@splinetool/runtime 2.0.11 → 2.0.13

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 (270) hide show
  1. package/build/{runtime-chunk-H3NZ2DPE.js → runtime-chunk-2GAIM5RJ.js} +1 -1
  2. package/build/runtime-chunk-2GAIM5RJ.js.br +0 -0
  3. package/build/runtime-chunk-2GAIM5RJ.js.gz +0 -0
  4. package/build/{runtime-chunk-ALDD75EK.js → runtime-chunk-2S2NQ44M.js} +1 -1
  5. package/build/runtime-chunk-2S2NQ44M.js.br +0 -0
  6. package/build/runtime-chunk-2S2NQ44M.js.gz +0 -0
  7. package/build/{runtime-chunk-7UK5TXXX.js → runtime-chunk-3IBXKX7I.js} +1 -1
  8. package/build/runtime-chunk-3IBXKX7I.js.br +0 -0
  9. package/build/runtime-chunk-3IBXKX7I.js.gz +0 -0
  10. package/build/{runtime-chunk-5GCT2MXQ.js → runtime-chunk-4GNBET46.js} +1 -1
  11. package/build/runtime-chunk-4GNBET46.js.br +0 -0
  12. package/build/runtime-chunk-4GNBET46.js.gz +0 -0
  13. package/build/{runtime-chunk-CSQ34B7E.js → runtime-chunk-5POGWSQZ.js} +1 -1
  14. package/build/runtime-chunk-5POGWSQZ.js.br +0 -0
  15. package/build/runtime-chunk-5POGWSQZ.js.gz +0 -0
  16. package/build/{runtime-chunk-MQKKQEK3.js → runtime-chunk-A7IMJ4FJ.js} +1 -1
  17. package/build/runtime-chunk-A7IMJ4FJ.js.br +0 -0
  18. package/build/{runtime-chunk-MQKKQEK3.js.gz → runtime-chunk-A7IMJ4FJ.js.gz} +0 -0
  19. package/build/{runtime-chunk-DX665HUE.js → runtime-chunk-ALTKMFUV.js} +1 -1
  20. package/build/runtime-chunk-ALTKMFUV.js.br +0 -0
  21. package/build/runtime-chunk-ALTKMFUV.js.gz +0 -0
  22. package/build/{runtime-chunk-DA36J6OU.js → runtime-chunk-BEWQ5BW5.js} +1 -1
  23. package/build/runtime-chunk-BEWQ5BW5.js.br +0 -0
  24. package/build/runtime-chunk-BEWQ5BW5.js.gz +0 -0
  25. package/build/{runtime-chunk-HLXTXF7I.js → runtime-chunk-ESL2VL5C.js} +1 -1
  26. package/build/runtime-chunk-ESL2VL5C.js.br +0 -0
  27. package/build/runtime-chunk-ESL2VL5C.js.gz +0 -0
  28. package/build/{runtime-chunk-4ENGAWL7.js → runtime-chunk-F5CUMYOK.js} +1 -1
  29. package/build/runtime-chunk-F5CUMYOK.js.br +0 -0
  30. package/build/runtime-chunk-F5CUMYOK.js.gz +0 -0
  31. package/build/{runtime-chunk-BY4Y72LZ.js → runtime-chunk-HKFPEE5F.js} +1 -1
  32. package/build/runtime-chunk-HKFPEE5F.js.br +0 -0
  33. package/build/runtime-chunk-HKFPEE5F.js.gz +0 -0
  34. package/build/{runtime-chunk-FJ3HZ257.js → runtime-chunk-ITI3UXPR.js} +1 -1
  35. package/build/runtime-chunk-ITI3UXPR.js.br +0 -0
  36. package/build/runtime-chunk-ITI3UXPR.js.gz +0 -0
  37. package/build/{runtime-chunk-O6F5QJHF.js → runtime-chunk-JIIVUL2M.js} +1 -1
  38. package/build/runtime-chunk-JIIVUL2M.js.br +0 -0
  39. package/build/runtime-chunk-JIIVUL2M.js.gz +0 -0
  40. package/build/{runtime-chunk-K3MY5TZT.js → runtime-chunk-JLL5C22M.js} +1 -1
  41. package/build/runtime-chunk-JLL5C22M.js.br +0 -0
  42. package/build/runtime-chunk-JLL5C22M.js.gz +0 -0
  43. package/build/{runtime-chunk-XT53PDQV.js → runtime-chunk-JSOWOATQ.js} +1 -1
  44. package/build/runtime-chunk-JSOWOATQ.js.br +0 -0
  45. package/build/runtime-chunk-JSOWOATQ.js.gz +0 -0
  46. package/build/{runtime-chunk-DQMOB5OU.js → runtime-chunk-MJYVLFQT.js} +1 -1
  47. package/build/runtime-chunk-MJYVLFQT.js.br +0 -0
  48. package/build/runtime-chunk-MJYVLFQT.js.gz +0 -0
  49. package/build/{runtime-chunk-FYQSEYL5.js → runtime-chunk-OUQPS3VD.js} +1 -1
  50. package/build/runtime-chunk-OUQPS3VD.js.br +0 -0
  51. package/build/runtime-chunk-OUQPS3VD.js.gz +0 -0
  52. package/build/{runtime-chunk-FBNDPGTS.js → runtime-chunk-PS74VRLB.js} +1 -1
  53. package/build/runtime-chunk-PS74VRLB.js.br +0 -0
  54. package/build/runtime-chunk-PS74VRLB.js.gz +0 -0
  55. package/build/{runtime-chunk-CUGQPKPQ.js → runtime-chunk-QMMGYOLW.js} +1 -1
  56. package/build/runtime-chunk-QMMGYOLW.js.br +0 -0
  57. package/build/runtime-chunk-QMMGYOLW.js.gz +0 -0
  58. package/build/{runtime-chunk-OWPKF7IL.js → runtime-chunk-SJQBQYDG.js} +1 -1
  59. package/build/runtime-chunk-SJQBQYDG.js.br +0 -0
  60. package/build/runtime-chunk-SJQBQYDG.js.gz +0 -0
  61. package/build/{runtime-chunk-NHLFGFU5.js → runtime-chunk-T4UMOSIQ.js} +1 -1
  62. package/build/runtime-chunk-T4UMOSIQ.js.br +0 -0
  63. package/build/runtime-chunk-T4UMOSIQ.js.gz +0 -0
  64. package/build/{runtime-chunk-I5YVCEFL.js → runtime-chunk-VAANBQKN.js} +1 -1
  65. package/build/runtime-chunk-VAANBQKN.js.br +0 -0
  66. package/build/runtime-chunk-VAANBQKN.js.gz +0 -0
  67. package/build/{runtime-chunk-AVO7AFZY.js → runtime-chunk-WILQUYJ4.js} +1 -1
  68. package/build/runtime-chunk-WILQUYJ4.js.br +0 -0
  69. package/build/runtime-chunk-WILQUYJ4.js.gz +0 -0
  70. package/build/{runtime-chunk-T7HEAOAP.js → runtime-chunk-WWYY25M2.js} +1 -1
  71. package/build/runtime-chunk-WWYY25M2.js.br +0 -0
  72. package/build/runtime-chunk-WWYY25M2.js.gz +0 -0
  73. package/build/{runtime-chunk-Q23Z6MJP.js → runtime-chunk-XUHTMJJD.js} +1 -1
  74. package/build/runtime-chunk-XUHTMJJD.js.br +0 -0
  75. package/build/runtime-chunk-XUHTMJJD.js.gz +0 -0
  76. package/build/{runtime-chunk-LEHYVJOU.js → runtime-chunk-YH55FWRI.js} +1 -1
  77. package/build/runtime-chunk-YH55FWRI.js.br +0 -0
  78. package/build/runtime-chunk-YH55FWRI.js.gz +0 -0
  79. package/build/{runtime-classicRuntime-K34VIFGP.js → runtime-classicRuntime-ZJP7UOQK.js} +1 -1
  80. package/build/runtime-classicRuntime-ZJP7UOQK.js.br +0 -0
  81. package/build/runtime-classicRuntime-ZJP7UOQK.js.gz +0 -0
  82. package/build/{runtime-cloners-3Y3EIRQD.js → runtime-cloners-V4TFNW2E.js} +1 -1
  83. package/build/runtime-cloners-V4TFNW2E.js.br +0 -0
  84. package/build/runtime-cloners-V4TFNW2E.js.gz +0 -0
  85. package/build/{runtime-components-OIRGNZ53.js → runtime-components-P5ZGYATF.js} +1 -1
  86. package/build/runtime-components-P5ZGYATF.js.br +0 -0
  87. package/build/runtime-components-P5ZGYATF.js.gz +0 -0
  88. package/build/{runtime-createDestroy-IXF6AHPT.js → runtime-createDestroy-MAV4GFE6.js} +1 -1
  89. package/build/runtime-createDestroy-MAV4GFE6.js.br +0 -0
  90. package/build/runtime-createDestroy-MAV4GFE6.js.gz +0 -0
  91. package/build/{runtime-dragDrop-XMMLZ4DN.js → runtime-dragDrop-IZ74WMYA.js} +1 -1
  92. package/build/runtime-dragDrop-IZ74WMYA.js.br +0 -0
  93. package/build/runtime-dragDrop-IZ74WMYA.js.gz +0 -0
  94. package/build/{runtime-gameControls-AJVDYQ34.js → runtime-gameControls-ALSYS4GT.js} +1 -1
  95. package/build/runtime-gameControls-ALSYS4GT.js.br +0 -0
  96. package/build/runtime-gameControls-ALSYS4GT.js.gz +0 -0
  97. package/build/{runtime-hair-LL7HBW3N.js → runtime-hair-PML4TDM4.js} +1 -1
  98. package/build/runtime-hair-PML4TDM4.js.br +1 -0
  99. package/build/runtime-hair-PML4TDM4.js.gz +0 -0
  100. package/build/{runtime-mergeStaticGeometries-SLURKUQL.js → runtime-mergeStaticGeometries-OPJK4T22.js} +1 -1
  101. package/build/runtime-mergeStaticGeometries-OPJK4T22.js.br +0 -0
  102. package/build/runtime-mergeStaticGeometries-OPJK4T22.js.gz +0 -0
  103. package/build/{runtime-miscActions-MYXVSOXT.js → runtime-miscActions-JZQXYHKG.js} +1 -1
  104. package/build/runtime-miscActions-JZQXYHKG.js.br +0 -0
  105. package/build/runtime-miscActions-JZQXYHKG.js.gz +0 -0
  106. package/build/{runtime-mouseHover-VNG5G3EV.js → runtime-mouseHover-FM43SWSA.js} +1 -1
  107. package/build/runtime-mouseHover-FM43SWSA.js.br +0 -0
  108. package/build/runtime-mouseHover-FM43SWSA.js.gz +0 -0
  109. package/build/{runtime-particles-WY5ERTQY.js → runtime-particles-NY5M47HQ.js} +1 -1
  110. package/build/runtime-particles-NY5M47HQ.js.br +0 -0
  111. package/build/runtime-particles-NY5M47HQ.js.gz +0 -0
  112. package/build/{runtime-paths-EBK4AK5D.js → runtime-paths-LU43LMTP.js} +1 -1
  113. package/build/runtime-paths-LU43LMTP.js.br +0 -0
  114. package/build/runtime-paths-LU43LMTP.js.gz +0 -0
  115. package/build/{runtime-resize-ARFL653M.js → runtime-resize-BWOD7P3W.js} +1 -1
  116. package/build/runtime-resize-BWOD7P3W.js.br +0 -0
  117. package/build/runtime-resize-BWOD7P3W.js.gz +0 -0
  118. package/build/{runtime-sceneTransition-U767Q26P.js → runtime-sceneTransition-4R6LM4MA.js} +1 -1
  119. package/build/runtime-sceneTransition-4R6LM4MA.js.br +0 -0
  120. package/build/runtime-sceneTransition-4R6LM4MA.js.gz +0 -0
  121. package/build/{runtime-scroll-PJN2KY5P.js → runtime-scroll-KEVND4W5.js} +1 -1
  122. package/build/runtime-scroll-KEVND4W5.js.br +0 -0
  123. package/build/runtime-scroll-KEVND4W5.js.gz +0 -0
  124. package/build/runtime-shapeBlends-LXJ4P3XD.js +1 -0
  125. package/build/runtime-shapeBlends-LXJ4P3XD.js.br +0 -0
  126. package/build/runtime-shapeBlends-LXJ4P3XD.js.gz +0 -0
  127. package/build/{runtime-text-BIQDLMVM.js → runtime-text-43V5BJGN.js} +1 -1
  128. package/build/runtime-text-43V5BJGN.js.br +0 -0
  129. package/build/runtime-text-43V5BJGN.js.gz +0 -0
  130. package/build/{runtime-textInputs-PBVRLIAG.js → runtime-textInputs-WPBZO7XI.js} +1 -1
  131. package/build/runtime-textInputs-WPBZO7XI.js.br +0 -0
  132. package/build/runtime-textInputs-WPBZO7XI.js.gz +0 -0
  133. package/build/{runtime-timeline-FZBQAKBM.js → runtime-timeline-AERFJWNC.js} +1 -1
  134. package/build/runtime-timeline-AERFJWNC.js.br +0 -0
  135. package/build/runtime-timeline-AERFJWNC.js.gz +0 -0
  136. package/build/{runtime-tracking-OGGWBM2F.js → runtime-tracking-T55DMPAI.js} +1 -1
  137. package/build/runtime-tracking-T55DMPAI.js.br +0 -0
  138. package/build/runtime-tracking-T55DMPAI.js.gz +0 -0
  139. package/build/{runtime-transitions-UZMSVIQQ.js → runtime-transitions-SLQEEKRO.js} +1 -1
  140. package/build/runtime-transitions-SLQEEKRO.js.br +0 -0
  141. package/build/runtime-transitions-SLQEEKRO.js.gz +0 -0
  142. package/build/{runtime-ui2d-3SFWWIHX.js → runtime-ui2d-FPEODT3M.js} +1 -1
  143. package/build/runtime-ui2d-FPEODT3M.js.br +0 -0
  144. package/build/runtime-ui2d-FPEODT3M.js.gz +0 -0
  145. package/build/{runtime-vectorShapes-LG23IGW6.js → runtime-vectorShapes-ZXLM5DCY.js} +1 -1
  146. package/build/runtime-vectorShapes-ZXLM5DCY.js.br +0 -0
  147. package/build/runtime-vectorShapes-ZXLM5DCY.js.gz +0 -0
  148. package/build/{runtime-webgpu-HA7LX6HX.js → runtime-webgpu-WHAEJKRX.js} +1 -1
  149. package/build/runtime-webgpu-WHAEJKRX.js.br +0 -0
  150. package/build/runtime-webgpu-WHAEJKRX.js.gz +0 -0
  151. package/build/runtime.cjs +5 -5
  152. package/build/runtime.js +1 -1
  153. package/build/runtime.js.br +0 -0
  154. package/build/runtime.js.gz +0 -0
  155. package/build/runtime.standalone.js +1 -1
  156. package/build/runtime.standalone.js.br +0 -0
  157. package/build/runtime.standalone.js.gz +0 -0
  158. package/build/runtime.standalone.webgl.js +1 -1
  159. package/build/runtime.standalone.webgl.js.br +0 -0
  160. package/build/runtime.standalone.webgl.js.gz +0 -0
  161. package/build/runtime.standalone.webgpu.js +1 -1
  162. package/build/runtime.standalone.webgpu.js.br +0 -0
  163. package/build/runtime.standalone.webgpu.js.gz +0 -0
  164. package/build/runtime.standalone.webgpu.micro.js +1 -1
  165. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  166. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  167. package/build/runtime.standalone.webgpu.min.js +1 -1
  168. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  169. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  170. package/package.json +1 -1
  171. package/build/runtime-chunk-4ENGAWL7.js.br +0 -0
  172. package/build/runtime-chunk-4ENGAWL7.js.gz +0 -0
  173. package/build/runtime-chunk-5GCT2MXQ.js.br +0 -0
  174. package/build/runtime-chunk-5GCT2MXQ.js.gz +0 -0
  175. package/build/runtime-chunk-7UK5TXXX.js.br +0 -0
  176. package/build/runtime-chunk-7UK5TXXX.js.gz +0 -0
  177. package/build/runtime-chunk-ALDD75EK.js.br +0 -0
  178. package/build/runtime-chunk-ALDD75EK.js.gz +0 -0
  179. package/build/runtime-chunk-AVO7AFZY.js.br +0 -0
  180. package/build/runtime-chunk-AVO7AFZY.js.gz +0 -0
  181. package/build/runtime-chunk-BY4Y72LZ.js.br +0 -0
  182. package/build/runtime-chunk-BY4Y72LZ.js.gz +0 -0
  183. package/build/runtime-chunk-CSQ34B7E.js.br +0 -0
  184. package/build/runtime-chunk-CSQ34B7E.js.gz +0 -0
  185. package/build/runtime-chunk-CUGQPKPQ.js.br +0 -0
  186. package/build/runtime-chunk-CUGQPKPQ.js.gz +0 -0
  187. package/build/runtime-chunk-DA36J6OU.js.br +0 -0
  188. package/build/runtime-chunk-DA36J6OU.js.gz +0 -0
  189. package/build/runtime-chunk-DQMOB5OU.js.br +0 -0
  190. package/build/runtime-chunk-DQMOB5OU.js.gz +0 -0
  191. package/build/runtime-chunk-DX665HUE.js.br +0 -0
  192. package/build/runtime-chunk-DX665HUE.js.gz +0 -0
  193. package/build/runtime-chunk-FBNDPGTS.js.br +0 -0
  194. package/build/runtime-chunk-FBNDPGTS.js.gz +0 -0
  195. package/build/runtime-chunk-FJ3HZ257.js.br +0 -0
  196. package/build/runtime-chunk-FJ3HZ257.js.gz +0 -0
  197. package/build/runtime-chunk-FYQSEYL5.js.br +0 -0
  198. package/build/runtime-chunk-FYQSEYL5.js.gz +0 -0
  199. package/build/runtime-chunk-H3NZ2DPE.js.br +0 -0
  200. package/build/runtime-chunk-H3NZ2DPE.js.gz +0 -0
  201. package/build/runtime-chunk-HLXTXF7I.js.br +0 -0
  202. package/build/runtime-chunk-HLXTXF7I.js.gz +0 -0
  203. package/build/runtime-chunk-I5YVCEFL.js.br +0 -0
  204. package/build/runtime-chunk-I5YVCEFL.js.gz +0 -0
  205. package/build/runtime-chunk-K3MY5TZT.js.br +0 -0
  206. package/build/runtime-chunk-K3MY5TZT.js.gz +0 -0
  207. package/build/runtime-chunk-LEHYVJOU.js.br +0 -0
  208. package/build/runtime-chunk-LEHYVJOU.js.gz +0 -0
  209. package/build/runtime-chunk-MQKKQEK3.js.br +0 -0
  210. package/build/runtime-chunk-NHLFGFU5.js.br +0 -0
  211. package/build/runtime-chunk-NHLFGFU5.js.gz +0 -0
  212. package/build/runtime-chunk-O6F5QJHF.js.br +0 -0
  213. package/build/runtime-chunk-O6F5QJHF.js.gz +0 -0
  214. package/build/runtime-chunk-OWPKF7IL.js.br +0 -0
  215. package/build/runtime-chunk-OWPKF7IL.js.gz +0 -0
  216. package/build/runtime-chunk-Q23Z6MJP.js.br +0 -0
  217. package/build/runtime-chunk-Q23Z6MJP.js.gz +0 -0
  218. package/build/runtime-chunk-T7HEAOAP.js.br +0 -0
  219. package/build/runtime-chunk-T7HEAOAP.js.gz +0 -0
  220. package/build/runtime-chunk-XT53PDQV.js.br +0 -0
  221. package/build/runtime-chunk-XT53PDQV.js.gz +0 -0
  222. package/build/runtime-classicRuntime-K34VIFGP.js.br +0 -0
  223. package/build/runtime-classicRuntime-K34VIFGP.js.gz +0 -0
  224. package/build/runtime-cloners-3Y3EIRQD.js.br +0 -1
  225. package/build/runtime-cloners-3Y3EIRQD.js.gz +0 -0
  226. package/build/runtime-components-OIRGNZ53.js.br +0 -0
  227. package/build/runtime-components-OIRGNZ53.js.gz +0 -0
  228. package/build/runtime-createDestroy-IXF6AHPT.js.br +0 -0
  229. package/build/runtime-createDestroy-IXF6AHPT.js.gz +0 -0
  230. package/build/runtime-dragDrop-XMMLZ4DN.js.br +0 -0
  231. package/build/runtime-dragDrop-XMMLZ4DN.js.gz +0 -0
  232. package/build/runtime-gameControls-AJVDYQ34.js.br +0 -0
  233. package/build/runtime-gameControls-AJVDYQ34.js.gz +0 -0
  234. package/build/runtime-hair-LL7HBW3N.js.br +0 -2
  235. package/build/runtime-hair-LL7HBW3N.js.gz +0 -0
  236. package/build/runtime-mergeStaticGeometries-SLURKUQL.js.br +0 -0
  237. package/build/runtime-mergeStaticGeometries-SLURKUQL.js.gz +0 -0
  238. package/build/runtime-miscActions-MYXVSOXT.js.br +0 -0
  239. package/build/runtime-miscActions-MYXVSOXT.js.gz +0 -0
  240. package/build/runtime-mouseHover-VNG5G3EV.js.br +0 -0
  241. package/build/runtime-mouseHover-VNG5G3EV.js.gz +0 -0
  242. package/build/runtime-particles-WY5ERTQY.js.br +0 -0
  243. package/build/runtime-particles-WY5ERTQY.js.gz +0 -0
  244. package/build/runtime-paths-EBK4AK5D.js.br +0 -0
  245. package/build/runtime-paths-EBK4AK5D.js.gz +0 -0
  246. package/build/runtime-resize-ARFL653M.js.br +0 -0
  247. package/build/runtime-resize-ARFL653M.js.gz +0 -0
  248. package/build/runtime-sceneTransition-U767Q26P.js.br +0 -0
  249. package/build/runtime-sceneTransition-U767Q26P.js.gz +0 -0
  250. package/build/runtime-scroll-PJN2KY5P.js.br +0 -0
  251. package/build/runtime-scroll-PJN2KY5P.js.gz +0 -0
  252. package/build/runtime-shapeBlends-QL2RV3WU.js +0 -1
  253. package/build/runtime-shapeBlends-QL2RV3WU.js.br +0 -4
  254. package/build/runtime-shapeBlends-QL2RV3WU.js.gz +0 -0
  255. package/build/runtime-text-BIQDLMVM.js.br +0 -0
  256. package/build/runtime-text-BIQDLMVM.js.gz +0 -0
  257. package/build/runtime-textInputs-PBVRLIAG.js.br +0 -0
  258. package/build/runtime-textInputs-PBVRLIAG.js.gz +0 -0
  259. package/build/runtime-timeline-FZBQAKBM.js.br +0 -0
  260. package/build/runtime-timeline-FZBQAKBM.js.gz +0 -0
  261. package/build/runtime-tracking-OGGWBM2F.js.br +0 -0
  262. package/build/runtime-tracking-OGGWBM2F.js.gz +0 -0
  263. package/build/runtime-transitions-UZMSVIQQ.js.br +0 -0
  264. package/build/runtime-transitions-UZMSVIQQ.js.gz +0 -0
  265. package/build/runtime-ui2d-3SFWWIHX.js.br +0 -0
  266. package/build/runtime-ui2d-3SFWWIHX.js.gz +0 -0
  267. package/build/runtime-vectorShapes-LG23IGW6.js.br +0 -0
  268. package/build/runtime-vectorShapes-LG23IGW6.js.gz +0 -0
  269. package/build/runtime-webgpu-HA7LX6HX.js.br +0 -0
  270. package/build/runtime-webgpu-HA7LX6HX.js.gz +0 -0
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-T7HEAOAP.js";import{d as e}from"./runtime-chunk-DA36J6OU.js";import{Sc as s}from"./runtime-chunk-BVVSZMXD.js";var r=class extends(e(s,t)){constructor(t,e,s){super(),this.super_Entity(t,e),this.context=s,this.objectHelper.update()}updateState(t,e){this.updateState_Entity(t,e)}};export{r as a};
1
+ import{a as t}from"./runtime-chunk-WWYY25M2.js";import{d as e}from"./runtime-chunk-BEWQ5BW5.js";import{Sc as s}from"./runtime-chunk-BVVSZMXD.js";var r=class extends(e(s,t)){constructor(t,e,s){super(),this.super_Entity(t,e),this.context=s,this.objectHelper.update()}updateState(t,e){this.updateState_Entity(t,e)}};export{r as a};
@@ -1 +1 @@
1
- import{a as e,b as t}from"./runtime-chunk-FYQSEYL5.js";import{b as a,e as i,g as r}from"./runtime-chunk-Q23Z6MJP.js";import{a as s}from"./runtime-chunk-TU4KDRKR.js";import{a as n}from"./runtime-chunk-AVO7AFZY.js";import{a as l,b as o}from"./runtime-chunk-I5YVCEFL.js";import{T as h,d as u,da as c,e as d,h as p}from"./runtime-chunk-BY4Y72LZ.js";import{b as y,h as m,j as g,v as f}from"./runtime-chunk-MQKKQEK3.js";import{c as b}from"./runtime-chunk-2PT2WH66.js";import{c as v,l as C}from"./runtime-chunk-TZCHGFVF.js";import{qa as S,ta as k,w as A,za as w}from"./runtime-chunk-D3BWEUN6.js";import{Ne as F,Oc as L,Tc as O,Uc as j,Vc as B,cd as H,jd as M,ld as T,ve as D}from"./runtime-chunk-BVVSZMXD.js";function U(e){return e instanceof c&&e.needsAO&&!b(e)&&!0!==e.isDecalObject}function z(e){let t=e.cloner;if(t&&Array.isArray(t.children))for(let a of t.children)a?.layers&&(a.layers.mask=e.layers.mask)}function E(e){return e.getLayersOfType("reflection").filter(e=>e.data.visible).length}function P(e){return e.getLayersOfType("reflection").some(e=>e.data.visible&&1===e.data.mirror)}function x(e){let t=1/0,a=-1/0;for(let i of e.getLayersOfType("reflection")){let e=i.data;if(!e.visible||1===e.mirror)continue;let r="number"==typeof e.blur?e.blur:null;t=Math.min(t,r??0),a=Math.max(a,r??10)}return t===1/0?null:{min:t,max:a}}function I(e){for(let t of e.getLayersOfType("reflection")){let e=t.data;if(!e.visible)continue;let{blur:a,thickness:i,steps:r,stepSize:s}=e;return"number"!=typeof a||"number"!=typeof i||"number"!=typeof r||"number"!=typeof s?"variable":{blur:a,thickness:i,steps:r,stepSize:s,tracingMode:1===e.tracingMode?1:0}}return null}function V(e,t){let a={outline:!1,cavity:!1},i=512&e.layers.mask,r=t.getLayersOfType("transmission"),s=t.getLayersOfType("outline"),n=E(t),h=t.getLayersOfType("cavity");return(s.length>0||h.length>0)&&(e.layers.set(8),r.length>0&&e.layers.enable(3),n>0&&e.layers.enable(4),a.outline=s.length>0,a.cavity=h.length>0,o(e),l(e)),0===r.length&&0===s.length&&0===h.length&&0===n&&e.layers.set(0),i&&e.layers.set(9),!i&&U(e)&&e.layers.enable(5),z(e),a}function W(e,t){if(!t.layers)return!1;let a=512&e.layers.mask,i=!1,r=t.getLayersOfType("transmission").filter(e=>e.data.visible),s=t.getLayersOfType("outline").filter(e=>e.data.visible),n=E(t),l=t.getLayersOfType("cavity").filter(e=>e.data.visible);return r.length>0&&(e.layers.set(3),(s.length>0||l.length>0)&&e.layers.enable(8),n>0&&e.layers.enable(4),i=!0),0===r.length&&0===s.length&&0===l.length&&0===n&&e.layers.set(0),a&&e.layers.set(9),!a&&U(e)&&e.layers.enable(5),z(e),i}function Q(e,t){var a;if(!t.layers)return!1;let i=512&e.layers.mask,r=!1,s=E(t),n=t.getLayersOfType("transmission").filter(e=>e.data.visible),l=t.getLayersOfType("outline").filter(e=>e.data.visible),o=t.getLayersOfType("cavity").filter(e=>e.data.visible);return s>0&&((a=e.userData).__splinePlanarMirror??(a.__splinePlanarMirror=0),e.layers.set(4),n.length>0&&e.layers.enable(3),(l.length>0||o.length>0)&&e.layers.enable(8),r=!0),0===s&&0===n.length&&0===l.length&&0===o.length&&e.layers.set(0),i&&e.layers.set(9),!i&&U(e)&&e.layers.enable(5),z(e),r}function Y(e){let t={outline:!1,cavity:!1},a=e=>{t.outline=t.outline||e.outline,t.cavity=t.cavity||e.cavity};return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let t=0;t<e.material.length;t++)a(V(e,e.material[t]));else a(V(e,e.material))}),t}function _(e){let t=!1;return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let a=0;a<e.material.length;a++)W(e,e.material[a])&&(t=!0);else W(e,e.material)&&(t=!0)}),t}function K(e){let t=!1;return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let a=0;a<e.material.length;a++)Q(e,e.material[a])&&(t=!0);else Q(e,e.material)&&(t=!0)}),t}var Z=new F,G=new L,R=new M,N=new H;function q(e,t,a,i=!1){let r=e.cloner;if(r){let s=null;if(e.raycast===T.prototype.raycast||e.raycast===f.prototype.raycast){let t=e.geometry;t&&(null===t.boundingSphere&&t.computeBoundingSphere(),s=t.boundingSphere)}for(let n of r.children){if(null!==s&&(N.copy(s).applyMatrix4(n.matrixWorld),!t.ray.intersectsSphere(N)))continue;let r=G.copy(n.matrixWorld).invert(),l=R.copy(t.ray).applyMatrix4(r),o=e.matrixWorld;l.applyMatrix4(o);let h=Z;h.set(l.origin,l.direction),h.near=t.near,h.far=t.far,h.layers.mask=t.layers.mask;let u=h.intersectObject(e,!1);u.length>0&&a.push({...u[0],object:i?n:e})}}}var J=class extends(g(B)){constructor(e,t,a){if(super(),this.data=t,this.bgColor=new p(1,1,1,1),this.fog=null,this.backupFog=new j(16777215,.1,2e3),this.fogUseBGColor=!1,this.fogMode="linear",this.fogDensity=S.getDensity({}),this.fogHeightFalloff=S.getHeightFalloff({}),this.fogHeightBase=S.getHeightBase({}),this.isActive=!1,this.skyState=null,this.skyStateVersion=0,this.gradingState=null,this.skyHdriHolder=null,this.aoColor=new O,this.penumbraSizeArrayCache=null,this.super_Entity(e,t),this.personalCamera=new n(A,{...w.defaultData,...t.camera,name:"Personal Camera"}),this.personalCamera.objectHelper.visible=!1,this.add(this.personalCamera),this.activeCamera=this.personalCamera,this.ambientLight=new D(13882323,8553090,.75*Math.PI),this.ambientLight.name="Default Ambient Light",this.ambientLight.layers.enable(3),this.ambientLight.removeFromParent(),this.add(this.ambientLight),t.uiScene){let i=C();null===i?v("ui-2d","a page's 2D scene"):this.uiScene=new i.Scene2D((Array.isArray(e)?e[0]:e)+"-ui",t.uiScene,{dpr:window.devicePixelRatio,shared:a.shared})}else t.uiFrame&&this.createUICanvas(t.uiFrame,a)}get scene(){return this.parent}get postprocessing(){return this.data.postprocessing}get frameId(){return this.data.uiFrame}get frame(){return this.uiCanvas?.frame}createUICanvas(e,t){let a=C();null!==a?(this.uiCanvas=new a.UICanvas(this.uuid+"-uiscreen",window.innerWidth,window.innerHeight,t),this.uiCanvas.isScreenSpace=!0,this.uiCanvas.promise.then(()=>{this.uiCanvas?.applyFrame(e),this.uiCanvas?.applySize()})):v("ui-2d","a page's UI canvas")}updateVisible(){}setBackgroundColor(e){this.bgColor=e,!0===this.fogUseBGColor&&(this.backupFog.color=e)}entityChildrenCount(){return this.uiScene?this.uiScene.children.length:super.entityChildrenCount()}updateAmbientLight(e,t){void 0!==e.color&&(this.ambientLight.color=s(e.color,t)),void 0!==e.intensity&&(this.ambientLight.intensity=e.intensity*Math.PI),void 0!==e.enabled&&(e.enabled?this.add(this.ambientLight):this.remove(this.ambientLight))}onDeactive(){this.isActive=!1}onActive(e){this.isActive=!0,e.fog=this.fog,this.traverseEntity(e=>{e instanceof a&&e.recomputeBoolean()}),this.updateShadow(this.data.shadow)}forceMaterialsUpdate(){this.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let t of e.material)t.needsUpdate=!0;else e.material.needsUpdate=!0,e.material.dispose()})}updateShadow(e){if(void 0===e.softShadowQuality&&void 0===e.type||!this.isActive)return;let t=this.data.shadow,a=k.isSoft(t);h(a,t?.softShadowQuality)&&this.forceMaterialsUpdate()}updateFog(e,t){e.enabled?this.fog=this.backupFog:this.fog=null,this.isActive&&(this.scene.fog=this.fog),this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=s(e.color,t),this.backupFog.near=e.near,this.backupFog.far=e.far,this.fogMode=S.getMode(e),this.fogDensity=S.getDensity(e),this.fogHeightFalloff=S.getHeightFalloff(e),this.fogHeightBase=S.getHeightBase(e)}updateSky(e,t){this.skyState=e??null,this.skyStateVersion++;let a=e?.hdri?.image;this.skyHdriHolder=null!=a?t.image(a):null}updateAo(e,t){void 0!==e.aoColor&&(this.aoColor=s(e.aoColor,t))}updateByOp(e,t,a,i){let r=this.data.uiFrame;super.updateByOp(e,t,a,i);let s=t;y(e.path,["fog"])?this.updateFog(s.fog,a.shared):y(e.path,["sky"])?this.updateSky(s.sky,a.shared):y(e.path,["grading"])?this.gradingState=s.grading??null:y(e.path,["ao"])?this.updateAo(s.ao,a.shared):y(e.path,["ambient"])?this.updateAmbientLight(s.ambient,a.shared):y(e.path,["shadow"])?this.updateShadow(s.shadow):0===e.type&&0===e.path.length&&(void 0!==e.props.uiFrame||r!==s.uiFrame)&&this.updateUIFrame(e.props.uiFrame,a)}updateUIFrame(e,t){e?(this.uiCanvas||this.createUICanvas(e,t),this.uiCanvas.enabled=!0,this.uiCanvas.applyFrame(e)):this.uiCanvas&&(this.uiCanvas.enabled=!1)}updateState(e,t){this.updateState_Entity(e,t),void 0!==e.backgroundColor&&this.setBackgroundColor(s(e.backgroundColor,t.shared)),void 0!==e.fog&&this.updateFog(e.fog,t.shared),void 0!==e.sky&&this.updateSky(e.sky,t.shared),void 0!==e.grading&&(this.gradingState=e.grading),void 0!==e.ambient&&this.updateAmbientLight(e.ambient,t.shared),void 0!==e.ao&&this.updateAo(e.ao,t.shared),void 0!==e.shadow&&this.updateShadow(e.shadow)}createFrame(e,t){}raycast(e,t){super.raycast(e,t)}switchActiveCamera(e){e&&e.isDescendantOf(this)&&(this.activeCamera!==this.personalCamera&&(this.activeCamera.objectHelper.visible=!0),this.activeCamera=e,e.objectHelper.visible=!1)}get playCamera(){return this.scene?.find(this.data.publish.playCamera)??this.personalCamera}switchToPlayCamera(){this.switchActiveCamera(this.playCamera)}get penumbraSizeArray(){return null===this.penumbraSizeArrayCache&&this.updatePenumbraSizeArray(),this.penumbraSizeArrayCache}updatePenumbraSizeArray(){this.penumbraSizeArrayCache=new Array(u).fill(.5);let a=0,i=0;this.traverseEntity(r=>{if(!r.visible)return!0;r instanceof e&&r.visible&&a<d&&(this.penumbraSizeArrayCache[a]=r.data.penumbraSize??.5,a+=1),r instanceof t&&r.visible&&a<u-d&&(this.penumbraSizeArrayCache[d+i]=r.data.penumbraSize??.5,i+=1)})}raycastWithClones(e){let t=[],a=s=>{for(let n of s.children){let s=n.cloner;m.is(n)&&(n.visible||s?.object.data.visible)&&((i(n)||r(n)&&this.scene.enableHelpers&&n.objectHelper.visible)&&(e.intersectObject(n,!1,t),q(n,e,t,!0)),a(n))}};return a(this),t}updateEntity2DByOp(e,t,a,i){this.uiCanvas?.updateEntity2DByOp(e,t,a,i)}};export{P as a,x as b,I as c,Y as d,_ as e,K as f,q as g,J as h};
1
+ import{a as e,b as t}from"./runtime-chunk-OUQPS3VD.js";import{b as a,e as i,g as r}from"./runtime-chunk-XUHTMJJD.js";import{a as s}from"./runtime-chunk-TU4KDRKR.js";import{a as n}from"./runtime-chunk-WILQUYJ4.js";import{a as l,b as o}from"./runtime-chunk-VAANBQKN.js";import{T as h,d as u,da as c,e as d,h as p}from"./runtime-chunk-HKFPEE5F.js";import{b as y,h as m,j as g,v as f}from"./runtime-chunk-A7IMJ4FJ.js";import{c as b}from"./runtime-chunk-2PT2WH66.js";import{c as v,l as C}from"./runtime-chunk-TZCHGFVF.js";import{qa as S,ta as k,w as A,za as w}from"./runtime-chunk-D3BWEUN6.js";import{Ne as F,Oc as L,Tc as O,Uc as j,Vc as H,cd as B,jd as T,ld as U,ve as D}from"./runtime-chunk-BVVSZMXD.js";function M(e){return e instanceof c&&e.needsAO&&!b(e)&&!0!==e.isDecalObject}function z(e){let t=e.cloner;if(t&&Array.isArray(t.children))for(let a of t.children)a?.layers&&(a.layers.mask=e.layers.mask)}function E(e){return e.getLayersOfType("reflection").filter(e=>e.data.visible).length}function P(e){return e.getLayersOfType("reflection").some(e=>e.data.visible&&1===e.data.mirror)}function I(e){let t=1/0,a=-1/0;for(let i of e.getLayersOfType("reflection")){let e=i.data;if(!e.visible||1===e.mirror)continue;let r="number"==typeof e.blur?e.blur:null;t=Math.min(t,r??0),a=Math.max(a,r??10)}return t===1/0?null:{min:t,max:a}}function x(e){for(let t of e.getLayersOfType("reflection")){let e=t.data;if(!e.visible)continue;let{blur:a,thickness:i,steps:r,stepSize:s}=e;return"number"!=typeof a||"number"!=typeof i||"number"!=typeof r||"number"!=typeof s?"variable":{blur:a,thickness:i,steps:r,stepSize:s,tracingMode:1===e.tracingMode?1:0}}return null}function V(e,t){let a={outline:!1,cavity:!1},i=512&e.layers.mask,r=t.getLayersOfType("transmission"),s=t.getLayersOfType("outline"),n=E(t),h=t.getLayersOfType("cavity");return(s.length>0||h.length>0)&&(e.layers.set(8),r.length>0&&e.layers.enable(3),n>0&&e.layers.enable(4),a.outline=s.length>0,a.cavity=h.length>0,o(e),l(e)),0===r.length&&0===s.length&&0===h.length&&0===n&&e.layers.set(0),i&&e.layers.set(9),!i&&M(e)&&e.layers.enable(5),z(e),a}function W(e,t){if(!t.layers)return!1;let a=512&e.layers.mask,i=!1,r=t.getLayersOfType("transmission").filter(e=>e.data.visible),s=t.getLayersOfType("outline").filter(e=>e.data.visible),n=E(t),l=t.getLayersOfType("cavity").filter(e=>e.data.visible);return r.length>0&&(e.layers.set(3),(s.length>0||l.length>0)&&e.layers.enable(8),n>0&&e.layers.enable(4),i=!0),0===r.length&&0===s.length&&0===l.length&&0===n&&e.layers.set(0),a&&e.layers.set(9),!a&&M(e)&&e.layers.enable(5),z(e),i}function _(e,t){var a;if(!t.layers)return!1;let i=512&e.layers.mask,r=!1,s=E(t),n=t.getLayersOfType("transmission").filter(e=>e.data.visible),l=t.getLayersOfType("outline").filter(e=>e.data.visible),o=t.getLayersOfType("cavity").filter(e=>e.data.visible);return s>0&&((a=e.userData).__splinePlanarMirror??(a.__splinePlanarMirror=0),e.layers.set(4),n.length>0&&e.layers.enable(3),(l.length>0||o.length>0)&&e.layers.enable(8),r=!0),0===s&&0===n.length&&0===l.length&&0===o.length&&e.layers.set(0),i&&e.layers.set(9),!i&&M(e)&&e.layers.enable(5),z(e),r}function J(e){let t={outline:!1,cavity:!1},a=e=>{t.outline=t.outline||e.outline,t.cavity=t.cavity||e.cavity};return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let t=0;t<e.material.length;t++)a(V(e,e.material[t]));else a(V(e,e.material))}),t}function Q(e){let t=!1;return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let a=0;a<e.material.length;a++)W(e,e.material[a])&&(t=!0);else W(e,e.material)&&(t=!0)}),t}function G(e){let t=!1;return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let a=0;a<e.material.length;a++)_(e,e.material[a])&&(t=!0);else _(e,e.material)&&(t=!0)}),t}var K=new F,N=new L,R=new T,X=new B;function Z(e,t,a,i=!1){let r=e.cloner;if(r){let s=null;if(e.raycast===U.prototype.raycast||e.raycast===f.prototype.raycast){let t=e.geometry;t&&(null===t.boundingSphere&&t.computeBoundingSphere(),s=t.boundingSphere)}for(let n of r.children){if(null!==s&&(X.copy(s).applyMatrix4(n.matrixWorld),!t.ray.intersectsSphere(X)))continue;let r=N.copy(n.matrixWorld).invert(),l=R.copy(t.ray).applyMatrix4(r),o=e.matrixWorld;l.applyMatrix4(o);let h=K;h.set(l.origin,l.direction),h.near=t.near,h.far=t.far,h.layers.mask=t.layers.mask;let u=h.intersectObject(e,!1);u.length>0&&a.push({...u[0],object:i?n:e})}}}var q=class extends(g(H)){constructor(e,t,a){if(super(),this.data=t,this.bgColor=new p(1,1,1,1),this.fog=null,this.backupFog=new j(16777215,.1,2e3),this.fogUseBGColor=!1,this.fogMode="linear",this.fogDensity=S.getDensity({}),this.fogHeightFalloff=S.getHeightFalloff({}),this.fogHeightBase=S.getHeightBase({}),this.isActive=!1,this.skyState=null,this.skyStateVersion=0,this.gradingState=null,this.skyHdriHolder=null,this.aoColor=new O,this.penumbraSizeArrayCache=null,this.super_Entity(e,t),this.personalCamera=new n(A,{...w.defaultData,...t.camera,name:"Personal Camera"}),this.personalCamera.objectHelper.visible=!1,this.add(this.personalCamera),this.activeCamera=this.personalCamera,this.ambientLight=new D(13882323,8553090,.75*Math.PI),this.ambientLight.name="Default Ambient Light",this.ambientLight.layers.enable(3),this.ambientLight.removeFromParent(),this.add(this.ambientLight),t.uiScene){let i=C();null===i?v("ui-2d","a page's 2D scene"):this.uiScene=new i.Scene2D((Array.isArray(e)?e[0]:e)+"-ui",t.uiScene,{dpr:window.devicePixelRatio,shared:a.shared})}else t.uiFrame&&this.createUICanvas(t.uiFrame,a)}get scene(){return this.parent}get postprocessing(){return this.data.postprocessing}get frameId(){return this.data.uiFrame}get frame(){return this.uiCanvas?.frame}createUICanvas(e,t){let a=C();null!==a?(this.uiCanvas=new a.UICanvas(this.uuid+"-uiscreen",window.innerWidth,window.innerHeight,t),this.uiCanvas.isScreenSpace=!0,this.uiCanvas.promise.then(()=>{this.uiCanvas?.applyFrame(e),this.uiCanvas?.applySize()})):v("ui-2d","a page's UI canvas")}updateVisible(){}setBackgroundColor(e){this.bgColor=e,!0===this.fogUseBGColor&&(this.backupFog.color=e)}entityChildrenCount(){return this.uiScene?this.uiScene.children.length:super.entityChildrenCount()}updateAmbientLight(e,t){void 0!==e.color&&(this.ambientLight.color=s(e.color,t)),void 0!==e.intensity&&(this.ambientLight.intensity=e.intensity*Math.PI),void 0!==e.enabled&&(e.enabled?this.add(this.ambientLight):this.remove(this.ambientLight))}onDeactive(){this.isActive=!1}onActive(e){this.isActive=!0,e.fog=this.fog,this.traverseEntity(e=>{e instanceof a&&e.recomputeBoolean()}),this.updateShadow(this.data.shadow)}forceMaterialsUpdate(){this.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let t of e.material)t.needsUpdate=!0;else e.material.needsUpdate=!0,e.material.dispose()})}updateShadow(e){if(void 0===e.softShadowQuality&&void 0===e.type||!this.isActive)return;let t=this.data.shadow,a=k.isSoft(t);h(a,t?.softShadowQuality)&&this.forceMaterialsUpdate()}updateFog(e,t){e.enabled?this.fog=this.backupFog:this.fog=null,this.isActive&&(this.scene.fog=this.fog),this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=s(e.color,t),this.backupFog.near=e.near,this.backupFog.far=e.far,this.fogMode=S.getMode(e),this.fogDensity=S.getDensity(e),this.fogHeightFalloff=S.getHeightFalloff(e),this.fogHeightBase=S.getHeightBase(e)}updateSky(e,t){this.skyState=e??null,this.skyStateVersion++;let a=e?.hdri?.image;this.skyHdriHolder=null!=a?t.image(a):null}updateAo(e,t){void 0!==e.aoColor&&(this.aoColor=s(e.aoColor,t))}updateByOp(e,t,a,i){let r=this.data.uiFrame;super.updateByOp(e,t,a,i);let s=t;y(e.path,["fog"])?this.updateFog(s.fog,a.shared):y(e.path,["sky"])?this.updateSky(s.sky,a.shared):y(e.path,["grading"])?this.gradingState=s.grading??null:y(e.path,["ao"])?this.updateAo(s.ao,a.shared):y(e.path,["ambient"])?this.updateAmbientLight(s.ambient,a.shared):y(e.path,["shadow"])?this.updateShadow(s.shadow):0===e.type&&0===e.path.length&&(void 0!==e.props.uiFrame||r!==s.uiFrame)&&this.updateUIFrame(e.props.uiFrame,a)}updateUIFrame(e,t){e?(this.uiCanvas||this.createUICanvas(e,t),this.uiCanvas.enabled=!0,this.uiCanvas.applyFrame(e)):this.uiCanvas&&(this.uiCanvas.enabled=!1)}updateState(e,t){this.updateState_Entity(e,t),void 0!==e.backgroundColor&&this.setBackgroundColor(s(e.backgroundColor,t.shared)),void 0!==e.fog&&this.updateFog(e.fog,t.shared),void 0!==e.sky&&this.updateSky(e.sky,t.shared),void 0!==e.grading&&(this.gradingState=e.grading),void 0!==e.ambient&&this.updateAmbientLight(e.ambient,t.shared),void 0!==e.ao&&this.updateAo(e.ao,t.shared),void 0!==e.shadow&&this.updateShadow(e.shadow)}createFrame(e,t){}raycast(e,t){super.raycast(e,t)}switchActiveCamera(e){e&&e.isDescendantOf(this)&&(this.activeCamera!==this.personalCamera&&(this.activeCamera.objectHelper.visible=!0),this.activeCamera=e,e.objectHelper.visible=!1)}get playCamera(){return this.scene?.find(this.data.publish.playCamera)??this.personalCamera}switchToPlayCamera(){this.switchActiveCamera(this.playCamera)}get penumbraSizeArray(){return null===this.penumbraSizeArrayCache&&this.updatePenumbraSizeArray(),this.penumbraSizeArrayCache}updatePenumbraSizeArray(){this.penumbraSizeArrayCache=new Array(u).fill(.5);let a=0,i=0;this.traverseEntity(r=>{if(!r.visible)return!0;r instanceof e&&r.visible&&a<d&&(this.penumbraSizeArrayCache[a]=r.data.penumbraSize??.5,a+=1),r instanceof t&&r.visible&&a<u-d&&(this.penumbraSizeArrayCache[d+i]=r.data.penumbraSize??.5,i+=1)})}raycastWithClones(e){let t=[],a=s=>{for(let n of s.children){let s=n.cloner;m.is(n)&&(n.visible||s?.object.data.visible)&&((i(n)||r(n)&&this.scene.enableHelpers&&n.objectHelper.visible)&&(e.intersectObject(n,!1,t),Z(n,e,t,!0)),a(n))}};return a(this),t}updateEntity2DByOp(e,t,a,i){this.uiCanvas?.updateEntity2DByOp(e,t,a,i)}};export{P as a,I as b,x as c,J as d,Q as e,G as f,Z as g,q as h};
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-T7HEAOAP.js";import{d as e}from"./runtime-chunk-DA36J6OU.js";import{Sc as s}from"./runtime-chunk-BVVSZMXD.js";var r=class extends(e(s,t)){constructor(t,e){super(),this.super_Entity(t,e),this.objectHelper.update(),"Empty"===this.data.type&&(this.objectHelper.visible=!1)}updateState(t,e){this.updateState_Entity(t,e),"buffer"in t&&1===Object.keys(t).length&&e.scene.reloadSplats()}};export{r as a};
1
+ import{a as t}from"./runtime-chunk-WWYY25M2.js";import{d as e}from"./runtime-chunk-BEWQ5BW5.js";import{Sc as s}from"./runtime-chunk-BVVSZMXD.js";var r=class extends(e(s,t)){constructor(t,e){super(),this.super_Entity(t,e),this.objectHelper.update(),"Empty"===this.data.type&&(this.objectHelper.visible=!1)}updateState(t,e){this.updateState_Entity(t,e),"buffer"in t&&1===Object.keys(t).length&&e.scene.reloadSplats()}};export{r as a};
@@ -1 +1 @@
1
- import{h as n}from"./runtime-chunk-MQKKQEK3.js";function e(o){if(o.component){let t=o.component.instances.indexOf(o);t>=0&&o.component.instances.splice(t,1);for(let t of o.children)n.is(t)&&e(t)}}export{e as a};
1
+ import{h as n}from"./runtime-chunk-A7IMJ4FJ.js";function e(o){if(o.component){let t=o.component.instances.indexOf(o);t>=0&&o.component.instances.splice(t,1);for(let t of o.children)n.is(t)&&e(t)}}export{e as a};
@@ -1 +1 @@
1
- import{d as s}from"./runtime-chunk-Q23Z6MJP.js";import{a as t,b as i}from"./runtime-chunk-DA36J6OU.js";import{Fc as a,Tc as o,Te as e,We as h,Xc as r,ze as d}from"./runtime-chunk-BVVSZMXD.js";var n=class extends(t(e)){constructor(s,t=15,i=6710886){super(s,t,i),this.object=s,this.name=`PointLightHelper: ${s.uuid}`}raycast(s,t){i(this.object,n.geometryHelper,s,t)}},p=class extends(s(d,n)){constructor(s,t,i){super(),this.super_Entity(s,t),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let e=this.shadow.camera;e.fov=90,e.aspect=1,e.near=100,e.far=2500;let d=new a(-e.far+this.position.x,-e.far+this.position.y,-e.far+this.position.z),n=new a(e.far+this.position.x,e.far+this.position.y,e.far+this.position.z),p=new r(d,n),c=new h(p,new o(16755200));c.visible=!1,this.gizmos.shadowmap=c,this.update()}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this.gizmos))for(let s in this.gizmos){let t=this.gizmos[s];if(t instanceof h){let s=this.shadow.camera,i=new a(-s.far+this.position.x,-s.far+this.position.y,-s.far+this.position.z),o=new a(s.far+this.position.x,s.far+this.position.y,s.far+this.position.z);t.box.set(i,o),t.updateMatrixWorld(!0)}}}updateMatrixWorld(s){super.updateMatrixWorld(s),this.objectHelper&&this.objectHelper.update()}updateState(s,t){this.updateState_Light(s,t),void 0!==s.distance&&(this.distance=s.distance),void 0!==s.decay&&(this.decay=s.decay),void 0!==s.shadowRadius&&(this.shadow.radius=s.shadowRadius),void 0!==s.shadowResolution&&(this.shadow.mapSize.set(s.shadowResolution,s.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}};export{p as a};
1
+ import{d as s}from"./runtime-chunk-XUHTMJJD.js";import{a as t,b as i}from"./runtime-chunk-BEWQ5BW5.js";import{Fc as a,Tc as o,Te as e,We as h,Xc as r,ze as d}from"./runtime-chunk-BVVSZMXD.js";var n=class extends(t(e)){constructor(s,t=15,i=6710886){super(s,t,i),this.object=s,this.name=`PointLightHelper: ${s.uuid}`}raycast(s,t){i(this.object,n.geometryHelper,s,t)}},p=class extends(s(d,n)){constructor(s,t,i){super(),this.super_Entity(s,t),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let e=this.shadow.camera;e.fov=90,e.aspect=1,e.near=100,e.far=2500;let d=new a(-e.far+this.position.x,-e.far+this.position.y,-e.far+this.position.z),n=new a(e.far+this.position.x,e.far+this.position.y,e.far+this.position.z),p=new r(d,n),c=new h(p,new o(16755200));c.visible=!1,this.gizmos.shadowmap=c,this.update()}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this.gizmos))for(let s in this.gizmos){let t=this.gizmos[s];if(t instanceof h){let s=this.shadow.camera,i=new a(-s.far+this.position.x,-s.far+this.position.y,-s.far+this.position.z),o=new a(s.far+this.position.x,s.far+this.position.y,s.far+this.position.z);t.box.set(i,o),t.updateMatrixWorld(!0)}}}updateMatrixWorld(s){super.updateMatrixWorld(s),this.objectHelper&&this.objectHelper.update()}updateState(s,t){this.updateState_Light(s,t),void 0!==s.distance&&(this.distance=s.distance),void 0!==s.decay&&(this.decay=s.decay),void 0!==s.shadowRadius&&(this.shadow.radius=s.shadowRadius),void 0!==s.shadowResolution&&(this.shadow.mapSize.set(s.shadowResolution,s.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}};export{p as a};
@@ -1 +1 @@
1
- import{h as t}from"./runtime-chunk-2PT2WH66.js";import{g as e}from"./runtime-chunk-4KZXQGUQ.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Ba as r,C as s,Ca as a,Ea as n,K as o,j as l,k as h,l as p,o as d}from"./runtime-chunk-D3BWEUN6.js";import{$c as c,Cc as u,Ec as m,Fc as f,Kd as y,Oc as g,Pc as v,Pd as x,Rc as S,Re as w,Xc as M,bd as b,cd as B,dd as P,kd as E,ld as A}from"./runtime-chunk-BVVSZMXD.js";var C={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function D(t,e){let i=[];if(e.length!==t.length)return null;{let r=0;for(;r<t.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}function W(t,e){let i=[];if(!(e.length<=t.length))return null;{let r=0;for(;r<e.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}var O=new f,V=new f,_=new g,U=[new f(-1,1,1),new f(-1,-1,1),new f(1,-1,1),new f(1,1,1),new f(-1,1,-1),new f(-1,-1,-1),new f(1,-1,-1),new f(1,1,-1)],T=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],R=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],z=(t,e,i)=>{t.updateEntityBoxSize(O,V),_.copy(e).multiply(t.matrixWorld),0===V.x&&0===V.y&&0===V.z?i.push(new f(O.x,O.y,O.z).applyMatrix4(_)):U.forEach(t=>{i.push(t.clone().multiply(V).add(O).applyMatrix4(_))})},I=class extends M{constructor(){super(...arguments),this.matrix=new g,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(t=>t.clone()),this.faces=t.faces.map(t=>t.clone()),this.edges=t.edges.map(t=>t.clone()),this.centerEdges=t.centerEdges.map(t=>t.clone()),this}setFromObjectSize(t,e=!1){t.updateWorldMatrix(!1,e),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let i=(new g).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return _.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(_));z(t,e,r)}}),0===r.length&&r.push(...i)}else z(t,e,r);return this.setFromPoints(r)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(_.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(V).multiplyScalar(.5),this.getCenter(O),_.copy(this.matrix).setPosition(O),this.vertices=U.map(t=>t.clone().multiply(V).applyMatrix4(_))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=T.map(([t,e])=>new w(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new f))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=R.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},L=new f,N=new f,j=new f,F=new f,k=new f,q=new f,G=new g,H=1e-12,X=.01;function Z(t){let e=t.elements;L.set(e[0],e[1],e[2]),N.set(e[4],e[5],e[6]),j.set(e[8],e[9],e[10])}function K(){let t=Math.max(L.lengthSq(),N.lengthSq(),j.lengthSq());L.lengthSq()>H*t?F.copy(L).normalize():F.set(1,0,0),k.crossVectors(j,F),k.lengthSq()<=H*t&&(k.copy(N).addScaledVector(F,-N.dot(F)),k.lengthSq()<=H*t&&function(t,e){t.set(1,0,0).cross(e),t.lengthSq()<=H&&t.set(0,1,0).cross(e),t.normalize()}(k,F)),k.normalize(),q.crossVectors(F,k)}function Q(t){return Z(t),K(),G.makeBasis(F,k,q)}var $,Y=new g;($||($={})).is=function(t){return t&&t.__isSPEObject};var J=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new g,this.copyPreviousMatrix=!0,this.hiddenMatrix=new g,this.pivotMatrix=new g,this.matrixWorldRigid=new g,this.shearScale=new g,this.shearScaleInv=new g}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply(Y.copy(this.parent.matrixWorld).invert()),t.premultiply(Y.copy(this.hiddenMatrix).invert()),t.multiply(Y.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof S&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e of this.children)e.updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),e)for(let t of this.children)t.updateWorldMatrix(!1,!0)}traverseChildren(t,e=0){for(let i of this.children)$.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)$.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=function(t,e,i){return Z(t),K(),e.makeBasis(F,k,q),i.set(F.dot(L),F.dot(N),F.dot(j),0,k.dot(L),k.dot(N),k.dot(j),0,q.dot(L),q.dot(N),q.dot(j),0,0,0,0,1),function(){let t=L.length(),e=N.length(),i=j.length(),r=Math.max(t,e,i);if(r-t>X||r-e>X||r-i>X)return!0;let s=X*r*r;return Math.abs(L.dot(N))>s||Math.abs(L.dot(j))>s||Math.abs(N.dot(j))>s}()}(this.matrixWorld,this.matrixWorldRigid,this.shearScale),this.matrixWorldRigid.copyPosition(this.matrixWorld),this.shearScaleInv.copy(this.shearScale).invert()}attach(t,e){this.updateWorldMatrix(!0,!1);let i=(new g).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),"hiddenMatrix"in t&&t.hiddenMatrix instanceof g?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),void 0!==e&&(this.children.pop(),this.children.splice(e,0,t)),this}copy(t,e=!1){return super.copy(t,e),this.hasNonUniformScale=t.hasNonUniformScale,this}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},tt=class extends x{constructor(){super()}getPoints(t=12){let e,i=[],r=this.getCurveLengths(),s=r[r.length-1]/r.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?r[a]:r[a]-r[a-1],h=Math.ceil(t*l/s),p=o.getPoints(h);for(let t=0;t<p.length;t++){let r=p[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},et=.001,it=new f,rt=new f,st=new f,at=new f,nt=new f,ot=new f,lt=new f,ht=new f,pt=new f;function dt(t,e,i){return it.subVectors(e,t),rt.subVectors(e,i),it.cross(rt).length()<=et}var ct,ut=new WeakMap;function mt(t){let e=ut.get(t.points);if(void 0!==e&&e.isClosed===t.isClosed)return e.curve;let i=function(t){let e=t.points,i=[e[0]],r=[new f(...e[0].data.position)];st.copy(r[0]);for(let t=0;t<e.length-1;t++)it.fromArray(e[t].data.position),rt.fromArray(e[t+1].data.position),nt.subVectors(it,st),lt.subVectors(it,rt),nt.cross(lt).length()>et&&(i.push(e[t]),r.push((new f).copy(it)),st.copy(it));let s=e[e.length-1];i.push(s),r.push(new f(...s.data.position));let a=t.isClosed,n=i.length-(a?0:1),o=i.length,l=[],h=[];for(let t=0;t<o;t++){let e=i[t].data;l.push(new f(...e.controlPrevious.position)),h.push(new f(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(dt(r[t],h[t],r[e])&&dt(r[t],l[e],r[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,s=r[t],n={position:s,prevDir:void 0,nextDir:void 0,controlPrevious:l[t],controlNext:h[t],tan:void 0,baseRoundness:e.roundness,removedLength:0};if(d.push(n),0===e.roundness||!a&&(0===t||t===o-1))continue;let c=a&&0==t?o-1:t-1,u=a&&t==o-1?0:t+1,m=(new f).subVectors(r[c],s).normalize(),y=(new f).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=y;let g=p[a&&0===t?o-1:t-1],v=p[t];if(g&&v){at.addVectors(m,y).normalize();let t=st.crossVectors(at,m).length()/m.dot(at);n.tan=t,n.removedLength=e.roundness/t}}for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e];if(0!==i.removedLength||0!==r.removedLength){let t=i.position.distanceTo(r.position);i.removedLength=Math.min(i.removedLength,t/2),r.removedLength=Math.min(r.removedLength,t/2)}}let c=new Array(2*o).fill(null);for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e],s=null;if(p[t]){let t=i.position.clone(),e=r.position.clone();(0!==i.removedLength||0!==r.removedLength)&&(i.nextDir&&t.add(st.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(st.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>et&&(s=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>et&&(s=new y(i.position,i.controlNext,r.controlPrevious,r.position));c[2*t+1]=s}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,r=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),s=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;at.addVectors(e.prevDir,e.nextDir).normalize(),nt.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;pt.copy(at).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(nt),ot.copy(at).multiplyScalar(-a).add(pt);let o=i.distanceTo(ot)/i.distanceTo(nt);lt.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),ht.copy(lt).lerp(ot,2);let l=r.clone().lerp(lt,4/3),h=s.clone().lerp(ht,4/3);c[2*t]=new y(r,l,h,s)}let u=new tt;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return ut.set(t.points,{isClosed:t.isClosed,curve:i}),i}(ct||(ct={})).is=function(t){return t&&t.__isEntity};var ft=t=>ct.is(t),yt={type:"completeState",isfromEntity:!0},gt=["x","y","z"],vt=new f,xt=new f(1,1,1),St=new m,wt=new v,Mt=(new f).set(0,1,0),bt=new g,Bt=new g,Pt=c=>class extends(J(c)){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.currentAnimationAction=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new I,this._recursiveBBox=new I,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(t){let e=this.children[t];if(ct.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(ct.is(this.children[t]))return t+1;return 0}get isConcreteEntity(){return"string"==typeof this.identity}get isVirtualEntity(){return"string"!=typeof this.identity}get isInstanceRoot(){return this.isConcreteEntity&&"Instance"===this.data.type}nearestInstanceSelfOrParent(){let t=this;for(;"Instance"!==t.data.type;){let e=t.parent;if(!ct.is(e))return;t=e}return t}forInstancesRec(t){this.instances.forEach(e=>{e.disposed||t(e),e.forInstancesRec(t)})}super_Entity(t,e){"string"==typeof t&&(this.uuid=t),this.identity=t,this.data=e,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(t,e,i=!1){if(0!==this.data.states.length||i){for(let t of this.data.states)n.toOps(this.data,t.data).forEach(t=>{let i=h.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let i=this.data.states.data(t);i&&(this.dataPatched=n.patch(this.data,i),n.toOps(this.data,i).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}i&&this.updateTransformState(this.dataPatched,e),this.stateSelection=t,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(t,e){t.setScalar(0),e.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{ft(t)&&t.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(t=>{t.resetBBoxNeedsUpdateSelf()})}find(t){let e;return this.traverseEntity(i=>{i.uuid===t&&(e=i)}),e}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children,i=e.indexOf(this)+1;if(ct.is(e[i]))return e[i];if(ct.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&ct.is(this.children[0])?t[0]:this.traverseSortNextHelper()}goUp(t){let e=this;for(;t>0&&null!==e;)e=e.parent,t-=1;return e}hasAnccestorOrSelf(t){return this===t||this.hasAnccestor(t)}hasAnccestor(t){let e=this.parent;for(;e;){if(t===e)return!0;e=e.parent}return!1}countToAccestor(t){let e=0,i=this;for(;i!==t;){if(null===i)return-1;i=i.parent,e+=1}return e}forEachEntity(t){for(let e of this.children)ft(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{ct.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ft(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ft(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)ft(e)&&e.visible&&e.traverseVisibleEntity(t)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(t){super.updateMatrixWorld(t),this.dispatchEvent({type:"updateMatrixWorld"})}copy(t,e=!1){return super.copy(t,e),this.dataPatched=t.dataPatched,this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),this}hasEntityChild(){return this.children.some(t=>ft(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(t=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*u.RAD2DEG,this.rotation.y*u.RAD2DEG,this.rotation.z*u.RAD2DEG],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray(),pivot:[0,0,0],pivotRotation:[0,0,0]};return e(i,t)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,gt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(vt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(vt),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),void 0!==t.hiddenMatrix&&(i=!0,this.hiddenMatrix.fromArray(t.hiddenMatrix??s.identity)),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(vt.fromArray(t.pivot).negate(),St.setFromEuler(wt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),xt);else if(void 0!==t.pivot)this.pivotMatrix.setPosition(-t.pivot[0],-t.pivot[1],-t.pivot[2]);else if(void 0!==t.pivotRotation){let e=vt.setFromMatrixPosition(this.pivotMatrix);St.setFromEuler(wt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,St,xt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&void 0!==t.hiddenMatrix&&this.updateWorldMatrix(!1,!0),i}onVariableUpdate(t=!1){t?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)}),this.requestRender())}dispose(){this.disposed=!0,this.cloner&&(this.cloner.dispose(),this.cloner=void 0)}disposeChildrenRecursively(){for(let t of this.children)ct.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{ct.is(t)&&t.disposeRecursively()})}toState(t=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(t)};return e(i,t)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,s){let o=this.data;this.data=e;let h=t,c=W(t.path,["states","*"]);if(null!==c){if(0===t.type){let[e]=c;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let r=d.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}h={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}if(void 0!==t.props.material&&"material"in e){let{material:t,...i}=e;e=i}let i=d.removeOverridden(t.path,t.props,e);h={...t,props:i}}}if(this.updateByPatchedOpBase(h,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),W(t.path,["overrides"])){let s=[],a=[...t.path];for(s.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)s.push(a[1]),a.splice(0,2);if(void 0===s[s.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){s[s.length-1]=e;let r=i.scene.findInstance([this.uuid,...s]);r&&(r.overrideData=t.props[e],r.updateState(l.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);if(n){let o=d.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,r]of Object.entries(t.props))void 0===r&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=r.resolve(e.overrides,s),n.updateByOp(t,p.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let r;if(0===t.path.length&&0===t.type){let e;for(let i of a.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(r={...t,props:e})}else for(let e of a.rootOverrideProps)if(W(t.path,[e])){r=t;break}void 0!==r&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=l.filterOp(t.overrideData,r);e&&t.updateByOp(e,p.applySimple(t.data,e),i,!0)}}),this.instances.forEach(r=>{if(!r.isInstanceRoot){let s=l.filterOp(r.overrideData,t);if(s){let a;a=o===r.data&&t===s?e:p.applySimple(r.data,s),r.updateByOp(s,a,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!o.is(t.props.type)&&C.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){C.changeEntityProptotype(this,e,i);for(let t of this.children)ct.is(t)&&t.updateVisible(i.scene)}this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){if(0===t.path.length&&0===t.type?this.updateState(t.props,i):0===t.type&&("resolutionLevel"in t.props||"useChildrenColors"in t.props)&&this.updateState(e,i),"morphTargetInfluences"===t.path[0]&&0===t.type){let r=e.morphTargetInfluences.get(t.path[1])?.data.name;r&&this.updateMorphInfluences(r,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",r]))}if(null!==W(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==W(t.path,["cloner"])){let r=p.drop(t,1);0===r.path.length&&0===r.type&&!0===r.props.disabled?this.setFromClonerState(null,i):this.cloner?this.cloner.updateState(e.cloner,i):(this.setFromClonerState(e.cloner,i),this.expandCloner(i)),this.updateVisible(i.scene)}}updatePathSnapping(t=this.dataPatched.pathSnapping){this._updatedPathSnapping=t,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(t){if(!1===this._needApplyPathSnapping)return;let e=this._updatedPathSnapping?.pathId??this.dataPatched.pathSnapping.pathId,i=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,r=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,s=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=mt(n.geometry.path),l=(i+r)%1;i+r===1&&0===l&&(l=1);let h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?bt.copy(this.parent.matrixWorld).invert():bt.identity();p.multiply(a.matrixWorld),h.applyMatrix4(p);let d={position:h.toArray(),rotation:n.rotation};if("tangential"===s){let t=Bt.extractRotation(a.matrixWorld),e=o.getTangentAt(l).applyMatrix4(t).add(h),i=Bt.lookAt(h,e,Mt),r=vt.setFromEuler(wt.setFromRotationMatrix(i)).multiplyScalar(u.RAD2DEG);d={...d,rotation:r.toArray()}}this.updateTransformState(d),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(yt)})}updateVisible(t){if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||(this.dataPatched.cloner.disabled??!1)||!0!==this.dataPatched.cloner?.hideBase),!t)return;let e=!1;this.traverseEntity(t=>{if("Splat"===t.data.type)return e=!0,!0}),e&&t.reloadSplats()}updateState_Entity(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.raycastLock&&(this.raycastLock=t.raycastLock),void 0!==t.visible&&(this.updateVisible(e?.scene),this.resetBBoxNeedsUpdate()),e&&"cloner"in t&&void 0!==t.cloner&&(this.setFromClonerState(t.cloner,e),this.updateVisible(e.scene)),this.updateTransformState(t,e)}get attachedSurfaceCloners(){return this.children.filter(e=>t(e)&&"toObject"===e.parameters.type)}setFromClonerState(t,e){if(!this.disposed)if(null===t||t.disabled)this.cloner&&this.cloner.dispose(),this.cloner=void 0;else if(void 0===this.cloner){if(null===C.Cloner)return void i("cloners","a cloner");this.cloner=new C.Cloner(this,t),e.scene.addPendingExpandCloner(this)}else this.cloner.updateState(t,e)}expandCloner(t){!this.disposed&&this.cloner&&this.cloner.expandClones(t)}invalidateClonerTransform(t){this.cloner&&this.cloner.invalidateTransform(t)}requestRender(){this.dispatchEvent({type:"requestRender"})}},Et=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,e){let i=Object.assign({},e?.parameters??{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},t.parameters),r=Math.abs(i.width),s=Math.abs(i.height??r),a=Math.abs(i.depth??r),n=Math.abs(Math.min(r,a))/2;return{parameters:Object.assign(i,{width:r,height:s,depth:a,radius:n,segments:Math.round(i.segments),pathSegments:Math.round(i.pathSegments),cornerSegments:Math.round(i.cornerSegments)})}}static build(t){let{width:e,height:i,depth:r,radius:s,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Ot(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},At=new c([0,0,0],1);function Ct(t){return"TorusGeometry"===t.type&&360===t.arc}var Dt,Wt,Ot=class extends P{constructor(t=!0,e=1,i=1,r=1,s=1,a=1,n=1,o=1,l=1,h=1,p=1,d=1){if(super(),0===a)return;let c=t&&1===a;c&&(d=0),p>100&&(p=100),0===p&&(d=0);let u,m,y,g,v,x,S,w,M=()=>new f,B=new f,P=M(),E=M(),A=M(),C=M(),D=M(),W=M(),O=M(),V=M(),_=M(),U=M(),T=M(),R=i-2*o+.001,z=R/a,I=Math.ceil(n*a),L=I+1,N=R/I,j=-R/2,F=h+1,k=2*Math.PI/h,q=Math.PI/2/d,G=Math.min((1-p/100)*o,o-.01),H=o-G,X=0,Z=2*d+2,K=F*Z/2,Q=K+F*L,$=Math.max(0,F*(L+Z)),[Y,J,tt]=[3,3,2].map(t=>Array($*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*N,w=2*Math.PI*(x%z)/z+r,x+=j,S=Math.sin(w)*it,v=Math.cos(w)*it,t?e.set(v,S,x):e.set(v,x,S)}rt(B,-1e-10),rt(P,0),C.copy(B),rt(B,1);let st=B.distanceTo(P),at=c?0:H+G,nt=st*I+2*at,ot=G,lt=nt-at;for(let e=0;e<=I;e++){rt(E,e),T.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),U.crossVectors(T,_).normalize();let i=0===e,r=e===I,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?F:Q,l=i?0:$-F,p=T.clone().multiplyScalar(i?-H:H).add(E),u=T.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<F;t++){let m=t*k;if(D.addVectors(B.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(U).multiplyScalar(o*Math.sin(m))),W.copy(D).normalize(),i||r){c||(X=l+t,[0,1,2].forEach(t=>{Y[3*X+t]=p.getComponent(t),J[3*X+t]=u.getComponent(t)}),tt[2*X]=+r,tt[2*X+1]=t/h),P.copy(W).multiplyScalar(G),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*q+s;O.addVectors(B.copy(T).multiplyScalar(H*Math.sin(r)),P.copy(W).multiplyScalar(H*Math.cos(r))),V.copy(O).normalize(),P.addVectors(A,O),O.normalize(),X=n+e*F+t,[0,1,2].forEach(t=>{Y[3*X+t]=P.getComponent(t),J[3*X+t]=V.getComponent(t)});let o=+i+Math.sin(r);tt[2*X]=(a+H*o)/nt,tt[2*X+1]=t/h}}P.addVectors(E,D),X=K+e*F+t,[0,1,2].forEach(t=>{Y[3*X+t]=P.getComponent(t),J[3*X+t]=W.getComponent(t)}),tt[2*X]=(at+e*st)/nt,tt[2*X+1]=t/h}}let ht=L+2*d+2,[pt,dt]=[+c,ht-1];for(let t=pt;t<=dt-1;t++){let e=c&&t===dt-1;for(let i=0;i<F-1;i++)u=t*F+i,m=u+1,y=(e?i:u)+F,g=(e?i+1:m)+F,0===t?et.push(m,g,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,g,y)}this.setIndex(et),this.setAttribute("position",new b(Y,3)),this.setAttribute("normal",new b(J,3)),this.setAttribute("uv",new b(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,r,s=this.userData.parameters,a=Math.ceil(s.tubularSegments),n=s.radialSegments,o=n+1,l=[];for(let s=1;s<a;s++)for(let a=0;a<n;a++)t=s*o+a,e=t+1,i=t+o,r=e+o,l.push(t,e,i,e,r,i);for(let s=0;s<n;s++)t=a*o+s,e=t+1,i=s+o,r=s+1+o,l.push(t,e,i,e,r,i);return At.array=new Uint32Array(l),At.count=l.length,At}},Vt=new Map,_t=0;function Ut(t){return Wt||(Wt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.11/build",i=import("./boolean.js"),[r,s]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await r.default({module_or_path:s}),Dt=r}())}function Tt(){if(void 0===Dt)throw new Error("boolean-wasm is not loaded");return Dt}function Rt(t){let e=Vt.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function zt(t){return Vt.set(++_t,t),_t}var It={0:0,1:1,2:2};function Lt(t,e,i){if(void 0===Dt)return-1;let{positions:r,indices:s,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,r=0;t<e.verticesPerFace.length;t++){let s=e.verticesPerFace[t];for(let t=1;t<s-1;t++)i.push(e.indices[r],e.indices[r+t],e.indices[r+t+1]);r+=s}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Ct(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let r,s=t.getAttribute("position");if(null===i){r=new Uint32Array(s.count);for(let t=0;t<r.length;t++)r[t]=t}else r=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===s.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:s.array,indices:r,normals:n}}(t,e);return zt(new Dt.CsgMesh(r,s,a))}function Nt(t,e){let i=Tt(),r=It[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(Rt);if(1===s.length)return i.clone_mesh(s[0]);let a,n=[];if(2===e&&s.length>2){let t=s[0];for(let e=1;e<s.length-1;e++)t=i.boolean_mesh(t,s[e],0),n.push(t);a=i.boolean_mesh(s[s.length-1],t,2)}else if(2===e)a=i.boolean_mesh(s[1],s[0],2);else{let t=s[s.length-1];for(let e=0;e<s.length-1&&(t=i.boolean_mesh(t,s[e],r),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function jt(t,e,i,r){let s=Tt(),a=Nt(t,e),n=s.mesh_render_data(a,Math.max(r,0));if(i.setAttribute("position",new b(n.positions(),3)),i.setAttribute("normal",new b(n.normals(),3)),n.free(),null===i.boundingSphere&&(i.boundingSphere=new B),0===a.tri_count())i.boundingSphere.center.set(0,0,0),i.boundingSphere.radius=0,i.userData.parameters={width:0,height:0,depth:0};else{let t=a.bounds();i.boundingSphere.center.set(t[0],t[1],t[2]),i.boundingSphere.radius=(t[3]**2+t[4]**2+t[5]**2)**.5,i.userData.parameters={width:2*t[3],height:2*t[4],depth:2*t[5]}}return zt(a)}function Ft(t,e){let i=Tt(),r=Nt(t,e),s=i.mesh_topological_data(r),a=s.positions(),n=s.indices();return s.free(),r.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function kt(t,e){Rt(t).transform(new Float32Array(e.elements))}function qt(t){let e=Vt.get(t);void 0!==e&&(e.free(),Vt.delete(t))}function Gt(t,e){return zt(Tt().instanced_union(Rt(t),e))}function Ht(t){return null!==t&&"booleanOp"in t}var Xt=class extends(Pt(A)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new g}updateVisible(t){super.updateVisible(t),this.visible=!Ht(this.parent)&&this.visible,Ht(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Ht(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(qt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Ht(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof Xt&&(t.freeBooleanPointer(),Ht(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Ht(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Ht(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Zt=new M;function Kt(t,e=0,i=t.count,r,s){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let r=e;r<i;r++){let e=t.getX(r),i=t.getY(r),s=t.getZ(r);e<a&&(a=e),i<n&&(n=i),s<o&&(o=s),e>l&&(l=e),i>h&&(h=i),s>p&&(p=s)}Zt.min.set(a,n,o),Zt.max.set(l,h,p),Zt.getCenter(r),Zt.getSize(s).multiplyScalar(.5)}var Qt=new P,$t=new E,Yt=class extends Xt{constructor(t,e){super(Qt,$t),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){super.raycast(t,e)}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Kt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{D as a,W as b,C as c,Q as d,$ as e,J as f,mt as g,ct as h,ft as i,Pt as j,Et as k,Ct as l,Ot as m,Ut as n,Lt as o,jt as p,Ft as q,kt as r,qt as s,Gt as t,Kt as u,Yt as v};
1
+ import{h as t}from"./runtime-chunk-2PT2WH66.js";import{g as e}from"./runtime-chunk-4KZXQGUQ.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Ba as r,C as s,Ca as a,Ea as n,K as o,j as l,k as h,l as p,o as d}from"./runtime-chunk-D3BWEUN6.js";import{$c as c,Cc as u,Ec as m,Fc as f,Kd as y,Oc as g,Pc as v,Pd as x,Rc as S,Re as w,Xc as M,bd as b,cd as B,dd as P,kd as E,ld as A}from"./runtime-chunk-BVVSZMXD.js";var C={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function D(t,e){let i=[];if(e.length!==t.length)return null;{let r=0;for(;r<t.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}function W(t,e){let i=[];if(!(e.length<=t.length))return null;{let r=0;for(;r<e.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}var O=new f,V=new f,_=new g,U=[new f(-1,1,1),new f(-1,-1,1),new f(1,-1,1),new f(1,1,1),new f(-1,1,-1),new f(-1,-1,-1),new f(1,-1,-1),new f(1,1,-1)],T=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],R=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],z=(t,e,i)=>{t.updateEntityBoxSize(O,V),_.copy(e).multiply(t.matrixWorld),0===V.x&&0===V.y&&0===V.z?i.push(new f(O.x,O.y,O.z).applyMatrix4(_)):U.forEach(t=>{i.push(t.clone().multiply(V).add(O).applyMatrix4(_))})},I=class extends M{constructor(){super(...arguments),this.matrix=new g,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(t=>t.clone()),this.faces=t.faces.map(t=>t.clone()),this.edges=t.edges.map(t=>t.clone()),this.centerEdges=t.centerEdges.map(t=>t.clone()),this}setFromObjectSize(t,e=!1){t.updateWorldMatrix(!1,e),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let i=(new g).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return _.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(_));z(t,e,r)}}),0===r.length&&r.push(...i)}else z(t,e,r);return this.setFromPoints(r)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(_.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(V).multiplyScalar(.5),this.getCenter(O),_.copy(this.matrix).setPosition(O),this.vertices=U.map(t=>t.clone().multiply(V).applyMatrix4(_))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=T.map(([t,e])=>new w(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new f))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=R.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},L=new f,N=new f,j=new f,F=new f,k=new f,q=new f,G=new g,H=1e-12,X=.01;function Z(t){let e=t.elements;L.set(e[0],e[1],e[2]),N.set(e[4],e[5],e[6]),j.set(e[8],e[9],e[10])}function K(){let t=Math.max(L.lengthSq(),N.lengthSq(),j.lengthSq());L.lengthSq()>H*t?F.copy(L).normalize():F.set(1,0,0),k.crossVectors(j,F),k.lengthSq()<=H*t&&(k.copy(N).addScaledVector(F,-N.dot(F)),k.lengthSq()<=H*t&&function(t,e){t.set(1,0,0).cross(e),t.lengthSq()<=H&&t.set(0,1,0).cross(e),t.normalize()}(k,F)),k.normalize(),q.crossVectors(F,k)}function Q(t){return Z(t),K(),G.makeBasis(F,k,q)}var $,Y=new g;($||($={})).is=function(t){return t&&t.__isSPEObject};var J=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new g,this.copyPreviousMatrix=!0,this.hiddenMatrix=new g,this.pivotMatrix=new g,this.matrixWorldRigid=new g,this.shearScale=new g,this.shearScaleInv=new g}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply(Y.copy(this.parent.matrixWorld).invert()),t.premultiply(Y.copy(this.hiddenMatrix).invert()),t.multiply(Y.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof S&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e of this.children)e.updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),e)for(let t of this.children)t.updateWorldMatrix(!1,!0)}traverseChildren(t,e=0){for(let i of this.children)$.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)$.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=function(t,e,i){return Z(t),K(),e.makeBasis(F,k,q),i.set(F.dot(L),F.dot(N),F.dot(j),0,k.dot(L),k.dot(N),k.dot(j),0,q.dot(L),q.dot(N),q.dot(j),0,0,0,0,1),function(){let t=L.length(),e=N.length(),i=j.length(),r=Math.max(t,e,i);if(r-t>X||r-e>X||r-i>X)return!0;let s=X*r*r;return Math.abs(L.dot(N))>s||Math.abs(L.dot(j))>s||Math.abs(N.dot(j))>s}()}(this.matrixWorld,this.matrixWorldRigid,this.shearScale),this.matrixWorldRigid.copyPosition(this.matrixWorld),this.shearScaleInv.copy(this.shearScale).invert()}attach(t,e){this.updateWorldMatrix(!0,!1);let i=(new g).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),"hiddenMatrix"in t&&t.hiddenMatrix instanceof g?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),void 0!==e&&(this.children.pop(),this.children.splice(e,0,t)),this}copy(t,e=!1){return super.copy(t,e),this.hasNonUniformScale=t.hasNonUniformScale,this}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},tt=class extends x{constructor(){super()}getPoints(t=12){let e,i=[],r=this.getCurveLengths(),s=r[r.length-1]/r.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?r[a]:r[a]-r[a-1],h=Math.ceil(t*l/s),p=o.getPoints(h);for(let t=0;t<p.length;t++){let r=p[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},et=.001,it=new f,rt=new f,st=new f,at=new f,nt=new f,ot=new f,lt=new f,ht=new f,pt=new f;function dt(t,e,i){return it.subVectors(e,t),rt.subVectors(e,i),it.cross(rt).length()<=et}var ct,ut=new WeakMap;function mt(t){let e=ut.get(t.points);if(void 0!==e&&e.isClosed===t.isClosed)return e.curve;let i=function(t){let e=t.points,i=[e[0]],r=[new f(...e[0].data.position)];st.copy(r[0]);for(let t=0;t<e.length-1;t++)it.fromArray(e[t].data.position),rt.fromArray(e[t+1].data.position),nt.subVectors(it,st),lt.subVectors(it,rt),nt.cross(lt).length()>et&&(i.push(e[t]),r.push((new f).copy(it)),st.copy(it));let s=e[e.length-1];i.push(s),r.push(new f(...s.data.position));let a=t.isClosed,n=i.length-(a?0:1),o=i.length,l=[],h=[];for(let t=0;t<o;t++){let e=i[t].data;l.push(new f(...e.controlPrevious.position)),h.push(new f(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(dt(r[t],h[t],r[e])&&dt(r[t],l[e],r[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,s=r[t],n={position:s,prevDir:void 0,nextDir:void 0,controlPrevious:l[t],controlNext:h[t],tan:void 0,baseRoundness:e.roundness,removedLength:0};if(d.push(n),0===e.roundness||!a&&(0===t||t===o-1))continue;let c=a&&0==t?o-1:t-1,u=a&&t==o-1?0:t+1,m=(new f).subVectors(r[c],s).normalize(),y=(new f).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=y;let g=p[a&&0===t?o-1:t-1],v=p[t];if(g&&v){at.addVectors(m,y).normalize();let t=st.crossVectors(at,m).length()/m.dot(at);n.tan=t,n.removedLength=e.roundness/t}}for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e];if(0!==i.removedLength||0!==r.removedLength){let t=i.position.distanceTo(r.position);i.removedLength=Math.min(i.removedLength,t/2),r.removedLength=Math.min(r.removedLength,t/2)}}let c=new Array(2*o).fill(null);for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e],s=null;if(p[t]){let t=i.position.clone(),e=r.position.clone();(0!==i.removedLength||0!==r.removedLength)&&(i.nextDir&&t.add(st.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(st.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>et&&(s=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>et&&(s=new y(i.position,i.controlNext,r.controlPrevious,r.position));c[2*t+1]=s}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,r=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),s=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;at.addVectors(e.prevDir,e.nextDir).normalize(),nt.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;pt.copy(at).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(nt),ot.copy(at).multiplyScalar(-a).add(pt);let o=i.distanceTo(ot)/i.distanceTo(nt);lt.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),ht.copy(lt).lerp(ot,2);let l=r.clone().lerp(lt,4/3),h=s.clone().lerp(ht,4/3);c[2*t]=new y(r,l,h,s)}let u=new tt;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return ut.set(t.points,{isClosed:t.isClosed,curve:i}),i}(ct||(ct={})).is=function(t){return t&&t.__isEntity};var ft=t=>ct.is(t),yt={type:"completeState",isfromEntity:!0},gt=["x","y","z"],vt=new f,xt=new f(1,1,1),St=new m,wt=new v,Mt=(new f).set(0,1,0),bt=new g,Bt=new g,Pt=c=>class extends(J(c)){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.currentAnimationAction=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new I,this._recursiveBBox=new I,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(t){let e=this.children[t];if(ct.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(ct.is(this.children[t]))return t+1;return 0}get isConcreteEntity(){return"string"==typeof this.identity}get isVirtualEntity(){return"string"!=typeof this.identity}get isInstanceRoot(){return this.isConcreteEntity&&"Instance"===this.data.type}nearestInstanceSelfOrParent(){let t=this;for(;"Instance"!==t.data.type;){let e=t.parent;if(!ct.is(e))return;t=e}return t}forInstancesRec(t){this.instances.forEach(e=>{e.disposed||t(e),e.forInstancesRec(t)})}super_Entity(t,e){"string"==typeof t&&(this.uuid=t),this.identity=t,this.data=e,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(t,e,i=!1){if(0!==this.data.states.length||i){for(let t of this.data.states)n.toOps(this.data,t.data).forEach(t=>{let i=h.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let i=this.data.states.data(t);i&&(this.dataPatched=n.patch(this.data,i),n.toOps(this.data,i).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}i&&this.updateTransformState(this.dataPatched,e),this.stateSelection=t,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(t,e){t.setScalar(0),e.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{ft(t)&&t.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(t=>{t.resetBBoxNeedsUpdateSelf()})}find(t){let e;return this.traverseEntity(i=>{i.uuid===t&&(e=i)}),e}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children,i=e.indexOf(this)+1;if(ct.is(e[i]))return e[i];if(ct.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&ct.is(this.children[0])?t[0]:this.traverseSortNextHelper()}goUp(t){let e=this;for(;t>0&&null!==e;)e=e.parent,t-=1;return e}hasAnccestorOrSelf(t){return this===t||this.hasAnccestor(t)}hasAnccestor(t){let e=this.parent;for(;e;){if(t===e)return!0;e=e.parent}return!1}countToAccestor(t){let e=0,i=this;for(;i!==t;){if(null===i)return-1;i=i.parent,e+=1}return e}forEachEntity(t){for(let e of this.children)ft(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{ct.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ft(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ft(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)ft(e)&&e.visible&&e.traverseVisibleEntity(t)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(t){super.updateMatrixWorld(t),this.dispatchEvent({type:"updateMatrixWorld"})}copy(t,e=!1){return super.copy(t,e),this.dataPatched=t.dataPatched,this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),this}hasEntityChild(){return this.children.some(t=>ft(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(t=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*u.RAD2DEG,this.rotation.y*u.RAD2DEG,this.rotation.z*u.RAD2DEG],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray(),pivot:[0,0,0],pivotRotation:[0,0,0]};return e(i,t)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,gt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(vt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(vt),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),void 0!==t.hiddenMatrix&&(i=!0,this.hiddenMatrix.fromArray(t.hiddenMatrix??s.identity)),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(vt.fromArray(t.pivot).negate(),St.setFromEuler(wt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),xt);else if(void 0!==t.pivot)this.pivotMatrix.setPosition(-t.pivot[0],-t.pivot[1],-t.pivot[2]);else if(void 0!==t.pivotRotation){let e=vt.setFromMatrixPosition(this.pivotMatrix);St.setFromEuler(wt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,St,xt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&void 0!==t.hiddenMatrix&&this.updateWorldMatrix(!1,!0),i}onVariableUpdate(t=!1){t?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)}),this.requestRender())}dispose(){this.disposed=!0,this.cloner&&(this.cloner.dispose(),this.cloner=void 0)}disposeChildrenRecursively(){for(let t of this.children)ct.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{ct.is(t)&&t.disposeRecursively()})}toState(t=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(t)};return e(i,t)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,s){let o=this.data;this.data=e;let h=t,c=W(t.path,["states","*"]);if(null!==c){if(0===t.type){let[e]=c;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let r=d.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}h={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}if(void 0!==t.props.material&&"material"in e){let{material:t,...i}=e;e=i}let i=d.removeOverridden(t.path,t.props,e);h={...t,props:i}}}if(this.updateByPatchedOpBase(h,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),W(t.path,["overrides"])){let s=[],a=[...t.path];for(s.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)s.push(a[1]),a.splice(0,2);if(void 0===s[s.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){s[s.length-1]=e;let r=i.scene.findInstance([this.uuid,...s]);r&&(r.overrideData=t.props[e],r.updateState(l.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);if(n){let o=d.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,r]of Object.entries(t.props))void 0===r&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=r.resolve(e.overrides,s),n.updateByOp(t,p.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let r;if(0===t.path.length&&0===t.type){let e;for(let i of a.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(r={...t,props:e})}else for(let e of a.rootOverrideProps)if(W(t.path,[e])){r=t;break}void 0!==r&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=l.filterOp(t.overrideData,r);e&&t.updateByOp(e,p.applySimple(t.data,e),i,!0)}}),this.instances.forEach(r=>{if(!r.isInstanceRoot){let s=l.filterOp(r.overrideData,t);if(s){let a;a=o===r.data&&t===s?e:p.applySimple(r.data,s),r.updateByOp(s,a,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!o.is(t.props.type)&&C.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){C.changeEntityProptotype(this,e,i);for(let t of this.children)ct.is(t)&&t.updateVisible(i.scene)}this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){if(0===t.path.length&&0===t.type?this.updateState(t.props,i):0===t.type&&("resolutionLevel"in t.props||"useChildrenColors"in t.props)&&this.updateState(e,i),"morphTargetInfluences"===t.path[0]&&0===t.type){let r=e.morphTargetInfluences.get(t.path[1])?.data.name;r&&this.updateMorphInfluences(r,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",r]))}if(null!==W(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==W(t.path,["cloner"])){let r=p.drop(t,1);0===r.path.length&&0===r.type&&!0===r.props.disabled?this.setFromClonerState(null,i):this.cloner?this.cloner.updateState(e.cloner,i):(this.setFromClonerState(e.cloner,i),this.expandCloner(i)),this.updateVisible(i.scene)}}updatePathSnapping(t=this.dataPatched.pathSnapping){this._updatedPathSnapping=t,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(t){if(!1===this._needApplyPathSnapping)return;let e=this._updatedPathSnapping?.pathId??this.dataPatched.pathSnapping.pathId,i=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,r=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,s=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=mt(n.geometry.path),l=(i+r)%1;i+r===1&&0===l&&(l=1);let h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?bt.copy(this.parent.matrixWorld).invert():bt.identity();p.multiply(a.matrixWorld),h.applyMatrix4(p);let d={position:h.toArray(),rotation:n.rotation};if("tangential"===s){let t=Bt.extractRotation(a.matrixWorld),e=o.getTangentAt(l).applyMatrix4(t).add(h),i=Bt.lookAt(h,e,Mt),r=vt.setFromEuler(wt.setFromRotationMatrix(i)).multiplyScalar(u.RAD2DEG);d={...d,rotation:r.toArray()}}this.updateTransformState(d),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(yt)})}updateVisible(t){if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||(this.dataPatched.cloner.disabled??!1)||!0!==this.dataPatched.cloner?.hideBase),!t)return;let e=!1;this.traverseEntity(t=>{if("Splat"===t.data.type)return e=!0,!0}),e&&t.reloadSplats()}updateState_Entity(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.raycastLock&&(this.raycastLock=t.raycastLock),void 0!==t.visible&&(this.updateVisible(e?.scene),this.resetBBoxNeedsUpdate()),e&&"cloner"in t&&void 0!==t.cloner&&(this.setFromClonerState(t.cloner,e),this.updateVisible(e.scene)),this.updateTransformState(t,e)}get attachedSurfaceCloners(){return this.children.filter(e=>t(e)&&"toObject"===e.parameters.type)}setFromClonerState(t,e){if(!this.disposed)if(null===t||t.disabled)this.cloner&&this.cloner.dispose(),this.cloner=void 0;else if(void 0===this.cloner){if(null===C.Cloner)return void i("cloners","a cloner");this.cloner=new C.Cloner(this,t),e.scene.addPendingExpandCloner(this)}else this.cloner.updateState(t,e)}expandCloner(t){!this.disposed&&this.cloner&&this.cloner.expandClones(t)}invalidateClonerTransform(t){this.cloner&&this.cloner.invalidateTransform(t)}requestRender(){this.dispatchEvent({type:"requestRender"})}},Et=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,e){let i=Object.assign({},e?.parameters??{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},t.parameters),r=Math.abs(i.width),s=Math.abs(i.height??r),a=Math.abs(i.depth??r),n=Math.abs(Math.min(r,a))/2;return{parameters:Object.assign(i,{width:r,height:s,depth:a,radius:n,segments:Math.round(i.segments),pathSegments:Math.round(i.pathSegments),cornerSegments:Math.round(i.cornerSegments)})}}static build(t){let{width:e,height:i,depth:r,radius:s,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Ot(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},At=new c([0,0,0],1);function Ct(t){return"TorusGeometry"===t.type&&360===t.arc}var Dt,Wt,Ot=class extends P{constructor(t=!0,e=1,i=1,r=1,s=1,a=1,n=1,o=1,l=1,h=1,p=1,d=1){if(super(),0===a)return;let c=t&&1===a;c&&(d=0),p>100&&(p=100),0===p&&(d=0);let u,m,y,g,v,x,S,w,M=()=>new f,B=new f,P=M(),E=M(),A=M(),C=M(),D=M(),W=M(),O=M(),V=M(),_=M(),U=M(),T=M(),R=i-2*o+.001,z=R/a,I=Math.ceil(n*a),L=I+1,N=R/I,j=-R/2,F=h+1,k=2*Math.PI/h,q=Math.PI/2/d,G=Math.min((1-p/100)*o,o-.01),H=o-G,X=0,Z=2*d+2,K=F*Z/2,Q=K+F*L,$=Math.max(0,F*(L+Z)),[Y,J,tt]=[3,3,2].map(t=>Array($*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*N,w=2*Math.PI*(x%z)/z+r,x+=j,S=Math.sin(w)*it,v=Math.cos(w)*it,t?e.set(v,S,x):e.set(v,x,S)}rt(B,-1e-10),rt(P,0),C.copy(B),rt(B,1);let st=B.distanceTo(P),at=c?0:H+G,nt=st*I+2*at,ot=G,lt=nt-at;for(let e=0;e<=I;e++){rt(E,e),T.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),U.crossVectors(T,_).normalize();let i=0===e,r=e===I,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?F:Q,l=i?0:$-F,p=T.clone().multiplyScalar(i?-H:H).add(E),u=T.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<F;t++){let m=t*k;if(D.addVectors(B.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(U).multiplyScalar(o*Math.sin(m))),W.copy(D).normalize(),i||r){c||(X=l+t,[0,1,2].forEach(t=>{Y[3*X+t]=p.getComponent(t),J[3*X+t]=u.getComponent(t)}),tt[2*X]=+r,tt[2*X+1]=t/h),P.copy(W).multiplyScalar(G),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*q+s;O.addVectors(B.copy(T).multiplyScalar(H*Math.sin(r)),P.copy(W).multiplyScalar(H*Math.cos(r))),V.copy(O).normalize(),P.addVectors(A,O),O.normalize(),X=n+e*F+t,[0,1,2].forEach(t=>{Y[3*X+t]=P.getComponent(t),J[3*X+t]=V.getComponent(t)});let o=+i+Math.sin(r);tt[2*X]=(a+H*o)/nt,tt[2*X+1]=t/h}}P.addVectors(E,D),X=K+e*F+t,[0,1,2].forEach(t=>{Y[3*X+t]=P.getComponent(t),J[3*X+t]=W.getComponent(t)}),tt[2*X]=(at+e*st)/nt,tt[2*X+1]=t/h}}let ht=L+2*d+2,[pt,dt]=[+c,ht-1];for(let t=pt;t<=dt-1;t++){let e=c&&t===dt-1;for(let i=0;i<F-1;i++)u=t*F+i,m=u+1,y=(e?i:u)+F,g=(e?i+1:m)+F,0===t?et.push(m,g,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,g,y)}this.setIndex(et),this.setAttribute("position",new b(Y,3)),this.setAttribute("normal",new b(J,3)),this.setAttribute("uv",new b(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,r,s=this.userData.parameters,a=Math.ceil(s.tubularSegments),n=s.radialSegments,o=n+1,l=[];for(let s=1;s<a;s++)for(let a=0;a<n;a++)t=s*o+a,e=t+1,i=t+o,r=e+o,l.push(t,e,i,e,r,i);for(let s=0;s<n;s++)t=a*o+s,e=t+1,i=s+o,r=s+1+o,l.push(t,e,i,e,r,i);return At.array=new Uint32Array(l),At.count=l.length,At}},Vt=new Map,_t=0;function Ut(t){return Wt||(Wt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.13/build",i=import("./boolean.js"),[r,s]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await r.default({module_or_path:s}),Dt=r}())}function Tt(){if(void 0===Dt)throw new Error("boolean-wasm is not loaded");return Dt}function Rt(t){let e=Vt.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function zt(t){return Vt.set(++_t,t),_t}var It={0:0,1:1,2:2};function Lt(t,e,i){if(void 0===Dt)return-1;let{positions:r,indices:s,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,r=0;t<e.verticesPerFace.length;t++){let s=e.verticesPerFace[t];for(let t=1;t<s-1;t++)i.push(e.indices[r],e.indices[r+t],e.indices[r+t+1]);r+=s}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Ct(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let r,s=t.getAttribute("position");if(null===i){r=new Uint32Array(s.count);for(let t=0;t<r.length;t++)r[t]=t}else r=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===s.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:s.array,indices:r,normals:n}}(t,e);return zt(new Dt.CsgMesh(r,s,a))}function Nt(t,e){let i=Tt(),r=It[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(Rt);if(1===s.length)return i.clone_mesh(s[0]);let a,n=[];if(2===e&&s.length>2){let t=s[0];for(let e=1;e<s.length-1;e++)t=i.boolean_mesh(t,s[e],0),n.push(t);a=i.boolean_mesh(s[s.length-1],t,2)}else if(2===e)a=i.boolean_mesh(s[1],s[0],2);else{let t=s[s.length-1];for(let e=0;e<s.length-1&&(t=i.boolean_mesh(t,s[e],r),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function jt(t,e,i,r){let s=Tt(),a=Nt(t,e),n=s.mesh_render_data(a,Math.max(r,0));if(i.setAttribute("position",new b(n.positions(),3)),i.setAttribute("normal",new b(n.normals(),3)),n.free(),null===i.boundingSphere&&(i.boundingSphere=new B),0===a.tri_count())i.boundingSphere.center.set(0,0,0),i.boundingSphere.radius=0,i.userData.parameters={width:0,height:0,depth:0};else{let t=a.bounds();i.boundingSphere.center.set(t[0],t[1],t[2]),i.boundingSphere.radius=(t[3]**2+t[4]**2+t[5]**2)**.5,i.userData.parameters={width:2*t[3],height:2*t[4],depth:2*t[5]}}return zt(a)}function Ft(t,e){let i=Tt(),r=Nt(t,e),s=i.mesh_topological_data(r),a=s.positions(),n=s.indices();return s.free(),r.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function kt(t,e){Rt(t).transform(new Float32Array(e.elements))}function qt(t){let e=Vt.get(t);void 0!==e&&(e.free(),Vt.delete(t))}function Gt(t,e){return zt(Tt().instanced_union(Rt(t),e))}function Ht(t){return null!==t&&"booleanOp"in t}var Xt=class extends(Pt(A)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new g}updateVisible(t){super.updateVisible(t),this.visible=!Ht(this.parent)&&this.visible,Ht(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Ht(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(qt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Ht(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof Xt&&(t.freeBooleanPointer(),Ht(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Ht(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Ht(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Zt=new M;function Kt(t,e=0,i=t.count,r,s){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let r=e;r<i;r++){let e=t.getX(r),i=t.getY(r),s=t.getZ(r);e<a&&(a=e),i<n&&(n=i),s<o&&(o=s),e>l&&(l=e),i>h&&(h=i),s>p&&(p=s)}Zt.min.set(a,n,o),Zt.max.set(l,h,p),Zt.getCenter(r),Zt.getSize(s).multiplyScalar(.5)}var Qt=new P,$t=new E,Yt=class extends Xt{constructor(t,e){super(Qt,$t),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){super.raycast(t,e)}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Kt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{D as a,W as b,C as c,Q as d,$ as e,J as f,mt as g,ct as h,ft as i,Pt as j,Et as k,Ct as l,Ot as m,Ut as n,Lt as o,jt as p,Ft as q,kt as r,qt as s,Gt as t,Kt as u,Yt as v};
@@ -1 +1 @@
1
- import{h as t,j as e,k as i}from"./runtime-chunk-HLXTXF7I.js";import{a as s}from"./runtime-chunk-R43XZP65.js";import{a}from"./runtime-chunk-AVO7AFZY.js";import{e as n}from"./runtime-chunk-WGBR2HLR.js";import{e as r}from"./runtime-chunk-2PT2WH66.js";import{q as o}from"./runtime-chunk-D3BWEUN6.js";import{Bc as h}from"./runtime-chunk-BVVSZMXD.js";var d=class extends h{constructor(t,e,i,s,a){if(super(),this.eventType=t,this.data=e,this.page=i,this.shared=s,this.condition=a,this.toggleIsForward=!1,this.timelineNeedsRebuild=!1,this.hasPlayedOnce=!1,this.pauseOnNextLoopEnd=!1,this.onTimelineChangeComplete=()=>{if(this.pauseOnNextLoopEnd)return this.pauseOnNextLoopEnd=!1,void this.timeline?.pause();"normal"!==this.data.tweens[0].data.direction&&(this.toggleIsForward=!this.toggleIsForward),!1!==this.timelineNeedsRebuild&&(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!1,isRebuild:!0}),this.timeline.play())},!e.object)throw new Error("Missing property");let n=this.page.scene.find(e.object)??this.page.uiCanvas?.find(e.object)??this.page.scene.find2DInUIObjects(e.object);if(!n)throw new Error("Missing property");if(!n.states)throw new Error("Missing property");if(this.object=n,e.tweens.length<2)throw new Error("Missing property");this.tweens=Array(this.data.tweens.length-1),this.startOnceDelay="start-once"===e.tweens[0].data.delayDirection?e.tweens[0].data.delay:0,this.init()}get playing(){return!1===this.timeline?.paused}get changeBegan(){return this.tweens.some(t=>t.changeBegan)??!1}init(){this.initialCurrentState=e(this.object,this.object.currentState).id,this.toggleIsForward=!1}get currentState(){return"Toggle"===this.data.runMode&&o(this.eventType)?this.initialCurrentState:this.object.currentState}buildTimeline({isForward:e=!0,needsRebuild:n=!1,isRebuild:r=!1}={}){try{let o=t(this.data.tweens[0].data);r&&"number"==typeof o.loop&&o.loop--,this.timeline?.pause(),this.timeline=s.timeline({autoplay:!1,...o,...!0===o.loop||o.loop>1?{timelineChangeComplete:this.onTimelineChangeComplete}:{}});let h=this.tweens.findIndex(t=>t?.changeBegan);if(!0===n&&(this.timelineNeedsRebuild=!0),e){let t=-1===h?0:h;for(let e=t;e<this.data.tweens.length-1;e++){let s,n=this.data.tweens[e],r=this.data.tweens[e+1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.delay:0))}this.timeline.duration+=o.endDelay}else{let t=-1===h?this.data.tweens.length-1:h+1;for(let e=t;e>0;e--){let s,n=this.data.tweens[e],r=this.data.tweens[e-1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,n.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e-1]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.endDelay:0))}this.timeline.duration+=o.delay}}catch(t){t instanceof Error&&console.error(t.message)}!0===this.object.previousAction?.playing&&this.object.previousAction.pause(),this.object.previousAction=this}play(){if(!1===n(this.shared,this.condition)||o(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce||(this.hasPlayedOnce=!0,this.playing))return!1;this.startTimeout?.pause();let e=t(this.data.tweens[0].data).pingPongDelayCorrection;this.startTimeout=s({targets:{},duration:this.startOnceDelay+e,easing:"linear",complete:()=>{this.startTimeout=void 0;try{this.buildTimeline(),this.timeline.play()}catch(t){t instanceof Error&&console.error(t.message)}}})}pause(){this.timeline?.pause(),this.startTimeout?.pause(),this.tweens=Array(this.data.tweens.length-1),delete this.startTimeout}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;r(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===n(this.shared,this.condition))return!1;void 0===this.timeline&&this.buildTimeline(),this.timeline?.seek(t*this.timeline.duration,!0)}toggle(t){if(!1===n(this.shared,this.condition))return!1;this.startTimeout?.pause(),this.toggleIsForward=t??!this.toggleIsForward,this.playing?(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!0}),this.pauseOnNextLoopEnd=!0,this.timeline.play()):this.startTimeout=s({targets:{},duration:this.startOnceDelay,easing:"linear",complete:()=>{this.startTimeout=void 0,this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward}),this.timeline.play()}})}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}};export{d as a};
1
+ import{h as t,j as e,k as i}from"./runtime-chunk-ESL2VL5C.js";import{a as s}from"./runtime-chunk-R43XZP65.js";import{a}from"./runtime-chunk-WILQUYJ4.js";import{e as n}from"./runtime-chunk-WGBR2HLR.js";import{e as r}from"./runtime-chunk-2PT2WH66.js";import{q as o}from"./runtime-chunk-D3BWEUN6.js";import{Bc as h}from"./runtime-chunk-BVVSZMXD.js";var d=class extends h{constructor(t,e,i,s,a){if(super(),this.eventType=t,this.data=e,this.page=i,this.shared=s,this.condition=a,this.toggleIsForward=!1,this.timelineNeedsRebuild=!1,this.hasPlayedOnce=!1,this.pauseOnNextLoopEnd=!1,this.onTimelineChangeComplete=()=>{if(this.pauseOnNextLoopEnd)return this.pauseOnNextLoopEnd=!1,void this.timeline?.pause();"normal"!==this.data.tweens[0].data.direction&&(this.toggleIsForward=!this.toggleIsForward),!1!==this.timelineNeedsRebuild&&(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!1,isRebuild:!0}),this.timeline.play())},!e.object)throw new Error("Missing property");let n=this.page.scene.find(e.object)??this.page.uiCanvas?.find(e.object)??this.page.scene.find2DInUIObjects(e.object);if(!n)throw new Error("Missing property");if(!n.states)throw new Error("Missing property");if(this.object=n,e.tweens.length<2)throw new Error("Missing property");this.tweens=Array(this.data.tweens.length-1),this.startOnceDelay="start-once"===e.tweens[0].data.delayDirection?e.tweens[0].data.delay:0,this.init()}get playing(){return!1===this.timeline?.paused}get changeBegan(){return this.tweens.some(t=>t.changeBegan)??!1}init(){this.initialCurrentState=e(this.object,this.object.currentState).id,this.toggleIsForward=!1}get currentState(){return"Toggle"===this.data.runMode&&o(this.eventType)?this.initialCurrentState:this.object.currentState}buildTimeline({isForward:e=!0,needsRebuild:n=!1,isRebuild:r=!1}={}){try{let o=t(this.data.tweens[0].data);r&&"number"==typeof o.loop&&o.loop--,this.timeline?.pause(),this.timeline=s.timeline({autoplay:!1,...o,...!0===o.loop||o.loop>1?{timelineChangeComplete:this.onTimelineChangeComplete}:{}});let h=this.tweens.findIndex(t=>t?.changeBegan);if(!0===n&&(this.timelineNeedsRebuild=!0),e){let t=-1===h?0:h;for(let e=t;e<this.data.tweens.length-1;e++){let s,n=this.data.tweens[e],r=this.data.tweens[e+1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.delay:0))}this.timeline.duration+=o.endDelay}else{let t=-1===h?this.data.tweens.length-1:h+1;for(let e=t;e>0;e--){let s,n=this.data.tweens[e],r=this.data.tweens[e-1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,n.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e-1]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.endDelay:0))}this.timeline.duration+=o.delay}}catch(t){t instanceof Error&&console.error(t.message)}!0===this.object.previousAction?.playing&&this.object.previousAction.pause(),this.object.previousAction=this}play(){if(!1===n(this.shared,this.condition)||o(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce||(this.hasPlayedOnce=!0,this.playing))return!1;this.startTimeout?.pause();let e=t(this.data.tweens[0].data).pingPongDelayCorrection;this.startTimeout=s({targets:{},duration:this.startOnceDelay+e,easing:"linear",complete:()=>{this.startTimeout=void 0;try{this.buildTimeline(),this.timeline.play()}catch(t){t instanceof Error&&console.error(t.message)}}})}pause(){this.timeline?.pause(),this.startTimeout?.pause(),this.tweens=Array(this.data.tweens.length-1),delete this.startTimeout}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;r(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===n(this.shared,this.condition))return!1;void 0===this.timeline&&this.buildTimeline(),this.timeline?.seek(t*this.timeline.duration,!0)}toggle(t){if(!1===n(this.shared,this.condition))return!1;this.startTimeout?.pause(),this.toggleIsForward=t??!this.toggleIsForward,this.playing?(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!0}),this.pauseOnNextLoopEnd=!0,this.timeline.play()):this.startTimeout=s({targets:{},duration:this.startOnceDelay,easing:"linear",complete:()=>{this.startTimeout=void 0,this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward}),this.timeline.play()}})}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}};export{d as a};
@@ -1 +1 @@
1
- import{j as e}from"./runtime-chunk-MQKKQEK3.js";import{Ed as t,Fc as r,Oc as i,We as n,cd as a,jd as o}from"./runtime-chunk-BVVSZMXD.js";var s;(s||(s={})).is=e=>"objectHelper"in e;var l=(r,i)=>class extends(e(r)){constructor(){super(...arguments),this.objectHelper=new i(this),this.gizmos={}}get geometryHelper(){return i.geometryHelper}raycast(e,t){this.objectHelper.raycast(e,t)}showGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!0)}}updateEntityBoxSize(e,r){this.objectHelper.visible&&this.geometryHelper instanceof t?(e.setScalar(0),r.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):super.updateEntityBoxSize(e,r)}hideGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!1)}}},c=e=>{var r;return(r=class extends e{}).geometryHelper=new t(30,30,30),r},p=new o,u=new a,m=new i,f=(e,t,i,n,a=!1,o=e)=>{let s=t,l=o.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),u.copy(s.boundingSphere),u.applyMatrix4(l),!1===i.ray.intersectsSphere(u)||(m.copy(l).invert(),p.copy(i.ray).applyMatrix4(m),null!==s.boundingBox&&!1===p.intersectsBox(s.boundingBox)))return;let c,f,h,d,g,y,x=s.index,b=s.attributes.position,w=s.drawRange;if(!1===a){for(g=Math.max(0,w.start),y=Math.min(x.count,w.start+w.count);g<y;g+=3)if(f=x.getX(g),h=x.getX(g+1),d=x.getX(g+2),c=B(e,i,p,b,f,h,d),c)return c.faceIndex=Math.floor(g/3),void n.push(c)}else{let t=s.attributes.position,a=new r,l=new r,c=new r,u=new r,m=2,f=1/((o.scale.x+o.scale.y+o.scale.z)/3),h=f*f;for(let r=Math.max(0,w.start),s=Math.min(t.count,w.start+w.count)-1;r<s;r+=m){if(a.fromBufferAttribute(t,r),l.fromBufferAttribute(t,r+1),p.distanceSqToSegment(a,l,u,c)>h)continue;u.applyMatrix4(o.matrixWorld);let s=i.ray.origin.distanceTo(u);s<i.near||s>i.far||n.push({distance:s,point:c.clone().applyMatrix4(o.matrixWorld),object:e})}}function B(e,t,i,n,a,o,s){let l=new r,c=new r,p=new r,u=new r,m=new r;if(l.fromBufferAttribute(n,a),c.fromBufferAttribute(n,o),p.fromBufferAttribute(n,s),null===i.intersectTriangle(l,c,p,!1,u))return null;m.copy(u),m.applyMatrix4(e.matrixWorld);let f=t.ray.origin.distanceTo(m);return f<t.near||f>t.far?null:{faceIndex:1,distance:f,point:m.clone(),object:e}}};export{c as a,f as b,s as c,l as d};
1
+ import{j as e}from"./runtime-chunk-A7IMJ4FJ.js";import{Ed as t,Fc as r,Oc as i,We as n,cd as a,jd as o}from"./runtime-chunk-BVVSZMXD.js";var s;(s||(s={})).is=e=>"objectHelper"in e;var l=(r,i)=>class extends(e(r)){constructor(){super(...arguments),this.objectHelper=new i(this),this.gizmos={}}get geometryHelper(){return i.geometryHelper}raycast(e,t){this.objectHelper.raycast(e,t)}showGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!0)}}updateEntityBoxSize(e,r){this.objectHelper.visible&&this.geometryHelper instanceof t?(e.setScalar(0),r.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):super.updateEntityBoxSize(e,r)}hideGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!1)}}},c=e=>{var r;return(r=class extends e{}).geometryHelper=new t(30,30,30),r},p=new o,u=new a,m=new i,f=(e,t,i,n,a=!1,o=e)=>{let s=t,l=o.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),u.copy(s.boundingSphere),u.applyMatrix4(l),!1===i.ray.intersectsSphere(u)||(m.copy(l).invert(),p.copy(i.ray).applyMatrix4(m),null!==s.boundingBox&&!1===p.intersectsBox(s.boundingBox)))return;let c,f,h,d,g,y,x=s.index,b=s.attributes.position,w=s.drawRange;if(!1===a){for(g=Math.max(0,w.start),y=Math.min(x.count,w.start+w.count);g<y;g+=3)if(f=x.getX(g),h=x.getX(g+1),d=x.getX(g+2),c=B(e,i,p,b,f,h,d),c)return c.faceIndex=Math.floor(g/3),void n.push(c)}else{let t=s.attributes.position,a=new r,l=new r,c=new r,u=new r,m=2,f=1/((o.scale.x+o.scale.y+o.scale.z)/3),h=f*f;for(let r=Math.max(0,w.start),s=Math.min(t.count,w.start+w.count)-1;r<s;r+=m){if(a.fromBufferAttribute(t,r),l.fromBufferAttribute(t,r+1),p.distanceSqToSegment(a,l,u,c)>h)continue;u.applyMatrix4(o.matrixWorld);let s=i.ray.origin.distanceTo(u);s<i.near||s>i.far||n.push({distance:s,point:c.clone().applyMatrix4(o.matrixWorld),object:e})}}function B(e,t,i,n,a,o,s){let l=new r,c=new r,p=new r,u=new r,m=new r;if(l.fromBufferAttribute(n,a),c.fromBufferAttribute(n,o),p.fromBufferAttribute(n,s),null===i.intersectTriangle(l,c,p,!1,u))return null;m.copy(u),m.applyMatrix4(e.matrixWorld);let f=t.ray.origin.distanceTo(m);return f<t.near||f>t.far?null:{faceIndex:1,distance:f,point:m.clone(),object:e}}};export{c as a,f as b,s as c,l as d};
@@ -1 +1 @@
1
- import{e,g as t,j as a}from"./runtime-chunk-K3MY5TZT.js";import{a as r}from"./runtime-chunk-CSQ34B7E.js";import{a as n,b as o}from"./runtime-chunk-FYQSEYL5.js";import{c as i,e as s,f as l}from"./runtime-chunk-Q23Z6MJP.js";import{a as u}from"./runtime-chunk-AVO7AFZY.js";import{b as d}from"./runtime-chunk-LEHYVJOU.js";import{U as p,Y as c,Z as h,da as f,ea as g,h as m}from"./runtime-chunk-BY4Y72LZ.js";import{v as y}from"./runtime-chunk-MQKKQEK3.js";import{d as b,e as v}from"./runtime-chunk-2PT2WH66.js";import{d as w,f as j}from"./runtime-chunk-4KZXQGUQ.js";import{A as S,B as D,I as E,N as V,O as B,P as x,Q as O,R as A,S as C,da as k,ma as M,pa as N,va as P,z as R}from"./runtime-chunk-D3BWEUN6.js";import{Cc as q,Dc as z,Ec as G,Fc as I,Oc as F,Pc as $,Tc as T}from"./runtime-chunk-BVVSZMXD.js";var{degToRad:U,radToDeg:_}=q,L=new I,Q=new I,W=new G;function Y(e,t,a,r,n,o){let i=void 0!==a[e]?a[e]:void 0,s=r[e];if(null==s)return;let l=null!=i?"string"==typeof i?Number(n.getVariable(i)??0):i:t[e],u="string"==typeof s?Number(n.getVariable(s)??0):s;return l!==u?{update:a=>{let r=q.lerp(l,u,a);t[e]=o?Math.trunc(r):r},start:()=>{t[e]=l},end:()=>{t[e]=u}}:void 0}function Z(e,t,a,r,n,o){let i=a[e]?a[e]:void 0,s=r[e];if(!s)return;let l=t[e],u=[...i??l].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e),d=[...s].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e);return u.length!==d.length||w(u,d)?void 0:{update:a=>{u.forEach((r,n)=>{let i=q.lerp(r,d[n],a);t[e][n]=o?Math.trunc(i):i})},start:()=>{Object.assign(t[e],u)},end:()=>{Object.assign(t[e],d)}}}function K(e,t,a){return t.forEach((t,r)=>{e.setComponent(r,"string"==typeof t?Number(a.getVariable(t)??0):t)}),e}function H(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=o?K(new I,o,n):s.clone(),u=K(new I,i,n);return l.equals(u)?void 0:{update:e=>{s.lerpVectors(l,u,e)},start:()=>{s.copy(l)},end:()=>{s.copy(u)}}}function J(e,t,a){return t.forEach((t,r)=>{e.setComponent(r,"string"==typeof t?Number(a.getVariable(t)??0):t)}),e}function X(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=!(s instanceof z),u=s instanceof z?s:(new z).fromArray(s),d=o?J(new z,o,n):u.clone(),p=J(new z,i,n);return d.equals(p)?void 0:{update:a=>{u.lerpVectors(d,p,a),l&&(t[e]=u.toArray())},start:()=>{u.copy(d),l&&(t[e]=u.toArray())},end:()=>{u.copy(p),l&&(t[e]=u.toArray())}}}function ee(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=new m(s.r,s.g,s.b,s.a),u=o?"string"==typeof o?n.getColor(o).clone():new m(o.r,o.g,o.b,o.a):l.clone(),d="string"==typeof i?n.getColor(i).clone():new m(i.r,i.g,i.b,i.a);return u.equals(d)?void 0:{update:a=>{l.lerpColors(u,d,a);let r=q.lerp(u.a,d.a,a);l.a=r,t[e]={r:l.r,g:l.g,b:l.b,a:l.a}},start:()=>{l.copy(u)},end:()=>{l.copy(d)}}}function te(e,t,a,r,n){return"number"==typeof t[e]?Y(e,t,a??{},r,n):Array.isArray(t[e])?Z(e,t,a??{},r,n):void 0}function ae(e,t,a,r,n){let o=a[e],i=r[e];if("number"==typeof t[e])Math.abs(o-i)>1e-4&&(t[e]=q.lerp(o,i,n));else if(Array.isArray(t[e]))for(let a=0,r=o.length;a<r;a++)t[e][a]=q.lerp(o[a],i[a],n)}function re(e,t,a,r){let n=e.geometry.userData.parameters.extrusion;if(n)return M.forEach(e=>{ae(e,n,t,a,r)}),n}function ne(e,t,a,r){let n=e.updatedPathSnapping;if(n)return P.forEach(e=>{ae(e,n,t,a,r)}),n}function oe(e,t,a,r,n){let o=e.getValue(r);if(void 0!==o){if("colors"===r)return function(e,t,a,r="colors"){if(!e.hasValue(r)||!(r in a))return;let n=[],o=e.getValue(r),i=t?t[r]:o.map(e=>e.toArray()),s=a[r];for(let e=0;e<o.length;++e){let t=[...i[e]],a=[...s[e]];D.isEqual(t,a)||n.push({update:r=>{o[e].fromArray(D.lerp(t,a,r))},start:()=>{o[e].fromArray(t)},end:()=>{o[e].fromArray(a)}})}return n.length?n:void 0}(e,t,a,r);if(Array.isArray(o))return"steps"===r?function(e,t,a,r="steps"){if(!e.hasValue(r)||!(r in a))return;let n=[],o=e.getValue(r),i=t?t[r]:o,s=a[r];return w(i,s)||n.push({update:t=>{let a=[...o];for(let e=0;e<o.length;++e){let r=i[e],n=s[e];a[e]=q.lerp(r,n,t)}e.setValue(r,a)},start:()=>{e.setValue(r,i)},end:()=>{e.setValue(r,s)}}),n.length?n:void 0}(e,t,a,r):void 0;if("number"==typeof o)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:e.getValue(r),i=a[r],s="string"==typeof o?Number(n.getVariable(o)??0):o,l="string"==typeof i?Number(n.getVariable(i)??0):i;return{update:t=>{e.setValue(r,q.lerp(s,l,t))},start:()=>{e.setValue(r,s)},end:()=>{e.setValue(r,l)}}}(e,t,a,r,n);if("boolean"!=typeof o){if(o instanceof z)return function(e,t,a,r){if(!e.hasValue(r)||!(r in a))return;let n=e.getValue(r),o=t?(new z).fromArray(t[r]):n.clone(),i=(new z).fromArray(a[r]);return o.equals(i)?void 0:{update:e=>{n.lerpVectors(o,i,e)},start:()=>{n.copy(o)},end:()=>{n.copy(i)}}}(e,t,a,r);if(o instanceof I)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=e.getValue(r),i=t?t[r]:void 0,s=a[r],l=i?K(new I,i,n):o.clone(),u=K(new I,s,n);return l.equals(u)?void 0:{update:e=>{o.lerpVectors(l,u,e)},start:()=>{o.copy(l)},end:()=>{o.copy(u)}}}(e,t,a,r,n);if(o instanceof m)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:void 0,i=a[r],s=e.getValue(r),l=o?"string"==typeof o?n.color(o).clone():(new T).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.color(i).clone():new m(i.r,i.g,i.b,i.a);if(l.equals(u))return;let d=s.clone();return{update:t=>{e.getValue(r)!==d&&e.setValue(r,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,a,r,n);if(o instanceof T)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:void 0,i=a[r],s=e.getValue(r),l=o?"string"==typeof o?n.color(o).clone():(new T).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.color(i).clone():(new T).setRGB(i.r,i.g,i.b);if(l.equals(u))return;let d=s.clone();return{update:t=>{e.getValue(r)!==d&&e.setValue(r,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,a,r,n);if("isTexture"in o)return function(e,t,a,r="texture"){if(!e.hasValue(r)||!(r in a))return;let n=e.getNode("rotation"),o=t?.[r]?.rotation??0,i=a[r]?.rotation??0;if(n&&o!==i)return{update:e=>{n.value=q.lerp(o,i,e)*q.DEG2RAD},start:()=>{n.value=o*q.DEG2RAD},end:()=>{n.value=i*q.DEG2RAD}};let s=e.getNode("mat"),l=s&&"function"==typeof s.updateMatrix?s:e.getValue("mat");if(!l)return;let u=t?t[r]:l,d=a[r],p=[...u.repeat],c=[...u.offset],h=[...d.repeat],f=[...d.offset],g=u.rotation??0,m=d.rotation??0;return R.isEqual(p,h)&&R.isEqual(c,f)&&g===m?void 0:{update:e=>{l.repeat=R.lerp(p,h,e),l.offset=R.lerp(c,f,e),l.rotation=q.lerp(g,m,e),l.updateMatrix()},start:()=>{l.repeat=[...p],l.offset=[...c],l.rotation=g,l.updateMatrix()},end:()=>{l.repeat=[...h],l.offset=[...f],l.rotation=m,l.updateMatrix()}}}(e,t,a,r)}}}function ie(e,t,a,r){let n=[],o=p(a,r)||!!t.layers&&p(t,r);n.push(function(e,t){return{update:()=>{e.transparent=t}}}(e,o)),function(e,t,a){let r=e.ensureRainbowNoiseCompiled;if("function"==typeof r)for(let n of[...e.layers]){if("rainbow"!==n.type)continue;let o=t.layers?.data(n.uuid),i=a.layers.data(n.uuid);(c(o?.noiseStrength)||c(i?.noiseStrength))&&r.call(e,n.uuid)}}(e,t,a);for(let o of e.layers){let e=t.layers?.data(o.uuid),i=a.layers.data(o.uuid);if(!i||"light"!==o.type&&(!(o.visible??1)||!(i.visible??1)))continue;let s=h[o.type]??[],l=o.getNames().filter(e=>!s.includes(e)&&!k.some(t=>e.includes(t)));for(let t of l)try{let a=oe(o,e,i,t,r);a&&(Array.isArray(a)?n.push(...a):n.push(a))}catch(e){console.error(`lerpMaterial: unexpected material layer for ${t}`,e)}}return n}function se(e,t,a,r,n,o){let i=oe(t,a,r,e,o);!i||(Array.isArray(i)?i.forEach(e=>e.update(n)):i.update(n))}new $;var le=new I,ue=new $;function de(e,t,a,r){let n=r.cloner?.parameters;if(n){ae("count",n,e,t,a),n.count=Math.trunc(n.count);for(let r of B)ae(r,n.radial,e.radial,t.radial,a);for(let r of x)ae(r,n.linear,e.linear,t.linear,a);for(let r of O)ae(r,n.grid,e.grid,t.grid,a);for(let r of A)ae(r,n.toObject,e.toObject,t.toObject,a);return n}}function pe(e,t,a,r){let n=r.cloner?.parameters;if(n){for(let r of C)ae(r,n.randomnessObject,e.randomnessObject,t.randomnessObject,a);return n}}function ce(r,n,o,p,c){let h=[];return r.data.visible&&h.push(...function(e,t,a,r,n){let o,i,u,d,p,c,h,f,g=[];if(v(e)?(o=X("position",e,t,a,n),o&&g.push(o),u=Y("rotation",e,t,a,n),u&&g.push(u),d=X("shear",e,t,a,n),d&&g.push(d)):(f={slide:t.pathSnapping?.slide??e.updatedPathSnapping?.slide??e.dataPatched.pathSnapping?.slide??0,offset:t.pathSnapping?.offset??e.updatedPathSnapping?.offset??e.dataPatched.pathSnapping?.offset??0},c=Y("slide",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,a.pathSnapping??e.dataPatched.pathSnapping,n),c&&g.push(c),h=Y("offset",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,a.pathSnapping??e.dataPatched.pathSnapping,n),h&&g.push(h),!c&&!h&&(o=H("position",e,t,a,n),o&&g.push(o),i=H("scale",e,t,a,n),i&&g.push(i),u=function(e,t,a,r,n){let o=t?.rotation?t.rotation.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*q.DEG2RAD):void 0,i=a.rotation?.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*q.DEG2RAD);if(!i)return;let s=o?(new I).fromArray(o):(new I).setFromEuler(e.rotation),l=(new I).fromArray(i);if(s.equals(l))return;let u=le.subVectors(l,s);if(r&&u.toArray().every(e=>Math.abs(e)<2*Math.PI)){let t=(new G).setFromEuler(ue.setFromVector3(s)),a=(new G).setFromEuler(ue.setFromVector3(l));return{update:r=>{!function(e,t,a,r){if(0===r)return a.copy(e);if(1===r)return a.copy(t);let n=e.w*t.w+e.x*t.x+e.y*t.y+e.z*t.z;if(n>=1)return a.copy(e);let o=1-n*n;if(o<=Number.EPSILON){let n=1-r;return a.w=n*e.w+r*t.w,a.x=n*e.x+r*t.x,a.y=n*e.y+r*t.y,a.z=n*e.z+r*t.z,a.normalize(),a}let i=Math.sqrt(o),s=Math.atan2(i,n),l=Math.sin((1-r)*s)/i,u=Math.sin(r*s)/i;a.w=e.w*l+t.w*u,a.x=e.x*l+t.x*u,a.y=e.y*l+t.y*u,a.z=e.z*l+t.z*u}(t,a,e.quaternion,r)},start:()=>{e.rotation.setFromVector3(s)},end:()=>{e.rotation.setFromVector3(l)}}}return{update:t=>{le.lerpVectors(s,l,t),e.rotation.setFromVector3(le)},start:()=>{e.rotation.setFromVector3(s)},end:()=>{e.rotation.setFromVector3(l)}}}(e,t,a,r,n),u&&g.push(u),p=function(e,t,a,r){let n=a[e]?a[e]:void 0,o=r[e];if(!o)return;let i=t[e],s=n?(new F).fromArray(n):i.clone(),l=new I,u=new G,d=new I;s.decompose(l,u,d);let p=(new F).fromArray(o),c=new I,h=new G,f=new I;return p.decompose(c,h,f),s.equals(p)?void 0:{update:e=>{W.slerpQuaternions(u,h,e),L.lerpVectors(l,c,e),Q.lerpVectors(d,f,e),i.compose(L,W,Q)},start:()=>{i.compose(l,u,d)},end:()=>{i.compose(c,h,f)}}}("hiddenMatrix",e,t,a),p&&g.push(p))),o||i||u||p||c||h){let a=v(e)?()=>{e.updateWorldMatrix(!0,!1,!0),e.resetBBoxNeedsUpdate()}:()=>{e.updateMatrix(),e.hasNonUniformScale&&(e.updateMatrixWorld(),e.updateMatrixWorldRigid()),e.parent?.matrixWorldFusedFalse&&(e.matrixWorld.multiplyMatrices(e.parent.matrixWorldFusedFalse,e.matrix),e.matrixWorldNeedsUpdate=!1),s(e)&&l(e.parent)&&e.invalidateDownstreamBooleanData(!0),e.updatePathSnapping(Object.assign({},t.pathSnapping,f))};g.push({update:a,start:a,end:a})}return g}(r,n,o,c,p.shared)),v(r)?h.push(...function(r,n,o,i,s){let l,u,d,p,c,h,f,g,m,y,b,v,w,j,S,D=[];if("width"in r&&(l=Y("width",r,n,o,s),l&&D.push(l)),"height"in r&&(u=Y("height",r,n,o,s),u&&D.push(u)),r instanceof e||r instanceof a){let t={...n.fill},a={...o.fill};void 0!==t.enabled&&t.enabled!==a.enabled&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.fill.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),d=ee("color",r.fill,t,a,s),d&&D.push(d)}if(r instanceof e){let t={...n.stroke},a={...o.stroke};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.stroke.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),p=ee("color",r.stroke,t,a,s),p&&D.push(p),c=Y("thickness",r.stroke,t,a,s),c&&D.push(c)}if(r instanceof e){let t={...n.dropShadow},a={...o.dropShadow};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.dropShadow.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),h=ee("color",r.dropShadow,t,a,s),h&&D.push(h),f=Y("blurRadius",r.dropShadow,t,a,s),f&&D.push(f),m=Y("spread",r.dropShadow,t,a,s),m&&D.push(m),g=X("offset",r.dropShadow,t,a,s),g&&D.push(g)}if(r instanceof e){let t={...n.innerShadow},a={...o.innerShadow};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.innerShadow.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),y=ee("color",r.innerShadow,t,a,s),y&&D.push(y),b=Y("blurRadius",r.innerShadow,t,a,s),b&&D.push(b),w=Y("spread",r.innerShadow,t,a,s),w&&D.push(w),v=X("offset",r.innerShadow,t,a,s),v&&D.push(v)}if(r instanceof e||r instanceof a){let t={...n.backgroundBlur},a={...o.backgroundBlur};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.backgroundBlur.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),a.enabled||Object.assign(a,{enabled:!0,radius:0})),j=Y("radius",r.backgroundBlur,t,a,s),j&&D.push(j)}if(r instanceof e){let t={...n.layerBlur},a={...o.layerBlur};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.layerBlur.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),a.enabled||Object.assign(a,{enabled:!0,radius:0})),S=Y("radius",r.layerBlur,t,a,s),S&&D.push(S)}if(r instanceof a||r instanceof t){let e=Z("cornerRadius",r,n,o,s);e&&D.push(e)}return D}(r,n,o,0,p.shared)):(r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(!("cloner"in a)||!e.cloner)return n;let o=e.cloner,i="cloner"in t?t.cloner:{},s=a.cloner;V.forEach(e=>{let t;t="count"===e?Y("count",o.parameters,i,s,r.shared,!0):te(e,o.parameters,i??{},s,r.shared),t&&n.push(t)});let l=function(e,t,a,r){if("radial"!==e.parameters.type)return;let n=t.radial,o=a.radial;if(!o)return;let i=e.parameters.radial,s=[];return B.forEach(e=>{let t=te(e,i,n??{},o,r);t&&s.push(t)}),s}(o,i,s,r.shared);l?.length&&n.push(...l);let u=function(e,t,a,r){if("linear"!==e.parameters.type)return;let n=t.linear,o=a.linear;if(!o)return;let i=[],s=e.parameters.linear;return x.forEach(e=>{let t=te(e,s,n??{},o,r);t&&i.push(t)}),i}(o,i,s,r.shared);u?.length&&n.push(...u);let d=function(e,t,a,r){if("grid"!==e.parameters.type)return;let n=t.grid,o=a.grid;if(!o)return;let i=[],s=e.parameters.grid;return O.forEach(e=>{let t;t="count"===e?Z(e,s,n??{},o,r,!0):te(e,s,n??{},o,r),t&&i.push(t)}),i}(o,i,s,r.shared);d?.length&&n.push(...d);let p=function(e,t,a,r){if("toObject"!==e.parameters.type)return;let n=t.toObject,o=a.toObject;if(!o)return;let i=[],s=e.parameters.toObject;return A.forEach(e=>{let t;t="count"===e?Y(e,s,n??{},o,r,!0):te(e,s,n??{},o,r),t&&i.push(t)}),i}(o,i,s,r.shared);p?.length&&n.push(...p);let c=function(e,t,a,r){if(!e.parameters.randomness)return;let n=t.randomnessObject,o=a.randomnessObject;if(!o)return;let i=[],s=e.parameters.randomnessObject;return C.forEach(e=>{let t=te(e,s,n??{},o,r);t&&i.push(t)}),i}(o,i,s,r.shared);return c?.length&&n.push(...c),n.length&&n.push({update:()=>{o.update(r)}}),n}(r,n,o,p)),r instanceof y?(r instanceof g&&r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(!("geometry"in a))return n;let o=e.geometry.userData.parameters,i="geometry"in t?t.geometry:{},s=a.geometry;if(e instanceof d){let t=function(e,t,a,r){if(void 0===a.scaleBaked)return;let n=(t.scaleBaked??e.data.geometry.scaleBaked).map(e=>"string"==typeof e?Number(r.shared.getVariable(e)??0):e),o=a.scaleBaked.map(e=>"string"==typeof e?Number(r.shared.getVariable(e)??0):e);if(S.isEqual(n,o))return;let i=[];return i.push({update:t=>{e.updateGeometryInteractions({scaleBaked:[q.lerp(n[0],o[0],t),q.lerp(n[1],o[1],t),q.lerp(n[2],o[2],t)]},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)},start:()=>{e.updateGeometryInteractions({scaleBaked:n},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)},end:()=>{e.updateGeometryInteractions({scaleBaked:o},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)}}),i}(e,i,s,r);t&&n.push(...t)}else{let t={};if(Object.assign(t,j(o,N),j(i,N)),N.forEach(e=>{let a=te(e,t,i,s,r.shared);a&&n.push(a)}),b(e)){Object.assign(t,{extrusion:{...o.extrusion}});let e=function(e,t,a,r){if(!a.extrusion)return;let n=e.extrusion,o=t.extrusion??{},i=a.extrusion,s=[];return M.forEach(e=>{let t=te(e,n,o,i,r);t&&s.push(t)}),s}(t,i,s,r.shared);e&&n.push(...e)}n.length&&n.push({update:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)},start:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)},end:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)}})}return n}(r,n,o,p)),r.data.visible&&!(r instanceof f&&r.materialOverride)&&h.push(...function(e,t,a,r){let n=[];if(Array.isArray(e.material)){if(!("materials"in a)||!a.materials)return n;let o="materials"in t&&t.materials?t.materials:[],i=a.materials;e.material.forEach((e,t)=>{if(!i[t])return;let a=o[t]??{},s=i[t];"string"==typeof a||"string"==typeof s||n.push(...ie(e,a,s,r))})}else{if(!("material"in a)||!a.material)return n;let o="material"in t&&t.material?t.material:{},i=a.material;if("string"==typeof o||"string"==typeof i)return n;n.push(...ie(e.material,o,i,r))}return n}(r,n,o,p.shared))):i.is(r)?r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(void 0!==a.intensity){let o=Y("intensity",e,t,a,r);o&&n.push(o)}if(void 0!==a.color){let o=function(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=o?"string"==typeof o?n.getColor(o).clone():(new T).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.getColor(i).clone():(new T).setRGB(i.r,i.g,i.b);if(l.equals(u))return;let d=s.clone();return{update:a=>{d.lerpColors(l,u,a),t[e]?.copy?.(d)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}("color",e,t,a,r);o&&n.push(o)}return n}(r,n,o,p.shared)):r instanceof u&&h.push(...function(e,t,a,r){let n=[],o="OrthographicCamera"===e.cameraType?t.orthographic?.zoom:t.perspective?.zoom,i="OrthographicCamera"===e.cameraType?a.orthographic?.zoom:a.perspective?.zoom;if(void 0!==i){let t=o??e.zoom,a=i;t!==a&&n.push({update:r=>{e.zoom=q.lerp(t,a,r),e.updateProjectionMatrix()},start:()=>{e.zoom=t,e.updateProjectionMatrix()},end:()=>{e.zoom=a,e.updateProjectionMatrix()}})}if(void 0!==a.targetOffset){let o=Y("targetOffset",e,t,a,r);o&&n.push(o)}return n}(r,n,o,p.shared))),h.length?{update:e=>{h.forEach(t=>t.update(e))},start:e=>{h.forEach(t=>t.start?.(e))},end:e=>{h.forEach(t=>t.end?.(e))}}:void 0}function he(e,t){return{position(t){Object.assign(e.position,t),(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},rotation(t){let a=Object.keys(t)[0];e.rotation[a]=t[a]*q.DEG2RAD,(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},scale(t){Object.assign(e.scale,t),(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},shapeSize(a){e instanceof g&&(e.userData.value={...e.userData.value,...a},(void 0!==a.x||void 0!==a.y||void 0!==a.z)&&(e.updateGeometryInteractions({width:e.userData.value.x,height:e.userData.value.y,depth:e.userData.value.z},t.shared),e.resetBBoxNeedsUpdate(),e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})))},material(a,r,n){n&&(Object.entries(n).forEach(([a,{start:n,end:o,t:i}])=>{let s=r.getValue(a);e instanceof y&&!Array.isArray(e.material)&&"alpha"===a&&"number"==typeof s&&s>0&&(e.material.transparent=!0),void 0!==s&&se(a,r,n,o,i,t.shared)}),e.dispatchEvent({type:"requestRender"}))},opacity(a){if(e instanceof y&&!Array.isArray(e.material)){let r=e.material.getLayersOfType("light")[0];if(void 0===r)return;e.material.transparent=!0,se("alphaOverride",r,{alphaOverride:a},{alphaOverride:a+1},0,t.shared),e.dispatchEvent({type:"requestRender"})}},light(t,a){(e instanceof n||e instanceof r||e instanceof o)&&(e[t]=a,e.dispatchEvent({type:"requestRender"}))},cloner(e){e.cloner?.update(t),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})},pathExtrusion(e,a){e.geometry.userData.parameters.extrusion={...e.geometry.userData.parameters.extrusion,...a},e.updateGeometryInteractions({extrusion:{...e.geometry.userData.parameters.extrusion}},t.shared),e.resetBBoxNeedsUpdate(),e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})},pathSnapping(t){e.userData.pathSnapping={...e.userData.pathSnapping,...t},e.updatePathSnapping(e.userData.pathSnapping),e.dispatchEvent({type:"requestRender"})}}}var fe={type:"beginState"};function ge(e){let t;if(5===e.easing){let{control1:a,control2:r}=e;t=`cubicBezier(\n\t\t\t${a[0]}, ${a[1]}, ${r[0]}, ${r[1]}\n\t\t)`}else if(6===e.easing){let{mass:a,stiffness:r,damping:n,velocity:o}=e;t=`spring( ${a}, ${r}, ${n}, ${o} )`}else{let a;switch(e.easing){case 0:default:a=E.linear;break;case 1:a=E.ease;break;case 2:a=E.easeIn;break;case 3:a=E.easeOut;break;case 4:a=E.easeInOut}let[r,n,o,i]=a;t=`cubicBezier( ${r}, ${n}, ${o}, ${i} )`}return{duration:Math.max(e.duration,1e-4),easing:t}}function me(e){let t={delay:0,loop:-1===e.repeat||e.repeat+1};if(0===e.repeat)t.direction="normal",t.rewind=!1;else switch(e.direction){case"pingpong":t.direction="alternate",t.rewind=!1;break;case"pingpong-rewind":t.direction="alternate",t.rewind=!0;break;default:t.direction="normal",t.rewind=!1}switch(t.delay=0,t.endDelay=0,t.startOnceDelay=0,t.pingPongDelayCorrection=0,t.pingPongEndDelayCorrection=0,e.delayDirection){case"start-once":t.startOnceDelay=e.delay;break;case"start":t.delay=e.delay;break;case"end":t.endDelay=e.delay;break;case"start-end":case void 0:t.delay=e.delay,t.endDelay=e.delay}return"alternate"===t.direction&&(t.delay/=2,t.endDelay/=2,"start"===e.delayDirection?(t.pingPongDelayCorrection=t.delay,"number"==typeof t.loop&&t.loop%2==0&&(t.pingPongEndDelayCorrection=t.delay)):"end"===e.delayDirection?"number"==typeof t.loop&&t.loop%2!=0&&(t.pingPongEndDelayCorrection=t.endDelay):"start-end"===e.delayDirection&&(t.pingPongDelayCorrection=t.delay,t.pingPongEndDelayCorrection=t.endDelay)),t}var ye={type:"completeState",isfromEntity:!1};function be(e,t){let a,r;if("string"==typeof t?(a=t,r=e.states?.[a]):null===t&&(a=null,r=e.data),void 0!==a&&void 0!==r)return{id:a,data:r}}var ve=class{constructor(e,t,a,r,n,o,i){if(this.object=e,this.data=r,this.sharedAssets=n,this.allowSlerp=o,this.page=i,this.targets={t:0},this.firstLoop=!0,this._changeBegan=!1,this._changeCompleted=!0,this.onChange=()=>{this.callback&&(this.callback.update(this.targets.t),this.object.requestRender()),0===this.targets.t||1===this.targets.t?this._changeCompleted||(this._changeCompleted=!0,this._changeBegan=!1,this.onChangeComplete()):(this._changeCompleted&&(this._changeCompleted=!1),this._changeBegan||(this._changeBegan=!0,this.onChangeBegin()))},this.onChangeBegin=()=>{this.object.reversibleToState=this.to.id;let e=this.targets.t>.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=e,this.object.dispatchEvent({type:"beginState",state:e}),v(this.object)||this.object.traverseEntity(e=>{e!==this.object&&e instanceof u&&e.dispatchEvent(fe)})},this.onChangeComplete=()=>{this.firstLoop&&(this.onFirstLoop(),this.firstLoop=!1),this.object.reversibleToState=this.to.id;let e=this.targets.t<.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=e,this.object.dispatchEvent({type:"completeState",state:e}),v(this.object)||this.object.traverseEntity(e=>{e!==this.object&&e instanceof u&&e.dispatchEvent(ye)})},this.onFirstLoop=()=>{this.useCurrentState&&(this.callback=ce(this.object,this.from.data,this.to.data,{scene:this.page.scene,shared:this.sharedAssets},this.allowSlerp))},void 0===t){let e=be(this.object,this.object.currentState===a?this.object.prevState:this.object.currentState);if(!e)throw new Error("Missing property");this.from=e}else{let e=be(this.object,t);if(!e)throw new Error("Missing property");this.from=e}if(void 0===a)throw new Error("Missing property");{let e=be(this.object,a);if(!e)throw new Error("Missing property");this.to=e}this.useCurrentState=void 0===t||void 0===a,this.params={targets:this.targets,t:1,autoplay:!1,...me(r),...ge(r),change:this.onChange},this.callback=ce(this.object,void 0===t?{}:this.from.data,void 0===a?{}:this.to.data,{scene:this.page.scene,shared:this.sharedAssets},this.allowSlerp)}get changeBegan(){return this._changeBegan}get changeCompleted(){return this._changeCompleted}};export{re as a,ne as b,de as c,pe as d,he as e,fe as f,ge as g,me as h,ye as i,be as j,ve as k};
1
+ import{e,g as t,j as a}from"./runtime-chunk-JLL5C22M.js";import{a as r}from"./runtime-chunk-5POGWSQZ.js";import{a as n,b as o}from"./runtime-chunk-OUQPS3VD.js";import{c as i,e as s,f as l}from"./runtime-chunk-XUHTMJJD.js";import{a as u}from"./runtime-chunk-WILQUYJ4.js";import{b as d}from"./runtime-chunk-YH55FWRI.js";import{U as p,Y as c,Z as h,da as f,ea as g,h as m}from"./runtime-chunk-HKFPEE5F.js";import{v as y}from"./runtime-chunk-A7IMJ4FJ.js";import{d as b,e as v}from"./runtime-chunk-2PT2WH66.js";import{d as w,f as j}from"./runtime-chunk-4KZXQGUQ.js";import{A as S,B as D,I as E,N as V,O as x,P as B,Q as O,R as A,S as C,da as k,ma as M,pa as N,va as P,z as R}from"./runtime-chunk-D3BWEUN6.js";import{Cc as q,Dc as G,Ec as z,Fc as I,Oc as F,Pc as U,Tc as $}from"./runtime-chunk-BVVSZMXD.js";var{degToRad:W,radToDeg:T}=q,_=new I,L=new I,Q=new z;function J(e,t,a,r,n,o){let i=void 0!==a[e]?a[e]:void 0,s=r[e];if(null==s)return;let l=null!=i?"string"==typeof i?Number(n.getVariable(i)??0):i:t[e],u="string"==typeof s?Number(n.getVariable(s)??0):s;return l!==u?{update:a=>{let r=q.lerp(l,u,a);t[e]=o?Math.trunc(r):r},start:()=>{t[e]=l},end:()=>{t[e]=u}}:void 0}function H(e,t,a,r,n,o){let i=a[e]?a[e]:void 0,s=r[e];if(!s)return;let l=t[e],u=[...i??l].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e),d=[...s].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e);return u.length!==d.length||w(u,d)?void 0:{update:a=>{u.forEach((r,n)=>{let i=q.lerp(r,d[n],a);t[e][n]=o?Math.trunc(i):i})},start:()=>{Object.assign(t[e],u)},end:()=>{Object.assign(t[e],d)}}}function Z(e,t,a){return t.forEach((t,r)=>{e.setComponent(r,"string"==typeof t?Number(a.getVariable(t)??0):t)}),e}function X(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=o?Z(new I,o,n):s.clone(),u=Z(new I,i,n);return l.equals(u)?void 0:{update:e=>{s.lerpVectors(l,u,e)},start:()=>{s.copy(l)},end:()=>{s.copy(u)}}}function Y(e,t,a){return t.forEach((t,r)=>{e.setComponent(r,"string"==typeof t?Number(a.getVariable(t)??0):t)}),e}function K(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=!(s instanceof G),u=s instanceof G?s:(new G).fromArray(s),d=o?Y(new G,o,n):u.clone(),p=Y(new G,i,n);return d.equals(p)?void 0:{update:a=>{u.lerpVectors(d,p,a),l&&(t[e]=u.toArray())},start:()=>{u.copy(d),l&&(t[e]=u.toArray())},end:()=>{u.copy(p),l&&(t[e]=u.toArray())}}}function ee(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=new m(s.r,s.g,s.b,s.a),u=o?"string"==typeof o?n.getColor(o).clone():new m(o.r,o.g,o.b,o.a):l.clone(),d="string"==typeof i?n.getColor(i).clone():new m(i.r,i.g,i.b,i.a);return u.equals(d)?void 0:{update:a=>{l.lerpColors(u,d,a);let r=q.lerp(u.a,d.a,a);l.a=r,t[e]={r:l.r,g:l.g,b:l.b,a:l.a}},start:()=>{l.copy(u)},end:()=>{l.copy(d)}}}function te(e,t,a,r,n){return"number"==typeof t[e]?J(e,t,a??{},r,n):Array.isArray(t[e])?H(e,t,a??{},r,n):void 0}function ae(e,t,a,r,n){let o=a[e],i=r[e];if("number"==typeof t[e])Math.abs(o-i)>1e-4&&(t[e]=q.lerp(o,i,n));else if(Array.isArray(t[e]))for(let a=0,r=o.length;a<r;a++)t[e][a]=q.lerp(o[a],i[a],n)}function re(e,t,a,r){let n=e.geometry.userData.parameters.extrusion;if(n)return M.forEach(e=>{ae(e,n,t,a,r)}),n}function ne(e,t,a,r){let n=e.updatedPathSnapping;if(n)return P.forEach(e=>{ae(e,n,t,a,r)}),n}function oe(e,t,a,r,n){let o=e.getValue(r);if(void 0!==o){if("colors"===r)return function(e,t,a,r="colors"){if(!e.hasValue(r)||!(r in a))return;let n=[],o=e.getValue(r),i=t?t[r]:o.map(e=>e.toArray()),s=a[r];for(let e=0;e<o.length;++e){let t=[...i[e]],a=[...s[e]];D.isEqual(t,a)||n.push({update:r=>{o[e].fromArray(D.lerp(t,a,r))},start:()=>{o[e].fromArray(t)},end:()=>{o[e].fromArray(a)}})}return n.length?n:void 0}(e,t,a,r);if(Array.isArray(o))return"steps"===r?function(e,t,a,r="steps"){if(!e.hasValue(r)||!(r in a))return;let n=[],o=e.getValue(r),i=t?t[r]:o,s=a[r];return w(i,s)||n.push({update:t=>{let a=[...o];for(let e=0;e<o.length;++e){let r=i[e],n=s[e];a[e]=q.lerp(r,n,t)}e.setValue(r,a)},start:()=>{e.setValue(r,i)},end:()=>{e.setValue(r,s)}}),n.length?n:void 0}(e,t,a,r):void 0;if("number"==typeof o)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:e.getValue(r),i=a[r],s="string"==typeof o?Number(n.getVariable(o)??0):o,l="string"==typeof i?Number(n.getVariable(i)??0):i;return{update:t=>{e.setValue(r,q.lerp(s,l,t))},start:()=>{e.setValue(r,s)},end:()=>{e.setValue(r,l)}}}(e,t,a,r,n);if("boolean"!=typeof o){if(o instanceof G)return function(e,t,a,r){if(!e.hasValue(r)||!(r in a))return;let n=e.getValue(r),o=t?(new G).fromArray(t[r]):n.clone(),i=(new G).fromArray(a[r]);return o.equals(i)?void 0:{update:e=>{n.lerpVectors(o,i,e)},start:()=>{n.copy(o)},end:()=>{n.copy(i)}}}(e,t,a,r);if(o instanceof I)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=e.getValue(r),i=t?t[r]:void 0,s=a[r],l=i?Z(new I,i,n):o.clone(),u=Z(new I,s,n);return l.equals(u)?void 0:{update:e=>{o.lerpVectors(l,u,e)},start:()=>{o.copy(l)},end:()=>{o.copy(u)}}}(e,t,a,r,n);if(o instanceof m)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:void 0,i=a[r],s=e.getValue(r),l=o?"string"==typeof o?n.color(o).clone():(new $).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.color(i).clone():new m(i.r,i.g,i.b,i.a);if(l.equals(u))return;let d=s.clone();return{update:t=>{e.getValue(r)!==d&&e.setValue(r,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,a,r,n);if(o instanceof $)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:void 0,i=a[r],s=e.getValue(r),l=o?"string"==typeof o?n.color(o).clone():(new $).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.color(i).clone():(new $).setRGB(i.r,i.g,i.b);if(l.equals(u))return;let d=s.clone();return{update:t=>{e.getValue(r)!==d&&e.setValue(r,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,a,r,n);if("isTexture"in o)return function(e,t,a,r="texture"){if(!e.hasValue(r)||!(r in a))return;let n=e.getNode("rotation"),o=t?.[r]?.rotation??0,i=a[r]?.rotation??0;if(n&&o!==i)return{update:e=>{n.value=q.lerp(o,i,e)*q.DEG2RAD},start:()=>{n.value=o*q.DEG2RAD},end:()=>{n.value=i*q.DEG2RAD}};let s=e.getNode("mat"),l=s&&"function"==typeof s.updateMatrix?s:e.getValue("mat");if(!l)return;let u=t?t[r]:l,d=a[r],p=[...u.repeat],c=[...u.offset],h=[...d.repeat],f=[...d.offset],g=u.rotation??0,m=d.rotation??0;return R.isEqual(p,h)&&R.isEqual(c,f)&&g===m?void 0:{update:e=>{l.repeat=R.lerp(p,h,e),l.offset=R.lerp(c,f,e),l.rotation=q.lerp(g,m,e),l.updateMatrix()},start:()=>{l.repeat=[...p],l.offset=[...c],l.rotation=g,l.updateMatrix()},end:()=>{l.repeat=[...h],l.offset=[...f],l.rotation=m,l.updateMatrix()}}}(e,t,a,r)}}}function ie(e,t,a,r){let n=[],o=p(a,r)||!!t.layers&&p(t,r);n.push(function(e,t){return{update:()=>{e.transparent=t}}}(e,o)),function(e,t,a){let r=e.ensureRainbowNoiseCompiled;if("function"==typeof r)for(let n of[...e.layers]){if("rainbow"!==n.type)continue;let o=t.layers?.data(n.uuid),i=a.layers.data(n.uuid);(c(o?.noiseStrength)||c(i?.noiseStrength))&&r.call(e,n.uuid)}}(e,t,a);for(let o of e.layers){let e=t.layers?.data(o.uuid),i=a.layers.data(o.uuid);if(!i||"light"!==o.type&&(!(o.visible??1)||!(i.visible??1)))continue;let s=h[o.type]??[],l=o.getNames().filter(e=>!s.includes(e)&&!k.some(t=>e.includes(t)));for(let t of l)try{let a=oe(o,e,i,t,r);a&&(Array.isArray(a)?n.push(...a):n.push(a))}catch(e){console.error(`lerpMaterial: unexpected material layer for ${t}`,e)}}return n}function se(e,t,a,r,n,o){let i=oe(t,a,r,e,o);!i||(Array.isArray(i)?i.forEach(e=>e.update(n)):i.update(n))}new U;var le=new I,ue=new U;function de(e,t,a,r){let n=r.cloner?.parameters;if(n){ae("count",n,e,t,a),n.count=Math.trunc(n.count);for(let r of x)ae(r,n.radial,e.radial,t.radial,a);for(let r of B)ae(r,n.linear,e.linear,t.linear,a);for(let r of O)ae(r,n.grid,e.grid,t.grid,a);for(let r of A)ae(r,n.toObject,e.toObject,t.toObject,a);return n}}function pe(e,t,a,r){let n=r.cloner?.parameters;if(n){for(let r of C)ae(r,n.randomnessObject,e.randomnessObject,t.randomnessObject,a);return n}}function ce(r,n,o,p,c){let h=[];return r.data.visible&&h.push(...function(e,t,a,r,n){let o,i,u,d,p,c,h,f,g=[];if(v(e)?(o=K("position",e,t,a,n),o&&g.push(o),u=J("rotation",e,t,a,n),u&&g.push(u),d=K("shear",e,t,a,n),d&&g.push(d)):(f={slide:t.pathSnapping?.slide??e.updatedPathSnapping?.slide??e.dataPatched.pathSnapping?.slide??0,offset:t.pathSnapping?.offset??e.updatedPathSnapping?.offset??e.dataPatched.pathSnapping?.offset??0},c=J("slide",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,a.pathSnapping??e.dataPatched.pathSnapping,n),c&&g.push(c),h=J("offset",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,a.pathSnapping??e.dataPatched.pathSnapping,n),h&&g.push(h),!c&&!h&&(o=X("position",e,t,a,n),o&&g.push(o),i=X("scale",e,t,a,n),i&&g.push(i),u=function(e,t,a,r,n){let o=t?.rotation?t.rotation.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*q.DEG2RAD):void 0,i=a.rotation?.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*q.DEG2RAD);if(!i)return;let s=o?(new I).fromArray(o):(new I).setFromEuler(e.rotation),l=(new I).fromArray(i);if(s.equals(l))return;let u=le.subVectors(l,s);if(r&&u.toArray().every(e=>Math.abs(e)<2*Math.PI)){let t=(new z).setFromEuler(ue.setFromVector3(s)),a=(new z).setFromEuler(ue.setFromVector3(l));return{update:r=>{!function(e,t,a,r){if(0===r)return a.copy(e);if(1===r)return a.copy(t);let n=e.w*t.w+e.x*t.x+e.y*t.y+e.z*t.z;if(n>=1)return a.copy(e);let o=1-n*n;if(o<=Number.EPSILON){let n=1-r;return a.w=n*e.w+r*t.w,a.x=n*e.x+r*t.x,a.y=n*e.y+r*t.y,a.z=n*e.z+r*t.z,a.normalize(),a}let i=Math.sqrt(o),s=Math.atan2(i,n),l=Math.sin((1-r)*s)/i,u=Math.sin(r*s)/i;a.w=e.w*l+t.w*u,a.x=e.x*l+t.x*u,a.y=e.y*l+t.y*u,a.z=e.z*l+t.z*u}(t,a,e.quaternion,r)},start:()=>{e.rotation.setFromVector3(s)},end:()=>{e.rotation.setFromVector3(l)}}}return{update:t=>{le.lerpVectors(s,l,t),e.rotation.setFromVector3(le)},start:()=>{e.rotation.setFromVector3(s)},end:()=>{e.rotation.setFromVector3(l)}}}(e,t,a,r,n),u&&g.push(u),p=function(e,t,a,r){let n=a[e]?a[e]:void 0,o=r[e];if(!o)return;let i=t[e],s=n?(new F).fromArray(n):i.clone(),l=new I,u=new z,d=new I;s.decompose(l,u,d);let p=(new F).fromArray(o),c=new I,h=new z,f=new I;return p.decompose(c,h,f),s.equals(p)?void 0:{update:e=>{Q.slerpQuaternions(u,h,e),_.lerpVectors(l,c,e),L.lerpVectors(d,f,e),i.compose(_,Q,L)},start:()=>{i.compose(l,u,d)},end:()=>{i.compose(c,h,f)}}}("hiddenMatrix",e,t,a),p&&g.push(p))),o||i||u||p||c||h){let a=v(e)?()=>{e.updateWorldMatrix(!0,!1,!0),e.resetBBoxNeedsUpdate()}:()=>{e.updateMatrix(),e.hasNonUniformScale&&(e.updateMatrixWorld(),e.updateMatrixWorldRigid()),e.parent?.matrixWorldFusedFalse&&(e.matrixWorld.multiplyMatrices(e.parent.matrixWorldFusedFalse,e.matrix),e.matrixWorldNeedsUpdate=!1),s(e)&&l(e.parent)&&e.invalidateDownstreamBooleanData(!0),e.updatePathSnapping(Object.assign({},t.pathSnapping,f))};g.push({update:a,start:a,end:a})}return g}(r,n,o,c,p.shared)),v(r)?h.push(...function(r,n,o,i,s){let l,u,d,p,c,h,f,g,m,y,b,v,w,j,S,D=[];if("width"in r&&(l=J("width",r,n,o,s),l&&D.push(l)),"height"in r&&(u=J("height",r,n,o,s),u&&D.push(u)),r instanceof e||r instanceof a){let t={...n.fill},a={...o.fill};void 0!==t.enabled&&t.enabled!==a.enabled&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.fill.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),d=ee("color",r.fill,t,a,s),d&&D.push(d)}if(r instanceof e){let t={...n.stroke},a={...o.stroke};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.stroke.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),p=ee("color",r.stroke,t,a,s),p&&D.push(p),c=J("thickness",r.stroke,t,a,s),c&&D.push(c)}if(r instanceof e){let t={...n.dropShadow},a={...o.dropShadow};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.dropShadow.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),h=ee("color",r.dropShadow,t,a,s),h&&D.push(h),f=J("blurRadius",r.dropShadow,t,a,s),f&&D.push(f),m=J("spread",r.dropShadow,t,a,s),m&&D.push(m),g=K("offset",r.dropShadow,t,a,s),g&&D.push(g)}if(r instanceof e){let t={...n.innerShadow},a={...o.innerShadow};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.innerShadow.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),y=ee("color",r.innerShadow,t,a,s),y&&D.push(y),b=J("blurRadius",r.innerShadow,t,a,s),b&&D.push(b),w=J("spread",r.innerShadow,t,a,s),w&&D.push(w),v=K("offset",r.innerShadow,t,a,s),v&&D.push(v)}if(r instanceof e||r instanceof a){let t={...n.backgroundBlur},a={...o.backgroundBlur};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.backgroundBlur.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),a.enabled||Object.assign(a,{enabled:!0,radius:0})),j=J("radius",r.backgroundBlur,t,a,s),j&&D.push(j)}if(r instanceof e){let t={...n.layerBlur},a={...o.layerBlur};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.layerBlur.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),a.enabled||Object.assign(a,{enabled:!0,radius:0})),S=J("radius",r.layerBlur,t,a,s),S&&D.push(S)}if(r instanceof a||r instanceof t){let e=H("cornerRadius",r,n,o,s);e&&D.push(e)}return D}(r,n,o,0,p.shared)):(r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(!("cloner"in a)||!e.cloner)return n;let o=e.cloner,i="cloner"in t?t.cloner:{},s=a.cloner;V.forEach(e=>{let t;t="count"===e?J("count",o.parameters,i,s,r.shared,!0):te(e,o.parameters,i??{},s,r.shared),t&&n.push(t)});let l=function(e,t,a,r){if("radial"!==e.parameters.type)return;let n=t.radial,o=a.radial;if(!o)return;let i=e.parameters.radial,s=[];return x.forEach(e=>{let t=te(e,i,n??{},o,r);t&&s.push(t)}),s}(o,i,s,r.shared);l?.length&&n.push(...l);let u=function(e,t,a,r){if("linear"!==e.parameters.type)return;let n=t.linear,o=a.linear;if(!o)return;let i=[],s=e.parameters.linear;return B.forEach(e=>{let t=te(e,s,n??{},o,r);t&&i.push(t)}),i}(o,i,s,r.shared);u?.length&&n.push(...u);let d=function(e,t,a,r){if("grid"!==e.parameters.type)return;let n=t.grid,o=a.grid;if(!o)return;let i=[],s=e.parameters.grid;return O.forEach(e=>{let t;t="count"===e?H(e,s,n??{},o,r,!0):te(e,s,n??{},o,r),t&&i.push(t)}),i}(o,i,s,r.shared);d?.length&&n.push(...d);let p=function(e,t,a,r){if("toObject"!==e.parameters.type)return;let n=t.toObject,o=a.toObject;if(!o)return;let i=[],s=e.parameters.toObject;return A.forEach(e=>{let t;t="count"===e?J(e,s,n??{},o,r,!0):te(e,s,n??{},o,r),t&&i.push(t)}),i}(o,i,s,r.shared);p?.length&&n.push(...p);let c=function(e,t,a,r){if(!e.parameters.randomness)return;let n=t.randomnessObject,o=a.randomnessObject;if(!o)return;let i=[],s=e.parameters.randomnessObject;return C.forEach(e=>{let t=te(e,s,n??{},o,r);t&&i.push(t)}),i}(o,i,s,r.shared);return c?.length&&n.push(...c),n.length&&n.push({update:()=>{o.update(r)}}),n}(r,n,o,p)),r instanceof y?(r instanceof g&&r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(!("geometry"in a))return n;let o=e.geometry.userData.parameters,i="geometry"in t?t.geometry:{},s=a.geometry;if(e instanceof d){let t=function(e,t,a,r){if(void 0===a.scaleBaked)return;let n=(t.scaleBaked??e.data.geometry.scaleBaked).map(e=>"string"==typeof e?Number(r.shared.getVariable(e)??0):e),o=a.scaleBaked.map(e=>"string"==typeof e?Number(r.shared.getVariable(e)??0):e);if(S.isEqual(n,o))return;let i=[];return i.push({update:t=>{e.updateGeometryInteractions({scaleBaked:[q.lerp(n[0],o[0],t),q.lerp(n[1],o[1],t),q.lerp(n[2],o[2],t)]},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)},start:()=>{e.updateGeometryInteractions({scaleBaked:n},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)},end:()=>{e.updateGeometryInteractions({scaleBaked:o},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)}}),i}(e,i,s,r);t&&n.push(...t)}else{let t={};if(Object.assign(t,j(o,N),j(i,N)),N.forEach(e=>{let a=te(e,t,i,s,r.shared);a&&n.push(a)}),b(e)){Object.assign(t,{extrusion:{...o.extrusion}});let e=function(e,t,a,r){if(!a.extrusion)return;let n=e.extrusion,o=t.extrusion??{},i=a.extrusion,s=[];return M.forEach(e=>{let t=te(e,n,o,i,r);t&&s.push(t)}),s}(t,i,s,r.shared);e&&n.push(...e)}n.length&&n.push({update:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)},start:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)},end:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)}})}return n}(r,n,o,p)),r.data.visible&&!(r instanceof f&&r.materialOverride)&&h.push(...function(e,t,a,r){let n=[];if(Array.isArray(e.material)){if(!("materials"in a)||!a.materials)return n;let o="materials"in t&&t.materials?t.materials:[],i=a.materials;e.material.forEach((e,t)=>{if(!i[t])return;let a=o[t]??{},s=i[t];"string"==typeof a||"string"==typeof s||n.push(...ie(e,a,s,r))})}else{if(!("material"in a)||!a.material)return n;let o="material"in t&&t.material?t.material:{},i=a.material;if("string"==typeof o||"string"==typeof i)return n;n.push(...ie(e.material,o,i,r))}return n}(r,n,o,p.shared))):i.is(r)?r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(void 0!==a.intensity){let o=J("intensity",e,t,a,r);o&&n.push(o)}if(void 0!==a.color){let o=function(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=o?"string"==typeof o?n.getColor(o).clone():(new $).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.getColor(i).clone():(new $).setRGB(i.r,i.g,i.b);if(l.equals(u))return;let d=s.clone();return{update:a=>{d.lerpColors(l,u,a),t[e]?.copy?.(d)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}("color",e,t,a,r);o&&n.push(o)}return n}(r,n,o,p.shared)):r instanceof u&&h.push(...function(e,t,a,r){let n=[],o="OrthographicCamera"===e.cameraType?t.orthographic?.zoom:t.perspective?.zoom,i="OrthographicCamera"===e.cameraType?a.orthographic?.zoom:a.perspective?.zoom;if(void 0!==i){let t=o??e.zoom,a=i;t!==a&&n.push({update:r=>{e.zoom=q.lerp(t,a,r),e.updateProjectionMatrix()},start:()=>{e.zoom=t,e.updateProjectionMatrix()},end:()=>{e.zoom=a,e.updateProjectionMatrix()}})}if(void 0!==a.targetOffset){let o=J("targetOffset",e,t,a,r);o&&n.push(o)}return n}(r,n,o,p.shared))),h.length?{update:e=>{h.forEach(t=>t.update(e))},start:e=>{h.forEach(t=>t.start?.(e))},end:e=>{h.forEach(t=>t.end?.(e))}}:void 0}function he(e,t){return{position(t){Object.assign(e.position,t),(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},rotation(t){let a=Object.keys(t)[0];e.rotation[a]=t[a]*q.DEG2RAD,(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},scale(t){Object.assign(e.scale,t),(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},shapeSize(a){e instanceof g&&(e.userData.value={...e.userData.value,...a},(void 0!==a.x||void 0!==a.y||void 0!==a.z)&&(e.updateGeometryInteractions({width:e.userData.value.x,height:e.userData.value.y,depth:e.userData.value.z},t.shared),e.resetBBoxNeedsUpdate(),e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})))},material(a,r,n){n&&(Object.entries(n).forEach(([a,{start:n,end:o,t:i}])=>{let s=r.getValue(a);e instanceof y&&!Array.isArray(e.material)&&"alpha"===a&&"number"==typeof s&&s>0&&(e.material.transparent=!0),void 0!==s&&se(a,r,n,o,i,t.shared)}),e.dispatchEvent({type:"requestRender"}))},opacity(a){if(e instanceof y&&!Array.isArray(e.material)){let r=e.material.getLayersOfType("light")[0];if(void 0===r)return;e.material.transparent=!0,se("alphaOverride",r,{alphaOverride:a},{alphaOverride:a+1},0,t.shared),e.dispatchEvent({type:"requestRender"})}},light(t,a){(e instanceof n||e instanceof r||e instanceof o)&&(e[t]=a,e.dispatchEvent({type:"requestRender"}))},cloner(e){e.cloner?.update(t),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})},pathExtrusion(e,a){e.geometry.userData.parameters.extrusion={...e.geometry.userData.parameters.extrusion,...a},e.updateGeometryInteractions({extrusion:{...e.geometry.userData.parameters.extrusion}},t.shared),e.resetBBoxNeedsUpdate(),e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})},pathSnapping(t){e.userData.pathSnapping={...e.userData.pathSnapping,...t},e.updatePathSnapping(e.userData.pathSnapping),e.dispatchEvent({type:"requestRender"})}}}var fe={type:"beginState"};function ge(e){let t;if(5===e.easing){let{control1:a,control2:r}=e;t=`cubicBezier(\n\t\t\t${a[0]}, ${a[1]}, ${r[0]}, ${r[1]}\n\t\t)`}else if(6===e.easing){let{mass:a,stiffness:r,damping:n,velocity:o}=e;t=`spring( ${a}, ${r}, ${n}, ${o} )`}else{let a;switch(e.easing){case 0:default:a=E.linear;break;case 1:a=E.ease;break;case 2:a=E.easeIn;break;case 3:a=E.easeOut;break;case 4:a=E.easeInOut}let[r,n,o,i]=a;t=`cubicBezier( ${r}, ${n}, ${o}, ${i} )`}return{duration:Math.max(e.duration,1e-4),easing:t}}function me(e){let t={delay:0,loop:-1===e.repeat||e.repeat+1};if(0===e.repeat)t.direction="normal",t.rewind=!1;else switch(e.direction){case"pingpong":t.direction="alternate",t.rewind=!1;break;case"pingpong-rewind":t.direction="alternate",t.rewind=!0;break;default:t.direction="normal",t.rewind=!1}switch(t.delay=0,t.endDelay=0,t.startOnceDelay=0,t.pingPongDelayCorrection=0,t.pingPongEndDelayCorrection=0,e.delayDirection){case"start-once":t.startOnceDelay=e.delay;break;case"start":t.delay=e.delay;break;case"end":t.endDelay=e.delay;break;case"start-end":case void 0:t.delay=e.delay,t.endDelay=e.delay}return"alternate"===t.direction&&(t.delay/=2,t.endDelay/=2,"start"===e.delayDirection?(t.pingPongDelayCorrection=t.delay,"number"==typeof t.loop&&t.loop%2==0&&(t.pingPongEndDelayCorrection=t.delay)):"end"===e.delayDirection?"number"==typeof t.loop&&t.loop%2!=0&&(t.pingPongEndDelayCorrection=t.endDelay):"start-end"===e.delayDirection&&(t.pingPongDelayCorrection=t.delay,t.pingPongEndDelayCorrection=t.endDelay)),t}var ye={type:"completeState",isfromEntity:!1};function be(e,t){let a,r;if("string"==typeof t?(a=t,r=e.states?.[a]):null===t&&(a=null,r=e.data),void 0!==a&&void 0!==r)return{id:a,data:r}}var ve=class{constructor(e,t,a,r,n,o,i){if(this.object=e,this.data=r,this.sharedAssets=n,this.allowSlerp=o,this.page=i,this.targets={t:0},this.firstLoop=!0,this._changeBegan=!1,this._changeCompleted=!0,this.onChange=()=>{this.callback&&(this.callback.update(this.targets.t),this.object.requestRender()),0===this.targets.t||1===this.targets.t?this._changeCompleted||(this._changeCompleted=!0,this._changeBegan=!1,this.onChangeComplete()):(this._changeCompleted&&(this._changeCompleted=!1),this._changeBegan||(this._changeBegan=!0,this.onChangeBegin()))},this.onChangeBegin=()=>{this.object.reversibleToState=this.to.id;let e=this.targets.t>.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=e,this.object.dispatchEvent({type:"beginState",state:e}),v(this.object)||this.object.traverseEntity(e=>{e!==this.object&&e instanceof u&&e.dispatchEvent(fe)})},this.onChangeComplete=()=>{this.firstLoop&&(this.onFirstLoop(),this.firstLoop=!1),this.object.reversibleToState=this.to.id;let e=this.targets.t<.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=e,this.object.dispatchEvent({type:"completeState",state:e}),v(this.object)||this.object.traverseEntity(e=>{e!==this.object&&e instanceof u&&e.dispatchEvent(ye)})},this.onFirstLoop=()=>{this.useCurrentState&&(this.callback=ce(this.object,this.from.data,this.to.data,{scene:this.page.scene,shared:this.sharedAssets},this.allowSlerp))},void 0===t){let e=be(this.object,this.object.currentState===a?this.object.prevState:this.object.currentState);if(!e)throw new Error("Missing property");this.from=e}else{let e=be(this.object,t);if(!e)throw new Error("Missing property");this.from=e}if(void 0===a)throw new Error("Missing property");{let e=be(this.object,a);if(!e)throw new Error("Missing property");this.to=e}this.useCurrentState=void 0===t||void 0===a,this.params={targets:this.targets,t:1,autoplay:!1,...me(r),...ge(r),change:this.onChange},this.callback=ce(this.object,void 0===t?{}:this.from.data,void 0===a?{}:this.to.data,{scene:this.page.scene,shared:this.sharedAssets},this.allowSlerp)}get changeBegan(){return this._changeBegan}get changeCompleted(){return this._changeCompleted}};export{re as a,ne as b,de as c,pe as d,he as e,fe as f,ge as g,me as h,ye as i,be as j,ve as k};
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-AVO7AFZY.js";import{ea as t}from"./runtime-chunk-BY4Y72LZ.js";import{h as a}from"./runtime-chunk-MQKKQEK3.js";import{c as s,e as o,f as i}from"./runtime-chunk-2PT2WH66.js";import{b as r}from"./runtime-chunk-VGEECQH4.js";import{Ea as n,w as d}from"./runtime-chunk-D3BWEUN6.js";import{Fc as c}from"./runtime-chunk-BVVSZMXD.js";var l=new c;function u(e,t,s=!1){let o=[],c=a=>{let s=a.data;delete a.states,a.currentState=null,a.reversibleToState=null,a.currentTransitionEvent=null;for(let e of s.states){let t={...e.data};a.states||(a.states={}),a.states[e.id]=r.patch(s,t)}p(e.scene,a,null,t,void 0!==s.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),f(e)};e.scene.traverse2D(c),e.traverseChildren(r=>{if(s&&(r.rigidBody?.setTranslation(r.position0,!0),r.rigidBody?.setRotation(r.rotation0,!0),r.rigidBody?.setLinvel(l,!0),r.rigidBody?.setAngvel(l,!0)),!a.is(r))return;let u=r.uuid,f=r.data;if(delete r.states,r.uuid===d)return;let m=!1;o.some(t=>e.scene.find(u)?.isDescendantOf(t))?m=!0:!0===f.physics?.fusedBody&&"dynamic"===f.physics.rigidBody&&o.push(u),r.data=f,r.currentState=null,r.reversibleToState=null,r.currentTransitionEvent=null;for(let t of f.states){let a={...t.data};!0===e.data.globalPhysics.usePhysics&&f.physics&&("dynamic"===f.physics.rigidBody||m)&&(void 0!==t.data.position&&delete a.position,void 0!==t.data.rotation&&delete a.rotation,void 0!==t.data.hiddenMatrix&&delete a.hiddenMatrix),r.states||(r.states={}),r.states[t.id]=n.patch(f,a)}p(e.scene,r,null,t,void 0!==f.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),i(r)&&r.frame&&(r.frame.traverse(e=>c(e)),r.uiCanvas?.applySize())}),f(e),e.frame&&(e.frame.traverse(e=>c(e)),e.uiCanvas?.applySize())}function f(e){e.traverseEntity(t=>{for(let a of t.data.events){let t=[];switch(a.data.type){case"Follow":case"MouseHover":case"Scroll":case"MouseDown":case"MouseUp":case"MousePress":case"KeyUp":case"KeyDown":case"KeyPress":case"Collision":t.push(...a.data.actions);break;case"GameControl":for(let e of Object.values(a.data.gameActions))t.push(...e);break;case"DragDrop":t.push(...a.data.dragDropActions.drag,...a.data.dragDropActions.drop);break;case"Conditional":t.push(...a.data.inActions,...a.data.outActions)}for(let a of t)if("Create"===a.data.type&&"Yes"===a.data.hideBase){let t=e.scene.find(a.data.object);t&&(t.visible=!1)}}})}function p(a,i,r,n,d=!1){if(a.markShadowsDirty(),i instanceof t&&!s(i)&&i.removeInteractionGeometry(n),o(i)?i.changeSelectedState(r,{shared:n},d):i.changeSelectedState(r,{scene:a,shared:n},d),i instanceof t&&i.updateGeometryGroupsIfNeeded(),i instanceof e&&i.updateCameraState(i.dataPatched,{scene:a,shared:n}),!o(i)){if(i.cloner){let e=!1;for(let t of i.cloner.children)t.playModeVisible=void 0,void 0!==t.transformOverride&&(t.transformOverride=void 0,e=!0);e&&a.addPendingUpdateCloner(i),i.cloner.syncInstanceMatrices()}i.updateVisible()}}export{u as a};
1
+ import{a as e}from"./runtime-chunk-WILQUYJ4.js";import{ea as t}from"./runtime-chunk-HKFPEE5F.js";import{h as a}from"./runtime-chunk-A7IMJ4FJ.js";import{c as s,e as o,f as i}from"./runtime-chunk-2PT2WH66.js";import{b as r}from"./runtime-chunk-VGEECQH4.js";import{Ea as n,w as d}from"./runtime-chunk-D3BWEUN6.js";import{Fc as c}from"./runtime-chunk-BVVSZMXD.js";var l=new c;function u(e,t,s=!1){let o=[],c=a=>{let s=a.data;delete a.states,a.currentState=null,a.reversibleToState=null,a.currentTransitionEvent=null;for(let e of s.states){let t={...e.data};a.states||(a.states={}),a.states[e.id]=r.patch(s,t)}p(e.scene,a,null,t,void 0!==s.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),f(e)};e.scene.traverse2D(c),e.traverseChildren(r=>{if(s&&(r.rigidBody?.setTranslation(r.position0,!0),r.rigidBody?.setRotation(r.rotation0,!0),r.rigidBody?.setLinvel(l,!0),r.rigidBody?.setAngvel(l,!0)),!a.is(r))return;let u=r.uuid,f=r.data;if(delete r.states,r.uuid===d)return;let m=!1;o.some(t=>e.scene.find(u)?.isDescendantOf(t))?m=!0:!0===f.physics?.fusedBody&&"dynamic"===f.physics.rigidBody&&o.push(u),r.data=f,r.currentState=null,r.reversibleToState=null,r.currentTransitionEvent=null;for(let t of f.states){let a={...t.data};!0===e.data.globalPhysics.usePhysics&&f.physics&&("dynamic"===f.physics.rigidBody||m)&&(void 0!==t.data.position&&delete a.position,void 0!==t.data.rotation&&delete a.rotation,void 0!==t.data.hiddenMatrix&&delete a.hiddenMatrix),r.states||(r.states={}),r.states[t.id]=n.patch(f,a)}p(e.scene,r,null,t,void 0!==f.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),i(r)&&r.frame&&(r.frame.traverse(e=>c(e)),r.uiCanvas?.applySize())}),f(e),e.frame&&(e.frame.traverse(e=>c(e)),e.uiCanvas?.applySize())}function f(e){e.traverseEntity(t=>{for(let a of t.data.events){let t=[];switch(a.data.type){case"Follow":case"MouseHover":case"Scroll":case"MouseDown":case"MouseUp":case"MousePress":case"KeyUp":case"KeyDown":case"KeyPress":case"Collision":t.push(...a.data.actions);break;case"GameControl":for(let e of Object.values(a.data.gameActions))t.push(...e);break;case"DragDrop":t.push(...a.data.dragDropActions.drag,...a.data.dragDropActions.drop);break;case"Conditional":t.push(...a.data.inActions,...a.data.outActions)}for(let a of t)if("Create"===a.data.type&&"Yes"===a.data.hideBase){let t=e.scene.find(a.data.object);t&&(t.visible=!1)}}})}function p(a,i,r,n,d=!1){if(a.markShadowsDirty(),i instanceof t&&!s(i)&&i.removeInteractionGeometry(n),o(i)?i.changeSelectedState(r,{shared:n},d):i.changeSelectedState(r,{scene:a,shared:n},d),i instanceof t&&i.updateGeometryGroupsIfNeeded(),i instanceof e&&i.updateCameraState(i.dataPatched,{scene:a,shared:n}),!o(i)){if(i.cloner){let e=!1;for(let t of i.cloner.children)t.playModeVisible=void 0,void 0!==t.transformOverride&&(t.transformOverride=void 0,e=!0);e&&a.addPendingUpdateCloner(i),i.cloner.syncInstanceMatrices()}i.updateVisible()}}export{u as a};