import"../chunks/CWj6FrbW.js";import{o as w,a as b,s as U}from"../chunks/tLFXBP7P.js";import{p as E,f as u,b as m,c as _,i as c,e as x,d as l,s as L,h as p,r as h,t as j}from"../chunks/Cp_hX0eh.js";import{i as y}from"../chunks/_HWrJCgx.js";import{s as R}from"../chunks/BMwJcaLS.js";import{p as k}from"../chunks/CYkx2jgw.js";import{g as C}from"../chunks/BHkx8tAH.js";var A=u(`<div class="
				absolute bottom-0 right-0 z-50 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>`),I=u('<main class="h-screen overflow-hidden bg-gray-600"><!> <!></main>');function B(f,i){E(i,!0);let t=x("");function s(r){c(t,r,!0),setTimeout(()=>{c(t,"")},5e3),console.error(r)}R({onAgentSelect:r=>{const e=new URLSearchParams(k.url.search).get("step");let o=`/edit/${encodeURIComponent(r)}/roleplay`;e&&(o+=`?step=${encodeURIComponent(e)}`),C(o)},onError:s}),w(()=>{const r=e=>{var o;console.error(e),s(`Uncaught error: ${((o=e.error)==null?void 0:o.message)||e.message||"Unknown error"}`)},n=e=>{var o;console.error(e),s(`Unhandled promise rejection: ${((o=e.reason)==null?void 0:o.message)||e.reason||"Unknown error"}`)};return window.addEventListener("error",r),window.addEventListener("unhandledrejection",n),()=>{window.removeEventListener("error",r),window.removeEventListener("unhandledrejection",n)}});var a=I(),d=l(a);b(d,()=>i.children);var g=L(d,2);{var v=r=>{var n=A(),e=l(n,!0);h(n),j(()=>U(e,p(t))),m(r,n)};y(g,r=>{p(t)&&r(v)})}h(a),m(f,a),_()}export{B as component};
