nextclaw 0.19.26 → 0.19.27
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.
- package/dist/cli/app/index.js +2 -0
- package/dist/cli/app/index.js.map +1 -0
- package/dist/cli/launcher/index.js +2 -0
- package/dist/cli/launcher/index.js.map +1 -0
- package/dist/nextclaw-distribution.utils-BJZhAnGk.js +2 -0
- package/dist/nextclaw-distribution.utils-BJZhAnGk.js.map +1 -0
- package/package.json +18 -18
- package/resources/USAGE.md +54 -3
- package/resources/usage/http-webhook-ingress.md +145 -0
- package/ui-dist/assets/{channels-list-page-CE_9jne_.js → channels-list-page-ZWYqfcCe.js} +1 -1
- package/ui-dist/assets/{chat-page-BMJLtk3O.js → chat-page-ACm58eUO.js} +1 -1
- package/ui-dist/assets/desktop-C-cDRCBY.js +3 -0
- package/ui-dist/assets/doc-browser-D2pq4IHR.js +1 -0
- package/ui-dist/assets/doc-browser-DhIkcy0-.js +1 -0
- package/ui-dist/assets/{doc-browser-CDBYvb8A.js → doc-browser-fLs0TcdS.js} +1 -1
- package/ui-dist/assets/{index-BEn7o-oH.js → index-Db9Cufsy.js} +22 -22
- package/ui-dist/assets/{marketplace-page-B3Q_uKOZ.js → marketplace-page-CAp_gpNe.js} +1 -1
- package/ui-dist/assets/marketplace-page-PPY5uMHK.js +1 -0
- package/ui-dist/assets/mcp-marketplace-page-87__92b1.js +1 -0
- package/ui-dist/assets/{mcp-marketplace-page-D9maE_Sf.js → mcp-marketplace-page-C6HENB6V.js} +1 -1
- package/ui-dist/assets/{model-config-BsEQYJvz.js → model-config-CK3a8DWH.js} +1 -1
- package/ui-dist/assets/{providers-list-5mA-2zno.js → providers-list-BTPjqNdK.js} +1 -1
- package/ui-dist/assets/{runtime-config-page-BSoKMvCh.js → runtime-config-page-Bb9he7t8.js} +1 -1
- package/ui-dist/assets/{search-config-DxWm2GrK.js → search-config-BkbSXa9d.js} +1 -1
- package/ui-dist/assets/{secrets-config-qutTAlFx.js → secrets-config-DFbHCb9n.js} +1 -1
- package/ui-dist/assets/{use-infinite-scroll-loader-CyNa4Vj6.js → use-infinite-scroll-loader-DXhw9W4l.js} +1 -1
- package/ui-dist/index.html +7 -7
- package/ui-dist/assets/desktop-DJpQzxsz.js +0 -3
- package/ui-dist/assets/doc-browser-B19cYGxa.js +0 -1
- package/ui-dist/assets/doc-browser-IRh6LCzu.js +0 -1
- package/ui-dist/assets/marketplace-page-CCq1bFb1.js +0 -1
- package/ui-dist/assets/mcp-marketplace-page-O5AQzBYl.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/doc-browser-IRh6LCzu.js","assets/doc-browser-B19cYGxa.js","assets/i18n-D1144VAA.js","assets/createLucideIcon-DzY6wN61.js","assets/search-CRtQwr-h.js","assets/book-open-BcnAiKde.js","assets/external-link-CpEvG65F.js","assets/plus-B-YHtTNC.js","assets/x-BeyYA_h6.js","assets/doc-browser-context-BPeeiNJ_.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as e,i as t,m as n,p as r,r as i,u as a}from"./i18n-D1144VAA.js";import{Dt as o,Et as s,Lt as c,Nt as l,Ot as u,Tt as d,bt as f,gt as ee,mt as p,pt as m,wt as h,yt as te}from"./api-rASx2-N4.js";import{a as g,f as _,t as v}from"./cpu-DKc3bQic.js";import{t as y}from"./createLucideIcon-DzY6wN61.js";import{n as ne,t as re}from"./search-CRtQwr-h.js";import{r as ie}from"./doc-browser-B19cYGxa.js";import{t as ae}from"./book-open-BcnAiKde.js";import{i as oe,k as se,n as ce,r as le,t as ue}from"./select-HI5kiwX_.js";import{t as b}from"./download-CMM8po31.js";import{t as de}from"./key-round-DUq47t0P.js";import{h as fe,n as pe}from"./app-manager-provider-CUkcbdWk.js";import{n as me,t as x}from"./settings-MWL2SMyk.js";import{t as he}from"./refresh-cw-CrbD8EkT.js";import{t as ge}from"./sparkles-BmgOD4nY.js";import{t as S}from"./x-BeyYA_h6.js";import{i as _e}from"./doc-browser-context-BPeeiNJ_.js";import{n as ve}from"./doc-browser-CDBYvb8A.js";import{t as ye}from"./use-config-BFqzVF8Y.js";import{n as be,r as xe,t as Se}from"./popover-DeAliE_4.js";var C=y(`AlarmClock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),w=y(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),T=y(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),E=y(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),D=y(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),Ce=y(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),we=y(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),Te=y(`Plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Ee=y(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),De=y(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Oe=y(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),O=y(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),k=f(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),ke=new class{constructor(){this.start=async()=>{let e=this.getDesktopApi();if(!e){this.markUnsupported();return}k.setState({supported:!0,initialized:!1,busyAction:`loading`});try{let t=await e.getPresenceState();k.setState({supported:!0,initialized:!0,busyAction:null,snapshot:t})}catch(e){k.setState({supported:!0,initialized:!0,busyAction:null}),c.error(`${i(`runtimePresenceLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.markUnsupported=()=>{k.setState({supported:!1,initialized:!0,busyAction:null,snapshot:null})},this.updatePreferences=async e=>{let t=this.getDesktopApi();if(!t)throw Error(i(`runtimePresenceLaunchAtLoginUnavailable`));k.setState({busyAction:`saving-preferences`});try{let n=await t.updatePresencePreferences(e);return k.setState({supported:!0,initialized:!0,snapshot:n}),c.success(i(`runtimePresenceSaved`)),n}catch(e){throw c.error(`${i(`runtimePresenceSaveFailed`)}: ${this.getErrorMessage(e)}`),e}finally{k.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:i(`error`)}},A=f(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null}));new class{constructor(){this.unsubscribe=null,this.subscriptionCount=0,this.start=async()=>{this.subscriptionCount+=1;let e=this.getDesktopApi();if(!e){A.setState({supported:!1,initialized:!0,snapshot:null});return}this.unsubscribe||=e.onUpdateStateChanged(e=>{A.setState({supported:!0,initialized:!0,snapshot:e})}),A.setState({supported:!0,initialized:!1});try{let t=await e.getUpdateState();A.setState({supported:!0,initialized:!0,snapshot:t})}catch(e){A.setState({supported:!0,initialized:!0}),c.error(`${i(`desktopUpdatesLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.stop=()=>{this.subscriptionCount=Math.max(0,this.subscriptionCount-1),!(this.subscriptionCount>0)&&(this.unsubscribe?.(),this.unsubscribe=null)},this.checkForUpdates=async()=>{let e;try{e=await this.runSnapshotCommand(`checking`,i(`desktopUpdatesCheckFailed`),async e=>await e.checkForUpdates())}catch{return}if(e.status===`up-to-date`){c.success(i(`desktopUpdatesAlreadyLatest`));return}if(e.status===`update-available`){c.success(i(`desktopUpdatesAvailable`).replace(`{version}`,e.availableVersion??i(`desktopUpdatesUnknownVersion`)));return}if(e.status===`downloaded`){c.success(i(`desktopUpdatesReadyToApply`));return}e.status===`failed`&&e.errorMessage&&c.error(e.errorMessage)},this.downloadUpdate=async()=>{let e;try{e=await this.runSnapshotCommand(`downloading`,i(`desktopUpdatesDownloadFailed`),async e=>await e.downloadUpdate())}catch{return}e.status===`downloaded`&&c.success(i(`desktopUpdatesReadyToApply`))},this.applyDownloadedUpdate=async()=>{try{await this.runSnapshotCommand(`applying`,i(`desktopUpdatesApplyFailed`),async e=>await e.applyDownloadedUpdate())}catch{return}},this.updatePreferences=async e=>{try{await this.runSnapshotCommand(`saving-preferences`,i(`desktopUpdatesPreferencesFailed`),async t=>await t.updatePreferences(e))}catch{return}},this.updateChannel=async e=>{if(A.getState().snapshot?.channel===e)return;let t;try{t=await this.runSnapshotCommand(`switching-channel`,i(`desktopUpdatesChannelChangeFailed`),async t=>await t.updateChannel(e))}catch{return}if(t.status===`update-available`&&t.availableVersion){c.success(i(`desktopUpdatesChannelChangedWithUpdate`).replace(`{channel}`,this.getChannelLabel(e)).replace(`{version}`,t.availableVersion));return}c.success(i(`desktopUpdatesChannelChanged`).replace(`{channel}`,this.getChannelLabel(e)))},this.runSnapshotCommand=async(e,t,n)=>{let r=this.getDesktopApi();if(!r)throw Error(i(`desktopUpdatesDesktopOnlyDescription`));A.setState({busyAction:e});try{let e=await n(r);return A.setState({snapshot:e}),e}catch(e){throw c.error(`${t}: ${this.getErrorMessage(e)}`),e}finally{A.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:i(`error`),this.getChannelLabel=e=>i(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}};function j(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function M(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)||t===`/agents`||t.startsWith(`/agents/`)}function Ae(e){let t=e.toLowerCase();return t.startsWith(`/chat/`)&&t!==`/chat`}function je(e){return[{target:`/chat`,label:e(`chat`),icon:D},{target:`/skills`,label:e(`marketplaceFilterSkills`),icon:T},{target:`/agents`,label:e(`agentsPageTitle`),icon:w},{target:`/settings`,label:e(`settings`),icon:x}]}function Me(e){return[{target:`/model`,label:e(`model`),icon:v},{target:`/providers`,label:e(`providers`),icon:ge},{target:`/channels`,label:e(`channels`),icon:me},{target:`/search`,label:e(`searchChannels`),icon:re},{target:`/runtime`,label:e(`runtime`),icon:v},{target:`/updates`,label:e(`updates`),icon:b},{target:`/remote`,label:e(`remote`),icon:Oe},{target:`/security`,label:e(`security`),icon:Ee},{target:`/secrets`,label:e(`secrets`),icon:de},{target:`/cron`,label:e(`cron`),icon:C},{target:`/marketplace/plugins`,label:e(`marketplaceFilterPlugins`),icon:Te},{target:`/marketplace/mcp`,label:e(`marketplaceFilterMcp`),icon:O}]}function N(e){return[{target:`/language`,label:e(`language`),icon:E},...Me(e)]}function Ne(e){let t=e.toLowerCase();return t===`/settings`?!0:N(e=>e).some(e=>j(t,e.target))}function Pe(e,t){let n=e.toLowerCase(),r=N(t);if(Ae(n))return{title:t(`chat`),backTarget:`/chat`,backLabel:t(`chat`)};if(n===`/chat`)return{title:t(`chat`),backTarget:null,backLabel:null};if(n===`/skills`||n.startsWith(`/skills/`))return{title:t(`marketplaceFilterSkills`),backTarget:null,backLabel:null};if(n===`/agents`||n.startsWith(`/agents/`))return{title:t(`agentsPageTitle`),backTarget:null,backLabel:null};if(n===`/settings`)return{title:t(`settings`),backTarget:null,backLabel:null};for(let e of r)if(j(n,e.target))return{title:e.label,backTarget:`/settings`,backLabel:t(`settings`)};return{title:t(`settings`),backTarget:null,backLabel:null}}var Fe=`nextclaw.ui.theme`,P=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],F=`warm`,I=!1,L=new Set;function Ie(e){return e===`warm`||e===`cool`}function R(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function Le(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(Fe);if(Ie(e))return e}catch{}return`warm`}function z(){return I||=(F=Le(),R(F),!0),F}function Re(){return I?F:z()}function ze(e){if(z(),e!==F){if(F=e,R(F),typeof window<`u`)try{window.localStorage.setItem(Fe,F)}catch{}L.forEach(e=>e(F))}}function Be(e){return L.add(e),()=>{L.delete(e)}}var B=r(),Ve={healthy:`bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]`,attention:`bg-amber-400 shadow-[0_0_0_3px_rgba(251,191,36,0.16)]`,inactive:`bg-gray-300 shadow-[0_0_0_3px_rgba(156,163,175,0.12)]`};function He(){let e=ee(),t=e.actionLabel===i(`runtimeStatusRestartAction`),n=async()=>{if(t)try{let e=await te.runRuntimeControlAction(`restart-service`);c.success(e.message)}catch(e){let t=e instanceof Error?e.message:i(`runtimeControlActionFailed`);c.error(`${i(`runtimeControlActionFailed`)}: ${t}`)}};return(0,B.jsxs)(Se,{children:[(0,B.jsx)(xe,{asChild:!0,children:(0,B.jsx)(`button`,{type:`button`,className:`inline-flex items-center justify-center rounded-full p-0.5 transition-transform hover:scale-105`,"aria-label":e.title,title:e.title,"data-testid":`runtime-status-entry`,children:(0,B.jsx)(`span`,{className:a(`h-2.5 w-2.5 rounded-full`,Ve[e.tone])})})}),(0,B.jsxs)(be,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-gray-200 bg-white p-4`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:e.title}),(0,B.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description})]}),e.reasonLines.length>0?(0,B.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,B.jsx)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-900`,children:e},e))}):null,e.actionLabel?(0,B.jsxs)(`div`,{className:`flex items-center justify-between border-t border-gray-100 pt-1`,children:[(0,B.jsx)(`span`,{className:`text-[11px] text-gray-500`,children:i(`runtimeStatusActionHint`)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>void n(),disabled:e.isBusy,className:`text-sm font-semibold text-sky-600 transition-colors hover:text-sky-700 disabled:text-gray-400`,children:e.isBusy?i(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}var V=e(n(),1);function H({className:e,density:t=`sidebar`,suffix:n}){let{data:r}=ye(),i=r?.name??`NextClaw`,o=r?.productVersion?.trim(),s=o?`v${o}`:null,c=n??(0,B.jsx)(He,{}),l=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`,u=t===`chrome`;return(0,B.jsxs)(`div`,{className:a(e??`flex min-w-0 items-center gap-2`,l&&`pl-[58px]`),children:[(0,B.jsx)(`div`,{className:a(`flex shrink-0 items-center justify-center overflow-hidden`,`h-6 w-6 rounded-md`),children:(0,B.jsx)(`img`,{src:`/logo.svg`,alt:i,className:`h-full w-full object-contain`})}),(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,B.jsx)(`span`,{className:a(`shrink-0 font-semibold text-gray-800`,u?`text-[15px]`:`text-[14px]`),children:i}),s?(0,B.jsx)(Ue,{versionLabel:s,density:t}):null]}),(0,B.jsx)(We,{}),c?(0,B.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:c}):null]})]})}function Ue({versionLabel:e,density:t}){let[n,r]=(0,V.useState)(!1);return(0,B.jsxs)(`span`,{className:`relative min-w-0 flex-1`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),children:[(0,B.jsx)(`span`,{tabIndex:0,"aria-label":e,className:a(`block min-w-0 truncate font-medium text-gray-500 outline-none`,`text-[12px]`),children:e}),n?(0,B.jsx)(`span`,{className:`pointer-events-none absolute left-0 top-full z-[var(--z-tooltip)] mt-1 w-max max-w-none whitespace-nowrap rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md`,children:e}):null]})}function We(){let{supported:e,busyAction:t,snapshot:n}=p();return!e||!n?null:n.status===`downloading`||n.status===`blocked`||n.status===`failed`?(0,B.jsx)(Ge,{snapshot:n}):n.status===`downloaded`?(0,B.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-emerald-50 px-2 text-[11px] font-semibold leading-none text-emerald-700 ring-1 ring-emerald-100 transition-colors hover:bg-emerald-100 disabled:opacity-70`,disabled:t===`applying`,onClick:()=>void m.applyDownloadedUpdate(),children:i(t===`applying`?`desktopUpdatesInlineApplying`:`desktopUpdatesInlineReady`)}):n.status===`update-available`?(0,B.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,disabled:t===`downloading`,onClick:()=>void m.downloadUpdate(),children:i(t===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)}):null}function Ge({snapshot:e}){if(e.status===`blocked`||e.status===`failed`)return(0,B.jsx)(Ke,{snapshot:e});let t=e.status===`downloading`?qe(e):null;return t?(0,B.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,title:i(`updates`),children:t}):null}function Ke({snapshot:e}){let t=e.status===`failed`?i(`desktopUpdatesStatusFailed`):i(`desktopUpdatesStatusBlocked`),n=e.recoveryCommand?.trim()||null,r=e.errorMessage?.trim()||e.blockReason?.trim()||null,a=[t,e.status===`blocked`&&e.blockReason?i(`desktopUpdatesBlockedRootCause.${e.blockReason}`):null,r,n].filter(Boolean).join(`
|
|
3
|
-
`);return(0,B.jsx)(`span`,{role:`img`,"aria-label":t,title:a,tabIndex:0,className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-50 text-[13px] font-bold leading-none text-amber-700 ring-1 ring-amber-100`,children:`!`})}function qe(e){let t=e.progress?.percent;return t==null?i(`desktopUpdatesInlineDownloading`):i(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(t))}var Je={default:{row:`gap-3 px-3 py-2.5 text-[14px]`,icon:`h-[17px] w-[17px]`,value:`text-xs`,gap:`gap-3`},compact:{row:`gap-2.5 px-3 py-2 text-[13px]`,icon:`h-4 w-4`,value:`text-[11px]`,gap:`gap-2.5`}};function U(e){return Je[e]}function W({to:e,label:t,icon:n,density:r=`default`,className:i}){let o=U(r);return(0,B.jsx)(g,{to:e,className:({isActive:e})=>a(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base`,o.row,e?`bg-gray-200 text-gray-900 shadow-sm`:`text-gray-600 hover:bg-gray-200/60 hover:text-gray-900`,i),children:({isActive:e})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{className:a(o.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function G({label:e,icon:t,onClick:n,density:r=`default`,className:i,labelClassName:o,trailing:s,trailingClassName:c,testId:l,trailingTestId:u}){let d=U(r);return(0,B.jsxs)(`button`,{type:`button`,onClick:n,className:a(`flex w-full items-center rounded-xl font-medium text-gray-600 transition-all duration-base hover:bg-gray-200/60 hover:text-gray-800`,d.row,i),"data-testid":l,children:[(0,B.jsx)(t,{className:a(d.icon,`shrink-0 text-gray-400`)}),(0,B.jsx)(`span`,{className:a(`min-w-0 flex-1 text-left`,o),children:e}),s?(0,B.jsx)(`span`,{className:a(`shrink-0 text-gray-500`,d.value,c),"data-testid":u,children:s}):null]})}function Ye({label:e,icon:t,value:n,valueLabel:r,onValueChange:i,density:o=`default`,children:s}){let c=U(o);return(0,B.jsxs)(ue,{value:n,onValueChange:i,children:[(0,B.jsxs)(oe,{className:a(`h-auto w-full rounded-xl border-0 bg-transparent font-medium text-gray-600 shadow-none hover:bg-gray-200/60 focus:ring-0`,c.row),children:[(0,B.jsxs)(`div`,{className:a(`flex min-w-0 items-center`,c.gap),children:[(0,B.jsx)(t,{className:a(c.icon,`text-gray-400`)}),(0,B.jsx)(`span`,{className:`text-left`,children:e})]}),(0,B.jsx)(`span`,{className:a(`ml-auto text-gray-500`,c.value),children:r})]}),(0,B.jsx)(ce,{children:s})]})}var K=`nextclaw-pwa-install-banner-dismissed`,q=`nextclaw-pwa-install-banner-dismissed-until`;function Xe(){let e=J();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:$e(e):!1}function Ze(){let e=J();e?.setItem(K,`1`),e?.removeItem(q)}function Qe(){let e=J();e?.removeItem(K),e?.removeItem(q)}function J(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function $e(e){let t=e.getItem(q);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(q),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(K,`1`),!0)}function et(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:Xe(),updateAvailable:!1,registrationFailed:!1}}var Y=f(()=>et()),X=`nextclaw-pwa-dev-sw-reset`,Z=new class{constructor(){this.started=!1,this.registration=null,this.reloadWhenControllerChanges=!1,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{let e=await navigator.serviceWorker.register(`/sw.js`);this.registration=e,this.bindRegistration(e),navigator.serviceWorker.addEventListener(`controllerchange`,this.handleControllerChange),await this.syncUpdateAvailability()}catch{Y.setState({registrationFailed:!0})}}},this.syncUpdateAvailability=async()=>{if(typeof window>`u`||!(`serviceWorker`in navigator)||typeof navigator.serviceWorker.getRegistration!=`function`){Y.setState({updateAvailable:!1});return}let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;Y.setState({updateAvailable:this.shouldSurfaceUpdate(e)})},this.applyUpdate=async()=>{let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;if(!e){window.location.reload();return}e.waiting||await e.update();let t=e.waiting;if(!t){window.location.reload();return}this.reloadWhenControllerChanges=!0,t.postMessage({type:`SKIP_WAIT`})},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(navigator.serviceWorker.removeEventListener(`controllerchange`,this.handleControllerChange),this.started=!1,this.registration=null,this.reloadWhenControllerChanges=!1)},this.bindRegistration=e=>{e.addEventListener(`updatefound`,()=>{let t=e.installing;t&&t.addEventListener(`statechange`,()=>{t.state===`installed`&&this.syncUpdateAvailability()})})},this.handleControllerChange=()=>{this.reloadWhenControllerChanges&&(this.reloadWhenControllerChanges=!1,window.location.reload())},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.shouldSurfaceUpdate=e=>!e?.waiting||!navigator.serviceWorker.controller?!1:Y.getState().installability===`installed`,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));if(e.length===0){this.clearDevResetMarker();return}if(await Promise.all(e.map(async e=>await e.unregister())),await this.clearNextClawCaches(),navigator.serviceWorker.controller&&!this.hasDevResetMarker()){this.setDevResetMarker(),window.location.reload();return}this.clearDevResetMarker()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))},this.hasDevResetMarker=()=>{try{return window.sessionStorage.getItem(X)===`1`}catch{return!1}},this.setDevResetMarker=()=>{try{window.sessionStorage.setItem(X,`1`)}catch{}},this.clearDevResetMarker=()=>{try{window.sessionStorage.removeItem(X)}catch{}}}},Q=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),Y.setState(et())},this.refreshState=()=>{let e=this.resolveInstallability();Y.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:Xe()})),Z.syncUpdateAvailability()},this.dismissInstallPrompt=()=>{Ze(),Y.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let t=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,t.outcome===`accepted`?(Qe(),this.refreshState(),c.success(i(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,Qe(),Y.setState({dismissedInstallPrompt:!0}),c.success(i(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}};function tt(){let e=Y(e=>e.installability);return(0,B.jsx)(`span`,{className:a(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:nt(e)})}function nt(e){return i(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function rt(e,t,n){return i(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function it(){let e=Y(e=>e.installability),t=Y(e=>e.installMethod),n=Y(e=>e.blockedReason);return(0,B.jsxs)(h,{children:[(0,B.jsxs)(o,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(u,{children:i(`pwaInstallTitle`)}),(0,B.jsx)(s,{children:i(`pwaInstallDescription`)})]}),(0,B.jsx)(tt,{})]}),(0,B.jsxs)(d,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50/90 p-4`,children:(0,B.jsx)(`p`,{className:`text-sm leading-6 text-gray-700`,children:rt(e,t,n)})}),e===`available`&&t===`prompt`?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,B.jsxs)(l,{type:`button`,className:`gap-2`,onClick:()=>{Q.promptInstall()},children:[(0,B.jsx)(b,{className:`h-4 w-4`}),i(`pwaInstallAction`)]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:i(`pwaInstallPromptHint`)})]}):null,e===`available`&&t===`manual`?(0,B.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl border border-dashed border-gray-300 bg-white p-4`,children:[(0,B.jsx)(De,{className:`mt-0.5 h-4 w-4 text-gray-500`}),(0,B.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:i(`pwaInstallManualHint`)})]}):null]})]})}function at(){let e=Y(e=>e.installability),t=Y(e=>e.installMethod),n=Y(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||n?null:(0,B.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:i(`pwaInstallBannerTitle`)}),(0,B.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:i(`pwaInstallBannerDescription`)})]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":i(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{Q.dismissInstallPrompt()},children:(0,B.jsx)(S,{className:`h-4 w-4`})})]}),(0,B.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,B.jsxs)(l,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{Q.promptInstall()},children:[(0,B.jsx)(b,{className:`h-4 w-4`}),i(`pwaInstallAction`)]}),(0,B.jsx)(l,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{Q.dismissInstallPrompt()},children:i(`pwaInstallDismiss`)})]})]})}function ot(){let e=Y(e=>e.updateAvailable),t=Y(e=>e.installability);return!e||t!==`installed`?null:(0,B.jsxs)(`div`,{className:`fixed top-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,B.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:i(`pwaUpdateBannerTitle`)}),(0,B.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:i(`pwaUpdateBannerDescription`)})]})}),(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsxs)(l,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{Z.applyUpdate()},children:[(0,B.jsx)(he,{className:`h-4 w-4`}),i(`pwaUpdateAction`)]})})]})}var st=!1;function ct(){st||typeof window>`u`||(st=!0,Q.start(),Z.start())}var lt={warm:`#F9F8F5`,cool:`#F8FAFB`},ut=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=lt[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=`light`},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`)===`cool`?`cool`:`warm`;this.syncTheme(e)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}},dt=(0,V.createContext)(null);function ft({children:e}){let[t,n]=(0,V.useState)(()=>z());(0,V.useEffect)(()=>{ut.syncTheme(t)},[t]),(0,V.useEffect)(()=>Be(e=>{n(e)}),[]);let r=(0,V.useCallback)(e=>{ze(e),n(Re())},[]),i=(0,V.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,B.jsx)(dt.Provider,{value:i,children:e})}function pt(){let e=(0,V.useContext)(dt);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function mt(){let{language:e,setLanguage:n}=ve();return{currentLanguage:e,currentLanguageLabel:t.find(t=>t.value===e)?.label??e,languageOptions:t,selectLanguage:(0,V.useCallback)(t=>{e!==t&&(n(t),window.location.reload())},[e,n])}}function ht(){let{currentLanguage:e,currentLanguageLabel:t,languageOptions:n,selectLanguage:r}=mt();return(0,B.jsxs)(`section`,{className:`mx-auto w-full max-w-3xl space-y-4`,children:[(0,B.jsx)(`div`,{className:`rounded-3xl border border-gray-200/80 bg-white p-5 shadow-card`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-gray-100 text-gray-600`,children:(0,B.jsx)(E,{className:`h-4 w-4`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:i(`language`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:t})]})]})}),(0,B.jsx)(`div`,{className:`overflow-hidden rounded-3xl border border-gray-200/80 bg-white shadow-card`,children:n.map(t=>{let n=t.value===e;return(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(t.value),className:a(`flex w-full items-center justify-between gap-3 border-b border-gray-100 px-5 py-4 text-left text-sm transition-colors last:border-b-0`,n?`bg-gray-50 text-gray-900`:`text-gray-700 hover:bg-gray-50/70`),"aria-current":n?`true`:void 0,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:t.label}),n?(0,B.jsx)(se,{className:`h-4 w-4 text-gray-700`}):null]},t.value)})})]})}function gt({mode:e}){let t=pe(),n=_e(),r=fe(),{currentLanguage:o,currentLanguageLabel:s,languageOptions:c,selectLanguage:l}=mt(),{theme:u,setTheme:d}=pt(),f=e===`settings`,ee=i(P.find(e=>e.value===u)?.labelKey??`themeWarm`),p=r.data?.account.email?.trim(),m=!!r.data?.account.loggedIn,h=e=>{u!==e&&d(e)},te=[{target:`/chat`,label:i(`chat`),icon:D},{target:`/chat/cron`,label:i(`cron`),icon:C},{target:`/chat/skills`,label:i(`marketplaceFilterSkills`),icon:T},{target:`/agents`,label:i(`agentsPageTitle`),icon:w}],_=Me(i),v=f?_:te,y=f?`compact`:`default`;return(0,B.jsxs)(`aside`,{className:`w-[240px] shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary px-4 py-6`,children:[f?(0,B.jsx)(`div`,{className:`shrink-0 px-2 pb-3`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-1`,"data-testid":`settings-sidebar-header`,children:[(0,B.jsxs)(g,{to:`/chat`,className:`group inline-flex min-w-0 items-center gap-1.5 rounded-lg px-1 py-1 text-[12px] font-medium text-gray-500 transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,B.jsx)(ne,{className:`h-3.5 w-3.5 shrink-0 text-gray-400 group-hover:text-gray-700`}),(0,B.jsx)(`span`,{className:`truncate`,children:i(`backToMain`)})]}),(0,B.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-[#dddfe6]`,"aria-hidden":`true`}),(0,B.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:i(`settings`)})]})}):(0,B.jsx)(`div`,{className:`shrink-0 px-2 pb-8`,children:(0,B.jsx)(H,{className:`flex items-center gap-2.5 cursor-pointer`})}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`nav`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto pr-1`,children:(0,B.jsx)(`ul`,{className:a(f?`space-y-0.5 pb-3`:`space-y-1 pb-4`),children:v.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsx)(W,{to:e.target,label:e.label,icon:e.icon,density:y})},e.target))})}),(0,B.jsxs)(`div`,{className:a(`shrink-0 border-t border-[#dde0ea] bg-secondary`,f?`mt-2 pt-3`:`mt-3 pt-3`),children:[f?(0,B.jsx)(G,{onClick:()=>t.accountManager.openAccountPanel(),icon:de,label:i(`remoteAccountEntryManage`),density:`compact`,className:`mb-1.5`,trailing:m?p||i(`remoteAccountEntryConnected`):i(`remoteAccountEntryDisconnected`),trailingClassName:`max-w-[92px] truncate text-right`,testId:`settings-sidebar-account-entry`,trailingTestId:`settings-sidebar-account-status`}):null,e===`main`&&(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(W,{to:`/settings`,label:i(`settings`),icon:x})}),(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(Ye,{value:u,onValueChange:e=>h(e),icon:we,label:i(`theme`),valueLabel:ee,density:y,children:P.map(e=>(0,B.jsx)(le,{value:e.value,className:`text-xs`,children:i(e.labelKey)},e.value))})}),(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(Ye,{value:o,onValueChange:e=>l(e),icon:E,label:i(`language`),valueLabel:s,density:y,children:c.map(e=>(0,B.jsx)(le,{value:e.value,className:`text-xs`,children:e.label},e.value))})}),(0,B.jsx)(G,{onClick:()=>n.open(void 0,{kind:`docs`,newTab:!0,title:`Docs`}),icon:ae,label:i(`docBrowserHelp`),density:y})]})]})]})}var _t=[{action:`minimize`,label:`Minimize`,icon:Ce},{action:`toggle-maximize`,label:`Maximize`,icon:ie},{action:`close`,label:`Close`,icon:S,variant:`danger`}];function vt(){return(0,B.jsxs)(`header`,{className:`desktop-window-drag relative flex h-[var(--desktop-titlebar-height)] shrink-0 border-b border-[#ebe7dc]/80 bg-secondary`,"data-testid":`desktop-window-chrome`,children:[(0,B.jsx)(`div`,{className:`desktop-window-no-drag absolute left-0 right-0 top-0 h-1`,"data-testid":`desktop-window-chrome-resize-strip`}),(0,B.jsx)(`div`,{className:`desktop-window-no-drag relative z-10 flex h-full w-[var(--desktop-sidebar-width)] shrink-0 items-center bg-secondary pl-4 pr-3 text-secondary-foreground`,"data-testid":`desktop-window-chrome-sidebar`,children:(0,B.jsx)(H,{className:`flex min-w-0 shrink-0 items-center gap-2.5`,density:`chrome`})}),(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`desktop-window-drag h-full min-w-0 flex-1`,"data-testid":`desktop-window-chrome-main-drag-region`}),(0,B.jsx)(`div`,{className:`desktop-window-no-drag absolute right-0 top-0 z-20 flex h-full w-[var(--desktop-caption-safe-right)] items-start justify-end`,"data-testid":`desktop-window-controls`,children:_t.map(e=>(0,B.jsx)(yt,{control:e},e.action))})]})}function yt({control:e}){let t=e.icon;return(0,B.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,className:e.variant===`danger`?`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-red-500 hover:text-white`:`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-black/10`,onClick:()=>{window.nextclawDesktop?.controlWindow?.(e.action)},children:(0,B.jsx)(t,{className:`h-3.5 w-3.5`})})}function $(){return typeof window>`u`?null:St()??window.nextclawDesktop?.platform??null}function bt(){return $()===`darwin`}function xt(){return $()===`win32`}function St(){return null}var Ct=(0,V.lazy)(async()=>({default:(await _(async()=>{let{DocBrowser:e}=await import(`./doc-browser-IRh6LCzu.js`);return{DocBrowser:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).DocBrowser}));function wt(e){return{"--desktop-titlebar-height":`40px`,"--desktop-caption-safe-right":`140px`,"--desktop-sidebar-width":e?`280px`:`240px`}}function Tt({pathname:e,isDocBrowserOpen:t,docBrowserMode:n,children:r}){let i=M(e),o=xt();return(0,B.jsxs)(`div`,{className:a(`h-screen flex flex-col overflow-hidden bg-background font-sans text-foreground`,o?`rounded-[10px]`:null),style:o?wt(i):void 0,children:[o?(0,B.jsx)(vt,{}):null,(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[!i&&(0,B.jsx)(gt,{mode:`settings`}),(0,B.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,B.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:i?(0,B.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:r}):(0,B.jsx)(`main`,{className:`flex-1 overflow-auto p-8 pb-16 custom-scrollbar`,children:(0,B.jsx)(`div`,{className:`mx-auto h-full max-w-6xl animate-fade-in`,children:r})})}),t&&n===`docked`?(0,B.jsx)(V.Suspense,{fallback:null,children:(0,B.jsx)(Ct,{})}):null]})]}),t&&n===`floating`?(0,B.jsx)(V.Suspense,{fallback:null,children:(0,B.jsx)(Ct,{})}):null]})}export{C as A,O as C,E as D,D as E,T as O,k as S,Ce as T,Ae as _,ht as a,Pe as b,ct as c,ot as d,W as f,N as g,je as h,xt as i,w as k,at as l,P as m,$ as n,ft as o,H as p,bt as r,pt as s,Tt as t,it as u,M as v,we as w,ke as x,Ne as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,m as t,p as n,r,u as i}from"./i18n-D1144VAA.js";import{t as a}from"./createLucideIcon-DzY6wN61.js";import{n as o,t as s}from"./search-CRtQwr-h.js";import{t as c}from"./book-open-BcnAiKde.js";import{t as l}from"./external-link-CpEvG65F.js";import{t as u}from"./plus-B-YHtTNC.js";import{t as d}from"./x-BeyYA_h6.js";import{i as f,r as p,t as m}from"./doc-browser-context-BPeeiNJ_.js";var h=a(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ee=a(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),g=a(`Maximize2`,[[`polyline`,{points:`15 3 21 3 21 9`,key:`mznyad`}],[`polyline`,{points:`9 21 3 21 3 15`,key:`1avn1i`}],[`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`,key:`ota7mn`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),_=a(`PanelRightOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),v=e(t(),1),y=n();function b({children:e,className:t,style:n,defaultWidth:r=420,minWidth:a=320,maxWidth:o=860,overlay:s=!1,...c}){let l=(0,v.useRef)(null),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(r),m=e=>{if(s)return;e.preventDefault(),e.stopPropagation(),d(!0),l.current={startX:e.clientX,startWidth:f};let t=e=>{let t=l.current;if(!t)return;let n=t.startWidth+t.startX-e.clientX;p(Math.max(a,Math.min(o,n)))},n=()=>{d(!1),l.current=null,window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n)};window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,n)};return(0,y.jsxs)(`aside`,{...c,className:i(`relative flex h-full min-h-0 shrink-0 overflow-hidden bg-white`,s?`fixed inset-0 z-40`:`border-l border-gray-200`,t),style:s?n:{...n,width:f},children:[s?null:(0,y.jsx)(`div`,{className:`absolute left-0 top-0 z-20 h-full w-1.5 cursor-ew-resize transition-colors hover:bg-primary/10`,"data-testid":`resizable-right-panel-handle`,onMouseDown:m}),(0,y.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,children:e}),u?(0,y.jsx)(`div`,{className:`absolute inset-0 z-10`}):null]})}function te(e){return i(`flex flex-col bg-white overflow-hidden relative`,e?`fixed inset-0 z-[9999] h-[100dvh] w-screen rounded-none border-0 shadow-2xl`:`rounded-2xl shadow-2xl border border-gray-200`)}function ne(e){let{isFullscreen:t,floatPos:n,floatSize:r}=e;if(!t)return{position:`fixed`,left:n.x,top:n.y,width:r.w,height:r.h,zIndex:9999}}function x({displayMode:e=`desktop`}){let{isOpen:t,mode:n,tabs:a,activeTabId:x,currentTab:S,open:C,close:w,toggleMode:T,goBack:E,goForward:D,navigate:O,syncUrl:k,setActiveTab:re,closeTab:A}=f(),[j,M]=(0,v.useState)(``),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!1),[L,R]=(0,v.useState)(()=>({x:Math.max(40,window.innerWidth-520),y:80})),[z,B]=(0,v.useState)({w:480,h:600}),V=(0,v.useRef)(null),H=(0,v.useRef)(null),U=(0,v.useRef)(null),W=S?.currentUrl??m,G=S?.navVersion??0,K=(0,v.useRef)(G),q=S?.kind===`docs`;(0,v.useEffect)(()=>{if(!q){M(``);return}try{M(new URL(W).pathname)}catch{M(W)}},[W,x,q]),(0,v.useEffect)(()=>{if(q){if(G!==K.current){K.current=G;return}if(U.current?.contentWindow)try{let e=new URL(W).pathname;U.current.contentWindow.postMessage({type:`docs-navigate`,path:e},`*`)}catch{}}},[W,G,q]),(0,v.useEffect)(()=>{n===`floating`&&R(e=>({x:Math.max(40,window.innerWidth-z.w-40),y:e.y}))},[n,z.w]),(0,v.useEffect)(()=>{let e=e=>{q&&e.data?.type===`docs-route-change`&&typeof e.data.url==`string`&&k(e.data.url)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[k,q]);let J=(0,v.useCallback)(e=>{if(e.preventDefault(),!q)return;let t=j.trim();t&&(t.startsWith(`/`)?O(`${m}${t}`):t.startsWith(`http`)?O(t):O(`${m}/${t}`))},[j,O,q]),Y=(0,v.useCallback)(e=>{n===`floating`&&(P(!0),V.current={startX:e.clientX,startY:e.clientY,startPosX:L.x,startPosY:L.y})},[n,L]);(0,v.useEffect)(()=>{if(!N)return;let e=e=>{V.current&&R({x:V.current.startPosX+(e.clientX-V.current.startX),y:V.current.startPosY+(e.clientY-V.current.startY)})},t=()=>{P(!1),V.current=null};return window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[N]);let X=(0,v.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),I(!0);let{axis:t}=e.currentTarget.dataset;H.current={startX:e.clientX,startY:e.clientY,startW:z.w,startH:z.h};let n=e=>{H.current&&B(n=>({w:t===`y`?n.w:Math.max(360,H.current.startW+(e.clientX-H.current.startX)),h:t===`x`?n.h:Math.max(400,H.current.startH+(e.clientY-H.current.startY))}))},r=()=>{I(!1),H.current=null,window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,r)};window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r)},[z]),ie=(0,v.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),I(!0);let t=e.clientX,n=z.w,r=L.x,i=e=>{let i=t-e.clientX,a=Math.max(360,n+i);B(e=>({...e,w:a})),R(e=>({...e,x:r-(a-n)}))},a=()=>{I(!1),window.removeEventListener(`mousemove`,i),window.removeEventListener(`mouseup`,a)};window.addEventListener(`mousemove`,i),window.addEventListener(`mouseup`,a)},[z.w,L.x]);if(!t)return null;let Z=n===`docked`,Q=e===`fullscreen`,$=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:i(`flex items-center justify-between px-4 py-2.5 bg-gray-50 border-b border-gray-200 shrink-0 select-none`,!Z&&!Q&&`cursor-grab active:cursor-grabbing`,Q&&`pt-[calc(env(safe-area-inset-top,0px)+0.625rem)]`),onMouseDown:!Z&&!Q?Y:void 0,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,y.jsx)(c,{className:`w-4 h-4 text-primary shrink-0`}),(0,y.jsx)(`span`,{className:`text-sm font-semibold text-gray-900 truncate`,children:r(`docBrowserTitle`)})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[Q?null:(0,y.jsx)(`button`,{onClick:T,className:`hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors`,title:r(Z?`docBrowserFloatMode`:`docBrowserDockMode`),children:Z?(0,y.jsx)(g,{className:`w-3.5 h-3.5`}):(0,y.jsx)(_,{className:`w-3.5 h-3.5`})}),(0,y.jsx)(`button`,{onClick:w,className:`hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors`,title:r(`docBrowserClose`),children:(0,y.jsx)(d,{className:`w-3.5 h-3.5`})})]})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-2 bg-background border-b border-[#f1e7d4] overflow-x-auto custom-scrollbar`,children:[a.map(e=>(0,y.jsxs)(`div`,{className:i(`inline-flex items-center gap-1 h-7 px-1.5 rounded-lg text-xs border max-w-[220px] shrink-0 transition-colors`,e.id===x?`bg-amber-50/80 border-amber-200 text-amber-900 shadow-[0_1px_2px_rgba(30,20,10,0.04)]`:`bg-[#f9f8f5] border-[#eee3d1] text-[#78644d] hover:bg-[#fff7ea] hover:text-[#2f2212]`),children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>re(e.id),className:`truncate text-left px-1`,title:e.title,children:e.title||r(`docBrowserTabUntitled`)}),(0,y.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),A(e.id)},className:`rounded p-0.5 hover:bg-black/10`,"aria-label":r(`docBrowserCloseTab`),children:(0,y.jsx)(d,{className:`w-3 h-3`})})]},e.id)),(0,y.jsx)(`button`,{onClick:()=>C(void 0,{kind:`docs`,newTab:!0,title:`Docs`}),className:`inline-flex items-center justify-center w-7 h-7 rounded-lg border border-[#eee3d1] bg-white text-[#78644d] hover:bg-[#fff7ea] hover:text-[#2f2212] shrink-0`,title:r(`docBrowserNewTab`),children:(0,y.jsx)(u,{className:`w-3.5 h-3.5`})})]}),q&&(0,y.jsxs)(`div`,{className:`flex items-center gap-2 px-3.5 py-2 bg-white border-b border-gray-100 shrink-0`,children:[(0,y.jsx)(`button`,{onClick:E,disabled:!q||(S?.historyIndex??0)<=0,className:`p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors`,children:(0,y.jsx)(o,{className:`w-4 h-4`})}),(0,y.jsx)(`button`,{onClick:D,disabled:!q||(S?.historyIndex??0)>=(S?.history.length??0)-1,className:`p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors`,children:(0,y.jsx)(h,{className:`w-4 h-4`})}),(0,y.jsxs)(`form`,{onSubmit:J,className:`flex-1 relative`,children:[(0,y.jsx)(s,{className:`w-3.5 h-3.5 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400`}),(0,y.jsx)(`input`,{type:`text`,value:j,onChange:e=>M(e.target.value),placeholder:r(`docBrowserSearchPlaceholder`),className:`w-full h-8 pl-8 pr-3 rounded-lg bg-gray-50 border border-gray-200 text-xs text-gray-700 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 transition-colors placeholder:text-gray-400`})]})]}),(0,y.jsxs)(`div`,{className:`flex-1 relative overflow-hidden`,children:[(0,y.jsx)(`iframe`,{ref:U,src:W,className:`absolute inset-0 w-full h-full border-0`,title:S?.title||`NextClaw Docs`,sandbox:`allow-same-origin allow-scripts allow-popups allow-forms`,allow:`clipboard-read; clipboard-write`},`${x}:${G}`),(F||N)&&(0,y.jsx)(`div`,{className:`absolute inset-0 z-10`})]}),q&&p(W)&&(0,y.jsx)(`div`,{className:`flex items-center justify-between px-4 py-2 bg-gray-50 border-t border-gray-200 shrink-0`,children:(0,y.jsxs)(`a`,{href:W,target:`_blank`,rel:`noopener noreferrer`,"data-doc-external":!0,className:`flex items-center gap-1.5 text-xs text-primary hover:text-primary-hover font-medium transition-colors`,children:[r(`docBrowserOpenExternal`),(0,y.jsx)(l,{className:`w-3 h-3`})]})})]});return Z&&!Q?(0,y.jsx)(b,{"data-testid":`doc-browser-panel`,defaultWidth:420,minWidth:320,maxWidth:860,children:$}):(0,y.jsxs)(`div`,{"data-testid":`doc-browser-panel`,className:te(Q),style:ne({isFullscreen:Q,floatPos:L,floatSize:z}),children:[$,!Z&&!Q&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`div`,{className:`absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,onMouseDown:ie}),(0,y.jsx)(`div`,{className:`absolute top-0 right-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,onMouseDown:X,"data-axis":`x`}),(0,y.jsx)(`div`,{className:`absolute bottom-0 left-0 h-1.5 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,onMouseDown:X,"data-axis":`y`}),(0,y.jsx)(`div`,{className:`absolute bottom-0 right-0 w-4 h-4 cursor-se-resize z-30 flex items-center justify-center text-gray-300 hover:text-gray-500 transition-colors`,onMouseDown:X,children:(0,y.jsx)(ee,{className:`w-3 h-3 rotate-[-45deg]`})})]})]})}export{b as n,g as r,x as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./doc-browser-B19cYGxa.js";export{e as DocBrowser};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./marketplace-page-B3Q_uKOZ.js";export{e as MarketplacePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./mcp-marketplace-page-D9maE_Sf.js";export{e as McpMarketplacePage};
|