@needle-tools/engine 4.14.0-next.31f837e → 4.14.0-next.52fdb13
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/CHANGELOG.md +9 -0
- package/components.needle.json +1 -1
- package/dist/{generateMeshBVH.worker-DFcS3P04.js → generateMeshBVH.worker-DiCnZlf3.js} +1 -1
- package/dist/{gltf-progressive-8voIgNp_.js → gltf-progressive-Bm_6aEi4.js} +4 -4
- package/dist/{gltf-progressive-BRRBj-nY.umd.cjs → gltf-progressive-BttGBXw6.umd.cjs} +3 -3
- package/dist/{gltf-progressive-Dkh3tG4-.min.js → gltf-progressive-T5WKTux5.min.js} +1 -1
- package/dist/{loader.worker-C6cXDgR1.js → loader.worker-BqODMeeW.js} +1 -1
- package/dist/{materialx-Dx8st96L.min.js → materialx-CJyQZtjt.min.js} +1 -1
- package/dist/{materialx-D66rYPqe.js → materialx-DMs1E08Z.js} +2 -2
- package/dist/{materialx-CxlgposR.umd.cjs → materialx-DaKKOoVk.umd.cjs} +1 -1
- package/dist/{needle-engine.bundle-D7w0XD7M.min.js → needle-engine.bundle-BwfaInTa.min.js} +156 -148
- package/dist/{needle-engine.bundle-BQXG5qbQ.umd.cjs → needle-engine.bundle-DJE-Bjpa.umd.cjs} +141 -133
- package/dist/{needle-engine.bundle-Byl5i6zJ.js → needle-engine.bundle-TmE5-_na.js} +6741 -6449
- package/dist/needle-engine.d.ts +896 -51
- package/dist/needle-engine.js +571 -570
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-Ce5-UWiA.min.js → postprocessing-06AXuvdv.min.js} +2 -2
- package/dist/{postprocessing-BkSpxpYB.js → postprocessing-CI2x8Cln.js} +4 -4
- package/dist/{postprocessing-DFVElmAh.umd.cjs → postprocessing-CPDcA21P.umd.cjs} +2 -2
- package/dist/{three-Bad8p1pf.umd.cjs → three-BjYim-vL.umd.cjs} +47 -47
- package/dist/{three-DFV1-P9z.js → three-Bvk2VKbF.js} +2 -2
- package/dist/{three-CWn13_u1.min.js → three-IG2qPafA.min.js} +2 -2
- package/dist/{three-examples-CO-tx3Sp.umd.cjs → three-examples-BMmNgNCN.umd.cjs} +1 -1
- package/dist/{three-examples-43yqn3mL.js → three-examples-CMYCd5nH.js} +1 -1
- package/dist/{three-examples-DKuJVGT4.min.js → three-examples-CQl1fFZp.min.js} +1 -1
- package/dist/{three-mesh-ui-DyEA5HQF.min.js → three-mesh-ui-5HVE2RV-.min.js} +1 -1
- package/dist/{three-mesh-ui-fSAQJxdI.js → three-mesh-ui-BlakAItG.js} +1 -1
- package/dist/{three-mesh-ui-ChzVOraf.umd.cjs → three-mesh-ui-D828VbQp.umd.cjs} +1 -1
- package/dist/{vendor-pe19S9r5.min.js → vendor-BxK0WKmT.min.js} +1 -1
- package/dist/{vendor-B51YffMU.umd.cjs → vendor-CIDkyBaO.umd.cjs} +1 -1
- package/dist/{vendor-CgpZ5ivC.js → vendor-ixwD-vv2.js} +1 -1
- package/lib/engine/api.d.ts +203 -18
- package/lib/engine/api.js +271 -18
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_accessibility.d.ts +58 -0
- package/lib/engine/engine_accessibility.js +143 -0
- package/lib/engine/engine_accessibility.js.map +1 -0
- package/lib/engine/engine_context.d.ts +2 -0
- package/lib/engine/engine_context.js +7 -0
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_materialpropertyblock.d.ts +309 -11
- package/lib/engine/engine_materialpropertyblock.js +396 -36
- package/lib/engine/engine_materialpropertyblock.js.map +1 -1
- package/lib/engine/engine_math.d.ts +34 -1
- package/lib/engine/engine_math.js +34 -1
- package/lib/engine/engine_math.js.map +1 -1
- package/lib/engine/engine_networking.js +1 -1
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_types.d.ts +2 -0
- package/lib/engine/engine_types.js +2 -0
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine/webcomponents/icons.js +3 -0
- package/lib/engine/webcomponents/icons.js.map +1 -1
- package/lib/engine/webcomponents/logo-element.d.ts +1 -0
- package/lib/engine/webcomponents/logo-element.js +3 -1
- package/lib/engine/webcomponents/logo-element.js.map +1 -1
- package/lib/engine/webcomponents/needle-button.d.ts +37 -11
- package/lib/engine/webcomponents/needle-button.js +42 -11
- package/lib/engine/webcomponents/needle-button.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +10 -2
- package/lib/engine/webcomponents/needle-engine.js +13 -3
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/Component.d.ts +1 -2
- package/lib/engine-components/Component.js +1 -2
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +1 -0
- package/lib/engine-components/DragControls.js +21 -0
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Duplicatable.js.map +1 -1
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/NeedleMenu.d.ts +2 -0
- package/lib/engine-components/NeedleMenu.js +2 -0
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/Networking.d.ts +28 -3
- package/lib/engine-components/Networking.js +28 -3
- package/lib/engine-components/Networking.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +33 -3
- package/lib/engine-components/ReflectionProbe.js +76 -27
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/Renderer.d.ts +2 -0
- package/lib/engine-components/Renderer.js +30 -6
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/RendererLightmap.js +2 -3
- package/lib/engine-components/RendererLightmap.js.map +1 -1
- package/lib/engine-components/SeeThrough.d.ts +0 -2
- package/lib/engine-components/SeeThrough.js +114 -88
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/SmoothFollow.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.d.ts +107 -13
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +167 -30
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/ui/Button.d.ts +1 -0
- package/lib/engine-components/ui/Button.js +11 -0
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Raycaster.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +1 -0
- package/lib/engine-components/ui/Text.js +11 -0
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/web/ViewBox.d.ts +2 -2
- package/lib/engine-components/web/ViewBox.js +2 -2
- package/lib/engine-components/web/ViewBox.js.map +1 -1
- package/lib/engine-components/webxr/WebXRPlaneTracking.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerMovement.js.map +1 -1
- package/package.json +4 -4
- package/src/engine/api.ts +371 -19
- package/src/engine/engine_accessibility.ts +178 -0
- package/src/engine/engine_context.ts +9 -0
- package/src/engine/engine_materialpropertyblock.ts +499 -42
- package/src/engine/engine_math.ts +34 -1
- package/src/engine/engine_networking.ts +1 -1
- package/src/engine/engine_types.ts +5 -0
- package/src/engine/webcomponents/icons.ts +3 -0
- package/src/engine/webcomponents/logo-element.ts +4 -1
- package/src/engine/webcomponents/needle-button.ts +44 -13
- package/src/engine/webcomponents/needle-engine.ts +18 -7
- package/src/engine-components/Camera.ts +2 -2
- package/src/engine-components/Component.ts +1 -3
- package/src/engine-components/DragControls.ts +29 -4
- package/src/engine-components/DropListener.ts +1 -1
- package/src/engine-components/Duplicatable.ts +1 -1
- package/src/engine-components/GroundProjection.ts +3 -0
- package/src/engine-components/NeedleMenu.ts +8 -3
- package/src/engine-components/NestedGltf.ts +1 -1
- package/src/engine-components/Networking.ts +29 -4
- package/src/engine-components/ReflectionProbe.ts +81 -31
- package/src/engine-components/Renderer.ts +34 -6
- package/src/engine-components/RendererLightmap.ts +2 -3
- package/src/engine-components/SeeThrough.ts +122 -107
- package/src/engine-components/SmoothFollow.ts +2 -2
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +198 -65
- package/src/engine-components/ui/Button.ts +13 -1
- package/src/engine-components/ui/Raycaster.ts +1 -1
- package/src/engine-components/ui/Text.ts +13 -0
- package/src/engine-components/web/ViewBox.ts +9 -2
- package/src/engine-components/webxr/WebXRPlaneTracking.ts +3 -3
- package/src/engine-components/webxr/controllers/XRControllerFollow.ts +1 -1
- package/src/engine-components/webxr/controllers/XRControllerMovement.ts +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";var CA=(function(){var A="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(t)?e:A,n,r=WebAssembly.instantiate(o(i),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var E=new Uint8Array(m.length),C=0;C<m.length;++C){var y=m.charCodeAt(C);E[C]=y>96?y-97:y>64?y-39:y+4}for(var Q=0,C=0;C<m.length;++C)E[Q++]=E[C]<60?s[E[C]]:(E[C]-60)*64+E[++C];return E.buffer.slice(0,Q)}function a(m,E,C,y,Q,M){var S=n.exports.sbrk,R=C+3&-4,D=S(R*y),O=S(Q.length),H=new Uint8Array(n.exports.memory.buffer);H.set(Q,O);var ae=m(D,C,y,O,Q.length);if(ae==0&&M&&M(D,R,y),E.set(H.subarray(D,D+C*y)),S(D-S(0)),ae!=0)throw new Error("Malformed buffer data: "+ae)}var h={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},l=[],u=0;function d(m){var E={object:new Worker(m),pending:0,requests:{}};return E.object.onmessage=function(C){var y=C.data;E.pending-=y.count,E.requests[y.id][y.action](y.value),delete E.requests[y.id]},E}function g(m){for(var E="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+a.toString()+f.toString(),C=new Blob([E],{type:"text/javascript"}),y=URL.createObjectURL(C),Q=0;Q<m;++Q)l[Q]=d(y);URL.revokeObjectURL(y)}function p(m,E,C,y,Q){for(var M=l[0],S=1;S<l.length;++S)l[S].pending<M.pending&&(M=l[S]);return new Promise(function(R,D){var O=new Uint8Array(C),H=u++;M.pending+=m,M.requests[H]={resolve:R,reject:D},M.object.postMessage({id:H,count:m,size:E,source:O,mode:y,filter:Q},[O.buffer])})}function f(m){r.then(function(){var E=m.data;try{var C=new Uint8Array(E.count*E.size);a(n.exports[E.mode],C,E.count,E.size,E.source,n.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:C},[C.buffer])}catch(y){self.postMessage({id:E.id,count:E.count,action:"reject",value:y})}})}return{ready:r,supported:!0,useWorkers:function(m){g(m)},decodeVertexBuffer:function(m,E,C,y,Q){a(n.exports.meshopt_decodeVertexBuffer,m,E,C,y,n.exports[h[Q]])},decodeIndexBuffer:function(m,E,C,y){a(n.exports.meshopt_decodeIndexBuffer,m,E,C,y)},decodeIndexSequence:function(m,E,C,y){a(n.exports.meshopt_decodeIndexSequence,m,E,C,y)},decodeGltfBuffer:function(m,E,C,y,Q,M){a(n.exports[c[Q]],m,E,C,y,n.exports[h[M]])},decodeGltfBufferAsync:function(m,E,C,y,Q){return l.length>0?p(m,E,C,c[y],h[Q]):r.then(function(){var M=new Uint8Array(m*E);return a(n.exports[c[y]],M,m,E,C,n.exports[h[Q]]),M})}}})();const Ys="169.17",Xs=0,Dr=1,BA=2,_r=1,kr=100,Lr=204,vr=205,Gr=3,xA=0,Zi=0,Or="attached",QA="detached",Ur=300,zr=301,wA=302,fs=1e3,Ct=1001,$i=1002,Me=1003,Pr=1004,TA=1005,At=1006,SA=1007,Lt=1008,xe=1009,MA=1013,Hr=1014,ht=1015,Bt=1016,NA=1020,qr=35902,Vr=35899,en=1022,ct=1023,tn=1026,jr=1027,vt=1028,ms=1030,Jr=33776,sn=33777,Wr=33778,nn=33779,RA=35840,FA=35842,DA=36196,Kr=37492,Yr=37496,Zs=37808,Xr=37812,rn=36492,_A=36495,Is=2300,bs=2301,on=2302,Zr=2400,$r=2401,eo=2402,kA=2500,LA=0,to=1,an=2,An=0,vA=1,Gt="",ne="srgb",ge="srgb-linear",GA="display-p3",so="display-p3-linear",hn="linear",io="srgb",no="rec709",ro="p3",Ot=7680,oo=519,$s=35044,lt=2e3,ei=2001;class Ut{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let n=0,r=i.length;n<r;n++)i[n].call(this,e);e.target=null}}}const he=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let ao=1234567;const ys=Math.PI/180,Es=180/Math.PI;function Ne(){const A=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(he[A&255]+he[A>>8&255]+he[A>>16&255]+he[A>>24&255]+"-"+he[e&255]+he[e>>8&255]+"-"+he[e>>16&15|64]+he[e>>24&255]+"-"+he[t&63|128]+he[t>>8&255]+"-"+he[t>>16&255]+he[t>>24&255]+he[s&255]+he[s>>8&255]+he[s>>16&255]+he[s>>24&255]).toLowerCase()}function ce(A,e,t){return Math.max(e,Math.min(t,A))}function cn(A,e){return(A%e+e)%e}function OA(A,e,t,s,i){return s+(A-e)*(i-s)/(t-e)}function UA(A,e,t){return A!==e?(t-A)/(e-A):0}function Cs(A,e,t){return(1-t)*A+t*e}function zA(A,e,t,s){return Cs(A,e,1-Math.exp(-t*s))}function PA(A,e=1){return e-Math.abs(cn(A,e*2)-e)}function HA(A,e,t){return A<=e?0:A>=t?1:(A=(A-e)/(t-e),A*A*(3-2*A))}function qA(A,e,t){return A<=e?0:A>=t?1:(A=(A-e)/(t-e),A*A*A*(A*(A*6-15)+10))}function VA(A,e){return A+Math.floor(Math.random()*(e-A+1))}function jA(A,e){return A+Math.random()*(e-A)}function JA(A){return A*(.5-Math.random())}function WA(A){A!==void 0&&(ao=A);let e=ao+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function KA(A){return A*ys}function YA(A){return A*Es}function XA(A){return(A&A-1)===0&&A!==0}function ZA(A){return Math.pow(2,Math.ceil(Math.log(A)/Math.LN2))}function $A(A){return Math.pow(2,Math.floor(Math.log(A)/Math.LN2))}function eh(A,e,t,s,i){const n=Math.cos,r=Math.sin,o=n(t/2),a=r(t/2),h=n((e+s)/2),c=r((e+s)/2),l=n((e-s)/2),u=r((e-s)/2),d=n((s-e)/2),g=r((s-e)/2);switch(i){case"XYX":A.set(o*c,a*l,a*u,o*h);break;case"YZY":A.set(a*u,o*c,a*l,o*h);break;case"ZXZ":A.set(a*l,a*u,o*c,o*h);break;case"XZX":A.set(o*c,a*g,a*d,o*h);break;case"YXY":A.set(a*d,o*c,a*g,o*h);break;case"ZYZ":A.set(a*g,a*d,o*c,o*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Re(A,e){switch(e.constructor){case Float32Array:return A;case Uint32Array:return A/4294967295;case Uint16Array:return A/65535;case Uint8Array:return A/255;case Int32Array:return Math.max(A/2147483647,-1);case Int16Array:return Math.max(A/32767,-1);case Int8Array:return Math.max(A/127,-1);default:throw new Error("Invalid component type.")}}function z(A,e){switch(e.constructor){case Float32Array:return A;case Uint32Array:return Math.round(A*4294967295);case Uint16Array:return Math.round(A*65535);case Uint8Array:return Math.round(A*255);case Int32Array:return Math.round(A*2147483647);case Int16Array:return Math.round(A*32767);case Int8Array:return Math.round(A*127);default:throw new Error("Invalid component type.")}}const Ao={DEG2RAD:ys,RAD2DEG:Es,generateUUID:Ne,clamp:ce,euclideanModulo:cn,mapLinear:OA,inverseLerp:UA,lerp:Cs,damp:zA,pingpong:PA,smoothstep:HA,smootherstep:qA,randInt:VA,randFloat:jA,randFloatSpread:JA,seededRandom:WA,degToRad:KA,radToDeg:YA,isPowerOfTwo:XA,ceilPowerOfTwo:ZA,floorPowerOfTwo:$A,setQuaternionFromProperEuler:eh,normalize:z,denormalize:Re};class q{constructor(e=0,t=0){q.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,s=this.y,i=e.elements;return this.x=i[0]*t+i[3]*s+i[6],this.y=i[1]*t+i[4]*s+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(ce(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const s=Math.cos(t),i=Math.sin(t),n=this.x-e.x,r=this.y-e.y;return this.x=n*s-r*i+e.x,this.y=n*i+r*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Fe{constructor(e,t,s,i,n,r,o,a,h){Fe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,s,i,n,r,o,a,h)}set(e,t,s,i,n,r,o,a,h){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=n,c[5]=a,c[6]=s,c[7]=r,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}extractBasis(e,t,s){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,n=this.elements,r=s[0],o=s[3],a=s[6],h=s[1],c=s[4],l=s[7],u=s[2],d=s[5],g=s[8],p=i[0],f=i[3],m=i[6],E=i[1],C=i[4],y=i[7],Q=i[2],M=i[5],S=i[8];return n[0]=r*p+o*E+a*Q,n[3]=r*f+o*C+a*M,n[6]=r*m+o*y+a*S,n[1]=h*p+c*E+l*Q,n[4]=h*f+c*C+l*M,n[7]=h*m+c*y+l*S,n[2]=u*p+d*E+g*Q,n[5]=u*f+d*C+g*M,n[8]=u*m+d*y+g*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8];return t*r*c-t*o*h-s*n*c+s*o*a+i*n*h-i*r*a}invert(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8],l=c*r-o*h,u=o*a-c*n,d=h*n-r*a,g=t*l+s*u+i*d;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const p=1/g;return e[0]=l*p,e[1]=(i*h-c*s)*p,e[2]=(o*s-i*r)*p,e[3]=u*p,e[4]=(c*t-i*a)*p,e[5]=(i*n-o*t)*p,e[6]=d*p,e[7]=(s*a-h*t)*p,e[8]=(r*t-s*n)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,s,i,n,r,o){const a=Math.cos(n),h=Math.sin(n);return this.set(s*a,s*h,-s*(a*r+h*o)+r+e,-i*h,i*a,-i*(-h*r+a*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(ln.makeScale(e,t)),this}rotate(e){return this.premultiply(ln.makeRotation(-e)),this}translate(e,t){return this.premultiply(ln.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,s=e.elements;for(let i=0;i<9;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const ln=new Fe;function th(A){for(let e=A.length-1;e>=0;--e)if(A[e]>=65535)return!0;return!1}function un(A){return document.createElementNS("http://www.w3.org/1999/xhtml",A)}const ho=new Fe().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),co=new Fe().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Bs={[ge]:{transfer:hn,primaries:no,luminanceCoefficients:[.2126,.7152,.0722],toReference:A=>A,fromReference:A=>A},[ne]:{transfer:io,primaries:no,luminanceCoefficients:[.2126,.7152,.0722],toReference:A=>A.convertSRGBToLinear(),fromReference:A=>A.convertLinearToSRGB()},[so]:{transfer:hn,primaries:ro,luminanceCoefficients:[.2289,.6917,.0793],toReference:A=>A.applyMatrix3(co),fromReference:A=>A.applyMatrix3(ho)},[GA]:{transfer:io,primaries:ro,luminanceCoefficients:[.2289,.6917,.0793],toReference:A=>A.convertSRGBToLinear().applyMatrix3(co),fromReference:A=>A.applyMatrix3(ho).convertLinearToSRGB()}},sh=new Set([ge,so]),le={enabled:!0,_workingColorSpace:ge,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(A){if(!sh.has(A))throw new Error(`Unsupported working color space, "${A}".`);this._workingColorSpace=A},convert:function(A,e,t){if(this.enabled===!1||e===t||!e||!t)return A;const s=Bs[e].toReference,i=Bs[t].fromReference;return i(s(A))},fromWorkingColorSpace:function(A,e){return this.convert(A,this._workingColorSpace,e)},toWorkingColorSpace:function(A,e){return this.convert(A,e,this._workingColorSpace)},getPrimaries:function(A){return Bs[A].primaries},getTransfer:function(A){return A===Gt?hn:Bs[A].transfer},getLuminanceCoefficients:function(A,e=this._workingColorSpace){return A.fromArray(Bs[e].luminanceCoefficients)}};function zt(A){return A<.04045?A*.0773993808:Math.pow(A*.9478672986+.0521327014,2.4)}function dn(A){return A<.0031308?A*12.92:1.055*Math.pow(A,.41666)-.055}let Pt;class ih{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Pt===void 0&&(Pt=un("canvas")),Pt.width=e.width,Pt.height=e.height;const s=Pt.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),t=Pt}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=un("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const i=s.getImageData(0,0,e.width,e.height),n=i.data;for(let r=0;r<n.length;r++)n[r]=zt(n[r]/255)*255;return s.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let s=0;s<t.length;s++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[s]=Math.floor(zt(t[s]/255)*255):t[s]=zt(t[s]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let nh=0;class lo{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:nh++}),this.uuid=Ne(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const s={uuid:this.uuid,url:""},i=this.data;if(i!==null){let n;if(Array.isArray(i)){n=[];for(let r=0,o=i.length;r<o;r++)i[r].isDataTexture?n.push(gn(i[r].image)):n.push(gn(i[r]))}else n=gn(i);s.url=n}return t||(e.images[this.uuid]=s),s}}function gn(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap?ih.getDataURL(A):A.data?{data:Array.from(A.data),width:A.width,height:A.height,type:A.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let rh=0;class ue extends Ut{constructor(e=ue.DEFAULT_IMAGE,t=ue.DEFAULT_MAPPING,s=Ct,i=Ct,n=At,r=Lt,o=ct,a=xe,h=ue.DEFAULT_ANISOTROPY,c=Gt){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:rh++}),this.uuid=Ne(),this.name="",this.source=new lo(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=s,this.wrapT=i,this.magFilter=n,this.minFilter=r,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=a,this.offset=new q(0,0),this.repeat=new q(1,1),this.center=new q(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Fe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const s={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(s.userData=this.userData),t||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ur)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case fs:e.x=e.x-Math.floor(e.x);break;case Ct:e.x=e.x<0?0:1;break;case $i:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case fs:e.y=e.y-Math.floor(e.y);break;case Ct:e.y=e.y<0?0:1;break;case $i:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}ue.DEFAULT_IMAGE=null,ue.DEFAULT_MAPPING=Ur,ue.DEFAULT_ANISOTROPY=4;class K{constructor(e=0,t=0,s=0,i=1){K.prototype.isVector4=!0,this.x=e,this.y=t,this.z=s,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,s,i){return this.x=e,this.y=t,this.z=s,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,n=this.w,r=e.elements;return this.x=r[0]*t+r[4]*s+r[8]*i+r[12]*n,this.y=r[1]*t+r[5]*s+r[9]*i+r[13]*n,this.z=r[2]*t+r[6]*s+r[10]*i+r[14]*n,this.w=r[3]*t+r[7]*s+r[11]*i+r[15]*n,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,s,i,n;const a=e.elements,h=a[0],c=a[4],l=a[8],u=a[1],d=a[5],g=a[9],p=a[2],f=a[6],m=a[10];if(Math.abs(c-u)<.01&&Math.abs(l-p)<.01&&Math.abs(g-f)<.01){if(Math.abs(c+u)<.1&&Math.abs(l+p)<.1&&Math.abs(g+f)<.1&&Math.abs(h+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const C=(h+1)/2,y=(d+1)/2,Q=(m+1)/2,M=(c+u)/4,S=(l+p)/4,R=(g+f)/4;return C>y&&C>Q?C<.01?(s=0,i=.707106781,n=.707106781):(s=Math.sqrt(C),i=M/s,n=S/s):y>Q?y<.01?(s=.707106781,i=0,n=.707106781):(i=Math.sqrt(y),s=M/i,n=R/i):Q<.01?(s=.707106781,i=.707106781,n=0):(n=Math.sqrt(Q),s=S/n,i=R/n),this.set(s,i,n,t),this}let E=Math.sqrt((f-g)*(f-g)+(l-p)*(l-p)+(u-c)*(u-c));return Math.abs(E)<.001&&(E=1),this.x=(f-g)/E,this.y=(l-p)/E,this.z=(u-c)/E,this.w=Math.acos((h+d+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this.w=e.w+(t.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class uo extends Ut{constructor(e=1,t=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new K(0,0,e,t),this.scissorTest=!1,this.viewport=new K(0,0,e,t);const i={width:e,height:t,depth:1};s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:At,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},s);const n=new ue(i,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace);n.flipY=!1,n.generateMipmaps=s.generateMipmaps,n.internalFormat=s.internalFormat,this.textures=[];const r=s.count;for(let o=0;o<r;o++)this.textures[o]=n.clone(),this.textures[o].isRenderTargetTexture=!0;this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this.depthTexture=s.depthTexture,this.samples=s.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,s=1){if(this.width!==e||this.height!==t||this.depth!==s){this.width=e,this.height=t,this.depth=s;for(let i=0,n=this.textures.length;i<n;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=s;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let s=0,i=e.textures.length;s<i;s++)this.textures[s]=e.textures[s].clone(),this.textures[s].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new lo(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class oh extends ue{constructor(e=null,t=1,s=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:s,depth:i},this.magFilter=Me,this.minFilter=Me,this.wrapR=Ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ke{constructor(e=0,t=0,s=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=s,this._w=i}static slerpFlat(e,t,s,i,n,r,o){let a=s[i+0],h=s[i+1],c=s[i+2],l=s[i+3];const u=n[r+0],d=n[r+1],g=n[r+2],p=n[r+3];if(o===0){e[t+0]=a,e[t+1]=h,e[t+2]=c,e[t+3]=l;return}if(o===1){e[t+0]=u,e[t+1]=d,e[t+2]=g,e[t+3]=p;return}if(l!==p||a!==u||h!==d||c!==g){let f=1-o;const m=a*u+h*d+c*g+l*p,E=m>=0?1:-1,C=1-m*m;if(C>Number.EPSILON){const Q=Math.sqrt(C),M=Math.atan2(Q,m*E);f=Math.sin(f*M)/Q,o=Math.sin(o*M)/Q}const y=o*E;if(a=a*f+u*y,h=h*f+d*y,c=c*f+g*y,l=l*f+p*y,f===1-o){const Q=1/Math.sqrt(a*a+h*h+c*c+l*l);a*=Q,h*=Q,c*=Q,l*=Q}}e[t]=a,e[t+1]=h,e[t+2]=c,e[t+3]=l}static multiplyQuaternionsFlat(e,t,s,i,n,r){const o=s[i],a=s[i+1],h=s[i+2],c=s[i+3],l=n[r],u=n[r+1],d=n[r+2],g=n[r+3];return e[t]=o*g+c*l+a*d-h*u,e[t+1]=a*g+c*u+h*l-o*d,e[t+2]=h*g+c*d+o*u-a*l,e[t+3]=c*g-o*l-a*u-h*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,s,i){return this._x=e,this._y=t,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const s=e._x,i=e._y,n=e._z,r=e._order,o=Math.cos,a=Math.sin,h=o(s/2),c=o(i/2),l=o(n/2),u=a(s/2),d=a(i/2),g=a(n/2);switch(r){case"XYZ":this._x=u*c*l+h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l-u*d*g;break;case"YXZ":this._x=u*c*l+h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l+u*d*g;break;case"ZXY":this._x=u*c*l-h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l-u*d*g;break;case"ZYX":this._x=u*c*l-h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l+u*d*g;break;case"YZX":this._x=u*c*l+h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l-u*d*g;break;case"XZY":this._x=u*c*l-h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l+u*d*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const s=t/2,i=Math.sin(s);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,s=t[0],i=t[4],n=t[8],r=t[1],o=t[5],a=t[9],h=t[2],c=t[6],l=t[10],u=s+o+l;if(u>0){const d=.5/Math.sqrt(u+1);this._w=.25/d,this._x=(c-a)*d,this._y=(n-h)*d,this._z=(r-i)*d}else if(s>o&&s>l){const d=2*Math.sqrt(1+s-o-l);this._w=(c-a)/d,this._x=.25*d,this._y=(i+r)/d,this._z=(n+h)/d}else if(o>l){const d=2*Math.sqrt(1+o-s-l);this._w=(n-h)/d,this._x=(i+r)/d,this._y=.25*d,this._z=(a+c)/d}else{const d=2*Math.sqrt(1+l-s-o);this._w=(r-i)/d,this._x=(n+h)/d,this._y=(a+c)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let s=e.dot(t)+1;return s<Number.EPSILON?(s=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ce(this.dot(e),-1,1)))}rotateTowards(e,t){const s=this.angleTo(e);if(s===0)return this;const i=Math.min(1,t/s);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const s=e._x,i=e._y,n=e._z,r=e._w,o=t._x,a=t._y,h=t._z,c=t._w;return this._x=s*c+r*o+i*h-n*a,this._y=i*c+r*a+n*o-s*h,this._z=n*c+r*h+s*a-i*o,this._w=r*c-s*o-i*a-n*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const s=this._x,i=this._y,n=this._z,r=this._w;let o=r*e._w+s*e._x+i*e._y+n*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=r,this._x=s,this._y=i,this._z=n,this;const a=1-o*o;if(a<=Number.EPSILON){const d=1-t;return this._w=d*r+t*this._w,this._x=d*s+t*this._x,this._y=d*i+t*this._y,this._z=d*n+t*this._z,this.normalize(),this}const h=Math.sqrt(a),c=Math.atan2(h,o),l=Math.sin((1-t)*c)/h,u=Math.sin(t*c)/h;return this._w=r*l+this._w*u,this._x=s*l+this._x*u,this._y=i*l+this._y*u,this._z=n*l+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,s){return this.copy(e).slerp(t,s)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),n=Math.sqrt(s);return this.set(i*Math.sin(e),i*Math.cos(e),n*Math.sin(t),n*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class b{constructor(e=0,t=0,s=0){b.prototype.isVector3=!0,this.x=e,this.y=t,this.z=s}set(e,t,s){return s===void 0&&(s=this.z),this.x=e,this.y=t,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(go.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(go.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,s=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[3]*s+n[6]*i,this.y=n[1]*t+n[4]*s+n[7]*i,this.z=n[2]*t+n[5]*s+n[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,n=e.elements,r=1/(n[3]*t+n[7]*s+n[11]*i+n[15]);return this.x=(n[0]*t+n[4]*s+n[8]*i+n[12])*r,this.y=(n[1]*t+n[5]*s+n[9]*i+n[13])*r,this.z=(n[2]*t+n[6]*s+n[10]*i+n[14])*r,this}applyQuaternion(e){const t=this.x,s=this.y,i=this.z,n=e.x,r=e.y,o=e.z,a=e.w,h=2*(r*i-o*s),c=2*(o*t-n*i),l=2*(n*s-r*t);return this.x=t+a*h+r*l-o*c,this.y=s+a*c+o*h-n*l,this.z=i+a*l+n*c-r*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,s=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[4]*s+n[8]*i,this.y=n[1]*t+n[5]*s+n[9]*i,this.z=n[2]*t+n[6]*s+n[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const s=e.x,i=e.y,n=e.z,r=t.x,o=t.y,a=t.z;return this.x=i*a-n*o,this.y=n*r-s*a,this.z=s*o-i*r,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const s=e.dot(this)/t;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return pn.copy(this).projectOnVector(e),this.sub(pn)}reflect(e){return this.sub(pn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(ce(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y,i=this.z-e.z;return t*t+s*s+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,s){const i=Math.sin(t)*e;return this.x=i*Math.sin(s),this.y=Math.cos(t)*e,this.z=i*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,s){return this.x=e*Math.sin(t),this.y=s,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=s,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,s=Math.sqrt(1-t*t);return this.x=s*Math.cos(e),this.y=t,this.z=s*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const pn=new b,go=new Ke;class Ye{constructor(e=new b(1/0,1/0,1/0),t=new b(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,s=e.length;t<s;t+=3)this.expandByPoint(De.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,s=e.count;t<s;t++)this.expandByPoint(De.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,s=e.length;t<s;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const s=De.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(s),this.max.copy(e).add(s),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const s=e.geometry;if(s!==void 0){const n=s.getAttribute("position");if(t===!0&&n!==void 0&&e.isInstancedMesh!==!0)for(let r=0,o=n.count;r<o;r++)e.isMesh===!0?e.getVertexPosition(r,De):De.fromBufferAttribute(n,r),De.applyMatrix4(e.matrixWorld),this.expandByPoint(De);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),ti.copy(e.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),ti.copy(s.boundingBox)),ti.applyMatrix4(e.matrixWorld),this.union(ti)}const i=e.children;for(let n=0,r=i.length;n<r;n++)this.expandByObject(i[n],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,De),De.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,s;return e.normal.x>0?(t=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),t<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(xs),si.subVectors(this.max,xs),Ht.subVectors(e.a,xs),qt.subVectors(e.b,xs),Vt.subVectors(e.c,xs),ut.subVectors(qt,Ht),dt.subVectors(Vt,qt),xt.subVectors(Ht,Vt);let t=[0,-ut.z,ut.y,0,-dt.z,dt.y,0,-xt.z,xt.y,ut.z,0,-ut.x,dt.z,0,-dt.x,xt.z,0,-xt.x,-ut.y,ut.x,0,-dt.y,dt.x,0,-xt.y,xt.x,0];return!fn(t,Ht,qt,Vt,si)||(t=[1,0,0,0,1,0,0,0,1],!fn(t,Ht,qt,Vt,si))?!1:(ii.crossVectors(ut,dt),t=[ii.x,ii.y,ii.z],fn(t,Ht,qt,Vt,si))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,De).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(De).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Xe[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Xe[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Xe[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Xe[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Xe[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Xe[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Xe[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Xe[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Xe),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Xe=[new b,new b,new b,new b,new b,new b,new b,new b],De=new b,ti=new Ye,Ht=new b,qt=new b,Vt=new b,ut=new b,dt=new b,xt=new b,xs=new b,si=new b,ii=new b,Qt=new b;function fn(A,e,t,s,i){for(let n=0,r=A.length-3;n<=r;n+=3){Qt.fromArray(A,n);const o=i.x*Math.abs(Qt.x)+i.y*Math.abs(Qt.y)+i.z*Math.abs(Qt.z),a=e.dot(Qt),h=t.dot(Qt),c=s.dot(Qt);if(Math.max(-Math.max(a,h,c),Math.min(a,h,c))>o)return!1}return!0}const ah=new Ye,Qs=new b,mn=new b;class Oe{constructor(e=new b,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const s=this.center;t!==void 0?s.copy(t):ah.setFromPoints(e).getCenter(s);let i=0;for(let n=0,r=e.length;n<r;n++)i=Math.max(i,s.distanceToSquared(e[n]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const s=this.center.distanceToSquared(e);return t.copy(e),s>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Qs.subVectors(e,this.center);const t=Qs.lengthSq();if(t>this.radius*this.radius){const s=Math.sqrt(t),i=(s-this.radius)*.5;this.center.addScaledVector(Qs,i/s),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(mn.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Qs.copy(e.center).add(mn)),this.expandByPoint(Qs.copy(e.center).sub(mn))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ze=new b,In=new b,ni=new b,gt=new b,bn=new b,ri=new b,yn=new b;class oi{constructor(e=new b,t=new b(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ze)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const s=t.dot(this.direction);return s<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ze.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ze.copy(this.origin).addScaledVector(this.direction,t),Ze.distanceToSquared(e))}distanceSqToSegment(e,t,s,i){In.copy(e).add(t).multiplyScalar(.5),ni.copy(t).sub(e).normalize(),gt.copy(this.origin).sub(In);const n=e.distanceTo(t)*.5,r=-this.direction.dot(ni),o=gt.dot(this.direction),a=-gt.dot(ni),h=gt.lengthSq(),c=Math.abs(1-r*r);let l,u,d,g;if(c>0)if(l=r*a-o,u=r*o-a,g=n*c,l>=0)if(u>=-g)if(u<=g){const p=1/c;l*=p,u*=p,d=l*(l+r*u+2*o)+u*(r*l+u+2*a)+h}else u=n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;else u=-n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;else u<=-g?(l=Math.max(0,-(-r*n+o)),u=l>0?-n:Math.min(Math.max(-n,-a),n),d=-l*l+u*(u+2*a)+h):u<=g?(l=0,u=Math.min(Math.max(-n,-a),n),d=u*(u+2*a)+h):(l=Math.max(0,-(r*n+o)),u=l>0?n:Math.min(Math.max(-n,-a),n),d=-l*l+u*(u+2*a)+h);else u=r>0?-n:n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;return s&&s.copy(this.origin).addScaledVector(this.direction,l),i&&i.copy(In).addScaledVector(ni,u),d}intersectSphere(e,t){Ze.subVectors(e.center,this.origin);const s=Ze.dot(this.direction),i=Ze.dot(Ze)-s*s,n=e.radius*e.radius;if(i>n)return null;const r=Math.sqrt(n-i),o=s-r,a=s+r;return a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/t;return s>=0?s:null}intersectPlane(e,t){const s=this.distanceToPlane(e);return s===null?null:this.at(s,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let s,i,n,r,o,a;const h=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,u=this.origin;return h>=0?(s=(e.min.x-u.x)*h,i=(e.max.x-u.x)*h):(s=(e.max.x-u.x)*h,i=(e.min.x-u.x)*h),c>=0?(n=(e.min.y-u.y)*c,r=(e.max.y-u.y)*c):(n=(e.max.y-u.y)*c,r=(e.min.y-u.y)*c),s>r||n>i||((n>s||isNaN(s))&&(s=n),(r<i||isNaN(i))&&(i=r),l>=0?(o=(e.min.z-u.z)*l,a=(e.max.z-u.z)*l):(o=(e.max.z-u.z)*l,a=(e.min.z-u.z)*l),s>a||o>i)||((o>s||s!==s)&&(s=o),(a<i||i!==i)&&(i=a),i<0)?null:this.at(s>=0?s:i,t)}intersectsBox(e){return this.intersectBox(e,Ze)!==null}intersectTriangle(e,t,s,i,n){bn.subVectors(t,e),ri.subVectors(s,e),yn.crossVectors(bn,ri);let r=this.direction.dot(yn),o;if(r>0){if(i)return null;o=1}else if(r<0)o=-1,r=-r;else return null;gt.subVectors(this.origin,e);const a=o*this.direction.dot(ri.crossVectors(gt,ri));if(a<0)return null;const h=o*this.direction.dot(bn.cross(gt));if(h<0||a+h>r)return null;const c=-o*gt.dot(yn);return c<0?null:this.at(c/r,n)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class k{constructor(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f){k.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f)}set(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f){const m=this.elements;return m[0]=e,m[4]=t,m[8]=s,m[12]=i,m[1]=n,m[5]=r,m[9]=o,m[13]=a,m[2]=h,m[6]=c,m[10]=l,m[14]=u,m[3]=d,m[7]=g,m[11]=p,m[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new k().fromArray(this.elements)}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],this}copyPosition(e){const t=this.elements,s=e.elements;return t[12]=s[12],t[13]=s[13],t[14]=s[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,s){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,t,s){return this.set(e.x,t.x,s.x,0,e.y,t.y,s.y,0,e.z,t.z,s.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,s=e.elements,i=1/jt.setFromMatrixColumn(e,0).length(),n=1/jt.setFromMatrixColumn(e,1).length(),r=1/jt.setFromMatrixColumn(e,2).length();return t[0]=s[0]*i,t[1]=s[1]*i,t[2]=s[2]*i,t[3]=0,t[4]=s[4]*n,t[5]=s[5]*n,t[6]=s[6]*n,t[7]=0,t[8]=s[8]*r,t[9]=s[9]*r,t[10]=s[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,s=e.x,i=e.y,n=e.z,r=Math.cos(s),o=Math.sin(s),a=Math.cos(i),h=Math.sin(i),c=Math.cos(n),l=Math.sin(n);if(e.order==="XYZ"){const u=r*c,d=r*l,g=o*c,p=o*l;t[0]=a*c,t[4]=-a*l,t[8]=h,t[1]=d+g*h,t[5]=u-p*h,t[9]=-o*a,t[2]=p-u*h,t[6]=g+d*h,t[10]=r*a}else if(e.order==="YXZ"){const u=a*c,d=a*l,g=h*c,p=h*l;t[0]=u+p*o,t[4]=g*o-d,t[8]=r*h,t[1]=r*l,t[5]=r*c,t[9]=-o,t[2]=d*o-g,t[6]=p+u*o,t[10]=r*a}else if(e.order==="ZXY"){const u=a*c,d=a*l,g=h*c,p=h*l;t[0]=u-p*o,t[4]=-r*l,t[8]=g+d*o,t[1]=d+g*o,t[5]=r*c,t[9]=p-u*o,t[2]=-r*h,t[6]=o,t[10]=r*a}else if(e.order==="ZYX"){const u=r*c,d=r*l,g=o*c,p=o*l;t[0]=a*c,t[4]=g*h-d,t[8]=u*h+p,t[1]=a*l,t[5]=p*h+u,t[9]=d*h-g,t[2]=-h,t[6]=o*a,t[10]=r*a}else if(e.order==="YZX"){const u=r*a,d=r*h,g=o*a,p=o*h;t[0]=a*c,t[4]=p-u*l,t[8]=g*l+d,t[1]=l,t[5]=r*c,t[9]=-o*c,t[2]=-h*c,t[6]=d*l+g,t[10]=u-p*l}else if(e.order==="XZY"){const u=r*a,d=r*h,g=o*a,p=o*h;t[0]=a*c,t[4]=-l,t[8]=h*c,t[1]=u*l+p,t[5]=r*c,t[9]=d*l-g,t[2]=g*l-d,t[6]=o*c,t[10]=p*l+u}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Ah,e,hh)}lookAt(e,t,s){const i=this.elements;return be.subVectors(e,t),be.lengthSq()===0&&(be.z=1),be.normalize(),pt.crossVectors(s,be),pt.lengthSq()===0&&(Math.abs(s.z)===1?be.x+=1e-4:be.z+=1e-4,be.normalize(),pt.crossVectors(s,be)),pt.normalize(),ai.crossVectors(be,pt),i[0]=pt.x,i[4]=ai.x,i[8]=be.x,i[1]=pt.y,i[5]=ai.y,i[9]=be.y,i[2]=pt.z,i[6]=ai.z,i[10]=be.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,n=this.elements,r=s[0],o=s[4],a=s[8],h=s[12],c=s[1],l=s[5],u=s[9],d=s[13],g=s[2],p=s[6],f=s[10],m=s[14],E=s[3],C=s[7],y=s[11],Q=s[15],M=i[0],S=i[4],R=i[8],D=i[12],O=i[1],H=i[5],ae=i[9],W=i[13],Ae=i[2],je=i[6],Be=i[10],ot=i[14],Je=i[3],We=i[7],at=i[11],V=i[15];return n[0]=r*M+o*O+a*Ae+h*Je,n[4]=r*S+o*H+a*je+h*We,n[8]=r*R+o*ae+a*Be+h*at,n[12]=r*D+o*W+a*ot+h*V,n[1]=c*M+l*O+u*Ae+d*Je,n[5]=c*S+l*H+u*je+d*We,n[9]=c*R+l*ae+u*Be+d*at,n[13]=c*D+l*W+u*ot+d*V,n[2]=g*M+p*O+f*Ae+m*Je,n[6]=g*S+p*H+f*je+m*We,n[10]=g*R+p*ae+f*Be+m*at,n[14]=g*D+p*W+f*ot+m*V,n[3]=E*M+C*O+y*Ae+Q*Je,n[7]=E*S+C*H+y*je+Q*We,n[11]=E*R+C*ae+y*Be+Q*at,n[15]=E*D+C*W+y*ot+Q*V,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[4],i=e[8],n=e[12],r=e[1],o=e[5],a=e[9],h=e[13],c=e[2],l=e[6],u=e[10],d=e[14],g=e[3],p=e[7],f=e[11],m=e[15];return g*(+n*a*l-i*h*l-n*o*u+s*h*u+i*o*d-s*a*d)+p*(+t*a*d-t*h*u+n*r*u-i*r*d+i*h*c-n*a*c)+f*(+t*h*l-t*o*d-n*r*l+s*r*d+n*o*c-s*h*c)+m*(-i*o*c-t*a*l+t*o*u+i*r*l-s*r*u+s*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,s){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=s),this}invert(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8],l=e[9],u=e[10],d=e[11],g=e[12],p=e[13],f=e[14],m=e[15],E=l*f*h-p*u*h+p*a*d-o*f*d-l*a*m+o*u*m,C=g*u*h-c*f*h-g*a*d+r*f*d+c*a*m-r*u*m,y=c*p*h-g*l*h+g*o*d-r*p*d-c*o*m+r*l*m,Q=g*l*a-c*p*a-g*o*u+r*p*u+c*o*f-r*l*f,M=t*E+s*C+i*y+n*Q;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/M;return e[0]=E*S,e[1]=(p*u*n-l*f*n-p*i*d+s*f*d+l*i*m-s*u*m)*S,e[2]=(o*f*n-p*a*n+p*i*h-s*f*h-o*i*m+s*a*m)*S,e[3]=(l*a*n-o*u*n-l*i*h+s*u*h+o*i*d-s*a*d)*S,e[4]=C*S,e[5]=(c*f*n-g*u*n+g*i*d-t*f*d-c*i*m+t*u*m)*S,e[6]=(g*a*n-r*f*n-g*i*h+t*f*h+r*i*m-t*a*m)*S,e[7]=(r*u*n-c*a*n+c*i*h-t*u*h-r*i*d+t*a*d)*S,e[8]=y*S,e[9]=(g*l*n-c*p*n-g*s*d+t*p*d+c*s*m-t*l*m)*S,e[10]=(r*p*n-g*o*n+g*s*h-t*p*h-r*s*m+t*o*m)*S,e[11]=(c*o*n-r*l*n-c*s*h+t*l*h+r*s*d-t*o*d)*S,e[12]=Q*S,e[13]=(c*p*i-g*l*i+g*s*u-t*p*u-c*s*f+t*l*f)*S,e[14]=(g*o*i-r*p*i-g*s*a+t*p*a+r*s*f-t*o*f)*S,e[15]=(r*l*i-c*o*i+c*s*a-t*l*a-r*s*u+t*o*u)*S,this}scale(e){const t=this.elements,s=e.x,i=e.y,n=e.z;return t[0]*=s,t[4]*=i,t[8]*=n,t[1]*=s,t[5]*=i,t[9]*=n,t[2]*=s,t[6]*=i,t[10]*=n,t[3]*=s,t[7]*=i,t[11]*=n,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,s,i))}makeTranslation(e,t,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,s,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,t,-s,0,0,s,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,0,s,0,0,1,0,0,-s,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,0,s,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const s=Math.cos(t),i=Math.sin(t),n=1-s,r=e.x,o=e.y,a=e.z,h=n*r,c=n*o;return this.set(h*r+s,h*o-i*a,h*a+i*o,0,h*o+i*a,c*o+s,c*a-i*r,0,h*a-i*o,c*a+i*r,n*a*a+s,0,0,0,0,1),this}makeScale(e,t,s){return this.set(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,t,s,i,n,r){return this.set(1,s,n,0,e,1,r,0,t,i,1,0,0,0,0,1),this}compose(e,t,s){const i=this.elements,n=t._x,r=t._y,o=t._z,a=t._w,h=n+n,c=r+r,l=o+o,u=n*h,d=n*c,g=n*l,p=r*c,f=r*l,m=o*l,E=a*h,C=a*c,y=a*l,Q=s.x,M=s.y,S=s.z;return i[0]=(1-(p+m))*Q,i[1]=(d+y)*Q,i[2]=(g-C)*Q,i[3]=0,i[4]=(d-y)*M,i[5]=(1-(u+m))*M,i[6]=(f+E)*M,i[7]=0,i[8]=(g+C)*S,i[9]=(f-E)*S,i[10]=(1-(u+p))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,s){const i=this.elements;let n=jt.set(i[0],i[1],i[2]).length();const r=jt.set(i[4],i[5],i[6]).length(),o=jt.set(i[8],i[9],i[10]).length();this.determinant()<0&&(n=-n),e.x=i[12],e.y=i[13],e.z=i[14],_e.copy(this);const h=1/n,c=1/r,l=1/o;return _e.elements[0]*=h,_e.elements[1]*=h,_e.elements[2]*=h,_e.elements[4]*=c,_e.elements[5]*=c,_e.elements[6]*=c,_e.elements[8]*=l,_e.elements[9]*=l,_e.elements[10]*=l,t.setFromRotationMatrix(_e),s.x=n,s.y=r,s.z=o,this}makePerspective(e,t,s,i,n,r,o=lt){const a=this.elements,h=2*n/(t-e),c=2*n/(s-i),l=(t+e)/(t-e),u=(s+i)/(s-i);let d,g;if(o===lt)d=-(r+n)/(r-n),g=-2*r*n/(r-n);else if(o===ei)d=-r/(r-n),g=-r*n/(r-n);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return a[0]=h,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=g,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,s,i,n,r,o=lt){const a=this.elements,h=1/(t-e),c=1/(s-i),l=1/(r-n),u=(t+e)*h,d=(s+i)*c;let g,p;if(o===lt)g=(r+n)*l,p=-2*l;else if(o===ei)g=n*l,p=-1*l;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return a[0]=2*h,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=p,a[14]=-g,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,s=e.elements;for(let i=0;i<16;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<16;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15],e}}const jt=new b,_e=new k,Ah=new b(0,0,0),hh=new b(1,1,1),pt=new b,ai=new b,be=new b,po=new k,fo=new Ke;class Jt{constructor(e=0,t=0,s=0,i=Jt.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=s,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,s,i=this._order){return this._x=e,this._y=t,this._z=s,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,s=!0){const i=e.elements,n=i[0],r=i[4],o=i[8],a=i[1],h=i[5],c=i[9],l=i[2],u=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(ce(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-r,n)):(this._x=Math.atan2(u,h),this._z=0);break;case"YXZ":this._x=Math.asin(-ce(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,h)):(this._y=Math.atan2(-l,n),this._z=0);break;case"ZXY":this._x=Math.asin(ce(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-l,d),this._z=Math.atan2(-r,h)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-ce(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-r,h));break;case"YZX":this._z=Math.asin(ce(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-l,n)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-ce(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(u,h),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,s){return po.makeRotationFromQuaternion(e),this.setFromRotationMatrix(po,t,s)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return fo.setFromEuler(this),this.setFromQuaternion(fo,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Jt.DEFAULT_ORDER="XYZ";class ch{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let lh=0;const mo=new b,Wt=new Ke,$e=new k,Ai=new b,ws=new b,uh=new b,dh=new Ke,Io=new b(1,0,0),bo=new b(0,1,0),yo=new b(0,0,1),Eo={type:"added"},gh={type:"removed"},Kt={type:"childadded",child:null},En={type:"childremoved",child:null};class Y extends Ut{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:lh++}),this.uuid=Ne(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Y.DEFAULT_UP.clone();const e=new b,t=new Jt,s=new Ke,i=new b(1,1,1);function n(){s.setFromEuler(t,!1)}function r(){t.setFromQuaternion(s,void 0,!1)}t._onChange(n),s._onChange(r),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new k},normalMatrix:{value:new Fe}}),this.matrix=new k,this.matrixWorld=new k,this.matrixAutoUpdate=Y.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Y.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ch,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Wt.setFromAxisAngle(e,t),this.quaternion.multiply(Wt),this}rotateOnWorldAxis(e,t){return Wt.setFromAxisAngle(e,t),this.quaternion.premultiply(Wt),this}rotateX(e){return this.rotateOnAxis(Io,e)}rotateY(e){return this.rotateOnAxis(bo,e)}rotateZ(e){return this.rotateOnAxis(yo,e)}translateOnAxis(e,t){return mo.copy(e).applyQuaternion(this.quaternion),this.position.add(mo.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Io,e)}translateY(e){return this.translateOnAxis(bo,e)}translateZ(e){return this.translateOnAxis(yo,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4($e.copy(this.matrixWorld).invert())}lookAt(e,t,s){e.isVector3?Ai.copy(e):Ai.set(e,t,s);const i=this.parent;this.updateWorldMatrix(!0,!1),ws.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?$e.lookAt(ws,Ai,this.up):$e.lookAt(Ai,ws,this.up),this.quaternion.setFromRotationMatrix($e),i&&($e.extractRotation(i.matrixWorld),Wt.setFromRotationMatrix($e),this.quaternion.premultiply(Wt.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Eo),Kt.child=e,this.dispatchEvent(Kt),Kt.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(gh),En.child=e,this.dispatchEvent(En),En.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),$e.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),$e.multiply(e.parent.matrixWorld)),e.applyMatrix4($e),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Eo),Kt.child=e,this.dispatchEvent(Kt),Kt.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let s=0,i=this.children.length;s<i;s++){const r=this.children[s].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,s=[]){this[e]===t&&s.push(this);const i=this.children;for(let n=0,r=i.length;n<r;n++)i[n].getObjectsByProperty(e,t,s);return s}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ws,e,uh),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ws,dh,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].updateMatrixWorld(e)}updateWorldMatrix(e,t){const s=this.parent;if(e===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let n=0,r=i.length;n<r;n++)i[n].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",s={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function n(o,a){return o[a.uuid]===void 0&&(o[a.uuid]=a.toJSON(e)),a.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=n(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const a=o.shapes;if(Array.isArray(a))for(let h=0,c=a.length;h<c;h++){const l=a[h];n(e.shapes,l)}else n(e.shapes,a)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(n(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let a=0,h=this.material.length;a<h;a++)o.push(n(e.materials,this.material[a]));i.material=o}else i.material=n(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const a=this.animations[o];i.animations.push(n(e.animations,a))}}if(t){const o=r(e.geometries),a=r(e.materials),h=r(e.textures),c=r(e.images),l=r(e.shapes),u=r(e.skeletons),d=r(e.animations),g=r(e.nodes);o.length>0&&(s.geometries=o),a.length>0&&(s.materials=a),h.length>0&&(s.textures=h),c.length>0&&(s.images=c),l.length>0&&(s.shapes=l),u.length>0&&(s.skeletons=u),d.length>0&&(s.animations=d),g.length>0&&(s.nodes=g)}return s.object=i,s;function r(o){const a=[];for(const h in o){const c=o[h];delete c.metadata,a.push(c)}return a}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let s=0;s<e.children.length;s++){const i=e.children[s];this.add(i.clone())}return this}}Y.DEFAULT_UP=new b(0,1,0),Y.DEFAULT_MATRIX_AUTO_UPDATE=!0,Y.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ke=new b,et=new b,Cn=new b,tt=new b,Yt=new b,Xt=new b,Co=new b,Bn=new b,xn=new b,Qn=new b,wn=new K,Tn=new K,Sn=new K;class Le{constructor(e=new b,t=new b,s=new b){this.a=e,this.b=t,this.c=s}static getNormal(e,t,s,i){i.subVectors(s,t),ke.subVectors(e,t),i.cross(ke);const n=i.lengthSq();return n>0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(e,t,s,i,n){ke.subVectors(i,t),et.subVectors(s,t),Cn.subVectors(e,t);const r=ke.dot(ke),o=ke.dot(et),a=ke.dot(Cn),h=et.dot(et),c=et.dot(Cn),l=r*h-o*o;if(l===0)return n.set(0,0,0),null;const u=1/l,d=(h*a-o*c)*u,g=(r*c-o*a)*u;return n.set(1-d-g,g,d)}static containsPoint(e,t,s,i){return this.getBarycoord(e,t,s,i,tt)===null?!1:tt.x>=0&&tt.y>=0&&tt.x+tt.y<=1}static getInterpolation(e,t,s,i,n,r,o,a){return this.getBarycoord(e,t,s,i,tt)===null?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(n,tt.x),a.addScaledVector(r,tt.y),a.addScaledVector(o,tt.z),a)}static getInterpolatedAttribute(e,t,s,i,n,r){return wn.setScalar(0),Tn.setScalar(0),Sn.setScalar(0),wn.fromBufferAttribute(e,t),Tn.fromBufferAttribute(e,s),Sn.fromBufferAttribute(e,i),r.setScalar(0),r.addScaledVector(wn,n.x),r.addScaledVector(Tn,n.y),r.addScaledVector(Sn,n.z),r}static isFrontFacing(e,t,s,i){return ke.subVectors(s,t),et.subVectors(e,t),ke.cross(et).dot(i)<0}set(e,t,s){return this.a.copy(e),this.b.copy(t),this.c.copy(s),this}setFromPointsAndIndices(e,t,s,i){return this.a.copy(e[t]),this.b.copy(e[s]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,s,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ke.subVectors(this.c,this.b),et.subVectors(this.a,this.b),ke.cross(et).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Le.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Le.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,s,i,n){return Le.getInterpolation(e,this.a,this.b,this.c,t,s,i,n)}containsPoint(e){return Le.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Le.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const s=this.a,i=this.b,n=this.c;let r,o;Yt.subVectors(i,s),Xt.subVectors(n,s),Bn.subVectors(e,s);const a=Yt.dot(Bn),h=Xt.dot(Bn);if(a<=0&&h<=0)return t.copy(s);xn.subVectors(e,i);const c=Yt.dot(xn),l=Xt.dot(xn);if(c>=0&&l<=c)return t.copy(i);const u=a*l-c*h;if(u<=0&&a>=0&&c<=0)return r=a/(a-c),t.copy(s).addScaledVector(Yt,r);Qn.subVectors(e,n);const d=Yt.dot(Qn),g=Xt.dot(Qn);if(g>=0&&d<=g)return t.copy(n);const p=d*h-a*g;if(p<=0&&h>=0&&g<=0)return o=h/(h-g),t.copy(s).addScaledVector(Xt,o);const f=c*g-d*l;if(f<=0&&l-c>=0&&d-g>=0)return Co.subVectors(n,i),o=(l-c)/(l-c+(d-g)),t.copy(i).addScaledVector(Co,o);const m=1/(f+p+u);return r=p*m,o=u*m,t.copy(s).addScaledVector(Yt,r).addScaledVector(Xt,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Bo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ft={h:0,s:0,l:0},hi={h:0,s:0,l:0};function Mn(A,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?A+(e-A)*6*t:t<1/2?e:t<2/3?A+(e-A)*6*(2/3-t):A}class X{constructor(e,t,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,s)}set(e,t,s){if(t===void 0&&s===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ne){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,le.toWorkingColorSpace(this,t),this}setRGB(e,t,s,i=le.workingColorSpace){return this.r=e,this.g=t,this.b=s,le.toWorkingColorSpace(this,i),this}setHSL(e,t,s,i=le.workingColorSpace){if(e=cn(e,1),t=ce(t,0,1),s=ce(s,0,1),t===0)this.r=this.g=this.b=s;else{const n=s<=.5?s*(1+t):s+t-s*t,r=2*s-n;this.r=Mn(r,n,e+1/3),this.g=Mn(r,n,e),this.b=Mn(r,n,e-1/3)}return le.toWorkingColorSpace(this,i),this}setStyle(e,t=ne){function s(n){n!==void 0&&parseFloat(n)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let n;const r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,t);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,t);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],r=n.length;if(r===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(r===6)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=ne){const s=Bo[e.toLowerCase()];return s!==void 0?this.setHex(s,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zt(e.r),this.g=zt(e.g),this.b=zt(e.b),this}copyLinearToSRGB(e){return this.r=dn(e.r),this.g=dn(e.g),this.b=dn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ne){return le.fromWorkingColorSpace(de.copy(this),e),Math.round(ce(de.r*255,0,255))*65536+Math.round(ce(de.g*255,0,255))*256+Math.round(ce(de.b*255,0,255))}getHexString(e=ne){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=le.workingColorSpace){le.fromWorkingColorSpace(de.copy(this),t);const s=de.r,i=de.g,n=de.b,r=Math.max(s,i,n),o=Math.min(s,i,n);let a,h;const c=(o+r)/2;if(o===r)a=0,h=0;else{const l=r-o;switch(h=c<=.5?l/(r+o):l/(2-r-o),r){case s:a=(i-n)/l+(i<n?6:0);break;case i:a=(n-s)/l+2;break;case n:a=(s-i)/l+4;break}a/=6}return e.h=a,e.s=h,e.l=c,e}getRGB(e,t=le.workingColorSpace){return le.fromWorkingColorSpace(de.copy(this),t),e.r=de.r,e.g=de.g,e.b=de.b,e}getStyle(e=ne){le.fromWorkingColorSpace(de.copy(this),e);const t=de.r,s=de.g,i=de.b;return e!==ne?`color(${e} ${t.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(s*255)},${Math.round(i*255)})`}offsetHSL(e,t,s){return this.getHSL(ft),this.setHSL(ft.h+e,ft.s+t,ft.l+s)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,s){return this.r=e.r+(t.r-e.r)*s,this.g=e.g+(t.g-e.g)*s,this.b=e.b+(t.b-e.b)*s,this}lerpHSL(e,t){this.getHSL(ft),e.getHSL(hi);const s=Cs(ft.h,hi.h,t),i=Cs(ft.s,hi.s,t),n=Cs(ft.l,hi.l,t);return this.setHSL(s,i,n),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,s=this.g,i=this.b,n=e.elements;return this.r=n[0]*t+n[3]*s+n[6]*i,this.g=n[1]*t+n[4]*s+n[7]*i,this.b=n[2]*t+n[5]*s+n[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const de=new X;X.NAMES=Bo;let ph=0;class wt extends Ut{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ph++}),this.uuid=Ne(),this.name="",this.type="Material",this.blending=_r,this.side=Xs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Lr,this.blendDst=vr,this.blendEquation=kr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new X(0,0,0),this.blendAlpha=0,this.depthFunc=Gr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=oo,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ot,this.stencilZFail=Ot,this.stencilZPass=Ot,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const s=e[t];if(s===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(s):i&&i.isVector3&&s&&s.isVector3?i.copy(s):this[t]=s}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==_r&&(s.blending=this.blending),this.side!==Xs&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==Lr&&(s.blendSrc=this.blendSrc),this.blendDst!==vr&&(s.blendDst=this.blendDst),this.blendEquation!==kr&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==Gr&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==oo&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ot&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Ot&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Ot&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function i(n){const r=[];for(const o in n){const a=n[o];delete a.metadata,r.push(a)}return r}if(t){const n=i(e.textures),r=i(e.images);n.length>0&&(s.textures=n),r.length>0&&(s.images=r)}return s}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let s=null;if(t!==null){const i=t.length;s=new Array(i);for(let n=0;n!==i;++n)s[n]=t[n].clone()}return this.clippingPlanes=s,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Zt extends wt{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new X(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Jt,this.combine=xA,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Z=new b,ci=new q;class ye{constructor(e,t,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=s,this.usage=$s,this.updateRanges=[],this.gpuType=ht,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,s){e*=this.itemSize,s*=t.itemSize;for(let i=0,n=this.itemSize;i<n;i++)this.array[e+i]=t.array[s+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,s=this.count;t<s;t++)ci.fromBufferAttribute(this,t),ci.applyMatrix3(e),this.setXY(t,ci.x,ci.y);else if(this.itemSize===3)for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyMatrix3(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}applyMatrix4(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyMatrix4(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}applyNormalMatrix(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyNormalMatrix(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}transformDirection(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.transformDirection(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let s=this.array[e*this.itemSize+t];return this.normalized&&(s=Re(s,this.array)),s}setComponent(e,t,s){return this.normalized&&(s=z(s,this.array)),this.array[e*this.itemSize+t]=s,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Re(t,this.array)),t}setX(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Re(t,this.array)),t}setY(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Re(t,this.array)),t}setZ(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Re(t,this.array)),t}setW(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,s){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array)),this.array[e+0]=t,this.array[e+1]=s,this}setXYZ(e,t,s,i){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array)),this.array[e+0]=t,this.array[e+1]=s,this.array[e+2]=i,this}setXYZW(e,t,s,i,n){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array),n=z(n,this.array)),this.array[e+0]=t,this.array[e+1]=s,this.array[e+2]=i,this.array[e+3]=n,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==$s&&(e.usage=this.usage),e}}class fh extends ye{constructor(e,t,s){super(new Uint16Array(e),t,s)}}class mh extends ye{constructor(e,t,s){super(new Uint32Array(e),t,s)}}class Nn extends ye{constructor(e,t,s){super(new Float32Array(e),t,s)}}let Ih=0;const Qe=new k,Rn=new Y,$t=new b,Ee=new Ye,Ts=new Ye,re=new b;class Tt extends Ut{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ih++}),this.uuid=Ne(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(th(e)?mh:fh)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,s=0){this.groups.push({start:e,count:t,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const n=new Fe().getNormalMatrix(e);s.applyNormalMatrix(n),s.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Qe.makeRotationFromQuaternion(e),this.applyMatrix4(Qe),this}rotateX(e){return Qe.makeRotationX(e),this.applyMatrix4(Qe),this}rotateY(e){return Qe.makeRotationY(e),this.applyMatrix4(Qe),this}rotateZ(e){return Qe.makeRotationZ(e),this.applyMatrix4(Qe),this}translate(e,t,s){return Qe.makeTranslation(e,t,s),this.applyMatrix4(Qe),this}scale(e,t,s){return Qe.makeScale(e,t,s),this.applyMatrix4(Qe),this}lookAt(e){return Rn.lookAt(e),Rn.updateMatrix(),this.applyMatrix4(Rn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter($t).negate(),this.translate($t.x,$t.y,$t.z),this}setFromPoints(e){const t=[];for(let s=0,i=e.length;s<i;s++){const n=e[s];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new Nn(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ye);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new b(-1/0,-1/0,-1/0),new b(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let s=0,i=t.length;s<i;s++){const n=t[s];Ee.setFromBufferAttribute(n),this.morphTargetsRelative?(re.addVectors(this.boundingBox.min,Ee.min),this.boundingBox.expandByPoint(re),re.addVectors(this.boundingBox.max,Ee.max),this.boundingBox.expandByPoint(re)):(this.boundingBox.expandByPoint(Ee.min),this.boundingBox.expandByPoint(Ee.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Oe);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new b,1/0);return}if(e){const s=this.boundingSphere.center;if(Ee.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const o=t[n];Ts.setFromBufferAttribute(o),this.morphTargetsRelative?(re.addVectors(Ee.min,Ts.min),Ee.expandByPoint(re),re.addVectors(Ee.max,Ts.max),Ee.expandByPoint(re)):(Ee.expandByPoint(Ts.min),Ee.expandByPoint(Ts.max))}Ee.getCenter(s);let i=0;for(let n=0,r=e.count;n<r;n++)re.fromBufferAttribute(e,n),i=Math.max(i,s.distanceToSquared(re));if(t)for(let n=0,r=t.length;n<r;n++){const o=t[n],a=this.morphTargetsRelative;for(let h=0,c=o.count;h<c;h++)re.fromBufferAttribute(o,h),a&&($t.fromBufferAttribute(e,h),re.add($t)),i=Math.max(i,s.distanceToSquared(re))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=t.position,i=t.normal,n=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ye(new Float32Array(4*s.count),4));const r=this.getAttribute("tangent"),o=[],a=[];for(let R=0;R<s.count;R++)o[R]=new b,a[R]=new b;const h=new b,c=new b,l=new b,u=new q,d=new q,g=new q,p=new b,f=new b;function m(R,D,O){h.fromBufferAttribute(s,R),c.fromBufferAttribute(s,D),l.fromBufferAttribute(s,O),u.fromBufferAttribute(n,R),d.fromBufferAttribute(n,D),g.fromBufferAttribute(n,O),c.sub(h),l.sub(h),d.sub(u),g.sub(u);const H=1/(d.x*g.y-g.x*d.y);isFinite(H)&&(p.copy(c).multiplyScalar(g.y).addScaledVector(l,-d.y).multiplyScalar(H),f.copy(l).multiplyScalar(d.x).addScaledVector(c,-g.x).multiplyScalar(H),o[R].add(p),o[D].add(p),o[O].add(p),a[R].add(f),a[D].add(f),a[O].add(f))}let E=this.groups;E.length===0&&(E=[{start:0,count:e.count}]);for(let R=0,D=E.length;R<D;++R){const O=E[R],H=O.start,ae=O.count;for(let W=H,Ae=H+ae;W<Ae;W+=3)m(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const C=new b,y=new b,Q=new b,M=new b;function S(R){Q.fromBufferAttribute(i,R),M.copy(Q);const D=o[R];C.copy(D),C.sub(Q.multiplyScalar(Q.dot(D))).normalize(),y.crossVectors(M,D);const H=y.dot(a[R])<0?-1:1;r.setXYZW(R,C.x,C.y,C.z,H)}for(let R=0,D=E.length;R<D;++R){const O=E[R],H=O.start,ae=O.count;for(let W=H,Ae=H+ae;W<Ae;W+=3)S(e.getX(W+0)),S(e.getX(W+1)),S(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new ye(new Float32Array(t.count*3),3),this.setAttribute("normal",s);else for(let u=0,d=s.count;u<d;u++)s.setXYZ(u,0,0,0);const i=new b,n=new b,r=new b,o=new b,a=new b,h=new b,c=new b,l=new b;if(e)for(let u=0,d=e.count;u<d;u+=3){const g=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);i.fromBufferAttribute(t,g),n.fromBufferAttribute(t,p),r.fromBufferAttribute(t,f),c.subVectors(r,n),l.subVectors(i,n),c.cross(l),o.fromBufferAttribute(s,g),a.fromBufferAttribute(s,p),h.fromBufferAttribute(s,f),o.add(c),a.add(c),h.add(c),s.setXYZ(g,o.x,o.y,o.z),s.setXYZ(p,a.x,a.y,a.z),s.setXYZ(f,h.x,h.y,h.z)}else for(let u=0,d=t.count;u<d;u+=3)i.fromBufferAttribute(t,u+0),n.fromBufferAttribute(t,u+1),r.fromBufferAttribute(t,u+2),c.subVectors(r,n),l.subVectors(i,n),c.cross(l),s.setXYZ(u+0,c.x,c.y,c.z),s.setXYZ(u+1,c.x,c.y,c.z),s.setXYZ(u+2,c.x,c.y,c.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,s=e.count;t<s;t++)re.fromBufferAttribute(e,t),re.normalize(),e.setXYZ(t,re.x,re.y,re.z)}toNonIndexed(){function e(o,a){const h=o.array,c=o.itemSize,l=o.normalized,u=new h.constructor(a.length*c);let d=0,g=0;for(let p=0,f=a.length;p<f;p++){o.isInterleavedBufferAttribute?d=a[p]*o.data.stride+o.offset:d=a[p]*c;for(let m=0;m<c;m++)u[g++]=h[d++]}return new ye(u,c,l)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Tt,s=this.index.array,i=this.attributes;for(const o in i){const a=i[o],h=e(a,s);t.setAttribute(o,h)}const n=this.morphAttributes;for(const o in n){const a=[],h=n[o];for(let c=0,l=h.length;c<l;c++){const u=h[c],d=e(u,s);a.push(d)}t.morphAttributes[o]=a}t.morphTargetsRelative=this.morphTargetsRelative;const r=this.groups;for(let o=0,a=r.length;o<a;o++){const h=r[o];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const a=this.parameters;for(const h in a)a[h]!==void 0&&(e[h]=a[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const s=this.attributes;for(const a in s){const h=s[a];e.data.attributes[a]=h.toJSON(e.data)}const i={};let n=!1;for(const a in this.morphAttributes){const h=this.morphAttributes[a],c=[];for(let l=0,u=h.length;l<u;l++){const d=h[l];c.push(d.toJSON(e.data))}c.length>0&&(i[a]=c,n=!0)}n&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(t));const i=e.attributes;for(const h in i){const c=i[h];this.setAttribute(h,c.clone(t))}const n=e.morphAttributes;for(const h in n){const c=[],l=n[h];for(let u=0,d=l.length;u<d;u++)c.push(l[u].clone(t));this.morphAttributes[h]=c}this.morphTargetsRelative=e.morphTargetsRelative;const r=e.groups;for(let h=0,c=r.length;h<c;h++){const l=r[h];this.addGroup(l.start,l.count,l.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const a=e.boundingSphere;return a!==null&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const xo=new k,St=new oi,li=new Oe,Qo=new b,ui=new b,di=new b,gi=new b,Fn=new b,pi=new b,wo=new b,fi=new b;class mi extends Y{constructor(e=new Tt,t=new Zt){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}getVertexPosition(e,t){const s=this.geometry,i=s.attributes.position,n=s.morphAttributes.position,r=s.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(n&&o){pi.set(0,0,0);for(let a=0,h=n.length;a<h;a++){const c=o[a],l=n[a];c!==0&&(Fn.fromBufferAttribute(l,e),r?pi.addScaledVector(Fn,c):pi.addScaledVector(Fn.sub(t),c))}t.add(pi)}return t}raycast(e,t){const s=this.geometry,i=this.material,n=this.matrixWorld;i!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),li.copy(s.boundingSphere),li.applyMatrix4(n),St.copy(e.ray).recast(e.near),!(li.containsPoint(St.origin)===!1&&(St.intersectSphere(li,Qo)===null||St.origin.distanceToSquared(Qo)>(e.far-e.near)**2))&&(xo.copy(n).invert(),St.copy(e.ray).applyMatrix4(xo),!(s.boundingBox!==null&&St.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,t,St)))}_computeIntersections(e,t,s){let i;const n=this.geometry,r=this.material,o=n.index,a=n.attributes.position,h=n.attributes.uv,c=n.attributes.uv1,l=n.attributes.normal,u=n.groups,d=n.drawRange;if(o!==null)if(Array.isArray(r))for(let g=0,p=u.length;g<p;g++){const f=u[g],m=r[f.materialIndex],E=Math.max(f.start,d.start),C=Math.min(o.count,Math.min(f.start+f.count,d.start+d.count));for(let y=E,Q=C;y<Q;y+=3){const M=o.getX(y),S=o.getX(y+1),R=o.getX(y+2);i=Ii(this,m,e,s,h,c,l,M,S,R),i&&(i.faceIndex=Math.floor(y/3),i.face.materialIndex=f.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),p=Math.min(o.count,d.start+d.count);for(let f=g,m=p;f<m;f+=3){const E=o.getX(f),C=o.getX(f+1),y=o.getX(f+2);i=Ii(this,r,e,s,h,c,l,E,C,y),i&&(i.faceIndex=Math.floor(f/3),t.push(i))}}else if(a!==void 0)if(Array.isArray(r))for(let g=0,p=u.length;g<p;g++){const f=u[g],m=r[f.materialIndex],E=Math.max(f.start,d.start),C=Math.min(a.count,Math.min(f.start+f.count,d.start+d.count));for(let y=E,Q=C;y<Q;y+=3){const M=y,S=y+1,R=y+2;i=Ii(this,m,e,s,h,c,l,M,S,R),i&&(i.faceIndex=Math.floor(y/3),i.face.materialIndex=f.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),p=Math.min(a.count,d.start+d.count);for(let f=g,m=p;f<m;f+=3){const E=f,C=f+1,y=f+2;i=Ii(this,r,e,s,h,c,l,E,C,y),i&&(i.faceIndex=Math.floor(f/3),t.push(i))}}}}function bh(A,e,t,s,i,n,r,o){let a;if(e.side===Dr?a=s.intersectTriangle(r,n,i,!0,o):a=s.intersectTriangle(i,n,r,e.side===Xs,o),a===null)return null;fi.copy(o),fi.applyMatrix4(A.matrixWorld);const h=t.ray.origin.distanceTo(fi);return h<t.near||h>t.far?null:{distance:h,point:fi.clone(),object:A}}function Ii(A,e,t,s,i,n,r,o,a,h){A.getVertexPosition(o,ui),A.getVertexPosition(a,di),A.getVertexPosition(h,gi);const c=bh(A,e,t,s,ui,di,gi,wo);if(c){const l=new b;Le.getBarycoord(wo,ui,di,gi,l),i&&(c.uv=Le.getInterpolatedAttribute(i,o,a,h,l,new q)),n&&(c.uv1=Le.getInterpolatedAttribute(n,o,a,h,l,new q)),r&&(c.normal=Le.getInterpolatedAttribute(r,o,a,h,l,new b),c.normal.dot(s.direction)>0&&c.normal.multiplyScalar(-1));const u={a:o,b:a,c:h,normal:new b,materialIndex:0};Le.getNormal(ui,di,gi,u.normal),c.face=u,c.barycoord=l}return c}const bi=new b,yi=new Ke,Ue=new b;class To extends Y{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new k,this.projectionMatrix=new k,this.projectionMatrixInverse=new k,this.coordinateSystem=lt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(bi,yi,Ue),Ue.x===1&&Ue.y===1&&Ue.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(bi,yi,Ue.set(1,1,1)).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorld.decompose(bi,yi,Ue),Ue.x===1&&Ue.y===1&&Ue.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(bi,yi,Ue.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const mt=new b,So=new q,Mo=new q;class Dn extends To{constructor(e=50,t=1,s=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Es*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ys*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Es*2*Math.atan(Math.tan(ys*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,s){mt.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(mt.x,mt.y).multiplyScalar(-e/mt.z),mt.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(mt.x,mt.y).multiplyScalar(-e/mt.z)}getViewSize(e,t){return this.getViewBounds(e,So,Mo),t.subVectors(Mo,So)}setViewOffset(e,t,s,i,n,r){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=n,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ys*.5*this.fov)/this.zoom,s=2*t,i=this.aspect*s,n=-.5*i;const r=this.view;if(this.view!==null&&this.view.enabled){const a=r.fullWidth,h=r.fullHeight;n+=r.offsetX*i/a,t-=r.offsetY*s/h,i*=r.width/a,s*=r.height/h}const o=this.filmOffset;o!==0&&(n+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,t,t-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const _n=new b,yh=new b,Eh=new Fe;class Mt{constructor(e=new b(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,s,i){return this.normal.set(e,t,s),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,s){const i=_n.subVectors(s,t).cross(yh.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const s=e.delta(_n),i=this.normal.dot(s);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const n=-(e.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:t.copy(e.start).addScaledVector(s,n)}intersectsLine(e){const t=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return t<0&&s>0||s<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||Eh.getNormalMatrix(e),i=this.coplanarPoint(_n).applyMatrix4(e),n=this.normal.applyMatrix3(s).normalize();return this.constant=-i.dot(n),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Nt=new Oe,Ei=new b;class Ch{constructor(e=new Mt,t=new Mt,s=new Mt,i=new Mt,n=new Mt,r=new Mt){this.planes=[e,t,s,i,n,r]}set(e,t,s,i,n,r){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(s),o[3].copy(i),o[4].copy(n),o[5].copy(r),this}copy(e){const t=this.planes;for(let s=0;s<6;s++)t[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,t=lt){const s=this.planes,i=e.elements,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],c=i[5],l=i[6],u=i[7],d=i[8],g=i[9],p=i[10],f=i[11],m=i[12],E=i[13],C=i[14],y=i[15];if(s[0].setComponents(a-n,u-h,f-d,y-m).normalize(),s[1].setComponents(a+n,u+h,f+d,y+m).normalize(),s[2].setComponents(a+r,u+c,f+g,y+E).normalize(),s[3].setComponents(a-r,u-c,f-g,y-E).normalize(),s[4].setComponents(a-o,u-l,f-p,y-C).normalize(),t===lt)s[5].setComponents(a+o,u+l,f+p,y+C).normalize();else if(t===ei)s[5].setComponents(o,l,p,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Nt.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Nt.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Nt)}intersectsSprite(e){return Nt.center.set(0,0,0),Nt.radius=.7071067811865476,Nt.applyMatrix4(e.matrixWorld),this.intersectsSphere(Nt)}intersectsSphere(e){const t=this.planes,s=e.center,i=-e.radius;for(let n=0;n<6;n++)if(t[n].distanceToPoint(s)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let s=0;s<6;s++){const i=t[s];if(Ei.x=i.normal.x>0?e.max.x:e.min.x,Ei.y=i.normal.y>0?e.max.y:e.min.y,Ei.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ei)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let s=0;s<6;s++)if(t[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class No extends To{constructor(e=-1,t=1,s=1,i=-1,n=.1,r=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=s,this.bottom=i,this.near=n,this.far=r,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,s,i,n,r){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=n,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let n=s-e,r=s+e,o=i+t,a=i-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=h*this.view.offsetX,r=n+h*this.view.width,o-=c*this.view.offsetY,a=o-c*this.view.height}this.projectionMatrix.makeOrthographic(n,r,o,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class Ro extends ue{constructor(e,t,s,i,n,r,o,a,h,c=tn){if(c!==tn&&c!==jr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");s===void 0&&c===tn&&(s=Hr),s===void 0&&c===jr&&(s=NA),super(null,i,n,r,o,a,c,s,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=o!==void 0?o:Me,this.minFilter=a!==void 0?a:Me,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class kn extends Y{constructor(){super(),this.isGroup=!0,this.type="Group"}}class Fo{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=$s,this.updateRanges=[],this.version=0,this.uuid=Ne()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let i=0,n=this.stride;i<n;i++)this.array[e+i]=t.array[s+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ne()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),s=new this.constructor(t,this.stride);return s.setUsage(this.usage),s}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ne()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const pe=new b;class Ci{constructor(e,t,s,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=s,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,s=this.data.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.applyMatrix4(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}applyNormalMatrix(e){for(let t=0,s=this.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.applyNormalMatrix(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}transformDirection(e){for(let t=0,s=this.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.transformDirection(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}getComponent(e,t){let s=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(s=Re(s,this.array)),s}setComponent(e,t,s){return this.normalized&&(s=z(s,this.array)),this.data.array[e*this.data.stride+this.offset+t]=s,this}setX(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Re(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Re(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Re(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Re(t,this.array)),t}setXY(e,t,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this}setXYZ(e,t,s,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this.data.array[e+2]=i,this}setXYZW(e,t,s,i,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array),n=z(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this.data.array[e+2]=i,this.data.array[e+3]=n,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let s=0;s<this.count;s++){const i=s*this.data.stride+this.offset;for(let n=0;n<this.itemSize;n++)t.push(this.data.array[i+n])}return new ye(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ci(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let s=0;s<this.count;s++){const i=s*this.data.stride+this.offset;for(let n=0;n<this.itemSize;n++)t.push(this.data.array[i+n])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const Do=new b,_o=new K,ko=new K,Bh=new b,Lo=new k,Bi=new b,Ln=new Oe,vo=new k,vn=new oi;class xh extends mi{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Or,this.bindMatrix=new k,this.bindMatrixInverse=new k,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Ye),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let s=0;s<t.count;s++)this.getVertexPosition(s,Bi),this.boundingBox.expandByPoint(Bi)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Oe),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let s=0;s<t.count;s++)this.getVertexPosition(s,Bi),this.boundingSphere.expandByPoint(Bi)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const s=this.material,i=this.matrixWorld;s!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ln.copy(this.boundingSphere),Ln.applyMatrix4(i),e.ray.intersectsSphere(Ln)!==!1&&(vo.copy(i).invert(),vn.copy(e.ray).applyMatrix4(vo),!(this.boundingBox!==null&&vn.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,vn)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new K,t=this.geometry.attributes.skinWeight;for(let s=0,i=t.count;s<i;s++){e.fromBufferAttribute(t,s);const n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(s,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Or?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===QA?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const s=this.skeleton,i=this.geometry;_o.fromBufferAttribute(i.attributes.skinIndex,e),ko.fromBufferAttribute(i.attributes.skinWeight,e),Do.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let n=0;n<4;n++){const r=ko.getComponent(n);if(r!==0){const o=_o.getComponent(n);Lo.multiplyMatrices(s.bones[o].matrixWorld,s.boneInverses[o]),t.addScaledVector(Bh.copy(Do).applyMatrix4(Lo),r)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Go extends Y{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Gn extends ue{constructor(e=null,t=1,s=1,i,n,r,o,a,h=Me,c=Me,l,u){super(null,r,o,a,h,c,i,n,l,u),this.isDataTexture=!0,this.image={data:e,width:t,height:s},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Oo=new k,Qh=new k;class On{constructor(e=[],t=[]){this.uuid=Ne(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let s=0,i=this.bones.length;s<i;s++)this.boneInverses.push(new k)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const s=new k;this.bones[e]&&s.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(s)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const s=this.bones[e];s&&s.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const s=this.bones[e];s&&(s.parent&&s.parent.isBone?(s.matrix.copy(s.parent.matrixWorld).invert(),s.matrix.multiply(s.matrixWorld)):s.matrix.copy(s.matrixWorld),s.matrix.decompose(s.position,s.quaternion,s.scale))}}update(){const e=this.bones,t=this.boneInverses,s=this.boneMatrices,i=this.boneTexture;for(let n=0,r=e.length;n<r;n++){const o=e[n]?e[n].matrixWorld:Qh;Oo.multiplyMatrices(o,t[n]),Oo.toArray(s,n*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new On(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const s=new Gn(t,e,e,ct,ht);return s.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=s,this}getBoneByName(e){for(let t=0,s=this.bones.length;t<s;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let s=0,i=e.bones.length;s<i;s++){const n=e.bones[s];let r=t[n];r===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new Go),this.bones.push(r),this.boneInverses.push(new k().fromArray(e.boneInverses[s]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,s=this.boneInverses;for(let i=0,n=t.length;i<n;i++){const r=t[i];e.bones.push(r.uuid);const o=s[i];e.boneInverses.push(o.toArray())}return e}}class Un extends ye{constructor(e,t,s,i=1){super(e,t,s),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const es=new k,Uo=new k,xi=[],zo=new Ye,wh=new k,Ss=new mi,Ms=new Oe;class Th extends mi{constructor(e,t,s){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Un(new Float32Array(s*16),16),this.instanceColor=null,this.morphTexture=null,this.count=s,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<s;i++)this.setMatrixAt(i,wh)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Ye),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let s=0;s<t;s++)this.getMatrixAt(s,es),zo.copy(e.boundingBox).applyMatrix4(es),this.boundingBox.union(zo)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Oe),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let s=0;s<t;s++)this.getMatrixAt(s,es),Ms.copy(e.boundingSphere).applyMatrix4(es),this.boundingSphere.union(Ms)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const s=t.morphTargetInfluences,i=this.morphTexture.source.data.data,n=s.length+1,r=e*n+1;for(let o=0;o<s.length;o++)s[o]=i[r+o]}raycast(e,t){const s=this.matrixWorld,i=this.count;if(Ss.geometry=this.geometry,Ss.material=this.material,Ss.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ms.copy(this.boundingSphere),Ms.applyMatrix4(s),e.ray.intersectsSphere(Ms)!==!1))for(let n=0;n<i;n++){this.getMatrixAt(n,es),Uo.multiplyMatrices(s,es),Ss.matrixWorld=Uo,Ss.raycast(e,xi);for(let r=0,o=xi.length;r<o;r++){const a=xi[r];a.instanceId=n,a.object=this,t.push(a)}xi.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Un(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const s=t.morphTargetInfluences,i=s.length+1;this.morphTexture===null&&(this.morphTexture=new Gn(new Float32Array(i*this.count),i,this.count,vt,ht));const n=this.morphTexture.source.data.data;let r=0;for(let h=0;h<s.length;h++)r+=s[h];const o=this.geometry.morphTargetsRelative?1:1-r,a=i*e;n[a]=o,n.set(s,a+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class Po extends wt{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new X(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Qi=new b,wi=new b,Ho=new k,Ns=new oi,Ti=new Oe,zn=new b,qo=new b;class Pn extends Y{constructor(e=new Tt,t=new Po){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,s=[0];for(let i=1,n=t.count;i<n;i++)Qi.fromBufferAttribute(t,i-1),wi.fromBufferAttribute(t,i),s[i]=s[i-1],s[i]+=Qi.distanceTo(wi);e.setAttribute("lineDistance",new Nn(s,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const s=this.geometry,i=this.matrixWorld,n=e.params.Line.threshold,r=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),Ti.copy(s.boundingSphere),Ti.applyMatrix4(i),Ti.radius+=n,e.ray.intersectsSphere(Ti)===!1)return;Ho.copy(i).invert(),Ns.copy(e.ray).applyMatrix4(Ho);const o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=this.isLineSegments?2:1,c=s.index,u=s.attributes.position;if(c!==null){const d=Math.max(0,r.start),g=Math.min(c.count,r.start+r.count);for(let p=d,f=g-1;p<f;p+=h){const m=c.getX(p),E=c.getX(p+1),C=Si(this,e,Ns,a,m,E);C&&t.push(C)}if(this.isLineLoop){const p=c.getX(g-1),f=c.getX(d),m=Si(this,e,Ns,a,p,f);m&&t.push(m)}}else{const d=Math.max(0,r.start),g=Math.min(u.count,r.start+r.count);for(let p=d,f=g-1;p<f;p+=h){const m=Si(this,e,Ns,a,p,p+1);m&&t.push(m)}if(this.isLineLoop){const p=Si(this,e,Ns,a,g-1,d);p&&t.push(p)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}}function Si(A,e,t,s,i,n){const r=A.geometry.attributes.position;if(Qi.fromBufferAttribute(r,i),wi.fromBufferAttribute(r,n),t.distanceSqToSegment(Qi,wi,zn,qo)>s)return;zn.applyMatrix4(A.matrixWorld);const a=e.ray.origin.distanceTo(zn);if(!(a<e.near||a>e.far))return{distance:a,point:qo.clone().applyMatrix4(A.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:A}}const Vo=new b,jo=new b;class Sh extends Pn{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,s=[];for(let i=0,n=t.count;i<n;i+=2)Vo.fromBufferAttribute(t,i),jo.fromBufferAttribute(t,i+1),s[i]=i===0?0:s[i-1],s[i+1]=s[i]+Vo.distanceTo(jo);e.setAttribute("lineDistance",new Nn(s,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Mh extends Pn{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Jo extends wt{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new X(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Wo=new k,Hn=new oi,Mi=new Oe,Ni=new b;class Nh extends Y{constructor(e=new Tt,t=new Jo){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const s=this.geometry,i=this.matrixWorld,n=e.params.Points.threshold,r=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),Mi.copy(s.boundingSphere),Mi.applyMatrix4(i),Mi.radius+=n,e.ray.intersectsSphere(Mi)===!1)return;Wo.copy(i).invert(),Hn.copy(e.ray).applyMatrix4(Wo);const o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=s.index,l=s.attributes.position;if(h!==null){const u=Math.max(0,r.start),d=Math.min(h.count,r.start+r.count);for(let g=u,p=d;g<p;g++){const f=h.getX(g);Ni.fromBufferAttribute(l,f),Ko(Ni,f,a,i,e,t,this)}}else{const u=Math.max(0,r.start),d=Math.min(l.count,r.start+r.count);for(let g=u,p=d;g<p;g++)Ni.fromBufferAttribute(l,g),Ko(Ni,g,a,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}}function Ko(A,e,t,s,i,n,r){const o=Hn.distanceSqToPoint(A);if(o<t){const a=new b;Hn.closestPointToPoint(A,a),a.applyMatrix4(s);const h=i.ray.origin.distanceTo(a);if(h<i.near||h>i.far)return;n.push({distance:h,distanceToRay:Math.sqrt(o),point:a,index:e,face:null,faceIndex:null,barycoord:null,object:r})}}class Rh extends ue{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Me,this.minFilter=Me,this.generateMipmaps=!1,this.needsUpdate=!0}}class Ri extends ue{constructor(e,t,s,i,n,r,o,a,h,c,l,u){super(null,r,o,a,h,c,i,n,l,u),this.isCompressedTexture=!0,this.image={width:t,height:s},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Fh extends Ri{constructor(e,t,s,i,n,r){super(e,t,s,n,r),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ct,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Dh extends Ri{constructor(e,t,s){super(void 0,e[0].width,e[0].height,t,s,zr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class qn extends wt{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new X(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new X(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=An,this.normalScale=new q(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Jt,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ze extends qn{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new q(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ce(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new X(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new X(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new X(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Fi(A,e,t){return!A||!t&&A.constructor===e?A:typeof e.BYTES_PER_ELEMENT=="number"?new e(A):Array.prototype.slice.call(A)}function _h(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function kh(A){function e(i,n){return A[i]-A[n]}const t=A.length,s=new Array(t);for(let i=0;i!==t;++i)s[i]=i;return s.sort(e),s}function Yo(A,e,t){const s=A.length,i=new A.constructor(s);for(let n=0,r=0;r!==s;++n){const o=t[n]*e;for(let a=0;a!==e;++a)i[r++]=A[o+a]}return i}function Xo(A,e,t,s){let i=1,n=A[0];for(;n!==void 0&&n[s]===void 0;)n=A[i++];if(n===void 0)return;let r=n[s];if(r!==void 0)if(Array.isArray(r))do r=n[s],r!==void 0&&(e.push(n.time),t.push.apply(t,r)),n=A[i++];while(n!==void 0);else if(r.toArray!==void 0)do r=n[s],r!==void 0&&(e.push(n.time),r.toArray(t,t.length)),n=A[i++];while(n!==void 0);else do r=n[s],r!==void 0&&(e.push(n.time),t.push(r)),n=A[i++];while(n!==void 0)}class Rs{constructor(e,t,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,i=t[s],n=t[s-1];s:{e:{let r;t:{i:if(!(e<i)){for(let o=s+2;;){if(i===void 0){if(e<n)break i;return s=t.length,this._cachedIndex=s,this.copySampleValue_(s-1)}if(s===o)break;if(n=i,i=t[++s],e<i)break e}r=t.length;break t}if(!(e>=n)){const o=t[1];e<o&&(s=2,n=o);for(let a=s-2;;){if(n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===a)break;if(i=n,n=t[--s-1],e>=n)break e}r=s,s=0;break t}break s}for(;s<r;){const o=s+r>>>1;e<t[o]?r=o:s=o+1}if(i=t[s],n=t[s-1],n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return s=t.length,this._cachedIndex=s,this.copySampleValue_(s-1)}this._cachedIndex=s,this.intervalChanged_(s,n,i)}return this.interpolate_(s,n,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,i=this.valueSize,n=e*i;for(let r=0;r!==i;++r)t[r]=s[n+r];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Lh extends Rs{constructor(e,t,s,i){super(e,t,s,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Zr,endingEnd:Zr}}intervalChanged_(e,t,s){const i=this.parameterPositions;let n=e-2,r=e+1,o=i[n],a=i[r];if(o===void 0)switch(this.getSettings_().endingStart){case $r:n=e,o=2*t-s;break;case eo:n=i.length-2,o=t+i[n]-i[n+1];break;default:n=e,o=s}if(a===void 0)switch(this.getSettings_().endingEnd){case $r:r=e,a=2*s-t;break;case eo:r=1,a=s+i[1]-i[0];break;default:r=e-1,a=t}const h=(s-t)*.5,c=this.valueSize;this._weightPrev=h/(t-o),this._weightNext=h/(a-s),this._offsetPrev=n*c,this._offsetNext=r*c}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=e*o,h=a-o,c=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,d=this._weightNext,g=(s-t)/(i-t),p=g*g,f=p*g,m=-u*f+2*u*p-u*g,E=(1+u)*f+(-1.5-2*u)*p+(-.5+u)*g+1,C=(-1-d)*f+(1.5+d)*p+.5*g,y=d*f-d*p;for(let Q=0;Q!==o;++Q)n[Q]=m*r[c+Q]+E*r[h+Q]+C*r[a+Q]+y*r[l+Q];return n}}class vh extends Rs{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=e*o,h=a-o,c=(s-t)/(i-t),l=1-c;for(let u=0;u!==o;++u)n[u]=r[h+u]*l+r[a+u]*c;return n}}class Gh extends Rs{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Pe{constructor(e,t,s,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Fi(t,this.TimeBufferType),this.values=Fi(s,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let s;if(t.toJSON!==this.toJSON)s=t.toJSON(e);else{s={name:e.name,times:Fi(e.times,Array),values:Fi(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(s.interpolation=i)}return s.type=e.ValueTypeName,s}InterpolantFactoryMethodDiscrete(e){return new Gh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new vh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Lh(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Is:t=this.InterpolantFactoryMethodDiscrete;break;case bs:t=this.InterpolantFactoryMethodLinear;break;case on:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const s="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(s);return console.warn("THREE.KeyframeTrack:",s),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Is;case this.InterpolantFactoryMethodLinear:return bs;case this.InterpolantFactoryMethodSmooth:return on}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let s=0,i=t.length;s!==i;++s)t[s]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let s=0,i=t.length;s!==i;++s)t[s]*=e}return this}trim(e,t){const s=this.times,i=s.length;let n=0,r=i-1;for(;n!==i&&s[n]<e;)++n;for(;r!==-1&&s[r]>t;)--r;if(++r,n!==0||r!==i){n>=r&&(r=Math.max(r,1),n=r-1);const o=this.getValueSize();this.times=s.slice(n,r),this.values=this.values.slice(n*o,r*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,n=s.length;n===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let o=0;o!==n;o++){const a=s[o];if(typeof a=="number"&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,a),e=!1;break}if(r!==null&&r>a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,a,r),e=!1;break}r=a}if(i!==void 0&&_h(i))for(let o=0,a=i.length;o!==a;++o){const h=i[o];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===on,n=e.length-1;let r=1;for(let o=1;o<n;++o){let a=!1;const h=e[o],c=e[o+1];if(h!==c&&(o!==1||h!==e[0]))if(i)a=!0;else{const l=o*s,u=l-s,d=l+s;for(let g=0;g!==s;++g){const p=t[l+g];if(p!==t[u+g]||p!==t[d+g]){a=!0;break}}}if(a){if(o!==r){e[r]=e[o];const l=o*s,u=r*s;for(let d=0;d!==s;++d)t[u+d]=t[l+d]}++r}}if(n>0){e[r]=e[n];for(let o=n*s,a=r*s,h=0;h!==s;++h)t[a+h]=t[o+h];++r}return r!==e.length?(this.times=e.slice(0,r),this.values=t.slice(0,r*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,i=new s(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Pe.prototype.TimeBufferType=Float32Array,Pe.prototype.ValueBufferType=Float32Array,Pe.prototype.DefaultInterpolation=bs;class ts extends Pe{constructor(e,t,s){super(e,t,s)}}ts.prototype.ValueTypeName="bool",ts.prototype.ValueBufferType=Array,ts.prototype.DefaultInterpolation=Is,ts.prototype.InterpolantFactoryMethodLinear=void 0,ts.prototype.InterpolantFactoryMethodSmooth=void 0;class Zo extends Pe{}Zo.prototype.ValueTypeName="color";class ss extends Pe{}ss.prototype.ValueTypeName="number";class Oh extends Rs{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=(s-t)/(i-t);let h=e*o;for(let c=h+o;h!==c;h+=4)Ke.slerpFlat(n,0,r,h-o,r,h,a);return n}}class is extends Pe{InterpolantFactoryMethodLinear(e){return new Oh(this.times,this.values,this.getValueSize(),e)}}is.prototype.ValueTypeName="quaternion",is.prototype.InterpolantFactoryMethodSmooth=void 0;class ns extends Pe{constructor(e,t,s){super(e,t,s)}}ns.prototype.ValueTypeName="string",ns.prototype.ValueBufferType=Array,ns.prototype.DefaultInterpolation=Is,ns.prototype.InterpolantFactoryMethodLinear=void 0,ns.prototype.InterpolantFactoryMethodSmooth=void 0;class rs extends Pe{}rs.prototype.ValueTypeName="vector";class Uh{constructor(e="",t=-1,s=[],i=kA){this.name=e,this.tracks=s,this.duration=t,this.blendMode=i,this.uuid=Ne(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,i=1/(e.fps||1);for(let r=0,o=s.length;r!==o;++r)t.push(Ph(s[r]).scale(i));const n=new this(e.name,e.duration,t,e.blendMode);return n.uuid=e.uuid,n}static toJSON(e){const t=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let n=0,r=s.length;n!==r;++n)t.push(Pe.toJSON(s[n]));return i}static CreateFromMorphTargetSequence(e,t,s,i){const n=t.length,r=[];for(let o=0;o<n;o++){let a=[],h=[];a.push((o+n-1)%n,o,(o+1)%n),h.push(0,1,0);const c=kh(a);a=Yo(a,1,c),h=Yo(h,1,c),!i&&a[0]===0&&(a.push(n),h.push(h[0])),r.push(new ss(".morphTargetInfluences["+t[o].name+"]",a,h).scale(1/s))}return new this(e,-1,r)}static findByName(e,t){let s=e;if(!Array.isArray(e)){const i=e;s=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<s.length;i++)if(s[i].name===t)return s[i];return null}static CreateClipsFromMorphTargetSequences(e,t,s){const i={},n=/^([\w-]*?)([\d]+)$/;for(let o=0,a=e.length;o<a;o++){const h=e[o],c=h.name.match(n);if(c&&c.length>1){const l=c[1];let u=i[l];u||(i[l]=u=[]),u.push(h)}}const r=[];for(const o in i)r.push(this.CreateFromMorphTargetSequence(o,i[o],t,s));return r}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(l,u,d,g,p){if(d.length!==0){const f=[],m=[];Xo(d,f,m,g),f.length!==0&&p.push(new l(u,f,m))}},i=[],n=e.name||"default",r=e.fps||30,o=e.blendMode;let a=e.length||-1;const h=e.hierarchy||[];for(let l=0;l<h.length;l++){const u=h[l].keys;if(!(!u||u.length===0))if(u[0].morphTargets){const d={};let g;for(g=0;g<u.length;g++)if(u[g].morphTargets)for(let p=0;p<u[g].morphTargets.length;p++)d[u[g].morphTargets[p]]=-1;for(const p in d){const f=[],m=[];for(let E=0;E!==u[g].morphTargets.length;++E){const C=u[g];f.push(C.time),m.push(C.morphTarget===p?1:0)}i.push(new ss(".morphTargetInfluence["+p+"]",f,m))}a=d.length*r}else{const d=".bones["+t[l].name+"]";s(rs,d+".position",u,"pos",i),s(is,d+".quaternion",u,"rot",i),s(rs,d+".scale",u,"scl",i)}}return i.length===0?null:new this(n,a,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let s=0,i=e.length;s!==i;++s){const n=this.tracks[s];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function zh(A){switch(A.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ss;case"vector":case"vector2":case"vector3":case"vector4":return rs;case"color":return Zo;case"quaternion":return is;case"bool":case"boolean":return ts;case"string":return ns}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+A)}function Ph(A){if(A.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=zh(A.type);if(A.times===void 0){const t=[],s=[];Xo(A.keys,t,s,"value"),A.times=t,A.values=s}return e.parse!==void 0?e.parse(A):new e(A.name,A.times,A.values,A.interpolation)}const It={enabled:!1,files:{},add:function(A,e){this.enabled!==!1&&(this.files[A]=e)},get:function(A){if(this.enabled!==!1)return this.files[A]},remove:function(A){delete this.files[A]},clear:function(){this.files={}}};class Hh{constructor(e,t,s){const i=this;let n=!1,r=0,o=0,a;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=s,this.itemStart=function(c){o++,n===!1&&i.onStart!==void 0&&i.onStart(c,r,o),n=!0},this.itemEnd=function(c){r++,i.onProgress!==void 0&&i.onProgress(c,r,o),r===o&&(n=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(c){i.onError!==void 0&&i.onError(c)},this.resolveURL=function(c){return a?a(c):c},this.setURLModifier=function(c){return a=c,this},this.addHandler=function(c,l){return h.push(c,l),this},this.removeHandler=function(c){const l=h.indexOf(c);return l!==-1&&h.splice(l,2),this},this.getHandler=function(c){for(let l=0,u=h.length;l<u;l+=2){const d=h[l],g=h[l+1];if(d.global&&(d.lastIndex=0),d.test(c))return g}return null}}}const qh=new Hh;class bt{constructor(e){this.manager=e!==void 0?e:qh,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const s=this;return new Promise(function(i,n){s.load(e,i,t,n)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}bt.DEFAULT_MATERIAL_NAME="__DEFAULT";const st={};class Vh extends Error{constructor(e,t){super(e),this.response=t}}class Rt extends bt{constructor(e){super(e)}load(e,t,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=It.get(e);if(n!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(n),this.manager.itemEnd(e)},0),n;if(st[e]!==void 0){st[e].push({onLoad:t,onProgress:s,onError:i});return}st[e]=[],st[e].push({onLoad:t,onProgress:s,onError:i});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(r).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const c=st[e],l=h.body.getReader(),u=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),d=u?parseInt(u):0,g=d!==0;let p=0;const f=new ReadableStream({start(m){E();function E(){l.read().then(({done:C,value:y})=>{if(C)m.close();else{p+=y.byteLength;const Q=new ProgressEvent("progress",{lengthComputable:g,loaded:p,total:d});for(let M=0,S=c.length;M<S;M++){const R=c[M];R.onProgress&&R.onProgress(Q)}m.enqueue(y),E()}},C=>{m.error(C)})}}});return new Response(f)}else throw new Vh(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(a){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return h.json();default:if(o===void 0)return h.text();{const l=/charset="?([^;"\s]*)"?/i.exec(o),u=l&&l[1]?l[1].toLowerCase():void 0,d=new TextDecoder(u);return h.arrayBuffer().then(g=>d.decode(g))}}}).then(h=>{It.add(e,h);const c=st[e];delete st[e];for(let l=0,u=c.length;l<u;l++){const d=c[l];d.onLoad&&d.onLoad(h)}}).catch(h=>{const c=st[e];if(c===void 0)throw this.manager.itemError(e),h;delete st[e];for(let l=0,u=c.length;l<u;l++){const d=c[l];d.onError&&d.onError(h)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class jh extends bt{constructor(e){super(e)}load(e,t,s,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=this,r=It.get(e);if(r!==void 0)return n.manager.itemStart(e),setTimeout(function(){t&&t(r),n.manager.itemEnd(e)},0),r;const o=un("img");function a(){c(),It.add(e,this),t&&t(this),n.manager.itemEnd(e)}function h(l){c(),i&&i(l),n.manager.itemError(e),n.manager.itemEnd(e)}function c(){o.removeEventListener("load",a,!1),o.removeEventListener("error",h,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",h,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),n.manager.itemStart(e),o.src=e,o}}class Jh extends bt{constructor(e){super(e)}load(e,t,s,i){const n=new ue,r=new jh(this.manager);return r.setCrossOrigin(this.crossOrigin),r.setPath(this.path),r.load(e,function(o){n.image=o,n.needsUpdate=!0,t!==void 0&&t(n)},s,i),n}}class Vn extends Y{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new X(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const jn=new k,$o=new b,ea=new b;class Jn{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new q(512,512),this.map=null,this.mapPass=null,this.matrix=new k,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ch,this._frameExtents=new q(1,1),this._viewportCount=1,this._viewports=[new K(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;$o.setFromMatrixPosition(e.matrixWorld),t.position.copy($o),ea.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(ea),t.updateMatrixWorld(),jn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(jn),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(jn)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Wh extends Jn{constructor(){super(new Dn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=Es*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,n=e.distance||t.far;(s!==t.fov||i!==t.aspect||n!==t.far)&&(t.fov=s,t.aspect=i,t.far=n,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Kh extends Vn{constructor(e,t,s=0,i=Math.PI/3,n=0,r=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Y.DEFAULT_UP),this.updateMatrix(),this.target=new Y,this.distance=s,this.angle=i,this.penumbra=n,this.decay=r,this.map=null,this.shadow=new Wh}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const ta=new k,Fs=new b,Wn=new b;class Yh extends Jn{constructor(){super(new Dn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new q(4,2),this._viewportCount=6,this._viewports=[new K(2,1,1,1),new K(0,1,1,1),new K(3,1,1,1),new K(1,1,1,1),new K(3,0,1,1),new K(1,0,1,1)],this._cubeDirections=[new b(1,0,0),new b(-1,0,0),new b(0,0,1),new b(0,0,-1),new b(0,1,0),new b(0,-1,0)],this._cubeUps=[new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,0,1),new b(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,i=this.matrix,n=e.distance||s.far;n!==s.far&&(s.far=n,s.updateProjectionMatrix()),Fs.setFromMatrixPosition(e.matrixWorld),s.position.copy(Fs),Wn.copy(s.position),Wn.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(Wn),s.updateMatrixWorld(),i.makeTranslation(-Fs.x,-Fs.y,-Fs.z),ta.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ta)}}class Xh extends Vn{constructor(e,t,s=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new Yh}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Zh extends Jn{constructor(){super(new No(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class $h extends Vn{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Y.DEFAULT_UP),this.updateMatrix(),this.target=new Y,this.shadow=new Zh}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Ds{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,i=e.length;s<i;s++)t+=String.fromCharCode(e[s]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class ec extends bt{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=this,r=It.get(e);if(r!==void 0){if(n.manager.itemStart(e),r.then){r.then(h=>{t&&t(h),n.manager.itemEnd(e)}).catch(h=>{i&&i(h)});return}return setTimeout(function(){t&&t(r),n.manager.itemEnd(e)},0),r}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const a=fetch(e,o).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(n.options,{colorSpaceConversion:"none"}))}).then(function(h){return It.add(e,h),t&&t(h),n.manager.itemEnd(e),h}).catch(function(h){i&&i(h),It.remove(e),n.manager.itemError(e),n.manager.itemEnd(e)});It.add(e,a),n.manager.itemStart(e)}}const Kn="\\[\\]\\.:\\/",tc=new RegExp("["+Kn+"]","g"),Yn="[^"+Kn+"]",sc="[^"+Kn.replace("\\.","")+"]",ic=/((?:WC+[\/:])*)/.source.replace("WC",Yn),nc=/(WCOD+)?/.source.replace("WCOD",sc),rc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Yn),oc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Yn),ac=new RegExp("^"+ic+nc+rc+oc+"$"),Ac=["material","materials","bones","map"];class hc{constructor(e,t,s){const i=s||P.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=s.length;i!==n;++i)s[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class P{constructor(e,t,s){this.path=t,this.parsedPath=s||P.parseTrackName(t),this.node=P.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new P.Composite(e,t,s):new P(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tc,"")}static parseTrackName(e){const t=ac.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const n=s.nodeName.substring(i+1);Ac.indexOf(n)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=n)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(n,r){for(let o=0;o<n.length;o++){const a=n[o];if(!r&&(a.name===t||a.uuid===t))return a;if(r&&a.userData&&a.userData.name===t)return a;const h=s(a.children,r);if(h)return h}return null},i=s(e.children);if(i)return i;{const n=s(e.children,!0);if(n)return n}}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)e[t++]=s[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,s=t.objectName,i=t.propertyName;let n=t.propertyIndex;if(e||(e=P.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(s){let h=t.objectIndex;switch(s){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let c=0;c<e.length;c++)if(e[c].name===h){h=c;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[s]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[s]}if(h!==void 0){if(e[h]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}const r=e[i];if(r===void 0){const h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(n!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[n]!==void 0&&(n=e.morphTargetDictionary[n])}a=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=n}else r.fromArray!==void 0&&r.toArray!==void 0?(a=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(a=this.BindingType.EntireArray,this.resolvedProperty=r):this.propertyName=i;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}P.Composite=hc,P.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},P.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},P.prototype.GetterByBindingType=[P.prototype._getValue_direct,P.prototype._getValue_array,P.prototype._getValue_arrayElement,P.prototype._getValue_toArray],P.prototype.SetterByBindingTypeAndVersioning=[[P.prototype._setValue_direct,P.prototype._setValue_direct_setNeedsUpdate,P.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[P.prototype._setValue_array,P.prototype._setValue_array_setNeedsUpdate,P.prototype._setValue_array_setMatrixWorldNeedsUpdate],[P.prototype._setValue_arrayElement,P.prototype._setValue_arrayElement_setNeedsUpdate,P.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[P.prototype._setValue_fromArray,P.prototype._setValue_fromArray_setNeedsUpdate,P.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];function Xn(A,e=0){let t=3735928559^e,s=1103547991^e;if(A instanceof Array)for(let i=0,n;i<A.length;i++)n=A[i],t=Math.imul(t^n,2654435761),s=Math.imul(s^n,1597334677);else for(let i=0,n;i<A.length;i++)n=A.charCodeAt(i),t=Math.imul(t^n,2654435761),s=Math.imul(s^n,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&s)+(t>>>0)}const cc=(...A)=>Xn(A);function lc(A,e=!1){const t=[];A.isNode===!0&&(t.push(A.id),A=A.getSelf());for(const{property:s,childNode:i}of Zn(A))t.push(t,Xn(s.slice(0,-4)),i.getCacheKey(e));return Xn(t)}function*Zn(A,e=!1){for(const t in A){if(t.startsWith("_")===!0)continue;const s=A[t];if(Array.isArray(s)===!0)for(let i=0;i<s.length;i++){const n=s[i];n&&(n.isNode===!0||e&&typeof n.toJSON=="function")&&(yield{property:t,index:i,childNode:n})}else if(s&&s.isNode===!0)yield{property:t,childNode:s};else if(typeof s=="object")for(const i in s){const n=s[i];n&&(n.isNode===!0||e&&typeof n.toJSON=="function")&&(yield{property:t,index:i,childNode:n})}}}function Di(A){if(A==null)return null;const e=typeof A;return A.isNode===!0?"node":e==="number"?"float":e==="boolean"?"bool":e==="string"?"string":e==="function"?"shader":A.isVector2===!0?"vec2":A.isVector3===!0?"vec3":A.isVector4===!0?"vec4":A.isMatrix3===!0?"mat3":A.isMatrix4===!0?"mat4":A.isColor===!0?"color":A instanceof ArrayBuffer?"ArrayBuffer":null}function sa(A,...e){const t=A?A.slice(-4):void 0;return e.length===1&&(t==="vec2"?e=[e[0],e[0]]:t==="vec3"?e=[e[0],e[0],e[0]]:t==="vec4"&&(e=[e[0],e[0],e[0],e[0]])),A==="color"?new X(...e):t==="vec2"?new q(...e):t==="vec3"?new b(...e):t==="vec4"?new K(...e):t==="mat3"?new Fe(...e):t==="mat4"?new k(...e):A==="bool"?e[0]||!1:A==="float"||A==="int"||A==="uint"?e[0]||0:A==="string"?e[0]||"":A==="ArrayBuffer"?dc(e[0]):null}function uc(A){let e="";const t=new Uint8Array(A);for(let s=0;s<t.length;s++)e+=String.fromCharCode(t[s]);return btoa(e)}function dc(A){return Uint8Array.from(atob(A),e=>e.charCodeAt(0)).buffer}const ia={VERTEX:"vertex"},$={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},_s=["x","y","z","w"];let gc=0;class L extends Ut{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=$.NONE,this.updateBeforeType=$.NONE,this.updateAfterType=$.NONE,this.uuid=Ao.generateUUID(),this.version=0,this._cacheKey=null,this._cacheKeyVersion=0,this.global=!1,this.isNode=!0,Object.defineProperty(this,"id",{value:gc++})}set needsUpdate(e){e===!0&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,$.FRAME)}onRenderUpdate(e){return this.onUpdate(e,$.RENDER)}onObjectUpdate(e){return this.onUpdate(e,$.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of Zn(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return e=e||this.version!==this._cacheKeyVersion,(e===!0||this._cacheKey===null)&&(this._cacheKey=lc(this,e),this._cacheKeyVersion=this.version),this._cacheKey}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let s=0;for(const i of this.getChildren())t["node"+s++]=i;return null}analyze(e){if(e.increaseUsage(this)===1){const s=e.getNodeProperties(this);for(const i of Object.values(s))i&&i.isNode===!0&&i.build(e)}}generate(e,t){const{outputNode:s}=e.getNodeProperties(this);if(s&&s.isNode===!0)return s.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const s=this.getShared(e);if(this!==s)return s.build(e,t);e.addNode(this),e.addChain(this);let i=null;const n=e.getBuildStage();if(n==="setup"){this.updateReference(e);const r=e.getNodeProperties(this);if(r.initialized!==!0){const o=e.stack.nodes.length;r.initialized=!0,r.outputNode=this.setup(e),r.outputNode!==null&&e.stack.nodes.length;for(const a of Object.values(r))a&&a.isNode===!0&&a.build(e)}}else if(n==="analyze")this.analyze(e);else if(n==="generate")if(this.generate.length===1){const o=this.getNodeType(e),a=e.getDataFromNode(this);i=a.snippet,i===void 0?(i=this.generate(e)||"",a.snippet=i):a.flowCodes!==void 0&&e.context.nodeBlock!==void 0&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),i=e.format(i,o,t)}else i=this.generate(e,t)||"";return e.removeChain(this),i}getSerializeChildren(){return Zn(this)}serialize(e){const t=this.getSerializeChildren(),s={};for(const{property:i,index:n,childNode:r}of t)n!==void 0?(s[i]===void 0&&(s[i]=Number.isInteger(n)?[]:{}),s[i][n]=r.toJSON(e.meta).uuid):s[i]=r.toJSON(e.meta).uuid;Object.keys(s).length>0&&(e.inputNodes=s)}deserialize(e){if(e.inputNodes!==void 0){const t=e.meta.nodes;for(const s in e.inputNodes)if(Array.isArray(e.inputNodes[s])){const i=[];for(const n of e.inputNodes[s])i.push(t[n]);this[s]=i}else if(typeof e.inputNodes[s]=="object"){const i={};for(const n in e.inputNodes[s]){const r=e.inputNodes[s][n];i[n]=t[r]}this[s]=i}else{const i=e.inputNodes[s];this[s]=t[i]}}}toJSON(e){const{uuid:t,type:s}=this,i=e===void 0||typeof e=="string";i&&(e={textures:{},images:{},nodes:{}});let n=e.nodes[t];n===void 0&&(n={uuid:t,type:s,meta:e,metadata:{version:4.6,type:"Node",generator:"Node.toJSON"}},i!==!0&&(e.nodes[n.uuid]=n),this.serialize(n),delete n.meta);function r(o){const a=[];for(const h in o){const c=o[h];delete c.metadata,a.push(c)}return a}if(i){const o=r(e.textures),a=r(e.images),h=r(e.nodes);o.length>0&&(n.textures=o),a.length>0&&(n.images=a),h.length>0&&(n.nodes=h)}return n}}class ks extends L{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.node.build(e),s=this.indexNode.build(e,"uint");return`${t}[ ${s} ]`}}class na extends L{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let s=null;for(const i of this.convertTo.split("|"))(s===null||e.getTypeLength(t)===e.getTypeLength(i))&&(s=i);return s}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const s=this.node,i=this.getNodeType(e),n=s.build(e,i);return e.format(n,i,t)}}class me extends L{static get type(){return"TempNode"}constructor(e){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if(e.getBuildStage()==="generate"){const i=e.getVectorType(this.getNodeType(e,t)),n=e.getDataFromNode(this);if(n.propertyName!==void 0)return e.format(n.propertyName,i,t);if(i!=="void"&&t!=="void"&&this.hasDependencies(e)){const r=super.build(e,i),o=e.getVarFromNode(this,null,i),a=e.getPropertyName(o);return e.addLineFlowCode(`${a} = ${r}`,this),n.snippet=r,n.propertyName=a,e.format(n.propertyName,i,t)}}return super.build(e,t)}}class pc extends me{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return this.nodeType!==null?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce((t,s)=>t+e.getTypeLength(s.getNodeType(e)),0))}generate(e,t){const s=this.getNodeType(e),i=this.nodes,n=e.getComponentType(s),r=[];for(const a of i){let h=a.build(e);const c=e.getComponentType(a.getNodeType(e));c!==n&&(h=e.format(h,c,n)),r.push(h)}const o=`${e.getType(s)}( ${r.join(", ")} )`;return e.format(o,s,t)}}const fc=_s.join("");class ra extends L{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(_s.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const s=this.node,i=e.getTypeLength(s.getNodeType(e));let n=null;if(i>1){let r=null;this.getVectorLength()>=i&&(r=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=s.build(e,r);this.components.length===i&&this.components===fc.slice(0,this.components.length)?n=e.format(a,r,t):n=e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else n=s.build(e,t);return n}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class mc extends me{static get type(){return"SetNode"}constructor(e,t,s){super(),this.sourceNode=e,this.components=t,this.targetNode=s}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:s,targetNode:i}=this,n=this.getNodeType(e),r=e.getTypeFromLength(s.length,i.getNodeType(e)),o=i.build(e,r),a=t.build(e,n),h=e.getTypeLength(n),c=[];for(let l=0;l<h;l++){const u=_s[l];u===s[0]?(c.push(o),l+=s.length-1):c.push(a+"."+u)}return`${e.getType(n)}( ${c.join(", ")} )`}}class Ic extends me{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:s}=this,i=this.getNodeType(e),n=s.build(e),r=e.getVarFromNode(this),o=e.getPropertyName(r);e.addLineFlowCode(o+" = "+n,this);const a=e.getTypeLength(i),h=[];let c=0;for(let l=0;l<a;l++){const u=_s[l];u===t[c]?(h.push("1.0 - "+(o+"."+u)),c++):h.push(o+"."+u)}return`${e.getType(i)}( ${h.join(", ")} )`}}class $n extends L{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}getNodeType(){return this.nodeType===null?Di(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=Di(this.value),e.nodeType=this.nodeType,e.valueType==="ArrayBuffer"&&(e.value=uc(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?sa(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){console.warn("Abstract function.")}}class it extends $n{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const s=this.getNodeType(e);return e.format(this.generateConst(e),s,t)}}let oa=null;const os=new Map;function x(A,e){if(os.has(A)){console.warn(`Redefinition of method chaining ${A}`);return}if(typeof e!="function")throw new Error(`Node element ${A} is not a function`);os.set(A,e)}const aa=A=>A.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),Aa=A=>aa(A).split("").sort().join(""),ha={setup(A,e){const t=e.shift();return A(Li(t),...e)},get(A,e,t){if(typeof e=="string"&&A[e]===void 0){if(A.isStackNode!==!0&&e==="assign")return(...s)=>(oa.assign(t,...s),t);if(os.has(e)){const s=os.get(e);return A.isStackNode?(...i)=>t.add(s(...i)):(...i)=>s(t,...i)}else{if(e==="self")return A;if(e.endsWith("Assign")&&os.has(e.slice(0,e.length-6))){const s=os.get(e.slice(0,e.length-6));return A.isStackNode?(...i)=>t.assign(i[0],s(...i)):(...i)=>t.assign(s(t,...i))}else{if(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0)return e=aa(e),T(new ra(t,e));if(/^set[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=Aa(e.slice(3).toLowerCase()),s=>T(new mc(A,e,s));if(/^flip[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=Aa(e.slice(4).toLowerCase()),()=>T(new Ic(T(A),e));if(e==="width"||e==="height"||e==="depth")return e==="width"?e="x":e==="height"?e="y":e==="depth"&&(e="z"),T(new ra(A,e));if(/^\d+$/.test(e)===!0)return T(new ks(t,new it(Number(e),"uint")))}}}return Reflect.get(A,e,t)},set(A,e,t,s){return typeof e=="string"&&A[e]===void 0&&(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0||e==="width"||e==="height"||e==="depth"||/^\d+$/.test(e)===!0)?(s[e].assign(t),!0):Reflect.set(A,e,t,s)}},er=new WeakMap,ca=new WeakMap,bc=function(A,e=null){const t=Di(A);if(t==="node"){let s=er.get(A);return s===void 0&&(s=new Proxy(A,ha),er.set(A,s),er.set(s,s)),s}else{if(e===null&&(t==="float"||t==="boolean")||t&&t!=="shader"&&t!=="string")return T(nr(A,e));if(t==="shader")return te(A)}return A},yc=function(A,e=null){for(const t in A)A[t]=T(A[t],e);return A},Ec=function(A,e=null){const t=A.length;for(let s=0;s<t;s++)A[s]=T(A[s],e);return A},Cc=function(A,e=null,t=null,s=null){const i=n=>T(s!==null?Object.assign(n,s):n);return e===null?(...n)=>i(new A(...as(n))):t!==null?(t=T(t),(...n)=>i(new A(e,...as(n),t))):(...n)=>i(new A(e,...as(n)))},Bc=function(A,...e){return T(new A(...as(e)))};class xc extends L{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}call(e){const{shaderNode:t,inputNodes:s}=this,i=e.getNodeProperties(t);if(i.onceOutput)return i.onceOutput;let n=null;if(t.layout){let r=ca.get(e.constructor);r===void 0&&(r=new WeakMap,ca.set(e.constructor,r));let o=r.get(t);o===void 0&&(o=T(e.buildFunctionNode(t)),r.set(t,o)),e.currentFunctionNode!==null&&e.currentFunctionNode.includes.push(o),n=T(o.call(s))}else{const r=t.jsFunc,o=s!==null?r(s,e):r(e);n=T(o)}return t.once&&(i.onceOutput=n),n}getOutputNode(e){const t=e.getNodeProperties(this);return t.outputNode===null&&(t.outputNode=this.setupOutput(e)),t.outputNode}setup(e){return this.getOutputNode(e)}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}generate(e,t){return this.getOutputNode(e).build(e,t)}}class Qc extends L{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}call(e=null){return Li(e),T(new xc(this,e))}setup(){return this.call()}}const wc=[!1,!0],Tc=[0,1,2,3],Sc=[-1,-2],la=[.5,1.5,1/3,1e-6,1e6,Math.PI,Math.PI*2,1/Math.PI,2/Math.PI,1/(Math.PI*2),Math.PI/2],tr=new Map;for(const A of wc)tr.set(A,new it(A));const sr=new Map;for(const A of Tc)sr.set(A,new it(A,"uint"));const ir=new Map([...sr].map(A=>new it(A.value,"int")));for(const A of Sc)ir.set(A,new it(A,"int"));const _i=new Map([...ir].map(A=>new it(A.value)));for(const A of la)_i.set(A,new it(A));for(const A of la)_i.set(-A,new it(-A));const ki={bool:tr,uint:sr,ints:ir,float:_i},ua=new Map([...tr,..._i]),nr=(A,e)=>ua.has(A)?ua.get(A):A.isNode===!0?A:new it(A,e),Mc=A=>{try{return A.getNodeType()}catch{return}},ee=function(A,e=null){return(...t)=>{if((t.length===0||!["bool","float","int","uint"].includes(A)&&t.every(i=>typeof i!="object"))&&(t=[sa(A,...t)]),t.length===1&&e!==null&&e.has(t[0]))return T(e.get(t[0]));if(t.length===1){const i=nr(t[0],A);return Mc(i)===A?T(i):T(new na(i,A))}const s=t.map(i=>nr(i));return T(new pc(s,A))}},Nc=A=>A!=null?A.nodeType||A.convertTo||(typeof A=="string"?A:null):null;function Rc(A,e){return new Proxy(new Qc(A,e),ha)}const T=(A,e=null)=>bc(A,e),Li=(A,e=null)=>new yc(A,e),as=(A,e=null)=>new Ec(A,e),w=(...A)=>new Cc(...A),N=(...A)=>new Bc(...A),te=(A,e)=>{const t=new Rc(A,e),s=(...i)=>{let n;return Li(i),i[0]&&i[0].isNode?n=[...i]:n=i[0],t.call(n)};return s.shaderNode=t,s.setLayout=i=>(t.setLayout(i),s),s.once=()=>(t.once=!0,s),s};x("toGlobal",A=>(A.global=!0,A));const rr=(...A)=>oa.If(...A);function Fc(A){return A}x("append",Fc);const Dc=new ee("color"),U=new ee("float",ki.float),As=new ee("int",ki.ints),_c=new ee("uint",ki.uint),kc=new ee("bool",ki.bool),F=new ee("vec2"),Lc=new ee("ivec2"),vc=new ee("uvec2"),Gc=new ee("bvec2"),v=new ee("vec3"),Oc=new ee("ivec3"),Uc=new ee("uvec3"),zc=new ee("bvec3"),hs=new ee("vec4"),Pc=new ee("ivec4"),Hc=new ee("uvec4"),qc=new ee("bvec4"),da=new ee("mat2"),vi=new ee("mat3"),Vc=new ee("mat4");x("toColor",Dc),x("toFloat",U),x("toInt",As),x("toUint",_c),x("toBool",kc),x("toVec2",F),x("toIVec2",Lc),x("toUVec2",vc),x("toBVec2",Gc),x("toVec3",v),x("toIVec3",Oc),x("toUVec3",Uc),x("toBVec3",zc),x("toVec4",hs),x("toIVec4",Pc),x("toUVec4",Hc),x("toBVec4",qc),x("toMat2",da),x("toMat3",vi),x("toMat4",Vc);const jc=w(ks),Jc=(A,e)=>T(new na(T(A),e));x("element",jc),x("convert",Jc);class ga extends L{static get type(){return"UniformGroupNode"}constructor(e,t=!1,s=1){super("string"),this.name=e,this.version=0,this.shared=t,this.order=s,this.isUniformGroup=!0}set needsUpdate(e){e===!0&&this.version++}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const Wc=A=>new ga(A),Ft=((A,e=0)=>new ga(A,!0,e))("render"),Kc=Wc("object");class cs extends $n{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=Kc}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const s=this.getSelf();return e=e.bind(s),super.onUpdate(i=>{const n=e(i,s);n!==void 0&&(this.value=n)},t)}generate(e,t){const s=this.getNodeType(e),i=this.getUniformHash(e);let n=e.getNodeFromHash(i);n===void 0&&(e.setHashNode(this,i),n=this);const r=n.getInputType(e),o=e.getUniformFromNode(n,r,e.shaderStage,this.name||e.context.label),a=e.getPropertyName(o);return e.context.label!==void 0&&delete e.context.label,e.format(a,s,t)}}const Ce=(A,e)=>{const t=Nc(e||A),s=A&&A.isNode===!0?A.node&&A.node.value||A.value:A;return T(new cs(s,t))};class pa extends L{static get type(){return"PropertyNode"}constructor(e,t=null,s=!1){super(e),this.name=t,this.varying=s,this.isPropertyNode=!0}getHash(e){return this.name||super.getHash(e)}isGlobal(){return!0}generate(e){let t;return this.varying===!0?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const ls=(A,e)=>T(new pa(A,e)),fa=N(pa,"vec4","DiffuseColor");class Yc extends me{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t}hasDependencies(){return!1}getNodeType(e,t){return t!=="void"?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(e.isAvailable("swizzleAssign")===!1&&t.isSplitNode&&t.components.length>1){const s=e.getTypeLength(t.node.getNodeType(e));return _s.join("").slice(0,s)!==t.components}return!1}generate(e,t){const{targetNode:s,sourceNode:i}=this,n=this.needsSplitAssign(e),r=s.getNodeType(e),o=s.context({assign:!0}).build(e),a=i.build(e,r),h=i.getNodeType(e),c=e.getDataFromNode(this);let l;if(c.initialized===!0)t!=="void"&&(l=o);else if(n){const u=e.getVarFromNode(this,null,r),d=e.getPropertyName(u);e.addLineFlowCode(`${d} = ${a}`,this);const g=s.node.context({assign:!0}).build(e);for(let p=0;p<s.components.length;p++){const f=s.components[p];e.addLineFlowCode(`${g}.${f} = ${d}[ ${p} ]`,this)}t!=="void"&&(l=o)}else l=`${o} = ${a}`,(t==="void"||h==="void")&&(e.addLineFlowCode(l,this),t!=="void"&&(l=o));return c.initialized=!0,e.format(l,r,t)}}x("assign",w(Yc));class Xc extends me{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}generate(e){const t=[],s=this.functionNode,i=s.getInputs(e),n=this.parameters;if(Array.isArray(n))for(let o=0;o<n.length;o++){const a=i[o],h=n[o];t.push(h.build(e,a.type))}else for(const o of i){const a=n[o.name];if(a!==void 0)t.push(a.build(e,o.type));else throw new Error(`FunctionCallNode: Input '${o.name}' not found in FunctionNode.`)}return`${s.build(e,"property")}( ${t.join(", ")} )`}}x("call",(A,...e)=>(e=e.length>1||e[0]&&e[0].isNode===!0?as(e):Li(e[0]),T(new Xc(T(A),e))));class J extends me{static get type(){return"OperatorNode"}constructor(e,t,s,...i){if(super(),i.length>0){let n=new J(e,t,s);for(let r=0;r<i.length-1;r++)n=new J(e,n,i[r]);t=n,s=i[i.length-1]}this.op=e,this.aNode=t,this.bNode=s}getNodeType(e,t){const s=this.op,i=this.aNode,n=this.bNode,r=i.getNodeType(e),o=typeof n<"u"?n.getNodeType(e):null;if(r==="void"||o==="void")return"void";if(s==="%")return r;if(s==="~"||s==="&"||s==="|"||s==="^"||s===">>"||s==="<<")return e.getIntegerType(r);if(s==="!"||s==="=="||s==="&&"||s==="||"||s==="^^")return"bool";if(s==="<"||s===">"||s==="<="||s===">="){const a=t?e.getTypeLength(t):Math.max(e.getTypeLength(r),e.getTypeLength(o));return a>1?`bvec${a}`:"bool"}else return r==="float"&&e.isMatrix(o)?o:e.isMatrix(r)&&e.isVector(o)?e.getVectorFromMatrix(r):e.isVector(r)&&e.isMatrix(o)?e.getVectorFromMatrix(o):e.getTypeLength(o)>e.getTypeLength(r)?o:r}generate(e,t){const s=this.op,i=this.aNode,n=this.bNode,r=this.getNodeType(e,t);let o=null,a=null;r!=="void"?(o=i.getNodeType(e),a=typeof n<"u"?n.getNodeType(e):null,s==="<"||s===">"||s==="<="||s===">="||s==="=="?e.isVector(o)?a=o:o!==a&&(o=a="float"):s===">>"||s==="<<"?(o=r,a=e.changeComponentType(a,"uint")):e.isMatrix(o)&&e.isVector(a)?a=e.getVectorFromMatrix(o):e.isVector(o)&&e.isMatrix(a)?o=e.getVectorFromMatrix(a):o=a=r):o=a=r;const h=i.build(e,o),c=typeof n<"u"?n.build(e,a):null,l=e.getTypeLength(t),u=e.getFunctionOperator(s);if(t!=="void")return s==="<"&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("lessThan",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} < ${c} )`,r,t):s==="<="&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("lessThanEqual",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} <= ${c} )`,r,t):s===">"&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("greaterThan",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} > ${c} )`,r,t):s===">="&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("greaterThanEqual",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} >= ${c} )`,r,t):s==="!"||s==="~"?e.format(`(${s}${h})`,o,t):u?e.format(`${u}( ${h}, ${c} )`,r,t):e.format(`( ${h} ${s} ${c} )`,r,t);if(o!=="void")return u?e.format(`${u}( ${h}, ${c} )`,r,t):e.format(`${h} ${s} ${c}`,r,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const Dt=w(J,"+"),Gi=w(J,"-"),Oi=w(J,"*"),ma=w(J,"/"),Ia=w(J,"%"),Zc=w(J,"=="),$c=w(J,"!="),el=w(J,"<"),tl=w(J,">"),sl=w(J,"<="),il=w(J,">="),nl=w(J,"&&"),rl=w(J,"||"),ol=w(J,"!"),al=w(J,"^^"),Al=w(J,"&"),hl=w(J,"~"),cl=w(J,"|"),ll=w(J,"^"),ul=w(J,"<<"),dl=w(J,">>");x("add",Dt),x("sub",Gi),x("mul",Oi),x("div",ma),x("modInt",Ia),x("equal",Zc),x("notEqual",$c),x("lessThan",el),x("greaterThan",tl),x("lessThanEqual",sl),x("greaterThanEqual",il),x("and",nl),x("or",rl),x("not",ol),x("xor",al),x("bitAnd",Al),x("bitNot",hl),x("bitOr",cl),x("bitXor",ll),x("shiftLeft",ul),x("shiftRight",dl),x("remainder",(...A)=>(console.warn("TSL.OperatorNode: .remainder() has been renamed to .modInt()."),Ia(...A)));class I extends me{static get type(){return"MathNode"}constructor(e,t,s=null,i=null){super(),this.method=e,this.aNode=t,this.bNode=s,this.cNode=i}getInputType(e){const t=this.aNode.getNodeType(e),s=this.bNode?this.bNode.getNodeType(e):null,i=this.cNode?this.cNode.getNodeType(e):null,n=e.isMatrix(t)?0:e.getTypeLength(t),r=e.isMatrix(s)?0:e.getTypeLength(s),o=e.isMatrix(i)?0:e.getTypeLength(i);return n>r&&n>o?t:r>o?s:o>n?i:t}getNodeType(e){const t=this.method;return t===I.LENGTH||t===I.DISTANCE||t===I.DOT?"float":t===I.CROSS?"vec3":t===I.ALL?"bool":t===I.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):t===I.MOD?this.aNode.getNodeType(e):this.getInputType(e)}generate(e,t){const s=this.method,i=this.getNodeType(e),n=this.getInputType(e),r=this.aNode,o=this.bNode,a=this.cNode,h=e.renderer.isWebGLRenderer===!0;if(s===I.TRANSFORM_DIRECTION){let c=r,l=o;e.isMatrix(c.getNodeType(e))?l=hs(v(l),0):c=hs(v(c),0);const u=Oi(c,l).xyz;return ba(u).build(e,t)}else{if(s===I.NEGATE)return e.format("( - "+r.build(e,n)+" )",i,t);if(s===I.ONE_MINUS)return Gi(1,r).build(e,t);if(s===I.RECIPROCAL)return ma(1,r).build(e,t);if(s===I.DIFFERENCE)return Ar(Gi(r,o)).build(e,t);{const c=[];return s===I.CROSS||s===I.MOD?c.push(r.build(e,i),o.build(e,i)):h&&s===I.STEP?c.push(r.build(e,e.getTypeLength(r.getNodeType(e))===1?"float":n),o.build(e,n)):h&&(s===I.MIN||s===I.MAX)||s===I.MOD?c.push(r.build(e,n),o.build(e,e.getTypeLength(o.getNodeType(e))===1?"float":n)):s===I.REFRACT?c.push(r.build(e,n),o.build(e,n),a.build(e,"float")):s===I.MIX?c.push(r.build(e,n),o.build(e,n),a.build(e,e.getTypeLength(a.getNodeType(e))===1?"float":n)):(c.push(r.build(e,n)),o!==null&&c.push(o.build(e,n)),a!==null&&c.push(a.build(e,n))),e.format(`${e.getMethod(s,i)}( ${c.join(", ")} )`,i,t)}}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}I.ALL="all",I.ANY="any",I.EQUALS="equals",I.RADIANS="radians",I.DEGREES="degrees",I.EXP="exp",I.EXP2="exp2",I.LOG="log",I.LOG2="log2",I.SQRT="sqrt",I.INVERSE_SQRT="inversesqrt",I.FLOOR="floor",I.CEIL="ceil",I.NORMALIZE="normalize",I.FRACT="fract",I.SIN="sin",I.COS="cos",I.TAN="tan",I.ASIN="asin",I.ACOS="acos",I.ATAN="atan",I.ABS="abs",I.SIGN="sign",I.LENGTH="length",I.NEGATE="negate",I.ONE_MINUS="oneMinus",I.DFDX="dFdx",I.DFDY="dFdy",I.ROUND="round",I.RECIPROCAL="reciprocal",I.TRUNC="trunc",I.FWIDTH="fwidth",I.BITCAST="bitcast",I.TRANSPOSE="transpose",I.ATAN2="atan2",I.MIN="min",I.MAX="max",I.MOD="mod",I.STEP="step",I.REFLECT="reflect",I.DISTANCE="distance",I.DIFFERENCE="difference",I.DOT="dot",I.CROSS="cross",I.POW="pow",I.TRANSFORM_DIRECTION="transformDirection",I.MIX="mix",I.CLAMP="clamp",I.REFRACT="refract",I.SMOOTHSTEP="smoothstep",I.FACEFORWARD="faceforward";const gl=U(Math.PI),pl=w(I,I.ALL),fl=w(I,I.ANY),ml=w(I,I.EQUALS),Il=w(I,I.RADIANS),bl=w(I,I.DEGREES),yl=w(I,I.EXP),El=w(I,I.EXP2),Cl=w(I,I.LOG),Bl=w(I,I.LOG2),or=w(I,I.SQRT),xl=w(I,I.INVERSE_SQRT),Ql=w(I,I.FLOOR),wl=w(I,I.CEIL),ba=w(I,I.NORMALIZE),ar=w(I,I.FRACT),ya=w(I,I.SIN),Tl=w(I,I.COS),Sl=w(I,I.TAN),Ml=w(I,I.ASIN),Nl=w(I,I.ACOS),Rl=w(I,I.ATAN),Ar=w(I,I.ABS),Ea=w(I,I.SIGN),Fl=w(I,I.LENGTH),Dl=w(I,I.NEGATE),_l=w(I,I.ONE_MINUS),kl=w(I,I.DFDX),Ll=w(I,I.DFDY),vl=w(I,I.ROUND),Gl=w(I,I.RECIPROCAL),Ol=w(I,I.TRUNC),Ul=w(I,I.FWIDTH);I.BITCAST;const zl=w(I,I.TRANSPOSE),Pl=w(I,I.ATAN2),Hl=w(I,I.MIN),hr=w(I,I.MAX),Ca=w(I,I.MOD),Ba=w(I,I.STEP),ql=w(I,I.REFLECT),Vl=w(I,I.DISTANCE),jl=w(I,I.DIFFERENCE),cr=w(I,I.DOT),Jl=w(I,I.CROSS),xa=w(I,I.POW),Wl=w(I,I.POW,2),Kl=w(I,I.POW,3),Yl=w(I,I.POW,4),Xl=w(I,I.TRANSFORM_DIRECTION),Zl=A=>Oi(Ea(A),xa(Ar(A),1/3)),$l=A=>cr(A,A),yt=w(I,I.MIX),Ui=(A,e=0,t=1)=>T(new I(I.CLAMP,T(A),T(e),T(t))),eu=A=>Ui(A),tu=w(I,I.REFRACT),lr=w(I,I.SMOOTHSTEP),su=w(I,I.FACEFORWARD),iu=te(([A])=>{const s=43758.5453,i=cr(A.xy,F(12.9898,78.233)),n=Ca(i,gl);return ar(ya(n).mul(s))}),nu=(A,e,t)=>yt(e,t,A),ru=(A,e,t)=>lr(e,t,A);x("all",pl),x("any",fl),x("equals",ml),x("radians",Il),x("degrees",bl),x("exp",yl),x("exp2",El),x("log",Cl),x("log2",Bl),x("sqrt",or),x("inverseSqrt",xl),x("floor",Ql),x("ceil",wl),x("normalize",ba),x("fract",ar),x("sin",ya),x("cos",Tl),x("tan",Sl),x("asin",Ml),x("acos",Nl),x("atan",Rl),x("abs",Ar),x("sign",Ea),x("length",Fl),x("lengthSq",$l),x("negate",Dl),x("oneMinus",_l),x("dFdx",kl),x("dFdy",Ll),x("round",vl),x("reciprocal",Gl),x("trunc",Ol),x("fwidth",Ul),x("atan2",Pl),x("min",Hl),x("max",hr),x("mod",Ca),x("step",Ba),x("reflect",ql),x("distance",Vl),x("dot",cr),x("cross",Jl),x("pow",xa),x("pow2",Wl),x("pow3",Kl),x("pow4",Yl),x("transformDirection",Xl),x("mix",nu),x("clamp",Ui),x("refract",tu),x("smoothstep",ru),x("faceForward",su),x("difference",jl),x("saturate",eu),x("cbrt",Zl),x("transpose",zl),x("rand",iu);class ou extends L{static get type(){return"ConditionalNode"}constructor(e,t,s=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=s}getNodeType(e){const t=this.ifNode.getNodeType(e);if(this.elseNode!==null){const s=this.elseNode.getNodeType(e);if(e.getTypeLength(s)>e.getTypeLength(t))return s}return t}setup(e){const t=this.condNode.cache(),s=this.ifNode.cache(),i=this.elseNode?this.elseNode.cache():null,n=e.context.nodeBlock;e.getDataFromNode(s).parentNodeBlock=n,i!==null&&(e.getDataFromNode(i).parentNodeBlock=n);const r=e.getNodeProperties(this);r.condNode=t,r.ifNode=s.context({nodeBlock:s}),r.elseNode=i?i.context({nodeBlock:i}):null}generate(e,t){const s=this.getNodeType(e),i=e.getDataFromNode(this);if(i.nodeProperty!==void 0)return i.nodeProperty;const{condNode:n,ifNode:r,elseNode:o}=e.getNodeProperties(this),a=t!=="void",h=a?ls(s).build(e):"";i.nodeProperty=h;const c=n.build(e,"bool");e.addFlowCode(`
|
|
1
|
+
(function(){"use strict";var CA=(function(){var A="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(t)?e:A,n,r=WebAssembly.instantiate(o(i),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var E=new Uint8Array(m.length),C=0;C<m.length;++C){var y=m.charCodeAt(C);E[C]=y>96?y-97:y>64?y-39:y+4}for(var Q=0,C=0;C<m.length;++C)E[Q++]=E[C]<60?s[E[C]]:(E[C]-60)*64+E[++C];return E.buffer.slice(0,Q)}function a(m,E,C,y,Q,M){var S=n.exports.sbrk,R=C+3&-4,D=S(R*y),O=S(Q.length),H=new Uint8Array(n.exports.memory.buffer);H.set(Q,O);var ae=m(D,C,y,O,Q.length);if(ae==0&&M&&M(D,R,y),E.set(H.subarray(D,D+C*y)),S(D-S(0)),ae!=0)throw new Error("Malformed buffer data: "+ae)}var h={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},l=[],u=0;function d(m){var E={object:new Worker(m),pending:0,requests:{}};return E.object.onmessage=function(C){var y=C.data;E.pending-=y.count,E.requests[y.id][y.action](y.value),delete E.requests[y.id]},E}function g(m){for(var E="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+a.toString()+f.toString(),C=new Blob([E],{type:"text/javascript"}),y=URL.createObjectURL(C),Q=0;Q<m;++Q)l[Q]=d(y);URL.revokeObjectURL(y)}function p(m,E,C,y,Q){for(var M=l[0],S=1;S<l.length;++S)l[S].pending<M.pending&&(M=l[S]);return new Promise(function(R,D){var O=new Uint8Array(C),H=u++;M.pending+=m,M.requests[H]={resolve:R,reject:D},M.object.postMessage({id:H,count:m,size:E,source:O,mode:y,filter:Q},[O.buffer])})}function f(m){r.then(function(){var E=m.data;try{var C=new Uint8Array(E.count*E.size);a(n.exports[E.mode],C,E.count,E.size,E.source,n.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:C},[C.buffer])}catch(y){self.postMessage({id:E.id,count:E.count,action:"reject",value:y})}})}return{ready:r,supported:!0,useWorkers:function(m){g(m)},decodeVertexBuffer:function(m,E,C,y,Q){a(n.exports.meshopt_decodeVertexBuffer,m,E,C,y,n.exports[h[Q]])},decodeIndexBuffer:function(m,E,C,y){a(n.exports.meshopt_decodeIndexBuffer,m,E,C,y)},decodeIndexSequence:function(m,E,C,y){a(n.exports.meshopt_decodeIndexSequence,m,E,C,y)},decodeGltfBuffer:function(m,E,C,y,Q,M){a(n.exports[c[Q]],m,E,C,y,n.exports[h[M]])},decodeGltfBufferAsync:function(m,E,C,y,Q){return l.length>0?p(m,E,C,c[y],h[Q]):r.then(function(){var M=new Uint8Array(m*E);return a(n.exports[c[y]],M,m,E,C,n.exports[h[Q]]),M})}}})();const Ys="169.19",Xs=0,Dr=1,BA=2,_r=1,kr=100,Lr=204,vr=205,Gr=3,xA=0,Zi=0,Or="attached",QA="detached",Ur=300,zr=301,wA=302,fs=1e3,Ct=1001,$i=1002,Me=1003,Pr=1004,TA=1005,At=1006,SA=1007,Lt=1008,xe=1009,MA=1013,Hr=1014,ht=1015,Bt=1016,NA=1020,qr=35902,Vr=35899,en=1022,ct=1023,tn=1026,jr=1027,vt=1028,ms=1030,Jr=33776,sn=33777,Wr=33778,nn=33779,RA=35840,FA=35842,DA=36196,Kr=37492,Yr=37496,Zs=37808,Xr=37812,rn=36492,_A=36495,Is=2300,bs=2301,on=2302,Zr=2400,$r=2401,eo=2402,kA=2500,LA=0,to=1,an=2,An=0,vA=1,Gt="",ne="srgb",ge="srgb-linear",GA="display-p3",so="display-p3-linear",hn="linear",io="srgb",no="rec709",ro="p3",Ot=7680,oo=519,$s=35044,lt=2e3,ei=2001;class Ut{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let n=0,r=i.length;n<r;n++)i[n].call(this,e);e.target=null}}}const he=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let ao=1234567;const ys=Math.PI/180,Es=180/Math.PI;function Ne(){const A=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(he[A&255]+he[A>>8&255]+he[A>>16&255]+he[A>>24&255]+"-"+he[e&255]+he[e>>8&255]+"-"+he[e>>16&15|64]+he[e>>24&255]+"-"+he[t&63|128]+he[t>>8&255]+"-"+he[t>>16&255]+he[t>>24&255]+he[s&255]+he[s>>8&255]+he[s>>16&255]+he[s>>24&255]).toLowerCase()}function ce(A,e,t){return Math.max(e,Math.min(t,A))}function cn(A,e){return(A%e+e)%e}function OA(A,e,t,s,i){return s+(A-e)*(i-s)/(t-e)}function UA(A,e,t){return A!==e?(t-A)/(e-A):0}function Cs(A,e,t){return(1-t)*A+t*e}function zA(A,e,t,s){return Cs(A,e,1-Math.exp(-t*s))}function PA(A,e=1){return e-Math.abs(cn(A,e*2)-e)}function HA(A,e,t){return A<=e?0:A>=t?1:(A=(A-e)/(t-e),A*A*(3-2*A))}function qA(A,e,t){return A<=e?0:A>=t?1:(A=(A-e)/(t-e),A*A*A*(A*(A*6-15)+10))}function VA(A,e){return A+Math.floor(Math.random()*(e-A+1))}function jA(A,e){return A+Math.random()*(e-A)}function JA(A){return A*(.5-Math.random())}function WA(A){A!==void 0&&(ao=A);let e=ao+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function KA(A){return A*ys}function YA(A){return A*Es}function XA(A){return(A&A-1)===0&&A!==0}function ZA(A){return Math.pow(2,Math.ceil(Math.log(A)/Math.LN2))}function $A(A){return Math.pow(2,Math.floor(Math.log(A)/Math.LN2))}function eh(A,e,t,s,i){const n=Math.cos,r=Math.sin,o=n(t/2),a=r(t/2),h=n((e+s)/2),c=r((e+s)/2),l=n((e-s)/2),u=r((e-s)/2),d=n((s-e)/2),g=r((s-e)/2);switch(i){case"XYX":A.set(o*c,a*l,a*u,o*h);break;case"YZY":A.set(a*u,o*c,a*l,o*h);break;case"ZXZ":A.set(a*l,a*u,o*c,o*h);break;case"XZX":A.set(o*c,a*g,a*d,o*h);break;case"YXY":A.set(a*d,o*c,a*g,o*h);break;case"ZYZ":A.set(a*g,a*d,o*c,o*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Re(A,e){switch(e.constructor){case Float32Array:return A;case Uint32Array:return A/4294967295;case Uint16Array:return A/65535;case Uint8Array:return A/255;case Int32Array:return Math.max(A/2147483647,-1);case Int16Array:return Math.max(A/32767,-1);case Int8Array:return Math.max(A/127,-1);default:throw new Error("Invalid component type.")}}function z(A,e){switch(e.constructor){case Float32Array:return A;case Uint32Array:return Math.round(A*4294967295);case Uint16Array:return Math.round(A*65535);case Uint8Array:return Math.round(A*255);case Int32Array:return Math.round(A*2147483647);case Int16Array:return Math.round(A*32767);case Int8Array:return Math.round(A*127);default:throw new Error("Invalid component type.")}}const Ao={DEG2RAD:ys,RAD2DEG:Es,generateUUID:Ne,clamp:ce,euclideanModulo:cn,mapLinear:OA,inverseLerp:UA,lerp:Cs,damp:zA,pingpong:PA,smoothstep:HA,smootherstep:qA,randInt:VA,randFloat:jA,randFloatSpread:JA,seededRandom:WA,degToRad:KA,radToDeg:YA,isPowerOfTwo:XA,ceilPowerOfTwo:ZA,floorPowerOfTwo:$A,setQuaternionFromProperEuler:eh,normalize:z,denormalize:Re};class q{constructor(e=0,t=0){q.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,s=this.y,i=e.elements;return this.x=i[0]*t+i[3]*s+i[6],this.y=i[1]*t+i[4]*s+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(ce(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const s=Math.cos(t),i=Math.sin(t),n=this.x-e.x,r=this.y-e.y;return this.x=n*s-r*i+e.x,this.y=n*i+r*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Fe{constructor(e,t,s,i,n,r,o,a,h){Fe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,s,i,n,r,o,a,h)}set(e,t,s,i,n,r,o,a,h){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=n,c[5]=a,c[6]=s,c[7]=r,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}extractBasis(e,t,s){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,n=this.elements,r=s[0],o=s[3],a=s[6],h=s[1],c=s[4],l=s[7],u=s[2],d=s[5],g=s[8],p=i[0],f=i[3],m=i[6],E=i[1],C=i[4],y=i[7],Q=i[2],M=i[5],S=i[8];return n[0]=r*p+o*E+a*Q,n[3]=r*f+o*C+a*M,n[6]=r*m+o*y+a*S,n[1]=h*p+c*E+l*Q,n[4]=h*f+c*C+l*M,n[7]=h*m+c*y+l*S,n[2]=u*p+d*E+g*Q,n[5]=u*f+d*C+g*M,n[8]=u*m+d*y+g*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8];return t*r*c-t*o*h-s*n*c+s*o*a+i*n*h-i*r*a}invert(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8],l=c*r-o*h,u=o*a-c*n,d=h*n-r*a,g=t*l+s*u+i*d;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const p=1/g;return e[0]=l*p,e[1]=(i*h-c*s)*p,e[2]=(o*s-i*r)*p,e[3]=u*p,e[4]=(c*t-i*a)*p,e[5]=(i*n-o*t)*p,e[6]=d*p,e[7]=(s*a-h*t)*p,e[8]=(r*t-s*n)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,s,i,n,r,o){const a=Math.cos(n),h=Math.sin(n);return this.set(s*a,s*h,-s*(a*r+h*o)+r+e,-i*h,i*a,-i*(-h*r+a*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(ln.makeScale(e,t)),this}rotate(e){return this.premultiply(ln.makeRotation(-e)),this}translate(e,t){return this.premultiply(ln.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,s=e.elements;for(let i=0;i<9;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const ln=new Fe;function th(A){for(let e=A.length-1;e>=0;--e)if(A[e]>=65535)return!0;return!1}function un(A){return document.createElementNS("http://www.w3.org/1999/xhtml",A)}const ho=new Fe().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),co=new Fe().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Bs={[ge]:{transfer:hn,primaries:no,luminanceCoefficients:[.2126,.7152,.0722],toReference:A=>A,fromReference:A=>A},[ne]:{transfer:io,primaries:no,luminanceCoefficients:[.2126,.7152,.0722],toReference:A=>A.convertSRGBToLinear(),fromReference:A=>A.convertLinearToSRGB()},[so]:{transfer:hn,primaries:ro,luminanceCoefficients:[.2289,.6917,.0793],toReference:A=>A.applyMatrix3(co),fromReference:A=>A.applyMatrix3(ho)},[GA]:{transfer:io,primaries:ro,luminanceCoefficients:[.2289,.6917,.0793],toReference:A=>A.convertSRGBToLinear().applyMatrix3(co),fromReference:A=>A.applyMatrix3(ho).convertLinearToSRGB()}},sh=new Set([ge,so]),le={enabled:!0,_workingColorSpace:ge,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(A){if(!sh.has(A))throw new Error(`Unsupported working color space, "${A}".`);this._workingColorSpace=A},convert:function(A,e,t){if(this.enabled===!1||e===t||!e||!t)return A;const s=Bs[e].toReference,i=Bs[t].fromReference;return i(s(A))},fromWorkingColorSpace:function(A,e){return this.convert(A,this._workingColorSpace,e)},toWorkingColorSpace:function(A,e){return this.convert(A,e,this._workingColorSpace)},getPrimaries:function(A){return Bs[A].primaries},getTransfer:function(A){return A===Gt?hn:Bs[A].transfer},getLuminanceCoefficients:function(A,e=this._workingColorSpace){return A.fromArray(Bs[e].luminanceCoefficients)}};function zt(A){return A<.04045?A*.0773993808:Math.pow(A*.9478672986+.0521327014,2.4)}function dn(A){return A<.0031308?A*12.92:1.055*Math.pow(A,.41666)-.055}let Pt;class ih{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Pt===void 0&&(Pt=un("canvas")),Pt.width=e.width,Pt.height=e.height;const s=Pt.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),t=Pt}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=un("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const i=s.getImageData(0,0,e.width,e.height),n=i.data;for(let r=0;r<n.length;r++)n[r]=zt(n[r]/255)*255;return s.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let s=0;s<t.length;s++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[s]=Math.floor(zt(t[s]/255)*255):t[s]=zt(t[s]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let nh=0;class lo{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:nh++}),this.uuid=Ne(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const s={uuid:this.uuid,url:""},i=this.data;if(i!==null){let n;if(Array.isArray(i)){n=[];for(let r=0,o=i.length;r<o;r++)i[r].isDataTexture?n.push(gn(i[r].image)):n.push(gn(i[r]))}else n=gn(i);s.url=n}return t||(e.images[this.uuid]=s),s}}function gn(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap?ih.getDataURL(A):A.data?{data:Array.from(A.data),width:A.width,height:A.height,type:A.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let rh=0;class ue extends Ut{constructor(e=ue.DEFAULT_IMAGE,t=ue.DEFAULT_MAPPING,s=Ct,i=Ct,n=At,r=Lt,o=ct,a=xe,h=ue.DEFAULT_ANISOTROPY,c=Gt){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:rh++}),this.uuid=Ne(),this.name="",this.source=new lo(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=s,this.wrapT=i,this.magFilter=n,this.minFilter=r,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=a,this.offset=new q(0,0),this.repeat=new q(1,1),this.center=new q(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Fe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const s={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(s.userData=this.userData),t||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ur)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case fs:e.x=e.x-Math.floor(e.x);break;case Ct:e.x=e.x<0?0:1;break;case $i:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case fs:e.y=e.y-Math.floor(e.y);break;case Ct:e.y=e.y<0?0:1;break;case $i:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}ue.DEFAULT_IMAGE=null,ue.DEFAULT_MAPPING=Ur,ue.DEFAULT_ANISOTROPY=4;class K{constructor(e=0,t=0,s=0,i=1){K.prototype.isVector4=!0,this.x=e,this.y=t,this.z=s,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,s,i){return this.x=e,this.y=t,this.z=s,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,n=this.w,r=e.elements;return this.x=r[0]*t+r[4]*s+r[8]*i+r[12]*n,this.y=r[1]*t+r[5]*s+r[9]*i+r[13]*n,this.z=r[2]*t+r[6]*s+r[10]*i+r[14]*n,this.w=r[3]*t+r[7]*s+r[11]*i+r[15]*n,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,s,i,n;const a=e.elements,h=a[0],c=a[4],l=a[8],u=a[1],d=a[5],g=a[9],p=a[2],f=a[6],m=a[10];if(Math.abs(c-u)<.01&&Math.abs(l-p)<.01&&Math.abs(g-f)<.01){if(Math.abs(c+u)<.1&&Math.abs(l+p)<.1&&Math.abs(g+f)<.1&&Math.abs(h+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const C=(h+1)/2,y=(d+1)/2,Q=(m+1)/2,M=(c+u)/4,S=(l+p)/4,R=(g+f)/4;return C>y&&C>Q?C<.01?(s=0,i=.707106781,n=.707106781):(s=Math.sqrt(C),i=M/s,n=S/s):y>Q?y<.01?(s=.707106781,i=0,n=.707106781):(i=Math.sqrt(y),s=M/i,n=R/i):Q<.01?(s=.707106781,i=.707106781,n=0):(n=Math.sqrt(Q),s=S/n,i=R/n),this.set(s,i,n,t),this}let E=Math.sqrt((f-g)*(f-g)+(l-p)*(l-p)+(u-c)*(u-c));return Math.abs(E)<.001&&(E=1),this.x=(f-g)/E,this.y=(l-p)/E,this.z=(u-c)/E,this.w=Math.acos((h+d+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this.w=e.w+(t.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class uo extends Ut{constructor(e=1,t=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new K(0,0,e,t),this.scissorTest=!1,this.viewport=new K(0,0,e,t);const i={width:e,height:t,depth:1};s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:At,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},s);const n=new ue(i,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace);n.flipY=!1,n.generateMipmaps=s.generateMipmaps,n.internalFormat=s.internalFormat,this.textures=[];const r=s.count;for(let o=0;o<r;o++)this.textures[o]=n.clone(),this.textures[o].isRenderTargetTexture=!0;this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this.depthTexture=s.depthTexture,this.samples=s.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,s=1){if(this.width!==e||this.height!==t||this.depth!==s){this.width=e,this.height=t,this.depth=s;for(let i=0,n=this.textures.length;i<n;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=s;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let s=0,i=e.textures.length;s<i;s++)this.textures[s]=e.textures[s].clone(),this.textures[s].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new lo(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class oh extends ue{constructor(e=null,t=1,s=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:s,depth:i},this.magFilter=Me,this.minFilter=Me,this.wrapR=Ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ke{constructor(e=0,t=0,s=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=s,this._w=i}static slerpFlat(e,t,s,i,n,r,o){let a=s[i+0],h=s[i+1],c=s[i+2],l=s[i+3];const u=n[r+0],d=n[r+1],g=n[r+2],p=n[r+3];if(o===0){e[t+0]=a,e[t+1]=h,e[t+2]=c,e[t+3]=l;return}if(o===1){e[t+0]=u,e[t+1]=d,e[t+2]=g,e[t+3]=p;return}if(l!==p||a!==u||h!==d||c!==g){let f=1-o;const m=a*u+h*d+c*g+l*p,E=m>=0?1:-1,C=1-m*m;if(C>Number.EPSILON){const Q=Math.sqrt(C),M=Math.atan2(Q,m*E);f=Math.sin(f*M)/Q,o=Math.sin(o*M)/Q}const y=o*E;if(a=a*f+u*y,h=h*f+d*y,c=c*f+g*y,l=l*f+p*y,f===1-o){const Q=1/Math.sqrt(a*a+h*h+c*c+l*l);a*=Q,h*=Q,c*=Q,l*=Q}}e[t]=a,e[t+1]=h,e[t+2]=c,e[t+3]=l}static multiplyQuaternionsFlat(e,t,s,i,n,r){const o=s[i],a=s[i+1],h=s[i+2],c=s[i+3],l=n[r],u=n[r+1],d=n[r+2],g=n[r+3];return e[t]=o*g+c*l+a*d-h*u,e[t+1]=a*g+c*u+h*l-o*d,e[t+2]=h*g+c*d+o*u-a*l,e[t+3]=c*g-o*l-a*u-h*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,s,i){return this._x=e,this._y=t,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const s=e._x,i=e._y,n=e._z,r=e._order,o=Math.cos,a=Math.sin,h=o(s/2),c=o(i/2),l=o(n/2),u=a(s/2),d=a(i/2),g=a(n/2);switch(r){case"XYZ":this._x=u*c*l+h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l-u*d*g;break;case"YXZ":this._x=u*c*l+h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l+u*d*g;break;case"ZXY":this._x=u*c*l-h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l-u*d*g;break;case"ZYX":this._x=u*c*l-h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l+u*d*g;break;case"YZX":this._x=u*c*l+h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l-u*d*g;break;case"XZY":this._x=u*c*l-h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l+u*d*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const s=t/2,i=Math.sin(s);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,s=t[0],i=t[4],n=t[8],r=t[1],o=t[5],a=t[9],h=t[2],c=t[6],l=t[10],u=s+o+l;if(u>0){const d=.5/Math.sqrt(u+1);this._w=.25/d,this._x=(c-a)*d,this._y=(n-h)*d,this._z=(r-i)*d}else if(s>o&&s>l){const d=2*Math.sqrt(1+s-o-l);this._w=(c-a)/d,this._x=.25*d,this._y=(i+r)/d,this._z=(n+h)/d}else if(o>l){const d=2*Math.sqrt(1+o-s-l);this._w=(n-h)/d,this._x=(i+r)/d,this._y=.25*d,this._z=(a+c)/d}else{const d=2*Math.sqrt(1+l-s-o);this._w=(r-i)/d,this._x=(n+h)/d,this._y=(a+c)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let s=e.dot(t)+1;return s<Number.EPSILON?(s=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ce(this.dot(e),-1,1)))}rotateTowards(e,t){const s=this.angleTo(e);if(s===0)return this;const i=Math.min(1,t/s);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const s=e._x,i=e._y,n=e._z,r=e._w,o=t._x,a=t._y,h=t._z,c=t._w;return this._x=s*c+r*o+i*h-n*a,this._y=i*c+r*a+n*o-s*h,this._z=n*c+r*h+s*a-i*o,this._w=r*c-s*o-i*a-n*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const s=this._x,i=this._y,n=this._z,r=this._w;let o=r*e._w+s*e._x+i*e._y+n*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=r,this._x=s,this._y=i,this._z=n,this;const a=1-o*o;if(a<=Number.EPSILON){const d=1-t;return this._w=d*r+t*this._w,this._x=d*s+t*this._x,this._y=d*i+t*this._y,this._z=d*n+t*this._z,this.normalize(),this}const h=Math.sqrt(a),c=Math.atan2(h,o),l=Math.sin((1-t)*c)/h,u=Math.sin(t*c)/h;return this._w=r*l+this._w*u,this._x=s*l+this._x*u,this._y=i*l+this._y*u,this._z=n*l+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,s){return this.copy(e).slerp(t,s)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),n=Math.sqrt(s);return this.set(i*Math.sin(e),i*Math.cos(e),n*Math.sin(t),n*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class b{constructor(e=0,t=0,s=0){b.prototype.isVector3=!0,this.x=e,this.y=t,this.z=s}set(e,t,s){return s===void 0&&(s=this.z),this.x=e,this.y=t,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(go.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(go.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,s=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[3]*s+n[6]*i,this.y=n[1]*t+n[4]*s+n[7]*i,this.z=n[2]*t+n[5]*s+n[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,n=e.elements,r=1/(n[3]*t+n[7]*s+n[11]*i+n[15]);return this.x=(n[0]*t+n[4]*s+n[8]*i+n[12])*r,this.y=(n[1]*t+n[5]*s+n[9]*i+n[13])*r,this.z=(n[2]*t+n[6]*s+n[10]*i+n[14])*r,this}applyQuaternion(e){const t=this.x,s=this.y,i=this.z,n=e.x,r=e.y,o=e.z,a=e.w,h=2*(r*i-o*s),c=2*(o*t-n*i),l=2*(n*s-r*t);return this.x=t+a*h+r*l-o*c,this.y=s+a*c+o*h-n*l,this.z=i+a*l+n*c-r*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,s=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[4]*s+n[8]*i,this.y=n[1]*t+n[5]*s+n[9]*i,this.z=n[2]*t+n[6]*s+n[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const s=e.x,i=e.y,n=e.z,r=t.x,o=t.y,a=t.z;return this.x=i*a-n*o,this.y=n*r-s*a,this.z=s*o-i*r,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const s=e.dot(this)/t;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return pn.copy(this).projectOnVector(e),this.sub(pn)}reflect(e){return this.sub(pn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(ce(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y,i=this.z-e.z;return t*t+s*s+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,s){const i=Math.sin(t)*e;return this.x=i*Math.sin(s),this.y=Math.cos(t)*e,this.z=i*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,s){return this.x=e*Math.sin(t),this.y=s,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=s,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,s=Math.sqrt(1-t*t);return this.x=s*Math.cos(e),this.y=t,this.z=s*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const pn=new b,go=new Ke;class Ye{constructor(e=new b(1/0,1/0,1/0),t=new b(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,s=e.length;t<s;t+=3)this.expandByPoint(De.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,s=e.count;t<s;t++)this.expandByPoint(De.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,s=e.length;t<s;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const s=De.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(s),this.max.copy(e).add(s),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const s=e.geometry;if(s!==void 0){const n=s.getAttribute("position");if(t===!0&&n!==void 0&&e.isInstancedMesh!==!0)for(let r=0,o=n.count;r<o;r++)e.isMesh===!0?e.getVertexPosition(r,De):De.fromBufferAttribute(n,r),De.applyMatrix4(e.matrixWorld),this.expandByPoint(De);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),ti.copy(e.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),ti.copy(s.boundingBox)),ti.applyMatrix4(e.matrixWorld),this.union(ti)}const i=e.children;for(let n=0,r=i.length;n<r;n++)this.expandByObject(i[n],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,De),De.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,s;return e.normal.x>0?(t=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),t<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(xs),si.subVectors(this.max,xs),Ht.subVectors(e.a,xs),qt.subVectors(e.b,xs),Vt.subVectors(e.c,xs),ut.subVectors(qt,Ht),dt.subVectors(Vt,qt),xt.subVectors(Ht,Vt);let t=[0,-ut.z,ut.y,0,-dt.z,dt.y,0,-xt.z,xt.y,ut.z,0,-ut.x,dt.z,0,-dt.x,xt.z,0,-xt.x,-ut.y,ut.x,0,-dt.y,dt.x,0,-xt.y,xt.x,0];return!fn(t,Ht,qt,Vt,si)||(t=[1,0,0,0,1,0,0,0,1],!fn(t,Ht,qt,Vt,si))?!1:(ii.crossVectors(ut,dt),t=[ii.x,ii.y,ii.z],fn(t,Ht,qt,Vt,si))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,De).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(De).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Xe[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Xe[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Xe[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Xe[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Xe[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Xe[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Xe[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Xe[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Xe),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Xe=[new b,new b,new b,new b,new b,new b,new b,new b],De=new b,ti=new Ye,Ht=new b,qt=new b,Vt=new b,ut=new b,dt=new b,xt=new b,xs=new b,si=new b,ii=new b,Qt=new b;function fn(A,e,t,s,i){for(let n=0,r=A.length-3;n<=r;n+=3){Qt.fromArray(A,n);const o=i.x*Math.abs(Qt.x)+i.y*Math.abs(Qt.y)+i.z*Math.abs(Qt.z),a=e.dot(Qt),h=t.dot(Qt),c=s.dot(Qt);if(Math.max(-Math.max(a,h,c),Math.min(a,h,c))>o)return!1}return!0}const ah=new Ye,Qs=new b,mn=new b;class Oe{constructor(e=new b,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const s=this.center;t!==void 0?s.copy(t):ah.setFromPoints(e).getCenter(s);let i=0;for(let n=0,r=e.length;n<r;n++)i=Math.max(i,s.distanceToSquared(e[n]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const s=this.center.distanceToSquared(e);return t.copy(e),s>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Qs.subVectors(e,this.center);const t=Qs.lengthSq();if(t>this.radius*this.radius){const s=Math.sqrt(t),i=(s-this.radius)*.5;this.center.addScaledVector(Qs,i/s),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(mn.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Qs.copy(e.center).add(mn)),this.expandByPoint(Qs.copy(e.center).sub(mn))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ze=new b,In=new b,ni=new b,gt=new b,bn=new b,ri=new b,yn=new b;class oi{constructor(e=new b,t=new b(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ze)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const s=t.dot(this.direction);return s<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ze.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ze.copy(this.origin).addScaledVector(this.direction,t),Ze.distanceToSquared(e))}distanceSqToSegment(e,t,s,i){In.copy(e).add(t).multiplyScalar(.5),ni.copy(t).sub(e).normalize(),gt.copy(this.origin).sub(In);const n=e.distanceTo(t)*.5,r=-this.direction.dot(ni),o=gt.dot(this.direction),a=-gt.dot(ni),h=gt.lengthSq(),c=Math.abs(1-r*r);let l,u,d,g;if(c>0)if(l=r*a-o,u=r*o-a,g=n*c,l>=0)if(u>=-g)if(u<=g){const p=1/c;l*=p,u*=p,d=l*(l+r*u+2*o)+u*(r*l+u+2*a)+h}else u=n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;else u=-n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;else u<=-g?(l=Math.max(0,-(-r*n+o)),u=l>0?-n:Math.min(Math.max(-n,-a),n),d=-l*l+u*(u+2*a)+h):u<=g?(l=0,u=Math.min(Math.max(-n,-a),n),d=u*(u+2*a)+h):(l=Math.max(0,-(r*n+o)),u=l>0?n:Math.min(Math.max(-n,-a),n),d=-l*l+u*(u+2*a)+h);else u=r>0?-n:n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;return s&&s.copy(this.origin).addScaledVector(this.direction,l),i&&i.copy(In).addScaledVector(ni,u),d}intersectSphere(e,t){Ze.subVectors(e.center,this.origin);const s=Ze.dot(this.direction),i=Ze.dot(Ze)-s*s,n=e.radius*e.radius;if(i>n)return null;const r=Math.sqrt(n-i),o=s-r,a=s+r;return a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/t;return s>=0?s:null}intersectPlane(e,t){const s=this.distanceToPlane(e);return s===null?null:this.at(s,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let s,i,n,r,o,a;const h=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,u=this.origin;return h>=0?(s=(e.min.x-u.x)*h,i=(e.max.x-u.x)*h):(s=(e.max.x-u.x)*h,i=(e.min.x-u.x)*h),c>=0?(n=(e.min.y-u.y)*c,r=(e.max.y-u.y)*c):(n=(e.max.y-u.y)*c,r=(e.min.y-u.y)*c),s>r||n>i||((n>s||isNaN(s))&&(s=n),(r<i||isNaN(i))&&(i=r),l>=0?(o=(e.min.z-u.z)*l,a=(e.max.z-u.z)*l):(o=(e.max.z-u.z)*l,a=(e.min.z-u.z)*l),s>a||o>i)||((o>s||s!==s)&&(s=o),(a<i||i!==i)&&(i=a),i<0)?null:this.at(s>=0?s:i,t)}intersectsBox(e){return this.intersectBox(e,Ze)!==null}intersectTriangle(e,t,s,i,n){bn.subVectors(t,e),ri.subVectors(s,e),yn.crossVectors(bn,ri);let r=this.direction.dot(yn),o;if(r>0){if(i)return null;o=1}else if(r<0)o=-1,r=-r;else return null;gt.subVectors(this.origin,e);const a=o*this.direction.dot(ri.crossVectors(gt,ri));if(a<0)return null;const h=o*this.direction.dot(bn.cross(gt));if(h<0||a+h>r)return null;const c=-o*gt.dot(yn);return c<0?null:this.at(c/r,n)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class k{constructor(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f){k.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f)}set(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f){const m=this.elements;return m[0]=e,m[4]=t,m[8]=s,m[12]=i,m[1]=n,m[5]=r,m[9]=o,m[13]=a,m[2]=h,m[6]=c,m[10]=l,m[14]=u,m[3]=d,m[7]=g,m[11]=p,m[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new k().fromArray(this.elements)}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],this}copyPosition(e){const t=this.elements,s=e.elements;return t[12]=s[12],t[13]=s[13],t[14]=s[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,s){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,t,s){return this.set(e.x,t.x,s.x,0,e.y,t.y,s.y,0,e.z,t.z,s.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,s=e.elements,i=1/jt.setFromMatrixColumn(e,0).length(),n=1/jt.setFromMatrixColumn(e,1).length(),r=1/jt.setFromMatrixColumn(e,2).length();return t[0]=s[0]*i,t[1]=s[1]*i,t[2]=s[2]*i,t[3]=0,t[4]=s[4]*n,t[5]=s[5]*n,t[6]=s[6]*n,t[7]=0,t[8]=s[8]*r,t[9]=s[9]*r,t[10]=s[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,s=e.x,i=e.y,n=e.z,r=Math.cos(s),o=Math.sin(s),a=Math.cos(i),h=Math.sin(i),c=Math.cos(n),l=Math.sin(n);if(e.order==="XYZ"){const u=r*c,d=r*l,g=o*c,p=o*l;t[0]=a*c,t[4]=-a*l,t[8]=h,t[1]=d+g*h,t[5]=u-p*h,t[9]=-o*a,t[2]=p-u*h,t[6]=g+d*h,t[10]=r*a}else if(e.order==="YXZ"){const u=a*c,d=a*l,g=h*c,p=h*l;t[0]=u+p*o,t[4]=g*o-d,t[8]=r*h,t[1]=r*l,t[5]=r*c,t[9]=-o,t[2]=d*o-g,t[6]=p+u*o,t[10]=r*a}else if(e.order==="ZXY"){const u=a*c,d=a*l,g=h*c,p=h*l;t[0]=u-p*o,t[4]=-r*l,t[8]=g+d*o,t[1]=d+g*o,t[5]=r*c,t[9]=p-u*o,t[2]=-r*h,t[6]=o,t[10]=r*a}else if(e.order==="ZYX"){const u=r*c,d=r*l,g=o*c,p=o*l;t[0]=a*c,t[4]=g*h-d,t[8]=u*h+p,t[1]=a*l,t[5]=p*h+u,t[9]=d*h-g,t[2]=-h,t[6]=o*a,t[10]=r*a}else if(e.order==="YZX"){const u=r*a,d=r*h,g=o*a,p=o*h;t[0]=a*c,t[4]=p-u*l,t[8]=g*l+d,t[1]=l,t[5]=r*c,t[9]=-o*c,t[2]=-h*c,t[6]=d*l+g,t[10]=u-p*l}else if(e.order==="XZY"){const u=r*a,d=r*h,g=o*a,p=o*h;t[0]=a*c,t[4]=-l,t[8]=h*c,t[1]=u*l+p,t[5]=r*c,t[9]=d*l-g,t[2]=g*l-d,t[6]=o*c,t[10]=p*l+u}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Ah,e,hh)}lookAt(e,t,s){const i=this.elements;return be.subVectors(e,t),be.lengthSq()===0&&(be.z=1),be.normalize(),pt.crossVectors(s,be),pt.lengthSq()===0&&(Math.abs(s.z)===1?be.x+=1e-4:be.z+=1e-4,be.normalize(),pt.crossVectors(s,be)),pt.normalize(),ai.crossVectors(be,pt),i[0]=pt.x,i[4]=ai.x,i[8]=be.x,i[1]=pt.y,i[5]=ai.y,i[9]=be.y,i[2]=pt.z,i[6]=ai.z,i[10]=be.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,n=this.elements,r=s[0],o=s[4],a=s[8],h=s[12],c=s[1],l=s[5],u=s[9],d=s[13],g=s[2],p=s[6],f=s[10],m=s[14],E=s[3],C=s[7],y=s[11],Q=s[15],M=i[0],S=i[4],R=i[8],D=i[12],O=i[1],H=i[5],ae=i[9],W=i[13],Ae=i[2],je=i[6],Be=i[10],ot=i[14],Je=i[3],We=i[7],at=i[11],V=i[15];return n[0]=r*M+o*O+a*Ae+h*Je,n[4]=r*S+o*H+a*je+h*We,n[8]=r*R+o*ae+a*Be+h*at,n[12]=r*D+o*W+a*ot+h*V,n[1]=c*M+l*O+u*Ae+d*Je,n[5]=c*S+l*H+u*je+d*We,n[9]=c*R+l*ae+u*Be+d*at,n[13]=c*D+l*W+u*ot+d*V,n[2]=g*M+p*O+f*Ae+m*Je,n[6]=g*S+p*H+f*je+m*We,n[10]=g*R+p*ae+f*Be+m*at,n[14]=g*D+p*W+f*ot+m*V,n[3]=E*M+C*O+y*Ae+Q*Je,n[7]=E*S+C*H+y*je+Q*We,n[11]=E*R+C*ae+y*Be+Q*at,n[15]=E*D+C*W+y*ot+Q*V,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[4],i=e[8],n=e[12],r=e[1],o=e[5],a=e[9],h=e[13],c=e[2],l=e[6],u=e[10],d=e[14],g=e[3],p=e[7],f=e[11],m=e[15];return g*(+n*a*l-i*h*l-n*o*u+s*h*u+i*o*d-s*a*d)+p*(+t*a*d-t*h*u+n*r*u-i*r*d+i*h*c-n*a*c)+f*(+t*h*l-t*o*d-n*r*l+s*r*d+n*o*c-s*h*c)+m*(-i*o*c-t*a*l+t*o*u+i*r*l-s*r*u+s*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,s){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=s),this}invert(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8],l=e[9],u=e[10],d=e[11],g=e[12],p=e[13],f=e[14],m=e[15],E=l*f*h-p*u*h+p*a*d-o*f*d-l*a*m+o*u*m,C=g*u*h-c*f*h-g*a*d+r*f*d+c*a*m-r*u*m,y=c*p*h-g*l*h+g*o*d-r*p*d-c*o*m+r*l*m,Q=g*l*a-c*p*a-g*o*u+r*p*u+c*o*f-r*l*f,M=t*E+s*C+i*y+n*Q;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/M;return e[0]=E*S,e[1]=(p*u*n-l*f*n-p*i*d+s*f*d+l*i*m-s*u*m)*S,e[2]=(o*f*n-p*a*n+p*i*h-s*f*h-o*i*m+s*a*m)*S,e[3]=(l*a*n-o*u*n-l*i*h+s*u*h+o*i*d-s*a*d)*S,e[4]=C*S,e[5]=(c*f*n-g*u*n+g*i*d-t*f*d-c*i*m+t*u*m)*S,e[6]=(g*a*n-r*f*n-g*i*h+t*f*h+r*i*m-t*a*m)*S,e[7]=(r*u*n-c*a*n+c*i*h-t*u*h-r*i*d+t*a*d)*S,e[8]=y*S,e[9]=(g*l*n-c*p*n-g*s*d+t*p*d+c*s*m-t*l*m)*S,e[10]=(r*p*n-g*o*n+g*s*h-t*p*h-r*s*m+t*o*m)*S,e[11]=(c*o*n-r*l*n-c*s*h+t*l*h+r*s*d-t*o*d)*S,e[12]=Q*S,e[13]=(c*p*i-g*l*i+g*s*u-t*p*u-c*s*f+t*l*f)*S,e[14]=(g*o*i-r*p*i-g*s*a+t*p*a+r*s*f-t*o*f)*S,e[15]=(r*l*i-c*o*i+c*s*a-t*l*a-r*s*u+t*o*u)*S,this}scale(e){const t=this.elements,s=e.x,i=e.y,n=e.z;return t[0]*=s,t[4]*=i,t[8]*=n,t[1]*=s,t[5]*=i,t[9]*=n,t[2]*=s,t[6]*=i,t[10]*=n,t[3]*=s,t[7]*=i,t[11]*=n,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,s,i))}makeTranslation(e,t,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,s,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,t,-s,0,0,s,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,0,s,0,0,1,0,0,-s,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,0,s,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const s=Math.cos(t),i=Math.sin(t),n=1-s,r=e.x,o=e.y,a=e.z,h=n*r,c=n*o;return this.set(h*r+s,h*o-i*a,h*a+i*o,0,h*o+i*a,c*o+s,c*a-i*r,0,h*a-i*o,c*a+i*r,n*a*a+s,0,0,0,0,1),this}makeScale(e,t,s){return this.set(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,t,s,i,n,r){return this.set(1,s,n,0,e,1,r,0,t,i,1,0,0,0,0,1),this}compose(e,t,s){const i=this.elements,n=t._x,r=t._y,o=t._z,a=t._w,h=n+n,c=r+r,l=o+o,u=n*h,d=n*c,g=n*l,p=r*c,f=r*l,m=o*l,E=a*h,C=a*c,y=a*l,Q=s.x,M=s.y,S=s.z;return i[0]=(1-(p+m))*Q,i[1]=(d+y)*Q,i[2]=(g-C)*Q,i[3]=0,i[4]=(d-y)*M,i[5]=(1-(u+m))*M,i[6]=(f+E)*M,i[7]=0,i[8]=(g+C)*S,i[9]=(f-E)*S,i[10]=(1-(u+p))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,s){const i=this.elements;let n=jt.set(i[0],i[1],i[2]).length();const r=jt.set(i[4],i[5],i[6]).length(),o=jt.set(i[8],i[9],i[10]).length();this.determinant()<0&&(n=-n),e.x=i[12],e.y=i[13],e.z=i[14],_e.copy(this);const h=1/n,c=1/r,l=1/o;return _e.elements[0]*=h,_e.elements[1]*=h,_e.elements[2]*=h,_e.elements[4]*=c,_e.elements[5]*=c,_e.elements[6]*=c,_e.elements[8]*=l,_e.elements[9]*=l,_e.elements[10]*=l,t.setFromRotationMatrix(_e),s.x=n,s.y=r,s.z=o,this}makePerspective(e,t,s,i,n,r,o=lt){const a=this.elements,h=2*n/(t-e),c=2*n/(s-i),l=(t+e)/(t-e),u=(s+i)/(s-i);let d,g;if(o===lt)d=-(r+n)/(r-n),g=-2*r*n/(r-n);else if(o===ei)d=-r/(r-n),g=-r*n/(r-n);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return a[0]=h,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=g,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,s,i,n,r,o=lt){const a=this.elements,h=1/(t-e),c=1/(s-i),l=1/(r-n),u=(t+e)*h,d=(s+i)*c;let g,p;if(o===lt)g=(r+n)*l,p=-2*l;else if(o===ei)g=n*l,p=-1*l;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return a[0]=2*h,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=p,a[14]=-g,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,s=e.elements;for(let i=0;i<16;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<16;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15],e}}const jt=new b,_e=new k,Ah=new b(0,0,0),hh=new b(1,1,1),pt=new b,ai=new b,be=new b,po=new k,fo=new Ke;class Jt{constructor(e=0,t=0,s=0,i=Jt.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=s,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,s,i=this._order){return this._x=e,this._y=t,this._z=s,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,s=!0){const i=e.elements,n=i[0],r=i[4],o=i[8],a=i[1],h=i[5],c=i[9],l=i[2],u=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(ce(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-r,n)):(this._x=Math.atan2(u,h),this._z=0);break;case"YXZ":this._x=Math.asin(-ce(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,h)):(this._y=Math.atan2(-l,n),this._z=0);break;case"ZXY":this._x=Math.asin(ce(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-l,d),this._z=Math.atan2(-r,h)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-ce(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-r,h));break;case"YZX":this._z=Math.asin(ce(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-l,n)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-ce(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(u,h),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,s){return po.makeRotationFromQuaternion(e),this.setFromRotationMatrix(po,t,s)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return fo.setFromEuler(this),this.setFromQuaternion(fo,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Jt.DEFAULT_ORDER="XYZ";class ch{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let lh=0;const mo=new b,Wt=new Ke,$e=new k,Ai=new b,ws=new b,uh=new b,dh=new Ke,Io=new b(1,0,0),bo=new b(0,1,0),yo=new b(0,0,1),Eo={type:"added"},gh={type:"removed"},Kt={type:"childadded",child:null},En={type:"childremoved",child:null};class Y extends Ut{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:lh++}),this.uuid=Ne(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Y.DEFAULT_UP.clone();const e=new b,t=new Jt,s=new Ke,i=new b(1,1,1);function n(){s.setFromEuler(t,!1)}function r(){t.setFromQuaternion(s,void 0,!1)}t._onChange(n),s._onChange(r),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new k},normalMatrix:{value:new Fe}}),this.matrix=new k,this.matrixWorld=new k,this.matrixAutoUpdate=Y.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Y.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ch,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Wt.setFromAxisAngle(e,t),this.quaternion.multiply(Wt),this}rotateOnWorldAxis(e,t){return Wt.setFromAxisAngle(e,t),this.quaternion.premultiply(Wt),this}rotateX(e){return this.rotateOnAxis(Io,e)}rotateY(e){return this.rotateOnAxis(bo,e)}rotateZ(e){return this.rotateOnAxis(yo,e)}translateOnAxis(e,t){return mo.copy(e).applyQuaternion(this.quaternion),this.position.add(mo.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Io,e)}translateY(e){return this.translateOnAxis(bo,e)}translateZ(e){return this.translateOnAxis(yo,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4($e.copy(this.matrixWorld).invert())}lookAt(e,t,s){e.isVector3?Ai.copy(e):Ai.set(e,t,s);const i=this.parent;this.updateWorldMatrix(!0,!1),ws.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?$e.lookAt(ws,Ai,this.up):$e.lookAt(Ai,ws,this.up),this.quaternion.setFromRotationMatrix($e),i&&($e.extractRotation(i.matrixWorld),Wt.setFromRotationMatrix($e),this.quaternion.premultiply(Wt.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Eo),Kt.child=e,this.dispatchEvent(Kt),Kt.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(gh),En.child=e,this.dispatchEvent(En),En.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),$e.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),$e.multiply(e.parent.matrixWorld)),e.applyMatrix4($e),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Eo),Kt.child=e,this.dispatchEvent(Kt),Kt.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let s=0,i=this.children.length;s<i;s++){const r=this.children[s].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,s=[]){this[e]===t&&s.push(this);const i=this.children;for(let n=0,r=i.length;n<r;n++)i[n].getObjectsByProperty(e,t,s);return s}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ws,e,uh),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ws,dh,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].updateMatrixWorld(e)}updateWorldMatrix(e,t){const s=this.parent;if(e===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let n=0,r=i.length;n<r;n++)i[n].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",s={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function n(o,a){return o[a.uuid]===void 0&&(o[a.uuid]=a.toJSON(e)),a.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=n(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const a=o.shapes;if(Array.isArray(a))for(let h=0,c=a.length;h<c;h++){const l=a[h];n(e.shapes,l)}else n(e.shapes,a)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(n(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let a=0,h=this.material.length;a<h;a++)o.push(n(e.materials,this.material[a]));i.material=o}else i.material=n(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const a=this.animations[o];i.animations.push(n(e.animations,a))}}if(t){const o=r(e.geometries),a=r(e.materials),h=r(e.textures),c=r(e.images),l=r(e.shapes),u=r(e.skeletons),d=r(e.animations),g=r(e.nodes);o.length>0&&(s.geometries=o),a.length>0&&(s.materials=a),h.length>0&&(s.textures=h),c.length>0&&(s.images=c),l.length>0&&(s.shapes=l),u.length>0&&(s.skeletons=u),d.length>0&&(s.animations=d),g.length>0&&(s.nodes=g)}return s.object=i,s;function r(o){const a=[];for(const h in o){const c=o[h];delete c.metadata,a.push(c)}return a}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let s=0;s<e.children.length;s++){const i=e.children[s];this.add(i.clone())}return this}}Y.DEFAULT_UP=new b(0,1,0),Y.DEFAULT_MATRIX_AUTO_UPDATE=!0,Y.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ke=new b,et=new b,Cn=new b,tt=new b,Yt=new b,Xt=new b,Co=new b,Bn=new b,xn=new b,Qn=new b,wn=new K,Tn=new K,Sn=new K;class Le{constructor(e=new b,t=new b,s=new b){this.a=e,this.b=t,this.c=s}static getNormal(e,t,s,i){i.subVectors(s,t),ke.subVectors(e,t),i.cross(ke);const n=i.lengthSq();return n>0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(e,t,s,i,n){ke.subVectors(i,t),et.subVectors(s,t),Cn.subVectors(e,t);const r=ke.dot(ke),o=ke.dot(et),a=ke.dot(Cn),h=et.dot(et),c=et.dot(Cn),l=r*h-o*o;if(l===0)return n.set(0,0,0),null;const u=1/l,d=(h*a-o*c)*u,g=(r*c-o*a)*u;return n.set(1-d-g,g,d)}static containsPoint(e,t,s,i){return this.getBarycoord(e,t,s,i,tt)===null?!1:tt.x>=0&&tt.y>=0&&tt.x+tt.y<=1}static getInterpolation(e,t,s,i,n,r,o,a){return this.getBarycoord(e,t,s,i,tt)===null?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(n,tt.x),a.addScaledVector(r,tt.y),a.addScaledVector(o,tt.z),a)}static getInterpolatedAttribute(e,t,s,i,n,r){return wn.setScalar(0),Tn.setScalar(0),Sn.setScalar(0),wn.fromBufferAttribute(e,t),Tn.fromBufferAttribute(e,s),Sn.fromBufferAttribute(e,i),r.setScalar(0),r.addScaledVector(wn,n.x),r.addScaledVector(Tn,n.y),r.addScaledVector(Sn,n.z),r}static isFrontFacing(e,t,s,i){return ke.subVectors(s,t),et.subVectors(e,t),ke.cross(et).dot(i)<0}set(e,t,s){return this.a.copy(e),this.b.copy(t),this.c.copy(s),this}setFromPointsAndIndices(e,t,s,i){return this.a.copy(e[t]),this.b.copy(e[s]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,s,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ke.subVectors(this.c,this.b),et.subVectors(this.a,this.b),ke.cross(et).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Le.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Le.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,s,i,n){return Le.getInterpolation(e,this.a,this.b,this.c,t,s,i,n)}containsPoint(e){return Le.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Le.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const s=this.a,i=this.b,n=this.c;let r,o;Yt.subVectors(i,s),Xt.subVectors(n,s),Bn.subVectors(e,s);const a=Yt.dot(Bn),h=Xt.dot(Bn);if(a<=0&&h<=0)return t.copy(s);xn.subVectors(e,i);const c=Yt.dot(xn),l=Xt.dot(xn);if(c>=0&&l<=c)return t.copy(i);const u=a*l-c*h;if(u<=0&&a>=0&&c<=0)return r=a/(a-c),t.copy(s).addScaledVector(Yt,r);Qn.subVectors(e,n);const d=Yt.dot(Qn),g=Xt.dot(Qn);if(g>=0&&d<=g)return t.copy(n);const p=d*h-a*g;if(p<=0&&h>=0&&g<=0)return o=h/(h-g),t.copy(s).addScaledVector(Xt,o);const f=c*g-d*l;if(f<=0&&l-c>=0&&d-g>=0)return Co.subVectors(n,i),o=(l-c)/(l-c+(d-g)),t.copy(i).addScaledVector(Co,o);const m=1/(f+p+u);return r=p*m,o=u*m,t.copy(s).addScaledVector(Yt,r).addScaledVector(Xt,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Bo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ft={h:0,s:0,l:0},hi={h:0,s:0,l:0};function Mn(A,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?A+(e-A)*6*t:t<1/2?e:t<2/3?A+(e-A)*6*(2/3-t):A}class X{constructor(e,t,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,s)}set(e,t,s){if(t===void 0&&s===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ne){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,le.toWorkingColorSpace(this,t),this}setRGB(e,t,s,i=le.workingColorSpace){return this.r=e,this.g=t,this.b=s,le.toWorkingColorSpace(this,i),this}setHSL(e,t,s,i=le.workingColorSpace){if(e=cn(e,1),t=ce(t,0,1),s=ce(s,0,1),t===0)this.r=this.g=this.b=s;else{const n=s<=.5?s*(1+t):s+t-s*t,r=2*s-n;this.r=Mn(r,n,e+1/3),this.g=Mn(r,n,e),this.b=Mn(r,n,e-1/3)}return le.toWorkingColorSpace(this,i),this}setStyle(e,t=ne){function s(n){n!==void 0&&parseFloat(n)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let n;const r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,t);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,t);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],r=n.length;if(r===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(r===6)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=ne){const s=Bo[e.toLowerCase()];return s!==void 0?this.setHex(s,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zt(e.r),this.g=zt(e.g),this.b=zt(e.b),this}copyLinearToSRGB(e){return this.r=dn(e.r),this.g=dn(e.g),this.b=dn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ne){return le.fromWorkingColorSpace(de.copy(this),e),Math.round(ce(de.r*255,0,255))*65536+Math.round(ce(de.g*255,0,255))*256+Math.round(ce(de.b*255,0,255))}getHexString(e=ne){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=le.workingColorSpace){le.fromWorkingColorSpace(de.copy(this),t);const s=de.r,i=de.g,n=de.b,r=Math.max(s,i,n),o=Math.min(s,i,n);let a,h;const c=(o+r)/2;if(o===r)a=0,h=0;else{const l=r-o;switch(h=c<=.5?l/(r+o):l/(2-r-o),r){case s:a=(i-n)/l+(i<n?6:0);break;case i:a=(n-s)/l+2;break;case n:a=(s-i)/l+4;break}a/=6}return e.h=a,e.s=h,e.l=c,e}getRGB(e,t=le.workingColorSpace){return le.fromWorkingColorSpace(de.copy(this),t),e.r=de.r,e.g=de.g,e.b=de.b,e}getStyle(e=ne){le.fromWorkingColorSpace(de.copy(this),e);const t=de.r,s=de.g,i=de.b;return e!==ne?`color(${e} ${t.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(s*255)},${Math.round(i*255)})`}offsetHSL(e,t,s){return this.getHSL(ft),this.setHSL(ft.h+e,ft.s+t,ft.l+s)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,s){return this.r=e.r+(t.r-e.r)*s,this.g=e.g+(t.g-e.g)*s,this.b=e.b+(t.b-e.b)*s,this}lerpHSL(e,t){this.getHSL(ft),e.getHSL(hi);const s=Cs(ft.h,hi.h,t),i=Cs(ft.s,hi.s,t),n=Cs(ft.l,hi.l,t);return this.setHSL(s,i,n),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,s=this.g,i=this.b,n=e.elements;return this.r=n[0]*t+n[3]*s+n[6]*i,this.g=n[1]*t+n[4]*s+n[7]*i,this.b=n[2]*t+n[5]*s+n[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const de=new X;X.NAMES=Bo;let ph=0;class wt extends Ut{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ph++}),this.uuid=Ne(),this.name="",this.type="Material",this.blending=_r,this.side=Xs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Lr,this.blendDst=vr,this.blendEquation=kr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new X(0,0,0),this.blendAlpha=0,this.depthFunc=Gr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=oo,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ot,this.stencilZFail=Ot,this.stencilZPass=Ot,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const s=e[t];if(s===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(s):i&&i.isVector3&&s&&s.isVector3?i.copy(s):this[t]=s}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==_r&&(s.blending=this.blending),this.side!==Xs&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==Lr&&(s.blendSrc=this.blendSrc),this.blendDst!==vr&&(s.blendDst=this.blendDst),this.blendEquation!==kr&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==Gr&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==oo&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ot&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Ot&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Ot&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function i(n){const r=[];for(const o in n){const a=n[o];delete a.metadata,r.push(a)}return r}if(t){const n=i(e.textures),r=i(e.images);n.length>0&&(s.textures=n),r.length>0&&(s.images=r)}return s}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let s=null;if(t!==null){const i=t.length;s=new Array(i);for(let n=0;n!==i;++n)s[n]=t[n].clone()}return this.clippingPlanes=s,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Zt extends wt{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new X(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Jt,this.combine=xA,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Z=new b,ci=new q;class ye{constructor(e,t,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=s,this.usage=$s,this.updateRanges=[],this.gpuType=ht,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,s){e*=this.itemSize,s*=t.itemSize;for(let i=0,n=this.itemSize;i<n;i++)this.array[e+i]=t.array[s+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,s=this.count;t<s;t++)ci.fromBufferAttribute(this,t),ci.applyMatrix3(e),this.setXY(t,ci.x,ci.y);else if(this.itemSize===3)for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyMatrix3(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}applyMatrix4(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyMatrix4(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}applyNormalMatrix(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyNormalMatrix(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}transformDirection(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.transformDirection(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let s=this.array[e*this.itemSize+t];return this.normalized&&(s=Re(s,this.array)),s}setComponent(e,t,s){return this.normalized&&(s=z(s,this.array)),this.array[e*this.itemSize+t]=s,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Re(t,this.array)),t}setX(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Re(t,this.array)),t}setY(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Re(t,this.array)),t}setZ(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Re(t,this.array)),t}setW(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,s){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array)),this.array[e+0]=t,this.array[e+1]=s,this}setXYZ(e,t,s,i){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array)),this.array[e+0]=t,this.array[e+1]=s,this.array[e+2]=i,this}setXYZW(e,t,s,i,n){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array),n=z(n,this.array)),this.array[e+0]=t,this.array[e+1]=s,this.array[e+2]=i,this.array[e+3]=n,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==$s&&(e.usage=this.usage),e}}class fh extends ye{constructor(e,t,s){super(new Uint16Array(e),t,s)}}class mh extends ye{constructor(e,t,s){super(new Uint32Array(e),t,s)}}class Nn extends ye{constructor(e,t,s){super(new Float32Array(e),t,s)}}let Ih=0;const Qe=new k,Rn=new Y,$t=new b,Ee=new Ye,Ts=new Ye,re=new b;class Tt extends Ut{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ih++}),this.uuid=Ne(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(th(e)?mh:fh)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,s=0){this.groups.push({start:e,count:t,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const n=new Fe().getNormalMatrix(e);s.applyNormalMatrix(n),s.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Qe.makeRotationFromQuaternion(e),this.applyMatrix4(Qe),this}rotateX(e){return Qe.makeRotationX(e),this.applyMatrix4(Qe),this}rotateY(e){return Qe.makeRotationY(e),this.applyMatrix4(Qe),this}rotateZ(e){return Qe.makeRotationZ(e),this.applyMatrix4(Qe),this}translate(e,t,s){return Qe.makeTranslation(e,t,s),this.applyMatrix4(Qe),this}scale(e,t,s){return Qe.makeScale(e,t,s),this.applyMatrix4(Qe),this}lookAt(e){return Rn.lookAt(e),Rn.updateMatrix(),this.applyMatrix4(Rn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter($t).negate(),this.translate($t.x,$t.y,$t.z),this}setFromPoints(e){const t=[];for(let s=0,i=e.length;s<i;s++){const n=e[s];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new Nn(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ye);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new b(-1/0,-1/0,-1/0),new b(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let s=0,i=t.length;s<i;s++){const n=t[s];Ee.setFromBufferAttribute(n),this.morphTargetsRelative?(re.addVectors(this.boundingBox.min,Ee.min),this.boundingBox.expandByPoint(re),re.addVectors(this.boundingBox.max,Ee.max),this.boundingBox.expandByPoint(re)):(this.boundingBox.expandByPoint(Ee.min),this.boundingBox.expandByPoint(Ee.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Oe);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new b,1/0);return}if(e){const s=this.boundingSphere.center;if(Ee.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const o=t[n];Ts.setFromBufferAttribute(o),this.morphTargetsRelative?(re.addVectors(Ee.min,Ts.min),Ee.expandByPoint(re),re.addVectors(Ee.max,Ts.max),Ee.expandByPoint(re)):(Ee.expandByPoint(Ts.min),Ee.expandByPoint(Ts.max))}Ee.getCenter(s);let i=0;for(let n=0,r=e.count;n<r;n++)re.fromBufferAttribute(e,n),i=Math.max(i,s.distanceToSquared(re));if(t)for(let n=0,r=t.length;n<r;n++){const o=t[n],a=this.morphTargetsRelative;for(let h=0,c=o.count;h<c;h++)re.fromBufferAttribute(o,h),a&&($t.fromBufferAttribute(e,h),re.add($t)),i=Math.max(i,s.distanceToSquared(re))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=t.position,i=t.normal,n=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ye(new Float32Array(4*s.count),4));const r=this.getAttribute("tangent"),o=[],a=[];for(let R=0;R<s.count;R++)o[R]=new b,a[R]=new b;const h=new b,c=new b,l=new b,u=new q,d=new q,g=new q,p=new b,f=new b;function m(R,D,O){h.fromBufferAttribute(s,R),c.fromBufferAttribute(s,D),l.fromBufferAttribute(s,O),u.fromBufferAttribute(n,R),d.fromBufferAttribute(n,D),g.fromBufferAttribute(n,O),c.sub(h),l.sub(h),d.sub(u),g.sub(u);const H=1/(d.x*g.y-g.x*d.y);isFinite(H)&&(p.copy(c).multiplyScalar(g.y).addScaledVector(l,-d.y).multiplyScalar(H),f.copy(l).multiplyScalar(d.x).addScaledVector(c,-g.x).multiplyScalar(H),o[R].add(p),o[D].add(p),o[O].add(p),a[R].add(f),a[D].add(f),a[O].add(f))}let E=this.groups;E.length===0&&(E=[{start:0,count:e.count}]);for(let R=0,D=E.length;R<D;++R){const O=E[R],H=O.start,ae=O.count;for(let W=H,Ae=H+ae;W<Ae;W+=3)m(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const C=new b,y=new b,Q=new b,M=new b;function S(R){Q.fromBufferAttribute(i,R),M.copy(Q);const D=o[R];C.copy(D),C.sub(Q.multiplyScalar(Q.dot(D))).normalize(),y.crossVectors(M,D);const H=y.dot(a[R])<0?-1:1;r.setXYZW(R,C.x,C.y,C.z,H)}for(let R=0,D=E.length;R<D;++R){const O=E[R],H=O.start,ae=O.count;for(let W=H,Ae=H+ae;W<Ae;W+=3)S(e.getX(W+0)),S(e.getX(W+1)),S(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new ye(new Float32Array(t.count*3),3),this.setAttribute("normal",s);else for(let u=0,d=s.count;u<d;u++)s.setXYZ(u,0,0,0);const i=new b,n=new b,r=new b,o=new b,a=new b,h=new b,c=new b,l=new b;if(e)for(let u=0,d=e.count;u<d;u+=3){const g=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);i.fromBufferAttribute(t,g),n.fromBufferAttribute(t,p),r.fromBufferAttribute(t,f),c.subVectors(r,n),l.subVectors(i,n),c.cross(l),o.fromBufferAttribute(s,g),a.fromBufferAttribute(s,p),h.fromBufferAttribute(s,f),o.add(c),a.add(c),h.add(c),s.setXYZ(g,o.x,o.y,o.z),s.setXYZ(p,a.x,a.y,a.z),s.setXYZ(f,h.x,h.y,h.z)}else for(let u=0,d=t.count;u<d;u+=3)i.fromBufferAttribute(t,u+0),n.fromBufferAttribute(t,u+1),r.fromBufferAttribute(t,u+2),c.subVectors(r,n),l.subVectors(i,n),c.cross(l),s.setXYZ(u+0,c.x,c.y,c.z),s.setXYZ(u+1,c.x,c.y,c.z),s.setXYZ(u+2,c.x,c.y,c.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,s=e.count;t<s;t++)re.fromBufferAttribute(e,t),re.normalize(),e.setXYZ(t,re.x,re.y,re.z)}toNonIndexed(){function e(o,a){const h=o.array,c=o.itemSize,l=o.normalized,u=new h.constructor(a.length*c);let d=0,g=0;for(let p=0,f=a.length;p<f;p++){o.isInterleavedBufferAttribute?d=a[p]*o.data.stride+o.offset:d=a[p]*c;for(let m=0;m<c;m++)u[g++]=h[d++]}return new ye(u,c,l)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Tt,s=this.index.array,i=this.attributes;for(const o in i){const a=i[o],h=e(a,s);t.setAttribute(o,h)}const n=this.morphAttributes;for(const o in n){const a=[],h=n[o];for(let c=0,l=h.length;c<l;c++){const u=h[c],d=e(u,s);a.push(d)}t.morphAttributes[o]=a}t.morphTargetsRelative=this.morphTargetsRelative;const r=this.groups;for(let o=0,a=r.length;o<a;o++){const h=r[o];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const a=this.parameters;for(const h in a)a[h]!==void 0&&(e[h]=a[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const s=this.attributes;for(const a in s){const h=s[a];e.data.attributes[a]=h.toJSON(e.data)}const i={};let n=!1;for(const a in this.morphAttributes){const h=this.morphAttributes[a],c=[];for(let l=0,u=h.length;l<u;l++){const d=h[l];c.push(d.toJSON(e.data))}c.length>0&&(i[a]=c,n=!0)}n&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(t));const i=e.attributes;for(const h in i){const c=i[h];this.setAttribute(h,c.clone(t))}const n=e.morphAttributes;for(const h in n){const c=[],l=n[h];for(let u=0,d=l.length;u<d;u++)c.push(l[u].clone(t));this.morphAttributes[h]=c}this.morphTargetsRelative=e.morphTargetsRelative;const r=e.groups;for(let h=0,c=r.length;h<c;h++){const l=r[h];this.addGroup(l.start,l.count,l.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const a=e.boundingSphere;return a!==null&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const xo=new k,St=new oi,li=new Oe,Qo=new b,ui=new b,di=new b,gi=new b,Fn=new b,pi=new b,wo=new b,fi=new b;class mi extends Y{constructor(e=new Tt,t=new Zt){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}getVertexPosition(e,t){const s=this.geometry,i=s.attributes.position,n=s.morphAttributes.position,r=s.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(n&&o){pi.set(0,0,0);for(let a=0,h=n.length;a<h;a++){const c=o[a],l=n[a];c!==0&&(Fn.fromBufferAttribute(l,e),r?pi.addScaledVector(Fn,c):pi.addScaledVector(Fn.sub(t),c))}t.add(pi)}return t}raycast(e,t){const s=this.geometry,i=this.material,n=this.matrixWorld;i!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),li.copy(s.boundingSphere),li.applyMatrix4(n),St.copy(e.ray).recast(e.near),!(li.containsPoint(St.origin)===!1&&(St.intersectSphere(li,Qo)===null||St.origin.distanceToSquared(Qo)>(e.far-e.near)**2))&&(xo.copy(n).invert(),St.copy(e.ray).applyMatrix4(xo),!(s.boundingBox!==null&&St.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,t,St)))}_computeIntersections(e,t,s){let i;const n=this.geometry,r=this.material,o=n.index,a=n.attributes.position,h=n.attributes.uv,c=n.attributes.uv1,l=n.attributes.normal,u=n.groups,d=n.drawRange;if(o!==null)if(Array.isArray(r))for(let g=0,p=u.length;g<p;g++){const f=u[g],m=r[f.materialIndex],E=Math.max(f.start,d.start),C=Math.min(o.count,Math.min(f.start+f.count,d.start+d.count));for(let y=E,Q=C;y<Q;y+=3){const M=o.getX(y),S=o.getX(y+1),R=o.getX(y+2);i=Ii(this,m,e,s,h,c,l,M,S,R),i&&(i.faceIndex=Math.floor(y/3),i.face.materialIndex=f.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),p=Math.min(o.count,d.start+d.count);for(let f=g,m=p;f<m;f+=3){const E=o.getX(f),C=o.getX(f+1),y=o.getX(f+2);i=Ii(this,r,e,s,h,c,l,E,C,y),i&&(i.faceIndex=Math.floor(f/3),t.push(i))}}else if(a!==void 0)if(Array.isArray(r))for(let g=0,p=u.length;g<p;g++){const f=u[g],m=r[f.materialIndex],E=Math.max(f.start,d.start),C=Math.min(a.count,Math.min(f.start+f.count,d.start+d.count));for(let y=E,Q=C;y<Q;y+=3){const M=y,S=y+1,R=y+2;i=Ii(this,m,e,s,h,c,l,M,S,R),i&&(i.faceIndex=Math.floor(y/3),i.face.materialIndex=f.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),p=Math.min(a.count,d.start+d.count);for(let f=g,m=p;f<m;f+=3){const E=f,C=f+1,y=f+2;i=Ii(this,r,e,s,h,c,l,E,C,y),i&&(i.faceIndex=Math.floor(f/3),t.push(i))}}}}function bh(A,e,t,s,i,n,r,o){let a;if(e.side===Dr?a=s.intersectTriangle(r,n,i,!0,o):a=s.intersectTriangle(i,n,r,e.side===Xs,o),a===null)return null;fi.copy(o),fi.applyMatrix4(A.matrixWorld);const h=t.ray.origin.distanceTo(fi);return h<t.near||h>t.far?null:{distance:h,point:fi.clone(),object:A}}function Ii(A,e,t,s,i,n,r,o,a,h){A.getVertexPosition(o,ui),A.getVertexPosition(a,di),A.getVertexPosition(h,gi);const c=bh(A,e,t,s,ui,di,gi,wo);if(c){const l=new b;Le.getBarycoord(wo,ui,di,gi,l),i&&(c.uv=Le.getInterpolatedAttribute(i,o,a,h,l,new q)),n&&(c.uv1=Le.getInterpolatedAttribute(n,o,a,h,l,new q)),r&&(c.normal=Le.getInterpolatedAttribute(r,o,a,h,l,new b),c.normal.dot(s.direction)>0&&c.normal.multiplyScalar(-1));const u={a:o,b:a,c:h,normal:new b,materialIndex:0};Le.getNormal(ui,di,gi,u.normal),c.face=u,c.barycoord=l}return c}const bi=new b,yi=new Ke,Ue=new b;class To extends Y{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new k,this.projectionMatrix=new k,this.projectionMatrixInverse=new k,this.coordinateSystem=lt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(bi,yi,Ue),Ue.x===1&&Ue.y===1&&Ue.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(bi,yi,Ue.set(1,1,1)).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorld.decompose(bi,yi,Ue),Ue.x===1&&Ue.y===1&&Ue.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(bi,yi,Ue.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const mt=new b,So=new q,Mo=new q;class Dn extends To{constructor(e=50,t=1,s=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Es*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ys*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Es*2*Math.atan(Math.tan(ys*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,s){mt.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(mt.x,mt.y).multiplyScalar(-e/mt.z),mt.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(mt.x,mt.y).multiplyScalar(-e/mt.z)}getViewSize(e,t){return this.getViewBounds(e,So,Mo),t.subVectors(Mo,So)}setViewOffset(e,t,s,i,n,r){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=n,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ys*.5*this.fov)/this.zoom,s=2*t,i=this.aspect*s,n=-.5*i;const r=this.view;if(this.view!==null&&this.view.enabled){const a=r.fullWidth,h=r.fullHeight;n+=r.offsetX*i/a,t-=r.offsetY*s/h,i*=r.width/a,s*=r.height/h}const o=this.filmOffset;o!==0&&(n+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,t,t-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const _n=new b,yh=new b,Eh=new Fe;class Mt{constructor(e=new b(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,s,i){return this.normal.set(e,t,s),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,s){const i=_n.subVectors(s,t).cross(yh.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const s=e.delta(_n),i=this.normal.dot(s);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const n=-(e.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:t.copy(e.start).addScaledVector(s,n)}intersectsLine(e){const t=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return t<0&&s>0||s<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||Eh.getNormalMatrix(e),i=this.coplanarPoint(_n).applyMatrix4(e),n=this.normal.applyMatrix3(s).normalize();return this.constant=-i.dot(n),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Nt=new Oe,Ei=new b;class Ch{constructor(e=new Mt,t=new Mt,s=new Mt,i=new Mt,n=new Mt,r=new Mt){this.planes=[e,t,s,i,n,r]}set(e,t,s,i,n,r){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(s),o[3].copy(i),o[4].copy(n),o[5].copy(r),this}copy(e){const t=this.planes;for(let s=0;s<6;s++)t[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,t=lt){const s=this.planes,i=e.elements,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],c=i[5],l=i[6],u=i[7],d=i[8],g=i[9],p=i[10],f=i[11],m=i[12],E=i[13],C=i[14],y=i[15];if(s[0].setComponents(a-n,u-h,f-d,y-m).normalize(),s[1].setComponents(a+n,u+h,f+d,y+m).normalize(),s[2].setComponents(a+r,u+c,f+g,y+E).normalize(),s[3].setComponents(a-r,u-c,f-g,y-E).normalize(),s[4].setComponents(a-o,u-l,f-p,y-C).normalize(),t===lt)s[5].setComponents(a+o,u+l,f+p,y+C).normalize();else if(t===ei)s[5].setComponents(o,l,p,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Nt.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Nt.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Nt)}intersectsSprite(e){return Nt.center.set(0,0,0),Nt.radius=.7071067811865476,Nt.applyMatrix4(e.matrixWorld),this.intersectsSphere(Nt)}intersectsSphere(e){const t=this.planes,s=e.center,i=-e.radius;for(let n=0;n<6;n++)if(t[n].distanceToPoint(s)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let s=0;s<6;s++){const i=t[s];if(Ei.x=i.normal.x>0?e.max.x:e.min.x,Ei.y=i.normal.y>0?e.max.y:e.min.y,Ei.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ei)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let s=0;s<6;s++)if(t[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class No extends To{constructor(e=-1,t=1,s=1,i=-1,n=.1,r=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=s,this.bottom=i,this.near=n,this.far=r,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,s,i,n,r){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=n,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let n=s-e,r=s+e,o=i+t,a=i-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=h*this.view.offsetX,r=n+h*this.view.width,o-=c*this.view.offsetY,a=o-c*this.view.height}this.projectionMatrix.makeOrthographic(n,r,o,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class Ro extends ue{constructor(e,t,s,i,n,r,o,a,h,c=tn){if(c!==tn&&c!==jr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");s===void 0&&c===tn&&(s=Hr),s===void 0&&c===jr&&(s=NA),super(null,i,n,r,o,a,c,s,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=o!==void 0?o:Me,this.minFilter=a!==void 0?a:Me,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class kn extends Y{constructor(){super(),this.isGroup=!0,this.type="Group"}}class Fo{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=$s,this.updateRanges=[],this.version=0,this.uuid=Ne()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let i=0,n=this.stride;i<n;i++)this.array[e+i]=t.array[s+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ne()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),s=new this.constructor(t,this.stride);return s.setUsage(this.usage),s}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ne()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const pe=new b;class Ci{constructor(e,t,s,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=s,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,s=this.data.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.applyMatrix4(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}applyNormalMatrix(e){for(let t=0,s=this.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.applyNormalMatrix(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}transformDirection(e){for(let t=0,s=this.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.transformDirection(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}getComponent(e,t){let s=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(s=Re(s,this.array)),s}setComponent(e,t,s){return this.normalized&&(s=z(s,this.array)),this.data.array[e*this.data.stride+this.offset+t]=s,this}setX(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Re(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Re(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Re(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Re(t,this.array)),t}setXY(e,t,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this}setXYZ(e,t,s,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this.data.array[e+2]=i,this}setXYZW(e,t,s,i,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array),n=z(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this.data.array[e+2]=i,this.data.array[e+3]=n,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let s=0;s<this.count;s++){const i=s*this.data.stride+this.offset;for(let n=0;n<this.itemSize;n++)t.push(this.data.array[i+n])}return new ye(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ci(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let s=0;s<this.count;s++){const i=s*this.data.stride+this.offset;for(let n=0;n<this.itemSize;n++)t.push(this.data.array[i+n])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const Do=new b,_o=new K,ko=new K,Bh=new b,Lo=new k,Bi=new b,Ln=new Oe,vo=new k,vn=new oi;class xh extends mi{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Or,this.bindMatrix=new k,this.bindMatrixInverse=new k,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Ye),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let s=0;s<t.count;s++)this.getVertexPosition(s,Bi),this.boundingBox.expandByPoint(Bi)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Oe),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let s=0;s<t.count;s++)this.getVertexPosition(s,Bi),this.boundingSphere.expandByPoint(Bi)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const s=this.material,i=this.matrixWorld;s!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ln.copy(this.boundingSphere),Ln.applyMatrix4(i),e.ray.intersectsSphere(Ln)!==!1&&(vo.copy(i).invert(),vn.copy(e.ray).applyMatrix4(vo),!(this.boundingBox!==null&&vn.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,vn)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new K,t=this.geometry.attributes.skinWeight;for(let s=0,i=t.count;s<i;s++){e.fromBufferAttribute(t,s);const n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(s,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Or?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===QA?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const s=this.skeleton,i=this.geometry;_o.fromBufferAttribute(i.attributes.skinIndex,e),ko.fromBufferAttribute(i.attributes.skinWeight,e),Do.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let n=0;n<4;n++){const r=ko.getComponent(n);if(r!==0){const o=_o.getComponent(n);Lo.multiplyMatrices(s.bones[o].matrixWorld,s.boneInverses[o]),t.addScaledVector(Bh.copy(Do).applyMatrix4(Lo),r)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Go extends Y{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Gn extends ue{constructor(e=null,t=1,s=1,i,n,r,o,a,h=Me,c=Me,l,u){super(null,r,o,a,h,c,i,n,l,u),this.isDataTexture=!0,this.image={data:e,width:t,height:s},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Oo=new k,Qh=new k;class On{constructor(e=[],t=[]){this.uuid=Ne(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let s=0,i=this.bones.length;s<i;s++)this.boneInverses.push(new k)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const s=new k;this.bones[e]&&s.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(s)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const s=this.bones[e];s&&s.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const s=this.bones[e];s&&(s.parent&&s.parent.isBone?(s.matrix.copy(s.parent.matrixWorld).invert(),s.matrix.multiply(s.matrixWorld)):s.matrix.copy(s.matrixWorld),s.matrix.decompose(s.position,s.quaternion,s.scale))}}update(){const e=this.bones,t=this.boneInverses,s=this.boneMatrices,i=this.boneTexture;for(let n=0,r=e.length;n<r;n++){const o=e[n]?e[n].matrixWorld:Qh;Oo.multiplyMatrices(o,t[n]),Oo.toArray(s,n*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new On(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const s=new Gn(t,e,e,ct,ht);return s.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=s,this}getBoneByName(e){for(let t=0,s=this.bones.length;t<s;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let s=0,i=e.bones.length;s<i;s++){const n=e.bones[s];let r=t[n];r===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new Go),this.bones.push(r),this.boneInverses.push(new k().fromArray(e.boneInverses[s]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,s=this.boneInverses;for(let i=0,n=t.length;i<n;i++){const r=t[i];e.bones.push(r.uuid);const o=s[i];e.boneInverses.push(o.toArray())}return e}}class Un extends ye{constructor(e,t,s,i=1){super(e,t,s),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const es=new k,Uo=new k,xi=[],zo=new Ye,wh=new k,Ss=new mi,Ms=new Oe;class Th extends mi{constructor(e,t,s){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Un(new Float32Array(s*16),16),this.instanceColor=null,this.morphTexture=null,this.count=s,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<s;i++)this.setMatrixAt(i,wh)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Ye),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let s=0;s<t;s++)this.getMatrixAt(s,es),zo.copy(e.boundingBox).applyMatrix4(es),this.boundingBox.union(zo)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Oe),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let s=0;s<t;s++)this.getMatrixAt(s,es),Ms.copy(e.boundingSphere).applyMatrix4(es),this.boundingSphere.union(Ms)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const s=t.morphTargetInfluences,i=this.morphTexture.source.data.data,n=s.length+1,r=e*n+1;for(let o=0;o<s.length;o++)s[o]=i[r+o]}raycast(e,t){const s=this.matrixWorld,i=this.count;if(Ss.geometry=this.geometry,Ss.material=this.material,Ss.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ms.copy(this.boundingSphere),Ms.applyMatrix4(s),e.ray.intersectsSphere(Ms)!==!1))for(let n=0;n<i;n++){this.getMatrixAt(n,es),Uo.multiplyMatrices(s,es),Ss.matrixWorld=Uo,Ss.raycast(e,xi);for(let r=0,o=xi.length;r<o;r++){const a=xi[r];a.instanceId=n,a.object=this,t.push(a)}xi.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Un(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const s=t.morphTargetInfluences,i=s.length+1;this.morphTexture===null&&(this.morphTexture=new Gn(new Float32Array(i*this.count),i,this.count,vt,ht));const n=this.morphTexture.source.data.data;let r=0;for(let h=0;h<s.length;h++)r+=s[h];const o=this.geometry.morphTargetsRelative?1:1-r,a=i*e;n[a]=o,n.set(s,a+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class Po extends wt{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new X(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Qi=new b,wi=new b,Ho=new k,Ns=new oi,Ti=new Oe,zn=new b,qo=new b;class Pn extends Y{constructor(e=new Tt,t=new Po){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,s=[0];for(let i=1,n=t.count;i<n;i++)Qi.fromBufferAttribute(t,i-1),wi.fromBufferAttribute(t,i),s[i]=s[i-1],s[i]+=Qi.distanceTo(wi);e.setAttribute("lineDistance",new Nn(s,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const s=this.geometry,i=this.matrixWorld,n=e.params.Line.threshold,r=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),Ti.copy(s.boundingSphere),Ti.applyMatrix4(i),Ti.radius+=n,e.ray.intersectsSphere(Ti)===!1)return;Ho.copy(i).invert(),Ns.copy(e.ray).applyMatrix4(Ho);const o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=this.isLineSegments?2:1,c=s.index,u=s.attributes.position;if(c!==null){const d=Math.max(0,r.start),g=Math.min(c.count,r.start+r.count);for(let p=d,f=g-1;p<f;p+=h){const m=c.getX(p),E=c.getX(p+1),C=Si(this,e,Ns,a,m,E);C&&t.push(C)}if(this.isLineLoop){const p=c.getX(g-1),f=c.getX(d),m=Si(this,e,Ns,a,p,f);m&&t.push(m)}}else{const d=Math.max(0,r.start),g=Math.min(u.count,r.start+r.count);for(let p=d,f=g-1;p<f;p+=h){const m=Si(this,e,Ns,a,p,p+1);m&&t.push(m)}if(this.isLineLoop){const p=Si(this,e,Ns,a,g-1,d);p&&t.push(p)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}}function Si(A,e,t,s,i,n){const r=A.geometry.attributes.position;if(Qi.fromBufferAttribute(r,i),wi.fromBufferAttribute(r,n),t.distanceSqToSegment(Qi,wi,zn,qo)>s)return;zn.applyMatrix4(A.matrixWorld);const a=e.ray.origin.distanceTo(zn);if(!(a<e.near||a>e.far))return{distance:a,point:qo.clone().applyMatrix4(A.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:A}}const Vo=new b,jo=new b;class Sh extends Pn{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,s=[];for(let i=0,n=t.count;i<n;i+=2)Vo.fromBufferAttribute(t,i),jo.fromBufferAttribute(t,i+1),s[i]=i===0?0:s[i-1],s[i+1]=s[i]+Vo.distanceTo(jo);e.setAttribute("lineDistance",new Nn(s,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Mh extends Pn{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Jo extends wt{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new X(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Wo=new k,Hn=new oi,Mi=new Oe,Ni=new b;class Nh extends Y{constructor(e=new Tt,t=new Jo){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const s=this.geometry,i=this.matrixWorld,n=e.params.Points.threshold,r=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),Mi.copy(s.boundingSphere),Mi.applyMatrix4(i),Mi.radius+=n,e.ray.intersectsSphere(Mi)===!1)return;Wo.copy(i).invert(),Hn.copy(e.ray).applyMatrix4(Wo);const o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=s.index,l=s.attributes.position;if(h!==null){const u=Math.max(0,r.start),d=Math.min(h.count,r.start+r.count);for(let g=u,p=d;g<p;g++){const f=h.getX(g);Ni.fromBufferAttribute(l,f),Ko(Ni,f,a,i,e,t,this)}}else{const u=Math.max(0,r.start),d=Math.min(l.count,r.start+r.count);for(let g=u,p=d;g<p;g++)Ni.fromBufferAttribute(l,g),Ko(Ni,g,a,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}}function Ko(A,e,t,s,i,n,r){const o=Hn.distanceSqToPoint(A);if(o<t){const a=new b;Hn.closestPointToPoint(A,a),a.applyMatrix4(s);const h=i.ray.origin.distanceTo(a);if(h<i.near||h>i.far)return;n.push({distance:h,distanceToRay:Math.sqrt(o),point:a,index:e,face:null,faceIndex:null,barycoord:null,object:r})}}class Rh extends ue{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Me,this.minFilter=Me,this.generateMipmaps=!1,this.needsUpdate=!0}}class Ri extends ue{constructor(e,t,s,i,n,r,o,a,h,c,l,u){super(null,r,o,a,h,c,i,n,l,u),this.isCompressedTexture=!0,this.image={width:t,height:s},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Fh extends Ri{constructor(e,t,s,i,n,r){super(e,t,s,n,r),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ct,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Dh extends Ri{constructor(e,t,s){super(void 0,e[0].width,e[0].height,t,s,zr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class qn extends wt{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new X(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new X(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=An,this.normalScale=new q(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Jt,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ze extends qn{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new q(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ce(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new X(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new X(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new X(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Fi(A,e,t){return!A||!t&&A.constructor===e?A:typeof e.BYTES_PER_ELEMENT=="number"?new e(A):Array.prototype.slice.call(A)}function _h(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function kh(A){function e(i,n){return A[i]-A[n]}const t=A.length,s=new Array(t);for(let i=0;i!==t;++i)s[i]=i;return s.sort(e),s}function Yo(A,e,t){const s=A.length,i=new A.constructor(s);for(let n=0,r=0;r!==s;++n){const o=t[n]*e;for(let a=0;a!==e;++a)i[r++]=A[o+a]}return i}function Xo(A,e,t,s){let i=1,n=A[0];for(;n!==void 0&&n[s]===void 0;)n=A[i++];if(n===void 0)return;let r=n[s];if(r!==void 0)if(Array.isArray(r))do r=n[s],r!==void 0&&(e.push(n.time),t.push.apply(t,r)),n=A[i++];while(n!==void 0);else if(r.toArray!==void 0)do r=n[s],r!==void 0&&(e.push(n.time),r.toArray(t,t.length)),n=A[i++];while(n!==void 0);else do r=n[s],r!==void 0&&(e.push(n.time),t.push(r)),n=A[i++];while(n!==void 0)}class Rs{constructor(e,t,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,i=t[s],n=t[s-1];s:{e:{let r;t:{i:if(!(e<i)){for(let o=s+2;;){if(i===void 0){if(e<n)break i;return s=t.length,this._cachedIndex=s,this.copySampleValue_(s-1)}if(s===o)break;if(n=i,i=t[++s],e<i)break e}r=t.length;break t}if(!(e>=n)){const o=t[1];e<o&&(s=2,n=o);for(let a=s-2;;){if(n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===a)break;if(i=n,n=t[--s-1],e>=n)break e}r=s,s=0;break t}break s}for(;s<r;){const o=s+r>>>1;e<t[o]?r=o:s=o+1}if(i=t[s],n=t[s-1],n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return s=t.length,this._cachedIndex=s,this.copySampleValue_(s-1)}this._cachedIndex=s,this.intervalChanged_(s,n,i)}return this.interpolate_(s,n,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,i=this.valueSize,n=e*i;for(let r=0;r!==i;++r)t[r]=s[n+r];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Lh extends Rs{constructor(e,t,s,i){super(e,t,s,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Zr,endingEnd:Zr}}intervalChanged_(e,t,s){const i=this.parameterPositions;let n=e-2,r=e+1,o=i[n],a=i[r];if(o===void 0)switch(this.getSettings_().endingStart){case $r:n=e,o=2*t-s;break;case eo:n=i.length-2,o=t+i[n]-i[n+1];break;default:n=e,o=s}if(a===void 0)switch(this.getSettings_().endingEnd){case $r:r=e,a=2*s-t;break;case eo:r=1,a=s+i[1]-i[0];break;default:r=e-1,a=t}const h=(s-t)*.5,c=this.valueSize;this._weightPrev=h/(t-o),this._weightNext=h/(a-s),this._offsetPrev=n*c,this._offsetNext=r*c}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=e*o,h=a-o,c=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,d=this._weightNext,g=(s-t)/(i-t),p=g*g,f=p*g,m=-u*f+2*u*p-u*g,E=(1+u)*f+(-1.5-2*u)*p+(-.5+u)*g+1,C=(-1-d)*f+(1.5+d)*p+.5*g,y=d*f-d*p;for(let Q=0;Q!==o;++Q)n[Q]=m*r[c+Q]+E*r[h+Q]+C*r[a+Q]+y*r[l+Q];return n}}class vh extends Rs{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=e*o,h=a-o,c=(s-t)/(i-t),l=1-c;for(let u=0;u!==o;++u)n[u]=r[h+u]*l+r[a+u]*c;return n}}class Gh extends Rs{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Pe{constructor(e,t,s,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Fi(t,this.TimeBufferType),this.values=Fi(s,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let s;if(t.toJSON!==this.toJSON)s=t.toJSON(e);else{s={name:e.name,times:Fi(e.times,Array),values:Fi(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(s.interpolation=i)}return s.type=e.ValueTypeName,s}InterpolantFactoryMethodDiscrete(e){return new Gh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new vh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Lh(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Is:t=this.InterpolantFactoryMethodDiscrete;break;case bs:t=this.InterpolantFactoryMethodLinear;break;case on:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const s="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(s);return console.warn("THREE.KeyframeTrack:",s),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Is;case this.InterpolantFactoryMethodLinear:return bs;case this.InterpolantFactoryMethodSmooth:return on}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let s=0,i=t.length;s!==i;++s)t[s]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let s=0,i=t.length;s!==i;++s)t[s]*=e}return this}trim(e,t){const s=this.times,i=s.length;let n=0,r=i-1;for(;n!==i&&s[n]<e;)++n;for(;r!==-1&&s[r]>t;)--r;if(++r,n!==0||r!==i){n>=r&&(r=Math.max(r,1),n=r-1);const o=this.getValueSize();this.times=s.slice(n,r),this.values=this.values.slice(n*o,r*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,n=s.length;n===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let o=0;o!==n;o++){const a=s[o];if(typeof a=="number"&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,a),e=!1;break}if(r!==null&&r>a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,a,r),e=!1;break}r=a}if(i!==void 0&&_h(i))for(let o=0,a=i.length;o!==a;++o){const h=i[o];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===on,n=e.length-1;let r=1;for(let o=1;o<n;++o){let a=!1;const h=e[o],c=e[o+1];if(h!==c&&(o!==1||h!==e[0]))if(i)a=!0;else{const l=o*s,u=l-s,d=l+s;for(let g=0;g!==s;++g){const p=t[l+g];if(p!==t[u+g]||p!==t[d+g]){a=!0;break}}}if(a){if(o!==r){e[r]=e[o];const l=o*s,u=r*s;for(let d=0;d!==s;++d)t[u+d]=t[l+d]}++r}}if(n>0){e[r]=e[n];for(let o=n*s,a=r*s,h=0;h!==s;++h)t[a+h]=t[o+h];++r}return r!==e.length?(this.times=e.slice(0,r),this.values=t.slice(0,r*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,i=new s(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Pe.prototype.TimeBufferType=Float32Array,Pe.prototype.ValueBufferType=Float32Array,Pe.prototype.DefaultInterpolation=bs;class ts extends Pe{constructor(e,t,s){super(e,t,s)}}ts.prototype.ValueTypeName="bool",ts.prototype.ValueBufferType=Array,ts.prototype.DefaultInterpolation=Is,ts.prototype.InterpolantFactoryMethodLinear=void 0,ts.prototype.InterpolantFactoryMethodSmooth=void 0;class Zo extends Pe{}Zo.prototype.ValueTypeName="color";class ss extends Pe{}ss.prototype.ValueTypeName="number";class Oh extends Rs{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=(s-t)/(i-t);let h=e*o;for(let c=h+o;h!==c;h+=4)Ke.slerpFlat(n,0,r,h-o,r,h,a);return n}}class is extends Pe{InterpolantFactoryMethodLinear(e){return new Oh(this.times,this.values,this.getValueSize(),e)}}is.prototype.ValueTypeName="quaternion",is.prototype.InterpolantFactoryMethodSmooth=void 0;class ns extends Pe{constructor(e,t,s){super(e,t,s)}}ns.prototype.ValueTypeName="string",ns.prototype.ValueBufferType=Array,ns.prototype.DefaultInterpolation=Is,ns.prototype.InterpolantFactoryMethodLinear=void 0,ns.prototype.InterpolantFactoryMethodSmooth=void 0;class rs extends Pe{}rs.prototype.ValueTypeName="vector";class Uh{constructor(e="",t=-1,s=[],i=kA){this.name=e,this.tracks=s,this.duration=t,this.blendMode=i,this.uuid=Ne(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,i=1/(e.fps||1);for(let r=0,o=s.length;r!==o;++r)t.push(Ph(s[r]).scale(i));const n=new this(e.name,e.duration,t,e.blendMode);return n.uuid=e.uuid,n}static toJSON(e){const t=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let n=0,r=s.length;n!==r;++n)t.push(Pe.toJSON(s[n]));return i}static CreateFromMorphTargetSequence(e,t,s,i){const n=t.length,r=[];for(let o=0;o<n;o++){let a=[],h=[];a.push((o+n-1)%n,o,(o+1)%n),h.push(0,1,0);const c=kh(a);a=Yo(a,1,c),h=Yo(h,1,c),!i&&a[0]===0&&(a.push(n),h.push(h[0])),r.push(new ss(".morphTargetInfluences["+t[o].name+"]",a,h).scale(1/s))}return new this(e,-1,r)}static findByName(e,t){let s=e;if(!Array.isArray(e)){const i=e;s=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<s.length;i++)if(s[i].name===t)return s[i];return null}static CreateClipsFromMorphTargetSequences(e,t,s){const i={},n=/^([\w-]*?)([\d]+)$/;for(let o=0,a=e.length;o<a;o++){const h=e[o],c=h.name.match(n);if(c&&c.length>1){const l=c[1];let u=i[l];u||(i[l]=u=[]),u.push(h)}}const r=[];for(const o in i)r.push(this.CreateFromMorphTargetSequence(o,i[o],t,s));return r}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(l,u,d,g,p){if(d.length!==0){const f=[],m=[];Xo(d,f,m,g),f.length!==0&&p.push(new l(u,f,m))}},i=[],n=e.name||"default",r=e.fps||30,o=e.blendMode;let a=e.length||-1;const h=e.hierarchy||[];for(let l=0;l<h.length;l++){const u=h[l].keys;if(!(!u||u.length===0))if(u[0].morphTargets){const d={};let g;for(g=0;g<u.length;g++)if(u[g].morphTargets)for(let p=0;p<u[g].morphTargets.length;p++)d[u[g].morphTargets[p]]=-1;for(const p in d){const f=[],m=[];for(let E=0;E!==u[g].morphTargets.length;++E){const C=u[g];f.push(C.time),m.push(C.morphTarget===p?1:0)}i.push(new ss(".morphTargetInfluence["+p+"]",f,m))}a=d.length*r}else{const d=".bones["+t[l].name+"]";s(rs,d+".position",u,"pos",i),s(is,d+".quaternion",u,"rot",i),s(rs,d+".scale",u,"scl",i)}}return i.length===0?null:new this(n,a,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let s=0,i=e.length;s!==i;++s){const n=this.tracks[s];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function zh(A){switch(A.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ss;case"vector":case"vector2":case"vector3":case"vector4":return rs;case"color":return Zo;case"quaternion":return is;case"bool":case"boolean":return ts;case"string":return ns}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+A)}function Ph(A){if(A.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=zh(A.type);if(A.times===void 0){const t=[],s=[];Xo(A.keys,t,s,"value"),A.times=t,A.values=s}return e.parse!==void 0?e.parse(A):new e(A.name,A.times,A.values,A.interpolation)}const It={enabled:!1,files:{},add:function(A,e){this.enabled!==!1&&(this.files[A]=e)},get:function(A){if(this.enabled!==!1)return this.files[A]},remove:function(A){delete this.files[A]},clear:function(){this.files={}}};class Hh{constructor(e,t,s){const i=this;let n=!1,r=0,o=0,a;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=s,this.itemStart=function(c){o++,n===!1&&i.onStart!==void 0&&i.onStart(c,r,o),n=!0},this.itemEnd=function(c){r++,i.onProgress!==void 0&&i.onProgress(c,r,o),r===o&&(n=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(c){i.onError!==void 0&&i.onError(c)},this.resolveURL=function(c){return a?a(c):c},this.setURLModifier=function(c){return a=c,this},this.addHandler=function(c,l){return h.push(c,l),this},this.removeHandler=function(c){const l=h.indexOf(c);return l!==-1&&h.splice(l,2),this},this.getHandler=function(c){for(let l=0,u=h.length;l<u;l+=2){const d=h[l],g=h[l+1];if(d.global&&(d.lastIndex=0),d.test(c))return g}return null}}}const qh=new Hh;class bt{constructor(e){this.manager=e!==void 0?e:qh,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const s=this;return new Promise(function(i,n){s.load(e,i,t,n)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}bt.DEFAULT_MATERIAL_NAME="__DEFAULT";const st={};class Vh extends Error{constructor(e,t){super(e),this.response=t}}class Rt extends bt{constructor(e){super(e)}load(e,t,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=It.get(e);if(n!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(n),this.manager.itemEnd(e)},0),n;if(st[e]!==void 0){st[e].push({onLoad:t,onProgress:s,onError:i});return}st[e]=[],st[e].push({onLoad:t,onProgress:s,onError:i});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(r).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const c=st[e],l=h.body.getReader(),u=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),d=u?parseInt(u):0,g=d!==0;let p=0;const f=new ReadableStream({start(m){E();function E(){l.read().then(({done:C,value:y})=>{if(C)m.close();else{p+=y.byteLength;const Q=new ProgressEvent("progress",{lengthComputable:g,loaded:p,total:d});for(let M=0,S=c.length;M<S;M++){const R=c[M];R.onProgress&&R.onProgress(Q)}m.enqueue(y),E()}},C=>{m.error(C)})}}});return new Response(f)}else throw new Vh(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(a){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return h.json();default:if(o===void 0)return h.text();{const l=/charset="?([^;"\s]*)"?/i.exec(o),u=l&&l[1]?l[1].toLowerCase():void 0,d=new TextDecoder(u);return h.arrayBuffer().then(g=>d.decode(g))}}}).then(h=>{It.add(e,h);const c=st[e];delete st[e];for(let l=0,u=c.length;l<u;l++){const d=c[l];d.onLoad&&d.onLoad(h)}}).catch(h=>{const c=st[e];if(c===void 0)throw this.manager.itemError(e),h;delete st[e];for(let l=0,u=c.length;l<u;l++){const d=c[l];d.onError&&d.onError(h)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class jh extends bt{constructor(e){super(e)}load(e,t,s,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=this,r=It.get(e);if(r!==void 0)return n.manager.itemStart(e),setTimeout(function(){t&&t(r),n.manager.itemEnd(e)},0),r;const o=un("img");function a(){c(),It.add(e,this),t&&t(this),n.manager.itemEnd(e)}function h(l){c(),i&&i(l),n.manager.itemError(e),n.manager.itemEnd(e)}function c(){o.removeEventListener("load",a,!1),o.removeEventListener("error",h,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",h,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),n.manager.itemStart(e),o.src=e,o}}class Jh extends bt{constructor(e){super(e)}load(e,t,s,i){const n=new ue,r=new jh(this.manager);return r.setCrossOrigin(this.crossOrigin),r.setPath(this.path),r.load(e,function(o){n.image=o,n.needsUpdate=!0,t!==void 0&&t(n)},s,i),n}}class Vn extends Y{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new X(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const jn=new k,$o=new b,ea=new b;class Jn{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new q(512,512),this.map=null,this.mapPass=null,this.matrix=new k,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ch,this._frameExtents=new q(1,1),this._viewportCount=1,this._viewports=[new K(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;$o.setFromMatrixPosition(e.matrixWorld),t.position.copy($o),ea.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(ea),t.updateMatrixWorld(),jn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(jn),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(jn)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Wh extends Jn{constructor(){super(new Dn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=Es*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,n=e.distance||t.far;(s!==t.fov||i!==t.aspect||n!==t.far)&&(t.fov=s,t.aspect=i,t.far=n,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Kh extends Vn{constructor(e,t,s=0,i=Math.PI/3,n=0,r=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Y.DEFAULT_UP),this.updateMatrix(),this.target=new Y,this.distance=s,this.angle=i,this.penumbra=n,this.decay=r,this.map=null,this.shadow=new Wh}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const ta=new k,Fs=new b,Wn=new b;class Yh extends Jn{constructor(){super(new Dn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new q(4,2),this._viewportCount=6,this._viewports=[new K(2,1,1,1),new K(0,1,1,1),new K(3,1,1,1),new K(1,1,1,1),new K(3,0,1,1),new K(1,0,1,1)],this._cubeDirections=[new b(1,0,0),new b(-1,0,0),new b(0,0,1),new b(0,0,-1),new b(0,1,0),new b(0,-1,0)],this._cubeUps=[new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,0,1),new b(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,i=this.matrix,n=e.distance||s.far;n!==s.far&&(s.far=n,s.updateProjectionMatrix()),Fs.setFromMatrixPosition(e.matrixWorld),s.position.copy(Fs),Wn.copy(s.position),Wn.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(Wn),s.updateMatrixWorld(),i.makeTranslation(-Fs.x,-Fs.y,-Fs.z),ta.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ta)}}class Xh extends Vn{constructor(e,t,s=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new Yh}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Zh extends Jn{constructor(){super(new No(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class $h extends Vn{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Y.DEFAULT_UP),this.updateMatrix(),this.target=new Y,this.shadow=new Zh}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Ds{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,i=e.length;s<i;s++)t+=String.fromCharCode(e[s]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class ec extends bt{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=this,r=It.get(e);if(r!==void 0){if(n.manager.itemStart(e),r.then){r.then(h=>{t&&t(h),n.manager.itemEnd(e)}).catch(h=>{i&&i(h)});return}return setTimeout(function(){t&&t(r),n.manager.itemEnd(e)},0),r}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const a=fetch(e,o).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(n.options,{colorSpaceConversion:"none"}))}).then(function(h){return It.add(e,h),t&&t(h),n.manager.itemEnd(e),h}).catch(function(h){i&&i(h),It.remove(e),n.manager.itemError(e),n.manager.itemEnd(e)});It.add(e,a),n.manager.itemStart(e)}}const Kn="\\[\\]\\.:\\/",tc=new RegExp("["+Kn+"]","g"),Yn="[^"+Kn+"]",sc="[^"+Kn.replace("\\.","")+"]",ic=/((?:WC+[\/:])*)/.source.replace("WC",Yn),nc=/(WCOD+)?/.source.replace("WCOD",sc),rc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Yn),oc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Yn),ac=new RegExp("^"+ic+nc+rc+oc+"$"),Ac=["material","materials","bones","map"];class hc{constructor(e,t,s){const i=s||P.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=s.length;i!==n;++i)s[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class P{constructor(e,t,s){this.path=t,this.parsedPath=s||P.parseTrackName(t),this.node=P.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new P.Composite(e,t,s):new P(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tc,"")}static parseTrackName(e){const t=ac.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const n=s.nodeName.substring(i+1);Ac.indexOf(n)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=n)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(n,r){for(let o=0;o<n.length;o++){const a=n[o];if(!r&&(a.name===t||a.uuid===t))return a;if(r&&a.userData&&a.userData.name===t)return a;const h=s(a.children,r);if(h)return h}return null},i=s(e.children);if(i)return i;{const n=s(e.children,!0);if(n)return n}}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)e[t++]=s[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,s=t.objectName,i=t.propertyName;let n=t.propertyIndex;if(e||(e=P.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(s){let h=t.objectIndex;switch(s){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let c=0;c<e.length;c++)if(e[c].name===h){h=c;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[s]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[s]}if(h!==void 0){if(e[h]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}const r=e[i];if(r===void 0){const h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(n!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[n]!==void 0&&(n=e.morphTargetDictionary[n])}a=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=n}else r.fromArray!==void 0&&r.toArray!==void 0?(a=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(a=this.BindingType.EntireArray,this.resolvedProperty=r):this.propertyName=i;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}P.Composite=hc,P.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},P.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},P.prototype.GetterByBindingType=[P.prototype._getValue_direct,P.prototype._getValue_array,P.prototype._getValue_arrayElement,P.prototype._getValue_toArray],P.prototype.SetterByBindingTypeAndVersioning=[[P.prototype._setValue_direct,P.prototype._setValue_direct_setNeedsUpdate,P.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[P.prototype._setValue_array,P.prototype._setValue_array_setNeedsUpdate,P.prototype._setValue_array_setMatrixWorldNeedsUpdate],[P.prototype._setValue_arrayElement,P.prototype._setValue_arrayElement_setNeedsUpdate,P.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[P.prototype._setValue_fromArray,P.prototype._setValue_fromArray_setNeedsUpdate,P.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];function Xn(A,e=0){let t=3735928559^e,s=1103547991^e;if(A instanceof Array)for(let i=0,n;i<A.length;i++)n=A[i],t=Math.imul(t^n,2654435761),s=Math.imul(s^n,1597334677);else for(let i=0,n;i<A.length;i++)n=A.charCodeAt(i),t=Math.imul(t^n,2654435761),s=Math.imul(s^n,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&s)+(t>>>0)}const cc=(...A)=>Xn(A);function lc(A,e=!1){const t=[];A.isNode===!0&&(t.push(A.id),A=A.getSelf());for(const{property:s,childNode:i}of Zn(A))t.push(t,Xn(s.slice(0,-4)),i.getCacheKey(e));return Xn(t)}function*Zn(A,e=!1){for(const t in A){if(t.startsWith("_")===!0)continue;const s=A[t];if(Array.isArray(s)===!0)for(let i=0;i<s.length;i++){const n=s[i];n&&(n.isNode===!0||e&&typeof n.toJSON=="function")&&(yield{property:t,index:i,childNode:n})}else if(s&&s.isNode===!0)yield{property:t,childNode:s};else if(typeof s=="object")for(const i in s){const n=s[i];n&&(n.isNode===!0||e&&typeof n.toJSON=="function")&&(yield{property:t,index:i,childNode:n})}}}function Di(A){if(A==null)return null;const e=typeof A;return A.isNode===!0?"node":e==="number"?"float":e==="boolean"?"bool":e==="string"?"string":e==="function"?"shader":A.isVector2===!0?"vec2":A.isVector3===!0?"vec3":A.isVector4===!0?"vec4":A.isMatrix3===!0?"mat3":A.isMatrix4===!0?"mat4":A.isColor===!0?"color":A instanceof ArrayBuffer?"ArrayBuffer":null}function sa(A,...e){const t=A?A.slice(-4):void 0;return e.length===1&&(t==="vec2"?e=[e[0],e[0]]:t==="vec3"?e=[e[0],e[0],e[0]]:t==="vec4"&&(e=[e[0],e[0],e[0],e[0]])),A==="color"?new X(...e):t==="vec2"?new q(...e):t==="vec3"?new b(...e):t==="vec4"?new K(...e):t==="mat3"?new Fe(...e):t==="mat4"?new k(...e):A==="bool"?e[0]||!1:A==="float"||A==="int"||A==="uint"?e[0]||0:A==="string"?e[0]||"":A==="ArrayBuffer"?dc(e[0]):null}function uc(A){let e="";const t=new Uint8Array(A);for(let s=0;s<t.length;s++)e+=String.fromCharCode(t[s]);return btoa(e)}function dc(A){return Uint8Array.from(atob(A),e=>e.charCodeAt(0)).buffer}const ia={VERTEX:"vertex"},$={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},_s=["x","y","z","w"];let gc=0;class L extends Ut{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=$.NONE,this.updateBeforeType=$.NONE,this.updateAfterType=$.NONE,this.uuid=Ao.generateUUID(),this.version=0,this._cacheKey=null,this._cacheKeyVersion=0,this.global=!1,this.isNode=!0,Object.defineProperty(this,"id",{value:gc++})}set needsUpdate(e){e===!0&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,$.FRAME)}onRenderUpdate(e){return this.onUpdate(e,$.RENDER)}onObjectUpdate(e){return this.onUpdate(e,$.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of Zn(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return e=e||this.version!==this._cacheKeyVersion,(e===!0||this._cacheKey===null)&&(this._cacheKey=lc(this,e),this._cacheKeyVersion=this.version),this._cacheKey}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let s=0;for(const i of this.getChildren())t["node"+s++]=i;return null}analyze(e){if(e.increaseUsage(this)===1){const s=e.getNodeProperties(this);for(const i of Object.values(s))i&&i.isNode===!0&&i.build(e)}}generate(e,t){const{outputNode:s}=e.getNodeProperties(this);if(s&&s.isNode===!0)return s.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const s=this.getShared(e);if(this!==s)return s.build(e,t);e.addNode(this),e.addChain(this);let i=null;const n=e.getBuildStage();if(n==="setup"){this.updateReference(e);const r=e.getNodeProperties(this);if(r.initialized!==!0){const o=e.stack.nodes.length;r.initialized=!0,r.outputNode=this.setup(e),r.outputNode!==null&&e.stack.nodes.length;for(const a of Object.values(r))a&&a.isNode===!0&&a.build(e)}}else if(n==="analyze")this.analyze(e);else if(n==="generate")if(this.generate.length===1){const o=this.getNodeType(e),a=e.getDataFromNode(this);i=a.snippet,i===void 0?(i=this.generate(e)||"",a.snippet=i):a.flowCodes!==void 0&&e.context.nodeBlock!==void 0&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),i=e.format(i,o,t)}else i=this.generate(e,t)||"";return e.removeChain(this),i}getSerializeChildren(){return Zn(this)}serialize(e){const t=this.getSerializeChildren(),s={};for(const{property:i,index:n,childNode:r}of t)n!==void 0?(s[i]===void 0&&(s[i]=Number.isInteger(n)?[]:{}),s[i][n]=r.toJSON(e.meta).uuid):s[i]=r.toJSON(e.meta).uuid;Object.keys(s).length>0&&(e.inputNodes=s)}deserialize(e){if(e.inputNodes!==void 0){const t=e.meta.nodes;for(const s in e.inputNodes)if(Array.isArray(e.inputNodes[s])){const i=[];for(const n of e.inputNodes[s])i.push(t[n]);this[s]=i}else if(typeof e.inputNodes[s]=="object"){const i={};for(const n in e.inputNodes[s]){const r=e.inputNodes[s][n];i[n]=t[r]}this[s]=i}else{const i=e.inputNodes[s];this[s]=t[i]}}}toJSON(e){const{uuid:t,type:s}=this,i=e===void 0||typeof e=="string";i&&(e={textures:{},images:{},nodes:{}});let n=e.nodes[t];n===void 0&&(n={uuid:t,type:s,meta:e,metadata:{version:4.6,type:"Node",generator:"Node.toJSON"}},i!==!0&&(e.nodes[n.uuid]=n),this.serialize(n),delete n.meta);function r(o){const a=[];for(const h in o){const c=o[h];delete c.metadata,a.push(c)}return a}if(i){const o=r(e.textures),a=r(e.images),h=r(e.nodes);o.length>0&&(n.textures=o),a.length>0&&(n.images=a),h.length>0&&(n.nodes=h)}return n}}class ks extends L{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.node.build(e),s=this.indexNode.build(e,"uint");return`${t}[ ${s} ]`}}class na extends L{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let s=null;for(const i of this.convertTo.split("|"))(s===null||e.getTypeLength(t)===e.getTypeLength(i))&&(s=i);return s}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const s=this.node,i=this.getNodeType(e),n=s.build(e,i);return e.format(n,i,t)}}class me extends L{static get type(){return"TempNode"}constructor(e){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if(e.getBuildStage()==="generate"){const i=e.getVectorType(this.getNodeType(e,t)),n=e.getDataFromNode(this);if(n.propertyName!==void 0)return e.format(n.propertyName,i,t);if(i!=="void"&&t!=="void"&&this.hasDependencies(e)){const r=super.build(e,i),o=e.getVarFromNode(this,null,i),a=e.getPropertyName(o);return e.addLineFlowCode(`${a} = ${r}`,this),n.snippet=r,n.propertyName=a,e.format(n.propertyName,i,t)}}return super.build(e,t)}}class pc extends me{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return this.nodeType!==null?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce((t,s)=>t+e.getTypeLength(s.getNodeType(e)),0))}generate(e,t){const s=this.getNodeType(e),i=this.nodes,n=e.getComponentType(s),r=[];for(const a of i){let h=a.build(e);const c=e.getComponentType(a.getNodeType(e));c!==n&&(h=e.format(h,c,n)),r.push(h)}const o=`${e.getType(s)}( ${r.join(", ")} )`;return e.format(o,s,t)}}const fc=_s.join("");class ra extends L{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(_s.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const s=this.node,i=e.getTypeLength(s.getNodeType(e));let n=null;if(i>1){let r=null;this.getVectorLength()>=i&&(r=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=s.build(e,r);this.components.length===i&&this.components===fc.slice(0,this.components.length)?n=e.format(a,r,t):n=e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else n=s.build(e,t);return n}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class mc extends me{static get type(){return"SetNode"}constructor(e,t,s){super(),this.sourceNode=e,this.components=t,this.targetNode=s}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:s,targetNode:i}=this,n=this.getNodeType(e),r=e.getTypeFromLength(s.length,i.getNodeType(e)),o=i.build(e,r),a=t.build(e,n),h=e.getTypeLength(n),c=[];for(let l=0;l<h;l++){const u=_s[l];u===s[0]?(c.push(o),l+=s.length-1):c.push(a+"."+u)}return`${e.getType(n)}( ${c.join(", ")} )`}}class Ic extends me{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:s}=this,i=this.getNodeType(e),n=s.build(e),r=e.getVarFromNode(this),o=e.getPropertyName(r);e.addLineFlowCode(o+" = "+n,this);const a=e.getTypeLength(i),h=[];let c=0;for(let l=0;l<a;l++){const u=_s[l];u===t[c]?(h.push("1.0 - "+(o+"."+u)),c++):h.push(o+"."+u)}return`${e.getType(i)}( ${h.join(", ")} )`}}class $n extends L{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}getNodeType(){return this.nodeType===null?Di(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=Di(this.value),e.nodeType=this.nodeType,e.valueType==="ArrayBuffer"&&(e.value=uc(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?sa(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){console.warn("Abstract function.")}}class it extends $n{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const s=this.getNodeType(e);return e.format(this.generateConst(e),s,t)}}let oa=null;const os=new Map;function x(A,e){if(os.has(A)){console.warn(`Redefinition of method chaining ${A}`);return}if(typeof e!="function")throw new Error(`Node element ${A} is not a function`);os.set(A,e)}const aa=A=>A.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),Aa=A=>aa(A).split("").sort().join(""),ha={setup(A,e){const t=e.shift();return A(Li(t),...e)},get(A,e,t){if(typeof e=="string"&&A[e]===void 0){if(A.isStackNode!==!0&&e==="assign")return(...s)=>(oa.assign(t,...s),t);if(os.has(e)){const s=os.get(e);return A.isStackNode?(...i)=>t.add(s(...i)):(...i)=>s(t,...i)}else{if(e==="self")return A;if(e.endsWith("Assign")&&os.has(e.slice(0,e.length-6))){const s=os.get(e.slice(0,e.length-6));return A.isStackNode?(...i)=>t.assign(i[0],s(...i)):(...i)=>t.assign(s(t,...i))}else{if(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0)return e=aa(e),T(new ra(t,e));if(/^set[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=Aa(e.slice(3).toLowerCase()),s=>T(new mc(A,e,s));if(/^flip[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=Aa(e.slice(4).toLowerCase()),()=>T(new Ic(T(A),e));if(e==="width"||e==="height"||e==="depth")return e==="width"?e="x":e==="height"?e="y":e==="depth"&&(e="z"),T(new ra(A,e));if(/^\d+$/.test(e)===!0)return T(new ks(t,new it(Number(e),"uint")))}}}return Reflect.get(A,e,t)},set(A,e,t,s){return typeof e=="string"&&A[e]===void 0&&(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0||e==="width"||e==="height"||e==="depth"||/^\d+$/.test(e)===!0)?(s[e].assign(t),!0):Reflect.set(A,e,t,s)}},er=new WeakMap,ca=new WeakMap,bc=function(A,e=null){const t=Di(A);if(t==="node"){let s=er.get(A);return s===void 0&&(s=new Proxy(A,ha),er.set(A,s),er.set(s,s)),s}else{if(e===null&&(t==="float"||t==="boolean")||t&&t!=="shader"&&t!=="string")return T(nr(A,e));if(t==="shader")return te(A)}return A},yc=function(A,e=null){for(const t in A)A[t]=T(A[t],e);return A},Ec=function(A,e=null){const t=A.length;for(let s=0;s<t;s++)A[s]=T(A[s],e);return A},Cc=function(A,e=null,t=null,s=null){const i=n=>T(s!==null?Object.assign(n,s):n);return e===null?(...n)=>i(new A(...as(n))):t!==null?(t=T(t),(...n)=>i(new A(e,...as(n),t))):(...n)=>i(new A(e,...as(n)))},Bc=function(A,...e){return T(new A(...as(e)))};class xc extends L{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}call(e){const{shaderNode:t,inputNodes:s}=this,i=e.getNodeProperties(t);if(i.onceOutput)return i.onceOutput;let n=null;if(t.layout){let r=ca.get(e.constructor);r===void 0&&(r=new WeakMap,ca.set(e.constructor,r));let o=r.get(t);o===void 0&&(o=T(e.buildFunctionNode(t)),r.set(t,o)),e.currentFunctionNode!==null&&e.currentFunctionNode.includes.push(o),n=T(o.call(s))}else{const r=t.jsFunc,o=s!==null?r(s,e):r(e);n=T(o)}return t.once&&(i.onceOutput=n),n}getOutputNode(e){const t=e.getNodeProperties(this);return t.outputNode===null&&(t.outputNode=this.setupOutput(e)),t.outputNode}setup(e){return this.getOutputNode(e)}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}generate(e,t){return this.getOutputNode(e).build(e,t)}}class Qc extends L{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}call(e=null){return Li(e),T(new xc(this,e))}setup(){return this.call()}}const wc=[!1,!0],Tc=[0,1,2,3],Sc=[-1,-2],la=[.5,1.5,1/3,1e-6,1e6,Math.PI,Math.PI*2,1/Math.PI,2/Math.PI,1/(Math.PI*2),Math.PI/2],tr=new Map;for(const A of wc)tr.set(A,new it(A));const sr=new Map;for(const A of Tc)sr.set(A,new it(A,"uint"));const ir=new Map([...sr].map(A=>new it(A.value,"int")));for(const A of Sc)ir.set(A,new it(A,"int"));const _i=new Map([...ir].map(A=>new it(A.value)));for(const A of la)_i.set(A,new it(A));for(const A of la)_i.set(-A,new it(-A));const ki={bool:tr,uint:sr,ints:ir,float:_i},ua=new Map([...tr,..._i]),nr=(A,e)=>ua.has(A)?ua.get(A):A.isNode===!0?A:new it(A,e),Mc=A=>{try{return A.getNodeType()}catch{return}},ee=function(A,e=null){return(...t)=>{if((t.length===0||!["bool","float","int","uint"].includes(A)&&t.every(i=>typeof i!="object"))&&(t=[sa(A,...t)]),t.length===1&&e!==null&&e.has(t[0]))return T(e.get(t[0]));if(t.length===1){const i=nr(t[0],A);return Mc(i)===A?T(i):T(new na(i,A))}const s=t.map(i=>nr(i));return T(new pc(s,A))}},Nc=A=>A!=null?A.nodeType||A.convertTo||(typeof A=="string"?A:null):null;function Rc(A,e){return new Proxy(new Qc(A,e),ha)}const T=(A,e=null)=>bc(A,e),Li=(A,e=null)=>new yc(A,e),as=(A,e=null)=>new Ec(A,e),w=(...A)=>new Cc(...A),N=(...A)=>new Bc(...A),te=(A,e)=>{const t=new Rc(A,e),s=(...i)=>{let n;return Li(i),i[0]&&i[0].isNode?n=[...i]:n=i[0],t.call(n)};return s.shaderNode=t,s.setLayout=i=>(t.setLayout(i),s),s.once=()=>(t.once=!0,s),s};x("toGlobal",A=>(A.global=!0,A));const rr=(...A)=>oa.If(...A);function Fc(A){return A}x("append",Fc);const Dc=new ee("color"),U=new ee("float",ki.float),As=new ee("int",ki.ints),_c=new ee("uint",ki.uint),kc=new ee("bool",ki.bool),F=new ee("vec2"),Lc=new ee("ivec2"),vc=new ee("uvec2"),Gc=new ee("bvec2"),v=new ee("vec3"),Oc=new ee("ivec3"),Uc=new ee("uvec3"),zc=new ee("bvec3"),hs=new ee("vec4"),Pc=new ee("ivec4"),Hc=new ee("uvec4"),qc=new ee("bvec4"),da=new ee("mat2"),vi=new ee("mat3"),Vc=new ee("mat4");x("toColor",Dc),x("toFloat",U),x("toInt",As),x("toUint",_c),x("toBool",kc),x("toVec2",F),x("toIVec2",Lc),x("toUVec2",vc),x("toBVec2",Gc),x("toVec3",v),x("toIVec3",Oc),x("toUVec3",Uc),x("toBVec3",zc),x("toVec4",hs),x("toIVec4",Pc),x("toUVec4",Hc),x("toBVec4",qc),x("toMat2",da),x("toMat3",vi),x("toMat4",Vc);const jc=w(ks),Jc=(A,e)=>T(new na(T(A),e));x("element",jc),x("convert",Jc);class ga extends L{static get type(){return"UniformGroupNode"}constructor(e,t=!1,s=1){super("string"),this.name=e,this.version=0,this.shared=t,this.order=s,this.isUniformGroup=!0}set needsUpdate(e){e===!0&&this.version++}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const Wc=A=>new ga(A),Ft=((A,e=0)=>new ga(A,!0,e))("render"),Kc=Wc("object");class cs extends $n{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=Kc}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const s=this.getSelf();return e=e.bind(s),super.onUpdate(i=>{const n=e(i,s);n!==void 0&&(this.value=n)},t)}generate(e,t){const s=this.getNodeType(e),i=this.getUniformHash(e);let n=e.getNodeFromHash(i);n===void 0&&(e.setHashNode(this,i),n=this);const r=n.getInputType(e),o=e.getUniformFromNode(n,r,e.shaderStage,this.name||e.context.label),a=e.getPropertyName(o);return e.context.label!==void 0&&delete e.context.label,e.format(a,s,t)}}const Ce=(A,e)=>{const t=Nc(e||A),s=A&&A.isNode===!0?A.node&&A.node.value||A.value:A;return T(new cs(s,t))};class pa extends L{static get type(){return"PropertyNode"}constructor(e,t=null,s=!1){super(e),this.name=t,this.varying=s,this.isPropertyNode=!0}getHash(e){return this.name||super.getHash(e)}isGlobal(){return!0}generate(e){let t;return this.varying===!0?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const ls=(A,e)=>T(new pa(A,e)),fa=N(pa,"vec4","DiffuseColor");class Yc extends me{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t}hasDependencies(){return!1}getNodeType(e,t){return t!=="void"?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(e.isAvailable("swizzleAssign")===!1&&t.isSplitNode&&t.components.length>1){const s=e.getTypeLength(t.node.getNodeType(e));return _s.join("").slice(0,s)!==t.components}return!1}generate(e,t){const{targetNode:s,sourceNode:i}=this,n=this.needsSplitAssign(e),r=s.getNodeType(e),o=s.context({assign:!0}).build(e),a=i.build(e,r),h=i.getNodeType(e),c=e.getDataFromNode(this);let l;if(c.initialized===!0)t!=="void"&&(l=o);else if(n){const u=e.getVarFromNode(this,null,r),d=e.getPropertyName(u);e.addLineFlowCode(`${d} = ${a}`,this);const g=s.node.context({assign:!0}).build(e);for(let p=0;p<s.components.length;p++){const f=s.components[p];e.addLineFlowCode(`${g}.${f} = ${d}[ ${p} ]`,this)}t!=="void"&&(l=o)}else l=`${o} = ${a}`,(t==="void"||h==="void")&&(e.addLineFlowCode(l,this),t!=="void"&&(l=o));return c.initialized=!0,e.format(l,r,t)}}x("assign",w(Yc));class Xc extends me{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}generate(e){const t=[],s=this.functionNode,i=s.getInputs(e),n=this.parameters;if(Array.isArray(n))for(let o=0;o<n.length;o++){const a=i[o],h=n[o];t.push(h.build(e,a.type))}else for(const o of i){const a=n[o.name];if(a!==void 0)t.push(a.build(e,o.type));else throw new Error(`FunctionCallNode: Input '${o.name}' not found in FunctionNode.`)}return`${s.build(e,"property")}( ${t.join(", ")} )`}}x("call",(A,...e)=>(e=e.length>1||e[0]&&e[0].isNode===!0?as(e):Li(e[0]),T(new Xc(T(A),e))));class J extends me{static get type(){return"OperatorNode"}constructor(e,t,s,...i){if(super(),i.length>0){let n=new J(e,t,s);for(let r=0;r<i.length-1;r++)n=new J(e,n,i[r]);t=n,s=i[i.length-1]}this.op=e,this.aNode=t,this.bNode=s}getNodeType(e,t){const s=this.op,i=this.aNode,n=this.bNode,r=i.getNodeType(e),o=typeof n<"u"?n.getNodeType(e):null;if(r==="void"||o==="void")return"void";if(s==="%")return r;if(s==="~"||s==="&"||s==="|"||s==="^"||s===">>"||s==="<<")return e.getIntegerType(r);if(s==="!"||s==="=="||s==="&&"||s==="||"||s==="^^")return"bool";if(s==="<"||s===">"||s==="<="||s===">="){const a=t?e.getTypeLength(t):Math.max(e.getTypeLength(r),e.getTypeLength(o));return a>1?`bvec${a}`:"bool"}else return r==="float"&&e.isMatrix(o)?o:e.isMatrix(r)&&e.isVector(o)?e.getVectorFromMatrix(r):e.isVector(r)&&e.isMatrix(o)?e.getVectorFromMatrix(o):e.getTypeLength(o)>e.getTypeLength(r)?o:r}generate(e,t){const s=this.op,i=this.aNode,n=this.bNode,r=this.getNodeType(e,t);let o=null,a=null;r!=="void"?(o=i.getNodeType(e),a=typeof n<"u"?n.getNodeType(e):null,s==="<"||s===">"||s==="<="||s===">="||s==="=="?e.isVector(o)?a=o:o!==a&&(o=a="float"):s===">>"||s==="<<"?(o=r,a=e.changeComponentType(a,"uint")):e.isMatrix(o)&&e.isVector(a)?a=e.getVectorFromMatrix(o):e.isVector(o)&&e.isMatrix(a)?o=e.getVectorFromMatrix(a):o=a=r):o=a=r;const h=i.build(e,o),c=typeof n<"u"?n.build(e,a):null,l=e.getTypeLength(t),u=e.getFunctionOperator(s);if(t!=="void")return s==="<"&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("lessThan",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} < ${c} )`,r,t):s==="<="&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("lessThanEqual",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} <= ${c} )`,r,t):s===">"&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("greaterThan",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} > ${c} )`,r,t):s===">="&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("greaterThanEqual",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} >= ${c} )`,r,t):s==="!"||s==="~"?e.format(`(${s}${h})`,o,t):u?e.format(`${u}( ${h}, ${c} )`,r,t):e.format(`( ${h} ${s} ${c} )`,r,t);if(o!=="void")return u?e.format(`${u}( ${h}, ${c} )`,r,t):e.format(`${h} ${s} ${c}`,r,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const Dt=w(J,"+"),Gi=w(J,"-"),Oi=w(J,"*"),ma=w(J,"/"),Ia=w(J,"%"),Zc=w(J,"=="),$c=w(J,"!="),el=w(J,"<"),tl=w(J,">"),sl=w(J,"<="),il=w(J,">="),nl=w(J,"&&"),rl=w(J,"||"),ol=w(J,"!"),al=w(J,"^^"),Al=w(J,"&"),hl=w(J,"~"),cl=w(J,"|"),ll=w(J,"^"),ul=w(J,"<<"),dl=w(J,">>");x("add",Dt),x("sub",Gi),x("mul",Oi),x("div",ma),x("modInt",Ia),x("equal",Zc),x("notEqual",$c),x("lessThan",el),x("greaterThan",tl),x("lessThanEqual",sl),x("greaterThanEqual",il),x("and",nl),x("or",rl),x("not",ol),x("xor",al),x("bitAnd",Al),x("bitNot",hl),x("bitOr",cl),x("bitXor",ll),x("shiftLeft",ul),x("shiftRight",dl),x("remainder",(...A)=>(console.warn("TSL.OperatorNode: .remainder() has been renamed to .modInt()."),Ia(...A)));class I extends me{static get type(){return"MathNode"}constructor(e,t,s=null,i=null){super(),this.method=e,this.aNode=t,this.bNode=s,this.cNode=i}getInputType(e){const t=this.aNode.getNodeType(e),s=this.bNode?this.bNode.getNodeType(e):null,i=this.cNode?this.cNode.getNodeType(e):null,n=e.isMatrix(t)?0:e.getTypeLength(t),r=e.isMatrix(s)?0:e.getTypeLength(s),o=e.isMatrix(i)?0:e.getTypeLength(i);return n>r&&n>o?t:r>o?s:o>n?i:t}getNodeType(e){const t=this.method;return t===I.LENGTH||t===I.DISTANCE||t===I.DOT?"float":t===I.CROSS?"vec3":t===I.ALL?"bool":t===I.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):t===I.MOD?this.aNode.getNodeType(e):this.getInputType(e)}generate(e,t){const s=this.method,i=this.getNodeType(e),n=this.getInputType(e),r=this.aNode,o=this.bNode,a=this.cNode,h=e.renderer.isWebGLRenderer===!0;if(s===I.TRANSFORM_DIRECTION){let c=r,l=o;e.isMatrix(c.getNodeType(e))?l=hs(v(l),0):c=hs(v(c),0);const u=Oi(c,l).xyz;return ba(u).build(e,t)}else{if(s===I.NEGATE)return e.format("( - "+r.build(e,n)+" )",i,t);if(s===I.ONE_MINUS)return Gi(1,r).build(e,t);if(s===I.RECIPROCAL)return ma(1,r).build(e,t);if(s===I.DIFFERENCE)return Ar(Gi(r,o)).build(e,t);{const c=[];return s===I.CROSS||s===I.MOD?c.push(r.build(e,i),o.build(e,i)):h&&s===I.STEP?c.push(r.build(e,e.getTypeLength(r.getNodeType(e))===1?"float":n),o.build(e,n)):h&&(s===I.MIN||s===I.MAX)||s===I.MOD?c.push(r.build(e,n),o.build(e,e.getTypeLength(o.getNodeType(e))===1?"float":n)):s===I.REFRACT?c.push(r.build(e,n),o.build(e,n),a.build(e,"float")):s===I.MIX?c.push(r.build(e,n),o.build(e,n),a.build(e,e.getTypeLength(a.getNodeType(e))===1?"float":n)):(c.push(r.build(e,n)),o!==null&&c.push(o.build(e,n)),a!==null&&c.push(a.build(e,n))),e.format(`${e.getMethod(s,i)}( ${c.join(", ")} )`,i,t)}}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}I.ALL="all",I.ANY="any",I.EQUALS="equals",I.RADIANS="radians",I.DEGREES="degrees",I.EXP="exp",I.EXP2="exp2",I.LOG="log",I.LOG2="log2",I.SQRT="sqrt",I.INVERSE_SQRT="inversesqrt",I.FLOOR="floor",I.CEIL="ceil",I.NORMALIZE="normalize",I.FRACT="fract",I.SIN="sin",I.COS="cos",I.TAN="tan",I.ASIN="asin",I.ACOS="acos",I.ATAN="atan",I.ABS="abs",I.SIGN="sign",I.LENGTH="length",I.NEGATE="negate",I.ONE_MINUS="oneMinus",I.DFDX="dFdx",I.DFDY="dFdy",I.ROUND="round",I.RECIPROCAL="reciprocal",I.TRUNC="trunc",I.FWIDTH="fwidth",I.BITCAST="bitcast",I.TRANSPOSE="transpose",I.ATAN2="atan2",I.MIN="min",I.MAX="max",I.MOD="mod",I.STEP="step",I.REFLECT="reflect",I.DISTANCE="distance",I.DIFFERENCE="difference",I.DOT="dot",I.CROSS="cross",I.POW="pow",I.TRANSFORM_DIRECTION="transformDirection",I.MIX="mix",I.CLAMP="clamp",I.REFRACT="refract",I.SMOOTHSTEP="smoothstep",I.FACEFORWARD="faceforward";const gl=U(Math.PI),pl=w(I,I.ALL),fl=w(I,I.ANY),ml=w(I,I.EQUALS),Il=w(I,I.RADIANS),bl=w(I,I.DEGREES),yl=w(I,I.EXP),El=w(I,I.EXP2),Cl=w(I,I.LOG),Bl=w(I,I.LOG2),or=w(I,I.SQRT),xl=w(I,I.INVERSE_SQRT),Ql=w(I,I.FLOOR),wl=w(I,I.CEIL),ba=w(I,I.NORMALIZE),ar=w(I,I.FRACT),ya=w(I,I.SIN),Tl=w(I,I.COS),Sl=w(I,I.TAN),Ml=w(I,I.ASIN),Nl=w(I,I.ACOS),Rl=w(I,I.ATAN),Ar=w(I,I.ABS),Ea=w(I,I.SIGN),Fl=w(I,I.LENGTH),Dl=w(I,I.NEGATE),_l=w(I,I.ONE_MINUS),kl=w(I,I.DFDX),Ll=w(I,I.DFDY),vl=w(I,I.ROUND),Gl=w(I,I.RECIPROCAL),Ol=w(I,I.TRUNC),Ul=w(I,I.FWIDTH);I.BITCAST;const zl=w(I,I.TRANSPOSE),Pl=w(I,I.ATAN2),Hl=w(I,I.MIN),hr=w(I,I.MAX),Ca=w(I,I.MOD),Ba=w(I,I.STEP),ql=w(I,I.REFLECT),Vl=w(I,I.DISTANCE),jl=w(I,I.DIFFERENCE),cr=w(I,I.DOT),Jl=w(I,I.CROSS),xa=w(I,I.POW),Wl=w(I,I.POW,2),Kl=w(I,I.POW,3),Yl=w(I,I.POW,4),Xl=w(I,I.TRANSFORM_DIRECTION),Zl=A=>Oi(Ea(A),xa(Ar(A),1/3)),$l=A=>cr(A,A),yt=w(I,I.MIX),Ui=(A,e=0,t=1)=>T(new I(I.CLAMP,T(A),T(e),T(t))),eu=A=>Ui(A),tu=w(I,I.REFRACT),lr=w(I,I.SMOOTHSTEP),su=w(I,I.FACEFORWARD),iu=te(([A])=>{const s=43758.5453,i=cr(A.xy,F(12.9898,78.233)),n=Ca(i,gl);return ar(ya(n).mul(s))}),nu=(A,e,t)=>yt(e,t,A),ru=(A,e,t)=>lr(e,t,A);x("all",pl),x("any",fl),x("equals",ml),x("radians",Il),x("degrees",bl),x("exp",yl),x("exp2",El),x("log",Cl),x("log2",Bl),x("sqrt",or),x("inverseSqrt",xl),x("floor",Ql),x("ceil",wl),x("normalize",ba),x("fract",ar),x("sin",ya),x("cos",Tl),x("tan",Sl),x("asin",Ml),x("acos",Nl),x("atan",Rl),x("abs",Ar),x("sign",Ea),x("length",Fl),x("lengthSq",$l),x("negate",Dl),x("oneMinus",_l),x("dFdx",kl),x("dFdy",Ll),x("round",vl),x("reciprocal",Gl),x("trunc",Ol),x("fwidth",Ul),x("atan2",Pl),x("min",Hl),x("max",hr),x("mod",Ca),x("step",Ba),x("reflect",ql),x("distance",Vl),x("dot",cr),x("cross",Jl),x("pow",xa),x("pow2",Wl),x("pow3",Kl),x("pow4",Yl),x("transformDirection",Xl),x("mix",nu),x("clamp",Ui),x("refract",tu),x("smoothstep",ru),x("faceForward",su),x("difference",jl),x("saturate",eu),x("cbrt",Zl),x("transpose",zl),x("rand",iu);class ou extends L{static get type(){return"ConditionalNode"}constructor(e,t,s=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=s}getNodeType(e){const t=this.ifNode.getNodeType(e);if(this.elseNode!==null){const s=this.elseNode.getNodeType(e);if(e.getTypeLength(s)>e.getTypeLength(t))return s}return t}setup(e){const t=this.condNode.cache(),s=this.ifNode.cache(),i=this.elseNode?this.elseNode.cache():null,n=e.context.nodeBlock;e.getDataFromNode(s).parentNodeBlock=n,i!==null&&(e.getDataFromNode(i).parentNodeBlock=n);const r=e.getNodeProperties(this);r.condNode=t,r.ifNode=s.context({nodeBlock:s}),r.elseNode=i?i.context({nodeBlock:i}):null}generate(e,t){const s=this.getNodeType(e),i=e.getDataFromNode(this);if(i.nodeProperty!==void 0)return i.nodeProperty;const{condNode:n,ifNode:r,elseNode:o}=e.getNodeProperties(this),a=t!=="void",h=a?ls(s).build(e):"";i.nodeProperty=h;const c=n.build(e,"bool");e.addFlowCode(`
|
|
2
2
|
${e.tab}if ( ${c} ) {
|
|
3
3
|
|
|
4
4
|
`).addFlowTab();let l=r.build(e,s);if(l&&(a?l=h+" = "+l+";":l="return "+l+";"),e.removeFlowTab().addFlowCode(e.tab+" "+l+`
|