import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t}from"./vendor-charts-Bu2lyBKP.js";var n=e(t(),1),r=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},i=(e=>e?r(e):r),a=e=>e;function o(e,t=a){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),n.useCallback(()=>t(e.getInitialState()),[e,t]));return n.useDebugValue(r),r}var s=e=>{let t=i(e),n=e=>o(t,e);return Object.assign(n,t),n},c=(e=>e?s(e):s),l=typeof window<`u`?window.__HIVE_CONFIG__:void 0,u=l?.apiUrl||``,d=l?.wsUrl||``,f=e=>/localhost|127\.0\.0\.1/.test(e),p=/localhost|127\.0\.0\.1/.test(window.location.hostname);function m(){return u&&(!f(u)||p)?u:``}function h(){if(d&&(!f(d)||p))return d;let e=m();return e?e.replace(/^http/,`ws`):`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`}export{h as n,c as r,m as t};