import{r}from"./index-CFdT0RIo.js";import{j as a}from"./jsx-runtime-hUI6LOBV.js";import{a as E}from"./index-BiGqsMpe.js";import{c as b}from"./misc-BNcbB3dR.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"66e9b849450b819e11683314a547a341cb57f7d0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2ace62b1-695a-4aa3-909c-9348f2cd7bc8",e._sentryDebugIdIdentifier="sentry-dbid-2ace62b1-695a-4aa3-909c-9348f2cd7bc8")}catch{}})();const h=r.createContext(new Map);h.Provider;function C(e,{event:t="message",init:n,enabled:o=!0}={}){let c=r.useContext(h),[p,d]=r.useState(null);return r.useEffect(()=>{if(!o)return;let i=[e.toString(),n?.withCredentials].join("::"),s=c.get(i)??{count:0,source:new EventSource(e,n)};++s.count,c.set(i,s),s.source.addEventListener(t,f),d(null);function f(x){d(x.data||"UNKNOWN_EVENT_DATA")}return()=>{s.source.removeEventListener(t,f),--s.count,s.count<=0&&(s.source.close(),c.delete(i))}},[e,t,n,c,o]),p}function I({className:e,children:t="Loading"}){const{reducedMotion:n}=E();return n==="reduce"?a.jsx("div",{className:"animate-pulse",children:t}):a.jsxs("div",{className:b("flex items-center gap-2 font-mono text-sm font-medium uppercase",e),role:"status",children:[a.jsx("div",{"aria-hidden":"true",children:a.jsx(m,{})}),t,a.jsx("div",{"aria-hidden":"true",children:a.jsx(m,{})})]})}const u="█<▓█ ▒░/▒░ █░>▒▓/ █▒▒ ▓▒▓/█<░▒ ▓/░>",l=()=>u[Math.floor(Math.random()*u.length)];function m(){const[e,t]=r.useState(u[0]),[n,o]=r.useState(u[1]);return g(()=>{t(l()),o(l())},80),a.jsxs("span",{children:[e,n]})}function g(e,t=1e3){const n=r.useRef(null);r.useEffect(()=>{n.current=e},[e]),r.useEffect(()=>{function o(){n.current?.()}if(t!==null){const c=setInterval(o,t);return()=>clearInterval(c)}},[t])}export{I as L,C as u};
//# sourceMappingURL=loading-Cf-_cX4u.js.map
