decocms
Version:
Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools
2 lines • 63.2 kB
JavaScript
import{c as R,b as Q,e as Xe,j as n,B as F,t as We,o as gt,cu as pe,ai as zt,a as fe,M as cn,V as Ft,K as ht,cv as Bt,cw as Kt,aw as Ze,m as bt,bb as dn,C as kt,r as X,af as un,ag as ie,cx as mn,w as Mt,x as qt,v as Ht,D as Ut,d as Jt,a6 as jt,H as fn,T as Vt,i as et,E as xt,aY as Gt,cy as gn,cz as hn,b9 as Tt,J as pn,cA as yn,bG as bn,aW as xn,y as wn,cB as Sn,cC as jn,cD as vn,cE as kn,cF as Tn,a7 as Nn,u as Pn,a8 as _n,cG as In,cH as On,l as Wt,cI as Nt,cJ as An,O as Cn,b3 as Pt,cK as En,a0 as $n}from"./index-ztdGKvBm.js";import{t as Yt}from"./Globe04-CeAQ1YNm.js";import{a as Ln,s as se}from"./UserSquare-CafFh5_d.js";import{u as Dn}from"./use-deployment-admin-Cr4LWHG9.js";import{a as Rn}from"./admin-fetch-BhTJlAsX.js";import{a0 as zn,B as yt,y as Fn,a1 as Bn,a2 as Kn,n as _t,h as Mn,a3 as qn,k as Hn,a4 as Un}from"./agent-icon-BYWtutu9.js";import{s as Jn,d as Vn}from"./UserCheck01-k-4bTA2h.js";import{s as Gn}from"./XClose-CmTuu4UN.js";import{l as Qt,i as Wn,c as Yn,b as Qn,a as Xn,w as Zn,O as es,j as ts,u as ns,k as ss,o as os}from"./use-org-notice-Bg0zOPPj.js";import{u as is,a as as}from"./use-project-scope-BwqdbGG4.js";import{u as Xt,a as rs}from"./use-panel-navigate-0z93k6Ut.js";import{i as me}from"./CheckCircle-DZ8MNpCP.js";import{i as It}from"./Monitor01-DMFbvudn.js";import{i as Ve}from"./Zap-CBJ7My90.js";import{s as Ot}from"./Plus-DWySsEmB.js";import{a as ls}from"./Tool01-BCJ5kyrz.js";import{e as Ge,b as oe,d as cs,a as ds,c as us,C as ms}from"./command-C3tlrKUq.js";import{I as fs}from"./integration-icon-Bo-3z9o3.js";import{P as gs}from"./project-icon-fQqckccl.js";import{a as hs}from"./use-navigate-to-agent-Cw8_3uU5.js";import{u as ps}from"./use-debounced-value-DO5dvp6c.js";import{a as ys,m as bs}from"./use-mcp-client-2MG3LveS.js";import{a as xs}from"./new-project-dialog-BW6Lh52P.js";import{u as ws,n as Ss}from"./new-project-store-DID5OVrt.js";import{L as js}from"./legacy-admin-welcome-dialog-plmLACwz.js";import{R as vs}from"./required-auth-layout-Cwtu4iIe.js";import{t as ks,u as Ts,b as Ns,A as At}from"./use-view-draft-kind-BopwZu5H.js";import{u as Ps,a as _s,c as Is,b as Os}from"./thread-route-CfpvvkkL.js";import{c as As,f as Cs}from"./thread-intent-DyZ5A9F9.js";import{u as Es}from"./use-blog-view-DMfZjkz0.js";import{u as $s}from"./use-org-sso-_fzcS8V-.js";function Ls(t){const e=R.c(49),{orgName:o,orgSlug:a,orgLogo:s,domain:r}=t,i=Q();let c;e[0]!==a||e[1]!==i?(c=async()=>{const I=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:a})}),A=await I.json();if(!I.ok||!A.success)throw new Error(A.error??i("common.autoDomainJoinScreen.joinError"));return A},e[0]=a,e[1]=i,e[2]=c):c=e[2];let f;e[3]!==a?(f=I=>{window.location.href=`/${I.slug??a}`},e[3]=a,e[4]=f):f=e[4];let g;e[5]!==i?(g=I=>{We.error(I instanceof Error?I.message:i("common.autoDomainJoinScreen.joinError"))},e[5]=i,e[6]=g):g=e[6];let h;e[7]!==c||e[8]!==f||e[9]!==g?(h={mutationFn:c,onSuccess:f,onError:g},e[7]=c,e[8]=f,e[9]=g,e[10]=h):h=e[10];const d=Xe(h),u=Ds;let l;e[11]!==s||e[12]!==o?(l=s?n.jsx(gt,{url:s,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Yt,{className:"h-6 w-6 text-primary"})}),e[11]=s,e[12]=o,e[13]=l):l=e[13];let y;e[14]!==o||e[15]!==i?(y=i("common.autoDomainJoinScreen.joinPrompt",{orgName:o}),e[14]=o,e[15]=i,e[16]=y):y=e[16];let m;e[17]!==y?(m=n.jsx("h3",{className:"text-lg font-medium",children:y}),e[17]=y,e[18]=m):m=e[18];let w;e[19]!==r||e[20]!==i?(w=i("common.autoDomainJoinScreen.joinDescription",{domain:r}),e[19]=r,e[20]=i,e[21]=w):w=e[21];let j;e[22]!==w?(j=n.jsx("p",{className:"text-sm text-muted-foreground",children:w}),e[22]=w,e[23]=j):j=e[23];let p;e[24]!==m||e[25]!==j?(p=n.jsxs("div",{className:"space-y-2",children:[m,j]}),e[24]=m,e[25]=j,e[26]=p):p=e[26];let b;e[27]!==d?(b=()=>d.mutate(),e[27]=d,e[28]=b):b=e[28];let S;e[29]!==d.isPending||e[30]!==o||e[31]!==i?(S=d.isPending?i("common.autoDomainJoinScreen.joining"):i("common.autoDomainJoinScreen.enterOrg",{orgName:o}),e[29]=d.isPending,e[30]=o,e[31]=i,e[32]=S):S=e[32];let x;e[33]!==d.isPending||e[34]!==b||e[35]!==S?(x=n.jsx(F,{onClick:b,disabled:d.isPending,children:S}),e[33]=d.isPending,e[34]=b,e[35]=S,e[36]=x):x=e[36];const k=d.isPending;let T;e[37]!==i?(T=i("common.goHome"),e[37]=i,e[38]=T):T=e[38];let v;e[39]!==d.isPending||e[40]!==T?(v=n.jsx(F,{variant:"ghost",onClick:u,disabled:k,children:T}),e[39]=d.isPending,e[40]=T,e[41]=v):v=e[41];let P;e[42]!==x||e[43]!==v?(P=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[x,v]}),e[42]=x,e[43]=v,e[44]=P):P=e[44];let _;return e[45]!==p||e[46]!==P||e[47]!==l?(_=n.jsxs(pe,{children:[l,p,P]}),e[45]=p,e[46]=P,e[47]=l,e[48]=_):_=e[48],_}function Ds(){window.location.href="/"}function Ct(t){const e=R.c(26),{orgSlug:o,orgId:a,orgName:s,reason:r}=t,i=Q(),{isAdmin:c}=Dn(),f=Rs,g=r==="not-found",h=g?Ln:zt;let d;e[0]!==g||e[1]!==i?(d=i(g?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=g,e[1]=i,e[2]=d):d=e[2];const u=d;let l;e[3]!==g||e[4]!==s||e[5]!==o||e[6]!==i?(l=g?n.jsxs(n.Fragment,{children:[i("common.noAccessScreen.couldNotFind")," ",n.jsx("strong",{children:o}),"."]}):n.jsxs(n.Fragment,{children:[i("common.noAccessScreen.noAccessTo")," ",n.jsx("strong",{children:s??o}),".",n.jsx("br",{}),i("common.noAccessScreen.askAdminToInvite")]}),e[3]=g,e[4]=s,e[5]=o,e[6]=i,e[7]=l):l=e[7];const y=l;let m;e[8]!==h?(m=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(h,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=h,e[9]=m):m=e[9];let w;e[10]!==u?(w=n.jsx("h3",{className:"text-lg font-medium",children:u}),e[10]=u,e[11]=w):w=e[11];let j;e[12]!==y?(j=n.jsx("p",{className:"text-sm text-muted-foreground",children:y}),e[12]=y,e[13]=j):j=e[13];let p;e[14]!==w||e[15]!==j?(p=n.jsxs("div",{className:"space-y-2",children:[w,j]}),e[14]=w,e[15]=j,e[16]=p):p=e[16];let b;e[17]!==c||e[18]!==a||e[19]!==o||e[20]!==i?(b=c&&a?n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(zs,{orgId:a,orgSlug:o}),n.jsx(F,{variant:"ghost",onClick:f,children:i("common.goHome")})]}):n.jsx(F,{onClick:f,children:i("common.goHome")}),e[17]=c,e[18]=a,e[19]=o,e[20]=i,e[21]=b):b=e[21];let S;return e[22]!==m||e[23]!==p||e[24]!==b?(S=n.jsxs(pe,{children:[m,p,b]}),e[22]=m,e[23]=p,e[24]=b,e[25]=S):S=e[25],S}function Rs(){window.location.href="/"}function zs(t){const e=R.c(20),{orgId:o,orgSlug:a}=t,s=Q(),{data:r}=fe.useSession(),i=r?.user.email;let c;e[0]!==i||e[1]!==o?(c=()=>Rn(`/api/_admin/orgs/${o}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i,role:"admin"})}),e[0]=i,e[1]=o,e[2]=c):c=e[2];let f;e[3]!==a?(f=()=>{window.location.href=`/${a}`},e[3]=a,e[4]=f):f=e[4];let g;e[5]!==s?(g=w=>{We.error(w instanceof Error?w.message:s("common.noAccessScreen.adminJoinFailed"))},e[5]=s,e[6]=g):g=e[6];let h;e[7]!==c||e[8]!==f||e[9]!==g?(h={mutationFn:c,onSuccess:f,onError:g},e[7]=c,e[8]=f,e[9]=g,e[10]=h):h=e[10];const d=Xe(h);let u;e[11]!==d?(u=()=>d.mutate(),e[11]=d,e[12]=u):u=e[12];const l=!i||d.isPending;let y;e[13]!==d.isPending||e[14]!==s?(y=d.isPending?s("common.noAccessScreen.adminJoining"):s("common.noAccessScreen.adminJoin"),e[13]=d.isPending,e[14]=s,e[15]=y):y=e[15];let m;return e[16]!==u||e[17]!==l||e[18]!==y?(m=n.jsx(F,{onClick:u,disabled:l,children:y}),e[16]=u,e[17]=l,e[18]=y,e[19]=m):m=e[19],m}function Fs(t){const e=R.c(59),{invitationId:o,orgName:a,orgSlug:s,orgLogo:r}=t,i=Q();let c;e[0]!==o?(c=async()=>{const O=await fe.organization.acceptInvitation({invitationId:o});if(O.error)throw new Error(O.error.message);return O.data},e[0]=o,e[1]=c):c=e[1];let f;e[2]!==s?(f=()=>{cn(),window.location.href=`/${s}`},e[2]=s,e[3]=f):f=e[3];let g;e[4]!==i?(g=O=>{We.error(O instanceof Error?O.message:i("common.pendingInviteScreen.failedToAccept"))},e[4]=i,e[5]=g):g=e[5];let h;e[6]!==c||e[7]!==f||e[8]!==g?(h={mutationFn:c,onSuccess:f,onError:g},e[6]=c,e[7]=f,e[8]=g,e[9]=h):h=e[9];const d=Xe(h);let u;e[10]!==o?(u=async()=>{const O=await fe.organization.rejectInvitation({invitationId:o});if(O.error)throw new Error(O.error.message);return O.data},e[10]=o,e[11]=u):u=e[11];let l,y;e[12]!==i?(l=()=>{We.success(i("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},y=O=>{We.error(O instanceof Error?O.message:i("common.pendingInviteScreen.failedToDecline"))},e[12]=i,e[13]=l,e[14]=y):(l=e[13],y=e[14]);let m;e[15]!==u||e[16]!==l||e[17]!==y?(m={mutationFn:u,onSuccess:l,onError:y},e[15]=u,e[16]=l,e[17]=y,e[18]=m):m=e[18];const w=Xe(m),j=d.isPending||w.isPending;let p;e[19]!==r||e[20]!==a?(p=r?n.jsx(gt,{url:r,fallback:a,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(zn,{className:"h-6 w-6 text-primary"})}),e[19]=r,e[20]=a,e[21]=p):p=e[21];let b;e[22]!==a||e[23]!==i?(b=i("common.pendingInviteScreen.invitedTo",{orgName:a}),e[22]=a,e[23]=i,e[24]=b):b=e[24];let S;e[25]!==b?(S=n.jsx("h3",{className:"text-lg font-medium",children:b}),e[25]=b,e[26]=S):S=e[26];let x;e[27]!==i?(x=i("common.pendingInviteScreen.acceptDescription"),e[27]=i,e[28]=x):x=e[28];let k;e[29]!==x?(k=n.jsx("p",{className:"text-sm text-muted-foreground",children:x}),e[29]=x,e[30]=k):k=e[30];let T;e[31]!==S||e[32]!==k?(T=n.jsxs("div",{className:"space-y-2",children:[S,k]}),e[31]=S,e[32]=k,e[33]=T):T=e[33];let v;e[34]!==d?(v=()=>d.mutate(),e[34]=d,e[35]=v):v=e[35];let P;e[36]!==d.isPending||e[37]!==i?(P=d.isPending?i("common.pendingInviteScreen.acceptingButton"):i("common.pendingInviteScreen.acceptButton"),e[36]=d.isPending,e[37]=i,e[38]=P):P=e[38];let _;e[39]!==j||e[40]!==v||e[41]!==P?(_=n.jsx(F,{onClick:v,disabled:j,children:P}),e[39]=j,e[40]=v,e[41]=P,e[42]=_):_=e[42];let I;e[43]!==w?(I=()=>w.mutate(),e[43]=w,e[44]=I):I=e[44];let A;e[45]!==w.isPending||e[46]!==i?(A=w.isPending?i("common.pendingInviteScreen.decliningButton"):i("common.pendingInviteScreen.declineButton"),e[45]=w.isPending,e[46]=i,e[47]=A):A=e[47];let E;e[48]!==j||e[49]!==I||e[50]!==A?(E=n.jsx(F,{variant:"ghost",onClick:I,disabled:j,children:A}),e[48]=j,e[49]=I,e[50]=A,e[51]=E):E=e[51];let $;e[52]!==_||e[53]!==E?($=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[_,E]}),e[52]=_,e[53]=E,e[54]=$):$=e[54];let L;return e[55]!==T||e[56]!==$||e[57]!==p?(L=n.jsxs(pe,{children:[p,T,$]}),e[55]=T,e[56]=$,e[57]=p,e[58]=L):L=e[58],L}function Bs(t){const e=R.c(23),{orgName:o,orgLogo:a}=t,s=Q();let r;e[0]!==a||e[1]!==o?(r=a?n.jsx(gt,{url:a,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:n.jsx(Jn,{className:"h-6 w-6 text-primary"})}),e[0]=a,e[1]=o,e[2]=r):r=e[2];let i;e[3]!==s?(i=s("common.requestPendingScreen.title"),e[3]=s,e[4]=i):i=e[4];let c;e[5]!==i?(c=n.jsx("h3",{className:"text-lg font-medium",children:i}),e[5]=i,e[6]=c):c=e[6];let f;e[7]!==o||e[8]!==s?(f=s("common.requestPendingScreen.description",{orgName:o}),e[7]=o,e[8]=s,e[9]=f):f=e[9];let g;e[10]!==f?(g=n.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[10]=f,e[11]=g):g=e[11];let h;e[12]!==c||e[13]!==g?(h=n.jsxs("div",{className:"space-y-2",children:[c,g]}),e[12]=c,e[13]=g,e[14]=h):h=e[14];let d;e[15]!==s?(d=s("common.goHome"),e[15]=s,e[16]=d):d=e[16];let u;e[17]!==d?(u=n.jsx(F,{variant:"ghost",onClick:Ks,children:d}),e[17]=d,e[18]=u):u=e[18];let l;return e[19]!==r||e[20]!==h||e[21]!==u?(l=n.jsxs(pe,{children:[r,h,u]}),e[19]=r,e[20]=h,e[21]=u,e[22]=l):l=e[22],l}function Ks(){window.location.href="/"}function Ms(t){const e=R.c(45),{orgName:o,orgSlug:a,orgLogo:s,domain:r}=t,i=Q();let c;e[0]!==a?(c=async()=>{const _=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:a})}),I=await _.json();if(!_.ok||!I.success)throw new Error(I.error??"Failed to request access");return I},e[0]=a,e[1]=c):c=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=Hs,e[2]=f):f=e[2];let g;e[3]!==i?(g=_=>{We.error(_ instanceof Error?_.message:i("common.requestToJoinScreen.failedToRequest"))},e[3]=i,e[4]=g):g=e[4];let h;e[5]!==c||e[6]!==g?(h={mutationFn:c,onSuccess:f,onError:g},e[5]=c,e[6]=g,e[7]=h):h=e[7];const d=Xe(h);let u;e[8]!==s||e[9]!==o?(u=s?n.jsx(gt,{url:s,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Yt,{className:"h-6 w-6 text-primary"})}),e[8]=s,e[9]=o,e[10]=u):u=e[10];let l;e[11]!==o||e[12]!==i?(l=i("common.requestToJoinScreen.title",{orgName:o}),e[11]=o,e[12]=i,e[13]=l):l=e[13];let y;e[14]!==l?(y=n.jsx("h3",{className:"text-lg font-medium",children:l}),e[14]=l,e[15]=y):y=e[15];let m;e[16]!==r||e[17]!==i?(m=i("common.requestToJoinScreen.description",{domain:r}),e[16]=r,e[17]=i,e[18]=m):m=e[18];let w;e[19]!==m?(w=n.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=w):w=e[20];let j;e[21]!==y||e[22]!==w?(j=n.jsxs("div",{className:"space-y-2",children:[y,w]}),e[21]=y,e[22]=w,e[23]=j):j=e[23];let p;e[24]!==d?(p=()=>d.mutate(),e[24]=d,e[25]=p):p=e[25];let b;e[26]!==d.isPending||e[27]!==i?(b=d.isPending?i("common.requestToJoinScreen.requesting"):i("common.requestToJoinScreen.requestButton"),e[26]=d.isPending,e[27]=i,e[28]=b):b=e[28];let S;e[29]!==d.isPending||e[30]!==p||e[31]!==b?(S=n.jsx(F,{onClick:p,disabled:d.isPending,children:b}),e[29]=d.isPending,e[30]=p,e[31]=b,e[32]=S):S=e[32];const x=d.isPending;let k;e[33]!==i?(k=i("common.goHome"),e[33]=i,e[34]=k):k=e[34];let T;e[35]!==d.isPending||e[36]!==k?(T=n.jsx(F,{variant:"ghost",onClick:qs,disabled:x,children:k}),e[35]=d.isPending,e[36]=k,e[37]=T):T=e[37];let v;e[38]!==S||e[39]!==T?(v=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[S,T]}),e[38]=S,e[39]=T,e[40]=v):v=e[40];let P;return e[41]!==j||e[42]!==v||e[43]!==u?(P=n.jsxs(pe,{children:[u,j,v]}),e[41]=j,e[42]=v,e[43]=u,e[44]=P):P=e[44],P}function qs(){window.location.href="/"}function Hs(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function Us(t){const e=R.c(7);let o;e[0]!==t?(o=ht.orgAccessStatus(t),e[0]=t,e[1]=o):o=e[1];let a;e[2]!==t?(a=async()=>{const r=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!r.ok)throw new Error(`org-access-status failed (${r.status})`);return await r.json()},e[2]=t,e[3]=a):a=e[3];let s;return e[4]!==o||e[5]!==a?(s={queryKey:o,queryFn:a,refetchOnWindowFocus:!1},e[4]=o,e[5]=a,e[6]=s):s=e[6],Ft(s)}function Js({orgSlug:t}){const{data:e}=Us(t);if(e.status!=="member"){const o=Bt()?.org===t;o&&Kt();const a=localStorage.getItem(Ze.lastOrgSlug())===t;if(a&&localStorage.removeItem(Ze.lastOrgSlug()),(o||a)&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(Ct,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(Fs,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(Ls,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(Ms,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(Bs,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(Ct,{orgSlug:t,orgId:e.organization.id,orgName:e.organization.name,reason:"no-access"})}function Zt(t){const e=R.c(42),{ariaLabel:o,dismissLabel:a,eyebrow:s,title:r,description:i,icon:c,children:f,footerLeading:g,actions:h,onDismiss:d,tone:u}=t,l=u===void 0?"neutral":u,y=g||h;let m;e[0]!==l?(m=l==="system"&&n.jsx("div",{className:"h-0.5 bg-special"}),e[0]=l,e[1]=m):m=e[1];let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Gn,{size:14}),e[2]=w):w=e[2];let j;e[3]!==a||e[4]!==d?(j=n.jsx(F,{size:"icon-sm",variant:"ghost","aria-label":a,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:d,children:w}),e[3]=a,e[4]=d,e[5]=j):j=e[5];const p=c&&"flex items-start gap-3",b=f&&"pb-3";let S;e[6]!==p||e[7]!==b?(S=bt("p-4 pr-11",p,b),e[6]=p,e[7]=b,e[8]=S):S=e[8];let x;e[9]!==c?(x=c&&n.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:c}),e[9]=c,e[10]=x):x=e[10];let k;e[11]!==s?(k=s&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[11]=s,e[12]=k):k=e[12];let T;e[13]!==r?(T=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:r}),e[13]=r,e[14]=T):T=e[14];let v;e[15]!==i?(v=i&&n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i}),e[15]=i,e[16]=v):v=e[16];let P;e[17]!==T||e[18]!==v||e[19]!==k?(P=n.jsxs("div",{children:[k,T,v]}),e[17]=T,e[18]=v,e[19]=k,e[20]=P):P=e[20];let _;e[21]!==f?(_=f&&n.jsx("div",{className:"mt-3",children:f}),e[21]=f,e[22]=_):_=e[22];let I;e[23]!==P||e[24]!==_?(I=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,_]}),e[23]=P,e[24]=_,e[25]=I):I=e[25];let A;e[26]!==I||e[27]!==S||e[28]!==x?(A=n.jsxs("div",{className:S,children:[x,I]}),e[26]=I,e[27]=S,e[28]=x,e[29]=A):A=e[29];let E;e[30]!==h||e[31]!==g||e[32]!==y||e[33]!==l?(E=y&&n.jsxs("div",{className:bt("flex items-center justify-between gap-3 px-4 py-2.5",l==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[n.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:g}),n.jsx("div",{className:"flex shrink-0 items-center gap-2",children:h})]}),e[30]=h,e[31]=g,e[32]=y,e[33]=l,e[34]=E):E=e[34];let $;return e[35]!==o||e[36]!==A||e[37]!==E||e[38]!==m||e[39]!==j||e[40]!==l?($=n.jsxs("div",{role:"dialog","aria-label":o,"data-slot":"announcement-card","data-tone":l,className:"relative w-full overflow-hidden rounded-lg bg-popover shadow-soft animate-in fade-in slide-in-from-bottom-2 duration-300",children:[m,j,A,E]}),e[35]=o,e[36]=A,e[37]=E,e[38]=m,e[39]=j,e[40]=l,e[41]=$):$=e[41],$}const Vs=[{scope:"shell",anchor:"switcher",titleKey:"layoutTour.switcher.title",descKey:"layoutTour.switcher.description",side:"right"},{scope:"shell",anchor:"nav",titleKey:"layoutTour.nav.title",descKey:"layoutTour.nav.description",side:"right"},{scope:"shell",anchor:"tasks",titleKey:"layoutTour.tasks.title",descKey:"layoutTour.tasks.description",side:"right"},{scope:"project",anchor:"siteEditor",titleKey:"layoutTour.siteEditor.title",descKey:"layoutTour.siteEditor.description",side:"right"},{scope:"project",anchor:"automations",titleKey:"layoutTour.automations.title",descKey:"layoutTour.automations.description",side:"right"},{scope:"shell",anchor:"settings",titleKey:"layoutTour.settings.title",descKey:"layoutTour.settings.description",side:"right"},{scope:"shell",anchor:"projects",titleKey:"layoutTour.projects.title",descKey:"layoutTour.projects.description",side:"right"},{scope:"shell",anchor:"account",titleKey:"layoutTour.account.title",descKey:"layoutTour.account.description",side:"right"},{scope:"siteEditor",anchor:"surfaceTabs",titleKey:"layoutTour.surfaceTabs.title",descKey:"layoutTour.surfaceTabs.description",side:"bottom"},{scope:"siteEditor",anchor:"branchPicker",titleKey:"layoutTour.branchPicker.title",descKey:"layoutTour.branchPicker.description",side:"bottom"},{scope:"orgHome",anchor:"recentActivity",titleKey:"layoutTour.recentActivity.title",descKey:"layoutTour.recentActivity.description",side:"top"}];function Gs(t){return Vs.filter(e=>e.scope==="shell"||e.scope==="orgHome"&&t.onOrgHome||e.scope==="project"&&t.inProject||e.scope==="siteEditor"&&t.onSiteEditor)}function Ws(t,e){return Gs(e).map(o=>({element:Qt(o.anchor),popover:{title:t(o.titleKey),description:t(o.descKey),side:o.side,align:"center"}}))}const Ys=Qt("switcher"),Qs=30;function en(t){const e=document.querySelector(t);return e instanceof HTMLElement&&e.offsetParent!==null}function Xs(t,e){return Ws(t,e).filter(o=>typeof o.element=="string"&&en(o.element))}function Zs(t,e){return{showProgress:!0,progressText:t("layoutTour.progress"),nextBtnText:t("layoutTour.next"),prevBtnText:t("layoutTour.prev"),doneBtnText:t("layoutTour.done"),showButtons:["next","previous"],smoothScroll:!0,allowClose:!0,disableActiveInteraction:!0,stagePadding:6,stageRadius:8,waitForElement:0,skipMissingElement:!0,popoverClass:"layout-tour-popover",onPopoverRender:(o,{driver:a})=>{if(o.footerButtons.querySelector(".layout-tour-skip"))return;const s=document.createElement("button");s.type="button",s.className="driver-popover-footer-btn layout-tour-skip",s.textContent=t("layoutTour.skip"),s.addEventListener("click",()=>a.destroy()),o.footerButtons.insertBefore(s,o.footerButtons.firstChild)},onDestroyed:()=>{Qe=!1},steps:e}}let Qe=!1;async function eo(){return(await dn(()=>import("./driver.js-Dj4CfABu.js"),[])).driver}function to(t,e){if(Qe)return;Qe=!0;let o=0;const a=()=>{if(!en(Ys)&&o++<Qs){requestAnimationFrame(a);return}const s=Xs(t,e);if(s.length===0){Qe=!1;return}eo().then(r=>{r(Zs(t,s)).drive()}).catch(()=>{Qe=!1})};a()}const tn=[{id:"new-layout",date:"2026-09-22",eyebrow:"Now Available",title:"New Layout",bullets:[{icon:It,title:"Unified page headers",body:"Every page now has a clear header with navigation breadcrumbs and actions, making it easy to orient yourself and move around."},{icon:yt,title:"Consistent navigation and controls",body:"Settings and project pages use a predictable sidebar instead of scattered tabs. Buttons, inputs and toolbars share one shape and one height, and the layout adapts to smaller screens."},{icon:Vn,title:"Site editor redesigned",body:"Try the redesigned blocks editor from Profile & Preferences. Blocks share consistent actions, variants appear beside their block in the header, and section selection is searchable."}],cta:{label:"Take a tour",action:"start-tour"}},{id:"unified-workspace-layout",date:"2026-09-01",eyebrow:"Now Available",title:"A new way around Studio",bullets:[{icon:kt,title:"Unified org switcher",body:"Organizations and agents now share one control at the top of the sidebar. Search it to jump straight to any agent, including ones in your other organizations."},{icon:se,title:"Your org at a glance",body:"The organization home now opens on the agents your team built and the tasks they are running — no empty board to fill in first."},{icon:It,title:"Simplified CMS",body:"The CMS opens over the page you are previewing rather than somewhere else, so changing a section never costs you your place."}],cta:{label:"Take the tour",action:"start-tour"}},{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:se,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:me,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:Ve,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:se,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:me,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:Ve,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:me,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:se,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:Ve,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:se,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:me,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:Ve,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:se,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:me,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:Ve,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:se,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:yt,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:me,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:kt,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:Ve,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:me,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:se,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:yt,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:se,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:Fn,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],ft="studio.release-feed.v1",wt=new Set;let ge="",he={},St=!1;function no(){if(St)return ge||"{}";try{return localStorage.getItem(ft)??"{}"}catch{return ge||"{}"}}function nn(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function Et(){const t=no();return t!==ge&&(ge=t,he=nn(t)),he}function so(t){wt.add(t);const e=o=>{if(!(o.key!==ft&&o.key!==null)){try{const a=localStorage.getItem(ft)??"{}",r={...nn(a),...he};he=r,ge=JSON.stringify(r)}catch{}t()}};return window.addEventListener("storage",e),()=>{wt.delete(t),window.removeEventListener("storage",e)}}function oo(t){he=t,ge=JSON.stringify(t);try{localStorage.setItem(ft,ge),St=!1}catch{St=!0}wt.forEach(e=>e())}function io(){const t=R.c(7),e=X.useSyncExternalStore(so,Et,Et);let o;t[0]!==e?(o=f=>!!e[f],t[0]=e,t[1]=o):o=t[1];const a=o,s=ao;let r;t[2]!==e?(r=tn.reduce((f,g)=>e[g.id]?f:f+1,0),t[2]=e,t[3]=r):r=t[3];const i=r;let c;return t[4]!==a||t[5]!==i?(c={isSeen:a,markSeen:s,unseenCount:i},t[4]=a,t[5]=i,t[6]=c):c=t[6],c}function ao(t){he[t]||oo({...he,[t]:{seenAt:new Date().toISOString()}})}const $t=new Map;function sn(t){let e=$t.get(t);return e||(e={now:Date.now(),subscribers:new Set,intervalId:null},$t.set(t,e)),e}function ro(t,e){const o=sn(t);return o.subscribers.add(e),o.intervalId===null&&(o.intervalId=setInterval(()=>{o.now=Date.now();for(const a of o.subscribers)a()},t)),()=>{o.subscribers.delete(e),o.subscribers.size===0&&o.intervalId!==null&&(clearInterval(o.intervalId),o.intervalId=null)}}function lo(t){const e=R.c(4),o=t===void 0?6e4:t;let a;e[0]!==o?(a=()=>sn(o).now,e[0]=o,e[1]=a):a=e[1];const s=a;let r;return e[2]!==o?(r=i=>ro(o,i),e[2]=o,e[3]=r):r=e[3],X.useSyncExternalStore(r,s,s)}const co=720*60*60*1e3,uo=10080*60*1e3;function mo(t){const[e,o,a]=t.split("-").map(Number);return!e||!o||!a?new Date(t).getTime():new Date(e,o-1,a).getTime()}function fo(t){const e=tn[0];if(!e)return null;const o=mo(e.date),a=t-o;return a<0||a>co?null:e}function go(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function ho(t,e){const o=go(t);return o===null?!1:e-o>=uo}function po(){const t=R.c(46),e=Q(),o=is(),a=un(),s=Xt(),r=!!o,i=a===ie.home&&!o;let c;t[0]!==s||t[1]!==r?(c=r&&!!s&&Wn(s),t[0]=s,t[1]=r,t[2]=c):c=t[2];const f=c,{data:g}=fe.useSession(),{isSeen:h,markSeen:d}=io(),u=lo(6e4);let l,y,m;if(t[3]!==h||t[4]!==u||t[5]!==g?.user?.createdAt){m=Symbol.for("react.early_return_sentinel");e:{if(l=fo(u),!l){m=null;break e}if(!ho(g?.user?.createdAt,u)){m=null;break e}y=h(l.id)}t[3]=h,t[4]=u,t[5]=g?.user?.createdAt,t[6]=l,t[7]=y,t[8]=m}else l=t[6],y=t[7],m=t[8];if(m!==Symbol.for("react.early_return_sentinel"))return m;if(y)return null;let w;t[9]!==l.id||t[10]!==r||t[11]!==d||t[12]!==i||t[13]!==f||t[14]!==e?(w=()=>{d(l.id),to(e,{onOrgHome:i,inProject:r,onSiteEditor:f})},t[9]=l.id,t[10]=r,t[11]=d,t[12]=i,t[13]=f,t[14]=e,t[15]=w):w=t[15];const j=w;let p;t[16]!==e?(p=e("announcements.release.ariaLabel"),t[16]=e,t[17]=p):p=t[17];let b;t[18]!==e?(b=e("announcements.release.dismiss"),t[18]=e,t[19]=b):b=t[19];const S=l.eyebrow,x=l.title;let k;t[20]!==l.id||t[21]!==d?(k=()=>d(l.id),t[20]=l.id,t[21]=d,t[22]=k):k=t[22];let T;t[23]!==l.id||t[24]!==l.learnMoreHref||t[25]!==d||t[26]!==e?(T=l.learnMoreHref?n.jsx("a",{href:l.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>d(l.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[23]=l.id,t[24]=l.learnMoreHref,t[25]=d,t[26]=e,t[27]=T):T=t[27];let v;t[28]!==l.cta||t[29]!==l.id||t[30]!==d||t[31]!==j?(v=l.cta?"href"in l.cta?n.jsx(F,{asChild:!0,size:"sm",onClick:()=>d(l.id),children:n.jsx("a",{href:l.cta.href,children:l.cta.label})}):n.jsx(F,{size:"sm",onClick:j,children:l.cta.label}):null,t[28]=l.cta,t[29]=l.id,t[30]=d,t[31]=j,t[32]=v):v=t[32];let P;t[33]!==l.bullets?(P=l.bullets.map(yo),t[33]=l.bullets,t[34]=P):P=t[34];let _;t[35]!==P?(_=n.jsx("ul",{className:"flex flex-col gap-3",children:P}),t[35]=P,t[36]=_):_=t[36];let I;return t[37]!==l.eyebrow||t[38]!==l.title||t[39]!==v||t[40]!==_||t[41]!==p||t[42]!==b||t[43]!==k||t[44]!==T?(I=n.jsx(Zt,{ariaLabel:p,dismissLabel:b,eyebrow:S,title:x,onDismiss:k,footerLeading:T,actions:v,children:_}),t[37]=l.eyebrow,t[38]=l.title,t[39]=v,t[40]=_,t[41]=p,t[42]=b,t[43]=k,t[44]=T,t[45]=I):I=t[45],I}function yo(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}function bo(t){const e=R.c(11),{open:o,onOpenChange:a}=t,s=Q();let r;e[0]!==s?(r=s("common.keyboardShortcutsDialog.title"),e[0]=s,e[1]=r):r=e[1];let i;e[2]!==r?(i=n.jsx(Mt,{children:n.jsx(qt,{children:r})}),e[2]=r,e[3]=i):i=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex flex-col gap-4",children:mn.map(xo)}),e[4]=c):c=e[4];let f;e[5]!==i?(f=n.jsxs(Ht,{className:"sm:max-w-md",children:[i,c]}),e[5]=i,e[6]=f):f=e[6];let g;return e[7]!==a||e[8]!==o||e[9]!==f?(g=n.jsx(Ut,{open:o,onOpenChange:a,children:f}),e[7]=a,e[8]=o,e[9]=f,e[10]=g):g=e[10],g}function xo(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(wo)})]},t.label)}function wo(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(So)})]},t.description)}function So(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const Lt=8,Ye=["all","organizations","projects","chats","connections","actions"],jo=5;function Dt(t){switch(t){case"all":return"commandPalette.scope.all";case"organizations":return"commandPalette.organizations";case"projects":return"commandPalette.projects";case"chats":return"commandPalette.scope.chats";case"connections":return"commandPalette.connections";case"actions":return"commandPalette.actions";default:return t}}function vo(t,e){const o=a=>{const s=e.indexOf(a);return s===-1?Number.POSITIVE_INFINITY:s};return[...t].sort((a,s)=>o(a.slug)-o(s.slug)||a.name.localeCompare(s.name))}function ko(t,e){const{org:o}=jt(),a=ys({connectionId:Vt,orgId:o.id,orgSlug:o.slug}),{data:s}=et({queryKey:ht.globalSearch(o.id,t,Lt),enabled:e&&!!a&&t.trim().length>=2,staleTime:15e3,retry:!1,queryFn:async()=>{if(!a)return[];try{return(await a.callTool({name:"GLOBAL_SEARCH",arguments:{query:t,limit:Lt}})).structuredContent?.items??[]}catch{return[]}}});return s??[]}function To(t){const e=R.c(213),{open:o,onOpenChange:a}=t,s=Q(),r=Jt(),{org:i}=jt(),{projects:c,hasProjects:f}=as(),{remember:g}=hs(i.slug),[h,d]=X.useState(""),[u,l]=X.useState("all");let y;e[0]!==u?(y=z=>u==="all"||u===z,e[0]=u,e[1]=y):y=e[1];const m=y,w=X.useDeferredValue(h),j=ko(w,m("chats")||m("connections")),p=Yn(),{data:b}=fn(),{recent:S}=Qn();let x;e[2]!==h?(x=h.trim(),e[2]=h,e[3]=x):x=e[3];const k=x,T=ps(k,150),{hits:v}=Xn(m("organizations")?T:"");let P,_;if(e[4]!==i||e[5]!==v||e[6]!==b||e[7]!==S){const z=vo(Zn(b??[],i),S);let U;e[10]!==v?(U=new Set(v.map(Io)),e[10]=v,e[11]=U):U=e[11],P=U,_=[...z,...v.filter(Ie=>!z.some(B=>B.id===Ie.id))],e[4]=i,e[5]=v,e[6]=b,e[7]=S,e[8]=P,e[9]=_}else P=e[8],_=e[9];const I=_;let A;e[12]!==I||e[13]!==i.slug||e[14]!==u||e[15]!==k?(A=u==="all"&&!k?I.filter(z=>z.slug!==i.slug).slice(0,jo):I,e[12]=I,e[13]=i.slug,e[14]=u,e[15]=k,e[16]=A):A=e[16];const E=A;let $;e[17]!==a?($=()=>{a(!1),d(""),l("all")},e[17]=a,e[18]=$):$=e[18];const L=$;let O;e[19]!==u?(O=z=>{const U=Ye.indexOf(u);l(Ye[(U+z+Ye.length)%Ye.length]??"all")},e[19]=u,e[20]=O):O=e[20];const K=O;let H;e[21]!==L?(H=(z,U)=>{xt("command_palette_used",{kind:U}),z(),L()},e[21]=L,e[22]=H):H=e[22];const D=H;let ae;e[23]!==r||e[24]!==i.id||e[25]!==i.slug?(ae=z=>{if(z.type==="connection"){if(!z.slug){r({to:"/$org/settings/connections",params:{org:i.slug},search:{tab:"all"}});return}r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:z.slug}});return}if(z.type==="task"){r({to:ie.tasks,params:{org:i.slug,taskKey:z.key??void 0}});return}const U=Gt(i.id).id;gn(r,hn({org:i.slug,agentId:z.virtual_mcp_id??U,superAgentId:U}),{search:()=>({thread:z.id}),replace:!1})},e[23]=r,e[24]=i.id,e[25]=i.slug,e[26]=ae):ae=e[26];const Z=ae;let ee;e[27]!==h?(ee=[h],e[27]=h,e[28]=ee):ee=e[28];const ne=ee;let te,J,V,q,G,W,Y,C,M,ye,be,re,le,ce,de,ue;if(e[29]!==L||e[30]!==K||e[31]!==D||e[32]!==f||e[33]!==j||e[34]!==r||e[35]!==a||e[36]!==o||e[37]!==Z||e[38]!==i.slug||e[39]!==E||e[40]!==c||e[41]!==g||e[42]!==ne||e[43]!==u||e[44]!==P||e[45]!==m||e[46]!==s||e[47]!==h||e[48]!==p){const z=j.filter(_o),U=j.filter(Po);let Ie;e[65]!==i.slug?(Ie={org:i.slug},e[65]=i.slug,e[66]=Ie):Ie=e[66];const B=Ie;let Oe;e[67]!==s?(Oe=s("sidebar.navDestinations.home"),e[67]=s,e[68]=Oe):Oe=e[68];let at;e[69]===Symbol.for("react.memo_cache_sentinel")?(at=n.jsx(Mn,{"aria-hidden":"true"}),e[69]=at):at=e[69];let Ae;e[70]!==B||e[71]!==Oe?(Ae={key:"home",label:Oe,icon:at,to:ie.home,params:B},e[70]=B,e[71]=Oe,e[72]=Ae):Ae=e[72];let Ce;e[73]!==s?(Ce=s("sidebar.navDestinations.reports"),e[73]=s,e[74]=Ce):Ce=e[74];let rt;e[75]===Symbol.for("react.memo_cache_sentinel")?(rt=n.jsx(qn,{"aria-hidden":"true"}),e[75]=rt):rt=e[75];let Ee;e[76]!==B||e[77]!==Ce?(Ee={key:"reports",label:Ce,icon:rt,to:ie.reports,params:B},e[76]=B,e[77]=Ce,e[78]=Ee):Ee=e[78];let $e;e[79]!==s?($e=s("sidebar.navDestinations.tasks"),e[79]=s,e[80]=$e):$e=e[80];let lt;e[81]===Symbol.for("react.memo_cache_sentinel")?(lt=n.jsx(_t,{"aria-hidden":"true"}),e[81]=lt):lt=e[81];let Le;e[82]!==i.slug?(Le={org:i.slug,taskKey:void 0},e[82]=i.slug,e[83]=Le):Le=e[83];let De;e[84]!==$e||e[85]!==Le?(De={key:"tasks",label:$e,icon:lt,to:ie.tasks,params:Le},e[84]=$e,e[85]=Le,e[86]=De):De=e[86];let Re;e[87]!==s?(Re=s("sidebar.navDestinations.library"),e[87]=s,e[88]=Re):Re=e[88];let ct;e[89]===Symbol.for("react.memo_cache_sentinel")?(ct=n.jsx(Hn,{"aria-hidden":"true"}),e[89]=ct):ct=e[89];let ze;e[90]!==B||e[91]!==Re?(ze={key:"library",label:Re,icon:ct,to:ie.library,params:B},e[90]=B,e[91]=Re,e[92]=ze):ze=e[92];let Fe;e[93]!==s?(Fe=s("sidebar.navDestinations.discover"),e[93]=s,e[94]=Fe):Fe=e[94];let dt;e[95]===Symbol.for("react.memo_cache_sentinel")?(dt=n.jsx(Un,{"aria-hidden":"true"}),e[95]=dt):dt=e[95];let Be;e[96]!==B||e[97]!==Fe?(Be={key:"discover",label:Fe,icon:dt,to:ie.discover,params:B},e[96]=B,e[97]=Fe,e[98]=Be):Be=e[98];let ut;e[99]!==Ae||e[100]!==Ee||e[101]!==De||e[102]!==ze||e[103]!==Be?(ut=[Ae,Ee,De,ze,Be],e[99]=Ae,e[100]=Ee,e[101]=De,e[102]=ze,e[103]=Be,e[104]=ut):ut=e[104];const pt=ut;J=cs,be=o,e[105]!==L||e[106]!==a?(re=N=>N?a(!0):L(),e[105]=L,e[106]=a,e[107]=re):re=e[107],e[108]!==s?(le=s("commandPalette.title"),e[108]=s,e[109]=le):le=e[109],e[110]!==s?(ce=s("commandPalette.description"),e[110]=s,e[111]=ce):ce=e[111];let Ke;e[112]!==u||e[113]!==s?(Ke=u==="all"?s("commandPalette.placeholder"):s("commandPalette.placeholderScoped",{scope:s(Dt(u)).toLowerCase()}),e[112]=u,e[113]=s,e[114]=Ke):Ke=e[114];let Me;e[115]!==s?(Me=s("commandPalette.placeholder"),e[115]=s,e[116]=Me):Me=e[116];let qe;e[117]!==K||e[118]!==u||e[119]!==h?(qe=N=>{if(N.key==="Tab"){N.preventDefault(),K(N.shiftKey?-1:1);return}N.key==="Backspace"&&!h&&u!=="all"&&(N.preventDefault(),l("all"))},e[117]=K,e[118]=u,e[119]=h,e[120]=qe):qe=e[120],e[121]!==Ke||e[122]!==Me||e[123]!==qe||e[124]!==h?(de=n.jsx(ds,{placeholder:Ke,"aria-label":Me,value:h,onValueChange:d,onKeyDown:qe}),e[121]=Ke,e[122]=Me,e[123]=qe,e[124]=h,e[125]=de):de=e[125];let He;e[126]!==s?(He=s("commandPalette.scope.label"),e[126]=s,e[127]=He):He=e[127];let Ue;e[128]!==u||e[129]!==s?(Ue=Ye.map(N=>n.jsx("button",{type:"button",role:"radio","aria-checked":u===N,tabIndex:-1,onMouseDown:No,onClick:()=>l(N),className:bt("h-7 shrink-0 cursor-pointer rounded-full px-3 text-xs font-medium transition-colors focus-ring",u===N?"bg-foreground text-background":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:s(Dt(N))},N)),e[128]=u,e[129]=s,e[130]=Ue):Ue=e[130],e[131]!==He||e[132]!==Ue?(ue=n.jsx("div",{role:"radiogroup","aria-label":He,className:"flex gap-1 overflow-x-auto border-b px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:Ue}),e[131]=He,e[132]=Ue,e[133]=ue):ue=e[133],te=us,V="h-[min(420px,60vh)] max-h-none";let Je;e[134]!==s?(Je=s("commandPalette.empty"),e[134]=s,e[135]=Je):Je=e[135],e[136]!==Je?(q=n.jsx(ms,{children:Je}),e[136]=Je,e[137]=q):q=e[137],e[138]!==D||e[139]!==i.slug||e[140]!==E||e[141]!==P||e[142]!==m||e[143]!==s||e[144]!==h||e[145]!==p?(G=m("organizations")&&E.length>0&&n.jsx(Ge,{heading:s("commandPalette.organizations"),children:E.map(N=>n.jsxs(oe,{value:`org ${N.name} ${N.slug}`,keywords:P.has(N.id)?[h]:void 0,onSelect:()=>D(()=>p(N.slug),"organization"),children:[n.jsx(es,{org:N,size:"xs"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:N.name}),N.slug===i.slug&&n.jsx("span",{className:"text-meta shrink-0",children:s("sidebar.rail.currentOrganization")})]},`org:${N.id}`))}),e[138]=D,e[139]=i.slug,e[140]=E,e[141]=P,e[142]=m,e[143]=s,e[144]=h,e[145]=p,e[146]=G):G=e[146],e[147]!==pt||e[148]!==D||e[149]!==r||e[150]!==m||e[151]!==s?(W=m("actions")&&n.jsx(Ge,{heading:s("commandPalette.goTo"),children:pt.map(N=>n.jsxs(oe,{onSelect:()=>D(()=>r({to:N.to,params:N.params}),"destination"),children:[N.icon,n.jsx("span",{children:N.label})]},N.key))}),e[147]=pt,e[148]=D,e[149]=r,e[150]=m,e[151]=s,e[152]=W):W=e[152],e[153]!==D||e[154]!==f||e[155]!==r||e[156]!==i.slug||e[157]!==c||e[158]!==g||e[159]!==m||e[160]!==s?(Y=m("projects")&&f&&n.jsx(Ge,{heading:s("commandPalette.projects"),children:c.map(N=>n.jsxs(oe,{value:`project ${N.title}`,onSelect:()=>D(()=>{g(N.id),r({to:ie.projects,params:{org:i.slug,agentId:N.id}})},"project"),children:[n.jsx(gs,{icon:N.icon,name:N.title,"aria-hidden":"true"}),n.jsx("span",{children:N.title})]},N.id))}),e[153]=D,e[154]=f,e[155]=r,e[156]=i.slug,e[157]=c,e[158]=g,e[159]=m,e[160]=s,e[161]=Y):Y=e[161],e[162]!==D||e[163]!==r||e[164]!==B||e[165]!==m||e[166]!==s?(C=m("actions")&&n.jsxs(Ge,{heading:s("commandPalette.actions"),children:[n.jsxs(oe,{value:s("commandPalette.newProject"),onSelect:()=>D(()=>r({to:ie.home,params:B}),"new_project"),children:[n.jsx(Ot,{"aria-hidden":"true"}),n.jsx("span",{children:s("commandPalette.newProject")})]}),n.jsxs(oe,{value:s("commandPalette.inviteTeammate"),onSelect:()=>D(()=>r({to:"/$org/settings/members",params:B}),"invite"),children:[n.jsx(Bn,{"aria-hidden":"true"}),n.jsx("span",{children:s("commandPalette.inviteTeammate")})]}),n.jsxs(oe,{value:s("commandPalette.addConnection"),onSelect:()=>D(()=>r({to:"/$org/settings/connections",params:B,search:{tab:"all"}}),"add_connection"),children:[n.jsx(Ot,{"aria-hidden":"true"}),n.jsx("span",{children:s("commandPalette.addConnection")})]}),n.jsxs(oe,{value:s("commandPalette.settings"),onSelect:()=>D(()=>r({to:"/$org/settings/general",params:B}),"settings"),children:[n.jsx(ls,{"aria-hidden":"true"}),n.jsx("span",{children:s("commandPalette.settings")})]})]}),e[162]=D,e[163]=r,e[164]=B,e[165]=m,e[166]=s,e[167]=C):C=e[167],M=m("connections")&&z.length>0&&n.jsx(Ge,{heading:s("commandPalette.connections"),children:z.map(N=>n.jsxs(oe,{value:`${N.title} ${N.id}`,keywords:ne,onSelect:()=>D(()=>Z(N),"connection"),children:[n.jsx(fs,{icon:N.icon,name:N.title,size:"2xs","aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:N.title})]},`connection:${N.id}`))}),ye=m("chats")&&U.length>0&&n.jsx(Ge,{heading:s("commandPalette.results"),children:U.map(N=>n.jsxs(oe,{value:`${N.title} ${N.id}`,keywords:ne,onSelect:()=>D(()=>Z(N),N.type),children:[N.type==="thread"?n.jsx(Kn,{"aria-hidden":"true"}):n.jsx(_t,{"aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:N.title}),N.type==="task"&&N.key&&n.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:N.key})]},`${N.type}:${N.id}`))}),e[29]=L,e[30]=K,e[31]=D,e[32]=f,e[33]=j,e[34]=r,e[35]=a,e[36]=o,e[37]=Z,e[38]=i.slug,e[39]=E,e[40]=c,e[41]=g,e[42]=ne,e[43]=u,e[44]=P,e[45]=m,e[46]=s,e[47]=h,e[48]=p,e[49]=te,e[50]=J,e[51]=V,e[52]=q,e[53]=G,e[54]=W,e[55]=Y,e[56]=C,e[57]=M,e[58]=ye,e[59]=be,e[60]=re,e[61]=le,e[62]=ce,e[63]=de,e[64]=ue}else te=e[49],J=e[50],V=e[51],q=e[52],G=e[53],W=e[54],Y=e[55],C=e[56],M=e[57],ye=e[58],be=e[59],re=e[60],le=e[61],ce=e[62],de=e[63],ue=e[64];let xe;e[168]!==te||e[169]!==V||e[170]!==q||e[171]!==G||e[172]!==W||e[173]!==Y||e[174]!==C||e[175]!==M||e[176]!==ye?(xe=n.jsxs(te,{className:V,children:[q,G,W,Y,C,M,ye]}),e[168]=te,e[169]=V,e[170]=q,e[171]=G,e[172]=W,e[173]=Y,e[174]=C,e[175]=M,e[176]=ye,e[177]=xe):xe=e[177];let tt;e[178]===Symbol.for("react.memo_cache_sentinel")?(tt=["↑","↓"],e[178]=tt):tt=e[178];let we;e[179]!==s?(we=s("commandPalette.hint.navigate"),e[179]=s,e[180]=we):we=e[180];let Se;e[181]!==we?(Se=n.jsx(mt,{keys:tt,label:we}),e[181]=we,e[182]=Se):Se=e[182];let nt;e[183]===Symbol.for("react.memo_cache_sentinel")?(nt=["↵"],e[183]=nt):nt=e[183];let je;e[184]!==s?(je=s("commandPalette.hint.open"),e[184]=s,e[185]=je):je=e[185];let ve;e[186]!==je?(ve=n.jsx(mt,{keys:nt,label:je}),e[186]=je,e[187]=ve):ve=e[187];let st;e[188]===Symbol.for("react.memo_cache_sentinel")?(st=["Tab"],e[188]=st):st=e[188];let ke;e[189]!==s?(ke=s("commandPalette.hint.filter"),e[189]=s,e[190]=ke):ke=e[190];let Te;e[191]!==ke?(Te=n.jsx(mt,{keys:st,label:ke}),e[191]=ke,e[192]=Te):Te=e[192];let ot;e[193]===Symbol.for("react.memo_cache_sentinel")?(ot=["Esc"],e[193]=ot):ot=e[193];let Ne;e[194]!==s?(Ne=s("commandPalette.hint.close"),e[194]=s,e[195]=Ne):Ne=e[195];let Pe;e[196]!==Ne?(Pe=n.jsx(mt,{keys:ot,label:Ne}),e[196]=Ne,e[197]=Pe):Pe=e[197];let _e;e[198]!==Se||e[199]!==ve||e[200]!==Te||e[201]!==Pe?(_e=n.jsxs("div",{className:"flex items-center gap-4 border-t px-3 py-2 text-xs text-muted-foreground",children:[Se,ve,Te,Pe]}),e[198]=Se,e[199]=ve,e[200]=Te,e[201]=Pe,e[202]=_e):_e=e[202];let it;return e[203]!==J||e[204]!==be||e[205]!==re||e[206]!==le||e[207]!==ce||e[208]!==de||e[209]!==ue||e[210]!==xe||e[211]!==_e?(it=n.jsxs(J,{open:be,onOpenChange:re,title:le,description:ce,children:[de,ue,xe,_e]}),e[203]=J,e[204]=be,e[205]=re,e[206]=le,e[207]=ce,e[208]=de,e[209]=ue,e[210]=xe,e[211]=_e,e[212]=it):it=e[212],it}function No(t){return t.preventDefault()}function Po(t){return t.type!=="connection"}function _o(t){return t.type==="connection"}function Io(t){return t.id}function mt(t){const e=R.c(7),{keys:o,label:a}=t;let s;e[0]!==o?(s=o.map(Oo),e[0]=o,e[1]=s):s=e[1];let r;e[2]!==s?(r=n.jsx("span",{className:"flex items-center gap-0.5",children:s}),e[2]=s,e[3]=r):r=e[3];let i;return e[4]!==a||e[5]!==r?(i=n.jsxs("span",{className:"flex items-center gap-1.5",children:[r,a]}),e[4]=a,e[5]=r,e[6]=i):i=e[6],i}function Oo(t){return n.jsx("kbd",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-border bg-muted px-1 font-mono text-2xs",children:t},t)}const Ao=300*1e3,Co=2;function Eo(t,e,o){return!e||e===o?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function $o(t,e){return t.count>=Co&&t.version!==null&&t.version!==e}function Lo(){const t=R.c(31),e=Q();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:ht.appVersionCheck(),queryFn:Ro,refetchInterval:Ao,refetchIntervalInBackground:!0,staleTime:0},t[0]=o):o=t[0];const{data:a,dataUpdatedAt:s}=et(o),[r,i]=X.useState(0);let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c={version:null,count:0},t[1]=c):c=t[1];const[f,g]=X.useState(c);s!==r&&(i(s),g(v=>Eo(v,a,"4.619.4")));const[h,d]=X.useState(null);if(!$o(f,h))return null;let u;t[2]!==e?(u=e("announcements.version.ariaLabel"),t[2]=e,t[3]=u):u=t[3];let l;t[4]!==e?(l=e("announcements.version.dismiss"),t[4]=e,t[5]=l):l=t[5];let y;t[6]!==e?(y=e("announcements.version.eyebrow"),t[6]=e,t[7]=y):y=t[7];let m;t[8]!==e?(m=e("announcements.version.title"),t[8]=e,t[9]=m):m=t[9];let w;t[10]!==e?(w=e("announcements.version.description"),t[10]=e,t[11]=w):w=t[11];let j;t[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Tt,{size:16}),t[12]=j):j=t[12];let p;t[13]!==f.version?(p=()=>d(f.version),t[13]=f.version,t[14]=p):p=t[14];let b;t[15]!==e?(b=e("announcements.version.currentSession",{version:"4.619.4"}),t[15]=e,t[16]=b):b=t[16];let S;t[17]!==e?(S=e("announcements.version.refresh"),t[17]=e,t[18]=S):S=t[18];let x;t[19]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Tt,{size:14}),t[19]=x):x=t[19];let k;t[20]!==S?(k=n.jsxs(F,{size:"sm",onClick:Do,children:[S,x]}),t[20]=S,t[21]=k):k=t[21];let T;return t[22]!==k||t[23]!==u||t[24]!==l||t[25]!==y||t[26]!==m||t[27]!==w||t[28]!==p||t[29]!==b?(T=n.jsx(Zt,{ariaLabel:u,dismissLabel:l,eyebrow:y,title:m,description:w,icon:j,tone:"system",onDismiss:p,footerLeading:b,actions:k}),t[22]=k,t[23]=u,t[24]=l,t[25]=y,t[26]=m,t[27]=w,t[28]=p,t[29]=b,t[30]=T):T=t[30],T}function Do(){return window.location.reload()}async function Ro(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function zo(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const Fo=Date.parse("2026-07-21T00:00:00Z"),Rt=t=>zo(Ze.ptBrAnnouncementSeen(t));function Bo(){const t=R.c(35),e=Q(),[o,a]=pn(),{data:s,isPending:r}=fe.useSession(),i=s?.user,c=i?.id,f=i?.createdAt,g=f!=null&&new Date(f).getTime()<Fo,h=yn()==="pt-BR",d=!r&&!!c&&g&&h&&o.language==="en"&&!Rt(c).has()&&!bn(),[u,l]=X.useState(!1),[y,m]=X.useState(!1);!u&&!r&&(l(!0),d&&c&&(Rt(c).mark(),a(Mo),m(!0),xt("pt_br_auto_switch_shown")));let w;t[0]===Symbol.for("react.memo_cache_sentinel")?(w=D=>{xt("pt_br_auto_switch_closed",{action:D}),m(!1)},t[0]=w):w=t[0];const j=w;let p;t[1]!==a?(p=()=>{a(Ko),j("switch-back")},t[1]=a,t[2]=p):p=t[2];const b=p;let S;t[3]===Symbol.for("react.memo_cache_sentinel")?(S=D=>!D&&j("dismiss"),t[3]=S):S=t[3];let x;t[4]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=x):x=t[4];let k;t[5]!==e?(k=e("announcements.ptBr.title"),t[5]=e,t[6]=k):k=t[6];let T;t[7]!==k?(T=n.jsx(qt,{children:k}),t[7]=k,t[8]=T):T=t[8];let v;t[9]!==e?(v=e("announcements.ptBr.description"),t[9]=e,t[10]=v):v=t[10];let P;t[11]!==v?(P=n.jsx(xn,{children:v}),t[11]=v,t[12]=P):P=t[12];let _;t[13]!==T||t[14]!==P?(_=n.jsxs(Mt,{children:[T,P]}),t[13]=T,t[14]=P,t[15]=_):_=t[15];let I;t[16]!==e?(I=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=I):I=t[17];let A;t[18]!==b||t[19]!==I?(A=n.jsx(F,{variant:"outline",onClick:b,children:I}),t[18]=b,t[19]=I,t[20]=A):A=t[20];let E;t[21]===Symbol.for("react.memo_cache_sentinel")?(E=()=>j("ok"),t[21]=E):E=t[21];let $;t[22]!==e?($=e("announcements.ptBr.ok"),t[22]=e,t[23]=$):$=t[23];let L;t[24]!==$?(L=n.jsx(F,{onClick:E,children:$}),t[24]=$,t[25]=L):L=t[25];let O;t[26]!==A||t[27]!==L?(O=n.jsxs(wn,{children:[A,L]}),t[26]=A,t[27]=L,t[28]=O):O=t[28];let K;t[29]!==O||t[30]!==_?(K=n.jsxs(Ht,{className:"sm:max-w-md",children:[x,_,O]}),t[29]=O,t[30]=_,t[31]=K):K=t[31];let H;return t[32]!==y||t[33]!==K?(H=n.jsx(Ut,{open:y,onOpenChange:S,children:K}),t[32]=y,t[33]=K,t[34]=H):H=t[34],H}function Ko(t){return{...t,language:"en"}}function Mo(t){return{...t,language:"pt-BR"}}function qo(t){const e=Sn(t);return typeof e=="string"?e:void 0}function Ho(){return qo("experiment-pipeline-check"),null}function Uo(t){const e=R.c(1),{activeOrg:o}=t;if(!o)return null;jn(o.id,{name:o.name??void 0,slug:o.slug??void 0}),vn();let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ho,{}),e[0]=a):a=e[0],a}function Jo(t){const{prev:e,virtualMcpId:o,decopilotId:a,savedLayout:s,opts:r,autosendValue:i}=t,c={mainpanel:void 0};o?c.virtualmcpid=o:e.virtualmcpid&&(c.virtualmcpid=e.virtualmcpid);const f=typeof e.virtualmcpid=="string"?e.virtualmcpid:a,h=(o??f)!==f;let d,u;return r?.panel?u=r.panel:r?.newThread&&!h&&kn(e.tabId)?(u=e.tabId,c.mainpanel=e.mainpanel,d=e.sidepanel):s?(u=s.tab,s.sidepanel!==void 0&&(d=s.sidepanel),s.mainpanel!==void 0&&(c.mainpanel=s.mainpanel)):!h&&e.tabId&&!Tn(e.tabId)&&(u=e.tabId),d!==void 0&&(c.sidepanel=d),r?.autosend&&(c.autosend=i),{tabId:ks(u,t.target,t.blogView),search:c}}const on="studio:thread-layout:v4",Vo=50;function an(t){const e={};return t===null||typeof t!="object"||(typeof t.tab=="string"&&(e.tab=t.tab),typeof t.mainpanel=="boolean"&&(e.mainpanel=t.mainpanel),typeof t.sidepanel=="boolean"&&(e.sidepanel=t.sidepanel)),e}function Go(t,e,o,a=Vo){const s=t.filter(([r])=>r!==e);for(s.push([e,an(o)]);s.length>a;)s.shift();return s}function vt(){try{const t=sessionStorage.getItem(on);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(o=>Array.isArray(o)&&o.length===2&&typeof o[0]=="string"):[]}catch{return[]}}function rn(t){try{sessionStorage.setItem(on,JSON.stringify(t))}catch{}}function Wo(t,e){t&&rn(Go(vt(),t,e))}function Yo(t){if(!t)return null;const e=vt().find(([o])=>o===t);return e?an(e[1]):null}function Ki(t){if(!t)return;const e=vt(),o=e.filter(([a])=>a!==t);o.length!==e.length&&rn(o)}function ln(t){return{queryKey:ht.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function Mi(t){const e=R.c(10);let o;e[0]!==t?(o=ln(t),e[0]=t,e[1]=o):o=e[1];const a=et(o);let s;e[2]!==a.data?.prompts?(s=a.data?.prompts??[],e[2]=a.data?.prompts,e[3]=s):s=e[3];let r;e[4]!==a.data?.tiles?(r=a.data?.tiles??[],e[4]=a.data?.tiles,e[5]=r):r=e[5];let i;return e[6]!==a.isLoading||e[7]!==s||e[8]!==r?(i={isLoading:a.isLoading,prompts:s,tiles:r},e[6]=a.isLoading,e[7]=s,e[8]=r,e[9]=i):i=e[9],i}function Qo(t){const e=R.c(31),{orgSlug:o,orgName:a,domain:s}=t,r=Q();let i;e[0]!==o?(i=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},e[0]=o,e[1]=i):i=e[1];const c=i,f=Xo;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:n.jsx(zt,{className:"h-6 w-6 text-primary"})}),e[2]=g):g=e[2];let h;e[3]!==r?(h=r("common.ssoRequiredScreen.title"),e[3]=r,e[4]=h):h=e[4];let d;e[5]!==h?(d=n.jsx("h3",{className:"text-lg font-medium",children:h}),e[5]=h,e[6]=d):d=e[6];let u;e[7]!==s||e[8]!==a||e[9]!==r?(u=a?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:a})," ",r("common.ssoRequiredScreen.requiresSsoAuth"),s?` ${r("common.ssoRequiredScreen.via",{domain:s})}`:"","."]}):r("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=s,e[8]=a,e[9]=r,e[10]=u):u=e[10];let l;e[11]!==u?(l=n.jsx("p",{className:"text-sm text-muted-foreground",children:u}),e[11]=u,e[12]=l):l=e[12];let y;e[13]!==d||e[14]!==l?(y=n.jsxs("div",{className:"space-y-2",children:[d,l]}),e[13]=d,e[14]=l,e[15]=y):y=e[15];let m;e[16]!==r?(m=r("common.ssoRequiredScreen.signInWithSso"),e[16]=r,e[17]=m):m=e[17];let w;e[18]!==c||e[19]!==m?(w=n.jsx(F,{onClick:c,children:m}),e[18]=c,e[19]=m,e[20]=w):w=e[20];let j;e[21]!==r?(j=r("common.goBack"),e[21]=r,e[22]=j):j=e[22];let p;e[23]!==j?(p=n.jsx(F,{variant:"ghost",onClick:f,children:j}),e[23]=j,e[24]=p):p=e[24];let b;e[25]!==p||e[26]!==w?(b=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[w,p]}),e[25]=p,e[26]=w,e[27]=b):b=e[27];let S;return e[28]!==b||e[29]!==y?(S=n.jsxs(pe,{children:[g,y,b]}),e[28]=b,e[29]=y,e[30]=S):S=e[30],S}function Xo(){window.location.href="/"}function Zo(t){const e=R.c(27),{notice:o,orgSlug:a}=t,s=Q();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:n.jsx(Nn,{className:"h-6 w-6 text-destructive"})}),e[0]=r):r=e[0];let i;e[1]!==o.title?(i=n.jsx("h3",{className:"text-lg font-medium",children:o.title}),e[1]=o.title,e[2]=i):i=e[2];let c;e[3]!==o.message?(c=n.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:o.message}),e[3]=o.message,e[4]=c):c=e[4];let f;e[5]!==i||e[6]!==c?(f=n.jsxs("div",{className:"space-y-2",children:[i,c]}),e[5]=i,e[6]=c,e[7]=f):f=e[7];let g;e[8]!==o.ctaLabel||e[9]!==o.ctaUrl?(g=o.ctaUrl&&o.ctaLabel?n.jsx(F,{asChild:!0,children:n.jsx("a",{href:o.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:o.ctaLabel})}):null,e[8]=o.ctaLabel,e[9]=o.ctaUrl,e[10]=g):g=e[10];const h=`/${encodeURIComponent(a)}/settings/infra-billing`;let d;e[11]!==s?(d=s("common.blockedOrgScreen.goToBilling"),e[11]=s,e[12]=d):d=e[12];let u;e[13]!==h||e[14]!==d?(u=n.jsx(F,{variant:"outline",asChild:!0,children:n.jsx("a",{href:h,children:d})}),e[13]=h,e[14]=d,e[15]=u):u=e[15];let l;e[16]!==s?(l=s("common.blockedOrgScreen.switchOrg"),e[16]=s,e[17]=l):l=e[17];let y;e[18]!==l?(y=n.jsx(F,{variant:"ghost",asChild:!0,children:n.jsx("a",{href:"/",children:l})}),e[18]=l,e[19]=y):y=e[19];let m;e[20]!==y||e[21]!==g||e[22]!==u?(m=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[g,u,y]}),e[20]=y,e[21]=g,e[22]=u,e[23]=m):m=e[23];let w;return e[24]!==m||e[25]!==f?(w=n.jsxs(pe,{children:[r,f,m]}),e[24]=m,e[25]=f,e[26]=w):w=e[26],w}const ei="/settings/infra-billing";function ti(t){return(t.endsWith("/")?t.slice(0,-1):t).endsWith(ei)}function ni(t){const e=R.c(7),{org:o,children:a}=t;let s;e[0]!==o.id||e[1]!==o.name?(s={id:o.id,organizationId:o.id,slug:"_org",name:o.name,ui:null},e[0]=o.id,e[1]=o.name,e[2]=s):s=e[2];const r=s;let i;return e[3]!==a||e[4]!==o||e[5]!==r?(i=n.jsx($n,{org:o,project:r,children:a}),e[3]=a,e[4]=o,e[5]=r,e[6]=i):i=e[6],i}function si(){const t=Jt(),e=As(),{org:o}=jt(),a=Pn({strict:!1}),s=Xt(),{openPanel:r,closePanel:i}=rs(),c=Ps(),f=_s(),g=Is(),h=Os(),d=Ts(),u=Es(),{data:l}=fe.useSession(),y=(p,b=!0)=>t({to:".",search:p,replace:b}),m=()=>y(p=>({...p,sidepanel:!0})),w=(p,b,S)=>{const x=!!f&&f===p;f&&!x&&Wo(f,{tab:s,mainpanel:a.mainpanel,sidepanel:a.sidepanel});const k=x?null:Yo(p),T=Gt(o.id).id;if(b===T&&!S?.panel)return h(p,()=>S?.autosend?{autosend:At}:{});const v=Jo({prev:{virtualmcpid:c,tabId:s,mainpanel:a.mainpanel,sidepanel:a.sidepanel},virtualMcpId:b,decopilotId:T,savedLayout:k,opts:S,autosendValue:At,target:e?.threads.get().find(P=>P.id===p),blogView:u});return h(p,()=>v.search,{virtualMcpId:b,view:{tabId:v.tabId}})};return{openSidePanel:m,setTaskId:w,createNewTask:async(p,b,S)=>{const x=crypto.randomUUID(),k=p??g,T=d==="blog"&&k===g&&!S?.panel?Ns(b,Cs(l?.user)):null;try{await e?.create({id:x,virtual_mcp_id:k,...T??(b?{branch:b}:{})})}catch{}w(x,k,{...S,newThread:!0})},openTab:r,closeTab:i}}const oi=new Set(["/$org/","/$org/home"]);function ii(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:ai},t[0]=e):e=t[0],Wt(e)}function ai(t){const e=t.matches.at(-1)?.fullPath;return e!==void 0&&oi.has(e)}function ri(){const t=R.c(54);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const a=_n(e)?.params.org,[s,r]=X.useState(!1),[i,c]=ts(),[f,g]=ws(),h=In(),d=ii(),u=a??"";let l;t[1]!==u?(l=ln(u),t[1]=u,t[2]=l):l=t[2];const y=!!a&&d;let m;t[3]!==l||t[4]!==y?(m={...l,enabled:y},t[3]=l,t[4]=y,t[5]=m):m=t[5],et(m);const{data:w}=fe.useSession(),j=w?.user?.id;let p,b;t[6]!==h?(p=()=>{const C=M=>{if(Pt(M)&&M.code==="KeyK"){M.preventDefault(),os();return}if(M.key==="?"&&!En(M.target)){M.preventDefault(),r(!0);return}Pt(M)&&M.code==="BracketLeft"&&h.history.canGoBack()&&(M.preventDefault(),h.history.back())};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},b=[h],t[6]=h,t[7]=p,t[8]=b):(p=t[7],b=t[8]),X.useEffect(p,b);let S;t[9]!==a||t[10]!==j?(S=On(a,j),t[9]=a,t[10]=j,t[11]=S):S=t[11];const{data:x}=Ft(S),k=x?.id,T=x?.slug,{data:v}=$s(k,T),P=!!v?.ssoRequired&&!v.authenticated,{data:_}=ns(T);let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={select:li},t[12]=I):I=t[12];const A=Wt(I),E=_?.severity==="block"&&!ti(A),$=k??"",L=T??"";let O;t[13]!==L||t[14]!==$?(O=bs({connectionId:Vt,orgId:$,orgSlug:L}),t[13]=L,t[14]=$,t[15]=O):O=t[15];const K=!!k&&!!T;let H;if(t[16]!==O||t[17]!==K?(H={...O,enabled:K},t[16]=O,t[17]=K,t[18]=H):H=t[18],et(H),(!x||Nt(x)||P||E)&&ss(),!x){let C;return t[19]!==a?(C=n.jsx(Js,{orgSlug:a}),t[19]=a,t[20]=C):C=t[20],C}if(Nt(x)){localStorage.getItem(Ze.lastOrgSlug())===a&&localStorage.removeItem(Ze.lastOrgSlug()),Bt()?.org===a&&Kt();let C;return t[21]!==x.name?(C=n.jsx(An,{orgName:x.name}),t[21]=x.name,t[22]=C):C=t[22],C}if(E&&_){let C;return t[23]!==x.slug||t[24]!==_?(C=n.jsx(Zo,{notice:_,orgSlug:x.slug}),t[23]=x.slug,t[24]=_,t[25]=C):C=t[25],C}if(P){let C;return t[26]!==x.id||t[27]!==x.name||t[28]!==x.slug||t[29]!==v.domain?(C=n.jsx(Qo,{orgId:x.id,orgSlug:x.slug,orgName:x.name,domain:v.domain}),t[26]=x.id,t[27]=x.name,t[28]=x.slug,t[29]=v.domain,t[30]=C):C=t[30],C}const ae=x.logo??null;let Z;t[31]!==x||t[32]!==ae?(Z={...x,logo:ae},t[31]=x,t[32]=ae,t[33]=Z):Z=t[33];let ee;t[34]!==x?(ee=n.jsx(Uo,{activeOrg:x}),t[34]=x,t[35]=ee):ee=t[35];let ne;t[36]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(Cn,{}),t[36]=ne):ne=t[36];let te;t[37]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[n.jsx(po,{}),n.jsx(Lo,{})]}),t[37]=te):te=t[37];let J;t[38]!==i||t[39]!==c?(J=i&&n.jsx(To,{open:i,onOpenChange:c}),t[38]=i,t[39]=c,t[40]=J):J=t[40];let V;t[41]!==f||t[42]!==g?(V=f&&n.jsx(xs,{open:!0,onOpenChange:g,source:Ss()}),t[41]=f,t[42]=g,t[43]=V):V=t[43];let q;t[44]!==s?(q=n.jsx(bo,{open:s,onOpenChange:r}),t[44]=s,t[45]=q):q=t[45];let G,W;t[46]===Symbol.for("react.memo_cache_sentinel")?(G=n.jsx(Bo,{}),W=n.jsx(js,{}),t[46]=G,t[47]=W):(G=t[46],W=t[47]);let Y;return t[48]!==Z||t[49]!==ee||t[50]!==J||t[51]!==V||t[52]!==q?(Y=n.jsxs(ni,{org:Z,children:[ee,ne,te,J,V,q,G,W]}),t[48]=Z,t[49]=ee,t[50]=J,t[51]=V,t[52]=q,t[53]=Y):Y=t[53],Y}function li(t){return t.location.pathname}function ci(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(vs,{children:n.jsx(ri,{})}),t[0]=e):e=t[0],e}const qi=Object.freeze(Object.defineProperty({__proto__:null,default:ci,usePanelActions:si},Symbol.toStringTag,{value:"Module"}));export{lo as a,Mi as b,Ki as f,qi as s,si as u};