1import{s as re}from"./chunk-LvLJmgfZ.js";import{d as be,l as oe,n as ae}from"./useEvent-D91BmmQi.js";import{t as je}from"./react-Bj1aDYRI.js";import{In as se,Ki as ve,Or as ke,Sr as we,Vt as Ne,br as _e,ki as ie,kr as Se,vr as ne}from"./cells-DOA0Gew8.js";import"./react-dom-CSu739Rf.js";import{t as le}from"./compiler-runtime-B3qBwwSJ.js";import{d as Ce,v as ce}from"./useEventListener-DvoEXWke.js";import{n as V}from"./constants-DMpttj8Q.js";import{t as ze}from"./ErrorBoundary-DyYDV0HI.js";import{t as Ie}from"./cn-DCUzRj2J.js";import{t as Me}from"./jsx-runtime-BqBOg78p.js";import"./fullscreen-DFky0PAA.js";import{o as Re}from"./alert-dialog-5BGIfskO.js";import"./popover-CNCYAwbC.js";import{a as Pe,c as De,p as Oe,r as Te,t as We}from"./dropdown-menu-CZ4XbE-c.js";import{t as Ae}from"./label-C2_YQRio.js";import{t as Fe}from"./tooltip-B_PkSKN3.js";import{t as B}from"./button-BbCh-29a.js";import"./dist-D0HyMpgV.js";import"./cjs-BRGiG41H.js";import"./main-B0OX4z33.js";import"./useNonce-DfoVjkkH.js";import{r as Y}from"./requests-DIwGYs0l.js";import{t as E}from"./createLucideIcon-D5guW7EU.js";import{t as Ue}from"./chart-no-axes-column-nqk474t8.js";import{r as $e}from"./x-C-6liIBr.js";import{t as Le}from"./chevron-right-CG5QYXYk.js";import{o as me,s as Ve}from"./tree-actions-1KQDSu1H.js";import{t as Ee}from"./circle-play-CYXX2xu3.js";import{t as Q}from"./external-link-BTNxSavU.js";import{r as He,t as Be}from"./file-icons-D2f3nfbq.js";import{t as Ye}from"./file-BrdxGLRX.js";import{t as qe}from"./github-BKS_2Qwn.js";import{n as Je,r as Ge,t as Qe}from"./youtube-CbdpN8oL.js";import{t as Ke}from"./link-CfEtM3Rl.js";import{t as K}from"./spinner-Bhir8k53.js";import{t as Xe}from"./package-Tv6ztuzw.js";import{a as Ze,i as et,l as tt,n as rt,o as ot,r as at,s as st,t as it}from"./file-name-input-BNYf9WWM.js";import{n as nt,r as lt,t as ct}from"./app-config-button-D_sFrSql.js";import{t as mt}from"./refresh-ccw-C-n2VFP5.js";import{dt,r as ht}from"./input-DA8xlX70.js";import"./dist-HyCgERnW.js";import"./dist-BwnT-_gD.js";import"./dist-rBRbke5D.js";import"./dist-RMRSa-Mj.js";import"./dist-BURue7-e.js";import{t as de}from"./use-toast-CJ1Tj2eC.js";import{n as he}from"./paths-D5zczhUD.js";import{c as pe,n as pt,o as ft,t as ut}from"./session-0B5NBztP.js";import"./purify.es-B9KxLTTS.js";import{s as xt}from"./dates-CTxr0EqQ.js";import{t as gt}from"./context-QkTujrKn.js";import{n as yt}from"./ImperativeModal-BW1dmntO.js";import{i as bt}from"./errors-D3F5g1xA.js";import{n as jt}from"./react-icons.esm-BNzu6e7h.js";import{t as fe}from"./error-banner-D0xvrLog.js";import{n as X,t as vt}from"./useAsyncData-bgszE9F0.js";import{t as Z}from"./icons-Ol38nIbL.js";import{n as kt}from"./marimo-icons-CLbC-oB3.js";import{t as wt}from"./links-DoPgJNku.js";import"./Inputs-CdyQ7nLC.js";import{t as Nt}from"./useInterval-COQ3SSh0.js";var _t=E("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"}]]),St=E("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]),Ct=E("graduation-cap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]),zt=E("orbit",[["path",{d:"M20.341 6.484A10 10 0 0 1 10.266 21.85",key:"1enhxb"}],["path",{d:"M3.659 17.516A10 10 0 0 1 13.74 2.152",key:"1crzgf"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}]]),It=E("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]),P=re(je(),1),ee=le(),r=re(Me(),1),Mt={intro:["Introduction",_t,"Get started with marimo basics"],dataflow:["Dataflow",Se,"Learn how cells interact with each other"],ui:["UI Elements",It,"Create interactive UI components"],markdown:["Markdown",ne,"Format text with parameterized markdown"],plots:["Plots",Ue,"Create interactive visualizations"],sql:["SQL",_e,"Query databases directly in marimo"],layout:["Layout",Ge,"Customize the layout of your cells' output"],fileformat:["File format",Ye,"Understand marimo's pure-Python file format"],"external-dependencies":["External dependencies",Xe,"Declare dependencies with Python script metadata"],"for-jupyter-users":["For Jupyter users",zt,"Transiting from Jupyter to marimo"],"markdown-format":["Markdown format",Z,"Using marimo to edit markdown files"]};const Rt=()=>{let t=(0,ee.c)(6),{openTutorial:e}=Y(),o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,r.jsx)(Ct,{className:"w-4 h-4 mr-2"}),t[0]=o):o=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=(0,r.jsx)(Oe,{asChild:!0,children:(0,r.jsxs)(B,{"data-testid":"open-tutorial-button",size:"xs",variant:"outline",children:[o,"Tutorials",(0,r.jsx)(jt,{className:"w-3 h-3 ml-1"})]})}),t[1]=s):s=t[1];let a;t[2]===e?a=t[3]:(a=Ce.entries(Mt).map(i=>{let[m,h]=i,[p,u,l]=h;return(0,r.jsxs)(Pe,{onSelect:async()=>{let c=await e({tutorialId:m});c&&wt(c.path)},children:[(0,r.jsx)(u,{strokeWidth:1.5,className:"w-4 h-4 mr-3 self-start mt-1.5 text-muted-foreground"}),(0,r.jsx)("div",{className:"flex items-center",children:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{children:p}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground pr-1",children:l})]})})]},m)}),t[2]=e,t[3]=a);let n;return t[4]===a?n=t[5]:(n=(0,r.jsxs)(We,{children:[s,(0,r.jsx)(Te,{side:"bottom",align:"end",className:"print:hidden",children:a})]}),t[4]=a,t[5]=n),n};var Pt=[{title:"Documentation",description:"Official marimo documentation and API reference",icon:ke,url:V.docsPage},{title:"GitHub",description:"View source code, report issues, or contribute",icon:qe,url:V.githubPage},{title:"Community",description:"Join the marimo Discord community",icon:Je,url:V.discordLink},{title:"molab",description:"Run marimo notebooks in the cloud",icon:kt,url:V.molab},{title:"YouTube",description:"Watch tutorials and demos",icon:Qe,url:V.youtube},{title:"Changelog",description:"See what's new in marimo",icon:ne,url:V.releasesPage}];const Dt=()=>{let t=(0,ee.c)(2),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(q,{Icon:Ke,children:"Resources"}),t[0]=e):e=t[0];let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[e,(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:Pt.map(Ot)})]}),t[1]=o):o=t[1],o},q=t=>{let e=(0,ee.c)(8),{Icon:o,control:s,children:a}=t,n;e[0]===o?n=e[1]:(n=(0,r.jsx)(o,{className:"h-5 w-5"}),e[0]=o,e[1]=n);let i;e[2]!==a||e[3]!==n?(i=(0,r.jsxs)("h2",{className:"flex items-center gap-2 text-xl font-semibold text-muted-foreground select-none",children:[n,a]}),e[2]=a,e[3]=n,e[4]=i):i=e[4];let m;return e[5]!==s||e[6]!==i?(m=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[i,s]}),e[5]=s,e[6]=i,e[7]=m):m=e[7],m};function Ot(t){return(0,r.jsxs)("a",{href:t.url,target:"_blank",className:"flex items-start gap-3 py-3 px-3 rounded-lg border hover:bg-accent/20 transition-colors shadow-xs",children:[(0,r.jsx)(t.icon,{className:"w-5 h-5 mt-1.5 text-primary"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-medium",children:t.title}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:t.description})]})]},t.title)}const te=P.createContext({runningNotebooks:new Map,setRunningNotebooks:ce.NOOP}),J=P.createContext({root:"",refreshWorkspace:ce.NOOP}),Tt=ie("marimo:home:include-markdown",!1,se,{getOnInit:!0}),ue=ie("marimo:home:expanded-folders",{},se,{getOnInit:!0});var W=le();function xe(t){return`${ut()}-${encodeURIComponent(t)}`}var Wt=()=>{let t=(0,W.c)(58),[e,o]=(0,P.useState)(0),{getRecentFiles:s,getRunningNotebooks:a}=Y(),n;t[0]===s?n=t[1]:(n=()=>s(),t[0]=s,t[1]=n);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=[],t[2]=i):i=t[2];let m=X(n,i),h,p;t[3]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{o(Yt)},p={delayMs:1e4,whenVisible:!0},t[3]=h,t[4]=p):(h=t[3],p=t[4]),Nt(h,p);let u;t[5]===a?u=t[6]:(u=async()=>{let R=await a();return me.keyBy(R.files,qt)},t[5]=a,t[6]=u);let l;t[7]===e?l=t[8]:(l=[e],t[7]=e,t[8]=l);let c=X(u,l),f,d,y,x,v,j,g,b,k,N,_,D,S;if(t[9]!==m||t[10]!==c){k=Symbol.for("react.early_return_sentinel");e:{let R=vt(m,c);if(R.error)throw R.error;let F=R.data;if(!F){let H;t[24]===Symbol.for("react.memo_cache_sentinel")?(H=(0,r.jsx)(K,{centered:!0,size:"xlarge"}),t[24]=H):H=t[24],k=H;break e}let[$,L]=F;x=$,y=P.Suspense,d=te,g={runningNotebooks:L,setRunningNotebooks:c.setData};let w,U;t[25]===Symbol.for("react.memo_cache_sentinel")?(w=(0,r.jsx)(Rt,{}),U=(0,r.jsx)(ct,{showAppConfig:!1}),t[25]=w,t[26]=U):(w=t[25],U=t[26]);let G=`This will shutdown the notebook server and terminate all running notebooks (${L.size}). You'll lose all data that's in memory.`;t[27]===G?b=t[28]:(b=(0,r.jsxs)("div",{className:"absolute top-3 right-5 flex gap-3 z-50",children:[w,U,(0,r.jsx)(nt,{description:G})]}),t[27]=G,t[28]=b),D="flex flex-col gap-6 max-w-6xl container pt-5 pb-20 z-10",t[29]===Symbol.for("react.memo_cache_sentinel")?(S=(0,r.jsx)("img",{src:"logo.png",alt:"marimo logo",className:"w-48 mb-2"}),v=(0,r.jsx)(Ht,{}),j=(0,r.jsx)(Dt,{}),t[29]=v,t[30]=j,t[31]=S):(v=t[29],j=t[30],S=t[31]),f=ge,t[32]===Symbol.for("react.memo_cache_sentinel")?(N=(0,r.jsx)(q,{Icon:Ee,children:"Running notebooks"}),t[32]=N):N=t[32],_=[...L.values()]}t[9]=m,t[10]=c,t[11]=f,t[12]=d,t[13]=y,t[14]=x,t[15]=v,t[16]=j,t[17]=g,t[18]=b,t[19]=k,t[20]=N,t[21]=_,t[22]=D,t[23]=S}else f=t[11],d=t[12],y=t[13],x=t[14],v=t[15],j=t[16],g=t[17],b=t[18],k=t[19],N=t[20],_=t[21],D=t[22],S=t[23];if(k!==Symbol.for("react.early_return_sentinel"))return k;let C;t[33]!==f||t[34]!==N||t[35]!==_?(C=(0,r.jsx)(f,{header:N,files:_}),t[33]=f,t[34]=N,t[35]=_,t[36]=C):C=t[36];let A;t[37]===Symbol.for("react.memo_cache_sentinel")?(A=(0,r.jsx)(q,{Icon:we,children:"Recent notebooks"}
vendor: 14,072 bytes, lines 1-4
1),t[37]=A):A=t[37];let z;t[38]===x.files?z=t[39]:(z=(0,r.jsx)(ge,{header:A,files:x.files}),t[38]=x.files,t[39]=z);let I;t[40]===m.refetch?I=t[41]:(I=(0,r.jsx)(ze,{children:(0,r.jsx)(At,{onRefreshRecents:m.refetch})}),t[40]=m.refetch,t[41]=I);let O;t[42]!==v||t[43]!==j||t[44]!==C||t[45]!==z||t[46]!==I||t[47]!==D||t[48]!==S?(O=(0,r.jsxs)("div",{className:D,children:[S,v,j,C,z,I]}),t[42]=v,t[43]=j,t[44]=C,t[45]=z,t[46]=I,t[47]=D,t[48]=S,t[49]=O):O=t[49];let M;t[50]!==d||t[51]!==g||t[52]!==b||t[53]!==O?(M=(0,r.jsxs)(d,{value:g,children:[b,O]}),t[50]=d,t[51]=g,t[52]=b,t[53]=O,t[54]=M):M=t[54];let T;return t[55]!==y||t[56]!==M?(T=(0,r.jsx)(y,{children:M}),t[55]=y,t[56]=M,t[57]=T):T=t[57],T},At=t=>{let e=(0,W.c)(54),{onRefreshRecents:o}=t,{getWorkspaceFiles:s}=Y(),[a,n]=oe(Tt),[i,m]=(0,P.useState)(""),h;e[0]!==s||e[1]!==a?(h=()=>s({includeMarkdown:a}),e[0]=s,e[1]=a,e[2]=h):h=e[2];let p;e[3]===a?p=e[4]:(p=[a],e[3]=a,e[4]=p);let{isPending:u,data:l,error:c,isFetching:f,refetch:d}=X(h,p),y;e[5]!==o||e[6]!==d?(y=()=>{d(),o()},e[5]=o,e[6]=d,e[7]=y):y=e[7];let x=ae(y);l==null||l.root;let v=(l==null?void 0:l.root)??"",j;e[8]!==x||e[9]!==v?(j={root:v,refreshWorkspace:x},e[8]=x,e[9]=v,e[10]=j):j=e[10];let g=j;if(u){let w;return e[11]===Symbol.for("react.memo_cache_sentinel")?(w=(0,r.jsx)(K,{centered:!0,size:"xlarge",className:"mt-6"}),e[11]=w):w=e[11],w}if(c){let w;e[12]===c?w=e[13]:(w=bt(c),e[12]=c,e[13]=w);let U;return e[14]===w?U=e[15]:(U=(0,r.jsx)(fe,{kind:"danger",className:"rounded p-4",children:w}),e[14]=w,e[15]=U),U}let b;e[16]!==l.fileCount||e[17]!==l.hasMore?(b=l.hasMore&&(0,r.jsxs)(fe,{kind:"warn",className:"rounded p-4",children:["Showing first ",l.fileCount," files. Your workspace has more files."]}),e[16]=l.fileCount,e[17]=l.hasMore,e[18]=b):b=e[18];let k,N;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=(0,r.jsx)(dt,{size:13}),N=w=>m(w.target.value),e[19]=k,e[20]=N):(k=e[19],N=e[20]);let _;e[21]===i?_=e[22]:(_=(0,r.jsx)(ht,{id:"search",value:i,icon:k,onChange:N,placeholder:"Search",className:"mb-0 border-border"}),e[21]=i,e[22]=_);let D;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=(0,r.jsx)(Ft,{}),e[23]=D):D=e[23];let S;e[24]===n?S=e[25]:(S=w=>n(!!w),e[24]=n,e[25]=S);let C;e[26]!==a||e[27]!==S?(C=(0,r.jsx)(Ne,{"data-testid":"include-markdown-checkbox",id:"include-markdown",checked:a,onCheckedChange:S}),e[26]=a,e[27]=S,e[28]=C):C=e[28];let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=(0,r.jsx)(Ae,{htmlFor:"include-markdown",children:"Include markdown"}),e[29]=A):A=e[29];let z;e[30]!==C||e[31]!==_?(z=(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[_,D,C,A]}),e[30]=C,e[31]=_,e[32]=z):z=e[32];let I;e[33]===d?I=e[34]:(I=()=>d(),e[33]=d,e[34]=I);let O;e[35]===Symbol.for("react.memo_cache_sentinel")?(O=(0,r.jsx)(mt,{className:"w-4 h-4"}),e[35]=O):O=e[35];let M;e[36]===I?M=e[37]:(M=(0,r.jsx)(B,{variant:"text",size:"icon",className:"w-4 h-4 ml-1 p-0 opacity-70 hover:opacity-100",onClick:I,"aria-label":"Refresh workspace",children:O}),e[36]=I,e[37]=M);let T;e[38]===f?T=e[39]:(T=f&&(0,r.jsx)(K,{size:"small"}),e[38]=f,e[39]=T);let R;e[40]!==z||e[41]!==M||e[42]!==T?(R=(0,r.jsxs)(q,{Icon:St,control:z,children:["Workspace",M,T]}),e[40]=z,e[41]=M,e[42]=T,e[43]=R):R=e[43];let F;e[44]!==i||e[45]!==l.files?(F=(0,r.jsx)("div",{className:"flex flex-col divide-y divide-(--slate-3) border rounded overflow-hidden max-h-192 overflow-y-auto shadow-sm bg-background",children:(0,r.jsx)(Ut,{searchText:i,files:l.files})}),e[44]=i,e[45]=l.files,e[46]=F):F=e[46];let $;e[47]!==R||e[48]!==F||e[49]!==b?($=(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[b,R,F]}),e[47]=R,e[48]=F,e[49]=b,e[50]=$):$=e[50];let L;return e[51]!==$||e[52]!==g?(L=(0,r.jsx)(J,{value:g,children:$}),e[51]=$,e[52]=g,e[53]=L):L=e[53],L},Ft=()=>{let t=(0,W.c)(5),e=be(ue),o;t[0]===e?o=t[1]:(o=()=>{e({})},t[0]=e,t[1]=o);let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,r.jsx)(Ve,{className:"w-4 h-4 mr-1"}),t[2]=s):s=t[2];let a;return t[3]===o?a=t[4]:(a=(0,r.jsxs)(B,{variant:"text",size:"sm",className:"h-fit hidden sm:flex",onClick:o,children:[s,"Collapse all"]}),t[3]=o,t[4]=a),a},Ut=t=>{let e=(0,W.c)(20),{files:o,searchText:s}=t,[a,n]=oe(ue),i=Object.keys(a).length===0,m=(0,P.useRef)(void 0),{root:h,refreshWorkspace:p}=(0,P.use)(J),u;e[0]===h?u=e[1]:(u={root:h},e[0]=h,e[1]=u);let{renameFile:l}=ot(u),c,f;e[2]===i?(c=e[3],f=e[4]):(c=()=>{var g;i&&((g=m.current)==null||g.closeAll())},f=[i],e[2]=i,e[3]=c,e[4]=f),(0,P.useEffect)(c,f);let d;e[5]!==p||e[6]!==l?(d=async(g,b)=>{var N;let k=(N=m.current)==null?void 0:N.get(g);if(!k){de({title:"Failed",description:`Node with id ${g} not found in the tree`});return}await l(k.data,b)&&p()},e[5]=p,e[6]=l,e[7]=d):d=e[7];let y=ae(d);if(o.length===0){let g;return e[8]===Symbol.for("react.memo_cache_sentinel")?(g=(0,r.jsx)("div",{className:"flex flex-col px-5 py-10 items-center justify-center",children:(0,r.jsx)("p",{className:"text-center text-muted-foreground",children:"No files in this workspace"})}),e[8]=g):g=e[8],g}let x;e[9]!==a||e[10]!==n?(x=async g=>{let b=a[g]??!1;n({...a,[g]:!b})},e[9]=a,e[10]=n,e[11]=x):x=e[11];let v;e[12]===y?v=e[13]:(v=async g=>{let{id:b,name:k}=g;await y(b,k)},e[12]=y,e[13]=v);let j;return e[14]!==o||e[15]!==a||e[16]!==s||e[17]!==x||e[18]!==v?(j=(0,r.jsx)(tt,{ref:m,width:"100%",height:500,searchTerm:s,className:"h-full",idAccessor:Jt,data:o,openByDefault:!1,initialOpenState:a,onToggle:x,onRename:v,padding:5,rowHeight:35,indent:15,overscanCount:1e3,renderCursor:Gt,disableDrop:!0,disableDrag:!0,disableMultiSelection:!0,children:$t}),e[14]=o,e[15]=a,e[16]=s,e[17]=x,e[18]=v,e[19]=j):j=e[19],j},$t=t=>{let e=(0,W.c)(18),{node:o,style:s}=t,a=Be[o.data.isDirectory?"directory":He(o.data.name)],n;e[0]===a?n=e[1]:(n=(0,r.jsx)(a,{className:"w-5 h-5 shrink-0",strokeWidth:1.5}),e[0]=a,e[1]=n);let i=n,{root:m}=(0,P.use)(J),{runningNotebooks:h}=(0,P.use)(te),p;e[2]!==i||e[3]!==o||e[4]!==m||e[5]!==h?(p=()=>{if(o.isEditing)return(0,r.jsxs)("div",{className:"flex items-center pl-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden h-full pr-3 gap-2",children:[i,(0,r.jsx)(it,{node:o})]});if(o.data.isDirectory)return(0,r.jsxs)("span",{className:"flex items-center pl-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden h-full pr-3 gap-2",children:[i,o.data.name]});let x=o.data.path.startsWith(m)&&he.isAbsolute(o.data.path)?he.rest(o.data.path,m):o.data.path,v=x.endsWith(".md")||x.endsWith(".qmd"),j=h.has(x);return(0,r.jsxs)("a",{className:"flex items-center pl-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden h-full pr-3 gap-2",href:pe(`?file=${encodeURIComponent(x)}`).toString(),target:xe(x),children:[i,(0,r.jsxs)("span",{className:"flex-1 overflow-hidden text-ellipsis",children:[o.data.name,v&&(0,r.jsx)(Z,{className:"ml-2 inline opacity-80"})]}),(0,r.jsx)(Lt,{node:o,isRunning:j}),(0,r.jsx)("div",{className:"w-8 h-8 flex items-center justify-center shrink-0",children:(0,r.jsx)(ye,{filePath:x})}),(0,r.jsx)(Q,{size:20,className:"group-hover:opacity-100 opacity-0 text-primary shrink-0"})]})},e[2]=i,e[3]=o,e[4]=m,e[5]=h,e[6]=p):p=e[6];let u=p,l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=Ie("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group h-full"),e[7]=l):l=e[7];let c,f;e[8]===o?(c=e[9],f=e[10]):(c=x=>{x.stopPropagation(),o.data.isDirectory&&o.toggle()},f=(0,r.jsx)(Vt,{node:o}),e[8]=o,e[9]=c,e[10]=f);let d;e[11]===u?d=e[12]:(d=u(),e[11]=u,e[12]=d);let y;return e[13]!==s||e[14]!==c||e[15]!==f||e[16]!==d?(y=(0,r.jsxs)("div",{style:s,className:l,onClick:c,children:[f,d]}),e[13]=s,e[14]=c,e[15]=f,e[16]=d,e[17]=y):y=e[17],y},Lt=t=>{let e=(0,W.c)(19),{node:o,isRunning:s}=t,{root:a,refreshWorkspace:n}=(0,P.use)(J),i;e[0]!==o||e[1]!==n||e[2]!==a?(i={node:o,root:a,onAfterChange:n},e[0]=o,e[1]=n,e[2]=a,e[3]=i):i=e[3];let{handleRename:m,handleDuplicate:h,handleDelete:p}=st(i),u=s?"Stop the notebook's kernel before renaming or deleting.":void 0,l;e[4]!==m||e[5]!==s||e[6]!==u?(l=(0,r.jsx)(Ze,{onSelect:m,disabled:s,title:u}),e[4]=m,e[5]=s,e[6]=u,e[7]=l):l=e[7];let c;e[8]===h?c=e[9]:(c=(0,r.jsx)(at,{onSelect:h}),e[8]=h,e[9]=c);let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=(0,r.jsx)(De,{}),e[10]=f):f=e[10];let d;e[11]!==p||e[12]!==s||e[13]!==u?(d=(0,r.jsx)(rt,{onSelect:p,disabled:s,title:u}),e[11]=p,e[12]=s,e[13]=u,e[14]=d):d=e[14];let y;return e[15]!==l||e[16]!==c||e[17]!==d?(y=(0,r.jsxs)(et,{testId:"workspace-more-button",buttonClassName:"w-8 h-8 p-0 shrink-0",contentClassName:"print:hidden w-fit min-w-[140px]",preventDefaultOnTrigger:!0,children:[l,c,f,d]}),e[15]=l,e[16]=c,e[17]=d,e[18]=y):y=e[18],y},Vt=t=>{let e=(0,W.c)(3),{node:o}=t;if(!o.data.isDirectory){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,r.jsx)("span",{className:"w-5 h-5 shrink-0"}),e[0]=a):a=e[0],a}let s;return e[1]===o.isOpen?s=e[2]:(s=o.isOpen?(0,r.jsx)($e,{className:"w-5 h-5 shrink-0"}):(0,r.jsx)(Le,{className:"w-5 h-5 shrink-0"}),e[1]=o.isOpen,e[2]=s),s},ge=t=>{let e=(0,W.c)(7),{header:o,files:s}=t;if(s.length===0)return null;let a;e[0]===s?a=e[1]:(a=s.map(Qt),e[0]=s,e[1]=a);let n;e[2]===a?n=e[3]:(n=(0,r.jsx)("div",{className:"flex flex-col divide-y divide-(--slate-3) border rounded overflow-hidden max-h-192 overflow-y-auto shadow-sm bg-background",children:a}),e[2]=a,e[3]=n);let i;return e[4]!==o||e[5]!==n?(i=(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[o,n]}),e[4]=o,e[5]=n,e[6]=i):i=e[6],i},Et=t=>{let e=(0,W.c)(41),{file:o}=t,{locale:s}=gt(),a;e[0]===o.path?a=e[1]:(a=pt(o.path),e[0]=o.path,e[1]=a);let n=a,i,m,h,p;if(e[2]!==o.initializationId||e[3]!==o.path||e[4]!==n){let N=pe(n?`?file=${encodeURIComponent(o.initializationId??o.path)}&session_id=${o.path}`:`?file=${encodeURIComponent(o.path)}`),_;e[9]===o.path?_=e[10]:(_=o.path.endsWith(".md"),e[9]=o.path,e[10]=_),i=_,m="py-1.5 px-4 hover:bg-(--blue-2) hover:text-primary transition-all duration-300 cursor-pointer group relative flex gap-4 items-center",h=o.path,p=N.toString(),e[2]=o.initializationId,e[3]=o.path,e[4]=n,e[5]=i,e[6]=m,e[7]=h,e[8]=p}else i=e[5],m=e[6],h=e[7],p=e[8];let u=o.initializationId||o.path,l;e[11]===u?l=e[12]:(l=xe(u),e[11]=u,e[12]=l);let c;e[13]===i?c=e[14]:(c=i&&(0,r.jsx)("span",{className:"opacity-80",children:(0,r.jsx)(Z,{})}),e[13]=i,e[14]=c);let f;e[15]!==o.name||e[16]!==c?(f=(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[o.name,c]}),e[15]=o.name,e[16]=c,e[17]=f):f=e[17];let d;e[18]===o.path?d=e[19]:(d=(0,r.jsx)("p",{title:o.path,className:"text-sm text-muted-foreground overflow-hidden whitespace-nowrap text-ellipsis",children:o.path}),e[18]=o.path,e[19]=d);let y;e[20]!==f||e[21]!==d?(y=(0,r.jsxs)("div",{className:"flex flex-col justify-between flex-1",children:[f,d]}),e[20]=f,e[21]=d,e[22]=y):y=e[22];let x;e[23]===o.path?x=e[24]:(x=(0,r.jsx)("div",{children:(0,r.jsx)(ye,{filePath:o.path})}),e[23]=o.path,e[24]=x);let v;e[25]===Symbol.for("react.memo_cache_sentinel")?(v=(0,r.jsx)(Q,{size:20,className:"group-hover:opacity-100 opacity-0 transition-all duration-300 text-primary"}),e[25]=v):v=e[25];let j;e[26]===x?j=e[27]:(j=(0,r.jsxs)("div",{className:"flex gap-3 items-center",children:[x,v]}),e[26]=x,e[27]=j);let g;e[28]!==o.lastModified||e[29]!==s?(g=!!o.lastModified&&(0,r.jsx)("div",{className:"text-xs text-muted-foreground opacity-80",children:xt(o.lastModified*1e3,s)}),e[28]=o.lastModified,e[29]=s,e[30]=g):g=e[30];let b;e[31]!==j||e[32]!==g?(b=(0,r.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[j,g]}),e[31]=j,e[32]=g,e[33]=b):b=e[33];let k;return e[34]!==y||e[35]!==b||e[36]!==m||e[37]!==h||e[38]!==p||e[39]!==l?(k=(0,r.jsxs)("a",{className:m,href:p,target:l,children:[y,b]},h),e[34]=y,e[35]=b,e[36]=m,e[37]=h,e[38]=p,e[39]=l,e[40]=k):k=e[40],k},ye=t=>{let e=(0,W.c)(10),{filePath:o}=t,{openConfirm:s,closeModal:a}=yt(),{shutdownSession:n}=Y(),{runningNotebooks:i,setRunningNotebooks:m}=(0,P.use)(te);if(!i.has(o))return null;let h;e[0]!==a||e[1]!==o||e[2]!==s||e[3]!==i||e[4]!==m||e[5]!==n?(h=l=>{l.stopPropagation(),l.preventDefault(),s({title:"Shutdown",description:"This will terminate the Python kernel. You'll lose all data that's in memory.",variant:"destructive",confirmAction:(0,r.jsx)(Re,{onClick:()=>{let c=i.get(o);ve(c==null?void 0:c.sessionId),n({sessionId:c.sessionId}).then(f=>{m(me.keyBy(f.files,Kt))}),a(),de({description:"Notebook has been shutdown."})},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[0]=a,e[1]=o,e[2]=s,e[3]=i,e[4]=m,e[5]=n,e[6]=h):h=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=(0,r.jsx)(lt,{size:14}),e[7]=p):p=e[7];let u;return e[8]===h?u=e[9]:(u=(0,r.jsx)(Fe,{content:"Shutdown",children:(0,r.jsx)(B,{size:"icon",variant:"outline",className:"opacity-80 hover:opacity-100 hover:bg-accent text-destructive border-destructive hover:border-destructive hover:text-destructive bg-background hover:bg-(--red-1)",onClick:h,children:p})}),e[8]=h,e[9]=u),u},Ht=()=>{let t=(0,W.c)(3),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ft(),t[0]=e):e=t[0];let o=e,s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Create a new notebook"}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,r.jsxs)("a",{className:`relative rounded-lg p-6 group 2 text-primary hover:bg-(--blue-2) shadow-md-solid shadow-accent border bg-(--blue-1) 3 transition-all duration-300 cursor-pointer 4 `,href:o,target:"_blank",rel:"noreferrer",children:[s,(0,r.jsx)("div",{className:"group-hover:opacity-100 opacity-0 absolute right-5 top-0 bottom-0 rounded-lg flex items-center justify-center transition-all duration-300",children:(0,r.jsx)(Q,{size:24})})]}),t[2]=a):a=t[2],a},Bt=Wt;function Yt(t){return t+1}function qt(t){return t.path}function Jt(t){return t.path}function Gt(){return null}function Qt(t){return(0,r.jsx)(Et,{file:t},t.path)}function Kt(t){return t.path}export{Bt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.