nextclaw 0.18.9 → 0.18.10
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 +5 -3
- package/package.json +12 -12
- package/resources/USAGE.md +6 -0
- package/ui-dist/assets/{api-BIg--UMJ.js → api-BurjmW4A.js} +1 -1
- package/ui-dist/assets/{app-manager-provider-BfKiVYea.js → app-manager-provider-DhxUmyTv.js} +1 -1
- package/ui-dist/assets/{app-navigation.config-xIjCAn-R.js → app-navigation.config-Bpd16Pem.js} +1 -1
- package/ui-dist/assets/{book-open-CUd69I2f.js → book-open-CVEuA0y5.js} +1 -1
- package/ui-dist/assets/{channels-list-page-5wQy-UW7.js → channels-list-page-BqhqaBf1.js} +1 -1
- package/ui-dist/assets/{chat-C7Ywus_K.js → chat-D4KecKjB.js} +7 -7
- package/ui-dist/assets/chat-page-Cc7n80lW.js +1 -0
- package/ui-dist/assets/{chunk-JZWAC4HX-THqEFwu9.js → chunk-JZWAC4HX-24FLdHl7.js} +1 -1
- package/ui-dist/assets/{config-split-page-UJSTBsEU.js → config-split-page-BGjVACdO.js} +1 -1
- package/ui-dist/assets/{createLucideIcon-DVAlgDOi.js → createLucideIcon-PPrXCGK8.js} +1 -1
- package/ui-dist/assets/{desktop-update-config-DdVgauFR.js → desktop-update-config-fMLlSStv.js} +1 -1
- package/ui-dist/assets/{dialog-t7OAmObC.js → dialog-CTCX7oLf.js} +1 -1
- package/ui-dist/assets/{dist-DWPNydLC.js → dist-FL5e8mMi.js} +1 -1
- package/ui-dist/assets/{doc-browser-DznuT-CU.js → doc-browser-C02neCIE.js} +1 -1
- package/ui-dist/assets/doc-browser-COj7x090.js +1 -0
- package/ui-dist/assets/{doc-browser-context-zXaTjrpA.js → doc-browser-context-C-WPOji4.js} +1 -1
- package/ui-dist/assets/{doc-browser-t96ibd-b.js → doc-browser-fyn7eDTp.js} +1 -1
- package/ui-dist/assets/{es2015-BRVsmfFO.js → es2015-BNy4R8AC.js} +1 -1
- package/ui-dist/assets/{external-link-D1Xqff6i.js → external-link-BNtqJE01.js} +1 -1
- package/ui-dist/assets/{folder-B_fuaX3x.js → folder-QyJHVUNz.js} +1 -1
- package/ui-dist/assets/{hash-BRvv_UUq.js → hash-BGYUE-zr.js} +1 -1
- package/ui-dist/assets/{i18n-CF_jgT_-.js → i18n-CM4y8Mw9.js} +1 -1
- package/ui-dist/assets/{index-CLxN8vXZ.js → index-CtVSzMPM.js} +2 -2
- package/ui-dist/assets/{key-round-DFVNXZcD.js → key-round-DenCfA2w.js} +1 -1
- package/ui-dist/assets/loader-circle-R23uEPkM.js +1 -0
- package/ui-dist/assets/{logo-badge-CRVKkIl9.js → logo-badge-CKAxvQFc.js} +1 -1
- package/ui-dist/assets/{logos-BVCi_7_I.js → logos-CqXnaJIm.js} +1 -1
- package/ui-dist/assets/{marketplace-page-apq5LpYx.js → marketplace-page-XnDa2ulT.js} +1 -1
- package/ui-dist/assets/marketplace-page-mF-M5mku.js +1 -0
- package/ui-dist/assets/{mcp-marketplace-page-DiqTAdRJ.js → mcp-marketplace-page-BArKWcRZ.js} +1 -1
- package/ui-dist/assets/mcp-marketplace-page-DBUcIIHJ.js +1 -0
- package/ui-dist/assets/message-square-Dm34zD6k.js +1 -0
- package/ui-dist/assets/{model-config-cth12uRn.js → model-config-ByeL6Toe.js} +1 -1
- package/ui-dist/assets/{notice-card-CXY09tsa.js → notice-card-D00-02yg.js} +1 -1
- package/ui-dist/assets/play-ul4L6MWm.js +1 -0
- package/ui-dist/assets/plus-D14303DH.js +1 -0
- package/ui-dist/assets/{popover-CbQxrchk.js → popover-AmJkxio3.js} +1 -1
- package/ui-dist/assets/{provider-scoped-model-input-CZEB2m98.js → provider-scoped-model-input-CfFJsJp-.js} +1 -1
- package/ui-dist/assets/{providers-list-Dsj2BYPm.js → providers-list-HMQzW2WV.js} +1 -1
- package/ui-dist/assets/{refresh-ccw-C-ytTHiq.js → refresh-ccw-B-dhb3yS.js} +1 -1
- package/ui-dist/assets/remote-B4ELSd3u.js +1 -0
- package/ui-dist/assets/{rotate-cw-ClSrRUa0.js → rotate-cw-BWqAG3Fv.js} +1 -1
- package/ui-dist/assets/{runtime-config-page-y8HmA9qr.js → runtime-config-page-N4FP6H0M.js} +1 -1
- package/ui-dist/assets/{save-KxhpE3Zr.js → save-DpdkGieJ.js} +1 -1
- package/ui-dist/assets/{search-Bz3Q64sr.js → search-CQUdr7j_.js} +1 -1
- package/ui-dist/assets/{search-config-C_xRBv_i.js → search-config-B62TY-z2.js} +1 -1
- package/ui-dist/assets/{secrets-config-BOL024Fj.js → secrets-config-YCsGd1am.js} +1 -1
- package/ui-dist/assets/{select-tRTLG4FK.js → select-DVUtSFHZ.js} +1 -1
- package/ui-dist/assets/{sessions-config-page-Ck6nbIFq.js → sessions-config-page-BKN-XdKr.js} +1 -1
- package/ui-dist/assets/{setting-row-DMDgBCC7.js → setting-row-Cb5-lFs-.js} +1 -1
- package/ui-dist/assets/{settings-Cto6z-Ij.js → settings-DgtZZlnF.js} +1 -1
- package/ui-dist/assets/skeleton-BCPi52jT.js +1 -0
- package/ui-dist/assets/{sparkles-xZ74eW0P.js → sparkles-DNSCyDhL.js} +1 -1
- package/ui-dist/assets/{status-dot-Bobpfutv.js → status-dot-X_j51OfA.js} +1 -1
- package/ui-dist/assets/{tabs-custom-C3Mf-NLb.js → tabs-custom-CcWmekaF.js} +1 -1
- package/ui-dist/assets/{tag-chip-BZ14i5b1.js → tag-chip-fdbK2wE6.js} +1 -1
- package/ui-dist/assets/{theme-provider-D6Cgm6i-.js → theme-provider-WTWq_jYq.js} +1 -1
- package/ui-dist/assets/{tooltip-7lsLGcL9.js → tooltip-BkZCQcKw.js} +1 -1
- package/ui-dist/assets/{trash-2-WFSNa5oj.js → trash-2-CqciSCsg.js} +1 -1
- package/ui-dist/assets/{use-config-CXu7dFzw.js → use-config-CyvhbRhf.js} +1 -1
- package/ui-dist/assets/{use-confirm-dialog-Df1SozKw.js → use-confirm-dialog-DSrb9205.js} +1 -1
- package/ui-dist/assets/{use-infinite-scroll-loader-BogRuzgz.js → use-infinite-scroll-loader-DmowtyTI.js} +1 -1
- package/ui-dist/assets/{use-viewport-layout-CWlW5b-T.js → use-viewport-layout-CaALCA51.js} +1 -1
- package/ui-dist/assets/x-tYcSDsrY.js +1 -0
- package/ui-dist/index.html +38 -38
- package/ui-dist/assets/chat-page-DX8OMxQ_.js +0 -1
- package/ui-dist/assets/doc-browser-BIggpN8Z.js +0 -1
- package/ui-dist/assets/loader-circle-DEz3bHGb.js +0 -1
- package/ui-dist/assets/marketplace-page-DVmk8dZk.js +0 -1
- package/ui-dist/assets/mcp-marketplace-page-CskrJuKU.js +0 -1
- package/ui-dist/assets/message-square-CLhDWybk.js +0 -1
- package/ui-dist/assets/play-CnnPm8ca.js +0 -1
- package/ui-dist/assets/plus-CdYMdiws.js +0 -1
- package/ui-dist/assets/remote-DMMC2PSo.js +0 -1
- package/ui-dist/assets/skeleton-BwfJfVK3.js +0 -1
- package/ui-dist/assets/x-BvS2y4e_.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,p as r,u as i}from"./i18n-CF_jgT_-.js";import{At as a,Ct as o,Pt as s,St as c,Tt as l,bt as u,gt as d,wt as ee,xt as te,yt as ne}from"./api-BIg--UMJ.js";import{r as re}from"./chunk-JZWAC4HX-THqEFwu9.js";import{t as f}from"./createLucideIcon-DVAlgDOi.js";import{i as p,n as m,t as h}from"./select-tRTLG4FK.js";import{t as g}from"./x-BvS2y4e_.js";import{t as _}from"./use-config-CXu7dFzw.js";import{n as v,r as ie,t as ae}from"./popover-CbQxrchk.js";var oe=f(`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`}]]),se=f(`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`}]]),ce=f(`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`}]]),y=f(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),le=f(`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`}]]),ue=f(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),de=f(`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`}]]),b=f(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),fe=f(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),pe=f(`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`}]]),x=`nextclaw.ui.theme`,me=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],S=`warm`,C=!1,w=new Set;function T(e){return e===`warm`||e===`cool`}function E(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function D(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(x);if(T(e))return e}catch{}return`warm`}function O(){return C||=(S=D(),E(S),!0),S}function k(){return C?S:O()}function A(e){if(O(),e!==S){if(S=e,E(S),typeof window<`u`)try{window.localStorage.setItem(x,S)}catch{}w.forEach(e=>e(S))}}function j(e){return w.add(e),()=>{w.delete(e)}}var M=r(),N={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 P(){let e=d(),n=e.actionLabel===t(`runtimeStatusRestartAction`),r=async()=>{if(n)try{let e=await ne.runRuntimeControlAction(`restart-service`);s.success(e.message)}catch(e){let n=e instanceof Error?e.message:t(`runtimeControlActionFailed`);s.error(`${t(`runtimeControlActionFailed`)}: ${n}`)}};return(0,M.jsxs)(ae,{children:[(0,M.jsx)(ie,{asChild:!0,children:(0,M.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,M.jsx)(`span`,{className:i(`h-2.5 w-2.5 rounded-full`,N[e.tone])})})}),(0,M.jsxs)(v,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-gray-200 bg-white p-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:e.title}),(0,M.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description})]}),e.reasonLines.length>0?(0,M.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,M.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,M.jsxs)(`div`,{className:`flex items-center justify-between border-t border-gray-100 pt-1`,children:[(0,M.jsx)(`span`,{className:`text-[11px] text-gray-500`,children:t(`runtimeStatusActionHint`)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:e.isBusy,className:`text-sm font-semibold text-sky-600 transition-colors hover:text-sky-700 disabled:text-gray-400`,children:e.isBusy?t(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}function F({className:e,suffix:t}){let{data:n}=_(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim(),a=t??(0,M.jsx)(P,{});return(0,M.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,M.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,M.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,M.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,M.jsx)(`span`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),i?(0,M.jsxs)(`span`,{className:`text-[13px] font-medium text-gray-500`,children:[`v`,i]}):null,a?(0,M.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:a}):null]})]})}var I={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 L(e){return I[e]}function R({to:e,label:t,icon:n,density:r=`default`,className:a}){let o=L(r);return(0,M.jsx)(re,{to:e,className:({isActive:e})=>i(`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`,a),children:({isActive:e})=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(n,{className:i(o.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function z({label:e,icon:t,onClick:n,density:r=`default`,className:a,labelClassName:o,trailing:s,trailingClassName:c,testId:l,trailingTestId:u}){let d=L(r);return(0,M.jsxs)(`button`,{type:`button`,onClick:n,className:i(`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,a),"data-testid":l,children:[(0,M.jsx)(t,{className:i(d.icon,`shrink-0 text-gray-400`)}),(0,M.jsx)(`span`,{className:i(`min-w-0 flex-1 text-left`,o),children:e}),s?(0,M.jsx)(`span`,{className:i(`shrink-0 text-gray-500`,d.value,c),"data-testid":u,children:s}):null]})}function he({label:e,icon:t,value:n,valueLabel:r,onValueChange:a,density:o=`default`,children:s}){let c=L(o);return(0,M.jsxs)(h,{value:n,onValueChange:a,children:[(0,M.jsxs)(p,{className:i(`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,M.jsxs)(`div`,{className:i(`flex min-w-0 items-center`,c.gap),children:[(0,M.jsx)(t,{className:i(c.icon,`text-gray-400`)}),(0,M.jsx)(`span`,{className:`text-left`,children:e})]}),(0,M.jsx)(`span`,{className:i(`ml-auto text-gray-500`,c.value),children:r})]}),(0,M.jsx)(m,{children:s})]})}var B=`nextclaw-pwa-install-banner-dismissed`,V=`nextclaw-pwa-install-banner-dismissed-until`;function H(){let e=W();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:_e(e):!1}function ge(){let e=W();e?.setItem(B,`1`),e?.removeItem(V)}function U(){let e=W();e?.removeItem(B),e?.removeItem(V)}function W(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function _e(e){let t=e.getItem(V);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(V),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(B,`1`),!0)}function G(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:H(),updateAvailable:!1,registrationFailed:!1}}var K=u(()=>G()),q=`nextclaw-pwa-dev-sw-reset`,J=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{K.setState({registrationFailed:!0})}}},this.syncUpdateAvailability=async()=>{if(typeof window>`u`||!(`serviceWorker`in navigator)||typeof navigator.serviceWorker.getRegistration!=`function`){K.setState({updateAvailable:!1});return}let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;K.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:K.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(q)===`1`}catch{return!1}},this.setDevResetMarker=()=>{try{window.sessionStorage.setItem(q,`1`)}catch{}},this.clearDevResetMarker=()=>{try{window.sessionStorage.removeItem(q)}catch{}}}},Y=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(),K.setState(G())},this.refreshState=()=>{let e=this.resolveInstallability();K.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:H()})),J.syncUpdateAvailability()},this.dismissInstallPrompt=()=>{ge(),K.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 n=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,n.outcome===`accepted`?(U(),this.refreshState(),s.success(t(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,U(),K.setState({dismissedInstallPrompt:!0}),s.success(t(`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 ve(){let e=K(e=>e.installability);return(0,M.jsx)(`span`,{className:i(`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:ye(e)})}function ye(e){return t(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function be(e,n,r){return t(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&n===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:r===`insecure-context`?`pwaInstallCardInsecureContext`:r===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function xe(){let e=K(e=>e.installability),n=K(e=>e.installMethod),r=K(e=>e.blockedReason);return(0,M.jsxs)(te,{children:[(0,M.jsxs)(ee,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(l,{children:t(`pwaInstallTitle`)}),(0,M.jsx)(o,{children:t(`pwaInstallDescription`)})]}),(0,M.jsx)(ve,{})]}),(0,M.jsxs)(c,{className:`space-y-4`,children:[(0,M.jsx)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50/90 p-4`,children:(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-700`,children:be(e,n,r)})}),e===`available`&&n===`prompt`?(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,M.jsxs)(a,{type:`button`,className:`gap-2`,onClick:()=>{Y.promptInstall()},children:[(0,M.jsx)(y,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,M.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`pwaInstallPromptHint`)})]}):null,e===`available`&&n===`manual`?(0,M.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl border border-dashed border-gray-300 bg-white p-4`,children:[(0,M.jsx)(fe,{className:`mt-0.5 h-4 w-4 text-gray-500`}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallManualHint`)})]}):null]})]})}function Se(){let e=K(e=>e.installability),n=K(e=>e.installMethod),r=K(e=>e.dismissedInstallPrompt);return e!==`available`||n!==`prompt`||r?null:(0,M.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,M.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaInstallBannerTitle`)}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallBannerDescription`)})]}),(0,M.jsx)(`button`,{type:`button`,"aria-label":t(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{Y.dismissInstallPrompt()},children:(0,M.jsx)(g,{className:`h-4 w-4`})})]}),(0,M.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,M.jsxs)(a,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{Y.promptInstall()},children:[(0,M.jsx)(y,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,M.jsx)(a,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{Y.dismissInstallPrompt()},children:t(`pwaInstallDismiss`)})]})]})}function Ce(){let e=K(e=>e.updateAvailable),n=K(e=>e.installability);return!e||n!==`installed`?null:(0,M.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,M.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaUpdateBannerTitle`)}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaUpdateBannerDescription`)})]})}),(0,M.jsx)(`div`,{className:`mt-4`,children:(0,M.jsxs)(a,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{J.applyUpdate()},children:[(0,M.jsx)(b,{className:`h-4 w-4`}),t(`pwaUpdateAction`)]})})]})}var X=!1;function we(){X||typeof window>`u`||(X=!0,Y.start(),J.start())}var Te={warm:`#F9F8F5`,cool:`#F8FAFB`},Z=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=Te[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)}}},Q=e(n(),1),$=(0,Q.createContext)(null);function Ee({children:e}){let[t,n]=(0,Q.useState)(()=>O());(0,Q.useEffect)(()=>{Z.syncTheme(t)},[t]),(0,Q.useEffect)(()=>j(e=>{n(e)}),[]);let r=(0,Q.useCallback)(e=>{A(e),n(k())},[]),i=(0,Q.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,M.jsx)($.Provider,{value:i,children:e})}function De(){let e=(0,Q.useContext)($);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}export{y as _,xe as a,oe as b,R as c,me as d,pe as f,le as g,ue as h,Se as i,he as l,de as m,De as n,Ce as o,b as p,we as r,z as s,Ee as t,F as u,ce as v,se as y};
|
|
1
|
+
import{_ as e,i as t,m as n,p as r,u as i}from"./i18n-CM4y8Mw9.js";import{At as a,Ct as o,Pt as s,St as c,Tt as l,bt as u,gt as d,wt as ee,xt as te,yt as ne}from"./api-BurjmW4A.js";import{r as re}from"./chunk-JZWAC4HX-24FLdHl7.js";import{t as f}from"./createLucideIcon-PPrXCGK8.js";import{i as p,n as m,t as h}from"./select-DVUtSFHZ.js";import{t as g}from"./x-tYcSDsrY.js";import{t as _}from"./use-config-CyvhbRhf.js";import{n as v,r as ie,t as ae}from"./popover-AmJkxio3.js";var oe=f(`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`}]]),se=f(`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`}]]),ce=f(`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`}]]),y=f(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),le=f(`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`}]]),ue=f(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),de=f(`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`}]]),b=f(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),fe=f(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),pe=f(`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`}]]),x=`nextclaw.ui.theme`,me=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],S=`warm`,C=!1,w=new Set;function T(e){return e===`warm`||e===`cool`}function E(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function D(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(x);if(T(e))return e}catch{}return`warm`}function O(){return C||=(S=D(),E(S),!0),S}function k(){return C?S:O()}function A(e){if(O(),e!==S){if(S=e,E(S),typeof window<`u`)try{window.localStorage.setItem(x,S)}catch{}w.forEach(e=>e(S))}}function j(e){return w.add(e),()=>{w.delete(e)}}var M=r(),N={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 P(){let e=d(),n=e.actionLabel===t(`runtimeStatusRestartAction`),r=async()=>{if(n)try{let e=await ne.runRuntimeControlAction(`restart-service`);s.success(e.message)}catch(e){let n=e instanceof Error?e.message:t(`runtimeControlActionFailed`);s.error(`${t(`runtimeControlActionFailed`)}: ${n}`)}};return(0,M.jsxs)(ae,{children:[(0,M.jsx)(ie,{asChild:!0,children:(0,M.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,M.jsx)(`span`,{className:i(`h-2.5 w-2.5 rounded-full`,N[e.tone])})})}),(0,M.jsxs)(v,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-gray-200 bg-white p-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:e.title}),(0,M.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description})]}),e.reasonLines.length>0?(0,M.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,M.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,M.jsxs)(`div`,{className:`flex items-center justify-between border-t border-gray-100 pt-1`,children:[(0,M.jsx)(`span`,{className:`text-[11px] text-gray-500`,children:t(`runtimeStatusActionHint`)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:e.isBusy,className:`text-sm font-semibold text-sky-600 transition-colors hover:text-sky-700 disabled:text-gray-400`,children:e.isBusy?t(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}function F({className:e,suffix:t}){let{data:n}=_(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim(),a=t??(0,M.jsx)(P,{});return(0,M.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,M.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,M.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,M.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,M.jsx)(`span`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),i?(0,M.jsxs)(`span`,{className:`text-[13px] font-medium text-gray-500`,children:[`v`,i]}):null,a?(0,M.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:a}):null]})]})}var I={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 L(e){return I[e]}function R({to:e,label:t,icon:n,density:r=`default`,className:a}){let o=L(r);return(0,M.jsx)(re,{to:e,className:({isActive:e})=>i(`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`,a),children:({isActive:e})=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(n,{className:i(o.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function z({label:e,icon:t,onClick:n,density:r=`default`,className:a,labelClassName:o,trailing:s,trailingClassName:c,testId:l,trailingTestId:u}){let d=L(r);return(0,M.jsxs)(`button`,{type:`button`,onClick:n,className:i(`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,a),"data-testid":l,children:[(0,M.jsx)(t,{className:i(d.icon,`shrink-0 text-gray-400`)}),(0,M.jsx)(`span`,{className:i(`min-w-0 flex-1 text-left`,o),children:e}),s?(0,M.jsx)(`span`,{className:i(`shrink-0 text-gray-500`,d.value,c),"data-testid":u,children:s}):null]})}function he({label:e,icon:t,value:n,valueLabel:r,onValueChange:a,density:o=`default`,children:s}){let c=L(o);return(0,M.jsxs)(h,{value:n,onValueChange:a,children:[(0,M.jsxs)(p,{className:i(`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,M.jsxs)(`div`,{className:i(`flex min-w-0 items-center`,c.gap),children:[(0,M.jsx)(t,{className:i(c.icon,`text-gray-400`)}),(0,M.jsx)(`span`,{className:`text-left`,children:e})]}),(0,M.jsx)(`span`,{className:i(`ml-auto text-gray-500`,c.value),children:r})]}),(0,M.jsx)(m,{children:s})]})}var B=`nextclaw-pwa-install-banner-dismissed`,V=`nextclaw-pwa-install-banner-dismissed-until`;function H(){let e=W();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:_e(e):!1}function ge(){let e=W();e?.setItem(B,`1`),e?.removeItem(V)}function U(){let e=W();e?.removeItem(B),e?.removeItem(V)}function W(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function _e(e){let t=e.getItem(V);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(V),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(B,`1`),!0)}function G(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:H(),updateAvailable:!1,registrationFailed:!1}}var K=u(()=>G()),q=`nextclaw-pwa-dev-sw-reset`,J=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{K.setState({registrationFailed:!0})}}},this.syncUpdateAvailability=async()=>{if(typeof window>`u`||!(`serviceWorker`in navigator)||typeof navigator.serviceWorker.getRegistration!=`function`){K.setState({updateAvailable:!1});return}let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;K.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:K.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(q)===`1`}catch{return!1}},this.setDevResetMarker=()=>{try{window.sessionStorage.setItem(q,`1`)}catch{}},this.clearDevResetMarker=()=>{try{window.sessionStorage.removeItem(q)}catch{}}}},Y=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(),K.setState(G())},this.refreshState=()=>{let e=this.resolveInstallability();K.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:H()})),J.syncUpdateAvailability()},this.dismissInstallPrompt=()=>{ge(),K.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 n=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,n.outcome===`accepted`?(U(),this.refreshState(),s.success(t(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,U(),K.setState({dismissedInstallPrompt:!0}),s.success(t(`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 ve(){let e=K(e=>e.installability);return(0,M.jsx)(`span`,{className:i(`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:ye(e)})}function ye(e){return t(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function be(e,n,r){return t(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&n===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:r===`insecure-context`?`pwaInstallCardInsecureContext`:r===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function xe(){let e=K(e=>e.installability),n=K(e=>e.installMethod),r=K(e=>e.blockedReason);return(0,M.jsxs)(te,{children:[(0,M.jsxs)(ee,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(l,{children:t(`pwaInstallTitle`)}),(0,M.jsx)(o,{children:t(`pwaInstallDescription`)})]}),(0,M.jsx)(ve,{})]}),(0,M.jsxs)(c,{className:`space-y-4`,children:[(0,M.jsx)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50/90 p-4`,children:(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-700`,children:be(e,n,r)})}),e===`available`&&n===`prompt`?(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,M.jsxs)(a,{type:`button`,className:`gap-2`,onClick:()=>{Y.promptInstall()},children:[(0,M.jsx)(y,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,M.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`pwaInstallPromptHint`)})]}):null,e===`available`&&n===`manual`?(0,M.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl border border-dashed border-gray-300 bg-white p-4`,children:[(0,M.jsx)(fe,{className:`mt-0.5 h-4 w-4 text-gray-500`}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallManualHint`)})]}):null]})]})}function Se(){let e=K(e=>e.installability),n=K(e=>e.installMethod),r=K(e=>e.dismissedInstallPrompt);return e!==`available`||n!==`prompt`||r?null:(0,M.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,M.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaInstallBannerTitle`)}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallBannerDescription`)})]}),(0,M.jsx)(`button`,{type:`button`,"aria-label":t(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{Y.dismissInstallPrompt()},children:(0,M.jsx)(g,{className:`h-4 w-4`})})]}),(0,M.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,M.jsxs)(a,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{Y.promptInstall()},children:[(0,M.jsx)(y,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,M.jsx)(a,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{Y.dismissInstallPrompt()},children:t(`pwaInstallDismiss`)})]})]})}function Ce(){let e=K(e=>e.updateAvailable),n=K(e=>e.installability);return!e||n!==`installed`?null:(0,M.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,M.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaUpdateBannerTitle`)}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaUpdateBannerDescription`)})]})}),(0,M.jsx)(`div`,{className:`mt-4`,children:(0,M.jsxs)(a,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{J.applyUpdate()},children:[(0,M.jsx)(b,{className:`h-4 w-4`}),t(`pwaUpdateAction`)]})})]})}var X=!1;function we(){X||typeof window>`u`||(X=!0,Y.start(),J.start())}var Te={warm:`#F9F8F5`,cool:`#F8FAFB`},Z=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=Te[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)}}},Q=e(n(),1),$=(0,Q.createContext)(null);function Ee({children:e}){let[t,n]=(0,Q.useState)(()=>O());(0,Q.useEffect)(()=>{Z.syncTheme(t)},[t]),(0,Q.useEffect)(()=>j(e=>{n(e)}),[]);let r=(0,Q.useCallback)(e=>{A(e),n(k())},[]),i=(0,Q.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,M.jsx)($.Provider,{value:i,children:e})}function De(){let e=(0,Q.useContext)($);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}export{y as _,xe as a,oe as b,R as c,me as d,pe as f,le as g,ue as h,Se as i,he as l,de as m,De as n,Ce as o,b as p,we as r,z as s,Ee as t,F as u,ce as v,se as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,m as t,p as n,u as r}from"./i18n-
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-CM4y8Mw9.js";import{_ as i,c as a,d as o,f as s,g as c,h as l,i as u,o as d,u as f}from"./es2015-BNy4R8AC.js";import{t as p}from"./dist-FL5e8mMi.js";import{C as m,E as h,S as g,T as _,w as v,x as y}from"./select-DVUtSFHZ.js";var b=e(t(),1),x=n(),[S,C]=l(`Tooltip`,[h]),w=h(),T=`TooltipProvider`,E=700,D=`tooltip.open`,[O,k]=S(T),A=e=>{let{__scopeTooltip:t,delayDuration:n=E,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=b.useRef(!0),s=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,x.jsx)(O,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:b.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};A.displayName=T;var j=`Tooltip`,[ee,M]=S(j),N=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:c,delayDuration:l}=e,u=k(j,e.__scopeTooltip),d=w(t),[f,p]=b.useState(null),m=s(),h=b.useRef(0),g=c??u.disableHoverableContent,v=l??u.delayDuration,y=b.useRef(!1),[S,C]=o({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(D))):u.onClose(),a?.(e)},caller:j}),T=b.useMemo(()=>S?y.current?`delayed-open`:`instant-open`:`closed`,[S]),E=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,C(!0)},[C]),O=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,C(!1)},[C]),A=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,C(!0),h.current=0},v)},[v,C]);return b.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,x.jsx)(_,{...d,children:(0,x.jsx)(ee,{scope:t,contentId:m,open:S,stateAttribute:T,trigger:f,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{u.isOpenDelayedRef.current?A():E()},[u.isOpenDelayedRef,A,E]),onTriggerLeave:b.useCallback(()=>{g?O():(window.clearTimeout(h.current),h.current=0)},[O,g]),onOpen:E,onClose:O,disableHoverableContent:g,children:n})})};N.displayName=j;var P=`TooltipTrigger`,F=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=M(P,n),s=k(P,n),l=w(n),u=c(t,b.useRef(null),o.onTriggerChange),d=b.useRef(!1),f=b.useRef(!1),p=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,x.jsx)(g,{asChild:!0,...l,children:(0,x.jsx)(a.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:i(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:i(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:i(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:i(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:i(e.onBlur,o.onClose),onClick:i(e.onClick,o.onClose)})})});F.displayName=P;var I=`TooltipPortal`,[L,R]=S(I,{forceMount:void 0}),z=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=M(I,t);return(0,x.jsx)(L,{scope:t,forceMount:n,children:(0,x.jsx)(p,{present:n||a.open,children:(0,x.jsx)(u,{asChild:!0,container:i,children:r})})})};z.displayName=I;var B=`TooltipContent`,V=b.forwardRef((e,t)=>{let n=R(B,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=M(B,e.__scopeTooltip);return(0,x.jsx)(p,{present:r||o.open,children:o.disableHoverableContent?(0,x.jsx)(K,{side:i,...a,ref:t}):(0,x.jsx)(H,{side:i,...a,ref:t})})}),H=b.forwardRef((e,t)=>{let n=M(B,e.__scopeTooltip),r=k(B,e.__scopeTooltip),i=b.useRef(null),a=c(t,i),[o,s]=b.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{s(null),f(!1)},[f]),m=b.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=re(r,ne(r,n.getBoundingClientRect())),a=ie(t.getBoundingClientRect());s(oe([...i,...a])),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(l&&d){let e=e=>m(e,d),t=e=>m(e,l);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),b.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!ae(n,o);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,o,u,p]),(0,x.jsx)(K,{...e,ref:a})}),[U,W]=S(j,{isInside:!1}),G=f(`TooltipContent`),K=b.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=M(B,n),l=w(n),{onClose:u}=c;return b.useEffect(()=>(document.addEventListener(D,u),()=>document.removeEventListener(D,u)),[u]),b.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,x.jsx)(d,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,x.jsxs)(v,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,x.jsx)(G,{children:r}),(0,x.jsx)(U,{scope:n,isInside:!0,children:(0,x.jsx)(y,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});V.displayName=B;var q=`TooltipArrow`,te=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=w(n);return W(q,n).isInside?null:(0,x.jsx)(m,{...i,...r,ref:t})});te.displayName=q;function ne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function re(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),se(t)}function se(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var J=A,Y=N,X=F,Z=z,Q=V,ce=J,le=Y,ue=X,$=b.forwardRef(({className:e,sideOffset:t=4,...n},i)=>(0,x.jsx)(Z,{children:(0,x.jsx)(Q,{ref:i,sideOffset:t,className:r(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));$.displayName=Q.displayName;export{Q as a,Y as c,ue as i,X as l,$ as n,Z as o,ce as r,J as s,le as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-PPrXCGK8.js";var t=e(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./i18n-
|
|
1
|
+
import{i as e}from"./i18n-CM4y8Mw9.js";import{$ as t,B as n,F as r,Ft as i,G as a,I as o,It as s,J as c,K as l,L as u,N as d,P as f,Pt as p,Q as m,R as h,U as g,V as _,W as v,X as y,Y as b,Z as x,_ as S,et as C,g as w,h as T,m as E,p as D,q as O,v as k,y as A,z as j,zt as M}from"./api-BurjmW4A.js";function ee(){return s({queryKey:[`config`],queryFn:h,staleTime:3e4,refetchOnWindowFocus:!0})}function N(){return s({queryKey:[`app-meta`],queryFn:u,staleTime:1/0})}function P(){return s({queryKey:[`config-meta`],queryFn:j,staleTime:1/0})}function F(){return s({queryKey:[`config-schema`],queryFn:n,staleTime:1/0})}function I(){let t=M();return i({mutationFn:y,onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),p.success(e(`configSaved`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function L(){let n=M();return i({mutationFn:({data:e})=>t(e),onSuccess:()=>{n.invalidateQueries({queryKey:[`config`]}),n.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function R(){let t=M();return i({mutationFn:({provider:e,data:t})=>x(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSaved`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function z(){let t=M();return i({mutationFn:({data:e})=>d(e??{}),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSaved`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function B(){let t=M();return i({mutationFn:({provider:e})=>r(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSaved`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function V(){return i({mutationFn:({provider:e,data:t})=>c(e,t)})}function H(){return i({mutationFn:({provider:e,data:t})=>O(e,t)})}function U(){return i({mutationFn:({provider:e,data:t})=>v(e,t)})}function W(){return i({mutationFn:({provider:e})=>g(e)})}function G(){let t=M();return i({mutationFn:({channel:e,data:t})=>b(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSavedApplying`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function K(){let t=M();return i({mutationFn:({data:e})=>m(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function q(){let t=M();return i({mutationFn:({data:e})=>C(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function J(){return i({mutationFn:({actionId:e,data:t})=>o(e,t),onError:t=>{p.error(e(`error`)+`: `+t.message)}})}function Y(e){return s({queryKey:[`ncp-sessions`,e?.limit??null],queryFn:()=>k(e),staleTime:5e3,retry:!1})}function X(e,t=200){return s({queryKey:[`ncp-session-messages`,e,t],queryFn:()=>w(e,t),enabled:!!e,staleTime:5e3,retry:!1})}function Z(e){return s({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>S(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,staleTime:5e3,retry:!1})}function Q(){let t=M();return i({mutationFn:({sessionId:e})=>T(e),onSuccess:(n,r)=>{D(t,r.sessionId),t.removeQueries({queryKey:[`ncp-session-messages`,r.sessionId]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function $(){let t=M();return i({mutationFn:({sessionId:e,data:t})=>A(e,t),onSuccess:n=>{E(t,n),t.invalidateQueries({queryKey:[`ncp-session-skills`,n.sessionId]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function te(e={all:!0}){return s({queryKey:[`cron`,e],queryFn:()=>_(e),staleTime:1e4})}function ne(){let t=M();return i({mutationFn:({id:e})=>f(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function re(){let t=M();return i({mutationFn:({id:e,enabled:t})=>l(e,{enabled:t}),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function ie(){let t=M();return i({mutationFn:({id:e,force:t})=>a(e,{force:t}),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}export{R as C,q as E,$ as S,L as T,H as _,z as a,G as b,Q as c,W as d,X as f,ie as g,U as h,F as i,B as l,Y as m,ee as n,te as o,Z as p,P as r,ne as s,N as t,J as u,V as v,K as w,I as x,re as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,p as r}from"./i18n-
|
|
1
|
+
import{_ as e,i as t,m as n,p as r}from"./i18n-CM4y8Mw9.js";import{At as i}from"./api-BurjmW4A.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./dialog-CTCX7oLf.js";var d=e(n(),1),f=r(),p=({open:e,onOpenChange:n,title:r,description:d,confirmLabel:p=t(`confirm`),cancelLabel:m=t(`cancel`),variant:h=`default`,onConfirm:g,onCancel:_})=>(0,f.jsx)(u,{open:e,onOpenChange:n,children:(0,f.jsxs)(s,{className:`[&>:last-child]:hidden`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,f.jsxs)(a,{children:[(0,f.jsx)(c,{children:r}),d?(0,f.jsx)(l,{children:d}):null]}),(0,f.jsxs)(o,{className:`gap-2 sm:gap-0`,children:[(0,f.jsx)(i,{type:`button`,variant:`outline`,onClick:()=>{_(),n(!1)},children:m}),(0,f.jsx)(i,{type:`button`,variant:h===`destructive`?`destructive`:`default`,onClick:()=>{g(),n(!1)},children:p})]})]})}),m={open:!1,title:``,description:``,confirmLabel:t(`confirm`),cancelLabel:t(`cancel`),variant:`default`,resolve:null};function h(){let[e,n]=(0,d.useState)(m),r=(0,d.useCallback)(e=>new Promise(r=>{n({open:!0,title:e.title,description:e.description??``,confirmLabel:e.confirmLabel??t(`confirm`),cancelLabel:e.cancelLabel??t(`cancel`),variant:e.variant??`default`,resolve:e=>{r(e),n(e=>({...e,open:!1,resolve:null}))}})}),[]),i=(0,d.useCallback)(e=>{n(t=>(!e&&t.resolve&&t.resolve(!1),{...t,open:e,resolve:e?t.resolve:null}))},[]);return{confirm:r,ConfirmDialog:(0,d.useCallback)(()=>(0,f.jsx)(p,{open:e.open,onOpenChange:i,title:e.title,description:e.description||void 0,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,variant:e.variant,onConfirm:()=>e.resolve?.(!0),onCancel:()=>e.resolve?.(!1)}),[e,i])}}export{h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,p as r}from"./i18n-
|
|
1
|
+
import{_ as e,i as t,m as n,p as r}from"./i18n-CM4y8Mw9.js";import{Bt as i,Ht as a,Lt as o,Ut as s,Vt as c}from"./api-BurjmW4A.js";import{t as l}from"./createLucideIcon-PPrXCGK8.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-DVUtSFHZ.js";import{t as h}from"./skeleton-BCPi52jT.js";var g=class extends s{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:a()})}getOptimisticResult(e){return e.behavior=a(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:s,isRefetchError:l}=r,u=n.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=a&&u===`forward`,p=s&&u===`backward`,m=a&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:i(t,n.data),hasPreviousPage:c(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:o&&!f&&!m}}};function _(e,t){return o(e,g,t)}var v=l(`PackageSearch`,[[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}],[`circle`,{cx:`18.5`,cy:`15.5`,r:`2.5`,key:`b5zd12`}],[`path`,{d:`M20.27 17.27 22 19`,key:`1l4muz`}]]);function y(e){if(!e||e.pages.length===0)return;let t=e.pages.flatMap(e=>e.items);return{...e.pages[e.pages.length-1],items:t,pages:e.pages,loadedItems:t.length,loadedPages:e.pages.length}}var b=r();function x({scope:e,searchText:n,searchPlaceholder:r,sort:i,onSearchTextChange:a,onSortChange:o}){return(0,b.jsx)(`div`,{className:`mb-4`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,b.jsx)(v,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,b.jsx)(`input`,{value:n,onChange:e=>a(e.target.value),placeholder:r,className:`h-9 w-full rounded-xl border border-gray-200/80 pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/40`})]}),e===`all`&&(0,b.jsxs)(m,{value:i,onValueChange:e=>o(e),children:[(0,b.jsx)(d,{className:`h-9 w-[150px] shrink-0 rounded-lg`,children:(0,b.jsx)(u,{})}),(0,b.jsxs)(f,{children:[(0,b.jsx)(p,{value:`relevance`,children:t(`marketplaceSortRelevance`)}),(0,b.jsx)(p,{value:`updated`,children:t(`marketplaceSortUpdated`)})]})]})]})})}function S({count:e}){return(0,b.jsx)(b.Fragment,{children:Array.from({length:e},(e,t)=>(0,b.jsx)(`article`,{className:`rounded-2xl border border-gray-200/40 bg-white px-5 py-4 shadow-sm`,children:(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3.5`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-3`,children:[(0,b.jsx)(h,{className:`h-10 w-10 shrink-0 rounded-xl`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2 pt-0.5`,children:[(0,b.jsx)(h,{className:`h-4 w-32 max-w-[70%]`}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(h,{className:`h-3 w-12`}),(0,b.jsx)(h,{className:`h-3 w-24`})]}),(0,b.jsx)(h,{className:`h-3 w-full`})]})]}),(0,b.jsx)(h,{className:`h-8 w-20 shrink-0 rounded-xl`})]})},`marketplace-skeleton-${t}`))})}function C({hasMore:e,loading:n,sentinelRef:r}){return!e&&!n?null:(0,b.jsxs)(`div`,{className:`py-4`,children:[e&&(0,b.jsx)(`div`,{ref:r,className:`h-1 w-full`,"aria-hidden":`true`}),n&&(0,b.jsx)(`div`,{"data-testid":`marketplace-loading-more`,className:`pt-3 text-center text-xs text-gray-500`,children:t(`loading`)})]})}function w(e){let t=e.trim().toLowerCase().replace(/_/g,`-`),n=[t,t.split(`-`)[0],`en`];return Array.from(new Set(n.filter(Boolean)))}function T(e){return e.trim().toLowerCase().replace(/_/g,`-`)}function E(e,t,n){if(e){let t=Object.entries(e).map(([e,t])=>({locale:T(e),text:typeof t==`string`?t.trim():``})).filter(e=>e.text.length>0);if(t.length>0){let e=new Map(t.map(e=>[e.locale,e.text]));for(let t of n){let n=T(t),r=e.get(n);if(r)return r}for(let e of n){let n=T(e).split(`-`)[0];if(!n)continue;let r=t.find(e=>e.locale===n||e.locale.startsWith(`${n}-`));if(r)return r.text}return t[0]?.text??``}}return t?.trim()??``}function D(e,t){if(!e)return``;for(let n of t)if(T(n).split(`-`)[0]===`zh`&&e.descriptionZh?.trim())return e.descriptionZh.trim();return e.description?.trim()?e.description.trim():e.descriptionZh?.trim()?e.descriptionZh.trim():``}var O=e(n(),1),k=160;function A(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),r=(0,O.useRef)(e.onLoadMore),i=(0,O.useRef)(!1);return(0,O.useEffect)(()=>{r.current=e.onLoadMore},[e.onLoadMore]),(0,O.useEffect)(()=>{e.disabled&&(i.current=!1)},[e.disabled]),(0,O.useEffect)(()=>{let a=t.current,o=n.current,s=e.thresholdPx??k;if(e.disabled||!a||!o)return;let c=()=>{i.current||e.disabled||(i.current=!0,Promise.resolve(r.current()).finally(()=>{i.current=!1}))},l=()=>{o.getBoundingClientRect().top-a.getBoundingClientRect().bottom<=s&&c()};if(typeof IntersectionObserver==`function`){let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c()},{root:a,rootMargin:`0px 0px ${s}px 0px`});return e.observe(o),l(),()=>{e.disconnect()}}return a.addEventListener(`scroll`,l,{passive:!0}),l(),()=>{a.removeEventListener(`scroll`,l)}},[e.disabled,e.thresholdPx,e.watchValue]),{containerRef:t,sentinelRef:n}}export{x as a,y as c,E as i,_ as l,w as n,C as o,D as r,S as s,A as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,m as t}from"./i18n-
|
|
1
|
+
import{_ as e,m as t}from"./i18n-CM4y8Mw9.js";import{bt as n}from"./api-BurjmW4A.js";function r(e){return typeof e!=`number`||!Number.isFinite(e)?`desktop`:e<=767?`mobile`:`desktop`}function i(){let e=typeof window>`u`?null:window.innerWidth??null;return{mode:r(e),width:e}}var a=n(()=>i()),o=new class{constructor(){this.consumerCount=0,this.started=!1,this.attach=()=>(this.consumerCount+=1,this.consumerCount===1&&this.start(),()=>{this.consumerCount=Math.max(0,this.consumerCount-1),this.consumerCount===0&&this.stop()}),this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`resize`,this.handleViewportChange),window.addEventListener(`orientationchange`,this.handleViewportChange),this.syncFromWindow())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`resize`,this.handleViewportChange),window.removeEventListener(`orientationchange`,this.handleViewportChange),this.started=!1)},this.getSnapshot=()=>a.getState(),this.resetForTests=()=>{this.consumerCount=0,this.stop(),a.setState(i())},this.handleViewportChange=()=>{this.syncFromWindow()},this.syncFromWindow=()=>{if(typeof window>`u`)return;let e=window.innerWidth??null;a.setState({width:e,mode:r(e)})}}},s=e(t(),1);function c(){(0,s.useEffect)(()=>o.attach(),[]);let e=a(e=>e.mode);return{mode:e,isMobile:e===`mobile`,isDesktop:e===`desktop`}}export{o as n,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-PPrXCGK8.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
package/ui-dist/index.html
CHANGED
|
@@ -78,44 +78,44 @@
|
|
|
78
78
|
})();
|
|
79
79
|
</script>
|
|
80
80
|
<title>NextClaw</title>
|
|
81
|
-
<script type="module" crossorigin src="/assets/index-
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/i18n-
|
|
83
|
-
<link rel="modulepreload" crossorigin href="/assets/api-
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/assets/es2015-
|
|
85
|
-
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/select-
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/assets/dialog-
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/popover-
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/tooltip-
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/chunk-JZWAC4HX-
|
|
93
|
-
<link rel="modulepreload" crossorigin href="/assets/use-config-
|
|
94
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-provider-
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/search-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/book-open-
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/external-link-
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/folder-
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/logos-
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/loader-circle-
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/plus-
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/refresh-ccw-
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/settings-
|
|
104
|
-
<link rel="modulepreload" crossorigin href="/assets/sparkles-
|
|
105
|
-
<link rel="modulepreload" crossorigin href="/assets/trash-2-
|
|
106
|
-
<link rel="modulepreload" crossorigin href="/assets/doc-browser-context-
|
|
107
|
-
<link rel="modulepreload" crossorigin href="/assets/doc-browser-
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/doc-browser-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/use-viewport-layout-
|
|
110
|
-
<link rel="modulepreload" crossorigin href="/assets/logo-badge-
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/skeleton-
|
|
112
|
-
<link rel="modulepreload" crossorigin href="/assets/chat-
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/key-round-
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/message-square-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/app-navigation.config-
|
|
116
|
-
<link rel="modulepreload" crossorigin href="/assets/notice-card-
|
|
117
|
-
<link rel="modulepreload" crossorigin href="/assets/status-dot-
|
|
118
|
-
<link rel="modulepreload" crossorigin href="/assets/app-manager-provider-
|
|
81
|
+
<script type="module" crossorigin src="/assets/index-CtVSzMPM.js"></script>
|
|
82
|
+
<link rel="modulepreload" crossorigin href="/assets/i18n-CM4y8Mw9.js">
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/api-BurjmW4A.js">
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/es2015-BNy4R8AC.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-PPrXCGK8.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/select-DVUtSFHZ.js">
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-FL5e8mMi.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/x-tYcSDsrY.js">
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/dialog-CTCX7oLf.js">
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/popover-AmJkxio3.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/tooltip-BkZCQcKw.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-JZWAC4HX-24FLdHl7.js">
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/use-config-CyvhbRhf.js">
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-provider-WTWq_jYq.js">
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/search-CQUdr7j_.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/book-open-CVEuA0y5.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/external-link-BNtqJE01.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/folder-QyJHVUNz.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/logos-CqXnaJIm.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/loader-circle-R23uEPkM.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/plus-D14303DH.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/refresh-ccw-B-dhb3yS.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/settings-DgtZZlnF.js">
|
|
104
|
+
<link rel="modulepreload" crossorigin href="/assets/sparkles-DNSCyDhL.js">
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/trash-2-CqciSCsg.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/doc-browser-context-C-WPOji4.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/doc-browser-fyn7eDTp.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/doc-browser-C02neCIE.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/use-viewport-layout-CaALCA51.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/logo-badge-CKAxvQFc.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/skeleton-BCPi52jT.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/chat-D4KecKjB.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/key-round-DenCfA2w.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/message-square-Dm34zD6k.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/app-navigation.config-Bpd16Pem.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/notice-card-D00-02yg.js">
|
|
117
|
+
<link rel="modulepreload" crossorigin href="/assets/status-dot-X_j51OfA.js">
|
|
118
|
+
<link rel="modulepreload" crossorigin href="/assets/app-manager-provider-DhxUmyTv.js">
|
|
119
119
|
<link rel="stylesheet" crossorigin href="/assets/index-N3hjuljD.css">
|
|
120
120
|
</head>
|
|
121
121
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,n as r,p as i,u as a}from"./i18n-CF_jgT_-.js";import{At as o,Dt as s,Et as c,St as l,kt as u,mt as d,xt as f,yt as p}from"./api-BIg--UMJ.js";import{c as m,l as h,s as g}from"./chunk-JZWAC4HX-THqEFwu9.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./dialog-t7OAmObC.js";import{t as C}from"./createLucideIcon-DVAlgDOi.js";import{b as w,h as T,p as E,y as ee}from"./theme-provider-D6Cgm6i-.js";import{A as D,C as te,D as O,E as k,I as A,L as ne,M as re,O as ie,P as ae,S as oe,T as j,_ as se,a as ce,b as M,c as le,d as N,f as ue,g as P,h as de,i as fe,j as pe,k as me,l as he,m as ge,n as _e,o as ve,p as ye,r as be,s as F,t as xe,u as Se,v as I,w as Ce,x as we,y as Te}from"./chat-C7Ywus_K.js";import{a as L,i as R,n as z,r as B,t as V}from"./select-tRTLG4FK.js";import{i as Ee,n as H,r as De,t as U}from"./provider-scoped-model-input-CZEB2m98.js";import"./mcp-marketplace-page-DiqTAdRJ.js";import{t as Oe}from"./play-CnnPm8ca.js";import{t as W}from"./plus-CdYMdiws.js";import{t as G}from"./sparkles-xZ74eW0P.js";import{t as K}from"./trash-2-WFSNa5oj.js";import{t as q}from"./notice-card-CXY09tsa.js";import{t as ke}from"./use-viewport-layout-CWlW5b-T.js";import{g as Ae,m as je,n as J,o as Me,p as Ne,r as Y,s as Pe,y as Fe}from"./use-config-CXu7dFzw.js";import{t as Ie}from"./index-CLxN8vXZ.js";import{t as Le}from"./tag-chip-BZ14i5b1.js";import{t as X}from"./use-confirm-dialog-Df1SozKw.js";import{t as Re}from"./marketplace-page-apq5LpYx.js";var ze=C(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Be=C(`ShieldCheck`,[[`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`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Z=e(n(),1),Q=i(),$=Z.forwardRef(({className:e,...t},n)=>(0,Q.jsx)(`textarea`,{className:a(`flex min-h-28 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2.5 text-sm text-gray-900 placeholder:text-gray-300 placeholder:font-normal focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/40 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));$.displayName=`Textarea`;var Ve={id:``,displayName:``,description:``,avatar:``,model:``,home:``,runtime:``};function He(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``}}function Ue(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=P(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:I(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function We({value:e,disabled:n=!1,runtimeOptions:r,defaultRuntime:i,onChange:a}){let o=e.trim()?P(e):``,s=Ue({runtimeOptions:r,currentRuntime:e}),c=s.find(e=>e.value===o)??null,l=c?.reasonMessage?.trim()||(c?.ready===!1?t(`agentsRuntimeUnavailableHelp`):``);return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(V,{value:o||i,onValueChange:e=>a(e===i?``:e),disabled:n,children:[(0,Q.jsx)(R,{"aria-label":t(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,Q.jsx)(L,{placeholder:t(`agentsRuntimeSelectPlaceholder`)})}),(0,Q.jsx)(z,{className:`rounded-xl`,children:s.map(e=>(0,Q.jsx)(B,{value:e.value,disabled:e.ready===!1&&e.value!==o,className:`rounded-lg`,children:e.label},e.value))})]}),l?(0,Q.jsx)(`p`,{className:`text-xs text-gray-500`,children:l}):null]})}function Ge({open:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,Q.jsx)(S,{open:e,onOpenChange:a,children:e||t?(0,Q.jsx)(qe,{pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e?`create-open`:`create-closed`):null})}function Ke({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,Q.jsx)(S,{open:e!==null,onOpenChange:a,children:e?(0,Q.jsx)(Je,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function qe(e){let{pending:n,providerCatalog:r,runtimeOptions:i,defaultRuntime:a,onOpenChange:s,onSubmit:c}=e,[l,d]=(0,Z.useState)(Ve);return(0,Q.jsxs)(y,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-[linear-gradient(180deg,#fff9f1_0%,#ffffff_24%)] p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,Q.jsx)(`div`,{className:`shrink-0 border-b border-[#f0e2c8] px-6 py-6`,children:(0,Q.jsxs)(_,{className:`text-left`,children:[(0,Q.jsx)(b,{children:t(`agentsCreateDialogTitle`)}),(0,Q.jsx)(x,{children:t(`agentsCreateDialogDescription`)})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,Q.jsx)(u,{value:l.id,onChange:e=>d(t=>({...t,id:e.target.value})),placeholder:t(`agentsFormIdPlaceholder`)}),(0,Q.jsx)(u,{value:l.displayName,onChange:e=>d(t=>({...t,displayName:e.target.value})),placeholder:t(`agentsFormNamePlaceholder`)}),(0,Q.jsx)($,{value:l.description,onChange:e=>d(t=>({...t,description:e.target.value})),placeholder:t(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,Q.jsx)(u,{value:l.avatar,onChange:e=>d(t=>({...t,avatar:e.target.value})),placeholder:t(`agentsFormAvatarPlaceholder`)}),(0,Q.jsx)(u,{value:l.home,onChange:e=>d(t=>({...t,home:e.target.value})),placeholder:t(`agentsFormHomePlaceholder`)}),(0,Q.jsx)(U,{value:l.model,onChange:e=>d(t=>({...t,model:e})),providerCatalog:r,disabled:n,className:`md:col-span-2`}),(0,Q.jsx)(We,{value:l.runtime,onChange:e=>d(t=>({...t,runtime:e})),runtimeOptions:i,defaultRuntime:a,disabled:n})]}),(0,Q.jsx)(q,{tone:`warning`,title:t(`agentsCreateDialogHint`),className:`text-xs leading-6`})]})}),(0,Q.jsxs)(v,{className:`shrink-0 border-t border-[#f1e7d4] px-6 py-5`,children:[(0,Q.jsx)(o,{type:`button`,variant:`ghost`,onClick:()=>s(!1),disabled:n,children:t(`cancel`)}),(0,Q.jsxs)(o,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>void c(l),disabled:n||l.id.trim().length===0,children:[(0,Q.jsx)(W,{className:`mr-2 h-4 w-4`}),t(`agentsCreateAction`)]})]})]})}function Je(e){let{agent:n,pending:r,providerCatalog:i,runtimeOptions:a,defaultRuntime:s,onOpenChange:c,onSubmit:l}=e,[d,f]=(0,Z.useState)(He(n));return(0,Q.jsxs)(y,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-[linear-gradient(180deg,#fff9f1_0%,#ffffff_24%)] p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,Q.jsx)(`div`,{className:`shrink-0 border-b border-[#f0e2c8] px-6 py-6`,children:(0,Q.jsxs)(_,{className:`text-left`,children:[(0,Q.jsx)(b,{children:t(`agentsEditDialogTitle`)}),(0,Q.jsx)(x,{children:t(`agentsEditDialogDescription`)})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(q,{tone:`warning`,title:t(`agentsEditHomeReadonly`),description:t(`agentsEditHomeReadonlyHint`),children:(0,Q.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:n.workspace??`-`})}),(0,Q.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,Q.jsx)(u,{value:d.displayName,onChange:e=>f(t=>({...t,displayName:e.target.value})),placeholder:t(`agentsFormNamePlaceholder`)}),(0,Q.jsx)($,{value:d.description,onChange:e=>f(t=>({...t,description:e.target.value})),placeholder:t(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,Q.jsx)(u,{value:d.avatar,onChange:e=>f(t=>({...t,avatar:e.target.value})),placeholder:t(`agentsFormAvatarPlaceholder`)}),(0,Q.jsx)(U,{value:d.model,onChange:e=>f(t=>({...t,model:e})),providerCatalog:i,disabled:r,className:`md:col-span-2`}),(0,Q.jsx)(We,{value:d.runtime,onChange:e=>f(t=>({...t,runtime:e})),runtimeOptions:a,defaultRuntime:s,disabled:r})]})]})}),(0,Q.jsxs)(v,{className:`shrink-0 border-t border-[#f1e7d4] px-6 py-5`,children:[(0,Q.jsx)(o,{type:`button`,variant:`ghost`,onClick:()=>c(!1),disabled:r,children:t(`cancel`)}),(0,Q.jsxs)(o,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>l(n.id,d),disabled:r,children:[(0,Q.jsx)(A,{className:`mr-2 h-4 w-4`}),t(`agentsEditSaveAction`)]})]})]})}var Ye=[{strip:`bg-[#efc37a]`,chip:`border-[#f2d7a7] bg-[#fff8eb] text-[#8d5a18]`},{strip:`bg-[#8fd4c0]`,chip:`border-[#bde6da] bg-[#effbf7] text-[#156653]`},{strip:`bg-[#b7c9fb]`,chip:`border-[#d7e2ff] bg-[#f4f7ff] text-[#2d4d8f]`}];function Xe(e,t){return t?{strip:`bg-[#e6b765]`,chip:`border-[#f2d19c] bg-[#fff8ec] text-[#90550d]`}:Ye[e%Ye.length]}function Ze(e){let{agentCount:n,onCreate:r}=e;return(0,Q.jsxs)(`section`,{className:`relative overflow-hidden rounded-[28px] border border-[#f0d6aa] bg-[linear-gradient(135deg,#fff7ea_0%,#fff9f1_32%,#f2fbff_100%)] px-5 py-5 sm:px-6`,children:[(0,Q.jsx)(`div`,{className:`absolute inset-y-0 right-0 w-[46%] bg-[radial-gradient(circle_at_top_right,rgba(255,215,163,0.52),transparent_54%)]`}),(0,Q.jsx)(`div`,{className:`absolute -bottom-10 left-8 h-32 w-32 rounded-full bg-[#ffe6c0]/55 blur-3xl`}),(0,Q.jsxs)(`div`,{className:`relative grid gap-5 xl:grid-cols-[minmax(0,1fr)_320px] xl:items-center`,children:[(0,Q.jsxs)(`div`,{className:`max-w-3xl space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-white/70 bg-white/80 px-3 py-1 text-[11px] font-semibold tracking-[0.16em] text-[#9b6118]`,children:[(0,Q.jsx)(G,{className:`h-3.5 w-3.5`}),t(`agentsHeroEyebrow`)]}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`h1`,{className:`max-w-2xl text-[30px] font-semibold leading-tight tracking-[-0.05em] text-[#2f2212] sm:text-[38px]`,children:t(`agentsHeroTitle`)}),(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-[#6d5841] sm:text-[15px] sm:leading-7`,children:t(`agentsHeroDescription`)})]}),(0,Q.jsx)(`div`,{className:`pt-1`,children:(0,Q.jsxs)(`div`,{className:`inline-flex items-center gap-3 rounded-2xl border border-[#f2d5a4] bg-white/82 px-3 py-2 text-[#7a4d12] shadow-[0_14px_30px_rgba(167,117,47,0.07)]`,children:[(0,Q.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.14em]`,children:t(`agentsOverviewTotal`)}),(0,Q.jsx)(`span`,{className:`text-xl font-semibold tracking-[-0.04em] text-[#1f2937]`,children:n})]})})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-3`,children:[(0,Q.jsxs)(o,{type:`button`,variant:`primary`,className:`h-10 rounded-2xl px-5 text-sm font-semibold`,onClick:r,children:[(0,Q.jsx)(W,{className:`mr-2 h-4 w-4`}),t(`agentsCreateButton`)]}),(0,Q.jsx)(q,{title:t(`agentsCreateDialogHint`),className:`border-white/70 bg-white/72 text-xs leading-6 shadow-[0_18px_40px_rgba(167,117,47,0.08)]`})]})]})]})}function Qe(e){let{agent:n,index:r,runtimeOptions:i,defaultRuntimeLabel:s,updatePending:c,deletePending:u,onStartChat:d,onEdit:p,onDelete:m}=e,h=Xe(r,!!n.builtIn),g=n.runtime?.trim()||n.engine?.trim()||``,_=g?i.find(e=>e.value===P(g))?.label??I(g):s;return(0,Q.jsxs)(f,{className:`overflow-hidden border border-gray-200 bg-white shadow-sm transition-shadow duration-200 hover:shadow-md`,children:[(0,Q.jsx)(`div`,{className:a(`h-1.5 w-full`,h.strip)}),(0,Q.jsxs)(l,{className:`flex h-full flex-col gap-4 px-4 py-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(ae,{agentId:n.id,displayName:n.displayName,avatarUrl:n.avatarUrl,className:`h-11 w-11 shrink-0`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1 pt-0.5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`div`,{className:`truncate text-lg font-semibold tracking-[-0.03em] text-[#1f2937]`,children:n.displayName?.trim()||n.id}),n.builtIn?(0,Q.jsxs)(Le,{tone:`warning`,className:a(`gap-1`,h.chip),children:[(0,Q.jsx)(Be,{className:`h-3 w-3`}),t(`agentsCardBuiltInTag`)]}):null]}),(0,Q.jsxs)(`div`,{className:`text-[11px] font-medium uppercase tracking-[0.18em] text-[#94a3b8]`,children:[`@`,n.id]})]})]}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-[#64748b]`,children:n.description?.trim()||(n.builtIn?t(`agentsCardBuiltInSummary`):t(`agentsCardCustomSummary`))}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-[#94a3b8]`,children:[(0,Q.jsx)(G,{className:`h-3.5 w-3.5`}),t(`agentsCardRuntimeLabel`)]}),(0,Q.jsx)(`div`,{className:`mt-1.5 text-sm leading-6 text-[#475569]`,children:_})]}),(0,Q.jsxs)(`div`,{className:`border-t border-gray-100 pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-[#94a3b8]`,children:[(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`}),t(`agentsCardHomeLabel`)]}),(0,Q.jsx)(`div`,{className:`mt-1.5 break-all text-sm leading-6 text-[#475569]`,children:n.workspace??`-`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(o,{type:`button`,variant:`primary`,className:`h-9 rounded-xl px-4`,onClick:d,children:[(0,Q.jsx)(T,{className:`mr-2 h-4 w-4`}),t(`agentsCardStartChat`)]}),(0,Q.jsxs)(o,{type:`button`,variant:`ghost`,className:`h-8 rounded-xl px-3 text-xs text-[#7b8794] hover:bg-[#f3f4f6] hover:text-[#475569]`,onClick:p,disabled:c,children:[(0,Q.jsx)(A,{className:`mr-1.5 h-3.5 w-3.5`}),t(`agentsEditAction`)]}),n.builtIn?null:(0,Q.jsxs)(o,{type:`button`,variant:`ghost`,className:`h-8 rounded-xl px-3 text-xs text-[#7b8794] hover:bg-[#f3f4f6] hover:text-[#475569]`,onClick:m,disabled:u,children:[(0,Q.jsx)(K,{className:`mr-1.5 h-3.5 w-3.5`}),t(`agentsRemoveAction`)]})]})]})]})]})}function $e(){let e=m(),n=M(),r=J(),i=Y(),a=F(),c=we(),u=te(),d=oe(),[p,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),v=N(e=>e.setSnapshot),y=(0,Z.useMemo)(()=>n.data?.agents??[],[n.data?.agents]),b=(0,Z.useMemo)(()=>[...y].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[y]),x=(0,Z.useMemo)(()=>H({config:r.data,meta:i.data,onlyConfigured:!0}),[i.data,r.data]),S=(0,Z.useMemo)(()=>de(a.data?.options??[]),[a.data?.options]),C=(0,Z.useMemo)(()=>P(a.data?.defaultType??`native`),[a.data?.defaultType]),w=(0,Z.useMemo)(()=>S.find(e=>e.value===C)?.label??I(C),[C,S]),T=async e=>{await c.mutateAsync({data:{id:e.id,...e.displayName.trim()?{displayName:e.displayName.trim()}:{},...e.description.trim()?{description:e.description.trim()}:{},...e.avatar.trim()?{avatar:e.avatar.trim()}:{},...e.home.trim()?{home:e.home.trim()}:{},...e.model.trim()?{model:e.model.trim()}:{},...e.runtime.trim()?{runtime:e.runtime.trim()}:{}}}),h(!1)},E=e=>{_(e)},O=async(e,t)=>{await u.mutateAsync({agentId:e,data:{displayName:t.displayName,description:t.description,avatar:t.avatar,model:t.model,...t.runtime.trim()?{runtime:t.runtime.trim()}:{runtime:``}}}),_(null)},k=t=>{v({selectedAgentId:t.id,selectedSessionKey:null}),D.getState().setSnapshot({pendingSessionType:se(t,C),pendingProjectRoot:null,pendingProjectRootSessionKey:null}),e(`/chat`)};return(0,Q.jsxs)(s,{className:`space-y-5`,children:[(0,Q.jsx)(Ze,{agentCount:y.length,onCreate:()=>h(!0)}),(0,Q.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:n.isLoading?(0,Q.jsx)(f,{className:`md:col-span-2 xl:col-span-3 border-dashed border-[#d9dce3] bg-white/70`,children:(0,Q.jsx)(l,{className:`py-14 text-center text-sm text-gray-500`,children:t(`agentsLoading`)})}):b.length===0?(0,Q.jsx)(f,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-[#d9dce3] bg-[linear-gradient(135deg,#fff7ea_0%,#f4fbff_100%)]`,children:(0,Q.jsxs)(l,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,Q.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-white/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,Q.jsx)(ee,{className:`h-8 w-8 text-[#d39a3b]`})}),(0,Q.jsx)(`div`,{className:`text-lg font-semibold text-[#2f2212]`,children:t(`agentsEmpty`)}),(0,Q.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-[#78644d]`,children:t(`agentsEmptyDescription`)}),(0,Q.jsxs)(o,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:()=>h(!0),children:[(0,Q.jsx)(W,{className:`mr-2 h-4 w-4`}),t(`agentsCreateButton`)]})]})}):b.map((e,t)=>(0,Q.jsx)(Qe,{agent:e,index:t,runtimeOptions:S,defaultRuntimeLabel:w,updatePending:u.isPending,deletePending:d.isPending,onStartChat:()=>k(e),onEdit:()=>E(e),onDelete:()=>d.mutate({agentId:e.id})},e.id))}),(0,Q.jsx)(Ge,{open:p,pending:c.isPending,providerCatalog:x,runtimeOptions:S,defaultRuntime:C,onOpenChange:h,onSubmit:T}),(0,Q.jsx)(Ke,{agent:g,pending:u.isPending,providerCatalog:x,runtimeOptions:S,defaultRuntime:C,onOpenChange:e=>{!e&&!u.isPending&&_(null)},onSubmit:O})]})}function et(e){return r(e??void 0)}function tt(e){return typeof e!=`number`||!Number.isFinite(e)?`-`:r(new Date(e))}function nt(e){if(typeof e!=`number`||!Number.isFinite(e))return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}function rt(e){let t=e.schedule;return t.kind===`cron`?t.expr?`cron ${t.expr}`:`cron`:t.kind===`every`?`every ${nt(t.everyMs)}`:t.kind===`at`?`at ${tt(t.atMs)}`:`-`}function it(e){return e.payload.deliver?`${e.payload.channel??`-`}:${e.payload.to??`-`}`:`-`}function at(e,t){let n=t.trim().toLowerCase();return n?[e.id,e.name,e.payload.message,e.payload.channel??``,e.payload.to??``].join(` `).toLowerCase().includes(n):!0}function ot(e,t){return t===`all`?!0:t===`enabled`?e.enabled:!e.enabled}function st(e){let{job:n,onDelete:r,onRun:i,onToggle:s}=e;return(0,Q.jsx)(f,{className:`border border-gray-200`,children:(0,Q.jsx)(l,{className:`pt-5 pb-5`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-[220px] flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-semibold text-gray-900`,children:n.name||n.id}),(0,Q.jsx)(`span`,{className:`rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-semibold text-gray-500`,children:n.id}),(0,Q.jsx)(`span`,{className:a(`rounded-full px-2 py-0.5 text-[10px] font-semibold`,n.enabled?`bg-emerald-50 text-emerald-700`:`bg-gray-100 text-gray-500`),children:n.enabled?t(`enabled`):t(`disabled`)}),n.deleteAfterRun?(0,Q.jsx)(`span`,{className:`rounded-full bg-amber-50 px-2 py-0.5 text-[10px] font-semibold text-amber-700`,children:t(`cronOneShot`)}):null]}),(0,Q.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[t(`cronScheduleLabel`),`: `,rt(n)]}),(0,Q.jsx)(`div`,{className:`mt-2 whitespace-pre-wrap break-words text-sm text-gray-700`,children:n.payload.message}),(0,Q.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[t(`cronDeliverTo`),`: `,it(n)]})]}),(0,Q.jsxs)(`div`,{className:`min-w-[220px] space-y-2 text-xs text-gray-500`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[t(`cronNextRun`),`:`]}),` `,et(n.state.nextRunAt)]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[t(`cronLastRun`),`:`]}),` `,et(n.state.lastRunAt)]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[t(`cronLastStatus`),`:`]}),` `,n.state.lastStatus??`-`]}),n.state.lastError?(0,Q.jsx)(`div`,{className:`break-words text-[11px] text-red-500`,children:n.state.lastError}):null]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-end gap-2`,children:[(0,Q.jsxs)(o,{variant:`subtle`,size:`sm`,onClick:()=>i(n),className:`gap-1`,children:[(0,Q.jsx)(Oe,{className:`h-3.5 w-3.5`}),t(`cronRunNow`)]}),(0,Q.jsxs)(o,{variant:n.enabled?`outline`:`primary`,size:`sm`,onClick:()=>s(n),className:`gap-1`,children:[(0,Q.jsx)(ze,{className:`h-3.5 w-3.5`}),n.enabled?t(`cronDisable`):t(`cronEnable`)]}),(0,Q.jsxs)(o,{variant:`destructive`,size:`sm`,onClick:()=>r(n),className:`gap-1`,children:[(0,Q.jsx)(K,{className:`h-3.5 w-3.5`}),t(`delete`)]})]})]})})})}function ct(){let[e,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(`all`),l=Me({all:!0}),d=Pe(),f=Fe(),p=Ae(),{confirm:m,ConfirmDialog:h}=X(),g=(0,Z.useMemo)(()=>(l.data?.jobs??[]).filter(t=>at(t,e)).filter(e=>ot(e,r)),[l.data,e,r]),_=async e=>{await m({title:`${t(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:`destructive`,confirmLabel:t(`delete`)})&&d.mutate({id:e.id})},v=async e=>{let n=!e.enabled;await m({title:n?`${t(`cronEnableConfirm`)}?`:`${t(`cronDisableConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:n?`default`:`destructive`,confirmLabel:t(n?`cronEnable`:`cronDisable`)})&&f.mutate({id:e.id,enabled:n})},y=async e=>{let n=!e.enabled;await m({title:n?`${t(`cronRunForceConfirm`)}?`:`${t(`cronRunConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:t(`cronRunNow`)})&&p.mutate({id:e.id,force:n})};return(0,Q.jsxs)(s,{fullHeight:!0,children:[(0,Q.jsx)(c,{title:t(`cronPageTitle`),description:t(`cronPageDescription`),actions:(0,Q.jsx)(o,{variant:`ghost`,size:`icon`,className:`h-9 w-9 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100`,onClick:()=>l.refetch(),children:(0,Q.jsx)(E,{className:a(`h-4 w-4`,l.isFetching&&`animate-spin`)})})}),(0,Q.jsx)(`div`,{className:`mb-6`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center`,children:[(0,Q.jsxs)(`div`,{className:`relative flex-1 min-w-[240px]`,children:[(0,Q.jsx)(u,{value:e,onChange:e=>n(e.target.value),placeholder:t(`cronSearchPlaceholder`),className:`pl-9`}),(0,Q.jsx)(w,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`})]}),(0,Q.jsx)(`div`,{className:`min-w-[180px]`,children:(0,Q.jsxs)(V,{value:r,onValueChange:e=>i(e),children:[(0,Q.jsx)(R,{className:`w-full`,children:(0,Q.jsx)(L,{placeholder:t(`cronStatusLabel`)})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(B,{value:`all`,children:t(`cronStatusAll`)}),(0,Q.jsx)(B,{value:`enabled`,children:t(`cronStatusEnabled`)}),(0,Q.jsx)(B,{value:`disabled`,children:t(`cronStatusDisabled`)})]})]})}),(0,Q.jsxs)(`div`,{className:`text-xs text-gray-500 ml-auto`,children:[t(`cronTotalLabel`),`: `,l.data?.total??0,` / `,g.length]})]})}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-auto custom-scrollbar`,children:l.isLoading?(0,Q.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:t(`cronLoading`)}):g.length===0?(0,Q.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:t(`cronEmpty`)}):(0,Q.jsx)(`div`,{className:`space-y-4`,children:g.map(e=>(0,Q.jsx)(st,{job:e,onDelete:_,onRun:y,onToggle:v},e.id))})}),(0,Q.jsx)(h,{})]})}function lt(e){let{view:t,routeSessionKey:n,selectedSessionKey:r,setSelectedSessionKey:i,selectedSessionKeyRef:a,resetStreamState:o}=e;(0,Z.useEffect)(()=>{if(t===`chat`){if(n){r!==n&&i(n);return}r!==null&&(i(null),o())}},[o,n,r,i,t]),(0,Z.useEffect)(()=>{a.current=r},[r,a])}function ut({view:e,confirmDialog:t}){let{isMobile:n}=ke();return(0,Q.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,Q.jsx)(Se,{}),e===`chat`?n?(0,Q.jsx)(Ie,{}):(0,Q.jsx)(ge,{}):(0,Q.jsx)(`section`,{className:`flex-1 min-h-0 overflow-hidden bg-gradient-to-b from-gray-50/60 to-white`,children:e===`cron`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,Q.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1120px,100%)] px-4 py-4 sm:px-6 sm:py-5`,children:(0,Q.jsx)(ct,{})})}):e===`agents`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,Q.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1180px,100%)] px-4 py-4 sm:px-6 sm:py-5`,children:(0,Q.jsx)($e,{})})}):(0,Q.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,Q.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-[min(1120px,100%)] flex-col px-4 py-4 sm:px-6 sm:py-5`,children:(0,Q.jsx)(Re,{forcedType:`skills`})})})}),t]})}function dt(e,t){return e.filter(e=>ye(e,t))}function ft(e){let{config:t,meta:n}=e;return(0,Z.useMemo)(()=>{let e=H({meta:n,config:t,onlyConfigured:!0}),r=new Set,i=[];for(let t of e)for(let e of t.models){let n=De(t.prefix,e);!n||r.has(n)||(r.add(n),i.push({value:n,modelLabel:e,providerLabel:t.displayName,thinkingCapability:Ee(t.modelThinking,e,t.aliases)}))}return i.sort((e,t)=>{let n=e.providerLabel.localeCompare(t.providerLabel);return n===0?e.modelLabel.localeCompare(t.modelLabel):n})},[t,n])}function pt(e){let{sessions:t,sessionKey:n,sessionType:r}=e;return{recentSessionPreferredModel:(0,Z.useMemo)(()=>xe({sessions:t,selectedSessionKey:n,sessionType:r}),[n,r,t]),recentSessionPreferredThinking:(0,Z.useMemo)(()=>_e({sessions:t,selectedSessionKey:n,sessionType:r}),[n,r,t])}}function mt(e){let{currentSelectedModel:t,modelOptions:n}=e,r=(0,Z.useMemo)(()=>n.find(e=>e.value===t),[t,n]);return{supportedThinkingLevels:(0,Z.useMemo)(()=>r?.thinkingCapability?.supported??[],[r?.thinkingCapability?.supported]),defaultThinkingLevel:(0,Z.useMemo)(()=>r?.thinkingCapability?.default??null,[r?.thinkingCapability?.default])}}function ht(e){let{modelOptions:t,supportedModels:n}=e;if(!n||n.length===0)return t;let r=new Set(n),i=t.filter(e=>r.has(e.value));return i.length>0?i:t}function gt(e){let{currentSelectedModel:t,pendingSessionType:n,projectRootOverride:r,query:i,sessionKey:a,setPendingSessionType:o,setSelectedModel:s,setSelectedThinkingLevel:c}=e,l=J(),u=Y(),d=je({limit:200}),f=F(),p=Ne({sessionId:a,...Object.prototype.hasOwnProperty.call(e,`projectRootOverride`)?{projectRoot:r??null}:{}}),m=(l.isFetched||l.isSuccess)&&(u.isFetched||u.isSuccess),h=ft({config:l.data,meta:u.data}),g=(0,Z.useMemo)(()=>d.data?.sessions??[],[d.data?.sessions]),_=(0,Z.useMemo)(()=>Ce(g),[g]),v=(0,Z.useMemo)(()=>dt(_,i),[_,i]),y=(0,Z.useMemo)(()=>_.find(e=>e.key===a)??null,[_,a]),b=(0,Z.useMemo)(()=>p.data?.records??[],[p.data?.records]),x=Te({selectedSession:y,pendingSessionType:n,setPendingSessionType:o,sessionTypesData:f.data}),S=(0,Z.useMemo)(()=>ht({modelOptions:h,supportedModels:x.selectedSessionTypeOption?.supportedModels}),[h,x.selectedSessionTypeOption?.supportedModels]),{recentSessionPreferredModel:C,recentSessionPreferredThinking:w}=pt({sessions:_,sessionKey:a,sessionType:x.selectedSessionType}),{supportedThinkingLevels:T,defaultThinkingLevel:E}=mt({currentSelectedModel:t,modelOptions:S});return be({modelOptions:S,selectedSessionKey:a,selectedSessionExists:!!y,selectedSessionPreferredModel:y?.preferredModel,fallbackPreferredModel:x.selectedSessionTypeOption?.recommendedModel??C,defaultModel:x.selectedSessionTypeOption?.recommendedModel??l.data?.agents.defaults.model,setSelectedModel:s}),fe({supportedThinkingLevels:T,selectedSessionKey:a,selectedSessionExists:!!y,selectedSessionPreferredThinking:y?.preferredThinking??null,fallbackPreferredThinking:w??null,defaultThinkingLevel:E,setSelectedThinkingLevel:c}),{configQuery:l,configMetaQuery:u,sessionsQuery:d,sessionTypesQuery:f,sessionSkillsQuery:p,isProviderStateResolved:m,modelOptions:S,sessionSummaries:g,sessions:v,skillRecords:b,selectedSession:y,...x}}function _t(e){return e.parentSessionKey?e.sessionSummaries.map(j).filter(t=>t.parentSessionId===e.parentSessionKey).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).map(e=>({sessionKey:e.key,parentSessionKey:e.parentSessionId??null,label:e.label??null,agentId:e.agentId??null})):[]}function vt(e){let{availableAgents:t,parentSessionId:n,selectedAgentId:r,selectedSession:i,selectedSessionType:a,sessionKey:o,sessionSummaries:s,sessionTypeOptions:c}=e,l=i?ue(i):void 0,u=i?.agentId??r,d=t.find(e=>e.id===u)??null,f=(0,Z.useMemo)(()=>{if(!n)return null;let e=s.find(e=>e.sessionId===n)??null;return e?j(e):null},[n,s]),p=c.find(e=>e.value===a)??null;return{currentSessionDisplayName:l,currentAgentId:u,currentAgent:d,parentSession:f,currentSessionTypeLabel:p?.label??I(a),currentSessionTypeIcon:p?.icon??null,currentChildSessionTabs:(0,Z.useMemo)(()=>_t({parentSessionKey:o,sessionSummaries:s}),[o,s])}}function yt(e){(0,Z.useEffect)(()=>{e.presenter.chatInputManager.syncSnapshot({isProviderStateResolved:e.isProviderStateResolved,defaultSessionType:e.defaultSessionType,canStopGeneration:e.canStopCurrentRun,stopDisabledReason:e.stopDisabledReason,stopSupported:!0,stopReason:void 0,sendError:e.lastSendError,isSending:e.isSending,modelOptions:e.modelOptions,sessionTypeOptions:e.sessionTypeOptions,selectedSessionType:e.selectedSessionType,canEditSessionType:e.canEditSessionType,sessionTypeUnavailable:e.sessionTypeUnavailable,skillRecords:e.skillRecords,isSkillsLoading:e.isSkillsLoading}),e.presenter.chatThreadManager.syncSnapshot({isProviderStateResolved:e.isProviderStateResolved,modelOptions:e.modelOptions,sessionTypeUnavailable:e.sessionTypeUnavailable,sessionTypeUnavailableMessage:e.sessionTypeUnavailableMessage,sessionTypeLabel:e.currentSessionTypeLabel,sessionTypeIcon:e.currentSessionTypeIcon,sessionKey:e.sessionKey,agentId:e.currentAgentId,agentDisplayName:e.currentAgent?.displayName??null,agentAvatarUrl:e.currentAgent?.avatarUrl??null,availableAgents:e.availableAgents,sessionDisplayName:e.currentSessionDisplayName,sessionProjectRoot:e.effectiveSessionProjectRoot,sessionProjectName:e.effectiveSessionProjectName,canDeleteSession:!!e.selectedSession,threadRef:e.threadRef,isHistoryLoading:e.agent.isHydrating,messages:e.agent.visibleMessages,isSending:e.isSending,isAwaitingAssistantOutput:e.isAwaitingAssistantOutput,parentSessionKey:e.parentSession?.key??null,parentSessionLabel:e.parentSession?ue(e.parentSession):null,childSessionTabs:e.childSessionTabs})},[e])}function bt(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function xt(e){let t={};e.model?.trim()&&(t.model=e.model.trim(),t.preferred_model=e.model.trim()),e.thinkingLevel?.trim()&&(t.thinking=e.thinkingLevel.trim(),t.preferred_thinking=e.thinkingLevel.trim()),e.sessionType?.trim()&&(t.session_type=e.sessionType.trim(),t.runtime=e.sessionType.trim()),e.agentId?.trim()&&(t.agent_id=e.agentId.trim());let n=O(e.projectRoot);n&&(t.project_root=n);let r=bt(e.requestedSkills);r.length>0&&(t.requested_skill_refs=r);let i=e.composerNodes?me(e.composerNodes):[];return i.length>0&&(t[ie]=i),t}function St(e){let{pendingProjectRoot:t,pendingProjectRootSessionKey:n,sessionKey:r,selectedSessionProjectRoot:i}=e;return t!==null&&n!==null&&r===n&&(i??null)===t}function Ct(e){let t=N(e=>e.snapshot.query),n=N(e=>e.snapshot.selectedSessionKey),r=N(e=>e.snapshot.draftSessionKey),i=N(e=>e.snapshot.selectedAgentId),a=D(e=>e.snapshot.pendingSessionType),o=D(e=>e.snapshot.pendingProjectRoot),s=D(e=>e.snapshot.pendingProjectRootSessionKey),c=D(e=>e.snapshot.selectedModel),l=d(),u=M(),{confirm:f,ConfirmDialog:p}=X(),_=g(),v=m(),{sessionId:y}=h(),b=(0,Z.useRef)(null),x=(0,Z.useRef)(n),S=(0,Z.useMemo)(()=>ve(y),[y]),C=S??n??r,w=o!==null&&s===C,T=gt({query:t,sessionKey:C,projectRootOverride:w?o:void 0,currentSelectedModel:c,pendingSessionType:a,setPendingSessionType:e.chatInputManager.setPendingSessionType,setSelectedModel:e.chatInputManager.setSelectedModel,setSelectedThinkingLevel:e.chatInputManager.setSelectedThinkingLevel});return{presenter:e,selectedSessionKey:n,selectedAgentId:i,pendingProjectRoot:o,pendingProjectRootSessionKey:s,runtimeAvailability:l,agentsQuery:u,confirm:f,ConfirmDialog:p,location:_,navigate:v,threadRef:b,selectedSessionKeyRef:x,routeSessionKey:S,sessionKey:C,hasSessionProjectRootOverride:w,agent:he(C),...T}}function wt(e){let t=Ct(e),{agent:n,agentsQuery:r,hasSessionProjectRootOverride:i,pendingProjectRoot:a,runtimeAvailability:o,selectedAgentId:s,selectedSession:c,selectedSessionType:l,sessionKey:u,sessionSummaries:d,sessionTypeOptions:f}=t,m=i?a:c?.projectRoot??null,h=i?k(m):c?.projectName??k(m),g=n.hydrateError?.message??n.snapshot.error?.message??null,_=o.phase===`ready`&&le(g)?null:g,v=(r.data?.agents?.length??0)>0?r.data?.agents??[]:[{id:c?.agentId??s}],y=vt({sessionKey:u,selectedSession:c,selectedAgentId:s,availableAgents:v,parentSessionId:c?.parentSessionId??null,sessionSummaries:d,selectedSessionType:l,sessionTypeOptions:f});return{...t,availableAgents:v,effectiveSessionProjectRoot:m,effectiveSessionProjectName:h,isSending:n.isSending||n.isRunning,isAwaitingAssistantOutput:n.isRunning,canStopCurrentRun:n.isRunning,stopDisabledReason:n.isRunning?null:`__preparing__`,lastSendError:o.isBlocked?null:o.phase===`ready`?_:p.getDisplayMessage(_),...y}}function Tt(e){let{agent:t,pendingProjectRoot:n,pendingProjectRootSessionKey:r,presenter:i,selectedSession:a,selectedSessionKey:o,selectedSessionKeyRef:s,sessionKey:c}=e;(0,Z.useEffect)(()=>{i.chatStreamActionsManager.bind({sendMessage:async e=>{if(e.sessionKey!==c)return;let o=xt({agentId:e.agentId,model:e.model,thinkingLevel:e.thinkingLevel,sessionType:e.sessionType,projectRoot:e.sessionKey===r?n:a?.projectRoot??null,requestedSkills:e.requestedSkills,composerNodes:e.composerNodes}),s=re({sessionId:e.sessionKey,text:e.message,attachments:e.attachments,parts:e.parts,metadata:o});if(s)try{await t.send(s)}catch(t){throw e.restoreDraftOnError&&(e.composerNodes&&e.composerNodes.length>0?i.chatInputManager.restoreComposerState?.(e.composerNodes,e.attachments??[]):i.chatInputManager.setDraft(t=>t.trim().length===0?e.message:t)),t}},stopCurrentRun:async()=>{await t.abort()},resumeRun:async e=>{e.sessionKey===c&&await t.streamRun()},resetStreamState:()=>{s.current=null},applyHistoryMessages:()=>{}})},[t,n,r,i,o,a?.projectRoot,s,c])}function Et(e){let{pendingProjectRoot:t,pendingProjectRootSessionKey:n,selectedSession:r,selectedSessionKey:i}=e;(0,Z.useEffect)(()=>{!r||!St({pendingProjectRoot:t,pendingProjectRootSessionKey:n,sessionKey:r.key,selectedSessionProjectRoot:r.projectRoot??null})||D.getState().setSnapshot({pendingProjectRoot:null,pendingProjectRootSessionKey:null})},[t,n,r,i])}function Dt(e){let{confirm:t,location:n,navigate:r,presenter:i}=e;(0,Z.useEffect)(()=>{i.chatUiManager.syncState({pathname:n.pathname}),i.chatUiManager.bindActions({navigate:r,confirm:t})},[t,n.pathname,r,i])}function Ot(e){let{presenter:t,selectedAgentId:n,selectedSession:r}=e;(0,Z.useEffect)(()=>{!r?.agentId||n===r.agentId||t.chatSessionListManager.setSelectedAgentId(r.agentId)},[t,n,r?.agentId])}function kt({view:e}){let[t]=(0,Z.useState)(()=>new ce),n=wt(t);return Tt(n),Et(n),Dt(n),Ot(n),lt({view:e,routeSessionKey:n.routeSessionKey,selectedSessionKey:n.selectedSessionKey,setSelectedSessionKey:t.chatSessionListManager.setSelectedSessionKey,selectedSessionKeyRef:n.selectedSessionKeyRef,resetStreamState:t.chatStreamActionsManager.resetStreamState}),yt({presenter:t,isProviderStateResolved:n.isProviderStateResolved,defaultSessionType:n.defaultSessionType,canStopCurrentRun:n.canStopCurrentRun,stopDisabledReason:n.stopDisabledReason,lastSendError:n.lastSendError,isSending:n.isSending,modelOptions:n.modelOptions,sessionTypeOptions:n.sessionTypeOptions,selectedSessionType:n.selectedSessionType,canEditSessionType:n.canEditSessionType,sessionTypeUnavailable:n.sessionTypeUnavailable,skillRecords:n.skillRecords,isSkillsLoading:n.sessionSkillsQuery.isLoading,sessionTypeUnavailableMessage:n.sessionTypeUnavailableMessage,currentSessionTypeLabel:n.currentSessionTypeLabel,currentSessionTypeIcon:n.currentSessionTypeIcon,sessionKey:n.sessionKey,currentAgentId:n.currentAgentId,currentAgent:n.currentAgent,availableAgents:n.availableAgents,currentSessionDisplayName:n.currentSessionDisplayName,effectiveSessionProjectRoot:n.effectiveSessionProjectRoot,effectiveSessionProjectName:n.effectiveSessionProjectName,selectedSession:n.selectedSession,threadRef:n.threadRef,agent:n.agent,isAwaitingAssistantOutput:n.isAwaitingAssistantOutput,parentSession:n.parentSession,childSessionTabs:n.currentChildSessionTabs}),(0,Q.jsx)(pe,{presenter:t,children:(0,Q.jsx)(ut,{view:e,confirmDialog:(0,Q.jsx)(n.ConfirmDialog,{})})})}function At({view:e}){return(0,Q.jsx)(kt,{view:e})}export{At as ChatPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./doc-browser-t96ibd-b.js";export{e as DocBrowser};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DVAlgDOi.js";var t=e(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./marketplace-page-apq5LpYx.js";export{e as MarketplacePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./mcp-marketplace-page-DiqTAdRJ.js";export{e as McpMarketplacePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DVAlgDOi.js";var t=e(`MessageSquare`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DVAlgDOi.js";var t=e(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DVAlgDOi.js";var t=e(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as e}from"./app-manager-provider-BfKiVYea.js";export{e as RemoteAccessPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,u as t}from"./i18n-CF_jgT_-.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{className:t(`animate-pulse rounded-md bg-slate-200`,e),...r})}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DVAlgDOi.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|