nextclaw 0.19.3 → 0.19.5
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 +4 -7
- package/dist/cli/launcher/index.js +4 -8
- package/dist/nextclaw-distribution.utils-BJZhAnGk.js +17 -0
- package/package.json +18 -18
- package/ui-dist/assets/{api-lwyw9j7i.js → api-BGd3rgv_.js} +5 -5
- package/ui-dist/assets/app-manager-provider-BuJ_U9eC.js +1 -0
- package/ui-dist/assets/{app-navigation.config-DgiR0c5_.js → app-navigation.config-BTdUuqXS.js} +1 -1
- package/ui-dist/assets/{book-open-DgLqYpNY.js → book-open-DDlN5MvX.js} +1 -1
- package/ui-dist/assets/{channels-list-page-Dl839n02.js → channels-list-page-BrwymXPe.js} +2 -2
- package/ui-dist/assets/{chat-DwUf7AKR.js → chat-DGM6K3Qs.js} +5 -5
- package/ui-dist/assets/{chat-page-B-FvPmA7.js → chat-page-DpmXMWNS.js} +1 -1
- package/ui-dist/assets/{chunk-JZWAC4HX-u4uYphxM.js → chunk-JZWAC4HX-Kydj4yEz.js} +1 -1
- package/ui-dist/assets/{config-split-page-BMRGuCJQ.js → config-split-page-DIOCjj2Q.js} +1 -1
- package/ui-dist/assets/{createLucideIcon-BZkY6emz.js → createLucideIcon-BLMK3QUd.js} +1 -1
- package/ui-dist/assets/{desktop-update-config-D5g_gPak.js → desktop-update-config-BGKiqc6q.js} +1 -1
- package/ui-dist/assets/{dialog-CdtCU2xX.js → dialog-dxsKz7jJ.js} +1 -1
- package/ui-dist/assets/{dist-CuqvE--P.js → dist-DsYTOyq7.js} +1 -1
- package/ui-dist/assets/{doc-browser-BUlCkZo2.js → doc-browser-C8FM5fC0.js} +1 -1
- package/ui-dist/assets/doc-browser-RJUOL_GO.js +1 -0
- package/ui-dist/assets/{doc-browser-context-DfLHAWbG.js → doc-browser-context-BJuMaI3o.js} +1 -1
- package/ui-dist/assets/{doc-browser-CzCV73NJ.js → doc-browser-p82AdNO-.js} +1 -1
- package/ui-dist/assets/{es2015-yYU5Ad5w.js → es2015-V75WQJ2s.js} +1 -1
- package/ui-dist/assets/{external-link-Sw3ah_JD.js → external-link-DwfSfTLB.js} +1 -1
- package/ui-dist/assets/{folder-D7-VTnkz.js → folder-CeJKPx5P.js} +1 -1
- package/ui-dist/assets/{hash-zajSTDXZ.js → hash-BqxRTZW5.js} +1 -1
- package/ui-dist/assets/i18n-DnTGDIRw.js +1 -0
- package/ui-dist/assets/{index-Doxyk7L2.js → index-BrEdR78s.js} +2 -2
- package/ui-dist/assets/{key-round-CnI1mc9F.js → key-round-CJ5gDAAG.js} +1 -1
- package/ui-dist/assets/loader-circle-fd-vQKtW.js +1 -0
- package/ui-dist/assets/{logo-badge-BQgKnVtz.js → logo-badge-KAe-7d8c.js} +1 -1
- package/ui-dist/assets/{logos-CqVm0q0W.js → logos-C4sYP1Vl.js} +1 -1
- package/ui-dist/assets/marketplace-page-B2Pm2RDJ.js +1 -0
- package/ui-dist/assets/{marketplace-page-CawcdL6Y.js → marketplace-page-CPHxlYL8.js} +1 -1
- package/ui-dist/assets/mcp-marketplace-page-BcjVmw36.js +1 -0
- package/ui-dist/assets/{mcp-marketplace-page-DEGfJ_70.js → mcp-marketplace-page-CswPXSjf.js} +1 -1
- package/ui-dist/assets/message-square-z_osm9c0.js +1 -0
- package/ui-dist/assets/{model-config-r-1RPSrZ.js → model-config-Cmruiqdx.js} +1 -1
- package/ui-dist/assets/{notice-card-BPtCVEKW.js → notice-card-D1RNsTn_.js} +1 -1
- package/ui-dist/assets/play-Dv6Nr1Ew.js +1 -0
- package/ui-dist/assets/plus-D8eKFY7h.js +1 -0
- package/ui-dist/assets/{popover-jbfQhYQh.js → popover-BMyiifTA.js} +1 -1
- package/ui-dist/assets/{provider-scoped-model-input-gdk2lmRi.js → provider-scoped-model-input-D7ACiMAO.js} +1 -1
- package/ui-dist/assets/{providers-list-DpISIr3M.js → providers-list-gg7LrfuB.js} +1 -1
- package/ui-dist/assets/{refresh-ccw-Bii4w8aB.js → refresh-ccw-ByVwmnN_.js} +1 -1
- package/ui-dist/assets/{refresh-cw-BxojR62w.js → refresh-cw-PcqoYB3K.js} +1 -1
- package/ui-dist/assets/remote-Db2M39Cv.js +1 -0
- package/ui-dist/assets/{rotate-cw-1Xqa7LZ8.js → rotate-cw-BZ2JObNs.js} +1 -1
- package/ui-dist/assets/runtime-config-page-BT_VV41p.js +1 -0
- package/ui-dist/assets/{save--BVI5wZX.js → save-euRxl8pI.js} +1 -1
- package/ui-dist/assets/{search-vChioOoe.js → search-CLd7m0M7.js} +1 -1
- package/ui-dist/assets/{search-config-BWqz8nqY.js → search-config-0VTPpz-w.js} +1 -1
- package/ui-dist/assets/{secrets-config-CjzSNg0Y.js → secrets-config-DwQbLLEy.js} +1 -1
- package/ui-dist/assets/{select-Cw5Zkb1w.js → select-DTdzR8j8.js} +1 -1
- package/ui-dist/assets/{sessions-config-page-beoDPtII.js → sessions-config-page-CAG7Zevv.js} +1 -1
- package/ui-dist/assets/{setting-row-Cjl2d40s.js → setting-row-CvKngoNI.js} +1 -1
- package/ui-dist/assets/{settings-CiRChctQ.js → settings-drbWqzA4.js} +1 -1
- package/ui-dist/assets/skeleton-BK1SOSRA.js +1 -0
- package/ui-dist/assets/{sparkles-D1ZKWdm4.js → sparkles-DVfeSVJQ.js} +1 -1
- package/ui-dist/assets/{status-dot-Dv_hiUVa.js → status-dot-ChvPCib9.js} +1 -1
- package/ui-dist/assets/{tabs-custom-CsACkVji.js → tabs-custom-Hia_ong0.js} +1 -1
- package/ui-dist/assets/{tag-chip-CoWHxYJj.js → tag-chip-BywQeHJj.js} +1 -1
- package/ui-dist/assets/theme-provider-COAwWFv8.js +2 -0
- package/ui-dist/assets/{tooltip-GYzH-Hfq.js → tooltip-BOYp8Ue7.js} +1 -1
- package/ui-dist/assets/{trash-2-rY9ZteZX.js → trash-2-CBsHCfqq.js} +1 -1
- package/ui-dist/assets/{use-config-BhJHD3-G.js → use-config-DTwhNDQE.js} +1 -1
- package/ui-dist/assets/{use-confirm-dialog-Bqgy3Gi-.js → use-confirm-dialog-oeSqhmrx.js} +1 -1
- package/ui-dist/assets/{use-infinite-scroll-loader-BfexitoF.js → use-infinite-scroll-loader-X3KGuME8.js} +1 -1
- package/ui-dist/assets/{use-viewport-layout-D33zVbr5.js → use-viewport-layout-C0NJAVXs.js} +1 -1
- package/ui-dist/assets/x-CM-XDMpk.js +1 -0
- package/ui-dist/index.html +39 -39
- package/dist/package-version.utils-BIAQ3zyy.js +0 -14
- package/ui-dist/assets/app-manager-provider-C0ONQxUg.js +0 -1
- package/ui-dist/assets/doc-browser-Doh2541x.js +0 -1
- package/ui-dist/assets/i18n-C5Mibli1.js +0 -1
- package/ui-dist/assets/loader-circle-B5i8oMMY.js +0 -1
- package/ui-dist/assets/marketplace-page-BRHkZaO5.js +0 -1
- package/ui-dist/assets/mcp-marketplace-page-CL7BF4dD.js +0 -1
- package/ui-dist/assets/message-square-D6Z4NwpG.js +0 -1
- package/ui-dist/assets/play-D8WJLnJe.js +0 -1
- package/ui-dist/assets/plus-Di0KAkiO.js +0 -1
- package/ui-dist/assets/remote-BnRNqMlb.js +0 -1
- package/ui-dist/assets/runtime-config-page-DQ8YY8Lc.js +0 -1
- package/ui-dist/assets/skeleton-CFQRIUzt.js +0 -1
- package/ui-dist/assets/theme-provider-B5XReW_-.js +0 -1
- package/ui-dist/assets/x-DpTzXQcX.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,p as r,u as i}from"./i18n-C5Mibli1.js";import{Ct as a,Dt as o,Et as s,It as c,Mt as l,Tt as u,bt as d,ft as f,ht as p,pt as m,wt as ee,yt as h}from"./api-lwyw9j7i.js";import{r as g}from"./chunk-JZWAC4HX-u4uYphxM.js";import{t as _}from"./createLucideIcon-BZkY6emz.js";import{i as v,n as y,t as b}from"./select-Cw5Zkb1w.js";import{n as x,t as te}from"./refresh-cw-BxojR62w.js";import{t as ne}from"./x-DpTzXQcX.js";import{t as re}from"./use-config-BhJHD3-G.js";import{n as ie,r as ae,t as oe}from"./popover-jbfQhYQh.js";var se=_(`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`}]]),ce=_(`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`}]]),le=_(`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`}]]),ue=_(`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`}]]),de=_(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),fe=_(`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`}]]),pe=_(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),me=_(`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`}]]),S=`nextclaw.ui.theme`,he=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],C=`warm`,w=!1,T=new Set;function E(e){return e===`warm`||e===`cool`}function D(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function O(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(S);if(E(e))return e}catch{}return`warm`}function k(){return w||=(C=O(),D(C),!0),C}function A(){return w?C:k()}function j(e){if(k(),e!==C){if(C=e,D(C),typeof window<`u`)try{window.localStorage.setItem(S,C)}catch{}T.forEach(e=>e(C))}}function M(e){return T.add(e),()=>{T.delete(e)}}var N=r(),P={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 F(){let e=p(),n=e.actionLabel===t(`runtimeStatusRestartAction`),r=async()=>{if(n)try{let e=await h.runRuntimeControlAction(`restart-service`);c.success(e.message)}catch(e){let n=e instanceof Error?e.message:t(`runtimeControlActionFailed`);c.error(`${t(`runtimeControlActionFailed`)}: ${n}`)}};return(0,N.jsxs)(oe,{children:[(0,N.jsx)(ae,{asChild:!0,children:(0,N.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,N.jsx)(`span`,{className:i(`h-2.5 w-2.5 rounded-full`,P[e.tone])})})}),(0,N.jsxs)(ie,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-gray-200 bg-white p-4`,children:[(0,N.jsxs)(`div`,{className:`space-y-1`,children:[(0,N.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:e.title}),(0,N.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description})]}),e.reasonLines.length>0?(0,N.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,N.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,N.jsxs)(`div`,{className:`flex items-center justify-between border-t border-gray-100 pt-1`,children:[(0,N.jsx)(`span`,{className:`text-[11px] text-gray-500`,children:t(`runtimeStatusActionHint`)}),(0,N.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]})]})}var I=e(n(),1);function L({className:e,suffix:t}){let{data:n}=re(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim(),a=i?`v${i}`:null,o=t??(0,N.jsx)(F,{});return(0,N.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,N.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,N.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,N.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,N.jsx)(`span`,{className:`shrink-0 text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),a?(0,N.jsx)(R,{versionLabel:a}):null]}),(0,N.jsx)(ge,{}),o?(0,N.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:o}):null]})]})}function R({versionLabel:e}){let[t,n]=(0,I.useState)(!1);return(0,N.jsxs)(`span`,{className:`relative min-w-0 flex-1`,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),children:[(0,N.jsx)(`span`,{tabIndex:0,"aria-label":e,className:`block min-w-0 truncate text-[13px] font-medium text-gray-500 outline-none`,children:e}),t?(0,N.jsx)(`span`,{className:`pointer-events-none absolute left-0 top-full z-[var(--z-tooltip)] mt-1 w-max max-w-none whitespace-nowrap rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md`,children:e}):null]})}function ge(){let{supported:e,busyAction:n,snapshot:r}=m();return!e||!r?null:r.status===`downloading`||r.status===`blocked`||r.status===`failed`?(0,N.jsx)(_e,{snapshot:r}):r.status===`downloaded`?(0,N.jsx)(`button`,{type:`button`,className:i(`inline-flex h-5 shrink-0 items-center rounded-full px-2 text-[11px] font-semibold leading-none ring-1 transition-colors`,z(r.status)),disabled:n===`applying`,onClick:()=>void f.applyDownloadedUpdate(),children:t(n===`applying`?`desktopUpdatesInlineApplying`:`desktopUpdatesInlineReady`)}):r.status===`update-available`?(0,N.jsx)(`button`,{type:`button`,className:i(`inline-flex h-5 shrink-0 items-center rounded-full px-2 text-[11px] font-semibold leading-none ring-1 transition-colors`,z(r.status)),disabled:n===`downloading`,onClick:()=>void f.downloadUpdate(),children:t(n===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)}):null}function _e({snapshot:e}){let n=ve(e);return n?(0,N.jsx)(`span`,{className:i(`inline-flex h-5 shrink-0 items-center rounded-full px-2 text-[11px] font-semibold leading-none ring-1 transition-colors`,z(e.status)),title:t(`updates`),children:n}):null}function ve(e){if(e.status===`downloading`){let n=e.progress?.percent;return n==null?t(`desktopUpdatesInlineDownloading`):t(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(n))}return e.status===`downloaded`?t(`desktopUpdatesInlineReady`):e.status===`update-available`?t(`desktopUpdatesInlineDownload`):e.status===`blocked`||e.status===`failed`?t(`desktopUpdatesInlineAttention`):null}function z(e){return e===`downloaded`?`bg-emerald-50 text-emerald-700 ring-emerald-100 hover:bg-emerald-100 disabled:opacity-70`:e===`blocked`||e===`failed`?`bg-red-50 text-red-700 ring-red-100`:`bg-amber-50 text-amber-700 ring-amber-100 hover:bg-amber-100 disabled:opacity-70`}var ye={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 B(e){return ye[e]}function be({to:e,label:t,icon:n,density:r=`default`,className:a}){let o=B(r);return(0,N.jsx)(g,{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,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(n,{className:i(o.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function xe({label:e,icon:t,onClick:n,density:r=`default`,className:a,labelClassName:o,trailing:s,trailingClassName:c,testId:l,trailingTestId:u}){let d=B(r);return(0,N.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,N.jsx)(t,{className:i(d.icon,`shrink-0 text-gray-400`)}),(0,N.jsx)(`span`,{className:i(`min-w-0 flex-1 text-left`,o),children:e}),s?(0,N.jsx)(`span`,{className:i(`shrink-0 text-gray-500`,d.value,c),"data-testid":u,children:s}):null]})}function Se({label:e,icon:t,value:n,valueLabel:r,onValueChange:a,density:o=`default`,children:s}){let c=B(o);return(0,N.jsxs)(b,{value:n,onValueChange:a,children:[(0,N.jsxs)(v,{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,N.jsxs)(`div`,{className:i(`flex min-w-0 items-center`,c.gap),children:[(0,N.jsx)(t,{className:i(c.icon,`text-gray-400`)}),(0,N.jsx)(`span`,{className:`text-left`,children:e})]}),(0,N.jsx)(`span`,{className:i(`ml-auto text-gray-500`,c.value),children:r})]}),(0,N.jsx)(y,{children:s})]})}var V=`nextclaw-pwa-install-banner-dismissed`,H=`nextclaw-pwa-install-banner-dismissed-until`;function U(){let e=G();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:we(e):!1}function Ce(){let e=G();e?.setItem(V,`1`),e?.removeItem(H)}function W(){let e=G();e?.removeItem(V),e?.removeItem(H)}function G(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function we(e){let t=e.getItem(H);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(H),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(V,`1`),!0)}function K(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:U(),updateAvailable:!1,registrationFailed:!1}}var q=d(()=>K()),J=`nextclaw-pwa-dev-sw-reset`,Y=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{q.setState({registrationFailed:!0})}}},this.syncUpdateAvailability=async()=>{if(typeof window>`u`||!(`serviceWorker`in navigator)||typeof navigator.serviceWorker.getRegistration!=`function`){q.setState({updateAvailable:!1});return}let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;q.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:q.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(J)===`1`}catch{return!1}},this.setDevResetMarker=()=>{try{window.sessionStorage.setItem(J,`1`)}catch{}},this.clearDevResetMarker=()=>{try{window.sessionStorage.removeItem(J)}catch{}}}},X=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(),q.setState(K())},this.refreshState=()=>{let e=this.resolveInstallability();q.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:U()})),Y.syncUpdateAvailability()},this.dismissInstallPrompt=()=>{Ce(),q.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`?(W(),this.refreshState(),c.success(t(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,W(),q.setState({dismissedInstallPrompt:!0}),c.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 Te(){let e=q(e=>e.installability);return(0,N.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:Ee(e)})}function Ee(e){return t(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function De(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 Oe(){let e=q(e=>e.installability),n=q(e=>e.installMethod),r=q(e=>e.blockedReason);return(0,N.jsxs)(a,{children:[(0,N.jsxs)(s,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(o,{children:t(`pwaInstallTitle`)}),(0,N.jsx)(u,{children:t(`pwaInstallDescription`)})]}),(0,N.jsx)(Te,{})]}),(0,N.jsxs)(ee,{className:`space-y-4`,children:[(0,N.jsx)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50/90 p-4`,children:(0,N.jsx)(`p`,{className:`text-sm leading-6 text-gray-700`,children:De(e,n,r)})}),e===`available`&&n===`prompt`?(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,N.jsxs)(l,{type:`button`,className:`gap-2`,onClick:()=>{X.promptInstall()},children:[(0,N.jsx)(x,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,N.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`pwaInstallPromptHint`)})]}):null,e===`available`&&n===`manual`?(0,N.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl border border-dashed border-gray-300 bg-white p-4`,children:[(0,N.jsx)(pe,{className:`mt-0.5 h-4 w-4 text-gray-500`}),(0,N.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallManualHint`)})]}):null]})]})}function ke(){let e=q(e=>e.installability),n=q(e=>e.installMethod),r=q(e=>e.dismissedInstallPrompt);return e!==`available`||n!==`prompt`||r?null:(0,N.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,N.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`space-y-1`,children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaInstallBannerTitle`)}),(0,N.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallBannerDescription`)})]}),(0,N.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:()=>{X.dismissInstallPrompt()},children:(0,N.jsx)(ne,{className:`h-4 w-4`})})]}),(0,N.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,N.jsxs)(l,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{X.promptInstall()},children:[(0,N.jsx)(x,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,N.jsx)(l,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{X.dismissInstallPrompt()},children:t(`pwaInstallDismiss`)})]})]})}function Z(){let e=q(e=>e.updateAvailable),n=q(e=>e.installability);return!e||n!==`installed`?null:(0,N.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,N.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,N.jsxs)(`div`,{className:`space-y-1`,children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaUpdateBannerTitle`)}),(0,N.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaUpdateBannerDescription`)})]})}),(0,N.jsx)(`div`,{className:`mt-4`,children:(0,N.jsxs)(l,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{Y.applyUpdate()},children:[(0,N.jsx)(te,{className:`h-4 w-4`}),t(`pwaUpdateAction`)]})})]})}var Q=!1;function Ae(){Q||typeof window>`u`||(Q=!0,X.start(),Y.start())}var je={warm:`#F9F8F5`,cool:`#F8FAFB`},Me=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=je[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)}}},$=(0,I.createContext)(null);function Ne({children:e}){let[t,n]=(0,I.useState)(()=>k());(0,I.useEffect)(()=>{Me.syncTheme(t)},[t]),(0,I.useEffect)(()=>M(e=>{n(e)}),[]);let r=(0,I.useCallback)(e=>{j(e),n(A())},[]),i=(0,I.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,N.jsx)($.Provider,{value:i,children:e})}function Pe(){let e=(0,I.useContext)($);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}export{ce as _,Oe as a,be as c,he as d,me as f,le as g,ue as h,ke as i,Se as l,de as m,Pe as n,Z as o,fe as p,Ae as r,xe as s,Ne as t,L as u,se as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-BZkY6emz.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|