@nextclaw/ui 0.22.5 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/assets/{api-aEu9cEI8.js → api-n96IfCKb.js} +2 -2
  3. package/dist/assets/{appearance-settings-page-z4DaHc_E.js → appearance-settings-page-C_AqxSF_.js} +1 -1
  4. package/dist/assets/{channels-list-page-x07sGqsT.js → channels-list-page-uR-M4Ls8.js} +1 -1
  5. package/dist/assets/{confirm-dialog-BALTnP33.js → confirm-dialog-CHVBMpla.js} +1 -1
  6. package/dist/assets/{desktop-capabilities-page-4-v3wKLV.js → desktop-capabilities-page-phMuNq1B.js} +1 -1
  7. package/dist/assets/{desktop-update-config-Cl-_XHqU.js → desktop-update-config-C77hkbor.js} +1 -1
  8. package/dist/assets/{extensions-DFQXmSwG.js → extensions-CQKXTqTI.js} +1 -1
  9. package/dist/assets/{index-zuqzAvNx.js → index-CLw9DuCJ.js} +4 -4
  10. package/dist/assets/mcp-marketplace-page-CbWOamyW.js +1 -0
  11. package/dist/assets/{mcp-marketplace-page-COUopIOc.js → mcp-marketplace-page-s9PTnSDT.js} +1 -1
  12. package/dist/assets/{model-config-page-g9_-hZqZ.js → model-config-page-CxnCUWRW.js} +1 -1
  13. package/dist/assets/{privacy-settings-page-pNhQQT4r.js → privacy-settings-page-D8HZHHjL.js} +1 -1
  14. package/dist/assets/{providers-config-page-DftW_6KU.js → providers-config-page-C0GIoGxm.js} +1 -1
  15. package/dist/assets/remote-DvTCSAxQ.js +1 -0
  16. package/dist/assets/{runtime-config-page-Cd9sOYvn.js → runtime-config-page-VNJZui5f.js} +1 -1
  17. package/dist/assets/{search-config-page-BqoDbKpM.js → search-config-page-D3_qNXbB.js} +1 -1
  18. package/dist/assets/{secrets-config-page-GsahsEVw.js → secrets-config-page-Be4P1E8o.js} +1 -1
  19. package/dist/assets/security-config-BtcpKIhQ.js +1 -0
  20. package/dist/assets/{tag-chip-ClBWeQ4p.js → tag-chip-Dc_NcCEe.js} +1 -1
  21. package/dist/index.html +5 -5
  22. package/package.json +2 -2
  23. package/src/features/panel-apps/managers/__tests__/panel-app-bridge.manager.test.ts +51 -0
  24. package/src/features/panel-apps/managers/panel-app-bridge.manager.ts +37 -2
  25. package/dist/assets/mcp-marketplace-page-DxPPmYqh.js +0 -1
  26. package/dist/assets/remote-DS2TkMPm.js +0 -1
  27. package/dist/assets/security-config-BnHQyrtG.js +0 -1
