1import{a4 as h,j as e,a5 as l,P as d,a7 as m,ac as x,ab as u,aW as j,a9 as t,R as y}from"./mantine-CGEClQ3v.js";import{r as n}from"./vendor-D6eLTwOz.js";import{b as f,I as v}from"./app-IRs7ANyC.js";import"./IconBrain-RWha6D0u.js";import"./chunk-reload-CTWyn8eB.js";const F=()=>{const p=f(),[s,a]=n.useState(null),[g,i]=n.useState(!0);n.useEffect(()=>{o()},[]);const o=async()=>{a(null),i(!0);try{const r=await p("/api/environments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"My Environment",size:"medium"})});if(!r.ok){const c=await r.json().catch(()=>({}));throw new Error(c.error||c.details||"Failed to create environment")}await r.json(),h("/app")}catch(r){console.error("Failed to create environment:",r),a(r instanceof Error?r.message:"Failed to set up your environment. Please try again."),i(!1)}};return s?e.jsx(l,{size:"sm",style:{paddingTop:100,paddingBottom:100},children:e.jsx(d,{p:"xl",radius:"md",withBorder:!0,children:e.jsxs(m,{align:"center",gap:"lg",children:[e.jsx("img",{src:"/papercrane_and_logo.svg",alt:"Papercrane",style:{height:"48px"}}),e.jsx(x,{icon:e.jsx(v,{size:16}),color:"red",variant:"light",title:"Setup Failed",w:"100%",children:s}),e.jsx(u,{leftSection:e.jsx(j,{size:16}),onClick:o,loading:g,children:"Try Again"}),e.jsxs(t,{size:"sm",c:"dimmed",children:["Or"," ",e.jsx(t,{component:"a",href:"/environments",size:"sm",c:"blue",style:{cursor:"pointer"},children:"go to environments"})]})]})})}):e.jsx(l,{size:"sm",style:{paddingTop:100,paddingBottom:100},children:e.jsx(d,{p:"xl",radius:"md",withBorder:!0,children:e.jsxs(m,{align:"center",gap:"lg",children:[e.jsx("img",{src:"/papercrane_and_logo.svg",alt:"Papercrane",style:{height:"48px"}}),e.jsx(t,{size:"xl",fw:600,children:"Welcome to Papercrane!"}),e.jsx(y,{size:"lg"}),e.jsx(t,{size:"md",c:"dimmed",ta:"center",children:"Setting up your first environment..."}),e.jsx(t,{size:"sm",c:"dimmed",ta:"center",children:"This may take a moment while we prepare your sandbox."})]})})})};export{F as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.