@geminilight/mindos 0.6.48 → 0.6.50
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/_standalone/.mindos-build-version +1 -1
- package/_standalone/.next/BUILD_ID +1 -1
- package/_standalone/.next/app-path-routes-manifest.json +16 -16
- package/_standalone/.next/build-manifest.json +2 -2
- package/_standalone/.next/cache/.previewinfo +1 -1
- package/_standalone/.next/cache/.rscinfo +1 -1
- package/_standalone/.next/cache/config.json +3 -3
- package/_standalone/.next/prerender-manifest.json +3 -3
- package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error.html +2 -2
- package/_standalone/.next/server/app/_global-error.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/_standalone/.next/server/app/_not-found/page.js +1 -1
- package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/page.js +1 -1
- package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask/route.js +23 -23
- package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changes/page.js +1 -1
- package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/page.js +1 -1
- package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/explore/page.js +1 -1
- package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/help/page.js +1 -1
- package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/login/page.js +1 -1
- package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/page.js +1 -1
- package/_standalone/.next/server/app/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/setup/page.js +1 -1
- package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/trash/page.js +3 -3
- package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
- package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app-paths-manifest.json +16 -16
- package/_standalone/.next/server/chunks/{6621.js → 273.js} +2 -2
- package/_standalone/.next/server/chunks/4241.js +16 -16
- package/_standalone/.next/server/pages/500.html +2 -2
- package/_standalone/.next/server/server-reference-manifest.js +1 -1
- package/_standalone/.next/server/server-reference-manifest.json +1 -1
- package/_standalone/.next/static/chunks/app/{layout-e93f7712eb19ea3c.js → layout-5b51589d4eedab68.js} +27 -27
- package/_standalone/.next/static/chunks/app/{page-8737865e3e69ba19.js → page-9ba25963d955f3d4.js} +2 -2
- package/_standalone/.next/static/chunks/app/trash/{page-18107f95010e02bb.js → page-20ee39622ea5047a.js} +1 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-67c4bf985a579c77.js +12 -0
- package/_standalone/.next/trace +63 -63
- package/app/app/api/ask/route.ts +53 -7
- package/package.json +1 -1
- package/scripts/build-runtime-archive.sh +6 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/page-be6c9b068838b878.js +0 -12
- /package/_standalone/.next/static/{wpGqoMXpRizjlB4FAva0T → 2qUKZF7S693ZZWFgkTSUY}/_buildManifest.js +0 -0
- /package/_standalone/.next/static/{wpGqoMXpRizjlB4FAva0T → 2qUKZF7S693ZZWFgkTSUY}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3637,9508],{4235:(e,t,r)=>{"use strict";r.d(t,{B1:()=>i,X8:()=>d,dV:()=>l,oR:()=>u});let n=[],s=[],a=0;function o(){for(let e of s)e()}function i(e){return s=[...s,e],()=>{s=s.filter(t=>t!==e)}}function l(){return n}function d(e){n=n.filter(t=>t.id!==e),o()}function c(e){let t=`toast-${++a}`,r={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};n=[...n,r].slice(-3),o(),r.duration>0&&setTimeout(()=>d(t),r.duration)}function u(e,t){c({message:e,...t})}u.success=(e,t)=>c({message:e,type:"success",duration:t}),u.undo=(e,t,r)=>c({message:e,type:"info",duration:r?.duration??5e3,action:{label:r?.label??"Undo",onClick:t}}),u.error=(e,t)=>c({message:e,type:"error",duration:t}),u.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},6517:(e,t,r)=>{"use strict";r.d(t,{Y:()=>s});var n=r(9339);let s=(0,n.createServerReference)("40469e1a3f65754f08872955f4fa07f79cd904e53a",n.callServer,void 0,n.findSourceMapURL,"undoDeleteAction")},6962:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},7834:(e,t,r)=>{"use strict";async function n(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let r=document.execCommand("copy");return document.body.removeChild(t),r}catch{return!1}}r.d(t,{l:()=>n})},10377:(e,t,r)=>{"use strict";r.d(t,{Z:()=>h});var n=r(12115);let s="mindos-pinned-files",a="mindos:pins-changed";function o(){try{let e=localStorage.getItem(s);return e?JSON.parse(e):[]}catch{return[]}}function i(){return c}let l=[];function d(){return l}let c=[],u=!1;function m(){u||(c=o(),u=!0)}function x(e){m();let t=t=>{t.key===s&&(c=o(),e())},r=()=>{c=o(),e()};return window.addEventListener("storage",t),window.addEventListener(a,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,r)}}function p(e){c=e;try{localStorage.setItem(s,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function h(){m();let e=(0,n.useSyncExternalStore)(x,i,d),t=(0,n.useCallback)(t=>e.includes(t),[e]),r=(0,n.useCallback)(e=>{let t=o(),r=t.indexOf(e);r>=0?t.splice(r,1):t.unshift(e),p(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:r,reorderPins:(0,n.useCallback)(e=>{p(e)},[]),removePin:(0,n.useCallback)(e=>{p(o().filter(t=>t!==e))},[])}}},16230:(e,t,r)=>{"use strict";r.d(t,{i:()=>s});var n=r(9339);let s=(0,n.createServerReference)("405a54a7c8d6011ad85002a50be12c1fb8f3aa2419",n.callServer,void 0,n.findSourceMapURL,"deleteFileAction")},21362:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},22356:(e,t,r)=>{"use strict";r.d(t,{h:()=>n,n:()=>s});class n extends Error{constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.code=r}}async function s(e,t={}){let r,a,o,{timeout:i=3e4,signal:l,...d}=t;if((i>0||l)&&(r=new AbortController),i>0&&r&&(a=setTimeout(()=>{r.abort(Error(`Request timed out after ${Math.round(i/1e3)}s`))},i)),l&&r)if(l.aborted)r.abort();else{let e=()=>r?.abort();l.addEventListener("abort",e,{once:!0}),o=()=>{l.removeEventListener("abort",e)}}let c=r?.signal??l;try{let t=await fetch(e,{...d,signal:c});if(!t.ok){let e,r=`Request failed (${t.status})`;try{let n=await t.json();n?.error?.code&&n?.error?.message?(r=n.error.message,e=n.error.code):n?.error&&(r="string"==typeof n.error?n.error:n.error.message??r)}catch{}throw new n(r,t.status,e)}return await t.json()}finally{a&&clearTimeout(a),o&&o()}}},33210:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},34367:(e,t,r)=>{"use strict";r.d(t,{default:()=>D});var n=r(95155),s=r(12115),a=r(98500),o=r.n(a),i=r(38798),l=r(33078),d=r(48368),c=r(42129),u=r(997),m=r(97810),x=r(67635),p=r(41585),h=r(49387),f=r(89363),g=r(33210),b=r(93631),v=r(37595);let y=(0,r(90425).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);var j=r(44406),w=r(91337),k=r(82125),N=r(91053);async function C(e){try{await navigator.clipboard.writeText(e)}catch{}}function A({node:e}){return"directory"===e.type?(0,n.jsx)(i.A,{size:16,className:"text-yellow-400 shrink-0"}):".csv"===e.extension?(0,n.jsx)(l.A,{size:16,className:"text-success shrink-0"}):(0,n.jsx)(d.A,{size:16,className:"text-muted-foreground shrink-0"})}function E({node:e}){return"directory"===e.type?(0,n.jsx)(c.A,{size:28,className:"text-yellow-400"}):".csv"===e.extension?(0,n.jsx)(l.A,{size:28,className:"text-success"}):(0,n.jsx)(d.A,{size:28,className:"text-muted-foreground"})}let z="mindos-dir-view",S="show-hidden-files";function M(e){let t=t=>{t.key===S&&e()},r=()=>e();return window.addEventListener("storage",t),window.addEventListener("mindos:hidden-files-changed",r),()=>{window.removeEventListener("storage",t),window.removeEventListener("mindos:hidden-files-changed",r)}}function L(){return"true"===localStorage.getItem(S)}function T({icon:e,title:t,lines:r,viewAllHref:s,viewAllLabel:a}){return 0===r.length?null:(0,n.jsxs)("div",{className:"bg-muted/30 border border-border/40 rounded-lg px-4 py-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[e,(0,n.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:t})]}),(0,n.jsx)("div",{className:"space-y-1",children:r.map((e,t)=>(0,n.jsxs)("p",{className:"text-sm text-muted-foreground/80 leading-relaxed",suppressHydrationWarning:!0,children:["\xb7 ",e]},t))}),(0,n.jsx)("div",{className:"flex justify-end mt-2",children:(0,n.jsx)(o(),{href:s,className:"text-xs hover:underline transition-colors text-[var(--amber)]",children:a})})]})}function R({preview:e,dirPath:t}){let{t:r}=(0,N.Y)(),s=e.instructionLines.length>0,a=e.readmeLines.length>0;return s||a?(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[s&&(0,n.jsx)(T,{icon:(0,n.jsx)(u.A,{size:14,className:"text-muted-foreground shrink-0"}),title:r.fileTree.rules,lines:e.instructionLines,viewAllHref:`/view/${(0,w.O0)(`${t}/INSTRUCTION.md`)}`,viewAllLabel:r.fileTree.viewAll}),a&&(0,n.jsx)(T,{icon:(0,n.jsx)(m.A,{size:14,className:"text-muted-foreground shrink-0"}),title:r.fileTree.about,lines:e.readmeLines,viewAllHref:`/view/${(0,w.O0)(`${t}/README.md`)}`,viewAllLabel:r.fileTree.viewAll})]}):null}function $({x:e,y:t,path:r,label:a,onClose:o}){let i=(0,s.useRef)(null),{t:l}=(0,N.Y)();(0,s.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&o()},t=e=>{"Escape"===e.key&&o()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]);let d=Math.min(e,window.innerWidth-200),c=Math.min(t,window.innerHeight-60);return(0,n.jsx)("div",{ref:i,className:"fixed z-50 min-w-[160px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:c,left:d},children:(0,n.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{C(r),o()},children:[(0,n.jsx)(x.A,{size:14,className:"shrink-0"})," ",l.fileTree.copyPath]})})}function P({dirPath:e}){let{t}=(0,N.Y)(),r="mindos-space-uninit-dismissed:"+e,[a,i]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{"1"===localStorage.getItem(r)&&i(!0)},[r]),a)?null:(0,n.jsx)("div",{className:"mb-4 rounded-lg border border-error/40 bg-error/5 px-4 py-3",children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(p.A,{size:18,className:"text-error shrink-0 mt-0.5"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-foreground",children:t.dirView.uninitTitle}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:t.dirView.uninitDesc}),(0,n.jsxs)("div",{className:"flex items-center gap-3 mt-2.5",children:[(0,n.jsxs)(o(),{href:`/view/${(0,w.O0)(`${e}/README.md`)}`,className:"inline-flex items-center gap-1 text-xs text-[var(--amber)] hover:underline",children:[(0,n.jsx)(h.A,{size:12})," ",t.dirView.uninitEditReadme]}),(0,n.jsxs)(o(),{href:`/view/${(0,w.O0)(`${e}/INSTRUCTION.md`)}`,className:"inline-flex items-center gap-1 text-xs text-[var(--amber)] hover:underline",children:[(0,n.jsx)(h.A,{size:12})," ",t.dirView.uninitEditInstruction]}),(0,n.jsxs)(o(),{href:"/settings",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[(0,n.jsx)(f.A,{size:12})," ",t.dirView.uninitSettings]})]})]}),(0,n.jsx)("button",{onClick:()=>{localStorage.setItem(r,"1"),i(!0)},className:"text-muted-foreground hover:text-foreground transition-colors p-0.5 shrink-0","aria-label":"Dismiss",children:(0,n.jsx)(g.A,{size:14})})]})})}function D({dirPath:e,entries:t,spacePreview:r}){let[a,i]=[(0,s.useSyncExternalStore)(e=>{let t=()=>e();return window.addEventListener("mindos-dir-view-change",t),()=>window.removeEventListener("mindos-dir-view-change",t)},()=>{let e=localStorage.getItem(z);return"list"===e||"grid"===e?e:"grid"},()=>"grid"),e=>{localStorage.setItem(z,e),window.dispatchEvent(new Event("mindos-dir-view-change"))}],l=(0,s.useSyncExternalStore)(M,L,()=>!1),{t:d}=(0,N.Y)(),u=e=>(0,w.KW)(e,d.home.relativeTime),[m,x]=(0,s.useState)(null),p=(0,s.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),x({x:e.clientX,y:e.clientY,path:t})},[]),h=(0,s.useMemo)(()=>l?t:t.filter(e=>"file"!==e.type||!k.C.has(e.name)),[t,l]),f=(0,s.useMemo)(()=>{let e=new Map;for(let t of h)e.set(t.path,function e(t){return"file"===t.type?1:(t.children||[]).reduce((t,r)=>t+e(r),0)}(t));return e},[h]);return(0,n.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,n.jsx)("div",{className:"sticky top-[52px] md:top-0 z-20 border-b border-border px-4 md:px-6 py-2.5 bg-background",children:(0,n.jsxs)("div",{className:"max-w-[860px] mx-auto flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"min-w-0 flex-1",children:(0,n.jsx)(j.A,{filePath:e})}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,n.jsxs)(o(),{href:`/view/${(0,w.O0)(e?`${e}/Untitled.md`:"Untitled.md")}`,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",children:[(0,n.jsx)(b.A,{size:13}),(0,n.jsx)("span",{className:"hidden sm:inline",children:d.dirView.newFile})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 p-1 bg-muted rounded-lg",children:[(0,n.jsx)("button",{onClick:()=>i("grid"),className:`p-1.5 rounded transition-colors ${"grid"===a?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,title:d.dirView.gridView,children:(0,n.jsx)(v.A,{size:14})}),(0,n.jsx)("button",{onClick:()=>i("list"),className:`p-1.5 rounded transition-colors ${"list"===a?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,title:d.dirView.listView,children:(0,n.jsx)(y,{size:14})})]})]})]})}),(0,n.jsx)("div",{className:"flex-1 px-4 md:px-6 py-6",children:(0,n.jsxs)("div",{className:"max-w-[860px] mx-auto",children:[r?.isTemplate&&(0,n.jsx)(P,{dirPath:e}),r&&!r.isTemplate&&(0,n.jsx)(R,{preview:r,dirPath:e}),0===h.length?(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:d.dirView.emptyFolder}):"grid"===a?(0,n.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-5 gap-3",children:h.map(e=>(0,n.jsxs)(o(),{href:`/view/${(0,w.O0)(e.path)}`,onContextMenu:t=>p(t,e.path),className:"directory"===e.type?"flex flex-col items-center gap-1.5 p-3 rounded-xl border border-border bg-card hover:bg-accent hover:border-border/80 transition-all duration-100 text-center":"flex flex-col items-center gap-2 p-4 rounded-xl border border-border bg-card hover:bg-accent hover:border-border/80 transition-all duration-100 text-center",children:["directory"===e.type?(0,n.jsx)(c.A,{size:22,className:"text-yellow-400"}):(0,n.jsx)(E,{node:e}),(0,n.jsx)("span",{className:"text-xs text-foreground leading-snug line-clamp-2 w-full",title:e.name,suppressHydrationWarning:!0,children:e.name}),"directory"===e.type&&(0,n.jsx)("span",{className:"text-2xs text-muted-foreground",children:d.dirView.fileCount(f.get(e.path)??0)}),"file"===e.type&&e.mtime&&(0,n.jsx)("span",{className:"text-2xs text-muted-foreground font-display",suppressHydrationWarning:!0,children:u(e.mtime)})]},e.path))}):(0,n.jsx)("div",{className:"flex flex-col divide-y divide-border border border-border rounded-xl overflow-hidden",children:h.map(e=>(0,n.jsxs)(o(),{href:`/view/${(0,w.O0)(e.path)}`,onContextMenu:t=>p(t,e.path),className:"flex items-center gap-3 px-4 py-3 bg-card hover:bg-accent transition-colors duration-100",children:[(0,n.jsx)(A,{node:e}),(0,n.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",title:e.name,suppressHydrationWarning:!0,children:e.name}),"directory"===e.type?(0,n.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:d.dirView.fileCount(f.get(e.path)??0)}):e.mtime?(0,n.jsx)("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums font-display",suppressHydrationWarning:!0,children:u(e.mtime)}):null]},e.path))})]})}),m&&(0,n.jsx)($,{x:m.x,y:m.y,path:m.path,label:d.fileTree.copyPath,onClose:()=>x(null)})]})}},36506:(e,t,r)=>{"use strict";r.d(t,{default:()=>ef});var n=r(95155),s=r(12115),a=r(73321),o=r(80723),i=r(95057),l=r(90425);let d=(0,l.A)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),c=(0,l.A)("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);var u=r(33210),m=r(6296),x=r(55243),p=r(94290),h=r(60285),f=r(48368);let g=(0,l.A)("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);var b=r(6962),v=r(67635),y=r(49387),j=r(68459),w=r(63637);function k({content:e}){let t=(0,s.useMemo)(()=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},[e]);return(0,n.jsx)("pre",{className:"rounded-xl border border-border bg-card px-4 py-3 overflow-x-auto text-sm leading-relaxed font-display",children:(0,n.jsx)("code",{suppressHydrationWarning:!0,children:t})})}var N=r(59386),C=r.n(N),A=r(9921),E=r(66088),z=r(56563),S=r(51914);function M(e,t){return C().unparse([e,...t])}function L({value:e,editable:t,onCommit:r}){let[a,o]=(0,s.useState)(!1),[i,l]=(0,s.useState)(e),d=(0,s.useRef)(null);function c(){o(!1),i!==e&&r(i)}return((0,s.useEffect)(()=>{a&&d.current?.select()},[a]),a)?(0,n.jsx)("input",{ref:d,value:i,onChange:e=>l(e.target.value),onBlur:c,onKeyDown:t=>{"Enter"===t.key&&c(),"Escape"===t.key&&(l(e),o(!1))},className:"w-full bg-transparent outline-none text-sm",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60},onClick:e=>e.stopPropagation()}):(0,n.jsx)("div",{className:`truncate text-sm ${t?"cursor-text":""}`,style:{color:"var(--foreground)",minWidth:60},onClick:t?function(){t&&(l(e),o(!0))}:void 0,title:e,children:e||(0,n.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.4},children:"—"})})}function T({headers:e,onAdd:t,onCancel:r}){let[a,o]=(0,s.useState)(()=>Array(e.length).fill("")),i=(0,s.useRef)(null);return(0,n.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[e.map((e,s)=>(0,n.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,n.jsx)("input",{ref:0===s?i:void 0,autoFocus:0===s,value:a[s],onChange:e=>{var t;return t=e.target.value,void o(e=>{let r=[...e];return r[s]=t,r})},onKeyDown:e=>{"Enter"===e.key&&t(a),"Escape"===e.key&&r()},placeholder:e,className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},s)),(0,n.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function R({content:e,appendAction:t,saveAction:r}){let[a,o]=(0,s.useState)(e),[i,l]=(0,s.useState)(null),[d,c]=(0,s.useState)(null),[u,x]=(0,s.useState)(!1),[p,h]=(0,s.useState)(!1),f=(0,s.useMemo)(()=>C().parse(a,{skipEmptyLines:!0}).data,[a]),g=f[0]||[],b=f.slice(1),v=(0,s.useMemo)(()=>null===i||null===d?b:[...b].sort((e,t)=>{let r=e[i]??"",n=t[i]??"",s=parseFloat(r),a=parseFloat(n);return isNaN(s)||isNaN(a)?"asc"===d?r.localeCompare(n):n.localeCompare(r):"asc"===d?s-a:a-s}),[b,i,d]),y=(0,s.useCallback)(async(e,t,n)=>{if(!r)return;let s=M(g,b.map(r=>r===v[e]?r.map((e,r)=>r===t?n:e):r));o(s),h(!0);try{await r(s)}catch(e){console.error("[CsvView] Cell save failed:",e)}finally{h(!1)}},[r,b,v,g]),w=(0,s.useCallback)(async e=>{if(!r||p)return;let t=v[e],n=M(g,b.filter(e=>e!==t));o(n),h(!0);try{await r(n)}catch(e){console.error("[CsvView] Row delete failed:",e)}finally{h(!1)}},[r,b,v,g,p]),k=(0,s.useCallback)(async e=>{h(!0);try{if(t){let r=await t(e);o(r.newContent)}else if(r){let t=M(g,[...b,e]);o(t),await r(t)}x(!1)}catch(e){console.error("[CsvView] Add row failed:",e)}finally{h(!1)}},[t,r,g,b]),N=!!r||!!t;return 0===g.length?(0,n.jsx)("div",{className:"text-sm py-4",style:{color:"var(--muted-foreground)"},children:"Empty CSV file"}):(0,n.jsxs)("div",{className:"w-full rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{style:{background:"var(--muted)"},children:[g.map((e,t)=>(0,n.jsx)("th",{onClick:()=>(function(e){if(i!==e){l(e),c("asc");return}"asc"===d?c("desc"):(l(null),c(null))})(t),className:"px-4 py-2.5 text-left font-semibold cursor-pointer select-none whitespace-nowrap transition-colors hover:bg-accent",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)",fontSize:"0.75rem",letterSpacing:"0.04em",textTransform:"uppercase"},children:(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{children:e}),i===t?"asc"===d?(0,n.jsx)(A.A,{size:11,style:{color:"var(--amber)"}}):(0,n.jsx)(E.A,{size:11,style:{color:"var(--amber)"}}):(0,n.jsx)(z.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.4}})]})},t)),N&&(0,n.jsx)("th",{className:"w-8",style:{borderBottom:"1px solid var(--border)",background:"var(--muted)"}})]})}),(0,n.jsxs)("tbody",{children:[v.map((e,t)=>(0,n.jsxs)("tr",{className:"group transition-colors",style:{background:t%2==0?"var(--background)":"var(--card)"},onMouseEnter:e=>e.currentTarget.style.background="var(--muted)",onMouseLeave:e=>e.currentTarget.style.background=t%2==0?"var(--background)":"var(--card)",children:[g.map((s,a)=>(0,n.jsx)("td",{className:"px-4 py-2.5 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,n.jsx)(L,{value:e[a]??"",editable:!!r,onCommit:e=>y(t,a,e)})},a)),N&&(0,n.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:r&&(0,n.jsx)("button",{onClick:()=>w(t),disabled:p,className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10 disabled:opacity-30",style:{color:"var(--muted-foreground)"},title:p?"Saving...":"Delete row",children:(0,n.jsx)(j.A,{size:12})})})]},t)),u&&(0,n.jsx)(T,{headers:g,onAdd:k,onCancel:()=>x(!1)})]})]})}),(0,n.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,n.jsxs)("span",{className:"text-xs font-display flex items-center gap-1.5",style:{color:"var(--muted-foreground)"},children:[b.length," rows \xb7 ",g.length," cols",p&&(0,n.jsx)(m.A,{size:10,className:"animate-spin",style:{color:"var(--amber)"}})]}),N&&!u&&(0,n.jsxs)("button",{onClick:()=>x(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md transition-colors font-display",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,n.jsx)(S.A,{size:12}),"Add row"]}),u&&(0,n.jsx)("button",{onClick:()=>x(!1),className:"text-xs px-2.5 py-1 rounded-md transition-colors font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]})}var $=r(98500),P=r.n($);let D=(0,l.A)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var I=r(91053),F=r(22356);function O({filePath:e}){let[t,r]=(0,s.useState)([]),[a,o]=(0,s.useState)(!0),{t:i}=(0,I.Y)();return((0,s.useEffect)(()=>{o(!0),(0,F.n)(`/api/backlinks?path=${encodeURIComponent(e)}`).then(e=>{r(Array.isArray(e)?e:[]),o(!1)}).catch(()=>{r([]),o(!1)})},[e]),a||0!==t.length)?(0,n.jsxs)("div",{className:"mt-12 pt-8 border-t border-border",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-6 text-muted-foreground",children:[(0,n.jsx)(D,{size:16,className:"text-[var(--amber)]/70"}),(0,n.jsx)("h3",{className:"text-sm font-semibold tracking-wider uppercase font-display",children:i.common?.relatedFiles||"Related Files"}),(0,n.jsx)("span",{className:"text-xs bg-muted px-1.5 py-0.5 rounded-full font-mono",children:t.length})]}),(0,n.jsx)("div",{className:"grid gap-3",children:a?(0,n.jsx)("div",{className:"space-y-3",children:[1,2].map(e=>(0,n.jsx)("div",{className:"h-20 bg-muted/30 rounded-lg animate-pulse"},e))}):t.map(e=>(0,n.jsx)(P(),{href:`/view/${e.filePath.split("/").map(encodeURIComponent).join("/")}`,className:"group block p-4 rounded-xl border border-border/50 bg-card/30 hover:bg-muted/30 hover:border-[var(--amber)]/30 transition-all duration-200",children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("div",{className:"mt-1 p-1.5 rounded-md bg-muted group-hover:bg-[var(--amber)]/10 transition-colors",children:(0,n.jsx)(f.A,{size:14,className:"text-muted-foreground group-hover:text-[var(--amber)]"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"font-medium text-sm text-foreground group-hover:text-[var(--amber)] transition-colors truncate mb-1",title:e.filePath,children:e.filePath}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed italic opacity-80 group-hover:opacity-100 transition-opacity",title:e.snippets[0]||"",children:e.snippets[0]||""})]})]})},e.filePath))})]}):null}var H=r(77148),V=r(44406),U=r(37206),W=r(8434);let B=(0,l.A)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);var Y=r(7915);let _=(0,U.default)(()=>Promise.all([r.e(6079),r.e(8131),r.e(362)]).then(r.bind(r,90362)),{loadableGenerated:{webpack:()=>[90362]},ssr:!1,loading:()=>(0,n.jsx)("div",{className:"h-full w-full min-h-[400px] rounded-lg border border-border bg-background flex items-center justify-center",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[(0,n.jsx)("div",{className:"w-4 h-4 border-2 border-border border-t-foreground rounded-full animate-spin"}),(0,n.jsx)("span",{children:"Loading editor..."})]})})}),K=(0,U.default)(()=>Promise.all([r.e(5004),r.e(277),r.e(1007),r.e(6087)]).then(r.bind(r,16087)),{loadableGenerated:{webpack:()=>[16087]},ssr:!1}),q=[{id:"wysiwyg",icon:(0,n.jsx)(y.A,{size:12}),label:"WYSIWYG"},{id:"split",icon:(0,n.jsx)(W.A,{size:12}),label:"Split"},{id:"source",icon:(0,n.jsx)(B,{size:12}),label:"Source"},{id:"preview",icon:(0,n.jsx)(Y.A,{size:12}),label:"Preview"}];function G({value:e,onChange:t,viewMode:r,onViewModeChange:s}){return(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("div",{className:"flex items-center gap-1 p-1 bg-muted rounded-lg self-start",children:q.map(e=>(0,n.jsxs)("button",{onClick:()=>s(e.id),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded text-xs font-medium transition-colors font-display ${r===e.id?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.icon,e.label]},e.id))}),(0,n.jsxs)("div",{className:"rounded-xl overflow-hidden border border-border flex",style:{height:"calc(100vh - 160px)"},children:["wysiwyg"===r&&(0,n.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,n.jsx)(K,{value:e,onChange:t})}),"split"===r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-1/2 h-full overflow-auto border-r border-border",children:(0,n.jsx)(_,{value:e,onChange:t,language:"markdown"})}),(0,n.jsx)("div",{className:"w-1/2 h-full overflow-auto bg-background",children:(0,n.jsx)("div",{className:"px-6 py-5",children:(0,n.jsx)(w.default,{content:e})})})]}),"source"===r&&(0,n.jsx)("div",{className:"w-full h-full overflow-auto",children:(0,n.jsx)(_,{value:e,onChange:t,language:"markdown"})}),"preview"===r&&(0,n.jsx)("div",{className:"w-full h-full overflow-auto bg-background",children:(0,n.jsx)("div",{className:"px-6 py-5",children:(0,n.jsx)(w.default,{content:e})})})]})]})}var J=r(21362),Z=r(36306),X=r(91337);function Q({content:e}){let{t}=(0,I.Y)(),{headings:r,minLevel:a}=(0,s.useMemo)(()=>{let t=function(e){let t=new Z.A,r=e.split("\n"),n=[],s=!1;for(let e of r){if(/^(`{3,}|~{3,})/.test(e)){s=!s;continue}if(s)continue;let r=e.match(/^(#{1,4})\s+(.+)/);if(r){let e=r[1].length,s=r[2].trim(),a=t.slug(s);n.push({id:a,text:s,level:e})}}return n}(e);return{headings:t,minLevel:t.length>0?Math.min(...t.map(e=>e.level)):1}},[e]),[o,i]=(0,s.useState)(""),[l,d]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=document.documentElement.style;return e.setProperty("--toc-width",l?"0px":"212px"),l?e.removeProperty("--toc-margin"):e.setProperty("--toc-margin","220px"),()=>{e.removeProperty("--toc-width"),e.removeProperty("--toc-margin")}},[l]);let c=(0,s.useRef)(null),u=(0,s.useRef)(null),m=(0,s.useRef)(new Map),x=(0,s.useCallback)(e=>{let t=m.current.get(e),r=u.current;if(!t||!r||!t.isConnected)return;let n=r.getBoundingClientRect(),s=t.getBoundingClientRect(),a=s.top<n.top+40,o=s.bottom>n.bottom-40;(a||o)&&t.scrollIntoView({block:"center",behavior:"auto"})},[]);return((0,s.useEffect)(()=>{if(0===r.length)return;let e=setTimeout(()=>{let e=r.map(e=>document.getElementById(e.id)).filter(Boolean);0!==e.length&&(c.current?.disconnect(),c.current=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){i(t.target.id),x(t.target.id);break}},{rootMargin:"-56px 0% -70% 0%",threshold:0}),e.forEach(e=>c.current?.observe(e)))},150);return()=>{clearTimeout(e),c.current?.disconnect()}},[r]),r.length<2)?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>d(e=>!e),className:"hidden xl:flex fixed z-10 top-[50px] flex items-center justify-center w-5 h-8 rounded-l-md border border-r-0 border-border hover:bg-muted transition-colors",style:{right:`calc(var(--right-panel-width, 0px) + ${212*!l}px)`,background:"var(--background)",transition:"right 200ms ease-in-out"},title:l?t.view.tocExpand:t.view.tocCollapse,children:(0,n.jsx)(J.A,{size:11,className:"text-muted-foreground/60 transition-transform duration-200",style:{transform:l?"rotate(180deg)":"rotate(0deg)"}})}),(0,n.jsx)("aside",{className:"hidden xl:flex flex-col fixed z-10 overflow-hidden",style:{top:44,height:"calc(100vh - 44px)",width:212,right:"var(--right-panel-width, 0px)",transform:l?"translateX(212px)":"translateX(0)",transition:"transform 200ms ease-in-out, right 200ms ease-out"},children:(0,n.jsxs)("nav",{ref:u,"aria-label":t.view.tocTitle,className:"flex flex-col gap-0.5 overflow-y-auto min-h-0 flex-1 py-5 pl-2 pr-3 border-l border-border",style:{background:"var(--background)"},children:[(0,n.jsx)("p",{className:"text-2xs font-semibold uppercase tracking-wider px-2 mb-1 text-muted-foreground/50 shrink-0",children:t.view.tocTitle}),r.map((e,t)=>{let r=(e.level-a)*14,s=o===e.id,l=e.level>a;return(0,n.jsx)("a",{ref:t=>{t?m.current.set(e.id,t):m.current.delete(e.id)},href:`#${e.id}`,onClick:t=>((e,t)=>{e.preventDefault();let r=document.getElementById(t);if(!r)return;let n=r.getBoundingClientRect().top+window.scrollY-56;window.scrollTo({top:n,behavior:"smooth"}),i(t)})(t,e.id),className:(0,X.cn)("block text-xs py-1 rounded transition-colors duration-100 leading-snug shrink-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",s&&"font-medium"),style:{paddingLeft:`${8+r}px`,paddingRight:"8px",borderLeft:"2px solid",borderLeftColor:s?"var(--amber)":l?"var(--border)":"transparent",marginLeft:l?"7px":"0",...s?{color:"var(--amber)",background:"var(--amber-dim)"}:{color:"var(--muted-foreground)"}},title:e.text,children:(0,n.jsx)("span",{className:"line-clamp-2",suppressHydrationWarning:!0,children:e.text})},`${e.id}-${t}`)})]})})]})}let ee="findip-highlight",et="findip-active";function er({containerRef:e,onClose:t}){let{t:r}=(0,I.Y)(),[a,o]=(0,s.useState)(""),[i,l]=(0,s.useState)(0),d=(0,s.useRef)(null),c=(0,s.useRef)([]);(0,s.useEffect)(()=>{d.current?.focus()},[]);let m=(0,s.useCallback)(()=>{for(let e of c.current){let t=e.parentNode;t&&(t.replaceChild(document.createTextNode(e.textContent||""),e),t.normalize())}c.current=[]},[]);(0,s.useEffect)(()=>{m(),l(0);let t=e.current;if(!t||!a.trim())return;let r=a.toLowerCase(),n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.parentElement?.closest("[data-find-in-page]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),s=[];for(;n.nextNode();)s.push(n.currentNode);let o=[];for(let e of s){let t=e.textContent||"",n=t.toLowerCase(),s=0,a=[];for(;;){let e=n.indexOf(r,s);if(-1===e)break;a.push(e),s=e+r.length}if(0===a.length)continue;let i=e.parentNode;if(!i)continue;let l=document.createDocumentFragment(),d=0;for(let e of a){e>d&&l.appendChild(document.createTextNode(t.slice(d,e)));let n=document.createElement("mark");n.className=ee,n.textContent=t.slice(e,e+r.length),l.appendChild(n),o.push(n),d=e+r.length}d<t.length&&l.appendChild(document.createTextNode(t.slice(d))),i.replaceChild(l,e)}return c.current=o,l(+(o.length>0)),o.length>0&&(o[0].classList.add(et),o[0].scrollIntoView({block:"center",behavior:"smooth"})),()=>{}},[a,e,m]),(0,s.useEffect)(()=>()=>{m()},[m]);let x=c.current.length,p=(0,s.useCallback)(e=>{let t=c.current;if(0===t.length)return;for(let e of t)e.classList.remove(et);let r=((e-1)%t.length+t.length)%t.length;t[r].classList.add(et),t[r].scrollIntoView({block:"center",behavior:"smooth"}),l(r+1)},[]),h=(0,s.useCallback)(()=>p(i+1),[i,p]),f=(0,s.useCallback)(()=>p(i-1),[i,p]),g=(0,s.useCallback)(e=>{"Escape"===e.key?(e.preventDefault(),t()):"Enter"===e.key&&(e.preventDefault(),e.shiftKey?f():h())},[t,h,f]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("style",{children:`
|
|
2
|
+
mark.${ee} {
|
|
3
|
+
background: rgba(250, 204, 21, 0.3);
|
|
4
|
+
color: inherit;
|
|
5
|
+
border-radius: 2px;
|
|
6
|
+
padding: 0;
|
|
7
|
+
}
|
|
8
|
+
mark.${et} {
|
|
9
|
+
background: rgba(250, 204, 21, 0.7);
|
|
10
|
+
outline: 2px solid rgba(250, 204, 21, 0.5);
|
|
11
|
+
}
|
|
12
|
+
`}),(0,n.jsx)("div",{className:"sticky top-[96px] md:top-[44px] z-30 flex justify-end px-4 md:px-6 pointer-events-none","data-find-in-page":!0,children:(0,n.jsxs)("div",{className:"pointer-events-auto flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card shadow-lg",children:[(0,n.jsx)("input",{ref:d,type:"text",value:a,onChange:e=>o(e.target.value),onKeyDown:g,placeholder:r.findInPage.placeholder,className:"w-[180px] sm:w-[220px] px-2 py-1 text-sm bg-transparent text-foreground placeholder:text-muted-foreground outline-none"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0 min-w-[48px] text-center font-display",children:a.trim()?x>0?r.findInPage.matchCount(i,x):r.findInPage.noResults:""}),(0,n.jsx)("button",{onClick:f,disabled:0===x,className:"p-1 rounded text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors","aria-label":"Previous match",children:(0,n.jsx)(A.A,{size:14})}),(0,n.jsx)("button",{onClick:h,disabled:0===x,className:"p-1 rounded text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors","aria-label":"Next match",children:(0,n.jsx)(E.A,{size:14})}),(0,n.jsx)("button",{onClick:t,className:"p-1 rounded text-muted-foreground hover:text-foreground transition-colors","aria-label":"Close find",children:(0,n.jsx)(u.A,{size:14})})]})})]})}var en=r(46838),es=r(70620),ea=r(94885),eo=r(16230),ei=r(6517),el=r(4235),ed=r(39498),ec=r(97631),eu=r(10377);let em=(0,l.A)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);var ex=r(92451),ep=r(94514);function eh({open:e,onClose:t,filePath:r,isDirectory:a,fileName:o}){let{t:i}=(0,I.Y)(),[l,d]=(0,s.useState)(a?"zip":"md"),[c,x]=(0,s.useState)("idle"),[p,h]=(0,s.useState)(""),g=(0,s.useRef)(null),v=(0,s.useCallback)(()=>{x("exporting"),h("");let e=new AbortController;g.current=e,fetch(`/api/export?path=${encodeURIComponent(r)}&format=${l}`,{signal:e.signal}).then(e=>{if(!e.ok){if((e.headers.get("content-type")??"").includes("json"))return e.json().then(e=>{throw Error(e.error||"Export failed")});throw Error(`Export failed (${e.status})`)}return e.blob().then(t=>({blob:t,res:e}))}).then(({blob:e,res:t})=>{let r=(t.headers.get("Content-Disposition")??"").match(/filename="?([^"]+)"?/),n=r?decodeURIComponent(r[1]):o,s=document.createElement("a");s.href=URL.createObjectURL(e),s.download=n,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(s.href),x("done"),el.oR.success(i.export?.downloaded??"Downloaded")}).catch(e=>{"AbortError"!==e.name&&(x("error"),h(e.message??"Export failed"))}).finally(()=>{g.current=null})},[r,l,o,i]),y=(0,s.useCallback)(()=>{g.current&&(g.current.abort(),g.current=null),x("idle"),h("")},[]),j=(0,s.useCallback)(()=>{x("idle"),h("")},[]),w=(0,s.useCallback)(()=>{g.current&&g.current.abort(),g.current=null,x("idle"),h(""),t()},[t]);if(!e)return null;let k=a?[{value:"zip",label:i.export?.formatZipMd??"Markdown ZIP",desc:i.export?.formatZipMdDesc??"All files in original format",icon:(0,n.jsx)(em,{size:14})},{value:"zip-html",label:i.export?.formatZipHtml??"HTML ZIP",desc:i.export?.formatZipHtmlDesc??"All files as webpages",icon:(0,n.jsx)(ex.A,{size:14})}]:[{value:"md",label:i.export?.formatMd??"Markdown (.md)",desc:i.export?.formatMdDesc??"Original format, editable",icon:(0,n.jsx)(f.A,{size:14})},{value:"html",label:i.export?.formatHtml??"HTML (.html)",desc:i.export?.formatHtmlDesc??"Static webpage, shareable",icon:(0,n.jsx)(ex.A,{size:14})}];return(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:"exporting"===c?void 0:w,children:(0,n.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-xl max-w-md w-full mx-4 animate-in fade-in-0 zoom-in-95 duration-200",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(b.A,{size:15,className:"text-[var(--amber)]"}),(0,n.jsx)("h3",{className:"text-sm font-semibold font-display",children:a?i.export?.exportSpace??"Export Space":i.export?.exportFile??"Export File"})]}),(0,n.jsx)("button",{onClick:w,className:"p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":i.export?.cancel??"Close",children:(0,n.jsx)(u.A,{size:14})})]}),(0,n.jsx)("div",{className:"px-5 py-4",children:"done"===c?(0,n.jsxs)("div",{className:"text-center py-6",children:[(0,n.jsx)("div",{className:"w-10 h-10 rounded-full bg-success/10 flex items-center justify-center mx-auto mb-3",children:(0,n.jsx)(ep.A,{size:20,className:"text-success"})}),(0,n.jsx)("p",{className:"text-sm font-medium font-display",children:i.export?.done??"Export Complete"}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:o})]}):"error"===c?(0,n.jsxs)("div",{className:"text-center py-6",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-error",children:i.export?.error??"Export failed"}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:p})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-xs text-muted-foreground mb-3 truncate",title:r,children:r}),(0,n.jsx)("p",{className:"text-xs font-medium font-display text-foreground mb-2",children:i.export?.chooseFormat??"Choose format"}),(0,n.jsx)("div",{className:"space-y-1.5",children:k.map(e=>(0,n.jsxs)("label",{className:`flex items-start gap-3 p-3 rounded-lg border cursor-pointer transition-all ${l===e.value?"border-[var(--amber)]/40 bg-[var(--amber-dim)]":"border-border hover:border-border/80 hover:bg-muted/30"} ${e.disabled?"opacity-40 cursor-not-allowed":""}`,children:[(0,n.jsx)("input",{type:"radio",name:"export-format",value:e.value,checked:l===e.value,onChange:()=>!e.disabled&&d(e.value),disabled:e.disabled,className:"sr-only"}),(0,n.jsx)("span",{className:`mt-0.5 ${l===e.value?"text-[var(--amber)]":"text-muted-foreground"}`,children:e.icon}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.label}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground block mt-0.5",children:e.desc})]})]},e.value))})]})}),(0,n.jsx)("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border",children:"done"===c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:j,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:i.export?.downloadAgain??"Download Again"}),(0,n.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:i.export?.close??"Done"})]}):"error"===c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:i.export?.cancel??"Cancel"}),(0,n.jsx)("button",{onClick:j,className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:i.export?.retry??"Retry"})]}):"exporting"===c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:y,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:i.export?.cancel??"Cancel"}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium text-[var(--amber-text)] opacity-70",children:[(0,n.jsx)(m.A,{size:12,className:"animate-spin"})," ",i.export?.exporting??"Exporting..."]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:i.export?.cancel??"Cancel"}),(0,n.jsxs)("button",{onClick:v,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:[(0,n.jsx)(b.A,{size:12})," ",i.export?.exportButton??"Export"]})]})})]})})}function ef({filePath:e,content:t,extension:r,saveAction:l,appendRowAction:N,initialEditing:C=!1,isDraft:A=!1,draftDirectories:E=[],createDraftAction:z}){let{t:S}=(0,I.Y)(),{isPinned:M,togglePin:L}=(0,eu.Z)(),T=M(e),[$,P]=(0,s.useState)(!1),D=(0,s.useSyncExternalStore)(()=>()=>{},()=>!0,()=>!1),[F,U]=(0,H.Un)("_raw",e,!1),[W,B]=(0,s.useState)(!1),Y=(0,a.useRouter)(),[_,K]=(0,s.useState)(C||""===t),[q,J]=(0,s.useState)(t),[Z,ee]=(0,s.useState)(t);(0,s.useEffect)(()=>{_||ee(t)},[t,_]);let[et,em]=(0,s.useTransition)(),[ex,ep]=(0,s.useState)(null),[ef,eg]=(0,s.useState)(!1),[eb,ev]=(0,s.useState)("wysiwyg"),[ey,ej]=(0,s.useState)(!1),ew=(0,s.useRef)(null),[ek,eN]=(0,s.useState)(!1),eC=(0,s.useRef)(null),eA=(0,s.useRef)(null),[eE,ez]=(0,s.useState)(!1),[eS,eM]=(0,s.useState)(!1),[eL,eT]=(0,s.useState)(""),[,eR]=(0,s.useTransition)(),e$=e.split("/").pop()||"Untitled.md",[eP,eD]=(0,s.useState)(A),[eI,eF]=(0,s.useState)(""),[eO,eH]=(0,s.useState)(e$);(0,s.useEffect)(()=>{if(!ek)return;let e=e=>{eC.current&&!eC.current.contains(e.target)&&eA.current&&!eA.current.contains(e.target)&&eN(!1)},t=e=>{"Escape"===e.key&&eN(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[ek]);let eV=(0,s.useCallback)(()=>{navigator.clipboard.writeText(e).catch(()=>{}),eN(!1)},[e]),eU=(0,s.useCallback)(()=>{eN(!1),eT(e.split("/").pop()??""),eM(!0)},[e]),eW=(0,s.useCallback)(()=>{let t=eL.trim();t&&t!==e.split("/").pop()?eR(async()=>{let r=await (0,ea.f)(e,t);eM(!1),r.success&&r.newPath&&(Y.push(`/view/${(0,X.O0)(r.newPath)}`),Y.refresh(),window.dispatchEvent(new Event("mindos:files-changed")))}):eM(!1)},[eL,e,Y]),eB=(0,s.useCallback)(()=>{ez(!1);let t=e.split("/").pop()??e;em(async()=>{let r=await (0,eo.i)(e);if(r.success){if(r.trashId){let e=r.trashId;el.oR.undo(`${S.trash?.movedToTrash??"Deleted"} ${t}`,async()=>{let t=await (0,ei.Y)(e);t.success?(Y.refresh(),window.dispatchEvent(new Event("mindos:files-changed"))):el.oR.error(t.error??"Undo failed")},{label:S.trash?.undo??"Undo"})}Y.push("/"),Y.refresh(),window.dispatchEvent(new Event("mindos:files-changed"))}})},[e,Y,S]),eY=!!D&&F,e_=(0,s.useCallback)(()=>{U(e=>!e)},[U]),eK=(0,s.useCallback)(()=>{B(e=>!e)},[B]),eq=(0,en.YB)(e,r),eG="md"===r&&W?(0,en.YB)(e,r,"graph"):void 0,eJ=eG||eq,eZ="csv"===r,eX=!_&&!!eJ&&(!eY||!!eG),eQ=(0,s.useMemo)(()=>eJ?eJ.component?eJ.component:eJ.load?(0,s.lazy)(eJ.load):null:null,[eJ]),e0=(0,s.useCallback)(()=>{J(Z),K(!0),ep(null),eg(!1)},[Z]),e1=(0,s.useCallback)(()=>{A?Y.push("/"):(K(!1),ep(null))},[A,Y]),e2=(0,s.useCallback)(()=>{let e=eO.trim();if(!e)return void ep("Please enter a file name");if(/[/\\:*?"<>|]/.test(e)||e.includes(".."))return void ep("File name contains invalid characters");if(!z)return void ep("Draft save is not available");let t=e.endsWith(".md")||e.endsWith(".csv")?e:`${e}.md`,r=eI?`${eI}/${t}`:t;ep(null),em(async()=>{try{await z(r,q),ee(q),K(!1),eD(!1),eg(!0),setTimeout(()=>eg(!1),2500),Y.push(`/view/${(0,X.O0)(r)}`),Y.refresh()}catch(e){ep(e instanceof Error?e.message:"Failed to save")}})},[eO,z,eI,q,Y]),e5=(0,s.useCallback)(()=>{if(eZ){K(!1),eg(!0),setTimeout(()=>eg(!1),2500);return}A?eD(!0):(ep(null),em(async()=>{try{await l(q),ee(q),K(!1),eg(!0),setTimeout(()=>eg(!1),2500)}catch(e){ep(e instanceof Error?e.message:"Failed to save")}}))},[eZ,A,l,q]),e3=(0,s.useCallback)(async e=>{await l(e),ee(e)},[l]);(0,s.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),_&&e5()),(e.metaKey||e.ctrlKey)&&"f"===e.key&&!_&&(e.preventDefault(),ej(!0)),"e"!==e.key||_||document.activeElement?.tagName!=="BODY"||e0(),"Escape"===e.key&&_&&e1()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[_,e5,e0,e1]);let[e4,e6]=(0,s.useState)(!1),[e8,e7]=(0,s.useState)([]),e9=(0,s.useRef)(t),te=(0,s.useRef)(!1),tt=(0,s.useRef)(null),tr=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!_&&te.current&&t!==e9.current&&""!==e9.current){te.current=!1;let e=(0,ec.m)(e9.current,t),r=[],n=1;for(let t of e)"insert"===t.type?(r.push(n),n++):"equal"===t.type&&n++;r.length>0&&(e7(r),tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>e7([]),6e3),setTimeout(()=>{let e=document.querySelector("[data-highlight-line]");e&&e.scrollIntoView({block:"center",behavior:"smooth"})},100))}e9.current=t},[t,_]),(0,s.useEffect)(()=>{let e=null,t=()=>{_||(e&&clearTimeout(e),e=setTimeout(()=>{te.current=!0,Y.refresh(),e6(!0),tr.current&&clearTimeout(tr.current),tr.current=setTimeout(()=>e6(!1),3e3)},300))};return window.addEventListener("mindos:files-changed",t),()=>{window.removeEventListener("mindos:files-changed",t),e&&clearTimeout(e)}},[_,Y]),(0,n.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,n.jsx)("div",{className:"sticky top-[52px] md:top-0 z-20 border-b border-border px-4 md:px-6 py-2.5",style:{background:"var(--background)"},children:(0,n.jsxs)("div",{className:"content-width flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 flex items-center gap-1.5",children:[(0,n.jsx)("button",{onClick:()=>Y.back(),className:"md:hidden p-1 -ml-1 rounded text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Go back",children:(0,n.jsx)(o.A,{size:16})}),(0,n.jsx)(V.A,{filePath:e})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 md:gap-2 shrink-0",children:[e4&&!_&&(0,n.jsxs)("span",{className:"text-xs flex items-center gap-1.5 text-[var(--amber)] animate-in fade-in-0 duration-200",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)]"}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"updated"})]}),ef&&(0,n.jsxs)("span",{className:"text-xs flex items-center gap-1.5 font-display",style:{color:"var(--success)"},children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--success)"}}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"saved"})]}),ex&&(0,n.jsx)("span",{className:"text-xs text-error hidden sm:inline",children:ex}),eq&&!_&&!A&&!eG&&(0,n.jsxs)("button",{onClick:e_,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors font-display",style:{background:eY?"var(--amber)22":"var(--muted)",color:eY?"var(--amber)":"var(--muted-foreground)"},title:eY?`Switch to ${eq?.name}`:"View raw",children:[eY?(0,n.jsx)(i.A,{size:13}):(0,n.jsx)(d,{size:13}),(0,n.jsx)("span",{className:"hidden sm:inline",children:eY?eq.name:"Raw"})]}),!_&&!eX&&!A&&(0,n.jsxs)("button",{onClick:e0,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.color="var(--foreground)",e.currentTarget.style.background="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--muted-foreground)",e.currentTarget.style.background="var(--muted)"},children:[(0,n.jsx)(c,{size:13}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Edit"})]}),_&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{onClick:e1,disabled:et,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors disabled:opacity-50 font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.background="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--muted)"},children:[(0,n.jsx)(u.A,{size:13}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Cancel"})]}),(0,n.jsxs)("button",{onClick:A&&eP?e2:e5,disabled:et,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium disabled:opacity-50 font-display",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[et?(0,n.jsx)(m.A,{size:13,className:"animate-spin"}):(0,n.jsx)(x.A,{size:13}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Save"})]})]}),!A&&(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("button",{type:"button",onClick:()=>L(e),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:T?S.fileTree.removeFromFavorites:S.fileTree.pinToFavorites,children:(0,n.jsx)(p.A,{size:16,className:T?"fill-[var(--amber)] text-[var(--amber)]":""})}),(0,n.jsx)("button",{ref:eC,type:"button",onClick:()=>eN(e=>!e),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:S.view?.more??"More",children:(0,n.jsx)(h.A,{size:16})}),ek&&(0,n.jsxs)("div",{ref:eA,className:"absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-border bg-card shadow-lg py-1",children:["md"===r&&!_&&!A&&(0,en.pl)("graph")&&(0,n.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{eN(!1),eK()},children:[W?(0,n.jsx)(f.A,{size:14,className:"shrink-0"}):(0,n.jsx)(g,{size:14,className:"shrink-0"}),W?S.view?.switchToDoc??"Document view":S.view?.switchToGraph??"Wiki Graph"]}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{eN(!1),P(!0)},children:[(0,n.jsx)(b.A,{size:14,className:"shrink-0"})," ",S.fileTree?.export??"Export"]}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:eV,children:[(0,n.jsx)(v.A,{size:14,className:"shrink-0"})," ",S.view?.copyPath??S.fileTree?.copyPath??"Copy Path"]}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:eU,children:[(0,n.jsx)(y.A,{size:14,className:"shrink-0"})," ",S.view?.rename??"Rename"]}),(0,n.jsx)("div",{className:"my-1 border-t border-border/50"}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",onClick:()=>{eN(!1),ez(!0)},children:[(0,n.jsx)(j.A,{size:14,className:"shrink-0"})," ",S.view?.delete??"Delete"]})]})]})]})]})}),(0,n.jsx)("div",{className:"flex-1 px-4 md:px-6 py-6 md:py-8",children:_?(0,n.jsxs)("div",{className:"content-width",children:[A&&eP&&(0,n.jsxs)("div",{className:"mb-3 rounded-lg border border-border bg-card p-3 flex flex-col gap-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground",children:S.view?.saveDirectory??"Directory"}),(0,n.jsx)("div",{className:"mt-1",children:(0,n.jsx)(es.A,{dirPaths:E,value:eI,onChange:eF,rootLabel:S.home?.rootLevel??"Root"})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground",children:S.view?.saveFileName??"File name"}),(0,n.jsx)("input",{value:eO,onChange:e=>eH(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e2()},className:"mt-1 w-full px-2.5 py-1.5 text-sm bg-background border border-border rounded-lg text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:"Untitled.md"})]})]}),eZ?(0,n.jsx)(R,{content:q,filePath:e,appendAction:N,saveAction:async e=>{await l(e),J(e),ee(e)}}):(0,n.jsx)(G,{value:q,onChange:J,viewMode:eb,onViewModeChange:ev})]}):eX&&eQ?(0,n.jsxs)("div",{ref:ew,className:"content-width",children:[ey&&(0,n.jsx)(er,{containerRef:ew,onClose:()=>ej(!1)}),(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,n.jsx)(m.A,{size:20,className:"animate-spin text-muted-foreground"})}),children:(0,n.jsx)(eQ,{filePath:e,content:Z,extension:r,saveAction:e3})}),(0,n.jsx)(O,{filePath:e})]}):(0,n.jsxs)("div",{ref:ew,className:"content-width",children:[ey&&(0,n.jsx)(er,{containerRef:ew,onClose:()=>ej(!1)}),"csv"===r?(0,n.jsx)(R,{content:Z,filePath:e}):"json"===r?(0,n.jsx)(k,{content:Z}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w.default,{content:Z,highlightLines:e8,onDismissHighlight:()=>e7([]),emptyPlaceholder:S.view?.emptyNote}),(0,n.jsx)(Q,{content:Z})]}),(0,n.jsx)(O,{filePath:e})]})}),eS&&(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-sm",children:(0,n.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-lg p-4 w-80",children:[(0,n.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Rename"}),(0,n.jsx)("input",{autoFocus:!0,value:eL,onChange:e=>eT(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eW(),"Escape"===e.key&&eM(!1)},className:"w-full bg-muted border border-border rounded-md px-3 py-1.5 text-sm text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),(0,n.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,n.jsx)("button",{onClick:()=>eM(!1),className:"px-3 py-1.5 rounded-md text-xs bg-muted text-muted-foreground hover:bg-accent transition-colors",children:S.view?.cancel??"Cancel"}),(0,n.jsx)("button",{onClick:eW,className:"px-3 py-1.5 rounded-md text-xs bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors",children:S.view?.rename??"Rename"})]})]})}),(0,n.jsx)(ed.TM,{open:eE,title:S.view?.delete??"Delete",message:S.view?.deleteConfirm?.(e.split("/").pop()??"")??`Delete "${e.split("/").pop()}"?`,confirmLabel:S.view?.delete??"Delete",cancelLabel:S.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>ez(!1),onConfirm:eB}),(0,n.jsx)(eh,{open:$,onClose:()=>P(!1),filePath:e,isDirectory:!1,fileName:e.split("/").pop()??e})]})}},39498:(e,t,r)=>{"use strict";r.d(t,{BK:()=>y,DO:()=>c,KF:()=>l,Mv:()=>m,TM:()=>v,ZC:()=>b,lx:()=>g,md:()=>d,pp:()=>x,rA:()=>u});var n=r(95155),s=r(33210),a=r(6296),o=r(51914),i=r(12115);function l({active:e,label:t,onClick:r}){return(0,n.jsx)("button",{type:"button",onClick:r,"aria-pressed":e,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${e?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:t})}function d({tone:e,label:t,count:r}){return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,n.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===e?"bg-[var(--success)]":"warn"===e?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"text-xs",children:t}),(0,n.jsx)("span",{className:`tabular-nums font-medium ${"ok"===e?"text-foreground":"warn"===e?"text-[var(--amber)]":"text-muted-foreground"}`,children:r})]})}function c({value:e,onChange:t,placeholder:r,ariaLabel:a,icon:o}){return(0,n.jsxs)("label",{className:"relative block group/search",children:[(0,n.jsx)(o,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,n.jsx)("input",{value:e,onChange:e=>t(e.target.value),placeholder:r,"aria-label":a,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),e.length>0&&(0,n.jsx)("button",{type:"button",onClick:()=>t(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,n.jsx)(s.A,{size:13})})]})}function u({onClick:e,disabled:t,busy:r,label:s,busyLabel:o,variant:i="default"}){return(0,n.jsxs)("button",{type:"button",onClick:e,disabled:t,"aria-busy":r,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}[i]}`,children:[r&&(0,n.jsx)(a.A,{size:12,className:"animate-spin","aria-hidden":"true"}),r?o??s:s]})}function m({message:e}){return e?(0,n.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:e}):null}function x({message:e,icon:t,className:r}){return(0,n.jsxs)("div",{className:`rounded-xl border border-dashed border-border/60 bg-gradient-to-b from-card/80 to-card/40 p-10 text-center ${r??""}`,children:[t&&(0,n.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:t}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:e})]})}let p=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function h(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return Math.abs(t)}function f(e){let t=e.split(/[\s\-_]+/).filter(Boolean);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function g({name:e,status:t,size:r="md",onRemove:a,href:o}){let[i,l,d]=p[h(e)%p.length],c="connected"===t?"bg-[var(--success)]":"detected"===t?"bg-[var(--amber)]":"bg-muted-foreground";return(0,n.jsxs)("div",{className:"relative group/avatar",title:e,children:[(0,n.jsx)("div",{className:`${"sm"===r?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${i} ${l} ${d} border rounded-full flex items-center justify-center font-semibold select-none`,children:f(e)}),t&&(0,n.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${c}`,"aria-hidden":"true"}),a&&(0,n.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),a()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-white flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${e}`,children:(0,n.jsx)(s.A,{size:9})})]})}function b({onClick:e,label:t,size:r="md"}){return(0,n.jsx)("button",{type:"button",onClick:e,title:t,"aria-label":t,className:`${"sm"===r?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,n.jsx)(o.A,{size:14})})}function v({open:e,title:t,message:r,confirmLabel:s,cancelLabel:a,onConfirm:o,onCancel:l,variant:d="destructive"}){let c=(0,i.useRef)(null);return((0,i.useEffect)(()=>{e&&c.current?.focus()},[e]),(0,i.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&l()}},[e,l]),e)?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-label":t,children:[(0,n.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:l,"aria-hidden":"true"}),(0,n.jsxs)("div",{className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1.5",children:t}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:r}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)("button",{ref:c,type:"button",onClick:l,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:a}),(0,n.jsx)("button",{type:"button",onClick:o,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===d?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}`,children:s})]})]})]}):null}function y({open:e,agents:t,emptyLabel:r,onSelect:s,onClose:a}){let o=(0,i.useRef)(null);return((0,i.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){o.current&&!o.current.contains(e.target)&&a()}},[e,a]),(0,i.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&a()}},[e,a]),e)?(0,n.jsx)("div",{ref:o,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===t.length?(0,n.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:r}):(0,n.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:t.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>s(e.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[t,r,s]=p[h(e.name)%p.length];return(0,n.jsx)("div",{className:`w-6 h-6 rounded-full border ${t} ${r} ${s} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:f(e.name)})})(),e.name]},e.key))})}):null}},41585:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},44406:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(95155),s=r(98500),a=r.n(s),o=r(33078),i=r(48368),l=r(38798),d=r(66614),c=r(21362);function u({name:e}){let t=e.includes(".")?e.slice(e.lastIndexOf(".")).toLowerCase():"";return".csv"===t?(0,n.jsx)(o.A,{size:13,className:"text-success shrink-0"}):t?(0,n.jsx)(i.A,{size:13,className:"text-muted-foreground shrink-0"}):(0,n.jsx)(l.A,{size:13,className:"text-yellow-400 shrink-0"})}function m({filePath:e}){let t=e.split("/");return(0,n.jsxs)("nav",{className:"flex items-center gap-1 text-xs text-muted-foreground flex-wrap font-display",children:[(0,n.jsx)(a(),{href:"/",className:"hover:text-foreground transition-colors",children:(0,n.jsx)(d.A,{size:14})}),t.map((e,r)=>{let s=r===t.length-1,o="/view/"+t.slice(0,r+1).map(encodeURIComponent).join("/");return(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(c.A,{size:12,className:"text-muted-foreground/50"}),s?(0,n.jsxs)("span",{className:"flex items-center gap-1.5 text-foreground font-medium",children:[(0,n.jsx)(u,{name:e}),(0,n.jsx)("span",{suppressHydrationWarning:!0,children:e})]}):(0,n.jsx)(a(),{href:o,className:"px-2 py-0.5 rounded-md hover:bg-muted/50 transition-colors truncate max-w-[200px]",title:e,children:(0,n.jsx)("span",{suppressHydrationWarning:!0,children:e})})]},r)})]})}},46838:(e,t,r)=>{"use strict";r.d(t,{$7:()=>o,MZ:()=>c,TS:()=>l,UG:()=>a,YB:()=>d,pl:()=>i});let n=[],s=new Set;function a(){try{let e=localStorage.getItem("mindos-disabled-renderers");s=new Set(e?JSON.parse(e):[])}catch{s=new Set}}function o(e,t){let r=n.find(t=>t.id===e);r?.core||(t?s.delete(e):s.add(e),localStorage.setItem("mindos-disabled-renderers",JSON.stringify([...s])))}function i(e){let t=n.find(t=>t.id===e);return!!t?.core||!s.has(e)}function l(e){n.find(t=>t.id===e.id)||n.push(e)}function d(e,t,r){if(r){let e=n.find(e=>e.id===r);return e&&i(e.id)?e:void 0}return n.find(r=>i(r.id)&&r.match({filePath:e,extension:t}))}function c(){return n.filter(e=>!e.appBuiltinFeature)}},51914:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},55243:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},56699:(e,t,r)=>{Promise.resolve().then(r.bind(r,36506)),Promise.resolve().then(r.bind(r,34367))},63637:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(95155),s=r(66804),a=r(32957),o=r(98076),i=r(96182),l=r(16535),d=r(12115),c=r(94514),u=r(67635),m=r(33210),x=r(7834),p=r(4235);function h({code:e}){let[t,r]=(0,d.useState)(!1),s=(0,d.useCallback)(()=>{(0,x.l)(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),2e3),p.oR.copy())})},[e]);return(0,n.jsx)("button",{onClick:s,className:" absolute top-2.5 right-2.5 p-1.5 rounded-md bg-muted hover:bg-accent text-muted-foreground hover:text-foreground transition-colors duration-100 opacity-0 group-hover:opacity-100 ",title:"Copy code",children:t?(0,n.jsx)(c.A,{size:13}):(0,n.jsx)(u.A,{size:13})})}function f(e){let{node:t,inline:r,ordered:n,depth:s,isHeader:a,...o}=e;return o}function g(e){let t=({children:t,...r})=>(0,n.jsx)(e,{...f(r),suppressHydrationWarning:!0,children:t});return t.displayName=e,t}let b={h1:g("h1"),h2:g("h2"),h3:g("h3"),h4:g("h4"),h5:g("h5"),h6:g("h6"),code:({children:e,node:t,...r})=>(0,n.jsx)("code",{...f(r),suppressHydrationWarning:!0,children:e}),pre({children:e,node:t,...r}){let s="";return e&&"object"==typeof e&&"props"in e&&(s=function e(t){return"string"==typeof t?t:Array.isArray(t)?t.map(e).join(""):t&&"object"==typeof t&&"props"in t?e(t.props?.children):""}(e.props?.children)),(0,n.jsxs)("div",{className:"relative group",children:[(0,n.jsx)("pre",{...f(r),suppressHydrationWarning:!0,children:e}),(0,n.jsx)(h,{code:s})]})},li:({children:e,node:t,...r})=>(0,n.jsx)("li",{...f(r),suppressHydrationWarning:!0,children:e}),p:({children:e,node:t,...r})=>(0,n.jsx)("p",{...f(r),suppressHydrationWarning:!0,children:e}),a({href:e,children:t,node:r,...s}){let a=e?.startsWith("http");return(0,n.jsx)("a",{href:e,target:a?"_blank":void 0,rel:a?"noopener noreferrer":void 0,...f(s),children:t})},img:({src:e,alt:t,node:r,...s})=>e?(0,n.jsx)("img",{src:e,alt:t??"",...f(s)}):null};function v({content:e,highlightLines:t,onDismissHighlight:r,emptyPlaceholder:d}){let c=t&&t.length>0;return!e.trim()&&d?(0,n.jsx)("div",{className:"py-12 text-center text-sm text-muted-foreground/50",children:d}):(0,n.jsxs)("div",{children:[c&&(0,n.jsxs)("div",{className:"mb-4 flex items-center gap-2 rounded-md border px-3 py-2 text-xs animate-in fade-in-0 duration-300",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",background:"color-mix(in srgb, var(--amber) 8%, var(--card))",color:"var(--amber)"},"data-highlight-line":!0,children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)] animate-pulse shrink-0"}),(0,n.jsxs)("span",{className:"font-display font-medium flex-1",children:[t.length," line",1!==t.length?"s":""," updated by AI"]}),r&&(0,n.jsx)("button",{type:"button",onClick:r,className:"p-0.5 rounded hover:bg-[var(--amber)]/15 transition-colors shrink-0","aria-label":"Dismiss",children:(0,n.jsx)(m.A,{size:12})})]}),(0,n.jsx)("div",{className:"prose max-w-none",children:(0,n.jsx)(s.oz,{remarkPlugins:[a.A],rehypePlugins:[l.A,o.A,i.A],components:b,children:e})})]})}},66614:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]])},67635:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},68459:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},70620:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(95155),s=r(12115),a=r(47650),o=r(21362),i=r(38798),l=r(94514),d=r(66088),c=r(91337);function u({dirPaths:e,value:t,onChange:r,rootLabel:u="Root"}){let[m,x]=(0,s.useState)(!1),[p,h]=(0,s.useState)(t),[f,g]=(0,s.useState)(null),b=(0,s.useRef)(null),v=(0,s.useRef)(null);(0,s.useEffect)(()=>{h(t)},[t]);let y=(0,s.useCallback)(()=>{if(!b.current)return;let e=b.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top,n=t<208&&r>t;g({top:n?e.top:e.bottom,left:e.left,width:e.width,flipUp:n})},[]);(0,s.useEffect)(()=>m?(y(),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}):void g(null),[m,y]);let j=(0,s.useCallback)(()=>x(!1),[]);(0,s.useEffect)(()=>{if(!m)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),j())},t=e=>{let t=e.target;b.current?.contains(t)||v.current?.contains(t)||j()};return document.addEventListener("keydown",e),document.addEventListener("mousedown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",t)}},[m,j]);let w=(0,s.useMemo)(()=>{let t=p?p+"/":"";return e.filter(e=>{if(!e.startsWith(t))return!1;let r=e.slice(t.length);return r.length>0&&!r.includes("/")}).sort()},[e,p]),k=(0,s.useMemo)(()=>p?p.split("/"):[],[p]),N=e=>{if(e<0)h(""),r("");else{let t=k.slice(0,e+1).join("/");h(t),r(t)}},C=t?t.split("/").map(e=>(0,c.vr)(e)).join(" / "):"/ "+u,A=m&&f&&(0,a.createPortal)((0,n.jsxs)("div",{ref:v,className:"fixed z-[9999] rounded-lg border border-[var(--amber)] bg-card shadow-lg overflow-hidden flex flex-col",style:{left:f.left,width:f.width,maxHeight:200,...f.flipUp?{bottom:window.innerHeight-f.top+4}:{top:f.top+4}},children:[(0,n.jsxs)("div",{className:"flex items-center gap-0.5 px-3 py-1.5 bg-muted/30 border-b border-border overflow-x-auto text-xs shrink-0",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>N(-1),className:`shrink-0 px-1.5 py-0.5 rounded transition-colors ${""===p?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:["/ ",u]}),k.map((e,t)=>(0,n.jsxs)("span",{className:"flex items-center gap-0.5 shrink-0",children:[(0,n.jsx)(o.A,{size:10,className:"text-muted-foreground/50"}),(0,n.jsx)("button",{type:"button",onClick:()=>N(t),className:`px-1.5 py-0.5 rounded transition-colors truncate max-w-[100px] ${t===k.length-1?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:e})]},t))]}),w.length>0?(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:w.map(t=>{let s=t.split("/").pop()||t,a=e.some(e=>e.startsWith(t+"/"));return(0,n.jsxs)("button",{type:"button",onClick:()=>{h(t),r(t)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-muted/60 transition-colors",children:[(0,n.jsx)(i.A,{size:12,className:"shrink-0 text-[var(--amber)]"}),(0,n.jsx)("span",{className:"flex-1 text-left truncate",children:s}),a&&(0,n.jsx)(o.A,{size:11,className:"shrink-0 text-muted-foreground/40"})]},t)})}):(0,n.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground/50 text-center",children:"—"}),(0,n.jsx)("button",{type:"button",onClick:j,className:"w-full py-1.5 flex items-center justify-center gap-1 text-xs font-medium text-[var(--amber)] border-t border-border hover:bg-muted/30 transition-colors shrink-0",children:(0,n.jsx)(l.A,{size:12})})]}),document.body);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{ref:b,type:"button",onClick:()=>x(e=>!e),"aria-haspopup":"true","aria-expanded":m,className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-lg border bg-background text-foreground transition-colors text-left focus-visible:ring-1 focus-visible:ring-ring outline-none ${m?"border-[var(--amber)]":"border-border hover:border-[var(--amber)]/40"}`,children:[(0,n.jsx)(i.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,n.jsx)("span",{className:"flex-1 truncate",children:C}),(0,n.jsx)(d.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${m?"rotate-180":""}`})]}),A]})}},73321:(e,t,r)=>{"use strict";var n=r(74645);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},77148:(e,t,r)=>{"use strict";r.d(t,{Un:()=>a});var n=r(12115);let s="mindos-renderer-state-change";function a(e,t,r){let a=`mindos-renderer:${e}:${t}`,o=(0,n.useRef)({key:a,raw:null,parsed:r});return o.current.key!==a&&(o.current={key:a,raw:null,parsed:r}),[(0,n.useSyncExternalStore)(e=>{let t=()=>e();return window.addEventListener("storage",t),window.addEventListener(s,t),()=>{window.removeEventListener("storage",t),window.removeEventListener(s,t)}},()=>{try{let e=localStorage.getItem(a);if(e===o.current.raw)return o.current.parsed;if(null===e)return o.current={key:a,raw:null,parsed:r},r;let t=JSON.parse(e);return o.current={key:a,raw:e,parsed:t},t}catch{return r}},()=>r),(0,n.useCallback)(e=>{try{let t=(()=>{try{let e=localStorage.getItem(a);return null!==e?JSON.parse(e):r}catch{return r}})(),n="function"==typeof e?e(t):e,s=JSON.stringify(n);localStorage.setItem(a,s),o.current={key:a,raw:s,parsed:n}}catch{}window.dispatchEvent(new Event(s))},[a,r])]}},80723:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},82125:(e,t,r)=>{"use strict";r.d(t,{A:()=>s,C:()=>n});let n=new Set(["INSTRUCTION.md","README.md","CONFIG.json","CHANGELOG.md"]),s=new Set(["TODO.md"])},91337:(e,t,r)=>{"use strict";r.d(t,{IX:()=>l,KW:()=>i,O0:()=>o,cn:()=>a,vr:()=>d});var n=r(29722),s=r(622);function a(...e){return(0,s.QP)((0,n.$)(e))}function o(e){return e.split("/").map(encodeURIComponent).join("/")}function i(e,t){let r=Date.now()-e,n=Math.floor(r/6e4),s=Math.floor(r/36e5),a=Math.floor(r/864e5);return n<1?t.justNow:n<60?t.minutesAgo(n):s<24?t.hoursAgo(s):a<7?t.daysAgo(a):new Date(e).toLocaleDateString()}function l(e){let t=e.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return t?.[0]??""}function d(e){return e.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||e}},92451:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},93631:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]])},94885:(e,t,r)=>{"use strict";r.d(t,{f:()=>s});var n=r(9339);let s=(0,n.createServerReference)("60dc1ced67756a0567217fc70906cce7aff02e0060",n.callServer,void 0,n.findSourceMapURL,"renameFileAction")},97631:(e,t,r)=>{"use strict";function n(e,t){let r=e.split("\n"),n=t.split("\n"),s=r.length,a=n.length,o=Array.from({length:s+1},()=>Array(a+1).fill(0));for(let e=s-1;e>=0;e--)for(let t=a-1;t>=0;t--)o[e][t]=r[e]===n[t]?1+o[e+1][t+1]:Math.max(o[e+1][t],o[e][t+1]);let i=[],l=0,d=0;for(;l<s||d<a;){if(l<s&&d<a&&r[l]===n[d]){i.push({type:"equal",text:r[l]}),l+=1,d+=1;continue}if(d<a&&(l>=s||o[l][d+1]>=o[l+1][d])){i.push({type:"insert",text:n[d]}),d+=1;continue}i.push({type:"delete",text:r[l]}),l+=1}return i}function s(e,t=2){let r=new Set;e.forEach((n,s)=>{if("equal"!==n.type)for(let n=Math.max(0,s-t);n<=Math.min(e.length-1,s+t);n++)r.add(n)});let n=[],a=-1;for(let t=0;t<e.length;t++){if(r.has(t)){-1!==a&&(n.push({type:"gap",count:t-a}),a=-1),n.push(e[t]);continue}-1===a&&(a=t)}return -1!==a&&n.push({type:"gap",count:e.length-a}),n}r.d(t,{S:()=>s,m:()=>n})},97810:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(90425).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])}},e=>{e.O(0,[6926,9602,9286,3013,6357,1053,8441,3794,7358],()=>e(e.s=56699)),_N_E=e.O()}]);
|