diff --git a/docs/404.html b/docs/404.html index dd886b26..b99edd65 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 dd886b26..b99edd65 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 9265c205..f9712c01 100644 --- a/docs/__next.__PAGE__.txt +++ b/docs/__next.__PAGE__.txt @@ -1,10 +1,10 @@ 1:"$Sreact.fragment" 2:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -3:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/790c269d8dfa8bf7.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/114146b21a4f5f3e.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/634517795b833f16.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] +3:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/63afa42c92661c50.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] 6:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] 7:"$Sreact.suspense" :HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/790c269d8dfa8bf7.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/114146b21a4f5f3e.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/634517795b833f16.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/63afa42c92661c50.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.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 395e77f1..dddeeb18 100644 --- a/docs/__next._full.txt +++ b/docs/__next._full.txt @@ -3,7 +3,7 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/790c269d8dfa8bf7.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/114146b21a4f5f3e.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/634517795b833f16.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] +6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/63afa42c92661c50.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] @@ -11,7 +11,7 @@ e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBounda 10:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] :HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"P":null,"b":"hT_425m97F9QlWX2JJZPJ","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/790c269d8dfa8bf7.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/114146b21a4f5f3e.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/634517795b833f16.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.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":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/63afa42c92661c50.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.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":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],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, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/__next._head.txt b/docs/__next._head.txt index 90169eed..b57734f2 100644 --- a/docs/__next._head.txt +++ b/docs/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","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"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","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"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/__next._index.txt b/docs/__next._index.txt index 646b5b34..a6efb165 100644 --- a/docs/__next._index.txt +++ b/docs/__next._index.txt @@ -3,4 +3,4 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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 187fe093..c2544fb1 100644 --- a/docs/__next._tree.txt +++ b/docs/__next._tree.txt @@ -1,3 +1,3 @@ :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] :HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","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} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","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/hT_425m97F9QlWX2JJZPJ/_buildManifest.js b/docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_buildManifest.js similarity index 100% rename from docs/_next/static/hT_425m97F9QlWX2JJZPJ/_buildManifest.js rename to docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_buildManifest.js diff --git a/docs/_next/static/hT_425m97F9QlWX2JJZPJ/_clientMiddlewareManifest.json b/docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/hT_425m97F9QlWX2JJZPJ/_clientMiddlewareManifest.json rename to docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_clientMiddlewareManifest.json diff --git a/docs/_next/static/hT_425m97F9QlWX2JJZPJ/_ssgManifest.js b/docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_ssgManifest.js similarity index 100% rename from docs/_next/static/hT_425m97F9QlWX2JJZPJ/_ssgManifest.js rename to docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_ssgManifest.js diff --git a/docs/_next/static/chunks/0070446447a9983b.js b/docs/_next/static/chunks/0070446447a9983b.js new file mode 100644 index 00000000..f0f0aaf5 --- /dev/null +++ b/docs/_next/static/chunks/0070446447a9983b.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Actions:"GameDialog-module__C6hZDW__Actions",Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},56614,e=>{e.v({Actions:"ServerBrowser-module__kqm3eq__Actions "+e.i(81847).Actions,CloseButton:"ServerBrowser-module__kqm3eq__CloseButton "+e.i(81847).Secondary,Dialog:"ServerBrowser-module__kqm3eq__Dialog "+e.i(81847).Dialog,Empty:"ServerBrowser-module__kqm3eq__Empty",EmptyServer:"ServerBrowser-module__kqm3eq__EmptyServer",Footer:"ServerBrowser-module__kqm3eq__Footer",Header:"ServerBrowser-module__kqm3eq__Header",HiddenRadio:"ServerBrowser-module__kqm3eq__HiddenRadio",Hint:"ServerBrowser-module__kqm3eq__Hint",JoinButton:"ServerBrowser-module__kqm3eq__JoinButton "+e.i(81847).DialogButton,Overlay:"ServerBrowser-module__kqm3eq__Overlay "+e.i(81847).Overlay,PasswordIcon:"ServerBrowser-module__kqm3eq__PasswordIcon",RefreshButton:"ServerBrowser-module__kqm3eq__RefreshButton "+e.i(81847).DialogButton,ServerCount:"ServerBrowser-module__kqm3eq__ServerCount",Table:"ServerBrowser-module__kqm3eq__Table",TableWrapper:"ServerBrowser-module__kqm3eq__TableWrapper",Title:"ServerBrowser-module__kqm3eq__Title",WarriorField:"ServerBrowser-module__kqm3eq__WarriorField",WarriorInput:"ServerBrowser-module__kqm3eq__WarriorInput",WarriorLabel:"ServerBrowser-module__kqm3eq__WarriorLabel"})},45554,e=>{"use strict";var r=e.i(43476),l=e.i(932),o=e.i(71645),s=e.i(56614),t=e.i(98755),a=e.i(79123);function n(e){let n,v,f,S,p,g,x,j,y,q,k,B,w,C,b,N,D,W,T,L,E,P,R,A,H,O,F,I,G,Z,J,K=(0,l.c)(90),{onClose:M}=e,U=(0,t.useLiveSelector)(h),Q=(0,t.useLiveSelector)(_),z=(0,t.useLiveSelector)(m),V=(0,t.useLiveSelector)(u),X=(0,t.useLiveSelector)(c),{warriorName:Y,setWarriorName:$}=(0,a.useSettings)(),[ee,er]=(0,o.useState)(null);K[0]!==X||K[1]!==M||K[2]!==ee||K[3]!==Y?(n=()=>{ee&&(X(ee,Y),M())},K[0]=X,K[1]=M,K[2]=ee,K[3]=Y,K[4]=n):n=K[4];let el=n;K[5]!==X||K[6]!==M||K[7]!==Y?(v=e=>{X(e,Y),M()},K[5]=X,K[6]=M,K[7]=Y,K[8]=v):v=K[8];let eo=v,[es,et]=(0,o.useState)("ping"),[ea,en]=(0,o.useState)("asc"),ei=(0,o.useRef)(null);K[9]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{ei.current?.focus();try{document.exitPointerLock()}catch{}},S=[],K[9]=f,K[10]=S):(f=K[9],S=K[10]),(0,o.useEffect)(f,S),K[11]!==V?(p=()=>{V()},g=[V],K[11]=V,K[12]=p,K[13]=g):(p=K[12],g=K[13]),(0,o.useEffect)(p,g),K[14]!==M?(x=()=>{let e=e=>{e.stopPropagation(),"Escape"===e.key&&M()};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},j=[M],K[14]=M,K[15]=x,K[16]=j):(x=K[15],j=K[16]),(0,o.useEffect)(x,j),K[17]!==es?(y=e=>{es===e?en(d):(et(e),en("desc"))},K[17]=es,K[18]=y):y=K[18];let ed=y;if(K[19]!==U||K[20]!==ea||K[21]!==es){let e;K[23]!==ea||K[24]!==es?(e=(e,r)=>{let l=e[es],o=r[es],s="number"==typeof l&&"number"==typeof o?l-o:String(l).localeCompare(String(o));return"asc"===ea?s:-s},K[23]=ea,K[24]=es,K[25]=e):e=K[25],q=[...U].sort(e),K[19]=U,K[20]=ea,K[21]=es,K[22]=q}else q=K[22];let ec=q;K[26]===Symbol.for("react.memo_cache_sentinel")?(k=(0,r.jsx)("h2",{className:s.default.Title,children:"Server Browser"}),K[26]=k):k=K[26];let eu=1!==U.length?"s":"";if(K[27]!==U.length||K[28]!==eu?(B=(0,r.jsxs)("span",{className:s.default.ServerCount,children:[U.length," server",eu]}),K[27]=U.length,K[28]=eu,K[29]=B):B=K[29],K[30]!==V||K[31]!==Q?(w=(0,r.jsx)("button",{className:s.default.RefreshButton,onClick:V,disabled:Q,children:"Refresh"}),K[30]=V,K[31]=Q,K[32]=w):w=K[32],K[33]!==B||K[34]!==w?(C=(0,r.jsxs)("div",{className:s.default.Header,children:[k,B,w]}),K[33]=B,K[34]=w,K[35]=C):C=K[35],K[36]!==ed?(b=(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{onClick:()=>ed("name"),children:"Server Name"}),(0,r.jsx)("th",{onClick:()=>ed("playerCount"),children:"Players"}),(0,r.jsx)("th",{onClick:()=>ed("ping"),children:"Ping"}),(0,r.jsx)("th",{onClick:()=>ed("mapName"),children:"Map"}),(0,r.jsx)("th",{onClick:()=>ed("gameType"),children:"Type"}),(0,r.jsx)("th",{onClick:()=>ed("mod"),children:"Mod"})]})}),K[36]=ed,K[37]=b):b=K[37],K[38]!==z||K[39]!==eo||K[40]!==M||K[41]!==ee||K[42]!==ec){let e;K[44]!==z||K[45]!==eo||K[46]!==M||K[47]!==ee?(e=e=>(0,r.jsxs)("tr",{onClick:()=>{er(e.address),Array.from(document.forms.serverList.elements.serverAddress).find(r=>r.value===e.address).focus()},onDoubleClick:()=>{er(e.address),eo(e.address),M()},children:[(0,r.jsxs)("td",{children:[(0,r.jsx)("input",{type:"radio",className:s.default.HiddenRadio,name:"serverAddress",value:e.address,checked:ee===e.address,onChange:e=>{er(e.target.value)}}),e.passwordRequired&&(0,r.jsx)("span",{className:s.default.PasswordIcon,children:"🔒"}),e.name]}),(0,r.jsxs)("td",{className:0===e.playerCount?s.default.EmptyServer:void 0,children:[e.playerCount," / ",e.maxPlayers]}),(0,r.jsx)("td",{children:null!=z?(e.ping+z).toLocaleString():"—"}),(0,r.jsx)("td",{children:e.mapName}),(0,r.jsx)("td",{children:e.gameType}),(0,r.jsx)("td",{children:e.mod})]},e.address),K[44]=z,K[45]=eo,K[46]=M,K[47]=ee,K[48]=e):e=K[48],N=ec.map(e),K[38]=z,K[39]=eo,K[40]=M,K[41]=ee,K[42]=ec,K[43]=N}else N=K[43];K[49]!==Q||K[50]!==ec.length?(D=0===ec.length&&!Q&&(0,r.jsx)("tr",{className:s.default.Empty,children:(0,r.jsx)("td",{colSpan:6,children:"No servers found"})}),K[49]=Q,K[50]=ec.length,K[51]=D):D=K[51],K[52]!==Q||K[53]!==ec.length?(W=Q&&0===ec.length&&(0,r.jsx)("tr",{className:s.default.Empty,children:(0,r.jsx)("td",{colSpan:6,children:"Querying master server…"})}),K[52]=Q,K[53]=ec.length,K[54]=W):W=K[54],K[55]!==N||K[56]!==D||K[57]!==W?(T=(0,r.jsxs)("tbody",{children:[N,D,W]}),K[55]=N,K[56]=D,K[57]=W,K[58]=T):T=K[58],K[59]!==b||K[60]!==T?(L=(0,r.jsxs)("table",{className:s.default.Table,children:[b,T]}),K[59]=b,K[60]=T,K[61]=L):L=K[61],K[62]!==el||K[63]!==L?(E=(0,r.jsx)("div",{className:s.default.TableWrapper,children:(0,r.jsx)("form",{name:"serverList",onSubmit:el,children:L})}),K[62]=el,K[63]=L,K[64]=E):E=K[64],K[65]===Symbol.for("react.memo_cache_sentinel")?(P=(0,r.jsx)("label",{className:s.default.WarriorLabel,htmlFor:"warriorName",children:"Warrior"}),K[65]=P):P=K[65],K[66]!==$?(R=e=>$(e.target.value),K[66]=$,K[67]=R):R=K[67],K[68]!==R||K[69]!==Y?(A=(0,r.jsxs)("div",{className:s.default.WarriorField,children:[P,(0,r.jsx)("input",{id:"warriorName",className:s.default.WarriorInput,type:"text",value:Y,onChange:R,placeholder:"Name thyself…",maxLength:24})]}),K[68]=R,K[69]=Y,K[70]=A):A=K[70],K[71]===Symbol.for("react.memo_cache_sentinel")?(H=(0,r.jsx)("span",{className:s.default.Hint,children:"Double-click a server to join"}),K[71]=H):H=K[71],K[72]!==M?(O=(0,r.jsx)("button",{onClick:M,className:s.default.CloseButton,children:"Cancel"}),K[72]=M,K[73]=O):O=K[73];let em=!ee;return K[74]!==el||K[75]!==em?(F=(0,r.jsx)("button",{onClick:el,disabled:em,className:s.default.JoinButton,children:"Join"}),K[74]=el,K[75]=em,K[76]=F):F=K[76],K[77]!==O||K[78]!==F?(I=(0,r.jsxs)("div",{className:s.default.Actions,children:[O,F]}),K[77]=O,K[78]=F,K[79]=I):I=K[79],K[80]!==A||K[81]!==I?(G=(0,r.jsxs)("div",{className:s.default.Footer,children:[A,H,I]}),K[80]=A,K[81]=I,K[82]=G):G=K[82],K[83]!==C||K[84]!==E||K[85]!==G?(Z=(0,r.jsxs)("div",{className:s.default.Dialog,ref:ei,tabIndex:-1,onClick:i,children:[C,E,G]}),K[83]=C,K[84]=E,K[85]=G,K[86]=Z):Z=K[86],K[87]!==M||K[88]!==Z?(J=(0,r.jsx)("div",{className:s.default.Overlay,onClick:M,children:Z}),K[87]=M,K[88]=Z,K[89]=J):J=K[89],J}function i(e){return e.stopPropagation()}function d(e){return"asc"===e?"desc":"asc"}function c(e){return e.joinServer}function u(e){return e.listServers}function m(e){return e.browserToRelayPing}function _(e){return e.serversLoading}function h(e){return e.servers}e.s(["ServerBrowser",()=>n])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/0e2ec5f4026ef564.js b/docs/_next/static/chunks/0e2ec5f4026ef564.js deleted file mode 100644 index 45dc1ba6..00000000 --- a/docs/_next/static/chunks/0e2ec5f4026ef564.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(15080),o=e.i(71753),i=e.i(90072),u=e.i(25645),c=e.i(12979),a=e.i(51434),s=e.i(79123),l=e.i(89887),f=e.i(58647);let d=(0,u.createLogger)("AudioEmitter"),p=new Map,m=new Map;function h(e,t=1){m.set(e,t)}function y(e){m.delete(e)}let g=0;function D(){return g}function R(){for(let[e]of(g++,m)){try{e.stop()}catch{}try{e.disconnect()}catch{}}m.clear()}function v(e,t){let r=t(e),n=r?.filename;if(!n)return null;let o=n.endsWith(".wav")?n:`${n}.wav`,i=r.description,u=null!=i?t(i):void 0,c=u?.is3D??!0,a=u?.isLooping??!1,s=u?.referenceDistance??20;return{filename:o,is3D:c,isLooping:a,refDist:s,maxDist:u?.maxDistance??100,volume:u?.volume??1}}function M(e,t,r,n,o){let u;try{u=(0,c.audioToUrl)(e.filename)}catch{return}let a=f.engineStore.getState().playback.rate,s=g;T(u,r,r=>{if(s===g)try{if(e.is3D&&o){let u=new i.PositionalAudio(t);u.setBuffer(r),u.setDistanceModel("inverse"),u.setRefDistance(e.refDist),u.setMaxDistance(e.maxDist),u.setRolloffFactor(1),u.setVolume(e.volume),u.setPlaybackRate(a),n&&u.position.copy(n),o.add(u),m.set(u,1),u.play(),u.source.onended=()=>{m.delete(u);try{u.disconnect()}catch{}o.remove(u)}}else{let n=new i.Audio(t);n.setBuffer(r),n.setVolume(e.volume),n.setPlaybackRate(a),m.set(n,1),n.play(),n.source.onended=()=>{m.delete(n);try{n.disconnect()}catch{}}}}catch{}})}function T(e,t,r){p.has(e)?r(p.get(e)):t.load(e,t=>{p.set(e,t),r(t)},void 0,t=>{d.error("Audio load error %s: %o",e,t)})}f.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,r]of m)try{t.setPlaybackRate(r*e)}catch{}});let b=(0,r.memo)(function({entity:e}){let{debugMode:u}=(0,s.useDebug)(),f=e.audioFileName??"",d=e.audioVolume??1,p=e.audioMinDistance??1,m=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,y=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,D=e.audioIsLooping??!0,[R,v,M]=e.position??[0,0,0],b=(0,n.useThree)(e=>e.scene),x=(0,n.useThree)(e=>e.camera),{audioLoader:A,audioListener:S}=(0,a.useAudio)(),{audioEnabled:w}=(0,s.useSettings)(),P=(0,r.useRef)(null),k=(0,r.useRef)(null),B=(0,r.useRef)(null),L=(0,r.useRef)(!1),V=(0,r.useRef)(!1),j=(0,r.useRef)(new i.Vector3(R,v,M)),E=(0,r.useRef)(0),F=()=>{null!=k.current&&(clearTimeout(k.current),k.current=null),null!=B.current&&(clearTimeout(B.current),B.current=null)};(0,r.useEffect)(()=>{let e;if(A&&S){if(E.current++,g){let t=new i.PositionalAudio(S);t.position.copy(j.current),t.setDistanceModel("inverse"),t.setRefDistance(p),t.setMaxDistance(m),t.setRolloffFactor(1),t.setVolume(d),e=t,b.add(e)}else(e=new i.Audio(S)).setVolume(d);return P.current=e,()=>{F();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&b.remove(e),P.current=null,L.current=!1,V.current=!1}}},[A,S,g,p,m,d,b]);let C=(e,t)=>{if(D)if(h>0||y>0){let r=Math.max(0,h),n=Math.max(r,y),o=r===n?r:Math.random()*(n-r)+r;e.loop=!1;let i=()=>{t===E.current&&(!1===e.isPlaying?k.current=setTimeout(()=>{if(t===E.current)try{e.play(),C(e,t)}catch{}},o):B.current=setTimeout(i,100))};B.current=setTimeout(i,100)}else e.setLoop(!0)},G=e=>{if(!A)return;let t=E.current;if(L.current)try{e.isPlaying||(e.play(),C(e,t))}catch{}else{let r;try{r=(0,c.audioToUrl)(f)}catch{return}T(r,A,r=>{if(t===E.current&&!e.buffer){e.setBuffer(r),L.current=!0;try{e.play(),C(e,t)}catch{}}})}};return(0,r.useEffect)(()=>{let e=P.current;e&&!g&&w&&f&&G(e)},[w,g,f,A,S]),(0,o.useFrame)(()=>{let e=P.current;if(!e||!g||!w||!f)return;let t=x.position.distanceTo(j.current),r=V.current,n=t<=m;if(n&&!r)V.current=!0,G(e);else if(!n&&r){V.current=!1,F();try{e.stop()}catch{}}}),(0,r.useEffect)(()=>{let e=P.current;if(e&&!w){F();try{e.stop()}catch{}V.current=!1}},[w]),u?(0,t.jsxs)("mesh",{position:j.current,children:[(0,t.jsx)("sphereGeometry",{args:[p,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(l.FloatingLabel,{color:"#00ff00",position:[0,p+1,0],children:f})]}):null});e.s(["AudioEmitter",0,b,"audioBufferCache",0,p,"getCachedAudioBuffer",()=>T,"getSoundGeneration",()=>D,"playOneShotSound",()=>M,"resolveAudioProfile",()=>v,"stopAllTrackedSounds",()=>R,"trackSound",()=>h,"untrackSound",()=>y])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/790c269d8dfa8bf7.js b/docs/_next/static/chunks/1273ef014eba2bd5.js similarity index 75% rename from docs/_next/static/chunks/790c269d8dfa8bf7.js rename to docs/_next/static/chunks/1273ef014eba2bd5.js index d2e50b73..66cf2c28 100644 --- a/docs/_next/static/chunks/790c269d8dfa8bf7.js +++ b/docs/_next/static/chunks/1273ef014eba2bd5.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(2232);let r=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:n,modules:i}=function(){let e="info".trim();if(!e)return{globalLevel:"info",modules:new Map};let t=null,n=new Map;for(let i of e.split(",")){let e=i.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&n.set(t,r)}else r.has(e)&&(t=e)}return{globalLevel:t??=n.size>0?"silent":"info",modules:n}}(),s={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},l=(0,t.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=s[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function a(e){let t=i.get(e)??n;return l.child({module:e},{level:t})}e.s(["createLogger",()=>a])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".m4a")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(47167),r=e.i(2232);let n=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:i,modules:s}=function(){let e=t.default.env.NEXT_PUBLIC_LOG?.trim();if(!e)return{globalLevel:"info",modules:new Map};let r=null,i=new Map;for(let t of e.split(",")){let e=t.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&i.set(t,r)}else n.has(e)&&(r=e)}return{globalLevel:r??=i.size>0?"silent":"info",modules:i}}(),l={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},a=(0,r.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=l[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function o(e){let t=s.get(e)??i;return a.child({module:e},{level:t})}e.s(["createLogger",()=>o])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".m4a")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/ebf99400aa3d97c0.js b/docs/_next/static/chunks/2070573ac43e863c.js similarity index 51% rename from docs/_next/static/chunks/ebf99400aa3d97c0.js rename to docs/_next/static/chunks/2070573ac43e863c.js index e24869d4..f9eb0495 100644 --- a/docs/_next/static/chunks/ebf99400aa3d97c0.js +++ b/docs/_next/static/chunks/2070573ac43e863c.js @@ -1,4 +1,4 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42585,e=>{"use strict";var t=e.i(43476),a=e.i(932),o=e.i(71645),r=e.i(31067),i=e.i(90072);let n=o.forwardRef(({args:e,children:t,...a},i)=>{let n=o.useRef(null);return o.useImperativeHandle(i,()=>n.current),o.useLayoutEffect(()=>void 0),o.createElement("mesh",(0,r.default)({ref:n},a),o.createElement("boxGeometry",{attach:"geometry",args:e}),t)});var s=e.i(47071),l=e.i(71753),u=e.i(15080),c=e.i(12979);e.i(70847);var f=e.i(63318),v=e.i(75567),d=e.i(48066),m=e.i(47021);let p=` +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42585,e=>{"use strict";var t=e.i(43476),a=e.i(932),o=e.i(71645),r=e.i(31067),i=e.i(90072);let n=o.forwardRef(({args:e,children:t,...a},i)=>{let n=o.useRef(null);return o.useImperativeHandle(i,()=>n.current),o.useLayoutEffect(()=>void 0),o.createElement("mesh",(0,r.default)({ref:n},a),o.createElement("boxGeometry",{attach:"geometry",args:e}),t)});var s=e.i(47071),l=e.i(71753),u=e.i(15080),c=e.i(12979);e.i(70847);var f=e.i(63318),v=e.i(75567),d=e.i(56893),m=e.i(48066),p=e.i(47021);let g=` #include #ifdef USE_FOG @@ -50,7 +50,7 @@ vFogDepth = length(mvPosition.xyz); #endif } -`,g=` +`,h=` #include // Enable volumetric fog (must be defined before fog uniforms) @@ -161,6 +161,6 @@ gl_FragColor = vec4(finalColor, combinedAlpha); // Apply volumetric fog using shared Torque-style fog shader - ${m.fogFragmentShader} + ${p.fogFragmentShader} } -`;var h=e.i(79123);function x(e){let o,r,n=(0,a.c)(5),{surfaceTexture:l,attach:u}=e;n[0]!==l?(o=(0,c.textureToUrl)(l),n[0]=l,n[1]=o):o=n[1];let f=o,v=(0,s.useTexture)(f,T);return n[2]!==u||n[3]!==v?(r=(0,t.jsx)("meshStandardMaterial",{attach:u,map:v,transparent:!0,opacity:.8,side:i.DoubleSide}),n[2]=u,n[3]=v,n[4]=r):r=n[4],r}function T(e){return(0,v.setupTexture)(e)}let b=(0,o.memo)(function(e){let r,s,c,v,d,m,p,g,x,T,b,E,_,S,V,P,U,C,D,F=(0,a.c)(59),{entity:A}=e,O=A.waterData,{debugMode:W}=(0,h.useDebug)();F[0]!==O.transform?(r=(0,f.matrixFToQuaternion)(O.transform),F[0]=O.transform,F[1]=r):r=F[1];let I=r;F[2]!==O.transform.position?(s=(0,f.torqueToThree)(O.transform.position),F[2]=O.transform.position,F[3]=s):s=F[3];let R=s;F[4]!==O.scale?(c=(0,f.torqueScaleToThree)(O.scale),F[4]=O.scale,F[5]=c):c=F[5];let z=c,[B,j,G]=z,N=(0,u.useThree)(w),L=(C=(0,a.c)(1),D=(0,o.useRef)(null),C[0]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{if(!D.current)return D.current=e.clone(),!0;let t=D.current.x===e.x&&D.current.y===e.y&&D.current.z===e.z;return t||D.current.copy(e),t},C[0]=U):U=C[0],U),Q=O.waveMagnitude,[Y,X,q]=R,H=Y+1024,$=q+1024;F[6]!==H?(v=Math.round(H/8),F[6]=H,F[7]=v):v=F[7];let Z=v;F[8]!==$?(d=Math.round($/8),F[8]=$,F[9]=d):d=F[9];let k=d,J=8*(Z=Math.max(0,Math.min(2040,Z))),K=8*(k=Math.max(0,Math.min(2040,k)));F[10]!==J||F[11]!==K||F[12]!==X?(m=[J,X,K],F[10]=J,F[11]=K,F[12]=X,F[13]=m):m=F[13];let ee=m,et=M;F[14]!==N.position.x||F[15]!==N.position.z?(p=()=>et(N.position.x,N.position.z),F[14]=N.position.x,F[15]=N.position.z,F[16]=p):p=F[16];let[ea,eo]=(0,o.useState)(p);F[17]!==N.position||F[18]!==L?(g=()=>{if(!L(N.position))return;let e=et(N.position.x,N.position.z);eo(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)},F[17]=N.position,F[18]=L,F[19]=g):g=F[19],(0,l.useFrame)(g);let er=O.surfaceName||"liquidTiles/BlueWater",ei=O.envMapName||void 0,en=O.surfaceOpacity,es=O.envMapIntensity;if(F[20]!==B||F[21]!==j||F[22]!==G){let e,[t,a]=(e=B<=1024&&G<=1024?8:16,[Math.max(4,Math.ceil(B/e)),Math.max(4,Math.ceil(G/e))]);(x=new i.PlaneGeometry(B,G,t,a)).rotateX(-Math.PI/2),x.translate(B/2,j,G/2),F[20]=B,F[21]=j,F[22]=G,F[23]=x}else x=F[23];let el=x;if(F[24]!==el?(b=()=>()=>{el.dispose()},T=[el],F[24]=el,F[25]=T,F[26]=b):(T=F[25],b=F[26]),(0,o.useEffect)(b,T),F[27]!==W||F[28]!==R[0]||F[29]!==R[1]||F[30]!==R[2]||F[31]!==z||F[32]!==B||F[33]!==j||F[34]!==G?(E=W&&(0,t.jsx)(n,{args:z,position:[R[0]+B/2,R[1]+j/2,R[2]+G/2],children:(0,t.jsx)("meshBasicMaterial",{color:"#00fbff",wireframe:!0})}),F[27]=W,F[28]=R[0],F[29]=R[1],F[30]=R[2],F[31]=z,F[32]=B,F[33]=j,F[34]=G,F[35]=E):E=F[35],F[36]!==ee||F[37]!==ea||F[38]!==el){let e;F[40]!==ee||F[41]!==el?(e=e=>{let[a,o]=e,r=ee[0]+2048*a-1024,n=ee[2]+2048*o-1024;return(0,t.jsx)("mesh",{geometry:el,position:[r,ee[1],n],children:(0,t.jsx)("meshStandardMaterial",{color:"#00fbff",transparent:!0,opacity:.4,wireframe:!0,side:i.DoubleSide})},`${a},${o}`)},F[40]=ee,F[41]=el,F[42]=e):e=F[42],_=ea.map(e),F[36]=ee,F[37]=ea,F[38]=el,F[39]=_}else _=F[39];return F[43]!==ee||F[44]!==es||F[45]!==ei||F[46]!==en||F[47]!==ea||F[48]!==el||F[49]!==er||F[50]!==Q?(S=(0,t.jsx)(y,{reps:ea,basePosition:ee,surfaceGeometry:el,surfaceTexture:er,envMapTexture:ei,opacity:en,waveMagnitude:Q,envMapIntensity:es}),F[43]=ee,F[44]=es,F[45]=ei,F[46]=en,F[47]=ea,F[48]=el,F[49]=er,F[50]=Q,F[51]=S):S=F[51],F[52]!==_||F[53]!==S?(V=(0,t.jsx)(o.Suspense,{fallback:_,children:S}),F[52]=_,F[53]=S,F[54]=V):V=F[54],F[55]!==I||F[56]!==E||F[57]!==V?(P=(0,t.jsxs)("group",{quaternion:I,children:[E,V]}),F[55]=I,F[56]=E,F[57]=V,F[58]=P):P=F[58],P}),y=(0,o.memo)(function({reps:e,basePosition:a,surfaceGeometry:r,surfaceTexture:n,envMapTexture:u,opacity:f,waveMagnitude:m,envMapIntensity:x}){let T=(0,c.textureToUrl)(n),b=(0,c.textureToUrl)(u??"special/lush_env"),[y,w]=(0,s.useTexture)([T,b],e=>{(Array.isArray(e)?e:[e]).forEach(e=>{(0,v.setupTexture)(e),e.colorSpace=i.NoColorSpace,e.wrapS=i.RepeatWrapping,e.wrapT=i.RepeatWrapping})}),{animationEnabled:M}=(0,h.useSettings)(),E=(0,o.useMemo)(()=>{var e;return e={opacity:f,waveMagnitude:m,envMapIntensity:x,baseTexture:y,envMapTexture:w},new i.ShaderMaterial({uniforms:{uTime:{value:0},uOpacity:{value:e?.opacity??.75},uWaveMagnitude:{value:e?.waveMagnitude??1},uEnvMapIntensity:{value:e?.envMapIntensity??1},uBaseTexture:{value:e?.baseTexture??null},uEnvMapTexture:{value:e?.envMapTexture??null},fogColor:{value:new i.Color},fogNear:{value:1},fogFar:{value:2e3},fogVolumeData:d.globalFogUniforms.fogVolumeData,cameraHeight:d.globalFogUniforms.cameraHeight,fogEnabled:d.globalFogUniforms.fogEnabled},vertexShader:p,fragmentShader:g,transparent:!0,side:i.DoubleSide,depthWrite:!0,fog:!0})},[f,m,x,y,w]),_=(0,o.useRef)(0);return(0,l.useFrame)((e,t)=>{M?(_.current+=t,E.uniforms.uTime.value=_.current):(_.current=0,E.uniforms.uTime.value=0)}),(0,o.useEffect)(()=>()=>{E.dispose()},[E]),(0,t.jsx)(t.Fragment,{children:e.map(([e,o])=>{let i=a[0]+2048*e-1024,n=a[2]+2048*o-1024;return(0,t.jsx)("mesh",{geometry:r,material:E,position:[i,a[1],n]},`${e},${o}`)})})});function w(e){return e.camera}function M(e,t){let a=e+1024,o=t+1024,r=Math.trunc(a/2048),i=Math.trunc(o/2048);a<0&&r--,o<0&&i--;let n=[];for(let e=i-1;e<=i+1;e++)for(let t=r-1;t<=r+1;t++)n.push([t,e]);return n}e.s(["WaterBlock",0,b,"WaterMaterial",()=>x],42585)}]); \ No newline at end of file +`;var x=e.i(79123);function T(e){let o,r,n,l=(0,a.c)(7),{surfaceTexture:u,attach:f}=e;l[0]!==u?(o=(0,c.textureToUrl)(u),l[0]=u,l[1]=o):o=l[1];let m=o,p=(0,d.useAnisotropy)();l[2]!==p?(r=e=>(0,v.setupTexture)(e,{anisotropy:p}),l[2]=p,l[3]=r):r=l[3];let g=(0,s.useTexture)(m,r);return l[4]!==f||l[5]!==g?(n=(0,t.jsx)("meshStandardMaterial",{attach:f,map:g,transparent:!0,opacity:.8,side:i.DoubleSide}),l[4]=f,l[5]=g,l[6]=n):n=l[6],n}let b=(0,o.memo)(function(e){let r,s,c,v,d,m,p,g,h,T,b,E,_,S,V,P,U,C,D,F=(0,a.c)(59),{entity:A}=e,O=A.waterData,{debugMode:W}=(0,x.useDebug)();F[0]!==O.transform?(r=(0,f.matrixFToQuaternion)(O.transform),F[0]=O.transform,F[1]=r):r=F[1];let I=r;F[2]!==O.transform.position?(s=(0,f.torqueToThree)(O.transform.position),F[2]=O.transform.position,F[3]=s):s=F[3];let R=s;F[4]!==O.scale?(c=(0,f.torqueScaleToThree)(O.scale),F[4]=O.scale,F[5]=c):c=F[5];let z=c,[B,j,G]=z,N=(0,u.useThree)(w),L=(C=(0,a.c)(1),D=(0,o.useRef)(null),C[0]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{if(!D.current)return D.current=e.clone(),!0;let t=D.current.x===e.x&&D.current.y===e.y&&D.current.z===e.z;return t||D.current.copy(e),t},C[0]=U):U=C[0],U),Q=O.waveMagnitude,[Y,X,q]=R,H=Y+1024,$=q+1024;F[6]!==H?(v=Math.round(H/8),F[6]=H,F[7]=v):v=F[7];let Z=v;F[8]!==$?(d=Math.round($/8),F[8]=$,F[9]=d):d=F[9];let k=d,J=8*(Z=Math.max(0,Math.min(2040,Z))),K=8*(k=Math.max(0,Math.min(2040,k)));F[10]!==J||F[11]!==K||F[12]!==X?(m=[J,X,K],F[10]=J,F[11]=K,F[12]=X,F[13]=m):m=F[13];let ee=m,et=M;F[14]!==N.position.x||F[15]!==N.position.z?(p=()=>et(N.position.x,N.position.z),F[14]=N.position.x,F[15]=N.position.z,F[16]=p):p=F[16];let[ea,eo]=(0,o.useState)(p);F[17]!==N.position||F[18]!==L?(g=()=>{if(!L(N.position))return;let e=et(N.position.x,N.position.z);eo(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)},F[17]=N.position,F[18]=L,F[19]=g):g=F[19],(0,l.useFrame)(g);let er=O.surfaceName||"liquidTiles/BlueWater",ei=O.envMapName||void 0,en=O.surfaceOpacity,es=O.envMapIntensity;if(F[20]!==B||F[21]!==j||F[22]!==G){let e,[t,a]=(e=B<=1024&&G<=1024?8:16,[Math.max(4,Math.ceil(B/e)),Math.max(4,Math.ceil(G/e))]);(h=new i.PlaneGeometry(B,G,t,a)).rotateX(-Math.PI/2),h.translate(B/2,j,G/2),F[20]=B,F[21]=j,F[22]=G,F[23]=h}else h=F[23];let el=h;if(F[24]!==el?(b=()=>()=>{el.dispose()},T=[el],F[24]=el,F[25]=T,F[26]=b):(T=F[25],b=F[26]),(0,o.useEffect)(b,T),F[27]!==W||F[28]!==R[0]||F[29]!==R[1]||F[30]!==R[2]||F[31]!==z||F[32]!==B||F[33]!==j||F[34]!==G?(E=W&&(0,t.jsx)(n,{args:z,position:[R[0]+B/2,R[1]+j/2,R[2]+G/2],children:(0,t.jsx)("meshBasicMaterial",{color:"#00fbff",wireframe:!0})}),F[27]=W,F[28]=R[0],F[29]=R[1],F[30]=R[2],F[31]=z,F[32]=B,F[33]=j,F[34]=G,F[35]=E):E=F[35],F[36]!==ee||F[37]!==ea||F[38]!==el){let e;F[40]!==ee||F[41]!==el?(e=e=>{let[a,o]=e,r=ee[0]+2048*a-1024,n=ee[2]+2048*o-1024;return(0,t.jsx)("mesh",{geometry:el,position:[r,ee[1],n],children:(0,t.jsx)("meshStandardMaterial",{color:"#00fbff",transparent:!0,opacity:.4,wireframe:!0,side:i.DoubleSide})},`${a},${o}`)},F[40]=ee,F[41]=el,F[42]=e):e=F[42],_=ea.map(e),F[36]=ee,F[37]=ea,F[38]=el,F[39]=_}else _=F[39];return F[43]!==ee||F[44]!==es||F[45]!==ei||F[46]!==en||F[47]!==ea||F[48]!==el||F[49]!==er||F[50]!==Q?(S=(0,t.jsx)(y,{reps:ea,basePosition:ee,surfaceGeometry:el,surfaceTexture:er,envMapTexture:ei,opacity:en,waveMagnitude:Q,envMapIntensity:es}),F[43]=ee,F[44]=es,F[45]=ei,F[46]=en,F[47]=ea,F[48]=el,F[49]=er,F[50]=Q,F[51]=S):S=F[51],F[52]!==_||F[53]!==S?(V=(0,t.jsx)(o.Suspense,{fallback:_,children:S}),F[52]=_,F[53]=S,F[54]=V):V=F[54],F[55]!==I||F[56]!==E||F[57]!==V?(P=(0,t.jsxs)("group",{quaternion:I,children:[E,V]}),F[55]=I,F[56]=E,F[57]=V,F[58]=P):P=F[58],P}),y=(0,o.memo)(function({reps:e,basePosition:a,surfaceGeometry:r,surfaceTexture:n,envMapTexture:u,opacity:f,waveMagnitude:p,envMapIntensity:T}){let b=(0,c.textureToUrl)(n),y=(0,c.textureToUrl)(u??"special/lush_env"),w=(0,d.useAnisotropy)(),[M,E]=(0,s.useTexture)([b,y],e=>{(Array.isArray(e)?e:[e]).forEach(e=>{(0,v.setupTexture)(e,{anisotropy:w}),e.colorSpace=i.NoColorSpace,e.wrapS=i.RepeatWrapping,e.wrapT=i.RepeatWrapping})}),{animationEnabled:_}=(0,x.useSettings)(),S=(0,o.useMemo)(()=>{var e;return e={opacity:f,waveMagnitude:p,envMapIntensity:T,baseTexture:M,envMapTexture:E},new i.ShaderMaterial({uniforms:{uTime:{value:0},uOpacity:{value:e?.opacity??.75},uWaveMagnitude:{value:e?.waveMagnitude??1},uEnvMapIntensity:{value:e?.envMapIntensity??1},uBaseTexture:{value:e?.baseTexture??null},uEnvMapTexture:{value:e?.envMapTexture??null},fogColor:{value:new i.Color},fogNear:{value:1},fogFar:{value:2e3},fogVolumeData:m.globalFogUniforms.fogVolumeData,cameraHeight:m.globalFogUniforms.cameraHeight,fogEnabled:m.globalFogUniforms.fogEnabled},vertexShader:g,fragmentShader:h,transparent:!0,side:i.DoubleSide,depthWrite:!0,fog:!0})},[f,p,T,M,E]),V=(0,o.useRef)(0);return(0,l.useFrame)((e,t)=>{_?(V.current+=t,S.uniforms.uTime.value=V.current):(V.current=0,S.uniforms.uTime.value=0)}),(0,o.useEffect)(()=>()=>{S.dispose()},[S]),(0,t.jsx)(t.Fragment,{children:e.map(([e,o])=>{let i=a[0]+2048*e-1024,n=a[2]+2048*o-1024;return(0,t.jsx)("mesh",{geometry:r,material:S,position:[i,a[1],n]},`${e},${o}`)})})});function w(e){return e.camera}function M(e,t){let a=e+1024,o=t+1024,r=Math.trunc(a/2048),i=Math.trunc(o/2048);a<0&&r--,o<0&&i--;let n=[];for(let e=i-1;e<=i+1;e++)for(let t=r-1;t<=r+1;t++)n.push([t,e]);return n}e.s(["WaterBlock",0,b,"WaterMaterial",()=>T],42585)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/273b16b21a9dcb92.js b/docs/_next/static/chunks/273b16b21a9dcb92.js deleted file mode 100644 index 1d55c706..00000000 --- a/docs/_next/static/chunks/273b16b21a9dcb92.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},66438,e=>{e.v({Bullet:"GuiMarkup-module__CLgNnq__Bullet",GuiMarkup:"GuiMarkup-module__CLgNnq__GuiMarkup"})},41973,e=>{e.v({Body:"MapInfoDialog-module__m0lXla__Body",CloseButton:"MapInfoDialog-module__m0lXla__CloseButton "+e.i(81847).DialogButton,Dialog:"MapInfoDialog-module__m0lXla__Dialog "+e.i(81847).Dialog,Footer:"MapInfoDialog-module__m0lXla__Footer",Hint:"MapInfoDialog-module__m0lXla__Hint",Left:"MapInfoDialog-module__m0lXla__Left",MapBlurb:"MapInfoDialog-module__m0lXla__MapBlurb",MapMeta:"MapInfoDialog-module__m0lXla__MapMeta",MapPlanet:"MapInfoDialog-module__m0lXla__MapPlanet",MapQuote:"MapInfoDialog-module__m0lXla__MapQuote",MusicButton:"MapInfoDialog-module__m0lXla__MusicButton",MusicTrack:"MapInfoDialog-module__m0lXla__MusicTrack",MusicTrackName:"MapInfoDialog-module__m0lXla__MusicTrackName",Overlay:"MapInfoDialog-module__m0lXla__Overlay "+e.i(81847).Overlay,PreviewImage:"MapInfoDialog-module__m0lXla__PreviewImage",PreviewImageFloating:"MapInfoDialog-module__m0lXla__PreviewImageFloating",Section:"MapInfoDialog-module__m0lXla__Section",SectionTitle:"MapInfoDialog-module__m0lXla__SectionTitle",Title:"MapInfoDialog-module__m0lXla__Title"})},94247,e=>{"use strict";var t=e.i(43476),a=e.i(932),l=e.i(71645),o=e.i(11152),i=e.i(66027),n=e.i(12979),r=e.i(91996),s=e.i(66438);let u=new Set(["spop","spush","lmargin","font","color","bitmap","a","/a"]),c=new Map;function m(e){let l,o=(0,a.c)(5),{name:i}=e;o[0]!==i?(l=function(e){let t;if(c.has(e))return c.get(e);try{t=(0,n.getUrlForPath)((0,r.getStandardTextureResourceKey)(`textures/gui/${e}`))}catch{t=null}return c.set(e,t),t}(i),o[0]=i,o[1]=l):l=o[1];let u=l;if(u){let e;return o[2]!==u?(e=(0,t.jsx)("img",{src:u,alt:"",className:s.default.Bitmap}),o[2]=u,o[3]=e):e=o[3],e}if(/bullet/i.test(i)){let e;return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:s.default.Bullet,children:"•"}),o[4]=e):e=o[4],e}return null}let p=/<(?:font|color|bitmap|just|lmargin|a):/i;function d(e){let o,i,n=(0,a.c)(4),{markup:r}=e;n[0]!==r?(o=function(e){let a=e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:"text",value:e}:null;{let[t,...a]=e.split(":");return u.has(t.toLowerCase())?{type:"tag",name:t,args:a}:{type:"text",value:`<${e}>`}}}).filter(e=>null!=e),o={type:"span",source:"root",style:{},children:[]},i=o,n=[i],r=e=>null!=e.children&&e.children.some(e=>"string"==typeof e||r(e));for(let e of a)switch(e.type){case"text":i.children.push(e.value);break;case"tag":switch(e.name){case"spush":{let e={type:"span",source:"spush",style:{},children:[]};i.children.push(e),i=e,n.push(i);break}case"spop":if("root"!==i.source){let e=n.pop();for(;"spush"!==e.source;)e=n.pop();i=n[n.length-1]}break;case"lmargin":break;case"font":{let t=function(e){let[t,a]=e;return{fontDescription:t,fontSize:a?Math.max(11,Math.min(parseInt(a.trim(),10),16)):void 0}}(e.args).fontSize;if(r(i)){let e={type:"span",source:"spush",style:{fontSize:t},children:[]};i.children.push(e),i=e,n.push(i)}else i.style.fontSize=t;break}case"color":if(r(i)){let t={type:"span",source:"spush",style:{color:`#${e.args[0].trim()}`},children:[]};i.children.push(t),i=t,n.push(i)}else i.style.color=`#${e.args[0].trim()}`;break;case"bitmap":{let t={type:"bitmap",value:e.args[0]};i.children.push(t);break}case"a":{let t=e.args[0].trim().split(" "),a=2===t.length&&"wwwlink"===t[0]?t[1]:t[0],l={type:"a",source:"a",value:`http://${a}`,style:{},children:[]};i.children.push(l),i=l,n.push(i);break}case"/a":{let e=n.pop();for(;"a"!==e.source;)e=n.pop();i=n[n.length-1]}}}return function e(a){switch(a.type){case"span":return l.default.createElement("span",{style:0===Object.keys(a.style).length?void 0:a.style},...a.children.map(t=>"string"==typeof t?t:e(t)));case"a":return l.default.createElement("a",{href:a.value,style:0===Object.keys(a.style).length?void 0:a.style,rel:"noopener noreferrer",target:"_blank"},...a.children.map(t=>"string"==typeof t?t:e(t)));case"bitmap":return(0,t.jsx)(m,{name:a.value})}}(o)}(r),n[0]=r,n[1]=o):o=n[1];let c=o;return n[2]!==c?(i=(0,t.jsx)("div",{className:s.default.GuiMarkup,children:c}),n[2]=c,n[3]=i):i=n[3],i}var f=e.i(41973);function _(e){let o,i,n,r=(0,a.c)(7),{src:s,alt:u,className:c}=e,m=void 0===c?f.default.PreviewImage:c,[p,d]=(0,l.useState)(null);return(r[0]!==s?(o=()=>{let e,t=!1;return fetch(s).then(M).then(y).then(g).then(a=>{!t&&a&&d(e=URL.createObjectURL(a))}).catch(h),()=>{t=!0,e&&URL.revokeObjectURL(e)}},i=[s],r[0]=s,r[1]=o,r[2]=i):(o=r[1],i=r[2]),(0,l.useEffect)(o,i),p)?(r[3]!==u||r[4]!==m||r[5]!==p?(n=(0,t.jsx)("img",{src:p,alt:u,className:m}),r[3]=u,r[4]=m,r[5]=p,r[6]=n):n=r[6],n):null}function h(){}function g(e){return new Promise(t=>{let a=document.createElement("canvas");a.width=e.width,a.height=e.height,a.getContext("2d")?.drawImage(e,0,0),e.close(),a.toBlob(t)})}function y(e){return createImageBitmap(e,{colorSpaceConversion:"none"})}function M(e){return e.blob()}function v(e){let i,r,s,u,c,m,p,d,_,h,g,y=(0,a.c)(22),{track:M}=e,[v,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!0),k=(0,l.useRef)(null);y[0]!==M?(i=M.toLowerCase(),y[0]=M,y[1]=i):i=y[1];let D=`${n.RESOURCE_ROOT_URL}music/${i}.mp3`;y[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>()=>{k.current?.pause()},s=[],y[2]=r,y[3]=s):(r=y[2],s=y[3]),(0,l.useEffect)(r,s),y[4]!==v?(u=()=>{let e=k.current;e&&(v?e.pause():e.play().catch(()=>j(!1)))},y[4]=v,y[5]=u):u=y[5];let w=u;return y[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>x(!0),m=()=>x(!1),p=()=>j(!1),y[6]=c,y[7]=m,y[8]=p):(c=y[6],m=y[7],p=y[8]),y[9]!==D?(d=(0,t.jsx)("audio",{ref:k,src:D,loop:!0,onPlay:c,onPause:m,onError:p}),y[9]=D,y[10]=d):d=y[10],y[11]!==M?(_=(0,t.jsx)("span",{className:f.default.MusicTrackName,children:M}),y[11]=M,y[12]=_):_=y[12],y[13]!==b||y[14]!==v||y[15]!==w?(h=b&&(0,t.jsx)("button",{className:f.default.MusicButton,onClick:w,"aria-label":v?"Pause music":"Play music",children:v?(0,t.jsx)(o.FaVolumeUp,{}):(0,t.jsx)(o.FaVolumeMute,{})}),y[13]=b,y[14]=v,y[15]=w,y[16]=h):h=y[16],y[17]!==v||y[18]!==h||y[19]!==d||y[20]!==_?(g=(0,t.jsxs)("div",{className:f.default.MusicTrack,"data-playing":v,children:[d,_,h]}),y[17]=v,y[18]=h,y[19]=d,y[20]=_,y[21]=g):g=y[21],g}function x(e){var o,s,u;let c,m,h,g,y,M,x,D,w,I,N,B,S,C,P,L,T,X,E,O,R,U,F,$,G,K,Q,q,W,Z,z,A,H,V,J,Y,ee,et=(0,a.c)(100),{onClose:ea,missionName:el,missionType:eo}=e,{data:ei}=((ee=(0,a.c)(2))[0]!==el?(Y={queryKey:["parsedMission",el],queryFn:()=>(0,n.loadMission)(el)},ee[0]=el,ee[1]=Y):Y=ee[1],(0,i.useQuery)(Y)),en=(0,l.useRef)(null);et[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{en.current?.focus();try{document.exitPointerLock()}catch{}},m=[],et[0]=c,et[1]=m):(c=et[0],m=et[1]),(0,l.useEffect)(c,m),et[2]!==ea?(h=()=>{let e=e=>{if("Escape"===e.key)ea();else if("k"===e.key&&(e.metaKey||e.ctrlKey))return void ea();e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",k,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",k,{capture:!0})}},g=[ea],et[2]=ea,et[3]=h,et[4]=g):(h=et[3],g=et[4]),(0,l.useEffect)(h,g),et[5]!==ei?(y=ei?function(e){for(let t of e.body){if("ObjectDeclaration"!==t.type)continue;let{instanceName:e,body:a}=t;if(e&&"Identifier"===e.type&&"missiongroup"===e.name.toLowerCase()){let e={};for(let t of a){if("Assignment"!==t.type)continue;let{target:a,value:l}=t;"Identifier"===a.type&&"StringLiteral"===l.type&&(e[a.name.toLowerCase()]=l.value)}return e}}return{}}(ei.ast):{},et[5]=ei,et[6]=y):y=et[6];let er=y;et[7]!==el||et[8]!==ei?(M=ei?function(e,t){if(e)try{let t=(0,r.getStandardTextureResourceKey)(`textures/gui/${e}`);return(0,n.getUrlForPath)(t)}catch{}try{let e=(0,r.getStandardTextureResourceKey)(`textures/gui/Load_${t}`);return(0,n.getUrlForPath)(e)}catch{}return null}(ei.bitmap,el):null,et[7]=el,et[8]=ei,et[9]=M):M=et[9];let es=M,eu=ei?.displayName??el;et[10]!==eo?(x=eo.toLowerCase(),et[10]=eo,et[11]=x):x=et[11];let ec="singleplayer"===x,em=er.musictrack;if(et[12]!==es||et[13]!==eu||et[14]!==ec||et[15]!==eo||et[16]!==ea||et[17]!==ei){let e,a,l,i,n,r,c=ei?.missionString?(o=ei.missionString,r=eo.toUpperCase(),o.split("\n").flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(r)?[]:[e.replace(/^\[[^\]]+\]/,"")]}).join("\n")):null;if(et[36]!==ei?.missionQuote){if(s=i=ei?.missionQuote?.trim()??"",l="",e="",!(a=p.test(s)))for(let t of i.split("\n")){let a=t.trim();a.match(/^--[^-]/)?e=a.replace(/^-+\s*/,"").trim():a&&(l+=(l?"\n":"")+a)}et[36]=ei?.missionQuote,et[37]=e,et[38]=a,et[39]=l,et[40]=i}else e=et[37],a=et[38],l=et[39],i=et[40];(U=f.default.Overlay,F=ea,C=en,P=f.default.Dialog,L=j,T=b,X="dialog",E="true",O="Map Information",R=-1,S=f.default.Body,$=f.default.Left,et[41]!==es||et[42]!==eu||et[43]!==ec?(G=es&&ec&&(0,t.jsx)(_,{className:f.default.PreviewImageFloating,src:es,alt:`${eu} preview`},es),et[41]=es,et[42]=eu,et[43]=ec,et[44]=G):G=et[44],et[45]!==eu?(D=(0,t.jsx)("h1",{className:f.default.Title,children:eu}),et[45]=eu,et[46]=D):D=et[46],et[47]!==ei?(n=ei?.planetName&&(0,t.jsx)("span",{className:f.default.MapPlanet,children:ei.planetName}),et[47]=ei,et[48]=n):n=et[48],et[49]!==n?(w=(0,t.jsx)("div",{className:f.default.MapMeta,children:n}),et[49]=n,et[50]=w):w=et[50],et[51]!==e||et[52]!==a||et[53]!==l||et[54]!==i?(I=a?(0,t.jsx)("blockquote",{className:f.default.MapQuote,children:(0,t.jsx)(d,{markup:i})}):l?(0,t.jsxs)("blockquote",{className:f.default.MapQuote,children:[(0,t.jsx)("p",{children:l}),e&&(0,t.jsxs)("cite",{children:["— ",e]})]}):null,et[51]=e,et[52]=a,et[53]=l,et[54]=i,et[55]=I):I=et[55],et[56]!==ei)?(N=ei?.missionBlurb&&(0,t.jsx)("div",{className:f.default.MapBlurb,children:(u=ei.missionBlurb,p.test(u))?(0,t.jsx)(d,{markup:ei.missionBlurb.trim()}):ei.missionBlurb.trim()}),et[56]=ei,et[57]=N):N=et[57],B=c&&c.trim()&&(0,t.jsx)("div",{className:f.default.Section,children:(0,t.jsx)(d,{markup:c})}),et[12]=es,et[13]=eu,et[14]=ec,et[15]=eo,et[16]=ea,et[17]=ei,et[18]=D,et[19]=w,et[20]=I,et[21]=N,et[22]=B,et[23]=S,et[24]=C,et[25]=P,et[26]=L,et[27]=T,et[28]=X,et[29]=E,et[30]=O,et[31]=R,et[32]=U,et[33]=F,et[34]=$,et[35]=G}else D=et[18],w=et[19],I=et[20],N=et[21],B=et[22],S=et[23],C=et[24],P=et[25],L=et[26],T=et[27],X=et[28],E=et[29],O=et[30],R=et[31],U=et[32],F=et[33],$=et[34],G=et[35];return et[58]!==ei?(K=ei?.missionBriefing&&(0,t.jsxs)("div",{className:f.default.Section,children:[(0,t.jsx)("h2",{className:f.default.SectionTitle,children:"Mission Briefing"}),(0,t.jsx)(d,{markup:ei.missionBriefing})]}),et[58]=ei,et[59]=K):K=et[59],et[60]!==em?(Q=em&&(0,t.jsx)(v,{track:em}),et[60]=em,et[61]=Q):Q=et[61],et[62]!==D||et[63]!==w||et[64]!==I||et[65]!==N||et[66]!==B||et[67]!==K||et[68]!==Q||et[69]!==$||et[70]!==G?(q=(0,t.jsxs)("div",{className:$,children:[G,D,w,I,N,B,K,Q]}),et[62]=D,et[63]=w,et[64]=I,et[65]=N,et[66]=B,et[67]=K,et[68]=Q,et[69]=$,et[70]=G,et[71]=q):q=et[71],et[72]!==es||et[73]!==eu||et[74]!==ec?(W=es&&!ec&&(0,t.jsx)(_,{src:es,alt:`${eu} preview`},es),et[72]=es,et[73]=eu,et[74]=ec,et[75]=W):W=et[75],et[76]!==S||et[77]!==q||et[78]!==W?(Z=(0,t.jsxs)("div",{className:S,children:[q,W]}),et[76]=S,et[77]=q,et[78]=W,et[79]=Z):Z=et[79],et[80]!==ea?(z=(0,t.jsx)("button",{className:f.default.CloseButton,onClick:ea,children:"Close"}),et[80]=ea,et[81]=z):z=et[81],et[82]===Symbol.for("react.memo_cache_sentinel")?(A=(0,t.jsx)("span",{className:f.default.Hint,children:"Esc to close"}),et[82]=A):A=et[82],et[83]!==z?(H=(0,t.jsxs)("div",{className:f.default.Footer,children:[z,A]}),et[83]=z,et[84]=H):H=et[84],et[85]!==C||et[86]!==P||et[87]!==L||et[88]!==T||et[89]!==X||et[90]!==E||et[91]!==O||et[92]!==R||et[93]!==Z||et[94]!==H?(V=(0,t.jsxs)("div",{ref:C,className:P,onClick:L,onKeyDown:T,role:X,"aria-modal":E,"aria-label":O,tabIndex:R,children:[Z,H]}),et[85]=C,et[86]=P,et[87]=L,et[88]=T,et[89]=X,et[90]=E,et[91]=O,et[92]=R,et[93]=Z,et[94]=H,et[95]=V):V=et[95],et[96]!==U||et[97]!==F||et[98]!==V?(J=(0,t.jsx)("div",{className:U,onClick:F,children:V}),et[96]=U,et[97]=F,et[98]=V,et[99]=J):J=et[99],J}function b(e){return e.stopPropagation()}function j(e){return e.stopPropagation()}function k(e){e.stopImmediatePropagation()}e.s(["MapInfoDialog",()=>x],94247)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/3b423df62fc674df.js b/docs/_next/static/chunks/3b423df62fc674df.js deleted file mode 100644 index a7d8caf6..00000000 --- a/docs/_next/static/chunks/3b423df62fc674df.js +++ /dev/null @@ -1,8 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8597,e=>{"use strict";var t=e.i(71645);let r=(0,t.createContext)(null),s={didCatch:!1,error:null};class n extends t.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=s}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;null!==t&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(s))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:n}=this.props;r&&null!==t.error&&function(e=[],t=[]){return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,n)&&(this.props.onReset?.({next:n,prev:e.resetKeys,reason:"keys"}),this.setState(s))}render(){let{children:e,fallbackRender:s,FallbackComponent:n,fallback:i}=this.props,{didCatch:a,error:o}=this.state,A=e;if(a){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof s)A=s(e);else if(n)A=(0,t.createElement)(n,e);else if(void 0!==i)A=i;else throw o}return(0,t.createElement)(r.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},A)}}e.s(["ErrorBoundary",()=>n])},78140,e=>{"use strict";let t;var r=e.i(31067),s=e.i(71645),n=e.i(90072);function i(e,t){if(t===n.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==n.TriangleFanDrawMode&&t!==n.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;etypeof TextDecoder)return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r=2.0 are supported."));return}let A=new z(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});A.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}A.setExtensions(i),A.setPlugins(a),A.parse(r,s)}parseAsync(e,t){let r=this;return new Promise(function(s,n){r.parse(e,t,s,n)})}}function c(){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 u={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 C{constructor(e){this.parser=e,this.name=u.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,i)}}class T{constructor(e){this.parser=e,this.name=u.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.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 H{constructor(e){this.parser=e,this.name=u.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.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 J{constructor(e){this.name=u.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],s=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.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 s.then(function(t){let r=e.byteOffset||0,s=e.byteLength||0,i=e.count,a=e.byteStride,o=new Uint8Array(t,r,s);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,a,o,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*a);return n.decodeGltfBuffer(new Uint8Array(t),i,a,o,e.mode,e.filter),t})})}}}class b{constructor(e){this.name=u.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!==v.TRIANGLES&&e.mode!==v.TRIANGLE_STRIP&&e.mode!==v.TRIANGLE_FAN&&void 0!==e.mode)return null;let s=r.extensions[this.name].attributes,i=[],a={};for(let e in s)i.push(this.parser.getDependency("accessor",s[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],s=e[0].count,i=[];for(let e of r){let t=new n.Matrix4,r=new n.Vector3,o=new n.Quaternion,A=new n.Vector3(1,1,1),l=new n.InstancedMesh(e.geometry,e.material,s);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"},X={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},j={CUBICSPLINE:void 0,LINEAR:n.InterpolateLinear,STEP:n.InterpolateDiscrete};function Y(e,t,r){for(let s in r.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=r.extensions[s])}function Z(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 W(e){let t="",r=Object.keys(e).sort();for(let s=0,n=r.length;stypeof navigator&&void 0!==navigator.userAgent&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=(s=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"u"{let r=this.associations.get(e);for(let[s,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(i,t.children[s])};return n(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&a.setY(t,u[e*A+1]),A>=3&&a.setZ(t,u[e*A+2]),A>=4&&a.setW(t,u[e*A+3]),A>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,r=this.options,s=t.textures[e].source,n=t.images[s],i=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,s,i)}loadTextureImage(e,t,r){let s=this,i=this.json,a=i.textures[e],o=i.images[t],A=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[A])return this.textureCache[A];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=N[r.magFilter]||n.LinearFilter,t.minFilter=N[r.minFilter]||n.LinearMipmapLinearFilter,t.wrapS=_[r.wrapS]||n.RepeatWrapping,t.wrapT=_[r.wrapT]||n.RepeatWrapping,s.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){let r=this.json,s=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||"",A=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then(function(e){A=!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 n.Texture(e);t.needsUpdate=!0,r(t)}),t.load(n.LoaderUtils.resolveURL(e,s.path),a,void 0,i)})}).then(function(e){var t;return!0===A&&a.revokeObjectURL(o),Z(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,s){let n=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),n.extensions[u.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[u.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[u.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}return void 0!==s&&("number"==typeof s&&(s=3001===s?A:l),"colorSpace"in i?i.colorSpace=s:i.encoding=s===A?3001:3e3),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,s=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 n.PointsMaterial,n.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 n.LineBasicMaterial,n.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(s||i||a){let e="ClonedMaterial:"+r.uuid+":";s&&(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),s&&(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 n.MeshStandardMaterial}loadMaterial(e){let t,r=this,s=this.json,i=this.extensions,a=s.materials[e],o={},B=a.extensions||{},c=[];if(B[u.KHR_MATERIALS_UNLIT]){let e=i[u.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),c.push(e.extendParams(o,a,r))}else{let s=a.pbrMetallicRoughness||{};if(o.color=new n.Color(1,1,1),o.opacity=1,Array.isArray(s.baseColorFactor)){let e=s.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],l),o.opacity=e[3]}void 0!==s.baseColorTexture&&c.push(r.assignTexture(o,"map",s.baseColorTexture,A)),o.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,o.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(c.push(r.assignTexture(o,"metalnessMap",s.metallicRoughnessTexture)),c.push(r.assignTexture(o,"roughnessMap",s.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===a.doubleSided&&(o.side=n.DoubleSide);let C=a.alphaMode||"OPAQUE";if("BLEND"===C?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,"MASK"===C&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==n.MeshBasicMaterial&&(c.push(r.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new n.Vector2(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==n.MeshBasicMaterial&&(c.push(r.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==n.MeshBasicMaterial){let e=a.emissiveFactor;o.emissive=new n.Color().setRGB(e[0],e[1],e[2],l)}return void 0!==a.emissiveTexture&&t!==n.MeshBasicMaterial&&c.push(r.assignTexture(o,"emissiveMap",a.emissiveTexture,A)),Promise.all(c).then(function(){let s=new t(o);return a.name&&(s.name=a.name),Z(s,a),r.associations.set(s,{materials:e}),a.extensions&&Y(i,s,a),s})}createUniqueName(e){let t=n.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,s=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,s=t.weights.length;r1?new n.Group:1===t.length?t[0]:new n.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of s.associations)(e instanceof n.Material||e instanceof n.Texture)&&t.set(e,r);return e.traverse(e=>{let r=s.associations.get(e);null!=r&&t.set(e,r)}),t})(i),i})}_createAnimationTracks(e,t,r,s,i){let a,o=[],A=e.name?e.name:e.uuid,l=[];switch(X[i.path]===X.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(A),X[i.path]){case X.weights:a=n.NumberKeyframeTrack;break;case X.rotation:a=n.QuaternionKeyframeTrack;break;case X.position:case X.scale:a=n.VectorKeyframeTrack;break;default:a=1===r.itemSize?n.NumberKeyframeTrack:n.VectorKeyframeTrack}let B=void 0!==s.interpolation?j[s.interpolation]:n.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(s)},r,s)}decodeDracoFile(e,t,r,s){let n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).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 s=JSON.stringify(t);if(et.has(e)){let t=et.get(e);if(t.key===s)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 n=this.workerNextTaskID++,i=e.byteLength,a=this._getWorker(n,i).then(s=>(r=s,new Promise((s,i)=>{r._callbacks[n]={resolve:s,reject:i},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return a.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),et.set(e,{key:s,promise:a}),a}_createGeometry(e){let t=new ee.BufferGeometry;e.index&&t.setIndex(new ee.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];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 s=es.toString(),n=["/* draco decoder */",r,"\n/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),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,a=new t.DecoderBuffer;a.Init(new Int8Array(n),n.byteLength);try{let e=function(e,t,r,s){var n,i,a;let o,A,l,B,c,u,C=s.attributeIDs,h=s.attributeTypes,d=t.GetEncodedGeometryType(r);if(d===e.TRIANGULAR_MESH)c=new e.Mesh,u=t.DecodeBufferToMesh(r,c);else if(d===e.POINT_CLOUD)c=new e.PointCloud,u=t.DecodeBufferToPointCloud(r,c);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!u.ok()||0===c.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+u.error_msg());let f={index:null,attributes:[]};for(let r in C){let n,i,a=self[h[r]];if(s.useUniqueIDs)i=C[r],n=t.GetAttributeByUniqueId(c,i);else{if(-1===(i=t.GetAttributeId(c,e[C[r]])))continue;n=t.GetAttribute(c,i)}f.attributes.push(function(e,t,r,s,n,i){let a=i.num_components(),o=r.num_points()*a,A=o*n.BYTES_PER_ELEMENT,l=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,n),B=e._malloc(A);t.GetAttributeDataArrayForAllPoints(r,i,l,A,B);let c=new n(e.HEAPF32.buffer,B,o).slice();return e._free(B),{name:s,array:c,itemSize:a}}(e,t,c,r,a,n))}return d===e.TRIANGULAR_MESH&&(n=e,i=t,a=c,o=3*a.num_faces(),A=4*o,l=n._malloc(A),i.GetTrianglesUInt32Array(a,A,l),B=new Uint32Array(n.HEAPF32.buffer,l,o).slice(),n._free(l),f.index={array:B,itemSize:1}),e.destroy(c),f}(t,r,a,i),n=e.attributes.map(e=>e.array.buffer);e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},n)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(a),t.destroy(r)}})}}}var en=e.i(99143);let ei=function(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;n{let C={keys:B,deep:a,inject:l,castShadow:o,receiveShadow:A};if(Array.isArray(t=s.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return ei(t)}return t},[t,e])))return s.createElement("group",(0,r.default)({},c,{ref:u}),t.map(e=>s.createElement(ea,(0,r.default)({key:e.uuid,object:e},C))),i);let{children:h,...d}=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:i,castShadow:a,receiveShadow:o}){let A={};for(let r of t)A[r]=e[r];return r&&(A.geometry&&"materialsOnly"!==r&&(A.geometry=A.geometry.clone()),A.material&&"geometriesOnly"!==r&&(A.material=A.material.clone())),i&&(A="function"==typeof i?{...A,children:i(e)}:s.isValidElement(i)?{...A,children:i}:{...A,...i}),e instanceof n.Mesh&&(a&&(A.castShadow=!0),o&&(A.receiveShadow=!0)),A}(t,C),f=t.type[0].toLowerCase()+t.type.slice(1);return s.createElement(f,(0,r.default)({},d,c,{ref:u}),t.children.map(e=>"Bone"===e.type?s.createElement("primitive",(0,r.default)({key:e.uuid,object:e},C)):s.createElement(ea,(0,r.default)({key:e.uuid,object:e},C,{isChild:!0}))),i,h)}),eo=null,eA="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function el(e=!0,r=!0,s){return n=>{s&&s(n),e&&(eo||(eo=new er),eo.setDecoderPath("string"==typeof e?e:eA),n.setDRACOLoader(eo)),r&&n.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]),s=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 n="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";WebAssembly.validate(r)&&(n="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");let i=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n{(e=t.instance).exports.__wasm_call_ctors()});function a(t,r,s,n,i,a){let o=e.exports.sbrk,A=s+3&-4,l=o(A*n),B=o(i.length),c=new Uint8Array(e.exports.memory.buffer);c.set(i,B);let u=t(l,s,n,B,i.length);if(0===u&&a&&a(l,A,n),r.set(c.subarray(l,l+s*n)),o(l-o(0)),0!==u)throw Error(`Malformed buffer data: ${u}`)}let o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},A={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:i,supported:!0,decodeVertexBuffer(t,r,s,n,i){a(e.exports.meshopt_decodeVertexBuffer,t,r,s,n,e.exports[o[i]])},decodeIndexBuffer(t,r,s,n){a(e.exports.meshopt_decodeIndexBuffer,t,r,s,n)},decodeIndexSequence(t,r,s,n){a(e.exports.meshopt_decodeIndexSequence,t,r,s,n)},decodeGltfBuffer(t,r,s,n,i,l){a(e.exports[A[i]],t,r,s,n,e.exports[o[l]])}}})())}}let eB=(e,t,r,s)=>(0,en.useLoader)(B,e,el(t,r,s));eB.preload=(e,t,r,s)=>en.useLoader.preload(B,e,el(t,r,s)),eB.clear=e=>en.useLoader.clear(B,e),eB.setDecoderPath=e=>{eA=e},e.s(["useGLTF",()=>eB],78140)},82816,e=>{"use strict";function t(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;nt])},25947,71505,6655,e=>{"use strict";var t=e.i(43476),r=e.i(932),s=e.i(71645);let n=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function i(e){return n.test(e)}let a=(0,s.createContext)(null);function o(){let e=(0,s.useContext)(a);if(!e)throw Error("useShapeInfo must be used within ShapeInfoProvider");return e}function A(e){let s,n,o,A=(0,r.c)(10),{children:l,object:B,shapeName:c,type:u}=e;A[0]!==c?(s=i(c),A[0]=c,A[1]=s):s=A[1];let C=s;A[2]!==C||A[3]!==B||A[4]!==c||A[5]!==u?(n={object:B,shapeName:c,type:u,isOrganic:C},A[2]=C,A[3]=B,A[4]=c,A[5]=u,A[6]=n):n=A[6];let h=n;return A[7]!==l||A[8]!==h?(o=(0,t.jsx)(a.Provider,{value:h,children:l}),A[7]=l,A[8]=h,A[9]=o):o=A[9],o}e.s(["ShapeInfoProvider",()=>A,"isOrganicShape",()=>i,"useShapeInfo",()=>o],25947);var l=e.i(47071);e.i(47167);var B=e.i(69230),c=e.i(69637),u=e.i(54440),C=e.i(90072),h=e.i(12979),d=e.i(75567),f=e.i(51475),m=e.i(79123);let p=1/30,M=new Map;function F(e){let t=e[0].image,r=t.width,s=t.height,n=e.length,i=Math.ceil(Math.sqrt(n)),a=Math.ceil(n/i),o=document.createElement("canvas");o.width=r*i,o.height=s*a;let A=o.getContext("2d");e.forEach((e,t)=>{let n=Math.floor(t/i);A.drawImage(e.image,t%i*r,n*s)});let l=new C.CanvasTexture(o);return l.colorSpace=C.SRGBColorSpace,l.generateMipmaps=!1,l.minFilter=C.NearestFilter,l.magFilter=C.NearestFilter,l.wrapS=C.ClampToEdgeWrapping,l.wrapT=C.ClampToEdgeWrapping,l.repeat.set(1/i,1/a),{texture:l,columns:i,rows:a,frameCount:n,frameOffsetSeconds:[],totalDurationSeconds:0,lastFrame:-1}}function E(e,t){let r=0;e.frameOffsetSeconds=t.map(e=>r+=e.frameCount*p),e.totalDurationSeconds=r}function G(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,s=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,s/e.rows)}function I(e,t){let r=e.totalDurationSeconds;if(r<=0)return 0;let s=t;s>r&&(s-=r*Math.floor(s/r));for(let t=0;t(0,h.iflTextureToUrl)(t.name,e)),n=F(await Promise.all(s.map(d.loadTextureAsync)));return E(n,r),M.set(e,n),n}function D(e){var t;let s,n,i,a,o=(0,r.c)(14),{animationEnabled:A}=(0,m.useSettings)();o[0]!==e?(s={queryKey:["ifl",e],queryFn:()=>(0,h.loadImageFrameList)(e)},o[0]=e,o[1]=s):s=o[1];let{data:C}=(t=s,(0,c.useBaseQuery)({...t,enabled:!0,suspense:!0,throwOnError:u.defaultThrowOnError,placeholderData:void 0},B.QueryObserver,void 0));if(o[2]!==C||o[3]!==e){let t;o[5]!==e?(t=t=>(0,h.iflTextureToUrl)(t.name,e),o[5]=e,o[6]=t):t=o[6],n=C.map(t),o[2]=C,o[3]=e,o[4]=n}else n=o[4];let d=n,p=(0,l.useTexture)(d);o[7]!==C||o[8]!==e||o[9]!==p?((i=M.get(e))||(i=F(p),M.set(e,i)),E(i,C),o[7]=C,o[8]=e,o[9]=p,o[10]=i):i=o[10];let g=i;return o[11]!==A||o[12]!==g?(a=e=>{let t=e/f.TICK_RATE,r=A?I(g,t):0;G(g,r)},o[11]=A,o[12]=g,o[13]=a):a=o[13],(0,f.useTick)(a),g.texture}e.s(["getFrameIndexForTime",()=>I,"loadIflAtlas",()=>g,"updateAtlasFrame",()=>G,"useIflTexture",()=>D],71505);function R(e){e.uniforms.shapeDirectionalFactor={value:1},e.uniforms.shapeAmbientFactor={value:1.5},e.fragmentShader=e.fragmentShader.replace("#include ",`#include -uniform float shapeDirectionalFactor; -uniform float shapeAmbientFactor; -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include - // Apply shape-specific lighting multipliers - reflectedLight.directDiffuse *= shapeDirectionalFactor; - reflectedLight.indirectDiffuse *= shapeAmbientFactor; -`)}e.s(["injectShapeLighting",()=>R],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"entityTypeColor",()=>D,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1){let o=e.userData?.resource_path,A=new Set(e.userData?.flag_names??[]);if(!o){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(A.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,A,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,o,t,r)}}return{material:t,initialize:(e,r)=>I(t,o,e,r)}}let l=(0,a.textureToUrl)(o),B=(0,i.loadTexture)(l),c=A.has("Translucent");n||c?(0,i.setupTexture)(B,{disableMipmaps:!0}):(0,i.setupTexture)(B);let u=(0,r.createMaterialFromFlags)(e,B,A,n,s);return Array.isArray(u)?{material:u[1],backMaterial:u[0]}:{material:u}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t){var r;let n,i=[],a=!!t&&(0,s.isOrganicShape)(t),o=null;e.traverse(e=>{!o&&e.skeleton&&(o=e.skeleton)});let A=o?(r=o,n=new Set,r.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&n.add(t)}),n):new Set,l=[];for(let{parent:t,mesh:r}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;if((e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry){let t=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index,i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(a)){i[e]=!0;break}}if(n){let t=[],r=n.array;for(let e=0;e1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(t=t.clone()),e.geometry=t}let r=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let s=G(t,r,a);if(s.initialize&&i.push({mesh:e,initialize:s.initialize}),s.backMaterial&&e.parent){let t=e.clone();t.material=s.backMaterial,l.push({parent:e.parent,mesh:t})}return s.material});else if(e.material){let t=G(e.material,r,a);if(t.initialize&&i.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,l.push({parent:e.parent,mesh:r})}}}),l))t.add(r);return i}function D(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapePlaceholder",()=>D,"ShapeRenderer",()=>J,"applyShapeShaderModifications",()=>G,"createMaterialFromFlags",()=>I,"useStaticShape",()=>g]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(25645),A=e.i(12979),l=e.i(90072),B=e.i(82816),c=(e.i(75567),e.i(79123)),u=e.i(25947),C=e.i(58647),h=e.i(89887),d=e.i(71505),f=e.i(47021),m=e.i(48066),p=e.i(6655),M=e.i(85557);let F=(0,o.createLogger)("GenericShape");function E(){let{recording:e}=C.engineStore.getState().playback;return null!=e?(0,C.effectNow)()/1e3:performance.now()/1e3}function G(e){e.onBeforeCompile=t=>{(0,f.injectCustomFog)(t,m.globalFogUniforms),e instanceof l.MeshLambertMaterial&&(0,p.injectShapeLighting)(t)}}function I(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),A=r.has("SelfIlluminating"),B=n<1||i;if(A||o){let e=o||a||B,r=new l.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:l.AdditiveBlending}});return G(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new l.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new l.MeshLambertMaterial({...e,side:0});return G(r),G(s),[r,s]}let c=new l.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return G(c),c}function g(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,A.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function D(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(h.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function R(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,c.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(D,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let T=new Set(["octahedron.dts"]);function H(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,c.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(h.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let J=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:c,streamEntity:C,children:h}=e,d=void 0===c?"yellow":c,{object:f,shapeName:m}=(0,u.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(R,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(T.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(H,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(R,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(D,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==C?(o=(0,t.jsx)(y,{streamEntity:C}),B[8]=C,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),b=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,u.useShapeInfo)(),{debugMode:o}=(0,c.useDebug)(),{animationEnabled:A}=(0,c.useSettings)(),f=(0,C.useEngineSelector)(e=>e.runtime.runtime),{clonedScene:m,mixer:p,clipsByName:G,visNodesBySequence:I,iflMeshes:g}=(0,s.useMemo)(()=>{let t=B.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,M.processShapeScene)(t,i??void 0),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new l.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e]),D=(0,s.useRef)(new Map),R=(0,s.useRef)(new Map),T=(0,s.useRef)([]),H=(0,s.useRef)(0);(0,s.useRef)(A).current=A;let J=(0,s.useRef)(r);J.current=r;let b=(0,s.useRef)(null),y=(0,s.useRef)(null),L=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(T.current=[],R.current.clear(),g))(0,d.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};T.current.push(s),R.current.set(e.mesh,t)}).catch(t=>{F.warn("Failed to load IFL atlas for %s: %o",e.iflPath,t)})},[g]);let x=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r{let e=D.current,t=null==J.current;function r(t,r){let n=r.toLowerCase();s(t);let i=G.get(n),a=I.get(n),o={sequence:n,startTime:E()};if(i&&p){let e=p.clipAction(i);x.get(n)??!0?e.setLoop(l.LoopRepeat,1/0):(e.setLoop(l.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,M.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=R.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(b.current=r,y.current=s,!t)return()=>{for(let t of(b.current=null,y.current=null,L.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(f&&(i.push(f.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(f.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(f.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(G.has(a)||I.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),b.current=null,y.current=null,L.current=void 0,[...e.keys()]))s(t)}},[p,G,I,x,n,f]);let S=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=D.current,s=null!=J.current,n=C.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=J.current?.threads,o=L.current;if(a!==o){let e=b.current,t=y.current;if(e&&t){L.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(H.current+=i,B)){if(!A){(0,d.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=E()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,d.updateAtlasFrame)(e.atlas,(0,d.getFrameIndexForTime)(e.atlas,t))}else(0,d.updateAtlasFrame)(e.atlas,(0,d.getFrameIndexForTime)(e.atlas,H.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:m}),o?(0,t.jsxs)(h.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function y(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,u.useShapeInfo)(),o=g(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(b,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/41fb9d5ac0e14608.js b/docs/_next/static/chunks/41fb9d5ac0e14608.js new file mode 100644 index 00000000..5b8a2c67 --- /dev/null +++ b/docs/_next/static/chunks/41fb9d5ac0e14608.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(15080),i=e.i(71753),r=e.i(90072),o=e.i(25645),l=e.i(12979),s=e.i(51434),c=e.i(79123),u=e.i(89887),m=e.i(58647);let d=(0,o.createLogger)("AudioEmitter"),f=new Map,p=new Map;function h(e,t=1){p.set(e,t)}function S(e){p.delete(e)}let g=0;function y(){return g}function T(){for(let[e]of(g++,p)){try{e.stop()}catch{}try{e.disconnect()}catch{}}p.clear()}function I(e,t){let n=t(e),a=n?.filename;if(!a)return null;let i=a.endsWith(".wav")?a:`${a}.wav`,r=n.description,o=null!=r?t(r):void 0,l=o?.is3D??!0,s=o?.isLooping??!1,c=o?.referenceDistance??20;return{filename:i,is3D:l,isLooping:s,refDist:c,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function w(e,t,n,a,i){let o;try{o=(0,l.audioToUrl)(e.filename)}catch{return}let s=m.engineStore.getState().playback.rate,c=g;k(o,n,n=>{if(c===g)try{if(e.is3D&&i){let o=new r.PositionalAudio(t);o.setBuffer(n),o.setDistanceModel("inverse"),o.setRefDistance(e.refDist),o.setMaxDistance(e.maxDist),o.setRolloffFactor(1),o.setVolume(e.volume),o.setPlaybackRate(s),a&&o.position.copy(a),i.add(o),p.set(o,1),o.play(),o.source.onended=()=>{p.delete(o);try{o.disconnect()}catch{}i.remove(o)}}else{let a=new r.Audio(t);a.setBuffer(n),a.setVolume(e.volume),a.setPlaybackRate(s),p.set(a,1),a.play(),a.source.onended=()=>{p.delete(a);try{a.disconnect()}catch{}}}}catch{}})}function k(e,t,n){f.has(e)?n(f.get(e)):t.load(e,t=>{f.set(e,t),n(t)},void 0,t=>{d.error("Audio load error %s: %o",e,t)})}m.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of p)try{t.setPlaybackRate(n*e)}catch{}});let A=(0,n.memo)(function({entity:e}){let{debugMode:o}=(0,c.useDebug)(),m=e.audioFileName??"",d=e.audioVolume??1,f=e.audioMinDistance??1,p=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,S=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,y=e.audioIsLooping??!0,[T,I,w]=e.position??[0,0,0],A=(0,a.useThree)(e=>e.scene),M=(0,a.useThree)(e=>e.camera),{audioLoader:b,audioListener:x}=(0,s.useAudio)(),{audioEnabled:v}=(0,c.useSettings)(),N=(0,n.useRef)(null),R=(0,n.useRef)(null),E=(0,n.useRef)(null),C=(0,n.useRef)(!1),_=(0,n.useRef)(!1),L=(0,n.useRef)(new r.Vector3(T,I,w)),O=(0,n.useRef)(0),D=()=>{null!=R.current&&(clearTimeout(R.current),R.current=null),null!=E.current&&(clearTimeout(E.current),E.current=null)},[P]=(0,n.useState)(()=>Math.random());(0,n.useEffect)(()=>{let e;if(b&&x){if(O.current++,g){let t=new r.PositionalAudio(x);t.position.copy(L.current),t.setDistanceModel("inverse"),t.setRefDistance(f),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(d),e=t,A.add(e)}else(e=new r.Audio(x)).setVolume(d);return N.current=e,()=>{D();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&A.remove(e),N.current=null,C.current=!1,_.current=!1}}},[b,x,g,f,p,d,A]);let j=(e,t)=>{if(y)if(h>0||S>0){let n=Math.max(0,h),a=Math.max(n,S),i=n===a?n:P*(a-n)+n;e.loop=!1;let r=()=>{t===O.current&&(!1===e.isPlaying?R.current=setTimeout(()=>{if(t===O.current)try{e.play(),j(e,t)}catch{}},i):E.current=setTimeout(r,100))};E.current=setTimeout(r,100)}else e.setLoop(!0)},F=(0,n.useEffectEvent)(e=>{if(!b)return;let t=O.current;if(C.current)try{e.isPlaying||(e.play(),j(e,t))}catch{}else{let n;try{n=(0,l.audioToUrl)(m)}catch{return}k(n,b,n=>{if(t===O.current&&!e.buffer){e.setBuffer(n),C.current=!0;try{e.play(),j(e,t)}catch{}}})}});return(0,n.useEffect)(()=>{let e=N.current;e&&!g&&v&&m&&F(e)},[v,g,m,b,x]),(0,i.useFrame)(()=>{let e=N.current;if(!e||!g||!v||!m)return;let t=M.position.distanceTo(L.current),n=_.current,a=t<=p;if(a&&!n)_.current=!0,F(e);else if(!a&&n){_.current=!1,D();try{e.stop()}catch{}}}),(0,n.useEffect)(()=>{let e=N.current;if(e&&!v){D();try{e.stop()}catch{}_.current=!1}},[v]),o?(0,t.jsxs)("mesh",{position:L.current,children:[(0,t.jsx)("sphereGeometry",{args:[f,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(u.FloatingLabel,{color:"#00ff00",position:[0,f+1,0],children:m})]}):null});e.s(["AudioEmitter",0,A,"audioBufferCache",0,f,"getCachedAudioBuffer",()=>k,"getSoundGeneration",()=>y,"playOneShotSound",()=>w,"resolveAudioProfile",()=>I,"stopAllTrackedSounds",()=>T,"trackSound",()=>h,"untrackSound",()=>S])},9721,e=>{"use strict";var t=e.i(43476),n=e.i(932),a=e.i(71645),i=e.i(71753),r=e.i(90072),o=e.i(82816),l=e.i(85557);class s{states;seqIndexToName;currentStateIndex=0;delayTime=0;lastFireCount=-1;spinTimeScale=0;constructor(e,t){this.states=e,this.seqIndexToName=t,e.length>0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(0===this.states.length)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let a=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&a.push(t)}}this.delayTime-=e;let i=n,r=this.evaluateTickTransitions(t),o=0;for(;r>=0&&o<32;){if(o++,i=!0,r===this.currentStateIndex){this.delayTime=this.states[r].timeoutValue??0;break}let e=this.states[this.currentStateIndex].spin,n=this.delayTime;this.currentStateIndex=r;let l=this.states[r].timeoutValue??0;this.delayTime=l;let s=this.states[r].soundDataBlockId;switch(s>=0&&a.push(s),this.states[r].spin){case 1:this.spinTimeScale=0;break;case 4:this.spinTimeScale=1;break;case 2:3===e&&l>0&&(this.delayTime*=1-n/l);break;case 3:2===e&&l>0&&(this.delayTime*=1-n/l)}r=this.evaluateEntryTransitions(t)}let l=this.states[this.currentStateIndex],s=l.timeoutValue??0;switch(l.spin){case 1:this.spinTimeScale=0;break;case 2:this.spinTimeScale=s>0?Math.max(0,1-this.delayTime/s):1;break;case 4:this.spinTimeScale=1;break;case 3:this.spinTimeScale=s>0?Math.max(0,this.delayTime/s):0}return{sequenceName:this.resolveSequenceName(l),isFiring:l.fire,spinTimeScale:this.spinTimeScale,reverse:!l.direction,scaleAnimation:l.scaleAnimation,timeoutValue:l.timeoutValue??0,transitioned:i,soundDataBlockIds:a,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return -1;let a=this.evaluateConditions(t,e);if(-1!==a)return a;if(n){let e=t.transitionOnTimeout;if(-1!==e)return e}return -1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(-1!==n)return n;let a=t.ammo?e.transitionOnAmmo:e.transitionOnNoAmmo;if(-1!==a)return a;let i=t.target?e.transitionOnTarget:e.transitionOnNoTarget;if(-1!==i)return i;let r=t.wet?e.transitionOnWet:e.transitionOnNotWet;if(-1!==r)return r;let o=t.triggerDown?e.transitionOnTriggerDown:e.transitionOnTriggerUp;return -1!==o?o:-1}resolveSequenceName(e){return null==e.sequence||e.sequence<0?null:this.seqIndexToName[e.sequence]??null}}var c=e.i(43595),u=e.i(91907),m=e.i(56893),d=e.i(31999),f=e.i(46325),p=e.i(51434),h=e.i(29055),S=e.i(12979),g=e.i(79123),y=e.i(58647),T=e.i(93784);let I=["root","run","back","side","fall","jet","jump","land"];function w(e,t,n){let a=e.current;if(a){(0,h.untrackSound)(a);try{a.stop()}catch{}try{a.disconnect()}catch{}n?.remove(a),e.current=null,t.current=-1}}function k(e){let s,p,h,S,g,w,k,R,E,C,L,O,D,P,j,F,B,q,V,W,U,$,G,z,Y,K,H=(0,n.c)(70),{entity:Q}=e,J=(0,y.useEngineStoreApi)(),X=Q.shapeName??Q.dataBlock,Z=(0,u.useStaticShape)(X);H[0]!==X?(s=e=>{let t=X?.toLowerCase();return t?e.runtime.sequenceAliases.get(t):void 0},H[0]=X,H[1]=s):s=H[1];let ee=(0,y.useEngineSelector)(s),et=(0,m.useAnisotropy)();H[2]!==et||H[3]!==Z.scene?(k=o.clone(Z.scene),p=(0,l.processShapeScene)(k,void 0,{anisotropy:et}),k.traverse(v),w=new r.AnimationMixer(k),h=null,S=null,g=null,k.traverse(e=>{h||"Mount0"!==e.name||(h=e),S||"Mount1"!==e.name||(S=e),g||"Mount2"!==e.name||(g=e)}),H[2]=et,H[3]=Z.scene,H[4]=p,H[5]=h,H[6]=S,H[7]=g,H[8]=w,H[9]=k):(p=H[4],h=H[5],S=H[6],g=H[7],w=H[8],k=H[9]),H[10]!==p||H[11]!==h||H[12]!==S||H[13]!==g||H[14]!==w||H[15]!==k?(R={clonedScene:k,mixer:w,mount0:h,mount1:S,mount2:g,iflInitializers:p},H[10]=p,H[11]=h,H[12]=S,H[13]=g,H[14]=w,H[15]=k,H[16]=R):R=H[16];let{clonedScene:en,mixer:ea,mount0:ei,mount1:er,mount2:eo,iflInitializers:el}=R;H[17]!==en||H[18]!==ea?(E=()=>()=>{(0,l.disposeClonedScene)(en),ea.uncacheRoot(en)},C=[en,ea],H[17]=en,H[18]=ea,H[19]=E,H[20]=C):(E=H[19],C=H[20]),(0,a.useEffect)(E,C),H[21]===Symbol.for("react.memo_cache_sentinel")?(L=new Map,H[21]=L):L=H[21];let es=(0,a.useRef)(L);H[22]===Symbol.for("react.memo_cache_sentinel")?(O={head:null,headside:null},H[22]=O):O=H[22];let ec=(0,a.useRef)(O);H[23]===Symbol.for("react.memo_cache_sentinel")?(D=new Map,H[23]=D):D=H[23];let eu=(0,a.useRef)(D),em=(0,a.useRef)(null);H[24]===Symbol.for("react.memo_cache_sentinel")?(P={name:"root",timeScale:1},H[24]=P):P=H[24];let ed=(0,a.useRef)(P),ef=(0,a.useRef)(!1),ep=(0,a.useRef)(void 0);if(H[25]!==J||H[26]!==X){e:{let e=J.getState().playback,t=e.recording?.streamingPlayback,n=X?.toLowerCase();if(!t||!n){let e;H[28]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,H[28]=e):e=H[28],j=e;break e}let a=t.getShapeConstructorSequences(n);if(!a){let e;H[29]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,H[29]=e):e=H[29],j=e;break e}j=function(e,t){let n=new Map,a=[];for(let n of e){let e=n.indexOf(" ");if(-1===e)continue;let i=n.slice(0,e).toLowerCase(),r=n.slice(e+1).trim().toLowerCase();if(!r||!i.startsWith(t)||!i.endsWith(".dsq"))continue;let o=i.slice(t.length,-4);o&&a.push({clipName:o,alias:r})}let i=new Set;for(let e=0;e{let e=(0,c.getAliasedActions)(Z.animations,ea,ee);es.current=e;let t=e.get("root");t&&t.play(),ed.current={name:"root",timeScale:1};let n={head:null,headside:null};for(let{key:e,names:t}of[{key:"head",names:["head"]},{key:"headside",names:["headside"]}]){let a=Z.animations.find(e=>t.includes(e.name.toLowerCase()));if(!a)continue;let i=a.clone(),o=Math.round(30*a.duration/2);r.AnimationUtils.makeClipAdditive(i,o,a,30);let l=ea.clipAction(i);l.blendMode=r.AdditiveAnimationBlendMode,l.timeScale=0,l.weight=1,l.play(),n[e]=l}ec.current=n;let a=new Map,i=Z.animations.find(x),o=i?Math.round(30*i.duration/2):0;for(let e of["lookde","lookms","looksn"]){let t=Z.animations.find(t=>t.name.toLowerCase()===e);if(!t)continue;let n=t.clone(),l=i??t;r.AnimationUtils.makeClipAdditive(n,o,l,30);let s=ea.clipAction(n);s.blendMode=r.AdditiveAnimationBlendMode,s.timeScale=0,s.weight=0,s.play(),a.set(e,s)}eu.current=a;let l=a.get("lookde");return l&&(l.weight=1,em.current="lookde"),ea.update(0),()=>{ea.stopAllAction(),es.current=new Map,ec.current={head:null,headside:null},eu.current=new Map,em.current=null}},B=[ea,Z.animations,ee],H[30]=Z.animations,H[31]=ea,H[32]=ee,H[33]=F,H[34]=B):(F=H[33],B=H[34]),(0,a.useEffect)(F,B),H[35]!==el?(q=()=>{let e=[];for(let{mesh:t,initialize:n}of el)n(t,b).then(t=>e.push(t)).catch(M);return()=>e.forEach(A)},V=[el],H[35]=el,H[36]=q,H[37]=V):(q=H[36],V=H[37]),(0,a.useEffect)(q,V);let eS=(0,a.useRef)(Q.weaponShape),[eg,ey]=(0,a.useState)(Q.weaponShape),eT=(0,a.useRef)(Q.packShape),[eI,ew]=(0,a.useState)(Q.packShape),ek=(0,a.useRef)(Q.flagShape),[eA,eM]=(0,a.useState)(Q.flagShape);return H[38]!==eh||H[39]!==J||H[40]!==Q.falling||H[41]!==Q.flagShape||H[42]!==Q.headPitch||H[43]!==Q.headYaw||H[44]!==Q.jetting||H[45]!==Q.keyframes||H[46]!==Q.packShape||H[47]!==Q.weaponShape||H[48]!==ea?(W=(e,t)=>{Q.weaponShape!==eS.current&&(eS.current=Q.weaponShape,ey(Q.weaponShape)),Q.packShape!==eT.current&&(eT.current=Q.packShape,ew(Q.packShape)),Q.flagShape!==ek.current&&(ek.current=Q.flagShape,eM(Q.flagShape));let n=J.getState().playback,a="playing"===n.status,i=T.streamPlaybackStore.getState().time,o=(0,l.getKeyframeAtTime)(Q.keyframes??[],i),s=o?.damageState!=null&&o.damageState>=1,c=es.current;if(s&&!ef.current){ef.current=!0;let e=null!=o.actionAnim?eh.get(o.actionAnim):void 0;if(e){let t=c.get(e.clipName);if(t){let n=c.get(ed.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),ed.current={name:e.clipName,timeScale:1},ep.current=o.actionAnim}}}if(!s&&ef.current){ef.current=!1,ep.current=void 0;let e=c.get(ed.current.name.toLowerCase());e&&(e.stop(),e.setLoop(r.LoopRepeat,1/0),e.clampWhenFinished=!1),ed.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().play()}let u=o?.actionAnim,m=ep.current;if(!ef.current&&u!==m){ep.current=u;let e=null!=m&&m>=8;if(null!=u&&u>=8){let e=eh.get(u);if(e){let t=c.get(e.clipName);if(t){let n=c.get(ed.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),ed.current={name:e.clipName,timeScale:1}}}}else if(e){let e=eh.get(m);if(e){let t=c.get(e.clipName);t&&(t.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopRepeat,1/0),t.clampWhenFinished=!1)}ed.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()}}if(null!=u&&u>=8&&o?.actionAtEnd){let e=eh.get(u);if(e){let t=c.get(e.clipName);t&&(t.paused=!0)}}let d=null!=ep.current&&ep.current>=8;if(!ef.current&&!d){let e=function(e,t,n,a){if(n)return{animation:"fall",timeScale:1};if(!e)return a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1};let[i,r,o]=e,l=-2*Math.atan2(t[1],t[3]),s=Math.cos(l),c=Math.sin(l),u=i*s+r*c,m=-i*c+r*s,d=-m,f=-u,p=Math.max(m,d,f,u);return p<.1?a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1}:p===m?{animation:"run",timeScale:1}:p===d?{animation:"back",timeScale:1}:p===f?{animation:"side",timeScale:1}:{animation:"side",timeScale:-1}}(o?.velocity,o?.rotation??[0,0,0,1],Q.falling,Q.jetting),t=ed.current;if(e.animation!==t.name||e.timeScale!==t.timeScale){let n=c.get(t.name.toLowerCase()),i=c.get(e.animation.toLowerCase());i&&(a&&n&&n!==i?(n.fadeOut(l.ANIM_TRANSITION_TIME),i.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):(n&&n!==i&&n.stop(),i.reset().play()),i.timeScale=e.timeScale,ed.current={name:e.animation,timeScale:e.timeScale})}}let f=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(Q.weaponShape);if(f!==em.current){let e=eu.current,t=em.current?e.get(em.current):null,n=e.get(f);n&&(t&&(t.weight=0),n.weight=+!s,em.current=f)}let{head:p,headside:h}=ec.current,S=em.current?eu.current.get(em.current):null,g=+!s,y=Q.headPitch??0,I=Q.headYaw??0,w=(y+1)/2;S&&(S.time=w*S.getClip().duration,S.weight=g),p&&(p.time=w*p.getClip().duration,p.weight=g),h&&(h.time=(I+1)/2*h.getClip().duration,h.weight=g),a?ea.update(t*n.rate):ea.update(0)},H[38]=eh,H[39]=J,H[40]=Q.falling,H[41]=Q.flagShape,H[42]=Q.headPitch,H[43]=Q.headYaw,H[44]=Q.jetting,H[45]=Q.keyframes,H[46]=Q.packShape,H[47]=Q.weaponShape,H[48]=ea,H[49]=W):W=H[49],(0,i.useFrame)(W),H[50]===Symbol.for("react.memo_cache_sentinel")?(U=[0,Math.PI/2,0],H[50]=U):U=H[50],H[51]!==en?($=(0,t.jsx)("group",{rotation:U,children:(0,t.jsx)("primitive",{object:en})}),H[51]=en,H[52]=$):$=H[52],H[53]!==eg||H[54]!==Q||H[55]!==ei?(G=eg&&ei&&(0,t.jsx)(d.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:eg}),children:(0,t.jsx)(f.DebugSuspense,{name:`Weapon:${Q.id}/${eg}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:eg}),children:(0,t.jsx)(N,{entity:Q,weaponShape:eg,mount0:ei})})},eg),H[53]=eg,H[54]=Q,H[55]=ei,H[56]=G):G=H[56],H[57]!==eI||H[58]!==Q.id||H[59]!==er?(z=eI&&er&&(0,t.jsx)(d.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:eI}),children:(0,t.jsx)(f.DebugSuspense,{name:`Pack:${Q.id}/${eI}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:eI}),children:(0,t.jsx)(_,{packShape:eI,mountBone:er})})},eI),H[57]=eI,H[58]=Q.id,H[59]=er,H[60]=z):z=H[60],H[61]!==eA||H[62]!==Q.id||H[63]!==eo?(Y=eA&&eo&&(0,t.jsx)(d.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:eA}),children:(0,t.jsx)(f.DebugSuspense,{name:`Flag:${Q.id}/${eA}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:eA}),children:(0,t.jsx)(_,{packShape:eA,mountBone:eo})})},eA),H[61]=eA,H[62]=Q.id,H[63]=eo,H[64]=Y):Y=H[64],H[65]!==$||H[66]!==G||H[67]!==z||H[68]!==Y?(K=(0,t.jsxs)(t.Fragment,{children:[$,G,z,Y]}),H[65]=$,H[66]=G,H[67]=z,H[68]=Y,H[69]=K):K=H[69],K}function A(e){return e()}function M(){}function b(){return T.streamPlaybackStore.getState().time}function x(e){return"lookde"===e.name.toLowerCase()}function v(e){if(e.isMesh&&e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.side=r.FrontSide}function N(e){let t,c,d,f,T,I,k,A,M,b,x,v,N,_,L,O,D=(0,n.c)(43),{entity:P,weaponShape:j,mount0:F}=e,B=(0,y.useEngineStoreApi)(),q=(0,u.useStaticShape)(j),V=(0,m.useAnisotropy)();if(D[0]!==V||D[1]!==q.animations||D[2]!==q.scene){t=o.clone(q.scene),c=(0,l.processShapeScene)(t,void 0,{anisotropy:V});let e=(0,l.getPosedNodeTransform)(q.scene,q.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}f=new Map,t.traverse(e=>{if(!e.isMesh)return;let t=e.userData,n=(t?.vis_sequence??"").toLowerCase();if(!n)return;let a=f.get(n);a||(a=[],f.set(n,a)),a.push(e)}),d=new r.AnimationMixer(t),D[0]=V,D[1]=q.animations,D[2]=q.scene,D[3]=t,D[4]=c,D[5]=d,D[6]=f}else t=D[3],c=D[4],d=D[5],f=D[6];let W=d,U=q.scene;D[7]!==U||D[8]!==q.animations?(T=function(e,t){let n=e.userData?.dts_sequence_names;if("string"==typeof n)try{return JSON.parse(n).map(e=>e.toLowerCase())}catch{}return t.map(e=>e.name.toLowerCase())}(U,q.animations),D[7]=U,D[8]=q.animations,D[9]=T):T=D[9];let $=T;D[10]!==t||D[11]!==c||D[12]!==W||D[13]!==$||D[14]!==f?(I={weaponClone:t,weaponMixer:W,seqIndexToName:$,visNodesBySequence:f,weaponIflInitializers:c},D[10]=t,D[11]=c,D[12]=W,D[13]=$,D[14]=f,D[15]=I):I=D[15];let{weaponClone:G,weaponMixer:z,seqIndexToName:Y,visNodesBySequence:K,weaponIflInitializers:H}=I;D[16]!==G||D[17]!==z?(k=()=>()=>{(0,l.disposeClonedScene)(G),z.uncacheRoot(G)},A=[G,z],D[16]=G,D[17]=z,D[18]=k,D[19]=A):(k=D[18],A=D[19]),(0,a.useEffect)(k,A),D[20]===Symbol.for("react.memo_cache_sentinel")?(M=new Map,D[20]=M):M=D[20];let Q=(0,a.useRef)(M),J=(0,a.useRef)(null);D[21]!==q.animations||D[22]!==z?(b=()=>{let e=new Map;for(let t of q.animations)e.set(t.name.toLowerCase(),z.clipAction(t));Q.current=e;let t=e.get("spin");return t&&(t.setLoop(r.LoopRepeat,1/0),t.timeScale=0,t.play()),J.current=t??null,z.update(0),()=>{z.stopAllAction(),Q.current=new Map,J.current=null,w(er,eo)}},x=[z,q.animations],D[21]=q.animations,D[22]=z,D[23]=b,D[24]=x):(b=D[23],x=D[24]),(0,a.useEffect)(b,x),D[25]!==H?(v=()=>{let e=[];for(let{mesh:t,initialize:n}of H)n(t,C).then(t=>e.push(t)).catch(E);return()=>e.forEach(R)},N=[H],D[25]=H,D[26]=v,D[27]=N):(v=D[26],N=D[27]),(0,a.useEffect)(v,N);let{audioLoader:X,audioListener:Z}=(0,p.useAudio)(),ee=(0,g.useSettings)(),et=ee?.audioEnabled??!1,en=(0,a.useRef)(null),ea=(0,a.useRef)(null),ei=(0,a.useRef)(P.weaponImageStates),er=(0,a.useRef)(null),eo=(0,a.useRef)(-1);return D[28]!==F||D[29]!==G?(_=()=>(F.add(G),()=>{F.remove(G)}),L=[G,F],D[28]=F,D[29]=G,D[30]=_,D[31]=L):(_=D[30],L=D[31]),(0,a.useEffect)(_,L),D[32]!==et||D[33]!==Z||D[34]!==X||D[35]!==B||D[36]!==P.weaponImageState||D[37]!==P.weaponImageStates||D[38]!==Y||D[39]!==K||D[40]!==G||D[41]!==z?(O=(e,t)=>{let n=B.getState().playback,a="playing"===n.status,i=Q.current,o=P.weaponImageState,c=P.weaponImageStates;c!==ei.current&&(ei.current=c,c&&c.length>0?en.current=new s(c,Y):en.current=null,ea.current=null,w(er,eo,G)),!en.current&&c&&c.length>0&&(en.current=new s(c,Y));let u=en.current;if(u&&o&&a){let e=t*n.rate,a=u.tick(e,o);if(function(e,t,n,a){let i=e.sequenceName,o=n.current;if(i===o&&!e.transitioned)return;if(i!==o){if(o){let e=a.get(o);if(e)for(let t of e)t.visible=!1}if(i){let e=a.get(i);if(e)for(let t of e)t.visible=!0}}if(!i){if(o){let e=t.get(o);e&&e.fadeOut(l.ANIM_TRANSITION_TIME),n.current=null}return}let s=t.get(i);if(s&&(e.transitioned||i!==o)){let a=o?t.get(o):null;if(e.isFiring||e.timeoutValue>0?(s.setLoop(r.LoopOnce,1),s.clampWhenFinished=!0):(s.setLoop(r.LoopRepeat,1/0),s.clampWhenFinished=!1),e.scaleAnimation&&e.timeoutValue>0){let t=s.getClip().duration;s.timeScale=t>0?t/e.timeoutValue:1}else s.timeScale=e.reverse?-1:1;a&&a!==s?(a.fadeOut(l.ANIM_TRANSITION_TIME),s.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):s.reset().play(),n.current=i}}(a,i,ea,K),er.current&&a.stateIndex!==eo.current&&w(er,eo,G),et&&X&&Z&&a.soundDataBlockIds.length>0){let e=n.recording?.streamingPlayback.getDataBlockData.bind(n.recording.streamingPlayback);if(e)for(let t of a.soundDataBlockIds){let a=(0,h.resolveAudioProfile)(t,e);if(a)if(a.isLooping){if(!er.current)try{let e=(0,S.audioToUrl)(a.filename),t=(0,h.getSoundGeneration)();(0,h.getCachedAudioBuffer)(e,X,e=>{if(t!==(0,h.getSoundGeneration)()||er.current)return;let i=u.stateIndex,o=new r.PositionalAudio(Z);o.setBuffer(e),o.setDistanceModel("inverse"),o.setRefDistance(a.refDist),o.setMaxDistance(a.maxDist),o.setRolloffFactor(1),o.setVolume(a.volume),o.setPlaybackRate(n.rate),o.setLoop(!0),G.add(o),(0,h.trackSound)(o),o.play(),er.current=o,eo.current=i})}catch{}}else(0,h.playOneShotSound)(a,Z,X,void 0,G)}}J.current&&(J.current.timeScale=a.spinTimeScale)}a?z.update(t*n.rate):z.update(0)},D[32]=et,D[33]=Z,D[34]=X,D[35]=B,D[36]=P.weaponImageState,D[37]=P.weaponImageStates,D[38]=Y,D[39]=K,D[40]=G,D[41]=z,D[42]=O):O=D[42],(0,i.useFrame)(O),null}function R(e){return e()}function E(){}function C(){return T.streamPlaybackStore.getState().time}function _(e){let t,i,r,s,c,d,f,p=(0,n.c)(15),{packShape:h,mountBone:S}=e,g=(0,u.useStaticShape)(h),y=(0,m.useAnisotropy)();if(p[0]!==y||p[1]!==g.animations||p[2]!==g.scene){t=o.clone(g.scene),i=(0,l.processShapeScene)(t,void 0,{anisotropy:y});let e=(0,l.getPosedNodeTransform)(g.scene,g.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}p[0]=y,p[1]=g.animations,p[2]=g.scene,p[3]=t,p[4]=i}else t=p[3],i=p[4];p[5]!==t||p[6]!==i?(r={packClone:t,packIflInitializers:i},p[5]=t,p[6]=i,p[7]=r):r=p[7];let{packClone:T,packIflInitializers:I}=r;return p[8]!==S||p[9]!==T?(s=()=>(S.add(T),()=>{S.remove(T),(0,l.disposeClonedScene)(T)}),c=[T,S],p[8]=S,p[9]=T,p[10]=s,p[11]=c):(s=p[10],c=p[11]),(0,a.useEffect)(s,c),p[12]!==I?(d=()=>{let e=[];for(let{mesh:t,initialize:n}of I)n(t,D).then(t=>e.push(t)).catch(O);return()=>e.forEach(L)},f=[I],p[12]=I,p[13]=d,p[14]=f):(d=p[13],f=p[14]),(0,a.useEffect)(d,f),null}function L(e){return e()}function O(){}function D(){return T.streamPlaybackStore.getState().time}function P(e){let t,i,r=(0,n.c)(7),{shapeName:o,eyeOffsetRef:s}=e,c=(0,u.useStaticShape)(o);return r[0]!==s||r[1]!==c.animations||r[2]!==c.scene?(t=()=>{let e=(0,l.getPosedNodeTransform)(c.scene,c.animations,"Eye");e?s.current.set(e.position.z,e.position.y,-e.position.x):s.current.set(0,l.DEFAULT_EYE_HEIGHT,0)},r[0]=s,r[1]=c.animations,r[2]=c.scene,r[3]=t):t=r[3],r[4]!==s||r[5]!==c?(i=[c,s],r[4]=s,r[5]=c,r[6]=i):i=r[6],(0,a.useEffect)(t,i),null}e.s(["PlayerEyeOffset",()=>P,"PlayerModel",()=>k],9721)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/538e72dc81951677.js b/docs/_next/static/chunks/538e72dc81951677.js new file mode 100644 index 00000000..ecb9fa96 --- /dev/null +++ b/docs/_next/static/chunks/538e72dc81951677.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(15080),o=e.i(71753),i=e.i(90072),u=e.i(25645),c=e.i(12979),a=e.i(51434),s=e.i(79123),l=e.i(89887),f=e.i(58647);let d=(0,u.createLogger)("AudioEmitter"),p=new Map,m=new Map;function h(e,t=1){m.set(e,t)}function y(e){m.delete(e)}let g=0;function D(){return g}function v(){for(let[e]of(g++,m)){try{e.stop()}catch{}try{e.disconnect()}catch{}}m.clear()}function R(e,t){let r=t(e),n=r?.filename;if(!n)return null;let o=n.endsWith(".wav")?n:`${n}.wav`,i=r.description,u=null!=i?t(i):void 0,c=u?.is3D??!0,a=u?.isLooping??!1,s=u?.referenceDistance??20;return{filename:o,is3D:c,isLooping:a,refDist:s,maxDist:u?.maxDistance??100,volume:u?.volume??1}}function M(e,t,r,n,o){let u;try{u=(0,c.audioToUrl)(e.filename)}catch{return}let a=f.engineStore.getState().playback.rate,s=g;T(u,r,r=>{if(s===g)try{if(e.is3D&&o){let u=new i.PositionalAudio(t);u.setBuffer(r),u.setDistanceModel("inverse"),u.setRefDistance(e.refDist),u.setMaxDistance(e.maxDist),u.setRolloffFactor(1),u.setVolume(e.volume),u.setPlaybackRate(a),n&&u.position.copy(n),o.add(u),m.set(u,1),u.play(),u.source.onended=()=>{m.delete(u);try{u.disconnect()}catch{}o.remove(u)}}else{let n=new i.Audio(t);n.setBuffer(r),n.setVolume(e.volume),n.setPlaybackRate(a),m.set(n,1),n.play(),n.source.onended=()=>{m.delete(n);try{n.disconnect()}catch{}}}}catch{}})}function T(e,t,r){p.has(e)?r(p.get(e)):t.load(e,t=>{p.set(e,t),r(t)},void 0,t=>{d.error("Audio load error %s: %o",e,t)})}f.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,r]of m)try{t.setPlaybackRate(r*e)}catch{}});let b=(0,r.memo)(function({entity:e}){let{debugMode:u}=(0,s.useDebug)(),f=e.audioFileName??"",d=e.audioVolume??1,p=e.audioMinDistance??1,m=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,y=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,D=e.audioIsLooping??!0,[v,R,M]=e.position??[0,0,0],b=(0,n.useThree)(e=>e.scene),x=(0,n.useThree)(e=>e.camera),{audioLoader:A,audioListener:S}=(0,a.useAudio)(),{audioEnabled:w}=(0,s.useSettings)(),P=(0,r.useRef)(null),k=(0,r.useRef)(null),B=(0,r.useRef)(null),E=(0,r.useRef)(!1),L=(0,r.useRef)(!1),V=(0,r.useRef)(new i.Vector3(v,R,M)),j=(0,r.useRef)(0),F=()=>{null!=k.current&&(clearTimeout(k.current),k.current=null),null!=B.current&&(clearTimeout(B.current),B.current=null)},[C]=(0,r.useState)(()=>Math.random());(0,r.useEffect)(()=>{let e;if(A&&S){if(j.current++,g){let t=new i.PositionalAudio(S);t.position.copy(V.current),t.setDistanceModel("inverse"),t.setRefDistance(p),t.setMaxDistance(m),t.setRolloffFactor(1),t.setVolume(d),e=t,b.add(e)}else(e=new i.Audio(S)).setVolume(d);return P.current=e,()=>{F();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&b.remove(e),P.current=null,E.current=!1,L.current=!1}}},[A,S,g,p,m,d,b]);let G=(e,t)=>{if(D)if(h>0||y>0){let r=Math.max(0,h),n=Math.max(r,y),o=r===n?r:C*(n-r)+r;e.loop=!1;let i=()=>{t===j.current&&(!1===e.isPlaying?k.current=setTimeout(()=>{if(t===j.current)try{e.play(),G(e,t)}catch{}},o):B.current=setTimeout(i,100))};B.current=setTimeout(i,100)}else e.setLoop(!0)},U=(0,r.useEffectEvent)(e=>{if(!A)return;let t=j.current;if(E.current)try{e.isPlaying||(e.play(),G(e,t))}catch{}else{let r;try{r=(0,c.audioToUrl)(f)}catch{return}T(r,A,r=>{if(t===j.current&&!e.buffer){e.setBuffer(r),E.current=!0;try{e.play(),G(e,t)}catch{}}})}});return(0,r.useEffect)(()=>{let e=P.current;e&&!g&&w&&f&&U(e)},[w,g,f,A,S]),(0,o.useFrame)(()=>{let e=P.current;if(!e||!g||!w||!f)return;let t=x.position.distanceTo(V.current),r=L.current,n=t<=m;if(n&&!r)L.current=!0,U(e);else if(!n&&r){L.current=!1,F();try{e.stop()}catch{}}}),(0,r.useEffect)(()=>{let e=P.current;if(e&&!w){F();try{e.stop()}catch{}L.current=!1}},[w]),u?(0,t.jsxs)("mesh",{position:V.current,children:[(0,t.jsx)("sphereGeometry",{args:[p,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(l.FloatingLabel,{color:"#00ff00",position:[0,p+1,0],children:f})]}):null});e.s(["AudioEmitter",0,b,"audioBufferCache",0,p,"getCachedAudioBuffer",()=>T,"getSoundGeneration",()=>D,"playOneShotSound",()=>M,"resolveAudioProfile",()=>R,"stopAllTrackedSounds",()=>v,"trackSound",()=>h,"untrackSound",()=>y])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/57517f0359971c33.js b/docs/_next/static/chunks/57517f0359971c33.js new file mode 100644 index 00000000..9b2e2fd9 --- /dev/null +++ b/docs/_next/static/chunks/57517f0359971c33.js @@ -0,0 +1,8 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8597,78140,e=>{"use strict";let t;var r=e.i(71645);let s=(0,r.createContext)(null),n={didCatch:!1,error:null};class i extends r.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=n}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;null!==t&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(n))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:s}=this.props;r&&null!==t.error&&function(e=[],t=[]){return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,s)&&(this.props.onReset?.({next:s,prev:e.resetKeys,reason:"keys"}),this.setState(n))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:a,error:o}=this.state,A=e;if(a){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)A=t(e);else if(n)A=(0,r.createElement)(n,e);else if(void 0!==i)A=i;else throw o}return(0,r.createElement)(s.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},A)}}e.s(["ErrorBoundary",()=>i],8597);var a=e.i(31067),o=e.i(90072);function A(e,t){if(t===o.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==o.TriangleFanDrawMode&&t!==o.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;etypeof TextDecoder)return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r=2.0 are supported."));return}let o=new et(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});o.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}o.setExtensions(i),o.setPlugins(a),o.parse(r,s)}parseAsync(e,t){let r=this;return new Promise(function(s,n){r.parse(e,t,s,n)})}}function h(){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 d={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 f{constructor(e){this.parser=e,this.name=d.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,i)}}class b{constructor(e){this.parser=e,this.name=d.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.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 y{constructor(e){this.parser=e,this.name=d.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.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 L{constructor(e){this.name=d.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],s=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.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 s.then(function(t){let r=e.byteOffset||0,s=e.byteLength||0,i=e.count,a=e.byteStride,o=new Uint8Array(t,r,s);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,a,o,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*a);return n.decodeGltfBuffer(new Uint8Array(t),i,a,o,e.mode,e.filter),t})})}}}class x{constructor(e){this.name=d.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!==_.TRIANGLES&&e.mode!==_.TRIANGLE_STRIP&&e.mode!==_.TRIANGLE_FAN&&void 0!==e.mode)return null;let s=r.extensions[this.name].attributes,n=[],i={};for(let e in s)n.push(this.parser.getDependency("accessor",s[e]).then(t=>(i[e]=t,i[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],s=e[0].count,n=[];for(let e of r){let t=new o.Matrix4,r=new o.Vector3,a=new o.Quaternion,A=new o.Vector3(1,1,1),l=new o.InstancedMesh(e.geometry,e.material,s);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"},Z={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},W={CUBICSPLINE:void 0,LINEAR:o.InterpolateLinear,STEP:o.InterpolateDiscrete};function V(e,t,r){for(let s in r.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=r.extensions[s])}function q(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 z(e){let t="",r=Object.keys(e).sort();for(let s=0,n=r.length;stypeof navigator&&void 0!==navigator.userAgent&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=(s=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"u"{let r=this.associations.get(e);for(let[s,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(i,t.children[s])};return n(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&i.setY(t,u[e*A+1]),A>=3&&i.setZ(t,u[e*A+2]),A>=4&&i.setW(t,u[e*A+3]),A>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i})}loadTexture(e){let t=this.json,r=this.options,s=t.textures[e].source,n=t.images[s],i=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,s,i)}loadTextureImage(e,t,r){let s=this,n=this.json,i=n.textures[e],a=n.images[t],A=(a.uri||a.bufferView)+":"+i.sampler;if(this.textureCache[A])return this.textureCache[A];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=i.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);let r=(n.samplers||{})[i.sampler]||{};return t.magFilter=k[r.magFilter]||o.LinearFilter,t.minFilter=k[r.minFilter]||o.LinearMipmapLinearFilter,t.wrapS=X[r.wrapS]||o.RepeatWrapping,t.wrapT=X[r.wrapT]||o.RepeatWrapping,s.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){let r=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let n=r.images[e],i=self.URL||self.webkitURL,a=n.uri||"",A=!1;if(void 0!==n.bufferView)a=this.getDependency("bufferView",n.bufferView).then(function(e){A=!0;let t=new Blob([e],{type:n.mimeType});return a=i.createObjectURL(t)});else if(void 0===n.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(a).then(function(e){return new Promise(function(r,n){let i=r;!0===t.isImageBitmapLoader&&(i=function(e){let t=new o.Texture(e);t.needsUpdate=!0,r(t)}),t.load(o.LoaderUtils.resolveURL(e,s.path),i,void 0,n)})}).then(function(e){var t;return!0===A&&i.revokeObjectURL(a),q(e,n),e.userData.mimeType=n.mimeType||((t=n.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",a),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,s){let n=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),n.extensions[d.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[d.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[d.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}return void 0!==s&&("number"==typeof s&&(s=3001===s?c:u),"colorSpace"in i?i.colorSpace=s:i.encoding=s===c?3001:3e3),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,s=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new o.PointsMaterial,o.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 o.LineBasicMaterial,o.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(s||n||i){let e="ClonedMaterial:"+r.uuid+":";s&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),i&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),i&&(t.flatShading=!0),s&&(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 o.MeshStandardMaterial}loadMaterial(e){let t,r=this,s=this.json,n=this.extensions,i=s.materials[e],a={},A=i.extensions||{},l=[];if(A[d.KHR_MATERIALS_UNLIT]){let e=n[d.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(a,i,r))}else{let s=i.pbrMetallicRoughness||{};if(a.color=new o.Color(1,1,1),a.opacity=1,Array.isArray(s.baseColorFactor)){let e=s.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],u),a.opacity=e[3]}void 0!==s.baseColorTexture&&l.push(r.assignTexture(a,"map",s.baseColorTexture,c)),a.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,a.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(l.push(r.assignTexture(a,"metalnessMap",s.metallicRoughnessTexture)),l.push(r.assignTexture(a,"roughnessMap",s.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,a)})))}!0===i.doubleSided&&(a.side=o.DoubleSide);let B=i.alphaMode||"OPAQUE";if("BLEND"===B?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===B&&(a.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==o.MeshBasicMaterial&&(l.push(r.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new o.Vector2(1,1),void 0!==i.normalTexture.scale)){let e=i.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==i.occlusionTexture&&t!==o.MeshBasicMaterial&&(l.push(r.assignTexture(a,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(a.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==o.MeshBasicMaterial){let e=i.emissiveFactor;a.emissive=new o.Color().setRGB(e[0],e[1],e[2],u)}return void 0!==i.emissiveTexture&&t!==o.MeshBasicMaterial&&l.push(r.assignTexture(a,"emissiveMap",i.emissiveTexture,c)),Promise.all(l).then(function(){let s=new t(a);return i.name&&(s.name=i.name),q(s,i),r.associations.set(s,{materials:e}),i.extensions&&V(n,s,i),s})}createUniqueName(e){let t=o.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,s=this.primitiveCache,n=[];for(let i=0,a=e.length;i0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,s=t.weights.length;r1?new o.Group:1===t.length?t[0]:new o.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of s.associations)(e instanceof o.Material||e instanceof o.Texture)&&t.set(e,r);return e.traverse(e=>{let r=s.associations.get(e);null!=r&&t.set(e,r)}),t})(n),n})}_createAnimationTracks(e,t,r,s,n){let i,a=[],A=e.name?e.name:e.uuid,l=[];switch(Z[n.path]===Z.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(A),Z[n.path]){case Z.weights:i=o.NumberKeyframeTrack;break;case Z.rotation:i=o.QuaternionKeyframeTrack;break;case Z.position:case Z.scale:i=o.VectorKeyframeTrack;break;default:i=1===r.itemSize?o.NumberKeyframeTrack:o.VectorKeyframeTrack}let B=void 0!==s.interpolation?W[s.interpolation]:o.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(s)},r,s)}decodeDracoFile(e,t,r,s){let n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).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 s=JSON.stringify(t);if(en.has(e)){let t=en.get(e);if(t.key===s)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 n=this.workerNextTaskID++,i=e.byteLength,a=this._getWorker(n,i).then(s=>(r=s,new Promise((s,i)=>{r._callbacks[n]={resolve:s,reject:i},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return a.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),en.set(e,{key:s,promise:a}),a}_createGeometry(e){let t=new es.BufferGeometry;e.index&&t.setIndex(new es.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];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 s=ea.toString(),n=["/* draco decoder */",r,"\n/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),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,a=new t.DecoderBuffer;a.Init(new Int8Array(n),n.byteLength);try{let e=function(e,t,r,s){var n,i,a;let o,A,l,B,c,u,C=s.attributeIDs,h=s.attributeTypes,d=t.GetEncodedGeometryType(r);if(d===e.TRIANGULAR_MESH)c=new e.Mesh,u=t.DecodeBufferToMesh(r,c);else if(d===e.POINT_CLOUD)c=new e.PointCloud,u=t.DecodeBufferToPointCloud(r,c);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!u.ok()||0===c.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+u.error_msg());let f={index:null,attributes:[]};for(let r in C){let n,i,a=self[h[r]];if(s.useUniqueIDs)i=C[r],n=t.GetAttributeByUniqueId(c,i);else{if(-1===(i=t.GetAttributeId(c,e[C[r]])))continue;n=t.GetAttribute(c,i)}f.attributes.push(function(e,t,r,s,n,i){let a=i.num_components(),o=r.num_points()*a,A=o*n.BYTES_PER_ELEMENT,l=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,n),B=e._malloc(A);t.GetAttributeDataArrayForAllPoints(r,i,l,A,B);let c=new n(e.HEAPF32.buffer,B,o).slice();return e._free(B),{name:s,array:c,itemSize:a}}(e,t,c,r,a,n))}return d===e.TRIANGULAR_MESH&&(n=e,i=t,a=c,o=3*a.num_faces(),A=4*o,l=n._malloc(A),i.GetTrianglesUInt32Array(a,A,l),B=new Uint32Array(n.HEAPF32.buffer,l,o).slice(),n._free(l),f.index={array:B,itemSize:1}),e.destroy(c),f}(t,r,a,i),n=e.attributes.map(e=>e.array.buffer);e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},n)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(a),t.destroy(r)}})}}}var eo=e.i(99143);let eA=function(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;n{let C={keys:B,deep:n,inject:l,castShadow:i,receiveShadow:A};if(Array.isArray(t=r.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return eA(t)}return t},[t,e])))return r.createElement("group",(0,a.default)({},c,{ref:u}),t.map(e=>r.createElement(el,(0,a.default)({key:e.uuid,object:e},C))),s);let{children:h,...d}=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:s,inject:n,castShadow:i,receiveShadow:a}){let A={};for(let r of t)A[r]=e[r];return s&&(A.geometry&&"materialsOnly"!==s&&(A.geometry=A.geometry.clone()),A.material&&"geometriesOnly"!==s&&(A.material=A.material.clone())),n&&(A="function"==typeof n?{...A,children:n(e)}:r.isValidElement(n)?{...A,children:n}:{...A,...n}),e instanceof o.Mesh&&(i&&(A.castShadow=!0),a&&(A.receiveShadow=!0)),A}(t,C),f=t.type[0].toLowerCase()+t.type.slice(1);return r.createElement(f,(0,a.default)({},d,c,{ref:u}),t.children.map(e=>"Bone"===e.type?r.createElement("primitive",(0,a.default)({key:e.uuid,object:e},C)):r.createElement(el,(0,a.default)({key:e.uuid,object:e},C,{isChild:!0}))),s,h)}),eB=null,ec="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function eu(e=!0,r=!0,s){return n=>{s&&s(n),e&&(eB||(eB=new ei),eB.setDecoderPath("string"==typeof e?e:ec),n.setDRACOLoader(eB)),r&&n.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]),s=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 n="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";WebAssembly.validate(r)&&(n="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");let i=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n{(e=t.instance).exports.__wasm_call_ctors()});function a(t,r,s,n,i,a){let o=e.exports.sbrk,A=s+3&-4,l=o(A*n),B=o(i.length),c=new Uint8Array(e.exports.memory.buffer);c.set(i,B);let u=t(l,s,n,B,i.length);if(0===u&&a&&a(l,A,n),r.set(c.subarray(l,l+s*n)),o(l-o(0)),0!==u)throw Error(`Malformed buffer data: ${u}`)}let o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},A={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:i,supported:!0,decodeVertexBuffer(t,r,s,n,i){a(e.exports.meshopt_decodeVertexBuffer,t,r,s,n,e.exports[o[i]])},decodeIndexBuffer(t,r,s,n){a(e.exports.meshopt_decodeIndexBuffer,t,r,s,n)},decodeIndexSequence(t,r,s,n){a(e.exports.meshopt_decodeIndexSequence,t,r,s,n)},decodeGltfBuffer(t,r,s,n,i,l){a(e.exports[A[i]],t,r,s,n,e.exports[o[l]])}}})())}}let eC=(e,t,r,s)=>(0,eo.useLoader)(C,e,eu(t,r,s));eC.preload=(e,t,r,s)=>eo.useLoader.preload(C,e,eu(t,r,s)),eC.clear=e=>eo.useLoader.clear(C,e),eC.setDecoderPath=e=>{ec=e},e.s(["useGLTF",()=>eC],78140)},82816,e=>{"use strict";function t(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;nt])},25947,71505,6655,e=>{"use strict";var t=e.i(43476),r=e.i(932),s=e.i(71645);let n=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function i(e){return n.test(e)}let a=(0,s.createContext)(null);function o(){let e=(0,s.useContext)(a);if(!e)throw Error("useShapeInfo must be used within ShapeInfoProvider");return e}function A(e){let s,n,o,A=(0,r.c)(10),{children:l,object:B,shapeName:c,type:u}=e;A[0]!==c?(s=i(c),A[0]=c,A[1]=s):s=A[1];let C=s;A[2]!==C||A[3]!==B||A[4]!==c||A[5]!==u?(n={object:B,shapeName:c,type:u,isOrganic:C},A[2]=C,A[3]=B,A[4]=c,A[5]=u,A[6]=n):n=A[6];let h=n;return A[7]!==l||A[8]!==h?(o=(0,t.jsx)(a.Provider,{value:h,children:l}),A[7]=l,A[8]=h,A[9]=o):o=A[9],o}e.s(["ShapeInfoProvider",()=>A,"isOrganicShape",()=>i,"useShapeInfo",()=>o],25947);var l=e.i(47071);e.i(47167);var B=e.i(69230),c=e.i(69637),u=e.i(54440),C=e.i(90072),h=e.i(12979),d=e.i(75567),f=e.i(51475),m=e.i(79123);let p=1/30,M=new Map;function F(e){let t=e[0].image,r=t.width,s=t.height,n=e.length,i=Math.ceil(Math.sqrt(n)),a=Math.ceil(n/i),o=document.createElement("canvas");o.width=r*i,o.height=s*a;let A=o.getContext("2d");e.forEach((e,t)=>{let n=Math.floor(t/i);A.drawImage(e.image,t%i*r,n*s)});let l=new C.CanvasTexture(o);return l.colorSpace=C.SRGBColorSpace,l.generateMipmaps=!1,l.minFilter=C.NearestFilter,l.magFilter=C.NearestFilter,l.wrapS=C.ClampToEdgeWrapping,l.wrapT=C.ClampToEdgeWrapping,l.repeat.set(1/i,1/a),{texture:l,columns:i,rows:a,frameCount:n,frameOffsetSeconds:[],totalDurationSeconds:0,lastFrame:-1}}function E(e,t){let r=0;e.frameOffsetSeconds=t.map(e=>r+=e.frameCount*p),e.totalDurationSeconds=r}function G(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,s=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,s/e.rows)}function I(e,t){let r=e.totalDurationSeconds;if(r<=0)return 0;let s=t;s>r&&(s-=r*Math.floor(s/r));for(let t=0;t(0,h.iflTextureToUrl)(t.name,e)),n=F(await Promise.all(s.map(d.loadTextureAsync)));return E(n,r),M.set(e,n),n}function D(e){var t;let s,n,i,a,o=(0,r.c)(14),{animationEnabled:A}=(0,m.useSettings)();o[0]!==e?(s={queryKey:["ifl",e],queryFn:()=>(0,h.loadImageFrameList)(e)},o[0]=e,o[1]=s):s=o[1];let{data:C}=(t=s,(0,c.useBaseQuery)({...t,enabled:!0,suspense:!0,throwOnError:u.defaultThrowOnError,placeholderData:void 0},B.QueryObserver,void 0));if(o[2]!==C||o[3]!==e){let t;o[5]!==e?(t=t=>(0,h.iflTextureToUrl)(t.name,e),o[5]=e,o[6]=t):t=o[6],n=C.map(t),o[2]=C,o[3]=e,o[4]=n}else n=o[4];let d=n,p=(0,l.useTexture)(d);o[7]!==C||o[8]!==e||o[9]!==p?((i=M.get(e))||(i=F(p),M.set(e,i)),E(i,C),o[7]=C,o[8]=e,o[9]=p,o[10]=i):i=o[10];let g=i;return o[11]!==A||o[12]!==g?(a=e=>{let t=e/f.TICK_RATE,r=A?I(g,t):0;G(g,r)},o[11]=A,o[12]=g,o[13]=a):a=o[13],(0,f.useTick)(a),g.texture}e.s(["getFrameIndexForTime",()=>I,"loadIflAtlas",()=>g,"updateAtlasFrame",()=>G,"useIflTexture",()=>D],71505);function R(e){e.uniforms.shapeDirectionalFactor={value:1},e.uniforms.shapeAmbientFactor={value:1.5},e.fragmentShader=e.fragmentShader.replace("#include ",`#include +uniform float shapeDirectionalFactor; +uniform float shapeAmbientFactor; +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include + // Apply shape-specific lighting multipliers + reflectedLight.directDiffuse *= shapeDirectionalFactor; + reflectedLight.indirectDiffuse *= shapeAmbientFactor; +`)}e.s(["injectShapeLighting",()=>R],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"disposeClonedScene",()=>D,"entityTypeColor",()=>R,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1,o={}){let A=e.userData?.resource_path,l=new Set(e.userData?.flag_names??[]);if(!A){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(l.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,l,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,A,t,r)}}return{material:t,initialize:(e,r)=>I(t,A,e,r)}}let B=(0,a.textureToUrl)(A),c=(0,i.loadTexture)(B),u=l.has("Translucent");n||u?(0,i.setupTexture)(c,{disableMipmaps:!0,anisotropy:o.anisotropy}):(0,i.setupTexture)(c,{anisotropy:o.anisotropy});let C=(0,r.createMaterialFromFlags)(e,c,l,n,s);return Array.isArray(C)?{material:C[1],backMaterial:C[0]}:{material:C}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t,r={}){var n;let i,a=[],o=!!t&&(0,s.isOrganicShape)(t),A=null;e.traverse(e=>{!A&&e.skeleton&&(A=e.skeleton)});let l=A?(n=A,i=new Set,n.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&i.add(t)}),i):new Set,B=[];for(let{parent:t,mesh:s}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;(e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry&&(!function(e,t){if(0===t.size||!e.attributes.skinIndex)return;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index;if(!n)return;let i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(a)){i[e]=!0;break}}let a=[],o=n.array;for(let e=0;e1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(e.geometry));let s=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let n=G(t,s,o,r);if(n.initialize&&a.push({mesh:e,initialize:n.initialize}),n.backMaterial&&e.parent){let t=e.clone();t.material=n.backMaterial,B.push({parent:e.parent,mesh:t})}return n.material});else if(e.material){let t=G(e.material,s,o,r);if(t.initialize&&a.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,B.push({parent:e.parent,mesh:r})}}}),B))t.add(s);return a}function D(e){e.traverse(e=>{if(e.geometry&&e.geometry.dispose(),e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.dispose()})}function R(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapePlaceholder",()=>R,"ShapeRenderer",()=>b,"applyShapeShaderModifications",()=>I,"createMaterialFromFlags",()=>g,"useStaticShape",()=>D]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(25645),A=e.i(12979),l=e.i(90072),B=e.i(82816),c=(e.i(75567),e.i(56893)),u=e.i(79123),C=e.i(25947),h=e.i(58647),d=e.i(89887),f=e.i(71505),m=e.i(47021),p=e.i(48066),M=e.i(6655),F=e.i(85557);let E=(0,o.createLogger)("GenericShape");function G(){let{recording:e}=h.engineStore.getState().playback;return null!=e?(0,h.effectNow)()/1e3:performance.now()/1e3}function I(e){e.onBeforeCompile=t=>{(0,m.injectCustomFog)(t,p.globalFogUniforms),e instanceof l.MeshLambertMaterial&&(0,M.injectShapeLighting)(t)}}function g(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),A=r.has("SelfIlluminating"),B=n<1||i;if(A||o){let e=o||a||B,r=new l.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:l.AdditiveBlending}});return I(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new l.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new l.MeshLambertMaterial({...e,side:0});return I(r),I(s),[r,s]}let c=new l.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return I(c),c}function D(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,A.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function R(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(d.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function T(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,u.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(R,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let H=new Set(["octahedron.dts"]);function J(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,u.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(d.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let b=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:c,streamEntity:u,children:h}=e,d=void 0===c?"yellow":c,{object:f,shapeName:m}=(0,C.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(T,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(H.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(J,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(T,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(R,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==u?(o=(0,t.jsx)(L,{streamEntity:u}),B[8]=u,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),y=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,C.useShapeInfo)(),{debugMode:o}=(0,u.useDebug)(),{animationEnabled:A}=(0,u.useSettings)(),m=(0,h.useEngineSelector)(e=>e.runtime.runtime),p=(0,c.useAnisotropy)(),{clonedScene:M,mixer:I,clipsByName:g,visNodesBySequence:D,iflMeshes:R}=(0,s.useMemo)(()=>{let t=B.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,F.processShapeScene)(t,i??void 0,{anisotropy:p}),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new l.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e,p]);(0,s.useEffect)(()=>()=>{(0,F.disposeClonedScene)(M),I?.uncacheRoot(M)},[M,I]);let T=(0,s.useRef)(new Map),H=(0,s.useRef)(new Map),J=(0,s.useRef)([]),b=(0,s.useRef)(0);(0,s.useRef)(A).current=A;let y=(0,s.useRef)(r);y.current=r;let L=(0,s.useRef)(null),x=(0,s.useRef)(null),S=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(J.current=[],H.current.clear(),R))(0,f.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};J.current.push(s),H.current.set(e.mesh,t)}).catch(t=>{E.warn("Failed to load IFL atlas for %s: %o",e.iflPath,t)})},[R]);let O=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r{let e=T.current,t=null==y.current;function r(t,r){let n=r.toLowerCase();s(t);let i=g.get(n),a=D.get(n),o={sequence:n,startTime:G()};if(i&&I){let e=I.clipAction(i);O.get(n)??!0?e.setLoop(l.LoopRepeat,1/0):(e.setLoop(l.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,F.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=H.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(L.current=r,x.current=s,!t)return()=>{for(let t of(L.current=null,x.current=null,S.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(m&&(i.push(m.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(m.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(m.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(g.has(a)||D.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),L.current=null,x.current=null,S.current=void 0,[...e.keys()]))s(t)}},[I,g,D,O,n,m]);let U=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=T.current,s=null!=y.current,n=h.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=y.current?.threads,o=S.current;if(a!==o){let e=L.current,t=x.current;if(e&&t){S.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(b.current+=i,B)){if(!A){(0,f.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=G()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,f.updateAtlasFrame)(e.atlas,(0,f.getFrameIndexForTime)(e.atlas,t))}else(0,f.updateAtlasFrame)(e.atlas,(0,f.getFrameIndexForTime)(e.atlas,b.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:M}),o?(0,t.jsxs)(d.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function L(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,C.useShapeInfo)(),o=D(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(y,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/114146b21a4f5f3e.js b/docs/_next/static/chunks/63afa42c92661c50.js similarity index 96% rename from docs/_next/static/chunks/114146b21a4f5f3e.js rename to docs/_next/static/chunks/63afa42c92661c50.js index 4c264697..96f62314 100644 --- a/docs/_next/static/chunks/114146b21a4f5f3e.js +++ b/docs/_next/static/chunks/63afa42c92661c50.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9672,e=>{"use strict";function t(e,t){return e[t.toLowerCase()]}function s(e,s){let n=t(e,s);if(null==n)return;let i=parseFloat(n);return Number.isFinite(i)?i:void 0}function n(e,s){let n=t(e,s);if(null==n)return;let i=parseInt(n,10);return Number.isFinite(i)?i:void 0}function i(e,t={x:0,y:0,z:0}){if(!e)return t;let s=e.split(" ").map(Number);return{x:s[0]??t.x,y:s[1]??t.y,z:s[2]??t.z}}function r(e,t={r:0,g:0,b:0}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b}}function a(e,t={r:.5,g:.5,b:.5,a:1}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b,a:s[3]??t.a}}function o(e,t){let s=i(e),n=(t??"1 0 0 0").split(" ").map(Number),r=n[0]??1,a=n[1]??0,o=n[2]??0,l=Math.PI/180*(n[3]??0),c=Math.sqrt(r*r+a*a+o*o),u=0,m=0,d=1;c>1e-8&&(u=r/c,m=a/c,d=o/c);let h=Math.cos(l),p=Math.sin(l),g=1-h,y=Array(16).fill(0);return y[0]=g*u*u+h,y[1]=g*u*m+p*d,y[2]=g*u*d-p*m,y[4]=g*u*m-p*d,y[5]=g*m*m+h,y[6]=g*m*d+p*u,y[8]=g*u*d+p*m,y[9]=g*m*d-p*u,y[10]=g*d*d+h,y[12]=s.x,y[13]=s.y,y[14]=s.z,y[15]=1,{elements:y,position:s}}function l(e){return{className:"TerrainBlock",ghostIndex:e._id,terrFileName:t(e,"terrainFile")??"",detailTextureName:t(e,"detailTexture")??"",squareSize:n(e,"squareSize")??8,emptySquareRuns:function(e){if(!e)return;let t=e.split(/\s+/).map(Number).filter(Number.isFinite);return t.length>0?t:void 0}(t(e,"emptySquares"))}}function c(e){return{className:"InteriorInstance",ghostIndex:e._id,interiorFile:t(e,"interiorFile")??"",transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),showTerrainInside:"1"===t(e,"showTerrainInside"),skinBase:t(e,"skinBase")??"",alarmState:!1}}function u(e){let a=[];for(let s=1;s<=3;s++){let n=function(e){if(!e)return null;let t=e.split(/\s+/).map(Number),s=t[0]??0,n=t[1]??0,i=t[2]??0;return 0===s&&0===n&&0===i?null:{visibleDistance:s,minHeight:n,maxHeight:i,color:{r:.5,g:.5,b:.5}}}(t(e,`fogVolume${s}`));n&&a.push(n)}let o=[];for(let n=0;n<3;n++){let i=t(e,`cloudText${n+1}`)??"",r=s(e,`cloudHeightPer[${n}]`)??s(e,`cloudheightper${n}`)??[.35,.25,.2][n],a=s(e,`cloudSpeed${n+1}`)??[1e-4,2e-4,3e-4][n];o.push({texture:i,heightPercent:r,speed:a})}return{className:"Sky",ghostIndex:e._id,materialList:t(e,"materialList")??"",fogColor:r(t(e,"fogColor")),visibleDistance:s(e,"visibleDistance")??1e3,fogDistance:s(e,"fogDistance")??0,skySolidColor:r(t(e,"SkySolidColor")),useSkyTextures:(n(e,"useSkyTextures")??1)!==0,fogVolumes:a,cloudLayers:o,windVelocity:i(t(e,"windVelocity"))}}function m(e){return{className:"Sun",ghostIndex:e._id,direction:i(t(e,"direction"),{x:.57735,y:.57735,z:-.57735}),color:a(t(e,"color"),{r:.7,g:.7,b:.7,a:1}),ambient:a(t(e,"ambient"),{r:.5,g:.5,b:.5,a:1})}}function d(e){let n=t(e,"area"),i={x:-512,y:-512,w:1024,h:1024};if(n){let e=n.split(/\s+/).map(Number);i={x:e[0]??i.x,y:e[1]??i.y,w:e[2]??i.w,h:e[3]??i.h}}return{className:"MissionArea",ghostIndex:e._id,area:i,flightCeiling:s(e,"flightCeiling")??2e3,flightCeilingRange:s(e,"flightCeilingRange")??50}}function h(e){return{className:"WaterBlock",ghostIndex:e._id,transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),surfaceName:t(e,"surfaceTexture")??"",envMapName:t(e,"envMapTexture")??"",surfaceOpacity:s(e,"surfaceOpacity")??.75,waveMagnitude:s(e,"waveMagnitude")??1,envMapIntensity:s(e,"envMapIntensity")??1}}e.s(["interiorFromMis",()=>c,"missionAreaFromMis",()=>d,"skyFromMis",()=>u,"sunFromMis",()=>m,"terrainFromMis",()=>l,"waterBlockFromMis",()=>h])},70847,47566,63318,e=>{"use strict";let t=(0,e.i(25645).createLogger)("ghostToScene");function s(e,t={x:0,y:0,z:0}){return e&&"object"==typeof e&&"x"in e?e:t}function n(e,t={r:0,g:0,b:0}){return e&&"object"==typeof e&&"r"in e?e:t}function i(e,t={r:.5,g:.5,b:.5,a:1}){return e&&"object"==typeof e&&"r"in e?e:t}function r(e){if(e&&"object"==typeof e&&"elements"in e&&Array.isArray(e.elements))return e;if(e&&"object"==typeof e&&"position"in e&&"rotation"in e){let{position:t,rotation:s}=e,n=s.x*s.x,i=s.y*s.y,r=s.z*s.z,a=s.x*s.y,o=s.x*s.z,l=s.y*s.z,c=s.w*s.x,u=s.w*s.y,m=s.w*s.z;return{elements:[1-2*(i+r),2*(a+m),2*(o-u),0,2*(a-m),1-2*(n+r),2*(l+c),0,2*(o+u),2*(l-c),1-2*(n+i),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function a(e,a,o){let l;switch(e){case"TerrainBlock":return l={className:"TerrainBlock",ghostIndex:a,terrFileName:o.terrFileName??"",detailTextureName:o.detailTextureName??"",squareSize:o.squareSize??8,emptySquareRuns:o.emptySquareRuns},t.debug("TerrainBlock #%d: terrFileName=%s",a,l.terrFileName),l;case"InteriorInstance":return l={className:"InteriorInstance",ghostIndex:a,interiorFile:o.interiorFile??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),showTerrainInside:o.showTerrainInside??!1,skinBase:o.skinBase??"",alarmState:o.alarmState??!1},t.debug("InteriorInstance #%d: interiorFile=%s",a,l.interiorFile),l;case"TSStatic":return{className:"TSStatic",ghostIndex:a,shapeName:o.shapeName??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1})};case"Sky":{let e,i;e=Array.isArray(o.fogVolumes)?o.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:n(e.color)})):[],i=Array.isArray(o.cloudLayers)?o.cloudLayers.map(e=>({texture:e.texture??"",heightPercent:e.heightPercent??0,speed:e.speed??0})):[];let r=l={className:"Sky",ghostIndex:a,materialList:o.materialList??"",fogColor:n(o.fogColor),visibleDistance:o.visibleDistance??1e3,fogDistance:o.fogDistance??0,skySolidColor:n(o.skySolidColor),useSkyTextures:o.useSkyTextures??!0,fogVolumes:e,cloudLayers:i,windVelocity:s(o.windVelocity)};return t.debug("Sky #%d: materialList=%s fogColor=(%s, %s, %s) visibleDist=%d fogDist=%d useSkyTextures=%s",a,r.materialList,r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,r.useSkyTextures),l}case"Sun":{let e=l={className:"Sun",ghostIndex:a,direction:s(o.direction,{x:.57735,y:.57735,z:-.57735}),color:i(o.color,{r:.7,g:.7,b:.7,a:1}),ambient:i(o.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(o.textures)?o.textures:void 0};return t.debug("Sun #%d: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",a,e.direction.x.toFixed(3),e.direction.y.toFixed(3),e.direction.z.toFixed(3),e.color.r.toFixed(3),e.color.g.toFixed(3),e.color.b.toFixed(3),e.ambient.r.toFixed(3),e.ambient.g.toFixed(3),e.ambient.b.toFixed(3)),l}case"MissionArea":return{className:"MissionArea",ghostIndex:a,area:o.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:o.flightCeiling??2e3,flightCeilingRange:o.flightCeilingRange??50};case"WaterBlock":return{className:"WaterBlock",ghostIndex:a,transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),surfaceName:o.surfaceName??"",envMapName:o.envMapName??"",surfaceOpacity:o.surfaceOpacity??.75,waveMagnitude:o.waveMagnitude??1,envMapIntensity:o.envMapIntensity??1};default:return null}}e.s(["ghostToSceneObject",()=>a],47566),e.i(9672);var o=e.i(90072);function l(e){return[e.y,e.z,e.x]}function c(e){return[e.y,e.z,e.x]}function u(e){let t=e.elements,s=new o.Matrix4,n=s.elements;n[0]=t[5],n[1]=t[6],n[2]=t[4],n[3]=0,n[4]=t[9],n[5]=t[10],n[6]=t[8],n[7]=0,n[8]=t[1],n[9]=t[2],n[10]=t[0],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1;let i=new o.Quaternion;return i.setFromRotationMatrix(s),i.conjugate(),i}e.s(["matrixFToQuaternion",()=>u,"torqueScaleToThree",()=>c,"torqueToThree",()=>l],63318),e.s([],70847)},92224,e=>{"use strict";e.i(932);var t=e.i(8155),s=e.i(66748),n=e.i(62395);let i=(0,t.createStore)()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:0,setEntity(t){e(e=>{let s=new Map(e.missionEntities);return s.set(t.id,t),{missionEntities:s,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let s=new Map(e.missionEntities);return s.delete(t),{missionEntities:s,version:e.version+1}})},setEntities(t){e(e=>{let s=new Map(e.missionEntities);for(let e of t)s.set(e.id,e);return{missionEntities:s,version:e.version+1}})},setAllEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);return{missionEntities:s,dataSource:e.isStreaming?e.dataSource:"map"}})},clearEntities(){e(e=>0===e.missionEntities.size?e:e.isStreaming?{missionEntities:new Map,version:e.version+1}:{missionEntities:new Map,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1})},setMissionInfo(t){let s={};if(void 0!==t.missionName&&(s.missionName=t.missionName),void 0!==t.missionType&&(s.missionType=t.missionType),void 0!==t.missionTypeDisplayName&&(s.missionTypeDisplayName=t.missionTypeDisplayName),void 0!==t.missionDisplayName&&(s.missionDisplayName=t.missionDisplayName),void 0!==t.gameClassName&&(s.gameClassName=t.gameClassName,void 0===t.missionType))if(t.gameClassName){let e=t.gameClassName.replace(/Game$/i,"");s.missionType=n.normalizedMissionTypes[e.toLowerCase()]??e}else s.missionType=null;void 0!==t.serverDisplayName&&(s.serverDisplayName=t.serverDisplayName),void 0!==t.recorderName&&(s.recorderName=t.recorderName),void 0!==t.recordingDate&&(s.recordingDate=t.recordingDate),e(e=>({...s,version:e.version+1}))},beginStreaming(t){e(e=>({isStreaming:!0,dataSource:t,streamEntities:new Map,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1}))},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,dataSource:e.missionEntities.size>0?"map":null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let s=new Map(e.streamEntities);return s.set(t.id,t),{streamEntities:s,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let s=new Map(e.streamEntities);return s.delete(t),{streamEntities:s,version:e.version+1}})},setStreamEntities(t){e(e=>{let s=new Map(e.streamEntities);for(let e of t)s.set(e.id,e);return{streamEntities:s,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);let n=e.streamEntities;return s.size===n.size&&[...s.keys()].every(e=>n.has(e))?e:{streamEntities:s,version:e.version+1}})},clearStreamEntities(){e(e=>0===e.streamEntities.size?e:{streamEntities:new Map,version:e.version+1})}}));function r(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,s=[];for(let e of t.values())"None"!==e.renderType&&s.push(e);return s}function a(e,t){if(e.length!==t.length)return!1;for(let s=0;so,"useDataSource",()=>d,"useMissionDisplayName",()=>k,"useMissionName",()=>p,"useMissionType",()=>y,"useMissionTypeDisplayName",()=>v,"useRecorderName",()=>N,"useRecordingDate",()=>x,"useSceneSky",()=>u,"useSceneSun",()=>m,"useServerDisplayName",()=>E])},98755,e=>{"use strict";e.i(47167);var t=e.i(8155),s=e.i(66748),n=e.i(25645);let i=(0,n.createLogger)("relayClient");class r{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{i.info("WebSocket connected to %s",this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){i.error("Failed to parse relay message: %o",e)}},this.ws.onclose=()=>{i.info("WebSocket disconnected"),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{i.error("WebSocket error"),this.handlers.onError?.("WebSocket connection error")}}handleMessage(e){switch(e.type){case"serverList":this.handlers.onServerList?.(e.servers);break;case"status":this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case"ping":this.handlers.onPing?.(e.ms);break;case"wsPong":{let t=Date.now()-e.ts;this.smoothedWsPing=0===this.smoothedWsPing?t:.5*this.smoothedWsPing+.5*t,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case"error":this.handlers.onError?.(e.message)}}listServers(){this.send({type:"listServers"})}sendWsPing(){this.send({type:"wsPing",ts:Date.now()})}joinServer(e,t){i.info("Joining server: %s",e),this.send({type:"joinServer",address:e,warriorName:t})}disconnectServer(){this.send({type:"disconnect"})}sendAuthEvent(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCommand(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCRCResponse(e,t,s){this.send({type:"sendCRCResponse",crcValue:e,field1:t,field2:s})}sendCRCCompute(e,t,s,n){this.send({type:"sendCRCCompute",seed:e,field2:t,includeTextures:n,datablocks:s})}sendGhostAck(e,t){this.send({type:"sendGhostAck",sequence:e,ghostCount:t})}sendMove(e){this.send({type:"sendMove",move:e})}close(){this.stopWsPing(),this.ws&&(this.ws.close(),this.ws=null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:"wsPing",ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:"wsPing",ts:Date.now()})},7e3)}stopWsPing(){null!=this.wsPingInterval&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):i.warn("send dropped (ws not open): %s",e.type)}}e.i(91891);var a=e.i(94802),o=e.i(89119),l=e.i(10244);let c=(0,n.createLogger)("liveStreaming");class u extends l.StreamEngine{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;dataBlockClassNames=new Map;onReady;onMissionChange;missionName=null;constructor(e){super(),this.relay=e;const{registry:t,ghostTracker:s,packetParser:n}=(0,a.createLiveParser)();this.packetParser=n,this.ghostTracker=s,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,s=e.sequences;t&&s&&this._shapeConstructorCache.set(t.toLowerCase(),s)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,s]of t){let n=s.explosion;if(null==n)continue;let i=t.get(n);i?.dtsFileName&&e.add(i.dtsFileName)}return[...e]}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this.dataBlockClassNames.clear(),this.observerMode="fly",this.missionName=null}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:0x1fffffff,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if("RemoteCommandEvent"!==e.type)return;let t=e.funcName;if(!t)return;let s=this.resolveNetString(t);if(["t2csri_pokeClient","t2csri_getChallengeChunk","t2csri_decryptChallenge"].includes(s)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>""!==e);c.info("auth event: %s %o",s,t),this.relay.sendAuthEvent(s,t);return}let n=(e.args??[]).map(e=>this.resolveNetString(e));if("MissionStartPhase1"===s){let e=n[0]??"",t=n[1]??null;c.info("mission phase 1, seq=%s mission=%s resolvedArgs=%o",e,t,n),t&&t!==this.missionName&&(this.missionName=t,this.entities.clear(),this.entityIdByGhostIndex.clear(),this._ready=!1,this._snapshot=null,this._snapshotTick=-1,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.onMissionChange?.(t)),this.relay.sendCommand("MissionStartPhase1Done",[e])}else if("MissionStartPhase2"===s){let e=n[0]??"";c.info("mission phase 2 (datablocks), seq=%s",e),this.relay.sendCommand("MissionStartPhase2Done",[e])}else if("MissionStartPhase3"===s){let e=n[0]??"",t=n[1]??null;c.info("mission phase 3 (ghosting), seq=%s mission=%s",e,t),t&&(this.missionName=t),this.relay.sendCommand("setClientFav",[""]),this.relay.sendCommand("MissionStartPhase3Done",[e])}}handleCRCChallenge(e){if("CRCChallengeEvent"!==e.type)return;let t=e.crcValue,s=e.field1,n=e.field2,i=(1&s)!=0;c.info("CRC challenge: seed=0x%s f1=0x%s f2=0x%s includeTextures=%s",(t>>>0).toString(16),(s>>>0).toString(16),(n>>>0).toString(16),i);let r=this.packetParser.getDataBlockDataMap(),a=[];if(r)for(let[e,t]of r){let s=this.dataBlockClassNames.get(e);if(!s)continue;let n=(0,o.resolveShapeName)(s,t);a.push({objectId:e,className:s,shapeName:n??""})}c.info("CRC: sending %d datablocks for computation",a.length),this.relay.sendCRCCompute(t,n,a,i)}handleGhostingMessage(e){if("GhostingMessageEvent"!==e.type)return;let t=e.message,s=e.sequence,n=e.ghostCount;c.info("GhostingMessageEvent: message=%d sequence=%d ghostCount=%d",t,s,n),0===t&&(c.info("Sending ghost ack (type 1) for sequence %d",s),this.relay.sendGhostAck(s,n))}observerMode="fly";cycleObserveNext(){"fly"===this.observerMode?(c.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(c.info("observer: cycle next (fire trigger)"),this.sendTrigger(0))}toggleObserverMode(){"fly"===this.observerMode?(c.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(c.info("observer: follow → fly (jump trigger)"),this.sendTrigger(2),this.observerMode="fly")}sendTrigger(e){let t=[!1,!1,!1,!1,!1,!1];t[e]=!0,this.relay.sendMove({x:0,y:0,z:0,yaw:0,pitch:0,roll:0,trigger:t,freeLook:!1})}getPlayerList(){let e=[];for(let[t,s]of this.targetNames){let n=this.targetTeams.get(t)??0;e.push({targetId:t,name:s,sensorGroup:n})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,s=this.packetParser.protocolNoDispatch,n=this.packetParser.parsePacket(e),i=this.packetParser.protocolRejected>t,r=this.packetParser.protocolNoDispatch>s;(i||r)&&c.warn("packet #%d %s: %d bytes (total rejected=%d, noDispatch=%d)",this.tickCount,i?"REJECTED":"no-dispatch",e.length,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch);let a=this.tickCount<20,l=this.tickCount%100==0,u=a||l;for(let t of(u&&c.debug("packet #%d: %d events, %d ghosts, %d bytes%s%s",this.tickCount,n.events.length,n.ghosts.length,e.length,void 0!==n.gameState.controlObjectGhostIndex?`, control=${n.gameState.controlObjectGhostIndex}`:"",void 0!==n.gameState.cameraFov?`, fov=${n.gameState.cameraFov}`:""),this.processControlObject(n.gameState),n.events))if(t.parsedData){this.handleRelayCommands(t.parsedData),this.handleCRCChallenge(t.parsedData),this.handleGhostingMessage(t.parsedData);let e=t.parsedData.type;if("RemoteCommandEvent"===e){let e=this.resolveNetString(t.parsedData.funcName??"");c.debug("remote: %s",e)}if(a&&"NetStringEvent"!==e&&"RemoteCommandEvent"!==e&&c.debug("event: %s%s",e,"SimDataBlockEvent"===e?` id=${t.parsedData.objectId} class=${t.parsedData.dataBlockClassName}`:""),"SimDataBlockEvent"===e){let e=t.parsedData.objectId,s=t.parsedData.dataBlockClassName;if(null!=e&&s&&this.dataBlockClassNames.set(e,s),u){let n=t.parsedData.dataBlockData,i=(0,o.resolveShapeName)(s??"",n);c.debug("datablock: id=%d class=%s%s",e,s??"?",i?` shape=${i}`:"")}}let s=this.registry.getEventParser(t.classId)?.name;if(this.processEvent(t,s),a&&"NetStringEvent"===e){let e=t.parsedData.id,s=t.parsedData.value;null!=e&&"string"==typeof s&&c.trace('netString #%d = "%s"',e,s.length>60?s.slice(0,60)+"…":s)}if("TargetInfoEvent"===e){let e=t.parsedData.targetId,s=t.parsedData.nameTag;if(null!=e&&null!=s){let n=this.netStrings.get(s);if(n){let s=(0,o.stripTaggedStringMarkup)(n);c.info('target #%d: "%s" team=%s',e,s,t.parsedData.sensorGroup??"?")}}}if("SetSensorGroupEvent"===e){let e=t.parsedData.sensorGroup;null!=e&&c.info("sensor group changed: → %d",e)}if("SensorGroupColorEvent"===e){let e=t.parsedData.sensorGroup,s=t.parsedData.colors;s&&c.debug("sensor group colors: group=%d, %d entries",e,s.length)}}for(let e of n.ghosts){if("create"===e.type){let t=e.parsedData?.position,s=t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z,n=this.resolveGhostClassName(e.index,e.classId);c.debug("ghost create: #%d %s%s (%d entities total)",e.index,n??"?",s?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:"",this.entities.size+1),this._ready||(this._ready=!0,this.onReady?.())}else if("delete"===e.type){let t=this.entityIdByGhostIndex.get(e.index),s=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&c.debug("ghost delete: #%d %s (%d entities remaining)",e.index,s?.className??"?",this.entities.size-1)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),l&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();c.info("status @ tick %d: %d entities, %d datablocks, rejected=%d, noDispatch=%d",this.tickCount,this.entities.size,e?.size??0,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch)}let m=this.entities.size;if(1===this.tickCount||m>0&&m%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(" ");c.info("entity count: %d (%s)",m,t)}let d=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==d&&c.info("camera mode: %s → %s%s",d??"none",this.camera.mode,"third-person"===this.camera.mode?` orbit=${this.camera.orbitTargetId??"?"} dist=${this.camera.orbitDistance??"?"}`:""),this.tickCount<=5&&this.camera){let[e,t,s]=this.camera.position;c.debug("camera: mode=%s pos=(%s, %s, %s) fov=%s",this.camera.mode,e.toFixed(1),t.toFixed(1),s.toFixed(1),this.camera.fov)}}catch(s){let t={tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced};c.error("Failed to process live packet: %o %o",s,t)}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:s,audioEvents:n}=this.buildTimeFilteredEvents(t),{weaponsHud:i,inventoryHud:r,backpackHud:a,teamScores:o}=this.buildHudState();this.camera||(this.camera={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:"observer"});let l={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:s,audioEvents:n,weaponsHud:i,backpackHud:a,inventoryHud:r,teamScores:o};return this._snapshot=l,this._snapshotTick=this.tickCount,l}}var m=e.i(92224);let d=(0,n.createLogger)("liveConnectionStore"),h="wss://t2-relay.fly.dev",p=(0,t.createStore)((e,t)=>({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(s=h){let n=t();n._relay&&n._relay.close();let i=new r(s,{onOpen(){e({relayConnected:!0});let s=t();for(let e of s._pending)e();s._pending=[]},onStatus(t,s,n,i){d.info("game status: %s%s%s",t,s?` — ${s}`:"",i?` map=${i}`:""),e({gameStatus:t,gameStatusMessage:s,...i?{mapName:i}:{}})},onServerList(s){t()._listInFlight=!1,e({servers:s,serversLoading:!1})},onGamePacket(e){let s=t()._adapter;s||d.warn("received game packet but no adapter is active"),s?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(s){d.error("error: %s",s),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let s=t();s._relay===i&&(s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let s=t();s._relay?.close(),s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let s=t();if(s._listInFlight)return;s._listInFlight=!0;let n=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),s._relay?.connected?n():(s._pending.push(n),s._relay||t().connectRelay())},joinServer(s,n){let i=t();if(!i._relay)return;let r=i.servers.find(e=>e.address===s),a=new u(i._relay);a.onReady=()=>e({liveReady:!0}),a.onMissionChange=t=>{d.info("mission changed: %s",t),e({mapName:t,liveReady:!1}),m.gameEntityStore.getState().setMissionInfo({missionName:t,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null})},a.onMissionInfoChange=()=>{m.gameEntityStore.getState().setMissionInfo({missionDisplayName:a.missionDisplayName??void 0,missionTypeDisplayName:a.missionTypeDisplayName??void 0,gameClassName:a.gameClassName??void 0,serverDisplayName:a.serverDisplayName??void 0,recorderName:a.connectedPlayerName??void 0})},i._adapter=a,e({mapName:r?.mapName??i.mapName,serverName:r?.name,warriorName:n,liveReady:!1,gameStatus:null,adapter:a}),m.gameEntityStore.getState().setMissionInfo({missionName:r?.mapName??void 0,missionTypeDisplayName:r?.gameType??void 0,serverDisplayName:r?.name??void 0,recorderName:n??void 0}),i._relay.joinServer(s,n)},disconnectServer(){let s=t();s._relay?.disconnectServer(),s._adapter=null,e({adapter:null,liveReady:!1,gameStatus:null,mapName:void 0,serverName:void 0,relayToGameServerPing:null})},sendMove(e){t()._relay?.sendMove(e)},sendCommand(e,...s){t()._relay?.sendCommand(e,s)}}));function g(e,t){return(0,s.useStoreWithEqualityFn)(p,e,t)}function y(e){return null!=e.relayToGameServerPing&&null!=e.browserToRelayPing?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}e.s(["liveConnectionStore",0,p,"selectPing",()=>y,"useLiveSelector",()=>g],98755)},66027,e=>{"use strict";var t=e.i(69230),s=e.i(69637);function n(e,n){return(0,s.useBaseQuery)(e,t.QueryObserver,n)}e.s(["useQuery",()=>n])},66093,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,n.createContext)(null);function r(){let e=(0,n.useContext)(i);if(!e)throw Error("No JoystickContext found. Did you forget to add a ?");return e}function a(e){let r,a,o,l,c,u,m=(0,s.c)(7),{children:d}=e;m[0]===Symbol.for("react.memo_cache_sentinel")?(r={angle:0,force:0},m[0]=r):r=m[0];let h=(0,n.useRef)(r);m[1]===Symbol.for("react.memo_cache_sentinel")?(a={angle:0,force:0},m[1]=a):a=m[1];let p=(0,n.useRef)(a);m[2]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{let{angle:t,force:s}=e;null!=t&&(h.current.angle=t),null!=s&&(h.current.force=s)},m[2]=o):o=m[2];let g=o;m[3]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let{angle:t,force:s}=e;null!=t&&(p.current.angle=t),null!=s&&(p.current.force=s)},m[3]=l):l=m[3];let y=l;m[4]===Symbol.for("react.memo_cache_sentinel")?(c={moveState:h,lookState:p,setMoveState:g,setLookState:y},m[4]=c):c=m[4];let f=c;return m[5]!==d?(u=(0,t.jsx)(i,{value:f,children:d}),m[5]=d,m[6]=u):u=m[6],u}e.s(["JoystickProvider",()=>a,"useJoystick",()=>r])},32865,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(58647);function i(e){let n,i=(0,s.c)(2),{children:r}=e;return i[0]!==r?(n=(0,t.jsx)(t.Fragment,{children:r}),i[0]=r,i[1]=n):n=i[1],n}function r(){return(0,n.useEngineSelector)(a)}function a(e){return e.playback.recording}function o(){return(0,n.useEngineSelector)(l)}function l(e){return"playing"===e.playback.status}function c(){return(0,n.useEngineSelector)(u)}function u(e){return e.playback.timeMs/1e3}function m(){return(0,n.useEngineSelector)(d)}function d(e){return e.playback.durationMs/1e3}function h(){return(0,n.useEngineSelector)(p)}function p(e){return e.playback.rate}function g(){let e,t,i,a,o,l,c=(0,s.c)(17),u=r(),m=(0,n.useEngineSelector)(S),d=(0,n.useEngineSelector)(v),h=(0,n.useEngineSelector)(f),p=(0,n.useEngineSelector)(y);c[0]!==m?(e=e=>{m(e)},c[0]=m,c[1]=e):e=c[1];let g=e;c[2]!==u||c[3]!==d?(t=()=>{u&&d("playing")},c[2]=u,c[3]=d,c[4]=t):t=c[4];let k=t;c[5]!==d?(i=()=>{d("paused")},c[5]=d,c[6]=i):i=c[6];let b=i;c[7]!==h?(a=e=>{h(1e3*e)},c[7]=h,c[8]=a):a=c[8];let E=a;c[9]!==p?(o=e=>{p(e)},c[9]=p,c[10]=o):o=c[10];let C=o;return c[11]!==b||c[12]!==k||c[13]!==E||c[14]!==g||c[15]!==C?(l={setRecording:g,play:k,pause:b,seek:E,setSpeed:C},c[11]=b,c[12]=k,c[13]=E,c[14]=g,c[15]=C,c[16]=l):l=c[16],l}function y(e){return e.setPlaybackRate}function f(e){return e.setPlaybackTime}function v(e){return e.setPlaybackStatus}function S(e){return e.setRecording}e.s(["RecordingProvider",()=>i,"useCurrentTime",()=>c,"useDuration",()=>m,"useIsPlaying",()=>o,"usePlaybackActions",()=>g,"useRecording",()=>r,"useSpeed",()=>h])},51434,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645),i=e.i(15080),r=e.i(90072),a=e.i(58647),o=e.i(79123);let l=(0,n.createContext)(void 0);function c(e){let c,h,p,g,y,f,v=(0,s.c)(11),{children:S}=e,k=(0,i.useThree)(d),{audioVolume:b}=(0,o.useSettings)();v[0]===Symbol.for("react.memo_cache_sentinel")?(c={audioLoader:null,audioListener:null},v[0]=c):c=v[0];let[E,C]=(0,n.useState)(c);return v[1]!==k?(h=()=>{let e=new r.AudioLoader,t=k.children.find(m);t||(t=new r.AudioListener,k.add(t)),C({audioLoader:e,audioListener:t});let s=()=>{let e=t.context;e&&"suspended"===e.state&&e.resume().finally(()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),document.removeEventListener("touchend",s)})};document.addEventListener("click",s),document.addEventListener("keydown",s),document.addEventListener("touchend",s);let n=a.engineStore.subscribe(u,e=>{let s=t.context;s&&("paused"===e?s.suspend():"suspended"===s.state&&s.resume())});return()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),document.removeEventListener("touchend",s),n(),t&&k.remove(t)}},p=[k],v[1]=k,v[2]=h,v[3]=p):(h=v[2],p=v[3]),(0,n.useEffect)(h,p),v[4]!==E.audioListener||v[5]!==b?(g=()=>{E.audioListener?.setMasterVolume(b)},y=[b,E.audioListener],v[4]=E.audioListener,v[5]=b,v[6]=g,v[7]=y):(g=v[6],y=v[7]),(0,n.useEffect)(g,y),v[8]!==E||v[9]!==S?(f=(0,t.jsx)(l.Provider,{value:E,children:S}),v[8]=E,v[9]=S,v[10]=f):f=v[10],f}function u(e){return e.playback.status}function m(e){return e instanceof r.AudioListener}function d(e){return e.camera}function h(){let e=(0,n.useContext)(l);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>c,"useAudio",()=>h])},93784,e=>{"use strict";let t=(0,e.i(8155).createStore)()(()=>({time:0,playback:null,root:null,freeFlyCamera:!1,entities:new Map}));function s(){t.setState({time:0,playback:null,freeFlyCamera:!1})}e.s(["resetStreamPlayback",()=>s,"streamPlaybackStore",0,t])},46325,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,e.i(25645).createLogger)("DebugSuspense");function r(e){let i,r,l,c=(0,s.c)(10),{name:u,fallback:m,children:d}=e,h=void 0===m?null:m;return c[0]!==h||c[1]!==u?(i=(0,t.jsx)(a,{name:u,children:h}),c[0]=h,c[1]=u,c[2]=i):i=c[2],c[3]!==u?(r=(0,t.jsx)(o,{name:u}),c[3]=u,c[4]=r):r=c[4],c[5]!==d||c[6]!==u||c[7]!==i||c[8]!==r?(l=(0,t.jsxs)(n.Suspense,{name:u,fallback:i,children:[r,d]}),c[5]=d,c[6]=u,c[7]=i,c[8]=r,c[9]=l):l=c[9],l}function a(e){let t,r,a=(0,s.c)(3),{name:o,children:l}=e;return a[0]!==o?(t=()=>{i.debug("🛑 SUSPENDED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),l}function o(e){let t,r,a=(0,s.c)(3),{name:o}=e;return a[0]!==o?(t=()=>{i.debug("✅ RESOLVED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),null}e.s(["DebugSuspense",()=>r])},31999,e=>{"use strict";var t=e.i(71645);let s=(0,e.i(25645).createLogger)("ShapeErrorBoundary");class n extends t.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){s.error("Shape load failed: %s %s",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}e.s(["ShapeErrorBoundary",()=>n])},77964,e=>{"use strict";function t(e){switch(e.renderType){case"TerrainBlock":case"InteriorInstance":case"Sky":case"Sun":case"WaterBlock":case"MissionArea":return!0;default:return!1}}e.s(["isSceneEntity",()=>t])},12631,e=>{"use strict";var t=e.i(71645),s=e.i(8155);let n=e=>{let n=(0,s.createStore)(e),i=e=>(function(e,s=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>s(e.getState()),[e,s]),t.default.useCallback(()=>s(e.getInitialState()),[e,s]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(i,n),i};var i=e.i(79473);let r=t.createContext(null);function a({map:e,children:s,onChange:a,domElement:o}){let l=e.map(e=>e.name+e.keys).join("-"),c=t.useMemo(()=>{let t;return(t=(0,i.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?n(t):n},[l]),u=t.useMemo(()=>[c.subscribe,c.getState,c],[l]),m=c.setState;return t.useEffect(()=>{let t=e.map(({name:e,keys:t,up:s})=>({keys:t,up:s,fn:t=>{m({[e]:t}),a&&a(e,t,u[1]())}})).reduce((e,{keys:t,fn:s,up:n=!0})=>(t.forEach(t=>e[t]={fn:s,pressed:!1,up:n}),e),{}),s=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,pressed:r,up:a}=n;n.pressed=!0,(a||!r)&&i(!0)},n=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,up:r}=n;n.pressed=!1,r&&i(!1)},i=o||window;return i.addEventListener("keydown",s,{passive:!0}),i.addEventListener("keyup",n,{passive:!0}),()=>{i.removeEventListener("keydown",s),i.removeEventListener("keyup",n)}},[o,l]),t.createElement(r.Provider,{value:u,children:s})}function o(e){let[s,n,i]=t.useContext(r);return e?i(e):[s,n]}e.s(["KeyboardControls",()=>a,"useKeyboardControls",()=>o],12631)},85413,e=>{"use strict";var t=Object.defineProperty;class s{constructor(){((e,s,n)=>{let i,r;r=void 0,(i="symbol"!=typeof s?s+"":s)in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let s=this._listeners;void 0===s[e]&&(s[e]=[]),-1===s[e].indexOf(t)&&s[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let s=this._listeners;return void 0!==s[e]&&-1!==s[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let s=this._listeners[e];if(void 0!==s){let e=s.indexOf(t);-1!==e&&s.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 s=t.slice(0);for(let t=0,n=s.length;ts])},68294,e=>{"use strict";var t=e.i(43476),s=e.i(90072),n=e.i(15080),i=e.i(71645);let r=(0,i.createContext)(null);function a(){let e=(0,i.useContext)(r);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function o({children:e}){let a=(0,n.useThree)(e=>e.camera),[o,l]=(0,i.useState)(-1),[c,u]=(0,i.useState)({}),[m,d]=(0,i.useState)(()=>({initialized:!1,position:null,quarternion:null})),h=(0,i.useCallback)(e=>{u(t=>({...t,[e.id]:e}))},[]),p=(0,i.useCallback)(e=>{u(t=>{let{[e.id]:s,...n}=t;return n})},[]),g=Object.keys(c).length,y=(0,i.useCallback)(e=>{if(e>=0&&e{y(g?(o+1)%g:-1)},[g,o,y]);(0,i.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,n]=e.slice(2).split("~"),i=t.split(",").map(e=>parseFloat(e)),r=n.split(",").map(e=>parseFloat(e));d({initialized:!0,position:new s.Vector3(...i),quarternion:new s.Quaternion(...r)})}else d({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,i.useEffect)(()=>{m.initialized&&m.position&&(a.position.copy(m.position),m.quarternion&&a.quaternion.copy(m.quarternion))},[a,m]),(0,i.useEffect)(()=>{m.initialized&&!m.position&&g>0&&-1===o&&y(0)},[g,y,o,m]);let v=(0,i.useMemo)(()=>({registerCamera:h,unregisterCamera:p,nextCamera:f,setCameraIndex:y,cameraCount:g}),[h,p,f,y,g]);return 0===g&&-1!==o&&l(-1),(0,t.jsx)(r.Provider,{value:v,children:e})}e.s(["CamerasProvider",()=>o,"useCameras",()=>a])},26747,e=>{"use strict";var t=e.i(90072),s=e.i(85413),n=Object.defineProperty,i=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?n(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,s};let r=new t.Euler(0,0,0,"YXZ"),a=new t.Vector3,o={type:"change"},l={type:"lock"},c={type:"unlock"},u=Math.PI/2;class m extends s.EventDispatcher{constructor(e,s){super(),i(this,"camera"),i(this,"domElement"),i(this,"isLocked"),i(this,"minPolarAngle"),i(this,"maxPolarAngle"),i(this,"pointerSpeed"),i(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(r.setFromQuaternion(this.camera.quaternion),r.y-=.002*e.movementX*this.pointerSpeed,r.x-=.002*e.movementY*this.pointerSpeed,r.x=Math.max(u-this.maxPolarAngle,Math.min(u-this.minPolarAngle,r.x)),this.camera.quaternion.setFromEuler(r),this.dispatchEvent(o))}),i(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(l),this.isLocked=!0):(this.dispatchEvent(c),this.isLocked=!1))}),i(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),i(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))}),i(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))}),i(this,"dispose",()=>{this.disconnect()}),i(this,"getObject",()=>this.camera),i(this,"direction",new t.Vector3(0,0,-1)),i(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),i(this,"moveForward",e=>{a.setFromMatrixColumn(this.camera.matrix,0),a.crossVectors(this.camera.up,a),this.camera.position.addScaledVector(a,e)}),i(this,"moveRight",e=>{a.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(a,e)}),i(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),i(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=s,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,s&&this.connect(s)}}e.s(["PointerLockControls",()=>m])},205,e=>{"use strict";var t=e.i(932),s=e.i(71645),n=e.i(90072),i=e.i(71753),r=e.i(15080),a=e.i(12631),o=e.i(26747),l=e.i(79123),c=e.i(68294),u=e.i(93784);let m=Math.PI/2-.01;function d(){let e,d,y,f,v,S,k,b,E,C,N,w,x,D,P,M,T=(0,t.c)(38);T[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],T[0]=e):e=T[0],(0,s.useEffect)(g,e);let{speedMultiplier:_,setSpeedMultiplier:L,invertScroll:F,invertDrag:I}=(0,l.useControls)(),[R,j]=(0,a.useKeyboardControls)(),A=(0,r.useThree)(p),q=(0,r.useThree)(h),{nextCamera:z,setCameraIndex:W,cameraCount:B}=(0,c.useCameras)(),G=(0,s.useRef)(null);T[1]!==F?(d=()=>F,T[1]=F,T[2]=d):d=T[2];let O=(0,s.useEffectEvent)(d);T[3]!==I?(y=()=>I,T[3]=I,T[4]=y):y=T[4];let V=(0,s.useEffectEvent)(y);T[5]===Symbol.for("react.memo_cache_sentinel")?(f=new n.Vector3,T[5]=f):f=T[5];let $=(0,s.useRef)(f);T[6]===Symbol.for("react.memo_cache_sentinel")?(v=new n.Vector3,T[6]=v):v=T[6];let K=(0,s.useRef)(v);T[7]===Symbol.for("react.memo_cache_sentinel")?(S=new n.Vector3,T[7]=S):S=T[7];let Y=(0,s.useRef)(S);T[8]===Symbol.for("react.memo_cache_sentinel")?(k=new n.Euler(0,0,0,"YXZ"),T[8]=k):k=T[8];let H=(0,s.useRef)(k);return T[9]!==A||T[10]!==q.domElement?(b=()=>{let e=new o.PointerLockControls(A,q.domElement);return G.current=e,()=>{e.dispose()}},E=[A,q.domElement],T[9]=A,T[10]=q.domElement,T[11]=b,T[12]=E):(b=T[11],E=T[12]),(0,s.useEffect)(b,E),T[13]!==A||T[14]!==V||T[15]!==q.domElement||T[16]!==z?(C=()=>{let e=q.domElement,t=new n.Euler(0,0,0,"YXZ"),s=!1,i=!1,r=0,a=0,o=t=>{G.current?.isLocked||t.target===e&&(s=!0,i=!1,r=t.clientX,a=t.clientY)},l=e=>{if(!s||!i&&3>Math.abs(e.clientX-r)&&3>Math.abs(e.clientY-a))return;i=!0;let n=V()?-1:1;t.setFromQuaternion(A.quaternion,"YXZ"),t.y=t.y+n*e.movementX*.003,t.x=t.x+n*e.movementY*.003,t.x=Math.max(-m,Math.min(m,t.x)),A.quaternion.setFromEuler(t)},c=()=>{s=!1},u=t=>{let s=G.current;!s||s.isLocked?z():t.target!==e||i||s.lock()};return e.addEventListener("mousedown",o),document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("click",u),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("click",u)}},T[13]=A,T[14]=V,T[15]=q.domElement,T[16]=z,T[17]=C):C=T[17],T[18]!==A||T[19]!==q.domElement||T[20]!==z?(N=[A,q.domElement,z],T[18]=A,T[19]=q.domElement,T[20]=z,T[21]=N):N=T[21],(0,s.useEffect)(C,N),T[22]!==B||T[23]!==W||T[24]!==R?(w=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return R(t=>{for(let s=0;s{let e=e=>{e.preventDefault();let t=O()?-1:1,s=(e.deltaY>0?-1:1)*t,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*s;L(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},t=q.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},T[27]=O,T[28]=q.domElement,T[29]=L,T[30]=D):D=T[30],T[31]!==q.domElement||T[32]!==L?(P=[q.domElement,L],T[31]=q.domElement,T[32]=L,T[33]=P):P=T[33],(0,s.useEffect)(D,P),T[34]!==A||T[35]!==j||T[36]!==_?(M=(e,t)=>{let s=u.streamPlaybackStore.getState();if(s.playback&&!s.freeFlyCamera)return;let{forward:n,backward:i,left:r,right:a,up:o,down:l,lookUp:c,lookDown:d,lookLeft:h,lookRight:p}=j();if((c||d||h||p)&&(H.current.setFromQuaternion(A.quaternion,"YXZ"),h&&(H.current.y=H.current.y+ +t),p&&(H.current.y=H.current.y-t),c&&(H.current.x=H.current.x+ +t),d&&(H.current.x=H.current.x-t),H.current.x=Math.max(-m,Math.min(m,H.current.x)),A.quaternion.setFromEuler(H.current)),!n&&!i&&!r&&!a&&!o&&!l)return;let g=80*_;A.getWorldDirection($.current),$.current.normalize(),K.current.crossVectors(A.up,$.current).normalize(),Y.current.set(0,0,0),n&&Y.current.add($.current),i&&Y.current.sub($.current),r&&Y.current.add(K.current),a&&Y.current.sub(K.current),o&&(Y.current.y=Y.current.y+1),l&&(Y.current.y=Y.current.y-1),Y.current.lengthSq()>0&&(Y.current.normalize().multiplyScalar(g*t),A.position.add(Y.current))},T[34]=A,T[35]=j,T[36]=_,T[37]=M):M=T[37],(0,i.useFrame)(M),null}function h(e){return e.gl}function p(e){return e.camera}function g(){return window.addEventListener("keydown",y,{capture:!0}),window.addEventListener("keyup",y,{capture:!0}),()=>{window.removeEventListener("keydown",y,{capture:!0}),window.removeEventListener("keyup",y,{capture:!0})}}function y(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}e.s(["ARROW_LOOK_SPEED",0,1,"KEYBOARD_CONTROLS",0,[{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:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{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"]}],"KeyboardAndMouseHandler",()=>d,"MOUSE_SENSITIVITY",0,.003])},60946,e=>{e.v(t=>Promise.all(["static/chunks/48d0203d138a3e57.js"].map(t=>e.l(t))).then(()=>t(0)))},30814,e=>{e.v(t=>Promise.all(["static/chunks/b89dc6fc9051e9fe.js"].map(t=>e.l(t))).then(()=>t(9721)))},44325,e=>{e.v(t=>Promise.all(["static/chunks/96ae05ebba99dcff.js"].map(t=>e.l(t))).then(()=>t(66789)))},62125,e=>{e.v(t=>Promise.all(["static/chunks/6c0bdfaab43cc40b.js"].map(t=>e.l(t))).then(()=>t(64972)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/2c772d15a5a10e4d.js"].map(t=>e.l(t))).then(()=>t(63724)))},61921,e=>{e.v(t=>Promise.all(["static/chunks/0e2ec5f4026ef564.js"].map(t=>e.l(t))).then(()=>t(29055)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/ebf99400aa3d97c0.js"].map(t=>e.l(t))).then(()=>t(42585)))},34019,e=>{e.v(t=>Promise.all(["static/chunks/341165a5ae0d70ac.js"].map(t=>e.l(t))).then(()=>t(66069)))},553,e=>{e.v(t=>Promise.all(["static/chunks/66f953934e42712b.css","static/chunks/e27b13e203064a85.js"].map(t=>e.l(t))).then(()=>t(18339)))},33487,e=>{e.v(t=>Promise.all(["static/chunks/9ffe862a9787606f.css","static/chunks/302e494fb721f5e6.js"].map(t=>e.l(t))).then(()=>t(40378)))},25483,e=>{e.v(t=>Promise.all(["static/chunks/b89dc6fc9051e9fe.js","static/chunks/bc2b324cb2101ffe.js"].map(t=>e.l(t))).then(()=>t(51295)))},93884,e=>{e.v(t=>Promise.all(["static/chunks/1db3a9d62713e989.css","static/chunks/3770acf7d1a6ba0a.js"].map(t=>e.l(t))).then(()=>t(94737)))},88487,e=>{e.v(t=>Promise.all(["static/chunks/005e475439c5cb3e.js","static/chunks/309d84bbb5b2092f.css"].map(t=>e.l(t))).then(()=>t(86855)))},21683,e=>{e.v(t=>Promise.all(["static/chunks/4c292ca57f1d49be.js"].map(t=>e.l(t))).then(()=>t(91285)))},96145,e=>{e.v(t=>Promise.all(["static/chunks/1cf57947857f8eec.js"].map(t=>e.l(t))).then(()=>t(60505)))},38496,e=>{e.v(t=>Promise.all(["static/chunks/97346c3751717c47.js"].map(t=>e.l(t))).then(()=>t(9962)))},57567,e=>{e.v(t=>Promise.all(["static/chunks/28c98fb093e4695f.css","static/chunks/22c22371d5c1dcba.js"].map(t=>e.l(t))).then(()=>t(49776)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/e257aadf7309fd30.css","static/chunks/273b16b21a9dcb92.js"].map(t=>e.l(t))).then(()=>t(94247)))},70012,e=>{e.v(t=>Promise.all(["static/chunks/e257aadf7309fd30.css","static/chunks/68bae3cf9f451a9b.js"].map(t=>e.l(t))).then(()=>t(45554)))}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9672,e=>{"use strict";function t(e,t){return e[t.toLowerCase()]}function s(e,s){let n=t(e,s);if(null==n)return;let i=parseFloat(n);return Number.isFinite(i)?i:void 0}function n(e,s){let n=t(e,s);if(null==n)return;let i=parseInt(n,10);return Number.isFinite(i)?i:void 0}function i(e,t={x:0,y:0,z:0}){if(!e)return t;let s=e.split(" ").map(Number);return{x:s[0]??t.x,y:s[1]??t.y,z:s[2]??t.z}}function r(e,t={r:0,g:0,b:0}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b}}function a(e,t={r:.5,g:.5,b:.5,a:1}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b,a:s[3]??t.a}}function o(e,t){let s=i(e),n=(t??"1 0 0 0").split(" ").map(Number),r=n[0]??1,a=n[1]??0,o=n[2]??0,l=Math.PI/180*(n[3]??0),c=Math.sqrt(r*r+a*a+o*o),u=0,m=0,d=1;c>1e-8&&(u=r/c,m=a/c,d=o/c);let h=Math.cos(l),p=Math.sin(l),g=1-h,y=Array(16).fill(0);return y[0]=g*u*u+h,y[1]=g*u*m+p*d,y[2]=g*u*d-p*m,y[4]=g*u*m-p*d,y[5]=g*m*m+h,y[6]=g*m*d+p*u,y[8]=g*u*d+p*m,y[9]=g*m*d-p*u,y[10]=g*d*d+h,y[12]=s.x,y[13]=s.y,y[14]=s.z,y[15]=1,{elements:y,position:s}}function l(e){return{className:"TerrainBlock",ghostIndex:e._id,terrFileName:t(e,"terrainFile")??"",detailTextureName:t(e,"detailTexture")??"",squareSize:n(e,"squareSize")??8,emptySquareRuns:function(e){if(!e)return;let t=e.split(/\s+/).map(Number).filter(Number.isFinite);return t.length>0?t:void 0}(t(e,"emptySquares"))}}function c(e){return{className:"InteriorInstance",ghostIndex:e._id,interiorFile:t(e,"interiorFile")??"",transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),showTerrainInside:"1"===t(e,"showTerrainInside"),skinBase:t(e,"skinBase")??"",alarmState:!1}}function u(e){let a=[];for(let s=1;s<=3;s++){let n=function(e){if(!e)return null;let t=e.split(/\s+/).map(Number),s=t[0]??0,n=t[1]??0,i=t[2]??0;return 0===s&&0===n&&0===i?null:{visibleDistance:s,minHeight:n,maxHeight:i,color:{r:.5,g:.5,b:.5}}}(t(e,`fogVolume${s}`));n&&a.push(n)}let o=[];for(let n=0;n<3;n++){let i=t(e,`cloudText${n+1}`)??"",r=s(e,`cloudHeightPer[${n}]`)??s(e,`cloudheightper${n}`)??[.35,.25,.2][n],a=s(e,`cloudSpeed${n+1}`)??[1e-4,2e-4,3e-4][n];o.push({texture:i,heightPercent:r,speed:a})}return{className:"Sky",ghostIndex:e._id,materialList:t(e,"materialList")??"",fogColor:r(t(e,"fogColor")),visibleDistance:s(e,"visibleDistance")??1e3,fogDistance:s(e,"fogDistance")??0,skySolidColor:r(t(e,"SkySolidColor")),useSkyTextures:(n(e,"useSkyTextures")??1)!==0,fogVolumes:a,cloudLayers:o,windVelocity:i(t(e,"windVelocity"))}}function m(e){return{className:"Sun",ghostIndex:e._id,direction:i(t(e,"direction"),{x:.57735,y:.57735,z:-.57735}),color:a(t(e,"color"),{r:.7,g:.7,b:.7,a:1}),ambient:a(t(e,"ambient"),{r:.5,g:.5,b:.5,a:1})}}function d(e){let n=t(e,"area"),i={x:-512,y:-512,w:1024,h:1024};if(n){let e=n.split(/\s+/).map(Number);i={x:e[0]??i.x,y:e[1]??i.y,w:e[2]??i.w,h:e[3]??i.h}}return{className:"MissionArea",ghostIndex:e._id,area:i,flightCeiling:s(e,"flightCeiling")??2e3,flightCeilingRange:s(e,"flightCeilingRange")??50}}function h(e){return{className:"WaterBlock",ghostIndex:e._id,transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),surfaceName:t(e,"surfaceTexture")??"",envMapName:t(e,"envMapTexture")??"",surfaceOpacity:s(e,"surfaceOpacity")??.75,waveMagnitude:s(e,"waveMagnitude")??1,envMapIntensity:s(e,"envMapIntensity")??1}}e.s(["interiorFromMis",()=>c,"missionAreaFromMis",()=>d,"skyFromMis",()=>u,"sunFromMis",()=>m,"terrainFromMis",()=>l,"waterBlockFromMis",()=>h])},70847,47566,63318,e=>{"use strict";let t=(0,e.i(25645).createLogger)("ghostToScene");function s(e,t={x:0,y:0,z:0}){return e&&"object"==typeof e&&"x"in e?e:t}function n(e,t={r:0,g:0,b:0}){return e&&"object"==typeof e&&"r"in e?e:t}function i(e,t={r:.5,g:.5,b:.5,a:1}){return e&&"object"==typeof e&&"r"in e?e:t}function r(e){if(e&&"object"==typeof e&&"elements"in e&&Array.isArray(e.elements))return e;if(e&&"object"==typeof e&&"position"in e&&"rotation"in e){let{position:t,rotation:s}=e,n=s.x*s.x,i=s.y*s.y,r=s.z*s.z,a=s.x*s.y,o=s.x*s.z,l=s.y*s.z,c=s.w*s.x,u=s.w*s.y,m=s.w*s.z;return{elements:[1-2*(i+r),2*(a+m),2*(o-u),0,2*(a-m),1-2*(n+r),2*(l+c),0,2*(o+u),2*(l-c),1-2*(n+i),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function a(e,a,o){let l;switch(e){case"TerrainBlock":return l={className:"TerrainBlock",ghostIndex:a,terrFileName:o.terrFileName??"",detailTextureName:o.detailTextureName??"",squareSize:o.squareSize??8,emptySquareRuns:o.emptySquareRuns},t.debug("TerrainBlock #%d: terrFileName=%s",a,l.terrFileName),l;case"InteriorInstance":return l={className:"InteriorInstance",ghostIndex:a,interiorFile:o.interiorFile??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),showTerrainInside:o.showTerrainInside??!1,skinBase:o.skinBase??"",alarmState:o.alarmState??!1},t.debug("InteriorInstance #%d: interiorFile=%s",a,l.interiorFile),l;case"TSStatic":return{className:"TSStatic",ghostIndex:a,shapeName:o.shapeName??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1})};case"Sky":{let e,i;e=Array.isArray(o.fogVolumes)?o.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:n(e.color)})):[],i=Array.isArray(o.cloudLayers)?o.cloudLayers.map(e=>({texture:e.texture??"",heightPercent:e.heightPercent??0,speed:e.speed??0})):[];let r=l={className:"Sky",ghostIndex:a,materialList:o.materialList??"",fogColor:n(o.fogColor),visibleDistance:o.visibleDistance??1e3,fogDistance:o.fogDistance??0,skySolidColor:n(o.skySolidColor),useSkyTextures:o.useSkyTextures??!0,fogVolumes:e,cloudLayers:i,windVelocity:s(o.windVelocity)};return t.debug("Sky #%d: materialList=%s fogColor=(%s, %s, %s) visibleDist=%d fogDist=%d useSkyTextures=%s",a,r.materialList,r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,r.useSkyTextures),l}case"Sun":{let e=l={className:"Sun",ghostIndex:a,direction:s(o.direction,{x:.57735,y:.57735,z:-.57735}),color:i(o.color,{r:.7,g:.7,b:.7,a:1}),ambient:i(o.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(o.textures)?o.textures:void 0};return t.debug("Sun #%d: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",a,e.direction.x.toFixed(3),e.direction.y.toFixed(3),e.direction.z.toFixed(3),e.color.r.toFixed(3),e.color.g.toFixed(3),e.color.b.toFixed(3),e.ambient.r.toFixed(3),e.ambient.g.toFixed(3),e.ambient.b.toFixed(3)),l}case"MissionArea":return{className:"MissionArea",ghostIndex:a,area:o.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:o.flightCeiling??2e3,flightCeilingRange:o.flightCeilingRange??50};case"WaterBlock":return{className:"WaterBlock",ghostIndex:a,transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),surfaceName:o.surfaceName??"",envMapName:o.envMapName??"",surfaceOpacity:o.surfaceOpacity??.75,waveMagnitude:o.waveMagnitude??1,envMapIntensity:o.envMapIntensity??1};default:return null}}e.s(["ghostToSceneObject",()=>a],47566),e.i(9672);var o=e.i(90072);function l(e){return[e.y,e.z,e.x]}function c(e){return[e.y,e.z,e.x]}function u(e){let t=e.elements,s=new o.Matrix4,n=s.elements;n[0]=t[5],n[1]=t[6],n[2]=t[4],n[3]=0,n[4]=t[9],n[5]=t[10],n[6]=t[8],n[7]=0,n[8]=t[1],n[9]=t[2],n[10]=t[0],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1;let i=new o.Quaternion;return i.setFromRotationMatrix(s),i.conjugate(),i}e.s(["matrixFToQuaternion",()=>u,"torqueScaleToThree",()=>c,"torqueToThree",()=>l],63318),e.s([],70847)},92224,e=>{"use strict";e.i(932);var t=e.i(8155),s=e.i(66748),n=e.i(62395);let i=(0,t.createStore)()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:0,setEntity(t){e(e=>{let s=new Map(e.missionEntities);return s.set(t.id,t),{missionEntities:s,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let s=new Map(e.missionEntities);return s.delete(t),{missionEntities:s,version:e.version+1}})},setEntities(t){e(e=>{let s=new Map(e.missionEntities);for(let e of t)s.set(e.id,e);return{missionEntities:s,version:e.version+1}})},setAllEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);return{missionEntities:s,dataSource:e.isStreaming?e.dataSource:"map"}})},clearEntities(){e(e=>0===e.missionEntities.size?e:e.isStreaming?{missionEntities:new Map,version:e.version+1}:{missionEntities:new Map,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1})},setMissionInfo(t){let s={};if(void 0!==t.missionName&&(s.missionName=t.missionName),void 0!==t.missionType&&(s.missionType=t.missionType),void 0!==t.missionTypeDisplayName&&(s.missionTypeDisplayName=t.missionTypeDisplayName),void 0!==t.missionDisplayName&&(s.missionDisplayName=t.missionDisplayName),void 0!==t.gameClassName&&(s.gameClassName=t.gameClassName,void 0===t.missionType))if(t.gameClassName){let e=t.gameClassName.replace(/Game$/i,"");s.missionType=n.normalizedMissionTypes[e.toLowerCase()]??e}else s.missionType=null;void 0!==t.serverDisplayName&&(s.serverDisplayName=t.serverDisplayName),void 0!==t.recorderName&&(s.recorderName=t.recorderName),void 0!==t.recordingDate&&(s.recordingDate=t.recordingDate),e(e=>({...s,version:e.version+1}))},beginStreaming(t){e(e=>({isStreaming:!0,dataSource:t,streamEntities:new Map,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1}))},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,dataSource:e.missionEntities.size>0?"map":null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let s=new Map(e.streamEntities);return s.set(t.id,t),{streamEntities:s,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let s=new Map(e.streamEntities);return s.delete(t),{streamEntities:s,version:e.version+1}})},setStreamEntities(t){e(e=>{let s=new Map(e.streamEntities);for(let e of t)s.set(e.id,e);return{streamEntities:s,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);let n=e.streamEntities;return s.size===n.size&&[...s.keys()].every(e=>n.has(e))?e:{streamEntities:s,version:e.version+1}})},clearStreamEntities(){e(e=>0===e.streamEntities.size?e:{streamEntities:new Map,version:e.version+1})}}));function r(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,s=[];for(let e of t.values())"None"!==e.renderType&&s.push(e);return s}function a(e,t){if(e.length!==t.length)return!1;for(let s=0;so,"useDataSource",()=>d,"useMissionDisplayName",()=>k,"useMissionName",()=>p,"useMissionType",()=>y,"useMissionTypeDisplayName",()=>v,"useRecorderName",()=>N,"useRecordingDate",()=>x,"useSceneSky",()=>u,"useSceneSun",()=>m,"useServerDisplayName",()=>b])},98755,e=>{"use strict";e.i(47167);var t=e.i(8155),s=e.i(66748),n=e.i(25645);let i=(0,n.createLogger)("relayClient");class r{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{i.info("WebSocket connected to %s",this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){i.error("Failed to parse relay message: %o",e)}},this.ws.onclose=()=>{i.info("WebSocket disconnected"),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{i.error("WebSocket error"),this.handlers.onError?.("WebSocket connection error")}}handleMessage(e){switch(e.type){case"serverList":this.handlers.onServerList?.(e.servers);break;case"status":this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case"ping":this.handlers.onPing?.(e.ms);break;case"wsPong":{let t=Date.now()-e.ts;this.smoothedWsPing=0===this.smoothedWsPing?t:.5*this.smoothedWsPing+.5*t,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case"error":this.handlers.onError?.(e.message)}}listServers(){this.send({type:"listServers"})}sendWsPing(){this.send({type:"wsPing",ts:Date.now()})}joinServer(e,t){i.info("Joining server: %s",e),this.send({type:"joinServer",address:e,warriorName:t})}disconnectServer(){this.send({type:"disconnect"})}sendAuthEvent(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCommand(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCRCResponse(e,t,s){this.send({type:"sendCRCResponse",crcValue:e,field1:t,field2:s})}sendCRCCompute(e,t,s,n){this.send({type:"sendCRCCompute",seed:e,field2:t,includeTextures:n,datablocks:s})}sendGhostAck(e,t){this.send({type:"sendGhostAck",sequence:e,ghostCount:t})}sendMove(e){this.send({type:"sendMove",move:e})}close(){this.stopWsPing(),this.ws&&(this.ws.close(),this.ws=null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:"wsPing",ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:"wsPing",ts:Date.now()})},7e3)}stopWsPing(){null!=this.wsPingInterval&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):i.warn("send dropped (ws not open): %s",e.type)}}e.i(91891);var a=e.i(94802),o=e.i(89119),l=e.i(10244);let c=(0,n.createLogger)("liveStreaming");class u extends l.StreamEngine{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;dataBlockClassNames=new Map;onReady;onMissionChange;missionName=null;constructor(e){super(),this.relay=e;const{registry:t,ghostTracker:s,packetParser:n}=(0,a.createLiveParser)();this.packetParser=n,this.ghostTracker=s,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,s=e.sequences;t&&s&&this._shapeConstructorCache.set(t.toLowerCase(),s)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,s]of t){let n=s.explosion;if(null==n)continue;let i=t.get(n);i?.dtsFileName&&e.add(i.dtsFileName)}return[...e]}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this.dataBlockClassNames.clear(),this.observerMode="fly",this.missionName=null}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:0x1fffffff,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if("RemoteCommandEvent"!==e.type)return;let t=e.funcName;if(!t)return;let s=this.resolveNetString(t);if(["t2csri_pokeClient","t2csri_getChallengeChunk","t2csri_decryptChallenge"].includes(s)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>""!==e);c.info("auth event: %s %o",s,t),this.relay.sendAuthEvent(s,t);return}let n=(e.args??[]).map(e=>this.resolveNetString(e));if("MissionStartPhase1"===s){let e=n[0]??"",t=n[1]??null;c.info("mission phase 1, seq=%s mission=%s resolvedArgs=%o",e,t,n),t&&t!==this.missionName&&(this.missionName=t,this.entities.clear(),this.entityIdByGhostIndex.clear(),this._ready=!1,this._snapshot=null,this._snapshotTick=-1,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.onMissionChange?.(t)),this.relay.sendCommand("MissionStartPhase1Done",[e])}else if("MissionStartPhase2"===s){let e=n[0]??"";c.info("mission phase 2 (datablocks), seq=%s",e),this.relay.sendCommand("MissionStartPhase2Done",[e])}else if("MissionStartPhase3"===s){let e=n[0]??"",t=n[1]??null;c.info("mission phase 3 (ghosting), seq=%s mission=%s",e,t),t&&(this.missionName=t),this.relay.sendCommand("setClientFav",[""]),this.relay.sendCommand("MissionStartPhase3Done",[e])}}handleCRCChallenge(e){if("CRCChallengeEvent"!==e.type)return;let t=e.crcValue,s=e.field1,n=e.field2,i=(1&s)!=0;c.info("CRC challenge: seed=0x%s f1=0x%s f2=0x%s includeTextures=%s",(t>>>0).toString(16),(s>>>0).toString(16),(n>>>0).toString(16),i);let r=this.packetParser.getDataBlockDataMap(),a=[];if(r)for(let[e,t]of r){let s=this.dataBlockClassNames.get(e);if(!s)continue;let n=(0,o.resolveShapeName)(s,t);a.push({objectId:e,className:s,shapeName:n??""})}c.info("CRC: sending %d datablocks for computation",a.length),this.relay.sendCRCCompute(t,n,a,i)}handleGhostingMessage(e){if("GhostingMessageEvent"!==e.type)return;let t=e.message,s=e.sequence,n=e.ghostCount;c.info("GhostingMessageEvent: message=%d sequence=%d ghostCount=%d",t,s,n),0===t&&(c.info("Sending ghost ack (type 1) for sequence %d",s),this.relay.sendGhostAck(s,n))}observerMode="fly";cycleObserveNext(){"fly"===this.observerMode?(c.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(c.info("observer: cycle next (fire trigger)"),this.sendTrigger(0))}toggleObserverMode(){"fly"===this.observerMode?(c.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(c.info("observer: follow → fly (jump trigger)"),this.sendTrigger(2),this.observerMode="fly")}sendTrigger(e){let t=[!1,!1,!1,!1,!1,!1];t[e]=!0,this.relay.sendMove({x:0,y:0,z:0,yaw:0,pitch:0,roll:0,trigger:t,freeLook:!1})}getPlayerList(){let e=[];for(let[t,s]of this.targetNames){let n=this.targetTeams.get(t)??0;e.push({targetId:t,name:s,sensorGroup:n})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,s=this.packetParser.protocolNoDispatch,n=this.packetParser.parsePacket(e),i=this.packetParser.protocolRejected>t,r=this.packetParser.protocolNoDispatch>s;(i||r)&&c.warn("packet #%d %s: %d bytes (total rejected=%d, noDispatch=%d)",this.tickCount,i?"REJECTED":"no-dispatch",e.length,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch);let a=this.tickCount<20,l=this.tickCount%100==0,u=a||l;for(let t of(u&&c.debug("packet #%d: %d events, %d ghosts, %d bytes%s%s",this.tickCount,n.events.length,n.ghosts.length,e.length,void 0!==n.gameState.controlObjectGhostIndex?`, control=${n.gameState.controlObjectGhostIndex}`:"",void 0!==n.gameState.cameraFov?`, fov=${n.gameState.cameraFov}`:""),this.processControlObject(n.gameState),n.events))if(t.parsedData){this.handleRelayCommands(t.parsedData),this.handleCRCChallenge(t.parsedData),this.handleGhostingMessage(t.parsedData);let e=t.parsedData.type;if("RemoteCommandEvent"===e){let e=this.resolveNetString(t.parsedData.funcName??"");c.debug("remote: %s",e)}if(a&&"NetStringEvent"!==e&&"RemoteCommandEvent"!==e&&c.debug("event: %s%s",e,"SimDataBlockEvent"===e?` id=${t.parsedData.objectId} class=${t.parsedData.dataBlockClassName}`:""),"SimDataBlockEvent"===e){let e=t.parsedData.objectId,s=t.parsedData.dataBlockClassName;if(null!=e&&s&&this.dataBlockClassNames.set(e,s),u){let n=t.parsedData.dataBlockData,i=(0,o.resolveShapeName)(s??"",n);c.debug("datablock: id=%d class=%s%s",e,s??"?",i?` shape=${i}`:"")}}let s=this.registry.getEventParser(t.classId)?.name;if(this.processEvent(t,s),a&&"NetStringEvent"===e){let e=t.parsedData.id,s=t.parsedData.value;null!=e&&"string"==typeof s&&c.trace('netString #%d = "%s"',e,s.length>60?s.slice(0,60)+"…":s)}if("TargetInfoEvent"===e){let e=t.parsedData.targetId,s=t.parsedData.nameTag;if(null!=e&&null!=s){let n=this.netStrings.get(s);if(n){let s=(0,o.stripTaggedStringMarkup)(n);c.info('target #%d: "%s" team=%s',e,s,t.parsedData.sensorGroup??"?")}}}if("SetSensorGroupEvent"===e){let e=t.parsedData.sensorGroup;null!=e&&c.info("sensor group changed: → %d",e)}if("SensorGroupColorEvent"===e){let e=t.parsedData.sensorGroup,s=t.parsedData.colors;s&&c.debug("sensor group colors: group=%d, %d entries",e,s.length)}}for(let e of n.ghosts){if("create"===e.type){let t=e.parsedData?.position,s=t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z,n=this.resolveGhostClassName(e.index,e.classId);c.debug("ghost create: #%d %s%s (%d entities total)",e.index,n??"?",s?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:"",this.entities.size+1),this._ready||(this._ready=!0,this.onReady?.())}else if("delete"===e.type){let t=this.entityIdByGhostIndex.get(e.index),s=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&c.debug("ghost delete: #%d %s (%d entities remaining)",e.index,s?.className??"?",this.entities.size-1)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),l&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();c.info("status @ tick %d: %d entities, %d datablocks, rejected=%d, noDispatch=%d",this.tickCount,this.entities.size,e?.size??0,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch)}let m=this.entities.size;if(1===this.tickCount||m>0&&m%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(" ");c.info("entity count: %d (%s)",m,t)}let d=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==d&&c.info("camera mode: %s → %s%s",d??"none",this.camera.mode,"third-person"===this.camera.mode?` orbit=${this.camera.orbitTargetId??"?"} dist=${this.camera.orbitDistance??"?"}`:""),this.tickCount<=5&&this.camera){let[e,t,s]=this.camera.position;c.debug("camera: mode=%s pos=(%s, %s, %s) fov=%s",this.camera.mode,e.toFixed(1),t.toFixed(1),s.toFixed(1),this.camera.fov)}}catch(s){let t={tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced};c.error("Failed to process live packet: %o %o",s,t)}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:s,audioEvents:n}=this.buildTimeFilteredEvents(t),{weaponsHud:i,inventoryHud:r,backpackHud:a,teamScores:o}=this.buildHudState();this.camera||(this.camera={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:"observer"});let l={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:s,audioEvents:n,weaponsHud:i,backpackHud:a,inventoryHud:r,teamScores:o};return this._snapshot=l,this._snapshotTick=this.tickCount,l}}var m=e.i(92224);let d=(0,n.createLogger)("liveConnectionStore"),h="wss://t2-relay.fly.dev",p=(0,t.createStore)((e,t)=>({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(s=h){let n=t();n._relay&&n._relay.close();let i=new r(s,{onOpen(){e({relayConnected:!0});let s=t();for(let e of s._pending)e();s._pending=[]},onStatus(t,s,n,i){d.info("game status: %s%s%s",t,s?` — ${s}`:"",i?` map=${i}`:""),e({gameStatus:t,gameStatusMessage:s,...i?{mapName:i}:{}})},onServerList(s){t()._listInFlight=!1,e({servers:s,serversLoading:!1})},onGamePacket(e){let s=t()._adapter;s||d.warn("received game packet but no adapter is active"),s?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(s){d.error("error: %s",s),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let s=t();s._relay===i&&(s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let s=t();s._relay?.close(),s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let s=t();if(s._listInFlight)return;s._listInFlight=!0;let n=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),s._relay?.connected?n():(s._pending.push(n),s._relay||t().connectRelay())},joinServer(s,n){let i=t();if(!i._relay)return;let r=i.servers.find(e=>e.address===s),a=new u(i._relay);a.onReady=()=>e({liveReady:!0}),a.onMissionChange=t=>{d.info("mission changed: %s",t),e({mapName:t,liveReady:!1}),m.gameEntityStore.getState().setMissionInfo({missionName:t,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null})},a.onMissionInfoChange=()=>{m.gameEntityStore.getState().setMissionInfo({missionDisplayName:a.missionDisplayName??void 0,missionTypeDisplayName:a.missionTypeDisplayName??void 0,gameClassName:a.gameClassName??void 0,serverDisplayName:a.serverDisplayName??void 0,recorderName:a.connectedPlayerName??void 0})},i._adapter=a,e({mapName:r?.mapName??i.mapName,serverName:r?.name,warriorName:n,liveReady:!1,gameStatus:null,adapter:a}),m.gameEntityStore.getState().setMissionInfo({missionName:r?.mapName??void 0,missionTypeDisplayName:r?.gameType??void 0,serverDisplayName:r?.name??void 0,recorderName:n??void 0}),i._relay.joinServer(s,n)},disconnectServer(){let s=t();s._relay?.disconnectServer(),s._adapter=null,e({adapter:null,liveReady:!1,gameStatus:null,mapName:void 0,serverName:void 0,relayToGameServerPing:null})},sendMove(e){t()._relay?.sendMove(e)},sendCommand(e,...s){t()._relay?.sendCommand(e,s)}}));function g(e,t){return(0,s.useStoreWithEqualityFn)(p,e,t)}function y(e){return null!=e.relayToGameServerPing&&null!=e.browserToRelayPing?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}e.s(["liveConnectionStore",0,p,"selectPing",()=>y,"useLiveSelector",()=>g],98755)},66027,e=>{"use strict";var t=e.i(69230),s=e.i(69637);function n(e,n){return(0,s.useBaseQuery)(e,t.QueryObserver,n)}e.s(["useQuery",()=>n])},66093,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,n.createContext)(null);function r(){let e=(0,n.useContext)(i);if(!e)throw Error("No JoystickContext found. Did you forget to add a ?");return e}function a(e){let r,a,o,l,c,u,m=(0,s.c)(7),{children:d}=e;m[0]===Symbol.for("react.memo_cache_sentinel")?(r={angle:0,force:0},m[0]=r):r=m[0];let h=(0,n.useRef)(r);m[1]===Symbol.for("react.memo_cache_sentinel")?(a={angle:0,force:0},m[1]=a):a=m[1];let p=(0,n.useRef)(a);m[2]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{let{angle:t,force:s}=e;null!=t&&(h.current.angle=t),null!=s&&(h.current.force=s)},m[2]=o):o=m[2];let g=o;m[3]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let{angle:t,force:s}=e;null!=t&&(p.current.angle=t),null!=s&&(p.current.force=s)},m[3]=l):l=m[3];let y=l;m[4]===Symbol.for("react.memo_cache_sentinel")?(c={moveState:h,lookState:p,setMoveState:g,setLookState:y},m[4]=c):c=m[4];let f=c;return m[5]!==d?(u=(0,t.jsx)(i,{value:f,children:d}),m[5]=d,m[6]=u):u=m[6],u}e.s(["JoystickProvider",()=>a,"useJoystick",()=>r])},32865,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(58647);function i(e){let n,i=(0,s.c)(2),{children:r}=e;return i[0]!==r?(n=(0,t.jsx)(t.Fragment,{children:r}),i[0]=r,i[1]=n):n=i[1],n}function r(){return(0,n.useEngineSelector)(a)}function a(e){return e.playback.recording}function o(){return(0,n.useEngineSelector)(l)}function l(e){return"playing"===e.playback.status}function c(){return(0,n.useEngineSelector)(u)}function u(e){return e.playback.timeMs/1e3}function m(){return(0,n.useEngineSelector)(d)}function d(e){return e.playback.durationMs/1e3}function h(){return(0,n.useEngineSelector)(p)}function p(e){return e.playback.rate}function g(){let e,t,i,a,o,l,c=(0,s.c)(17),u=r(),m=(0,n.useEngineSelector)(S),d=(0,n.useEngineSelector)(v),h=(0,n.useEngineSelector)(f),p=(0,n.useEngineSelector)(y);c[0]!==m?(e=e=>{m(e)},c[0]=m,c[1]=e):e=c[1];let g=e;c[2]!==u||c[3]!==d?(t=()=>{u&&d("playing")},c[2]=u,c[3]=d,c[4]=t):t=c[4];let k=t;c[5]!==d?(i=()=>{d("paused")},c[5]=d,c[6]=i):i=c[6];let E=i;c[7]!==h?(a=e=>{h(1e3*e)},c[7]=h,c[8]=a):a=c[8];let b=a;c[9]!==p?(o=e=>{p(e)},c[9]=p,c[10]=o):o=c[10];let C=o;return c[11]!==E||c[12]!==k||c[13]!==b||c[14]!==g||c[15]!==C?(l={setRecording:g,play:k,pause:E,seek:b,setSpeed:C},c[11]=E,c[12]=k,c[13]=b,c[14]=g,c[15]=C,c[16]=l):l=c[16],l}function y(e){return e.setPlaybackRate}function f(e){return e.setPlaybackTime}function v(e){return e.setPlaybackStatus}function S(e){return e.setRecording}e.s(["RecordingProvider",()=>i,"useCurrentTime",()=>c,"useDuration",()=>m,"useIsPlaying",()=>o,"usePlaybackActions",()=>g,"useRecording",()=>r,"useSpeed",()=>h])},51434,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645),i=e.i(15080),r=e.i(90072),a=e.i(58647),o=e.i(79123);let l=(0,n.createContext)(void 0);function c(e){let c,h,p,g,y,f,v=(0,s.c)(11),{children:S}=e,k=(0,i.useThree)(d),{audioVolume:E}=(0,o.useSettings)();v[0]===Symbol.for("react.memo_cache_sentinel")?(c={audioLoader:null,audioListener:null},v[0]=c):c=v[0];let[b,C]=(0,n.useState)(c);return v[1]!==k?(h=()=>{let e=new r.AudioLoader,t=k.children.find(m);t||(t=new r.AudioListener,k.add(t)),C({audioLoader:e,audioListener:t});let s=()=>{let e=t.context;e&&"suspended"===e.state&&e.resume().finally(()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),document.removeEventListener("touchend",s)})};document.addEventListener("click",s),document.addEventListener("keydown",s),document.addEventListener("touchend",s);let n=a.engineStore.subscribe(u,e=>{let s=t.context;s&&("paused"===e?s.suspend():"suspended"===s.state&&s.resume())});return()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),document.removeEventListener("touchend",s),n(),t&&k.remove(t)}},p=[k],v[1]=k,v[2]=h,v[3]=p):(h=v[2],p=v[3]),(0,n.useEffect)(h,p),v[4]!==b.audioListener||v[5]!==E?(g=()=>{b.audioListener?.setMasterVolume(E)},y=[E,b.audioListener],v[4]=b.audioListener,v[5]=E,v[6]=g,v[7]=y):(g=v[6],y=v[7]),(0,n.useEffect)(g,y),v[8]!==b||v[9]!==S?(f=(0,t.jsx)(l.Provider,{value:b,children:S}),v[8]=b,v[9]=S,v[10]=f):f=v[10],f}function u(e){return e.playback.status}function m(e){return e instanceof r.AudioListener}function d(e){return e.camera}function h(){let e=(0,n.useContext)(l);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>c,"useAudio",()=>h])},93784,e=>{"use strict";let t=(0,e.i(8155).createStore)()(()=>({time:0,playback:null,root:null,freeFlyCamera:!1,entities:new Map}));function s(){t.setState({time:0,playback:null,freeFlyCamera:!1})}e.s(["resetStreamPlayback",()=>s,"streamPlaybackStore",0,t])},46325,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,e.i(25645).createLogger)("DebugSuspense");function r(e){let i,r,l,c=(0,s.c)(10),{name:u,fallback:m,children:d}=e,h=void 0===m?null:m;return c[0]!==h||c[1]!==u?(i=(0,t.jsx)(a,{name:u,children:h}),c[0]=h,c[1]=u,c[2]=i):i=c[2],c[3]!==u?(r=(0,t.jsx)(o,{name:u}),c[3]=u,c[4]=r):r=c[4],c[5]!==d||c[6]!==u||c[7]!==i||c[8]!==r?(l=(0,t.jsxs)(n.Suspense,{name:u,fallback:i,children:[r,d]}),c[5]=d,c[6]=u,c[7]=i,c[8]=r,c[9]=l):l=c[9],l}function a(e){let t,r,a=(0,s.c)(3),{name:o,children:l}=e;return a[0]!==o?(t=()=>{i.debug("🛑 SUSPENDED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),l}function o(e){let t,r,a=(0,s.c)(3),{name:o}=e;return a[0]!==o?(t=()=>{i.debug("✅ RESOLVED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),null}e.s(["DebugSuspense",()=>r])},31999,e=>{"use strict";var t=e.i(71645);let s=(0,e.i(25645).createLogger)("ShapeErrorBoundary");class n extends t.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){s.error("Shape load failed: %s %s",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}e.s(["ShapeErrorBoundary",()=>n])},77964,e=>{"use strict";function t(e){switch(e.renderType){case"TerrainBlock":case"InteriorInstance":case"Sky":case"Sun":case"WaterBlock":case"MissionArea":return!0;default:return!1}}e.s(["isSceneEntity",()=>t])},12631,e=>{"use strict";var t=e.i(71645),s=e.i(8155);let n=e=>{let n=(0,s.createStore)(e),i=e=>(function(e,s=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>s(e.getState()),[e,s]),t.default.useCallback(()=>s(e.getInitialState()),[e,s]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(i,n),i};var i=e.i(79473);let r=t.createContext(null);function a({map:e,children:s,onChange:a,domElement:o}){let l=e.map(e=>e.name+e.keys).join("-"),c=t.useMemo(()=>{let t;return(t=(0,i.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?n(t):n},[l]),u=t.useMemo(()=>[c.subscribe,c.getState,c],[l]),m=c.setState;return t.useEffect(()=>{let t=e.map(({name:e,keys:t,up:s})=>({keys:t,up:s,fn:t=>{m({[e]:t}),a&&a(e,t,u[1]())}})).reduce((e,{keys:t,fn:s,up:n=!0})=>(t.forEach(t=>e[t]={fn:s,pressed:!1,up:n}),e),{}),s=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,pressed:r,up:a}=n;n.pressed=!0,(a||!r)&&i(!0)},n=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,up:r}=n;n.pressed=!1,r&&i(!1)},i=o||window;return i.addEventListener("keydown",s,{passive:!0}),i.addEventListener("keyup",n,{passive:!0}),()=>{i.removeEventListener("keydown",s),i.removeEventListener("keyup",n)}},[o,l]),t.createElement(r.Provider,{value:u,children:s})}function o(e){let[s,n,i]=t.useContext(r);return e?i(e):[s,n]}e.s(["KeyboardControls",()=>a,"useKeyboardControls",()=>o],12631)},85413,e=>{"use strict";var t=Object.defineProperty;class s{constructor(){((e,s,n)=>{let i,r;r=void 0,(i="symbol"!=typeof s?s+"":s)in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let s=this._listeners;void 0===s[e]&&(s[e]=[]),-1===s[e].indexOf(t)&&s[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let s=this._listeners;return void 0!==s[e]&&-1!==s[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let s=this._listeners[e];if(void 0!==s){let e=s.indexOf(t);-1!==e&&s.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 s=t.slice(0);for(let t=0,n=s.length;ts])},68294,e=>{"use strict";var t=e.i(43476),s=e.i(90072),n=e.i(15080),i=e.i(71645);let r=(0,i.createContext)(null);function a(){let e=(0,i.useContext)(r);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function o({children:e}){let a=(0,n.useThree)(e=>e.camera),[o,l]=(0,i.useState)(-1),[c,u]=(0,i.useState)({}),[m,d]=(0,i.useState)(()=>({initialized:!1,position:null,quarternion:null})),h=(0,i.useCallback)(e=>{u(t=>({...t,[e.id]:e}))},[]),p=(0,i.useCallback)(e=>{u(t=>{let{[e.id]:s,...n}=t;return n})},[]),g=Object.keys(c).length,y=(0,i.useCallback)(e=>{if(e>=0&&e{y(g?(o+1)%g:-1)},[g,o,y]);(0,i.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,n]=e.slice(2).split("~"),i=t.split(",").map(e=>parseFloat(e)),r=n.split(",").map(e=>parseFloat(e));d({initialized:!0,position:new s.Vector3(...i),quarternion:new s.Quaternion(...r)})}else d({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,i.useEffect)(()=>{m.initialized&&m.position&&(a.position.copy(m.position),m.quarternion&&a.quaternion.copy(m.quarternion))},[a,m]),(0,i.useEffect)(()=>{m.initialized&&!m.position&&g>0&&-1===o&&y(0)},[g,y,o,m]);let v=(0,i.useMemo)(()=>({registerCamera:h,unregisterCamera:p,nextCamera:f,setCameraIndex:y,cameraCount:g}),[h,p,f,y,g]);return 0===g&&-1!==o&&l(-1),(0,t.jsx)(r.Provider,{value:v,children:e})}e.s(["CamerasProvider",()=>o,"useCameras",()=>a])},26747,e=>{"use strict";var t=e.i(90072),s=e.i(85413),n=Object.defineProperty,i=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?n(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,s};let r=new t.Euler(0,0,0,"YXZ"),a=new t.Vector3,o={type:"change"},l={type:"lock"},c={type:"unlock"},u=Math.PI/2;class m extends s.EventDispatcher{constructor(e,s){super(),i(this,"camera"),i(this,"domElement"),i(this,"isLocked"),i(this,"minPolarAngle"),i(this,"maxPolarAngle"),i(this,"pointerSpeed"),i(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(r.setFromQuaternion(this.camera.quaternion),r.y-=.002*e.movementX*this.pointerSpeed,r.x-=.002*e.movementY*this.pointerSpeed,r.x=Math.max(u-this.maxPolarAngle,Math.min(u-this.minPolarAngle,r.x)),this.camera.quaternion.setFromEuler(r),this.dispatchEvent(o))}),i(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(l),this.isLocked=!0):(this.dispatchEvent(c),this.isLocked=!1))}),i(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),i(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))}),i(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))}),i(this,"dispose",()=>{this.disconnect()}),i(this,"getObject",()=>this.camera),i(this,"direction",new t.Vector3(0,0,-1)),i(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),i(this,"moveForward",e=>{a.setFromMatrixColumn(this.camera.matrix,0),a.crossVectors(this.camera.up,a),this.camera.position.addScaledVector(a,e)}),i(this,"moveRight",e=>{a.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(a,e)}),i(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),i(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=s,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,s&&this.connect(s)}}e.s(["PointerLockControls",()=>m])},205,e=>{"use strict";var t=e.i(932),s=e.i(71645),n=e.i(90072),i=e.i(71753),r=e.i(15080),a=e.i(12631),o=e.i(26747),l=e.i(79123),c=e.i(68294),u=e.i(93784);let m=Math.PI/2-.01;function d(){let e,d,y,f,v,S,k,E,b,C,N,w,x,D,P,M,T=(0,t.c)(38);T[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],T[0]=e):e=T[0],(0,s.useEffect)(g,e);let{speedMultiplier:_,setSpeedMultiplier:L,invertScroll:F,invertDrag:I}=(0,l.useControls)(),[R,j]=(0,a.useKeyboardControls)(),A=(0,r.useThree)(p),q=(0,r.useThree)(h),{nextCamera:z,setCameraIndex:W,cameraCount:B}=(0,c.useCameras)(),G=(0,s.useRef)(null);T[1]!==F?(d=()=>F,T[1]=F,T[2]=d):d=T[2];let O=(0,s.useEffectEvent)(d);T[3]!==I?(y=()=>I,T[3]=I,T[4]=y):y=T[4];let V=(0,s.useEffectEvent)(y);T[5]===Symbol.for("react.memo_cache_sentinel")?(f=new n.Vector3,T[5]=f):f=T[5];let $=(0,s.useRef)(f);T[6]===Symbol.for("react.memo_cache_sentinel")?(v=new n.Vector3,T[6]=v):v=T[6];let K=(0,s.useRef)(v);T[7]===Symbol.for("react.memo_cache_sentinel")?(S=new n.Vector3,T[7]=S):S=T[7];let Y=(0,s.useRef)(S);T[8]===Symbol.for("react.memo_cache_sentinel")?(k=new n.Euler(0,0,0,"YXZ"),T[8]=k):k=T[8];let H=(0,s.useRef)(k);return T[9]!==A||T[10]!==q.domElement?(E=()=>{let e=new o.PointerLockControls(A,q.domElement);return G.current=e,()=>{e.dispose()}},b=[A,q.domElement],T[9]=A,T[10]=q.domElement,T[11]=E,T[12]=b):(E=T[11],b=T[12]),(0,s.useEffect)(E,b),T[13]!==A||T[14]!==V||T[15]!==q.domElement||T[16]!==z?(C=()=>{let e=q.domElement,t=new n.Euler(0,0,0,"YXZ"),s=!1,i=!1,r=0,a=0,o=t=>{G.current?.isLocked||t.target===e&&(s=!0,i=!1,r=t.clientX,a=t.clientY)},l=e=>{if(!s||!i&&3>Math.abs(e.clientX-r)&&3>Math.abs(e.clientY-a))return;i=!0;let n=V()?-1:1;t.setFromQuaternion(A.quaternion,"YXZ"),t.y=t.y+n*e.movementX*.003,t.x=t.x+n*e.movementY*.003,t.x=Math.max(-m,Math.min(m,t.x)),A.quaternion.setFromEuler(t)},c=()=>{s=!1},u=t=>{let s=G.current;!s||s.isLocked?z():t.target!==e||i||s.lock()};return e.addEventListener("mousedown",o),document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("click",u),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("click",u)}},T[13]=A,T[14]=V,T[15]=q.domElement,T[16]=z,T[17]=C):C=T[17],T[18]!==A||T[19]!==q.domElement||T[20]!==z?(N=[A,q.domElement,z],T[18]=A,T[19]=q.domElement,T[20]=z,T[21]=N):N=T[21],(0,s.useEffect)(C,N),T[22]!==B||T[23]!==W||T[24]!==R?(w=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return R(t=>{for(let s=0;s{let e=e=>{e.preventDefault();let t=O()?-1:1,s=(e.deltaY>0?-1:1)*t,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*s;L(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},t=q.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},T[27]=O,T[28]=q.domElement,T[29]=L,T[30]=D):D=T[30],T[31]!==q.domElement||T[32]!==L?(P=[q.domElement,L],T[31]=q.domElement,T[32]=L,T[33]=P):P=T[33],(0,s.useEffect)(D,P),T[34]!==A||T[35]!==j||T[36]!==_?(M=(e,t)=>{let s=u.streamPlaybackStore.getState();if(s.playback&&!s.freeFlyCamera)return;let{forward:n,backward:i,left:r,right:a,up:o,down:l,lookUp:c,lookDown:d,lookLeft:h,lookRight:p}=j();if((c||d||h||p)&&(H.current.setFromQuaternion(A.quaternion,"YXZ"),h&&(H.current.y=H.current.y+ +t),p&&(H.current.y=H.current.y-t),c&&(H.current.x=H.current.x+ +t),d&&(H.current.x=H.current.x-t),H.current.x=Math.max(-m,Math.min(m,H.current.x)),A.quaternion.setFromEuler(H.current)),!n&&!i&&!r&&!a&&!o&&!l)return;let g=80*_;A.getWorldDirection($.current),$.current.normalize(),K.current.crossVectors(A.up,$.current).normalize(),Y.current.set(0,0,0),n&&Y.current.add($.current),i&&Y.current.sub($.current),r&&Y.current.add(K.current),a&&Y.current.sub(K.current),o&&(Y.current.y=Y.current.y+1),l&&(Y.current.y=Y.current.y-1),Y.current.lengthSq()>0&&(Y.current.normalize().multiplyScalar(g*t),A.position.add(Y.current))},T[34]=A,T[35]=j,T[36]=_,T[37]=M):M=T[37],(0,i.useFrame)(M),null}function h(e){return e.gl}function p(e){return e.camera}function g(){return window.addEventListener("keydown",y,{capture:!0}),window.addEventListener("keyup",y,{capture:!0}),()=>{window.removeEventListener("keydown",y,{capture:!0}),window.removeEventListener("keyup",y,{capture:!0})}}function y(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}e.s(["ARROW_LOOK_SPEED",0,1,"KEYBOARD_CONTROLS",0,[{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:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{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"]}],"KeyboardAndMouseHandler",()=>d,"MOUSE_SENSITIVITY",0,.003])},60946,e=>{e.v(t=>Promise.all(["static/chunks/48d0203d138a3e57.js"].map(t=>e.l(t))).then(()=>t(0)))},30814,e=>{e.v(t=>Promise.all(["static/chunks/41fb9d5ac0e14608.js"].map(t=>e.l(t))).then(()=>t(9721)))},44325,e=>{e.v(t=>Promise.all(["static/chunks/c5f946098461b297.js"].map(t=>e.l(t))).then(()=>t(66789)))},62125,e=>{e.v(t=>Promise.all(["static/chunks/6c0bdfaab43cc40b.js"].map(t=>e.l(t))).then(()=>t(64972)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/2c772d15a5a10e4d.js"].map(t=>e.l(t))).then(()=>t(63724)))},61921,e=>{e.v(t=>Promise.all(["static/chunks/538e72dc81951677.js"].map(t=>e.l(t))).then(()=>t(29055)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/2070573ac43e863c.js"].map(t=>e.l(t))).then(()=>t(42585)))},34019,e=>{e.v(t=>Promise.all(["static/chunks/341165a5ae0d70ac.js"].map(t=>e.l(t))).then(()=>t(66069)))},553,e=>{e.v(t=>Promise.all(["static/chunks/66f953934e42712b.css","static/chunks/e27b13e203064a85.js"].map(t=>e.l(t))).then(()=>t(18339)))},33487,e=>{e.v(t=>Promise.all(["static/chunks/9ffe862a9787606f.css","static/chunks/302e494fb721f5e6.js"].map(t=>e.l(t))).then(()=>t(40378)))},25483,e=>{e.v(t=>Promise.all(["static/chunks/41fb9d5ac0e14608.js","static/chunks/e5d92d4ce07851d8.js"].map(t=>e.l(t))).then(()=>t(51295)))},93884,e=>{e.v(t=>Promise.all(["static/chunks/1db3a9d62713e989.css","static/chunks/3770acf7d1a6ba0a.js"].map(t=>e.l(t))).then(()=>t(94737)))},88487,e=>{e.v(t=>Promise.all(["static/chunks/005e475439c5cb3e.js","static/chunks/309d84bbb5b2092f.css"].map(t=>e.l(t))).then(()=>t(86855)))},21683,e=>{e.v(t=>Promise.all(["static/chunks/4c292ca57f1d49be.js"].map(t=>e.l(t))).then(()=>t(91285)))},96145,e=>{e.v(t=>Promise.all(["static/chunks/1cf57947857f8eec.js"].map(t=>e.l(t))).then(()=>t(60505)))},38496,e=>{e.v(t=>Promise.all(["static/chunks/fd10b9633e3b5488.js"].map(t=>e.l(t))).then(()=>t(9962)))},57567,e=>{e.v(t=>Promise.all(["static/chunks/28c98fb093e4695f.css","static/chunks/22c22371d5c1dcba.js"].map(t=>e.l(t))).then(()=>t(49776)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/7317a925124598e3.css","static/chunks/7aec7c45fab908e2.js"].map(t=>e.l(t))).then(()=>t(94247)))},70012,e=>{e.v(t=>Promise.all(["static/chunks/7317a925124598e3.css","static/chunks/0070446447a9983b.js"].map(t=>e.l(t))).then(()=>t(45554)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/68bae3cf9f451a9b.js b/docs/_next/static/chunks/68bae3cf9f451a9b.js deleted file mode 100644 index fd4e2b3b..00000000 --- a/docs/_next/static/chunks/68bae3cf9f451a9b.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},56614,e=>{e.v({CloseButton:"ServerBrowser-module__kqm3eq__CloseButton "+e.i(81847).Secondary,Dialog:"ServerBrowser-module__kqm3eq__Dialog "+e.i(81847).Dialog,Empty:"ServerBrowser-module__kqm3eq__Empty",EmptyServer:"ServerBrowser-module__kqm3eq__EmptyServer",Footer:"ServerBrowser-module__kqm3eq__Footer",Header:"ServerBrowser-module__kqm3eq__Header",HiddenRadio:"ServerBrowser-module__kqm3eq__HiddenRadio",Hint:"ServerBrowser-module__kqm3eq__Hint",JoinButton:"ServerBrowser-module__kqm3eq__JoinButton "+e.i(81847).DialogButton,Overlay:"ServerBrowser-module__kqm3eq__Overlay "+e.i(81847).Overlay,PasswordIcon:"ServerBrowser-module__kqm3eq__PasswordIcon",RefreshButton:"ServerBrowser-module__kqm3eq__RefreshButton "+e.i(81847).DialogButton,ServerCount:"ServerBrowser-module__kqm3eq__ServerCount",Table:"ServerBrowser-module__kqm3eq__Table",TableWrapper:"ServerBrowser-module__kqm3eq__TableWrapper",Title:"ServerBrowser-module__kqm3eq__Title",WarriorField:"ServerBrowser-module__kqm3eq__WarriorField",WarriorInput:"ServerBrowser-module__kqm3eq__WarriorInput",WarriorLabel:"ServerBrowser-module__kqm3eq__WarriorLabel"})},45554,e=>{"use strict";var r=e.i(43476),l=e.i(932),o=e.i(71645),t=e.i(56614),s=e.i(98755),a=e.i(79123);function n(e){let n,v,f,S,p,g,x,y,j,q,k,B,w,C,b,N,D,W,T,L,E,P,R,H,O,F,I,A,G,Z,J=(0,l.c)(88),{onClose:K}=e,M=(0,s.useLiveSelector)(h),U=(0,s.useLiveSelector)(_),Q=(0,s.useLiveSelector)(m),z=(0,s.useLiveSelector)(u),V=(0,s.useLiveSelector)(c),{warriorName:X,setWarriorName:Y}=(0,a.useSettings)(),[$,ee]=(0,o.useState)(null);J[0]!==V||J[1]!==K||J[2]!==$||J[3]!==X?(n=()=>{$&&(V($,X),K())},J[0]=V,J[1]=K,J[2]=$,J[3]=X,J[4]=n):n=J[4];let er=n;J[5]!==V||J[6]!==K||J[7]!==X?(v=e=>{V(e,X),K()},J[5]=V,J[6]=K,J[7]=X,J[8]=v):v=J[8];let el=v,[eo,et]=(0,o.useState)("ping"),[es,ea]=(0,o.useState)("asc"),en=(0,o.useRef)(null);J[9]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{en.current?.focus();try{document.exitPointerLock()}catch{}},S=[],J[9]=f,J[10]=S):(f=J[9],S=J[10]),(0,o.useEffect)(f,S),J[11]!==z?(p=()=>{z()},g=[z],J[11]=z,J[12]=p,J[13]=g):(p=J[12],g=J[13]),(0,o.useEffect)(p,g),J[14]!==K?(x=()=>{let e=e=>{e.stopPropagation(),"Escape"===e.key&&K()};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},y=[K],J[14]=K,J[15]=x,J[16]=y):(x=J[15],y=J[16]),(0,o.useEffect)(x,y),J[17]!==eo?(j=e=>{eo===e?ea(d):(et(e),ea("desc"))},J[17]=eo,J[18]=j):j=J[18];let ei=j;if(J[19]!==M||J[20]!==es||J[21]!==eo){let e;J[23]!==es||J[24]!==eo?(e=(e,r)=>{let l=e[eo],o=r[eo],t="number"==typeof l&&"number"==typeof o?l-o:String(l).localeCompare(String(o));return"asc"===es?t:-t},J[23]=es,J[24]=eo,J[25]=e):e=J[25],q=[...M].sort(e),J[19]=M,J[20]=es,J[21]=eo,J[22]=q}else q=J[22];let ed=q;J[26]===Symbol.for("react.memo_cache_sentinel")?(k=(0,r.jsx)("h2",{className:t.default.Title,children:"Server Browser"}),J[26]=k):k=J[26];let ec=1!==M.length?"s":"";if(J[27]!==M.length||J[28]!==ec?(B=(0,r.jsxs)("span",{className:t.default.ServerCount,children:[M.length," server",ec]}),J[27]=M.length,J[28]=ec,J[29]=B):B=J[29],J[30]!==z||J[31]!==U?(w=(0,r.jsx)("button",{className:t.default.RefreshButton,onClick:z,disabled:U,children:"Refresh"}),J[30]=z,J[31]=U,J[32]=w):w=J[32],J[33]!==B||J[34]!==w?(C=(0,r.jsxs)("div",{className:t.default.Header,children:[k,B,w]}),J[33]=B,J[34]=w,J[35]=C):C=J[35],J[36]!==ei?(b=(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{onClick:()=>ei("name"),children:"Server Name"}),(0,r.jsx)("th",{onClick:()=>ei("playerCount"),children:"Players"}),(0,r.jsx)("th",{onClick:()=>ei("ping"),children:"Ping"}),(0,r.jsx)("th",{onClick:()=>ei("mapName"),children:"Map"}),(0,r.jsx)("th",{onClick:()=>ei("gameType"),children:"Type"}),(0,r.jsx)("th",{onClick:()=>ei("mod"),children:"Mod"})]})}),J[36]=ei,J[37]=b):b=J[37],J[38]!==Q||J[39]!==el||J[40]!==K||J[41]!==$||J[42]!==ed){let e;J[44]!==Q||J[45]!==el||J[46]!==K||J[47]!==$?(e=e=>(0,r.jsxs)("tr",{onClick:()=>{ee(e.address),Array.from(document.forms.serverList.elements.serverAddress).find(r=>r.value===e.address).focus()},onDoubleClick:()=>{ee(e.address),el(e.address),K()},children:[(0,r.jsxs)("td",{children:[(0,r.jsx)("input",{type:"radio",className:t.default.HiddenRadio,name:"serverAddress",value:e.address,checked:$===e.address,onChange:e=>{ee(e.target.value)}}),e.passwordRequired&&(0,r.jsx)("span",{className:t.default.PasswordIcon,children:"🔒"}),e.name]}),(0,r.jsxs)("td",{className:0===e.playerCount?t.default.EmptyServer:void 0,children:[e.playerCount," / ",e.maxPlayers]}),(0,r.jsx)("td",{children:null!=Q?(e.ping+Q).toLocaleString():"—"}),(0,r.jsx)("td",{children:e.mapName}),(0,r.jsx)("td",{children:e.gameType}),(0,r.jsx)("td",{children:e.mod})]},e.address),J[44]=Q,J[45]=el,J[46]=K,J[47]=$,J[48]=e):e=J[48],N=ed.map(e),J[38]=Q,J[39]=el,J[40]=K,J[41]=$,J[42]=ed,J[43]=N}else N=J[43];J[49]!==U||J[50]!==ed.length?(D=0===ed.length&&!U&&(0,r.jsx)("tr",{className:t.default.Empty,children:(0,r.jsx)("td",{colSpan:6,children:"No servers found"})}),J[49]=U,J[50]=ed.length,J[51]=D):D=J[51],J[52]!==U||J[53]!==ed.length?(W=U&&0===ed.length&&(0,r.jsx)("tr",{className:t.default.Empty,children:(0,r.jsx)("td",{colSpan:6,children:"Querying master server…"})}),J[52]=U,J[53]=ed.length,J[54]=W):W=J[54],J[55]!==N||J[56]!==D||J[57]!==W?(T=(0,r.jsxs)("tbody",{children:[N,D,W]}),J[55]=N,J[56]=D,J[57]=W,J[58]=T):T=J[58],J[59]!==b||J[60]!==T?(L=(0,r.jsxs)("table",{className:t.default.Table,children:[b,T]}),J[59]=b,J[60]=T,J[61]=L):L=J[61],J[62]!==er||J[63]!==L?(E=(0,r.jsx)("div",{className:t.default.TableWrapper,children:(0,r.jsx)("form",{name:"serverList",onSubmit:er,children:L})}),J[62]=er,J[63]=L,J[64]=E):E=J[64],J[65]===Symbol.for("react.memo_cache_sentinel")?(P=(0,r.jsx)("label",{className:t.default.WarriorLabel,htmlFor:"warriorName",children:"Warrior"}),J[65]=P):P=J[65],J[66]!==Y?(R=e=>Y(e.target.value),J[66]=Y,J[67]=R):R=J[67],J[68]!==R||J[69]!==X?(H=(0,r.jsxs)("div",{className:t.default.WarriorField,children:[P,(0,r.jsx)("input",{id:"warriorName",className:t.default.WarriorInput,type:"text",value:X,onChange:R,placeholder:"Name thyself…",maxLength:24})]}),J[68]=R,J[69]=X,J[70]=H):H=J[70],J[71]===Symbol.for("react.memo_cache_sentinel")?(O=(0,r.jsx)("span",{className:t.default.Hint,children:"Double-click a server to join"}),J[71]=O):O=J[71],J[72]!==K?(F=(0,r.jsx)("button",{onClick:K,className:t.default.CloseButton,children:"Cancel"}),J[72]=K,J[73]=F):F=J[73];let eu=!$;return J[74]!==er||J[75]!==eu?(I=(0,r.jsx)("button",{onClick:er,disabled:eu,className:t.default.JoinButton,children:"Join"}),J[74]=er,J[75]=eu,J[76]=I):I=J[76],J[77]!==H||J[78]!==F||J[79]!==I?(A=(0,r.jsxs)("div",{className:t.default.Footer,children:[H,O,F,I]}),J[77]=H,J[78]=F,J[79]=I,J[80]=A):A=J[80],J[81]!==C||J[82]!==E||J[83]!==A?(G=(0,r.jsxs)("div",{className:t.default.Dialog,ref:en,tabIndex:-1,onClick:i,children:[C,E,A]}),J[81]=C,J[82]=E,J[83]=A,J[84]=G):G=J[84],J[85]!==K||J[86]!==G?(Z=(0,r.jsx)("div",{className:t.default.Overlay,onClick:K,children:G}),J[85]=K,J[86]=G,J[87]=Z):Z=J[87],Z}function i(e){return e.stopPropagation()}function d(e){return"asc"===e?"desc":"asc"}function c(e){return e.joinServer}function u(e){return e.listServers}function m(e){return e.browserToRelayPing}function _(e){return e.serversLoading}function h(e){return e.servers}e.s(["ServerBrowser",()=>n])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e257aadf7309fd30.css b/docs/_next/static/chunks/7317a925124598e3.css similarity index 62% rename from docs/_next/static/chunks/e257aadf7309fd30.css rename to docs/_next/static/chunks/7317a925124598e3.css index 85307bff..29fdca8a 100644 --- a/docs/_next/static/chunks/e257aadf7309fd30.css +++ b/docs/_next/static/chunks/7317a925124598e3.css @@ -1,4 +1,4 @@ .GuiMarkup-module__CLgNnq__GuiMarkup{white-space:pre-wrap;font-size:14px;line-height:1.5}.GuiMarkup-module__CLgNnq__GuiMarkup a{color:inherit;text-decoration:underline}.GuiMarkup-module__CLgNnq__Bullet{margin-left:.5em;margin-right:.5em} -.GameDialog-module__C6hZDW__Dialog{color:#b0d5c9;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;background:#142526cc;border:1px solid #41838b99;border-radius:4px;outline:none;max-width:calc(100dvw - 40px);max-height:calc(100dvh - 40px);font-size:14px;line-height:1.5;position:relative;overflow:hidden;box-shadow:0 0 50px #0006,inset 0 0 60px #01070d99}.GameDialog-module__C6hZDW__Overlay{z-index:10;background:#000000b3;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}.GameDialog-module__C6hZDW__DialogButton{color:#99fff1;text-shadow:0 -1px 1px #0006;cursor:pointer;background:linear-gradient(#30a497cc,#1f9688cc 33%,#218377cc 67%,#046564cc);border:1px solid #387c74cc;border-top-color:#57b7b9cc;border-radius:4px;padding:4px 18px;font-family:inherit;font-size:14px;font-weight:500;box-shadow:inset 0 0 4px #02808e80}.GameDialog-module__C6hZDW__DialogButton:hover:not(:disabled){color:#b1fff5;border:1px solid #409188e6;border-top-color:#5ac6c2e6;box-shadow:inset 0 0 4px #02808e80,0 0 5px #3effbf80}.GameDialog-module__C6hZDW__DialogButton:active:not(:disabled){transform:translateY(1px)}.GameDialog-module__C6hZDW__DialogButton:disabled{opacity:.4;cursor:not-allowed}.GameDialog-module__C6hZDW__Secondary{box-shadow:none;color:#a2e2cfcc;text-shadow:none;background:0 0;border:1px solid #387c74cc;}.GameDialog-module__C6hZDW__Secondary:hover:not(:disabled){color:#a9ffe5cc;border:1px solid #3f9087e6} +.GameDialog-module__C6hZDW__Dialog{color:#b0d5c9;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;background:#142526cc;border:1px solid #41838b99;border-radius:4px;outline:none;max-width:calc(100dvw - 40px);max-height:calc(100dvh - 40px);font-size:14px;line-height:1.5;position:relative;overflow:hidden;box-shadow:0 0 50px #0006,inset 0 0 60px #01070d99}.GameDialog-module__C6hZDW__Overlay{z-index:10;background:#000000b3;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}.GameDialog-module__C6hZDW__DialogButton{color:#99fff1;text-shadow:0 -1px 1px #0006;cursor:pointer;background:linear-gradient(#30a497cc,#1f9688cc 33%,#218377cc 67%,#046564cc);border:1px solid #387c74cc;border-top-color:#57b7b9cc;border-radius:4px;padding:4px 18px;font-family:inherit;font-size:14px;font-weight:500;box-shadow:inset 0 0 4px #02808e80}.GameDialog-module__C6hZDW__DialogButton:hover:not(:disabled){color:#b1fff5;border:1px solid #409188e6;border-top-color:#5ac6c2e6;box-shadow:inset 0 0 4px #02808e80,0 0 5px #3effbf80}.GameDialog-module__C6hZDW__DialogButton:active:not(:disabled){transform:translateY(1px)}.GameDialog-module__C6hZDW__DialogButton:disabled{opacity:.4;cursor:not-allowed}.GameDialog-module__C6hZDW__Secondary{box-shadow:none;color:#a2e2cfcc;text-shadow:none;background:0 0;border:1px solid #387c74cc;}.GameDialog-module__C6hZDW__Secondary:hover:not(:disabled){color:#a9ffe5cc;border:1px solid #3f9087e6}.GameDialog-module__C6hZDW__Actions{align-items:center;gap:10px;display:flex}@media (max-width:719px){.GameDialog-module__C6hZDW__Dialog{border-radius:0;max-width:calc(100dvw - 20px);max-height:calc(100dvh - 20px)}}@media (max-width:639px){.GameDialog-module__C6hZDW__Overlay{padding:10px}} .MapInfoDialog-module__m0lXla__Dialog{grid-template-rows:1fr auto;grid-template-columns:100%;width:800px;height:600px;display:grid;}.MapInfoDialog-module__m0lXla__Overlay{}.MapInfoDialog-module__m0lXla__Body{grid-template-rows:100%;grid-template-columns:1fr auto;min-height:0;display:grid;overflow:hidden}.MapInfoDialog-module__m0lXla__Left{padding:24px 28px;overflow-y:auto}.MapInfoDialog-module__m0lXla__PreviewImage{border-left:1px solid #00bedc40;height:100%;display:block}.MapInfoDialog-module__m0lXla__PreviewImageFloating{float:right;clear:right;width:auto;max-width:30%;max-height:260px;margin:0 0 16px 20px;display:block}.MapInfoDialog-module__m0lXla__Title{color:#7dffff;text-shadow:0 1px 6px #0006;margin:0;font-size:26px;font-weight:500}.MapInfoDialog-module__m0lXla__MapMeta{flex-wrap:wrap;gap:8px 16px;margin-bottom:4px;font-size:15px;font-weight:400;display:flex}.MapInfoDialog-module__m0lXla__MapPlanet{color:#dbcaa8b3}.MapInfoDialog-module__m0lXla__MapQuote{border-left:2px solid #00bedc59;margin:16px 0;padding:0 0 0 14px;font-style:italic}.MapInfoDialog-module__m0lXla__MapQuote p{white-space:pre-line;margin:0 0 4px}.MapInfoDialog-module__m0lXla__MapQuote cite{color:#d7edcb80;font-size:12px;font-style:normal;display:block}.MapInfoDialog-module__m0lXla__MapBlurb{margin:0 0 16px;font-size:13px}.MapInfoDialog-module__m0lXla__Section{margin-top:20px}.MapInfoDialog-module__m0lXla__SectionTitle{color:#7dffff;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 16px #00d2f040;margin:0 0 8px;font-size:16px;font-weight:500}.MapInfoDialog-module__m0lXla__MusicTrack{color:#d7edcb80;align-items:center;gap:6px;margin-top:16px;font-size:14px;font-style:italic;display:flex}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true]{color:#f7fdd8b3}.MapInfoDialog-module__m0lXla__MusicButton{cursor:pointer;color:#557663;opacity:.5;background:0 0;border:0;border-radius:20px;flex-shrink:0;place-content:center;width:32px;height:32px;padding:0;font-size:20px;font-style:normal;line-height:1;display:grid}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true] .MapInfoDialog-module__m0lXla__MusicButton{color:#6dffaa;opacity:1}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true] .MapInfoDialog-module__m0lXla__MusicButton:hover{opacity:.7}.MapInfoDialog-module__m0lXla__Footer{background:#021415b3;border-top:1px solid #00bedc40;flex-shrink:0;align-items:center;gap:16px;padding:10px 12px;display:flex}.MapInfoDialog-module__m0lXla__CloseButton{}.MapInfoDialog-module__m0lXla__Hint{color:#c9dcd84d;margin-left:auto;font-size:12px}.MapInfoDialog-module__m0lXla__MusicTrackName{text-transform:capitalize}@media (max-width:719px){.MapInfoDialog-module__m0lXla__Body{display:block;overflow:auto}.MapInfoDialog-module__m0lXla__Hint{display:none}.MapInfoDialog-module__m0lXla__Left{width:100%;height:auto;margin:0;padding:16px 20px;overflow:auto}.MapInfoDialog-module__m0lXla__PreviewImage{width:auto;height:auto;margin:16px auto}.MapInfoDialog-module__m0lXla__CloseButton{width:220px;height:36px;margin:0 auto}} -.ServerBrowser-module__kqm3eq__Dialog{grid-template-rows:auto 1fr auto;grid-template-columns:100%;width:860px;height:560px;display:grid;}.ServerBrowser-module__kqm3eq__Overlay{}.ServerBrowser-module__kqm3eq__Header{border-bottom:1px solid #00bedc40;align-items:center;gap:12px;padding:12px 16px 10px;display:flex}.ServerBrowser-module__kqm3eq__Title{color:#7dffff;text-shadow:0 1px 6px #0006;flex:1;margin:0;font-size:18px;font-weight:500}.ServerBrowser-module__kqm3eq__HiddenRadio{opacity:0;z-index:-1;pointer-events:none;width:0;height:0;position:absolute;overflow:hidden}.ServerBrowser-module__kqm3eq__RefreshButton{padding:3px 14px;font-size:12px;}.ServerBrowser-module__kqm3eq__ServerCount{color:#c9dcd866;font-size:12px}.ServerBrowser-module__kqm3eq__TableWrapper{min-height:0;overflow-y:auto}.ServerBrowser-module__kqm3eq__Table{border-collapse:collapse;width:100%;font-size:13px}.ServerBrowser-module__kqm3eq__Table th{z-index:1;text-align:left;cursor:pointer;-webkit-user-select:none;user-select:none;letter-spacing:.04em;text-transform:uppercase;color:#7dffff99;background:#0a191af2;border-bottom:1px solid #00bedc33;padding:6px 12px;font-size:11px;font-weight:500;position:sticky;top:0}.ServerBrowser-module__kqm3eq__Table th:hover{color:#7dffff}.ServerBrowser-module__kqm3eq__Table th:nth-child(2),.ServerBrowser-module__kqm3eq__Table td:nth-child(2),.ServerBrowser-module__kqm3eq__Table th:nth-child(3),.ServerBrowser-module__kqm3eq__Table td:nth-child(3){text-align:right}.ServerBrowser-module__kqm3eq__Table td{z-index:0;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px solid #ffffff0a;max-width:340px;padding:3px 12px;font-weight:500;position:relative;overflow:hidden}.ServerBrowser-module__kqm3eq__Table td.ServerBrowser-module__kqm3eq__EmptyServer{opacity:.4}.ServerBrowser-module__kqm3eq__Table tbody tr:not(.ServerBrowser-module__kqm3eq__Empty){cursor:pointer}.ServerBrowser-module__kqm3eq__Table tbody tr:not(.ServerBrowser-module__kqm3eq__Empty):hover{background:#41838b1f}.ServerBrowser-module__kqm3eq__Table tbody tr:has(input:checked){color:#1e2828;background:#5dffe1e6!important}.ServerBrowser-module__kqm3eq__PasswordIcon{color:#ffc83c99;margin-right:4px;font-size:11px}.ServerBrowser-module__kqm3eq__Empty td{text-align:center;color:#c9dcd84d;font-style:italic;padding:32px 12px!important}.ServerBrowser-module__kqm3eq__Footer{background:#021415b3;border-top:1px solid #00bedc40;flex-shrink:0;align-items:center;gap:16px;padding:10px 12px;display:flex}.ServerBrowser-module__kqm3eq__JoinButton{min-width:100px;}.ServerBrowser-module__kqm3eq__CloseButton{}.ServerBrowser-module__kqm3eq__WarriorField{align-items:center;gap:8px;display:flex}.ServerBrowser-module__kqm3eq__WarriorLabel{color:#7dffff99;font-size:12px;font-weight:500}.ServerBrowser-module__kqm3eq__WarriorInput{color:#b0d5c9;background:#00323ccc;border:1px solid #41838b80;border-radius:2px;outline:none;width:130px;padding:4px 6px;font-family:inherit;font-size:13px}.ServerBrowser-module__kqm3eq__WarriorInput:focus{border-color:#7dffff99}.ServerBrowser-module__kqm3eq__WarriorInput::placeholder{color:#c9dcd84d}.ServerBrowser-module__kqm3eq__Hint{color:#c9dcd84d;margin:0 auto;font-size:12px}@media (max-width:719px){.ServerBrowser-module__kqm3eq__Dialog{border-radius:0;width:100%;max-width:100dvw;height:100%;max-height:100dvh}.ServerBrowser-module__kqm3eq__Hint{display:none}.ServerBrowser-module__kqm3eq__Table td{max-width:200px}.ServerBrowser-module__kqm3eq__CloseButton{margin-left:auto}} +.ServerBrowser-module__kqm3eq__Dialog{grid-template-rows:auto 1fr auto;grid-template-columns:100%;width:860px;height:560px;display:grid;}.ServerBrowser-module__kqm3eq__Overlay{}.ServerBrowser-module__kqm3eq__Header{border-bottom:1px solid #00bedc40;align-items:center;gap:12px;padding:12px 16px 10px;display:flex}.ServerBrowser-module__kqm3eq__Title{color:#7dffff;text-shadow:0 1px 6px #0006;flex:1;margin:0;font-size:18px;font-weight:500}.ServerBrowser-module__kqm3eq__HiddenRadio{opacity:0;z-index:-1;pointer-events:none;width:0;height:0;position:absolute;overflow:hidden}.ServerBrowser-module__kqm3eq__RefreshButton{padding:3px 14px;font-size:12px;}.ServerBrowser-module__kqm3eq__ServerCount{color:#c9dcd866;font-size:12px}.ServerBrowser-module__kqm3eq__TableWrapper{min-height:0;overflow-y:auto}.ServerBrowser-module__kqm3eq__Table{border-collapse:collapse;width:100%;min-height:0;font-size:13px}.ServerBrowser-module__kqm3eq__Table th{z-index:1;text-align:left;cursor:pointer;-webkit-user-select:none;user-select:none;letter-spacing:.04em;text-transform:uppercase;color:#7dffff99;background:#0a191af2;border-bottom:1px solid #00bedc33;padding:6px 12px;font-size:11px;font-weight:500;position:sticky;top:0}.ServerBrowser-module__kqm3eq__Table th:hover{color:#7dffff}.ServerBrowser-module__kqm3eq__Table th:nth-child(2),.ServerBrowser-module__kqm3eq__Table td:nth-child(2),.ServerBrowser-module__kqm3eq__Table th:nth-child(3),.ServerBrowser-module__kqm3eq__Table td:nth-child(3){text-align:right}.ServerBrowser-module__kqm3eq__Table td{z-index:0;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px solid #ffffff0a;max-width:340px;padding:3px 12px;font-weight:500;position:relative;overflow:hidden}.ServerBrowser-module__kqm3eq__Table td.ServerBrowser-module__kqm3eq__EmptyServer{opacity:.4}.ServerBrowser-module__kqm3eq__Table tbody tr:not(.ServerBrowser-module__kqm3eq__Empty){cursor:pointer}.ServerBrowser-module__kqm3eq__Table tbody tr:not(.ServerBrowser-module__kqm3eq__Empty):hover{background:#41838b1f}.ServerBrowser-module__kqm3eq__Table tbody tr:has(input:checked){color:#1e2828;background:#5dffe1e6!important}.ServerBrowser-module__kqm3eq__PasswordIcon{color:#ffc83c99;margin-right:4px;font-size:11px}.ServerBrowser-module__kqm3eq__Empty td{text-align:center;color:#c9dcd84d;font-style:italic;padding:32px 12px!important}.ServerBrowser-module__kqm3eq__Footer{background:#021415b3;border-top:1px solid #00bedc40;flex-shrink:0;justify-content:space-between;align-items:center;gap:16px;padding:10px 12px;display:flex}.ServerBrowser-module__kqm3eq__JoinButton{min-width:100px;}.ServerBrowser-module__kqm3eq__CloseButton{}.ServerBrowser-module__kqm3eq__WarriorField{align-items:center;gap:8px;display:flex}.ServerBrowser-module__kqm3eq__WarriorLabel{color:#7dffff99;font-size:12px;font-weight:500}.ServerBrowser-module__kqm3eq__WarriorInput{color:#b0d5c9;background:#00323ccc;border:1px solid #41838b80;border-radius:2px;outline:none;width:130px;padding:4px 6px;font-family:inherit;font-size:13px}.ServerBrowser-module__kqm3eq__WarriorInput:focus{border-color:#7dffff99}.ServerBrowser-module__kqm3eq__WarriorInput::placeholder{color:#c9dcd84d}.ServerBrowser-module__kqm3eq__Hint{color:#c9dcd84d;margin:0 auto;font-size:12px}.ServerBrowser-module__kqm3eq__Actions{}@media (max-width:719px){.ServerBrowser-module__kqm3eq__Hint{display:none}.ServerBrowser-module__kqm3eq__Table td{max-width:200px}.ServerBrowser-module__kqm3eq__CloseButton{margin-left:auto}}@media (max-width:539px){.ServerBrowser-module__kqm3eq__Footer{flex-direction:column;gap:8px}.ServerBrowser-module__kqm3eq__Actions{width:100%}.ServerBrowser-module__kqm3eq__WarriorLabel{font-size:14px}.ServerBrowser-module__kqm3eq__WarriorInput{min-width:12em;font-size:16px}.ServerBrowser-module__kqm3eq__JoinButton,.ServerBrowser-module__kqm3eq__CloseButton{flex:1 0 auto;height:32px}} diff --git a/docs/_next/static/chunks/7aec7c45fab908e2.js b/docs/_next/static/chunks/7aec7c45fab908e2.js new file mode 100644 index 00000000..a2aea06a --- /dev/null +++ b/docs/_next/static/chunks/7aec7c45fab908e2.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Actions:"GameDialog-module__C6hZDW__Actions",Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},66438,e=>{e.v({Bullet:"GuiMarkup-module__CLgNnq__Bullet",GuiMarkup:"GuiMarkup-module__CLgNnq__GuiMarkup"})},41973,e=>{e.v({Body:"MapInfoDialog-module__m0lXla__Body",CloseButton:"MapInfoDialog-module__m0lXla__CloseButton "+e.i(81847).DialogButton,Dialog:"MapInfoDialog-module__m0lXla__Dialog "+e.i(81847).Dialog,Footer:"MapInfoDialog-module__m0lXla__Footer",Hint:"MapInfoDialog-module__m0lXla__Hint",Left:"MapInfoDialog-module__m0lXla__Left",MapBlurb:"MapInfoDialog-module__m0lXla__MapBlurb",MapMeta:"MapInfoDialog-module__m0lXla__MapMeta",MapPlanet:"MapInfoDialog-module__m0lXla__MapPlanet",MapQuote:"MapInfoDialog-module__m0lXla__MapQuote",MusicButton:"MapInfoDialog-module__m0lXla__MusicButton",MusicTrack:"MapInfoDialog-module__m0lXla__MusicTrack",MusicTrackName:"MapInfoDialog-module__m0lXla__MusicTrackName",Overlay:"MapInfoDialog-module__m0lXla__Overlay "+e.i(81847).Overlay,PreviewImage:"MapInfoDialog-module__m0lXla__PreviewImage",PreviewImageFloating:"MapInfoDialog-module__m0lXla__PreviewImageFloating",Section:"MapInfoDialog-module__m0lXla__Section",SectionTitle:"MapInfoDialog-module__m0lXla__SectionTitle",Title:"MapInfoDialog-module__m0lXla__Title"})},94247,e=>{"use strict";var t=e.i(43476),a=e.i(932),l=e.i(71645),o=e.i(11152),i=e.i(66027),n=e.i(12979),r=e.i(91996),s=e.i(66438);let u=new Set(["spop","spush","lmargin","font","color","bitmap","a","/a"]),c=new Map;function m(e){let l,o=(0,a.c)(5),{name:i}=e;o[0]!==i?(l=function(e){let t;if(c.has(e))return c.get(e);try{t=(0,n.getUrlForPath)((0,r.getStandardTextureResourceKey)(`textures/gui/${e}`))}catch{t=null}return c.set(e,t),t}(i),o[0]=i,o[1]=l):l=o[1];let u=l;if(u){let e;return o[2]!==u?(e=(0,t.jsx)("img",{src:u,alt:"",className:s.default.Bitmap}),o[2]=u,o[3]=e):e=o[3],e}if(/bullet/i.test(i)){let e;return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:s.default.Bullet,children:"•"}),o[4]=e):e=o[4],e}return null}let p=/<(?:font|color|bitmap|just|lmargin|a):/i;function d(e){let o,i,n=(0,a.c)(4),{markup:r}=e;n[0]!==r?(o=function(e){let a=e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:"text",value:e}:null;{let[t,...a]=e.split(":");return u.has(t.toLowerCase())?{type:"tag",name:t,args:a}:{type:"text",value:`<${e}>`}}}).filter(e=>null!=e),o={type:"span",source:"root",style:{},children:[]},i=o,n=[i],r=e=>null!=e.children&&e.children.some(e=>"string"==typeof e||r(e));for(let e of a)switch(e.type){case"text":i.children.push(e.value);break;case"tag":switch(e.name){case"spush":{let e={type:"span",source:"spush",style:{},children:[]};i.children.push(e),i=e,n.push(i);break}case"spop":if("root"!==i.source){let e=n.pop();for(;"spush"!==e.source;)e=n.pop();i=n[n.length-1]}break;case"lmargin":break;case"font":{let t=function(e){let[t,a]=e;return{fontDescription:t,fontSize:a?Math.max(11,Math.min(parseInt(a.trim(),10),16)):void 0}}(e.args).fontSize;if(r(i)){let e={type:"span",source:"spush",style:{fontSize:t},children:[]};i.children.push(e),i=e,n.push(i)}else i.style.fontSize=t;break}case"color":if(r(i)){let t={type:"span",source:"spush",style:{color:`#${e.args[0].trim()}`},children:[]};i.children.push(t),i=t,n.push(i)}else i.style.color=`#${e.args[0].trim()}`;break;case"bitmap":{let t={type:"bitmap",value:e.args[0]};i.children.push(t);break}case"a":{let t=e.args[0].trim().split(" "),a=2===t.length&&"wwwlink"===t[0]?t[1]:t[0],l={type:"a",source:"a",value:`http://${a}`,style:{},children:[]};i.children.push(l),i=l,n.push(i);break}case"/a":{let e=n.pop();for(;"a"!==e.source;)e=n.pop();i=n[n.length-1]}}}return function e(a){switch(a.type){case"span":return l.default.createElement("span",{style:0===Object.keys(a.style).length?void 0:a.style},...a.children.map(t=>"string"==typeof t?t:e(t)));case"a":return l.default.createElement("a",{href:a.value,style:0===Object.keys(a.style).length?void 0:a.style,rel:"noopener noreferrer",target:"_blank"},...a.children.map(t=>"string"==typeof t?t:e(t)));case"bitmap":return(0,t.jsx)(m,{name:a.value})}}(o)}(r),n[0]=r,n[1]=o):o=n[1];let c=o;return n[2]!==c?(i=(0,t.jsx)("div",{className:s.default.GuiMarkup,children:c}),n[2]=c,n[3]=i):i=n[3],i}var f=e.i(41973);function _(e){let o,i,n,r=(0,a.c)(7),{src:s,alt:u,className:c}=e,m=void 0===c?f.default.PreviewImage:c,[p,d]=(0,l.useState)(null);return(r[0]!==s?(o=()=>{let e,t=!1;return fetch(s).then(M).then(y).then(g).then(a=>{!t&&a&&d(e=URL.createObjectURL(a))}).catch(h),()=>{t=!0,e&&URL.revokeObjectURL(e)}},i=[s],r[0]=s,r[1]=o,r[2]=i):(o=r[1],i=r[2]),(0,l.useEffect)(o,i),p)?(r[3]!==u||r[4]!==m||r[5]!==p?(n=(0,t.jsx)("img",{src:p,alt:u,className:m}),r[3]=u,r[4]=m,r[5]=p,r[6]=n):n=r[6],n):null}function h(){}function g(e){return new Promise(t=>{let a=document.createElement("canvas");a.width=e.width,a.height=e.height,a.getContext("2d")?.drawImage(e,0,0),e.close(),a.toBlob(t)})}function y(e){return createImageBitmap(e,{colorSpaceConversion:"none"})}function M(e){return e.blob()}function v(e){let i,r,s,u,c,m,p,d,_,h,g,y=(0,a.c)(22),{track:M}=e,[v,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!0),k=(0,l.useRef)(null);y[0]!==M?(i=M.toLowerCase(),y[0]=M,y[1]=i):i=y[1];let D=`${n.RESOURCE_ROOT_URL}music/${i}.mp3`;y[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>()=>{k.current?.pause()},s=[],y[2]=r,y[3]=s):(r=y[2],s=y[3]),(0,l.useEffect)(r,s),y[4]!==v?(u=()=>{let e=k.current;e&&(v?e.pause():e.play().catch(()=>j(!1)))},y[4]=v,y[5]=u):u=y[5];let w=u;return y[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>x(!0),m=()=>x(!1),p=()=>j(!1),y[6]=c,y[7]=m,y[8]=p):(c=y[6],m=y[7],p=y[8]),y[9]!==D?(d=(0,t.jsx)("audio",{ref:k,src:D,loop:!0,onPlay:c,onPause:m,onError:p}),y[9]=D,y[10]=d):d=y[10],y[11]!==M?(_=(0,t.jsx)("span",{className:f.default.MusicTrackName,children:M}),y[11]=M,y[12]=_):_=y[12],y[13]!==b||y[14]!==v||y[15]!==w?(h=b&&(0,t.jsx)("button",{className:f.default.MusicButton,onClick:w,"aria-label":v?"Pause music":"Play music",children:v?(0,t.jsx)(o.FaVolumeUp,{}):(0,t.jsx)(o.FaVolumeMute,{})}),y[13]=b,y[14]=v,y[15]=w,y[16]=h):h=y[16],y[17]!==v||y[18]!==h||y[19]!==d||y[20]!==_?(g=(0,t.jsxs)("div",{className:f.default.MusicTrack,"data-playing":v,children:[d,_,h]}),y[17]=v,y[18]=h,y[19]=d,y[20]=_,y[21]=g):g=y[21],g}function x(e){var o,s,u;let c,m,h,g,y,M,x,D,w,I,N,B,S,C,P,L,T,X,E,O,R,U,F,G,$,K,Q,q,W,Z,A,z,H,V,J,Y,ee,et=(0,a.c)(100),{onClose:ea,missionName:el,missionType:eo}=e,{data:ei}=((ee=(0,a.c)(2))[0]!==el?(Y={queryKey:["parsedMission",el],queryFn:()=>(0,n.loadMission)(el)},ee[0]=el,ee[1]=Y):Y=ee[1],(0,i.useQuery)(Y)),en=(0,l.useRef)(null);et[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{en.current?.focus();try{document.exitPointerLock()}catch{}},m=[],et[0]=c,et[1]=m):(c=et[0],m=et[1]),(0,l.useEffect)(c,m),et[2]!==ea?(h=()=>{let e=e=>{if("Escape"===e.key)ea();else if("k"===e.key&&(e.metaKey||e.ctrlKey))return void ea();e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",k,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",k,{capture:!0})}},g=[ea],et[2]=ea,et[3]=h,et[4]=g):(h=et[3],g=et[4]),(0,l.useEffect)(h,g),et[5]!==ei?(y=ei?function(e){for(let t of e.body){if("ObjectDeclaration"!==t.type)continue;let{instanceName:e,body:a}=t;if(e&&"Identifier"===e.type&&"missiongroup"===e.name.toLowerCase()){let e={};for(let t of a){if("Assignment"!==t.type)continue;let{target:a,value:l}=t;"Identifier"===a.type&&"StringLiteral"===l.type&&(e[a.name.toLowerCase()]=l.value)}return e}}return{}}(ei.ast):{},et[5]=ei,et[6]=y):y=et[6];let er=y;et[7]!==el||et[8]!==ei?(M=ei?function(e,t){if(e)try{let t=(0,r.getStandardTextureResourceKey)(`textures/gui/${e}`);return(0,n.getUrlForPath)(t)}catch{}try{let e=(0,r.getStandardTextureResourceKey)(`textures/gui/Load_${t}`);return(0,n.getUrlForPath)(e)}catch{}return null}(ei.bitmap,el):null,et[7]=el,et[8]=ei,et[9]=M):M=et[9];let es=M,eu=ei?.displayName??el;et[10]!==eo?(x=eo.toLowerCase(),et[10]=eo,et[11]=x):x=et[11];let ec="singleplayer"===x,em=er.musictrack;if(et[12]!==es||et[13]!==eu||et[14]!==ec||et[15]!==eo||et[16]!==ea||et[17]!==ei){let e,a,l,i,n,r,c=ei?.missionString?(o=ei.missionString,r=eo.toUpperCase(),o.split("\n").flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(r)?[]:[e.replace(/^\[[^\]]+\]/,"")]}).join("\n")):null;if(et[36]!==ei?.missionQuote){if(s=i=ei?.missionQuote?.trim()??"",l="",e="",!(a=p.test(s)))for(let t of i.split("\n")){let a=t.trim();a.match(/^--[^-]/)?e=a.replace(/^-+\s*/,"").trim():a&&(l+=(l?"\n":"")+a)}et[36]=ei?.missionQuote,et[37]=e,et[38]=a,et[39]=l,et[40]=i}else e=et[37],a=et[38],l=et[39],i=et[40];(U=f.default.Overlay,F=ea,C=en,P=f.default.Dialog,L=j,T=b,X="dialog",E="true",O="Map Information",R=-1,S=f.default.Body,G=f.default.Left,et[41]!==es||et[42]!==eu||et[43]!==ec?($=es&&ec&&(0,t.jsx)(_,{className:f.default.PreviewImageFloating,src:es,alt:`${eu} preview`},es),et[41]=es,et[42]=eu,et[43]=ec,et[44]=$):$=et[44],et[45]!==eu?(D=(0,t.jsx)("h1",{className:f.default.Title,children:eu}),et[45]=eu,et[46]=D):D=et[46],et[47]!==ei?(n=ei?.planetName&&(0,t.jsx)("span",{className:f.default.MapPlanet,children:ei.planetName}),et[47]=ei,et[48]=n):n=et[48],et[49]!==n?(w=(0,t.jsx)("div",{className:f.default.MapMeta,children:n}),et[49]=n,et[50]=w):w=et[50],et[51]!==e||et[52]!==a||et[53]!==l||et[54]!==i?(I=a?(0,t.jsx)("blockquote",{className:f.default.MapQuote,children:(0,t.jsx)(d,{markup:i})}):l?(0,t.jsxs)("blockquote",{className:f.default.MapQuote,children:[(0,t.jsx)("p",{children:l}),e&&(0,t.jsxs)("cite",{children:["— ",e]})]}):null,et[51]=e,et[52]=a,et[53]=l,et[54]=i,et[55]=I):I=et[55],et[56]!==ei)?(N=ei?.missionBlurb&&(0,t.jsx)("div",{className:f.default.MapBlurb,children:(u=ei.missionBlurb,p.test(u))?(0,t.jsx)(d,{markup:ei.missionBlurb.trim()}):ei.missionBlurb.trim()}),et[56]=ei,et[57]=N):N=et[57],B=c&&c.trim()&&(0,t.jsx)("div",{className:f.default.Section,children:(0,t.jsx)(d,{markup:c})}),et[12]=es,et[13]=eu,et[14]=ec,et[15]=eo,et[16]=ea,et[17]=ei,et[18]=D,et[19]=w,et[20]=I,et[21]=N,et[22]=B,et[23]=S,et[24]=C,et[25]=P,et[26]=L,et[27]=T,et[28]=X,et[29]=E,et[30]=O,et[31]=R,et[32]=U,et[33]=F,et[34]=G,et[35]=$}else D=et[18],w=et[19],I=et[20],N=et[21],B=et[22],S=et[23],C=et[24],P=et[25],L=et[26],T=et[27],X=et[28],E=et[29],O=et[30],R=et[31],U=et[32],F=et[33],G=et[34],$=et[35];return et[58]!==ei?(K=ei?.missionBriefing&&(0,t.jsxs)("div",{className:f.default.Section,children:[(0,t.jsx)("h2",{className:f.default.SectionTitle,children:"Mission Briefing"}),(0,t.jsx)(d,{markup:ei.missionBriefing})]}),et[58]=ei,et[59]=K):K=et[59],et[60]!==em?(Q=em&&(0,t.jsx)(v,{track:em}),et[60]=em,et[61]=Q):Q=et[61],et[62]!==D||et[63]!==w||et[64]!==I||et[65]!==N||et[66]!==B||et[67]!==K||et[68]!==Q||et[69]!==G||et[70]!==$?(q=(0,t.jsxs)("div",{className:G,children:[$,D,w,I,N,B,K,Q]}),et[62]=D,et[63]=w,et[64]=I,et[65]=N,et[66]=B,et[67]=K,et[68]=Q,et[69]=G,et[70]=$,et[71]=q):q=et[71],et[72]!==es||et[73]!==eu||et[74]!==ec?(W=es&&!ec&&(0,t.jsx)(_,{src:es,alt:`${eu} preview`},es),et[72]=es,et[73]=eu,et[74]=ec,et[75]=W):W=et[75],et[76]!==S||et[77]!==q||et[78]!==W?(Z=(0,t.jsxs)("div",{className:S,children:[q,W]}),et[76]=S,et[77]=q,et[78]=W,et[79]=Z):Z=et[79],et[80]!==ea?(A=(0,t.jsx)("button",{className:f.default.CloseButton,onClick:ea,children:"Close"}),et[80]=ea,et[81]=A):A=et[81],et[82]===Symbol.for("react.memo_cache_sentinel")?(z=(0,t.jsx)("span",{className:f.default.Hint,children:"Esc to close"}),et[82]=z):z=et[82],et[83]!==A?(H=(0,t.jsxs)("div",{className:f.default.Footer,children:[A,z]}),et[83]=A,et[84]=H):H=et[84],et[85]!==C||et[86]!==P||et[87]!==L||et[88]!==T||et[89]!==X||et[90]!==E||et[91]!==O||et[92]!==R||et[93]!==Z||et[94]!==H?(V=(0,t.jsxs)("div",{ref:C,className:P,onClick:L,onKeyDown:T,role:X,"aria-modal":E,"aria-label":O,tabIndex:R,children:[Z,H]}),et[85]=C,et[86]=P,et[87]=L,et[88]=T,et[89]=X,et[90]=E,et[91]=O,et[92]=R,et[93]=Z,et[94]=H,et[95]=V):V=et[95],et[96]!==U||et[97]!==F||et[98]!==V?(J=(0,t.jsx)("div",{className:U,onClick:F,children:V}),et[96]=U,et[97]=F,et[98]=V,et[99]=J):J=et[99],J}function b(e){return e.stopPropagation()}function j(e){return e.stopPropagation()}function k(e){e.stopImmediatePropagation()}e.s(["MapInfoDialog",()=>x],94247)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/994d42eb1af43673.js b/docs/_next/static/chunks/926fdfc108de2b2e.js similarity index 94% rename from docs/_next/static/chunks/994d42eb1af43673.js rename to docs/_next/static/chunks/926fdfc108de2b2e.js index 095c7ed8..13ac8b4c 100644 --- a/docs/_next/static/chunks/994d42eb1af43673.js +++ b/docs/_next/static/chunks/926fdfc108de2b2e.js @@ -1,4 +1,4 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51475,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(71753);let s=(0,r.createContext)(null);function n({children:e}){let n=(0,r.useRef)(void 0),a=(0,r.useRef)(0),o=(0,r.useRef)(0);(0,i.useFrame)((e,t)=>{for(a.current+=t;a.current>=.03125;)if(a.current-=.03125,o.current++,n.current)for(let e of n.current)e(o.current)});let l=(0,r.useCallback)(e=>(n.current??=new Set,n.current.add(e),()=>{n.current.delete(e)}),[]),u=(0,r.useCallback)(()=>o.current,[]),c=(0,r.useMemo)(()=>({subscribe:l,getTick:u}),[l,u]);return(0,t.jsx)(s.Provider,{value:c,children:e})}function a(e){let t=(0,r.useContext)(s);if(!t)throw Error("useTick must be used within a TickProvider");let i=(0,r.useRef)(e);i.current=e,(0,r.useEffect)(()=>t.subscribe(e=>i.current(e)),[t])}e.s(["TICK_RATE",0,32,"TickProvider",()=>n,"useTick",()=>a])},47071,99143,e=>{"use strict";var t=e.i(71645),r=e.i(90072),i=e.i(15080),s=e.i(40859);e.s(["useLoader",()=>s.G],99143);var s=s;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let o=(0,i.useThree)(e=>e.gl),l=(0,s.G)(r.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(l)},[a]),(0,t.useEffect)(()=>{if("initTexture"in o){let e=[];Array.isArray(l)?e=l:l instanceof r.Texture?e=[l]:n(l)&&(e=Object.values(l)),e.forEach(e=>{e instanceof r.Texture&&o.initTexture(e)})}},[o,l]),(0,t.useMemo)(()=>{if(!n(e))return l;{let t={},r=0;for(let i in e)t[i]=l[r++];return t}},[e,l])}a.preload=e=>s.G.preload(r.TextureLoader,e),a.clear=e=>s.G.clear(r.TextureLoader,e),e.s(["useTexture",()=>a],47071)},75567,e=>{"use strict";var t=e.i(90072);let r=new t.ImageBitmapLoader,i=new Map;function s(e,s){let n=i.get(e);if(n)return s&&n.image&&s(n),n;let a=new t.Texture;return a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s?.(a)}),a}function n(e){let s=i.get(e);return s?s.image?Promise.resolve(s):new Promise(e=>{let t=()=>{s.image?e(s):setTimeout(t,16)};t()}):new Promise((s,n)=>{let a=new t.Texture;a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s(a)},void 0,n)})}function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:s=!1}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=16,s?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function o(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}e.s(["loadTexture",()=>s,"loadTextureAsync",()=>n,"setupMask",()=>o,"setupTexture",()=>a])},47021,e=>{"use strict";var t=e.i(8560);let r=` +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51475,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(71753);let s=(0,r.createContext)(null);function n({children:e}){let n=(0,r.useRef)(void 0),a=(0,r.useRef)(0),o=(0,r.useRef)(0);(0,i.useFrame)((e,t)=>{for(a.current+=t;a.current>=.03125;)if(a.current-=.03125,o.current++,n.current)for(let e of n.current)e(o.current)});let l=(0,r.useCallback)(e=>(n.current??=new Set,n.current.add(e),()=>{n.current.delete(e)}),[]),u=(0,r.useCallback)(()=>o.current,[]),c=(0,r.useMemo)(()=>({subscribe:l,getTick:u}),[l,u]);return(0,t.jsx)(s.Provider,{value:c,children:e})}function a(e){let t=(0,r.useContext)(s);if(!t)throw Error("useTick must be used within a TickProvider");let i=(0,r.useRef)(e);i.current=e,(0,r.useEffect)(()=>t.subscribe(e=>i.current(e)),[t])}e.s(["TICK_RATE",0,32,"TickProvider",()=>n,"useTick",()=>a])},47071,99143,e=>{"use strict";var t=e.i(71645),r=e.i(90072),i=e.i(15080),s=e.i(40859);e.s(["useLoader",()=>s.G],99143);var s=s;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let o=(0,i.useThree)(e=>e.gl),l=(0,s.G)(r.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(l)},[a]),(0,t.useEffect)(()=>{if("initTexture"in o){let e=[];Array.isArray(l)?e=l:l instanceof r.Texture?e=[l]:n(l)&&(e=Object.values(l)),e.forEach(e=>{e instanceof r.Texture&&o.initTexture(e)})}},[o,l]),(0,t.useMemo)(()=>{if(!n(e))return l;{let t={},r=0;for(let i in e)t[i]=l[r++];return t}},[e,l])}a.preload=e=>s.G.preload(r.TextureLoader,e),a.clear=e=>s.G.clear(r.TextureLoader,e),e.s(["useTexture",()=>a],47071)},75567,56893,e=>{"use strict";var t=e.i(90072);let r=new t.ImageBitmapLoader,i=new Map;function s(e,s){let n=i.get(e);if(n)return s&&n.image&&s(n),n;let a=new t.Texture;return a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s?.(a)}),a}function n(e){let s=i.get(e);return s?s.image?Promise.resolve(s):new Promise(e=>{let t=()=>{s.image?e(s):setTimeout(t,16)};t()}):new Promise((s,n)=>{let a=new t.Texture;a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s(a)},void 0,n)})}function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:s=!1,anisotropy:n}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=n??1,s?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function o(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}e.s(["loadTexture",()=>s,"loadTextureAsync",()=>n,"setupMask",()=>o,"setupTexture",()=>a],75567);var l=e.i(15080);function u(){return(0,l.useThree)(c)}function c(e){return e.gl.capabilities.getMaxAnisotropy()}e.s(["useAnisotropy",()=>u],56893)},47021,e=>{"use strict";var t=e.i(8560);let r=` #ifdef USE_FOG // Check fog enabled uniform - allows toggling without shader recompilation #ifdef USE_VOLUMETRIC_FOG @@ -171,7 +171,7 @@ uniform bool fogEnabled; #define USE_FOG_WORLD_POSITION varying vec3 vFogWorldPosition; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",r)}e.s(["fogFragmentShader",0,r,"injectCustomFog",()=>s,"installCustomFogShader",()=>i])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function r(e,i,s=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(i),t.fogEnabled.value=s}function i(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function s(e){let t=new Float32Array(12);for(let r=0;r<3;r++){let i=4*r,s=e[r];s&&(t[i+0]=s.visibleDistance,t[i+1]=s.minHeight,t[i+2]=s.maxHeight,t[i+3]=s.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>s,"resetGlobalFogUniforms",()=>i,"updateGlobalFogUniforms",()=>r])},67191,e=>{e.v({Label:"FloatingLabel-module__8y09Ka__Label"})},89887,e=>{"use strict";var t=e.i(43476),r=e.i(932),i=e.i(71645),s=e.i(90072),n=e.i(71753),a=e.i(60099),o=e.i(67191);let l=[0,0,0],u=new s.Vector3,c=(0,i.memo)(function(e){let s,c,h,d=(0,r.c)(11),{children:f,color:p,position:m,opacity:v}=e,g=void 0===p?"white":p,y=void 0===m?l:m,b=void 0===v?"fadeWithDistance":v,S="fadeWithDistance"===b,x=(0,i.useRef)(null),[T,F]=(0,i.useState)(0!==b),O=(0,i.useRef)(null);return d[0]!==S||d[1]!==T||d[2]!==b?(s=e=>{var t,r,i;let s,{camera:n}=e,a=x.current;if(!a)return;a.getWorldPosition(u);let o=(t=u.x,r=u.y,i=u.z,-((t-(s=n.matrixWorld.elements)[12])*s[8])+-((r-s[13])*s[9])+-((i-s[14])*s[10])<0);if(S){let e=o?1/0:n.position.distanceTo(u),t=e<200;if(T!==t&&F(t),O.current&&t){let t=Math.max(0,Math.min(1,1-e/200));O.current.style.opacity=t.toString()}}else{let e=!o&&0!==b;T!==e&&F(e),O.current&&(O.current.style.opacity=b.toString())}},d[0]=S,d[1]=T,d[2]=b,d[3]=s):s=d[3],(0,n.useFrame)(s),d[4]!==f||d[5]!==g||d[6]!==T||d[7]!==y?(c=T?(0,t.jsx)(a.Html,{position:y,center:!0,children:(0,t.jsx)("div",{ref:O,className:o.default.Label,style:{color:g},children:f})}):null,d[4]=f,d[5]=g,d[6]=T,d[7]=y,d[8]=c):c=d[8],d[9]!==c?(h=(0,t.jsx)("group",{ref:x,children:c}),d[9]=c,d[10]=h):h=d[10],h});e.s(["FloatingLabel",0,c])},79123,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let i=(0,r.createContext)(null),s=(0,r.createContext)(null),n=(0,r.createContext)(null);function a(){return(0,r.useContext)(i)}function o(){return(0,r.useContext)(s)}function l(){return(0,r.useContext)(n)}function u({children:e,fogEnabledOverride:a,onClearFogEnabledOverride:o}){let[l,u]=(0,r.useState)(!0),[c,h]=(0,r.useState)(!1),[d,f]=(0,r.useState)(1),[p,m]=(0,r.useState)(90),[v,g]=(0,r.useState)(!1),[y,b]=(0,r.useState)(.75),[S,x]=(0,r.useState)(!0),[T,F]=(0,r.useState)(!1),[O,R]=(0,r.useState)("moveLookStick"),[E,w]=(0,r.useState)("MapGenius"),[M,C]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[I,_]=(0,r.useState)(!1),[U,Q]=(0,r.useState)(!1),k=(0,r.useCallback)(e=>{u(e),o()},[o]),L=(0,r.useMemo)(()=>({fogEnabled:a??l,setFogEnabled:k,highQualityFog:c,setHighQualityFog:h,fov:p,setFov:m,audioEnabled:v,setAudioEnabled:g,animationEnabled:S,setAnimationEnabled:x,warriorName:E,setWarriorName:w,audioVolume:y,setAudioVolume:b}),[l,a,k,c,p,v,S,E,y]),j=(0,r.useMemo)(()=>({debugMode:T,setDebugMode:F,renderOnDemand:U,setRenderOnDemand:Q}),[T,F,U]),H=(0,r.useMemo)(()=>({speedMultiplier:d,setSpeedMultiplier:f,touchMode:O,setTouchMode:R,invertScroll:M,setInvertScroll:C,invertDrag:P,setInvertDrag:D,invertJoystick:I,setInvertJoystick:_}),[d,f,O,R,M,P,I]);(0,r.useEffect)(()=>{let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&F(e.debugMode),null!=e.audioEnabled&&g(e.audioEnabled),null!=e.animationEnabled&&x(e.animationEnabled),null!=e.fogEnabled&&u(e.fogEnabled),null!=e.highQualityFog&&h(e.highQualityFog),null!=e.speedMultiplier&&f(Math.max(0,Math.min(1,e.speedMultiplier))),null!=e.fov&&m(e.fov),null!=e.touchMode&&R(e.touchMode),null!=e.warriorName&&w(e.warriorName),null!=e.audioVolume&&b(e.audioVolume),null!=e.invertScroll&&C(e.invertScroll),null!=e.invertDrag&&D(e.invertDrag),null!=e.invertJoystick&&_(e.invertJoystick)},[]);let W=(0,r.useRef)(null);return(0,r.useEffect)(()=>(W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:l,highQualityFog:c,speedMultiplier:d,fov:p,audioEnabled:v,animationEnabled:S,debugMode:T,touchMode:O,warriorName:E,audioVolume:y,invertScroll:M,invertDrag:P,invertJoystick:I}))}catch(e){}},500),()=>{W.current&&clearTimeout(W.current)}),[l,c,d,p,v,S,T,O,E,y,M,P,I]),(0,t.jsx)(i.Provider,{value:L,children:(0,t.jsx)(s.Provider,{value:j,children:(0,t.jsx)(n.Provider,{value:H,children:e})})})}e.s(["SettingsProvider",()=>u,"useControls",()=>l,"useDebug",()=>o,"useSettings",()=>a])},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},60099,e=>{"use strict";let t,r;var i=e.i(31067),s=e.i(71645),n=e.i(88014),a=e.i(90072),o=e.i(15080),l=e.i(71753);let u=new a.Vector3,c=new a.Vector3,h=new a.Vector3,d=new a.Vector2;function f(e,t,r){let i=u.setFromMatrixPosition(e.matrixWorld);i.project(t);let s=r.width/2,n=r.height/2;return[i.x*s+s,-(i.y*n)+n]}let p=e=>1e-10>Math.abs(e)?0:e;function m(e,t,r=""){let i="matrix3d(";for(let r=0;16!==r;r++)i+=p(t[r]*e.elements[r])+(15!==r?",":")");return r+i}let v=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>m(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>m(e,r(t),"translate(-50%,-50%)")),y=s.forwardRef(({children:e,eps:t=.001,style:r,className:m,prepend:y,center:b,fullscreen:S,portal:x,distanceFactor:T,sprite:F=!1,transform:O=!1,occlude:R,onOcclude:E,castShadow:w,receiveShadow:M,material:C,geometry:P,zIndexRange:D=[0x1000037,0],calculatePosition:I=f,as:_="div",wrapperClass:U,pointerEvents:Q="auto",...k},L)=>{let{gl:j,camera:H,scene:W,size:A,raycaster:V,events:q,viewport:G}=(0,o.useThree)(),[z]=s.useState(()=>document.createElement(_)),N=s.useRef(null),$=s.useRef(null),K=s.useRef(0),Y=s.useRef([0,0]),B=s.useRef(null),J=s.useRef(null),Z=(null==x?void 0:x.current)||q.connected||j.domElement.parentNode,X=s.useRef(null),ee=s.useRef(!1),et=s.useMemo(()=>{var e;return R&&"blending"!==R||Array.isArray(R)&&R.length&&(e=R[0])&&"object"==typeof e&&"current"in e},[R]);s.useLayoutEffect(()=>{let e=j.domElement;R&&"blending"===R?(e.style.zIndex=`${Math.floor(D[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[R]),s.useLayoutEffect(()=>{if($.current){let e=N.current=n.createRoot(z);if(W.updateMatrixWorld(),O)z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=I($.current,H,A);z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Z&&(y?Z.prepend(z):Z.appendChild(z)),()=>{Z&&Z.removeChild(z),e.unmount()}}},[Z,O]),s.useLayoutEffect(()=>{U&&(z.className=U)},[U]);let er=s.useMemo(()=>O?{position:"absolute",top:0,left:0,width:A.width,height:A.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...S&&{top:-A.height/2,left:-A.width/2,width:A.width,height:A.height},...r},[r,b,S,A,O]),ei=s.useMemo(()=>({position:"absolute",pointerEvents:Q}),[Q]);s.useLayoutEffect(()=>{var t,i;ee.current=!1,O?null==(t=N.current)||t.render(s.createElement("div",{ref:B,style:er},s.createElement("div",{ref:J,style:ei},s.createElement("div",{ref:L,className:m,style:r,children:e})))):null==(i=N.current)||i.render(s.createElement("div",{ref:L,style:er,className:m,children:e}))});let es=s.useRef(!0);(0,l.useFrame)(e=>{if($.current){H.updateMatrixWorld(),$.current.updateWorldMatrix(!0,!1);let e=O?Y.current:I($.current,H,A);if(O||Math.abs(K.current-H.zoom)>t||Math.abs(Y.current[0]-e[0])>t||Math.abs(Y.current[1]-e[1])>t){var r;let t,i,s,n,o=(r=$.current,t=u.setFromMatrixPosition(r.matrixWorld),i=c.setFromMatrixPosition(H.matrixWorld),s=t.sub(i),n=H.getWorldDirection(h),s.angleTo(n)>Math.PI/2),l=!1;et&&(Array.isArray(R)?l=R.map(e=>e.current):"blending"!==R&&(l=[W]));let f=es.current;l?es.current=function(e,t,r,i){let s=u.setFromMatrixPosition(e.matrixWorld),n=s.clone();n.project(t),d.set(n.x,n.y),r.setFromCamera(d,t);let a=r.intersectObjects(i,!0);if(a.length){let e=a[0].distance;return s.distanceTo(r.ray.origin)({vertexShader:O?void 0:` +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",r)}e.s(["fogFragmentShader",0,r,"injectCustomFog",()=>s,"installCustomFogShader",()=>i])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function r(e,i,s=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(i),t.fogEnabled.value=s}function i(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function s(e){let t=new Float32Array(12);for(let r=0;r<3;r++){let i=4*r,s=e[r];s&&(t[i+0]=s.visibleDistance,t[i+1]=s.minHeight,t[i+2]=s.maxHeight,t[i+3]=s.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>s,"resetGlobalFogUniforms",()=>i,"updateGlobalFogUniforms",()=>r])},67191,e=>{e.v({Label:"FloatingLabel-module__8y09Ka__Label"})},89887,e=>{"use strict";var t=e.i(43476),r=e.i(932),i=e.i(71645),s=e.i(90072),n=e.i(71753),a=e.i(60099),o=e.i(67191);let l=[0,0,0],u=new s.Vector3,c=(0,i.memo)(function(e){let s,c,h,d=(0,r.c)(11),{children:f,color:p,position:m,opacity:v}=e,g=void 0===p?"white":p,y=void 0===m?l:m,b=void 0===v?"fadeWithDistance":v,S="fadeWithDistance"===b,x=(0,i.useRef)(null),[T,F]=(0,i.useState)(0!==b),O=(0,i.useRef)(null);return d[0]!==S||d[1]!==T||d[2]!==b?(s=e=>{var t,r,i;let s,{camera:n}=e,a=x.current;if(!a)return;a.getWorldPosition(u);let o=(t=u.x,r=u.y,i=u.z,-((t-(s=n.matrixWorld.elements)[12])*s[8])+-((r-s[13])*s[9])+-((i-s[14])*s[10])<0);if(S){let e=o?1/0:n.position.distanceTo(u),t=e<200;if(T!==t&&F(t),O.current&&t){let t=Math.max(0,Math.min(1,1-e/200));O.current.style.opacity=t.toString()}}else{let e=!o&&0!==b;T!==e&&F(e),O.current&&(O.current.style.opacity=b.toString())}},d[0]=S,d[1]=T,d[2]=b,d[3]=s):s=d[3],(0,n.useFrame)(s),d[4]!==f||d[5]!==g||d[6]!==T||d[7]!==y?(c=T?(0,t.jsx)(a.Html,{position:y,center:!0,children:(0,t.jsx)("div",{ref:O,className:o.default.Label,style:{color:g},children:f})}):null,d[4]=f,d[5]=g,d[6]=T,d[7]=y,d[8]=c):c=d[8],d[9]!==c?(h=(0,t.jsx)("group",{ref:x,children:c}),d[9]=c,d[10]=h):h=d[10],h});e.s(["FloatingLabel",0,c])},79123,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let i=(0,r.createContext)(null),s=(0,r.createContext)(null),n=(0,r.createContext)(null);function a(){return(0,r.useContext)(i)}function o(){return(0,r.useContext)(s)}function l(){return(0,r.useContext)(n)}function u({children:e,fogEnabledOverride:a,onClearFogEnabledOverride:o}){let[l,u]=(0,r.useState)(!0),[c,h]=(0,r.useState)(!1),[d,f]=(0,r.useState)(1),[p,m]=(0,r.useState)(90),[v,g]=(0,r.useState)(!1),[y,b]=(0,r.useState)(.75),[S,x]=(0,r.useState)(!0),[T,F]=(0,r.useState)(!1),[O,R]=(0,r.useState)("moveLookStick"),[E,w]=(0,r.useState)("MapGenius"),[M,C]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[I,_]=(0,r.useState)(!1),[U,Q]=(0,r.useState)(!1),k=(0,r.useCallback)(e=>{u(e),o()},[o]),L=(0,r.useMemo)(()=>({fogEnabled:a??l,setFogEnabled:k,highQualityFog:c,setHighQualityFog:h,fov:p,setFov:m,audioEnabled:v,setAudioEnabled:g,animationEnabled:S,setAnimationEnabled:x,warriorName:E,setWarriorName:w,audioVolume:y,setAudioVolume:b}),[l,a,k,c,p,v,S,E,y]),j=(0,r.useMemo)(()=>({debugMode:T,setDebugMode:F,renderOnDemand:U,setRenderOnDemand:Q}),[T,F,U]),H=(0,r.useMemo)(()=>({speedMultiplier:d,setSpeedMultiplier:f,touchMode:O,setTouchMode:R,invertScroll:M,setInvertScroll:C,invertDrag:P,setInvertDrag:D,invertJoystick:I,setInvertJoystick:_}),[d,f,O,R,M,P,I]);(0,r.useEffect)(()=>{let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&F(e.debugMode),null!=e.audioEnabled&&g(e.audioEnabled),null!=e.animationEnabled&&x(e.animationEnabled),null!=e.fogEnabled&&u(e.fogEnabled),null!=e.highQualityFog&&h(e.highQualityFog),null!=e.speedMultiplier&&f(Math.max(0,Math.min(1,e.speedMultiplier))),null!=e.fov&&m(e.fov),null!=e.touchMode&&R(e.touchMode),null!=e.warriorName&&w(e.warriorName),null!=e.audioVolume&&b(e.audioVolume),null!=e.invertScroll&&C(e.invertScroll),null!=e.invertDrag&&D(e.invertDrag),null!=e.invertJoystick&&_(e.invertJoystick)},[]);let A=(0,r.useRef)(null);return(0,r.useEffect)(()=>(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:l,highQualityFog:c,speedMultiplier:d,fov:p,audioEnabled:v,animationEnabled:S,debugMode:T,touchMode:O,warriorName:E,audioVolume:y,invertScroll:M,invertDrag:P,invertJoystick:I}))}catch(e){}},500),()=>{A.current&&clearTimeout(A.current)}),[l,c,d,p,v,S,T,O,E,y,M,P,I]),(0,t.jsx)(i.Provider,{value:L,children:(0,t.jsx)(s.Provider,{value:j,children:(0,t.jsx)(n.Provider,{value:H,children:e})})})}e.s(["SettingsProvider",()=>u,"useControls",()=>l,"useDebug",()=>o,"useSettings",()=>a])},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},60099,e=>{"use strict";let t,r;var i=e.i(31067),s=e.i(71645),n=e.i(88014),a=e.i(90072),o=e.i(15080),l=e.i(71753);let u=new a.Vector3,c=new a.Vector3,h=new a.Vector3,d=new a.Vector2;function f(e,t,r){let i=u.setFromMatrixPosition(e.matrixWorld);i.project(t);let s=r.width/2,n=r.height/2;return[i.x*s+s,-(i.y*n)+n]}let p=e=>1e-10>Math.abs(e)?0:e;function m(e,t,r=""){let i="matrix3d(";for(let r=0;16!==r;r++)i+=p(t[r]*e.elements[r])+(15!==r?",":")");return r+i}let v=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>m(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>m(e,r(t),"translate(-50%,-50%)")),y=s.forwardRef(({children:e,eps:t=.001,style:r,className:m,prepend:y,center:b,fullscreen:S,portal:x,distanceFactor:T,sprite:F=!1,transform:O=!1,occlude:R,onOcclude:E,castShadow:w,receiveShadow:M,material:C,geometry:P,zIndexRange:D=[0x1000037,0],calculatePosition:I=f,as:_="div",wrapperClass:U,pointerEvents:Q="auto",...k},L)=>{let{gl:j,camera:H,scene:A,size:W,raycaster:V,events:q,viewport:G}=(0,o.useThree)(),[z]=s.useState(()=>document.createElement(_)),N=s.useRef(null),$=s.useRef(null),K=s.useRef(0),Y=s.useRef([0,0]),B=s.useRef(null),J=s.useRef(null),Z=(null==x?void 0:x.current)||q.connected||j.domElement.parentNode,X=s.useRef(null),ee=s.useRef(!1),et=s.useMemo(()=>{var e;return R&&"blending"!==R||Array.isArray(R)&&R.length&&(e=R[0])&&"object"==typeof e&&"current"in e},[R]);s.useLayoutEffect(()=>{let e=j.domElement;R&&"blending"===R?(e.style.zIndex=`${Math.floor(D[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[R]),s.useLayoutEffect(()=>{if($.current){let e=N.current=n.createRoot(z);if(A.updateMatrixWorld(),O)z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=I($.current,H,W);z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Z&&(y?Z.prepend(z):Z.appendChild(z)),()=>{Z&&Z.removeChild(z),e.unmount()}}},[Z,O]),s.useLayoutEffect(()=>{U&&(z.className=U)},[U]);let er=s.useMemo(()=>O?{position:"absolute",top:0,left:0,width:W.width,height:W.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...S&&{top:-W.height/2,left:-W.width/2,width:W.width,height:W.height},...r},[r,b,S,W,O]),ei=s.useMemo(()=>({position:"absolute",pointerEvents:Q}),[Q]);s.useLayoutEffect(()=>{var t,i;ee.current=!1,O?null==(t=N.current)||t.render(s.createElement("div",{ref:B,style:er},s.createElement("div",{ref:J,style:ei},s.createElement("div",{ref:L,className:m,style:r,children:e})))):null==(i=N.current)||i.render(s.createElement("div",{ref:L,style:er,className:m,children:e}))});let es=s.useRef(!0);(0,l.useFrame)(e=>{if($.current){H.updateMatrixWorld(),$.current.updateWorldMatrix(!0,!1);let e=O?Y.current:I($.current,H,W);if(O||Math.abs(K.current-H.zoom)>t||Math.abs(Y.current[0]-e[0])>t||Math.abs(Y.current[1]-e[1])>t){var r;let t,i,s,n,o=(r=$.current,t=u.setFromMatrixPosition(r.matrixWorld),i=c.setFromMatrixPosition(H.matrixWorld),s=t.sub(i),n=H.getWorldDirection(h),s.angleTo(n)>Math.PI/2),l=!1;et&&(Array.isArray(R)?l=R.map(e=>e.current):"blending"!==R&&(l=[A]));let f=es.current;l?es.current=function(e,t,r,i){let s=u.setFromMatrixPosition(e.matrixWorld),n=s.clone();n.project(t),d.set(n.x,n.y),r.setFromCamera(d,t);let a=r.intersectObjects(i,!0);if(a.length){let e=a[0].distance;return s.distanceTo(r.ray.origin)({vertexShader:O?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite diff --git a/docs/_next/static/chunks/96ae05ebba99dcff.js b/docs/_next/static/chunks/96ae05ebba99dcff.js deleted file mode 100644 index e676475d..00000000 --- a/docs/_next/static/chunks/96ae05ebba99dcff.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66789,e=>{"use strict";var t=e.i(43476),a=e.i(71645),i=e.i(71753),r=e.i(90072),n=e.i(58647),o=e.i(82816),l=e.i(85557),s=e.i(71505),u=e.i(91907),c=e.i(25947),m=e.i(93784);function f({entity:e}){let i=e.weaponShape,r=e.shapeName,n=(0,u.useStaticShape)(r),o=(0,u.useStaticShape)(i),s=(0,a.useMemo)(()=>{let e,t,a=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(i),r=(0,l.getPosedNodeTransform)(n.scene,n.animations,"Mount0",[a]);if(!r)return{position:void 0,quaternion:void 0};let s=(0,l.getPosedNodeTransform)(o.scene,o.animations,"Mountpoint");if(s){let a=s.quaternion.clone().invert(),i=s.position.clone().negate().applyQuaternion(a);t=r.quaternion.clone().multiply(a),e=i.clone().applyQuaternion(r.quaternion).add(r.position)}else e=r.position.clone(),t=r.quaternion.clone();return{position:e.applyQuaternion(l._r90),quaternion:l._r90.clone().multiply(t).multiply(l._r90inv)}},[n,o]),m=(0,a.useMemo)(()=>({_class:"weapon",_className:"Weapon",_id:0}),[]);return(0,t.jsx)(c.ShapeInfoProvider,{object:m,shapeName:i,type:"Item",children:(0,t.jsx)("group",{position:s.position,quaternion:s.quaternion,children:(0,t.jsx)(u.ShapeRenderer,{loadingColor:"#4488ff"})})})}function p({entity:e}){let c=m.streamPlaybackStore.getState().playback,f=(0,u.useStaticShape)(e.shapeName),p=(0,a.useRef)(null),h=(0,a.useRef)((0,n.effectNow)()),d=(0,a.useRef)(Math.random()*Math.PI*2),y=(0,a.useRef)([]),g=(0,a.useMemo)(()=>{if(e.explosionDataBlockId)return c.getDataBlockData(e.explosionDataBlockId)},[e.explosionDataBlockId,c]),v=(0,a.useMemo)(()=>g?function(e){let t=e.sizes,a=e.times;if(!Array.isArray(t)||0===t.length)return{times:[0,1],sizes:[[1,1,1],[1,1,1]]};let i=t.map(e=>[e.x/100,e.y/100,e.z/100]);return{times:Array.isArray(a)?a:i.map((e,t)=>t/Math.max(i.length-1,1)),sizes:i}}(g):void 0,[g]),M=(0,a.useMemo)(()=>{let e=g?.explosionScale;return e?[e.x/100,e.y/100,e.z/100]:[1,1,1]},[g]),A=32*(g?.lifetimeMS??31),S=!1!==e.faceViewer,{scene:_,mixer:x,visNodes:b,iflInfos:q,materials:k}=(0,a.useMemo)(()=>{let t=o.clone(f.scene),a=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let i=new Set(t.userData.flag_names??[]),r=t.userData.resource_path;if(i.has("IflMaterial")&&r){let t=e.userData;a.push({mesh:e,iflPath:`textures/${r}.ifl`,sequenceName:t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,duration:t?.ifl_duration?Number(t.ifl_duration):void 0,cyclic:t?.ifl_sequence?!!t.ifl_cyclic:void 0,toolBegin:t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0})}}),(0,l.processShapeScene)(t,e.shapeName);let i=[];for(let e of(t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let a=t.vis_keyframes,r=t.vis_duration,n=(t.vis_sequence??"").toLowerCase();n&&Array.isArray(a)&&!(a.length<=1)&&r&&!(r<=0)&&"ambient"===n&&i.push({mesh:e,keyframes:a,duration:r,cyclic:!!t.vis_cyclic})}),i))e.mesh.visible=!0,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);for(let e of a)e.mesh.userData?.vis_sequence||(e.mesh.visible=!0);let n=new Map;for(let e of f.animations)n.set(e.name.toLowerCase(),e);let s=n.get("ambient"),u=null;if(s){let e=(u=new r.AnimationMixer(t)).clipAction(s);e.setLoop(r.LoopOnce,1),e.clampWhenFinished=!0,e.timeScale=(g?.playSpeed??20)/20,e.play()}let c=[];return t.traverse(e=>{e.isMesh&&(Array.isArray(e.material)?c.push(...e.material):e.material&&c.push(e.material))}),t.traverse(e=>{e.frustumCulled=!1}),{scene:t,mixer:u,visNodes:i,iflInfos:a,materials:c}},[f,g]);return(0,a.useEffect)(()=>{for(let e of(y.current=[],q))(0,s.loadIflAtlas)(e.iflPath).then(t=>{let a=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;a&&(a.map=t.texture,a.needsUpdate=!0),y.current.push({atlas:t,info:e})}).catch(()=>{})},[q]),(0,i.useFrame)((e,t)=>{let a=p.current;if(!a)return;let i=n.engineStore.getState().playback,r="playing"===i.status?t*i.rate:0,o=(0,n.effectNow)()-h.current,l=Math.min(o/A,1),u=o/1e3;x&&x.update(r);let c=l>.8?1-(l-.8)/.2:1;for(let{mesh:e,keyframes:t,duration:a,cyclic:i}of b){let r=e.material;if(!r||Array.isArray(r))continue;let n=u/a,o=i?n%1:Math.min(n,1),l=t.length,s=o*l,m=Math.floor(s)%l,f=(m+1)%l,p=s-Math.floor(s);r.opacity=(t[m]+(t[f]-t[m])*p)*c}if(c<1)for(let e of k)"opacity"in e&&(e.transparent=!0,e.opacity*=c);for(let{atlas:e,info:t}of y.current){let a;a=t.sequenceName&&t.duration?(t.cyclic?u/t.duration%1:Math.min(u/t.duration,1))*t.duration+(t.toolBegin??0):u,(0,s.updateAtlasFrame)(e,(0,s.getFrameIndexForTime)(e,a))}if(v){let e=function(e,t){let{times:a,sizes:i}=e;if(0===a.length)return[1,1,1];if(t<=a[0])return i[0];if(t>=a[a.length-1])return i[i.length-1];for(let e=0;e=a[e]&&t<=a[e+1]){let r=(t-a[e])/(a[e+1]-a[e]);return[i[e][0]+(i[e+1][0]-i[e][0])*r,i[e][1]+(i[e+1][1]-i[e][1])*r,i[e][2]+(i[e+1][2]-i[e][2])*r]}return i[i.length-1]}(v,l);a.scale.set(e[0]*M[0],e[1]*M[1],e[2]*M[2])}S&&(a.lookAt(e.camera.position),a.rotateZ(d.current))}),(0,t.jsx)("group",{ref:p,children:(0,t.jsx)("group",{rotation:[0,Math.PI,0],children:(0,t.jsx)("primitive",{object:_})})})}e.s(["ExplosionShape",()=>p,"WeaponModel",()=>f])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/97346c3751717c47.js b/docs/_next/static/chunks/97346c3751717c47.js deleted file mode 100644 index df3179c1..00000000 --- a/docs/_next/static/chunks/97346c3751717c47.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(15080),o=e.i(71753),i=e.i(90072),u=e.i(25645),c=e.i(12979),a=e.i(51434),s=e.i(79123),l=e.i(89887),f=e.i(58647);let d=(0,u.createLogger)("AudioEmitter"),h=new Map,p=new Map;function y(e,t=1){p.set(e,t)}function m(e){p.delete(e)}let g=0;function S(){return g}function R(){for(let[e]of(g++,p)){try{e.stop()}catch{}try{e.disconnect()}catch{}}p.clear()}function b(e,t){let r=t(e),n=r?.filename;if(!n)return null;let o=n.endsWith(".wav")?n:`${n}.wav`,i=r.description,u=null!=i?t(i):void 0,c=u?.is3D??!0,a=u?.isLooping??!1,s=u?.referenceDistance??20;return{filename:o,is3D:c,isLooping:a,refDist:s,maxDist:u?.maxDistance??100,volume:u?.volume??1}}function M(e,t,r,n,o){let u;try{u=(0,c.audioToUrl)(e.filename)}catch{return}let a=f.engineStore.getState().playback.rate,s=g;D(u,r,r=>{if(s===g)try{if(e.is3D&&o){let u=new i.PositionalAudio(t);u.setBuffer(r),u.setDistanceModel("inverse"),u.setRefDistance(e.refDist),u.setMaxDistance(e.maxDist),u.setRolloffFactor(1),u.setVolume(e.volume),u.setPlaybackRate(a),n&&u.position.copy(n),o.add(u),p.set(u,1),u.play(),u.source.onended=()=>{p.delete(u);try{u.disconnect()}catch{}o.remove(u)}}else{let n=new i.Audio(t);n.setBuffer(r),n.setVolume(e.volume),n.setPlaybackRate(a),p.set(n,1),n.play(),n.source.onended=()=>{p.delete(n);try{n.disconnect()}catch{}}}}catch{}})}function D(e,t,r){h.has(e)?r(h.get(e)):t.load(e,t=>{h.set(e,t),r(t)},void 0,t=>{d.error("Audio load error %s: %o",e,t)})}f.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,r]of p)try{t.setPlaybackRate(r*e)}catch{}});let k=(0,r.memo)(function({entity:e}){let{debugMode:u}=(0,s.useDebug)(),f=e.audioFileName??"",d=e.audioVolume??1,h=e.audioMinDistance??1,p=e.audioMaxDistance??1,y=e.audioMinLoopGap??0,m=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,S=e.audioIsLooping??!0,[R,b,M]=e.position??[0,0,0],k=(0,n.useThree)(e=>e.scene),v=(0,n.useThree)(e=>e.camera),{audioLoader:A,audioListener:T}=(0,a.useAudio)(),{audioEnabled:P}=(0,s.useSettings)(),w=(0,r.useRef)(null),x=(0,r.useRef)(null),B=(0,r.useRef)(null),E=(0,r.useRef)(!1),L=(0,r.useRef)(!1),C=(0,r.useRef)(new i.Vector3(R,b,M)),G=(0,r.useRef)(0),V=()=>{null!=x.current&&(clearTimeout(x.current),x.current=null),null!=B.current&&(clearTimeout(B.current),B.current=null)};(0,r.useEffect)(()=>{let e;if(A&&T){if(G.current++,g){let t=new i.PositionalAudio(T);t.position.copy(C.current),t.setDistanceModel("inverse"),t.setRefDistance(h),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(d),e=t,k.add(e)}else(e=new i.Audio(T)).setVolume(d);return w.current=e,()=>{V();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&k.remove(e),w.current=null,E.current=!1,L.current=!1}}},[A,T,g,h,p,d,k]);let j=(e,t)=>{if(S)if(y>0||m>0){let r=Math.max(0,y),n=Math.max(r,m),o=r===n?r:Math.random()*(n-r)+r;e.loop=!1;let i=()=>{t===G.current&&(!1===e.isPlaying?x.current=setTimeout(()=>{if(t===G.current)try{e.play(),j(e,t)}catch{}},o):B.current=setTimeout(i,100))};B.current=setTimeout(i,100)}else e.setLoop(!0)},F=e=>{if(!A)return;let t=G.current;if(E.current)try{e.isPlaying||(e.play(),j(e,t))}catch{}else{let r;try{r=(0,c.audioToUrl)(f)}catch{return}D(r,A,r=>{if(t===G.current&&!e.buffer){e.setBuffer(r),E.current=!0;try{e.play(),j(e,t)}catch{}}})}};return(0,r.useEffect)(()=>{let e=w.current;e&&!g&&P&&f&&F(e)},[P,g,f,A,T]),(0,o.useFrame)(()=>{let e=w.current;if(!e||!g||!P||!f)return;let t=v.position.distanceTo(C.current),r=L.current,n=t<=p;if(n&&!r)L.current=!0,F(e);else if(!n&&r){L.current=!1,V();try{e.stop()}catch{}}}),(0,r.useEffect)(()=>{let e=w.current;if(e&&!P){V();try{e.stop()}catch{}L.current=!1}},[P]),u?(0,t.jsxs)("mesh",{position:C.current,children:[(0,t.jsx)("sphereGeometry",{args:[h,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(l.FloatingLabel,{color:"#00ff00",position:[0,h+1,0],children:f})]}):null});e.s(["AudioEmitter",0,k,"audioBufferCache",0,h,"getCachedAudioBuffer",()=>D,"getSoundGeneration",()=>S,"playOneShotSound",()=>M,"resolveAudioProfile",()=>b,"stopAllTrackedSounds",()=>R,"trackSound",()=>y,"untrackSound",()=>m])},9962,e=>{"use strict";var t=e.i(71645),r=e.i(90072),n=e.i(12979),o=e.i(51434),i=e.i(29055),u=e.i(79123),c=e.i(58647);function a(){let{audioLoader:e,audioListener:a}=(0,o.useAudio)(),{audioEnabled:s}=(0,u.useSettings)(),l=(0,c.useEngineSelector)(e=>e.playback.streamSnapshot?.chatMessages),f=(0,c.useEngineSelector)(e=>e.playback.streamSnapshot?.timeSec),d=(0,t.useRef)(new WeakSet),h=(0,t.useRef)(new Map);return(0,t.useEffect)(()=>{if(!s||!e||!a||!l?.length||null==f)return;let t=d.current,o=h.current;for(let u of l){if(!t.has(u)){if((t.add(u),u.soundPath)&&!(Math.abs(f-u.timeSec)>2))try{let t=(0,n.audioToUrl)(u.soundPath),s=u.soundPitch??1,l=c.engineStore.getState().playback.rate,f=u.sender,d=(0,i.getSoundGeneration)();(0,i.getCachedAudioBuffer)(t,e,e=>{if(d!==(0,i.getSoundGeneration)())return;if(f){let e=o.get(f);if(e){try{e.stop()}catch{}(0,i.untrackSound)(e);try{e.disconnect()}catch{}o.delete(f)}}let t=new r.Audio(a);t.setBuffer(e),t.setPlaybackRate(s*l),(0,i.trackSound)(t,s),f&&o.set(f,t),t.play(),t.source.onended=()=>{(0,i.untrackSound)(t);try{t.disconnect()}catch{}f&&o.get(f)===t&&o.delete(f)}})}catch{}}}},[s,e,a,l,f]),null}e.s(["ChatSoundPlayer",()=>a])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/b89dc6fc9051e9fe.js b/docs/_next/static/chunks/b89dc6fc9051e9fe.js deleted file mode 100644 index 8d5432f9..00000000 --- a/docs/_next/static/chunks/b89dc6fc9051e9fe.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(15080),i=e.i(71753),r=e.i(90072),o=e.i(25645),l=e.i(12979),s=e.i(51434),c=e.i(79123),u=e.i(89887),m=e.i(58647);let f=(0,o.createLogger)("AudioEmitter"),d=new Map,p=new Map;function h(e,t=1){p.set(e,t)}function S(e){p.delete(e)}let g=0;function y(){return g}function T(){for(let[e]of(g++,p)){try{e.stop()}catch{}try{e.disconnect()}catch{}}p.clear()}function I(e,t){let n=t(e),a=n?.filename;if(!a)return null;let i=a.endsWith(".wav")?a:`${a}.wav`,r=n.description,o=null!=r?t(r):void 0,l=o?.is3D??!0,s=o?.isLooping??!1,c=o?.referenceDistance??20;return{filename:i,is3D:l,isLooping:s,refDist:c,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function w(e,t,n,a,i){let o;try{o=(0,l.audioToUrl)(e.filename)}catch{return}let s=m.engineStore.getState().playback.rate,c=g;k(o,n,n=>{if(c===g)try{if(e.is3D&&i){let o=new r.PositionalAudio(t);o.setBuffer(n),o.setDistanceModel("inverse"),o.setRefDistance(e.refDist),o.setMaxDistance(e.maxDist),o.setRolloffFactor(1),o.setVolume(e.volume),o.setPlaybackRate(s),a&&o.position.copy(a),i.add(o),p.set(o,1),o.play(),o.source.onended=()=>{p.delete(o);try{o.disconnect()}catch{}i.remove(o)}}else{let a=new r.Audio(t);a.setBuffer(n),a.setVolume(e.volume),a.setPlaybackRate(s),p.set(a,1),a.play(),a.source.onended=()=>{p.delete(a);try{a.disconnect()}catch{}}}}catch{}})}function k(e,t,n){d.has(e)?n(d.get(e)):t.load(e,t=>{d.set(e,t),n(t)},void 0,t=>{f.error("Audio load error %s: %o",e,t)})}m.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of p)try{t.setPlaybackRate(n*e)}catch{}});let A=(0,n.memo)(function({entity:e}){let{debugMode:o}=(0,c.useDebug)(),m=e.audioFileName??"",f=e.audioVolume??1,d=e.audioMinDistance??1,p=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,S=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,y=e.audioIsLooping??!0,[T,I,w]=e.position??[0,0,0],A=(0,a.useThree)(e=>e.scene),M=(0,a.useThree)(e=>e.camera),{audioLoader:b,audioListener:x}=(0,s.useAudio)(),{audioEnabled:N}=(0,c.useSettings)(),v=(0,n.useRef)(null),R=(0,n.useRef)(null),_=(0,n.useRef)(null),E=(0,n.useRef)(!1),L=(0,n.useRef)(!1),C=(0,n.useRef)(new r.Vector3(T,I,w)),O=(0,n.useRef)(0),D=()=>{null!=R.current&&(clearTimeout(R.current),R.current=null),null!=_.current&&(clearTimeout(_.current),_.current=null)};(0,n.useEffect)(()=>{let e;if(b&&x){if(O.current++,g){let t=new r.PositionalAudio(x);t.position.copy(C.current),t.setDistanceModel("inverse"),t.setRefDistance(d),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(f),e=t,A.add(e)}else(e=new r.Audio(x)).setVolume(f);return v.current=e,()=>{D();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&A.remove(e),v.current=null,E.current=!1,L.current=!1}}},[b,x,g,d,p,f,A]);let P=(e,t)=>{if(y)if(h>0||S>0){let n=Math.max(0,h),a=Math.max(n,S),i=n===a?n:Math.random()*(a-n)+n;e.loop=!1;let r=()=>{t===O.current&&(!1===e.isPlaying?R.current=setTimeout(()=>{if(t===O.current)try{e.play(),P(e,t)}catch{}},i):_.current=setTimeout(r,100))};_.current=setTimeout(r,100)}else e.setLoop(!0)},j=e=>{if(!b)return;let t=O.current;if(E.current)try{e.isPlaying||(e.play(),P(e,t))}catch{}else{let n;try{n=(0,l.audioToUrl)(m)}catch{return}k(n,b,n=>{if(t===O.current&&!e.buffer){e.setBuffer(n),E.current=!0;try{e.play(),P(e,t)}catch{}}})}};return(0,n.useEffect)(()=>{let e=v.current;e&&!g&&N&&m&&j(e)},[N,g,m,b,x]),(0,i.useFrame)(()=>{let e=v.current;if(!e||!g||!N||!m)return;let t=M.position.distanceTo(C.current),n=L.current,a=t<=p;if(a&&!n)L.current=!0,j(e);else if(!a&&n){L.current=!1,D();try{e.stop()}catch{}}}),(0,n.useEffect)(()=>{let e=v.current;if(e&&!N){D();try{e.stop()}catch{}L.current=!1}},[N]),o?(0,t.jsxs)("mesh",{position:C.current,children:[(0,t.jsx)("sphereGeometry",{args:[d,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(u.FloatingLabel,{color:"#00ff00",position:[0,d+1,0],children:m})]}):null});e.s(["AudioEmitter",0,A,"audioBufferCache",0,d,"getCachedAudioBuffer",()=>k,"getSoundGeneration",()=>y,"playOneShotSound",()=>w,"resolveAudioProfile",()=>I,"stopAllTrackedSounds",()=>T,"trackSound",()=>h,"untrackSound",()=>S])},9721,e=>{"use strict";var t=e.i(43476),n=e.i(932),a=e.i(71645),i=e.i(71753),r=e.i(90072),o=e.i(82816),l=e.i(85557);class s{states;seqIndexToName;currentStateIndex=0;delayTime=0;lastFireCount=-1;spinTimeScale=0;constructor(e,t){this.states=e,this.seqIndexToName=t,e.length>0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(0===this.states.length)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let a=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&a.push(t)}}this.delayTime-=e;let i=n,r=this.evaluateTickTransitions(t),o=0;for(;r>=0&&o<32;){if(o++,i=!0,r===this.currentStateIndex){this.delayTime=this.states[r].timeoutValue??0;break}let e=this.states[this.currentStateIndex].spin,n=this.delayTime;this.currentStateIndex=r;let l=this.states[r].timeoutValue??0;this.delayTime=l;let s=this.states[r].soundDataBlockId;switch(s>=0&&a.push(s),this.states[r].spin){case 1:this.spinTimeScale=0;break;case 4:this.spinTimeScale=1;break;case 2:3===e&&l>0&&(this.delayTime*=1-n/l);break;case 3:2===e&&l>0&&(this.delayTime*=1-n/l)}r=this.evaluateEntryTransitions(t)}let l=this.states[this.currentStateIndex],s=l.timeoutValue??0;switch(l.spin){case 1:this.spinTimeScale=0;break;case 2:this.spinTimeScale=s>0?Math.max(0,1-this.delayTime/s):1;break;case 4:this.spinTimeScale=1;break;case 3:this.spinTimeScale=s>0?Math.max(0,this.delayTime/s):0}return{sequenceName:this.resolveSequenceName(l),isFiring:l.fire,spinTimeScale:this.spinTimeScale,reverse:!l.direction,scaleAnimation:l.scaleAnimation,timeoutValue:l.timeoutValue??0,transitioned:i,soundDataBlockIds:a,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return -1;let a=this.evaluateConditions(t,e);if(-1!==a)return a;if(n){let e=t.transitionOnTimeout;if(-1!==e)return e}return -1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(-1!==n)return n;let a=t.ammo?e.transitionOnAmmo:e.transitionOnNoAmmo;if(-1!==a)return a;let i=t.target?e.transitionOnTarget:e.transitionOnNoTarget;if(-1!==i)return i;let r=t.wet?e.transitionOnWet:e.transitionOnNotWet;if(-1!==r)return r;let o=t.triggerDown?e.transitionOnTriggerDown:e.transitionOnTriggerUp;return -1!==o?o:-1}resolveSequenceName(e){return null==e.sequence||e.sequence<0?null:this.seqIndexToName[e.sequence]??null}}var c=e.i(43595),u=e.i(91907),m=e.i(31999),f=e.i(46325),d=e.i(51434),p=e.i(29055),h=e.i(12979),S=e.i(79123),g=e.i(58647),y=e.i(93784);let T=["root","run","back","side","fall","jet","jump","land"];function I(e,t,n){let a=e.current;if(a){(0,p.untrackSound)(a);try{a.stop()}catch{}try{a.disconnect()}catch{}n?.remove(a),e.current=null,t.current=-1}}function w(e){let s,d,p,h,S,I,w,v,R,_,L,C,O,D,P,j,F,B,q,V,W,U,$,G,z=(0,n.c)(65),{entity:Y}=e,K=(0,g.useEngineStoreApi)(),H=Y.shapeName??Y.dataBlock,Q=(0,u.useStaticShape)(H);z[0]!==H?(s=e=>{let t=H?.toLowerCase();return t?e.runtime.sequenceAliases.get(t):void 0},z[0]=H,z[1]=s):s=z[1];let J=(0,g.useEngineSelector)(s);z[2]!==Q.scene?(w=o.clone(Q.scene),d=(0,l.processShapeScene)(w),w.traverse(x),I=new r.AnimationMixer(w),p=null,h=null,S=null,w.traverse(e=>{p||"Mount0"!==e.name||(p=e),h||"Mount1"!==e.name||(h=e),S||"Mount2"!==e.name||(S=e)}),z[2]=Q.scene,z[3]=d,z[4]=p,z[5]=h,z[6]=S,z[7]=I,z[8]=w):(d=z[3],p=z[4],h=z[5],S=z[6],I=z[7],w=z[8]),z[9]!==d||z[10]!==p||z[11]!==h||z[12]!==S||z[13]!==I||z[14]!==w?(v={clonedScene:w,mixer:I,mount0:p,mount1:h,mount2:S,iflInitializers:d},z[9]=d,z[10]=p,z[11]=h,z[12]=S,z[13]=I,z[14]=w,z[15]=v):v=z[15];let{clonedScene:X,mixer:Z,mount0:ee,mount1:et,mount2:en,iflInitializers:ea}=v;z[16]===Symbol.for("react.memo_cache_sentinel")?(R=new Map,z[16]=R):R=z[16];let ei=(0,a.useRef)(R);z[17]===Symbol.for("react.memo_cache_sentinel")?(_={head:null,headside:null},z[17]=_):_=z[17];let er=(0,a.useRef)(_);z[18]===Symbol.for("react.memo_cache_sentinel")?(L=new Map,z[18]=L):L=z[18];let eo=(0,a.useRef)(L),el=(0,a.useRef)(null);z[19]===Symbol.for("react.memo_cache_sentinel")?(C={name:"root",timeScale:1},z[19]=C):C=z[19];let es=(0,a.useRef)(C),ec=(0,a.useRef)(!1),eu=(0,a.useRef)(void 0);if(z[20]!==K||z[21]!==H){e:{let e=K.getState().playback,t=e.recording?.streamingPlayback,n=H?.toLowerCase();if(!t||!n){let e;z[23]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,z[23]=e):e=z[23],O=e;break e}let a=t.getShapeConstructorSequences(n);if(!a){let e;z[24]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,z[24]=e):e=z[24],O=e;break e}O=function(e,t){let n=new Map,a=[];for(let n of e){let e=n.indexOf(" ");if(-1===e)continue;let i=n.slice(0,e).toLowerCase(),r=n.slice(e+1).trim().toLowerCase();if(!r||!i.startsWith(t)||!i.endsWith(".dsq"))continue;let o=i.slice(t.length,-4);o&&a.push({clipName:o,alias:r})}let i=new Set;for(let e=0;e{let e=(0,c.getAliasedActions)(Q.animations,Z,J);ei.current=e;let t=e.get("root");t&&t.play(),es.current={name:"root",timeScale:1};let n={head:null,headside:null};for(let{key:e,names:t}of[{key:"head",names:["head"]},{key:"headside",names:["headside"]}]){let a=Q.animations.find(e=>t.includes(e.name.toLowerCase()));if(!a)continue;let i=a.clone(),o=Math.round(30*a.duration/2);r.AnimationUtils.makeClipAdditive(i,o,a,30);let l=Z.clipAction(i);l.blendMode=r.AdditiveAnimationBlendMode,l.timeScale=0,l.weight=1,l.play(),n[e]=l}er.current=n;let a=new Map,i=Q.animations.find(b),o=i?Math.round(30*i.duration/2):0;for(let e of["lookde","lookms","looksn"]){let t=Q.animations.find(t=>t.name.toLowerCase()===e);if(!t)continue;let n=t.clone(),l=i??t;r.AnimationUtils.makeClipAdditive(n,o,l,30);let s=Z.clipAction(n);s.blendMode=r.AdditiveAnimationBlendMode,s.timeScale=0,s.weight=0,s.play(),a.set(e,s)}eo.current=a;let l=a.get("lookde");return l&&(l.weight=1,el.current="lookde"),Z.update(0),()=>{Z.stopAllAction(),ei.current=new Map,er.current={head:null,headside:null},eo.current=new Map,el.current=null}},P=[Z,Q.animations,J],z[25]=Q.animations,z[26]=Z,z[27]=J,z[28]=D,z[29]=P):(D=z[28],P=z[29]),(0,a.useEffect)(D,P),z[30]!==ea?(j=()=>{let e=[];for(let{mesh:t,initialize:n}of ea)n(t,M).then(t=>e.push(t)).catch(A);return()=>e.forEach(k)},F=[ea],z[30]=ea,z[31]=j,z[32]=F):(j=z[31],F=z[32]),(0,a.useEffect)(j,F);let ef=(0,a.useRef)(Y.weaponShape),[ed,ep]=(0,a.useState)(Y.weaponShape),eh=(0,a.useRef)(Y.packShape),[eS,eg]=(0,a.useState)(Y.packShape),ey=(0,a.useRef)(Y.flagShape),[eT,eI]=(0,a.useState)(Y.flagShape);return z[33]!==em||z[34]!==K||z[35]!==Y.falling||z[36]!==Y.flagShape||z[37]!==Y.headPitch||z[38]!==Y.headYaw||z[39]!==Y.jetting||z[40]!==Y.keyframes||z[41]!==Y.packShape||z[42]!==Y.weaponShape||z[43]!==Z?(B=(e,t)=>{Y.weaponShape!==ef.current&&(ef.current=Y.weaponShape,ep(Y.weaponShape)),Y.packShape!==eh.current&&(eh.current=Y.packShape,eg(Y.packShape)),Y.flagShape!==ey.current&&(ey.current=Y.flagShape,eI(Y.flagShape));let n=K.getState().playback,a="playing"===n.status,i=y.streamPlaybackStore.getState().time,o=(0,l.getKeyframeAtTime)(Y.keyframes??[],i),s=o?.damageState!=null&&o.damageState>=1,c=ei.current;if(s&&!ec.current){ec.current=!0;let e=null!=o.actionAnim?em.get(o.actionAnim):void 0;if(e){let t=c.get(e.clipName);if(t){let n=c.get(es.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),es.current={name:e.clipName,timeScale:1},eu.current=o.actionAnim}}}if(!s&&ec.current){ec.current=!1,eu.current=void 0;let e=c.get(es.current.name.toLowerCase());e&&(e.stop(),e.setLoop(r.LoopRepeat,1/0),e.clampWhenFinished=!1),es.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().play()}let u=o?.actionAnim,m=eu.current;if(!ec.current&&u!==m){eu.current=u;let e=null!=m&&m>=8;if(null!=u&&u>=8){let e=em.get(u);if(e){let t=c.get(e.clipName);if(t){let n=c.get(es.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),es.current={name:e.clipName,timeScale:1}}}}else if(e){let e=em.get(m);if(e){let t=c.get(e.clipName);t&&(t.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopRepeat,1/0),t.clampWhenFinished=!1)}es.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()}}if(null!=u&&u>=8&&o?.actionAtEnd){let e=em.get(u);if(e){let t=c.get(e.clipName);t&&(t.paused=!0)}}let f=null!=eu.current&&eu.current>=8;if(!ec.current&&!f){let e=function(e,t,n,a){if(n)return{animation:"fall",timeScale:1};if(!e)return a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1};let[i,r,o]=e,l=-2*Math.atan2(t[1],t[3]),s=Math.cos(l),c=Math.sin(l),u=i*s+r*c,m=-i*c+r*s,f=-m,d=-u,p=Math.max(m,f,d,u);return p<.1?a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1}:p===m?{animation:"run",timeScale:1}:p===f?{animation:"back",timeScale:1}:p===d?{animation:"side",timeScale:1}:{animation:"side",timeScale:-1}}(o?.velocity,o?.rotation??[0,0,0,1],Y.falling,Y.jetting),t=es.current;if(e.animation!==t.name||e.timeScale!==t.timeScale){let n=c.get(t.name.toLowerCase()),i=c.get(e.animation.toLowerCase());i&&(a&&n&&n!==i?(n.fadeOut(l.ANIM_TRANSITION_TIME),i.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):(n&&n!==i&&n.stop(),i.reset().play()),i.timeScale=e.timeScale,es.current={name:e.animation,timeScale:e.timeScale})}}let d=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(Y.weaponShape);if(d!==el.current){let e=eo.current,t=el.current?e.get(el.current):null,n=e.get(d);n&&(t&&(t.weight=0),n.weight=+!s,el.current=d)}let{head:p,headside:h}=er.current,S=el.current?eo.current.get(el.current):null,g=+!s,T=Y.headPitch??0,I=Y.headYaw??0,w=(T+1)/2;S&&(S.time=w*S.getClip().duration,S.weight=g),p&&(p.time=w*p.getClip().duration,p.weight=g),h&&(h.time=(I+1)/2*h.getClip().duration,h.weight=g),a?Z.update(t*n.rate):Z.update(0)},z[33]=em,z[34]=K,z[35]=Y.falling,z[36]=Y.flagShape,z[37]=Y.headPitch,z[38]=Y.headYaw,z[39]=Y.jetting,z[40]=Y.keyframes,z[41]=Y.packShape,z[42]=Y.weaponShape,z[43]=Z,z[44]=B):B=z[44],(0,i.useFrame)(B),z[45]===Symbol.for("react.memo_cache_sentinel")?(q=[0,Math.PI/2,0],z[45]=q):q=z[45],z[46]!==X?(V=(0,t.jsx)("group",{rotation:q,children:(0,t.jsx)("primitive",{object:X})}),z[46]=X,z[47]=V):V=z[47],z[48]!==ed||z[49]!==Y||z[50]!==ee?(W=ed&&ee&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:ed}),children:(0,t.jsx)(f.DebugSuspense,{name:`Weapon:${Y.id}/${ed}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:ed}),children:(0,t.jsx)(N,{entity:Y,weaponShape:ed,mount0:ee})})},ed),z[48]=ed,z[49]=Y,z[50]=ee,z[51]=W):W=z[51],z[52]!==eS||z[53]!==Y.id||z[54]!==et?(U=eS&&et&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:eS}),children:(0,t.jsx)(f.DebugSuspense,{name:`Pack:${Y.id}/${eS}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:eS}),children:(0,t.jsx)(E,{packShape:eS,mountBone:et})})},eS),z[52]=eS,z[53]=Y.id,z[54]=et,z[55]=U):U=z[55],z[56]!==eT||z[57]!==Y.id||z[58]!==en?($=eT&&en&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:eT}),children:(0,t.jsx)(f.DebugSuspense,{name:`Flag:${Y.id}/${eT}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:eT}),children:(0,t.jsx)(E,{packShape:eT,mountBone:en})})},eT),z[56]=eT,z[57]=Y.id,z[58]=en,z[59]=$):$=z[59],z[60]!==V||z[61]!==W||z[62]!==U||z[63]!==$?(G=(0,t.jsxs)(t.Fragment,{children:[V,W,U,$]}),z[60]=V,z[61]=W,z[62]=U,z[63]=$,z[64]=G):G=z[64],G}function k(e){return e()}function A(){}function M(){return y.streamPlaybackStore.getState().time}function b(e){return"lookde"===e.name.toLowerCase()}function x(e){if(e.isMesh&&e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.side=r.FrontSide}function N(e){let t,c,m,f,y,T,w,k,A,M,b,x,N,E,L=(0,n.c)(38),{entity:C,weaponShape:O,mount0:D}=e,P=(0,g.useEngineStoreApi)(),j=(0,u.useStaticShape)(O);if(L[0]!==j.animations||L[1]!==j.scene){t=o.clone(j.scene),c=(0,l.processShapeScene)(t);let e=(0,l.getPosedNodeTransform)(j.scene,j.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}f=new Map,t.traverse(e=>{if(!e.isMesh)return;let t=e.userData,n=(t?.vis_sequence??"").toLowerCase();if(!n)return;let a=f.get(n);a||(a=[],f.set(n,a)),a.push(e)}),m=new r.AnimationMixer(t),L[0]=j.animations,L[1]=j.scene,L[2]=t,L[3]=c,L[4]=m,L[5]=f}else t=L[2],c=L[3],m=L[4],f=L[5];let F=m,B=j.scene;L[6]!==B||L[7]!==j.animations?(y=function(e,t){let n=e.userData?.dts_sequence_names;if("string"==typeof n)try{return JSON.parse(n).map(e=>e.toLowerCase())}catch{}return t.map(e=>e.name.toLowerCase())}(B,j.animations),L[6]=B,L[7]=j.animations,L[8]=y):y=L[8];let q=y;L[9]!==t||L[10]!==c||L[11]!==F||L[12]!==q||L[13]!==f?(T={weaponClone:t,weaponMixer:F,seqIndexToName:q,visNodesBySequence:f,weaponIflInitializers:c},L[9]=t,L[10]=c,L[11]=F,L[12]=q,L[13]=f,L[14]=T):T=L[14];let{weaponClone:V,weaponMixer:W,seqIndexToName:U,visNodesBySequence:$,weaponIflInitializers:G}=T;L[15]===Symbol.for("react.memo_cache_sentinel")?(w=new Map,L[15]=w):w=L[15];let z=(0,a.useRef)(w),Y=(0,a.useRef)(null);L[16]!==j.animations||L[17]!==W?(k=()=>{let e=new Map;for(let t of j.animations)e.set(t.name.toLowerCase(),W.clipAction(t));z.current=e;let t=e.get("spin");return t&&(t.setLoop(r.LoopRepeat,1/0),t.timeScale=0,t.play()),Y.current=t??null,W.update(0),()=>{W.stopAllAction(),z.current=new Map,Y.current=null,I(et,en)}},A=[W,j.animations],L[16]=j.animations,L[17]=W,L[18]=k,L[19]=A):(k=L[18],A=L[19]),(0,a.useEffect)(k,A),L[20]!==G?(M=()=>{let e=[];for(let{mesh:t,initialize:n}of G)n(t,_).then(t=>e.push(t)).catch(R);return()=>e.forEach(v)},b=[G],L[20]=G,L[21]=M,L[22]=b):(M=L[21],b=L[22]),(0,a.useEffect)(M,b);let{audioLoader:K,audioListener:H}=(0,d.useAudio)(),Q=(0,S.useSettings)(),J=Q?.audioEnabled??!1,X=(0,a.useRef)(null),Z=(0,a.useRef)(null),ee=(0,a.useRef)(C.weaponImageStates),et=(0,a.useRef)(null),en=(0,a.useRef)(-1);return L[23]!==D||L[24]!==V?(x=()=>(D.add(V),()=>{D.remove(V)}),N=[V,D],L[23]=D,L[24]=V,L[25]=x,L[26]=N):(x=L[25],N=L[26]),(0,a.useEffect)(x,N),L[27]!==J||L[28]!==H||L[29]!==K||L[30]!==P||L[31]!==C.weaponImageState||L[32]!==C.weaponImageStates||L[33]!==U||L[34]!==$||L[35]!==V||L[36]!==W?(E=(e,t)=>{let n=P.getState().playback,a="playing"===n.status,i=z.current,o=C.weaponImageState,c=C.weaponImageStates;c!==ee.current&&(ee.current=c,c&&c.length>0?X.current=new s(c,U):X.current=null,Z.current=null,I(et,en,V)),!X.current&&c&&c.length>0&&(X.current=new s(c,U));let u=X.current;if(u&&o&&a){let e=t*n.rate,a=u.tick(e,o);if(function(e,t,n,a){let i=e.sequenceName,o=n.current;if(i===o&&!e.transitioned)return;if(i!==o){if(o){let e=a.get(o);if(e)for(let t of e)t.visible=!1}if(i){let e=a.get(i);if(e)for(let t of e)t.visible=!0}}if(!i){if(o){let e=t.get(o);e&&e.fadeOut(l.ANIM_TRANSITION_TIME),n.current=null}return}let s=t.get(i);if(s&&(e.transitioned||i!==o)){let a=o?t.get(o):null;if(e.isFiring||e.timeoutValue>0?(s.setLoop(r.LoopOnce,1),s.clampWhenFinished=!0):(s.setLoop(r.LoopRepeat,1/0),s.clampWhenFinished=!1),e.scaleAnimation&&e.timeoutValue>0){let t=s.getClip().duration;s.timeScale=t>0?t/e.timeoutValue:1}else s.timeScale=e.reverse?-1:1;a&&a!==s?(a.fadeOut(l.ANIM_TRANSITION_TIME),s.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):s.reset().play(),n.current=i}}(a,i,Z,$),et.current&&a.stateIndex!==en.current&&I(et,en,V),J&&K&&H&&a.soundDataBlockIds.length>0){let e=n.recording?.streamingPlayback.getDataBlockData.bind(n.recording.streamingPlayback);if(e)for(let t of a.soundDataBlockIds){let a=(0,p.resolveAudioProfile)(t,e);if(a)if(a.isLooping){if(!et.current)try{let e=(0,h.audioToUrl)(a.filename),t=(0,p.getSoundGeneration)();(0,p.getCachedAudioBuffer)(e,K,e=>{if(t!==(0,p.getSoundGeneration)()||et.current)return;let i=u.stateIndex,o=new r.PositionalAudio(H);o.setBuffer(e),o.setDistanceModel("inverse"),o.setRefDistance(a.refDist),o.setMaxDistance(a.maxDist),o.setRolloffFactor(1),o.setVolume(a.volume),o.setPlaybackRate(n.rate),o.setLoop(!0),V.add(o),(0,p.trackSound)(o),o.play(),et.current=o,en.current=i})}catch{}}else(0,p.playOneShotSound)(a,H,K,void 0,V)}}Y.current&&(Y.current.timeScale=a.spinTimeScale)}a?W.update(t*n.rate):W.update(0)},L[27]=J,L[28]=H,L[29]=K,L[30]=P,L[31]=C.weaponImageState,L[32]=C.weaponImageStates,L[33]=U,L[34]=$,L[35]=V,L[36]=W,L[37]=E):E=L[37],(0,i.useFrame)(E),null}function v(e){return e()}function R(){}function _(){return y.streamPlaybackStore.getState().time}function E(e){let t,i,r,s,c,m,f,d=(0,n.c)(14),{packShape:p,mountBone:h}=e,S=(0,u.useStaticShape)(p);if(d[0]!==S.animations||d[1]!==S.scene){t=o.clone(S.scene),i=(0,l.processShapeScene)(t);let e=(0,l.getPosedNodeTransform)(S.scene,S.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}d[0]=S.animations,d[1]=S.scene,d[2]=t,d[3]=i}else t=d[2],i=d[3];d[4]!==t||d[5]!==i?(r={packClone:t,packIflInitializers:i},d[4]=t,d[5]=i,d[6]=r):r=d[6];let{packClone:g,packIflInitializers:y}=r;return d[7]!==h||d[8]!==g?(s=()=>(h.add(g),()=>{h.remove(g)}),c=[g,h],d[7]=h,d[8]=g,d[9]=s,d[10]=c):(s=d[9],c=d[10]),(0,a.useEffect)(s,c),d[11]!==y?(m=()=>{let e=[];for(let{mesh:t,initialize:n}of y)n(t,O).then(t=>e.push(t)).catch(C);return()=>e.forEach(L)},f=[y],d[11]=y,d[12]=m,d[13]=f):(m=d[12],f=d[13]),(0,a.useEffect)(m,f),null}function L(e){return e()}function C(){}function O(){return y.streamPlaybackStore.getState().time}function D(e){let t,i,r=(0,n.c)(7),{shapeName:o,eyeOffsetRef:s}=e,c=(0,u.useStaticShape)(o);return r[0]!==s||r[1]!==c.animations||r[2]!==c.scene?(t=()=>{let e=(0,l.getPosedNodeTransform)(c.scene,c.animations,"Eye");e?s.current.set(e.position.z,e.position.y,-e.position.x):s.current.set(0,l.DEFAULT_EYE_HEIGHT,0)},r[0]=s,r[1]=c.animations,r[2]=c.scene,r[3]=t):t=r[3],r[4]!==s||r[5]!==c?(i=[c,s],r[4]=s,r[5]=c,r[6]=i):i=r[6],(0,a.useEffect)(t,i),null}e.s(["PlayerEyeOffset",()=>D,"PlayerModel",()=>w],9721)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/bc2b324cb2101ffe.js b/docs/_next/static/chunks/bc2b324cb2101ffe.js deleted file mode 100644 index 4dacabc7..00000000 --- a/docs/_next/static/chunks/bc2b324cb2101ffe.js +++ /dev/null @@ -1,89 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51295,e=>{"use strict";var t=e.i(43476),i=e.i(932),r=e.i(71645),a=e.i(71753),o=e.i(78140),n=e.i(90072),s=e.i(85557),l=e.i(12979),c=e.i(15080),u=e.i(75567);let d=Math.PI/180,m=Math.PI/18e4;function p(e,t,i){let r=e[t];return"number"==typeof r&&Number.isFinite(r)?r:i}function f(e,t,i){let r=e[t];return"boolean"==typeof r?r:"number"==typeof r?0!==r:i}function h(e,t){let i,r=e.particles;if(Array.isArray(r)){for(let e of r)if("number"==typeof e&&(i=t(e)))break}return i?{ejectionPeriodMS:p(e,"ejectionPeriodMS",100),periodVarianceMS:p(e,"periodVarianceMS",0),ejectionVelocity:.01*p(e,"ejectionVelocity",200),velocityVariance:.01*p(e,"velocityVariance",100),ejectionOffset:.01*p(e,"ejectionOffset",0),thetaMin:p(e,"thetaMin",0),thetaMax:p(e,"thetaMax",90),phiReferenceVel:p(e,"phiReferenceVel",0),phiVariance:p(e,"phiVariance",360),overrideAdvances:f(e,"overrideAdvances",!1),orientParticles:f(e,"orientParticles",!1),orientOnVelocity:f(e,"orientOnVelocity",!0),lifetimeMS:p(e,"lifetimeMS",0)<<5,lifetimeVarianceMS:p(e,"lifetimeVarianceMS",0)<<5,particles:function(e){let t=e.keys,i=[];if(Array.isArray(t)&&t.length>0)for(let e=0;e0&&t[0]&&(r=t[0])}return{dragCoefficient:5*p(e,"dragCoefficient",0),windCoefficient:p(e,"windCoefficient",1),gravityCoefficient:10*p(e,"gravityCoefficient",0),inheritedVelFactor:p(e,"inheritedVelFactor",0),constantAcceleration:p(e,"constantAcceleration",0),lifetimeMS:p(e,"lifetimeMS",31)<<5,lifetimeVarianceMS:p(e,"lifetimeVarianceMS",0)<<5,spinSpeed:p(e,"spinSpeed",0),spinRandomMin:p(e,"spinRandomMin",1e3)+-1e3,spinRandomMax:p(e,"spinRandomMax",1e3)+-1e3,useInvAlpha:f(e,"useInvAlpha",!1),keys:i,textureName:r}}(i)}:null}function g(e,t){return e+(2*Math.random()-1)*t}function y(e,t,i,r,a,o,n){let s=Math.cos(n),l=Math.sin(n),c=e*r+t*a+i*o;return[e*s+(a*i-o*t)*l+r*c*(1-s),t*s+(o*e-r*i)*l+a*c*(1-s),i*s+(r*t-a*e)*l+o*c*(1-s)]}class S{data;particles=[];maxParticles;internalClock=0;nextParticleTime=0;emitterAge=0;emitterLifetime;emitterDead=!1;constructor(e,t=256,i){this.data=e,this.maxParticles=t;let r=i??e.lifetimeMS;!i&&e.lifetimeVarianceMS>0&&(r+=Math.round(g(0,e.lifetimeVarianceMS))),this.emitterLifetime=r}emitBurst(e,t,i=[0,0,1]){for(let r=0;r0;){if(this.nextParticleTime>0){let e=Math.min(r,this.nextParticleTime);this.nextParticleTime-=e,r-=e,this.internalClock+=e;continue}if(this.particles.length0)){let e=this.particles[this.particles.length-1];e.currentAge+=r,e.currentAge>=e.totalLifetime&&this.particles.pop()}let t=this.data.ejectionPeriodMS;this.data.periodVarianceMS>0&&(t+=Math.round(g(0,this.data.periodVarianceMS))),this.nextParticleTime=Math.max(1,t)}}update(e){this.emitterAge+=e,this.emitterLifetime>0&&this.emitterAge>this.emitterLifetime&&(this.emitterDead=!0);let t=e/1e3,i=this.data.particles;for(let r=this.particles.length-1;r>=0;r--){let a=this.particles[r];if(a.currentAge+=e,a.currentAge>=a.totalLifetime){this.particles[r]=this.particles[this.particles.length-1],this.particles.pop();continue}let o=i.dragCoefficient,n=i.gravityCoefficient,s=a.acc[0]-a.vel[0]*o,l=a.acc[1]-a.vel[1]*o,c=a.acc[2]-a.vel[2]*o+-9.81*n;a.vel[0]+=s*t,a.vel[1]+=l*t,a.vel[2]+=c*t,a.pos[0]+=a.vel[0]*t,a.pos[1]+=a.vel[1]*t,a.pos[2]+=a.vel[2]*t;let u=a.currentAge/a.totalLifetime,d=function(e,t){for(let i=1;i=t){let r=e[i-1],a=e[i],o=a.time-r.time,n=o>0?(t-r.time)/o:0;return{r:r.r+(a.r-r.r)*n,g:r.g+(a.g-r.g)*n,b:r.b+(a.b-r.b)*n,a:r.a+(a.a-r.a)*n,size:r.size+(a.size-r.size)*n}}let i=e[e.length-1];return{r:i.r,g:i.g,b:i.b,a:i.a,size:i.size}}(i.keys,u);a.r=d.r,a.g=d.g,a.b=d.b,a.a=d.a,a.size=d.size,a.currentSpin=a.spinSpeed*a.currentAge*m}}isDead(){return this.emitterDead&&0===this.particles.length}kill(){this.emitterDead=!0}addParticle(e,t){var i,r,a,o;let n,s,l,c,u=this.data,m=u.particles,p=t[0],f=t[1],h=t[2],S=(i=p,r=f,.9>Math.abs(a=h)?(n=r,s=-i,l=0):(n=-a,s=0,l=i),(c=Math.sqrt(n*n+s*s+l*l))<1e-8?[1,0,0]:[n/c,s/c,l/c]),v=(u.thetaMin+Math.random()*(u.thetaMax-u.thetaMin))*d,b=(this.internalClock/1e3*u.phiReferenceVel+Math.random()*u.phiVariance)*d;[p,f,h]=y(p,f,h,S[0],S[1],S[2],v),[p,f,h]=y(p,f,h,t[0],t[1],t[2],b);let M=Math.sqrt(p*p+f*f+h*h);M>1e-8&&(p/=M,f/=M,h/=M);let x=g(u.ejectionVelocity,u.velocityVariance),w=[e[0]+p*u.ejectionOffset,e[1]+f*u.ejectionOffset,e[2]+h*u.ejectionOffset],T=[p*x,f*x,h*x],A=m.constantAcceleration,P=[T[0]*A,T[1]*A,T[2]*A],k=m.lifetimeMS;m.lifetimeVarianceMS>0&&(k+=Math.round(g(0,m.lifetimeVarianceMS))),k=Math.max(1,k);let C=m.spinSpeed+((o=m.spinRandomMin)+Math.random()*(m.spinRandomMax-o)),D=m.keys[0];this.particles.push({pos:w,vel:T,acc:P,orientDir:[p,f,h],currentAge:0,totalLifetime:k,dataIndex:0,spinSpeed:C,currentSpin:0,r:D.r,g:D.g,b:D.b,a:D.a,size:D.size})}}let v=` -// 'position' is auto-declared by Three.js for ShaderMaterial. -attribute vec4 particleColor; -attribute float particleSize; -attribute float particleSpin; -attribute vec2 quadCorner; // (-0.5,-0.5) to (0.5,0.5) -attribute vec3 orientDir; - -uniform bool uOrientParticles; -// cameraPosition is a built-in Three.js uniform. - -varying vec2 vUv; -varying vec4 vColor; - -void main() { - vUv = quadCorner + 0.5; // [0,1] range - vColor = particleColor; - - if (uOrientParticles) { - if (length(orientDir) < 0.0001) { - // V12: don't render oriented particles with zero velocity. - gl_Position = vec4(0.0, 0.0, 0.0, 0.0); - return; - } - // V12 oriented particle: quad aligned along direction, facing camera. - vec3 worldPos = (modelMatrix * vec4(position, 1.0)).xyz; - vec3 dir = normalize(orientDir); - vec3 dirFromCam = worldPos - cameraPosition; - vec3 crossDir = normalize(cross(dirFromCam, dir)); - - // V12 maps U along dir (velocity) — match by using quadCorner.x for dir. - vec3 offset = dir * quadCorner.x + crossDir * quadCorner.y; - worldPos += offset * particleSize; - - gl_Position = projectionMatrix * viewMatrix * vec4(worldPos, 1.0); - } else { - // Standard camera-facing billboard. - vec3 viewPos = (modelViewMatrix * vec4(position, 1.0)).xyz; - - // Apply spin rotation to quad corner. - float c = cos(particleSpin); - float s = sin(particleSpin); - vec2 rotated = vec2( - c * quadCorner.x - s * quadCorner.y, - s * quadCorner.x + c * quadCorner.y - ); - - // Offset in view space (camera-facing billboard). - viewPos.xy += rotated * particleSize; - - gl_Position = projectionMatrix * vec4(viewPos, 1.0); - } -} -`,b=` -uniform sampler2D particleTexture; -uniform bool hasTexture; -uniform float debugOpacity; - -varying vec2 vUv; -varying vec4 vColor; - -void main() { - if (hasTexture) { - vec4 texColor = texture2D(particleTexture, vUv); - gl_FragColor = texColor * vColor; - } else { - gl_FragColor = vColor; - } - gl_FragColor.a *= debugOpacity; -} -`;var M=e.i(25645),x=e.i(79123),w=e.i(51434),T=e.i(29055),A=e.i(58647);let P=(0,M.createLogger)("ParticleEffects"),k=new Float32Array([-.5,-.5,.5,-.5,.5,.5,-.5,.5]),C=new Map,D=new Set,I=new n.DataTexture(new Uint8Array([255,255,255,255]),1,1,n.RGBAFormat,n.UnsignedByteType);function B(e){if(!e)return I;let t=C.get(e);if(t)return t;try{let t=(0,l.textureToUrl)(e),i=(0,u.loadTexture)(t,e=>{(0,s.setupEffectTexture)(e),D.add(e)});return(0,s.setupEffectTexture)(i),C.set(e,i),i}catch{return I}}I.needsUpdate=!0;let N=new n.SphereGeometry(1,6,6),E=new n.MeshBasicMaterial({color:0xff0000,wireframe:!0}),R=new n.BoxGeometry(.3,.3,.3),V=new n.MeshBasicMaterial({color:65280,wireframe:!0}),F=new n.SphereGeometry(1,12,8),_=` - attribute vec4 vertexColor; - attribute vec2 texCoord; - varying vec4 vColor; - varying vec2 vUV; - void main() { - vColor = vertexColor; - vUV = texCoord; - gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - } -`,O=` - uniform sampler2D uTexture; - varying vec4 vColor; - varying vec2 vUV; - void main() { - vec4 tex = texture2D(uTexture, vUV); - gl_FragColor = vec4(vColor.rgb * tex.rgb, vColor.a * tex.a); - } -`;function z(e){let t=(e+1)*2,i=new Float32Array(3*t),r=new Float32Array(2*t),a=new Float32Array(4*t),o=new Uint16Array(6*e);for(let t=0;t{let i=Q.current,r=C.current;if(!i||!r)return;let a=A.engineStore.getState().playback,o="playing"===a.status,s=o?t*a.rate:0,c=1e3*s,u=k.getDataBlockData.bind(k);for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position||X.current.has(e.id))continue;X.current.add(e.id);let t=function(e,t){let i=t(e);if(!i)return null;let r=[],a=[],o=i.particleEmitter;if("number"==typeof o){let e=t(o);if(e){let a=h(e,t);if(a){let e=i.particleDensity??10;r.push({data:a,density:e})}}}let n=i.emitters;if(Array.isArray(n))for(let e of n){if("number"!=typeof e)continue;let i=t(e);if(!i)continue;let r=h(i,t);r&&a.push(r)}return 0===r.length&&0===a.length?null:{burstEmitters:r,streamingEmitters:a,lifetimeMS:32*(i.lifetimeMS??31)}}(e.explosionDataBlockId,u);if(!t)continue;let r=[...e.position];for(let e of t.burstEmitters){let t=new S(e.data,256);t.emitBurst(r,e.density);let a=B(e.data.particles.textureName),o=j(256),s=q(a,e.data.particles.useInvAlpha,e.data.orientParticles),l=new n.Mesh(o,s);l.frustumCulled=!1,i.add(l),J.current.push({emitter:t,mesh:l,geometry:o,material:s,targetTexture:a,origin:r,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let a=new S(e,256,t.lifetimeMS),o=B(e.particles.textureName),s=j(256),l=q(o,e.particles.useInvAlpha,e.orientParticles),c=new n.Mesh(s,l);c.frustumCulled=!1,i.add(c),J.current.push({emitter:a,mesh:c,geometry:s,material:l,targetTexture:o,origin:r,isBurst:!1,hasBurst:!1})}let a=u(e.explosionDataBlockId);if(I){let o=a?function(e){let t=e.sizes;if(Array.isArray(t)&&t.length>0){let e=0;for(let i of t)e=Math.max(e,i.x,i.y,i.z);if(e>0)return e/1e3}let i=e.particleRadius;return"number"==typeof i&&i>0?i:5}(a):5,s=function(e){if(!e)return 0xff00ff;let t=e.toLowerCase();return t.includes("disc")?4491519:t.includes("grenade")?0xff8800:t.includes("mortar")?0xff4400:t.includes("plasma")?4521796:t.includes("laser")?0xff2222:t.includes("blaster")?0xffff00:t.includes("missile")?0xff6600:t.includes("bomb")?0xff0000:t.includes("mine")?0xff8844:t.includes("concussion")?0xffaa00:t.includes("shocklance")?8930559:t.includes("chaingun")||t.includes("bullet")?0xcccccc:0xff00ff}(e.dataBlock),l=new n.MeshBasicMaterial({color:s,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new n.Mesh(F,l);c.frustumCulled=!1,c.scale.setScalar(o),c.position.set(r[1],r[2],r[0]),i.add(c);let{sprite:u,material:d}=function(e,t){let i=document.createElement("canvas"),r=i.getContext("2d");r.font="bold 32px monospace",i.width=Math.ceil(r.measureText(e).width)+16,i.height=48,r.font="bold 32px monospace",r.fillStyle=`#${t.toString(16).padStart(6,"0")}`,r.textBaseline="middle",r.fillText(e,8,i.height/2);let a=new n.CanvasTexture(i),o=new n.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),s=new n.Sprite(o),l=i.width/i.height;return s.scale.set(2*l,2,1),{sprite:s,material:o}}(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,s);u.position.set(r[1],r[2]+o+2,r[0]),u.frustumCulled=!1,i.add(u),ei.current.push({entityId:e.id,mesh:c,material:l,label:u,labelMaterial:d,creationTime:(0,A.effectNow)(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:o})}let o=a?.shockwave;if("number"==typeof o){let t=function(e,t){let i=t(e);if(!i)return null;let r=i.colors??[],a=i.times??[0,.5,1,1];return{width:i.width??1,numSegments:Math.max(i.numSegments??16,4),velocity:i.velocity??0,height:i.height??0,verticalCurve:i.verticalCurve??0,acceleration:i.acceleration??0,texWrap:i.texWrap??1,lifetimeMS:i.lifetimeMS??500,is2D:!!i.is2D,renderSquare:!!i.renderSquare,renderBottom:!!i.renderBottom,mapToTerrain:!!i.mapToTerrain,colors:r,times:a,textureName:i.textureName??"",mapToTexture:i.mapToTexture??""}}(o,u);if(t){let a=B(t.textureName),o=z(t.numSegments),s=new n.ShaderMaterial({vertexShader:_,fragmentShader:O,uniforms:{uTexture:{value:a}},transparent:!0,depthWrite:!1,blending:n.AdditiveBlending,side:n.DoubleSide}),l=new n.Mesh(o,s);l.frustumCulled=!1,l.position.set(r[1],r[2],r[0]),i.add(l);let c=null,u=null;t.renderBottom&&(u=z(t.numSegments),(c=new n.Mesh(u,s)).frustumCulled=!1,c.position.set(r[1],r[2],r[0]),c.scale.y=-1,i.add(c));let d=Math.abs(t.velocity)>1e-10?t.velocity:0;er.current.push({entityId:e.id,mesh:l,bottomMesh:c,geometry:o,bottomGeometry:u,material:s,creationTime:(0,A.effectNow)(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:d})}}}let d=new Set;for(let e of r.entities){if(d.add(e.id),!e.maintainEmitterId||Z.current.has(e.id))continue;Z.current.add(e.id);let t=u(e.maintainEmitterId);if(!t)continue;let r=h(t,u);if(!r)continue;let a=e.position?[...e.position]:[0,0,0],o=new S(r,256),s=B(r.particles.textureName),l=j(256),c=q(s,r.particles.useInvAlpha,r.orientParticles),m=new n.Mesh(l,c);m.frustumCulled=!1,i.add(m),J.current.push({emitter:o,mesh:m,geometry:l,material:c,targetTexture:s,origin:a,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of J.current)e.followEntityId&&!d.has(e.followEntityId)&&e.emitter.kill();for(let e of Z.current)d.has(e)||Z.current.delete(e);let m=J.current;for(let e=m.length-1;e>=0;e--){let t=m[e];if(t.shaderChecked||(!function(e,t,i){let r=e.properties.get(t).currentProgram;if(!r)return;let a=r.program,o=e.getContext();o.getProgramParameter(a,o.LINK_STATUS)||P.error("Shader LINK ERROR (%s): %s",i,o.getProgramInfoLog(a))}(Y,t.material,t.isBurst?"burst":"stream"),t.shaderChecked=!0),t.followEntityId){let e=r.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,c,t.emitAxis),t.emitter.update(c),D.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=I?.2:1,!function(e){let t=e.emitter.particles,i=e.geometry,r=i.getAttribute("position"),a=i.getAttribute("particleColor"),o=i.getAttribute("particleSize"),n=i.getAttribute("particleSpin"),s=i.getAttribute("orientDir"),l=r.array,c=a.array,u=o.array,d=n.array,m=s.array,p=Math.min(t.length,256),f=e.emitter.data.orientOnVelocity;for(let e=0;e=0;e--){let t=p[e],r=Math.min((f-t.creationTime)/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),p.splice(e,1))}let g=er.current;for(let t=g.length-1;t>=0;t--){let r=g[t],a=Math.min((f-r.creationTime)/r.lifetimeMS,1);r.velocity=r.velocity+r.data.acceleration*s,r.radius=r.radius+r.velocity*s;let o=function(e,t){let{colors:i,times:r}=e;if(0===i.length)return[1,1,1,1];let a=0;for(let e=0;e=r[e]&&(a=e);let o=Math.min(a+1,i.length-1),n=r[a]??0,s=(r[o]??1)-n,l=s>0?Math.min((t-n)/s,1):0,c=i[a]??i[0],u=i[o]??i[0];return[c.r+(u.r-c.r)*l,c.g+(u.g-c.g)*l,c.b+(u.b-c.b)*l,c.a+(u.a-c.a)*l]}(r.data,a);U(r.geometry,r.data,r.radius,o,r.data.is2D),r.bottomGeometry&&U(r.bottomGeometry,r.data,r.radius,o,r.data.is2D),r.data.is2D&&r.mesh.lookAt(e.camera.position),a>=1&&(i.remove(r.mesh),r.bottomMesh&&i.remove(r.bottomMesh),r.geometry.dispose(),r.bottomGeometry?.dispose(),r.material.dispose(),g.splice(t,1))}if(o&&L&&K&&$&&Q.current){for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(et.current.has(t))continue;et.current.add(t);let i=u(e.explosionDataBlockId);if(!i)continue;let r=i.soundProfile;if("number"!=typeof r)continue;let a=(0,T.resolveAudioProfile)(r,u);if(!a)continue;let o=new n.Vector3(e.position[1],e.position[2],e.position[0]);(0,T.playOneShotSound)(a,$,K,o,Q.current)}let e=ee.current;for(let t of r.entities){if("Projectile"!==t.type||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=20)continue;let i=u(t.dataBlockId);if(!i)continue;let r=i.sound;if("number"!=typeof r)continue;let o=(0,T.resolveAudioProfile)(r,u);if(o&&o.isLooping&&o.is3D)try{let i=(0,l.audioToUrl)(o.filename),r=(0,T.getSoundGeneration)();(0,T.getCachedAudioBuffer)(i,K,i=>{if(r!==(0,T.getSoundGeneration)()||!d.has(t.id)||e.has(t.id))return;let s=Q.current;if(!s)return;let l=new n.PositionalAudio($);l.setBuffer(i),l.setDistanceModel("inverse"),l.setRefDistance(o.refDist),l.setMaxDistance(o.maxDist),l.setRolloffFactor(1),l.setVolume(o.volume),l.setPlaybackRate(a.rate),l.setLoop(!0),l.position.set(t.position[1],t.position[2],t.position[0]),s.add(l),(0,T.trackSound)(l),l.play(),e.set(t.id,l)})}catch{}}for(let[t,i]of e)if(!d.has(t)){(0,T.untrackSound)(i);try{i.stop()}catch{}try{i.disconnect()}catch{}Q.current?.remove(i),e.delete(t)}for(let e of r.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??""}`;if(et.current.has(t))continue;et.current.add(t);let i=(0,T.resolveAudioProfile)(e.profileId,u);if(!i)continue;let r=e.position?new n.Vector3(e.position.y,e.position.z,e.position.x):void 0;(0,T.playOneShotSound)(i,$,K,r,Q.current)}}if(X.current.size>500){let e=new Set(r.entities.map(W));for(let t of X.current)e.has(t)||X.current.delete(t)}if(et.current.size>500){let e=new Set(r.entities.map(G));for(let t of et.current)t.startsWith("snd:")&&e.has(t.slice(4))||et.current.delete(t)}},M[7]=L,M[8]=$,M[9]=K,M[10]=I,M[11]=Y,M[12]=k,M[13]=C,M[14]=g):g=M[14],(0,a.useFrame)(g),M[15]===Symbol.for("react.memo_cache_sentinel")?(v=()=>()=>{let e=Q.current;for(let t of J.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let i of t.debugParticleMeshes)e.remove(i);t.geometry.dispose(),t.material.dispose()}for(let t of(J.current=[],ei.current))e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();for(let t of(ei.current=[],er.current))e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();for(let[,t]of(er.current=[],X.current.clear(),Z.current.clear(),ee.current)){(0,T.untrackSound)(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}ee.current.clear(),et.current.clear()},y=[],M[15]=y,M[16]=v):(y=M[15],v=M[16]),(0,r.useEffect)(v,y),M[17]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)("group",{ref:Q}),M[17]=b):b=M[17],b}function G(e){return e.id}function W(e){return e.id}function H(e){return e.gl}var K=e.i(9721),$=e.i(92224),Y=e.i(93784);function Q(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}var J=e.i(77964);let X=new WeakMap;function Z(e){let t=X.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),X.set(e,t)),t}let ee=new n.Vector3,et=new n.Quaternion,ei=new n.Quaternion,er=new n.Quaternion(0,1,0,0),ea=new n.Vector3,eo=new n.Vector3,en=new n.Vector3;function es(e){let c,u,d,m,p,f,h,g,y,S=(0,i.c)(25),{recording:v}=e,b=(0,A.useEngineStoreApi)(),M=(0,r.useRef)(0),x=(0,r.useRef)(null),w=(0,r.useRef)(null);S[0]===Symbol.for("react.memo_cache_sentinel")?(c=new n.Vector3(0,s.DEFAULT_EYE_HEIGHT,0),S[0]=c):c=S[0];let P=(0,r.useRef)(c),k=(0,r.useRef)(v.streamingPlayback??null),C=(0,r.useRef)(null);S[1]===Symbol.for("react.memo_cache_sentinel")?(u=new Map,S[1]=u):u=S[1];let D=(0,r.useRef)(u),I=(0,r.useRef)(null),[B,N]=(0,r.useState)(null);S[2]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{if(e===I.current)return;I.current=e;let t=D.current,i=new Map;for(let a of e.entities){let o=t.get(a.id),n=o&&("Shape"===o.renderType||"Player"===o.renderType||"Explosion"===o.renderType);if(!o||o.className!==(a.className??a.type)||o.ghostIndex!==a.ghostIndex||o.dataBlockId!==a.dataBlockId||o.shapeHint!==a.shapeHint||n&&null!=a.dataBlock&&o.shapeName!==a.dataBlock||"Player"!==o.renderType&&n&&o.weaponShape!==a.weaponShape)o=function(e,t){if(e.sceneData){let i={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case"TerrainBlock":return{...i,renderType:"TerrainBlock",terrainData:e.sceneData};case"InteriorInstance":return{...i,renderType:"InteriorInstance",interiorData:e.sceneData};case"Sky":return{...i,renderType:"Sky",skyData:e.sceneData};case"Sun":return{...i,renderType:"Sun",sunData:e.sceneData};case"WaterBlock":return{...i,renderType:"WaterBlock",waterData:e.sceneData};case"MissionArea":return{...i,renderType:"MissionArea",missionAreaData:e.sceneData};case"TSStatic":return{...Q(e,t),renderType:"Shape",shapeName:e.sceneData.shapeName,shapeType:"TSStatic",dataBlock:e.dataBlock}}}return e.visual?.kind==="tracer"?{...Q(e,t),renderType:"Tracer",visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind==="sprite"?{...Q(e,t),renderType:"Sprite",visual:e.visual}:"Player"===e.type?{...Q(e,t),renderType:"Player",shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,flagShape:e.flagShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:"Explosion"===e.type?{...Q(e,t),renderType:"Explosion",shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:"ForceFieldBare"===e.className?{...Q(e,t),renderType:"ForceFieldBare"}:"AudioEmitter"===e.className?{...Q(e,t),renderType:"AudioEmitter",audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:"WayPoint"===e.className?{...Q(e,t),renderType:"WayPoint",label:e.label}:"Camera"===e.className?{...Q(e,t),renderType:"Camera"}:{...Q(e,t),renderType:"Shape",shapeName:e.dataBlock,shapeType:"Turret"===e.className?"Turret":"Item"===e.className?"Item":"StaticShape",dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor}}(a,e.timeSec);else{var r=o;switch(r.renderType){case"Player":r.threads=a.threads,r.weaponShape=a.weaponShape,r.packShape=a.packShape,r.flagShape=a.flagShape,r.falling=a.falling,r.jetting=a.jetting,r.weaponImageState=a.weaponImageState,r.weaponImageStates=a.weaponImageStates,r.playerName=a.playerName,r.iffColor=a.iffColor,r.headPitch=a.headPitch,r.headYaw=a.headYaw,r.targetRenderFlags=a.targetRenderFlags;break;case"Shape":r.threads=a.threads,r.targetRenderFlags=a.targetRenderFlags,r.iffColor=a.iffColor}}if(i.set(a.id,o),(0,J.isSceneEntity)(o)||"None"===o.renderType)continue;let s=o.keyframes;0===s.length&&s.push({time:e.timeSec,position:a.position??[0,0,0],rotation:a.rotation??[0,0,0,1]});let l=s[0];l.time=e.timeSec,a.position&&(l.position=a.position),a.rotation&&(l.rotation=a.rotation),l.velocity=a.velocity,l.health=a.health,l.energy=a.energy,l.actionAnim=a.actionAnim,l.actionAtEnd=a.actionAtEnd,l.damageState=a.damageState}for(let[r,a]of t)if(!i.has(r)&&"Explosion"===a.renderType&&a.shapeName&&null!=a.spawnTime&&e.timeSec-a.spawnTime<5){i.set(r,a);continue}let a=i.size!==t.size||[...i.keys()].some(e=>!t.has(e));D.current=i,a&&$.gameEntityStore.getState().setAllStreamEntities(Array.from(i.values()));let o=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId),r=t?t.shapeName:void 0;r&&(o=r)}N(e=>e===o?e:o)},S[2]=d):d=S[2];let E=d;return S[3]!==b||S[4]!==v.gameType||S[5]!==v.missionName||S[6]!==v.recorderName||S[7]!==v.recordingDate||S[8]!==v.serverDisplayName||S[9]!==v.source||S[10]!==v.streamingPlayback?(m=()=>{(0,T.stopAllTrackedSounds)(),k.current=v.streamingPlayback??null,D.current=new Map,I.current=null,C.current=null,(0,Y.resetStreamPlayback)(),M.current=0,x.current=null,w.current=null;let e=k.current;if(Y.streamPlaybackStore.setState({playback:e}),$.gameEntityStore.getState().beginStreaming(v.source),!e)return void b.getState().setPlaybackStreamSnapshot(null);e.onMissionInfoChange=()=>{$.gameEntityStore.getState().setMissionInfo({missionDisplayName:e.missionDisplayName??void 0,missionTypeDisplayName:e.missionTypeDisplayName??void 0,gameClassName:e.gameClassName??void 0,recorderName:e.connectedPlayerName??void 0})};let t=e.missionDisplayName,i=e.missionTypeDisplayName,r=e.gameClassName,a=e.serverDisplayName,n=e.connectedPlayerName;for(let s of("live"!==v.source&&e.reset(),e.missionDisplayName=t,e.missionTypeDisplayName=i,e.gameClassName=r,e.serverDisplayName=a,e.connectedPlayerName=n,$.gameEntityStore.getState().setMissionInfo({missionName:v.missionName??void 0,missionTypeDisplayName:v.gameType??void 0,missionDisplayName:t??void 0,gameClassName:r??void 0,serverDisplayName:a??v.serverDisplayName??void 0,recorderName:n??v.recorderName??void 0,recordingDate:v.recordingDate??void 0}),e.getEffectShapes()))o.useGLTF.preload((0,l.shapeToUrl)(s));let s=e.getSnapshot();return Y.streamPlaybackStore.setState({time:s.timeSec}),M.current=s.timeSec,x.current=s,w.current=s,E(s),b.getState().setPlaybackStreamSnapshot(s),C.current=s,()=>{(0,T.stopAllTrackedSounds)(),k.current=null,(0,Y.resetStreamPlayback)()}},S[3]=b,S[4]=v.gameType,S[5]=v.missionName,S[6]=v.recorderName,S[7]=v.recordingDate,S[8]=v.serverDisplayName,S[9]=v.source,S[10]=v.streamingPlayback,S[11]=m):m=S[11],S[12]!==b||S[13]!==v?(p=[v,b,E],S[12]=b,S[13]=v,S[14]=p):p=S[14],(0,r.useEffect)(m,p),S[15]!==b||S[16]!==v.source?(f=(e,t)=>{let i=k.current;if(!i)return;let r=b.getState(),a=r.playback,o="playing"===a.status,n=a.timeMs/1e3,l=!o&&Math.abs(n-M.current)>5e-4,c=o&&Math.abs(n-Y.streamPlaybackStore.getState().time)>.05,u=l||c;u&&(M.current=n),o&&((0,A.advanceEffectClock)(t,a.rate),M.current=M.current+t*a.rate);let d=Math.max(1,Math.ceil(1e3*t*Math.max(a.rate,.01)/32)+2),m=M.current+s.STREAM_TICK_SEC,p=i.stepToTime(m,o&&!u?d:1/0),f=w.current;!f||p.timeSec1.5*s.STREAM_TICK_SEC?(x.current=p,w.current=p):p.timeSec!==f.timeSec&&(x.current=f,w.current=p);let h=w.current??p,g=x.current??h,y=h.timeSec-s.STREAM_TICK_SEC,S=Math.max(0,Math.min(1,(M.current-y)/s.STREAM_TICK_SEC));Y.streamPlaybackStore.setState({time:M.current}),p.exhausted&&o&&(M.current=Math.min(M.current,p.timeSec)),E(h),Y.streamPlaybackStore.getState().entities=D.current,h!==C.current&&(C.current=h,r.setPlaybackStreamSnapshot(h));let T=h.camera,I=T&&g.camera&&g.camera.mode===T.mode&&g.camera.controlEntityId===T.controlEntityId&&g.camera.orbitTargetId===T.orbitTargetId?g.camera:null,B=Y.streamPlaybackStore.getState().freeFlyCamera,N="live"===v.source;if(T&&!B){if(I){let t=I.position[0],i=I.position[1],r=I.position[2],a=T.position[0],o=T.position[1],n=T.position[2];e.camera.position.set(i+(o-i)*S,r+(n-r)*S,t+(a-t)*S),N||(et.set(...I.rotation),ei.set(...T.rotation),et.slerp(ei,S),e.camera.quaternion.copy(et))}else e.camera.position.set(T.position[1],T.position[2],T.position[0]),N||e.camera.quaternion.set(...T.rotation);if(Number.isFinite(T.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,i=I&&Number.isFinite(I.fov)?I.fov+(T.fov-I.fov)*S:T.fov,r=(0,s.torqueHorizontalFovToThreeVerticalFov)(i,t.aspect);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let R=Z(h),V=Z(g),F=D.current,_=Y.streamPlaybackStore.getState().root;if(_)for(let t of _.children){let i=F.get(t.name);if(i&&(0,J.isSceneEntity)(i))continue;let r=R.get(t.name);if(!r){let e=i&&"keyframes"in i?i.keyframes:void 0;if(e?.[0]?.position){let i=e[0];t.visible=!0,t.position.set(i.position[1],i.position[2],i.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=V.get(t.name);if(a?.position){let e=a.position[0],i=a.position[1],o=a.position[2],n=r.position[0],s=r.position[1],l=r.position[2],c=e+(n-e)*S,u=i+(s-i)*S,d=o+(l-o)*S;t.position.set(u,d,c)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(er):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(et.set(...a.rotation),ei.set(...r.rotation),et.slerp(ei,S),t.quaternion.copy(et)):t.quaternion.set(...r.rotation))}let O=T?.mode;if(!B&&!N&&"third-person"===O&&_&&T?.orbitTargetId){let t=_.children.find(e=>e.name===T.orbitTargetId);if(t){let i=R.get(T.orbitTargetId);eo.copy(t.position),i?.type==="Player"&&(eo.y=eo.y+1);let r=!1;if(T.orbitDirection)ea.set(T.orbitDirection[0],T.orbitDirection[1],T.orbitDirection[2]),r=ea.lengthSq()>1e-8;else if("number"==typeof T.yaw&&"number"==typeof T.pitch){let e=Math.sin(T.pitch),t=Math.cos(T.pitch),i=Math.sin(T.yaw),a=Math.cos(T.yaw);ea.set(-a*t,-e,-i*t),r=ea.lengthSq()>1e-8}if(r||(ea.copy(e.camera.position).sub(eo),r=ea.lengthSq()>1e-8),r){ea.normalize();let t=Math.max(.1,T.orbitDistance??4);en.copy(eo).addScaledVector(ea,t),e.camera.position.copy(en),e.camera.lookAt(eo)}}}if(!B&&"first-person"===O&&_&&T?.controlEntityId){let t=_.children.find(e=>e.name===T.controlEntityId);t?(ee.copy(P.current).applyQuaternion(t.quaternion),e.camera.position.add(ee)):e.camera.position.y=e.camera.position.y+P.current.y}o&&p.exhausted&&r.setPlaybackStatus("paused");let z=1e3*M.current;Math.abs(z-a.timeMs)>.5&&r.setPlaybackTime(z)},S[15]=b,S[16]=v.source,S[17]=f):f=S[17],(0,a.useFrame)(f),S[18]!==v.streamingPlayback?(h=(0,t.jsx)(L,{playback:v.streamingPlayback,snapshotRef:w}),S[18]=v.streamingPlayback,S[19]=h):h=S[19],S[20]!==B?(g=B&&(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(K.PlayerEyeOffset,{shapeName:B,eyeOffsetRef:P})}),S[20]=B,S[21]=g):g=S[21],S[22]!==h||S[23]!==g?(y=(0,t.jsxs)(t.Fragment,{children:[h,g]}),S[22]=h,S[23]=g,S[24]=y):y=S[24],y}e.s(["StreamingController",()=>es],51295)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/c5f946098461b297.js b/docs/_next/static/chunks/c5f946098461b297.js new file mode 100644 index 00000000..e9be5e0e --- /dev/null +++ b/docs/_next/static/chunks/c5f946098461b297.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66789,e=>{"use strict";var t=e.i(43476),i=e.i(932),a=e.i(71645),r=e.i(71753),n=e.i(90072),o=e.i(58647),l=e.i(82816),s=e.i(85557),u=e.i(71505),c=e.i(91907),m=e.i(56893),f=e.i(25947),p=e.i(93784);function h(e){let a,r,n,o,l,u=(0,i.c)(18),{entity:m}=e,p=m.weaponShape,h=m.shapeName,d=(0,c.useStaticShape)(h),y=(0,c.useStaticShape)(p);if(u[0]!==d.animations||u[1]!==d.scene||u[2]!==p||u[3]!==y.animations||u[4]!==y.scene){e:{let e,t,i,r=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(p),n=(0,s.getPosedNodeTransform)(d.scene,d.animations,"Mount0",[r]);if(!n){let e;u[6]===Symbol.for("react.memo_cache_sentinel")?(e={position:void 0,quaternion:void 0},u[6]=e):e=u[6],a=e;break e}let o=(0,s.getPosedNodeTransform)(y.scene,y.animations,"Mountpoint");if(o){let i=o.quaternion.clone().invert(),a=o.position.clone().negate().applyQuaternion(i);t=n.quaternion.clone().multiply(i),e=a.clone().applyQuaternion(n.quaternion).add(n.position)}else e=n.position.clone(),t=n.quaternion.clone();let l=e.applyQuaternion(s._r90),c=s._r90.clone().multiply(t).multiply(s._r90inv);u[7]!==l||u[8]!==c?(i={position:l,quaternion:c},u[7]=l,u[8]=c,u[9]=i):i=u[9],a=i}u[0]=d.animations,u[1]=d.scene,u[2]=p,u[3]=y.animations,u[4]=y.scene,u[5]=a}else a=u[5];let g=a;u[10]===Symbol.for("react.memo_cache_sentinel")?(r={_class:"weapon",_className:"Weapon",_id:0},u[10]=r):r=u[10];let _=r;return u[11]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)(c.ShapeRenderer,{loadingColor:"#4488ff"}),u[11]=n):n=u[11],u[12]!==g.position||u[13]!==g.quaternion?(o=(0,t.jsx)("group",{position:g.position,quaternion:g.quaternion,children:n}),u[12]=g.position,u[13]=g.quaternion,u[14]=o):o=u[14],u[15]!==p||u[16]!==o?(l=(0,t.jsx)(f.ShapeInfoProvider,{object:_,shapeName:p,type:"Item",children:o}),u[15]=p,u[16]=o,u[17]=l):l=u[17],l}function d({entity:e}){let i=p.streamPlaybackStore.getState().playback,f=(0,c.useStaticShape)(e.shapeName),h=(0,m.useAnisotropy)(),d=(0,a.useRef)(null),y=(0,a.useRef)((0,o.effectNow)()),g=(0,a.useRef)(Math.random()*Math.PI*2),_=(0,a.useRef)([]),S=(0,a.useMemo)(()=>{if(e.explosionDataBlockId)return i.getDataBlockData(e.explosionDataBlockId)},[e.explosionDataBlockId,i]),v=(0,a.useMemo)(()=>S?function(e){let t=e.sizes,i=e.times;if(!Array.isArray(t)||0===t.length)return{times:[0,1],sizes:[[1,1,1],[1,1,1]]};let a=t.map(e=>[e.x/100,e.y/100,e.z/100]);return{times:Array.isArray(i)?i:a.map((e,t)=>t/Math.max(a.length-1,1)),sizes:a}}(S):void 0,[S]),A=(0,a.useMemo)(()=>{let e=S?.explosionScale;return e?[e.x/100,e.y/100,e.z/100]:[1,1,1]},[S]),M=32*(S?.lifetimeMS??31),b=!1!==e.faceViewer,{scene:x,mixer:q,visNodes:k,iflInfos:N,materials:w}=(0,a.useMemo)(()=>{let t=l.clone(f.scene),i=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let a=new Set(t.userData.flag_names??[]),r=t.userData.resource_path;if(a.has("IflMaterial")&&r){let t=e.userData;i.push({mesh:e,iflPath:`textures/${r}.ifl`,sequenceName:t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,duration:t?.ifl_duration?Number(t.ifl_duration):void 0,cyclic:t?.ifl_sequence?!!t.ifl_cyclic:void 0,toolBegin:t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0})}}),(0,s.processShapeScene)(t,e.shapeName,{anisotropy:h});let a=[];for(let e of(t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let i=t.vis_keyframes,r=t.vis_duration,n=(t.vis_sequence??"").toLowerCase();n&&Array.isArray(i)&&!(i.length<=1)&&r&&!(r<=0)&&"ambient"===n&&a.push({mesh:e,keyframes:i,duration:r,cyclic:!!t.vis_cyclic})}),a))e.mesh.visible=!0,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);for(let e of i)e.mesh.userData?.vis_sequence||(e.mesh.visible=!0);let r=new Map;for(let e of f.animations)r.set(e.name.toLowerCase(),e);let o=r.get("ambient"),u=null;if(o){let e=(u=new n.AnimationMixer(t)).clipAction(o);e.setLoop(n.LoopOnce,1),e.clampWhenFinished=!0,e.timeScale=(S?.playSpeed??20)/20,e.play()}let c=[];return t.traverse(e=>{e.isMesh&&(Array.isArray(e.material)?c.push(...e.material):e.material&&c.push(e.material))}),t.traverse(e=>{e.frustumCulled=!1}),{scene:t,mixer:u,visNodes:a,iflInfos:i,materials:c}},[f,S,h]);return(0,a.useEffect)(()=>()=>{(0,s.disposeClonedScene)(x),q?.uncacheRoot(x)},[x,q]),(0,a.useEffect)(()=>{for(let e of(_.current=[],N))(0,u.loadIflAtlas)(e.iflPath).then(t=>{let i=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;i&&(i.map=t.texture,i.needsUpdate=!0),_.current.push({atlas:t,info:e})}).catch(()=>{})},[N]),(0,r.useFrame)((e,t)=>{let i=d.current;if(!i)return;let a=o.engineStore.getState().playback,r="playing"===a.status?t*a.rate:0,n=(0,o.effectNow)()-y.current,l=Math.min(n/M,1),s=n/1e3;q&&q.update(r);let c=l>.8?1-(l-.8)/.2:1;for(let{mesh:e,keyframes:t,duration:i,cyclic:a}of k){let r=e.material;if(!r||Array.isArray(r))continue;let n=s/i,o=a?n%1:Math.min(n,1),l=t.length,u=o*l,m=Math.floor(u)%l,f=(m+1)%l,p=u-Math.floor(u);r.opacity=(t[m]+(t[f]-t[m])*p)*c}if(c<1)for(let e of w)"opacity"in e&&(e.transparent=!0,e.opacity*=c);for(let{atlas:e,info:t}of _.current){let i;i=t.sequenceName&&t.duration?(t.cyclic?s/t.duration%1:Math.min(s/t.duration,1))*t.duration+(t.toolBegin??0):s,(0,u.updateAtlasFrame)(e,(0,u.getFrameIndexForTime)(e,i))}if(v){let e=function(e,t){let{times:i,sizes:a}=e;if(0===i.length)return[1,1,1];if(t<=i[0])return a[0];if(t>=i[i.length-1])return a[a.length-1];for(let e=0;e=i[e]&&t<=i[e+1]){let r=(t-i[e])/(i[e+1]-i[e]);return[a[e][0]+(a[e+1][0]-a[e][0])*r,a[e][1]+(a[e+1][1]-a[e][1])*r,a[e][2]+(a[e+1][2]-a[e][2])*r]}return a[a.length-1]}(v,l);i.scale.set(e[0]*A[0],e[1]*A[1],e[2]*A[2])}b&&(i.lookAt(e.camera.position),i.rotateZ(g.current))}),(0,t.jsx)("group",{ref:d,children:(0,t.jsx)("group",{rotation:[0,Math.PI,0],children:(0,t.jsx)("primitive",{object:x})})})}e.s(["ExplosionShape",()=>d,"WeaponModel",()=>h])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/634517795b833f16.js b/docs/_next/static/chunks/cc36ef62835b35ab.js similarity index 86% rename from docs/_next/static/chunks/634517795b833f16.js rename to docs/_next/static/chunks/cc36ef62835b35ab.js index 8afeff82..f847502a 100644 --- a/docs/_next/static/chunks/634517795b833f16.js +++ b/docs/_next/static/chunks/cc36ef62835b35ab.js @@ -19,7 +19,7 @@ float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { float line = min(grid.x, grid.y); return 1.0 - min(line / lineWidth, 1.0); } -`;var tq=e.i(47021),tQ=e.i(48066);let tK={0:32,1:32,2:32,3:32,4:32,5:32},tY=(0,a.memo)(function({displacementMap:e,visibilityMask:r,textureNames:n,alphaTextures:o,detailTextureName:i,lightmap:l}){let{debugMode:s}=(0,b.useDebug)(),c=(0,tO.useTexture)(n.map(e=>(0,tW.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,tH.setupTexture)(e))}),u=i?(0,tW.textureToUrl)(i):null,d=(0,tO.useTexture)(u??tW.FALLBACK_TEXTURE_URL,e=>{(0,tH.setupTexture)(e)}),m=(0,a.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:a,tiling:n,detailTexture:o=null,lightmap:i=null}){e.uniforms.sunLightPointsDown=t$;let l=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),a&&(e.uniforms.visibilityMask={value:a}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:n[r]??32}}),i&&(e.uniforms.terrainLightmap={value:i}),o&&(e.uniforms.detailTexture={value:o},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include +`;var tq=e.i(56893),tQ=e.i(47021),tK=e.i(48066);let tY={0:32,1:32,2:32,3:32,4:32,5:32},tJ=(0,a.memo)(function({displacementMap:e,visibilityMask:r,textureNames:n,alphaTextures:o,detailTextureName:i,lightmap:l}){let{debugMode:s}=(0,b.useDebug)(),c=(0,tq.useAnisotropy)(),u=(0,tO.useTexture)(n.map(e=>(0,tW.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,tH.setupTexture)(e,{anisotropy:c}))}),d=i?(0,tW.textureToUrl)(i):null,m=(0,tO.useTexture)(d??tW.FALLBACK_TEXTURE_URL,e=>{(0,tH.setupTexture)(e,{anisotropy:c})}),f=(0,a.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:a,tiling:n,detailTexture:o=null,lightmap:i=null}){e.uniforms.sunLightPointsDown=t$;let l=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),a&&(e.uniforms.visibilityMask={value:a}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:n[r]??32}}),i&&(e.uniforms.terrainLightmap={value:i}),o&&(e.uniforms.detailTexture={value:o},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; @@ -182,7 +182,7 @@ void RE_Direct_TerrainShadow( const in IncidentLight directLight, const in vec3 gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); #endif -#include `)}({shader:e,baseTextures:c,alphaTextures:o,visibilityMask:r,tiling:tK,detailTexture:u?d:null,lightmap:l}),(0,tq.injectCustomFog)(e,tQ.globalFogUniforms)},[c,o,r,d,u,l]),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=f.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!s,e.needsUpdate=!0)},[s]);let h=`${u?"detail":"nodetail"}-${l?"lightmap":"nolightmap"}`;return(0,t.jsx)("meshLambertMaterial",{ref:f,map:e,depthWrite:!0,side:tM.FrontSide,defines:{DEBUG_MODE:+!!s},onBeforeCompile:m},h)}),tJ=(0,a.memo)(function(e){let n,o,i=(0,r.c)(8),{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),i[0]=n):n=i[0],i[1]!==u||i[2]!==d||i[3]!==l||i[4]!==m||i[5]!==c||i[6]!==s?(o=(0,t.jsx)(a.Suspense,{fallback:n,children:(0,t.jsx)(tY,{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m})}),i[1]=u,i[2]=d,i[3]=l,i[4]=m,i[5]=c,i[6]=s,i[7]=o):o=i[7],o}),tZ=(0,a.memo)(function(e){let a,n,o,i=(0,r.c)(15),{tileX:l,tileZ:s,blockSize:c,basePosition:u,textureNames:d,geometry:m,displacementMap:f,visibilityMask:h,alphaTextures:p,detailTextureName:g,lightmap:v,visible:x}=e,y=void 0===x||x,b=c/2,_=u.x+l*c+b,S=u.z+s*c+b;i[0]!==_||i[1]!==S?(a=[_,0,S],i[0]=_,i[1]=S,i[2]=a):a=i[2];let j=a;return i[3]!==p||i[4]!==g||i[5]!==f||i[6]!==v||i[7]!==d||i[8]!==h?(n=(0,t.jsx)(tJ,{displacementMap:f,visibilityMask:h,textureNames:d,alphaTextures:p,detailTextureName:g,lightmap:v}),i[3]=p,i[4]=g,i[5]=f,i[6]=v,i[7]=d,i[8]=h,i[9]=n):n=i[9],i[10]!==m||i[11]!==j||i[12]!==n||i[13]!==y?(o=(0,t.jsx)("mesh",{position:j,geometry:m,castShadow:!0,receiveShadow:!0,visible:y,children:n}),i[10]=m,i[11]=j,i[12]=n,i[13]=y,i[14]=o):o=i[14],o});function tX(e){}let t0=(0,w.createLogger)("TerrainBlock");function t1(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,a=r>>8&255,n=r>>16,o=256*a;for(let r=0;r0?S.visibleDistance:600,I=(0,tC.useThree)(t3),A=-(128*R);T[0]!==A?(n={x:A,z:A},T[0]=A,T[1]=n):n=T[1];let P=n;T[2]!==k.emptySquareRuns?(o=k.emptySquareRuns??[],T[2]=k.emptySquareRuns,T[3]=o):o=T[3];let E=o,{data:z}=((M=(0,r.c)(8))[0]!==F?(j={queryKey:["terrain",F],queryFn:()=>(t0.debug("Loading terrain: %s",F),(0,tW.loadTerrain)(F))},M[0]=F,M[1]=j):j=M[1],N=(0,tG.useQuery)(j),M[2]!==N.data||M[3]!==N.error||M[4]!==N.status||M[5]!==F?(C=()=>{t0.debug("Query status: %s%s%s file=%s",N.status,N.error?` error=${N.error.message}`:"",N.data?" (data ready)":" (no data)",F)},w=[N.status,N.error,N.data,F],M[2]=N.data,M[3]=N.error,M[4]=N.status,M[5]=F,M[6]=C,M[7]=w):(C=M[6],w=M[7]),(0,a.useEffect)(C,w),N);e:{let e;if(!z){i=null;break e}let t=256*R;T[4]!==t||T[5]!==R||T[6]!==z.heightMap?(!function(e,t,r){let a=e.attributes.position,n=e.attributes.uv,o=e.attributes.normal,i=a.array,l=n.array,s=o.array,c=a.count,u=(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 a=Math.floor(e=Math.max(0,Math.min(255,e))),n=Math.floor(r=Math.max(0,Math.min(255,r))),o=Math.min(a+1,255),i=Math.min(n+1,255),l=e-a,s=r-n;return(t[256*n+a]/65535*2048*(1-l)+t[256*n+o]/65535*2048*l)*(1-s)+(t[256*i+a]/65535*2048*(1-l)+t[256*i+o]/65535*2048*l)*s};for(let e=0;e0?(h/=v,p/=v,g/=v):(h=0,p=1,g=0),s[3*e]=h,s[3*e+1]=p,s[3*e+2]=g}a.needsUpdate=!0,o.needsUpdate=!0}(e=function(e,t){let r=new tM.BufferGeometry,a=new Float32Array(198147),n=new Float32Array(198147),o=new Float32Array(132098),i=new Uint32Array(393216),l=0,s=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let i=257*t+r;a[3*i]=r*s-e/2,a[3*i+1]=e/2-t*s,a[3*i+2]=0,n[3*i]=0,n[3*i+1]=0,n[3*i+2]=1,o[2*i]=r/256,o[2*i+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,a=r+1,n=(e+1)*257+t,o=n+1;((t^e)&1)==0?(i[l++]=r,i[l++]=n,i[l++]=o,i[l++]=r,i[l++]=o,i[l++]=a):(i[l++]=r,i[l++]=n,i[l++]=a,i[l++]=a,i[l++]=n,i[l++]=o)}return r.setIndex(new tM.BufferAttribute(i,1)),r.setAttribute("position",new tM.Float32BufferAttribute(a,3)),r.setAttribute("normal",new tM.Float32BufferAttribute(n,3)),r.setAttribute("uv",new tM.Float32BufferAttribute(o,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(t,0),z.heightMap,R),T[4]=t,T[5]=R,T[6]=z.heightMap,T[7]=e):e=T[7],i=e}let G=i;T[8]!==R||T[9]!==z?(l=()=>{if(z){var e;return tX((e=z.heightMap,(t,r)=>{let a=Math.max(0,Math.min(255,t/R+128)),n=Math.max(0,Math.min(255,r/R+128)),o=Math.floor(a),i=Math.floor(n),l=Math.min(o+1,255),s=Math.min(i+1,255),c=a-o,u=n-i;return((e[256*i+o]*(1-c)+e[256*i+l]*c)*(1-u)+(e[256*s+o]*(1-c)+e[256*s+l]*c)*u)/65535*2048})),t5}},s=[z,R],T[8]=R,T[9]=z,T[10]=l,T[11]=s):(l=T[10],s=T[11]),(0,a.useEffect)(l,s);let U=(0,eX.useSceneSun)();t:{let e,t;if(!U){let e;T[12]===Symbol.for("react.memo_cache_sentinel")?(e=new tM.Vector3(.57735,-.57735,.57735),T[12]=e):e=T[12],c=e;break t}T[13]!==U.direction?(e=(0,tU.torqueToThree)(U.direction),T[13]=U.direction,T[14]=e):e=T[14];let[r,a,n]=e,o=Math.sqrt(r*r+a*a+n*n),i=r/o,l=a/o,s=n/o;T[15]!==s||T[16]!==i||T[17]!==l?(t=new tM.Vector3(i,l,s),T[15]=s,T[16]=i,T[17]=l,T[18]=t):t=T[18],c=t}let W=c;r:{let e;if(!z){u=null;break r}T[19]!==R||T[20]!==W||T[21]!==z.heightMap?(e=function(e,t,r){let a=(t,r)=>{let a=Math.max(0,Math.min(255,t)),n=Math.max(0,Math.min(255,r)),o=Math.floor(a),i=Math.floor(n),l=Math.min(o+1,255),s=Math.min(i+1,255),c=a-o,u=n-i;return((e[256*i+o]/65535*(1-c)+e[256*i+l]/65535*c)*(1-u)+(e[256*s+o]/65535*(1-c)+e[256*s+l]/65535*c)*u)*2048},n=new tM.Vector3(-t.x,-t.y,-t.z).normalize(),o=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let i=t/2+.25,l=e/2+.25,s=a(i,l),c=a(i-.5,l),u=a(i+.5,l),d=a(i,l-.5),m=-((a(i,l+.5)-d)/1),f=-((u-c)/1),h=Math.sqrt(m*m+r*r+f*f),p=Math.max(0,m/h*n.x+r/h*n.y+f/h*n.z),g=1;p>0&&(g=function(e,t,r,a,n,o){let i=a.z/n,l=a.x/n,s=a.y,c=Math.sqrt(i*i+l*l);if(c<1e-4)return 1;let u=.5/c,d=i*u,m=l*u,f=s*u,h=e,p=t,g=r+.1;for(let e=0;e<768&&(h+=d,p+=m,g+=f,!(h<0)&&!(h>=256)&&!(p<0)&&!(p>=256)&&!(g>2048));e++)if(gArray(K).fill(null),T[32]=K,T[33]=g):g=T[33];let[J,Z]=(0,a.useState)(g);T[34]===Symbol.for("react.memo_cache_sentinel")?(v={xStart:0,xEnd:0,zStart:0,zEnd:0},T[34]=v):v=T[34];let X=(0,a.useRef)(v);return(T[35]!==P.x||T[36]!==P.z||T[37]!==L||T[38]!==I.position.x||T[39]!==I.position.z||T[40]!==K||T[41]!==B?(x=()=>{let e=I.position.x-P.x,t=I.position.z-P.z,r=Math.floor((e-B)/L),a=Math.ceil((e+B)/L),n=Math.floor((t-B)/L),o=Math.ceil((t+B)/L),i=X.current;if(r===i.xStart&&a===i.xEnd&&n===i.zStart&&o===i.zEnd)return;i.xStart=r,i.xEnd=a,i.zStart=n,i.zEnd=o;let l=[];for(let e=r;e{let r=J[e];return(0,t.jsx)(tZ,{tileX:r?.tileX??0,tileZ:r?.tileZ??0,blockSize:L,basePosition:P,textureNames:z.textureNames,geometry:G,displacementMap:O,visibilityMask:V,alphaTextures:q,detailTextureName:D,lightmap:H,visible:null!==r},e)}),T[53]=P,T[54]=L,T[55]=D,T[56]=Y,T[57]=q,T[58]=O,T[59]=G,T[60]=z.textureNames,T[61]=H,T[62]=J,T[63]=b):b=T[63],T[64]!==y||T[65]!==b?(_=(0,t.jsxs)(t.Fragment,{children:[y,b]}),T[64]=y,T[65]=b,T[66]=_):_=T[66],_):(t0.debug("Not ready: terrain=%s geometry=%s displacement=%s alpha=%s",!!z,!!G,!!O,!!q),null)});function t3(e){return e.camera}function t5(){return tX(null)}function t4(e){return(0,tH.setupMask)(e)}function t6(e,t){return t}var t8=e.i(8597),t7=e.i(78140);let t9=` +#include `)}({shader:e,baseTextures:u,alphaTextures:o,visibilityMask:r,tiling:tY,detailTexture:d?m:null,lightmap:l}),(0,tQ.injectCustomFog)(e,tK.globalFogUniforms)},[u,o,r,m,d,l]),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!s,e.needsUpdate=!0)},[s]);let p=`${d?"detail":"nodetail"}-${l?"lightmap":"nolightmap"}`;return(0,t.jsx)("meshLambertMaterial",{ref:h,map:e,depthWrite:!0,side:tM.FrontSide,defines:{DEBUG_MODE:+!!s},onBeforeCompile:f},p)}),tZ=(0,a.memo)(function(e){let n,o,i=(0,r.c)(8),{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),i[0]=n):n=i[0],i[1]!==u||i[2]!==d||i[3]!==l||i[4]!==m||i[5]!==c||i[6]!==s?(o=(0,t.jsx)(a.Suspense,{fallback:n,children:(0,t.jsx)(tJ,{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m})}),i[1]=u,i[2]=d,i[3]=l,i[4]=m,i[5]=c,i[6]=s,i[7]=o):o=i[7],o}),tX=(0,a.memo)(function(e){let a,n,o,i=(0,r.c)(15),{tileX:l,tileZ:s,blockSize:c,basePosition:u,textureNames:d,geometry:m,displacementMap:f,visibilityMask:h,alphaTextures:p,detailTextureName:g,lightmap:v,visible:x}=e,y=void 0===x||x,b=c/2,_=u.x+l*c+b,S=u.z+s*c+b;i[0]!==_||i[1]!==S?(a=[_,0,S],i[0]=_,i[1]=S,i[2]=a):a=i[2];let j=a;return i[3]!==p||i[4]!==g||i[5]!==f||i[6]!==v||i[7]!==d||i[8]!==h?(n=(0,t.jsx)(tZ,{displacementMap:f,visibilityMask:h,textureNames:d,alphaTextures:p,detailTextureName:g,lightmap:v}),i[3]=p,i[4]=g,i[5]=f,i[6]=v,i[7]=d,i[8]=h,i[9]=n):n=i[9],i[10]!==m||i[11]!==j||i[12]!==n||i[13]!==y?(o=(0,t.jsx)("mesh",{position:j,geometry:m,castShadow:!0,receiveShadow:!0,visible:y,children:n}),i[10]=m,i[11]=j,i[12]=n,i[13]=y,i[14]=o):o=i[14],o});function t0(e){}let t1=(0,w.createLogger)("TerrainBlock");function t2(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,a=r>>8&255,n=r>>16,o=256*a;for(let r=0;r0?S.visibleDistance:600,I=(0,tC.useThree)(t5),A=-(128*R);T[0]!==A?(n={x:A,z:A},T[0]=A,T[1]=n):n=T[1];let P=n;T[2]!==k.emptySquareRuns?(o=k.emptySquareRuns??[],T[2]=k.emptySquareRuns,T[3]=o):o=T[3];let E=o,{data:z}=((M=(0,r.c)(8))[0]!==F?(j={queryKey:["terrain",F],queryFn:()=>(t1.debug("Loading terrain: %s",F),(0,tW.loadTerrain)(F))},M[0]=F,M[1]=j):j=M[1],N=(0,tG.useQuery)(j),M[2]!==N.data||M[3]!==N.error||M[4]!==N.status||M[5]!==F?(C=()=>{t1.debug("Query status: %s%s%s file=%s",N.status,N.error?` error=${N.error.message}`:"",N.data?" (data ready)":" (no data)",F)},w=[N.status,N.error,N.data,F],M[2]=N.data,M[3]=N.error,M[4]=N.status,M[5]=F,M[6]=C,M[7]=w):(C=M[6],w=M[7]),(0,a.useEffect)(C,w),N);e:{let e;if(!z){i=null;break e}let t=256*R;T[4]!==t||T[5]!==R||T[6]!==z.heightMap?(!function(e,t,r){let a=e.attributes.position,n=e.attributes.uv,o=e.attributes.normal,i=a.array,l=n.array,s=o.array,c=a.count,u=(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 a=Math.floor(e=Math.max(0,Math.min(255,e))),n=Math.floor(r=Math.max(0,Math.min(255,r))),o=Math.min(a+1,255),i=Math.min(n+1,255),l=e-a,s=r-n;return(t[256*n+a]/65535*2048*(1-l)+t[256*n+o]/65535*2048*l)*(1-s)+(t[256*i+a]/65535*2048*(1-l)+t[256*i+o]/65535*2048*l)*s};for(let e=0;e0?(h/=v,p/=v,g/=v):(h=0,p=1,g=0),s[3*e]=h,s[3*e+1]=p,s[3*e+2]=g}a.needsUpdate=!0,o.needsUpdate=!0}(e=function(e,t){let r=new tM.BufferGeometry,a=new Float32Array(198147),n=new Float32Array(198147),o=new Float32Array(132098),i=new Uint32Array(393216),l=0,s=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let i=257*t+r;a[3*i]=r*s-e/2,a[3*i+1]=e/2-t*s,a[3*i+2]=0,n[3*i]=0,n[3*i+1]=0,n[3*i+2]=1,o[2*i]=r/256,o[2*i+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,a=r+1,n=(e+1)*257+t,o=n+1;((t^e)&1)==0?(i[l++]=r,i[l++]=n,i[l++]=o,i[l++]=r,i[l++]=o,i[l++]=a):(i[l++]=r,i[l++]=n,i[l++]=a,i[l++]=a,i[l++]=n,i[l++]=o)}return r.setIndex(new tM.BufferAttribute(i,1)),r.setAttribute("position",new tM.Float32BufferAttribute(a,3)),r.setAttribute("normal",new tM.Float32BufferAttribute(n,3)),r.setAttribute("uv",new tM.Float32BufferAttribute(o,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(t,0),z.heightMap,R),T[4]=t,T[5]=R,T[6]=z.heightMap,T[7]=e):e=T[7],i=e}let G=i;T[8]!==R||T[9]!==z?(l=()=>{if(z){var e;return t0((e=z.heightMap,(t,r)=>{let a=Math.max(0,Math.min(255,t/R+128)),n=Math.max(0,Math.min(255,r/R+128)),o=Math.floor(a),i=Math.floor(n),l=Math.min(o+1,255),s=Math.min(i+1,255),c=a-o,u=n-i;return((e[256*i+o]*(1-c)+e[256*i+l]*c)*(1-u)+(e[256*s+o]*(1-c)+e[256*s+l]*c)*u)/65535*2048})),t4}},s=[z,R],T[8]=R,T[9]=z,T[10]=l,T[11]=s):(l=T[10],s=T[11]),(0,a.useEffect)(l,s);let U=(0,eX.useSceneSun)();t:{let e,t;if(!U){let e;T[12]===Symbol.for("react.memo_cache_sentinel")?(e=new tM.Vector3(.57735,-.57735,.57735),T[12]=e):e=T[12],c=e;break t}T[13]!==U.direction?(e=(0,tU.torqueToThree)(U.direction),T[13]=U.direction,T[14]=e):e=T[14];let[r,a,n]=e,o=Math.sqrt(r*r+a*a+n*n),i=r/o,l=a/o,s=n/o;T[15]!==s||T[16]!==i||T[17]!==l?(t=new tM.Vector3(i,l,s),T[15]=s,T[16]=i,T[17]=l,T[18]=t):t=T[18],c=t}let W=c;r:{let e;if(!z){u=null;break r}T[19]!==R||T[20]!==W||T[21]!==z.heightMap?(e=function(e,t,r){let a=(t,r)=>{let a=Math.max(0,Math.min(255,t)),n=Math.max(0,Math.min(255,r)),o=Math.floor(a),i=Math.floor(n),l=Math.min(o+1,255),s=Math.min(i+1,255),c=a-o,u=n-i;return((e[256*i+o]/65535*(1-c)+e[256*i+l]/65535*c)*(1-u)+(e[256*s+o]/65535*(1-c)+e[256*s+l]/65535*c)*u)*2048},n=new tM.Vector3(-t.x,-t.y,-t.z).normalize(),o=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let i=t/2+.25,l=e/2+.25,s=a(i,l),c=a(i-.5,l),u=a(i+.5,l),d=a(i,l-.5),m=-((a(i,l+.5)-d)/1),f=-((u-c)/1),h=Math.sqrt(m*m+r*r+f*f),p=Math.max(0,m/h*n.x+r/h*n.y+f/h*n.z),g=1;p>0&&(g=function(e,t,r,a,n,o){let i=a.z/n,l=a.x/n,s=a.y,c=Math.sqrt(i*i+l*l);if(c<1e-4)return 1;let u=.5/c,d=i*u,m=l*u,f=s*u,h=e,p=t,g=r+.1;for(let e=0;e<768&&(h+=d,p+=m,g+=f,!(h<0)&&!(h>=256)&&!(p<0)&&!(p>=256)&&!(g>2048));e++)if(gArray(K).fill(null),T[32]=K,T[33]=g):g=T[33];let[J,Z]=(0,a.useState)(g);T[34]===Symbol.for("react.memo_cache_sentinel")?(v={xStart:0,xEnd:0,zStart:0,zEnd:0},T[34]=v):v=T[34];let X=(0,a.useRef)(v);return(T[35]!==P.x||T[36]!==P.z||T[37]!==L||T[38]!==I.position.x||T[39]!==I.position.z||T[40]!==K||T[41]!==B?(x=()=>{let e=I.position.x-P.x,t=I.position.z-P.z,r=Math.floor((e-B)/L),a=Math.ceil((e+B)/L),n=Math.floor((t-B)/L),o=Math.ceil((t+B)/L),i=X.current;if(r===i.xStart&&a===i.xEnd&&n===i.zStart&&o===i.zEnd)return;i.xStart=r,i.xEnd=a,i.zStart=n,i.zEnd=o;let l=[];for(let e=r;e{let r=J[e];return(0,t.jsx)(tX,{tileX:r?.tileX??0,tileZ:r?.tileZ??0,blockSize:L,basePosition:P,textureNames:z.textureNames,geometry:G,displacementMap:O,visibilityMask:V,alphaTextures:q,detailTextureName:D,lightmap:H,visible:null!==r},e)}),T[53]=P,T[54]=L,T[55]=D,T[56]=Y,T[57]=q,T[58]=O,T[59]=G,T[60]=z.textureNames,T[61]=H,T[62]=J,T[63]=b):b=T[63],T[64]!==y||T[65]!==b?(_=(0,t.jsxs)(t.Fragment,{children:[y,b]}),T[64]=y,T[65]=b,T[66]=_):_=T[66],_):(t1.debug("Not ready: terrain=%s geometry=%s displacement=%s alpha=%s",!!z,!!G,!!O,!!q),null)});function t5(e){return e.camera}function t4(){return t0(null)}function t6(e){return(0,tH.setupMask)(e)}function t8(e,t){return t}var t7=e.i(8597),t9=e.i(78140);let re=` vec3 interiorLinearToSRGB(vec3 linear) { vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; vec3 lower = linear * 12.92; @@ -203,8 +203,8 @@ float debugGrid(vec2 uv, float gridSize, float lineWidth) { float line = min(grid.x, grid.y); return 1.0 - min(line / lineWidth, 1.0); } -`,re=(0,w.createLogger)("InteriorInstance");function rt({materialName:e,material:r,lightMap:n}){let o=(0,b.useDebug)(),i=o?.debugMode??!1,l=(0,tW.textureToUrl)(e),s=(0,tO.useTexture)(l,e=>(0,tH.setupTexture)(e)),c=new Set(r?.userData?.flag_names??[]).has("SelfIlluminating"),u=new Set(r?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),d=(0,a.useCallback)(e=>{let t;(0,tq.injectCustomFog)(e,tQ.globalFogUniforms),t=u??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new tM.Vector3(0,.4,1):new tM.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include -${t9} +`,rt=(0,w.createLogger)("InteriorInstance");function rr({materialName:e,material:r,lightMap:n}){let o=(0,b.useDebug)(),i=o?.debugMode??!1,l=(0,tq.useAnisotropy)(),s=(0,tW.textureToUrl)(e),c=(0,tO.useTexture)(s,e=>(0,tH.setupTexture)(e,{anisotropy:l})),u=new Set(r?.userData?.flag_names??[]).has("SelfIlluminating"),d=new Set(r?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),m=(0,a.useCallback)(e=>{let t;(0,tQ.injectCustomFog)(e,tK.globalFogUniforms),t=d??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new tM.Vector3(0,.4,1):new tM.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include +${re} uniform bool useSceneLighting; uniform vec3 interiorDebugColor; `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation @@ -259,7 +259,7 @@ outgoingLight = resultLinear + totalEmissiveRadiance; gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); #endif -#include `)},[u]),m=(0,a.useRef)(null),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=m.current??f.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let h={DEBUG_MODE:+!!i},p=`${u}`;return c?(0,t.jsx)("meshBasicMaterial",{ref:m,map:s,toneMapped:!1,defines:h,onBeforeCompile:d},p):(0,t.jsx)("meshLambertMaterial",{ref:f,map:s,lightMap:n,toneMapped:!1,defines:h,onBeforeCompile:d},p)}function rr(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=tM.SRGBColorSpace),t??null}function ra(e){let a,n,o,i=(0,r.c)(13),{node:l}=e;e:{let e,t;if(!l.material){let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],i[0]=e):e=i[0],a=e;break e}if(Array.isArray(l.material)){let e;i[1]!==l.material?(e=l.material.map(rn),i[1]=l.material,i[2]=e):e=i[2],a=e;break e}i[3]!==l.material?(e=rr(l.material),i[3]=l.material,i[4]=e):e=i[4],i[5]!==e?(t=[e],i[5]=e,i[6]=t):t=i[6],a=t}let s=a;return i[7]!==s||i[8]!==l.material?(n=l.material?(0,t.jsx)(tI.DebugSuspense,{name:`InteriorTexture:${Array.isArray(l.material)?l.material[0]?.userData?.resource_path:l.material?.userData?.resource_path??"?"}`,fallback:(0,t.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(l.material)?l.material.map((e,r)=>(0,t.jsx)(rt,{materialName:e.userData.resource_path,material:e,lightMap:s[r]},r)):(0,t.jsx)(rt,{materialName:l.material.userData.resource_path,material:l.material,lightMap:s[0]})}):null,i[7]=s,i[8]=l.material,i[9]=n):n=i[9],i[10]!==l.geometry||i[11]!==n?(o=(0,t.jsx)("mesh",{geometry:l.geometry,castShadow:!0,receiveShadow:!0,children:n}),i[10]=l.geometry,i[11]=n,i[12]=o):o=i[12],o}function rn(e){return rr(e)}let ro=(0,a.memo)(function(e){let a,n,o,i,l,s,c,u=(0,r.c)(10),{interiorFile:d,ghostIndex:m}=e,{nodes:f}=((s=(0,r.c)(2))[0]!==d?(l=(0,tW.interiorToUrl)(d),s[0]=d,s[1]=l):l=s[1],c=l,(0,t7.useGLTF)(c)),h=(0,b.useDebug)(),p=h?.debugMode??!1;return u[0]===Symbol.for("react.memo_cache_sentinel")?(a=[0,-Math.PI/2,0],u[0]=a):a=u[0],u[1]!==f?(n=Object.entries(f).filter(rc).map(ru),u[1]=f,u[2]=n):n=u[2],u[3]!==p||u[4]!==m||u[5]!==d?(o=p?(0,t.jsxs)(tP.FloatingLabel,{children:[m,": ",d]}):null,u[3]=p,u[4]=m,u[5]=d,u[6]=o):o=u[6],u[7]!==n||u[8]!==o?(i=(0,t.jsxs)("group",{rotation:a,children:[n,o]}),u[7]=n,u[8]=o,u[9]=i):i=u[9],i});function ri(e){let a,n,o,i,l=(0,r.c)(9),{color:s,label:c}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),l[0]=a):a=l[0],l[1]!==s?(n=(0,t.jsx)("meshStandardMaterial",{color:s,wireframe:!0}),l[1]=s,l[2]=n):n=l[2],l[3]!==s||l[4]!==c?(o=c?(0,t.jsx)(tP.FloatingLabel,{color:s,children:c}):null,l[3]=s,l[4]=c,l[5]=o):o=l[5],l[6]!==n||l[7]!==o?(i=(0,t.jsxs)("mesh",{children:[a,n,o]}),l[6]=n,l[7]=o,l[8]=i):i=l[8],i}function rl(e){let a,n=(0,r.c)(3),{label:o}=e,i=(0,b.useDebug)(),l=i?.debugMode??!1;return n[0]!==l||n[1]!==o?(a=l?(0,t.jsx)(ri,{color:"red",label:o}):null,n[0]=l,n[1]=o,n[2]=a):a=n[2],a}let rs=(0,a.memo)(function(e){let a,n,o,i,l,s,c,u,d,m,f=(0,r.c)(26),{scene:h}=e;f[0]!==h.transform.position?(a=(0,tU.torqueToThree)(h.transform.position),f[0]=h.transform.position,f[1]=a):a=f[1];let p=a;f[2]!==h.transform?(n=(0,tU.matrixFToQuaternion)(h.transform),f[2]=h.transform,f[3]=n):n=f[3];let g=n;f[4]!==h.scale?(o=(0,tU.torqueScaleToThree)(h.scale),f[4]=h.scale,f[5]=o):o=f[5];let v=o,x=`${h.ghostIndex}: ${h.interiorFile}`;f[6]!==x?(i=(0,t.jsx)(rl,{label:x}),f[6]=x,f[7]=i):i=f[7],f[8]!==h.interiorFile?(l=e=>{re.error("Failed to load %s: %s",h.interiorFile,e.message)},f[8]=h.interiorFile,f[9]=l):l=f[9];let y=`InteriorModel:${h.interiorFile}`;return f[10]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(ri,{color:"orange"}),f[10]=s):s=f[10],f[11]!==h.ghostIndex||f[12]!==h.interiorFile?(c=(0,t.jsx)(ro,{interiorFile:h.interiorFile,ghostIndex:h.ghostIndex}),f[11]=h.ghostIndex,f[12]=h.interiorFile,f[13]=c):c=f[13],f[14]!==y||f[15]!==c?(u=(0,t.jsx)(tI.DebugSuspense,{name:y,fallback:s,children:c}),f[14]=y,f[15]=c,f[16]=u):u=f[16],f[17]!==u||f[18]!==i||f[19]!==l?(d=(0,t.jsx)(t8.ErrorBoundary,{fallback:i,onError:l,children:u}),f[17]=u,f[18]=i,f[19]=l,f[20]=d):d=f[20],f[21]!==p||f[22]!==g||f[23]!==v||f[24]!==d?(m=(0,t.jsx)("group",{position:p,quaternion:g,scale:v,children:d}),f[21]=p,f[22]=g,f[23]=v,f[24]=d,f[25]=m):m=f[25],m});function rc(e){let[,t]=e;return t.isMesh}function ru(e){let[r,a]=e;return(0,t.jsx)(ra,{node:a},r)}var rd=e.i(99143);function rm(e,{path:t}){let[r]=(0,rd.useLoader)(tM.CubeTextureLoader,[e],e=>e.setPath(t));return r}rm.preload=(e,{path:t})=>rd.useLoader.preload(tM.CubeTextureLoader,[e],e=>e.setPath(t));let rf=()=>{};function rh(e){return e.wrapS=tM.RepeatWrapping,e.wrapT=tM.RepeatWrapping,e.minFilter=tM.LinearFilter,e.magFilter=tM.LinearFilter,e.colorSpace=tM.NoColorSpace,e.needsUpdate=!0,e}let rp=` +#include `)},[d]),f=(0,a.useRef)(null),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=f.current??h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let p={DEBUG_MODE:+!!i},g=`${d}`;return u?(0,t.jsx)("meshBasicMaterial",{ref:f,map:c,toneMapped:!1,defines:p,onBeforeCompile:m},g):(0,t.jsx)("meshLambertMaterial",{ref:h,map:c,lightMap:n,toneMapped:!1,defines:p,onBeforeCompile:m},g)}function ra(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=tM.SRGBColorSpace),t??null}function rn(e){let a,n,o,i=(0,r.c)(13),{node:l}=e;e:{let e,t;if(!l.material){let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],i[0]=e):e=i[0],a=e;break e}if(Array.isArray(l.material)){let e;i[1]!==l.material?(e=l.material.map(ro),i[1]=l.material,i[2]=e):e=i[2],a=e;break e}i[3]!==l.material?(e=ra(l.material),i[3]=l.material,i[4]=e):e=i[4],i[5]!==e?(t=[e],i[5]=e,i[6]=t):t=i[6],a=t}let s=a;return i[7]!==s||i[8]!==l.material?(n=l.material?(0,t.jsx)(tI.DebugSuspense,{name:`InteriorTexture:${Array.isArray(l.material)?l.material[0]?.userData?.resource_path:l.material?.userData?.resource_path??"?"}`,fallback:(0,t.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(l.material)?l.material.map((e,r)=>(0,t.jsx)(rr,{materialName:e.userData.resource_path,material:e,lightMap:s[r]},r)):(0,t.jsx)(rr,{materialName:l.material.userData.resource_path,material:l.material,lightMap:s[0]})}):null,i[7]=s,i[8]=l.material,i[9]=n):n=i[9],i[10]!==l.geometry||i[11]!==n?(o=(0,t.jsx)("mesh",{geometry:l.geometry,castShadow:!0,receiveShadow:!0,children:n}),i[10]=l.geometry,i[11]=n,i[12]=o):o=i[12],o}function ro(e){return ra(e)}let ri=(0,a.memo)(function(e){let a,n,o,i,l,s,c,u=(0,r.c)(10),{interiorFile:d,ghostIndex:m}=e,{nodes:f}=((s=(0,r.c)(2))[0]!==d?(l=(0,tW.interiorToUrl)(d),s[0]=d,s[1]=l):l=s[1],c=l,(0,t9.useGLTF)(c)),h=(0,b.useDebug)(),p=h?.debugMode??!1;return u[0]===Symbol.for("react.memo_cache_sentinel")?(a=[0,-Math.PI/2,0],u[0]=a):a=u[0],u[1]!==f?(n=Object.entries(f).filter(ru).map(rd),u[1]=f,u[2]=n):n=u[2],u[3]!==p||u[4]!==m||u[5]!==d?(o=p?(0,t.jsxs)(tP.FloatingLabel,{children:[m,": ",d]}):null,u[3]=p,u[4]=m,u[5]=d,u[6]=o):o=u[6],u[7]!==n||u[8]!==o?(i=(0,t.jsxs)("group",{rotation:a,children:[n,o]}),u[7]=n,u[8]=o,u[9]=i):i=u[9],i});function rl(e){let a,n,o,i,l=(0,r.c)(9),{color:s,label:c}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),l[0]=a):a=l[0],l[1]!==s?(n=(0,t.jsx)("meshStandardMaterial",{color:s,wireframe:!0}),l[1]=s,l[2]=n):n=l[2],l[3]!==s||l[4]!==c?(o=c?(0,t.jsx)(tP.FloatingLabel,{color:s,children:c}):null,l[3]=s,l[4]=c,l[5]=o):o=l[5],l[6]!==n||l[7]!==o?(i=(0,t.jsxs)("mesh",{children:[a,n,o]}),l[6]=n,l[7]=o,l[8]=i):i=l[8],i}function rs(e){let a,n=(0,r.c)(3),{label:o}=e,i=(0,b.useDebug)(),l=i?.debugMode??!1;return n[0]!==l||n[1]!==o?(a=l?(0,t.jsx)(rl,{color:"red",label:o}):null,n[0]=l,n[1]=o,n[2]=a):a=n[2],a}let rc=(0,a.memo)(function(e){let a,n,o,i,l,s,c,u,d,m,f=(0,r.c)(26),{scene:h}=e;f[0]!==h.transform.position?(a=(0,tU.torqueToThree)(h.transform.position),f[0]=h.transform.position,f[1]=a):a=f[1];let p=a;f[2]!==h.transform?(n=(0,tU.matrixFToQuaternion)(h.transform),f[2]=h.transform,f[3]=n):n=f[3];let g=n;f[4]!==h.scale?(o=(0,tU.torqueScaleToThree)(h.scale),f[4]=h.scale,f[5]=o):o=f[5];let v=o,x=`${h.ghostIndex}: ${h.interiorFile}`;f[6]!==x?(i=(0,t.jsx)(rs,{label:x}),f[6]=x,f[7]=i):i=f[7],f[8]!==h.interiorFile?(l=e=>{rt.error("Failed to load %s: %s",h.interiorFile,e.message)},f[8]=h.interiorFile,f[9]=l):l=f[9];let y=`InteriorModel:${h.interiorFile}`;return f[10]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(rl,{color:"orange"}),f[10]=s):s=f[10],f[11]!==h.ghostIndex||f[12]!==h.interiorFile?(c=(0,t.jsx)(ri,{interiorFile:h.interiorFile,ghostIndex:h.ghostIndex}),f[11]=h.ghostIndex,f[12]=h.interiorFile,f[13]=c):c=f[13],f[14]!==y||f[15]!==c?(u=(0,t.jsx)(tI.DebugSuspense,{name:y,fallback:s,children:c}),f[14]=y,f[15]=c,f[16]=u):u=f[16],f[17]!==u||f[18]!==i||f[19]!==l?(d=(0,t.jsx)(t7.ErrorBoundary,{fallback:i,onError:l,children:u}),f[17]=u,f[18]=i,f[19]=l,f[20]=d):d=f[20],f[21]!==p||f[22]!==g||f[23]!==v||f[24]!==d?(m=(0,t.jsx)("group",{position:p,quaternion:g,scale:v,children:d}),f[21]=p,f[22]=g,f[23]=v,f[24]=d,f[25]=m):m=f[25],m});function ru(e){let[,t]=e;return t.isMesh}function rd(e){let[r,a]=e;return(0,t.jsx)(rn,{node:a},r)}var rm=e.i(99143);function rf(e,{path:t}){let[r]=(0,rm.useLoader)(tM.CubeTextureLoader,[e],e=>e.setPath(t));return r}rf.preload=(e,{path:t})=>rm.useLoader.preload(tM.CubeTextureLoader,[e],e=>e.setPath(t));let rh=()=>{};function rp(e){return e.wrapS=tM.RepeatWrapping,e.wrapT=tM.RepeatWrapping,e.minFilter=tM.LinearFilter,e.magFilter=tM.LinearFilter,e.colorSpace=tM.NoColorSpace,e.needsUpdate=!0,e}let rg=` attribute float alpha; uniform vec2 uvOffset; @@ -276,7 +276,7 @@ outgoingLight = resultLinear + totalEmissiveRadiance; // Set depth to far plane so clouds are always visible and behind other geometry gl_Position = pos.xyww; } -`,rg=` +`,rv=` uniform sampler2D cloudTexture; uniform float debugMode; uniform int layerIndex; @@ -319,7 +319,7 @@ outgoingLight = resultLinear + totalEmissiveRadiance; // Output clouds with texture color and combined alpha gl_FragColor = vec4(color, finalAlpha); } -`;function rv({textureUrl:e,radius:r,heightPercent:n,speed:o,windDirection:i,layerIndex:l}){let{debugMode:s}=(0,b.useDebug)(),{animationEnabled:c}=(0,b.useSettings)(),u=(0,a.useRef)(null),d=(0,tO.useTexture)(e,rh),m=(0,a.useMemo)(()=>{let e=n-.05;return function(e,t,r,a){var n;let o,i,l,s,c,u,d,m,f,h,p,g,v,x,y,b,_,S=new tM.BufferGeometry,j=new Float32Array(75),C=new Float32Array(50),w=[.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],M=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let a=5*t+r,n=-e+r*M,o=e-t*M,i=e*w[a];j[3*a]=n,j[3*a+1]=i,j[3*a+2]=o,C[2*a]=r,C[2*a+1]=t}n=j,o=e=>({x:n[3*e],y:n[3*e+1],z:n[3*e+2]}),i=(e,t,r,a)=>{n[3*e]=t,n[3*e+1]=r,n[3*e+2]=a},l=o(1),s=o(3),c=o(5),u=o(6),d=o(8),m=o(9),f=o(15),h=o(16),p=o(18),g=o(19),v=o(21),x=o(23),y=c.x+(l.x-c.x)*.5,b=c.y+(l.y-c.y)*.5,_=c.z+(l.z-c.z)*.5,i(0,u.x+(y-u.x)*2,u.y+(b-u.y)*2,u.z+(_-u.z)*2),y=m.x+(s.x-m.x)*.5,b=m.y+(s.y-m.y)*.5,_=m.z+(s.z-m.z)*.5,i(4,d.x+(y-d.x)*2,d.y+(b-d.y)*2,d.z+(_-d.z)*2),y=v.x+(f.x-v.x)*.5,b=v.y+(f.y-v.y)*.5,_=v.z+(f.z-v.z)*.5,i(20,h.x+(y-h.x)*2,h.y+(b-h.y)*2,h.z+(_-h.z)*2),y=x.x+(g.x-x.x)*.5,b=x.y+(g.y-x.y)*.5,_=x.z+(g.z-x.z)*.5,i(24,p.x+(y-p.x)*2,p.y+(b-p.y)*2,p.z+(_-p.z)*2);let N=function(e,t){let r=new Float32Array(25);for(let a=0;a<25;a++){let n=e[3*a],o=e[3*a+2],i=1.3-Math.sqrt(n*n+o*o)/t;i<.4?i=0:i>.8&&(i=1),r[a]=i}return r}(j,e),T=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,a=r+1,n=r+5,o=n+1;T.push(r,n,o),T.push(r,o,a)}return S.setIndex(T),S.setAttribute("position",new tM.Float32BufferAttribute(j,3)),S.setAttribute("uv",new tM.Float32BufferAttribute(C,2)),S.setAttribute("alpha",new tM.Float32BufferAttribute(N,1)),S.computeBoundingSphere(),S}(r,n,e,0)},[r,n]);(0,a.useEffect)(()=>()=>{m.dispose()},[m]);let f=(0,a.useMemo)(()=>new tM.ShaderMaterial({uniforms:{cloudTexture:{value:d},uvOffset:{value:new tM.Vector2(0,0)},debugMode:{value:+!!s},layerIndex:{value:l}},vertexShader:rp,fragmentShader:rg,transparent:!0,depthWrite:!1,side:tM.DoubleSide}),[d,s,l]);return(0,a.useEffect)(()=>()=>{f.dispose()},[f]),(0,tw.useFrame)(c?(e,t)=>{let r=1e3*t/32;u.current??=new tM.Vector2(0,0),u.current.x+=i.x*o*r,u.current.y+=i.y*o*r,u.current.x-=Math.floor(u.current.x),u.current.y-=Math.floor(u.current.y),f.uniforms.uvOffset.value.copy(u.current)}:rf),(0,t.jsx)("mesh",{geometry:m,frustumCulled:!1,renderOrder:10,children:(0,t.jsx)("primitive",{object:f,attach:"material"})})}function rx(e){var n;let o,i,l,s,c,u,d,m,f,h,p,g=(0,r.c)(18),{scene:v}=e,{data:x}=(n=v.materialList||void 0,(h=(0,r.c)(7))[0]!==n?(d=["detailMapList",n],m=()=>(0,tW.loadDetailMapList)(n),h[0]=n,h[1]=d,h[2]=m):(d=h[1],m=h[2]),p=!!n,h[3]!==d||h[4]!==m||h[5]!==p?(f={queryKey:d,queryFn:m,enabled:p},h[3]=d,h[4]=m,h[5]=p,h[6]=f):f=h[6],(0,tG.useQuery)(f)),y=.95*(v.visibleDistance>0?v.visibleDistance:500);g[0]!==v.cloudLayers?(o=v.cloudLayers.map(rb),g[0]=v.cloudLayers,g[1]=o):o=g[1];let b=o;g[2]!==v.cloudLayers?(i=v.cloudLayers.map(ry),g[2]=v.cloudLayers,g[3]=i):i=g[3];let _=i;e:{let e,{x:t,y:r}=v.windVelocity;if(0!==t||0!==r){let e;g[4]!==t||g[5]!==r?(e=new tM.Vector2(r,-t).normalize(),g[4]=t,g[5]=r,g[6]=e):e=g[6],l=e;break e}g[7]===Symbol.for("react.memo_cache_sentinel")?(e=new tM.Vector2(1,0),g[7]=e):e=g[7],l=e}let S=l;t:{let e;if(!x){let e;g[8]===Symbol.for("react.memo_cache_sentinel")?(e=[],g[8]=e):e=g[8],s=e;break t}if(g[9]!==_||g[10]!==b||g[11]!==x){e=[];for(let t=0;t<3;t++){let r=x[7+t];r&&e.push({texture:r,height:_[t],speed:b[t]})}g[9]=_,g[10]=b,g[11]=x,g[12]=e}else e=g[12];s=e}let j=s,C=(0,a.useRef)(null);return(g[13]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{let{camera:t}=e;C.current&&C.current.position.copy(t.position)},g[13]=c):c=g[13],(0,tw.useFrame)(c),j&&0!==j.length)?(g[14]!==j||g[15]!==y||g[16]!==S?(u=(0,t.jsx)("group",{ref:C,children:j.map((e,r)=>{let n=(0,tW.textureToUrl)(e.texture);return(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rv,{textureUrl:n,radius:y,heightPercent:e.height,speed:e.speed,windDirection:S,layerIndex:r})},r)})}),g[14]=j,g[15]=y,g[16]=S,g[17]=u):u=g[17],u):null}function ry(e,t){return e.heightPercent||[.35,.25,.2][t]}function rb(e,t){return e.speed||[1e-4,2e-4,3e-4][t]}e.i(62395);let r_=(0,w.createLogger)("Sky"),rS=!1;function rj(e){return[new tM.Color().setRGB(e.r,e.g,e.b),new tM.Color().setRGB(e.r,e.g,e.b).convertSRGBToLinear()]}function rC({skyBoxFiles:e,fogColor:r,fogState:n}){let o=(0,tC.useThree)(e=>e.camera),i=rm(e,{path:""}),l=!!r,s=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),c=(0,a.useMemo)(()=>n?(0,tQ.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),u=(0,a.useRef)({skybox:{value:i},fogColor:{value:r??new tM.Color(0,0,0)},enableFog:{value:l},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:tQ.globalFogUniforms.cameraHeight,fogVolumeData:{value:c},horizonFogHeight:{value:.18}}),d=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]);return(0,a.useEffect)(()=>{u.current.skybox.value=i,u.current.fogColor.value=r??new tM.Color(0,0,0),u.current.enableFog.value=l,u.current.fogVolumeData.value=c,u.current.horizonFogHeight.value=d},[i,r,l,c,d]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` +`;function rx({textureUrl:e,radius:r,heightPercent:n,speed:o,windDirection:i,layerIndex:l}){let{debugMode:s}=(0,b.useDebug)(),{animationEnabled:c}=(0,b.useSettings)(),u=(0,a.useRef)(null),d=(0,tO.useTexture)(e,rp),m=(0,a.useMemo)(()=>{let e=n-.05;return function(e,t,r,a){var n;let o,i,l,s,c,u,d,m,f,h,p,g,v,x,y,b,_,S=new tM.BufferGeometry,j=new Float32Array(75),C=new Float32Array(50),w=[.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],M=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let a=5*t+r,n=-e+r*M,o=e-t*M,i=e*w[a];j[3*a]=n,j[3*a+1]=i,j[3*a+2]=o,C[2*a]=r,C[2*a+1]=t}n=j,o=e=>({x:n[3*e],y:n[3*e+1],z:n[3*e+2]}),i=(e,t,r,a)=>{n[3*e]=t,n[3*e+1]=r,n[3*e+2]=a},l=o(1),s=o(3),c=o(5),u=o(6),d=o(8),m=o(9),f=o(15),h=o(16),p=o(18),g=o(19),v=o(21),x=o(23),y=c.x+(l.x-c.x)*.5,b=c.y+(l.y-c.y)*.5,_=c.z+(l.z-c.z)*.5,i(0,u.x+(y-u.x)*2,u.y+(b-u.y)*2,u.z+(_-u.z)*2),y=m.x+(s.x-m.x)*.5,b=m.y+(s.y-m.y)*.5,_=m.z+(s.z-m.z)*.5,i(4,d.x+(y-d.x)*2,d.y+(b-d.y)*2,d.z+(_-d.z)*2),y=v.x+(f.x-v.x)*.5,b=v.y+(f.y-v.y)*.5,_=v.z+(f.z-v.z)*.5,i(20,h.x+(y-h.x)*2,h.y+(b-h.y)*2,h.z+(_-h.z)*2),y=x.x+(g.x-x.x)*.5,b=x.y+(g.y-x.y)*.5,_=x.z+(g.z-x.z)*.5,i(24,p.x+(y-p.x)*2,p.y+(b-p.y)*2,p.z+(_-p.z)*2);let N=function(e,t){let r=new Float32Array(25);for(let a=0;a<25;a++){let n=e[3*a],o=e[3*a+2],i=1.3-Math.sqrt(n*n+o*o)/t;i<.4?i=0:i>.8&&(i=1),r[a]=i}return r}(j,e),T=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,a=r+1,n=r+5,o=n+1;T.push(r,n,o),T.push(r,o,a)}return S.setIndex(T),S.setAttribute("position",new tM.Float32BufferAttribute(j,3)),S.setAttribute("uv",new tM.Float32BufferAttribute(C,2)),S.setAttribute("alpha",new tM.Float32BufferAttribute(N,1)),S.computeBoundingSphere(),S}(r,n,e,0)},[r,n]);(0,a.useEffect)(()=>()=>{m.dispose()},[m]);let f=(0,a.useMemo)(()=>new tM.ShaderMaterial({uniforms:{cloudTexture:{value:d},uvOffset:{value:new tM.Vector2(0,0)},debugMode:{value:+!!s},layerIndex:{value:l}},vertexShader:rg,fragmentShader:rv,transparent:!0,depthWrite:!1,side:tM.DoubleSide}),[d,s,l]);return(0,a.useEffect)(()=>()=>{f.dispose()},[f]),(0,tw.useFrame)(c?(e,t)=>{let r=1e3*t/32;u.current??=new tM.Vector2(0,0),u.current.x+=i.x*o*r,u.current.y+=i.y*o*r,u.current.x-=Math.floor(u.current.x),u.current.y-=Math.floor(u.current.y),f.uniforms.uvOffset.value.copy(u.current)}:rh),(0,t.jsx)("mesh",{geometry:m,frustumCulled:!1,renderOrder:10,children:(0,t.jsx)("primitive",{object:f,attach:"material"})})}function ry(e){var n;let o,i,l,s,c,u,d,m,f,h,p,g=(0,r.c)(18),{scene:v}=e,{data:x}=(n=v.materialList||void 0,(h=(0,r.c)(7))[0]!==n?(d=["detailMapList",n],m=()=>(0,tW.loadDetailMapList)(n),h[0]=n,h[1]=d,h[2]=m):(d=h[1],m=h[2]),p=!!n,h[3]!==d||h[4]!==m||h[5]!==p?(f={queryKey:d,queryFn:m,enabled:p},h[3]=d,h[4]=m,h[5]=p,h[6]=f):f=h[6],(0,tG.useQuery)(f)),y=.95*(v.visibleDistance>0?v.visibleDistance:500);g[0]!==v.cloudLayers?(o=v.cloudLayers.map(r_),g[0]=v.cloudLayers,g[1]=o):o=g[1];let b=o;g[2]!==v.cloudLayers?(i=v.cloudLayers.map(rb),g[2]=v.cloudLayers,g[3]=i):i=g[3];let _=i;e:{let e,{x:t,y:r}=v.windVelocity;if(0!==t||0!==r){let e;g[4]!==t||g[5]!==r?(e=new tM.Vector2(r,-t).normalize(),g[4]=t,g[5]=r,g[6]=e):e=g[6],l=e;break e}g[7]===Symbol.for("react.memo_cache_sentinel")?(e=new tM.Vector2(1,0),g[7]=e):e=g[7],l=e}let S=l;t:{let e;if(!x){let e;g[8]===Symbol.for("react.memo_cache_sentinel")?(e=[],g[8]=e):e=g[8],s=e;break t}if(g[9]!==_||g[10]!==b||g[11]!==x){e=[];for(let t=0;t<3;t++){let r=x[7+t];r&&e.push({texture:r,height:_[t],speed:b[t]})}g[9]=_,g[10]=b,g[11]=x,g[12]=e}else e=g[12];s=e}let j=s,C=(0,a.useRef)(null);return(g[13]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{let{camera:t}=e;C.current&&C.current.position.copy(t.position)},g[13]=c):c=g[13],(0,tw.useFrame)(c),j&&0!==j.length)?(g[14]!==j||g[15]!==y||g[16]!==S?(u=(0,t.jsx)("group",{ref:C,children:j.map((e,r)=>{let n=(0,tW.textureToUrl)(e.texture);return(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rx,{textureUrl:n,radius:y,heightPercent:e.height,speed:e.speed,windDirection:S,layerIndex:r})},r)})}),g[14]=j,g[15]=y,g[16]=S,g[17]=u):u=g[17],u):null}function rb(e,t){return e.heightPercent||[.35,.25,.2][t]}function r_(e,t){return e.speed||[1e-4,2e-4,3e-4][t]}e.i(62395);let rS=(0,w.createLogger)("Sky"),rj=!1;function rC(e){return[new tM.Color().setRGB(e.r,e.g,e.b),new tM.Color().setRGB(e.r,e.g,e.b).convertSRGBToLinear()]}function rw({skyBoxFiles:e,fogColor:r,fogState:n}){let o=(0,tC.useThree)(e=>e.camera),i=rf(e,{path:""}),l=!!r,s=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),c=(0,a.useMemo)(()=>n?(0,tK.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),u=(0,a.useRef)({skybox:{value:i},fogColor:{value:r??new tM.Color(0,0,0)},enableFog:{value:l},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:tK.globalFogUniforms.cameraHeight,fogVolumeData:{value:c},horizonFogHeight:{value:.18}}),d=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]);return(0,a.useEffect)(()=>{u.current.skybox.value=i,u.current.fogColor.value=r??new tM.Color(0,0,0),u.current.enableFog.value=l,u.current.fogVolumeData.value=c,u.current.horizonFogHeight.value=d},[i,r,l,c,d]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` varying vec2 vUv; void main() { @@ -438,7 +438,7 @@ outgoingLight = resultLinear + totalEmissiveRadiance; // Convert linear result to sRGB for display gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); } - `,depthWrite:!1,depthTest:!1})]})}function rw(e){let n,o,i,l,s,c,u,d=(0,r.c)(6),{materialList:m,fogColor:f,fogState:h}=e,{data:p}=((c=(0,r.c)(8))[0]!==m?(i={queryKey:["detailMapList",m],queryFn:()=>(r_.debug("Loading detail map list: %s",m),(0,tW.loadDetailMapList)(m))},c[0]=m,c[1]=i):i=c[1],u=(0,tG.useQuery)(i),c[2]!==m||c[3]!==u.data||c[4]!==u.error||c[5]!==u.status?(l=()=>{r_.debug("DML query status: %s%s%s file=%s",u.status,u.error?` error=${u.error.message}`:"",u.data?` (${u.data.length} entries)`:" (no data)",m)},s=[u.status,u.error,u.data,m],c[2]=m,c[3]=u.data,c[4]=u.error,c[5]=u.status,c[6]=l,c[7]=s):(l=c[6],s=c[7]),(0,a.useEffect)(l,s),u);d[0]!==p?(n=p?[(0,tW.textureToUrl)(p[1]),(0,tW.textureToUrl)(p[3]),(0,tW.textureToUrl)(p[4]),(0,tW.textureToUrl)(p[5]),(0,tW.textureToUrl)(p[0]),(0,tW.textureToUrl)(p[2])]:null,d[0]=p,d[1]=n):n=d[1];let g=n;return g?(d[2]!==f||d[3]!==h||d[4]!==g?(o=(0,t.jsx)(rC,{skyBoxFiles:g,fogColor:f,fogState:h}),d[2]=f,d[3]=h,d[4]=g,d[5]=o):o=d[5],o):null}function rM({skyColor:e,fogColor:r,fogState:n}){let o=(0,tC.useThree)(e=>e.camera),i=!!r,l=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),s=(0,a.useMemo)(()=>n?(0,tQ.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),c=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]),u=(0,a.useRef)({skyColor:{value:e},fogColor:{value:r??new tM.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:l},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:tQ.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:c}});return(0,a.useEffect)(()=>{u.current.skyColor.value=e,u.current.fogColor.value=r??new tM.Color(0,0,0),u.current.enableFog.value=i,u.current.fogVolumeData.value=s,u.current.horizonFogHeight.value=c},[e,r,i,s,c]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` + `,depthWrite:!1,depthTest:!1})]})}function rM(e){let n,o,i,l,s,c,u,d=(0,r.c)(6),{materialList:m,fogColor:f,fogState:h}=e,{data:p}=((c=(0,r.c)(8))[0]!==m?(i={queryKey:["detailMapList",m],queryFn:()=>(rS.debug("Loading detail map list: %s",m),(0,tW.loadDetailMapList)(m))},c[0]=m,c[1]=i):i=c[1],u=(0,tG.useQuery)(i),c[2]!==m||c[3]!==u.data||c[4]!==u.error||c[5]!==u.status?(l=()=>{rS.debug("DML query status: %s%s%s file=%s",u.status,u.error?` error=${u.error.message}`:"",u.data?` (${u.data.length} entries)`:" (no data)",m)},s=[u.status,u.error,u.data,m],c[2]=m,c[3]=u.data,c[4]=u.error,c[5]=u.status,c[6]=l,c[7]=s):(l=c[6],s=c[7]),(0,a.useEffect)(l,s),u);d[0]!==p?(n=p?[(0,tW.textureToUrl)(p[1]),(0,tW.textureToUrl)(p[3]),(0,tW.textureToUrl)(p[4]),(0,tW.textureToUrl)(p[5]),(0,tW.textureToUrl)(p[0]),(0,tW.textureToUrl)(p[2])]:null,d[0]=p,d[1]=n):n=d[1];let g=n;return g?(d[2]!==f||d[3]!==h||d[4]!==g?(o=(0,t.jsx)(rw,{skyBoxFiles:g,fogColor:f,fogState:h}),d[2]=f,d[3]=h,d[4]=g,d[5]=o):o=d[5],o):null}function rN({skyColor:e,fogColor:r,fogState:n}){let o=(0,tC.useThree)(e=>e.camera),i=!!r,l=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),s=(0,a.useMemo)(()=>n?(0,tK.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),c=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]),u=(0,a.useRef)({skyColor:{value:e},fogColor:{value:r??new tM.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:l},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:tK.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:c}});return(0,a.useEffect)(()=>{u.current.skyColor.value=e,u.current.fogColor.value=r??new tM.Color(0,0,0),u.current.enableFog.value=i,u.current.fogVolumeData.value=s,u.current.horizonFogHeight.value=c},[e,r,i,s,c]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` varying vec2 vUv; void main() { @@ -518,4 +518,4 @@ outgoingLight = resultLinear + totalEmissiveRadiance; gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); } - `,depthWrite:!1,depthTest:!1})]})}function rN(e,t){let{fogDistance:r,visibleDistance:a}=e;return[r,a]}function rT({fogState:e,enabled:t}){let r=(0,tC.useThree)(e=>e.scene),n=(0,tC.useThree)(e=>e.camera),o=(0,a.useRef)(null),i=(0,a.useMemo)(()=>(0,tQ.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,a.useEffect)(()=>{rS||((0,tq.installCustomFogShader)(),rS=!0)},[]),(0,a.useEffect)(()=>{(0,tQ.resetGlobalFogUniforms)();let[t,a]=rN(e,n.position.y),l=new tM.Fog(e.fogColor,t,a);return r.fog=l,o.current=l,(0,tQ.updateGlobalFogUniforms)(n.position.y,i),()=>{r.fog=null,o.current=null,(0,tQ.resetGlobalFogUniforms)()}},[r,n,e,i]),(0,a.useEffect)(()=>{let r=o.current;if(r)if(t){let[t,a]=rN(e,n.position.y);r.near=t,r.far=a}else r.near=1e10,r.far=1e10},[t,e,n.position.y]),(0,tw.useFrame)(()=>{let r=o.current;if(!r)return;let a=n.position.y;if((0,tQ.updateGlobalFogUniforms)(a,i,t),t){let[t,n]=rN(e,a);r.near=t,r.far=n,r.color.copy(e.fogColor)}}),null}let rk=(0,a.memo)(function({entity:e}){let{skyData:r}=e;r_.debug("Rendering: materialList=%s, useSkyTextures=%s",r.materialList,r.useSkyTextures);let{fogEnabled:n}=(0,b.useSettings)(),o=r.materialList||void 0,i=(0,a.useMemo)(()=>rj(r.skySolidColor),[r.skySolidColor]),l=r.useSkyTextures,s=(0,a.useMemo)(()=>(function(e){let t=e.fogDistance,r=e.visibleDistance>0?e.visibleDistance:1e3,{r:a,g:n,b:o}=e.fogColor,i=new tM.Color().setRGB(a,n,o).convertSRGBToLinear(),l=[];for(let t of e.fogVolumes)t.visibleDistance<=0||t.maxHeight<=t.minHeight||l.push({visibleDistance:t.visibleDistance,minHeight:t.minHeight,maxHeight:t.maxHeight,percentage:1});let s=l.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:t,visibleDistance:r,fogColor:i,fogVolumes:l,fogLine:s,enabled:r>t}})(r),[r]);r_.debug("fogState: fogColor=(%s, %s, %s) visibleDistance=%d fogDistance=%d enabled=%s volumes=%d",r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,s.enabled,s.fogVolumes.length);let c=(0,a.useMemo)(()=>rj(r.fogColor),[r.fogColor]),u=i||c,d=s.enabled&&n,m=s.fogColor,f=(0,tC.useThree)(e=>e.scene),h=(0,tC.useThree)(e=>e.gl);(0,a.useEffect)(()=>{if(d){let e=m.clone();f.background=e,h.setClearColor(e)}else if(u){let e=u[0].clone();f.background=e,h.setClearColor(e)}else f.background=null;return()=>{f.background=null}},[f,h,d,m,u]);let p=i?.[1];return(0,t.jsxs)(t.Fragment,{children:[o&&l&&o.length>0?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rw,{materialList:o,fogColor:d?m:void 0,fogState:d?s:void 0},o)}):p?(0,t.jsx)(rM,{skyColor:p,fogColor:d?m:void 0,fogState:d?s:void 0}):null,(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rx,{scene:r})}),s.enabled?(0,t.jsx)(rT,{fogState:s,enabled:n}):null]})});function rF(e){let n,o=(0,r.c)(3),{children:i}=e,{audioEnabled:l}=(0,b.useSettings)();return o[0]!==l||o[1]!==i?(n=l?(0,t.jsx)(a.Suspense,{children:i}):null,o[0]=l,o[1]=i,o[2]=n):n=o[2],n}function rR(e,n){let o=(0,a.lazy)(()=>n().then(t=>({default:t[e]}))),i=a=>{let n,i,l=(0,r.c)(5),{entity:s}=a,c=`${e}:${s.id}`;return l[0]!==s?(n=(0,t.jsx)(o,{entity:s}),l[0]=s,l[1]=n):n=l[1],l[2]!==c||l[3]!==n?(i=(0,t.jsx)(tI.DebugSuspense,{name:c,children:n}),l[2]=c,l[3]=n,l[4]=i):i=l[4],i};return i.displayName=`createLazy(${e})`,i}let rD=rR("PlayerModel",()=>e.A(30814)),rL=rR("ExplosionShape",()=>e.A(44325)),rB=rR("TracerProjectile",()=>e.A(62125)),rI=rR("SpriteProjectile",()=>e.A(62125)),rA=rR("ForceFieldBare",()=>e.A(25147)),rP=rR("AudioEmitter",()=>e.A(61921)),rE=rR("WaterBlock",()=>e.A(18599)),rz=rR("WeaponModel",()=>e.A(44325)),rG={1:"Storm",2:"Inferno"},rU=(0,a.memo)(function(e){let a=(0,r.c)(26),{entity:n}=e;switch(n.renderType){case"Shape":{let e;return a[0]!==n?(e=(0,t.jsx)(rW,{entity:n}),a[0]=n,a[1]=e):e=a[1],e}case"ForceFieldBare":{let e;return a[2]!==n?(e=(0,t.jsx)(rA,{entity:n}),a[2]=n,a[3]=e):e=a[3],e}case"Player":{let e;return a[4]!==n?(e=(0,t.jsx)(rD,{entity:n}),a[4]=n,a[5]=e):e=a[5],e}case"Explosion":{let e;return a[6]!==n?(e=(0,t.jsx)(rL,{entity:n}),a[6]=n,a[7]=e):e=a[7],e}case"Tracer":{let e;return a[8]!==n?(e=(0,t.jsx)(rB,{entity:n}),a[8]=n,a[9]=e):e=a[9],e}case"Sprite":{let e;return a[10]!==n?(e=(0,t.jsx)(rI,{entity:n}),a[10]=n,a[11]=e):e=a[11],e}case"AudioEmitter":{let e;return a[12]!==n?(e=(0,t.jsx)(rF,{children:(0,t.jsx)(rP,{entity:n})}),a[12]=n,a[13]=e):e=a[13],e}case"Camera":{let e;return a[14]!==n?(e=(0,t.jsx)(tE,{entity:n}),a[14]=n,a[15]=e):e=a[15],e}case"WayPoint":{let e;return a[16]!==n?(e=(0,t.jsx)(tz,{entity:n}),a[16]=n,a[17]=e):e=a[17],e}case"TerrainBlock":{let e;return a[18]!==n.terrainData?(e=(0,t.jsx)(t2,{scene:n.terrainData}),a[18]=n.terrainData,a[19]=e):e=a[19],e}case"InteriorInstance":{let e;return a[20]!==n.interiorData?(e=(0,t.jsx)(rs,{scene:n.interiorData}),a[20]=n.interiorData,a[21]=e):e=a[21],e}case"Sky":{let e;return a[22]!==n?(e=(0,t.jsx)(rk,{entity:n}),a[22]=n,a[23]=e):e=a[23],e}case"Sun":case"MissionArea":case"None":default:return null;case"WaterBlock":{let e;return a[24]!==n?(e=(0,t.jsx)(rE,{entity:n}),a[24]=n,a[25]=e):e=a[25],e}}});function rW(e){let n,o,i,l,s,c,u,d=(0,r.c)(24),{entity:m}=e,{animationEnabled:f}=(0,b.useSettings)(),h=(0,a.useRef)(null);if(d[0]!==f||d[1]!==m.rotate?(n=()=>{if(!h.current||!m.rotate||!f)return;let e=performance.now()/1e3;h.current.rotation.y=e/3*Math.PI*2},d[0]=f,d[1]=m.rotate,d[2]=n):n=d[2],(0,tw.useFrame)(n),!m.shapeName)throw Error(`Shape entity missing shapeName: ${m.id}`);let p=m.runtimeObject,g=m.shapeType??"StaticShape",v=m.dataBlock?.toLowerCase()==="flag",x=m.teamId&&m.teamId>0?rG[m.teamId]:null,y=v&&x?`${x} Flag`:null,_="Item"===m.shapeType?"pink":m.threads?"#00ff88":"yellow",S=m.rotate?h:void 0,j=p?void 0:m;return d[3]!==y?(o=y?(0,t.jsx)(tP.FloatingLabel,{opacity:.6,children:y}):null,d[3]=y,d[4]=o):o=d[4],d[5]!==_||d[6]!==j||d[7]!==o?(i=(0,t.jsx)(tL.ShapeRenderer,{loadingColor:_,streamEntity:j,children:o}),d[5]=_,d[6]=j,d[7]=o,d[8]=i):i=d[8],d[9]!==m.barrelShapeName||d[10]!==p?(l=m.barrelShapeName&&(0,t.jsx)(tB.ShapeInfoProvider,{object:p,shapeName:m.barrelShapeName,type:"Turret",children:(0,t.jsx)("group",{position:[0,1.5,0],children:(0,t.jsx)(tL.ShapeRenderer,{})})}),d[9]=m.barrelShapeName,d[10]=p,d[11]=l):l=d[11],d[12]!==m?(s=m.weaponShape&&(0,t.jsx)(tA.ShapeErrorBoundary,{fallback:(0,t.jsx)(tL.ShapePlaceholder,{color:"red",label:m.weaponShape}),children:(0,t.jsx)(tI.DebugSuspense,{name:`Weapon:${m.id}/${m.weaponShape}`,fallback:(0,t.jsx)(tL.ShapePlaceholder,{color:"cyan",label:m.weaponShape}),children:(0,t.jsx)(rz,{entity:m})})}),d[12]=m,d[13]=s):s=d[13],d[14]!==S||d[15]!==i||d[16]!==l||d[17]!==s?(c=(0,t.jsxs)("group",{ref:S,children:[i,l,s]}),d[14]=S,d[15]=i,d[16]=l,d[17]=s,d[18]=c):c=d[18],d[19]!==m.shapeName||d[20]!==g||d[21]!==c||d[22]!==p?(u=(0,t.jsx)(tB.ShapeInfoProvider,{object:p,shapeName:m.shapeName,type:g,children:c}),d[19]=m.shapeName,d[20]=g,d[21]=c,d[22]=p,d[23]=u):u=d[23],u}var rH=e.i(60099),rO=e.i(85557),r$=e.i(29418);let rV=(0,tW.textureToUrl)("gui/hud_alliedtriangle"),rq=(0,tW.textureToUrl)("gui/hud_enemytriangle"),rQ=new tM.Vector3;function rK(e){let n,o,i,l,s,c,u=(0,r.c)(23),{entity:d}=e,m=(0,tL.useStaticShape)(d.shapeName??d.dataBlock),f=(0,tC.useThree)(rJ),h=(0,a.useRef)(null),p=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),[y,b]=(0,a.useState)(!0),_=(0,a.useRef)(null);u[0]!==m.scene?(n=new tM.Box3().setFromObject(m.scene),u[0]=m.scene,u[1]=n):n=u[1];let S=n.max.y+.1;u[2]!==d.keyframes?(o=d.keyframes??[],u[2]=d.keyframes,u[3]=o):o=u[3];let j=o;u[4]!==j?(i=j.some(rY),u[4]=j,u[5]=i):i=u[5];let C=i;u[6]!==f||u[7]!==d.id||u[8]!==d.iffColor||u[9]!==d.playerName||u[10]!==C||u[11]!==y||u[12]!==j?(l=()=>{let e=h.current;if(!e)return;e.getWorldPosition(rQ);let t=f.position.distanceTo(rQ),r=f.matrixWorld.elements,a=!(-((rQ.x-r[12])*r[8])+-((rQ.y-r[13])*r[9])+-((rQ.z-r[14])*r[10])<0)&&t<150;if(y!==a&&b(a),!a)return;let n=(0,rO.getKeyframeAtTime)(j,tD.streamPlaybackStore.getState().time),o=n?.health??1;if(n?.damageState!=null&&n.damageState>=1){p.current&&(p.current.style.opacity="0"),g.current&&(g.current.style.opacity="0");return}let i=Math.max(0,Math.min(1,1-t/150)).toString();if(p.current&&(p.current.style.opacity=i),g.current&&(g.current.style.opacity=i),_.current){let e=d.playerName??d.id;_.current.textContent!==e&&(_.current.textContent=e)}if(x.current&&d.iffColor){let e=d.iffColor.r>d.iffColor.g?rq:rV;x.current.getAttribute("src")!==e&&(x.current.src=e)}v.current&&C&&(v.current.style.width=`${Math.max(0,Math.min(100,100*o))}%`,v.current.style.background=d.iffColor?`rgb(${d.iffColor.r}, ${d.iffColor.g}, ${d.iffColor.b})`:"")},u[6]=f,u[7]=d.id,u[8]=d.iffColor,u[9]=d.playerName,u[10]=C,u[11]=y,u[12]=j,u[13]=l):l=u[13],(0,tw.useFrame)(l);let w=d.iffColor&&d.iffColor.r>d.iffColor.g?rq:rV;return u[14]!==d.id||u[15]!==d.playerName||u[16]!==C||u[17]!==S||u[18]!==w||u[19]!==y?(s=y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(rH.Html,{position:[0,S,0],center:!0,children:(0,t.jsx)("div",{ref:p,className:r$.default.Top,children:(0,t.jsx)("img",{ref:x,className:r$.default.IffArrow,src:w,alt:""})})}),(0,t.jsx)(rH.Html,{position:[0,-.2,0],center:!0,children:(0,t.jsxs)("div",{ref:g,className:r$.default.Bottom,children:[(0,t.jsx)("div",{ref:_,className:r$.default.Name,children:d.playerName??d.id}),C&&(0,t.jsx)("div",{className:r$.default.HealthBar,children:(0,t.jsx)("div",{ref:v,className:r$.default.HealthFill})})]})})]}),u[14]=d.id,u[15]=d.playerName,u[16]=C,u[17]=S,u[18]=w,u[19]=y,u[20]=s):s=u[20],u[21]!==s?(c=(0,t.jsx)("group",{ref:h,children:s}),u[21]=s,u[22]=c):c=u[22],c}function rY(e){return null!=e.health}function rJ(e){return e.camera}var rZ=e.i(78779);let rX=(0,tW.textureToUrl)("commander/MiniIcons/com_flag_grey"),r0=new tM.Vector3;function r1(e){let n,o,i,l,s,c=(0,r.c)(9),{entity:u}=e,d=(0,a.useRef)(null),m=(0,a.useRef)(null),f=(0,a.useRef)(null),h=(0,tC.useThree)(r2);c[0]!==h||c[1]!==u.iffColor?(n=()=>{if(m.current&&u.iffColor){let{r:e,g:t,b:r}=u.iffColor;m.current.style.backgroundColor=`rgb(${e},${t},${r})`}if(f.current&&d.current){d.current.getWorldPosition(r0);let e=h.position.distanceTo(r0);f.current.textContent=e.toFixed(1)}},c[0]=h,c[1]=u.iffColor,c[2]=n):n=c[2],(0,tw.useFrame)(n);let p=u.iffColor?`rgb(${u.iffColor.r},${u.iffColor.g},${u.iffColor.b})`:"rgb(200,200,200)";c[3]===Symbol.for("react.memo_cache_sentinel")?(o=[0,1.5,0],c[3]=o):o=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("span",{ref:f,className:rZ.default.Distance}),c[4]=i):i=c[4],c[5]!==p?(l={backgroundColor:p,"--flag-icon-url":`url(${rX})`},c[5]=p,c[6]=l):l=c[6];let g=l;return c[7]!==g?(s=(0,t.jsx)("group",{ref:d,children:(0,t.jsx)(rH.Html,{position:o,center:!0,children:(0,t.jsxs)("div",{className:rZ.default.Root,children:[i,(0,t.jsx)("div",{ref:m,className:rZ.default.Icon,style:g})]})})}),c[7]=g,c[8]=s):s=c[8],s}function r2(e){return e.camera}function r3(){let e,a=(0,r.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("group",{ref:r5,children:(0,t.jsx)(r4,{})}),a[0]=e):e=a[0],e}function r5(e){tD.streamPlaybackStore.setState({root:e})}let r4=(0,a.memo)(function(){let e=(0,eX.useAllGameEntities)(),r=(0,a.useRef)(new Map).current,n=new Set;for(let t of e)n.add(t.id),r.set(t.id,t);for(let e of r.keys())n.has(e)||r.delete(e);return(0,t.jsx)(t.Fragment,{children:[...r.values()].map(e=>(0,t.jsx)(r6,{entity:e},e.id))})}),r6=(0,a.memo)(function(e){let a,n=(0,r.c)(7),{entity:o}=e;if((0,tR.isSceneEntity)(o)){let e,r;return n[0]!==o?(e=(0,t.jsx)(rU,{entity:o}),n[0]=o,n[1]=e):e=n[1],n[2]!==o.id||n[3]!==e?(r=(0,t.jsx)("group",{name:o.id,children:e}),n[2]=o.id,n[3]=e,n[4]=r):r=n[4],r}return"None"===o.renderType?null:(n[5]!==o?(a=(0,t.jsx)(ae,{entity:o}),n[5]=o,n[6]=a):a=n[6],a)});function r8(e){let a,n=(0,r.c)(2),{entity:o}=e,i=(0,tg.useEngineSelector)(r7);return o.id===i?null:(n[0]!==o?(a=(0,t.jsx)(rK,{entity:o}),n[0]=o,n[1]=a):a=n[1],a)}function r7(e){return e.playback.streamSnapshot?.controlPlayerGhostId}function r9({entity:e}){let r=(0,a.useRef)(!1),[n,o]=(0,a.useState)(()=>((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0);return(r.current=n,(0,tw.useFrame)(()=>{let t=((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0;t!==r.current&&(r.current=t,o(t))}),n)?(0,t.jsx)(r1,{entity:e}):null}function ae(e){let a,n,o,i,l,s,c,u,d=(0,r.c)(39),{entity:m}=e,f=m.position,h=m.scale;e:{let e;if(!m.rotation){a=void 0;break e}d[0]!==m.rotation?(e=new tM.Quaternion(...m.rotation),d[0]=m.rotation,d[1]=e):e=d[1],a=e}let p=a,g="Player"===m.renderType;if("Shape"===m.renderType&&!m.shapeName){let e,r,a,n,o,i=m.id;return d[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("sphereGeometry",{args:[.3,6,4]}),d[2]=e):e=d[2],d[3]!==m.className?(r=(0,rO.entityTypeColor)(m.className),d[3]=m.className,d[4]=r):r=d[4],d[5]!==r?(a=(0,t.jsxs)("mesh",{children:[e,(0,t.jsx)("meshBasicMaterial",{color:r,wireframe:!0})]}),d[5]=r,d[6]=a):a=d[6],d[7]!==m?(n=(0,t.jsx)(r9,{entity:m}),d[7]=m,d[8]=n):n=d[8],d[9]!==m.id||d[10]!==f||d[11]!==p||d[12]!==h||d[13]!==a||d[14]!==n?(o=(0,t.jsxs)("group",{name:i,position:f,quaternion:p,scale:h,children:[a,n]}),d[9]=m.id,d[10]=f,d[11]=p,d[12]=h,d[13]=a,d[14]=n,d[15]=o):o=d[15],o}d[16]!==m.className||d[17]!==m.renderType?(n="Explosion"===m.renderType?null:(0,t.jsxs)("mesh",{children:[(0,t.jsx)("sphereGeometry",{args:[.5,8,6]}),(0,t.jsx)("meshBasicMaterial",{color:(0,rO.entityTypeColor)(m.className),wireframe:!0})]}),d[16]=m.className,d[17]=m.renderType,d[18]=n):n=d[18];let v=n;return d[19]!==m?(o=(0,t.jsx)(rU,{entity:m}),d[19]=m,d[20]=o):o=d[20],d[21]!==v||d[22]!==o?(i=(0,t.jsx)(tA.ShapeErrorBoundary,{fallback:v,children:o}),d[21]=v,d[22]=o,d[23]=i):i=d[23],d[24]!==m||d[25]!==g?(l=g&&(0,t.jsx)(r8,{entity:m}),d[24]=m,d[25]=g,d[26]=l):l=d[26],d[27]!==m?(s=(0,t.jsx)(r9,{entity:m}),d[27]=m,d[28]=s):s=d[28],d[29]!==i||d[30]!==l||d[31]!==s?(c=(0,t.jsxs)("group",{name:"model",children:[i,l,s]}),d[29]=i,d[30]=l,d[31]=s,d[32]=c):c=d[32],d[33]!==m.id||d[34]!==f||d[35]!==p||d[36]!==h||d[37]!==c?(u=(0,t.jsx)("group",{name:m.id,position:f,quaternion:p,scale:h,children:c}),d[33]=m.id,d[34]=f,d[35]=p,d[36]=h,d[37]=c,d[38]=u):u=d[38],u}var at=e.i(51475);let ar=(0,w.createLogger)("SceneLighting");function aa(){let e,n,o,i=(0,r.c)(6),l=(0,eX.useSceneSun)();if(i[0]!==l?(e=()=>{l?ar.debug("sunData: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",l.direction.x.toFixed(3),l.direction.y.toFixed(3),l.direction.z.toFixed(3),l.color.r.toFixed(3),l.color.g.toFixed(3),l.color.b.toFixed(3),l.ambient.r.toFixed(3),l.ambient.g.toFixed(3),l.ambient.b.toFixed(3)):ar.debug("No sunData — using fallback ambient #888")},n=[l],i[0]=l,i[1]=e,i[2]=n):(e=i[1],n=i[2]),(0,a.useEffect)(e,n),!l){let e;return i[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("ambientLight",{color:"#888888",intensity:1}),i[3]=e):e=i[3],e}return i[4]!==l?(o=(0,t.jsx)(an,{sunData:l}),i[4]=l,i[5]=o):o=i[5],o}function an(e){let n,o,i,l,s,c,u,d,m,f,h=(0,r.c)(29),{sunData:p}=e;h[0]!==p.direction?(n=(0,tU.torqueToThree)(p.direction),h[0]=p.direction,h[1]=n):n=h[1];let[g,v,x]=n,y=Math.sqrt(g*g+v*v+x*x),b=g/y,_=v/y,S=x/y;h[2]!==b||h[3]!==_||h[4]!==S?(o=new tM.Vector3(b,_,S),h[2]=b,h[3]=_,h[4]=S,h[5]=o):o=h[5];let j=o,C=-(5e3*j.x),w=-(5e3*j.y),M=-(5e3*j.z);h[6]!==C||h[7]!==w||h[8]!==M?(i=new tM.Vector3(C,w,M),h[6]=C,h[7]=w,h[8]=M,h[9]=i):i=h[9];let N=i;h[10]!==p.color.b||h[11]!==p.color.g||h[12]!==p.color.r?(l=new tM.Color(p.color.r,p.color.g,p.color.b),h[10]=p.color.b,h[11]=p.color.g,h[12]=p.color.r,h[13]=l):l=h[13];let T=l;h[14]!==p.ambient.b||h[15]!==p.ambient.g||h[16]!==p.ambient.r?(s=new tM.Color(p.ambient.r,p.ambient.g,p.ambient.b),h[14]=p.ambient.b,h[15]=p.ambient.g,h[16]=p.ambient.r,h[17]=s):s=h[17];let k=s,F=j.y<0;return h[18]!==F?(c=()=>{t$.value=F},u=[F],h[18]=F,h[19]=c,h[20]=u):(c=h[19],u=h[20]),(0,a.useEffect)(c,u),h[21]!==T||h[22]!==N?(d=(0,t.jsx)("directionalLight",{position:N,color:T,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}),h[21]=T,h[22]=N,h[23]=d):d=h[23],h[24]!==k?(m=(0,t.jsx)("ambientLight",{color:k,intensity:1}),h[24]=k,h[25]=m):m=h[25],h[26]!==d||h[27]!==m?(f=(0,t.jsxs)(t.Fragment,{children:[d,m]}),h[26]=d,h[27]=m,h[28]=f):f=h[28],f}function ao(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo,delete window.loadDemoRecording}let ai=(0,i.createParser)({parse(e){let[t,r]=e.split("~"),a=r,n=(0,e0.getMissionInfo)(t).missionTypes;return r&&n.includes(r)||(a=n[0]),{missionName:t,missionType:a}},serialize({missionName:e,missionType:t}){let r=(0,e0.getMissionInfo)(e).missionTypes;return t&&1!==r.length?`${e}~${t}`:e},eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});var al=e.i(75056);let as={toneMapping:tM.NoToneMapping,outputColorSpace:tM.SRGBColorSpace};function ac(e){let a,n,o=(0,r.c)(6),{children:i,renderOnDemand:l,dpr:s,onCreated:c}=e,{renderOnDemand:u}=(0,b.useDebug)(),d=void 0!==l&&l||u?"demand":"always";return o[0]===Symbol.for("react.memo_cache_sentinel")?(a={type:tM.PCFShadowMap},o[0]=a):a=o[0],o[1]!==i||o[2]!==s||o[3]!==c||o[4]!==d?(n=(0,t.jsx)(al.Canvas,{frameloop:d,dpr:s,gl:as,shadows:a,onCreated:c,children:i}),o[1]=i,o[2]=s,o[3]=c,o[4]=d,o[5]=n):n=o[5],n}var au=e.i(12631),ad=e.i(66093),am=e.i(205);let af=(0,a.lazy)(()=>e.A(34019).then(e=>({default:e.TouchHandler})));function ah(e){let a,n=(0,r.c)(2),{children:o}=e;return n[0]!==o?(a=(0,t.jsx)(au.KeyboardControls,{map:am.KEYBOARD_CONTROLS,children:(0,t.jsx)(ad.JoystickProvider,{children:o})}),n[0]=o,n[1]=a):a=n[1],a}function ap(){let e,n,o,i=(0,r.c)(5),l=eZ();return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(am.KeyboardAndMouseHandler,{}),i[0]=e):e=i[0],i[1]!==l?(n=l?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(af,{})}):null,i[1]=l,i[2]=n):n=i[2],i[3]!==n?(o=(0,t.jsxs)(t.Fragment,{children:[e,n]}),i[3]=n,i[4]=o):o=i[4],o}let ag=(0,a.lazy)(()=>e.A(553).then(e=>({default:e.TouchJoystick}))),av=(0,a.lazy)(()=>e.A(33487).then(e=>({default:e.KeyboardOverlay})));function ax(){let e,n,o,i=(0,r.c)(7),l=eZ();return i[0]!==l?(e=l?(0,t.jsx)(ag,{}):null,i[0]=l,i[1]=e):e=i[1],i[2]!==l?(n=!1===l?(0,t.jsx)(av,{}):null,i[2]=l,i[3]=n):n=i[3],i[4]!==e||i[5]!==n?(o=(0,t.jsxs)(a.Suspense,{children:[e,n]}),i[4]=e,i[5]=n,i[6]=o):o=i[6],o}var ay=e.i(89271);function ab(e){let a,n,o,i,l,s=(0,r.c)(11),{isLoading:c,progress:u}=e,d=!c;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:ay.default.Spinner}),s[0]=a):a=s[0];let m=`${100*u}%`;return s[1]!==m?(n=(0,t.jsx)("div",{className:ay.default.Progress,children:(0,t.jsx)("div",{className:ay.default.ProgressBar,style:{width:m}})}),s[1]=m,s[2]=n):n=s[2],s[3]!==u?(o=Math.round(100*u),s[3]=u,s[4]=o):o=s[4],s[5]!==o?(i=(0,t.jsxs)("div",{className:ay.default.ProgressText,children:[o,"%"]}),s[5]=o,s[6]=i):i=s[6],s[7]!==d||s[8]!==n||s[9]!==i?(l=(0,t.jsxs)("div",{className:ay.default.LoadingIndicator,"data-complete":d,children:[a,n,i]}),s[7]=d,s[8]=n,s[9]=i,s[10]=l):l=s[10],l}function a_(e){let n,o=(0,r.c)(3),{children:i}=e,{debugMode:l}=(0,b.useDebug)();return o[0]!==i||o[1]!==l?(n=l?(0,t.jsx)(a.Suspense,{children:i}):null,o[0]=i,o[1]=l,o[2]=n):n=o[2],n}var aS=e.i(82156);function aj(e,t){return(0,a.lazy)(()=>t().then(t=>({default:t[e]})))}let aC=aj("StreamingController",()=>e.A(25483)),aw=aj("DemoPlaybackControls",()=>e.A(93884)),aM=aj("DebugElements",()=>e.A(88487)),aN=aj("Mission",()=>e.A(21683)),aT=aj("LiveObserver",()=>e.A(96145)),ak=aj("ChatSoundPlayer",()=>e.A(38496)),aF=aj("PlayerHUD",()=>e.A(57567)),aR=aj("MapInfoDialog",()=>e.A(59197)),aD=aj("ServerBrowser",()=>e.A(70012));function aL(){let[e,n]=function(){let e,t=(0,r.c)(3),[a,n]=(0,i.useQueryState)("mission",ai);return t[0]!==a||t[1]!==n?(e=[a,n],t[0]=a,t[1]=n,t[2]=e):e=t[2],e}(),[o,s]=function(){let e,t=(0,r.c)(3),[a,n]=(0,i.useQueryState)("fog",i.parseAsBoolean);return t[0]!==a||t[1]!==n?(e=[a,n],t[0]=a,t[1]=n,t[2]=e):e=t[2],e}(),c=(0,a.useCallback)(()=>{s(null)},[s]),u=(0,a.useContext)(l),{missionName:d,missionType:m}=e,[f,h]=(0,a.useState)(!1),[p,_]=(0,a.useState)(!1),[S,j]=(0,a.useState)(!1),[C,w]=(0,a.useState)(!1),[T,k]=(0,a.useState)(0),[F,R]=(0,a.useState)(!0),D=eZ(),L=(0,a.useCallback)(e=>{window.location.hash="",c(),w(!1);let t=M.liveConnectionStore.getState();t.disconnectServer(),t.disconnectRelay(),tg.engineStore.getState().setRecording(null),eX.gameEntityStore.getState().endStreaming(),n(e),D&&j(!1)},[c,n,D]);!function(e){let t,n,o=(0,r.c)(5),{onChangeMission:i}=e,{setRecording:l}=(0,N.usePlaybackActions)(),s=(0,a.useEffectEvent)(i);o[0]!==s||o[1]!==l?(t=()=>(window.setMissionName=e=>{let t=(0,e0.getMissionInfo)(e).missionTypes;s({missionName:e,missionType:t[0]})},window.getMissionList=e0.getMissionList,window.getMissionInfo=e0.getMissionInfo,window.loadDemoRecording=l,ao),o[0]=s,o[1]=l,o[2]=t):t=o[2],o[3]!==l?(n=[l],o[3]=l,o[4]=n):n=o[4],(0,a.useEffect)(t,n)}({onChangeMission:L});let B=(0,N.useRecording)(),I=(0,eX.useDataSource)(),A="demo"===I||"live"===I,P=(0,M.useLiveSelector)(e=>null!=e.adapter),E=(0,eX.useMissionName)(),z=(0,eX.useMissionType)();(0,a.useEffect)(()=>{if(A&&E)try{let e=(0,e0.getMissionInfo)(E),t=z&&e.missionTypes.includes(z)?z:void 0;n({missionName:E,missionType:t})}catch{n(null)}},[A,E,z,n]),(0,a.useEffect)(()=>{B&&w(!1)},[B]);let G=(0,M.useLiveSelector)(e=>e.gameStatus);(0,a.useEffect)(()=>{"connected"===G&&D&&j(!1)},[G,D]),(0,a.useEffect)(()=>{B&&D&&j(!1)},[D,B]);let U=T<1;(0,a.useEffect)(()=>{if(U)R(!0);else{let e=setTimeout(()=>R(!1),500);return()=>clearTimeout(e)}},[U]);let W=(0,a.useCallback)((e,t=0)=>{k(t)},[]),H=(0,a.useRef)(null),O=(0,a.useRef)(null);return(0,t.jsx)("main",{className:aS.default.Frame,children:(0,t.jsx)(N.RecordingProvider,{children:(0,t.jsxs)(b.SettingsProvider,{fogEnabledOverride:o,onClearFogEnabledOverride:c,children:[(0,t.jsxs)("header",{className:aS.default.Toolbar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{type:"button",className:aS.default.ToggleSidebarButton,"data-orientation":"top","aria-label":S?"Close sidebar":"Open sidebar",title:S?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>j(e=>!e))},children:S?(0,t.jsx)(x,{}):(0,t.jsx)(y,{})}),(0,t.jsx)("button",{type:"button",className:aS.default.ToggleSidebarButton,"data-orientation":"left","aria-label":S?"Close sidebar":"Open sidebar",title:S?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>j(e=>!e))},children:S?(0,t.jsx)(g,{}):(0,t.jsx)(v,{})}),(0,t.jsx)(a.Activity,{mode:A&&!C?"visible":"hidden",children:(0,t.jsx)(ty,{})}),(0,t.jsxs)(a.Activity,{mode:!A||C?"visible":"hidden",children:[(0,t.jsx)(tp,{value:C?"":d,missionType:C?"":m,onChange:L,autoFocus:C}),C&&(0,t.jsx)("button",{type:"button",className:aS.default.CancelButton,onClick:()=>{w(!1)},children:"Cancel"})]})]}),S?(0,t.jsx)("div",{className:aS.default.Backdrop}):null,(0,t.jsx)(a.Activity,{mode:S?"visible":"hidden",children:(0,t.jsx)(a.ViewTransition,{children:(0,t.jsx)("div",{className:aS.default.Sidebar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),"data-open":S,children:(0,t.jsx)(e2,{missionName:d,missionType:m,onOpenMapInfo:()=>h(!0),onOpenServerBrowser:u.live?()=>_(!0):void 0,onChooseMap:A?()=>{w(!0)}:void 0,onCancelChoosingMap:()=>{w(!1)},choosingMap:C,cameraRef:H,invalidateRef:O})})})}),(0,t.jsx)(ah,{children:(0,t.jsxs)("div",{className:aS.default.Content,children:[(0,t.jsx)("div",{className:aS.default.ThreeView,children:(0,t.jsx)(ac,{dpr:f||p?.25:void 0,onCreated:e=>{H.current=e.camera,O.current=e.invalidate},children:(0,t.jsx)(at.TickProvider,{children:(0,t.jsxs)(tF.CamerasProvider,{children:[(0,t.jsx)(ap,{}),(0,t.jsxs)(tk.AudioProvider,{children:[(0,t.jsx)(aa,{}),(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(r3,{})}),(0,t.jsx)(tT,{}),(0,t.jsx)(rF,{children:(0,t.jsx)(ak,{})}),(0,t.jsx)(a_,{children:(0,t.jsx)(aM,{})}),B?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aC,{recording:B})}):null,A?null:(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aN,{name:d,missionType:m,onLoadingChange:W},`${d}~${m}`)}),P?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aT,{})}):null]})]})})})}),A?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aF,{})}):null,(0,t.jsx)(ax,{}),F&&(0,t.jsx)(ab,{isLoading:U,progress:T})]})}),(0,t.jsx)("footer",{className:aS.default.PlayerBar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:B?.source==="demo"?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aw,{})}):null}),f?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aR,{onClose:()=>h(!1),missionName:d,missionType:m??""})}):null,p?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aD,{onClose:()=>_(!1)})}):null]})})})}let aB=new n.QueryClient;function aI(){let e,n=(0,r.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(s,{children:(0,t.jsx)(o.QueryClientProvider,{client:aB,children:(0,t.jsx)(aL,{})})})}),n[0]=e):e=n[0],e}e.s(["default",()=>aI],31713)}]); \ No newline at end of file + `,depthWrite:!1,depthTest:!1})]})}function rT(e,t){let{fogDistance:r,visibleDistance:a}=e;return[r,a]}function rk({fogState:e,enabled:t}){let r=(0,tC.useThree)(e=>e.scene),n=(0,tC.useThree)(e=>e.camera),o=(0,a.useRef)(null),i=(0,a.useMemo)(()=>(0,tK.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,a.useEffect)(()=>{rj||((0,tQ.installCustomFogShader)(),rj=!0)},[]),(0,a.useEffect)(()=>{(0,tK.resetGlobalFogUniforms)();let[t,a]=rT(e,n.position.y),l=new tM.Fog(e.fogColor,t,a);return r.fog=l,o.current=l,(0,tK.updateGlobalFogUniforms)(n.position.y,i),()=>{r.fog=null,o.current=null,(0,tK.resetGlobalFogUniforms)()}},[r,n,e,i]),(0,a.useEffect)(()=>{let r=o.current;if(r)if(t){let[t,a]=rT(e,n.position.y);r.near=t,r.far=a}else r.near=1e10,r.far=1e10},[t,e,n.position.y]),(0,tw.useFrame)(()=>{let r=o.current;if(!r)return;let a=n.position.y;if((0,tK.updateGlobalFogUniforms)(a,i,t),t){let[t,n]=rT(e,a);r.near=t,r.far=n,r.color.copy(e.fogColor)}}),null}let rF=(0,a.memo)(function({entity:e}){let{skyData:r}=e;rS.debug("Rendering: materialList=%s, useSkyTextures=%s",r.materialList,r.useSkyTextures);let{fogEnabled:n}=(0,b.useSettings)(),o=r.materialList||void 0,i=(0,a.useMemo)(()=>rC(r.skySolidColor),[r.skySolidColor]),l=r.useSkyTextures,s=(0,a.useMemo)(()=>(function(e){let t=e.fogDistance,r=e.visibleDistance>0?e.visibleDistance:1e3,{r:a,g:n,b:o}=e.fogColor,i=new tM.Color().setRGB(a,n,o).convertSRGBToLinear(),l=[];for(let t of e.fogVolumes)t.visibleDistance<=0||t.maxHeight<=t.minHeight||l.push({visibleDistance:t.visibleDistance,minHeight:t.minHeight,maxHeight:t.maxHeight,percentage:1});let s=l.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:t,visibleDistance:r,fogColor:i,fogVolumes:l,fogLine:s,enabled:r>t}})(r),[r]);rS.debug("fogState: fogColor=(%s, %s, %s) visibleDistance=%d fogDistance=%d enabled=%s volumes=%d",r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,s.enabled,s.fogVolumes.length);let c=(0,a.useMemo)(()=>rC(r.fogColor),[r.fogColor]),u=i||c,d=s.enabled&&n,m=s.fogColor,f=(0,tC.useThree)(e=>e.scene),h=(0,tC.useThree)(e=>e.gl);(0,a.useEffect)(()=>{if(d){let e=m.clone();f.background=e,h.setClearColor(e)}else if(u){let e=u[0].clone();f.background=e,h.setClearColor(e)}else f.background=null;return()=>{f.background=null}},[f,h,d,m,u]);let p=i?.[1];return(0,t.jsxs)(t.Fragment,{children:[o&&l&&o.length>0?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rM,{materialList:o,fogColor:d?m:void 0,fogState:d?s:void 0},o)}):p?(0,t.jsx)(rN,{skyColor:p,fogColor:d?m:void 0,fogState:d?s:void 0}):null,(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(ry,{scene:r})}),s.enabled?(0,t.jsx)(rk,{fogState:s,enabled:n}):null]})});function rR(e){let n,o=(0,r.c)(3),{children:i}=e,{audioEnabled:l}=(0,b.useSettings)();return o[0]!==l||o[1]!==i?(n=l?(0,t.jsx)(a.Suspense,{children:i}):null,o[0]=l,o[1]=i,o[2]=n):n=o[2],n}function rD(e,n){let o=(0,a.lazy)(()=>n().then(t=>({default:t[e]}))),i=a=>{let n,i,l=(0,r.c)(5),{entity:s}=a,c=`${e}:${s.id}`;return l[0]!==s?(n=(0,t.jsx)(o,{entity:s}),l[0]=s,l[1]=n):n=l[1],l[2]!==c||l[3]!==n?(i=(0,t.jsx)(tI.DebugSuspense,{name:c,children:n}),l[2]=c,l[3]=n,l[4]=i):i=l[4],i};return i.displayName=`createLazy(${e})`,i}let rL=rD("PlayerModel",()=>e.A(30814)),rB=rD("ExplosionShape",()=>e.A(44325)),rI=rD("TracerProjectile",()=>e.A(62125)),rA=rD("SpriteProjectile",()=>e.A(62125)),rP=rD("ForceFieldBare",()=>e.A(25147)),rE=rD("AudioEmitter",()=>e.A(61921)),rz=rD("WaterBlock",()=>e.A(18599)),rG=rD("WeaponModel",()=>e.A(44325)),rU={1:"Storm",2:"Inferno"},rW=(0,a.memo)(function(e){let a=(0,r.c)(26),{entity:n}=e;switch(n.renderType){case"Shape":{let e;return a[0]!==n?(e=(0,t.jsx)(rH,{entity:n}),a[0]=n,a[1]=e):e=a[1],e}case"ForceFieldBare":{let e;return a[2]!==n?(e=(0,t.jsx)(rP,{entity:n}),a[2]=n,a[3]=e):e=a[3],e}case"Player":{let e;return a[4]!==n?(e=(0,t.jsx)(rL,{entity:n}),a[4]=n,a[5]=e):e=a[5],e}case"Explosion":{let e;return a[6]!==n?(e=(0,t.jsx)(rB,{entity:n}),a[6]=n,a[7]=e):e=a[7],e}case"Tracer":{let e;return a[8]!==n?(e=(0,t.jsx)(rI,{entity:n}),a[8]=n,a[9]=e):e=a[9],e}case"Sprite":{let e;return a[10]!==n?(e=(0,t.jsx)(rA,{entity:n}),a[10]=n,a[11]=e):e=a[11],e}case"AudioEmitter":{let e;return a[12]!==n?(e=(0,t.jsx)(rR,{children:(0,t.jsx)(rE,{entity:n})}),a[12]=n,a[13]=e):e=a[13],e}case"Camera":{let e;return a[14]!==n?(e=(0,t.jsx)(tE,{entity:n}),a[14]=n,a[15]=e):e=a[15],e}case"WayPoint":{let e;return a[16]!==n?(e=(0,t.jsx)(tz,{entity:n}),a[16]=n,a[17]=e):e=a[17],e}case"TerrainBlock":{let e;return a[18]!==n.terrainData?(e=(0,t.jsx)(t3,{scene:n.terrainData}),a[18]=n.terrainData,a[19]=e):e=a[19],e}case"InteriorInstance":{let e;return a[20]!==n.interiorData?(e=(0,t.jsx)(rc,{scene:n.interiorData}),a[20]=n.interiorData,a[21]=e):e=a[21],e}case"Sky":{let e;return a[22]!==n?(e=(0,t.jsx)(rF,{entity:n}),a[22]=n,a[23]=e):e=a[23],e}case"Sun":case"MissionArea":case"None":default:return null;case"WaterBlock":{let e;return a[24]!==n?(e=(0,t.jsx)(rz,{entity:n}),a[24]=n,a[25]=e):e=a[25],e}}});function rH(e){let n,o,i,l,s,c,u,d=(0,r.c)(24),{entity:m}=e,{animationEnabled:f}=(0,b.useSettings)(),h=(0,a.useRef)(null);if(d[0]!==f||d[1]!==m.rotate?(n=()=>{if(!h.current||!m.rotate||!f)return;let e=performance.now()/1e3;h.current.rotation.y=e/3*Math.PI*2},d[0]=f,d[1]=m.rotate,d[2]=n):n=d[2],(0,tw.useFrame)(n),!m.shapeName)throw Error(`Shape entity missing shapeName: ${m.id}`);let p=m.runtimeObject,g=m.shapeType??"StaticShape",v=m.dataBlock?.toLowerCase()==="flag",x=m.teamId&&m.teamId>0?rU[m.teamId]:null,y=v&&x?`${x} Flag`:null,_="Item"===m.shapeType?"pink":m.threads?"#00ff88":"yellow",S=m.rotate?h:void 0,j=p?void 0:m;return d[3]!==y?(o=y?(0,t.jsx)(tP.FloatingLabel,{opacity:.6,children:y}):null,d[3]=y,d[4]=o):o=d[4],d[5]!==_||d[6]!==j||d[7]!==o?(i=(0,t.jsx)(tL.ShapeRenderer,{loadingColor:_,streamEntity:j,children:o}),d[5]=_,d[6]=j,d[7]=o,d[8]=i):i=d[8],d[9]!==m.barrelShapeName||d[10]!==p?(l=m.barrelShapeName&&(0,t.jsx)(tB.ShapeInfoProvider,{object:p,shapeName:m.barrelShapeName,type:"Turret",children:(0,t.jsx)("group",{position:[0,1.5,0],children:(0,t.jsx)(tL.ShapeRenderer,{})})}),d[9]=m.barrelShapeName,d[10]=p,d[11]=l):l=d[11],d[12]!==m?(s=m.weaponShape&&(0,t.jsx)(tA.ShapeErrorBoundary,{fallback:(0,t.jsx)(tL.ShapePlaceholder,{color:"red",label:m.weaponShape}),children:(0,t.jsx)(tI.DebugSuspense,{name:`Weapon:${m.id}/${m.weaponShape}`,fallback:(0,t.jsx)(tL.ShapePlaceholder,{color:"cyan",label:m.weaponShape}),children:(0,t.jsx)(rG,{entity:m})})}),d[12]=m,d[13]=s):s=d[13],d[14]!==S||d[15]!==i||d[16]!==l||d[17]!==s?(c=(0,t.jsxs)("group",{ref:S,children:[i,l,s]}),d[14]=S,d[15]=i,d[16]=l,d[17]=s,d[18]=c):c=d[18],d[19]!==m.shapeName||d[20]!==g||d[21]!==c||d[22]!==p?(u=(0,t.jsx)(tB.ShapeInfoProvider,{object:p,shapeName:m.shapeName,type:g,children:c}),d[19]=m.shapeName,d[20]=g,d[21]=c,d[22]=p,d[23]=u):u=d[23],u}var rO=e.i(60099),r$=e.i(85557),rV=e.i(29418);let rq=(0,tW.textureToUrl)("gui/hud_alliedtriangle"),rQ=(0,tW.textureToUrl)("gui/hud_enemytriangle"),rK=new tM.Vector3;function rY(e){let n,o,i,l,s,c,u=(0,r.c)(23),{entity:d}=e,m=(0,tL.useStaticShape)(d.shapeName??d.dataBlock),f=(0,tC.useThree)(rZ),h=(0,a.useRef)(null),p=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),[y,b]=(0,a.useState)(!0),_=(0,a.useRef)(null);u[0]!==m.scene?(n=new tM.Box3().setFromObject(m.scene),u[0]=m.scene,u[1]=n):n=u[1];let S=n.max.y+.1;u[2]!==d.keyframes?(o=d.keyframes??[],u[2]=d.keyframes,u[3]=o):o=u[3];let j=o;u[4]!==j?(i=j.some(rJ),u[4]=j,u[5]=i):i=u[5];let C=i;u[6]!==f||u[7]!==d.id||u[8]!==d.iffColor||u[9]!==d.playerName||u[10]!==C||u[11]!==y||u[12]!==j?(l=()=>{let e=h.current;if(!e)return;e.getWorldPosition(rK);let t=f.position.distanceTo(rK),r=f.matrixWorld.elements,a=!(-((rK.x-r[12])*r[8])+-((rK.y-r[13])*r[9])+-((rK.z-r[14])*r[10])<0)&&t<150;if(y!==a&&b(a),!a)return;let n=(0,r$.getKeyframeAtTime)(j,tD.streamPlaybackStore.getState().time),o=n?.health??1;if(n?.damageState!=null&&n.damageState>=1){p.current&&(p.current.style.opacity="0"),g.current&&(g.current.style.opacity="0");return}let i=Math.max(0,Math.min(1,1-t/150)).toString();if(p.current&&(p.current.style.opacity=i),g.current&&(g.current.style.opacity=i),_.current){let e=d.playerName??d.id;_.current.textContent!==e&&(_.current.textContent=e)}if(x.current&&d.iffColor){let e=d.iffColor.r>d.iffColor.g?rQ:rq;x.current.getAttribute("src")!==e&&(x.current.src=e)}v.current&&C&&(v.current.style.width=`${Math.max(0,Math.min(100,100*o))}%`,v.current.style.background=d.iffColor?`rgb(${d.iffColor.r}, ${d.iffColor.g}, ${d.iffColor.b})`:"")},u[6]=f,u[7]=d.id,u[8]=d.iffColor,u[9]=d.playerName,u[10]=C,u[11]=y,u[12]=j,u[13]=l):l=u[13],(0,tw.useFrame)(l);let w=d.iffColor&&d.iffColor.r>d.iffColor.g?rQ:rq;return u[14]!==d.id||u[15]!==d.playerName||u[16]!==C||u[17]!==S||u[18]!==w||u[19]!==y?(s=y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(rO.Html,{position:[0,S,0],center:!0,children:(0,t.jsx)("div",{ref:p,className:rV.default.Top,children:(0,t.jsx)("img",{ref:x,className:rV.default.IffArrow,src:w,alt:""})})}),(0,t.jsx)(rO.Html,{position:[0,-.2,0],center:!0,children:(0,t.jsxs)("div",{ref:g,className:rV.default.Bottom,children:[(0,t.jsx)("div",{ref:_,className:rV.default.Name,children:d.playerName??d.id}),C&&(0,t.jsx)("div",{className:rV.default.HealthBar,children:(0,t.jsx)("div",{ref:v,className:rV.default.HealthFill})})]})})]}),u[14]=d.id,u[15]=d.playerName,u[16]=C,u[17]=S,u[18]=w,u[19]=y,u[20]=s):s=u[20],u[21]!==s?(c=(0,t.jsx)("group",{ref:h,children:s}),u[21]=s,u[22]=c):c=u[22],c}function rJ(e){return null!=e.health}function rZ(e){return e.camera}var rX=e.i(78779);let r0=(0,tW.textureToUrl)("commander/MiniIcons/com_flag_grey"),r1=new tM.Vector3;function r2(e){let n,o,i,l,s,c=(0,r.c)(9),{entity:u}=e,d=(0,a.useRef)(null),m=(0,a.useRef)(null),f=(0,a.useRef)(null),h=(0,tC.useThree)(r3);c[0]!==h||c[1]!==u.iffColor?(n=()=>{if(m.current&&u.iffColor){let{r:e,g:t,b:r}=u.iffColor;m.current.style.backgroundColor=`rgb(${e},${t},${r})`}if(f.current&&d.current){d.current.getWorldPosition(r1);let e=h.position.distanceTo(r1);f.current.textContent=e.toFixed(1)}},c[0]=h,c[1]=u.iffColor,c[2]=n):n=c[2],(0,tw.useFrame)(n);let p=u.iffColor?`rgb(${u.iffColor.r},${u.iffColor.g},${u.iffColor.b})`:"rgb(200,200,200)";c[3]===Symbol.for("react.memo_cache_sentinel")?(o=[0,1.5,0],c[3]=o):o=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("span",{ref:f,className:rX.default.Distance}),c[4]=i):i=c[4],c[5]!==p?(l={backgroundColor:p,"--flag-icon-url":`url(${r0})`},c[5]=p,c[6]=l):l=c[6];let g=l;return c[7]!==g?(s=(0,t.jsx)("group",{ref:d,children:(0,t.jsx)(rO.Html,{position:o,center:!0,children:(0,t.jsxs)("div",{className:rX.default.Root,children:[i,(0,t.jsx)("div",{ref:m,className:rX.default.Icon,style:g})]})})}),c[7]=g,c[8]=s):s=c[8],s}function r3(e){return e.camera}function r5(){let e,a=(0,r.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("group",{ref:r4,children:(0,t.jsx)(r6,{})}),a[0]=e):e=a[0],e}function r4(e){tD.streamPlaybackStore.setState({root:e})}let r6=(0,a.memo)(function(){let e=(0,eX.useAllGameEntities)(),r=(0,a.useRef)(new Map).current,n=new Set;for(let t of e)n.add(t.id),r.set(t.id,t);for(let e of r.keys())n.has(e)||r.delete(e);return(0,t.jsx)(t.Fragment,{children:[...r.values()].map(e=>(0,t.jsx)(r8,{entity:e},e.id))})}),r8=(0,a.memo)(function(e){let a,n=(0,r.c)(7),{entity:o}=e;if((0,tR.isSceneEntity)(o)){let e,r;return n[0]!==o?(e=(0,t.jsx)(rW,{entity:o}),n[0]=o,n[1]=e):e=n[1],n[2]!==o.id||n[3]!==e?(r=(0,t.jsx)("group",{name:o.id,children:e}),n[2]=o.id,n[3]=e,n[4]=r):r=n[4],r}return"None"===o.renderType?null:(n[5]!==o?(a=(0,t.jsx)(at,{entity:o}),n[5]=o,n[6]=a):a=n[6],a)});function r7(e){let a,n=(0,r.c)(2),{entity:o}=e,i=(0,tg.useEngineSelector)(r9);return o.id===i?null:(n[0]!==o?(a=(0,t.jsx)(rY,{entity:o}),n[0]=o,n[1]=a):a=n[1],a)}function r9(e){return e.playback.streamSnapshot?.controlPlayerGhostId}function ae({entity:e}){let r=(0,a.useRef)(!1),[n,o]=(0,a.useState)(()=>((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0);return(r.current=n,(0,tw.useFrame)(()=>{let t=((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0;t!==r.current&&(r.current=t,o(t))}),n)?(0,t.jsx)(r2,{entity:e}):null}function at(e){let a,n,o,i,l,s,c,u,d=(0,r.c)(39),{entity:m}=e,f=m.position,h=m.scale;e:{let e;if(!m.rotation){a=void 0;break e}d[0]!==m.rotation?(e=new tM.Quaternion(...m.rotation),d[0]=m.rotation,d[1]=e):e=d[1],a=e}let p=a,g="Player"===m.renderType;if("Shape"===m.renderType&&!m.shapeName){let e,r,a,n,o,i=m.id;return d[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("sphereGeometry",{args:[.3,6,4]}),d[2]=e):e=d[2],d[3]!==m.className?(r=(0,r$.entityTypeColor)(m.className),d[3]=m.className,d[4]=r):r=d[4],d[5]!==r?(a=(0,t.jsxs)("mesh",{children:[e,(0,t.jsx)("meshBasicMaterial",{color:r,wireframe:!0})]}),d[5]=r,d[6]=a):a=d[6],d[7]!==m?(n=(0,t.jsx)(ae,{entity:m}),d[7]=m,d[8]=n):n=d[8],d[9]!==m.id||d[10]!==f||d[11]!==p||d[12]!==h||d[13]!==a||d[14]!==n?(o=(0,t.jsxs)("group",{name:i,position:f,quaternion:p,scale:h,children:[a,n]}),d[9]=m.id,d[10]=f,d[11]=p,d[12]=h,d[13]=a,d[14]=n,d[15]=o):o=d[15],o}d[16]!==m.className||d[17]!==m.renderType?(n="Explosion"===m.renderType?null:(0,t.jsxs)("mesh",{children:[(0,t.jsx)("sphereGeometry",{args:[.5,8,6]}),(0,t.jsx)("meshBasicMaterial",{color:(0,r$.entityTypeColor)(m.className),wireframe:!0})]}),d[16]=m.className,d[17]=m.renderType,d[18]=n):n=d[18];let v=n;return d[19]!==m?(o=(0,t.jsx)(rW,{entity:m}),d[19]=m,d[20]=o):o=d[20],d[21]!==v||d[22]!==o?(i=(0,t.jsx)(tA.ShapeErrorBoundary,{fallback:v,children:o}),d[21]=v,d[22]=o,d[23]=i):i=d[23],d[24]!==m||d[25]!==g?(l=g&&(0,t.jsx)(r7,{entity:m}),d[24]=m,d[25]=g,d[26]=l):l=d[26],d[27]!==m?(s=(0,t.jsx)(ae,{entity:m}),d[27]=m,d[28]=s):s=d[28],d[29]!==i||d[30]!==l||d[31]!==s?(c=(0,t.jsxs)("group",{name:"model",children:[i,l,s]}),d[29]=i,d[30]=l,d[31]=s,d[32]=c):c=d[32],d[33]!==m.id||d[34]!==f||d[35]!==p||d[36]!==h||d[37]!==c?(u=(0,t.jsx)("group",{name:m.id,position:f,quaternion:p,scale:h,children:c}),d[33]=m.id,d[34]=f,d[35]=p,d[36]=h,d[37]=c,d[38]=u):u=d[38],u}var ar=e.i(51475);let aa=(0,w.createLogger)("SceneLighting");function an(){let e,n,o,i=(0,r.c)(6),l=(0,eX.useSceneSun)();if(i[0]!==l?(e=()=>{l?aa.debug("sunData: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",l.direction.x.toFixed(3),l.direction.y.toFixed(3),l.direction.z.toFixed(3),l.color.r.toFixed(3),l.color.g.toFixed(3),l.color.b.toFixed(3),l.ambient.r.toFixed(3),l.ambient.g.toFixed(3),l.ambient.b.toFixed(3)):aa.debug("No sunData — using fallback ambient #888")},n=[l],i[0]=l,i[1]=e,i[2]=n):(e=i[1],n=i[2]),(0,a.useEffect)(e,n),!l){let e;return i[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("ambientLight",{color:"#888888",intensity:1}),i[3]=e):e=i[3],e}return i[4]!==l?(o=(0,t.jsx)(ao,{sunData:l}),i[4]=l,i[5]=o):o=i[5],o}function ao(e){let n,o,i,l,s,c,u,d,m,f,h=(0,r.c)(29),{sunData:p}=e;h[0]!==p.direction?(n=(0,tU.torqueToThree)(p.direction),h[0]=p.direction,h[1]=n):n=h[1];let[g,v,x]=n,y=Math.sqrt(g*g+v*v+x*x),b=g/y,_=v/y,S=x/y;h[2]!==b||h[3]!==_||h[4]!==S?(o=new tM.Vector3(b,_,S),h[2]=b,h[3]=_,h[4]=S,h[5]=o):o=h[5];let j=o,C=-(5e3*j.x),w=-(5e3*j.y),M=-(5e3*j.z);h[6]!==C||h[7]!==w||h[8]!==M?(i=new tM.Vector3(C,w,M),h[6]=C,h[7]=w,h[8]=M,h[9]=i):i=h[9];let N=i;h[10]!==p.color.b||h[11]!==p.color.g||h[12]!==p.color.r?(l=new tM.Color(p.color.r,p.color.g,p.color.b),h[10]=p.color.b,h[11]=p.color.g,h[12]=p.color.r,h[13]=l):l=h[13];let T=l;h[14]!==p.ambient.b||h[15]!==p.ambient.g||h[16]!==p.ambient.r?(s=new tM.Color(p.ambient.r,p.ambient.g,p.ambient.b),h[14]=p.ambient.b,h[15]=p.ambient.g,h[16]=p.ambient.r,h[17]=s):s=h[17];let k=s,F=j.y<0;return h[18]!==F?(c=()=>{t$.value=F},u=[F],h[18]=F,h[19]=c,h[20]=u):(c=h[19],u=h[20]),(0,a.useEffect)(c,u),h[21]!==T||h[22]!==N?(d=(0,t.jsx)("directionalLight",{position:N,color:T,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}),h[21]=T,h[22]=N,h[23]=d):d=h[23],h[24]!==k?(m=(0,t.jsx)("ambientLight",{color:k,intensity:1}),h[24]=k,h[25]=m):m=h[25],h[26]!==d||h[27]!==m?(f=(0,t.jsxs)(t.Fragment,{children:[d,m]}),h[26]=d,h[27]=m,h[28]=f):f=h[28],f}function ai(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo,delete window.loadDemoRecording}let al=(0,i.createParser)({parse(e){let[t,r]=e.split("~"),a=r,n=(0,e0.getMissionInfo)(t).missionTypes;return r&&n.includes(r)||(a=n[0]),{missionName:t,missionType:a}},serialize({missionName:e,missionType:t}){let r=(0,e0.getMissionInfo)(e).missionTypes;return t&&1!==r.length?`${e}~${t}`:e},eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});var as=e.i(75056);let ac={toneMapping:tM.NoToneMapping,outputColorSpace:tM.SRGBColorSpace};function au(e){let a,n,o=(0,r.c)(6),{children:i,renderOnDemand:l,dpr:s,onCreated:c}=e,{renderOnDemand:u}=(0,b.useDebug)(),d=void 0!==l&&l||u?"demand":"always";return o[0]===Symbol.for("react.memo_cache_sentinel")?(a={type:tM.PCFShadowMap},o[0]=a):a=o[0],o[1]!==i||o[2]!==s||o[3]!==c||o[4]!==d?(n=(0,t.jsx)(as.Canvas,{frameloop:d,dpr:s,gl:ac,shadows:a,onCreated:c,children:i}),o[1]=i,o[2]=s,o[3]=c,o[4]=d,o[5]=n):n=o[5],n}var ad=e.i(12631),am=e.i(66093),af=e.i(205);let ah=(0,a.lazy)(()=>e.A(34019).then(e=>({default:e.TouchHandler})));function ap(e){let a,n=(0,r.c)(2),{children:o}=e;return n[0]!==o?(a=(0,t.jsx)(ad.KeyboardControls,{map:af.KEYBOARD_CONTROLS,children:(0,t.jsx)(am.JoystickProvider,{children:o})}),n[0]=o,n[1]=a):a=n[1],a}function ag(){let e,n,o,i=(0,r.c)(5),l=eZ();return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(af.KeyboardAndMouseHandler,{}),i[0]=e):e=i[0],i[1]!==l?(n=l?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(ah,{})}):null,i[1]=l,i[2]=n):n=i[2],i[3]!==n?(o=(0,t.jsxs)(t.Fragment,{children:[e,n]}),i[3]=n,i[4]=o):o=i[4],o}let av=(0,a.lazy)(()=>e.A(553).then(e=>({default:e.TouchJoystick}))),ax=(0,a.lazy)(()=>e.A(33487).then(e=>({default:e.KeyboardOverlay})));function ay(){let e,n,o,i=(0,r.c)(7),l=eZ();return i[0]!==l?(e=l?(0,t.jsx)(av,{}):null,i[0]=l,i[1]=e):e=i[1],i[2]!==l?(n=!1===l?(0,t.jsx)(ax,{}):null,i[2]=l,i[3]=n):n=i[3],i[4]!==e||i[5]!==n?(o=(0,t.jsxs)(a.Suspense,{children:[e,n]}),i[4]=e,i[5]=n,i[6]=o):o=i[6],o}var ab=e.i(89271);function a_(e){let a,n,o,i,l,s=(0,r.c)(11),{isLoading:c,progress:u}=e,d=!c;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:ab.default.Spinner}),s[0]=a):a=s[0];let m=`${100*u}%`;return s[1]!==m?(n=(0,t.jsx)("div",{className:ab.default.Progress,children:(0,t.jsx)("div",{className:ab.default.ProgressBar,style:{width:m}})}),s[1]=m,s[2]=n):n=s[2],s[3]!==u?(o=Math.round(100*u),s[3]=u,s[4]=o):o=s[4],s[5]!==o?(i=(0,t.jsxs)("div",{className:ab.default.ProgressText,children:[o,"%"]}),s[5]=o,s[6]=i):i=s[6],s[7]!==d||s[8]!==n||s[9]!==i?(l=(0,t.jsxs)("div",{className:ab.default.LoadingIndicator,"data-complete":d,children:[a,n,i]}),s[7]=d,s[8]=n,s[9]=i,s[10]=l):l=s[10],l}function aS(e){let n,o=(0,r.c)(3),{children:i}=e,{debugMode:l}=(0,b.useDebug)();return o[0]!==i||o[1]!==l?(n=l?(0,t.jsx)(a.Suspense,{children:i}):null,o[0]=i,o[1]=l,o[2]=n):n=o[2],n}var aj=e.i(82156);function aC(e,t){return(0,a.lazy)(()=>t().then(t=>({default:t[e]})))}let aw=aC("StreamingController",()=>e.A(25483)),aM=aC("DemoPlaybackControls",()=>e.A(93884)),aN=aC("DebugElements",()=>e.A(88487)),aT=aC("Mission",()=>e.A(21683)),ak=aC("LiveObserver",()=>e.A(96145)),aF=aC("ChatSoundPlayer",()=>e.A(38496)),aR=aC("PlayerHUD",()=>e.A(57567)),aD=aC("MapInfoDialog",()=>e.A(59197)),aL=aC("ServerBrowser",()=>e.A(70012));function aB(){let[e,n]=function(){let e,t=(0,r.c)(3),[a,n]=(0,i.useQueryState)("mission",al);return t[0]!==a||t[1]!==n?(e=[a,n],t[0]=a,t[1]=n,t[2]=e):e=t[2],e}(),[o,s]=function(){let e,t=(0,r.c)(3),[a,n]=(0,i.useQueryState)("fog",i.parseAsBoolean);return t[0]!==a||t[1]!==n?(e=[a,n],t[0]=a,t[1]=n,t[2]=e):e=t[2],e}(),c=(0,a.useCallback)(()=>{s(null)},[s]),u=(0,a.useContext)(l),{missionName:d,missionType:m}=e,[f,h]=(0,a.useState)(!1),[p,_]=(0,a.useState)(!1),[S,j]=(0,a.useState)(!1),[C,w]=(0,a.useState)(!1),[T,k]=(0,a.useState)(0),[F,R]=(0,a.useState)(!0),D=eZ(),L=(0,a.useCallback)(e=>{window.location.hash="",c(),w(!1);let t=M.liveConnectionStore.getState();t.disconnectServer(),t.disconnectRelay(),tg.engineStore.getState().setRecording(null),eX.gameEntityStore.getState().endStreaming(),n(e),D&&j(!1)},[c,n,D]);!function(e){let t,n,o=(0,r.c)(5),{onChangeMission:i}=e,{setRecording:l}=(0,N.usePlaybackActions)(),s=(0,a.useEffectEvent)(i);o[0]!==s||o[1]!==l?(t=()=>(window.setMissionName=e=>{let t=(0,e0.getMissionInfo)(e).missionTypes;s({missionName:e,missionType:t[0]})},window.getMissionList=e0.getMissionList,window.getMissionInfo=e0.getMissionInfo,window.loadDemoRecording=l,ai),o[0]=s,o[1]=l,o[2]=t):t=o[2],o[3]!==l?(n=[l],o[3]=l,o[4]=n):n=o[4],(0,a.useEffect)(t,n)}({onChangeMission:L});let B=(0,N.useRecording)(),I=(0,eX.useDataSource)(),A="demo"===I||"live"===I,P=(0,M.useLiveSelector)(e=>null!=e.adapter),E=(0,eX.useMissionName)(),z=(0,eX.useMissionType)();(0,a.useEffect)(()=>{if(A&&E)try{let e=(0,e0.getMissionInfo)(E),t=z&&e.missionTypes.includes(z)?z:void 0;n({missionName:E,missionType:t})}catch{n(null)}},[A,E,z,n]),(0,a.useEffect)(()=>{B&&w(!1)},[B]);let G=(0,M.useLiveSelector)(e=>e.gameStatus);(0,a.useEffect)(()=>{"connected"===G&&D&&j(!1)},[G,D]),(0,a.useEffect)(()=>{B&&D&&j(!1)},[D,B]);let U=T<1;(0,a.useEffect)(()=>{if(U)R(!0);else{let e=setTimeout(()=>R(!1),500);return()=>clearTimeout(e)}},[U]);let W=(0,a.useCallback)((e,t=0)=>{k(t)},[]),H=(0,a.useRef)(null),O=(0,a.useRef)(null);return(0,t.jsx)("main",{className:aj.default.Frame,children:(0,t.jsx)(N.RecordingProvider,{children:(0,t.jsxs)(b.SettingsProvider,{fogEnabledOverride:o,onClearFogEnabledOverride:c,children:[(0,t.jsxs)("header",{className:aj.default.Toolbar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{type:"button",className:aj.default.ToggleSidebarButton,"data-orientation":"top","aria-label":S?"Close sidebar":"Open sidebar",title:S?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>j(e=>!e))},children:S?(0,t.jsx)(x,{}):(0,t.jsx)(y,{})}),(0,t.jsx)("button",{type:"button",className:aj.default.ToggleSidebarButton,"data-orientation":"left","aria-label":S?"Close sidebar":"Open sidebar",title:S?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>j(e=>!e))},children:S?(0,t.jsx)(g,{}):(0,t.jsx)(v,{})}),(0,t.jsx)(a.Activity,{mode:A&&!C?"visible":"hidden",children:(0,t.jsx)(ty,{})}),(0,t.jsxs)(a.Activity,{mode:!A||C?"visible":"hidden",children:[(0,t.jsx)(tp,{value:C?"":d,missionType:C?"":m,onChange:L,autoFocus:C}),C&&(0,t.jsx)("button",{type:"button",className:aj.default.CancelButton,onClick:()=>{w(!1)},children:"Cancel"})]})]}),S?(0,t.jsx)("div",{className:aj.default.Backdrop}):null,(0,t.jsx)(a.Activity,{mode:S?"visible":"hidden",children:(0,t.jsx)(a.ViewTransition,{children:(0,t.jsx)("div",{className:aj.default.Sidebar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),"data-open":S,children:(0,t.jsx)(e2,{missionName:d,missionType:m,onOpenMapInfo:()=>h(!0),onOpenServerBrowser:u.live?()=>_(!0):void 0,onChooseMap:A?()=>{w(!0)}:void 0,onCancelChoosingMap:()=>{w(!1)},choosingMap:C,cameraRef:H,invalidateRef:O})})})}),(0,t.jsx)(ap,{children:(0,t.jsxs)("div",{className:aj.default.Content,children:[(0,t.jsx)("div",{className:aj.default.ThreeView,children:(0,t.jsx)(au,{dpr:f||p?.25:void 0,onCreated:e=>{H.current=e.camera,O.current=e.invalidate},children:(0,t.jsx)(ar.TickProvider,{children:(0,t.jsxs)(tF.CamerasProvider,{children:[(0,t.jsx)(ag,{}),(0,t.jsxs)(tk.AudioProvider,{children:[(0,t.jsx)(an,{}),(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(r5,{})}),(0,t.jsx)(tT,{}),(0,t.jsx)(rR,{children:(0,t.jsx)(aF,{})}),(0,t.jsx)(aS,{children:(0,t.jsx)(aN,{})}),B?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aw,{recording:B})}):null,A?null:(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aT,{name:d,missionType:m,onLoadingChange:W},`${d}~${m}`)}),P?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(ak,{})}):null]})]})})})}),A?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aR,{})}):null,(0,t.jsx)(ay,{}),F&&(0,t.jsx)(a_,{isLoading:U,progress:T})]})}),(0,t.jsx)("footer",{className:aj.default.PlayerBar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:B?.source==="demo"?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aM,{})}):null}),f?(0,t.jsx)(a.ViewTransition,{children:(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aD,{onClose:()=>h(!1),missionName:d,missionType:m??""})})}):null,p?(0,t.jsx)(a.ViewTransition,{children:(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aL,{onClose:()=>_(!1)})})}):null]})})})}let aI=new n.QueryClient;function aA(){let e,n=(0,r.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(s,{children:(0,t.jsx)(o.QueryClientProvider,{client:aI,children:(0,t.jsx)(aB,{})})})}),n[0]=e):e=n[0],e}e.s(["default",()=>aA],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/d06053c14447cd9a.js b/docs/_next/static/chunks/df1e111d87e0ccf8.js similarity index 75% rename from docs/_next/static/chunks/d06053c14447cd9a.js rename to docs/_next/static/chunks/df1e111d87e0ccf8.js index 0b4615a4..23f07363 100644 --- a/docs/_next/static/chunks/d06053c14447cd9a.js +++ b/docs/_next/static/chunks/df1e111d87e0ccf8.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(2232);let r=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:n,modules:i}=function(){let e="info".trim();if(!e)return{globalLevel:"info",modules:new Map};let t=null,n=new Map;for(let i of e.split(",")){let e=i.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&n.set(t,r)}else r.has(e)&&(t=e)}return{globalLevel:t??=n.size>0?"silent":"info",modules:n}}(),s={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},l=(0,t.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=s[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function a(e){let t=i.get(e)??n;return l.child({module:e},{level:t})}e.s(["createLogger",()=>a])},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".m4a")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(47167),r=e.i(2232);let n=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:i,modules:s}=function(){let e=t.default.env.NEXT_PUBLIC_LOG?.trim();if(!e)return{globalLevel:"info",modules:new Map};let r=null,i=new Map;for(let t of e.split(",")){let e=t.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&i.set(t,r)}else n.has(e)&&(r=e)}return{globalLevel:r??=i.size>0?"silent":"info",modules:i}}(),l={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},a=(0,r.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=l[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function o(e){let t=s.get(e)??i;return a.child({module:e},{level:t})}e.s(["createLogger",()=>o])},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".m4a")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e5d92d4ce07851d8.js b/docs/_next/static/chunks/e5d92d4ce07851d8.js new file mode 100644 index 00000000..ffda4aae --- /dev/null +++ b/docs/_next/static/chunks/e5d92d4ce07851d8.js @@ -0,0 +1,89 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51295,e=>{"use strict";var t=e.i(43476),i=e.i(932),r=e.i(71645),a=e.i(71753),o=e.i(90072),n=e.i(85557),s=e.i(15080),l=e.i(12979),c=e.i(75567);let u=Math.PI/180,d=Math.PI/18e4;function m(e,t,i){let r=e[t];return"number"==typeof r&&Number.isFinite(r)?r:i}function p(e,t,i){let r=e[t];return"boolean"==typeof r?r:"number"==typeof r?0!==r:i}function f(e,t){let i,r=e.particles;if(Array.isArray(r)){for(let e of r)if("number"==typeof e&&(i=t(e)))break}return i?{ejectionPeriodMS:m(e,"ejectionPeriodMS",100),periodVarianceMS:m(e,"periodVarianceMS",0),ejectionVelocity:.01*m(e,"ejectionVelocity",200),velocityVariance:.01*m(e,"velocityVariance",100),ejectionOffset:.01*m(e,"ejectionOffset",0),thetaMin:m(e,"thetaMin",0),thetaMax:m(e,"thetaMax",90),phiReferenceVel:m(e,"phiReferenceVel",0),phiVariance:m(e,"phiVariance",360),overrideAdvances:p(e,"overrideAdvances",!1),orientParticles:p(e,"orientParticles",!1),orientOnVelocity:p(e,"orientOnVelocity",!0),lifetimeMS:m(e,"lifetimeMS",0)<<5,lifetimeVarianceMS:m(e,"lifetimeVarianceMS",0)<<5,particles:function(e){let t=e.keys,i=[];if(Array.isArray(t)&&t.length>0)for(let e=0;e0&&t[0]&&(r=t[0])}return{dragCoefficient:5*m(e,"dragCoefficient",0),windCoefficient:m(e,"windCoefficient",1),gravityCoefficient:10*m(e,"gravityCoefficient",0),inheritedVelFactor:m(e,"inheritedVelFactor",0),constantAcceleration:m(e,"constantAcceleration",0),lifetimeMS:m(e,"lifetimeMS",31)<<5,lifetimeVarianceMS:m(e,"lifetimeVarianceMS",0)<<5,spinSpeed:m(e,"spinSpeed",0),spinRandomMin:m(e,"spinRandomMin",1e3)+-1e3,spinRandomMax:m(e,"spinRandomMax",1e3)+-1e3,useInvAlpha:p(e,"useInvAlpha",!1),keys:i,textureName:r}}(i)}:null}function h(e,t){return e+(2*Math.random()-1)*t}function g(e,t,i,r,a,o,n){let s=Math.cos(n),l=Math.sin(n),c=e*r+t*a+i*o;return[e*s+(a*i-o*t)*l+r*c*(1-s),t*s+(o*e-r*i)*l+a*c*(1-s),i*s+(r*t-a*e)*l+o*c*(1-s)]}class y{data;particles=[];maxParticles;internalClock=0;nextParticleTime=0;emitterAge=0;emitterLifetime;emitterDead=!1;constructor(e,t=256,i){this.data=e,this.maxParticles=t;let r=i??e.lifetimeMS;!i&&e.lifetimeVarianceMS>0&&(r+=Math.round(h(0,e.lifetimeVarianceMS))),this.emitterLifetime=r}emitBurst(e,t,i=[0,0,1]){for(let r=0;r0;){if(this.nextParticleTime>0){let e=Math.min(r,this.nextParticleTime);this.nextParticleTime-=e,r-=e,this.internalClock+=e;continue}if(this.particles.length0)){let e=this.particles[this.particles.length-1];e.currentAge+=r,e.currentAge>=e.totalLifetime&&this.particles.pop()}let t=this.data.ejectionPeriodMS;this.data.periodVarianceMS>0&&(t+=Math.round(h(0,this.data.periodVarianceMS))),this.nextParticleTime=Math.max(1,t)}}update(e){this.emitterAge+=e,this.emitterLifetime>0&&this.emitterAge>this.emitterLifetime&&(this.emitterDead=!0);let t=e/1e3,i=this.data.particles;for(let r=this.particles.length-1;r>=0;r--){let a=this.particles[r];if(a.currentAge+=e,a.currentAge>=a.totalLifetime){this.particles[r]=this.particles[this.particles.length-1],this.particles.pop();continue}let o=i.dragCoefficient,n=i.gravityCoefficient,s=a.acc[0]-a.vel[0]*o,l=a.acc[1]-a.vel[1]*o,c=a.acc[2]-a.vel[2]*o+-9.81*n;a.vel[0]+=s*t,a.vel[1]+=l*t,a.vel[2]+=c*t,a.pos[0]+=a.vel[0]*t,a.pos[1]+=a.vel[1]*t,a.pos[2]+=a.vel[2]*t;let u=a.currentAge/a.totalLifetime,m=function(e,t){for(let i=1;i=t){let r=e[i-1],a=e[i],o=a.time-r.time,n=o>0?(t-r.time)/o:0;return{r:r.r+(a.r-r.r)*n,g:r.g+(a.g-r.g)*n,b:r.b+(a.b-r.b)*n,a:r.a+(a.a-r.a)*n,size:r.size+(a.size-r.size)*n}}let i=e[e.length-1];return{r:i.r,g:i.g,b:i.b,a:i.a,size:i.size}}(i.keys,u);a.r=m.r,a.g=m.g,a.b=m.b,a.a=m.a,a.size=m.size,a.currentSpin=a.spinSpeed*a.currentAge*d}}isDead(){return this.emitterDead&&0===this.particles.length}kill(){this.emitterDead=!0}addParticle(e,t){var i,r,a,o;let n,s,l,c,d=this.data,m=d.particles,p=t[0],f=t[1],y=t[2],S=(i=p,r=f,.9>Math.abs(a=y)?(n=r,s=-i,l=0):(n=-a,s=0,l=i),(c=Math.sqrt(n*n+s*s+l*l))<1e-8?[1,0,0]:[n/c,s/c,l/c]),v=(d.thetaMin+Math.random()*(d.thetaMax-d.thetaMin))*u,b=(this.internalClock/1e3*d.phiReferenceVel+Math.random()*d.phiVariance)*u;[p,f,y]=g(p,f,y,S[0],S[1],S[2],v),[p,f,y]=g(p,f,y,t[0],t[1],t[2],b);let M=Math.sqrt(p*p+f*f+y*y);M>1e-8&&(p/=M,f/=M,y/=M);let x=h(d.ejectionVelocity,d.velocityVariance),w=[e[0]+p*d.ejectionOffset,e[1]+f*d.ejectionOffset,e[2]+y*d.ejectionOffset],T=[p*x,f*x,y*x],A=m.constantAcceleration,P=[T[0]*A,T[1]*A,T[2]*A],k=m.lifetimeMS;m.lifetimeVarianceMS>0&&(k+=Math.round(h(0,m.lifetimeVarianceMS))),k=Math.max(1,k);let C=m.spinSpeed+((o=m.spinRandomMin)+Math.random()*(m.spinRandomMax-o)),D=m.keys[0];this.particles.push({pos:w,vel:T,acc:P,orientDir:[p,f,y],currentAge:0,totalLifetime:k,dataIndex:0,spinSpeed:C,currentSpin:0,r:D.r,g:D.g,b:D.b,a:D.a,size:D.size})}}let S=` +// 'position' is auto-declared by Three.js for ShaderMaterial. +attribute vec4 particleColor; +attribute float particleSize; +attribute float particleSpin; +attribute vec2 quadCorner; // (-0.5,-0.5) to (0.5,0.5) +attribute vec3 orientDir; + +uniform bool uOrientParticles; +// cameraPosition is a built-in Three.js uniform. + +varying vec2 vUv; +varying vec4 vColor; + +void main() { + vUv = quadCorner + 0.5; // [0,1] range + vColor = particleColor; + + if (uOrientParticles) { + if (length(orientDir) < 0.0001) { + // V12: don't render oriented particles with zero velocity. + gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + return; + } + // V12 oriented particle: quad aligned along direction, facing camera. + vec3 worldPos = (modelMatrix * vec4(position, 1.0)).xyz; + vec3 dir = normalize(orientDir); + vec3 dirFromCam = worldPos - cameraPosition; + vec3 crossDir = normalize(cross(dirFromCam, dir)); + + // V12 maps U along dir (velocity) — match by using quadCorner.x for dir. + vec3 offset = dir * quadCorner.x + crossDir * quadCorner.y; + worldPos += offset * particleSize; + + gl_Position = projectionMatrix * viewMatrix * vec4(worldPos, 1.0); + } else { + // Standard camera-facing billboard. + vec3 viewPos = (modelViewMatrix * vec4(position, 1.0)).xyz; + + // Apply spin rotation to quad corner. + float c = cos(particleSpin); + float s = sin(particleSpin); + vec2 rotated = vec2( + c * quadCorner.x - s * quadCorner.y, + s * quadCorner.x + c * quadCorner.y + ); + + // Offset in view space (camera-facing billboard). + viewPos.xy += rotated * particleSize; + + gl_Position = projectionMatrix * vec4(viewPos, 1.0); + } +} +`,v=` +uniform sampler2D particleTexture; +uniform bool hasTexture; +uniform float debugOpacity; + +varying vec2 vUv; +varying vec4 vColor; + +void main() { + if (hasTexture) { + vec4 texColor = texture2D(particleTexture, vUv); + gl_FragColor = texColor * vColor; + } else { + gl_FragColor = vColor; + } + gl_FragColor.a *= debugOpacity; +} +`;var b=e.i(25645),M=e.i(79123),x=e.i(51434),w=e.i(29055),T=e.i(58647);let A=(0,b.createLogger)("ParticleEffects"),P=new Float32Array([-.5,-.5,.5,-.5,.5,.5,-.5,.5]),k=new Map,C=new Set,D=new o.DataTexture(new Uint8Array([255,255,255,255]),1,1,o.RGBAFormat,o.UnsignedByteType);function I(e){if(!e)return D;let t=k.get(e);if(t)return t;try{let t=(0,l.textureToUrl)(e),i=(0,c.loadTexture)(t,e=>{(0,n.setupEffectTexture)(e),C.add(e)});return(0,n.setupEffectTexture)(i),k.set(e,i),i}catch{return D}}D.needsUpdate=!0;let B=new o.SphereGeometry(1,6,6),N=new o.MeshBasicMaterial({color:0xff0000,wireframe:!0}),E=new o.BoxGeometry(.3,.3,.3),R=new o.MeshBasicMaterial({color:65280,wireframe:!0}),V=new o.SphereGeometry(1,12,8),F=` + attribute vec4 vertexColor; + attribute vec2 texCoord; + varying vec4 vColor; + varying vec2 vUV; + void main() { + vColor = vertexColor; + vUV = texCoord; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } +`,_=` + uniform sampler2D uTexture; + varying vec4 vColor; + varying vec2 vUV; + void main() { + vec4 tex = texture2D(uTexture, vUV); + gl_FragColor = vec4(vColor.rgb * tex.rgb, vColor.a * tex.a); + } +`;function O(e){let t=(e+1)*2,i=new Float32Array(3*t),r=new Float32Array(2*t),a=new Float32Array(4*t),n=new Uint16Array(6*e);for(let t=0;t{let i=Q.current,r=D.current;if(!i||!r)return;let a=T.engineStore.getState().playback,n="playing"===a.status,s=n?t*a.rate:0,c=1e3*s,u=k.getDataBlockData.bind(k);for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position||X.current.has(e.id))continue;X.current.add(e.id);let t=function(e,t){let i=t(e);if(!i)return null;let r=[],a=[],o=i.particleEmitter;if("number"==typeof o){let e=t(o);if(e){let a=f(e,t);if(a){let e=i.particleDensity??10;r.push({data:a,density:e})}}}let n=i.emitters;if(Array.isArray(n))for(let e of n){if("number"!=typeof e)continue;let i=t(e);if(!i)continue;let r=f(i,t);r&&a.push(r)}return 0===r.length&&0===a.length?null:{burstEmitters:r,streamingEmitters:a,lifetimeMS:32*(i.lifetimeMS??31)}}(e.explosionDataBlockId,u);if(!t)continue;let r=[...e.position];for(let e of t.burstEmitters){let t=new y(e.data,256);t.emitBurst(r,e.density);let a=I(e.data.particles.textureName),n=U(256),s=j(a,e.data.particles.useInvAlpha,e.data.orientParticles),l=new o.Mesh(n,s);l.frustumCulled=!1,i.add(l),J.current.push({emitter:t,mesh:l,geometry:n,material:s,targetTexture:a,origin:r,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let a=new y(e,256,t.lifetimeMS),n=I(e.particles.textureName),s=U(256),l=j(n,e.particles.useInvAlpha,e.orientParticles),c=new o.Mesh(s,l);c.frustumCulled=!1,i.add(c),J.current.push({emitter:a,mesh:c,geometry:s,material:l,targetTexture:n,origin:r,isBurst:!1,hasBurst:!1})}let a=u(e.explosionDataBlockId);if(q){let n=a?function(e){let t=e.sizes;if(Array.isArray(t)&&t.length>0){let e=0;for(let i of t)e=Math.max(e,i.x,i.y,i.z);if(e>0)return e/1e3}let i=e.particleRadius;return"number"==typeof i&&i>0?i:5}(a):5,s=function(e){if(!e)return 0xff00ff;let t=e.toLowerCase();return t.includes("disc")?4491519:t.includes("grenade")?0xff8800:t.includes("mortar")?0xff4400:t.includes("plasma")?4521796:t.includes("laser")?0xff2222:t.includes("blaster")?0xffff00:t.includes("missile")?0xff6600:t.includes("bomb")?0xff0000:t.includes("mine")?0xff8844:t.includes("concussion")?0xffaa00:t.includes("shocklance")?8930559:t.includes("chaingun")||t.includes("bullet")?0xcccccc:0xff00ff}(e.dataBlock),l=new o.MeshBasicMaterial({color:s,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new o.Mesh(V,l);c.frustumCulled=!1,c.scale.setScalar(n),c.position.set(r[1],r[2],r[0]),i.add(c);let{sprite:u,material:d}=function(e,t){let i=document.createElement("canvas"),r=i.getContext("2d");r.font="bold 32px monospace",i.width=Math.ceil(r.measureText(e).width)+16,i.height=48,r.font="bold 32px monospace",r.fillStyle=`#${t.toString(16).padStart(6,"0")}`,r.textBaseline="middle",r.fillText(e,8,i.height/2);let a=new o.CanvasTexture(i),n=new o.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),s=new o.Sprite(n),l=i.width/i.height;return s.scale.set(2*l,2,1),{sprite:s,material:n}}(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,s);u.position.set(r[1],r[2]+n+2,r[0]),u.frustumCulled=!1,i.add(u),ei.current.push({entityId:e.id,mesh:c,material:l,label:u,labelMaterial:d,creationTime:(0,T.effectNow)(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:n})}let n=a?.shockwave;if("number"==typeof n){let t=function(e,t){let i=t(e);if(!i)return null;let r=i.colors??[],a=i.times??[0,.5,1,1];return{width:i.width??1,numSegments:Math.max(i.numSegments??16,4),velocity:i.velocity??0,height:i.height??0,verticalCurve:i.verticalCurve??0,acceleration:i.acceleration??0,texWrap:i.texWrap??1,lifetimeMS:i.lifetimeMS??500,is2D:!!i.is2D,renderSquare:!!i.renderSquare,renderBottom:!!i.renderBottom,mapToTerrain:!!i.mapToTerrain,colors:r,times:a,textureName:i.textureName??"",mapToTexture:i.mapToTexture??""}}(n,u);if(t){let a=I(t.textureName),n=O(t.numSegments),s=new o.ShaderMaterial({vertexShader:F,fragmentShader:_,uniforms:{uTexture:{value:a}},transparent:!0,depthWrite:!1,blending:o.AdditiveBlending,side:o.DoubleSide}),l=new o.Mesh(n,s);l.frustumCulled=!1,l.position.set(r[1],r[2],r[0]),i.add(l);let c=null,u=null;t.renderBottom&&(u=O(t.numSegments),(c=new o.Mesh(u,s)).frustumCulled=!1,c.position.set(r[1],r[2],r[0]),c.scale.y=-1,i.add(c));let d=Math.abs(t.velocity)>1e-10?t.velocity:0;er.current.push({entityId:e.id,mesh:l,bottomMesh:c,geometry:n,bottomGeometry:u,material:s,creationTime:(0,T.effectNow)(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:d})}}}let d=new Set;for(let e of r.entities){if(d.add(e.id),!e.maintainEmitterId||Z.current.has(e.id))continue;Z.current.add(e.id);let t=u(e.maintainEmitterId);if(!t)continue;let r=f(t,u);if(!r)continue;let a=e.position?[...e.position]:[0,0,0],n=new y(r,256),s=I(r.particles.textureName),l=U(256),c=j(s,r.particles.useInvAlpha,r.orientParticles),m=new o.Mesh(l,c);m.frustumCulled=!1,i.add(m),J.current.push({emitter:n,mesh:m,geometry:l,material:c,targetTexture:s,origin:a,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of J.current)e.followEntityId&&!d.has(e.followEntityId)&&e.emitter.kill();for(let e of Z.current)d.has(e)||Z.current.delete(e);let m=J.current;for(let e=m.length-1;e>=0;e--){let t=m[e];if(t.shaderChecked||(!function(e,t,i){let r=e.properties.get(t).currentProgram;if(!r)return;let a=r.program,o=e.getContext();o.getProgramParameter(a,o.LINK_STATUS)||A.error("Shader LINK ERROR (%s): %s",i,o.getProgramInfoLog(a))}(Y,t.material,t.isBurst?"burst":"stream"),t.shaderChecked=!0),t.followEntityId){let e=r.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,c,t.emitAxis),t.emitter.update(c),C.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=q?.2:1,!function(e){let t=e.emitter.particles,i=e.geometry,r=i.getAttribute("position"),a=i.getAttribute("particleColor"),o=i.getAttribute("particleSize"),n=i.getAttribute("particleSpin"),s=i.getAttribute("orientDir"),l=r.array,c=a.array,u=o.array,d=n.array,m=s.array,p=Math.min(t.length,256),f=e.emitter.data.orientOnVelocity;for(let e=0;e=0;e--){let t=p[e],r=Math.min((h-t.creationTime)/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),p.splice(e,1))}let g=er.current;for(let t=g.length-1;t>=0;t--){let r=g[t],a=Math.min((h-r.creationTime)/r.lifetimeMS,1);r.velocity=r.velocity+r.data.acceleration*s,r.radius=r.radius+r.velocity*s;let o=function(e,t){let{colors:i,times:r}=e;if(0===i.length)return[1,1,1,1];let a=0;for(let e=0;e=r[e]&&(a=e);let o=Math.min(a+1,i.length-1),n=r[a]??0,s=(r[o]??1)-n,l=s>0?Math.min((t-n)/s,1):0,c=i[a]??i[0],u=i[o]??i[0];return[c.r+(u.r-c.r)*l,c.g+(u.g-c.g)*l,c.b+(u.b-c.b)*l,c.a+(u.a-c.a)*l]}(r.data,a);z(r.geometry,r.data,r.radius,o,r.data.is2D),r.bottomGeometry&&z(r.bottomGeometry,r.data,r.radius,o,r.data.is2D),r.data.is2D&&r.mesh.lookAt(e.camera.position),a>=1&&(i.remove(r.mesh),r.bottomMesh&&i.remove(r.bottomMesh),r.geometry.dispose(),r.bottomGeometry?.dispose(),r.material.dispose(),g.splice(t,1))}if(n&&H&&K&&$&&Q.current){for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(et.current.has(t))continue;et.current.add(t);let i=u(e.explosionDataBlockId);if(!i)continue;let r=i.soundProfile;if("number"!=typeof r)continue;let a=(0,w.resolveAudioProfile)(r,u);if(!a)continue;let n=new o.Vector3(e.position[1],e.position[2],e.position[0]);(0,w.playOneShotSound)(a,$,K,n,Q.current)}let e=ee.current;for(let t of r.entities){if("Projectile"!==t.type||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=20)continue;let i=u(t.dataBlockId);if(!i)continue;let r=i.sound;if("number"!=typeof r)continue;let n=(0,w.resolveAudioProfile)(r,u);if(n&&n.isLooping&&n.is3D)try{let i=(0,l.audioToUrl)(n.filename),r=(0,w.getSoundGeneration)();(0,w.getCachedAudioBuffer)(i,K,i=>{if(r!==(0,w.getSoundGeneration)()||!d.has(t.id)||e.has(t.id))return;let s=Q.current;if(!s)return;let l=new o.PositionalAudio($);l.setBuffer(i),l.setDistanceModel("inverse"),l.setRefDistance(n.refDist),l.setMaxDistance(n.maxDist),l.setRolloffFactor(1),l.setVolume(n.volume),l.setPlaybackRate(a.rate),l.setLoop(!0),l.position.set(t.position[1],t.position[2],t.position[0]),s.add(l),(0,w.trackSound)(l),l.play(),e.set(t.id,l)})}catch{}}for(let[t,i]of e)if(!d.has(t)){(0,w.untrackSound)(i);try{i.stop()}catch{}try{i.disconnect()}catch{}Q.current?.remove(i),e.delete(t)}for(let e of r.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??""}`;if(et.current.has(t))continue;et.current.add(t);let i=(0,w.resolveAudioProfile)(e.profileId,u);if(!i)continue;let r=e.position?new o.Vector3(e.position.y,e.position.z,e.position.x):void 0;(0,w.playOneShotSound)(i,$,K,r,Q.current)}}if(X.current.size>500){let e=new Set(r.entities.map(G));for(let t of X.current)e.has(t)||X.current.delete(t)}if(et.current.size>500){let e=new Set(r.entities.map(L));for(let t of et.current)t.startsWith("snd:")&&e.has(t.slice(4))||et.current.delete(t)}},P[7]=H,P[8]=$,P[9]=K,P[10]=q,P[11]=Y,P[12]=k,P[13]=D,P[14]=g):g=P[14],(0,a.useFrame)(g),P[15]===Symbol.for("react.memo_cache_sentinel")?(v=()=>()=>{let e=Q.current;for(let t of J.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let i of t.debugParticleMeshes)e.remove(i);t.geometry.dispose(),t.material.dispose()}for(let t of(J.current=[],ei.current))e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();for(let t of(ei.current=[],er.current))e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();for(let[,t]of(er.current=[],X.current.clear(),Z.current.clear(),ee.current)){(0,w.untrackSound)(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}ee.current.clear(),et.current.clear()},S=[],P[15]=S,P[16]=v):(S=P[15],v=P[16]),(0,r.useEffect)(v,S),P[17]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)("group",{ref:Q}),P[17]=b):b=P[17],b}function L(e){return e.id}function G(e){return e.id}function W(e){return e.gl}var H=e.i(9721),K=e.i(92224),$=e.i(93784);function Y(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}var Q=e.i(77964);let J=new WeakMap;function X(e){let t=J.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),J.set(e,t)),t}let Z=new o.Vector3,ee=new o.Quaternion,et=new o.Quaternion,ei=new o.Quaternion(0,1,0,0),er=new o.Vector3,ea=new o.Vector3,eo=new o.Vector3;function en(e){let s,l,c,u,d,m,p,f,h,g=(0,i.c)(25),{recording:y}=e,S=(0,T.useEngineStoreApi)(),v=(0,r.useRef)(0),b=(0,r.useRef)(null),M=(0,r.useRef)(null);g[0]===Symbol.for("react.memo_cache_sentinel")?(s=new o.Vector3(0,n.DEFAULT_EYE_HEIGHT,0),g[0]=s):s=g[0];let x=(0,r.useRef)(s),A=(0,r.useRef)(y.streamingPlayback??null),P=(0,r.useRef)(null);g[1]===Symbol.for("react.memo_cache_sentinel")?(l=new Map,g[1]=l):l=g[1];let k=(0,r.useRef)(l),C=(0,r.useRef)(null),[D,I]=(0,r.useState)(null);g[2]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{if(e===C.current)return;C.current=e;let t=k.current,i=new Map;for(let a of e.entities){let o=t.get(a.id),n=o&&("Shape"===o.renderType||"Player"===o.renderType||"Explosion"===o.renderType);if(!o||o.className!==(a.className??a.type)||o.ghostIndex!==a.ghostIndex||o.dataBlockId!==a.dataBlockId||o.shapeHint!==a.shapeHint||n&&null!=a.dataBlock&&o.shapeName!==a.dataBlock||"Player"!==o.renderType&&n&&o.weaponShape!==a.weaponShape)o=function(e,t){if(e.sceneData){let i={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case"TerrainBlock":return{...i,renderType:"TerrainBlock",terrainData:e.sceneData};case"InteriorInstance":return{...i,renderType:"InteriorInstance",interiorData:e.sceneData};case"Sky":return{...i,renderType:"Sky",skyData:e.sceneData};case"Sun":return{...i,renderType:"Sun",sunData:e.sceneData};case"WaterBlock":return{...i,renderType:"WaterBlock",waterData:e.sceneData};case"MissionArea":return{...i,renderType:"MissionArea",missionAreaData:e.sceneData};case"TSStatic":return{...Y(e,t),renderType:"Shape",shapeName:e.sceneData.shapeName,shapeType:"TSStatic",dataBlock:e.dataBlock}}}return e.visual?.kind==="tracer"?{...Y(e,t),renderType:"Tracer",visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind==="sprite"?{...Y(e,t),renderType:"Sprite",visual:e.visual}:"Player"===e.type?{...Y(e,t),renderType:"Player",shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,flagShape:e.flagShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:"Explosion"===e.type?{...Y(e,t),renderType:"Explosion",shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:"ForceFieldBare"===e.className?{...Y(e,t),renderType:"ForceFieldBare"}:"AudioEmitter"===e.className?{...Y(e,t),renderType:"AudioEmitter",audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:"WayPoint"===e.className?{...Y(e,t),renderType:"WayPoint",label:e.label}:"Camera"===e.className?{...Y(e,t),renderType:"Camera"}:{...Y(e,t),renderType:"Shape",shapeName:e.dataBlock,shapeType:"Turret"===e.className?"Turret":"Item"===e.className?"Item":"StaticShape",dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor}}(a,e.timeSec);else{var r=o;switch(r.renderType){case"Player":r.threads=a.threads,r.weaponShape=a.weaponShape,r.packShape=a.packShape,r.flagShape=a.flagShape,r.falling=a.falling,r.jetting=a.jetting,r.weaponImageState=a.weaponImageState,r.weaponImageStates=a.weaponImageStates,r.playerName=a.playerName,r.iffColor=a.iffColor,r.headPitch=a.headPitch,r.headYaw=a.headYaw,r.targetRenderFlags=a.targetRenderFlags;break;case"Shape":r.threads=a.threads,r.targetRenderFlags=a.targetRenderFlags,r.iffColor=a.iffColor}}if(i.set(a.id,o),(0,Q.isSceneEntity)(o)||"None"===o.renderType)continue;let s=o.keyframes;0===s.length&&s.push({time:e.timeSec,position:a.position??[0,0,0],rotation:a.rotation??[0,0,0,1]});let l=s[0];l.time=e.timeSec,a.position&&(l.position=a.position),a.rotation&&(l.rotation=a.rotation),l.velocity=a.velocity,l.health=a.health,l.energy=a.energy,l.actionAnim=a.actionAnim,l.actionAtEnd=a.actionAtEnd,l.damageState=a.damageState}for(let[r,a]of t)if(!i.has(r)&&"Explosion"===a.renderType&&a.shapeName&&null!=a.spawnTime&&e.timeSec-a.spawnTime<5){i.set(r,a);continue}let a=i.size!==t.size||[...i.keys()].some(e=>!t.has(e));k.current=i,a&&K.gameEntityStore.getState().setAllStreamEntities(Array.from(i.values()));let o=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId),r=t?t.shapeName:void 0;r&&(o=r)}I(e=>e===o?e:o)},g[2]=c):c=g[2];let B=c;return g[3]!==S||g[4]!==y.gameType||g[5]!==y.missionName||g[6]!==y.recorderName||g[7]!==y.recordingDate||g[8]!==y.serverDisplayName||g[9]!==y.source||g[10]!==y.streamingPlayback?(u=()=>{(0,w.stopAllTrackedSounds)(),A.current=y.streamingPlayback??null,k.current=new Map,C.current=null,P.current=null,(0,$.resetStreamPlayback)(),v.current=0,b.current=null,M.current=null;let e=A.current;if($.streamPlaybackStore.setState({playback:e}),K.gameEntityStore.getState().beginStreaming(y.source),!e)return void S.getState().setPlaybackStreamSnapshot(null);e.onMissionInfoChange=()=>{K.gameEntityStore.getState().setMissionInfo({missionDisplayName:e.missionDisplayName??void 0,missionTypeDisplayName:e.missionTypeDisplayName??void 0,gameClassName:e.gameClassName??void 0,recorderName:e.connectedPlayerName??void 0})};let t=e.missionDisplayName,i=e.missionTypeDisplayName,r=e.gameClassName,a=e.serverDisplayName,o=e.connectedPlayerName;"live"!==y.source&&e.reset(),e.missionDisplayName=t,e.missionTypeDisplayName=i,e.gameClassName=r,e.serverDisplayName=a,e.connectedPlayerName=o,K.gameEntityStore.getState().setMissionInfo({missionName:y.missionName??void 0,missionTypeDisplayName:y.gameType??void 0,missionDisplayName:t??void 0,gameClassName:r??void 0,serverDisplayName:a??y.serverDisplayName??void 0,recorderName:o??y.recorderName??void 0,recordingDate:y.recordingDate??void 0});let n=e.getSnapshot();return $.streamPlaybackStore.setState({time:n.timeSec}),v.current=n.timeSec,b.current=n,M.current=n,B(n),S.getState().setPlaybackStreamSnapshot(n),P.current=n,()=>{(0,w.stopAllTrackedSounds)(),A.current=null,(0,$.resetStreamPlayback)()}},g[3]=S,g[4]=y.gameType,g[5]=y.missionName,g[6]=y.recorderName,g[7]=y.recordingDate,g[8]=y.serverDisplayName,g[9]=y.source,g[10]=y.streamingPlayback,g[11]=u):u=g[11],g[12]!==S||g[13]!==y?(d=[y,S,B],g[12]=S,g[13]=y,g[14]=d):d=g[14],(0,r.useEffect)(u,d),g[15]!==S||g[16]!==y.source?(m=(e,t)=>{let i=A.current;if(!i)return;let r=S.getState(),a=r.playback,o="playing"===a.status,s=a.timeMs/1e3,l=!o&&Math.abs(s-v.current)>5e-4,c=o&&Math.abs(s-$.streamPlaybackStore.getState().time)>.05,u=l||c;u&&(v.current=s),o&&((0,T.advanceEffectClock)(t,a.rate),v.current=v.current+t*a.rate);let d=Math.max(1,Math.ceil(1e3*t*Math.max(a.rate,.01)/32)+2),m=v.current+n.STREAM_TICK_SEC,p=i.stepToTime(m,o&&!u?d:1/0),f=M.current;!f||p.timeSec1.5*n.STREAM_TICK_SEC?(b.current=p,M.current=p):p.timeSec!==f.timeSec&&(b.current=f,M.current=p);let h=M.current??p,g=b.current??h,w=h.timeSec-n.STREAM_TICK_SEC,C=Math.max(0,Math.min(1,(v.current-w)/n.STREAM_TICK_SEC));$.streamPlaybackStore.setState({time:v.current}),p.exhausted&&o&&(v.current=Math.min(v.current,p.timeSec)),B(h),$.streamPlaybackStore.getState().entities=k.current,h!==P.current&&(P.current=h,r.setPlaybackStreamSnapshot(h));let D=h.camera,I=D&&g.camera&&g.camera.mode===D.mode&&g.camera.controlEntityId===D.controlEntityId&&g.camera.orbitTargetId===D.orbitTargetId?g.camera:null,N=$.streamPlaybackStore.getState().freeFlyCamera,E="live"===y.source;if(D&&!N){if(I){let t=I.position[0],i=I.position[1],r=I.position[2],a=D.position[0],o=D.position[1],n=D.position[2];e.camera.position.set(i+(o-i)*C,r+(n-r)*C,t+(a-t)*C),E||(ee.set(...I.rotation),et.set(...D.rotation),ee.slerp(et,C),e.camera.quaternion.copy(ee))}else e.camera.position.set(D.position[1],D.position[2],D.position[0]),E||e.camera.quaternion.set(...D.rotation);if(Number.isFinite(D.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,i=I&&Number.isFinite(I.fov)?I.fov+(D.fov-I.fov)*C:D.fov,r=(0,n.torqueHorizontalFovToThreeVerticalFov)(i,t.aspect);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let R=X(h),V=X(g),F=k.current,_=$.streamPlaybackStore.getState().root;if(_)for(let t of _.children){let i=F.get(t.name);if(i&&(0,Q.isSceneEntity)(i))continue;let r=R.get(t.name);if(!r){let e=i&&"keyframes"in i?i.keyframes:void 0;if(e?.[0]?.position){let i=e[0];t.visible=!0,t.position.set(i.position[1],i.position[2],i.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=V.get(t.name);if(a?.position){let e=a.position[0],i=a.position[1],o=a.position[2],n=r.position[0],s=r.position[1],l=r.position[2],c=e+(n-e)*C,u=i+(s-i)*C,d=o+(l-o)*C;t.position.set(u,d,c)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(ei):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(ee.set(...a.rotation),et.set(...r.rotation),ee.slerp(et,C),t.quaternion.copy(ee)):t.quaternion.set(...r.rotation))}let O=D?.mode;if(!N&&!E&&"third-person"===O&&_&&D?.orbitTargetId){let t=_.children.find(e=>e.name===D.orbitTargetId);if(t){let i=R.get(D.orbitTargetId);ea.copy(t.position),i?.type==="Player"&&(ea.y=ea.y+1);let r=!1;if(D.orbitDirection)er.set(D.orbitDirection[0],D.orbitDirection[1],D.orbitDirection[2]),r=er.lengthSq()>1e-8;else if("number"==typeof D.yaw&&"number"==typeof D.pitch){let e=Math.sin(D.pitch),t=Math.cos(D.pitch),i=Math.sin(D.yaw),a=Math.cos(D.yaw);er.set(-a*t,-e,-i*t),r=er.lengthSq()>1e-8}if(r||(er.copy(e.camera.position).sub(ea),r=er.lengthSq()>1e-8),r){er.normalize();let t=Math.max(.1,D.orbitDistance??4);eo.copy(ea).addScaledVector(er,t),e.camera.position.copy(eo),e.camera.lookAt(ea)}}}if(!N&&"first-person"===O&&_&&D?.controlEntityId){let t=_.children.find(e=>e.name===D.controlEntityId);t?(Z.copy(x.current).applyQuaternion(t.quaternion),e.camera.position.add(Z)):e.camera.position.y=e.camera.position.y+x.current.y}o&&p.exhausted&&r.setPlaybackStatus("paused");let z=1e3*v.current;Math.abs(z-a.timeMs)>.5&&r.setPlaybackTime(z)},g[15]=S,g[16]=y.source,g[17]=m):m=g[17],(0,a.useFrame)(m),g[18]!==y.streamingPlayback?(p=(0,t.jsx)(q,{playback:y.streamingPlayback,snapshotRef:M}),g[18]=y.streamingPlayback,g[19]=p):p=g[19],g[20]!==D?(f=D&&(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(H.PlayerEyeOffset,{shapeName:D,eyeOffsetRef:x})}),g[20]=D,g[21]=f):f=g[21],g[22]!==p||g[23]!==f?(h=(0,t.jsxs)(t.Fragment,{children:[p,f]}),g[22]=p,g[23]=f,g[24]=h):h=g[24],h}e.s(["StreamingController",()=>en],51295)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/fd10b9633e3b5488.js b/docs/_next/static/chunks/fd10b9633e3b5488.js new file mode 100644 index 00000000..4a534abe --- /dev/null +++ b/docs/_next/static/chunks/fd10b9633e3b5488.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(15080),o=e.i(71753),u=e.i(90072),i=e.i(25645),c=e.i(12979),a=e.i(51434),s=e.i(79123),l=e.i(89887),f=e.i(58647);let d=(0,i.createLogger)("AudioEmitter"),h=new Map,p=new Map;function y(e,t=1){p.set(e,t)}function m(e){p.delete(e)}let g=0;function S(){return g}function R(){for(let[e]of(g++,p)){try{e.stop()}catch{}try{e.disconnect()}catch{}}p.clear()}function b(e,t){let r=t(e),n=r?.filename;if(!n)return null;let o=n.endsWith(".wav")?n:`${n}.wav`,u=r.description,i=null!=u?t(u):void 0,c=i?.is3D??!0,a=i?.isLooping??!1,s=i?.referenceDistance??20;return{filename:o,is3D:c,isLooping:a,refDist:s,maxDist:i?.maxDistance??100,volume:i?.volume??1}}function M(e,t,r,n,o){let i;try{i=(0,c.audioToUrl)(e.filename)}catch{return}let a=f.engineStore.getState().playback.rate,s=g;v(i,r,r=>{if(s===g)try{if(e.is3D&&o){let i=new u.PositionalAudio(t);i.setBuffer(r),i.setDistanceModel("inverse"),i.setRefDistance(e.refDist),i.setMaxDistance(e.maxDist),i.setRolloffFactor(1),i.setVolume(e.volume),i.setPlaybackRate(a),n&&i.position.copy(n),o.add(i),p.set(i,1),i.play(),i.source.onended=()=>{p.delete(i);try{i.disconnect()}catch{}o.remove(i)}}else{let n=new u.Audio(t);n.setBuffer(r),n.setVolume(e.volume),n.setPlaybackRate(a),p.set(n,1),n.play(),n.source.onended=()=>{p.delete(n);try{n.disconnect()}catch{}}}}catch{}})}function v(e,t,r){h.has(e)?r(h.get(e)):t.load(e,t=>{h.set(e,t),r(t)},void 0,t=>{d.error("Audio load error %s: %o",e,t)})}f.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,r]of p)try{t.setPlaybackRate(r*e)}catch{}});let D=(0,r.memo)(function({entity:e}){let{debugMode:i}=(0,s.useDebug)(),f=e.audioFileName??"",d=e.audioVolume??1,h=e.audioMinDistance??1,p=e.audioMaxDistance??1,y=e.audioMinLoopGap??0,m=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,S=e.audioIsLooping??!0,[R,b,M]=e.position??[0,0,0],D=(0,n.useThree)(e=>e.scene),k=(0,n.useThree)(e=>e.camera),{audioLoader:A,audioListener:T}=(0,a.useAudio)(),{audioEnabled:P}=(0,s.useSettings)(),w=(0,r.useRef)(null),x=(0,r.useRef)(null),B=(0,r.useRef)(null),E=(0,r.useRef)(!1),L=(0,r.useRef)(!1),C=(0,r.useRef)(new u.Vector3(R,b,M)),G=(0,r.useRef)(0),V=()=>{null!=x.current&&(clearTimeout(x.current),x.current=null),null!=B.current&&(clearTimeout(B.current),B.current=null)},[j]=(0,r.useState)(()=>Math.random());(0,r.useEffect)(()=>{let e;if(A&&T){if(G.current++,g){let t=new u.PositionalAudio(T);t.position.copy(C.current),t.setDistanceModel("inverse"),t.setRefDistance(h),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(d),e=t,D.add(e)}else(e=new u.Audio(T)).setVolume(d);return w.current=e,()=>{V();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&D.remove(e),w.current=null,E.current=!1,L.current=!1}}},[A,T,g,h,p,d,D]);let F=(e,t)=>{if(S)if(y>0||m>0){let r=Math.max(0,y),n=Math.max(r,m),o=r===n?r:j*(n-r)+r;e.loop=!1;let u=()=>{t===G.current&&(!1===e.isPlaying?x.current=setTimeout(()=>{if(t===G.current)try{e.play(),F(e,t)}catch{}},o):B.current=setTimeout(u,100))};B.current=setTimeout(u,100)}else e.setLoop(!0)},U=(0,r.useEffectEvent)(e=>{if(!A)return;let t=G.current;if(E.current)try{e.isPlaying||(e.play(),F(e,t))}catch{}else{let r;try{r=(0,c.audioToUrl)(f)}catch{return}v(r,A,r=>{if(t===G.current&&!e.buffer){e.setBuffer(r),E.current=!0;try{e.play(),F(e,t)}catch{}}})}});return(0,r.useEffect)(()=>{let e=w.current;e&&!g&&P&&f&&U(e)},[P,g,f,A,T]),(0,o.useFrame)(()=>{let e=w.current;if(!e||!g||!P||!f)return;let t=k.position.distanceTo(C.current),r=L.current,n=t<=p;if(n&&!r)L.current=!0,U(e);else if(!n&&r){L.current=!1,V();try{e.stop()}catch{}}}),(0,r.useEffect)(()=>{let e=w.current;if(e&&!P){V();try{e.stop()}catch{}L.current=!1}},[P]),i?(0,t.jsxs)("mesh",{position:C.current,children:[(0,t.jsx)("sphereGeometry",{args:[h,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(l.FloatingLabel,{color:"#00ff00",position:[0,h+1,0],children:f})]}):null});e.s(["AudioEmitter",0,D,"audioBufferCache",0,h,"getCachedAudioBuffer",()=>v,"getSoundGeneration",()=>S,"playOneShotSound",()=>M,"resolveAudioProfile",()=>b,"stopAllTrackedSounds",()=>R,"trackSound",()=>y,"untrackSound",()=>m])},9962,e=>{"use strict";var t=e.i(71645),r=e.i(90072),n=e.i(12979),o=e.i(51434),u=e.i(29055),i=e.i(79123),c=e.i(58647);function a(){let{audioLoader:e,audioListener:a}=(0,o.useAudio)(),{audioEnabled:s}=(0,i.useSettings)(),l=(0,c.useEngineSelector)(e=>e.playback.streamSnapshot?.chatMessages),f=(0,c.useEngineSelector)(e=>e.playback.streamSnapshot?.timeSec),d=(0,t.useRef)(new WeakSet),h=(0,t.useRef)(new Map);return(0,t.useEffect)(()=>{if(!s||!e||!a||!l?.length||null==f)return;let t=d.current,o=h.current;for(let i of l){if(!t.has(i)){if((t.add(i),i.soundPath)&&!(Math.abs(f-i.timeSec)>2))try{let t=(0,n.audioToUrl)(i.soundPath),s=i.soundPitch??1,l=c.engineStore.getState().playback.rate,f=i.sender,d=(0,u.getSoundGeneration)();(0,u.getCachedAudioBuffer)(t,e,e=>{if(d!==(0,u.getSoundGeneration)())return;if(f){let e=o.get(f);if(e){try{e.stop()}catch{}(0,u.untrackSound)(e);try{e.disconnect()}catch{}o.delete(f)}}let t=new r.Audio(a);t.setBuffer(e),t.setPlaybackRate(s*l),(0,u.trackSound)(t,s),f&&o.set(f,t),t.play(),t.source.onended=()=>{(0,u.untrackSound)(t);try{t.disconnect()}catch{}f&&o.get(f)===t&&o.delete(f)}})}catch{}}}},[s,e,a,l,f]),null}e.s(["ChatSoundPlayer",()=>a])}]); \ No newline at end of file diff --git a/docs/_not-found/__next._full.txt b/docs/_not-found/__next._full.txt index 90dab871..3bcec8d1 100644 --- a/docs/_not-found/__next._full.txt +++ b/docs/_not-found/__next._full.txt @@ -8,7 +8,7 @@ a:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] c:I[68027,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"P":null,"b":"hT_425m97F9QlWX2JJZPJ","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/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","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/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],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, maximum-scale=1, user-scalable=no"}]] d:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] 7:null diff --git a/docs/_not-found/__next._head.txt b/docs/_not-found/__next._head.txt index dca20a1b..f6ea5756 100644 --- a/docs/_not-found/__next._head.txt +++ b/docs/_not-found/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","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"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","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"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._index.txt b/docs/_not-found/__next._index.txt index 646b5b34..a6efb165 100644 --- a/docs/_not-found/__next._index.txt +++ b/docs/_not-found/__next._index.txt @@ -3,4 +3,4 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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 3dbd7853..b619c104 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/2f236954d6a65e12.js"],"OutletBoundary"] 3:"$Sreact.suspense" -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","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":"HUIHRvyaa6D1abkRRPPoG","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 2edc4bfa..10690d3b 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/2f236954d6a65e12.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","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 1e9b0e5b..053892a9 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/ad52ebedad251428.css","style"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","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} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","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 dd886b26..b99edd65 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 90dab871..3bcec8d1 100644 --- a/docs/_not-found/index.txt +++ b/docs/_not-found/index.txt @@ -8,7 +8,7 @@ a:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] c:I[68027,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"P":null,"b":"hT_425m97F9QlWX2JJZPJ","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/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","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/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],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, maximum-scale=1, user-scalable=no"}]] d:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] 7:null diff --git a/docs/index.html b/docs/index.html index 7eaa13ac..17311634 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 395e77f1..dddeeb18 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -3,7 +3,7 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/790c269d8dfa8bf7.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/114146b21a4f5f3e.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/634517795b833f16.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] +6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/63afa42c92661c50.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] @@ -11,7 +11,7 @@ e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBounda 10:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] :HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"P":null,"b":"hT_425m97F9QlWX2JJZPJ","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/790c269d8dfa8bf7.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/114146b21a4f5f3e.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/634517795b833f16.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.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":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/63afa42c92661c50.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.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":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],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, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/shapes/__next._full.txt b/docs/shapes/__next._full.txt index ce20e335..c9659abe 100644 --- a/docs/shapes/__next._full.txt +++ b/docs/shapes/__next._full.txt @@ -3,7 +3,7 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/d06053c14447cd9a.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] +6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] @@ -11,7 +11,7 @@ e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBounda 10:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] :HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"P":null,"b":"hT_425m97F9QlWX2JJZPJ","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/d06053c14447cd9a.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children: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, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/shapes/__next._head.txt b/docs/shapes/__next._head.txt index 90169eed..b57734f2 100644 --- a/docs/shapes/__next._head.txt +++ b/docs/shapes/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","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"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","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"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/shapes/__next._index.txt b/docs/shapes/__next._index.txt index 646b5b34..a6efb165 100644 --- a/docs/shapes/__next._index.txt +++ b/docs/shapes/__next._index.txt @@ -3,4 +3,4 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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/shapes/__next._tree.txt b/docs/shapes/__next._tree.txt index 025e828c..8a9a608b 100644 --- a/docs/shapes/__next._tree.txt +++ b/docs/shapes/__next._tree.txt @@ -1,3 +1,3 @@ :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] :HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"shapes","paramType":null,"paramKey":"shapes","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"shapes","paramType":null,"paramKey":"shapes","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/shapes/__next.shapes.__PAGE__.txt b/docs/shapes/__next.shapes.__PAGE__.txt index 6dfdc4d5..f42c911d 100644 --- a/docs/shapes/__next.shapes.__PAGE__.txt +++ b/docs/shapes/__next.shapes.__PAGE__.txt @@ -1,10 +1,10 @@ 1:"$Sreact.fragment" 2:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -3:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/d06053c14447cd9a.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] +3:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 6:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] 7:"$Sreact.suspense" :HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/d06053c14447cd9a.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.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/shapes/__next.shapes.txt b/docs/shapes/__next.shapes.txt index 2edc4bfa..10690d3b 100644 --- a/docs/shapes/__next.shapes.txt +++ b/docs/shapes/__next.shapes.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -0:{"buildId":"hT_425m97F9QlWX2JJZPJ","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/shapes/index.html b/docs/shapes/index.html index 991b560d..535b1a7d 100644 --- a/docs/shapes/index.html +++ b/docs/shapes/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/shapes/index.txt b/docs/shapes/index.txt index ce20e335..c9659abe 100644 --- a/docs/shapes/index.txt +++ b/docs/shapes/index.txt @@ -3,7 +3,7 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/d06053c14447cd9a.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] +6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] @@ -11,7 +11,7 @@ e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBounda 10:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] :HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"P":null,"b":"hT_425m97F9QlWX2JJZPJ","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/d06053c14447cd9a.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.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":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children: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, maximum-scale=1, user-scalable=no"}]] diff --git a/eslint.config.mjs b/eslint.config.mjs index b272daf2..7e1d0992 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -18,7 +18,7 @@ export default defineConfig( ], "react-hooks/immutability": "warn", "react-hooks/refs": "warn", - "react-hooks/set-state-in-effect": "warn", + "react-hooks/set-state-in-effect": "off", }, }, ); diff --git a/src/components/AudioEmitter.tsx b/src/components/AudioEmitter.tsx index b0eba79f..04cbf185 100644 --- a/src/components/AudioEmitter.tsx +++ b/src/components/AudioEmitter.tsx @@ -1,4 +1,4 @@ -import { memo, useEffect, useRef } from "react"; +import { memo, useEffect, useEffectEvent, useRef, useState } from "react"; import { useThree, useFrame } from "@react-three/fiber"; import { Audio, @@ -253,6 +253,8 @@ export const AudioEmitter = memo(function AudioEmitter({ } }; + const [randomValue] = useState(() => Math.random()); + // Create sound object on mount. useEffect(() => { if (!audioLoader || !audioListener) return; @@ -312,7 +314,7 @@ export const AudioEmitter = memo(function AudioEmitter({ const gapMin = Math.max(0, minLoopGap); const gapMax = Math.max(gapMin, maxLoopGap); const gap = - gapMin === gapMax ? gapMin : Math.random() * (gapMax - gapMin) + gapMin; + gapMin === gapMax ? gapMin : randomValue * (gapMax - gapMin) + gapMin; sound.loop = false; @@ -340,7 +342,7 @@ export const AudioEmitter = memo(function AudioEmitter({ }; // Load and play audio. For 3D, gated by proximity; for 2D, plays immediately. - const loadAndPlay = (sound: Audio) => { + const loadAndPlay = useEffectEvent((sound: Audio) => { if (!audioLoader) return; const gen = generationRef.current; if (!isLoadedRef.current) { @@ -373,7 +375,7 @@ export const AudioEmitter = memo(function AudioEmitter({ /* expected */ } } - }; + }); // 2D emitters: load and play on mount (no proximity gating). useEffect(() => { diff --git a/src/components/GameDialog.module.css b/src/components/GameDialog.module.css index d4a5a893..3da8bcad 100644 --- a/src/components/GameDialog.module.css +++ b/src/components/GameDialog.module.css @@ -67,7 +67,6 @@ cursor: not-allowed; } -/* Secondary/ghost variant for less prominent actions (Close, Cancel). */ .Secondary { composes: DialogButton; background: transparent; @@ -81,3 +80,23 @@ color: rgba(169, 255, 229, 0.8); border: 1px solid rgba(63, 144, 135, 0.9); } + +.Actions { + display: flex; + align-items: center; + gap: 10px; +} + +@media (max-width: 719px) { + .Dialog { + max-width: calc(100dvw - 20px); + max-height: calc(100dvh - 20px); + border-radius: 0; + } +} + +@media (max-width: 639px) { + .Overlay { + padding: 10px; + } +} diff --git a/src/components/GenericShape.tsx b/src/components/GenericShape.tsx index 0b84f178..cd4a8161 100644 --- a/src/components/GenericShape.tsx +++ b/src/components/GenericShape.tsx @@ -20,6 +20,7 @@ import { import type { AnimationAction } from "three"; import * as SkeletonUtils from "three/examples/jsm/utils/SkeletonUtils.js"; import { setupTexture } from "../textureUtils"; +import { useAnisotropy } from "./useAnisotropy"; import { useDebug, useSettings } from "./SettingsProvider"; import { useShapeInfo, isOrganicShape } from "./ShapeInfoProvider"; import { useEngineSelector, effectNow, engineStore } from "../state/engineStore"; @@ -37,6 +38,7 @@ import { injectShapeLighting } from "../shapeMaterial"; import { processShapeScene, replaceWithShapeMaterial, + disposeClonedScene, } from "../stream/playbackUtils"; import type { ThreadState as StreamThreadState } from "../stream/types"; @@ -198,7 +200,13 @@ const IflTexture = memo(function IflTexture({ animated = false, }: TextureProps) { const resourcePath = material.userData.resource_path; - const flagNames = new Set(material.userData.flag_names ?? []); + const flagNames = useMemo( + () => + material.userData.flag_names + ? new Set(material.userData.flag_names) + : EMPTY_FLAG_NAMES, + [material.userData.flag_names], + ); const iflPath = `textures/${resourcePath}.ifl`; const texture = useIflTexture(iflPath); @@ -217,6 +225,8 @@ const IflTexture = memo(function IflTexture({ [material, texture, flagNames, isOrganic, vis, animated], ); + useDisposeMaterial(customMaterial); + // Two-pass rendering for organic/translucent materials // Render BackSide first (with flipped normals), then FrontSide if (Array.isArray(customMaterial)) { @@ -251,6 +261,18 @@ const IflTexture = memo(function IflTexture({ ); }); +function useDisposeMaterial(material: MaterialResult) { + useEffect(() => { + return () => { + if (Array.isArray(material)) { + material.forEach((m) => m.dispose()); + } else { + material.dispose(); + } + }; + }, [material]); +} + const EMPTY_FLAG_NAMES = new Set(); const StaticTexture = memo(function StaticTexture({ @@ -281,14 +303,15 @@ const StaticTexture = memo(function StaticTexture({ const isOrganic = shapeName && isOrganicShape(shapeName); const isTranslucent = flagNames.has("Translucent"); + const anisotropy = useAnisotropy(); const texture = useTexture(url, (texture) => { // Organic/alpha-tested textures need special handling to avoid mipmap artifacts if (isOrganic || isTranslucent) { - return setupTexture(texture, { disableMipmaps: true }); + return setupTexture(texture, { disableMipmaps: true, anisotropy }); } // Standard color texture setup for diffuse-only materials - return setupTexture(texture); + return setupTexture(texture, { anisotropy }); }); const customMaterial = useMemo( @@ -304,6 +327,8 @@ const StaticTexture = memo(function StaticTexture({ [material, texture, flagNames, isOrganic, vis, animated], ); + useDisposeMaterial(customMaterial); + // Two-pass rendering for organic/translucent materials // Render BackSide first (with flipped normals), then FrontSide if (Array.isArray(customMaterial)) { @@ -501,6 +526,7 @@ export const ShapeModel = memo(function ShapeModel({ const { debugMode } = useDebug(); const { animationEnabled } = useSettings(); const runtime = useEngineSelector((state) => state.runtime.runtime); + const anisotropy = useAnisotropy(); const { clonedScene, mixer, clipsByName, visNodesBySequence, iflMeshes } = useMemo(() => { @@ -549,7 +575,7 @@ export const ShapeModel = memo(function ShapeModel({ } }); - processShapeScene(scene, shapeName ?? undefined); + processShapeScene(scene, shapeName ?? undefined, { anisotropy }); // Un-hide IFL meshes that don't have a vis sequence — they should always // be visible. IFL meshes WITH vis sequences stay hidden until their @@ -607,7 +633,16 @@ export const ShapeModel = memo(function ShapeModel({ visNodesBySequence: visBySeq, iflMeshes: iflInfos, }; - }, [gltf]); + }, [gltf, anisotropy]); + + // Dispose cloned geometries and materials when the scene is replaced or + // the component unmounts, to prevent GPU memory from accumulating. + useEffect(() => { + return () => { + disposeClonedScene(clonedScene); + mixer?.uncacheRoot(clonedScene); + }; + }, [clonedScene, mixer]); const threadsRef = useRef(new Map()); const iflMeshAtlasRef = useRef(new Map()); diff --git a/src/components/InteriorInstance.tsx b/src/components/InteriorInstance.tsx index e278fd56..0e542052 100644 --- a/src/components/InteriorInstance.tsx +++ b/src/components/InteriorInstance.tsx @@ -22,6 +22,7 @@ import { import { setupTexture } from "../textureUtils"; import { FloatingLabel } from "./FloatingLabel"; import { useDebug } from "./SettingsProvider"; +import { useAnisotropy } from "./useAnisotropy"; import { injectCustomFog } from "../fogShader"; import { globalFogUniforms } from "../globalFogUniforms"; import { injectInteriorLighting } from "../interiorMaterial"; @@ -47,8 +48,9 @@ function InteriorTexture({ }) { const debugContext = useDebug(); const debugMode = debugContext?.debugMode ?? false; + const anisotropy = useAnisotropy(); const url = textureToUrl(materialName); - const texture = useTexture(url, (texture) => setupTexture(texture)); + const texture = useTexture(url, (texture) => setupTexture(texture, { anisotropy })); // Check for self-illuminating flag in material userData // Note: The io_dif Blender add-on needs to be updated to export material flags const flagNames = new Set(material?.userData?.flag_names ?? []); diff --git a/src/components/MapInspector.tsx b/src/components/MapInspector.tsx index 24598973..d084bc23 100644 --- a/src/components/MapInspector.tsx +++ b/src/components/MapInspector.tsx @@ -386,18 +386,22 @@ export function MapInspector() { ) : null} {mapInfoOpen ? ( - - setMapInfoOpen(false)} - missionName={missionName} - missionType={missionType ?? ""} - /> - + + + setMapInfoOpen(false)} + missionName={missionName} + missionType={missionType ?? ""} + /> + + ) : null} {serverBrowserOpen ? ( - - setServerBrowserOpen(false)} /> - + + + setServerBrowserOpen(false)} /> + + ) : null} diff --git a/src/components/PlayerModel.tsx b/src/components/PlayerModel.tsx index 884f4311..56454d9c 100644 --- a/src/components/PlayerModel.tsx +++ b/src/components/PlayerModel.tsx @@ -18,6 +18,7 @@ import * as SkeletonUtils from "three/examples/jsm/utils/SkeletonUtils.js"; import { ANIM_TRANSITION_TIME, DEFAULT_EYE_HEIGHT, + disposeClonedScene, getKeyframeAtTime, getPosedNodeTransform, processShapeScene, @@ -27,6 +28,7 @@ import { WeaponImageStateMachine } from "../stream/weaponStateMachine"; import type { WeaponAnimState } from "../stream/weaponStateMachine"; import { getAliasedActions } from "../torqueScript/shapeConstructor"; import { useStaticShape, ShapePlaceholder } from "./GenericShape"; +import { useAnisotropy } from "./useAnisotropy"; import { ShapeErrorBoundary } from "./ShapeErrorBoundary"; import { DebugSuspense } from "./DebugSuspense"; import { useAudio } from "./AudioContext"; @@ -174,12 +176,13 @@ export function PlayerModel({ entity }: { entity: PlayerEntity }) { const sn = shapeName?.toLowerCase(); return sn ? state.runtime.sequenceAliases.get(sn) : undefined; }); + const anisotropy = useAnisotropy(); // Clone scene preserving skeleton bindings, create mixer, find mount bones. const { clonedScene, mixer, mount0, mount1, mount2, iflInitializers } = useMemo(() => { const scene = SkeletonUtils.clone(gltf.scene) as Group; - const iflInits = processShapeScene(scene); + const iflInits = processShapeScene(scene, undefined, { anisotropy }); // Use front-face-only rendering so the camera can see out from inside the // model in first-person (backface culling hides interior faces). @@ -209,7 +212,14 @@ export function PlayerModel({ entity }: { entity: PlayerEntity }) { mount2: m2, iflInitializers: iflInits, }; - }, [gltf]); + }, [gltf, anisotropy]); + + useEffect(() => { + return () => { + disposeClonedScene(clonedScene); + mixer.uncacheRoot(clonedScene); + }; + }, [clonedScene, mixer]); // Build case-insensitive clip lookup with alias support. const animActionsRef = useRef(new Map()); @@ -659,6 +669,7 @@ function WeaponModel({ }) { const engineStore = useEngineStoreApi(); const weaponGltf = useStaticShape(weaponShape); + const anisotropy = useAnisotropy(); // Clone weapon with skeleton bindings, create dedicated mixer. const { @@ -669,7 +680,7 @@ function WeaponModel({ weaponIflInitializers, } = useMemo(() => { const clone = SkeletonUtils.clone(weaponGltf.scene) as Group; - const iflInits = processShapeScene(clone); + const iflInits = processShapeScene(clone, undefined, { anisotropy }); // Compute Mountpoint inverse offset so the weapon's grip aligns to Mount0. const mp = getPosedNodeTransform( @@ -714,7 +725,14 @@ function WeaponModel({ visNodesBySequence: visBySeq, weaponIflInitializers: iflInits, }; - }, [weaponGltf]); + }, [weaponGltf, anisotropy]); + + useEffect(() => { + return () => { + disposeClonedScene(weaponClone); + weaponMixer.uncacheRoot(weaponClone); + }; + }, [weaponClone, weaponMixer]); // Build case-insensitive action map for weapon animations. const weaponActionsRef = useRef(new Map()); @@ -1013,10 +1031,11 @@ function PackModel({ mountBone: Object3D; }) { const packGltf = useStaticShape(packShape); + const anisotropy = useAnisotropy(); const { packClone, packIflInitializers } = useMemo(() => { const clone = SkeletonUtils.clone(packGltf.scene) as Group; - const iflInits = processShapeScene(clone); + const iflInits = processShapeScene(clone, undefined, { anisotropy }); // Compute Mountpoint inverse offset so the pack aligns to Mount1. const mp = getPosedNodeTransform( @@ -1032,12 +1051,13 @@ function PackModel({ } return { packClone: clone, packIflInitializers: iflInits }; - }, [packGltf]); + }, [packGltf, anisotropy]); useEffect(() => { mountBone.add(packClone); return () => { mountBone.remove(packClone); + disposeClonedScene(packClone); }; }, [packClone, mountBone]); diff --git a/src/components/ServerBrowser.module.css b/src/components/ServerBrowser.module.css index dabc70ef..0fdd50fb 100644 --- a/src/components/ServerBrowser.module.css +++ b/src/components/ServerBrowser.module.css @@ -56,6 +56,7 @@ .Table { width: 100%; + min-height: 0; border-collapse: collapse; font-size: 13px; } @@ -133,6 +134,7 @@ .Footer { display: flex; align-items: center; + justify-content: space-between; gap: 16px; padding: 10px 12px; border-top: 1px solid rgba(0, 190, 220, 0.25); @@ -187,15 +189,11 @@ margin: 0 auto; } -@media (max-width: 719px) { - .Dialog { - width: 100%; - height: 100%; - max-width: 100dvw; - max-height: 100dvh; - border-radius: 0; - } +.Actions { + composes: Actions from "./GameDialog.module.css"; +} +@media (max-width: 719px) { .Hint { display: none; } @@ -208,3 +206,29 @@ margin-left: auto; } } + +@media (max-width: 539px) { + .Footer { + flex-direction: column; + gap: 8px; + } + + .Actions { + width: 100%; + } + + .WarriorLabel { + font-size: 14px; + } + + .WarriorInput { + font-size: 16px; + min-width: 12em; + } + + .JoinButton, + .CloseButton { + flex: 1 0 auto; + height: 32px; + } +} diff --git a/src/components/ServerBrowser.tsx b/src/components/ServerBrowser.tsx index c81aaf2a..d3c1f514 100644 --- a/src/components/ServerBrowser.tsx +++ b/src/components/ServerBrowser.tsx @@ -195,16 +195,18 @@ export function ServerBrowser({ onClose }: { onClose: () => void }) { /> Double-click a server to join - - +
+ + +
diff --git a/src/components/ShapeModel.tsx b/src/components/ShapeModel.tsx index 7d5b0a25..fea1dbc0 100644 --- a/src/components/ShapeModel.tsx +++ b/src/components/ShapeModel.tsx @@ -7,6 +7,7 @@ import * as SkeletonUtils from "three/examples/jsm/utils/SkeletonUtils.js"; import { _r90, _r90inv, + disposeClonedScene, getPosedNodeTransform, processShapeScene, } from "../stream/playbackUtils"; @@ -17,6 +18,7 @@ import { } from "./useIflTexture"; import type { IflAtlas } from "./useIflTexture"; import { ShapeRenderer, useStaticShape } from "./GenericShape"; +import { useAnisotropy } from "./useAnisotropy"; import { ShapeInfoProvider } from "./ShapeInfoProvider"; import type { TorqueObject } from "../torqueScript"; import type { ExplosionEntity, ShapeEntity } from "../state/gameEntityTypes"; @@ -50,7 +52,6 @@ export function WeaponModel({ entity }: { entity: ShapeEntity }) { const playerGltf = useStaticShape(playerShapeName); const weaponGltf = useStaticShape(shapeName); - // eslint-disable-next-line react-hooks/preserve-manual-memoization const mountTransform = useMemo(() => { // Get Mount0 from the player's posed skeleton with arm animation applied. const armThread = getArmThread(shapeName); @@ -96,7 +97,13 @@ export function WeaponModel({ entity }: { entity: ShapeEntity }) { const mountQuat = _r90.clone().multiply(combinedQuat).multiply(_r90inv); return { position: mountPos, quaternion: mountQuat }; - }, [playerGltf, weaponGltf]); + }, [ + playerGltf.animations, + playerGltf.scene, + shapeName, + weaponGltf.animations, + weaponGltf.scene, + ]); const torqueObject = useMemo( () => ({ @@ -207,6 +214,7 @@ function interpolateSize( export function ExplosionShape({ entity }: { entity: ExplosionEntity }) { const playback = streamPlaybackStore.getState().playback; const gltf = useStaticShape(entity.shapeName!); + const anisotropy = useAnisotropy(); const groupRef = useRef(null); const startTimeRef = useRef(effectNow()); // eslint-disable-next-line react-hooks/purity @@ -267,7 +275,7 @@ export function ExplosionShape({ entity }: { entity: ExplosionEntity }) { } }); - processShapeScene(scene, entity.shapeName); + processShapeScene(scene, entity.shapeName, { anisotropy }); // Collect vis-animated nodes keyed by sequence name. const visNodes: VisNode[] = []; @@ -342,7 +350,14 @@ export function ExplosionShape({ entity }: { entity: ExplosionEntity }) { }); return { scene, mixer, visNodes, iflInfos, materials }; - }, [gltf, expBlock]); + }, [gltf, expBlock, anisotropy]); + + useEffect(() => { + return () => { + disposeClonedScene(scene); + mixer?.uncacheRoot(scene); + }; + }, [scene, mixer]); // Load IFL texture atlases. useEffect(() => { diff --git a/src/components/StreamingController.tsx b/src/components/StreamingController.tsx index 39315f6a..433da908 100644 --- a/src/components/StreamingController.tsx +++ b/src/components/StreamingController.tsx @@ -1,13 +1,11 @@ import { Suspense, useCallback, useEffect, useRef, useState } from "react"; import { useFrame } from "@react-three/fiber"; -import { useGLTF } from "@react-three/drei"; import { Quaternion, Vector3 } from "three"; import { DEFAULT_EYE_HEIGHT, STREAM_TICK_SEC, torqueHorizontalFovToThreeVerticalFov, } from "../stream/playbackUtils"; -import { shapeToUrl } from "../loaders"; import { ParticleEffects } from "./ParticleEffects"; import { PlayerEyeOffset } from "./PlayerModel"; import { stopAllTrackedSounds } from "./AudioEmitter"; @@ -302,12 +300,6 @@ export function StreamingController({ savedConnectedPlayerName ?? recording.recorderName ?? undefined, recordingDate: recording.recordingDate ?? undefined, }); - // Preload weapon effect shapes (explosions) so they're cached before - // the first projectile detonates -- otherwise the GLB fetch latency - // causes the short-lived explosion entity to expire before it renders. - for (const shape of stream.getEffectShapes()) { - useGLTF.preload(shapeToUrl(shape)); - } const snapshot = stream.getSnapshot(); streamPlaybackStore.setState({ time: snapshot.timeSec }); diff --git a/src/components/TerrainTile.tsx b/src/components/TerrainTile.tsx index f353acee..2857f6dd 100644 --- a/src/components/TerrainTile.tsx +++ b/src/components/TerrainTile.tsx @@ -14,6 +14,7 @@ import { import { setupTexture } from "../textureUtils"; import { updateTerrainTextureShader } from "../terrainMaterial"; import { useDebug } from "./SettingsProvider"; +import { useAnisotropy } from "./useAnisotropy"; import { injectCustomFog } from "../fogShader"; import { globalFogUniforms } from "../globalFogUniforms"; @@ -58,11 +59,12 @@ const BlendedTerrainTextures = memo(function BlendedTerrainTextures({ lightmap?: DataTexture; }) { const { debugMode } = useDebug(); + const anisotropy = useAnisotropy(); const baseTextures = useTexture( textureNames.map((name) => terrainTextureToUrl(name)), (textures) => { - textures.forEach((tex) => setupTexture(tex)); + textures.forEach((tex) => setupTexture(tex, { anisotropy })); }, ); @@ -74,7 +76,7 @@ const BlendedTerrainTextures = memo(function BlendedTerrainTextures({ const detailTexture = useTexture( detailTextureUrl ?? FALLBACK_TEXTURE_URL, (tex) => { - setupTexture(tex); + setupTexture(tex, { anisotropy }); }, ); diff --git a/src/components/WaterBlock.tsx b/src/components/WaterBlock.tsx index 21b2ee1d..1fc28c40 100644 --- a/src/components/WaterBlock.tsx +++ b/src/components/WaterBlock.tsx @@ -9,6 +9,7 @@ import { matrixFToQuaternion, } from "../scene"; import { setupTexture } from "../textureUtils"; +import { useAnisotropy } from "./useAnisotropy"; import { createWaterMaterial } from "../waterMaterial"; import { useDebug, useSettings } from "./SettingsProvider"; import { usePositionTracker } from "./usePositionTracker"; @@ -61,7 +62,8 @@ export function WaterMaterial({ attach?: string; }) { const url = textureToUrl(surfaceTexture); - const texture = useTexture(url, (texture) => setupTexture(texture)); + const anisotropy = useAnisotropy(); + const texture = useTexture(url, (texture) => setupTexture(texture, { anisotropy })); return ( { const texArray = Array.isArray(textures) ? textures : [textures]; texArray.forEach((tex) => { - setupTexture(tex); + setupTexture(tex, { anisotropy }); tex.colorSpace = NoColorSpace; tex.wrapS = RepeatWrapping; tex.wrapT = RepeatWrapping; diff --git a/src/components/useAnisotropy.ts b/src/components/useAnisotropy.ts new file mode 100644 index 00000000..97132367 --- /dev/null +++ b/src/components/useAnisotropy.ts @@ -0,0 +1,5 @@ +import { useThree } from "@react-three/fiber"; + +export function useAnisotropy(): number { + return useThree((s) => s.gl.capabilities.getMaxAnisotropy()); +} diff --git a/src/shapeMaterial.ts b/src/shapeMaterial.ts index 1340078d..ebd29a0f 100644 --- a/src/shapeMaterial.ts +++ b/src/shapeMaterial.ts @@ -64,11 +64,14 @@ const alphaAsRoughnessShaderModifier = (shader: any) => { * Configures a texture for use with alpha-as-roughness materials * @param texture - The texture to configure */ -export function setupAlphaAsRoughnessTexture(texture: Texture) { +export function setupAlphaAsRoughnessTexture( + texture: Texture, + options: { anisotropy?: number } = {}, +) { texture.wrapS = texture.wrapT = RepeatWrapping; texture.colorSpace = SRGBColorSpace; texture.flipY = false; - texture.anisotropy = 16; + texture.anisotropy = options.anisotropy ?? 1; texture.generateMipmaps = true; texture.minFilter = LinearMipmapLinearFilter; texture.magFilter = LinearFilter; diff --git a/src/stream/playbackUtils.ts b/src/stream/playbackUtils.ts index 7fc41521..ed4703f8 100644 --- a/src/stream/playbackUtils.ts +++ b/src/stream/playbackUtils.ts @@ -27,7 +27,7 @@ import { getFrameIndexForTime, updateAtlasFrame, } from "../components/useIflTexture"; -import { getHullBoneIndices, filterGeometryByVertexGroups } from "../meshUtils"; +import { getHullBoneIndices } from "../meshUtils"; import { loadTexture, setupTexture } from "../textureUtils"; import { textureToUrl } from "../loaders"; import type { Keyframe } from "./types"; @@ -193,6 +193,51 @@ export function getPosedNodeTransform( return { position, quaternion }; } +/** + * Remove faces influenced by hull bones, mutating the geometry in place. + * Unlike filterGeometryByVertexGroups (which clones), this is safe when the + * geometry is already our own copy (e.g. from SkeletonUtils.clone). + */ +function filterHullFaces( + geometry: BufferGeometry, + hullBoneIndices: Set, +): void { + if (hullBoneIndices.size === 0 || !geometry.attributes.skinIndex) return; + + const skinIndex = geometry.attributes.skinIndex; + const skinWeight = geometry.attributes.skinWeight; + const index = geometry.index; + if (!index) return; + + const vertexHasHullInfluence = new Array(skinIndex.count).fill(false); + for (let i = 0; i < skinIndex.count; i++) { + for (let j = 0; j < 4; j++) { + const boneIndex = skinIndex.array[i * 4 + j]; + const weight = skinWeight.array[i * 4 + j]; + if (weight > 0.01 && hullBoneIndices.has(boneIndex)) { + vertexHasHullInfluence[i] = true; + break; + } + } + } + + const newIndices: number[] = []; + const indexArray = index.array; + for (let i = 0; i < indexArray.length; i += 3) { + const i0 = indexArray[i]; + const i1 = indexArray[i + 1]; + const i2 = indexArray[i + 2]; + if ( + !vertexHasHullInfluence[i0] && + !vertexHasHullInfluence[i1] && + !vertexHasHullInfluence[i2] + ) { + newIndices.push(i0, i1, i2); + } + } + geometry.setIndex(newIndices); +} + /** * Smooth vertex normals across co-located split vertices (same position, different * UVs). Matches the technique used by ShapeModel for consistent lighting. @@ -262,6 +307,7 @@ export function replaceWithShapeMaterial( mat: MeshStandardMaterial, vis: number, isOrganic = false, + options: { anisotropy?: number } = {}, ): ShapeMaterialResult { const resourcePath: string | undefined = mat.userData?.resource_path; const flagNames = new Set(mat.userData?.flag_names ?? []); @@ -311,9 +357,9 @@ export function replaceWithShapeMaterial( const texture = loadTexture(url); const isTranslucent = flagNames.has("Translucent"); if (isOrganic || isTranslucent) { - setupTexture(texture, { disableMipmaps: true }); + setupTexture(texture, { disableMipmaps: true, anisotropy: options.anisotropy }); } else { - setupTexture(texture); + setupTexture(texture, { anisotropy: options.anisotropy }); } const result = createMaterialFromFlags( @@ -368,6 +414,7 @@ async function initializeIflMaterial( export function processShapeScene( scene: Object3D, shapeName?: string, + options: { anisotropy?: number } = {}, ): IflInitializer[] { const iflInitializers: IflInitializer[] = []; const isOrganic = shapeName ? isOrganicShape(shapeName) : false; @@ -402,14 +449,11 @@ export function processShapeScene( } // Filter hull-influenced triangles and smooth normals. + // SkeletonUtils.clone already deep-clones geometry, so no extra clone + // is needed — we can mutate in place. if (node.geometry) { - let geometry = filterGeometryByVertexGroups( - node.geometry, - hullBoneIndices, - ); - geometry = geometry.clone(); - smoothVertexNormals(geometry); - node.geometry = geometry; + filterHullFaces(node.geometry, hullBoneIndices); + smoothVertexNormals(node.geometry); } // Replace PBR materials with diffuse-only Lambert materials. @@ -418,7 +462,7 @@ export function processShapeScene( const vis: number = hasVisSequence ? 1 : (node.userData?.vis ?? 1); if (Array.isArray(node.material)) { node.material = node.material.map((m: MeshStandardMaterial) => { - const result = replaceWithShapeMaterial(m, vis, isOrganic); + const result = replaceWithShapeMaterial(m, vis, isOrganic, options); if (result.initialize) { iflInitializers.push({ mesh: node, initialize: result.initialize }); } @@ -430,7 +474,7 @@ export function processShapeScene( return result.material; }); } else if (node.material) { - const result = replaceWithShapeMaterial(node.material, vis, isOrganic); + const result = replaceWithShapeMaterial(node.material, vis, isOrganic, options); if (result.initialize) { iflInitializers.push({ mesh: node, initialize: result.initialize }); } @@ -451,6 +495,26 @@ export function processShapeScene( return iflInitializers; } +/** + * Dispose all geometries and materials on a cloned scene graph. + * Textures are intentionally left alone since they're shared via caches. + */ +export function disposeClonedScene(root: Object3D): void { + root.traverse((node: any) => { + if (node.geometry) { + node.geometry.dispose(); + } + if (node.material) { + const mats: Material[] = Array.isArray(node.material) + ? node.material + : [node.material]; + for (const mat of mats) { + mat.dispose(); + } + } + }); +} + export function entityTypeColor(type: string): string { switch (type.toLowerCase()) { case "player": diff --git a/src/textureUtils.ts b/src/textureUtils.ts index d2b7bdec..14ae0cb7 100644 --- a/src/textureUtils.ts +++ b/src/textureUtils.ts @@ -84,6 +84,8 @@ export interface TextureSetupOptions { repeat?: [number, number]; /** Disable mipmaps (for alpha-tested textures to prevent artifacts). Default: false */ disableMipmaps?: boolean; + /** Override anisotropy level. Default: max supported by the GPU. */ + anisotropy?: number; } /** @@ -97,13 +99,13 @@ export function setupTexture( tex: T, options: TextureSetupOptions = {}, ): T { - const { repeat = [1, 1], disableMipmaps = false } = options; + const { repeat = [1, 1], disableMipmaps = false, anisotropy } = options; tex.wrapS = tex.wrapT = RepeatWrapping; tex.colorSpace = SRGBColorSpace; tex.repeat.set(...repeat); tex.flipY = false; // DDS/DIF textures are already flipped - tex.anisotropy = 16; + tex.anisotropy = anisotropy ?? 1; if (disableMipmaps) { // Disable mipmaps - prevents checkerboard artifacts on alpha-tested materials