diff --git a/app/layout.tsx b/app/layout.tsx index 178a921e..ff7a9036 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,4 +1,5 @@ import { ReactNode } from "react"; +import { NuqsAdapter } from "nuqs/adapters/next/app"; import "./style.css"; export const metadata = { @@ -9,7 +10,15 @@ export const metadata = { export default function RootLayout({ children }: { children: ReactNode }) { return ( - {children} + + + {children} + + ); } diff --git a/app/page.tsx b/app/page.tsx index 829bc596..b7409c3f 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,8 +1,7 @@ "use client"; -import { useState, useEffect, useCallback, Suspense, useMemo } from "react"; -import { useSearchParams, useRouter } from "next/navigation"; +import { useState, useEffect, useCallback, Suspense, useRef } from "react"; import { Canvas, GLProps } from "@react-three/fiber"; -import { NoToneMapping, SRGBColorSpace, PCFShadowMap } from "three"; +import { NoToneMapping, SRGBColorSpace, PCFShadowMap, Camera } from "three"; import { Mission } from "@/src/components/Mission"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ObserverControls } from "@/src/components/ObserverControls"; @@ -13,8 +12,9 @@ import { AudioProvider } from "@/src/components/AudioContext"; import { DebugElements } from "@/src/components/DebugElements"; import { CamerasProvider } from "@/src/components/CamerasProvider"; import { getMissionList, getMissionInfo } from "@/src/manifest"; +import { createParser, useQueryState } from "nuqs"; -// three.js has its own loaders for textures and models, but we need to load other +// Three.js has its own loaders for textures and models, but we need to load other // stuff too, e.g. missions, terrains, and more. This client is used for those. const queryClient = new QueryClient(); @@ -26,23 +26,52 @@ const glSettings: GLProps = { outputColorSpace: SRGBColorSpace, }; +type CurrentMission = { + missionName: string; + missionType?: string; +}; + +const defaultMission: CurrentMission = { + missionName: "RiverDance", + missionType: "CTF", +}; + +const parseAsMissionWithType = createParser({ + parse(query: string) { + let [missionName, missionType] = query.split("~"); + const availableMissionTypes = getMissionInfo(missionName).missionTypes; + if (!missionType || !availableMissionTypes.includes(missionType)) { + missionType = availableMissionTypes[0]; + } + return { missionName, missionType }; + }, + serialize({ missionName, missionType }): string { + const availableMissionTypes = getMissionInfo(missionName).missionTypes; + if (availableMissionTypes.length === 1) { + return missionName; + } + return `${missionName}~${missionType}`; + }, + eq(a, b) { + return a.missionName === b.missionName && a.missionType === b.missionType; + }, +}).withDefault(defaultMission); + function MapInspector() { - const searchParams = useSearchParams(); - const router = useRouter(); - - const [initialMissionName, initialMissionType] = useMemo( - () => (searchParams.get("mission") || "RiverDance~CTF").split("~"), - [], + const [currentMission, setCurrentMission] = useQueryState( + "mission", + parseAsMissionWithType, ); - const [missionName, setMissionName] = useState(initialMissionName); - const availableMissionTypes = getMissionInfo(missionName).missionTypes; - const [missionType, setMissionType] = useState(() => - initialMissionType && availableMissionTypes.includes(initialMissionType) - ? initialMissionType - : availableMissionTypes[0], - ); - const isOnlyMissionType = availableMissionTypes.length === 1; + const changeMission = useCallback( + (mission: CurrentMission) => { + window.location.hash = ""; + setCurrentMission(mission); + }, + [setCurrentMission], + ); + + const { missionName, missionType } = currentMission; const [loadingProgress, setLoadingProgress] = useState(0); const [showLoadingIndicator, setShowLoadingIndicator] = useState(true); const isLoading = loadingProgress < 1; @@ -59,7 +88,13 @@ function MapInspector() { useEffect(() => { // For automation, like the t2-maps app! - window.setMissionName = setMissionName; + window.setMissionName = (missionName: string) => { + const availableMissionTypes = getMissionInfo(missionName).missionTypes; + changeMission({ + missionName, + missionType: availableMissionTypes[0], + }); + }; window.getMissionList = getMissionList; window.getMissionInfo = getMissionInfo; @@ -68,17 +103,7 @@ function MapInspector() { delete window.getMissionList; delete window.getMissionInfo; }; - }, []); - - // Update query params when state changes - useEffect(() => { - const params = new URLSearchParams(); - const value = isOnlyMissionType - ? missionName - : `${missionName}~${missionType}`; - params.set("mission", value); - router.replace(`?${params.toString()}`, { scroll: false }); - }, [missionName, missionType, isOnlyMissionType, router]); + }, [changeMission]); const handleLoadingChange = useCallback( (_loading: boolean, progress: number = 0) => { @@ -87,6 +112,8 @@ function MapInspector() { [], ); + const cameraRef = useRef(null); + return (
@@ -110,6 +137,9 @@ function MapInspector() { frameloop="always" gl={glSettings} shadows={{ type: PCFShadowMap }} + onCreated={(state) => { + cameraRef.current = state.camera; + }} > @@ -118,7 +148,6 @@ function MapInspector() { name={missionName} missionType={missionType} onLoadingChange={handleLoadingChange} - setMissionType={setMissionType} /> @@ -130,10 +159,8 @@ function MapInspector() { { - setMissionName(missionName); - setMissionType(missionType); - }} + onChangeMission={changeMission} + cameraRef={cameraRef} />
diff --git a/app/style.css b/app/style.css index a4ef0d50..d3fd1d07 100644 --- a/app/style.css +++ b/app/style.css @@ -77,6 +77,42 @@ input[type="range"] { gap: 6px; } +.IconButton { + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + margin: 0 0 0 -12px; + font-size: 15px; + padding: 0; + border-top: 1px solid rgba(255, 255, 255, 0.3); + border-left: 1px solid rgba(255, 255, 255, 0.3); + border-right: 1px solid rgba(200, 200, 200, 0.3); + border-bottom: 1px solid rgba(200, 200, 200, 0.3); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); + border-radius: 4px; + background: rgba(3, 82, 147, 0.6); + color: #fff; + cursor: pointer; + transform: translate(0, 0); + transition: + background 0.1s, + border-color 0.1s; +} + +.IconButton:hover { + background: rgba(0, 98, 179, 0.8); + border-color: rgba(255, 255, 255, 0.4); +} + +.IconButton:active { + background: rgba(0, 98, 179, 0.7); + border-color: rgba(255, 255, 255, 0.3); + transform: translate(0, 1px); +} + .StaticShapeLabel { background: rgba(0, 0, 0, 0.5); color: #fff; @@ -353,3 +389,26 @@ input[type="range"] { color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; } + +.CopyCoordinatesButton .ClipboardCheck { + display: none; + opacity: 1; +} + +@keyframes showClipboardCheck { + 0% { + opacity: 1; + } + 100% { + opacity: 0.2; + } +} + +.CopyCoordinatesButton[data-copied="true"] .ClipboardCheck { + display: block; + animation: showClipboardCheck 300ms linear infinite; +} + +.CopyCoordinatesButton[data-copied="true"] .MapPin { + display: none; +} diff --git a/docs/404.html b/docs/404.html index 9b86b716..4b48cc09 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index 9b86b716..4b48cc09 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/__next.__PAGE__.txt b/docs/__next.__PAGE__.txt index 9b3f1b70..90abd507 100644 --- a/docs/__next.__PAGE__.txt +++ b/docs/__next.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[47257,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ClientPageRoot"] -3:I[31713,["/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","/t2-mapper/_next/static/chunks/88a69012eeffa5b8.js","/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js"],"default"] +3:I[31713,["/t2-mapper/_next/static/chunks/9309477277712998.js","/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","/t2-mapper/_next/static/chunks/259e253a988800da.js","/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js"],"default"] 6:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/88a69012eeffa5b8.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/259e253a988800da.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/docs/__next._full.txt b/docs/__next._full.txt index fb9bfebd..3d857604 100644 --- a/docs/__next._full.txt +++ b/docs/__next._full.txt @@ -1,18 +1,19 @@ 1:"$Sreact.fragment" -2:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -3:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -4:I[47257,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ClientPageRoot"] -5:I[31713,["/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","/t2-mapper/_next/static/chunks/88a69012eeffa5b8.js","/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js"],"default"] -8:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] -9:"$Sreact.suspense" -b:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ViewportBoundary"] -d:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] -f:I[68027,[],"default"] -:HL["/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","style"] -0:{"P":null,"b":"B9Mz834jSAfO_CiVWkcwc","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/88a69012eeffa5b8.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$@c"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$@e"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[]],"S":true} -6:{} -7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" -c:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] -10:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] -e:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L10","3",{}]] -a:null +2:I[12985,["/t2-mapper/_next/static/chunks/9309477277712998.js"],"NuqsAdapter"] +3:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +4:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +5:I[47257,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ClientPageRoot"] +6:I[31713,["/t2-mapper/_next/static/chunks/9309477277712998.js","/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","/t2-mapper/_next/static/chunks/259e253a988800da.js","/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js"],"default"] +9:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] +a:"$Sreact.suspense" +c:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ViewportBoundary"] +e:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] +10:I[68027,[],"default"] +:HL["/t2-mapper/_next/static/chunks/045236f705732fea.css","style"] +0:{"P":null,"b":"scQMBCUl76V3bQl4SK2Zy","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/045236f705732fea.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/9309477277712998.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/259e253a988800da.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$@d"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$@f"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +7:{} +8:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" +d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] +11:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] +f:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L11","3",{}]] +b:null diff --git a/docs/__next._head.txt b/docs/__next._head.txt index 0d73949a..cfa3f4e5 100644 --- a/docs/__next._head.txt +++ b/docs/__next._head.txt @@ -3,6 +3,6 @@ 4:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] 5:"$Sreact.suspense" 7:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":"$@3"}],["$","div",null,{"hidden":true,"children":["$","$L4",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$@6"}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":"$@3"}],["$","div",null,{"hidden":true,"children":["$","$L4",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$@6"}]}]}],null]}],"loading":null,"isPartial":false} 3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] 6:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L7","3",{}]] diff --git a/docs/__next._index.txt b/docs/__next._index.txt index e9cd28e3..b1bb37c6 100644 --- a/docs/__next._index.txt +++ b/docs/__next._index.txt @@ -1,5 +1,6 @@ 1:"$Sreact.fragment" -2:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -3:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","style"] -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","precedence":"next"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]]}],"loading":null,"isPartial":false} +2:I[12985,["/t2-mapper/_next/static/chunks/9309477277712998.js"],"NuqsAdapter"] +3:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +4:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +:HL["/t2-mapper/_next/static/chunks/045236f705732fea.css","style"] +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/045236f705732fea.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/9309477277712998.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/__next._tree.txt b/docs/__next._tree.txt index 073b5622..5bddafdd 100644 --- a/docs/__next._tree.txt +++ b/docs/__next._tree.txt @@ -1,2 +1,2 @@ -:HL["/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","style"] -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/045236f705732fea.css","style"] +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/_next/static/chunks/045236f705732fea.css b/docs/_next/static/chunks/045236f705732fea.css new file mode 100644 index 00000000..abb8cdb7 --- /dev/null +++ b/docs/_next/static/chunks/045236f705732fea.css @@ -0,0 +1 @@ +html{box-sizing:border-box;background:#000;margin:0;padding:0}*,:before,:after{box-sizing:inherit}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:100%}body{margin:0;padding:0}main{width:100vw;height:100vh}#canvasContainer{z-index:0;position:absolute;inset:0}#controls{color:#fff;z-index:1;background:#00000080;border-radius:0 0 4px;align-items:center;gap:20px;padding:8px 12px 8px 8px;font-size:13px;display:flex;position:fixed;top:0;left:0}input[type=range]{max-width:80px}.CheckboxField,.Field{align-items:center;gap:6px;display:flex}.IconButton{color:#fff;cursor:pointer;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d;border-radius:4px;justify-content:center;align-items:center;width:28px;height:28px;margin:0 0 0 -12px;padding:0;font-size:15px;transition:background .1s,border-color .1s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}.IconButton:hover{background:#0062b3cc;border-color:#fff6}.IconButton:active{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}.StaticShapeLabel{color:#fff;white-space:nowrap;text-align:center;background:#00000080;border-radius:1px;padding:1px 3px;font-size:11px}.StatsPanel{right:0;left:auto!important}.AxisLabel{pointer-events:none;font-size:12px}.AxisLabel[data-axis=x]{color:#f90}.AxisLabel[data-axis=y]{color:#9f0}.AxisLabel[data-axis=z]{color:#09f}.MissionSelect-inputWrapper{align-items:center;display:flex;position:relative}.MissionSelect-shortcut{color:#fff9;pointer-events:none;background:#ffffff26;border-radius:3px;padding:1px 4px;font-family:system-ui,sans-serif;font-size:11px;position:absolute;right:7px}.MissionSelect-input[aria-expanded=true]~.MissionSelect-shortcut{display:none}.MissionSelect-input{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;outline:none;width:280px;padding:6px 36px 6px 8px;font-size:14px}.MissionSelect-input[aria-expanded=true]{padding-right:8px}.MissionSelect-input:focus{border-color:#fff9}.MissionSelect-input::placeholder{color:#0000}.MissionSelect-selectedValue{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}.MissionSelect-input[aria-expanded=true]~.MissionSelect-selectedValue{display:none}.MissionSelect-selectedName{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden}.MissionSelect-selectedValue>.MissionSelect-itemType{flex-shrink:0}.MissionSelect-popover{z-index:100;min-width:320px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow-y:auto;box-shadow:0 8px 24px #0009}.MissionSelect-list{padding:4px 0}.MissionSelect-list:has(>.MissionSelect-group:first-child){padding-top:0}.MissionSelect-group{padding-bottom:4px}.MissionSelect-groupLabel{color:#c6caca;z-index:1;background:#3a4548f2;border-bottom:1px solid #ffffff4d;padding:6px 8px 6px 12px;font-size:13px;font-weight:600;position:sticky;top:0}.MissionSelect-group:not(:last-child){border-bottom:1px solid #ffffff4d}.MissionSelect-item{cursor:pointer;border-radius:4px;outline:none;flex-direction:column;gap:1px;margin:4px 4px 0;padding:6px 8px;scroll-margin-top:32px;display:flex}.MissionSelect-list>.MissionSelect-item:first-child{margin-top:0}.MissionSelect-item[data-active-item]{background:#ffffff26}.MissionSelect-item[aria-selected=true]{background:#6496ff4d}.MissionSelect-itemHeader{align-items:center;gap:6px;display:flex}.MissionSelect-itemName{color:#fff;font-size:14px;font-weight:600}.MissionSelect-itemTypes{gap:3px;display:flex}.MissionSelect-itemType{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600}.MissionSelect-itemType:hover{background:#ff9d00b3}.MissionSelect-itemMissionName{color:#ffffff80;font-size:12px}.MissionSelect-noResults{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px}.LoadingSpinner{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite LoadingSpinner-spin}@keyframes LoadingSpinner-spin{to{transform:rotate(360deg)}}#loadingIndicator{pointer-events:none;z-index:1;opacity:.8;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#loadingIndicator[data-complete=true]{animation:.3s ease-out forwards loadingComplete}@keyframes loadingComplete{0%{opacity:1}to{opacity:0}}.LoadingProgress{background:#fff3;border-radius:2px;width:200px;height:4px;overflow:hidden}.LoadingProgress-bar{background:#fff;border-radius:2px;height:100%;transition:width .1s ease-out}.LoadingProgress-text{color:#ffffffb3;font-variant-numeric:tabular-nums;font-size:14px}.CopyCoordinatesButton .ClipboardCheck{opacity:1;display:none}@keyframes showClipboardCheck{0%{opacity:1}to{opacity:.2}}.CopyCoordinatesButton[data-copied=true] .ClipboardCheck{animation:.3s linear infinite showClipboardCheck;display:block}.CopyCoordinatesButton[data-copied=true] .MapPin{display:none} diff --git a/docs/_next/static/chunks/259e253a988800da.js b/docs/_next/static/chunks/259e253a988800da.js new file mode 100644 index 00000000..9b244577 --- /dev/null +++ b/docs/_next/static/chunks/259e253a988800da.js @@ -0,0 +1,528 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),a=RegExp(i,"g"),o=RegExp(i,"");function s(e){return n[e]}var l=function(e){return e.replace(a,s)};t.exports=l,t.exports.has=function(e){return!!e.match(o)},t.exports.remove=l},29402,(e,t,r)=>{var n,i,a,o,s="__lodash_hash_undefined__",l=1/0,u="[object Arguments]",c="[object Array]",d="[object Boolean]",f="[object Date]",h="[object Error]",m="[object Function]",p="[object Map]",A="[object Number]",g="[object Object]",v="[object Promise]",C="[object RegExp]",B="[object Set]",y="[object String]",b="[object Symbol]",x="[object WeakMap]",E="[object ArrayBuffer]",M="[object DataView]",S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,T=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w=/\\(\\)?/g,D=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,G={};G["[object Float32Array]"]=G["[object Float64Array]"]=G["[object Int8Array]"]=G["[object Int16Array]"]=G["[object Int32Array]"]=G["[object Uint8Array]"]=G["[object Uint8ClampedArray]"]=G["[object Uint16Array]"]=G["[object Uint32Array]"]=!0,G[u]=G[c]=G[E]=G[d]=G[M]=G[f]=G[h]=G[m]=G[p]=G[A]=G[g]=G[C]=G[B]=G[y]=G[x]=!1;var L=e.g&&e.g.Object===Object&&e.g,O="object"==typeof self&&self&&self.Object===Object&&self,P=L||O||Function("return this")(),H=r&&!r.nodeType&&r,_=H&&t&&!t.nodeType&&t,k=_&&_.exports===H&&L.process,U=function(){try{return k&&k.binding("util")}catch(e){}}(),j=U&&U.isTypedArray;function N(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},eb.prototype.set=function(e,t){var r=this.__data__,n=eS(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ex.prototype.clear=function(){this.__data__={hash:new ey,map:new(el||eb),string:new ey}},ex.prototype.delete=function(e){return eL(this,e).delete(e)},ex.prototype.get=function(e){return eL(this,e).get(e)},ex.prototype.has=function(e){return eL(this,e).has(e)},ex.prototype.set=function(e,t){return eL(this,e).set(e,t),this},eE.prototype.add=eE.prototype.push=function(e){return this.__data__.set(e,s),this},eE.prototype.has=function(e){return this.__data__.has(e)},eM.prototype.clear=function(){this.__data__=new eb},eM.prototype.delete=function(e){return this.__data__.delete(e)},eM.prototype.get=function(e){return this.__data__.get(e)},eM.prototype.has=function(e){return this.__data__.has(e)},eM.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eb){var n=r.__data__;if(!el||n.length<199)return n.push([e,t]),this;r=this.__data__=new ex(n)}return r.set(e,t),this};var eF=(n=function(e,t){return e&&eT(e,t,e0)},function(e,t){if(null==e)return e;if(!eq(e))return n(e,t);for(var r=e.length,i=-1,a=Object(e);++is))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var c=-1,d=!0,f=1&i?new eE:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eY(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ez(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||ez(e)&&ee.call(e)==b}var e$=j?J(j):function(e){return ez(e)&&eW(e.length)&&!!G[ee.call(e)]};function e0(e){return eq(e)?function(e,t){var r=eV(e)||eQ(e)?function(e,t){for(var r=-1,n=Array(e);++rt||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;return l*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});l--;)s[l]=s[l].value;return s}(e,t,r))}},81405,(e,t,r)=>{var n;e.e,(n=function(){function e(e){return i.appendChild(e.dom),e}function t(e){for(var t=0;to+1e3&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:t}}).Panel=function(e,t,r){var n=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,l=48*o,u=3*o,c=2*o,d=3*o,f=15*o,h=74*o,m=30*o,p=document.createElement("canvas");p.width=s,p.height=l,p.style.cssText="width:80px;height:48px";var A=p.getContext("2d");return A.font="bold "+9*o+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=r,A.fillRect(0,0,s,l),A.fillStyle=t,A.fillText(e,u,c),A.fillRect(d,f,h,m),A.fillStyle=r,A.globalAlpha=.9,A.fillRect(d,f,h,m),{dom:p,update:function(l,g){n=Math.min(n,l),i=Math.max(i,l),A.fillStyle=r,A.globalAlpha=1,A.fillRect(0,0,s,f),A.fillStyle=t,A.fillText(a(l)+" "+e+" ("+a(n)+"-"+a(i)+")",u,c),A.drawImage(p,d+o,f,h-o,m,d,f,h-o,m),A.fillRect(d+h-o,f,o,m),A.fillStyle=r,A.globalAlpha=.9,A.fillRect(d+h-o,f,o,a((1-l/g)*m))}}},t.exports=n},31713,e=>{"use strict";let t,r,n,i,a,o,s,l;var u,c,d=e.i(43476),f=e.i(71645),h=e.i(91037),m=e.i(8560),p=e.i(90072);e.s(["ACESFilmicToneMapping",()=>p.ACESFilmicToneMapping,"AddEquation",()=>p.AddEquation,"AddOperation",()=>p.AddOperation,"AdditiveAnimationBlendMode",()=>p.AdditiveAnimationBlendMode,"AdditiveBlending",()=>p.AdditiveBlending,"AgXToneMapping",()=>p.AgXToneMapping,"AlphaFormat",()=>p.AlphaFormat,"AlwaysCompare",()=>p.AlwaysCompare,"AlwaysDepth",()=>p.AlwaysDepth,"AlwaysStencilFunc",()=>p.AlwaysStencilFunc,"AmbientLight",()=>p.AmbientLight,"AnimationAction",()=>p.AnimationAction,"AnimationClip",()=>p.AnimationClip,"AnimationLoader",()=>p.AnimationLoader,"AnimationMixer",()=>p.AnimationMixer,"AnimationObjectGroup",()=>p.AnimationObjectGroup,"AnimationUtils",()=>p.AnimationUtils,"ArcCurve",()=>p.ArcCurve,"ArrayCamera",()=>p.ArrayCamera,"ArrowHelper",()=>p.ArrowHelper,"AttachedBindMode",()=>p.AttachedBindMode,"Audio",()=>p.Audio,"AudioAnalyser",()=>p.AudioAnalyser,"AudioContext",()=>p.AudioContext,"AudioListener",()=>p.AudioListener,"AudioLoader",()=>p.AudioLoader,"AxesHelper",()=>p.AxesHelper,"BackSide",()=>p.BackSide,"BasicDepthPacking",()=>p.BasicDepthPacking,"BasicShadowMap",()=>p.BasicShadowMap,"BatchedMesh",()=>p.BatchedMesh,"Bone",()=>p.Bone,"BooleanKeyframeTrack",()=>p.BooleanKeyframeTrack,"Box2",()=>p.Box2,"Box3",()=>p.Box3,"Box3Helper",()=>p.Box3Helper,"BoxGeometry",()=>p.BoxGeometry,"BoxHelper",()=>p.BoxHelper,"BufferAttribute",()=>p.BufferAttribute,"BufferGeometry",()=>p.BufferGeometry,"BufferGeometryLoader",()=>p.BufferGeometryLoader,"ByteType",()=>p.ByteType,"Cache",()=>p.Cache,"Camera",()=>p.Camera,"CameraHelper",()=>p.CameraHelper,"CanvasTexture",()=>p.CanvasTexture,"CapsuleGeometry",()=>p.CapsuleGeometry,"CatmullRomCurve3",()=>p.CatmullRomCurve3,"CineonToneMapping",()=>p.CineonToneMapping,"CircleGeometry",()=>p.CircleGeometry,"ClampToEdgeWrapping",()=>p.ClampToEdgeWrapping,"Clock",()=>p.Clock,"Color",()=>p.Color,"ColorKeyframeTrack",()=>p.ColorKeyframeTrack,"ColorManagement",()=>p.ColorManagement,"CompressedArrayTexture",()=>p.CompressedArrayTexture,"CompressedCubeTexture",()=>p.CompressedCubeTexture,"CompressedTexture",()=>p.CompressedTexture,"CompressedTextureLoader",()=>p.CompressedTextureLoader,"ConeGeometry",()=>p.ConeGeometry,"ConstantAlphaFactor",()=>p.ConstantAlphaFactor,"ConstantColorFactor",()=>p.ConstantColorFactor,"Controls",()=>p.Controls,"CubeCamera",()=>p.CubeCamera,"CubeDepthTexture",()=>p.CubeDepthTexture,"CubeReflectionMapping",()=>p.CubeReflectionMapping,"CubeRefractionMapping",()=>p.CubeRefractionMapping,"CubeTexture",()=>p.CubeTexture,"CubeTextureLoader",()=>p.CubeTextureLoader,"CubeUVReflectionMapping",()=>p.CubeUVReflectionMapping,"CubicBezierCurve",()=>p.CubicBezierCurve,"CubicBezierCurve3",()=>p.CubicBezierCurve3,"CubicInterpolant",()=>p.CubicInterpolant,"CullFaceBack",()=>p.CullFaceBack,"CullFaceFront",()=>p.CullFaceFront,"CullFaceFrontBack",()=>p.CullFaceFrontBack,"CullFaceNone",()=>p.CullFaceNone,"Curve",()=>p.Curve,"CurvePath",()=>p.CurvePath,"CustomBlending",()=>p.CustomBlending,"CustomToneMapping",()=>p.CustomToneMapping,"CylinderGeometry",()=>p.CylinderGeometry,"Cylindrical",()=>p.Cylindrical,"Data3DTexture",()=>p.Data3DTexture,"DataArrayTexture",()=>p.DataArrayTexture,"DataTexture",()=>p.DataTexture,"DataTextureLoader",()=>p.DataTextureLoader,"DataUtils",()=>p.DataUtils,"DecrementStencilOp",()=>p.DecrementStencilOp,"DecrementWrapStencilOp",()=>p.DecrementWrapStencilOp,"DefaultLoadingManager",()=>p.DefaultLoadingManager,"DepthFormat",()=>p.DepthFormat,"DepthStencilFormat",()=>p.DepthStencilFormat,"DepthTexture",()=>p.DepthTexture,"DetachedBindMode",()=>p.DetachedBindMode,"DirectionalLight",()=>p.DirectionalLight,"DirectionalLightHelper",()=>p.DirectionalLightHelper,"DiscreteInterpolant",()=>p.DiscreteInterpolant,"DodecahedronGeometry",()=>p.DodecahedronGeometry,"DoubleSide",()=>p.DoubleSide,"DstAlphaFactor",()=>p.DstAlphaFactor,"DstColorFactor",()=>p.DstColorFactor,"DynamicCopyUsage",()=>p.DynamicCopyUsage,"DynamicDrawUsage",()=>p.DynamicDrawUsage,"DynamicReadUsage",()=>p.DynamicReadUsage,"EdgesGeometry",()=>p.EdgesGeometry,"EllipseCurve",()=>p.EllipseCurve,"EqualCompare",()=>p.EqualCompare,"EqualDepth",()=>p.EqualDepth,"EqualStencilFunc",()=>p.EqualStencilFunc,"EquirectangularReflectionMapping",()=>p.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>p.EquirectangularRefractionMapping,"Euler",()=>p.Euler,"EventDispatcher",()=>p.EventDispatcher,"ExternalTexture",()=>p.ExternalTexture,"ExtrudeGeometry",()=>p.ExtrudeGeometry,"FileLoader",()=>p.FileLoader,"Float16BufferAttribute",()=>p.Float16BufferAttribute,"Float32BufferAttribute",()=>p.Float32BufferAttribute,"FloatType",()=>p.FloatType,"Fog",()=>p.Fog,"FogExp2",()=>p.FogExp2,"FramebufferTexture",()=>p.FramebufferTexture,"FrontSide",()=>p.FrontSide,"Frustum",()=>p.Frustum,"FrustumArray",()=>p.FrustumArray,"GLBufferAttribute",()=>p.GLBufferAttribute,"GLSL1",()=>p.GLSL1,"GLSL3",()=>p.GLSL3,"GreaterCompare",()=>p.GreaterCompare,"GreaterDepth",()=>p.GreaterDepth,"GreaterEqualCompare",()=>p.GreaterEqualCompare,"GreaterEqualDepth",()=>p.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>p.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>p.GreaterStencilFunc,"GridHelper",()=>p.GridHelper,"Group",()=>p.Group,"HalfFloatType",()=>p.HalfFloatType,"HemisphereLight",()=>p.HemisphereLight,"HemisphereLightHelper",()=>p.HemisphereLightHelper,"IcosahedronGeometry",()=>p.IcosahedronGeometry,"ImageBitmapLoader",()=>p.ImageBitmapLoader,"ImageLoader",()=>p.ImageLoader,"ImageUtils",()=>p.ImageUtils,"IncrementStencilOp",()=>p.IncrementStencilOp,"IncrementWrapStencilOp",()=>p.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>p.InstancedBufferAttribute,"InstancedBufferGeometry",()=>p.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>p.InstancedInterleavedBuffer,"InstancedMesh",()=>p.InstancedMesh,"Int16BufferAttribute",()=>p.Int16BufferAttribute,"Int32BufferAttribute",()=>p.Int32BufferAttribute,"Int8BufferAttribute",()=>p.Int8BufferAttribute,"IntType",()=>p.IntType,"InterleavedBuffer",()=>p.InterleavedBuffer,"InterleavedBufferAttribute",()=>p.InterleavedBufferAttribute,"Interpolant",()=>p.Interpolant,"InterpolateDiscrete",()=>p.InterpolateDiscrete,"InterpolateLinear",()=>p.InterpolateLinear,"InterpolateSmooth",()=>p.InterpolateSmooth,"InterpolationSamplingMode",()=>p.InterpolationSamplingMode,"InterpolationSamplingType",()=>p.InterpolationSamplingType,"InvertStencilOp",()=>p.InvertStencilOp,"KeepStencilOp",()=>p.KeepStencilOp,"KeyframeTrack",()=>p.KeyframeTrack,"LOD",()=>p.LOD,"LatheGeometry",()=>p.LatheGeometry,"Layers",()=>p.Layers,"LessCompare",()=>p.LessCompare,"LessDepth",()=>p.LessDepth,"LessEqualCompare",()=>p.LessEqualCompare,"LessEqualDepth",()=>p.LessEqualDepth,"LessEqualStencilFunc",()=>p.LessEqualStencilFunc,"LessStencilFunc",()=>p.LessStencilFunc,"Light",()=>p.Light,"LightProbe",()=>p.LightProbe,"Line",()=>p.Line,"Line3",()=>p.Line3,"LineBasicMaterial",()=>p.LineBasicMaterial,"LineCurve",()=>p.LineCurve,"LineCurve3",()=>p.LineCurve3,"LineDashedMaterial",()=>p.LineDashedMaterial,"LineLoop",()=>p.LineLoop,"LineSegments",()=>p.LineSegments,"LinearFilter",()=>p.LinearFilter,"LinearInterpolant",()=>p.LinearInterpolant,"LinearMipMapLinearFilter",()=>p.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>p.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>p.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>p.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>p.LinearSRGBColorSpace,"LinearToneMapping",()=>p.LinearToneMapping,"LinearTransfer",()=>p.LinearTransfer,"Loader",()=>p.Loader,"LoaderUtils",()=>p.LoaderUtils,"LoadingManager",()=>p.LoadingManager,"LoopOnce",()=>p.LoopOnce,"LoopPingPong",()=>p.LoopPingPong,"LoopRepeat",()=>p.LoopRepeat,"MOUSE",()=>p.MOUSE,"Material",()=>p.Material,"MaterialLoader",()=>p.MaterialLoader,"MathUtils",()=>p.MathUtils,"Matrix2",()=>p.Matrix2,"Matrix3",()=>p.Matrix3,"Matrix4",()=>p.Matrix4,"MaxEquation",()=>p.MaxEquation,"Mesh",()=>p.Mesh,"MeshBasicMaterial",()=>p.MeshBasicMaterial,"MeshDepthMaterial",()=>p.MeshDepthMaterial,"MeshDistanceMaterial",()=>p.MeshDistanceMaterial,"MeshLambertMaterial",()=>p.MeshLambertMaterial,"MeshMatcapMaterial",()=>p.MeshMatcapMaterial,"MeshNormalMaterial",()=>p.MeshNormalMaterial,"MeshPhongMaterial",()=>p.MeshPhongMaterial,"MeshPhysicalMaterial",()=>p.MeshPhysicalMaterial,"MeshStandardMaterial",()=>p.MeshStandardMaterial,"MeshToonMaterial",()=>p.MeshToonMaterial,"MinEquation",()=>p.MinEquation,"MirroredRepeatWrapping",()=>p.MirroredRepeatWrapping,"MixOperation",()=>p.MixOperation,"MultiplyBlending",()=>p.MultiplyBlending,"MultiplyOperation",()=>p.MultiplyOperation,"NearestFilter",()=>p.NearestFilter,"NearestMipMapLinearFilter",()=>p.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>p.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>p.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>p.NearestMipmapNearestFilter,"NeutralToneMapping",()=>p.NeutralToneMapping,"NeverCompare",()=>p.NeverCompare,"NeverDepth",()=>p.NeverDepth,"NeverStencilFunc",()=>p.NeverStencilFunc,"NoBlending",()=>p.NoBlending,"NoColorSpace",()=>p.NoColorSpace,"NoNormalPacking",()=>p.NoNormalPacking,"NoToneMapping",()=>p.NoToneMapping,"NormalAnimationBlendMode",()=>p.NormalAnimationBlendMode,"NormalBlending",()=>p.NormalBlending,"NormalGAPacking",()=>p.NormalGAPacking,"NormalRGPacking",()=>p.NormalRGPacking,"NotEqualCompare",()=>p.NotEqualCompare,"NotEqualDepth",()=>p.NotEqualDepth,"NotEqualStencilFunc",()=>p.NotEqualStencilFunc,"NumberKeyframeTrack",()=>p.NumberKeyframeTrack,"Object3D",()=>p.Object3D,"ObjectLoader",()=>p.ObjectLoader,"ObjectSpaceNormalMap",()=>p.ObjectSpaceNormalMap,"OctahedronGeometry",()=>p.OctahedronGeometry,"OneFactor",()=>p.OneFactor,"OneMinusConstantAlphaFactor",()=>p.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>p.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>p.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>p.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>p.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>p.OneMinusSrcColorFactor,"OrthographicCamera",()=>p.OrthographicCamera,"PCFShadowMap",()=>p.PCFShadowMap,"PCFSoftShadowMap",()=>p.PCFSoftShadowMap,"PMREMGenerator",()=>m.PMREMGenerator,"Path",()=>p.Path,"PerspectiveCamera",()=>p.PerspectiveCamera,"Plane",()=>p.Plane,"PlaneGeometry",()=>p.PlaneGeometry,"PlaneHelper",()=>p.PlaneHelper,"PointLight",()=>p.PointLight,"PointLightHelper",()=>p.PointLightHelper,"Points",()=>p.Points,"PointsMaterial",()=>p.PointsMaterial,"PolarGridHelper",()=>p.PolarGridHelper,"PolyhedronGeometry",()=>p.PolyhedronGeometry,"PositionalAudio",()=>p.PositionalAudio,"PropertyBinding",()=>p.PropertyBinding,"PropertyMixer",()=>p.PropertyMixer,"QuadraticBezierCurve",()=>p.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>p.QuadraticBezierCurve3,"Quaternion",()=>p.Quaternion,"QuaternionKeyframeTrack",()=>p.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>p.QuaternionLinearInterpolant,"R11_EAC_Format",()=>p.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>p.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>p.RED_RGTC1_Format,"REVISION",()=>p.REVISION,"RG11_EAC_Format",()=>p.RG11_EAC_Format,"RGBADepthPacking",()=>p.RGBADepthPacking,"RGBAFormat",()=>p.RGBAFormat,"RGBAIntegerFormat",()=>p.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>p.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>p.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>p.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>p.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>p.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>p.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>p.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>p.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>p.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>p.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>p.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>p.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>p.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>p.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>p.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>p.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>p.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>p.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>p.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>p.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>p.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>p.RGBDepthPacking,"RGBFormat",()=>p.RGBFormat,"RGBIntegerFormat",()=>p.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>p.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>p.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>p.RGB_ETC1_Format,"RGB_ETC2_Format",()=>p.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>p.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>p.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>p.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>p.RGDepthPacking,"RGFormat",()=>p.RGFormat,"RGIntegerFormat",()=>p.RGIntegerFormat,"RawShaderMaterial",()=>p.RawShaderMaterial,"Ray",()=>p.Ray,"Raycaster",()=>p.Raycaster,"RectAreaLight",()=>p.RectAreaLight,"RedFormat",()=>p.RedFormat,"RedIntegerFormat",()=>p.RedIntegerFormat,"ReinhardToneMapping",()=>p.ReinhardToneMapping,"RenderTarget",()=>p.RenderTarget,"RenderTarget3D",()=>p.RenderTarget3D,"RepeatWrapping",()=>p.RepeatWrapping,"ReplaceStencilOp",()=>p.ReplaceStencilOp,"ReverseSubtractEquation",()=>p.ReverseSubtractEquation,"RingGeometry",()=>p.RingGeometry,"SIGNED_R11_EAC_Format",()=>p.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>p.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>p.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>p.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>p.SRGBColorSpace,"SRGBTransfer",()=>p.SRGBTransfer,"Scene",()=>p.Scene,"ShaderChunk",()=>m.ShaderChunk,"ShaderLib",()=>m.ShaderLib,"ShaderMaterial",()=>p.ShaderMaterial,"ShadowMaterial",()=>p.ShadowMaterial,"Shape",()=>p.Shape,"ShapeGeometry",()=>p.ShapeGeometry,"ShapePath",()=>p.ShapePath,"ShapeUtils",()=>p.ShapeUtils,"ShortType",()=>p.ShortType,"Skeleton",()=>p.Skeleton,"SkeletonHelper",()=>p.SkeletonHelper,"SkinnedMesh",()=>p.SkinnedMesh,"Source",()=>p.Source,"Sphere",()=>p.Sphere,"SphereGeometry",()=>p.SphereGeometry,"Spherical",()=>p.Spherical,"SphericalHarmonics3",()=>p.SphericalHarmonics3,"SplineCurve",()=>p.SplineCurve,"SpotLight",()=>p.SpotLight,"SpotLightHelper",()=>p.SpotLightHelper,"Sprite",()=>p.Sprite,"SpriteMaterial",()=>p.SpriteMaterial,"SrcAlphaFactor",()=>p.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>p.SrcAlphaSaturateFactor,"SrcColorFactor",()=>p.SrcColorFactor,"StaticCopyUsage",()=>p.StaticCopyUsage,"StaticDrawUsage",()=>p.StaticDrawUsage,"StaticReadUsage",()=>p.StaticReadUsage,"StereoCamera",()=>p.StereoCamera,"StreamCopyUsage",()=>p.StreamCopyUsage,"StreamDrawUsage",()=>p.StreamDrawUsage,"StreamReadUsage",()=>p.StreamReadUsage,"StringKeyframeTrack",()=>p.StringKeyframeTrack,"SubtractEquation",()=>p.SubtractEquation,"SubtractiveBlending",()=>p.SubtractiveBlending,"TOUCH",()=>p.TOUCH,"TangentSpaceNormalMap",()=>p.TangentSpaceNormalMap,"TetrahedronGeometry",()=>p.TetrahedronGeometry,"Texture",()=>p.Texture,"TextureLoader",()=>p.TextureLoader,"TextureUtils",()=>p.TextureUtils,"Timer",()=>p.Timer,"TimestampQuery",()=>p.TimestampQuery,"TorusGeometry",()=>p.TorusGeometry,"TorusKnotGeometry",()=>p.TorusKnotGeometry,"Triangle",()=>p.Triangle,"TriangleFanDrawMode",()=>p.TriangleFanDrawMode,"TriangleStripDrawMode",()=>p.TriangleStripDrawMode,"TrianglesDrawMode",()=>p.TrianglesDrawMode,"TubeGeometry",()=>p.TubeGeometry,"UVMapping",()=>p.UVMapping,"Uint16BufferAttribute",()=>p.Uint16BufferAttribute,"Uint32BufferAttribute",()=>p.Uint32BufferAttribute,"Uint8BufferAttribute",()=>p.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>p.Uint8ClampedBufferAttribute,"Uniform",()=>p.Uniform,"UniformsGroup",()=>p.UniformsGroup,"UniformsLib",()=>m.UniformsLib,"UniformsUtils",()=>p.UniformsUtils,"UnsignedByteType",()=>p.UnsignedByteType,"UnsignedInt101111Type",()=>p.UnsignedInt101111Type,"UnsignedInt248Type",()=>p.UnsignedInt248Type,"UnsignedInt5999Type",()=>p.UnsignedInt5999Type,"UnsignedIntType",()=>p.UnsignedIntType,"UnsignedShort4444Type",()=>p.UnsignedShort4444Type,"UnsignedShort5551Type",()=>p.UnsignedShort5551Type,"UnsignedShortType",()=>p.UnsignedShortType,"VSMShadowMap",()=>p.VSMShadowMap,"Vector2",()=>p.Vector2,"Vector3",()=>p.Vector3,"Vector4",()=>p.Vector4,"VectorKeyframeTrack",()=>p.VectorKeyframeTrack,"VideoFrameTexture",()=>p.VideoFrameTexture,"VideoTexture",()=>p.VideoTexture,"WebGL3DRenderTarget",()=>p.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>p.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>p.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>p.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>p.WebGLRenderTarget,"WebGLRenderer",()=>m.WebGLRenderer,"WebGLUtils",()=>m.WebGLUtils,"WebGPUCoordinateSystem",()=>p.WebGPUCoordinateSystem,"WebXRController",()=>p.WebXRController,"WireframeGeometry",()=>p.WireframeGeometry,"WrapAroundEnding",()=>p.WrapAroundEnding,"ZeroCurvatureEnding",()=>p.ZeroCurvatureEnding,"ZeroFactor",()=>p.ZeroFactor,"ZeroSlopeEnding",()=>p.ZeroSlopeEnding,"ZeroStencilOp",()=>p.ZeroStencilOp,"createCanvasElement",()=>p.createCanvasElement,"error",()=>p.error,"getConsoleFunction",()=>p.getConsoleFunction,"log",()=>p.log,"setConsoleFunction",()=>p.setConsoleFunction,"warn",()=>p.warn,"warnOnce",()=>p.warnOnce],32009);var A=e.i(32009);function g(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let v=["x","y","top","bottom","left","right","width","height"];var C=e.i(46791);function B({ref:e,children:t,fallback:r,resize:n,style:i,gl:a,events:o=h.f,eventSource:s,eventPrefix:l,shadows:u,linear:c,flat:m,legacy:p,orthographic:C,frameloop:B,dpr:y,performance:b,raycaster:x,camera:E,scene:M,onPointerMissed:S,onCreated:F,...T}){f.useMemo(()=>(0,h.e)(A),[]);let R=(0,h.u)(),[w,D]=function({debounce:e,scroll:t,polyfill:r,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var i,a,o;let s=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[l,u]=(0,f.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,f.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:l,orientationHandler:null}),d=e?"number"==typeof e?e:e.scroll:null,h=e?"number"==typeof e?e:e.resize:null,m=(0,f.useRef)(!1);(0,f.useEffect)(()=>(m.current=!0,()=>void(m.current=!1)));let[p,A,C]=(0,f.useMemo)(()=>{let e=()=>{let e,t;if(!c.current.element)return;let{left:r,top:i,width:a,height:o,bottom:s,right:l,x:d,y:f}=c.current.element.getBoundingClientRect(),h={left:r,top:i,width:a,height:o,bottom:s,right:l,x:d,y:f};c.current.element instanceof HTMLElement&&n&&(h.height=c.current.element.offsetHeight,h.width=c.current.element.offsetWidth),Object.freeze(h),m.current&&(e=c.current.lastBounds,t=h,!v.every(r=>e[r]===t[r]))&&u(c.current.lastBounds=h)};return[e,h?g(e,h):e,d?g(e,d):e]},[u,n,d,h]);function B(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",C,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null),c.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",c.current.orientationHandler))}function y(){c.current.element&&(c.current.resizeObserver=new s(C),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(e=>e.addEventListener("scroll",C,{capture:!0,passive:!0})),c.current.orientationHandler=()=>{C()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",c.current.orientationHandler))}return i=C,a=!!t,(0,f.useEffect)(()=>{if(a)return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)},[i,a]),o=A,(0,f.useEffect)(()=>(window.addEventListener("resize",o),()=>void window.removeEventListener("resize",o)),[o]),(0,f.useEffect)(()=>{B(),y()},[t,C,A]),(0,f.useEffect)(()=>B,[]),[e=>{e&&e!==c.current.element&&(B(),c.current.element=e,c.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),y())},l,p]}({scroll:!0,debounce:{scroll:50,resize:0},...n}),I=f.useRef(null),G=f.useRef(null);f.useImperativeHandle(e,()=>I.current);let L=(0,h.a)(S),[O,P]=f.useState(!1),[H,_]=f.useState(!1);if(O)throw O;if(H)throw H;let k=f.useRef(null);(0,h.b)(()=>{let e=I.current;D.width>0&&D.height>0&&e&&(k.current||(k.current=(0,h.c)(e)),async function(){await k.current.configure({gl:a,scene:M,events:o,shadows:u,linear:c,flat:m,legacy:p,orthographic:C,frameloop:B,dpr:y,performance:b,raycaster:x,camera:E,size:D,onPointerMissed:(...e)=>null==L.current?void 0:L.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(s?(0,h.i)(s)?s.current:s:G.current),l&&e.setEvents({compute:(e,t)=>{let r=e[l+"X"],n=e[l+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==F||F(e)}}),k.current.render((0,d.jsx)(R,{children:(0,d.jsx)(h.E,{set:_,children:(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)(h.B,{set:P}),children:null!=t?t:null})})}))}())}),f.useEffect(()=>{let e=I.current;if(e)return()=>(0,h.d)(e)},[]);let U=s?"none":"auto";return(0,d.jsx)("div",{ref:G,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...i},...T,children:(0,d.jsx)("div",{ref:w,style:{width:"100%",height:"100%"},children:(0,d.jsx)("canvas",{ref:I,style:{display:"block"},children:r})})})}function y(e){return(0,d.jsx)(C.FiberProvider,{children:(0,d.jsx)(B,{...e})})}e.i(39695),e.i(98133),e.i(95087);var b=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.i(47167);var x={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},E=new class{#e=x;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},M="undefined"==typeof window||"Deno"in globalThis;function S(){}function F(e){return"number"==typeof e&&e>=0&&e!==1/0}function T(e,t){return Math.max(e+(t||0)-Date.now(),0)}function R(e,t){return"function"==typeof e?e(t):e}function w(e,t){return"function"==typeof e?e(t):e}function D(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==G(o,t.options))return!1}else if(!O(t.queryKey,o))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&(!i||i===t.state.fetchStatus)&&(!a||!!a(t))}function I(e,t){let{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(L(t.options.mutationKey)!==L(a))return!1}else if(!O(t.options.mutationKey,a))return!1}return(!n||t.state.status===n)&&(!i||!!i(t))}function G(e,t){return(t?.queryKeyHashFn||L)(e)}function L(e){return JSON.stringify(e,(e,t)=>k(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function O(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>O(e[r],t[r]))}var P=Object.prototype.hasOwnProperty;function H(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function _(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function k(e){if(!U(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!U(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function U(e){return"[object Object]"===Object.prototype.toString.call(e)}function j(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=_(t)&&_(r);if(!n&&!(k(t)&&k(r)))return r;let i=(n?t:Object.keys(t)).length,a=n?r:Object.keys(r),o=a.length,s=n?Array(o):{},l=0;for(let u=0;ur?n.slice(1):n}function J(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var K=Symbol();function Q(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==K?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}var V=new class extends b{#r;#n;#i;constructor(){super(),this.#i=e=>{if(!M&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#i=e,this.#n?.(),this.#n=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}},q=(r=[],n=0,i=e=>{e()},a=e=>{e()},o=function(e){setTimeout(e,0)},{batch:e=>{let t;n++;try{t=e()}finally{let e;--n||(e=r,r=[],e.length&&o(()=>{a(()=>{e.forEach(e=>{i(e)})})}))}return t},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s=e=>{n?r.push(e):o(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{a=e},setScheduler:e=>{o=e}}),X=new class extends b{#a=!0;#n;#i;constructor(){super(),this.#i=e=>{if(!M&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#n||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#i=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function W(){let e,t,r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function Y(e){return Math.min(1e3*2**e,3e4)}function z(e){return(e??"online")!=="online"||X.isOnline()}var Z=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function $(e){let t,r=!1,n=0,i=W(),a=()=>V.isFocused()&&("always"===e.networkMode||X.isOnline())&&e.canRun(),o=()=>z(e.networkMode)&&e.canRun(),s=e=>{"pending"===i.status&&(t?.(),i.resolve(e))},l=e=>{"pending"===i.status&&(t?.(),i.reject(e))},u=()=>new Promise(r=>{t=e=>{("pending"!==i.status||a())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===i.status&&e.onContinue?.()}),c=()=>{let t;if("pending"!==i.status)return;let o=0===n?e.initialPromise:void 0;try{t=o??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(s).catch(t=>{if("pending"!==i.status)return;let o=e.retry??3*!M,s=e.retryDelay??Y,d="function"==typeof s?s(n,t):s,f=!0===o||"number"==typeof o&&n{E.setTimeout(e,d)}).then(()=>a()?void 0:u()).then(()=>{r?l(t):c()}))})};return{promise:i,status:()=>i.status,cancel:t=>{if("pending"===i.status){let r=new Z(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:o,start:()=>(o()?c():u().then(c),i)}}var ee=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),F(this.gcTime)&&(this.#o=E.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M?1/0:3e5))}clearGcTimeout(){this.#o&&(E.clearTimeout(this.#o),this.#o=void 0)}},et=class extends ee{#s;#l;#u;#c;#d;#f;#h;constructor(e){super(),this.#h=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#s=ei(this.options),this.state=e.state??this.#s,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=ei(this.options);void 0!==e.data&&(this.setState(en(e.data,e.dataUpdatedAt)),this.#s=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){let r=j(this.state.data,e,this.options);return this.#m({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#m({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#s)}isActive(){return this.observers.some(e=>!1!==w(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===K||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===R(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!T(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#h?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,t){let r;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},a=()=>{let e,r=Q(this.options,t),n=(i(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#h=!1,this.options.persister)?this.options.persister(r,n,this):r(n)},o=(i(r={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),r);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#m({type:"fetch",meta:o.fetchOptions?.meta}),this.#d=$({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof Z&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Z){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#m({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#m(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...er(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...en(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),q.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function er(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function en(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ei(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ea=class extends b{constructor(e,t){super(),this.options=t,this.#c=e,this.#p=null,this.#A=W(),this.bindMethods(),this.setOptions(t)}#c;#g=void 0;#v=void 0;#C=void 0;#B;#y;#A;#p;#b;#x;#E;#M;#S;#F;#T=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#g.addObserver(this),eo(this.#g,this.options)?this.#R():this.updateResult(),this.#w())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return es(this.#g,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return es(this.#g,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#D(),this.#I(),this.#g.removeObserver(this)}setOptions(e){let t=this.options,r=this.#g;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof w(this.options.enabled,this.#g))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#G(),this.#g.setOptions(this.options),t._defaulted&&!H(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#g,observer:this});let n=this.hasListeners();n&&el(this.#g,r,this.options,t)&&this.#R(),this.updateResult(),n&&(this.#g!==r||w(this.options.enabled,this.#g)!==w(t.enabled,this.#g)||R(this.options.staleTime,this.#g)!==R(t.staleTime,this.#g))&&this.#L();let i=this.#O();n&&(this.#g!==r||w(this.options.enabled,this.#g)!==w(t.enabled,this.#g)||i!==this.#F)&&this.#P(i)}getOptimisticResult(e){var t,r;let n=this.#c.getQueryCache().build(this.#c,e),i=this.createResult(n,e);return t=this,r=i,H(t.getCurrentResult(),r)||(this.#C=i,this.#y=this.options,this.#B=this.#g.state),i}getCurrentResult(){return this.#C}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#A.status||this.#A.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#T.add(e)}getCurrentQuery(){return this.#g}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#R({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#C))}#R(e){this.#G();let t=this.#g.fetch(this.options,e);return e?.throwOnError||(t=t.catch(S)),t}#L(){this.#D();let e=R(this.options.staleTime,this.#g);if(M||this.#C.isStale||!F(e))return;let t=T(this.#C.dataUpdatedAt,e);this.#M=E.setTimeout(()=>{this.#C.isStale||this.updateResult()},t+1)}#O(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#g):this.options.refetchInterval)??!1}#P(e){this.#I(),this.#F=e,!M&&!1!==w(this.options.enabled,this.#g)&&F(this.#F)&&0!==this.#F&&(this.#S=E.setInterval(()=>{(this.options.refetchIntervalInBackground||V.isFocused())&&this.#R()},this.#F))}#w(){this.#L(),this.#P(this.#O())}#D(){this.#M&&(E.clearTimeout(this.#M),this.#M=void 0)}#I(){this.#S&&(E.clearInterval(this.#S),this.#S=void 0)}createResult(e,t){let r,n=this.#g,i=this.options,a=this.#C,o=this.#B,s=this.#y,l=e!==n?e.state:this.#v,{state:u}=e,c={...u},d=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&eo(e,t),o=r&&el(e,n,t,i);(a||o)&&(c={...c,...er(u.data,e.options)}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:m}=c;r=c.data;let p=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===m){let e;a?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=a.data,p=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#E?.state.data,this.#E):t.placeholderData,void 0!==e&&(m="success",r=j(a?.data,e,t),d=!0)}if(t.select&&void 0!==r&&!p)if(a&&r===o?.data&&t.select===this.#b)r=this.#x;else try{this.#b=t.select,r=t.select(r),r=j(a?.data,r,t),this.#x=r,this.#p=null}catch(e){this.#p=e}this.#p&&(f=this.#p,r=this.#x,h=Date.now(),m="error");let A="fetching"===c.fetchStatus,g="pending"===m,v="error"===m,C=g&&A,B=void 0!==r,y={status:m,fetchStatus:c.fetchStatus,isPending:g,isSuccess:"success"===m,isError:v,isInitialLoading:C,isLoading:C,data:r,dataUpdatedAt:c.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:A,isRefetching:A&&!g,isLoadingError:v&&!B,isPaused:"paused"===c.fetchStatus,isPlaceholderData:d,isRefetchError:v&&B,isStale:eu(e,t),refetch:this.refetch,promise:this.#A,isEnabled:!1!==w(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===y.status?e.reject(y.error):void 0!==y.data&&e.resolve(y.data)},r=()=>{t(this.#A=y.promise=W())},i=this.#A;switch(i.status){case"pending":e.queryHash===n.queryHash&&t(i);break;case"fulfilled":("error"===y.status||y.data!==i.value)&&r();break;case"rejected":("error"!==y.status||y.error!==i.reason)&&r()}}return y}updateResult(){let e=this.#C,t=this.createResult(this.#g,this.options);if(this.#B=this.#g.state,this.#y=this.options,void 0!==this.#B.data&&(this.#E=this.#g),H(t,e))return;this.#C=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#T.size)return!0;let n=new Set(r??this.#T);return this.options.throwOnError&&n.add("error"),Object.keys(this.#C).some(t=>this.#C[t]!==e[t]&&n.has(t))};this.#H({listeners:r()})}#G(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#g)return;let t=this.#g;this.#g=e,this.#v=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#w()}#H(e){q.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#C)}),this.#c.getQueryCache().notify({query:this.#g,type:"observerResultsUpdated"})})}};function eo(e,t){return!1!==w(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&es(e,t,t.refetchOnMount)}function es(e,t,r){if(!1!==w(t.enabled,e)&&"static"!==R(t.staleTime,e)){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&eu(e,t)}return!1}function el(e,t,r,n){return(e!==t||!1===w(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&eu(e,r)}function eu(e,t){return!1!==w(t.enabled,e)&&e.isStaleByTime(R(t.staleTime,e))}var ec=f.createContext(void 0),ed=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,d.jsx)(ec.Provider,{value:e,children:t})),ef=f.createContext((l=!1,{clearReset:()=>{l=!1},reset:()=>{l=!0},isReset:()=>l})),eh=f.createContext(!1);eh.Provider;var em=(e,t)=>void 0===t.state.data,ep=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function eA(e,t,r){let n=f.useContext(eh),i=f.useContext(ef),a=(e=>{let t=f.useContext(ec);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t})(r),o=a.defaultQueryOptions(e);if(a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=n?"isRestoring":"optimistic",o.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=o.staleTime;o.staleTime="function"==typeof t?(...r)=>e(t(...r)):e(t),"number"==typeof o.gcTime&&(o.gcTime=Math.max(o.gcTime,1e3))}(o.suspense||o.throwOnError||o.experimental_prefetchInRender)&&!i.isReset()&&(o.retryOnMount=!1),f.useEffect(()=>{i.clearReset()},[i]);let s=!a.getQueryCache().get(o.queryHash),[l]=f.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),c=!n&&!1!==e.subscribed;if(f.useSyncExternalStore(f.useCallback(e=>{let t=c?l.subscribe(q.batchCalls(e)):S;return l.updateResult(),t},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o)},[o,l]),o?.suspense&&u.isPending)throw ep(o,l,i);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>{var a;return e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&void 0===e.data||(a=[e.error,n],"function"==typeof r?r(...a):!!r))})({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if(a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!M&&u.isLoading&&u.isFetching&&!n){let e=s?ep(o,l,i):a.getQueryCache().get(o.queryHash)?.promise;e?.catch(S).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}var eg=e.i(54970),ev=e.i(12979),eC=e.i(49774),eB=e.i(73949),ey=e.i(62395),eb=e.i(75567),ex=e.i(47071);let eE={value:!0},eM=` +vec3 terrainLinearToSRGB(vec3 linear) { + vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; + vec3 lower = linear * 12.92; + return mix(lower, higher, step(vec3(0.0031308), linear)); +} + +vec3 terrainSRGBToLinear(vec3 srgb) { + vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); + vec3 lower = srgb / 12.92; + return mix(lower, higher, step(vec3(0.04045), srgb)); +} + +// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines +// Returns 1.0 on grid lines, 0.0 elsewhere +float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); +} +`;var eS=e.i(79123),eF=e.i(47021),eT=e.i(48066);let eR={0:32,1:32,2:32,3:32,4:32,5:32};function ew({displacementMap:e,visibilityMask:t,textureNames:r,alphaTextures:n,detailTextureName:i,lightmap:a}){let{debugMode:o}=(0,eS.useDebug)(),s=(0,ex.useTexture)(r.map(e=>(0,ev.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,eb.setupTexture)(e))}),l=i?(0,ev.textureToUrl)(i):null,u=(0,ex.useTexture)(l??ev.FALLBACK_TEXTURE_URL,e=>{(0,eb.setupTexture)(e)}),c=(0,f.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:n,tiling:i,detailTexture:a=null,lightmap:o=null}){e.uniforms.sunLightPointsDown=eE;let s=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),n&&(e.uniforms.visibilityMask={value:n}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:i[r]??32}}),o&&(e.uniforms.terrainLightmap={value:o}),a&&(e.uniforms.detailTexture={value:a},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include +varying vec3 vTerrainWorldPos;`),e.vertexShader=e.vertexShader.replace("#include ",`#include +vTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;`)),e.fragmentShader=` +uniform sampler2D albedo0; +uniform sampler2D albedo1; +uniform sampler2D albedo2; +uniform sampler2D albedo3; +uniform sampler2D albedo4; +uniform sampler2D albedo5; +uniform sampler2D mask0; +uniform sampler2D mask1; +uniform sampler2D mask2; +uniform sampler2D mask3; +uniform sampler2D mask4; +uniform sampler2D mask5; +uniform float tiling0; +uniform float tiling1; +uniform float tiling2; +uniform float tiling3; +uniform float tiling4; +uniform float tiling5; +${n?"uniform sampler2D visibilityMask;":""} +${o?"uniform sampler2D terrainLightmap;":""} +uniform bool sunLightPointsDown; +${a?`uniform sampler2D detailTexture; +uniform float detailTiling; +uniform float detailFadeDistance; +varying vec3 vTerrainWorldPos;`:""} + +${eM} + +// Global variable to store shadow factor from RE_Direct for use in output calculation +float terrainShadowFactor = 1.0; +`+e.fragmentShader,n){let t="#include ";e.fragmentShader=e.fragmentShader.replace(t,`${t} + // Early discard for invisible areas (before fog/lighting) + float visibility = texture2D(visibilityMask, vMapUv).r; + if (visibility < 0.5) { + discard; + } + `)}e.fragmentShader=e.fragmentShader.replace("#include ",` + // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js) + vec2 baseUv = vMapUv; + vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb; + ${s>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":""} + ${s>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":""} + ${s>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":""} + ${s>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":""} + ${s>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":""} + + // Sample alpha masks for all layers (use R channel) + // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices), + // but GPU linear filtering samples at texel centers. This offset aligns them. + vec2 alphaUv = baseUv + vec2(0.5 / 256.0); + float a0 = texture2D(mask0, alphaUv).r; + ${s>1?"float a1 = texture2D(mask1, alphaUv).r;":""} + ${s>2?"float a2 = texture2D(mask2, alphaUv).r;":""} + ${s>3?"float a3 = texture2D(mask3, alphaUv).r;":""} + ${s>4?"float a4 = texture2D(mask4, alphaUv).r;":""} + ${s>5?"float a5 = texture2D(mask5, alphaUv).r;":""} + + // Torque-style additive weighted blending (blender.cc): + // result = tex0 * alpha0 + tex1 * alpha1 + tex2 * alpha2 + ... + // Each layer's alpha map defines its contribution weight. + vec3 blended = c0 * a0; + ${s>1?"blended += c1 * a1;":""} + ${s>2?"blended += c2 * a2;":""} + ${s>3?"blended += c3 * a3;":""} + ${s>4?"blended += c4 * a4;":""} + ${s>5?"blended += c5 * a5;":""} + + // Assign to diffuseColor before lighting + vec3 textureColor = blended; + + ${a?`// Detail texture blending (Torque-style multiplicative blend) + // Sample detail texture at high frequency tiling + vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb; + + // Calculate distance-based fade factor using world positions + // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance + float distToCamera = distance(vTerrainWorldPos, cameraPosition); + float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0); + + // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor) + // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray + // Direct multiplication adds subtle darkening for surface detail + textureColor *= mix(vec3(1.0), detailColor, detailFade);`:""} + + // Store blended texture in diffuseColor (still in linear space here) + // We'll convert to sRGB in the output calculation + diffuseColor.rgb = textureColor; +`),o&&(e.fragmentShader=e.fragmentShader.replace("#include ",`#include + +// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting +#undef RE_Direct +void RE_Direct_TerrainShadow( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + // Torque lighting (terrLighting.cc): if light points up, terrain gets only ambient + // This prevents shadow acne from light hitting terrain backfaces + if (!sunLightPointsDown) { + terrainShadowFactor = 0.0; + return; + } + // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js) + // Extract shadow factor by comparing to original sun color + #if ( NUM_DIR_LIGHTS > 0 ) + vec3 originalSunColor = directionalLights[0].color; + float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b); + float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b); + terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0); + #endif + // Don't add to reflectedLight - we'll compute lighting in gamma space at output +} +#define RE_Direct RE_Direct_TerrainShadow + +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include +// Clear indirect diffuse - we'll compute ambient in gamma space +#if defined( RE_IndirectDiffuse ) + irradiance = vec3(0.0); +#endif +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include + // Clear Three.js lighting - we compute everything in gamma space + reflectedLight.directDiffuse = vec3(0.0); + reflectedLight.indirectDiffuse = vec3(0.0); +`)),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style terrain lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space +{ + // Get texture in sRGB space (undo Three.js linear decode) + vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb); + + ${o?` + // Sample terrain lightmap for smooth NdotL + vec2 lightmapUv = vMapUv + vec2(0.5 / 512.0); + float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r; + + // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file) + // Three.js interprets them as linear, but the numerical values are preserved + #if ( NUM_DIR_LIGHTS > 0 ) + vec3 sunColorSRGB = directionalLights[0].color; + #else + vec3 sunColorSRGB = vec3(0.7); + #endif + vec3 ambientColorSRGB = ambientLightColor; + + // Torque formula (terrLighting.cc:471-483): + // lighting = ambient + NdotL * shadowFactor * sunColor + // Clamp lighting to [0,1] before multiplying by texture + vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0); + `:` + // No lightmap - use simple ambient lighting + vec3 lightingSRGB = ambientLightColor; + `} + + // Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space + vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); + + // Convert back to linear for Three.js output pipeline + outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance; +} +#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`#if DEBUG_MODE + // Debug mode: overlay green grid matching terrain grid squares (256x256) + float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); + vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green + gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); +#endif + +#include `)}({shader:e,baseTextures:s,alphaTextures:n,visibilityMask:t,tiling:eR,detailTexture:l?u:null,lightmap:a}),(0,eF.injectCustomFog)(e,eT.globalFogUniforms)},[s,n,t,u,l,a]),h=(0,f.useRef)(null);(0,f.useEffect)(()=>{let e=h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!o,e.needsUpdate=!0)},[o]);let m=`${l?"detail":"nodetail"}-${a?"lightmap":"nolightmap"}`;return(0,d.jsx)("meshLambertMaterial",{ref:h,map:e,depthWrite:!0,side:p.FrontSide,defines:{DEBUG_MODE:+!!o},onBeforeCompile:c},m)}function eD({displacementMap:e,visibilityMask:t,textureNames:r,alphaTextures:n,detailTextureName:i,lightmap:a}){return(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),children:(0,d.jsx)(ew,{displacementMap:e,visibilityMask:t,textureNames:r,alphaTextures:n,detailTextureName:i,lightmap:a})})}let eI=(0,f.memo)(function({tileX:e,tileZ:t,blockSize:r,basePosition:n,textureNames:i,geometry:a,displacementMap:o,visibilityMask:s,alphaTextures:l,detailTextureName:u,lightmap:c,visible:h=!0}){let m=(0,f.useMemo)(()=>{let i=r/2;return[n.x+e*r+i,0,n.z+t*r+i]},[e,t,r,n]);return(0,d.jsx)("mesh",{position:m,geometry:a,castShadow:!0,receiveShadow:!0,visible:h,children:(0,d.jsx)(eD,{displacementMap:o,visibilityMask:s,textureNames:i,alphaTextures:l,detailTextureName:u,lightmap:c})})});var eG=e.i(77482);function eL(e){return(0,eG.useRuntime)().getObjectByName(e)}function eO(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,n=r>>8&255,i=r>>16,a=256*n;for(let r=0;r0?t:(0,ey.getFloat)(e,"visibleDistance")??600}(),o=(0,eB.useThree)(e=>e.camera),s=(0,f.useMemo)(()=>{let e=-(128*r);return{x:e,z:e}},[r]),l=(0,f.useMemo)(()=>{let t=(0,ey.getProperty)(e,"emptySquares");return t?t.split(" ").map(e=>parseInt(e,10)):[]},[e]),{data:u}=eA({queryKey:["terrain",t],queryFn:()=>(0,ev.loadTerrain)(t)},ea,void 0),c=(0,f.useMemo)(()=>{if(!u)return null;let e=function(e,t){let r=new p.BufferGeometry,n=new Float32Array(198147),i=new Float32Array(198147),a=new Float32Array(132098),o=new Uint32Array(393216),s=0,l=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let o=257*t+r;n[3*o]=r*l-e/2,n[3*o+1]=e/2-t*l,n[3*o+2]=0,i[3*o]=0,i[3*o+1]=0,i[3*o+2]=1,a[2*o]=r/256,a[2*o+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,n=r+1,i=(e+1)*257+t,a=i+1;((t^e)&1)==0?(o[s++]=r,o[s++]=i,o[s++]=a,o[s++]=r,o[s++]=a,o[s++]=n):(o[s++]=r,o[s++]=i,o[s++]=n,o[s++]=n,o[s++]=i,o[s++]=a)}return r.setIndex(new p.BufferAttribute(o,1)),r.setAttribute("position",new p.Float32BufferAttribute(n,3)),r.setAttribute("normal",new p.Float32BufferAttribute(i,3)),r.setAttribute("uv",new p.Float32BufferAttribute(a,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(256*r,0);return!function(e,t,r){let n=e.attributes.position,i=e.attributes.uv,a=e.attributes.normal,o=n.array,s=i.array,l=a.array,u=n.count,c=(e,r)=>(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let n=Math.floor(e=Math.max(0,Math.min(255,e))),i=Math.floor(r=Math.max(0,Math.min(255,r))),a=Math.min(n+1,255),o=Math.min(i+1,255),s=e-n,l=r-i;return(t[256*i+n]/65535*2048*(1-s)+t[256*i+a]/65535*2048*s)*(1-l)+(t[256*o+n]/65535*2048*(1-s)+t[256*o+a]/65535*2048*s)*l};for(let e=0;e0?(m/=g,p/=g,A/=g):(m=0,p=1,A=0),l[3*e]=m,l[3*e+1]=p,l[3*e+2]=A}n.needsUpdate=!0,a.needsUpdate=!0}(e,u.heightMap,r),e},[r,u]),h=eL("Sun"),m=(0,f.useMemo)(()=>{if(!h)return new p.Vector3(.57735,-.57735,.57735);let[e,t,r]=((0,ey.getProperty)(h,"direction")??"0.57735 0.57735 -0.57735").split(" ").map(e=>parseFloat(e)),n=Math.sqrt(e*e+r*r+t*t);return new p.Vector3(e/n,r/n,t/n)},[h]),A=(0,f.useMemo)(()=>u?function(e,t,r){let n=(t,r)=>{let n=Math.max(0,Math.min(255,t)),i=Math.max(0,Math.min(255,r)),a=Math.floor(n),o=Math.floor(i),s=Math.min(a+1,255),l=Math.min(o+1,255),u=n-a,c=i-o;return((e[256*o+a]/65535*(1-u)+e[256*o+s]/65535*u)*(1-c)+(e[256*l+a]/65535*(1-u)+e[256*l+s]/65535*u)*c)*2048},i=new p.Vector3(-t.x,-t.y,-t.z).normalize(),a=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let o=t/2+.25,s=e/2+.25,l=n(o,s),u=n(o-.5,s),c=n(o+.5,s),d=n(o,s-.5),f=-((n(o,s+.5)-d)/1),h=-((c-u)/1),m=Math.sqrt(f*f+r*r+h*h),p=Math.max(0,f/m*i.x+r/m*i.y+h/m*i.z),A=1;p>0&&(A=function(e,t,r,n,i,a){let o=n.z/i,s=n.x/i,l=n.y,u=Math.sqrt(o*o+s*s);if(u<1e-4)return 1;let c=.5/u,d=o*c,f=s*c,h=l*c,m=e,p=t,A=r+.1;for(let e=0;e<768&&(m+=d,p+=f,A+=h,!(m<0)&&!(m>=256)&&!(p<0)&&!(p>=256)&&!(A>2048));e++)if(A{if(!u)return null;let e=function(e){let t=new Float32Array(e.length);for(let r=0;reO(l),[l]),C=(0,f.useMemo)(()=>eO([]),[]),B=(0,f.useMemo)(()=>u?u.alphaMaps.map(e=>(0,eb.setupMask)(e)):null,[u]),y=(0,f.useMemo)(()=>{let e=2*Math.ceil(a/i)+1;return e*e-1},[a,i]),b=(0,f.useMemo)(()=>Array.from({length:y},(e,t)=>t),[y]),[x,E]=(0,f.useState)(()=>Array(y).fill(null)),M=(0,f.useRef)({xStart:0,xEnd:0,zStart:0,zEnd:0});return((0,eC.useFrame)(()=>{let e=o.position.x-s.x,t=o.position.z-s.z,r=Math.floor((e-a)/i),n=Math.ceil((e+a)/i),l=Math.floor((t-a)/i),u=Math.ceil((t+a)/i),c=M.current;if(r===c.xStart&&n===c.xEnd&&l===c.zStart&&u===c.zEnd)return;c.xStart=r,c.xEnd=n,c.zStart=l,c.zEnd=u;let d=[];for(let e=r;e{let t=x[e];return(0,d.jsx)(eI,{tileX:t?.tileX??0,tileZ:t?.tileZ??0,blockSize:i,basePosition:s,textureNames:u.textureNames,geometry:c,displacementMap:g,visibilityMask:C,alphaTextures:B,detailTextureName:n,lightmap:A,visible:null!==t},e)})]}):null}),eH=(0,f.createContext)(null);function e_(){return(0,f.useContext)(eH)}var ek=f;let eU=(0,ek.createContext)(null),ej={didCatch:!1,error:null};class eN extends ek.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ej}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,n=arguments.length,i=Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,n)){var i,a;null==(i=(a=this.props).onReset)||i.call(a,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(ej)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(r)o=(0,ek.createElement)(r,e);else if(void 0!==n)o=n;else throw a}return(0,ek.createElement)(eU.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}var eJ=e.i(31067),eK=p;function eQ(e,t){if(t===p.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==p.TriangleFanDrawMode&&t!==p.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e=2.0 are supported."));return}let s=new tT(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}s.setExtensions(a),s.setPlugins(o),s.parse(r,n)}parseAsync(e,t){let r=this;return new Promise(function(n,i){r.parse(e,t,n,i)})}}function ez(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let eZ={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class e${constructor(e){this.parser=e,this.name=eZ.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,i.source,a)}}class tn{constructor(e){this.parser=e,this.name=eZ.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=n.images[a.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,a.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class ti{constructor(e){this.parser=e,this.name=eZ.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=n.images[a.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,a.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class ta{constructor(e){this.name=eZ.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return n.then(function(t){let r=e.byteOffset||0,n=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}}}class to{constructor(e){this.name=eZ.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==tp.TRIANGLES&&e.mode!==tp.TRIANGLE_STRIP&&e.mode!==tp.TRIANGLE_FAN&&void 0!==e.mode)return null;let n=r.extensions[this.name].attributes,i=[],a={};for(let e in n)i.push(this.parser.getDependency("accessor",n[e]).then(t=>(a[e]=t,a[e])));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],n=e[0].count,i=[];for(let e of r){let t=new eK.Matrix4,r=new eK.Vector3,o=new eK.Quaternion,s=new eK.Vector3(1,1,1),l=new eK.InstancedMesh(e.geometry,e.material,n);for(let e=0;e=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ty={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},tb={CUBICSPLINE:void 0,LINEAR:eK.InterpolateLinear,STEP:eK.InterpolateDiscrete};function tx(e,t,r){for(let n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function tE(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function tM(e){let t="",r=Object.keys(e).sort();for(let n=0,i=r.length;n-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&i<98?this.textureLoader=new eK.TextureLoader(this.options.manager):this.textureLoader=new eK.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new eK.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let a={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return tx(i,a,n),tE(a,n),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r{let r=this.associations.get(e);for(let[n,a]of(null!=r&&this.associations.set(t,r),e.children.entries()))i(a,t.children[n])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&a.setY(t,d[e*s+1]),s>=3&&a.setZ(t,d[e*s+2]),s>=4&&a.setW(t,d[e*s+3]),s>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n],a=this.textureLoader;if(i.uri){let e=r.manager.getHandler(i.uri);null!==e&&(a=e)}return this.loadTextureImage(e,n,a)}loadTextureImage(e,t,r){let n=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[s])return this.textureCache[s];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(i.samplers||{})[a.sampler]||{};return t.magFilter=tg[r.magFilter]||eK.LinearFilter,t.minFilter=tg[r.minFilter]||eK.LinearMipmapLinearFilter,t.wrapS=tv[r.wrapS]||eK.RepeatWrapping,t.wrapT=tv[r.wrapT]||eK.RepeatWrapping,n.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=l,l}loadImageSource(e,t){let r=this.json,n=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let i=r.images[e],a=self.URL||self.webkitURL,o=i.uri||"",s=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then(function(e){s=!0;let t=new Blob([e],{type:i.mimeType});return o=a.createObjectURL(t)});else if(void 0===i.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(e){return new Promise(function(r,i){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new eK.Texture(e);t.needsUpdate=!0,r(t)}),t.load(eK.LoaderUtils.resolveURL(e,n.path),a,void 0,i)})}).then(function(e){var t;return!0===s&&a.revokeObjectURL(o),tE(e,i),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,n){let i=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((a=a.clone()).channel=r.texCoord),i.extensions[eZ.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[eZ.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=i.associations.get(a);a=i.extensions[eZ.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return void 0!==n&&("number"==typeof n&&(n=3001===n?eX:eW),"colorSpace"in a?a.colorSpace=n:a.encoding=n===eX?3001:3e3),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,r=e.material,n=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new eK.PointsMaterial,eK.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new eK.LineBasicMaterial,eK.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(n||i||a){let e="ClonedMaterial:"+r.uuid+":";n&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return eK.MeshStandardMaterial}loadMaterial(e){let t,r=this,n=this.json,i=this.extensions,a=n.materials[e],o={},s=a.extensions||{},l=[];if(s[eZ.KHR_MATERIALS_UNLIT]){let e=i[eZ.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(o,a,r))}else{let n=a.pbrMetallicRoughness||{};if(o.color=new eK.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],eW),o.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(r.assignTexture(o,"map",n.baseColorTexture,eX)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(r.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),l.push(r.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===a.doubleSided&&(o.side=eK.DoubleSide);let u=a.alphaMode||"OPAQUE";if("BLEND"===u?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,"MASK"===u&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==eK.MeshBasicMaterial&&(l.push(r.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new eK.Vector2(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==eK.MeshBasicMaterial&&(l.push(r.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==eK.MeshBasicMaterial){let e=a.emissiveFactor;o.emissive=new eK.Color().setRGB(e[0],e[1],e[2],eW)}return void 0!==a.emissiveTexture&&t!==eK.MeshBasicMaterial&&l.push(r.assignTexture(o,"emissiveMap",a.emissiveTexture,eX)),Promise.all(l).then(function(){let n=new t(o);return a.name&&(n.name=a.name),tE(n,a),r.associations.set(n,{materials:e}),a.extensions&&tx(i,n,a),n})}createUniqueName(e){let t=eK.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,n=this.primitiveCache,i=[];for(let a=0,o=e.length;a0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,n=t.weights.length;r1?new eK.Group:1===t.length?t[0]:new eK.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of n.associations)(e instanceof eK.Material||e instanceof eK.Texture)&&t.set(e,r);return e.traverse(e=>{let r=n.associations.get(e);null!=r&&t.set(e,r)}),t})(i),i})}_createAnimationTracks(e,t,r,n,i){let a,o=[],s=e.name?e.name:e.uuid,l=[];switch(ty[i.path]===ty.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(s),ty[i.path]){case ty.weights:a=eK.NumberKeyframeTrack;break;case ty.rotation:a=eK.QuaternionKeyframeTrack;break;case ty.position:case ty.scale:a=eK.VectorKeyframeTrack;break;default:a=1===r.itemSize?eK.NumberKeyframeTrack:eK.VectorKeyframeTrack}let u=void 0!==n.interpolation?tb[n.interpolation]:eK.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(n)},r,n)}decodeDracoFile(e,t,r,n){let i={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let n=JSON.stringify(t);if(tD.has(e)){let t=tD.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),tD.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new tw.BufferGeometry;e.index&&t.setIndex(new tw.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=tG.toString(),i=["/* draco decoder */",r,"\n/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,r=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(i),i.byteLength);try{let e=function(e,t,r,n){var i,a,o;let s,l,u,c,d,f,h=n.attributeIDs,m=n.attributeTypes,p=t.GetEncodedGeometryType(r);if(p===e.TRIANGULAR_MESH)d=new e.Mesh,f=t.DecodeBufferToMesh(r,d);else if(p===e.POINT_CLOUD)d=new e.PointCloud,f=t.DecodeBufferToPointCloud(r,d);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||0===d.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let A={index:null,attributes:[]};for(let r in h){let i,a,o=self[m[r]];if(n.useUniqueIDs)a=h[r],i=t.GetAttributeByUniqueId(d,a);else{if(-1===(a=t.GetAttributeId(d,e[h[r]])))continue;i=t.GetAttribute(d,a)}A.attributes.push(function(e,t,r,n,i,a){let o=a.num_components(),s=r.num_points()*o,l=s*i.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,a,u,l,c);let d=new i(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:n,array:d,itemSize:o}}(e,t,d,r,o,i))}return p===e.TRIANGULAR_MESH&&(i=e,a=t,o=d,s=3*o.num_faces(),l=4*s,u=i._malloc(l),a.GetTrianglesUInt32Array(o,l,u),c=new Uint32Array(i.HEAPF32.buffer,u,s).slice(),i._free(u),A.index={array:c,itemSize:1}),e.destroy(d),A}(t,r,o,a),i=e.attributes.map(e=>e.array.buffer);e.index&&i.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},i)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(o),t.destroy(r)}})}}}var tL=e.i(971);let tO=function(e){let t=new Map,r=new Map,n=e.clone();return function e(t,r,n){n(t,r);for(let i=0;i{let c={keys:s,deep:n,inject:o,castShadow:i,receiveShadow:a};if(Array.isArray(t=f.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return tO(t)}return t},[t,e])))return f.createElement("group",(0,eJ.default)({},l,{ref:u}),t.map(e=>f.createElement(tP,(0,eJ.default)({key:e.uuid,object:e},c))),r);let{children:d,...h}=function(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:r,inject:n,castShadow:i,receiveShadow:a}){let o={};for(let r of t)o[r]=e[r];return r&&(o.geometry&&"materialsOnly"!==r&&(o.geometry=o.geometry.clone()),o.material&&"geometriesOnly"!==r&&(o.material=o.material.clone())),n&&(o="function"==typeof n?{...o,children:n(e)}:f.isValidElement(n)?{...o,children:n}:{...o,...n}),e instanceof p.Mesh&&(i&&(o.castShadow=!0),a&&(o.receiveShadow=!0)),o}(t,c),m=t.type[0].toLowerCase()+t.type.slice(1);return f.createElement(m,(0,eJ.default)({},h,l,{ref:u}),t.children.map(e=>"Bone"===e.type?f.createElement("primitive",(0,eJ.default)({key:e.uuid,object:e},c)):f.createElement(tP,(0,eJ.default)({key:e.uuid,object:e},c,{isChild:!0}))),r,d)}),tH=null,t_="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function tk(e=!0,r=!0,n){return i=>{n&&n(i),e&&(tH||(tH=new tI),tH.setDecoderPath("string"==typeof e?e:t_),i.setDRACOLoader(tH)),r&&i.setMeshoptDecoder((()=>{let e;if(t)return t;let r=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]),n=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(r)&&(i="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");let a=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let i=0;i{(e=t.instance).exports.__wasm_call_ctors()});function o(t,r,n,i,a,o){let s=e.exports.sbrk,l=n+3&-4,u=s(l*i),c=s(a.length),d=new Uint8Array(e.exports.memory.buffer);d.set(a,c);let f=t(u,n,i,c,a.length);if(0===f&&o&&o(u,l,i),r.set(d.subarray(u,u+n*i)),s(u-s(0)),0!==f)throw Error(`Malformed buffer data: ${f}`)}let s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:a,supported:!0,decodeVertexBuffer(t,r,n,i,a){o(e.exports.meshopt_decodeVertexBuffer,t,r,n,i,e.exports[s[a]])},decodeIndexBuffer(t,r,n,i){o(e.exports.meshopt_decodeIndexBuffer,t,r,n,i)},decodeIndexSequence(t,r,n,i){o(e.exports.meshopt_decodeIndexSequence,t,r,n,i)},decodeGltfBuffer(t,r,n,i,a,u){o(e.exports[l[a]],t,r,n,i,e.exports[s[u]])}}})())}}let tU=(e,t,r,n)=>(0,tL.useLoader)(eY,e,tk(t,r,n));tU.preload=(e,t,r,n)=>tL.useLoader.preload(eY,e,tk(t,r,n)),tU.clear=e=>tL.useLoader.clear(eY,e),tU.setDecoderPath=e=>{t_=e};var tj=e.i(89887);let tN=` +vec3 interiorLinearToSRGB(vec3 linear) { + vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; + vec3 lower = linear * 12.92; + return mix(lower, higher, step(vec3(0.0031308), linear)); +} + +vec3 interiorSRGBToLinear(vec3 srgb) { + vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); + vec3 lower = srgb / 12.92; + return mix(lower, higher, step(vec3(0.04045), srgb)); +} + +// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines +// Returns 1.0 on grid lines, 0.0 elsewhere +float debugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); +} +`;function tJ({materialName:e,material:t,lightMap:r}){let n=(0,eS.useDebug)(),i=n?.debugMode??!1,a=(0,ev.textureToUrl)(e),o=(0,ex.useTexture)(a,e=>(0,eb.setupTexture)(e)),s=new Set(t?.userData?.flag_names??[]).has("SelfIlluminating"),l=new Set(t?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),u=(0,f.useCallback)(e=>{let t;(0,eF.injectCustomFog)(e,eT.globalFogUniforms),t=l??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new p.Vector3(0,.4,1):new p.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include +${tN} +uniform bool useSceneLighting; +uniform vec3 interiorDebugColor; +`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation +#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space +// Get texture in sRGB space (undo Three.js linear decode) +vec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb); + +// Compute lighting in sRGB space +vec3 lightingSRGB = vec3(0.0); + +if (useSceneLighting) { + // Three.js computed: reflectedLight = lighting \xd7 texture_linear / PI + // Extract pure lighting: lighting = reflectedLight \xd7 PI / texture_linear + vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001)); + vec3 extractedLighting = totalLight * PI / safeTexLinear; + // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors + // are sRGB values (Torque used them directly in gamma space). Three.js treats them + // as linear but the numerical values are the same. DO NOT convert to sRGB here! + // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap + // (sceneLighting.cc line 1785: tmp.clamp()) + lightingSRGB = clamp(extractedLighting, 0.0, 1.0); +} + +// Add lightmap contribution (for BOTH outside and inside surfaces) +// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load +// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here. +#ifdef USE_LIGHTMAP + // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back + lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb); +#endif +// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827) +lightingSRGB = clamp(lightingSRGB, 0.0, 1.0); + +// Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space +vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); + +// Convert back to linear for Three.js output pipeline +vec3 resultLinear = interiorSRGBToLinear(resultSRGB); + +// Reassign outgoingLight before opaque_fragment consumes it +outgoingLight = resultLinear + totalEmissiveRadiance; + +#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Debug mode: overlay colored grid on top of normal rendering +// Blue grid = SurfaceOutsideVisible (receives scene ambient light) +// Red grid = inside surface (no scene ambient light) +#if DEBUG_MODE && defined(USE_MAP) + // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide + float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); + gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); +#endif + +#include `)},[l]),c=(0,f.useRef)(null),h=(0,f.useRef)(null);(0,f.useEffect)(()=>{let e=c.current??h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let m={DEBUG_MODE:+!!i},A=`${l}`;return s?(0,d.jsx)("meshBasicMaterial",{ref:c,map:o,toneMapped:!1,defines:m,onBeforeCompile:u},A):(0,d.jsx)("meshLambertMaterial",{ref:h,map:o,lightMap:r,toneMapped:!1,defines:m,onBeforeCompile:u},A)}function tK(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=p.SRGBColorSpace),t??null}function tQ({node:e}){let t=(0,f.useMemo)(()=>e.material?Array.isArray(e.material)?e.material.map(e=>tK(e)):[tK(e.material)]:[],[e.material]);return(0,d.jsx)("mesh",{geometry:e.geometry,castShadow:!0,receiveShadow:!0,children:e.material?(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(e.material)?e.material.map((e,r)=>(0,d.jsx)(tJ,{materialName:e.userData.resource_path,material:e,lightMap:t[r]},r)):(0,d.jsx)(tJ,{materialName:e.material.userData.resource_path,material:e.material,lightMap:t[0]})}):null})}let tV=(0,f.memo)(({object:e,interiorFile:t})=>{let{nodes:r}=tU((0,ev.interiorToUrl)(t)),n=(0,eS.useDebug)(),i=n?.debugMode??!1;return(0,d.jsxs)("group",{rotation:[0,-Math.PI/2,0],children:[Object.entries(r).filter(([,e])=>e.isMesh).map(([e,t])=>(0,d.jsx)(tQ,{node:t},e)),i?(0,d.jsxs)(tj.FloatingLabel,{children:[e._id,": ",t]}):null]})});function tq({color:e,label:t}){return(0,d.jsxs)("mesh",{children:[(0,d.jsx)("boxGeometry",{args:[10,10,10]}),(0,d.jsx)("meshStandardMaterial",{color:e,wireframe:!0}),t?(0,d.jsx)(tj.FloatingLabel,{color:e,children:t}):null]})}function tX({label:e}){let t=(0,eS.useDebug)();return t?.debugMode?(0,d.jsx)(tq,{color:"red",label:e}):null}let tW=(0,f.memo)(function({object:e}){let t=(0,ey.getProperty)(e,"interiorFile"),r=(0,f.useMemo)(()=>(0,ey.getPosition)(e),[e]),n=(0,f.useMemo)(()=>(0,ey.getScale)(e),[e]),i=(0,f.useMemo)(()=>(0,ey.getRotation)(e),[e]);return(0,d.jsx)("group",{position:r,quaternion:i,scale:n,children:(0,d.jsx)(eN,{fallback:(0,d.jsx)(tX,{label:`${e._id}: ${t}`}),children:(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)(tq,{color:"orange"}),children:(0,d.jsx)(tV,{object:e,interiorFile:t})})})})});function tY(e,{path:t}){let[r]=(0,tL.useLoader)(p.CubeTextureLoader,[e],e=>e.setPath(t));return r}tY.preload=(e,{path:t})=>tL.useLoader.preload(p.CubeTextureLoader,[e],e=>e.setPath(t));let tz=()=>{};function tZ(e){return e.wrapS=p.RepeatWrapping,e.wrapT=p.RepeatWrapping,e.minFilter=p.LinearFilter,e.magFilter=p.LinearFilter,e.colorSpace=p.NoColorSpace,e.needsUpdate=!0,e}let t$=` + attribute float alpha; + + uniform vec2 uvOffset; + + varying vec2 vUv; + varying float vAlpha; + + void main() { + // Apply UV offset for scrolling + vUv = uv + uvOffset; + vAlpha = alpha; + + vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + // Set depth to far plane so clouds are always visible and behind other geometry + gl_Position = pos.xyww; + } +`,t0=` + uniform sampler2D cloudTexture; + uniform float debugMode; + uniform int layerIndex; + + varying vec2 vUv; + varying float vAlpha; + + // Debug grid using screen-space derivatives for sharp, anti-aliased lines + float debugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); + } + + void main() { + vec4 texColor = texture2D(cloudTexture, vUv); + + // Tribes 2 uses GL_MODULATE: final = texture \xd7 vertex color + // Vertex color is white with varying alpha, so: + // Final RGB = Texture RGB \xd7 1.0 = Texture RGB + // Final Alpha = Texture Alpha \xd7 Vertex Alpha + float finalAlpha = texColor.a * vAlpha; + vec3 color = texColor.rgb; + + // Debug mode: overlay R/G/B grid for layers 0/1/2 + if (debugMode > 0.5) { + float gridIntensity = debugGrid(vUv, 4.0, 1.5); + vec3 gridColor; + if (layerIndex == 0) { + gridColor = vec3(1.0, 0.0, 0.0); // Red + } else if (layerIndex == 1) { + gridColor = vec3(0.0, 1.0, 0.0); // Green + } else { + gridColor = vec3(0.0, 0.0, 1.0); // Blue + } + color = mix(color, gridColor, gridIntensity * 0.5); + } + + // Output clouds with texture color and combined alpha + gl_FragColor = vec4(color, finalAlpha); + } +`;function t1({textureUrl:e,radius:t,heightPercent:r,speed:n,windDirection:i,layerIndex:a}){let{debugMode:o}=(0,eS.useDebug)(),{animationEnabled:s}=(0,eS.useSettings)(),l=(0,f.useRef)(null),u=(0,ex.useTexture)(e,tZ),c=(0,f.useMemo)(()=>{let e=r-.05;return function(e,t,r,n){var i;let a,o,s,l,u,c,d,f,h,m,A,g,v,C,B,y,b,x=new p.BufferGeometry,E=new Float32Array(75),M=new Float32Array(50),S=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],F=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let n=5*t+r,i=-e+r*F,a=e-t*F,o=e*S[n];E[3*n]=i,E[3*n+1]=o,E[3*n+2]=a,M[2*n]=r,M[2*n+1]=t}i=E,a=e=>({x:i[3*e],y:i[3*e+1],z:i[3*e+2]}),o=(e,t,r,n)=>{i[3*e]=t,i[3*e+1]=r,i[3*e+2]=n},s=a(1),l=a(3),u=a(5),c=a(6),d=a(8),f=a(9),h=a(15),m=a(16),A=a(18),g=a(19),v=a(21),C=a(23),B=u.x+(s.x-u.x)*.5,y=u.y+(s.y-u.y)*.5,b=u.z+(s.z-u.z)*.5,o(0,c.x+(B-c.x)*2,c.y+(y-c.y)*2,c.z+(b-c.z)*2),B=f.x+(l.x-f.x)*.5,y=f.y+(l.y-f.y)*.5,b=f.z+(l.z-f.z)*.5,o(4,d.x+(B-d.x)*2,d.y+(y-d.y)*2,d.z+(b-d.z)*2),B=v.x+(h.x-v.x)*.5,y=v.y+(h.y-v.y)*.5,b=v.z+(h.z-v.z)*.5,o(20,m.x+(B-m.x)*2,m.y+(y-m.y)*2,m.z+(b-m.z)*2),B=C.x+(g.x-C.x)*.5,y=C.y+(g.y-C.y)*.5,b=C.z+(g.z-C.z)*.5,o(24,A.x+(B-A.x)*2,A.y+(y-A.y)*2,A.z+(b-A.z)*2);let T=function(e,t){let r=new Float32Array(25);for(let n=0;n<25;n++){let i=e[3*n],a=e[3*n+2],o=1.3-Math.sqrt(i*i+a*a)/t;o<.4?o=0:o>.8&&(o=1),r[n]=o}return r}(E,e),R=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,n=r+1,i=r+5,a=i+1;R.push(r,i,a),R.push(r,a,n)}return x.setIndex(R),x.setAttribute("position",new p.Float32BufferAttribute(E,3)),x.setAttribute("uv",new p.Float32BufferAttribute(M,2)),x.setAttribute("alpha",new p.Float32BufferAttribute(T,1)),x.computeBoundingSphere(),x}(t,r,e,0)},[t,r]);(0,f.useEffect)(()=>()=>{c.dispose()},[c]);let h=(0,f.useMemo)(()=>new p.ShaderMaterial({uniforms:{cloudTexture:{value:u},uvOffset:{value:new p.Vector2(0,0)},debugMode:{value:+!!o},layerIndex:{value:a}},vertexShader:t$,fragmentShader:t0,transparent:!0,depthWrite:!1,side:p.DoubleSide}),[u,o,a]);return(0,f.useEffect)(()=>()=>{h.dispose()},[h]),(0,eC.useFrame)(s?(e,t)=>{let r=1e3*t/32;l.current??=new p.Vector2(0,0),l.current.x+=i.x*n*r,l.current.y+=i.y*n*r,l.current.x-=Math.floor(l.current.x),l.current.y-=Math.floor(l.current.y),h.uniforms.uvOffset.value.copy(l.current)}:tz),(0,d.jsx)("mesh",{geometry:c,frustumCulled:!1,renderOrder:10,children:(0,d.jsx)("primitive",{object:h,attach:"material"})})}function t9({object:e}){var t;let{data:r}=eA({queryKey:["detailMapList",t=(0,ey.getProperty)(e,"materialList")],queryFn:()=>(0,ev.loadDetailMapList)(t),enabled:!!t},ea,void 0),n=.95*((0,ey.getFloat)(e,"visibleDistance")??500),i=(0,f.useMemo)(()=>[(0,ey.getFloat)(e,"cloudSpeed1")??1e-4,(0,ey.getFloat)(e,"cloudSpeed2")??2e-4,(0,ey.getFloat)(e,"cloudSpeed3")??3e-4],[e]),a=(0,f.useMemo)(()=>[(0,ey.getFloat)(e,"cloudHeightPer1")??.35,(0,ey.getFloat)(e,"cloudHeightPer2")??.25,(0,ey.getFloat)(e,"cloudHeightPer3")??.2],[e]),o=(0,f.useMemo)(()=>{let t=(0,ey.getProperty)(e,"windVelocity");if(t){let[e,r]=t.split(" ").map(e=>parseFloat(e));if(0!==e||0!==r)return new p.Vector2(r,-e).normalize()}return new p.Vector2(1,0)},[e]),s=(0,f.useMemo)(()=>{if(!r)return[];let e=[];for(let t=0;t<3;t++){let n=r[7+t];n&&e.push({texture:n,height:a[t],speed:i[t]})}return e},[r,i,a]),l=(0,f.useRef)(null);return((0,eC.useFrame)(({camera:e})=>{l.current&&l.current.position.copy(e.position)}),s&&0!==s.length)?(0,d.jsx)("group",{ref:l,children:s.map((e,t)=>{let r=(0,ev.textureToUrl)(e.texture);return(0,d.jsx)(f.Suspense,{fallback:null,children:(0,d.jsx)(t1,{textureUrl:r,radius:n,heightPercent:e.height,speed:e.speed,windDirection:o,layerIndex:t})},t)})}):null}let t2=!1;function t3(e){if(!e)return;let[t,r,n]=e.split(" ").map(e=>parseFloat(e));return[new p.Color().setRGB(t,r,n),new p.Color().setRGB(t,r,n).convertSRGBToLinear()]}function t8({skyBoxFiles:e,fogColor:t,fogState:r}){let{camera:n}=(0,eB.useThree)(),i=tY(e,{path:""}),a=!!t,o=(0,f.useMemo)(()=>n.projectionMatrixInverse,[n]),s=(0,f.useMemo)(()=>r?(0,eT.packFogVolumeData)(r.fogVolumes):new Float32Array(12),[r]),l=(0,f.useRef)({skybox:{value:i},fogColor:{value:t??new p.Color(0,0,0)},enableFog:{value:a},inverseProjectionMatrix:{value:o},cameraMatrixWorld:{value:n.matrixWorld},cameraHeight:eT.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:.18}}),u=(0,f.useMemo)(()=>{if(!r)return .18;let e=.95*r.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[r]);return(0,f.useEffect)(()=>{l.current.skybox.value=i,l.current.fogColor.value=t??new p.Color(0,0,0),l.current.enableFog.value=a,l.current.fogVolumeData.value=s,l.current.horizonFogHeight.value=u},[i,t,a,s,u]),(0,d.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,d.jsxs)("bufferGeometry",{children:[(0,d.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,d.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,d.jsx)("shaderMaterial",{uniforms:l.current,vertexShader:` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } + `,fragmentShader:` + uniform samplerCube skybox; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + // Convert linear to sRGB for display + // shaderMaterial does NOT get automatic linear->sRGB output conversion + // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js + vec3 linearToSRGB(vec3 linear) { + vec3 low = linear * 12.92; + vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; + return mix(low, high, step(vec3(0.0031308), linear)); + } + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear + vec4 skyColor = textureCube(skybox, direction); + vec3 finalColor; + + if (enableFog) { + vec3 effectiveFogColor = fogColor; + + // Calculate how much fog volume the ray passes through + // For skybox at "infinite" distance, the relevant height is how much + // of the volume is above/below camera depending on view direction + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // Check if camera is inside this volume + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + // Camera is inside the fog volume + // Looking horizontally or up at shallow angles means ray travels + // through more fog before exiting the volume + float heightAboveCamera = volMaxH - cameraHeight; + float heightBelowCamera = cameraHeight - volMinH; + float volumeHeight = volMaxH - volMinH; + + // For horizontal rays (direction.y ≈ 0), maximum fog influence + // For rays going up steeply, less fog (exits volume quickly) + // For rays going down, more fog (travels through volume below) + float rayInfluence; + if (direction.y >= 0.0) { + // Looking up: influence based on how steep we're looking + // Shallow angles = long path through fog = high influence + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + // Looking down: always high fog (into the volume) + rayInfluence = 1.0; + } + + // Scale by percentage and volume depth factor + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction (for haze at horizon) + // In Torque, the fog "bans" (bands) are rendered as geometry from + // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. + // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). + // + // horizonFogHeight is the direction.y value where the fog band ends: + // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) + // + // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 + // + // Torque renders the fog bands as geometry with linear vertex alpha + // interpolation. We use a squared curve (t^2) to create a gentler + // falloff at the top of the gradient, matching Tribes 2's appearance. + float baseFogFactor; + if (direction.y <= 0.0) { + // Looking at or below horizon: full fog + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + // Above fog band: no fog + baseFogFactor = 0.0; + } else { + // Within fog band: squared curve for gentler falloff at top + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + // When inside a volume, increase fog intensity + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor); + } else { + finalColor = skyColor.rgb; + } + // Convert linear result to sRGB for display + gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); + } + `,depthWrite:!1,depthTest:!1})]})}function t5({materialList:e,fogColor:t,fogState:r}){let{data:n}=eA({queryKey:["detailMapList",e],queryFn:()=>(0,ev.loadDetailMapList)(e)},ea,void 0),i=(0,f.useMemo)(()=>n?[(0,ev.textureToUrl)(n[1]),(0,ev.textureToUrl)(n[3]),(0,ev.textureToUrl)(n[4]),(0,ev.textureToUrl)(n[5]),(0,ev.textureToUrl)(n[0]),(0,ev.textureToUrl)(n[2])]:null,[n]);return i?(0,d.jsx)(t8,{skyBoxFiles:i,fogColor:t,fogState:r}):null}function t6({skyColor:e,fogColor:t,fogState:r}){let{camera:n}=(0,eB.useThree)(),i=!!t,a=(0,f.useMemo)(()=>n.projectionMatrixInverse,[n]),o=(0,f.useMemo)(()=>r?(0,eT.packFogVolumeData)(r.fogVolumes):new Float32Array(12),[r]),s=(0,f.useMemo)(()=>{if(!r)return .18;let e=.95*r.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[r]),l=(0,f.useRef)({skyColor:{value:e},fogColor:{value:t??new p.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:a},cameraMatrixWorld:{value:n.matrixWorld},cameraHeight:eT.globalFogUniforms.cameraHeight,fogVolumeData:{value:o},horizonFogHeight:{value:s}});return(0,f.useEffect)(()=>{l.current.skyColor.value=e,l.current.fogColor.value=t??new p.Color(0,0,0),l.current.enableFog.value=i,l.current.fogVolumeData.value=o,l.current.horizonFogHeight.value=s},[e,t,i,o,s]),(0,d.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,d.jsxs)("bufferGeometry",{children:[(0,d.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,d.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,d.jsx)("shaderMaterial",{uniforms:l.current,vertexShader:` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } + `,fragmentShader:` + uniform vec3 skyColor; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + // Convert linear to sRGB for display + vec3 linearToSRGB(vec3 linear) { + vec3 low = linear * 12.92; + vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; + return mix(low, high, step(vec3(0.0031308), linear)); + } + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + + vec3 finalColor; + + if (enableFog) { + // Calculate volume fog influence (same logic as SkyBoxTexture) + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + float rayInfluence; + if (direction.y >= 0.0) { + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + rayInfluence = 1.0; + } + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction + float baseFogFactor; + if (direction.y <= 0.0) { + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + baseFogFactor = 0.0; + } else { + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + finalColor = mix(skyColor, fogColor, finalFogFactor); + } else { + finalColor = skyColor; + } + + gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); + } + `,depthWrite:!1,depthTest:!1})]})}function t4(e,t){let{fogDistance:r,visibleDistance:n}=e;return[r,n]}function t7({fogState:e,enabled:t}){let{scene:r,camera:n}=(0,eB.useThree)(),i=(0,f.useRef)(null),a=(0,f.useMemo)(()=>(0,eT.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,f.useEffect)(()=>{t2||((0,eF.installCustomFogShader)(),t2=!0)},[]),(0,f.useEffect)(()=>{(0,eT.resetGlobalFogUniforms)();let[t,o]=t4(e,n.position.y),s=new p.Fog(e.fogColor,t,o);return r.fog=s,i.current=s,(0,eT.updateGlobalFogUniforms)(n.position.y,a),()=>{r.fog=null,i.current=null,(0,eT.resetGlobalFogUniforms)()}},[r,n,e,a]),(0,f.useEffect)(()=>{let r=i.current;if(r)if(t){let[t,i]=t4(e,n.position.y);r.near=t,r.far=i}else r.near=1e10,r.far=1e10},[t,e,n.position.y]),(0,eC.useFrame)(()=>{let r=i.current;if(!r)return;let o=n.position.y;if((0,eT.updateGlobalFogUniforms)(o,a,t),t){let[t,n]=t4(e,o);r.near=t,r.far=n,r.color.copy(e.fogColor)}}),null}let re=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function rt(e){return re.test(e)}let rr=(0,f.createContext)(null);function rn(){let e=(0,f.useContext)(rr);if(!e)throw Error("useShapeInfo must be used within ShapeInfoProvider");return e}function ri({children:e,object:t,shapeName:r,type:n}){let i=(0,f.useMemo)(()=>rt(r),[r]),a=(0,f.useMemo)(()=>({object:t,shapeName:r,type:n,isOrganic:i}),[t,r,n,i]);return(0,d.jsx)(rr.Provider,{value:a,children:e})}var ra=e.i(51475);let ro=new Map;function rs(e){e.onBeforeCompile=t=>{(0,eF.injectCustomFog)(t,eT.globalFogUniforms),e instanceof p.MeshLambertMaterial&&(t.uniforms.shapeDirectionalFactor={value:1},t.uniforms.shapeAmbientFactor={value:1.5},t.fragmentShader=t.fragmentShader.replace("#include ",`#include +uniform float shapeDirectionalFactor; +uniform float shapeAmbientFactor; +`),t.fragmentShader=t.fragmentShader.replace("#include ",`#include + // Apply shape-specific lighting multipliers + reflectedLight.directDiffuse *= shapeDirectionalFactor; + reflectedLight.indirectDiffuse *= shapeAmbientFactor; +`))}}function rl(e,t,r,n){let i=r.has("Translucent"),a=r.has("Additive");if(r.has("SelfIlluminating")){let e=new p.MeshBasicMaterial({map:t,side:2,transparent:a,alphaTest:.5*!a,fog:!0,...a&&{blending:p.AdditiveBlending}});return rs(e),e}if(n||i){let e={map:t,transparent:!1,alphaTest:.5,reflectivity:0},r=new p.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),n=new p.MeshLambertMaterial({...e,side:0});return rs(r),rs(n),[r,n]}let o=new p.MeshLambertMaterial({map:t,side:2,reflectivity:0});return rs(o),o}let ru=(0,f.memo)(function({material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i=!1,receiveShadow:a=!1}){let o=e.userData.resource_path,s=new Set(e.userData.flag_names??[]),l=function(e){let{animationEnabled:t}=(0,eS.useSettings)(),{data:r}=eA({queryKey:["ifl",e],queryFn:()=>(0,ev.loadImageFrameList)(e),enabled:!0,suspense:!0,throwOnError:em,placeholderData:void 0},ea,void 0),n=(0,f.useMemo)(()=>r.map(t=>(0,ev.iflTextureToUrl)(t.name,e)),[r,e]),i=(0,ex.useTexture)(n),a=(0,f.useMemo)(()=>{var t;let n,a=ro.get(e);if(!a){let t,r,n,o,s,l,u,c,d;r=(t=i[0].image).width,n=t.height,s=Math.ceil(Math.sqrt(o=i.length)),l=Math.ceil(o/s),(u=document.createElement("canvas")).width=r*s,u.height=n*l,c=u.getContext("2d"),i.forEach((e,t)=>{let i=Math.floor(t/s);c.drawImage(e.image,t%s*r,i*n)}),(d=new p.CanvasTexture(u)).colorSpace=p.SRGBColorSpace,d.generateMipmaps=!1,d.minFilter=p.NearestFilter,d.magFilter=p.NearestFilter,d.wrapS=p.ClampToEdgeWrapping,d.wrapT=p.ClampToEdgeWrapping,d.repeat.set(1/s,1/l),a={texture:d,columns:s,rows:l,frameCount:o,frameStartTicks:[],totalTicks:0,lastFrame:-1},ro.set(e,a)}return n=0,(t=a).frameStartTicks=r.map(e=>{let t=n;return n+=e.frameCount,t}),t.totalTicks=n,a},[e,i,r]);return(0,ra.useTick)(e=>{let r=t?function(e,t){if(0===e.totalTicks)return 0;let r=t%e.totalTicks,{frameStartTicks:n}=e;for(let e=n.length-1;e>=0;e--)if(r>=n[e])return e;return 0}(a,e):0;!function(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,n=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,n/e.rows)}(a,r)}),a.texture}(`textures/${o}.ifl`),u=t&&rt(t),c=(0,f.useMemo)(()=>rl(e,l,s,u),[e,l,s,u]);return Array.isArray(c)?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("mesh",{geometry:n||r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:c[0],attach:"material"})}),(0,d.jsx)("mesh",{geometry:r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:c[1],attach:"material"})})]}):(0,d.jsx)("mesh",{geometry:r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:c,attach:"material"})})}),rc=(0,f.memo)(function({material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i=!1,receiveShadow:a=!1}){let o=e.userData.resource_path,s=new Set(e.userData.flag_names??[]),l=(0,f.useMemo)(()=>(o||console.warn(`No resource_path was found on "${t}" - rendering fallback.`),o?(0,ev.textureToUrl)(o):ev.FALLBACK_TEXTURE_URL),[o,t]),u=t&&rt(t),c=s.has("Translucent"),h=(0,ex.useTexture)(l,e=>u||c?(0,eb.setupTexture)(e,{disableMipmaps:!0}):(0,eb.setupTexture)(e)),m=(0,f.useMemo)(()=>rl(e,h,s,u),[e,h,s,u]);return Array.isArray(m)?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("mesh",{geometry:n||r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:m[0],attach:"material"})}),(0,d.jsx)("mesh",{geometry:r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:m[1],attach:"material"})})]}):(0,d.jsx)("mesh",{geometry:r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:m,attach:"material"})})}),rd=(0,f.memo)(function({material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i=!1,receiveShadow:a=!1}){let o=new Set(e.userData.flag_names??[]).has("IflMaterial"),s=e.userData.resource_path;return o&&s?(0,d.jsx)(ru,{material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i,receiveShadow:a}):e.name?(0,d.jsx)(rc,{material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i,receiveShadow:a}):null});function rf({color:e,label:t}){return(0,d.jsxs)("mesh",{children:[(0,d.jsx)("boxGeometry",{args:[10,10,10]}),(0,d.jsx)("meshStandardMaterial",{color:e,wireframe:!0}),t?(0,d.jsx)(tj.FloatingLabel,{color:e,children:t}):null]})}function rh({color:e,label:t}){let{debugMode:r}=(0,eS.useDebug)();return r?(0,d.jsx)(rf,{color:e,label:t}):null}function rm({loadingColor:e="yellow",children:t}){let{object:r,shapeName:n}=rn();return n?(0,d.jsx)(eN,{fallback:(0,d.jsx)(rh,{color:"red",label:`${r._id}: ${n}`}),children:(0,d.jsxs)(f.Suspense,{fallback:(0,d.jsx)(rf,{color:e}),children:[(0,d.jsx)(rp,{}),t]})}):(0,d.jsx)(rh,{color:"orange",label:`${r._id}: `})}let rp=(0,f.memo)(function(){let{object:e,shapeName:t,isOrganic:r}=rn(),{debugMode:n}=(0,eS.useDebug)(),{nodes:i}=tU((0,ev.shapeToUrl)(t)),a=(0,f.useMemo)(()=>{let e=Object.values(i).filter(e=>e.skeleton);if(e.length>0){var t;let r;return t=e[0].skeleton,r=new Set,t.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&r.add(t)}),r}return new Set},[i]),o=(0,f.useMemo)(()=>Object.entries(i).filter(([e,t])=>t.material&&"Unassigned"!==t.material.name&&!t.name.match(/^Hulk/i)).map(([e,t])=>{let n=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,n=e.attributes.skinWeight,i=e.index,a=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(o)){a[e]=!0;break}}if(i){let t=[],r=i.array;for(let e=0;e1){let t=0,r=0,n=0;for(let i of e)t+=o[3*i],r+=o[3*i+1],n+=o[3*i+2];let i=Math.sqrt(t*t+r*r+n*n);for(let a of(i>0&&(t/=i,r/=i,n/=i),e))o[3*a]=t,o[3*a+1]=r,o[3*a+2]=n}if(t.needsUpdate=!0,r){let e=(i=n.clone()).attributes.normal,t=e.array;for(let e=0;e(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("mesh",{geometry:r,children:(0,d.jsx)("meshStandardMaterial",{color:"gray",wireframe:!0})}),children:e.material?Array.isArray(e.material)?e.material.map((e,i)=>(0,d.jsx)(rd,{material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:s,receiveShadow:s},i)):(0,d.jsx)(rd,{material:e.material,shapeName:t,geometry:r,backGeometry:n,castShadow:s,receiveShadow:s}):null},e.id)),n?(0,d.jsxs)(tj.FloatingLabel,{children:[e._id,": ",t]}):null]})});var rA=e.i(6112);let rg={1:"Storm",2:"Inferno"},rv=(0,f.createContext)(null);function rC(){let e=(0,f.useContext)(rv);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function rB({children:e}){let{camera:t}=(0,eB.useThree)(),[r,n]=(0,f.useState)(-1),[i,a]=(0,f.useState)({}),[o,s]=(0,f.useState)(()=>({initialized:!1,position:null,quarternion:null})),l=(0,f.useCallback)(e=>{a(t=>({...t,[e.id]:e}))},[]),u=(0,f.useCallback)(e=>{a(t=>{let{[e.id]:r,...n}=t;return n})},[]),c=Object.keys(i).length,h=(0,f.useCallback)(e=>{if(console.log(`[CamerasProvider] setCamera(${e})`),e>=0&&e{console.log("[CamerasProvider] nextCamera()",c,r),h(c?(r+1)%c:-1)},[c,r,h]);(0,f.useEffect)(()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,r]=e.slice(2).split("~"),n=t.split(",").map(e=>parseFloat(e)),i=r.split(",").map(e=>parseFloat(e));s({initialized:!0,position:new p.Vector3(...n),quarternion:new p.Quaternion(...i)})}else s({initialized:!0,position:null,quarternion:null})},[]),(0,f.useEffect)(()=>{o.initialized&&o.position&&(t.position.copy(o.position),o.quarternion&&t.quaternion.copy(o.quarternion))},[o]),(0,f.useEffect)(()=>{o.initialized&&!o.position&&c>0&&-1===r&&(console.log("[CamerasProvider] setCamera(0) in useEffect"),h(0))},[c,h,r]);let A=(0,f.useMemo)(()=>({registerCamera:l,unregisterCamera:u,nextCamera:m,setCameraIndex:h,cameraCount:c}),[l,u,m,h,c]);return(0,d.jsx)(rv.Provider,{value:A,children:e})}let ry=(0,f.createContext)(null),rb=ry.Provider,rx=(0,f.lazy)(()=>e.A(61921).then(e=>({default:e.AudioEmitter}))),rE={AudioEmitter:function(e){let{audioEnabled:t}=(0,eS.useSettings)();return t?(0,d.jsx)(rx,{...e}):null},Camera:function({object:e}){let{registerCamera:t,unregisterCamera:r}=rC(),n=(0,f.useId)(),i=(0,ey.getProperty)(e,"dataBlock"),a=(0,f.useMemo)(()=>(0,ey.getPosition)(e),[e]),o=(0,f.useMemo)(()=>(0,ey.getRotation)(e),[e]);return(0,f.useEffect)(()=>{if("Observer"===i){let e={id:n,position:new p.Vector3(...a),rotation:o};return t(e),()=>{r(e)}}},[n,i,t,r,a,o]),null},ForceFieldBare:(0,f.lazy)(()=>e.A(25147).then(e=>({default:e.ForceFieldBare}))),InteriorInstance:tW,Item:function({object:e}){let t=e_(),r=(0,ey.getProperty)(e,"dataBlock")??"",n=(0,rA.useDatablock)(r),i=(0,f.useMemo)(()=>(0,ey.getPosition)(e),[e]),a=(0,f.useMemo)(()=>(0,ey.getScale)(e),[e]),o=(0,f.useMemo)(()=>(0,ey.getRotation)(e),[e]),s=(0,ey.getProperty)(n,"shapeFile");s||console.error(` missing shape for datablock: ${r}`);let l=r?.toLowerCase()==="flag",u=t?.team??null,c=u&&u>0?rg[u]:null,h=l&&c?`${c} Flag`:null;return(0,d.jsx)(ri,{type:"Item",object:e,shapeName:s,children:(0,d.jsx)("group",{position:i,quaternion:o,scale:a,children:(0,d.jsx)(rm,{loadingColor:"pink",children:h?(0,d.jsx)(tj.FloatingLabel,{opacity:.6,children:h}):null})})})},SimGroup:function({object:e}){let t=e_(),r=(0,f.useMemo)(()=>{let r=null,n=!1;if(t&&t.hasTeams){if(n=!0,null!=t.team)r=t.team;else if(e._name){let t=e._name.match(/^team(\d+)$/i);t&&(r=parseInt(t[1],10))}}else e._name&&(n="teams"===e._name.toLowerCase());return{object:e,parent:t,hasTeams:n,team:r}},[e,t]);return(0,d.jsx)(eH.Provider,{value:r,children:(e._children??[]).map((e,t)=>(0,d.jsx)(rM,{object:e},e._id))})},Sky:function({object:e}){let{fogEnabled:t,highQualityFog:r}=(0,eS.useSettings)(),n=(0,ey.getProperty)(e,"materialList"),i=(0,f.useMemo)(()=>t3((0,ey.getProperty)(e,"SkySolidColor")),[e]),a=(0,ey.getInt)(e,"useSkyTextures")??1,o=(0,f.useMemo)(()=>(function(e,t=!0){let r=(0,ey.getFloat)(e,"fogDistance")??0,n=(0,ey.getFloat)(e,"visibleDistance")??1e3,i=(0,ey.getFloat)(e,"high_fogDistance"),a=(0,ey.getFloat)(e,"high_visibleDistance"),o=t&&null!=i&&i>0?i:r,s=t&&null!=a&&a>0?a:n,l=function(e){if(!e)return new p.Color(.5,.5,.5);let[t,r,n]=e.split(" ").map(e=>parseFloat(e));return new p.Color().setRGB(t,r,n).convertSRGBToLinear()}((0,ey.getProperty)(e,"fogColor")),u=[];for(let t=1;t<=3;t++){let r=function(e,t=1){if(!e)return null;let r=e.split(" ").map(e=>parseFloat(e));if(r.length<3)return null;let[n,i,a]=r;return n<=0||a<=i?null:{visibleDistance:n,minHeight:i,maxHeight:a,percentage:Math.max(0,Math.min(1,t))}}((0,ey.getProperty)(e,`fogVolume${t}`),1);r&&u.push(r)}let c=u.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:o,visibleDistance:s,fogColor:l,fogVolumes:u,fogLine:c,enabled:s>o}})(e,r),[e,r]),s=(0,f.useMemo)(()=>t3((0,ey.getProperty)(e,"fogColor")),[e]),l=i||s,u=o.enabled&&t,c=o.fogColor,{scene:h,gl:m}=(0,eB.useThree)();(0,f.useEffect)(()=>{if(u){let e=c.clone();h.background=e,m.setClearColor(e)}else if(l){let e=l[0].clone();h.background=e,m.setClearColor(e)}else h.background=null;return()=>{h.background=null}},[h,m,u,c,l]);let A=i?.[1];return(0,d.jsxs)(d.Fragment,{children:[n&&a?(0,d.jsx)(f.Suspense,{fallback:null,children:(0,d.jsx)(t5,{materialList:n,fogColor:u?c:void 0,fogState:u?o:void 0},n)}):A?(0,d.jsx)(t6,{skyColor:A,fogColor:u?c:void 0,fogState:u?o:void 0}):null,(0,d.jsx)(f.Suspense,{children:(0,d.jsx)(t9,{object:e})}),o.enabled?(0,d.jsx)(t7,{fogState:o,enabled:t}):null]})},StaticShape:function({object:e}){let t=(0,ey.getProperty)(e,"dataBlock")??"",r=(0,rA.useDatablock)(t),n=(0,f.useMemo)(()=>(0,ey.getPosition)(e),[e]),i=(0,f.useMemo)(()=>(0,ey.getRotation)(e),[e]),a=(0,f.useMemo)(()=>(0,ey.getScale)(e),[e]),o=(0,ey.getProperty)(r,"shapeFile");return o||console.error(` missing shape for datablock: ${t}`),(0,d.jsx)(ri,{type:"StaticShape",object:e,shapeName:o,children:(0,d.jsx)("group",{position:n,quaternion:i,scale:a,children:(0,d.jsx)(rm,{})})})},Sun:function({object:e}){let t=(0,f.useMemo)(()=>{let[t,r,n]=((0,ey.getProperty)(e,"direction")??"0.57735 0.57735 -0.57735").split(" ").map(e=>parseFloat(e)),i=Math.sqrt(t*t+n*n+r*r);return new p.Vector3(t/i,n/i,r/i)},[e]),r=(0,f.useMemo)(()=>new p.Vector3(-(5e3*t.x),-(5e3*t.y),-(5e3*t.z)),[t]),n=(0,f.useMemo)(()=>{let[t,r,n]=((0,ey.getProperty)(e,"color")??"0.7 0.7 0.7 1").split(" ").map(e=>parseFloat(e));return new p.Color(t,r,n)},[e]),i=(0,f.useMemo)(()=>{let[t,r,n]=((0,ey.getProperty)(e,"ambient")??"0.5 0.5 0.5 1").split(" ").map(e=>parseFloat(e));return new p.Color(t,r,n)},[e]),a=t.y<0;return(0,f.useEffect)(()=>{eE.value=a},[a]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("directionalLight",{position:r,color:n,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),(0,d.jsx)("ambientLight",{color:i,intensity:1})]})},TerrainBlock:eP,TSStatic:function({object:e}){let t=(0,ey.getProperty)(e,"shapeName"),r=(0,f.useMemo)(()=>(0,ey.getPosition)(e),[e]),n=(0,f.useMemo)(()=>(0,ey.getRotation)(e),[e]),i=(0,f.useMemo)(()=>(0,ey.getScale)(e),[e]);return t||console.error(" missing shapeName for object",e),(0,d.jsx)(ri,{type:"TSStatic",object:e,shapeName:t,children:(0,d.jsx)("group",{position:r,quaternion:n,scale:i,children:(0,d.jsx)(rm,{})})})},Turret:function({object:e}){let t=(0,ey.getProperty)(e,"dataBlock")??"",r=(0,ey.getProperty)(e,"initialBarrel"),n=(0,rA.useDatablock)(t),i=(0,rA.useDatablock)(r),a=(0,f.useMemo)(()=>(0,ey.getPosition)(e),[e]),o=(0,f.useMemo)(()=>(0,ey.getRotation)(e),[e]),s=(0,f.useMemo)(()=>(0,ey.getScale)(e),[e]),l=(0,ey.getProperty)(n,"shapeFile"),u=(0,ey.getProperty)(i,"shapeFile");return l||console.error(` missing shape for datablock: ${t}`),r&&!u&&console.error(` missing shape for barrel datablock: ${r}`),(0,d.jsx)(ri,{type:"Turret",object:e,shapeName:l,children:(0,d.jsxs)("group",{position:a,quaternion:o,scale:s,children:[(0,d.jsx)(rm,{}),u?(0,d.jsx)(ri,{type:"Turret",object:e,shapeName:u,children:(0,d.jsx)("group",{position:[0,1.5,0],children:(0,d.jsx)(rm,{})})}):null]})})},WaterBlock:(0,f.lazy)(()=>e.A(18599).then(e=>({default:e.WaterBlock}))),WayPoint:function({object:e}){let t=(0,f.useMemo)(()=>(0,ey.getPosition)(e),[e]),r=(0,ey.getProperty)(e,"name");return r?(0,d.jsx)(tj.FloatingLabel,{position:t,opacity:.6,children:r}):null}};function rM({object:e}){let{missionType:t}=(0,f.useContext)(ry),r=(0,f.useMemo)(()=>{let r=new Set(((0,ey.getProperty)(e,"missionTypesList")??"").toLowerCase().split(/s+/).filter(Boolean));return!r.size||r.has(t.toLowerCase())},[e,t]),n=rE[e._className];return r&&n?(0,d.jsx)(f.Suspense,{children:(0,d.jsx)(n,{object:e})}):null}var rS=e.i(86608),rF=e.i(38433),rT=e.i(33870),rR=e.i(91996);let rw=async e=>{let t;try{t=(0,ev.getUrlForPath)(e)}catch(t){return console.warn(`Script not in manifest: ${e} (${t})`),null}try{let r=await fetch(t);if(!r.ok)return console.error(`Script fetch failed: ${e} (${r.status})`),null;return await r.text()}catch(t){return console.error(`Script fetch error: ${e}`),console.error(t),null}},rD=(0,rT.createScriptCache)(),rI={findFiles:e=>{let t=(0,eg.default)(e,{nocase:!0});return(0,rR.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,rR.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,rR.getResourceMap)()[(0,rR.getResourceKey)(e)]},rG=(0,f.memo)(function({name:e,missionType:t,onLoadingChange:r}){let{data:n}=eA({queryKey:["parsedMission",e],queryFn:()=>(0,ev.loadMission)(e)},ea,void 0),{missionGroup:i,runtime:a,progress:o}=function(e,t,r){let[n,i]=(0,f.useState)({missionGroup:void 0,runtime:void 0,progress:0});return(0,f.useEffect)(()=>{if(!r)return;let n=new AbortController,a=(0,rF.createProgressTracker)(),o=()=>{i(e=>({...e,progress:a.progress}))};a.on("update",o);let{runtime:s}=(0,rS.runServer)({missionName:e,missionType:t,runtimeOptions:{loadScript:rw,fileSystem:rI,cache:rD,signal:n.signal,progress:a,ignoreScripts:["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]},onMissionLoadDone:()=>{i({missionGroup:s.getObjectByName("MissionGroup"),runtime:s,progress:1})}});return()=>{a.off("update",o),n.abort(),s.destroy()}},[e,r]),n}(e,t,n),s=!n||!i||!a,l=(0,f.useMemo)(()=>({metadata:n,missionType:t,missionGroup:i}),[n,t,i]);return((0,f.useEffect)(()=>{r?.(s,o)},[s,o,r]),s)?null:(0,d.jsx)(rb,{value:l,children:(0,d.jsx)(eG.RuntimeProvider,{runtime:a,children:(0,d.jsx)(rM,{object:i})})})});var rL=class extends b{constructor(e={}){super(),this.config=e,this.#_=new Map}#_;build(e,t,r){let n=t.queryKey,i=t.queryHash??G(n,t),a=this.get(i);return a||(a=new et({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}add(e){this.#_.has(e.queryHash)||(this.#_.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#_.get(e.queryHash);t&&(e.destroy(),t===e&&this.#_.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){q.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#_.get(e)}getAll(){return[...this.#_.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>D(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>D(e,t)):t}notify(e){q.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){q.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){q.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rO=class extends ee{#c;#k;#U;#d;constructor(e){super(),this.#c=e.client,this.mutationId=e.mutationId,this.#U=e.mutationCache,this.#k=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#k.includes(e)||(this.#k.push(e),this.clearGcTimeout(),this.#U.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#k=this.#k.filter(t=>t!==e),this.scheduleGc(),this.#U.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#k.length||("pending"===this.state.status?this.scheduleGc():this.#U.remove(this))}continue(){return this.#d?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#m({type:"continue"})},r={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#d=$({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#U.canRun(this)});let n="pending"===this.state.status,i=!this.#d.canStart();try{if(n)t();else{this.#m({type:"pending",variables:e,isPaused:i}),await this.#U.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#m({type:"pending",context:t,variables:e,isPaused:i})}let a=await this.#d.start();return await this.#U.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#U.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#m({type:"success",data:a}),a}catch(t){try{throw await this.#U.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#U.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#m({type:"error",error:t})}}finally{this.#U.runNext(this)}}#m(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),q.batch(()=>{this.#k.forEach(t=>{t.onMutationUpdate(e)}),this.#U.notify({mutation:this,type:"updated",action:e})})}},rP=class extends b{constructor(e={}){super(),this.config=e,this.#j=new Set,this.#N=new Map,this.#J=0}#j;#N;#J;build(e,t,r){let n=new rO({client:e,mutationCache:this,mutationId:++this.#J,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#j.add(e);let t=rH(e);if("string"==typeof t){let r=this.#N.get(t);r?r.push(e):this.#N.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#j.delete(e)){let t=rH(e);if("string"==typeof t){let r=this.#N.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#N.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=rH(e);if("string"!=typeof t)return!0;{let r=this.#N.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=rH(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#N.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){q.batch(()=>{this.#j.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#j.clear(),this.#N.clear()})}getAll(){return Array.from(this.#j)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>I(t,e))}findAll(e={}){return this.getAll().filter(t=>I(e,t))}notify(e){q.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return q.batch(()=>Promise.all(e.map(e=>e.continue().catch(S))))}};function rH(e){return e.options.scope?.id}function r_(e){return{onFetch:(t,r)=>{let n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},l=0,u=async()=>{let r=!1,u=Q(t.options,t.fetchOptions),c=async(e,n,i)=>{let a;if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);let o=(Object.defineProperty(a={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta},"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),a),s=await u(o),{maxPages:l}=t.options,c=i?J:N;return{pages:c(e.pages,s,l),pageParams:c(e.pageParams,n,l)}};if(i&&a.length){let e="backward"===i,t={pages:a,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:rk)(n,t);s=await c(t,r,e)}else{let t=e??a.length;do{let e=0===l?o[0]??n.initialPageParam:rk(n,s);if(l>0&&null==e)break;s=await c(s,e),l++}while(lt.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function rk(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var rU=class{#K;#U;#f;#Q;#V;#q;#X;#W;constructor(e={}){this.#K=e.queryCache||new rL,this.#U=e.mutationCache||new rP,this.#f=e.defaultOptions||{},this.#Q=new Map,this.#V=new Map,this.#q=0}mount(){this.#q++,1===this.#q&&(this.#X=V.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#K.onFocus())}),this.#W=X.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#K.onOnline())}))}unmount(){this.#q--,0===this.#q&&(this.#X?.(),this.#X=void 0,this.#W?.(),this.#W=void 0)}isFetching(e){return this.#K.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#U.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#K.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#K.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(R(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#K.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=this.#K.get(n.queryHash),a=i?.state.data,o="function"==typeof t?t(a):t;if(void 0!==o)return this.#K.build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return q.batch(()=>this.#K.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#K.get(t.queryHash)?.state}removeQueries(e){let t=this.#K;q.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#K;return q.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(q.batch(()=>this.#K.findAll(e).map(e=>e.cancel(r)))).then(S).catch(S)}invalidateQueries(e,t={}){return q.batch(()=>(this.#K.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(q.batch(()=>this.#K.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(S)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(S)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#K.build(this,t);return r.isStaleByTime(R(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(S).catch(S)}fetchInfiniteQuery(e){return e.behavior=r_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(S).catch(S)}ensureInfiniteQueryData(e){return e.behavior=r_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return X.isOnline()?this.#U.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#K}getMutationCache(){return this.#U}getDefaultOptions(){return this.#f}setDefaultOptions(e){this.#f=e}setQueryDefaults(e,t){this.#Q.set(L(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#Q.values()],r={};return t.forEach(t=>{O(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#V.set(L(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#V.values()],r={};return t.forEach(t=>{O(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#f.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=G(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===K&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#f.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#K.clear(),this.#U.clear()}},rj=e.i(8155);let rN=e=>{let t=(0,rj.createStore)(e),r=e=>(function(e,t=e=>e){let r=f.default.useSyncExternalStore(e.subscribe,f.default.useCallback(()=>t(e.getState()),[e,t]),f.default.useCallback(()=>t(e.getInitialState()),[e,t]));return f.default.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},rJ=f.createContext(null);function rK({map:e,children:t,onChange:r,domElement:n}){let i=e.map(e=>e.name+e.keys).join("-"),a=f.useMemo(()=>{let t,r;return t=()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{}),(r=(e,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let a=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,o=e(n.getState());a=r=>{let n=e(r);if(!i(o,n)){let e=o;t(o=n,e)}},(null==r?void 0:r.fireImmediately)&&t(o,o)}return i(a)},t(e,r,n)})?rN(r):rN},[i]),o=f.useMemo(()=>[a.subscribe,a.getState,a],[i]),s=a.setState;return f.useEffect(()=>{let t=e.map(({name:e,keys:t,up:n})=>({keys:t,up:n,fn:t=>{s({[e]:t}),r&&r(e,t,o[1]())}})).reduce((e,{keys:t,fn:r,up:n=!0})=>(t.forEach(t=>e[t]={fn:r,pressed:!1,up:n}),e),{}),i=({key:e,code:r})=>{let n=t[e]||t[r];if(!n)return;let{fn:i,pressed:a,up:o}=n;n.pressed=!0,(o||!a)&&i(!0)},a=({key:e,code:r})=>{let n=t[e]||t[r];if(!n)return;let{fn:i,up:a}=n;n.pressed=!1,a&&i(!1)},l=n||window;return l.addEventListener("keydown",i,{passive:!0}),l.addEventListener("keyup",a,{passive:!0}),()=>{l.removeEventListener("keydown",i),l.removeEventListener("keyup",a)}},[n,i]),f.createElement(rJ.Provider,{value:o,children:t})}var rQ=Object.defineProperty;class rV{constructor(){((e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?rQ(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,n=r.length;t{let n;return(n="symbol"!=typeof t?t+"":t)in e?rq(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,r};let rW=new p.Euler(0,0,0,"YXZ"),rY=new p.Vector3,rz={type:"change"},rZ={type:"lock"},r$={type:"unlock"},r0=Math.PI/2;class r1 extends rV{constructor(e,t){super(),rX(this,"camera"),rX(this,"domElement"),rX(this,"isLocked"),rX(this,"minPolarAngle"),rX(this,"maxPolarAngle"),rX(this,"pointerSpeed"),rX(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(rW.setFromQuaternion(this.camera.quaternion),rW.y-=.002*e.movementX*this.pointerSpeed,rW.x-=.002*e.movementY*this.pointerSpeed,rW.x=Math.max(r0-this.maxPolarAngle,Math.min(r0-this.minPolarAngle,rW.x)),this.camera.quaternion.setFromEuler(rW),this.dispatchEvent(rz))}),rX(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(rZ),this.isLocked=!0):(this.dispatchEvent(r$),this.isLocked=!1))}),rX(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),rX(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),rX(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),rX(this,"dispose",()=>{this.disconnect()}),rX(this,"getObject",()=>this.camera),rX(this,"direction",new p.Vector3(0,0,-1)),rX(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),rX(this,"moveForward",e=>{rY.setFromMatrixColumn(this.camera.matrix,0),rY.crossVectors(this.camera.up,rY),this.camera.position.addScaledVector(rY,e)}),rX(this,"moveRight",e=>{rY.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(rY,e)}),rX(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),rX(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}var r9=((c=r9||{}).forward="forward",c.backward="backward",c.left="left",c.right="right",c.up="up",c.down="down",c.camera1="camera1",c.camera2="camera2",c.camera3="camera3",c.camera4="camera4",c.camera5="camera5",c.camera6="camera6",c.camera7="camera7",c.camera8="camera8",c.camera9="camera9",c);function r2(){let{speedMultiplier:e,setSpeedMultiplier:t}=(0,eS.useControls)(),[r,n]=function(e){let[t,r,n]=f.useContext(rJ);return[t,r]}(),{camera:i,gl:a}=(0,eB.useThree)(),{nextCamera:o,setCameraIndex:s,cameraCount:l}=rC(),u=(0,f.useRef)(null),c=(0,f.useRef)(new p.Vector3),d=(0,f.useRef)(new p.Vector3),h=(0,f.useRef)(new p.Vector3);return(0,f.useEffect)(()=>{let e=new r1(i,a.domElement);return u.current=e,()=>{e.dispose()}},[i,a.domElement]),(0,f.useEffect)(()=>{let e=e=>{let t=u.current;!t||t.isLocked?o():e.target===a.domElement&&t.lock()};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[o]),(0,f.useEffect)(()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return r(t=>{for(let r=0;r{let e=e=>{e.preventDefault();let r=e.deltaY>0?-1:1,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*r;t(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},r=a.domElement;return r.addEventListener("wheel",e,{passive:!1}),()=>{r.removeEventListener("wheel",e)}},[a]),(0,eC.useFrame)((t,r)=>{let{forward:a,backward:o,left:s,right:l,up:u,down:f}=n();(a||o||s||l||u||f)&&(i.getWorldDirection(c.current),c.current.normalize(),d.current.crossVectors(i.up,c.current).normalize(),h.current.set(0,0,0),a&&h.current.add(c.current),o&&h.current.sub(c.current),s&&h.current.add(d.current),l&&h.current.sub(d.current),u&&(h.current.y+=1),f&&(h.current.y-=1),h.current.lengthSq()>0&&(h.current.normalize().multiplyScalar(80*e*r),i.position.add(h.current)))}),null}let r3=[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}];function r8(){return(0,f.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",e,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",e,{capture:!0})}},[]),(0,d.jsx)(rK,{map:r3,children:(0,d.jsx)(r2,{})})}var r5="undefined"!=typeof window&&!!(null==(u=window.document)?void 0:u.createElement);function r6(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function r4(e){return e?"self"in e?e.self:r6(e).defaultView||window:self}function r7(e,t=!1){let{activeElement:r}=r6(e);if(!(null==r?void 0:r.nodeName))return null;if(nt(r)&&r.contentDocument)return r7(r.contentDocument.body,t);if(t){let e=r.getAttribute("aria-activedescendant");if(e){let t=r6(r).getElementById(e);if(t)return t}}return r}function ne(e,t){return e===t||e.contains(t)}function nt(e){return"IFRAME"===e.tagName}function nr(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==nn.indexOf(e.type)}var nn=["button","color","file","image","reset","submit"];function ni(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function na(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function no(e){return e.isContentEditable||na(e)}function ns(e){let t=0,r=0;if(na(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let n=r6(e).getSelection();if((null==n?void 0:n.rangeCount)&&n.anchorNode&&ne(e,n.anchorNode)&&n.focusNode&&ne(e,n.focusNode)){let i=n.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(e),a.setEnd(i.startContainer,i.startOffset),t=a.toString().length,a.setEnd(i.endContainer,i.endOffset),r=a.toString().length}}return{start:t,end:r}}function nl(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function nu(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return nu(e.parentElement)||document.scrollingElement||document.body}function nc(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function nd(e,t){return t&&e.item(t)||null}var nf=Symbol("FOCUS_SILENTLY");function nh(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function nm(){}function np(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function nA(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function ng(e){return e}function nv(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function nC(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function nB(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function ny(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function nb(...e){for(let t of e)if(void 0!==t)return t}function nx(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function nE(){return r5&&!!navigator.maxTouchPoints}function nM(){return!!r5&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function nS(){return r5&&nM()&&/apple/i.test(navigator.vendor)}function nF(e){return!!(e.currentTarget&&!ne(e.currentTarget,e.target))}function nT(e){return e.target===e.currentTarget}function nR(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function nw(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function nD(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!ne(r,n)}function nI(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),r()}),a=()=>{i(),r()};return e.addEventListener(t,a,{once:!0,capture:!0}),i}function nG(e,t,r,n=window){let i=[];try{for(let a of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(nG(e,t,r,a))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var nL={...f},nO=nL.useId;nL.useDeferredValue;var nP=nL.useInsertionEffect,nH=r5?f.useLayoutEffect:f.useEffect;function n_(e){let t=(0,f.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return nP?nP(()=>{t.current=e}):t.current=e,(0,f.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function nk(...e){return(0,f.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)nx(r,t)}},e)}function nU(e){if(nO){let t=nO();return e||t}let[t,r]=(0,f.useState)(e);return nH(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function nj(e,t){let r=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,f.useEffect)(()=>()=>{r.current=!1},[])}function nN(){return(0,f.useReducer)(()=>[],[])}function nJ(e){return n_("function"==typeof e?e:()=>e)}function nK(e,t,r=[]){let n=(0,f.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function nQ(e=!1,t){let[r,n]=(0,f.useState)(null);return{portalRef:nk(n,t),portalNode:r,domReady:!e||r}}var nV=!1,nq=!1,nX=0,nW=0;function nY(e){let t,r;t=e.movementX||e.screenX-nX,r=e.movementY||e.screenY-nW,nX=e.screenX,nW=e.screenY,(t||r||0)&&(nq=!0)}function nz(){nq=!1}function nZ(e){let t=f.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function n$(e,t){return f.memo(e,t)}function n0(e,t){let r,{wrapElement:n,render:i,...a}=t,o=nk(t.ref,i&&(0,f.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(f.isValidElement(i)){let e={...i.props,ref:o};r=f.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!np(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(a,e))}else r=i?i(a):(0,d.jsx)(e,{...a});return n?n(r):r}function n1(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function n9(e=[],t=[]){let r=f.createContext(void 0),n=f.createContext(void 0),i=()=>f.useContext(r),a=t=>e.reduceRight((e,r)=>(0,d.jsx)(r,{...t,children:e}),(0,d.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=f.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=f.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:a,ScopedContextProvider:e=>(0,d.jsx)(a,{...e,children:t.reduceRight((t,r)=>(0,d.jsx)(r,{...e,children:t}),(0,d.jsx)(n.Provider,{...e}))})}}var n2=n9(),n3=n2.useContext;n2.useScopedContext,n2.useProviderContext;var n8=n9([n2.ContextProvider],[n2.ScopedContextProvider]),n5=n8.useContext;n8.useScopedContext;var n6=n8.useProviderContext,n4=n8.ContextProvider,n7=n8.ScopedContextProvider,ie=(0,f.createContext)(void 0),it=(0,f.createContext)(void 0),ir=(0,f.createContext)(!0),ii="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ia(e){return!(!e.matches(ii)||!ni(e)||e.closest("[inert]"))}function io(e){if(!ia(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=r7(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function is(e,t){let r=Array.from(e.querySelectorAll(ii));t&&r.unshift(e);let n=r.filter(ia);return n.forEach((e,t)=>{if(nt(e)&&e.contentDocument){let r=e.contentDocument.body;n.splice(t,1,...is(r))}}),n}function il(e,t,r){let n=Array.from(e.querySelectorAll(ii)),i=n.filter(io);return(t&&io(e)&&i.unshift(e),i.forEach((e,t)=>{if(nt(e)&&e.contentDocument){let n=il(e.contentDocument.body,!1,r);i.splice(t,1,...n)}}),!i.length&&r)?n:i}function iu(e,t){var r;let n,i,a,o;return r=document.body,n=r7(r),a=(i=is(r,!1)).indexOf(n),(o=i.slice(a+1)).find(io)||(e?i.find(io):null)||(t?o[0]:null)||null}function ic(e,t){var r;let n,i,a,o;return r=document.body,n=r7(r),a=(i=is(r,!1).reverse()).indexOf(n),(o=i.slice(a+1)).find(io)||(e?i.find(io):null)||(t?o[0]:null)||null}function id(e){let t=r7(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function ih(e){let t=r7(e);if(!t)return!1;if(ne(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function im(e){!ih(e)&&ia(e)&&e.focus()}var ip=nS(),iA=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],ig=Symbol("safariFocusAncestor");function iv(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function iC(e,t){return n_(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var iB=!1,iy=!0;function ib(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(iy=!1)}function ix(e){e.metaKey||e.ctrlKey||e.altKey||(iy=!0)}var iE=n1(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var a,o,s,l,u;let c=(0,f.useRef)(null);(0,f.useEffect)(()=>{!e||iB||(nG("mousedown",ib,!0),nG("keydown",ix,!0),iB=!0)},[e]),ip&&(0,f.useEffect)(()=>{if(!e)return;let t=c.current;if(!t||!iv(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&nB(i),h=!!d&&!t,[m,p]=(0,f.useState)(!1);(0,f.useEffect)(()=>{e&&h&&m&&p(!1)},[e,h,m]),(0,f.useEffect)(()=>{if(!e||!m)return;let t=c.current;if(!t||"undefined"==typeof IntersectionObserver)return;let r=new IntersectionObserver(()=>{ia(t)||p(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let A=iC(i.onKeyPressCapture,d),g=iC(i.onMouseDownCapture,d),v=iC(i.onClickCapture,d),C=i.onMouseDown,B=n_(t=>{if(null==C||C(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!ip||nF(t)||!nr(r)&&!iv(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let a=function(e){for(;e&&!ia(e);)e=e.closest(ii);return e||null}(r.parentElement);a&&(a[ig]=!0),nI(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),a&&(a[ig]=!1),n||im(r)})}),y=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&id(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",p(!0)))},b=i.onKeyDownCapture,x=n_(t=>{if(null==b||b(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!nT(t))return;let r=t.currentTarget;nI(r,"focusout",()=>y(t,r))}),E=i.onFocusCapture,M=n_(t=>{if(null==E||E(t),t.defaultPrevented||!e)return;if(!nT(t))return void p(!1);let r=t.currentTarget;iy||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:iA.includes(n))}(t.target)?nI(t.target,"focusout",()=>y(t,r)):p(!1)}),S=i.onBlur,F=n_(t=>{null==S||S(t),!e||nD(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),p(!1))}),T=(0,f.useContext)(ir),R=n_(t=>{e&&r&&t&&T&&queueMicrotask(()=>{id(t)||ia(t)&&t.focus()})}),w=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,f.useState)(()=>r(void 0));return nH(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(c),D=e&&(!w||"button"===w||"summary"===w||"input"===w||"select"===w||"textarea"===w||"a"===w),I=e&&(!w||"button"===w||"input"===w||"select"===w||"textarea"===w),G=i.style,L=(0,f.useMemo)(()=>h?{pointerEvents:"none",...G}:G,[h,G]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:nk(c,R,i.ref),style:L,tabIndex:(a=e,o=h,s=D,l=I,u=i.tabIndex,a?o?s&&!l?-1:void 0:s?u:u||0:u),disabled:!!I&&!!h||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:A,onClickCapture:v,onMouseDownCapture:g,onMouseDown:B,onKeyDownCapture:x,onFocusCapture:M,onBlur:F},ny(i)});function iM(e){let t=[];for(let r of e)t.push(...r);return t}function iS(e){return e.slice().reverse()}function iF(e,t,r){return n_(n=>{var i;let a,o;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!nT(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(a=n.target)||na(a))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let s=e.getState(),l=null==(i=nd(e,s.activeId))?void 0:i.element;if(!l)return;let{view:u,...c}=n;l!==(null==r?void 0:r.current)&&l.focus(),o=new KeyboardEvent(n.type,c),l.dispatchEvent(o)||n.preventDefault(),n.currentTarget.contains(l)&&n.stopPropagation()})}nZ(function(e){return n0("div",iE(e))});var iT=n1(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=n6();nv(e=e||a,!1);let o=(0,f.useRef)(null),s=(0,f.useRef)(null),l=function(e){let[t,r]=(0,f.useState)(!1),n=(0,f.useCallback)(()=>r(!0),[]),i=e.useState(t=>nd(e,t.activeId));return(0,f.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),u=e.useState("moves"),[,c]=function(e){let[t,r]=(0,f.useState)(null);return nH(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,f.useEffect)(()=>{var n;if(!e||!u||!t||!r)return;let{activeId:i}=e.getState(),a=null==(n=nd(e,i))?void 0:n.element;a&&("scrollIntoView"in a?(a.focus({preventScroll:!0}),a.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):a.focus())},[e,u,t,r]),nH(()=>{if(!e||!u||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=s.current;s.current=null,i&&nR(i,{relatedTarget:r}),id(r)||r.focus()},[e,u,t]);let h=e.useState("activeId"),m=e.useState("virtualFocus");nH(()=>{var r;if(!e||!t||!m)return;let n=s.current;if(s.current=null,!n)return;let i=(null==(r=nd(e,h))?void 0:r.element)||r7(n);i!==n&&nR(n,{relatedTarget:i})},[e,h,m,t]);let p=iF(e,i.onKeyDownCapture,s),A=iF(e,i.onKeyUpCapture,s),g=i.onFocusCapture,v=n_(t=>{var r;let n;if(null==g||g(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let a=t.relatedTarget,o=(n=(r=t.currentTarget)[nf],delete r[nf],n);nT(t)&&o&&(t.stopPropagation(),s.current=a)}),C=i.onFocus,B=n_(r=>{if(null==C||C(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?nT(r)&&!nh(e,n)&&queueMicrotask(l):nT(r)&&e.setActiveId(null)}),y=i.onBlurCapture,b=n_(t=>{var r;if(null==y||y(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let a=null==(r=nd(e,i))?void 0:r.element,o=t.relatedTarget,l=nh(e,o),u=s.current;s.current=null,nT(t)&&l?(o===a?u&&u!==o&&nR(u,t):a?nR(a,t):u&&nR(u,t),t.stopPropagation()):!nh(e,t.target)&&a&&nR(a,t)}),x=i.onKeyDown,E=nJ(n),M=n_(t=>{var r;if(null==x||x(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!nT(t))return;let{orientation:n,renderedItems:i,activeId:a}=e.getState(),o=nd(e,a);if(null==(r=null==o?void 0:o.element)?void 0:r.isConnected)return;let s="horizontal"!==n,l="vertical"!==n,u=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&na(t.currentTarget))return;let c={ArrowUp:(u||s)&&(()=>{if(u){let e=iM(iS(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(u||l)&&e.first,ArrowDown:(u||s)&&e.first,ArrowLeft:(u||l)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!E(t))return;t.preventDefault(),e.move(r)}}});return i=nK(i,t=>(0,d.jsx)(n4,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=nd(e,r.activeId))?void 0:n.id}),...i,ref:nk(o,c,i.ref),onKeyDownCapture:p,onKeyUpCapture:A,onFocusCapture:v,onFocus:B,onBlurCapture:b,onKeyDown:M},i=iE({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});nZ(function(e){return n0("div",iT(e))});var iR=n9();iR.useContext,iR.useScopedContext;var iw=iR.useProviderContext,iD=n9([iR.ContextProvider],[iR.ScopedContextProvider]);iD.useContext,iD.useScopedContext;var iI=iD.useProviderContext,iG=iD.ContextProvider,iL=iD.ScopedContextProvider,iO=(0,f.createContext)(void 0),iP=(0,f.createContext)(void 0),iH=n9([iG],[iL]);iH.useContext,iH.useScopedContext;var i_=iH.useProviderContext,ik=iH.ContextProvider,iU=iH.ScopedContextProvider,ij=n1(function({store:e,...t}){let r=i_();return e=e||r,t={...t,ref:nk(null==e?void 0:e.setAnchorElement,t.ref)}});nZ(function(e){return n0("div",ij(e))});var iN=(0,f.createContext)(void 0),iJ=n9([ik,n4],[iU,n7]),iK=iJ.useContext,iQ=iJ.useScopedContext,iV=iJ.useProviderContext,iq=iJ.ContextProvider,iX=iJ.ScopedContextProvider,iW=(0,f.createContext)(void 0),iY=(0,f.createContext)(!1);function iz(e,t){let r=e.__unstableInternals;return nv(r,"Invalid store"),r[t]}function iZ(e,...t){let r=e,n=r,i=Symbol(),a=nm,o=new Set,s=new Set,l=new Set,u=new Set,c=new Set,d=new WeakMap,f=new WeakMap,h=(e,t,r=u)=>(r.add(t),f.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),f.delete(t),r.delete(t)}),m=(e,a,o=!1)=>{var l,h;if(!np(r,e))return;let m=(h=r[e],"function"==typeof a?a("function"==typeof h?h():h):a);if(m===r[e])return;if(!o)for(let r of t)null==(l=null==r?void 0:r.setState)||l.call(r,e,m);let p=r;r={...r,[e]:m};let A=Symbol();i=A,s.add(e);let g=(t,n,i)=>{var a;let o=f.get(t);(!o||o.some(t=>i?i.has(t):t===e))&&(null==(a=d.get(t))||a(),d.set(t,t(r,n)))};for(let e of u)g(e,p);queueMicrotask(()=>{if(i!==A)return;let e=r;for(let e of c)g(e,n,s);n=e,s.clear()})},p={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{let e=o.size,n=Symbol();o.add(n);let i=()=>{o.delete(n),o.size||a()};if(e)return i;let s=Object.keys(r).map(e=>nA(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&np(n,e))return i9(t,[e],t=>{m(e,t[e],!0)})}))),u=[];for(let e of l)u.push(e());return a=nA(...s,...u,...t.map(i0)),i},subscribe:(e,t)=>h(e,t),sync:(e,t)=>(d.set(t,t(r,r)),h(e,t)),batch:(e,t)=>(d.set(t,t(r,n)),h(e,t,c)),pick:e=>iZ(function(e,t){let r={};for(let n of t)np(e,n)&&(r[n]=e[n]);return r}(r,e),p),omit:e=>iZ(function(e,t){let r={...e};for(let e of t)np(r,e)&&delete r[e];return r}(r,e),p)}};return p}function i$(e,...t){if(e)return iz(e,"setup")(...t)}function i0(e,...t){if(e)return iz(e,"init")(...t)}function i1(e,...t){if(e)return iz(e,"subscribe")(...t)}function i9(e,...t){if(e)return iz(e,"sync")(...t)}function i2(e,...t){if(e)return iz(e,"batch")(...t)}function i3(e,...t){if(e)return iz(e,"omit")(...t)}function i8(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=iZ(r,...e);return Object.assign({},...e,n)}function i5(e,t){}function i6(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function i4(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var i7=n1(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:a=0,showOnChange:o,showOnMouseDown:s,showOnClick:l=s,showOnKeyDown:u,showOnKeyPress:c=u,blurActiveItemOnClick:d,setValueOnClick:h=!0,moveOnKeyPress:m=!0,autoComplete:p="list",...A}){var g;let v,C=iV();nv(e=e||C,!1);let B=(0,f.useRef)(null),[y,b]=nN(),x=(0,f.useRef)(!1),E=(0,f.useRef)(!1),M=e.useState(e=>e.virtualFocus&&r),S="inline"===p||"both"===p,[F,T]=(0,f.useState)(S);g=[S],v=(0,f.useRef)(!1),nH(()=>{if(v.current)return(()=>{S&&T(!0)})();v.current=!0},g),nH(()=>()=>{v.current=!1},[]);let R=e.useState("value"),w=(0,f.useRef)();(0,f.useEffect)(()=>i9(e,["selectedValue","activeId"],(e,t)=>{w.current=t.selectedValue}),[]);let D=e.useState(e=>{var t;if(S&&F){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=w.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),I=e.useState("renderedItems"),G=e.useState("open"),L=e.useState("contentElement"),O=(0,f.useMemo)(()=>{if(!S||!F)return R;if(i6(I,D,M)){if(i4(R,D)){let e=(null==D?void 0:D.slice(R.length))||"";return R+e}return R}return D||R},[S,F,I,D,M,R]);(0,f.useEffect)(()=>{let e=B.current;if(!e)return;let t=()=>T(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,f.useEffect)(()=>{if(!S||!F||!D||!i6(I,D,M)||!i4(R,D))return;let e=nm;return queueMicrotask(()=>{let t=B.current;if(!t)return;let{start:r,end:n}=ns(t),i=R.length,a=D.length;nc(t,i,a),e=()=>{if(!id(t))return;let{start:e,end:o}=ns(t);e!==i||o===a&&nc(t,r,n)}}),()=>e()},[y,S,F,D,I,M,R]);let P=(0,f.useRef)(null),H=n_(n),_=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(!G||!L)return;let t=nu(L);if(!t)return;P.current=t;let r=()=>{x.current=!1},n=()=>{if(!e||!x.current)return;let{activeId:t}=e.getState();null===t||t!==_.current&&(x.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[G,L,e]),nH(()=>{!R||E.current||(x.current=!0)},[R]),nH(()=>{"always"!==M&&G||(x.current=G)},[M,G]);let k=e.useState("resetValueOnSelect");nj(()=>{var t,r;let n=x.current;if(!e||!G||!n&&!k)return;let{baseElement:i,contentElement:a,activeId:o}=e.getState();if(!i||id(i)){if(null==a?void 0:a.hasAttribute("data-placing")){let e=new MutationObserver(b);return e.observe(a,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(M&&n){let r,n=H(I),i=void 0!==n?n:null!=(t=null==(r=I.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();_.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(o||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,G,y,R,M,k,H,I]),(0,f.useEffect)(()=>{if(!S)return;let t=B.current;if(!t)return;let r=[t,L].filter(e=>!!e),n=t=>{r.every(e=>nD(t,e))&&(null==e||e.setValue(O))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[S,L,e,O]);let U=e=>e.currentTarget.value.length>=a,j=A.onChange,N=nJ(null!=o?o:U),J=nJ(null!=i?i:!e.tag),K=n_(t=>{if(null==j||j(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:a}=r,o=t.nativeEvent;if(x.current=!0,"input"===o.type&&(o.isComposing&&(x.current=!1,E.current=!0),S)){let e="insertText"===o.inputType||"insertCompositionText"===o.inputType,t=i===n.length;T(e&&t)}if(J(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{nc(r,i,a)}),S&&M&&t&&b()}N(t)&&e.show(),M&&x.current||e.setActiveId(null)}),Q=A.onCompositionEnd,V=n_(e=>{x.current=!0,E.current=!1,null==Q||Q(e),e.defaultPrevented||M&&b()}),q=A.onMouseDown,X=nJ(null!=d?d:()=>!!(null==e?void 0:e.getState().includesBaseElement)),W=nJ(h),Y=nJ(null!=l?l:U),z=n_(t=>{null==q||q(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(X(t)&&e.setActiveId(null),W(t)&&e.setValue(O),Y(t)&&nI(t.currentTarget,"mouseup",e.show))}),Z=A.onKeyDown,$=nJ(null!=c?c:U),ee=n_(t=>{if(null==Z||Z(t),t.repeat||(x.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&$(t)&&(t.preventDefault(),e.show())}),et=A.onBlur,er=n_(e=>{if(x.current=!1,null==et||et(e),e.defaultPrevented)return}),en=nU(A.id),ei=e.useState(e=>null===e.activeId);return A={id:en,role:"combobox","aria-autocomplete":"inline"===p||"list"===p||"both"===p||"none"===p?p:void 0,"aria-haspopup":nl(L,"listbox"),"aria-expanded":G,"aria-controls":null==L?void 0:L.id,"data-active-item":ei||void 0,value:O,...A,ref:nk(B,A.ref),onChange:K,onCompositionEnd:V,onMouseDown:z,onKeyDown:ee,onBlur:er},A=iT({store:e,focusable:t,...A,moveOnKeyPress:e=>!nC(m,e)&&(S&&T(!0),!0)}),{autoComplete:"off",...A=ij({store:e,...A})}}),ae=nZ(function(e){return n0("input",i7(e))});function at(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var ar=Symbol("composite-hover"),an=n1(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=n5();nv(e=e||i,!1);let a=((0,f.useEffect)(()=>{nV||(nG("mousemove",nY,!0),nG("mousedown",nz,!0),nG("mouseup",nz,!0),nG("keydown",nz,!0),nG("scroll",nz,!0),nV=!0)},[]),n_(()=>nq)),o=n.onMouseMove,s=nJ(t),l=n_(t=>{if((null==o||o(t),!t.defaultPrevented&&a())&&s(t)){if(!ih(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!id(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),u=n.onMouseLeave,c=nJ(r),d=n_(t=>{var r;let n;null==u||u(t),!t.defaultPrevented&&a()&&((n=at(t))&&ne(t.currentTarget,n)||function(e){let t=at(e);if(!t)return!1;do{if(np(t,ar)&&t[ar])return!0;t=t.parentElement}while(t)return!1}(t)||!s(t)||c(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),h=(0,f.useCallback)(e=>{e&&(e[ar]=!0)},[]);return ny(n={...n,ref:nk(h,n.ref),onMouseMove:l,onMouseLeave:d})});n$(nZ(function(e){return n0("div",an(e))}));var ai=n1(function({store:e,shouldRegisterItem:t=!0,getItem:r=ng,element:n,...i}){let a=n3();e=e||a;let o=nU(i.id),s=(0,f.useRef)(n);return(0,f.useEffect)(()=>{let n=s.current;if(!o||!n||!t)return;let i=r({id:o,element:n});return null==e?void 0:e.renderItem(i)},[o,t,r,e]),ny(i={...i,ref:nk(s,i.ref)})});function aa(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?nr(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(nr(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}nZ(function(e){return n0("div",ai(e))});var ao=Symbol("command"),as=n1(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...r}){let n,i,a=(0,f.useRef)(null),[o,s]=(0,f.useState)(!1);(0,f.useEffect)(()=>{a.current&&s(nr(a.current))},[]);let[l,u]=(0,f.useState)(!1),c=(0,f.useRef)(!1),d=nB(r),[h,m]=(n=r.onLoadedMetadataCapture,i=(0,f.useMemo)(()=>Object.assign(()=>{},{...n,[ao]:!0}),[n,ao,!0]),[null==n?void 0:n[ao],{onLoadedMetadataCapture:i}]),p=r.onKeyDown,A=n_(r=>{null==p||p(r);let n=r.currentTarget;if(r.defaultPrevented||h||d||!nT(r)||na(n)||n.isContentEditable)return;let i=e&&"Enter"===r.key,a=t&&" "===r.key,o="Enter"===r.key&&!e,s=" "===r.key&&!t;if(o||s)return void r.preventDefault();if(i||a){let e=aa(r);if(i){if(!e){r.preventDefault();let{view:e,...t}=r,i=()=>nw(n,t);r5&&/firefox\//i.test(navigator.userAgent)?nI(n,"keyup",i):queueMicrotask(i)}}else a&&(c.current=!0,e||(r.preventDefault(),u(!0)))}}),g=r.onKeyUp,v=n_(e=>{if(null==g||g(e),e.defaultPrevented||h||d||e.metaKey)return;let r=t&&" "===e.key;if(c.current&&r&&(c.current=!1,!aa(e))){e.preventDefault(),u(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>nw(t,n))}});return iE(r={"data-active":l||void 0,type:o?"button":void 0,...m,...r,ref:nk(a,r.ref),onKeyDown:A,onKeyUp:v})});nZ(function(e){return n0("button",as(e))});var{useSyncExternalStore:al}=e.i(2239).default,au=()=>()=>{};function ac(e,t=ng){let r=f.useCallback(t=>e?i1(e,null,t):au(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&np(i,r)?i[r]:void 0};return al(r,n,n)}function ad(e,t){let r=f.useRef({}),n=f.useCallback(t=>e?i1(e,null,t):au(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,a=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==a[e]&&(a[e]=t,i=!0)}if("string"==typeof r){if(!n||!np(n,r))continue;let t=n[r];t!==a[e]&&(a[e]=t,i=!0)}}return i&&(r.current={...a}),r.current};return al(n,i,i)}function af(e,t,r,n){var i;let a,o=np(t,r)?t[r]:void 0,s=(i={value:o,setValue:n?t[n]:void 0},a=(0,f.useRef)(i),nH(()=>{a.current=i}),a);nH(()=>i9(e,[r],(e,t)=>{let{value:n,setValue:i}=s.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),nH(()=>{if(void 0!==o)return e.setState(r,o),i2(e,[r],()=>{void 0!==o&&e.setState(r,o)})})}function ah(e,t){let[r,n]=f.useState(()=>e(t));nH(()=>i0(r),[r]);let i=f.useCallback(e=>ac(r,e),[r]);return[f.useMemo(()=>({...r,useState:i}),[r,i]),n_(()=>{n(r=>e({...t,...r.getState()}))})]}function am(e,t,r,n=!1){var i;let a,o;if(!t||!r)return;let{renderedItems:s}=t.getState(),l=nu(e);if(!l)return;let u=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),a=t?r-i+n:i+n;return"HTML"===e.tagName?a+e.scrollTop:a}(l,n);for(let e=0;e=0){void 0!==o&&ot||(e&&(null==m?void 0:m.baseElement)&&m.baseElement===e.baseElement?m.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===c,ariaSetSize:e=>null!=o?o:e&&(null==m?void 0:m.ariaSetSize)&&m.baseElement===e.baseElement?m.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==m?void 0:m.ariaPosInSet)||m.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===A);return m.ariaPosInSet+t.findIndex(e=>e.id===c)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(i)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===c}}),b=(0,f.useCallback)(e=>{var t;let r={...e,id:c||e.id,rowId:A,disabled:!!p,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[c,A,p,a]),x=l.onFocus,E=(0,f.useRef)(!1),M=n_(t=>{var r,n;if(null==x||x(t),t.defaultPrevented||nF(t)||!c||!e||(r=e,!nT(t)&&nh(r,t.target)))return;let{virtualFocus:i,baseElement:a}=e.getState();e.setActiveId(c),no(t.currentTarget)&&function(e,t=!1){if(na(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=r6(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!i||!nT(t)||!no(n=t.currentTarget)&&("INPUT"!==n.tagName||nr(n))&&(null==a?void 0:a.isConnected)&&((nS()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),E.current=!0,t.relatedTarget===a||nh(e,t.relatedTarget))?(a[nf]=!0,a.focus({preventScroll:!0})):a.focus())}),S=l.onBlurCapture,F=n_(t=>{if(null==S||S(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&E.current&&(E.current=!1,t.preventDefault(),t.stopPropagation())}),T=l.onKeyDown,R=nJ(r),w=nJ(n),D=n_(t=>{if(null==T||T(t),t.defaultPrevented||!nT(t)||!e)return;let{currentTarget:r}=t,n=e.getState(),i=e.item(c),a=!!(null==i?void 0:i.rowId),o="horizontal"!==n.orientation,s="vertical"!==n.orientation,l=()=>!(!a&&!s&&n.baseElement&&na(n.baseElement)),u={ArrowUp:(a||o)&&e.up,ArrowRight:(a||s)&&e.next,ArrowDown:(a||o)&&e.down,ArrowLeft:(a||s)&&e.previous,Home:()=>{if(l())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(l())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>am(r,e,null==e?void 0:e.up,!0),PageDown:()=>am(r,e,null==e?void 0:e.down)}[t.key];if(u){if(no(r)){let e=ns(r),n=s&&"ArrowLeft"===t.key,i=s&&"ArrowRight"===t.key,a=o&&"ArrowUp"===t.key,l=o&&"ArrowDown"===t.key;if(i||l){let{length:t}=function(e){if(na(e))return e.value;if(e.isContentEditable){let t=r6(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((n||a)&&0!==e.start)return}let n=u();if(R(t)||void 0!==n){if(!w(t))return;t.preventDefault(),e.move(n)}}}),I=(0,f.useMemo)(()=>({id:c,baseElement:g}),[c,g]);return l={id:c,"data-active-item":v||void 0,...l=nK(l,e=>(0,d.jsx)(ie.Provider,{value:I,children:e}),[I]),ref:nk(h,l.ref),tabIndex:y?l.tabIndex:-1,onFocus:M,onBlurCapture:F,onKeyDown:D},l=as(l),ny({...l=ai({store:e,...l,getItem:b,shouldRegisterItem:!!c&&l.shouldRegisterItem}),"aria-setsize":C,"aria-posinset":B})});n$(nZ(function(e){return n0("button",ap(e))}));var aA=n1(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:a,focusOnHover:o=!1,moveOnKeyPress:s=!0,getItem:l,...u}){var c,h;let m=iQ();nv(e=e||m,!1);let{resetValueOnSelectState:p,multiSelectable:A,selected:g}=ad(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),v=(0,f.useCallback)(e=>{let r={...e,value:t};return l?l(r):r},[t,l]);n=null!=n?n:!A,r=null!=r?r:null!=t&&!A;let C=u.onClick,B=nJ(n),y=nJ(i),b=nJ(null!=(c=null!=a?a:p)?c:A),x=nJ(r),E=n_(r=>{null==C||C(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=nM();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(y(r)&&(b(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),B(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),M=u.onKeyDown,S=n_(t=>{if(null==M||M(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||id(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),na(r)&&(null==e||e.setValue(r.value)))});A&&null!=g&&(u={"aria-selected":g,...u}),u=nK(u,e=>(0,d.jsx)(iW.Provider,{value:t,children:(0,d.jsx)(iY.Provider,{value:null!=g&&g,children:e})}),[t,g]),u={role:null!=(h=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,f.useContext)(iN)])?h:"option",children:t,...u,onClick:E,onKeyDown:S};let F=nJ(s);return u=ap({store:e,...u,getItem:v,moveOnKeyPress:t=>{if(!F(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),u=an({store:e,focusOnHover:o,...u})}),ag=n$(nZ(function(e){return n0("div",aA(e))})),av=e.i(74080);function aC(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function aB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function ay(e,t,r){return!r&&!1!==t&&(!e||!!t)}var ab=n1(function({store:e,alwaysVisible:t,...r}){let n=iw();nv(e=e||n,!1);let i=(0,f.useRef)(null),a=nU(r.id),[o,s]=(0,f.useState)(null),l=e.useState("open"),u=e.useState("mounted"),c=e.useState("animated"),h=e.useState("contentElement"),m=ac(e.disclosure,"contentElement");nH(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),nH(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),nH(()=>{if(c){var e;let t;return(null==h?void 0:h.isConnected)?(e=()=>{s(l?"enter":u?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void s(null)}},[c,h,l,u]),nH(()=>{if(!e||!c||!o||!h)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,av.flushSync)(t);if("leave"===o&&l||"enter"===o&&!l)return;if("number"==typeof c)return aC(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:a,animationDelay:s}=getComputedStyle(h),{transitionDuration:u="0",animationDuration:d="0",transitionDelay:f="0",animationDelay:p="0"}=m?getComputedStyle(m):{},A=aB(a,s,f,p)+aB(n,i,u,d);if(!A){"enter"===o&&e.setState("animated",!1),t();return}return aC(Math.max(A-1e3/60,0),r)},[e,c,h,m,l,o]);let p=ay(u,(r=nK(r,t=>(0,d.jsx)(iL,{value:e,children:t}),[e])).hidden,t),A=r.style,g=(0,f.useMemo)(()=>p?{...A,display:"none"}:A,[p,A]);return ny(r={id:a,"data-open":l||void 0,"data-enter":"enter"===o||void 0,"data-leave":"leave"===o||void 0,hidden:p,...r,ref:nk(a?e.setContentElement:null,i,r.ref),style:g})}),ax=nZ(function(e){return n0("div",ab(e))});nZ(function({unmountOnHide:e,...t}){let r=iw();return!1===ac(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,d.jsx)(ax,{...t})});var aE=n1(function({store:e,alwaysVisible:t,...r}){let n=iQ(!0),i=iK(),a=!!(e=e||i)&&e===n;nv(e,!1);let o=(0,f.useRef)(null),s=nU(r.id),l=e.useState("mounted"),u=ay(l,r.hidden,t),c=u?{...r.style,display:"none"}:r.style,h=e.useState(e=>Array.isArray(e.selectedValue)),m=function(e,t,r){let n=function(e){let[t]=(0,f.useState)(e);return t}(r),[i,a]=(0,f.useState)(n);return(0,f.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);a(null==e?n:e)},o=new MutationObserver(i);return o.observe(r,{attributeFilter:[t]}),i(),()=>o.disconnect()},[e,t,n]),i}(o,"role",r.role),p="listbox"===m||"tree"===m||"grid"===m,[A,g]=(0,f.useState)(!1),v=e.useState("contentElement");nH(()=>{if(!l)return;let e=o.current;if(!e||v!==e)return;let t=()=>{g(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[l,v]),A||(r={role:"listbox","aria-multiselectable":p&&h||void 0,...r}),r=nK(r,t=>(0,d.jsx)(iX,{value:e,children:(0,d.jsx)(iN.Provider,{value:m,children:t})}),[e,m]);let C=!s||n&&a?null:e.setContentElement;return ny(r={id:s,hidden:u,...r,ref:nk(C,o,r.ref),style:c})}),aM=nZ(function(e){return n0("div",aE(e))}),aS=(0,f.createContext)(null),aF=n1(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});nZ(function(e){return n0("span",aF(e))});var aT=n1(function(e){return aF(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),aR=nZ(function(e){return n0("span",aT(e))});function aw(e){queueMicrotask(()=>{null==e||e.focus()})}var aD=n1(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:n,portal:i=!0,...a}){let o=(0,f.useRef)(null),s=nk(o,a.ref),l=(0,f.useContext)(aS),[u,c]=(0,f.useState)(null),[h,m]=(0,f.useState)(null),p=(0,f.useRef)(null),A=(0,f.useRef)(null),g=(0,f.useRef)(null),v=(0,f.useRef)(null);return nH(()=>{let e=o.current;if(!e||!i)return void c(null);let t=r?"function"==typeof r?r(e):r:r6(e).createElement("div");if(!t)return void c(null);let a=t.isConnected;if(a||(l||r6(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),c(t),nx(n,t),!a)return()=>{t.remove(),nx(n,null)}},[i,r,l,n]),nH(()=>{if(!i||!e||!t)return;let r=r6(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),m(r),()=>{r.remove(),m(null)}},[i,e,t]),(0,f.useEffect)(()=>{if(!u||!e)return;let t=0,r=e=>{if(!nD(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=u.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(u.hasAttribute("data-tabindex")&&t(u),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of il(u,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return u.addEventListener("focusin",r,!0),u.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),u.removeEventListener("focusin",r,!0),u.removeEventListener("focusout",r,!0)}},[u,e]),a={...a=nK(a,t=>{if(t=(0,d.jsx)(aS.Provider,{value:u||l,children:t}),!i)return t;if(!u)return(0,d.jsx)("span",{ref:s,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,d.jsxs)(d.Fragment,{children:[e&&u&&(0,d.jsx)(aR,{ref:A,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{nD(e,u)?aw(iu()):aw(p.current)}}),t,e&&u&&(0,d.jsx)(aR,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{nD(e,u)?aw(ic()):aw(v.current)}})]}),u&&(t=(0,av.createPortal)(t,u));let r=(0,d.jsxs)(d.Fragment,{children:[e&&u&&(0,d.jsx)(aR,{ref:p,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==v.current&&nD(e,u)?aw(A.current):aw(ic())}}),e&&(0,d.jsx)("span",{"aria-owns":null==u?void 0:u.id,style:{position:"fixed"}}),e&&u&&(0,d.jsx)(aR,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(nD(e,u))aw(g.current);else{let e=iu();if(e===A.current)return void requestAnimationFrame(()=>{var e;return null==(e=iu())?void 0:e.focus()});aw(e)}}})]});return h&&e&&(r=(0,av.createPortal)(r,h)),(0,d.jsxs)(d.Fragment,{children:[r,t]})},[u,l,i,a.id,e,h]),ref:s}});nZ(function(e){return n0("div",aD(e))});var aI=(0,f.createContext)(0);function aG({level:e,children:t}){let r=(0,f.useContext)(aI),n=Math.max(Math.min(e||r+1,6),1);return(0,d.jsx)(aI.Provider,{value:n,children:t})}var aL=n1(function({autoFocusOnShow:e=!0,...t}){return nK(t,t=>(0,d.jsx)(ir.Provider,{value:e,children:t}),[e])});nZ(function(e){return n0("div",aL(e))});var aO=new WeakMap;function aP(e,t,r){aO.has(e)||aO.set(e,new Map);let n=aO.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let a=r(),o=()=>{a(),i(),n.delete(t)};return n.set(t,o),()=>{n.get(t)===o&&(a(),n.set(t,i))}}function aH(e,t,r){return aP(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function a_(e,t,r){return aP(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function ak(e,t){return e?aP(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var aU=["SCRIPT","STYLE"];function aj(e){return`__ariakit-dialog-snapshot-${e}`}function aN(e,t,r,n){for(let i of t){if(!(null==i?void 0:i.isConnected))continue;let a=t.some(e=>!!e&&e!==i&&e.contains(i)),o=r6(i),s=i;for(;i.parentElement&&i!==o.body;){if(null==n||n(i.parentElement,s),!a)for(let n of i.parentElement.children)(function(e,t,r){return!aU.includes(t.tagName)&&!!function(e,t){let r=r6(t),n=aj(e);if(!r.body[n])return!0;for(;;){if(t===r.body)return!1;if(t[n])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&ne(t,e))})(e,n,t)&&r(n,s);i=i.parentElement}}}function aJ(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function aK(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function aQ(e,t=""){return nA(a_(e,aK("",!0),!0),a_(e,aK(t,!0),!0))}function aV(e,t){if(e[aK(t,!0)])return!0;let r=aK(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function aq(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return aN(e,t,t=>{aJ(t,...n)||r.unshift(function(e,t=""){return nA(a_(e,aK(),!0),a_(e,aK(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(aQ(t,e))}),()=>{for(let e of r)e()}}function aX({store:e,type:t,listener:r,capture:n,domReady:i}){let a=n_(r),o=ac(e,"open"),s=(0,f.useRef)(!1);nH(()=>{if(!o||!i)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,o,i]),(0,f.useEffect)(()=>{if(o)return nG(t,t=>{let{contentElement:r,disclosureElement:n}=e.getState(),i=t.target;!r||!i||!(!("HTML"===i.tagName||ne(r6(i).body,i))||ne(r,i)||function(e,t){if(!e)return!1;if(ne(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=r6(e).getElementById(r);if(t)return ne(e,t)}return!1}(n,i)||i.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||aV(i,r.id))&&(i&&i[ig]||a(t))},n)},[o,n])}function aW(e,t){return"function"==typeof e?e(t):!!e}var aY=(0,f.createContext)({});function az(){return"inert"in HTMLElement.prototype}function aZ(e,t){if(!("style"in e))return nm;if(az())return a_(e,"inert",!0);let r=il(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&ne(t,e)))return nm;let r=aP(e,"focus",()=>(e.focus=nm,()=>{delete e.focus}));return nA(aH(e,"tabindex","-1"),r)});return nA(...r,aH(e,"aria-hidden","true"),ak(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function a$(e={}){let t=i8(e.store,i3(e.disclosure,["contentElement","disclosureElement"]));i5(e,t);let r=null==t?void 0:t.getState(),n=nb(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=nb(e.animated,null==r?void 0:r.animated,!1),a=iZ({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:nb(null==r?void 0:r.contentElement,null),disclosureElement:nb(null==r?void 0:r.disclosureElement,null)},t);return i$(a,()=>i9(a,["animated","animating"],e=>{e.animated||a.setState("animating",!1)})),i$(a,()=>i1(a,["open"],()=>{a.getState().animated&&a.setState("animating",!0)})),i$(a,()=>i9(a,["open","animating"],e=>{a.setState("mounted",e.open||e.animating)})),{...a,disclosure:e.disclosure,setOpen:e=>a.setState("open",e),show:()=>a.setState("open",!0),hide:()=>a.setState("open",!1),toggle:()=>a.setState("open",e=>!e),stopAnimation:()=>a.setState("animating",!1),setContentElement:e=>a.setState("contentElement",e),setDisclosureElement:e=>a.setState("disclosureElement",e)}}function a0(e,t,r){return nj(t,[r.store,r.disclosure]),af(e,r,"open","setOpen"),af(e,r,"mounted","setMounted"),af(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}n1(function(e){return e});var a1=nZ(function(e){return n0("div",e)});function a9({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,f.useRef)(null),a=function(e={}){let[t,r]=ah(a$,e);return a0(t,r,e)}({disclosure:e}),o=ac(e,"contentElement");(0,f.useEffect)(()=>{let e=i.current;!e||o&&(e.style.zIndex=getComputedStyle(o).zIndex)},[o]),nH(()=>{let e=null==o?void 0:o.id;if(!e)return;let t=i.current;if(t)return aQ(t,e)},[o]);let s=ab({ref:i,store:a,role:"presentation","data-backdrop":(null==o?void 0:o.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,f.isValidElement)(t))return(0,d.jsx)(a1,{...s,render:t});let l="boolean"!=typeof t?t:"div";return(0,d.jsx)(a1,{...s,render:(0,d.jsx)(l,{})})}function a2(e={}){return a$(e)}Object.assign(a1,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=nZ(function(e){return n0(t,e)}),e),{}));var a3=nS();function a8(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ia(r)?r:null:r:null}var a5=n1(function({store:e,open:t,onClose:r,focusable:n=!0,modal:i=!0,portal:a=!!i,backdrop:o=!!i,hideOnEscape:s=!0,hideOnInteractOutside:l=!0,getPersistentElements:u,preventBodyScroll:c=!!i,autoFocusOnShow:h=!0,autoFocusOnHide:m=!0,initialFocus:p,finalFocus:A,unmountOnHide:g,unstable_treeSnapshotKey:v,...C}){var B;let y,b,x,E=iI(),M=(0,f.useRef)(null),S=function(e={}){let[t,r]=ah(a2,e);return a0(t,r,e)}({store:e||E,open:t,setOpen(e){if(e)return;let t=M.current;if(!t)return;let n=new Event("close",{bubbles:!1,cancelable:!0});r&&t.addEventListener("close",r,{once:!0}),t.dispatchEvent(n),n.defaultPrevented&&S.setOpen(!0)}}),{portalRef:F,domReady:T}=nQ(a,C.portalRef),R=C.preserveTabOrder,w=ac(S,e=>R&&!i&&e.mounted),D=nU(C.id),I=ac(S,"open"),G=ac(S,"mounted"),L=ac(S,"contentElement"),O=ay(G,C.hidden,C.alwaysVisible);y=function({attribute:e,contentId:t,contentElement:r,enabled:n}){let[i,a]=nN(),o=(0,f.useCallback)(()=>{if(!n||!r)return!1;let{body:i}=r6(r),a=i.getAttribute(e);return!a||a===t},[i,n,r,e,t]);return(0,f.useEffect)(()=>{if(!n||!t||!r)return;let{body:i}=r6(r);if(o())return i.setAttribute(e,t),()=>i.removeAttribute(e);let s=new MutationObserver(()=>(0,av.flushSync)(a));return s.observe(i,{attributeFilter:[e]}),()=>s.disconnect()},[i,n,t,r,o,e]),o}({attribute:"data-dialog-prevent-body-scroll",contentElement:L,contentId:D,enabled:c&&!O}),(0,f.useEffect)(()=>{var e,t;if(!y()||!L)return;let r=r6(L),n=r4(L),{documentElement:i,body:a}=r,o=i.style.getPropertyValue("--scrollbar-width"),s=o?Number.parseInt(o,10):n.innerWidth-i.clientWidth,l=Math.round(i.getBoundingClientRect().left)+i.scrollLeft?"paddingLeft":"paddingRight",u=nM()&&!(r5&&navigator.platform.startsWith("Mac")&&!nE());return nA((e="--scrollbar-width",t=`${s}px`,i?aP(i,e,()=>{let r=i.style.getPropertyValue(e);return i.style.setProperty(e,t),()=>{r?i.style.setProperty(e,r):i.style.removeProperty(e)}}):()=>{}),u?(()=>{var e,t;let{scrollX:r,scrollY:i,visualViewport:o}=n,u=null!=(e=null==o?void 0:o.offsetLeft)?e:0,c=null!=(t=null==o?void 0:o.offsetTop)?t:0,d=ak(a,{position:"fixed",overflow:"hidden",top:`${-(i-Math.floor(c))}px`,left:`${-(r-Math.floor(u))}px`,right:"0",[l]:`${s}px`});return()=>{d(),n.scrollTo({left:r,top:i,behavior:"instant"})}})():ak(a,{overflow:"hidden",[l]:`${s}px`}))},[y,L]),B=ac(S,"open"),b=(0,f.useRef)(),(0,f.useEffect)(()=>{if(!B){b.current=null;return}return nG("mousedown",e=>{b.current=e.target},!0)},[B]),aX({...x={store:S,domReady:T,capture:!0},type:"click",listener:e=>{let{contentElement:t}=S.getState(),r=b.current;r&&ni(r)&&aV(r,null==t?void 0:t.id)&&aW(l,e)&&S.hide()}}),aX({...x,type:"focusin",listener:e=>{let{contentElement:t}=S.getState();!t||e.target===r6(t)||aW(l,e)&&S.hide()}}),aX({...x,type:"contextmenu",listener:e=>{aW(l,e)&&S.hide()}});let{wrapElement:P,nestedDialogs:H}=function(e){let t=(0,f.useContext)(aY),[r,n]=(0,f.useState)([]),i=(0,f.useCallback)(e=>{var r;return n(t=>[...t,e]),nA(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);nH(()=>i9(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let a=(0,f.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,f.useCallback)(e=>(0,d.jsx)(aY.Provider,{value:a,children:e}),[a]),nestedDialogs:r}}(S);C=nK(C,P,[P]),nH(()=>{if(!I)return;let e=M.current,t=r7(e,!0);!t||"BODY"===t.tagName||e&&ne(e,t)||S.setDisclosureElement(t)},[S,I]),a3&&(0,f.useEffect)(()=>{if(!G)return;let{disclosureElement:e}=S.getState();if(!e||!nr(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),nI(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||im(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[S,G]),(0,f.useEffect)(()=>{if(!G||!T)return;let e=M.current;if(!e)return;let t=r4(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[G,T]),(0,f.useEffect)(()=>{if(!i||!G||!T)return;let e=M.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=S.hide,(r=r6(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[S,i,G,T]),nH(()=>{if(!az()||I||!G||!T)return;let e=M.current;if(e)return aZ(e)},[I,G,T]);let _=I&&T;nH(()=>{if(D&&_)return function(e,t){let{body:r}=r6(t[0]),n=[];return aN(e,t,t=>{n.push(a_(t,aj(e),!0))}),nA(a_(r,aj(e),!0),()=>{for(let e of n)e()})}(D,[M.current])},[D,_,v]);let k=n_(u);nH(()=>{if(!D||!_)return;let{disclosureElement:e}=S.getState(),t=[M.current,...k()||[],...H.map(e=>e.getState().contentElement)];if(i){let e,r;return nA(aq(D,t),(e=[],r=t.map(e=>null==e?void 0:e.id),aN(D,t,n=>{aJ(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(aZ(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&ne(e,r))||e.unshift(aH(r,"role","none"))}),()=>{for(let t of e)t()}))}return aq(D,[e,...t])},[D,S,_,k,H,i,v]);let U=!!h,j=nJ(h),[N,J]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(!I||!U||!T||!(null==L?void 0:L.isConnected))return;let e=a8(p,!0)||L.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=il(e,t,r);return n||null}(L,!0,a&&w)||L,t=ia(e);j(t?e:null)&&(J(!0),queueMicrotask(()=>{e.focus(),!a3||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[I,U,T,L,p,a,w,j]);let K=!!m,Q=nJ(m),[V,q]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(I)return q(!0),()=>q(!1)},[I]);let X=(0,f.useCallback)((e,t=!0)=>{let r,{disclosureElement:n}=S.getState();if(!(!(r=r7())||e&&ne(e,r))&&ia(r))return;let i=a8(A)||n;if(null==i?void 0:i.id){let e=r6(i),t=`[aria-activedescendant="${i.id}"]`,r=e.querySelector(t);r&&(i=r)}if(i&&!ia(i)){let e=i.closest("[data-dialog]");if(null==e?void 0:e.id){let t=r6(e),r=`[aria-controls~="${e.id}"]`,n=t.querySelector(r);n&&(i=n)}}let a=i&&ia(i);!a&&t?requestAnimationFrame(()=>X(e,!1)):!Q(a?i:null)||a&&(null==i||i.focus({preventScroll:!0}))},[S,A,Q]),W=(0,f.useRef)(!1);nH(()=>{if(I||!V||!K)return;let e=M.current;W.current=!0,X(e)},[I,V,T,K,X]),(0,f.useEffect)(()=>{if(!V||!K)return;let e=M.current;return()=>{if(W.current){W.current=!1;return}X(e)}},[V,K,X]);let Y=nJ(s);(0,f.useEffect)(()=>{if(T&&G)return nG("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=M.current;if(!t||aV(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=S.getState();!("BODY"===r.tagName||ne(t,r)||!n||ne(n,r))||Y(e)&&S.hide()},!0)},[S,T,G,Y]);let z=(C=nK(C,e=>(0,d.jsx)(aG,{level:i?1:void 0,children:e}),[i])).hidden,Z=C.alwaysVisible;C=nK(C,e=>o?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a9,{store:S,backdrop:o,hidden:z,alwaysVisible:Z}),e]}):e,[S,o,z,Z]);let[$,ee]=(0,f.useState)(),[et,er]=(0,f.useState)();return C=aL({...C={id:D,"data-dialog":"",role:"dialog",tabIndex:n?-1:void 0,"aria-labelledby":$,"aria-describedby":et,...C=nK(C,e=>(0,d.jsx)(iL,{value:S,children:(0,d.jsx)(iO.Provider,{value:ee,children:(0,d.jsx)(iP.Provider,{value:er,children:e})})}),[S]),ref:nk(M,C.ref)},autoFocusOnShow:N}),C=aD({portal:a,...C=iE({...C=ab({store:S,...C}),focusable:n}),portalRef:F,preserveTabOrder:w})});function a6(e,t=iI){return nZ(function(r){let n=t();return ac(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,d.jsx)(e,{...r}):null})}a6(nZ(function(e){return n0("div",a5(e))}),iI);let a4=Math.min,a7=Math.max,oe=Math.round,ot=Math.floor,or=e=>({x:e,y:e}),on={left:"right",right:"left",bottom:"top",top:"bottom"},oi={start:"end",end:"start"};function oa(e,t){return"function"==typeof e?e(t):e}function oo(e){return e.split("-")[0]}function os(e){return e.split("-")[1]}function ol(e){return"x"===e?"y":"x"}function ou(e){return"y"===e?"height":"width"}let oc=new Set(["top","bottom"]);function od(e){return oc.has(oo(e))?"y":"x"}function of(e){return e.replace(/start|end/g,e=>oi[e])}let oh=["left","right"],om=["right","left"],op=["top","bottom"],oA=["bottom","top"];function og(e){return e.replace(/left|right|bottom|top/g,e=>on[e])}function ov(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function oC(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function oB(e,t,r){let n,{reference:i,floating:a}=e,o=od(t),s=ol(od(t)),l=ou(s),u=oo(t),c="y"===o,d=i.x+i.width/2-a.width/2,f=i.y+i.height/2-a.height/2,h=i[l]/2-a[l]/2;switch(u){case"top":n={x:d,y:i.y-a.height};break;case"bottom":n={x:d,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:f};break;case"left":n={x:i.x-a.width,y:f};break;default:n={x:i.x,y:i.y}}switch(os(t)){case"start":n[s]-=h*(r&&c?-1:1);break;case"end":n[s]+=h*(r&&c?-1:1)}return n}let oy=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=a.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=oB(u,n,l),f=n,h={},m=0;for(let r=0;r{try{return e.matches(t)}catch(e){return!1}})}let o_=["transform","translate","scale","rotate","perspective"],ok=["transform","translate","scale","rotate","perspective","filter"],oU=["paint","layout","strict","content"];function oj(e){let t=oN(),r=ow(e)?oQ(e):e;return o_.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||ok.some(e=>(r.willChange||"").includes(e))||oU.some(e=>(r.contain||"").includes(e))}function oN(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let oJ=new Set(["html","body","#document"]);function oK(e){return oJ.has(oS(e))}function oQ(e){return oF(e).getComputedStyle(e)}function oV(e){return ow(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oq(e){if("html"===oS(e))return e;let t=e.assignedSlot||e.parentNode||oI(e)&&e.host||oT(e);return oI(t)?t.host:t}function oX(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let i=function e(t){let r=oq(t);return oK(r)?t.ownerDocument?t.ownerDocument.body:t.body:oD(r)&&oL(r)?r:e(r)}(e),a=i===(null==(n=e.ownerDocument)?void 0:n.body),o=oF(i);if(a){let e=oW(o);return t.concat(o,o.visualViewport||[],oL(i)?i:[],e&&r?oX(e):[])}return t.concat(i,oX(i,[],r))}function oW(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oY(e){let t=oQ(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=oD(e),a=i?e.offsetWidth:r,o=i?e.offsetHeight:n,s=oe(r)!==a||oe(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function oz(e){return ow(e)?e:e.contextElement}function oZ(e){let t=oz(e);if(!oD(t))return or(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:a}=oY(t),o=(a?oe(r.width):r.width)/n,s=(a?oe(r.height):r.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}let o$=or(0);function o0(e){let t=oF(e);return oN()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:o$}function o1(e,t,r,n){var i;void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),o=oz(e),s=or(1);t&&(n?ow(n)&&(s=oZ(n)):s=oZ(e));let l=(void 0===(i=r)&&(i=!1),n&&(!i||n===oF(o))&&i)?o0(o):or(0),u=(a.left+l.x)/s.x,c=(a.top+l.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=oF(o),t=n&&ow(n)?oF(n):n,r=e,i=oW(r);for(;i&&n&&t!==r;){let e=oZ(i),t=i.getBoundingClientRect(),n=oQ(i),a=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=a,c+=o,i=oW(r=oF(i))}}return oC({width:d,height:f,x:u,y:c})}function o9(e,t){let r=oV(e).scrollLeft;return t?t.left+r:o1(oT(e)).left+r}function o2(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-o9(e,r),y:r.top+t.scrollTop}}let o3=new Set(["absolute","fixed"]);function o8(e,t,r){var n;let i;if("viewport"===t)i=function(e,t){let r=oF(e),n=oT(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;let e=oN();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}let u=o9(n);if(u<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(n.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else u<=25&&(a+=u);return{width:a,height:o,x:s,y:l}}(e,r);else if("document"===t){let t,r,a,o,s,l,u;n=oT(e),t=oT(n),r=oV(n),a=n.ownerDocument.body,o=a7(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=a7(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight),l=-r.scrollLeft+o9(n),u=-r.scrollTop,"rtl"===oQ(a).direction&&(l+=a7(t.clientWidth,a.clientWidth)-o),i={width:o,height:s,x:l,y:u}}else if(ow(t)){let e,n,a,o,s,l;n=(e=o1(t,!0,"fixed"===r)).top+t.clientTop,a=e.left+t.clientLeft,o=oD(t)?oZ(t):or(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,i={width:s,height:l,x:a*o.x,y:n*o.y}}else{let r=o0(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return oC(i)}function o5(e){return"static"===oQ(e).position}function o6(e,t){if(!oD(e)||"fixed"===oQ(e).position)return null;if(t)return t(e);let r=e.offsetParent;return oT(e)===r&&(r=r.ownerDocument.body),r}function o4(e,t){var r;let n=oF(e);if(oH(e))return n;if(!oD(e)){let t=oq(e);for(;t&&!oK(t);){if(ow(t)&&!o5(t))return t;t=oq(t)}return n}let i=o6(e,t);for(;i&&(r=i,oO.has(oS(r)))&&o5(i);)i=o6(i,t);return i&&oK(i)&&o5(i)&&!oj(i)?n:i||function(e){let t=oq(e);for(;oD(t)&&!oK(t);){if(oj(t))return t;if(oH(t))break;t=oq(t)}return null}(e)||n}let o7=async function(e){let t=this.getOffsetParent||o4,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=oD(t),i=oT(t),a="fixed"===r,o=o1(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=or(0);if(n||!n&&!a)if(("body"!==oS(t)||oL(i))&&(s=oV(t)),n){let e=o1(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=o9(i));a&&!n&&i&&(l.x=o9(i));let u=!i||n||a?or(0):o2(i,s);return{x:o.left+s.scrollLeft-l.x-u.x,y:o.top+s.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},se={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,a="fixed"===i,o=oT(n),s=!!t&&oH(t.floating);if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=or(1),c=or(0),d=oD(n);if((d||!d&&!a)&&(("body"!==oS(n)||oL(o))&&(l=oV(n)),oD(n))){let e=o1(n);u=oZ(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let f=!o||d||a?or(0):o2(o,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:oT,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,a=[..."clippingAncestors"===r?oH(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=oX(e,[],!1).filter(e=>ow(e)&&"body"!==oS(e)),i=null,a="fixed"===oQ(e).position,o=a?oq(e):e;for(;ow(o)&&!oK(o);){let t=oQ(o),r=oj(o);r||"fixed"!==t.position||(i=null),(a?!r&&!i:!r&&"static"===t.position&&!!i&&o3.has(i.position)||oL(o)&&!r&&function e(t,r){let n=oq(t);return!(n===r||!ow(n)||oK(n))&&("fixed"===oQ(n).position||e(n,r))}(e,o))?n=n.filter(e=>e!==o):i=t,o=oq(o)}return t.set(e,n),n}(t,this._c):[].concat(r),n],o=a[0],s=a.reduce((e,r)=>{let n=o8(t,r,i);return e.top=a7(n.top,e.top),e.right=a4(n.right,e.right),e.bottom=a4(n.bottom,e.bottom),e.left=a7(n.left,e.left),e},o8(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:o4,getElementRects:o7,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=oY(e);return{width:t,height:r}},getScale:oZ,isElement:ow,isRTL:function(e){return"rtl"===oQ(e).direction}};function st(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sr(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function sn(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function si(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var sa=n1(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:a,fixed:o=!1,flip:s=!0,shift:l=0,slide:u=!0,overlap:c=!1,sameWidth:h=!1,fitViewport:m=!1,gutter:p,arrowPadding:A=4,overflowPadding:g=8,getAnchorRect:v,updatePosition:C,...B}){let y=i_();nv(e=e||y,!1);let b=e.useState("arrowElement"),x=e.useState("anchorElement"),E=e.useState("disclosureElement"),M=e.useState("popoverElement"),S=e.useState("contentElement"),F=e.useState("placement"),T=e.useState("mounted"),R=e.useState("rendered"),w=(0,f.useRef)(null),[D,I]=(0,f.useState)(!1),{portalRef:G,domReady:L}=nQ(r,B.portalRef),O=n_(v),P=n_(C),H=!!C;nH(()=>{if(!(null==M?void 0:M.isConnected))return;M.style.setProperty("--popover-overflow-padding",`${g}px`);let t={contextElement:x||void 0,getBoundingClientRect:()=>{let e=null==O?void 0:O(x);return e||!x?function(e){if(!e)return sr();let{x:t,y:r,width:n,height:i}=e;return sr(t,r,n,i)}(e):x.getBoundingClientRect()}},r=async()=>{var r,n,i,a,d;let f,v,C;if(!T)return;b||(w.current=w.current||document.createElement("div"));let B=b||w.current,y=[(r={gutter:p,shift:l},void 0===(n=({placement:e})=>{var t;let n=((null==B?void 0:B.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:a,placement:o,middlewareData:s}=e,l=await oE(e,n);return o===(null==(t=s.offset)?void 0:t.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return nv(!r||r.every(sn),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,a,o,s,l,u;let c,d,f,{placement:h,middlewareData:m,rects:p,initialPlacement:A,platform:g,elements:v}=e,{mainAxis:C=!0,crossAxis:B=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:E=!0,...M}=oa(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let S=oo(h),F=od(A),T=oo(A)===A,R=await (null==g.isRTL?void 0:g.isRTL(v.floating)),w=y||(T||!E?[og(A)]:(c=og(A),[of(A),c,of(c)])),D="none"!==x;!y&&D&&w.push(...(d=os(A),f=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?om:oh;return t?oh:om;case"left":case"right":return t?op:oA;default:return[]}}(oo(A),"start"===x,R),d&&(f=f.map(e=>e+"-"+d),E&&(f=f.concat(f.map(of)))),f));let I=[A,...w],G=await ob(e,M),L=[],O=(null==(n=m.flip)?void 0:n.overflows)||[];if(C&&L.push(G[S]),B){let e,t,r,n,i=(s=h,l=p,void 0===(u=R)&&(u=!1),e=os(s),r=ou(t=ol(od(s))),n="x"===t?e===(u?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[r]>l.floating[r]&&(n=og(n)),[n,og(n)]);L.push(G[i[0]],G[i[1]])}if(O=[...O,{placement:h,overflows:L}],!L.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=I[e];if(t&&("alignment"!==B||F===od(t)||O.every(e=>od(e.placement)!==F||e.overflows[0]>0)))return{data:{index:e,overflows:O},reset:{placement:t}};let r=null==(a=O.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:a.placement;if(!r)switch(b){case"bestFit":{let e=null==(o=O.filter(e=>{if(D){let t=od(e.placement);return t===F||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=A}if(h!==r)return{reset:{placement:r}}}return{}}}}({flip:s,overflowPadding:g}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:a,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=oa(t,e),c={x:r,y:n},d=od(i),f=ol(d),h=c[f],m=c[d],p=oa(s,e),A="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){let e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+A.mainAxis,r=a.reference[f]+a.reference[e]-A.mainAxis;hr&&(h=r)}if(u){var g,v;let e="y"===f?"width":"height",t=ox.has(oo(i)),r=a.reference[d]-a.floating[e]+(t&&(null==(g=o.offset)?void 0:g[d])||0)+(t?0:A.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(v=o.offset)?void 0:v[d])||0)-(t?A.crossAxis:0);mn&&(m=n)}return{[f]:h,[d]:m}}})},async fn(e){let{x:t,y:n,placement:i}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=oa(r,e),u={x:t,y:n},c=await ob(e,l),d=od(oo(i)),f=ol(d),h=u[f],m=u[d];if(a){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=h+c[e],n=h-c[t];h=a7(r,a4(h,n))}if(o){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+c[e],n=m-c[t];m=a7(r,a4(m,n))}let p=s.fn({...e,[f]:h,[d]:m});return{...p,data:{x:p.x-t,y:p.y-n,enabled:{[f]:a,[d]:o}}}}}}}({slide:u,shift:l,overlap:c,overflowPadding:g}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=oa(r,e)||{};if(null==u)return{};let d=ov(c),f={x:t,y:n},h=ol(od(i)),m=ou(h),p=await o.getDimensions(u),A="y"===h,g=A?"clientHeight":"clientWidth",v=a.reference[m]+a.reference[h]-f[h]-a.floating[m],C=f[h]-a.reference[h],B=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),y=B?B[g]:0;y&&await (null==o.isElement?void 0:o.isElement(B))||(y=s.floating[g]||a.floating[m]);let b=y/2-p[m]/2-1,x=a4(d[A?"top":"left"],b),E=a4(d[A?"bottom":"right"],b),M=y-p[m]-E,S=y/2-p[m]/2+(v/2-C/2),F=a7(x,a4(S,M)),T=!l.arrow&&null!=os(i)&&S!==F&&a.reference[m]/2-(S{},...d}=oa(a,e),f=await ob(e,d),h=oo(o),m=os(o),p="y"===od(o),{width:A,height:g}=s.floating;"top"===h||"bottom"===h?(n=h,i=m===(await (null==l.isRTL?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(i=h,n="end"===m?"top":"bottom");let v=g-f.top-f.bottom,C=A-f.left-f.right,B=a4(g-f[n],v),y=a4(A-f[i],C),b=!e.middlewareData.shift,x=B,E=y;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=C),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(x=v),b&&!m){let e=a7(f.left,0),t=a7(f.right,0),r=a7(f.top,0),n=a7(f.bottom,0);p?E=A-2*(0!==e||0!==t?e+t:a7(f.left,f.right)):x=g-2*(0!==r||0!==n?r+n:a7(f.top,f.bottom))}await c({...e,availableWidth:E,availableHeight:x});let M=await l.getDimensions(u.floating);return A!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}],x=await (d={placement:F,strategy:o?"fixed":"absolute",middleware:y},f=new Map,C={...(v={platform:se,...d}).platform,_c:f},oy(t,M,{...v,platform:C}));null==e||e.setState("currentPlacement",x.placement),I(!0);let E=si(x.x),S=si(x.y);if(Object.assign(M.style,{top:"0",left:"0",transform:`translate3d(${E}px,${S}px,0)`}),B&&x.middlewareData.arrow){let{x:e,y:t}=x.middlewareData.arrow,r=x.placement.split("-")[0],n=B.clientWidth/2,i=B.clientHeight/2,a=null!=e?e+n:-n,o=null!=t?t+i:-i;M.style.setProperty("--popover-transform-origin",{top:`${a}px calc(100% + ${i}px)`,bottom:`${a}px ${-i}px`,left:`calc(100% + ${n}px) ${o}px`,right:`${-n}px ${o}px`}[r]),Object.assign(B.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=oz(e),d=a||o?[...c?oX(c):[],...oX(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,n=null,i=oT(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(s||t(),!f||!h)return;let m={rootMargin:-ot(d)+"px "+-ot(i.clientWidth-(c+f))+"px "+-ot(i.clientHeight-(d+h))+"px "+-ot(c)+"px",threshold:a7(0,a4(1,l))||1},p=!0;function A(t){let n=t[0].intersectionRatio;if(n!==l){if(!p)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==n||st(u,e.getBoundingClientRect())||o(),p=!1}try{n=new IntersectionObserver(A,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(A,m)}n.observe(e)}(!0),a}(c,r):null,h=-1,m=null;s&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!u&&m.observe(c),m.observe(t));let p=u?o1(e):null;return u&&function t(){let n=o1(e);p&&!st(p,n)&&r(),p=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(i)}}(t,M,async()=>{H?(await P({updatePosition:r}),I(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{I(!1),n()}},[e,R,M,b,x,M,F,T,L,o,s,l,u,c,h,m,p,A,g,O,H,P]),nH(()=>{if(!T||!L||!(null==M?void 0:M.isConnected)||!(null==S?void 0:S.isConnected))return;let e=()=>{M.style.zIndex=getComputedStyle(S).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,L,M,S]);let _=o?"fixed":"absolute";return B=nK(B,t=>(0,d.jsx)("div",{...a,style:{position:_,top:0,left:0,width:"max-content",...null==a?void 0:a.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,_,a]),B={"data-placing":!D||void 0,...B=nK(B,t=>(0,d.jsx)(iU,{value:e,children:t}),[e]),style:{position:"relative",...B.style}},B=a5({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:E||x,autoFocusOnShow:D&&i,...B,portalRef:G})});a6(nZ(function(e){return n0("div",sa(e))}),i_);var so=n1(function({store:e,modal:t,tabIndex:r,alwaysVisible:n,autoFocusOnHide:i=!0,hideOnInteractOutside:a=!0,...o}){let s=iV();nv(e=e||s,!1);let l=e.useState("baseElement"),u=(0,f.useRef)(!1),c=ac(e.tag,e=>null==e?void 0:e.renderedItems.length);return o=aE({store:e,alwaysVisible:n,...o}),o=sa({store:e,modal:t,alwaysVisible:n,backdrop:!1,autoFocusOnShow:!1,finalFocus:l,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:c,...o,getPersistentElements(){var r;let n=(null==(r=o.getPersistentElements)?void 0:r.call(o))||[];if(!t||!e)return n;let{contentElement:i,baseElement:a}=e.getState();if(!a)return n;let s=r6(a),l=[];if((null==i?void 0:i.id)&&l.push(`[aria-controls~="${i.id}"]`),(null==a?void 0:a.id)&&l.push(`[aria-controls~="${a.id}"]`),!l.length)return[...n,a];let u=l.join(",");return[...n,...s.querySelectorAll(u)]},autoFocusOnHide:e=>!nC(i,e)&&(!u.current||(u.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,s=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,s))return!1;let l="function"==typeof a?a(t):a;return l&&(u.current="click"===t.type),l}})}),ss=a6(nZ(function(e){return n0("div",so(e))}),iV);(0,f.createContext)(null),(0,f.createContext)(null);var sl=n9([n4],[n7]),su=sl.useContext;sl.useScopedContext,sl.useProviderContext,sl.ContextProvider,sl.ScopedContextProvider;var sc={id:null};function sd(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function sf(e,t){return e.filter(e=>e.rowId===t)}function sh(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function sm(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var sp=nS()&&nE();function sA({tag:e,...t}={}){let r=i8(t.store,function(e,...t){if(e)return iz(e,"pick")(...t)}(e,["value","rtl"]));i5(t,r);let n=null==e?void 0:e.getState(),i=null==r?void 0:r.getState(),a=nb(t.activeId,null==i?void 0:i.activeId,t.defaultActiveId,null),o=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),n=function(e={}){var t,r;i5(e,e.store);let n=null==(t=e.store)?void 0:t.getState(),i=nb(e.items,null==n?void 0:n.items,e.defaultItems,[]),a=new Map(i.map(e=>[e.id,e])),o={items:i,renderedItems:nb(null==n?void 0:n.renderedItems,[])},s=null==(r=e.store)?void 0:r.__unstablePrivateStore,l=iZ({items:i,renderedItems:o.renderedItems},s),u=iZ(o,e.store),c=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,a])=>{var o;let s=t(r),l=t(a);return s!==l&&s&&l?(o=s,l.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);l.setState("renderedItems",i),u.setState("renderedItems",i)};i$(u,()=>i0(l)),i$(l,()=>i2(l,["items"],e=>{u.setState("items",e.items)})),i$(l,()=>i2(l,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let n=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>c(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),n=[...e].reverse().find(e=>!!e.element),i=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;i&&(null==n?void 0:n.element);){let e=i;if(n&&e.contains(n.element))return i;i=i.parentElement}return r6(i).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&n.observe(t.element);return()=>{cancelAnimationFrame(r),n.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},f=e=>d(e,e=>l.setState("items",e),!0);return{...u,registerItem:f,renderItem:e=>nA(f(e),d(e,e=>l.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=l.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:l}}(e),i=nb(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=iZ({...n.getState(),id:nb(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:i,baseElement:nb(null==r?void 0:r.baseElement,null),includesBaseElement:nb(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===i),moves:nb(null==r?void 0:r.moves,0),orientation:nb(e.orientation,null==r?void 0:r.orientation,"both"),rtl:nb(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:nb(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:nb(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:nb(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:nb(e.focusShift,null==r?void 0:r.focusShift,!1)},n,e.store);i$(a,()=>i9(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=sd(e.renderedItems))?void 0:r.id})}));let o=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:s=i.activeId,focusShift:l=i.focusShift,focusLoop:u=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:d=i.includesBaseElement,renderedItems:f=i.renderedItems,rtl:h=i.rtl}=t,m="up"===e||"down"===e,p="next"===e||"down"===e,A=m?iM(function(e,t,r){let n=sm(e);for(let i of e)for(let e=0;ee.id===s);if(!g)return null==(n=sd(A))?void 0:n.id;let v=A.some(e=>e.rowId),C=A.indexOf(g),B=A.slice(C+1),y=sf(B,g.rowId);if(o){let e=y.filter(e=>s?!e.disabled&&e.id!==s:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let b=u&&(m?"horizontal"!==u:"vertical"!==u),x=v&&c&&(m?"horizontal"!==c:"vertical"!==c),E=p?(!v||m)&&b&&d:!!m&&d;if(b){let e=sd(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[sc]:[],...e.slice(0,n)]}(x&&!E?A:sf(A,g.rowId),s,E),s);return null==e?void 0:e.id}if(x){let e=sd(E?y:B,s);return E?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let M=sd(y,s);return!M&&E?null:null==M?void 0:M.id};return{...n,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=sd(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=sd(iS(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("up",e))}}({...t,activeId:a,includesBaseElement:nb(t.includesBaseElement,null==i?void 0:i.includesBaseElement,!0),orientation:nb(t.orientation,null==i?void 0:i.orientation,"vertical"),focusLoop:nb(t.focusLoop,null==i?void 0:i.focusLoop,!0),focusWrap:nb(t.focusWrap,null==i?void 0:i.focusWrap,!0),virtualFocus:nb(t.virtualFocus,null==i?void 0:i.virtualFocus,!0)}),s=function({popover:e,...t}={}){let r=i8(t.store,i3(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));i5(t,r);let n=null==r?void 0:r.getState(),i=a2({...t,store:r}),a=nb(t.placement,null==n?void 0:n.placement,"bottom"),o=iZ({...i.getState(),placement:a,currentPlacement:a,anchorElement:nb(null==n?void 0:n.anchorElement,null),popoverElement:nb(null==n?void 0:n.popoverElement,null),arrowElement:nb(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...o,setAnchorElement:e=>o.setState("anchorElement",e),setPopoverElement:e=>o.setState("popoverElement",e),setArrowElement:e=>o.setState("arrowElement",e),render:()=>o.setState("rendered",Symbol("rendered"))}}({...t,placement:nb(t.placement,null==i?void 0:i.placement,"bottom-start")}),l=nb(t.value,null==i?void 0:i.value,t.defaultValue,""),u=nb(t.selectedValue,null==i?void 0:i.selectedValue,null==n?void 0:n.values,t.defaultSelectedValue,""),c=Array.isArray(u),d={...o.getState(),...s.getState(),value:l,selectedValue:u,resetValueOnSelect:nb(t.resetValueOnSelect,null==i?void 0:i.resetValueOnSelect,c),resetValueOnHide:nb(t.resetValueOnHide,null==i?void 0:i.resetValueOnHide,c&&!e),activeValue:null==i?void 0:i.activeValue},f=iZ(d,o,s,r);return sp&&i$(f,()=>i9(f,["virtualFocus"],()=>{f.setState("virtualFocus",!1)})),i$(f,()=>{if(e)return nA(i9(f,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),i9(e,["values"],e=>{f.setState("selectedValue",e.values)}))}),i$(f,()=>i9(f,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||f.setState("value",l)})),i$(f,()=>i9(f,["open"],e=>{e.open||(f.setState("activeId",a),f.setState("moves",0))})),i$(f,()=>i9(f,["moves","activeId"],(e,t)=>{e.moves===t.moves&&f.setState("activeValue",void 0)})),i$(f,()=>i2(f,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=f.getState(),n=o.item(r);f.setState("activeValue",null==n?void 0:n.value)})),{...s,...o,...f,tag:e,setValue:e=>f.setState("value",e),resetValue:()=>f.setState("value",d.value),setSelectedValue:e=>f.setState("selectedValue",e)}}function sg(e={}){var t,r,n,i,a,o,s,l;let u;t=e,u=su();let[c,d]=ah(sA,e={id:nU((r=t={...t,tag:void 0!==t.tag?t.tag:u}).id),...r});return nj(d,[(n=e).tag]),af(c,n,"value","setValue"),af(c,n,"selectedValue","setSelectedValue"),af(c,n,"resetValueOnHide"),af(c,n,"resetValueOnSelect"),Object.assign((o=c,nj(s=d,[(l=n).popover]),af(o,l,"placement"),i=a0(o,s,l),a=i,nj(d,[n.store]),af(a,n,"items","setItems"),af(i=a,n,"activeId","setActiveId"),af(i,n,"includesBaseElement"),af(i,n,"virtualFocus"),af(i,n,"orientation"),af(i,n,"rtl"),af(i,n,"focusLoop"),af(i,n,"focusWrap"),af(i,n,"focusShift"),i),{tag:n.tag})}function sv(e={}){let t=sg(e);return(0,d.jsx)(iq,{value:t,children:e.children})}var sC=(0,f.createContext)(void 0),sB=n1(function(e){let[t,r]=(0,f.useState)();return ny(e={role:"group","aria-labelledby":t,...e=nK(e,e=>(0,d.jsx)(sC.Provider,{value:r,children:e}),[])})});nZ(function(e){return n0("div",sB(e))});var sy=n1(function({store:e,...t}){return sB(t)});nZ(function(e){return n0("div",sy(e))});var sb=n1(function({store:e,...t}){let r=iQ();return nv(e=e||r,!1),"grid"===nl(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=sy({store:e,...t})}),sx=nZ(function(e){return n0("div",sb(e))}),sE=n1(function(e){let t=(0,f.useContext)(sC),r=nU(e.id);return nH(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),ny(e={id:r,"aria-hidden":!0,...e})});nZ(function(e){return n0("div",sE(e))});var sM=n1(function({store:e,...t}){return sE(t)});nZ(function(e){return n0("div",sM(e))});var sS=n1(function(e){return sM(e)}),sF=nZ(function(e){return n0("div",sS(e))}),sT=e.i(38360);let sR={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},sw=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function sD(e,t,r={}){let{keys:n,threshold:i=sR.MATCHES,baseSort:a=sw,sorter:o=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:a,keyIndex:o}=t;return n!==a?n>a?-1:1:i===o?r(e,t):i{let s=sI(i,u,c),l=t,{minRanking:d,maxRanking:f,threshold:h}=a;return s=sR.MATCHES?s=d:s>f&&(s=f),s>e&&(e=s,r=o,n=h,l=i),{rankedValue:l,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:s,rank:sR.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:s,rank:sI(s,u,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:f,keyThreshold:h=i}=d;return f>=h&&e.push({...d,item:a,index:o}),e},[])).map(({item:e})=>e)}function sI(e,t,r){if(e=sG(e,r),(t=sG(t,r)).length>e.length)return sR.NO_MATCH;if(e===t)return sR.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),a=i.value;if(e.length===t.length&&0===a)return sR.EQUAL;if(0===a)return sR.STARTS_WITH;let o=i;for(;!o.done;){if(o.value>0&&" "===e[o.value-1])return sR.WORD_STARTS_WITH;o=n.next()}return a>0?sR.CONTAINS:1===t.length?sR.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return sR.NO_MATCH;return r=a-s,n=i/t.length,sR.MATCHES+1/r*n}(e,t)}function sG(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,sT.default)(e)),e}sD.rankings=sR;let sL={maxRanking:1/0,minRanking:-1/0};var sO=e.i(29402);let sP=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),sH={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/xPack2.vl2":"xPack2","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":"DMP (Discord Map Pack)"},s_={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},sk=(0,rR.getMissionList)().filter(e=>!sP.has(e)).map(e=>{let t,r=(0,rR.getMissionInfo)(e),[n]=(0,rR.getSourceAndPath)(r.resourcePath),i=(t=n.match(/^(.*)(\/[^/]+)$/))?t[1]:"",a=sH[n]??s_[i]??null;return{resourcePath:r.resourcePath,missionName:e,displayName:r.displayName,sourcePath:n,groupName:a,missionTypes:r.missionTypes}}),sU=new Map(sk.map(e=>[e.missionName,e])),sj=function(e){let t=new Map;for(let r of e){let e=t.get(r.groupName)??[];e.push(r),t.set(r.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,sO.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,sO.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(sk),sN="undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function sJ({mission:e}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"MissionSelect-itemHeader",children:[(0,d.jsx)("span",{className:"MissionSelect-itemName",children:e.displayName||e.missionName}),e.missionTypes.length>0&&(0,d.jsx)("span",{className:"MissionSelect-itemTypes",children:e.missionTypes.map(e=>(0,d.jsx)("span",{className:"MissionSelect-itemType","data-mission-type":e,children:e},e))})]}),(0,d.jsx)("span",{className:"MissionSelect-itemMissionName",children:e.missionName})]})}function sK({value:e,missionType:t,onChange:r}){let[n,i]=(0,f.useState)(""),a=(0,f.useRef)(null),o=(0,f.useRef)(t),s=sg({resetValueOnHide:!0,selectedValue:e,setSelectedValue:e=>{if(e){let t=o.current,n=(0,rR.getMissionInfo)(e).missionTypes;t&&n.includes(t)||(t=n[0]),r({missionName:e,missionType:t})}},setValue:e=>{(0,f.startTransition)(()=>i(e))}});(0,f.useEffect)(()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),a.current?.focus(),s.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]);let l=sU.get(e),u=(0,f.useMemo)(()=>n?{type:"flat",missions:sD(sk,n,{keys:["displayName","missionName","missionTypes","groupName"]})}:{type:"grouped",groups:sj},[n]),c=l?l.displayName||l.missionName:e,h="flat"===u.type?0===u.missions.length:0===u.groups.length,m=t=>(0,d.jsx)(ag,{value:t.missionName,className:"MissionSelect-item",focusOnHover:!0,onClick:n=>{if(n.target&&n.target instanceof HTMLElement){let i=n.target.dataset.missionType;i?(o.current=i,t.missionName===e&&r({missionName:t.missionName,missionType:i})):o.current=null}else o.current=null},children:(0,d.jsx)(sJ,{mission:t})},t.missionName);return(0,d.jsxs)(sv,{store:s,children:[(0,d.jsxs)("div",{className:"MissionSelect-inputWrapper",children:[(0,d.jsx)(ae,{ref:a,autoSelect:!0,placeholder:c,className:"MissionSelect-input",onFocus:()=>{document.exitPointerLock(),s.show()}}),(0,d.jsxs)("div",{className:"MissionSelect-selectedValue",children:[(0,d.jsx)("span",{className:"MissionSelect-selectedName",children:c}),t&&(0,d.jsx)("span",{className:"MissionSelect-itemType","data-mission-type":t,children:t})]}),(0,d.jsx)("kbd",{className:"MissionSelect-shortcut",children:sN?"⌘K":"^K"})]}),(0,d.jsx)(ss,{gutter:4,fitViewport:!0,className:"MissionSelect-popover",children:(0,d.jsxs)(aM,{className:"MissionSelect-list",children:["flat"===u.type?u.missions.map(m):u.groups.map(([e,t])=>e?(0,d.jsxs)(sx,{className:"MissionSelect-group",children:[(0,d.jsx)(sF,{className:"MissionSelect-groupLabel",children:e}),t.map(m)]},e):(0,d.jsx)(f.Fragment,{children:t.map(m)},"ungrouped")),h&&(0,d.jsx)("div",{className:"MissionSelect-noResults",children:"No missions found"})]})})]})}var sQ={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},sV=f.default.createContext&&f.default.createContext(sQ),sq=["attr","size","title"];function sX(){return(sX=Object.assign.bind()).apply(this,arguments)}function sW(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function sY(e){for(var t=1;tf.default.createElement(sZ,sX({attr:sY({},e.attr)},t),function e(t){return t&&t.map((t,r)=>f.default.createElement(t.tag,sY({key:r},t.attr),e(t.child)))}(e.child))}function sZ(e){var t=t=>{var r,{attr:n,size:i,title:a}=e,o=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,sq),s=i||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),f.default.createElement("svg",sX({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,o,{className:r,style:sY(sY({color:e.color||t.color},t.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),a&&f.default.createElement("title",null,a),e.children)};return void 0!==sV?f.default.createElement(sV.Consumer,null,e=>t(e)):t(sQ)}function s$(e){return sz({tag:"svg",attr:{viewBox:"0 0 288 512"},child:[{tag:"path",attr:{d:"M112 316.94v156.69l22.02 33.02c4.75 7.12 15.22 7.12 19.97 0L176 473.63V316.94c-10.39 1.92-21.06 3.06-32 3.06s-21.61-1.14-32-3.06zM144 0C64.47 0 0 64.47 0 144s64.47 144 144 144 144-64.47 144-144S223.53 0 144 0zm0 76c-37.5 0-68 30.5-68 68 0 6.62-5.38 12-12 12s-12-5.38-12-12c0-50.73 41.28-92 92-92 6.62 0 12 5.38 12 12s-5.38 12-12 12z"},child:[]}]})(e)}function s0(e){return sz({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"},child:[]}]})(e)}function s1({cameraRef:e}){let[t,r]=(0,f.useState)(!1),n=(0,f.useRef)(null),i=(0,f.useCallback)(async()=>{clearTimeout(n.current);let t=e.current;if(!t)return;let i=function({position:e,quaternion:t}){let r=e=>parseFloat(e.toFixed(3)),n=`${r(e.x)},${r(e.y)},${r(e.z)}`,i=`${r(t.x)},${r(t.y)},${r(t.z)},${r(t.w)}`;return`#c${n}~${i}`}(t),a=`${window.location.pathname}${window.location.search}${i}`,o=`${window.location.origin}${a}`;window.history.replaceState(null,"",a);try{await navigator.clipboard.writeText(o),r(!0),n.current=setTimeout(()=>{r(!1)},1300)}catch(e){console.error(e)}},[e]);return(0,d.jsxs)("button",{type:"button",className:"IconButton CopyCoordinatesButton","aria-label":"Copy coordinates URL",title:"Copy coordinates URL",onClick:i,"data-copied":t?"true":"false",children:[(0,d.jsx)(s$,{className:"MapPin"}),(0,d.jsx)(s0,{className:"ClipboardCheck"})]})}function s9({missionName:e,missionType:t,onChangeMission:r,cameraRef:n}){let{fogEnabled:i,setFogEnabled:a,fov:o,setFov:s,audioEnabled:l,setAudioEnabled:u,animationEnabled:c,setAnimationEnabled:f}=(0,eS.useSettings)(),{speedMultiplier:h,setSpeedMultiplier:m}=(0,eS.useControls)(),{debugMode:p,setDebugMode:A}=(0,eS.useDebug)();return(0,d.jsxs)("div",{id:"controls",onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,d.jsx)(sK,{value:e,missionType:t,onChange:r}),(0,d.jsx)(s1,{cameraRef:n}),(0,d.jsxs)("div",{className:"CheckboxField",children:[(0,d.jsx)("input",{id:"fogInput",type:"checkbox",checked:i,onChange:e=>{a(e.target.checked)}}),(0,d.jsx)("label",{htmlFor:"fogInput",children:"Fog?"})]}),(0,d.jsxs)("div",{className:"CheckboxField",children:[(0,d.jsx)("input",{id:"audioInput",type:"checkbox",checked:l,onChange:e=>{u(e.target.checked)}}),(0,d.jsx)("label",{htmlFor:"audioInput",children:"Audio?"})]}),(0,d.jsxs)("div",{className:"CheckboxField",children:[(0,d.jsx)("input",{id:"animationInput",type:"checkbox",checked:c,onChange:e=>{f(e.target.checked)}}),(0,d.jsx)("label",{htmlFor:"animationInput",children:"Animation?"})]}),(0,d.jsxs)("div",{className:"CheckboxField",children:[(0,d.jsx)("input",{id:"debugInput",type:"checkbox",checked:p,onChange:e=>{A(e.target.checked)}}),(0,d.jsx)("label",{htmlFor:"debugInput",children:"Debug?"})]}),(0,d.jsxs)("div",{className:"Field",children:[(0,d.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),(0,d.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:o,onChange:e=>s(parseInt(e.target.value))}),(0,d.jsx)("output",{htmlFor:"speedInput",children:o})]}),(0,d.jsxs)("div",{className:"Field",children:[(0,d.jsx)("label",{htmlFor:"speedInput",children:"Speed"}),(0,d.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:h,onChange:e=>m(parseFloat(e.target.value))})]})]})}let s2=f.forwardRef(({envMap:e,resolution:t=256,frames:r=1/0,makeDefault:n,children:i,...a},o)=>{let s=(0,eB.useThree)(({set:e})=>e),l=(0,eB.useThree)(({camera:e})=>e),u=(0,eB.useThree)(({size:e})=>e),c=f.useRef(null);f.useImperativeHandle(o,()=>c.current,[]);let d=f.useRef(null),h=function(e,t,r){let n=(0,eB.useThree)(e=>e.size),i=(0,eB.useThree)(e=>e.viewport),a="number"==typeof e?e:n.width*i.dpr,o=n.height*i.dpr,s=("number"==typeof e?void 0:e)||{},{samples:l=0,depth:u,...c}=s,d=null!=u?u:s.depthBuffer,h=f.useMemo(()=>{let e=new p.WebGLRenderTarget(a,o,{minFilter:p.LinearFilter,magFilter:p.LinearFilter,type:p.HalfFloatType,...c});return d&&(e.depthTexture=new p.DepthTexture(a,o,p.FloatType)),e.samples=l,e},[]);return f.useLayoutEffect(()=>{h.setSize(a,o),l&&(h.samples=l)},[l,h,a,o]),f.useEffect(()=>()=>h.dispose(),[]),h}(t);f.useLayoutEffect(()=>{a.manual||(c.current.aspect=u.width/u.height)},[u,a]),f.useLayoutEffect(()=>{c.current.updateProjectionMatrix()});let m=0,A=null,g="function"==typeof i;return(0,eC.useFrame)(t=>{g&&(r===1/0||m{if(n)return s(()=>({camera:c.current})),()=>s(()=>({camera:l}))},[c,n,s]),f.createElement(f.Fragment,null,f.createElement("perspectiveCamera",(0,eJ.default)({ref:c},a),!g&&i),f.createElement("group",{ref:d},g&&i(h.texture)))});function s3(){let{fov:e}=(0,eS.useSettings)();return(0,d.jsx)(s2,{makeDefault:!0,position:[0,256,0],fov:e})}var s8=e.i(51434),s5=e.i(81405);function s6(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function s4({showPanel:e=0,className:t,parent:r}){let n=function(e,t=[],r){let[n,i]=f.useState();return f.useLayoutEffect(()=>{let t=e();return i(t),s6(void 0,t),()=>s6(void 0,null)},t),n}(()=>new s5.default,[]);return f.useEffect(()=>{if(n){let i=r&&r.current||document.body;n.showPanel(e),null==i||i.appendChild(n.dom);let a=(null!=t?t:"").split(" ").filter(e=>e);a.length&&n.dom.classList.add(...a);let o=(0,h.j)(()=>n.begin()),s=(0,h.k)(()=>n.end());return()=>{a.length&&n.dom.classList.remove(...a),null==i||i.removeChild(n.dom),o(),s()}}},[r,n,t,e]),null}var s7=e.i(60099);function le(){let{debugMode:e}=(0,eS.useDebug)(),t=(0,f.useRef)(null);return(0,f.useEffect)(()=>{let e=t.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")}),e?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(s4,{className:"StatsPanel"}),(0,d.jsx)("axesHelper",{ref:t,args:[70],renderOrder:999,children:(0,d.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,d.jsx)(s7.Html,{position:[80,0,0],center:!0,children:(0,d.jsx)("span",{className:"AxisLabel","data-axis":"y",children:"Y"})}),(0,d.jsx)(s7.Html,{position:[0,80,0],center:!0,children:(0,d.jsx)("span",{className:"AxisLabel","data-axis":"z",children:"Z"})}),(0,d.jsx)(s7.Html,{position:[0,0,80],center:!0,children:(0,d.jsx)("span",{className:"AxisLabel","data-axis":"x",children:"X"})})]}):null}var lt=e.i(50361),lr=e.i(24540);function ln(e,t,r){try{return e(t)}catch(e){return(0,lr.l)("[nuqs] Error while parsing value `%s`: %O"+(r?" (for key `%s`)":""),t,e,r),null}}function li(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),ln(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}function la(e,t){return e.valueOf()===t.valueOf()}li({parse:e=>e,serialize:String}),li({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),li({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),li({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),li({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String}),li({parse:e=>"true"===e.toLowerCase(),serialize:String}),li({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:la}),li({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:la}),li({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:la});let lo=(0,lt.r)(),ls={};function ll(e,t,r,n,i,a){let o=!1,s=Object.entries(e).reduce((e,[s,l])=>{var u;let c=t?.[s]??s,d=n[c],f="multi"===l.type?[]:null,h=void 0===d?("multi"===l.type?r?.getAll(c):r?.get(c))??f:d;return i&&a&&((u=i[c]??f)===h||null!==u&&null!==h&&"string"!=typeof u&&"string"!=typeof h&&u.length===h.length&&u.every((e,t)=>e===h[t]))?e[s]=a[s]??null:(o=!0,e[s]=((0,lt.i)(h)?null:ln(l.parse,h,c))??null,i&&(i[c]=h)),e},{});if(!o){let t=Object.keys(e),r=Object.keys(a??{});o=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:o}}function lu(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}let lc=new rU,ld={toneMapping:p.NoToneMapping,outputColorSpace:p.SRGBColorSpace},lf=li({parse(e){let[t,r]=e.split("~"),n=(0,rR.getMissionInfo)(t).missionTypes;return r&&n.includes(r)||(r=n[0]),{missionName:t,missionType:r}},serialize:({missionName:e,missionType:t})=>1===(0,rR.getMissionInfo)(e).missionTypes.length?e:`${e}~${t}`,eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});function lh(){let[e,t]=function(e,t={}){let{parse:r,type:n,serialize:i,eq:a,defaultValue:o,...s}=t,[{[e]:l},u]=function(e,t={}){let r=(0,f.useId)(),n=(0,lr.i)(),i=(0,lr.a)(),{history:a="replace",scroll:o=n?.scroll??!1,shallow:s=n?.shallow??!0,throttleMs:l=lt.s.timeMs,limitUrlUpdates:u=n?.limitUrlUpdates,clearOnDefault:c=n?.clearOnDefault??!0,startTransition:d,urlKeys:h=ls}=t,m=Object.keys(e).join(","),p=(0,f.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,h[e]??e])),[m,JSON.stringify(h)]),A=(0,lr.r)(Object.values(p)),g=A.searchParams,v=(0,f.useRef)({}),C=(0,f.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),B=lt.t.useQueuedQueries(Object.values(p)),[y,b]=(0,f.useState)(()=>ll(e,h,g??new URLSearchParams,B).state),x=(0,f.useRef)(y);if((0,lr.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",r,m,y,g),Object.keys(v.current).join("&")!==Object.values(p).join("&")){let{state:t,hasChanged:n}=ll(e,h,g,B,v.current,x.current);n&&((0,lr.c)("[nuq+ %s `%s`] State changed: %O",r,m,{state:t,initialSearchParams:g,queuedQueries:B,queryRef:v.current,stateRef:x.current}),x.current=t,b(t)),v.current=Object.fromEntries(Object.entries(p).map(([t,r])=>[r,e[t]?.type==="multi"?g?.getAll(r):g?.get(r)??null]))}(0,f.useEffect)(()=>{let{state:t,hasChanged:n}=ll(e,h,g,B,v.current,x.current);n&&((0,lr.c)("[nuq+ %s `%s`] State changed: %O",r,m,{state:t,initialSearchParams:g,queuedQueries:B,queryRef:v.current,stateRef:x.current}),x.current=t,b(t))},[Object.values(p).map(e=>`${e}=${g?.getAll(e)}`).join("&"),JSON.stringify(B)]),(0,f.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:i})=>{b(a=>{let{defaultValue:o}=e[n],s=p[n],l=t??o??null;return Object.is(a[n]??o??null,l)?((0,lr.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",r,m,s,t,o,x.current),a):(x.current={...x.current,[n]:l},v.current[s]=i,(0,lr.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",r,m,s,t,o,x.current),x.current)})},t),{});for(let n of Object.keys(e)){let e=p[n];(0,lr.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",r,e,m),lo.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=p[n];(0,lr.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",r,e,m),lo.off(e,t[n])}}},[m,p]);let E=(0,f.useCallback)((t,n={})=>{let f,h=Object.fromEntries(Object.keys(e).map(e=>[e,null])),g="function"==typeof t?t(lu(x.current,C))??h:t??h;(0,lr.c)("[nuq+ %s `%s`] setState: %O",r,m,g);let v=0,B=!1,y=[];for(let[t,r]of Object.entries(g)){let h=e[t],m=p[t];if(!h||void 0===r)continue;(n.clearOnDefault??h.clearOnDefault??c)&&null!==r&&void 0!==h.defaultValue&&(h.eq??((e,t)=>e===t))(r,h.defaultValue)&&(r=null);let g=null===r?null:(h.serialize??String)(r);lo.emit(m,{state:r,query:g});let C={key:m,query:g,options:{history:n.history??h.history??a,shallow:n.shallow??h.shallow??s,scroll:n.scroll??h.scroll??o,startTransition:n.startTransition??h.startTransition??d}};if(n?.limitUrlUpdates?.method==="debounce"||u?.method==="debounce"||h.limitUrlUpdates?.method==="debounce"){!0===C.options.shallow&&console.warn((0,lr.s)(422));let e=n?.limitUrlUpdates?.timeMs??u?.timeMs??h.limitUrlUpdates?.timeMs??lt.s.timeMs,t=lt.t.push(C,e,A,i);vt(e),B?lt.n.flush(A,i):lt.n.getPendingPromise(A));return f??b},[m,a,s,o,l,u?.method,u?.timeMs,d,p,A.updateUrl,A.getSearchParamsSnapshot,A.rateLimitFactor,i,C]);return[(0,f.useMemo)(()=>lu(y,C),[y,C]),E]}({[e]:{parse:r??(e=>e),type:n,serialize:i,eq:a,defaultValue:o}},s);return[l,(0,f.useCallback)((t,r={})=>u(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,u])]}("mission",lf),r=(0,f.useCallback)(e=>{window.location.hash="",t(e)},[t]),{missionName:n,missionType:i}=e,[a,o]=(0,f.useState)(0),[s,l]=(0,f.useState)(!0),u=a<1;(0,f.useEffect)(()=>{if(u)l(!0);else{let e=setTimeout(()=>l(!1),500);return()=>clearTimeout(e)}},[u]),(0,f.useEffect)(()=>(window.setMissionName=e=>{let t=(0,rR.getMissionInfo)(e).missionTypes;r({missionName:e,missionType:t[0]})},window.getMissionList=rR.getMissionList,window.getMissionInfo=rR.getMissionInfo,()=>{delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo}),[r]);let c=(0,f.useCallback)((e,t=0)=>{o(t)},[]),h=(0,f.useRef)(null);return(0,d.jsx)(ed,{client:lc,children:(0,d.jsx)("main",{children:(0,d.jsxs)(eS.SettingsProvider,{children:[(0,d.jsxs)("div",{id:"canvasContainer",children:[s&&(0,d.jsxs)("div",{id:"loadingIndicator","data-complete":!u,children:[(0,d.jsx)("div",{className:"LoadingSpinner"}),(0,d.jsx)("div",{className:"LoadingProgress",children:(0,d.jsx)("div",{className:"LoadingProgress-bar",style:{width:`${100*a}%`}})}),(0,d.jsxs)("div",{className:"LoadingProgress-text",children:[Math.round(100*a),"%"]})]}),(0,d.jsx)(y,{frameloop:"always",gl:ld,shadows:{type:p.PCFShadowMap},onCreated:e=>{h.current=e.camera},children:(0,d.jsx)(rB,{children:(0,d.jsxs)(s8.AudioProvider,{children:[(0,d.jsx)(rG,{name:n,missionType:i,onLoadingChange:c},`${n}~${i}`),(0,d.jsx)(s3,{}),(0,d.jsx)(le,{}),(0,d.jsx)(r8,{})]})})})]}),(0,d.jsx)(s9,{missionName:n,missionType:i,onChangeMission:r,cameraRef:h})]})})})}function lm(){return(0,d.jsx)(f.Suspense,{children:(0,d.jsx)(lh,{})})}e.s(["default",()=>lm],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/5b1b8f9bd8f0faac.js b/docs/_next/static/chunks/5b1b8f9bd8f0faac.js deleted file mode 100644 index 139ac431..00000000 --- a/docs/_next/static/chunks/5b1b8f9bd8f0faac.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68027,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(43476),o=e.r(12354),i={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},u={fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"},s=function({error:e}){let t=e?.digest;return(0,n.jsxs)("html",{id:"__next_error__",children:[(0,n.jsx)("head",{}),(0,n.jsxs)("body",{children:[(0,n.jsx)(o.HandleISRError,{error:e}),(0,n.jsx)("div",{style:i,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("h2",{style:u,children:["Application error: a ",t?"server":"client","-side exception has occurred while loading ",window.location.hostname," (see the"," ",t?"server logs":"browser console"," for more information)."]}),t?(0,n.jsx)("p",{style:u,children:`Digest: ${t}`}):null]})})]})]})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},12354,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"HandleISRError",{enumerable:!0,get:function(){return o}});let n="undefined"==typeof window?e.r(63599).workAsyncStorage:void 0;function o({error:e}){if(n){let t=n.getStore();if(t?.isStaticGeneration)throw e&&console.error(e),e}return null}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},90317,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return c},createSnapshot:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class u{disable(){throw i}getStore(){}run(){throw i}exit(){throw i}enterWith(){throw i}static bind(e){return e}}let s="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function c(){return s?new s:new u}function a(e){return s?s.bind(e):u.bind(e)}function l(){return s?s.snapshot():function(e,...t){return e(...t)}}},42344,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,e.r(90317).createAsyncLocalStorage)()},63599,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=e.r(42344)},35451,(e,t,r)=>{var n={229:function(e){var t,r,n,o=e.exports={};function i(){throw Error("setTimeout has not been defined")}function u(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var c=[],a=!1,l=-1;function f(){a&&n&&(a=!1,n.length?c=n.concat(c):l=-1,c.length&&p())}function p(){if(!a){var e=s(f);a=!0;for(var t=c.length;t;){for(n=c,c=[];++l1)for(var r=1;r{"use strict";var n,o;t.exports=(null==(n=e.g.process)?void 0:n.env)&&"object"==typeof(null==(o=e.g.process)?void 0:o.env)?e.g.process:e.r(35451)},45689,(e,t,r)=>{"use strict";var n=Symbol.for("react.transitional.element");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return{$$typeof:n,type:e,key:o,ref:void 0!==(t=r.ref)?t:null,props:r}}r.Fragment=Symbol.for("react.fragment"),r.jsx=o,r.jsxs=o},43476,(e,t,r)=>{"use strict";t.exports=e.r(45689)},50740,(e,t,r)=>{"use strict";var n=e.i(47167),o=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.for("react.view_transition"),v=Symbol.iterator,_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,b={};function S(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||_}function O(){}function E(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||_}S.prototype.isReactComponent={},S.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},S.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},O.prototype=S.prototype;var T=E.prototype=new O;T.constructor=E,m(T,S.prototype),T.isPureReactComponent=!0;var w=Array.isArray;function j(){}var R={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function A(e,t,r){var n=r.ref;return{$$typeof:o,type:e,key:t,ref:void 0!==n?n:null,props:r}}function P(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var C=/\/+/g;function H(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function k(e,t,r){if(null==e)return e;var n=[],u=0;return!function e(t,r,n,u,s){var c,a,l,f=typeof t;("undefined"===f||"boolean"===f)&&(t=null);var p=!1;if(null===t)p=!0;else switch(f){case"bigint":case"string":case"number":p=!0;break;case"object":switch(t.$$typeof){case o:case i:p=!0;break;case y:return e((p=t._init)(t._payload),r,n,u,s)}}if(p)return s=s(t),p=""===u?"."+H(t,0):u,w(s)?(n="",null!=p&&(n=p.replace(C,"$&/")+"/"),e(s,r,n,"",function(e){return e})):null!=s&&(P(s)&&(c=s,a=n+(null==s.key||t&&t.key===s.key?"":(""+s.key).replace(C,"$&/")+"/")+p,s=A(c.type,a,c.props)),r.push(s)),1;p=0;var d=""===u?".":u+":";if(w(t))for(var h=0;h{"use strict";t.exports=e.r(50740)},18800,(e,t,r)=>{"use strict";var n=e.r(71645);function o(e){var t="https://react.dev/errors/"+e;if(1{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),t.exports=e.r(18800)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/88a69012eeffa5b8.js b/docs/_next/static/chunks/88a69012eeffa5b8.js deleted file mode 100644 index 4c97da31..00000000 --- a/docs/_next/static/chunks/88a69012eeffa5b8.js +++ /dev/null @@ -1,528 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,t,r)=>{t.exports=e.r(76562)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),a=RegExp(i,"g"),o=RegExp(i,"");function s(e){return n[e]}var l=function(e){return e.replace(a,s)};t.exports=l,t.exports.has=function(e){return!!e.match(o)},t.exports.remove=l},29402,(e,t,r)=>{var n,i,a,o,s="__lodash_hash_undefined__",l=1/0,u="[object Arguments]",c="[object Array]",d="[object Boolean]",f="[object Date]",h="[object Error]",m="[object Function]",p="[object Map]",A="[object Number]",g="[object Object]",v="[object Promise]",B="[object RegExp]",C="[object Set]",y="[object String]",b="[object Symbol]",x="[object WeakMap]",E="[object ArrayBuffer]",M="[object DataView]",F=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S=/^\w*$/,T=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,D=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,w=/^(?:0|[1-9]\d*)$/,G={};G["[object Float32Array]"]=G["[object Float64Array]"]=G["[object Int8Array]"]=G["[object Int16Array]"]=G["[object Int32Array]"]=G["[object Uint8Array]"]=G["[object Uint8ClampedArray]"]=G["[object Uint16Array]"]=G["[object Uint32Array]"]=!0,G[u]=G[c]=G[E]=G[d]=G[M]=G[f]=G[h]=G[m]=G[p]=G[A]=G[g]=G[B]=G[C]=G[y]=G[x]=!1;var L=e.g&&e.g.Object===Object&&e.g,P="object"==typeof self&&self&&self.Object===Object&&self,O=L||P||Function("return this")(),H=r&&!r.nodeType&&r,_=H&&t&&!t.nodeType&&t,k=_&&_.exports===H&&L.process,U=function(){try{return k&&k.binding("util")}catch(e){}}(),j=U&&U.isTypedArray;function N(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},eb.prototype.set=function(e,t){var r=this.__data__,n=eF(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ex.prototype.clear=function(){this.__data__={hash:new ey,map:new(el||eb),string:new ey}},ex.prototype.delete=function(e){return eL(this,e).delete(e)},ex.prototype.get=function(e){return eL(this,e).get(e)},ex.prototype.has=function(e){return eL(this,e).has(e)},ex.prototype.set=function(e,t){return eL(this,e).set(e,t),this},eE.prototype.add=eE.prototype.push=function(e){return this.__data__.set(e,s),this},eE.prototype.has=function(e){return this.__data__.has(e)},eM.prototype.clear=function(){this.__data__=new eb},eM.prototype.delete=function(e){return this.__data__.delete(e)},eM.prototype.get=function(e){return this.__data__.get(e)},eM.prototype.has=function(e){return this.__data__.has(e)},eM.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eb){var n=r.__data__;if(!el||n.length<199)return n.push([e,t]),this;r=this.__data__=new ex(n)}return r.set(e,t),this};var eS=(n=function(e,t){return e&&eT(e,t,e0)},function(e,t){if(null==e)return e;if(!eX(e))return n(e,t);for(var r=e.length,i=-1,a=Object(e);++is))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var c=-1,d=!0,f=1&i?new eE:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eY(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ez(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||ez(e)&&ee.call(e)==b}var e$=j?J(j):function(e){return ez(e)&&eW(e.length)&&!!G[ee.call(e)]};function e0(e){return eX(e)?function(e,t){var r=eV(e)||eQ(e)?function(e,t){for(var r=-1,n=Array(e);++rt||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;return l*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});l--;)s[l]=s[l].value;return s}(e,t,r))}},81405,(e,t,r)=>{var n;e.e,(n=function(){function e(e){return i.appendChild(e.dom),e}function t(e){for(var t=0;to+1e3&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:t}}).Panel=function(e,t,r){var n=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,l=48*o,u=3*o,c=2*o,d=3*o,f=15*o,h=74*o,m=30*o,p=document.createElement("canvas");p.width=s,p.height=l,p.style.cssText="width:80px;height:48px";var A=p.getContext("2d");return A.font="bold "+9*o+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=r,A.fillRect(0,0,s,l),A.fillStyle=t,A.fillText(e,u,c),A.fillRect(d,f,h,m),A.fillStyle=r,A.globalAlpha=.9,A.fillRect(d,f,h,m),{dom:p,update:function(l,g){n=Math.min(n,l),i=Math.max(i,l),A.fillStyle=r,A.globalAlpha=1,A.fillRect(0,0,s,f),A.fillStyle=t,A.fillText(a(l)+" "+e+" ("+a(n)+"-"+a(i)+")",u,c),A.drawImage(p,d+o,f,h-o,m,d,f,h-o,m),A.fillRect(d+h-o,f,o,m),A.fillStyle=r,A.globalAlpha=.9,A.fillRect(d+h-o,f,o,a((1-l/g)*m))}}},t.exports=n},31713,e=>{"use strict";let t,r,n,i,a,o,s,l;var u,c,d=e.i(43476),f=e.i(71645),h=e.i(18566),m=e.i(91037),p=e.i(8560),A=e.i(90072);e.s(["ACESFilmicToneMapping",()=>A.ACESFilmicToneMapping,"AddEquation",()=>A.AddEquation,"AddOperation",()=>A.AddOperation,"AdditiveAnimationBlendMode",()=>A.AdditiveAnimationBlendMode,"AdditiveBlending",()=>A.AdditiveBlending,"AgXToneMapping",()=>A.AgXToneMapping,"AlphaFormat",()=>A.AlphaFormat,"AlwaysCompare",()=>A.AlwaysCompare,"AlwaysDepth",()=>A.AlwaysDepth,"AlwaysStencilFunc",()=>A.AlwaysStencilFunc,"AmbientLight",()=>A.AmbientLight,"AnimationAction",()=>A.AnimationAction,"AnimationClip",()=>A.AnimationClip,"AnimationLoader",()=>A.AnimationLoader,"AnimationMixer",()=>A.AnimationMixer,"AnimationObjectGroup",()=>A.AnimationObjectGroup,"AnimationUtils",()=>A.AnimationUtils,"ArcCurve",()=>A.ArcCurve,"ArrayCamera",()=>A.ArrayCamera,"ArrowHelper",()=>A.ArrowHelper,"AttachedBindMode",()=>A.AttachedBindMode,"Audio",()=>A.Audio,"AudioAnalyser",()=>A.AudioAnalyser,"AudioContext",()=>A.AudioContext,"AudioListener",()=>A.AudioListener,"AudioLoader",()=>A.AudioLoader,"AxesHelper",()=>A.AxesHelper,"BackSide",()=>A.BackSide,"BasicDepthPacking",()=>A.BasicDepthPacking,"BasicShadowMap",()=>A.BasicShadowMap,"BatchedMesh",()=>A.BatchedMesh,"Bone",()=>A.Bone,"BooleanKeyframeTrack",()=>A.BooleanKeyframeTrack,"Box2",()=>A.Box2,"Box3",()=>A.Box3,"Box3Helper",()=>A.Box3Helper,"BoxGeometry",()=>A.BoxGeometry,"BoxHelper",()=>A.BoxHelper,"BufferAttribute",()=>A.BufferAttribute,"BufferGeometry",()=>A.BufferGeometry,"BufferGeometryLoader",()=>A.BufferGeometryLoader,"ByteType",()=>A.ByteType,"Cache",()=>A.Cache,"Camera",()=>A.Camera,"CameraHelper",()=>A.CameraHelper,"CanvasTexture",()=>A.CanvasTexture,"CapsuleGeometry",()=>A.CapsuleGeometry,"CatmullRomCurve3",()=>A.CatmullRomCurve3,"CineonToneMapping",()=>A.CineonToneMapping,"CircleGeometry",()=>A.CircleGeometry,"ClampToEdgeWrapping",()=>A.ClampToEdgeWrapping,"Clock",()=>A.Clock,"Color",()=>A.Color,"ColorKeyframeTrack",()=>A.ColorKeyframeTrack,"ColorManagement",()=>A.ColorManagement,"CompressedArrayTexture",()=>A.CompressedArrayTexture,"CompressedCubeTexture",()=>A.CompressedCubeTexture,"CompressedTexture",()=>A.CompressedTexture,"CompressedTextureLoader",()=>A.CompressedTextureLoader,"ConeGeometry",()=>A.ConeGeometry,"ConstantAlphaFactor",()=>A.ConstantAlphaFactor,"ConstantColorFactor",()=>A.ConstantColorFactor,"Controls",()=>A.Controls,"CubeCamera",()=>A.CubeCamera,"CubeDepthTexture",()=>A.CubeDepthTexture,"CubeReflectionMapping",()=>A.CubeReflectionMapping,"CubeRefractionMapping",()=>A.CubeRefractionMapping,"CubeTexture",()=>A.CubeTexture,"CubeTextureLoader",()=>A.CubeTextureLoader,"CubeUVReflectionMapping",()=>A.CubeUVReflectionMapping,"CubicBezierCurve",()=>A.CubicBezierCurve,"CubicBezierCurve3",()=>A.CubicBezierCurve3,"CubicInterpolant",()=>A.CubicInterpolant,"CullFaceBack",()=>A.CullFaceBack,"CullFaceFront",()=>A.CullFaceFront,"CullFaceFrontBack",()=>A.CullFaceFrontBack,"CullFaceNone",()=>A.CullFaceNone,"Curve",()=>A.Curve,"CurvePath",()=>A.CurvePath,"CustomBlending",()=>A.CustomBlending,"CustomToneMapping",()=>A.CustomToneMapping,"CylinderGeometry",()=>A.CylinderGeometry,"Cylindrical",()=>A.Cylindrical,"Data3DTexture",()=>A.Data3DTexture,"DataArrayTexture",()=>A.DataArrayTexture,"DataTexture",()=>A.DataTexture,"DataTextureLoader",()=>A.DataTextureLoader,"DataUtils",()=>A.DataUtils,"DecrementStencilOp",()=>A.DecrementStencilOp,"DecrementWrapStencilOp",()=>A.DecrementWrapStencilOp,"DefaultLoadingManager",()=>A.DefaultLoadingManager,"DepthFormat",()=>A.DepthFormat,"DepthStencilFormat",()=>A.DepthStencilFormat,"DepthTexture",()=>A.DepthTexture,"DetachedBindMode",()=>A.DetachedBindMode,"DirectionalLight",()=>A.DirectionalLight,"DirectionalLightHelper",()=>A.DirectionalLightHelper,"DiscreteInterpolant",()=>A.DiscreteInterpolant,"DodecahedronGeometry",()=>A.DodecahedronGeometry,"DoubleSide",()=>A.DoubleSide,"DstAlphaFactor",()=>A.DstAlphaFactor,"DstColorFactor",()=>A.DstColorFactor,"DynamicCopyUsage",()=>A.DynamicCopyUsage,"DynamicDrawUsage",()=>A.DynamicDrawUsage,"DynamicReadUsage",()=>A.DynamicReadUsage,"EdgesGeometry",()=>A.EdgesGeometry,"EllipseCurve",()=>A.EllipseCurve,"EqualCompare",()=>A.EqualCompare,"EqualDepth",()=>A.EqualDepth,"EqualStencilFunc",()=>A.EqualStencilFunc,"EquirectangularReflectionMapping",()=>A.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>A.EquirectangularRefractionMapping,"Euler",()=>A.Euler,"EventDispatcher",()=>A.EventDispatcher,"ExternalTexture",()=>A.ExternalTexture,"ExtrudeGeometry",()=>A.ExtrudeGeometry,"FileLoader",()=>A.FileLoader,"Float16BufferAttribute",()=>A.Float16BufferAttribute,"Float32BufferAttribute",()=>A.Float32BufferAttribute,"FloatType",()=>A.FloatType,"Fog",()=>A.Fog,"FogExp2",()=>A.FogExp2,"FramebufferTexture",()=>A.FramebufferTexture,"FrontSide",()=>A.FrontSide,"Frustum",()=>A.Frustum,"FrustumArray",()=>A.FrustumArray,"GLBufferAttribute",()=>A.GLBufferAttribute,"GLSL1",()=>A.GLSL1,"GLSL3",()=>A.GLSL3,"GreaterCompare",()=>A.GreaterCompare,"GreaterDepth",()=>A.GreaterDepth,"GreaterEqualCompare",()=>A.GreaterEqualCompare,"GreaterEqualDepth",()=>A.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>A.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>A.GreaterStencilFunc,"GridHelper",()=>A.GridHelper,"Group",()=>A.Group,"HalfFloatType",()=>A.HalfFloatType,"HemisphereLight",()=>A.HemisphereLight,"HemisphereLightHelper",()=>A.HemisphereLightHelper,"IcosahedronGeometry",()=>A.IcosahedronGeometry,"ImageBitmapLoader",()=>A.ImageBitmapLoader,"ImageLoader",()=>A.ImageLoader,"ImageUtils",()=>A.ImageUtils,"IncrementStencilOp",()=>A.IncrementStencilOp,"IncrementWrapStencilOp",()=>A.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>A.InstancedBufferAttribute,"InstancedBufferGeometry",()=>A.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>A.InstancedInterleavedBuffer,"InstancedMesh",()=>A.InstancedMesh,"Int16BufferAttribute",()=>A.Int16BufferAttribute,"Int32BufferAttribute",()=>A.Int32BufferAttribute,"Int8BufferAttribute",()=>A.Int8BufferAttribute,"IntType",()=>A.IntType,"InterleavedBuffer",()=>A.InterleavedBuffer,"InterleavedBufferAttribute",()=>A.InterleavedBufferAttribute,"Interpolant",()=>A.Interpolant,"InterpolateDiscrete",()=>A.InterpolateDiscrete,"InterpolateLinear",()=>A.InterpolateLinear,"InterpolateSmooth",()=>A.InterpolateSmooth,"InterpolationSamplingMode",()=>A.InterpolationSamplingMode,"InterpolationSamplingType",()=>A.InterpolationSamplingType,"InvertStencilOp",()=>A.InvertStencilOp,"KeepStencilOp",()=>A.KeepStencilOp,"KeyframeTrack",()=>A.KeyframeTrack,"LOD",()=>A.LOD,"LatheGeometry",()=>A.LatheGeometry,"Layers",()=>A.Layers,"LessCompare",()=>A.LessCompare,"LessDepth",()=>A.LessDepth,"LessEqualCompare",()=>A.LessEqualCompare,"LessEqualDepth",()=>A.LessEqualDepth,"LessEqualStencilFunc",()=>A.LessEqualStencilFunc,"LessStencilFunc",()=>A.LessStencilFunc,"Light",()=>A.Light,"LightProbe",()=>A.LightProbe,"Line",()=>A.Line,"Line3",()=>A.Line3,"LineBasicMaterial",()=>A.LineBasicMaterial,"LineCurve",()=>A.LineCurve,"LineCurve3",()=>A.LineCurve3,"LineDashedMaterial",()=>A.LineDashedMaterial,"LineLoop",()=>A.LineLoop,"LineSegments",()=>A.LineSegments,"LinearFilter",()=>A.LinearFilter,"LinearInterpolant",()=>A.LinearInterpolant,"LinearMipMapLinearFilter",()=>A.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>A.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>A.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>A.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>A.LinearSRGBColorSpace,"LinearToneMapping",()=>A.LinearToneMapping,"LinearTransfer",()=>A.LinearTransfer,"Loader",()=>A.Loader,"LoaderUtils",()=>A.LoaderUtils,"LoadingManager",()=>A.LoadingManager,"LoopOnce",()=>A.LoopOnce,"LoopPingPong",()=>A.LoopPingPong,"LoopRepeat",()=>A.LoopRepeat,"MOUSE",()=>A.MOUSE,"Material",()=>A.Material,"MaterialLoader",()=>A.MaterialLoader,"MathUtils",()=>A.MathUtils,"Matrix2",()=>A.Matrix2,"Matrix3",()=>A.Matrix3,"Matrix4",()=>A.Matrix4,"MaxEquation",()=>A.MaxEquation,"Mesh",()=>A.Mesh,"MeshBasicMaterial",()=>A.MeshBasicMaterial,"MeshDepthMaterial",()=>A.MeshDepthMaterial,"MeshDistanceMaterial",()=>A.MeshDistanceMaterial,"MeshLambertMaterial",()=>A.MeshLambertMaterial,"MeshMatcapMaterial",()=>A.MeshMatcapMaterial,"MeshNormalMaterial",()=>A.MeshNormalMaterial,"MeshPhongMaterial",()=>A.MeshPhongMaterial,"MeshPhysicalMaterial",()=>A.MeshPhysicalMaterial,"MeshStandardMaterial",()=>A.MeshStandardMaterial,"MeshToonMaterial",()=>A.MeshToonMaterial,"MinEquation",()=>A.MinEquation,"MirroredRepeatWrapping",()=>A.MirroredRepeatWrapping,"MixOperation",()=>A.MixOperation,"MultiplyBlending",()=>A.MultiplyBlending,"MultiplyOperation",()=>A.MultiplyOperation,"NearestFilter",()=>A.NearestFilter,"NearestMipMapLinearFilter",()=>A.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>A.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>A.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>A.NearestMipmapNearestFilter,"NeutralToneMapping",()=>A.NeutralToneMapping,"NeverCompare",()=>A.NeverCompare,"NeverDepth",()=>A.NeverDepth,"NeverStencilFunc",()=>A.NeverStencilFunc,"NoBlending",()=>A.NoBlending,"NoColorSpace",()=>A.NoColorSpace,"NoNormalPacking",()=>A.NoNormalPacking,"NoToneMapping",()=>A.NoToneMapping,"NormalAnimationBlendMode",()=>A.NormalAnimationBlendMode,"NormalBlending",()=>A.NormalBlending,"NormalGAPacking",()=>A.NormalGAPacking,"NormalRGPacking",()=>A.NormalRGPacking,"NotEqualCompare",()=>A.NotEqualCompare,"NotEqualDepth",()=>A.NotEqualDepth,"NotEqualStencilFunc",()=>A.NotEqualStencilFunc,"NumberKeyframeTrack",()=>A.NumberKeyframeTrack,"Object3D",()=>A.Object3D,"ObjectLoader",()=>A.ObjectLoader,"ObjectSpaceNormalMap",()=>A.ObjectSpaceNormalMap,"OctahedronGeometry",()=>A.OctahedronGeometry,"OneFactor",()=>A.OneFactor,"OneMinusConstantAlphaFactor",()=>A.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>A.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>A.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>A.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>A.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>A.OneMinusSrcColorFactor,"OrthographicCamera",()=>A.OrthographicCamera,"PCFShadowMap",()=>A.PCFShadowMap,"PCFSoftShadowMap",()=>A.PCFSoftShadowMap,"PMREMGenerator",()=>p.PMREMGenerator,"Path",()=>A.Path,"PerspectiveCamera",()=>A.PerspectiveCamera,"Plane",()=>A.Plane,"PlaneGeometry",()=>A.PlaneGeometry,"PlaneHelper",()=>A.PlaneHelper,"PointLight",()=>A.PointLight,"PointLightHelper",()=>A.PointLightHelper,"Points",()=>A.Points,"PointsMaterial",()=>A.PointsMaterial,"PolarGridHelper",()=>A.PolarGridHelper,"PolyhedronGeometry",()=>A.PolyhedronGeometry,"PositionalAudio",()=>A.PositionalAudio,"PropertyBinding",()=>A.PropertyBinding,"PropertyMixer",()=>A.PropertyMixer,"QuadraticBezierCurve",()=>A.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>A.QuadraticBezierCurve3,"Quaternion",()=>A.Quaternion,"QuaternionKeyframeTrack",()=>A.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>A.QuaternionLinearInterpolant,"R11_EAC_Format",()=>A.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>A.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>A.RED_RGTC1_Format,"REVISION",()=>A.REVISION,"RG11_EAC_Format",()=>A.RG11_EAC_Format,"RGBADepthPacking",()=>A.RGBADepthPacking,"RGBAFormat",()=>A.RGBAFormat,"RGBAIntegerFormat",()=>A.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>A.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>A.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>A.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>A.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>A.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>A.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>A.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>A.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>A.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>A.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>A.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>A.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>A.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>A.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>A.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>A.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>A.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>A.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>A.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>A.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>A.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>A.RGBDepthPacking,"RGBFormat",()=>A.RGBFormat,"RGBIntegerFormat",()=>A.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>A.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>A.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>A.RGB_ETC1_Format,"RGB_ETC2_Format",()=>A.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>A.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>A.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>A.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>A.RGDepthPacking,"RGFormat",()=>A.RGFormat,"RGIntegerFormat",()=>A.RGIntegerFormat,"RawShaderMaterial",()=>A.RawShaderMaterial,"Ray",()=>A.Ray,"Raycaster",()=>A.Raycaster,"RectAreaLight",()=>A.RectAreaLight,"RedFormat",()=>A.RedFormat,"RedIntegerFormat",()=>A.RedIntegerFormat,"ReinhardToneMapping",()=>A.ReinhardToneMapping,"RenderTarget",()=>A.RenderTarget,"RenderTarget3D",()=>A.RenderTarget3D,"RepeatWrapping",()=>A.RepeatWrapping,"ReplaceStencilOp",()=>A.ReplaceStencilOp,"ReverseSubtractEquation",()=>A.ReverseSubtractEquation,"RingGeometry",()=>A.RingGeometry,"SIGNED_R11_EAC_Format",()=>A.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>A.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>A.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>A.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>A.SRGBColorSpace,"SRGBTransfer",()=>A.SRGBTransfer,"Scene",()=>A.Scene,"ShaderChunk",()=>p.ShaderChunk,"ShaderLib",()=>p.ShaderLib,"ShaderMaterial",()=>A.ShaderMaterial,"ShadowMaterial",()=>A.ShadowMaterial,"Shape",()=>A.Shape,"ShapeGeometry",()=>A.ShapeGeometry,"ShapePath",()=>A.ShapePath,"ShapeUtils",()=>A.ShapeUtils,"ShortType",()=>A.ShortType,"Skeleton",()=>A.Skeleton,"SkeletonHelper",()=>A.SkeletonHelper,"SkinnedMesh",()=>A.SkinnedMesh,"Source",()=>A.Source,"Sphere",()=>A.Sphere,"SphereGeometry",()=>A.SphereGeometry,"Spherical",()=>A.Spherical,"SphericalHarmonics3",()=>A.SphericalHarmonics3,"SplineCurve",()=>A.SplineCurve,"SpotLight",()=>A.SpotLight,"SpotLightHelper",()=>A.SpotLightHelper,"Sprite",()=>A.Sprite,"SpriteMaterial",()=>A.SpriteMaterial,"SrcAlphaFactor",()=>A.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>A.SrcAlphaSaturateFactor,"SrcColorFactor",()=>A.SrcColorFactor,"StaticCopyUsage",()=>A.StaticCopyUsage,"StaticDrawUsage",()=>A.StaticDrawUsage,"StaticReadUsage",()=>A.StaticReadUsage,"StereoCamera",()=>A.StereoCamera,"StreamCopyUsage",()=>A.StreamCopyUsage,"StreamDrawUsage",()=>A.StreamDrawUsage,"StreamReadUsage",()=>A.StreamReadUsage,"StringKeyframeTrack",()=>A.StringKeyframeTrack,"SubtractEquation",()=>A.SubtractEquation,"SubtractiveBlending",()=>A.SubtractiveBlending,"TOUCH",()=>A.TOUCH,"TangentSpaceNormalMap",()=>A.TangentSpaceNormalMap,"TetrahedronGeometry",()=>A.TetrahedronGeometry,"Texture",()=>A.Texture,"TextureLoader",()=>A.TextureLoader,"TextureUtils",()=>A.TextureUtils,"Timer",()=>A.Timer,"TimestampQuery",()=>A.TimestampQuery,"TorusGeometry",()=>A.TorusGeometry,"TorusKnotGeometry",()=>A.TorusKnotGeometry,"Triangle",()=>A.Triangle,"TriangleFanDrawMode",()=>A.TriangleFanDrawMode,"TriangleStripDrawMode",()=>A.TriangleStripDrawMode,"TrianglesDrawMode",()=>A.TrianglesDrawMode,"TubeGeometry",()=>A.TubeGeometry,"UVMapping",()=>A.UVMapping,"Uint16BufferAttribute",()=>A.Uint16BufferAttribute,"Uint32BufferAttribute",()=>A.Uint32BufferAttribute,"Uint8BufferAttribute",()=>A.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>A.Uint8ClampedBufferAttribute,"Uniform",()=>A.Uniform,"UniformsGroup",()=>A.UniformsGroup,"UniformsLib",()=>p.UniformsLib,"UniformsUtils",()=>A.UniformsUtils,"UnsignedByteType",()=>A.UnsignedByteType,"UnsignedInt101111Type",()=>A.UnsignedInt101111Type,"UnsignedInt248Type",()=>A.UnsignedInt248Type,"UnsignedInt5999Type",()=>A.UnsignedInt5999Type,"UnsignedIntType",()=>A.UnsignedIntType,"UnsignedShort4444Type",()=>A.UnsignedShort4444Type,"UnsignedShort5551Type",()=>A.UnsignedShort5551Type,"UnsignedShortType",()=>A.UnsignedShortType,"VSMShadowMap",()=>A.VSMShadowMap,"Vector2",()=>A.Vector2,"Vector3",()=>A.Vector3,"Vector4",()=>A.Vector4,"VectorKeyframeTrack",()=>A.VectorKeyframeTrack,"VideoFrameTexture",()=>A.VideoFrameTexture,"VideoTexture",()=>A.VideoTexture,"WebGL3DRenderTarget",()=>A.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>A.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>A.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>A.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>A.WebGLRenderTarget,"WebGLRenderer",()=>p.WebGLRenderer,"WebGLUtils",()=>p.WebGLUtils,"WebGPUCoordinateSystem",()=>A.WebGPUCoordinateSystem,"WebXRController",()=>A.WebXRController,"WireframeGeometry",()=>A.WireframeGeometry,"WrapAroundEnding",()=>A.WrapAroundEnding,"ZeroCurvatureEnding",()=>A.ZeroCurvatureEnding,"ZeroFactor",()=>A.ZeroFactor,"ZeroSlopeEnding",()=>A.ZeroSlopeEnding,"ZeroStencilOp",()=>A.ZeroStencilOp,"createCanvasElement",()=>A.createCanvasElement,"error",()=>A.error,"getConsoleFunction",()=>A.getConsoleFunction,"log",()=>A.log,"setConsoleFunction",()=>A.setConsoleFunction,"warn",()=>A.warn,"warnOnce",()=>A.warnOnce],32009);var g=e.i(32009);function v(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let B=["x","y","top","bottom","left","right","width","height"];var C=e.i(46791);function y({ref:e,children:t,fallback:r,resize:n,style:i,gl:a,events:o=m.f,eventSource:s,eventPrefix:l,shadows:u,linear:c,flat:h,legacy:p,orthographic:A,frameloop:C,dpr:y,performance:b,raycaster:x,camera:E,scene:M,onPointerMissed:F,onCreated:S,...T}){f.useMemo(()=>(0,m.e)(g),[]);let R=(0,m.u)(),[D,I]=function({debounce:e,scroll:t,polyfill:r,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var i,a,o;let s=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[l,u]=(0,f.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,f.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:l,orientationHandler:null}),d=e?"number"==typeof e?e:e.scroll:null,h=e?"number"==typeof e?e:e.resize:null,m=(0,f.useRef)(!1);(0,f.useEffect)(()=>(m.current=!0,()=>void(m.current=!1)));let[p,A,g]=(0,f.useMemo)(()=>{let e=()=>{let e,t;if(!c.current.element)return;let{left:r,top:i,width:a,height:o,bottom:s,right:l,x:d,y:f}=c.current.element.getBoundingClientRect(),h={left:r,top:i,width:a,height:o,bottom:s,right:l,x:d,y:f};c.current.element instanceof HTMLElement&&n&&(h.height=c.current.element.offsetHeight,h.width=c.current.element.offsetWidth),Object.freeze(h),m.current&&(e=c.current.lastBounds,t=h,!B.every(r=>e[r]===t[r]))&&u(c.current.lastBounds=h)};return[e,h?v(e,h):e,d?v(e,d):e]},[u,n,d,h]);function C(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",g,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null),c.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",c.current.orientationHandler))}function y(){c.current.element&&(c.current.resizeObserver=new s(g),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(e=>e.addEventListener("scroll",g,{capture:!0,passive:!0})),c.current.orientationHandler=()=>{g()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",c.current.orientationHandler))}return i=g,a=!!t,(0,f.useEffect)(()=>{if(a)return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)},[i,a]),o=A,(0,f.useEffect)(()=>(window.addEventListener("resize",o),()=>void window.removeEventListener("resize",o)),[o]),(0,f.useEffect)(()=>{C(),y()},[t,g,A]),(0,f.useEffect)(()=>C,[]),[e=>{e&&e!==c.current.element&&(C(),c.current.element=e,c.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),y())},l,p]}({scroll:!0,debounce:{scroll:50,resize:0},...n}),w=f.useRef(null),G=f.useRef(null);f.useImperativeHandle(e,()=>w.current);let L=(0,m.a)(F),[P,O]=f.useState(!1),[H,_]=f.useState(!1);if(P)throw P;if(H)throw H;let k=f.useRef(null);(0,m.b)(()=>{let e=w.current;I.width>0&&I.height>0&&e&&(k.current||(k.current=(0,m.c)(e)),async function(){await k.current.configure({gl:a,scene:M,events:o,shadows:u,linear:c,flat:h,legacy:p,orthographic:A,frameloop:C,dpr:y,performance:b,raycaster:x,camera:E,size:I,onPointerMissed:(...e)=>null==L.current?void 0:L.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(s?(0,m.i)(s)?s.current:s:G.current),l&&e.setEvents({compute:(e,t)=>{let r=e[l+"X"],n=e[l+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==S||S(e)}}),k.current.render((0,d.jsx)(R,{children:(0,d.jsx)(m.E,{set:_,children:(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)(m.B,{set:O}),children:null!=t?t:null})})}))}())}),f.useEffect(()=>{let e=w.current;if(e)return()=>(0,m.d)(e)},[]);let U=s?"none":"auto";return(0,d.jsx)("div",{ref:G,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...i},...T,children:(0,d.jsx)("div",{ref:D,style:{width:"100%",height:"100%"},children:(0,d.jsx)("canvas",{ref:w,style:{display:"block"},children:r})})})}function b(e){return(0,d.jsx)(C.FiberProvider,{children:(0,d.jsx)(y,{...e})})}e.i(39695),e.i(98133),e.i(95087);var x=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.i(47167);var E={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},M=new class{#e=E;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},F="undefined"==typeof window||"Deno"in globalThis;function S(){}function T(e){return"number"==typeof e&&e>=0&&e!==1/0}function R(e,t){return Math.max(e+(t||0)-Date.now(),0)}function D(e,t){return"function"==typeof e?e(t):e}function I(e,t){return"function"==typeof e?e(t):e}function w(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==L(o,t.options))return!1}else if(!O(t.queryKey,o))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&(!i||i===t.state.fetchStatus)&&(!a||!!a(t))}function G(e,t){let{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(P(t.options.mutationKey)!==P(a))return!1}else if(!O(t.options.mutationKey,a))return!1}return(!n||t.state.status===n)&&(!i||!!i(t))}function L(e,t){return(t?.queryKeyHashFn||P)(e)}function P(e){return JSON.stringify(e,(e,t)=>U(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function O(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>O(e[r],t[r]))}var H=Object.prototype.hasOwnProperty;function _(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function k(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function U(e){if(!j(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!j(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function j(e){return"[object Object]"===Object.prototype.toString.call(e)}function N(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=k(t)&&k(r);if(!n&&!(U(t)&&U(r)))return r;let i=(n?t:Object.keys(t)).length,a=n?r:Object.keys(r),o=a.length,s=n?Array(o):{},l=0;for(let u=0;ur?n.slice(1):n}function K(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Q=Symbol();function V(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==Q?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}var X=new class extends x{#r;#n;#i;constructor(){super(),this.#i=e=>{if(!F&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#i=e,this.#n?.(),this.#n=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}},q=(r=[],n=0,i=e=>{e()},a=e=>{e()},o=function(e){setTimeout(e,0)},{batch:e=>{let t;n++;try{t=e()}finally{let e;--n||(e=r,r=[],e.length&&o(()=>{a(()=>{e.forEach(e=>{i(e)})})}))}return t},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s=e=>{n?r.push(e):o(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{a=e},setScheduler:e=>{o=e}}),W=new class extends x{#a=!0;#n;#i;constructor(){super(),this.#i=e=>{if(!F&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#n||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#i=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function Y(){let e,t,r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function z(e){return Math.min(1e3*2**e,3e4)}function Z(e){return(e??"online")!=="online"||W.isOnline()}var $=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ee(e){let t,r=!1,n=0,i=Y(),a=()=>X.isFocused()&&("always"===e.networkMode||W.isOnline())&&e.canRun(),o=()=>Z(e.networkMode)&&e.canRun(),s=e=>{"pending"===i.status&&(t?.(),i.resolve(e))},l=e=>{"pending"===i.status&&(t?.(),i.reject(e))},u=()=>new Promise(r=>{t=e=>{("pending"!==i.status||a())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===i.status&&e.onContinue?.()}),c=()=>{let t;if("pending"!==i.status)return;let o=0===n?e.initialPromise:void 0;try{t=o??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(s).catch(t=>{if("pending"!==i.status)return;let o=e.retry??3*!F,s=e.retryDelay??z,d="function"==typeof s?s(n,t):s,f=!0===o||"number"==typeof o&&n{M.setTimeout(e,d)}).then(()=>a()?void 0:u()).then(()=>{r?l(t):c()}))})};return{promise:i,status:()=>i.status,cancel:t=>{if("pending"===i.status){let r=new $(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:o,start:()=>(o()?c():u().then(c),i)}}var et=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T(this.gcTime)&&(this.#o=M.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(F?1/0:3e5))}clearGcTimeout(){this.#o&&(M.clearTimeout(this.#o),this.#o=void 0)}},er=class extends et{#s;#l;#u;#c;#d;#f;#h;constructor(e){super(),this.#h=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#s=ea(this.options),this.state=e.state??this.#s,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=ea(this.options);void 0!==e.data&&(this.setState(ei(e.data,e.dataUpdatedAt)),this.#s=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){let r=N(this.state.data,e,this.options);return this.#m({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#m({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#s)}isActive(){return this.observers.some(e=>!1!==I(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Q||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===D(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!R(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#h?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,t){let r;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},a=()=>{let e,r=V(this.options,t),n=(i(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#h=!1,this.options.persister)?this.options.persister(r,n,this):r(n)},o=(i(r={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),r);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#m({type:"fetch",meta:o.fetchOptions?.meta}),this.#d=ee({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof $&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof $){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#m({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#m(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...en(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...ei(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),q.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function en(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ei(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ea(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var eo=class extends x{constructor(e,t){super(),this.options=t,this.#c=e,this.#p=null,this.#A=Y(),this.bindMethods(),this.setOptions(t)}#c;#g=void 0;#v=void 0;#B=void 0;#C;#y;#A;#p;#b;#x;#E;#M;#F;#S;#T=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#g.addObserver(this),es(this.#g,this.options)?this.#R():this.updateResult(),this.#D())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return el(this.#g,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return el(this.#g,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#I(),this.#w(),this.#g.removeObserver(this)}setOptions(e){let t=this.options,r=this.#g;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof I(this.options.enabled,this.#g))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#G(),this.#g.setOptions(this.options),t._defaulted&&!_(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#g,observer:this});let n=this.hasListeners();n&&eu(this.#g,r,this.options,t)&&this.#R(),this.updateResult(),n&&(this.#g!==r||I(this.options.enabled,this.#g)!==I(t.enabled,this.#g)||D(this.options.staleTime,this.#g)!==D(t.staleTime,this.#g))&&this.#L();let i=this.#P();n&&(this.#g!==r||I(this.options.enabled,this.#g)!==I(t.enabled,this.#g)||i!==this.#S)&&this.#O(i)}getOptimisticResult(e){var t,r;let n=this.#c.getQueryCache().build(this.#c,e),i=this.createResult(n,e);return t=this,r=i,_(t.getCurrentResult(),r)||(this.#B=i,this.#y=this.options,this.#C=this.#g.state),i}getCurrentResult(){return this.#B}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#A.status||this.#A.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#T.add(e)}getCurrentQuery(){return this.#g}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#R({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#B))}#R(e){this.#G();let t=this.#g.fetch(this.options,e);return e?.throwOnError||(t=t.catch(S)),t}#L(){this.#I();let e=D(this.options.staleTime,this.#g);if(F||this.#B.isStale||!T(e))return;let t=R(this.#B.dataUpdatedAt,e);this.#M=M.setTimeout(()=>{this.#B.isStale||this.updateResult()},t+1)}#P(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#g):this.options.refetchInterval)??!1}#O(e){this.#w(),this.#S=e,!F&&!1!==I(this.options.enabled,this.#g)&&T(this.#S)&&0!==this.#S&&(this.#F=M.setInterval(()=>{(this.options.refetchIntervalInBackground||X.isFocused())&&this.#R()},this.#S))}#D(){this.#L(),this.#O(this.#P())}#I(){this.#M&&(M.clearTimeout(this.#M),this.#M=void 0)}#w(){this.#F&&(M.clearInterval(this.#F),this.#F=void 0)}createResult(e,t){let r,n=this.#g,i=this.options,a=this.#B,o=this.#C,s=this.#y,l=e!==n?e.state:this.#v,{state:u}=e,c={...u},d=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&es(e,t),o=r&&eu(e,n,t,i);(a||o)&&(c={...c,...en(u.data,e.options)}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:m}=c;r=c.data;let p=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===m){let e;a?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=a.data,p=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#E?.state.data,this.#E):t.placeholderData,void 0!==e&&(m="success",r=N(a?.data,e,t),d=!0)}if(t.select&&void 0!==r&&!p)if(a&&r===o?.data&&t.select===this.#b)r=this.#x;else try{this.#b=t.select,r=t.select(r),r=N(a?.data,r,t),this.#x=r,this.#p=null}catch(e){this.#p=e}this.#p&&(f=this.#p,r=this.#x,h=Date.now(),m="error");let A="fetching"===c.fetchStatus,g="pending"===m,v="error"===m,B=g&&A,C=void 0!==r,y={status:m,fetchStatus:c.fetchStatus,isPending:g,isSuccess:"success"===m,isError:v,isInitialLoading:B,isLoading:B,data:r,dataUpdatedAt:c.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:A,isRefetching:A&&!g,isLoadingError:v&&!C,isPaused:"paused"===c.fetchStatus,isPlaceholderData:d,isRefetchError:v&&C,isStale:ec(e,t),refetch:this.refetch,promise:this.#A,isEnabled:!1!==I(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===y.status?e.reject(y.error):void 0!==y.data&&e.resolve(y.data)},r=()=>{t(this.#A=y.promise=Y())},i=this.#A;switch(i.status){case"pending":e.queryHash===n.queryHash&&t(i);break;case"fulfilled":("error"===y.status||y.data!==i.value)&&r();break;case"rejected":("error"!==y.status||y.error!==i.reason)&&r()}}return y}updateResult(){let e=this.#B,t=this.createResult(this.#g,this.options);if(this.#C=this.#g.state,this.#y=this.options,void 0!==this.#C.data&&(this.#E=this.#g),_(t,e))return;this.#B=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#T.size)return!0;let n=new Set(r??this.#T);return this.options.throwOnError&&n.add("error"),Object.keys(this.#B).some(t=>this.#B[t]!==e[t]&&n.has(t))};this.#H({listeners:r()})}#G(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#g)return;let t=this.#g;this.#g=e,this.#v=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#D()}#H(e){q.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#B)}),this.#c.getQueryCache().notify({query:this.#g,type:"observerResultsUpdated"})})}};function es(e,t){return!1!==I(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&el(e,t,t.refetchOnMount)}function el(e,t,r){if(!1!==I(t.enabled,e)&&"static"!==D(t.staleTime,e)){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&ec(e,t)}return!1}function eu(e,t,r,n){return(e!==t||!1===I(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ec(e,r)}function ec(e,t){return!1!==I(t.enabled,e)&&e.isStaleByTime(D(t.staleTime,e))}var ed=f.createContext(void 0),ef=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,d.jsx)(ed.Provider,{value:e,children:t})),eh=f.createContext((l=!1,{clearReset:()=>{l=!1},reset:()=>{l=!0},isReset:()=>l})),em=f.createContext(!1);em.Provider;var ep=(e,t)=>void 0===t.state.data,eA=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function eg(e,t,r){let n=f.useContext(em),i=f.useContext(eh),a=(e=>{let t=f.useContext(ed);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t})(r),o=a.defaultQueryOptions(e);if(a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=n?"isRestoring":"optimistic",o.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=o.staleTime;o.staleTime="function"==typeof t?(...r)=>e(t(...r)):e(t),"number"==typeof o.gcTime&&(o.gcTime=Math.max(o.gcTime,1e3))}(o.suspense||o.throwOnError||o.experimental_prefetchInRender)&&!i.isReset()&&(o.retryOnMount=!1),f.useEffect(()=>{i.clearReset()},[i]);let s=!a.getQueryCache().get(o.queryHash),[l]=f.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),c=!n&&!1!==e.subscribed;if(f.useSyncExternalStore(f.useCallback(e=>{let t=c?l.subscribe(q.batchCalls(e)):S;return l.updateResult(),t},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o)},[o,l]),o?.suspense&&u.isPending)throw eA(o,l,i);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>{var a;return e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&void 0===e.data||(a=[e.error,n],"function"==typeof r?r(...a):!!r))})({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if(a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!F&&u.isLoading&&u.isFetching&&!n){let e=s?eA(o,l,i):a.getQueryCache().get(o.queryHash)?.promise;e?.catch(S).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}var ev=e.i(54970),eB=e.i(12979),eC=e.i(49774),ey=e.i(73949),eb=e.i(62395),ex=e.i(75567),eE=e.i(47071);let eM={value:!0},eF=` -vec3 terrainLinearToSRGB(vec3 linear) { - vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; - vec3 lower = linear * 12.92; - return mix(lower, higher, step(vec3(0.0031308), linear)); -} - -vec3 terrainSRGBToLinear(vec3 srgb) { - vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); - vec3 lower = srgb / 12.92; - return mix(lower, higher, step(vec3(0.04045), srgb)); -} - -// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines -// Returns 1.0 on grid lines, 0.0 elsewhere -float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); -} -`;var eS=e.i(79123),eT=e.i(47021),eR=e.i(48066);let eD={0:32,1:32,2:32,3:32,4:32,5:32};function eI({displacementMap:e,visibilityMask:t,textureNames:r,alphaTextures:n,detailTextureName:i,lightmap:a}){let{debugMode:o}=(0,eS.useDebug)(),s=(0,eE.useTexture)(r.map(e=>(0,eB.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,ex.setupTexture)(e))}),l=i?(0,eB.textureToUrl)(i):null,u=(0,eE.useTexture)(l??eB.FALLBACK_TEXTURE_URL,e=>{(0,ex.setupTexture)(e)}),c=(0,f.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:n,tiling:i,detailTexture:a=null,lightmap:o=null}){e.uniforms.sunLightPointsDown=eM;let s=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),n&&(e.uniforms.visibilityMask={value:n}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:i[r]??32}}),o&&(e.uniforms.terrainLightmap={value:o}),a&&(e.uniforms.detailTexture={value:a},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include -varying vec3 vTerrainWorldPos;`),e.vertexShader=e.vertexShader.replace("#include ",`#include -vTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;`)),e.fragmentShader=` -uniform sampler2D albedo0; -uniform sampler2D albedo1; -uniform sampler2D albedo2; -uniform sampler2D albedo3; -uniform sampler2D albedo4; -uniform sampler2D albedo5; -uniform sampler2D mask0; -uniform sampler2D mask1; -uniform sampler2D mask2; -uniform sampler2D mask3; -uniform sampler2D mask4; -uniform sampler2D mask5; -uniform float tiling0; -uniform float tiling1; -uniform float tiling2; -uniform float tiling3; -uniform float tiling4; -uniform float tiling5; -${n?"uniform sampler2D visibilityMask;":""} -${o?"uniform sampler2D terrainLightmap;":""} -uniform bool sunLightPointsDown; -${a?`uniform sampler2D detailTexture; -uniform float detailTiling; -uniform float detailFadeDistance; -varying vec3 vTerrainWorldPos;`:""} - -${eF} - -// Global variable to store shadow factor from RE_Direct for use in output calculation -float terrainShadowFactor = 1.0; -`+e.fragmentShader,n){let t="#include ";e.fragmentShader=e.fragmentShader.replace(t,`${t} - // Early discard for invisible areas (before fog/lighting) - float visibility = texture2D(visibilityMask, vMapUv).r; - if (visibility < 0.5) { - discard; - } - `)}e.fragmentShader=e.fragmentShader.replace("#include ",` - // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js) - vec2 baseUv = vMapUv; - vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb; - ${s>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":""} - ${s>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":""} - ${s>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":""} - ${s>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":""} - ${s>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":""} - - // Sample alpha masks for all layers (use R channel) - // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices), - // but GPU linear filtering samples at texel centers. This offset aligns them. - vec2 alphaUv = baseUv + vec2(0.5 / 256.0); - float a0 = texture2D(mask0, alphaUv).r; - ${s>1?"float a1 = texture2D(mask1, alphaUv).r;":""} - ${s>2?"float a2 = texture2D(mask2, alphaUv).r;":""} - ${s>3?"float a3 = texture2D(mask3, alphaUv).r;":""} - ${s>4?"float a4 = texture2D(mask4, alphaUv).r;":""} - ${s>5?"float a5 = texture2D(mask5, alphaUv).r;":""} - - // Torque-style additive weighted blending (blender.cc): - // result = tex0 * alpha0 + tex1 * alpha1 + tex2 * alpha2 + ... - // Each layer's alpha map defines its contribution weight. - vec3 blended = c0 * a0; - ${s>1?"blended += c1 * a1;":""} - ${s>2?"blended += c2 * a2;":""} - ${s>3?"blended += c3 * a3;":""} - ${s>4?"blended += c4 * a4;":""} - ${s>5?"blended += c5 * a5;":""} - - // Assign to diffuseColor before lighting - vec3 textureColor = blended; - - ${a?`// Detail texture blending (Torque-style multiplicative blend) - // Sample detail texture at high frequency tiling - vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb; - - // Calculate distance-based fade factor using world positions - // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance - float distToCamera = distance(vTerrainWorldPos, cameraPosition); - float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0); - - // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor) - // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray - // Direct multiplication adds subtle darkening for surface detail - textureColor *= mix(vec3(1.0), detailColor, detailFade);`:""} - - // Store blended texture in diffuseColor (still in linear space here) - // We'll convert to sRGB in the output calculation - diffuseColor.rgb = textureColor; -`),o&&(e.fragmentShader=e.fragmentShader.replace("#include ",`#include - -// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting -#undef RE_Direct -void RE_Direct_TerrainShadow( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - // Torque lighting (terrLighting.cc): if light points up, terrain gets only ambient - // This prevents shadow acne from light hitting terrain backfaces - if (!sunLightPointsDown) { - terrainShadowFactor = 0.0; - return; - } - // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js) - // Extract shadow factor by comparing to original sun color - #if ( NUM_DIR_LIGHTS > 0 ) - vec3 originalSunColor = directionalLights[0].color; - float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b); - float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b); - terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0); - #endif - // Don't add to reflectedLight - we'll compute lighting in gamma space at output -} -#define RE_Direct RE_Direct_TerrainShadow - -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include -// Clear indirect diffuse - we'll compute ambient in gamma space -#if defined( RE_IndirectDiffuse ) - irradiance = vec3(0.0); -#endif -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include - // Clear Three.js lighting - we compute everything in gamma space - reflectedLight.directDiffuse = vec3(0.0); - reflectedLight.indirectDiffuse = vec3(0.0); -`)),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style terrain lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space -{ - // Get texture in sRGB space (undo Three.js linear decode) - vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb); - - ${o?` - // Sample terrain lightmap for smooth NdotL - vec2 lightmapUv = vMapUv + vec2(0.5 / 512.0); - float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r; - - // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file) - // Three.js interprets them as linear, but the numerical values are preserved - #if ( NUM_DIR_LIGHTS > 0 ) - vec3 sunColorSRGB = directionalLights[0].color; - #else - vec3 sunColorSRGB = vec3(0.7); - #endif - vec3 ambientColorSRGB = ambientLightColor; - - // Torque formula (terrLighting.cc:471-483): - // lighting = ambient + NdotL * shadowFactor * sunColor - // Clamp lighting to [0,1] before multiplying by texture - vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0); - `:` - // No lightmap - use simple ambient lighting - vec3 lightingSRGB = ambientLightColor; - `} - - // Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space - vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); - - // Convert back to linear for Three.js output pipeline - outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance; -} -#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`#if DEBUG_MODE - // Debug mode: overlay green grid matching terrain grid squares (256x256) - float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); - vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green - gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); -#endif - -#include `)}({shader:e,baseTextures:s,alphaTextures:n,visibilityMask:t,tiling:eD,detailTexture:l?u:null,lightmap:a}),(0,eT.injectCustomFog)(e,eR.globalFogUniforms)},[s,n,t,u,l,a]),h=(0,f.useRef)(null);(0,f.useEffect)(()=>{let e=h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!o,e.needsUpdate=!0)},[o]);let m=`${l?"detail":"nodetail"}-${a?"lightmap":"nolightmap"}`;return(0,d.jsx)("meshLambertMaterial",{ref:h,map:e,depthWrite:!0,side:A.FrontSide,defines:{DEBUG_MODE:+!!o},onBeforeCompile:c},m)}function ew({displacementMap:e,visibilityMask:t,textureNames:r,alphaTextures:n,detailTextureName:i,lightmap:a}){return(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),children:(0,d.jsx)(eI,{displacementMap:e,visibilityMask:t,textureNames:r,alphaTextures:n,detailTextureName:i,lightmap:a})})}let eG=(0,f.memo)(function({tileX:e,tileZ:t,blockSize:r,basePosition:n,textureNames:i,geometry:a,displacementMap:o,visibilityMask:s,alphaTextures:l,detailTextureName:u,lightmap:c,visible:h=!0}){let m=(0,f.useMemo)(()=>{let i=r/2;return[n.x+e*r+i,0,n.z+t*r+i]},[e,t,r,n]);return(0,d.jsx)("mesh",{position:m,geometry:a,castShadow:!0,receiveShadow:!0,visible:h,children:(0,d.jsx)(ew,{displacementMap:o,visibilityMask:s,textureNames:i,alphaTextures:l,detailTextureName:u,lightmap:c})})});var eL=e.i(77482);function eP(e){return(0,eL.useRuntime)().getObjectByName(e)}function eO(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,n=r>>8&255,i=r>>16,a=256*n;for(let r=0;r0?t:(0,eb.getFloat)(e,"visibleDistance")??600}(),o=(0,ey.useThree)(e=>e.camera),s=(0,f.useMemo)(()=>{let e=-(128*r);return{x:e,z:e}},[r]),l=(0,f.useMemo)(()=>{let t=(0,eb.getProperty)(e,"emptySquares");return t?t.split(" ").map(e=>parseInt(e,10)):[]},[e]),{data:u}=eg({queryKey:["terrain",t],queryFn:()=>(0,eB.loadTerrain)(t)},eo,void 0),c=(0,f.useMemo)(()=>{if(!u)return null;let e=function(e,t){let r=new A.BufferGeometry,n=new Float32Array(198147),i=new Float32Array(198147),a=new Float32Array(132098),o=new Uint32Array(393216),s=0,l=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let o=257*t+r;n[3*o]=r*l-e/2,n[3*o+1]=e/2-t*l,n[3*o+2]=0,i[3*o]=0,i[3*o+1]=0,i[3*o+2]=1,a[2*o]=r/256,a[2*o+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,n=r+1,i=(e+1)*257+t,a=i+1;((t^e)&1)==0?(o[s++]=r,o[s++]=i,o[s++]=a,o[s++]=r,o[s++]=a,o[s++]=n):(o[s++]=r,o[s++]=i,o[s++]=n,o[s++]=n,o[s++]=i,o[s++]=a)}return r.setIndex(new A.BufferAttribute(o,1)),r.setAttribute("position",new A.Float32BufferAttribute(n,3)),r.setAttribute("normal",new A.Float32BufferAttribute(i,3)),r.setAttribute("uv",new A.Float32BufferAttribute(a,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(256*r,0);return!function(e,t,r){let n=e.attributes.position,i=e.attributes.uv,a=e.attributes.normal,o=n.array,s=i.array,l=a.array,u=n.count,c=(e,r)=>(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let n=Math.floor(e=Math.max(0,Math.min(255,e))),i=Math.floor(r=Math.max(0,Math.min(255,r))),a=Math.min(n+1,255),o=Math.min(i+1,255),s=e-n,l=r-i;return(t[256*i+n]/65535*2048*(1-s)+t[256*i+a]/65535*2048*s)*(1-l)+(t[256*o+n]/65535*2048*(1-s)+t[256*o+a]/65535*2048*s)*l};for(let e=0;e0?(m/=g,p/=g,A/=g):(m=0,p=1,A=0),l[3*e]=m,l[3*e+1]=p,l[3*e+2]=A}n.needsUpdate=!0,a.needsUpdate=!0}(e,u.heightMap,r),e},[r,u]),h=eP("Sun"),m=(0,f.useMemo)(()=>{if(!h)return new A.Vector3(.57735,-.57735,.57735);let[e,t,r]=((0,eb.getProperty)(h,"direction")??"0.57735 0.57735 -0.57735").split(" ").map(e=>parseFloat(e)),n=Math.sqrt(e*e+r*r+t*t);return new A.Vector3(e/n,r/n,t/n)},[h]),p=(0,f.useMemo)(()=>u?function(e,t,r){let n=(t,r)=>{let n=Math.max(0,Math.min(255,t)),i=Math.max(0,Math.min(255,r)),a=Math.floor(n),o=Math.floor(i),s=Math.min(a+1,255),l=Math.min(o+1,255),u=n-a,c=i-o;return((e[256*o+a]/65535*(1-u)+e[256*o+s]/65535*u)*(1-c)+(e[256*l+a]/65535*(1-u)+e[256*l+s]/65535*u)*c)*2048},i=new A.Vector3(-t.x,-t.y,-t.z).normalize(),a=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let o=t/2+.25,s=e/2+.25,l=n(o,s),u=n(o-.5,s),c=n(o+.5,s),d=n(o,s-.5),f=-((n(o,s+.5)-d)/1),h=-((c-u)/1),m=Math.sqrt(f*f+r*r+h*h),p=Math.max(0,f/m*i.x+r/m*i.y+h/m*i.z),A=1;p>0&&(A=function(e,t,r,n,i,a){let o=n.z/i,s=n.x/i,l=n.y,u=Math.sqrt(o*o+s*s);if(u<1e-4)return 1;let c=.5/u,d=o*c,f=s*c,h=l*c,m=e,p=t,A=r+.1;for(let e=0;e<768&&(m+=d,p+=f,A+=h,!(m<0)&&!(m>=256)&&!(p<0)&&!(p>=256)&&!(A>2048));e++)if(A{if(!u)return null;let e=function(e){let t=new Float32Array(e.length);for(let r=0;reO(l),[l]),B=(0,f.useMemo)(()=>eO([]),[]),C=(0,f.useMemo)(()=>u?u.alphaMaps.map(e=>(0,ex.setupMask)(e)):null,[u]),y=(0,f.useMemo)(()=>{let e=2*Math.ceil(a/i)+1;return e*e-1},[a,i]),b=(0,f.useMemo)(()=>Array.from({length:y},(e,t)=>t),[y]),[x,E]=(0,f.useState)(()=>Array(y).fill(null)),M=(0,f.useRef)({xStart:0,xEnd:0,zStart:0,zEnd:0});return((0,eC.useFrame)(()=>{let e=o.position.x-s.x,t=o.position.z-s.z,r=Math.floor((e-a)/i),n=Math.ceil((e+a)/i),l=Math.floor((t-a)/i),u=Math.ceil((t+a)/i),c=M.current;if(r===c.xStart&&n===c.xEnd&&l===c.zStart&&u===c.zEnd)return;c.xStart=r,c.xEnd=n,c.zStart=l,c.zEnd=u;let d=[];for(let e=r;e{let t=x[e];return(0,d.jsx)(eG,{tileX:t?.tileX??0,tileZ:t?.tileZ??0,blockSize:i,basePosition:s,textureNames:u.textureNames,geometry:c,displacementMap:g,visibilityMask:B,alphaTextures:C,detailTextureName:n,lightmap:p,visible:null!==t},e)})]}):null}),e_=(0,f.createContext)(null);function ek(){return(0,f.useContext)(e_)}var eU=f;let ej=(0,eU.createContext)(null),eN={didCatch:!1,error:null};class eJ extends eU.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=eN}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,n=arguments.length,i=Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,n)){var i,a;null==(i=(a=this.props).onReset)||i.call(a,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(eN)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(r)o=(0,eU.createElement)(r,e);else if(void 0!==n)o=n;else throw a}return(0,eU.createElement)(ej.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}var eK=e.i(31067),eQ=A;function eV(e,t){if(t===A.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==A.TriangleFanDrawMode&&t!==A.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e=2.0 are supported."));return}let s=new tR(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}s.setExtensions(a),s.setPlugins(o),s.parse(r,n)}parseAsync(e,t){let r=this;return new Promise(function(n,i){r.parse(e,t,n,i)})}}function eZ(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let e$={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class e0{constructor(e){this.parser=e,this.name=e$.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,i.source,a)}}class ti{constructor(e){this.parser=e,this.name=e$.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=n.images[a.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,a.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class ta{constructor(e){this.parser=e,this.name=e$.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=n.images[a.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,a.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class to{constructor(e){this.name=e$.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return n.then(function(t){let r=e.byteOffset||0,n=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}}}class ts{constructor(e){this.name=e$.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==tA.TRIANGLES&&e.mode!==tA.TRIANGLE_STRIP&&e.mode!==tA.TRIANGLE_FAN&&void 0!==e.mode)return null;let n=r.extensions[this.name].attributes,i=[],a={};for(let e in n)i.push(this.parser.getDependency("accessor",n[e]).then(t=>(a[e]=t,a[e])));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],n=e[0].count,i=[];for(let e of r){let t=new eQ.Matrix4,r=new eQ.Vector3,o=new eQ.Quaternion,s=new eQ.Vector3(1,1,1),l=new eQ.InstancedMesh(e.geometry,e.material,n);for(let e=0;e=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},tb={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},tx={CUBICSPLINE:void 0,LINEAR:eQ.InterpolateLinear,STEP:eQ.InterpolateDiscrete};function tE(e,t,r){for(let n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function tM(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function tF(e){let t="",r=Object.keys(e).sort();for(let n=0,i=r.length;n-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&i<98?this.textureLoader=new eQ.TextureLoader(this.options.manager):this.textureLoader=new eQ.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new eQ.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let a={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return tE(i,a,n),tM(a,n),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r{let r=this.associations.get(e);for(let[n,a]of(null!=r&&this.associations.set(t,r),e.children.entries()))i(a,t.children[n])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&a.setY(t,d[e*s+1]),s>=3&&a.setZ(t,d[e*s+2]),s>=4&&a.setW(t,d[e*s+3]),s>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n],a=this.textureLoader;if(i.uri){let e=r.manager.getHandler(i.uri);null!==e&&(a=e)}return this.loadTextureImage(e,n,a)}loadTextureImage(e,t,r){let n=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[s])return this.textureCache[s];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(i.samplers||{})[a.sampler]||{};return t.magFilter=tv[r.magFilter]||eQ.LinearFilter,t.minFilter=tv[r.minFilter]||eQ.LinearMipmapLinearFilter,t.wrapS=tB[r.wrapS]||eQ.RepeatWrapping,t.wrapT=tB[r.wrapT]||eQ.RepeatWrapping,n.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=l,l}loadImageSource(e,t){let r=this.json,n=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let i=r.images[e],a=self.URL||self.webkitURL,o=i.uri||"",s=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then(function(e){s=!0;let t=new Blob([e],{type:i.mimeType});return o=a.createObjectURL(t)});else if(void 0===i.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(e){return new Promise(function(r,i){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new eQ.Texture(e);t.needsUpdate=!0,r(t)}),t.load(eQ.LoaderUtils.resolveURL(e,n.path),a,void 0,i)})}).then(function(e){var t;return!0===s&&a.revokeObjectURL(o),tM(e,i),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,n){let i=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((a=a.clone()).channel=r.texCoord),i.extensions[e$.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[e$.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=i.associations.get(a);a=i.extensions[e$.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return void 0!==n&&("number"==typeof n&&(n=3001===n?eW:eY),"colorSpace"in a?a.colorSpace=n:a.encoding=n===eW?3001:3e3),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,r=e.material,n=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new eQ.PointsMaterial,eQ.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new eQ.LineBasicMaterial,eQ.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(n||i||a){let e="ClonedMaterial:"+r.uuid+":";n&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return eQ.MeshStandardMaterial}loadMaterial(e){let t,r=this,n=this.json,i=this.extensions,a=n.materials[e],o={},s=a.extensions||{},l=[];if(s[e$.KHR_MATERIALS_UNLIT]){let e=i[e$.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(o,a,r))}else{let n=a.pbrMetallicRoughness||{};if(o.color=new eQ.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],eY),o.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(r.assignTexture(o,"map",n.baseColorTexture,eW)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(r.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),l.push(r.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===a.doubleSided&&(o.side=eQ.DoubleSide);let u=a.alphaMode||"OPAQUE";if("BLEND"===u?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,"MASK"===u&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==eQ.MeshBasicMaterial&&(l.push(r.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new eQ.Vector2(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==eQ.MeshBasicMaterial&&(l.push(r.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==eQ.MeshBasicMaterial){let e=a.emissiveFactor;o.emissive=new eQ.Color().setRGB(e[0],e[1],e[2],eY)}return void 0!==a.emissiveTexture&&t!==eQ.MeshBasicMaterial&&l.push(r.assignTexture(o,"emissiveMap",a.emissiveTexture,eW)),Promise.all(l).then(function(){let n=new t(o);return a.name&&(n.name=a.name),tM(n,a),r.associations.set(n,{materials:e}),a.extensions&&tE(i,n,a),n})}createUniqueName(e){let t=eQ.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,n=this.primitiveCache,i=[];for(let a=0,o=e.length;a0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,n=t.weights.length;r1?new eQ.Group:1===t.length?t[0]:new eQ.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of n.associations)(e instanceof eQ.Material||e instanceof eQ.Texture)&&t.set(e,r);return e.traverse(e=>{let r=n.associations.get(e);null!=r&&t.set(e,r)}),t})(i),i})}_createAnimationTracks(e,t,r,n,i){let a,o=[],s=e.name?e.name:e.uuid,l=[];switch(tb[i.path]===tb.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(s),tb[i.path]){case tb.weights:a=eQ.NumberKeyframeTrack;break;case tb.rotation:a=eQ.QuaternionKeyframeTrack;break;case tb.position:case tb.scale:a=eQ.VectorKeyframeTrack;break;default:a=1===r.itemSize?eQ.NumberKeyframeTrack:eQ.VectorKeyframeTrack}let u=void 0!==n.interpolation?tx[n.interpolation]:eQ.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(n)},r,n)}decodeDracoFile(e,t,r,n){let i={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let n=JSON.stringify(t);if(tw.has(e)){let t=tw.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),tw.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new tI.BufferGeometry;e.index&&t.setIndex(new tI.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=tL.toString(),i=["/* draco decoder */",r,"\n/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,r=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(i),i.byteLength);try{let e=function(e,t,r,n){var i,a,o;let s,l,u,c,d,f,h=n.attributeIDs,m=n.attributeTypes,p=t.GetEncodedGeometryType(r);if(p===e.TRIANGULAR_MESH)d=new e.Mesh,f=t.DecodeBufferToMesh(r,d);else if(p===e.POINT_CLOUD)d=new e.PointCloud,f=t.DecodeBufferToPointCloud(r,d);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||0===d.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let A={index:null,attributes:[]};for(let r in h){let i,a,o=self[m[r]];if(n.useUniqueIDs)a=h[r],i=t.GetAttributeByUniqueId(d,a);else{if(-1===(a=t.GetAttributeId(d,e[h[r]])))continue;i=t.GetAttribute(d,a)}A.attributes.push(function(e,t,r,n,i,a){let o=a.num_components(),s=r.num_points()*o,l=s*i.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,a,u,l,c);let d=new i(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:n,array:d,itemSize:o}}(e,t,d,r,o,i))}return p===e.TRIANGULAR_MESH&&(i=e,a=t,o=d,s=3*o.num_faces(),l=4*s,u=i._malloc(l),a.GetTrianglesUInt32Array(o,l,u),c=new Uint32Array(i.HEAPF32.buffer,u,s).slice(),i._free(u),A.index={array:c,itemSize:1}),e.destroy(d),A}(t,r,o,a),i=e.attributes.map(e=>e.array.buffer);e.index&&i.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},i)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(o),t.destroy(r)}})}}}var tP=e.i(971);let tO=function(e){let t=new Map,r=new Map,n=e.clone();return function e(t,r,n){n(t,r);for(let i=0;i{let c={keys:s,deep:n,inject:o,castShadow:i,receiveShadow:a};if(Array.isArray(t=f.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return tO(t)}return t},[t,e])))return f.createElement("group",(0,eK.default)({},l,{ref:u}),t.map(e=>f.createElement(tH,(0,eK.default)({key:e.uuid,object:e},c))),r);let{children:d,...h}=function(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:r,inject:n,castShadow:i,receiveShadow:a}){let o={};for(let r of t)o[r]=e[r];return r&&(o.geometry&&"materialsOnly"!==r&&(o.geometry=o.geometry.clone()),o.material&&"geometriesOnly"!==r&&(o.material=o.material.clone())),n&&(o="function"==typeof n?{...o,children:n(e)}:f.isValidElement(n)?{...o,children:n}:{...o,...n}),e instanceof A.Mesh&&(i&&(o.castShadow=!0),a&&(o.receiveShadow=!0)),o}(t,c),m=t.type[0].toLowerCase()+t.type.slice(1);return f.createElement(m,(0,eK.default)({},h,l,{ref:u}),t.children.map(e=>"Bone"===e.type?f.createElement("primitive",(0,eK.default)({key:e.uuid,object:e},c)):f.createElement(tH,(0,eK.default)({key:e.uuid,object:e},c,{isChild:!0}))),r,d)}),t_=null,tk="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function tU(e=!0,r=!0,n){return i=>{n&&n(i),e&&(t_||(t_=new tG),t_.setDecoderPath("string"==typeof e?e:tk),i.setDRACOLoader(t_)),r&&i.setMeshoptDecoder((()=>{let e;if(t)return t;let r=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]),n=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(r)&&(i="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");let a=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let i=0;i{(e=t.instance).exports.__wasm_call_ctors()});function o(t,r,n,i,a,o){let s=e.exports.sbrk,l=n+3&-4,u=s(l*i),c=s(a.length),d=new Uint8Array(e.exports.memory.buffer);d.set(a,c);let f=t(u,n,i,c,a.length);if(0===f&&o&&o(u,l,i),r.set(d.subarray(u,u+n*i)),s(u-s(0)),0!==f)throw Error(`Malformed buffer data: ${f}`)}let s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:a,supported:!0,decodeVertexBuffer(t,r,n,i,a){o(e.exports.meshopt_decodeVertexBuffer,t,r,n,i,e.exports[s[a]])},decodeIndexBuffer(t,r,n,i){o(e.exports.meshopt_decodeIndexBuffer,t,r,n,i)},decodeIndexSequence(t,r,n,i){o(e.exports.meshopt_decodeIndexSequence,t,r,n,i)},decodeGltfBuffer(t,r,n,i,a,u){o(e.exports[l[a]],t,r,n,i,e.exports[s[u]])}}})())}}let tj=(e,t,r,n)=>(0,tP.useLoader)(ez,e,tU(t,r,n));tj.preload=(e,t,r,n)=>tP.useLoader.preload(ez,e,tU(t,r,n)),tj.clear=e=>tP.useLoader.clear(ez,e),tj.setDecoderPath=e=>{tk=e};var tN=e.i(89887);let tJ=` -vec3 interiorLinearToSRGB(vec3 linear) { - vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; - vec3 lower = linear * 12.92; - return mix(lower, higher, step(vec3(0.0031308), linear)); -} - -vec3 interiorSRGBToLinear(vec3 srgb) { - vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); - vec3 lower = srgb / 12.92; - return mix(lower, higher, step(vec3(0.04045), srgb)); -} - -// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines -// Returns 1.0 on grid lines, 0.0 elsewhere -float debugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); -} -`;function tK({materialName:e,material:t,lightMap:r}){let n=(0,eS.useDebug)(),i=n?.debugMode??!1,a=(0,eB.textureToUrl)(e),o=(0,eE.useTexture)(a,e=>(0,ex.setupTexture)(e)),s=new Set(t?.userData?.flag_names??[]).has("SelfIlluminating"),l=new Set(t?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),u=(0,f.useCallback)(e=>{let t;(0,eT.injectCustomFog)(e,eR.globalFogUniforms),t=l??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new A.Vector3(0,.4,1):new A.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include -${tJ} -uniform bool useSceneLighting; -uniform vec3 interiorDebugColor; -`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation -#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space -// Get texture in sRGB space (undo Three.js linear decode) -vec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb); - -// Compute lighting in sRGB space -vec3 lightingSRGB = vec3(0.0); - -if (useSceneLighting) { - // Three.js computed: reflectedLight = lighting \xd7 texture_linear / PI - // Extract pure lighting: lighting = reflectedLight \xd7 PI / texture_linear - vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001)); - vec3 extractedLighting = totalLight * PI / safeTexLinear; - // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors - // are sRGB values (Torque used them directly in gamma space). Three.js treats them - // as linear but the numerical values are the same. DO NOT convert to sRGB here! - // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap - // (sceneLighting.cc line 1785: tmp.clamp()) - lightingSRGB = clamp(extractedLighting, 0.0, 1.0); -} - -// Add lightmap contribution (for BOTH outside and inside surfaces) -// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load -// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here. -#ifdef USE_LIGHTMAP - // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back - lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb); -#endif -// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827) -lightingSRGB = clamp(lightingSRGB, 0.0, 1.0); - -// Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space -vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); - -// Convert back to linear for Three.js output pipeline -vec3 resultLinear = interiorSRGBToLinear(resultSRGB); - -// Reassign outgoingLight before opaque_fragment consumes it -outgoingLight = resultLinear + totalEmissiveRadiance; - -#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Debug mode: overlay colored grid on top of normal rendering -// Blue grid = SurfaceOutsideVisible (receives scene ambient light) -// Red grid = inside surface (no scene ambient light) -#if DEBUG_MODE && defined(USE_MAP) - // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide - float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); - gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); -#endif - -#include `)},[l]),c=(0,f.useRef)(null),h=(0,f.useRef)(null);(0,f.useEffect)(()=>{let e=c.current??h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let m={DEBUG_MODE:+!!i},p=`${l}`;return s?(0,d.jsx)("meshBasicMaterial",{ref:c,map:o,toneMapped:!1,defines:m,onBeforeCompile:u},p):(0,d.jsx)("meshLambertMaterial",{ref:h,map:o,lightMap:r,toneMapped:!1,defines:m,onBeforeCompile:u},p)}function tQ(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=A.SRGBColorSpace),t??null}function tV({node:e}){let t=(0,f.useMemo)(()=>e.material?Array.isArray(e.material)?e.material.map(e=>tQ(e)):[tQ(e.material)]:[],[e.material]);return(0,d.jsx)("mesh",{geometry:e.geometry,castShadow:!0,receiveShadow:!0,children:e.material?(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(e.material)?e.material.map((e,r)=>(0,d.jsx)(tK,{materialName:e.userData.resource_path,material:e,lightMap:t[r]},r)):(0,d.jsx)(tK,{materialName:e.material.userData.resource_path,material:e.material,lightMap:t[0]})}):null})}let tX=(0,f.memo)(({object:e,interiorFile:t})=>{let{nodes:r}=tj((0,eB.interiorToUrl)(t)),n=(0,eS.useDebug)(),i=n?.debugMode??!1;return(0,d.jsxs)("group",{rotation:[0,-Math.PI/2,0],children:[Object.entries(r).filter(([,e])=>e.isMesh).map(([e,t])=>(0,d.jsx)(tV,{node:t},e)),i?(0,d.jsxs)(tN.FloatingLabel,{children:[e._id,": ",t]}):null]})});function tq({color:e,label:t}){return(0,d.jsxs)("mesh",{children:[(0,d.jsx)("boxGeometry",{args:[10,10,10]}),(0,d.jsx)("meshStandardMaterial",{color:e,wireframe:!0}),t?(0,d.jsx)(tN.FloatingLabel,{color:e,children:t}):null]})}function tW({label:e}){let t=(0,eS.useDebug)();return t?.debugMode?(0,d.jsx)(tq,{color:"red",label:e}):null}let tY=(0,f.memo)(function({object:e}){let t=(0,eb.getProperty)(e,"interiorFile"),r=(0,f.useMemo)(()=>(0,eb.getPosition)(e),[e]),n=(0,f.useMemo)(()=>(0,eb.getScale)(e),[e]),i=(0,f.useMemo)(()=>(0,eb.getRotation)(e),[e]);return(0,d.jsx)("group",{position:r,quaternion:i,scale:n,children:(0,d.jsx)(eJ,{fallback:(0,d.jsx)(tW,{label:`${e._id}: ${t}`}),children:(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)(tq,{color:"orange"}),children:(0,d.jsx)(tX,{object:e,interiorFile:t})})})})});function tz(e,{path:t}){let[r]=(0,tP.useLoader)(A.CubeTextureLoader,[e],e=>e.setPath(t));return r}tz.preload=(e,{path:t})=>tP.useLoader.preload(A.CubeTextureLoader,[e],e=>e.setPath(t));let tZ=()=>{};function t$(e){return e.wrapS=A.RepeatWrapping,e.wrapT=A.RepeatWrapping,e.minFilter=A.LinearFilter,e.magFilter=A.LinearFilter,e.colorSpace=A.NoColorSpace,e.needsUpdate=!0,e}let t0=` - attribute float alpha; - - uniform vec2 uvOffset; - - varying vec2 vUv; - varying float vAlpha; - - void main() { - // Apply UV offset for scrolling - vUv = uv + uvOffset; - vAlpha = alpha; - - vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - // Set depth to far plane so clouds are always visible and behind other geometry - gl_Position = pos.xyww; - } -`,t1=` - uniform sampler2D cloudTexture; - uniform float debugMode; - uniform int layerIndex; - - varying vec2 vUv; - varying float vAlpha; - - // Debug grid using screen-space derivatives for sharp, anti-aliased lines - float debugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); - } - - void main() { - vec4 texColor = texture2D(cloudTexture, vUv); - - // Tribes 2 uses GL_MODULATE: final = texture \xd7 vertex color - // Vertex color is white with varying alpha, so: - // Final RGB = Texture RGB \xd7 1.0 = Texture RGB - // Final Alpha = Texture Alpha \xd7 Vertex Alpha - float finalAlpha = texColor.a * vAlpha; - vec3 color = texColor.rgb; - - // Debug mode: overlay R/G/B grid for layers 0/1/2 - if (debugMode > 0.5) { - float gridIntensity = debugGrid(vUv, 4.0, 1.5); - vec3 gridColor; - if (layerIndex == 0) { - gridColor = vec3(1.0, 0.0, 0.0); // Red - } else if (layerIndex == 1) { - gridColor = vec3(0.0, 1.0, 0.0); // Green - } else { - gridColor = vec3(0.0, 0.0, 1.0); // Blue - } - color = mix(color, gridColor, gridIntensity * 0.5); - } - - // Output clouds with texture color and combined alpha - gl_FragColor = vec4(color, finalAlpha); - } -`;function t9({textureUrl:e,radius:t,heightPercent:r,speed:n,windDirection:i,layerIndex:a}){let{debugMode:o}=(0,eS.useDebug)(),{animationEnabled:s}=(0,eS.useSettings)(),l=(0,f.useRef)(null),u=(0,eE.useTexture)(e,t$),c=(0,f.useMemo)(()=>{let e=r-.05;return function(e,t,r,n){var i;let a,o,s,l,u,c,d,f,h,m,p,g,v,B,C,y,b,x=new A.BufferGeometry,E=new Float32Array(75),M=new Float32Array(50),F=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],S=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let n=5*t+r,i=-e+r*S,a=e-t*S,o=e*F[n];E[3*n]=i,E[3*n+1]=o,E[3*n+2]=a,M[2*n]=r,M[2*n+1]=t}i=E,a=e=>({x:i[3*e],y:i[3*e+1],z:i[3*e+2]}),o=(e,t,r,n)=>{i[3*e]=t,i[3*e+1]=r,i[3*e+2]=n},s=a(1),l=a(3),u=a(5),c=a(6),d=a(8),f=a(9),h=a(15),m=a(16),p=a(18),g=a(19),v=a(21),B=a(23),C=u.x+(s.x-u.x)*.5,y=u.y+(s.y-u.y)*.5,b=u.z+(s.z-u.z)*.5,o(0,c.x+(C-c.x)*2,c.y+(y-c.y)*2,c.z+(b-c.z)*2),C=f.x+(l.x-f.x)*.5,y=f.y+(l.y-f.y)*.5,b=f.z+(l.z-f.z)*.5,o(4,d.x+(C-d.x)*2,d.y+(y-d.y)*2,d.z+(b-d.z)*2),C=v.x+(h.x-v.x)*.5,y=v.y+(h.y-v.y)*.5,b=v.z+(h.z-v.z)*.5,o(20,m.x+(C-m.x)*2,m.y+(y-m.y)*2,m.z+(b-m.z)*2),C=B.x+(g.x-B.x)*.5,y=B.y+(g.y-B.y)*.5,b=B.z+(g.z-B.z)*.5,o(24,p.x+(C-p.x)*2,p.y+(y-p.y)*2,p.z+(b-p.z)*2);let T=function(e,t){let r=new Float32Array(25);for(let n=0;n<25;n++){let i=e[3*n],a=e[3*n+2],o=1.3-Math.sqrt(i*i+a*a)/t;o<.4?o=0:o>.8&&(o=1),r[n]=o}return r}(E,e),R=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,n=r+1,i=r+5,a=i+1;R.push(r,i,a),R.push(r,a,n)}return x.setIndex(R),x.setAttribute("position",new A.Float32BufferAttribute(E,3)),x.setAttribute("uv",new A.Float32BufferAttribute(M,2)),x.setAttribute("alpha",new A.Float32BufferAttribute(T,1)),x.computeBoundingSphere(),x}(t,r,e,0)},[t,r]);(0,f.useEffect)(()=>()=>{c.dispose()},[c]);let h=(0,f.useMemo)(()=>new A.ShaderMaterial({uniforms:{cloudTexture:{value:u},uvOffset:{value:new A.Vector2(0,0)},debugMode:{value:+!!o},layerIndex:{value:a}},vertexShader:t0,fragmentShader:t1,transparent:!0,depthWrite:!1,side:A.DoubleSide}),[u,o,a]);return(0,f.useEffect)(()=>()=>{h.dispose()},[h]),(0,eC.useFrame)(s?(e,t)=>{let r=1e3*t/32;l.current??=new A.Vector2(0,0),l.current.x+=i.x*n*r,l.current.y+=i.y*n*r,l.current.x-=Math.floor(l.current.x),l.current.y-=Math.floor(l.current.y),h.uniforms.uvOffset.value.copy(l.current)}:tZ),(0,d.jsx)("mesh",{geometry:c,frustumCulled:!1,renderOrder:10,children:(0,d.jsx)("primitive",{object:h,attach:"material"})})}function t2({object:e}){var t;let{data:r}=eg({queryKey:["detailMapList",t=(0,eb.getProperty)(e,"materialList")],queryFn:()=>(0,eB.loadDetailMapList)(t),enabled:!!t},eo,void 0),n=.95*((0,eb.getFloat)(e,"visibleDistance")??500),i=(0,f.useMemo)(()=>[(0,eb.getFloat)(e,"cloudSpeed1")??1e-4,(0,eb.getFloat)(e,"cloudSpeed2")??2e-4,(0,eb.getFloat)(e,"cloudSpeed3")??3e-4],[e]),a=(0,f.useMemo)(()=>[(0,eb.getFloat)(e,"cloudHeightPer1")??.35,(0,eb.getFloat)(e,"cloudHeightPer2")??.25,(0,eb.getFloat)(e,"cloudHeightPer3")??.2],[e]),o=(0,f.useMemo)(()=>{let t=(0,eb.getProperty)(e,"windVelocity");if(t){let[e,r]=t.split(" ").map(e=>parseFloat(e));if(0!==e||0!==r)return new A.Vector2(r,-e).normalize()}return new A.Vector2(1,0)},[e]),s=(0,f.useMemo)(()=>{if(!r)return[];let e=[];for(let t=0;t<3;t++){let n=r[7+t];n&&e.push({texture:n,height:a[t],speed:i[t]})}return e},[r,i,a]),l=(0,f.useRef)(null);return((0,eC.useFrame)(({camera:e})=>{l.current&&l.current.position.copy(e.position)}),s&&0!==s.length)?(0,d.jsx)("group",{ref:l,children:s.map((e,t)=>{let r=(0,eB.textureToUrl)(e.texture);return(0,d.jsx)(f.Suspense,{fallback:null,children:(0,d.jsx)(t9,{textureUrl:r,radius:n,heightPercent:e.height,speed:e.speed,windDirection:o,layerIndex:t})},t)})}):null}let t3=!1;function t8(e){if(!e)return;let[t,r,n]=e.split(" ").map(e=>parseFloat(e));return[new A.Color().setRGB(t,r,n),new A.Color().setRGB(t,r,n).convertSRGBToLinear()]}function t5({skyBoxFiles:e,fogColor:t,fogState:r}){let{camera:n}=(0,ey.useThree)(),i=tz(e,{path:""}),a=!!t,o=(0,f.useMemo)(()=>n.projectionMatrixInverse,[n]),s=(0,f.useMemo)(()=>r?(0,eR.packFogVolumeData)(r.fogVolumes):new Float32Array(12),[r]),l=(0,f.useRef)({skybox:{value:i},fogColor:{value:t??new A.Color(0,0,0)},enableFog:{value:a},inverseProjectionMatrix:{value:o},cameraMatrixWorld:{value:n.matrixWorld},cameraHeight:eR.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:.18}}),u=(0,f.useMemo)(()=>{if(!r)return .18;let e=.95*r.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[r]);return(0,f.useEffect)(()=>{l.current.skybox.value=i,l.current.fogColor.value=t??new A.Color(0,0,0),l.current.enableFog.value=a,l.current.fogVolumeData.value=s,l.current.horizonFogHeight.value=u},[i,t,a,s,u]),(0,d.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,d.jsxs)("bufferGeometry",{children:[(0,d.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,d.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,d.jsx)("shaderMaterial",{uniforms:l.current,vertexShader:` - varying vec2 vUv; - - void main() { - vUv = uv; - gl_Position = vec4(position.xy, 0.9999, 1.0); - } - `,fragmentShader:` - uniform samplerCube skybox; - uniform vec3 fogColor; - uniform bool enableFog; - uniform mat4 inverseProjectionMatrix; - uniform mat4 cameraMatrixWorld; - uniform float cameraHeight; - uniform float fogVolumeData[12]; - uniform float horizonFogHeight; - - varying vec2 vUv; - - // Convert linear to sRGB for display - // shaderMaterial does NOT get automatic linear->sRGB output conversion - // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js - vec3 linearToSRGB(vec3 linear) { - vec3 low = linear * 12.92; - vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; - return mix(low, high, step(vec3(0.0031308), linear)); - } - - void main() { - vec2 ndc = vUv * 2.0 - 1.0; - vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); - viewPos.xyz /= viewPos.w; - vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); - direction = vec3(direction.z, direction.y, -direction.x); - // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear - vec4 skyColor = textureCube(skybox, direction); - vec3 finalColor; - - if (enableFog) { - vec3 effectiveFogColor = fogColor; - - // Calculate how much fog volume the ray passes through - // For skybox at "infinite" distance, the relevant height is how much - // of the volume is above/below camera depending on view direction - float volumeFogInfluence = 0.0; - - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - // Check if camera is inside this volume - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - // Camera is inside the fog volume - // Looking horizontally or up at shallow angles means ray travels - // through more fog before exiting the volume - float heightAboveCamera = volMaxH - cameraHeight; - float heightBelowCamera = cameraHeight - volMinH; - float volumeHeight = volMaxH - volMinH; - - // For horizontal rays (direction.y ≈ 0), maximum fog influence - // For rays going up steeply, less fog (exits volume quickly) - // For rays going down, more fog (travels through volume below) - float rayInfluence; - if (direction.y >= 0.0) { - // Looking up: influence based on how steep we're looking - // Shallow angles = long path through fog = high influence - rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); - } else { - // Looking down: always high fog (into the volume) - rayInfluence = 1.0; - } - - // Scale by percentage and volume depth factor - volumeFogInfluence += rayInfluence * volPct; - } - } - - // Base fog factor from view direction (for haze at horizon) - // In Torque, the fog "bans" (bands) are rendered as geometry from - // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. - // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). - // - // horizonFogHeight is the direction.y value where the fog band ends: - // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) - // - // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 - // - // Torque renders the fog bands as geometry with linear vertex alpha - // interpolation. We use a squared curve (t^2) to create a gentler - // falloff at the top of the gradient, matching Tribes 2's appearance. - float baseFogFactor; - if (direction.y <= 0.0) { - // Looking at or below horizon: full fog - baseFogFactor = 1.0; - } else if (direction.y >= horizonFogHeight) { - // Above fog band: no fog - baseFogFactor = 0.0; - } else { - // Within fog band: squared curve for gentler falloff at top - float t = direction.y / horizonFogHeight; - baseFogFactor = (1.0 - t) * (1.0 - t); - } - - // Combine base fog with volume fog influence - // When inside a volume, increase fog intensity - float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); - - finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor); - } else { - finalColor = skyColor.rgb; - } - // Convert linear result to sRGB for display - gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); - } - `,depthWrite:!1,depthTest:!1})]})}function t6({materialList:e,fogColor:t,fogState:r}){let{data:n}=eg({queryKey:["detailMapList",e],queryFn:()=>(0,eB.loadDetailMapList)(e)},eo,void 0),i=(0,f.useMemo)(()=>n?[(0,eB.textureToUrl)(n[1]),(0,eB.textureToUrl)(n[3]),(0,eB.textureToUrl)(n[4]),(0,eB.textureToUrl)(n[5]),(0,eB.textureToUrl)(n[0]),(0,eB.textureToUrl)(n[2])]:null,[n]);return i?(0,d.jsx)(t5,{skyBoxFiles:i,fogColor:t,fogState:r}):null}function t4({skyColor:e,fogColor:t,fogState:r}){let{camera:n}=(0,ey.useThree)(),i=!!t,a=(0,f.useMemo)(()=>n.projectionMatrixInverse,[n]),o=(0,f.useMemo)(()=>r?(0,eR.packFogVolumeData)(r.fogVolumes):new Float32Array(12),[r]),s=(0,f.useMemo)(()=>{if(!r)return .18;let e=.95*r.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[r]),l=(0,f.useRef)({skyColor:{value:e},fogColor:{value:t??new A.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:a},cameraMatrixWorld:{value:n.matrixWorld},cameraHeight:eR.globalFogUniforms.cameraHeight,fogVolumeData:{value:o},horizonFogHeight:{value:s}});return(0,f.useEffect)(()=>{l.current.skyColor.value=e,l.current.fogColor.value=t??new A.Color(0,0,0),l.current.enableFog.value=i,l.current.fogVolumeData.value=o,l.current.horizonFogHeight.value=s},[e,t,i,o,s]),(0,d.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,d.jsxs)("bufferGeometry",{children:[(0,d.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,d.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,d.jsx)("shaderMaterial",{uniforms:l.current,vertexShader:` - varying vec2 vUv; - - void main() { - vUv = uv; - gl_Position = vec4(position.xy, 0.9999, 1.0); - } - `,fragmentShader:` - uniform vec3 skyColor; - uniform vec3 fogColor; - uniform bool enableFog; - uniform mat4 inverseProjectionMatrix; - uniform mat4 cameraMatrixWorld; - uniform float cameraHeight; - uniform float fogVolumeData[12]; - uniform float horizonFogHeight; - - varying vec2 vUv; - - // Convert linear to sRGB for display - vec3 linearToSRGB(vec3 linear) { - vec3 low = linear * 12.92; - vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; - return mix(low, high, step(vec3(0.0031308), linear)); - } - - void main() { - vec2 ndc = vUv * 2.0 - 1.0; - vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); - viewPos.xyz /= viewPos.w; - vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); - direction = vec3(direction.z, direction.y, -direction.x); - - vec3 finalColor; - - if (enableFog) { - // Calculate volume fog influence (same logic as SkyBoxTexture) - float volumeFogInfluence = 0.0; - - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - float rayInfluence; - if (direction.y >= 0.0) { - rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); - } else { - rayInfluence = 1.0; - } - volumeFogInfluence += rayInfluence * volPct; - } - } - - // Base fog factor from view direction - float baseFogFactor; - if (direction.y <= 0.0) { - baseFogFactor = 1.0; - } else if (direction.y >= horizonFogHeight) { - baseFogFactor = 0.0; - } else { - float t = direction.y / horizonFogHeight; - baseFogFactor = (1.0 - t) * (1.0 - t); - } - - // Combine base fog with volume fog influence - float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); - - finalColor = mix(skyColor, fogColor, finalFogFactor); - } else { - finalColor = skyColor; - } - - gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); - } - `,depthWrite:!1,depthTest:!1})]})}function t7(e,t){let{fogDistance:r,visibleDistance:n}=e;return[r,n]}function re({fogState:e,enabled:t}){let{scene:r,camera:n}=(0,ey.useThree)(),i=(0,f.useRef)(null),a=(0,f.useMemo)(()=>(0,eR.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,f.useEffect)(()=>{t3||((0,eT.installCustomFogShader)(),t3=!0)},[]),(0,f.useEffect)(()=>{(0,eR.resetGlobalFogUniforms)();let[t,o]=t7(e,n.position.y),s=new A.Fog(e.fogColor,t,o);return r.fog=s,i.current=s,(0,eR.updateGlobalFogUniforms)(n.position.y,a),()=>{r.fog=null,i.current=null,(0,eR.resetGlobalFogUniforms)()}},[r,n,e,a]),(0,f.useEffect)(()=>{let r=i.current;if(r)if(t){let[t,i]=t7(e,n.position.y);r.near=t,r.far=i}else r.near=1e10,r.far=1e10},[t,e,n.position.y]),(0,eC.useFrame)(()=>{let r=i.current;if(!r)return;let o=n.position.y;if((0,eR.updateGlobalFogUniforms)(o,a,t),t){let[t,n]=t7(e,o);r.near=t,r.far=n,r.color.copy(e.fogColor)}}),null}let rt=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function rr(e){return rt.test(e)}let rn=(0,f.createContext)(null);function ri(){let e=(0,f.useContext)(rn);if(!e)throw Error("useShapeInfo must be used within ShapeInfoProvider");return e}function ra({children:e,object:t,shapeName:r,type:n}){let i=(0,f.useMemo)(()=>rr(r),[r]),a=(0,f.useMemo)(()=>({object:t,shapeName:r,type:n,isOrganic:i}),[t,r,n,i]);return(0,d.jsx)(rn.Provider,{value:a,children:e})}var ro=e.i(51475);let rs=new Map;function rl(e){e.onBeforeCompile=t=>{(0,eT.injectCustomFog)(t,eR.globalFogUniforms),e instanceof A.MeshLambertMaterial&&(t.uniforms.shapeDirectionalFactor={value:1},t.uniforms.shapeAmbientFactor={value:1.5},t.fragmentShader=t.fragmentShader.replace("#include ",`#include -uniform float shapeDirectionalFactor; -uniform float shapeAmbientFactor; -`),t.fragmentShader=t.fragmentShader.replace("#include ",`#include - // Apply shape-specific lighting multipliers - reflectedLight.directDiffuse *= shapeDirectionalFactor; - reflectedLight.indirectDiffuse *= shapeAmbientFactor; -`))}}function ru(e,t,r,n){let i=r.has("Translucent"),a=r.has("Additive");if(r.has("SelfIlluminating")){let e=new A.MeshBasicMaterial({map:t,side:2,transparent:a,alphaTest:.5*!a,fog:!0,...a&&{blending:A.AdditiveBlending}});return rl(e),e}if(n||i){let e={map:t,transparent:!1,alphaTest:.5,reflectivity:0},r=new A.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),n=new A.MeshLambertMaterial({...e,side:0});return rl(r),rl(n),[r,n]}let o=new A.MeshLambertMaterial({map:t,side:2,reflectivity:0});return rl(o),o}let rc=(0,f.memo)(function({material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i=!1,receiveShadow:a=!1}){let o=e.userData.resource_path,s=new Set(e.userData.flag_names??[]),l=function(e){let{animationEnabled:t}=(0,eS.useSettings)(),{data:r}=eg({queryKey:["ifl",e],queryFn:()=>(0,eB.loadImageFrameList)(e),enabled:!0,suspense:!0,throwOnError:ep,placeholderData:void 0},eo,void 0),n=(0,f.useMemo)(()=>r.map(t=>(0,eB.iflTextureToUrl)(t.name,e)),[r,e]),i=(0,eE.useTexture)(n),a=(0,f.useMemo)(()=>{var t;let n,a=rs.get(e);if(!a){let t,r,n,o,s,l,u,c,d;r=(t=i[0].image).width,n=t.height,s=Math.ceil(Math.sqrt(o=i.length)),l=Math.ceil(o/s),(u=document.createElement("canvas")).width=r*s,u.height=n*l,c=u.getContext("2d"),i.forEach((e,t)=>{let i=Math.floor(t/s);c.drawImage(e.image,t%s*r,i*n)}),(d=new A.CanvasTexture(u)).colorSpace=A.SRGBColorSpace,d.generateMipmaps=!1,d.minFilter=A.NearestFilter,d.magFilter=A.NearestFilter,d.wrapS=A.ClampToEdgeWrapping,d.wrapT=A.ClampToEdgeWrapping,d.repeat.set(1/s,1/l),a={texture:d,columns:s,rows:l,frameCount:o,frameStartTicks:[],totalTicks:0,lastFrame:-1},rs.set(e,a)}return n=0,(t=a).frameStartTicks=r.map(e=>{let t=n;return n+=e.frameCount,t}),t.totalTicks=n,a},[e,i,r]);return(0,ro.useTick)(e=>{let r=t?function(e,t){if(0===e.totalTicks)return 0;let r=t%e.totalTicks,{frameStartTicks:n}=e;for(let e=n.length-1;e>=0;e--)if(r>=n[e])return e;return 0}(a,e):0;!function(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,n=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,n/e.rows)}(a,r)}),a.texture}(`textures/${o}.ifl`),u=t&&rr(t),c=(0,f.useMemo)(()=>ru(e,l,s,u),[e,l,s,u]);return Array.isArray(c)?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("mesh",{geometry:n||r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:c[0],attach:"material"})}),(0,d.jsx)("mesh",{geometry:r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:c[1],attach:"material"})})]}):(0,d.jsx)("mesh",{geometry:r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:c,attach:"material"})})}),rd=(0,f.memo)(function({material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i=!1,receiveShadow:a=!1}){let o=e.userData.resource_path,s=new Set(e.userData.flag_names??[]),l=(0,f.useMemo)(()=>(o||console.warn(`No resource_path was found on "${t}" - rendering fallback.`),o?(0,eB.textureToUrl)(o):eB.FALLBACK_TEXTURE_URL),[o,t]),u=t&&rr(t),c=s.has("Translucent"),h=(0,eE.useTexture)(l,e=>u||c?(0,ex.setupTexture)(e,{disableMipmaps:!0}):(0,ex.setupTexture)(e)),m=(0,f.useMemo)(()=>ru(e,h,s,u),[e,h,s,u]);return Array.isArray(m)?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("mesh",{geometry:n||r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:m[0],attach:"material"})}),(0,d.jsx)("mesh",{geometry:r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:m[1],attach:"material"})})]}):(0,d.jsx)("mesh",{geometry:r,castShadow:i,receiveShadow:a,children:(0,d.jsx)("primitive",{object:m,attach:"material"})})}),rf=(0,f.memo)(function({material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i=!1,receiveShadow:a=!1}){let o=new Set(e.userData.flag_names??[]).has("IflMaterial"),s=e.userData.resource_path;return o&&s?(0,d.jsx)(rc,{material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i,receiveShadow:a}):e.name?(0,d.jsx)(rd,{material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:i,receiveShadow:a}):null});function rh({color:e,label:t}){return(0,d.jsxs)("mesh",{children:[(0,d.jsx)("boxGeometry",{args:[10,10,10]}),(0,d.jsx)("meshStandardMaterial",{color:e,wireframe:!0}),t?(0,d.jsx)(tN.FloatingLabel,{color:e,children:t}):null]})}function rm({color:e,label:t}){let{debugMode:r}=(0,eS.useDebug)();return r?(0,d.jsx)(rh,{color:e,label:t}):null}function rp({loadingColor:e="yellow",children:t}){let{object:r,shapeName:n}=ri();return n?(0,d.jsx)(eJ,{fallback:(0,d.jsx)(rm,{color:"red",label:`${r._id}: ${n}`}),children:(0,d.jsxs)(f.Suspense,{fallback:(0,d.jsx)(rh,{color:e}),children:[(0,d.jsx)(rA,{}),t]})}):(0,d.jsx)(rm,{color:"orange",label:`${r._id}: `})}let rA=(0,f.memo)(function(){let{object:e,shapeName:t,isOrganic:r}=ri(),{debugMode:n}=(0,eS.useDebug)(),{nodes:i}=tj((0,eB.shapeToUrl)(t)),a=(0,f.useMemo)(()=>{let e=Object.values(i).filter(e=>e.skeleton);if(e.length>0){var t;let r;return t=e[0].skeleton,r=new Set,t.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&r.add(t)}),r}return new Set},[i]),o=(0,f.useMemo)(()=>Object.entries(i).filter(([e,t])=>t.material&&"Unassigned"!==t.material.name&&!t.name.match(/^Hulk/i)).map(([e,t])=>{let n=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,n=e.attributes.skinWeight,i=e.index,a=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(o)){a[e]=!0;break}}if(i){let t=[],r=i.array;for(let e=0;e1){let t=0,r=0,n=0;for(let i of e)t+=o[3*i],r+=o[3*i+1],n+=o[3*i+2];let i=Math.sqrt(t*t+r*r+n*n);for(let a of(i>0&&(t/=i,r/=i,n/=i),e))o[3*a]=t,o[3*a+1]=r,o[3*a+2]=n}if(t.needsUpdate=!0,r){let e=(i=n.clone()).attributes.normal,t=e.array;for(let e=0;e(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("mesh",{geometry:r,children:(0,d.jsx)("meshStandardMaterial",{color:"gray",wireframe:!0})}),children:e.material?Array.isArray(e.material)?e.material.map((e,i)=>(0,d.jsx)(rf,{material:e,shapeName:t,geometry:r,backGeometry:n,castShadow:s,receiveShadow:s},i)):(0,d.jsx)(rf,{material:e.material,shapeName:t,geometry:r,backGeometry:n,castShadow:s,receiveShadow:s}):null},e.id)),n?(0,d.jsxs)(tN.FloatingLabel,{children:[e._id,": ",t]}):null]})});var rg=e.i(6112);let rv={1:"Storm",2:"Inferno"},rB=(0,f.createContext)(null);function rC(){let e=(0,f.useContext)(rB);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function ry({children:e}){let{camera:t}=(0,ey.useThree)(),[r,n]=(0,f.useState)(0),[i,a]=(0,f.useState)({}),o=(0,f.useCallback)(e=>{a(t=>({...t,[e.id]:e}))},[]),s=(0,f.useCallback)(e=>{a(t=>{let{[e.id]:r,...n}=t;return n})},[]),l=Object.keys(i).length,u=(0,f.useCallback)(()=>{n(e=>0===l?0:(e+1)%l)},[l]),c=(0,f.useCallback)(e=>{e>=0&&e{if(r({registerCamera:o,unregisterCamera:s,nextCamera:u,setCameraIndex:c,cameraCount:l}),[o,s,u,c,l]);return(0,d.jsx)(rB.Provider,{value:h,children:e})}let rb=(0,f.createContext)(null),rx=rb.Provider,rE=(0,f.lazy)(()=>e.A(61921).then(e=>({default:e.AudioEmitter}))),rM={AudioEmitter:function(e){let{audioEnabled:t}=(0,eS.useSettings)();return t?(0,d.jsx)(rE,{...e}):null},Camera:function({object:e}){let{registerCamera:t,unregisterCamera:r}=rC(),n=(0,f.useId)(),i=(0,eb.getProperty)(e,"dataBlock"),a=(0,f.useMemo)(()=>(0,eb.getPosition)(e),[e]),o=(0,f.useMemo)(()=>(0,eb.getRotation)(e),[e]);return(0,f.useEffect)(()=>{if("Observer"===i){let e={id:n,position:new A.Vector3(...a),rotation:o};return t(e),()=>{r(e)}}},[n,i,t,r,a,o]),null},ForceFieldBare:(0,f.lazy)(()=>e.A(25147).then(e=>({default:e.ForceFieldBare}))),InteriorInstance:tY,Item:function({object:e}){let t=ek(),r=(0,eb.getProperty)(e,"dataBlock")??"",n=(0,rg.useDatablock)(r),i=(0,f.useMemo)(()=>(0,eb.getPosition)(e),[e]),a=(0,f.useMemo)(()=>(0,eb.getScale)(e),[e]),o=(0,f.useMemo)(()=>(0,eb.getRotation)(e),[e]),s=(0,eb.getProperty)(n,"shapeFile");s||console.error(` missing shape for datablock: ${r}`);let l=r?.toLowerCase()==="flag",u=t?.team??null,c=u&&u>0?rv[u]:null,h=l&&c?`${c} Flag`:null;return(0,d.jsx)(ra,{type:"Item",object:e,shapeName:s,children:(0,d.jsx)("group",{position:i,quaternion:o,scale:a,children:(0,d.jsx)(rp,{loadingColor:"pink",children:h?(0,d.jsx)(tN.FloatingLabel,{opacity:.6,children:h}):null})})})},SimGroup:function({object:e}){let t=ek(),r=(0,f.useMemo)(()=>{let r=null,n=!1;if(t&&t.hasTeams){if(n=!0,null!=t.team)r=t.team;else if(e._name){let t=e._name.match(/^team(\d+)$/i);t&&(r=parseInt(t[1],10))}}else e._name&&(n="teams"===e._name.toLowerCase());return{object:e,parent:t,hasTeams:n,team:r}},[e,t]);return(0,d.jsx)(e_.Provider,{value:r,children:(e._children??[]).map((e,t)=>(0,d.jsx)(rF,{object:e},e._id))})},Sky:function({object:e}){let{fogEnabled:t,highQualityFog:r}=(0,eS.useSettings)(),n=(0,eb.getProperty)(e,"materialList"),i=(0,f.useMemo)(()=>t8((0,eb.getProperty)(e,"SkySolidColor")),[e]),a=(0,eb.getInt)(e,"useSkyTextures")??1,o=(0,f.useMemo)(()=>(function(e,t=!0){let r=(0,eb.getFloat)(e,"fogDistance")??0,n=(0,eb.getFloat)(e,"visibleDistance")??1e3,i=(0,eb.getFloat)(e,"high_fogDistance"),a=(0,eb.getFloat)(e,"high_visibleDistance"),o=t&&null!=i&&i>0?i:r,s=t&&null!=a&&a>0?a:n,l=function(e){if(!e)return new A.Color(.5,.5,.5);let[t,r,n]=e.split(" ").map(e=>parseFloat(e));return new A.Color().setRGB(t,r,n).convertSRGBToLinear()}((0,eb.getProperty)(e,"fogColor")),u=[];for(let t=1;t<=3;t++){let r=function(e,t=1){if(!e)return null;let r=e.split(" ").map(e=>parseFloat(e));if(r.length<3)return null;let[n,i,a]=r;return n<=0||a<=i?null:{visibleDistance:n,minHeight:i,maxHeight:a,percentage:Math.max(0,Math.min(1,t))}}((0,eb.getProperty)(e,`fogVolume${t}`),1);r&&u.push(r)}let c=u.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:o,visibleDistance:s,fogColor:l,fogVolumes:u,fogLine:c,enabled:s>o}})(e,r),[e,r]),s=(0,f.useMemo)(()=>t8((0,eb.getProperty)(e,"fogColor")),[e]),l=i||s,u=o.enabled&&t,c=o.fogColor,{scene:h,gl:m}=(0,ey.useThree)();(0,f.useEffect)(()=>{if(u){let e=c.clone();h.background=e,m.setClearColor(e)}else if(l){let e=l[0].clone();h.background=e,m.setClearColor(e)}else h.background=null;return()=>{h.background=null}},[h,m,u,c,l]);let p=i?.[1];return(0,d.jsxs)(d.Fragment,{children:[n&&a?(0,d.jsx)(f.Suspense,{fallback:null,children:(0,d.jsx)(t6,{materialList:n,fogColor:u?c:void 0,fogState:u?o:void 0},n)}):p?(0,d.jsx)(t4,{skyColor:p,fogColor:u?c:void 0,fogState:u?o:void 0}):null,(0,d.jsx)(f.Suspense,{children:(0,d.jsx)(t2,{object:e})}),o.enabled?(0,d.jsx)(re,{fogState:o,enabled:t}):null]})},StaticShape:function({object:e}){let t=(0,eb.getProperty)(e,"dataBlock")??"",r=(0,rg.useDatablock)(t),n=(0,f.useMemo)(()=>(0,eb.getPosition)(e),[e]),i=(0,f.useMemo)(()=>(0,eb.getRotation)(e),[e]),a=(0,f.useMemo)(()=>(0,eb.getScale)(e),[e]),o=(0,eb.getProperty)(r,"shapeFile");return o||console.error(` missing shape for datablock: ${t}`),(0,d.jsx)(ra,{type:"StaticShape",object:e,shapeName:o,children:(0,d.jsx)("group",{position:n,quaternion:i,scale:a,children:(0,d.jsx)(rp,{})})})},Sun:function({object:e}){let t=(0,f.useMemo)(()=>{let[t,r,n]=((0,eb.getProperty)(e,"direction")??"0.57735 0.57735 -0.57735").split(" ").map(e=>parseFloat(e)),i=Math.sqrt(t*t+n*n+r*r);return new A.Vector3(t/i,n/i,r/i)},[e]),r=(0,f.useMemo)(()=>new A.Vector3(-(5e3*t.x),-(5e3*t.y),-(5e3*t.z)),[t]),n=(0,f.useMemo)(()=>{let[t,r,n]=((0,eb.getProperty)(e,"color")??"0.7 0.7 0.7 1").split(" ").map(e=>parseFloat(e));return new A.Color(t,r,n)},[e]),i=(0,f.useMemo)(()=>{let[t,r,n]=((0,eb.getProperty)(e,"ambient")??"0.5 0.5 0.5 1").split(" ").map(e=>parseFloat(e));return new A.Color(t,r,n)},[e]),a=t.y<0;return(0,f.useEffect)(()=>{eM.value=a},[a]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("directionalLight",{position:r,color:n,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),(0,d.jsx)("ambientLight",{color:i,intensity:1})]})},TerrainBlock:eH,TSStatic:function({object:e}){let t=(0,eb.getProperty)(e,"shapeName"),r=(0,f.useMemo)(()=>(0,eb.getPosition)(e),[e]),n=(0,f.useMemo)(()=>(0,eb.getRotation)(e),[e]),i=(0,f.useMemo)(()=>(0,eb.getScale)(e),[e]);return t||console.error(" missing shapeName for object",e),(0,d.jsx)(ra,{type:"TSStatic",object:e,shapeName:t,children:(0,d.jsx)("group",{position:r,quaternion:n,scale:i,children:(0,d.jsx)(rp,{})})})},Turret:function({object:e}){let t=(0,eb.getProperty)(e,"dataBlock")??"",r=(0,eb.getProperty)(e,"initialBarrel"),n=(0,rg.useDatablock)(t),i=(0,rg.useDatablock)(r),a=(0,f.useMemo)(()=>(0,eb.getPosition)(e),[e]),o=(0,f.useMemo)(()=>(0,eb.getRotation)(e),[e]),s=(0,f.useMemo)(()=>(0,eb.getScale)(e),[e]),l=(0,eb.getProperty)(n,"shapeFile"),u=(0,eb.getProperty)(i,"shapeFile");return l||console.error(` missing shape for datablock: ${t}`),r&&!u&&console.error(` missing shape for barrel datablock: ${r}`),(0,d.jsx)(ra,{type:"Turret",object:e,shapeName:l,children:(0,d.jsxs)("group",{position:a,quaternion:o,scale:s,children:[(0,d.jsx)(rp,{}),u?(0,d.jsx)(ra,{type:"Turret",object:e,shapeName:u,children:(0,d.jsx)("group",{position:[0,1.5,0],children:(0,d.jsx)(rp,{})})}):null]})})},WaterBlock:(0,f.lazy)(()=>e.A(18599).then(e=>({default:e.WaterBlock}))),WayPoint:function({object:e}){let t=(0,f.useMemo)(()=>(0,eb.getPosition)(e),[e]),r=(0,eb.getProperty)(e,"name");return r?(0,d.jsx)(tN.FloatingLabel,{position:t,opacity:.6,children:r}):null}};function rF({object:e}){let{missionType:t}=(0,f.useContext)(rb),r=(0,f.useMemo)(()=>{let r=new Set(((0,eb.getProperty)(e,"missionTypesList")??"").toLowerCase().split(/s+/).filter(Boolean));return!r.size||r.has(t.toLowerCase())},[e,t]),n=rM[e._className];return r&&n?(0,d.jsx)(f.Suspense,{children:(0,d.jsx)(n,{object:e})}):null}var rS=e.i(86608),rT=e.i(38433),rR=e.i(33870),rD=e.i(91996);let rI=async e=>{let t;try{t=(0,eB.getUrlForPath)(e)}catch(t){return console.warn(`Script not in manifest: ${e} (${t})`),null}try{let r=await fetch(t);if(!r.ok)return console.error(`Script fetch failed: ${e} (${r.status})`),null;return await r.text()}catch(t){return console.error(`Script fetch error: ${e}`),console.error(t),null}},rw=(0,rR.createScriptCache)(),rG={findFiles:e=>{let t=(0,ev.default)(e,{nocase:!0});return(0,rD.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,rD.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,rD.getResourceMap)()[(0,rD.getResourceKey)(e)]},rL=(0,f.memo)(function({name:e,missionType:t,onLoadingChange:r}){let{data:n}=eg({queryKey:["parsedMission",e],queryFn:()=>(0,eB.loadMission)(e)},eo,void 0),{missionGroup:i,runtime:a,progress:o}=function(e,t,r){let[n,i]=(0,f.useState)({missionGroup:void 0,runtime:void 0,progress:0});return(0,f.useEffect)(()=>{if(!r)return;let n=new AbortController,a=(0,rT.createProgressTracker)(),o=()=>{i(e=>({...e,progress:a.progress}))};a.on("update",o);let{runtime:s}=(0,rS.runServer)({missionName:e,missionType:t,runtimeOptions:{loadScript:rI,fileSystem:rG,cache:rw,signal:n.signal,progress:a,ignoreScripts:["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]},onMissionLoadDone:()=>{i({missionGroup:s.getObjectByName("MissionGroup"),runtime:s,progress:1})}});return()=>{a.off("update",o),n.abort(),s.destroy()}},[e,r]),n}(e,t,n),s=!n||!i||!a,l=(0,f.useMemo)(()=>({metadata:n,missionType:t,missionGroup:i}),[n,t,i]);return((0,f.useEffect)(()=>{r?.(s,o)},[s,o,r]),s)?null:(0,d.jsx)(rx,{value:l,children:(0,d.jsx)(eL.RuntimeProvider,{runtime:a,children:(0,d.jsx)(rF,{object:i})})})});var rP=class extends x{constructor(e={}){super(),this.config=e,this.#_=new Map}#_;build(e,t,r){let n=t.queryKey,i=t.queryHash??L(n,t),a=this.get(i);return a||(a=new er({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}add(e){this.#_.has(e.queryHash)||(this.#_.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#_.get(e.queryHash);t&&(e.destroy(),t===e&&this.#_.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){q.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#_.get(e)}getAll(){return[...this.#_.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>w(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>w(e,t)):t}notify(e){q.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){q.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){q.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rO=class extends et{#c;#k;#U;#d;constructor(e){super(),this.#c=e.client,this.mutationId=e.mutationId,this.#U=e.mutationCache,this.#k=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#k.includes(e)||(this.#k.push(e),this.clearGcTimeout(),this.#U.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#k=this.#k.filter(t=>t!==e),this.scheduleGc(),this.#U.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#k.length||("pending"===this.state.status?this.scheduleGc():this.#U.remove(this))}continue(){return this.#d?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#m({type:"continue"})},r={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#d=ee({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#U.canRun(this)});let n="pending"===this.state.status,i=!this.#d.canStart();try{if(n)t();else{this.#m({type:"pending",variables:e,isPaused:i}),await this.#U.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#m({type:"pending",context:t,variables:e,isPaused:i})}let a=await this.#d.start();return await this.#U.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#U.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#m({type:"success",data:a}),a}catch(t){try{throw await this.#U.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#U.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#m({type:"error",error:t})}}finally{this.#U.runNext(this)}}#m(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),q.batch(()=>{this.#k.forEach(t=>{t.onMutationUpdate(e)}),this.#U.notify({mutation:this,type:"updated",action:e})})}},rH=class extends x{constructor(e={}){super(),this.config=e,this.#j=new Set,this.#N=new Map,this.#J=0}#j;#N;#J;build(e,t,r){let n=new rO({client:e,mutationCache:this,mutationId:++this.#J,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#j.add(e);let t=r_(e);if("string"==typeof t){let r=this.#N.get(t);r?r.push(e):this.#N.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#j.delete(e)){let t=r_(e);if("string"==typeof t){let r=this.#N.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#N.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=r_(e);if("string"!=typeof t)return!0;{let r=this.#N.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=r_(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#N.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){q.batch(()=>{this.#j.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#j.clear(),this.#N.clear()})}getAll(){return Array.from(this.#j)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>G(t,e))}findAll(e={}){return this.getAll().filter(t=>G(e,t))}notify(e){q.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return q.batch(()=>Promise.all(e.map(e=>e.continue().catch(S))))}};function r_(e){return e.options.scope?.id}function rk(e){return{onFetch:(t,r)=>{let n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},l=0,u=async()=>{let r=!1,u=V(t.options,t.fetchOptions),c=async(e,n,i)=>{let a;if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);let o=(Object.defineProperty(a={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta},"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),a),s=await u(o),{maxPages:l}=t.options,c=i?K:J;return{pages:c(e.pages,s,l),pageParams:c(e.pageParams,n,l)}};if(i&&a.length){let e="backward"===i,t={pages:a,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:rU)(n,t);s=await c(t,r,e)}else{let t=e??a.length;do{let e=0===l?o[0]??n.initialPageParam:rU(n,s);if(l>0&&null==e)break;s=await c(s,e),l++}while(lt.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function rU(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var rj=class{#K;#U;#f;#Q;#V;#X;#q;#W;constructor(e={}){this.#K=e.queryCache||new rP,this.#U=e.mutationCache||new rH,this.#f=e.defaultOptions||{},this.#Q=new Map,this.#V=new Map,this.#X=0}mount(){this.#X++,1===this.#X&&(this.#q=X.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#K.onFocus())}),this.#W=W.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#K.onOnline())}))}unmount(){this.#X--,0===this.#X&&(this.#q?.(),this.#q=void 0,this.#W?.(),this.#W=void 0)}isFetching(e){return this.#K.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#U.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#K.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#K.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(D(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#K.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=this.#K.get(n.queryHash),a=i?.state.data,o="function"==typeof t?t(a):t;if(void 0!==o)return this.#K.build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return q.batch(()=>this.#K.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#K.get(t.queryHash)?.state}removeQueries(e){let t=this.#K;q.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#K;return q.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(q.batch(()=>this.#K.findAll(e).map(e=>e.cancel(r)))).then(S).catch(S)}invalidateQueries(e,t={}){return q.batch(()=>(this.#K.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(q.batch(()=>this.#K.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(S)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(S)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#K.build(this,t);return r.isStaleByTime(D(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(S).catch(S)}fetchInfiniteQuery(e){return e.behavior=rk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(S).catch(S)}ensureInfiniteQueryData(e){return e.behavior=rk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return W.isOnline()?this.#U.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#K}getMutationCache(){return this.#U}getDefaultOptions(){return this.#f}setDefaultOptions(e){this.#f=e}setQueryDefaults(e,t){this.#Q.set(P(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#Q.values()],r={};return t.forEach(t=>{O(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#V.set(P(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#V.values()],r={};return t.forEach(t=>{O(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#f.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=L(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Q&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#f.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#K.clear(),this.#U.clear()}},rN=e.i(8155);let rJ=e=>{let t=(0,rN.createStore)(e),r=e=>(function(e,t=e=>e){let r=f.default.useSyncExternalStore(e.subscribe,f.default.useCallback(()=>t(e.getState()),[e,t]),f.default.useCallback(()=>t(e.getInitialState()),[e,t]));return f.default.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},rK=f.createContext(null);function rQ({map:e,children:t,onChange:r,domElement:n}){let i=e.map(e=>e.name+e.keys).join("-"),a=f.useMemo(()=>{let t,r;return t=()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{}),(r=(e,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let a=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,o=e(n.getState());a=r=>{let n=e(r);if(!i(o,n)){let e=o;t(o=n,e)}},(null==r?void 0:r.fireImmediately)&&t(o,o)}return i(a)},t(e,r,n)})?rJ(r):rJ},[i]),o=f.useMemo(()=>[a.subscribe,a.getState,a],[i]),s=a.setState;return f.useEffect(()=>{let t=e.map(({name:e,keys:t,up:n})=>({keys:t,up:n,fn:t=>{s({[e]:t}),r&&r(e,t,o[1]())}})).reduce((e,{keys:t,fn:r,up:n=!0})=>(t.forEach(t=>e[t]={fn:r,pressed:!1,up:n}),e),{}),i=({key:e,code:r})=>{let n=t[e]||t[r];if(!n)return;let{fn:i,pressed:a,up:o}=n;n.pressed=!0,(o||!a)&&i(!0)},a=({key:e,code:r})=>{let n=t[e]||t[r];if(!n)return;let{fn:i,up:a}=n;n.pressed=!1,a&&i(!1)},l=n||window;return l.addEventListener("keydown",i,{passive:!0}),l.addEventListener("keyup",a,{passive:!0}),()=>{l.removeEventListener("keydown",i),l.removeEventListener("keyup",a)}},[n,i]),f.createElement(rK.Provider,{value:o,children:t})}var rV=Object.defineProperty;class rX{constructor(){((e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?rV(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,n=r.length;t{let n;return(n="symbol"!=typeof t?t+"":t)in e?rq(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,r};let rY=new A.Euler(0,0,0,"YXZ"),rz=new A.Vector3,rZ={type:"change"},r$={type:"lock"},r0={type:"unlock"},r1=Math.PI/2;class r9 extends rX{constructor(e,t){super(),rW(this,"camera"),rW(this,"domElement"),rW(this,"isLocked"),rW(this,"minPolarAngle"),rW(this,"maxPolarAngle"),rW(this,"pointerSpeed"),rW(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(rY.setFromQuaternion(this.camera.quaternion),rY.y-=.002*e.movementX*this.pointerSpeed,rY.x-=.002*e.movementY*this.pointerSpeed,rY.x=Math.max(r1-this.maxPolarAngle,Math.min(r1-this.minPolarAngle,rY.x)),this.camera.quaternion.setFromEuler(rY),this.dispatchEvent(rZ))}),rW(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(r$),this.isLocked=!0):(this.dispatchEvent(r0),this.isLocked=!1))}),rW(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),rW(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),rW(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),rW(this,"dispose",()=>{this.disconnect()}),rW(this,"getObject",()=>this.camera),rW(this,"direction",new A.Vector3(0,0,-1)),rW(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),rW(this,"moveForward",e=>{rz.setFromMatrixColumn(this.camera.matrix,0),rz.crossVectors(this.camera.up,rz),this.camera.position.addScaledVector(rz,e)}),rW(this,"moveRight",e=>{rz.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(rz,e)}),rW(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),rW(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}var r2=((c=r2||{}).forward="forward",c.backward="backward",c.left="left",c.right="right",c.up="up",c.down="down",c.camera1="camera1",c.camera2="camera2",c.camera3="camera3",c.camera4="camera4",c.camera5="camera5",c.camera6="camera6",c.camera7="camera7",c.camera8="camera8",c.camera9="camera9",c);function r3(){let{speedMultiplier:e,setSpeedMultiplier:t}=(0,eS.useControls)(),[r,n]=function(e){let[t,r,n]=f.useContext(rK);return[t,r]}(),{camera:i,gl:a}=(0,ey.useThree)(),{nextCamera:o,setCameraIndex:s,cameraCount:l}=rC(),u=(0,f.useRef)(null),c=(0,f.useRef)(new A.Vector3),d=(0,f.useRef)(new A.Vector3),h=(0,f.useRef)(new A.Vector3);return(0,f.useEffect)(()=>{let e=new r9(i,a.domElement);u.current=e;let t=t=>{e.isLocked?o():t.target===a.domElement&&e.lock()};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t),e.dispose()}},[i,a,o]),(0,f.useEffect)(()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return r(t=>{for(let r=0;r{let e=e=>{e.preventDefault();let r=e.deltaY>0?-1:1,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*r;t(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},r=a.domElement;return r.addEventListener("wheel",e,{passive:!1}),()=>{r.removeEventListener("wheel",e)}},[a]),(0,eC.useFrame)((t,r)=>{let{forward:a,backward:o,left:s,right:l,up:u,down:f}=n();(a||o||s||l||u||f)&&(i.getWorldDirection(c.current),c.current.normalize(),d.current.crossVectors(i.up,c.current).normalize(),h.current.set(0,0,0),a&&h.current.add(c.current),o&&h.current.sub(c.current),s&&h.current.add(d.current),l&&h.current.sub(d.current),u&&(h.current.y+=1),f&&(h.current.y-=1),h.current.lengthSq()>0&&(h.current.normalize().multiplyScalar(80*e*r),i.position.add(h.current)))}),null}let r8=[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}];function r5(){return(0,f.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",e,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",e,{capture:!0})}},[]),(0,d.jsx)(rQ,{map:r8,children:(0,d.jsx)(r3,{})})}var r6="undefined"!=typeof window&&!!(null==(u=window.document)?void 0:u.createElement);function r4(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function r7(e){return e?"self"in e?e.self:r4(e).defaultView||window:self}function ne(e,t=!1){let{activeElement:r}=r4(e);if(!(null==r?void 0:r.nodeName))return null;if(nr(r)&&r.contentDocument)return ne(r.contentDocument.body,t);if(t){let e=r.getAttribute("aria-activedescendant");if(e){let t=r4(r).getElementById(e);if(t)return t}}return r}function nt(e,t){return e===t||e.contains(t)}function nr(e){return"IFRAME"===e.tagName}function nn(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==ni.indexOf(e.type)}var ni=["button","color","file","image","reset","submit"];function na(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function no(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function ns(e){return e.isContentEditable||no(e)}function nl(e){let t=0,r=0;if(no(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let n=r4(e).getSelection();if((null==n?void 0:n.rangeCount)&&n.anchorNode&&nt(e,n.anchorNode)&&n.focusNode&&nt(e,n.focusNode)){let i=n.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(e),a.setEnd(i.startContainer,i.startOffset),t=a.toString().length,a.setEnd(i.endContainer,i.endOffset),r=a.toString().length}}return{start:t,end:r}}function nu(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function nc(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return nc(e.parentElement)||document.scrollingElement||document.body}function nd(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function nf(e,t){return t&&e.item(t)||null}var nh=Symbol("FOCUS_SILENTLY");function nm(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function np(){}function nA(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function ng(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function nv(e){return e}function nB(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function nC(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function ny(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function nb(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function nx(...e){for(let t of e)if(void 0!==t)return t}function nE(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function nM(){return r6&&!!navigator.maxTouchPoints}function nF(){return!!r6&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function nS(){return r6&&nF()&&/apple/i.test(navigator.vendor)}function nT(e){return!!(e.currentTarget&&!nt(e.currentTarget,e.target))}function nR(e){return e.target===e.currentTarget}function nD(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function nI(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function nw(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!nt(r,n)}function nG(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),r()}),a=()=>{i(),r()};return e.addEventListener(t,a,{once:!0,capture:!0}),i}function nL(e,t,r,n=window){let i=[];try{for(let a of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(nL(e,t,r,a))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var nP={...f},nO=nP.useId;nP.useDeferredValue;var nH=nP.useInsertionEffect,n_=r6?f.useLayoutEffect:f.useEffect;function nk(e){let t=(0,f.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return nH?nH(()=>{t.current=e}):t.current=e,(0,f.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function nU(...e){return(0,f.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)nE(r,t)}},e)}function nj(e){if(nO){let t=nO();return e||t}let[t,r]=(0,f.useState)(e);return n_(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function nN(e,t){let r=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,f.useEffect)(()=>()=>{r.current=!1},[])}function nJ(){return(0,f.useReducer)(()=>[],[])}function nK(e){return nk("function"==typeof e?e:()=>e)}function nQ(e,t,r=[]){let n=(0,f.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function nV(e=!1,t){let[r,n]=(0,f.useState)(null);return{portalRef:nU(n,t),portalNode:r,domReady:!e||r}}var nX=!1,nq=!1,nW=0,nY=0;function nz(e){let t,r;t=e.movementX||e.screenX-nW,r=e.movementY||e.screenY-nY,nW=e.screenX,nY=e.screenY,(t||r||0)&&(nq=!0)}function nZ(){nq=!1}function n$(e){let t=f.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function n0(e,t){return f.memo(e,t)}function n1(e,t){let r,{wrapElement:n,render:i,...a}=t,o=nU(t.ref,i&&(0,f.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(f.isValidElement(i)){let e={...i.props,ref:o};r=f.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!nA(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(a,e))}else r=i?i(a):(0,d.jsx)(e,{...a});return n?n(r):r}function n9(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function n2(e=[],t=[]){let r=f.createContext(void 0),n=f.createContext(void 0),i=()=>f.useContext(r),a=t=>e.reduceRight((e,r)=>(0,d.jsx)(r,{...t,children:e}),(0,d.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=f.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=f.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:a,ScopedContextProvider:e=>(0,d.jsx)(a,{...e,children:t.reduceRight((t,r)=>(0,d.jsx)(r,{...e,children:t}),(0,d.jsx)(n.Provider,{...e}))})}}var n3=n2(),n8=n3.useContext;n3.useScopedContext,n3.useProviderContext;var n5=n2([n3.ContextProvider],[n3.ScopedContextProvider]),n6=n5.useContext;n5.useScopedContext;var n4=n5.useProviderContext,n7=n5.ContextProvider,ie=n5.ScopedContextProvider,it=(0,f.createContext)(void 0),ir=(0,f.createContext)(void 0),ii=(0,f.createContext)(!0),ia="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function io(e){return!(!e.matches(ia)||!na(e)||e.closest("[inert]"))}function is(e){if(!io(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=ne(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function il(e,t){let r=Array.from(e.querySelectorAll(ia));t&&r.unshift(e);let n=r.filter(io);return n.forEach((e,t)=>{if(nr(e)&&e.contentDocument){let r=e.contentDocument.body;n.splice(t,1,...il(r))}}),n}function iu(e,t,r){let n=Array.from(e.querySelectorAll(ia)),i=n.filter(is);return(t&&is(e)&&i.unshift(e),i.forEach((e,t)=>{if(nr(e)&&e.contentDocument){let n=iu(e.contentDocument.body,!1,r);i.splice(t,1,...n)}}),!i.length&&r)?n:i}function ic(e,t){var r;let n,i,a,o;return r=document.body,n=ne(r),a=(i=il(r,!1)).indexOf(n),(o=i.slice(a+1)).find(is)||(e?i.find(is):null)||(t?o[0]:null)||null}function id(e,t){var r;let n,i,a,o;return r=document.body,n=ne(r),a=(i=il(r,!1).reverse()).indexOf(n),(o=i.slice(a+1)).find(is)||(e?i.find(is):null)||(t?o[0]:null)||null}function ih(e){let t=ne(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function im(e){let t=ne(e);if(!t)return!1;if(nt(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function ip(e){!im(e)&&io(e)&&e.focus()}var iA=nS(),ig=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],iv=Symbol("safariFocusAncestor");function iB(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function iC(e,t){return nk(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var iy=!1,ib=!0;function ix(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(ib=!1)}function iE(e){e.metaKey||e.ctrlKey||e.altKey||(ib=!0)}var iM=n9(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var a,o,s,l,u;let c=(0,f.useRef)(null);(0,f.useEffect)(()=>{!e||iy||(nL("mousedown",ix,!0),nL("keydown",iE,!0),iy=!0)},[e]),iA&&(0,f.useEffect)(()=>{if(!e)return;let t=c.current;if(!t||!iB(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&ny(i),h=!!d&&!t,[m,p]=(0,f.useState)(!1);(0,f.useEffect)(()=>{e&&h&&m&&p(!1)},[e,h,m]),(0,f.useEffect)(()=>{if(!e||!m)return;let t=c.current;if(!t||"undefined"==typeof IntersectionObserver)return;let r=new IntersectionObserver(()=>{io(t)||p(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let A=iC(i.onKeyPressCapture,d),g=iC(i.onMouseDownCapture,d),v=iC(i.onClickCapture,d),B=i.onMouseDown,C=nk(t=>{if(null==B||B(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!iA||nT(t)||!nn(r)&&!iB(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let a=function(e){for(;e&&!io(e);)e=e.closest(ia);return e||null}(r.parentElement);a&&(a[iv]=!0),nG(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),a&&(a[iv]=!1),n||ip(r)})}),y=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&ih(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",p(!0)))},b=i.onKeyDownCapture,x=nk(t=>{if(null==b||b(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!nR(t))return;let r=t.currentTarget;nG(r,"focusout",()=>y(t,r))}),E=i.onFocusCapture,M=nk(t=>{if(null==E||E(t),t.defaultPrevented||!e)return;if(!nR(t))return void p(!1);let r=t.currentTarget;ib||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:ig.includes(n))}(t.target)?nG(t.target,"focusout",()=>y(t,r)):p(!1)}),F=i.onBlur,S=nk(t=>{null==F||F(t),!e||nw(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),p(!1))}),T=(0,f.useContext)(ii),R=nk(t=>{e&&r&&t&&T&&queueMicrotask(()=>{ih(t)||io(t)&&t.focus()})}),D=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,f.useState)(()=>r(void 0));return n_(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(c),I=e&&(!D||"button"===D||"summary"===D||"input"===D||"select"===D||"textarea"===D||"a"===D),w=e&&(!D||"button"===D||"input"===D||"select"===D||"textarea"===D),G=i.style,L=(0,f.useMemo)(()=>h?{pointerEvents:"none",...G}:G,[h,G]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:nU(c,R,i.ref),style:L,tabIndex:(a=e,o=h,s=I,l=w,u=i.tabIndex,a?o?s&&!l?-1:void 0:s?u:u||0:u),disabled:!!w&&!!h||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:A,onClickCapture:v,onMouseDownCapture:g,onMouseDown:C,onKeyDownCapture:x,onFocusCapture:M,onBlur:S},nb(i)});function iF(e){let t=[];for(let r of e)t.push(...r);return t}function iS(e){return e.slice().reverse()}function iT(e,t,r){return nk(n=>{var i;let a,o;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!nR(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(a=n.target)||no(a))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let s=e.getState(),l=null==(i=nf(e,s.activeId))?void 0:i.element;if(!l)return;let{view:u,...c}=n;l!==(null==r?void 0:r.current)&&l.focus(),o=new KeyboardEvent(n.type,c),l.dispatchEvent(o)||n.preventDefault(),n.currentTarget.contains(l)&&n.stopPropagation()})}n$(function(e){return n1("div",iM(e))});var iR=n9(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=n4();nB(e=e||a,!1);let o=(0,f.useRef)(null),s=(0,f.useRef)(null),l=function(e){let[t,r]=(0,f.useState)(!1),n=(0,f.useCallback)(()=>r(!0),[]),i=e.useState(t=>nf(e,t.activeId));return(0,f.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),u=e.useState("moves"),[,c]=function(e){let[t,r]=(0,f.useState)(null);return n_(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,f.useEffect)(()=>{var n;if(!e||!u||!t||!r)return;let{activeId:i}=e.getState(),a=null==(n=nf(e,i))?void 0:n.element;a&&("scrollIntoView"in a?(a.focus({preventScroll:!0}),a.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):a.focus())},[e,u,t,r]),n_(()=>{if(!e||!u||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=s.current;s.current=null,i&&nD(i,{relatedTarget:r}),ih(r)||r.focus()},[e,u,t]);let h=e.useState("activeId"),m=e.useState("virtualFocus");n_(()=>{var r;if(!e||!t||!m)return;let n=s.current;if(s.current=null,!n)return;let i=(null==(r=nf(e,h))?void 0:r.element)||ne(n);i!==n&&nD(n,{relatedTarget:i})},[e,h,m,t]);let p=iT(e,i.onKeyDownCapture,s),A=iT(e,i.onKeyUpCapture,s),g=i.onFocusCapture,v=nk(t=>{var r;let n;if(null==g||g(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let a=t.relatedTarget,o=(n=(r=t.currentTarget)[nh],delete r[nh],n);nR(t)&&o&&(t.stopPropagation(),s.current=a)}),B=i.onFocus,C=nk(r=>{if(null==B||B(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?nR(r)&&!nm(e,n)&&queueMicrotask(l):nR(r)&&e.setActiveId(null)}),y=i.onBlurCapture,b=nk(t=>{var r;if(null==y||y(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let a=null==(r=nf(e,i))?void 0:r.element,o=t.relatedTarget,l=nm(e,o),u=s.current;s.current=null,nR(t)&&l?(o===a?u&&u!==o&&nD(u,t):a?nD(a,t):u&&nD(u,t),t.stopPropagation()):!nm(e,t.target)&&a&&nD(a,t)}),x=i.onKeyDown,E=nK(n),M=nk(t=>{var r;if(null==x||x(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!nR(t))return;let{orientation:n,renderedItems:i,activeId:a}=e.getState(),o=nf(e,a);if(null==(r=null==o?void 0:o.element)?void 0:r.isConnected)return;let s="horizontal"!==n,l="vertical"!==n,u=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&no(t.currentTarget))return;let c={ArrowUp:(u||s)&&(()=>{if(u){let e=iF(iS(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(u||l)&&e.first,ArrowDown:(u||s)&&e.first,ArrowLeft:(u||l)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!E(t))return;t.preventDefault(),e.move(r)}}});return i=nQ(i,t=>(0,d.jsx)(n7,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=nf(e,r.activeId))?void 0:n.id}),...i,ref:nU(o,c,i.ref),onKeyDownCapture:p,onKeyUpCapture:A,onFocusCapture:v,onFocus:C,onBlurCapture:b,onKeyDown:M},i=iM({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});n$(function(e){return n1("div",iR(e))});var iD=n2();iD.useContext,iD.useScopedContext;var iI=iD.useProviderContext,iw=n2([iD.ContextProvider],[iD.ScopedContextProvider]);iw.useContext,iw.useScopedContext;var iG=iw.useProviderContext,iL=iw.ContextProvider,iP=iw.ScopedContextProvider,iO=(0,f.createContext)(void 0),iH=(0,f.createContext)(void 0),i_=n2([iL],[iP]);i_.useContext,i_.useScopedContext;var ik=i_.useProviderContext,iU=i_.ContextProvider,ij=i_.ScopedContextProvider,iN=n9(function({store:e,...t}){let r=ik();return e=e||r,t={...t,ref:nU(null==e?void 0:e.setAnchorElement,t.ref)}});n$(function(e){return n1("div",iN(e))});var iJ=(0,f.createContext)(void 0),iK=n2([iU,n7],[ij,ie]),iQ=iK.useContext,iV=iK.useScopedContext,iX=iK.useProviderContext,iq=iK.ContextProvider,iW=iK.ScopedContextProvider,iY=(0,f.createContext)(void 0),iz=(0,f.createContext)(!1);function iZ(e,t){let r=e.__unstableInternals;return nB(r,"Invalid store"),r[t]}function i$(e,...t){let r=e,n=r,i=Symbol(),a=np,o=new Set,s=new Set,l=new Set,u=new Set,c=new Set,d=new WeakMap,f=new WeakMap,h=(e,t,r=u)=>(r.add(t),f.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),f.delete(t),r.delete(t)}),m=(e,a,o=!1)=>{var l,h;if(!nA(r,e))return;let m=(h=r[e],"function"==typeof a?a("function"==typeof h?h():h):a);if(m===r[e])return;if(!o)for(let r of t)null==(l=null==r?void 0:r.setState)||l.call(r,e,m);let p=r;r={...r,[e]:m};let A=Symbol();i=A,s.add(e);let g=(t,n,i)=>{var a;let o=f.get(t);(!o||o.some(t=>i?i.has(t):t===e))&&(null==(a=d.get(t))||a(),d.set(t,t(r,n)))};for(let e of u)g(e,p);queueMicrotask(()=>{if(i!==A)return;let e=r;for(let e of c)g(e,n,s);n=e,s.clear()})},p={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{let e=o.size,n=Symbol();o.add(n);let i=()=>{o.delete(n),o.size||a()};if(e)return i;let s=Object.keys(r).map(e=>ng(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&nA(n,e))return i2(t,[e],t=>{m(e,t[e],!0)})}))),u=[];for(let e of l)u.push(e());return a=ng(...s,...u,...t.map(i1)),i},subscribe:(e,t)=>h(e,t),sync:(e,t)=>(d.set(t,t(r,r)),h(e,t)),batch:(e,t)=>(d.set(t,t(r,n)),h(e,t,c)),pick:e=>i$(function(e,t){let r={};for(let n of t)nA(e,n)&&(r[n]=e[n]);return r}(r,e),p),omit:e=>i$(function(e,t){let r={...e};for(let e of t)nA(r,e)&&delete r[e];return r}(r,e),p)}};return p}function i0(e,...t){if(e)return iZ(e,"setup")(...t)}function i1(e,...t){if(e)return iZ(e,"init")(...t)}function i9(e,...t){if(e)return iZ(e,"subscribe")(...t)}function i2(e,...t){if(e)return iZ(e,"sync")(...t)}function i3(e,...t){if(e)return iZ(e,"batch")(...t)}function i8(e,...t){if(e)return iZ(e,"omit")(...t)}function i5(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=i$(r,...e);return Object.assign({},...e,n)}function i6(e,t){}function i4(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function i7(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var ae=n9(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:a=0,showOnChange:o,showOnMouseDown:s,showOnClick:l=s,showOnKeyDown:u,showOnKeyPress:c=u,blurActiveItemOnClick:d,setValueOnClick:h=!0,moveOnKeyPress:m=!0,autoComplete:p="list",...A}){var g;let v,B=iX();nB(e=e||B,!1);let C=(0,f.useRef)(null),[y,b]=nJ(),x=(0,f.useRef)(!1),E=(0,f.useRef)(!1),M=e.useState(e=>e.virtualFocus&&r),F="inline"===p||"both"===p,[S,T]=(0,f.useState)(F);g=[F],v=(0,f.useRef)(!1),n_(()=>{if(v.current)return(()=>{F&&T(!0)})();v.current=!0},g),n_(()=>()=>{v.current=!1},[]);let R=e.useState("value"),D=(0,f.useRef)();(0,f.useEffect)(()=>i2(e,["selectedValue","activeId"],(e,t)=>{D.current=t.selectedValue}),[]);let I=e.useState(e=>{var t;if(F&&S){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=D.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),w=e.useState("renderedItems"),G=e.useState("open"),L=e.useState("contentElement"),P=(0,f.useMemo)(()=>{if(!F||!S)return R;if(i4(w,I,M)){if(i7(R,I)){let e=(null==I?void 0:I.slice(R.length))||"";return R+e}return R}return I||R},[F,S,w,I,M,R]);(0,f.useEffect)(()=>{let e=C.current;if(!e)return;let t=()=>T(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,f.useEffect)(()=>{if(!F||!S||!I||!i4(w,I,M)||!i7(R,I))return;let e=np;return queueMicrotask(()=>{let t=C.current;if(!t)return;let{start:r,end:n}=nl(t),i=R.length,a=I.length;nd(t,i,a),e=()=>{if(!ih(t))return;let{start:e,end:o}=nl(t);e!==i||o===a&&nd(t,r,n)}}),()=>e()},[y,F,S,I,w,M,R]);let O=(0,f.useRef)(null),H=nk(n),_=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(!G||!L)return;let t=nc(L);if(!t)return;O.current=t;let r=()=>{x.current=!1},n=()=>{if(!e||!x.current)return;let{activeId:t}=e.getState();null===t||t!==_.current&&(x.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[G,L,e]),n_(()=>{!R||E.current||(x.current=!0)},[R]),n_(()=>{"always"!==M&&G||(x.current=G)},[M,G]);let k=e.useState("resetValueOnSelect");nN(()=>{var t,r;let n=x.current;if(!e||!G||!n&&!k)return;let{baseElement:i,contentElement:a,activeId:o}=e.getState();if(!i||ih(i)){if(null==a?void 0:a.hasAttribute("data-placing")){let e=new MutationObserver(b);return e.observe(a,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(M&&n){let r,n=H(w),i=void 0!==n?n:null!=(t=null==(r=w.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();_.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(o||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,G,y,R,M,k,H,w]),(0,f.useEffect)(()=>{if(!F)return;let t=C.current;if(!t)return;let r=[t,L].filter(e=>!!e),n=t=>{r.every(e=>nw(t,e))&&(null==e||e.setValue(P))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[F,L,e,P]);let U=e=>e.currentTarget.value.length>=a,j=A.onChange,N=nK(null!=o?o:U),J=nK(null!=i?i:!e.tag),K=nk(t=>{if(null==j||j(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:a}=r,o=t.nativeEvent;if(x.current=!0,"input"===o.type&&(o.isComposing&&(x.current=!1,E.current=!0),F)){let e="insertText"===o.inputType||"insertCompositionText"===o.inputType,t=i===n.length;T(e&&t)}if(J(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{nd(r,i,a)}),F&&M&&t&&b()}N(t)&&e.show(),M&&x.current||e.setActiveId(null)}),Q=A.onCompositionEnd,V=nk(e=>{x.current=!0,E.current=!1,null==Q||Q(e),e.defaultPrevented||M&&b()}),X=A.onMouseDown,q=nK(null!=d?d:()=>!!(null==e?void 0:e.getState().includesBaseElement)),W=nK(h),Y=nK(null!=l?l:U),z=nk(t=>{null==X||X(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(q(t)&&e.setActiveId(null),W(t)&&e.setValue(P),Y(t)&&nG(t.currentTarget,"mouseup",e.show))}),Z=A.onKeyDown,$=nK(null!=c?c:U),ee=nk(t=>{if(null==Z||Z(t),t.repeat||(x.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&$(t)&&(t.preventDefault(),e.show())}),et=A.onBlur,er=nk(e=>{if(x.current=!1,null==et||et(e),e.defaultPrevented)return}),en=nj(A.id),ei=e.useState(e=>null===e.activeId);return A={id:en,role:"combobox","aria-autocomplete":"inline"===p||"list"===p||"both"===p||"none"===p?p:void 0,"aria-haspopup":nu(L,"listbox"),"aria-expanded":G,"aria-controls":null==L?void 0:L.id,"data-active-item":ei||void 0,value:P,...A,ref:nU(C,A.ref),onChange:K,onCompositionEnd:V,onMouseDown:z,onKeyDown:ee,onBlur:er},A=iR({store:e,focusable:t,...A,moveOnKeyPress:e=>!nC(m,e)&&(F&&T(!0),!0)}),{autoComplete:"off",...A=iN({store:e,...A})}}),at=n$(function(e){return n1("input",ae(e))});function ar(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var an=Symbol("composite-hover"),ai=n9(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=n6();nB(e=e||i,!1);let a=((0,f.useEffect)(()=>{nX||(nL("mousemove",nz,!0),nL("mousedown",nZ,!0),nL("mouseup",nZ,!0),nL("keydown",nZ,!0),nL("scroll",nZ,!0),nX=!0)},[]),nk(()=>nq)),o=n.onMouseMove,s=nK(t),l=nk(t=>{if((null==o||o(t),!t.defaultPrevented&&a())&&s(t)){if(!im(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!ih(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),u=n.onMouseLeave,c=nK(r),d=nk(t=>{var r;let n;null==u||u(t),!t.defaultPrevented&&a()&&((n=ar(t))&&nt(t.currentTarget,n)||function(e){let t=ar(e);if(!t)return!1;do{if(nA(t,an)&&t[an])return!0;t=t.parentElement}while(t)return!1}(t)||!s(t)||c(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),h=(0,f.useCallback)(e=>{e&&(e[an]=!0)},[]);return nb(n={...n,ref:nU(h,n.ref),onMouseMove:l,onMouseLeave:d})});n0(n$(function(e){return n1("div",ai(e))}));var aa=n9(function({store:e,shouldRegisterItem:t=!0,getItem:r=nv,element:n,...i}){let a=n8();e=e||a;let o=nj(i.id),s=(0,f.useRef)(n);return(0,f.useEffect)(()=>{let n=s.current;if(!o||!n||!t)return;let i=r({id:o,element:n});return null==e?void 0:e.renderItem(i)},[o,t,r,e]),nb(i={...i,ref:nU(s,i.ref)})});function ao(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?nn(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(nn(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}n$(function(e){return n1("div",aa(e))});var as=Symbol("command"),al=n9(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...r}){let n,i,a=(0,f.useRef)(null),[o,s]=(0,f.useState)(!1);(0,f.useEffect)(()=>{a.current&&s(nn(a.current))},[]);let[l,u]=(0,f.useState)(!1),c=(0,f.useRef)(!1),d=ny(r),[h,m]=(n=r.onLoadedMetadataCapture,i=(0,f.useMemo)(()=>Object.assign(()=>{},{...n,[as]:!0}),[n,as,!0]),[null==n?void 0:n[as],{onLoadedMetadataCapture:i}]),p=r.onKeyDown,A=nk(r=>{null==p||p(r);let n=r.currentTarget;if(r.defaultPrevented||h||d||!nR(r)||no(n)||n.isContentEditable)return;let i=e&&"Enter"===r.key,a=t&&" "===r.key,o="Enter"===r.key&&!e,s=" "===r.key&&!t;if(o||s)return void r.preventDefault();if(i||a){let e=ao(r);if(i){if(!e){r.preventDefault();let{view:e,...t}=r,i=()=>nI(n,t);r6&&/firefox\//i.test(navigator.userAgent)?nG(n,"keyup",i):queueMicrotask(i)}}else a&&(c.current=!0,e||(r.preventDefault(),u(!0)))}}),g=r.onKeyUp,v=nk(e=>{if(null==g||g(e),e.defaultPrevented||h||d||e.metaKey)return;let r=t&&" "===e.key;if(c.current&&r&&(c.current=!1,!ao(e))){e.preventDefault(),u(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>nI(t,n))}});return iM(r={"data-active":l||void 0,type:o?"button":void 0,...m,...r,ref:nU(a,r.ref),onKeyDown:A,onKeyUp:v})});n$(function(e){return n1("button",al(e))});var{useSyncExternalStore:au}=e.i(2239).default,ac=()=>()=>{};function ad(e,t=nv){let r=f.useCallback(t=>e?i9(e,null,t):ac(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&nA(i,r)?i[r]:void 0};return au(r,n,n)}function af(e,t){let r=f.useRef({}),n=f.useCallback(t=>e?i9(e,null,t):ac(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,a=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==a[e]&&(a[e]=t,i=!0)}if("string"==typeof r){if(!n||!nA(n,r))continue;let t=n[r];t!==a[e]&&(a[e]=t,i=!0)}}return i&&(r.current={...a}),r.current};return au(n,i,i)}function ah(e,t,r,n){var i;let a,o=nA(t,r)?t[r]:void 0,s=(i={value:o,setValue:n?t[n]:void 0},a=(0,f.useRef)(i),n_(()=>{a.current=i}),a);n_(()=>i2(e,[r],(e,t)=>{let{value:n,setValue:i}=s.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),n_(()=>{if(void 0!==o)return e.setState(r,o),i3(e,[r],()=>{void 0!==o&&e.setState(r,o)})})}function am(e,t){let[r,n]=f.useState(()=>e(t));n_(()=>i1(r),[r]);let i=f.useCallback(e=>ad(r,e),[r]);return[f.useMemo(()=>({...r,useState:i}),[r,i]),nk(()=>{n(r=>e({...t,...r.getState()}))})]}function ap(e,t,r,n=!1){var i;let a,o;if(!t||!r)return;let{renderedItems:s}=t.getState(),l=nc(e);if(!l)return;let u=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),a=t?r-i+n:i+n;return"HTML"===e.tagName?a+e.scrollTop:a}(l,n);for(let e=0;e=0){void 0!==o&&ot||(e&&(null==m?void 0:m.baseElement)&&m.baseElement===e.baseElement?m.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===c,ariaSetSize:e=>null!=o?o:e&&(null==m?void 0:m.ariaSetSize)&&m.baseElement===e.baseElement?m.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==m?void 0:m.ariaPosInSet)||m.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===A);return m.ariaPosInSet+t.findIndex(e=>e.id===c)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(i)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===c}}),b=(0,f.useCallback)(e=>{var t;let r={...e,id:c||e.id,rowId:A,disabled:!!p,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[c,A,p,a]),x=l.onFocus,E=(0,f.useRef)(!1),M=nk(t=>{var r,n;if(null==x||x(t),t.defaultPrevented||nT(t)||!c||!e||(r=e,!nR(t)&&nm(r,t.target)))return;let{virtualFocus:i,baseElement:a}=e.getState();e.setActiveId(c),ns(t.currentTarget)&&function(e,t=!1){if(no(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=r4(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!i||!nR(t)||!ns(n=t.currentTarget)&&("INPUT"!==n.tagName||nn(n))&&(null==a?void 0:a.isConnected)&&((nS()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),E.current=!0,t.relatedTarget===a||nm(e,t.relatedTarget))?(a[nh]=!0,a.focus({preventScroll:!0})):a.focus())}),F=l.onBlurCapture,S=nk(t=>{if(null==F||F(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&E.current&&(E.current=!1,t.preventDefault(),t.stopPropagation())}),T=l.onKeyDown,R=nK(r),D=nK(n),I=nk(t=>{if(null==T||T(t),t.defaultPrevented||!nR(t)||!e)return;let{currentTarget:r}=t,n=e.getState(),i=e.item(c),a=!!(null==i?void 0:i.rowId),o="horizontal"!==n.orientation,s="vertical"!==n.orientation,l=()=>!(!a&&!s&&n.baseElement&&no(n.baseElement)),u={ArrowUp:(a||o)&&e.up,ArrowRight:(a||s)&&e.next,ArrowDown:(a||o)&&e.down,ArrowLeft:(a||s)&&e.previous,Home:()=>{if(l())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(l())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>ap(r,e,null==e?void 0:e.up,!0),PageDown:()=>ap(r,e,null==e?void 0:e.down)}[t.key];if(u){if(ns(r)){let e=nl(r),n=s&&"ArrowLeft"===t.key,i=s&&"ArrowRight"===t.key,a=o&&"ArrowUp"===t.key,l=o&&"ArrowDown"===t.key;if(i||l){let{length:t}=function(e){if(no(e))return e.value;if(e.isContentEditable){let t=r4(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((n||a)&&0!==e.start)return}let n=u();if(R(t)||void 0!==n){if(!D(t))return;t.preventDefault(),e.move(n)}}}),w=(0,f.useMemo)(()=>({id:c,baseElement:g}),[c,g]);return l={id:c,"data-active-item":v||void 0,...l=nQ(l,e=>(0,d.jsx)(it.Provider,{value:w,children:e}),[w]),ref:nU(h,l.ref),tabIndex:y?l.tabIndex:-1,onFocus:M,onBlurCapture:S,onKeyDown:I},l=al(l),nb({...l=aa({store:e,...l,getItem:b,shouldRegisterItem:!!c&&l.shouldRegisterItem}),"aria-setsize":B,"aria-posinset":C})});n0(n$(function(e){return n1("button",aA(e))}));var ag=n9(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:a,focusOnHover:o=!1,moveOnKeyPress:s=!0,getItem:l,...u}){var c,h;let m=iV();nB(e=e||m,!1);let{resetValueOnSelectState:p,multiSelectable:A,selected:g}=af(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),v=(0,f.useCallback)(e=>{let r={...e,value:t};return l?l(r):r},[t,l]);n=null!=n?n:!A,r=null!=r?r:null!=t&&!A;let B=u.onClick,C=nK(n),y=nK(i),b=nK(null!=(c=null!=a?a:p)?c:A),x=nK(r),E=nk(r=>{null==B||B(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=nF();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(y(r)&&(b(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),C(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),M=u.onKeyDown,F=nk(t=>{if(null==M||M(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||ih(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),no(r)&&(null==e||e.setValue(r.value)))});A&&null!=g&&(u={"aria-selected":g,...u}),u=nQ(u,e=>(0,d.jsx)(iY.Provider,{value:t,children:(0,d.jsx)(iz.Provider,{value:null!=g&&g,children:e})}),[t,g]),u={role:null!=(h=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,f.useContext)(iJ)])?h:"option",children:t,...u,onClick:E,onKeyDown:F};let S=nK(s);return u=aA({store:e,...u,getItem:v,moveOnKeyPress:t=>{if(!S(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),u=ai({store:e,focusOnHover:o,...u})}),av=n0(n$(function(e){return n1("div",ag(e))})),aB=e.i(74080);function aC(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function ay(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function ab(e,t,r){return!r&&!1!==t&&(!e||!!t)}var ax=n9(function({store:e,alwaysVisible:t,...r}){let n=iI();nB(e=e||n,!1);let i=(0,f.useRef)(null),a=nj(r.id),[o,s]=(0,f.useState)(null),l=e.useState("open"),u=e.useState("mounted"),c=e.useState("animated"),h=e.useState("contentElement"),m=ad(e.disclosure,"contentElement");n_(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),n_(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),n_(()=>{if(c){var e;let t;return(null==h?void 0:h.isConnected)?(e=()=>{s(l?"enter":u?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void s(null)}},[c,h,l,u]),n_(()=>{if(!e||!c||!o||!h)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,aB.flushSync)(t);if("leave"===o&&l||"enter"===o&&!l)return;if("number"==typeof c)return aC(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:a,animationDelay:s}=getComputedStyle(h),{transitionDuration:u="0",animationDuration:d="0",transitionDelay:f="0",animationDelay:p="0"}=m?getComputedStyle(m):{},A=ay(a,s,f,p)+ay(n,i,u,d);if(!A){"enter"===o&&e.setState("animated",!1),t();return}return aC(Math.max(A-1e3/60,0),r)},[e,c,h,m,l,o]);let p=ab(u,(r=nQ(r,t=>(0,d.jsx)(iP,{value:e,children:t}),[e])).hidden,t),A=r.style,g=(0,f.useMemo)(()=>p?{...A,display:"none"}:A,[p,A]);return nb(r={id:a,"data-open":l||void 0,"data-enter":"enter"===o||void 0,"data-leave":"leave"===o||void 0,hidden:p,...r,ref:nU(a?e.setContentElement:null,i,r.ref),style:g})}),aE=n$(function(e){return n1("div",ax(e))});n$(function({unmountOnHide:e,...t}){let r=iI();return!1===ad(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,d.jsx)(aE,{...t})});var aM=n9(function({store:e,alwaysVisible:t,...r}){let n=iV(!0),i=iQ(),a=!!(e=e||i)&&e===n;nB(e,!1);let o=(0,f.useRef)(null),s=nj(r.id),l=e.useState("mounted"),u=ab(l,r.hidden,t),c=u?{...r.style,display:"none"}:r.style,h=e.useState(e=>Array.isArray(e.selectedValue)),m=function(e,t,r){let n=function(e){let[t]=(0,f.useState)(e);return t}(r),[i,a]=(0,f.useState)(n);return(0,f.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);a(null==e?n:e)},o=new MutationObserver(i);return o.observe(r,{attributeFilter:[t]}),i(),()=>o.disconnect()},[e,t,n]),i}(o,"role",r.role),p="listbox"===m||"tree"===m||"grid"===m,[A,g]=(0,f.useState)(!1),v=e.useState("contentElement");n_(()=>{if(!l)return;let e=o.current;if(!e||v!==e)return;let t=()=>{g(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[l,v]),A||(r={role:"listbox","aria-multiselectable":p&&h||void 0,...r}),r=nQ(r,t=>(0,d.jsx)(iW,{value:e,children:(0,d.jsx)(iJ.Provider,{value:m,children:t})}),[e,m]);let B=!s||n&&a?null:e.setContentElement;return nb(r={id:s,hidden:u,...r,ref:nU(B,o,r.ref),style:c})}),aF=n$(function(e){return n1("div",aM(e))}),aS=(0,f.createContext)(null),aT=n9(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});n$(function(e){return n1("span",aT(e))});var aR=n9(function(e){return aT(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),aD=n$(function(e){return n1("span",aR(e))});function aI(e){queueMicrotask(()=>{null==e||e.focus()})}var aw=n9(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:n,portal:i=!0,...a}){let o=(0,f.useRef)(null),s=nU(o,a.ref),l=(0,f.useContext)(aS),[u,c]=(0,f.useState)(null),[h,m]=(0,f.useState)(null),p=(0,f.useRef)(null),A=(0,f.useRef)(null),g=(0,f.useRef)(null),v=(0,f.useRef)(null);return n_(()=>{let e=o.current;if(!e||!i)return void c(null);let t=r?"function"==typeof r?r(e):r:r4(e).createElement("div");if(!t)return void c(null);let a=t.isConnected;if(a||(l||r4(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),c(t),nE(n,t),!a)return()=>{t.remove(),nE(n,null)}},[i,r,l,n]),n_(()=>{if(!i||!e||!t)return;let r=r4(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),m(r),()=>{r.remove(),m(null)}},[i,e,t]),(0,f.useEffect)(()=>{if(!u||!e)return;let t=0,r=e=>{if(!nw(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=u.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(u.hasAttribute("data-tabindex")&&t(u),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of iu(u,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return u.addEventListener("focusin",r,!0),u.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),u.removeEventListener("focusin",r,!0),u.removeEventListener("focusout",r,!0)}},[u,e]),a={...a=nQ(a,t=>{if(t=(0,d.jsx)(aS.Provider,{value:u||l,children:t}),!i)return t;if(!u)return(0,d.jsx)("span",{ref:s,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,d.jsxs)(d.Fragment,{children:[e&&u&&(0,d.jsx)(aD,{ref:A,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{nw(e,u)?aI(ic()):aI(p.current)}}),t,e&&u&&(0,d.jsx)(aD,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{nw(e,u)?aI(id()):aI(v.current)}})]}),u&&(t=(0,aB.createPortal)(t,u));let r=(0,d.jsxs)(d.Fragment,{children:[e&&u&&(0,d.jsx)(aD,{ref:p,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==v.current&&nw(e,u)?aI(A.current):aI(id())}}),e&&(0,d.jsx)("span",{"aria-owns":null==u?void 0:u.id,style:{position:"fixed"}}),e&&u&&(0,d.jsx)(aD,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(nw(e,u))aI(g.current);else{let e=ic();if(e===A.current)return void requestAnimationFrame(()=>{var e;return null==(e=ic())?void 0:e.focus()});aI(e)}}})]});return h&&e&&(r=(0,aB.createPortal)(r,h)),(0,d.jsxs)(d.Fragment,{children:[r,t]})},[u,l,i,a.id,e,h]),ref:s}});n$(function(e){return n1("div",aw(e))});var aG=(0,f.createContext)(0);function aL({level:e,children:t}){let r=(0,f.useContext)(aG),n=Math.max(Math.min(e||r+1,6),1);return(0,d.jsx)(aG.Provider,{value:n,children:t})}var aP=n9(function({autoFocusOnShow:e=!0,...t}){return nQ(t,t=>(0,d.jsx)(ii.Provider,{value:e,children:t}),[e])});n$(function(e){return n1("div",aP(e))});var aO=new WeakMap;function aH(e,t,r){aO.has(e)||aO.set(e,new Map);let n=aO.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let a=r(),o=()=>{a(),i(),n.delete(t)};return n.set(t,o),()=>{n.get(t)===o&&(a(),n.set(t,i))}}function a_(e,t,r){return aH(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function ak(e,t,r){return aH(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function aU(e,t){return e?aH(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var aj=["SCRIPT","STYLE"];function aN(e){return`__ariakit-dialog-snapshot-${e}`}function aJ(e,t,r,n){for(let i of t){if(!(null==i?void 0:i.isConnected))continue;let a=t.some(e=>!!e&&e!==i&&e.contains(i)),o=r4(i),s=i;for(;i.parentElement&&i!==o.body;){if(null==n||n(i.parentElement,s),!a)for(let n of i.parentElement.children)(function(e,t,r){return!aj.includes(t.tagName)&&!!function(e,t){let r=r4(t),n=aN(e);if(!r.body[n])return!0;for(;;){if(t===r.body)return!1;if(t[n])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&nt(t,e))})(e,n,t)&&r(n,s);i=i.parentElement}}}function aK(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function aQ(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function aV(e,t=""){return ng(ak(e,aQ("",!0),!0),ak(e,aQ(t,!0),!0))}function aX(e,t){if(e[aQ(t,!0)])return!0;let r=aQ(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function aq(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return aJ(e,t,t=>{aK(t,...n)||r.unshift(function(e,t=""){return ng(ak(e,aQ(),!0),ak(e,aQ(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(aV(t,e))}),()=>{for(let e of r)e()}}function aW({store:e,type:t,listener:r,capture:n,domReady:i}){let a=nk(r),o=ad(e,"open"),s=(0,f.useRef)(!1);n_(()=>{if(!o||!i)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,o,i]),(0,f.useEffect)(()=>{if(o)return nL(t,t=>{let{contentElement:r,disclosureElement:n}=e.getState(),i=t.target;!r||!i||!(!("HTML"===i.tagName||nt(r4(i).body,i))||nt(r,i)||function(e,t){if(!e)return!1;if(nt(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=r4(e).getElementById(r);if(t)return nt(e,t)}return!1}(n,i)||i.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||aX(i,r.id))&&(i&&i[iv]||a(t))},n)},[o,n])}function aY(e,t){return"function"==typeof e?e(t):!!e}var az=(0,f.createContext)({});function aZ(){return"inert"in HTMLElement.prototype}function a$(e,t){if(!("style"in e))return np;if(aZ())return ak(e,"inert",!0);let r=iu(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&nt(t,e)))return np;let r=aH(e,"focus",()=>(e.focus=np,()=>{delete e.focus}));return ng(a_(e,"tabindex","-1"),r)});return ng(...r,a_(e,"aria-hidden","true"),aU(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function a0(e={}){let t=i5(e.store,i8(e.disclosure,["contentElement","disclosureElement"]));i6(e,t);let r=null==t?void 0:t.getState(),n=nx(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=nx(e.animated,null==r?void 0:r.animated,!1),a=i$({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:nx(null==r?void 0:r.contentElement,null),disclosureElement:nx(null==r?void 0:r.disclosureElement,null)},t);return i0(a,()=>i2(a,["animated","animating"],e=>{e.animated||a.setState("animating",!1)})),i0(a,()=>i9(a,["open"],()=>{a.getState().animated&&a.setState("animating",!0)})),i0(a,()=>i2(a,["open","animating"],e=>{a.setState("mounted",e.open||e.animating)})),{...a,disclosure:e.disclosure,setOpen:e=>a.setState("open",e),show:()=>a.setState("open",!0),hide:()=>a.setState("open",!1),toggle:()=>a.setState("open",e=>!e),stopAnimation:()=>a.setState("animating",!1),setContentElement:e=>a.setState("contentElement",e),setDisclosureElement:e=>a.setState("disclosureElement",e)}}function a1(e,t,r){return nN(t,[r.store,r.disclosure]),ah(e,r,"open","setOpen"),ah(e,r,"mounted","setMounted"),ah(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}n9(function(e){return e});var a9=n$(function(e){return n1("div",e)});function a2({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,f.useRef)(null),a=function(e={}){let[t,r]=am(a0,e);return a1(t,r,e)}({disclosure:e}),o=ad(e,"contentElement");(0,f.useEffect)(()=>{let e=i.current;!e||o&&(e.style.zIndex=getComputedStyle(o).zIndex)},[o]),n_(()=>{let e=null==o?void 0:o.id;if(!e)return;let t=i.current;if(t)return aV(t,e)},[o]);let s=ax({ref:i,store:a,role:"presentation","data-backdrop":(null==o?void 0:o.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,f.isValidElement)(t))return(0,d.jsx)(a9,{...s,render:t});let l="boolean"!=typeof t?t:"div";return(0,d.jsx)(a9,{...s,render:(0,d.jsx)(l,{})})}function a3(e={}){return a0(e)}Object.assign(a9,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=n$(function(e){return n1(t,e)}),e),{}));var a8=nS();function a5(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?io(r)?r:null:r:null}var a6=n9(function({store:e,open:t,onClose:r,focusable:n=!0,modal:i=!0,portal:a=!!i,backdrop:o=!!i,hideOnEscape:s=!0,hideOnInteractOutside:l=!0,getPersistentElements:u,preventBodyScroll:c=!!i,autoFocusOnShow:h=!0,autoFocusOnHide:m=!0,initialFocus:p,finalFocus:A,unmountOnHide:g,unstable_treeSnapshotKey:v,...B}){var C;let y,b,x,E=iG(),M=(0,f.useRef)(null),F=function(e={}){let[t,r]=am(a3,e);return a1(t,r,e)}({store:e||E,open:t,setOpen(e){if(e)return;let t=M.current;if(!t)return;let n=new Event("close",{bubbles:!1,cancelable:!0});r&&t.addEventListener("close",r,{once:!0}),t.dispatchEvent(n),n.defaultPrevented&&F.setOpen(!0)}}),{portalRef:S,domReady:T}=nV(a,B.portalRef),R=B.preserveTabOrder,D=ad(F,e=>R&&!i&&e.mounted),I=nj(B.id),w=ad(F,"open"),G=ad(F,"mounted"),L=ad(F,"contentElement"),P=ab(G,B.hidden,B.alwaysVisible);y=function({attribute:e,contentId:t,contentElement:r,enabled:n}){let[i,a]=nJ(),o=(0,f.useCallback)(()=>{if(!n||!r)return!1;let{body:i}=r4(r),a=i.getAttribute(e);return!a||a===t},[i,n,r,e,t]);return(0,f.useEffect)(()=>{if(!n||!t||!r)return;let{body:i}=r4(r);if(o())return i.setAttribute(e,t),()=>i.removeAttribute(e);let s=new MutationObserver(()=>(0,aB.flushSync)(a));return s.observe(i,{attributeFilter:[e]}),()=>s.disconnect()},[i,n,t,r,o,e]),o}({attribute:"data-dialog-prevent-body-scroll",contentElement:L,contentId:I,enabled:c&&!P}),(0,f.useEffect)(()=>{var e,t;if(!y()||!L)return;let r=r4(L),n=r7(L),{documentElement:i,body:a}=r,o=i.style.getPropertyValue("--scrollbar-width"),s=o?Number.parseInt(o,10):n.innerWidth-i.clientWidth,l=Math.round(i.getBoundingClientRect().left)+i.scrollLeft?"paddingLeft":"paddingRight",u=nF()&&!(r6&&navigator.platform.startsWith("Mac")&&!nM());return ng((e="--scrollbar-width",t=`${s}px`,i?aH(i,e,()=>{let r=i.style.getPropertyValue(e);return i.style.setProperty(e,t),()=>{r?i.style.setProperty(e,r):i.style.removeProperty(e)}}):()=>{}),u?(()=>{var e,t;let{scrollX:r,scrollY:i,visualViewport:o}=n,u=null!=(e=null==o?void 0:o.offsetLeft)?e:0,c=null!=(t=null==o?void 0:o.offsetTop)?t:0,d=aU(a,{position:"fixed",overflow:"hidden",top:`${-(i-Math.floor(c))}px`,left:`${-(r-Math.floor(u))}px`,right:"0",[l]:`${s}px`});return()=>{d(),n.scrollTo({left:r,top:i,behavior:"instant"})}})():aU(a,{overflow:"hidden",[l]:`${s}px`}))},[y,L]),C=ad(F,"open"),b=(0,f.useRef)(),(0,f.useEffect)(()=>{if(!C){b.current=null;return}return nL("mousedown",e=>{b.current=e.target},!0)},[C]),aW({...x={store:F,domReady:T,capture:!0},type:"click",listener:e=>{let{contentElement:t}=F.getState(),r=b.current;r&&na(r)&&aX(r,null==t?void 0:t.id)&&aY(l,e)&&F.hide()}}),aW({...x,type:"focusin",listener:e=>{let{contentElement:t}=F.getState();!t||e.target===r4(t)||aY(l,e)&&F.hide()}}),aW({...x,type:"contextmenu",listener:e=>{aY(l,e)&&F.hide()}});let{wrapElement:O,nestedDialogs:H}=function(e){let t=(0,f.useContext)(az),[r,n]=(0,f.useState)([]),i=(0,f.useCallback)(e=>{var r;return n(t=>[...t,e]),ng(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);n_(()=>i2(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let a=(0,f.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,f.useCallback)(e=>(0,d.jsx)(az.Provider,{value:a,children:e}),[a]),nestedDialogs:r}}(F);B=nQ(B,O,[O]),n_(()=>{if(!w)return;let e=M.current,t=ne(e,!0);!t||"BODY"===t.tagName||e&&nt(e,t)||F.setDisclosureElement(t)},[F,w]),a8&&(0,f.useEffect)(()=>{if(!G)return;let{disclosureElement:e}=F.getState();if(!e||!nn(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),nG(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||ip(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[F,G]),(0,f.useEffect)(()=>{if(!G||!T)return;let e=M.current;if(!e)return;let t=r7(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[G,T]),(0,f.useEffect)(()=>{if(!i||!G||!T)return;let e=M.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=F.hide,(r=r4(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[F,i,G,T]),n_(()=>{if(!aZ()||w||!G||!T)return;let e=M.current;if(e)return a$(e)},[w,G,T]);let _=w&&T;n_(()=>{if(I&&_)return function(e,t){let{body:r}=r4(t[0]),n=[];return aJ(e,t,t=>{n.push(ak(t,aN(e),!0))}),ng(ak(r,aN(e),!0),()=>{for(let e of n)e()})}(I,[M.current])},[I,_,v]);let k=nk(u);n_(()=>{if(!I||!_)return;let{disclosureElement:e}=F.getState(),t=[M.current,...k()||[],...H.map(e=>e.getState().contentElement)];if(i){let e,r;return ng(aq(I,t),(e=[],r=t.map(e=>null==e?void 0:e.id),aJ(I,t,n=>{aK(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(a$(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&nt(e,r))||e.unshift(a_(r,"role","none"))}),()=>{for(let t of e)t()}))}return aq(I,[e,...t])},[I,F,_,k,H,i,v]);let U=!!h,j=nK(h),[N,J]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(!w||!U||!T||!(null==L?void 0:L.isConnected))return;let e=a5(p,!0)||L.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=iu(e,t,r);return n||null}(L,!0,a&&D)||L,t=io(e);j(t?e:null)&&(J(!0),queueMicrotask(()=>{e.focus(),!a8||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[w,U,T,L,p,a,D,j]);let K=!!m,Q=nK(m),[V,X]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(w)return X(!0),()=>X(!1)},[w]);let q=(0,f.useCallback)((e,t=!0)=>{let r,{disclosureElement:n}=F.getState();if(!(!(r=ne())||e&&nt(e,r))&&io(r))return;let i=a5(A)||n;if(null==i?void 0:i.id){let e=r4(i),t=`[aria-activedescendant="${i.id}"]`,r=e.querySelector(t);r&&(i=r)}if(i&&!io(i)){let e=i.closest("[data-dialog]");if(null==e?void 0:e.id){let t=r4(e),r=`[aria-controls~="${e.id}"]`,n=t.querySelector(r);n&&(i=n)}}let a=i&&io(i);!a&&t?requestAnimationFrame(()=>q(e,!1)):!Q(a?i:null)||a&&(null==i||i.focus({preventScroll:!0}))},[F,A,Q]),W=(0,f.useRef)(!1);n_(()=>{if(w||!V||!K)return;let e=M.current;W.current=!0,q(e)},[w,V,T,K,q]),(0,f.useEffect)(()=>{if(!V||!K)return;let e=M.current;return()=>{if(W.current){W.current=!1;return}q(e)}},[V,K,q]);let Y=nK(s);(0,f.useEffect)(()=>{if(T&&G)return nL("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=M.current;if(!t||aX(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=F.getState();!("BODY"===r.tagName||nt(t,r)||!n||nt(n,r))||Y(e)&&F.hide()},!0)},[F,T,G,Y]);let z=(B=nQ(B,e=>(0,d.jsx)(aL,{level:i?1:void 0,children:e}),[i])).hidden,Z=B.alwaysVisible;B=nQ(B,e=>o?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a2,{store:F,backdrop:o,hidden:z,alwaysVisible:Z}),e]}):e,[F,o,z,Z]);let[$,ee]=(0,f.useState)(),[et,er]=(0,f.useState)();return B=aP({...B={id:I,"data-dialog":"",role:"dialog",tabIndex:n?-1:void 0,"aria-labelledby":$,"aria-describedby":et,...B=nQ(B,e=>(0,d.jsx)(iP,{value:F,children:(0,d.jsx)(iO.Provider,{value:ee,children:(0,d.jsx)(iH.Provider,{value:er,children:e})})}),[F]),ref:nU(M,B.ref)},autoFocusOnShow:N}),B=aw({portal:a,...B=iM({...B=ax({store:F,...B}),focusable:n}),portalRef:S,preserveTabOrder:D})});function a4(e,t=iG){return n$(function(r){let n=t();return ad(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,d.jsx)(e,{...r}):null})}a4(n$(function(e){return n1("div",a6(e))}),iG);let a7=Math.min,oe=Math.max,ot=Math.round,or=Math.floor,on=e=>({x:e,y:e}),oi={left:"right",right:"left",bottom:"top",top:"bottom"},oa={start:"end",end:"start"};function oo(e,t){return"function"==typeof e?e(t):e}function os(e){return e.split("-")[0]}function ol(e){return e.split("-")[1]}function ou(e){return"x"===e?"y":"x"}function oc(e){return"y"===e?"height":"width"}let od=new Set(["top","bottom"]);function of(e){return od.has(os(e))?"y":"x"}function oh(e){return e.replace(/start|end/g,e=>oa[e])}let om=["left","right"],op=["right","left"],oA=["top","bottom"],og=["bottom","top"];function ov(e){return e.replace(/left|right|bottom|top/g,e=>oi[e])}function oB(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function oC(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function oy(e,t,r){let n,{reference:i,floating:a}=e,o=of(t),s=ou(of(t)),l=oc(s),u=os(t),c="y"===o,d=i.x+i.width/2-a.width/2,f=i.y+i.height/2-a.height/2,h=i[l]/2-a[l]/2;switch(u){case"top":n={x:d,y:i.y-a.height};break;case"bottom":n={x:d,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:f};break;case"left":n={x:i.x-a.width,y:f};break;default:n={x:i.x,y:i.y}}switch(ol(t)){case"start":n[s]-=h*(r&&c?-1:1);break;case"end":n[s]+=h*(r&&c?-1:1)}return n}let ob=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=a.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=oy(u,n,l),f=n,h={},m=0;for(let r=0;r{try{return e.matches(t)}catch(e){return!1}})}let ok=["transform","translate","scale","rotate","perspective"],oU=["transform","translate","scale","rotate","perspective","filter"],oj=["paint","layout","strict","content"];function oN(e){let t=oJ(),r=oI(e)?oV(e):e;return ok.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||oU.some(e=>(r.willChange||"").includes(e))||oj.some(e=>(r.contain||"").includes(e))}function oJ(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let oK=new Set(["html","body","#document"]);function oQ(e){return oK.has(oS(e))}function oV(e){return oT(e).getComputedStyle(e)}function oX(e){return oI(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oq(e){if("html"===oS(e))return e;let t=e.assignedSlot||e.parentNode||oG(e)&&e.host||oR(e);return oG(t)?t.host:t}function oW(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let i=function e(t){let r=oq(t);return oQ(r)?t.ownerDocument?t.ownerDocument.body:t.body:ow(r)&&oP(r)?r:e(r)}(e),a=i===(null==(n=e.ownerDocument)?void 0:n.body),o=oT(i);if(a){let e=oY(o);return t.concat(o,o.visualViewport||[],oP(i)?i:[],e&&r?oW(e):[])}return t.concat(i,oW(i,[],r))}function oY(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oz(e){let t=oV(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=ow(e),a=i?e.offsetWidth:r,o=i?e.offsetHeight:n,s=ot(r)!==a||ot(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function oZ(e){return oI(e)?e:e.contextElement}function o$(e){let t=oZ(e);if(!ow(t))return on(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:a}=oz(t),o=(a?ot(r.width):r.width)/n,s=(a?ot(r.height):r.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}let o0=on(0);function o1(e){let t=oT(e);return oJ()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:o0}function o9(e,t,r,n){var i;void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),o=oZ(e),s=on(1);t&&(n?oI(n)&&(s=o$(n)):s=o$(e));let l=(void 0===(i=r)&&(i=!1),n&&(!i||n===oT(o))&&i)?o1(o):on(0),u=(a.left+l.x)/s.x,c=(a.top+l.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=oT(o),t=n&&oI(n)?oT(n):n,r=e,i=oY(r);for(;i&&n&&t!==r;){let e=o$(i),t=i.getBoundingClientRect(),n=oV(i),a=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=a,c+=o,i=oY(r=oT(i))}}return oC({width:d,height:f,x:u,y:c})}function o2(e,t){let r=oX(e).scrollLeft;return t?t.left+r:o9(oR(e)).left+r}function o3(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-o2(e,r),y:r.top+t.scrollTop}}let o8=new Set(["absolute","fixed"]);function o5(e,t,r){var n;let i;if("viewport"===t)i=function(e,t){let r=oT(e),n=oR(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;let e=oJ();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}let u=o2(n);if(u<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(n.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else u<=25&&(a+=u);return{width:a,height:o,x:s,y:l}}(e,r);else if("document"===t){let t,r,a,o,s,l,u;n=oR(e),t=oR(n),r=oX(n),a=n.ownerDocument.body,o=oe(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=oe(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight),l=-r.scrollLeft+o2(n),u=-r.scrollTop,"rtl"===oV(a).direction&&(l+=oe(t.clientWidth,a.clientWidth)-o),i={width:o,height:s,x:l,y:u}}else if(oI(t)){let e,n,a,o,s,l;n=(e=o9(t,!0,"fixed"===r)).top+t.clientTop,a=e.left+t.clientLeft,o=ow(t)?o$(t):on(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,i={width:s,height:l,x:a*o.x,y:n*o.y}}else{let r=o1(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return oC(i)}function o6(e){return"static"===oV(e).position}function o4(e,t){if(!ow(e)||"fixed"===oV(e).position)return null;if(t)return t(e);let r=e.offsetParent;return oR(e)===r&&(r=r.ownerDocument.body),r}function o7(e,t){var r;let n=oT(e);if(o_(e))return n;if(!ow(e)){let t=oq(e);for(;t&&!oQ(t);){if(oI(t)&&!o6(t))return t;t=oq(t)}return n}let i=o4(e,t);for(;i&&(r=i,oO.has(oS(r)))&&o6(i);)i=o4(i,t);return i&&oQ(i)&&o6(i)&&!oN(i)?n:i||function(e){let t=oq(e);for(;ow(t)&&!oQ(t);){if(oN(t))return t;if(o_(t))break;t=oq(t)}return null}(e)||n}let se=async function(e){let t=this.getOffsetParent||o7,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=ow(t),i=oR(t),a="fixed"===r,o=o9(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=on(0);if(n||!n&&!a)if(("body"!==oS(t)||oP(i))&&(s=oX(t)),n){let e=o9(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=o2(i));a&&!n&&i&&(l.x=o2(i));let u=!i||n||a?on(0):o3(i,s);return{x:o.left+s.scrollLeft-l.x-u.x,y:o.top+s.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},st={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,a="fixed"===i,o=oR(n),s=!!t&&o_(t.floating);if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=on(1),c=on(0),d=ow(n);if((d||!d&&!a)&&(("body"!==oS(n)||oP(o))&&(l=oX(n)),ow(n))){let e=o9(n);u=o$(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let f=!o||d||a?on(0):o3(o,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:oR,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,a=[..."clippingAncestors"===r?o_(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=oW(e,[],!1).filter(e=>oI(e)&&"body"!==oS(e)),i=null,a="fixed"===oV(e).position,o=a?oq(e):e;for(;oI(o)&&!oQ(o);){let t=oV(o),r=oN(o);r||"fixed"!==t.position||(i=null),(a?!r&&!i:!r&&"static"===t.position&&!!i&&o8.has(i.position)||oP(o)&&!r&&function e(t,r){let n=oq(t);return!(n===r||!oI(n)||oQ(n))&&("fixed"===oV(n).position||e(n,r))}(e,o))?n=n.filter(e=>e!==o):i=t,o=oq(o)}return t.set(e,n),n}(t,this._c):[].concat(r),n],o=a[0],s=a.reduce((e,r)=>{let n=o5(t,r,i);return e.top=oe(n.top,e.top),e.right=a7(n.right,e.right),e.bottom=a7(n.bottom,e.bottom),e.left=oe(n.left,e.left),e},o5(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:o7,getElementRects:se,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=oz(e);return{width:t,height:r}},getScale:o$,isElement:oI,isRTL:function(e){return"rtl"===oV(e).direction}};function sr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sn(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function si(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function sa(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var so=n9(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:a,fixed:o=!1,flip:s=!0,shift:l=0,slide:u=!0,overlap:c=!1,sameWidth:h=!1,fitViewport:m=!1,gutter:p,arrowPadding:A=4,overflowPadding:g=8,getAnchorRect:v,updatePosition:B,...C}){let y=ik();nB(e=e||y,!1);let b=e.useState("arrowElement"),x=e.useState("anchorElement"),E=e.useState("disclosureElement"),M=e.useState("popoverElement"),F=e.useState("contentElement"),S=e.useState("placement"),T=e.useState("mounted"),R=e.useState("rendered"),D=(0,f.useRef)(null),[I,w]=(0,f.useState)(!1),{portalRef:G,domReady:L}=nV(r,C.portalRef),P=nk(v),O=nk(B),H=!!B;n_(()=>{if(!(null==M?void 0:M.isConnected))return;M.style.setProperty("--popover-overflow-padding",`${g}px`);let t={contextElement:x||void 0,getBoundingClientRect:()=>{let e=null==P?void 0:P(x);return e||!x?function(e){if(!e)return sn();let{x:t,y:r,width:n,height:i}=e;return sn(t,r,n,i)}(e):x.getBoundingClientRect()}},r=async()=>{var r,n,i,a,d;let f,v,B;if(!T)return;b||(D.current=D.current||document.createElement("div"));let C=b||D.current,y=[(r={gutter:p,shift:l},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:a,placement:o,middlewareData:s}=e,l=await oM(e,n);return o===(null==(t=s.offset)?void 0:t.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return nB(!r||r.every(si),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,a,o,s,l,u;let c,d,f,{placement:h,middlewareData:m,rects:p,initialPlacement:A,platform:g,elements:v}=e,{mainAxis:B=!0,crossAxis:C=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:E=!0,...M}=oo(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let F=os(h),S=of(A),T=os(A)===A,R=await (null==g.isRTL?void 0:g.isRTL(v.floating)),D=y||(T||!E?[ov(A)]:(c=ov(A),[oh(A),c,oh(c)])),I="none"!==x;!y&&I&&D.push(...(d=ol(A),f=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?op:om;return t?om:op;case"left":case"right":return t?oA:og;default:return[]}}(os(A),"start"===x,R),d&&(f=f.map(e=>e+"-"+d),E&&(f=f.concat(f.map(oh)))),f));let w=[A,...D],G=await ox(e,M),L=[],P=(null==(n=m.flip)?void 0:n.overflows)||[];if(B&&L.push(G[F]),C){let e,t,r,n,i=(s=h,l=p,void 0===(u=R)&&(u=!1),e=ol(s),r=oc(t=ou(of(s))),n="x"===t?e===(u?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[r]>l.floating[r]&&(n=ov(n)),[n,ov(n)]);L.push(G[i[0]],G[i[1]])}if(P=[...P,{placement:h,overflows:L}],!L.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=w[e];if(t&&("alignment"!==C||S===of(t)||P.every(e=>of(e.placement)!==S||e.overflows[0]>0)))return{data:{index:e,overflows:P},reset:{placement:t}};let r=null==(a=P.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:a.placement;if(!r)switch(b){case"bestFit":{let e=null==(o=P.filter(e=>{if(I){let t=of(e.placement);return t===S||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=A}if(h!==r)return{reset:{placement:r}}}return{}}}}({flip:s,overflowPadding:g}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:a,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=oo(t,e),c={x:r,y:n},d=of(i),f=ou(d),h=c[f],m=c[d],p=oo(s,e),A="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){let e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+A.mainAxis,r=a.reference[f]+a.reference[e]-A.mainAxis;hr&&(h=r)}if(u){var g,v;let e="y"===f?"width":"height",t=oE.has(os(i)),r=a.reference[d]-a.floating[e]+(t&&(null==(g=o.offset)?void 0:g[d])||0)+(t?0:A.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(v=o.offset)?void 0:v[d])||0)-(t?A.crossAxis:0);mn&&(m=n)}return{[f]:h,[d]:m}}})},async fn(e){let{x:t,y:n,placement:i}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=oo(r,e),u={x:t,y:n},c=await ox(e,l),d=of(os(i)),f=ou(d),h=u[f],m=u[d];if(a){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=h+c[e],n=h-c[t];h=oe(r,a7(h,n))}if(o){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+c[e],n=m-c[t];m=oe(r,a7(m,n))}let p=s.fn({...e,[f]:h,[d]:m});return{...p,data:{x:p.x-t,y:p.y-n,enabled:{[f]:a,[d]:o}}}}}}}({slide:u,shift:l,overlap:c,overflowPadding:g}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=oo(r,e)||{};if(null==u)return{};let d=oB(c),f={x:t,y:n},h=ou(of(i)),m=oc(h),p=await o.getDimensions(u),A="y"===h,g=A?"clientHeight":"clientWidth",v=a.reference[m]+a.reference[h]-f[h]-a.floating[m],B=f[h]-a.reference[h],C=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),y=C?C[g]:0;y&&await (null==o.isElement?void 0:o.isElement(C))||(y=s.floating[g]||a.floating[m]);let b=y/2-p[m]/2-1,x=a7(d[A?"top":"left"],b),E=a7(d[A?"bottom":"right"],b),M=y-p[m]-E,F=y/2-p[m]/2+(v/2-B/2),S=oe(x,a7(F,M)),T=!l.arrow&&null!=ol(i)&&F!==S&&a.reference[m]/2-(F{},...d}=oo(a,e),f=await ox(e,d),h=os(o),m=ol(o),p="y"===of(o),{width:A,height:g}=s.floating;"top"===h||"bottom"===h?(n=h,i=m===(await (null==l.isRTL?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(i=h,n="end"===m?"top":"bottom");let v=g-f.top-f.bottom,B=A-f.left-f.right,C=a7(g-f[n],v),y=a7(A-f[i],B),b=!e.middlewareData.shift,x=C,E=y;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=B),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(x=v),b&&!m){let e=oe(f.left,0),t=oe(f.right,0),r=oe(f.top,0),n=oe(f.bottom,0);p?E=A-2*(0!==e||0!==t?e+t:oe(f.left,f.right)):x=g-2*(0!==r||0!==n?r+n:oe(f.top,f.bottom))}await c({...e,availableWidth:E,availableHeight:x});let M=await l.getDimensions(u.floating);return A!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}],x=await (d={placement:S,strategy:o?"fixed":"absolute",middleware:y},f=new Map,B={...(v={platform:st,...d}).platform,_c:f},ob(t,M,{...v,platform:B}));null==e||e.setState("currentPlacement",x.placement),w(!0);let E=sa(x.x),F=sa(x.y);if(Object.assign(M.style,{top:"0",left:"0",transform:`translate3d(${E}px,${F}px,0)`}),C&&x.middlewareData.arrow){let{x:e,y:t}=x.middlewareData.arrow,r=x.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,a=null!=e?e+n:-n,o=null!=t?t+i:-i;M.style.setProperty("--popover-transform-origin",{top:`${a}px calc(100% + ${i}px)`,bottom:`${a}px ${-i}px`,left:`calc(100% + ${n}px) ${o}px`,right:`${-n}px ${o}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=oZ(e),d=a||o?[...c?oW(c):[],...oW(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,n=null,i=oR(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(s||t(),!f||!h)return;let m={rootMargin:-or(d)+"px "+-or(i.clientWidth-(c+f))+"px "+-or(i.clientHeight-(d+h))+"px "+-or(c)+"px",threshold:oe(0,a7(1,l))||1},p=!0;function A(t){let n=t[0].intersectionRatio;if(n!==l){if(!p)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==n||sr(u,e.getBoundingClientRect())||o(),p=!1}try{n=new IntersectionObserver(A,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(A,m)}n.observe(e)}(!0),a}(c,r):null,h=-1,m=null;s&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!u&&m.observe(c),m.observe(t));let p=u?o9(e):null;return u&&function t(){let n=o9(e);p&&!sr(p,n)&&r(),p=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(i)}}(t,M,async()=>{H?(await O({updatePosition:r}),w(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{w(!1),n()}},[e,R,M,b,x,M,S,T,L,o,s,l,u,c,h,m,p,A,g,P,H,O]),n_(()=>{if(!T||!L||!(null==M?void 0:M.isConnected)||!(null==F?void 0:F.isConnected))return;let e=()=>{M.style.zIndex=getComputedStyle(F).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,L,M,F]);let _=o?"fixed":"absolute";return C=nQ(C,t=>(0,d.jsx)("div",{...a,style:{position:_,top:0,left:0,width:"max-content",...null==a?void 0:a.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,_,a]),C={"data-placing":!I||void 0,...C=nQ(C,t=>(0,d.jsx)(ij,{value:e,children:t}),[e]),style:{position:"relative",...C.style}},C=a6({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:E||x,autoFocusOnShow:I&&i,...C,portalRef:G})});a4(n$(function(e){return n1("div",so(e))}),ik);var ss=n9(function({store:e,modal:t,tabIndex:r,alwaysVisible:n,autoFocusOnHide:i=!0,hideOnInteractOutside:a=!0,...o}){let s=iX();nB(e=e||s,!1);let l=e.useState("baseElement"),u=(0,f.useRef)(!1),c=ad(e.tag,e=>null==e?void 0:e.renderedItems.length);return o=aM({store:e,alwaysVisible:n,...o}),o=so({store:e,modal:t,alwaysVisible:n,backdrop:!1,autoFocusOnShow:!1,finalFocus:l,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:c,...o,getPersistentElements(){var r;let n=(null==(r=o.getPersistentElements)?void 0:r.call(o))||[];if(!t||!e)return n;let{contentElement:i,baseElement:a}=e.getState();if(!a)return n;let s=r4(a),l=[];if((null==i?void 0:i.id)&&l.push(`[aria-controls~="${i.id}"]`),(null==a?void 0:a.id)&&l.push(`[aria-controls~="${a.id}"]`),!l.length)return[...n,a];let u=l.join(",");return[...n,...s.querySelectorAll(u)]},autoFocusOnHide:e=>!nC(i,e)&&(!u.current||(u.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,s=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,s))return!1;let l="function"==typeof a?a(t):a;return l&&(u.current="click"===t.type),l}})}),sl=a4(n$(function(e){return n1("div",ss(e))}),iX);(0,f.createContext)(null),(0,f.createContext)(null);var su=n2([n7],[ie]),sc=su.useContext;su.useScopedContext,su.useProviderContext,su.ContextProvider,su.ScopedContextProvider;var sd={id:null};function sf(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function sh(e,t){return e.filter(e=>e.rowId===t)}function sm(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function sp(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var sA=nS()&&nM();function sg({tag:e,...t}={}){let r=i5(t.store,function(e,...t){if(e)return iZ(e,"pick")(...t)}(e,["value","rtl"]));i6(t,r);let n=null==e?void 0:e.getState(),i=null==r?void 0:r.getState(),a=nx(t.activeId,null==i?void 0:i.activeId,t.defaultActiveId,null),o=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),n=function(e={}){var t,r;i6(e,e.store);let n=null==(t=e.store)?void 0:t.getState(),i=nx(e.items,null==n?void 0:n.items,e.defaultItems,[]),a=new Map(i.map(e=>[e.id,e])),o={items:i,renderedItems:nx(null==n?void 0:n.renderedItems,[])},s=null==(r=e.store)?void 0:r.__unstablePrivateStore,l=i$({items:i,renderedItems:o.renderedItems},s),u=i$(o,e.store),c=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,a])=>{var o;let s=t(r),l=t(a);return s!==l&&s&&l?(o=s,l.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);l.setState("renderedItems",i),u.setState("renderedItems",i)};i0(u,()=>i1(l)),i0(l,()=>i3(l,["items"],e=>{u.setState("items",e.items)})),i0(l,()=>i3(l,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let n=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>c(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),n=[...e].reverse().find(e=>!!e.element),i=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;i&&(null==n?void 0:n.element);){let e=i;if(n&&e.contains(n.element))return i;i=i.parentElement}return r4(i).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&n.observe(t.element);return()=>{cancelAnimationFrame(r),n.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},f=e=>d(e,e=>l.setState("items",e),!0);return{...u,registerItem:f,renderItem:e=>ng(f(e),d(e,e=>l.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=l.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:l}}(e),i=nx(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=i$({...n.getState(),id:nx(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:i,baseElement:nx(null==r?void 0:r.baseElement,null),includesBaseElement:nx(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===i),moves:nx(null==r?void 0:r.moves,0),orientation:nx(e.orientation,null==r?void 0:r.orientation,"both"),rtl:nx(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:nx(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:nx(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:nx(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:nx(e.focusShift,null==r?void 0:r.focusShift,!1)},n,e.store);i0(a,()=>i2(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=sf(e.renderedItems))?void 0:r.id})}));let o=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:s=i.activeId,focusShift:l=i.focusShift,focusLoop:u=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:d=i.includesBaseElement,renderedItems:f=i.renderedItems,rtl:h=i.rtl}=t,m="up"===e||"down"===e,p="next"===e||"down"===e,A=m?iF(function(e,t,r){let n=sp(e);for(let i of e)for(let e=0;ee.id===s);if(!g)return null==(n=sf(A))?void 0:n.id;let v=A.some(e=>e.rowId),B=A.indexOf(g),C=A.slice(B+1),y=sh(C,g.rowId);if(o){let e=y.filter(e=>s?!e.disabled&&e.id!==s:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let b=u&&(m?"horizontal"!==u:"vertical"!==u),x=v&&c&&(m?"horizontal"!==c:"vertical"!==c),E=p?(!v||m)&&b&&d:!!m&&d;if(b){let e=sf(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[sd]:[],...e.slice(0,n)]}(x&&!E?A:sh(A,g.rowId),s,E),s);return null==e?void 0:e.id}if(x){let e=sf(E?y:C,s);return E?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let M=sf(y,s);return!M&&E?null:null==M?void 0:M.id};return{...n,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=sf(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=sf(iS(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("up",e))}}({...t,activeId:a,includesBaseElement:nx(t.includesBaseElement,null==i?void 0:i.includesBaseElement,!0),orientation:nx(t.orientation,null==i?void 0:i.orientation,"vertical"),focusLoop:nx(t.focusLoop,null==i?void 0:i.focusLoop,!0),focusWrap:nx(t.focusWrap,null==i?void 0:i.focusWrap,!0),virtualFocus:nx(t.virtualFocus,null==i?void 0:i.virtualFocus,!0)}),s=function({popover:e,...t}={}){let r=i5(t.store,i8(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));i6(t,r);let n=null==r?void 0:r.getState(),i=a3({...t,store:r}),a=nx(t.placement,null==n?void 0:n.placement,"bottom"),o=i$({...i.getState(),placement:a,currentPlacement:a,anchorElement:nx(null==n?void 0:n.anchorElement,null),popoverElement:nx(null==n?void 0:n.popoverElement,null),arrowElement:nx(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...o,setAnchorElement:e=>o.setState("anchorElement",e),setPopoverElement:e=>o.setState("popoverElement",e),setArrowElement:e=>o.setState("arrowElement",e),render:()=>o.setState("rendered",Symbol("rendered"))}}({...t,placement:nx(t.placement,null==i?void 0:i.placement,"bottom-start")}),l=nx(t.value,null==i?void 0:i.value,t.defaultValue,""),u=nx(t.selectedValue,null==i?void 0:i.selectedValue,null==n?void 0:n.values,t.defaultSelectedValue,""),c=Array.isArray(u),d={...o.getState(),...s.getState(),value:l,selectedValue:u,resetValueOnSelect:nx(t.resetValueOnSelect,null==i?void 0:i.resetValueOnSelect,c),resetValueOnHide:nx(t.resetValueOnHide,null==i?void 0:i.resetValueOnHide,c&&!e),activeValue:null==i?void 0:i.activeValue},f=i$(d,o,s,r);return sA&&i0(f,()=>i2(f,["virtualFocus"],()=>{f.setState("virtualFocus",!1)})),i0(f,()=>{if(e)return ng(i2(f,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),i2(e,["values"],e=>{f.setState("selectedValue",e.values)}))}),i0(f,()=>i2(f,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||f.setState("value",l)})),i0(f,()=>i2(f,["open"],e=>{e.open||(f.setState("activeId",a),f.setState("moves",0))})),i0(f,()=>i2(f,["moves","activeId"],(e,t)=>{e.moves===t.moves&&f.setState("activeValue",void 0)})),i0(f,()=>i3(f,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=f.getState(),n=o.item(r);f.setState("activeValue",null==n?void 0:n.value)})),{...s,...o,...f,tag:e,setValue:e=>f.setState("value",e),resetValue:()=>f.setState("value",d.value),setSelectedValue:e=>f.setState("selectedValue",e)}}function sv(e={}){var t,r,n,i,a,o,s,l;let u;t=e,u=sc();let[c,d]=am(sg,e={id:nj((r=t={...t,tag:void 0!==t.tag?t.tag:u}).id),...r});return nN(d,[(n=e).tag]),ah(c,n,"value","setValue"),ah(c,n,"selectedValue","setSelectedValue"),ah(c,n,"resetValueOnHide"),ah(c,n,"resetValueOnSelect"),Object.assign((o=c,nN(s=d,[(l=n).popover]),ah(o,l,"placement"),i=a1(o,s,l),a=i,nN(d,[n.store]),ah(a,n,"items","setItems"),ah(i=a,n,"activeId","setActiveId"),ah(i,n,"includesBaseElement"),ah(i,n,"virtualFocus"),ah(i,n,"orientation"),ah(i,n,"rtl"),ah(i,n,"focusLoop"),ah(i,n,"focusWrap"),ah(i,n,"focusShift"),i),{tag:n.tag})}function sB(e={}){let t=sv(e);return(0,d.jsx)(iq,{value:t,children:e.children})}var sC=(0,f.createContext)(void 0),sy=n9(function(e){let[t,r]=(0,f.useState)();return nb(e={role:"group","aria-labelledby":t,...e=nQ(e,e=>(0,d.jsx)(sC.Provider,{value:r,children:e}),[])})});n$(function(e){return n1("div",sy(e))});var sb=n9(function({store:e,...t}){return sy(t)});n$(function(e){return n1("div",sb(e))});var sx=n9(function({store:e,...t}){let r=iV();return nB(e=e||r,!1),"grid"===nu(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=sb({store:e,...t})}),sE=n$(function(e){return n1("div",sx(e))}),sM=n9(function(e){let t=(0,f.useContext)(sC),r=nj(e.id);return n_(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),nb(e={id:r,"aria-hidden":!0,...e})});n$(function(e){return n1("div",sM(e))});var sF=n9(function({store:e,...t}){return sM(t)});n$(function(e){return n1("div",sF(e))});var sS=n9(function(e){return sF(e)}),sT=n$(function(e){return n1("div",sS(e))}),sR=e.i(38360);let sD={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},sI=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function sw(e,t,r={}){let{keys:n,threshold:i=sD.MATCHES,baseSort:a=sI,sorter:o=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:a,keyIndex:o}=t;return n!==a?n>a?-1:1:i===o?r(e,t):i{let s=sG(i,u,c),l=t,{minRanking:d,maxRanking:f,threshold:h}=a;return s=sD.MATCHES?s=d:s>f&&(s=f),s>e&&(e=s,r=o,n=h,l=i),{rankedValue:l,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:s,rank:sD.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:s,rank:sG(s,u,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:f,keyThreshold:h=i}=d;return f>=h&&e.push({...d,item:a,index:o}),e},[])).map(({item:e})=>e)}function sG(e,t,r){if(e=sL(e,r),(t=sL(t,r)).length>e.length)return sD.NO_MATCH;if(e===t)return sD.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),a=i.value;if(e.length===t.length&&0===a)return sD.EQUAL;if(0===a)return sD.STARTS_WITH;let o=i;for(;!o.done;){if(o.value>0&&" "===e[o.value-1])return sD.WORD_STARTS_WITH;o=n.next()}return a>0?sD.CONTAINS:1===t.length?sD.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return sD.NO_MATCH;return r=a-s,n=i/t.length,sD.MATCHES+1/r*n}(e,t)}function sL(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,sR.default)(e)),e}sw.rankings=sD;let sP={maxRanking:1/0,minRanking:-1/0};var sO=e.i(29402);let sH=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),s_={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/xPack2.vl2":"xPack2","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":"DMP (Discord Map Pack)"},sk={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},sU=(0,rD.getMissionList)().filter(e=>!sH.has(e)).map(e=>{let t,r=(0,rD.getMissionInfo)(e),[n]=(0,rD.getSourceAndPath)(r.resourcePath),i=(t=n.match(/^(.*)(\/[^/]+)$/))?t[1]:"",a=s_[n]??sk[i]??null;return{resourcePath:r.resourcePath,missionName:e,displayName:r.displayName,sourcePath:n,groupName:a,missionTypes:r.missionTypes}}),sj=new Map(sU.map(e=>[e.missionName,e])),sN=function(e){let t=new Map;for(let r of e){let e=t.get(r.groupName)??[];e.push(r),t.set(r.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,sO.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,sO.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(sU),sJ="undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function sK({mission:e}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"MissionSelect-itemHeader",children:[(0,d.jsx)("span",{className:"MissionSelect-itemName",children:e.displayName||e.missionName}),e.missionTypes.length>0&&(0,d.jsx)("span",{className:"MissionSelect-itemTypes",children:e.missionTypes.map(e=>(0,d.jsx)("span",{className:"MissionSelect-itemType","data-mission-type":e,children:e},e))})]}),(0,d.jsx)("span",{className:"MissionSelect-itemMissionName",children:e.missionName})]})}function sQ({value:e,missionType:t,onChange:r}){let[n,i]=(0,f.useState)(""),a=(0,f.useRef)(null),o=(0,f.useRef)(t),s=sv({resetValueOnHide:!0,selectedValue:e,setSelectedValue:e=>{if(e){let t=o.current,n=(0,rD.getMissionInfo)(e).missionTypes;t&&n.includes(t)||(t=n[0]),r({missionName:e,missionType:t})}},setValue:e=>{(0,f.startTransition)(()=>i(e))}});(0,f.useEffect)(()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),a.current?.focus(),s.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]);let l=sj.get(e),u=(0,f.useMemo)(()=>n?{type:"flat",missions:sw(sU,n,{keys:["displayName","missionName"]})}:{type:"grouped",groups:sN},[n]),c=l?l.displayName||l.missionName:e,h="flat"===u.type?0===u.missions.length:0===u.groups.length,m=t=>(0,d.jsx)(av,{value:t.missionName,className:"MissionSelect-item",focusOnHover:!0,onClick:n=>{if(n.target&&n.target instanceof HTMLElement){let i=n.target.dataset.missionType;i?(o.current=i,t.missionName===e&&r({missionName:t.missionName,missionType:i})):o.current=null}else o.current=null},children:(0,d.jsx)(sK,{mission:t})},t.missionName);return(0,d.jsxs)(sB,{store:s,children:[(0,d.jsxs)("div",{className:"MissionSelect-inputWrapper",children:[(0,d.jsx)(at,{ref:a,autoSelect:!0,placeholder:c,className:"MissionSelect-input",onFocus:()=>{document.exitPointerLock(),s.show()}}),(0,d.jsxs)("div",{className:"MissionSelect-selectedValue",children:[(0,d.jsx)("span",{className:"MissionSelect-selectedName",children:c}),t&&(0,d.jsx)("span",{className:"MissionSelect-itemType","data-mission-type":t,children:t})]}),(0,d.jsx)("kbd",{className:"MissionSelect-shortcut",children:sJ?"⌘K":"^K"})]}),(0,d.jsx)(sl,{gutter:4,fitViewport:!0,className:"MissionSelect-popover",children:(0,d.jsxs)(aF,{className:"MissionSelect-list",children:["flat"===u.type?u.missions.map(m):u.groups.map(([e,t])=>e?(0,d.jsxs)(sE,{className:"MissionSelect-group",children:[(0,d.jsx)(sT,{className:"MissionSelect-groupLabel",children:e}),t.map(m)]},e):(0,d.jsx)(f.Fragment,{children:t.map(m)},"ungrouped")),h&&(0,d.jsx)("div",{className:"MissionSelect-noResults",children:"No missions found"})]})})]})}function sV({missionName:e,missionType:t,onChangeMission:r}){let{fogEnabled:n,setFogEnabled:i,fov:a,setFov:o,audioEnabled:s,setAudioEnabled:l,animationEnabled:u,setAnimationEnabled:c}=(0,eS.useSettings)(),{speedMultiplier:f,setSpeedMultiplier:h}=(0,eS.useControls)(),{debugMode:m,setDebugMode:p}=(0,eS.useDebug)();return(0,d.jsxs)("div",{id:"controls",onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,d.jsx)(sQ,{value:e,missionType:t,onChange:r}),(0,d.jsxs)("div",{className:"CheckboxField",children:[(0,d.jsx)("input",{id:"fogInput",type:"checkbox",checked:n,onChange:e=>{i(e.target.checked)}}),(0,d.jsx)("label",{htmlFor:"fogInput",children:"Fog?"})]}),(0,d.jsxs)("div",{className:"CheckboxField",children:[(0,d.jsx)("input",{id:"audioInput",type:"checkbox",checked:s,onChange:e=>{l(e.target.checked)}}),(0,d.jsx)("label",{htmlFor:"audioInput",children:"Audio?"})]}),(0,d.jsxs)("div",{className:"CheckboxField",children:[(0,d.jsx)("input",{id:"animationInput",type:"checkbox",checked:u,onChange:e=>{c(e.target.checked)}}),(0,d.jsx)("label",{htmlFor:"animationInput",children:"Animation?"})]}),(0,d.jsxs)("div",{className:"CheckboxField",children:[(0,d.jsx)("input",{id:"debugInput",type:"checkbox",checked:m,onChange:e=>{p(e.target.checked)}}),(0,d.jsx)("label",{htmlFor:"debugInput",children:"Debug?"})]}),(0,d.jsxs)("div",{className:"Field",children:[(0,d.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),(0,d.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:a,onChange:e=>o(parseInt(e.target.value))}),(0,d.jsx)("output",{htmlFor:"speedInput",children:a})]}),(0,d.jsxs)("div",{className:"Field",children:[(0,d.jsx)("label",{htmlFor:"speedInput",children:"Speed"}),(0,d.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:f,onChange:e=>h(parseFloat(e.target.value))})]})]})}let sX=f.forwardRef(({envMap:e,resolution:t=256,frames:r=1/0,makeDefault:n,children:i,...a},o)=>{let s=(0,ey.useThree)(({set:e})=>e),l=(0,ey.useThree)(({camera:e})=>e),u=(0,ey.useThree)(({size:e})=>e),c=f.useRef(null);f.useImperativeHandle(o,()=>c.current,[]);let d=f.useRef(null),h=function(e,t,r){let n=(0,ey.useThree)(e=>e.size),i=(0,ey.useThree)(e=>e.viewport),a="number"==typeof e?e:n.width*i.dpr,o=n.height*i.dpr,s=("number"==typeof e?void 0:e)||{},{samples:l=0,depth:u,...c}=s,d=null!=u?u:s.depthBuffer,h=f.useMemo(()=>{let e=new A.WebGLRenderTarget(a,o,{minFilter:A.LinearFilter,magFilter:A.LinearFilter,type:A.HalfFloatType,...c});return d&&(e.depthTexture=new A.DepthTexture(a,o,A.FloatType)),e.samples=l,e},[]);return f.useLayoutEffect(()=>{h.setSize(a,o),l&&(h.samples=l)},[l,h,a,o]),f.useEffect(()=>()=>h.dispose(),[]),h}(t);f.useLayoutEffect(()=>{a.manual||(c.current.aspect=u.width/u.height)},[u,a]),f.useLayoutEffect(()=>{c.current.updateProjectionMatrix()});let m=0,p=null,g="function"==typeof i;return(0,eC.useFrame)(t=>{g&&(r===1/0||m{if(n)return s(()=>({camera:c.current})),()=>s(()=>({camera:l}))},[c,n,s]),f.createElement(f.Fragment,null,f.createElement("perspectiveCamera",(0,eK.default)({ref:c},a),!g&&i),f.createElement("group",{ref:d},g&&i(h.texture)))});function sq(){let{fov:e}=(0,eS.useSettings)();return(0,d.jsx)(sX,{makeDefault:!0,position:[0,256,0],fov:e})}var sW=e.i(51434),sY=e.i(81405);function sz(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function sZ({showPanel:e=0,className:t,parent:r}){let n=function(e,t=[],r){let[n,i]=f.useState();return f.useLayoutEffect(()=>{let t=e();return i(t),sz(void 0,t),()=>sz(void 0,null)},t),n}(()=>new sY.default,[]);return f.useEffect(()=>{if(n){let i=r&&r.current||document.body;n.showPanel(e),null==i||i.appendChild(n.dom);let a=(null!=t?t:"").split(" ").filter(e=>e);a.length&&n.dom.classList.add(...a);let o=(0,m.j)(()=>n.begin()),s=(0,m.k)(()=>n.end());return()=>{a.length&&n.dom.classList.remove(...a),null==i||i.removeChild(n.dom),o(),s()}}},[r,n,t,e]),null}var s$=e.i(60099);function s0(){let{debugMode:e}=(0,eS.useDebug)(),t=(0,f.useRef)(null);return(0,f.useEffect)(()=>{let e=t.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")}),e?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(sZ,{className:"StatsPanel"}),(0,d.jsx)("axesHelper",{ref:t,args:[70],renderOrder:999,children:(0,d.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,d.jsx)(s$.Html,{position:[80,0,0],center:!0,children:(0,d.jsx)("span",{className:"AxisLabel","data-axis":"y",children:"Y"})}),(0,d.jsx)(s$.Html,{position:[0,80,0],center:!0,children:(0,d.jsx)("span",{className:"AxisLabel","data-axis":"z",children:"Z"})}),(0,d.jsx)(s$.Html,{position:[0,0,80],center:!0,children:(0,d.jsx)("span",{className:"AxisLabel","data-axis":"x",children:"X"})})]}):null}let s1=new rj,s9={toneMapping:A.NoToneMapping,outputColorSpace:A.SRGBColorSpace};function s2(){let e=(0,h.useSearchParams)(),t=(0,h.useRouter)(),[r,n]=(0,f.useMemo)(()=>(e.get("mission")||"RiverDance~CTF").split("~"),[]),[i,a]=(0,f.useState)(r),o=(0,rD.getMissionInfo)(i).missionTypes,[s,l]=(0,f.useState)(()=>n&&o.includes(n)?n:o[0]),u=1===o.length,[c,m]=(0,f.useState)(0),[p,g]=(0,f.useState)(!0),v=c<1;(0,f.useEffect)(()=>{if(v)g(!0);else{let e=setTimeout(()=>g(!1),500);return()=>clearTimeout(e)}},[v]),(0,f.useEffect)(()=>(window.setMissionName=a,window.getMissionList=rD.getMissionList,window.getMissionInfo=rD.getMissionInfo,()=>{delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo}),[]),(0,f.useEffect)(()=>{let e=new URLSearchParams,r=u?i:`${i}~${s}`;e.set("mission",r),t.replace(`?${e.toString()}`,{scroll:!1})},[i,s,u,t]);let B=(0,f.useCallback)((e,t=0)=>{m(t)},[]);return(0,d.jsx)(ef,{client:s1,children:(0,d.jsx)("main",{children:(0,d.jsxs)(eS.SettingsProvider,{children:[(0,d.jsxs)("div",{id:"canvasContainer",children:[p&&(0,d.jsxs)("div",{id:"loadingIndicator","data-complete":!v,children:[(0,d.jsx)("div",{className:"LoadingSpinner"}),(0,d.jsx)("div",{className:"LoadingProgress",children:(0,d.jsx)("div",{className:"LoadingProgress-bar",style:{width:`${100*c}%`}})}),(0,d.jsxs)("div",{className:"LoadingProgress-text",children:[Math.round(100*c),"%"]})]}),(0,d.jsx)(b,{frameloop:"always",gl:s9,shadows:{type:A.PCFShadowMap},children:(0,d.jsx)(ry,{children:(0,d.jsxs)(sW.AudioProvider,{children:[(0,d.jsx)(rL,{name:i,missionType:s,onLoadingChange:B,setMissionType:l},`${i}~${s}`),(0,d.jsx)(sq,{}),(0,d.jsx)(s0,{}),(0,d.jsx)(r5,{})]})})})]}),(0,d.jsx)(sV,{missionName:i,missionType:s,onChangeMission:({missionName:e,missionType:t})=>{a(e),l(t)}})]})})})}function s3(){return(0,d.jsx)(f.Suspense,{children:(0,d.jsx)(s2,{})})}e.s(["default",()=>s3],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/9309477277712998.js b/docs/_next/static/chunks/9309477277712998.js new file mode 100644 index 00000000..a7b752f6 --- /dev/null +++ b/docs/_next/static/chunks/9309477277712998.js @@ -0,0 +1,2 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,50361,24540,e=>{"use strict";e.i(47167);var t=e.i(71645);let r=function(){try{let e="nuqs-localStorage-test";if("undefined"==typeof localStorage)return!1;localStorage.setItem(e,e);let t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}();function s(e,...t){if(!r)return;let n=function(e,...t){return e.replace(/%[sfdO]/g,e=>{let r=t.shift();return"%O"===e&&r?JSON.stringify(r).replace(/"([^"]+)":/g,"$1:"):String(r)})}(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function n(e,...t){r&&console.warn(e,...t)}let u={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function o(e){return`[nuqs] ${u[e]} + See https://nuqs.dev/NUQS-${e}`}function i(e){if(0===e.size)return"";let t=[];for(let[r,s]of e.entries()){let e=r.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${e}=${s.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(//g,"%3E").replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}`)}return"?"+t.join("&")}let l=(0,t.createContext)({useAdapter(){throw Error(o(404))}});function a(e){return({children:r,defaultOptions:s,processUrlSearchParams:n,...u})=>(0,t.createElement)(l.Provider,{...u,value:{useAdapter:e,defaultOptions:s,processUrlSearchParams:n}},r)}function c(e){let r=(0,t.useContext)(l);if(!("useAdapter"in r))throw Error(o(404));return r.useAdapter(e)}l.displayName="NuqsAdapterContext",r&&"undefined"!=typeof window&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==l&&console.error(o(303)),window.__NuqsAdapterContext=l);let h=()=>(0,t.useContext)(l).defaultOptions,p=()=>(0,t.useContext)(l).processUrlSearchParams;function d(e){return{method:"throttle",timeMs:e}}function f(e){return{method:"debounce",timeMs:e}}e.s(["a",()=>p,"c",()=>s,"i",()=>h,"l",()=>n,"n",()=>a,"o",()=>i,"r",()=>c,"s",()=>o],24540);let m=d(function(){if("undefined"==typeof window||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}());function q(e){return null===e||Array.isArray(e)&&0===e.length}function y(e,t,r){if("string"==typeof e)r.set(t,e);else{for(let s of(r.delete(t),e))r.append(t,s);r.has(t)||r.set(t,"")}return r}function g(){let e=new Map;return{on(t,r){let s=e.get(t)||[];return s.push(r),e.set(t,s),()=>this.off(t,r)},off(t,r){let s=e.get(t);s&&e.set(t,s.filter(e=>e!==r))},emit(t,r){e.get(t)?.forEach(e=>e(r))}}}function v(e,t,r){let s=setTimeout(function(){e(),r.removeEventListener("abort",n)},t);function n(){clearTimeout(s),r.removeEventListener("abort",n)}r.addEventListener("abort",n)}function w(){let e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},r=()=>{};return{promise:new e((e,s)=>{t=e,r=s}),resolve:t,reject:r}}function b(){return new URLSearchParams(location.search)}var S=class{updateMap=new Map;options={history:"replace",scroll:!1,shallow:!0};timeMs=m.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:r},n=m.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),s("[nuqs gtq] Enqueueing %s=%s %O",e,t,r),this.updateMap.set(e,t),"push"===r.history&&(this.options.history="push"),r.scroll&&(this.options.scroll=!0),!1===r.shallow&&(this.options.shallow=!1),r.startTransition&&this.transitions.add(r.startTransition),(!Number.isFinite(this.timeMs)||n>this.timeMs)&&(this.timeMs=n)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=b}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=b,rateLimitFactor:t=1,...r},n){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return s("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=w();let u=()=>{this.lastFlushedAt=performance.now();let[t,s]=this.applyPendingUpdates({...r,autoResetQueueOnUpdate:r.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},n);null===s?(this.resolvers.resolve(t),this.resetQueueOnNextPush=!0):this.resolvers.reject(t),this.resolvers=null},o=()=>{let e=performance.now()-this.lastFlushedAt,r=this.timeMs,n=t*Math.max(0,r-e);s("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",n,r,t),0===n?u():v(u,n,this.controller.signal)};return v(o,0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return s("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=m.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:r,getSearchParamsSnapshot:n}=e,u=n();if(s("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,u.toString()),0===this.updateMap.size)return[u,null];let i=Array.from(this.updateMap.entries()),l={...this.options},a=Array.from(this.transitions);for(let[t,r]of(e.autoResetQueueOnUpdate&&this.reset(),s("[nuqs gtq] Flushing queue %O with options %O",i,l),i))null===r?u.delete(t):u=y(r,t,u);t&&(u=t(u));try{return!function(e,t){let r=t;for(let t=e.length-1;t>=0;t--){let s=e[t];if(!s)continue;let n=r;r=()=>s(n)}r()}(a,()=>{r(u,l)}),[u,null]}catch(e){return console.error(o(429),i.map(([e])=>e).join(),e),[u,e]}}};let Q=new S;var A=class{callback;resolvers=w();controller=new AbortController;queuedValue=void 0;constructor(e){this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,v(()=>{let t=this.resolvers;try{s("[nuqs dq] Flushing debounce queue",e);let r=this.callback(e);s("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=w(),r.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}};let M=new class{throttleQueue;queues=new Map;queuedQuerySync=g();constructor(e=new S){this.throttleQueue=e}useQueuedQueries(e){var r,s;let n,u;return r=(e,t)=>this.queuedQuerySync.on(e,t),s=e=>this.getQueuedQuery(e),n=(0,t.useCallback)(()=>{let t=Object.fromEntries(e.map(e=>[e,s(e)]));return[JSON.stringify(t),t]},[e.join(","),s]),null===(u=(0,t.useRef)(null)).current&&(u.current=n()),(0,t.useSyncExternalStore)((0,t.useCallback)(t=>{let s=e.map(e=>r(e,t));return()=>s.forEach(e=>e())},[e.join(","),r]),()=>{let[e,t]=n();return u.current[0]===e?u.current[1]:(u.current=[e,t],t)},()=>u.current[1])}push(e,t,r,n){if(!Number.isFinite(t))return Promise.resolve((r.getSearchParamsSnapshot??b)());let u=e.key;if(!this.queues.has(u)){s("[nuqs dqc] Creating debounce queue for `%s`",u);let e=new A(e=>(this.throttleQueue.push(e),this.throttleQueue.flush(r,n).finally(()=>{this.queues.get(e.key)?.queuedValue===void 0&&(s("[nuqs dqc] Cleaning up empty queue for `%s`",e.key),this.queues.delete(e.key)),this.queuedQuerySync.emit(e.key)})));this.queues.set(u,e)}s("[nuqs dqc] Enqueueing debounce update %O",e);let o=this.queues.get(u).push(e,t);return this.queuedQuerySync.emit(u),o}abort(e){let t=this.queues.get(e);return t?(s("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())s("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return void 0!==t?t:this.throttleQueue.getQueuedQuery(e)}}(Q);e.s(["a",()=>y,"c",()=>d,"i",()=>q,"n",()=>Q,"o",()=>f,"r",()=>g,"s",()=>m,"t",()=>M],50361)},18566,(e,t,r)=>{t.exports=e.r(76562)},12985,e=>{"use strict";var t=e.i(24540),r=e.i(50361);function s(){(0,t.c)("[nuqs] Aborting queues"),r.t.abortAll(),r.n.abort().forEach(e=>r.t.queuedQuerySync.emit(e))}var n=e.i(71645),u=e.i(18566);let o=0;function i(){o=0,s()}function l(){--o<=0&&(o=0,queueMicrotask(s))}function a(){return(0,n.useEffect)(()=>(!function(){var e;if(e="next/app","undefined"==typeof history||(history.nuqs?.version&&"2.8.5"!==history.nuqs.version?(console.error((0,t.s)(409),history.nuqs.version,"2.8.5",e),!0):!!history.nuqs?.adapters?.includes(e)))return;let r=history.replaceState,s=history.pushState;history.replaceState=function(e,t,s){return l(),r.call(history,e,t,s)},history.pushState=function(e,t,r){return l(),s.call(history,e,t,r)},history.nuqs=history.nuqs??{version:"2.8.5",adapters:[]},history.nuqs.adapters.push("next/app")}(),window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)),[]),null}let c=(0,t.n)(function(){let e=(0,u.useRouter)(),[r,s]=(0,n.useOptimistic)((0,u.useSearchParams)());return{searchParams:r,updateUrl:(0,n.useCallback)((r,u)=>{(0,n.startTransition)(()=>{u.shallow||s(r);let n=function(e){let{origin:r,pathname:s,hash:n}=location;return r+s+(0,t.o)(e)+n}(r);(0,t.c)("[nuqs next/app] Updating url: %s",n);let i="push"===u.history?history.pushState:history.replaceState;o=3,i.call(history,null,"",n),u.scroll&&window.scrollTo(0,0),u.shallow||e.replace(n,{scroll:!1})})},[]),rateLimitFactor:3,autoResetQueueOnUpdate:!1}});function h({children:e,...t}){return(0,n.createElement)(c,{...t,children:[(0,n.createElement)(n.Suspense,{key:"nuqs-adapter-suspense-navspy",children:(0,n.createElement)(a)}),e]})}e.s(["NuqsAdapter",()=>h],12985)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/b701b1a505258ad2.js b/docs/_next/static/chunks/b701b1a505258ad2.js new file mode 100644 index 00000000..bc2c6348 --- /dev/null +++ b/docs/_next/static/chunks/b701b1a505258ad2.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68027,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(43476),o=e.r(12354),i={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},u={fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"},s=function({error:e}){let t=e?.digest;return(0,n.jsxs)("html",{id:"__next_error__",children:[(0,n.jsx)("head",{}),(0,n.jsxs)("body",{children:[(0,n.jsx)(o.HandleISRError,{error:e}),(0,n.jsx)("div",{style:i,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("h2",{style:u,children:["Application error: a ",t?"server":"client","-side exception has occurred while loading ",window.location.hostname," (see the"," ",t?"server logs":"browser console"," for more information)."]}),t?(0,n.jsx)("p",{style:u,children:`Digest: ${t}`}):null]})})]})]})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},35451,(e,t,r)=>{var n={229:function(e){var t,r,n,o=e.exports={};function i(){throw Error("setTimeout has not been defined")}function u(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var c=[],a=!1,l=-1;function f(){a&&n&&(a=!1,n.length?c=n.concat(c):l=-1,c.length&&p())}function p(){if(!a){var e=s(f);a=!0;for(var t=c.length;t;){for(n=c,c=[];++l1)for(var r=1;r{"use strict";var n,o;t.exports=(null==(n=e.g.process)?void 0:n.env)&&"object"==typeof(null==(o=e.g.process)?void 0:o.env)?e.g.process:e.r(35451)},45689,(e,t,r)=>{"use strict";var n=Symbol.for("react.transitional.element");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return{$$typeof:n,type:e,key:o,ref:void 0!==(t=r.ref)?t:null,props:r}}r.Fragment=Symbol.for("react.fragment"),r.jsx=o,r.jsxs=o},43476,(e,t,r)=>{"use strict";t.exports=e.r(45689)},50740,(e,t,r)=>{"use strict";var n=e.i(47167),o=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.for("react.view_transition"),v=Symbol.iterator,_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,b={};function S(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||_}function O(){}function E(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||_}S.prototype.isReactComponent={},S.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},S.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},O.prototype=S.prototype;var T=E.prototype=new O;T.constructor=E,m(T,S.prototype),T.isPureReactComponent=!0;var w=Array.isArray;function j(){}var R={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function A(e,t,r){var n=r.ref;return{$$typeof:o,type:e,key:t,ref:void 0!==n?n:null,props:r}}function P(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var C=/\/+/g;function H(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function k(e,t,r){if(null==e)return e;var n=[],u=0;return!function e(t,r,n,u,s){var c,a,l,f=typeof t;("undefined"===f||"boolean"===f)&&(t=null);var p=!1;if(null===t)p=!0;else switch(f){case"bigint":case"string":case"number":p=!0;break;case"object":switch(t.$$typeof){case o:case i:p=!0;break;case y:return e((p=t._init)(t._payload),r,n,u,s)}}if(p)return s=s(t),p=""===u?"."+H(t,0):u,w(s)?(n="",null!=p&&(n=p.replace(C,"$&/")+"/"),e(s,r,n,"",function(e){return e})):null!=s&&(P(s)&&(c=s,a=n+(null==s.key||t&&t.key===s.key?"":(""+s.key).replace(C,"$&/")+"/")+p,s=A(c.type,a,c.props)),r.push(s)),1;p=0;var d=""===u?".":u+":";if(w(t))for(var h=0;h{"use strict";t.exports=e.r(50740)},18800,(e,t,r)=>{"use strict";var n=e.r(71645);function o(e){var t="https://react.dev/errors/"+e;if(1{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),t.exports=e.r(18800)},90317,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return c},createSnapshot:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class u{disable(){throw i}getStore(){}run(){throw i}exit(){throw i}enterWith(){throw i}static bind(e){return e}}let s="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function c(){return s?new s:new u}function a(e){return s?s.bind(e):u.bind(e)}function l(){return s?s.snapshot():function(e,...t){return e(...t)}}},42344,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,e.r(90317).createAsyncLocalStorage)()},63599,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=e.r(42344)},12354,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"HandleISRError",{enumerable:!0,get:function(){return o}});let n="undefined"==typeof window?e.r(63599).workAsyncStorage:void 0;function o({error:e}){if(n){let t=n.getStore();if(t?.isStaticGeneration)throw e&&console.error(e),e}return null}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/c2a0c8ce789a084e.css b/docs/_next/static/chunks/c2a0c8ce789a084e.css deleted file mode 100644 index 140a7468..00000000 --- a/docs/_next/static/chunks/c2a0c8ce789a084e.css +++ /dev/null @@ -1 +0,0 @@ -html{box-sizing:border-box;background:#000;margin:0;padding:0}*,:before,:after{box-sizing:inherit}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:100%}body{margin:0;padding:0}main{width:100vw;height:100vh}#canvasContainer{z-index:0;position:absolute;inset:0}#controls{color:#fff;z-index:1;background:#00000080;border-radius:0 0 4px;align-items:center;gap:20px;padding:8px 12px 8px 8px;font-size:13px;display:flex;position:fixed;top:0;left:0}input[type=range]{max-width:80px}.CheckboxField,.Field{align-items:center;gap:6px;display:flex}.StaticShapeLabel{color:#fff;white-space:nowrap;text-align:center;background:#00000080;border-radius:1px;padding:1px 3px;font-size:11px}.StatsPanel{right:0;left:auto!important}.AxisLabel{pointer-events:none;font-size:12px}.AxisLabel[data-axis=x]{color:#f90}.AxisLabel[data-axis=y]{color:#9f0}.AxisLabel[data-axis=z]{color:#09f}.MissionSelect-inputWrapper{align-items:center;display:flex;position:relative}.MissionSelect-shortcut{color:#fff9;pointer-events:none;background:#ffffff26;border-radius:3px;padding:1px 4px;font-family:system-ui,sans-serif;font-size:11px;position:absolute;right:7px}.MissionSelect-input[aria-expanded=true]~.MissionSelect-shortcut{display:none}.MissionSelect-input{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;outline:none;width:280px;padding:6px 36px 6px 8px;font-size:14px}.MissionSelect-input[aria-expanded=true]{padding-right:8px}.MissionSelect-input:focus{border-color:#fff9}.MissionSelect-input::placeholder{color:#0000}.MissionSelect-selectedValue{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}.MissionSelect-input[aria-expanded=true]~.MissionSelect-selectedValue{display:none}.MissionSelect-selectedName{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden}.MissionSelect-selectedValue>.MissionSelect-itemType{flex-shrink:0}.MissionSelect-popover{z-index:100;min-width:320px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow-y:auto;box-shadow:0 8px 24px #0009}.MissionSelect-list{padding:4px 0}.MissionSelect-list:has(>.MissionSelect-group:first-child){padding-top:0}.MissionSelect-group{padding-bottom:4px}.MissionSelect-groupLabel{color:#c6caca;z-index:1;background:#3a4548f2;border-bottom:1px solid #ffffff4d;padding:6px 8px 6px 12px;font-size:13px;font-weight:600;position:sticky;top:0}.MissionSelect-group:not(:last-child){border-bottom:1px solid #ffffff4d}.MissionSelect-item{cursor:pointer;border-radius:4px;outline:none;flex-direction:column;gap:1px;margin:4px 4px 0;padding:6px 8px;scroll-margin-top:32px;display:flex}.MissionSelect-list>.MissionSelect-item:first-child{margin-top:0}.MissionSelect-item[data-active-item]{background:#ffffff26}.MissionSelect-item[aria-selected=true]{background:#6496ff4d}.MissionSelect-itemHeader{align-items:center;gap:6px;display:flex}.MissionSelect-itemName{color:#fff;font-size:14px;font-weight:600}.MissionSelect-itemTypes{gap:3px;display:flex}.MissionSelect-itemType{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600}.MissionSelect-itemType:hover{background:#ff9d00b3}.MissionSelect-itemMissionName{color:#ffffff80;font-size:12px}.MissionSelect-noResults{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px}.LoadingSpinner{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite LoadingSpinner-spin}@keyframes LoadingSpinner-spin{to{transform:rotate(360deg)}}#loadingIndicator{pointer-events:none;z-index:1;opacity:.8;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#loadingIndicator[data-complete=true]{animation:.3s ease-out forwards loadingComplete}@keyframes loadingComplete{0%{opacity:1}to{opacity:0}}.LoadingProgress{background:#fff3;border-radius:2px;width:200px;height:4px;overflow:hidden}.LoadingProgress-bar{background:#fff;border-radius:2px;height:100%;transition:width .1s ease-out}.LoadingProgress-text{color:#ffffffb3;font-variant-numeric:tabular-nums;font-size:14px} diff --git a/docs/_next/static/chunks/turbopack-ab07404ca97cd82a.js b/docs/_next/static/chunks/turbopack-8fa260b184153c3e.js similarity index 98% rename from docs/_next/static/chunks/turbopack-ab07404ca97cd82a.js rename to docs/_next/static/chunks/turbopack-8fa260b184153c3e.js index e79180e1..a0bd5496 100644 --- a/docs/_next/static/chunks/turbopack-ab07404ca97cd82a.js +++ b/docs/_next/static/chunks/turbopack-8fa260b184153c3e.js @@ -1,3 +1,3 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/5b1b8f9bd8f0faac.js","static/chunks/112f346e31f991df.js","static/chunks/ba8a736ce3226769.js","static/chunks/5476504fbe1f5f80.js","static/chunks/5a34e3874f745a25.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/t2-mapper/_next/",r=new WeakMap;function n(e,t){this.m=e,this.e=t}let o=n.prototype,l=Object.prototype.hasOwnProperty,i="undefined"!=typeof Symbol&&Symbol.toStringTag;function s(e,t,r){l.call(e,t)||Object.defineProperty(e,t,r)}function u(e,t){let r=e[t];return r||(r=a(t),e[t]=r),r}function a(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function c(e,t){s(e,"__esModule",{value:!0}),i&&s(e,i,{value:"Module"});let r=0;for(;rObject.getPrototypeOf(e):e=>e.__proto__,p=[null,f({}),f([]),f(f)];function h(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!p.includes(t);t=f(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),c(t,n),t}function d(e){let t=N(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=h(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function m(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}o.i=d,o.A=function(e){return this.r(e)(d.bind(this))},o.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},o.r=function(e){return N(e,this.m).exports},o.f=function(e){function t(t){if(l.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(l.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let b=Symbol("turbopack queues"),y=Symbol("turbopack exports"),O=Symbol("turbopack error");function g(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}o.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:l,reject:i,promise:s}=m(),u=Object.assign(s,{[y]:r.exports,[b]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[y]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(b in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[y]:{},[b]:e=>e(t)};return e.then(e=>{r[y]=e,g(t)},e=>{r[O]=e,g(t)}),r}}return{[y]:e,[b]:()=>{}}}),r=()=>t.map(e=>{if(e[O])throw e[O];return e[y]}),{promise:l,resolve:i}=m(),s=Object.assign(()=>i(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[b](u)),s.queueCount?l:r()},function(e){e?i(u[O]=e):l(u[y]),g(n)}),n&&-1===n.status&&(n.status=0)};let w=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function j(e,t){throw Error(`Invariant: ${t(e)}`)}w.prototype=URL.prototype,o.U=w,o.z=function(e){throw Error("dynamic usage of require is not supported")},o.g=globalThis;let R=n.prototype;var C,U=((C=U||{})[C.Runtime=0]="Runtime",C[C.Parent=1]="Parent",C[C.Update=2]="Update",C);let k=new Map;o.M=k;let v=new Map,_=new Map;async function P(e,t,r){let n;if("string"==typeof r)return A(e,t,S(r));let o=r.included||[],l=o.map(e=>!!k.has(e)||v.get(e));if(l.length>0&&l.every(e=>e))return void await Promise.all(l);let i=r.moduleChunks||[],s=i.map(e=>_.get(e)).filter(e=>e);if(s.length>0){if(s.length===i.length)return void await Promise.all(s);let r=new Set;for(let e of i)_.has(e)||r.add(e);for(let n of r){let r=A(e,t,S(n));_.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=A(e,t,S(r.path)),i))_.has(o)||_.set(o,n)}for(let e of o)v.has(e)||v.set(e,n);await n}R.l=function(e){return P(1,this.m.id,e)};let $=Promise.resolve(void 0),T=new WeakMap;function A(t,r,n){let o=e.loadChunkCached(t,n),l=T.get(o);if(void 0===l){let e=T.set.bind(T,o,$);l=o.then(e).catch(e=>{let o;switch(t){case 0:o=`as a runtime dependency of chunk ${r}`;break;case 1:o=`from module ${r}`;break;case 2:o="from an HMR update";break;default:j(t,e=>`Unknown source type: ${e}`)}throw Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0)}),T.set(o,l)}return l}function S(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}`}R.L=function(e){return A(1,this.m.id,e)},R.R=function(e){let t=this.r(e);return t?.default??t},R.P=function(e){return`/ROOT/${e??""}`},R.b=function(e){let t=new Blob([`self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)}; +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/b701b1a505258ad2.js","static/chunks/112f346e31f991df.js","static/chunks/5a34e3874f745a25.js","static/chunks/5476504fbe1f5f80.js","static/chunks/ba8a736ce3226769.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/t2-mapper/_next/",r=new WeakMap;function n(e,t){this.m=e,this.e=t}let o=n.prototype,l=Object.prototype.hasOwnProperty,i="undefined"!=typeof Symbol&&Symbol.toStringTag;function s(e,t,r){l.call(e,t)||Object.defineProperty(e,t,r)}function u(e,t){let r=e[t];return r||(r=a(t),e[t]=r),r}function a(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function c(e,t){s(e,"__esModule",{value:!0}),i&&s(e,i,{value:"Module"});let r=0;for(;rObject.getPrototypeOf(e):e=>e.__proto__,p=[null,f({}),f([]),f(f)];function h(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!p.includes(t);t=f(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),c(t,n),t}function d(e){let t=N(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=h(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function m(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}o.i=d,o.A=function(e){return this.r(e)(d.bind(this))},o.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},o.r=function(e){return N(e,this.m).exports},o.f=function(e){function t(t){if(l.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(l.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let b=Symbol("turbopack queues"),y=Symbol("turbopack exports"),O=Symbol("turbopack error");function g(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}o.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:l,reject:i,promise:s}=m(),u=Object.assign(s,{[y]:r.exports,[b]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[y]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(b in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[y]:{},[b]:e=>e(t)};return e.then(e=>{r[y]=e,g(t)},e=>{r[O]=e,g(t)}),r}}return{[y]:e,[b]:()=>{}}}),r=()=>t.map(e=>{if(e[O])throw e[O];return e[y]}),{promise:l,resolve:i}=m(),s=Object.assign(()=>i(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[b](u)),s.queueCount?l:r()},function(e){e?i(u[O]=e):l(u[y]),g(n)}),n&&-1===n.status&&(n.status=0)};let w=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function j(e,t){throw Error(`Invariant: ${t(e)}`)}w.prototype=URL.prototype,o.U=w,o.z=function(e){throw Error("dynamic usage of require is not supported")},o.g=globalThis;let R=n.prototype;var C,U=((C=U||{})[C.Runtime=0]="Runtime",C[C.Parent=1]="Parent",C[C.Update=2]="Update",C);let k=new Map;o.M=k;let v=new Map,_=new Map;async function P(e,t,r){let n;if("string"==typeof r)return A(e,t,S(r));let o=r.included||[],l=o.map(e=>!!k.has(e)||v.get(e));if(l.length>0&&l.every(e=>e))return void await Promise.all(l);let i=r.moduleChunks||[],s=i.map(e=>_.get(e)).filter(e=>e);if(s.length>0){if(s.length===i.length)return void await Promise.all(s);let r=new Set;for(let e of i)_.has(e)||r.add(e);for(let n of r){let r=A(e,t,S(n));_.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=A(e,t,S(r.path)),i))_.has(o)||_.set(o,n)}for(let e of o)v.has(e)||v.set(e,n);await n}R.l=function(e){return P(1,this.m.id,e)};let $=Promise.resolve(void 0),T=new WeakMap;function A(t,r,n){let o=e.loadChunkCached(t,n),l=T.get(o);if(void 0===l){let e=T.set.bind(T,o,$);l=o.then(e).catch(e=>{let o;switch(t){case 0:o=`as a runtime dependency of chunk ${r}`;break;case 1:o=`from module ${r}`;break;case 2:o="from an HMR update";break;default:j(t,e=>`Unknown source type: ${e}`)}throw Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0)}),T.set(o,l)}return l}function S(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}`}R.L=function(e){return A(1,this.m.id,e)},R.R=function(e){let t=this.r(e);return t?.default??t},R.P=function(e){return`/ROOT/${e??""}`},R.b=function(e){let t=new Blob([`self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)}; self.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(e.reverse().map(S),null,2)}; importScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`],{type:"text/javascript"});return URL.createObjectURL(t)};let E=/\.js(?:\?[^#]*)?(?:#.*)?$/,K=/\.css(?:\?[^#]*)?(?:#.*)?$/;function x(e){return K.test(e)}o.w=function(t,r,n){return e.loadWebAssembly(1,this.m.id,t,r,n)},o.u=function(t,r){return e.loadWebAssemblyModule(1,this.m.id,t,r)};let M={};o.c=M;let N=(e,t)=>{let r=M[e];if(r){if(r.error)throw r.error;return r}return L(e,U.Parent,t.id)};function L(e,t,r){let o=k.get(e);if("function"!=typeof o)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:j(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let l=a(e),i=l.exports;M[e]=l;let s=new n(l,i);try{o(s,l,i)}catch(e){throw l.error=e,e}return l.namespaceObject&&l.exports!==l.namespaceObject&&h(l.exports,l.namespaceObject),l}function q(r){let n,o=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(("undefined"!=typeof TURBOPACK_NEXT_CHUNK_URLS?TURBOPACK_NEXT_CHUNK_URLS.pop():e.getAttribute("src")).replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(r[0]);return 2===r.length?n=r[1]:(n=void 0,!function(e,t,r,n){let o=1;for(;o{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},B.set(e,t)}return t}e={async registerChunk(e,t){if(W(S(e)).resolve(),null!=t){for(let e of t.otherChunks)W(S("string"==typeof e?e:e.path));if(await Promise.all(t.otherChunks.map(t=>P(0,e,t))),t.runtimeModuleIds.length>0)for(let r of t.runtimeModuleIds)!function(e,t){let r=M[t];if(r){if(r.error)throw r.error;return}L(t,U.Runtime,e)}(e,r)}},loadChunkCached:(e,t)=>(function(e,t){let r=W(t);if(r.loadingStarted)return r.promise;if(e===U.Runtime)return r.loadingStarted=!0,x(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(x(t));else if(E.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(TURBOPACK_WORKER_LOCATION+t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(x(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(E.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let l=fetch(S(r)),{instance:i}=await WebAssembly.instantiateStreaming(l,o);return i.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(S(r));return await WebAssembly.compileStreaming(o)}};let I=globalThis.TURBOPACK;globalThis.TURBOPACK={push:q},I.forEach(q)})(); \ No newline at end of file diff --git a/docs/_next/static/B9Mz834jSAfO_CiVWkcwc/_buildManifest.js b/docs/_next/static/scQMBCUl76V3bQl4SK2Zy/_buildManifest.js similarity index 100% rename from docs/_next/static/B9Mz834jSAfO_CiVWkcwc/_buildManifest.js rename to docs/_next/static/scQMBCUl76V3bQl4SK2Zy/_buildManifest.js diff --git a/docs/_next/static/B9Mz834jSAfO_CiVWkcwc/_clientMiddlewareManifest.json b/docs/_next/static/scQMBCUl76V3bQl4SK2Zy/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/B9Mz834jSAfO_CiVWkcwc/_clientMiddlewareManifest.json rename to docs/_next/static/scQMBCUl76V3bQl4SK2Zy/_clientMiddlewareManifest.json diff --git a/docs/_next/static/B9Mz834jSAfO_CiVWkcwc/_ssgManifest.js b/docs/_next/static/scQMBCUl76V3bQl4SK2Zy/_ssgManifest.js similarity index 100% rename from docs/_next/static/B9Mz834jSAfO_CiVWkcwc/_ssgManifest.js rename to docs/_next/static/scQMBCUl76V3bQl4SK2Zy/_ssgManifest.js diff --git a/docs/_not-found/__next._full.txt b/docs/_not-found/__next._full.txt index 693cad9d..7ba64a3c 100644 --- a/docs/_not-found/__next._full.txt +++ b/docs/_not-found/__next._full.txt @@ -1,14 +1,15 @@ 1:"$Sreact.fragment" -2:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -3:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -4:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] -5:"$Sreact.suspense" -7:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ViewportBoundary"] -9:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] -b:I[68027,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","style"] -0:{"P":null,"b":"B9Mz834jSAfO_CiVWkcwc","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L7",null,{"children":"$@8"}],["$","div",null,{"hidden":true,"children":["$","$L9",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$@a"}]}]}],null]}],false]],"m":"$undefined","G":["$b","$undefined"],"S":true} -8:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] -c:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] -a:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$Lc","3",{}]] -6:null +2:I[12985,["/t2-mapper/_next/static/chunks/9309477277712998.js"],"NuqsAdapter"] +3:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +4:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +5:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] +6:"$Sreact.suspense" +8:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ViewportBoundary"] +a:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] +c:I[68027,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +:HL["/t2-mapper/_next/static/chunks/045236f705732fea.css","style"] +0:{"P":null,"b":"scQMBCUl76V3bQl4SK2Zy","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/045236f705732fea.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/9309477277712998.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$@9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$@b"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] +d:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] +b:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$Ld","3",{}]] +7:null diff --git a/docs/_not-found/__next._head.txt b/docs/_not-found/__next._head.txt index 54d0ced5..98388e2e 100644 --- a/docs/_not-found/__next._head.txt +++ b/docs/_not-found/__next._head.txt @@ -3,6 +3,6 @@ 4:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] 5:"$Sreact.suspense" 7:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":"$@3"}],["$","div",null,{"hidden":true,"children":["$","$L4",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$@6"}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":"$@3"}],["$","div",null,{"hidden":true,"children":["$","$L4",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$@6"}]}]}],null]}],"loading":null,"isPartial":false} 3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] 6:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L7","3",{}]] diff --git a/docs/_not-found/__next._index.txt b/docs/_not-found/__next._index.txt index e9cd28e3..b1bb37c6 100644 --- a/docs/_not-found/__next._index.txt +++ b/docs/_not-found/__next._index.txt @@ -1,5 +1,6 @@ 1:"$Sreact.fragment" -2:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -3:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","style"] -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","precedence":"next"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]]}],"loading":null,"isPartial":false} +2:I[12985,["/t2-mapper/_next/static/chunks/9309477277712998.js"],"NuqsAdapter"] +3:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +4:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +:HL["/t2-mapper/_next/static/chunks/045236f705732fea.css","style"] +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/045236f705732fea.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/9309477277712998.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._not-found.__PAGE__.txt b/docs/_not-found/__next._not-found.__PAGE__.txt index e59cc5b5..9fd3bea4 100644 --- a/docs/_not-found/__next._not-found.__PAGE__.txt +++ b/docs/_not-found/__next._not-found.__PAGE__.txt @@ -1,5 +1,5 @@ 1:"$Sreact.fragment" 2:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] 3:"$Sreact.suspense" -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} 4:null diff --git a/docs/_not-found/__next._not-found.txt b/docs/_not-found/__next._not-found.txt index ae8458c8..faef4298 100644 --- a/docs/_not-found/__next._not-found.txt +++ b/docs/_not-found/__next._not-found.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._tree.txt b/docs/_not-found/__next._tree.txt index 2d1fef9f..706297a0 100644 --- a/docs/_not-found/__next._tree.txt +++ b/docs/_not-found/__next._tree.txt @@ -1,2 +1,2 @@ -:HL["/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","style"] -0:{"buildId":"B9Mz834jSAfO_CiVWkcwc","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/045236f705732fea.css","style"] +0:{"buildId":"scQMBCUl76V3bQl4SK2Zy","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/_not-found/index.html b/docs/_not-found/index.html index 9b86b716..4b48cc09 100644 --- a/docs/_not-found/index.html +++ b/docs/_not-found/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_not-found/index.txt b/docs/_not-found/index.txt index 693cad9d..7ba64a3c 100644 --- a/docs/_not-found/index.txt +++ b/docs/_not-found/index.txt @@ -1,14 +1,15 @@ 1:"$Sreact.fragment" -2:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -3:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -4:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] -5:"$Sreact.suspense" -7:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ViewportBoundary"] -9:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] -b:I[68027,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","style"] -0:{"P":null,"b":"B9Mz834jSAfO_CiVWkcwc","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L7",null,{"children":"$@8"}],["$","div",null,{"hidden":true,"children":["$","$L9",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$@a"}]}]}],null]}],false]],"m":"$undefined","G":["$b","$undefined"],"S":true} -8:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] -c:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] -a:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$Lc","3",{}]] -6:null +2:I[12985,["/t2-mapper/_next/static/chunks/9309477277712998.js"],"NuqsAdapter"] +3:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +4:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +5:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] +6:"$Sreact.suspense" +8:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ViewportBoundary"] +a:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] +c:I[68027,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +:HL["/t2-mapper/_next/static/chunks/045236f705732fea.css","style"] +0:{"P":null,"b":"scQMBCUl76V3bQl4SK2Zy","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/045236f705732fea.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/9309477277712998.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$@9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$@b"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] +d:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] +b:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$Ld","3",{}]] +7:null diff --git a/docs/index.html b/docs/index.html index 4493c28d..d567d638 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -MapGenius – Explore maps for Tribes 2 \ No newline at end of file +MapGenius – Explore maps for Tribes 2 \ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index fb9bfebd..3d857604 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -1,18 +1,19 @@ 1:"$Sreact.fragment" -2:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -3:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] -4:I[47257,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ClientPageRoot"] -5:I[31713,["/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","/t2-mapper/_next/static/chunks/88a69012eeffa5b8.js","/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js"],"default"] -8:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] -9:"$Sreact.suspense" -b:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ViewportBoundary"] -d:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] -f:I[68027,[],"default"] -:HL["/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","style"] -0:{"P":null,"b":"B9Mz834jSAfO_CiVWkcwc","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/c2a0c8ce789a084e.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/88a69012eeffa5b8.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$@c"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$@e"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[]],"S":true} -6:{} -7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" -c:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] -10:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] -e:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L10","3",{}]] -a:null +2:I[12985,["/t2-mapper/_next/static/chunks/9309477277712998.js"],"NuqsAdapter"] +3:I[39756,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +4:I[37457,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"default"] +5:I[47257,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ClientPageRoot"] +6:I[31713,["/t2-mapper/_next/static/chunks/9309477277712998.js","/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","/t2-mapper/_next/static/chunks/259e253a988800da.js","/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js"],"default"] +9:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"OutletBoundary"] +a:"$Sreact.suspense" +c:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"ViewportBoundary"] +e:I[97367,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"MetadataBoundary"] +10:I[68027,[],"default"] +:HL["/t2-mapper/_next/static/chunks/045236f705732fea.css","style"] +0:{"P":null,"b":"scQMBCUl76V3bQl4SK2Zy","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/045236f705732fea.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/9309477277712998.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/3a3cff0360e2ba9f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/ed074071f28b33e1.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/259e253a988800da.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/acd032a5b4d059f4.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$@d"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$@f"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +7:{} +8:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" +d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] +11:I[27201,["/t2-mapper/_next/static/chunks/42879de7b8087bc9.js"],"IconMark"] +f:[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L11","3",{}]] +b:null diff --git a/package-lock.json b/package-lock.json index 42bac3f8..311fd131 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,10 +17,12 @@ "lodash.orderby": "^4.6.0", "match-sorter": "^8.2.0", "next": "^16.0.10", + "nuqs": "^2.8.5", "picomatch": "^4.0.3", "react": "^19.2.3", "react-dom": "^19.2.3", "react-error-boundary": "^6.0.0", + "react-icons": "^5.5.0", "three": "^0.182.0", "unzipper": "^0.12.3", "zustand": "^5.0.9" @@ -1753,7 +1755,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", - "dev": true, "license": "MIT" }, "node_modules/@swc/helpers": { @@ -3951,6 +3952,7 @@ "resolved": "https://registry.npmjs.org/next/-/next-16.0.10.tgz", "integrity": "sha512-RtWh5PUgI+vxlV3HdR+IfWA1UUHu0+Ram/JBO4vWB54cVPentCD0e+lxyAYEsDTqGGMg7qpjhKh6dc6aW7W/sA==", "license": "MIT", + "peer": true, "dependencies": { "@next/env": "16.0.10", "@swc/helpers": "0.5.15", @@ -4004,6 +4006,43 @@ "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "license": "MIT" }, + "node_modules/nuqs": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/nuqs/-/nuqs-2.8.5.tgz", + "integrity": "sha512-ndhnNB9eLX/bsiGFkBNsrfOWf3BCbzBMD+b5GkD5o2Q96Q+llHnoUlZsrO3tgJKZZV7LLlVCvFKdj+sjBITRzg==", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/franky47" + }, + "peerDependencies": { + "@remix-run/react": ">=2", + "@tanstack/react-router": "^1", + "next": ">=14.2.0", + "react": ">=18.2.0 || ^19.0.0-0", + "react-router": "^5 || ^6 || ^7", + "react-router-dom": "^5 || ^6 || ^7" + }, + "peerDependenciesMeta": { + "@remix-run/react": { + "optional": true + }, + "@tanstack/react-router": { + "optional": true + }, + "next": { + "optional": true + }, + "react-router": { + "optional": true + }, + "react-router-dom": { + "optional": true + } + } + }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", @@ -4494,6 +4533,15 @@ "react": ">=16.13.1" } }, + "node_modules/react-icons": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz", + "integrity": "sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw==", + "license": "MIT", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-reconciler": { "version": "0.31.0", "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.31.0.tgz", diff --git a/package.json b/package.json index 2c220502..81a3710d 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,12 @@ "lodash.orderby": "^4.6.0", "match-sorter": "^8.2.0", "next": "^16.0.10", + "nuqs": "^2.8.5", "picomatch": "^4.0.3", "react": "^19.2.3", "react-dom": "^19.2.3", "react-error-boundary": "^6.0.0", + "react-icons": "^5.5.0", "three": "^0.182.0", "unzipper": "^0.12.3", "zustand": "^5.0.9" diff --git a/src/components/CamerasProvider.tsx b/src/components/CamerasProvider.tsx index 0403a6d7..e3e61026 100644 --- a/src/components/CamerasProvider.tsx +++ b/src/components/CamerasProvider.tsx @@ -36,8 +36,13 @@ export function useCameras() { export function CamerasProvider({ children }: { children: ReactNode }) { const { camera } = useThree(); - const [cameraIndex, setCameraIndex] = useState(0); + const [cameraIndex, setCameraIndex] = useState(-1); const [cameraMap, setCameraMap] = useState>({}); + const [initialViewState, setInitialViewState] = useState(() => ({ + initialized: false, + position: null, + quarternion: null, + })); const registerCamera = useCallback((camera: CameraEntry) => { setCameraMap((prevCameraMap) => ({ @@ -55,38 +60,70 @@ export function CamerasProvider({ children }: { children: ReactNode }) { const cameraCount = Object.keys(cameraMap).length; - const nextCamera = useCallback(() => { - setCameraIndex((prev) => { - if (cameraCount === 0) { - return 0; - } - return (prev + 1) % cameraCount; - }); - }, [cameraCount]); - const setCamera = useCallback( (index: number) => { + console.log(`[CamerasProvider] setCamera(${index})`); if (index >= 0 && index < cameraCount) { + console.log(`[CamerasProvider] setCameraIndex(${index})`); setCameraIndex(index); + const cameraId = Object.keys(cameraMap)[index]; + const cameraInfo = cameraMap[cameraId]; + camera.position.copy(cameraInfo.position); + // Apply coordinate system correction for Torque3D to Three.js + const correction = new Quaternion().setFromAxisAngle( + new Vector3(0, 1, 0), + -Math.PI / 2, + ); + camera.quaternion.copy(cameraInfo.rotation).multiply(correction); + console.log(`[CamerasProvider] Done updating camera.`); } }, - [cameraCount], + [camera, cameraCount, cameraMap], ); + const nextCamera = useCallback(() => { + console.log(`[CamerasProvider] nextCamera()`, cameraCount, cameraIndex); + setCamera(cameraCount ? (cameraIndex + 1) % cameraCount : -1); + }, [cameraCount, cameraIndex, setCamera]); + useEffect(() => { - const cameraCount = Object.keys(cameraMap).length; - if (cameraIndex < cameraCount) { - const cameraId = Object.keys(cameraMap)[cameraIndex]; - const cameraInfo = cameraMap[cameraId]; - camera.position.copy(cameraInfo.position); - // Apply coordinate system correction for Torque3D to Three.js - const correction = new Quaternion().setFromAxisAngle( - new Vector3(0, 1, 0), - -Math.PI / 2, - ); - camera.quaternion.copy(cameraInfo.rotation).multiply(correction); + const hash = window.location.hash; + if (hash.startsWith("#c")) { + const [positionString, quarternionString] = hash.slice(2).split("~"); + const position = positionString.split(",").map((s) => parseFloat(s)); + const quarternion = quarternionString + .split(",") + .map((s) => parseFloat(s)); + setInitialViewState({ + initialized: true, + position: new Vector3(...position), + quarternion: new Quaternion(...quarternion), + }); + } else { + setInitialViewState({ + initialized: true, + position: null, + quarternion: null, + }); } - }, [cameraIndex, cameraMap, camera]); + }, []); + + useEffect(() => { + if (initialViewState.initialized && initialViewState.position) { + camera.position.copy(initialViewState.position); + if (initialViewState.quarternion) { + camera.quaternion.copy(initialViewState.quarternion); + } + } + }, [initialViewState]); + + useEffect(() => { + if (!initialViewState.initialized || initialViewState.position) return; + if (cameraCount > 0 && cameraIndex === -1) { + console.log(`[CamerasProvider] setCamera(0) in useEffect`); + setCamera(0); + } + }, [cameraCount, setCamera, cameraIndex]); const context: CamerasContextValue = useMemo( () => ({ diff --git a/src/components/CopyCoordinatesButton.tsx b/src/components/CopyCoordinatesButton.tsx new file mode 100644 index 00000000..2ee4cb15 --- /dev/null +++ b/src/components/CopyCoordinatesButton.tsx @@ -0,0 +1,60 @@ +import { RefObject, useCallback, useRef, useState } from "react"; +import { FaMapPin } from "react-icons/fa"; +import { FaClipboardCheck } from "react-icons/fa6"; +import { Camera, Quaternion, Vector3 } from "three"; + +function encodeViewHash({ + position, + quaternion, +}: { + position: Vector3; + quaternion: Quaternion; +}) { + const trunc = (num: number) => parseFloat(num.toFixed(3)); + const encodedPosition = `${trunc(position.x)},${trunc(position.y)},${trunc(position.z)}`; + const encodedQuaternion = `${trunc(quaternion.x)},${trunc(quaternion.y)},${trunc(quaternion.z)},${trunc(quaternion.w)}`; + return `#c${encodedPosition}~${encodedQuaternion}`; +} + +export function CopyCoordinatesButton({ + cameraRef, +}: { + cameraRef: RefObject; +}) { + const [showCopied, setShowCopied] = useState(false); + const timerRef = useRef | null>(null); + + const handleCopyLink = useCallback(async () => { + clearTimeout(timerRef.current); + const camera = cameraRef.current; + if (!camera) return; + const hash = encodeViewHash(camera); + // Update the URL hash + const fullPath = `${window.location.pathname}${window.location.search}${hash}`; + const fullUrl = `${window.location.origin}${fullPath}`; + window.history.replaceState(null, "", fullPath); + try { + await navigator.clipboard.writeText(fullUrl); + setShowCopied(true); + timerRef.current = setTimeout(() => { + setShowCopied(false); + }, 1300); + } catch (err) { + console.error(err); + } + }, [cameraRef]); + + return ( + + ); +} diff --git a/src/components/InspectorControls.tsx b/src/components/InspectorControls.tsx index 1b832f24..b28642a9 100644 --- a/src/components/InspectorControls.tsx +++ b/src/components/InspectorControls.tsx @@ -1,10 +1,14 @@ import { useControls, useDebug, useSettings } from "./SettingsProvider"; import { MissionSelect } from "./MissionSelect"; +import { RefObject } from "react"; +import { Camera } from "three"; +import { CopyCoordinatesButton } from "./CopyCoordinatesButton"; export function InspectorControls({ missionName, missionType, onChangeMission, + cameraRef, }: { missionName: string; missionType: string; @@ -15,6 +19,7 @@ export function InspectorControls({ missionName: string; missionType: string; }) => void; + cameraRef: RefObject; }) { const { fogEnabled, @@ -41,6 +46,7 @@ export function InspectorControls({ missionType={missionType} onChange={onChangeMission} /> +
void; onLoadingChange?: (isLoading: boolean, progress?: number) => void; } diff --git a/src/components/MissionSelect.tsx b/src/components/MissionSelect.tsx index 818a6e90..d38c08a8 100644 --- a/src/components/MissionSelect.tsx +++ b/src/components/MissionSelect.tsx @@ -212,7 +212,7 @@ export function MissionSelect({ if (!searchValue) return { type: "grouped" as const, groups: defaultGroups }; const matches = matchSorter(allMissions, searchValue, { - keys: ["displayName", "missionName"], + keys: ["displayName", "missionName", "missionTypes", "groupName"], }); return { type: "flat" as const, missions: matches }; }, [searchValue]); diff --git a/src/components/ObserverControls.tsx b/src/components/ObserverControls.tsx index bfbd5726..2296b44c 100644 --- a/src/components/ObserverControls.tsx +++ b/src/components/ObserverControls.tsx @@ -45,8 +45,15 @@ function CameraMovement() { const controls = new PointerLockControls(camera, gl.domElement); controlsRef.current = controls; + return () => { + controls.dispose(); + }; + }, [camera, gl.domElement]); + + useEffect(() => { const handleClick = (e: MouseEvent) => { - if (controls.isLocked) { + const controls = controlsRef.current; + if (!controls || controls.isLocked) { nextCamera(); } else if (e.target === gl.domElement) { // Only lock if clicking directly on the canvas (not on UI elements) @@ -58,9 +65,8 @@ function CameraMovement() { return () => { document.removeEventListener("click", handleClick); - controls.dispose(); }; - }, [camera, gl, nextCamera]); + }, [nextCamera]); // Handle number keys 1-9 for camera selection useEffect(() => {