@splinetool/runtime 2.0.46 → 2.0.49
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/{runtime-aiAssistant-CV4K5RNS.js → runtime-aiAssistant-Q7WOWTCF.js} +1 -1
- package/build/runtime-aiAssistant-Q7WOWTCF.js.br +0 -0
- package/build/runtime-aiAssistant-Q7WOWTCF.js.gz +0 -0
- package/build/{runtime-apiServices-IZQKNNJR.js → runtime-apiServices-TWKYVKXK.js} +1 -1
- package/build/runtime-apiServices-TWKYVKXK.js.br +0 -0
- package/build/runtime-apiServices-TWKYVKXK.js.gz +0 -0
- package/build/{runtime-audio-WTF7P43O.js → runtime-audio-EAVYJJ6Y.js} +1 -1
- package/build/runtime-audio-EAVYJJ6Y.js.br +0 -0
- package/build/runtime-audio-EAVYJJ6Y.js.gz +0 -0
- package/build/runtime-chunk-3B2HGN24.js +1 -0
- package/build/runtime-chunk-3B2HGN24.js.br +0 -0
- package/build/runtime-chunk-3B2HGN24.js.gz +0 -0
- package/build/{runtime-chunk-JBIPPY3K.js → runtime-chunk-4EH2XFYY.js} +1 -1
- package/build/runtime-chunk-4EH2XFYY.js.br +0 -0
- package/build/runtime-chunk-4EH2XFYY.js.gz +0 -0
- package/build/{runtime-chunk-A2SZNLCE.js → runtime-chunk-54QYM3MM.js} +1 -1
- package/build/runtime-chunk-54QYM3MM.js.br +0 -0
- package/build/runtime-chunk-54QYM3MM.js.gz +0 -0
- package/build/runtime-chunk-62ULXDUZ.js +1 -0
- package/build/runtime-chunk-62ULXDUZ.js.br +0 -0
- package/build/runtime-chunk-62ULXDUZ.js.gz +0 -0
- package/build/{runtime-chunk-EIKL6YQ3.js → runtime-chunk-A5SHLSKX.js} +1 -1
- package/build/runtime-chunk-A5SHLSKX.js.br +0 -0
- package/build/runtime-chunk-A5SHLSKX.js.gz +0 -0
- package/build/{runtime-chunk-A4V6IMN2.js → runtime-chunk-AAJG7OQA.js} +1 -1
- package/build/runtime-chunk-AAJG7OQA.js.br +0 -0
- package/build/runtime-chunk-AAJG7OQA.js.gz +0 -0
- package/build/{runtime-chunk-HHRA6K3Y.js → runtime-chunk-ABVRWCND.js} +1 -1
- package/build/runtime-chunk-ABVRWCND.js.br +0 -0
- package/build/runtime-chunk-ABVRWCND.js.gz +0 -0
- package/build/{runtime-chunk-DSCGKWZ5.js → runtime-chunk-ALC6ISFF.js} +1 -1
- package/build/runtime-chunk-ALC6ISFF.js.br +0 -0
- package/build/runtime-chunk-ALC6ISFF.js.gz +0 -0
- package/build/{runtime-chunk-W4NXLGIX.js → runtime-chunk-BIQP6R2E.js} +1 -1
- package/build/runtime-chunk-BIQP6R2E.js.br +0 -0
- package/build/runtime-chunk-BIQP6R2E.js.gz +0 -0
- package/build/{runtime-chunk-C6JZPJNZ.js → runtime-chunk-BPWKE4TV.js} +1 -1
- package/build/runtime-chunk-BPWKE4TV.js.br +0 -0
- package/build/runtime-chunk-BPWKE4TV.js.gz +0 -0
- package/build/{runtime-chunk-JVUEEI7B.js → runtime-chunk-CFUHJXWW.js} +1 -1
- package/build/runtime-chunk-CFUHJXWW.js.br +0 -0
- package/build/runtime-chunk-CFUHJXWW.js.gz +0 -0
- package/build/{runtime-chunk-HSPFMEZY.js → runtime-chunk-CGRJT4H4.js} +1 -1
- package/build/runtime-chunk-CGRJT4H4.js.br +0 -0
- package/build/runtime-chunk-CGRJT4H4.js.gz +0 -0
- package/build/{runtime-chunk-A5KIXFSY.js → runtime-chunk-D3NXY575.js} +1 -1
- package/build/runtime-chunk-D3NXY575.js.br +0 -0
- package/build/runtime-chunk-D3NXY575.js.gz +0 -0
- package/build/{runtime-chunk-AMWQRMET.js → runtime-chunk-JH5OFC4J.js} +1 -1
- package/build/runtime-chunk-JH5OFC4J.js.br +0 -0
- package/build/runtime-chunk-JH5OFC4J.js.gz +0 -0
- package/build/{runtime-chunk-ZJD3LX6E.js → runtime-chunk-JRZXX57L.js} +1 -1
- package/build/runtime-chunk-JRZXX57L.js.br +0 -0
- package/build/runtime-chunk-JRZXX57L.js.gz +0 -0
- package/build/{runtime-chunk-GR2ZC5GY.js → runtime-chunk-KGRWOXPD.js} +1 -1
- package/build/runtime-chunk-KGRWOXPD.js.br +0 -0
- package/build/runtime-chunk-KGRWOXPD.js.gz +0 -0
- package/build/{runtime-chunk-KL6OIHVF.js → runtime-chunk-KYWOL4FO.js} +1 -1
- package/build/{runtime-chunk-KL6OIHVF.js.br → runtime-chunk-KYWOL4FO.js.br} +0 -0
- package/build/runtime-chunk-KYWOL4FO.js.gz +0 -0
- package/build/{runtime-chunk-ZJCEUE6J.js → runtime-chunk-LEXX7XOL.js} +1 -1
- package/build/runtime-chunk-LEXX7XOL.js.br +0 -0
- package/build/runtime-chunk-LEXX7XOL.js.gz +0 -0
- package/build/{runtime-chunk-WKTS4T2Q.js → runtime-chunk-NMRQ6IV4.js} +1 -1
- package/build/runtime-chunk-NMRQ6IV4.js.br +0 -0
- package/build/runtime-chunk-NMRQ6IV4.js.gz +0 -0
- package/build/{runtime-chunk-GJIYL4V5.js → runtime-chunk-QU4YWWPM.js} +1 -1
- package/build/runtime-chunk-QU4YWWPM.js.br +0 -0
- package/build/runtime-chunk-QU4YWWPM.js.gz +0 -0
- package/build/{runtime-chunk-FNG2IRQJ.js → runtime-chunk-R6SG422O.js} +1 -1
- package/build/runtime-chunk-R6SG422O.js.br +0 -0
- package/build/runtime-chunk-R6SG422O.js.gz +0 -0
- package/build/{runtime-chunk-Z4NV7FMH.js → runtime-chunk-RQTWS576.js} +1 -1
- package/build/runtime-chunk-RQTWS576.js.br +0 -0
- package/build/runtime-chunk-RQTWS576.js.gz +0 -0
- package/build/{runtime-chunk-UYRGNTDQ.js → runtime-chunk-SKL72FMW.js} +1 -1
- package/build/runtime-chunk-SKL72FMW.js.br +0 -0
- package/build/runtime-chunk-SKL72FMW.js.gz +0 -0
- package/build/{runtime-chunk-M3F4LIG4.js → runtime-chunk-UGYY3TE5.js} +1 -1
- package/build/runtime-chunk-UGYY3TE5.js.br +0 -0
- package/build/runtime-chunk-UGYY3TE5.js.gz +0 -0
- package/build/{runtime-chunk-Y5F2EZVH.js → runtime-chunk-UOHC2OET.js} +1 -1
- package/build/runtime-chunk-UOHC2OET.js.br +0 -0
- package/build/runtime-chunk-UOHC2OET.js.gz +0 -0
- package/build/{runtime-chunk-OF2FTFLH.js → runtime-chunk-UQZ4RL7R.js} +1 -1
- package/build/runtime-chunk-UQZ4RL7R.js.br +0 -0
- package/build/runtime-chunk-UQZ4RL7R.js.gz +0 -0
- package/build/{runtime-chunk-XV6R6T7P.js → runtime-chunk-WY4SDMN3.js} +1 -1
- package/build/runtime-chunk-WY4SDMN3.js.br +1 -0
- package/build/runtime-chunk-WY4SDMN3.js.gz +0 -0
- package/build/{runtime-chunk-VE44RSRZ.js → runtime-chunk-XVKC3GTF.js} +1 -1
- package/build/{runtime-chunk-VE44RSRZ.js.br → runtime-chunk-XVKC3GTF.js.br} +0 -0
- package/build/runtime-chunk-XVKC3GTF.js.gz +0 -0
- package/build/{runtime-chunk-AF23X5NO.js → runtime-chunk-YJTOFWUO.js} +1 -1
- package/build/runtime-chunk-YJTOFWUO.js.br +0 -0
- package/build/runtime-chunk-YJTOFWUO.js.gz +0 -0
- package/build/runtime-classicRuntime-B2COIB35.js +1 -0
- package/build/runtime-classicRuntime-B2COIB35.js.br +0 -0
- package/build/runtime-classicRuntime-B2COIB35.js.gz +0 -0
- package/build/runtime-cloners-RPTIIXIY.js +1 -0
- package/build/runtime-cloners-RPTIIXIY.js.br +0 -0
- package/build/runtime-cloners-RPTIIXIY.js.gz +0 -0
- package/build/{runtime-components-XWRACNBU.js → runtime-components-UXZNYXDN.js} +1 -1
- package/build/runtime-components-UXZNYXDN.js.br +0 -0
- package/build/runtime-components-UXZNYXDN.js.gz +0 -0
- package/build/{runtime-conditional-3IFYLPUZ.js → runtime-conditional-XSJDNYMV.js} +1 -1
- package/build/runtime-conditional-XSJDNYMV.js.br +0 -0
- package/build/runtime-conditional-XSJDNYMV.js.gz +0 -0
- package/build/{runtime-createDestroy-QWUF3GPM.js → runtime-createDestroy-ESM4PSNF.js} +1 -1
- package/build/runtime-createDestroy-ESM4PSNF.js.br +0 -0
- package/build/runtime-createDestroy-ESM4PSNF.js.gz +0 -0
- package/build/{runtime-dragDrop-7Q7GPQVN.js → runtime-dragDrop-D7YOCWAO.js} +1 -1
- package/build/runtime-dragDrop-D7YOCWAO.js.br +0 -0
- package/build/runtime-dragDrop-D7YOCWAO.js.gz +0 -0
- package/build/{runtime-fxBloom-BKZGVVPT.js → runtime-fxBloom-5MMJ7V4U.js} +1 -1
- package/build/runtime-fxBloom-5MMJ7V4U.js.br +0 -0
- package/build/runtime-fxBloom-5MMJ7V4U.js.gz +0 -0
- package/build/{runtime-gameControls-SDY6N2PY.js → runtime-gameControls-6KBAJLUE.js} +1 -1
- package/build/runtime-gameControls-6KBAJLUE.js.br +0 -0
- package/build/runtime-gameControls-6KBAJLUE.js.gz +0 -0
- package/build/runtime-hair-MJN3Q7FU.js +1 -0
- package/build/runtime-hair-MJN3Q7FU.js.br +2 -0
- package/build/runtime-hair-MJN3Q7FU.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-TNNOBCGA.js → runtime-mergeStaticGeometries-66XHJCUJ.js} +1 -1
- package/build/runtime-mergeStaticGeometries-66XHJCUJ.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-66XHJCUJ.js.gz +0 -0
- package/build/{runtime-miscActions-QSAGKDZJ.js → runtime-miscActions-V64WLHDQ.js} +1 -1
- package/build/runtime-miscActions-V64WLHDQ.js.br +0 -0
- package/build/runtime-miscActions-V64WLHDQ.js.gz +0 -0
- package/build/{runtime-mouseHover-62MHBTFY.js → runtime-mouseHover-OT5UUTKX.js} +1 -1
- package/build/runtime-mouseHover-OT5UUTKX.js.br +0 -0
- package/build/runtime-mouseHover-OT5UUTKX.js.gz +0 -0
- package/build/{runtime-particles-ZQHFGFBM.js → runtime-particles-RZVGI6RG.js} +1 -1
- package/build/runtime-particles-RZVGI6RG.js.br +0 -0
- package/build/runtime-particles-RZVGI6RG.js.gz +0 -0
- package/build/{runtime-paths-3FIH62G6.js → runtime-paths-GHSTNP5N.js} +1 -1
- package/build/runtime-paths-GHSTNP5N.js.br +0 -0
- package/build/runtime-paths-GHSTNP5N.js.gz +0 -0
- package/build/{runtime-resize-CRSWQBEC.js → runtime-resize-IPWYUT6P.js} +1 -1
- package/build/runtime-resize-IPWYUT6P.js.br +0 -0
- package/build/runtime-resize-IPWYUT6P.js.gz +0 -0
- package/build/{runtime-sceneTransition-APLHOQF2.js → runtime-sceneTransition-BAOBPWP2.js} +1 -1
- package/build/runtime-sceneTransition-BAOBPWP2.js.br +0 -0
- package/build/runtime-sceneTransition-BAOBPWP2.js.gz +0 -0
- package/build/{runtime-scroll-PFA62LPV.js → runtime-scroll-LDBVGTY7.js} +1 -1
- package/build/runtime-scroll-LDBVGTY7.js.br +0 -0
- package/build/runtime-scroll-LDBVGTY7.js.gz +0 -0
- package/build/runtime-shapeBlends-FCVAMLTP.js +1 -0
- package/build/runtime-shapeBlends-FCVAMLTP.js.br +0 -0
- package/build/runtime-shapeBlends-FCVAMLTP.js.gz +0 -0
- package/build/{runtime-text-TUKJCR2B.js → runtime-text-VCGMGBZ5.js} +1 -1
- package/build/runtime-text-VCGMGBZ5.js.br +0 -0
- package/build/runtime-text-VCGMGBZ5.js.gz +0 -0
- package/build/{runtime-textInputs-6UWEC42Z.js → runtime-textInputs-QK6UTNH2.js} +1 -1
- package/build/runtime-textInputs-QK6UTNH2.js.br +0 -0
- package/build/runtime-textInputs-QK6UTNH2.js.gz +0 -0
- package/build/{runtime-timeline-YMCCOEV5.js → runtime-timeline-A4MYQAI6.js} +1 -1
- package/build/runtime-timeline-A4MYQAI6.js.br +0 -0
- package/build/runtime-timeline-A4MYQAI6.js.gz +0 -0
- package/build/{runtime-tracking-WROBAURO.js → runtime-tracking-WDUCSHW4.js} +1 -1
- package/build/runtime-tracking-WDUCSHW4.js.br +0 -0
- package/build/runtime-tracking-WDUCSHW4.js.gz +0 -0
- package/build/{runtime-transitions-JZCKGRPR.js → runtime-transitions-E65FPWMI.js} +1 -1
- package/build/runtime-transitions-E65FPWMI.js.br +0 -0
- package/build/runtime-transitions-E65FPWMI.js.gz +0 -0
- package/build/{runtime-ui2d-4LSBVCJJ.js → runtime-ui2d-V4OY3GOI.js} +1 -1
- package/build/runtime-ui2d-V4OY3GOI.js.br +0 -0
- package/build/runtime-ui2d-V4OY3GOI.js.gz +0 -0
- package/build/{runtime-updater-BNOFPDRB.js → runtime-updater-QYT2D73O.js} +1 -1
- package/build/runtime-updater-QYT2D73O.js.br +2 -0
- package/build/runtime-updater-QYT2D73O.js.gz +0 -0
- package/build/{runtime-variables-UHMFC5KF.js → runtime-variables-PI7YVOVR.js} +1 -1
- package/build/runtime-variables-PI7YVOVR.js.br +0 -0
- package/build/runtime-variables-PI7YVOVR.js.gz +0 -0
- package/build/{runtime-vectorShapes-BCUVEHSB.js → runtime-vectorShapes-BJDJMOYN.js} +1 -1
- package/build/runtime-vectorShapes-BJDJMOYN.js.br +0 -0
- package/build/runtime-vectorShapes-BJDJMOYN.js.gz +0 -0
- package/build/{runtime-video-HX4EHK3D.js → runtime-video-5C4ZCNVD.js} +1 -1
- package/build/runtime-video-5C4ZCNVD.js.br +0 -0
- package/build/runtime-video-5C4ZCNVD.js.gz +0 -0
- package/build/runtime-webgpu-WABQUMLC.js +1 -0
- package/build/runtime-webgpu-WABQUMLC.js.br +0 -0
- package/build/runtime-webgpu-WABQUMLC.js.gz +0 -0
- package/build/runtime.cjs +338 -333
- 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 +1 -1
- package/build/runtime-aiAssistant-CV4K5RNS.js.br +0 -0
- package/build/runtime-aiAssistant-CV4K5RNS.js.gz +0 -0
- package/build/runtime-apiServices-IZQKNNJR.js.br +0 -0
- package/build/runtime-apiServices-IZQKNNJR.js.gz +0 -0
- package/build/runtime-audio-WTF7P43O.js.br +0 -0
- package/build/runtime-audio-WTF7P43O.js.gz +0 -0
- package/build/runtime-chunk-A2SZNLCE.js.br +0 -0
- package/build/runtime-chunk-A2SZNLCE.js.gz +0 -0
- package/build/runtime-chunk-A4V6IMN2.js.br +0 -0
- package/build/runtime-chunk-A4V6IMN2.js.gz +0 -0
- package/build/runtime-chunk-A5KIXFSY.js.br +0 -0
- package/build/runtime-chunk-A5KIXFSY.js.gz +0 -0
- package/build/runtime-chunk-AF23X5NO.js.br +0 -0
- package/build/runtime-chunk-AF23X5NO.js.gz +0 -0
- package/build/runtime-chunk-AMWQRMET.js.br +0 -0
- package/build/runtime-chunk-AMWQRMET.js.gz +0 -0
- package/build/runtime-chunk-C6JZPJNZ.js.br +0 -0
- package/build/runtime-chunk-C6JZPJNZ.js.gz +0 -0
- package/build/runtime-chunk-DSCGKWZ5.js.br +0 -0
- package/build/runtime-chunk-DSCGKWZ5.js.gz +0 -0
- package/build/runtime-chunk-EIKL6YQ3.js.br +0 -0
- package/build/runtime-chunk-EIKL6YQ3.js.gz +0 -0
- package/build/runtime-chunk-FNG2IRQJ.js.br +0 -0
- package/build/runtime-chunk-FNG2IRQJ.js.gz +0 -0
- package/build/runtime-chunk-GJIYL4V5.js.br +0 -0
- package/build/runtime-chunk-GJIYL4V5.js.gz +0 -0
- package/build/runtime-chunk-GR2ZC5GY.js.br +0 -0
- package/build/runtime-chunk-GR2ZC5GY.js.gz +0 -0
- package/build/runtime-chunk-HHRA6K3Y.js.br +0 -0
- package/build/runtime-chunk-HHRA6K3Y.js.gz +0 -0
- package/build/runtime-chunk-HSPFMEZY.js.br +0 -0
- package/build/runtime-chunk-HSPFMEZY.js.gz +0 -0
- package/build/runtime-chunk-JBIPPY3K.js.br +0 -0
- package/build/runtime-chunk-JBIPPY3K.js.gz +0 -0
- package/build/runtime-chunk-JVUEEI7B.js.br +0 -0
- package/build/runtime-chunk-JVUEEI7B.js.gz +0 -0
- package/build/runtime-chunk-KL6OIHVF.js.gz +0 -0
- package/build/runtime-chunk-M3F4LIG4.js.br +0 -0
- package/build/runtime-chunk-M3F4LIG4.js.gz +0 -0
- package/build/runtime-chunk-OF2FTFLH.js.br +0 -0
- package/build/runtime-chunk-OF2FTFLH.js.gz +0 -0
- package/build/runtime-chunk-TLA4CYVH.js +0 -1
- package/build/runtime-chunk-TLA4CYVH.js.br +0 -0
- package/build/runtime-chunk-TLA4CYVH.js.gz +0 -0
- package/build/runtime-chunk-UYRGNTDQ.js.br +0 -0
- package/build/runtime-chunk-UYRGNTDQ.js.gz +0 -0
- package/build/runtime-chunk-VE44RSRZ.js.gz +0 -0
- package/build/runtime-chunk-W4NXLGIX.js.br +0 -0
- package/build/runtime-chunk-W4NXLGIX.js.gz +0 -0
- package/build/runtime-chunk-WKTS4T2Q.js.br +0 -0
- package/build/runtime-chunk-WKTS4T2Q.js.gz +0 -0
- package/build/runtime-chunk-XEXAWJME.js +0 -1
- package/build/runtime-chunk-XEXAWJME.js.br +0 -0
- package/build/runtime-chunk-XEXAWJME.js.gz +0 -0
- package/build/runtime-chunk-XV6R6T7P.js.br +0 -1
- package/build/runtime-chunk-XV6R6T7P.js.gz +0 -0
- package/build/runtime-chunk-Y5F2EZVH.js.br +0 -0
- package/build/runtime-chunk-Y5F2EZVH.js.gz +0 -0
- package/build/runtime-chunk-Z4NV7FMH.js.br +0 -0
- package/build/runtime-chunk-Z4NV7FMH.js.gz +0 -0
- package/build/runtime-chunk-ZJCEUE6J.js.br +0 -0
- package/build/runtime-chunk-ZJCEUE6J.js.gz +0 -0
- package/build/runtime-chunk-ZJD3LX6E.js.br +0 -0
- package/build/runtime-chunk-ZJD3LX6E.js.gz +0 -0
- package/build/runtime-classicRuntime-Z4JNOMJD.js +0 -1
- package/build/runtime-classicRuntime-Z4JNOMJD.js.br +0 -0
- package/build/runtime-classicRuntime-Z4JNOMJD.js.gz +0 -0
- package/build/runtime-cloners-2IWTYAOM.js +0 -1
- package/build/runtime-cloners-2IWTYAOM.js.br +0 -0
- package/build/runtime-cloners-2IWTYAOM.js.gz +0 -0
- package/build/runtime-components-XWRACNBU.js.br +0 -0
- package/build/runtime-components-XWRACNBU.js.gz +0 -0
- package/build/runtime-conditional-3IFYLPUZ.js.br +0 -0
- package/build/runtime-conditional-3IFYLPUZ.js.gz +0 -0
- package/build/runtime-createDestroy-QWUF3GPM.js.br +0 -0
- package/build/runtime-createDestroy-QWUF3GPM.js.gz +0 -0
- package/build/runtime-dragDrop-7Q7GPQVN.js.br +0 -0
- package/build/runtime-dragDrop-7Q7GPQVN.js.gz +0 -0
- package/build/runtime-fxBloom-BKZGVVPT.js.br +0 -0
- package/build/runtime-fxBloom-BKZGVVPT.js.gz +0 -0
- package/build/runtime-gameControls-SDY6N2PY.js.br +0 -0
- package/build/runtime-gameControls-SDY6N2PY.js.gz +0 -0
- package/build/runtime-hair-H5I5EW4P.js +0 -1
- package/build/runtime-hair-H5I5EW4P.js.br +0 -1
- package/build/runtime-hair-H5I5EW4P.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-TNNOBCGA.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-TNNOBCGA.js.gz +0 -0
- package/build/runtime-miscActions-QSAGKDZJ.js.br +0 -0
- package/build/runtime-miscActions-QSAGKDZJ.js.gz +0 -0
- package/build/runtime-mouseHover-62MHBTFY.js.br +0 -0
- package/build/runtime-mouseHover-62MHBTFY.js.gz +0 -0
- package/build/runtime-particles-ZQHFGFBM.js.br +0 -0
- package/build/runtime-particles-ZQHFGFBM.js.gz +0 -0
- package/build/runtime-paths-3FIH62G6.js.br +0 -0
- package/build/runtime-paths-3FIH62G6.js.gz +0 -0
- package/build/runtime-resize-CRSWQBEC.js.br +0 -0
- package/build/runtime-resize-CRSWQBEC.js.gz +0 -0
- package/build/runtime-sceneTransition-APLHOQF2.js.br +0 -0
- package/build/runtime-sceneTransition-APLHOQF2.js.gz +0 -0
- package/build/runtime-scroll-PFA62LPV.js.br +0 -0
- package/build/runtime-scroll-PFA62LPV.js.gz +0 -0
- package/build/runtime-shapeBlends-CLW3VCVF.js +0 -1
- package/build/runtime-shapeBlends-CLW3VCVF.js.br +0 -0
- package/build/runtime-shapeBlends-CLW3VCVF.js.gz +0 -0
- package/build/runtime-text-TUKJCR2B.js.br +0 -0
- package/build/runtime-text-TUKJCR2B.js.gz +0 -0
- package/build/runtime-textInputs-6UWEC42Z.js.br +0 -0
- package/build/runtime-textInputs-6UWEC42Z.js.gz +0 -0
- package/build/runtime-timeline-YMCCOEV5.js.br +0 -0
- package/build/runtime-timeline-YMCCOEV5.js.gz +0 -0
- package/build/runtime-tracking-WROBAURO.js.br +0 -0
- package/build/runtime-tracking-WROBAURO.js.gz +0 -0
- package/build/runtime-transitions-JZCKGRPR.js.br +0 -0
- package/build/runtime-transitions-JZCKGRPR.js.gz +0 -0
- package/build/runtime-ui2d-4LSBVCJJ.js.br +0 -0
- package/build/runtime-ui2d-4LSBVCJJ.js.gz +0 -0
- package/build/runtime-updater-BNOFPDRB.js.br +0 -2
- package/build/runtime-updater-BNOFPDRB.js.gz +0 -0
- package/build/runtime-variables-UHMFC5KF.js.br +0 -0
- package/build/runtime-variables-UHMFC5KF.js.gz +0 -0
- package/build/runtime-vectorShapes-BCUVEHSB.js.br +0 -0
- package/build/runtime-vectorShapes-BCUVEHSB.js.gz +0 -0
- package/build/runtime-video-HX4EHK3D.js.br +0 -0
- package/build/runtime-video-HX4EHK3D.js.gz +0 -0
- package/build/runtime-webgpu-JFQDKQ6C.js +0 -1
- package/build/runtime-webgpu-JFQDKQ6C.js.br +0 -0
- package/build/runtime-webgpu-JFQDKQ6C.js.gz +0 -0
|
@@ -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-Y5F2EZVH.js";import"./runtime-chunk-C6JZPJNZ.js";import{a as n}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-WKTS4T2Q.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-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");
|
|
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-Y5F2EZVH.js";import{a}from"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-C6JZPJNZ.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import{Ea as c,Fa as d,n as u}from"./runtime-chunk-WKTS4T2Q.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-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");
|
|
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-UOHC2OET.js";import"./runtime-chunk-BPWKE4TV.js";import{a as s}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-NMRQ6IV4.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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e,g as t,j as r}from"./runtime-chunk-CGRJT4H4.js";import{a,b as n}from"./runtime-chunk-HD7WF3XN.js";import{c as i,e as s,f as o}from"./runtime-chunk-QU4YWWPM.js";import{a as l}from"./runtime-chunk-4EH2XFYY.js";import{b as u}from"./runtime-chunk-BIQP6R2E.js";import{U as d,Y as c,Z as p,da as h,ea as f,h as g}from"./runtime-chunk-AAJG7OQA.js";import{v as m}from"./runtime-chunk-ABVRWCND.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,F as A,G as V,L as M,M as D,N as R,O as k,P as E,Q as x,ba as O,ka as B,na as C,y as P,z as N}from"./runtime-chunk-NMRQ6IV4.js";import{Cc as G,Dc as I,Ec as F,Fc as q,Oc as z,Pc as T,Tc as W}from"./runtime-chunk-BVVSZMXD.js";var L=Math.fround,Q=[.01,100],U=[.01,1e4],H=[.01,1e3],Y=[.01,1e3];function X(e,[t,r]){return Math.min(Math.max(e,t),r)}function J(e,t,r,a,n){e=X(e,Q),t=X(t,U),r=X(r,H),a=X(a,Y);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 Z=L(.001),$=L(1e-7),K=L(.1);function _(e,t){return L(L(1-L(3*t))+L(3*e))}function ee(e,t){return L(L(3*t)-L(6*e))}function te(e){return L(3*e)}function re(e,t,r){return L(L(L(L(L(_(t,r)*e)+ee(t,r))*e)+te(t))*e)}function ae(e,t,r){let a=L(L(L(3*_(t,r))*e)*e),n=L(L(2*ee(t,r))*e);return L(L(a+n)+te(t))}var ne=e=>e;function ie(e,t,r,a){if(e=L(e),t=L(t),r=L(r),a=L(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(L(t*K),e,r);return i=>0===(i=L(i))||1===i?i:re((t=>{let a=0,i=1;for(;10!==i&&n[i]<=t;)a=L(a+K),i+=1;i-=1;let s=L(L(t-n[i])/L(n[i+1]-n[i])),o=L(a+L(s*K)),l=ae(o,e,r);return l>=Z?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=L(re(t,r,a)-e);t=L(t-L(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=L(t+L(L(r-t)/2)),i=L(re(s,a,n)-e),i>0?r=s:t=s,o+=1}while(Math.abs(i)>$&&o<10);return s}(t,a,L(a+K),e,r)})(i),t,a)}var se=L(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:L(J(a,n,i,s,t)(r))}}}L(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=J(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 L(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 q,he=new q,fe=new F;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 q,i,n):o.clone(),u=be(new q,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 I),u=o instanceof I?o:(new I).fromArray(o),d=i?ve(new I,i,n):u.clone(),c=ve(new I,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 Ae(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 Ve(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 Me(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]];j.isEqual(t,r)||n.push({update:a=>{i[e].fromArray(j.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 I)return function(e,t,r,a){if(!e.hasValue(a)||!(a in r))return;let n=e.getValue(a),i=t?(new I).fromArray(t[a]):n.clone(),s=(new I).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 q)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 q,s,n):i.clone(),u=be(new q,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 W).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 W)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 W).setRGB(i.r,i.g,i.b):o.clone(),u="string"==typeof s?n.color(s).clone():(new W).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 De(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)&&!O.some(t=>e.includes(t)));for(let t of l)try{let r=Me(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=Me(t,r,a,e,i);!s||(Array.isArray(s)?s.forEach(e=>e.update(n)):s.update(n))}new T;var ke=new q,Ee=new T;var xe=[["radial",D],["linear",R],["grid",k],["toObject",E],["randomnessObject",x]];function Oe(e,t,r,a){if(!e)return{};let n=Ve(["count"],t,r,a);void 0!==n.count&&(n.count=Math.trunc(n.count));for(let[i,s]of xe){if(!e[i])continue;let o=Ve(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 xe){let a=t[r];a&&Ae(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 q).fromArray(i):(new q).setFromEuler(e.rotation),l=(new q).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 F).setFromEuler(Ee.setFromVector3(o)),r=(new F).setFromEuler(Ee.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 z).fromArray(n):s.clone(),l=new q,u=new F,d=new q;o.decompose(l,u,d);let c=(new z).fromArray(i),p=new q,h=new F,f=new q;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,A=[];if("width"in a&&(l=ge("width",a,n,i,o),l&&A.push(l)),"height"in a&&(u=ge("height",a,n,i,o),u&&A.push(u)),a instanceof e||a instanceof r){let t={...n.fill},r={...i.fill};void 0!==t.enabled&&t.enabled!==r.enabled&&(A.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&&A.push(d)}if(a instanceof e){let t={...n.stroke},r={...i.stroke};(t.enabled||r.enabled)&&(A.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&&A.push(c),p=ge("thickness",a.stroke,t,r,o),p&&A.push(p)}if(a instanceof e){let t={...n.dropShadow},r={...i.dropShadow};(t.enabled||r.enabled)&&(A.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&&A.push(h),f=ge("blurRadius",a.dropShadow,t,r,o),f&&A.push(f),m=ge("spread",a.dropShadow,t,r,o),m&&A.push(m),g=we("offset",a.dropShadow,t,r,o),g&&A.push(g)}if(a instanceof e){let t={...n.innerShadow},r={...i.innerShadow};(t.enabled||r.enabled)&&(A.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&&A.push(b),y=ge("blurRadius",a.innerShadow,t,r,o),y&&A.push(y),w=ge("spread",a.innerShadow,t,r,o),w&&A.push(w),v=we("offset",a.innerShadow,t,r,o),v&&A.push(v)}if(a instanceof e||a instanceof r){let t={...n.backgroundBlur},r={...i.backgroundBlur};(t.enabled||r.enabled)&&(A.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&&A.push(S)}if(a instanceof e){let t={...n.layerBlur},r={...i.layerBlur};(t.enabled||r.enabled)&&(A.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&&A.push(j)}if(a instanceof r||a instanceof t){let e=me("cornerRadius",a,n,i,o);e&&A.push(e)}return A}(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 D.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 R.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 k.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 x.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(N.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,C),r?{width:r[0],height:r[1],depth:r[2]}:{},y(s,C)),C.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 B.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(...De(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(...De(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 W).setRGB(i.r,i.g,i.b):o.clone(),u="string"==typeof s?n.getColor(s).clone():(new W).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 Pe={type:"beginState"};function Ne(e){if(5===e.easing){let{control1:t,control2:r}=e;return{easing:5,control1:t??V.defaultData.control1,control2:r??V.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 Ie={type:"completeState",isfromEntity:!1};function Fe(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 qe=class{constructor(e,t,r,a,n,i,s,o={}){var l;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.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,{},this.end.data,{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:(l=a).duration,ease:Ne(l),...Ge(l)},this.onChange,this.buildCallback),this.rebind()}rebind(){let{fromRef:e,toRef:t}=this;if(void 0===e){let e=Fe(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=Fe(this.object,e);if(!t)throw new Error("Missing property");this.from=t}if(void 0===t)throw new Error("Missing property");let r=Fe(this.object,t);if(!r)throw new Error("Missing property");this.to=r,this.buildCallback()}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?Ie:Pe)}),t?this.hooks.onComplete?.(r):this.hooks.onBegin?.(r))}};export{oe as a,ue as b,Ve as c,Oe as d,Be as e,Re as f,Pe as g,Ne as h,Ge as i,Ie as j,Fe as k,qe as l};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as e,d as r}from"./runtime-chunk-DSCGKWZ5.js";import{f as i}from"./runtime-chunk-RTLL6WIB.js";import{J as a,xa as o}from"./runtime-chunk-WKTS4T2Q.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,W=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=W.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=W.projectionTransitionsEnabled;W.projectionTransitionsEnabled=!1;try{return t()}finally{W.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 W.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=W.projectionTransitionMinAgeMs}_beginProjectionTransition(t){let e=this._projectionTransition;void 0===e&&(e={from:new h,blend:new h,blendInverse:new h,start:0,duration:W.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:t},this._projectionTransition=e),e.from.copy(this.projectionMatrix),e.start=performance.now(),e.duration=W.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=W;A.projectionTransitionsEnabled=!1,A.projectionTransitionDuration=350,A.projectionTransitionMinAgeMs=1e3;export{A as a};
|
|
1
|
+
import{a as t,b as e,d as r}from"./runtime-chunk-ALC6ISFF.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};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-
|
|
1
|
+
import{a as t}from"./runtime-chunk-YJTOFWUO.js";import{e}from"./runtime-chunk-QU4YWWPM.js";import{c as i}from"./runtime-chunk-AAJG7OQA.js";import{i as r}from"./runtime-chunk-ABVRWCND.js";import{j as s}from"./runtime-chunk-2PT2WH66.js";import{Fc as n,Ne as o,dd as a,ud as h,vd as c}from"./runtime-chunk-BVVSZMXD.js";var d=class extends o{constructor(){super(),i(this.layers)}setFromCamera(t,e){e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):e.isPerspectiveCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(t,e=!0,i=[]){return t.forEach(t=>{t.visible&&this.intersectObject(t,e,i)}),i}createRaycastLineHelper(){let t=new h({color:65280,linewidth:10}),e=new n(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),i=new n(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),r=this.camera.far-this.camera.near,s=(new n).addVectors(e,i.multiplyScalar(r)),o=new a;return o.setFromPoints([e,s]),new c(o,t)}},u=e=>e instanceof t||s(e);function l(t,e){return t.distance-e.distance}function m(t,i,s){if(r(i)&&i.visible){e(i)&&i.raycast(t,s);for(let e of i.children)m(t,e,s)}}function f(t,e,i,r=!1){if(!r&&!i.some(e=>void 0!==w(t,e)))return[];let s=[];return e.children.forEach(e=>m(t,e,s)),s.sort(l),s}function p(t){let e=[];if(t.length){let i=t[0].object;r(i)&&e.push(i);let s=i.parent;for(;s;)u(s)&&e.push(s),s=s.parent}return e}function y(t,e,i,r){let s=t.frame;if(s){let t=e[0]*s.width,n=(1-e[1])*s.height;for(let e of i){let i=e===s.uuid?s:s.find(e);if(i?.intersects(t,n))return r(i),!0}}return!1}function w(t,i){if(e(i)){if(i.visible){let e=[];return i.raycast(t,e),e.length?e[0]:void 0}}else if(u(i))return g(t,i)}function g(t,i){if(r(i)&&i.visible){if(e(i)){let e=[];if(i.raycast(t,e),e.length)return e[0]}for(let e of i.children){let i=g(t,e);if(i)return i}}}var v=class{constructor(t,e,i,r,s,n,o,a){this.renderer=t,this.publish=e,this.scene=i,this.getCamera=r,this.sharedAssets=s,this.requestRender=n,this.isExport=o,this.frame=a,this.raycaster=new d,this._useWindowEvents=!1,this.pointerWorld={x:0,y:0},this.pointerScreen={x:0,y:0},this._useWindowEvents="window"===e.mouseEventTarget,this.domElement=t.domElement,this.eventElement=this._useWindowEvents?window:t.domElement,this._domRect=this.domElement.getBoundingClientRect()}get stopRaycast(){return this.publish.stopRaycast}get page(){return this.scene.activePage}set useWindowEvents(t){this._useWindowEvents=t,this.eventElement=t?window:this.renderer.domElement}get useWindowEvents(){return this._useWindowEvents}set domRect(t){this._domRect=t}get domRect(){return this._domRect}updateRaycaster(t){let{pageX:e,pageY:i}=t.touches?.length>0?t.touches[0]:t;this.pointerWorld=function(t,e,i){return{x:(t-(i.left+window.scrollX))/i.width*2-1,y:-(e-(i.top+window.scrollY))/i.height*2+1}}(e,i,this._domRect),this.pointerScreen=function(t,e,i){return{x:(t-(i.left+window.scrollX))/i.width,y:1-(e-(i.top+window.scrollY))/i.height}}(e,i,this._domRect),this.raycaster.setFromCamera(this.pointerWorld,this.getCamera())}dispose(){this.scene=void 0,this.sharedAssets=void 0,this.publish=void 0,this.getCamera=void 0,this.requestRender=void 0,this.frame=void 0,this.isExport=void 0}};export{f as a,p as b,y as c,w as d,v as e};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bc as e,Cc as a,uc as n}from"./runtime-chunk-GNCRONVM.js";import{Dc as t,Fc as r,Ic as s,Jc as i,Oc as o,nd as l,qa as d}from"./runtime-chunk-BVVSZMXD.js";var c=8,u=new s,p=(()=>{let e=new l(new Uint8Array([0,0,0,255]),1,1);return e.minFilter=d,e.magFilter=d,e.needsUpdate=!0,e})(),w=(()=>{let e=new l(new Uint8Array([0,0,0,255]),1,1);return e.minFilter=d,e.magFilter=d,e.needsUpdate=!0,e})(),m=(()=>{let e=new l(new Uint8Array([255,255,255,255]),1,1);return e.minFilter=d,e.magFilter=d,e.needsUpdate=!0,e})(),g=(()=>{let e=new l(new Uint8Array([0,0,0,0]),1,1);return e.minFilter=d,e.magFilter=d,e.needsUpdate=!0,e})();function h(){try{return"0"!==new URLSearchParams(window.location.search).get("dbgsrgb8")}catch{return!0}}function R(){try{return"0"!==new URLSearchParams(window.location.search).get("dbgoutguard")}catch{return!0}}var f={chainBuilds:0,lastChainBuildReason:"",taaResolves:0,taaJitterIndex:0,taaJitterApplies:0,taaHistoryValid:!1,taaResolveSize:"",helperOverlayMode:"",transparentDepthMaterials:0,deviceLost:"",outputInterpositions:0,bundleChecks:0,bundleRebuilds:0,bundleDisabled:!1,bundleResourceRebuilds:0,bundleIncompleteRecords:0,bundleRecords:0,bundleReplays:0,instancingGroups:0,instancedDrawsSaved:0,instancingRegroups:0,instancingParks:0,instancingIneligible:{},skippedAsyncDraws:0,stalledSkipFrames:0,compilationBurst:!1,pcssLights:0,pcssInstalled:0,pcssForeignFilter:0,pcssPyramidBuilds:0,pcssPyramidActive:0,shadowMaskResolves:0,shadowMaskActive:0,pcssHookServes:0,pcssRadius0:0,pcssPenumbra0:0,nodeResurrections:0,shadowTypeSoft:!0};typeof window<"u"&&(window.__SPLINE_WEBGPU_STATS=f);var b={resolution:e(new t(1,1)),pixelRatio:e(1),frameIndex:e(0),alphaDiscardCutoff:e(0),aspectRatio:e(new t(1,1)),transmissionRenderTarget:n(u),normalRenderTarget:n(u),normalRenderTargetDepth:n(u),normalViewRenderTarget:n(u),aoRenderTarget:n(u),reflectionRenderTarget:n(p),reflectionDepthPyramid:n(p),reflectionDepthSize:e(new t(1,1)),reflectionDepthLevels:e(1,"int"),reflectionEnvMap:n(p),reflectionEnvEnabled:e(0),reflectionPlanarTarget:n(p),reflectionPlanarEnabled:e(0),reflectionMissColor:e(new r(0,0,0)),reflectionResolveTarget:n(w),reflectionResolveEnabled:e(0),shadowMaskTexture:n(m),shadowMaskGBuffer:n(g),shadowMaskEnabled:e(0),shadowMaskResolution:e(new t(1,1)),shadowMaskFullResolution:e(new t(1,1)),transmissionSamplerSize:e(new t(2048,2048)),transmissionActualSize:e(new t(1,1)),orthographicUniform:e(0),unjitteredProjection:e(new o),aoEnabledUniform:e(0),pcssHalton:e(new t(0,-.333334)),tapAngle:e(0),tapAngle2:e(0),cameraJitterPx:e(new t(0,0)),toonLightData:a(Array.from({length:8},()=>new i),"vec4"),toonLightCount:e(0,"int"),taaEnabled:{value:!1},aoEnabled:{value:!1},transmissionLod:{value:2}};export{c as a,u as b,p as c,w as d,h as e,R as f,f as g,b as h};
|
|
Binary file
|
|
Binary file
|