https://spiaggefrontend-production.up.railway.app/_next/static/chunks/pages/home-c7a82025703d0faa.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[845],{2814:(e,r,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/home",function(){return t(34020)}])},8641:(e,r,t)=>{"use strict";t.d(r,{S:()=>s,f:()=>n});let[s,n]=(0,t(31889).q)({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1})},19277:(e,r,t)=>{"use strict";t.d(r,{A:()=>o});var s=t(37876),n=t(72943),i=t(14e3);t(14232);var l=t(19619);let o=e=>r=>{let t=(0,n.J)(),o=(0,i.useRouter)();return t.loading?(0,s.jsx)("div",{children:"Loading..."}):null===t?void o.push("/auth"):(0,s.jsx)(l.SessionAuth,{onSessionExpired:()=>o.refresh(),userContext:t.user||void 0,children:(0,s.jsx)(e,{...r})})}},20529:(e,r,t)=>{"use strict";t.d(r,{D:()=>i});let{withContext:s,PropsProvider:n}=(0,t(74482).a)({key:"heading"}),i=s("h2")},34020:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>N});var s=t(37876),n=t(19277),i=t(43123),l=t(39822),o=t(14232),a=t(95563),d=t(20529),c=t(30488),u=t(72953),g=t(92146),x=t(77362),h=t(60307),m=t(33712),p=t(77005);let j=(0,o.forwardRef)(function(e,r){var t,n,i;let{columns:l,minChildWidth:o,...a}=e,d=(0,h.$)(),c=o?(t=o,n=d,(0,m.s)(t,e=>{let r=n.tokens.getVar(`sizes.${e}`,"number"==typeof e?`${e}px`:e);return null===e?null:`repeat(auto-fit, minmax(${r}, 1fr))`})):(i=l,(0,m.s)(i,e=>null===e?null:`repeat(${e}, minmax(0, 1fr))`));return(0,s.jsx)(p.x,{ref:r,templateColumns:c,...a})});var f=t(1924),b=t(9463),C=t(70294),v=t(89099),k=t(69731),w=t(46954),y=t(66238),z=t(82703),A=t(81033),_=t(61385);function E(){let e=(0,v.useRouter)(),{resolvedTheme:r}=(0,z.j)(),{agents:t,isLoading:n,refetchAgents:h}=(0,k.my)(),{trigger:m,isMutating:p}=(0,w.JG)(),[E,N]=(0,o.useState)(""),[R,P]=(0,o.useState)(!1),S=(0,o.useContext)(A.j),$=(null==S?void 0:S.isOwner)||(null==S?void 0:S.isAdmin),D=y.kY.blockBorderColor[r]||y.kY.blockBorderColor.dark,F=y.kY.blockHoverColor[r]||y.kY.blockHoverColor.dark,T=async()=>{try{let e=await m({name:E||void 0});e&&(_.X.success({title:"Agent Created",description:"".concat(e.agent_name," has been created successfully.")}),N(""),P(!1),h())}catch(e){_.X.error({title:"Error",description:e.message||"Failed to create agent"})}},Y=r=>{e.push("/agents/".concat(r,"/dashboard"))};return n?(0,s.jsx)(i.s,{justify:"center",align:"center",minH:"300px",children:(0,s.jsx)(a.y,{size:"lg"})}):(0,s.jsxs)(l.a,{w:"100%",children:[(0,s.jsxs)(i.s,{justify:"space-between",align:"center",mb:6,children:[(0,s.jsxs)(l.a,{children:[(0,s.jsx)(d.D,{size:"lg",children:"Your Agents"}),(0,s.jsx)(c.E,{fontSize:"sm",color:"gray.500",mt:1,children:"Select an agent to manage or create a new one"})]}),$&&!R&&(0,s.jsxs)(u.$,{colorPalette:"blue",size:"sm",onClick:()=>P(!0),children:[(0,s.jsx)(C.GGD,{}),"New Agent"]})]}),R&&$&&(0,s.jsxs)(l.a,{mb:6,p:4,borderWidth:"1px",borderColor:D,borderRadius:"lg",children:[(0,s.jsx)(c.E,{fontWeight:"medium",mb:3,children:"Create New Agent"}),(0,s.jsxs)(g.z,{gap:3,children:[(0,s.jsx)(x.p,{placeholder:"Agent name (optional)",value:E,onChange:e=>N(e.target.value),size:"sm",flex:1}),(0,s.jsx)(u.$,{colorPalette:"blue",size:"sm",onClick:T,disabled:p,children:p?(0,s.jsx)(a.y,{size:"sm"}):"Create"}),(0,s.jsx)(u.$,{variant:"ghost",size:"sm",onClick:()=>{P(!1),N("")},children:"Cancel"})]})]}),0===t.length?(0,s.jsxs)(i.s,{direction:"column",align:"center",justify:"center",minH:"200px",borderWidth:"1px",borderColor:D,borderRadius:"lg",p:8,children:[(0,s.jsx)(C.Ojn,{size:48,color:"gray"}),(0,s.jsx)(c.E,{mt:4,color:"gray.500",children:"No agents yet. Create your first agent to get started!"}),$&&(0,s.jsxs)(u.$,{mt:4,colorPalette:"blue",onClick:()=>P(!0),children:[(0,s.jsx)(C.GGD,{}),"Create First Agent"]})]}):(0,s.jsx)(j,{columns:{base:1,md:2,lg:3},gap:4,children:t.map(e=>(0,s.jsx)(l.a,{p:4,borderWidth:"1px",borderColor:D,borderRadius:"lg",cursor:"pointer",transition:"all 0.2s",_hover:{borderColor:"blue.500",bg:F,transform:"translateY(-2px)",boxShadow:"md"},onClick:()=>Y(e.id),children:(0,s.jsxs)(i.s,{justify:"space-between",align:"flex-start",children:[(0,s.jsxs)(f.T,{align:"start",gap:2,flex:1,children:[(0,s.jsx)(d.D,{size:"md",lineClamp:1,children:e.name}),(0,s.jsxs)(c.E,{fontSize:"xs",color:"gray.500",lineClamp:1,children:["ID: ",e.id.slice(0,8),"..."]})]}),(0,s.jsx)(b.K,{"aria-label":"Open agent",size:"sm",variant:"ghost",colorPalette:"blue",onClick:r=>{r.stopPropagation(),Y(e.id)},children:(0,s.jsx)(C.dyV,{})})]})},e.id))})]})}let N=(0,n.A)(function(){return(0,s.jsx)(i.s,{w:"100%",flexDirection:"column",alignItems:"center",children:(0,s.jsx)(l.a,{w:"100%",position:"relative",children:(0,s.jsx)(E,{})})})})},77005:(e,r,t)=>{"use strict";t.d(r,{x:()=>l});var s=t(37876),n=t(14232),i=t(57175);let l=(0,n.forwardRef)(function(e,r){let{templateAreas:t,column:n,row:l,autoFlow:o,autoRows:a,templateRows:d,autoColumns:c,templateColumns:u,inline:g,...x}=e;return(0,s.jsx)(i.B.div,{...x,ref:r,css:[{display:g?"inline-grid":"grid",gridTemplateAreas:t,gridAutoColumns:c,gridColumn:n,gridRow:l,gridAutoFlow:o,gridAutoRows:a,gridTemplateRows:d,gridTemplateColumns:u},e.css]})})},77362:(e,r,t)=>{"use strict";t.d(r,{p:()=>u});var s=t(37876),n=t(5661),i=t(14232),l=t(61112),o=t(8641);let a=(0,i.forwardRef)((e,r)=>{let t=(0,o.f)(),i=(0,n.v6)(t?.getInputProps(),e);return(0,s.jsx)(l.X.input,{...i,ref:r})});a.displayName="FieldInput";let{withContext:d,PropsProvider:c}=(0,t(74482).a)({key:"input"}),u=d(a)}},e=>{e.O(0,[0,636,593,792],()=>e(e.s=2814)),_N_E=e.O()}]);
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.