@wrongstack/webui 0.303.0 → 0.305.1
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/assets/AgentRosterView-D21dmPj3.js +9 -0
- package/dist/assets/{AnalyticsDashboard-CMs176Dp.js → AnalyticsDashboard-BKW5jxN7.js} +1 -1
- package/dist/assets/{AudienceMemoryPanel-BRXM47H1.js → AudienceMemoryPanel-DvdyvikT.js} +2 -2
- package/dist/assets/ChangesView-BFv5V-2K.js +1 -0
- package/dist/assets/{ChronicleDashboard-DPI_5S2R.js → ChronicleDashboard-BgFFTJ9c.js} +1 -1
- package/dist/assets/CodeEditor-BcB3ieu2.js +1 -0
- package/dist/assets/CodeMap-CnlnHM8P.js +1 -0
- package/dist/assets/{ConfirmModal-DXy17_uy.js → ConfirmModal-BD6pUkAB.js} +1 -1
- package/dist/assets/{CronJobsPanel-C_bGieGQ.js → CronJobsPanel-DzRNjwf_.js} +1 -1
- package/dist/assets/{DeadCodeScanPanel-hkBvamWn.js → DeadCodeScanPanel-Dp6vW6pV.js} +2 -2
- package/dist/assets/{DebugDashboard-CDWJ9nLR.js → DebugDashboard-BvX4wPHr.js} +1 -1
- package/dist/assets/DesignGalleryView-BtH9po91.js +1 -0
- package/dist/assets/GoalView-Dt18_qkp.js +1 -0
- package/dist/assets/KanbanView-CmXysTwU.js +3 -0
- package/dist/assets/MailboxDetailView-B7Rpq-q5.js +1 -0
- package/dist/assets/{MemoryDrawer-D2Yq9oba.js → MemoryDrawer-CQifV69f.js} +1 -1
- package/dist/assets/MemoryManager-52A6Porm.js +1 -0
- package/dist/assets/{ModelPicker-BazB-GbH.js → ModelPicker-BzO5YWvC.js} +1 -1
- package/dist/assets/OfficeMapPanel-B_r043GV.js +4 -0
- package/dist/assets/{ProcessMonitor-BTjaxnO-.js → ProcessMonitor-BXLvlOm5.js} +1 -1
- package/dist/assets/{QueuePanel-BOD9qtHp.js → QueuePanel-BnslTb01.js} +1 -1
- package/dist/assets/{RefreshDebugView-DfbZ-vgF.js → RefreshDebugView-DTO6YlTY.js} +1 -1
- package/dist/assets/RequirementIntakeView-CjEUqwkC.js +1 -0
- package/dist/assets/SageTabs-CZAYUZRL.js +2 -0
- package/dist/assets/{SddFlowGraph-DWphr6Tr.js → SddFlowGraph-B-5J7zOV.js} +1 -1
- package/dist/assets/SddHub-B8uS39mj.js +2 -0
- package/dist/assets/{SessionInspectView-DqrSHseG.js → SessionInspectView-C9f4pdyH.js} +1 -1
- package/dist/assets/SessionList-CiUBVr04.js +1 -0
- package/dist/assets/{SessionsDashboard-CUj2WSYM.js → SessionsDashboard-D-jy0eZl.js} +1 -1
- package/dist/assets/SetupScreen-CfFpbarK.js +1 -0
- package/dist/assets/SkillDetailView-W220T6zf.js +3 -0
- package/dist/assets/{SpecsView-Cl4vpAoL.js → SpecsView-DOTFvg9y.js} +1 -1
- package/dist/assets/{TechStackView-DsFV85XT.js → TechStackView-Bar55FH0.js} +1 -1
- package/dist/assets/{TerminalPanel-GraS3zw1.js → TerminalPanel-BAg6jaIM.js} +1 -1
- package/dist/assets/{Toaster-D76T-Ld4.js → Toaster-Dic3369l.js} +1 -1
- package/dist/assets/{activity-CZIixoel.js → activity-BI4XyF_x.js} +3 -3
- package/dist/assets/{activity-BwEBEQ51.js → activity-Dg9Q9kwt.js} +3 -3
- package/dist/assets/{activity-BnTQWNPX.js → activity-Dr_u3dOm.js} +3 -3
- package/dist/assets/{activity-CRMLR4a3.js → activity-Dzgvt4Nh.js} +3 -3
- package/dist/assets/{activity-Xqrt9v4z.js → activity-IttuV5ar.js} +3 -3
- package/dist/assets/{activity-BLSyJfTr.js → activity-L2_b8Uan.js} +3 -3
- package/dist/assets/{activity-C-9I3_s4.js → activity-gB90peLu.js} +3 -3
- package/dist/assets/{button-ELs5xgtQ.js → button-DvHe5h9X.js} +1 -1
- package/dist/assets/{chat-store-CBJ1gc8n.js → chat-store-RzAVkc8a.js} +2 -2
- package/dist/assets/{codemap-activity-store-D67-genN.js → codemap-activity-store-DBdfN0ix.js} +1 -1
- package/dist/assets/codemap-index-store-45CkVCxN.js +1 -0
- package/dist/assets/{dialog-CfAoIH8P.js → dialog-jbs7gu-q.js} +1 -1
- package/dist/assets/{empty-state-BDwjdvMh.js → empty-state-D-ojp6Gp.js} +1 -1
- package/dist/assets/i18n-nlW2iAya.js +2 -0
- package/dist/assets/{index-DHsJniTZ.css → index-mNf-KFcC.css} +1 -1
- package/dist/assets/index-o8LMiiBK.js +132 -0
- package/dist/assets/{input-DSTQkMEh.js → input-oJ0Gehqp.js} +1 -1
- package/dist/assets/{mailbox-store-CKpkM0H1.js → mailbox-store-BuLRsYu3.js} +1 -1
- package/dist/assets/{roster-ws-a3-SO1Yb.js → roster-ws-DobwmzEj.js} +1 -1
- package/dist/assets/{session-store-Ce4Dck2K.js → session-store-DkPaOIhe.js} +1 -1
- package/dist/assets/{settings-Orwkg3lH.js → settings-4A6zNjep.js} +1 -1
- package/dist/assets/{settings-BlMNd_AC.js → settings-Bq1PPj3V.js} +1 -1
- package/dist/assets/{settings-DyIEVRJT.js → settings-BxL8m0v6.js} +1 -1
- package/dist/assets/{settings-ClpzPWKE.js → settings-CZR4viP9.js} +1 -1
- package/dist/assets/{settings-CyYYbmdR.js → settings-L8hBHrGD.js} +1 -1
- package/dist/assets/{settings-BUtmAZBV.js → settings-t7_uBgp_.js} +1 -1
- package/dist/assets/{settings-XRC0dC9D.js → settings-uLdezc9e.js} +1 -1
- package/dist/assets/{shared-D368RBth.js → shared-CiaNczO0.js} +1 -1
- package/dist/assets/{stores-BATHCuMN.js → stores-liE4mt_C.js} +2 -2
- package/dist/assets/{ui-store-BGNdg1e4.js → ui-store-FVcXVdRC.js} +1 -1
- package/dist/assets/useWebSocket-DZ-NnXn0.js +29 -0
- package/dist/assets/utils-D1fGupR8.js +1 -0
- package/dist/assets/{vendor-GiKfK4Iw.js → vendor-AeHpGMaG.js} +30 -30
- package/dist/assets/{view-navigation-FdnvQSOv.js → view-navigation-D-afwlSZ.js} +1 -1
- package/dist/assets/ws-client-B7j8isQb.js +1 -0
- package/dist/components/KanbanContractGraphPanel.d.ts +6 -1
- package/dist/components/KanbanTaskInspectorChrome.d.ts +62 -0
- package/dist/components/MemoryManager/MemoryDetail.d.ts +1 -1
- package/dist/components/MemoryManager/ReviewQueue.d.ts +25 -0
- package/dist/components/SettingsPanel/ToolsSection.d.ts +1 -0
- package/dist/components/agent-roster-data.d.ts +12 -0
- package/dist/hooks/useWebSocket.d.ts +3 -0
- package/dist/index.html +23 -23
- package/dist/index.js +5488 -4370
- package/dist/lib/kanban-cleaner.d.ts +20 -1
- package/dist/lib/ws-client-actions.d.ts +3 -0
- package/dist/lib/ws-client-utils.d.ts +12 -1
- package/dist/lib/ws-client.d.ts +27 -0
- package/dist/stores/kanban-store.d.ts +4 -1
- package/dist/stores/local-prefs.d.ts +1 -1
- package/dist/stores/session-store.d.ts +2 -0
- package/dist/stores/ui-store.d.ts +3 -3
- package/dist/types/client-message.d.ts +5 -0
- package/dist/types/sage.d.ts +13 -0
- package/dist/types/server-message.d.ts +2 -2
- package/dist/types/system.d.ts +2 -0
- package/package.json +9 -9
- package/dist/assets/AgentRosterView-BnnhSRau.js +0 -9
- package/dist/assets/ChangesView-DxAQY4v4.js +0 -1
- package/dist/assets/CodeEditor-9Fu9hRrw.js +0 -1
- package/dist/assets/CodeMap-B7YGx2G0.js +0 -1
- package/dist/assets/DesignGalleryView-BG-p6kFX.js +0 -1
- package/dist/assets/GoalView-CCklBpTx.js +0 -1
- package/dist/assets/KanbanView-Dzvn9y79.js +0 -3
- package/dist/assets/MailboxDetailView-7dtt5joR.js +0 -1
- package/dist/assets/MemoryManager-CL5AiyKr.js +0 -1
- package/dist/assets/OfficeMapPanel-Dtb75DlY.js +0 -4
- package/dist/assets/RequirementIntakeView-CeZFJlrn.js +0 -1
- package/dist/assets/SageTabs-BlK58zgb.js +0 -2
- package/dist/assets/SddHub-ZRkMmA7e.js +0 -2
- package/dist/assets/SessionList-DLoIKc1b.js +0 -1
- package/dist/assets/SetupScreen-B_2CuLeR.js +0 -1
- package/dist/assets/SkillDetailView-ChspOaAw.js +0 -3
- package/dist/assets/codemap-index-store-ByAYIzQA.js +0 -1
- package/dist/assets/i18n-BvFgJYE2.js +0 -2
- package/dist/assets/index-BTRQG7C5.js +0 -132
- package/dist/assets/useWebSocket-B2opfRwA.js +0 -29
- package/dist/assets/utils-CUCQrODG.js +0 -1
- package/dist/assets/ws-client-CGEB75Dy.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ba as t,Dr as n,Fa as r,Gi as i,Mi as a,On as o,Ot as s,Ra as c,Tn as l,an as u,ar as d,dt as ee,ft as f,jt as te,ka as p,lt as m,on as ne,si as h,vn as re,zi as g,zt as _}from"./vendor-GiKfK4Iw.js";import"./i18n-BvFgJYE2.js";import{t as v}from"./utils-CUCQrODG.js";import"./stores-BATHCuMN.js";import{n as y}from"./ui-store-BGNdg1e4.js";import{r as b}from"./ConfirmModal-DXy17_uy.js";import{b as ie}from"./index-BTRQG7C5.js";var x=e(t(),1),S=m(),ae=10,oe=20,C=e=>{if(!e)return 0;let t=Date.parse(e);return Number.isNaN(t)?0:t},w=e=>(e.iterationCount??0)+(e.toolCallCount??0)+(e.fileChangeCount??0),T=e=>{let t=Date.parse(e);if(Number.isNaN(t))return``;let n=Math.max(0,Date.now()-t);if(n<6e4)return c.t(`common:time.justNow`);if(n<36e5)return c.t(`common:time.minutesAgo`,{count:Math.floor(n/6e4)});if(n<864e5)return c.t(`common:time.hoursAgo`,{count:Math.floor(n/36e5)});let r=Math.floor(n/864e5);return r<7?c.t(`common:time.daysAgo`,{count:r}):new Date(t).toLocaleDateString()},E=e=>e.lastActivityAt??e.endedAt??e.startedAt;function D(e){let t=C(e.startedAt);if(!t)return``;let n=e.isCurrent?Date.now():C(e.endedAt)||t,r=Math.max(0,Math.floor((n-t)/6e4));if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h ${r%60}m`:`${Math.floor(i/24)}d ${i%24}h`}function O(e){return new Intl.NumberFormat(void 0,{notation:e>=1e3?`compact`:`standard`,maximumFractionDigits:1}).format(e)}function se(e){return e.filter(e=>e.tokenTotal===0&&!e.isCurrent).map(e=>e.id)}function ce(e,t){let n=t.query.trim().toLocaleLowerCase(),r=new Set(t.favoriteIds);return[...e.filter(e=>{if(!(!n||[e.name,e.title,e.lastUserMessage,e.model,e.provider,e.id,...Object.keys(e.toolBreakdown??{})].some(e=>e?.toLocaleLowerCase().includes(n))))return!1;switch(t.filter){case`favorites`:return r.has(e.id);case`active`:return e.isCurrent;case`completed`:return!e.isCurrent&&(e.outcome===`completed`||e.outcome===void 0&&!!e.endedAt);case`issues`:return e.outcome===`error`||e.outcome===`timeout`||e.outcome===`aborted`||(e.toolErrorCount??0)>0;default:return!0}})].sort((e,n)=>{if(t.sort===`tokens`&&n.tokenTotal!==e.tokenTotal)return n.tokenTotal-e.tokenTotal;if(t.sort===`activity`){let t=w(n)-w(e);if(t!==0)return t}return C(E(n))-C(E(e))})}function le(e,t,n=Date.now()){let r=new Date(n);r.setHours(0,0,0,0);let i=r.getTime(),a=i-864e5,o=i-6*864e5,s=new Set(t),c=e.filter(e=>s.has(e.id)),l={today:[],yesterday:[],thisWeek:[],earlier:[]};for(let t of e){if(s.has(t.id))continue;let e=C(E(t));e>=i?l.today.push(t):e>=a?l.yesterday.push(t):e>=o?l.thisWeek.push(t):l.earlier.push(t)}let u=[];c.length>0&&u.push({label:`favorites`,rows:c,favorite:!0});for(let e of[`today`,`yesterday`,`thisWeek`,`earlier`])l[e].length>0&&u.push({label:e,rows:l[e]});return u}function ue(e){return e.reduce((e,t)=>({sessions:e.sessions+1,active:e.active+ +!!t.isCurrent,tokens:e.tokens+t.tokenTotal,tools:e.tools+(t.toolCallCount??0),files:e.files+(t.fileChangeCount??0),errors:e.errors+(t.toolErrorCount??0)+ +(t.outcome===`error`)}),{sessions:0,active:0,tokens:0,tools:0,files:0,errors:0})}function de(e){if(e.isCurrent)return{icon:p,label:`active`,defaultLabel:`Active`,className:`text-primary`};switch(e.outcome){case`completed`:return{icon:i,label:`completed`,defaultLabel:`Completed`,className:`text-success`};case`error`:return{icon:s,label:`error`,defaultLabel:`Error`,className:`text-destructive`};case`timeout`:return{icon:a,label:`timeout`,defaultLabel:`Timed out`,className:`text-warning`};case`aborted`:return{icon:g,label:`aborted`,defaultLabel:`Aborted`,className:`text-muted-foreground`};default:return e.endedAt?{icon:i,label:`completed`,defaultLabel:`Completed`,className:`text-success`}:{icon:n,label:`saved`,defaultLabel:`Saved session`,className:`text-muted-foreground`}}}function fe({stats:e}){let{t}=r();return(0,S.jsx)(`div`,{className:`grid grid-cols-2 border-b border-border/75 bg-card md:grid-cols-5`,children:[{label:t(`activity:sessions.stats.sessions`,{defaultValue:`Sessions`}),value:e.sessions,icon:n},{label:t(`activity:sessions.stats.tokens`,{defaultValue:`Tokens`}),value:e.tokens,icon:p},{label:t(`activity:sessions.stats.tools`,{defaultValue:`Tool calls`}),value:e.tools,icon:f},{label:t(`activity:sessions.stats.files`,{defaultValue:`Files changed`}),value:e.files,icon:h},{label:t(`activity:sessions.stats.errors`,{defaultValue:`Errors`}),value:e.errors,icon:s}].map(e=>{let t=e.icon;return(0,S.jsxs)(`div`,{className:`border-b border-r border-border/75 px-4 py-3 md:border-b-0`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground`,children:[(0,S.jsx)(t,{className:`h-3 w-3`}),e.label]}),(0,S.jsx)(`div`,{className:`mt-1 font-mono text-xl font-semibold tabular-nums`,children:O(e.value)})]},e.label)})})}function k({historyQuery:e,setHistoryQuery:t,historyEntries:i,historyLoading:a,historyError:c,wsConnected:p,listSessions:m,resumeSession:g,deleteSession:C,renameSession:w,variant:k=`sidebar`}){let{t:A}=r(),j=y(e=>e.favoriteSessionIds),pe=y(e=>e.toggleFavoriteSession),M=y(e=>e.sessionNicknames),N=y(e=>e.setSessionNickname),me=y(e=>e.setInspectSession),[P,he]=(0,x.useState)(`all`),[F,ge]=(0,x.useState)(`recent`),[I,L]=(0,x.useState)(null),[R,z]=(0,x.useState)(``),[B,V]=(0,x.useState)(null),[H,U]=(0,x.useState)(1),W=(0,x.useRef)(null),G=(0,x.useRef)(null),K=k===`workspace`,q=(0,x.useCallback)(e=>e.name||M[e.id]||e.title||A(`activity:sessions.empty`),[M,A]),J=(0,x.useCallback)(e=>{L(e.id),z(e.name??M[e.id]??e.title??``)},[M]),Y=(0,x.useCallback)(e=>{L(null),N(e,R),w(e,R)},[R,w,N]);(0,x.useEffect)(()=>{B&&i.some(e=>e.id===B&&e.isCurrent)&&(V(null),W.current&&clearTimeout(W.current))},[i,B]),(0,x.useEffect)(()=>{I&&(G.current?.focus(),G.current?.select())},[I]),(0,x.useEffect)(()=>()=>{W.current&&clearTimeout(W.current)},[]);let X=(0,x.useCallback)(e=>{V(e),g(e),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>V(null),1e4)},[g]),Z=(0,x.useMemo)(()=>se(i),[i]),Q=(0,x.useMemo)(()=>ce(i,{query:e,filter:P,sort:F,favoriteIds:j}),[j,P,i,e,F]),$=K?oe:ae,_e=(0,x.useMemo)(()=>Q.slice((H-1)*$,H*$),[H,$,Q]),ve=(0,x.useMemo)(()=>le(_e,j),[j,_e]),ye=(0,x.useMemo)(()=>ue(i),[i]);(0,x.useEffect)(()=>{U(1)},[P,e,F]),(0,x.useEffect)(()=>{let e=Math.max(1,Math.ceil(Q.length/$));H>e&&U(e)},[H,$,Q.length]);let be=(0,x.useCallback)(async()=>{if(Z.length!==0&&await b({title:A(`activity:sessions.deleteEmptyTitle`,{count:Z.length}),message:A(`activity:sessions.deleteEmptyConfirmBody`),confirmLabel:A(`common:action.delete`),danger:!0}))for(let e of Z)C(e)},[C,Z,A]),xe=[{id:`all`,label:A(`activity:sessions.filters.all`,{defaultValue:`All`})},{id:`favorites`,label:A(`activity:sessions.filters.favorites`,{defaultValue:`Pinned`})},{id:`active`,label:A(`activity:sessions.filters.active`,{defaultValue:`Active`})},{id:`completed`,label:A(`activity:sessions.filters.completed`,{defaultValue:`Completed`})},{id:`issues`,label:A(`activity:sessions.filters.issues`,{defaultValue:`Issues`})}];return(0,S.jsxs)(`div`,{className:v(`flex min-h-0 min-w-0 flex-1 flex-col bg-background`,K&&`h-full`),"data-history-variant":k,children:[K?(0,S.jsx)(fe,{stats:ye}):null,(0,S.jsxs)(`div`,{className:v(`border-b border-border/75 bg-card`,K?`px-4 py-3`:`px-3 py-2`),children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:A(`activity:sessions.recentSessions`)}),K?(0,S.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:A(`activity:sessions.workspaceHint`,{defaultValue:`Search, inspect, pin and resume every project conversation.`})}):null]}),(0,S.jsxs)(`div`,{className:`flex shrink-0 items-center border border-border/75`,children:[Z.length>0?(0,S.jsxs)(`button`,{type:`button`,className:`inline-flex h-8 items-center justify-center gap-1 border-r border-border/75 px-2 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:opacity-40`,onClick:be,disabled:!p,title:A(`activity:sessions.deleteEmptyTitle`,{count:Z.length}),children:[(0,S.jsx)(te,{className:`h-3.5 w-3.5`}),K?(0,S.jsx)(`span`,{className:`text-[10px]`,children:Z.length}):null]}):null,(0,S.jsx)(`button`,{type:`button`,className:`inline-flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40`,onClick:()=>m(200),disabled:!p,title:A(`common:action.refresh`),children:a?(0,S.jsx)(d,{className:`h-3.5 w-3.5 animate-spin`}):(0,S.jsx)(re,{className:`h-3.5 w-3.5`})})]})]}),(0,S.jsxs)(`div`,{className:v(`grid gap-2`,K?`mt-3 lg:grid-cols-[minmax(18rem,1fr)_auto_auto]`:`mt-2`),children:[(0,S.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,S.jsx)(u,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,S.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:A(`activity:sessions.filterPlaceholder`),"aria-label":A(`activity:sessions.filterPlaceholder`),className:`h-9 w-full border border-border/75 bg-background pl-8 pr-8 text-xs outline-none transition-colors placeholder:text-muted-foreground/70 focus:border-primary focus:ring-1 focus:ring-primary`}),e?(0,S.jsx)(`button`,{type:`button`,onClick:()=>t(``),className:`absolute right-0 top-0 inline-flex h-9 w-8 items-center justify-center text-muted-foreground hover:text-foreground`,title:A(`activity:sessions.clearFilter`),children:(0,S.jsx)(ee,{className:`h-3.5 w-3.5`})}):null]}),(0,S.jsxs)(`fieldset`,{className:`flex min-w-0 overflow-x-auto border border-border/75`,children:[(0,S.jsx)(`legend`,{className:`sr-only`,children:A(`activity:sessionList.historyFilters`)}),xe.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>he(e.id),"aria-pressed":P===e.id,className:v(`h-9 shrink-0 border-r border-border/75 px-2.5 text-[10px] font-semibold uppercase tracking-[0.08em] transition-colors last:border-r-0`,P===e.id?`bg-foreground text-background`:`bg-background text-muted-foreground hover:bg-muted hover:text-foreground`),children:e.label},e.id))]}),(0,S.jsxs)(`select`,{value:F,onChange:e=>ge(e.target.value),"aria-label":A(`activity:sessions.sort.label`,{defaultValue:`Sort sessions`}),className:`h-9 border border-border/75 bg-background px-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground outline-none focus:border-primary`,children:[(0,S.jsx)(`option`,{value:`recent`,children:A(`activity:sessions.sort.recent`,{defaultValue:`Recent`})}),(0,S.jsx)(`option`,{value:`tokens`,children:A(`activity:sessions.sort.tokens`,{defaultValue:`Most tokens`})}),(0,S.jsx)(`option`,{value:`activity`,children:A(`activity:sessions.sort.activity`,{defaultValue:`Most activity`})})]})]})]}),c?(0,S.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/5 px-4 py-2 text-xs text-destructive`,children:c}):null,(0,S.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain overflow-x-hidden [scrollbar-gutter:stable]`,children:i.length===0&&!a?(0,S.jsxs)(`div`,{className:`flex min-h-56 flex-col items-center justify-center px-4 py-10 text-center text-muted-foreground`,children:[(0,S.jsx)(n,{className:`h-9 w-9 opacity-25`}),(0,S.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:A(`activity:sessions.noHistory`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs`,children:A(`activity:sessions.noHistoryHint`)})]}):ve.length===0?(0,S.jsxs)(`div`,{className:`flex min-h-56 flex-col items-center justify-center px-4 py-10 text-center text-muted-foreground`,children:[(0,S.jsx)(u,{className:`h-9 w-9 opacity-25`}),(0,S.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:A(`activity:sessions.noMatches`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs`,children:A(`activity:sessions.noMatchesHint`)})]}):(0,S.jsxs)(`div`,{className:v(K?`mx-auto w-full max-w-7xl p-4 lg:p-6`:`p-2`),children:[(0,S.jsx)(`div`,{className:v(`space-y-5`,K&&`grid gap-x-5 space-y-0 xl:grid-cols-2`),children:ve.map(e=>(0,S.jsxs)(`section`,{className:`min-w-0`,children:[(0,S.jsxs)(`div`,{className:v(`sticky top-0 z-[1] flex items-center gap-1 border-b border-border/75 bg-background/95 px-1 py-2 text-[10px] font-semibold uppercase tracking-[0.14em] backdrop-blur-sm`,e.favorite?`text-warning`:`text-muted-foreground`),children:[e.favorite?(0,S.jsx)(_,{className:`h-3 w-3 fill-current`}):null,A(`activity:sessions.group.${e.label}`),(0,S.jsx)(`span`,{className:`ml-1 font-mono font-normal text-muted-foreground`,children:e.rows.length})]}),(0,S.jsx)(`div`,{className:`divide-y divide-border/75 border-x border-b border-border/75`,children:e.rows.map(e=>{let t=j.includes(e.id),n=de(e),r=n.icon,i=I===e.id,a=B===e.id;return(0,S.jsxs)(`article`,{className:v(`group grid min-w-0 grid-cols-[minmax(0,1fr)_auto] bg-card transition-colors`,e.isCurrent?`border-l-2 border-l-primary bg-primary/5`:`border-l-2 border-l-transparent hover:bg-muted/45`),"data-session-id":e.id,children:[i?(0,S.jsxs)(`div`,{className:`min-w-0 px-3 py-3`,children:[(0,S.jsx)(`label`,{className:`block text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground`,htmlFor:`session-name-${e.id}`,children:A(`activity:sessions.rename`,{defaultValue:`Session name`})}),(0,S.jsx)(`input`,{ref:G,id:`session-name-${e.id}`,value:R,onChange:e=>z(e.target.value),onBlur:()=>Y(e.id),onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),Y(e.id)):t.key===`Escape`&&(t.preventDefault(),L(null))},placeholder:e.title||A(`activity:sessions.nicknamePlaceholder`),className:`mt-1 h-8 w-full border border-primary bg-background px-2 text-sm outline-none ring-1 ring-primary`})]}):(0,S.jsx)(`button`,{type:`button`,disabled:e.isCurrent||B!==null,onClick:()=>X(e.id),onDoubleClick:()=>J(e),"aria-current":e.isCurrent?`page`:void 0,className:`min-w-0 px-3 py-3 text-left outline-none focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary disabled:cursor-default`,children:(0,S.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,S.jsx)(`span`,{className:v(`mt-0.5 shrink-0`,n.className),title:A(`activity:sessions.status.${n.label}`,{defaultValue:n.defaultLabel}),children:(0,S.jsx)(r,{className:v(`h-3.5 w-3.5`,e.isCurrent&&`animate-pulse`)})}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,title:q(e),children:q(e)}),(0,S.jsxs)(`div`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted-foreground`,children:[e.provider,`/`,e.model]}),e.lastUserMessage?(0,S.jsx)(`div`,{className:`mt-1 truncate text-xs text-muted-foreground`,title:e.lastUserMessage,children:e.lastUserMessage}):null,(0,S.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[10px] text-muted-foreground`,children:[a?(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-sans font-semibold text-primary`,children:[(0,S.jsx)(d,{className:`h-3 w-3 animate-spin`}),A(`activity:sessions.resuming`)]}):(0,S.jsx)(`span`,{title:new Date(E(e)).toLocaleString(),children:T(E(e))}),(0,S.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,S.jsx)(`span`,{children:D(e)}),e.tokenTotal>0?(0,S.jsxs)(`span`,{children:[O(e.tokenTotal),` tok`]}):null,(e.messageCount??0)>0?(0,S.jsxs)(`span`,{children:[O(e.messageCount??0),` msg`]}):null,(e.toolCallCount??0)>0?(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,S.jsx)(f,{className:`h-3 w-3`}),e.toolCallCount]}):null,(e.fileChangeCount??0)>0?(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,S.jsx)(h,{className:`h-3 w-3`}),e.fileChangeCount]}):null,(e.toolErrorCount??0)>0?(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-destructive`,children:[(0,S.jsx)(s,{className:`h-3 w-3`}),e.toolErrorCount]}):null]})]})]})}),(0,S.jsxs)(`div`,{className:`flex items-start gap-0.5 p-2`,children:[!e.isCurrent&&K&&!i?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>X(e.id),disabled:B!==null,className:`inline-flex h-7 items-center gap-1 border border-border/75 px-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground hover:border-primary hover:text-primary disabled:opacity-40`,title:A(`activity:sessions.resume`,{defaultValue:`Resume session`}),children:[(0,S.jsx)(l,{className:`h-3 w-3`}),A(`activity:sessions.resumeShort`,{defaultValue:`Resume`})]}):null,i?null:(0,S.jsx)(`button`,{type:`button`,onClick:()=>me(e.id),className:`inline-flex h-7 w-7 items-center justify-center text-muted-foreground transition-colors hover:bg-primary/10 hover:text-primary`,title:A(`activity:sessions.inspect`,{defaultValue:`Inspect session`}),children:(0,S.jsx)(ne,{className:`h-3.5 w-3.5`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>pe(e.id),"aria-pressed":t,className:v(`inline-flex h-7 w-7 items-center justify-center transition-colors hover:bg-warning/10 hover:text-warning`,t?`text-warning`:`text-muted-foreground`),title:A(t?`activity:sessions.unfavorite`:`activity:sessions.markFavorite`),children:(0,S.jsx)(_,{className:v(`h-3.5 w-3.5`,t&&`fill-current`)})}),i?null:(0,S.jsx)(`button`,{type:`button`,onClick:()=>J(e),className:`inline-flex h-7 w-7 items-center justify-center text-muted-foreground transition-colors hover:bg-primary/10 hover:text-primary`,title:A(`activity:sessions.renameAction`,{defaultValue:`Rename`}),children:(0,S.jsx)(o,{className:`h-3.5 w-3.5`})}),e.isCurrent?null:(0,S.jsx)(`button`,{type:`button`,onClick:async()=>{await b({title:A(`activity:sessions.deleteSessionConfirmTitle`),message:A(`activity:sessions.deleteSessionConfirmBody`,{name:q(e)}),confirmLabel:A(`common:action.delete`),danger:!0})&&C(e.id)},className:`inline-flex h-7 w-7 items-center justify-center text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,title:A(`activity:sessions.deleteSessionTitle`),children:(0,S.jsx)(te,{className:`h-3.5 w-3.5`})})]})]},e.id)})})]},e.label))}),(0,S.jsx)(ie,{page:H,pageSize:$,totalItems:Q.length,onPageChange:U,compact:!K,itemLabel:`sessions`})]})})]})}export{D as i,O as n,T as r,k as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{$i as t,Ba as n,Ci as r,Fa as i,Fr as a,Jt as o,Ma as s,Ra as c,Wt as l,Zi as u,ar as d,ba as f,br as p,ea as m,en as h,fi as g,jr as _,lt as v,t as y,ua as b,vn as x,wn as ee}from"./vendor-GiKfK4Iw.js";import"./i18n-BvFgJYE2.js";import{t as S}from"./useWebSocket-B2opfRwA.js";import{t as C}from"./ws-client-CGEB75Dy.js";import{t as w}from"./utils-CUCQrODG.js";import{I as T}from"./stores-BATHCuMN.js";import{o as E}from"./view-navigation-FdnvQSOv.js";import{n as D}from"./Toaster-D76T-Ld4.js";import{a as O,n as te,o as ne,r as k,t as A}from"./dialog-CfAoIH8P.js";import{t as j}from"./button-ELs5xgtQ.js";import{t as M}from"./input-DSTQkMEh.js";import{D as N,a as P,b as F,i as I,r as L,t as R,x as z}from"./index-BTRQG7C5.js";var B=e(n(),1);function V(e,t=8e3){return new Promise((n,r)=>{let i=setTimeout(()=>{a(),r(Error(`timeout`))},t),a=e.on(`key.operation_result`,e=>{clearTimeout(i),a(),n(e.payload)})})}var H=v();function re({onKeySaved:e}){let{t}=i(),[n,r]=(0,B.useState)(!1),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(`openai-compatible`),[l,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)([]),{setFieldRef:y,handleKeyDown:b}=P(),x=async()=>{if(a.trim()){g(!0);try{let n=C(T.getState().wsUrl),i=V(n);n.send({type:`provider.add`,payload:{id:a.trim(),family:s,baseUrl:l.trim()||void 0,apiKey:p.trim()||void 0,models:_.length>0?_.map(e=>e.id):void 0,customModels:_.length>0?Object.fromEntries(_.filter(e=>e.name||e.maxOutput||e.capabilities).map(e=>[e.id,{...e.name&&e.name!==e.id?{name:e.name}:{},...e.maxOutput?{maxOutput:e.maxOutput}:{},...e.capabilities&&Object.values(e.capabilities).some(Boolean)?{capabilities:e.capabilities}:{}}])):void 0}});let c=await i;if(!c.success)throw Error(c.message);D.success(t(`setup:screen.toasts.providerAdded`,{id:a.trim()})),e(a.trim()),n.listSavedProviders(),n.probeProvider(a.trim()),o(``),f(``),m(``),v([]),r(!1)}catch(e){let n=e instanceof Error&&e.message&&e.message!==`timeout`?e.message:null;D.error(n??t(`setup:screen.toasts.providerAddFailed`))}finally{g(!1)}}};return(0,H.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/60 overflow-hidden`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(!n),className:`w-full flex items-center gap-3 p-4 text-left hover:bg-muted/30 transition-colors`,children:[(0,H.jsx)(`div`,{className:`w-10 h-10 rounded-lg bg-muted/50 flex items-center justify-center`,children:(0,H.jsx)(ee,{className:`h-5 w-5 text-muted-foreground`})}),(0,H.jsxs)(`div`,{className:`flex-1`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-medium`,children:t(`setup:screen.custom.title`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`setup:screen.custom.description`)})]}),(0,H.jsx)(u,{className:w(`h-4 w-4 text-muted-foreground transition-transform`,n&&`rotate-90`)})]}),n&&(0,H.jsxs)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/40`,children:[(0,H.jsxs)(`div`,{className:`space-y-1.5 pt-3`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground block`,children:t(`setup:screen.custom.localServers`)}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:L.map(e=>(0,H.jsx)(j,{type:`button`,size:`sm`,variant:a===e.id?`default`:`outline`,onClick:()=>{o(e.id),c(`openai-compatible`),f(e.defaultBaseUrl),e.noAuth&&m(``),v([])},title:e.hint,children:e.label},e.id))})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.providerId`)}),(0,H.jsx)(M,{placeholder:t(`activity:customProviderSection.eGMyLlm`),value:a,onChange:e=>o(e.target.value),className:`text-sm`,ref:y(0),onKeyDown:e=>b(e,0)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.family`)}),(0,H.jsxs)(`select`,{value:s,onChange:e=>c(e.target.value),className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm`,ref:y(1),onKeyDown:e=>b(e,1),children:[(0,H.jsx)(`option`,{value:`openai-compatible`,children:t(`setup:screen.custom.familyOpenAiCompatible`)}),(0,H.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,H.jsx)(`option`,{value:`anthropic`,children:`Anthropic`}),(0,H.jsx)(`option`,{value:`google`,children:`Google`})]})]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.baseUrl`)}),(0,H.jsx)(M,{placeholder:t(`activity:customProviderSection.eGHttpLocalhost11434V1`),value:l,onChange:e=>f(e.target.value),className:`text-sm font-mono`,ref:y(2),onKeyDown:e=>b(e,2)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.apiKey`)}),(0,H.jsx)(M,{type:`password`,placeholder:t(`setup:screen.custom.apiKeyPlaceholder`),value:p,onChange:e=>m(e.target.value),className:`text-sm font-mono`,ref:y(3),onKeyDown:e=>b(e,3)})]}),(0,H.jsx)(R,{models:_,onChange:v}),(0,H.jsxs)(j,{onClick:x,disabled:!a.trim()||h,size:`sm`,ref:y(4),onKeyDown:e=>b(e,4,x),children:[h?(0,H.jsx)(d,{className:`h-4 w-4 animate-spin mr-2`}):null,t(`setup:screen.custom.add`)]})]})]})}var U=I();async function ie(e,t){try{let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`HTTP ${n.status}`);let r=await n.json();if(!Array.isArray(r))throw Error(`Expected JSON array`);let i=r.filter(e=>typeof e.id==`string`&&typeof e.name==`string`&&typeof e.family==`string`);return i.length>0?i:U}catch{return U}}function ae(e,t){let n=new Date().getTime()-e.getTime(),r=Math.floor(n/1e3);if(r<10)return t(`setup:screen.time.justNow`);if(r<60)return t(`setup:screen.time.secondsAgo`,{count:r});let i=Math.floor(r/60);if(i<60)return t(`setup:screen.time.minutesAgo`,{count:i});let a=Math.floor(i/60);return a<24?t(`setup:screen.time.hoursAgo`,{count:a}):t(`setup:screen.time.daysAgo`,{count:Math.floor(a/24)})}var oe=e(y(),1);function se({popular:e,catalogProvider:n,savedProvider:o,onKeySaved:s,probeResult:c}){let{t:l}=i(),[f,p]=(0,B.useState)(``),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(!!o?.apiKeys.some(e=>e.isActive)),[x,ee]=(0,B.useState)(!1),[S,E]=(0,B.useState)(!1),[N,P]=(0,B.useState)(!1),[F,I]=(0,B.useState)(null);(0,B.useEffect)(()=>{N&&e.referral&&oe.toDataURL(e.referral.url,{width:200,margin:2,color:{dark:`#000000`,light:`#ffffff`}}).then(e=>I(e)).catch(()=>I(null))},[N,e.referral]);let L=async()=>{if(f.trim()){v(!0);try{let t=C(T.getState().wsUrl),r=V(t);n?t.addKey(e.id,`default`,f.trim()):t.send({type:`provider.add`,payload:{id:e.id,family:e.family,apiKey:f.trim()}});let i=await r;if(!i.success)throw Error(i.message);b(!0),p(``),D.success(l(`setup:screen.toasts.keySaved`,{name:e.name})),s(e.id),t.listSavedProviders(),t.probeProvider(e.id)}catch(t){let n=t instanceof Error&&t.message&&t.message!==`timeout`?t.message:null;D.error(n??l(`setup:screen.toasts.keySaveFailed`,{name:e.name}))}finally{v(!1)}}},R=e=>{e.key===`Enter`&&f.trim()&&L()},z=async()=>{if(e.referral)try{await navigator.clipboard.writeText(e.referral.url),E(!0),D.success(l(`setup:screen.toasts.referralCopied`)),setTimeout(()=>E(!1),2e3)}catch{D.error(l(`setup:screen.toasts.referralCopyFailed`))}},re=n&&n.modelCount>0;return(0,H.jsxs)(`div`,{className:w(`rounded-xl border p-4 transition-all`,y?`border-success/30 bg-success/5`:`bg-gradient-to-br ${e.color}`),children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`span`,{className:`text-2xl shrink-0 mt-0.5`,children:e.icon}),(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),y&&(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-success/10 text-success border border-success/20`,children:[(0,H.jsx)(m,{className:`h-2.5 w-2.5`}),l(`setup:screen.card.keySaved`)]}),e.referral&&!y&&(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-warning/10 text-warning border border-warning/20`,children:[(0,H.jsx)(a,{className:`h-2.5 w-2.5`}),l(`setup:screen.card.referral`)]})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e.description}),e.referral&&!y&&(0,H.jsxs)(`p`,{className:`text-[11px] text-warning/80 mt-1`,children:[`🎁 `,e.referral.reward]}),y?y?(0,H.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[o?.baseUrl&&(0,H.jsxs)(`div`,{className:`text-[11px] text-muted-foreground/70 font-mono truncate`,title:o.baseUrl,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[l(`activity:providerKey.url`),` `]}),o.baseUrl]}),o?.models&&o.models.length>0&&(0,H.jsxs)(`div`,{className:`text-[11px] text-muted-foreground/70`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[l(`activity:providerKey.models`),` `]}),o.pickedModelId??o.models[0],(0,H.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[` (+`,o.models.length-1,` more)`]})]}),c===`probing`?(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground mt-1`,children:[(0,H.jsx)(d,{className:`h-3 w-3 animate-spin`}),l(`setup:screen.probe.checking`,`Checking connection…`)]}):c?.ok?(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-success mt-1`,children:[(0,H.jsx)(m,{className:`h-3 w-3`}),(0,H.jsxs)(`span`,{children:[l(`setup:screen.probe.connected`,`Connected`),c.modelCount!=null&&` · ${c.modelCount} ${l(`setup:screen.probe.models`,`models`)}`,c.elapsedMs!=null&&` · ${c.elapsedMs}ms`]})]}):c&&!c.ok?(0,H.jsxs)(`div`,{className:`flex items-start gap-1.5 text-[11px] text-destructive mt-1`,children:[(0,H.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:`✕`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:l(`setup:screen.probe.failed`,`Probe failed`)}),c.status===`no_base_url`&&(0,H.jsx)(`span`,{className:`block text-destructive/70`,children:l(`setup:screen.probe.noBaseUrl`,`No base URL configured`)}),c.status===`unreachable`&&(0,H.jsxs)(`span`,{className:`block text-destructive/70`,children:[l(`setup:screen.probe.unreachable`,`Could not connect`),c.detail?`: ${c.detail}`:``]}),c.status!==`no_base_url`&&c.status!==`unreachable`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`block text-destructive/70`,children:c.httpStatus==null?c.status:`${l(`setup:screen.probe.httpStatus`,`Status`)} ${c.httpStatus}`}),c.detail&&(0,H.jsx)(`span`,{className:`block text-destructive/70 truncate max-w-[250px]`,title:c.detail,children:c.detail})]})]})]}):null,re&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>ee(!x),className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[l(`setup:screen.providers.modelsAvailable`,{count:n?.modelCount??0}),x?(0,H.jsx)(t,{className:`h-3 w-3`}):(0,H.jsx)(u,{className:`h-3 w-3`})]})]}):null:(0,H.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(M,{type:`password`,placeholder:e.keyPlaceholder,value:f,onChange:e=>p(e.target.value),onKeyDown:R,className:`font-mono text-sm`}),(0,H.jsx)(j,{onClick:L,disabled:!f.trim()||_,size:`sm`,className:`shrink-0`,children:_?(0,H.jsx)(d,{className:`h-4 w-4 animate-spin`}):l(`setup:screen.card.save`)})]}),e.docsUrl&&(0,H.jsxs)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors`,children:[l(`setup:screen.card.getKey`),` `,(0,H.jsx)(g,{className:`h-3 w-3`})]}),e.referral&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:z,className:`inline-flex items-center gap-1 text-[11px] text-warning/80 hover:text-warning transition-colors`,children:S?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(m,{className:`h-3 w-3`}),` `,l(`setup:screen.card.copied`)]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(r,{className:`h-3 w-3`}),` `,l(`setup:screen.card.copyReferral`)]})}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>P(!0),className:`inline-flex items-center gap-1 text-[11px] text-warning/80 hover:text-warning transition-colors`,children:[(0,H.jsx)(h,{className:`h-3 w-3`}),` `,l(`setup:screen.card.share`)]})]})]})]})]}),(0,H.jsx)(A,{open:N,onOpenChange:P,children:(0,H.jsxs)(te,{className:`sm:max-w-md`,children:[(0,H.jsxs)(O,{children:[(0,H.jsxs)(ne,{className:`flex items-center gap-2`,children:[(0,H.jsx)(a,{className:`h-4 w-4 text-warning`}),l(`setup:screen.share.title`,{name:e.name})]}),(0,H.jsx)(k,{children:l(`setup:screen.share.description`)})]}),(0,H.jsx)(`div`,{className:`flex flex-col items-center gap-4 py-4`,children:e.referral&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`text-sm text-center`,children:(0,H.jsxs)(`p`,{className:`font-medium text-warning`,children:[`🎁 `,e.referral.reward]})}),F?(0,H.jsx)(`div`,{className:`rounded-lg border border-border p-2 bg-white`,children:(0,H.jsx)(`img`,{src:F,alt:l(`setup:screen.card.qrAlt`,{name:e.name}),className:`w-[200px] h-[200px]`})}):(0,H.jsx)(`div`,{className:`w-[200px] h-[200px] rounded-lg border border-border flex items-center justify-center bg-muted`,children:(0,H.jsx)(d,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),(0,H.jsxs)(`div`,{className:`w-full space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://twitter.com/intent/tweet?text=${t}&url=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.twitter`),children:[(0,H.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,H.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})}),`X`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(e.referral.url),n=encodeURIComponent(`Check out ${e.name}! ${e.referral.reward}`);window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${t}&summary=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.linkedin`),children:[(0,H.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,H.jsx)(`path`,{d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`})}),l(`activity:providerKey.linkedin`)]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward} ${e.referral.url}`);window.open(`https://t.me/share/url?url=${t}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.telegram`),children:[(0,H.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,H.jsx)(`path`,{d:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`})}),l(`activity:providerKey.telegram`)]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://wa.me/?text=${t}%20${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.whatsapp`),children:[(0,H.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,H.jsx)(`path`,{d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.134 1.585 5.934L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z`})}),l(`activity:providerKey.whatsapp`)]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(e.referral.url),n=encodeURIComponent(`${e.name} - ${e.referral.reward}`);window.open(`https://www.reddit.com/submit?url=${t}&title=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.reddit`),children:[(0,H.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,H.jsx)(`path`,{d:`M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 0 1.108-.701 1.25 1.25 0 0 1 2.144.33zm-8.811 8.748c-.968 0-1.754.786-1.754 1.754 0 .968.786 1.754 1.754 1.754.968 0 1.754-.786 1.754-1.754 0-.968-.786-1.754-1.754-1.754zm7.944 0c-.968 0-1.754.786-1.754 1.754 0 .968.786 1.754 1.754 1.754.968 0 1.754-.786 1.754-1.754 0-.968-.786-1.754-1.754-1.754z`})}),l(`activity:providerKey.reddit`)]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://www.facebook.com/sharer/sharer.php?u=${n}"e=${t}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.facebook`),children:[(0,H.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,H.jsx)(`path`,{d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`})}),l(`activity:providerKey.facebook`)]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`mailto:?subject=${t}&body=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs hover:bg-muted/80 transition-colors`,title:l(`setup:screen.share.email`),children:[(0,H.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25H4.5a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75`})}),l(`activity:providerKey.email`)]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(M,{value:e.referral.url,readOnly:!0,className:`font-mono text-xs flex-1`}),(0,H.jsx)(j,{size:`sm`,variant:`outline`,onClick:z,className:`shrink-0`,children:S?(0,H.jsx)(m,{className:`h-4 w-4`}):(0,H.jsx)(r,{className:`h-4 w-4`})})]}),(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground text-center`,children:l(`setup:screen.share.hint`)})]})]})})]})})]})}function W(){let{t:e}=i(),{model:t,setProvider:n,setModel:r,wsConnected:a,wsUrl:h}=T(s(e=>({model:e.model,setProvider:e.setProvider,setModel:e.setModel,wsConnected:e.wsConnected,wsUrl:e.wsUrl})));S();let[g,v]=(0,B.useState)([]),[y,ee]=(0,B.useState)({}),[O,te]=(0,B.useState)([]),[ne,k]=(0,B.useState)(!1),[A,M]=(0,B.useState)(null),[P,I]=(0,B.useState)(0),[L,R]=(0,B.useState)(new Set),[V,oe]=(0,B.useState)({}),[W,ce]=(0,B.useState)(U),[G,K]=(0,B.useState)(!1),[le,ue]=(0,B.useState)(0),[de,fe]=(0,B.useState)(0),[q,pe]=(0,B.useState)(null),J=(0,B.useRef)(!0);(0,B.useEffect)(()=>{let e=new AbortController,t=`${window.location.origin}/providers.json`;return K(!0),ie(t,e.signal).then(t=>{if(t!==U){if(ce(t),K(!1),!J.current){let e=t.length-de;e>0?D.success(c.t(`setup:screen.toasts.providersLoadedNew`,{count:t.length,diff:e})):e<0?D.success(c.t(`setup:screen.toasts.providersLoadedRemoved`,{count:t.length,diff:Math.abs(e)})):D.success(c.t(`setup:screen.toasts.providersLoadedNoChanges`,{count:t.length})),fe(t.length)}pe(new Date);return}return ie(`https://raw.githubusercontent.com/WrongStack/WrongStack/main/packages/webui/public/providers.json`,e.signal)}).then(e=>{if(e){if(ce(e),!J.current){let t=e.length-de;t>0?D.success(c.t(`setup:screen.toasts.providersLoadedNew`,{count:e.length,diff:t})):t<0?D.success(c.t(`setup:screen.toasts.providersLoadedRemoved`,{count:e.length,diff:Math.abs(t)})):D.success(c.t(`setup:screen.toasts.providersLoadedNoChanges`,{count:e.length})),fe(e.length)}pe(new Date)}}).catch(()=>{J.current||D.error(c.t(`setup:screen.toasts.providersRefreshFailed`))}).finally(()=>{K(!1),J.current=!1}),()=>e.abort()},[le]);let[Y,me]=(0,B.useState)(null),[X,Z]=(0,B.useState)(null),[he,ge]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(!a)return;let e=C(h),n=setTimeout(()=>{n=null,k(!1),M(c.t(`setup:screen.errors.backendNotResponding`))},8e3),r=()=>{n&&=(clearTimeout(n),null)},i=e.on(`provider.catalog`,e=>{if(e.type===`provider.catalog`){r(),M(null);let t=e.payload.providers.sort((e,t)=>e.id.localeCompare(t.id));v(t),k(!1)}}),o=e.on(`provider.models`,e=>{if(e.type===`provider.models`){let n=e.payload;if(n.provider!==Y)return;ee(e=>({...e,[n.provider]:n.models})),ge(!1),n.models.length===1?Z(n.models[0].id):t&&n.models.some(e=>e.id===t)&&Z(t)}}),s=e.on(`providers.saved`,e=>{if(e.type===`providers.saved`){let t=e.payload.providers.sort((e,t)=>e.id.localeCompare(t.id));te(t);let n=new Set(t.filter(e=>e.apiKeys.some(e=>e.isActive)).map(e=>e.id));R(n)}}),l=e.on(`provider.probe`,e=>{if(e.type!==`provider.probe`)return;let t=e.payload;oe(e=>({...e,[t.providerId]:t}))});return M(null),k(!0),e.listProviders(),()=>{r(),i?.(),o?.(),s?.(),l?.()}},[a,h,t,P,Y]);let _e=(0,B.useCallback)(()=>{M(null),I(e=>e+1)},[]),ve=(0,B.useCallback)(()=>{ue(e=>e+1)},[]),ye=(0,B.useCallback)(t=>ae(t,e),[e]),be=(0,B.useCallback)(e=>{R(t=>new Set([...t,e])),me(e),Z(null)},[]),xe=L.size>0;(0,B.useEffect)(()=>{if(!Y||!a)return;let e=C(h);y[Y]||(ge(!0),e.listProviderModels(Y))},[Y,a,h,y]);let Se=Y?y[Y]??[]:[],Ce=(0,B.useCallback)(async()=>{if(!Y||!X)return;if(!L.has(Y)){D.error(`Please save the provider configuration before starting a session.`);return}n(Y),r(X);let e=C(h),t=await e.switchModel(Y,X,5e3);t.success?(e.newSession(),E(`chat`)):D.error(t.message||c.t(`setup:screen.errors.modelSwitchTimeout`))},[Y,X,n,r,h]),we=(0,B.useCallback)(async()=>{if(!Y||!X)return;n(Y),r(X);let e=await C(h).switchModel(Y,X,5e3);e.success?E(`chat`):D.error(e.message||c.t(`setup:screen.errors.modelSwitchTimeout`))},[Y,X,n,r,h]),Te=new Set(W.map(e=>e.id)),Ee=g.filter(e=>!Te.has(e.id)).sort((e,t)=>e.id.localeCompare(t.id)),Q=z(Ee,10);z(O,9);let $=z(Se,12,Y);return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,H.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b bg-card px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(`img`,{src:`/wrongstack.svg`,alt:`WrongStack`,draggable:!1,className:`ws-brand-logo h-10 w-10 shrink-0 border border-border/70 shadow-sm`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:e(`setup:screen.header.title`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground sm:truncate`,children:e(`setup:screen.header.subtitle`)})]})]}),xe&&Y?(0,H.jsxs)(`span`,{className:`text-xs text-success/80`,children:[(0,H.jsx)(m,{className:`h-3 w-3 inline-block mr-1`}),e(`setup:screen.header.continue`)]}):null]}),(0,H.jsx)(N,{className:`min-h-0 flex-1`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-8 p-4 pb-4 sm:p-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm`,children:[(0,H.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,xe?`text-success`:`text-primary font-medium`),children:[(0,H.jsx)(p,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{children:e(`setup:screen.steps.addKeys`)})]}),(0,H.jsx)(u,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,H.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,Y?`text-primary font-medium`:`text-muted-foreground`),children:[(0,H.jsx)(b,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{children:e(`setup:screen.steps.pickModel`)})]}),(0,H.jsx)(u,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,H.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,Y&&X?`text-primary font-medium`:`text-muted-foreground`),children:[(0,H.jsx)(l,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{children:e(`setup:screen.steps.start`)})]})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-primary/20 bg-primary/5 p-4`,children:[(0,H.jsx)(o,{className:`h-5 w-5 text-primary shrink-0 mt-0.5`}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:e(`setup:screen.security.title`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`setup:screen.security.body`)})]})]}),A?(0,H.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-4 py-12 rounded-xl border border-destructive/30 bg-destructive/5 px-6`,children:[(0,H.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-destructive/10 border border-destructive/30 flex items-center justify-center`,children:(0,H.jsx)(_,{className:`h-6 w-6 text-destructive`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:e(`setup:screen.errors.backendUnreachable`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 max-w-sm`,children:A})]}),(0,H.jsxs)(j,{onClick:_e,size:`sm`,variant:`outline`,children:[(0,H.jsx)(d,{className:`h-4 w-4 mr-2`}),e(`setup:screen.errors.retry`)]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.popular`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[G&&(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(d,{className:`h-3 w-3 animate-spin`}),e(`setup:screen.providers.updating`)]}),q&&!G&&(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,title:q.toLocaleString(),children:ye(q)}),(0,H.jsxs)(`button`,{type:`button`,onClick:ve,disabled:G,className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,title:e(`setup:screen.providers.refreshTitle`),children:[(0,H.jsx)(x,{className:w(`h-3 w-3`,G&&`animate-spin`)}),e(`setup:screen.providers.refresh`)]})]})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:W.map(e=>(0,H.jsx)(se,{popular:e,catalogProvider:g.find(t=>t.id===e.id),savedProvider:O.find(t=>t.id===e.id),onKeySaved:be,probeResult:V[e.id]},e.id))})]}),Ee.length>0&&(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.more`)}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:Q.pageItems.map(t=>(0,H.jsx)(se,{popular:{id:t.id,name:t.name,description:e(`setup:screen.providers.catalogDescription`,{family:t.family,count:t.modelCount}),icon:`🔗`,color:`from-muted/60 to-muted/20 border-border hover:border-primary/40`,keyPlaceholder:`API key`,family:t.family},catalogProvider:t,savedProvider:O.find(e=>e.id===t.id),onKeySaved:be,probeResult:V[t.id]},t.id))}),(0,H.jsx)(F,{page:Q.page,pageSize:Q.pageSize,totalItems:Q.totalItems,onPageChange:Q.setPage,itemLabel:`providers`})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.selfHosted`)}),(0,H.jsx)(re,{onKeySaved:be})]})]}),ne&&(0,H.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,H.jsx)(d,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),Y&&(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`h2`,{className:`text-base font-semibold flex items-center gap-2`,children:[(0,H.jsx)(l,{className:`h-4 w-4 text-primary`}),e(`setup:screen.start.chooseModel`)]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>{me(null),Z(null)},className:`text-xs text-muted-foreground hover:text-foreground transition-colors`,children:e(`setup:screen.start.addMoreKeys`)})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`setup:screen.start.modelsFor`,{provider:Y})}),he?(0,H.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,H.jsx)(d,{className:`h-6 w-6 animate-spin text-muted-foreground`})}):Se.length>0?(0,H.jsx)(`div`,{className:`grid grid-cols-1 gap-2`,children:$.pageItems.map(e=>{let t=e.contextWindow?`${(e.contextWindow/1e6).toFixed(0)}M ctx`:null;return(0,H.jsx)(`button`,{type:`button`,onClick:()=>Z(e.id),className:w(`w-full text-left rounded-xl border p-3 transition-all`,`hover:border-primary/40 hover:bg-primary/5`,X===e.id?`border-primary bg-primary/10 ring-1 ring-primary/30`:`border-border bg-card`),children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsx)(`span`,{className:`font-medium text-sm`,children:e.name}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[t&&(0,H.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:t}),e.capabilities.slice(0,3).map(e=>(0,H.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20`,children:e},e))]})]}),X===e.id&&(0,H.jsx)(`div`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary`,children:(0,H.jsx)(m,{className:`h-3 w-3 text-primary-foreground`})})]})},e.id)})}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground py-8 text-center`,children:e(`setup:screen.errors.noModels`)}),(0,H.jsx)(F,{page:$.page,pageSize:$.pageSize,totalItems:$.totalItems,onPageChange:$.setPage,itemLabel:`models`})]}),Y&&X&&(0,H.jsxs)(`div`,{className:`sticky bottom-0 -mx-4 border-t bg-background/80 px-4 py-4 backdrop-blur-sm sm:-mx-6 sm:px-6`,children:[(0,H.jsx)(`div`,{className:`mb-3 flex min-w-0 items-center justify-between gap-2 text-sm text-muted-foreground`,children:(0,H.jsxs)(`span`,{className:`min-w-0 truncate`,children:[Y,` / `,X]})}),(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,H.jsxs)(j,{onClick:Ce,className:`flex-1`,size:`lg`,children:[(0,H.jsx)(b,{className:`h-4 w-4 mr-2`}),e(`setup:screen.start.startSession`),(0,H.jsx)(f,{className:`h-4 w-4 ml-2`})]}),(0,H.jsxs)(j,{onClick:we,variant:`outline`,className:`flex-1`,size:`lg`,children:[(0,H.jsx)(m,{className:`h-4 w-4 mr-2`}),e(`setup:screen.start.saveConfig`)]})]}),(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground/60 text-center mt-2`,children:e(`setup:screen.start.saveConfigHint`)})]})]})})]})}export{W as SetupScreen};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-GiKfK4Iw.js","assets/rolldown-runtime-QTnfLwEv.js","assets/monaco-BLUV5g0U.js","assets/monaco-Bowa0-zp.css","assets/markdown-sSmz-Ua_.js","assets/vendor-BMdWcCR4.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ba as t,Ci as n,Fa as r,Gr as ee,Mn as te,On as ne,Qi as re,Ra as i,Wt as ie,Zi as a,Zr as ae,_a as o,_i as oe,ar as s,dt as c,ea as se,fa as ce,jr as le,jt as l,lt as u,vn as ue}from"./vendor-GiKfK4Iw.js";import"./i18n-BvFgJYE2.js";import{s as d}from"./monaco-BLUV5g0U.js";import{t as de}from"./useWebSocket-B2opfRwA.js";import{t as f}from"./utils-CUCQrODG.js";import{n as p}from"./ui-store-BGNdg1e4.js";import{o as fe}from"./view-navigation-FdnvQSOv.js";import{a as pe,n as me,o as he,t as ge}from"./dialog-CfAoIH8P.js";import{p as m}from"./markdown-sSmz-Ua_.js";import{c as _e,g as h,u as g}from"./index-BTRQG7C5.js";import{t as ve}from"./empty-state-BDwjdvMh.js";var _=e(t(),1),v=u(),ye=(0,_.lazy)(()=>d(()=>import(`./vendor-GiKfK4Iw.js`).then(e=>e.S),__vite__mapDeps([0,1,2,3,4,5])));function y(e){return e===`project`||e===`user`}function be(e){let t=e.match(/^(.+?)\/SKILL(?:\.save)?\.md$/);return t?t[1]:null}function xe({source:e}){let{t}=r(),n=e===`project`?`project`:e===`user`?`user`:`bundled`;return(0,v.jsx)(`span`,{className:f(`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide`,n===`project`&&`border-success/25 bg-success/8 text-success`,n===`user`&&`border-primary/25 bg-primary/10 text-primary`,n===`bundled`&&`border-border/70 bg-muted/60 text-muted-foreground`),children:t(`activity:skillDetail.${{project:`scopeProject`,user:`scopeGlobal`,bundled:`scopeBundled`}[n]}`)})}function b({className:e}){let{t}=r(),{client:u}=de(),d=p(e=>e.skillsState),b=p(e=>e.setSkillsState),x=d.selectedSkill,S=d.navHistory,C=d.historyIndex,[w,Se]=(0,_.useState)(null),[Ce,T]=(0,_.useState)(!1),[we,E]=(0,_.useState)(null),Te=_e(`skill-detail`,!!w),[D,O]=(0,_.useState)(!1),[k,A]=(0,_.useState)(``),[j,Ee]=(0,_.useState)(!1),[De,M]=(0,_.useState)(null),[N,P]=(0,_.useState)(!1),[F,I]=(0,_.useState)(null),[L,R]=(0,_.useState)(!1),z=(0,_.useRef)(``),[B,V]=(0,_.useState)(!1),[H,U]=(0,_.useState)(null),[Oe,W]=(0,_.useState)(!1),[G,K]=(0,_.useState)(null),[q,ke]=(0,_.useState)(!1),[Ae,je]=(0,_.useState)([]),J=(0,_.useRef)(d);J.current=d;let Y=(0,_.useRef)(!1),X=(0,_.useMemo)(()=>k?{lines:k.split(`
|
|
3
|
-
`).length,words:k.trim()?k.trim().split(/\s+/).length:0,chars:k.length}:{lines:0,words:0,chars:0},[k]),Z=(0,_.useMemo)(()=>{if(!k)return null;let e=5*1024*1024,t=new Blob([k]).size;return t>=e?{level:`critical`,used:t,limit:e}:t>=4194304?{level:`warn`,used:t,limit:e}:null},[k]);(0,_.useEffect)(()=>{if(!F)return;let e=setTimeout(()=>I(null),2e3);return()=>clearTimeout(e)},[F]),(0,_.useEffect)(()=>{if(!D||!x)return;let e=setInterval(()=>{k&&k!==z.current&&(z.current=k,localStorage.setItem(`skills_draft_${x.name}`,JSON.stringify({content:k,savedAt:Date.now()})),I(Date.now()))},5e3);return()=>clearInterval(e)},[D,k,x]),(0,_.useEffect)(()=>{if(!x||!D)return;let e=localStorage.getItem(`skills_draft_${x.name}`);if(e)try{let{content:t}=JSON.parse(e);t&&t!==k&&t!==z.current&&(A(t),z.current=t,R(!0))}catch{}},[x?.name,D]),(0,_.useEffect)(()=>{if(!u||!x)return;T(!0),Se(null),E(null);let e=setTimeout(()=>{T(!1),E(i.t(`activity:skillDetail.timeoutError`))},1e4),t=t=>{clearTimeout(e);let n=t;n.payload.error?E(n.payload.error):n.payload.name&&Se(n.payload),T(!1)},n=e=>{let t=e;V(!1);let n=J.current;if(t.payload.success){let e={...n.knownRefs};for(let n of t.payload.updated??[])e[n.name]=n.newRef;b({...n,knownRefs:e,updateAvailableCount:0}),U({updated:t.payload.updated??[],unchanged:t.payload.unchanged??[],errors:t.payload.errors??[]}),u.send({type:`skills.list`},{echoToChat:!1})}else U({updated:[],unchanged:[],errors:[{name:``,error:t.payload.error??i.t(`activity:skillDetail.updateFailed`)}]})},r=e=>{let t=e;t.payload.skills&&je(t.payload.skills)};return u.on(`skills.content`,t),u.on(`skills.updated`,n),u.on(`skills.list`,r),u.send({type:`skills.content`,payload:{name:x.name,source:x.source}}),()=>{clearTimeout(e),u.off(`skills.content`,t),u.off(`skills.updated`,n),u.off(`skills.list`,r)}},[u,x?.name,x?.source]),(0,_.useEffect)(()=>{D&&(O(!1),A(``),M(null))},[x?.name]);let Q=(0,_.useCallback)(e=>Ae.find(t=>t.name.toLowerCase()===e.toLowerCase()),[Ae]),Me=(0,_.useCallback)(e=>{let t=Q(e);if(t){Y.current=!1;let e=S.slice(0,C+1);e.push(t),b({...J.current,selectedSkill:t,navHistory:e,historyIndex:e.length-1}),O(!1),A(``),U(null)}},[Q,S,C,b]),Ne=(0,_.useCallback)(()=>{if(C<=0)return;Y.current=!0;let e=C-1,t=S[e];b({...J.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),U(null)},[C,S,b]),Pe=(0,_.useCallback)(()=>{if(C>=S.length-1)return;Y.current=!0;let e=C+1,t=S[e];b({...J.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),U(null)},[C,S,b]),$=(0,_.useCallback)(()=>{fe(`chat`)},[]),Fe=(0,_.useCallback)(()=>{w&&(A(w.body),z.current=w.body,R(!1),M(null),O(!0),P(!1))},[w]),Ie=(0,_.useCallback)(()=>{O(!1),A(``),M(null),P(!1),R(!1),x&&localStorage.removeItem(`skills_draft_${x.name}`)},[x]),Le=(0,_.useCallback)(()=>{!x||!w||(R(!1),A(w.body),z.current=w.body,x&&localStorage.removeItem(`skills_draft_${x.name}`))},[x,w]),Re=(0,_.useCallback)(()=>{if(!u||!x||!k.trim())return;Ee(!0),M(null);let e=t=>{let n=t;Ee(!1),n.payload.success?(z.current=``,localStorage.removeItem(`skills_draft_${x.name}`),R(!1),O(!1),u.send({type:`skills.content`,payload:{name:x.name,source:x.source}}),u.send({type:`skills.list`},{echoToChat:!1})):M(n.payload.error??i.t(`activity:skillDetail.saveFailed`)),u.off(`skills.edited`,e)};u.on(`skills.edited`,e),u.editSkill(x.name,k)},[u,x,k]),ze=(0,_.useCallback)(()=>{!u||!x||(V(!0),U(null),u.checkForUpdates(x.name,x.source===`user`))},[u,x]),Be=(0,_.useCallback)(()=>{x?.sourceUrl&&navigator.clipboard.writeText(x.sourceUrl).then(()=>{W(!0),setTimeout(()=>W(!1),2e3)})},[x]),Ve=(0,_.useCallback)(()=>{if(!w?.body)return;let e=new Blob([w.body],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${w.name.replace(/\//g,`_`)}-SKILL.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},[w]),He=(0,_.useCallback)(async e=>{if(!u||!e)return;ke(!0);let t=e=>{let n=e;ke(!1),n.payload.success?(K(null),u.send({type:`skills.list`},{echoToChat:!1}),$()):M(n.payload.error??i.t(`activity:skillDetail.uninstallFailed`)),u.off(`skills.uninstalled`,t)};u.on(`skills.uninstalled`,t),u.uninstallSkill(e.name,e.source===`user`)},[u,$]);return x?(0,v.jsxs)(`div`,{className:f(`flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:[(0,v.jsxs)(`div`,{className:`shrink-0 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,v.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,v.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,v.jsx)(ie,{className:`h-4 w-4`})}),(0,v.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold`,children:x.name}),x.version&&(0,v.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`v`,x.version]}),(0,v.jsx)(xe,{source:x.source})]}),(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:x.description||x.trigger}),x.sourceUrl&&(0,v.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center gap-1`,children:[(0,v.jsxs)(`a`,{href:`https://${x.sourceUrl.replace(`github:`,``)}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,title:t(`activity:skillDetail.openSourceRepo`),children:[(0,v.jsx)(le,{className:`h-3 w-3 shrink-0`}),(0,v.jsx)(`span`,{className:`truncate font-mono`,children:x.sourceUrl})]}),(0,v.jsx)(`button`,{type:`button`,onClick:Be,className:`flex shrink-0 items-center text-muted-foreground transition-colors hover:text-foreground`,title:t(`activity:skillDetail.copySourceUrl`),children:Oe?(0,v.jsx)(se,{className:`h-3 w-3 text-success`}):(0,v.jsx)(n,{className:`h-3 w-3`})})]}),x.scope.length>0&&(0,v.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:x.scope.map(e=>(0,v.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:e},e))}),H&&(0,v.jsxs)(`div`,{className:`mt-2 text-xs space-y-1`,children:[H.updated.length>0&&(0,v.jsx)(`div`,{className:`text-success`,children:t(`activity:skillDetail.updatedLabel`,{list:H.updated.map(e=>`${e.name} (${e.oldRef} → ${e.newRef})`).join(`, `)})}),H.unchanged.length>0&&(0,v.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:skillDetail.upToDateLabel`,{list:H.unchanged.join(`, `)})}),H.errors.length>0&&(0,v.jsx)(`div`,{className:`text-destructive`,children:t(`activity:skillDetail.errorsLabel`,{list:H.errors.map(e=>`${e.name?`${e.name}: `:``}${e.error}`).join(`; `)})})]})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 lg:ml-auto lg:shrink-0 lg:justify-end`,children:[y(x.source)&&x.sourceUrl&&(0,v.jsx)(`button`,{type:`button`,onClick:ze,disabled:B,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50`,title:t(`activity:skillDetail.checkUpdatesTitle`),children:B?(0,v.jsx)(s,{className:`h-3.5 w-3.5 animate-spin`}):(0,v.jsx)(ue,{className:`h-3.5 w-3.5`})}),x.source!==`bundled`&&!D&&(0,v.jsx)(`button`,{type:`button`,onClick:Ve,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:t(`activity:skillDetail.exportTitle`),children:(0,v.jsx)(oe,{className:`h-3.5 w-3.5`})}),y(x.source)&&!D&&(0,v.jsx)(`button`,{type:`button`,onClick:Fe,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:t(`activity:skillDetail.editTitle`),children:(0,v.jsx)(ne,{className:`h-3.5 w-3.5`})}),y(x.source)&&(0,v.jsx)(`button`,{type:`button`,onClick:()=>K(x),className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,title:t(`activity:skillDetail.uninstallTitle`),children:(0,v.jsx)(l,{className:`h-3.5 w-3.5`})}),(0,v.jsx)(`button`,{type:`button`,onClick:$,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:t(`activity:skillDetail.closeTitle`),children:(0,v.jsx)(c,{className:`h-4 w-4`})})]})]}),S.length>1&&(0,v.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1 rounded-lg border border-border/60 bg-muted/35 px-2 py-1`,children:[(0,v.jsx)(`button`,{type:`button`,onClick:Ne,disabled:C<=0,className:f(`rounded p-1 transition-colors`,C<=0?`text-muted-foreground/65 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:t(`activity:skillDetail.backTitle`),children:(0,v.jsx)(re,{className:`h-4 w-4`})}),(0,v.jsx)(`button`,{type:`button`,onClick:Pe,disabled:C>=S.length-1,className:f(`rounded p-1 transition-colors`,C>=S.length-1?`text-muted-foreground/65 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:t(`activity:skillDetail.forwardTitle`),children:(0,v.jsx)(a,{className:`h-4 w-4`})}),(0,v.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto text-xs`,children:S.map((e,t)=>(0,v.jsxs)(`span`,{className:`flex items-center shrink-0`,children:[t>0&&(0,v.jsx)(a,{className:`h-3 w-3 text-muted-foreground/65 mx-0.5 shrink-0`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>{t<C&&(Y.current=!0,b({...J.current,selectedSkill:e,historyIndex:t}),O(!1),A(``),U(null))},className:f(`hover:text-primary cursor-pointer transition-colors`,t===C?`text-primary font-medium`:`text-muted-foreground`),children:e.name})]},e.name+t))})]})]}),w&&(w.relatedFiles.length>0||w.references.length>0)&&(0,v.jsxs)(`div`,{className:`shrink-0 space-y-2 rounded-xl border border-border/70 bg-card/70 px-4 py-3 shadow-sm`,children:[w.relatedFiles.length>0&&(0,v.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,v.jsx)(ee,{className:`h-3 w-3`}),(0,v.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:t(`activity:skillDetail.relatedFiles`)})]}),w.relatedFiles.map(e=>{let n=be(e);return n&&Q(n)?(0,v.jsxs)(`button`,{type:`button`,onClick:()=>Me(n),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] transition-colors hover:border-primary/40 hover:text-primary`,title:t(`activity:skillDetail.goToSkillTitle`,{name:n}),children:[(0,v.jsx)(o,{className:`h-2.5 w-2.5`}),e]},e):(0,v.jsx)(`span`,{className:`rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e},e)})]}),w.references.length>0&&(0,v.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,v.jsx)(ae,{className:`h-3 w-3`}),(0,v.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:t(`activity:skillDetail.references`)})]}),w.references.map(e=>{let n=be(e)??e.replace(/\.md$/,``);return Q(n)?(0,v.jsxs)(`button`,{type:`button`,onClick:()=>Me(n),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] text-primary transition-colors hover:border-primary/30 hover:bg-primary/10`,title:t(`activity:skillDetail.goToSkillTitle`,{name:n}),children:[(0,v.jsx)(o,{className:`h-2.5 w-2.5`}),n]},e):(0,v.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:n},e)})]})]}),(0,v.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-xl border border-border/70 bg-card/70 shadow-sm`,children:Ce?(0,v.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center text-muted-foreground`,children:[(0,v.jsx)(s,{className:`mx-auto mb-2 h-6 w-6 animate-spin text-primary`}),(0,v.jsx)(`p`,{children:t(`activity:skillDetail.loadingContent`)})]}):D?(0,v.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border/70 bg-muted/30 px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,v.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:skillDetail.editingLabel`,{name:x.name})}),(0,v.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t(`activity:skillDetail.editStats`,{lines:X.lines,words:X.words,chars:X.chars})}),Z&&(0,v.jsx)(`span`,{className:`text-xs tabular-nums ${Z.level===`critical`?`font-medium text-destructive`:`text-warning`}`,children:t(`activity:skillDetail.charsWarningFmt`,{used:(Z.used/(1024*1024)).toFixed(1),limit:(Z.limit/(1024*1024)).toFixed(0)})}),F&&(0,v.jsx)(`span`,{className:`text-xs text-success animate-pulse`,children:t(`activity:skillDetail.draftSaved`)}),L&&(0,v.jsx)(`span`,{className:`animate-pulse text-xs text-warning`,children:t(`activity:skillDetail.draftRestored`)})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[De&&(0,v.jsx)(`span`,{className:`text-xs text-destructive`,children:De}),L&&(0,v.jsx)(`button`,{type:`button`,onClick:Le,className:`rounded-md border border-warning/35 px-2 py-1 text-[10px] text-warning transition-colors hover:bg-warning/10`,children:t(`activity:skillDetail.discardDraft`)}),(0,v.jsx)(`button`,{type:`button`,onClick:Ie,className:`rounded-md border border-border/70 px-2 py-1 text-xs transition-colors hover:bg-accent`,children:t(`common:action.cancel`)}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>P(e=>!e),title:t(N?`activity:skillDetail.hidePreviewTitle`:`activity:skillDetail.splitViewTitle`),className:`rounded-md border px-2 py-1 text-xs transition-colors ${N?`border-primary/40 bg-primary/10 text-primary`:`border-border/70 text-muted-foreground hover:bg-accent`}`,children:(0,v.jsx)(te,{className:`h-3 w-3 inline`})}),(0,v.jsx)(`button`,{type:`button`,onClick:Re,disabled:j||!k.trim(),className:`rounded-md bg-primary px-3 py-1 text-xs text-primary-foreground shadow-sm shadow-primary/15 transition-colors hover:bg-primary/90 disabled:opacity-50`,children:j?(0,v.jsx)(s,{className:`h-3 w-3 animate-spin inline`}):t(`common:action.save`)})]})]}),N?(0,v.jsxs)(`div`,{className:`flex flex-1 min-h-0 gap-0.5`,children:[(0,v.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-0`,children:(0,v.jsx)(_.Suspense,{fallback:null,children:(0,v.jsx)(ye,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:t(`activity:skillDetail.contentPlaceholder`)})})}),(0,v.jsx)(`div`,{className:`w-px bg-border flex-shrink-0`}),(0,v.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-background/45 p-4 prose prose-sm dark:prose-invert max-w-none`,children:(0,v.jsx)(g,{rehypePlugins:[m],components:h,children:k})})]}):(0,v.jsx)(_.Suspense,{fallback:null,children:(0,v.jsx)(ye,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:t(`activity:skillDetail.contentPlaceholder`)})})]}):w?(0,v.jsx)(`div`,{ref:Te,className:`h-full min-h-0 overflow-y-auto overscroll-contain p-5 sm:p-6 prose prose-sm dark:prose-invert max-w-none`,children:(0,v.jsx)(g,{rehypePlugins:[m],components:h,children:w.body})}):we?(0,v.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center`,children:[(0,v.jsx)(`p`,{className:`text-destructive mb-2`,children:t(`activity:skillDetail.loadFailed`)}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:we}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>{u&&x&&(T(!0),E(null),u.send({type:`skills.content`,payload:{name:x.name,source:x.source}}))},className:`mt-4 rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent`,children:t(`common:action.retry`)})]}):(0,v.jsx)(`div`,{className:`flex h-full min-h-[16rem] items-center justify-center p-8 text-center text-muted-foreground`,children:t(`activity:skillDetail.noContent`)})}),(0,v.jsx)(ge,{open:!!G,onOpenChange:e=>{e||K(null)},children:(0,v.jsxs)(me,{className:`flex max-h-[calc(100dvh-2rem)] w-[380px] max-w-[90vw] flex-col gap-0 overflow-hidden p-0`,showCloseButton:!1,children:[(0,v.jsxs)(pe,{className:`flex shrink-0 items-center justify-between border-b border-border/70 p-4 sm:flex-row sm:justify-between sm:space-y-0`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(l,{className:`h-4 w-4 text-destructive`}),(0,v.jsx)(he,{className:`font-semibold text-sm`,children:t(`activity:skillDetail.uninstallSkillHeading`)})]}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>K(null),"aria-label":t(`common:action.close`),className:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground`,children:(0,v.jsx)(c,{className:`h-4 w-4`})})]}),(0,v.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-4`,children:[(0,v.jsx)(`p`,{className:`text-sm`,children:G&&t(`activity:skillDetail.uninstallConfirm`,{name:G.name})}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:G&&t(`activity:skillDetail.uninstallRemovePath`,{path:G.path})})]}),(0,v.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-border/70 bg-muted/20 p-4`,children:[(0,v.jsx)(`button`,{type:`button`,onClick:()=>K(null),disabled:q,className:`rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent disabled:opacity-50`,children:t(`common:action.cancel`)}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>G&&He(G),disabled:q,className:`flex items-center gap-1.5 rounded-md bg-destructive px-3 py-1.5 text-xs text-destructive-foreground transition-colors hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50`,children:[q&&(0,v.jsx)(s,{className:`h-3 w-3 animate-spin`}),t(`activity:skillDetail.uninstallAction`)]})]})]})})]}):(0,v.jsx)(ve,{icon:(0,v.jsx)(ce,{className:`h-6 w-6`}),title:t(`activity:skillDetail.noSkillSelected`),description:t(`activity:skillDetail.selectSkillHint`),action:{label:t(`activity:skillDetail.goToChat`),onClick:$},className:e})}export{b as SkillDetailView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Pa as e}from"./vendor-GiKfK4Iw.js";var t=e(e=>({generation:0,lastUpdatedAt:null,notifyIndexUpdated(t=Date.now()){e(e=>({generation:e.generation+1,lastUpdatedAt:t}))}}));export{t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/activity-BwEBEQ51.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chat-CdiY7G6Z.js","assets/commandPalette-DpaemFux.js","assets/common-COVxQ0FV.js","assets/settings-BUtmAZBV.js","assets/setup-BFcmn89w.js","assets/toasts-BL_8kH4B.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{Ia as e,La as t,Na as n,Pa as r,Ra as i}from"./vendor-GiKfK4Iw.js";import{t as a}from"./activity-BwEBEQ51.js";import{t as o}from"./chat-CdiY7G6Z.js";import{t as s}from"./commandPalette-DpaemFux.js";import{t as c}from"./common-COVxQ0FV.js";import{t as l}from"./settings-BUtmAZBV.js";import{t as u}from"./setup-BFcmn89w.js";import{t as d}from"./toasts-BL_8kH4B.js";import{s as f}from"./monaco-BLUV5g0U.js";var p=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},m=[`en`,`tr`,`de`,`fr`,`it`,`es`,`pt-BR`],h=[{code:`en`,name:`English`},{code:`tr`,name:`Türkçe`},{code:`de`,name:`Deutsch`},{code:`fr`,name:`Français`},{code:`it`,name:`Italiano`},{code:`es`,name:`Español`},{code:`pt-BR`,name:`Português (Brasil)`}],g=new Set(m);function _(){return typeof navigator>`u`||!navigator.language?`en`:y(navigator.language)}function v(e){return!e||typeof e!=`string`?_():y(e)}function y(e){let t=e.trim().toLowerCase();if(!t)return`en`;if(g.has(t))return t;let n=t.split(`-`)[0];return n&&g.has(n)?n:n===`pt`?`pt-BR`:`en`}var b={autonomy:`auto`,autonomyDelayMs:45e3,autoProceedMaxIterations:50,yolo:!0,maxIterations:500,chime:!1,confirmExit:!0,fleetChatVerbosity:`off`,nextPrediction:!1,nextStepsTool:!1,fallbackModels:[],fallbackProfiles:{},favoriteModels:[],favoriteModelsOnly:!1,modelMatrix:{},fallbackAuto:!0,modelAvailabilitySchedule:[],featureMcp:!0,featurePlugins:!0,featureMemory:!0,featureSkills:!0,featureModelsRegistry:!0,indexOnStart:!0,contextAutoCompact:!0,contextStrategy:`hybrid`,contextMode:`balanced`,tokenSavingTier:`off`,maxConcurrent:10,titleAnimation:!0,logLevel:`info`,auditLevel:`standard`,enhanceEnabled:!0,enhanceDelayMs:6e4,enhanceCountdownMs:3e3,enhanceLanguage:`original`,refinerProvider:``,refinerModel:``,refinerFallbackProfile:``,thinkingWord:`thinking`,statuslineMode:`minimum`,animationStyle:`rainbow`,showThinkingLogs:!0,groupToolCalls:!0,autoCollapseInput:!1,showModelReasoning:!0,showAgentSwarmPanel:`bottom`,allowOutsideProjectRoot:!0,reasoningMode:`auto`,reasoningEffort:`high`,reasoningPreserve:!1,cacheTtl:`default`,breakerEnabled:!1,breakerAutoKillResetMs:6e4,fsAccess:`unrestricted`,debugStream:!1,hqEnabled:!1,hqUrl:``,hqToken:``,hqRawContent:!1,tgConfigured:!1,tgSessionEnd:!1,tgDelegate:!0,tgLongToolMs:3e4,uiLocale:_(),chimeraAutoFix:`off`,readSymbols:!1,showSageMemoryInject:!1,sageMemoryInjectThreshold:.85,preRefineSeconds:3,multiDiffSummaryThreshold:5,chimeraEnabled:!0,chimeraProvider:``,chimeraModel:``,chimeraMaxFiles:15,autoReviewEnabled:!1,autoReviewProvider:``,autoReviewModel:``,autoReviewFallbackProfile:``,autoReviewModelSelection:`round-robin`,autoReviewFallbackModels:[],autoReviewDebounceMs:15e3,autoReviewMaxFilesPerBatch:15,autoReviewMaxConcurrentReviews:2,autoReviewCascadeOn:`off`,pluginsEnabled:{}},x=r()(n(e=>({...b,set:t=>e(t),reset:()=>e(b)}),{name:`wrongstack-local-prefs`,version:15,migrate:(e,t)=>{let n=e??{};return t<12&&n.autoReviewDebounceMs===5e3&&(n.autoReviewDebounceMs=15e3),typeof n.fleetChatVerbosity!=`string`&&(n.streamFleet===!0?n.fleetChatVerbosity=`full`:(n.streamFleet,n.fleetChatVerbosity=`off`),delete n.streamFleet),n.fleetChatVerbosity!==`off`&&n.fleetChatVerbosity!==`full`&&(n.fleetChatVerbosity=`off`),[`hybrid`,`intelligent`,`selective`].includes(n.contextStrategy)||(n.contextStrategy=`hybrid`),n.auditLevel===`verbose`&&(n.auditLevel=`full`),[`minimal`,`standard`,`full`].includes(n.auditLevel)||(n.auditLevel=`standard`),typeof n.autoProceedMaxIterations!=`number`&&(n.autoProceedMaxIterations=50),(!n.fallbackProfiles||typeof n.fallbackProfiles!=`object`||Array.isArray(n.fallbackProfiles))&&(n.fallbackProfiles={}),Array.isArray(n.favoriteModels)||(n.favoriteModels=[]),typeof n.favoriteModelsOnly!=`boolean`&&(n.favoriteModelsOnly=!1),Array.isArray(n.modelAvailabilitySchedule)||(n.modelAvailabilitySchedule=[]),(!n.modelMatrix||typeof n.modelMatrix!=`object`||Array.isArray(n.modelMatrix))&&(n.modelMatrix={}),(typeof n.uiLocale!=`string`||!n.uiLocale)&&(n.uiLocale=_()),typeof n.breakerEnabled!=`boolean`&&(n.breakerEnabled=!1),typeof n.breakerAutoKillResetMs!=`number`&&(n.breakerAutoKillResetMs=6e4),n.fsAccess!==`unrestricted`&&n.fsAccess!==`project`&&(n.fsAccess=`unrestricted`),typeof n.debugStream!=`boolean`&&(n.debugStream=!1),typeof n.chimeraEnabled!=`boolean`&&(n.chimeraEnabled=!0),typeof n.chimeraProvider!=`string`&&(n.chimeraProvider=``),typeof n.chimeraModel!=`string`&&(n.chimeraModel=``),n.chimeraAutoFix!==`off`&&n.chimeraAutoFix!==`ask`&&n.chimeraAutoFix!==`auto`&&(n.chimeraAutoFix=`off`),(typeof n.chimeraMaxFiles!=`number`||!Number.isFinite(n.chimeraMaxFiles)||n.chimeraMaxFiles<1)&&(n.chimeraMaxFiles=15),typeof n.autoReviewEnabled!=`boolean`&&(n.autoReviewEnabled=!1),typeof n.autoReviewProvider!=`string`&&(n.autoReviewProvider=``),typeof n.autoReviewModel!=`string`&&(n.autoReviewModel=``),typeof n.autoReviewFallbackProfile!=`string`&&(n.autoReviewFallbackProfile=``),n.autoReviewModelSelection!==`round-robin`&&n.autoReviewModelSelection!==`random`&&(n.autoReviewModelSelection=`round-robin`),Array.isArray(n.autoReviewFallbackModels)||(n.autoReviewFallbackModels=[]),(typeof n.autoReviewDebounceMs!=`number`||!Number.isFinite(n.autoReviewDebounceMs)||n.autoReviewDebounceMs<0)&&(n.autoReviewDebounceMs=15e3),(typeof n.autoReviewMaxFilesPerBatch!=`number`||!Number.isFinite(n.autoReviewMaxFilesPerBatch)||n.autoReviewMaxFilesPerBatch<1)&&(n.autoReviewMaxFilesPerBatch=15),(typeof n.autoReviewMaxConcurrentReviews!=`number`||!Number.isFinite(n.autoReviewMaxConcurrentReviews)||n.autoReviewMaxConcurrentReviews<1)&&(n.autoReviewMaxConcurrentReviews=2),n.autoReviewCascadeOn!==`off`&&n.autoReviewCascadeOn!==`critical`&&n.autoReviewCascadeOn!==`high`&&(n.autoReviewCascadeOn=`off`),typeof n.showModelReasoning!=`boolean`&&(n.showModelReasoning=!0),typeof n.autoCollapseInput!=`boolean`&&(n.autoCollapseInput=!1),typeof n.showAgentSwarmPanel==`boolean`?n.showAgentSwarmPanel=n.showAgentSwarmPanel?`bottom`:`off`:(typeof n.showAgentSwarmPanel!=`string`||![`bottom`,`sidebar`,`off`].includes(n.showAgentSwarmPanel))&&(n.showAgentSwarmPanel=`bottom`),typeof n.allowOutsideProjectRoot!=`boolean`&&(n.allowOutsideProjectRoot=!0),typeof n.readSymbols!=`boolean`&&(n.readSymbols=!1),typeof n.showSageMemoryInject!=`boolean`&&(n.showSageMemoryInject=!1),(typeof n.sageMemoryInjectThreshold!=`number`||!Number.isFinite(n.sageMemoryInjectThreshold)||n.sageMemoryInjectThreshold<0||n.sageMemoryInjectThreshold>1)&&(n.sageMemoryInjectThreshold=.85),(typeof n.preRefineSeconds!=`number`||!Number.isFinite(n.preRefineSeconds)||n.preRefineSeconds<0)&&(n.preRefineSeconds=3),(typeof n.multiDiffSummaryThreshold!=`number`||!Number.isFinite(n.multiDiffSummaryThreshold)||n.multiDiffSummaryThreshold<0)&&(n.multiDiffSummaryThreshold=5),n},partialize:e=>{let{hqToken:t,...n}=e;return n},merge:(e,t)=>{let{hqToken:n,...r}=e??{};return{...t,...r,hqToken:``}}})),S=[`common`,`activity`,`chat`,`commandPalette`,`settings`,`setup`,`toasts`];function C(){try{return v(x.getState().uiLocale)}catch{return`en`}}i.use(e).use(t((e,t)=>p(Object.assign({"./locales/de/activity.json":()=>f(()=>import(`./activity-BLSyJfTr.js`),[]),"./locales/de/chat.json":()=>f(()=>import(`./chat-BnkVCZ3Q.js`),[]),"./locales/de/commandPalette.json":()=>f(()=>import(`./commandPalette-aaAou3Tl.js`),[]),"./locales/de/common.json":()=>f(()=>import(`./common-BiNu_WzQ.js`),[]),"./locales/de/settings.json":()=>f(()=>import(`./settings-ClpzPWKE.js`),[]),"./locales/de/setup.json":()=>f(()=>import(`./setup-DD8rKpQU.js`),[]),"./locales/de/toasts.json":()=>f(()=>import(`./toasts-CFzweRH5.js`),[]),"./locales/en/activity.json":()=>f(()=>import(`./activity-BwEBEQ51.js`).then(e=>e.n),__vite__mapDeps([0,1])),"./locales/en/chat.json":()=>f(()=>import(`./chat-CdiY7G6Z.js`).then(e=>e.n),__vite__mapDeps([2,1])),"./locales/en/commandPalette.json":()=>f(()=>import(`./commandPalette-DpaemFux.js`).then(e=>e.n),__vite__mapDeps([3,1])),"./locales/en/common.json":()=>f(()=>import(`./common-COVxQ0FV.js`).then(e=>e.n),__vite__mapDeps([4,1])),"./locales/en/settings.json":()=>f(()=>import(`./settings-BUtmAZBV.js`).then(e=>e.n),__vite__mapDeps([5,1])),"./locales/en/setup.json":()=>f(()=>import(`./setup-BFcmn89w.js`).then(e=>e.n),__vite__mapDeps([6,1])),"./locales/en/toasts.json":()=>f(()=>import(`./toasts-BL_8kH4B.js`).then(e=>e.n),__vite__mapDeps([7,1])),"./locales/es/activity.json":()=>f(()=>import(`./activity-C-9I3_s4.js`),[]),"./locales/es/chat.json":()=>f(()=>import(`./chat-BPuAsrkF.js`),[]),"./locales/es/commandPalette.json":()=>f(()=>import(`./commandPalette-Nlxs0V7J.js`),[]),"./locales/es/common.json":()=>f(()=>import(`./common-BXJbu5Y-.js`),[]),"./locales/es/settings.json":()=>f(()=>import(`./settings-DyIEVRJT.js`),[]),"./locales/es/setup.json":()=>f(()=>import(`./setup-COxU-AT_.js`),[]),"./locales/es/toasts.json":()=>f(()=>import(`./toasts-BwQJwYLe.js`),[]),"./locales/fr/activity.json":()=>f(()=>import(`./activity-CRMLR4a3.js`),[]),"./locales/fr/chat.json":()=>f(()=>import(`./chat-BfQBSiII.js`),[]),"./locales/fr/commandPalette.json":()=>f(()=>import(`./commandPalette-Dfk74u87.js`),[]),"./locales/fr/common.json":()=>f(()=>import(`./common-Ch7JihXD.js`),[]),"./locales/fr/settings.json":()=>f(()=>import(`./settings-BlMNd_AC.js`),[]),"./locales/fr/setup.json":()=>f(()=>import(`./setup-CMteRkTs.js`),[]),"./locales/fr/toasts.json":()=>f(()=>import(`./toasts-BCDGDcyq.js`),[]),"./locales/it/activity.json":()=>f(()=>import(`./activity-BnTQWNPX.js`),[]),"./locales/it/chat.json":()=>f(()=>import(`./chat-CR2B97dj.js`),[]),"./locales/it/commandPalette.json":()=>f(()=>import(`./commandPalette-CUh_kgfp.js`),[]),"./locales/it/common.json":()=>f(()=>import(`./common-DPaTeTls.js`),[]),"./locales/it/settings.json":()=>f(()=>import(`./settings-CyYYbmdR.js`),[]),"./locales/it/setup.json":()=>f(()=>import(`./setup-pPW1kVR_.js`),[]),"./locales/it/toasts.json":()=>f(()=>import(`./toasts-Dm12Nq8t.js`),[]),"./locales/pt-BR/activity.json":()=>f(()=>import(`./activity-Xqrt9v4z.js`),[]),"./locales/pt-BR/chat.json":()=>f(()=>import(`./chat-DResBrkV.js`),[]),"./locales/pt-BR/commandPalette.json":()=>f(()=>import(`./commandPalette-tFxIIhvU.js`),[]),"./locales/pt-BR/common.json":()=>f(()=>import(`./common-DdGpRh8j.js`),[]),"./locales/pt-BR/settings.json":()=>f(()=>import(`./settings-Orwkg3lH.js`),[]),"./locales/pt-BR/setup.json":()=>f(()=>import(`./setup-BOYK0I6-.js`),[]),"./locales/pt-BR/toasts.json":()=>f(()=>import(`./toasts-frBt6fvE.js`),[]),"./locales/tr/activity.json":()=>f(()=>import(`./activity-CZIixoel.js`),[]),"./locales/tr/chat.json":()=>f(()=>import(`./chat-Di8o0wDz.js`),[]),"./locales/tr/commandPalette.json":()=>f(()=>import(`./commandPalette-CGMq-qlP.js`),[]),"./locales/tr/common.json":()=>f(()=>import(`./common-pI6fYZW3.js`),[]),"./locales/tr/settings.json":()=>f(()=>import(`./settings-XRC0dC9D.js`),[]),"./locales/tr/setup.json":()=>f(()=>import(`./setup-Bd23KLtt.js`),[]),"./locales/tr/toasts.json":()=>f(()=>import(`./toasts-DDYQsJV8.js`),[])}),`./locales/${e}/${t}.json`,4))).init({lng:C(),fallbackLng:`en`,supportedLngs:[...m],ns:[...S],defaultNS:`common`,partialBundledLanguages:!0,resources:{en:{common:c,activity:a,chat:o,commandPalette:s,settings:l,setup:u,toasts:d}},interpolation:{escapeValue:!1},react:{useSuspense:!1},returnNull:!1});function w(e){typeof document<`u`&&(document.documentElement.lang=e)}w(i.language||`en`),x.subscribe((e,t)=>{let n=e.uiLocale;n&&n!==t.uiLocale&&n!==i.language&&i.changeLanguage(n).then(()=>w(n))});function T(){window.wrongstackDesktopHost?.onLocaleChanged?.(e=>{if(!e)return;let t=v(e);if(t===i.language)return;let n=x.getState();n.uiLocale!==t&&n.set({uiLocale:t}),i.changeLanguage(t).then(()=>w(t))})}try{T()}catch{}export{h as n,x as t};
|