@openchambery/web 1.19.8-beta.2 → 1.19.8-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AssistantView-DqF_KliJ.js +2 -0
- package/dist/assets/{DiagramView-B1cr5UPr.js → DiagramView-BOf0XyhQ.js} +1 -1
- package/dist/assets/FadeInOnReveal-CTlNE4Hg.js +1 -0
- package/dist/assets/MarkdownRenderer-BOu7M25-.js +2 -0
- package/dist/assets/MarkdownRendererImpl-CwOqt9-n.js +7 -0
- package/dist/assets/MarkstreamRendererImpl-CZwr50m3.js +3 -0
- package/dist/assets/{MobileDetailNavigation-DUYT-w-b.js → MobileDetailNavigation-o35tPGJZ.js} +1 -1
- package/dist/assets/{MobileShareBridge-BdkKcPfM.js → MobileShareBridge-CJv9FNN4.js} +1 -1
- package/dist/assets/{MobileSurface-BipQrFN7.js → MobileSurface-FeJg2wvI.js} +1 -1
- package/dist/assets/{MultiRunWindow-KznXYi4R.js → MultiRunWindow-C4gTo26b.js} +1 -1
- package/dist/assets/{SettingsView-yD6YjBtn.js → SettingsView-DH1lKxhj.js} +1 -1
- package/dist/assets/{SettingsWindow-lc0HYe8D.js → SettingsWindow-DfZYScHD.js} +1 -1
- package/dist/assets/{TerminalView-BiftutsX.js → TerminalView-Cvox0n-Y.js} +1 -1
- package/dist/assets/{ToolOutputDialog-_Tc2D64N.js → ToolOutputDialog-DAjbYaQs.js} +2 -2
- package/dist/assets/{appThemeRegistry-CbdJL978.js → appThemeRegistry-B9dkdh17.js} +1 -1
- package/dist/assets/{gitApi-DhafzShm.js → gitApi-Cuvk5IMC.js} +1 -1
- package/dist/assets/{insertionBoundaries-D82BN9Nn.js → insertionBoundaries-BKBE6Sqv.js} +1 -1
- package/dist/assets/{main-UPkDYyZy.js → main-DJOnIS-J.js} +13 -13
- package/dist/assets/{main-DONRSGbm.js → main-DgayyYBn.js} +2 -2
- package/dist/assets/markdown-worker-D_Fa477Q.js +2 -0
- package/dist/assets/{MarkdownLoadingSkeleton-DWs4Jg7b.js → markdownHeightCache-ClvyXMvt.js} +1 -1
- package/dist/assets/markdownTheme-DyJ4Gfcj.js +2 -0
- package/dist/assets/{miniChat-CQlBJDTL.js → miniChat-Bl8OAwWA.js} +2 -2
- package/dist/assets/{mobile-C_PBZouC.js → mobile-I1e-Q6Ti.js} +2 -2
- package/dist/assets/{multirun-Qahvkk53.js → multirun-C4EEG6D4.js} +1 -1
- package/dist/assets/{projectMeta-B6cvcYxv.js → projectMeta-BaYjFN04.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-CvMcHfej.js → renderElectronMiniChatApp-a0VxaopQ.js} +2 -2
- package/dist/assets/renderMobileApp-Bov7RC9j.js +28 -0
- package/dist/assets/{runtimeConfig-BOf8a6dv.js → runtimeConfig-C4PbCqJy.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-eaItEnQo.js → runtimeEndpointReset-Dg84smE6.js} +6 -6
- package/dist/assets/sessionChangeSummary-hVby3sJk.js +1 -0
- package/dist/assets/{sessionLookup-DQxTr5Hf.js → sessionLookup-Dy-vq8rt.js} +1 -1
- package/dist/assets/{useAppFontEffects-DT00lvd_.js → useAppFontEffects-BsBNRjTC.js} +44 -44
- package/dist/assets/{useDesktopWindowControlsLayout-Bzkb1Y05.js → useDesktopWindowControlsLayout-DI4_cCHr.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-C55Dluga.js → useEffectiveDirectory-BFzFI3Zf.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-DpPEzHZ1.js → useMobileNavigationStore-CUjhBNtJ.js} +1 -1
- package/dist/assets/{useSessionAutoCleanup-BF_zxuMv.js → useSessionAutoCleanup-CYO684Np.js} +1 -1
- package/dist/assets/useWorkerHighlightedLines-DA0EngHm.js +7 -0
- package/dist/assets/{vendor-markstream-react-C3K8YH0d.js → vendor-markstream-react-BHKU7s_s.js} +4 -4
- package/dist/index.html +2 -2
- package/dist/mini-chat.html +2 -2
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/dist/assets/AssistantView-DqU0LpWe.js +0 -2
- package/dist/assets/FadeInOnReveal-CK4asqVR.js +0 -1
- package/dist/assets/MarkdownRenderer-3WAUET64.js +0 -2
- package/dist/assets/MarkdownRendererImpl-834FCgUq.js +0 -7
- package/dist/assets/MarkstreamRendererImpl-Bi3gx3MP.js +0 -1
- package/dist/assets/fileReferenceActions-BJJtX_S5.js +0 -1
- package/dist/assets/markdown-worker-BuveaH3O.js +0 -1
- package/dist/assets/markdownHeightCache-CvUyZT4q.js +0 -1
- package/dist/assets/markdownTheme-CzZm3riB.js +0 -2
- package/dist/assets/outsideFileGrants-DnplRxr-.js +0 -1
- package/dist/assets/path-utils-jGozTg9d.js +0 -1
- package/dist/assets/renderMobileApp-WptF-y5w.js +0 -28
- package/dist/assets/sessionChangeSummary-DOq8EN_H.js +0 -1
- package/dist/assets/toolHelpers-DEvVP9U0.js +0 -2
- package/dist/assets/useWorkerHighlightedLines-BAd14WJR.js +0 -7
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n}from"./vendor-base-ui-CnHfUmDN.js";import{n as r}from"./vendor-react-DLPElpoQ.js";import{n as i,u as a}from"./vendor-reactuses-core-DDoDDyM9.js";import{t as o}from"./utils-BiK3tBGM.js";import{n as s}from"./Icon-BYM02QyU.js";import{t as c}from"./textarea-Cgo_nWUU.js";var l=r(),u=e(n(),1),d=t(),f=u.createContext(null),p=e=>{let t=(0,l.c)(3),{actions:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,d.jsx)(f.Provider,{value:n,children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},m=()=>u.useContext(f),ee=e=>e.nativeEvent.isComposing||e.nativeEvent.keyCode===229;function h(e){let t=(0,l.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=o(`inline-flex shrink-0 items-center justify-center rounded-full bg-foreground text-background`,r),t[4]=r,t[5]=a);let s;return t[6]!==n||t[7]!==i||t[8]!==a?(s=(0,d.jsx)(`span`,{className:a,...i,"aria-hidden":!0,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=s):s=t[9],s}function g(e){let t=(0,l.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,d.jsx)(`span`,{"data-stop-glyph":`true`,className:`block size-[38%] rounded-[20%] bg-current`}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,d.jsx)(h,{className:n,...r,children:i}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function _(e){let t=(0,l.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,spinning:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i,c=a?`loader-4`:`arrow-up`,u=a?`size-[50%] animate-spin`:`size-[56%]`,f;t[4]===u?f=t[5]:(f=o(u),t[4]=u,t[5]=f);let p;t[6]!==c||t[7]!==f?(p=(0,d.jsx)(s,{name:c,weight:`medium`,className:f}),t[6]=c,t[7]=f,t[8]=p):p=t[8];let m;return t[9]!==n||t[10]!==r||t[11]!==p?(m=(0,d.jsx)(h,{className:n,...r,children:p}),t[9]=n,t[10]=r,t[11]=p,t[12]=m):m=t[12],m}var te=u.forwardRef((e,t)=>{let n=(0,l.c)(19),r,i,a,s,c,u;n[0]===e?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5],u=n[6]):({children:r,className:i,expanded:c,focusedTone:u,style:s,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c,n[6]=u);let f=c!==void 0&&c,p=u===void 0?`primary`:u,m=f&&`min-h-0 flex-1`,ee=p===`info`?`focus-within:ring-[var(--status-info)]`:`focus-within:ring-primary/50`,h;n[7]!==i||n[8]!==m||n[9]!==ee?(h=o(`relative flex flex-col overflow-visible border border-border/80 focus-within:ring-1`,m,ee,i),n[7]=i,n[8]=m,n[9]=ee,n[10]=h):h=n[10];let g;n[11]===s?g=n[12]:(g={borderRadius:`var(--radius-xl)`,backgroundColor:`var(--surface-subtle)`,...s},n[11]=s,n[12]=g);let _;return n[13]!==r||n[14]!==a||n[15]!==t||n[16]!==h||n[17]!==g?(_=(0,d.jsx)(`div`,{ref:t,className:h,style:g,...a,children:r}),n[13]=r,n[14]=a,n[15]=t,n[16]=h,n[17]=g,n[18]=_):_=n[18],_});te.displayName=`ChatComposerSurface`;var ne=u.forwardRef((e,t)=>{let n=(0,l.c)(3),r;return n[0]!==e||n[1]!==t?(r=(0,d.jsx)(c,{ref:t,...e}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});ne.displayName=`ChatPromptTextarea`;var re=e=>{let t=(0,l.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=o(`flex shrink-0 items-center gap-2 bg-transparent px-2.5 py-1.5`,r),t[4]=r,t[5]=a);let s;return t[6]!==n||t[7]!==i||t[8]!==a?(s=(0,d.jsx)(`div`,{className:a,"data-chat-input-footer":`true`,...i,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=s):s=t[9],s},ie=(e,t)=>{typeof e==`function`?e(t):e&&(e.current=t)},v=e=>{let t=(0,l.c)(169),n,r,c,f,p,m,h,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,se,F,I,L,R,ce,le,ue,de,fe,pe,me,he,ge,z,B,V;t[0]===e?(n=t[1],r=t[2],c=t[3],f=t[4],p=t[5],m=t[6],h=t[7],v=t[8],y=t[9],b=t[10],x=t[11],S=t[12],C=t[13],w=t[14],T=t[15],E=t[16],D=t[17],O=t[18],k=t[19],A=t[20],j=t[21],M=t[22],N=t[23],P=t[24],se=t[25],F=t[26],I=t[27],L=t[28],R=t[29],ce=t[30],le=t[31],ue=t[32],de=t[33],fe=t[34],pe=t[35],me=t[36],he=t[37],ge=t[38],z=t[39],B=t[40],V=t[41]):({value:V,attachments:ce,disabled:le,pending:ue,placeholder:P,isMobile:de,onChange:A,onSubmit:N,onStop:M,onAddFiles:k,onRemoveAttachment:j,addFilesLabel:n,removeAttachmentLabel:se,fileAccept:fe,sendLabel:I,stopLabel:L,hint:x,leftControls:O,rightControls:F,footerContent:h,inputHeader:C,attachmentContent:r,highlightedContent:b,highlightRef:y,inputRef:T,textareaProps:B,textLayoutClassName:z,inputClassName:S,inputOuterClassName:w,inputStyle:D,footerClassName:m,footerStyle:v,contentClassName:p,inputSectionClassName:E,autoResize:pe,disableInputWhilePending:me,layout:he,children:c,className:f,expanded:ge,...R}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=c,t[4]=f,t[5]=p,t[6]=m,t[7]=h,t[8]=v,t[9]=y,t[10]=b,t[11]=x,t[12]=S,t[13]=C,t[14]=w,t[15]=T,t[16]=E,t[17]=D,t[18]=O,t[19]=k,t[20]=A,t[21]=j,t[22]=M,t[23]=N,t[24]=P,t[25]=se,t[26]=F,t[27]=I,t[28]=L,t[29]=R,t[30]=ce,t[31]=le,t[32]=ue,t[33]=de,t[34]=fe,t[35]=pe,t[36]=me,t[37]=he,t[38]=ge,t[39]=z,t[40]=B,t[41]=V);let _e=ce===void 0?[]:ce,H=le!==void 0&&le,U=ue!==void 0&&ue,ve=de!==void 0&&de,ye=fe===void 0?`image/*`:fe,W=pe===void 0||pe,be=me===void 0||me,xe=he===void 0?`stacked`:he,G=ge!==void 0&&ge,K=xe===`inline`,[Se,Ce]=u.useState(!1),we=_e.length>0||Se,Te=u.useRef(null),Ee=u.useRef(null),De;t[42]!==W||t[43]!==G||t[44]!==K||t[45]!==B?.fillContainer?(De=()=>{if(!W||G||B?.fillContainer){K&&Ce(!1);return}let e=Te.current;if(!e)return;e.style.height=`auto`;let t=Number.parseFloat(window.getComputedStyle(e).maxHeight),n=K?Math.max(e.scrollHeight,48):e.scrollHeight,r=Number.isFinite(t)?Math.min(n,t):n;e.style.height=`${r}px`,e.style.overflowY=Number.isFinite(t)&&n>t?`auto`:`hidden`;let i=r>48;K&&Ce(e=>e===i?e:i)},t[42]=W,t[43]=G,t[44]=K,t[45]=B?.fillContainer,t[46]=De):De=t[46];let Oe=i(De),ke;t[47]===Oe?ke=t[48]:(ke=()=>{Oe()},t[47]=Oe,t[48]=ke);let Ae=B?.fillContainer,je;t[49]!==W||t[50]!==G||t[51]!==K||t[52]!==Ae||t[53]!==V?(je=[W,G,K,Ae,V],t[49]=W,t[50]=G,t[51]=K,t[52]=Ae,t[53]=V,t[54]=je):je=t[54],u.useLayoutEffect(ke,je),a(K&&W&&!G&&!B?.fillContainer?Te:null,Oe);let Me;t[55]!==be||t[56]!==H||t[57]!==N||t[58]!==U||t[59]!==B?(Me=e=>{B?.onKeyDown?.(e),!(e.defaultPrevented||ee(e))&&e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),!H&&(!U||!be)&&N())},t[55]=be,t[56]=H,t[57]=N,t[58]=U,t[59]=B,t[60]=Me):Me=t[60];let Ne=Me,Pe;t[61]===k?Pe=t[62]:(Pe=e=>{k?.(e.target.files),e.target.value=``},t[61]=k,t[62]=Pe);let Fe=Pe,q=V.trim().length>0||_e.length>0,Ie=_e.filter(ae),Le=_e.filter(oe),Re;t[63]!==n||t[64]!==H||t[65]!==ye||t[66]!==Fe||t[67]!==k||t[68]!==U?(Re=k?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`input`,{ref:Ee,type:`file`,accept:ye,multiple:!0,className:`hidden`,onChange:Fe}),(0,d.jsx)(`button`,{type:`button`,className:`flex size-8 shrink-0 items-center justify-center rounded-md text-foreground outline-none hover:bg-[var(--interactive-hover)] disabled:cursor-not-allowed disabled:opacity-40`,onClick:()=>Ee.current?.click(),disabled:H||U,"aria-label":n,children:(0,d.jsx)(s,{name:`attachment-2`,className:`size-[18px]`})})]}):null,t[63]=n,t[64]=H,t[65]=ye,t[66]=Fe,t[67]=k,t[68]=U,t[69]=Re):Re=t[69];let ze=Re,J=!H&&!U&&q,Y=ve?`size-6`:`size-full`,Be;t[70]!==Y||t[71]!==H||t[72]!==q||t[73]!==M||t[74]!==U||t[75]!==I||t[76]!==J||t[77]!==L?(Be=U&&M?(0,d.jsx)(`button`,{type:`button`,"data-composer-stop":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:opacity-80`,onClick:M,"aria-label":L,children:(0,d.jsx)(g,{className:Y})}):(0,d.jsx)(`button`,{type:`submit`,"data-composer-send":`true`,"data-composer-circle":J?`true`:void 0,className:o(`flex size-8 shrink-0 items-center justify-center outline-none`,J?`rounded-full hover:opacity-80`:`rounded-md text-primary hover:bg-[var(--interactive-hover)] disabled:cursor-not-allowed disabled:opacity-30`),disabled:H||U||!q,"aria-label":I,children:J?(0,d.jsx)(_,{className:Y}):(0,d.jsx)(s,{name:U?`loader-4`:`send-plane-2`,className:o(`size-4`,U&&`animate-spin`)})}),t[70]=Y,t[71]=H,t[72]=q,t[73]=M,t[74]=U,t[75]=I,t[76]=J,t[77]=L,t[78]=Be):Be=t[78];let Ve=Be,He;t[79]!==Y||t[80]!==H||t[81]!==q||t[82]!==M||t[83]!==U||t[84]!==I||t[85]!==J||t[86]!==L?(He=U&&M?(0,d.jsx)(`button`,{type:`button`,"data-composer-stop":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:opacity-80`,onClick:M,"aria-label":L,children:(0,d.jsx)(g,{className:Y})}):(0,d.jsx)(`button`,{type:`submit`,"data-composer-send":`true`,"data-composer-circle":`true`,className:o(`flex size-8 shrink-0 items-center justify-center rounded-full outline-none`,J?`hover:opacity-80`:`cursor-not-allowed opacity-30`),disabled:H||U||!q,"aria-busy":U||void 0,"aria-label":I,children:(0,d.jsx)(_,{className:Y,spinning:U})}),t[79]=Y,t[80]=H,t[81]=q,t[82]=M,t[83]=U,t[84]=I,t[85]=J,t[86]=L,t[87]=He):He=t[87];let Ue=K?He:Ve,We=O===void 0?ze:O,Ge=te,X;t[88]!==p||t[89]!==G||t[90]!==K||t[91]!==we?(X=o(`relative flex min-h-0`,K?o(`min-h-12 flex-row`,we?`items-end`:`items-center`):`flex-col`,G&&`flex-1`,p),t[88]=p,t[89]=G,t[90]=K,t[91]=we,t[92]=X):X=t[92];let Z;t[93]!==K||t[94]!==We?(Z=K&&We?(0,d.jsx)(`div`,{className:`flex h-12 shrink-0 items-center pl-1.5`,"data-composer-inline-attach":`true`,children:We}):null,t[93]=K,t[94]=We,t[95]=Z):Z=t[95];let Ke=K&&`min-w-0 flex-1`,qe=G&&`flex min-h-0 flex-1 flex-col`,Je;t[96]!==E||t[97]!==Ke||t[98]!==qe?(Je=o(`overflow-hidden`,Ke,qe,E),t[96]=E,t[97]=Ke,t[98]=qe,t[99]=Je):Je=t[99];let Ye=Ie.length>0?(0,d.jsx)(`div`,{className:`flex gap-2 overflow-x-auto px-3 pt-3`,"data-chat-prompt-attachments":`true`,children:Ie.map(e=>(0,d.jsxs)(`div`,{className:`group relative shrink-0`,children:[(0,d.jsx)(`img`,{src:e.url,alt:e.name,className:`size-16 rounded-lg border border-border object-cover`}),j?(0,d.jsx)(`button`,{type:`button`,className:`absolute -right-1 -top-1 flex size-6 items-center justify-center rounded-full border border-border bg-[var(--surface-elevated)] shadow-sm hover:bg-[var(--interactive-hover)]`,onClick:()=>j(e.id),"aria-label":se,children:(0,d.jsx)(s,{name:`close`,className:`size-3`})}):null]},e.id))}):null,Xe=Le.length>0?(0,d.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,"data-chat-prompt-file-attachments":`true`,children:Le.map(e=>(0,d.jsxs)(`div`,{className:`relative flex max-w-[12rem] items-center gap-1.5 rounded-lg border border-border bg-[var(--surface-elevated)] px-2 py-1`,children:[(0,d.jsx)(s,{name:`file-text`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,d.jsx)(`span`,{className:`min-w-0 truncate typography-micro`,children:e.name}),j?(0,d.jsx)(`button`,{type:`button`,className:`flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-[var(--interactive-hover)]`,onClick:()=>j(e.id),"aria-label":se,children:(0,d.jsx)(s,{name:`close`,className:`size-3`})}):null]},e.id))}):null,Ze=K&&`flex min-h-12 items-end`,Qe=G&&`flex min-h-0 flex-1 flex-col`,$e;t[100]!==Ze||t[101]!==Qe?($e=o(`relative overflow-hidden`,Ze,Qe),t[100]=Ze,t[101]=Qe,t[102]=$e):$e=t[102];let et;t[103]!==y||t[104]!==b||t[105]!==S||t[106]!==z?(et=b?(0,d.jsx)(`div`,{ref:y,"aria-hidden":!0,"data-composer-highlight":`true`,className:o(`pointer-events-none absolute inset-0 z-0 rounded-b-none`,z,S),children:b}):null,t[103]=y,t[104]=b,t[105]=S,t[106]=z,t[107]=et):et=t[107];let tt=!K&&B?.fillContainer,nt;t[108]===T?nt=t[109]:(nt=e=>{Te.current=e,ie(T,e)},t[108]=T,t[109]=nt);let rt;t[110]===A?rt=t[111]:(rt=e=>A(e.target.value,e),t[110]=A,t[111]=rt);let it=H||U&&be,at=ve?`send`:B?.enterKeyHint,ot=K&&`flex-none`,st=G&&`min-h-0 flex-1`,ct;t[112]!==w||t[113]!==ot||t[114]!==st?(ct=o(`ring-0 bg-transparent shadow-none hover:bg-transparent focus-within:ring-0`,ot,st,w),t[112]=w,t[113]=ot,t[114]=st,t[115]=ct):ct=t[115];let lt=K?`min-h-12 max-h-32 px-3 py-3 leading-6`:`min-h-[52px] max-h-40 rounded-b-none px-3 pb-2 pt-4`,ut=b&&`text-transparent caret-[var(--surface-foreground)]`,Q;t[116]!==S||t[117]!==lt||t[118]!==ut||t[119]!==z?(Q=o(`relative z-10 resize-none overflow-y-hidden appearance-none border-0 bg-transparent typography-markdown hover:border-transparent md:typography-ui-label`,lt,z,S,ut),t[116]=S,t[117]=lt,t[118]=ut,t[119]=z,t[120]=Q):Q=t[120];let dt=B?.rows??1,ft;t[121]!==Ne||t[122]!==D||t[123]!==P||t[124]!==tt||t[125]!==nt||t[126]!==rt||t[127]!==it||t[128]!==at||t[129]!==ct||t[130]!==Q||t[131]!==dt||t[132]!==B||t[133]!==V?(ft=(0,d.jsx)(ne,{...B,simple:!0,fillContainer:tt,ref:nt,"data-chat-input":`true`,value:V,onChange:rt,onKeyDown:Ne,disabled:it,placeholder:P,enterKeyHint:at,outerClassName:ct,className:Q,style:D,rows:dt}),t[121]=Ne,t[122]=D,t[123]=P,t[124]=tt,t[125]=nt,t[126]=rt,t[127]=it,t[128]=at,t[129]=ct,t[130]=Q,t[131]=dt,t[132]=B,t[133]=V,t[134]=ft):ft=t[134];let pt;t[135]!==$e||t[136]!==et||t[137]!==ft?(pt=(0,d.jsxs)(`div`,{className:$e,"data-composer-input-shell":`true`,children:[et,ft]}),t[135]=$e,t[136]=et,t[137]=ft,t[138]=pt):pt=t[138];let mt;t[139]!==r||t[140]!==C||t[141]!==Je||t[142]!==Ye||t[143]!==Xe||t[144]!==pt?(mt=(0,d.jsxs)(`div`,{className:Je,children:[C,r,Ye,Xe,pt]}),t[139]=r,t[140]=C,t[141]=Je,t[142]=Ye,t[143]=Xe,t[144]=pt,t[145]=mt):mt=t[145];let ht;t[146]!==ze||t[147]!==Ue||t[148]!==m||t[149]!==h||t[150]!==v||t[151]!==x||t[152]!==K||t[153]!==O||t[154]!==F?(ht=K?(0,d.jsx)(`div`,{className:o(`flex h-12 shrink-0 items-center pr-1.5`,m),style:v,"data-composer-inline-send":`true`,children:F??Ue}):(0,d.jsx)(re,{className:m,style:v,children:h??(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{className:`flex items-center gap-1.5`,children:O??ze}),x?(0,d.jsx)(`div`,{className:`min-w-0 flex-1 truncate typography-micro text-muted-foreground`,children:x}):(0,d.jsx)(`div`,{className:`flex-1`}),(0,d.jsx)(`div`,{className:`flex items-center gap-1.5`,children:F??Ue})]})}),t[146]=ze,t[147]=Ue,t[148]=m,t[149]=h,t[150]=v,t[151]=x,t[152]=K,t[153]=O,t[154]=F,t[155]=ht):ht=t[155];let $;t[156]!==xe||t[157]!==X||t[158]!==Z||t[159]!==mt||t[160]!==ht?($=(0,d.jsxs)(`div`,{"data-composer-content":`true`,"data-composer-layout":xe,className:X,children:[Z,mt,ht]}),t[156]=xe,t[157]=X,t[158]=Z,t[159]=mt,t[160]=ht,t[161]=$):$=t[161];let gt;return t[162]!==Ge||t[163]!==c||t[164]!==f||t[165]!==G||t[166]!==R||t[167]!==$?(gt=(0,d.jsxs)(Ge,{className:f,expanded:G,...R,children:[c,$]}),t[162]=Ge,t[163]=c,t[164]=f,t[165]=G,t[166]=R,t[167]=$,t[168]=gt):gt=t[168],gt};function ae(e){return e.mime.startsWith(`image/`)}function oe(e){return!e.mime.startsWith(`image/`)}var y=e=>{if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.trunc(e);return t>=0?t:void 0},b=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.summary;return!t||typeof t!=`object`||Array.isArray(t)?null:t},x=e=>{let t=y(e);return t!==void 0&&t>0?t:void 0};function S(e){let t=b(e);if(!t)return null;let n=x(t.additions),r=x(t.deletions),i=x(t.files)??x(t.diffCount);return n===void 0&&r===void 0&&i===void 0?null:{...n===void 0?{}:{additions:n},...r===void 0?{}:{deletions:r},...i===void 0?{}:{files:i}}}function C(e){if(!e)return null;let t=[];return e.additions!==void 0&&e.additions>0&&t.push(`+${e.additions}`),e.deletions!==void 0&&e.deletions>0&&t.push(`−${e.deletions}`),t.length>0?t.join(` `):null}function w(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=typeof t.providerID==`string`?t.providerID.trim():``,r=typeof t.modelID==`string`?t.modelID.trim():``;if(n&&r)return`${n}/${r}`;let i=t.model;if(typeof i==`string`&&i.trim())return i.trim();if(i&&typeof i==`object`&&!Array.isArray(i)){let e=i,t=typeof e.providerID==`string`?e.providerID.trim():typeof e.provider==`string`?e.provider.trim():``,n=typeof e.modelID==`string`?e.modelID.trim():typeof e.id==`string`?e.id.trim():``;if(t&&n)return`${t}/${n}`}return null}function T(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;if(typeof t.branch==`string`&&t.branch.trim())return t.branch.trim();let n=t.project;if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n.branch;if(typeof e==`string`&&e.trim())return e.trim()}return null}export{v as a,ee as c,w as i,p as l,T as n,_ as o,S as r,g as s,C as t,m as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={read:{displayName:`Read File`,category:`file`,outputLanguage:`auto`,inputFields:[{key:`filePath`,label:`File Path`,type:`file`},{key:`offset`,label:`Start Line`,type:`text`},{key:`limit`,label:`Lines to Read`,type:`text`}]},write:{displayName:`Write File`,category:`file`,outputLanguage:`auto`,inputFields:[{key:`filePath`,label:`File Path`,type:`file`},{key:`content`,label:`Content`,type:`code`}]},edit:{displayName:`Edit File`,category:`file`,outputLanguage:`diff`,inputFields:[{key:`filePath`,label:`File Path`,type:`file`},{key:`oldString`,label:`Find`,type:`code`},{key:`newString`,label:`Replace`,type:`code`},{key:`replaceAll`,label:`Replace All`,type:`text`}]},multiedit:{displayName:`Multi-Edit`,category:`file`,outputLanguage:`diff`,inputFields:[{key:`filePath`,label:`File Path`,type:`file`},{key:`edits`,label:`Edits`,type:`code`,language:`json`}]},apply_patch:{displayName:`Apply Patch`,category:`file`,outputLanguage:`diff`,inputFields:[{key:`patchText`,label:`Patch`,type:`code`,language:`diff`}]},bash:{displayName:`Shell Command`,category:`system`,outputLanguage:`text`,inputFields:[{key:`command`,label:`Command`,type:`command`,language:`bash`},{key:`description`,label:`Description`,type:`text`},{key:`timeout`,label:`Timeout (ms)`,type:`text`}]},grep:{displayName:`Search Files`,category:`search`,outputLanguage:`text`,inputFields:[{key:`pattern`,label:`Pattern`,type:`pattern`},{key:`path`,label:`Directory`,type:`file`},{key:`include`,label:`Include Pattern`,type:`pattern`}]},glob:{displayName:`Find Files`,category:`search`,outputLanguage:`text`,inputFields:[{key:`pattern`,label:`Pattern`,type:`pattern`},{key:`path`,label:`Directory`,type:`file`}]},list:{displayName:`List Directory`,category:`file`,outputLanguage:`text`,inputFields:[{key:`path`,label:`Directory`,type:`file`},{key:`ignore`,label:`Ignore Patterns`,type:`pattern`}]},task:{displayName:`Agent Task`,category:`ai`,outputLanguage:`markdown`,inputFields:[{key:`description`,label:`Task`,type:`text`},{key:`prompt`,label:`Instructions`,type:`text`},{key:`subagent_type`,label:`Agent Type`,type:`text`}]},webfetch:{displayName:`Fetch URL`,category:`web`,outputLanguage:`auto`,inputFields:[{key:`url`,label:`URL`,type:`text`},{key:`format`,label:`Format`,type:`text`},{key:`timeout`,label:`Timeout`,type:`text`}]},websearch:{displayName:`Web Search`,category:`web`,outputLanguage:`markdown`,inputFields:[{key:`query`,label:`Search Query`,type:`text`},{key:`numResults`,label:`Results Count`,type:`text`},{key:`type`,label:`Search Type`,type:`text`}]},codesearch:{displayName:`Code Search`,category:`web`,outputLanguage:`markdown`,inputFields:[{key:`query`,label:`Search Query`,type:`text`},{key:`tokensNum`,label:`Tokens`,type:`text`}]},todowrite:{displayName:`Update Todo List`,category:`system`,outputLanguage:`json`,inputFields:[{key:`todos`,label:`Todo Items`,type:`code`,language:`json`}]},todoread:{displayName:`Read Todo List`,category:`system`,outputLanguage:`json`,inputFields:[]},skill:{displayName:`Load Skill`,category:`ai`,outputLanguage:`markdown`,inputFields:[{key:`name`,label:`Skill Name`,type:`text`}]},question:{displayName:`Question`,category:`ai`,outputLanguage:`text`,inputFields:[{key:`questions`,label:`Questions`,type:`code`,language:`json`}]},lsp:{displayName:`LSP`,category:`code`,outputLanguage:`json`,inputFields:[{key:`operation`,label:`Operation`,type:`text`},{key:`filePath`,label:`File Path`,type:`file`},{key:`line`,label:`Line`,type:`text`},{key:`character`,label:`Character`,type:`text`},{key:`query`,label:`Query`,type:`text`}]},StructuredOutput:{displayName:`Structured Output`,category:`ai`,outputLanguage:`json`,inputFields:[]},structuredoutput:{displayName:`Structured Output`,category:`ai`,outputLanguage:`json`,inputFields:[]}};function t(e){return e.trim().replace(/[_-]+/g,` `).replace(/\s+/g,` `).replace(/^./,e=>e.toUpperCase())}var n={shell:`bash`,cmd:`bash`,terminal:`bash`,structuredoutput:`structuredoutput`},r={read:`chat.tools.display.read`,write:`chat.tools.display.write`,edit:`chat.tools.display.edit`,multiedit:`chat.tools.display.multiedit`,apply_patch:`chat.tools.display.apply_patch`,bash:`chat.tools.display.bash`,grep:`chat.tools.display.grep`,glob:`chat.tools.display.glob`,list:`chat.tools.display.list`,task:`chat.tools.display.task`,webfetch:`chat.tools.display.webfetch`,websearch:`chat.tools.display.websearch`,codesearch:`chat.tools.display.codesearch`,todowrite:`chat.tools.display.todowrite`,todoread:`chat.tools.display.todoread`,skill:`chat.tools.display.skill`,question:`chat.tools.display.question`,lsp:`chat.tools.display.lsp`,structuredoutput:`chat.tools.display.structuredoutput`};function i(e){let t=e.trim().toLowerCase();if(!t)return``;let r=t.replace(/:\d+$/,``),i=r.includes(`.`)?r.split(`.`).filter(Boolean).pop()??r:r;return n[i]??i}function a(e,t){let n=i(e);return n in r?t(r[n]):o(e).displayName}function o(n){return e[n]||e[i(n)]||{displayName:t(n),category:`system`,outputLanguage:`text`,inputFields:[]}}function s(e,t,n){let r=o(e);if(r.outputLanguage===`auto`){if(n?.filePath||n?.file_path||n?.sourcePath){let e=c(n.filePath||n.file_path||n.sourcePath);if(e)return e}if(e===`webfetch`){if(t.trim().startsWith(`{`)||t.trim().startsWith(`[`))try{return JSON.parse(t),`json`}catch{}if(t.trim().startsWith(`<`))return`html`;if(t.includes("```"))return`markdown`}return`text`}return r.outputLanguage||`text`}function c(e){let t=e.split(`.`).pop()?.toLowerCase(),n=e.split(`/`).pop()?.toLowerCase()||``,r={dockerfile:`dockerfile`,makefile:`makefile`,gnumakefile:`makefile`,"cmakelists.txt":`cmake`,gemfile:`ruby`,rakefile:`ruby`,podfile:`ruby`,vagrantfile:`ruby`,guardfile:`ruby`,brewfile:`ruby`,fastfile:`ruby`,appfile:`ruby`,matchfile:`ruby`,pluginfile:`ruby`,scanfile:`ruby`,snapfile:`ruby`,".gitignore":`text`,".gitattributes":`text`,".gitmodules":`ini`,".editorconfig":`ini`,".npmrc":`ini`,".yarnrc":`yaml`,".prettierrc":`json`,".eslintrc":`json`,".babelrc":`json`,".browserslistrc":`text`,"tsconfig.json":`jsonc`,"jsconfig.json":`jsonc`,".env":`bash`,".env.local":`bash`,".env.development":`bash`,".env.production":`bash`,".env.test":`bash`,procfile:`yaml`,codeowners:`text`,"package-lock.json":`json`,"composer.lock":`json`,"yarn.lock":`yaml`,"pnpm-lock.yaml":`yaml`,"cargo.lock":`toml`,"poetry.lock":`toml`,"gemfile.lock":`ruby`,"pubspec.lock":`yaml`,"packages.lock.json":`json`,"bun.lockb":`text`,"bun.lock":`json`};return r[n]?r[n]:{js:`javascript`,jsx:`jsx`,ts:`typescript`,tsx:`tsx`,mjs:`javascript`,cjs:`javascript`,mts:`typescript`,cts:`typescript`,html:`html`,htm:`html`,xhtml:`html`,vue:`html`,svelte:`html`,astro:`html`,ejs:`html`,hbs:`handlebars`,handlebars:`handlebars`,mustache:`handlebars`,njk:`twig`,nunjucks:`twig`,twig:`twig`,liquid:`liquid`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,styl:`stylus`,stylus:`stylus`,pcss:`css`,postcss:`css`,json:`json`,jsonc:`json`,json5:`json`,jsonl:`json`,ndjson:`json`,geojson:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,xml:`xml`,xsl:`xml`,xslt:`xml`,xsd:`xml`,dtd:`xml`,plist:`xml`,svg:`xml`,rss:`xml`,atom:`xml`,xaml:`xml`,csproj:`xml`,vbproj:`xml`,fsproj:`xml`,props:`xml`,targets:`xml`,nuspec:`xml`,resx:`xml`,ini:`ini`,cfg:`ini`,conf:`ini`,config:`ini`,properties:`properties`,env:`bash`,csv:`text`,tsv:`text`,py:`python`,pyw:`python`,pyx:`python`,pxd:`python`,pxi:`python`,pyi:`python`,gyp:`python`,gypi:`python`,bzl:`python`,rb:`ruby`,erb:`erb`,rake:`ruby`,gemspec:`ruby`,ru:`ruby`,podspec:`ruby`,thor:`ruby`,jbuilder:`ruby`,rabl:`ruby`,builder:`ruby`,php:`php`,phtml:`php`,php3:`php`,php4:`php`,php5:`php`,php7:`php`,phps:`php`,inc:`php`,"blade.php":`php`,java:`java`,kt:`kotlin`,kts:`kotlin`,scala:`scala`,sc:`scala`,groovy:`groovy`,gradle:`groovy`,gvy:`groovy`,gy:`groovy`,gsh:`groovy`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,"c++":`cpp`,hpp:`cpp`,hxx:`cpp`,hh:`cpp`,"h++":`cpp`,ino:`cpp`,m:`objectivec`,mm:`objectivec`,cs:`csharp`,csx:`csharp`,cake:`csharp`,fs:`fsharp`,fsx:`fsharp`,fsi:`fsharp`,vb:`vbnet`,go:`go`,mod:`go`,sum:`text`,rs:`rust`,swift:`swift`,dart:`dart`,lua:`lua`,pl:`perl`,pm:`perl`,pod:`perl`,t:`perl`,r:`r`,R:`r`,rmd:`markdown`,rnw:`r`,jl:`julia`,hs:`haskell`,lhs:`haskell`,ex:`elixir`,exs:`elixir`,eex:`html`,heex:`html`,leex:`html`,erl:`erlang`,hrl:`erlang`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,edn:`clojure`,lisp:`lisp`,cl:`lisp`,el:`lisp`,scm:`scheme`,ss:`scheme`,rkt:`scheme`,ml:`ocaml`,mli:`ocaml`,re:`reason`,rei:`reason`,nim:`nim`,nims:`nim`,nimble:`nim`,zig:`zig`,v:`v`,vsh:`v`,cr:`crystal`,d:`d`,di:`d`,sh:`bash`,bash:`bash`,zsh:`bash`,fish:`bash`,ksh:`bash`,csh:`bash`,tcsh:`bash`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,bat:`batch`,cmd:`batch`,sql:`sql`,psql:`sql`,plsql:`sql`,mysql:`sql`,pgsql:`sql`,sqlite:`sql`,graphql:`graphql`,gql:`graphql`,sol:`solidity`,asm:`nasm`,s:`nasm`,S:`nasm`,nix:`nix`,tf:`hcl`,tfvars:`hcl`,hcl:`hcl`,dockerignore:`text`,pp:`puppet`,tex:`latex`,latex:`latex`,sty:`latex`,cls:`latex`,bib:`bibtex`,bst:`bibtex`,md:`markdown`,mdx:`markdown`,markdown:`markdown`,mdown:`markdown`,mkd:`markdown`,rst:`text`,adoc:`asciidoc`,asciidoc:`asciidoc`,org:`text`,txt:`text`,text:`text`,rtf:`text`,vim:`vim`,vimrc:`vim`,mk:`makefile`,cmake:`cmake`,diff:`diff`,patch:`diff`,prisma:`prisma`,proto:`protobuf`,thrift:`thrift`,wat:`wasm`,wast:`wasm`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,geom:`glsl`,comp:`glsl`,hlsl:`hlsl`,fx:`hlsl`,cg:`cg`,shader:`glsl`,htaccess:`apacheconf`,nginx:`nginx`,kubeconfig:`yaml`,ansible:`yaml`}[t||``]||null}var l=[`drawio`,`dio`];function u(e){let t=e.split(`.`).pop()?.toLowerCase();return l.includes(t||``)}var d=[`png`,`jpg`,`jpeg`,`gif`,`svg`,`webp`,`ico`,`bmp`,`avif`];function f(e){let t=e.split(`.`).pop()?.toLowerCase();return d.includes(t||``)}function p(e){return e.split(`.`).pop()?.toLowerCase()===`pdf`}function m(e){let t=e.split(`.`).pop()?.toLowerCase();return t===`html`||t===`htm`}function h(e){return{png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,svg:`image/svg+xml`,webp:`image/webp`,ico:`image/x-icon`,bmp:`image/bmp`,avif:`image/avif`}[e.split(`.`).pop()?.toLowerCase()||``]||`image/png`}function g(e,t){if(!e)return``;let n=t=>{let n=e[t];return typeof n==`string`?n:typeof n==`number`?String(n):null};if(t===`bash`){let e=n(`command`);if(e)return e}if(t===`lsp`){let e=n(`operation`)||`lsp`,t=n(`filePath`)||n(`file_path`)||n(`path`),r=n(`line`),i=n(`character`),a=n(`query`),o=r&&i?` (Line: ${r}; Character: ${i})`:``;if(e===`workspaceSymbol`)return a?`Operation: ${e} (Query: "${a}")`:`Operation: ${e}`;let s=`Operation: ${e}${o}`;return t?`${s}\n${t}`:s}if(t===`task`){let e=n(`prompt`);if(e)return e;let t=n(`description`);if(t)return t}if(t===`apply_patch`&&typeof e==`object`){let e=n(`patchText`)||n(`patch_text`)||n(`patch`);if(e)return e}if((t===`edit`||t===`multiedit`)&&typeof e==`object`){let e=n(`filePath`)||n(`file_path`)||n(`path`);if(e)return`File path: ${e}`}if(t===`write`&&typeof e==`object`){let e=n(`content`);if(e)return e}return typeof e==`object`?Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,t])=>{let n=e.replace(/([A-Z])/g,` $1`).replace(/_/g,` `).toLowerCase().replace(/^./,e=>e.toUpperCase()),r=t;return typeof t==`object`?r=JSON.stringify(t,null,2):typeof t==`boolean`&&(r=t?`Yes`:`No`),`${n}: ${r}`}).join(`
|
|
2
|
-
`):String(e)}export{u as a,p as c,c as i,a as l,g as n,m as o,h as r,f as s,s as t};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{_ as t}from"./useUIStore-CuaA8-Hp.js";import{$t as n,kn as r,xn as i}from"./persistence-DdUac14I.js";import{nt as a,rt as o}from"./vendor-base-ui-CnHfUmDN.js";import{n as s}from"./platform-B4KKLnZ5.js";import{a as c,n as l}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";import{n as u}from"./vendor-react-DLPElpoQ.js";import{n as d}from"./clipboard-DJ4nQEuY.js";import{t as f}from"./utils-BiK3tBGM.js";import{n as p}from"./Icon-BYM02QyU.js";import{t as m}from"./button-C0cth9tl.js";import{i as h,n as g,t as _}from"./tooltip-BifLJ8o0.js";import{n as v}from"./useThemeSystem-DMzWVJaW.js";import{c as y,n as b,o as x,r as S,s as C}from"./markdownTheme-CzZm3riB.js";import{n as w}from"./MarkdownRenderer-3WAUET64.js";import{n as T,t as E}from"./toolHelpers-DEvVP9U0.js";import{t as D}from"./vendor-tanstack-react-virtual-tlDgH6PG.js";import{n as ee,t as te}from"./markdown-worker-BuveaH3O.js";var O=e(o(),1),k=u(),A=a(),ne=`w-[min(30rem,calc(100cqw-1rem))] min-w-[280px] max-w-full overflow-hidden rounded-xl shadow-[inset_0_1px_0_0_rgba(255,255,255,0.8),inset_0_0_0_1px_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.10),0_1px_2px_-0.5px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.08),0_12px_20px_-4px_rgba(0,0,0,0.08)] dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.12),inset_0_0_0_1px_rgba(255,255,255,0.08),0_0_0_1px_rgba(0,0,0,0.36),0_1px_1px_-0.5px_rgba(0,0,0,0.22),0_3px_3px_-1.5px_rgba(0,0,0,0.20),0_6px_6px_-3px_rgba(0,0,0,0.16)]`,j={maxWidth:`min(28rem, calc(100cqw - 4ch))`,backgroundColor:`var(--surface-elevated)`,color:`var(--surface-elevated-foreground)`},M=`flex items-center justify-between gap-3 border-b border-[var(--surface-subtle)] px-3 py-2.5`,N=`text-xs font-medium leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,re=`text-xs tabular-nums leading-4 text-muted-foreground md:text-[0.8125rem] md:leading-5`,P=`m-0 list-none divide-y divide-[var(--surface-subtle)] p-0`,F=`${P} max-h-[min(22rem,50vh)] overflow-y-auto`,ie=`${P} w-full`,ae={className:`p-0 rounded-none`,maxHeightClass:`max-h-[46vh]`,disableHorizontal:!0},I=`px-2.5 py-1.5 text-xs leading-4 md:py-2 md:text-[0.8125rem] md:leading-5`,oe=`flex min-w-0 items-center gap-1 text-xs leading-4 text-muted-foreground md:gap-1.5 md:text-[0.8125rem] md:leading-5`,se=`min-w-0 truncate text-xs leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,ce=`inline-flex shrink-0 items-center gap-1 text-xs leading-4 tabular-nums text-muted-foreground md:text-[0.8125rem] md:leading-5`,le=`h-3 w-3 shrink-0 md:h-3.5 md:w-3.5`,ue={in_progress:`text-foreground`,pending:`text-foreground`,completed:`text-muted-foreground line-through`,cancelled:`text-muted-foreground line-through`},L={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},R=e=>{let t=(0,k.c)(26),{todo:n,isActive:r,activeRef:i}=e,{t:a}=d(),o=z.has(n.status)?n.status:`pending`,s=L[o],c;t[0]!==a||t[1]!==s?(c=a(s),t[0]=a,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]===o?u=t[4]:(u=o===`in_progress`?(0,A.jsx)(p,{name:`record-circle`,className:`h-3.5 w-3.5 text-[var(--status-info)]`,"aria-hidden":`true`}):o===`completed`?(0,A.jsx)(p,{name:`checkbox-circle`,className:`h-3.5 w-3.5 text-[var(--status-success)]`,"aria-hidden":`true`}):(0,A.jsx)(p,{name:`time`,className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),t[3]=o,t[4]=u);let m=u,v=r?`step`:void 0,y=r&&`bg-[var(--surface-muted)] before:absolute before:inset-y-2 before:left-0 before:w-0.5 before:rounded-full before:bg-[var(--status-info)]`,b;t[5]===y?b=t[6]:(b=f(`group relative grid min-w-0 grid-cols-[1rem_minmax(0,1fr)] items-start gap-2.5`,I,y),t[5]=y,t[6]=b);let x;t[7]!==m||t[8]!==l?(x=(0,A.jsx)(h,{asChild:!0,children:(0,A.jsx)(`span`,{className:`flex size-4 items-center justify-center`,"aria-label":l,children:m})}),t[7]=m,t[8]=l,t[9]=x):x=t[9];let S;t[10]===l?S=t[11]:(S=(0,A.jsx)(g,{side:`left`,sideOffset:6,children:l}),t[10]=l,t[11]=S);let C;t[12]!==x||t[13]!==S?(C=(0,A.jsxs)(_,{children:[x,S]}),t[12]=x,t[13]=S,t[14]=C):C=t[14];let w=ue[o],T;t[15]===w?T=t[16]:(T=f(`block whitespace-normal break-words`,w),t[15]=w,t[16]=T);let E;t[17]!==T||t[18]!==n.content?(E=(0,A.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,A.jsx)(`span`,{className:T,children:n.content})}),t[17]=T,t[18]=n.content,t[19]=E):E=t[19];let D;return t[20]!==i||t[21]!==E||t[22]!==v||t[23]!==b||t[24]!==C?(D=(0,A.jsxs)(`li`,{ref:i,"aria-current":v,className:b,children:[C,E]}),t[20]=i,t[21]=E,t[22]=v,t[23]=b,t[24]=C,t[25]=D):D=t[25],D},z=new Set([`in_progress`,`pending`,`completed`,`cancelled`]),B=`image/png`,V=c(`OpenChamberMedia`),H=e=>{let t=e.toLowerCase().split(`;`)[0]?.trim()||B;if(t===`image/jpeg`||t===`image/jpg`)return`jpg`;if(t===`image/webp`)return`webp`;if(t===`image/gif`)return`gif`;if(t===`image/svg+xml`)return`svg`;if(t===`image/png`)return`png`;let n=t.split(`/`)[1];return n&&/^[a-z0-9.+-]+$/i.test(n)?n:`png`},U=(e,t)=>{let n=`image.${H(t)}`,r=(((e||``).trim()||n).split(/[\\/]/).pop()||n).replace(/[^\w.\- ()[\]]+/g,`_`).replace(/^\.+/,``);return r?/\.[a-z0-9]{1,8}$/i.test(r)?r:`${r}.${H(t)}`:n},W=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result==`string`){t(r.result);return}n(Error(`Failed to encode image`))},r.onerror=()=>n(r.error??Error(`Failed to encode image`)),r.readAsDataURL(e)}),de=async e=>{let t=await W(e),n=t.indexOf(`,`);return n>=0?t.slice(n+1):t},fe=(e,t)=>{let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)},G=async(e,t)=>{let n=await fetch(e,{signal:t,cache:`no-store`});if(!n.ok)throw Error(`Image fetch failed (${n.status})`);return n.blob()},pe=async(e,t=B)=>{if(!e.naturalWidth||!e.naturalHeight)return null;let n=e.currentSrc||e.src;if(n&&(/^(?:blob:|data:|openchamber-asset:)/i.test(n)||/^https?:/i.test(n)||/^\/api(?=\/|[?#]|$)/.test(n)))try{let e=await G(n);if(e.size>0)return e}catch{}try{let n=document.createElement(`canvas`);n.width=e.naturalWidth,n.height=e.naturalHeight;let r=n.getContext(`2d`);if(!r)return null;r.drawImage(e,0,0);let i=t.startsWith(`image/`)?t:B,a=await new Promise(e=>{n.toBlob(t=>e(t),i===`image/jpg`?`image/jpeg`:i)});return a&&a.size>0?a:null}catch{return null}},me=async(e,t)=>{let n=``;try{return n=await S(e,t??new AbortController().signal),await G(n,t)}finally{n&&C(n)}},he=async(e,t)=>{let n=e.effectiveDirectory??``,i=null;e.prefetchedBlob&&e.prefetchedBlob.size>0&&(i=e.prefetchedBlob);let a=e.displayUrl?.trim();if(!i&&a)try{i=await G(a,t)}catch{i=null}if(!i){let a=e.sourceUrl.trim();if(!a)throw Error(`Image source is empty`);if(/^(?:data|blob):/i.test(a)||/^https?:/i.test(a)||/^\/api(?=\/|[?#]|$)/.test(a))i=await G(a,t);else{let e=y(a,n);if(x(e))try{i=await me(e.path,t)}catch{let n=await r(`/api/fs/raw`,{method:`GET`,cache:`no-store`,query:{path:e.path},signal:t});if(!n.ok)throw Error(`Image source request failed with status ${n.status}`);i=await n.blob()}else i=await G(e.source,t)}}if(!i||i.size<=0)throw Error(`Image is empty`);let o=(e.mimeType||(i.type&&i.type.startsWith(`image/`)?i.type:``)||B).split(`;`)[0].trim()||B;return{blob:i,filename:U(e.filename,o),mimeType:o}},ge=()=>!s()||l===void 0?!1:l.isPluginAvailable(`OpenChamberMedia`),_e=async(e,t)=>{let{blob:r,filename:a,mimeType:o}=await he(e,t);if(ge()){let e=await de(r);return await V.saveImage({dataBase64:e,mimeType:o,filename:a}),`saved`}if(n()){let e=i()?.vscode;if(e?.saveImage){let t=await W(r);return await e.saveImage({fileName:a,dataUrl:t}),`saved`}}return fe(r,a),`downloaded`},ve=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`),ye=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,K=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=ye(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},be=e=>`<pre><code>${ve(e)}</code></pre>`,xe=e=>{let t=(0,k.c)(21),{code:n,language:r,className:i,style:a,codeStyle:o,wrap:s}=e,c=s!==void 0&&s,{currentTheme:l}=v(),u=O.useRef(null),d;t[0]===l?d=t[1]:(d=b(l),t[0]=l,t[1]=d);let p=d,m,h;t[2]!==n||t[3]!==o||t[4]!==c?(m=()=>{let e=u.current;e&&(e.innerHTML=be(n),K(e,c,o))},h=[n,c,o],t[2]=n,t[3]=o,t[4]=c,t[5]=m,t[6]=h):(m=t[5],h=t[6]),O.useLayoutEffect(m,h);let g,_;t[7]!==n||t[8]!==o||t[9]!==r||t[10]!==c?(g=()=>{let e=u.current;if(!e)return;let t=!0,i=new AbortController;return te(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,K(e,c,o))}),()=>{t=!1,i.abort()}},_=[n,r,c,o],t[7]=n,t[8]=o,t[9]=r,t[10]=c,t[11]=g,t[12]=_):(g=t[11],_=t[12]),O.useEffect(g,_);let y;t[13]===i?y=t[14]:(y=f(`typography-code`,i),t[13]=i,t[14]=y);let x=p,S;t[15]!==a||t[16]!==x?(S={...x,...a},t[15]=a,t[16]=x,t[17]=S):S=t[17];let C;return t[18]!==y||t[19]!==S?(C=(0,A.jsx)(`div`,{ref:u,className:y,style:S}),t[18]=y,t[19]=S,t[20]=C):C=t[20],C},Se=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},Ce=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},we=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,Te=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,Ee=(e,t)=>!e||typeof e!=`object`?String(e):T(e,t||``),q=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},De=e=>{if(!e||typeof e!=`object`)return;let t=q(e.patch)??q(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=q(e.patch)??q(e.diff);if(t)return t}},Oe=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},ke=(e,t,n)=>{let r=Se(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&we(r)&&(r=Te(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=De(n);if(e)return e}return r},Ae=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
|
|
2
|
-
`).split(`
|
|
3
|
-
`),r=e=>/\(\s*File has more lines\..*offset.*\)/i.test(e.trim());return{type:t,lines:n.map(e=>{let n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);if(t!==`directory`){let t=e.match(/^(\d+):\s?(.*)$/);if(t){let e=t[2],n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);return{lineNumber:i?null:Number(t[1]),text:e,isInfo:i}}}return{lineNumber:null,text:e,isInfo:i}}).filter((e,t,n)=>{if(e.text.trim().length>0)return!0;let r=n[t-1],i=n[t+1],a=!!(r?.isInfo||i?.isInfo),o=e.lineNumber!==null;return!(a&&o)})}},je=(e,n)=>{try{let r=e.trim().split(`
|
|
4
|
-
`).filter(Boolean);if(r.length===0)return null;let i=[];return r.forEach(e=>{let t=e.match(/^(\s*)(.+)$/);if(t){let[,e,n]=t,r=Math.floor(e.length/2),a=!n.endsWith(`/`);i.push({name:n.replace(/\/$/,``),depth:r,isFile:a})}}),(0,A.jsx)(`div`,{className:f(`w-full min-w-0 font-mono space-y-0.5`,n?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:t.tool.popup,children:i.map((e,t)=>(0,A.jsx)(`div`,{className:`min-w-0`,style:{paddingLeft:`${e.depth*20}px`},children:e.isFile?(0,A.jsx)(`span`,{className:`text-foreground/90 block truncate`,children:e.name}):(0,A.jsxs)(`span`,{className:`font-semibold text-foreground block truncate`,children:[e.name,`/`]})},t))})}catch{return null}},Me={backgroundColor:`var(--status-info)`,opacity:.6},Ne=(e,n,r)=>{try{let i=e.trim().split(`
|
|
5
|
-
`).filter(Boolean);if(i.length===0)return null;let a={};return i.forEach(e=>{let t=e.match(/^(.+?):(\d+):(.*)$/)||e.match(/^(.+?):(.*)$/);if(t){let[,e,n,r]=t,i=r===void 0?``:n,o=r===void 0?n:r;a[e]||(a[e]=[]),a[e].push({lineNum:i,content:o})}}),(0,A.jsxs)(`div`,{className:f(`space-y-2 w-full min-w-0`,r?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:t.tool.popup,children:[(0,A.jsxs)(`div`,{className:`typography-meta text-muted-foreground mb-2`,children:[`Found `,i.length,` match`,i.length===1?``:`es`]}),Object.entries(a).map(([e,t])=>(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(`div`,{className:f(`font-medium text-muted-foreground`,n?`typography-micro`:`typography-code`),children:e}),(0,A.jsx)(`div`,{className:`pl-4 space-y-1`,children:t.map((e,t)=>!e.lineNum&&!e.content?null:(0,A.jsxs)(`div`,{className:f(`flex items-start gap-2 min-w-0`,n?`typography-micro`:`typography-code`),children:[(0,A.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 mt-1.5`,style:Me}),(0,A.jsxs)(`div`,{className:`flex gap-2 min-w-0 flex-1`,children:[e.lineNum&&(0,A.jsxs)(`span`,{className:`text-muted-foreground font-mono whitespace-nowrap`,children:[`Line `,e.lineNum,`:`]}),(0,A.jsx)(`span`,{className:`text-foreground font-mono break-words flex-1`,children:e.content||`\xA0`})]})]},t))})]},e))]})}catch{return null}},Pe={backgroundColor:`var(--status-info)`,opacity:.6},Fe=(e,n,r)=>{try{let i=e.trim().split(`
|
|
6
|
-
`).filter(Boolean);if(i.length===0)return null;let a={};i.forEach(e=>{let t=e.lastIndexOf(`/`),n=t>0?e.substring(0,t):`/`,r=t>=0?e.substring(t+1):e;a[n]||(a[n]=[]),a[n].push(r)});let o=Object.keys(a).sort();return(0,A.jsxs)(`div`,{className:f(`space-y-2 w-full min-w-0`,r?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:t.tool.popup,children:[(0,A.jsxs)(`div`,{className:`typography-meta text-muted-foreground mb-2`,children:[`Found `,i.length,` file`,i.length===1?``:`s`]}),o.map(e=>(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:f(`font-medium text-muted-foreground`,n?`typography-micro`:`typography-code`),children:[e,`/`]}),(0,A.jsx)(`div`,{className:f(`pl-4 grid gap-1`,n?`grid-cols-1`:`grid-cols-2`),children:a[e].sort().map(e=>(0,A.jsxs)(`div`,{className:f(`flex items-center gap-2 min-w-0`,n?`typography-micro`:`typography-code`),children:[(0,A.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:Pe}),(0,A.jsx)(`span`,{className:`text-foreground font-mono truncate`,children:e})]},e))})]},e))]})}catch{return null}},Ie=new Set([`in_progress`,`pending`,`completed`,`cancelled`]),Le=(e,t,n)=>{try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let r=t.filter(e=>!!e&&typeof e==`object`&&typeof e.content==`string`&&typeof e.status==`string`&&Ie.has(e.status));if(r.length===0)return null;let i=r.find(e=>e.status===`in_progress`)??null;return(0,A.jsx)(`ul`,{className:n?.listClassName??F,children:r.map((e,t)=>(0,A.jsx)(R,{todo:e,isActive:e===i},e.id??`todo-${t}`))})}catch{return null}},Re=(e,n)=>{try{return(0,A.jsx)(`div`,{className:f(`typography-code max-w-none w-full min-w-0`,n?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/20`),style:t.tool.popup,children:(0,A.jsx)(w,{content:e,variant:`tool`})})}catch{return null}},ze=e=>{let t=e.split(`
|
|
7
|
-
`),n=``,r=[],i=0;for(;i<t.length;){let e=t[i];if(e.startsWith(`Index:`)||e.startsWith(`===`)||e.startsWith(`---`)||e.startsWith(`+++`)){e.startsWith(`Index:`)&&(n=e.split(` `)[1].split(`/`).pop()||`file`),i++;continue}if(e.startsWith(`@@`)){let a=e.match(/@@ -(\d+),\d+ \+(\d+),\d+ @@/),o=a?parseInt(a[1]):0,s=a?parseInt(a[2]):0,c=[],l=o,u=s,d=i+1;for(;d<t.length&&!t[d].startsWith(`@@`)&&!t[d].startsWith(`Index:`);){let e=t[d];e.startsWith(`+`)?(c.push({type:`added`,lineNumber:u,content:e.substring(1)}),u++):e.startsWith(`-`)?(c.push({type:`removed`,lineNumber:l,content:e.substring(1)}),l++):e.startsWith(` `)&&(c.push({type:`context`,lineNumber:u,content:e.substring(1)}),l++,u++),d++}r.push({file:n,oldStart:o,newStart:s,lines:c}),i=d;continue}i++}return r},Be=(e,t,n)=>E(t,e,n),Ve={maxDepth:50,maxNodes:1e5,initiallyExpandedDepth:2};function He(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e==`object`?`object`:typeof e==`string`?`string`:typeof e==`number`?`number`:typeof e==`boolean`?`boolean`:`null`}function Ue(e){if(e.length===0)return`root`;let t=`root`;for(let n of e)/^\d+$/.test(n)?t+=`[${n}]`:t+=`.${n}`;return t}var J=0;function Y(e,t,n,r,i){if(J>=i.maxNodes)return null;J++;let a=He(e),o=Ue(n),s=a===`object`||a===`array`,c={id:o,key:t,value:e,type:a,depth:r,path:n,isExpandable:s};if(s&&r<i.maxDepth){let t=a===`array`?e.map((e,t)=>[String(t),e]):Object.entries(e);c.childCount=t.length,c.children=[];for(let[e,a]of t){let t=Y(a,e,[...n,e],r+1,i);t&&c.children.push(t)}}else s&&(c.childCount=a===`array`?e.length:Object.keys(e).length);return c}function We(e,t){let n={...Ve,...t};J=0;try{let t=e.trim();return t?Y(JSON.parse(t),`root`,[],0,n):null}catch{return null}}function X(e,t){if(!e)return[];let n=[];function r(e){let i=!t.has(e.id);if(n.push({node:e,isExpanded:i}),e.isExpandable&&i&&e.children)for(let t of e.children)r(t)}return r(e),n}function Ge(e){if(!e)return[];let t=[];function n(e){if(e.isExpandable&&(t.push(e.id),e.children))for(let t of e.children)n(t)}return n(e),t}function Ke(e,t){if(!e)return[];let n=[];function r(e){if(e.isExpandable&&e.depth>=t&&n.push(e.id),e.children)for(let t of e.children)r(t)}return r(e),n}var Z=[`var(--syntax-key)`,`color-mix(in oklch, var(--syntax-key) 85%, var(--syntax-string))`,`color-mix(in oklch, var(--syntax-key) 70%, var(--syntax-number))`,`color-mix(in oklch, var(--syntax-key) 55%, var(--syntax-function))`,`color-mix(in oklch, var(--syntax-key) 40%, var(--syntax-type))`,`color-mix(in oklch, var(--syntax-key) 30%, var(--syntax-keyword))`];function qe(e){return Z[e%Z.length]}function Je(e){switch(e.type){case`string`:return`var(--syntax-string)`;case`number`:return`var(--syntax-number)`;case`boolean`:return`var(--syntax-keyword)`;case`null`:return`var(--syntax-comment)`;default:return`var(--surface-foreground)`}}function Q(e){switch(e.type){case`string`:{let t=e.value;return t.length>60?`"${t.slice(0,57)}..."`:`"${t}"`}case`number`:case`boolean`:return String(e.value);case`null`:return`null`;case`object`:return`{${e.childCount??0} ${e.childCount===1?`item`:`items`}}`;case`array`:return`[${e.childCount??0}]`;default:return String(e.value)}}function Ye(e){if(e.type===`object`){let t=e.children?.map(e=>e.key).slice(0,3)??[],n=(e.childCount??0)>3?`, ...`:``;return`{ ${t.map(e=>`"${e}": ...`).join(`, `)}${n} }`}if(e.type===`array`){let t=e.childCount??0;return t<=3?`[${e.children?.map(e=>Q(e)).join(`, `)??``}]`:`[${t} items]`}return Q(e)}var $=O.memo(e=>{let t=(0,k.c)(29),{flatNode:n,onToggle:r,onCopyPath:i}=e,{node:a,isExpanded:o}=n,s=a.depth*20,c;t[0]!==a.id||t[1]!==r?(c=()=>{r(a.id)},t[0]=a.id,t[1]=r,t[2]=c):c=t[2];let l=c,u;t[3]!==a.id||t[4]!==i?(u=e=>{i&&(e.preventDefault(),i(a.id))},t[3]=a.id,t[4]=i,t[5]=u):u=t[5];let d=u,f;t[6]===a.depth?f=t[7]:(f=qe(a.depth),t[6]=a.depth,t[7]=f);let m=f,h;t[8]===a?h=t[9]:(h=Je(a),t[8]=a,t[9]=h);let g=h,_=a.isExpandable&&a.children&&a.children.length>0,v=`${s+8}px`,y;t[10]===v?y=t[11]:(y={paddingLeft:v},t[10]=v,t[11]=y);let b;t[12]!==l||t[13]!==_||t[14]!==o?(b=_?(0,A.jsx)(`button`,{type:`button`,onClick:l,className:`mr-1 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm hover:bg-[var(--interactive-hover)] text-muted-foreground`,children:o?(0,A.jsx)(p,{name:`arrow-down-s`,className:`h-3 w-3`}):(0,A.jsx)(p,{name:`arrow-right-s`,className:`h-3 w-3`})}):(0,A.jsx)(`span`,{className:`mr-1 w-4`}),t[12]=l,t[13]=_,t[14]=o,t[15]=b):b=t[15];let x;t[16]!==m||t[17]!==a.key?(x=a.key!==`root`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`mr-1 font-semibold`,style:{color:m},children:/^\d+$/.test(a.key)?a.key:`"${a.key}"`}),(0,A.jsx)(`span`,{className:`mr-1 text-[var(--surface-foreground)]`,children:`:`})]}),t[16]=m,t[17]=a.key,t[18]=x):x=t[18];let S;t[19]!==o||t[20]!==a||t[21]!==g?(S=a.isExpandable?o?(0,A.jsx)(`span`,{className:`text-[var(--surface-foreground)]`,children:a.type===`object`?`{`:`[`}):(0,A.jsx)(`span`,{style:{color:`var(--surface-mutedForeground)`},children:Ye(a)}):(0,A.jsx)(`span`,{style:{color:g},children:Q(a)}),t[19]=o,t[20]=a,t[21]=g,t[22]=S):S=t[22];let C;return t[23]!==d||t[24]!==y||t[25]!==b||t[26]!==x||t[27]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center py-0.5 px-2 hover:bg-[var(--surface-hover)] rounded-sm cursor-default font-mono text-xs leading-5 whitespace-nowrap`,style:y,onContextMenu:d,children:[b,x,S]}),t[23]=d,t[24]=y,t[25]=b,t[26]=x,t[27]=S,t[28]=C):C=t[28],C});$.displayName=`JsonRow`;var Xe=200,Ze=22,Qe=O.forwardRef(function({data:e,className:t,maxHeight:n=`100%`,initiallyExpandedDepth:r=2,onCopyPath:i},a){let o=O.useMemo(()=>{try{return JSON.stringify(e)}catch{return null}},[e]),s=O.useMemo(()=>o?We(o):null,[o]),[c,l]=O.useState(()=>s?new Set(Ke(s,r)):new Set),u=O.useMemo(()=>X(s,c),[s,c]),d=u.length>Xe,f=O.useRef(null),p=D({count:u.length,enabled:d,getScrollElement:()=>f.current,estimateSize:()=>Ze,overscan:20,getItemKey:e=>u[e]?.node.id??e}),m=O.useCallback(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=O.useCallback(()=>{l(new Set)},[]),g=O.useCallback(()=>{s&&l(new Set(Ge(s)))},[s]);return O.useImperativeHandle(a,()=>({expandAll:h,collapseAll:g}),[h,g]),s?d?(0,A.jsx)(`div`,{ref:f,className:t,style:{maxHeight:n,overflow:`auto`},children:(0,A.jsx)(`div`,{style:{height:p.getTotalSize(),position:`relative`},children:p.getVirtualItems().map(e=>{let t=u[e.index];return t?(0,A.jsx)(`div`,{"data-index":e.index,ref:p.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,A.jsx)($,{flatNode:t,onToggle:m,onCopyPath:i})},t.node.id):null})})}):(0,A.jsx)(`div`,{ref:f,className:t,style:{maxHeight:n,overflow:`auto`},children:u.map(e=>(0,A.jsx)($,{flatNode:e,onToggle:m,onCopyPath:i},e.node.id))}):null}),$e=e=>{let t=(0,k.c)(12),{mode:n,onModeChange:r,className:i}=e,a;t[0]!==n||t[1]!==r?(a=e=>{e.stopPropagation(),r(n===`side-by-side`?`unified`:`side-by-side`)},t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]===i?s=t[4]:(s=f(`h-5 w-5 p-0 opacity-60 hover:opacity-100`,i),t[3]=i,t[4]=s);let c=n===`side-by-side`?`Switch to unified view`:`Switch to side-by-side view`,l;t[5]===n?l=t[6]:(l=n===`side-by-side`?(0,A.jsx)(p,{name:`align-justify`,className:`h-3 w-3`}):(0,A.jsx)(p,{name:`layout-column`,className:`h-3 w-3`}),t[5]=n,t[6]=l);let u;return t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,A.jsx)(m,{size:`sm`,variant:`ghost`,className:s,onClick:o,title:c,children:l}),t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u},et=(e,t)=>{let n=(0,k.c)(4),[r,i]=O.useState(null),a,o;return n[0]!==e||n[1]!==t?(a=()=>{let n=!0,r=new AbortController;return i(null),ee(e,(t||`text`).toLowerCase(),{signal:r.signal,priority:`visible`}).then(e=>{n&&i(e)}),()=>{n=!1,r.abort()}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),O.useEffect(a,o),r};export{ce as A,N as C,oe as D,j as E,ae as M,le as O,re as S,I as T,pe as _,Be as a,ne as b,ze as c,Ne as d,je as f,xe as g,Oe as h,Ce as i,ie as j,se as k,Ae as l,Re as m,$e as n,ke as o,Le as p,Qe as r,Ee as s,et as t,Fe as u,_e as v,F as w,M as x,R as y};
|