try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`4ba872d3-9196-4b6c-9d14-ebfde3a39f04`,e._sentryDebugIdIdentifier=`sentry-dbid-4ba872d3-9196-4b6c-9d14-ebfde3a39f04`)}catch{}import"./rolldown-runtime-nx40z1zs.js";import{Ag as e,Yh as t,Zm as n,_r as r,ng as i,op as a}from"./entry.client-mpghtlrl.js";import{t as o}from"./xds-icons-m106f2fc.js";import{n as s,r as c}from"./useWidget-nf2epnjz.js";import{t as l}from"./useWidgetNavigation-os2rjdn1.js";import{t as u}from"./WidgetInteractable-mzv6xcil.js";import{c as d}from"./data-k1o1noin.js";var f=e(),p=i(),m=({gradient:e,icon:t,name:n,description:r})=>(0,p.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br text-xl ${e}`,children:t}),(0,p.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,p.jsx)(`span`,{className:`truncate font-semibold text-white type-body`,children:n}),r&&(0,p.jsx)(`span`,{className:`truncate text-white/60 type-caption`,children:r})]})]}),h=e=>{let t=(0,f.c)(7),{navigate:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={title:`Apps`,icon:(0,p.jsx)(o,{})},t[0]=i):i=t[0],r=i,c(r);let a;t[1]===n?a=t[2]:(a={getNavigateParams:v,getHeader:y,navigate:n},t[1]=n,t[2]=a);let{isReady:h,getItemProps:g}=l(a),{visibility:_}=s();if(!h||_===`hidden`)return null;let b;t[3]===g?b=t[4]:(b=d.map(e=>(0,p.jsx)(u,{className:`group flex cursor-pointer items-center gap-3 rounded p-3 text-start hover:bg-white/10`,...g(e),children:(0,p.jsx)(m,{gradient:e.gradient,icon:e.icon,name:e.name,description:e.description})},e.appId)),t[3]=g,t[4]=b);let x;return t[5]===b?x=t[6]:(x=(0,p.jsx)(`div`,{className:`flex h-full w-full flex-col gap-2 p-2`,children:b}),t[5]=b,t[6]=x),x},g=r(h,()=>{let{router:e}=n(),{mutate:r}=t(e.mutations.navigate.getOptions());return{navigate:r}}),_=()=>{let e=(0,f.c)(2),t=g.useComponent(),n;return e[0]===t?n=e[1]:(n=(0,p.jsx)(t,{}),e[0]=t,e[1]=n),n};function v(e,t){return{key:t,to:a.widget.apps.byId.id,params:{appId:e.appId}}}function y(e){return{title:e.name}}export{_ as Apps,g as AppsConnection,h as PureApps};