tarsk 0.5.75 → 0.5.76
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/public/assets/{account-view-DvyhZGLB.js → account-view-CWtpznW2.js} +1 -1
- package/dist/public/assets/browser-tab-D_5MLhxE.js +12 -0
- package/dist/public/assets/chat-dock-context-8K8Ikjgy.js +1 -0
- package/dist/public/assets/{commit-dialog-BUfbvG6F.js → commit-dialog-CSXPoomw.js} +1 -1
- package/dist/public/assets/{commit-error-dialog-D1XRPBOc.js → commit-error-dialog-CdcGI69P.js} +1 -1
- package/dist/public/assets/{commit-method-fields-CVQjrJ_O.js → commit-method-fields-BtEHb0_G.js} +1 -1
- package/dist/public/assets/{conversation-history-view-CzRrC6cJ.js → conversation-history-view-CuzU9qF6.js} +1 -1
- package/dist/public/assets/{create-project-dialog-Bqm_qC2v.js → create-project-dialog-a6Wgq-Z8.js} +1 -1
- package/dist/public/assets/{create-repo-dialog-D2H1eZic.js → create-repo-dialog-BTIQ5Nw4.js} +1 -1
- package/dist/public/assets/{diff-view-zXlCXzER.js → diff-view-DA1uT9tc.js} +2 -2
- package/dist/public/assets/{explorer-tab-view-BOc5FPFg.js → explorer-tab-view-CewTYYOm.js} +2 -2
- package/dist/public/assets/explorer-tree-C0VDhihz.js +1 -0
- package/dist/public/assets/{explorer-view-DFjt0DXO.js → explorer-view-RCfDm3p5.js} +2 -2
- package/dist/public/assets/{git-history-dialog-CFoZcBB0.js → git-history-dialog-DL0Trxiz.js} +1 -1
- package/dist/public/assets/index-B3-5kIOf.js +3658 -0
- package/dist/public/assets/merged-pr-dialog-BzND8nzx.js +1 -0
- package/dist/public/assets/{model-list-controls-CNrps9Ys.js → model-list-controls-I67L2x3H.js} +1 -1
- package/dist/public/assets/onboarding-dialog-DY8v11hv.js +1 -0
- package/dist/public/assets/{project-coding-view-DG1D8-z4.js → project-coding-view-DxOwsjtt.js} +1 -1
- package/dist/public/assets/project-danger-zone-view-CkvKOQrl.js +1 -0
- package/dist/public/assets/{project-env-vars-view-TblkryyN.js → project-env-vars-view-DYLWA7s0.js} +1 -1
- package/dist/public/assets/{project-model-aliases-view-Ct0v4NQm.js → project-model-aliases-view-DWu9khLA.js} +1 -1
- package/dist/public/assets/{project-settings-view-Dd3QPujg.js → project-settings-view-DJfmaWn6.js} +1 -1
- package/dist/public/assets/{project-tools-view-DdsKSUDp.js → project-tools-view-BEjBkghz.js} +1 -1
- package/dist/public/assets/providers-list-view-jMEPJCci.js +1 -0
- package/dist/public/assets/{pull-request-dialog-BRiR5Qz8.js → pull-request-dialog-B_JCqT53.js} +1 -1
- package/dist/public/assets/{pull-with-changes-dialog-BCIWOzvE.js → pull-with-changes-dialog-V3_km2zQ.js} +1 -1
- package/dist/public/assets/{push-before-pr-dialog-BEr0QZlO.js → push-before-pr-dialog-CarrD3y2.js} +1 -1
- package/dist/public/assets/{settings-general-view-CKvkG8C5.js → settings-general-view-BhrfHGfQ.js} +1 -1
- package/dist/public/assets/{settings-list-B9a61wMg.js → settings-list-DiiYzOxn.js} +1 -1
- package/dist/public/assets/{settings-logs-view-4Uoa1-Dx.js → settings-logs-view-DbKM1SNk.js} +2 -2
- package/dist/public/assets/settings-mcp-servers-view-4FpPIeYV.js +5 -0
- package/dist/public/assets/{settings-models-view-Ef404r4H.js → settings-models-view-CJVeo9ad.js} +1 -1
- package/dist/public/assets/settings-skills-view-DoRPGbHG.js +3 -0
- package/dist/public/assets/{settings-slack-view-C32in2Wg.js → settings-slack-view-Cc1NgVkx.js} +1 -1
- package/dist/public/assets/settings-slash-commands-view-CmlWqqmi.js +1 -0
- package/dist/public/assets/{settings-statistics-view-CxW2KB56.js → settings-statistics-view-DRuyEbcN.js} +1 -1
- package/dist/public/assets/settings-storage-view-DihbtUYb.js +1 -0
- package/dist/public/assets/{settings-subagents-view-StdmEn-E.js → settings-subagents-view-B2RvxDZI.js} +2 -2
- package/dist/public/assets/{settings-system-prompt-view-DizAjXjo.js → settings-system-prompt-view-CvVbgjNN.js} +1 -1
- package/dist/public/assets/settings-view-CPUAjTMa.js +2 -0
- package/dist/public/assets/tasks-view-CvFFLPeD.js +1 -0
- package/dist/public/assets/{terminal-panel-DSfDZzBk.js → terminal-panel-DIh6it7K.js} +1 -1
- package/dist/public/assets/{use-active-dock-panel-instance-DNExGWVs.js → use-active-dock-panel-instance-DRfRj6MV.js} +1 -1
- package/dist/public/assets/{use-installed-ai-files-BuuVI3sM.js → use-installed-ai-files-C8nNWGC7.js} +1 -1
- package/dist/public/assets/{useBaseQuery-GJoj38pA.js → useBaseQuery-34f0-SVd.js} +1 -1
- package/dist/public/assets/{web-DyYrh5r4.js → web-Bn9n5e7r.js} +1 -1
- package/dist/public/assets/{web-CliOgvKf.js → web-C2KGFouM.js} +1 -1
- package/dist/public/assets/{web-Dzci4edU.js → web-Dk3GAfTy.js} +1 -1
- package/dist/public/assets/{web-BmpJHrzY.js → web-DycfRH4j.js} +1 -1
- package/dist/public/index.html +3 -3
- package/package.json +1 -1
- package/dist/public/assets/browser-tab-5rqpwS93.js +0 -12
- package/dist/public/assets/chat-dock-context-BJNNRoZC.js +0 -1
- package/dist/public/assets/explorer-tree-m1u3VhWL.js +0 -1
- package/dist/public/assets/index-u8UbWjXL.js +0 -3658
- package/dist/public/assets/merged-pr-dialog-BMqHRow2.js +0 -1
- package/dist/public/assets/onboarding-dialog-BFJftu2O.js +0 -1
- package/dist/public/assets/project-danger-zone-view-6HEDGyUj.js +0 -1
- package/dist/public/assets/providers-list-view-BUNk2E8O.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-CaAy6iV4.js +0 -5
- package/dist/public/assets/settings-skills-view-DLrG4E_U.js +0 -3
- package/dist/public/assets/settings-slash-commands-view-CpBMV_5D.js +0 -1
- package/dist/public/assets/settings-storage-view-BzT8k6yE.js +0 -1
- package/dist/public/assets/settings-view-CTQgFmjM.js +0 -2
- package/dist/public/assets/tasks-view-z93aMoQp.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{n as i}from"./chat-dock-context-8K8Ikjgy.js";import{Dt as a}from"./dist-CTLFS4dn.js";import{r as o,u as s}from"./button-kWtLAMpB.js";import{Kt as c,Nn as l,Yt as u,i as d,jn as f,q as p,qt as m}from"./dist-c_QADQ5u.js";import{a as h,i as g,n as _,o as v}from"./dist-D-2G8xGB.js";import{t as y}from"./dist-DsmF-KJ-.js";import{t as b}from"./use-toast-xpb5jNtN.js";import{t as x}from"./suspense-resource-BFrb_XJX.js";import{t as S}from"./use-suspense-resource-Dakt9lfT.js";import{a as C,c as w,i as T,n as E,r as D,t as O}from"./alert-dialog-BxMfaLuO.js";import{n as k}from"./explorer-tab-context-BxUVwWQQ.js";import{r as A,t as j}from"./async-loading-fallback-V0EaQ_Kn.js";import{$ as M,En as N,J as P,K as F,Kn as I,Lt as L,On as R,Tn as ee,X as z,Y as B,et as V,fr as te,nt as ne,q as re,wn as ie}from"./index-B3-5kIOf.js";import{a as ae,i as oe,n as se,r as H,t as ce}from"./context-menu-BcM6I0Sx.js";import{t as le}from"./async-error-boundary-BX1G17o9.js";var U=e(n(),1),W=t(),ue=1,de=.9,fe=.8,pe=.17,me=.1,he=.999,ge=.9999,_e=.99,ve=/[\\\/_+.#"@\[\(\{&]/,ye=/[\\\/_+.#"@\[\(\{&]/g,be=/[\s-]/,xe=/[\s-]/g;function Se(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?ue:_e;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Se(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=ue:ve.test(e.charAt(l-1))?(d*=fe,p=e.slice(i,l-1).match(ye),p&&i>0&&(d*=he**+p.length)):be.test(e.charAt(l-1))?(d*=de,m=e.slice(i,l-1).match(xe),m&&i>0&&(d*=he**+m.length)):(d*=pe,i>0&&(d*=he**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=ge)),(d<me&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Se(e,t,n,r,l+1,a+2,o),f*me>d&&(d=f*me)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Ce(e){return e.toLowerCase().replace(xe,` `)}function we(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Se(e,t,Ce(e),Ce(t),0,0,{})}var G=`[cmdk-group=""]`,Te=`[cmdk-group-items=""]`,Ee=`[cmdk-group-heading=""]`,De=`[cmdk-item=""]`,Oe=`${De}:not([aria-disabled="true"])`,ke=`cmdk-item-select`,K=`data-value`,Ae=(e,t,n)=>we(e,t,n),je=U.createContext(void 0),q=()=>U.useContext(je),Me=U.createContext(void 0),Ne=()=>U.useContext(Me),Pe=U.createContext(void 0),Fe=U.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),s=Ke(e),{label:c,children:l,value:u,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,b=d(),x=d(),S=d(),C=U.useRef(null),w=Je();Y(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,T.emit()}},[u]),Y(()=>{w(6,j)},[]);let T=U.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=U.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=s.current?.filter??Ae;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Te);t?t.appendChild(e.parentElement===t?e:e.closest(`${Te} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Te} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${G}[${K}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(K);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(G)?.querySelector(Ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${De}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(Oe)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(K))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(K))}function I(e){let t=M()?.closest(G),n;for(;t&&!n;)t=e>0?We(t,G):Ge(t,G),n=t?.querySelector(Oe);n?T.setState(`value`,n.getAttribute(K)):F(e)}let L=()=>P(N().length-1),R=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):F(1)},ee=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return U.createElement(y.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&R(e);break;case`ArrowDown`:R(e);break;case`p`:case`k`:_&&e.ctrlKey&&ee(e);break;case`ArrowUp`:ee(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(ke);t.dispatchEvent(e)}}}}},U.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:Ze},c),Xe(e,e=>U.createElement(Me.Provider,{value:T},U.createElement(je.Provider,{value:E},e))))}),Ie=U.forwardRef((e,t)=>{let n=d(),r=U.useRef(null),i=U.useContext(Pe),a=q(),o=Ke(e),c=o.current?.forceMount??i?.forceMount;Y(()=>{if(!c)return a.item(n,i?.id)},[c]);let l=qe(n,r,[e.value,e.children,r],e.keywords),u=Ne(),f=Z(e=>e.value&&e.value===l.current),p=Z(e=>c||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);U.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(ke,m),()=>t.removeEventListener(ke,m)},[p,e.onSelect,e.disabled]);function m(){var e,t;h(),(t=(e=o.current).onSelect)==null||t.call(e,l.current)}function h(){u.setState(`value`,l.current,!0)}if(!p)return null;let{disabled:g,value:_,onSelect:v,forceMount:b,keywords:x,...S}=e;return U.createElement(y.div,{ref:s(r,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||a.getDisablePointerSelection()?void 0:h,onClick:g?void 0:m},e.children)}),Le=U.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=d(),c=U.useRef(null),l=U.useRef(null),u=d(),f=q(),p=Z(e=>i||f.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Y(()=>f.group(o),[]),qe(o,c,[e.value,e.heading,l]);let m=U.useMemo(()=>({id:o,forceMount:i}),[i]);return U.createElement(y.div,{ref:s(c,t),...a,"cmdk-group":``,role:`presentation`,hidden:p?void 0:!0},n&&U.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Xe(e,e=>U.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},U.createElement(Pe.Provider,{value:m},e))))}),Re=U.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=U.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:U.createElement(y.div,{ref:s(i,t),...r,"cmdk-separator":``,role:`separator`})}),ze=U.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Ne(),o=Z(e=>e.search),s=Z(e=>e.selectedItemId),c=q();return U.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),U.createElement(y.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Be=U.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=U.useRef(null),o=U.useRef(null),c=Z(e=>e.selectedItemId),l=q();return U.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),U.createElement(y.div,{ref:s(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Xe(e,e=>U.createElement(`div`,{ref:s(o,l.listInnerRef),"cmdk-list-sizer":``},e)))}),Ve=U.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return U.createElement(v,{open:n,onOpenChange:r},U.createElement(h,{container:o},U.createElement(g,{"cmdk-overlay":``,className:i}),U.createElement(_,{"aria-label":e.label,"cmdk-dialog":``,className:a},U.createElement(Fe,{ref:t,...s}))))}),He=U.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?U.createElement(y.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ue=U.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return U.createElement(y.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Xe(e,e=>U.createElement(`div`,{"aria-hidden":!0},e)))}),J=Object.assign(Fe,{List:Be,Item:Ie,Input:ze,Group:Le,Separator:Re,Dialog:Ve,Empty:He,Loading:Ue});function We(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ge(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ke(e){let t=U.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?U.useEffect:U.useLayoutEffect;function X(e){let t=U.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=Ne(),n=()=>e(t.snapshot());return U.useSyncExternalStore(t.subscribe,n,n)}function qe(e,t,n,r=[]){let i=U.useRef(),a=q();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(K,s),i.current=s}),i}var Je=()=>{let[e,t]=U.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ye(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Xe({asChild:e,children:t},n){return e&&U.isValidElement(t)?U.cloneElement(Ye(t),{ref:t.ref},n(t.props.children)):n(t)}var Ze={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Q=r(),Qe=U.forwardRef((e,t)=>{let n=(0,W.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=o(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,Q.jsx)(J,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});Qe.displayName=J.displayName;var $e=U.forwardRef((e,t)=>{let n=(0,W.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]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(p,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),n[3]=a):a=n[3];let s;n[4]===r?s=n[5]:(s=o(`flex h-11 w-full rounded-md bg-transparent py-3 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,r),n[4]=r,n[5]=s);let c;return n[6]!==i||n[7]!==t||n[8]!==s?(c=(0,Q.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[a,(0,Q.jsx)(J.Input,{ref:t,className:s,...i})]}),n[6]=i,n[7]=t,n[8]=s,n[9]=c):c=n[9],c});$e.displayName=J.Input.displayName;var et=U.forwardRef((e,t)=>{let n=(0,W.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=o(`max-h-[300px] overflow-y-auto overflow-x-hidden`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,Q.jsx)(J.List,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});et.displayName=J.List.displayName;var tt=U.forwardRef((e,t)=>{let n=(0,W.c)(4),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=o(a.bodyMuted,`py-6 text-center`),n[0]=r):r=n[0];let i;return n[1]!==e||n[2]!==t?(i=(0,Q.jsx)(J.Empty,{ref:t,className:r,...e}),n[1]=e,n[2]=t,n[3]=i):i=n[3],i});tt.displayName=J.Empty.displayName;var nt=U.forwardRef((e,t)=>{let n=(0,W.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=o(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,Q.jsx)(J.Group,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});nt.displayName=J.Group.displayName;var rt=U.forwardRef((e,t)=>{let n=(0,W.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=o(`-mx-1 h-px bg-divider`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,Q.jsx)(J.Separator,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});rt.displayName=J.Separator.displayName;var it=U.forwardRef((e,t)=>{let n=(0,W.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 s;n[3]===r?s=n[4]:(s=o(o(a.body,`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`),r),n[3]=r,n[4]=s);let c;return n[5]!==i||n[6]!==t||n[7]!==s?(c=(0,Q.jsx)(J.Item,{ref:t,className:s,...i}),n[5]=i,n[6]=t,n[7]=s,n[8]=c):c=n[8],c});it.displayName=J.Item.displayName;var at=e=>{let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(a.compact,`ml-auto tracking-widest text-muted-foreground`,n),t[3]=n,t[4]=i);let s;return t[5]!==r||t[6]!==i?(s=(0,Q.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s};at.displayName=`CommandShortcut`;var ot=100,st=500;function ct(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean)}function lt(e,t){return t.length===0?!0:t.every(t=>e.haystack.includes(t))}function ut(e,t,n){if(t.length===0)return[];let r=[];for(let n of e)if(lt(n,t)&&(r.push(n.node),r.length>=st))break;return r.sort((e,t)=>dt(e,t,n)).slice(0,ot)}function dt(e,t,n){let r=n.trim().toLowerCase(),i=e.name.toLowerCase(),a=t.name.toLowerCase(),o=r?i.startsWith(r):!1;return o===(r?a.startsWith(r):!1)?e.type===t.type?e.path.localeCompare(t.path):e.type===`folder`?-1:1:o?-1:1}function ft(e,t){return n=>{e.current=n,t&&(t.current=n)}}function pt(e){let t=(0,W.c)(41),{items:n,isReady:r,onRequestIndex:i,onOpenChange:s,onSelect:l,inputRef:u}=e,d=r===void 0?!1:r,f=(0,U.useRef)(null),p=(0,U.useRef)(!1),m=(0,U.useRef)(!1),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(``),y=(0,U.useDeferredValue)(_),b;t[0]===i?b=t[1]:(b=function(){m.current||(m.current=!0,i())},t[0]=i,t[1]=b);let x=b,S;t[2]!==y||t[3]!==n?(S=ut(n,ct(y),y),t[2]=y,t[3]=n,t[4]=S):S=t[4];let C=S,w,T;t[5]!==s||t[6]!==_?(w=()=>{let e=_.trim().length>0;g(e),p.current!==e&&(p.current=e,s(e))},T=[s,_],t[5]=s,t[6]=_,t[7]=w,t[8]=T):(w=t[7],T=t[8]),(0,U.useEffect)(w,T);let E;t[9]===s?E=t[10]:(E=function(e){e||v(``),g(e),s(e),e&&requestAnimationFrame(()=>f.current?.focus())},t[9]=s,t[10]=E);let D=E,O;t[11]!==s||t[12]!==l?(O=function(e){l(e),g(!1),s(!1),v(``)},t[11]=s,t[12]=l,t[13]=O):O=t[13];let k=O,A;t[14]===u?A=t[15]:(A=ft(f,u),t[14]=u,t[15]=A);let j;t[16]===x?j=t[17]:(j=e=>{x(),v(e.target.value)},t[16]=x,t[17]=j);let M;t[18]!==_||t[19]!==x||t[20]!==A||t[21]!==j?(M=(0,Q.jsx)(N,{asChild:!0,children:(0,Q.jsx)(`div`,{className:`bg-transparent`,children:(0,Q.jsx)(te,{ref:A,value:_,onPointerDown:x,onChange:j,placeholder:`Search files and folders`,className:`pr-[4px]`})})}),t[18]=_,t[19]=x,t[20]=A,t[21]=j,t[22]=M):M=t[22];let P;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(P=o(a.compact,`py-4`),t[23]=P):P=t[23];let F=d?`No matches found.`:`Indexing files and folders...`,I;t[24]===F?I=t[25]:(I=(0,Q.jsx)(tt,{className:P,children:F}),t[24]=F,t[25]=I);let R;if(t[26]!==k||t[27]!==C){let e;t[29]===k?e=t[30]:(e=e=>(0,Q.jsxs)(it,{value:e.path,onSelect:()=>k(e),className:e.ignored?`opacity-50`:void 0,children:[e.type===`folder`?(0,Q.jsx)(c,{className:`h-4 w-4 text-muted-foreground`}):(0,Q.jsx)(L,{filename:e.name}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate`,children:e.name}),(0,Q.jsx)(`div`,{className:o(a.compact,`truncate text-muted-foreground`),children:e.path})]})]},e.path),t[29]=k,t[30]=e),R=C.map(e),t[26]=k,t[27]=C,t[28]=R}else R=t[28];let z;t[31]===R?z=t[32]:(z=(0,Q.jsx)(nt,{children:R}),t[31]=R,t[32]=z);let B;t[33]!==I||t[34]!==z?(B=(0,Q.jsx)(ee,{align:`start`,side:`bottom`,sideOffset:4,onOpenAutoFocus:mt,className:`w-[var(--radix-popover-trigger-width)] p-0`,children:(0,Q.jsx)(Qe,{shouldFilter:!1,children:(0,Q.jsxs)(et,{children:[I,z]})})}),t[33]=I,t[34]=z,t[35]=B):B=t[35];let V;return t[36]!==D||t[37]!==h||t[38]!==M||t[39]!==B?(V=(0,Q.jsxs)(ie,{open:h,onOpenChange:D,children:[M,B]}),t[36]=D,t[37]=h,t[38]=M,t[39]=B,t[40]=V):V=t[40],V}function mt(e){return e.preventDefault()}function ht(e,t,n){return`explorer-dir:${e}:${t}:${n}`}function gt(e){let t=(0,W.c)(12),{threadId:n,dirPath:r,version:i,children:a}=e,o;t[0]!==r||t[1]!==n||t[2]!==i?(o=ht(n,r,i),t[0]=r,t[1]=n,t[2]=i,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==n?(s=()=>M(n,r).then(_t),t[4]=r,t[5]=n,t[6]=s):s=t[6];let c=S(o,s),l;t[7]!==a||t[8]!==c?(l=a(c),t[7]=a,t[8]=c,t[9]=l):l=t[9];let u;return t[10]===l?u=t[11]:(u=(0,Q.jsx)(Q.Fragment,{children:l}),t[10]=l,t[11]=u),u}function _t(e){return e.entries}function vt(e){let t=(0,W.c)(19),{defaultValue:n,onCommit:r,onCancel:i,level:o,basePadding:s,icon:c}=e,l=(0,U.useRef)(null),u,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{l.current?.focus(),l.current?.select()},d=[],t[0]=u,t[1]=d):(u=t[0],d=t[1]),(0,U.useEffect)(u,d);let f;t[2]!==i||t[3]!==r?(f=function(e){e?r(e):i()},t[2]=i,t[3]=r,t[4]=f):f=t[4];let p=f,m;t[5]!==p||t[6]!==i?(m=function(e){e.key===`Enter`?p(St(l.current)):e.key===`Escape`&&i()},t[5]=p,t[6]=i,t[7]=m):m=t[7];let h=m,g;t[8]===p?g=t[9]:(g=function(){p(St(l.current))},t[8]=p,t[9]=g);let _=g,v;t[10]!==n||t[11]!==_||t[12]!==h?(v=(0,Q.jsx)(`input`,{ref:l,defaultValue:n,onKeyDown:h,onBlur:_,className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`,onClick:yt}),t[10]=n,t[11]=_,t[12]=h,t[13]=v):v=t[13];let y;return t[14]!==s||t[15]!==c||t[16]!==o||t[17]!==v?(y=(0,Q.jsxs)(I,{level:o,basePadding:s,className:a.conversationBody,children:[c,v]}),t[14]=s,t[15]=c,t[16]=o,t[17]=v,t[18]=y):y=t[18],y}function yt(e){return e.stopPropagation()}function bt(e){return e.map(e=>({node:e,haystack:`${e.name} ${e.path}`.toLowerCase()}))}function xt(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t):``}function St(e){return e?.value.trim()??``}function Ct(e,t){let n=e.split(`/`);t&&n.pop();let r=[],i=``;for(let e of n)i=i?`${i}/${e}`:e,r.push(i);return r}function wt(e,t){let n=new Set(e);for(let e of t)n.add(e);return n}function Tt(e,t){let n=new Set(e);return n.delete(t),n}function Et(e,t){let n=t.filter(t=>!e.has(t));if(n.length===0)return e;let r=new Map(e);for(let e of n)r.set(e,0);return r}function Dt(e){let t=new Set([``]);for(let n of e)t.add(n);return t}function Ot(e,t,n){let r=Dt(t),i=new Map(e);for(let t of r){let r=e.get(t)??0;x(ht(n,t,r)),i.set(t,r+1)}return i}function kt(e,t){return e===t||e.startsWith(t+`/`)}function At(e,t){let n=new Set(e);for(let e of n)kt(e,t)&&n.delete(e);return n}function jt(e,t){let n=new Map(e);for(let e of n.keys())kt(e,t)&&n.delete(e);return n}async function $(e,t){try{await e()}catch{b({title:`Error`,description:t,variant:`destructive`})}}function Mt(e){let t=(0,W.c)(13),{node:n,onCommitRename:r,onCancelRename:i}=e,a;t[0]!==n||t[1]!==i||t[2]!==r?(a=function(e){let t=e.trim();t?r(n,t):i()},t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s;t[4]!==o||t[5]!==i?(s=function(e){if(e.key===`Escape`){i();return}e.key===`Enter`&&o(e.target.value)},t[4]=o,t[5]=i,t[6]=s):s=t[6];let c=s,l;t[7]===o?l=t[8]:(l=e=>o(e.target.value),t[7]=o,t[8]=l);let u;return t[9]!==c||t[10]!==n.name||t[11]!==l?(u=(0,Q.jsx)(`input`,{autoFocus:!0,defaultValue:n.name,onKeyDown:c,onBlur:l,onClick:Nt,className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`}),t[9]=c,t[10]=n.name,t[11]=l,t[12]=u):u=t[12],u}function Nt(e){return e.stopPropagation()}function Pt(e,t){return o(a.conversationBody,e.ignored&&`opacity-50`,t&&`bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-primary`)}function Ft(e,t){re(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,t.isDropTarget||t.onFolderDropTargetChange(t.path))}function It(e,t){re(e.dataTransfer)&&(e.currentTarget.contains(e.relatedTarget)||t.isDropTarget&&t.onFolderDropTargetChange(null))}function Lt(e,t){if(!re(e.dataTransfer))return;e.preventDefault(),e.stopPropagation(),t.onFolderDropTargetChange(null);let{files:n,skippedFolders:r}=F(e.dataTransfer);r>0&&b({title:`Folders skipped`,description:`Only files can be copied. Drop individual files instead of folders.`}),n.length>0&&t.onFilesDrop(n,t.path)}function Rt(e){let t=(0,W.c)(27),{node:n,newItemDir:r,onOpen:i,onNewFile:a,onNewFolder:o,onCopyReference:s,onStartRename:c,onDelete:l}=e,u;t[0]!==n||t[1]!==i?(u=(0,Q.jsx)(H,{onSelect:()=>i(n),children:`Open`}),t[0]=n,t[1]=i,t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(oe,{}),t[3]=d):d=t[3];let f;t[4]!==r||t[5]!==a?(f=(0,Q.jsx)(H,{onSelect:()=>a(r),children:`New File...`}),t[4]=r,t[5]=a,t[6]=f):f=t[6];let p;t[7]!==r||t[8]!==o?(p=(0,Q.jsx)(H,{onSelect:()=>o(r),children:`New Folder...`}),t[7]=r,t[8]=o,t[9]=p):p=t[9];let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(oe,{}),t[10]=m):m=t[10];let h;t[11]!==n||t[12]!==s?(h=(0,Q.jsx)(H,{onSelect:()=>s(n),children:`Copy Reference`}),t[11]=n,t[12]=s,t[13]=h):h=t[13];let g;t[14]!==n||t[15]!==c?(g=(0,Q.jsx)(H,{onSelect:()=>c(n),children:`Rename...`}),t[14]=n,t[15]=c,t[16]=g):g=t[16];let _;t[17]!==n||t[18]!==l?(_=(0,Q.jsx)(H,{onSelect:()=>l(n),className:`text-destructive focus:text-destructive`,children:`Delete`}),t[17]=n,t[18]=l,t[19]=_):_=t[19];let v;return t[20]!==u||t[21]!==f||t[22]!==p||t[23]!==h||t[24]!==g||t[25]!==_?(v=(0,Q.jsxs)(se,{children:[u,d,f,p,m,h,g,_]}),t[20]=u,t[21]=f,t[22]=p,t[23]=h,t[24]=g,t[25]=_,t[26]=v):v=t[26],v}function zt(e){let t=(0,W.c)(10),{newItemIn:n,dirPath:r,level:i,onCommitNewItem:a,onCancelNewItem:o}=e;if(!n||n.dirPath!==r)return null;let s=n.type===`folder`,c;t[0]===s?c=t[1]:(c=Vt(s),t[0]=s,t[1]=c);let l;t[2]===s?l=t[3]:(l=Bt(s),t[2]=s,t[3]=l);let u;return t[4]!==i||t[5]!==o||t[6]!==a||t[7]!==c||t[8]!==l?(u=(0,Q.jsx)(vt,{defaultValue:``,level:i,basePadding:c,icon:l,onCommit:a,onCancel:o}),t[4]=i,t[5]=o,t[6]=a,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function Bt(e){return e?(0,Q.jsx)(c,{className:`h-4 w-4 flex-shrink-0`}):(0,Q.jsx)(u,{className:`h-4 w-4 flex-shrink-0 text-muted-foreground`})}function Vt(e){return e?10:22}function Ht(e){let t=(0,W.c)(33),{node:n,level:r,selectedPath:i,expandedPaths:a,renamingPath:o,dropTargetPath:s,onToggleFolder:u,onCommitRename:d,onCancelRename:p,onFolderDropTargetChange:h,onFilesDrop:g}=e,_=a.has(n.path),v=o===n.path,y=s===n.path,b=_?l:f,x=_?m:c,S;t[0]!==y||t[1]!==n.path||t[2]!==g||t[3]!==h?(S={path:n.path,isDropTarget:y,onFolderDropTargetChange:h,onFilesDrop:g},t[0]=y,t[1]=n.path,t[2]=g,t[3]=h,t[4]=S):S=t[4];let C=S,w=i===n.path,T;t[5]!==y||t[6]!==n?(T=Pt(n,y),t[5]=y,t[6]=n,t[7]=T):T=t[7];let E;t[8]!==n||t[9]!==u?(E=e=>{e.stopPropagation(),u(n)},t[8]=n,t[9]=u,t[10]=E):E=t[10];let D,O,k;t[11]===C?(D=t[12],O=t[13],k=t[14]):(D=e=>Ft(e,C),O=e=>It(e,C),k=e=>Lt(e,C),t[11]=C,t[12]=D,t[13]=O,t[14]=k);let A;t[15]===b?A=t[16]:(A=(0,Q.jsx)(`span`,{className:`text-muted-foreground w-3 flex-shrink-0`,children:(0,Q.jsx)(b,{className:`h-3 w-3`})}),t[15]=b,t[16]=A);let j;t[17]!==x||t[18]!==v||t[19]!==n||t[20]!==p||t[21]!==d?(j=v?(0,Q.jsx)(Mt,{node:n,onCommitRename:d,onCancelRename:p}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(x,{className:`h-4 w-4 flex-shrink-0`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate`,children:n.name})]}),t[17]=x,t[18]=v,t[19]=n,t[20]=p,t[21]=d,t[22]=j):j=t[22];let M;return t[23]!==r||t[24]!==w||t[25]!==T||t[26]!==E||t[27]!==D||t[28]!==O||t[29]!==k||t[30]!==A||t[31]!==j?(M=(0,Q.jsxs)(I,{level:r,basePadding:10,selected:w,className:T,onClick:E,onDragOver:D,onDragLeave:O,onDrop:k,children:[A,j]}),t[23]=r,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O,t[29]=k,t[30]=A,t[31]=j,t[32]=M):M=t[32],M}function Ut(e){let t=(0,W.c)(29),{node:n,level:r,threadId:i,expandedPaths:a,getDirVersion:o,newItemIn:s,onOpen:c,onNewFile:l,onNewFolder:u,onCopyReference:d,onStartRename:f,onDelete:p,onCommitNewItem:m,onCancelNewItem:h}=e,g;t[0]!==a||t[1]!==n.path?(g=a.has(n.path),t[0]=a,t[1]=n.path,t[2]=g):g=t[2];let _=g,v;t[3]===e?v=t[4]:(v=(0,Q.jsx)(Ht,{...e}),t[3]=e,t[4]=v);let y;t[5]!==o||t[6]!==_||t[7]!==r||t[8]!==s||t[9]!==n.path||t[10]!==h||t[11]!==m||t[12]!==e||t[13]!==i?(y=_&&(0,Q.jsx)(`div`,{children:(0,Q.jsx)(U.Suspense,{fallback:(0,Q.jsx)(j,{}),children:(0,Q.jsx)(gt,{threadId:i,dirPath:n.path,version:o(n.path),children:t=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(zt,{newItemIn:s,dirPath:n.path,level:r+1,onCommitNewItem:m,onCancelNewItem:h}),t.map(t=>(0,Q.jsx)(Gt,{...e,node:t,level:r+1},t.path))]})})})}),t[5]=o,t[6]=_,t[7]=r,t[8]=s,t[9]=n.path,t[10]=h,t[11]=m,t[12]=e,t[13]=i,t[14]=y):y=t[14];let b;t[15]!==v||t[16]!==y?(b=(0,Q.jsx)(ae,{asChild:!0,children:(0,Q.jsxs)(`div`,{children:[v,y]})}),t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;t[18]!==n||t[19]!==d||t[20]!==p||t[21]!==l||t[22]!==u||t[23]!==c||t[24]!==f?(x=(0,Q.jsx)(Rt,{node:n,newItemDir:n.path,onOpen:c,onNewFile:l,onNewFolder:u,onCopyReference:d,onStartRename:f,onDelete:p}),t[18]=n,t[19]=d,t[20]=p,t[21]=l,t[22]=u,t[23]=c,t[24]=f,t[25]=x):x=t[25];let S;return t[26]!==b||t[27]!==x?(S=(0,Q.jsxs)(ce,{children:[b,x]}),t[26]=b,t[27]=x,t[28]=S):S=t[28],S}function Wt(e){let t=(0,W.c)(33),{node:n,level:r,selectedPath:i,renamingPath:s,onSelectNode:c,onOpen:l,onNewFile:u,onNewFolder:d,onCopyReference:f,onStartRename:p,onDelete:m,onCommitRename:h,onCancelRename:g}=e,_=s===n.path,v=i===n.path,y=n.ignored&&`opacity-50`,b;t[0]===y?b=t[1]:(b=o(a.conversationBody,y),t[0]=y,t[1]=b);let x;t[2]!==n||t[3]!==c?(x=()=>c(n),t[2]=n,t[3]=c,t[4]=x):x=t[4];let S;t[5]===n.name?S=t[6]:(S=(0,Q.jsx)(L,{filename:n.name}),t[5]=n.name,t[6]=S);let C;t[7]!==_||t[8]!==n||t[9]!==g||t[10]!==h?(C=_?(0,Q.jsx)(Mt,{node:n,onCommitRename:h,onCancelRename:g}):(0,Q.jsx)(`span`,{className:`flex-1 truncate`,children:n.name}),t[7]=_,t[8]=n,t[9]=g,t[10]=h,t[11]=C):C=t[11];let w;t[12]!==r||t[13]!==v||t[14]!==b||t[15]!==x||t[16]!==S||t[17]!==C?(w=(0,Q.jsx)(ae,{asChild:!0,children:(0,Q.jsxs)(I,{level:r,basePadding:22,selected:v,className:b,onClick:x,children:[S,C]})}),t[12]=r,t[13]=v,t[14]=b,t[15]=x,t[16]=S,t[17]=C,t[18]=w):w=t[18];let T;t[19]===n.path?T=t[20]:(T=xt(n.path),t[19]=n.path,t[20]=T);let E;t[21]!==n||t[22]!==f||t[23]!==m||t[24]!==u||t[25]!==d||t[26]!==l||t[27]!==p||t[28]!==T?(E=(0,Q.jsx)(Rt,{node:n,newItemDir:T,onOpen:l,onNewFile:u,onNewFolder:d,onCopyReference:f,onStartRename:p,onDelete:m}),t[21]=n,t[22]=f,t[23]=m,t[24]=u,t[25]=d,t[26]=l,t[27]=p,t[28]=T,t[29]=E):E=t[29];let D;return t[30]!==w||t[31]!==E?(D=(0,Q.jsxs)(ce,{children:[w,E]}),t[30]=w,t[31]=E,t[32]=D):D=t[32],D}var Gt=(0,U.memo)(function(e){let t=(0,W.c)(4);if(e.node.type===`folder`){let n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(Ut,{...e}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,Q.jsx)(Wt,{...e}),t[2]=e,t[3]=n),n}),Kt=new Map;function qt(e,t,n){e?(t(e),n(!0)):(t([]),n(!1))}async function Jt(e,t,n){try{let n=bt((await M(e,``,!0)).entries);return Kt.set(t,n),n}catch{return null}finally{n.current===t&&(n.current=null)}}function Yt(e,t){let n=(0,W.c)(26),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],n[0]=r):r=n[0];let[i,a]=(0,U.useState)(r),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(!1),f=(0,U.useRef)(null),p=`${e}:${t}`,m;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>{(0,U.startTransition)(()=>{l(e)})},n[1]=m):m=n[1];let h=m,g;n[2]!==p||n[3]!==e?(g=async()=>{if(!e)return;let t=Kt.get(p);if(t){a(t),s(!0);return}f.current!==p&&(f.current=p,a([]),s(!1),qt(await Jt(e,p,f),a,s))},n[2]=p,n[3]=e,n[4]=g):g=n[4];let _=g,v;n[5]===p?v=n[6]:(v=()=>{Kt.delete(p),a([]),s(!1)},n[5]=p,n[6]=v);let y=v,b;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>{d(!0)},n[7]=b):b=n[7];let x=b,S;n[8]!==y||n[9]!==_||n[10]!==u?(S=()=>{y(),u&&_()},n[8]=y,n[9]=_,n[10]=u,n[11]=S):S=n[11];let C=S,w;n[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{a([]),s(!1),d(!1),f.current=null},n[12]=w):w=n[12];let T;n[13]===p?T=n[14]:(T=[p],n[13]=p,n[14]=T),(0,U.useEffect)(w,T);let E,D;n[15]!==_||n[16]!==u||n[17]!==e?(E=()=>{!u||!e||_()},D=[_,u,e],n[15]=_,n[16]=u,n[17]=e,n[18]=E,n[19]=D):(E=n[18],D=n[19]),(0,U.useEffect)(E,D);let O;return n[20]!==C||n[21]!==o||n[22]!==c||n[23]!==p||n[24]!==i?(O={searchableItems:i,isSearchCacheReady:o,isSearchOpen:c,searchCacheKey:p,onSearchIndexRequest:x,onSearchOpenChange:h,handleExplorerMutation:C},n[20]=C,n[21]=o,n[22]=c,n[23]=p,n[24]=i,n[25]=O):O=n[25],O}function Xt(e,t,n,r,i){let a=(0,W.c)(25),[o,s]=(0,U.useState)(Zt),c=(0,U.useRef)(0),l=(0,U.useRef)(null),u;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{s(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},a[0]=u):u=a[0];let d=u,f;a[1]===o?f=a[2]:(f=e=>o.get(e)??0,a[1]=o,a[2]=f);let p=f,m;a[3]!==p||a[4]!==e?(m=t=>{e&&(x(ht(e,t,p(t))),d(t))},a[3]=p,a[4]=e,a[5]=m):m=a[5];let h=m,g;a[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{s(t=>Et(t,e))},a[6]=g):g=a[6];let _=g,v;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{s(t=>jt(t,e))},a[7]=v):v=a[7];let y=v,b,S;a[8]!==t||a[9]!==e?(b=()=>{if(!e)return;let n=l.current!==null&&l.current!==e;l.current=e,n&&(s(new Map([[``,0]])),c.current=t)},S=[t,e],a[8]=t,a[9]=e,a[10]=b,a[11]=S):(b=a[10],S=a[11]),(0,U.useEffect)(b,S);let C,w;a[12]!==n||a[13]!==t||a[14]!==e?(C=()=>{!e||t<=c.current||(c.current=t,s(t=>Ot(t,n,e)))},w=[t,n,e],a[12]=n,a[13]=t,a[14]=e,a[15]=C,a[16]=w):(C=a[15],w=a[16]),(0,U.useEffect)(C,w);let T,E;a[17]!==i||a[18]!==r||a[19]!==e?(E=()=>{if(!i||!e)return;let t=Ct(i,!0);t.length!==0&&(r(e=>wt(e,t)),s(e=>Et(e,t)))},T=[i,r,e],a[17]=i,a[18]=r,a[19]=e,a[20]=T,a[21]=E):(T=a[20],E=a[21]),(0,U.useEffect)(E,T);let D;return a[22]!==p||a[23]!==h?(D={getDirVersion:p,reloadDir:h,ensureDirVersionsInitialized:_,removeSubtreeVersions:y},a[22]=p,a[23]=h,a[24]=D):D=a[24],D}function Zt(){return new Map([[``,0]])}function Qt(e){let t=(0,W.c)(10),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=new Set,t[0]=n):n=t[0];let[r,i]=(0,U.useState)(n),[a,o]=(0,U.useState)(null),[s,c]=(0,U.useState)(null),[l,u]=(0,U.useState)(null),[d,f]=(0,U.useState)(null),p=(0,U.useRef)(null),m,h;t[1]===e?(m=t[2],h=t[3]):(m=()=>{if(!e)return;let t=p.current!==null&&p.current!==e;p.current=e,t&&(i(new Set),o(null),c(null))},h=[e],t[1]=e,t[2]=m,t[3]=h),(0,U.useEffect)(m,h);let g;return t[4]!==d||t[5]!==r||t[6]!==s||t[7]!==a||t[8]!==l?(g={expandedPaths:r,setExpandedPaths:i,renamingPath:a,setRenamingPath:o,newItemIn:s,setNewItemIn:c,trashTarget:l,setTrashTarget:u,dropTargetPath:d,setDropTargetPath:f},t[4]=d,t[5]=r,t[6]=s,t[7]=a,t[8]=l,t[9]=g):g=t[9],g}function $t(e){let t=(0,W.c)(15),{trashTarget:n,onDismiss:r,onConfirm:i}=e,a=n!==null,o;t[0]===r?o=t[1]:(o=e=>!e&&r(),t[0]=r,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(w,{children:`Move to Trash`}),t[2]=s):s=t[2];let c=n?.name,l;t[3]===c?l=t[4]:(l=(0,Q.jsxs)(C,{children:[`Move “`,c,`” to trash?`]}),t[3]=c,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(D,{children:`Cancel`}),t[5]=u):u=t[5];let d;t[6]===i?d=t[7]:(d=(0,Q.jsxs)(`div`,{className:`flex gap-3 justify-end`,children:[u,(0,Q.jsx)(E,{onClick:i,children:`Move to Trash`})]}),t[6]=i,t[7]=d);let f;t[8]!==l||t[9]!==d?(f=(0,Q.jsxs)(T,{children:[s,l,d]}),t[8]=l,t[9]=d,t[10]=f):f=t[10];let p;return t[11]!==a||t[12]!==o||t[13]!==f?(p=(0,Q.jsx)(O,{open:a,onOpenChange:o,children:f}),t[11]=a,t[12]=o,t[13]=f,t[14]=p):p=t[14],p}function en(e){let t=(0,W.c)(13),{treeCallbacks:n,rootVersion:r,onRetryRoot:i}=e,{threadId:a,newItemIn:o,onCommitNewItem:s,onCancelNewItem:c}=n,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(A,{}),t[0]=l):l=t[0];let u;t[1]!==o||t[2]!==c||t[3]!==s||t[4]!==n?(u=e=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(zt,{newItemIn:o,dirPath:``,level:0,onCommitNewItem:s,onCancelNewItem:c}),e.map(e=>(0,Q.jsx)(Gt,{node:e,level:0,...n},e.path))]}),t[1]=o,t[2]=c,t[3]=s,t[4]=n,t[5]=u):u=t[5];let d;t[6]!==r||t[7]!==u||t[8]!==a?(d=(0,Q.jsx)(U.Suspense,{fallback:l,children:(0,Q.jsx)(gt,{threadId:a,dirPath:``,version:r,children:u})}),t[6]=r,t[7]=u,t[8]=a,t[9]=d):d=t[9];let f;return t[10]!==i||t[11]!==d?(f=(0,Q.jsx)(`div`,{className:`py-2 min-h-full`,children:(0,Q.jsx)(le,{fallbackTitle:`Failed to load files`,onRetry:i,children:d})}),t[10]=i,t[11]=d,t[12]=f):f=t[12],f}function tn(e){let t=(0,W.c)(17),{treeCallbacks:n,rootVersion:r,onRetryRoot:i,isSearchOpen:a}=e,{onNewFile:o,onNewFolder:s}=n,c;t[0]!==i||t[1]!==r||t[2]!==n?(c=(0,Q.jsx)(en,{treeCallbacks:n,rootVersion:r,onRetryRoot:i}),t[0]=i,t[1]=r,t[2]=n,t[3]=c):c=t[3];let l;t[4]!==a||t[5]!==c?(l=(0,Q.jsx)(ae,{asChild:!0,disabled:a,children:c}),t[4]=a,t[5]=c,t[6]=l):l=t[6];let u;t[7]===o?u=t[8]:(u=(0,Q.jsx)(H,{onSelect:()=>o(``),children:`New File...`}),t[7]=o,t[8]=u);let d;t[9]===s?d=t[10]:(d=(0,Q.jsx)(H,{onSelect:()=>s(``),children:`New Folder...`}),t[9]=s,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(se,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,Q.jsxs)(ce,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}function nn({threadId:e,selectedPath:t,onNodeSelect:n,onFilesDrop:r,instanceId:a}){let o=(0,U.useRef)(null),{registerPanelFocus:s}=i(),{explorerRefreshTick:c,pendingExplorerPath:l,setExplorerClearPath:u}=k(),{fetchUnifiedStatus:d}=R(),{expandedPaths:f,setExpandedPaths:p,renamingPath:m,setRenamingPath:h,newItemIn:g,setNewItemIn:_,trashTarget:v,setTrashTarget:y,dropTargetPath:x,setDropTargetPath:S}=Qt(e),{searchableItems:C,isSearchCacheReady:w,isSearchOpen:T,searchCacheKey:E,onSearchIndexRequest:D,onSearchOpenChange:O,handleExplorerMutation:A}=Yt(e,c),{getDirVersion:j,reloadDir:M,ensureDirVersionsInitialized:N,removeSubtreeVersions:F}=Xt(e,c,f,p,l);(0,U.useEffect)(()=>{if(a)return s(a,()=>o.current?.focus())},[a,s]);let I=(0,U.useCallback)(t=>{e&&p(e=>wt(e,Ct(t.path,t.type===`file`)))},[e]);function L(e){f.has(e.path)?p(t=>Tt(t,e.path)):(p(t=>wt(t,[e.path])),N([e.path]))}function ee(e){y(e)}async function te(t){await $(()=>V(e,t.path),`Failed to open "${t.name}"`)}async function re(e){await $(async()=>{await navigator.clipboard.writeText(e.path);let t=b({title:`Copied`,description:`Reference copied to clipboard.`});window.setTimeout(()=>{t.dismiss()},2e3)},`Failed to copy reference for "${e.name}"`)}async function ie(){if(!v)return;let t=v;y(null),await $(async()=>{await z(e,t.path),u(t.path),M(xt(t.path)),A(),d(!0),p(e=>At(e,t.path)),F(t.path)},`Failed to move "${t.name}" to trash`)}function ae(e){_(null),h(e.path)}async function oe(t,n){if(n===t.name){h(null);return}h(null),await $(async()=>{await ne(e,t.path,n),M(xt(t.path)),A(),d(!0),t.type===`folder`&&(p(e=>At(e,t.path)),F(t.path))},`Failed to rename "${t.name}"`)}function se(e){h(null),f.has(e)||(p(t=>wt(t,[e])),N([e]))}function H(e){se(e),_({dirPath:e,type:`file`})}function ce(e){se(e),_({dirPath:e,type:`folder`})}async function le(t){if(!g)return;let{dirPath:n,type:r}=g;_(null),await $(async()=>{r===`file`?await P(e,n,t):await B(e,n,t),M(n),A(),d(!0)},`Failed to create ${r} "${t}"`)}function W(){_(null)}let ue=(0,U.useCallback)((e,t)=>{r?.(e,t)},[r]);function de(e){I(e),e.type===`file`&&n(e)}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($t,{trashTarget:v,onDismiss:()=>y(null),onConfirm:()=>void ie()}),(0,Q.jsx)(`div`,{className:`border-b border-border px-2 py-2`,children:(0,Q.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,Q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Q.jsx)(pt,{items:C,isReady:w,onRequestIndex:D,onOpenChange:O,onSelect:e=>de(e),inputRef:o},E)})})}),(0,Q.jsx)(tn,{treeCallbacks:{threadId:e,selectedPath:t,expandedPaths:f,getDirVersion:j,renamingPath:m,newItemIn:g,onToggleFolder:L,onSelectNode:n,onStartRename:ae,onCommitRename:oe,onCancelRename:()=>h(null),onDelete:ee,onOpen:te,onCopyReference:re,onNewFile:H,onNewFolder:ce,onCommitNewItem:le,onCancelNewItem:W,dropTargetPath:x,onFolderDropTargetChange:S,onFilesDrop:ue},rootVersion:j(``),onRetryRoot:()=>M(``),isSearchOpen:T})]})}export{nn as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/explorer-monaco-editor-BdZ_bBqh.js","assets/rolldown-runtime-aKtaBQYM.js","assets/react-vendor-Ee0-5T4I.js","assets/monaco-setup-DU2h1v3K.js","assets/monaco-lJcjGRXq.js","assets/monaco-BQve5vfS.css","assets/dist-CTLFS4dn.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,r,t as i}from"./react-vendor-Ee0-5T4I.js";import{Dt as a,N as o,Q as s,Z as c}from"./dist-CTLFS4dn.js";import{r as l}from"./store-BSzKIu5G.js";import{r as u,t as d}from"./button-kWtLAMpB.js";import{Ot as f,Pn as p,Qt as m,Zt as h,bn as g,dt as _,on as v,rt as y,tt as b}from"./dist-c_QADQ5u.js";import{Wr as x,ot as ee}from"./api-DX1ny6q-.js";import{t as S}from"./use-toast-xpb5jNtN.js";import{t as C}from"./suspense-resource-BFrb_XJX.js";import{t as w}from"./use-suspense-resource-Dakt9lfT.js";import{n as
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,r,t as i}from"./react-vendor-Ee0-5T4I.js";import{Dt as a,N as o,Q as s,Z as c}from"./dist-CTLFS4dn.js";import{r as l}from"./store-BSzKIu5G.js";import{r as u,t as d}from"./button-kWtLAMpB.js";import{Ot as f,Pn as p,Qt as m,Zt as h,bn as g,dt as _,on as v,rt as y,tt as b}from"./dist-c_QADQ5u.js";import{Wr as x,ot as ee}from"./api-DX1ny6q-.js";import{t as S}from"./use-toast-xpb5jNtN.js";import{t as C}from"./suspense-resource-BFrb_XJX.js";import{t as w}from"./use-suspense-resource-Dakt9lfT.js";import{n as T}from"./explorer-tab-context-BxUVwWQQ.js";import{n as E}from"./async-loading-fallback-V0EaQ_Kn.js";import{$ as D,An as O,J as k,Q as A,Z as j,et as M,ir as N,k as P,qn as te,rr as F,rt as I,tr as L,tt as R,ur as z}from"./index-B3-5kIOf.js";import{t as B}from"./async-error-boundary-BX1G17o9.js";var V=t(),H=e(n(),1),U=i(),W=(0,H.lazy)(function(){return r(()=>import(`./explorer-monaco-editor-BdZ_bBqh.js`),__vite__mapDeps([0,1,2,3,4,5,6]))}),ne=o(`explorer.preview`),re=[{label:`Markdown`,ext:`md`,icon:m},{label:`TypeScript`,ext:`ts`,icon:v},{label:`Text`,ext:`txt`,icon:h}];async function ie(e,t){try{let n=await D(e,``),r=new Set(n.entries.map(e=>e.name)),i=`untitled`,a=`${i}.${t}`,o=2;for(;r.has(a);)a=`${i}${o}.${t}`,o++;return a}catch{return`untitled.${t}`}}function G(e){return s(e)===`md`}function K(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,mdc:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,sh:`shell`,yaml:`yaml`,yml:`yaml`,xml:`xml`,sql:`sql`}[s(e)]??`plaintext`}function q(e,t){return`explorer-file:${e}:${t}`}function J(e){let t=(0,V.c)(11),{threadId:n,path:r,contentKey:i,onContentReady:a}=e,o;t[0]!==r||t[1]!==n?(o=q(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n?(s=async()=>{try{return await A(n,r)}catch(e){let t=e;throw Y(`Failed to load explorer file preview`,{threadId:n,path:r},t),t}},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c=w(o,s),l,u;return t[6]!==i||t[7]!==a||t[8]!==c.content?(l=()=>{a({key:i,content:c.content,original:c.content})},u=[a,c.content,i],t[6]=i,t[7]=a,t[8]=c.content,t[9]=l,t[10]=u):(l=t[9],u=t[10]),(0,H.useLayoutEffect)(l,u),null}function Y(e,t,n){ne.error(e,{...t,error:n})}function X(e,t){return`explorer-media:${e}:${t}`}function Z(e,t){let n=(0,V.c)(11),r;n[0]!==t||n[1]!==e?(r=X(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]!==t||n[4]!==e?(i=async()=>{try{return await j(e,t)}catch(n){let r=n;throw Y(`Failed to load explorer media preview`,{threadId:e,path:t},r),r}},n[3]=t,n[4]=e,n[5]=i):i=n[5];let a=w(r,i),o;n[6]===a?o=n[7]:(o=URL.createObjectURL(a),n[6]=a,n[7]=o);let s=o,c,l;return n[8]===s?(c=n[9],l=n[10]):(c=()=>()=>{URL.revokeObjectURL(s)},l=[s],n[8]=s,n[9]=c,n[10]=l),(0,H.useEffect)(c,l),s}function ae(e){let t=(0,V.c)(3),{threadId:n,path:r,alt:i}=e,a=Z(n,r),o;return t[0]!==i||t[1]!==a?(o=(0,U.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 overflow-auto`,children:(0,U.jsx)(`img`,{src:a,alt:i,className:`max-w-full max-h-full object-contain`})}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function oe(e){let t=(0,V.c)(2),{threadId:n,path:r}=e,i=Z(n,r),a;return t[0]===i?a=t[1]:(a=(0,U.jsx)(`div`,{className:`flex items-center justify-center h-full p-4`,children:(0,U.jsx)(`video`,{src:i,controls:!0,className:`max-w-full max-h-full`})}),t[0]=i,t[1]=a),a}function se(e,t){return t?`edit`:G(e.path)?`view`:`edit`}function ce(e,t,n,r){let i=t?c(t.path,t.name):null,a=t?.type===`file`&&e&&!i?t:null,o=a?`${e}:${a.path}:${r}`:null,s=n&&n.key===o?n:null;return{selectedMediaType:i,editableFile:a,fileSuspenseKey:o,currentContent:s,fileContent:s?.content??``,originalFileContent:s?.original??``}}function le(){let e=document.querySelector(`[data-markdown-print-content]`);return e instanceof HTMLElement?e:null}function ue(e,t){return`<!doctype html>
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8" />
|
|
@@ -73,4 +73,4 @@ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,o as n,r,t as i
|
|
|
73
73
|
}, { once: true });
|
|
74
74
|
<\/script>
|
|
75
75
|
</body>
|
|
76
|
-
</html>`}function de(e,t){let n=window.open(``,`_blank`,`noopener,noreferrer`);return n?(n.document.open(),n.document.write(ue(e,t)),n.document.close(),!0):!1}function fe(e){if(typeof window>`u`)return;let t=le();if(!t){S({title:`Print unavailable`,description:`Couldn't find the markdown preview to print.`,variant:`destructive`});return}de(e.name??`Markdown document`,t.innerHTML)||S({title:`Print blocked`,description:`Allow pop-ups to print this file.`,variant:`destructive`})}async function pe(e,t){S({title:`PDF created`,description:`Opened ${(await j(e,t.path)).outputPath.split(/[\\/]/).pop()??`the PDF`} in your default app.`})}async function me(e,t){try{if(!x()){fe(t);return}await pe(e,t)}catch(n){Y(`Failed to print markdown file as PDF`,{threadId:e,path:t.path},n),S({title:`PDF export failed`,description:n instanceof Error?n.message:`Failed to convert this markdown file to PDF.`,variant:`destructive`})}}async function he(e,t){try{let n=await ie(e,t);return await F(e,``,n),S({title:`Created`,description:`${n} created successfully.`}),n}catch(n){return Y(`Failed to create explorer file`,{threadId:e,extension:t},n),S({title:`Error`,description:`Failed to create file.`,variant:`destructive`}),null}}async function ge(e,t){try{await navigator.clipboard.writeText(t),S({title:`Copied`,description:`Repository folder path copied to clipboard.`})}catch(n){Y(`Failed to copy explorer folder path`,{threadId:e,folderPath:t},n),S({title:`Error`,description:`Failed to copy path to clipboard.`,variant:`destructive`})}}async function _e(e,t){try{await E(e,`.`)}catch(n){Y(`Failed to open explorer repository folder`,{threadId:e,folderPath:t},n),S({title:`Error`,description:`Failed to open repository folder.`,variant:`destructive`})}}async function ve(e){try{await P(e.threadId,e.file.path,e.content),e.onSaved({key:e.suspenseKey,content:e.content,original:e.content}),S({title:`Saved`,description:`${e.file.name} saved successfully.`})}catch(t){Y(`Failed to save explorer file`,{threadId:e.threadId,path:e.file.path},t),S({title:`Error`,description:t instanceof Error?t.message:`Failed to save file`,variant:`destructive`})}}function ye(e){let t=(0,V.c)(15),{selectedFile:n,showBackButton:r,onShowTree:i}=e,o;t[0]!==i||t[1]!==r?(o=r&&i?(0,U.jsxs)(d,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:i,children:[(0,U.jsx)(_,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):null,t[0]=i,t[1]=r,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=u(a.label,`truncate leading-normal text-foreground`),t[3]=s):s=t[3];let c=n?n.name:`Select a file to edit`,l;t[4]===c?l=t[5]:(l=(0,U.jsx)(`span`,{className:s,children:c}),t[4]=c,t[5]=l);let f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=u(a.compact,`truncate text-muted-foreground`),t[6]=f):f=t[6];let p=n?n.path:`Browse and edit repository files`,m;t[7]===p?m=t[8]:(m=(0,U.jsx)(`span`,{className:f,children:p}),t[7]=p,t[8]=m);let h;t[9]!==l||t[10]!==m?(h=(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[l,m]}),t[9]=l,t[10]=m,t[11]=h):h=t[11];let g;return t[12]!==o||t[13]!==h?(g=(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[o,h]}),t[12]=o,t[13]=h,t[14]=g):g=t[14],g}function Q(e){let t=(0,V.c)(12),{path:n,markdownMode:r,onMarkdownModeChange:i,printing:a,onPrint:o}=e,s;t[0]!==r||t[1]!==o||t[2]!==n||t[3]!==a?(s=G(n)&&r===`view`?(0,U.jsxs)(d,{size:`sm`,variant:`outline`,onClick:o,disabled:a,children:[a?(0,U.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,U.jsx)(b,{className:`h-4 w-4`}),a?`Printing…`:`Print`]}):null,t[0]=r,t[1]=o,t[2]=n,t[3]=a,t[4]=s):s=t[4];let c;t[5]!==r||t[6]!==i||t[7]!==n?(c=G(n)?(0,U.jsxs)(`div`,{className:`flex rounded-full border border-input bg-background p-0.5`,children:[(0,U.jsx)(d,{size:`sm`,variant:r===`view`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>i(`view`),children:`View`}),(0,U.jsx)(d,{size:`sm`,variant:r===`edit`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>i(`edit`),children:`Edit`})]}):null,t[5]=r,t[6]=i,t[7]=n,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l=(0,U.jsxs)(U.Fragment,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function be(e){let t=(0,V.c)(16),{selectedFile:n,editableFile:r,hasLoadedContent:i}=e,a;t[0]!==r||t[1]!==i||t[2]!==e.canSave||t[3]!==e.markdownMode||t[4]!==e.onMarkdownModeChange||t[5]!==e.onPrint||t[6]!==e.onSave||t[7]!==e.printing||t[8]!==e.saving?(a=r&&i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Q,{path:r.path,markdownMode:e.markdownMode,onMarkdownModeChange:e.onMarkdownModeChange,printing:e.printing,onPrint:e.onPrint}),(0,U.jsxs)(d,{size:`sm`,onClick:e.onSave,disabled:e.saving||!e.canSave,children:[e.saving?(0,U.jsx)(f,{className:`h-4 w-4 animate-spin`}):null,`Save`]})]}):null,t[0]=r,t[1]=i,t[2]=e.canSave,t[3]=e.markdownMode,t[4]=e.onMarkdownModeChange,t[5]=e.onPrint,t[6]=e.onSave,t[7]=e.printing,t[8]=e.saving,t[9]=a):a=t[9];let o;t[10]!==e||t[11]!==n?(o=n?null:(0,U.jsxs)(R,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsxs)(d,{size:`sm`,className:`gap-1.5`,children:[(0,U.jsx)(y,{className:`h-3.5 w-3.5`}),`New file`]})}),(0,U.jsx)(L,{align:`end`,children:re.map(t=>{let{label:n,ext:r,icon:i}=t;return(0,U.jsxs)(M,{onSelect:()=>e.onNewFile(r),children:[(0,U.jsx)(i,{className:`h-4 w-4`}),n]},r)})})]}),t[10]=e,t[11]=n,t[12]=o):o=t[12];let s;return t[13]!==a||t[14]!==o?(s=(0,U.jsxs)(U.Fragment,{children:[a,o]}),t[13]=a,t[14]=o,t[15]=s):s=t[15],s}function xe(){let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,U.jsx)(`h2`,{className:u(a.pageTitle,`text-foreground`),children:`File Explorer`}),(0,U.jsx)(`p`,{className:u(a.pageSubtitle),children:`Browse and edit files`})]}),e[0]=t):t=e[0],t}function $(e){let t=(0,V.c)(14),{mediaType:n,threadId:r,file:i}=e,a=n===`image`?`Failed to load image`:`Failed to load video`,o;t[0]!==i.path||t[1]!==r?(o=()=>{C(X(r,i.path))},t[0]=i.path,t[1]=r,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.jsx)(T,{}),t[3]=s):s=t[3];let c;t[4]!==i.name||t[5]!==i.path||t[6]!==n||t[7]!==r?(c=(0,U.jsx)(H.Suspense,{fallback:s,children:n===`image`?(0,U.jsx)(ae,{threadId:r,path:i.path,alt:i.name}):(0,U.jsx)(oe,{threadId:r,path:i.path})}),t[4]=i.name,t[5]=i.path,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l;return t[9]!==i.path||t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,U.jsx)(B,{fallbackTitle:a,onRetry:o,children:c},i.path),t[9]=i.path,t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Se(e){let t=(0,V.c)(21),{threadId:n,file:r,suspenseKey:i,hasLoadedContent:a,fileContent:o,markdownMode:s,resolvedTheme:c,autoFocusEditor:l,onContentChange:u,onEditorReady:d,onRetry:f}=e,p=i??void 0,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,U.jsx)(T,{}),t[0]=m):m=t[0];let h=i??void 0,g=i??``,_;t[1]!==r.path||t[2]!==u||t[3]!==h||t[4]!==g||t[5]!==n?(_=(0,U.jsx)(H.Suspense,{fallback:m,children:(0,U.jsx)(J,{threadId:n,path:r.path,contentKey:g,onContentReady:u},h)}),t[1]=r.path,t[2]=u,t[3]=h,t[4]=g,t[5]=n,t[6]=_):_=t[6];let v;t[7]!==l||t[8]!==r.path||t[9]!==o||t[10]!==a||t[11]!==s||t[12]!==u||t[13]!==d||t[14]!==c?(v=a?G(r.path)&&s===`view`?(0,U.jsx)(`div`,{className:`h-full overflow-auto p-6 print:h-auto print:overflow-visible print:p-0`,children:(0,U.jsx)(`div`,{className:`mx-auto max-w-4xl print:max-w-none`,"data-markdown-print-content":!0,children:(0,U.jsx)(N,{content:o,enableMermaid:!0})})}):(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(T,{}),children:(0,U.jsx)(W,{language:K(r.path),value:o,theme:c===`dark`?`vs-dark`:`vs-light`,autoFocus:l,onReady:d,onChange:e=>u(t=>t&&{...t,content:e??``})})}):(0,U.jsx)(T,{}),t[7]=l,t[8]=r.path,t[9]=o,t[10]=a,t[11]=s,t[12]=u,t[13]=d,t[14]=c,t[15]=v):v=t[15];let y;return t[16]!==f||t[17]!==p||t[18]!==_||t[19]!==v?(y=(0,U.jsxs)(B,{fallbackTitle:`Failed to load file`,onRetry:f,children:[_,v]},p),t[16]=f,t[17]=p,t[18]=_,t[19]=v,t[20]=y):y=t[20],y}function Ce(e){let t=(0,V.c)(19);if(e.editableFile){let n;return t[0]!==e.autoFocusEditor||t[1]!==e.editableFile||t[2]!==e.fileContent||t[3]!==e.fileSuspenseKey||t[4]!==e.hasLoadedContent||t[5]!==e.markdownMode||t[6]!==e.onContentChange||t[7]!==e.onEditorReady||t[8]!==e.onFileLoadRetry||t[9]!==e.resolvedTheme||t[10]!==e.threadId?(n=(0,U.jsx)(Se,{threadId:e.threadId,file:e.editableFile,suspenseKey:e.fileSuspenseKey,hasLoadedContent:e.hasLoadedContent,fileContent:e.fileContent,markdownMode:e.markdownMode,resolvedTheme:e.resolvedTheme,autoFocusEditor:e.autoFocusEditor,onContentChange:e.onContentChange,onEditorReady:e.onEditorReady,onRetry:e.onFileLoadRetry}),t[0]=e.autoFocusEditor,t[1]=e.editableFile,t[2]=e.fileContent,t[3]=e.fileSuspenseKey,t[4]=e.hasLoadedContent,t[5]=e.markdownMode,t[6]=e.onContentChange,t[7]=e.onEditorReady,t[8]=e.onFileLoadRetry,t[9]=e.resolvedTheme,t[10]=e.threadId,t[11]=n):n=t[11],n}if(e.selectedFile?.type===`file`&&e.selectedMediaType===`image`){let n;return t[12]!==e.selectedFile||t[13]!==e.threadId?(n=(0,U.jsx)($,{mediaType:`image`,threadId:e.threadId,file:e.selectedFile}),t[12]=e.selectedFile,t[13]=e.threadId,t[14]=n):n=t[14],n}if(e.selectedFile?.type===`file`&&e.selectedMediaType===`video`){let n;return t[15]!==e.selectedFile||t[16]!==e.threadId?(n=(0,U.jsx)($,{mediaType:`video`,threadId:e.threadId,file:e.selectedFile}),t[15]=e.selectedFile,t[16]=e.threadId,t[17]=n):n=t[17],n}let n;return t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,U.jsx)(xe,{}),t[18]=n):n=t[18],n}function we(e){let t=(0,V.c)(5),{folderPath:n,copying:r,onOpen:i,onCopy:o}=e,s;return t[0]!==r||t[1]!==n||t[2]!==o||t[3]!==i?(s=(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 px-4 py-2`,children:n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,onClick:i,className:u(a.compact,`min-w-0 flex-1 truncate text-left font-mono text-muted-foreground hover:text-foreground hover:underline`),title:n,children:n}),(0,U.jsxs)(d,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0`,onClick:o,disabled:r,children:[r?(0,U.jsx)(p,{className:`h-3.5 w-3.5`}):(0,U.jsx)(g,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Copy path`})]})]}):(0,U.jsx)(`p`,{className:u(a.compact,`text-muted-foreground/50 italic`),children:`Loading path...`})}),t[0]=r,t[1]=n,t[2]=o,t[3]=i,t[4]=s):s=t[4],s}function Te({selectedFile:e,showTreeBackButton:t=!1,onShowTree:n,onFileCreated:r}){let{resolvedTheme:i}=D(),o=l(e=>e.selectedThreadId),{triggerExplorerRefresh:s}=te(),c=(0,H.useRef)(null),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(null),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(!1),[y,b]=(0,H.useState)(`edit`),[x,S]=(0,H.useState)(0),[w,T]=(0,H.useState)(null),[E,O]=(0,H.useState)(!1),k=e?.path??null;(0,H.useEffect)(()=>{o&&ee(o).then(T).catch(()=>{})},[o]);let A=async()=>{if(!(!w||E)){O(!0);try{await ge(o,w)}finally{O(!1)}}},j=(0,H.useCallback)(async e=>{if(!o)return;let t=await he(o,e);if(!t)return;let n={name:t,path:t,type:`file`};c.current=t,d(!0),r?.(n),s()},[o,r,s]),{selectedMediaType:M,editableFile:N,fileSuspenseKey:P,currentContent:F,fileContent:L,originalFileContent:R}=ce(o,e,f,x);(0,H.useEffect)(()=>{if(e?.type===`file`){let t=c.current===e.path;t&&(c.current=null),b(se(e,t))}else b(`edit`)},[k,o]);async function z(){if(!(!o||!e||!P)){g(!0);try{await ve({threadId:o,file:e,suspenseKey:P,content:L,onSaved:p})}finally{g(!1)}}}async function B(){if(!(!o||!e||_)){v(!0);try{await me(o,e)}finally{v(!1)}}}function V(){d(!1)}function W(){!o||!N||(C(q(o,N.path)),S(e=>e+1))}return o?(0,U.jsxs)(`div`,{className:`explorer-view-root flex flex-col h-full print:block print:h-auto`,children:[(0,U.jsxs)(I,{className:`justify-between print:hidden`,children:[(0,U.jsx)(ye,{selectedFile:e,showBackButton:t,onShowTree:n}),(0,U.jsx)(`div`,{className:`flex gap-2`,children:(0,U.jsx)(be,{selectedFile:e,editableFile:N,hasLoadedContent:F!==null,markdownMode:y,onMarkdownModeChange:b,printing:_,onPrint:()=>void B(),saving:h,canSave:L!==``&&L!==R,onSave:()=>void z(),onNewFile:e=>void j(e)})})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden print:overflow-visible print:flex-none`,children:(0,U.jsx)(`div`,{className:`h-full relative overflow-hidden print:h-auto print:overflow-visible`,children:(0,U.jsx)(Ce,{threadId:o,selectedFile:e,selectedMediaType:M,editableFile:N,fileSuspenseKey:P,hasLoadedContent:F!==null,fileContent:L,markdownMode:y,resolvedTheme:i,autoFocusEditor:u,onContentChange:p,onEditorReady:V,onFileLoadRetry:W})})}),e?null:(0,U.jsx)(we,{folderPath:w,copying:E,onOpen:()=>void _e(o,w),onCopy:()=>void A()})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[(0,U.jsx)(m,{className:`h-8 w-8 text-muted-foreground`}),(0,U.jsx)(`p`,{className:a.bodyMuted,children:`Select a thread to browse its files`})]})}export{Te as default};
|
|
76
|
+
</html>`}function de(e,t){let n=window.open(``,`_blank`,`noopener,noreferrer`);return n?(n.document.open(),n.document.write(ue(e,t)),n.document.close(),!0):!1}function fe(e){if(typeof window>`u`)return;let t=le();if(!t){S({title:`Print unavailable`,description:`Couldn't find the markdown preview to print.`,variant:`destructive`});return}de(e.name??`Markdown document`,t.innerHTML)||S({title:`Print blocked`,description:`Allow pop-ups to print this file.`,variant:`destructive`})}async function pe(e,t){S({title:`PDF created`,description:`Opened ${(await R(e,t.path)).outputPath.split(/[\\/]/).pop()??`the PDF`} in your default app.`})}async function me(e,t){try{if(!x()){fe(t);return}await pe(e,t)}catch(n){Y(`Failed to print markdown file as PDF`,{threadId:e,path:t.path},n),S({title:`PDF export failed`,description:n instanceof Error?n.message:`Failed to convert this markdown file to PDF.`,variant:`destructive`})}}async function he(e,t){try{let n=await ie(e,t);return await k(e,``,n),S({title:`Created`,description:`${n} created successfully.`}),n}catch(n){return Y(`Failed to create explorer file`,{threadId:e,extension:t},n),S({title:`Error`,description:`Failed to create file.`,variant:`destructive`}),null}}async function ge(e,t){try{await navigator.clipboard.writeText(t),S({title:`Copied`,description:`Repository folder path copied to clipboard.`})}catch(n){Y(`Failed to copy explorer folder path`,{threadId:e,folderPath:t},n),S({title:`Error`,description:`Failed to copy path to clipboard.`,variant:`destructive`})}}async function _e(e,t){try{await M(e,`.`)}catch(n){Y(`Failed to open explorer repository folder`,{threadId:e,folderPath:t},n),S({title:`Error`,description:`Failed to open repository folder.`,variant:`destructive`})}}async function ve(e){try{await I(e.threadId,e.file.path,e.content),e.onSaved({key:e.suspenseKey,content:e.content,original:e.content}),S({title:`Saved`,description:`${e.file.name} saved successfully.`})}catch(t){Y(`Failed to save explorer file`,{threadId:e.threadId,path:e.file.path},t),S({title:`Error`,description:t instanceof Error?t.message:`Failed to save file`,variant:`destructive`})}}function ye(e){let t=(0,V.c)(15),{selectedFile:n,showBackButton:r,onShowTree:i}=e,o;t[0]!==i||t[1]!==r?(o=r&&i?(0,U.jsxs)(d,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:i,children:[(0,U.jsx)(_,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):null,t[0]=i,t[1]=r,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=u(a.label,`truncate leading-normal text-foreground`),t[3]=s):s=t[3];let c=n?n.name:`Select a file to edit`,l;t[4]===c?l=t[5]:(l=(0,U.jsx)(`span`,{className:s,children:c}),t[4]=c,t[5]=l);let f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=u(a.compact,`truncate text-muted-foreground`),t[6]=f):f=t[6];let p=n?n.path:`Browse and edit repository files`,m;t[7]===p?m=t[8]:(m=(0,U.jsx)(`span`,{className:f,children:p}),t[7]=p,t[8]=m);let h;t[9]!==l||t[10]!==m?(h=(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[l,m]}),t[9]=l,t[10]=m,t[11]=h):h=t[11];let g;return t[12]!==o||t[13]!==h?(g=(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[o,h]}),t[12]=o,t[13]=h,t[14]=g):g=t[14],g}function Q(e){let t=(0,V.c)(12),{path:n,markdownMode:r,onMarkdownModeChange:i,printing:a,onPrint:o}=e,s;t[0]!==r||t[1]!==o||t[2]!==n||t[3]!==a?(s=G(n)&&r===`view`?(0,U.jsxs)(d,{size:`sm`,variant:`outline`,onClick:o,disabled:a,children:[a?(0,U.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,U.jsx)(b,{className:`h-4 w-4`}),a?`Printing…`:`Print`]}):null,t[0]=r,t[1]=o,t[2]=n,t[3]=a,t[4]=s):s=t[4];let c;t[5]!==r||t[6]!==i||t[7]!==n?(c=G(n)?(0,U.jsxs)(`div`,{className:`flex rounded-full border border-input bg-background p-0.5`,children:[(0,U.jsx)(d,{size:`sm`,variant:r===`view`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>i(`view`),children:`View`}),(0,U.jsx)(d,{size:`sm`,variant:r===`edit`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>i(`edit`),children:`Edit`})]}):null,t[5]=r,t[6]=i,t[7]=n,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l=(0,U.jsxs)(U.Fragment,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function be(e){let t=(0,V.c)(16),{selectedFile:n,editableFile:r,hasLoadedContent:i}=e,a;t[0]!==r||t[1]!==i||t[2]!==e.canSave||t[3]!==e.markdownMode||t[4]!==e.onMarkdownModeChange||t[5]!==e.onPrint||t[6]!==e.onSave||t[7]!==e.printing||t[8]!==e.saving?(a=r&&i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Q,{path:r.path,markdownMode:e.markdownMode,onMarkdownModeChange:e.onMarkdownModeChange,printing:e.printing,onPrint:e.onPrint}),(0,U.jsxs)(d,{size:`sm`,onClick:e.onSave,disabled:e.saving||!e.canSave,children:[e.saving?(0,U.jsx)(f,{className:`h-4 w-4 animate-spin`}):null,`Save`]})]}):null,t[0]=r,t[1]=i,t[2]=e.canSave,t[3]=e.markdownMode,t[4]=e.onMarkdownModeChange,t[5]=e.onPrint,t[6]=e.onSave,t[7]=e.printing,t[8]=e.saving,t[9]=a):a=t[9];let o;t[10]!==e||t[11]!==n?(o=n?null:(0,U.jsxs)(L,{children:[(0,U.jsx)(z,{asChild:!0,children:(0,U.jsxs)(d,{size:`sm`,className:`gap-1.5`,children:[(0,U.jsx)(y,{className:`h-3.5 w-3.5`}),`New file`]})}),(0,U.jsx)(F,{align:`end`,children:re.map(t=>{let{label:n,ext:r,icon:i}=t;return(0,U.jsxs)(N,{onSelect:()=>e.onNewFile(r),children:[(0,U.jsx)(i,{className:`h-4 w-4`}),n]},r)})})]}),t[10]=e,t[11]=n,t[12]=o):o=t[12];let s;return t[13]!==a||t[14]!==o?(s=(0,U.jsxs)(U.Fragment,{children:[a,o]}),t[13]=a,t[14]=o,t[15]=s):s=t[15],s}function xe(){let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,U.jsx)(`h2`,{className:u(a.pageTitle,`text-foreground`),children:`File Explorer`}),(0,U.jsx)(`p`,{className:u(a.pageSubtitle),children:`Browse and edit files`})]}),e[0]=t):t=e[0],t}function $(e){let t=(0,V.c)(14),{mediaType:n,threadId:r,file:i}=e,a=n===`image`?`Failed to load image`:`Failed to load video`,o;t[0]!==i.path||t[1]!==r?(o=()=>{C(X(r,i.path))},t[0]=i.path,t[1]=r,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.jsx)(E,{}),t[3]=s):s=t[3];let c;t[4]!==i.name||t[5]!==i.path||t[6]!==n||t[7]!==r?(c=(0,U.jsx)(H.Suspense,{fallback:s,children:n===`image`?(0,U.jsx)(ae,{threadId:r,path:i.path,alt:i.name}):(0,U.jsx)(oe,{threadId:r,path:i.path})}),t[4]=i.name,t[5]=i.path,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l;return t[9]!==i.path||t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,U.jsx)(B,{fallbackTitle:a,onRetry:o,children:c},i.path),t[9]=i.path,t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Se(e){let t=(0,V.c)(21),{threadId:n,file:r,suspenseKey:i,hasLoadedContent:a,fileContent:o,markdownMode:s,resolvedTheme:c,autoFocusEditor:l,onContentChange:u,onEditorReady:d,onRetry:f}=e,p=i??void 0,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,U.jsx)(E,{}),t[0]=m):m=t[0];let h=i??void 0,g=i??``,_;t[1]!==r.path||t[2]!==u||t[3]!==h||t[4]!==g||t[5]!==n?(_=(0,U.jsx)(H.Suspense,{fallback:m,children:(0,U.jsx)(J,{threadId:n,path:r.path,contentKey:g,onContentReady:u},h)}),t[1]=r.path,t[2]=u,t[3]=h,t[4]=g,t[5]=n,t[6]=_):_=t[6];let v;t[7]!==l||t[8]!==r.path||t[9]!==o||t[10]!==a||t[11]!==s||t[12]!==u||t[13]!==d||t[14]!==c?(v=a?G(r.path)&&s===`view`?(0,U.jsx)(`div`,{className:`h-full overflow-auto p-6 print:h-auto print:overflow-visible print:p-0`,children:(0,U.jsx)(`div`,{className:`mx-auto max-w-4xl print:max-w-none`,"data-markdown-print-content":!0,children:(0,U.jsx)(O,{content:o,enableMermaid:!0})})}):(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(E,{}),children:(0,U.jsx)(W,{language:K(r.path),value:o,theme:c===`dark`?`vs-dark`:`vs-light`,autoFocus:l,onReady:d,onChange:e=>u(t=>t&&{...t,content:e??``})})}):(0,U.jsx)(E,{}),t[7]=l,t[8]=r.path,t[9]=o,t[10]=a,t[11]=s,t[12]=u,t[13]=d,t[14]=c,t[15]=v):v=t[15];let y;return t[16]!==f||t[17]!==p||t[18]!==_||t[19]!==v?(y=(0,U.jsxs)(B,{fallbackTitle:`Failed to load file`,onRetry:f,children:[_,v]},p),t[16]=f,t[17]=p,t[18]=_,t[19]=v,t[20]=y):y=t[20],y}function Ce(e){let t=(0,V.c)(19);if(e.editableFile){let n;return t[0]!==e.autoFocusEditor||t[1]!==e.editableFile||t[2]!==e.fileContent||t[3]!==e.fileSuspenseKey||t[4]!==e.hasLoadedContent||t[5]!==e.markdownMode||t[6]!==e.onContentChange||t[7]!==e.onEditorReady||t[8]!==e.onFileLoadRetry||t[9]!==e.resolvedTheme||t[10]!==e.threadId?(n=(0,U.jsx)(Se,{threadId:e.threadId,file:e.editableFile,suspenseKey:e.fileSuspenseKey,hasLoadedContent:e.hasLoadedContent,fileContent:e.fileContent,markdownMode:e.markdownMode,resolvedTheme:e.resolvedTheme,autoFocusEditor:e.autoFocusEditor,onContentChange:e.onContentChange,onEditorReady:e.onEditorReady,onRetry:e.onFileLoadRetry}),t[0]=e.autoFocusEditor,t[1]=e.editableFile,t[2]=e.fileContent,t[3]=e.fileSuspenseKey,t[4]=e.hasLoadedContent,t[5]=e.markdownMode,t[6]=e.onContentChange,t[7]=e.onEditorReady,t[8]=e.onFileLoadRetry,t[9]=e.resolvedTheme,t[10]=e.threadId,t[11]=n):n=t[11],n}if(e.selectedFile?.type===`file`&&e.selectedMediaType===`image`){let n;return t[12]!==e.selectedFile||t[13]!==e.threadId?(n=(0,U.jsx)($,{mediaType:`image`,threadId:e.threadId,file:e.selectedFile}),t[12]=e.selectedFile,t[13]=e.threadId,t[14]=n):n=t[14],n}if(e.selectedFile?.type===`file`&&e.selectedMediaType===`video`){let n;return t[15]!==e.selectedFile||t[16]!==e.threadId?(n=(0,U.jsx)($,{mediaType:`video`,threadId:e.threadId,file:e.selectedFile}),t[15]=e.selectedFile,t[16]=e.threadId,t[17]=n):n=t[17],n}let n;return t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,U.jsx)(xe,{}),t[18]=n):n=t[18],n}function we(e){let t=(0,V.c)(5),{folderPath:n,copying:r,onOpen:i,onCopy:o}=e,s;return t[0]!==r||t[1]!==n||t[2]!==o||t[3]!==i?(s=(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 px-4 py-2`,children:n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,onClick:i,className:u(a.compact,`min-w-0 flex-1 truncate text-left font-mono text-muted-foreground hover:text-foreground hover:underline`),title:n,children:n}),(0,U.jsxs)(d,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0`,onClick:o,disabled:r,children:[r?(0,U.jsx)(p,{className:`h-3.5 w-3.5`}):(0,U.jsx)(g,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Copy path`})]})]}):(0,U.jsx)(`p`,{className:u(a.compact,`text-muted-foreground/50 italic`),children:`Loading path...`})}),t[0]=r,t[1]=n,t[2]=o,t[3]=i,t[4]=s):s=t[4],s}function Te({selectedFile:e,showTreeBackButton:t=!1,onShowTree:n,onFileCreated:r}){let{resolvedTheme:i}=P(),o=l(e=>e.selectedThreadId),{triggerExplorerRefresh:s}=T(),c=(0,H.useRef)(null),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(null),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(!1),[y,b]=(0,H.useState)(`edit`),[x,S]=(0,H.useState)(0),[w,E]=(0,H.useState)(null),[D,O]=(0,H.useState)(!1),k=e?.path??null;(0,H.useEffect)(()=>{o&&ee(o).then(E).catch(()=>{})},[o]);let A=async()=>{if(!(!w||D)){O(!0);try{await ge(o,w)}finally{O(!1)}}},j=(0,H.useCallback)(async e=>{if(!o)return;let t=await he(o,e);if(!t)return;let n={name:t,path:t,type:`file`};c.current=t,d(!0),r?.(n),s()},[o,r,s]),{selectedMediaType:M,editableFile:N,fileSuspenseKey:F,currentContent:I,fileContent:L,originalFileContent:R}=ce(o,e,f,x);(0,H.useEffect)(()=>{if(e?.type===`file`){let t=c.current===e.path;t&&(c.current=null),b(se(e,t))}else b(`edit`)},[k,o]);async function z(){if(!(!o||!e||!F)){g(!0);try{await ve({threadId:o,file:e,suspenseKey:F,content:L,onSaved:p})}finally{g(!1)}}}async function B(){if(!(!o||!e||_)){v(!0);try{await me(o,e)}finally{v(!1)}}}function V(){d(!1)}function W(){!o||!N||(C(q(o,N.path)),S(e=>e+1))}return o?(0,U.jsxs)(`div`,{className:`explorer-view-root flex flex-col h-full print:block print:h-auto`,children:[(0,U.jsxs)(te,{className:`justify-between print:hidden`,children:[(0,U.jsx)(ye,{selectedFile:e,showBackButton:t,onShowTree:n}),(0,U.jsx)(`div`,{className:`flex gap-2`,children:(0,U.jsx)(be,{selectedFile:e,editableFile:N,hasLoadedContent:I!==null,markdownMode:y,onMarkdownModeChange:b,printing:_,onPrint:()=>void B(),saving:h,canSave:L!==``&&L!==R,onSave:()=>void z(),onNewFile:e=>void j(e)})})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden print:overflow-visible print:flex-none`,children:(0,U.jsx)(`div`,{className:`h-full relative overflow-hidden print:h-auto print:overflow-visible`,children:(0,U.jsx)(Ce,{threadId:o,selectedFile:e,selectedMediaType:M,editableFile:N,fileSuspenseKey:F,hasLoadedContent:I!==null,fileContent:L,markdownMode:y,resolvedTheme:i,autoFocusEditor:u,onContentChange:p,onEditorReady:V,onFileLoadRetry:W})})}),e?null:(0,U.jsx)(we,{folderPath:w,copying:D,onOpen:()=>void _e(o,w),onCopy:()=>void A()})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[(0,U.jsx)(m,{className:`h-8 w-8 text-muted-foreground`}),(0,U.jsx)(`p`,{className:a.bodyMuted,children:`Select a thread to browse its files`})]})}export{Te as default};
|
package/dist/public/assets/{git-history-dialog-CFoZcBB0.js → git-history-dialog-DL0Trxiz.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./react-vendor-Ee0-5T4I.js";import{Dt as n}from"./dist-CTLFS4dn.js";import{r,t as i}from"./button-kWtLAMpB.js";import{Ot as a}from"./dist-c_QADQ5u.js";import{_r as o,gr as s,hr as c,mr as l,pr as u,vr as d}from"./index-
|
|
1
|
+
import{n as e,t}from"./react-vendor-Ee0-5T4I.js";import{Dt as n}from"./dist-CTLFS4dn.js";import{r,t as i}from"./button-kWtLAMpB.js";import{Ot as a}from"./dist-c_QADQ5u.js";import{_r as o,gr as s,hr as c,mr as l,pr as u,vr as d}from"./index-B3-5kIOf.js";var f=e(),p=t();function m(e){let t=(0,f.c)(28),{open:m,onOpenChange:g,commits:_,displayedCommits:v,isLoadingMore:y,onScroll:b,currentBranch:x}=e,S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,p.jsx)(d,{children:`Commit History`}),t[0]=S):S=t[0];let C;t[1]===x?C=t[2]:(C=(0,p.jsxs)(o,{children:[S,(0,p.jsxs)(c,{children:[`Recent commits on branch `,x]})]}),t[1]=x,t[2]=C);let w;t[3]===v?w=t[4]:(w=v.length>0?v.map(h):(0,p.jsx)(`p`,{className:r(n.bodyMuted,`text-center py-8`),children:`No commits found`}),t[3]=v,t[4]=w);let T;t[5]===y?T=t[6]:(T=y&&(0,p.jsx)(`div`,{className:`p-3 text-center`,children:(0,p.jsx)(a,{className:`h-4 w-4 animate-spin inline`})}),t[5]=y,t[6]=T);let E;t[7]!==_.length||t[8]!==v.length||t[9]!==y?(E=v.length<_.length&&!y&&(0,p.jsx)(`div`,{className:r(n.caption,`p-3 text-center`),children:`Scroll to load more`}),t[7]=_.length,t[8]=v.length,t[9]=y,t[10]=E):E=t[10];let D;t[11]!==w||t[12]!==T||t[13]!==E?(D=(0,p.jsxs)(`div`,{className:`divide-y`,children:[w,T,E]}),t[11]=w,t[12]=T,t[13]=E,t[14]=D):D=t[14];let O;t[15]!==b||t[16]!==D?(O=(0,p.jsx)(`div`,{className:`flex-1 overflow-y-auto border rounded-lg`,onScroll:b,children:D}),t[15]=b,t[16]=D,t[17]=O):O=t[17];let k;t[18]===g?k=t[19]:(k=(0,p.jsx)(s,{children:(0,p.jsx)(i,{onClick:()=>g(!1),children:`Close`})}),t[18]=g,t[19]=k);let A;t[20]!==C||t[21]!==O||t[22]!==k?(A=(0,p.jsxs)(l,{className:`max-w-2xl max-h-[80vh] flex flex-col`,children:[C,O,k]}),t[20]=C,t[21]=O,t[22]=k,t[23]=A):A=t[23];let j;return t[24]!==g||t[25]!==m||t[26]!==A?(j=(0,p.jsx)(u,{open:m,onOpenChange:g,children:A}),t[24]=g,t[25]=m,t[26]=A,t[27]=j):j=t[27],j}function h(e){return(0,p.jsxs)(`div`,{className:`p-3 hover:bg-muted/50 transition-colors`,children:[(0,p.jsx)(`p`,{className:r(n.label,`break-words`),children:e.message}),(0,p.jsxs)(`p`,{className:r(n.bodyMuted,`mt-1`),children:[(0,p.jsx)(`span`,{className:n.mono,children:e.hash.substring(0,7)}),` •`,` `,e.author,` • `,new Date(e.date).toLocaleDateString()]})]},e.hash)}export{m as GitHistoryDialog};
|