omegga 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/dist/brickadia/server.d.ts +17 -0
- package/dist/brickadia/server.js +81 -4
- package/dist/brickadia/server.js.map +1 -1
- package/dist/cli/auth.js +1 -1
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/terminal.js +99 -6
- package/dist/cli/terminal.js.map +1 -1
- package/dist/config/reader.js.map +1 -1
- package/dist/config/types.d.ts +5 -0
- package/dist/main.js +43 -47
- package/dist/main.js.map +1 -1
- package/dist/omegga/player.js +4 -2
- package/dist/omegga/player.js.map +1 -1
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.js.map +1 -1
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts +5 -5
- package/dist/omegga/plugin.d.ts +2 -2
- package/dist/omegga/server.d.ts +6 -5
- package/dist/omegga/server.js +128 -84
- package/dist/omegga/server.js.map +1 -1
- package/dist/omegga/wrapper.d.ts +11 -0
- package/dist/omegga/wrapper.js +16 -0
- package/dist/omegga/wrapper.js.map +1 -1
- package/dist/plugin.d.ts +7 -9
- package/dist/plugin.js.map +1 -1
- package/dist/softconfig.d.ts +1 -0
- package/dist/softconfig.js +2 -1
- package/dist/softconfig.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/updater/index.d.ts +1 -0
- package/dist/updater/index.js +10 -0
- package/dist/updater/index.js.map +1 -0
- package/dist/updater/steam.d.ts +52 -0
- package/dist/updater/steam.js +139 -0
- package/dist/updater/steam.js.map +1 -0
- package/dist/util/color.js +7 -7
- package/dist/util/color.js.map +1 -1
- package/dist/util/time.js +1 -1
- package/dist/util/time.js.map +1 -1
- package/dist/webserver/backend/api.d.ts +83 -1
- package/dist/webserver/backend/api.js +174 -15
- package/dist/webserver/backend/api.js.map +1 -1
- package/dist/webserver/backend/database.js +10 -3
- package/dist/webserver/backend/database.js.map +1 -1
- package/dist/webserver/backend/index.js +5 -9
- package/dist/webserver/backend/index.js.map +1 -1
- package/dist/webserver/backend/metrics.js +58 -11
- package/dist/webserver/backend/metrics.js.map +1 -1
- package/eslint.config.mjs +53 -0
- package/package.json +37 -29
- package/public/app.html +1865 -0
- package/public/assets/IconArrowRight-CA5_cccJ.js +7 -0
- package/public/assets/IconArrowRight-CA5_cccJ.js.map +1 -0
- package/public/assets/IconCheck-Dyq5qyY1.js +17 -0
- package/public/assets/IconCheck-Dyq5qyY1.js.map +1 -0
- package/public/assets/IconLockOpen-D95XLORK.js +7 -0
- package/public/assets/IconLockOpen-D95XLORK.js.map +1 -0
- package/public/assets/IconWorld-DtARpBKX.js +72 -0
- package/public/assets/IconWorld-DtARpBKX.js.map +1 -0
- package/public/assets/IconWorldPlus-CMeE6oOX.js +182 -0
- package/public/assets/IconWorldPlus-CMeE6oOX.js.map +1 -0
- package/public/assets/IconX-SYtbnYKI.js +12 -0
- package/public/assets/IconX-SYtbnYKI.js.map +1 -0
- package/public/assets/_commonjsHelpers-CE1G-McA.js +2 -0
- package/public/assets/_commonjsHelpers-CE1G-McA.js.map +1 -0
- package/public/assets/app-CRu25Om6.js +6 -0
- package/public/assets/app-CRu25Om6.js.map +1 -0
- package/public/assets/auth-DdQ5DJ5h.js +2 -0
- package/public/assets/auth-DdQ5DJ5h.js.map +1 -0
- package/public/assets/client-C5T7_OK9.js +26 -0
- package/public/assets/client-C5T7_OK9.js.map +1 -0
- package/public/assets/index-CJ4e7_2M.js +2 -0
- package/public/assets/index-CJ4e7_2M.js.map +1 -0
- package/public/assets/index-CRRRLlCc.js +10 -0
- package/public/assets/index-CRRRLlCc.js.map +1 -0
- package/public/assets/index-CSV4ZXsq.js +2 -0
- package/public/assets/index-CSV4ZXsq.js.map +1 -0
- package/public/assets/index-CtY8r8rg.js +9 -0
- package/public/assets/index-CtY8r8rg.js.map +1 -0
- package/public/assets/index-DaWNRjkx.js +2 -0
- package/public/assets/index-DaWNRjkx.js.map +1 -0
- package/public/assets/index-DqHVrEeL.js +10 -0
- package/public/assets/index-DqHVrEeL.js.map +1 -0
- package/public/assets/index-c0qeY2gs.js +10 -0
- package/public/assets/index-c0qeY2gs.js.map +1 -0
- package/public/assets/index-i4mjW0og.js +2 -0
- package/public/assets/index-i4mjW0og.js.map +1 -0
- package/public/assets/jsx-runtime-Bw5QeaCk.js +10 -0
- package/public/assets/jsx-runtime-Bw5QeaCk.js.map +1 -0
- package/public/assets/jsx-runtime-DoEZbXM1.js +2 -0
- package/public/assets/jsx-runtime-DoEZbXM1.js.map +1 -0
- package/public/assets/shared/@components-BiaBe0jO.js +2 -0
- package/public/assets/shared/@components-BiaBe0jO.js.map +1 -0
- package/public/assets/shared/@hooks-DfTzYBIL.js +2 -0
- package/public/assets/shared/@hooks-DfTzYBIL.js.map +1 -0
- package/public/assets/shared/@nanostores_react-HTG3s0lp.js +2 -0
- package/public/assets/shared/@nanostores_react-HTG3s0lp.js.map +1 -0
- package/public/assets/shared/@tabler_icons-react-DwfGvIVr.js +29458 -0
- package/public/assets/shared/@tabler_icons-react-DwfGvIVr.js.map +1 -0
- package/public/assets/shared/@utils-BQyGUOvP.js +2 -0
- package/public/assets/shared/@utils-BQyGUOvP.js.map +1 -0
- package/public/assets/shared/nanostores-BFqqIY_c.js +2 -0
- package/public/assets/shared/nanostores-BFqqIY_c.js.map +1 -0
- package/public/assets/shared/react-CR6vSpIu.js +2 -0
- package/public/assets/shared/react-CR6vSpIu.js.map +1 -0
- package/public/assets/shared/react-dom-BznoGTRX.js +2 -0
- package/public/assets/shared/react-dom-BznoGTRX.js.map +1 -0
- package/public/assets/shared/react_jsx-runtime-C15Zu6_p.js +2 -0
- package/public/assets/shared/react_jsx-runtime-C15Zu6_p.js.map +1 -0
- package/public/assets/shared/wouter-DbmGxXTo.js +2 -0
- package/public/assets/shared/wouter-DbmGxXTo.js.map +1 -0
- package/public/auth.html +1206 -0
- package/templates/rust/src/main.rs +25 -0
- package/templates/safe-ts/omegga.d.ts +7 -9
- package/tools/install_steamcmd.sh +1 -1
- package/.prettierignore +0 -6
- package/frontend/app.html +0 -14
- package/frontend/auth.html +0 -14
- package/omegga-config.yml +0 -7
- package/public/app.bundle.js +0 -54537
- package/public/app.bundle.js.map +0 -1
- package/public/app.css +0 -6345
- package/public/app.css.map +0 -1
- package/public/auth.bundle.js +0 -17789
- package/public/auth.bundle.js.map +0 -1
- package/public/auth.css +0 -3313
- package/public/auth.css.map +0 -1
- /package/{frontend/assets/fonts/GlacialIndifferenceBold.ttf → public/assets/GlacialIndifferenceBold-DhenBmgZ.ttf} +0 -0
- /package/{frontend/assets/fonts/GlacialIndifferenceItalic.otf → public/assets/GlacialIndifferenceItalic-BApAEtVA.otf} +0 -0
- /package/{frontend/assets/fonts/GlacialIndifferenceMedium.otf → public/assets/GlacialIndifferenceMedium-CALcoUYm.otf} +0 -0
- /package/{frontend/assets/fonts/GlacialIndifferenceRegular.ttf → public/assets/GlacialIndifferenceRegular-DynFsoUc.ttf} +0 -0
- /package/{frontend/assets/fonts/RobotoBold.ttf → public/assets/RobotoBold-DB1hqCFM.ttf} +0 -0
- /package/{frontend/assets/fonts/RobotoItalic.ttf → public/assets/RobotoItalic-DIrf6xfk.ttf} +0 -0
- /package/{frontend/assets/fonts/RobotoRegular.ttf → public/assets/RobotoRegular-CGSfnFoJ.ttf} +0 -0
- /package/{frontend/assets/img/auth_bg.webp → public/assets/auth_bg-DJZN1T-H.webp} +0 -0
- /package/{frontend/assets/img/dark_bg.webp → public/assets/dark_bg-uu5tZDxN.webp} +0 -0
- /package/{frontend/assets/img/turkey.webp → public/assets/turkey-BW4gu-4u.webp} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CJ4e7_2M.js","sources":["../../node_modules/nanostores/listen-keys/index.js"],"sourcesContent":["export function listenKeys($store, keys, listener) {\n let keysSet = new Set(keys).add(undefined)\n return $store.listen((value, oldValue, changed) => {\n if (keysSet.has(changed)) {\n listener(value, oldValue, changed)\n }\n })\n}\n\nexport function subscribeKeys($store, keys, listener) {\n let unbind = listenKeys($store, keys, listener)\n listener($store.value)\n return unbind\n}\n"],"names":["listenKeys","$store","keys","listener","keysSet","value","oldValue","changed","subscribeKeys","unbind"],"mappings":"AAAO,SAASA,EAAWC,EAAQC,EAAMC,EAAU,CACjD,IAAIC,EAAU,IAAI,IAAIF,CAAI,EAAE,IAAI,MAAS,EACzC,OAAOD,EAAO,OAAO,CAACI,EAAOC,EAAUC,IAAY,CAC7CH,EAAQ,IAAIG,CAAO,GACrBJ,EAASE,EAAOC,EAAUC,CAAO,CAErC,CAAC,CACH,CAEO,SAASC,EAAcP,EAAQC,EAAMC,EAAU,CACpD,IAAIM,EAAST,EAAWC,EAAQC,EAAMC,CAAQ,EAC9C,OAAAA,EAASF,EAAO,KAAK,EACdQ,CACT","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{r as u,R as B}from"./index-i4mjW0og.js";import{r as F}from"./index-c0qeY2gs.js";function N(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,s,r,a,o=[],f="",h=e.split("/");for(h[0]||h.shift();r=h.shift();)n=r[0],n==="*"?(o.push(n),f+=r[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(s=r.indexOf("?",1),a=r.indexOf(".",1),o.push(r.substring(1,~s?s:~a?a:r.length)),f+=~s&&!~a?"(?:/([^/]+?))?":"/([^/]+?)",~a&&(f+=(~s?"?":"")+"\\"+r.substring(a))):f+="/"+r;return{keys:o,pattern:new RegExp("^"+f+(t?"(?=$|/)":"/?$"),"i")}}var w={exports:{}},x={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var L;function T(){if(L)return x;L=1;var e=F();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function f(c,d){var y=d(),E=s({inst:{value:y,getSnapshot:d}}),p=E[0].inst,m=E[1];return a(function(){p.value=y,p.getSnapshot=d,h(p)&&m({inst:p})},[c,y,d]),r(function(){return h(p)&&m({inst:p}),c(function(){h(p)&&m({inst:p})})},[c]),o(y),y}function h(c){var d=c.getSnapshot;c=c.value;try{var y=d();return!n(c,y)}catch{return!0}}function l(c,d){return d()}var i=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:f;return x.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:i,x}var C;function z(){return C||(C=1,w.exports=T()),w.exports}var G=z();const Q=B.useInsertionEffect,J=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$=J?u.useLayoutEffect:u.useEffect,W=Q||$,g=e=>{const t=u.useRef([e,(...n)=>t[0](...n)]).current;return W(()=>{t[0]=e}),t[1]},X="popstate",R="pushState",b="replaceState",Y="hashchange",O=[X,R,b,Y],Z=e=>{for(const t of O)addEventListener(t,e);return()=>{for(const t of O)removeEventListener(t,e)}},q=(e,t)=>G.useSyncExternalStore(Z,e,t),ee=()=>location.search,te=({ssrSearch:e=""}={})=>q(ee,()=>e),j=()=>location.pathname,ne=({ssrPath:e}={})=>q(j,e?()=>e:j),re=(e,{replace:t=!1,state:n=null}={})=>history[t?b:R](n,"",e),se=(e={})=>[ne(e),re],_=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[_]>"u"){for(const e of[R,b]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),s=new Event(e);return s.arguments=arguments,dispatchEvent(s),n}}Object.defineProperty(window,_,{value:!0})}const oe=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",D=(e="")=>e==="/"?"":e,ae=(e,t)=>e[0]==="~"?e.slice(1):D(t)+e,ce=(e="",t)=>oe(P(D(e)),P(t)),ue=e=>e[0]==="?"?e.slice(1):e,P=e=>{try{return decodeURI(e)}catch{return e}},ie=e=>P(ue(e)),I={hook:se,searchHook:te,parser:N,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},K=u.createContext(I),S=()=>u.useContext(K),V={},H=u.createContext(V),fe=()=>u.useContext(H),v=e=>{const[t,n]=e.hook(e);return[ce(e.base,t),g((s,r)=>n(ae(s,e.base),r))]},M=()=>v(S()),le=()=>{const e=S();return ie(e.searchHook(e))},k=(e,t,n,s)=>{const{pattern:r,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",s),o=r.exec(n)||[],[f,...h]=o;return f!==void 0?[!0,(()=>{const l=a!==!1?Object.fromEntries(a.map((c,d)=>[c,h[d]])):o.groups;let i={...h};return l&&Object.assign(i,l),i})(),...s?[f]:[]]:[!1,null]},ye=e=>k(S().parser,e,M()[0]),he=({children:e,...t})=>{const n=S(),s=t.hook?I:n;let r=s;const[a,o]=t.ssrPath?.split("?")??[];o&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs;let f=u.useRef({}),h=f.current,l=h;for(let i in s){const c=i==="base"?s[i]+(t[i]||""):t[i]||s[i];h===l&&c!==l[i]&&(f.current=l={...l}),l[i]=c,(c!==s[i]||c!==r[i])&&(r=l)}return u.createElement(K.Provider,{value:r,children:e})},U=({children:e,component:t},n)=>t?u.createElement(t,{params:n}):typeof e=="function"?e(n):e,de=e=>{let t=u.useRef(V);const n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([s,r])=>r!==n[s])?e:n};function Se(){const[e,t]=M(),n=le(),s=u.useMemo(()=>new URLSearchParams(n),[n]);let r=s;const a=g((o,f)=>{r=new URLSearchParams(typeof o=="function"?o(r):o),t(e+"?"+r,f)});return[s,a]}const Ee=({path:e,nest:t,match:n,...s})=>{const r=S(),[a]=v(r),[o,f,h]=n??k(r.parser,e,a,t),l=de({...fe(),...f});if(!o)return null;const i=h?u.createElement(he,{base:h},U(s,l)):U(s,l);return u.createElement(H.Provider,{value:l,children:i})},ve=u.forwardRef((e,t)=>{const n=S(),[s,r]=v(n),{to:a="",href:o=a,onClick:f,asChild:h,children:l,className:i,replace:c,state:d,...y}=e,E=g(m=>{m.ctrlKey||m.metaKey||m.altKey||m.shiftKey||m.button!==0||(f?.(m),m.defaultPrevented||(m.preventDefault(),r(o,e)))}),p=n.hrefs(o[0]==="~"?o.slice(1):n.base+o,n);return h&&u.isValidElement(l)?u.cloneElement(l,{onClick:E,href:p}):u.createElement("a",{...y,onClick:E,href:p,className:i?.call?i(s===o):i,children:l,ref:t})}),A=e=>Array.isArray(e)?e.flatMap(t=>A(t&&t.type===u.Fragment?t.props.children:t)):[e],ge=({children:e,location:t})=>{const n=S(),[s]=v(n);for(const r of A(e)){let a=0;if(u.isValidElement(r)&&(a=k(n.parser,r.props.path,t||s,r.props.nest))[0])return u.cloneElement(r,{match:a})}return null},we=e=>{const{to:t,href:n=t}=e,s=S(),[,r]=v(s),a=g(()=>r(t||n,e)),{ssrContext:o}=s;return $(()=>{a()},[]),o&&(o.redirectTo=t),null};export{ve as L,Ee as R,ge as S,M as a,he as b,se as c,we as d,fe as e,S as f,le as g,Se as h,k as m,ye as u};
|
|
10
|
+
//# sourceMappingURL=index-CRRRLlCc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CRRRLlCc.js","sources":["../../node_modules/regexparam/dist/index.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/wouter/esm/react-deps.js","../../node_modules/wouter/esm/use-browser-location.js","../../node_modules/wouter/esm/index.js"],"sourcesContent":["/**\n * @param {string|RegExp} input The route pattern\n * @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.\n */\nexport function parse(input, loose) {\n\tif (input instanceof RegExp) return { keys:false, pattern:input };\n\tvar c, o, tmp, ext, keys=[], pattern='', arr = input.split('/');\n\tarr[0] || arr.shift();\n\n\twhile (tmp = arr.shift()) {\n\t\tc = tmp[0];\n\t\tif (c === '*') {\n\t\t\tkeys.push(c);\n\t\t\tpattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)';\n\t\t} else if (c === ':') {\n\t\t\to = tmp.indexOf('?', 1);\n\t\t\text = tmp.indexOf('.', 1);\n\t\t\tkeys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );\n\t\t\tpattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';\n\t\t\tif (!!~ext) pattern += (!!~o ? '?' : '') + '\\\\' + tmp.substring(ext);\n\t\t} else {\n\t\t\tpattern += '/' + tmp;\n\t\t}\n\t}\n\n\treturn {\n\t\tkeys: keys,\n\t\tpattern: new RegExp('^' + pattern + (loose ? '(?=$|\\/)' : '\\/?$'), 'i')\n\t};\n}\n\nvar RGX = /(\\/|^)([:*][^/]*?)(\\?)?(?=[/.]|$)/g;\n\n// error if key missing?\nexport function inject(route, values) {\n\treturn route.replace(RGX, (x, lead, key, optional) => {\n\t\tx = values[key=='*' ? key : key.substring(1)];\n\t\treturn x ? '/'+x : (optional || key=='*') ? '' : '/' + key;\n\t});\n}\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","import * as React from 'react';\nexport { Fragment, cloneElement, createContext, createElement, forwardRef, isValidElement, useContext, useMemo, useRef, useState } from 'react';\nexport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';\n\n// React.useInsertionEffect is not available in React <18\n// This hack fixes a transpilation issue on some apps\nconst useBuiltinInsertionEffect = React[\"useInsertion\" + \"Effect\"];\n\n// Copied from:\n// https://github.com/facebook/react/blob/main/packages/shared/ExecutionEnvironment.js\nconst canUseDOM = !!(\n typeof window !== \"undefined\" &&\n typeof window.document !== \"undefined\" &&\n typeof window.document.createElement !== \"undefined\"\n);\n\n// Copied from:\n// https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.ts\n// \"React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\"\nconst useIsomorphicLayoutEffect = canUseDOM\n ? React.useLayoutEffect\n : React.useEffect;\n\n// useInsertionEffect is already a noop on the server.\n// See: https://github.com/facebook/react/blob/main/packages/react-server/src/ReactFizzHooks.js\nconst useInsertionEffect =\n useBuiltinInsertionEffect || useIsomorphicLayoutEffect;\n\n// Userland polyfill while we wait for the forthcoming\n// https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md\n// Note: \"A high-fidelity polyfill for useEvent is not possible because\n// there is no lifecycle or Hook in React that we can use to switch\n// .current at the right timing.\"\n// So we will have to make do with this \"close enough\" approach for now.\nconst useEvent = (fn) => {\n const ref = React.useRef([fn, (...args) => ref[0](...args)]).current;\n // Per Dan Abramov: useInsertionEffect executes marginally closer to the\n // correct timing for ref synchronization than useLayoutEffect on React 18.\n // See: https://github.com/facebook/react/pull/25881#issuecomment-1356244360\n useInsertionEffect(() => {\n ref[0] = fn;\n });\n return ref[1];\n};\n\nexport { useEvent, useInsertionEffect, useIsomorphicLayoutEffect };\n","import { useSyncExternalStore } from './react-deps.js';\n\n/**\n * History API docs @see https://developer.mozilla.org/en-US/docs/Web/API/History\n */\nconst eventPopstate = \"popstate\";\nconst eventPushState = \"pushState\";\nconst eventReplaceState = \"replaceState\";\nconst eventHashchange = \"hashchange\";\nconst events = [\n eventPopstate,\n eventPushState,\n eventReplaceState,\n eventHashchange,\n];\n\nconst subscribeToLocationUpdates = (callback) => {\n for (const event of events) {\n addEventListener(event, callback);\n }\n return () => {\n for (const event of events) {\n removeEventListener(event, callback);\n }\n };\n};\n\nconst useLocationProperty = (fn, ssrFn) =>\n useSyncExternalStore(subscribeToLocationUpdates, fn, ssrFn);\n\nconst currentSearch = () => location.search;\n\nconst useSearch = ({ ssrSearch = \"\" } = {}) =>\n useLocationProperty(currentSearch, () => ssrSearch);\n\nconst currentPathname = () => location.pathname;\n\nconst usePathname = ({ ssrPath } = {}) =>\n useLocationProperty(\n currentPathname,\n ssrPath ? () => ssrPath : currentPathname\n );\n\nconst currentHistoryState = () => history.state;\nconst useHistoryState = () =>\n useLocationProperty(currentHistoryState, () => null);\n\nconst navigate = (to, { replace = false, state = null } = {}) =>\n history[replace ? eventReplaceState : eventPushState](state, \"\", to);\n\n// the 2nd argument of the `useBrowserLocation` return value is a function\n// that allows to perform a navigation.\nconst useBrowserLocation = (opts = {}) => [usePathname(opts), navigate];\n\nconst patchKey = Symbol.for(\"wouter_v3\");\n\n// While History API does have `popstate` event, the only\n// proper way to listen to changes via `push/replaceState`\n// is to monkey-patch these methods.\n//\n// See https://stackoverflow.com/a/4585031\nif (typeof history !== \"undefined\" && typeof window[patchKey] === \"undefined\") {\n for (const type of [eventPushState, eventReplaceState]) {\n const original = history[type];\n // TODO: we should be using unstable_batchedUpdates to avoid multiple re-renders,\n // however that will require an additional peer dependency on react-dom.\n // See: https://github.com/reactwg/react-18/discussions/86#discussioncomment-1567149\n history[type] = function () {\n const result = original.apply(this, arguments);\n const event = new Event(type);\n event.arguments = arguments;\n\n dispatchEvent(event);\n return result;\n };\n }\n\n // patch history object only once\n // See: https://github.com/molefrog/wouter/issues/167\n Object.defineProperty(window, patchKey, { value: true });\n}\n\nexport { navigate, useBrowserLocation, useHistoryState, useLocationProperty, usePathname, useSearch };\n","import { parse } from 'regexparam';\nimport { useBrowserLocation, useSearch as useSearch$1 } from './use-browser-location.js';\nimport { createContext, forwardRef, useEvent, isValidElement, cloneElement, createElement, useContext, useRef, useMemo, useIsomorphicLayoutEffect, Fragment } from './react-deps.js';\n\n/*\n * Transforms `path` into its relative `base` version\n * If base isn't part of the path provided returns absolute path e.g. `~/app`\n */\nconst _relativePath = (base, path) =>\n !path.toLowerCase().indexOf(base.toLowerCase())\n ? path.slice(base.length) || \"/\"\n : \"~\" + path;\n\n/**\n * When basepath is `undefined` or '/' it is ignored (we assume it's empty string)\n */\nconst baseDefaults = (base = \"\") => (base === \"/\" ? \"\" : base);\n\nconst absolutePath = (to, base) =>\n to[0] === \"~\" ? to.slice(1) : baseDefaults(base) + to;\n\nconst relativePath = (base = \"\", path) =>\n _relativePath(unescape(baseDefaults(base)), unescape(path));\n\n/*\n * Removes leading question mark\n */\nconst stripQm = (str) => (str[0] === \"?\" ? str.slice(1) : str);\n\n/*\n * decodes escape sequences such as %20\n */\nconst unescape = (str) => {\n try {\n return decodeURI(str);\n } catch (_e) {\n // fail-safe mode: if string can't be decoded do nothing\n return str;\n }\n};\n\nconst sanitizeSearch = (search) => unescape(stripQm(search));\n\n/*\n * Router and router context. Router is a lightweight object that represents the current\n * routing options: how location is managed, base path etc.\n *\n * There is a default router present for most of the use cases, however it can be overridden\n * via the <Router /> component.\n */\n\nconst defaultRouter = {\n hook: useBrowserLocation,\n searchHook: useSearch$1,\n parser: parse,\n base: \"\",\n // this option is used to override the current location during SSR\n ssrPath: undefined,\n ssrSearch: undefined,\n // optional context to track render state during SSR\n ssrContext: undefined,\n // customizes how `href` props are transformed for <Link />\n hrefs: (x) => x,\n};\n\nconst RouterCtx = createContext(defaultRouter);\n\n// gets the closest parent router from the context\nconst useRouter = () => useContext(RouterCtx);\n\n/**\n * Parameters context. Used by `useParams()` to get the\n * matched params from the innermost `Route` component.\n */\n\nconst Params0 = {},\n ParamsCtx = createContext(Params0);\n\nconst useParams = () => useContext(ParamsCtx);\n\n/*\n * Part 1, Hooks API: useRoute and useLocation\n */\n\n// Internal version of useLocation to avoid redundant useRouter calls\n\nconst useLocationFromRouter = (router) => {\n const [location, navigate] = router.hook(router);\n\n // the function reference should stay the same between re-renders, so that\n // it can be passed down as an element prop without any performance concerns.\n // (This is achieved via `useEvent`.)\n return [\n relativePath(router.base, location),\n useEvent((to, navOpts) => navigate(absolutePath(to, router.base), navOpts)),\n ];\n};\n\nconst useLocation = () => useLocationFromRouter(useRouter());\n\nconst useSearch = () => {\n const router = useRouter();\n return sanitizeSearch(router.searchHook(router));\n};\n\nconst matchRoute = (parser, route, path, loose) => {\n // if the input is a regexp, skip parsing\n const { pattern, keys } =\n route instanceof RegExp\n ? { keys: false, pattern: route }\n : parser(route || \"*\", loose);\n\n // array destructuring loses keys, so this is done in two steps\n const result = pattern.exec(path) || [];\n\n // when parser is in \"loose\" mode, `$base` is equal to the\n // first part of the route that matches the pattern\n // (e.g. for pattern `/a/:b` and path `/a/1/2/3` the `$base` is `a/1`)\n // we use this for route nesting\n const [$base, ...matches] = result;\n\n return $base !== undefined\n ? [\n true,\n\n (() => {\n // for regex paths, `keys` will always be false\n\n // an object with parameters matched, e.g. { foo: \"bar\" } for \"/:foo\"\n // we \"zip\" two arrays here to construct the object\n // [\"foo\"], [\"bar\"] → { foo: \"bar\" }\n const groups =\n keys !== false\n ? Object.fromEntries(keys.map((key, i) => [key, matches[i]]))\n : result.groups;\n\n // convert the array to an instance of object\n // this makes it easier to integrate with the existing param implementation\n let obj = { ...matches };\n\n // merge named capture groups with matches array\n groups && Object.assign(obj, groups);\n\n return obj;\n })(),\n\n // the third value if only present when parser is in \"loose\" mode,\n // so that we can extract the base path for nested routes\n ...(loose ? [$base] : []),\n ]\n : [false, null];\n};\n\nconst useRoute = (pattern) =>\n matchRoute(useRouter().parser, pattern, useLocation()[0]);\n\n/*\n * Part 2, Low Carb Router API: Router, Route, Link, Switch\n */\n\nconst Router = ({ children, ...props }) => {\n // the router we will inherit from - it is the closest router in the tree,\n // unless the custom `hook` is provided (in that case it's the default one)\n const parent_ = useRouter();\n const parent = props.hook ? defaultRouter : parent_;\n\n // holds to the context value: the router object\n let value = parent;\n\n // when `ssrPath` contains a `?` character, we can extract the search from it\n const [path, search] = props.ssrPath?.split(\"?\") ?? [];\n if (search) (props.ssrSearch = search), (props.ssrPath = path);\n\n // hooks can define their own `href` formatter (e.g. for hash location)\n props.hrefs = props.hrefs ?? props.hook?.hrefs;\n\n // what is happening below: to avoid unnecessary rerenders in child components,\n // we ensure that the router object reference is stable, unless there are any\n // changes that require reload (e.g. `base` prop changes -> all components that\n // get the router from the context should rerender, even if the component is memoized).\n // the expected behaviour is:\n //\n // 1) when the resulted router is no different from the parent, use parent\n // 2) if the custom `hook` prop is provided, we always inherit from the\n // default router instead. this resets all previously overridden options.\n // 3) when the router is customized here, it should stay stable between renders\n let ref = useRef({}),\n prev = ref.current,\n next = prev;\n\n for (let k in parent) {\n const option =\n k === \"base\"\n ? /* base is special case, it is appended to the parent's base */\n parent[k] + (props[k] || \"\")\n : props[k] || parent[k];\n\n if (prev === next && option !== next[k]) {\n ref.current = next = { ...next };\n }\n\n next[k] = option;\n\n // the new router is no different from the parent or from the memoized value, use parent\n if (option !== parent[k] || option !== value[k]) value = next;\n }\n\n return createElement(RouterCtx.Provider, { value, children });\n};\n\nconst h_route = ({ children, component }, params) => {\n // React-Router style `component` prop\n if (component) return createElement(component, { params });\n\n // support render prop or plain children\n return typeof children === \"function\" ? children(params) : children;\n};\n\n// Cache params object between renders if values are shallow equal\nconst useCachedParams = (value) => {\n let prev = useRef(Params0);\n const curr = prev.current;\n return (prev.current =\n // Update cache if number of params changed or any value changed\n Object.keys(value).length !== Object.keys(curr).length ||\n Object.entries(value).some(([k, v]) => v !== curr[k])\n ? value // Return new value if there are changes\n : curr); // Return cached value if nothing changed\n};\n\nfunction useSearchParams() {\n const [location, navigate] = useLocation();\n\n const search = useSearch();\n const searchParams = useMemo(() => new URLSearchParams(search), [search]);\n\n // cached value before next render, so you can call setSearchParams multiple times\n let tempSearchParams = searchParams;\n\n const setSearchParams = useEvent((nextInit, options) => {\n tempSearchParams = new URLSearchParams(\n typeof nextInit === \"function\" ? nextInit(tempSearchParams) : nextInit\n );\n navigate(location + \"?\" + tempSearchParams, options);\n });\n\n return [searchParams, setSearchParams];\n}\n\nconst Route = ({ path, nest, match, ...renderProps }) => {\n const router = useRouter();\n const [location] = useLocationFromRouter(router);\n\n const [matches, routeParams, base] =\n // `match` is a special prop to give up control to the parent,\n // it is used by the `Switch` to avoid double matching\n match ?? matchRoute(router.parser, path, location, nest);\n\n // when `routeParams` is `null` (there was no match), the argument\n // below becomes {...null} = {}, see the Object Spread specs\n // https://tc39.es/proposal-object-rest-spread/#AbstractOperations-CopyDataProperties\n const params = useCachedParams({ ...useParams(), ...routeParams });\n\n if (!matches) return null;\n\n const children = base\n ? createElement(Router, { base }, h_route(renderProps, params))\n : h_route(renderProps, params);\n\n return createElement(ParamsCtx.Provider, { value: params, children });\n};\n\nconst Link = forwardRef((props, ref) => {\n const router = useRouter();\n const [currentPath, navigate] = useLocationFromRouter(router);\n\n const {\n to = \"\",\n href: targetPath = to,\n onClick: _onClick,\n asChild,\n children,\n className: cls,\n /* eslint-disable no-unused-vars */\n replace /* ignore nav props */,\n state /* ignore nav props */,\n /* eslint-enable no-unused-vars */\n\n ...restProps\n } = props;\n\n const onClick = useEvent((event) => {\n // ignores the navigation when clicked using right mouse button or\n // by holding a special modifier key: ctrl, command, win, alt, shift\n if (\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.shiftKey ||\n event.button !== 0\n )\n return;\n\n _onClick?.(event);\n if (!event.defaultPrevented) {\n event.preventDefault();\n navigate(targetPath, props);\n }\n });\n\n // handle nested routers and absolute paths\n const href = router.hrefs(\n targetPath[0] === \"~\" ? targetPath.slice(1) : router.base + targetPath,\n router // pass router as a second argument for convinience\n );\n\n return asChild && isValidElement(children)\n ? cloneElement(children, { onClick, href })\n : createElement(\"a\", {\n ...restProps,\n onClick,\n href,\n // `className` can be a function to apply the class if this link is active\n className: cls?.call ? cls(currentPath === targetPath) : cls,\n children,\n ref,\n });\n});\n\nconst flattenChildren = (children) =>\n Array.isArray(children)\n ? children.flatMap((c) =>\n flattenChildren(c && c.type === Fragment ? c.props.children : c)\n )\n : [children];\n\nconst Switch = ({ children, location }) => {\n const router = useRouter();\n const [originalLocation] = useLocationFromRouter(router);\n\n for (const element of flattenChildren(children)) {\n let match = 0;\n\n if (\n isValidElement(element) &&\n // we don't require an element to be of type Route,\n // but we do require it to contain a truthy `path` prop.\n // this allows to use different components that wrap Route\n // inside of a switch, for example <AnimatedRoute />.\n (match = matchRoute(\n router.parser,\n element.props.path,\n location || originalLocation,\n element.props.nest\n ))[0]\n )\n return cloneElement(element, { match });\n }\n\n return null;\n};\n\nconst Redirect = (props) => {\n const { to, href = to } = props;\n const router = useRouter();\n const [, navigate] = useLocationFromRouter(router);\n const redirect = useEvent(() => navigate(to || href, props));\n const { ssrContext } = router;\n\n // redirect is guaranteed to be stable since it is returned from useEvent\n useIsomorphicLayoutEffect(() => {\n redirect();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n if (ssrContext) {\n ssrContext.redirectTo = to;\n }\n\n return null;\n};\n\nexport { Link, Redirect, Route, Router, Switch, matchRoute, useLocation, useParams, useRoute, useRouter, useSearch, useSearchParams };\n"],"names":["parse","input","loose","c","o","tmp","ext","keys","pattern","arr","React","require$$0","is","x","y","objectIs","useState","useEffect","useLayoutEffect","useDebugValue","useSyncExternalStore$2","subscribe","getSnapshot","value","_useState","inst","forceUpdate","checkIfSnapshotChanged","latestGetSnapshot","nextValue","useSyncExternalStore$1","shim","useSyncExternalStoreShim_production","shimModule","useBuiltinInsertionEffect","canUseDOM","useIsomorphicLayoutEffect","React.useLayoutEffect","React.useEffect","useInsertionEffect","useEvent","fn","ref","React.useRef","args","eventPopstate","eventPushState","eventReplaceState","eventHashchange","events","subscribeToLocationUpdates","callback","event","useLocationProperty","ssrFn","useSyncExternalStore","currentSearch","useSearch","ssrSearch","currentPathname","usePathname","ssrPath","navigate","to","replace","state","useBrowserLocation","opts","patchKey","type","original","result","_relativePath","base","path","baseDefaults","absolutePath","relativePath","unescape","stripQm","str","sanitizeSearch","search","defaultRouter","useSearch$1","RouterCtx","createContext","useRouter","useContext","Params0","ParamsCtx","useParams","useLocationFromRouter","router","location","navOpts","useLocation","matchRoute","parser","route","$base","matches","groups","key","i","obj","useRoute","Router","children","props","parent_","parent","useRef","prev","next","k","option","createElement","h_route","component","params","useCachedParams","curr","v","useSearchParams","searchParams","useMemo","tempSearchParams","setSearchParams","nextInit","options","Route","nest","match","renderProps","routeParams","Link","forwardRef","currentPath","targetPath","_onClick","asChild","cls","restProps","onClick","href","isValidElement","cloneElement","flattenChildren","Fragment","Switch","originalLocation","element","Redirect","redirect","ssrContext"],"mappings":"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","x_google_ignoreList":[0,1,2,3,4,5]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let t=[],i=0;const f=4;let a=0,c=r=>{let s=[],e={get(){return e.lc||e.listen(()=>{})(),e.value},lc:0,listen(l){return e.lc=s.push(l),()=>{for(let u=i+f;u<t.length;)t[u]===l?t.splice(u,f):u+=f;let n=s.indexOf(l);~n&&(s.splice(n,1),--e.lc||e.off())}},notify(l,n){a++;let u=!t.length;for(let o of s)t.push(o,e.value,l,n);if(u){for(i=0;i<t.length;i+=f)t[i](t[i+1],t[i+2],t[i+3]);t.length=0}},off(){},set(l){let n=e.value;n!==l&&(e.value=l,e.notify(n))},subscribe(l){let n=e.listen(l);return l(e.value),n},value:r};return e};const h=r=>r;export{c as a,a as e,h as r};
|
|
2
|
+
//# sourceMappingURL=index-CSV4ZXsq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CSV4ZXsq.js","sources":["../../node_modules/nanostores/atom/index.js"],"sourcesContent":["import { clean } from '../clean-stores/index.js'\n\nlet listenerQueue = []\nlet lqIndex = 0\nconst QUEUE_ITEMS_PER_LISTENER = 4\nexport let epoch = 0\n\nexport let atom = initialValue => {\n let listeners = []\n let $atom = {\n get() {\n if (!$atom.lc) {\n $atom.listen(() => {})()\n }\n return $atom.value\n },\n lc: 0,\n listen(listener) {\n $atom.lc = listeners.push(listener)\n\n return () => {\n for (\n let i = lqIndex + QUEUE_ITEMS_PER_LISTENER;\n i < listenerQueue.length;\n\n ) {\n if (listenerQueue[i] === listener) {\n listenerQueue.splice(i, QUEUE_ITEMS_PER_LISTENER)\n } else {\n i += QUEUE_ITEMS_PER_LISTENER\n }\n }\n\n let index = listeners.indexOf(listener)\n if (~index) {\n listeners.splice(index, 1)\n if (!--$atom.lc) $atom.off()\n }\n }\n },\n notify(oldValue, changedKey) {\n epoch++\n let runListenerQueue = !listenerQueue.length\n for (let listener of listeners) {\n listenerQueue.push(listener, $atom.value, oldValue, changedKey)\n }\n\n if (runListenerQueue) {\n for (\n lqIndex = 0;\n lqIndex < listenerQueue.length;\n lqIndex += QUEUE_ITEMS_PER_LISTENER\n ) {\n listenerQueue[lqIndex](\n listenerQueue[lqIndex + 1],\n listenerQueue[lqIndex + 2],\n listenerQueue[lqIndex + 3]\n )\n }\n listenerQueue.length = 0\n }\n },\n /* It will be called on last listener unsubscribing.\n We will redefine it in onMount and onStop. */\n off() {},\n set(newValue) {\n let oldValue = $atom.value\n if (oldValue !== newValue) {\n $atom.value = newValue\n $atom.notify(oldValue)\n }\n },\n subscribe(listener) {\n let unbind = $atom.listen(listener)\n listener($atom.value)\n return unbind\n },\n value: initialValue\n }\n\n if (process.env.NODE_ENV !== 'production') {\n $atom[clean] = () => {\n listeners = []\n $atom.lc = 0\n $atom.off()\n }\n }\n\n return $atom\n}\n\nexport const readonlyType = store => store\n"],"names":["listenerQueue","lqIndex","QUEUE_ITEMS_PER_LISTENER","epoch","atom","initialValue","listeners","$atom","listener","i","index","oldValue","changedKey","runListenerQueue","newValue","unbind","readonlyType","store"],"mappings":"AAEA,IAAIA,EAAgB,CAAA,EAChBC,EAAU,EACd,MAAMC,EAA2B,EAC1B,IAAIC,EAAQ,EAERC,EAAOC,GAAgB,CAChC,IAAIC,EAAY,CAAA,EACZC,EAAQ,CACV,KAAM,CACJ,OAAKA,EAAM,IACTA,EAAM,OAAO,IAAM,CAAC,CAAC,EAAA,EAEhBA,EAAM,KACf,EACA,GAAI,EACJ,OAAOC,EAAU,CACf,OAAAD,EAAM,GAAKD,EAAU,KAAKE,CAAQ,EAE3B,IAAM,CACX,QACMC,EAAIR,EAAUC,EAClBO,EAAIT,EAAc,QAGdA,EAAcS,CAAC,IAAMD,EACvBR,EAAc,OAAOS,EAAGP,CAAwB,EAEhDO,GAAKP,EAIT,IAAIQ,EAAQJ,EAAU,QAAQE,CAAQ,EAClC,CAACE,IACHJ,EAAU,OAAOI,EAAO,CAAC,EACpB,EAAEH,EAAM,MAAU,IAAA,EAE3B,CACF,EACA,OAAOI,EAAUC,EAAY,CAC3BT,IACA,IAAIU,EAAmB,CAACb,EAAc,OACtC,QAASQ,KAAYF,EACnBN,EAAc,KAAKQ,EAAUD,EAAM,MAAOI,EAAUC,CAAU,EAGhE,GAAIC,EAAkB,CACpB,IACEZ,EAAU,EACVA,EAAUD,EAAc,OACxBC,GAAWC,EAEXF,EAAcC,CAAO,EACnBD,EAAcC,EAAU,CAAC,EACzBD,EAAcC,EAAU,CAAC,EACzBD,EAAcC,EAAU,CAAC,CAAA,EAG7BD,EAAc,OAAS,CACzB,CACF,EAGA,KAAM,CAAC,EACP,IAAIc,EAAU,CACZ,IAAIH,EAAWJ,EAAM,MACjBI,IAAaG,IACfP,EAAM,MAAQO,EACdP,EAAM,OAAOI,CAAQ,EAEzB,EACA,UAAUH,EAAU,CAClB,IAAIO,EAASR,EAAM,OAAOC,CAAQ,EAClC,OAAAA,EAASD,EAAM,KAAK,EACbQ,CACT,EACA,MAAOV,CAAA,EAWT,OAAOE,CACT,EAEO,MAAMS,EAAeC,GAASA","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{$ as ns,L as bn,I as _n,a as Pe,B as ss}from"./index-DaWNRjkx.js";import{j as d}from"./jsx-runtime-DoEZbXM1.js";import{r as w}from"./index-i4mjW0og.js";import{u as rs,L as oe}from"./index-CRRRLlCc.js";import{g as is,c as wn,a as Sn,b as os,h as as,f as cs,e as ls,i as us,d as hs,I as ds,j as fs,m as ps,k as ms,l as gs}from"./IconWorld-DtARpBKX.js";import{a as te}from"./index-CSV4ZXsq.js";import{useStore as Nt}from"./shared/@nanostores_react-HTG3s0lp.js";import{logout as ys,debounce as vs}from"./shared/@utils-BQyGUOvP.js";const Es="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Rs="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",ee=(n,e)=>{for(const t in e)n[t]=e[t];return n},Ot="numeric",At="ascii",kt="alpha",me="asciinumeric",fe="alphanumeric",Tt="domain",Cn="emoji",bs="scheme",_s="slashscheme",gt="whitespace";function ws(n,e){return n in e||(e[n]=[]),e[n]}function Z(n,e,t){e[Ot]&&(e[me]=!0,e[fe]=!0),e[At]&&(e[me]=!0,e[kt]=!0),e[me]&&(e[fe]=!0),e[kt]&&(e[fe]=!0),e[fe]&&(e[Tt]=!0),e[Cn]&&(e[Tt]=!0);for(const s in e){const r=ws(s,t);r.indexOf(n)<0&&r.push(n)}}function Ss(n,e){const t={};for(const s in e)e[s].indexOf(n)>=0&&(t[s]=!0);return t}function T(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}T.groups={};T.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let s=0;s<e.jr.length;s++){const r=e.jr[s][0],i=e.jr[s][1];if(i&&r.test(n))return i}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,s){for(let r=0;r<n.length;r++)this.tt(n[r],e,t,s)},tr(n,e,t,s){s=s||T.groups;let r;return e&&e.j?r=e:(r=new T(e),t&&s&&Z(e,t,s)),this.jr.push([n,r]),r},ts(n,e,t,s){let r=this;const i=n.length;if(!i)return r;for(let o=0;o<i-1;o++)r=r.tt(n[o]);return r.tt(n[i-1],e,t,s)},tt(n,e,t,s){s=s||T.groups;const r=this;if(e&&e.j)return r.j[n]=e,e;const i=e;let o,a=r.go(n);if(a?(o=new T,ee(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new T,i){if(s)if(o.t&&typeof o.t=="string"){const l=ee(Ss(o.t,s),t);Z(i,l,s)}else t&&Z(i,t,s);o.t=i}return r.j[n]=o,o}};const R=(n,e,t,s,r)=>n.ta(e,t,s,r),C=(n,e,t,s,r)=>n.tr(e,t,s,r),nn=(n,e,t,s,r)=>n.ts(e,t,s,r),h=(n,e,t,s,r)=>n.tt(e,t,s,r),$="WORD",Lt="UWORD",Nn="ASCIINUMERICAL",On="ALPHANUMERICAL",be="LOCALHOST",xt="TLD",Pt="UTLD",Ae="SCHEME",ie="SLASH_SCHEME",Ut="NUM",It="WS",Ft="NL",ge="OPENBRACE",ye="CLOSEBRACE",Ie="OPENBRACKET",je="CLOSEBRACKET",De="OPENPAREN",Be="CLOSEPAREN",Me="OPENANGLEBRACKET",He="CLOSEANGLEBRACKET",qe="FULLWIDTHLEFTPAREN",Ue="FULLWIDTHRIGHTPAREN",Fe="LEFTCORNERBRACKET",Je="RIGHTCORNERBRACKET",We="LEFTWHITECORNERBRACKET",$e="RIGHTWHITECORNERBRACKET",Ke="FULLWIDTHLESSTHAN",ze="FULLWIDTHGREATERTHAN",Ve="AMPERSAND",Ye="APOSTROPHE",Qe="ASTERISK",z="AT",Ge="BACKSLASH",Xe="BACKTICK",Ze="CARET",V="COLON",Jt="COMMA",et="DOLLAR",D="DOT",tt="EQUALS",Wt="EXCLAMATION",P="HYPHEN",ve="PERCENT",nt="PIPE",st="PLUS",rt="POUND",Ee="QUERY",$t="QUOTE",An="FULLWIDTHMIDDLEDOT",Kt="SEMI",B="SLASH",Re="TILDE",it="UNDERSCORE",kn="EMOJI",ot="SYM";var Tn=Object.freeze({__proto__:null,ALPHANUMERICAL:On,AMPERSAND:Ve,APOSTROPHE:Ye,ASCIINUMERICAL:Nn,ASTERISK:Qe,AT:z,BACKSLASH:Ge,BACKTICK:Xe,CARET:Ze,CLOSEANGLEBRACKET:He,CLOSEBRACE:ye,CLOSEBRACKET:je,CLOSEPAREN:Be,COLON:V,COMMA:Jt,DOLLAR:et,DOT:D,EMOJI:kn,EQUALS:tt,EXCLAMATION:Wt,FULLWIDTHGREATERTHAN:ze,FULLWIDTHLEFTPAREN:qe,FULLWIDTHLESSTHAN:Ke,FULLWIDTHMIDDLEDOT:An,FULLWIDTHRIGHTPAREN:Ue,HYPHEN:P,LEFTCORNERBRACKET:Fe,LEFTWHITECORNERBRACKET:We,LOCALHOST:be,NL:Ft,NUM:Ut,OPENANGLEBRACKET:Me,OPENBRACE:ge,OPENBRACKET:Ie,OPENPAREN:De,PERCENT:ve,PIPE:nt,PLUS:st,POUND:rt,QUERY:Ee,QUOTE:$t,RIGHTCORNERBRACKET:Je,RIGHTWHITECORNERBRACKET:$e,SCHEME:Ae,SEMI:Kt,SLASH:B,SLASH_SCHEME:ie,SYM:ot,TILDE:Re,TLD:xt,UNDERSCORE:it,UTLD:Pt,UWORD:Lt,WORD:$,WS:It});const U=/[a-z]/,ue=new RegExp("\\p{L}","u"),yt=new RegExp("\\p{Emoji}","u"),F=/\d/,vt=/\s/,sn="\r",Et=`
|
|
2
|
+
`,Cs="️",Ns="",Rt="";let we=null,Se=null;function Os(n=[]){const e={};T.groups=e;const t=new T;we==null&&(we=rn(Es)),Se==null&&(Se=rn(Rs)),h(t,"'",Ye),h(t,"{",ge),h(t,"}",ye),h(t,"[",Ie),h(t,"]",je),h(t,"(",De),h(t,")",Be),h(t,"<",Me),h(t,">",He),h(t,"(",qe),h(t,")",Ue),h(t,"「",Fe),h(t,"」",Je),h(t,"『",We),h(t,"』",$e),h(t,"<",Ke),h(t,">",ze),h(t,"&",Ve),h(t,"*",Qe),h(t,"@",z),h(t,"`",Xe),h(t,"^",Ze),h(t,":",V),h(t,",",Jt),h(t,"$",et),h(t,".",D),h(t,"=",tt),h(t,"!",Wt),h(t,"-",P),h(t,"%",ve),h(t,"|",nt),h(t,"+",st),h(t,"#",rt),h(t,"?",Ee),h(t,'"',$t),h(t,"/",B),h(t,";",Kt),h(t,"~",Re),h(t,"_",it),h(t,"\\",Ge),h(t,"・",An);const s=C(t,F,Ut,{[Ot]:!0});C(s,F,s);const r=C(s,U,Nn,{[me]:!0}),i=C(s,ue,On,{[fe]:!0}),o=C(t,U,$,{[At]:!0});C(o,F,r),C(o,U,o),C(r,F,r),C(r,U,r);const a=C(t,ue,Lt,{[kt]:!0});C(a,U),C(a,F,i),C(a,ue,a),C(i,F,i),C(i,U),C(i,ue,i);const l=h(t,Et,Ft,{[gt]:!0}),c=h(t,sn,It,{[gt]:!0}),f=C(t,vt,It,{[gt]:!0});h(t,Rt,f),h(c,Et,l),h(c,Rt,f),C(c,vt,f),h(f,sn),h(f,Et),C(f,vt,f),h(f,Rt,f);const m=C(t,yt,kn,{[Cn]:!0});h(m,"#"),C(m,yt,m),h(m,Cs,m);const g=h(m,Ns);h(g,"#"),C(g,yt,m);const u=[[U,o],[F,r]],p=[[U,null],[ue,a],[F,i]];for(let y=0;y<we.length;y++)K(t,we[y],xt,$,u);for(let y=0;y<Se.length;y++)K(t,Se[y],Pt,Lt,p);Z(xt,{tld:!0,ascii:!0},e),Z(Pt,{utld:!0,alpha:!0},e),K(t,"file",Ae,$,u),K(t,"mailto",Ae,$,u),K(t,"http",ie,$,u),K(t,"https",ie,$,u),K(t,"ftp",ie,$,u),K(t,"ftps",ie,$,u),Z(Ae,{scheme:!0,ascii:!0},e),Z(ie,{slashscheme:!0,ascii:!0},e),n=n.sort((y,E)=>y[0]>E[0]?1:-1);for(let y=0;y<n.length;y++){const E=n[y][0],v=n[y][1]?{[bs]:!0}:{[_s]:!0};E.indexOf("-")>=0?v[Tt]=!0:U.test(E)?F.test(E)?v[me]=!0:v[At]=!0:v[Ot]=!0,nn(t,E,E,v)}return nn(t,"localhost",be,{ascii:!0}),t.jd=new T(ot),{start:t,tokens:ee({groups:e},Tn)}}function Ln(n,e){const t=As(e.replace(/[A-Z]/g,a=>a.toLowerCase())),s=t.length,r=[];let i=0,o=0;for(;o<s;){let a=n,l=null,c=0,f=null,m=-1,g=-1;for(;o<s&&(l=a.go(t[o]));)a=l,a.accepts()?(m=0,g=0,f=a):m>=0&&(m+=t[o].length,g++),c+=t[o].length,i+=t[o].length,o++;i-=m,o-=g,c-=m,r.push({t:f.t,v:e.slice(i-c,i),s:i-c,e:i})}return r}function As(n){const e=[],t=n.length;let s=0;for(;s<t;){let r=n.charCodeAt(s),i,o=r<55296||r>56319||s+1===t||(i=n.charCodeAt(s+1))<56320||i>57343?n[s]:n.slice(s,s+2);e.push(o),s+=o.length}return e}function K(n,e,t,s,r){let i;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];n.j[l]?i=n.j[l]:(i=new T(s),i.jr=r.slice(),n.j[l]=i),n=i}return i=new T(t),i.jr=r.slice(),n.j[e[o-1]]=i,i}function rn(n){const e=[],t=[];let s=0,r="0123456789";for(;s<n.length;){let i=0;for(;r.indexOf(n[s+i])>=0;)i++;if(i>0){e.push(t.join(""));for(let o=parseInt(n.substring(s,s+i),10);o>0;o--)t.pop();s+=i}else t.push(n[s]),s++}return e}const ae={defaultProtocol:"http",events:null,format:on,formatHref:on,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function at(n,e=null){let t=ee({},ae);n&&(t=ee(t,n instanceof at?n.o:n));const s=t.ignoreTags,r=[];for(let i=0;i<s.length;i++)r.push(s[i].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=r}at.prototype={o:ae,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const s=e!=null;let r=this.o[n];return r&&(typeof r=="object"?(r=t.t in r?r[t.t]:ae[n],typeof r=="function"&&s&&(r=r(e,t))):typeof r=="function"&&s&&(r=r(e,t.t,t)),r)},getObj(n,e,t){let s=this.o[n];return typeof s=="function"&&e!=null&&(s=s(e,t.t,t)),s},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function on(n){return n}var xn=Object.freeze({__proto__:null,Options:at,assign:ee,defaults:ae});function Pn(n,e){this.t="token",this.v=n,this.tk=e}Pn.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),s=n.get("format",e,this);return t&&s.length>t?s.substring(0,t)+"…":s},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=ae.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),s=n.get("formatHref",t,this),r=n.get("tagName",t,e),i=this.toFormattedString(n),o={},a=n.get("className",t,e),l=n.get("target",t,e),c=n.get("rel",t,e),f=n.getObj("attributes",t,e),m=n.getObj("events",t,e);return o.href=s,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),f&&ee(o,f),{tagName:r,attributes:o,content:i,eventListeners:m}}};function ct(n,e){class t extends Pn{constructor(r,i){super(r,i),this.t=n}}for(const s in e)t.prototype[s]=e[s];return t.t=n,t}const an=ct("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),cn=ct("text"),ks=ct("nl"),Ce=ct("url",{isLink:!0,toHref(n=ae.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==be&&n[1].t===V}}),x=n=>new T(n);function Ts({groups:n}){const e=n.domain.concat([Ve,Qe,z,Ge,Xe,Ze,et,tt,P,Ut,ve,nt,st,rt,B,ot,Re,it]),t=[Ye,V,Jt,D,Wt,ve,Ee,$t,Kt,Me,He,ge,ye,je,Ie,De,Be,qe,Ue,Fe,Je,We,$e,Ke,ze],s=[Ve,Ye,Qe,Ge,Xe,Ze,et,tt,P,ge,ye,ve,nt,st,rt,Ee,B,ot,Re,it],r=x(),i=h(r,Re);R(i,s,i),R(i,n.domain,i);const o=x(),a=x(),l=x();R(r,n.domain,o),R(r,n.scheme,a),R(r,n.slashscheme,l),R(o,s,i),R(o,n.domain,o);const c=h(o,z);h(i,z,c),h(a,z,c),h(l,z,c);const f=h(i,D);R(f,s,i),R(f,n.domain,i);const m=x();R(c,n.domain,m),R(m,n.domain,m);const g=h(m,D);R(g,n.domain,m);const u=x(an);R(g,n.tld,u),R(g,n.utld,u),h(c,be,u);const p=h(m,P);h(p,P,p),R(p,n.domain,m),R(u,n.domain,m),h(u,D,g),h(u,P,p);const y=h(u,V);R(y,n.numeric,an);const E=h(o,P),_=h(o,D);h(E,P,E),R(E,n.domain,o),R(_,s,i),R(_,n.domain,o);const v=x(Ce);R(_,n.tld,v),R(_,n.utld,v),R(v,n.domain,o),R(v,s,i),h(v,D,_),h(v,P,E),h(v,z,c);const S=h(v,V),k=x(Ce);R(S,n.numeric,k);const O=x(Ce),q=x();R(O,e,O),R(O,t,q),R(q,e,O),R(q,t,q),h(v,B,O),h(k,B,O);const dt=h(a,V),es=h(l,V),ts=h(es,B),ft=h(ts,B);R(a,n.domain,o),h(a,D,_),h(a,P,E),R(l,n.domain,o),h(l,D,_),h(l,P,E),R(dt,n.domain,O),h(dt,B,O),h(dt,Ee,O),R(ft,n.domain,O),R(ft,e,O),h(ft,B,O);const en=[[ge,ye],[Ie,je],[De,Be],[Me,He],[qe,Ue],[Fe,Je],[We,$e],[Ke,ze]];for(let pt=0;pt<en.length;pt++){const[tn,mt]=en[pt],_e=h(O,tn);h(q,tn,_e),h(_e,mt,O);const re=x(Ce);R(_e,e,re);const le=x();R(_e,t),R(re,e,re),R(re,t,le),R(le,e,re),R(le,t,le),h(re,mt,O),h(le,mt,O)}return h(r,be,v),h(r,Ft,ks),{start:r,tokens:Tn}}function Ls(n,e,t){let s=t.length,r=0,i=[],o=[];for(;r<s;){let a=n,l=null,c=null,f=0,m=null,g=-1;for(;r<s&&!(l=a.go(t[r].t));)o.push(t[r++]);for(;r<s&&(c=l||a.go(t[r].t));)l=null,a=c,a.accepts()?(g=0,m=a):g>=0&&g++,r++,f++;if(g<0)r-=f,r<s&&(o.push(t[r]),r++);else{o.length>0&&(i.push(bt(cn,e,o)),o=[]),r-=g,f-=g;const u=m.t,p=t.slice(r-f,r);i.push(bt(u,e,p))}}return o.length>0&&i.push(bt(cn,e,o)),i}function bt(n,e,t){const s=t[0].s,r=t[t.length-1].e,i=e.slice(s,r);return new n(i,t)}const A={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xs(){A.scanner=Os(A.customSchemes);for(let n=0;n<A.tokenQueue.length;n++)A.tokenQueue[n][1]({scanner:A.scanner});A.parser=Ts(A.scanner.tokens);for(let n=0;n<A.pluginQueue.length;n++)A.pluginQueue[n][1]({scanner:A.scanner,parser:A.parser});return A.initialized=!0,A}function In(n){return A.initialized||xs(),Ls(A.parser.start,n,Ln(A.scanner.start,n))}In.scan=Ln;function Ps(n,e,t){const s=In(n),r=[];for(let i=0;i<s.length;i++){const o=s[i];if(o.t==="nl"&&e.get("nl2br")){const a=`__linkify-el-${t.elementId++}`;r.push(w.createElement("br",{key:a}))}else if(!o.isLink||!e.check(o))r.push(o.toString());else{let a=e.render(o);if(!("key"in a.props)){const l=`__linkify-el-${t.elementId++}`,c=xn.assign({key:l},a.props);a=w.cloneElement(a,c)}r.push(a)}}return r}function jn(n,e,t){if(w.Children.count(n.props.children)===0)return n;const s=[];w.Children.forEach(n.props.children,o=>{typeof o=="string"?s.push.apply(s,Ps(o,e,t)):w.isValidElement(o)?typeof o.type=="string"&&e.ignoreTags.indexOf(o.type.toUpperCase())>=0?s.push(o):s.push(jn(o,e,t)):s.push(o)});const r=`__linkify-el-${t.elementId++}`,i=xn.assign({key:r},n.props);return w.cloneElement(n,i,s)}const Is=n=>{let e=0;const t=({tagName:l,attributes:c,content:f})=>(c.key=`__linkify-lnk-${e++}`,c.class&&(c.className=c.class,delete c.class),w.createElement(l,c,f)),s={key:"__linkify-wrapper"};for(const l in n)l!=="options"&&l!=="as"&&l!=="tagName"&&l!=="children"&&(s[l]=n[l]);const r=new at(n.options,t),i=n.as||n.tagName||w.Fragment||"span",o=n.children,a=w.createElement(i,s,o);return jn(a,r,{elementId:0})},js=({time:n})=>{const e=new Date(n);let t=e.getHours();const s=t>=12?"PM":"AM";t>12?t-=12:t===0&&(t=12);const r=String(e.getMinutes()).padStart(2,"0");return d.jsxs("div",{className:"chat-timestamp",children:[t,":",r," ",s]})},Yr=({log:n})=>{const[e,t]=rs("/history/:time?"),s=t?.time===n.created+"";return d.jsx("div",{className:`log-entry ${s?"focused":""}`,children:d.jsxs("div",{className:"log-row",children:[d.jsxs(oe,{href:`/history/${s?"":n.created}`,className:"time-link",children:[d.jsx(is,{}),d.jsx(js,{time:n.created})]}),n.action==="msg"&&d.jsxs("div",{className:"chat-message message",children:[n.user.web?"[":"",n.user.web?d.jsx("span",{className:"user",style:{color:`#${n.user.color}`},children:n.user.name}):d.jsx(oe,{href:`/players/${n.user.id}`,className:"user",style:{color:`#${n.user.color}`},children:n.user.name}),n.user.web?"]":"",":"," ",d.jsx(Is,{as:"span",children:n.message})]}),n.action==="leave"&&d.jsxs("div",{className:"message join-message",children:[d.jsx(oe,{href:`/players/${n.user.id}`,className:"user",children:n.user.name})," ","left the game."]}),n.action==="join"&&d.jsxs("div",{className:"message join-message",children:[d.jsx(oe,{href:`/players/${n.user.id}`,className:"user",children:n.user.name})," ","joined the game",n.user.isFirst?" for the first time":"","."]}),n.action==="server"&&d.jsx("div",{className:"message server-message",children:n.message})]})})},Ds=({disabled:n=!1,options:e=[],value:t,onChange:s})=>{const[r,i]=w.useState(!1),o=w.useRef(null);return w.useEffect(()=>{if(!r)return;function a(l){l.target&&!o.current?.contains(l.target)&&(console.log("[debug] close"),i(!1))}return document.addEventListener("click",a),()=>document.removeEventListener("click",a)},[r]),d.jsxs("div",{className:`dropdown ${n?"disabled":""}`,ref:o,children:[r&&d.jsx("div",{className:"options",children:e.map(a=>d.jsx("div",{className:`option ${t===a?"green":""}`,onClick:()=>{i(!1),s(a)},children:a},a))}),d.jsxs("div",{className:"selected",onClick:()=>{!n&&i(a=>!a)},children:[d.jsx("div",{className:"value",children:t}),d.jsx(wn,{})]})]})},Qr=({loading:n,offset:e=0,onTopScrollsToBottom:t=!0,onBottom:s,onTop:r,children:i,className:o,...a})=>{const[l,c]=w.useState(0),[f,m]=w.useState(""),g=w.useRef(null),u=y=>{n||(m(y),y==="bottom"?s():r())},p=y=>{const E=y.currentTarget,_=E.scrollTop;_>l&&_+E.offsetHeight>=E.scrollHeight-e?u("bottom"):_<l&&_<=e&&u("top"),c(_)};return w.useEffect(()=>{t&&!n&&f==="top"&&g.current&&g.current.scrollTo({top:g.current.scrollHeight-g.current.offsetHeight-e-2,behavior:"instant"})},[n,f,t,e]),d.jsx("div",{ref:g,onScroll:p,className:o,...a,children:i})};var Q={},he={},_t={},ln;function lt(){return ln||(ln=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.createJSONRPCErrorResponse=n.JSONRPCErrorCode=n.isJSONRPCResponse=n.isJSONRPCRequest=n.isJSONRPCID=n.JSONRPC=void 0,n.JSONRPC="2.0",n.isJSONRPCID=function(e){return typeof e=="string"||typeof e=="number"||e===null},n.isJSONRPCRequest=function(e){return e.jsonrpc===n.JSONRPC&&e.method!==void 0&&e.result===void 0&&e.error===void 0},n.isJSONRPCResponse=function(e){return e.jsonrpc===n.JSONRPC&&e.id!==void 0&&(e.result!==void 0||e.error!==void 0)},function(e){e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(n.JSONRPCErrorCode||(n.JSONRPCErrorCode={})),n.createJSONRPCErrorResponse=function(e,t,s,r){var i={code:t,message:s};return r&&(i.data=r),{jsonrpc:n.JSONRPC,id:e,error:i}}}(_t)),_t}var G={},un;function Dn(){return un||(un=1,Object.defineProperty(G,"__esModule",{value:!0}),G.DefaultErrorCode=G.createLogDeprecationWarning=void 0,G.createLogDeprecationWarning=function(n){return function(){}},G.DefaultErrorCode=0),G}var hn;function Bs(){if(hn)return he;hn=1,Object.defineProperty(he,"__esModule",{value:!0}),he.JSONRPCClient=void 0;var n=lt(),e=Dn(),t=e.createLogDeprecationWarning(`Using a higher order function on JSONRPCClient send method is deprecated.
|
|
3
|
+
Instead of this: new JSONRPCClient((jsonRPCClient) => (clientParams) => /* no change here */)
|
|
4
|
+
Do this: new JSONRPCClient((jsonRPCClient, clientParams) => /* no change here */)
|
|
5
|
+
The old way still works, but we will drop the support in the future.`),s=function(){function r(i,o){this._send=i,this.createID=o,this.idToResolveMap=new Map,this.id=0}return r.prototype._createID=function(){return this.createID?this.createID():++this.id},r.prototype.timeout=function(i,o){var a=this;o===void 0&&(o=function(c){return n.createJSONRPCErrorResponse(c,e.DefaultErrorCode,"Request timeout")});var l=function(c,f){var m=setTimeout(function(){var g=a.idToResolveMap.get(c);g&&(a.idToResolveMap.delete(c),g(o(c)))},i);return f().then(function(g){return clearTimeout(m),g},function(g){return clearTimeout(m),Promise.reject(g)})};return{request:function(c,f,m){var g=a._createID();return l(g,function(){return a.requestWithID(c,f,m,g)})},requestAdvanced:function(c,f){return l(c.id,function(){return a.requestAdvanced(c,f)})}}},r.prototype.request=function(i,o,a){return this.requestWithID(i,o,a,this._createID())},r.prototype.requestWithID=function(i,o,a,l){var c={jsonrpc:n.JSONRPC,method:i,params:o,id:l};return this.requestAdvanced(c,a).then(function(f){return f.result!==void 0&&!f.error?f.result:f.result===void 0&&f.error?Promise.reject(new Error(f.error.message)):Promise.reject(new Error("An unexpected error occurred"))})},r.prototype.requestAdvanced=function(i,o){var a=this,l=new Promise(function(c){return a.idToResolveMap.set(i.id,c)});return this.send(i,o).then(function(){return l},function(c){return a.receive(n.createJSONRPCErrorResponse(i.id,e.DefaultErrorCode,c&&c.message||"Failed to send a request")),l})},r.prototype.notify=function(i,o,a){this.send({jsonrpc:n.JSONRPC,method:i,params:o},a).then(void 0,function(){})},r.prototype.send=function(i,o){var a=this._send(i,o);return typeof a=="function"&&(t(),a=a(o)),a},r.prototype.rejectAllPendingRequests=function(i){this.idToResolveMap.forEach(function(o,a){return o(n.createJSONRPCErrorResponse(a,e.DefaultErrorCode,i))}),this.idToResolveMap.clear()},r.prototype.receive=function(i){var o=this.idToResolveMap.get(i.id);o&&(this.idToResolveMap.delete(i.id),o(i))},r}();return he.JSONRPCClient=s,he}var J={},dn;function Ms(){if(dn)return J;dn=1;var n=J&&J.__assign||function(){return n=Object.assign||function(u){for(var p,y=1,E=arguments.length;y<E;y++){p=arguments[y];for(var _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(u[_]=p[_])}return u},n.apply(this,arguments)},e=J&&J.__spreadArrays||function(){for(var u=0,p=0,y=arguments.length;p<y;p++)u+=arguments[p].length;for(var E=Array(u),_=0,p=0;p<y;p++)for(var v=arguments[p],S=0,k=v.length;S<k;S++,_++)E[_]=v[S];return E};Object.defineProperty(J,"__esModule",{value:!0}),J.JSONRPCServer=void 0;var t=lt(),s=Dn(),r=function(){return t.createJSONRPCErrorResponse(null,t.JSONRPCErrorCode.ParseError,"Parse error")},i=function(u){return t.createJSONRPCErrorResponse(t.isJSONRPCID(u.id)?u.id:null,t.JSONRPCErrorCode.InvalidRequest,"Invalid Request")},o=function(u){return t.createJSONRPCErrorResponse(u,t.JSONRPCErrorCode.MethodNotFound,"Method not found")},a=s.createLogDeprecationWarning(`Using a higher order function on JSONRPCServer.addMethod/addMethodAdvanced is deprecated.
|
|
6
|
+
Instead of this: jsonRPCServer.addMethod(methodName, (params) => (serverParams) => /* no change here */)
|
|
7
|
+
Do this: jsonRPCServer.addMethod(methodName, (params, serverParams) => /* no change here */)
|
|
8
|
+
The old way still works, but we will drop the support in the future.`),l=function(){function u(){this.mapErrorToJSONRPCErrorResponse=m,this.nameToMethodDictionary={},this.middleware=null}return u.prototype.addMethod=function(p,y){this.addMethodAdvanced(p,this.toJSONRPCMethod(y))},u.prototype.toJSONRPCMethod=function(p){var y=this;return function(E,_){var v=p(E.params,_);return typeof v=="function"&&(a(),v=v(_)),Promise.resolve(v).then(function(S){return f(E.id,S)},function(S){return console.warn("JSON-RPC method "+E.method+" responded an error",S),y.mapErrorToJSONRPCErrorResponseIfNecessary(E.id,S)})}},u.prototype.addMethodAdvanced=function(p,y){var E;this.nameToMethodDictionary=n(n({},this.nameToMethodDictionary),(E={},E[p]=y,E))},u.prototype.receiveJSON=function(p,y){var E=this.tryParseRequestJSON(p);return E?this.receive(E,y):Promise.resolve(r())},u.prototype.tryParseRequestJSON=function(p){try{return JSON.parse(p)}catch{return null}},u.prototype.receive=function(p,y){var E=this.nameToMethodDictionary[p.method];if(t.isJSONRPCRequest(p))if(E){var _=this.callMethod(E,p,y);return _.then(function(v){return g(p,v)})}else return p.id!==void 0?Promise.resolve(o(p.id)):Promise.resolve(null);else return Promise.resolve(i(p))},u.prototype.applyMiddleware=function(){for(var p=[],y=0;y<arguments.length;y++)p[y]=arguments[y];this.middleware?this.middleware=this.combineMiddlewares(e([this.middleware],p)):this.middleware=this.combineMiddlewares(p)},u.prototype.combineMiddlewares=function(p){return p.length?p.reduce(this.middlewareReducer):null},u.prototype.middlewareReducer=function(p,y){return function(E,_,v){return p(function(S,k){return y(E,S,k)},_,v)}},u.prototype.callMethod=function(p,y,E){var _=this,v=function(k,O){var q=p(k,O);return typeof q=="function"?(a(),q(O)):q},S=function(k){return console.warn('An unexpected error occurred while executing "'+y.method+'" JSON-RPC method:',k),Promise.resolve(_.mapErrorToJSONRPCErrorResponseIfNecessary(y.id,k))};try{return(this.middleware||c)(v,y,E).then(void 0,S)}catch(k){return S(k)}},u.prototype.mapErrorToJSONRPCErrorResponseIfNecessary=function(p,y){return p!==void 0?this.mapErrorToJSONRPCErrorResponse(p,y):null},u}();J.JSONRPCServer=l;var c=function(u,p,y){return u(p,y)},f=function(u,p){return u!==void 0?{jsonrpc:t.JSONRPC,id:u,result:p===void 0?null:p}:null},m=function(u,p){return t.createJSONRPCErrorResponse(u,s.DefaultErrorCode,p&&p.message||"An unexpected error occurred")},g=function(u,p){return p||(u.id!==void 0?t.createJSONRPCErrorResponse(u.id,t.JSONRPCErrorCode.InternalError,"Internal error"):null)};return J}var W={},fn;function Hs(){if(fn)return W;fn=1;var n=W&&W.__awaiter||function(r,i,o,a){function l(c){return c instanceof o?c:new o(function(f){f(c)})}return new(o||(o=Promise))(function(c,f){function m(p){try{u(a.next(p))}catch(y){f(y)}}function g(p){try{u(a.throw(p))}catch(y){f(y)}}function u(p){p.done?c(p.value):l(p.value).then(m,g)}u((a=a.apply(r,i||[])).next())})},e=W&&W.__generator||function(r,i){var o={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},a,l,c,f;return f={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function m(u){return function(p){return g([u,p])}}function g(u){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,l&&(c=u[0]&2?l.return:u[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,u[1])).done)return c;switch(l=0,c&&(u=[u[0]&2,c.value]),u[0]){case 0:case 1:c=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,l=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(c=o.trys,!(c=c.length>0&&c[c.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!c||u[1]>c[0]&&u[1]<c[3])){o.label=u[1];break}if(u[0]===6&&o.label<c[1]){o.label=c[1],c=u;break}if(c&&o.label<c[2]){o.label=c[2],o.ops.push(u);break}c[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(r,o)}catch(p){u=[6,p],l=0}finally{a=c=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(W,"__esModule",{value:!0}),W.JSONRPCServerAndClient=void 0;var t=lt(),s=function(){function r(i,o){this.server=i,this.client=o}return r.prototype.applyServerMiddleware=function(){for(var i,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];(i=this.server).applyMiddleware.apply(i,o)},r.prototype.addMethod=function(i,o){this.server.addMethod(i,o)},r.prototype.addMethodAdvanced=function(i,o){this.server.addMethodAdvanced(i,o)},r.prototype.timeout=function(i){return this.client.timeout(i)},r.prototype.request=function(i,o,a){return this.client.request(i,o,a)},r.prototype.requestAdvanced=function(i,o){return this.client.requestAdvanced(i,o)},r.prototype.notify=function(i,o,a){this.client.notify(i,o,a)},r.prototype.rejectAllPendingRequests=function(i){this.client.rejectAllPendingRequests(i)},r.prototype.receiveAndSend=function(i,o,a){return n(this,void 0,void 0,function(){var l,c;return e(this,function(f){switch(f.label){case 0:return t.isJSONRPCResponse(i)?(this.client.receive(i),[3,4]):[3,1];case 1:return t.isJSONRPCRequest(i)?[4,this.server.receive(i,o)]:[3,3];case 2:return l=f.sent(),l?[2,this.client.send(l,a)]:[3,4];case 3:return c="Received an invalid JSON-RPC message",console.warn(c,i),[2,Promise.reject(new Error(c))];case 4:return[2]}})})},r}();return W.JSONRPCServerAndClient=s,W}var pn;function qs(){return pn||(pn=1,function(n){var e=Q&&Q.__createBinding||(Object.create?function(s,r,i,o){o===void 0&&(o=i),Object.defineProperty(s,o,{enumerable:!0,get:function(){return r[i]}})}:function(s,r,i,o){o===void 0&&(o=i),s[o]=r[i]}),t=Q&&Q.__exportStar||function(s,r){for(var i in s)i!=="default"&&!r.hasOwnProperty(i)&&e(r,s,i)};Object.defineProperty(n,"__esModule",{value:!0}),t(Bs(),n),t(lt(),n),t(Ms(),n),t(Hs(),n)}(Q)),Q}var zt=qs();const H=Object.create(null);H.open="0";H.close="1";H.ping="2";H.pong="3";H.message="4";H.upgrade="5";H.noop="6";const ke=Object.create(null);Object.keys(H).forEach(n=>{ke[H[n]]=n});const jt={type:"error",data:"parser error"},Bn=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Mn=typeof ArrayBuffer=="function",Hn=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,Vt=({type:n,data:e},t,s)=>Bn&&e instanceof Blob?t?s(e):mn(e,s):Mn&&(e instanceof ArrayBuffer||Hn(e))?t?s(e):mn(new Blob([e]),s):s(H[n]+(e||"")),mn=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function gn(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let wt;function Us(n,e){if(Bn&&n.data instanceof Blob)return n.data.arrayBuffer().then(gn).then(e);if(Mn&&(n.data instanceof ArrayBuffer||Hn(n.data)))return e(gn(n.data));Vt(n,!1,t=>{wt||(wt=new TextEncoder),e(wt.encode(t))})}const yn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<yn.length;n++)pe[yn.charCodeAt(n)]=n;const Fs=n=>{let e=n.length*.75,t=n.length,s,r=0,i,o,a,l;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const c=new ArrayBuffer(e),f=new Uint8Array(c);for(s=0;s<t;s+=4)i=pe[n.charCodeAt(s)],o=pe[n.charCodeAt(s+1)],a=pe[n.charCodeAt(s+2)],l=pe[n.charCodeAt(s+3)],f[r++]=i<<2|o>>4,f[r++]=(o&15)<<4|a>>2,f[r++]=(a&3)<<6|l&63;return c},Js=typeof ArrayBuffer=="function",Yt=(n,e)=>{if(typeof n!="string")return{type:"message",data:qn(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:Ws(n.substring(1),e)}:ke[t]?n.length>1?{type:ke[t],data:n.substring(1)}:{type:ke[t]}:jt},Ws=(n,e)=>{if(Js){const t=Fs(n);return qn(t,e)}else return{base64:!0,data:n}},qn=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},Un="",$s=(n,e)=>{const t=n.length,s=new Array(t);let r=0;n.forEach((i,o)=>{Vt(i,!1,a=>{s[o]=a,++r===t&&e(s.join(Un))})})},Ks=(n,e)=>{const t=n.split(Un),s=[];for(let r=0;r<t.length;r++){const i=Yt(t[r],e);if(s.push(i),i.type==="error")break}return s};function zs(){return new TransformStream({transform(n,e){Us(n,t=>{const s=t.length;let r;if(s<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,s);else if(s<65536){r=new Uint8Array(3);const i=new DataView(r.buffer);i.setUint8(0,126),i.setUint16(1,s)}else{r=new Uint8Array(9);const i=new DataView(r.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}let St;function Ne(n){return n.reduce((e,t)=>e+t.length,0)}function Oe(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let r=0;r<e;r++)t[r]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),t}function Vs(n,e){St||(St=new TextDecoder);const t=[];let s=0,r=-1,i=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(s===0){if(Ne(t)<1)break;const l=Oe(t,1);i=(l[0]&128)===128,r=l[0]&127,r<126?s=3:r===126?s=1:s=2}else if(s===1){if(Ne(t)<2)break;const l=Oe(t,2);r=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),s=3}else if(s===2){if(Ne(t)<8)break;const l=Oe(t,8),c=new DataView(l.buffer,l.byteOffset,l.length),f=c.getUint32(0);if(f>Math.pow(2,21)-1){a.enqueue(jt);break}r=f*Math.pow(2,32)+c.getUint32(4),s=3}else{if(Ne(t)<r)break;const l=Oe(t,r);a.enqueue(Yt(i?l:St.decode(l),e)),s=0}if(r===0||r>n){a.enqueue(jt);break}}}})}const Fn=4;function N(n){if(n)return Ys(n)}function Ys(n){for(var e in N.prototype)n[e]=N.prototype[e];return n}N.prototype.on=N.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};N.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};N.prototype.off=N.prototype.removeListener=N.prototype.removeAllListeners=N.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,r=0;r<t.length;r++)if(s=t[r],s===e||s.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+n],this};N.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,r=t.length;s<r;++s)t[s].apply(this,e)}return this};N.prototype.emitReserved=N.prototype.emit;N.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};N.prototype.hasListeners=function(n){return!!this.listeners(n).length};const ut=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),I=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Qs="arraybuffer";function Jn(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const Gs=I.setTimeout,Xs=I.clearTimeout;function ht(n,e){e.useNativeTimers?(n.setTimeoutFn=Gs.bind(I),n.clearTimeoutFn=Xs.bind(I)):(n.setTimeoutFn=I.setTimeout.bind(I),n.clearTimeoutFn=I.clearTimeout.bind(I))}const Zs=1.33;function er(n){return typeof n=="string"?tr(n):Math.ceil((n.byteLength||n.size)*Zs)}function tr(n){let e=0,t=0;for(let s=0,r=n.length;s<r;s++)e=n.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function Wn(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function nr(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function sr(n){let e={},t=n.split("&");for(let s=0,r=t.length;s<r;s++){let i=t[s].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}class rr extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class Qt extends N{constructor(e){super(),this.writable=!1,ht(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new rr(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Yt(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=nr(e);return t.length?"?"+t:""}}class ir extends Qt{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Ks(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,$s(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Wn()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let $n=!1;try{$n=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const or=$n;function ar(){}class cr extends ir{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(r,i)=>{this.onError("xhr post error",r,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class M extends N{constructor(e,t,s){super(),this.createRequest=e,ht(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=Jn(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let r in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(r)&&s.setRequestHeader(r,this._opts.extraHeaders[r])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var r;s.readyState===3&&((r=this._opts.cookieJar)===null||r===void 0||r.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(r){this.setTimeoutFn(()=>{this._onError(r)},0);return}typeof document<"u"&&(this._index=M.requestsCount++,M.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=ar,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete M.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}M.requestsCount=0;M.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",vn);else if(typeof addEventListener=="function"){const n="onpagehide"in I?"pagehide":"unload";addEventListener(n,vn,!1)}}function vn(){for(let n in M.requests)M.requests.hasOwnProperty(n)&&M.requests[n].abort()}const lr=function(){const n=Kn({xdomain:!1});return n&&n.responseType!==null}();class ur extends cr{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=lr&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new M(Kn,this.uri(),e)}}function Kn(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||or))return new XMLHttpRequest}catch{}if(!e)try{return new I[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const zn=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class hr extends Qt{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=zn?{}:Jn(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],r=t===e.length-1;Vt(s,this.supportsBinary,i=>{try{this.doWrite(s,i)}catch{}r&&ut(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Wn()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Ct=I.WebSocket||I.MozWebSocket;class dr extends hr{createSocket(e,t,s){return zn?new Ct(e,t,s):t?new Ct(e,t):new Ct(e)}doWrite(e,t){this.ws.send(t)}}class fr extends Qt{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Vs(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),r=zs();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const i=()=>{s.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],r=t===e.length-1;this._writer.write(s).then(()=>{r&&ut(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const pr={websocket:dr,webtransport:fr,polling:ur},mr=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,gr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Dt(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let r=mr.exec(n||""),i={},o=14;for(;o--;)i[gr[o]]=r[o]||"";return t!=-1&&s!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=yr(i,i.path),i.queryKey=vr(i,i.query),i}function yr(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function vr(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,r,i){r&&(t[r]=i)}),t}const Bt=typeof addEventListener=="function"&&typeof removeEventListener=="function",Te=[];Bt&&addEventListener("offline",()=>{Te.forEach(n=>n())},!1);class Y extends N{constructor(e,t){if(super(),this.binaryType=Qs,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=Dt(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=Dt(t.host).host);ht(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const r=s.prototype.name;this.transports.push(r),this._transportsByName[r]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=sr(this.opts.query)),Bt&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Te.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=Fn,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Y.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",Y.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){const r=this.writeBuffer[s].data;if(r&&(t+=er(r)),s>0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,ut(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,r){if(typeof t=="function"&&(r=t,t=void 0),typeof s=="function"&&(r=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const i={type:e,data:t,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(Y.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Bt&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Te.indexOf(this._offlineEventListener);s!==-1&&Te.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}Y.protocol=Fn;class Er extends Y{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;Y.priorWebsocketSuccess=!1;const r=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",m=>{if(!s)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Y.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(f(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=t.name,this.emitReserved("upgradeError",g)}}))};function i(){s||(s=!0,f(),t.close(),t=null)}const o=m=>{const g=new Error("probe error: "+m);g.transport=t.name,i(),this.emitReserved("upgradeError",g)};function a(){o("transport closed")}function l(){o("socket closed")}function c(m){t&&m.name!==t.name&&i()}const f=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};t.once("open",r),t.once("error",o),t.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}let Rr=class extends Er{constructor(e,t={}){const s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(r=>pr[r]).filter(r=>!!r)),super(e,s)}};function br(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=Dt(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const i=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port+e,s.href=s.protocol+"://"+i+(t&&t.port===s.port?"":":"+s.port),s}const _r=typeof ArrayBuffer=="function",wr=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,Vn=Object.prototype.toString,Sr=typeof Blob=="function"||typeof Blob<"u"&&Vn.call(Blob)==="[object BlobConstructor]",Cr=typeof File=="function"||typeof File<"u"&&Vn.call(File)==="[object FileConstructor]";function Gt(n){return _r&&(n instanceof ArrayBuffer||wr(n))||Sr&&n instanceof Blob||Cr&&n instanceof File}function Le(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t<s;t++)if(Le(n[t]))return!0;return!1}if(Gt(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Le(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&Le(n[t]))return!0;return!1}function Nr(n){const e=[],t=n.data,s=n;return s.data=Mt(t,e),s.attachments=e.length,{packet:s,buffers:e}}function Mt(n,e){if(!n)return n;if(Gt(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let s=0;s<n.length;s++)t[s]=Mt(n[s],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=Mt(n[s],e));return t}return n}function Or(n,e){return n.data=Ht(n.data,e),delete n.attachments,n}function Ht(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=Ht(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=Ht(n[t],e));return n}const Ar=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],kr=5;var b;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(b||(b={}));class Tr{constructor(e){this.replacer=e}encode(e){return(e.type===b.EVENT||e.type===b.ACK)&&Le(e)?this.encodeAsBinary({type:e.type===b.EVENT?b.BINARY_EVENT:b.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===b.BINARY_EVENT||e.type===b.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Nr(e),s=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(s),r}}function En(n){return Object.prototype.toString.call(n)==="[object Object]"}class Xt extends N{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const s=t.type===b.BINARY_EVENT;s||t.type===b.BINARY_ACK?(t.type=s?b.EVENT:b.ACK,this.reconstructor=new Lr(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(Gt(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(b[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===b.BINARY_EVENT||s.type===b.BINARY_ACK){const i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){const i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(i,t)}else s.nsp="/";const r=e.charAt(t+1);if(r!==""&&Number(r)==r){const i=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){const i=this.tryParse(e.substr(t));if(Xt.isPayloadValid(s.type,i))s.data=i;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case b.CONNECT:return En(t);case b.DISCONNECT:return t===void 0;case b.CONNECT_ERROR:return typeof t=="string"||En(t);case b.EVENT:case b.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Ar.indexOf(t[0])===-1);case b.ACK:case b.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Lr{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Or(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const xr=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Xt,Encoder:Tr,get PacketType(){return b},protocol:kr},Symbol.toStringTag,{value:"Module"}));function j(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const Pr=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Yn extends N{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[j(e,"open",this.onopen.bind(this)),j(e,"packet",this.onpacket.bind(this)),j(e,"error",this.onerror.bind(this)),j(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,r,i;if(Pr.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:b.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const f=this.ids++,m=t.pop();this._registerAckCallback(f,m),o.id=f}const a=(r=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||r===void 0?void 0:r.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;const r=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(r===void 0){this.acks[e]=t;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);t.call(this,new Error("operation has timed out"))},r),o=(...a)=>{this.io.clearTimeoutFn(i),t.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,r)=>{const i=(o,a)=>o?r(o):s(a);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...i)=>s!==this._queue[0]?void 0:(r!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(r)):(this._queue.shift(),t&&t(null,...i)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:b.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case b.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case b.EVENT:case b.BINARY_EVENT:this.onevent(e);break;case b.ACK:case b.BINARY_ACK:this.onack(e);break;case b.DISCONNECT:this.ondisconnect();break;case b.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...r){s||(s=!0,t.packet({type:b.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:b.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const s of t)s.apply(this,e.data)}}}function ce(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}ce.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};ce.prototype.reset=function(){this.attempts=0};ce.prototype.setMin=function(n){this.ms=n};ce.prototype.setMax=function(n){this.max=n};ce.prototype.setJitter=function(n){this.jitter=n};class qt extends N{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,ht(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new ce({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||xr;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Rr(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const r=j(t,"open",function(){s.onopen(),e&&e()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=j(t,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{r(),i(new Error("timeout")),t.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(j(e,"ping",this.onping.bind(this)),j(e,"data",this.ondata.bind(this)),j(e,"error",this.onerror.bind(this)),j(e,"close",this.onclose.bind(this)),j(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){ut(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new Yn(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const de={};function xe(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=br(n,e.path||"/socket.io"),s=t.source,r=t.id,i=t.path,o=de[r]&&i in de[r].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new qt(s,e):(de[r]||(de[r]=new qt(s,e)),l=de[r]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(xe,{Manager:qt,Socket:Yn,io:xe,connect:xe});const Qn=te(!1),Gn=te(!1),L=te({starting:!1,started:!1,stopping:!1,loading:!0}),Xr=()=>(w.useEffect(()=>(Rn("subscribe","server"),Ir(),()=>{Rn("unsubscribe","server")}),[]),Nt(L));async function Ir(){L.set({...L.get(),loading:!0});const{started:n,starting:e,stopping:t}=await se("server.started");L.set({started:n,stopping:t,starting:e,loading:!1})}const Zr=()=>{L.set({...L.get(),loading:!0}),se("server.start")},ei=()=>{L.set({...L.get(),loading:!0}),se("server.stop")},ti=()=>{L.set({...L.get(),loading:!0}),se("server.restart")},ni=()=>{L.set({...L.get(),loading:!0}),se("server.update")},Xn=te(!1),Zn=te(null),jr=te([]),Dr=te(null),ne=xe();ne.on("connect",()=>{console.info("[socket] Connected"),Qn.set(!0),Gn.set(!1)});ne.on("disconnect",()=>{console.info("[socket] Disconnected"),Qn.set(!1),Gn.set(!0)});ne.on("data",n=>{Dr.set(n),ns.set(n.version),Zn.set(n.user),jr.set(n.roles),Xn.set(n.canLogOut)});ne.on("rpc",n=>{Zt.receiveAndSend(n)});ne.on("status",({started:n,starting:e,stopping:t})=>{L.set({started:n,starting:e,stopping:t,loading:!1})});const Br=new zt.JSONRPCServer,Mr=new zt.JSONRPCClient(async n=>{ne.emit("rpc",n)}),Zt=new zt.JSONRPCServerAndClient(Br,Mr),se=(n,...e)=>Zt.request(n,e),si=(n,...e)=>Zt.notify(n,e),Rn=(n,...e)=>ne.emit(n,...e),Hr=({disabled:n=!1,value:e,onChange:t,...s})=>{const[r,i]=w.useState(!1),[o,a]=w.useState(!1),[l,c]=w.useState([]),f=w.useRef(null);async function m(){a(!0),c([]);const g=await se("roles.list");c(g.map(u=>u.name)),a(!1)}return w.useEffect(()=>{if(!r)return;function g(u){u.target&&!f.current?.contains(u.target)&&i(!1)}return document.addEventListener("click",g),()=>document.removeEventListener("click",g)},[r]),d.jsxs("div",{className:`role-dropdown ${n?"disabled":""}`,ref:f,...s,children:[r&&d.jsxs("div",{className:"options",children:[o&&d.jsx("div",{className:"option search",style:{position:"relative"},children:d.jsx(bn,{active:!0,size:"small"})}),l.map(g=>d.jsx("div",{onClick:()=>{t(g),i(!1)},className:`option ${e===g?"green":""}`,children:g},g))]}),d.jsxs("div",{className:"selected",onClick:()=>{i(g=>!g),r||m()},children:[d.jsx("div",{className:"value",children:e}),d.jsx(wn,{})]})]})},ri=({placeholder:n="",disabled:e=!1,type:t,value:s=[],options:r=[],onChange:i})=>{const o=(c,f)=>{const m=s.slice();m[c]=f,i(m)},a=()=>{const c=s.slice();c.push({string:"",number:0,password:"",role:"",enum:r&&r[0]}[t]),i(c)},l=c=>{const f=s.slice();f.splice(c,1),i(f)};return d.jsxs("div",{className:`br-list-input ${e?"disabled":""}`,children:[(s||[]).map((c,f)=>d.jsxs("div",{className:"br-list-item",children:[(t==="string"||t==="password"||t==="number")&&d.jsx(_n,{value:c,onChange:m=>o(f,m),placeholder:n,type:t==="string"?"text":t,disabled:e}),t==="enum"&&d.jsx(Ds,{value:c,options:r,onChange:m=>o(f,m),disabled:e}),t==="role"&&d.jsx(Hr,{value:c,onChange:m=>o(f,m),disabled:e}),d.jsx(Pe,{icon:!0,warn:!0,"data-tooltip":"Remove this item from the list",onClick:()=>l(f),disabled:e,children:d.jsx(Sn,{})})]},f)),d.jsx(Pe,{icon:!0,main:!0,"data-tooltip":"Add an item to the list",onClick:a,disabled:e,children:d.jsx(os,{})})]})},qr=({children:n,attached:e,className:t})=>d.jsx("div",{className:`navbar ${e?"attached":""} ${t??""}`,children:n}),ii=({title:n,className:e,children:t})=>{const s=Nt(Zn),r=Nt(Xn);return d.jsxs("div",{className:`main-nav ${e??""}`,children:[d.jsx("header",{className:"nav-header",children:n}),d.jsxs(qr,{children:[d.jsxs("span",{style:{flex:1,marginLeft:8},children:["Welcome, ",s?.username??"..."]}),t,r&&d.jsx(Pe,{icon:!0,error:!0,"data-tooltip":"Logout of Web UI",onClick:()=>ys(),children:d.jsx(as,{})})]})]})},oi=({children:n})=>d.jsx("div",{className:"main-content",children:n}),ai=({children:n,loading:e})=>d.jsxs("div",{children:[d.jsx(ss,{}),d.jsx("div",{className:"content-parent",children:!e&&d.jsx("div",{className:"content",children:n})})]}),ci=({disabled:n=!1,value:e,placeholder:t,onChange:s,...r})=>{const[i,o]=w.useState(!1),[a,l]=w.useState(!1),[c,f]=w.useState([]),[m,g]=w.useState(""),u=w.useRef(null);w.useEffect(()=>{if(!i)return;function v(S){S.target&&!u.current?.contains(S.target)&&o(!1)}return document.addEventListener("click",v),()=>document.removeEventListener("click",v)},[i]);function p(v){const S=e.slice();S.splice(v,1),s(S)}function y({id:v,name:S}){s([...e,{id:v,name:S}]),o(!1),g("")}const E=w.useRef(m);E.current=m;const _=w.useMemo(()=>vs(async()=>{if(E.current.length===0){o(!1),l(!1),f([]);return}l(!0),o(!0);const{players:v}=await se("players.list",{page:0,search:E.current,sort:"lastSeen",direction:-1,filter:""});f(v),l(!1)},500),[]);return d.jsxs("div",{className:`br-player-list ${n?"disabled":""}`,...r,children:[e.map((v,S)=>d.jsxs("div",{className:"br-player-item",children:[d.jsx(oe,{href:`/players/${v.id}`,className:"selected","data-tooltip":"Click to navigate to player page",children:v.name}),d.jsx(Pe,{icon:!0,warn:!0,"data-tooltip":"Remove this player from the list",onClick:()=>p(S),children:d.jsx(Sn,{})})]},v.id)),d.jsxs("div",{className:"player-search",ref:u,children:[d.jsx(_n,{type:"text",placeholder:"Search Players...",value:m,onChange:v=>{g(v),_()}}),i&&d.jsxs("div",{className:"options",children:[a&&d.jsx("div",{className:"option search",style:{position:"relative"},children:d.jsx(bn,{active:!0,size:"small"})}),c.map(v=>d.jsx("div",{onClick:()=>y(v),className:"option",children:v.name},v.id))]})]})]})},li=({children:n,className:e,...t})=>d.jsx("div",{className:`scroll-container ${e??""}`,...t,children:d.jsx("div",{className:"scroll-scroller",children:n})}),X=({children:n,disabled:e,to:t,...s})=>d.jsx(oe,{href:t,className:r=>`menu-button ${e?"disabled":""} ${r?"active":""}`,...s,children:d.jsx("div",{className:"menu-button-content",children:n})}),ui=w.memo(()=>d.jsxs("div",{className:"main-menu-buttons",children:[d.jsxs(X,{to:"/","data-tooltip":"Chat with players, view server status. Main Dashboard",children:[d.jsx(cs,{style:{background:"#de4f43"}}),"Dashboard"]}),d.jsxs(X,{to:"/worlds","data-tooltip":"Manage worlds",children:[d.jsx(ls,{style:{background:"#f0a500"}}),"Worlds"]}),d.jsxs(X,{to:"/history","data-tooltip":"Browse chat history",children:[d.jsx(us,{style:{background:"#008bd6"}}),"History"]}),d.jsxs(X,{to:"/plugins","data-tooltip":"Manage, reload, and configure plugins",children:[d.jsx(hs,{style:{background:"#00b35f"}}),"Plugins"]}),d.jsxs(X,{to:"/players","data-tooltip":"Browse player info and play time",children:[d.jsx(ds,{style:{background:"#b3006b"}}),"Players"]}),d.jsxs(X,{to:"/server","data-tooltip":"Server management",children:[d.jsx(fs,{style:{background:"#453d9c"}}),"Server"]}),d.jsxs(X,{to:"/users","data-tooltip":"Server users",children:[d.jsx(ps,{style:{background:"#7f0b8a"}}),"Users"]})]})),hi=({name:n,sort:e,direction:t})=>n===e&&d.jsxs(d.Fragment,{children:[t===1&&d.jsx(ms,{}),t===-1&&d.jsx(gs,{})]}),di=({disabled:n=!1,value:e,onChange:t,tooltip:s})=>d.jsx("div",{"data-tooltip":s,className:`toggle ${n?"disabled":""}`,onClick:()=>t(!e),children:d.jsx("div",{className:`toggle-slider ${e?"on":""}`,children:d.jsx("div",{className:"symbol"})})});export{Dr as $,Yr as C,Ds as D,Qr as I,Is as L,ii as N,oi as P,Hr as R,ui as S,di as T,li as a,si as b,qr as c,hi as d,ri as e,ci as f,Zr as g,ei as h,Rn as i,ti as j,ni as k,Zn as l,L as m,ai as n,js as o,se as r,ne as s,Xr as u};
|
|
9
|
+
//# sourceMappingURL=index-CtY8r8rg.js.map
|