@@ -1 +1 @@
1
- import{B as e,a as t}from"./react-CVFx225w.js";import{an as n,fn as r,in as i,on as a,sn as o}from"./api-aEu9cEI8.js";import{a as s,i as c,o as l,r as u,s as d}from"./index-zuqzAvNx.js";var f=e();function p(){let e=c(),p=u(),h=l(),v=s(),y=d(),b=e.data,x=h.isPending||v.isPending;return(0,f.jsxs)(o,{title:t(`desktopCapabilitiesPageTitle`),description:t(`desktopCapabilitiesPageDescription`),children:[(0,f.jsx)(a,{title:t(`desktopCapabilitiesSystemTitle`),description:t(`desktopCapabilitiesSystemDescription`),children:(0,f.jsxs)(n,{children:[(0,f.jsx)(i,{title:t(`desktopCapabilitiesHostStatus`),description:e.isLoading?t(`loading`):b?.online?t(`desktopCapabilitiesHostOnline`):t(`desktopCapabilitiesHostOffline`),control:(0,f.jsx)(r,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:t(`desktopCapabilitiesRecheck`)})}),(0,f.jsx)(i,{title:t(`desktopCapabilitiesAccessibility`),description:g(b?.permissions.accessibility),control:(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,f.jsx)(r,{type:`button`,variant:`outline`,size:`sm`,disabled:x,onClick:()=>v.mutate(),children:t(`desktopCapabilitiesOpenSettings`)}),(0,f.jsx)(r,{type:`button`,size:`sm`,disabled:x,onClick:()=>h.mutate(),children:t(`desktopCapabilitiesRequestPermission`)})]})})]})}),(0,f.jsx)(a,{title:t(`desktopCapabilitiesGrantsTitle`),description:t(`desktopCapabilitiesGrantsDescription`),children:(0,f.jsx)(n,{children:p.isLoading?(0,f.jsx)(i,{title:t(`loading`)}):p.data?.length?p.data.map(e=>(0,f.jsx)(m,{grant:e,disabled:y.isPending,onRevoke:()=>y.mutate(e)},_(e))):(0,f.jsx)(i,{title:t(`desktopCapabilitiesNoGrants`),description:t(`desktopCapabilitiesNoGrantsDescription`)})})})]})}function m({disabled:e,grant:n,onRevoke:a}){let o=h(n.resource.target);return(0,f.jsx)(i,{title:n.subject.type===`agent`?`${t(`desktopCapabilitiesAgent`)} · ${n.subject.id}`:`${t(`desktopCapabilitiesExtension`)} · ${n.subject.id}`,description:`${o} · ${n.access.join(`, `)}`,control:(0,f.jsx)(r,{type:`button`,variant:`destructive`,size:`sm`,disabled:e,onClick:a,children:t(`desktopCapabilitiesRevoke`)})})}function h(e){if(!e||typeof e!=`object`||Array.isArray(e))return t(`desktopCapabilitiesUnknownApplication`);let{applicationId:n}=e;return typeof n==`string`&&n.trim()?n.trim():t(`desktopCapabilitiesUnknownApplication`)}function g(e){switch(e){case`granted`:return t(`desktopCapabilitiesPermissionGranted`);case`not_granted`:return t(`desktopCapabilitiesPermissionNotGranted`);case`not_supported`:return t(`desktopCapabilitiesPermissionNotSupported`);default:return t(`desktopCapabilitiesPermissionUnknown`)}}function _(e){return`${e.subject.type}:${e.subject.id}:${JSON.stringify(e.resource.target)}:${e.access.join(`,`)}`}export{p as DesktopCapabilitiesPage};
1
+ import{B as e,a as t}from"./react-CVFx225w.js";import{an as n,fn as r,in as i,on as a,sn as o}from"./api-n96IfCKb.js";import{a as s,i as c,o as l,r as u,s as d}from"./index-CLw9DuCJ.js";var f=e();function p(){let e=c(),p=u(),h=l(),v=s(),y=d(),b=e.data,x=h.isPending||v.isPending;return(0,f.jsxs)(o,{title:t(`desktopCapabilitiesPageTitle`),description:t(`desktopCapabilitiesPageDescription`),children:[(0,f.jsx)(a,{title:t(`desktopCapabilitiesSystemTitle`),description:t(`desktopCapabilitiesSystemDescription`),children:(0,f.jsxs)(n,{children:[(0,f.jsx)(i,{title:t(`desktopCapabilitiesHostStatus`),description:e.isLoading?t(`loading`):b?.online?t(`desktopCapabilitiesHostOnline`):t(`desktopCapabilitiesHostOffline`),control:(0,f.jsx)(r,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:t(`desktopCapabilitiesRecheck`)})}),(0,f.jsx)(i,{title:t(`desktopCapabilitiesAccessibility`),description:g(b?.permissions.accessibility),control:(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,f.jsx)(r,{type:`button`,variant:`outline`,size:`sm`,disabled:x,onClick:()=>v.mutate(),children:t(`desktopCapabilitiesOpenSettings`)}),(0,f.jsx)(r,{type:`button`,size:`sm`,disabled:x,onClick:()=>h.mutate(),children:t(`desktopCapabilitiesRequestPermission`)})]})})]})}),(0,f.jsx)(a,{title:t(`desktopCapabilitiesGrantsTitle`),description:t(`desktopCapabilitiesGrantsDescription`),children:(0,f.jsx)(n,{children:p.isLoading?(0,f.jsx)(i,{title:t(`loading`)}):p.data?.length?p.data.map(e=>(0,f.jsx)(m,{grant:e,disabled:y.isPending,onRevoke:()=>y.mutate(e)},_(e))):(0,f.jsx)(i,{title:t(`desktopCapabilitiesNoGrants`),description:t(`desktopCapabilitiesNoGrantsDescription`)})})})]})}function m({disabled:e,grant:n,onRevoke:a}){let o=h(n.resource.target);return(0,f.jsx)(i,{title:n.subject.type===`agent`?`${t(`desktopCapabilitiesAgent`)} · ${n.subject.id}`:`${t(`desktopCapabilitiesExtension`)} · ${n.subject.id}`,description:`${o} · ${n.access.join(`, `)}`,control:(0,f.jsx)(r,{type:`button`,variant:`destructive`,size:`sm`,disabled:e,onClick:a,children:t(`desktopCapabilitiesRevoke`)})})}function h(e){if(!e||typeof e!=`object`||Array.isArray(e))return t(`desktopCapabilitiesUnknownApplication`);let{applicationId:n}=e;return typeof n==`string`&&n.trim()?n.trim():t(`desktopCapabilitiesUnknownApplication`)}function g(e){switch(e){case`granted`:return t(`desktopCapabilitiesPermissionGranted`);case`not_granted`:return t(`desktopCapabilitiesPermissionNotGranted`);case`not_supported`:return t(`desktopCapabilitiesPermissionNotSupported`);default:return t(`desktopCapabilitiesPermissionUnknown`)}}function _(e){return`${e.subject.type}:${e.subject.id}:${JSON.stringify(e.resource.target)}:${e.access.join(`,`)}`}export{p as DesktopCapabilitiesPage};
@@ -1 +1 @@
1
- import{B as e,L as t,a as n,r,s as i}from"./react-CVFx225w.js";import{t as a}from"./navigation-link-Ci4Z7Phi.js";import{Gt as o,Jt as s,Kt as c,Wt as l,Yt as u,an as d,fn as f,in as p,on as m,sn as h,yn as g}from"./api-aEu9cEI8.js";import{a as _,i as v,n as y,r as b,t as x}from"./select-DPKCWajZ.js";import{t as S}from"./refresh-cw-C-3_thgr.js";import{t as C}from"./rotate-cw-DSFTq_yu.js";import{$ as w,Q as T,et as E,nt as D,tt as O}from"./index-zuqzAvNx.js";var k=e(),A={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,applying:`desktopUpdatesStatusApplying`,"restart-required":`desktopUpdatesStatusRestartRequired`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},j={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function M({snapshot:e}){return(0,k.jsx)(`span`,{className:t(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,V(e.status)),children:B(e)})}function N({label:e,value:t}){return(0,k.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,k.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function P({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,r=t==null?n(`desktopUpdatesDownloadProgressUnknown`):n(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),i=L(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,k.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r}),(0,k.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,k.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,k.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function F(e){return e?.trim()||`-`}function I(e){return e?r(e):`-`}function L(e,t){let n=R(e);return t&&t>0?`${n} / ${R(t)}`:n}function R(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function z(e){return n(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function B(e){return e.status===`failed`&&e.failureStage?n(`desktopUpdatesFailureStage.${e.failureStage}`):n(A[e.status]??`desktopUpdatesStatusIdle`)}function V(e){return e===`downloaded`||e===`restart-required`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function H(){return i()===`zh`?`zh-CN`:`en-US`}function U(e,t){return o(e.title,t)??n(j[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function W({snapshot:e}){let t=c(e),r=H(),i=g({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await l(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),s=i.data,u=o(s?.title,r)??n(`desktopUpdatesReleaseNotesPreviewTitle`),d=o(s?.summary,r)??n(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,k.jsxs)(T,{children:[(0,k.jsx)(O,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(D,{children:u}),(0,k.jsx)(E,{children:d})]}),(0,k.jsx)(a,{href:e.releaseNotesUrl,external:!0,children:n(`desktopUpdatesReleaseNotes`)})]})}),(0,k.jsxs)(w,{className:`space-y-4`,children:[i.isLoading?(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||i.isError?(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,s?(0,k.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:s.sections.map(e=>(0,k.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:U(e,r)}),(0,k.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,n)=>{let i=o(t.title,r),a=o(t.body,r);return(0,k.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,k.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,k.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${n}`)})})]},e.kind))}):null]})]}):null}function G(){return(0,k.jsx)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),children:(0,k.jsx)(m,{title:n(`runtimeUpdatesUnavailableTitle`),description:n(`runtimeUpdatesUnavailableDescription`),children:(0,k.jsx)(d,{children:(0,k.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:n(`runtimeUpdatesUnavailableHint`)})})})})}function K(){let{supported:e,initialized:r,busyAction:i,snapshot:a}=u();if(!r)return(0,k.jsx)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),children:(0,k.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:n(`loading`)})});if(!e||!a)return(0,k.jsx)(G,{});let o=i===`checking`,c=i===`downloading`,l=i===`applying`,g=i===`updating`,w=i===`switching-channel`,T=(a.status===`update-available`||a.status===`downloaded`)&&!c&&!l&&!g,E=[[n(`runtimeUpdatesHostVersion`),F(a.hostVersion)],[n(`desktopUpdatesCurrentBundleVersion`),F(a.currentVersion)],[n(`desktopUpdatesAvailableVersion`),F(a.availableVersion)],[n(`desktopUpdatesLastCheckedAt`),I(a.lastCheckedAt)],[n(`desktopUpdatesCurrentChannel`),z(a.channel)]];return(0,k.jsxs)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),actions:(0,k.jsxs)(f,{variant:`outline`,onClick:()=>void s.checkForUpdates(),disabled:o||c||l||g,children:[(0,k.jsx)(S,{className:t(`mr-2 h-4 w-4`,o&&`animate-spin`)}),n(`desktopUpdatesCheckNow`)]}),children:[(0,k.jsx)(m,{title:n(`desktopUpdatesOverviewTitle`),description:n(`desktopUpdatesOverviewDescription`),children:(0,k.jsx)(d,{children:(0,k.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n(`desktopUpdatesStatusLabel`)}),(0,k.jsx)(M,{snapshot:a})]}),(0,k.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:E.map(([e,t])=>(0,k.jsx)(N,{label:e,value:t},e))}),a.channel===`beta`?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n(`desktopUpdatesBetaBadgeTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:n(`desktopUpdatesBetaBadgeDescription`)})]}):null,a.downloadedVersion?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:n(`desktopUpdatesDownloadedBannerTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:n(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,a.downloadedVersion)})]}):null,(0,k.jsx)(P,{snapshot:a}),a.status===`blocked`?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:n(`desktopUpdatesBlockedTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:a.errorMessage??n(`desktopUpdatesBlockedDescription`)}),a.recoveryCommand?(0,k.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:a.recoveryCommand}):null]}):null,a.errorMessage&&a.status!==`blocked`?(0,k.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:a.errorMessage}):null]})})}),(0,k.jsx)(W,{snapshot:a}),(0,k.jsx)(m,{title:n(`desktopUpdatesChannelSettingsTitle`),description:n(`desktopUpdatesChannelSettingsDescription`),children:(0,k.jsx)(d,{children:(0,k.jsx)(p,{title:n(`desktopUpdatesReleaseChannel`),description:n(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsxs)(x,{value:a.channel,disabled:w||o||c||l||g,onValueChange:e=>void s.updateChannel(e),children:[(0,k.jsx)(v,{className:`w-full max-w-sm`,children:(0,k.jsx)(_,{placeholder:n(`desktopUpdatesReleaseChannel`)})}),(0,k.jsxs)(y,{children:[(0,k.jsx)(b,{value:`stable`,children:n(`desktopUpdatesChannelStable`)}),(0,k.jsx)(b,{value:`beta`,children:n(`desktopUpdatesChannelBeta`)})]})]}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,k.jsx)(m,{title:n(`desktopUpdatesActionsTitle`),description:n(`runtimeUpdatesActionsDescription`),children:(0,k.jsx)(d,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,k.jsxs)(f,{variant:`outline`,onClick:()=>void s.checkForUpdates(),disabled:o||c||l||g,children:[(0,k.jsx)(S,{className:t(`mr-2 h-4 w-4`,o&&`animate-spin`)}),n(`desktopUpdatesCheckNow`)]}),(0,k.jsxs)(f,{onClick:()=>void s.updateNow(),disabled:!T,children:[(0,k.jsx)(C,{className:t(`mr-2 h-4 w-4`,g&&`animate-spin`)}),n(`runtimeUpdatesApplyNow`)]})]})})})]})}export{K as DesktopUpdateConfig};
1
+ import{B as e,L as t,a as n,r,s as i}from"./react-CVFx225w.js";import{t as a}from"./navigation-link-Ci4Z7Phi.js";import{Gt as o,Jt as s,Kt as c,Wt as l,Yt as u,an as d,fn as f,in as p,on as m,sn as h,yn as g}from"./api-n96IfCKb.js";import{a as _,i as v,n as y,r as b,t as x}from"./select-DPKCWajZ.js";import{t as S}from"./refresh-cw-C-3_thgr.js";import{t as C}from"./rotate-cw-DSFTq_yu.js";import{$ as w,Q as T,et as E,nt as D,tt as O}from"./index-CLw9DuCJ.js";var k=e(),A={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,applying:`desktopUpdatesStatusApplying`,"restart-required":`desktopUpdatesStatusRestartRequired`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},j={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function M({snapshot:e}){return(0,k.jsx)(`span`,{className:t(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,V(e.status)),children:B(e)})}function N({label:e,value:t}){return(0,k.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,k.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function P({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,r=t==null?n(`desktopUpdatesDownloadProgressUnknown`):n(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),i=L(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,k.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r}),(0,k.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,k.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,k.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function F(e){return e?.trim()||`-`}function I(e){return e?r(e):`-`}function L(e,t){let n=R(e);return t&&t>0?`${n} / ${R(t)}`:n}function R(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function z(e){return n(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function B(e){return e.status===`failed`&&e.failureStage?n(`desktopUpdatesFailureStage.${e.failureStage}`):n(A[e.status]??`desktopUpdatesStatusIdle`)}function V(e){return e===`downloaded`||e===`restart-required`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function H(){return i()===`zh`?`zh-CN`:`en-US`}function U(e,t){return o(e.title,t)??n(j[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function W({snapshot:e}){let t=c(e),r=H(),i=g({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await l(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),s=i.data,u=o(s?.title,r)??n(`desktopUpdatesReleaseNotesPreviewTitle`),d=o(s?.summary,r)??n(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,k.jsxs)(T,{children:[(0,k.jsx)(O,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(D,{children:u}),(0,k.jsx)(E,{children:d})]}),(0,k.jsx)(a,{href:e.releaseNotesUrl,external:!0,children:n(`desktopUpdatesReleaseNotes`)})]})}),(0,k.jsxs)(w,{className:`space-y-4`,children:[i.isLoading?(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||i.isError?(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,s?(0,k.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:s.sections.map(e=>(0,k.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:U(e,r)}),(0,k.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,n)=>{let i=o(t.title,r),a=o(t.body,r);return(0,k.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,k.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,k.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${n}`)})})]},e.kind))}):null]})]}):null}function G(){return(0,k.jsx)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),children:(0,k.jsx)(m,{title:n(`runtimeUpdatesUnavailableTitle`),description:n(`runtimeUpdatesUnavailableDescription`),children:(0,k.jsx)(d,{children:(0,k.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:n(`runtimeUpdatesUnavailableHint`)})})})})}function K(){let{supported:e,initialized:r,busyAction:i,snapshot:a}=u();if(!r)return(0,k.jsx)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),children:(0,k.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:n(`loading`)})});if(!e||!a)return(0,k.jsx)(G,{});let o=i===`checking`,c=i===`downloading`,l=i===`applying`,g=i===`updating`,w=i===`switching-channel`,T=(a.status===`update-available`||a.status===`downloaded`)&&!c&&!l&&!g,E=[[n(`runtimeUpdatesHostVersion`),F(a.hostVersion)],[n(`desktopUpdatesCurrentBundleVersion`),F(a.currentVersion)],[n(`desktopUpdatesAvailableVersion`),F(a.availableVersion)],[n(`desktopUpdatesLastCheckedAt`),I(a.lastCheckedAt)],[n(`desktopUpdatesCurrentChannel`),z(a.channel)]];return(0,k.jsxs)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),actions:(0,k.jsxs)(f,{variant:`outline`,onClick:()=>void s.checkForUpdates(),disabled:o||c||l||g,children:[(0,k.jsx)(S,{className:t(`mr-2 h-4 w-4`,o&&`animate-spin`)}),n(`desktopUpdatesCheckNow`)]}),children:[(0,k.jsx)(m,{title:n(`desktopUpdatesOverviewTitle`),description:n(`desktopUpdatesOverviewDescription`),children:(0,k.jsx)(d,{children:(0,k.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n(`desktopUpdatesStatusLabel`)}),(0,k.jsx)(M,{snapshot:a})]}),(0,k.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:E.map(([e,t])=>(0,k.jsx)(N,{label:e,value:t},e))}),a.channel===`beta`?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n(`desktopUpdatesBetaBadgeTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:n(`desktopUpdatesBetaBadgeDescription`)})]}):null,a.downloadedVersion?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:n(`desktopUpdatesDownloadedBannerTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:n(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,a.downloadedVersion)})]}):null,(0,k.jsx)(P,{snapshot:a}),a.status===`blocked`?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:n(`desktopUpdatesBlockedTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:a.errorMessage??n(`desktopUpdatesBlockedDescription`)}),a.recoveryCommand?(0,k.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:a.recoveryCommand}):null]}):null,a.errorMessage&&a.status!==`blocked`?(0,k.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:a.errorMessage}):null]})})}),(0,k.jsx)(W,{snapshot:a}),(0,k.jsx)(m,{title:n(`desktopUpdatesChannelSettingsTitle`),description:n(`desktopUpdatesChannelSettingsDescription`),children:(0,k.jsx)(d,{children:(0,k.jsx)(p,{title:n(`desktopUpdatesReleaseChannel`),description:n(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsxs)(x,{value:a.channel,disabled:w||o||c||l||g,onValueChange:e=>void s.updateChannel(e),children:[(0,k.jsx)(v,{className:`w-full max-w-sm`,children:(0,k.jsx)(_,{placeholder:n(`desktopUpdatesReleaseChannel`)})}),(0,k.jsxs)(y,{children:[(0,k.jsx)(b,{value:`stable`,children:n(`desktopUpdatesChannelStable`)}),(0,k.jsx)(b,{value:`beta`,children:n(`desktopUpdatesChannelBeta`)})]})]}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,k.jsx)(m,{title:n(`desktopUpdatesActionsTitle`),description:n(`runtimeUpdatesActionsDescription`),children:(0,k.jsx)(d,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,k.jsxs)(f,{variant:`outline`,onClick:()=>void s.checkForUpdates(),disabled:o||c||l||g,children:[(0,k.jsx)(S,{className:t(`mr-2 h-4 w-4`,o&&`animate-spin`)}),n(`desktopUpdatesCheckNow`)]}),(0,k.jsxs)(f,{onClick:()=>void s.updateNow(),disabled:!T,children:[(0,k.jsx)(C,{className:t(`mr-2 h-4 w-4`,g&&`animate-spin`)}),n(`runtimeUpdatesApplyNow`)]})]})})})]})}export{K as DesktopUpdateConfig};
@@ -1 +1 @@
1
- import{B as e,L as t,a as n}from"./react-CVFx225w.js";import{f as r,fn as i,sn as a,yn as o}from"./api-aEu9cEI8.js";import{t as s}from"./refresh-cw-C-3_thgr.js";import{Ct as c,Ot as l,Tt as u,yt as d}from"./index-zuqzAvNx.js";function f(){return o({queryKey:[`extension-catalog`],queryFn:r,staleTime:5e3,refetchOnWindowFocus:!0})}var p=e(),m={running:`bg-emerald-50 text-emerald-700`,starting:`bg-amber-50 text-amber-700`,stopping:`bg-amber-50 text-amber-700`,stopped:`bg-muted text-muted-foreground`,failed:`bg-rose-50 text-rose-700`};function h({state:e}){return(0,p.jsx)(`span`,{className:t(`rounded-full px-2 py-1 text-xs font-medium`,m[e]),children:n(`extensionsState${e[0].toUpperCase()}${e.slice(1)}`)})}function g({label:e,value:t}){return(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card px-4 py-3`,children:[(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,p.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums text-foreground`,children:t})]})}function _({extension:e}){return(0,p.jsxs)(`article`,{className:`rounded-xl border border-border/70 bg-card p-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,p.jsx)(`span`,{className:`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,p.jsx)(d,{className:`h-5 w-5`})}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,p.jsx)(`h2`,{className:`truncate font-semibold text-foreground`,children:e.name}),(0,p.jsx)(h,{state:e.state})]}),(0,p.jsxs)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:[e.id,e.version?` · v${e.version}`:``]})]})]}),(0,p.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:[(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(u,{className:`h-3.5 w-3.5`}),n(`extensionsObservationCapabilities`)]}),(0,p.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.observations.context?n(`extensionsContextCapability`):null,e.observations.context&&e.observations.events?` · `:null,e.observations.events?n(`extensionsEventsCapability`):null,!e.observations.context&&!e.observations.events?n(`extensionsNone`):null]})]}),(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(c,{className:`h-3.5 w-3.5`}),n(`extensionsChannelCapabilities`)]}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.channels.length>0?e.channels.map(e=>e.name||e.id).join(` · `):n(`extensionsNone`)})]})]}),(0,p.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,p.jsxs)(`span`,{children:[n(`extensionsLeaseCount`),`: `,e.leaseCount]}),e.pid?(0,p.jsxs)(`span`,{children:[n(`extensionsProcess`),`: `,e.pid]}):null,e.startedAt?(0,p.jsxs)(`span`,{children:[n(`extensionsStartedAt`),`: `,new Date(e.startedAt).toLocaleString()]}):null]})]})}function v(){let e=f(),r=e.data;return(0,p.jsxs)(a,{title:n(`extensionsPageTitle`),description:n(`extensionsPageDescription`),actions:(0,p.jsxs)(i,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:[(0,p.jsx)(s,{className:t(`mr-2 h-4 w-4`,e.isFetching&&`animate-spin`)}),n(`extensionsRefresh`)]}),children:[(0,p.jsx)(`div`,{className:`rounded-xl border border-primary/20 bg-primary/5 px-4 py-3 text-sm text-muted-foreground`,children:(0,p.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,p.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-primary`}),(0,p.jsx)(`p`,{children:n(`extensionsLifecycleDescription`)})]})}),e.isPending?(0,p.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:n(`extensionsLoading`)}):e.isError?(0,p.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 px-4 py-5 text-sm text-rose-700`,children:[(0,p.jsx)(`p`,{children:n(`extensionsLoadFailed`)}),(0,p.jsx)(i,{className:`mt-3`,type:`button`,variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),children:n(`extensionsRetry`)})]}):r?.extensions.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 lg:grid-cols-4`,children:[(0,p.jsx)(g,{label:n(`extensionsTotal`),value:r.counts.total}),(0,p.jsx)(g,{label:n(`extensionsRunning`),value:r.counts.running}),(0,p.jsx)(g,{label:n(`extensionsWithObservations`),value:r.counts.withObservations}),(0,p.jsx)(g,{label:n(`extensionsWithChannels`),value:r.counts.withChannels})]}),(0,p.jsx)(`div`,{className:`space-y-3`,children:r.extensions.map(e=>(0,p.jsx)(_,{extension:e},e.id))})]}):(0,p.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground`,children:[(0,p.jsx)(d,{className:`mx-auto h-5 w-5 text-muted-foreground/50`}),(0,p.jsx)(`p`,{className:`mt-2 font-medium text-foreground`,children:n(`extensionsEmpty`)}),(0,p.jsx)(`p`,{className:`mt-1`,children:n(`extensionsEmptyDescription`)})]})]})}export{v as ExtensionsConfigPage};
1
+ import{B as e,L as t,a as n}from"./react-CVFx225w.js";import{f as r,fn as i,sn as a,yn as o}from"./api-n96IfCKb.js";import{t as s}from"./refresh-cw-C-3_thgr.js";import{Ct as c,Ot as l,Tt as u,yt as d}from"./index-CLw9DuCJ.js";function f(){return o({queryKey:[`extension-catalog`],queryFn:r,staleTime:5e3,refetchOnWindowFocus:!0})}var p=e(),m={running:`bg-emerald-50 text-emerald-700`,starting:`bg-amber-50 text-amber-700`,stopping:`bg-amber-50 text-amber-700`,stopped:`bg-muted text-muted-foreground`,failed:`bg-rose-50 text-rose-700`};function h({state:e}){return(0,p.jsx)(`span`,{className:t(`rounded-full px-2 py-1 text-xs font-medium`,m[e]),children:n(`extensionsState${e[0].toUpperCase()}${e.slice(1)}`)})}function g({label:e,value:t}){return(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card px-4 py-3`,children:[(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,p.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums text-foreground`,children:t})]})}function _({extension:e}){return(0,p.jsxs)(`article`,{className:`rounded-xl border border-border/70 bg-card p-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,p.jsx)(`span`,{className:`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,p.jsx)(d,{className:`h-5 w-5`})}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,p.jsx)(`h2`,{className:`truncate font-semibold text-foreground`,children:e.name}),(0,p.jsx)(h,{state:e.state})]}),(0,p.jsxs)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:[e.id,e.version?` · v${e.version}`:``]})]})]}),(0,p.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:[(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(u,{className:`h-3.5 w-3.5`}),n(`extensionsObservationCapabilities`)]}),(0,p.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.observations.context?n(`extensionsContextCapability`):null,e.observations.context&&e.observations.events?` · `:null,e.observations.events?n(`extensionsEventsCapability`):null,!e.observations.context&&!e.observations.events?n(`extensionsNone`):null]})]}),(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(c,{className:`h-3.5 w-3.5`}),n(`extensionsChannelCapabilities`)]}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.channels.length>0?e.channels.map(e=>e.name||e.id).join(` · `):n(`extensionsNone`)})]})]}),(0,p.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,p.jsxs)(`span`,{children:[n(`extensionsLeaseCount`),`: `,e.leaseCount]}),e.pid?(0,p.jsxs)(`span`,{children:[n(`extensionsProcess`),`: `,e.pid]}):null,e.startedAt?(0,p.jsxs)(`span`,{children:[n(`extensionsStartedAt`),`: `,new Date(e.startedAt).toLocaleString()]}):null]})]})}function v(){let e=f(),r=e.data;return(0,p.jsxs)(a,{title:n(`extensionsPageTitle`),description:n(`extensionsPageDescription`),actions:(0,p.jsxs)(i,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:[(0,p.jsx)(s,{className:t(`mr-2 h-4 w-4`,e.isFetching&&`animate-spin`)}),n(`extensionsRefresh`)]}),children:[(0,p.jsx)(`div`,{className:`rounded-xl border border-primary/20 bg-primary/5 px-4 py-3 text-sm text-muted-foreground`,children:(0,p.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,p.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-primary`}),(0,p.jsx)(`p`,{children:n(`extensionsLifecycleDescription`)})]})}),e.isPending?(0,p.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:n(`extensionsLoading`)}):e.isError?(0,p.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 px-4 py-5 text-sm text-rose-700`,children:[(0,p.jsx)(`p`,{children:n(`extensionsLoadFailed`)}),(0,p.jsx)(i,{className:`mt-3`,type:`button`,variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),children:n(`extensionsRetry`)})]}):r?.extensions.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 lg:grid-cols-4`,children:[(0,p.jsx)(g,{label:n(`extensionsTotal`),value:r.counts.total}),(0,p.jsx)(g,{label:n(`extensionsRunning`),value:r.counts.running}),(0,p.jsx)(g,{label:n(`extensionsWithObservations`),value:r.counts.withObservations}),(0,p.jsx)(g,{label:n(`extensionsWithChannels`),value:r.counts.withChannels})]}),(0,p.jsx)(`div`,{className:`space-y-3`,children:r.extensions.map(e=>(0,p.jsx)(_,{extension:e},e.id))})]}):(0,p.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground`,children:[(0,p.jsx)(d,{className:`mx-auto h-5 w-5 text-muted-foreground/50`}),(0,p.jsx)(`p`,{className:`mt-2 font-medium text-foreground`,children:n(`extensionsEmpty`)}),(0,p.jsx)(`p`,{className:`mt-1`,children:n(`extensionsEmptyDescription`)})]})]})}export{v as ExtensionsConfigPage};