import"../chunks/CWj6FrbW.js";import{o as w,a as E,s as U}from"../chunks/CwfCwap7.js";import{p as _,j as m,f as h,b as c,c as x,e as y,d as p,s as j,h as u,r as f,t as L}from"../chunks/DhlfkVbH.js";import{i as $}from"../chunks/s_ghFM5S.js";import{s as k}from"../chunks/beLKjDF5.js";import{p as C}from"../chunks/84_D9GGU.js";import{g as i}from"../chunks/Kz6TiXE5.js";var R=h(`<div class="
				absolute bottom-0 right-0 m-4 rounded-sm border border-red-500 bg-red-50
				px-4 py-2 text-red-800 focus:outline-none focus:ring-0"> </div>`),A=h('<main class="h-screen overflow-hidden bg-gray-600"><!> <!></main>');function F(g,d){_(d,!0);let t=y("");k({onAgentSelect:e=>{const r=C.url.pathname.split("/")[1];r?r==="roleplay"?i(`/roleplay?agent=${encodeURIComponent(e)}`):i(`/${r}/${e}`):i(`/roleplay?agent=${encodeURIComponent(e)}`)},onError:a}),w(()=>{const e=o=>{var n;console.error(o),a(`Uncaught error: ${((n=o.error)==null?void 0:n.message)||o.message||"Unknown error"}`)},r=o=>{var n;console.error(o),a(`Unhandled promise rejection: ${((n=o.reason)==null?void 0:n.message)||o.reason||"Unknown error"}`)};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",r),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",r)}});function a(e){m(t,e,!0),setTimeout(()=>{m(t,"")},5e3),console.error(e)}var s=A(),l=p(s);E(l,()=>d.children);var v=j(l,2);{var b=e=>{var r=R(),o=p(r,!0);f(r),L(()=>U(o,u(t))),c(e,r)};$(v,e=>{u(t)&&e(b)})}f(s),c(g,s),x()}export{F as component};
