@splinetool/runtime 2.0.52 → 2.0.54
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.
- package/build/boolean.js +1 -1
- package/build/boolean.js.br +0 -0
- package/build/boolean.js.gz +0 -0
- package/build/hana-ui.wasm +0 -0
- package/build/hana-ui.wasm.br +0 -0
- package/build/hana-ui.wasm.gz +0 -0
- package/build/runtime-DRACOLoader-GLMRFFK2.js +1 -0
- package/build/runtime-DRACOLoader-GLMRFFK2.js.br +0 -0
- package/build/runtime-DRACOLoader-GLMRFFK2.js.gz +0 -0
- package/build/{runtime-aiAssistant-Q7WOWTCF.js → runtime-aiAssistant-QYI2OEAT.js} +1 -1
- package/build/runtime-aiAssistant-QYI2OEAT.js.br +0 -0
- package/build/runtime-aiAssistant-QYI2OEAT.js.gz +0 -0
- package/build/{runtime-apiServices-TWKYVKXK.js → runtime-apiServices-NYOQMQZG.js} +1 -1
- package/build/runtime-apiServices-NYOQMQZG.js.br +0 -0
- package/build/runtime-apiServices-NYOQMQZG.js.gz +0 -0
- package/build/{runtime-audio-EAVYJJ6Y.js → runtime-audio-43VUDXSF.js} +1 -1
- package/build/runtime-audio-43VUDXSF.js.br +0 -0
- package/build/runtime-audio-43VUDXSF.js.gz +0 -0
- package/build/{runtime-chunk-I42QES7U.js → runtime-chunk-333ZOV2S.js} +1 -1
- package/build/runtime-chunk-333ZOV2S.js.br +0 -0
- package/build/runtime-chunk-333ZOV2S.js.gz +0 -0
- package/build/{runtime-chunk-5HGNTQER.js → runtime-chunk-4GLZNPR6.js} +1 -1
- package/build/runtime-chunk-4GLZNPR6.js.br +0 -0
- package/build/runtime-chunk-4GLZNPR6.js.gz +0 -0
- package/build/{runtime-chunk-KK2QQ4ZZ.js → runtime-chunk-5QDCFNS4.js} +1 -1
- package/build/runtime-chunk-5QDCFNS4.js.br +0 -0
- package/build/runtime-chunk-5QDCFNS4.js.gz +0 -0
- package/build/{runtime-chunk-LIWWHPUH.js → runtime-chunk-5Y2MXXX6.js} +1 -1
- package/build/runtime-chunk-5Y2MXXX6.js.br +0 -0
- package/build/runtime-chunk-5Y2MXXX6.js.gz +0 -0
- package/build/runtime-chunk-77S3KKYT.js +1 -0
- package/build/runtime-chunk-77S3KKYT.js.br +0 -0
- package/build/runtime-chunk-77S3KKYT.js.gz +0 -0
- package/build/{runtime-chunk-N4NXFFQN.js → runtime-chunk-7AN6SYSU.js} +1 -1
- package/build/runtime-chunk-7AN6SYSU.js.br +0 -0
- package/build/runtime-chunk-7AN6SYSU.js.gz +0 -0
- package/build/{runtime-chunk-5KBBYU4N.js → runtime-chunk-AE3KJLVD.js} +1 -1
- package/build/runtime-chunk-AE3KJLVD.js.br +0 -0
- package/build/runtime-chunk-AE3KJLVD.js.gz +0 -0
- package/build/{runtime-chunk-6B53B4ZA.js → runtime-chunk-B2LLDBVR.js} +1 -1
- package/build/runtime-chunk-B2LLDBVR.js.br +0 -0
- package/build/runtime-chunk-B2LLDBVR.js.gz +0 -0
- package/build/runtime-chunk-C5BW2BYH.js +1 -0
- package/build/runtime-chunk-C5BW2BYH.js.br +0 -0
- package/build/runtime-chunk-C5BW2BYH.js.gz +0 -0
- package/build/{runtime-chunk-NBSMJJGP.js → runtime-chunk-CDUGB775.js} +1 -1
- package/build/runtime-chunk-CDUGB775.js.br +0 -0
- package/build/runtime-chunk-CDUGB775.js.gz +0 -0
- package/build/{runtime-chunk-X6BELYL5.js → runtime-chunk-CNYYWTRG.js} +1 -1
- package/build/runtime-chunk-CNYYWTRG.js.br +0 -0
- package/build/runtime-chunk-CNYYWTRG.js.gz +0 -0
- package/build/{runtime-chunk-7AY2FNTL.js → runtime-chunk-D4RTVX56.js} +1 -1
- package/build/runtime-chunk-D4RTVX56.js.br +0 -0
- package/build/runtime-chunk-D4RTVX56.js.gz +0 -0
- package/build/{runtime-chunk-ZYT7ZGNV.js → runtime-chunk-G4XAQUT2.js} +1 -1
- package/build/runtime-chunk-G4XAQUT2.js.br +0 -0
- package/build/runtime-chunk-G4XAQUT2.js.gz +0 -0
- package/build/{runtime-chunk-NMRQ6IV4.js → runtime-chunk-K3UQCG3P.js} +1 -1
- package/build/runtime-chunk-K3UQCG3P.js.br +0 -0
- package/build/{runtime-chunk-NMRQ6IV4.js.gz → runtime-chunk-K3UQCG3P.js.gz} +0 -0
- package/build/{runtime-chunk-GZJFFVMH.js → runtime-chunk-KD4RAVC6.js} +1 -1
- package/build/runtime-chunk-KD4RAVC6.js.br +0 -0
- package/build/runtime-chunk-KD4RAVC6.js.gz +0 -0
- package/build/{runtime-chunk-3F6LVH6N.js → runtime-chunk-KG3JC3MU.js} +1 -1
- package/build/runtime-chunk-KG3JC3MU.js.br +0 -0
- package/build/runtime-chunk-KG3JC3MU.js.gz +0 -0
- package/build/{runtime-chunk-M3IGVAW7.js → runtime-chunk-LDVHB5FO.js} +1 -1
- package/build/runtime-chunk-LDVHB5FO.js.br +0 -0
- package/build/runtime-chunk-LDVHB5FO.js.gz +0 -0
- package/build/{runtime-chunk-UOHC2OET.js → runtime-chunk-M6FFVLT6.js} +1 -1
- package/build/runtime-chunk-M6FFVLT6.js.br +0 -0
- package/build/runtime-chunk-M6FFVLT6.js.gz +0 -0
- package/build/{runtime-chunk-TSPPXQ66.js → runtime-chunk-M7VGJ5HW.js} +1 -1
- package/build/runtime-chunk-M7VGJ5HW.js.br +0 -0
- package/build/runtime-chunk-M7VGJ5HW.js.gz +0 -0
- package/build/{runtime-chunk-G6ZT5GAD.js → runtime-chunk-ODVIMOLE.js} +1 -1
- package/build/runtime-chunk-ODVIMOLE.js.br +0 -0
- package/build/runtime-chunk-ODVIMOLE.js.gz +0 -0
- package/build/{runtime-chunk-563PYPN4.js → runtime-chunk-QG5XINCE.js} +1 -1
- package/build/runtime-chunk-QG5XINCE.js.br +0 -0
- package/build/runtime-chunk-QG5XINCE.js.gz +0 -0
- package/build/{runtime-chunk-AYKUVZGC.js → runtime-chunk-R2PNQV2A.js} +1 -1
- package/build/runtime-chunk-R2PNQV2A.js.br +0 -0
- package/build/runtime-chunk-R2PNQV2A.js.gz +0 -0
- package/build/{runtime-chunk-3QS5XSMI.js → runtime-chunk-UUHLQQOF.js} +1 -1
- package/build/runtime-chunk-UUHLQQOF.js.br +0 -0
- package/build/runtime-chunk-UUHLQQOF.js.gz +0 -0
- package/build/{runtime-chunk-AZB3ROBJ.js → runtime-chunk-V6DRGTD6.js} +1 -1
- package/build/runtime-chunk-V6DRGTD6.js.br +0 -0
- package/build/runtime-chunk-V6DRGTD6.js.gz +0 -0
- package/build/{runtime-chunk-7O5DALO7.js → runtime-chunk-VNSXYJJ4.js} +1 -1
- package/build/runtime-chunk-VNSXYJJ4.js.br +0 -0
- package/build/runtime-chunk-VNSXYJJ4.js.gz +0 -0
- package/build/{runtime-chunk-TKCOO74F.js → runtime-chunk-YMKCEDKL.js} +1 -1
- package/build/runtime-chunk-YMKCEDKL.js.br +0 -0
- package/build/runtime-chunk-YMKCEDKL.js.gz +0 -0
- package/build/{runtime-chunk-2HISS44Y.js → runtime-chunk-YMO675HZ.js} +1 -1
- package/build/runtime-chunk-YMO675HZ.js.br +0 -0
- package/build/runtime-chunk-YMO675HZ.js.gz +0 -0
- package/build/{runtime-chunk-LYI5RFFL.js → runtime-chunk-YR2R64PI.js} +1 -1
- package/build/runtime-chunk-YR2R64PI.js.br +0 -0
- package/build/runtime-chunk-YR2R64PI.js.gz +0 -0
- package/build/{runtime-classicRuntime-GZEGVJ7B.js → runtime-classicRuntime-NLCUPLCP.js} +1 -1
- package/build/runtime-classicRuntime-NLCUPLCP.js.br +0 -0
- package/build/runtime-classicRuntime-NLCUPLCP.js.gz +0 -0
- package/build/runtime-cloners-GW6RJNUX.js +1 -0
- package/build/runtime-cloners-GW6RJNUX.js.br +0 -0
- package/build/runtime-cloners-GW6RJNUX.js.gz +0 -0
- package/build/{runtime-components-QFBU6NQX.js → runtime-components-WP55QEHC.js} +1 -1
- package/build/runtime-components-WP55QEHC.js.br +0 -0
- package/build/runtime-components-WP55QEHC.js.gz +0 -0
- package/build/{runtime-conditional-XSJDNYMV.js → runtime-conditional-P3ULJSG2.js} +1 -1
- package/build/runtime-conditional-P3ULJSG2.js.br +0 -0
- package/build/runtime-conditional-P3ULJSG2.js.gz +0 -0
- package/build/{runtime-createDestroy-4AEFZQ6Z.js → runtime-createDestroy-6CB23YPW.js} +1 -1
- package/build/runtime-createDestroy-6CB23YPW.js.br +0 -0
- package/build/runtime-createDestroy-6CB23YPW.js.gz +0 -0
- package/build/{runtime-dragDrop-MCBED4HC.js → runtime-dragDrop-KAWO74LN.js} +1 -1
- package/build/runtime-dragDrop-KAWO74LN.js.br +0 -0
- package/build/runtime-dragDrop-KAWO74LN.js.gz +0 -0
- package/build/{runtime-gameControls-JQ3GPIIQ.js → runtime-gameControls-64ESDOTZ.js} +1 -1
- package/build/runtime-gameControls-64ESDOTZ.js.br +0 -0
- package/build/runtime-gameControls-64ESDOTZ.js.gz +0 -0
- package/build/runtime-hair-NNKBNXJP.js +1 -0
- package/build/runtime-hair-NNKBNXJP.js.br +1 -0
- package/build/runtime-hair-NNKBNXJP.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-OFAAEYTX.js → runtime-mergeStaticGeometries-3NTHH4WO.js} +1 -1
- package/build/runtime-mergeStaticGeometries-3NTHH4WO.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-3NTHH4WO.js.gz +0 -0
- package/build/{runtime-miscActions-HPVTGVUE.js → runtime-miscActions-YGY23LSE.js} +1 -1
- package/build/runtime-miscActions-YGY23LSE.js.br +0 -0
- package/build/runtime-miscActions-YGY23LSE.js.gz +0 -0
- package/build/{runtime-mouseHover-Y2BARDNH.js → runtime-mouseHover-VJCC3EWI.js} +1 -1
- package/build/runtime-mouseHover-VJCC3EWI.js.br +0 -0
- package/build/runtime-mouseHover-VJCC3EWI.js.gz +0 -0
- package/build/{runtime-particles-F5MUJ3SG.js → runtime-particles-KXSCQ3XN.js} +1 -1
- package/build/runtime-particles-KXSCQ3XN.js.br +0 -0
- package/build/runtime-particles-KXSCQ3XN.js.gz +0 -0
- package/build/{runtime-paths-4JBIN2NB.js → runtime-paths-MDXY75OZ.js} +1 -1
- package/build/runtime-paths-MDXY75OZ.js.br +0 -0
- package/build/runtime-paths-MDXY75OZ.js.gz +0 -0
- package/build/{runtime-resize-C4J5X2UE.js → runtime-resize-UQFQWVFH.js} +1 -1
- package/build/runtime-resize-UQFQWVFH.js.br +0 -0
- package/build/runtime-resize-UQFQWVFH.js.gz +0 -0
- package/build/{runtime-sceneTransition-ZACN3VBY.js → runtime-sceneTransition-L63GLGEP.js} +1 -1
- package/build/runtime-sceneTransition-L63GLGEP.js.br +0 -0
- package/build/runtime-sceneTransition-L63GLGEP.js.gz +0 -0
- package/build/{runtime-scroll-W3ACRLD3.js → runtime-scroll-GAYM7P56.js} +1 -1
- package/build/runtime-scroll-GAYM7P56.js.br +0 -0
- package/build/runtime-scroll-GAYM7P56.js.gz +0 -0
- package/build/runtime-shapeBlends-GNZI2DZM.js +1 -0
- package/build/runtime-shapeBlends-GNZI2DZM.js.br +0 -0
- package/build/runtime-shapeBlends-GNZI2DZM.js.gz +0 -0
- package/build/{runtime-text-WPZBMBKI.js → runtime-text-3FDUPNEN.js} +1 -1
- package/build/runtime-text-3FDUPNEN.js.br +0 -0
- package/build/runtime-text-3FDUPNEN.js.gz +0 -0
- package/build/{runtime-textInputs-2ZNTJL63.js → runtime-textInputs-ZGBP7XND.js} +1 -1
- package/build/runtime-textInputs-ZGBP7XND.js.br +0 -0
- package/build/runtime-textInputs-ZGBP7XND.js.gz +0 -0
- package/build/{runtime-timeline-FQBHGQWZ.js → runtime-timeline-IA6DYERZ.js} +1 -1
- package/build/runtime-timeline-IA6DYERZ.js.br +0 -0
- package/build/runtime-timeline-IA6DYERZ.js.gz +0 -0
- package/build/{runtime-tracking-N5EXAGD3.js → runtime-tracking-SSZZY5QU.js} +1 -1
- package/build/runtime-tracking-SSZZY5QU.js.br +0 -0
- package/build/runtime-tracking-SSZZY5QU.js.gz +0 -0
- package/build/runtime-transitions-6BSS3AI5.js +1 -0
- package/build/runtime-transitions-6BSS3AI5.js.br +0 -0
- package/build/runtime-transitions-6BSS3AI5.js.gz +0 -0
- package/build/{runtime-ui2d-OSYYZANY.js → runtime-ui2d-DCWMMEO5.js} +1 -1
- package/build/runtime-ui2d-DCWMMEO5.js.br +0 -0
- package/build/runtime-ui2d-DCWMMEO5.js.gz +0 -0
- package/build/{runtime-updater-QYT2D73O.js → runtime-updater-6QPW4RJT.js} +1 -1
- package/build/runtime-updater-6QPW4RJT.js.br +1 -0
- package/build/runtime-updater-6QPW4RJT.js.gz +0 -0
- package/build/{runtime-variables-PI7YVOVR.js → runtime-variables-IRTA2G43.js} +1 -1
- package/build/runtime-variables-IRTA2G43.js.br +0 -0
- package/build/runtime-variables-IRTA2G43.js.gz +0 -0
- package/build/{runtime-vectorShapes-NAOKPPYS.js → runtime-vectorShapes-REXTFJ55.js} +1 -1
- package/build/runtime-vectorShapes-REXTFJ55.js.br +0 -0
- package/build/runtime-vectorShapes-REXTFJ55.js.gz +0 -0
- package/build/{runtime-video-5C4ZCNVD.js → runtime-video-3ET4F26V.js} +1 -1
- package/build/runtime-video-3ET4F26V.js.br +0 -0
- package/build/runtime-video-3ET4F26V.js.gz +0 -0
- package/build/runtime-webgpu-IGBYLILS.js +1 -0
- package/build/runtime-webgpu-IGBYLILS.js.br +0 -0
- package/build/runtime-webgpu-IGBYLILS.js.gz +0 -0
- package/build/runtime.cjs +355 -355
- package/build/runtime.js +1 -1
- package/build/runtime.js.br +0 -0
- package/build/runtime.js.gz +0 -0
- package/build/runtime.standalone.js +1 -1
- package/build/runtime.standalone.js.br +0 -0
- package/build/runtime.standalone.js.gz +0 -0
- package/build/runtime.standalone.webgl.js +1 -1
- package/build/runtime.standalone.webgl.js.br +0 -0
- package/build/runtime.standalone.webgl.js.gz +0 -0
- package/build/runtime.standalone.webgpu.js +1 -1
- package/build/runtime.standalone.webgpu.js.br +0 -0
- package/build/runtime.standalone.webgpu.js.gz +0 -0
- package/build/runtime.standalone.webgpu.micro.js +1 -1
- package/build/runtime.standalone.webgpu.micro.js.br +0 -0
- package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
- package/build/runtime.standalone.webgpu.min.js +1 -1
- package/build/runtime.standalone.webgpu.min.js.br +0 -0
- package/build/runtime.standalone.webgpu.min.js.gz +0 -0
- package/package.json +2 -1
- package/build/runtime-DRACOLoader-5OLRBTT3.js +0 -1
- package/build/runtime-DRACOLoader-5OLRBTT3.js.br +0 -0
- package/build/runtime-DRACOLoader-5OLRBTT3.js.gz +0 -0
- package/build/runtime-aiAssistant-Q7WOWTCF.js.br +0 -0
- package/build/runtime-aiAssistant-Q7WOWTCF.js.gz +0 -0
- package/build/runtime-apiServices-TWKYVKXK.js.br +0 -0
- package/build/runtime-apiServices-TWKYVKXK.js.gz +0 -0
- package/build/runtime-audio-EAVYJJ6Y.js.br +0 -0
- package/build/runtime-audio-EAVYJJ6Y.js.gz +0 -0
- package/build/runtime-chunk-2HISS44Y.js.br +0 -0
- package/build/runtime-chunk-2HISS44Y.js.gz +0 -0
- package/build/runtime-chunk-3F6LVH6N.js.br +0 -0
- package/build/runtime-chunk-3F6LVH6N.js.gz +0 -0
- package/build/runtime-chunk-3QS5XSMI.js.br +0 -0
- package/build/runtime-chunk-3QS5XSMI.js.gz +0 -0
- package/build/runtime-chunk-563PYPN4.js.br +0 -0
- package/build/runtime-chunk-563PYPN4.js.gz +0 -0
- package/build/runtime-chunk-5HGNTQER.js.br +0 -0
- package/build/runtime-chunk-5HGNTQER.js.gz +0 -0
- package/build/runtime-chunk-5KBBYU4N.js.br +0 -0
- package/build/runtime-chunk-5KBBYU4N.js.gz +0 -0
- package/build/runtime-chunk-6B53B4ZA.js.br +0 -0
- package/build/runtime-chunk-6B53B4ZA.js.gz +0 -0
- package/build/runtime-chunk-7AY2FNTL.js.br +0 -0
- package/build/runtime-chunk-7AY2FNTL.js.gz +0 -0
- package/build/runtime-chunk-7O5DALO7.js.br +0 -0
- package/build/runtime-chunk-7O5DALO7.js.gz +0 -0
- package/build/runtime-chunk-AYKUVZGC.js.br +0 -0
- package/build/runtime-chunk-AYKUVZGC.js.gz +0 -0
- package/build/runtime-chunk-AZB3ROBJ.js.br +0 -0
- package/build/runtime-chunk-AZB3ROBJ.js.gz +0 -0
- package/build/runtime-chunk-BPWKE4TV.js +0 -1
- package/build/runtime-chunk-BPWKE4TV.js.br +0 -0
- package/build/runtime-chunk-BPWKE4TV.js.gz +0 -0
- package/build/runtime-chunk-DL7X5N5X.js +0 -1
- package/build/runtime-chunk-DL7X5N5X.js.br +0 -0
- package/build/runtime-chunk-DL7X5N5X.js.gz +0 -0
- package/build/runtime-chunk-G6ZT5GAD.js.br +0 -0
- package/build/runtime-chunk-G6ZT5GAD.js.gz +0 -0
- package/build/runtime-chunk-GZJFFVMH.js.br +0 -0
- package/build/runtime-chunk-GZJFFVMH.js.gz +0 -0
- package/build/runtime-chunk-I42QES7U.js.br +0 -1
- package/build/runtime-chunk-I42QES7U.js.gz +0 -0
- package/build/runtime-chunk-KK2QQ4ZZ.js.br +0 -0
- package/build/runtime-chunk-KK2QQ4ZZ.js.gz +0 -0
- package/build/runtime-chunk-LIWWHPUH.js.br +0 -0
- package/build/runtime-chunk-LIWWHPUH.js.gz +0 -0
- package/build/runtime-chunk-LYI5RFFL.js.br +0 -0
- package/build/runtime-chunk-LYI5RFFL.js.gz +0 -0
- package/build/runtime-chunk-M3IGVAW7.js.br +0 -0
- package/build/runtime-chunk-M3IGVAW7.js.gz +0 -0
- package/build/runtime-chunk-N4NXFFQN.js.br +0 -0
- package/build/runtime-chunk-N4NXFFQN.js.gz +0 -0
- package/build/runtime-chunk-NBSMJJGP.js.br +0 -0
- package/build/runtime-chunk-NBSMJJGP.js.gz +0 -0
- package/build/runtime-chunk-NMRQ6IV4.js.br +0 -0
- package/build/runtime-chunk-TKCOO74F.js.br +0 -0
- package/build/runtime-chunk-TKCOO74F.js.gz +0 -0
- package/build/runtime-chunk-TSPPXQ66.js.br +0 -0
- package/build/runtime-chunk-TSPPXQ66.js.gz +0 -0
- package/build/runtime-chunk-UOHC2OET.js.br +0 -0
- package/build/runtime-chunk-UOHC2OET.js.gz +0 -0
- package/build/runtime-chunk-X6BELYL5.js.br +0 -0
- package/build/runtime-chunk-X6BELYL5.js.gz +0 -0
- package/build/runtime-chunk-ZYT7ZGNV.js.br +0 -0
- package/build/runtime-chunk-ZYT7ZGNV.js.gz +0 -0
- package/build/runtime-classicRuntime-GZEGVJ7B.js.br +0 -0
- package/build/runtime-classicRuntime-GZEGVJ7B.js.gz +0 -0
- package/build/runtime-cloners-7SKK4ILD.js +0 -1
- package/build/runtime-cloners-7SKK4ILD.js.br +0 -0
- package/build/runtime-cloners-7SKK4ILD.js.gz +0 -0
- package/build/runtime-components-QFBU6NQX.js.br +0 -0
- package/build/runtime-components-QFBU6NQX.js.gz +0 -0
- package/build/runtime-conditional-XSJDNYMV.js.br +0 -0
- package/build/runtime-conditional-XSJDNYMV.js.gz +0 -0
- package/build/runtime-createDestroy-4AEFZQ6Z.js.br +0 -0
- package/build/runtime-createDestroy-4AEFZQ6Z.js.gz +0 -0
- package/build/runtime-dragDrop-MCBED4HC.js.br +0 -0
- package/build/runtime-dragDrop-MCBED4HC.js.gz +0 -0
- package/build/runtime-gameControls-JQ3GPIIQ.js.br +0 -0
- package/build/runtime-gameControls-JQ3GPIIQ.js.gz +0 -0
- package/build/runtime-hair-BMIXD4DE.js +0 -1
- package/build/runtime-hair-BMIXD4DE.js.br +0 -3
- package/build/runtime-hair-BMIXD4DE.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-OFAAEYTX.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-OFAAEYTX.js.gz +0 -0
- package/build/runtime-miscActions-HPVTGVUE.js.br +0 -0
- package/build/runtime-miscActions-HPVTGVUE.js.gz +0 -0
- package/build/runtime-mouseHover-Y2BARDNH.js.br +0 -0
- package/build/runtime-mouseHover-Y2BARDNH.js.gz +0 -0
- package/build/runtime-particles-F5MUJ3SG.js.br +0 -0
- package/build/runtime-particles-F5MUJ3SG.js.gz +0 -0
- package/build/runtime-paths-4JBIN2NB.js.br +0 -0
- package/build/runtime-paths-4JBIN2NB.js.gz +0 -0
- package/build/runtime-resize-C4J5X2UE.js.br +0 -0
- package/build/runtime-resize-C4J5X2UE.js.gz +0 -0
- package/build/runtime-sceneTransition-ZACN3VBY.js.br +0 -0
- package/build/runtime-sceneTransition-ZACN3VBY.js.gz +0 -0
- package/build/runtime-scroll-W3ACRLD3.js.br +0 -0
- package/build/runtime-scroll-W3ACRLD3.js.gz +0 -0
- package/build/runtime-shapeBlends-A75ALCPS.js +0 -1
- package/build/runtime-shapeBlends-A75ALCPS.js.br +0 -0
- package/build/runtime-shapeBlends-A75ALCPS.js.gz +0 -0
- package/build/runtime-text-WPZBMBKI.js.br +0 -0
- package/build/runtime-text-WPZBMBKI.js.gz +0 -0
- package/build/runtime-textInputs-2ZNTJL63.js.br +0 -0
- package/build/runtime-textInputs-2ZNTJL63.js.gz +0 -0
- package/build/runtime-timeline-FQBHGQWZ.js.br +0 -0
- package/build/runtime-timeline-FQBHGQWZ.js.gz +0 -0
- package/build/runtime-tracking-N5EXAGD3.js.br +0 -0
- package/build/runtime-tracking-N5EXAGD3.js.gz +0 -0
- package/build/runtime-transitions-YUNUNEOJ.js +0 -1
- package/build/runtime-transitions-YUNUNEOJ.js.br +0 -0
- package/build/runtime-transitions-YUNUNEOJ.js.gz +0 -0
- package/build/runtime-ui2d-OSYYZANY.js.br +0 -0
- package/build/runtime-ui2d-OSYYZANY.js.gz +0 -0
- package/build/runtime-updater-QYT2D73O.js.br +0 -2
- package/build/runtime-updater-QYT2D73O.js.gz +0 -0
- package/build/runtime-variables-PI7YVOVR.js.br +0 -0
- package/build/runtime-variables-PI7YVOVR.js.gz +0 -0
- package/build/runtime-vectorShapes-NAOKPPYS.js.br +0 -0
- package/build/runtime-vectorShapes-NAOKPPYS.js.gz +0 -0
- package/build/runtime-video-5C4ZCNVD.js.br +0 -0
- package/build/runtime-video-5C4ZCNVD.js.gz +0 -0
- package/build/runtime-webgpu-TT4HHDA7.js +0 -1
- package/build/runtime-webgpu-TT4HHDA7.js.br +0 -0
- package/build/runtime-webgpu-TT4HHDA7.js.gz +0 -0
package/build/boolean.js
CHANGED
|
@@ -418,7 +418,7 @@ async function __wbg_init(module_or_path) {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
if (module_or_path === undefined) {
|
|
421
|
-
module_or_path = new URL('
|
|
421
|
+
module_or_path = new URL('boolean.wasm', import.meta.url);
|
|
422
422
|
}
|
|
423
423
|
const imports = __wbg_get_imports();
|
|
424
424
|
|
package/build/boolean.js.br
CHANGED
|
Binary file
|
package/build/boolean.js.gz
CHANGED
|
Binary file
|
package/build/hana-ui.wasm
CHANGED
|
Binary file
|
package/build/hana-ui.wasm.br
CHANGED
|
Binary file
|
package/build/hana-ui.wasm.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fe as e,Hc as t,Ib as r,Jb as s,Tc as o,Zc as a,dd as i,ed as n,fd as d,qe as l,re as c}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var u=new WeakMap,h={js:"",wasm:""},f=class extends l{constructor(e){super(e),this.decoderPaths={js:"",wasm:"",dep_js:""},this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(t){let{decoderPaths:r}=this;return"object"==typeof t?(r.js=t.js,r.wasm=t.wasm,r.dep_js=null):(r.js=e.resolveURL("draco_wasm_wrapper.js",t),r.wasm=e.resolveURL("draco_decoder.wasm",t),r.dep_js=e.resolveURL("draco_decoder.js",t)),this}setDecoderConfig(e){return console.warn("THREE.DRACOLoader: setDecoderConfig to has been deprecated and will be removed in r194."),this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,s){let o=new c(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,e=>{this.parse(e,t,s)},r,s)}parse(e,t,s=()=>{}){this.decodeDracoFile(e,t,null,null,r,s).catch(s)}decodeDracoFile(e,t,r,o,a=s,i=()=>{}){let n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:o||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:a};return this.decodeGeometry(e,n).then(t).catch(i)}decodeGeometry(e,t){let r=JSON.stringify(t);if(u.has(e)){let t=u.get(e);if(t.key===r)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s,o=this.workerNextTaskID++,a=e.byteLength,i=this._getWorker(o,a).then(r=>(s=r,new Promise((r,a)=>{s._callbacks[o]={resolve:r,reject:a},s.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return i.catch(()=>!0).then(()=>{s&&o&&this._releaseTask(s,o)}),u.set(e,{key:r,promise:i}),i}_createGeometry(e){let t=new i;e.index&&t.setIndex(new a(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let s,{name:o,array:i,itemSize:l,stride:c,vertexColorSpace:u}=e.attributes[r];if(l===c)s=new a(i,l);else{let e=new n(i,c);s=new d(e,l,0)}"color"===o&&(this._assignVertexColorSpace(s,u),s.normalized=!(i instanceof Float32Array)),t.setAttribute(o,s)}return t}_assignVertexColorSpace(e,s){if(s!==r)return;let a=new o;for(let s=0,o=e.count;s<o;s++)a.fromBufferAttribute(e,s),t.colorSpaceToWorking(a,r),e.setXYZ(s,a.r,a.g,a.b)}_loadLibrary(e,t){let r=new c(this.manager);return r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((t,s)=>{r.load(e,t,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[],{decoderPaths:r}=this;if(e){if(null===r.dep_js)throw new Error("THREE.DRACOLoader: WebAssembly is required when using a custom decoder paths.");t.push(this._loadLibrary(r.dep_js,"text"))}else t.push(this._loadLibrary(r.js,"text")),t.push(this._loadLibrary(r.wasm,"arraybuffer"));return this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let s=y.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let r=t.data;switch(r.type){case"decode":e._callbacks[r.id].resolve(r);break;case"error":e._callbacks[r.id].reject(r);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+r.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}};function y(){let e,t;function r(e,t,r,s,o,a){let i=r.num_points(),n=a.num_components(),d=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,o),l=n*o.BYTES_PER_ELEMENT,c=4*Math.ceil(l/4),u=c/o.BYTES_PER_ELEMENT,h=i*l,f=i*c,y=e._malloc(h);t.GetAttributeDataArrayForAllPoints(r,a,d,h,y);let w,_=new o(e.HEAPF32.buffer,y,h/o.BYTES_PER_ELEMENT);if(l===c)w=_.slice();else{w=new o(f/o.BYTES_PER_ELEMENT);let e=0;for(let t=0,r=_.length;t<r;t++){for(let r=0;r<n;r++)w[e+r]=_[t*n+r];e+=u}}return e._free(y),{name:s,count:i,itemSize:n,array:w,stride:u}}onmessage=function(s){let o=s.data;switch(o.type){case"init":e=o.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let s=o.buffer,a=o.taskConfig;t.then(e=>{let t=e.draco,i=new t.Decoder;try{let e=function(e,t,s,o){let a,i,n=o.attributeIDs,d=o.attributeTypes,l=t.GetEncodedGeometryType(s);if(l===e.TRIANGULAR_MESH)a=new e.Mesh,i=t.DecodeArrayToMesh(s,s.byteLength,a);else{if(l!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,i=t.DecodeArrayToPointCloud(s,s.byteLength,a)}if(!i.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+i.error_msg());let c={index:null,attributes:[]};for(let s in n){let i,l,u=self[d[s]];if(o.useUniqueIDs)l=n[s],i=t.GetAttributeByUniqueId(a,l);else{if(l=t.GetAttributeId(a,e[n[s]]),-1===l)continue;i=t.GetAttribute(a,l)}let h=r(e,t,a,s,u,i);"color"===s&&(h.vertexColorSpace=o.vertexColorSpace),c.attributes.push(h)}return l===e.TRIANGULAR_MESH&&(c.index=function(e,t,r){let s=3*r.num_faces(),o=4*s,a=e._malloc(o);t.GetTrianglesUInt32Array(r,o,a);let i=new Uint32Array(e.HEAPF32.buffer,a,s).slice();return e._free(a),{array:i,itemSize:1}}(e,t,a)),e.destroy(a),c}(t,i,new Int8Array(s),a),n=e.attributes.map(e=>e.array.buffer);e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:e},n)}catch(e){console.error(e),self.postMessage({type:"error",id:o.id,error:e.message})}finally{t.destroy(i)}})}}}export{f as DRACOLoader,h as DRACO_GLTF_CONFIG};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./runtime-chunk-NTUTXO7Q.js";import{a as t,b as s}from"./runtime-chunk-DZNU62CT.js";import{c as i}from"./runtime-chunk-4YV3EXSU.js";import{f as a}from"./runtime-chunk-UOHC2OET.js";import"./runtime-chunk-BPWKE4TV.js";import{a as n}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-NMRQ6IV4.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var r=class extends t{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.onVoice=({value:e,frequencies:t})=>{this.events.forEach(e=>{e.dispatch()})}}connect(){this.openAIRealtime=this.eventContext.sharedAssets.openAIRealtime,this.openAIRealtime&&(this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"AIAssistantListener"===e.data.type&&!e.data.disabled).forEach(t=>{this.events.push(new o(t.id,t.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.openAIRealtime.on("voice",this.onVoice))}disconnect(){this.openAIRealtime?.off("voice",this.onVoice)}},o=class{constructor(e,t,s,i,n,r){this.id=e,this.data=t,this.object=s,this.actions=a(t,t.actions,i,n,r,s)}dispatch(){this.dispatchActions(this.actions)}dispatchActions(e){e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}},c=class extends t{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.onTriggerEvent=({description:e,direction:t})=>{let s=this.events.find(t=>t.data.description===e);s&&("backward"===t?s.dispatchReverse():s.dispatch())}}connect(){this.openAIRealtime=this.eventContext.sharedAssets.openAIRealtime,this.openAIRealtime&&(this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"AIAssistantTrigger"===e.data.type&&!e.data.disabled).forEach(t=>{this.events.push(new h(t.id,t.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.openAIRealtime.on("trigger_event",this.onTriggerEvent))}disconnect(){this.openAIRealtime?.off("trigger_event",this.onTriggerEvent)}},h=class{constructor(e,t,s,i,n,r){this.id=e,this.data=t,this.object=s,this.actions=a(t,t.actions,i,n,r,s)}dispatch(){let e=this.actions;e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}dispatchReverse(){let e=this.actions;e.Transition.forEach(e=>e.reverseFromCurrent()),e.Particles.forEach(e=>e.reverseFromCurrent()),e.Animation.forEach(e=>e.reverseFromCurrent()),e.SwitchCamera.forEach(e=>e.reverseFromCurrent()),e.Create.forEach(e=>e.dispatchStop())}},l=function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(e,t,s,i)=>String(t+t+s+s+i+i));let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},d=[4186.01,4434.92,4698.63,4978.03,5274.04,5587.65,5919.91,6271.93,6644.88,7040,7458.62,7902.13],p=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],u=[],f=[];for(let e=1;e<=8;e++)for(let t=0;t<d.length;t++){let s=d[t];u.push(s/Math.pow(2,8-e)),f.push(p[t]+e)}var v=[32,2e3],m=u.filter((e,t)=>u[t]>v[0]&&u[t]<v[1]),y=f.filter((e,t)=>u[t]>v[0]&&u[t]<v[1]),g=class{static getFrequencies(e,t,s,i="frequency",a=-100,n=-30){s||(s=new Float32Array(e.frequencyBinCount),e.getFloatFrequencyData(s));let r,o,c,h=t/2,l=1/s.length*h;if("music"===i||"voice"===i){let e="voice"===i?m:u,t=Array(e.length).fill(a);for(let i=0;i<s.length;i++){let a=i*l,n=s[i];for(let s=e.length-1;s>=0;s--)if(a>e[s]){t[s]=Math.max(t[s],n);break}}r=t,o="voice"===i?m:u,c="voice"===i?y:f}else r=Array.from(s),o=r.map((e,t)=>l*t),c=o.map(e=>`${e.toFixed(2)} Hz`);let d=r.map(e=>Math.max(0,Math.min((e-a)/(n-a),1)));return{values:new Float32Array(d),frequencies:o,labels:c}}},E=class{constructor(e){this.value=0,this.frequencies=new Float32Array(0);let t=new AudioContext;this.source=t.createMediaStreamSource(e),this.analyser=t.createAnalyser(),this.source.connect(this.analyser),this.analyser.fftSize=8192,this.analyser.smoothingTimeConstant=.1}getFrequencies(e=-100,t=-30){if(!this.analyser)throw new Error("Not connected, please call .connect() first");return g.getFrequencies(this.analyser,44100,void 0,"voice",e,t)}update(){let e=this.getFrequencies(),t=e.values.reduce((e,t)=>e+t,0)/e.values.length;this.value=t,this.frequencies=e.values}disconnect(){this.source.disconnect(),this.analyser.disconnect()}},b=class{constructor(e){this.callbacks=e,this.rafId=0,this.isOpen=!1,this.onMessage=e=>{this.callbacks.onMessage(e.data)},this.onOpen=()=>{this.isOpen=!0,this.callbacks.onOpen()},this.animate=()=>{this.rafId=requestAnimationFrame(this.animate),this.isOpen&&this.analyser&&(this.analyser.update(),this.callbacks.onVoice(this.analyser.value,this.analyser.frequencies))}}async connect(e){let t=await async function(e){try{return(await(await fetch("https://relayserver.spline.design/session?uuidfile="+e)).json()).token}catch(e){console.error("Token generation error:",e)}}(e);this.pc=new RTCPeerConnection,this.audioElement=document.createElement("audio"),this.audioElement.autoplay=!0,this.pc.ontrack=e=>{let t=e.streams[0];this.audioElement.srcObject=t,this.analyser=new E(t)};let s=await navigator.mediaDevices.getUserMedia({audio:!0});this.pc.addTrack(s.getTracks()[0]),this.dc=this.pc.createDataChannel("oai-events"),this.dc.addEventListener("message",this.onMessage),this.dc.addEventListener("open",this.onOpen);let i=await this.pc.createOffer();await this.pc.setLocalDescription(i);let a={type:"answer",sdp:await(await fetch("https://api.openai.com/v1/realtime/calls?model=gpt-realtime",{method:"POST",body:i.sdp,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/sdp"}})).text()};await this.pc.setRemoteDescription(a),this.animate()}send(e){return!!this.dc&&(this.dc.send(e),!0)}disconnect(){cancelAnimationFrame(this.rafId),this.analyser?.disconnect(),this.isOpen=!1,this.dc?.removeEventListener("message",this.onMessage),this.dc?.removeEventListener("open",this.onOpen),this.dc?.close(),this.pc?.getSenders().forEach(e=>{e.track&&e.track.stop()}),this.pc?.close(),this.pc=void 0}};var w=class{constructor(t,s,i){this.data=t,this.id=s,this.shared=i,this.emitter=e(),this.voice=0,this.frequencies=new Float32Array([0]),this.events=[],this.isConnected=!1,this.isToolsAdded=!1,this.tools=[],this.onServerEvent=e=>{let t=JSON.parse(e);if(this.appendEvent(t),"session.created"===t.type&&this.onSessionCreated(),"response.done"===t.type&&t.response?.output)for(let e of t.response.output)if("function_call"===e.type)for(let[t,s]of this.tools)e.name===t.name&&(s(JSON.parse(e.arguments)),setTimeout(()=>{this.sendClientEvent({type:"response.create",response:{instructions:"notice the user about what you just did"}})}))},this.onSessionCreated=()=>{this.isToolsAdded||this.registerTools()},this.onOpen=()=>{this.events=[],this.isConnected=!0,this.sendClientEvent({type:"response.create",response:{instructions:"Say hi"}})}}update(e){this.data=e}setColorByName(e,t){let s=this.shared.getColorByName(e);if(s){let{id:e}=s,{r:i,g:a,b:n}=l(t)??{r:0,g:0,b:0};this.shared.updateColor(e,{r:i/255,g:a/255,b:n/255})}}async connect(){if(this.isConnected||this.session||this.hosted)return;let e={onMessage:this.onServerEvent,onOpen:this.onOpen,onVoice:(e,t)=>{this.voice=e,this.frequencies=t,this.emitter.emit("voice",{value:e,frequencies:t})}};this.hosted=function(e,t,s){if(!function(){try{return!0===window.__SPLINE_PLAY_VOICE_HOST__&&window.parent!==window}catch{return!1}}())return null;let i=!1,a=e=>{window.parent.postMessage({__splinePlayFrame:!0,...e},"*")},n=t=>{if(t.source!==window.parent)return;let a=t.data;!a||!0!==a.__splinePlayFrameHost||a.id!==e||("voice-open"===a.type?(i=!0,s.onOpen()):"voice-message"===a.type&&"string"==typeof a.data?s.onMessage(a.data):"voice-level"===a.type&&"number"==typeof a.value?s.onVoice(a.value,a.frequencies instanceof Float32Array?a.frequencies:new Float32Array(0)):"voice-error"===a.type&&console.error("Voice assistant host error:",a.message))};return window.addEventListener("message",n),a({type:"voice-connect",id:e,hash:t}),{send:t=>!!i&&(a({type:"voice-send",id:e,message:t}),!0),disconnect:()=>{i=!1,window.removeEventListener("message",n),a({type:"voice-disconnect",id:e})}}}(this.id,this.data.integration.hash,e),!this.hosted&&(this.session=new b(e),await this.session.connect(this.data.integration.hash))}appendEvent(e){this.events=[e,...this.events]}sendClientEvent(e){e.event_id=e.event_id||crypto.randomUUID();let t=JSON.stringify(e);(this.hosted?this.hosted.send(t):this.session?.send(t))?this.appendEvent(e):console.error("Failed to send message - no data channel available",e)}registerTools(){this.isToolsAdded=!0,this.registerTool({type:"function",name:"set_personality_color",description:"returns a color based on the voice personality of the ai assistant. This should be called by the voice assistant each time it is asks to speak differently. If a color cannot be associated to the personality, the color should be a neutral color.",parameters:{type:"object",properties:{color:{type:"string",description:"css hex color string, reflecting the personality"},personality:{type:"string",description:"the personality of the voice assistant"}},required:["color","personality"]}},({color:e})=>{this.setColorByName("Voice Assistant Color",e)});let e=this.shared.getVariablesNames().join(", ");this.registerTool({type:"function",name:"set_variable",description:"Sets a Spline variable value when asked by the user.",parameters:{type:"object",properties:{name:{type:"string",description:`The name of the variable that needs to be set. Here's a list of available variables: ${e}. It the variable does not exist, don't call the function and warn the user about it.`},value:{type:"string",description:"The new value for this variable, should always be a string even for number and boolean variables, assume that the value will be cast to the proper type afterwards."}},required:["name","value","type"]}},({name:e,value:t})=>{let s=this.shared.getVariableByName(e);if(s){let e,i=this.shared.getVariable(s.id);e="number"==typeof i?parseFloat(t):"boolean"==typeof i?"true"===t.toLowerCase():{textValue:t},this.shared.updateVariable(s.id,e)}});let t=this.shared.getColorNames().join(", ");this.registerTool({type:"function",name:"set_color",description:"Sets a Spline color asset value when asked by the user.",parameters:{type:"object",properties:{name:{type:"string",description:`The name of the color asset that needs to be set. Here's a list of available color assets: ${t}. It the color asset does not exist, don't call the function and warn the user about it.`},value:{type:"string",description:"css hex color string"}},required:["name","value"]}},({name:e,value:t})=>{this.setColorByName(e,t)});let s=this.shared.scene,i=[];s.traverseEntity(e=>{e.data.events.forEach(e=>{if("AIAssistantTrigger"===e.data.type){let{description:t}=e.data;i.push(t)}})}),this.registerTool({type:"function",name:"trigger_event",description:"Trigger an event by name, here are the available events, please match what the user is asking for to one of these if it applies, otherwise don't call the function and warn the user.",parameters:{type:"object",properties:{description:{type:"string",description:`The name of the event that needs to be triggered. Here's a list of available events: ${JSON.stringify(i)}.`},direction:{type:"string",description:"default is forward, but can be forward or backward. Always set to forward unless the user ask to reverse or cancel the event, then set to backward."}},required:["description","direction"]}},({description:e,direction:t})=>{this.emitter.emit("trigger_event",{description:e,direction:t})}),this.sendClientEvent({type:"session.update",session:{type:"realtime",tools:this.tools.map(([e])=>e)}})}registerTool(e,t){this.tools.push([e,t])}disconnect(){this.voice=0,this.isConnected=!1,this.isToolsAdded=!1,this.session?.disconnect(),this.session=void 0,this.hosted?.disconnect(),this.hosted=null}computeAnalysisForListenerEvent(e){if("range"===e.analysis){let t=this.frequencies.slice(...e.analysisRange);return t.reduce((e,t)=>e+t,0)/t.length}return"single"===e.analysis?this.frequencies[e.analysisSingle]:this.voice}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}};s("AIAssistantListener",({eventContext:e,eventManager:t})=>new r(e,t)),s("AIAssistantTrigger",({eventContext:e,eventManager:t})=>new c(e,t)),i((e,t,s)=>new w(e,t,s)),n("ai-assistant");
|
|
1
|
+
import{a as e}from"./runtime-chunk-NTUTXO7Q.js";import{a as t,b as s}from"./runtime-chunk-DZNU62CT.js";import{c as i}from"./runtime-chunk-4YV3EXSU.js";import{f as a}from"./runtime-chunk-M6FFVLT6.js";import"./runtime-chunk-C5BW2BYH.js";import{a as n}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-K3UQCG3P.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var r=class extends t{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.onVoice=({value:e,frequencies:t})=>{this.events.forEach(e=>{e.dispatch()})}}connect(){this.openAIRealtime=this.eventContext.sharedAssets.openAIRealtime,this.openAIRealtime&&(this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"AIAssistantListener"===e.data.type&&!e.data.disabled).forEach(t=>{this.events.push(new o(t.id,t.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.openAIRealtime.on("voice",this.onVoice))}disconnect(){this.openAIRealtime?.off("voice",this.onVoice)}},o=class{constructor(e,t,s,i,n,r){this.id=e,this.data=t,this.object=s,this.actions=a(t,t.actions,i,n,r,s)}dispatch(){this.dispatchActions(this.actions)}dispatchActions(e){e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}},c=class extends t{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.onTriggerEvent=({description:e,direction:t})=>{let s=this.events.find(t=>t.data.description===e);s&&("backward"===t?s.dispatchReverse():s.dispatch())}}connect(){this.openAIRealtime=this.eventContext.sharedAssets.openAIRealtime,this.openAIRealtime&&(this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"AIAssistantTrigger"===e.data.type&&!e.data.disabled).forEach(t=>{this.events.push(new h(t.id,t.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.openAIRealtime.on("trigger_event",this.onTriggerEvent))}disconnect(){this.openAIRealtime?.off("trigger_event",this.onTriggerEvent)}},h=class{constructor(e,t,s,i,n,r){this.id=e,this.data=t,this.object=s,this.actions=a(t,t.actions,i,n,r,s)}dispatch(){let e=this.actions;e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}dispatchReverse(){let e=this.actions;e.Transition.forEach(e=>e.reverseFromCurrent()),e.Particles.forEach(e=>e.reverseFromCurrent()),e.Animation.forEach(e=>e.reverseFromCurrent()),e.SwitchCamera.forEach(e=>e.reverseFromCurrent()),e.Create.forEach(e=>e.dispatchStop())}},l=function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(e,t,s,i)=>String(t+t+s+s+i+i));let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},d=[4186.01,4434.92,4698.63,4978.03,5274.04,5587.65,5919.91,6271.93,6644.88,7040,7458.62,7902.13],p=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],u=[],f=[];for(let e=1;e<=8;e++)for(let t=0;t<d.length;t++){let s=d[t];u.push(s/Math.pow(2,8-e)),f.push(p[t]+e)}var v=[32,2e3],m=u.filter((e,t)=>u[t]>v[0]&&u[t]<v[1]),y=f.filter((e,t)=>u[t]>v[0]&&u[t]<v[1]),g=class{static getFrequencies(e,t,s,i="frequency",a=-100,n=-30){s||(s=new Float32Array(e.frequencyBinCount),e.getFloatFrequencyData(s));let r,o,c,h=t/2,l=1/s.length*h;if("music"===i||"voice"===i){let e="voice"===i?m:u,t=Array(e.length).fill(a);for(let i=0;i<s.length;i++){let a=i*l,n=s[i];for(let s=e.length-1;s>=0;s--)if(a>e[s]){t[s]=Math.max(t[s],n);break}}r=t,o="voice"===i?m:u,c="voice"===i?y:f}else r=Array.from(s),o=r.map((e,t)=>l*t),c=o.map(e=>`${e.toFixed(2)} Hz`);let d=r.map(e=>Math.max(0,Math.min((e-a)/(n-a),1)));return{values:new Float32Array(d),frequencies:o,labels:c}}},E=class{constructor(e){this.value=0,this.frequencies=new Float32Array(0);let t=new AudioContext;this.source=t.createMediaStreamSource(e),this.analyser=t.createAnalyser(),this.source.connect(this.analyser),this.analyser.fftSize=8192,this.analyser.smoothingTimeConstant=.1}getFrequencies(e=-100,t=-30){if(!this.analyser)throw new Error("Not connected, please call .connect() first");return g.getFrequencies(this.analyser,44100,void 0,"voice",e,t)}update(){let e=this.getFrequencies(),t=e.values.reduce((e,t)=>e+t,0)/e.values.length;this.value=t,this.frequencies=e.values}disconnect(){this.source.disconnect(),this.analyser.disconnect()}},b=class{constructor(e){this.callbacks=e,this.rafId=0,this.isOpen=!1,this.onMessage=e=>{this.callbacks.onMessage(e.data)},this.onOpen=()=>{this.isOpen=!0,this.callbacks.onOpen()},this.animate=()=>{this.rafId=requestAnimationFrame(this.animate),this.isOpen&&this.analyser&&(this.analyser.update(),this.callbacks.onVoice(this.analyser.value,this.analyser.frequencies))}}async connect(e){let t=await async function(e){try{return(await(await fetch("https://relayserver.spline.design/session?uuidfile="+e)).json()).token}catch(e){console.error("Token generation error:",e)}}(e);this.pc=new RTCPeerConnection,this.audioElement=document.createElement("audio"),this.audioElement.autoplay=!0,this.pc.ontrack=e=>{let t=e.streams[0];this.audioElement.srcObject=t,this.analyser=new E(t)};let s=await navigator.mediaDevices.getUserMedia({audio:!0});this.pc.addTrack(s.getTracks()[0]),this.dc=this.pc.createDataChannel("oai-events"),this.dc.addEventListener("message",this.onMessage),this.dc.addEventListener("open",this.onOpen);let i=await this.pc.createOffer();await this.pc.setLocalDescription(i);let a={type:"answer",sdp:await(await fetch("https://api.openai.com/v1/realtime/calls?model=gpt-realtime",{method:"POST",body:i.sdp,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/sdp"}})).text()};await this.pc.setRemoteDescription(a),this.animate()}send(e){return!!this.dc&&(this.dc.send(e),!0)}disconnect(){cancelAnimationFrame(this.rafId),this.analyser?.disconnect(),this.isOpen=!1,this.dc?.removeEventListener("message",this.onMessage),this.dc?.removeEventListener("open",this.onOpen),this.dc?.close(),this.pc?.getSenders().forEach(e=>{e.track&&e.track.stop()}),this.pc?.close(),this.pc=void 0}};var w=class{constructor(t,s,i){this.data=t,this.id=s,this.shared=i,this.emitter=e(),this.voice=0,this.frequencies=new Float32Array([0]),this.events=[],this.isConnected=!1,this.isToolsAdded=!1,this.tools=[],this.onServerEvent=e=>{let t=JSON.parse(e);if(this.appendEvent(t),"session.created"===t.type&&this.onSessionCreated(),"response.done"===t.type&&t.response?.output)for(let e of t.response.output)if("function_call"===e.type)for(let[t,s]of this.tools)e.name===t.name&&(s(JSON.parse(e.arguments)),setTimeout(()=>{this.sendClientEvent({type:"response.create",response:{instructions:"notice the user about what you just did"}})}))},this.onSessionCreated=()=>{this.isToolsAdded||this.registerTools()},this.onOpen=()=>{this.events=[],this.isConnected=!0,this.sendClientEvent({type:"response.create",response:{instructions:"Say hi"}})}}update(e){this.data=e}setColorByName(e,t){let s=this.shared.getColorByName(e);if(s){let{id:e}=s,{r:i,g:a,b:n}=l(t)??{r:0,g:0,b:0};this.shared.updateColor(e,{r:i/255,g:a/255,b:n/255})}}async connect(){if(this.isConnected||this.session||this.hosted)return;let e={onMessage:this.onServerEvent,onOpen:this.onOpen,onVoice:(e,t)=>{this.voice=e,this.frequencies=t,this.emitter.emit("voice",{value:e,frequencies:t})}};this.hosted=function(e,t,s){if(!function(){try{return!0===window.__SPLINE_PLAY_VOICE_HOST__&&window.parent!==window}catch{return!1}}())return null;let i=!1,a=e=>{window.parent.postMessage({__splinePlayFrame:!0,...e},"*")},n=t=>{if(t.source!==window.parent)return;let a=t.data;!a||!0!==a.__splinePlayFrameHost||a.id!==e||("voice-open"===a.type?(i=!0,s.onOpen()):"voice-message"===a.type&&"string"==typeof a.data?s.onMessage(a.data):"voice-level"===a.type&&"number"==typeof a.value?s.onVoice(a.value,a.frequencies instanceof Float32Array?a.frequencies:new Float32Array(0)):"voice-error"===a.type&&console.error("Voice assistant host error:",a.message))};return window.addEventListener("message",n),a({type:"voice-connect",id:e,hash:t}),{send:t=>!!i&&(a({type:"voice-send",id:e,message:t}),!0),disconnect:()=>{i=!1,window.removeEventListener("message",n),a({type:"voice-disconnect",id:e})}}}(this.id,this.data.integration.hash,e),!this.hosted&&(this.session=new b(e),await this.session.connect(this.data.integration.hash))}appendEvent(e){this.events=[e,...this.events]}sendClientEvent(e){e.event_id=e.event_id||crypto.randomUUID();let t=JSON.stringify(e);(this.hosted?this.hosted.send(t):this.session?.send(t))?this.appendEvent(e):console.error("Failed to send message - no data channel available",e)}registerTools(){this.isToolsAdded=!0,this.registerTool({type:"function",name:"set_personality_color",description:"returns a color based on the voice personality of the ai assistant. This should be called by the voice assistant each time it is asks to speak differently. If a color cannot be associated to the personality, the color should be a neutral color.",parameters:{type:"object",properties:{color:{type:"string",description:"css hex color string, reflecting the personality"},personality:{type:"string",description:"the personality of the voice assistant"}},required:["color","personality"]}},({color:e})=>{this.setColorByName("Voice Assistant Color",e)});let e=this.shared.getVariablesNames().join(", ");this.registerTool({type:"function",name:"set_variable",description:"Sets a Spline variable value when asked by the user.",parameters:{type:"object",properties:{name:{type:"string",description:`The name of the variable that needs to be set. Here's a list of available variables: ${e}. It the variable does not exist, don't call the function and warn the user about it.`},value:{type:"string",description:"The new value for this variable, should always be a string even for number and boolean variables, assume that the value will be cast to the proper type afterwards."}},required:["name","value","type"]}},({name:e,value:t})=>{let s=this.shared.getVariableByName(e);if(s){let e,i=this.shared.getVariable(s.id);e="number"==typeof i?parseFloat(t):"boolean"==typeof i?"true"===t.toLowerCase():{textValue:t},this.shared.updateVariable(s.id,e)}});let t=this.shared.getColorNames().join(", ");this.registerTool({type:"function",name:"set_color",description:"Sets a Spline color asset value when asked by the user.",parameters:{type:"object",properties:{name:{type:"string",description:`The name of the color asset that needs to be set. Here's a list of available color assets: ${t}. It the color asset does not exist, don't call the function and warn the user about it.`},value:{type:"string",description:"css hex color string"}},required:["name","value"]}},({name:e,value:t})=>{this.setColorByName(e,t)});let s=this.shared.scene,i=[];s.traverseEntity(e=>{e.data.events.forEach(e=>{if("AIAssistantTrigger"===e.data.type){let{description:t}=e.data;i.push(t)}})}),this.registerTool({type:"function",name:"trigger_event",description:"Trigger an event by name, here are the available events, please match what the user is asking for to one of these if it applies, otherwise don't call the function and warn the user.",parameters:{type:"object",properties:{description:{type:"string",description:`The name of the event that needs to be triggered. Here's a list of available events: ${JSON.stringify(i)}.`},direction:{type:"string",description:"default is forward, but can be forward or backward. Always set to forward unless the user ask to reverse or cancel the event, then set to backward."}},required:["description","direction"]}},({description:e,direction:t})=>{this.emitter.emit("trigger_event",{description:e,direction:t})}),this.sendClientEvent({type:"session.update",session:{type:"realtime",tools:this.tools.map(([e])=>e)}})}registerTool(e,t){this.tools.push([e,t])}disconnect(){this.voice=0,this.isConnected=!1,this.isToolsAdded=!1,this.session?.disconnect(),this.session=void 0,this.hosted?.disconnect(),this.hosted=null}computeAnalysisForListenerEvent(e){if("range"===e.analysis){let t=this.frequencies.slice(...e.analysisRange);return t.reduce((e,t)=>e+t,0)/t.length}return"single"===e.analysis?this.frequencies[e.analysisSingle]:this.voice}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}};s("AIAssistantListener",({eventContext:e,eventManager:t})=>new r(e,t)),s("AIAssistantTrigger",({eventContext:e,eventManager:t})=>new c(e,t)),i((e,t,s)=>new w(e,t,s)),n("ai-assistant");
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./runtime-chunk-NTUTXO7Q.js";import{a as t,b as s}from"./runtime-chunk-DZNU62CT.js";import{a as r}from"./runtime-chunk-4YV3EXSU.js";import{b as i,e as n,f as o}from"./runtime-chunk-UOHC2OET.js";import{a}from"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-BPWKE4TV.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import{Ea as c,Fa as d,n as u}from"./runtime-chunk-NMRQ6IV4.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var l=class extends t{constructor(e,t){super(e),this.eventManager=t,this.userAPIs={},this.events=[],this.onSuccess=({userAPIId:e})=>{this.events.forEach(t=>{t.data.userAPIId===e&&t.dispatchSuccess()})},this.onError=({userAPIId:e})=>{this.events.forEach(t=>{t.data.userAPIId===e&&t.dispatchError()})},this.userAPIs=e.sharedAssets.getUserAPIs()}connect(){this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"API"===e.data.type&&!e.data.disabled).forEach(t=>{this.events.push(new p(t.id,t.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),Object.entries(this.userAPIs).forEach(([e,t])=>{t.on("success",this.onSuccess),t.on("error",this.onError),t.autostart&&t.callUserAPI(this.eventContext.sharedAssets)})}disconnect(){Object.entries(this.userAPIs).forEach(([e,t])=>{t.off("success",this.onSuccess),t.off("error",this.onError)})}},p=class{constructor(e,t,s,r,i,n){this.id=e,this.data=t,this.object=s,this.successActions=o(t,t.successActions,r,i,n,s),this.errorActions=o(t,t.errorActions,r,i,n,s)}dispatchSuccess(){this.dispatchActions(this.successActions)}dispatchError(){this.dispatchActions(this.errorActions)}dispatchActions(e){e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}},f=class extends t{constructor(e,t){super(e),this.eventManager=t,this.userWebhooks={},this.events=[],this.onMessage=({userWebhookId:e})=>{this.events.forEach(t=>{t.data.userWebhookId===e&&t.dispatch()})},this.userWebhooks=e.sharedAssets.getUserWebhooks()}connect(){this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"WEBHOOK"===e.data.type&&!e.data.disabled).forEach(t=>{this.events.push(new m(t.id,t.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),Object.entries(this.userWebhooks).forEach(([e,t])=>{t.connect(),t.on("message",this.onMessage)})}disconnect(){Object.entries(this.userWebhooks).forEach(([e,t])=>{t.off("message",this.onMessage),t.disconnect()})}},m=class{constructor(e,t,s,r,i,n){this.id=e,this.data=t,this.object=s,this.actions=o(t,t.actions,r,i,n,s)}dispatch(){let e=this.actions;e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}},v=class{constructor(e,t,s,r){this.data=e,this.page=t,this.shared=s,this.condition=r}dispatch(){if(!1===n(this.shared,this.condition))return!1;if(this.data.userAPIId){let e=this.shared.getUserAPI(this.data.userAPIId);e&&"callUserAPI"in e&&e.callUserAPI(this.shared)}}dispose(){}},E=class{constructor(t,s,r){this.id=t,this.userAPI=s,this.result=void 0,this.error="null",this.isPrefetched=!1,this.isLoading=!1,this.isLoaded=!1,this.prefetchPromise=new Promise(e=>e()),this.emitter=e(),this._innerCallUserAPI=async e=>{this.emitter.emit("start",{userAPIId:this.id}),this.isLoading=!0,this.isLoading=!1;try{this.result=await async function(e,t,s=new AbortController){let r,i,n=e.url,o=e.proxy?.enabled??!1;if("OpenAI"===e.integration?.type){let s=b(""===e.integration.prompt?[]:JSON.parse(e.integration.prompt),t),r=""===e.integration.behavior?[]:b(JSON.parse(e.integration.behavior),t);i=`{\n\t\t"model": "${e.integration.model}",\n\t\t"messages": [${e.integration.useBehavior?`\n\t\t{\n\t\t\t"role": "system",\n\t\t\t"content": "${r}"\n\t\t},`:""}\n\t\t{\n\t\t\t"role": "user",\n\t\t\t"content": "${s}"\n\t\t}\n\t\t]\n\t}`}if(o){let s;n=`https://apis.spline.design/file/${e.proxy.fileId}/external-api/request?uuidexternalapi=${e.proxy.proxyId}`,void 0!==i?s=i:"POST"===e.method&&e.body&&(s=b(JSON.parse(e.body),t)),void 0!==s&&(n+=`&data=${encodeURIComponent(s.replace(/(\r\n|\n|\r|\t)/gm,""))}`)}else"OpenAI"===e.integration?.type?r=i:"POST"===e.method&&e.body&&(r=b(JSON.parse(e.body),t));let a=await fetch(n,{method:o?"GET":e.method,headers:o?void 0:g(e),signal:s.signal,body:r});if(!a.ok)throw new Error("status:"+a.status+"_:_"+a.statusText);if("OpenAI"===e.integration?.type){let e=await a.json();return o&&(e=e.response),{content:e.choices[0].message.content}}{let e=await a.json();return o&&(e=e.response),e}}(this.userAPI,e),this.error="null",this.emitter.emit("success",{userAPIId:this.id})}catch(e){let t=e.message?.split("_:_")?.[0]?.replace("status:","")??"null";this.error=t,this.result=null,this.emitter.emit("error",{userAPIId:this.id})}this.isLoading=!1,this.isPrefetched=!0,this.isLoaded=!0},this._debouncedCallUserAPI=this._makeDebouncedCallUserAPI(),this._debouncedPrefetch=a(this.prefetch,1e3,{trailing:!0}),"OpenAI"===s?.integration?.type?this.result={content:""}:"GET"===s.method&&""!==s.url&&(this.prefetchPromise=this.prefetch(r))}_makeDebouncedCallUserAPI(){return void 0!==this.userAPI.debounce&&this.userAPI.debounce>0?a(this._innerCallUserAPI,this.userAPI.debounce,{leading:!0,trailing:!0}):this._innerCallUserAPI}async prefetch(e){await this.callUserAPI(e)}async callUserAPI(e){await this._debouncedCallUserAPI(e)}update(e,t,s=!0){this.userAPI=e,this._debouncedCallUserAPI=this._makeDebouncedCallUserAPI(),""!==this.userAPI.url&&"GET"===this.userAPI.method&&s&&this._debouncedPrefetch(t)}retrieveValue(e){if(this.result)try{return u.zoom(this.result,e)}catch(e){console.error(e)}}retrieveZoomedKeyValues(e){if(this.result){let s=e&&e.length?u.zoom(this.result,e):this.result;if("object"==typeof(t=s)&&null!==t)return Object.entries(s);if(function(e){return Array.isArray(e)}(s))return s.map((e,t)=>[t.toString(),e]);throw function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null===e}(s)?new Error("This path points to a value, use retrieveValue() instead. "+e?.join(".")):new Error("Path error"+e?.join("."))}var t}dispose(){}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}get autostart(){return this.userAPI.autoStart}};function g(e){let t=new Headers;return e.headers.forEach(e=>{""!==e.data.key&&t.append(e.data.key,e.data.value)}),t}var A=(e,t)=>{if("string"==typeof e){let s=t.getVariable(e);if(s)return A(s,t)}return d.isBoolean(e)?d.getDisplayedValue(e).toLowerCase():d.getDisplayedValue(e)},b=(e,t)=>e.map((e,s)=>{if("text"in e)return e.text;if("type"in e){if("paragraph"===e.type)return(s>0?"\n":"")+b(e.children,t);if("variable"===e.type){let s=t.getVariable(e.variableId);if(void 0!==s)return A(s,t)}}return""}).join(""),I=1e3,P=512*I,y=class{constructor(t,s){this.id=t,this.userWebhook=s,this.result=void 0,this._connected=!1,this.emitter=e(),this.reconnectWaitFor=I,this._onError=e=>{this.eventSource?.removeEventListener("message",this._onMessage),this.eventSource?.removeEventListener("error",this._onError),this.eventSource?.removeEventListener("open",this._onConnected),this._scheduleReconnect()},this._onConnected=e=>{clearTimeout(this.scheduledReconnectHandle),this.reconnectWaitFor=I,this._connected=!0},this._onDisconnected=()=>{clearTimeout(this.scheduledReconnectHandle),this.reconnectWaitFor=I,this._connected=!1},this._onMessage=e=>{let t,s=e.data;try{t=JSON.parse(s)}catch(e){console.error("Error parsing webhook message",e)}if(t){let e=!1;this.userWebhook.parametersSchemas.forEach(({data:s})=>{void 0!==t[s.name]&&function(e,t){let s=typeof e;return!!(("string"===t||"number"===t)&&s===t||"boolean"===t&&("true"===e||"false"===e||!0===e||!1===e)||"image"===t&&"string"===s&&e.startsWith("http"))}(t[s.name],s.type)&&(void 0===this.result&&(this.result={}),this.result[s.name]=t[s.name],e=!0)}),e&&this.emitter.emit("message",{userWebhookId:this.id})}}}connect(){clearTimeout(this.scheduledReconnectHandle),this.userWebhook.url&&(this.eventSource=new EventSource("https://hooks.spline.design/events?hashFile="+this.userWebhook.url),this.eventSource.addEventListener("message",this._onMessage),this.eventSource.addEventListener("error",this._onError),this.eventSource.addEventListener("open",this._onConnected))}disconnect(){this.eventSource?.removeEventListener("message",this._onMessage),this.eventSource?.removeEventListener("error",this._onError),this.eventSource?.removeEventListener("open",this._onConnected),this.eventSource?.close(),this._onDisconnected(),clearTimeout(this.scheduledReconnectHandle)}_scheduleReconnect(){this.reconnectWaitFor*=2,this.reconnectWaitFor>P&&(this.reconnectWaitFor=P),clearTimeout(this.scheduledReconnectHandle),this.scheduledReconnectHandle=setTimeout(()=>{this.scheduledReconnectHandle=void 0,this.connect()},this.reconnectWaitFor)}update(e){this.userWebhook=e}dispose(){this._connected&&this.disconnect()}get connected(){return this._connected}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}getParametersKeys(){return this.userWebhook.parametersSchemas.map(e=>e.data.name)}getParameterValue(e){if(this.getParametersKeys().includes(e)){if(this.result)return this.result?.[e];for(let t of this.userWebhook.parametersSchemas)if(t.data.name===e)return c.defaultParameterValueByType(t.data.type)}}};s("API",({eventContext:e,eventManager:t})=>new l(e,t)),s("WEBHOOK",({eventContext:e,eventManager:t})=>new f(e,t)),i("UserAPI",({data:e,page:t,shared:s,actionCondition:r})=>new v(e,t,s,r)),r({createUserAPI:(e,t,s)=>new E(e,t,s),createUserWebhook:(e,t)=>new y(e,t)}),h("api-services");
|
|
1
|
+
import{a as e}from"./runtime-chunk-NTUTXO7Q.js";import{a as t,b as s}from"./runtime-chunk-DZNU62CT.js";import{a as r}from"./runtime-chunk-4YV3EXSU.js";import{b as i,e as n,f as o}from"./runtime-chunk-M6FFVLT6.js";import{a}from"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-C5BW2BYH.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import{Fa as c,Ga as d,n as u}from"./runtime-chunk-K3UQCG3P.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var l=class extends t{constructor(e,t){super(e),this.eventManager=t,this.userAPIs={},this.events=[],this.onSuccess=({userAPIId:e})=>{this.events.forEach(t=>{t.data.userAPIId===e&&t.dispatchSuccess()})},this.onError=({userAPIId:e})=>{this.events.forEach(t=>{t.data.userAPIId===e&&t.dispatchError()})},this.userAPIs=e.sharedAssets.getUserAPIs()}connect(){this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"API"===e.data.type&&!e.data.disabled).forEach(t=>{this.events.push(new p(t.id,t.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),Object.entries(this.userAPIs).forEach(([e,t])=>{t.on("success",this.onSuccess),t.on("error",this.onError),t.autostart&&t.callUserAPI(this.eventContext.sharedAssets)})}disconnect(){Object.entries(this.userAPIs).forEach(([e,t])=>{t.off("success",this.onSuccess),t.off("error",this.onError)})}},p=class{constructor(e,t,s,r,i,n){this.id=e,this.data=t,this.object=s,this.successActions=o(t,t.successActions,r,i,n,s),this.errorActions=o(t,t.errorActions,r,i,n,s)}dispatchSuccess(){this.dispatchActions(this.successActions)}dispatchError(){this.dispatchActions(this.errorActions)}dispatchActions(e){e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}},f=class extends t{constructor(e,t){super(e),this.eventManager=t,this.userWebhooks={},this.events=[],this.onMessage=({userWebhookId:e})=>{this.events.forEach(t=>{t.data.userWebhookId===e&&t.dispatch()})},this.userWebhooks=e.sharedAssets.getUserWebhooks()}connect(){this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"WEBHOOK"===e.data.type&&!e.data.disabled).forEach(t=>{this.events.push(new m(t.id,t.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),Object.entries(this.userWebhooks).forEach(([e,t])=>{t.connect(),t.on("message",this.onMessage)})}disconnect(){Object.entries(this.userWebhooks).forEach(([e,t])=>{t.off("message",this.onMessage),t.disconnect()})}},m=class{constructor(e,t,s,r,i,n){this.id=e,this.data=t,this.object=s,this.actions=o(t,t.actions,r,i,n,s)}dispatch(){let e=this.actions;e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}},v=class{constructor(e,t,s,r){this.data=e,this.page=t,this.shared=s,this.condition=r}dispatch(){if(!1===n(this.shared,this.condition))return!1;if(this.data.userAPIId){let e=this.shared.getUserAPI(this.data.userAPIId);e&&"callUserAPI"in e&&e.callUserAPI(this.shared)}}dispose(){}},E=class{constructor(t,s,r){this.id=t,this.userAPI=s,this.result=void 0,this.error="null",this.isPrefetched=!1,this.isLoading=!1,this.isLoaded=!1,this.prefetchPromise=new Promise(e=>e()),this.emitter=e(),this._innerCallUserAPI=async e=>{this.emitter.emit("start",{userAPIId:this.id}),this.isLoading=!0,this.isLoading=!1;try{this.result=await async function(e,t,s=new AbortController){let r,i,n=e.url,o=e.proxy?.enabled??!1;if("OpenAI"===e.integration?.type){let s=b(""===e.integration.prompt?[]:JSON.parse(e.integration.prompt),t),r=""===e.integration.behavior?[]:b(JSON.parse(e.integration.behavior),t);i=`{\n\t\t"model": "${e.integration.model}",\n\t\t"messages": [${e.integration.useBehavior?`\n\t\t{\n\t\t\t"role": "system",\n\t\t\t"content": "${r}"\n\t\t},`:""}\n\t\t{\n\t\t\t"role": "user",\n\t\t\t"content": "${s}"\n\t\t}\n\t\t]\n\t}`}if(o){let s;n=`https://apis.spline.design/file/${e.proxy.fileId}/external-api/request?uuidexternalapi=${e.proxy.proxyId}`,void 0!==i?s=i:"POST"===e.method&&e.body&&(s=b(JSON.parse(e.body),t)),void 0!==s&&(n+=`&data=${encodeURIComponent(s.replace(/(\r\n|\n|\r|\t)/gm,""))}`)}else"OpenAI"===e.integration?.type?r=i:"POST"===e.method&&e.body&&(r=b(JSON.parse(e.body),t));let a=await fetch(n,{method:o?"GET":e.method,headers:o?void 0:g(e),signal:s.signal,body:r});if(!a.ok)throw new Error("status:"+a.status+"_:_"+a.statusText);if("OpenAI"===e.integration?.type){let e=await a.json();return o&&(e=e.response),{content:e.choices[0].message.content}}{let e=await a.json();return o&&(e=e.response),e}}(this.userAPI,e),this.error="null",this.emitter.emit("success",{userAPIId:this.id})}catch(e){let t=e.message?.split("_:_")?.[0]?.replace("status:","")??"null";this.error=t,this.result=null,this.emitter.emit("error",{userAPIId:this.id})}this.isLoading=!1,this.isPrefetched=!0,this.isLoaded=!0},this._debouncedCallUserAPI=this._makeDebouncedCallUserAPI(),this._debouncedPrefetch=a(this.prefetch,1e3,{trailing:!0}),"OpenAI"===s?.integration?.type?this.result={content:""}:"GET"===s.method&&""!==s.url&&(this.prefetchPromise=this.prefetch(r))}_makeDebouncedCallUserAPI(){return void 0!==this.userAPI.debounce&&this.userAPI.debounce>0?a(this._innerCallUserAPI,this.userAPI.debounce,{leading:!0,trailing:!0}):this._innerCallUserAPI}async prefetch(e){await this.callUserAPI(e)}async callUserAPI(e){await this._debouncedCallUserAPI(e)}update(e,t,s=!0){this.userAPI=e,this._debouncedCallUserAPI=this._makeDebouncedCallUserAPI(),""!==this.userAPI.url&&"GET"===this.userAPI.method&&s&&this._debouncedPrefetch(t)}retrieveValue(e){if(this.result)try{return u.zoom(this.result,e)}catch(e){console.error(e)}}retrieveZoomedKeyValues(e){if(this.result){let s=e&&e.length?u.zoom(this.result,e):this.result;if("object"==typeof(t=s)&&null!==t)return Object.entries(s);if(function(e){return Array.isArray(e)}(s))return s.map((e,t)=>[t.toString(),e]);throw function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null===e}(s)?new Error("This path points to a value, use retrieveValue() instead. "+e?.join(".")):new Error("Path error"+e?.join("."))}var t}dispose(){}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}get autostart(){return this.userAPI.autoStart}};function g(e){let t=new Headers;return e.headers.forEach(e=>{""!==e.data.key&&t.append(e.data.key,e.data.value)}),t}var A=(e,t)=>{if("string"==typeof e){let s=t.getVariable(e);if(s)return A(s,t)}return d.isBoolean(e)?d.getDisplayedValue(e).toLowerCase():d.getDisplayedValue(e)},b=(e,t)=>e.map((e,s)=>{if("text"in e)return e.text;if("type"in e){if("paragraph"===e.type)return(s>0?"\n":"")+b(e.children,t);if("variable"===e.type){let s=t.getVariable(e.variableId);if(void 0!==s)return A(s,t)}}return""}).join(""),I=1e3,P=512*I,y=class{constructor(t,s){this.id=t,this.userWebhook=s,this.result=void 0,this._connected=!1,this.emitter=e(),this.reconnectWaitFor=I,this._onError=e=>{this.eventSource?.removeEventListener("message",this._onMessage),this.eventSource?.removeEventListener("error",this._onError),this.eventSource?.removeEventListener("open",this._onConnected),this._scheduleReconnect()},this._onConnected=e=>{clearTimeout(this.scheduledReconnectHandle),this.reconnectWaitFor=I,this._connected=!0},this._onDisconnected=()=>{clearTimeout(this.scheduledReconnectHandle),this.reconnectWaitFor=I,this._connected=!1},this._onMessage=e=>{let t,s=e.data;try{t=JSON.parse(s)}catch(e){console.error("Error parsing webhook message",e)}if(t){let e=!1;this.userWebhook.parametersSchemas.forEach(({data:s})=>{void 0!==t[s.name]&&function(e,t){let s=typeof e;return!!(("string"===t||"number"===t)&&s===t||"boolean"===t&&("true"===e||"false"===e||!0===e||!1===e)||"image"===t&&"string"===s&&e.startsWith("http"))}(t[s.name],s.type)&&(void 0===this.result&&(this.result={}),this.result[s.name]=t[s.name],e=!0)}),e&&this.emitter.emit("message",{userWebhookId:this.id})}}}connect(){clearTimeout(this.scheduledReconnectHandle),this.userWebhook.url&&(this.eventSource=new EventSource("https://hooks.spline.design/events?hashFile="+this.userWebhook.url),this.eventSource.addEventListener("message",this._onMessage),this.eventSource.addEventListener("error",this._onError),this.eventSource.addEventListener("open",this._onConnected))}disconnect(){this.eventSource?.removeEventListener("message",this._onMessage),this.eventSource?.removeEventListener("error",this._onError),this.eventSource?.removeEventListener("open",this._onConnected),this.eventSource?.close(),this._onDisconnected(),clearTimeout(this.scheduledReconnectHandle)}_scheduleReconnect(){this.reconnectWaitFor*=2,this.reconnectWaitFor>P&&(this.reconnectWaitFor=P),clearTimeout(this.scheduledReconnectHandle),this.scheduledReconnectHandle=setTimeout(()=>{this.scheduledReconnectHandle=void 0,this.connect()},this.reconnectWaitFor)}update(e){this.userWebhook=e}dispose(){this._connected&&this.disconnect()}get connected(){return this._connected}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}getParametersKeys(){return this.userWebhook.parametersSchemas.map(e=>e.data.name)}getParameterValue(e){if(this.getParametersKeys().includes(e)){if(this.result)return this.result?.[e];for(let t of this.userWebhook.parametersSchemas)if(t.data.name===e)return c.defaultParameterValueByType(t.data.type)}}};s("API",({eventContext:e,eventManager:t})=>new l(e,t)),s("WEBHOOK",({eventContext:e,eventManager:t})=>new f(e,t)),i("UserAPI",({data:e,page:t,shared:s,actionCondition:r})=>new v(e,t,s,r)),r({createUserAPI:(e,t,s)=>new E(e,t,s),createUserWebhook:(e,t)=>new y(e,t)}),h("api-services");
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t}from"./runtime-chunk-NSD7DU3P.js";import{b as i,e as a}from"./runtime-chunk-
|
|
1
|
+
import{c as t}from"./runtime-chunk-NSD7DU3P.js";import{b as i,e as a}from"./runtime-chunk-M6FFVLT6.js";import"./runtime-chunk-C5BW2BYH.js";import{a as s}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-K3UQCG3P.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var e=new Map,o=new Map,d=class{constructor(i,a,s,d){this.data=a,this.isPlayAudioAction=!0;let{audio:n,volume:r,delay:h,loop:u}=a;if(!n)throw new Error("Missing property");try{let i="string"==typeof n?d.getAudio(n).src:n.data;this.audioPlayer=new t({src:i,volume:r,delay:h,loop:u})}catch{console.warn(`Could not create an audio player for this object: "${s.name}" and this audio: "${n}"`)}o.has(s.uuid)?o.get(s.uuid).push(this):o.set(s.uuid,[this]),e.set(i,this)}playByToggle(){"stop"===this.data.toggle?"playing"===this.audioPlayer?.status?this.audioPlayer.stop():(this.audioPlayer?.stop(),this.audioPlayer?.play()):"pause"===this.data.toggle?"playing"===this.audioPlayer?.status?this.audioPlayer?.pause():this.audioPlayer?.play():(this.audioPlayer?.stop(),this.audioPlayer?.play())}dispose(){this.audioPlayer?.stop()}},n=class{constructor(t){this.data=t,this.isPauseAudioAction=!0}dispatch(){this.data.playAudio?this.pauseAudio(this.data.playAudio):this.data.object?this.pauseAllAudiosFromObject(this.data.object):this.pauseAllAudios()}pauseAudio(t){let i=e.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.audioPlayer?.[this.data.interaction](),this.disposeDelay()},this.data.delay)):i.audioPlayer?.[this.data.interaction]())}pauseAllAudiosFromObject(t){let i=o.get(t);!i?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.forEach(t=>t.audioPlayer?.[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(t=>t.audioPlayer?.[this.data.interaction]()))}pauseAllAudios(){let t=[...o.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t.audioPlayer?.[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t.audioPlayer?.[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},r=class{constructor(t,i,a,s,e){if(this.data=i,this.shared=s,this.condition=e,"play"===i.interaction)this.interaction=new d(t,i,a,s);else{if("pause"!==i.interaction&&"stop"!==i.interaction)throw new Error("Missing property");this.interaction=new n(i)}}dispatchBasic(){if(!1===a(this.shared,this.condition))return!1;this.interaction instanceof d?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===a(this.shared,this.condition))return!1;this.interaction instanceof d?this.interaction.audioPlayer?.play():this.interaction.dispatch()}dispatchGameControl(t){if(!1===a(this.shared,this.condition))return!1;this.interaction instanceof d&&("start"===t?this.interaction.audioPlayer?.play():this.interaction.audioPlayer?.stop())}dispose(){this.interaction.dispose()}};i("Audio",({id:t,data:i,object:a,shared:s,actionCondition:e})=>new r(t,i,a,s,e)),s("audio");
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-
|
|
1
|
+
import{a as t}from"./runtime-chunk-CDUGB775.js";import{d as e}from"./runtime-chunk-VNSXYJJ4.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};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as t}from"./runtime-chunk-RTLL6WIB.js";import{h as e}from"./runtime-chunk-2PT2WH66.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Aa as r,B as s,Ca as a,I as n,i as o,j as l,k as h,n as p,za as d}from"./runtime-chunk-NMRQ6IV4.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 M,Xc as w,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 V(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,W=new f,_=new g,R=[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]],U=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],I=(t,e,i)=>{t.updateEntityBoxSize(O,W),_.copy(e).multiply(t.matrixWorld),0===W.x&&0===W.y&&0===W.z?i.push(new f(O.x,O.y,O.z).applyMatrix4(_)):R.forEach(t=>{i.push(t.clone().multiply(W).add(O).applyMatrix4(_))})},z=class extends w{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(_));I(t,e,r)}}),0===r.length&&r.push(...i)}else I(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(W).multiplyScalar(.5),this.getCenter(O),_.copy(this.matrix).setPosition(O),this.vertices=R.map(t=>t.clone().multiply(W).applyMatrix4(_))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=T.map(([t,e])=>new M(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=U.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},L=new f,F=new f,N=new f,j=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]),F.set(e[4],e[5],e[6]),N.set(e[8],e[9],e[10])}function Q(){let t=Math.max(L.lengthSq(),F.lengthSq(),N.lengthSq());L.lengthSq()>H*t?j.copy(L).normalize():j.set(1,0,0),k.crossVectors(N,j),k.lengthSq()<=H*t&&(k.copy(F).addScaledVector(j,-F.dot(j)),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,j)),k.normalize(),q.crossVectors(j,k)}function $(t){return Z(t),Q(),G.makeBasis(j,k,q)}var K,Y=new g;(K||(K={})).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)K.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)K.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=function(t,e,i){return Z(t),Q(),e.makeBasis(j,k,q),i.set(j.dot(L),j.dot(F),j.dot(N),0,k.dot(L),k.dot(F),k.dot(N),0,q.dot(L),q.dot(F),q.dot(N),0,0,0,0,1),function(){let t=L.length(),e=F.length(),i=N.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(F))>s||Math.abs(L.dot(N))>s||Math.abs(F.dot(N))>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=new WeakMap;function ut(t){let e=ct.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 ct.set(t.points,{isClosed:t.isClosed,curve:i}),i}var mt,ft=new g,yt=new m,gt=new m,vt=new v,xt=new f,St=new f(0,1,0);(mt||(mt={})).is=function(t){return t&&t.__isEntity};var Mt=t=>mt.is(t),wt={type:"completeState",isfromEntity:!0},bt=["x","y","z"],Bt=new f,Pt=new f(1,1,1),Et=new m,At=new v,Ct=new g,Dt=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.transitionState={settled:!0,state:null},this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new z,this._recursiveBBox=new z,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(mt.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(mt.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(!mt.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)a.toOps(this.data,t.data).forEach(t=>{let i=l.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=a.patch(this.data,i),a.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=>{Mt(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(mt.is(e[i]))return e[i];if(mt.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&mt.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)Mt(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{mt.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)Mt(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)Mt(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)Mt(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=>Mt(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(e=[]){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 t(i,e)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,bt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(Bt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(Bt),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(Bt.fromArray(t.pivot).negate(),Et.setFromEuler(At.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),Pt);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=Bt.setFromMatrixPosition(this.pivotMatrix);Et.setFromEuler(At.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,Et,Pt)}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)mt.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{mt.is(t)&&t.disposeRecursively()})}toState(e=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return t(i,e)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,s){let n=this.data;this.data=e;let l=t,c=V(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=p.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])}}l={...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=p.removeOverridden(t.path,t.props,e);l={...t,props:i}}}if(this.updateByPatchedOpBase(l,a.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),V(t.path,["overrides"])){let r=[],s=[...t.path];for(r.push(s[1]),s.splice(0,2);s.length>0&&"descendants"===s[0];)r.push(s[1]),s.splice(0,2);if(void 0===r[r.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){r[r.length-1]=e;let s=i.scene.findInstance([this.uuid,...r]);s&&(s.overrideData=t.props[e],s.updateState(o.apply(s.component.data,s.overrideData),i))}}else{let a=i.scene.findInstance([this.uuid,...r]);if(a){let n=p.zoom(a.component.data,s);if(0===(t={...t,path:s}).type){let e=t.props;if(n)for(let[i,r]of Object.entries(t.props))void 0===r&&(e===t.props&&(e={...t.props}),e[i]=n[i]);t={...t,props:e}}a.overrideData=d.resolve(e.overrides,r),a.updateByOp(t,h.applySimple(a.data,t),i,!1)}}}else if(this.instances.length>0){let s;if(0===t.path.length&&0===t.type){let e;for(let i of r.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(s={...t,props:e})}else for(let e of r.rootOverrideProps)if(V(t.path,[e])){s=t;break}void 0!==s&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=o.filterOp(t.overrideData,s);e&&t.updateByOp(e,h.applySimple(t.data,e),i,!0)}}),this.instances.forEach(r=>{if(!r.isInstanceRoot){let s=o.filterOp(r.overrideData,t);if(s){let a;a=n===r.data&&t===s?e:h.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&&!n.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)mt.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!==V(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==V(t.path,["cloner"])){let r=h.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=ut(n.geometry.path),l=function(t){let e=t%1;return e<0?e+1:0===e&&t>0?1:e}(i+r),h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?Ct.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix):Ct.copy(this.hiddenMatrix),d=function(t,e,i,r){yt.setFromRotationMatrix(ft.extractRotation(r));let s=t.clone().applyMatrix4(ft.copy(r).invert().multiply(i));if(null===e)gt.setFromRotationMatrix(ft.extractRotation(i));else{let t=e.clone().applyMatrix4(ft.extractRotation(i));gt.setFromRotationMatrix(ft.lookAt(xt.set(0,0,0),t,St))}return{position:s,rotation:(new f).setFromEuler(vt.setFromQuaternion(yt.invert().multiply(gt))).multiplyScalar(u.RAD2DEG)}}(h,"tangential"===s?o.getTangentAt(l):null,a.matrixWorld,p);this.updateTransformState({position:d.position.toArray(),rotation:d.rotation.toArray()}),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(wt)})}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(t=>e(t)&&"toObject"===t.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"})}},Vt=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 Tt(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Ot=new c([0,0,0],1);function Wt(t){return"TorusGeometry"===t.type&&360===t.arc}var _t,Rt,Tt=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,M,w=()=>new f,B=new f,P=w(),E=w(),A=w(),C=w(),D=w(),V=w(),O=w(),W=w(),_=w(),R=w(),T=w(),U=i-2*o+.001,I=U/a,z=Math.ceil(n*a),L=z+1,F=U/z,N=-U/2,j=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,Q=j*Z/2,$=Q+j*L,K=Math.max(0,j*(L+Z)),[Y,J,tt]=[3,3,2].map(t=>Array(K*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*F,M=2*Math.PI*(x%I)/I+r,x+=N,S=Math.sin(M)*it,v=Math.cos(M)*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*z+2*at,ot=G,lt=nt-at;for(let e=0;e<=z;e++){rt(E,e),T.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),R.crossVectors(T,_).normalize();let i=0===e,r=e===z,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?j:$,l=i?0:K-j,p=T.clone().multiplyScalar(i?-H:H).add(E),u=T.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<j;t++){let m=t*k;if(D.addVectors(B.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(R).multiplyScalar(o*Math.sin(m))),V.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(V).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(V).multiplyScalar(H*Math.cos(r))),W.copy(O).normalize(),P.addVectors(A,O),O.normalize(),X=n+e*j+t,[0,1,2].forEach(t=>{Y[3*X+t]=P.getComponent(t),J[3*X+t]=W.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=Q+e*j+t,[0,1,2].forEach(t=>{Y[3*X+t]=P.getComponent(t),J[3*X+t]=V.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<j-1;i++)u=t*j+i,m=u+1,y=(e?i:u)+j,g=(e?i+1:m)+j,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 Ot.array=new Uint32Array(l),Ot.count=l.length,Ot}},Ut=new Map,It=0;function zt(t){return Rt||(Rt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.52/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}),_t=r}())}function Lt(){if(void 0===_t)throw new Error("boolean-wasm is not loaded");return _t}function Ft(t){let e=Ut.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function Nt(t){return Ut.set(++It,t),It}var jt={0:0,1:1,2:2};function kt(t,e,i){if(void 0===_t)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=Wt(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 Nt(new _t.CsgMesh(r,s,a))}function qt(t,e){let i=Lt(),r=jt[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(Ft);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 Gt(t,e,i,r){let s=Lt(),a=qt(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 Nt(a)}function Ht(t,e){let i=Lt(),r=qt(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 Xt(t,e){Ft(t).transform(new Float32Array(e.elements))}function Zt(t){let e=Ut.get(t);void 0!==e&&(e.free(),Ut.delete(t))}function Qt(t,e){return Nt(Lt().instanced_union(Ft(t),e))}function $t(t){return null!==t&&"booleanOp"in t}var Kt=class extends(Dt(A)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new g}updateVisible(t){super.updateVisible(t),this.visible=!$t(this.parent)&&this.visible,$t(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){$t(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(Zt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),$t(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof Kt&&(t.freeBooleanPointer(),$t(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&$t(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),$t(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Yt=new w;function Jt(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)}Yt.min.set(a,n,o),Yt.max.set(l,h,p),Yt.getCenter(r),Yt.getSize(s).multiplyScalar(.5)}var te=new P,ee=new E,ie=class extends Kt{constructor(t,e){super(te,ee),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?Jt(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,V as b,C as c,$ as d,K as e,J as f,ut as g,mt as h,Mt as i,Dt as j,Vt as k,Wt as l,Tt as m,zt as n,kt as o,Gt as p,Ht as q,Xt as r,Zt as s,Qt as t,Jt as u,ie as v};
|
|
1
|
+
import{f as t}from"./runtime-chunk-RTLL6WIB.js";import{h as e}from"./runtime-chunk-2PT2WH66.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Aa as r,Ba as s,C as a,Da as n,J as o,i as l,j as h,k as p,n as d}from"./runtime-chunk-K3UQCG3P.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 O(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 V=new f,W=new f,_=new g,R=[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]],U=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],L=(t,e,i)=>{t.updateEntityBoxSize(V,W),_.copy(e).multiply(t.matrixWorld),0===W.x&&0===W.y&&0===W.z?i.push(new f(V.x,V.y,V.z).applyMatrix4(_)):R.forEach(t=>{i.push(t.clone().multiply(W).add(V).applyMatrix4(_))})},z=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(_));L(t,e,r)}}),0===r.length&&r.push(...i)}else L(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(W).multiplyScalar(.5),this.getCenter(V),_.copy(this.matrix).setPosition(V),this.vertices=R.map(t=>t.clone().multiply(W).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=U.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},I=new f,F=new f,N=new f,j=new f,k=new f,q=new f,G=new g,H=1e-12,X=.01;function Z(t){let e=t.elements;I.set(e[0],e[1],e[2]),F.set(e[4],e[5],e[6]),N.set(e[8],e[9],e[10])}function K(){let t=Math.max(I.lengthSq(),F.lengthSq(),N.lengthSq());I.lengthSq()>H*t?j.copy(I).normalize():j.set(1,0,0),k.crossVectors(N,j),k.lengthSq()<=H*t&&(k.copy(F).addScaledVector(j,-F.dot(j)),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,j)),k.normalize(),q.crossVectors(j,k)}function Q(t){return Z(t),K(),G.makeBasis(j,k,q)}var $,J=new g;($||($={})).is=function(t){return t&&t.__isSPEObject};var Y=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(J.copy(this.parent.matrixWorld).invert()),t.premultiply(J.copy(this.hiddenMatrix).invert()),t.multiply(J.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(j,k,q),i.set(j.dot(I),j.dot(F),j.dot(N),0,k.dot(I),k.dot(F),k.dot(N),0,q.dot(I),q.dot(F),q.dot(N),0,0,0,0,1),function(){let t=I.length(),e=F.length(),i=N.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(I.dot(F))>s||Math.abs(I.dot(N))>s||Math.abs(F.dot(N))>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=new WeakMap;function ut(t){let e=ct.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 ct.set(t.points,{isClosed:t.isClosed,curve:i}),i}var mt,ft=new g,yt=new m,gt=new m,vt=new v,xt=new f,St=new f(0,1,0);(mt||(mt={})).is=function(t){return t&&t.__isEntity};var wt=t=>mt.is(t),Mt={type:"completeState",isfromEntity:!0},bt=["x","y","z"],Bt=new f,Pt=new f(1,1,1),Et=new m,At=new v,Ct=new g,Dt=c=>class extends(Y(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.transitionState={settled:!0,state:null},this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new z,this._recursiveBBox=new z,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(mt.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(mt.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(!mt.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=>{wt(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(mt.is(e[i]))return e[i];if(mt.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&mt.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)wt(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{mt.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)wt(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)wt(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)wt(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=>wt(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(e=[]){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 t(i,e)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,bt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(Bt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(Bt),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??a.identity)),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(Bt.fromArray(t.pivot).negate(),Et.setFromEuler(At.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),Pt);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=Bt.setFromMatrixPosition(this.pivotMatrix);Et.setFromEuler(At.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,Et,Pt)}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)mt.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{mt.is(t)&&t.disposeRecursively()})}toState(e=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return t(i,e)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,a){let o=this.data;this.data=e;let h=t,c=O(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),O(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 s.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(r={...t,props:e})}else for(let e of s.rootOverrideProps)if(O(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)mt.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!==O(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==O(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=ut(n.geometry.path),l=function(t){let e=t%1;return e<0?e+1:0===e&&t>0?1:e}(i+r),h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?Ct.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix):Ct.copy(this.hiddenMatrix),d=function(t,e,i,r){yt.setFromRotationMatrix(ft.extractRotation(r));let s=t.clone().applyMatrix4(ft.copy(r).invert().multiply(i));if(null===e)gt.setFromRotationMatrix(ft.extractRotation(i));else{let t=e.clone().applyMatrix4(ft.extractRotation(i));gt.setFromRotationMatrix(ft.lookAt(xt.set(0,0,0),t,St))}return{position:s,rotation:(new f).setFromEuler(vt.setFromQuaternion(yt.invert().multiply(gt))).multiplyScalar(u.RAD2DEG)}}(h,"tangential"===s?o.getTangentAt(l):null,a.matrixWorld,p);this.updateTransformState({position:d.position.toArray(),rotation:d.rotation.toArray()}),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(Mt)})}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(t=>e(t)&&"toObject"===t.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"})}},Ot=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 Tt(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Vt=new c([0,0,0],1);function Wt(t){return"TorusGeometry"===t.type&&360===t.arc}var _t,Rt,Tt=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(),O=M(),V=M(),W=M(),_=M(),R=M(),T=M(),U=i-2*o+.001,L=U/a,z=Math.ceil(n*a),I=z+1,F=U/z,N=-U/2,j=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=j*Z/2,Q=K+j*I,$=Math.max(0,j*(I+Z)),[J,Y,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*F,w=2*Math.PI*(x%L)/L+r,x+=N,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*z+2*at,ot=G,lt=nt-at;for(let e=0;e<=z;e++){rt(E,e),T.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),R.crossVectors(T,_).normalize();let i=0===e,r=e===z,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?j:Q,l=i?0:$-j,p=T.clone().multiplyScalar(i?-H:H).add(E),u=T.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<j;t++){let m=t*k;if(D.addVectors(B.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(R).multiplyScalar(o*Math.sin(m))),O.copy(D).normalize(),i||r){c||(X=l+t,[0,1,2].forEach(t=>{J[3*X+t]=p.getComponent(t),Y[3*X+t]=u.getComponent(t)}),tt[2*X]=+r,tt[2*X+1]=t/h),P.copy(O).multiplyScalar(G),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*q+s;V.addVectors(B.copy(T).multiplyScalar(H*Math.sin(r)),P.copy(O).multiplyScalar(H*Math.cos(r))),W.copy(V).normalize(),P.addVectors(A,V),V.normalize(),X=n+e*j+t,[0,1,2].forEach(t=>{J[3*X+t]=P.getComponent(t),Y[3*X+t]=W.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*j+t,[0,1,2].forEach(t=>{J[3*X+t]=P.getComponent(t),Y[3*X+t]=O.getComponent(t)}),tt[2*X]=(at+e*st)/nt,tt[2*X+1]=t/h}}let ht=I+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<j-1;i++)u=t*j+i,m=u+1,y=(e?i:u)+j,g=(e?i+1:m)+j,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(J,3)),this.setAttribute("normal",new b(Y,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 Vt.array=new Uint32Array(l),Vt.count=l.length,Vt}},Ut=new Map,Lt=0;function zt(t){return Rt||(Rt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.54/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}),_t=r}())}function It(){if(void 0===_t)throw new Error("boolean-wasm is not loaded");return _t}function Ft(t){let e=Ut.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function Nt(t){return Ut.set(++Lt,t),Lt}var jt={0:0,1:1,2:2};function kt(t,e,i){if(void 0===_t)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=Wt(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 Nt(new _t.CsgMesh(r,s,a))}function qt(t,e){let i=It(),r=jt[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(Ft);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 Gt(t,e,i,r){let s=It(),a=qt(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 Nt(a)}function Ht(t,e){let i=It(),r=qt(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 Xt(t,e){Ft(t).transform(new Float32Array(e.elements))}function Zt(t){let e=Ut.get(t);void 0!==e&&(e.free(),Ut.delete(t))}function Kt(t,e){return Nt(It().instanced_union(Ft(t),e))}function Qt(t){return null!==t&&"booleanOp"in t}var $t=class extends(Dt(A)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new g}updateVisible(t){super.updateVisible(t),this.visible=!Qt(this.parent)&&this.visible,Qt(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Qt(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(Zt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Qt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof $t&&(t.freeBooleanPointer(),Qt(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Qt(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Qt(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Jt=new M;function Yt(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)}Jt.min.set(a,n,o),Jt.max.set(l,h,p),Jt.getCenter(r),Jt.getSize(s).multiplyScalar(.5)}var te=new P,ee=new E,ie=class extends $t{constructor(t,e){super(te,ee),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?Yt(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,O as b,C as c,Q as d,$ as e,Y as f,ut as g,mt as h,wt as i,Dt as j,Ot as k,Wt as l,Tt as m,zt as n,kt as o,Gt as p,Ht as q,Xt as r,Zt as s,Kt as t,Yt as u,ie as v};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as e,d as r}from"./runtime-chunk-7O5DALO7.js";import{f as i}from"./runtime-chunk-RTLL6WIB.js";import{J as a,xa as o}from"./runtime-chunk-NMRQ6IV4.js";import{Ae as s,Ec as n,Fc as p,Oc as h,Rc as c,Tc as m,bd as f,dd as u,ud as d,wd as l,we as g,xe as v}from"./runtime-chunk-BVVSZMXD.js";var C=new p,j=new g,T=class extends l{constructor(t){let e=new u,r=new d({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],a=[],o={},s=new m(15711266),n=new m(15711266),p=new m(2857471);function h(t,e,r){c(t,r),c(e,r)}function c(t,e){i.push(0,0,0),a.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}h("n1","n2",s),h("n2","n4",s),h("n4","n3",s),h("n3","n1",s),h("f1","f2",s),h("f2","f4",s),h("f4","f3",s),h("f3","f1",s),h("n1","f1",s),h("n2","f2",s),h("n3","f3",s),h("n4","f4",s),h("p","n1",n),h("p","n2",n),h("p","n3",n),h("p","n4",n),h("u1","u2",p),h("u2","u3",p),h("u3","u1",p),e.setAttribute("position",new f(i,3)),e.setAttribute("color",new f(a,3)),super(e,r),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){let t=this.geometry,e=this.pointMap;j.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=.8;y("n1",e,t,j,-1,-1,r),y("n2",e,t,j,1,-1,r),y("n3",e,t,j,-1,1,r),y("n4",e,t,j,1,1,r);let i=r;y("f1",e,t,j,-1,-1,i),y("f2",e,t,j,1,-1,i),y("f3",e,t,j,-1,1,i),y("f4",e,t,j,1,1,i);let a=i;y("u1",e,t,j,.35,1.1,a),y("u2",e,t,j,-.35,1.1,a),y("u3",e,t,j,0,1.55,a),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function y(t,e,r,i,a,o,s){C.set(a,o,s).unproject(i);let n=e[t];if(void 0!==n){let t=r.getAttribute("position");for(let e=0,r=n.length;e<r;e++)t.setXYZ(n[e],C.x,C.y,C.z)}}var w=class extends(t(T)){constructor(t){super(t),this.object=t,this.name=`CombinedCameraHelper: ${t.uuid}`}updateMatrixWorld(t){super.updateMatrixWorld(t),this.updateTarget()}updateTarget(){let t=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(t)}raycast(t,r){e(this.object,this.geometry,t,r,!0)}};function P(t){return 1-Math.pow(1-t,3)}var x=new p,b=new p,_=new n,M=new p,O=new p,F=new p,A=class extends(r(g,w)){constructor(t="",e={...o.defaultData,name:""}){super(),this._cameraType="OrthographicCamera",this.targetOffset=a.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this._createdAt=typeof performance<"u"?performance.now():0,this._tickProjectionTransition=()=>{let t=this._projectionTransition;if(void 0===t)return;if(this.disposed)return void this._endProjectionTransition();t.raf=requestAnimationFrame(this._tickProjectionTransition);let e=A.projectionTransitionRequestRender??t.requestRender;this.updateProjectionMatrix(),e?.()},this.super_Entity(t,e),this.previousProjectionMatrix=new h,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,i=this.height;this.orthoCamera=new s(-.5*r,.5*r,.5*i,-.5*i,-5e4,1e4),this.perspCamera=new v(45,r/i,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}static withoutProjectionTransition(t){let e=A.projectionTransitionsEnabled;A.projectionTransitionsEnabled=!1;try{return t()}finally{A.projectionTransitionsEnabled=e}}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(t){this.perspCamera.fov=t}get fov(){return this.perspCamera.fov}setNear(t,e){"PerspectiveCamera"===t?this.perspCamera.near=e:this.orthoCamera.near=e}setZoom(t,e){e>=0&&("PerspectiveCamera"===t?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}set cameraType(t){"PerspectiveCamera"===t?this.toPerspective():"OrthographicCamera"===t&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(t){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=t:this.orthoCamera.near=t}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(t){t>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}lookAt(t,e,r){"number"==typeof t&&(t=new p(t,e,r)),super.lookAt(t),this.getWorldPosition(x),this.targetOffset=x.distanceTo(t)}getTarget(t=new p){return this.getWorldDirection(b),this.getWorldPosition(x),b.multiplyScalar(this.targetOffset),t.copy(x).add(b),t}getDistanceToTarget(){let t=this.getTarget();return this.getWorldPosition(x),x.distanceTo(t)}updateUp(){this.getWorldQuaternion(_),M.set(0,0,1).applyQuaternion(_),O.copy(c.DEFAULT_UP),this.isUpVectorFlipped&&O.negate(),O.applyQuaternion(_),F.copy(c.DEFAULT_UP).projectOnPlane(M),this.angleOffsetFromUp=F.angleTo(O),this.angleOffsetFromUp*=F.cross(O).dot(M)>=0?1:-1}updateTransformState(t,e){let r=super.updateTransformState(t,e);return void 0!==t.isUpVectorFlipped&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(t){let e=t.getWorldPosition(new p),r=t.getWorldDirection(new p).multiplyScalar(this.targetOffset);return{position:e.clone().add(r),target:e}}getViewToTarget(t){let e=this.getWorldDirection(new p).multiplyScalar(this.targetOffset);return{position:t.clone().sub(e),target:t}}getViewToObject(t){let e=new p;return t.getWorldPosition(e),this.getViewToTarget(e)}setViewplaneSize(t,e,r=!1){if(this.aspect=t/e,r){let r=t>e?this.aspect:1,i=t>e?1:this.aspect;this.left=-395*r,this.right=395*r,this.top=1/i*395,this.bottom=1/i*-395}else this.left=.5*-t,this.right=.5*t,this.top=.5*e,this.bottom=.5*-e;this.updateProjectionMatrix()}copyViewPlaneSize(t){this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}get isProjectionTransitioning(){return void 0!==this._projectionTransition}get projectionTransitionProgress(){let t=this._projectionTransition;if(void 0===t)return 1;let e=(performance.now()-t.start)/t.duration;return e>=1?1:e<=0?0:P(e)}get _activeSubCamera(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}_canAnimateProjection(){return A.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=A.projectionTransitionMinAgeMs}_beginProjectionTransition(t){let e=this._projectionTransition;void 0===e&&(e={from:new h,blend:new h,blendInverse:new h,start:0,duration:A.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:t},this._projectionTransition=e),e.from.copy(this.projectionMatrix),e.start=performance.now(),e.duration=A.projectionTransitionDuration,e.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,t&&(e.requestRender=t),0!==e.raf&&cancelAnimationFrame(e.raf),e.raf=requestAnimationFrame(this._tickProjectionTransition)}_applyProjectionTransition(){let t=this._projectionTransition;if(void 0===t)return;let e=(performance.now()-t.start)/t.duration;if(e>=1)return void this._endProjectionTransition();let r=P(e),i=t.from.elements,a=this._activeSubCamera.projectionMatrix.elements,o=t.blend.elements,s=t.referenceDepth,n=Math.max(1e-6,i[15]-i[11]*s),p=r*n/(r*n+(1-r)*Math.max(1e-6,a[15]-a[11]*s));for(let t=0;t<16;t++)o[t]=i[t]+(a[t]-i[t])*p;t.blendInverse.copy(t.blend).invert(),this.projectionMatrix=t.blend,this.projectionMatrixInverse=t.blendInverse}_endProjectionTransition(){let t=this._projectionTransition;if(void 0===t)return;0!==t.raf&&cancelAnimationFrame(t.raf),this._projectionTransition=void 0;let e=this._activeSubCamera;this.projectionMatrix=e.projectionMatrix,this.projectionMatrixInverse=e.projectionMatrixInverse}_syncProjectionTransition(t){let e=t._projectionTransition;if(void 0===e)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());let r=this._projectionTransition;void 0===r?(r={from:new h,blend:new h,blendInverse:new h,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=r):0!==r.raf&&(cancelAnimationFrame(r.raf),r.raf=0),r.requestRender=void 0,r.from.copy(e.from),r.start=e.start,r.duration=e.duration,r.referenceDepth=e.referenceDepth,this._applyProjectionTransition()}setFocalLength(t){this.perspCamera.setFocalLength(t),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(t,e,r,i,a,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(t,e,r,i,a,o):this.orthoCamera.setViewOffset(t,e,r,i,a,o),this._applyProjectionTransition()}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(t,e){return super.copy(t,e),this.parent=t.parent,this.orthoCamera.copy(t.orthoCamera),this.perspCamera.copy(t.perspCamera),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.far=t.far,this.view=null===t.view?null:Object.assign({},t.view),this._cameraType=t._cameraType,this.aspect=t.aspect,this.fov=t.fov,this.focus=t.focus,this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this.targetOffset=a.sanitizeTargetOffset(t.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(t),this}toCameraState(t=[]){let e={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return i(e,t)}updateCameraSubtype(t,e){let r="perspective"===t?"PerspectiveCamera":"OrthographicCamera";void 0!==e.zoom&&this.setZoom(r,e.zoom),void 0!==e.near&&this.setNear(r,e.near),void 0!==e.fov&&"PerspectiveCamera"===r&&(this.fov=e.fov)}updateState(t,e){this.updateCameraState(t,e)}updateCameraState(t,e){this.updateState_Entity(t,e),void 0!==t.far&&(this.far=t.far),void 0!==t.orthographic&&this.updateCameraSubtype("orthographic",t.orthographic),void 0!==t.perspective&&this.updateCameraSubtype("perspective",t.perspective),void 0!==t.type&&(t.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(e?.shared.requestRender),this.cameraType=t.type),void 0!==t.up&&this.up.fromArray(t.up.map(t=>"number"==typeof t?t:0)),void 0!==t.targetOffset&&(this.targetOffset=a.sanitizeTargetOffset(t.targetOffset)),void 0!==t.isUpVectorFlipped&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(t,e,r){super.updateByPatchedOp(t,e,r),1===t.path.length&&0===t.type&&this.updateCameraSubtype(t.path[0],t.props)}toState(t){return{...super.toState(t),...this.toCameraState(t),type:this.cameraType}}},V=A;V.projectionTransitionsEnabled=!1,V.projectionTransitionDuration=350,V.projectionTransitionMinAgeMs=1e3;export{V as a};
|
|
1
|
+
import{a as t,b as e,d as r}from"./runtime-chunk-VNSXYJJ4.js";import{f as i}from"./runtime-chunk-RTLL6WIB.js";import{K as a,ya as o}from"./runtime-chunk-K3UQCG3P.js";import{Ae as s,Ec as n,Fc as p,Oc as h,Rc as c,Tc as m,bd as f,dd as u,ud as d,wd as l,we as g,xe as v}from"./runtime-chunk-BVVSZMXD.js";var C=new p,j=new g,T=class extends l{constructor(t){let e=new u,r=new d({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],a=[],o={},s=new m(15711266),n=new m(15711266),p=new m(2857471);function h(t,e,r){c(t,r),c(e,r)}function c(t,e){i.push(0,0,0),a.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}h("n1","n2",s),h("n2","n4",s),h("n4","n3",s),h("n3","n1",s),h("f1","f2",s),h("f2","f4",s),h("f4","f3",s),h("f3","f1",s),h("n1","f1",s),h("n2","f2",s),h("n3","f3",s),h("n4","f4",s),h("p","n1",n),h("p","n2",n),h("p","n3",n),h("p","n4",n),h("u1","u2",p),h("u2","u3",p),h("u3","u1",p),e.setAttribute("position",new f(i,3)),e.setAttribute("color",new f(a,3)),super(e,r),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){let t=this.geometry,e=this.pointMap;j.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=.8;y("n1",e,t,j,-1,-1,r),y("n2",e,t,j,1,-1,r),y("n3",e,t,j,-1,1,r),y("n4",e,t,j,1,1,r);let i=r;y("f1",e,t,j,-1,-1,i),y("f2",e,t,j,1,-1,i),y("f3",e,t,j,-1,1,i),y("f4",e,t,j,1,1,i);let a=i;y("u1",e,t,j,.35,1.1,a),y("u2",e,t,j,-.35,1.1,a),y("u3",e,t,j,0,1.55,a),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function y(t,e,r,i,a,o,s){C.set(a,o,s).unproject(i);let n=e[t];if(void 0!==n){let t=r.getAttribute("position");for(let e=0,r=n.length;e<r;e++)t.setXYZ(n[e],C.x,C.y,C.z)}}var w=class extends(t(T)){constructor(t){super(t),this.object=t,this.name=`CombinedCameraHelper: ${t.uuid}`}updateMatrixWorld(t){super.updateMatrixWorld(t),this.updateTarget()}updateTarget(){let t=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(t)}raycast(t,r){e(this.object,this.geometry,t,r,!0)}};function P(t){return 1-Math.pow(1-t,3)}var b=new p,x=new p,_=new n,M=new p,O=new p,F=new p,V=class extends(r(g,w)){constructor(t="",e={...o.defaultData,name:""}){super(),this._cameraType="OrthographicCamera",this.targetOffset=a.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this._createdAt=typeof performance<"u"?performance.now():0,this._tickProjectionTransition=()=>{let t=this._projectionTransition;if(void 0===t)return;if(this.disposed)return void this._endProjectionTransition();t.raf=requestAnimationFrame(this._tickProjectionTransition);let e=V.projectionTransitionRequestRender??t.requestRender;this.updateProjectionMatrix(),e?.()},this.super_Entity(t,e),this.previousProjectionMatrix=new h,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,i=this.height;this.orthoCamera=new s(-.5*r,.5*r,.5*i,-.5*i,-5e4,1e4),this.perspCamera=new v(45,r/i,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}static withoutProjectionTransition(t){let e=V.projectionTransitionsEnabled;V.projectionTransitionsEnabled=!1;try{return t()}finally{V.projectionTransitionsEnabled=e}}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(t){this.perspCamera.fov=t}get fov(){return this.perspCamera.fov}setNear(t,e){"PerspectiveCamera"===t?this.perspCamera.near=e:this.orthoCamera.near=e}setZoom(t,e){e>=0&&("PerspectiveCamera"===t?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}set cameraType(t){"PerspectiveCamera"===t?this.toPerspective():"OrthographicCamera"===t&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(t){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=t:this.orthoCamera.near=t}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(t){t>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}lookAt(t,e,r){"number"==typeof t&&(t=new p(t,e,r)),super.lookAt(t),this.getWorldPosition(b),this.targetOffset=b.distanceTo(t)}getTarget(t=new p){return this.getWorldDirection(x),this.getWorldPosition(b),x.multiplyScalar(this.targetOffset),t.copy(b).add(x),t}getDistanceToTarget(){let t=this.getTarget();return this.getWorldPosition(b),b.distanceTo(t)}updateUp(){this.getWorldQuaternion(_),M.set(0,0,1).applyQuaternion(_),O.copy(c.DEFAULT_UP),this.isUpVectorFlipped&&O.negate(),O.applyQuaternion(_),F.copy(c.DEFAULT_UP).projectOnPlane(M),this.angleOffsetFromUp=F.angleTo(O),this.angleOffsetFromUp*=F.cross(O).dot(M)>=0?1:-1}updateTransformState(t,e){let r=super.updateTransformState(t,e);return void 0!==t.isUpVectorFlipped&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(t){let e=t.getWorldPosition(new p),r=t.getWorldDirection(new p).multiplyScalar(this.targetOffset);return{position:e.clone().add(r),target:e}}getViewToTarget(t){let e=this.getWorldDirection(new p).multiplyScalar(this.targetOffset);return{position:t.clone().sub(e),target:t}}getViewToObject(t){let e=new p;return t.getWorldPosition(e),this.getViewToTarget(e)}setViewplaneSize(t,e,r=!1){if(this.aspect=t/e,r){let r=t>e?this.aspect:1,i=t>e?1:this.aspect;this.left=-395*r,this.right=395*r,this.top=1/i*395,this.bottom=1/i*-395}else this.left=.5*-t,this.right=.5*t,this.top=.5*e,this.bottom=.5*-e;this.updateProjectionMatrix()}copyViewPlaneSize(t){this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}get isProjectionTransitioning(){return void 0!==this._projectionTransition}get projectionTransitionProgress(){let t=this._projectionTransition;if(void 0===t)return 1;let e=(performance.now()-t.start)/t.duration;return e>=1?1:e<=0?0:P(e)}get _activeSubCamera(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}_canAnimateProjection(){return V.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=V.projectionTransitionMinAgeMs}_beginProjectionTransition(t){let e=this._projectionTransition;void 0===e&&(e={from:new h,blend:new h,blendInverse:new h,start:0,duration:V.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:t},this._projectionTransition=e),e.from.copy(this.projectionMatrix),e.start=performance.now(),e.duration=V.projectionTransitionDuration,e.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,t&&(e.requestRender=t),0!==e.raf&&cancelAnimationFrame(e.raf),e.raf=requestAnimationFrame(this._tickProjectionTransition)}_applyProjectionTransition(){let t=this._projectionTransition;if(void 0===t)return;let e=(performance.now()-t.start)/t.duration;if(e>=1)return void this._endProjectionTransition();let r=P(e),i=t.from.elements,a=this._activeSubCamera.projectionMatrix.elements,o=t.blend.elements,s=t.referenceDepth,n=Math.max(1e-6,i[15]-i[11]*s),p=r*n/(r*n+(1-r)*Math.max(1e-6,a[15]-a[11]*s));for(let t=0;t<16;t++)o[t]=i[t]+(a[t]-i[t])*p;t.blendInverse.copy(t.blend).invert(),this.projectionMatrix=t.blend,this.projectionMatrixInverse=t.blendInverse}_endProjectionTransition(){let t=this._projectionTransition;if(void 0===t)return;0!==t.raf&&cancelAnimationFrame(t.raf),this._projectionTransition=void 0;let e=this._activeSubCamera;this.projectionMatrix=e.projectionMatrix,this.projectionMatrixInverse=e.projectionMatrixInverse}_syncProjectionTransition(t){let e=t._projectionTransition;if(void 0===e)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());let r=this._projectionTransition;void 0===r?(r={from:new h,blend:new h,blendInverse:new h,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=r):0!==r.raf&&(cancelAnimationFrame(r.raf),r.raf=0),r.requestRender=void 0,r.from.copy(e.from),r.start=e.start,r.duration=e.duration,r.referenceDepth=e.referenceDepth,this._applyProjectionTransition()}setFocalLength(t){this.perspCamera.setFocalLength(t),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(t,e,r,i,a,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(t,e,r,i,a,o):this.orthoCamera.setViewOffset(t,e,r,i,a,o),this._applyProjectionTransition()}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(t,e){return super.copy(t,e),this.parent=t.parent,this.orthoCamera.copy(t.orthoCamera),this.perspCamera.copy(t.perspCamera),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.far=t.far,this.view=null===t.view?null:Object.assign({},t.view),this._cameraType=t._cameraType,this.aspect=t.aspect,this.fov=t.fov,this.focus=t.focus,this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this.targetOffset=a.sanitizeTargetOffset(t.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(t),this}toCameraState(t=[]){let e={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return i(e,t)}updateCameraSubtype(t,e){let r="perspective"===t?"PerspectiveCamera":"OrthographicCamera";void 0!==e.zoom&&this.setZoom(r,e.zoom),void 0!==e.near&&this.setNear(r,e.near),void 0!==e.fov&&"PerspectiveCamera"===r&&(this.fov=e.fov)}updateState(t,e){this.updateCameraState(t,e)}updateCameraState(t,e){this.updateState_Entity(t,e),void 0!==t.far&&(this.far=t.far),void 0!==t.orthographic&&this.updateCameraSubtype("orthographic",t.orthographic),void 0!==t.perspective&&this.updateCameraSubtype("perspective",t.perspective),void 0!==t.type&&(t.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(e?.shared.requestRender),this.cameraType=t.type),void 0!==t.up&&this.up.fromArray(t.up.map(t=>"number"==typeof t?t:0)),void 0!==t.targetOffset&&(this.targetOffset=a.sanitizeTargetOffset(t.targetOffset)),void 0!==t.isUpVectorFlipped&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(t,e,r){super.updateByPatchedOp(t,e,r),1===t.path.length&&0===t.type&&this.updateCameraSubtype(t.path[0],t.props)}toState(t){return{...super.toState(t),...this.toCameraState(t),type:this.cameraType}}},A=V;A.projectionTransitionsEnabled=!1,A.projectionTransitionDuration=350,A.projectionTransitionMinAgeMs=1e3;export{A as a};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fa as t}from"./runtime-chunk-
|
|
1
|
+
import{fa as t}from"./runtime-chunk-ODVIMOLE.js";import{Fc as e,Oc as r,jd as i}from"./runtime-chunk-BVVSZMXD.js";var s=new e,n=new r,a=new i,h=class extends t{constructor(t,e,r){super(t,e,r),this.data=e}get textGeometry(){return this.geometry}get charWidths(){return this.textGeometry.charWidths}get charCoords(){return this.textGeometry.charCoords}get wrappedText(){return this.textGeometry.wrappedText}get font(){return this.textGeometry.font}get initialOffsetY(){let t=this.dataPatched;return this.font?.getLineInitialOffsetY(this.lineHeight,this.wrappedText.length,"number"==typeof t.geometry.height?t.geometry.height:1,this.fontScale,t.geometry.verticalAlign)??0}get fontScale(){let t=this.dataPatched;return this.font?t.geometry.fontSize/this.font.unitsPerEm:1}get AD(){return Math.abs(this.ascender-this.descender)}get ascender(){return(this.font?.ascender??1)*this.fontScale}get descender(){return(this.font?.descender??1)*this.fontScale}get lineHeight(){let t=this.dataPatched;return t.geometry.fontSize*t.geometry.lineHeight}raycast(t,e){let{matrixWorld:r}=this;if(!isNaN(t.ray.origin.x)&&0!==this.scale.x&&0!==this.scale.y&&0!==this.scale.z&&(n.copy(r).invert(),a.copy(t.ray).applyMatrix4(n),a.intersectBox(this.singleBBox,s))){let i=s.applyMatrix4(r),n=t.ray.origin.distanceTo(i);e.push({distance:n,point:i.clone(),object:this})}}};export{h as a};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e,g as t,j as r}from"./runtime-chunk-LDVHB5FO.js";import{a,b as n}from"./runtime-chunk-HD7WF3XN.js";import{c as i,e as s,f as o}from"./runtime-chunk-AE3KJLVD.js";import{a as l}from"./runtime-chunk-5QDCFNS4.js";import{b as u}from"./runtime-chunk-7AN6SYSU.js";import{V as d,Z as c,_ as p,ea as h,fa as f,i as g}from"./runtime-chunk-ODVIMOLE.js";import{v as m}from"./runtime-chunk-4GLZNPR6.js";import{d as b,e as y}from"./runtime-chunk-RTLL6WIB.js";import{c as v,d as w,e as S}from"./runtime-chunk-2PT2WH66.js";import{A as j,B as V,G as A,H as D,M,N as R,O as k,P as x,Q as E,R as O,ca as B,la as C,oa as N,z as P}from"./runtime-chunk-K3UQCG3P.js";import{Cc as G,Dc as F,Ec as I,Fc as z,Oc as q,Pc as T,Tc as L}from"./runtime-chunk-BVVSZMXD.js";var W=Math.fround,U=[.01,100],H=[.01,1e4],Q=[.01,1e3],Z=[.01,1e3];function K(e,[t,r]){return Math.min(Math.max(e,t),r)}function X(e,t,r,a,n){e=K(e,U),t=K(t,H),r=K(r,Q),a=K(a,Z);let i=Math.sqrt(t/e),s=r/(2*Math.sqrt(t*e)),o=s<1?i*Math.sqrt(1-s*s):0,l=s<1?(s*i-a)/o:-a+i;return e=>{let t=void 0!==n?n*e:e;return t=s<1?Math.exp(-t*s*i)*(1*Math.cos(o*t)+l*Math.sin(o*t)):(1+l*t)*Math.exp(-t*i),0===e||1===e?e:1-t}}var J=W(.001),Y=W(1e-7),$=W(.1);function _(e,t){return W(W(1-W(3*t))+W(3*e))}function ee(e,t){return W(W(3*t)-W(6*e))}function te(e){return W(3*e)}function re(e,t,r){return W(W(W(W(W(_(t,r)*e)+ee(t,r))*e)+te(t))*e)}function ae(e,t,r){let a=W(W(W(3*_(t,r))*e)*e),n=W(W(2*ee(t,r))*e);return W(W(a+n)+te(t))}var ne=e=>e;function ie(e,t,r,a){if(e=W(e),t=W(t),r=W(r),a=W(a),e<0||e>1||r<0||r>1||e===t&&r===a)return ne;let n=new Float32Array(11);for(let t=0;t<11;t++)n[t]=re(W(t*$),e,r);return i=>0===(i=W(i))||1===i?i:re((t=>{let a=0,i=1;for(;10!==i&&n[i]<=t;)a=W(a+$),i+=1;i-=1;let s=W(W(t-n[i])/W(n[i+1]-n[i])),o=W(a+W(s*$)),l=ae(o,e,r);return l>=J?function(e,t,r,a){for(let n=0;n<4;n++){let n=ae(t,r,a);if(0===n)return t;let i=W(re(t,r,a)-e);t=W(t-W(i/n))}return t}(t,o,e,r):0===l?o:function(e,t,r,a,n){let i,s=0,o=0;do{s=W(t+W(W(r-t)/2)),i=W(re(s,a,n)-e),i>0?r=s:t=s,o+=1}while(Math.abs(i)>Y&&o<10);return s}(t,a,W(a+$),e,r)})(i),t,a)}var se=W(1.70158);function oe(e,t,r){switch(e.easing){case 0:default:return r;case 1:return ie(.25,.1,.25,1)(r);case 2:return ie(.42,0,1,1)(r);case 3:return ie(0,0,.58,1)(r);case 4:return ie(.42,0,.58,1)(r);case 7:return ie(.25,1,.5,1)(r);case 8:return Math.floor(r);case 5:{let{control1:t,control2:a}=e;return t&&a?ie(t[0],t[1],a[0],a[1])(r):r}case 6:{let{mass:a,stiffness:n,damping:i,velocity:s}=e;return void 0===a||void 0===n||void 0===i||void 0===s?r:W(X(a,n,i,s,t)(r))}}}W(se+1);var le=Math.fround,ue=class{constructor(e,t,r){this.apply=t,this.onStart=r,this.isPlaying=!1,this.isReversed=!1,this.endTime=0,this.startTime=0,this.isFirstLerpAfterStart=!1,this.config=e,this.duration=function(e,t){if(6!==e.easing)return t;let{mass:r,stiffness:a,damping:n,velocity:i}=e;return void 0===r||void 0===a||void 0===n||void 0===i?t:function(e,t,r,a){let n=.16666666666666666,i=0,s=0,o=X(e,t,r,a);for(let e=0;e<1e5;e++)if(i+=n,1===o(i)){if(s+=1,s>=16)break}else s=0;return W(i*n)}(r,a,n,i)}(e.ease,le(e.duration/1e3)),this.delay=le(e.delay/1e3),this.currentRepeat=e.repeat}get repeatDirection(){return this.overrideDirection??this.config.direction}get isPingpong(){let e=this.repeatDirection;return"pingpong"===e||"pingpong-rewind"===e}get actualDelayDirection(){return this.isReversed?"start"===this.config.delayDirection?"end":"end"===this.config.delayDirection?"start":this.config.delayDirection:this.config.delayDirection}start(e){this.isPlaying=!0,this.currentRepeat=this.config.repeat,this.isFirstLerpAfterStart=!0,this.startTime=e,this.onStart?.()}endAfterCurrentPass(){this.currentRepeat<0&&(this.currentRepeat=0)}stop(){this.isPlaying=!1}rearm(){this.onStart?.()}seek(e){this.lerp(e)}update(e){if(!this.isPlaying)return;let t=a(e,this.startTime),r=0;if(this.isFirstLerpAfterStart||!this.isPingpong){let e=this.actualDelayDirection;if("start-once"===this.config.delayDirection&&this.isFirstLerpAfterStart||"start"===e||"start-end"===e){if(t<this.delay)return;r=this.delay}}t=le(t-r);let i=0===this.duration?1:Math.min(Math.max(le(t/this.duration),0),1);if(this.lerp(i),!this.isPlaying||1!==i)return;let s=this.actualDelayDirection;if("end"===s||"start-end"===s){if(t<le(this.duration+this.delay))return;this.endTime=n(this.startTime,le(le(r+this.duration)+this.delay))}else this.endTime=n(this.startTime,le(r+this.duration));this.isFirstLerpAfterStart=!1,0!==this.currentRepeat?(this.currentRepeat>0&&(this.currentRepeat-=1),this.isPingpong?this.isReversed=!this.isReversed:this.lerp(0),this.startTime=e,this.onStart?.()):this.stop()}lerp(e){"pingpong-rewind"===this.repeatDirection&&this.isReversed?(e=le(1-e),e=this.ease(e),e=le(1-e)):e=this.ease(e),this.apply(e)}ease(e){return oe(this.config.ease,this.duration,e)}},{degToRad:de,radToDeg:ce}=G,pe=new z,he=new z,fe=new I;function ge(e,t,r,a,n,i){let s=void 0!==r[e]?r[e]:void 0,o=a[e];if(null==o)return;let l=null!=s?"string"==typeof s?Number(n.getVariable(s)??0):s:t[e],u="string"==typeof o?Number(n.getVariable(o)??0):o;return l!==u?{update:r=>{let a=G.lerp(l,u,r);t[e]=i?Math.trunc(a):a},start:()=>{t[e]=l},end:()=>{t[e]=u}}:void 0}function me(e,t,r,a,n,i){let s=r[e]?r[e]:void 0,o=a[e];if(!o)return;let l=t[e],u=[...s??l].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e),d=[...o].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e);return u.length!==d.length||b(u,d)?void 0:{update:r=>{u.forEach((a,n)=>{let s=G.lerp(a,d[n],r);t[e][n]=i?Math.trunc(s):s})},start:()=>{Object.assign(t[e],u)},end:()=>{Object.assign(t[e],d)}}}function be(e,t,r){return t.forEach((t,a)=>{e.setComponent(a,"string"==typeof t?Number(r.getVariable(t)??0):t)}),e}function ye(e,t,r,a,n){let i=r[e]?r[e]:void 0,s=a[e];if(!s)return;let o=t[e],l=i?be(new z,i,n):o.clone(),u=be(new z,s,n);return l.equals(u)?void 0:{update:e=>{o.lerpVectors(l,u,e)},start:()=>{o.copy(l)},end:()=>{o.copy(u)}}}function ve(e,t,r){return t.forEach((t,a)=>{e.setComponent(a,"string"==typeof t?Number(r.getVariable(t)??0):t)}),e}function we(e,t,r,a,n){let i=r[e]?r[e]:void 0,s=a[e];if(!s)return;let o=t[e],l=!(o instanceof F),u=o instanceof F?o:(new F).fromArray(o),d=i?ve(new F,i,n):u.clone(),c=ve(new F,s,n);return d.equals(c)?void 0:{update:r=>{u.lerpVectors(d,c,r),l&&(t[e]=u.toArray())},start:()=>{u.copy(d),l&&(t[e]=u.toArray())},end:()=>{u.copy(c),l&&(t[e]=u.toArray())}}}function Se(e,t,r,a,n){let i=r[e]?r[e]:void 0,s=a[e];if(!s)return;let o=t[e],l=new g(o.r,o.g,o.b,o.a),u=i?"string"==typeof i?n.getColor(i).clone():new g(i.r,i.g,i.b,i.a):l.clone(),d="string"==typeof s?n.getColor(s).clone():new g(s.r,s.g,s.b,s.a);return u.equals(d)?void 0:{update:r=>{l.lerpColors(u,d,r);let a=G.lerp(u.a,d.a,r);l.a=a,t[e]={r:l.r,g:l.g,b:l.b,a:l.a}},start:()=>{l.copy(u)},end:()=>{l.copy(d)}}}function je(e,t,r,a,n){return"number"==typeof t[e]?ge(e,t,r??{},a,n):Array.isArray(t[e])?me(e,t,r??{},a,n):void 0}function Ve(e,t){if(e)for(let[r,a]of Object.entries(t)){let t=e[r];if(Array.isArray(t)&&Array.isArray(a)){let e=Math.min(t.length,a.length);for(let r=0;r<e;r++)t[r]=a[r]}else e[r]=a}}function Ae(e,t,r,a){let n={};if(!t||!r)return n;for(let i of e){let e=t[i],s=r[i];if("number"==typeof e&&"number"==typeof s)n[i]=G.lerp(e,s,a);else if(Array.isArray(e)&&Array.isArray(s)){let t=Math.min(e.length,s.length);n[i]=Array.from({length:t},(t,r)=>G.lerp(e[r],s[r],a))}}return n}function De(e,t,r,a,n){let i=e.getValue(a);if(void 0!==i){if("colors"===a)return function(e,t,r,a="colors"){if(!e.hasValue(a)||!(a in r))return;let n=[],i=e.getValue(a),s=t?t[a]:i.map(e=>e.toArray()),o=r[a];for(let e=0;e<i.length;++e){let t=[...s[e]],r=[...o[e]];V.isEqual(t,r)||n.push({update:a=>{i[e].fromArray(V.lerp(t,r,a))},start:()=>{i[e].fromArray(t)},end:()=>{i[e].fromArray(r)}})}return n.length?n:void 0}(e,t,r,a);if(Array.isArray(i))return"steps"===a?function(e,t,r,a="steps"){if(!e.hasValue(a)||!(a in r))return;let n=[],i=e.getValue(a),s=t?t[a]:i,o=r[a];return b(s,o)||n.push({update:t=>{let r=[...i];for(let e=0;e<i.length;++e){let a=s[e],n=o[e];r[e]=G.lerp(a,n,t)}e.setValue(a,r)},start:()=>{e.setValue(a,s)},end:()=>{e.setValue(a,o)}}),n.length?n:void 0}(e,t,r,a):void 0;if("number"==typeof i)return function(e,t,r,a,n){if(!e.hasValue(a)||!(a in r))return;let i=t?t[a]:e.getValue(a),s=r[a],o="string"==typeof i?Number(n.getVariable(i)??0):i,l="string"==typeof s?Number(n.getVariable(s)??0):s;return{update:t=>{e.setValue(a,G.lerp(o,l,t))},start:()=>{e.setValue(a,o)},end:()=>{e.setValue(a,l)}}}(e,t,r,a,n);if("boolean"!=typeof i){if(i instanceof F)return function(e,t,r,a){if(!e.hasValue(a)||!(a in r))return;let n=e.getValue(a),i=t?(new F).fromArray(t[a]):n.clone(),s=(new F).fromArray(r[a]);return i.equals(s)?void 0:{update:e=>{n.lerpVectors(i,s,e)},start:()=>{n.copy(i)},end:()=>{n.copy(s)}}}(e,t,r,a);if(i instanceof z)return function(e,t,r,a,n){if(!e.hasValue(a)||!(a in r))return;let i=e.getValue(a),s=t?t[a]:void 0,o=r[a],l=s?be(new z,s,n):i.clone(),u=be(new z,o,n);return l.equals(u)?void 0:{update:e=>{i.lerpVectors(l,u,e)},start:()=>{i.copy(l)},end:()=>{i.copy(u)}}}(e,t,r,a,n);if(i instanceof g)return function(e,t,r,a,n){if(!e.hasValue(a)||!(a in r))return;let i=t?t[a]:void 0,s=r[a],o=e.getValue(a),l=i?"string"==typeof i?n.color(i).clone():(new L).setRGB(i.r,i.g,i.b):o.clone(),u="string"==typeof s?n.color(s).clone():new g(s.r,s.g,s.b,s.a);if(l.equals(u))return;let d=o.clone();return{update:t=>{e.getValue(a)!==d&&e.setValue(a,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,r,a,n);if(i instanceof L)return function(e,t,r,a,n){if(!e.hasValue(a)||!(a in r))return;let i=t?t[a]:void 0,s=r[a],o=e.getValue(a),l=i?"string"==typeof i?n.color(i).clone():(new L).setRGB(i.r,i.g,i.b):o.clone(),u="string"==typeof s?n.color(s).clone():(new L).setRGB(s.r,s.g,s.b);if(l.equals(u))return;let d=o.clone();return{update:t=>{e.getValue(a)!==d&&e.setValue(a,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,r,a,n);if("isTexture"in i)return function(e,t,r,a="texture",n){if(!e.hasValue(a)||!(a in r))return;let i=e=>Number("string"==typeof e?n?.getVariable(e)??0:e??0),s=e.getNode("rotation"),o=t?i(t[a]?.rotation):(s?.value??0)*G.RAD2DEG,l=i(r[a]?.rotation);if(s&&Math.abs(o-l)>1e-9)return{update:e=>{s.value=G.lerp(o,l,e)*G.DEG2RAD},start:()=>{s.value=o*G.DEG2RAD},end:()=>{s.value=l*G.DEG2RAD}};let u=function(e){let t=e.getNode("mat");if("function"==typeof t?.updateMatrix)return t;let r=e.getValue("mat");return"function"==typeof r?.updateMatrix?r:void 0}(e);if(!u)return;let d=t?t[a]:u,c=r[a],p=[...d.repeat],h=[...d.offset],f=[...c.repeat],g=[...c.offset],m=d.rotation??0,b=c.rotation??0;return P.isEqual(p,f)&&P.isEqual(h,g)&&m===b?void 0:{update:e=>{u.repeat=P.lerp(p,f,e),u.offset=P.lerp(h,g,e),u.rotation=G.lerp(m,b,e),u.updateMatrix()},start:()=>{u.repeat=[...p],u.offset=[...h],u.rotation=m,u.updateMatrix()},end:()=>{u.repeat=[...f],u.offset=[...g],u.rotation=b,u.updateMatrix()}}}(e,t,r,a,n)}}}function Me(e,t,r,a){let n=[],i=d(r,a)||!!t.layers&&d(t,a);n.push(function(e,t){return{update:()=>{e.setTransparent(t)}}}(e,i)),function(e,t,r){let a=e.ensureRainbowNoiseCompiled;if("function"==typeof a)for(let n of[...e.layers]){if("rainbow"!==n.type)continue;let i=t.layers?.data(n.uuid),s=r.layers.data(n.uuid);(c(i?.noiseStrength)||c(s?.noiseStrength))&&a.call(e,n.uuid)}}(e,t,r);for(let i of e.layers){let e=t.layers?.data(i.uuid),s=r.layers.data(i.uuid);if(!s||"light"!==i.type&&(!(i.visible??1)||!(s.visible??1)))continue;let o=p[i.type]??[],l=i.getNames().filter(e=>!o.includes(e)&&!B.some(t=>e.includes(t)));for(let t of l)try{let r=De(i,e,s,t,a);r&&(Array.isArray(r)?n.push(...r):n.push(r))}catch(e){console.error(`lerpMaterial: unexpected material layer for ${t}`,e)}}return n}function Re(e,t,r,a,n,i){let s=De(t,r,a,e,i);!s||(Array.isArray(s)?s.forEach(e=>e.update(n)):s.update(n))}new T;var ke=new z,xe=new T;var Ee=[["radial",R],["linear",k],["grid",x],["toObject",E],["randomnessObject",O]];function Oe(e,t,r,a){if(!e)return{};let n=Ae(["count"],t,r,a);void 0!==n.count&&(n.count=Math.trunc(n.count));for(let[i,s]of Ee){if(!e[i])continue;let o=Ae(s,t[i],r[i],a);Object.keys(o).length&&(n[i]=o)}return n}function Be(e,t){if(e){void 0!==t.count&&(e.count=t.count);for(let[r]of Ee){let a=t[r];a&&Ve(e[r],a)}}}function Ce(a,n,d,c,p){let g=[];return a.data.visible&&g.push(...function(e,t,r,a,n){let i,l,u,d,c,p,h,f,g=[];if(S(e)?(i=we("position",e,t,r,n),i&&g.push(i),u=ge("rotation",e,t,r,n),u&&g.push(u),d=we("shear",e,t,r,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},p=ge("slide",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,r.pathSnapping??e.dataPatched.pathSnapping,n),p&&g.push(p),h=ge("offset",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,r.pathSnapping??e.dataPatched.pathSnapping,n),h&&g.push(h),!p&&!h&&(i=ye("position",e,t,r,n),i&&g.push(i),l=ye("scale",e,t,r,n),l&&g.push(l),u=function(e,t,r,a,n){let i=t?.rotation?t.rotation.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*G.DEG2RAD):void 0,s=r.rotation?.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*G.DEG2RAD);if(!s)return;let o=i?(new z).fromArray(i):(new z).setFromEuler(e.rotation),l=(new z).fromArray(s);if(o.equals(l))return;let u=ke.subVectors(l,o);if(a&&u.toArray().every(e=>Math.abs(e)<2*Math.PI)){let t=(new I).setFromEuler(xe.setFromVector3(o)),r=(new I).setFromEuler(xe.setFromVector3(l));return{update:a=>{!function(e,t,r,a){if(0===a)return r.copy(e);if(1===a)return r.copy(t);let n=e.w*t.w+e.x*t.x+e.y*t.y+e.z*t.z;if(n>=1)return r.copy(e);let i=1-n*n;if(i<=Number.EPSILON){let n=1-a;return r.w=n*e.w+a*t.w,r.x=n*e.x+a*t.x,r.y=n*e.y+a*t.y,r.z=n*e.z+a*t.z,r.normalize(),r}let s=Math.sqrt(i),o=Math.atan2(s,n),l=Math.sin((1-a)*o)/s,u=Math.sin(a*o)/s;r.w=e.w*l+t.w*u,r.x=e.x*l+t.x*u,r.y=e.y*l+t.y*u,r.z=e.z*l+t.z*u}(t,r,e.quaternion,a)},start:()=>{e.rotation.setFromVector3(o)},end:()=>{e.rotation.setFromVector3(l)}}}return{update:t=>{ke.lerpVectors(o,l,t),e.rotation.setFromVector3(ke)},start:()=>{e.rotation.setFromVector3(o)},end:()=>{e.rotation.setFromVector3(l)}}}(e,t,r,a,n),u&&g.push(u),c=function(e,t,r,a){let n=r[e]?r[e]:void 0,i=a[e];if(!i)return;let s=t[e],o=n?(new q).fromArray(n):s.clone(),l=new z,u=new I,d=new z;o.decompose(l,u,d);let c=(new q).fromArray(i),p=new z,h=new I,f=new z;return c.decompose(p,h,f),o.equals(c)?void 0:{update:e=>{fe.slerpQuaternions(u,h,e),pe.lerpVectors(l,p,e),he.lerpVectors(d,f,e),s.compose(pe,fe,he)},start:()=>{s.compose(l,u,d)},end:()=>{s.compose(p,h,f)}}}("hiddenMatrix",e,t,r),c&&g.push(c))),i||l||u||c||p||h){let r=S(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)&&o(e.parent)&&e.invalidateDownstreamBooleanData(!0),e.updatePathSnapping(Object.assign({},t.pathSnapping,f))};g.push({update:r,start:r,end:r})}return g}(a,n,d,p,c.shared)),S(a)?g.push(...function(a,n,i,s,o){let l,u,d,c,p,h,f,g,m,b,y,v,w,S,j,V=[];if("width"in a&&(l=ge("width",a,n,i,o),l&&V.push(l)),"height"in a&&(u=ge("height",a,n,i,o),u&&V.push(u)),a instanceof e||a instanceof r){let t={...n.fill},r={...i.fill};void 0!==t.enabled&&t.enabled!==r.enabled&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.fill.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),r.enabled||Object.assign(r,{enabled:!0,color:{...r.color,a:0}})),d=Se("color",a.fill,t,r,o),d&&V.push(d)}if(a instanceof e){let t={...n.stroke},r={...i.stroke};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.stroke.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),r.enabled||Object.assign(r,{enabled:!0,color:{...r.color,a:0}})),c=Se("color",a.stroke,t,r,o),c&&V.push(c),p=ge("thickness",a.stroke,t,r,o),p&&V.push(p)}if(a instanceof e){let t={...n.dropShadow},r={...i.dropShadow};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.dropShadow.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),r.enabled||Object.assign(r,{enabled:!0,color:{...r.color,a:0}})),h=Se("color",a.dropShadow,t,r,o),h&&V.push(h),f=ge("blurRadius",a.dropShadow,t,r,o),f&&V.push(f),m=ge("spread",a.dropShadow,t,r,o),m&&V.push(m),g=we("offset",a.dropShadow,t,r,o),g&&V.push(g)}if(a instanceof e){let t={...n.innerShadow},r={...i.innerShadow};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.innerShadow.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),r.enabled||Object.assign(r,{enabled:!0,color:{...r.color,a:0}})),b=Se("color",a.innerShadow,t,r,o),b&&V.push(b),y=ge("blurRadius",a.innerShadow,t,r,o),y&&V.push(y),w=ge("spread",a.innerShadow,t,r,o),w&&V.push(w),v=we("offset",a.innerShadow,t,r,o),v&&V.push(v)}if(a instanceof e||a instanceof r){let t={...n.backgroundBlur},r={...i.backgroundBlur};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.backgroundBlur.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),r.enabled||Object.assign(r,{enabled:!0,radius:0})),S=ge("radius",a.backgroundBlur,t,r,o),S&&V.push(S)}if(a instanceof e){let t={...n.layerBlur},r={...i.layerBlur};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.layerBlur.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),r.enabled||Object.assign(r,{enabled:!0,radius:0})),j=ge("radius",a.layerBlur,t,r,o),j&&V.push(j)}if(a instanceof r||a instanceof t){let e=me("cornerRadius",a,n,i,o);e&&V.push(e)}return V}(a,n,d,0,c.shared)):(a.data.visible&&g.push(...function(e,t,r,a){let n=[];if(!("cloner"in r)||!e.cloner)return n;let i=e.cloner,s="cloner"in t?t.cloner:{},o=r.cloner;M.forEach(e=>{let t;t="count"===e?ge("count",i.parameters,s,o,a.shared,!0):je(e,i.parameters,s??{},o,a.shared),t&&n.push(t)});let l=function(e,t,r,a){if("radial"!==e.parameters.type)return;let n=t.radial,i=r.radial;if(!i)return;let s=e.parameters.radial,o=[];return R.forEach(e=>{let t=je(e,s,n??{},i,a);t&&o.push(t)}),o}(i,s,o,a.shared);l?.length&&n.push(...l);let u=function(e,t,r,a){if("linear"!==e.parameters.type)return;let n=t.linear,i=r.linear;if(!i)return;let s=[],o=e.parameters.linear;return k.forEach(e=>{let t=je(e,o,n??{},i,a);t&&s.push(t)}),s}(i,s,o,a.shared);u?.length&&n.push(...u);let d=function(e,t,r,a){if("grid"!==e.parameters.type)return;let n=t.grid,i=r.grid;if(!i)return;let s=[],o=e.parameters.grid;return x.forEach(e=>{let t;t="count"===e?me(e,o,n??{},i,a,!0):je(e,o,n??{},i,a),t&&s.push(t)}),s}(i,s,o,a.shared);d?.length&&n.push(...d);let c=function(e,t,r,a){if("toObject"!==e.parameters.type)return;let n=t.toObject,i=r.toObject;if(!i)return;let s=[],o=e.parameters.toObject;return E.forEach(e=>{let t;t="count"===e?ge(e,o,n??{},i,a,!0):je(e,o,n??{},i,a),t&&s.push(t)}),s}(i,s,o,a.shared);c?.length&&n.push(...c);let p=function(e,t,r,a){if(!e.parameters.randomness)return;let n=t.randomnessObject,i=r.randomnessObject;if(!i)return;let s=[],o=e.parameters.randomnessObject;return O.forEach(e=>{let t=je(e,o,n??{},i,a);t&&s.push(t)}),s}(i,s,o,a.shared);return p?.length&&n.push(...p),n.length&&n.push({update:()=>{i.update(a)}}),n}(a,n,d,c)),a instanceof m?(a instanceof f&&a.data.visible&&g.push(...function(e,t,r,a){let n=[];if(!("geometry"in r)||v(e))return n;let i=e.geometry.userData.parameters,s="geometry"in t?t.geometry:{},o=r.geometry;if(e instanceof u){let t=function(e,t,r,a){if(void 0===r.scaleBaked)return;let n=(t.scaleBaked??e.appliedGeometrySize??e.data.geometry.scaleBaked).map(e=>"string"==typeof e?Number(a.shared.getVariable(e)??0):e),i=r.scaleBaked.map(e=>"string"==typeof e?Number(a.shared.getVariable(e)??0):e);if(j.isEqual(n,i))return;let s=[];return s.push({update:t=>{e.updateGeometryInteractions({scaleBaked:[G.lerp(n[0],i[0],t),G.lerp(n[1],i[1],t),G.lerp(n[2],i[2],t)]},a.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(a)},start:()=>{e.updateGeometryInteractions({scaleBaked:n},a.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(a)},end:()=>{e.updateGeometryInteractions({scaleBaked:i},a.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(a)}}),s}(e,s,o,a);t&&n.push(...t)}else{let t={},r=e.appliedGeometrySize;if(Object.assign(t,y(i,N),r?{width:r[0],height:r[1],depth:r[2]}:{},y(s,N)),N.forEach(e=>{let r=je(e,t,s,o,a.shared);r&&n.push(r)}),w(e)){Object.assign(t,{extrusion:{...i.extrusion}});let e=function(e,t,r,a){if(!r.extrusion)return;let n=e.extrusion,i=t.extrusion??{},s=r.extrusion,o=[];return C.forEach(e=>{let t=je(e,n,i,s,a);t&&o.push(t)}),o}(t,s,o,a.shared);e&&n.push(...e)}n.length&&n.push({update:r=>{e.updateGeometryInteractions(t,a.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(a)},start:r=>{e.updateGeometryInteractions(t,a.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(a)},end:r=>{e.updateGeometryInteractions(t,a.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(a)}})}return n}(a,n,d,c)),a.data.visible&&!(a instanceof h&&a.materialOverride)&&g.push(...function(e,t,r,a){let n=[];if(Array.isArray(e.material)){if(!("materials"in r)||!r.materials)return n;let i="materials"in t&&t.materials?t.materials:[],s=r.materials;e.material.forEach((e,t)=>{if(!s[t])return;let r=i[t]??{},o=s[t];"string"==typeof r||"string"==typeof o||n.push(...Me(e,r,o,a))})}else{if(!("material"in r)||!r.material)return n;let i="material"in t&&t.material?t.material:{},s=r.material;if("string"==typeof i||"string"==typeof s)return n;n.push(...Me(e.material,i,s,a))}return n}(a,n,d,c.shared))):i.is(a)?a.data.visible&&g.push(...function(e,t,r,a){let n=[];if(void 0!==r.intensity){let i=ge("intensity",e,t,r,a);i&&n.push(i)}if(void 0!==r.color){let i=function(e,t,r,a,n){let i=r[e]?r[e]:void 0,s=a[e];if(!s)return;let o=t[e],l=i?"string"==typeof i?n.getColor(i).clone():(new L).setRGB(i.r,i.g,i.b):o.clone(),u="string"==typeof s?n.getColor(s).clone():(new L).setRGB(s.r,s.g,s.b);if(l.equals(u))return;let d=o.clone();return{update:r=>{d.lerpColors(l,u,r),t[e]?.copy?.(d)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}("color",e,t,r,a);i&&n.push(i)}return n}(a,n,d,c.shared)):a instanceof l&&g.push(...function(e,t,r,a){let n=[],i="OrthographicCamera"===e.cameraType?t.orthographic?.zoom:t.perspective?.zoom,s="OrthographicCamera"===e.cameraType?r.orthographic?.zoom:r.perspective?.zoom;if(void 0!==s){let t=i??e.zoom,r=s;t!==r&&n.push({update:a=>{e.zoom=G.lerp(t,r,a),e.updateProjectionMatrix()},start:()=>{e.zoom=t,e.updateProjectionMatrix()},end:()=>{e.zoom=r,e.updateProjectionMatrix()}})}if(void 0!==r.targetOffset){let i=ge("targetOffset",e,t,r,a);i&&n.push(i)}return n}(a,n,d,c.shared))),g.length?{update:e=>{g.forEach(t=>t.update(e))},start:e=>{g.forEach(t=>t.start?.(e))},end:e=>{g.forEach(t=>t.end?.(e))}}:void 0}var Ne={type:"beginState"};function Pe(e){if(5===e.easing){let{control1:t,control2:r}=e;return{easing:5,control1:t??D.defaultData.control1,control2:r??D.defaultData.control2}}if(6===e.easing){let{mass:t,stiffness:r,damping:a,velocity:n}=e;return{easing:6,mass:t??A.defaultData.mass,stiffness:r??A.defaultData.stiffness,damping:a??A.defaultData.damping,velocity:n??A.defaultData.velocity}}return{easing:e.easing}}function Ge(e){return{delay:e.delay,delayDirection:e.delayDirection??"start-end",direction:e.direction??"normal",repeat:e.repeat}}var Fe={type:"completeState",isfromEntity:!1};function Ie(e,t){let r,a;if("string"==typeof t?(r=t,a=e.states?.[r]):null===t&&(r=null,a=e.data),void 0!==r&&void 0!==a)return{id:r,data:a}}var ze=["position","rotation","scale","shear","hiddenMatrix"],qe=new Set;function Te(e){if(e.length<2)return qe;let t=new Set,[r,...a]=e;for(let e of ze){let n=r[e];void 0!==n&&a.every(t=>b(t[e],n))&&t.add(e)}return t}var Le=class{constructor(e,t,r,a,n,i,s,o={},l=()=>qe){var u;this.object=e,this.fromRef=t,this.toRef=r,this.data=a,this.sharedAssets=n,this.allowSlerp=i,this.page=s,this.hooks=o,this.inert=l,this.builtReversed=!1,this.startStateId=null,this.buildCallback=()=>{this.builtReversed=this.runner.isReversed,this.startStateId=S(this.object)?null:this.object.transitionState.state,this.callback=Ce(this.object,{},function(e,t){if(0===t.size)return e;let r={...e};for(let e of t)delete r[e];return r}(this.end.data,this.inert()),{scene:this.page.scene,shared:this.sharedAssets},this.allowSlerp)},this.onChange=e=>{this.builtReversed!==this.runner.isReversed&&this.buildCallback(),this.callback&&(this.callback.update(e),this.object.requestRender()),this.writeState(e)},this.runner=new ue({duration:(u=a).duration,ease:Pe(u),...Ge(u)},this.onChange,this.buildCallback),this.rebind()}rebind(){let{fromRef:e,toRef:t}=this;if(void 0===e){let e=Ie(this.object,this.object.currentState===t?this.object.prevState:this.object.currentState);if(!e)throw new Error("Missing property");this.from=e}else{let t=Ie(this.object,e);if(!t)throw new Error("Missing property");this.from=t}if(void 0===t)throw new Error("Missing property");let r=Ie(this.object,t);if(!r)throw new Error("Missing property");this.to=r,this.buildCallback()}refresh(){this.buildCallback()}get endpointData(){return[this.from.data,this.to.data]}get targetStateId(){return this.builtReversed?this.from.id:this.to.id}get start(){return this.builtReversed?this.to:this.from}get end(){return this.builtReversed?this.from:this.to}writeState(e){if(0===e||S(this.object))return;let t=1===e,r=e>.5?this.targetStateId:this.startStateId,a=this.object.transitionState;a.settled===t&&a.state===r||(this.object.transitionState={settled:t,state:r},this.object.reversibleToState=this.end.id,this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=r,this.object.dispatchEvent({type:"transitionState",settled:t,state:r}),this.object.dispatchEvent({type:t?"completeState":"beginState",state:r}),this.object.traverseEntity(e=>{e!==this.object&&e instanceof l&&e.dispatchEvent(t?Fe:Ne)}),t?this.hooks.onComplete?.(r):this.hooks.onBegin?.(r))}};export{oe as a,ue as b,Ae as c,Oe as d,Be as e,Re as f,Ne as g,Pe as h,Ge as i,Fe as j,Ie as k,qe as l,Te as m,Le as n};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as i}from"./runtime-chunk-
|
|
1
|
+
import{a as e,b as i}from"./runtime-chunk-KD4RAVC6.js";import{F as t,G as s,fa as o}from"./runtime-chunk-ODVIMOLE.js";import{v as r}from"./runtime-chunk-4GLZNPR6.js";import{Fc as h,Oc as a,Xc as d,cd as n}from"./runtime-chunk-BVVSZMXD.js";var l=new d,u=new h;function m(e){let i=!1;return e.scene.objects.traverse((e,t)=>{"Mesh"===t.type&&"SubdivGeometry"===t.geometry.type&&(i=!0)}),i}var y=class extends o{constructor(e,i,t){super(e,i,t),this.data=i,this.hiddenMatrixOld=new a,this.smoothShading=!0,this.skipReactionUpdate=!1}chooseGeoemtryCache(e){return this.dataPatched.flatShading?e.geometryCache:e.geometryCache2}get subdivPointerNew(){return void 0!==this.localGeometry?this.subdivPointer:this.geometry.ensureSubdivPointer()}get originalGeometryNew(){return void 0!==this.localGeometry?this.originalGeometry:this.geometry.originalGeometry}get phongAngle(){return this.data.geometry.phongAngle??45}updateEntityBoxSize(e,i){let t=this.geometry.userData.parameters;e.copy(this.originalGeometryNew.boundingSphere.center),i.set(t.width,t.height,t.depth??0).multiplyScalar(.5)}createGeometryByControls(s){if(!0===this.skipReactionUpdate)return;let o=this.localGeometry?.uuid,{originalGeometry:r,subdividedGeometry:h,subdivPointer:a}=t.build(s,this.subdivPointer,this.smoothShading,this.hasNonUniformScale?this.shearScale:void 0);this.subdivPointer=a,void 0!==r&&(this.originalGeometry?.dispose(),this.originalGeometry=r),void 0!==h&&(this.subdividedGeometry?.dispose(),this.subdividedGeometry=h??void 0),this.localGeometry=this.subdividedGeometry??this.originalGeometry,e(this),i(this),this.calcBoundingBox(),o&&(this.localGeometry.uuid=o)}updateState(e,i){if(super.updateState(e,i),void 0!==e.flatShading){let t=this.material;this.material=Array.isArray(t)?t.map(e=>e.getFlavor(!1,e.side,e.wireframe)):t.getFlavor(!1,t.side,t.wireframe),this.smoothShading=!e.flatShading,this.createGeometryDelayed(i)}}updateMesh(e=!1,i=!1,s=!1){i&&this.subdividedGeometry||t.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1,this.originalGeometry,e&&this.hasNonUniformScale?this.shearScaleInv:void 0,s),this.subdividedGeometry&&t.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1,this.subdividedGeometry,e&&this.hasNonUniformScale?this.shearScaleInv:void 0)}updateTopology(){let s=this.localGeometry?.uuid;this.originalGeometry.dispose(),this.originalGeometry=t.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1),this.subdividedGeometry&&(this.subdividedGeometry.dispose(),this.subdividedGeometry=t.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1)),this.localGeometry=this.subdividedGeometry??this.originalGeometry,e(this),i(this),this.calcBoundingBox(),s&&(this.localGeometry.uuid=s)}raycast(e,i){let t=this.localGeometry;this.localGeometry=this.originalGeometryNew,r.prototype.raycast.call(this,e,i),this.localGeometry=t}activateShearCompensation(){!this.hasNonUniformScale||(this.matrix.copy(this.matrixWorldRigid),this.hiddenMatrixOld.copy(this.hiddenMatrix),this.hiddenMatrix.copy(this.parent.matrixWorld).invert())}deactivateShearCompensation(){!this.hasNonUniformScale||(this.updateMatrix(),this.hasNonUniformScale=void 0,this.hiddenMatrix.copy(this.hiddenMatrixOld))}calcBoundingBox(){let e=this.originalGeometry;null===e.boundingSphere&&(e.boundingSphere=new n,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=e.boundingSphere));let i=e.attributes.position,t=e.boundingSphere.center;l.setFromBufferAttribute(i),l.getCenter(t),e.boundingSphere.radius=t.distanceTo(l.max),isNaN(e.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),l.getSize(u),this.hasNonUniformScale&&u.divide(this.scale);let s={width:u.x,height:u.y,depth:u.z};return this.geometry.userData.parameters=s,s}updateBoundingSphere(e){let i=this.originalGeometry;l.min.set(e[0],e[2],e[4]),l.max.set(e[1],e[3],e[5]),this.hasNonUniformScale&&(l.min.applyMatrix4(this.shearScaleInv),l.max.applyMatrix4(this.shearScaleInv)),null===i.boundingSphere&&(i.boundingSphere=new n);let t=i.boundingSphere.center;l.getCenter(t),i.boundingSphere.radius=t.distanceTo(l.max)}freeSubdivPointer(){this.subdivPointer&&(t.freeSubdivPointer(this.subdivPointer),this.subdivPointer=0),this.localGeometry=void 0,this.originalGeometry?.dispose(),this.subdividedGeometry?.dispose()}dispose(){super.dispose(),this.freeSubdivPointer()}updateSubdivisionLevel(s){if(!0===this.skipReactionUpdate)return;let o=this.localGeometry,r=o?.uuid,h=o?.userData.parameters,a=s.subdivisions>0?t.buildRefined(this.subdivPointer,s.subdivisions,this.smoothShading?s.phongAngle??35:-1):null;this.subdividedGeometry?.dispose(),this.subdividedGeometry=a??void 0,this.subdividedGeometry&&this.originalGeometry.boundingSphere&&(this.subdividedGeometry.boundingSphere=this.originalGeometry.boundingSphere),this.localGeometry=this.subdividedGeometry??this.originalGeometry,e(this),i(this),void 0!==h&&(this.localGeometry.userData.parameters=h),r&&(this.localGeometry.uuid=r)}updateByPatchedOpGeometry(e,i,t){super.updateByPatchedOpGeometry(e,i,t),this.localGeometry&&(0===e.type&&0===e.path.length&&s(e.props)&&this.subdivPointer?this.updateSubdivisionLevel(i):this.createGeometryByControls(i))}};export{m as a,y as b};
|
|
Binary file
|
|
Binary file
|