tarsk 0.5.49 → 0.5.51
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/README.md +85 -3
- package/dist/index.js +10869 -8554
- package/dist/public/assets/{account-view-DxHV7OtO.js → account-view-CGokQA1o.js} +1 -1
- package/dist/public/assets/api-BRrGio-B.js +1 -0
- package/dist/public/assets/browser-tab-B3BybVD0.js +1 -0
- package/dist/public/assets/commit-dialog-BLzHl6oN.js +1 -0
- package/dist/public/assets/context-menu-yKNgVtVk.js +1 -0
- package/dist/public/assets/create-repo-dialog-DHFloJc3.js +1 -0
- package/dist/public/assets/{dialogs-config-BEazgV7k.js → dialogs-config-BF_RyK5j.js} +14 -14
- package/dist/public/assets/diff-view-DONeogdk.js +3 -0
- package/dist/public/assets/explorer-tab-view-C1Dex751.js +2 -0
- package/dist/public/assets/{explorer-tree-CiPMm5ck.js → explorer-tree-BmsrsMXJ.js} +1 -1
- package/dist/public/assets/explorer-view-1fAca9It.js +1 -0
- package/dist/public/assets/git-history-dialog-DXsSt3e0.js +1 -0
- package/dist/public/assets/git-ops-button-Cj3j4bvy.js +2 -0
- package/dist/public/assets/history-view-COEFPP2U.js +9 -0
- package/dist/public/assets/index-Dsj5zHdU.js +73 -0
- package/dist/public/assets/index-DzUALYN4.css +1 -0
- package/dist/public/assets/mcp-server-card-3bFOnHFO.js +1 -0
- package/dist/public/assets/merged-pr-dialog-C5vgSXwq.js +1 -0
- package/dist/public/assets/model-star-rating-GWRgO9pY.js +1 -0
- package/dist/public/assets/onboarding-B_n7I3ri.js +1 -0
- package/dist/public/assets/project-settings-view-DsVEiQM_.js +1 -0
- package/dist/public/assets/providers-list-view-BT5XZP-F.js +1 -0
- package/dist/public/assets/pull-request-dialog-BO_7fALs.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-DQSC-HUH.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-B9evx_c7.js +1 -0
- package/dist/public/assets/radio-group-CNuRXtN5.js +1 -0
- package/dist/public/assets/react-vendor-D-z0br-z.js +16 -0
- package/dist/public/assets/settings-general-view-BaTUBgdM.js +1 -0
- package/dist/public/assets/settings-instructions-view-Bit7tYRh.js +1 -0
- package/dist/public/assets/settings-list-Cc_0YmxB.js +1 -0
- package/dist/public/assets/settings-mcp-servers-view-BcuuyWhI.js +5 -0
- package/dist/public/assets/{settings-models-skeleton-Cse6L-Nd.js → settings-models-skeleton-BfIx9XDs.js} +1 -1
- package/dist/public/assets/{settings-models-view-BAxf3eJq.js → settings-models-view-CNFB1Iqn.js} +1 -1
- package/dist/public/assets/settings-rules-view-BvelCH4j.js +8 -0
- package/dist/public/assets/settings-skills-view-DV-cA6cj.js +3 -0
- package/dist/public/assets/settings-slash-commands-view-CKxQnzse.js +1 -0
- package/dist/public/assets/settings-subagents-view-DAl5Db-p.js +2 -0
- package/dist/public/assets/{settings-system-prompt-view-B1vc2cgC.js → settings-system-prompt-view-BdwsxqMo.js} +1 -1
- package/dist/public/assets/settings-view-BxiazdKG.js +2 -0
- package/dist/public/assets/{skeleton-6mGMglV0.js → skeleton-DJZ5x6e0.js} +1 -1
- package/dist/public/assets/{slug-utils-BT1eqWhW.js → slug-utils-D4uxO5qv.js} +1 -1
- package/dist/public/assets/{tabs-iUSYYupj.js → tabs-TGCt-ze0.js} +1 -1
- package/dist/public/assets/{terminal-panel-DIpnKR-N.js → terminal-panel-Bh_CKydu.js} +2 -2
- package/dist/public/assets/todos-view-DDSSplmi.js +17 -0
- package/dist/public/assets/{ui-components-kSaUEA_X.js → ui-components-JEH8JAJ7.js} +1 -1
- package/dist/public/assets/{use-deferred-search-DGJskNBr.js → use-deferred-search-BZg7Bt7W.js} +1 -1
- package/dist/public/assets/{utils-CECQ_-6N.js → utils-H-1x3dmp.js} +1 -1
- package/dist/public/assets/{vosk-speech-CgILeNJR.js → vosk-speech-FJiKHPe4.js} +2 -2
- package/dist/public/assets/{web-DGalafxk.js → web-B4cuelyi.js} +1 -1
- package/dist/public/assets/{web-BD1sqxMq.js → web-CQpWcSn8.js} +1 -1
- package/dist/public/assets/{web-BWAZk7ug.js → web-Cq4yC7dg.js} +1 -1
- package/dist/public/assets/{web-Dt5YgbhM.js → web-DOZOaJlj.js} +1 -1
- package/dist/public/index.html +8 -8
- package/package.json +1 -1
- package/dist/public/assets/api-Dhzdgb40.js +0 -1
- package/dist/public/assets/browser-tab-qhf-xKwZ.js +0 -1
- package/dist/public/assets/commit-dialog-DcVXFOBP.js +0 -1
- package/dist/public/assets/context-menu-PIC-g8wy.js +0 -1
- package/dist/public/assets/create-repo-dialog-CsjpTBPU.js +0 -1
- package/dist/public/assets/diff-view-CGEl0YbC.js +0 -3
- package/dist/public/assets/explorer-tab-view--ib_BjId.js +0 -2
- package/dist/public/assets/explorer-view-odyQutTO.js +0 -1
- package/dist/public/assets/git-history-dialog-qUZ7Qsp4.js +0 -1
- package/dist/public/assets/git-ops-button-Bced-_39.js +0 -2
- package/dist/public/assets/history-view-BMVTxWTg.js +0 -9
- package/dist/public/assets/index-C7FLshNp.css +0 -1
- package/dist/public/assets/index-_SOdLUMq.js +0 -73
- package/dist/public/assets/mcp-server-card-ChdAZekt.js +0 -1
- package/dist/public/assets/merged-pr-dialog-DAXqT4Xe.js +0 -1
- package/dist/public/assets/model-star-rating-BzpXBjSo.js +0 -1
- package/dist/public/assets/onboarding-Bi5MieW-.js +0 -1
- package/dist/public/assets/project-settings-view-CHV6lJG4.js +0 -1
- package/dist/public/assets/providers-list-view-Dgid2Wui.js +0 -1
- package/dist/public/assets/pull-request-dialog-BFgRF5AH.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-oGP-j8Yw.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-BQ0QC6Qu.js +0 -1
- package/dist/public/assets/radio-group-n9qyUxmu.js +0 -1
- package/dist/public/assets/react-vendor-iDwBzcYF.js +0 -16
- package/dist/public/assets/settings-general-view-Vwi9J6Tn.js +0 -1
- package/dist/public/assets/settings-instructions-view-8YIr0PO3.js +0 -1
- package/dist/public/assets/settings-list-owWkHWxE.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-CCXW_uet.js +0 -5
- package/dist/public/assets/settings-rules-view-D3KLTKVZ.js +0 -8
- package/dist/public/assets/settings-skills-view-DaqOna-w.js +0 -3
- package/dist/public/assets/settings-slash-commands-view-CN8_DTYX.js +0 -1
- package/dist/public/assets/settings-subagents-view-BIejA-ck.js +0 -2
- package/dist/public/assets/settings-view-DLBIkYoA.js +0 -2
- package/dist/public/assets/todos-view-BK6i_oPT.js +0 -17
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ai as e,Ea as t,Fo as n,Fr as r,Ir as i,Mi as a,Nr as o,Pr as s,Xi as c,Zo as l,os as u,ss as d}from"./dialogs-config-BEazgV7k.js";import{I as f}from"./history-view-BMVTxWTg.js";var p=d(),m=u(),h=f(e=>(0,m.jsxs)(`div`,{className:e.v0,onClick:e.v1,role:e.v2,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,m.jsx)(`span`,{className:e.v3,children:e.v4}),e.v5]}),e.v6]}),(0,m.jsx)(`p`,{className:e.v7,children:e.v8})]}),{name:`ServerCard_1`,portals:[`v4`,`v5`,`v6`,`v8`]}),g=function(u){let d=(0,p.c)(18),{name:f,description:g,installed:_,onClick:v,onOpen:y,onUninstall:b,showInstalledControls:x}=u,S=x===void 0?!0:x,C=`flex flex-col gap-2 p-2.5 rounded-lg border border-border bg-card text-left transition-colors w-full ${_?``:`hover:bg-accent/50 cursor-pointer`}`,w=_?void 0:v,T=_?void 0:`button`,E;d[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=a(c.label,`truncate`),d[0]=E):E=d[0];let D;d[1]!==_||d[2]!==S?(D=_&&S&&(0,m.jsx)(r,{delayDuration:300,children:(0,m.jsxs)(o,{children:[(0,m.jsx)(i,{asChild:!0,children:(0,m.jsx)(`span`,{className:`flex-shrink-0 h-4 w-4 rounded-full bg-green-500/15 flex items-center justify-center`,children:(0,m.jsx)(l,{className:`h-2.5 w-2.5 text-green-600 dark:text-green-400`})})}),(0,m.jsx)(s,{children:`Installed`})]})}),d[1]=_,d[2]=S,d[3]=D):D=d[3];let O;d[4]!==_||d[5]!==y||d[6]!==b||d[7]!==S?(O=_&&S&&(0,m.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[y&&(0,m.jsx)(r,{delayDuration:300,children:(0,m.jsxs)(o,{children:[(0,m.jsx)(i,{asChild:!0,children:(0,m.jsx)(e,{variant:`ghost`,size:`icon-sm`,onClick:e=>{e.stopPropagation(),y()},children:(0,m.jsx)(n,{className:`h-3.5 w-3.5`})})}),(0,m.jsx)(s,{children:`Open in Explorer`})]})}),b&&(0,m.jsx)(r,{delayDuration:300,children:(0,m.jsxs)(o,{children:[(0,m.jsx)(i,{asChild:!0,children:(0,m.jsx)(e,{variant:`ghost`,size:`icon-sm`,onClick:e=>{e.stopPropagation(),b()},className:`text-destructive hover:text-destructive`,children:(0,m.jsx)(t,{className:`h-3.5 w-3.5`})})}),(0,m.jsx)(s,{children:`Remove`})]})})]}),d[4]=_,d[5]=y,d[6]=b,d[7]=S,d[8]=O):O=d[8];let k;d[9]===Symbol.for(`react.memo_cache_sentinel`)?(k=a(c.caption,`line-clamp-3`),d[9]=k):k=d[9];let A;return d[10]!==g||d[11]!==f||d[12]!==C||d[13]!==w||d[14]!==T||d[15]!==D||d[16]!==O?(A=(0,m.jsx)(h,{v0:C,v1:w,v2:T,v3:E,v4:f,v5:D,v6:O,v7:k,v8:g}),d[10]=g,d[11]=f,d[12]=C,d[13]=w,d[14]=T,d[15]=D,d[16]=O,d[17]=A):A=d[17],A};export{g as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$r as e,Ai as t,Gr as n,Jr as r,Qr as i,Xi as a,Xr as o,Zr as s,ei as c,os as l,ss as u}from"./dialogs-config-BEazgV7k.js";import{a as d}from"./onboarding-Bi5MieW-.js";var f=u(),p=l();function m(l){let u=(0,f.c)(30),{open:m,onOpenChange:h,onNewBranch:g,onJustOpen:_,newChatOnNewBranch:v,onNewChatOnNewBranchChange:y,isLoading:b,projectName:x}=l,S=b===void 0?!1:b,C;u[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,p.jsx)(c,{children:`Pull Request Merged`}),u[0]=C):C=u[0];let w=x?` for ${x}`:``,T;u[1]===w?T=u[2]:(T=(0,p.jsxs)(e,{children:[C,(0,p.jsxs)(s,{children:[`As the pull request has been merged`,w,`, a new branch will be created from the current checkout.`]})]}),u[1]=w,u[2]=T);let E;u[3]===y?E=u[4]:(E=e=>y(e===!0),u[3]=y,u[4]=E);let D;u[5]!==v||u[6]!==E?(D=(0,p.jsx)(d,{id:`new-chat-on-new-branch`,checked:v,onCheckedChange:E}),u[5]=v,u[6]=E,u[7]=D):D=u[7];let O;u[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,p.jsx)(n,{htmlFor:`new-chat-on-new-branch`,className:a.labelNormal,children:`New Chat`}),u[8]=O):O=u[8];let k;u[9]===D?k=u[10]:(k=(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[D,O]}),u[9]=D,u[10]=k);let A;u[11]!==S||u[12]!==_?(A=(0,p.jsx)(t,{variant:`ghost`,onClick:_,disabled:S,children:`Just Open`}),u[11]=S,u[12]=_,u[13]=A):A=u[13];let j;u[14]!==S||u[15]!==g?(j=(0,p.jsx)(t,{onClick:g,disabled:S,children:`New Branch`}),u[14]=S,u[15]=g,u[16]=j):j=u[16];let M;u[17]!==j||u[18]!==A?(M=(0,p.jsxs)(`div`,{className:`flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row`,children:[A,j]}),u[17]=j,u[18]=A,u[19]=M):M=u[19];let N;u[20]!==M||u[21]!==k?(N=(0,p.jsxs)(i,{className:`flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[k,M]}),u[20]=M,u[21]=k,u[22]=N):N=u[22];let P;u[23]!==N||u[24]!==T?(P=(0,p.jsxs)(o,{children:[T,N]}),u[23]=N,u[24]=T,u[25]=P):P=u[25];let F;return u[26]!==h||u[27]!==m||u[28]!==P?(F=(0,p.jsx)(r,{open:m,onOpenChange:h,children:P}),u[26]=h,u[27]=m,u[28]=P,u[29]=F):F=u[29],F}export{m as MergedPRDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Aa as e,Fr as t,Ir as n,Nr as r,Pr as i,Xi as a,os as o,ss as s}from"./dialogs-config-BEazgV7k.js";import{r as c}from"./onboarding-Bi5MieW-.js";var l=s(),u=o();function d(o){let s=(0,l.c)(9),{codingIndex:d,modelName:f}=o,p=c(d);if(p===0)return null;let m;s[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=[1,2,3,4,5],s[0]=m):m=s[0];let h;s[1]===p?h=s[2]:(h=(0,u.jsx)(n,{asChild:!0,children:(0,u.jsx)(`div`,{className:`flex items-center gap-0.5`,children:m.map(t=>(0,u.jsx)(e,{className:`h-3 w-3 ${t<=p?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},t))})}),s[1]=p,s[2]=h);let g;s[3]!==d||s[4]!==f?(g=(0,u.jsx)(i,{children:(0,u.jsxs)(`p`,{className:a.body,children:[f,` was indexed `,d,` for coding intelligence`]})}),s[3]=d,s[4]=f,s[5]=g):g=s[5];let _;return s[6]!==h||s[7]!==g?(_=(0,u.jsx)(t,{children:(0,u.jsxs)(r,{children:[h,g]})}),s[6]=h,s[7]=g,s[8]=_):_=s[8],_}export{d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{$r as n,Ai as r,At as i,Fo as a,Fr as o,G as s,Gi as c,Gr as l,Ir as u,Jr as d,Ko as f,Kr as p,Lo as m,Mi as h,Ni as g,No as _,Nr as v,Oi as y,Ot as b,Po as x,Pr as S,Qr as C,Ti as w,U as T,Wi as E,Wr as D,Xi as O,Xr as k,Zo as A,Zr as j,as as M,bn as ee,c as te,ei as N,ga as P,h as ne,in as F,ki as I,kt as L,ls as re,ma as R,mi as ie,n as z,os as B,po as V,qr as H,r as ae,rs as oe,ss as se,uo as U,xi as W,y as ce,yn as le,za as ue,zo as de}from"./dialogs-config-BEazgV7k.js";import{I as G,_ as fe,d as pe,f as me,h as he,m as ge,p as _e,x as K}from"./history-view-BMVTxWTg.js";var q=se(),J=e(re(),1),Y=B(),ve=J.forwardRef((e,t)=>{let n=(0,q.c)(23),r,i,a,o,s,c,l,u,d;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7],u=n[8],d=n[9]):({className:i,selected:c,noBackground:o,level:a,basePadding:r,indentSize:u,asChild:d,style:l,...s}=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,n[8]=u,n[9]=d);let f=u===void 0?20:u,p=d===void 0?!1:d,m=a===void 0?void 0:(r??12)+a*f,g=p?R:`div`,_;n[10]!==i||n[11]!==o||n[12]!==c?(_=h(h(O.body,`flex items-center gap-2 w-full min-w-0 justify-start text-left touch-manipulation px-3 py-2 cursor-pointer rounded-full transition-colors group overflow-hidden`),`can-hover:hover:bg-sidebar-accent can-hover:hover:text-sidebar-accent-foreground`,c&&!o&&`bg-sidebar-accent text-sidebar-accent-foreground font-medium`,c&&o&&`font-bold text-foreground`,i),n[10]=i,n[11]=o,n[12]=c,n[13]=_):_=n[13];let v=m===void 0?void 0:`${m}px`,y;n[14]!==l||n[15]!==v?(y={paddingLeft:v,...l},n[14]=l,n[15]=v,n[16]=y):y=n[16];let b;return n[17]!==g||n[18]!==s||n[19]!==t||n[20]!==_||n[21]!==y?(b=(0,Y.jsx)(g,{ref:t,className:_,style:y,...s}),n[17]=g,n[18]=s,n[19]=t,n[20]=_,n[21]=y,n[22]=b):b=n[22],b});ve.displayName=`StandardListItem`;function ye(e){if(!e)return`Unknown Model`;let t=(e.split(`/`).filter(Boolean).pop()??e).replace(/[-_]+/g,` `).trim();return t?t.split(/\s+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):e}var be=`Separator`,xe=`horizontal`,Se=[`horizontal`,`vertical`],Ce=J.forwardRef((e,t)=>{let{decorative:n,orientation:r=xe,...i}=e,a=we(r)?r:xe,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,Y.jsx)(p.div,{"data-orientation":a,...o,...i,ref:t})});Ce.displayName=be;function we(e){return Se.includes(e)}var Te=Ce,Ee=J.forwardRef((e,t)=>{let n=(0,q.c)(14),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,orientation:a,decorative:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a===void 0?`horizontal`:a,c=o===void 0?!0:o,l=s===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,u;n[5]!==r||n[6]!==l?(u=h(`shrink-0 bg-border`,l,r),n[5]=r,n[6]=l,n[7]=u):u=n[7];let d;return n[8]!==c||n[9]!==s||n[10]!==i||n[11]!==t||n[12]!==u?(d=(0,Y.jsx)(Te,{ref:t,decorative:c,orientation:s,className:u,...i}),n[8]=c,n[9]=s,n[10]=i,n[11]=t,n[12]=u,n[13]=d):d=n[13],d});Ee.displayName=Te.displayName;function De(e){return`${e.slug.toUpperCase().replace(/-/g,`_`)}_API_URL`}function Oe(e){let t=e.env??[];return t.find(e=>/resource_name$/i.test(e))??t[0]??``}function ke(e){if(e.apiKeyEnv)return e.apiKeyEnv;if(e.keyName)return e.keyName;let t=e.env??[];return t.find(e=>/api_key$/i.test(e))??t[t.length-1]??``}function Ae(e){let t=ke(e);return(e.env??[]).filter(e=>e!==t)}function je(e){return e===`LOCAL_API_URL`?`URL`:e.replace(/^AZURE_/,``).replace(/_/g,` `).toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}function Me(e,t){let n=De(e),r=t[n]??e.envValues?.[n]??``;if(r)return r;if(e.slug===`azure`){let n=Oe(e),r=t[n]??e.envValues?.[n]??``;if(r)return`https://${r}.openai.azure.com/openai/v1`}return E(e.slug)?c({...e.envValues,...t}):e.api.replace(/\$\{([A-Z0-9_]+)\}/gi,(n,r)=>t[r]??e.envValues?.[r]??``)}function Ne(e){return e.slug.toLowerCase()===`openrouter`||e.name.toLowerCase()===`openrouter`}function Pe(e){return{recommended:e.find(Ne)??null,others:e.filter(e=>!Ne(e)).sort((e,t)=>e.name.localeCompare(t.name))}}function Fe(e){let{recommended:t,others:n}=Pe(e);return t??n[0]??null}function Ie(e){try{let t=new URL(e),n=t.hostname.split(`.`),r=n.length<=2?t.hostname:n.slice(-2).join(`.`);return`${t.protocol}//${r}`}catch{return e}}function Le(e){let t=(0,q.c)(17),{url:n,className:r,children:i,showIcon:o,variant:s}=e,c=o===void 0?!0:o,l=s===void 0?`link`:s,u;t[0]===n?u=t[1]:(u=Ie(n),t[0]=n,t[1]=u);let d=u,f;t[2]===d?f=t[3]:(f=async function(e){e.preventDefault(),e.stopPropagation();try{await F(d)}catch(e){console.error(`Failed to open provider website:`,e)}},t[2]=d,t[3]=f);let p=f,m=l===`link`&&O.caption,g=l===`link`&&`text-brand hover:underline inline-flex items-center gap-1`,_=l===`inline`&&`inline hover:underline`,v;t[4]!==r||t[5]!==m||t[6]!==g||t[7]!==_?(v=h(m,g,_,r),t[4]=r,t[5]=m,t[6]=g,t[7]=_,t[8]=v):v=t[8];let y;t[9]!==i||t[10]!==c?(y=i??(0,Y.jsxs)(Y.Fragment,{children:[`Visit provider website`,c&&(0,Y.jsx)(a,{className:`h-3.5 w-3.5`})]}),t[9]=i,t[10]=c,t[11]=y):y=t[11];let b;return t[12]!==p||t[13]!==d||t[14]!==v||t[15]!==y?(b=(0,Y.jsx)(`a`,{href:d,onClick:p,className:v,children:y}),t[12]=p,t[13]=d,t[14]=v,t[15]=y,t[16]=b):b=t[16],b}function Re(e){let t=(0,q.c)(10),{provider:n,size:r}=e,i=r===void 0?`md`:r,[a,o]=(0,J.useState)(!1),s=i===`sm`?`h-6 w-6`:`h-8 w-8`,c=i===`sm`?`h-4 w-4`:`h-5 w-5`,l=i===`sm`?`h-4 w-4`:`h-5 w-5`,u;t[0]===s?u=t[1]:(u=h(`flex-shrink-0 rounded-full bg-muted flex items-center justify-center overflow-hidden`,s),t[0]=s,t[1]=u);let d;t[2]!==l||t[3]!==c||t[4]!==a||t[5]!==n?(d=a?(0,Y.jsx)(de,{className:h(l,`text-muted-foreground`)}):(0,Y.jsx)(`img`,{src:b(n.slug),alt:`${n.name} logo`,className:h(c,`dark:invert`),onError:()=>o(!0)}),t[2]=l,t[3]=c,t[4]=a,t[5]=n,t[6]=d):d=t[6];let f;return t[7]!==u||t[8]!==d?(f=(0,Y.jsx)(`div`,{className:u,children:d}),t[7]=u,t[8]=d,t[9]=f):f=t[9],f}function ze(e){let t=(0,q.c)(10),{provider:n,recommended:r}=e,i=r===void 0?!1:r,a;t[0]===n?a=t[1]:(a=(0,Y.jsx)(Re,{provider:n,size:`sm`}),t[0]=n,t[1]=a);let o;t[2]===n.name?o=t[3]:(o=(0,Y.jsx)(`span`,{className:`truncate`,children:n.name}),t[2]=n.name,t[3]=o);let s;t[4]===i?s=t[5]:(s=i&&(0,Y.jsx)(`span`,{className:h(O.caption,`text-muted-foreground flex-shrink-0`),children:`(Recommended)`}),t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Be(e){let t=(0,q.c)(8),{providers:n}=e,r,i,a;if(t[0]!==n){let{recommended:e,others:o}=Pe(n);r=e&&(0,Y.jsx)(_e,{value:e.name,children:(0,Y.jsx)(ze,{provider:e,recommended:!0})},e.name),i=e&&o.length>0&&(0,Y.jsx)(ge,{}),a=o.map(Ve),t[0]=n,t[1]=r,t[2]=i,t[3]=a}else r=t[1],i=t[2],a=t[3];let o;return t[4]!==r||t[5]!==i||t[6]!==a?(o=(0,Y.jsxs)(Y.Fragment,{children:[r,i,a]}),t[4]=r,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function Ve(e){return(0,Y.jsx)(_e,{value:e.name,children:(0,Y.jsx)(ze,{provider:e})},e.name)}function He(e){let t=(0,q.c)(17),{providers:n,selectedProvider:r,onProviderChange:i}=e,a,o,s,c;if(t[0]!==i||t[1]!==n||t[2]!==r?.name){let{recommended:e,others:l}=Pe(n),u;t[7]!==i||t[8]!==r?.name?(u=function(e,t){let n=t===void 0?!1:t;return(0,Y.jsx)(ve,{selected:r?.name===e.name,asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,className:`justify-start w-full`,onClick:()=>i(e),children:[(0,Y.jsx)(Re,{provider:e}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.name}),n&&(0,Y.jsx)(`span`,{className:h(O.caption,`text-muted-foreground flex-shrink-0`),children:`(Recommended)`})]})},e.name)},t[7]=i,t[8]=r?.name,t[9]=u):u=t[9];let d=u;a=`space-y-1`,o=e&&d(e,!0),s=e&&l.length>0&&(0,Y.jsx)(Ee,{className:`my-2`});let f;t[10]===d?f=t[11]:(f=e=>d(e),t[10]=d,t[11]=f),c=l.map(f),t[0]=i,t[1]=n,t[2]=r?.name,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else a=t[3],o=t[4],s=t[5],c=t[6];let l;return t[12]!==a||t[13]!==o||t[14]!==s||t[15]!==c?(l=(0,Y.jsxs)(`div`,{className:a,children:[o,s,c]}),t[12]=a,t[13]=o,t[14]=s,t[15]=c,t[16]=l):l=t[16],l}function Ue({selectedProvider:e,onProviderChange:t,showApiKeyInput:n=!0,apiKey:r,onApiKeyChange:i,isLoading:a,error:o,variant:s=`dropdown`}){let[c,u]=(0,J.useState)([]),[d,f]=(0,J.useState)(!1);if((0,J.useEffect)(()=>{(async()=>{f(!0);try{let n=await L();if(u(n),n.length>0&&!e){let e=Fe(n);e&&t(e)}}catch(e){console.error(`Failed to load providers:`,e)}finally{f(!1)}})()},[e,t]),d)return(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,Y.jsx)(U,{className:`h-4 w-4 animate-spin text-muted-foreground`})});let p=(0,Y.jsxs)(Y.Fragment,{children:[e?.url&&(0,Y.jsx)(Le,{url:e.url}),n&&e&&(0,Y.jsx)(We,{provider:e,value:r??e.apiKey??``,onChange:i,isLoading:a})]});return s===`list`?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o&&(0,Y.jsx)(`p`,{className:O.error,children:o}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(l,{children:`AI Provider`}),(0,Y.jsx)(He,{providers:c,selectedProvider:e,onProviderChange:t})]}),p]}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o&&(0,Y.jsx)(`p`,{className:O.error,children:o}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(l,{children:`AI Provider`}),(0,Y.jsxs)(pe,{value:e?.name??``,onValueChange:e=>{let n=c.find(t=>t.name===e);n&&t(n)},children:[(0,Y.jsx)(he,{children:e?(0,Y.jsx)(ze,{provider:e}):`Select a provider`}),(0,Y.jsx)(me,{children:(0,Y.jsx)(Be,{providers:c})})]})]}),p]})}function We(e){let t=(0,q.c)(24),{provider:n,value:i,onChange:a,isLoading:s}=e,[c,d]=(0,J.useState)(!1);if(n.authType!==`APIKey`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(K,{className:`mb-0`,children:`This provider uses OAuth for authentication.`}),t[0]=e):e=t[0];let i;return t[1]===n.name?i=t[2]:(i=(0,Y.jsxs)(`div`,{className:`space-y-2 text-center`,children:[e,(0,Y.jsxs)(r,{variant:`outline`,size:`sm`,disabled:!0,children:[`Sign in with `,n.name]})]}),t[1]=n.name,t[2]=i),i}let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,Y.jsx)(o,{children:(0,Y.jsxs)(v,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsx)(l,{htmlFor:`api-key`,className:`cursor-help`,children:`API Key`})}),(0,Y.jsx)(S,{children:`Your API key is stored locally and never shared.`})]})})}),t[3]=f):f=t[3];let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(V,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),t[4]=p):p=t[4];let m=c?`text`:`password`,h=n.keyName??`Enter API Key`,g;t[5]===a?g=t[6]:(g=e=>a?.(e.target.value),t[5]=a,t[6]=g);let y;t[7]!==s||t[8]!==m||t[9]!==h||t[10]!==g||t[11]!==i?(y=(0,Y.jsx)(H,{id:`api-key`,type:m,placeholder:h,className:`pl-10 pr-10`,value:i,onChange:g,disabled:s}),t[7]=s,t[8]=m,t[9]=h,t[10]=g,t[11]=i,t[12]=y):y=t[12];let b;t[13]===c?b=t[14]:(b=()=>d(!c),t[13]=c,t[14]=b);let C=(s??!1)||!i,w;t[15]===c?w=t[16]:(w=c?(0,Y.jsx)(x,{className:`h-4 w-4 text-muted-foreground`}):(0,Y.jsx)(_,{className:`h-4 w-4 text-muted-foreground`}),t[15]=c,t[16]=w);let T;t[17]!==b||t[18]!==C||t[19]!==w?(T=(0,Y.jsx)(r,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:b,disabled:C,children:w}),t[17]=b,t[18]=C,t[19]=w,t[20]=T):T=t[20];let E;return t[21]!==T||t[22]!==y?(E=(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[f,(0,Y.jsxs)(`div`,{className:`relative`,children:[p,y,T]})]}),t[21]=T,t[22]=y,t[23]=E):E=t[23],E}var X=`Checkbox`,[Ge,Ke]=y(X),[qe,Je]=Ge(X);function Ye(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=w({prop:n,defaultProp:i??!1,onChange:c,caller:X}),[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:Z(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,Y.jsx)(qe,{scope:t,...b,children:rt(d)?d(b):r})}var Xe=`CheckboxTrigger`,Ze=J.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=Je(Xe,e),h=P(i,u),g=J.useRef(c);return J.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,Y.jsx)(W.button,{type:`button`,role:`checkbox`,"aria-checked":Z(c)?`mixed`:c,"aria-required":l,"data-state":it(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:I(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:I(n,e=>{d(e=>Z(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Ze.displayName=Xe;var Qe=J.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,Y.jsx)(Ye,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ze,{...d,ref:t,__scopeCheckbox:n}),e&&(0,Y.jsx)(nt,{__scopeCheckbox:n})]})})});Qe.displayName=X;var $e=`CheckboxIndicator`,et=J.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Je($e,n);return(0,Y.jsx)(ie,{present:r||Z(a.checked)||a.checked===!0,children:(0,Y.jsx)(W.span,{"data-state":it(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});et.displayName=$e;var tt=`CheckboxBubbleInput`,nt=J.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=Je(tt,e),m=P(n,p),h=fe(a),g=D(r);J.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=Z(a),n.call(e,Z(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=J.useRef(Z(a)?!1:a);return(0,Y.jsx)(W.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});nt.displayName=tt;function rt(e){return typeof e==`function`}function Z(e){return e===`indeterminate`}function it(e){return Z(e)?`indeterminate`:e?`checked`:`unchecked`}var Q=J.forwardRef((e,t)=>{let n=(0,q.c)(10),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=h(`peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(et,{className:h(`flex items-center justify-center text-current`),children:(0,Y.jsx)(A,{className:`h-4 w-4`})}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,Y.jsx)(Qe,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});Q.displayName=Qe.displayName;function at(e){let t=/^[^:]+:\s+(.+)$/.exec(e);return(t?t[1]:e).trim()}function ot(e){return[ye(e.id),e.name,at(e.name)]}function st(e,t){let n=new Set(t.map(e=>e.toLowerCase()));return ot(e).some(e=>n.has(e.toLowerCase()))}function ct(e,t){return e.filter(e=>st(e,t)).map(e=>e.id)}function lt(e){return e==null?0:e<20?1:e<30?2:e<40?3:e<50?4:5}function $(e){return e.pricing?((e.pricing.prompt??0)+(e.pricing.completion??0))/2:null}function ut(e,t,n){let r=t.toLowerCase(),i=n(e);return e.name.toLowerCase().includes(r)||e.id.toLowerCase().includes(r)||i.toLowerCase().includes(r)}function dt(e){return e.pricing?.prompt===0&&e.pricing?.completion===0}function ft(e,t,n){let{sortBy:r,getDisplayName:i,getPriority:a,groupByProvider:o}=n;if(o){let n=(e.provider??``).toLowerCase(),r=(t.provider??``).toLowerCase();if(n!==r)return n.localeCompare(r)}if(a){let n=a(e),r=a(t);if(n!==r)return n-r}if(r===`price-low`){let n=!!e.pricing;return n===!!t.pricing?!e.pricing||!t.pricing?0:($(e)??0)-($(t)??0):n?-1:1}if(r===`price-high`){let n=!!e.pricing;if(n!==!!t.pricing)return n?-1:1;if(!e.pricing||!t.pricing)return 0;let r=$(e)??0;return($(t)??0)-r}if(r===`coding-index`){let n=e.coding_index!==void 0&&e.coding_index!==null;return n===(t.coding_index!==void 0&&t.coding_index!==null)?e.coding_index==null||t.coding_index==null?0:t.coding_index-e.coding_index:n?-1:1}if(r===`intelligence-by-price`){let n=lt(e.coding_index),r=lt(t.coding_index),i=n>0;if(i!==r>0)return i?-1:1;if(r!==n)return r-n;let a=$(e),o=$(t),s=a!==null;return s===(o!==null)?a===null||o===null?0:a-o:s?-1:1}return i(e).localeCompare(i(t))}function pt(e){let{models:t,query:n,sortBy:r,getDisplayName:i,getPriority:a,freeOnly:o,groupByProvider:s}=e;return t.filter(e=>!(!ut(e,n,i)||o&&!dt(e))).sort((e,t)=>ft(e,t,{sortBy:r,getDisplayName:i,getPriority:a,groupByProvider:s}))}function mt(e,t,n){let r=new Map(e),i=n.has(t),a=r.has(t),o=r.get(t),s=!(a?o:i);return s===i?r.delete(t):r.set(t,s),r}var ht=G(e=>(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:e.v0}),{name:`ModelSelector_1`,portals:[`v0`]}),gt=G(e=>(0,Y.jsx)(`div`,{className:`text-center py-8`,children:(0,Y.jsx)(`p`,{className:e.v0,children:`No models available for this provider.`})}),{name:`ModelSelector_2`}),_t=G(e=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:e.v0,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[e.v1,(0,Y.jsx)(`label`,{htmlFor:`select-all-models`,className:e.v2,children:`Select all models`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,Y.jsxs)(`div`,{className:`relative w-44 sm:w-52`,children:[e.v3,e.v4]}),e.v5]})]}),e.v6]}),{name:`ModelSelector_3`,portals:[`v1`,`v3`,`v4`,`v5`,`v6`]}),vt=function({provider:e,onModelsChange:t,isLoading:n,disabled:r,displayMode:a=`grid`,autoSelectRecommended:c=!1}){let[l,d]=(0,J.useState)([]),[f,p]=(0,J.useState)(new Set),[_,y]=(0,J.useState)(new Set),[b,x]=(0,J.useState)(new Map),[C,w]=(0,J.useState)(!1),[T,E]=(0,J.useState)(``),[D,k]=(0,J.useState)(`alphabetical`);(0,J.useEffect)(()=>{A()},[e]);let A=async()=>{w(!0),E(``),k(`alphabetical`);try{let t=await s(e);d(t.models);let n=new Set(t.enabledModelIds);p(n);let r=new Map,a=new Set;if(c)try{let{models:e}=await i();a=new Set(ct(t.models,e)),r=new Map([...a].filter(e=>!n.has(e)).map(e=>[e,!0]))}catch(e){console.error(`Failed to load recommended models:`,e)}y(a),x(r),j(n,r,t.models)}catch(t){console.error(`Failed to load models for ${e}:`,t),d([]),p(new Set),y(new Set)}finally{w(!1)}},j=(e,n,r=l)=>{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)},ee=e=>{x(t=>{let n=mt(t,e,f);return j(f,n),n})},te=e=>{x(t=>{let n=new Map(t);return l.forEach(t=>{let r=f.has(t.id);e?r?n.delete(t.id):n.set(t.id,!0):r?n.set(t.id,!1):n.delete(t.id)}),j(f,n),n})},N=e=>ye(e.id);function P(e,t=b){let n=t.has(e),r=t.get(e);return n?!!r:f.has(e)}let ne=pt({models:l,query:T,sortBy:D,getDisplayName:N,getPriority:e=>+!P(e.id)}),F=D===`alphabetical`?`alphabetical`:`price`;function I(e){if(e===`alphabetical`){k(`alphabetical`);return}e===`price`&&k(`price-low`)}function L(){D!==`alphabetical`&&k(e=>e===`price-low`?`price-high`:`price-low`)}return C||n?(0,Y.jsx)(ht,{v0:(0,Y.jsx)(U,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):l.length===0?(0,Y.jsx)(gt,{v0:O.bodyMuted}):a===`compact`?(0,Y.jsx)(_t,{v0:h(`flex items-center justify-between gap-3`,r&&`opacity-25`),v1:(0,Y.jsx)(Q,{id:`select-all-models`,disabled:r,checked:l.every(e=>P(e.id)),onCheckedChange:e=>te(e===!0)}),v2:h(O.body,`cursor-pointer`),v3:(0,Y.jsx)(ue,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),v4:(0,Y.jsx)(H,{placeholder:`Search models...`,value:T,onChange:e=>E(e.target.value),disabled:r,className:`pl-8 h-9`}),v5:(0,Y.jsxs)(z,{type:`single`,value:F,onValueChange:I,"aria-label":`Sort models`,variant:`outline`,className:`inline-flex rounded-full border bg-muted/40 p-1`,children:[(0,Y.jsx)(ae,{value:`alphabetical`,"aria-label":`Sort A–Z`,disabled:r,className:yt,children:(0,Y.jsx)(M,{className:`h-4 w-4`})}),(0,Y.jsx)(ae,{value:`price`,"aria-label":`Sort by price`,disabled:r,className:yt,onClick:L,children:(0,Y.jsx)(m,{className:`h-4 w-4`})})]}),v6:(0,Y.jsx)(o,{children:(0,Y.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:ne.length===0?(0,Y.jsx)(`div`,{className:`text-center py-4`,children:(0,Y.jsx)(`p`,{className:O.bodyMuted,children:T?`No models match your search.`:`No models available.`})}):ne.map(e=>{let t=P(e.id),n=e.pricing,i=t&&_.has(e.id);return(0,Y.jsxs)(v,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsxs)(`div`,{className:h(`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0`,r&&`opacity-25`),children:[(0,Y.jsx)(Q,{id:e.id,disabled:r,checked:t??!1,onCheckedChange:()=>ee(e.id),className:`mt-0`}),(0,Y.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,Y.jsxs)(`label`,{htmlFor:e.id,className:h(O.body,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate flex-1 w-0`),children:[N(e),i&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:` (Recommended)`})]}),n&&(0,Y.jsx)(`span`,{className:h(O.compact,`text-muted-foreground whitespace-nowrap flex-shrink-0`),children:(n.prompt??0)<=0&&(n.completion??0)<=0?`Free`:`${g(n.prompt??0)} in | ${g(n.completion??0)} out`})]})]})}),e.description&&(0,Y.jsx)(S,{side:`top`,className:`max-w-xs`,children:(0,Y.jsx)(`p`,{className:O.body,children:e.description})})]},e.id)})})})}):null},yt=`rounded-full border-0 px-3 data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:shadow-sm dark:data-[state=on]:bg-background dark:data-[state=on]:text-foreground`,bt=t({OnboardingDialog:()=>xt,default:()=>xt});function xt({open:e,onOpenChange:t,onComplete:i}){let[o,c]=(0,J.useState)(`git-check`),[u,p]=(0,J.useState)(null),[m,g]=(0,J.useState)(!1),[_,v]=(0,J.useState)([]),[y,b]=(0,J.useState)(null),[x,S]=(0,J.useState)(``),[w,D]=(0,J.useState)({}),[M,P]=(0,J.useState)(!1),[F,I]=(0,J.useState)(``),[re,R]=(0,J.useState)(new Set),[ie,z]=(0,J.useState)(!1),[B,V]=(0,J.useState)(!1);(0,J.useEffect)(()=>{e&&o===`git-check`&&H()},[e,o]),(0,J.useEffect)(()=>{e&&o===`provider-selection`&&_.length===0&&ae()},[e,o,_.length]),(0,J.useEffect)(()=>{e&&o===`model-selection`&&y&&se()},[e,o,y]);let H=async()=>{g(!0);try{let e=await ne();p(e.gitInstalled),e.gitInstalled&&c(`provider-selection`)}catch(e){console.error(`Failed to check git installation:`,e),p(!1)}finally{g(!1)}},ae=async()=>{try{let e=await L();if(v(e),e.length>0&&!y){let t=Fe(e);t&&(b(t),S(t.apiKey??``),D(t.envValues??{}))}}catch(e){console.error(`Failed to load providers:`,e)}},se=async()=>{if(y){z(!0);try{await s(y.name),R(new Set)}catch(e){console.error(`Failed to load models:`,e)}finally{z(!1)}}},W=async()=>{if(!y||!x.trim()){I(`Please enter an API key`);return}let e=Ae(y),t=e.find(e=>!w[e]?.trim());if(t){I(`Please enter ${je(t)}`);return}P(!0),I(``);try{e.length>0&&await le(Object.fromEntries(e.map(e=>[e,w[e].trim()]))),await ee(y.slug,x),c(`model-selection`)}catch(e){I(e instanceof Error?e.message:`Failed to validate API key`)}finally{P(!1)}},ue=async()=>{if(y){V(!0);try{for(let e of re)await T(y.slug,e);await ce(),i?.(),t(!1)}catch(e){console.error(`Failed to complete onboarding:`,e)}finally{V(!1)}}},de=async()=>{V(!0);try{await ce(),i?.(),t(!1)}catch(e){console.error(`Failed to skip onboarding:`,e)}finally{V(!1)}},G=e=>{b(e),S(e.apiKey??``),D(e.envValues??{}),I(``)},fe=(e,t)=>{D(n=>({...n,[e]:t}))};return(0,Y.jsx)(d,{open:e,onOpenChange:t,children:(0,Y.jsxs)(k,{className:`max-w-2xl h-[min(42rem,90dvh)] flex flex-col p-0 overflow-hidden`,children:[(0,Y.jsxs)(`div`,{className:`px-6 pt-6 pb-2`,children:[(0,Y.jsxs)(`div`,{className:`w-1/2 mx-auto flex items-center gap-2 mb-6`,children:[(0,Y.jsx)(`div`,{className:h(`flex items-center justify-center h-8 w-8 rounded-full`,O.label,o===`git-check`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`1`}),(0,Y.jsx)(`div`,{className:h(`h-0.5 flex-1`,o===`provider-selection`||o===`model-selection`?`bg-primary`:`bg-muted`)}),(0,Y.jsx)(`div`,{className:h(`flex items-center justify-center h-8 w-8 rounded-full`,O.label,o===`provider-selection`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`2`}),(0,Y.jsx)(`div`,{className:h(`h-0.5 flex-1`,o===`model-selection`?`bg-primary`:`bg-muted`)}),(0,Y.jsx)(`div`,{className:h(`flex items-center justify-center h-8 w-8 rounded-full`,O.label,o===`model-selection`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`3`})]}),(0,Y.jsxs)(n,{children:[o===`git-check`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(N,{children:`Let's get started`}),(0,Y.jsx)(j,{children:`First, we need to check that Git is installed on your system.`})]}),o===`provider-selection`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(N,{children:`Select an AI Provider`}),(0,Y.jsx)(j,{children:`Choose your preferred AI provider and enter your API key.`})]}),o===`model-selection`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(N,{children:`Select Models`}),(0,Y.jsx)(j,{children:`Choose which models you want to use with this provider.`})]})]})]}),(0,Y.jsx)(te,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,Y.jsxs)(`div`,{className:`px-6 py-4`,children:[o===`git-check`&&(0,Y.jsx)(`div`,{className:`space-y-4`,children:m?(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Y.jsx)(U,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):u?(0,Y.jsxs)(K,{variant:`success`,className:`mb-0 flex items-start gap-3`,children:[(0,Y.jsx)(A,{className:`h-5 w-5 text-green-600 flex-shrink-0 mt-0.5`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:h(O.label,`text-green-900`),children:`Git is installed`}),(0,Y.jsx)(`p`,{className:O.bodyMuted,children:`You're all set to use Git features in Tarsk.`})]})]}):(0,Y.jsxs)(K,{variant:`hint`,className:`mb-0 flex items-start gap-3`,children:[(0,Y.jsx)(f,{className:`h-5 w-5 text-yellow-600 flex-shrink-0 mt-0.5`}),(0,Y.jsxs)(`div`,{className:`flex-1`,children:[(0,Y.jsx)(`p`,{className:O.label,children:`Git is not installed`}),(0,Y.jsx)(`p`,{className:O.bodyMuted,children:`Git is required for some features in Tarsk. You can continue without it, but we recommend installing it.`}),(0,Y.jsxs)(`a`,{href:`https://git-scm.com/downloads`,target:`_blank`,rel:`noreferrer`,className:h(O.caption,`text-brand hover:underline mt-2 inline-flex items-center gap-1`),children:[`Download Git `,(0,Y.jsx)(a,{className:`h-3 w-3`})]})]})]})}),o===`provider-selection`&&(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsx)(Ue,{selectedProvider:y,onProviderChange:G,showApiKeyInput:!0,apiKey:x,onApiKeyChange:S,variant:`dropdown`,isLoading:M}),y&&Ae(y).map(e=>(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(l,{htmlFor:e,children:je(e)}),(0,Y.jsx)(`input`,{id:e,value:w[e]??``,onChange:t=>fe(e,t.target.value),className:`h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base`,placeholder:E(y.slug)&&e===`LOCAL_API_URL`?y.api:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),y.slug===`azure`&&e===Oe(y)||E(y.slug)&&e===`LOCAL_API_URL`?(0,Y.jsx)(`p`,{className:h(O.bodyMuted,`break-all`),children:Me(y,w)||y.api}):null]},e)),F&&(0,Y.jsx)(K,{variant:`error`,className:`mb-0`,children:F})]}),o===`model-selection`&&y&&(0,Y.jsx)(`div`,{className:`space-y-4`,children:(0,Y.jsx)(vt,{provider:y.slug,isLoading:ie,displayMode:`compact`,disabled:!1,autoSelectRecommended:!0,onModelsChange:R})})]})}),(0,Y.jsx)(`div`,{className:`px-6 py-4 border-t border-border bg-muted/10`,children:(0,Y.jsxs)(C,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`div`,{children:o===`provider-selection`&&(0,Y.jsx)(r,{variant:`ghost`,onClick:()=>de(),disabled:B,children:`Skip for now`})}),(0,Y.jsxs)(`div`,{className:`flex gap-3`,children:[o!==`git-check`&&(0,Y.jsx)(r,{variant:`outline`,onClick:()=>{o===`provider-selection`?c(`git-check`):o===`model-selection`&&c(`provider-selection`)},disabled:B,children:`Back`}),o===`git-check`&&(0,Y.jsxs)(r,{onClick:()=>{c(`provider-selection`)},disabled:m,className:`gap-2`,children:[`Continue `,(0,Y.jsx)(oe,{className:`h-4 w-4`})]}),o===`provider-selection`&&(0,Y.jsx)(r,{onClick:W,disabled:M||!x.trim()||!y,className:`gap-2`,children:M?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(U,{className:`h-4 w-4 animate-spin`}),`Validating...`]}):(0,Y.jsxs)(Y.Fragment,{children:[`Next `,(0,Y.jsx)(oe,{className:`h-4 w-4`})]})}),o===`model-selection`&&(0,Y.jsx)(r,{onClick:ue,disabled:B,className:`gap-2`,children:B?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(U,{className:`h-4 w-4 animate-spin`}),`Finishing...`]}):(0,Y.jsxs)(Y.Fragment,{children:[`Finish `,(0,Y.jsx)(A,{className:`h-4 w-4`})]})})]})]})})]})})}export{Q as a,Ae as c,ve as d,mt as i,Ee as l,pt as n,Le as o,lt as r,je as s,bt as t,ye as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$ as t,Ai as n,Bi as r,Bn as i,Ct as a,Gr as o,In as s,Ln as c,Mi as l,Nn as u,No as d,Pn as f,Po as p,Xi as m,Xo as h,ca as g,da as _,fa as ee,la as v,ls as y,oa as b,os as x,qa as S,qr as C,sa as w,ss as T,ua as E,uo as D,va as te,xt as ne,ya as re,zn as ie}from"./dialogs-config-BEazgV7k.js";import{Ft as ae,f as O,g as k,h as A,m as j,p as M}from"./react-vendor-iDwBzcYF.js";import{D as oe,E as se,S as ce,T as le,b as N,d as P,f as F,g as I,h as L,m as R,p as z}from"./history-view-BMVTxWTg.js";import{a as ue,u as B}from"./onboarding-Bi5MieW-.js";import{I as de,P as V}from"./index-_SOdLUMq.js";import{n as fe,t as pe}from"./radio-group-n9qyUxmu.js";var H=T(),U=e(y(),1),W=x(),me=A,he=U.forwardRef((e,t)=>{let n=(0,H.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=l(`border-b`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,W.jsx)(j,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});he.displayName=`AccordionItem`;var ge=U.forwardRef((e,t)=>{let n=(0,H.c)(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=l(`flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,W.jsx)(h,{className:`h-4 w-4 shrink-0 transition-transform duration-200`}),n[6]=s):s=n[6];let c;return n[7]!==r||n[8]!==a||n[9]!==t||n[10]!==o?(c=(0,W.jsx)(M,{className:`flex`,children:(0,W.jsxs)(k,{ref:t,className:o,...a,children:[r,s]})}),n[7]=r,n[8]=a,n[9]=t,n[10]=o,n[11]=c):c=n[11],c});ge.displayName=k.displayName;var _e=U.forwardRef((e,t)=>{let n=(0,H.c)(14),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=l(m.body,`overflow-hidden transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`),n[4]=o):o=n[4];let s;n[5]===i?s=n[6]:(s=l(`pb-4 pt-0`,i),n[5]=i,n[6]=s);let c;n[7]!==r||n[8]!==s?(c=(0,W.jsx)(`div`,{className:s,children:r}),n[7]=r,n[8]=s,n[9]=c):c=n[9];let u;return n[10]!==a||n[11]!==t||n[12]!==c?(u=(0,W.jsx)(O,{ref:t,className:o,...a,children:c}),n[10]=a,n[11]=t,n[12]=c,n[13]=u):u=n[13],u});_e.displayName=O.displayName;var G=`__unspecified__`;function ve(e){return[...e].sort((e,t)=>{let n=(e.provider??``).localeCompare(t.provider??``);return n===0?B(e.id).localeCompare(B(t.id)):n})}function ye({value:e,onChange:n,disabled:r=!1}){let[i,a]=(0,U.useState)([]),[s,c]=(0,U.useState)(!0);(0,U.useEffect)(()=>{let e=!1;async function n(){c(!0);try{let n=await t();if(e)return;a(ve(Object.values(n).flat()))}catch(t){console.error(`Failed to load enabled models:`,t),e||a([])}finally{e||c(!1)}}return n(),()=>{e=!0}},[]);let u=(0,U.useMemo)(()=>{let e=new Map;for(let t of i){let n=t.provider??`other`,r=e.get(n);r?r.push(t):e.set(n,[t])}return e},[i]);function d(t,r){let i={...e};if(r===G){delete i[t],n(i);return}let a=E(r);a&&(i[t]=a,n(i))}return(0,W.jsx)(`div`,{className:`space-y-4`,children:v.map(t=>{let n=e[t],a=n?_(n):G;return(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(o,{htmlFor:`model-alias-${t}`,className:m.label,children:g[t]}),(0,W.jsx)(`p`,{className:l(m.caption,`mt-1`),children:w[t]})]}),(0,W.jsxs)(P,{value:a,onValueChange:e=>d(t,e),disabled:r||s,children:[(0,W.jsx)(L,{id:`model-alias-${t}`,children:(0,W.jsx)(I,{placeholder:s?`Loading models...`:`Unspecified`})}),(0,W.jsxs)(F,{children:[(0,W.jsx)(z,{value:G,children:`Unspecified`}),i.length>0&&(0,W.jsx)(R,{}),[...u.entries()].map(([e,t])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:l(m.dropdownGroupHeading,`px-2 py-1.5 uppercase`),children:e}),t.map(t=>{let n=_({provider:t.provider??e,model:t.id});return(0,W.jsx)(z,{value:n,children:B(t.id)},n)})]},e))]})]})]},t)})})}function be(e){let t=(0,H.c)(20),{entry:i,index:a,loading:o,onValueChange:s}=e,c=r(i.name),[u,f]=(0,U.useState)(!1),m=i.value.length>0||i.hasExistingValue,h=i.hasExistingValue&&!i.value?`••••••••`:`value`;(0,U.useEffect)(()=>{c||f(!1)},[c]);let g=C,_=c&&!u?`password`:`text`,ee=i.value,v;t[0]!==a||t[1]!==s?(v=e=>s(a,e.target.value),t[0]=a,t[1]=s,t[2]=v):v=t[2];let y=l(`font-mono`,c&&`pr-10`),b;t[3]!==g||t[4]!==i.value||t[5]!==o||t[6]!==h||t[7]!==_||t[8]!==v||t[9]!==y?(b=(0,W.jsx)(g,{type:_,placeholder:h,value:ee,onChange:v,className:y,disabled:o}),t[3]=g,t[4]=i.value,t[5]=o,t[6]=h,t[7]=_,t[8]=v,t[9]=y,t[10]=b):b=t[10];let x;t[11]!==m||t[12]!==c||t[13]!==o||t[14]!==f||t[15]!==u?(x=c&&(0,W.jsx)(n,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:()=>f(K),disabled:o||!m,children:u?(0,W.jsx)(p,{className:`h-4 w-4 text-muted-foreground`}):(0,W.jsx)(d,{className:`h-4 w-4 text-muted-foreground`})}),t[11]=m,t[12]=c,t[13]=o,t[14]=f,t[15]=u,t[16]=x):x=t[16];let S;return t[17]!==b||t[18]!==x?(S=(0,W.jsxs)(`div`,{className:`relative flex-1`,children:[b,x]}),t[17]=b,t[18]=x,t[19]=S):S=t[19],S}function K(e){return!e}function q({projectId:e,onProjectUpdated:r}){let d=ae(),[p,h]=(0,U.useState)(``),[g,_]=(0,U.useState)(``),[v,y]=(0,U.useState)(``),[x,w]=(0,U.useState)(b.PullRequest),[T,E]=(0,U.useState)(``),[O,k]=(0,U.useState)(!1),[A,j]=(0,U.useState)(!1),[M,P]=(0,U.useState)(!1),[F,I]=(0,U.useState)(``),[L,R]=(0,U.useState)(``),[z,B]=(0,U.useState)(``),[H,G]=(0,U.useState)(``),[ve,K]=(0,U.useState)(b.PullRequest),[q,xe]=(0,U.useState)(!0),[J,Se]=(0,U.useState)([]),[Ce,we]=(0,U.useState)(!0),[Te,Ee]=(0,U.useState)([]),[Y,X]=(0,U.useState)([]),[De,Oe]=(0,U.useState)([]),[Z,ke]=(0,U.useState)({}),[Ae,Q]=(0,U.useState)({}),$=(0,U.useCallback)(async()=>{if(e){P(!0);try{let t=await ne(e),n=await a(e),r=t.name??``,i=t.setupScript??``,o=t.validationScript??``,s=t.runCommand??``,c=t.commitMethod??b.PullRequest,l=t.allowAllCommands!==!1,u=t.allowedCommandPatterns??[],d=n.vars.map(e=>({name:e.name,value:e.value??``,hasExistingValue:e.hasValue&&e.value===void 0})),f=t.modelAliases??{};h(r),_(i),E(o),y(s),w(c),xe(l),Se(u),X(d),ke(f),I(r),R(i),B(o),G(s),K(c),we(l),Ee(u),Oe(d),Q(f)}catch(e){V({title:`Error`,description:e instanceof Error?e.message:`Failed to load project settings`,variant:`destructive`})}finally{P(!1)}}},[e]);(0,U.useEffect)(()=>{$()},[$]);function je(){X(e=>[...e,{name:``,value:``,hasExistingValue:!1}])}function Me(e,t){X(n=>n.map((n,r)=>r===e?{...n,name:t.toUpperCase()}:n))}function Ne(e,t){X(n=>n.map((n,r)=>r===e?{...n,value:t}:n))}function Pe(e){X(t=>t.filter((t,n)=>n!==e))}function Fe(){if(Y.length!==De.length)return!0;for(let e=0;e<Y.length;e+=1){let t=Y[e],n=De[e];if(!n||t.name!==n.name||t.value!==n.value||t.hasExistingValue!==n.hasExistingValue)return!0}return!1}function Ie(){return JSON.stringify(Z)!==JSON.stringify(Ae)}return e?(0,W.jsx)(oe,{children:(0,W.jsxs)(se,{children:[(0,W.jsx)(ce,{title:`Project Settings`,description:`Configure settings for your project.`,action:(0,W.jsx)(n,{onClick:async()=>{if(e){k(!0);try{if(p!==F&&await c(e,p),g!==L&&await ie(e,g.trim()||null,!1),T!==z&&await s(e,{validationScript:T.trim()||null}),v!==H&&await i(e,v.trim()||null),x!==ve&&await s(e,{commitMethod:x}),(q!==Ce||JSON.stringify(J)!==JSON.stringify(Te))&&await s(e,{allowAllCommands:q,allowedCommandPatterns:J}),Ie()){let n=Object.keys(Z).length>0?Z:void 0;if(n){let e=await t();ee(n,Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.map(e=>e.id)])))}await s(e,{modelAliases:n??null})}if(Fe()){let t=Y.map(e=>({name:e.name.trim(),value:e.value,hasExistingValue:e.hasExistingValue})).filter(e=>e.name.length>0),n=t.find((e,n)=>t.findIndex(t=>t.name===e.name)!==n);if(n)throw Error(`Duplicate environment variable name: ${n.name}`);let r=t.find(e=>!e.hasExistingValue&&!e.value.trim());if(r)throw Error(`Value is required for environment variable: ${r.name}`);await f(e,t.map(e=>({name:e.name,value:e.value.trim()||void 0})))}I(p),R(g),B(T),G(v),K(x),we(q),Ee(J),Q(Z),Oe(Y.map(e=>({...e,value:``}))),r&&await r(),await $(),V({title:`Success`,description:`Project settings saved`}),d(`/`)}catch(e){V({title:`Error`,description:e instanceof Error?e.message:`Failed to save settings`,variant:`destructive`})}finally{k(!1)}}},disabled:O||M,children:O?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(D,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):M?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(D,{className:`mr-2 h-4 w-4 animate-spin`}),`Loading...`]}):`Save`})}),(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsx)(N,{title:`Project Name`,children:(0,W.jsx)(C,{id:`projectName`,value:p,onChange:e=>h(e.target.value),placeholder:`Enter project name`,disabled:M})}),(0,W.jsx)(N,{title:`Setup Script`,description:`This script runs automatically after cloning the repo for new threads.`,children:(0,W.jsx)(de,{id:`setupScript`,value:g,onChange:e=>_(e.target.value),placeholder:`e.g. npm install`,className:`font-mono min-h-[80px] resize-none`,disabled:M})}),(0,W.jsx)(N,{title:`Validation Script`,description:`This script runs after each chat response. If it fails, Tarsk will try to fix issues automatically up to the retry limit.`,children:(0,W.jsx)(de,{id:`validationScript`,value:T,onChange:e=>E(e.target.value),placeholder:`e.g. npm run lint && npm test`,className:`font-mono min-h-[80px] resize-none`,disabled:M})}),(0,W.jsx)(N,{title:`Run Command`,description:`The command to start the dev server. Leave empty to disable run functionality.`,action:(0,W.jsx)(n,{variant:`ghost`,size:`sm`,onClick:async()=>{if(e){j(!0);try{let t=await u(e);t.runCommand?(y(t.runCommand),V({title:`Success`,description:`Suggested: ${t.runCommand}`})):V({title:`No command found`,description:`Could not detect a dev script in package.json`})}catch(e){V({title:`Error`,description:e instanceof Error?e.message:`Failed to suggest command`,variant:`destructive`})}finally{j(!1)}}},disabled:A||M,children:A?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(D,{className:`h-3 w-3 animate-spin`}),`Suggesting...`]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(te,{className:`h-3 w-3`}),`Suggest`]})}),children:(0,W.jsx)(C,{id:`runCommand`,value:v,onChange:e=>y(e.target.value),placeholder:`e.g. npm run dev`,className:`font-mono`,disabled:M})}),(0,W.jsx)(N,{title:`Commit Method`,description:x===b.PullRequest?`Feature branches are created and pull requests can be created.`:`Commits are made directly to the main branch without feature branches.`,children:(0,W.jsxs)(pe,{value:x,onValueChange:e=>w(e),className:`flex gap-4`,disabled:M,children:[(0,W.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,W.jsx)(fe,{value:b.PullRequest,id:`commit-pr`}),(0,W.jsx)(o,{htmlFor:`commit-pr`,className:l(m.labelNormal,`cursor-pointer`),children:`Pull Requests`})]}),(0,W.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,W.jsx)(fe,{value:b.Direct,id:`commit-direct`}),(0,W.jsx)(o,{htmlFor:`commit-direct`,className:l(m.labelNormal,`cursor-pointer`),children:`Direct Commits`})]})]})}),(0,W.jsxs)(N,{title:`Confirm Commands`,description:`When checked, the agent asks for approval before running bash commands, skill scripts, and browser shell calls.`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(ue,{id:`confirmCommands`,checked:!q,onCheckedChange:e=>xe(e!==!0),disabled:M}),(0,W.jsx)(o,{htmlFor:`confirmCommands`,className:m.labelNormal,children:`Require approval for bash commands, skill scripts, and browser shell calls`})]}),!q&&J.length>0&&(0,W.jsxs)(`div`,{className:`space-y-2 mt-3`,children:[(0,W.jsx)(o,{children:`Allowed command patterns`}),(0,W.jsx)(`ul`,{className:`space-y-1`,children:J.map(e=>(0,W.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-border px-3 py-2`,children:[(0,W.jsx)(`code`,{className:l(m.mono,m.bodyMuted),children:e}),(0,W.jsx)(n,{type:`button`,variant:`ghost`,size:`sm`,disabled:M||O,onClick:()=>Se(t=>t.filter(t=>t!==e)),children:`Remove`})]},e))})]})]}),(0,W.jsx)(N,{title:`Environment Variables`,description:`Stored encrypted in the Tarsk database and injected when the agent runs bash commands or MCP tools.`,action:(0,W.jsxs)(n,{variant:`ghost`,size:`sm`,onClick:je,disabled:M,children:[(0,W.jsx)(S,{className:`h-3 w-3 mr-1`}),`Add variable`]}),children:Y.length===0?(0,W.jsx)(`p`,{className:m.caption,children:`No environment variables configured`}):(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:Y.map((e,t)=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(C,{placeholder:`API_KEY`,value:e.name,onChange:e=>Me(t,e.target.value),className:`font-mono w-[35%]`,disabled:M}),(0,W.jsx)(be,{entry:e,index:t,loading:M,onValueChange:Ne}),(0,W.jsx)(n,{variant:`ghost`,size:`icon`,onClick:()=>Pe(t),className:`h-9 w-9 flex-shrink-0`,disabled:M||O,children:(0,W.jsx)(re,{className:`h-3.5 w-3.5`})})]},t))})}),(0,W.jsx)(me,{type:`single`,collapsible:!0,children:(0,W.jsxs)(he,{value:`advanced`,className:`border-b-0`,children:[(0,W.jsx)(ge,{className:l(m.sectionTitle,`text-2xl hover:no-underline py-0`),children:`Advanced`}),(0,W.jsx)(_e,{children:(0,W.jsx)(N,{title:`Model Aliases`,description:`Map short names (fast, local, cheap, smart) to enabled models. Subagents can reference these aliases in AGENT.md.`,className:`pt-2`,children:(0,W.jsx)(ye,{value:Z,onChange:ke,disabled:M||O})})})]})})]})]})}):(0,W.jsx)(le,{title:`No project selected`,children:`Please select a project from the sidebar to view its settings.`})}export{q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$ as t,$o as n,Aa as r,Ai as i,B as a,Dt as o,Fo as s,Fr as c,G as l,Ga as u,H as d,Ii as f,Ir as p,Lo as m,Mi as h,Ni as g,No as _,Nr as v,Ot as y,Po as b,Pr as x,U as S,V as C,Va as w,W as ee,Wi as te,Xi as T,Yo as ne,as as re,bn as ie,kt as ae,ln as oe,ls as se,os as E,pa as ce,po as le,qr as D,ss as ue,uo as de,vn as fe,vo as O,yn as pe,za as me,zo as k}from"./dialogs-config-BEazgV7k.js";import{Ft as he,It as ge}from"./react-vendor-iDwBzcYF.js";import{C as A,D as _e,E as ve,S as ye,T as be,a as xe,b as Se,d as Ce,f as we,g as Te,h as Ee,i as De,n as j,o as M,p as Oe,r as N,x as P}from"./history-view-BMVTxWTg.js";import{a as F,c as ke,i as Ae,n as je,o as Me,s as Ne,u as Pe}from"./onboarding-Bi5MieW-.js";import{t as I}from"./skeleton-6mGMglV0.js";import{i as Fe,n as Ie,r as Le,t as Re}from"./tabs-iUSYYupj.js";import{t as ze}from"./use-deferred-search-DGJskNBr.js";import{t as Be}from"./model-star-rating-BzpXBjSo.js";var L=ue(),R=e(se(),1),z=E(),Ve=f(h(T.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 B(e){let t=(0,L.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=h(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,z.jsx)(`div`,{className:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function He(e,t,n){return n?e.find(e=>e.slug===n)??null:t?e.find(e=>e.name===t)??null:null}function V({selectedProviderName:e=null,selectedProviderSlug:t=null,providerData:n,onBack:s,className:f}){let[y,se]=(0,R.useState)(null),[E,ue]=(0,R.useState)(``),[O,k]=(0,R.useState)(!1),[he,ge]=(0,R.useState)(null),[xe,De]=(0,R.useState)(``),[j,M]=(0,R.useState)([]),[N,I]=(0,R.useState)(new Set),[L,Ve]=(0,R.useState)(new Set),[B,V]=(0,R.useState)(new Map),{query:H,setQuery:U,deferredQuery:W}=ze(),[G,K]=(0,R.useState)(`alphabetical`),[q,Ue]=(0,R.useState)(`all`),[J,We]=(0,R.useState)(!1),[Ge,Y]=(0,R.useState)(``),[Ke,X]=(0,R.useState)(``),[qe,Je]=(0,R.useState)(``),[Ye,Xe]=(0,R.useState)(`coding`),[Z,Ze]=(0,R.useState)([]),[Qe,$e]=(0,R.useState)(new Set),[et,tt]=(0,R.useState)(new Set),[nt,rt]=(0,R.useState)(new Map),[it,at]=(0,R.useState)({}),Q=e=>Pe(e.id);(0,R.useEffect)(()=>{(async()=>{if(De(``),n&&(t&&n.slug===t||e&&n.name===e)){se(n),Je(n.apiKey??``),ue(n.apiKey??``),at(n.envValues??{}),lt(n.slug),ot(n.slug);return}try{let n=He(await ae(),e,t);se(n),Je(n?.apiKey??``),ue(n?.apiKey??``),at(n?.envValues??{}),n&&(lt(n.slug),ot(n.slug))}catch(e){De(e instanceof Error?e.message:`Failed to load providers`)}})()},[e,t,n]);let ot=async e=>{ge(null);try{let t=await o(e);t.status===`success`&&ge(t.balance)}catch(t){console.error(`Failed to load balance for ${e}:`,t)}};function st(){M([]),Ze([]),I(new Set),Ve(new Set),$e(new Set),tt(new Set),V(new Map),rt(new Map)}function ct(e){return e instanceof Error?e.message:`Failed to load models from local API`}let lt=async e=>{k(!0),X(``),U(``),K(`alphabetical`),Ue(`all`),Xe(`coding`);try{let[t,n]=await Promise.all([l(e),ee(e)]);M(t.models),Ze(n.models);let r=new Set(t.enabledModelIds);I(r),Ve(r);let i=new Set(n.enabledModelIds);$e(i),tt(i),V(new Map),rt(new Map)}catch(t){console.error(`Failed to load models for ${e}:`,t),st(),X(ct(t))}finally{k(!1)}};async function ut(e){k(!0),X(``);try{await oe(e),await lt(e)}catch(t){console.error(`Failed to refresh models for ${e}:`,t),st(),X(ct(t)),k(!1)}}let dt=(e,t)=>{y?.name===e&&(ue(t),pt(t))},ft=(e,t)=>{at(n=>({...n,[e]:t})),y&&(async()=>{try{await pe({[e]:t}),Y(`${Ne(e)} saved successfully`),setTimeout(()=>Y(``),3e3)}catch(e){Y(e instanceof Error?e.message:`Failed to save provider settings`);return}te(y.slug)&&e===`LOCAL_API_URL`&&t.trim()&&await ut(y.slug)})()},pt=async e=>{if(!(!y||e===qe))try{await ie(y.slug,e),Je(e),Y(`API key saved successfully`),setTimeout(()=>Y(``),3e3)}catch(e){Y(e instanceof Error?e.message:`Failed to save API key`)}},mt=(e,t)=>{t===`image`?rt(t=>{let n=new Map(t),r=Qe.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),gt(e,(n.has(e)?n.get(e):r)??!1,`image`),n}):V(t=>{let n=Ae(t,e,N);return gt(e,(n.has(e)?n.get(e):N.has(e))??!1,`coding`),n})};async function ht(e,t){if(!(!y||!te(y.slug)))try{await fe(y.slug,e,{reasoningEffort:t}),M(n=>n.map(n=>n.id===e?{...n,settings:{...n.settings,reasoningEffort:t}}:n))}catch(e){Y(e instanceof Error?e.message:`Failed to save model settings`)}}let gt=async(e,t,n=`coding`)=>{if(y)try{n===`image`?(t?(await d(y.slug,e),$e(t=>new Set([...t,e]))):(await a(y.slug,e),$e(t=>{let n=new Set(t);return n.delete(e),n})),rt(t=>{let n=new Map(t);return n.delete(e),n})):(t?(await S(y.slug,e),I(t=>new Set([...t,e]))):(await C(y.slug,e),I(t=>{let n=new Set(t);return n.delete(e),n})),V(t=>{let n=new Map(t);return n.delete(e),n})),Y(`Model preferences saved successfully`),setTimeout(()=>Y(``),3e3)}catch(e){Y(e instanceof Error?e.message:`Failed to save model changes`)}};async function _t(e,t=`coding`){let n=t===`image`?Z:j,r=t===`image`?Qe:N;(t===`image`?rt:V)(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 gt(i.id,e,t)}let $=E!==void 0&&E.trim().length>0,vt=(0,R.useMemo)(()=>je({models:j,query:W,sortBy:G,getDisplayName:Q,freeOnly:q===`free`,groupByProvider:!0,getPriority:e=>+!L.has(e.id)}),[j,W,q,L,G,Q]),yt=(0,R.useMemo)(()=>je({models:Z,query:W,sortBy:G===`coding-index`||G===`intelligence-by-price`?`alphabetical`:G,getDisplayName:Q,freeOnly:q===`free`,groupByProvider:!0,getPriority:e=>+!et.has(e.id)}),[Z,W,q,et,G,Q]);return xe?(0,z.jsxs)(`div`,{className:h(`flex flex-1 flex-col items-center justify-center gap-4 p-6`,f),children:[(0,z.jsx)(P,{variant:`error`,className:`mb-0`,children:xe}),(0,z.jsx)(i,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`Retry`})]}):y?(0,z.jsx)(_e,{className:f,children:(0,z.jsxs)(ve,{children:[s?(0,z.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-center gap-2`,children:[(0,z.jsxs)(i,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground`,onClick:s,children:[(0,z.jsx)(ne,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Back to providers`})]}),(0,z.jsx)(`button`,{type:`button`,className:h(T.sectionTitle,`min-w-0 flex-1 truncate border-0 bg-transparent p-0 text-left text-foreground cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm`),onClick:s,children:`Providers`})]}):null,(0,z.jsx)(ye,{title:y.name,description:`Configure API keys and models for this provider.`}),(0,z.jsxs)(`div`,{className:`space-y-6`,children:[(0,z.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,z.jsxs)(`div`,{className:`flex items-center justify-between min-h-[20px]`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-2`,children:he===null?(0,z.jsx)(`div`,{className:`h-[20px] w-[1px]`}):(0,z.jsxs)(`span`,{className:h(T.compact,`font-medium text-green-600 bg-green-50 px-2.5 py-1 rounded-full border border-green-100 flex items-center gap-1.5`),children:[(0,z.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-green-500`}),`$`,g(he),` `,`balance`]})}),y.url?(0,z.jsx)(Me,{url:y.url,className:h(T.compact,`p-3`)}):(0,z.jsx)(`div`,{className:`h-[20px] w-[1px]`})]})}),(0,z.jsx)(Se,{title:`API Key`,description:`Your API key is stored locally and never shared.`,children:y.authType===`APIKey`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`relative`,children:[(0,z.jsx)(le,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,z.jsx)(D,{type:J?`text`:`password`,placeholder:y.keyName||`Enter API Key`,className:`pl-10 pr-10`,value:E,onChange:e=>{dt(y.name,e.target.value)}}),(0,z.jsx)(i,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:()=>We(!J),disabled:!E,children:J?(0,z.jsx)(b,{className:`h-4 w-4 text-muted-foreground`}):(0,z.jsx)(_,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,z.jsx)(`div`,{className:`space-y-4 mt-4`,children:ke(y).map(e=>(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(c,{children:(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(`span`,{className:h(T.label,`cursor-help`),children:Ne(e)})}),(0,z.jsx)(x,{children:e})]})}),te(y.slug)&&e===`LOCAL_API_URL`?(0,z.jsxs)(`div`,{className:`relative`,children:[(0,z.jsx)(D,{id:e,value:it[e]??``,onChange:t=>ft(e,t.target.value),placeholder:y.api,className:`pr-10`,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),(0,z.jsx)(c,{children:(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(i,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:()=>{ut(y.slug)},disabled:O,children:O?(0,z.jsx)(de,{className:`h-4 w-4 animate-spin text-muted-foreground`}):(0,z.jsx)(u,{className:`h-4 w-4 text-muted-foreground`})})}),(0,z.jsx)(x,{children:`Refresh models`})]})})]}):(0,z.jsx)(D,{id:e,value:it[e]??``,onChange:t=>ft(e,t.target.value),placeholder:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`})]},e))})]}):(0,z.jsxs)(`div`,{className:`space-y-2 text-center`,children:[(0,z.jsx)(P,{className:`mb-0`,children:`This provider uses OAuth for authentication.`}),(0,z.jsxs)(i,{variant:`outline`,size:`sm`,disabled:!0,children:[`Sign in with `,y.name]})]})}),(0,z.jsx)(A,{title:`Models`}),Ke?(0,z.jsx)(P,{variant:`error`,className:`mb-4`,children:Ke}):null,(0,z.jsxs)(Re,{value:Ye,onValueChange:e=>{Xe(e),U(``),K(`alphabetical`)},children:[(0,z.jsxs)(Le,{className:`mb-4`,children:[(0,z.jsx)(Fe,{value:`coding`,children:`Coding`}),y?.name.toLowerCase()===`openrouter`&&(0,z.jsx)(Fe,{value:`image`,children:`Image`})]}),(0,z.jsx)(Ie,{value:`coding`,children:(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[!O&&j.length>0&&(0,z.jsxs)(`div`,{className:h(`flex flex-col gap-3 md:flex-row md:items-center md:justify-between`,!$&&`opacity-25`),children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,z.jsx)(F,{id:`select-all-models`,disabled:!$,checked:j.every(e=>{let t=B.has(e.id),n=B.get(e.id);return t?n:N.has(e.id)}),onCheckedChange:e=>{_t(e===!0,`coding`)}}),(0,z.jsx)(`label`,{htmlFor:`select-all-models`,className:h(T.body,`whitespace-nowrap`,$?`cursor-pointer`:`cursor-not-allowed`),children:`Select all models`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:flex-1 md:min-w-0 md:justify-end`,children:[(0,z.jsxs)(`div`,{className:`relative w-full md:w-52 flex-shrink-0`,children:[(0,z.jsx)(me,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,z.jsx)(D,{placeholder:`Search models...`,className:`pl-10 h-8`,value:H,onChange:e=>U(e.target.value),disabled:!$})]}),(0,z.jsx)(c,{children:(0,z.jsxs)(`div`,{className:`flex items-center self-end rounded-md border border-border p-0.5 flex-shrink-0 md:self-auto`,children:[(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(i,{type:`button`,variant:G===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`alphabetical`),children:(0,z.jsx)(re,{className:`h-4 w-4`})})}),(0,z.jsx)(x,{children:`Sort A–Z`})]}),(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(i,{type:`button`,variant:G===`price-low`||G===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`price-low`),children:(0,z.jsx)(m,{className:`h-4 w-4`})})}),(0,z.jsx)(x,{children:`Sort by price`})]}),(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(i,{type:`button`,variant:G===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`coding-index`),children:(0,z.jsx)(r,{className:`h-4 w-4`})})}),(0,z.jsx)(x,{children:`Sort by coding intelligence`})]}),(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(i,{type:`button`,variant:G===`intelligence-by-price`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`intelligence-by-price`),children:(0,z.jsx)(w,{className:`h-4 w-4`})})}),(0,z.jsx)(x,{children:`Sort by price/intelligence`})]})]})})]})]}),O?(0,z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,z.jsx)(de,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):j.length===0?(0,z.jsx)(`div`,{className:`text-center py-8`,children:(0,z.jsx)(`p`,{className:T.bodyMuted,children:Ke?`No models loaded.`:`No models available for this provider.`})}):(0,z.jsx)(c,{children:(0,z.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:vt.length===0?(0,z.jsx)(`div`,{className:`text-center py-8`,children:(0,z.jsx)(`p`,{className:T.bodyMuted,children:`No models matching your filters.`})}):vt.map(e=>{let t=N.has(e.id),n=B.has(e.id),r=B.get(e.id),i=n?r:t,a=e.pricing;return(0,z.jsxs)(`div`,{className:`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0 ${$?``:`opacity-25`}`,children:[(0,z.jsx)(F,{id:e.id,disabled:!$,checked:i??!1,onCheckedChange:()=>mt(e.id,`coding`),className:`mt-0`}),(0,z.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,z.jsx)(`label`,{htmlFor:e.id,className:h(T.body,`leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:Q(e)})}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[y&&te(y.slug)&&i&&(e.supportedReasoningEfforts?.length??0)>0&&(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(e.supportedReasoningEfforts?.length??0)===1?(0,z.jsxs)(`label`,{className:h(T.caption,`flex items-center gap-1.5 text-muted-foreground cursor-pointer`),children:[(0,z.jsx)(F,{checked:e.settings?.reasoningEffort!==`off`&&e.settings?.reasoningEffort!==void 0,onCheckedChange:t=>{let n=e.supportedReasoningEfforts?.[0];n&&ht(e.id,t===!0?n:`off`)},"aria-label":`Enable reasoning for ${Q(e)}`}),`Reasoning`]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:h(T.caption,`text-muted-foreground`),children:`Reasoning`}),(0,z.jsxs)(Ce,{value:e.settings?.reasoningEffort??`off`,onValueChange:t=>{ht(e.id,t)},children:[(0,z.jsx)(Ee,{className:`h-7 w-[7.5rem] text-xs`,"aria-label":`Reasoning effort for ${Q(e)}`,children:(0,z.jsx)(Te,{})}),(0,z.jsxs)(we,{children:[(0,z.jsx)(Oe,{value:`off`,children:ce(`off`)}),e.supportedReasoningEfforts?.map(e=>(0,z.jsx)(Oe,{value:e,children:ce(e)},e))]})]})]})})}),(0,z.jsx)(x,{children:`Control reasoning/thinking parameters for this model. Choose Off if the model does not support reasoning.`})]}),(G===`coding-index`||G===`intelligence-by-price`)&&(0,z.jsx)(Be,{codingIndex:e.coding_index,modelName:Q(e)}),a&&(0,z.jsx)(`span`,{className:h(T.caption,`whitespace-nowrap`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${g(a.prompt??0)} in | $${g(a.completion??0)} out`})]})]})]},e.id)})})})]})}),(0,z.jsx)(Ie,{value:`image`,children:(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[!O&&Z.length>0&&(0,z.jsxs)(`div`,{className:h(`flex flex-col gap-3 md:flex-row md:items-center md:justify-between`,!$&&`opacity-25`),children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,z.jsx)(F,{id:`select-all-image-models`,disabled:!$,checked:Z.every(e=>{let t=nt.has(e.id),n=nt.get(e.id);return t?n:Qe.has(e.id)}),onCheckedChange:e=>{_t(e===!0,`image`)}}),(0,z.jsx)(`label`,{htmlFor:`select-all-image-models`,className:h(T.body,`whitespace-nowrap`,$?`cursor-pointer`:`cursor-not-allowed`),children:`Select all models`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:flex-1 md:min-w-0 md:justify-end`,children:[(0,z.jsxs)(`div`,{className:`relative w-full md:w-52 flex-shrink-0`,children:[(0,z.jsx)(me,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,z.jsx)(D,{placeholder:`Search models...`,className:`pl-10 h-8`,value:H,onChange:e=>U(e.target.value),disabled:!$})]}),(0,z.jsx)(c,{children:(0,z.jsxs)(`div`,{className:`flex items-center self-end rounded-md border border-border p-0.5 flex-shrink-0 md:self-auto`,children:[(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(i,{type:`button`,variant:G===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`alphabetical`),children:(0,z.jsx)(re,{className:`h-4 w-4`})})}),(0,z.jsx)(x,{children:`Sort A–Z`})]}),(0,z.jsxs)(v,{children:[(0,z.jsx)(p,{asChild:!0,children:(0,z.jsx)(i,{type:`button`,variant:G===`price-low`||G===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`price-low`),children:(0,z.jsx)(m,{className:`h-4 w-4`})})}),(0,z.jsx)(x,{children:`Sort by price`})]})]})})]})]}),O?(0,z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,z.jsx)(de,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):Z.length===0?(0,z.jsx)(`div`,{className:`text-center py-8`,children:(0,z.jsx)(`p`,{className:T.bodyMuted,children:`No image models available for this provider.`})}):(0,z.jsx)(c,{children:(0,z.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:yt.length===0?(0,z.jsx)(`div`,{className:`text-center py-8`,children:(0,z.jsx)(`p`,{className:T.bodyMuted,children:`No models matching your filters.`})}):yt.map(e=>{let t=Qe.has(e.id),n=nt.has(e.id),r=nt.get(e.id),i=n?r:t,a=e.pricing;return(0,z.jsxs)(`div`,{className:`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0 ${$?``:`opacity-25`}`,children:[(0,z.jsx)(F,{id:`image-${e.id}`,disabled:!$,checked:i??!1,onCheckedChange:()=>mt(e.id,`image`),className:`mt-0`}),(0,z.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,z.jsx)(`label`,{htmlFor:`image-${e.id}`,className:h(T.label,`leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:Q(e)})}),a&&(0,z.jsx)(`span`,{className:h(T.caption,`whitespace-nowrap flex-shrink-0`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${g(a.prompt??0)} in | $${g(a.completion??0)} out`})]})]},e.id)})})})]})})]}),Ge?(0,z.jsx)(P,{variant:Ge.includes(`error`)||Ge.includes(`Failed`)?`error`:`success`,children:Ge}):null]})]})}):(0,z.jsx)(`div`,{className:h(`flex flex-1 items-center justify-center`,f),children:(0,z.jsx)(be,{title:e||t?`Provider not found`:`Select a Provider`,action:s?(0,z.jsxs)(i,{variant:`outline`,size:`sm`,onClick:s,children:[(0,z.jsx)(ne,{className:`h-4 w-4 mr-1`}),`Back to Providers`]}):void 0,children:s?`This provider could not be found.`:`Choose a provider from the list to configure its settings.`})})}function H(e){return`providers:list:${e}`}async function U(){let[e,n]=await Promise.all([ae(),t().catch(()=>({}))]),r={};for(let[e,t]of Object.entries(n))r[e]=t.length;return{providers:e,enabledModelCounts:r}}function W(){let e=(0,L.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsx)(ye,{title:`Providers`,description:`Manage your AI provider connections and API keys.`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,z.jsx)(A,{title:`Connected Providers`}),e[1]=n):n=e[1];let r,i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,z.jsxs)(`div`,{children:[n,(0,z.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,z.jsx)(I,{className:`h-24 rounded-lg`}),(0,z.jsx)(I,{className:`h-24 rounded-lg`})]})]}),i=(0,z.jsx)(A,{title:`Available Providers`}),e[2]=r,e[3]=i):(r=e[2],i=e[3]);let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,z.jsx)(_e,{children:(0,z.jsxs)(ve,{children:[t,(0,z.jsxs)(`div`,{className:`space-y-8`,children:[r,(0,z.jsxs)(`div`,{children:[i,(0,z.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,z.jsx)(I,{className:`h-24 rounded-lg`}),(0,z.jsx)(I,{className:`h-24 rounded-lg`}),(0,z.jsx)(I,{className:`h-24 rounded-lg`}),(0,z.jsx)(I,{className:`h-24 rounded-lg`})]})]})]})]})}),e[4]=a):a=e[4],a}function G(e){let t=(0,L.c)(40),{loadVersion:n,onProviderClick:r}=e,{query:i,setQuery:a,deferredQuery:o}=ze(),s;t[0]===n?s=t[1]:(s=H(n),t[0]=n,t[1]=s);let{providers:c,enabledModelCounts:l}=xe(s,U),u;if(t[2]!==o||t[3]!==l||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]===l?n=t[9]:(n=(e,t)=>{let n=(l[e.slug]??0)>0,r=(l[t.slug]??0)>0;return n&&!r?-1:!n&&r?1:e.name.localeCompare(t.name)},t[8]=l,t[9]=n),u=c.filter(Ue).filter(e).sort(n),t[2]=o,t[3]=l,t[4]=c,t[5]=u}else u=t[5];let d=u,f;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),f=c.filter(q).filter(e).sort(K),t[10]=o,t[11]=c,t[12]=f}else f=t[12];let p=f,m;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,z.jsx)(ye,{title:`Providers`,description:`Manage your AI provider connections and API keys.`}),t[15]=m):m=t[15];let g;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,z.jsx)(me,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),t[16]=g):g=t[16];let _;t[17]===a?_=t[18]:(_=e=>a(e.target.value),t[17]=a,t[18]=_);let v;t[19]!==i||t[20]!==_?(v=(0,z.jsx)(`div`,{className:`mb-6`,children:(0,z.jsxs)(`div`,{className:`relative`,children:[g,(0,z.jsx)(D,{placeholder:`Search providers...`,className:`pl-10`,value:i,onChange:_})]})}),t[19]=i,t[20]=_,t[21]=v):v=t[21];let y;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,z.jsx)(A,{title:`Connected Providers`}),t[22]=y):y=t[22];let b;t[23]!==d||t[24]!==l||t[25]!==r||t[26]!==i?(b=(0,z.jsxs)(`section`,{children:[y,d.length===0?(0,z.jsx)(`p`,{className:h(T.bodyMuted,`py-4`),children:i?`No connected providers match your search.`:`No providers connected yet. Add an API key to get started.`}):(0,z.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:d.map(e=>(0,z.jsx)(X,{provider:e,isConnected:!0,modelCount:l[e.slug]??0,onClick:r},e.name))})]}),t[23]=d,t[24]=l,t[25]=r,t[26]=i,t[27]=b):b=t[27];let x;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,z.jsx)(A,{title:`Available Providers`}),t[28]=x):x=t[28];let S;t[29]!==p||t[30]!==l||t[31]!==r||t[32]!==i?(S=(0,z.jsxs)(`section`,{children:[x,p.length===0?(0,z.jsx)(`p`,{className:h(T.bodyMuted,`py-4`),children:i?`No available providers match your search.`:`All providers are connected.`}):(0,z.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:p.map(e=>(0,z.jsx)(X,{provider:e,modelCount:l[e.slug]??0,onClick:r},e.name))})]}),t[29]=p,t[30]=l,t[31]=r,t[32]=i,t[33]=S):S=t[33];let C;t[34]!==S||t[35]!==b?(C=(0,z.jsxs)(`div`,{className:`space-y-8`,children:[b,S]}),t[34]=S,t[35]=b,t[36]=C):C=t[36];let w;return t[37]!==C||t[38]!==v?(w=(0,z.jsx)(_e,{children:(0,z.jsxs)(ve,{children:[m,v,C]})}),t[37]=C,t[38]=v,t[39]=w):w=t[39],w}function K(e,t){return e.name.localeCompare(t.name)}function q(e){return!e.apiKey}function Ue(e){return e.apiKey}function J(){let e=(0,L.c)(21),t=he(),{providerSlug:n}=ge(),[r,i]=(0,R.useState)(0),a=(0,R.useRef)(n),o,s;e[0]!==r||e[1]!==n?(o=()=>{a.current&&!n&&(M(H(r)),i(Ke)),a.current=n},s=[n,r],e[0]=r,e[1]=n,e[2]=o,e[3]=s):(o=e[2],s=e[3]),(0,R.useEffect)(o,s);let c;e[4]===t?c=e[5]:(c=e=>{t(`/settings/providers/${encodeURIComponent(e.slug)}`)},e[4]=t,e[5]=c);let l=c,u;e[6]!==r||e[7]!==t?(u=()=>{t(`/settings/providers`),M(H(r)),i(Y)},e[6]=r,e[7]=t,e[8]=u):u=e[8];let d=u,f;e[9]===r?f=e[10]:(f=function(){M(H(r)),i(Ge)},e[9]=r,e[10]=f);let p=f;if(n){let t=decodeURIComponent(n),r;return e[11]!==d||e[12]!==t?(r=(0,z.jsx)(V,{selectedProviderSlug:t,onBack:d}),e[11]=d,e[12]=t,e[13]=r):r=e[13],r}let m;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,z.jsx)(W,{}),e[14]=m):m=e[14];let h;e[15]!==l||e[16]!==r?(h=(0,z.jsx)(R.Suspense,{fallback:m,children:(0,z.jsx)(G,{loadVersion:r,onProviderClick:l},r)}),e[15]=l,e[16]=r,e[17]=h):h=e[17];let g;return e[18]!==p||e[19]!==h?(g=(0,z.jsx)(j,{fallbackTitle:`Failed to load providers`,onRetry:p,renderFallback:We,children:h}),e[18]=p,e[19]=h,e[20]=g):g=e[20],g}function We(e,t){return(0,z.jsx)(_e,{children:(0,z.jsxs)(ve,{children:[(0,z.jsx)(ye,{title:`Providers`,description:`Manage your AI provider connections and API keys.`}),(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-16`,children:(0,z.jsxs)(`div`,{className:`text-center max-w-md`,children:[(0,z.jsx)(P,{variant:`error`,className:`mb-4`,children:e.message}),(0,z.jsx)(i,{variant:`outline`,size:`sm`,onClick:t,children:`Retry`})]})})]})})}function Ge(e){return e+1}function Y(e){return e+1}function Ke(e){return e+1}function X(e){let t=(0,L.c)(28),{provider:r,isConnected:i,modelCount:a,onClick:o}=e,c=i===void 0?!1:i,l=a===void 0?0:a,[u,d]=(0,R.useState)(!1),f;t[0]!==o||t[1]!==r?(f=()=>o(r),t[0]=o,t[1]=r,t[2]=f):f=t[2];let p;t[3]!==u||t[4]!==r.name||t[5]!==r.slug?(p=(0,z.jsx)(`div`,{className:`flex-shrink-0 h-10 w-10 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:u?(0,z.jsx)(k,{className:`h-5 w-5 text-muted-foreground`}):(0,z.jsx)(`img`,{src:y(r.slug),alt:`${r.name} logo`,className:`h-6 w-6 dark:invert`,onError:()=>d(!0)})}),t[3]=u,t[4]=r.name,t[5]=r.slug,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=h(T.label,`truncate`),t[7]=m):m=t[7];let g;t[8]===r.name?g=t[9]:(g=(0,z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,z.jsx)(`span`,{className:m,children:r.name})}),t[8]=r.name,t[9]=g);let _;t[10]===c?_=t[11]:(_=!c&&(0,z.jsxs)(`div`,{className:h(T.compact,`flex items-center gap-1 text-muted-foreground mt-0.5`),children:[(0,z.jsx)(s,{className:`h-3 w-3`}),(0,z.jsx)(`span`,{children:`Click to configure`})]}),t[10]=c,t[11]=_);let v;t[12]!==g||t[13]!==_?(v=(0,z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[g,_]}),t[12]=g,t[13]=_,t[14]=v):v=t[14];let b;t[15]!==p||t[16]!==v?(b=(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[p,v]}),t[15]=p,t[16]=v,t[17]=b):b=t[17];let x;t[18]!==c||t[19]!==l||t[20]!==r.isEnv?(x=c&&(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[r.isEnv?(0,z.jsxs)(B,{variant:`secondary`,className:h(T.compact,`gap-1 px-2 py-0.5`),children:[(0,z.jsx)(O,{className:`h-3 w-3`}),`Environment`]}):(0,z.jsxs)(B,{variant:`secondary`,className:h(T.compact,`gap-1 px-2 py-0.5`),children:[(0,z.jsx)(le,{className:`h-3 w-3`}),`API Key`]}),l>0&&(0,z.jsxs)(B,{variant:`default`,className:h(T.compact,`gap-1 px-2 py-0.5`),children:[(0,z.jsx)(n,{className:`h-3 w-3`}),l,` `,l===1?`Model`:`Models`]})]}),t[18]=c,t[19]=l,t[20]=r.isEnv,t[21]=x):x=t[21];let S;t[22]!==x||t[23]!==b?(S=(0,z.jsxs)(De,{className:`p-4 flex flex-col gap-3`,children:[b,x]}),t[22]=x,t[23]=b,t[24]=S):S=t[24];let C;return t[25]!==S||t[26]!==f?(C=(0,z.jsx)(N,{className:`cursor-pointer transition-all hover:border-primary/50 hover:shadow-md`,onClick:f,children:S}),t[25]=S,t[26]=f,t[27]=C):C=t[27],C}export{J as ProvidersListView,J as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$r as e,Ai as t,Fr as n,Gr as r,Ir as ee,Jr as i,Ma as a,Nr as te,Pr as ne,Qr as o,Xi as s,Xr as c,Zr as l,ei as u,os as d,qr as f,ss as p,uo as re}from"./dialogs-config-BEazgV7k.js";import{a as ie}from"./onboarding-Bi5MieW-.js";import{I as ae}from"./index-_SOdLUMq.js";var m=p(),h=d();function g(d){let p=(0,m.c)(54),{open:g,onOpenChange:_,prTitle:v,onPrTitleChange:y,prDescription:b,onPrDescriptionChange:x,isGeneratingPRInfo:S,isLoading:C,onGeneratePRInfo:w,onCreatePR:T,currentBranch:E,autoGeneratePRInfo:D,onAutoGeneratePRInfoChange:O}=d,k;p[0]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,h.jsx)(u,{children:`Create Pull Request`}),p[0]=k):k=p[0];let A;p[1]===E?A=p[2]:(A=(0,h.jsxs)(e,{children:[k,(0,h.jsxs)(l,{children:[`Create a pull request for branch `,E]})]}),p[1]=E,p[2]=A);let j;p[3]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,h.jsx)(r,{htmlFor:`pr-title`,children:`Title`}),p[3]=j):j=p[3];let M=E||`Enter PR title...`,N;p[4]===y?N=p[5]:(N=e=>y(e.target.value),p[4]=y,p[5]=N);let P;p[6]!==v||p[7]!==M||p[8]!==N?(P=(0,h.jsxs)(`div`,{className:`grid gap-2`,children:[j,(0,h.jsx)(f,{id:`pr-title`,placeholder:M,value:v,onChange:N})]}),p[6]=v,p[7]=M,p[8]=N,p[9]=P):P=p[9];let F;p[10]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,h.jsx)(r,{htmlFor:`pr-description`,children:`Description`}),p[10]=F):F=p[10];let I;p[11]===x?I=p[12]:(I=e=>x(e.target.value),p[11]=x,p[12]=I);let L;p[13]!==b||p[14]!==I?(L=(0,h.jsx)(ae,{id:`pr-description`,placeholder:`Enter PR description...`,value:b,onChange:I,className:`pr-10 h-full min-h-[14rem] resize-none`}),p[13]=b,p[14]=I,p[15]=L):L=p[15];let R=S||C,z;p[16]===S?z=p[17]:(z=S?(0,h.jsx)(re,{className:`h-3.5 w-3.5 animate-spin`}):(0,h.jsx)(a,{className:`h-3.5 w-3.5`}),p[16]=S,p[17]=z);let B;p[18]!==w||p[19]!==R||p[20]!==z?(B=(0,h.jsx)(ee,{asChild:!0,children:(0,h.jsx)(t,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute top-2 right-2 h-6 w-6`,onClick:w,disabled:R,children:z})}),p[18]=w,p[19]=R,p[20]=z,p[21]=B):B=p[21];let V=S?`Generating PR description...`:`Generate PR title and description with AI`,H;p[22]===V?H=p[23]:(H=(0,h.jsx)(ne,{children:V}),p[22]=V,p[23]=H);let U;p[24]!==B||p[25]!==H?(U=(0,h.jsx)(n,{children:(0,h.jsxs)(te,{children:[B,H]})}),p[24]=B,p[25]=H,p[26]=U):U=p[26];let W;p[27]!==U||p[28]!==L?(W=(0,h.jsxs)(`div`,{className:`grid gap-2 flex-1 min-h-0`,children:[F,(0,h.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[L,U]})]}),p[27]=U,p[28]=L,p[29]=W):W=p[29];let G;p[30]!==W||p[31]!==P?(G=(0,h.jsxs)(`div`,{className:`grid gap-4 py-4 flex-1 min-h-0`,children:[P,W]}),p[30]=W,p[31]=P,p[32]=G):G=p[32];let K;p[33]===O?K=p[34]:(K=e=>O(e===!0),p[33]=O,p[34]=K);let q;p[35]!==D||p[36]!==K?(q=(0,h.jsx)(ie,{id:`auto-generate-pr`,checked:D,onCheckedChange:K}),p[35]=D,p[36]=K,p[37]=q):q=p[37];let J;p[38]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,h.jsx)(r,{htmlFor:`auto-generate-pr`,className:s.labelNormal,children:`Auto generate PR title and description`}),p[38]=J):J=p[38];let Y;p[39]===q?Y=p[40]:(Y=(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[q,J]}),p[39]=q,p[40]=Y);let X=C?`Creating...`:`Create PR`,Z;p[41]!==C||p[42]!==T||p[43]!==X?(Z=(0,h.jsx)(o,{children:(0,h.jsx)(t,{onClick:T,disabled:C,children:X})}),p[41]=C,p[42]=T,p[43]=X,p[44]=Z):Z=p[44];let Q;p[45]!==G||p[46]!==A||p[47]!==Y||p[48]!==Z?(Q=(0,h.jsxs)(c,{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:[A,G,Y,Z]}),p[45]=G,p[46]=A,p[47]=Y,p[48]=Z,p[49]=Q):Q=p[49];let $;return p[50]!==_||p[51]!==g||p[52]!==Q?($=(0,h.jsx)(i,{open:g,onOpenChange:_,children:Q}),p[50]=_,p[51]=g,p[52]=Q,p[53]=$):$=p[53],$}export{g as PullRequestDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$r as e,Ai as t,Jr as n,Qr as r,So as i,Xi as a,Xr as o,Zr as s,ei as c,no as l,os as u,ss as d,wa as f}from"./dialogs-config-BEazgV7k.js";import{x as p}from"./history-view-BMVTxWTg.js";var m=d(),h=u();function g(u){let d=(0,m.c)(27),{open:g,onOpenChange:_,onCommitFirst:v,onStashAndPull:y,onCancel:b,isLoading:x}=u,S=x===void 0?!1:x,C;d[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,h.jsxs)(e,{children:[(0,h.jsxs)(c,{className:`flex items-center gap-2`,children:[(0,h.jsx)(f,{className:`h-5 w-5 text-amber-500`}),`Uncommitted Changes Detected`]}),(0,h.jsx)(s,{children:`You have uncommitted changes. You need to handle them before pulling from the remote branch.`})]}),d[0]=C):C=d[0];let w;d[1]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,h.jsx)(`div`,{className:a.bodyMuted,children:`Choose how you want to proceed:`}),d[1]=w):w=d[1];let T;d[2]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,h.jsx)(i,{className:`h-4 w-4 mr-2`}),d[2]=T):T=d[2];let E;d[3]!==S||d[4]!==v?(E=(0,h.jsxs)(t,{onClick:v,disabled:S,className:`w-full justify-start`,variant:`outline`,children:[T,`Commit changes first, then pull`]}),d[3]=S,d[4]=v,d[5]=E):E=d[5];let D;d[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,h.jsx)(l,{className:`h-4 w-4 mr-2`}),d[6]=D):D=d[6];let O;d[7]!==S||d[8]!==y?(O=(0,h.jsxs)(t,{onClick:y,disabled:S,className:`w-full justify-start`,variant:`outline`,children:[D,`Stash changes → Pull → Restore changes`]}),d[7]=S,d[8]=y,d[9]=O):O=d[9];let k;d[10]!==E||d[11]!==O?(k=(0,h.jsxs)(`div`,{className:`space-y-2`,children:[E,O]}),d[10]=E,d[11]=O,d[12]=k):k=d[12];let A;d[13]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,h.jsx)(`strong`,{children:`Commit first:`}),d[13]=A):A=d[13];let j;d[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,h.jsxs)(p,{variant:`hint`,className:`mt-4 mb-0`,children:[A,` Safe option, preserves changes in your commit history.`,(0,h.jsx)(`br`,{}),(0,h.jsx)(`strong`,{children:`Stash and pull:`}),` Temporary option, changes will be restored after pulling.`]}),d[14]=j):j=d[14];let M;d[15]===k?M=d[16]:(M=(0,h.jsx)(`div`,{className:`py-4`,children:(0,h.jsxs)(`div`,{className:`space-y-3`,children:[w,k,j]})}),d[15]=k,d[16]=M);let N;d[17]!==S||d[18]!==b?(N=(0,h.jsx)(r,{children:(0,h.jsx)(t,{variant:`ghost`,onClick:b,disabled:S,children:`Cancel`})}),d[17]=S,d[18]=b,d[19]=N):N=d[19];let P;d[20]!==M||d[21]!==N?(P=(0,h.jsxs)(o,{className:`sm:max-w-[425px]`,children:[C,M,N]}),d[20]=M,d[21]=N,d[22]=P):P=d[22];let F;return d[23]!==_||d[24]!==g||d[25]!==P?(F=(0,h.jsx)(n,{open:g,onOpenChange:_,children:P}),d[23]=_,d[24]=g,d[25]=P,d[26]=F):F=d[26],F}export{g as PullWithChangesDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$r as e,Ai as t,Jr as n,Qr as r,Xr as i,Zr as a,ei as o,os as s,ss as c}from"./dialogs-config-BEazgV7k.js";var l=c(),u=s();function d(s){let c=(0,l.c)(15),{open:d,onOpenChange:f,isLoading:p,onPushAndCreatePR:m,onCancel:h}=s,g;c[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,u.jsxs)(e,{children:[(0,u.jsx)(o,{children:`Push Branch First`}),(0,u.jsx)(a,{children:`Your branch needs to be pushed to the remote before creating a pull request. Would you like to push it now?`})]}),c[0]=g):g=c[0];let _;c[1]!==p||c[2]!==h?(_=(0,u.jsx)(t,{variant:`outline`,onClick:h,disabled:p,children:`Cancel`}),c[1]=p,c[2]=h,c[3]=_):_=c[3];let v=p?`Pushing...`:`Push & Create PR`,y;c[4]!==p||c[5]!==m||c[6]!==v?(y=(0,u.jsx)(t,{onClick:m,disabled:p,children:v}),c[4]=p,c[5]=m,c[6]=v,c[7]=y):y=c[7];let b;c[8]!==_||c[9]!==y?(b=(0,u.jsxs)(i,{children:[g,(0,u.jsxs)(r,{children:[_,y]})]}),c[8]=_,c[9]=y,c[10]=b):b=c[10];let x;return c[11]!==f||c[12]!==d||c[13]!==b?(x=(0,u.jsx)(n,{open:d,onOpenChange:f,children:b}),c[11]=f,c[12]=d,c[13]=b,c[14]=x):x=c[14],x}export{d as PushBeforePRDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ho as t,Mi as n,ls as r,os as i,ss as a}from"./dialogs-config-BEazgV7k.js";import{_ as o,v as s,y as c}from"./react-vendor-iDwBzcYF.js";var l=a(),u=e(r(),1),d=i(),f=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=n(`grid gap-2`,i),r[3]=i,r[4]=o);let s;return r[5]!==a||r[6]!==t||r[7]!==o?(s=(0,d.jsx)(c,{className:o,...a,ref:t}),r[5]=a,r[6]=t,r[7]=o,r[8]=s):s=r[8],s});f.displayName=c.displayName;var p=u.forwardRef((e,r)=>{let i=(0,l.c)(10),a,c;i[0]===e?(a=i[1],c=i[2]):({className:a,...c}=e,i[0]=e,i[1]=a,i[2]=c);let u;i[3]===a?u=i[4]:(u=n(`aspect-square h-4 w-4 rounded-full border border-brand text-brand ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,a),i[3]=a,i[4]=u);let f;i[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,d.jsx)(o,{className:`flex items-center justify-center`,children:(0,d.jsx)(t,{className:`h-2.5 w-2.5 fill-current text-current`})}),i[5]=f):f=i[5];let p;return i[6]!==c||i[7]!==r||i[8]!==u?(p=(0,d.jsx)(s,{ref:r,className:u,...c,children:f}),i[6]=c,i[7]=r,i[8]=u,i[9]=p):p=i[9],p});p.displayName=s.displayName;export{p as n,f as t};
|