tarsk 0.5.73 → 0.5.74
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/index.js +145120 -178397
- package/dist/public/assets/{Combination-lwI_j-mU.js → Combination-BdvBzSm4.js} +1 -1
- package/dist/public/assets/{account-view-DKQdyGPK.js → account-view-c-UG0JKH.js} +1 -1
- package/dist/public/assets/{alert-dialog-Cb1PEgra.js → alert-dialog-DAHkynVZ.js} +1 -1
- package/dist/public/assets/api-D1GxdEEp.js +2 -0
- package/dist/public/assets/{async-error-boundary-J8P6NVvc.js → async-error-boundary-DNJqC4BV.js} +1 -1
- package/dist/public/assets/{async-loading-fallback-B_JNgWJR.js → async-loading-fallback-D2X0o4Qa.js} +1 -1
- package/dist/public/assets/browser-tab-BKQJKTg8.js +12 -0
- package/dist/public/assets/{button-DeNw35VZ.js → button-B6HDsfd5.js} +1 -1
- package/dist/public/assets/{card-B4eI0NI-.js → card-DZGd45nw.js} +1 -1
- package/dist/public/assets/chat-dock-context-8_5G30KG.js +1 -0
- package/dist/public/assets/{commit-dialog-DDLaQVzY.js → commit-dialog-OQFa4W6i.js} +1 -1
- package/dist/public/assets/{commit-error-dialog-Cp0Aic7I.js → commit-error-dialog-BFByxoUG.js} +1 -1
- package/dist/public/assets/{commit-method-fields-CD3PTIox.js → commit-method-fields-BihSf23f.js} +1 -1
- package/dist/public/assets/context-menu-e5jeH0Jl.js +1 -0
- package/dist/public/assets/{conversation-history-view-JymxZFJ2.js → conversation-history-view-BUlO9oJ6.js} +1 -1
- package/dist/public/assets/create-project-dialog-CY5wIGQV.js +2 -0
- package/dist/public/assets/{create-project-workspace-BcIx6FNf.js → create-project-workspace-ClILToZd.js} +1 -1
- package/dist/public/assets/{create-repo-dialog-DcvSMy3g.js → create-repo-dialog-CKUQoOaX.js} +1 -1
- package/dist/public/assets/{delete-confirm-dialog-C9NASyh6.js → delete-confirm-dialog-3DX1u0Dg.js} +1 -1
- package/dist/public/assets/{dialog-Do98zzAW.js → dialog--0foS3aw.js} +1 -1
- package/dist/public/assets/{diff-view-ePD0sdsW.js → diff-view-DLPu21IR.js} +2 -2
- package/dist/public/assets/{dist-CWnEmdyL.js → dist-Bxyh1Ml_.js} +1 -1
- package/dist/public/assets/{dist-BZvmHCxP.js → dist-CFXDhuA_.js} +1 -1
- package/dist/public/assets/{dist-DIjomljy.js → dist-CNOCRPxn.js} +1 -1
- package/dist/public/assets/{dist-DiMgghKn.js → dist-Cda_ffeR.js} +1 -1
- package/dist/public/assets/{dist-CWq9XRXF.js → dist-CkQILg8A.js} +1 -1
- package/dist/public/assets/{dist-DjKXDRW7.js → dist-CqGsum35.js} +1 -1
- package/dist/public/assets/dist-DjiNKpTV.js +2 -0
- package/dist/public/assets/{dist-CjhvxqFU.js → dist-eMdiO0P3.js} +1 -1
- package/dist/public/assets/{dist-mdooLpmq.js → dist-rO95BjzU.js} +1 -1
- package/dist/public/assets/explorer-tab-view-nzl0M0Vm.js +2 -0
- package/dist/public/assets/explorer-tree-Bkb6dzmf.js +1 -0
- package/dist/public/assets/explorer-view-NcArt0_H.js +75 -0
- package/dist/public/assets/{git-history-dialog-DWhJ1-ba.js → git-history-dialog-rWkjoaR5.js} +1 -1
- package/dist/public/assets/index-BOB3ZUQs.js +3386 -0
- package/dist/public/assets/index-BdGMz8sL.css +1 -0
- package/dist/public/assets/{markdown-renderer-qLede1zH.js → markdown-renderer-BkKibNMs.js} +3 -3
- package/dist/public/assets/{mcp-server-card-zm-ss-7h.js → mcp-server-card-DFT7uyRh.js} +1 -1
- package/dist/public/assets/{merged-pr-dialog-Due9WdB4.js → merged-pr-dialog-BOrFaYk6.js} +1 -1
- package/dist/public/assets/model-list-controls-CpQjn6i7.js +1 -0
- package/dist/public/assets/onboarding-dialog-HJpyzVWa.js +1 -0
- package/dist/public/assets/{project-env-vars-view-N1Io1Pau.js → project-env-vars-view-C9VTTfTo.js} +1 -1
- package/dist/public/assets/project-model-aliases-view-DKRoV7Gc.js +1 -0
- package/dist/public/assets/{project-settings-view-BalZ6Fe1.js → project-settings-view-BDYqpibk.js} +1 -1
- package/dist/public/assets/{project-tools-view-OnCN0jKz.js → project-tools-view-9WUc4Yca.js} +1 -1
- package/dist/public/assets/providers-list-view-BgvIWP_0.js +1 -0
- package/dist/public/assets/pull-request-dialog-BM1dkFpK.js +1 -0
- package/dist/public/assets/{pull-with-changes-dialog-B9y2_lt_.js → pull-with-changes-dialog-Bjl_esir.js} +1 -1
- package/dist/public/assets/{push-before-pr-dialog-D3pMFe9A.js → push-before-pr-dialog-Cbc_zaI8.js} +1 -1
- package/dist/public/assets/{radio-group-CU59hGiA.js → radio-group-CMW5ku-w.js} +1 -1
- package/dist/public/assets/{scroll-area-nbNFO91g.js → scroll-area-BMQFeWmq.js} +1 -1
- package/dist/public/assets/settings-general-view-BaMVw6kD.js +1 -0
- package/dist/public/assets/{settings-instructions-view-GjQivhLy.js → settings-instructions-view-BRE87H2U.js} +1 -1
- package/dist/public/assets/{settings-list-DU82HNPX.js → settings-list-BpPbGcpS.js} +1 -1
- package/dist/public/assets/{settings-logs-view-DnQ_4O9b.js → settings-logs-view-Bbue8ZOn.js} +4 -4
- package/dist/public/assets/settings-mcp-servers-view-BiMCy8sH.js +5 -0
- package/dist/public/assets/{settings-models-view-CTjnBd74.js → settings-models-view-BkZtGcUP.js} +1 -1
- package/dist/public/assets/{settings-rules-view-DiTC-cBE.js → settings-rules-view-TK7LEC-0.js} +3 -3
- package/dist/public/assets/settings-skills-view-Bv9Kn55r.js +3 -0
- package/dist/public/assets/{settings-slack-view-CiuJZ-9i.js → settings-slack-view-Dy2bFJqU.js} +1 -1
- package/dist/public/assets/{settings-slash-commands-view-CnXff39A.js → settings-slash-commands-view-DiR1IyMF.js} +1 -1
- package/dist/public/assets/{settings-statistics-view-D8SvAGE_.js → settings-statistics-view-DX1UVeCJ.js} +1 -1
- package/dist/public/assets/settings-storage-view-D8tHP8XT.js +1 -0
- package/dist/public/assets/{settings-subagents-view-B4HugfzU.js → settings-subagents-view-Bz7jBhbB.js} +2 -2
- package/dist/public/assets/{settings-system-prompt-view-DNQKxcFg.js → settings-system-prompt-view-VHGAqfQk.js} +1 -1
- package/dist/public/assets/settings-view-QBOhYAyv.js +2 -0
- package/dist/public/assets/store-CHF6tOp2.js +9 -0
- package/dist/public/assets/{switch-pIBaqatj.js → switch-P5m18oUl.js} +1 -1
- package/dist/public/assets/{table-B3fLagUj.js → table-MUx4ZxvS.js} +1 -1
- package/dist/public/assets/tasks-view-l00Nc2fV.js +2 -0
- package/dist/public/assets/terminal-panel-DHDoOXAH.js +38 -0
- package/dist/public/assets/{toggle-group-5tREtjoW.js → toggle-group-DMR7z3pz.js} +1 -1
- package/dist/public/assets/{tooltip-B6ziVyTv.js → tooltip-BtJG5fZl.js} +1 -1
- package/dist/public/assets/{use-active-dock-panel-instance-BSch6-Fx.js → use-active-dock-panel-instance-cO_DR87G.js} +1 -1
- package/dist/public/assets/use-installed-ai-files-CJr_PVcY.js +1 -0
- package/dist/public/assets/{use-open-chat-dock-panel-Cr1bQYOH.js → use-open-chat-dock-panel-B31lwcQF.js} +1 -1
- package/dist/public/assets/{web-BKpP7kYB.js → web-C7jr0n2X.js} +1 -1
- package/dist/public/assets/{web-DaiDQ9WA.js → web-D0nlJHDu.js} +1 -1
- package/dist/public/assets/{web-W5CC9Cq4.js → web-DPW3m0cL.js} +1 -1
- package/dist/public/assets/{web-CtDn8Ggo.js → web-jJ1krOD-.js} +1 -1
- package/dist/public/index.html +24 -24
- package/dist/recommended-models.txt +1 -1
- package/package.json +4 -3
- package/dist/public/assets/api-BMo_Lz8f.js +0 -2
- package/dist/public/assets/browser-tab-D_GXZ93G.js +0 -12
- package/dist/public/assets/chat-dock-context-BXoAs38w.js +0 -1
- package/dist/public/assets/context-menu-Dx5Jy21w.js +0 -1
- package/dist/public/assets/create-project-dialog-qbwqSqGU.js +0 -6
- package/dist/public/assets/dist-BWuYHVi8.js +0 -2
- package/dist/public/assets/explorer-tab-view-D6hsKrXY.js +0 -2
- package/dist/public/assets/explorer-tree-BG8ShRwn.js +0 -1
- package/dist/public/assets/explorer-view-BZcNnLd9.js +0 -75
- package/dist/public/assets/index-DhOeeft5.css +0 -1
- package/dist/public/assets/index-DjaVbFDB.js +0 -3386
- package/dist/public/assets/is-macos-client-BIb4ZSEa.js +0 -1
- package/dist/public/assets/model-list-controls-D86_87E4.js +0 -1
- package/dist/public/assets/onboarding-dialog-DlqbPvG0.js +0 -1
- package/dist/public/assets/project-model-aliases-view-B4FEze4g.js +0 -1
- package/dist/public/assets/providers-list-view-DXvcxXDM.js +0 -1
- package/dist/public/assets/pull-request-dialog-BeeTNIN_.js +0 -1
- package/dist/public/assets/settings-general-view-CAYlYs3J.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-C6OZHR3K.js +0 -5
- package/dist/public/assets/settings-skills-view-DHoSorOw.js +0 -3
- package/dist/public/assets/settings-storage-view-CUsa7Lwv.js +0 -1
- package/dist/public/assets/settings-view-DoZmXguf.js +0 -2
- package/dist/public/assets/store-BaMSfYoJ.js +0 -9
- package/dist/public/assets/tasks-view-BaMd8ZM0.js +0 -2
- package/dist/public/assets/terminal-panel-BjD6z-3y.js +0 -38
- package/dist/public/assets/use-installed-ai-files-E4BAFIPG.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return typeof navigator>`u`?!1:navigator.userAgentData?.platform===`macOS`?!0:navigator.platform.startsWith(`Mac`)}export{e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{n as e,o as t,t as n}from"./react-vendor-Ee0-5T4I.js";import{ot as r}from"./dist-BWuYHVi8.js";import{Bn as i,P as a,Y as o,gn as s}from"./dist-DIjomljy.js";import{t as c}from"./button-DeNw35VZ.js";import"./api-BMo_Lz8f.js";import{i as l,n as u,r as d,t as f}from"./tooltip-B6ziVyTv.js";import{o as p}from"./index-DjaVbFDB.js";import{n as m}from"./sorting-DqwxPMRN.js";var h=e(),g=n();function _(e){let t=(0,h.c)(9),{codingIndex:n,modelName:i}=e,o=m(n);if(o===0)return null;let s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[1,2,3,4,5],t[0]=s):s=t[0];let c;t[1]===o?c=t[2]:(c=(0,g.jsx)(l,{asChild:!0,children:(0,g.jsx)(`div`,{className:`flex items-center gap-0.5`,children:s.map(e=>(0,g.jsx)(a,{className:`h-3 w-3 ${e<=o?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),t[1]=o,t[2]=c);let p;t[3]!==n||t[4]!==i?(p=(0,g.jsx)(u,{children:(0,g.jsxs)(`p`,{className:r.body,children:[i,` was indexed `,n,` for coding intelligence`]})}),t[3]=n,t[4]=i,t[5]=p):p=t[5];let _;return t[6]!==c||t[7]!==p?(_=(0,g.jsx)(d,{children:(0,g.jsxs)(f,{children:[c,p]})}),t[6]=c,t[7]=p,t[8]=_):_=t[8],_}t();function v(e){let t=(0,h.c)(10),{id:n,checked:r,disabled:i,onChange:a}=e,o=i===void 0?!1:i,s;t[0]===a?s=t[1]:(s=e=>a(e===!0),t[0]=a,t[1]=s);let c;t[2]!==r||t[3]!==o||t[4]!==n||t[5]!==s?(c=(0,g.jsx)(l,{asChild:!0,children:(0,g.jsx)(`span`,{className:`inline-flex`,children:(0,g.jsx)(p,{id:n,disabled:o,checked:r,onCheckedChange:s,"aria-label":`Select All Models`})})}),t[2]=r,t[3]=o,t[4]=n,t[5]=s,t[6]=c):c=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,g.jsx)(u,{children:`Select All Models`}),t[7]=m):m=t[7];let _;return t[8]===c?_=t[9]:(_=(0,g.jsx)(d,{children:(0,g.jsxs)(f,{children:[c,m]})}),t[8]=c,t[9]=_),_}function y(e){let t=(0,h.c)(31),{sortBy:n,onSortByChange:r,showCodingIndex:p,showIntelligenceByPrice:m}=e,_=p===void 0?!1:p,v=m===void 0?!1:m,y=n===`alphabetical`?`secondary`:`ghost`,b;t[0]===r?b=t[1]:(b=()=>r(`alphabetical`),t[0]=r,t[1]=b);let x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,g.jsx)(i,{className:`h-4 w-4`}),t[2]=x):x=t[2];let S;t[3]!==y||t[4]!==b?(S=(0,g.jsx)(l,{asChild:!0,children:(0,g.jsx)(c,{type:`button`,variant:y,size:`icon`,className:`h-8 w-8`,onClick:b,children:x})}),t[3]=y,t[4]=b,t[5]=S):S=t[5];let C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,g.jsx)(u,{children:`Sort A–Z`}),t[6]=C):C=t[6];let w;t[7]===S?w=t[8]:(w=(0,g.jsxs)(f,{children:[S,C]}),t[7]=S,t[8]=w);let T=n===`price-low`||n===`price-high`?`secondary`:`ghost`,E;t[9]===r?E=t[10]:(E=()=>r(`price-low`),t[9]=r,t[10]=E);let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,g.jsx)(s,{className:`h-4 w-4`}),t[11]=D):D=t[11];let O;t[12]!==E||t[13]!==T?(O=(0,g.jsx)(l,{asChild:!0,children:(0,g.jsx)(c,{type:`button`,variant:T,size:`icon`,className:`h-8 w-8`,onClick:E,children:D})}),t[12]=E,t[13]=T,t[14]=O):O=t[14];let k;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,g.jsx)(u,{children:`Sort by price`}),t[15]=k):k=t[15];let A;t[16]===O?A=t[17]:(A=(0,g.jsxs)(f,{children:[O,k]}),t[16]=O,t[17]=A);let j;t[18]!==r||t[19]!==_||t[20]!==n?(j=_?(0,g.jsxs)(f,{children:[(0,g.jsx)(l,{asChild:!0,children:(0,g.jsx)(c,{type:`button`,variant:n===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(`coding-index`),children:(0,g.jsx)(a,{className:`h-4 w-4`})})}),(0,g.jsx)(u,{children:`Sort by coding intelligence`})]}):null,t[18]=r,t[19]=_,t[20]=n,t[21]=j):j=t[21];let M;t[22]!==r||t[23]!==v||t[24]!==n?(M=v?(0,g.jsxs)(f,{children:[(0,g.jsx)(l,{asChild:!0,children:(0,g.jsx)(c,{type:`button`,variant:n===`intelligence-by-price`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(`intelligence-by-price`),children:(0,g.jsx)(o,{className:`h-4 w-4`})})}),(0,g.jsx)(u,{children:`Sort by price/intelligence`})]}):null,t[22]=r,t[23]=v,t[24]=n,t[25]=M):M=t[25];let N;return t[26]!==A||t[27]!==j||t[28]!==M||t[29]!==w?(N=(0,g.jsx)(d,{children:(0,g.jsxs)(`div`,{className:`flex items-center rounded-md p-0.5`,children:[w,A,j,M]})}),t[26]=A,t[27]=j,t[28]=M,t[29]=w,t[30]=N):N=t[30],N}export{y as n,_ as r,v as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{G as i,S as a,ot as o}from"./dist-BWuYHVi8.js";import{An as s,Bn as c,Et as l,Ln as u,Tn as d,dn as f,gn as p,q as m}from"./dist-DIjomljy.js";import{n as h,t as g}from"./utils-CT-Dw22R.js";import{t as _}from"./button-DeNw35VZ.js";import{G as v,V as y,h as b,jt as x,kt as S,s as C,vn as w,yn as T}from"./api-BMo_Lz8f.js";import{i as E,n as D,r as O,t as k}from"./tooltip-B6ziVyTv.js";import{n as A}from"./scroll-area-nbNFO91g.js";import{a as j,i as M,o as N,r as P,s as F,t as I}from"./dialog-Do98zzAW.js";import{Ct as L,Ft as R,On as z,Pn as B,Pt as V,St as H,Tt as U,o as W,pn as G,wt as K,xt as ee,yt as q}from"./index-DjaVbFDB.js";import{n as J,t as Y}from"./toggle-group-5tREtjoW.js";import{t as te}from"./sorting-DqwxPMRN.js";import{t as ne}from"./pending-changes-Bn-0ak1d.js";function re(e){let t=/^[^:]+:\s+(.+)$/.exec(e);return(t?t[1]:e).trim()}function ie(e){return[G(e.id),e.name,re(e.name)]}function ae(e,t){let n=new Set(t.map(e=>e.toLowerCase()));return ie(e).some(e=>n.has(e.toLowerCase()))}function oe(e,t){return e.filter(e=>ae(e,t)).map(e=>e.id)}var X=t(),Z=e(n(),1),Q=r(),se=a(`app.model-selector.ui`),ce=`rounded-full border-0 px-3 data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:shadow-sm`;function le({provider:e,onModelsChange:t,isLoading:n,disabled:r,displayMode:i=`grid`,autoSelectRecommended:a=!1}){let[s,u]=(0,Z.useState)([]),[d,f]=(0,Z.useState)(new Set),[_,y]=(0,Z.useState)(new Set),[b,S]=(0,Z.useState)(new Map),[C,w]=(0,Z.useState)(!1),[T,A]=(0,Z.useState)(``),[j,M]=(0,Z.useState)(`alphabetical`);(0,Z.useEffect)(()=>{N()},[e]);let N=async()=>{w(!0),A(``),M(`alphabetical`);try{let t=await v(e);u(t.models);let n=new Set(t.enabledModelIds);f(n);let r=new Map,i=new Set;if(a)try{let{models:e}=await x();i=new Set(oe(t.models,e)),r=new Map([...i].filter(e=>!n.has(e)).map(e=>[e,!0]))}catch(e){se.error(`Failed to load recommended models:`,e)}y(i),S(r),P(n,r,t.models)}catch(t){se.error(`Failed to load models for ${e}:`,t),u([]),f(new Set),y(new Set)}finally{w(!1)}},P=(e,n,r=s)=>{let i=new Set(e);r.forEach(e=>{n.has(e.id)&&(n.get(e.id)?i.add(e.id):i.delete(e.id))}),t?.(i)},F=e=>{S(t=>{let n=ne(t,e,d);return P(d,n),n})},I=e=>{S(t=>{let n=new Map(t);return s.forEach(t=>{let r=d.has(t.id);e?r?n.delete(t.id):n.set(t.id,!0):r?n.set(t.id,!1):n.delete(t.id)}),P(d,n),n})},L=e=>G(e.id);function z(e,t=b){let n=t.has(e),r=t.get(e);return n?!!r:d.has(e)}let B=te({models:s,query:T,sortBy:j,getDisplayName:L,getPriority:e=>+!z(e.id)}),V=j===`alphabetical`?`alphabetical`:`price`;function H(e){if(e===`alphabetical`){M(`alphabetical`);return}e===`price`&&M(`price-low`)}function U(){j!==`alphabetical`&&M(e=>e===`price-low`?`price-high`:`price-low`)}return C||n?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(l,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):s.length===0?(0,Q.jsx)(`div`,{className:`text-center py-8`,children:(0,Q.jsx)(`p`,{className:o.bodyMuted,children:`No models available for this provider.`})}):i===`compact`?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsxs)(`div`,{className:g(`flex items-center justify-between gap-3`,r&&`opacity-25`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(W,{id:`select-all-models`,disabled:r,checked:s.every(e=>z(e.id)),onCheckedChange:e=>I(e===!0)}),(0,Q.jsx)(`label`,{htmlFor:`select-all-models`,className:g(o.body,`cursor-pointer`),children:`Select all models`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,Q.jsxs)(`div`,{className:`relative w-44 sm:w-52`,children:[(0,Q.jsx)(m,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,Q.jsx)(R,{placeholder:`Search models...`,value:T,onChange:e=>A(e.target.value),disabled:r,className:`pl-8 h-9`})]}),(0,Q.jsxs)(Y,{type:`single`,value:V,onValueChange:H,"aria-label":`Sort models`,variant:`outline`,className:`inline-flex rounded-full border bg-muted/40 p-1`,children:[(0,Q.jsx)(J,{value:`alphabetical`,"aria-label":`Sort A–Z`,disabled:r,className:ce,children:(0,Q.jsx)(c,{className:`h-4 w-4`})}),(0,Q.jsx)(J,{value:`price`,"aria-label":`Sort by price`,disabled:r,className:ce,onClick:U,children:(0,Q.jsx)(p,{className:`h-4 w-4`})})]})]})]}),(0,Q.jsx)(O,{children:(0,Q.jsx)(`div`,{className:`grid grid-cols-1 gap-0 overflow-hidden rounded-md border border-table-border`,children:B.length===0?(0,Q.jsx)(`div`,{className:`text-center py-4`,children:(0,Q.jsx)(`p`,{className:o.bodyMuted,children:T?`No models match your search.`:`No models available.`})}):B.map(e=>{let t=z(e.id),n=e.pricing,i=t&&_.has(e.id);return(0,Q.jsxs)(k,{children:[(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:g(`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default`,r&&`opacity-25`),children:[(0,Q.jsx)(W,{id:e.id,disabled:r,checked:t??!1,onCheckedChange:()=>F(e.id),className:`mt-0`}),(0,Q.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,Q.jsxs)(`label`,{htmlFor:e.id,className:g(o.body,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate flex-1 w-0`),children:[L(e),i&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` (Recommended)`})]}),n&&(0,Q.jsx)(`span`,{className:g(o.compact,`text-muted-foreground whitespace-nowrap flex-shrink-0`),children:(n.prompt??0)<=0&&(n.completion??0)<=0?`Free`:`${h(n.prompt??0)} in | ${h(n.completion??0)} out`})]})]})}),e.description&&(0,Q.jsx)(D,{side:`top`,className:`max-w-xs`,children:(0,Q.jsx)(`p`,{className:o.body,children:e.description})})]},e.id)})})})]}):null}var $=a(`app.onboarding-dialog.ui`);function ue(e){let t=(0,X.c)(26),{currentStep:n}=e,r=e=>e===`provider-selection`&&n===`provider-selection`||n===`model-selection`,i=e=>n===e,a=i(`git-check`)?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`,s;t[0]===a?s=t[1]:(s=g(`flex items-center justify-center h-8 w-8 rounded-full`,o.label,a),t[0]=a,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(`div`,{className:s,children:`1`}),t[2]=s,t[3]=c);let l=r(`provider-selection`)?`bg-primary`:`bg-muted`,u;t[4]===l?u=t[5]:(u=g(`h-0.5 flex-1`,l),t[4]=l,t[5]=u);let d;t[6]===u?d=t[7]:(d=(0,Q.jsx)(`div`,{className:u}),t[6]=u,t[7]=d);let f=i(`provider-selection`)?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`,p;t[8]===f?p=t[9]:(p=g(`flex items-center justify-center h-8 w-8 rounded-full`,o.label,f),t[8]=f,t[9]=p);let m;t[10]===p?m=t[11]:(m=(0,Q.jsx)(`div`,{className:p,children:`2`}),t[10]=p,t[11]=m);let h=r(`model-selection`)?`bg-primary`:`bg-muted`,_;t[12]===h?_=t[13]:(_=g(`h-0.5 flex-1`,h),t[12]=h,t[13]=_);let v;t[14]===_?v=t[15]:(v=(0,Q.jsx)(`div`,{className:_}),t[14]=_,t[15]=v);let y=i(`model-selection`)?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`,b;t[16]===y?b=t[17]:(b=g(`flex items-center justify-center h-8 w-8 rounded-full`,o.label,y),t[16]=y,t[17]=b);let x;t[18]===b?x=t[19]:(x=(0,Q.jsx)(`div`,{className:b,children:`3`}),t[18]=b,t[19]=x);let S;return t[20]!==v||t[21]!==x||t[22]!==c||t[23]!==d||t[24]!==m?(S=(0,Q.jsxs)(`div`,{className:`w-1/2 mx-auto flex items-center gap-2 mb-6`,children:[c,d,m,v,x]}),t[20]=v,t[21]=x,t[22]=c,t[23]=d,t[24]=m,t[25]=S):S=t[25],S}function de(e){let t=(0,X.c)(3),{currentStep:n}=e;if(n===`provider-selection`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{children:`Select an AI Provider`}),(0,Q.jsx)(M,{children:`Choose your preferred AI provider and enter your API key.`})]}),t[0]=e):e=t[0],e}if(n===`model-selection`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{children:`Select Models`}),(0,Q.jsx)(M,{children:`Choose which models you want to use with this provider.`})]}),t[1]=e):e=t[1],e}let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{children:`Let's get started`}),(0,Q.jsx)(M,{children:`First, we need to check that Git is installed on your system.`})]}),t[2]=r):r=t[2],r}function fe(e){let t=(0,X.c)(7),{gitLoading:n,gitInstalled:r}=e;if(n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(l,{className:`h-5 w-5 animate-spin text-muted-foreground`})}),t[0]=e):e=t[0],e}if(r){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsxs)(z,{variant:`success`,className:`mb-0 flex items-start gap-3`,children:[(0,Q.jsx)(s,{className:`h-5 w-5 text-green-600 flex-shrink-0 mt-0.5`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:g(o.label,`text-green-900`),children:`Git is installed`}),(0,Q.jsx)(`p`,{className:o.bodyMuted,children:`You're all set to use Git features in Tarsk.`})]})]}),t[1]=e):e=t[1],e}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(d,{className:`h-5 w-5 text-yellow-600 flex-shrink-0 mt-0.5`}),t[2]=i):i=t[2];let a,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`p`,{className:o.label,children:`Git is not installed`}),c=(0,Q.jsx)(`p`,{className:o.bodyMuted,children:`Git is required for some features in Tarsk. You can continue without it, but we recommend installing it.`}),t[3]=a,t[4]=c):(a=t[3],c=t[4]);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=g(o.caption,`text-brand hover:underline mt-2 inline-flex items-center gap-1`),t[5]=u):u=t[5];let p;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsxs)(z,{variant:`hint`,className:`mb-0 flex items-start gap-3`,children:[i,(0,Q.jsxs)(`div`,{className:`flex-1`,children:[a,c,(0,Q.jsxs)(`a`,{href:`https://git-scm.com/downloads`,target:`_blank`,rel:`noreferrer`,className:u,children:[`Download Git `,(0,Q.jsx)(f,{className:`h-3 w-3`})]})]})]}),t[6]=p):p=t[6],p}function pe(e){let t=(0,X.c)(16),{selectedProvider:n,onProviderChange:r,apiKey:a,onApiKeyChange:s,validatingKey:c,providerEnvValues:l,onProviderEnvChange:u,keyError:d}=e,f;t[0]!==a||t[1]!==s||t[2]!==r||t[3]!==n||t[4]!==c?(f=(0,Q.jsx)(q,{selectedProvider:n,onProviderChange:r,showApiKeyInput:!0,apiKey:a,onApiKeyChange:s,variant:`dropdown`,isLoading:c}),t[0]=a,t[1]=s,t[2]=r,t[3]=n,t[4]=c,t[5]=f):f=t[5];let p;t[6]!==u||t[7]!==l||t[8]!==n?(p=n&&L(n).map(e=>(0,Q.jsx)(B,{label:(0,Q.jsx)(V,{htmlFor:e,children:H(e)}),control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`input`,{id:e,value:l[e]??``,onChange:t=>u(e,t.target.value),className:`h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base`,placeholder:i(n.slug)&&e===`LOCAL_API_URL`?n.api:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),n.slug===`azure`&&e===K(n)||i(n.slug)&&e===`LOCAL_API_URL`?(0,Q.jsx)(`p`,{className:g(o.bodyMuted,`mt-2 break-all`),children:U(n,l)||n.api}):null]}),align:`start`},e)),t[6]=u,t[7]=l,t[8]=n,t[9]=p):p=t[9];let m;t[10]===d?m=t[11]:(m=d&&(0,Q.jsx)(z,{variant:`error`,className:`mb-0`,children:d}),t[10]=d,t[11]=m);let h;return t[12]!==f||t[13]!==p||t[14]!==m?(h=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[f,p,m]}),t[12]=f,t[13]=p,t[14]=m,t[15]=h):h=t[15],h}function me(e){let t=(0,X.c)(4),{providerSlug:n,modelsLoading:r,onModelsChange:i}=e,a;return t[0]!==r||t[1]!==i||t[2]!==n?(a=(0,Q.jsx)(`div`,{className:`space-y-4`,children:(0,Q.jsx)(le,{provider:n,isLoading:r,displayMode:`compact`,disabled:!1,autoSelectRecommended:!0,onModelsChange:i})}),t[0]=r,t[1]=i,t[2]=n,t[3]=a):a=t[3],a}function he(e){let t=(0,X.c)(32),{currentStep:n,savingOnboarding:r,gitLoading:i,validatingKey:a,apiKey:o,hasProvider:c,onSkip:d,onBack:f,onContinue:p,onValidate:m,onFinish:h}=e,g;t[0]!==n||t[1]!==d||t[2]!==r?(g=n===`provider-selection`&&(0,Q.jsx)(_,{variant:`ghost`,onClick:d,disabled:r,children:`Skip for now`}),t[0]=n,t[1]=d,t[2]=r,t[3]=g):g=t[3];let v;t[4]===g?v=t[5]:(v=(0,Q.jsx)(`div`,{children:g}),t[4]=g,t[5]=v);let y;t[6]!==n||t[7]!==f||t[8]!==r?(y=n!==`git-check`&&(0,Q.jsx)(_,{variant:`outline`,onClick:f,disabled:r,children:`Back`}),t[6]=n,t[7]=f,t[8]=r,t[9]=y):y=t[9];let b;t[10]!==n||t[11]!==i||t[12]!==p?(b=n===`git-check`&&(0,Q.jsxs)(_,{onClick:p,disabled:i,className:`gap-2`,children:[`Continue `,(0,Q.jsx)(u,{className:`h-4 w-4`})]}),t[10]=n,t[11]=i,t[12]=p,t[13]=b):b=t[13];let x;t[14]!==o||t[15]!==n||t[16]!==c||t[17]!==m||t[18]!==a?(x=n===`provider-selection`&&(0,Q.jsx)(_,{onClick:m,disabled:a||!o.trim()||!c,className:`gap-2`,children:a?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(l,{className:`h-4 w-4 animate-spin`}),`Validating...`]}):(0,Q.jsxs)(Q.Fragment,{children:[`Next `,(0,Q.jsx)(u,{className:`h-4 w-4`})]})}),t[14]=o,t[15]=n,t[16]=c,t[17]=m,t[18]=a,t[19]=x):x=t[19];let S;t[20]!==n||t[21]!==h||t[22]!==r?(S=n===`model-selection`&&(0,Q.jsx)(_,{onClick:h,disabled:r,className:`gap-2`,children:r?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(l,{className:`h-4 w-4 animate-spin`}),`Finishing...`]}):(0,Q.jsxs)(Q.Fragment,{children:[`Finish `,(0,Q.jsx)(s,{className:`h-4 w-4`})]})}),t[20]=n,t[21]=h,t[22]=r,t[23]=S):S=t[23];let C;t[24]!==y||t[25]!==b||t[26]!==x||t[27]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[y,b,x,S]}),t[24]=y,t[25]=b,t[26]=x,t[27]=S,t[28]=C):C=t[28];let w;return t[29]!==v||t[30]!==C?(w=(0,Q.jsx)(`div`,{className:`px-6 py-4 border-t border-border bg-muted/10`,children:(0,Q.jsxs)(j,{className:`flex items-center justify-between`,children:[v,C]})}),t[29]=v,t[30]=C,t[31]=w):w=t[31],w}function ge({open:e,onOpenChange:t,onComplete:n}){let[r,i]=(0,Z.useState)(`git-check`),[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)([]),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)({}),[_,x]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(``),[O,k]=(0,Z.useState)(new Set),[j,M]=(0,Z.useState)(!1),[F,R]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{e&&r===`git-check`&&z()},[e,r]),(0,Z.useEffect)(()=>{e&&r===`provider-selection`&&l.length===0&&B()},[e,r,l.length]),(0,Z.useEffect)(()=>{e&&r===`model-selection`&&d&&V()},[e,r,d]);let z=async()=>{c(!0);try{let e=await C();o(e.gitInstalled),e.gitInstalled&&i(`provider-selection`)}catch(e){$.error(`Failed to check git installation:`,e),o(!1)}finally{c(!1)}},B=async()=>{try{let e=await S();if(u(e),e.length>0&&!d){let t=ee(e);t&&(f(t),m(t.apiKey??``),g(t.envValues??{}))}}catch(e){$.error(`Failed to load providers:`,e)}},V=async()=>{if(d){M(!0);try{await v(d.name),k(new Set)}catch(e){$.error(`Failed to load models:`,e)}finally{M(!1)}}},U=async()=>{if(!d||!p.trim()){D(`Please enter an API key`);return}let e=L(d),t=e.find(e=>!h[e]?.trim());if(t){D(`Please enter ${H(t)}`);return}x(!0),D(``);try{e.length>0&&await w(Object.fromEntries(e.map(e=>[e,h[e].trim()]))),await T(d.slug,p),i(`model-selection`)}catch(e){D(e instanceof Error?e.message:`Failed to validate API key`)}finally{x(!1)}},W=async()=>{if(d){R(!0);try{for(let e of O)await y(d.slug,e);await b(),n?.(),t(!1)}catch(e){$.error(`Failed to complete onboarding:`,e)}finally{R(!1)}}},G=async()=>{R(!0);try{await b(),n?.(),t(!1)}catch(e){$.error(`Failed to skip onboarding:`,e)}finally{R(!1)}},K=e=>{f(e),m(e.apiKey??``),g(e.envValues??{}),D(``)},q=(e,t)=>{g(n=>({...n,[e]:t}))},J=()=>{i(`provider-selection`)};function Y(){r===`provider-selection`?i(`git-check`):r===`model-selection`&&i(`provider-selection`)}return(0,Q.jsx)(I,{open:e,onOpenChange:t,children:(0,Q.jsxs)(P,{className:`max-w-2xl h-[min(42rem,90dvh)] flex flex-col p-0 overflow-hidden`,children:[(0,Q.jsxs)(`div`,{className:`px-6 pt-6 pb-2`,children:[(0,Q.jsx)(ue,{currentStep:r}),(0,Q.jsx)(N,{children:(0,Q.jsx)(de,{currentStep:r})})]}),(0,Q.jsx)(A,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,Q.jsxs)(`div`,{className:`px-6 py-4`,children:[r===`git-check`&&(0,Q.jsx)(`div`,{className:`space-y-4`,children:(0,Q.jsx)(fe,{gitLoading:s,gitInstalled:a})}),r===`provider-selection`&&(0,Q.jsx)(pe,{selectedProvider:d,onProviderChange:K,apiKey:p,onApiKeyChange:m,validatingKey:_,providerEnvValues:h,onProviderEnvChange:q,keyError:E}),r===`model-selection`&&d&&(0,Q.jsx)(me,{providerSlug:d.slug,modelsLoading:j,onModelsChange:k})]})}),(0,Q.jsx)(he,{currentStep:r,savingOnboarding:F,gitLoading:s,validatingKey:_,apiKey:p,hasProvider:!!d,onSkip:()=>void G(),onBack:Y,onContinue:J,onValidate:()=>void U(),onFinish:()=>void W()})]})})}export{ge as OnboardingDialog,ge as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{s as i}from"./chunk-QFMPRPBF-COsSkB7x.js";import{Bt as a,It as o,Jt as s,Kt as c,Lt as l,Rt as u,ot as d,qt as f,zt as p}from"./dist-BWuYHVi8.js";import{Et as m}from"./dist-DIjomljy.js";import{t as h}from"./utils-CT-Dw22R.js";import{t as g}from"./button-DeNw35VZ.js";import{tt as _,yt as v,zn as y}from"./api-BMo_Lz8f.js";import{t as b}from"./use-toast-xpb5jNtN.js";import{At as x,Bn as S,Dn as C,Fn as w,In as T,Ln as E,Mt as D,Nn as O,Nt as k,Ot as A,jt as j,kn as M,kt as N,pn as P}from"./index-DjaVbFDB.js";import{t as F}from"./use-settings-page-loading-BTySlInF.js";var I=e(n(),1),L=t(),R=r(),z=`__unspecified__`,B=`__default__`;function V(e){let t=(0,L.c)(20),{value:n,onChange:r,enabledModels:i,disabled:c}=e,d=c===void 0?!1:c,m;if(t[0]!==i){m=new Map;for(let e of i){let t=e.provider??`other`,n=m.get(t);n?n.push(e):m.set(t,[e])}t[0]=i,t[1]=m}else m=t[1];let h=m,g;t[2]!==r||t[3]!==n?(g=function(e,t){let i={...n};if(t===z){delete i[e],r(i);return}let a=p(t);a&&(i[e]=a,r(i))},t[2]=r,t[3]=n,t[4]=g):g=t[4];let _=g,v;t[5]===i?v=t[6]:(v=function(e){if(!e)return;let t=e.provider.toLowerCase();return i.find(n=>n.id===e.model&&(n.provider??`other`).toLowerCase()===t)},t[5]=i,t[6]=v);let y=v,b;t[7]!==r||t[8]!==n?(b=function(e,t){let i=n[e];if(!i)return;let a={...i};if(t===B)delete a.reasoningEffort;else if(s(t))a.reasoningEffort=t;else return;r({...n,[e]:a})},t[7]=r,t[8]=n,t[9]=b):b=t[9];let S=b,T;t[10]!==d||t[11]!==i||t[12]!==y||t[13]!==_||t[14]!==S||t[15]!==h||t[16]!==n?(T=u.map(e=>{let t=n[e],r=t?a(t):z,s=y(t)?.supportedReasoningEfforts??[];return(0,R.jsx)(C,{title:l[e],description:o[e],children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(A,{value:r,onValueChange:t=>_(e,t),disabled:d,children:[(0,R.jsx)(D,{id:`model-alias-${e}`,className:`w-full min-w-0`,children:(0,R.jsx)(k,{placeholder:`Unspecified`})}),(0,R.jsxs)(N,{children:[(0,R.jsx)(x,{value:z,children:`Unspecified`}),i.length>0&&(0,R.jsx)(j,{}),[...h.entries()].map(U)]})]}),t&&s.length>0&&(0,R.jsxs)(A,{value:t.reasoningEffort??B,onValueChange:t=>S(e,t),disabled:d,children:[(0,R.jsx)(D,{id:`model-alias-${e}-reasoning`,className:`w-full min-w-0`,children:(0,R.jsx)(k,{placeholder:`Model default`})}),(0,R.jsxs)(N,{children:[(0,R.jsx)(x,{value:B,children:`Model default`}),(0,R.jsx)(x,{value:`off`,children:f(`off`)}),s.map(H)]})]})]})},e)}),t[10]=d,t[11]=i,t[12]=y,t[13]=_,t[14]=S,t[15]=h,t[16]=n,t[17]=T):T=t[17];let E;return t[18]===T?E=t[19]:(E=(0,R.jsx)(w,{id:`model-aliases`,children:T}),t[18]=T,t[19]=E),E}function H(e){return(0,R.jsx)(x,{value:e,children:f(e)},e)}function U(e){let[t,n]=e;return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:h(d.dropdownGroupHeading,`px-2 py-1.5 uppercase`),children:t}),n.map(e=>{let n=a({provider:e.provider??t,model:e.id});return(0,R.jsx)(x,{value:n,children:P(e.id)},n)})]},t)}function W(e){return[...e].sort((e,t)=>{let n=(e.provider??``).localeCompare(t.provider??``);return n===0?P(e.id).localeCompare(P(t.id)):n})}function G({projectId:e,onProjectUpdated:t}){let n=i(),[r,a]=(0,I.useState)({}),[o,s]=(0,I.useState)({}),[l,u]=(0,I.useState)([]),[d,f]=(0,I.useState)(!0),[p,h]=(0,I.useState)(!1),x=(0,I.useCallback)(async()=>{if(!e){f(!1);return}f(!0);try{let[t,n]=await Promise.all([v(e),_().catch(()=>({}))]),r=t.modelAliases??{};u(W(Object.values(n).flat())),a(r),s(r)}catch(e){b({title:`Error`,description:e instanceof Error?e.message:`Failed to load model aliases`,variant:`destructive`})}finally{f(!1)}},[e]);(0,I.useLayoutEffect)(()=>{e&&f(!0)},[e]),(0,I.useEffect)(()=>{x()},[x]);let C=F(e,[d]);function w(){return JSON.stringify(r)!==JSON.stringify(o)}async function D(){if(!(!e||!w())){h(!0);try{let i=Object.keys(r).length>0?r:void 0;if(i){let e=await _();c(i,Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.map(e=>e.id)])))}await y(e,{modelAliases:i??null}),s(r),t&&await t(),await x(),n(`/`)}catch(e){b({title:`Error`,description:e instanceof Error?e.message:`Failed to save model aliases`,variant:`destructive`})}finally{h(!1)}}}return e?(0,R.jsx)(O,{loading:C,children:(0,R.jsxs)(S,{className:`shrink-0`,children:[(0,R.jsx)(M,{title:`Model Aliases`,description:`Map short names (fast, local, cheap, smart) to enabled models. Subagents can reference these aliases in AGENT.md. Set Cheap to enable Orchestrate mode.`,action:(0,R.jsx)(g,{onClick:()=>void D(),disabled:p||d,children:p?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(m,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`}),sticky:!1}),(0,R.jsx)(E,{className:`max-w-none pt-6`,children:(0,R.jsx)(V,{value:r,onChange:a,enabledModels:l,disabled:d||p})})]})}):(0,R.jsx)(T,{title:`No project selected`,children:`Please select a project from the sidebar to configure model aliases.`})}export{G as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{c as i,s as a}from"./chunk-QFMPRPBF-COsSkB7x.js";import{G as o,S as s,at as c,ot as l}from"./dist-BWuYHVi8.js";import{Q as u,n as d}from"./store-BaMSfYoJ.js";import{$ as f,Et as p,Mt as m,On as h,ln as g,q as _,un as v,y}from"./dist-DIjomljy.js";import{n as b,o as x,t as S}from"./utils-CT-Dw22R.js";import{t as C}from"./button-DeNw35VZ.js";import{B as ee,Et as te,G as w,L as T,R as E,V as ne,W as re,an as ie,kt as ae,tt as D,vn as oe,yn as se}from"./api-BMo_Lz8f.js";import{i as ce,n as O,r as k,t as A}from"./tooltip-B6ziVyTv.js";import{n as le}from"./async-loading-fallback-B_JNgWJR.js";import{t as j}from"./suspense-resource-DnYnmTbs.js";import{t as M}from"./use-suspense-resource-Dkz6ddFN.js";import{Bn as ue,Ct as N,Et as P,Fn as F,Ft as I,I as de,In as fe,L as pe,Ln as L,On as R,Pn as z,R as B,St as me,bt as V,kn as H,o as he,pn as ge,z as U}from"./index-DjaVbFDB.js";import{t as W}from"./async-error-boundary-J8P6NVvc.js";import{t as G}from"./sorting-DqwxPMRN.js";import{t as _e}from"./pending-changes-Bn-0ak1d.js";import{o as K}from"./settings-list-DU82HNPX.js";import{t as q}from"./use-deferred-search-Dgxosq55.js";import{n as J,r as Y,t as X}from"./model-list-controls-D86_87E4.js";var Z=t(),Q=e(n(),1),$=r(),ve=x(S(l.compact,`inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`),{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function ye(e){let t=(0,Z.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=S(ve({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==a?(o=(0,$.jsx)(`div`,{className:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o}var be=s(`app.use-provider-details.hook`);function xe(e,t,n){return n?e.find(e=>e.slug===n)??null:t?e.find(e=>e.name===t)??null:null}function Se({selectedProviderName:e=null,selectedProviderSlug:t=null,providerData:n}){let r=d(),[i,a]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(``),[l,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)([]),[y,b]=(0,Q.useState)(new Set),[x,S]=(0,Q.useState)(new Set),[C,D]=(0,Q.useState)(new Map),{query:ce,setQuery:O,deferredQuery:k}=q(),[A,le]=(0,Q.useState)(`alphabetical`),[j,M]=(0,Q.useState)(`all`),[ue,N]=(0,Q.useState)(!1),[P,F]=(0,Q.useState)(``),[I,de]=(0,Q.useState)(``),[fe,pe]=(0,Q.useState)(``),[L,R]=(0,Q.useState)(`coding`),[z,B]=(0,Q.useState)([]),[V,H]=(0,Q.useState)(new Set),[he,U]=(0,Q.useState)(new Set),[W,K]=(0,Q.useState)(new Map),[J,Y]=(0,Q.useState)({}),X=e=>ge(e.id);(0,Q.useEffect)(()=>{(async()=>{if(g(``),n&&(t&&n.slug===t||e&&n.name===e)){a(n),pe(n.apiKey??``),c(n.apiKey??``),Y(n.envValues??{}),ye(n.slug),Z(n.slug);return}try{let n=xe(await ae(),e,t);a(n),pe(n?.apiKey??``),c(n?.apiKey??``),Y(n?.envValues??{}),n&&(ye(n.slug),Z(n.slug))}catch(e){g(e instanceof Error?e.message:`Failed to load providers`)}})()},[e,t,n]);let Z=async e=>{m(null);try{let t=await te(e);t.status===`success`&&m(t.balance)}catch(t){be.error(`Failed to load balance for ${e}:`,t)}};function $(){v([]),B([]),b(new Set),S(new Set),H(new Set),U(new Set),D(new Map),K(new Map)}function ve(e){return e instanceof Error?e.message:`Failed to load models from local API`}let ye=async e=>{f(!0),de(``),O(``),le(`alphabetical`),M(`all`),R(`coding`);try{let[t,n]=await Promise.all([w(e),re(e)]);v(t.models),B(n.models);let r=new Set(t.enabledModelIds);b(r),S(r);let i=new Set(n.enabledModelIds);H(i),U(i),D(new Map),K(new Map)}catch(t){be.error(`Failed to load models for ${e}:`,t),$(),de(ve(t))}finally{f(!1)}};async function Se(e){f(!0),de(``);try{await ie(e),await ye(e),r({type:u.ConfigUpdated})}catch(t){be.error(`Failed to refresh models for ${e}:`,t),$(),de(ve(t)),f(!1)}}let Ce=(e,t)=>{i?.name===e&&(c(t),Te(t))},we=(e,t)=>{Y(n=>({...n,[e]:t})),i&&(async()=>{try{await oe({[e]:t}),r({type:u.ConfigUpdated}),F(`${me(e)} saved successfully`),setTimeout(()=>F(``),3e3)}catch(e){F(e instanceof Error?e.message:`Failed to save provider settings`);return}o(i.slug)&&e===`LOCAL_API_URL`&&t.trim()&&await Se(i.slug)})()},Te=async e=>{if(!(!i||e===fe))try{await se(i.slug,e),r({type:u.ConfigUpdated}),pe(e),F(`API key saved successfully`),setTimeout(()=>F(``),3e3)}catch(e){F(e instanceof Error?e.message:`Failed to save API key`)}},Ee=(e,t)=>{t===`image`?K(t=>{let n=new Map(t),r=V.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),De(e,(n.has(e)?n.get(e):r)??!1,`image`),n}):D(t=>{let n=_e(t,e,y);return De(e,(n.has(e)?n.get(e):y.has(e))??!1,`coding`),n})},De=async(e,t,n=`coding`)=>{if(i)try{n===`image`?(t?(await ee(i.slug,e),H(t=>new Set([...t,e]))):(await T(i.slug,e),H(t=>{let n=new Set(t);return n.delete(e),n})),K(t=>{let n=new Map(t);return n.delete(e),n})):(t?(await ne(i.slug,e),b(t=>new Set([...t,e]))):(await E(i.slug,e),b(t=>{let n=new Set(t);return n.delete(e),n})),D(t=>{let n=new Map(t);return n.delete(e),n})),r({type:u.ConfigUpdated}),F(`Model preferences saved successfully`),setTimeout(()=>F(``),3e3)}catch(e){F(e instanceof Error?e.message:`Failed to save model changes`)}};async function Oe(e,t=`coding`){let n=t===`image`?z:_,r=t===`image`?V:y;(t===`image`?K:D)(t=>{let i=new Map(t);for(let t of n)r.has(t.id)===e?i.delete(t.id):i.set(t.id,e);return i});for(let i of n)r.has(i.id)!==e&&await De(i.id,e,t)}let ke=s!==void 0&&s.trim().length>0;return{selectedProvider:i,error:h,balance:p,displayApiKey:s,showApiKey:ue,setShowApiKey:N,providerEnvValues:J,modelsLoading:l,modelsError:I,saveStatus:P,modelTab:L,setModelTab:R,modelSearchQuery:ce,setModelSearchQuery:O,modelSortBy:A,setModelSortBy:le,modelFilter:j,setModelFilter:M,availableModels:_,enabledModelIds:y,pendingChanges:C,filteredAndSortedModels:(0,Q.useMemo)(()=>G({models:_,query:k,sortBy:A,getDisplayName:X,freeOnly:j===`free`,groupByProvider:!0,getPriority:e=>+!x.has(e.id)}),[_,k,j,x,A,X]),availableImageModels:z,enabledImageModelIds:V,pendingImageChanges:W,filteredAndSortedImageModels:(0,Q.useMemo)(()=>G({models:z,query:k,sortBy:A===`coding-index`||A===`intelligence-by-price`?`alphabetical`:A,getDisplayName:X,freeOnly:j===`free`,groupByProvider:!0,getPriority:e=>+!he.has(e.id)}),[z,k,j,he,A,X]),hasApiKey:ke,getModelDisplayName:X,handleUpdateKeyLocal:Ce,handleUpdateProviderEnv:we,refreshLocalProviderModels:Se,handleToggleModel:Ee,handleToggleAllModels:Oe}}function Ce(e){let t=(0,Z.c)(7),{provider:n,onBack:r}=e;if(!r&&!n.url)return null;let i;t[0]===n.url?i=t[1]:(i=n.url?(0,$.jsx)(V,{url:n.url,className:S(l.compact,`p-3`)}):null,t[0]=n.url,t[1]=i);let a;t[2]===r?a=t[3]:(a=r?(0,$.jsxs)(C,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:r,children:[(0,$.jsx)(y,{className:`h-4 w-4`}),(0,$.jsx)(`span`,{className:`sr-only`,children:`Close provider details`})]}):null,t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function we(e){let t=(0,Z.c)(6),{balance:n}=e;if(n===null)return null;let r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=S(l.compact,`inline-flex shrink-0 items-center gap-1.5 font-medium`),i=(0,$.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-green-500`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;t[2]===n?a=t[3]:(a=b(n),t[2]=n,t[3]=a);let o;return t[4]===a?o=t[5]:(o=(0,$.jsxs)(`span`,{className:r,children:[i,`$`,a,` balance`]}),t[4]=a,t[5]=o),o}function Te(e){let t=(0,Z.c)(8),{title:n,tooltip:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=S(l.label,`cursor-help`),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,$.jsx)(ce,{asChild:!0,children:(0,$.jsx)(`span`,{className:i,children:n})}),t[1]=n,t[2]=a);let o;t[3]===r?o=t[4]:(o=(0,$.jsx)(O,{children:r}),t[3]=r,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,$.jsx)(k,{children:(0,$.jsxs)(A,{children:[a,o]})}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Ee(e){let t=(0,Z.c)(10),{provider:n,displayApiKey:r,showApiKey:i,onToggleShowApiKey:a,onUpdateKey:s,providerEnvValues:c,onUpdateEnv:l,modelsLoading:u,onRefreshModels:d}=e,h;return t[0]!==r||t[1]!==u||t[2]!==d||t[3]!==a||t[4]!==l||t[5]!==s||t[6]!==n||t[7]!==c||t[8]!==i?(h=(0,$.jsx)($.Fragment,{children:n.authType===`APIKey`?(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(F,{children:[(0,$.jsx)(z,{label:(0,$.jsx)(Te,{title:`API Key`,tooltip:`Your API key is stored locally and never shared.`}),control:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(m,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,$.jsx)(I,{type:i?`text`:`password`,placeholder:n.keyName||`Enter API Key`,className:`pl-10 pr-10`,value:r,onChange:e=>{s(n.name,e.target.value)}}),(0,$.jsx)(C,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:a,disabled:!r,children:i?(0,$.jsx)(v,{className:`h-4 w-4 text-muted-foreground`}):(0,$.jsx)(g,{className:`h-4 w-4 text-muted-foreground`})})]})}),N(n).map(e=>(0,$.jsx)(z,{label:(0,$.jsx)(Te,{title:me(e),tooltip:e}),control:o(n.slug)&&e===`LOCAL_API_URL`?(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(I,{id:e,value:c[e]??``,onChange:t=>l(e,t.target.value),placeholder:n.api,className:`pr-10`,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),(0,$.jsx)(k,{children:(0,$.jsxs)(A,{children:[(0,$.jsx)(ce,{asChild:!0,children:(0,$.jsx)(C,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:()=>{d(n.slug)},disabled:u,children:u?(0,$.jsx)(p,{className:`h-4 w-4 animate-spin text-muted-foreground`}):(0,$.jsx)(f,{className:`h-4 w-4 text-muted-foreground`})})}),(0,$.jsx)(O,{children:`Refresh models`})]})})]}):(0,$.jsx)(I,{id:e,value:c[e]??``,onChange:t=>l(e,t.target.value),placeholder:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`})},e))]})}):(0,$.jsxs)(`div`,{className:`space-y-2 text-center`,children:[(0,$.jsx)(R,{className:`mb-0`,children:`This provider uses OAuth for authentication.`}),(0,$.jsxs)(C,{variant:`outline`,size:`sm`,disabled:!0,children:[`Sign in with `,n.name]})]})}),t[0]=r,t[1]=u,t[2]=d,t[3]=a,t[4]=l,t[5]=s,t[6]=n,t[7]=c,t[8]=i,t[9]=h):h=t[9],h}function De(e){let t=(0,Z.c)(22),{tab:n,model:r,displayName:i,willBeEnabled:a,hasApiKey:o,showStarRating:s,onToggle:c}=e,u=r.pricing,d=n===`image`?`image-${r.id}`:r.id,f=r.id,p=!o&&`opacity-25`,m;t[0]===p?m=t[1]:(m=S(`flex cursor-default items-center space-x-3 p-3 transition-colors hover:bg-muted/30`,p),t[0]=p,t[1]=m);let h=!o,g=a??!1,_;t[2]!==r.id||t[3]!==c?(_=()=>c(r.id),t[2]=r.id,t[3]=c,t[4]=_):_=t[4];let v;t[5]!==d||t[6]!==h||t[7]!==g||t[8]!==_?(v=(0,$.jsx)(he,{id:d,disabled:h,checked:g,onCheckedChange:_,className:`mt-0`}),t[5]=d,t[6]=h,t[7]=g,t[8]=_,t[9]=v):v=t[9];let y;t[10]!==d||t[11]!==i||t[12]!==r.coding_index||t[13]!==u||t[14]!==s||t[15]!==n?(y=n===`coding`?(0,$.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,$.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,$.jsx)(`label`,{htmlFor:d,className:S(l.body,`leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:i})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[s&&(0,$.jsx)(Y,{codingIndex:r.coding_index,modelName:i}),u&&(0,$.jsx)(`span`,{className:S(l.caption,`whitespace-nowrap`),children:(u.prompt??0)===0&&(u.completion??0)===0?``:`$${b(u.prompt??0)} in | $${b(u.completion??0)} out`})]})]}):(0,$.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,$.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,$.jsx)(`label`,{htmlFor:d,className:S(l.label,`leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:i})}),u&&(0,$.jsx)(`span`,{className:S(l.caption,`whitespace-nowrap flex-shrink-0`),children:(u.prompt??0)===0&&(u.completion??0)===0?``:`$${b(u.prompt??0)} in | $${b(u.completion??0)} out`})]}),t[10]=d,t[11]=i,t[12]=r.coding_index,t[13]=u,t[14]=s,t[15]=n,t[16]=y):y=t[16];let x;return t[17]!==r.id||t[18]!==m||t[19]!==v||t[20]!==y?(x=(0,$.jsxs)(`div`,{className:m,children:[v,y]},f),t[17]=r.id,t[18]=m,t[19]=v,t[20]=y,t[21]=x):x=t[21],x}function Oe(e){let t=(0,Z.c)(13),{tab:n,models:r,filteredModels:i,modelsLoading:a,modelsError:o,hasApiKey:s,enabledModelIds:u,pendingChanges:d,modelSortBy:f,getModelDisplayName:m,onToggleModel:h}=e,g=n===`coding`,_=g?o?`No models loaded.`:`No models available for this provider.`:`No image models available for this provider.`,v;return t[0]!==_||t[1]!==u||t[2]!==i||t[3]!==m||t[4]!==s||t[5]!==g||t[6]!==f||t[7]!==r||t[8]!==a||t[9]!==h||t[10]!==d||t[11]!==n?(v=(0,$.jsx)(`div`,{className:`flex flex-col gap-4`,children:a?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,$.jsx)(p,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):r.length===0?(0,$.jsx)(`div`,{className:`text-center py-8`,children:(0,$.jsx)(`p`,{className:l.bodyMuted,children:_})}):(0,$.jsx)(k,{children:(0,$.jsx)(`div`,{className:S(`grid grid-cols-1 gap-0`,c.tableWrapper),children:i.length===0?(0,$.jsx)(`div`,{className:`text-center py-8`,children:(0,$.jsx)(`p`,{className:l.bodyMuted,children:`No models matching your filters.`})}):i.map(e=>{let t=u.has(e.id),r=d.has(e.id),i=d.get(e.id),a=(r?i:t)??!1;return(0,$.jsx)(De,{tab:n,model:e,displayName:m(e),willBeEnabled:a,hasApiKey:s,showStarRating:g&&(f===`coding-index`||f===`intelligence-by-price`),onToggle:e=>h(e,n)},e.id)})})})}),t[0]=_,t[1]=u,t[2]=i,t[3]=m,t[4]=s,t[5]=g,t[6]=f,t[7]=r,t[8]=a,t[9]=h,t[10]=d,t[11]=n,t[12]=v):v=t[12],v}function ke(e){let t=(0,Z.c)(22),{tab:n,showImageTab:r,modelsLoading:i,models:a,hasApiKey:o,enabledModelIds:s,pendingChanges:c,modelSearchQuery:l,onModelSearchQueryChange:u,modelSortBy:d,onModelSortByChange:f,onToggleAllModels:p}=e,m=n===`coding`,h=m?`select-all-models`:`select-all-image-models`,g=!i&&a.length>0,v=g&&!o&&`opacity-25`,y;t[0]===v?y=t[1]:(y=S(`flex flex-col gap-2 md:flex-row md:items-center`,v),t[0]=v,t[1]=y);let b;t[2]===r?b=t[3]:(b=r?(0,$.jsxs)(B,{className:`w-fit shrink-0 self-start`,children:[(0,$.jsx)(U,{value:`coding`,children:`Coding`}),(0,$.jsx)(U,{value:`image`,children:`Image`})]}):null,t[2]=r,t[3]=b);let x;t[4]!==s||t[5]!==o||t[6]!==m||t[7]!==l||t[8]!==d||t[9]!==a||t[10]!==u||t[11]!==f||t[12]!==p||t[13]!==c||t[14]!==h||t[15]!==g||t[16]!==n?(x=g?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`relative w-full md:w-52 flex-shrink-0`,children:[(0,$.jsx)(_,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,$.jsx)(I,{placeholder:`Search`,className:`pl-10 h-8`,value:l,onChange:e=>u(e.target.value),disabled:!o})]}),(0,$.jsxs)(`div`,{className:`flex flex-shrink-0 items-center gap-2 self-end md:ml-auto md:self-auto`,children:[(0,$.jsx)(X,{id:h,disabled:!o,checked:a.every(e=>{let t=c.has(e.id),n=c.get(e.id);return t?n:s.has(e.id)}),onChange:e=>{p(e,n)}}),(0,$.jsx)(J,{sortBy:d,showCodingIndex:m,showIntelligenceByPrice:m,onSortByChange:f})]})]}):null,t[4]=s,t[5]=o,t[6]=m,t[7]=l,t[8]=d,t[9]=a,t[10]=u,t[11]=f,t[12]=p,t[13]=c,t[14]=h,t[15]=g,t[16]=n,t[17]=x):x=t[17];let C;return t[18]!==y||t[19]!==b||t[20]!==x?(C=(0,$.jsxs)(`div`,{className:y,children:[b,x]}),t[18]=y,t[19]=b,t[20]=x,t[21]=C):C=t[21],C}function Ae(e){let t=(0,Z.c)(10),{title:n,description:r,action:i,tableHeader:a,children:o}=e,s;t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==n?(s=(0,$.jsx)(H,{title:n,description:r,action:i,sticky:!1,tableHeader:a}),t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=s):s=t[4];let c;t[5]===o?c=t[6]:(c=(0,$.jsx)(`div`,{className:`px-6 pb-6`,children:o}),t[5]=o,t[6]=c);let l;return t[7]!==s||t[8]!==c?(l=(0,$.jsxs)(ue,{className:`shrink-0`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function je(e){let t=(0,Z.c)(111),{selectedProviderName:n,selectedProviderSlug:r,providerData:i,onBack:a,className:o}=e,s=n===void 0?null:n,c=r===void 0?null:r,l;t[0]!==i||t[1]!==s||t[2]!==c?(l={selectedProviderName:s,selectedProviderSlug:c,providerData:i},t[0]=i,t[1]=s,t[2]=c,t[3]=l):l=t[3];let{selectedProvider:u,error:d,balance:f,displayApiKey:p,showApiKey:m,setShowApiKey:g,providerEnvValues:_,modelsLoading:v,modelsError:y,saveStatus:b,modelTab:x,setModelTab:ee,modelSearchQuery:te,setModelSearchQuery:w,modelSortBy:T,setModelSortBy:E,availableModels:ne,enabledModelIds:re,pendingChanges:ie,filteredAndSortedModels:ae,availableImageModels:D,enabledImageModelIds:oe,pendingImageChanges:se,filteredAndSortedImageModels:ce,hasApiKey:O,getModelDisplayName:k,handleUpdateKeyLocal:A,handleUpdateProviderEnv:le,refreshLocalProviderModels:j,handleToggleModel:M,handleToggleAllModels:ue}=Se(l);if(d){let e;t[4]===o?e=t[5]:(e=S(`flex h-full min-h-0 flex-col items-center justify-center gap-4 p-6`,o),t[4]=o,t[5]=e);let n;t[6]===d?n=t[7]:(n=(0,$.jsx)(R,{variant:`error`,className:`mb-0`,children:d}),t[6]=d,t[7]=n);let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(C,{variant:`outline`,size:`sm`,onClick:Me,children:`Retry`}),t[8]=r):r=t[8];let i;return t[9]!==e||t[10]!==n?(i=(0,$.jsxs)(`div`,{className:e,children:[n,r]}),t[9]=e,t[10]=n,t[11]=i):i=t[11],i}if(!u){let e;t[12]===o?e=t[13]:(e=S(`flex h-full min-h-0 items-center justify-center`,o),t[12]=o,t[13]=e);let n=s||c?`Provider not found`:`Select a Provider`,r;t[14]===a?r=t[15]:(r=a?(0,$.jsxs)(C,{variant:`outline`,size:`sm`,onClick:a,children:[(0,$.jsx)(h,{className:`h-4 w-4 mr-1`}),`Back to Providers`]}):void 0,t[14]=a,t[15]=r);let i=a?`This provider could not be found.`:`Choose a provider from the list to configure its settings.`,l;t[16]!==n||t[17]!==r||t[18]!==i?(l=(0,$.jsx)(fe,{title:n,action:r,children:i}),t[16]=n,t[17]=r,t[18]=i,t[19]=l):l=t[19];let u;return t[20]!==e||t[21]!==l?(u=(0,$.jsx)(`div`,{className:e,children:l}),t[20]=e,t[21]=l,t[22]=u):u=t[22],u}let N;t[23]===o?N=t[24]:(N=S(`h-full min-h-0`,o),t[23]=o,t[24]=N);let P;t[25]!==a||t[26]!==u?(P=(0,$.jsx)(Ce,{provider:u,onBack:a}),t[25]=a,t[26]=u,t[27]=P):P=t[27];let F;t[28]!==g||t[29]!==m?(F=()=>g(!m),t[28]=g,t[29]=m,t[30]=F):F=t[30];let I;t[31]!==p||t[32]!==A||t[33]!==le||t[34]!==v||t[35]!==_||t[36]!==j||t[37]!==u||t[38]!==m||t[39]!==F?(I=(0,$.jsx)(`div`,{className:`pt-6`,children:(0,$.jsx)(Ee,{provider:u,displayApiKey:p,showApiKey:m,onToggleShowApiKey:F,onUpdateKey:A,providerEnvValues:_,onUpdateEnv:le,modelsLoading:v,onRefreshModels:j})}),t[31]=p,t[32]=A,t[33]=le,t[34]=v,t[35]=_,t[36]=j,t[37]=u,t[38]=m,t[39]=F,t[40]=I):I=t[40];let L;t[41]!==u.name||t[42]!==P||t[43]!==I?(L=(0,$.jsx)(Ae,{title:u.name,description:`Configure API keys and connection settings for this provider.`,action:P,children:I}),t[41]=u.name,t[42]=P,t[43]=I,t[44]=L):L=t[44];let z;t[45]!==w||t[46]!==E||t[47]!==ee?(z=e=>{ee(e),w(``),E(`alphabetical`)},t[45]=w,t[46]=E,t[47]=ee,t[48]=z):z=t[48];let B;t[49]===f?B=t[50]:(B=(0,$.jsx)(we,{balance:f}),t[49]=f,t[50]=B);let me;t[51]===u.name?me=t[52]:(me=u.name.toLowerCase(),t[51]=u.name,t[52]=me);let V=me===`openrouter`,H=x===`coding`?ne:D,he=x===`coding`?re:oe,ge=x===`coding`?ie:se,U;t[53]!==ue||t[54]!==O||t[55]!==te||t[56]!==T||t[57]!==x||t[58]!==v||t[59]!==w||t[60]!==E||t[61]!==V||t[62]!==H||t[63]!==he||t[64]!==ge?(U=(0,$.jsx)(ke,{tab:x,showImageTab:V,modelsLoading:v,models:H,hasApiKey:O,enabledModelIds:he,pendingChanges:ge,modelSearchQuery:te,onModelSearchQueryChange:w,modelSortBy:T,onModelSortByChange:E,onToggleAllModels:ue}),t[53]=ue,t[54]=O,t[55]=te,t[56]=T,t[57]=x,t[58]=v,t[59]=w,t[60]=E,t[61]=V,t[62]=H,t[63]=he,t[64]=ge,t[65]=U):U=t[65];let W;t[66]===y?W=t[67]:(W=y?(0,$.jsx)(R,{variant:`error`,className:`mb-4`,children:y}):null,t[66]=y,t[67]=W);let G;t[68]!==ne||t[69]!==re||t[70]!==ae||t[71]!==k||t[72]!==M||t[73]!==O||t[74]!==T||t[75]!==y||t[76]!==v||t[77]!==ie||t[78]!==u?(G=(0,$.jsx)(pe,{value:`coding`,children:(0,$.jsx)(Oe,{tab:`coding`,provider:u,models:ne,filteredModels:ae,modelsLoading:v,modelsError:y,hasApiKey:O,enabledModelIds:re,pendingChanges:ie,modelSortBy:T,getModelDisplayName:k,onToggleModel:M})}),t[68]=ne,t[69]=re,t[70]=ae,t[71]=k,t[72]=M,t[73]=O,t[74]=T,t[75]=y,t[76]=v,t[77]=ie,t[78]=u,t[79]=G):G=t[79];let _e;t[80]!==D||t[81]!==oe||t[82]!==ce||t[83]!==k||t[84]!==M||t[85]!==O||t[86]!==T||t[87]!==y||t[88]!==v||t[89]!==se||t[90]!==u?(_e=(0,$.jsx)(pe,{value:`image`,children:(0,$.jsx)(Oe,{tab:`image`,provider:u,models:D,filteredModels:ce,modelsLoading:v,modelsError:y,hasApiKey:O,enabledModelIds:oe,pendingChanges:se,modelSortBy:T,getModelDisplayName:k,onToggleModel:M})}),t[80]=D,t[81]=oe,t[82]=ce,t[83]=k,t[84]=M,t[85]=O,t[86]=T,t[87]=y,t[88]=v,t[89]=se,t[90]=u,t[91]=_e):_e=t[91];let K;t[92]===b?K=t[93]:(K=b?(0,$.jsx)(R,{variant:b.includes(`error`)||b.includes(`Failed`)?`error`:`success`,className:`mt-4`,children:b}):null,t[92]=b,t[93]=K);let q;t[94]!==B||t[95]!==U||t[96]!==W||t[97]!==G||t[98]!==_e||t[99]!==K?(q=(0,$.jsxs)(Ae,{title:`Models`,description:`Enable coding and image models for this provider.`,action:B,tableHeader:U,children:[W,G,_e,K]}),t[94]=B,t[95]=U,t[96]=W,t[97]=G,t[98]=_e,t[99]=K,t[100]=q):q=t[100];let J;t[101]!==x||t[102]!==q||t[103]!==z?(J=(0,$.jsx)(de,{value:x,onValueChange:z,children:q}),t[101]=x,t[102]=q,t[103]=z,t[104]=J):J=t[104];let Y;t[105]!==J||t[106]!==L?(Y=(0,$.jsx)(`div`,{className:`frosted-scrollbar h-full min-h-0 overflow-auto`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[L,J]})}),t[105]=J,t[106]=L,t[107]=Y):Y=t[107];let X;return t[108]!==Y||t[109]!==N?(X=(0,$.jsx)(`div`,{className:N,children:Y}),t[108]=Y,t[109]=N,t[110]=X):X=t[110],X}function Me(){return window.location.reload()}function Ne(e){return`providers:list:${e}`}async function Pe(){let[e,t]=await Promise.all([ae(),D().catch(()=>({}))]),n={};for(let[e,r]of Object.entries(t))n[e]=r.length;return{providers:e,enabledModelCounts:n}}var Fe=`grid min-h-10 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 px-3 py-2 hover:bg-muted/30 cursor-pointer`,Ie=`[&>*+*]:border-t [&>*+*]:border-table-border`;function Le(e){let t=(0,Z.c)(9),{title:n,description:r,action:i,children:a}=e,o;t[0]!==i||t[1]!==r||t[2]!==n?(o=(0,$.jsx)(H,{title:n,description:r,action:i,sticky:!1}),t[0]=i,t[1]=r,t[2]=n,t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=(0,$.jsx)(L,{className:`pt-6`,children:a}),t[4]=a,t[5]=s);let c;return t[6]!==o||t[7]!==s?(c=(0,$.jsxs)(ue,{className:`shrink-0`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function Re(e){let t=(0,Z.c)(33),{loadVersion:n,onProviderClick:r}=e,{query:i,setQuery:a,deferredQuery:o}=q(),s;t[0]===n?s=t[1]:(s=Ne(n),t[0]=n,t[1]=s);let{providers:c,enabledModelCounts:u}=M(s,Pe),d;if(t[2]!==o||t[3]!==u||t[4]!==c){let e;t[6]===o?e=t[7]:(e=e=>{let t=o.toLowerCase();return e.name.toLowerCase().includes(t)},t[6]=o,t[7]=e);let n;t[8]===u?n=t[9]:(n=(e,t)=>{let n=(u[e.slug]??0)>0,r=(u[t.slug]??0)>0;return n&&!r?-1:!n&&r?1:e.name.localeCompare(t.name)},t[8]=u,t[9]=n),d=c.filter(Ve).filter(e).sort(n),t[2]=o,t[3]=u,t[4]=c,t[5]=d}else d=t[5];let f=d,p;if(t[10]!==o||t[11]!==c){let e;t[13]===o?e=t[14]:(e=e=>{let t=o.toLowerCase();return e.name.toLowerCase().includes(t)},t[13]=o,t[14]=e),p=c.filter(Be).filter(e).sort(ze),t[10]=o,t[11]=c,t[12]=p}else p=t[12];let m=p,h;t[15]!==i||t[16]!==a?(h=(0,$.jsx)(K,{placeholder:`Search`,value:i,onChange:a,className:`mb-0 w-64`}),t[15]=i,t[16]=a,t[17]=h):h=t[17];let g;t[18]!==f||t[19]!==u||t[20]!==r||t[21]!==i?(g=f.length===0?(0,$.jsx)(`p`,{className:S(l.bodyMuted,`py-4`),children:i?`No connected providers match your search.`:`No providers connected yet. Add an API key to get started.`}):(0,$.jsx)(`div`,{className:Ie,children:f.map(e=>(0,$.jsx)(Je,{provider:e,modelCount:u[e.slug]??0,onClick:r},e.name))}),t[18]=f,t[19]=u,t[20]=r,t[21]=i,t[22]=g):g=t[22];let _;t[23]!==h||t[24]!==g?(_=(0,$.jsx)(Le,{title:`Connected Providers`,description:`Providers you've connected with an API key or environment variable.`,action:h,children:g}),t[23]=h,t[24]=g,t[25]=_):_=t[25];let v;t[26]!==m||t[27]!==r||t[28]!==i?(v=(0,$.jsx)(Le,{title:`Available Providers`,description:`Connect additional providers by adding your API key.`,children:m.length===0?(0,$.jsx)(`p`,{className:S(l.bodyMuted,`py-4`),children:i?`No available providers match your search.`:`All providers are connected.`}):(0,$.jsx)(`div`,{className:Ie,children:m.map(e=>(0,$.jsx)(Ye,{provider:e,onClick:r},e.name))})}),t[26]=m,t[27]=r,t[28]=i,t[29]=v):v=t[29];let y;return t[30]!==_||t[31]!==v?(y=(0,$.jsx)(`div`,{className:`frosted-scrollbar h-full min-h-0 overflow-auto`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[_,v]})}),t[30]=_,t[31]=v,t[32]=y):y=t[32],y}function ze(e,t){return e.name.localeCompare(t.name)}function Be(e){return!e.apiKey}function Ve(e){return e.apiKey}function He(){let e=(0,Z.c)(21),t=a(),{providerSlug:n}=i(),[r,o]=(0,Q.useState)(0),s=(0,Q.useRef)(n),c,l;e[0]!==r||e[1]!==n?(c=()=>{s.current&&!n&&(j(Ne(r)),o(Ke)),s.current=n},l=[n,r],e[0]=r,e[1]=n,e[2]=c,e[3]=l):(c=e[2],l=e[3]),(0,Q.useEffect)(c,l);let u;e[4]===t?u=e[5]:(u=e=>{t(`/settings/providers/${encodeURIComponent(e.slug)}`)},e[4]=t,e[5]=u);let d=u,f;e[6]!==r||e[7]!==t?(f=()=>{t(`/settings/providers`),j(Ne(r)),o(Ge)},e[6]=r,e[7]=t,e[8]=f):f=e[8];let p=f,m;e[9]===r?m=e[10]:(m=function(){j(Ne(r)),o(We)},e[9]=r,e[10]=m);let h=m;if(n){let t=decodeURIComponent(n),r;return e[11]!==p||e[12]!==t?(r=(0,$.jsx)(je,{selectedProviderSlug:t,onBack:p}),e[11]=p,e[12]=t,e[13]=r):r=e[13],r}let g;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(le,{label:`Loading providers...`,size:`lg`}),e[14]=g):g=e[14];let _;e[15]!==d||e[16]!==r?(_=(0,$.jsx)(Q.Suspense,{fallback:g,children:(0,$.jsx)(Re,{loadVersion:r,onProviderClick:d},r)}),e[15]=d,e[16]=r,e[17]=_):_=e[17];let v;return e[18]!==h||e[19]!==_?(v=(0,$.jsx)(`div`,{className:`h-full min-h-0`,children:(0,$.jsx)(W,{fallbackTitle:`Failed to load providers`,onRetry:h,renderFallback:Ue,children:_})}),e[18]=h,e[19]=_,e[20]=v):v=e[20],v}function Ue(e,t){return(0,$.jsx)(`div`,{className:`frosted-scrollbar h-full min-h-0 overflow-auto`,children:(0,$.jsxs)(ue,{className:`shrink-0`,children:[(0,$.jsx)(H,{title:`Providers`,description:`Manage your AI provider connections and API keys.`,sticky:!1}),(0,$.jsx)(`div`,{className:`flex items-center justify-center px-6 pb-6 pt-6`,children:(0,$.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,$.jsx)(R,{variant:`error`,className:`mb-4`,children:e.message}),(0,$.jsx)(C,{variant:`outline`,size:`sm`,onClick:t,children:`Retry`})]})})]})})}function We(e){return e+1}function Ge(e){return e+1}function Ke(e){return e+1}function qe(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())}function Je(e){let t=(0,Z.c)(25),{provider:n,modelCount:r,onClick:i}=e,a;t[0]!==i||t[1]!==n?(a=function(){i(n)},t[0]=i,t[1]=n,t[2]=a):a=t[2];let o=a,s;t[3]===o?s=t[4]:(s=e=>qe(e,o),t[3]=o,t[4]=s);let c;t[5]===n?c=t[6]:(c=(0,$.jsx)(P,{provider:n}),t[5]=n,t[6]=c);let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=S(l.label,`truncate leading-normal`),t[7]=u):u=t[7];let d;t[8]===n.name?d=t[9]:(d=(0,$.jsx)(`span`,{className:u,children:n.name}),t[8]=n.name,t[9]=d);let f;t[10]!==c||t[11]!==d?(f=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[c,d]}),t[10]=c,t[11]=d,t[12]=f):f=t[12];let p;t[13]===n.isEnv?p=t[14]:(p=n.isEnv?(0,$.jsx)(ye,{variant:`secondary`,className:S(l.compact,`px-2 py-0.5`),children:`Environment`}):(0,$.jsx)(ye,{variant:`secondary`,className:S(l.compact,`px-2 py-0.5`),children:`API Key`}),t[13]=n.isEnv,t[14]=p);let m;t[15]===r?m=t[16]:(m=r>0&&(0,$.jsxs)(ye,{variant:`default`,className:S(l.compact,`px-2 py-0.5`),children:[r,` `,r===1?`Model`:`Models`]}),t[15]=r,t[16]=m);let h;t[17]!==p||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-1.5`,children:[p,m]}),t[17]=p,t[18]=m,t[19]=h):h=t[19];let g;return t[20]!==o||t[21]!==s||t[22]!==f||t[23]!==h?(g=(0,$.jsxs)(`div`,{className:Fe,role:`button`,tabIndex:0,onClick:o,onKeyDown:s,children:[f,h]}),t[20]=o,t[21]=s,t[22]=f,t[23]=h,t[24]=g):g=t[24],g}function Ye(e){let t=(0,Z.c)(18),{provider:n,onClick:r}=e,i;t[0]!==r||t[1]!==n?(i=function(){r(n)},t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===a?o=t[4]:(o=e=>qe(e,a),t[3]=a,t[4]=o);let s;t[5]===n?s=t[6]:(s=(0,$.jsx)(P,{provider:n}),t[5]=n,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=S(l.label,`truncate leading-normal`),t[7]=c):c=t[7];let u;t[8]===n.name?u=t[9]:(u=(0,$.jsx)(`span`,{className:c,children:n.name}),t[8]=n.name,t[9]=u);let d;t[10]!==s||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`span`,{className:S(l.compact,`shrink-0 text-muted-foreground`),children:`Configure`}),t[13]=f):f=t[13];let p;return t[14]!==a||t[15]!==o||t[16]!==d?(p=(0,$.jsxs)(`div`,{className:Fe,role:`button`,tabIndex:0,onClick:a,onKeyDown:o,children:[d,f]}),t[14]=a,t[15]=o,t[16]=d,t[17]=p):p=t[17],p}export{He as ProvidersListView,He as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./react-vendor-Ee0-5T4I.js";import{ot as ee}from"./dist-BWuYHVi8.js";import{I as te}from"./dist-DIjomljy.js";import{t as n}from"./button-DeNw35VZ.js";import{i as r,n as i,r as a,t as o}from"./tooltip-B6ziVyTv.js";import{a as s,i as ne,o as re,r as ie,s as c,t as l}from"./dialog-Do98zzAW.js";import{Ft as u,Pt as d,Y as f,un as p,vt as ae}from"./index-DjaVbFDB.js";var oe=e(),m=t();function h(e){let t=(0,oe.c)(58),{open:h,onOpenChange:g,prTitle:_,onPrTitleChange:v,prDescription:y,onPrDescriptionChange:b,isGeneratingPRInfo:x,isLoading:S,onGeneratePRInfo:C,onCreatePR:w,currentBranch:T,createWorkspaceAfterPR:E,onCreateWorkspaceAfterPRChange:D}=e,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,m.jsx)(c,{children:`Create Pull Request`}),t[0]=O):O=t[0];let k;t[1]===T?k=t[2]:(k=(0,m.jsxs)(re,{children:[O,(0,m.jsxs)(ne,{children:[`Create a pull request for branch `,T]})]}),t[1]=T,t[2]=k);let A;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,m.jsx)(d,{htmlFor:`pr-title`,children:`Title`}),t[3]=A):A=t[3];let j=T||`Enter PR title...`,M;t[4]===v?M=t[5]:(M=e=>v(e.target.value),t[4]=v,t[5]=M);let N;t[6]!==x||t[7]!==_||t[8]!==j||t[9]!==M?(N=(0,m.jsxs)(`div`,{className:`grid gap-2`,children:[A,(0,m.jsx)(u,{id:`pr-title`,placeholder:j,value:_,onChange:M,disabled:x})]}),t[6]=x,t[7]=_,t[8]=j,t[9]=M,t[10]=N):N=t[10];let P;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,m.jsx)(d,{htmlFor:`pr-description`,children:`Description`}),t[11]=P):P=t[11];let F;t[12]===b?F=t[13]:(F=e=>b(e.target.value),t[12]=b,t[13]=F);let I;t[14]!==x||t[15]!==y||t[16]!==F?(I=(0,m.jsx)(f,{id:`pr-description`,placeholder:`Enter PR description...`,value:y,onChange:F,disabled:x,className:`pr-10 h-full min-h-[14rem] resize-none`}),t[14]=x,t[15]=y,t[16]=F,t[17]=I):I=t[17];let L=x||S,R;t[18]===x?R=t[19]:(R=x?(0,m.jsx)(p,{}):(0,m.jsx)(te,{className:`h-3.5 w-3.5`}),t[18]=x,t[19]=R);let z;t[20]!==C||t[21]!==L||t[22]!==R?(z=(0,m.jsx)(r,{asChild:!0,children:(0,m.jsx)(n,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute top-2 right-2 h-6 w-6`,onClick:C,disabled:L,children:R})}),t[20]=C,t[21]=L,t[22]=R,t[23]=z):z=t[23];let B=x?`Generating PR description...`:`Generate PR title and description with AI`,V;t[24]===B?V=t[25]:(V=(0,m.jsx)(i,{children:B}),t[24]=B,t[25]=V);let H;t[26]!==z||t[27]!==V?(H=(0,m.jsx)(a,{children:(0,m.jsxs)(o,{children:[z,V]})}),t[26]=z,t[27]=V,t[28]=H):H=t[28];let U;t[29]!==H||t[30]!==I?(U=(0,m.jsxs)(`div`,{className:`grid gap-2 flex-1 min-h-0`,children:[P,(0,m.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[I,H]})]}),t[29]=H,t[30]=I,t[31]=U):U=t[31];let W;t[32]!==U||t[33]!==N?(W=(0,m.jsxs)(`div`,{className:`grid gap-4 py-4 flex-1 min-h-0`,children:[N,U]}),t[32]=U,t[33]=N,t[34]=W):W=t[34];let G;t[35]!==E||t[36]!==D?(G=(0,m.jsx)(ae,{value:E,onChange:D,ariaLabel:`Also create new workspace`}),t[35]=E,t[36]=D,t[37]=G):G=t[37];let K;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,m.jsx)(d,{className:ee.labelNormal,children:`Also create new workspace`}),t[38]=K):K=t[38];let q;t[39]===G?q=t[40]:(q=(0,m.jsxs)(`div`,{className:`mr-auto flex items-center gap-3`,children:[G,K]}),t[39]=G,t[40]=q);let J=S||x,Y;t[41]===S?Y=t[42]:(Y=S?(0,m.jsxs)(m.Fragment,{children:[`Create PR`,(0,m.jsx)(p,{size:`sm`})]}):`Create PR`,t[41]=S,t[42]=Y);let X;t[43]!==w||t[44]!==J||t[45]!==Y?(X=(0,m.jsx)(n,{className:`ml-auto`,onClick:w,disabled:J,children:Y}),t[43]=w,t[44]=J,t[45]=Y,t[46]=X):X=t[46];let Z;t[47]!==q||t[48]!==X?(Z=(0,m.jsxs)(s,{className:`w-full items-center gap-4`,children:[q,X]}),t[47]=q,t[48]=X,t[49]=Z):Z=t[49];let Q;t[50]!==W||t[51]!==k||t[52]!==Z?(Q=(0,m.jsxs)(ie,{className:`flex max-w-2xl flex-col max-md:top-[max(1rem,env(safe-area-inset-top,0px))] max-md:max-h-[calc(100dvh-2rem)] max-md:translate-y-0 max-md:overflow-y-auto max-md:data-[state=closed]:slide-out-to-top max-md:data-[state=open]:slide-in-from-top max-md:data-[state=closed]:slide-out-to-left-0 max-md:data-[state=open]:slide-in-from-left-0 max-md:data-[state=closed]:zoom-out-100 max-md:data-[state=open]:zoom-in-100 md:h-[min(36rem,85dvh)]`,children:[k,W,Z]}),t[50]=W,t[51]=k,t[52]=Z,t[53]=Q):Q=t[53];let $;return t[54]!==g||t[55]!==h||t[56]!==Q?($=(0,m.jsx)(l,{open:h,onOpenChange:g,children:Q}),t[54]=g,t[55]=h,t[56]=Q,t[57]=$):$=t[57],$}export{h as PullRequestDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{S as i,ot as a}from"./dist-BWuYHVi8.js";import{An as o,Et as s,M as c,N as l,Nt as u,Sn as d,Tn as f,Vn as p,Z as m,g as h,gt as g,h as _,ht as v,t as y,u as b,wn as x,yn as ee}from"./dist-DIjomljy.js";import{c as S,t as C}from"./utils-CT-Dw22R.js";import{t as w}from"./button-DeNw35VZ.js";import{$ as T,Nr as E,Pi as te,Rn as D,kr as ne,mi as O}from"./api-BMo_Lz8f.js";import{t as re}from"./dist-mdooLpmq.js";import{i as ie,n as ae,t as oe}from"./tooltip-B6ziVyTv.js";import{t as se}from"./dist-OixawqbU.js";import{i as ce}from"./scroll-area-nbNFO91g.js";import{t as le}from"./dist-CWq9XRXF.js";import{t as ue}from"./use-toast-xpb5jNtN.js";import{t as de}from"./dist-CSssbxDI.js";import{Bn as fe,Dn as k,F as pe,Fn as me,Ft as he,Ln as ge,Nn as _e,P as ve,U as ye,_t as be,gt as xe,kn as Se,n as Ce,r as we,t as Te,vt as Ee}from"./index-DjaVbFDB.js";import{n as De,t as Oe}from"./toggle-group-5tREtjoW.js";import{t as ke}from"./use-settings-page-loading-BTySlInF.js";import{t as Ae}from"./is-macos-client-BIb4ZSEa.js";var je=t(),A=e(n(),1),j=r(),Me=[`PageUp`,`PageDown`],Ne=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Pe={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},M=`Slider`,[N,Fe,Ie]=le(M),[Le,Re]=_(M,[Ie]),[ze,Be]=Le(M),P=A.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...g}=e,_=A.useRef(new Set),v=A.useRef(0),b=o===`horizontal`?Ve:He,[x=[],ee]=y({prop:u,defaultProp:l,onChange:e=>{[..._.current][v.current]?.focus(),d(e)}}),S=A.useRef(x);function C(e){E(e,et(x,e))}function w(e){E(e,v.current)}function T(){let e=S.current[v.current];x[v.current]!==e&&f(x)}function E(e,t,{commit:n}={commit:!1}){let o=rt(a),s=ce(it(Math.round((e-r)/a)*a+r,o),[r,i]);ee((e=[])=>{let r=Qe(e,s,t);if(tt(r,c*a)){v.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}else return e})}return(0,j.jsx)(ze,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:v,thumbs:_.current,values:x,orientation:o,form:m,children:(0,j.jsx)(N.Provider,{scope:e.__scopeSlider,children:(0,j.jsx)(N.Slot,{scope:e.__scopeSlider,children:(0,j.jsx)(b,{"aria-disabled":s,"data-disabled":s?``:void 0,...g,ref:t,onPointerDown:h(g.onPointerDown,()=>{s||(S.current=x)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:C,onSlideMove:s?void 0:w,onSlideEnd:s?void 0:T,onHomeKeyDown:()=>!s&&E(r,0,{commit:!0}),onEndKeyDown:()=>!s&&E(i,x.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=Me.includes(e.key)||e.shiftKey&&Ne.includes(e.key)?10:1,r=v.current,i=x[r];E(i+a*n*t,r,{commit:!0})}}})})})})});P.displayName=M;var[F,I]=Le(M,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Ve=A.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=A.useState(null),p=S(t,e=>f(e)),m=A.useRef(void 0),h=se(i),g=h===`ltr`,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=nt([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,j.jsx)(F,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:(0,j.jsx)(Ue,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=Pe[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),He=A.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=A.useRef(null),d=S(t,u),f=A.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=nt([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,j.jsx)(F,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,j.jsx)(Ue,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=Pe[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),Ue=A.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Be(M,n);return(0,j.jsx)(b.span,{...l,ref:t,onKeyDown:h(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Me.concat(Ne).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:h(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:h(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:h(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),We=`SliderTrack`,Ge=A.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Be(We,n);return(0,j.jsx)(b.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});Ge.displayName=We;var Ke=`SliderRange`,qe=A.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Be(Ke,n),a=I(Ke,n),o=S(t,A.useRef(null)),s=i.values.length,c=i.values.map(e=>R(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,j.jsx)(b.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})});qe.displayName=Ke;var Je=`SliderThumb`,Ye=A.forwardRef((e,t)=>{let n=Fe(e.__scopeSlider),[r,i]=A.useState(null),a=S(t,e=>i(e)),o=A.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,j.jsx)(Xe,{...e,ref:a,index:o})}),Xe=A.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=Be(Je,n),s=I(Je,n),[c,l]=A.useState(null),u=S(t,e=>l(e)),d=c?o.form||!!c.closest(`form`):!0,f=re(c),p=o.values[r],m=p===void 0?0:R(p,o.min,o.max),g=$e(r,o.values.length),_=f?.[s.size],v=_?z(_,m,s.direction):0;return A.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,j.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${v}px)`},children:[(0,j.jsx)(N.ItemSlot,{scope:e.__scopeSlider,children:(0,j.jsx)(b.span,{role:`slider`,"aria-label":e[`aria-label`]||g,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,tabIndex:o.disabled?void 0:0,...a,ref:u,style:p===void 0?{display:`none`}:e.style,onFocus:h(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&(0,j.jsx)(L,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});Ye.displayName=Je;var Ze=`RadioBubbleInput`,L=A.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=A.useRef(null),a=S(i,r),o=de(t);return A.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,j.jsx)(b.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});L.displayName=Ze;function Qe(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function R(e,t,n){return ce(100/(n-t)*(e-t),[0,100])}function $e(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function et(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function z(e,t,n){let r=e/2;return(r-nt([0,50],[0,r])(t)*n)*n}function B(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function tt(e,t){if(t>0){let n=B(e);return Math.min(...n)>=t}return!0}function nt(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function rt(e){return(String(e).split(`.`)[1]||``).length}function it(e,t){let n=10**t;return Math.round(e*n)/n}var at=P,ot=Ge,st=qe,ct=Ye,lt=A.forwardRef((e,t)=>{let n=(0,je.c)(22),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,valueTooltip:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let[o,s]=A.useState(!1),[c,l]=A.useState(!1),u,d;n[4]===c?(u=n[5],d=n[6]):(u=()=>{if(!c)return;let e=function(){l(!1)};return document.addEventListener(`pointerup`,e),()=>{document.removeEventListener(`pointerup`,e)}},d=[c],n[4]=c,n[5]=u,n[6]=d),A.useEffect(u,d);let f;n[7]===a?f=n[8]:(f=(0,j.jsx)(ct,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,onPointerDown:()=>{a!=null&&(l(!0),s(!0))}}),n[7]=a,n[8]=f);let p=f,m;n[9]===r?m=n[10]:(m=C(`relative flex w-full touch-none select-none items-center`,r),n[9]=r,n[10]=m);let h;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,j.jsx)(ot,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,j.jsx)(st,{className:`absolute h-full bg-primary`})}),n[11]=h):h=n[11];let g;n[12]!==c||n[13]!==o||n[14]!==p||n[15]!==a?(g=a==null?p:(0,j.jsxs)(oe,{open:o||c,onOpenChange:s,children:[(0,j.jsx)(ie,{asChild:!0,children:p}),(0,j.jsx)(ae,{side:`top`,children:a})]}),n[12]=c,n[13]=o,n[14]=p,n[15]=a,n[16]=g):g=n[16];let _;return n[17]!==i||n[18]!==t||n[19]!==m||n[20]!==g?(_=(0,j.jsxs)(at,{ref:t,className:m,...i,children:[h,g]}),n[17]=i,n[18]=t,n[19]=m,n[20]=g,n[21]=_):_=n[21],_});lt.displayName=at.displayName;var ut=i(`app.use-maximum-turn-count.hook`),dt=100;function ft(){let[e,t]=(0,A.useState)(dt),[n,r]=(0,A.useState)(dt.toString()),[i,a]=(0,A.useState)(!0),[o,s]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let e=!1;async function n(){try{let n=await T();e||(t(n.maximumTurnCount),r(n.maximumTurnCount.toString()))}catch(e){ut.error(`Failed to load maximum turn count:`,e)}finally{e||a(!1)}}return n(),()=>{e=!0}},[]);function c(e){r(e)}async function l(e){s(!0);try{let n=await D({maximumTurnCount:e});t(n.maximumTurnCount),r(n.maximumTurnCount.toString())}catch(e){throw ut.error(`Failed to update maximum turn count:`,e),e}finally{s(!1)}}function u(){r(e.toString())}return{defaultMaximumTurnCount:dt,draftMaximumTurnCount:n,isLoading:i,isSaving:o,maximumTurnCount:e,resetDraftMaximumTurnCount:u,setDraftMaximumTurnCount:c,updateMaximumTurnCount:l}}var pt=i(`app.use-screen-recording-permission.hook`),mt={isMacOS:!1,granted:!1,available:!1,message:``};function ht(){return{...mt,isMacOS:Ae()}}function gt(){let[e,t]=(0,A.useState)(ht),[n,r]=(0,A.useState)(!0),[i,a]=(0,A.useState)(null),[o,s]=(0,A.useState)(!1),[c,l]=(0,A.useState)(null),u=(0,A.useCallback)(async()=>{r(!0),a(null);try{t(await ne(`api/system-permissions/screen-recording`))}catch(e){a(e instanceof Error?e.message:`Failed to check screen recording permission`),t(e=>({...mt,isMacOS:e?.isMacOS??Ae(),message:`Unable to check permission status.`}))}finally{r(!1)}},[]);return(0,A.useEffect)(()=>{u()},[u]),{status:e,isLoading:n,error:i,isOpeningSettings:o,openSettingsError:c,refresh:u,openSystemSettings:(0,A.useCallback)(async()=>{s(!0),l(null);try{let e=await E(`api/system-permissions/screen-recording/open-settings`,{});if(!e.success){let t=e.message||`Failed to open System Settings`;pt.error(`[useScreenRecordingPermission] ${t}`,e.error),l(t)}}catch(e){let t=e instanceof Error?e.message:`Failed to open System Settings`;pt.error(`[useScreenRecordingPermission] Error opening System Settings:`,e),l(t)}finally{s(!1)}},[])}}var _t=i(`app.use-server-bind-mode.hook`),vt=`local`,yt=`tarsk-server-bind-mode-changed`;function bt(e){te(e)}function xt(){if(typeof window>`u`)return!1;try{return sessionStorage.getItem(yt)===`true`}catch{return!1}}function St(e){if(!(typeof window>`u`))try{e?sessionStorage.setItem(yt,`true`):sessionStorage.removeItem(yt)}catch{}}function Ct(){let[e,t]=(0,A.useState)(()=>O()?.serverBindMode??vt),[n,r]=(0,A.useState)(null),[i,a]=(0,A.useState)(()=>O()?.networkAddresses??[]),[o,s]=(0,A.useState)(()=>O()===null),[c,l]=(0,A.useState)(!1),[u,d]=(0,A.useState)(xt);(0,A.useEffect)(()=>{let e=!1;async function n(){try{let n=await T();e||(t(n.serverBindMode),r(n.serverBindMode),a(n.networkAddresses),bt({networkAddresses:n.networkAddresses,serverBindMode:n.serverBindMode}))}catch(e){_t.error(`Failed to load server bind mode:`,e)}finally{e||s(!1)}}return n(),()=>{e=!0}},[]);async function f(e){l(!0);try{let n=await D({serverBindMode:e});t(n.serverBindMode),a(n.networkAddresses),bt({networkAddresses:n.networkAddresses,serverBindMode:n.serverBindMode}),d(!0),St(!0)}catch(e){throw _t.error(`Failed to update server bind mode:`,e),e}finally{l(!1)}}let p=n!==null&&e!==n;return{defaultServerBindMode:vt,hasServerBindModeChanged:p,isLoading:o,isSaving:c,needsRestart:p||u,networkAddresses:i,serverBindMode:e,updateServerBindMode:f}}var wt=i(`app.use-logging.hook`);function Tt(){let[e,t]=(0,A.useState)(!1),[n,r]=(0,A.useState)(null),[i,a]=(0,A.useState)(!1),[o,s]=(0,A.useState)(null),[c,l]=(0,A.useState)(!0),[u,d]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let e=!1;async function n(){try{let n=await T();e||(t(n.loggingEnabled),r(n.fileLoggingPath),a(n.betterStackEnvConfigured),s(n.betterStackIngestingHost))}catch(e){wt.error(`Failed to load logging setting:`,e)}finally{e||l(!1)}}return n(),()=>{e=!0}},[]);async function f(e){d(!0);try{let n=await D({loggingEnabled:e});t(n.loggingEnabled),r(n.fileLoggingPath),a(n.betterStackEnvConfigured),s(n.betterStackIngestingHost)}catch(e){throw wt.error(`Failed to update logging setting:`,e),e}finally{d(!1)}}return{ingestingHost:o,isEnabled:e,isEnvConfigured:i,isLoading:c,isSaving:u,logPath:n,updateIsEnabled:f}}var Et=Object.defineProperty,V=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,Dt=(e,t,n)=>t in e?Et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ot=(e,t)=>{for(var n in t||={})H.call(t,n)&&Dt(e,n,t[n]);if(V)for(var n of V(t))U.call(t,n)&&Dt(e,n,t[n]);return e},W=(e,t)=>{var n={};for(var r in e)H.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&V)for(var r of V(e))t.indexOf(r)<0&&U.call(e,r)&&(n[r]=e[r]);return n},G;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(G||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(G||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(G||={});var K=G,kt={L:K.QrCode.Ecc.LOW,M:K.QrCode.Ecc.MEDIUM,Q:K.QrCode.Ecc.QUARTILE,H:K.QrCode.Ecc.HIGH},At=128,q=`L`,J=`#FFFFFF`,Y=`#000000`,X=!1,Z=1,jt=4,Mt=0,Nt=.1;function Q(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function $(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function Pt(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*Nt),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function Ft(e,t){return t==null?e?jt:Mt:Math.max(Math.floor(t),0)}function It({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=A.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...K.QrSegment.makeSegments(t)),e),[]);return K.QrCode.encodeSegments(r,kt[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=A.useMemo(()=>{let e=c.getModules(),t=Ft(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:Pt(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var Lt=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Rt=A.forwardRef(function(e,t){let n=e,{value:r,size:i=At,level:a=q,bgColor:o=J,fgColor:s=Y,includeMargin:c=X,minVersion:l=Z,boostLevel:u,marginSize:d,imageSettings:f}=n,p=W(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=W(p,[`style`]),g=f?.src,_=A.useRef(null),v=A.useRef(null),y=A.useCallback(e=>{_.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[b,x]=A.useState(!1),{margin:ee,cells:S,numCells:C,calculatedImageSettings:w}=It({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});A.useEffect(()=>{if(_.current!=null){let e=_.current,t=e.getContext(`2d`);if(!t)return;let n=S,r=v.current,a=w!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&w.excavation!=null&&(n=$(S,w.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/C*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,C,C),t.fillStyle=s,Lt?t.fill(new Path2D(Q(n,ee))):S.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+ee,n+ee,1,1)})}),w&&(t.globalAlpha=w.opacity),a&&t.drawImage(r,w.x+ee,w.y+ee,w.w,w.h)}}),A.useEffect(()=>{x(!1)},[g]);let T=Ot({height:i,width:i},m),E=null;return g!=null&&(E=A.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{x(!0)},ref:v,crossOrigin:w?.crossOrigin})),A.createElement(A.Fragment,null,A.createElement(`canvas`,Ot({style:T,height:i,width:i,ref:y,role:`img`},h)),E)});Rt.displayName=`QRCodeCanvas`;var zt=A.forwardRef(function(e,t){let n=e,{value:r,size:i=At,level:a=q,bgColor:o=J,fgColor:s=Y,includeMargin:c=X,minVersion:l=Z,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=W(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:_,calculatedImageSettings:v}=It({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),y=g,b=null;p!=null&&v!=null&&(v.excavation!=null&&(y=$(g,v.excavation)),b=A.createElement(`image`,{href:p.src,height:v.h,width:v.w,x:v.x+h,y:v.y+h,preserveAspectRatio:`none`,opacity:v.opacity,crossOrigin:v.crossOrigin}));let x=Q(y,h);return A.createElement(`svg`,Ot({height:i,width:i,viewBox:`0 0 ${_} ${_}`,ref:t,role:`img`},m),!!d&&A.createElement(`title`,null,d),A.createElement(`path`,{fill:o,d:`M0,0 h${_}v${_}H0z`,shapeRendering:`crispEdges`}),A.createElement(`path`,{fill:s,d:x,shapeRendering:`crispEdges`}),b)});zt.displayName=`QRCodeSVG`;var Bt=[{value:`light`,label:`Light`,icon:c},{value:`dark`,label:`Dark`,icon:v},{value:`system`,label:`System`,icon:l}],Vt=[{value:`image`,label:`Image`,icon:u},{value:`background`,label:`Background`,icon:p}],Ht=`flex h-7 w-7 min-h-0 min-w-0 items-center justify-center rounded-full border-0 bg-background p-0 data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:shadow-sm hover:bg-background hover:text-muted-foreground data-[state=on]:hover:bg-foreground data-[state=on]:hover:text-background`,Ut=`inline-flex h-auto w-fit justify-start rounded-full border-0 bg-background p-1 text-muted-foreground`,Wt=[`462`,`8100`].includes(typeof document<`u`?document.location.port:``)?`462`:`641`,Gt=600;function Kt(e){let t=(0,je.c)(224),{onboardingResetSignal:n}=e,r=n===void 0?0:n,[i,c]=(0,A.useState)(!1),{theme:l,setTheme:u}=ve(),{scale:p,updateScale:h,min:_,max:v}=we(),{opacity:y,updateOpacity:b,min:S,max:T}=Ce(),{mode:E,color:te,updateMode:D,updateColor:ne}=ye(),{color:O,updateColor:re,resetColor:se}=Te(),{defaultMaximumTurnCount:ce,draftMaximumTurnCount:le,isLoading:de,isSaving:Ae,resetDraftMaximumTurnCount:Me,setDraftMaximumTurnCount:Ne,updateMaximumTurnCount:Pe}=ft(),{status:M,isLoading:N,isOpeningSettings:Fe,openSettingsError:Ie,refresh:Le,openSystemSettings:Re}=gt(),{isLoading:ze,isSaving:Be,needsRestart:P,networkAddresses:F,serverBindMode:I,updateServerBindMode:Ve}=Ct(),{isEnabled:He,isLoading:Ue,isSaving:We,updateIsEnabled:Ge}=xe(),{isEnabled:Ke,isLoading:qe,isSaving:Je,updateIsEnabled:Ye}=pe(),{isEnabled:Xe,isSupported:Ze,isHealthy:L,statusMessage:Qe,isLoading:R,isSaving:$e,updateIsEnabled:et}=be(),{isEnabled:z,logPath:B,isEnvConfigured:tt,ingestingHost:nt,isLoading:rt,isSaving:it,updateIsEnabled:at}=Tt(),ot;t[0]!==rt||t[1]!==de||t[2]!==N||t[3]!==R||t[4]!==ze||t[5]!==qe||t[6]!==Ue?(ot=[de,N,ze,Ue,qe,R,rt],t[0]=rt,t[1]=de,t[2]=N,t[3]=R,t[4]=ze,t[5]=qe,t[6]=Ue,t[7]=ot):ot=t[7];let st=ke(`general`,ot),ct,ut;t[8]===r?(ct=t[9],ut=t[10]):(ct=()=>{if(r===0)return;c(!0);let e=setTimeout(()=>{c(!1)},Gt);return()=>{clearTimeout(e)}},ut=[r],t[8]=r,t[9]=ct,t[10]=ut),(0,A.useEffect)(ct,ut);let dt;t[11]===Ne?dt=t[12]:(dt=function(e){Ne(e.target.value)},t[11]=Ne,t[12]=dt);let pt=dt,mt;t[13]!==ce||t[14]!==le||t[15]!==Me||t[16]!==Pe?(mt=async function(){let e=Number.parseInt(le,10),t=Number.isFinite(e)&&e>0?e:ce;try{await Pe(t)}catch{Me()}},t[13]=ce,t[14]=le,t[15]=Me,t[16]=Pe,t[17]=mt):mt=t[17];let ht=mt,_t;t[18]===h?_t=t[19]:(_t=function(e){e.length>0&&h(e[0])},t[18]=h,t[19]=_t);let vt=_t,yt;t[20]===b?yt=t[21]:(yt=function(e){e.length>0&&b(e[0])},t[20]=b,t[21]=yt);let bt=yt,xt;t[22]===B?xt=t[23]:(xt=async function(){if(B)try{await navigator.clipboard.writeText(B),ue({title:`Copied`,description:`Log file path copied to clipboard.`})}catch(e){let t=e;ue({title:`Copy failed`,description:t instanceof Error?t.message:`Could not copy the log file path.`,variant:`destructive`})}},t[22]=B,t[23]=xt);let St=xt,[wt,Et]=(0,A.useState)(!1),V,H,U;t[24]!==F||t[25]!==I?(V=async function(){if(H)try{await navigator.clipboard.writeText(H),Et(!0),ue({title:`Copied`,description:`Network URL copied to clipboard.`}),window.setTimeout(()=>{Et(!1)},1500)}catch(e){let t=e;ue({title:`Copy failed`,description:t instanceof Error?t.message:`Could not copy the network URL.`,variant:`destructive`})}},U=I===`network`&&F.length>0,H=U?`http://${F[0]}:${Wt}`:null,t[24]=F,t[25]=I,t[26]=V,t[27]=H,t[28]=U):(V=t[26],H=t[27],U=t[28]);let Dt=U&&H,Ot=i&&`animate-headline-reset`,W;t[29]===Ot?W=t[30]:(W=C(Ot),t[29]=Ot,t[30]=W);let G;t[31]===W?G=t[32]:(G=(0,j.jsx)(Se,{title:`Appearance`,titleClassName:W,className:`[&>div:first-child]:py-2`,sticky:!1}),t[31]=W,t[32]=G);let K;t[33]===_?K=t[34]:(K=(0,j.jsxs)(`span`,{className:`${a.bodyMuted} w-8 shrink-0 text-right`,children:[_,`%`]}),t[33]=_,t[34]=K);let kt;t[35]===p?kt=t[36]:(kt=[p],t[35]=p,t[36]=kt);let At=`${p}%`,q;t[37]!==vt||t[38]!==v||t[39]!==_||t[40]!==kt||t[41]!==At?(q=(0,j.jsx)(lt,{value:kt,min:_,max:v,step:5,onValueChange:vt,"aria-label":`Font size`,valueTooltip:At}),t[37]=vt,t[38]=v,t[39]=_,t[40]=kt,t[41]=At,t[42]=q):q=t[42];let J;t[43]===v?J=t[44]:(J=(0,j.jsxs)(`span`,{className:`${a.bodyMuted} w-9 shrink-0`,children:[v,`%`]}),t[43]=v,t[44]=J);let Y;t[45]!==K||t[46]!==q||t[47]!==J?(Y=(0,j.jsx)(k,{title:`Font Size`,description:`Adjust the text size across the entire application.`,children:(0,j.jsxs)(`div`,{className:`ml-auto flex w-1/2 items-center gap-3`,children:[K,q,J]})}),t[45]=K,t[46]=q,t[47]=J,t[48]=Y):Y=t[48];let X;t[49]===S?X=t[50]:(X=(0,j.jsxs)(`span`,{className:`${a.bodyMuted} w-8 shrink-0 text-right`,children:[S,`%`]}),t[49]=S,t[50]=X);let Z;t[51]===y?Z=t[52]:(Z=[y],t[51]=y,t[52]=Z);let jt=`${y}%`,Mt;t[53]!==T||t[54]!==S||t[55]!==bt||t[56]!==Z||t[57]!==jt?(Mt=(0,j.jsx)(lt,{value:Z,min:S,max:T,step:5,onValueChange:bt,"aria-label":`Panel opacity`,valueTooltip:jt}),t[53]=T,t[54]=S,t[55]=bt,t[56]=Z,t[57]=jt,t[58]=Mt):Mt=t[58];let Nt;t[59]===T?Nt=t[60]:(Nt=(0,j.jsxs)(`span`,{className:`${a.bodyMuted} w-9 shrink-0`,children:[T,`%`]}),t[59]=T,t[60]=Nt);let Q;t[61]!==X||t[62]!==Mt||t[63]!==Nt?(Q=(0,j.jsx)(k,{title:`Panel Opacity`,description:`Adjust how opaque the frosted panels are over the wallpaper.`,children:(0,j.jsxs)(`div`,{className:`ml-auto flex w-1/2 items-center gap-3`,children:[X,Mt,Nt]})}),t[61]=X,t[62]=Mt,t[63]=Nt,t[64]=Q):Q=t[64];let $;t[65]===u?$=t[66]:($=e=>{(e===`light`||e===`dark`||e===`system`)&&u(e)},t[65]=u,t[66]=$);let Pt;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Pt=Bt.map(Yt),t[67]=Pt):Pt=t[67];let Ft;t[68]!==$||t[69]!==l?(Ft=(0,j.jsx)(k,{title:`Appearance`,description:`Choose your preferred color scheme.`,controlLayout:`row-end`,action:(0,j.jsx)(Oe,{type:`single`,value:l,onValueChange:$,"aria-label":`Appearance`,className:Ut,children:Pt})}),t[68]=$,t[69]=l,t[70]=Ft):Ft=t[70];let It;t[71]===D?It=t[72]:(It=e=>{(e===`image`||e===`background`||e===`color`)&&D(e)},t[71]=D,t[72]=It);let Lt;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Lt=Vt.map(Jt),t[73]=Lt):Lt=t[73];let Rt;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=C(Ht,`relative overflow-hidden`),t[74]=Rt):Rt=t[74];let Kt;t[75]===te?Kt=t[76]:(Kt=(0,j.jsx)(`span`,{className:`pointer-events-none h-4 w-4 rounded-full border border-black/25 dark:border-white/25`,style:{backgroundColor:te},"aria-hidden":`true`}),t[75]=te,t[76]=Kt);let Xt;t[77]===D?Xt=t[78]:(Xt=()=>{D(`color`)},t[77]=D,t[78]=Xt);let Zt;t[79]!==ne||t[80]!==D?(Zt=e=>{ne(e.target.value),D(`color`)},t[79]=ne,t[80]=D,t[81]=Zt):Zt=t[81];let Qt;t[82]!==Xt||t[83]!==Zt||t[84]!==te?(Qt=(0,j.jsx)(`input`,{type:`color`,value:te,"aria-label":`Choose wallpaper color`,className:`absolute inset-0 cursor-pointer opacity-0`,onPointerDown:Xt,onChange:Zt}),t[82]=Xt,t[83]=Zt,t[84]=te,t[85]=Qt):Qt=t[85];let $t;t[86]!==Kt||t[87]!==Qt?($t=(0,j.jsxs)(De,{value:`color`,"aria-label":`Custom color`,className:Rt,children:[Kt,Qt]}),t[86]=Kt,t[87]=Qt,t[88]=$t):$t=t[88];let en;t[89]!==It||t[90]!==$t||t[91]!==E?(en=(0,j.jsx)(k,{title:`Wallpaper`,description:`Choose a scenic image, the theme background, or a custom color.`,controlLayout:`row-end`,action:(0,j.jsxs)(Oe,{type:`single`,value:E,onValueChange:It,"aria-label":`Wallpaper`,className:Ut,children:[Lt,$t]})}),t[89]=It,t[90]=$t,t[91]=E,t[92]=en):en=t[92];let tn;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(tn=C(Ht,`relative cursor-pointer overflow-hidden`),t[93]=tn):tn=t[93];let nn;t[94]===O?nn=t[95]:(nn=(0,j.jsx)(`span`,{className:`pointer-events-none h-4 w-4 rounded-full border border-black/25 dark:border-white/25`,style:{backgroundColor:O},"aria-hidden":`true`}),t[94]=O,t[95]=nn);let rn;t[96]===re?rn=t[97]:(rn=e=>{re(e.target.value)},t[96]=re,t[97]=rn);let an;t[98]!==O||t[99]!==rn?(an=(0,j.jsx)(`input`,{type:`color`,value:O,"aria-label":`Primary color`,className:`absolute inset-0 cursor-pointer opacity-0`,onChange:rn}),t[98]=O,t[99]=rn,t[100]=an):an=t[100];let on;t[101]!==nn||t[102]!==an?(on=(0,j.jsx)(`div`,{className:Ut,children:(0,j.jsxs)(`label`,{className:tn,children:[nn,an]})}),t[101]=nn,t[102]=an,t[103]=on):on=t[103];let sn;t[104]!==se||t[105]!==on?(sn=(0,j.jsx)(k,{title:`Primary Color`,description:`Choose the primary accent color used across the app. Click the label to reset to default.`,controlLayout:`row-end`,onTitleClick:se,action:on}),t[104]=se,t[105]=on,t[106]=sn):sn=t[106];let cn;t[107]!==Y||t[108]!==Q||t[109]!==Ft||t[110]!==en||t[111]!==sn?(cn=(0,j.jsx)(ge,{className:`max-w-none pt-0`,children:(0,j.jsxs)(me,{children:[Y,Q,Ft,en,sn]})}),t[107]=Y,t[108]=Q,t[109]=Ft,t[110]=en,t[111]=sn,t[112]=cn):cn=t[112];let ln;t[113]!==G||t[114]!==cn?(ln=(0,j.jsxs)(fe,{className:`shrink-0`,children:[G,cn]}),t[113]=G,t[114]=cn,t[115]=ln):ln=t[115];let un;t[116]===Symbol.for(`react.memo_cache_sentinel`)?(un=(0,j.jsx)(Se,{title:`Settings`,className:`[&>div:first-child]:py-2`,sticky:!1}),t[116]=un):un=t[116];let dn=`Set how many turns a long-running agent chat can take before Tarsk asks whether to continue. Default: ${ce} turns.`,fn;t[117]===ht?fn=t[118]:(fn=()=>{ht()},t[117]=ht,t[118]=fn);let pn=de||Ae,mn;t[119]!==le||t[120]!==pt||t[121]!==fn||t[122]!==pn?(mn=(0,j.jsx)(he,{type:`number`,min:1,step:1,value:le,onChange:pt,onBlur:fn,disabled:pn,"aria-label":`Maximum turn count`,className:`w-28 text-right font-mono tabular-nums flex-shrink-0`}),t[119]=le,t[120]=pt,t[121]=fn,t[122]=pn,t[123]=mn):mn=t[123];let hn;t[124]!==dn||t[125]!==mn?(hn=(0,j.jsx)(k,{title:`Maximum Turn Count`,description:dn,controlLayout:`row-end`,action:mn}),t[124]=dn,t[125]=mn,t[126]=hn):hn=t[126];let gn;t[127]===Ge?gn=t[128]:(gn=e=>{Ge(e)},t[127]=Ge,t[128]=gn);let _n=Ue||We,vn;t[129]!==gn||t[130]!==_n||t[131]!==He?(vn=(0,j.jsx)(k,{title:`AI Voice Cleanup`,description:`After stopping voice recording, run the transcription through AI to remove filler words, false starts, and repetitions.`,controlLayout:`row-end`,action:(0,j.jsx)(Ee,{value:He,onChange:gn,disabled:_n,ariaLabel:`AI Voice Cleanup`})}),t[129]=gn,t[130]=_n,t[131]=He,t[132]=vn):vn=t[132];let yn;t[133]===Ye?yn=t[134]:(yn=e=>{Ye(e)},t[133]=Ye,t[134]=yn);let bn=qe||Je,xn;t[135]!==Ke||t[136]!==yn||t[137]!==bn?(xn=(0,j.jsx)(k,{title:`Spend`,description:`Show an estimated spend counter in the chat header.`,controlLayout:`row-end`,action:(0,j.jsx)(Ee,{value:Ke,onChange:yn,disabled:bn,ariaLabel:`Spend`})}),t[135]=Ke,t[136]=yn,t[137]=bn,t[138]=xn):xn=t[138];let Sn;t[139]!==Fe||t[140]!==N||t[141]!==Re||t[142]!==Le||t[143]!==Ie||t[144]!==M?.granted||t[145]!==M?.isMacOS||t[146]!==M?.message?(Sn=M?.isMacOS&&(0,j.jsx)(k,{title:`Screen & Audio Recording`,description:`Tarsk needs this macOS permission to capture screen content for browser tools and screen sharing features.`,controlLayout:`row-end`,action:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!N&&M?.granted?(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(x,{className:`h-4 w-4 text-green-500`}),(0,j.jsx)(`span`,{className:C(a.body,`text-green-600 dark:text-green-400`),children:`Permission granted`})]}):N?null:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(d,{className:`h-4 w-4 text-amber-500`}),(0,j.jsx)(`span`,{className:C(a.body,`text-amber-600 dark:text-amber-400`),children:`Permission not granted`})]}),(0,j.jsxs)(w,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7 shrink-0 rounded-full border-0 bg-background hover:bg-background hover:text-foreground`,onClick:()=>void Le(),disabled:N,children:[N?(0,j.jsx)(s,{className:`h-3.5 w-3.5 animate-spin`}):(0,j.jsx)(m,{className:`h-3.5 w-3.5`}),(0,j.jsx)(`span`,{className:`sr-only`,children:`Refresh permission status`})]})]}),children:!N&&!M?.granted?(0,j.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,j.jsx)(`p`,{className:a.bodyMuted,children:M?.message??`Tarsk needs Screen & Audio Recording permission to use browser tools.`}),(0,j.jsx)(w,{size:`sm`,onClick:()=>void Re(),disabled:Fe,className:`w-fit`,children:Fe?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(s,{className:`h-4 w-4 mr-2 animate-spin`}),`Opening Settings...`]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(g,{className:`h-4 w-4 mr-2`}),`Open System Settings`]})}),Ie&&(0,j.jsxs)(`div`,{className:`flex items-start gap-2 p-3 rounded-md bg-destructive/10 text-destructive`,children:[(0,j.jsx)(f,{className:`h-4 w-4 mt-0.5 flex-shrink-0`}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,j.jsx)(`p`,{className:a.body,children:`Failed to open System Settings`}),(0,j.jsx)(`p`,{className:a.bodyMuted,children:Ie}),(0,j.jsxs)(`p`,{className:a.bodyMuted,children:[`Please open it manually:`,` `,(0,j.jsx)(`strong`,{children:`System Settings > Privacy & Security > Screen & System Audio Recording`})]})]})]})]}):null}),t[139]=Fe,t[140]=N,t[141]=Re,t[142]=Le,t[143]=Ie,t[144]=M?.granted,t[145]=M?.isMacOS,t[146]=M?.message,t[147]=Sn):Sn=t[147];let Cn;t[148]!==R||t[149]!==$e||t[150]!==Xe||t[151]!==L||t[152]!==Qe||t[153]!==Ze||t[154]!==et?(Cn=Ze&&(0,j.jsx)(k,{title:`Sandbox`,description:`Sandbox tools like bash and skill script execution to allow running and testing code safely without risking your system, files, or data.`,controlLayout:`row-end`,action:(0,j.jsx)(Ee,{value:Xe&&L,onChange:e=>{e&&!L||et(e).catch(qt)},disabled:R||$e,disableOn:!L,ariaLabel:`Sandbox`}),children:!R&&!L?(0,j.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,j.jsx)(d,{className:`h-4 w-4 mt-0.5 shrink-0`}),(0,j.jsx)(`p`,{className:a.bodyMuted,children:Qe||`Seatbelt sandbox failed its health check and cannot be enabled.`})]}):null}),t[148]=R,t[149]=$e,t[150]=Xe,t[151]=L,t[152]=Qe,t[153]=Ze,t[154]=et,t[155]=Cn):Cn=t[155];let wn;t[156]===at?wn=t[157]:(wn=e=>{at(e)},t[156]=at,t[157]=wn);let Tn=rt||it,En;t[158]!==z||t[159]!==wn||t[160]!==Tn?(En=(0,j.jsx)(ie,{asChild:!0,children:(0,j.jsx)(`span`,{className:`inline-flex`,children:(0,j.jsx)(Ee,{value:z,onChange:wn,disabled:Tn,ariaLabel:`Logging`})})}),t[158]=z,t[159]=wn,t[160]=Tn,t[161]=En):En=t[161];let Dn=z&&B?`max-w-sm cursor-pointer`:`max-w-sm`,On;t[162]!==St||t[163]!==z||t[164]!==B?(On=z&&B?()=>void St():void 0,t[162]=St,t[163]=z,t[164]=B,t[165]=On):On=t[165];let kn;t[166]!==z||t[167]!==B?(kn=z&&B?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{children:`Click to copy log file path`}),(0,j.jsx)(`p`,{className:C(a.mono,`mt-1 break-all`),children:B})]}):(0,j.jsx)(`p`,{children:`Enable logging to write to a local file.`}),t[166]=z,t[167]=B,t[168]=kn):kn=t[168];let An;t[169]!==Dn||t[170]!==On||t[171]!==kn?(An=(0,j.jsx)(ae,{className:Dn,onClick:On,children:kn}),t[169]=Dn,t[170]=On,t[171]=kn,t[172]=An):An=t[172];let jn;t[173]!==En||t[174]!==An?(jn=(0,j.jsxs)(oe,{children:[En,An]}),t[173]=En,t[174]=An,t[175]=jn):jn=t[175];let Mn;t[176]!==nt||t[177]!==tt||t[178]!==z?(Mn=z&&tt&&nt&&(0,j.jsxs)(`p`,{className:`${a.bodyMuted} mt-3`,children:[`Also sending logs to Better Stack at`,` `,(0,j.jsx)(`span`,{className:a.mono,children:nt})]}),t[176]=nt,t[177]=tt,t[178]=z,t[179]=Mn):Mn=t[179];let Nn;t[180]!==jn||t[181]!==Mn?(Nn=(0,j.jsx)(k,{title:`Logging`,description:`Write verbose application logs to a local file. When Better Stack environment variables are configured, logs are sent there too.`,controlLayout:`row-end`,action:jn,children:Mn}),t[180]=jn,t[181]=Mn,t[182]=Nn):Nn=t[182];let Pn=I===`network`,Fn;t[183]===Ve?Fn=t[184]:(Fn=e=>{Ve(e?`network`:`local`)},t[183]=Ve,t[184]=Fn);let In=ze||Be,Ln;t[185]!==Pn||t[186]!==Fn||t[187]!==In?(Ln=(0,j.jsx)(Ee,{value:Pn,onChange:Fn,disabled:In,ariaLabel:`Mobile & Network Access`}),t[185]=Pn,t[186]=Fn,t[187]=In,t[188]=Ln):Ln=t[188];let Rn;t[189]!==wt||t[190]!==V||t[191]!==H||t[192]!==P||t[193]!==U?(Rn=U&&H&&(0,j.jsxs)(`div`,{className:`mt-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`p`,{className:a.bodyMuted,children:[`Available on the network at:`,` `,(0,j.jsx)(`span`,{className:a.mono,children:H})]}),(0,j.jsxs)(oe,{children:[(0,j.jsx)(ie,{asChild:!0,children:(0,j.jsxs)(`button`,{type:`button`,onClick:()=>void V(),className:`inline-flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background/90 text-foreground shadow-sm transition-colors hover:bg-background`,children:[wt?(0,j.jsx)(o,{className:`h-3.5 w-3.5 text-green-500`}):(0,j.jsx)(ee,{className:`h-3.5 w-3.5`}),(0,j.jsx)(`span`,{className:`sr-only`,children:`Copy network URL`})]})}),(0,j.jsx)(ae,{children:wt?`Copied!`:`Copy to clipboard`})]})]}),P&&(0,j.jsx)(`p`,{className:`${a.bodyMuted} mt-1`,children:`You will need to restart for this setting to take effect.`})]}),t[189]=wt,t[190]=V,t[191]=H,t[192]=P,t[193]=U,t[194]=Rn):Rn=t[194];let zn;t[195]!==F||t[196]!==I?(zn=I===`network`&&F.length===0&&(0,j.jsx)(`p`,{className:`${a.bodyMuted} mt-3`,children:`No network IP addresses were detected on this computer.`}),t[195]=F,t[196]=I,t[197]=zn):zn=t[197];let Bn;t[198]!==P||t[199]!==I?(Bn=P&&I===`local`&&(0,j.jsx)(`p`,{className:`${a.bodyMuted} mt-3`,children:`You will need to restart for this setting to take effect.`}),t[198]=P,t[199]=I,t[200]=Bn):Bn=t[200];let Vn;t[201]!==Ln||t[202]!==Rn||t[203]!==zn||t[204]!==Bn?(Vn=(0,j.jsxs)(k,{title:`Mobile & Network Access`,description:`Allow the Tarsk mobile app or other web browsers to access Tarsk on the wifi network.`,controlLayout:`row-end`,action:Ln,children:[Rn,zn,Bn]}),t[201]=Ln,t[202]=Rn,t[203]=zn,t[204]=Bn,t[205]=Vn):Vn=t[205];let Hn;t[206]!==hn||t[207]!==vn||t[208]!==xn||t[209]!==Sn||t[210]!==Cn||t[211]!==Nn||t[212]!==Vn?(Hn=(0,j.jsxs)(fe,{className:`shrink-0`,children:[un,(0,j.jsx)(ge,{className:`max-w-none pt-0`,children:(0,j.jsxs)(me,{children:[hn,vn,xn,Sn,Cn,Nn,Vn]})})]}),t[206]=hn,t[207]=vn,t[208]=xn,t[209]=Sn,t[210]=Cn,t[211]=Nn,t[212]=Vn,t[213]=Hn):Hn=t[213];let Un;t[214]!==H||t[215]!==Dt?(Un=Dt?(0,j.jsxs)(fe,{className:`shrink-0`,children:[(0,j.jsx)(Se,{title:`Mobile App`,description:`Scan this code with the Tarsk mobile app to connect on your Wi-Fi network.`,sticky:!1}),(0,j.jsx)(`div`,{className:`flex flex-col items-center px-6 pb-6 pt-6`,children:(0,j.jsx)(`div`,{className:`rounded-lg bg-background p-3`,children:(0,j.jsx)(zt,{value:H,size:128,bgColor:`hsl(var(--background))`,fgColor:`hsl(var(--foreground))`,level:`M`})})})]}):null,t[214]=H,t[215]=Dt,t[216]=Un):Un=t[216];let Wn;t[217]!==ln||t[218]!==Hn||t[219]!==Un?(Wn=(0,j.jsxs)(`div`,{className:`divide-y divide-table-border [&>*]:rounded-none`,children:[ln,Hn,Un]}),t[217]=ln,t[218]=Hn,t[219]=Un,t[220]=Wn):Wn=t[220];let Gn;return t[221]!==st||t[222]!==Wn?(Gn=(0,j.jsx)(_e,{loading:st,children:Wn}),t[221]=st,t[222]=Wn,t[223]=Gn):Gn=t[223],Gn}function qt(){}function Jt(e){let t=e.icon;return(0,j.jsx)(De,{value:e.value,"aria-label":e.label,className:Ht,children:(0,j.jsx)(t,{className:`h-4 w-4`,"aria-hidden":`true`})},e.value)}function Yt(e){let t=e.icon;return(0,j.jsx)(De,{value:e.value,"aria-label":e.label,className:Ht,children:(0,j.jsx)(t,{className:`h-4 w-4`,"aria-hidden":`true`})},e.value)}export{Kt as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{ot as i}from"./dist-BWuYHVi8.js";import{r as a}from"./store-BaMSfYoJ.js";import{$ as o,An as s,D as c,G as l,ct as u,dn as d,kn as f,rt as p,y as m}from"./dist-DIjomljy.js";import{t as h}from"./utils-CT-Dw22R.js";import{t as g}from"./button-DeNw35VZ.js";import{Xt as _,a as v,ft as y,un as b}from"./api-BMo_Lz8f.js";import{i as ee,n as te,r as x,t as ne}from"./tooltip-B6ziVyTv.js";import{t as S}from"./use-toast-xpb5jNtN.js";import{r as C,t as w}from"./dialog-Do98zzAW.js";import{n as T}from"./explorer-tab-context-BxUVwWQQ.js";import{t as E}from"./use-open-chat-dock-panel-Cr1bQYOH.js";import{A as D,At as O,Bn as k,Cn as A,D as j,Dn as M,E as N,En as P,Ft as F,I as re,In as I,L,Ln as R,Mt as z,Nn as B,Nt as V,O as H,Ot as ie,R as U,Sn as W,Tn as G,Y as K,gn as q,j as ae,k as oe,kn as se,kt as ce,vn as le,wn as J,xn as ue,yn as Y,z as de,zn as fe}from"./index-DjaVbFDB.js";import{t as pe}from"./delete-confirm-dialog-C9NASyh6.js";import{t as me}from"./use-settings-page-loading-BTySlInF.js";import{n as he}from"./settings-list-DU82HNPX.js";import{t as ge}from"./switch-pIBaqatj.js";var X=e(n(),1),Z=r();function _e(e){return e?.url?`remote`:`local`}function ve(e){return Object.entries(e??{}).map(([e,t])=>({key:e,value:t}))}function ye({projectPath:e,serverName:t,initialName:n,initialConfig:r,onBack:a}){let{installedServers:o}=ae(e),s=!!t,[c,l]=(0,X.useState)(`local`),[u,d]=(0,X.useState)(``),[f,h]=(0,X.useState)(``),[_,v]=(0,X.useState)(``),[y,b]=(0,X.useState)(``),[ee,te]=(0,X.useState)(`sse`),[x,ne]=(0,X.useState)(``),[C,w]=(0,X.useState)(``),[T,E]=(0,X.useState)(``),[D,k]=(0,X.useState)([]),[A,I]=(0,X.useState)([]),[R,B]=(0,X.useState)(!0),[H,W]=(0,X.useState)(!1),[G,q]=(0,X.useState)(!1),[le,J]=(0,X.useState)(null),[ue,Y]=(0,X.useState)(s),[pe,me]=(0,X.useState)(``),[he,ye]=(0,X.useState)(``);function Q(e,t){let n=_e(t);l(n),d(e),h(t.command??``),v((t.args??[]).join(`
|
|
2
|
-
`)),b(t.url??``),te(t.transport??`sse`),ne(t.oauth?.clientId??``),w(t.oauth?.clientSecret??``),E(t.oauth?.callbackPort===void 0?``:String(t.oauth.callbackPort)),k(ve(t.env)),I(ve(t.headers)),B(t.defer!==!1),me(e),ye(JSON.stringify({name:e,type:n,config:t}))}(0,X.useEffect)(()=>{if(s&&t){let e=o.find(e=>e.name===t);e&&(Q(e.name,e.config),Y(!1))}else r&&Q(n??``,r),Y(!1)},[o,t,s,r,n]);let be=(0,X.useCallback)(()=>{k(e=>[...e,{key:``,value:``}])},[]),xe=(0,X.useCallback)(e=>{k(t=>t.filter((t,n)=>n!==e))},[]),Se=(0,X.useCallback)((e,t)=>{k(n=>n.map((n,r)=>r===e?{...n,key:t}:n))},[]),$=(0,X.useCallback)((e,t)=>{k(n=>n.map((n,r)=>r===e?{...n,value:t}:n))},[]),Ce=(0,X.useCallback)(()=>{I(e=>[...e,{key:``,value:``}])},[]),we=(0,X.useCallback)(e=>{I(t=>t.filter((t,n)=>n!==e))},[]),Te=(0,X.useCallback)((e,t)=>{I(n=>n.map((n,r)=>r===e?{...n,key:t}:n))},[]),Ee=(0,X.useCallback)((e,t)=>{I(n=>n.map((n,r)=>r===e?{...n,value:t}:n))},[]);function De(e){let t={};for(let{key:n,value:r}of e)n.trim()&&(t[n.trim()]=r);return Object.keys(t).length>0?t:void 0}function Oe(){let e=De(D);if(c===`remote`){let t=De(A),n=x.trim(),r=C.trim(),i=T.trim(),a=i?Number.parseInt(i,10):void 0,o=n||r||a?{...n?{clientId:n}:{},...r?{clientSecret:r}:{},...a&&Number.isInteger(a)&&a>0?{callbackPort:a}:{}}:void 0;return{url:y.trim(),transport:ee,...t?{headers:t}:{},...e?{env:e}:{},...o&&Object.keys(o).length>0?{oauth:o}:{},...R?{}:{defer:!1}}}let t=_.split(`
|
|
3
|
-
`).map(e=>e.trim()).filter(Boolean);return{command:f.trim(),args:t,...e?{env:e}:{},...R?{}:{defer:!1}}}let ke=JSON.stringify({name:u.trim(),type:c,config:Oe()}),Ae=async()=>{J(null);let t=u.trim();if(!t){J(`Server name is required`);return}if(c===`remote`){if(!y.trim()){J(`Server URL is required`);return}try{new URL(y.trim())}catch{J(`Server URL must be a valid URL`);return}if(T.trim()){let e=Number.parseInt(T.trim(),10);if(!Number.isInteger(e)||e<=0){J(`OAuth callback port must be a positive integer`);return}}if(C.trim()&&!x.trim()){J(`OAuth client ID is required when a client secret is set`);return}}else if(!f.trim()){J(`Command is required`);return}W(!0);try{if(!e)throw Error(`No project path`);let n=await oe(e,pe||t,Oe());S({title:`Success`,description:s?`MCP server saved · ${j(n.catalog)}`:`MCP server added · ${j(n.catalog)}`}),a()}catch(e){J(e instanceof Error?e.message:`Failed to save server`)}finally{W(!1)}},je=async()=>{if(e){q(!0);try{await N(e,pe),S({title:`Success`,description:`MCP server removed`}),a()}catch(e){J(e instanceof Error?e.message:`Failed to delete server`)}finally{q(!1)}}},Me=s?ke!==he:u.trim()!==``||f.trim()!==``||_.trim()!==``||y.trim()!==``||x.trim()!==``||C.trim()!==``||T.trim()!==``||D.length>0||A.length>0||!R;return ue?(0,Z.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,Z.jsx)(`p`,{className:i.bodyMuted,children:`Loading server configuration...`})}):(0,Z.jsx)(fe,{children:(0,Z.jsxs)(P,{children:[(0,Z.jsx)(se,{title:s?u:`Add MCP Server`,description:s?`Edit MCP Server configuration.`:`Configure a new MCP Server.`,sticky:!0,className:`pr-10`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(M,{title:`Server name`,description:s?`Server name cannot be changed`:void 0,controlLayout:`stack`,className:`pt-6`,children:(0,Z.jsx)(F,{id:`server-name`,placeholder:`e.g. filesystem`,value:u,onChange:e=>d(e.target.value),disabled:s})}),(0,Z.jsxs)(re,{value:c,onValueChange:e=>l(e),className:`w-full pt-6`,children:[(0,Z.jsxs)(U,{className:`grid w-full grid-cols-2`,children:[(0,Z.jsx)(de,{value:`local`,children:`Local (stdio)`}),(0,Z.jsx)(de,{value:`remote`,children:`Remote (HTTP/SSE)`})]}),(0,Z.jsxs)(L,{value:`local`,children:[(0,Z.jsx)(M,{title:`Command`,controlLayout:`stack`,className:`pt-6`,children:(0,Z.jsx)(F,{id:`server-command`,placeholder:`e.g. npx`,value:f,onChange:e=>h(e.target.value)})}),(0,Z.jsx)(M,{title:`Arguments`,description:`One argument per line`,controlLayout:`stack`,className:`pt-6`,children:(0,Z.jsx)(K,{id:`server-args`,placeholder:`-y
|
|
4
|
-
@modelcontextprotocol/server-filesystem
|
|
5
|
-
/path/to/dir`,value:_,onChange:e=>v(e.target.value),className:`font-mono min-h-[80px] resize-none`})})]}),(0,Z.jsxs)(L,{value:`remote`,children:[(0,Z.jsx)(M,{title:`Server URL`,description:`Paste the MCP endpoint URL from your provider.`,controlLayout:`stack`,className:`pt-6`,children:(0,Z.jsx)(F,{id:`server-url`,placeholder:`https://example.com/mcp`,value:y,onChange:e=>b(e.target.value),className:`font-mono`})}),(0,Z.jsx)(M,{title:`Transport`,controlLayout:`stack`,className:`pt-6`,children:(0,Z.jsxs)(ie,{value:ee,onValueChange:e=>te(e),children:[(0,Z.jsx)(z,{children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(ce,{children:[(0,Z.jsx)(O,{value:`sse`,children:`SSE (Server-Sent Events)`}),(0,Z.jsx)(O,{value:`streamableHttp`,children:`Streamable HTTP`})]})]})}),(0,Z.jsx)(M,{title:`OAuth client`,description:`Required for servers without dynamic client registration (e.g. GitHub Copilot MCP). Create an OAuth App, set callback to http://localhost:<port>/callback, then Sign in.`,controlLayout:`stack`,className:`pt-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(F,{id:`oauth-client-id`,placeholder:`Client ID`,value:x,onChange:e=>ne(e.target.value),className:`font-mono`}),(0,Z.jsx)(F,{id:`oauth-client-secret`,placeholder:`Client secret`,type:`password`,value:C,onChange:e=>w(e.target.value),className:`font-mono`}),(0,Z.jsx)(F,{id:`oauth-callback-port`,placeholder:`Callback port (e.g. 3118)`,value:T,onChange:e=>E(e.target.value),className:`font-mono`})]})}),(0,Z.jsx)(M,{title:`HTTP headers`,description:`Optional headers for authentication.`,controlLayout:`stack`,className:`pt-6`,action:(0,Z.jsxs)(g,{variant:`ghost`,size:`sm`,onClick:Ce,children:[(0,Z.jsx)(p,{className:`h-3 w-3 mr-1`}),`Add header`]}),children:A.length===0?(0,Z.jsx)(`p`,{className:i.caption,children:`No headers configured`}):(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:A.map((e,t)=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{placeholder:`Authorization`,value:e.key,onChange:e=>Te(t,e.target.value),className:`font-mono w-[35%]`}),(0,Z.jsx)(F,{placeholder:`Bearer ...`,value:e.value,onChange:e=>Ee(t,e.target.value),className:`font-mono flex-1`}),(0,Z.jsx)(g,{variant:`ghost`,size:`icon`,onClick:()=>we(t),className:`h-9 w-9 flex-shrink-0`,children:(0,Z.jsx)(m,{className:`h-3.5 w-3.5`})})]},t))})})]})]}),(0,Z.jsx)(M,{title:`Deferred`,description:R?`Tool definitions load on demand via tool_search to keep the initial prompt small.`:`Tool definitions are always injected into the initial prompt, even when not used. Useful when this server's tools are needed in nearly every conversation, but they consume context.`,controlLayout:`stack`,className:`pt-6`,action:(0,Z.jsx)(ge,{id:`defer-tools`,checked:R,onCheckedChange:B,"aria-label":`Deferred`})}),(0,Z.jsx)(M,{title:`Environment variables`,description:c===`remote`?`Optional metadata for local tooling.`:void 0,controlLayout:`stack`,className:`pt-6`,action:(0,Z.jsxs)(g,{variant:`ghost`,size:`sm`,onClick:be,children:[(0,Z.jsx)(p,{className:`h-3 w-3 mr-1`}),`Add variable`]}),children:D.length===0?(0,Z.jsx)(`p`,{className:i.caption,children:`No environment variables configured`}):(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:D.map((e,t)=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{placeholder:`KEY`,value:e.key,onChange:e=>Se(t,e.target.value),className:`font-mono w-[35%]`}),(0,Z.jsx)(F,{placeholder:`value`,value:e.value,onChange:e=>$(t,e.target.value),className:`font-mono flex-1`}),(0,Z.jsx)(g,{variant:`ghost`,size:`icon`,onClick:()=>xe(t),className:`h-9 w-9 flex-shrink-0`,children:(0,Z.jsx)(m,{className:`h-3.5 w-3.5`})})]},t))})}),le&&(0,Z.jsx)(`p`,{className:i.error,children:le}),(0,Z.jsxs)(`div`,{className:`mt-6 border-t pt-4 flex items-center justify-between`,children:[s&&(0,Z.jsx)(g,{variant:`destructive`,onClick:je,disabled:G||H,children:G?`Removing...`:`Remove`}),!s&&(0,Z.jsx)(`div`,{}),(0,Z.jsx)(g,{onClick:Ae,disabled:H||G||!Me,children:H?s?`Saving...`:`Adding...`:s?`Save`:`Add`})]})]})]})})}var Q=t();function be(e){if(!e)return null;let t=new Date(e).getTime();if(Number.isNaN(t))return null;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:new Date(e).toLocaleDateString()}function xe(e){if(!e||e.state===`missing`||e.state===`stale`)return`Refresh to load tools`;if(e.state===`needs_auth`)return`Sign in required`;if(e.state===`error`)return e.error??`Could not load tools`;let t=e.tools.length,n=t===1?`1 tool`:`${t} tools`,r=be(e.refreshedAt);return r?`${n} · refreshed ${r}`:n}function Se(e){let t=(0,Q.c)(69),{name:n,config:r,catalog:a,remote:s,authorized:l,oauthBusy:u,refreshing:d,onEdit:p,onRefresh:m,onDelete:_,onSignIn:v,onSignOut:y}=e,[b,S]=(0,X.useState)(!1),C;if(t[0]!==l||t[1]!==a||t[2]!==r.args||t[3]!==r.command||t[4]!==r.url||t[5]!==b||t[6]!==n||t[7]!==u||t[8]!==_||t[9]!==p||t[10]!==m||t[11]!==v||t[12]!==y||t[13]!==d||t[14]!==s){let e=a?.state===`ok`?a.tools.map(we):[],w;t[16]!==r.args||t[17]!==r.command||t[18]!==r.url?(w=r.url?r.url:`${r.command??``} ${r.args?.join(` `)??``}`.trim(),t[16]=r.args,t[17]=r.command,t[18]=r.url,t[19]=w):w=t[19];let T=w,E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=h(i.body,`truncate`),t[20]=E):E=t[20];let D;t[21]===n?D=t[22]:(D=(0,Z.jsx)(`div`,{className:E,children:n}),t[21]=n,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=h(i.compact,`truncate text-muted-foreground font-mono`),t[23]=O):O=t[23];let k;t[24]===T?k=t[25]:(k=(0,Z.jsx)(`div`,{className:O,children:T}),t[24]=T,t[25]=k);let A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=h(i.caption,`truncate text-muted-foreground`),t[26]=A):A=t[26];let j;t[27]===a?j=t[28]:(j=xe(a),t[27]=a,t[28]=j);let M;t[29]===j?M=t[30]:(M=(0,Z.jsx)(`div`,{className:A,children:j}),t[29]=j,t[30]=M);let N;t[31]!==p||t[32]!==D||t[33]!==k||t[34]!==M?(N=(0,Z.jsxs)(`button`,{type:`button`,onClick:p,className:`min-w-0 text-left`,children:[D,k,M]}),t[31]=p,t[32]=D,t[33]=k,t[34]=M,t[35]=N):N=t[35];let P;t[36]!==l||t[37]!==u||t[38]!==v||t[39]!==y||t[40]!==s?(P=s&&(0,Z.jsx)(g,{type:`button`,variant:l?`outline`:`secondary`,size:`sm`,disabled:u,onClick:()=>{l?y():v()},children:u?`Working…`:l?`Sign out`:`Sign in`}),t[36]=l,t[37]=u,t[38]=v,t[39]=y,t[40]=s,t[41]=P):P=t[41];let F=`Refresh ${n} tools`,re=d&&`animate-spin`,I;t[42]===re?I=t[43]:(I=h(`h-4 w-4`,re),t[42]=re,t[43]=I);let L;t[44]===I?L=t[45]:(L=(0,Z.jsx)(o,{className:I}),t[44]=I,t[45]=L);let R;t[46]!==m||t[47]!==d||t[48]!==F||t[49]!==L?(R=(0,Z.jsx)(ee,{asChild:!0,children:(0,Z.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:d,onClick:m,"aria-label":F,children:L})}),t[46]=m,t[47]=d,t[48]=F,t[49]=L,t[50]=R):R=t[50];let z;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(te,{children:`Refresh tools`}),t[51]=z):z=t[51];let B;t[52]===R?B=t[53]:(B=(0,Z.jsx)(x,{children:(0,Z.jsxs)(ne,{children:[R,z]})}),t[52]=R,t[53]=B);let V=e.length>0&&(0,Z.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-expanded":b,"aria-label":b?`Hide tools`:`Show tools`,onClick:()=>S(Ce),children:(0,Z.jsx)(f,{className:h(`h-4 w-4 transition-transform`,b&&`rotate-180`)})}),H;t[54]!==P||t[55]!==B||t[56]!==V?(H=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[P,B,V]}),t[54]=P,t[55]=B,t[56]=V,t[57]=H):H=t[57];let ie=`Delete ${n}`,U;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(c,{className:`h-4 w-4`}),t[58]=U):U=t[58];let W;t[59]!==_||t[60]!==ie?(W=(0,Z.jsx)(ee,{asChild:!0,children:(0,Z.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`shrink-0 items-center justify-center text-muted-foreground opacity-0 pointer-events-none can-hover:group-hover:opacity-100 can-hover:group-hover:pointer-events-auto can-hover:hover:bg-destructive can-hover:hover:text-destructive-foreground transition-[opacity,color,background-color]`,onClick:_,"aria-label":ie,children:U})}),t[59]=_,t[60]=ie,t[61]=W):W=t[61];let G;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(te,{children:`Remove this MCP server from the project`}),t[62]=G):G=t[62];let K;t[63]===W?K=t[64]:(K=(0,Z.jsx)(x,{children:(0,Z.jsxs)(ne,{children:[W,G]})}),t[63]=W,t[64]=K);let q;t[65]!==N||t[66]!==H||t[67]!==K?(q=(0,Z.jsxs)(`div`,{className:`grid min-h-13 grid-cols-[minmax(0,1fr)_auto_1.75rem] items-center gap-3`,children:[N,H,K]}),t[65]=N,t[66]=H,t[67]=K,t[68]=q):q=t[68],C=(0,Z.jsxs)(`div`,{className:`group px-3 py-3 hover:bg-muted/30`,children:[q,b&&e.length>0&&(0,Z.jsx)(`ul`,{className:h(i.caption,`mt-2 space-y-1 pl-1 text-muted-foreground`),children:e.map($)})]}),t[0]=l,t[1]=a,t[2]=r.args,t[3]=r.command,t[4]=r.url,t[5]=b,t[6]=n,t[7]=u,t[8]=_,t[9]=p,t[10]=m,t[11]=v,t[12]=y,t[13]=d,t[14]=s,t[15]=C}else C=t[15];return C}function $(e){return(0,Z.jsx)(`li`,{className:`font-mono truncate`,children:e},e)}function Ce(e){return!e}function we(e){return e.name}var Te=`https://tarsk.io/skills/mcp/`;function Ee(e){return e.name.toLowerCase().replace(/\s+/g,`-`)}function De(e){return typeof e.url==`string`&&e.url.trim().length>0}function Oe(){let e=a(e=>e.selectedProjectId),t=a(e=>e.projects).find(t=>t.projectId===e)?.projectPath,{installedServers:n,catalog:r,loadingConfig:c,loadInstalledServers:p}=ae(t),{popularServers:m,loadingPopular:O}=D(),{openChatDockPanel:M}=E(),{setPendingExplorerPath:P,triggerExplorerRefresh:F}=T(),[re,L]=(0,X.useState)(!1),[z,V]=(0,X.useState)(null),[ie,U]=(0,X.useState)(null),[K,ce]=(0,X.useState)(null),[de,fe]=(0,X.useState)(!1),[ge,_e]=(0,X.useState)({}),[ve,Q]=(0,X.useState)(null),[be,xe]=(0,X.useState)(null),$=(0,X.useCallback)(async()=>{if(!t){_e({});return}let e=n.filter(e=>De(e.config));if(e.length===0){_e({});return}let r=await Promise.all(e.map(async e=>{try{let n=await y(t,e.name);return[e.name,n.authorized]}catch{return[e.name,!1]}}));_e(Object.fromEntries(r))},[t,n]);(0,X.useEffect)(()=>{$()},[$]);let Ce=(0,X.useCallback)(async e=>{if(t){fe(!0);try{await N(t,e),await p(),F(),S({title:`MCP server removed`,description:e}),ce(null)}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to remove server`,variant:`destructive`})}finally{fe(!1)}}},[t,p,F]),we=(0,X.useCallback)(async e=>{if(t){Q(e);try{let n=await v(t,e);await $(),await p(),S({title:`Signed in`,description:n.catalog?`${e} · ${j(n.catalog)}`:`Connected to ${e}`})}catch(e){S({title:`Sign in failed`,description:e instanceof Error?e.message:`OAuth authorization failed`,variant:`destructive`})}finally{Q(null)}}},[t,$,p]),Oe=(0,X.useCallback)(async e=>{if(t){Q(e);try{await b(t,e),await $(),await p(),S({title:`Signed out`,description:e})}catch(e){S({title:`Sign out failed`,description:e instanceof Error?e.message:`Failed to revoke OAuth credentials`,variant:`destructive`})}finally{Q(null)}}},[t,$,p]),ke=(0,X.useCallback)(async e=>{if(t){xe(e??`all`);try{let n=await H(t,e);await p();let r=Object.values(n.catalog),[i]=r;if(i)S({title:`Tools refreshed`,description:`${i.serverName} · ${j(i)}`});else{let e=r.filter(e=>e.state===`ok`).length;S({title:`Tools refreshed`,description:`${e}/${r.length} servers loaded`})}}catch(e){S({title:`Refresh failed`,description:e instanceof Error?e.message:`Could not refresh MCP tools`,variant:`destructive`})}finally{xe(null)}}},[t,p]),Ae=(0,X.useCallback)(()=>{P(`.agents/mcp.json`),M(`explorer`)},[P,M]),je=(0,X.useCallback)(async e=>{if(!t)return;let r=Ee(e);if(!n.some(t=>t.name===r||t.name===e.id)){if(e.url!==void 0){if(!e.url.trim()){V({name:r,config:{url:``,transport:e.transport??`sse`,...Object.keys(e.env??{}).length>0?{env:e.env}:{}}}),L(!0);return}try{let n=await oe(t,r,{url:e.url,transport:e.transport??`sse`,...Object.keys(e.env??{}).length>0?{env:e.env}:{}});await p(),F(),S({title:`MCP server installed`,description:`${e.name} · ${j(n.catalog)}`})}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to install server`,variant:`destructive`})}return}if(!e.command){S({title:`Error`,description:`This server is missing install configuration.`,variant:`destructive`});return}try{let n=await oe(t,r,{command:e.command,args:e.args??[],...Object.keys(e.env??{}).length>0?{env:e.env}:{}});await p(),F(),S({title:`MCP server installed`,description:`${e.name} · ${j(n.catalog)}`})}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to install server`,variant:`destructive`})}}},[t,n,p,F]),Me=me(e,[c,O]);return e?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(B,{loading:Me,children:(0,Z.jsxs)(k,{className:`shrink-0`,children:[(0,Z.jsx)(se,{title:`Installed MCP Servers`,description:`MCP servers configured for this project.`,action:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(g,{variant:`ghost`,onClick:Ae,children:`Config`}),n.length>=2&&(0,Z.jsxs)(g,{variant:`ghost`,className:`gap-1`,disabled:be!==null,onClick:()=>void ke(),children:[(0,Z.jsx)(o,{className:h(`h-4 w-4`,be===`all`&&`animate-spin`)}),`Refresh all`]}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(G,{asChild:!0,children:(0,Z.jsxs)(g,{className:`gap-1`,children:[`Add Server`,(0,Z.jsx)(f,{className:`h-4 w-4 opacity-70`})]})}),(0,Z.jsxs)(le,{align:`end`,className:`w-56`,children:[(0,Z.jsxs)(Y,{className:h(i.body,`gap-2`),onSelect:()=>L(!0),children:[(0,Z.jsx)(u,{className:`h-4 w-4 shrink-0`}),`Manual Entry`]}),(0,Z.jsxs)(W,{children:[(0,Z.jsxs)(J,{className:h(i.body,`gap-2`),children:[(0,Z.jsx)(l,{className:`h-4 w-4 shrink-0`}),`Popular`]}),(0,Z.jsx)(A,{className:`w-80 max-h-80 overflow-y-auto`,children:O?(0,Z.jsx)(Y,{disabled:!0,className:i.bodyMuted,children:`Loading…`}):m.length===0?(0,Z.jsx)(Y,{disabled:!0,className:i.bodyMuted,children:`No available servers`}):[...m].sort((e,t)=>e.name.localeCompare(t.name)).map(e=>{let t=Ee(e),r=n.some(n=>n.name===t||n.name===e.id);return(0,Z.jsx)(x,{children:(0,Z.jsxs)(ne,{children:[(0,Z.jsx)(ee,{asChild:!0,children:(0,Z.jsxs)(Y,{className:h(i.body,`gap-2`,r&&`opacity-50 cursor-not-allowed`),onSelect:()=>{r||je(e)},children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),r&&(0,Z.jsx)(s,{className:`h-4 w-4 shrink-0 text-muted-foreground`})]})}),(0,Z.jsx)(te,{side:`right`,className:`max-w-64`,children:e.description})]})},e.id)})})]}),(0,Z.jsx)(ue,{}),(0,Z.jsxs)(Y,{className:h(i.body,`gap-2`),onSelect:()=>void _(Te),children:[(0,Z.jsx)(d,{className:`h-4 w-4 shrink-0`}),`Marketplace`]})]})]})]}),sticky:!1}),(0,Z.jsx)(R,{className:`pt-6`,children:n.length===0?(0,Z.jsx)(he,{icon:l,title:`Connect your agent to tools, APIs, and data sources`,bordered:!1}):(0,Z.jsx)(`div`,{className:`divide-y divide-table-border`,children:n.map(e=>(0,Z.jsx)(Se,{name:e.name,config:e.config,catalog:r[e.name],remote:De(e.config),authorized:ge[e.name]===!0,oauthBusy:ve===e.name,refreshing:be===e.name||be===`all`,onEdit:()=>U(e.name),onRefresh:()=>void ke(e.name),onDelete:()=>ce(e.name),onSignIn:()=>void we(e.name),onSignOut:()=>void Oe(e.name)},e.name))})})]})}),(0,Z.jsx)(w,{open:re,onOpenChange:e=>{L(e),e||V(null)},children:(0,Z.jsx)(C,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,Z.jsx)(ye,{projectPath:t,initialName:z?.name,initialConfig:z?.config,onBack:()=>{L(!1),V(null),p(),F()}})})}),(0,Z.jsx)(w,{open:ie!==null,onOpenChange:e=>{e||U(null)},children:(0,Z.jsx)(C,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,Z.jsx)(ye,{projectPath:t,serverName:ie??void 0,onBack:()=>{U(null),p(),F()}})})}),(0,Z.jsx)(pe,{open:K!==null,onOpenChange:e=>!e&&ce(null),title:`Delete MCP Server`,description:`Are you sure you want to delete the server "${K}"? This action cannot be undone.`,onConfirm:()=>{K&&Ce(K)},confirming:de})]}):(0,Z.jsx)(I,{children:`Select a project to manage MCP servers.`})}export{Oe as SettingsMCPServersView,Oe as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{t as i}from"./markdown-renderer-qLede1zH.js";import{ot as a,w as o}from"./dist-BWuYHVi8.js";import{r as s}from"./store-BaMSfYoJ.js";import{At as c,Et as l,Jt as u,dn as d,kn as f,ot as p,rt as m,st as h,x as g}from"./dist-DIjomljy.js";import{a as _,t as v}from"./utils-CT-Dw22R.js";import{t as y}from"./button-DeNw35VZ.js";import{$n as b,Gn as x,Ii as S,Kn as C,Ni as w,Qn as T,T as E,Xn as D,Xr as O,Xt as k,Zr as A,ai as j,bn as M,er as N,gi as ee,ir as P,pi as F,qn as I,rr as L,tr as te}from"./api-BMo_Lz8f.js";import{i as ne,n as re,r as ie,t as ae}from"./tooltip-B6ziVyTv.js";import{n as R}from"./async-loading-fallback-B_JNgWJR.js";import{t as z}from"./use-toast-xpb5jNtN.js";import{a as B,i as V,o as H,r as U,s as W,t as G}from"./dialog-Do98zzAW.js";import{a as oe,c as se,i as ce,n as le,o as ue,r as de,s as fe,t as pe}from"./alert-dialog-Cb1PEgra.js";import{At as me,Bn as he,Dn as ge,Dt as _e,En as ve,Ft as K,In as ye,Ln as be,Mt as xe,Nn as Se,Nt as Ce,On as we,Ot as Te,Pt as q,Tn as Ee,Y as De,a as Oe,gn as ke,kn as J,kt as Ae,vn as je,xn as Me,yn as Y,zn as Ne}from"./index-DjaVbFDB.js";import{t as Pe}from"./delete-confirm-dialog-C9NASyh6.js";import{t as Fe}from"./use-settings-page-loading-BTySlInF.js";import{a as Ie,i as Le,o as Re,r as ze}from"./settings-list-DU82HNPX.js";import{t as Be}from"./use-deferred-search-Dgxosq55.js";import{a as Ve,i as He,n as Ue,r as We,t as Ge}from"./mcp-server-card-zm-ss-7h.js";import{t as Ke}from"./use-installed-ai-files-E4BAFIPG.js";var X=t(),Z=e(n(),1),Q=r();function qe({threadId:e,onSkillCreated:t}){let[n,r]=(0,Z.useState)(``),[i,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),l=He(n),u=We(l),d=async()=>{if(!(!u||!i.trim()||!e)){c(!0);try{let n=await E(e,l,i.trim());z({title:`Skill created`,description:`Skill '${l}' was created successfully.`}),r(``),o(``),t?.(n.path,`SKILL.md`)}catch(e){z({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{c(!1)}}};return e?(0,Q.jsx)(Ne,{children:(0,Q.jsxs)(ve,{children:[(0,Q.jsx)(J,{title:`Add Skill`,description:`Saved as SKILL.md in .agents/skills.`,sticky:!0,className:`pr-10`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(ge,{title:`Skill Name`,controlLayout:`stack`,className:`pt-6`,children:[(0,Q.jsx)(K,{id:`skillName`,value:n,onChange:e=>r(e.target.value),placeholder:`e.g. Code Review`,disabled:s}),n?(0,Q.jsxs)(`p`,{className:v(a.caption,`mt-2`),children:[`Folder name: `,(0,Q.jsx)(`span`,{className:`font-mono`,children:l||`...`})]}):null]}),(0,Q.jsx)(ge,{title:`Description`,controlLayout:`stack`,className:`pt-6`,children:(0,Q.jsx)(De,{id:`skillDescription`,value:i,onChange:e=>o(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:s})}),(0,Q.jsx)(Ve,{onContinue:()=>void d(),disabled:!u||!i.trim(),creating:s})]})]})}):(0,Q.jsx)(ye,{title:`No thread selected`,children:`Please select a thread to add a skill.`})}function Je(e){let t=[`---`,`name: ${e.id}`,`description: ${e.description}`];return e.allowedTools&&t.push(`allowed-tools: ${e.allowedTools}`),e.license&&t.push(`license: ${e.license}`),t.push(`---`,``,e.instructions??``),t.join(`
|
|
2
|
-
`)}function Ye(e){return e.endsWith(`.md`)||e.endsWith(`.mdx`)}function Xe(e){return e.includes(`SKILL.md`)?`SKILL.md`:e[0]??`SKILL.md`}function Ze(e,t){let n=e?.sourceId??t;if(!(!n||n==="default"))return n}function Qe({open:e,onOpenChange:t,skill:n,catalogSourceId:r,onInstall:o}){let[s,c]=(0,Z.useState)([]),[l,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),[S,w]=(0,Z.useState)(!1),T=Ze(n,r),E=!!T;(0,Z.useEffect)(()=>{if(!e||!n)return;let t=n,i=Ze(t,r),a=!1;async function o(){h(!0),x(null),c([]),d(null),p(``);try{if(i){let e=await I(i,t.id);if(a)return;c(e.files),d(Xe(e.files))}else{if(a)return;c([`SKILL.md`]),d(`SKILL.md`),p(Je(t))}}catch(e){if(a)return;x(e instanceof Error?e.message:`Failed to load skill files`)}finally{a||h(!1)}}return o(),()=>{a=!0}},[e,n,r]),(0,Z.useEffect)(()=>{if(!e||!n||!l||!E||!T)return;let t=n,r=l,i=!1;async function a(){_(!0),x(null);try{let e=await C(T,t.id,r);if(i)return;p(e.content)}catch(e){if(i)return;x(e instanceof Error?e.message:`Failed to load file`),p(``)}finally{i||_(!1)}}return a(),()=>{i=!0}},[e,n,l,E,T]);let D=(0,Z.useCallback)(async()=>{if(!n)return;let e=T?{...n,sourceId:T}:n;w(!0);try{await o(e),t(!1)}finally{w(!1)}},[n,T,o,t]),O=m||E&&g,k=l?Ye(l):!1,A=(0,Z.useMemo)(()=>s.map(e=>(0,Q.jsxs)(_e,{selected:e===l,onClick:()=>d(e),className:`gap-2 cursor-pointer`,children:[(0,Q.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:v(a.caption,`truncate`),children:e})]},e)),[s,l]);return(0,Q.jsx)(G,{open:e,onOpenChange:t,children:(0,Q.jsxs)(U,{className:`flex max-h-[90vh] max-w-5xl flex-col gap-0 overflow-hidden p-0`,children:[(0,Q.jsxs)(H,{className:`border-b border-border px-6 py-4`,children:[(0,Q.jsx)(W,{children:n?.name??`Review skill`}),n?.description?(0,Q.jsx)(V,{children:n.description}):null]}),(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col sm:flex-row`,children:[(0,Q.jsxs)(`div`,{className:`flex max-h-40 shrink-0 flex-col border-b border-border sm:max-h-none sm:w-56 sm:border-b-0 sm:border-r`,children:[(0,Q.jsx)(`div`,{className:v(a.labelMuted,`px-3 py-2`),children:`Files`}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-1 pb-2`,children:m?(0,Q.jsx)(R,{className:`py-8`,label:`Loading files...`}):s.length===0?(0,Q.jsx)(`p`,{className:v(a.caption,`px-3 py-2 text-muted-foreground`),children:`No files found.`}):A})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-4`,children:b?(0,Q.jsx)(`p`,{className:v(a.body,`text-destructive`),children:b}):O?(0,Q.jsx)(R,{className:`py-12`,label:`Loading preview...`}):k?(0,Q.jsx)(i,{content:f,enableMermaid:!1}):(0,Q.jsx)(`pre`,{className:v(a.caption,`overflow-x-auto whitespace-pre-wrap font-mono`),children:f})})]}),(0,Q.jsxs)(B,{className:`border-t border-border px-6 py-4 sm:justify-between`,children:[(0,Q.jsx)(y,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,Q.jsx)(y,{type:`button`,onClick:()=>void D(),disabled:S||!n,children:S?`Installing...`:`Install`})]})]})})}var $=new Map;function $e(e){let t=$.get(e);if(t)return t;let n=T(e).finally(()=>{$.delete(e)});return $.set(e,n),n}function et(e,t){return t.map(t=>({...t,sourceId:t.sourceId??e}))}function tt(){let e=(0,X.c)(18),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,Z.useState)(t),[i,a]=(0,Z.useState)(F),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],e[1]=o):o=e[1];let[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(!1),p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=async()=>{try{r(await b())}catch{r([])}},e[2]=p):p=e[2];let m=p,h,g;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{(async function(){let e=j();if(e.length>0)try{await N(e),O()}catch{}await m()})()},g=[m],e[3]=h,e[4]=g):(h=e[3],g=e[4]),(0,Z.useEffect)(h,g);let _;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{a(e),w(e)},e[5]=_):_=e[5];let v=_,y;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{r(t=>[...t.filter(t=>t.id!==e.id),e].sort(rt)),v(e.id)},e[6]=y):y=e[6];let x=y,C;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{r(t=>t.map(t=>t.id===e.id?e:t).sort(nt)),A(e.id)},e[7]=C):C=e[7];let T=C,E;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{r(t=>t.filter(t=>t.id!==e)),A(e),a(t=>t===e?(w(`default`),`default`):t)},e[8]=E):E=e[8];let D=E,k,M;e[9]===i?(k=e[10],M=e[11]):(M=()=>{if(i==="default"){c([]),u(!1),f(!1);return}let e=ee(i);e?.skills?(c(et(i,e.skills)),u(!1)):(c([]),u(!0));let t=!1;return f(!!e?.skills),$e(i).then(e=>{if(t)return;let n=et(i,e);c(n),S(i,{fetchedAt:Date.now(),skills:n})}).catch(n=>{t||(e?.skills||c([]),z({title:`Error`,description:n instanceof Error?n.message:`Failed to load skill catalog`,variant:`destructive`}))}).finally(()=>{t||(u(!1),f(!1))}),()=>{t=!0}},k=[i],e[9]=i,e[10]=k,e[11]=M),(0,Z.useEffect)(M,k);let P;return e[12]!==s||e[13]!==l||e[14]!==d||e[15]!==i||e[16]!==n?(P={sources:n,selectedSourceId:i,setSelectedSourceId:v,addSource:x,updateSource:T,removeSource:D,reloadSources:m,catalogSkills:s,isLoadingCatalog:l,isRefreshingCatalog:d},e[12]=s,e[13]=l,e[14]=d,e[15]=i,e[16]=n,e[17]=P):P=e[17],P}function nt(e,t){return e.title.localeCompare(t.title)}function rt(e,t){return e.title.localeCompare(t.title)}function it({open:e,onOpenChange:t,editingSource:n,onSourceAdded:r,onSourceUpdated:i,onSourceDeleted:o}){let[s,c]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(!1),[b,S]=(0,Z.useState)(!1),C=n!=null;function w(){c(``),d(``),p(null),h(!1),_(!1),S(!1)}function T(e){e||w(),t(e)}(0,Z.useEffect)(()=>{if(e){if(n){c(n.title),d(n.url),p(null);return}c(``),d(``),p(null)}},[e,n]);async function E(){let e=s.trim(),t=u.trim();if(!e||!t){p(`Title and URL are required.`);return}h(!0),p(null);try{if(C&&n){let r=await L(n.id,e,t);i?.(r.source)}else r((await P(e,t)).source);T(!1)}catch(e){p(e instanceof Error?e.message:`Failed to verify skill source`)}finally{h(!1)}}async function D(){if(n){_(!0),p(null);try{await x(n.id),o?.(n.id),S(!1),T(!1)}catch(e){p(e instanceof Error?e.message:`Failed to delete skill source`),S(!1)}finally{_(!1)}}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(G,{open:e,onOpenChange:T,children:(0,Q.jsxs)(U,{className:`sm:max-w-lg`,children:[(0,Q.jsxs)(H,{children:[(0,Q.jsx)(W,{children:C?`Edit Skill Source`:`Add Skill Source`}),(0,Q.jsx)(V,{children:C?`Update the title or GitHub skills folder URL for this custom source.`:`Add a GitHub skills folder URL. The source is verified by loading at least one skill from the repository.`})]}),(0,Q.jsxs)(`div`,{className:`grid gap-4 py-2`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Q.jsx)(q,{htmlFor:`skill-source-title`,children:`Title`}),(0,Q.jsx)(K,{id:`skill-source-title`,placeholder:`e.g. My Team Skills`,value:s,onChange:e=>c(e.target.value),disabled:m||g,autoFocus:!0})]}),(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Q.jsx)(q,{htmlFor:`skill-source-url`,children:`URL`}),(0,Q.jsx)(K,{id:`skill-source-url`,placeholder:`https://github.com/org/repo or .../tree/main/skills`,value:u,onChange:e=>d(e.target.value),disabled:m||g})]}),f?(0,Q.jsx)(`p`,{className:v(a.caption,`text-destructive`),children:f}):null]}),(0,Q.jsxs)(B,{className:`flex-col-reverse gap-2 sm:flex-row sm:justify-between`,children:[C?(0,Q.jsx)(y,{type:`button`,variant:`destructive`,onClick:()=>S(!0),disabled:m||g,children:`Delete`}):(0,Q.jsx)(`div`,{className:`hidden sm:block`}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row`,children:[(0,Q.jsx)(y,{variant:`outline`,onClick:()=>T(!1),disabled:m||g,children:`Cancel`}),(0,Q.jsx)(y,{onClick:()=>void E(),disabled:m||g||!s.trim()||!u.trim(),children:m?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(l,{className:`mr-2 h-4 w-4 animate-spin`}),`Verifying...`]}):C?`Save Changes`:`Add Source`})]})]})]})}),(0,Q.jsx)(pe,{open:b,onOpenChange:S,children:(0,Q.jsxs)(ce,{children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(se,{children:`Delete Skill Source`}),(0,Q.jsxs)(oe,{children:[`Are you sure you want to delete "`,n?.title,`"? This removes the source from your list but does not uninstall skills you already added.`]})]}),(0,Q.jsxs)(ue,{children:[(0,Q.jsx)(de,{disabled:g,children:`Cancel`}),(0,Q.jsx)(le,{onClick:()=>void D(),disabled:g,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:g?`Deleting...`:`Delete`})]})]})})]})}var at=`https://tarsk.io/skills/list/`;function ot(e){let t=(0,X.c)(20),{onSelectMode:n,manualDisabled:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Ee,{asChild:!0,children:(0,Q.jsxs)(y,{className:`gap-1`,children:[`Add Skill`,(0,Q.jsx)(f,{className:`h-4 w-4 opacity-70`})]})}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=v(a.body,`gap-2`),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=()=>n(`manual`),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(h,{className:`h-4 w-4 shrink-0`}),t[4]=l):l=t[4];let u;t[5]!==r||t[6]!==s?(u=(0,Q.jsxs)(Y,{className:o,disabled:r,onSelect:s,children:[l,`Manually Enter`]}),t[5]=r,t[6]=s,t[7]=u):u=t[7];let p;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=v(a.body,`gap-2`),t[8]=p):p=t[8];let m;t[9]===n?m=t[10]:(m=()=>n(`url`),t[9]=n,t[10]=m);let g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(c,{className:`h-4 w-4 shrink-0`}),t[11]=g):g=t[11];let _;t[12]===m?_=t[13]:(_=(0,Q.jsxs)(Y,{className:p,onSelect:m,children:[g,`Via URL`]}),t[12]=m,t[13]=_);let b;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(Me,{}),t[14]=b):b=t[14];let x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=v(a.body,`gap-2`),t[15]=x):x=t[15];let S;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(Y,{className:x,onSelect:st,children:[(0,Q.jsx)(d,{className:`h-4 w-4 shrink-0`}),`Marketplace`]}),t[16]=S):S=t[16];let C;return t[17]!==u||t[18]!==_?(C=(0,Q.jsxs)(ke,{children:[i,(0,Q.jsxs)(je,{align:`end`,className:`w-44`,children:[u,_,b,S]})]}),t[17]=u,t[18]=_,t[19]=C):C=t[19],C}function st(){k(at)}function ct(e){let t=e.trim();if(!t)return null;if(/^https?:\/\//i.test(t))try{return new URL(t),t}catch{return null}if(t.startsWith(`tarsk://`))try{let e=new URL(`https://tarsk.invalid/${t.slice(8)}`);if(e.pathname===`/skill-install`&&e.searchParams.get(`url`))return e.searchParams.get(`url`)}catch{return null}return null}function lt(e){let t=(0,X.c)(40),{open:n,onOpenChange:r,onSubmit:i}=e,[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=function(){s(``),l(null)},t[0]=u):u=t[0];let d=u,f;t[1]===r?f=t[2]:(f=function(e){e||d(),r(e)},t[1]=r,t[2]=f);let p=f,m,h;t[3]===n?(m=t[4],h=t[5]):(m=()=>{n&&d()},h=[n],t[3]=n,t[4]=m,t[5]=h),(0,Z.useEffect)(m,h);let g;t[6]!==p||t[7]!==i||t[8]!==o?(g=function(){let e=ct(o);if(!e){l(`Enter a valid http(s) URL for the plugin archive or paste a tarsk:// install link.`);return}i(e),p(!1)},t[6]=p,t[7]=i,t[8]=o,t[9]=g):g=t[9];let _=g,b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsxs)(H,{children:[(0,Q.jsx)(W,{children:`Add Skill via URL`}),(0,Q.jsx)(V,{children:`Paste the URL of a plugin archive. Its skills and MCP servers are installed into this project.`})]}),t[10]=b):b=t[10];let x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(q,{htmlFor:`add-skill-url`,children:`URL`}),t[11]=x):x=t[11];let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>s(e.target.value),t[12]=S):S=t[12];let C;t[13]===_?C=t[14]:(C=e=>{e.key===`Enter`&&(e.preventDefault(),_())},t[13]=_,t[14]=C);let w;t[15]!==C||t[16]!==o?(w=(0,Q.jsx)(K,{id:`add-skill-url`,placeholder:`https://example.com/my-plugin.zip`,value:o,onChange:S,autoFocus:!0,onKeyDown:C}),t[15]=C,t[16]=o,t[17]=w):w=t[17];let T;t[18]===c?T=t[19]:(T=c?(0,Q.jsx)(`p`,{className:v(a.caption,`text-destructive`),children:c}):null,t[18]=c,t[19]=T);let E;t[20]!==w||t[21]!==T?(E=(0,Q.jsx)(`div`,{className:`grid gap-4 py-2`,children:(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[x,w,T]})}),t[20]=w,t[21]=T,t[22]=E):E=t[22];let D;t[23]===p?D=t[24]:(D=(0,Q.jsx)(y,{variant:`outline`,onClick:()=>p(!1),children:`Cancel`}),t[23]=p,t[24]=D);let O;t[25]===o?O=t[26]:(O=o.trim(),t[25]=o,t[26]=O);let k=!O,A;t[27]!==_||t[28]!==k?(A=(0,Q.jsx)(y,{onClick:_,disabled:k,children:`Continue`}),t[27]=_,t[28]=k,t[29]=A):A=t[29];let j;t[30]!==D||t[31]!==A?(j=(0,Q.jsxs)(B,{children:[D,A]}),t[30]=D,t[31]=A,t[32]=j):j=t[32];let M;t[33]!==E||t[34]!==j?(M=(0,Q.jsxs)(U,{className:`sm:max-w-lg`,children:[b,E,j]}),t[33]=E,t[34]=j,t[35]=M):M=t[35];let N;return t[36]!==p||t[37]!==n||t[38]!==M?(N=(0,Q.jsx)(G,{open:n,onOpenChange:p,children:M}),t[36]=p,t[37]=n,t[38]=M,t[39]=N):N=t[39],N}function ut(e){let t=[];for(let n of e){if(n.path===`.agents/skills`&&n.type===`folder`&&n.children)for(let e of n.children)e.type===`folder`&&t.push(e);n.children&&n.children.length>0&&t.push(...ut(n.children))}return t}function dt(e){return`.agents/skills/${e}/SKILL.md`}function ft(e,t){let n=t.trim();if(!n)return e;let r=n.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(r)||e.description.toLowerCase().includes(r))}function pt(e){let t=(0,X.c)(9),{items:n,installedFilePaths:r,onPreview:i}=e,a;if(t[0]!==r||t[1]!==n||t[2]!==i){let e;t[4]!==r||t[5]!==i?(e=e=>{let t=dt(e.id),n=r.has(t);return(0,Q.jsx)(Ge,{className:`bg-background hover:bg-background`,name:Ue(e.name),description:e.description,installed:n,onClick:()=>{n||i(e)},showInstalledControls:!1},e.id)},t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=n,t[2]=i,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,Q.jsx)(Le,{children:a}),t[7]=a,t[8]=o),o}function mt(e){let t=(0,X.c)(21),{skills:n,threadId:r,onOpenSkill:i,onDelete:a,onAddManual:o,onAddUrl:s}=e,c=!r,l;t[0]!==o||t[1]!==s?(l=e=>{e===`manual`?o():s()},t[0]=o,t[1]=s,t[2]=l):l=t[2];let u;t[3]!==c||t[4]!==l?(u=(0,Q.jsx)(J,{title:`Installed Skills`,description:`Reusable instruction sets that guide agent behavior in this project.`,action:(0,Q.jsx)(ot,{manualDisabled:c,onSelectMode:l}),sticky:!1}),t[3]=c,t[4]=l,t[5]=u):u=t[5];let d;t[6]===r?d=t[7]:(d=!r&&(0,Q.jsx)(we,{children:`Select a thread to add or install skills.`}),t[6]=r,t[7]=d);let f;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(f={icon:g,title:`No skills installed`,description:`Add skills to extend agent capabilities with reusable instructions.`},t[8]=f):f=t[8];let p;t[9]===i?p=t[10]:(p=e=>i(e.path),t[9]=i,t[10]=p);let m;t[11]!==a||t[12]!==n||t[13]!==p?(m=(0,Q.jsx)(ze,{showHeader:!1,compact:!0,loading:!1,items:n,emptyState:f,getKey:vt,renderContent:_t,onItemClick:p,itemClickLabel:gt,onDelete:a,deleteAriaLabel:ht,deleteTooltip:`Remove this skill from the project`}),t[11]=a,t[12]=n,t[13]=p,t[14]=m):m=t[14];let h;t[15]!==d||t[16]!==m?(h=(0,Q.jsxs)(be,{className:`pt-6`,children:[d,m]}),t[15]=d,t[16]=m,t[17]=h):h=t[17];let _;return t[18]!==u||t[19]!==h?(_=(0,Q.jsxs)(he,{className:`shrink-0`,children:[u,h]}),t[18]=u,t[19]=h,t[20]=_):_=t[20],_}function ht(e){return`Delete ${e.name}`}function gt(e){return`Open ${e.name} in Files`}function _t(e){return(0,Q.jsx)(`span`,{className:v(a.body,`truncate text-left`),children:e.name})}function vt(e){return e.id}function yt(e){let t=(0,X.c)(40),{availableSearch:n,onSearchChange:r,selectedSourceId:i,onSourceChange:a,sources:o,selectedCustomSource:s,availableCatalogLoading:c,isDefaultSource:l,filteredPopular:u,filteredCatalog:d,installedFilePaths:f,onPreviewPopular:h,onPreviewCatalog:g,onAddSource:_}=e,v;t[0]!==n||t[1]!==r?(v=(0,Q.jsx)(Re,{placeholder:`Search`,value:n,onChange:r,className:`mb-0 w-64`}),t[0]=n,t[1]=r,t[2]=v):v=t[2];let b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(xe,{className:`w-40`,"aria-label":`Skill source`,children:(0,Q.jsx)(Ce,{placeholder:`Default`})}),t[3]=b):b=t[3];let x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(me,{value:`default`,children:`Default`}),t[4]=x):x=t[4];let S;t[5]===o?S=t[6]:(S=o.map(bt),t[5]=o,t[6]=S);let C;t[7]===S?C=t[8]:(C=(0,Q.jsxs)(Ae,{children:[x,S]}),t[7]=S,t[8]=C);let w;t[9]!==a||t[10]!==i||t[11]!==C?(w=(0,Q.jsxs)(Te,{value:i,onValueChange:a,children:[b,C]}),t[9]=a,t[10]=i,t[11]=C,t[12]=w):w=t[12];let T=s?`Edit skill source`:`Add skill source`,E;t[13]===s?E=t[14]:(E=s?(0,Q.jsx)(p,{className:`h-4 w-4`}):(0,Q.jsx)(m,{className:`h-4 w-4`}),t[13]=s,t[14]=E);let D;t[15]!==_||t[16]!==T||t[17]!==E?(D=(0,Q.jsx)(ne,{asChild:!0,children:(0,Q.jsx)(y,{type:`button`,variant:`outline`,size:`icon`,className:`shrink-0`,onClick:_,"aria-label":T,children:E})}),t[15]=_,t[16]=T,t[17]=E,t[18]=D):D=t[18];let O=s?`Edit this custom skill source`:`Add a custom skill source`,k;t[19]===O?k=t[20]:(k=(0,Q.jsx)(re,{children:O}),t[19]=O,t[20]=k);let A;t[21]!==k||t[22]!==D?(A=(0,Q.jsx)(ie,{children:(0,Q.jsxs)(ae,{children:[D,k]})}),t[21]=k,t[22]=D,t[23]=A):A=t[23];let j;t[24]!==v||t[25]!==A||t[26]!==w?(j=(0,Q.jsx)(J,{title:`Available Skills`,description:`Browse and install skills from the catalog.`,action:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[v,w,A]}),sticky:!1}),t[24]=v,t[25]=A,t[26]=w,t[27]=j):j=t[27];let M;t[28]!==c||t[29]!==n||t[30]!==d||t[31]!==u||t[32]!==f||t[33]!==l||t[34]!==g||t[35]!==h?(M=(0,Q.jsx)(be,{className:`pt-6`,children:c?(0,Q.jsx)(R,{className:`py-12`,label:`Loading skills...`}):l?u.length===0?(0,Q.jsx)(Ie,{searchQuery:n,emptyLabel:`No available skills found.`}):(0,Q.jsx)(pt,{items:u,installedFilePaths:f,onPreview:h}):d.length===0?(0,Q.jsx)(Ie,{searchQuery:n,emptyLabel:`No available skills found.`}):(0,Q.jsx)(pt,{items:d,installedFilePaths:f,onPreview:g})}),t[28]=c,t[29]=n,t[30]=d,t[31]=u,t[32]=f,t[33]=l,t[34]=g,t[35]=h,t[36]=M):M=t[36];let N;return t[37]!==j||t[38]!==M?(N=(0,Q.jsxs)(he,{className:`shrink-0`,children:[j,M]}),t[37]=j,t[38]=M,t[39]=N):N=t[39],N}function bt(e){return(0,Q.jsx)(me,{value:e.id,children:e.title},e.id)}function xt(){let{selectedProjectId:e,selectedThreadId:t,items:n,loading:r,deleteConfirm:i,setDeleteConfirm:a,deleting:c,installedFilePaths:l,setInstalledFilePaths:u,loadItems:d,handleDelete:f,handleOpenInExplorer:p,triggerExplorerRefresh:m}=Ke({findItems:ut,installedPathSuffix:`/SKILL.md`,explorerPathSuffix:`/SKILL.md`,sortByName:!0,removedToastTitle:`Skill removed`}),h=s(e=>e.projects),g=(0,Z.useMemo)(()=>h.find(t=>t.projectId===e)??null,[h,e]),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),[w,T]=(0,Z.useState)([]),[E,O]=(0,Z.useState)(!0),[k,A]=(0,Z.useState)(null),[j,N]=(0,Z.useState)(!1),{query:ee,setQuery:P,deferredQuery:F}=Be(),{sources:I,selectedSourceId:L,setSelectedSourceId:ne,addSource:re,updateSource:ie,removeSource:ae,catalogSkills:R,isLoadingCatalog:B}=tt(),V=L==="default",H=(0,Z.useMemo)(()=>o(L)?I.find(e=>e.id===L)??null:null,[L,I]);(0,Z.useEffect)(()=>{O(!0),D().then(T).catch(()=>T([])).finally(()=>O(!1))},[]);let W=Fe(e?`${e}:${t??``}`:null,[r,E]),oe=(0,Z.useCallback)(async e=>{let n=`.agents/skills/${e.id}/SKILL.md`;if(!t||l.has(n))return;let r=e.sourceId??(L==="default"?void 0:L);try{if(r)await te(t,r,e.id,`.agents/skills/${e.id}`);else{let r=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.allowedTools&&r.push(`allowed-tools: ${e.allowedTools}`),e.license&&r.push(`license: ${e.license}`),r.push(`---`,``,e.instructions??``),await M(t,n,r.join(`
|
|
3
|
-
`))}u(e=>new Set(e).add(n)),m(),d(),z({title:`Skill installed`,description:e.name})}catch(e){throw z({title:`Error`,description:e instanceof Error?e.message:`Failed to install skill`,variant:`destructive`}),e}},[t,L,l,m,d]),se=(0,Z.useMemo)(()=>ft(w,F),[w,F]),ce=(0,Z.useMemo)(()=>ft(R,F),[R,F]),le=!V&&B&&R.length===0;return e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Se,{loading:W,children:[(0,Q.jsx)(mt,{skills:n,threadId:t,onOpenSkill:p,onDelete:a,onAddManual:()=>y(!0),onAddUrl:()=>x(!0)}),(0,Q.jsx)(yt,{availableSearch:ee,onSearchChange:P,selectedSourceId:L,onSourceChange:ne,sources:I,selectedCustomSource:H,availableCatalogLoading:le,isDefaultSource:V,filteredPopular:se,filteredCatalog:ce,installedFilePaths:l,onPreviewPopular:e=>A(e),onPreviewCatalog:e=>A({...e,sourceId:e.sourceId??L}),onAddSource:()=>N(!0)})]}),(0,Q.jsx)(Qe,{open:k!==null,onOpenChange:e=>{e||A(null)},skill:k,catalogSourceId:V?void 0:L,onInstall:oe}),(0,Q.jsx)(it,{open:j,onOpenChange:N,editingSource:H,onSourceAdded:e=>{re(e),z({title:`Skill source added`,description:`${e.title} is now available in the source list.`})},onSourceUpdated:e=>{ie(e),z({title:`Skill source updated`,description:`${e.title} has been saved.`})},onSourceDeleted:e=>{ae(e),z({title:`Skill source removed`,description:`The custom source has been deleted.`})}}),(0,Q.jsx)(G,{open:v,onOpenChange:y,children:(0,Q.jsx)(U,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,Q.jsx)(qe,{threadId:t,onSkillCreated:()=>{y(!1),d(),m()}})})}),(0,Q.jsx)(lt,{open:b,onOpenChange:x,onSubmit:e=>C(e)}),(0,Q.jsx)(Oe,{url:S,projectId:e,projectName:g?_(g):null,projects:h,onSelectProject:()=>{},onClose:()=>C(null),onInstalled:({mcpOnly:e})=>{d(),m(),z({title:e?`MCP server installed`:`Plugin installed`,description:e?`Its MCP servers were added to this project.`:`Its skills and MCP servers were added to this project.`})}}),(0,Q.jsx)(Pe,{open:i!==null,onOpenChange:e=>!e&&a(null),title:`Delete Skill`,description:`Are you sure you want to delete the skill "${i?.name}"? This action cannot be undone.`,onConfirm:()=>{i&&f(i)},confirming:c})]}):(0,Q.jsx)(ye,{children:`Select a project to manage skills.`})}export{xt as SettingsSkillsView,xt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{o as i,ot as a}from"./dist-BWuYHVi8.js";import{J as o,U as s,r as c}from"./store-BaMSfYoJ.js";import{D as l,Et as u,In as d,zn as f}from"./dist-DIjomljy.js";import{a as p,t as m}from"./utils-CT-Dw22R.js";import{t as h}from"./button-DeNw35VZ.js";import{i as g,n as _,t as v}from"./tooltip-B6ziVyTv.js";import{n as y}from"./async-loading-fallback-B_JNgWJR.js";import{n as ee}from"./use-toast-xpb5jNtN.js";import{$ as te,Ln as ne,ft as re,hn as ie,kn as ae}from"./index-DjaVbFDB.js";import{t as oe}from"./delete-confirm-dialog-C9NASyh6.js";import{i as se,r as b}from"./table-B3fLagUj.js";import{t as ce}from"./settings-list-DU82HNPX.js";import{t as le}from"./is-macos-client-BIb4ZSEa.js";var x=t(),S=e(n(),1),C=r(),ue=36,de=`table-fixed`,fe=`h-9 w-48 bg-transparent py-2`,pe=`h-9 bg-transparent py-2`,me=`h-9 w-32 bg-transparent py-2`,he=`h-9 w-10 bg-transparent py-2`,ge=m(a.bodyMuted,`w-48 truncate py-1.5`),_e=m(a.body,`truncate py-1.5`),ve=m(a.bodyMuted,`w-32 truncate py-1.5`),ye=`w-10 py-1.5`,be={column:`project`,direction:`asc`};function xe(e){let t=(0,x.c)(4),n;if(t[0]!==e){let{style:r,...i}=e,o;t[2]===r?o=t[3]:(o={...r,width:`100%`},t[2]=r,t[3]=o),n=(0,C.jsx)(`table`,{...i,style:o,className:m(`w-full caption-bottom`,de,a.body,i.className)}),t[0]=e,t[1]=n}else n=t[1];return n}function Se(e){let t=(0,x.c)(5),n;t[0]===e.className?n=t[1]:(n=m(`hidden`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,C.jsx)(`thead`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function Ce(e){let t=(0,x.c)(5),n;t[0]===e.className?n=t[1]:(n=m(`[&_tr:last-child]:border-0`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,C.jsx)(`tbody`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function we(e){let t=(0,x.c)(5),n;t[0]===e.className?n=t[1]:(n=m(`frosted-scrollbar`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,C.jsx)(`div`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function w(e,t){return t?i(t,e):e}function T(e,t,n){switch(t){case`project`:return e.projectName;case`path`:return w(e.path,n);case`branch`:return e.branch}}function Te(e){let t=[];for(let n of e){let e=p(n);for(let r of n.threads)t.push({threadId:r.threadId,projectId:n.projectId,projectName:e,path:r.path,branch:r.currentBranch||r.title})}return t}function Ee(e,t,n,r){return[...e].sort((e,i)=>{let a=T(e,t,r).localeCompare(T(i,t,r),void 0,{sensitivity:`base`});return n===`asc`?a:-a})}function E(e){let t=(0,x.c)(17),{label:n,column:r,sortColumn:i,sortDirection:a,className:o,onSort:s}=e,c=i===r,l=a===`asc`?d:f,u=c?`text-foreground`:`text-muted-foreground`,p;t[0]===u?p=t[1]:(p=m(`inline-flex items-center gap-1 transition-colors hover:text-foreground`,u),t[0]=u,t[1]=p);let h;t[2]!==r||t[3]!==s?(h=()=>s(r),t[2]=r,t[3]=s,t[4]=h):h=t[4];let g=c?a===`asc`?`ascending`:`descending`:`none`,_;t[5]!==l||t[6]!==c?(_=c?(0,C.jsx)(l,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):null,t[5]=l,t[6]=c,t[7]=_):_=t[7];let v;t[8]!==n||t[9]!==p||t[10]!==h||t[11]!==g||t[12]!==_?(v=(0,C.jsxs)(`button`,{type:`button`,className:p,onClick:h,"aria-sort":g,children:[n,_]}),t[8]=n,t[9]=p,t[10]=h,t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;return t[14]!==o||t[15]!==v?(y=(0,C.jsx)(se,{className:o,children:v}),t[14]=o,t[15]=v,t[16]=y):y=t[16],y}function D(){let e=(0,x.c)(55),t=c(Fe),n=c(Pe),r=c(Ne),i=c(Me),s=c(je),d=c(Ae),f=c(ke),p=c(Oe),{handleDeleteThread:T,refreshWorkspaces:D}=te(),{toast:O}=ee(),[k,Ie]=(0,S.useState)(null),[A,Le]=(0,S.useState)(be),Re=le()?`Finder`:`Explorer`,j,M;e[0]===D?(j=e[1],M=e[2]):(j=()=>{D()},M=[D],e[0]=D,e[1]=j,e[2]=M),(0,S.useEffect)(j,M);let N;e[3]!==n||e[4]!==t||e[5]!==A.column||e[6]!==A.direction?(N=Ee(Te(t),A.column,A.direction,n),e[3]=n,e[4]=t,e[5]=A.column,e[6]=A.direction,e[7]=N):N=e[7];let P=N,F;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){Le(t=>t.column===e?{column:e,direction:t.direction===`asc`?`desc`:`asc`}:{column:e,direction:`asc`})},e[8]=F):F=e[8];let ze=F,I;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){let{...t}=e;return(0,C.jsx)(`tr`,{...t,className:m(`group border-0 transition-colors hover:bg-muted/50`,t.className)})},e[9]=I):I=e[9];let Be=I,L;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(L={Table:xe,TableHead:Se,TableBody:Ce,TableRow:Be,Scroller:we},e[10]=L):L=e[10];let Ve=L,R;e[11]!==T||e[12]!==k?(R=function(){if(!k)return;let{projectId:e,threadId:t}=k;Ie(null),T(e,t)},e[11]=T,e[12]=k,e[13]=R):R=e[13];let He=R,z;e[14]===O?z=e[15]:(z=async function(e){try{await re(e.threadId,`.`)}catch{O({title:`Error`,description:`Failed to open folder in ${Re}.`,variant:`destructive`})}},e[14]=O,e[15]=z);let Ue=z,B;e[16]!==n||e[17]!==d||e[18]!==i||e[19]!==Ue||e[20]!==p||e[21]!==s||e[22]!==f?(B=function(e,t){let r=i.includes(t.threadId),c=o(t.threadId,s,f,p),y=d.includes(t.threadId),ee=!c&&!r&&!y,te=w(t.path,n);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(b,{className:ge,children:t.projectName}),(0,C.jsx)(b,{className:_e,children:(0,C.jsx)(`button`,{type:`button`,className:m(a.body,`block w-full truncate text-left hover:underline`),title:`${t.path}\nOpen in ${Re}`,onClick:()=>void Ue(t),children:te})}),(0,C.jsx)(b,{className:ve,children:t.branch}),(0,C.jsx)(b,{className:ye,children:(0,C.jsx)(`div`,{className:`ml-auto flex h-7 w-7 items-center justify-center`,children:r?(0,C.jsx)(u,{className:`h-4 w-4 animate-spin text-muted-foreground`,"aria-label":`Deleting`}):ee?(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{asChild:!0,children:(0,C.jsxs)(h,{variant:`ghost`,size:`icon-sm`,className:ce,onClick:e=>{e.stopPropagation(),Ie(t)},children:[(0,C.jsx)(l,{}),(0,C.jsx)(`span`,{className:`sr-only`,children:`Delete workspace`})]})}),(0,C.jsx)(_,{side:`left`,children:`Delete branch and files from the repo`})]}):null})})]})},e[16]=n,e[17]=d,e[18]=i,e[19]=Ue,e[20]=p,e[21]=s,e[22]=f,e[23]=B):B=e[23];let We=B,V;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=m(`w-full caption-bottom`,de,a.body),e[24]=V):V=e[24];let H,U,W;e[25]!==A.column||e[26]!==A.direction?(H=(0,C.jsx)(E,{label:`Project`,column:`project`,sortColumn:A.column,sortDirection:A.direction,className:fe,onSort:ze}),U=(0,C.jsx)(E,{label:`Path`,column:`path`,sortColumn:A.column,sortDirection:A.direction,className:pe,onSort:ze}),W=(0,C.jsx)(E,{label:`Branch`,column:`branch`,sortColumn:A.column,sortDirection:A.direction,className:me,onSort:ze}),e[25]=A.column,e[26]=A.direction,e[27]=H,e[28]=U,e[29]=W):(H=e[27],U=e[28],W=e[29]);let G;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,C.jsx)(se,{className:he,children:(0,C.jsx)(`span`,{className:`sr-only`,children:`Actions`})}),e[30]=G):G=e[30];let K;e[31]!==H||e[32]!==U||e[33]!==W?(K=(0,C.jsx)(`table`,{className:V,children:(0,C.jsx)(`thead`,{className:`[&_tr]:border-b [&_tr]:border-table-border`,children:(0,C.jsxs)(`tr`,{children:[H,U,W,G]})})}),e[31]=H,e[32]=U,e[33]=W,e[34]=K):K=e[34];let Ge=K,Ke=P.length>0?Ge:void 0,q;e[35]===Ke?q=e[36]:(q=(0,C.jsx)(ae,{title:`Storage`,description:`Workspaces and branches stored on disk across all projects.`,tableHeader:Ke}),e[35]=Ke,e[36]=q);let J;e[37]!==r||e[38]!==We||e[39]!==P?(J=(0,C.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:r&&P.length===0?(0,C.jsx)(y,{label:`Loading workspaces...`,size:`lg`}):P.length===0?(0,C.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,C.jsxs)(`div`,{className:`max-w-md space-y-2 text-center`,children:[(0,C.jsx)(`h3`,{className:a.emptyStateTitle,children:`No workspaces`}),(0,C.jsx)(`p`,{className:a.bodyMuted,children:`No branches or workspaces found yet.`})]})}):(0,C.jsx)(ie,{style:{height:`100%`},data:P,computeItemKey:De,itemContent:We,defaultItemHeight:ue,increaseViewportBy:ue*5,components:Ve})}),e[37]=r,e[38]=We,e[39]=P,e[40]=J):J=e[40];let Y;e[41]!==q||e[42]!==J?(Y=(0,C.jsxs)(ne,{className:`flex w-full max-w-none min-w-0 min-h-0 flex-1 flex-col pb-0 pt-0`,children:[q,J]}),e[41]=q,e[42]=J,e[43]=Y):Y=e[43];let qe=k!==null,X;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(X=e=>{e||Ie(null)},e[44]=X):X=e[44];let Z;e[45]!==n||e[46]!==k?(Z=k?`Are you sure you want to delete the workspace at "${w(k.path,n)}"? This removes the branch and all its files. This action cannot be undone.`:``,e[45]=n,e[46]=k,e[47]=Z):Z=e[47];let Q;e[48]!==He||e[49]!==qe||e[50]!==Z?(Q=(0,C.jsx)(oe,{open:qe,onOpenChange:X,title:`Delete workspace?`,description:Z,onConfirm:He,confirmLabel:`Delete`,confirmingLabel:`Deleting...`}),e[48]=He,e[49]=qe,e[50]=Z,e[51]=Q):Q=e[51];let $;return e[52]!==Y||e[53]!==Q?($=(0,C.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-1 flex-col`,children:[Y,Q]}),e[52]=Y,e[53]=Q,e[54]=$):$=e[54],$}function De(e,t){return t.threadId}function Oe(e){return e.pendingChatMessage}function ke(e){return s(e.threadStreamingStates)}function Ae(e){return e.completedThreadIds}function je(e){return e.processingThreadIds}function Me(e){return e.deletingThreadIds}function Ne(e){return e.projectsLoading}function Pe(e){return e.cloneRootPath}function Fe(e){return e.projects}export{D as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-general-view-CAYlYs3J.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-DjaVbFDB.js","assets/react-vendor-Ee0-5T4I.js","assets/markdown-renderer-qLede1zH.js","assets/button-DeNw35VZ.js","assets/utils-CT-Dw22R.js","assets/dist-BWuYHVi8.js","assets/dialog-Do98zzAW.js","assets/use-browser-overlay-block-DyprQSIG.js","assets/browser-overlay-block-CiDtkfup.js","assets/dist-DIjomljy.js","assets/dist-BZvmHCxP.js","assets/Combination-lwI_j-mU.js","assets/tooltip-B6ziVyTv.js","assets/dist-DiMgghKn.js","assets/dist-mdooLpmq.js","assets/use-toast-xpb5jNtN.js","assets/explorer-tab-context-BxUVwWQQ.js","assets/use-open-chat-dock-panel-Cr1bQYOH.js","assets/chat-dock-context-BXoAs38w.js","assets/api-BMo_Lz8f.js","assets/store-BaMSfYoJ.js","assets/main-tab-context-Byl1LybL.js","assets/chunk-QFMPRPBF-COsSkB7x.js","assets/query-keys-5QPW6Dv-.js","assets/alert-dialog-Cb1PEgra.js","assets/async-loading-fallback-B_JNgWJR.js","assets/scroll-area-nbNFO91g.js","assets/dist-OixawqbU.js","assets/use-suspense-resource-Dkz6ddFN.js","assets/suspense-resource-DnYnmTbs.js","assets/create-project-workspace-BcIx6FNf.js","assets/ndjson-stream-DeGpE5o5.js","assets/scenic-chrome-CbN3vum7.js","assets/dist-CWq9XRXF.js","assets/dist-DjKXDRW7.js","assets/dist-CWnEmdyL.js","assets/dist-CjhvxqFU.js","assets/dist-CSssbxDI.js","assets/useInfiniteQuery-DUeUxDcu.js","assets/index-DhOeeft5.css","assets/toggle-group-5tREtjoW.js","assets/use-settings-page-loading-BTySlInF.js","assets/is-macos-client-BIb4ZSEa.js","assets/project-settings-view-BalZ6Fe1.js","assets/commit-method-fields-CD3PTIox.js","assets/context-menu-Dx5Jy21w.js","assets/project-env-vars-view-N1Io1Pau.js","assets/project-model-aliases-view-B4FEze4g.js","assets/project-tools-view-OnCN0jKz.js","assets/providers-list-view-DXvcxXDM.js","assets/model-list-controls-D86_87E4.js","assets/sorting-DqwxPMRN.js","assets/async-error-boundary-J8P6NVvc.js","assets/card-B4eI0NI-.js","assets/settings-list-DU82HNPX.js","assets/skeleton-DvLd14RU.js","assets/use-deferred-search-Dgxosq55.js","assets/pending-changes-Bn-0ak1d.js","assets/settings-models-view-CTjnBd74.js","assets/table-B3fLagUj.js","assets/settings-mcp-servers-view-C6OZHR3K.js","assets/delete-confirm-dialog-C9NASyh6.js","assets/switch-pIBaqatj.js","assets/settings-slack-view-CiuJZ-9i.js","assets/settings-logs-view-DnQ_4O9b.js","assets/settings-skills-view-DHoSorOw.js","assets/mcp-server-card-zm-ss-7h.js","assets/use-installed-ai-files-E4BAFIPG.js","assets/settings-rules-view-DiTC-cBE.js","assets/settings-slash-commands-view-CnXff39A.js","assets/radio-group-CU59hGiA.js","assets/settings-subagents-view-B4HugfzU.js","assets/settings-instructions-view-GjQivhLy.js","assets/settings-system-prompt-view-DNQKxcFg.js","assets/account-view-DKQdyGPK.js","assets/conversation-history-view-JymxZFJ2.js","assets/settings-storage-view-CUsa7Lwv.js","assets/settings-statistics-view-D8SvAGE_.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,r,t as i}from"./react-vendor-Ee0-5T4I.js";import{c as a,o,s}from"./chunk-QFMPRPBF-COsSkB7x.js";import{S as c,ot as l}from"./dist-BWuYHVi8.js";import{Q as u,n as d,r as f}from"./store-BaMSfYoJ.js";import{A as p,C as m,G as h,I as g,It as _,J as v,Lt as y,Mn as b,Nn as x,Pn as S,S as C,Tt as w,U as T,b as E,dt as D,jn as O,k,vn as A,x as j,y as M}from"./dist-DIjomljy.js";import{a as N,o as P,t as F}from"./utils-CT-Dw22R.js";import{r as I,t as L}from"./button-DeNw35VZ.js";import{Tt as R,ln as z,qt as B}from"./api-BMo_Lz8f.js";import{i as V,n as H,r as U,t as W}from"./tooltip-B6ziVyTv.js";import{n as G}from"./async-loading-fallback-B_JNgWJR.js";import{n as ee}from"./scroll-area-nbNFO91g.js";import{a as te,i as K,n as ne,o as re,r as ie,s as ae,t as oe}from"./dist-BZvmHCxP.js";import{Dt as se,Ft as ce,Hn as le,I as ue,In as de,It as q,R as fe,c as J,d as pe,l as me,u as he,z as ge}from"./index-DjaVbFDB.js";import{t as _e}from"./skeleton-DvLd14RU.js";var Y=t(),X=e(n(),1),Z=i(),ve=(0,X.forwardRef)(function(e,t){let n=(0,Y.c)(29),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p,isMobile:m,mobileShowSidebar:h,sidebarClassName:g}=e,_=a===void 0?25:a,v=o===void 0?20:o,y=s===void 0?30:s,b=c===void 0?40:c,x=l===void 0?!1:l,S=u===void 0?0:u,C=d===void 0?``:d,w=m===void 0?!1:m,T=h===void 0?!0:h,E=w&&!T,D=w&&T,O=`h-full ${C}`,k=w?100:_,A=w?50:v,j=w?100:y,M=E&&`hidden`,N;n[0]!==g||n[1]!==M?(N=F(`border-r border-transparent`,M,g),n[0]=g,n[1]=M,n[2]=N):N=n[2];let P;n[3]!==S||n[4]!==x||n[5]!==f||n[6]!==p||n[7]!==t||n[8]!==r||n[9]!==k||n[10]!==A||n[11]!==j||n[12]!==N?(P=(0,Z.jsx)(he,{ref:t,defaultSize:k,minSize:A,maxSize:j,collapsible:x,collapsedSize:S,onCollapse:f,onExpand:p,className:N,children:r}),n[3]=S,n[4]=x,n[5]=f,n[6]=p,n[7]=t,n[8]=r,n[9]=k,n[10]=A,n[11]=j,n[12]=N,n[13]=P):P=n[13];let I;n[14]===w?I=n[15]:(I=!w&&(0,Z.jsx)(me,{withHandle:!0,className:`ml-[-10px]`}),n[14]=w,n[15]=I);let L=D&&`hidden`,R;n[16]===L?R=n[17]:(R=F(`overflow-hidden`,L),n[16]=L,n[17]=R);let z;n[18]!==i||n[19]!==b||n[20]!==R?(z=(0,Z.jsx)(he,{minSize:b,className:R,children:i}),n[18]=i,n[19]=b,n[20]=R,n[21]=z):z=n[21];let B;n[22]!==P||n[23]!==I||n[24]!==z?(B=(0,Z.jsxs)(pe,{direction:`horizontal`,className:`h-full`,children:[P,I,z]}),n[22]=P,n[23]=I,n[24]=z,n[25]=B):B=n[25];let V;return n[26]!==O||n[27]!==B?(V=(0,Z.jsx)(`div`,{className:O,children:B}),n[26]=O,n[27]=B,n[28]=V):V=n[28],V});function ye(e){let t=(0,Y.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=F(`h-4 w-4`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`path`,{d:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.528 2.528 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.528 2.528 0 0 1-2.52-2.523 2.528 2.528 0 0 1 2.52-2.52h6.313A2.528 2.528 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:r,children:i}),t[3]=r,t[4]=a),a}var be=re,xe=te,Se=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(K,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Se.displayName=K.displayName;var Ce=P(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),we=X.forwardRef((e,t)=>{let n=(0,Y.c)(15),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({side:o,className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`right`:o,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Se,{}),n[5]=c):c=n[5];let l;n[6]!==i||n[7]!==s?(l=F(Ce({side:s}),i),n[6]=i,n[7]=s,n[8]=l):l=n[8];let u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsxs)(oe,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,Z.jsx)(M,{className:`h-4 w-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),n[9]=u):u=n[9];let d;return n[10]!==r||n[11]!==a||n[12]!==t||n[13]!==l?(d=(0,Z.jsxs)(xe,{children:[c,(0,Z.jsxs)(ne,{ref:t,className:l,...a,children:[r,u]})]}),n[10]=r,n[11]=a,n[12]=t,n[13]=l,n[14]=d):d=n[14],d});we.displayName=ne.displayName;var Te=e=>{let t=(0,Y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col space-y-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Te.displayName=`SheetHeader`;var Ee=e=>{let t=(0,Y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Ee.displayName=`SheetFooter`;var De=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(l.dialogTitle,`text-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(ae,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});De.displayName=ae.displayName;var Oe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(l.dialogDescription,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(ie,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Oe.displayName=ie.displayName;var ke=`sidebar:state`,Ae=3600*24*7,je=`16rem`,Me=`18rem`,Ne=`3rem`,Pe=X.createContext(null);function Q(){let e=X.useContext(Pe);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var Fe=X.forwardRef((e,t)=>{let n=(0,Y.c)(37),r,i,a,o,s,c,l;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7]):({defaultOpen:l,open:a,onOpenChange:s,className:i,style:c,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l);let u=l===void 0?!0:l,d=J(),[f,p]=X.useState(!1),[m,h]=X.useState(u),g=a??m,_;n[8]!==g||n[9]!==s?(_=e=>{let t=typeof e==`function`?e(g):e;s?s(t):h(t),document.cookie=`${ke}=${t}; path=/; max-age=${Ae}`},n[8]=g,n[9]=s,n[10]=_):_=n[10];let v=_,y;n[11]!==d||n[12]!==v?(y=()=>d?p(Ie):v(Le),n[11]=d,n[12]=v,n[13]=y):y=n[13];let b=y,x,S;n[14]===b?(x=n[15],S=n[16]):(x=()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},S=[b],n[14]=b,n[15]=x,n[16]=S),X.useEffect(x,S);let C=g?`expanded`:`collapsed`,w;n[17]!==d||n[18]!==g||n[19]!==f||n[20]!==v||n[21]!==C||n[22]!==b?(w={state:C,open:g,setOpen:v,isMobile:d,openMobile:f,setOpenMobile:p,toggleSidebar:b},n[17]=d,n[18]=g,n[19]=f,n[20]=v,n[21]=C,n[22]=b,n[23]=w):w=n[23];let T=w,E;n[24]===c?E=n[25]:(E={"--sidebar-width":je,"--sidebar-width-icon":Ne,...c},n[24]=c,n[25]=E);let D=E,O;n[26]===i?O=n[27]:(O=F(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,i),n[26]=i,n[27]=O);let k;n[28]!==r||n[29]!==o||n[30]!==t||n[31]!==D||n[32]!==O?(k=(0,Z.jsx)(U,{delayDuration:0,children:(0,Z.jsx)(`div`,{style:D,className:O,ref:t,...o,children:r})}),n[28]=r,n[29]=o,n[30]=t,n[31]=D,n[32]=O,n[33]=k):k=n[33];let A;return n[34]!==T||n[35]!==k?(A=(0,Z.jsx)(Pe.Provider,{value:T,children:k}),n[34]=T,n[35]=k,n[36]=A):A=n[36],A});Fe.displayName=`SidebarProvider`;function Ie(e){return!e}function Le(e){return!e}var Re=X.forwardRef((e,t)=>{let n=(0,Y.c)(47),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({side:o,variant:s,collapsible:c,className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=o===void 0?`left`:o,u=s===void 0?`sidebar`:s,d=c===void 0?`offcanvas`:c,{isMobile:f,state:p,openMobile:m,setOpenMobile:h}=Q();if(d===`none`){let e;n[7]===i?e=n[8]:(e=F(`flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground`,i),n[7]=i,n[8]=e);let o;return n[9]!==r||n[10]!==a||n[11]!==t||n[12]!==e?(o=(0,Z.jsx)(`div`,{className:e,ref:t,...a,children:r}),n[9]=r,n[10]=a,n[11]=t,n[12]=e,n[13]=o):o=n[13],o}if(f){let e;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(e={"--sidebar-width":Me},n[14]=e):e=n[14];let t;n[15]===r?t=n[16]:(t=(0,Z.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:r}),n[15]=r,n[16]=t);let i;n[17]!==l||n[18]!==t?(i=(0,Z.jsx)(we,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:e,side:l,children:t}),n[17]=l,n[18]=t,n[19]=i):i=n[19];let o;return n[20]!==m||n[21]!==a||n[22]!==h||n[23]!==i?(o=(0,Z.jsx)(be,{open:m,onOpenChange:h,...a,children:i}),n[20]=m,n[21]=a,n[22]=h,n[23]=i,n[24]=o):o=n[24],o}let g=p===`collapsed`?d:``,_=u===`floating`||u===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]`:`group-data-[collapsible=icon]:w-[--sidebar-width-icon]`,v;n[25]===_?v=n[26]:(v=F(`relative h-svh w-[--sidebar-width] bg-transparent`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,_),n[25]=_,n[26]=v);let y;n[27]===v?y=n[28]:(y=(0,Z.jsx)(`div`,{className:v}),n[27]=v,n[28]=y);let b=l===`left`?`left-0`:`right-0`,x=u===`floating`||u===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]`:`group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l`,S;n[29]!==i||n[30]!==b||n[31]!==x?(S=F(`fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] md:flex`,b,`group-data-[collapsible=offcanvas]:hidden`,x,i),n[29]=i,n[30]=b,n[31]=x,n[32]=S):S=n[32];let C;n[33]===r?C=n[34]:(C=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:r}),n[33]=r,n[34]=C);let w;n[35]!==a||n[36]!==S||n[37]!==C?(w=(0,Z.jsx)(`div`,{className:S,...a,children:C}),n[35]=a,n[36]=S,n[37]=C,n[38]=w):w=n[38];let T;return n[39]!==t||n[40]!==l||n[41]!==p||n[42]!==w||n[43]!==g||n[44]!==y||n[45]!==u?(T=(0,Z.jsxs)(`div`,{ref:t,className:`group peer hidden md:block text-sidebar-foreground`,"data-state":p,"data-collapsible":g,"data-variant":u,"data-side":l,children:[y,w]}),n[39]=t,n[40]=l,n[41]=p,n[42]=w,n[43]=g,n[44]=y,n[45]=u,n[46]=T):T=n[46],T});Re.displayName=`Sidebar`;var ze=X.forwardRef((e,t)=>{let n=(0,Y.c)(16),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,onClick:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{toggleSidebar:o}=Q(),s;n[4]===r?s=n[5]:(s=F(`h-7 w-7`,r),n[4]=r,n[5]=s);let c;n[6]!==i||n[7]!==o?(c=e=>{i?.(e),o()},n[6]=i,n[7]=o,n[8]=c):c=n[8];let l,u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(D,{}),u=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),n[9]=l,n[10]=u):(l=n[9],u=n[10]);let d;return n[11]!==a||n[12]!==t||n[13]!==s||n[14]!==c?(d=(0,Z.jsxs)(L,{ref:t,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:s,onClick:c,...a,children:[l,u]}),n[11]=a,n[12]=t,n[13]=s,n[14]=c,n[15]=d):d=n[15],d});ze.displayName=`SidebarTrigger`;var Be=X.forwardRef((e,t)=>{let n=(0,Y.c)(13),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{toggleSidebar:a}=Q(),o;n[3]===r?o=n[4]:(o=F(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,r),n[3]=r,n[4]=o);let s;n[5]!==i||n[6]!==t||n[7]!==o||n[8]!==a?(s=(0,Z.jsx)(V,{asChild:!0,children:(0,Z.jsx)(`button`,{ref:t,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:a,className:o,...i})}),n[5]=i,n[6]=t,n[7]=o,n[8]=a,n[9]=s):s=n[9];let c;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(H,{children:`Toggle Sidebar`}),n[10]=c):c=n[10];let l;return n[11]===s?l=n[12]:(l=(0,Z.jsxs)(W,{children:[s,c]}),n[11]=s,n[12]=l),l});Be.displayName=`SidebarRail`;var Ve=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`main`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ve.displayName=`SidebarInset`;var He=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(ce,{ref:t,"data-sidebar":`input`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});He.displayName=`SidebarInput`;var Ue=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`flex flex-col gap-2 p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`header`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ue.displayName=`SidebarHeader`;var We=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`flex flex-col gap-2 p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`footer`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});We.displayName=`SidebarFooter`;var Ge=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`mx-2 w-auto bg-divider`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(q,{ref:t,"data-sidebar":`separator`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ge.displayName=`SidebarSeparator`;var Ke=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`content`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ke.displayName=`SidebarContent`;var qe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`relative flex w-full min-w-0 flex-col p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`group`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});qe.displayName=`SidebarGroup`;var Je=X.forwardRef((e,t)=>{let n=(0,Y.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,asChild:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a!==void 0&&a?I:`div`,s;n[4]===r?s=n[5]:(s=F(`duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-base font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,r),n[4]=r,n[5]=s);let c;return n[6]!==o||n[7]!==i||n[8]!==t||n[9]!==s?(c=(0,Z.jsx)(o,{ref:t,"data-sidebar":`group-label`,className:s,...i}),n[6]=o,n[7]=i,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});Je.displayName=`SidebarGroupLabel`;var Ye=X.forwardRef((e,t)=>{let n=(0,Y.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,asChild:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a!==void 0&&a?I:`button`,s;n[4]===r?s=n[5]:(s=F(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[collapsible=icon]:hidden`,r),n[4]=r,n[5]=s);let c;return n[6]!==o||n[7]!==i||n[8]!==t||n[9]!==s?(c=(0,Z.jsx)(o,{ref:t,"data-sidebar":`group-action`,className:s,...i}),n[6]=o,n[7]=i,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});Ye.displayName=`SidebarGroupAction`;var Xe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`w-full`,l.compact,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`group-content`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Xe.displayName=`SidebarGroupContent`;var Ze=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`flex w-full min-w-0 flex-col gap-1`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`ul`,{ref:t,"data-sidebar":`menu`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ze.displayName=`SidebarMenu`;var Qe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`group/menu-item relative`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`li`,{ref:t,"data-sidebar":`menu-item`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Qe.displayName=`SidebarMenuItem`;var $e=P(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left ${l.compact} outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8`,sm:`h-7`,lg:`h-12 group-data-[collapsible=icon]:!p-0`}},defaultVariants:{variant:`default`,size:`default`}}),et=X.forwardRef((e,t)=>{let n=(0,Y.c)(29),r,i,a,o,s,c,l;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7]):({asChild:a,isActive:o,variant:s,size:c,tooltip:l,className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l);let u=a===void 0?!1:a,d=o===void 0?!1:o,f=s===void 0?`default`:s,p=c===void 0?`default`:c,m=u?I:`button`,{isMobile:h,state:g}=Q(),_;n[8]!==r||n[9]!==p||n[10]!==f?(_=F($e({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=_):_=n[11];let v;n[12]!==m||n[13]!==d||n[14]!==i||n[15]!==t||n[16]!==p||n[17]!==_?(v=(0,Z.jsx)(m,{ref:t,"data-sidebar":`menu-button`,"data-size":p,"data-active":d,className:_,...i}),n[12]=m,n[13]=d,n[14]=i,n[15]=t,n[16]=p,n[17]=_,n[18]=v):v=n[18];let y=v;if(!l)return y;if(typeof l==`string`){let e;n[19]===l?e=n[20]:(e={children:l},n[19]=l,n[20]=e),l=e}let b;n[21]===y?b=n[22]:(b=(0,Z.jsx)(V,{asChild:!0,children:y}),n[21]=y,n[22]=b);let x=g!==`collapsed`||h,S;n[23]!==x||n[24]!==l?(S=(0,Z.jsx)(H,{side:`right`,align:`center`,hidden:x,...l}),n[23]=x,n[24]=l,n[25]=S):S=n[25];let C;return n[26]!==b||n[27]!==S?(C=(0,Z.jsxs)(W,{children:[b,S]}),n[26]=b,n[27]=S,n[28]=C):C=n[28],C});et.displayName=`SidebarMenuButton`;var tt=X.forwardRef((e,t)=>{let n=(0,Y.c)(13),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,asChild:a,showOnHover:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a===void 0?!1:a,c=o===void 0?!1:o,l=s?I:`button`,u=c&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,d;n[5]!==r||n[6]!==u?(d=F(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,u,r),n[5]=r,n[6]=u,n[7]=d):d=n[7];let f;return n[8]!==l||n[9]!==i||n[10]!==t||n[11]!==d?(f=(0,Z.jsx)(l,{ref:t,"data-sidebar":`menu-action`,className:d,...i}),n[8]=l,n[9]=i,n[10]=t,n[11]=d,n[12]=f):f=n[12],f});tt.displayName=`SidebarMenuAction`;var nt=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`menu-badge`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});nt.displayName=`SidebarMenuBadge`;var rt=X.forwardRef((e,t)=>{let n=(0,Y.c)(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,showIcon:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?!1:a,s=`${Math.floor(Math.random()*40)+50}%`,c;n[4]===r?c=n[5]:(c=F(`rounded-md h-8 flex gap-2 px-2 items-center`,r),n[4]=r,n[5]=c);let l;n[6]===o?l=n[7]:(l=o&&(0,Z.jsx)(_e,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),n[6]=o,n[7]=l);let u;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(u={"--skeleton-width":s},n[8]=u):u=n[8];let d;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(_e,{className:`h-4 flex-1 max-w-[--skeleton-width]`,"data-sidebar":`menu-skeleton-text`,style:u}),n[9]=d):d=n[9];let f;return n[10]!==i||n[11]!==t||n[12]!==c||n[13]!==l?(f=(0,Z.jsxs)(`div`,{ref:t,"data-sidebar":`menu-skeleton`,className:c,...i,children:[l,d]}),n[10]=i,n[11]=t,n[12]=c,n[13]=l,n[14]=f):f=n[14],f});rt.displayName=`SidebarMenuSkeleton`;var it=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`ul`,{ref:t,"data-sidebar":`menu-sub`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});it.displayName=`SidebarMenuSub`;var at=X.forwardRef((e,t)=>{let n=(0,Y.c)(5),r;n[0]===e?r=n[1]:({...r}=e,n[0]=e,n[1]=r);let i;return n[2]!==r||n[3]!==t?(i=(0,Z.jsx)(`li`,{ref:t,...r}),n[2]=r,n[3]=t,n[4]=i):i=n[4],i});at.displayName=`SidebarMenuSubItem`;var ot=X.forwardRef((e,t)=>{let n=(0,Y.c)(17),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({asChild:o,size:s,isActive:i,className:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c=o===void 0?!1:o,u=s===void 0?`md`:s,d=c?I:`a`,f=u===`sm`&&l.compact,p=u===`md`&&l.compact,m;n[6]!==r||n[7]!==f||n[8]!==p?(m=F(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,f,p,`group-data-[collapsible=icon]:hidden`,r),n[6]=r,n[7]=f,n[8]=p,n[9]=m):m=n[9];let h;return n[10]!==d||n[11]!==i||n[12]!==a||n[13]!==t||n[14]!==u||n[15]!==m?(h=(0,Z.jsx)(d,{ref:t,"data-sidebar":`menu-sub-button`,"data-size":u,"data-active":i,className:m,...a}),n[10]=d,n[11]=i,n[12]=a,n[13]=t,n[14]=u,n[15]=m,n[16]=h):h=n[16],h});ot.displayName=`SidebarMenuSubButton`;var st=[{id:`skills`,label:`Skills`,icon:(0,Z.jsx)(j,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,Z.jsx)(v,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,Z.jsx)(k,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,Z.jsx)(C,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,Z.jsx)(S,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`system-prompt`,label:`System Prompt`,icon:(0,Z.jsx)(g,{className:`h-4 w-4`}),route:`/settings/system-prompt`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,Z.jsx)(h,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`general`,label:`Settings`,icon:(0,Z.jsx)(T,{className:`h-4 w-4`}),route:`/settings/general`},{id:`logs`,label:`Logs`,icon:(0,Z.jsx)(w,{className:`h-4 w-4`}),route:`/settings/logs`},{id:`slack`,label:`Slack`,icon:(0,Z.jsx)(ye,{}),route:`/settings/slack`},{id:`providers`,label:`Providers`,icon:(0,Z.jsx)(A,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,Z.jsx)(b,{className:`h-4 w-4`}),route:`/settings/models`},{id:`statistics`,label:`Statistics`,icon:(0,Z.jsx)(O,{className:`h-4 w-4`}),route:`/settings/statistics`},{id:`history`,label:`History`,icon:(0,Z.jsx)(_,{className:`h-4 w-4`}),route:`/settings/history`},{id:`storage`,label:`Storage`,icon:(0,Z.jsx)(y,{className:`h-4 w-4`}),route:`/settings/storage`},{id:`account`,label:`Account`,icon:(0,Z.jsx)(m,{className:`h-4 w-4`}),route:`/settings/account`}],ct=new Set([`project`,`project-env-vars`,`project-model-aliases`,`project-tools`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`]),lt=new Set([`project`,`instructions`,`project-env-vars`]),ut=new Set([`skills`,`rules`,`slash-commands`,`subagents`,`mcp-servers`]),dt=new Set([`system-prompt`,`project-model-aliases`,`project-tools`]),ft=new Set([`general`,`logs`,`slack`,`providers`,`models`,`statistics`,`history`,`storage`,`account`]);function pt(e){return ct.has(e)?`project`:`general`}function $(e){let t=(0,Y.c)(18),{label:n,items:r,activeTabId:i,onItemClick:a,showSeparator:o,className:s}=e,c=o===void 0?!0:o;if(r.length===0)return null;let l;t[0]===n?l=t[1]:(l=n?(0,Z.jsx)(Je,{children:n}):null,t[0]=n,t[1]=l);let u;if(t[2]!==i||t[3]!==r||t[4]!==a){let e;t[6]!==i||t[7]!==a?(e=e=>(0,Z.jsx)(se,{selected:i===e.id,asChild:!0,children:(0,Z.jsx)(`button`,{className:`justify-start`,onClick:()=>a(e),children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,Z.jsx)(`span`,{children:e.label})]})})},e.id),t[6]=i,t[7]=a,t[8]=e):e=t[8],u=r.map(e),t[2]=i,t[3]=r,t[4]=a,t[5]=u}else u=t[5];let d;t[9]===u?d=t[10]:(d=(0,Z.jsx)(`div`,{className:`space-y-1`,children:u}),t[9]=u,t[10]=d);let f;t[11]===c?f=t[12]:(f=c?(0,Z.jsx)(q,{className:`my-2`}):null,t[11]=c,t[12]=f);let p;return t[13]!==s||t[14]!==l||t[15]!==d||t[16]!==f?(p=(0,Z.jsxs)(`div`,{className:s,children:[l,d,f]}),t[13]=s,t[14]=l,t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function mt(e){let t=[...st];if(!e)return t;let n=t.findIndex(e=>e.id===`skills`);t.splice(n,0,{id:`project`,label:`Settings`,icon:(0,Z.jsx)(T,{className:`h-4 w-4`}),route:`/settings/project/${e}`},{id:`project-env-vars`,label:`Environment Variables`,icon:(0,Z.jsx)(x,{className:`h-4 w-4`}),route:`/settings/project/${e}/env-vars`});let r=t.findIndex(e=>e.id===`instructions`),i=t.findIndex(e=>e.id===`project`);if(r!==-1&&i!==-1){let[e]=t.splice(r,1);t.splice(i+1,0,e)}let a=t.findIndex(e=>e.id===`system-prompt`),o=a===-1?null:t.splice(a,1)[0],s=t.findIndex(e=>e.id===`mcp-servers`);return s!==-1&&t.splice(s+1,0,...o?[o]:[],{id:`project-model-aliases`,label:`Model Aliases`,icon:(0,Z.jsx)(p,{className:`h-4 w-4`}),route:`/settings/project/${e}/model-aliases`},{id:`project-tools`,label:`Tools`,icon:(0,Z.jsx)(E,{className:`h-4 w-4`}),route:`/settings/project/${e}/tools`}),t}function ht(e){let t=(0,Y.c)(48),{className:n,selectedProjectId:r,settingsScope:i,onResetOnboarding:a,onNavItemSelect:c}=e,l=s(),u=o(),d=(0,X.useRef)(0),f=(0,X.useRef)(null),p,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>()=>{f.current&&clearTimeout(f.current)},m=[],t[0]=p,t[1]=m):(p=t[0],m=t[1]),(0,X.useEffect)(p,m);let h=J(),g;t[2]===r?g=t[3]:(g=mt(r),t[2]=r,t[3]=g);let _=g,v;t[4]!==h||t[5]!==_?(v=h?_.filter(St):_,t[4]=h,t[5]=_,t[6]=v):v=t[6];let y=v,b;t[7]!==u.pathname||t[8]!==y?(b=function(){let e=u.pathname;if(e.endsWith(`/tools`)&&e.startsWith(`/settings/project/`))return`project-tools`;if(e.endsWith(`/model-aliases`)&&e.startsWith(`/settings/project/`))return`project-model-aliases`;if(e.endsWith(`/env-vars`)&&e.startsWith(`/settings/project/`))return`project-env-vars`;if(e.startsWith(`/settings/project/`))return`project`;for(let t of y)if(e.startsWith(t.route))return t.id;return`general`}(),t[7]=u.pathname,t[8]=y,t[9]=b):b=t[9];let x=b,S,C,w,T,E,D,O,k,A;if(t[10]!==x||t[11]!==n||t[12]!==y||t[13]!==l||t[14]!==c||t[15]!==a||t[16]!==r||t[17]!==i){C=function(e){e.id===`general`&&a&&(f.current&&clearTimeout(f.current),d.current+=1,d.current>=3?(d.current=0,a()):f.current=setTimeout(()=>{d.current=0},1500)),c?.(),l(e.route)};let e=!!r;D=!e||i!==`project`,O=e&&i!==`general`;let o=y.filter(xt);E=o.filter(bt),T=o.filter(yt),w=o.filter(vt);let s;t[27]===y?s=t[28]:(s=y.filter(_t),t[27]=y,t[28]=s),S=s;let u=e?[]:o.filter(gt);t[29]===n?k=t[30]:(k=F(`space-y-1`,n),t[29]=n,t[30]=k),A=u.length>0?(0,Z.jsxs)(Z.Fragment,{children:[u.map(e=>(0,Z.jsx)(se,{selected:x===e.id,asChild:!0,children:(0,Z.jsx)(`button`,{className:`justify-start`,onClick:()=>C(e),children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,Z.jsx)(`span`,{children:e.label})]})})},e.id)),(0,Z.jsx)(q,{className:`my-2`})]}):null,t[10]=x,t[11]=n,t[12]=y,t[13]=l,t[14]=c,t[15]=a,t[16]=r,t[17]=i,t[18]=S,t[19]=C,t[20]=w,t[21]=T,t[22]=E,t[23]=D,t[24]=O,t[25]=k,t[26]=A}else S=t[18],C=t[19],w=t[20],T=t[21],E=t[22],D=t[23],O=t[24],k=t[25],A=t[26];let j;t[31]!==x||t[32]!==C||t[33]!==w||t[34]!==T||t[35]!==E||t[36]!==O?(j=O?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:`Project`,items:E,activeTabId:x,onItemClick:C,showSeparator:!1}),(0,Z.jsx)($,{label:`Customize`,items:T,activeTabId:x,onItemClick:C,showSeparator:!1,className:`pt-3`}),(0,Z.jsx)($,{label:`Advanced`,items:w,activeTabId:x,onItemClick:C,showSeparator:!1,className:`pt-3`})]}):null,t[31]=x,t[32]=C,t[33]=w,t[34]=T,t[35]=E,t[36]=O,t[37]=j):j=t[37];let M;t[38]!==x||t[39]!==S||t[40]!==C||t[41]!==D?(M=D?(0,Z.jsx)($,{items:S,activeTabId:x,onItemClick:C,showSeparator:!1}):null,t[38]=x,t[39]=S,t[40]=C,t[41]=D,t[42]=M):M=t[42];let N;return t[43]!==k||t[44]!==A||t[45]!==j||t[46]!==M?(N=(0,Z.jsxs)(`div`,{className:k,children:[A,j,M]}),t[43]=k,t[44]=A,t[45]=j,t[46]=M,t[47]=N):N=t[47],N}function gt(e){return e.id!==`project`}function _t(e){return ft.has(e.id)}function vt(e){return dt.has(e.id)}function yt(e){return ut.has(e.id)}function bt(e){return lt.has(e.id)}function xt(e){return ct.has(e.id)}function St(e){return e.id!==`account`}var Ct=c(`app.settings-view.ui`),wt=`h-8 rounded-full border-0 bg-muted/40 p-0.5`,Tt=`h-7 rounded-full px-4 data-[state=active]:bg-foreground data-[state=active]:text-background data-[state=active]:shadow-sm`,Et=`frosted-surface backdrop-blur-2xl`,Dt=(0,X.lazy)(()=>r(()=>import(`./settings-general-view-CAYlYs3J.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),Ot=(0,X.lazy)(()=>r(()=>import(`./project-settings-view-BalZ6Fe1.js`),__vite__mapDeps([45,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,46,42,47,43]))),kt=(0,X.lazy)(()=>r(()=>import(`./project-env-vars-view-N1Io1Pau.js`),__vite__mapDeps([48,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43]))),At=(0,X.lazy)(()=>r(()=>import(`./project-model-aliases-view-B4FEze4g.js`),__vite__mapDeps([49,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43]))),jt=(0,X.lazy)(()=>r(()=>import(`./project-tools-view-OnCN0jKz.js`),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43]))),Mt=(0,X.lazy)(()=>r(()=>import(`./providers-list-view-DXvcxXDM.js`),__vite__mapDeps([51,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,52,53,54,55,56,57,58,59]))),Nt=(0,X.lazy)(()=>r(()=>import(`./settings-models-view-CTjnBd74.js`),__vite__mapDeps([60,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,46,42,52,53,54,55,56,57,61,58]))),Pt=(0,X.lazy)(()=>r(()=>import(`./settings-mcp-servers-view-C6OZHR3K.js`),__vite__mapDeps([62,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,63,56,55,57,64,43]))),Ft=(0,X.lazy)(()=>r(()=>import(`./settings-slack-view-CiuJZ-9i.js`),__vite__mapDeps([65,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]))),It=(0,X.lazy)(()=>r(()=>import(`./settings-logs-view-DnQ_4O9b.js`),__vite__mapDeps([66,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42]))),Lt=(0,X.lazy)(()=>r(()=>import(`./settings-skills-view-DHoSorOw.js`),__vite__mapDeps([67,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,68,63,56,55,57,58,69,43]))),Rt=(0,X.lazy)(()=>r(()=>import(`./settings-rules-view-DiTC-cBE.js`),__vite__mapDeps([70,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,68,63,56,55,57,64,58,69,43]))),zt=(0,X.lazy)(()=>r(()=>import(`./settings-slash-commands-view-CnXff39A.js`),__vite__mapDeps([71,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,68,63,72,56,55,57,43]))),Bt=(0,X.lazy)(()=>r(()=>import(`./settings-subagents-view-B4HugfzU.js`),__vite__mapDeps([73,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,68,63,56,55,57,69,43]))),Vt=(0,X.lazy)(()=>r(()=>import(`./settings-instructions-view-GjQivhLy.js`),__vite__mapDeps([74,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43]))),Ht=(0,X.lazy)(()=>r(()=>import(`./settings-system-prompt-view-DNQKxcFg.js`),__vite__mapDeps([75,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43]))),Ut=(0,X.lazy)(()=>r(()=>import(`./account-view-DKQdyGPK.js`),__vite__mapDeps([76,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,63,57]))),Wt=(0,X.lazy)(()=>r(()=>import(`./conversation-history-view-JymxZFJ2.js`),__vite__mapDeps([77,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,63,61]))),Gt=(0,X.lazy)(()=>r(()=>import(`./settings-storage-view-CUsa7Lwv.js`),__vite__mapDeps([78,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,63,56,55,57,61,44]))),Kt=(0,X.lazy)(()=>r(()=>import(`./settings-statistics-view-D8SvAGE_.js`),__vite__mapDeps([79,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,61,42]))),qt=[`general`,`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`,`slack`,`logs`,`statistics`,`history`,`storage`,`account`];function Jt(e){let t=(0,Y.c)(2),{title:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(de,{title:n,children:`Content coming soon...`}),t[0]=n,t[1]=r),r}function Yt(e){return e.startsWith(`/settings/general`)?`general`:e.startsWith(`/settings/providers`)?`providers`:e.startsWith(`/settings/models`)?`models`:e.startsWith(`/settings/skills`)?`skills`:e.startsWith(`/settings/rules`)?`rules`:e.startsWith(`/settings/slash-commands`)?`slash-commands`:e.startsWith(`/settings/subagents`)?`subagents`:e.startsWith(`/settings/instructions`)?`instructions`:e.startsWith(`/settings/system-prompt`)?`system-prompt`:e.startsWith(`/settings/mcp-servers`)?`mcp-servers`:e.startsWith(`/settings/slack`)?`slack`:e.startsWith(`/settings/logs`)?`logs`:e.startsWith(`/settings/statistics`)?`statistics`:e.startsWith(`/settings/history`)?`history`:e.startsWith(`/settings/storage`)?`storage`:e.startsWith(`/settings/account`)?`account`:`general`}function Xt(e){let t=e.match(/^\/settings\/providers\/([^/]+)$/);return t?decodeURIComponent(t[1]):null}function Zt(e,t,n){return e&&qt.includes(e)?e:t&&qt.includes(t)?t:Yt(n)}function Qt(e,t,n,r,i){return e?`project-tools`:t?`project-model-aliases`:n?`project-env-vars`:r?`project`:i}function $t(e,t,n,r,i){return e?`Tools`:t?`Model Aliases`:n?`Environment Variables`:r?`Project`:st.find(e=>e.id===i)?.label??`Settings`}function en(e,t){return e===`/settings`||e===`/settings/project`||[`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(t=>e.startsWith(t))||t&&e.startsWith(`/settings/account`)}function tn(e,t){let n=!!e&&t.startsWith(`/settings/project/`),r=n&&t.endsWith(`/tools`),i=n&&t.endsWith(`/model-aliases`),a=n&&t.endsWith(`/env-vars`);return{isProjectRoute:n,isProjectToolsRoute:r,isProjectModelAliasesRoute:i,isProjectEnvVarsRoute:a,isProjectSettingsRoute:n&&!a&&!i&&!r}}function nn(e,t){let n=(0,Y.c)(5),r;n[0]!==t||n[1]!==e?(r=()=>{let n=e.current;if(!n)return;let r=function(e){if(e.key!==`Escape`)return;let n=document.activeElement;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLElement&&n.isContentEditable){n.blur();return}t()};return n.addEventListener(`keydown`,r),()=>n.removeEventListener(`keydown`,r)},n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]===t?i=n[4]:(i=[t],n[3]=t,n[4]=i),(0,X.useEffect)(r,i)}function rn(e){let t=(0,Y.c)(5),{selectedProjectId:n,settingsScope:r,onResetOnboarding:i,onNavItemSelect:a}=e,o=n?r:void 0,s;return t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==o?(s=(0,Z.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden p-2.5`,children:(0,Z.jsx)(ee,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(`div`,{className:`py-2`,children:(0,Z.jsx)(ht,{selectedProjectId:n,settingsScope:o,onResetOnboarding:i,onNavItemSelect:a})})})}),t[0]=a,t[1]=i,t[2]=n,t[3]=o,t[4]=s):s=t[4],s}function an(e){let t=(0,Y.c)(21),{settingsHeaderTitle:n,isProjectSettingsScope:r,selectedProject:i,selectedProjectId:a,settingsScope:o,onScopeChange:s,onRequestClose:c}=e,u;t[0]!==r||t[1]!==i?(u=r&&i?(0,Z.jsx)(le,{project:i,elevated:!1,className:`h-7 w-7 shrink-0 rounded-md`,iconClassName:`h-3.5 w-3.5`}):(0,Z.jsx)(`div`,{className:`flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border shadow-sm`,children:(0,Z.jsx)(`img`,{src:`/tarsk.svg`,alt:`Tarsk`,className:`h-full w-full`})}),t[0]=r,t[1]=i,t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=F(l.sectionTitle,`truncate`),t[3]=d):d=t[3];let f;t[4]===n?f=t[5]:(f=(0,Z.jsx)(`span`,{className:d,children:n}),t[4]=n,t[5]=f);let p;t[6]!==u||t[7]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 electrobun-webkit-app-region-no-drag`,children:[u,f]}),t[6]=u,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==s||t[10]!==a||t[11]!==o?(m=a?(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-4 flex justify-center`,children:(0,Z.jsx)(ue,{value:o,onValueChange:e=>{(e===`project`||e===`general`)&&s(e)},className:`pointer-events-auto electrobun-webkit-app-region-no-drag`,children:(0,Z.jsxs)(fe,{className:wt,children:[(0,Z.jsx)(ge,{value:`project`,className:Tt,children:`Project`}),(0,Z.jsx)(ge,{value:`general`,className:Tt,children:`General`})]})})}):null,t[9]=s,t[10]=a,t[11]=o,t[12]=m):m=t[12];let h,g;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(M,{className:`h-4 w-4`}),g=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`}),t[13]=h,t[14]=g):(h=t[13],g=t[14]);let _;t[15]===c?_=t[16]:(_=(0,Z.jsx)(`div`,{className:`ml-auto flex items-center gap-2 electrobun-webkit-app-region-no-drag`,children:(0,Z.jsxs)(L,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:c,children:[h,g]})}),t[15]=c,t[16]=_);let v;return t[17]!==p||t[18]!==m||t[19]!==_?(v=(0,Z.jsxs)(`div`,{className:`relative flex h-14 shrink-0 items-start px-4 pt-4 pb-2 electrobun-webkit-app-region-drag`,children:[p,m,_]}),t[17]=p,t[18]=m,t[19]=_,t[20]=v):v=t[20],v}function on(e){let t=(0,Y.c)(10),{isMobile:n,mobileShowSidebar:r,isProviderDetailRoute:i,activeSectionLabel:a,onShowSidebar:o}=e;if(!n||r||i)return null;let s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(D,{className:`h-4 w-4`}),c=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Show settings menu`}),t[0]=s,t[1]=c):(s=t[0],c=t[1]);let u;t[2]===o?u=t[3]:(u=(0,Z.jsxs)(L,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground`,onClick:o,children:[s,c]}),t[2]=o,t[3]=u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=F(l.sectionTitle,`truncate text-foreground`),t[4]=d):d=t[4];let f;t[5]===a?f=t[6]:(f=(0,Z.jsx)(`span`,{className:d,children:a}),t[5]=a,t[6]=f);let p;return t[7]!==u||t[8]!==f?(p=(0,Z.jsx)(`div`,{className:`px-6 pb-0 pt-6`,children:(0,Z.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-center gap-2`,children:[u,f]})}),t[7]=u,t[8]=f,t[9]=p):p=t[9],p}function sn(e){let t=(0,Y.c)(19),{isProjectToolsRoute:n,isProjectModelAliasesRoute:r,isProjectEnvVarsRoute:i,isProjectSettingsRoute:a,projectId:o,activeTab:s,locationKey:c,onboardingResetSignal:l,handleProjectUpdated:u}=e;if(n&&o){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(G,{}),t[0]=e):e=t[0];let n;return t[1]!==u||t[2]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(jt,{projectId:o,onProjectUpdated:u})}),t[1]=u,t[2]=o,t[3]=n):n=t[3],n}if(r&&o){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(G,{}),t[4]=e):e=t[4];let n;return t[5]!==u||t[6]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(At,{projectId:o,onProjectUpdated:u})}),t[5]=u,t[6]=o,t[7]=n):n=t[7],n}if(i&&o){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(G,{}),t[8]=e):e=t[8];let n;return t[9]===o?n=t[10]:(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(kt,{projectId:o})}),t[9]=o,t[10]=n),n}if(a&&o){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(G,{}),t[11]=e):e=t[11];let n;return t[12]!==u||t[13]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(Ot,{projectId:o,onProjectUpdated:u})}),t[12]=u,t[13]=o,t[14]=n):n=t[14],n}let d;return t[15]!==s||t[16]!==c||t[17]!==l?(d=cn(s,c,l),t[15]=s,t[16]=c,t[17]=l,t[18]=d):d=t[18],d}function cn(e,t,n){return{general:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Dt,{onboardingResetSignal:n})}),providers:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{label:`Loading providers...`,size:`lg`}),children:(0,Z.jsx)(Mt,{})}),models:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{label:`Loading models...`,size:`lg`}),children:(0,Z.jsx)(Nt,{})}),skills:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Lt,{},t)}),rules:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Rt,{})}),"slash-commands":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(zt,{})}),subagents:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Bt,{})}),instructions:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Vt,{})}),"system-prompt":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Ht,{})}),"mcp-servers":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Pt,{})}),slack:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Ft,{})}),logs:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(It,{})}),statistics:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Kt,{})}),history:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Wt,{})}),storage:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Gt,{})}),account:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(G,{}),children:(0,Z.jsx)(Ut,{})})}[e]??(0,Z.jsx)(Jt,{title:`Settings`})}function ln({onRequestClose:e}){let{tab:t,projectId:n}=a(),r=s(),i=o(),c=d(),l=f(e=>e.selectedProjectId),p=f(e=>e.projects),{isProjectRoute:m,isProjectToolsRoute:h,isProjectModelAliasesRoute:g,isProjectEnvVarsRoute:_,isProjectSettingsRoute:v}=tn(n,i.pathname),y=Xt(i.pathname)!==null,b=Zt(new URLSearchParams(i.search).get(`tab`),t,i.pathname),x=J(),[S,C]=(0,X.useState)(!0),[w,T]=(0,X.useState)(0),E=(0,X.useRef)(null),D=(0,X.useRef)(null),O=Qt(h,g,_,m,b),[k,A]=(0,X.useState)(()=>pt(O));(0,X.useEffect)(()=>{A(pt(O))},[O]);let j=(0,X.useCallback)(e=>{if(A(e),e===`project`&&l){r(`/settings/project/${l}`);return}e===`general`&&r(`/settings/general`)},[r,l]),M=(0,X.useMemo)(()=>p.find(e=>e.projectId===l)??null,[p,l]),P=k===`project`&&M!==null,I=P?`${N(M)} Settings`:`General Settings`,L=(0,X.useMemo)(()=>$t(h,g,_,v,b),[b,_,g,v,h]),V=(0,X.useCallback)(()=>{x&&C(!1)},[x]),H=(0,X.useCallback)(()=>{C(!0)},[]),U=(0,X.useCallback)(async()=>{try{await z(),T(e=>e+1)}catch(e){Ct.error(`Failed to reset onboarding:`,e)}},[]),W=(0,X.useCallback)(async()=>{B(n);try{let e=await R();c({type:u.SetProjects,projects:e.projects,cloneRootPath:e.cloneRootPath})}catch(e){throw Ct.error(`Failed to refresh projects after settings update:`,e),e}},[c,n]);return(0,X.useEffect)(()=>{en(i.pathname,x)&&r(`/settings/general`,{replace:!0})},[i.pathname,r,x]),nn(D,e),(0,Z.jsxs)(`div`,{ref:D,role:`dialog`,"aria-modal":`true`,"aria-label":`Settings`,className:F(`rounded-2xl border border-border shadow-lg`,Et,`flex h-full w-full flex-col overflow-hidden md:h-[95vh] md:w-[80vw] md:max-w-[1400px]`),children:[(0,Z.jsx)(an,{settingsHeaderTitle:I,isProjectSettingsScope:P,selectedProject:M,selectedProjectId:l,settingsScope:k,onScopeChange:j,onRequestClose:e}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(ve,{ref:E,collapsible:!0,isMobile:x,mobileShowSidebar:S,sidebarClassName:F(`overflow-hidden rounded-tr-2xl`,Et),sidebar:(0,Z.jsx)(rn,{selectedProjectId:l,settingsScope:k,onResetOnboarding:U,onNavItemSelect:V}),children:(0,Z.jsxs)(`div`,{className:F(`relative flex h-full min-h-0 flex-col overflow-hidden py-2.5 pl-2.5`,x?null:`ml-2.5`),children:[(0,Z.jsx)(on,{isMobile:x,mobileShowSidebar:S,isProviderDetailRoute:y,activeSectionLabel:L,onShowSidebar:H}),(0,Z.jsx)(sn,{isProjectToolsRoute:h,isProjectModelAliasesRoute:g,isProjectEnvVarsRoute:_,isProjectSettingsRoute:v,projectId:n,activeTab:b,locationKey:i.key,onboardingResetSignal:w,handleProjectUpdated:W})]})})})]})}export{ln as default};
|