@marimo-team/frontend 0.25.3-dev66 → 0.25.3-dev68

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.
Files changed (22) hide show
  1. package/dist/assets/{add-cell-with-ai-BhmuohAY.js → add-cell-with-ai-By51zSlC.js} +1 -1
  2. package/dist/assets/{agent-panel-GFhlWVub.js → agent-panel-aCWa3Yai.js} +1 -1
  3. package/dist/assets/{ai-model-dropdown-YT1HiXiK.js → ai-model-dropdown-bwTRyFn4.js} +1 -1
  4. package/dist/assets/{app-config-button-C_whRVO8.js → app-config-button-DGhsM0xw.js} +1 -1
  5. package/dist/assets/{cell-editor-3cVIcyHK.js → cell-editor-M8dEnDzk.js} +1 -1
  6. package/dist/assets/{chat-display-BtaARI-N.js → chat-display-DXn2Yrjr.js} +1 -1
  7. package/dist/assets/{chat-panel-eT2lfQrB.js → chat-panel-D3iUyZId.js} +1 -1
  8. package/dist/assets/{chat-ui-nNFa2LdU.js → chat-ui-YuJtv3UJ.js} +1 -1
  9. package/dist/assets/{command-palette-OZPTmtR-.js → command-palette-B5H-9JMB.js} +1 -1
  10. package/dist/assets/{edit-page-L1WRvtMa.js → edit-page-4qZ3DZjt.js} +4 -4
  11. package/dist/assets/{home-page-KnJyha6O.js → home-page-CZ3hkD3m.js} +1 -1
  12. package/dist/assets/{hooks-w6zKs3CJ.js → hooks-BrFYiTJS.js} +1 -1
  13. package/dist/assets/{index-oc8deM9X.js → index-CDWL5dyB.js} +3 -3
  14. package/dist/assets/{layout-sYdHI-lW.js → layout-CGC8ajpe.js} +2 -2
  15. package/dist/assets/{packages-panel-lkNX6Oov.js → packages-panel-BtkXVz3L.js} +1 -1
  16. package/dist/assets/{panels-DVvPamWL.js → panels-Cez8PgGB.js} +1 -1
  17. package/dist/assets/{reveal-component-CrQRQhW4.js → reveal-component-Cxo3hLGA.js} +1 -1
  18. package/dist/assets/{run-page-sTTYJWKI.js → run-page-Bn5ccbSI.js} +1 -1
  19. package/dist/assets/{scratchpad-panel-ClLxdqdK.js → scratchpad-panel-yHIW63VQ.js} +1 -1
  20. package/dist/assets/{useNotebookActions-OLol05t9.js → useNotebookActions-CmqOx-WZ.js} +1 -1
  21. package/dist/index.html +1 -1
  22. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,l as n,t as r,u as i}from"./useEvent-Dfcbgjhg.js";import{t as a}from"./react-DVplv7_D.js";import{uo as o}from"./cells-T9_Y4Jlv.js";import{t as s}from"./compiler-runtime-BrajqUja.js";import{C as c}from"./config-DGX7JYor.js";import{N as l,v as u,x as d}from"./config-DzdxZb17.js";import{t as f}from"./cn-ldLVeaqm.js";import{t as p}from"./jsx-runtime-B74pBk57.js";import{t as m}from"./tooltip-CkGm8X7m.js";import{r as h,t as g}from"./button-D8gVKwe-.js";import{r as _}from"./ai-model-dropdown-YT1HiXiK.js";import{a as v}from"./useNumberFormatter-D7O_26UI.js";import{t as y}from"./chevron-right-eAtVhbNZ.js";import{s as b}from"./toDate-DOj9Q6uC.js";import{t as x}from"./spinner-DyNE-o8o.js";import{t as S}from"./refresh-cw-Qw1f8Jhy.js";import{a as C}from"./input-BZdRe7pb.js";import{n as w}from"./copy-KlhazlhB.js";import{t as T}from"./use-toast-Wu434mLr.js";import{r as E}from"./requests-lt0JK8Jt.js";import{n as D}from"./useAsyncData-DhhdOGGd.js";import{n as O}from"./package-data-dv4FBHxR.js";import{c as k,d as A,i as j,o as M,r as N,s as P,t as ee}from"./useInstallPackage-C7neMPwh.js";import{a as F}from"./errors-CNsgAw6m.js";import{n as I}from"./error-banner-B5kzVf_0.js";import{a as te,i as L,n as R,o as z,r as B,t as V}from"./table-vrvqpuKJ.js";import{t as H}from"./useStateForKey-CGMJQT8x.js";import{t as U}from"./empty-state-BaCKb7o3.js";import{r as W}from"./panel-context-C2QXpKfx.js";import{c as G,d as K,f as q,l as ne,n as J,p as re,s as Y,t as X,u as ie}from"./runtime-details-state-CznIe40L.js";var Z=e(a(),1),Q=s();function ae(e){let t=e.trim();for(let e of[`pip install`,`pip3 install`,`uv add`,`uv pip install`,`poetry add`,`conda install`,`pipenv install`])if(t.toLowerCase().startsWith(e.toLowerCase()))return t.slice(e.length).trim();return t}function oe(e,t,n){let{addPackage:i,removePackage:a}=E(),[o,s]=(0,Z.useState)(!1),c=(0,Z.useRef)(!1);return{loading:o,run:r(async()=>{if(c.current)return;c.current=!0,s(!0);let r=e===`upgrade`?M:j;try{let o={package:t,group:n?.find(e=>e.kind===`group`)?.value},s=await(e===`upgrade`?i({...o,upgrade:!0}):a(o));s.restartRequired?N():s.success?r(t):r(t,s.error||`Package operation failed.`)}catch(e){r(t,F(e))}finally{c.current=!1,s(!1)}})}}function se(){let e=(0,Q.c)(8),t=n(O),[r]=c(),i=r.package_management.manager,{getDependencyTree:a,getPackageList:o}=E(),s;e[0]!==a||e[1]!==o?(s=async()=>{let{context:e,tree:t}=await a();return{list:e.kind===`sandbox`?[]:(await o()).packages,context:e,tree:t}},e[0]=a,e[1]=o,e[2]=s):s=e[2];let l;return e[3]!==a||e[4]!==o||e[5]!==t||e[6]!==i?(l=[a,o,i,t],e[3]=a,e[4]=o,e[5]=t,e[6]=i,e[7]=l):l=e[7],D(s,l)}var $=p();function ce(e){let t=(0,Q.c)(17),{notice:r}=e,i=n(K),a=n(ie),o=n(q);if(r.pending||r.ready)return null;let s=!a||i?.manifest==null,c;t[0]===a?c=t[1]:(c=()=>a?.editManifest(),t[0]=a,t[1]=c);let l;t[2]!==s||t[3]!==c?(l=(0,$.jsx)(g,{variant:`outline`,size:`xs`,disabled:s,onClick:c,children:`Edit manifest…`}),t[2]=s,t[3]=c,t[4]=l):l=t[4];let u;t[5]!==a||t[6]!==r.kind||t[7]!==o?(u=r.kind===`sync`&&o.kind===`restart-required`?(0,$.jsx)(le,{}):(0,$.jsx)(g,{variant:`text`,size:`xs`,disabled:!a,onClick:()=>a?.sync(),children:`Retry sync`}),t[5]=a,t[6]=r.kind,t[7]=o,t[8]=u):u=t[8];let d;t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11];let f;t[12]===i?.manifest?f=t[13]:(f=i?.manifest==null&&(0,$.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`A manifest will be available once this new notebook starts.`}),t[12]=i?.manifest,t[13]=f);let p;return t[14]!==d||t[15]!==f?(p=(0,$.jsxs)($.Fragment,{children:[d,f]}),t[14]=d,t[15]=f,t[16]=p):p=t[16],p}function le(){let e=(0,Q.c)(2),t=P(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(g,{variant:`text`,size:`xs`,onClick:t,children:`Restart Kernel`}),e[0]=t,e[1]=n),n}function ue(e){let t=(0,Q.c)(5),{notice:n}=e,r;t[0]===n?r=t[1]:(r=n.sandbox&&(0,$.jsx)(ce,{notice:n}),t[0]=n,t[1]=r);let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(J,{notice:n,children:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}function de(e){let t=(0,Q.c)(9),{notice:r}=e,i=n(re);if(!i&&!r)return null;let a;t[0]===r?a=t[1]:(a=r?(0,$.jsx)(`div`,{className:`mb-5`,children:(0,$.jsx)(ue,{notice:r})}):(0,$.jsx)(`p`,{className:`text-sm`,children:`Environment synced`}),t[0]=r,t[1]=a);let o=i?.operation_id,s=i?.logs.environment??``,c=i?.status.kind===`running`?`running`:i?.status.kind===`succeeded`?`succeeded`:`failed`,l;t[2]!==o||t[3]!==s||t[4]!==c?(l=(0,$.jsx)(Y,{logs:s,state:c,label:`sandbox sync output`},o),t[2]=o,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;return t[6]!==a||t[7]!==l?(u=(0,$.jsxs)(`div`,{className:`mt-5 min-w-0`,children:[a,l]}),t[6]=a,t[7]=l,t[8]=u):u=t[8],u}function fe(){let e=(0,Q.c)(41),r=W(),i=!!n(K)?.backend,a=n(u),o=n(G),s;e[0]===o?s=e[1]:(s=o&&{...o,ready:!1},e[0]=o,e[1]=s);let c=s,l=n(ne),p=n(d),[m,h]=t(X),g;e[2]!==a||e[3]!==c||e[4]!==l||e[5]!==p||e[6]!==i?(g=c?.kind===`startup`?c:l||p||a&&!i?{kind:`startup`,sandbox:i,title:`Notebook started`,description:`The notebook is ready to run.`,pending:!1,ready:!0,error:null}:null,e[2]=a,e[3]=c,e[4]=l,e[5]=p,e[6]=i,e[7]=g):g=e[7];let _=g,v=`runtime-details-${r}`,y=i?`Sandbox details`:`Runtime details`,b=!m,x=a?`shrink-0 max-h-[65%] border-b`:`flex-1`,S;e[8]===x?S=e[9]:(S=f(`min-w-0 overflow-auto p-4`,x),e[8]=x,e[9]=S);let C,w;e[10]===h?(C=e[11],w=e[12]):(C=()=>h(!0),w=()=>h(!0),e[10]=h,e[11]=C,e[12]=w);let T;e[13]===c?T=e[14]:(T=c?.kind===`connection`&&(0,$.jsx)(`div`,{className:`mb-5`,children:(0,$.jsx)(ue,{notice:c})}),e[13]=c,e[14]=T);let E;e[15]===_?E=e[16]:(E=_&&(0,$.jsx)(ue,{notice:_}),e[15]=_,e[16]=E);let D;e[17]!==a||e[18]!==c||e[19]!==i?(D=i&&a&&(0,$.jsx)(de,{notice:c?.kind===`sync`?c:null}),e[17]=a,e[18]=c,e[19]=i,e[20]=D):D=e[20];let O;e[21]!==a||e[22]!==c||e[23]!==i?(O=i&&a&&(!c||c.pending)&&(0,$.jsx)(pe,{}),e[21]=a,e[22]=c,e[23]=i,e[24]=O):O=e[24];let k;e[25]!==c||e[26]!==i||e[27]!==_?(k=!c&&!_&&!i&&(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Not connected to a runtime.`}),e[25]=c,e[26]=i,e[27]=_,e[28]=k):k=e[28];let A;return e[29]!==E||e[30]!==D||e[31]!==O||e[32]!==k||e[33]!==v||e[34]!==y||e[35]!==b||e[36]!==S||e[37]!==C||e[38]!==w||e[39]!==T?(A=(0,$.jsxs)(`section`,{id:v,"aria-label":y,hidden:b,className:S,onPointerDownCapture:C,onFocusCapture:w,children:[T,E,D,O,k]}),e[29]=E,e[30]=D,e[31]=O,e[32]=k,e[33]=v,e[34]=y,e[35]=b,e[36]=S,e[37]=C,e[38]=w,e[39]=T,e[40]=A):A=e[40],A}function pe(){let e=(0,Q.c)(14),t=n(K),r=n(ie),i=n(q).kind===`running`||!r,a;e[0]===r?a=e[1]:(a=()=>r?.sync(),e[0]=r,e[1]=a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(S,{className:`size-3`,"aria-hidden":!0}),e[2]=o):o=e[2];let s;e[3]!==i||e[4]!==a?(s=(0,$.jsxs)(g,{variant:`text`,size:`xs`,className:`text-muted-foreground gap-1.5 p-0`,disabled:i,onClick:a,children:[o,`Sync`]}),e[3]=i,e[4]=a,e[5]=s):s=e[5];let c=!r||t?.manifest==null,l;e[6]===r?l=e[7]:(l=()=>r?.editManifest(),e[6]=r,e[7]=l);let u;e[8]!==c||e[9]!==l?(u=(0,$.jsx)(g,{variant:`text`,size:`xs`,className:`text-muted-foreground p-0`,disabled:c,onClick:l,children:`Edit manifest…`}),e[8]=c,e[9]=l,e[10]=u):u=e[10];let d;return e[11]!==s||e[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center gap-4 mt-5 border-t pt-3`,children:[s,u]}),e[11]=s,e[12]=u,e[13]=d):d=e[13],d}var me=e=>{let t=(0,Q.c)(9),{onClick:n,loading:r,children:i,className:a}=e;if(r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(x,{size:`small`,className:`h-4 w-4 shrink-0 opacity-50`}),t[0]=e):e=t[0],e}let o;t[1]===a?o=t[2]:(o=f(`px-2 h-full text-xs text-muted-foreground hover:text-foreground`,`invisible group-hover:visible`,a),t[1]=a,t[2]=o);let s;t[3]===n?s=t[4]:(s=h.stopPropagation(n),t[3]=n,t[4]=s);let c;return t[5]!==i||t[6]!==o||t[7]!==s?(c=(0,$.jsx)(`button`,{type:`button`,className:o,onClick:s,children:i}),t[5]=i,t[6]=o,t[7]=s,t[8]=c):c=t[8],c},he=()=>{let e=(0,Q.c)(5),t=n(u),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(fe,{}),e[0]=r):r=e[0];let i;e[1]===t?i=e[2]:(i=t&&(0,$.jsx)(ge,{}),e[1]=t,e[2]=i);let a;return e[3]===i?a=e[4]:(a=(0,$.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 overflow-hidden`,children:[r,i]}),e[3]=i,e[4]=a),a},ge=()=>{let e=(0,Q.c)(35),t=n(q).kind===`running`,[r,i]=Z.useState(null),{data:a,error:o,isPending:s}=se();if(s){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`output`,{className:`flex flex-1 items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(x,{className:`size-4`}),`Loading installed packages…`]}),e[0]=t):t=e[0],t}if(o){let t;return e[1]===o?t=e[2]:(t=(0,$.jsx)(I,{error:o}),e[1]=o,e[2]=t),t}let c=a.tree!=null,l=a.tree?.name,u=a?.tree?.version,d=a.context.kind===`sandbox`?a.context.backend:null,p=d!==null,m;e[3]!==p||e[4]!==c||e[5]!==r?(m=p?`tree`:Ce(r,c),e[3]=p,e[4]=c,e[5]=r,e[6]=m):m=e[6];let h=m,g=l&&l!==`<root>`?`project`:`environment`,_;e[7]===a.context?_=e[8]:(_=(0,$.jsx)(_e,{context:a.context}),e[7]=a.context,e[8]=_);let v;e[9]!==t||e[10]!==_?(v=(0,$.jsx)(`fieldset`,{disabled:t,className:`contents`,children:_}),e[9]=t,e[10]=_,e[11]=v):v=e[11];let y;e[12]!==p||e[13]!==c||e[14]!==l||e[15]!==g||e[16]!==u||e[17]!==h?(y=c&&!p&&(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 border-b`,children:[(0,$.jsxs)(`div`,{className:`flex gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,className:f(`px-2 py-1 text-xs rounded`,h===`list`?`bg-accent text-accent-foreground`:`text-muted-foreground hover:text-foreground`),onClick:()=>i(`list`),children:`List`}),(0,$.jsx)(`button`,{type:`button`,className:f(`px-2 py-1 text-xs rounded`,h===`tree`?`bg-accent text-accent-foreground`:`text-muted-foreground hover:text-foreground`),onClick:()=>i(`tree`),children:`Tree`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium`,title:g,children:g}),l&&(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[l,u&&` v${u}`]})]})]}),e[12]=p,e[13]=c,e[14]=l,e[15]=g,e[16]=u,e[17]=h,e[18]=y):y=e[18];let b;e[19]===t?b=e[20]:(b=t&&(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`Showing packages from the last sync.`}),e[19]=t,e[20]=b);let S;e[21]!==a.list||e[22]!==a.tree||e[23]!==o||e[24]!==d||e[25]!==h?(S=h===`list`?(0,$.jsx)(ve,{packages:a.list}):(0,$.jsx)(xe,{tree:a.tree,error:o,sandboxBackend:d}),e[21]=a.list,e[22]=a.tree,e[23]=o,e[24]=d,e[25]=h,e[26]=S):S=e[26];let C;e[27]!==t||e[28]!==b||e[29]!==S?(C=(0,$.jsxs)(`fieldset`,{disabled:t,className:`flex flex-col flex-1 min-h-0`,"aria-busy":t,children:[b,S]}),e[27]=t,e[28]=b,e[29]=S,e[30]=C):C=e[30];let w;return e[31]!==v||e[32]!==y||e[33]!==C?(w=(0,$.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[v,y,C]}),e[31]=v,e[32]=y,e[33]=C,e[34]=w):w=e[34],w},_e=e=>{let t=(0,Q.c)(50),{context:r}=e,[a,s]=Z.useState(``),{handleClick:c}=_(),l=r.kind===`sandbox`,u=l?r.backend:r.name,d=n(A),p=i(A),h,g;t[0]!==d||t[1]!==p?(h=()=>{d&&(s(d),p(null))},g=[d,p],t[0]=d,t[1]=p,t[2]=h,t[3]=g):(h=t[2],g=t[3]),Z.useEffect(h,g);let{loading:v,handleInstallPackages:y}=ee(),S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{s(``)},t[4]=S):S=t[4];let w=S,T;t[5]!==y||t[6]!==a?(T=()=>{let e=ae(a);y([e],w)},t[5]=y,t[6]=a,t[7]=T):T=t[7];let E=T,D=l?`Add packages to ${u} sandbox...`:`Install packages with ${u}...`,O;t[8]!==l||t[9]!==v||t[10]!==c||t[11]!==u?(O=v?(0,$.jsx)(x,{size:`small`,className:`mr-2 h-4 w-4 shrink-0 opacity-50`}):l?(0,$.jsx)(o,{"aria-hidden":`true`,className:`mr-2 h-4 w-4 shrink-0 opacity-50`}):(0,$.jsx)(m,{content:`Change package manager (currently ${u})`,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":`Change package manager`,onClick:()=>c(`packageManagementAndData`),className:`pointer-events-auto mr-2 rounded-sm opacity-50 hover:opacity-80 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring`,children:(0,$.jsx)(o,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0`})})}),t[8]=l,t[9]=v,t[10]=c,t[11]=u,t[12]=O):O=t[12];let j;t[13]===E?j=t[14]:(j=e=>{e.key===`Enter`&&(e.preventDefault(),E())},t[13]=E,t[14]=j);let M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>s(e.target.value),t[15]=M):M=t[15];let N;t[16]!==a||t[17]!==D||t[18]!==O||t[19]!==j?(N=(0,$.jsx)(C,{placeholder:D,id:k,icon:O,rootClassName:`flex-1 border-none`,value:a,onKeyDown:j,onChange:M}),t[16]=a,t[17]=D,t[18]=O,t[19]=j,t[20]=N):N=t[20];let P;t[21]!==l||t[22]!==u?(P=l?(0,$.jsxs)(`span`,{children:[`Packages are recorded in this notebook's inline metadata and synchronized with its `,u,` sandbox. To switch backends, restart marimo with a different --sandbox option.`]}):(0,$.jsxs)(`span`,{children:[`Packages are installed using `,u,`, selected in your user configuration.`]}),t[21]=l,t[22]=u,t[23]=P):P=t[23];let F;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`span`,{className:`mt-2`,children:`You can install packages with various formats:`}),t[24]=F):F=t[24];let I;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`Package name:`}),t[25]=I):I=t[25];let te,L;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsxs)(`div`,{children:[I,` A package name; this will install the latest version.`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Example: httpx`})]}),L=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`Package and version:`}),t[26]=te,t[27]=L):(te=t[26],L=t[27]);let R,z;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsxs)(`div`,{children:[L,` `,`A package with a specific version or version range.`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Examples: httpx==0.27.0, httpx>=0.27.0`})]}),z=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`Git:`}),t[28]=R,t[29]=z):(R=t[28],z=t[29]);let B,V;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsxs)(`div`,{children:[z,` A Git repository`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Example: git+https://github.com/encode/httpx`})]}),V=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`URL:`}),t[30]=B,t[31]=V):(B=t[30],V=t[31]);let H,U;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsxs)(`div`,{children:[V,` A remote wheel or source distribution.`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Example: https://example.com/httpx-0.27.0.tar.gz`})]}),U=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`Path:`}),t[32]=H,t[33]=U):(H=t[32],U=t[33]);let W;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 mt-2`,children:[te,R,B,H,(0,$.jsxs)(`div`,{children:[U,` A local wheel, source distribution, or project directory.`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Example: /example/foo-0.1.0-py3-none-any.whl`})]})]}),t[34]=W):W=t[34];let G;t[35]===P?G=t[36]:(G=(0,$.jsxs)(`div`,{className:`text-sm flex flex-col w-full max-w-[360px]`,children:[P,F,W]}),t[35]=P,t[36]=G);let K;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(b,{className:`h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent`}),t[37]=K):K=t[37];let q;t[38]===G?q=t[39]:(q=(0,$.jsx)(m,{delayDuration:300,side:`left`,align:`start`,content:G,children:K}),t[38]=G,t[39]=q);let ne=a&&`bg-accent text-accent-foreground`,J;t[40]===ne?J=t[41]:(J=f(`float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2`,ne,`disabled:cursor-not-allowed disabled:opacity-50`),t[40]=ne,t[41]=J);let re=!a,Y;t[42]!==E||t[43]!==J||t[44]!==re?(Y=(0,$.jsx)(`button`,{type:`button`,className:J,onClick:E,disabled:re,children:`Add`}),t[42]=E,t[43]=J,t[44]=re,t[45]=Y):Y=t[45];let X;return t[46]!==q||t[47]!==Y||t[48]!==N?(X=(0,$.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[N,q,Y]}),t[46]=q,t[47]=Y,t[48]=N,t[49]=X):X=t[49],X},ve=e=>{let t=(0,Q.c)(8),{packages:n}=e,r;t[0]===n?r=t[1]:(r=n.toSorted(we),t[0]=n,t[1]=r);let i=r;if(n.length===0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{title:`No packages`,description:`No packages are installed in this environment.`,icon:(0,$.jsx)(o,{})}),t[2]=e):e=t[2],e}let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(te,{children:(0,$.jsxs)(z,{children:[(0,$.jsx)(L,{children:`Name`}),(0,$.jsx)(L,{children:`Version`}),(0,$.jsx)(L,{})]})}),t[3]=a):a=t[3];let s;t[4]===i?s=t[5]:(s=i.map(Te),t[4]=i,t[5]=s);let c;return t[6]===s?c=t[7]:(c=(0,$.jsxs)(V,{className:`overflow-auto flex-1`,children:[a,(0,$.jsx)(R,{children:s})]}),t[6]=s,t[7]=c),c},ye=e=>{let t=(0,Q.c)(3),{packageName:n,tags:r}=e,{loading:i,run:a}=oe(`upgrade`,n,r);if(l())return null;let o;return t[0]!==i||t[1]!==a?(o=(0,$.jsx)(me,{onClick:a,loading:i,children:`Upgrade`}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o},be=e=>{let t=(0,Q.c)(3),{packageName:n,tags:r}=e,{loading:i,run:a}=oe(`remove`,n,r);if(n.toLowerCase()===`marimo`)return null;let o;return t[0]!==i||t[1]!==a?(o=(0,$.jsx)(me,{onClick:a,loading:i,children:`Remove`}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o},xe=e=>{let t=(0,Q.c)(16),{tree:n,error:r,sandboxBackend:i}=e,[a,s]=H(n,Ee);if(r){let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(I,{error:r}),t[0]=r,t[1]=e),e}if(!n){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{title:`Dependency tree unavailable`,description:`The sandbox did not return a dependency tree.`,icon:(0,$.jsx)(o,{})}),t[2]=e):e=t[2],e}if(n.dependencies.length===0){if(i===`pixi`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{title:`No PyPI dependencies`,description:`Conda dependencies are not shown in this panel.`,icon:(0,$.jsx)(o,{})}),t[3]=e):e=t[3],e}let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{title:`No dependencies`,description:`No package dependencies found in this environment.`,icon:(0,$.jsx)(o,{})}),t[4]=e):e=t[4],e}let c;t[5]===s?c=t[6]:(c=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=s,t[6]=c);let l=c,u;if(t[7]!==a||t[8]!==l||t[9]!==n.dependencies){let e;t[11]!==a||t[12]!==l?(e=(e,t)=>(0,$.jsx)(`div`,{className:`border-b`,children:(0,$.jsx)(Se,{nodeId:`root-${t}`,node:e,level:0,isTopLevel:!0,expandedNodes:a,onToggle:l})},`${e.name}-${t}`),t[11]=a,t[12]=l,t[13]=e):e=t[13],u=n.dependencies.map(e),t[7]=a,t[8]=l,t[9]=n.dependencies,t[10]=u}else u=t[10];let d;return t[14]===u?d=t[15]:(d=(0,$.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,$.jsx)(`div`,{children:u})}),t[14]=u,t[15]=d),d},Se=e=>{let t=(0,Q.c)(56),{nodeId:n,node:r,level:i,isTopLevel:a,expandedNodes:o,onToggle:s}=e,c=a!==void 0&&a,l=r.dependencies.length>0,u;t[0]!==o||t[1]!==n?(u=o.has(n),t[0]=o,t[1]=n,t[2]=u):u=t[2];let d=u,p=c?0:16+i*16,m;t[3]!==l||t[4]!==n||t[5]!==s?(m=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l&&s(n))},t[3]=l,t[4]=n,t[5]=s,t[6]=m):m=t[6];let h=m,g;t[7]!==l||t[8]!==n||t[9]!==s?(g=e=>{e.stopPropagation(),l&&s(n)},t[7]=l,t[8]=n,t[9]=s,t[10]=g):g=t[10];let _=g,b=l&&`select-none`,x=c?`px-2 py-0.5`:``,S;t[11]!==b||t[12]!==x?(S=f(`flex items-center group cursor-pointer text-sm whitespace-nowrap`,`hover:bg-(--slate-2) focus:bg-(--slate-2) focus:outline-hidden`,b,x),t[11]=b,t[12]=x,t[13]=S):S=t[13];let C;t[14]!==p||t[15]!==c?(C=c?{}:{paddingLeft:`${p}px`},t[14]=p,t[15]=c,t[16]=C):C=t[16];let w=l?d:void 0,T;t[17]!==l||t[18]!==d?(T=l?d?(0,$.jsx)(v,{className:`w-4 h-4 mr-2 shrink-0`}):(0,$.jsx)(y,{className:`w-4 h-4 mr-2 shrink-0`}):(0,$.jsx)(`div`,{className:`w-4 mr-2 shrink-0`}),t[17]=l,t[18]=d,t[19]=T):T=t[19];let E;t[20]===r.name?E=t[21]:(E=(0,$.jsx)(`span`,{className:`font-medium truncate`,children:r.name}),t[20]=r.name,t[21]=E);let D;t[22]===r.version?D=t[23]:(D=r.version&&(0,$.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`v`,r.version]}),t[22]=r.version,t[23]=D);let O;t[24]!==E||t[25]!==D?(O=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 py-1.5`,children:[E,D]}),t[24]=E,t[25]=D,t[26]=O):O=t[26];let k;t[27]===r.tags?k=t[28]:(k=r.tags.map(De),t[27]=r.tags,t[28]=k);let A;t[29]===k?A=t[30]:(A=(0,$.jsx)(`div`,{className:`flex items-center gap-1 ml-2`,children:k}),t[29]=k,t[30]=A);let j;t[31]!==c||t[32]!==r.name||t[33]!==r.tags?(j=c&&(0,$.jsxs)(`div`,{className:`flex gap-1 invisible group-hover:visible`,children:[(0,$.jsx)(ye,{packageName:r.name,tags:r.tags}),(0,$.jsx)(be,{packageName:r.name,tags:r.tags})]}),t[31]=c,t[32]=r.name,t[33]=r.tags,t[34]=j):j=t[34];let M;t[35]!==_||t[36]!==h||t[37]!==T||t[38]!==O||t[39]!==A||t[40]!==j||t[41]!==S||t[42]!==C||t[43]!==w?(M=(0,$.jsxs)(`div`,{className:S,style:C,onClick:_,onKeyDown:h,tabIndex:0,role:`treeitem`,"aria-selected":!1,"aria-expanded":w,children:[T,O,A,j]}),t[35]=_,t[36]=h,t[37]=T,t[38]=O,t[39]=A,t[40]=j,t[41]=S,t[42]=C,t[43]=w,t[44]=M):M=t[44];let N;t[45]!==o||t[46]!==l||t[47]!==d||t[48]!==i||t[49]!==r.dependencies||t[50]!==n||t[51]!==s?(N=l&&d&&(0,$.jsx)(`div`,{role:`group`,children:r.dependencies.map((e,t)=>(0,$.jsx)(Se,{nodeId:`${n}-${t}`,node:e,level:i+1,isTopLevel:!1,expandedNodes:o,onToggle:s},`${e.name}-${t}`))}),t[45]=o,t[46]=l,t[47]=d,t[48]=i,t[49]=r.dependencies,t[50]=n,t[51]=s,t[52]=N):N=t[52];let P;return t[53]!==M||t[54]!==N?(P=(0,$.jsxs)(`div`,{children:[M,N]}),t[53]=M,t[54]=N,t[55]=P):P=t[55],P};function Ce(e,t){return e===`list`?`list`:t?e||`tree`:`list`}function we(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:`base`})}function Te(e){return(0,$.jsxs)(z,{className:`group`,onClick:async()=>{await w(`${e.name}==${e.version}`),T({title:`Copied to clipboard`})},children:[(0,$.jsx)(B,{children:e.name}),(0,$.jsx)(B,{children:e.version}),(0,$.jsxs)(B,{className:`flex justify-end`,children:[(0,$.jsx)(ye,{packageName:e.name}),(0,$.jsx)(be,{packageName:e.name})]})]},e.name)}function Ee(){return new Set}function De(e,t){return e.kind===`dedupe`?(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-muted-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium`,title:`Package tree already displayed`,children:`already in tree`},t):e.kind===`cycle`?(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-orange-300 dark:border-orange-700 text-orange-700 dark:text-orange-300`,title:`cycle`,children:`cycle`},t):e.kind===`extra`?(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-300`,title:e.value,children:e.value},t):e.kind===`group`?(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-green-300 dark:border-green-700 text-green-700 dark:text-green-300`,title:e.value,children:e.value},t):null}export{he as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,l as n,t as r,u as i}from"./useEvent-Dfcbgjhg.js";import{t as a}from"./react-DVplv7_D.js";import{uo as o}from"./cells-T9_Y4Jlv.js";import{t as s}from"./compiler-runtime-BrajqUja.js";import{C as c}from"./config-DGX7JYor.js";import{N as l,v as u,x as d}from"./config-DzdxZb17.js";import{t as f}from"./cn-ldLVeaqm.js";import{t as p}from"./jsx-runtime-B74pBk57.js";import{t as m}from"./tooltip-CkGm8X7m.js";import{r as h,t as g}from"./button-D8gVKwe-.js";import{r as _}from"./ai-model-dropdown-bwTRyFn4.js";import{a as v}from"./useNumberFormatter-D7O_26UI.js";import{t as y}from"./chevron-right-eAtVhbNZ.js";import{s as b}from"./toDate-DOj9Q6uC.js";import{t as x}from"./spinner-DyNE-o8o.js";import{t as S}from"./refresh-cw-Qw1f8Jhy.js";import{a as C}from"./input-BZdRe7pb.js";import{n as w}from"./copy-KlhazlhB.js";import{t as T}from"./use-toast-Wu434mLr.js";import{r as E}from"./requests-lt0JK8Jt.js";import{n as D}from"./useAsyncData-DhhdOGGd.js";import{n as O}from"./package-data-dv4FBHxR.js";import{c as k,d as A,i as j,o as M,r as N,s as P,t as ee}from"./useInstallPackage-C7neMPwh.js";import{a as F}from"./errors-CNsgAw6m.js";import{n as I}from"./error-banner-B5kzVf_0.js";import{a as te,i as L,n as R,o as z,r as B,t as V}from"./table-vrvqpuKJ.js";import{t as H}from"./useStateForKey-CGMJQT8x.js";import{t as U}from"./empty-state-BaCKb7o3.js";import{r as W}from"./panel-context-C2QXpKfx.js";import{c as G,d as K,f as q,l as ne,n as J,p as re,s as Y,t as X,u as ie}from"./runtime-details-state-CznIe40L.js";var Z=e(a(),1),Q=s();function ae(e){let t=e.trim();for(let e of[`pip install`,`pip3 install`,`uv add`,`uv pip install`,`poetry add`,`conda install`,`pipenv install`])if(t.toLowerCase().startsWith(e.toLowerCase()))return t.slice(e.length).trim();return t}function oe(e,t,n){let{addPackage:i,removePackage:a}=E(),[o,s]=(0,Z.useState)(!1),c=(0,Z.useRef)(!1);return{loading:o,run:r(async()=>{if(c.current)return;c.current=!0,s(!0);let r=e===`upgrade`?M:j;try{let o={package:t,group:n?.find(e=>e.kind===`group`)?.value},s=await(e===`upgrade`?i({...o,upgrade:!0}):a(o));s.restartRequired?N():s.success?r(t):r(t,s.error||`Package operation failed.`)}catch(e){r(t,F(e))}finally{c.current=!1,s(!1)}})}}function se(){let e=(0,Q.c)(8),t=n(O),[r]=c(),i=r.package_management.manager,{getDependencyTree:a,getPackageList:o}=E(),s;e[0]!==a||e[1]!==o?(s=async()=>{let{context:e,tree:t}=await a();return{list:e.kind===`sandbox`?[]:(await o()).packages,context:e,tree:t}},e[0]=a,e[1]=o,e[2]=s):s=e[2];let l;return e[3]!==a||e[4]!==o||e[5]!==t||e[6]!==i?(l=[a,o,i,t],e[3]=a,e[4]=o,e[5]=t,e[6]=i,e[7]=l):l=e[7],D(s,l)}var $=p();function ce(e){let t=(0,Q.c)(17),{notice:r}=e,i=n(K),a=n(ie),o=n(q);if(r.pending||r.ready)return null;let s=!a||i?.manifest==null,c;t[0]===a?c=t[1]:(c=()=>a?.editManifest(),t[0]=a,t[1]=c);let l;t[2]!==s||t[3]!==c?(l=(0,$.jsx)(g,{variant:`outline`,size:`xs`,disabled:s,onClick:c,children:`Edit manifest…`}),t[2]=s,t[3]=c,t[4]=l):l=t[4];let u;t[5]!==a||t[6]!==r.kind||t[7]!==o?(u=r.kind===`sync`&&o.kind===`restart-required`?(0,$.jsx)(le,{}):(0,$.jsx)(g,{variant:`text`,size:`xs`,disabled:!a,onClick:()=>a?.sync(),children:`Retry sync`}),t[5]=a,t[6]=r.kind,t[7]=o,t[8]=u):u=t[8];let d;t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11];let f;t[12]===i?.manifest?f=t[13]:(f=i?.manifest==null&&(0,$.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`A manifest will be available once this new notebook starts.`}),t[12]=i?.manifest,t[13]=f);let p;return t[14]!==d||t[15]!==f?(p=(0,$.jsxs)($.Fragment,{children:[d,f]}),t[14]=d,t[15]=f,t[16]=p):p=t[16],p}function le(){let e=(0,Q.c)(2),t=P(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(g,{variant:`text`,size:`xs`,onClick:t,children:`Restart Kernel`}),e[0]=t,e[1]=n),n}function ue(e){let t=(0,Q.c)(5),{notice:n}=e,r;t[0]===n?r=t[1]:(r=n.sandbox&&(0,$.jsx)(ce,{notice:n}),t[0]=n,t[1]=r);let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(J,{notice:n,children:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}function de(e){let t=(0,Q.c)(9),{notice:r}=e,i=n(re);if(!i&&!r)return null;let a;t[0]===r?a=t[1]:(a=r?(0,$.jsx)(`div`,{className:`mb-5`,children:(0,$.jsx)(ue,{notice:r})}):(0,$.jsx)(`p`,{className:`text-sm`,children:`Environment synced`}),t[0]=r,t[1]=a);let o=i?.operation_id,s=i?.logs.environment??``,c=i?.status.kind===`running`?`running`:i?.status.kind===`succeeded`?`succeeded`:`failed`,l;t[2]!==o||t[3]!==s||t[4]!==c?(l=(0,$.jsx)(Y,{logs:s,state:c,label:`sandbox sync output`},o),t[2]=o,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;return t[6]!==a||t[7]!==l?(u=(0,$.jsxs)(`div`,{className:`mt-5 min-w-0`,children:[a,l]}),t[6]=a,t[7]=l,t[8]=u):u=t[8],u}function fe(){let e=(0,Q.c)(41),r=W(),i=!!n(K)?.backend,a=n(u),o=n(G),s;e[0]===o?s=e[1]:(s=o&&{...o,ready:!1},e[0]=o,e[1]=s);let c=s,l=n(ne),p=n(d),[m,h]=t(X),g;e[2]!==a||e[3]!==c||e[4]!==l||e[5]!==p||e[6]!==i?(g=c?.kind===`startup`?c:l||p||a&&!i?{kind:`startup`,sandbox:i,title:`Notebook started`,description:`The notebook is ready to run.`,pending:!1,ready:!0,error:null}:null,e[2]=a,e[3]=c,e[4]=l,e[5]=p,e[6]=i,e[7]=g):g=e[7];let _=g,v=`runtime-details-${r}`,y=i?`Sandbox details`:`Runtime details`,b=!m,x=a?`shrink-0 max-h-[65%] border-b`:`flex-1`,S;e[8]===x?S=e[9]:(S=f(`min-w-0 overflow-auto p-4`,x),e[8]=x,e[9]=S);let C,w;e[10]===h?(C=e[11],w=e[12]):(C=()=>h(!0),w=()=>h(!0),e[10]=h,e[11]=C,e[12]=w);let T;e[13]===c?T=e[14]:(T=c?.kind===`connection`&&(0,$.jsx)(`div`,{className:`mb-5`,children:(0,$.jsx)(ue,{notice:c})}),e[13]=c,e[14]=T);let E;e[15]===_?E=e[16]:(E=_&&(0,$.jsx)(ue,{notice:_}),e[15]=_,e[16]=E);let D;e[17]!==a||e[18]!==c||e[19]!==i?(D=i&&a&&(0,$.jsx)(de,{notice:c?.kind===`sync`?c:null}),e[17]=a,e[18]=c,e[19]=i,e[20]=D):D=e[20];let O;e[21]!==a||e[22]!==c||e[23]!==i?(O=i&&a&&(!c||c.pending)&&(0,$.jsx)(pe,{}),e[21]=a,e[22]=c,e[23]=i,e[24]=O):O=e[24];let k;e[25]!==c||e[26]!==i||e[27]!==_?(k=!c&&!_&&!i&&(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Not connected to a runtime.`}),e[25]=c,e[26]=i,e[27]=_,e[28]=k):k=e[28];let A;return e[29]!==E||e[30]!==D||e[31]!==O||e[32]!==k||e[33]!==v||e[34]!==y||e[35]!==b||e[36]!==S||e[37]!==C||e[38]!==w||e[39]!==T?(A=(0,$.jsxs)(`section`,{id:v,"aria-label":y,hidden:b,className:S,onPointerDownCapture:C,onFocusCapture:w,children:[T,E,D,O,k]}),e[29]=E,e[30]=D,e[31]=O,e[32]=k,e[33]=v,e[34]=y,e[35]=b,e[36]=S,e[37]=C,e[38]=w,e[39]=T,e[40]=A):A=e[40],A}function pe(){let e=(0,Q.c)(14),t=n(K),r=n(ie),i=n(q).kind===`running`||!r,a;e[0]===r?a=e[1]:(a=()=>r?.sync(),e[0]=r,e[1]=a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(S,{className:`size-3`,"aria-hidden":!0}),e[2]=o):o=e[2];let s;e[3]!==i||e[4]!==a?(s=(0,$.jsxs)(g,{variant:`text`,size:`xs`,className:`text-muted-foreground gap-1.5 p-0`,disabled:i,onClick:a,children:[o,`Sync`]}),e[3]=i,e[4]=a,e[5]=s):s=e[5];let c=!r||t?.manifest==null,l;e[6]===r?l=e[7]:(l=()=>r?.editManifest(),e[6]=r,e[7]=l);let u;e[8]!==c||e[9]!==l?(u=(0,$.jsx)(g,{variant:`text`,size:`xs`,className:`text-muted-foreground p-0`,disabled:c,onClick:l,children:`Edit manifest…`}),e[8]=c,e[9]=l,e[10]=u):u=e[10];let d;return e[11]!==s||e[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center gap-4 mt-5 border-t pt-3`,children:[s,u]}),e[11]=s,e[12]=u,e[13]=d):d=e[13],d}var me=e=>{let t=(0,Q.c)(9),{onClick:n,loading:r,children:i,className:a}=e;if(r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(x,{size:`small`,className:`h-4 w-4 shrink-0 opacity-50`}),t[0]=e):e=t[0],e}let o;t[1]===a?o=t[2]:(o=f(`px-2 h-full text-xs text-muted-foreground hover:text-foreground`,`invisible group-hover:visible`,a),t[1]=a,t[2]=o);let s;t[3]===n?s=t[4]:(s=h.stopPropagation(n),t[3]=n,t[4]=s);let c;return t[5]!==i||t[6]!==o||t[7]!==s?(c=(0,$.jsx)(`button`,{type:`button`,className:o,onClick:s,children:i}),t[5]=i,t[6]=o,t[7]=s,t[8]=c):c=t[8],c},he=()=>{let e=(0,Q.c)(5),t=n(u),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(fe,{}),e[0]=r):r=e[0];let i;e[1]===t?i=e[2]:(i=t&&(0,$.jsx)(ge,{}),e[1]=t,e[2]=i);let a;return e[3]===i?a=e[4]:(a=(0,$.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 overflow-hidden`,children:[r,i]}),e[3]=i,e[4]=a),a},ge=()=>{let e=(0,Q.c)(35),t=n(q).kind===`running`,[r,i]=Z.useState(null),{data:a,error:o,isPending:s}=se();if(s){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`output`,{className:`flex flex-1 items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(x,{className:`size-4`}),`Loading installed packages…`]}),e[0]=t):t=e[0],t}if(o){let t;return e[1]===o?t=e[2]:(t=(0,$.jsx)(I,{error:o}),e[1]=o,e[2]=t),t}let c=a.tree!=null,l=a.tree?.name,u=a?.tree?.version,d=a.context.kind===`sandbox`?a.context.backend:null,p=d!==null,m;e[3]!==p||e[4]!==c||e[5]!==r?(m=p?`tree`:Ce(r,c),e[3]=p,e[4]=c,e[5]=r,e[6]=m):m=e[6];let h=m,g=l&&l!==`<root>`?`project`:`environment`,_;e[7]===a.context?_=e[8]:(_=(0,$.jsx)(_e,{context:a.context}),e[7]=a.context,e[8]=_);let v;e[9]!==t||e[10]!==_?(v=(0,$.jsx)(`fieldset`,{disabled:t,className:`contents`,children:_}),e[9]=t,e[10]=_,e[11]=v):v=e[11];let y;e[12]!==p||e[13]!==c||e[14]!==l||e[15]!==g||e[16]!==u||e[17]!==h?(y=c&&!p&&(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 border-b`,children:[(0,$.jsxs)(`div`,{className:`flex gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,className:f(`px-2 py-1 text-xs rounded`,h===`list`?`bg-accent text-accent-foreground`:`text-muted-foreground hover:text-foreground`),onClick:()=>i(`list`),children:`List`}),(0,$.jsx)(`button`,{type:`button`,className:f(`px-2 py-1 text-xs rounded`,h===`tree`?`bg-accent text-accent-foreground`:`text-muted-foreground hover:text-foreground`),onClick:()=>i(`tree`),children:`Tree`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium`,title:g,children:g}),l&&(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[l,u&&` v${u}`]})]})]}),e[12]=p,e[13]=c,e[14]=l,e[15]=g,e[16]=u,e[17]=h,e[18]=y):y=e[18];let b;e[19]===t?b=e[20]:(b=t&&(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`Showing packages from the last sync.`}),e[19]=t,e[20]=b);let S;e[21]!==a.list||e[22]!==a.tree||e[23]!==o||e[24]!==d||e[25]!==h?(S=h===`list`?(0,$.jsx)(ve,{packages:a.list}):(0,$.jsx)(xe,{tree:a.tree,error:o,sandboxBackend:d}),e[21]=a.list,e[22]=a.tree,e[23]=o,e[24]=d,e[25]=h,e[26]=S):S=e[26];let C;e[27]!==t||e[28]!==b||e[29]!==S?(C=(0,$.jsxs)(`fieldset`,{disabled:t,className:`flex flex-col flex-1 min-h-0`,"aria-busy":t,children:[b,S]}),e[27]=t,e[28]=b,e[29]=S,e[30]=C):C=e[30];let w;return e[31]!==v||e[32]!==y||e[33]!==C?(w=(0,$.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[v,y,C]}),e[31]=v,e[32]=y,e[33]=C,e[34]=w):w=e[34],w},_e=e=>{let t=(0,Q.c)(50),{context:r}=e,[a,s]=Z.useState(``),{handleClick:c}=_(),l=r.kind===`sandbox`,u=l?r.backend:r.name,d=n(A),p=i(A),h,g;t[0]!==d||t[1]!==p?(h=()=>{d&&(s(d),p(null))},g=[d,p],t[0]=d,t[1]=p,t[2]=h,t[3]=g):(h=t[2],g=t[3]),Z.useEffect(h,g);let{loading:v,handleInstallPackages:y}=ee(),S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{s(``)},t[4]=S):S=t[4];let w=S,T;t[5]!==y||t[6]!==a?(T=()=>{let e=ae(a);y([e],w)},t[5]=y,t[6]=a,t[7]=T):T=t[7];let E=T,D=l?`Add packages to ${u} sandbox...`:`Install packages with ${u}...`,O;t[8]!==l||t[9]!==v||t[10]!==c||t[11]!==u?(O=v?(0,$.jsx)(x,{size:`small`,className:`mr-2 h-4 w-4 shrink-0 opacity-50`}):l?(0,$.jsx)(o,{"aria-hidden":`true`,className:`mr-2 h-4 w-4 shrink-0 opacity-50`}):(0,$.jsx)(m,{content:`Change package manager (currently ${u})`,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":`Change package manager`,onClick:()=>c(`packageManagementAndData`),className:`pointer-events-auto mr-2 rounded-sm opacity-50 hover:opacity-80 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring`,children:(0,$.jsx)(o,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0`})})}),t[8]=l,t[9]=v,t[10]=c,t[11]=u,t[12]=O):O=t[12];let j;t[13]===E?j=t[14]:(j=e=>{e.key===`Enter`&&(e.preventDefault(),E())},t[13]=E,t[14]=j);let M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>s(e.target.value),t[15]=M):M=t[15];let N;t[16]!==a||t[17]!==D||t[18]!==O||t[19]!==j?(N=(0,$.jsx)(C,{placeholder:D,id:k,icon:O,rootClassName:`flex-1 border-none`,value:a,onKeyDown:j,onChange:M}),t[16]=a,t[17]=D,t[18]=O,t[19]=j,t[20]=N):N=t[20];let P;t[21]!==l||t[22]!==u?(P=l?(0,$.jsxs)(`span`,{children:[`Packages are recorded in this notebook's inline metadata and synchronized with its `,u,` sandbox. To switch backends, restart marimo with a different --sandbox option.`]}):(0,$.jsxs)(`span`,{children:[`Packages are installed using `,u,`, selected in your user configuration.`]}),t[21]=l,t[22]=u,t[23]=P):P=t[23];let F;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`span`,{className:`mt-2`,children:`You can install packages with various formats:`}),t[24]=F):F=t[24];let I;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`Package name:`}),t[25]=I):I=t[25];let te,L;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsxs)(`div`,{children:[I,` A package name; this will install the latest version.`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Example: httpx`})]}),L=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`Package and version:`}),t[26]=te,t[27]=L):(te=t[26],L=t[27]);let R,z;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsxs)(`div`,{children:[L,` `,`A package with a specific version or version range.`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Examples: httpx==0.27.0, httpx>=0.27.0`})]}),z=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`Git:`}),t[28]=R,t[29]=z):(R=t[28],z=t[29]);let B,V;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsxs)(`div`,{children:[z,` A Git repository`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Example: git+https://github.com/encode/httpx`})]}),V=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`URL:`}),t[30]=B,t[31]=V):(B=t[30],V=t[31]);let H,U;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsxs)(`div`,{children:[V,` A remote wheel or source distribution.`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Example: https://example.com/httpx-0.27.0.tar.gz`})]}),U=(0,$.jsx)(`span`,{className:`font-bold tracking-wide`,children:`Path:`}),t[32]=H,t[33]=U):(H=t[32],U=t[33]);let W;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 mt-2`,children:[te,R,B,H,(0,$.jsxs)(`div`,{children:[U,` A local wheel, source distribution, or project directory.`,(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:`Example: /example/foo-0.1.0-py3-none-any.whl`})]})]}),t[34]=W):W=t[34];let G;t[35]===P?G=t[36]:(G=(0,$.jsxs)(`div`,{className:`text-sm flex flex-col w-full max-w-[360px]`,children:[P,F,W]}),t[35]=P,t[36]=G);let K;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(b,{className:`h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent`}),t[37]=K):K=t[37];let q;t[38]===G?q=t[39]:(q=(0,$.jsx)(m,{delayDuration:300,side:`left`,align:`start`,content:G,children:K}),t[38]=G,t[39]=q);let ne=a&&`bg-accent text-accent-foreground`,J;t[40]===ne?J=t[41]:(J=f(`float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2`,ne,`disabled:cursor-not-allowed disabled:opacity-50`),t[40]=ne,t[41]=J);let re=!a,Y;t[42]!==E||t[43]!==J||t[44]!==re?(Y=(0,$.jsx)(`button`,{type:`button`,className:J,onClick:E,disabled:re,children:`Add`}),t[42]=E,t[43]=J,t[44]=re,t[45]=Y):Y=t[45];let X;return t[46]!==q||t[47]!==Y||t[48]!==N?(X=(0,$.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[N,q,Y]}),t[46]=q,t[47]=Y,t[48]=N,t[49]=X):X=t[49],X},ve=e=>{let t=(0,Q.c)(8),{packages:n}=e,r;t[0]===n?r=t[1]:(r=n.toSorted(we),t[0]=n,t[1]=r);let i=r;if(n.length===0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{title:`No packages`,description:`No packages are installed in this environment.`,icon:(0,$.jsx)(o,{})}),t[2]=e):e=t[2],e}let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(te,{children:(0,$.jsxs)(z,{children:[(0,$.jsx)(L,{children:`Name`}),(0,$.jsx)(L,{children:`Version`}),(0,$.jsx)(L,{})]})}),t[3]=a):a=t[3];let s;t[4]===i?s=t[5]:(s=i.map(Te),t[4]=i,t[5]=s);let c;return t[6]===s?c=t[7]:(c=(0,$.jsxs)(V,{className:`overflow-auto flex-1`,children:[a,(0,$.jsx)(R,{children:s})]}),t[6]=s,t[7]=c),c},ye=e=>{let t=(0,Q.c)(3),{packageName:n,tags:r}=e,{loading:i,run:a}=oe(`upgrade`,n,r);if(l())return null;let o;return t[0]!==i||t[1]!==a?(o=(0,$.jsx)(me,{onClick:a,loading:i,children:`Upgrade`}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o},be=e=>{let t=(0,Q.c)(3),{packageName:n,tags:r}=e,{loading:i,run:a}=oe(`remove`,n,r);if(n.toLowerCase()===`marimo`)return null;let o;return t[0]!==i||t[1]!==a?(o=(0,$.jsx)(me,{onClick:a,loading:i,children:`Remove`}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o},xe=e=>{let t=(0,Q.c)(16),{tree:n,error:r,sandboxBackend:i}=e,[a,s]=H(n,Ee);if(r){let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(I,{error:r}),t[0]=r,t[1]=e),e}if(!n){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{title:`Dependency tree unavailable`,description:`The sandbox did not return a dependency tree.`,icon:(0,$.jsx)(o,{})}),t[2]=e):e=t[2],e}if(n.dependencies.length===0){if(i===`pixi`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{title:`No PyPI dependencies`,description:`Conda dependencies are not shown in this panel.`,icon:(0,$.jsx)(o,{})}),t[3]=e):e=t[3],e}let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(U,{title:`No dependencies`,description:`No package dependencies found in this environment.`,icon:(0,$.jsx)(o,{})}),t[4]=e):e=t[4],e}let c;t[5]===s?c=t[6]:(c=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=s,t[6]=c);let l=c,u;if(t[7]!==a||t[8]!==l||t[9]!==n.dependencies){let e;t[11]!==a||t[12]!==l?(e=(e,t)=>(0,$.jsx)(`div`,{className:`border-b`,children:(0,$.jsx)(Se,{nodeId:`root-${t}`,node:e,level:0,isTopLevel:!0,expandedNodes:a,onToggle:l})},`${e.name}-${t}`),t[11]=a,t[12]=l,t[13]=e):e=t[13],u=n.dependencies.map(e),t[7]=a,t[8]=l,t[9]=n.dependencies,t[10]=u}else u=t[10];let d;return t[14]===u?d=t[15]:(d=(0,$.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,$.jsx)(`div`,{children:u})}),t[14]=u,t[15]=d),d},Se=e=>{let t=(0,Q.c)(56),{nodeId:n,node:r,level:i,isTopLevel:a,expandedNodes:o,onToggle:s}=e,c=a!==void 0&&a,l=r.dependencies.length>0,u;t[0]!==o||t[1]!==n?(u=o.has(n),t[0]=o,t[1]=n,t[2]=u):u=t[2];let d=u,p=c?0:16+i*16,m;t[3]!==l||t[4]!==n||t[5]!==s?(m=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l&&s(n))},t[3]=l,t[4]=n,t[5]=s,t[6]=m):m=t[6];let h=m,g;t[7]!==l||t[8]!==n||t[9]!==s?(g=e=>{e.stopPropagation(),l&&s(n)},t[7]=l,t[8]=n,t[9]=s,t[10]=g):g=t[10];let _=g,b=l&&`select-none`,x=c?`px-2 py-0.5`:``,S;t[11]!==b||t[12]!==x?(S=f(`flex items-center group cursor-pointer text-sm whitespace-nowrap`,`hover:bg-(--slate-2) focus:bg-(--slate-2) focus:outline-hidden`,b,x),t[11]=b,t[12]=x,t[13]=S):S=t[13];let C;t[14]!==p||t[15]!==c?(C=c?{}:{paddingLeft:`${p}px`},t[14]=p,t[15]=c,t[16]=C):C=t[16];let w=l?d:void 0,T;t[17]!==l||t[18]!==d?(T=l?d?(0,$.jsx)(v,{className:`w-4 h-4 mr-2 shrink-0`}):(0,$.jsx)(y,{className:`w-4 h-4 mr-2 shrink-0`}):(0,$.jsx)(`div`,{className:`w-4 mr-2 shrink-0`}),t[17]=l,t[18]=d,t[19]=T):T=t[19];let E;t[20]===r.name?E=t[21]:(E=(0,$.jsx)(`span`,{className:`font-medium truncate`,children:r.name}),t[20]=r.name,t[21]=E);let D;t[22]===r.version?D=t[23]:(D=r.version&&(0,$.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`v`,r.version]}),t[22]=r.version,t[23]=D);let O;t[24]!==E||t[25]!==D?(O=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 py-1.5`,children:[E,D]}),t[24]=E,t[25]=D,t[26]=O):O=t[26];let k;t[27]===r.tags?k=t[28]:(k=r.tags.map(De),t[27]=r.tags,t[28]=k);let A;t[29]===k?A=t[30]:(A=(0,$.jsx)(`div`,{className:`flex items-center gap-1 ml-2`,children:k}),t[29]=k,t[30]=A);let j;t[31]!==c||t[32]!==r.name||t[33]!==r.tags?(j=c&&(0,$.jsxs)(`div`,{className:`flex gap-1 invisible group-hover:visible`,children:[(0,$.jsx)(ye,{packageName:r.name,tags:r.tags}),(0,$.jsx)(be,{packageName:r.name,tags:r.tags})]}),t[31]=c,t[32]=r.name,t[33]=r.tags,t[34]=j):j=t[34];let M;t[35]!==_||t[36]!==h||t[37]!==T||t[38]!==O||t[39]!==A||t[40]!==j||t[41]!==S||t[42]!==C||t[43]!==w?(M=(0,$.jsxs)(`div`,{className:S,style:C,onClick:_,onKeyDown:h,tabIndex:0,role:`treeitem`,"aria-selected":!1,"aria-expanded":w,children:[T,O,A,j]}),t[35]=_,t[36]=h,t[37]=T,t[38]=O,t[39]=A,t[40]=j,t[41]=S,t[42]=C,t[43]=w,t[44]=M):M=t[44];let N;t[45]!==o||t[46]!==l||t[47]!==d||t[48]!==i||t[49]!==r.dependencies||t[50]!==n||t[51]!==s?(N=l&&d&&(0,$.jsx)(`div`,{role:`group`,children:r.dependencies.map((e,t)=>(0,$.jsx)(Se,{nodeId:`${n}-${t}`,node:e,level:i+1,isTopLevel:!1,expandedNodes:o,onToggle:s},`${e.name}-${t}`))}),t[45]=o,t[46]=l,t[47]=d,t[48]=i,t[49]=r.dependencies,t[50]=n,t[51]=s,t[52]=N):N=t[52];let P;return t[53]!==M||t[54]!==N?(P=(0,$.jsxs)(`div`,{children:[M,N]}),t[53]=M,t[54]=N,t[55]=P):P=t[55],P};function Ce(e,t){return e===`list`?`list`:t?e||`tree`:`list`}function we(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:`base`})}function Te(e){return(0,$.jsxs)(z,{className:`group`,onClick:async()=>{await w(`${e.name}==${e.version}`),T({title:`Copied to clipboard`})},children:[(0,$.jsx)(B,{children:e.name}),(0,$.jsx)(B,{children:e.version}),(0,$.jsxs)(B,{className:`flex justify-end`,children:[(0,$.jsx)(ye,{packageName:e.name}),(0,$.jsx)(be,{packageName:e.name})]})]},e.name)}function Ee(){return new Set}function De(e,t){return e.kind===`dedupe`?(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-muted-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium`,title:`Package tree already displayed`,children:`already in tree`},t):e.kind===`cycle`?(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-orange-300 dark:border-orange-700 text-orange-700 dark:text-orange-300`,title:`cycle`,children:`cycle`},t):e.kind===`extra`?(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-300`,title:e.value,children:e.value},t):e.kind===`group`?(0,$.jsx)(`div`,{className:`items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-green-300 dark:border-green-700 text-green-700 dark:text-green-300`,title:e.value,children:e.value},t):null}export{he as default};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,d as n,f as r,l as i,r as a,t as o,u as s}from"./useEvent-Dfcbgjhg.js";import{t as c}from"./react-DVplv7_D.js";import{$ as l,B as u,D as d,Dt as f,Et as p,Gn as m,Hr as h,I as g,Ii as ee,Jn as _,Kn as v,Mr as y,Oo as b,Ot as te,R as x,So as ne,St as re,T as ie,Vi as ae,Wn as oe,b as se,ei as ce,g as le,h as ue,l as de,mr as fe,pr as pe,qn as me,r as he}from"./cells-T9_Y4Jlv.js";import{C as S,E as C,F as w,I as T,K as ge,N as E,O as _e,R as D,S as O,b as k,c as A,v as j,z as M}from"./schemas-ChRqMOTL.js";import{t as ve}from"./compiler-runtime-BrajqUja.js";import{D as ye,d as be,w as xe}from"./config-DGX7JYor.js";import{_ as Se,c as Ce,g as we,i as Te,m as Ee,n as De,o as Oe,p as ke,r as N,s as Ae,t as P}from"./state-BRYi026f.js";import{g as F,t as je}from"./useEventListener-CjDeLqFC.js";import{t as I}from"./objects-rLPlQ3X_.js";import{i as Me}from"./utils-B4K466FK.js";import{a as Ne,f as Pe,m as Fe,r as Ie,v as Le}from"./session-B8Y-GJnS.js";import{E as L,N as Re,T as R,_ as ze,l as Be,o as Ve,w as z,x as He}from"./config-DzdxZb17.js";import{r as Ue}from"./state-C0irhlOZ.js";import{i as We,o as Ge,r as Ke}from"./state-DaWgt-rn.js";import{r as qe}from"./ErrorBoundary-DJhsFCsX.js";import{n as B,t as V}from"./cn-ldLVeaqm.js";import{t as H}from"./jsx-runtime-B74pBk57.js";import{i as U,s as W}from"./fullscreen-BWTs8pYZ.js";import{a as Je,c as G,i as Ye,l as Xe,n as Ze,o as Qe,r as $e,s as et}from"./use-restore-focus-DdS7Tl0F.js";import{Dt as tt,Et as nt,xt as rt}from"./JsonOutput-Pm6OCP3J.js";import{p as it}from"./download-C8Gw-D0Y.js";import{t as at}from"./tooltip-CkGm8X7m.js";import{t as ot}from"./button-D8gVKwe-.js";import{t as st}from"./createLucideIcon-DfJ2oMlA.js";import{P as ct,a as lt,c as ut,i as dt,n as ft}from"./layout-sYdHI-lW.js";import{d as pt,n as mt}from"./markdown-renderer-pKc_bFac.js";import{v as ht}from"./write-secret-modal-7DzehGyr.js";import{n as gt}from"./spinner-DyNE-o8o.js";import{c as _t,l as vt,s as yt}from"./readonly-python-code-B81AjzXM.js";import{s as bt}from"./MarimoErrorOutput-DlEjLCZ-.js";import{t as xt}from"./use-toast-Wu434mLr.js";import{i as St}from"./strings-C25fhMR_.js";import{t as Ct}from"./requests-lt0JK8Jt.js";import{t as wt}from"./useDebounce-k9QTpQ9-.js";import{n as Tt}from"./useAsyncData-DhhdOGGd.js";import{t as Et}from"./RenderHTML-CfQ6i3QV.js";import{t as Dt}from"./package-data-dv4FBHxR.js";import{f as Ot}from"./useInstallPackage-C7neMPwh.js";import{a as kt}from"./errors-CNsgAw6m.js";import{s as At}from"./react-icons.esm-D6tfmvq8.js";import{r as jt}from"./events-CbeVJ6OD.js";import{i as Mt}from"./cell-link-DFqfW-Ym.js";import{t as Nt}from"./useDelayElapsed-BlsDT4TV.js";import{t as Pt}from"./requests-CgSY1X4a.js";import{r as Ft,s as It,t as Lt}from"./state-Ck7FMD5A.js";import{t as Rt}from"./ws-BXWY541V.js";import{n as zt}from"./runs-6lJxKV1w.js";function K(e){return ge(A,e)}var Bt=st(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),Vt=st(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Ht=st(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),q=e(c(),1),J=ve(),Y=H(),Ut=e=>{let{requires:t,fallback:n,delay:r,children:a}=e,o=n===void 0?null:n,s=r===void 0?0:r,c=i(t),l=Nt(c?0:s);return c?a:l?o:null},Wt=e=>{let t=(0,J.c)(6),{title:n}=e,r=wt(n,300),i=n===r,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(gt,{className:`size-20 animate-spin text-primary`,"data-testid":`large-spinner`,strokeWidth:1}),t[0]=a):a=t[0];let o=i?`opacity-100`:`opacity-0`,s;t[1]===o?s=t[2]:(s=V(`mt-2 text-muted-foreground font-semibold text-lg transition-opacity duration-300`,o),t[1]=o,t[2]=s);let c;return t[3]!==r||t[4]!==s?(c=(0,Y.jsxs)(`div`,{className:`flex flex-col h-full flex-1 items-center justify-center p-4`,children:[a,(0,Y.jsx)(`div`,{className:s,children:r})]}),t[3]=r,t[4]=s,t[5]=c):c=t[5],c};function Gt(e,t){return e===`edit`||e===`home`||e===`gallery`?!0:e===`present`||Ne(Me.includeCode,`false`)||Ne(Me.showCode,`false`)?!1:Ne(Me.showCode,`true`)?!0:t}function Kt(e){let t=Gt(e.mode,e.showAppCode),n=e.hasCells&&e.hasCachedOutputs;return{showCode:t,showCachedOutputs:n,canPaint:e.hasCells&&(t||n||e.allCellsIdle)}}var qt=r(e=>{let t=!1,n=!0;for(let r of Object.values(e(se).cellRuntime))mt(r.output)||(t=!0),r.status!==`idle`&&(n=!1);return{hasCachedOutputs:t,allCellsIdle:n}}),Jt=r(e=>e(qt).hasCachedOutputs),Yt=r(e=>e(qt).allCellsIdle),Xt=r(e=>Kt({mode:e(Pe),showAppCode:e(Ue),hasCells:e(le),hasCachedOutputs:e(Jt),allCellsIdle:e(Yt)})),Zt=r(e=>e(Xt).canPaint),Qt=e=>{let t=(0,J.c)(2),{children:n}=e;if(!Re())return n;let r;return t[0]===n?r=t[1]:(r=(0,Y.jsx)($t,{children:n}),t[0]=n,t[1]=r),r},$t=e=>{let t=(0,J.c)(8),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let{error:a}=Tt(tn,r),o=i(Zt),s=(0,q.useRef)(!1),c,l;if(t[1]!==o||t[2]!==a?(c=()=>{a&&o&&!s.current&&(s.current=!0,F.error(`Pyodide failed to initialize`,a),xt({title:`Failed to start the notebook runtime`,description:kt(a),variant:`danger`}))},l=[a,o],t[1]=o,t[2]=a,t[3]=c,t[4]=l):(c=t[3],l=t[4]),(0,q.useEffect)(c,l),a&&!o)throw a;let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(en,{}),t[5]=u):u=t[5];let d;return t[6]===n?d=t[7]:(d=(0,Y.jsx)(Ut,{requires:Zt,fallback:u,children:n}),t[6]=n,t[7]=d),d},en=()=>{let e=(0,J.c)(2),t=i(Ge),n=t.kind===`loading`?t.message:`Loading…`,r;return e[0]===n?r=e[1]:(r=(0,Y.jsx)(Wt,{title:n}),e[0]=n,e[1]=r),r};async function tn(){return await ke.INSTANCE.initialized.promise,!0}var nn={idle:`./favicon.ico`,success:`data:image/x-icon;base64,AAABAAEAMDAAAAEACACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAAAkAAAAAAAAAAAAAAAEAAAABAAAAAAAAXXQAAFd3AwBWeAQAVngEAFd4AwBXeAQAVnkEAFh3AwBXdwQAVXcGAFd4BQBXeAQAWHgEAFd6AwBXeAMAVnkEAFZ5AwBXdwQAV3cFAFd4BABYeAQAV3gEAFh4BABXeAQA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAH/8AAP/+AAB//wAA//+AAf//AAD///////8AAP///////wAA`};function rn(){let e=document.querySelector(`link[rel~='icon']`);if(e)return e;let t=document.createElement(`link`);return t.rel=`icon`,document.head.append(t),t}function an(e){if(document.visibilityState===`visible`)return;let t=()=>{e===0?new Notification(`Execution completed`,{body:`Your notebook run completed successfully.`,icon:nn.success}):new Notification(`Execution failed`,{body:`Your notebook run encountered ${e} error(s).`,icon:nn.error})};!(`Notification`in window)||Notification.permission===`denied`||(Notification.permission===`granted`?t():Notification.permission==="default"&&Notification.requestPermission().then(e=>{e===`granted`&&t()}))}var on=e=>{let t=(0,J.c)(11),{isRunning:n}=e,r=i(he),a,o;t[0]!==n||t[1]!==r?(a=()=>{let e=rn();if(!n&&e.href.includes(`favicon`)||(e.href=nn[n?`running`:r===0?`success`:`error`],!document.hasFocus()))return;let t=setTimeout(()=>{e.href=nn.idle},3e3);return()=>clearTimeout(t)},o=[n,r],t[0]=n,t[1]=r,t[2]=a,t[3]=o):(a=t[2],o=t[3]),(0,q.useEffect)(a,o);let s=ct(n)??n,c,l;t[4]!==n||t[5]!==r||t[6]!==s?(c=()=>{s&&!n&&an(r)},l=[r,s,n],t[4]=n,t[5]=r,t[6]=s,t[7]=c,t[8]=l):(c=t[7],l=t[8]),(0,q.useEffect)(c,l);let u;return t[9]===n?u=t[10]:(u=()=>{if(!n){let e=rn();e.href=nn.idle}},t[9]=n,t[10]=u),je(window,`focus`,u),null};function sn(){let{cellIds:e,cellRuntime:t}=a.get(se),n=e.inOrderIds.find(e=>t[e]?.status===`running`);n&&Mt(n,`focus`)}var cn=e=>{let t=(0,J.c)(18),{connection:n,isRunning:r,onReconnect:a}=e,{mode:o}=i(Le),s=n.state===R.CLOSED&&(o===`read`||n.code!==z.KERNEL_STARTUP_ERROR),c=n.state===R.OPEN,l=s&&n.code===z.KERNEL_DISCONNECTED,u;t[0]===s?u=t[1]:(u=s&&(0,Y.jsx)(fn,{}),t[0]=s,t[1]=u);let d=o===`read`?`fixed`:`absolute`,f;t[2]===d?f=t[3]:(f=V(`z-50 top-4 left-4`,d),t[2]=d,t[3]=f);let p;t[4]!==c||t[5]!==r?(p=c&&r&&(0,Y.jsx)(dn,{}),t[4]=c,t[5]=r,t[6]=p):p=t[6];let m;t[7]!==l||t[8]!==s||t[9]!==a?(m=s&&(0,Y.jsx)(un,{onReconnect:l?a:void 0}),t[7]=l,t[8]=s,t[9]=a,t[10]=m):m=t[10];let h;t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,Y.jsxs)(`div`,{className:f,children:[p,m]}),t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;return t[15]!==u||t[16]!==h?(g=(0,Y.jsxs)(Y.Fragment,{children:[u,h]}),t[15]=u,t[16]=h,t[17]=g):g=t[17],g},ln=`print:hidden pointer-events-auto hover:cursor-pointer`,un=e=>{let t=(0,J.c)(12),{onReconnect:n}=e,r=!n,i=r?`App disconnected`:`App disconnected — click to reconnect`,a=r?0:-1,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=V(ln,`bg-transparent border-0 p-0`),t[0]=o):o=t[0];let s=r?`App disconnected`:`Reconnect to app`,c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(Ht,{className:`w-[25px] h-[25px] text-(--red-11)`}),t[1]=c):c=t[1];let l;t[2]!==r||t[3]!==n||t[4]!==s?(l=(0,Y.jsx)(`button`,{type:`button`,className:o,"aria-label":s,"data-testid":`disconnected-indicator`,onClick:n,disabled:r,children:c}),t[2]=r,t[3]=n,t[4]=s,t[5]=l):l=t[5];let u;t[6]!==a||t[7]!==l?(u=(0,Y.jsx)(`span`,{tabIndex:a,children:l}),t[6]=a,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==i||t[10]!==u?(d=(0,Y.jsx)(at,{content:i,children:u}),t[9]=i,t[10]=u,t[11]=d):d=t[11],d},dn=()=>{let e=(0,J.c)(6),t=i(ie),n=t?`Scratchpad is running`:`Jump to running cell`,r=t?void 0:sn,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(Bt,{className:`running-app-icon`,size:30,strokeWidth:1}),e[0]=a):a=e[0];let o;e[1]===r?o=e[2]:(o=(0,Y.jsx)(`div`,{className:ln,"data-testid":`loading-indicator`,onClick:r,children:a}),e[1]=r,e[2]=o);let s;return e[3]!==o||e[4]!==n?(s=(0,Y.jsx)(at,{content:n,side:`right`,children:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5],s},fn=()=>{let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`noise`}),(0,Y.jsx)(`div`,{className:`disconnected-gradient`})]}),e[0]=t):t=e[0],t},pn=Ze,mn=Xe,hn=U(et),gn=q.forwardRef((e,t)=>{let n=(0,J.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=V(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(Qe,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});gn.displayName=Qe.displayName;var _n=B(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),vn=q.forwardRef((e,t)=>{let n=(0,J.c)(15),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({side:o,className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`right`:o,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(gn,{}),n[5]=c):c=n[5];let l;n[6]!==i||n[7]!==s?(l=V(_n({side:s}),i),n[6]=i,n[7]=s,n[8]=l):l=n[8];let u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsxs)($e,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,Y.jsx)(At,{className:`h-4 w-4`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),n[9]=u):u=n[9];let d;return n[10]!==r||n[11]!==a||n[12]!==t||n[13]!==l?(d=(0,Y.jsx)(hn,{children:(0,Y.jsxs)(W,{children:[c,(0,Y.jsxs)(Ye,{ref:t,className:l,...a,children:[r,u]})]})}),n[10]=r,n[11]=a,n[12]=t,n[13]=l,n[14]=d):d=n[14],d});vn.displayName=Ye.displayName;var yn=q.forwardRef((e,t)=>{let n=(0,J.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=V(`text-lg font-semibold text-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(G,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});yn.displayName=G.displayName;var bn=q.forwardRef((e,t)=>{let n=(0,J.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=V(`text-sm text-muted-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(Je,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});bn.displayName=Je.displayName;var xn=(0,q.memo)(()=>{let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(nt,{name:rt.SIDEBAR}),e[0]=t):t=e[0],t});xn.displayName=`SidebarSlot`;var Sn=e=>{let t=(0,J.c)(6),{openWidth:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(mn,{className:`lg:hidden`,asChild:!0,children:(0,Y.jsx)(ot,{variant:`ghost`,className:`bg-background`,children:(0,Y.jsx)(Vt,{className:`w-5 h-5`})})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i={maxWidth:n},t[1]=n,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(xn,{}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,Y.jsxs)(pn,{children:[r,(0,Y.jsx)(vn,{className:`w-full px-3 h-full flex flex-col overflow-y-auto`,style:i,side:`left`,children:a})]}),t[4]=i,t[5]=o),o},Cn=e=>{let t=(0,J.c)(7),{isOpen:n,toggle:r}=e,i=n?`rotate-0`:`rotate-180`,a;t[0]===i?a=t[1]:(a=V(`h-5 w-5 transition-transform ease-in-out duration-700`,i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,Y.jsx)(it,{className:a}),t[2]=a,t[3]=o);let s;return t[4]!==o||t[5]!==r?(s=(0,Y.jsx)(`div`,{className:`invisible lg:visible absolute top-[12px] right-[16px] z-20`,children:(0,Y.jsx)(ot,{onClick:r,className:`w-10 h-8`,variant:`ghost`,size:`icon`,children:o})}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},wn=e=>{let t=(0,J.c)(11),{isOpen:n,toggle:r,width:i}=e,a=n?i:P,o;t[0]===a?o=t[1]:(o={width:a},t[0]=a,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=V(`app-sidebar auto-collapse-nav`,`top-0 left-0 z-20 h-full hidden lg:block relative transition-[width] ease-in-out duration-300`),t[2]=s):s=t[2];let c;t[3]!==n||t[4]!==r?(c=(0,Y.jsx)(Cn,{isOpen:n,toggle:r}),t[3]=n,t[4]=r,t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(`div`,{className:`relative h-full flex flex-col px-3 pb-16 pt-14 overflow-y-auto shadow-sm border-l`,children:(0,Y.jsx)(xn,{})}),t[6]=l):l=t[6];let u;return t[7]!==n||t[8]!==o||t[9]!==c?(u=(0,Y.jsxs)(`aside`,{"data-expanded":n,style:o,className:s,children:[c,l]}),t[7]=n,t[8]=o,t[9]=c,t[10]=u):u=t[10],u},Tn=e=>{let n=(0,J.c)(15),{children:r}=e,[i,a]=t(N),{isOpen:o,width:s}=i;if(tt(rt.SIDEBAR).length===0)return r;let c;n[0]===s?c=n[1]:(c=De(s),n[0]=s,n[1]=c);let l=c,u;n[2]!==a||n[3]!==o?(u=()=>a({type:`toggle`,isOpen:!o}),n[2]=a,n[3]=o,n[4]=u):u=n[4];let d;n[5]!==o||n[6]!==l||n[7]!==u?(d=(0,Y.jsx)(wn,{isOpen:o,width:l,toggle:u}),n[5]=o,n[6]=l,n[7]=u,n[8]=d):d=n[8];let f;n[9]===l?f=n[10]:(f=(0,Y.jsx)(`div`,{className:`absolute top-3 left-4 flex items-center z-50`,children:(0,Y.jsx)(Sn,{openWidth:l})}),n[9]=l,n[10]=f);let p;return n[11]!==r||n[12]!==d||n[13]!==f?(p=(0,Y.jsxs)(`div`,{className:`inset-0 absolute flex`,children:[d,f,r]}),n[11]=r,n[12]=d,n[13]=f,n[14]=p):p=n[14],p},En=e=>{let t=(0,J.c)(19),{width:n,connection:r,isRunning:i,children:a,onReconnect:o}=e,s=r.state,c;t[0]===i?c=t[1]:(c=(0,Y.jsx)(on,{isRunning:i}),t[0]=i,t[1]=c);let l;t[2]!==r||t[3]!==i||t[4]!==o?(l=(0,Y.jsx)(cn,{connection:r,isRunning:i,onReconnect:o}),t[2]=r,t[3]=i,t[4]=o,t[5]=l):l=t[5];let u=r.state===R.CLOSED&&r.code!==z.KERNEL_STARTUP_ERROR&&`disconnected`,d=n===`full`&&`config-width-full`,f=n===`columns`?`overflow-x-auto`:`overflow-x-auto sm:overflow-x-hidden`,p;t[6]!==u||t[7]!==d||t[8]!==f?(p=V(`mathjax_ignore`,u,`bg-background w-full h-full text-textColor`,`flex flex-col overflow-y-auto`,d,f,`print:height-fit`),t[6]=u,t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==a||t[11]!==s||t[12]!==p||t[13]!==n?(m=(0,Y.jsx)(Qt,{children:(0,Y.jsx)(Tn,{children:(0,Y.jsx)(`div`,{id:`App`,"data-config-width":n,"data-connection-state":s,className:p,children:a})})}),t[10]=a,t[11]=s,t[12]=p,t[13]=n,t[14]=m):m=t[14];let h;return t[15]!==c||t[16]!==l||t[17]!==m?(h=(0,Y.jsxs)(Y.Fragment,{children:[c,l,m]}),t[15]=c,t[16]=l,t[17]=m,t[18]=h):h=t[18],h},Dn=(0,q.memo)(e=>{let t=(0,J.c)(9),{appConfig:n,mode:r,children:a}=e,{selectedLayout:o}=vt();if(!i(Fe)&&(r===`edit`||r===`present`&&o===`vertical`))return a;let s=r===`read`,c;t[0]!==o||t[1]!==s?(c=yt({selectedLayout:o,isReading:s,searchParams:new URLSearchParams(window.location.search)}),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]===l?u=t[4]:(u=lt.find(e=>e.type===l),t[3]=l,t[4]=u);let d=u;if(!d)return a;let f;return t[5]!==n||t[6]!==r||t[7]!==d?(f=(0,Y.jsx)(On,{appConfig:n,mode:r,plugin:d}),t[5]=n,t[6]=r,t[7]=d,t[8]=f):f=t[8],f});Dn.displayName=`CellsRenderer`;var On=e=>{let t=(0,J.c)(12),{appConfig:n,mode:r,plugin:i}=e,a=vt(),o=g(),{setCurrentLayoutData:s}=_t(),c,l;t[0]!==a||t[1]!==o||t[2]!==i?(c=de(o),l=dt({state:a,plugin:i,cells:c}),t[0]=a,t[1]=o,t[2]=i,t[3]=c,t[4]=l):(c=t[3],l=t[4]);let u=l,d=i.Component,f;return t[5]!==d||t[6]!==n||t[7]!==c||t[8]!==u||t[9]!==r||t[10]!==s?(f=(0,Y.jsx)(d,{appConfig:n,mode:r,cells:c,layout:u,setLayout:s}),t[5]=d,t[6]=n,t[7]=c,t[8]=u,t[9]=r,t[10]=s,t[11]=f):f=t[11],f},kn=class e{hasStarted=!1;static get INSTANCE(){let t=`_marimo_private_RuntimeState`;return window[t]||(window[t]=new e(Oe)),window[t]}_sendComponentValues;uiElementRegistry;constructor(e){this.uiElementRegistry=e}get sendComponentValues(){if(!this._sendComponentValues)throw Error(`sendComponentValues is not set`);return this._sendComponentValues}start(e){if(this.hasStarted){F.warn(`RuntimeState already started`);return}this._sendComponentValues=e,document.addEventListener(jt.TYPE,this.handleReadyEvent),this.hasStarted=!0}stop(){if(!this.hasStarted){F.warn(`RuntimeState already stopped`);return}document.removeEventListener(jt.TYPE,this.handleReadyEvent),this.hasStarted=!1}handleReadyEvent=e=>{let t=e.detail.objectId;if(!this.uiElementRegistry.has(t))return;let n=this.uiElementRegistry.lookupValue(t);n!==void 0&&this.sendComponentValues({objectIds:[t],values:[n]}).catch(e=>{F.warn(e)})}},An=T().min(1).describe(`Identifies a project. Unique within the host and unchanged while the project exists.`),jn=T().min(1).describe(`Identifies a notebook. Unique within the host and unchanged while the notebook exists.`),Mn=T().min(1).describe(`Identifies a runtime. Unique within the host; every start and restart creates a new id.`),Nn=T().min(1).describe(`Identifies an attachment. Unique within the host.`),Pn=T().min(1).describe("Identifies a run independently of the request's `Idempotency-Key`. Events carry the key in `request_id`."),X=T().min(1).describe(`Identifies an execution. Unique within the host.`),Fn=T().min(1).describe(`Identifies a console, display, or variable item. Unique within the host; sending an item again with the same id replaces it.`),Z=T().min(1).describe("Identifies a cell within its notebook. Stable while the host serves the notebook; whether it survives a reload of the store depends on the format. `setup` is the setup cell."),In=E({pid:C().min(1).describe(`The process id.`),started_at:K({offset:!0}).describe(`When the process started.`)}).describe("The process that wrote a record. A client checks that a process\nwith this `pid` that started at `started_at` still exists. If it\ndoes not, the record is stale and may be removed.\n");E({version:_e(1).describe(`The version of this record's format. This document describes version 1.`),process:In,name:T().describe("A label for the host to show people, such as `VS Code` or `marimo`. Two hosts can share a name; the filename is the identity."),url:T().describe("Where the host's API is. The scheme is `http`, and the host part is `127.0.0.1` or `[::1]`, written exactly that way."),token:T().min(1).describe(`The secret a client sends to prove it read the record.`)}).describe(`A host record is the file a host writes so that clients can find
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,d as n,f as r,l as i,r as a,t as o,u as s}from"./useEvent-Dfcbgjhg.js";import{t as c}from"./react-DVplv7_D.js";import{$ as l,B as u,D as d,Dt as f,Et as p,Gn as m,Hr as h,I as g,Ii as ee,Jn as _,Kn as v,Mr as y,Oo as b,Ot as te,R as x,So as ne,St as re,T as ie,Vi as ae,Wn as oe,b as se,ei as ce,g as le,h as ue,l as de,mr as fe,pr as pe,qn as me,r as he}from"./cells-T9_Y4Jlv.js";import{C as S,E as C,F as w,I as T,K as ge,N as E,O as _e,R as D,S as O,b as k,c as A,v as j,z as M}from"./schemas-ChRqMOTL.js";import{t as ve}from"./compiler-runtime-BrajqUja.js";import{D as ye,d as be,w as xe}from"./config-DGX7JYor.js";import{_ as Se,c as Ce,g as we,i as Te,m as Ee,n as De,o as Oe,p as ke,r as N,s as Ae,t as P}from"./state-BRYi026f.js";import{g as F,t as je}from"./useEventListener-CjDeLqFC.js";import{t as I}from"./objects-rLPlQ3X_.js";import{i as Me}from"./utils-B4K466FK.js";import{a as Ne,f as Pe,m as Fe,r as Ie,v as Le}from"./session-B8Y-GJnS.js";import{E as L,N as Re,T as R,_ as ze,l as Be,o as Ve,w as z,x as He}from"./config-DzdxZb17.js";import{r as Ue}from"./state-C0irhlOZ.js";import{i as We,o as Ge,r as Ke}from"./state-DaWgt-rn.js";import{r as qe}from"./ErrorBoundary-DJhsFCsX.js";import{n as B,t as V}from"./cn-ldLVeaqm.js";import{t as H}from"./jsx-runtime-B74pBk57.js";import{i as U,s as W}from"./fullscreen-BWTs8pYZ.js";import{a as Je,c as G,i as Ye,l as Xe,n as Ze,o as Qe,r as $e,s as et}from"./use-restore-focus-DdS7Tl0F.js";import{Dt as tt,Et as nt,xt as rt}from"./JsonOutput-Pm6OCP3J.js";import{p as it}from"./download-C8Gw-D0Y.js";import{t as at}from"./tooltip-CkGm8X7m.js";import{t as ot}from"./button-D8gVKwe-.js";import{t as st}from"./createLucideIcon-DfJ2oMlA.js";import{P as ct,a as lt,c as ut,i as dt,n as ft}from"./layout-CGC8ajpe.js";import{d as pt,n as mt}from"./markdown-renderer-pKc_bFac.js";import{v as ht}from"./write-secret-modal-7DzehGyr.js";import{n as gt}from"./spinner-DyNE-o8o.js";import{c as _t,l as vt,s as yt}from"./readonly-python-code-B81AjzXM.js";import{s as bt}from"./MarimoErrorOutput-DlEjLCZ-.js";import{t as xt}from"./use-toast-Wu434mLr.js";import{i as St}from"./strings-C25fhMR_.js";import{t as Ct}from"./requests-lt0JK8Jt.js";import{t as wt}from"./useDebounce-k9QTpQ9-.js";import{n as Tt}from"./useAsyncData-DhhdOGGd.js";import{t as Et}from"./RenderHTML-CfQ6i3QV.js";import{t as Dt}from"./package-data-dv4FBHxR.js";import{f as Ot}from"./useInstallPackage-C7neMPwh.js";import{a as kt}from"./errors-CNsgAw6m.js";import{s as At}from"./react-icons.esm-D6tfmvq8.js";import{r as jt}from"./events-CbeVJ6OD.js";import{i as Mt}from"./cell-link-DFqfW-Ym.js";import{t as Nt}from"./useDelayElapsed-BlsDT4TV.js";import{t as Pt}from"./requests-CgSY1X4a.js";import{r as Ft,s as It,t as Lt}from"./state-Ck7FMD5A.js";import{t as Rt}from"./ws-BXWY541V.js";import{n as zt}from"./runs-6lJxKV1w.js";function K(e){return ge(A,e)}var Bt=st(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),Vt=st(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Ht=st(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),q=e(c(),1),J=ve(),Y=H(),Ut=e=>{let{requires:t,fallback:n,delay:r,children:a}=e,o=n===void 0?null:n,s=r===void 0?0:r,c=i(t),l=Nt(c?0:s);return c?a:l?o:null},Wt=e=>{let t=(0,J.c)(6),{title:n}=e,r=wt(n,300),i=n===r,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(gt,{className:`size-20 animate-spin text-primary`,"data-testid":`large-spinner`,strokeWidth:1}),t[0]=a):a=t[0];let o=i?`opacity-100`:`opacity-0`,s;t[1]===o?s=t[2]:(s=V(`mt-2 text-muted-foreground font-semibold text-lg transition-opacity duration-300`,o),t[1]=o,t[2]=s);let c;return t[3]!==r||t[4]!==s?(c=(0,Y.jsxs)(`div`,{className:`flex flex-col h-full flex-1 items-center justify-center p-4`,children:[a,(0,Y.jsx)(`div`,{className:s,children:r})]}),t[3]=r,t[4]=s,t[5]=c):c=t[5],c};function Gt(e,t){return e===`edit`||e===`home`||e===`gallery`?!0:e===`present`||Ne(Me.includeCode,`false`)||Ne(Me.showCode,`false`)?!1:Ne(Me.showCode,`true`)?!0:t}function Kt(e){let t=Gt(e.mode,e.showAppCode),n=e.hasCells&&e.hasCachedOutputs;return{showCode:t,showCachedOutputs:n,canPaint:e.hasCells&&(t||n||e.allCellsIdle)}}var qt=r(e=>{let t=!1,n=!0;for(let r of Object.values(e(se).cellRuntime))mt(r.output)||(t=!0),r.status!==`idle`&&(n=!1);return{hasCachedOutputs:t,allCellsIdle:n}}),Jt=r(e=>e(qt).hasCachedOutputs),Yt=r(e=>e(qt).allCellsIdle),Xt=r(e=>Kt({mode:e(Pe),showAppCode:e(Ue),hasCells:e(le),hasCachedOutputs:e(Jt),allCellsIdle:e(Yt)})),Zt=r(e=>e(Xt).canPaint),Qt=e=>{let t=(0,J.c)(2),{children:n}=e;if(!Re())return n;let r;return t[0]===n?r=t[1]:(r=(0,Y.jsx)($t,{children:n}),t[0]=n,t[1]=r),r},$t=e=>{let t=(0,J.c)(8),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let{error:a}=Tt(tn,r),o=i(Zt),s=(0,q.useRef)(!1),c,l;if(t[1]!==o||t[2]!==a?(c=()=>{a&&o&&!s.current&&(s.current=!0,F.error(`Pyodide failed to initialize`,a),xt({title:`Failed to start the notebook runtime`,description:kt(a),variant:`danger`}))},l=[a,o],t[1]=o,t[2]=a,t[3]=c,t[4]=l):(c=t[3],l=t[4]),(0,q.useEffect)(c,l),a&&!o)throw a;let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(en,{}),t[5]=u):u=t[5];let d;return t[6]===n?d=t[7]:(d=(0,Y.jsx)(Ut,{requires:Zt,fallback:u,children:n}),t[6]=n,t[7]=d),d},en=()=>{let e=(0,J.c)(2),t=i(Ge),n=t.kind===`loading`?t.message:`Loading…`,r;return e[0]===n?r=e[1]:(r=(0,Y.jsx)(Wt,{title:n}),e[0]=n,e[1]=r),r};async function tn(){return await ke.INSTANCE.initialized.promise,!0}var nn={idle:`./favicon.ico`,success:`data:image/x-icon;base64,AAABAAEAMDAAAAEACACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAAAkAAAAAAAAAAAAAAAEAAAABAAAAAAAAXXQAAFd3AwBWeAQAVngEAFd4AwBXeAQAVnkEAFh3AwBXdwQAVXcGAFd4BQBXeAQAWHgEAFd6AwBXeAMAVnkEAFZ5AwBXdwQAV3cFAFd4BABYeAQAV3gEAFh4BABXeAQA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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`};function rn(){let e=document.querySelector(`link[rel~='icon']`);if(e)return e;let t=document.createElement(`link`);return t.rel=`icon`,document.head.append(t),t}function an(e){if(document.visibilityState===`visible`)return;let t=()=>{e===0?new Notification(`Execution completed`,{body:`Your notebook run completed successfully.`,icon:nn.success}):new Notification(`Execution failed`,{body:`Your notebook run encountered ${e} error(s).`,icon:nn.error})};!(`Notification`in window)||Notification.permission===`denied`||(Notification.permission===`granted`?t():Notification.permission==="default"&&Notification.requestPermission().then(e=>{e===`granted`&&t()}))}var on=e=>{let t=(0,J.c)(11),{isRunning:n}=e,r=i(he),a,o;t[0]!==n||t[1]!==r?(a=()=>{let e=rn();if(!n&&e.href.includes(`favicon`)||(e.href=nn[n?`running`:r===0?`success`:`error`],!document.hasFocus()))return;let t=setTimeout(()=>{e.href=nn.idle},3e3);return()=>clearTimeout(t)},o=[n,r],t[0]=n,t[1]=r,t[2]=a,t[3]=o):(a=t[2],o=t[3]),(0,q.useEffect)(a,o);let s=ct(n)??n,c,l;t[4]!==n||t[5]!==r||t[6]!==s?(c=()=>{s&&!n&&an(r)},l=[r,s,n],t[4]=n,t[5]=r,t[6]=s,t[7]=c,t[8]=l):(c=t[7],l=t[8]),(0,q.useEffect)(c,l);let u;return t[9]===n?u=t[10]:(u=()=>{if(!n){let e=rn();e.href=nn.idle}},t[9]=n,t[10]=u),je(window,`focus`,u),null};function sn(){let{cellIds:e,cellRuntime:t}=a.get(se),n=e.inOrderIds.find(e=>t[e]?.status===`running`);n&&Mt(n,`focus`)}var cn=e=>{let t=(0,J.c)(18),{connection:n,isRunning:r,onReconnect:a}=e,{mode:o}=i(Le),s=n.state===R.CLOSED&&(o===`read`||n.code!==z.KERNEL_STARTUP_ERROR),c=n.state===R.OPEN,l=s&&n.code===z.KERNEL_DISCONNECTED,u;t[0]===s?u=t[1]:(u=s&&(0,Y.jsx)(fn,{}),t[0]=s,t[1]=u);let d=o===`read`?`fixed`:`absolute`,f;t[2]===d?f=t[3]:(f=V(`z-50 top-4 left-4`,d),t[2]=d,t[3]=f);let p;t[4]!==c||t[5]!==r?(p=c&&r&&(0,Y.jsx)(dn,{}),t[4]=c,t[5]=r,t[6]=p):p=t[6];let m;t[7]!==l||t[8]!==s||t[9]!==a?(m=s&&(0,Y.jsx)(un,{onReconnect:l?a:void 0}),t[7]=l,t[8]=s,t[9]=a,t[10]=m):m=t[10];let h;t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,Y.jsxs)(`div`,{className:f,children:[p,m]}),t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;return t[15]!==u||t[16]!==h?(g=(0,Y.jsxs)(Y.Fragment,{children:[u,h]}),t[15]=u,t[16]=h,t[17]=g):g=t[17],g},ln=`print:hidden pointer-events-auto hover:cursor-pointer`,un=e=>{let t=(0,J.c)(12),{onReconnect:n}=e,r=!n,i=r?`App disconnected`:`App disconnected — click to reconnect`,a=r?0:-1,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=V(ln,`bg-transparent border-0 p-0`),t[0]=o):o=t[0];let s=r?`App disconnected`:`Reconnect to app`,c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(Ht,{className:`w-[25px] h-[25px] text-(--red-11)`}),t[1]=c):c=t[1];let l;t[2]!==r||t[3]!==n||t[4]!==s?(l=(0,Y.jsx)(`button`,{type:`button`,className:o,"aria-label":s,"data-testid":`disconnected-indicator`,onClick:n,disabled:r,children:c}),t[2]=r,t[3]=n,t[4]=s,t[5]=l):l=t[5];let u;t[6]!==a||t[7]!==l?(u=(0,Y.jsx)(`span`,{tabIndex:a,children:l}),t[6]=a,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==i||t[10]!==u?(d=(0,Y.jsx)(at,{content:i,children:u}),t[9]=i,t[10]=u,t[11]=d):d=t[11],d},dn=()=>{let e=(0,J.c)(6),t=i(ie),n=t?`Scratchpad is running`:`Jump to running cell`,r=t?void 0:sn,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(Bt,{className:`running-app-icon`,size:30,strokeWidth:1}),e[0]=a):a=e[0];let o;e[1]===r?o=e[2]:(o=(0,Y.jsx)(`div`,{className:ln,"data-testid":`loading-indicator`,onClick:r,children:a}),e[1]=r,e[2]=o);let s;return e[3]!==o||e[4]!==n?(s=(0,Y.jsx)(at,{content:n,side:`right`,children:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5],s},fn=()=>{let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`noise`}),(0,Y.jsx)(`div`,{className:`disconnected-gradient`})]}),e[0]=t):t=e[0],t},pn=Ze,mn=Xe,hn=U(et),gn=q.forwardRef((e,t)=>{let n=(0,J.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=V(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(Qe,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});gn.displayName=Qe.displayName;var _n=B(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),vn=q.forwardRef((e,t)=>{let n=(0,J.c)(15),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({side:o,className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`right`:o,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(gn,{}),n[5]=c):c=n[5];let l;n[6]!==i||n[7]!==s?(l=V(_n({side:s}),i),n[6]=i,n[7]=s,n[8]=l):l=n[8];let u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsxs)($e,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,Y.jsx)(At,{className:`h-4 w-4`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),n[9]=u):u=n[9];let d;return n[10]!==r||n[11]!==a||n[12]!==t||n[13]!==l?(d=(0,Y.jsx)(hn,{children:(0,Y.jsxs)(W,{children:[c,(0,Y.jsxs)(Ye,{ref:t,className:l,...a,children:[r,u]})]})}),n[10]=r,n[11]=a,n[12]=t,n[13]=l,n[14]=d):d=n[14],d});vn.displayName=Ye.displayName;var yn=q.forwardRef((e,t)=>{let n=(0,J.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=V(`text-lg font-semibold text-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(G,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});yn.displayName=G.displayName;var bn=q.forwardRef((e,t)=>{let n=(0,J.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=V(`text-sm text-muted-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Y.jsx)(Je,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});bn.displayName=Je.displayName;var xn=(0,q.memo)(()=>{let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(nt,{name:rt.SIDEBAR}),e[0]=t):t=e[0],t});xn.displayName=`SidebarSlot`;var Sn=e=>{let t=(0,J.c)(6),{openWidth:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(mn,{className:`lg:hidden`,asChild:!0,children:(0,Y.jsx)(ot,{variant:`ghost`,className:`bg-background`,children:(0,Y.jsx)(Vt,{className:`w-5 h-5`})})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i={maxWidth:n},t[1]=n,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(xn,{}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,Y.jsxs)(pn,{children:[r,(0,Y.jsx)(vn,{className:`w-full px-3 h-full flex flex-col overflow-y-auto`,style:i,side:`left`,children:a})]}),t[4]=i,t[5]=o),o},Cn=e=>{let t=(0,J.c)(7),{isOpen:n,toggle:r}=e,i=n?`rotate-0`:`rotate-180`,a;t[0]===i?a=t[1]:(a=V(`h-5 w-5 transition-transform ease-in-out duration-700`,i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,Y.jsx)(it,{className:a}),t[2]=a,t[3]=o);let s;return t[4]!==o||t[5]!==r?(s=(0,Y.jsx)(`div`,{className:`invisible lg:visible absolute top-[12px] right-[16px] z-20`,children:(0,Y.jsx)(ot,{onClick:r,className:`w-10 h-8`,variant:`ghost`,size:`icon`,children:o})}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},wn=e=>{let t=(0,J.c)(11),{isOpen:n,toggle:r,width:i}=e,a=n?i:P,o;t[0]===a?o=t[1]:(o={width:a},t[0]=a,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=V(`app-sidebar auto-collapse-nav`,`top-0 left-0 z-20 h-full hidden lg:block relative transition-[width] ease-in-out duration-300`),t[2]=s):s=t[2];let c;t[3]!==n||t[4]!==r?(c=(0,Y.jsx)(Cn,{isOpen:n,toggle:r}),t[3]=n,t[4]=r,t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(`div`,{className:`relative h-full flex flex-col px-3 pb-16 pt-14 overflow-y-auto shadow-sm border-l`,children:(0,Y.jsx)(xn,{})}),t[6]=l):l=t[6];let u;return t[7]!==n||t[8]!==o||t[9]!==c?(u=(0,Y.jsxs)(`aside`,{"data-expanded":n,style:o,className:s,children:[c,l]}),t[7]=n,t[8]=o,t[9]=c,t[10]=u):u=t[10],u},Tn=e=>{let n=(0,J.c)(15),{children:r}=e,[i,a]=t(N),{isOpen:o,width:s}=i;if(tt(rt.SIDEBAR).length===0)return r;let c;n[0]===s?c=n[1]:(c=De(s),n[0]=s,n[1]=c);let l=c,u;n[2]!==a||n[3]!==o?(u=()=>a({type:`toggle`,isOpen:!o}),n[2]=a,n[3]=o,n[4]=u):u=n[4];let d;n[5]!==o||n[6]!==l||n[7]!==u?(d=(0,Y.jsx)(wn,{isOpen:o,width:l,toggle:u}),n[5]=o,n[6]=l,n[7]=u,n[8]=d):d=n[8];let f;n[9]===l?f=n[10]:(f=(0,Y.jsx)(`div`,{className:`absolute top-3 left-4 flex items-center z-50`,children:(0,Y.jsx)(Sn,{openWidth:l})}),n[9]=l,n[10]=f);let p;return n[11]!==r||n[12]!==d||n[13]!==f?(p=(0,Y.jsxs)(`div`,{className:`inset-0 absolute flex`,children:[d,f,r]}),n[11]=r,n[12]=d,n[13]=f,n[14]=p):p=n[14],p},En=e=>{let t=(0,J.c)(19),{width:n,connection:r,isRunning:i,children:a,onReconnect:o}=e,s=r.state,c;t[0]===i?c=t[1]:(c=(0,Y.jsx)(on,{isRunning:i}),t[0]=i,t[1]=c);let l;t[2]!==r||t[3]!==i||t[4]!==o?(l=(0,Y.jsx)(cn,{connection:r,isRunning:i,onReconnect:o}),t[2]=r,t[3]=i,t[4]=o,t[5]=l):l=t[5];let u=r.state===R.CLOSED&&r.code!==z.KERNEL_STARTUP_ERROR&&`disconnected`,d=n===`full`&&`config-width-full`,f=n===`columns`?`overflow-x-auto`:`overflow-x-auto sm:overflow-x-hidden`,p;t[6]!==u||t[7]!==d||t[8]!==f?(p=V(`mathjax_ignore`,u,`bg-background w-full h-full text-textColor`,`flex flex-col overflow-y-auto`,d,f,`print:height-fit`),t[6]=u,t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==a||t[11]!==s||t[12]!==p||t[13]!==n?(m=(0,Y.jsx)(Qt,{children:(0,Y.jsx)(Tn,{children:(0,Y.jsx)(`div`,{id:`App`,"data-config-width":n,"data-connection-state":s,className:p,children:a})})}),t[10]=a,t[11]=s,t[12]=p,t[13]=n,t[14]=m):m=t[14];let h;return t[15]!==c||t[16]!==l||t[17]!==m?(h=(0,Y.jsxs)(Y.Fragment,{children:[c,l,m]}),t[15]=c,t[16]=l,t[17]=m,t[18]=h):h=t[18],h},Dn=(0,q.memo)(e=>{let t=(0,J.c)(9),{appConfig:n,mode:r,children:a}=e,{selectedLayout:o}=vt();if(!i(Fe)&&(r===`edit`||r===`present`&&o===`vertical`))return a;let s=r===`read`,c;t[0]!==o||t[1]!==s?(c=yt({selectedLayout:o,isReading:s,searchParams:new URLSearchParams(window.location.search)}),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]===l?u=t[4]:(u=lt.find(e=>e.type===l),t[3]=l,t[4]=u);let d=u;if(!d)return a;let f;return t[5]!==n||t[6]!==r||t[7]!==d?(f=(0,Y.jsx)(On,{appConfig:n,mode:r,plugin:d}),t[5]=n,t[6]=r,t[7]=d,t[8]=f):f=t[8],f});Dn.displayName=`CellsRenderer`;var On=e=>{let t=(0,J.c)(12),{appConfig:n,mode:r,plugin:i}=e,a=vt(),o=g(),{setCurrentLayoutData:s}=_t(),c,l;t[0]!==a||t[1]!==o||t[2]!==i?(c=de(o),l=dt({state:a,plugin:i,cells:c}),t[0]=a,t[1]=o,t[2]=i,t[3]=c,t[4]=l):(c=t[3],l=t[4]);let u=l,d=i.Component,f;return t[5]!==d||t[6]!==n||t[7]!==c||t[8]!==u||t[9]!==r||t[10]!==s?(f=(0,Y.jsx)(d,{appConfig:n,mode:r,cells:c,layout:u,setLayout:s}),t[5]=d,t[6]=n,t[7]=c,t[8]=u,t[9]=r,t[10]=s,t[11]=f):f=t[11],f},kn=class e{hasStarted=!1;static get INSTANCE(){let t=`_marimo_private_RuntimeState`;return window[t]||(window[t]=new e(Oe)),window[t]}_sendComponentValues;uiElementRegistry;constructor(e){this.uiElementRegistry=e}get sendComponentValues(){if(!this._sendComponentValues)throw Error(`sendComponentValues is not set`);return this._sendComponentValues}start(e){if(this.hasStarted){F.warn(`RuntimeState already started`);return}this._sendComponentValues=e,document.addEventListener(jt.TYPE,this.handleReadyEvent),this.hasStarted=!0}stop(){if(!this.hasStarted){F.warn(`RuntimeState already stopped`);return}document.removeEventListener(jt.TYPE,this.handleReadyEvent),this.hasStarted=!1}handleReadyEvent=e=>{let t=e.detail.objectId;if(!this.uiElementRegistry.has(t))return;let n=this.uiElementRegistry.lookupValue(t);n!==void 0&&this.sendComponentValues({objectIds:[t],values:[n]}).catch(e=>{F.warn(e)})}},An=T().min(1).describe(`Identifies a project. Unique within the host and unchanged while the project exists.`),jn=T().min(1).describe(`Identifies a notebook. Unique within the host and unchanged while the notebook exists.`),Mn=T().min(1).describe(`Identifies a runtime. Unique within the host; every start and restart creates a new id.`),Nn=T().min(1).describe(`Identifies an attachment. Unique within the host.`),Pn=T().min(1).describe("Identifies a run independently of the request's `Idempotency-Key`. Events carry the key in `request_id`."),X=T().min(1).describe(`Identifies an execution. Unique within the host.`),Fn=T().min(1).describe(`Identifies a console, display, or variable item. Unique within the host; sending an item again with the same id replaces it.`),Z=T().min(1).describe("Identifies a cell within its notebook. Stable while the host serves the notebook; whether it survives a reload of the store depends on the format. `setup` is the setup cell."),In=E({pid:C().min(1).describe(`The process id.`),started_at:K({offset:!0}).describe(`When the process started.`)}).describe("The process that wrote a record. A client checks that a process\nwith this `pid` that started at `started_at` still exists. If it\ndoes not, the record is stale and may be removed.\n");E({version:_e(1).describe(`The version of this record's format. This document describes version 1.`),process:In,name:T().describe("A label for the host to show people, such as `VS Code` or `marimo`. Two hosts can share a name; the filename is the identity."),url:T().describe("Where the host's API is. The scheme is `http`, and the host part is `127.0.0.1` or `[::1]`, written exactly that way."),token:T().min(1).describe(`The secret a client sends to prove it read the record.`)}).describe(`A host record is the file a host writes so that clients can find
2
2
  it. A host writes \`<marimo-state-dir>/hosts-v1/<id>.json\` once its API
3
3
  is serving at \`url\`, where \`<id>\` is an identifier the host makes
4
4
  up each time it starts. The record does not change while the host
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t,t as n}from"./useEvent-Dfcbgjhg.js";import{t as r}from"./react-DVplv7_D.js";import{Bt as i,D as a,na as o,oa as s,rt as c,ta as l}from"./cells-T9_Y4Jlv.js";import{t as u}from"./compiler-runtime-BrajqUja.js";import{T as d,s as f}from"./config-DGX7JYor.js";import{g as p,t as m}from"./useEventListener-CjDeLqFC.js";import{t as h}from"./utils-B4K466FK.js";import{m as g}from"./session-B8Y-GJnS.js";import{_}from"./config-DzdxZb17.js";import{r as v}from"./state-DaWgt-rn.js";import{t as y}from"./cn-ldLVeaqm.js";import{t as b}from"./jsx-runtime-B74pBk57.js";import{n as x}from"./fullscreen-BWTs8pYZ.js";import{Pt as S}from"./JsonOutput-Pm6OCP3J.js";import{t as C}from"./tooltip-CkGm8X7m.js";import{r as ee,t as w}from"./button-D8gVKwe-.js";import{t as T}from"./createLucideIcon-DfJ2oMlA.js";import{_ as E,d as D,f as O,g as k,s as A,u as te}from"./layout-sYdHI-lW.js";import{a as j}from"./useNumberFormatter-D7O_26UI.js";import{t as ne}from"./code-BEiQP4pS.js";import{t as M}from"./eye-off-CxVozGAC.js";import{n as N,t as re}from"./cell-editor-3cVIcyHK.js";import{n as ie,t as P}from"./RunButton-DvuvkgrG.js";import{t as ae}from"./readonly-python-code-B81AjzXM.js";import{r as oe}from"./useTheme-DLtPc-39.js";import{r as se}from"./useDebounce-k9QTpQ9-.js";import{t as ce}from"./CellStatus-cD3S0wEA.js";import{i as le}from"./useRunCells-BFeZMi7f.js";import{n as ue,r as de,t as fe}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{n as pe,t as me}from"./code-visibility-CV3S4xuf.js";import{t as he}from"./readonly-code-display-Dsp6vWPh.js";/* empty css */var ge=T(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),F=e(r(),1),_e=u(),I=(e,t)=>{for(let n in t)e[n]=t[n];return e},L=(e,t)=>Array.from(e.querySelectorAll(t)),ve=(e,t,n)=>{n?e.classList.add(t):e.classList.remove(t)},R=e=>{if(typeof e==`string`){if(e===`null`)return null;if(e===`true`)return!0;if(e===`false`)return!1;if(e.match(/^-?[\d\.]+$/))return parseFloat(e)}return e},z=(e,t)=>{e.style.transform=t},B=(e,t)=>{let n=e.matches||e.matchesSelector||e.msMatchesSelector;return!!(n&&n.call(e,t))},V=(e,t)=>{if(e&&typeof e.closest==`function`)return e.closest(t);for(;e;){if(B(e,t))return e;e=e.parentElement}return null},H=e=>{e||=document.documentElement;let t=e.requestFullscreen||e.webkitRequestFullscreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t&&t.apply(e)},ye=(e,t,n,r=``)=>{let i=e.querySelectorAll(`.`+n);for(let t=0;t<i.length;t++){let n=i[t];if(n.parentNode===e)return n}let a=document.createElement(t);return a.className=n,a.innerHTML=r,e.appendChild(a),a},be=e=>{let t=document.createElement(`style`);return e&&e.length>0&&t.appendChild(document.createTextNode(e)),document.head.appendChild(t),t},xe=()=>{let e={};location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,t=>{let n=t.split(`=`).shift(),r=t.split(`=`).pop();return n&&r!==void 0&&(e[n]=r),t});for(let t in e){let n=e[t];e[t]=R(unescape(n))}return e.dependencies!==void 0&&delete e.dependencies,e},Se=(e,t=0)=>{if(e){let n,r=e.style.height;return e.style.height=`0px`,e.parentElement&&(e.parentElement.style.height=`auto`),n=t-(e.parentElement?.offsetHeight||0),e.style.height=r+`px`,e.parentElement&&e.parentElement.style.removeProperty(`height`),n}return t},U={mp4:`video/mp4`,m4a:`video/mp4`,ogv:`video/ogg`,mpeg:`video/mpeg`,webm:`video/webm`},W=(e=``)=>{let t=e.split(`.`).pop();return t?U[t]:void 0},Ce=(e=``)=>encodeURI(e).replace(/%5B/g,`[`).replace(/%5D/g,`]`).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),G=navigator.userAgent,we=/(iphone|ipod|ipad|android)/gi.test(G)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1;/chrome/i.test(G)&&/edge/i.test(G);var Te=/android/gi.test(G),Ee=function(e){if(e){var t=function(e){return[].slice.call(e)},n=0,r=1,i=2,a=3,o=[],s=null,c=`requestAnimationFrame`in e?function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{sync:!1};e.cancelAnimationFrame(s);var n=function(){return u(o.filter((function(e){return e.dirty&&e.active})))};if(t.sync)return n();s=e.requestAnimationFrame(n)}:function(){},l=function(e){return function(t){o.forEach((function(t){return t.dirty=e})),c(t)}},u=function(e){e.filter((function(e){return!e.styleComputed})).forEach((function(e){e.styleComputed=m(e)})),e.filter(h).forEach(g);var t=e.filter(p);t.forEach(f),t.forEach((function(e){g(e),d(e)})),t.forEach(_)},d=function(e){return e.dirty=n},f=function(e){e.availableWidth=e.element.parentNode.clientWidth,e.currentWidth=e.element.scrollWidth,e.previousFontSize=e.currentFontSize,e.currentFontSize=Math.min(Math.max(e.minSize,e.availableWidth/e.currentWidth*e.previousFontSize),e.maxSize),e.whiteSpace=e.multiLine&&e.currentFontSize===e.minSize?`normal`:`nowrap`},p=function(e){return e.dirty!==i||e.dirty===i&&e.element.parentNode.clientWidth!==e.availableWidth},m=function(t){var n=e.getComputedStyle(t.element,null);return t.currentFontSize=parseFloat(n.getPropertyValue(`font-size`)),t.display=n.getPropertyValue(`display`),t.whiteSpace=n.getPropertyValue(`white-space`),!0},h=function(e){var t=!1;return!e.preStyleTestCompleted&&(/inline-/.test(e.display)||(t=!0,e.display=`inline-block`),e.whiteSpace!==`nowrap`&&(t=!0,e.whiteSpace=`nowrap`),e.preStyleTestCompleted=!0,t)},g=function(e){e.element.style.whiteSpace=e.whiteSpace,e.element.style.display=e.display,e.element.style.fontSize=e.currentFontSize+`px`},_=function(e){e.element.dispatchEvent(new CustomEvent(`fit`,{detail:{oldValue:e.previousFontSize,newValue:e.currentFontSize,scaleFactor:e.currentFontSize/e.previousFontSize}}))},v=function(e,t){return function(n){e.dirty=t,e.active&&c(n)}},y=function(e){return function(){o=o.filter((function(t){return t.element!==e.element})),e.observeMutations&&e.observer.disconnect(),e.element.style.whiteSpace=e.originalStyle.whiteSpace,e.element.style.display=e.originalStyle.display,e.element.style.fontSize=e.originalStyle.fontSize}},b=function(e){return function(){e.active||(e.active=!0,c())}},x=function(e){return function(){return e.active=!1}},S=function(e){e.observeMutations&&(e.observer=new MutationObserver(v(e,r)),e.observer.observe(e.element,e.observeMutations))},C={minSize:16,maxSize:512,multiLine:!0,observeMutations:`MutationObserver`in e&&{subtree:!0,childList:!0,characterData:!0}},ee=null,w=function(){e.clearTimeout(ee),ee=e.setTimeout(l(i),D.observeWindowDelay)},T=[`resize`,`orientationchange`];return Object.defineProperty(D,"observeWindow",{set:function(t){var n=`${t?`add`:`remove`}EventListener`;T.forEach((function(t){e[n](t,w)}))}}),D.observeWindow=!0,D.observeWindowDelay=100,D.fitAll=l(a),D}function E(e,t){var n=Object.assign({},C,t),r=e.map((function(e){var t=Object.assign({},n,{element:e,active:!0});return function(e){e.originalStyle={whiteSpace:e.element.style.whiteSpace,display:e.element.style.display,fontSize:e.element.style.fontSize},S(e),e.newbie=!0,e.dirty=!0,o.push(e)}(t),{element:e,fit:v(t,a),unfreeze:b(t),freeze:x(t),unsubscribe:y(t)}}));return c(),r}function D(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof e==`string`?E(t(document.querySelectorAll(e)),n):E([e],n)[0]}}(typeof window>`u`?null:window);function De(e){"@babel/helpers - typeof";return De=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},De(e)}function Oe(e,t){if(De(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(De(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ke(e){var t=Oe(e,`string`);return De(t)==`symbol`?t:t+``}function Ae(e,t,n){return(t=ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var je=class{constructor(e){Ae(this,`allowedToPlayAudio`,null),this.Reveal=e,this.startEmbeddedMedia=this.startEmbeddedMedia.bind(this),this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this),this.preventIframeAutoFocus=this.preventIframeAutoFocus.bind(this),this.ensureMobileMediaPlaying=this.ensureMobileMediaPlaying.bind(this),this.failedAudioPlaybackTargets=new Set,this.failedVideoPlaybackTargets=new Set,this.failedMutedVideoPlaybackTargets=new Set,this.renderMediaPlayButton()}renderMediaPlayButton(){this.mediaPlayButton=document.createElement(`button`),this.mediaPlayButton.className=`r-overlay-button r-media-play-button`,this.mediaPlayButton.addEventListener(`click`,()=>{this.resetTemporarilyMutedMedia(),new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(e=>{this.startEmbeddedMedia({target:e})}),this.clearMediaPlaybackErrors()})}shouldPreload(e){if(this.Reveal.isScrollView())return!0;let t=this.Reveal.getConfig().preloadIframes;return typeof t!=`boolean`&&(t=e.hasAttribute(`data-preload`)),t}load(e,t={}){let n=this.Reveal.getConfig().display;if(n.includes(`!important`)){let t=n.replace(/\s*!important\s*$/,``).trim();e.style.setProperty(`display`,t,`important`)}else e.style.display=n;L(e,`img[data-src], video[data-src], audio[data-src], iframe[data-src]`).forEach(e=>{let t=e.tagName===`IFRAME`;(!t||this.shouldPreload(e))&&(e.setAttribute(`src`,e.getAttribute(`data-src`)),e.setAttribute(`data-lazy-loaded`,``),e.removeAttribute(`data-src`),t&&e.addEventListener(`load`,this.preventIframeAutoFocus))}),L(e,`video, audio`).forEach(e=>{let t=0;L(e,`source[data-src]`).forEach(e=>{e.setAttribute(`src`,e.getAttribute(`data-src`)),e.removeAttribute(`data-src`),e.setAttribute(`data-lazy-loaded`,``),t+=1}),we&&e.tagName===`VIDEO`&&e.setAttribute(`playsinline`,``),t>0&&e.load()});let r=e.slideBackgroundElement;if(r){r.style.display=`block`;let n=e.slideBackgroundContentElement,i=e.getAttribute(`data-background-iframe`);if(r.hasAttribute(`data-loaded`)===!1){r.setAttribute(`data-loaded`,`true`);let a=e.getAttribute(`data-background-image`),o=e.getAttribute(`data-background-video`),s=e.hasAttribute(`data-background-video-loop`),c=e.hasAttribute(`data-background-video-muted`);if(a)/^data:/.test(a.trim())?n.style.backgroundImage=`url(${a.trim()})`:n.style.backgroundImage=a.split(`,`).map(e=>`url(${Ce(decodeURI(e.trim()))})`).join(`,`);else if(o){let e=document.createElement(`video`);s&&e.setAttribute(`loop`,``),(c||this.Reveal.isSpeakerNotes())&&(e.muted=!0),we&&e.setAttribute(`playsinline`,``),o.split(`,`).forEach(t=>{let n=document.createElement(`source`);n.setAttribute(`src`,t);let r=W(t);r&&n.setAttribute(`type`,r),e.appendChild(n)}),n.appendChild(e)}else if(i&&t.excludeIframes!==!0){let e=document.createElement(`iframe`);e.setAttribute(`allowfullscreen`,``),e.setAttribute(`mozallowfullscreen`,``),e.setAttribute(`webkitallowfullscreen`,``),e.setAttribute(`allow`,`autoplay`),e.setAttribute(`data-src`,i),e.style.width=`100%`,e.style.height=`100%`,e.style.maxHeight=`100%`,e.style.maxWidth=`100%`,n.appendChild(e)}}let a=n.querySelector(`iframe[data-src]`);a&&this.shouldPreload(r)&&!/autoplay=(1|true|yes)/gi.test(i)&&a.getAttribute(`src`)!==i&&a.setAttribute(`src`,i)}this.layout(e)}layout(e){Array.from(e.querySelectorAll(`.r-fit-text`)).forEach(e=>{Ee(e,{minSize:24,maxSize:this.Reveal.getConfig().height*.8,observeMutations:!1,observeWindow:!1})})}unload(e){e.style.display=`none`;let t=this.Reveal.getSlideBackground(e);t&&(t.style.display=`none`,L(t,`iframe[src]`).forEach(e=>{e.removeAttribute(`src`)})),L(e,`video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]`).forEach(e=>{e.setAttribute(`data-src`,e.getAttribute(`src`)),e.removeAttribute(`src`)}),L(e,`video[data-lazy-loaded] source[src], audio source[src]`).forEach(e=>{e.setAttribute(`data-src`,e.getAttribute(`src`)),e.removeAttribute(`src`)})}formatEmbeddedContent(){let e=(e,t,n)=>{L(this.Reveal.getSlidesElement(),`iframe[`+e+`*="`+t+`"]`).forEach(t=>{let r=t.getAttribute(e);r&&r.indexOf(n)===-1&&t.setAttribute(e,r+(/\?/.test(r)?`&`:`?`)+n)})};e(`src`,`youtube.com/embed/`,`enablejsapi=1`),e(`data-src`,`youtube.com/embed/`,`enablejsapi=1`),e(`src`,`player.vimeo.com/`,`api=1`),e(`data-src`,`player.vimeo.com/`,`api=1`)}startEmbeddedContent(e){if(e){let t=this.Reveal.isSpeakerNotes();L(e,`img[src$=".gif"]`).forEach(e=>{e.setAttribute(`src`,e.getAttribute(`src`))}),L(e,`video, audio`).forEach(e=>{if(V(e,`.fragment`)&&!V(e,`.fragment.visible`))return;let n=this.Reveal.getConfig().autoPlayMedia;if(typeof n!=`boolean`&&(n=e.hasAttribute(`data-autoplay`)||!!V(e,`.slide-background`)),n&&typeof e.play==`function`){if(t&&!e.muted)return;e.readyState>1?this.startEmbeddedMedia({target:e}):we?(e.addEventListener(`canplay`,this.ensureMobileMediaPlaying),this.playMediaElement(e)):(e.removeEventListener(`loadeddata`,this.startEmbeddedMedia),e.addEventListener(`loadeddata`,this.startEmbeddedMedia))}}),t||(L(e,`iframe[src]`).forEach(e=>{V(e,`.fragment`)&&!V(e,`.fragment.visible`)||this.startEmbeddedIframe({target:e})}),L(e,`iframe[data-src]`).forEach(e=>{V(e,`.fragment`)&&!V(e,`.fragment.visible`)||e.getAttribute(`src`)!==e.getAttribute(`data-src`)&&(e.removeEventListener(`load`,this.startEmbeddedIframe),e.addEventListener(`load`,this.startEmbeddedIframe),e.setAttribute(`src`,e.getAttribute(`data-src`)))}))}}ensureMobileMediaPlaying(e){let t=e.target;typeof t.getVideoPlaybackQuality==`function`&&setTimeout(()=>{let e=t.paused===!1,n=t.getVideoPlaybackQuality().totalVideoFrames;e&&n===0&&(t.load(),t.play())},1e3)}startEmbeddedMedia(e){let t=!!V(e.target,`html`),n=!!V(e.target,`.present`);t&&n&&(e.target.paused||e.target.ended)&&(e.target.currentTime=0,this.playMediaElement(e.target)),e.target.removeEventListener(`loadeddata`,this.startEmbeddedMedia)}playMediaElement(e){let t=e.play();t&&typeof t.catch==`function`&&t.then(()=>{e.muted||(this.allowedToPlayAudio=!0)}).catch(t=>{if(t.name===`NotAllowedError`){if(this.allowedToPlayAudio=!1,e.tagName===`VIDEO`){this.onVideoPlaybackNotAllowed(e);let t=!!V(e,`html`),n=!!V(e,`.present`),r=e.muted;t&&n&&!r&&(e.setAttribute(`data-muted-by-reveal`,`true`),e.muted=!0,e.play().catch(()=>{this.onMutedVideoPlaybackNotAllowed(e)}))}else e.tagName===`AUDIO`&&this.onAudioPlaybackNotAllowed(e)}})}startEmbeddedIframe(e){let t=e.target;if(this.preventIframeAutoFocus(e),t&&t.contentWindow){let n=!!V(e.target,`html`),r=!!V(e.target,`.present`);if(n&&r){let e=this.Reveal.getConfig().autoPlayMedia;typeof e!=`boolean`&&(e=t.hasAttribute(`data-autoplay`)||!!V(t,`.slide-background`)),/youtube\.com\/embed\//.test(t.getAttribute(`src`))&&e?t.contentWindow.postMessage(`{"event":"command","func":"playVideo","args":""}`,`*`):/player\.vimeo\.com\//.test(t.getAttribute(`src`))&&e?t.contentWindow.postMessage(`{"method":"play"}`,`*`):t.contentWindow.postMessage(`slide:start`,`*`)}}}stopEmbeddedContent(e,t={}){t=I({unloadIframes:!0},t),e&&e.parentNode&&(L(e,`video, audio`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&typeof e.pause==`function`&&(e.setAttribute(`data-paused-by-reveal`,``),e.pause(),we&&e.removeEventListener(`canplay`,this.ensureMobileMediaPlaying))}),L(e,`iframe`).forEach(e=>{e.contentWindow&&e.contentWindow.postMessage(`slide:stop`,`*`),e.removeEventListener(`load`,this.preventIframeAutoFocus),e.removeEventListener(`load`,this.startEmbeddedIframe)}),L(e,`iframe[src*="youtube.com/embed/"]`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&e.contentWindow&&typeof e.contentWindow.postMessage==`function`&&e.contentWindow.postMessage(`{"event":"command","func":"pauseVideo","args":""}`,`*`)}),L(e,`iframe[src*="player.vimeo.com/"]`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&e.contentWindow&&typeof e.contentWindow.postMessage==`function`&&e.contentWindow.postMessage(`{"method":"pause"}`,`*`)}),t.unloadIframes===!0&&L(e,`iframe[data-src]`).forEach(e=>{e.setAttribute(`src`,`about:blank`),e.removeAttribute(`src`)}))}isAllowedToPlayAudio(){return this.allowedToPlayAudio}showPlayOrUnmuteButton(){let e=this.failedAudioPlaybackTargets.size,t=this.failedVideoPlaybackTargets.size,n=this.failedMutedVideoPlaybackTargets.size,r=`Play media`;n>0?r=`Play video`:t>0?r=`Unmute video`:e>0&&(r=`Play audio`),this.mediaPlayButton.textContent=r,this.Reveal.getRevealElement().appendChild(this.mediaPlayButton)}onAudioPlaybackNotAllowed(e){this.failedAudioPlaybackTargets.add(e),this.showPlayOrUnmuteButton(e)}onVideoPlaybackNotAllowed(e){this.failedVideoPlaybackTargets.add(e),this.showPlayOrUnmuteButton()}onMutedVideoPlaybackNotAllowed(e){this.failedMutedVideoPlaybackTargets.add(e),this.showPlayOrUnmuteButton()}resetTemporarilyMutedMedia(){new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(e=>{e.hasAttribute(`data-muted-by-reveal`)&&(e.muted=!1,e.removeAttribute(`data-muted-by-reveal`))})}clearMediaPlaybackErrors(){this.resetTemporarilyMutedMedia(),this.failedAudioPlaybackTargets.clear(),this.failedVideoPlaybackTargets.clear(),this.failedMutedVideoPlaybackTargets.clear(),this.mediaPlayButton&&this.mediaPlayButton.parentNode&&this.mediaPlayButton.remove()}preventIframeAutoFocus(e){let t=e.target;if(t&&this.Reveal.getConfig().preventIframeAutoFocus){let e=0,n=()=>{document.activeElement===t?document.activeElement.blur():e<1e3&&(e+=100,setTimeout(n,100))};setTimeout(n,100)}}afterSlideChanged(){this.clearMediaPlaybackErrors()}},Me=`.slides section`,Ne=`.slides>section`,Pe=`.slides>section.present>section`,Fe=`.backgrounds>.slide-background`,Ie=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Le=class{constructor(e){this.Reveal=e}render(){this.element=document.createElement(`div`),this.element.className=`slide-number`,this.Reveal.getRevealElement().appendChild(this.element)}configure(e,t){let n=`none`;e.slideNumber&&!this.Reveal.isPrintView()&&(e.showSlideNumber===`all`||e.showSlideNumber===`speaker`&&this.Reveal.isSpeakerNotes())&&(n=`block`),this.element.style.display=n}update(){this.Reveal.getConfig().slideNumber&&this.element&&(this.element.innerHTML=this.getSlideNumber())}getSlideNumber(e=this.Reveal.getCurrentSlide()){let t=this.Reveal.getConfig(),n,r=`h.v`;if(typeof t.slideNumber==`function`)n=t.slideNumber(e);else{typeof t.slideNumber==`string`&&(r=t.slideNumber),!/c/.test(r)&&this.Reveal.getHorizontalSlides().length===1&&(r=`c`);let i=e&&e.dataset.visibility===`uncounted`?0:1;switch(n=[],r){case`c`:n.push(this.Reveal.getSlidePastCount(e)+i);break;case`c/t`:n.push(this.Reveal.getSlidePastCount(e)+i,`/`,this.Reveal.getTotalSlides());break;default:let t=this.Reveal.getIndices(e);n.push(t.h+i);let a=r===`h/v`?`/`:`.`;this.Reveal.isVerticalSlide(e)&&n.push(a,t.v+1)}}let i=`#`+this.Reveal.location.getHash(e);return this.formatNumber(n[0],n[1],n[2],i)}formatNumber(e,t,n,r=`#`+this.Reveal.location.getHash()){return typeof n==`number`&&!isNaN(n)?`<a href="${r}">
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t,t as n}from"./useEvent-Dfcbgjhg.js";import{t as r}from"./react-DVplv7_D.js";import{Bt as i,D as a,na as o,oa as s,rt as c,ta as l}from"./cells-T9_Y4Jlv.js";import{t as u}from"./compiler-runtime-BrajqUja.js";import{T as d,s as f}from"./config-DGX7JYor.js";import{g as p,t as m}from"./useEventListener-CjDeLqFC.js";import{t as h}from"./utils-B4K466FK.js";import{m as g}from"./session-B8Y-GJnS.js";import{_}from"./config-DzdxZb17.js";import{r as v}from"./state-DaWgt-rn.js";import{t as y}from"./cn-ldLVeaqm.js";import{t as b}from"./jsx-runtime-B74pBk57.js";import{n as x}from"./fullscreen-BWTs8pYZ.js";import{Pt as S}from"./JsonOutput-Pm6OCP3J.js";import{t as C}from"./tooltip-CkGm8X7m.js";import{r as ee,t as w}from"./button-D8gVKwe-.js";import{t as T}from"./createLucideIcon-DfJ2oMlA.js";import{_ as E,d as D,f as O,g as k,s as A,u as te}from"./layout-CGC8ajpe.js";import{a as j}from"./useNumberFormatter-D7O_26UI.js";import{t as ne}from"./code-BEiQP4pS.js";import{t as M}from"./eye-off-CxVozGAC.js";import{n as N,t as re}from"./cell-editor-M8dEnDzk.js";import{n as ie,t as P}from"./RunButton-DvuvkgrG.js";import{t as ae}from"./readonly-python-code-B81AjzXM.js";import{r as oe}from"./useTheme-DLtPc-39.js";import{r as se}from"./useDebounce-k9QTpQ9-.js";import{t as ce}from"./CellStatus-cD3S0wEA.js";import{i as le}from"./useRunCells-BFeZMi7f.js";import{n as ue,r as de,t as fe}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{n as pe,t as me}from"./code-visibility-CV3S4xuf.js";import{t as he}from"./readonly-code-display-Dsp6vWPh.js";/* empty css */var ge=T(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),F=e(r(),1),_e=u(),I=(e,t)=>{for(let n in t)e[n]=t[n];return e},L=(e,t)=>Array.from(e.querySelectorAll(t)),ve=(e,t,n)=>{n?e.classList.add(t):e.classList.remove(t)},R=e=>{if(typeof e==`string`){if(e===`null`)return null;if(e===`true`)return!0;if(e===`false`)return!1;if(e.match(/^-?[\d\.]+$/))return parseFloat(e)}return e},z=(e,t)=>{e.style.transform=t},B=(e,t)=>{let n=e.matches||e.matchesSelector||e.msMatchesSelector;return!!(n&&n.call(e,t))},V=(e,t)=>{if(e&&typeof e.closest==`function`)return e.closest(t);for(;e;){if(B(e,t))return e;e=e.parentElement}return null},H=e=>{e||=document.documentElement;let t=e.requestFullscreen||e.webkitRequestFullscreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t&&t.apply(e)},ye=(e,t,n,r=``)=>{let i=e.querySelectorAll(`.`+n);for(let t=0;t<i.length;t++){let n=i[t];if(n.parentNode===e)return n}let a=document.createElement(t);return a.className=n,a.innerHTML=r,e.appendChild(a),a},be=e=>{let t=document.createElement(`style`);return e&&e.length>0&&t.appendChild(document.createTextNode(e)),document.head.appendChild(t),t},xe=()=>{let e={};location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,t=>{let n=t.split(`=`).shift(),r=t.split(`=`).pop();return n&&r!==void 0&&(e[n]=r),t});for(let t in e){let n=e[t];e[t]=R(unescape(n))}return e.dependencies!==void 0&&delete e.dependencies,e},Se=(e,t=0)=>{if(e){let n,r=e.style.height;return e.style.height=`0px`,e.parentElement&&(e.parentElement.style.height=`auto`),n=t-(e.parentElement?.offsetHeight||0),e.style.height=r+`px`,e.parentElement&&e.parentElement.style.removeProperty(`height`),n}return t},U={mp4:`video/mp4`,m4a:`video/mp4`,ogv:`video/ogg`,mpeg:`video/mpeg`,webm:`video/webm`},W=(e=``)=>{let t=e.split(`.`).pop();return t?U[t]:void 0},Ce=(e=``)=>encodeURI(e).replace(/%5B/g,`[`).replace(/%5D/g,`]`).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),G=navigator.userAgent,we=/(iphone|ipod|ipad|android)/gi.test(G)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1;/chrome/i.test(G)&&/edge/i.test(G);var Te=/android/gi.test(G),Ee=function(e){if(e){var t=function(e){return[].slice.call(e)},n=0,r=1,i=2,a=3,o=[],s=null,c=`requestAnimationFrame`in e?function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{sync:!1};e.cancelAnimationFrame(s);var n=function(){return u(o.filter((function(e){return e.dirty&&e.active})))};if(t.sync)return n();s=e.requestAnimationFrame(n)}:function(){},l=function(e){return function(t){o.forEach((function(t){return t.dirty=e})),c(t)}},u=function(e){e.filter((function(e){return!e.styleComputed})).forEach((function(e){e.styleComputed=m(e)})),e.filter(h).forEach(g);var t=e.filter(p);t.forEach(f),t.forEach((function(e){g(e),d(e)})),t.forEach(_)},d=function(e){return e.dirty=n},f=function(e){e.availableWidth=e.element.parentNode.clientWidth,e.currentWidth=e.element.scrollWidth,e.previousFontSize=e.currentFontSize,e.currentFontSize=Math.min(Math.max(e.minSize,e.availableWidth/e.currentWidth*e.previousFontSize),e.maxSize),e.whiteSpace=e.multiLine&&e.currentFontSize===e.minSize?`normal`:`nowrap`},p=function(e){return e.dirty!==i||e.dirty===i&&e.element.parentNode.clientWidth!==e.availableWidth},m=function(t){var n=e.getComputedStyle(t.element,null);return t.currentFontSize=parseFloat(n.getPropertyValue(`font-size`)),t.display=n.getPropertyValue(`display`),t.whiteSpace=n.getPropertyValue(`white-space`),!0},h=function(e){var t=!1;return!e.preStyleTestCompleted&&(/inline-/.test(e.display)||(t=!0,e.display=`inline-block`),e.whiteSpace!==`nowrap`&&(t=!0,e.whiteSpace=`nowrap`),e.preStyleTestCompleted=!0,t)},g=function(e){e.element.style.whiteSpace=e.whiteSpace,e.element.style.display=e.display,e.element.style.fontSize=e.currentFontSize+`px`},_=function(e){e.element.dispatchEvent(new CustomEvent(`fit`,{detail:{oldValue:e.previousFontSize,newValue:e.currentFontSize,scaleFactor:e.currentFontSize/e.previousFontSize}}))},v=function(e,t){return function(n){e.dirty=t,e.active&&c(n)}},y=function(e){return function(){o=o.filter((function(t){return t.element!==e.element})),e.observeMutations&&e.observer.disconnect(),e.element.style.whiteSpace=e.originalStyle.whiteSpace,e.element.style.display=e.originalStyle.display,e.element.style.fontSize=e.originalStyle.fontSize}},b=function(e){return function(){e.active||(e.active=!0,c())}},x=function(e){return function(){return e.active=!1}},S=function(e){e.observeMutations&&(e.observer=new MutationObserver(v(e,r)),e.observer.observe(e.element,e.observeMutations))},C={minSize:16,maxSize:512,multiLine:!0,observeMutations:`MutationObserver`in e&&{subtree:!0,childList:!0,characterData:!0}},ee=null,w=function(){e.clearTimeout(ee),ee=e.setTimeout(l(i),D.observeWindowDelay)},T=[`resize`,`orientationchange`];return Object.defineProperty(D,"observeWindow",{set:function(t){var n=`${t?`add`:`remove`}EventListener`;T.forEach((function(t){e[n](t,w)}))}}),D.observeWindow=!0,D.observeWindowDelay=100,D.fitAll=l(a),D}function E(e,t){var n=Object.assign({},C,t),r=e.map((function(e){var t=Object.assign({},n,{element:e,active:!0});return function(e){e.originalStyle={whiteSpace:e.element.style.whiteSpace,display:e.element.style.display,fontSize:e.element.style.fontSize},S(e),e.newbie=!0,e.dirty=!0,o.push(e)}(t),{element:e,fit:v(t,a),unfreeze:b(t),freeze:x(t),unsubscribe:y(t)}}));return c(),r}function D(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof e==`string`?E(t(document.querySelectorAll(e)),n):E([e],n)[0]}}(typeof window>`u`?null:window);function De(e){"@babel/helpers - typeof";return De=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},De(e)}function Oe(e,t){if(De(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(De(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ke(e){var t=Oe(e,`string`);return De(t)==`symbol`?t:t+``}function Ae(e,t,n){return(t=ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var je=class{constructor(e){Ae(this,`allowedToPlayAudio`,null),this.Reveal=e,this.startEmbeddedMedia=this.startEmbeddedMedia.bind(this),this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this),this.preventIframeAutoFocus=this.preventIframeAutoFocus.bind(this),this.ensureMobileMediaPlaying=this.ensureMobileMediaPlaying.bind(this),this.failedAudioPlaybackTargets=new Set,this.failedVideoPlaybackTargets=new Set,this.failedMutedVideoPlaybackTargets=new Set,this.renderMediaPlayButton()}renderMediaPlayButton(){this.mediaPlayButton=document.createElement(`button`),this.mediaPlayButton.className=`r-overlay-button r-media-play-button`,this.mediaPlayButton.addEventListener(`click`,()=>{this.resetTemporarilyMutedMedia(),new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(e=>{this.startEmbeddedMedia({target:e})}),this.clearMediaPlaybackErrors()})}shouldPreload(e){if(this.Reveal.isScrollView())return!0;let t=this.Reveal.getConfig().preloadIframes;return typeof t!=`boolean`&&(t=e.hasAttribute(`data-preload`)),t}load(e,t={}){let n=this.Reveal.getConfig().display;if(n.includes(`!important`)){let t=n.replace(/\s*!important\s*$/,``).trim();e.style.setProperty(`display`,t,`important`)}else e.style.display=n;L(e,`img[data-src], video[data-src], audio[data-src], iframe[data-src]`).forEach(e=>{let t=e.tagName===`IFRAME`;(!t||this.shouldPreload(e))&&(e.setAttribute(`src`,e.getAttribute(`data-src`)),e.setAttribute(`data-lazy-loaded`,``),e.removeAttribute(`data-src`),t&&e.addEventListener(`load`,this.preventIframeAutoFocus))}),L(e,`video, audio`).forEach(e=>{let t=0;L(e,`source[data-src]`).forEach(e=>{e.setAttribute(`src`,e.getAttribute(`data-src`)),e.removeAttribute(`data-src`),e.setAttribute(`data-lazy-loaded`,``),t+=1}),we&&e.tagName===`VIDEO`&&e.setAttribute(`playsinline`,``),t>0&&e.load()});let r=e.slideBackgroundElement;if(r){r.style.display=`block`;let n=e.slideBackgroundContentElement,i=e.getAttribute(`data-background-iframe`);if(r.hasAttribute(`data-loaded`)===!1){r.setAttribute(`data-loaded`,`true`);let a=e.getAttribute(`data-background-image`),o=e.getAttribute(`data-background-video`),s=e.hasAttribute(`data-background-video-loop`),c=e.hasAttribute(`data-background-video-muted`);if(a)/^data:/.test(a.trim())?n.style.backgroundImage=`url(${a.trim()})`:n.style.backgroundImage=a.split(`,`).map(e=>`url(${Ce(decodeURI(e.trim()))})`).join(`,`);else if(o){let e=document.createElement(`video`);s&&e.setAttribute(`loop`,``),(c||this.Reveal.isSpeakerNotes())&&(e.muted=!0),we&&e.setAttribute(`playsinline`,``),o.split(`,`).forEach(t=>{let n=document.createElement(`source`);n.setAttribute(`src`,t);let r=W(t);r&&n.setAttribute(`type`,r),e.appendChild(n)}),n.appendChild(e)}else if(i&&t.excludeIframes!==!0){let e=document.createElement(`iframe`);e.setAttribute(`allowfullscreen`,``),e.setAttribute(`mozallowfullscreen`,``),e.setAttribute(`webkitallowfullscreen`,``),e.setAttribute(`allow`,`autoplay`),e.setAttribute(`data-src`,i),e.style.width=`100%`,e.style.height=`100%`,e.style.maxHeight=`100%`,e.style.maxWidth=`100%`,n.appendChild(e)}}let a=n.querySelector(`iframe[data-src]`);a&&this.shouldPreload(r)&&!/autoplay=(1|true|yes)/gi.test(i)&&a.getAttribute(`src`)!==i&&a.setAttribute(`src`,i)}this.layout(e)}layout(e){Array.from(e.querySelectorAll(`.r-fit-text`)).forEach(e=>{Ee(e,{minSize:24,maxSize:this.Reveal.getConfig().height*.8,observeMutations:!1,observeWindow:!1})})}unload(e){e.style.display=`none`;let t=this.Reveal.getSlideBackground(e);t&&(t.style.display=`none`,L(t,`iframe[src]`).forEach(e=>{e.removeAttribute(`src`)})),L(e,`video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]`).forEach(e=>{e.setAttribute(`data-src`,e.getAttribute(`src`)),e.removeAttribute(`src`)}),L(e,`video[data-lazy-loaded] source[src], audio source[src]`).forEach(e=>{e.setAttribute(`data-src`,e.getAttribute(`src`)),e.removeAttribute(`src`)})}formatEmbeddedContent(){let e=(e,t,n)=>{L(this.Reveal.getSlidesElement(),`iframe[`+e+`*="`+t+`"]`).forEach(t=>{let r=t.getAttribute(e);r&&r.indexOf(n)===-1&&t.setAttribute(e,r+(/\?/.test(r)?`&`:`?`)+n)})};e(`src`,`youtube.com/embed/`,`enablejsapi=1`),e(`data-src`,`youtube.com/embed/`,`enablejsapi=1`),e(`src`,`player.vimeo.com/`,`api=1`),e(`data-src`,`player.vimeo.com/`,`api=1`)}startEmbeddedContent(e){if(e){let t=this.Reveal.isSpeakerNotes();L(e,`img[src$=".gif"]`).forEach(e=>{e.setAttribute(`src`,e.getAttribute(`src`))}),L(e,`video, audio`).forEach(e=>{if(V(e,`.fragment`)&&!V(e,`.fragment.visible`))return;let n=this.Reveal.getConfig().autoPlayMedia;if(typeof n!=`boolean`&&(n=e.hasAttribute(`data-autoplay`)||!!V(e,`.slide-background`)),n&&typeof e.play==`function`){if(t&&!e.muted)return;e.readyState>1?this.startEmbeddedMedia({target:e}):we?(e.addEventListener(`canplay`,this.ensureMobileMediaPlaying),this.playMediaElement(e)):(e.removeEventListener(`loadeddata`,this.startEmbeddedMedia),e.addEventListener(`loadeddata`,this.startEmbeddedMedia))}}),t||(L(e,`iframe[src]`).forEach(e=>{V(e,`.fragment`)&&!V(e,`.fragment.visible`)||this.startEmbeddedIframe({target:e})}),L(e,`iframe[data-src]`).forEach(e=>{V(e,`.fragment`)&&!V(e,`.fragment.visible`)||e.getAttribute(`src`)!==e.getAttribute(`data-src`)&&(e.removeEventListener(`load`,this.startEmbeddedIframe),e.addEventListener(`load`,this.startEmbeddedIframe),e.setAttribute(`src`,e.getAttribute(`data-src`)))}))}}ensureMobileMediaPlaying(e){let t=e.target;typeof t.getVideoPlaybackQuality==`function`&&setTimeout(()=>{let e=t.paused===!1,n=t.getVideoPlaybackQuality().totalVideoFrames;e&&n===0&&(t.load(),t.play())},1e3)}startEmbeddedMedia(e){let t=!!V(e.target,`html`),n=!!V(e.target,`.present`);t&&n&&(e.target.paused||e.target.ended)&&(e.target.currentTime=0,this.playMediaElement(e.target)),e.target.removeEventListener(`loadeddata`,this.startEmbeddedMedia)}playMediaElement(e){let t=e.play();t&&typeof t.catch==`function`&&t.then(()=>{e.muted||(this.allowedToPlayAudio=!0)}).catch(t=>{if(t.name===`NotAllowedError`){if(this.allowedToPlayAudio=!1,e.tagName===`VIDEO`){this.onVideoPlaybackNotAllowed(e);let t=!!V(e,`html`),n=!!V(e,`.present`),r=e.muted;t&&n&&!r&&(e.setAttribute(`data-muted-by-reveal`,`true`),e.muted=!0,e.play().catch(()=>{this.onMutedVideoPlaybackNotAllowed(e)}))}else e.tagName===`AUDIO`&&this.onAudioPlaybackNotAllowed(e)}})}startEmbeddedIframe(e){let t=e.target;if(this.preventIframeAutoFocus(e),t&&t.contentWindow){let n=!!V(e.target,`html`),r=!!V(e.target,`.present`);if(n&&r){let e=this.Reveal.getConfig().autoPlayMedia;typeof e!=`boolean`&&(e=t.hasAttribute(`data-autoplay`)||!!V(t,`.slide-background`)),/youtube\.com\/embed\//.test(t.getAttribute(`src`))&&e?t.contentWindow.postMessage(`{"event":"command","func":"playVideo","args":""}`,`*`):/player\.vimeo\.com\//.test(t.getAttribute(`src`))&&e?t.contentWindow.postMessage(`{"method":"play"}`,`*`):t.contentWindow.postMessage(`slide:start`,`*`)}}}stopEmbeddedContent(e,t={}){t=I({unloadIframes:!0},t),e&&e.parentNode&&(L(e,`video, audio`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&typeof e.pause==`function`&&(e.setAttribute(`data-paused-by-reveal`,``),e.pause(),we&&e.removeEventListener(`canplay`,this.ensureMobileMediaPlaying))}),L(e,`iframe`).forEach(e=>{e.contentWindow&&e.contentWindow.postMessage(`slide:stop`,`*`),e.removeEventListener(`load`,this.preventIframeAutoFocus),e.removeEventListener(`load`,this.startEmbeddedIframe)}),L(e,`iframe[src*="youtube.com/embed/"]`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&e.contentWindow&&typeof e.contentWindow.postMessage==`function`&&e.contentWindow.postMessage(`{"event":"command","func":"pauseVideo","args":""}`,`*`)}),L(e,`iframe[src*="player.vimeo.com/"]`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&e.contentWindow&&typeof e.contentWindow.postMessage==`function`&&e.contentWindow.postMessage(`{"method":"pause"}`,`*`)}),t.unloadIframes===!0&&L(e,`iframe[data-src]`).forEach(e=>{e.setAttribute(`src`,`about:blank`),e.removeAttribute(`src`)}))}isAllowedToPlayAudio(){return this.allowedToPlayAudio}showPlayOrUnmuteButton(){let e=this.failedAudioPlaybackTargets.size,t=this.failedVideoPlaybackTargets.size,n=this.failedMutedVideoPlaybackTargets.size,r=`Play media`;n>0?r=`Play video`:t>0?r=`Unmute video`:e>0&&(r=`Play audio`),this.mediaPlayButton.textContent=r,this.Reveal.getRevealElement().appendChild(this.mediaPlayButton)}onAudioPlaybackNotAllowed(e){this.failedAudioPlaybackTargets.add(e),this.showPlayOrUnmuteButton(e)}onVideoPlaybackNotAllowed(e){this.failedVideoPlaybackTargets.add(e),this.showPlayOrUnmuteButton()}onMutedVideoPlaybackNotAllowed(e){this.failedMutedVideoPlaybackTargets.add(e),this.showPlayOrUnmuteButton()}resetTemporarilyMutedMedia(){new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(e=>{e.hasAttribute(`data-muted-by-reveal`)&&(e.muted=!1,e.removeAttribute(`data-muted-by-reveal`))})}clearMediaPlaybackErrors(){this.resetTemporarilyMutedMedia(),this.failedAudioPlaybackTargets.clear(),this.failedVideoPlaybackTargets.clear(),this.failedMutedVideoPlaybackTargets.clear(),this.mediaPlayButton&&this.mediaPlayButton.parentNode&&this.mediaPlayButton.remove()}preventIframeAutoFocus(e){let t=e.target;if(t&&this.Reveal.getConfig().preventIframeAutoFocus){let e=0,n=()=>{document.activeElement===t?document.activeElement.blur():e<1e3&&(e+=100,setTimeout(n,100))};setTimeout(n,100)}}afterSlideChanged(){this.clearMediaPlaybackErrors()}},Me=`.slides section`,Ne=`.slides>section`,Pe=`.slides>section.present>section`,Fe=`.backgrounds>.slide-background`,Ie=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Le=class{constructor(e){this.Reveal=e}render(){this.element=document.createElement(`div`),this.element.className=`slide-number`,this.Reveal.getRevealElement().appendChild(this.element)}configure(e,t){let n=`none`;e.slideNumber&&!this.Reveal.isPrintView()&&(e.showSlideNumber===`all`||e.showSlideNumber===`speaker`&&this.Reveal.isSpeakerNotes())&&(n=`block`),this.element.style.display=n}update(){this.Reveal.getConfig().slideNumber&&this.element&&(this.element.innerHTML=this.getSlideNumber())}getSlideNumber(e=this.Reveal.getCurrentSlide()){let t=this.Reveal.getConfig(),n,r=`h.v`;if(typeof t.slideNumber==`function`)n=t.slideNumber(e);else{typeof t.slideNumber==`string`&&(r=t.slideNumber),!/c/.test(r)&&this.Reveal.getHorizontalSlides().length===1&&(r=`c`);let i=e&&e.dataset.visibility===`uncounted`?0:1;switch(n=[],r){case`c`:n.push(this.Reveal.getSlidePastCount(e)+i);break;case`c/t`:n.push(this.Reveal.getSlidePastCount(e)+i,`/`,this.Reveal.getTotalSlides());break;default:let t=this.Reveal.getIndices(e);n.push(t.h+i);let a=r===`h/v`?`/`:`.`;this.Reveal.isVerticalSlide(e)&&n.push(a,t.v+1)}}let i=`#`+this.Reveal.location.getHash(e);return this.formatNumber(n[0],n[1],n[2],i)}formatNumber(e,t,n,r=`#`+this.Reveal.location.getHash()){return typeof n==`number`&&!isNaN(n)?`<a href="${r}">
2
2
  <span class="slide-number-a">${e}</span>
3
3
  <span class="slide-number-delimiter">${t}</span>
4
4
  <span class="slide-number-b">${n}</span>
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{D as a,La as o,g as s,oo as c,x as l}from"./cells-T9_Y4Jlv.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./panels-DVvPamWL.js";import{t as g}from"./compiler-runtime-BrajqUja.js";import{C as _}from"./config-DGX7JYor.js";import{r as v}from"./utils-B4K466FK.js";import{t as y}from"./session-B8Y-GJnS.js";import{T as b,_ as x,l as S,p as C}from"./config-DzdxZb17.js";import{t as w}from"./cn-ldLVeaqm.js";import{t as T}from"./jsx-runtime-B74pBk57.js";import{a as E,c as D,i as O,l as k,n as A,s as j,t as M}from"./alert-dialog-C-sWmKva.js";import{F as N,Ft as ee}from"./JsonOutput-Pm6OCP3J.js";import{n as te}from"./download-C8Gw-D0Y.js";import{i as P,n as F,r as ne,t as re}from"./tabs-CY8E4r9U.js";import{n as I,t as L}from"./button-D8gVKwe-.js";import{n as ie}from"./paths-bkIFVj8h.js";import{t as ae}from"./arrow-left-BaPN-xbg.js";import{t as R}from"./copy-Djr5m5ac.js";import{t as oe}from"./house-CpsMWsLL.js";import{t as z}from"./spinner-DyNE-o8o.js";import{l as B,s as V}from"./readonly-python-code-B81AjzXM.js";import{Jt as H,Qt as U,Xt as W,Yt as G,nn as K,tn as q}from"./input-BZdRe7pb.js";import{n as J}from"./copy-KlhazlhB.js";import{t as Y}from"./use-toast-Wu434mLr.js";import{r as se}from"./requests-lt0JK8Jt.js";import{t as ce}from"./shell-Fj8a65ii.js";import{t as le}from"./share-BZW3tzEX.js";import{a as X}from"./cell-link-DFqfW-Ym.js";import{n as ue,t as de}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{n as fe}from"./code-visibility-CV3S4xuf.js";import{n as pe,t as me}from"./marimo-icons-CqliHyTr.js";import{t as he}from"./state-Ck7FMD5A.js";var ge=e(i(),1),Z=g(),Q=T(),_e=()=>{let e=(0,Z.c)(25),[n,r]=t(he);if(n===null)return null;let i;e[0]===n?i=e[1]:(i=async()=>{try{await navigator.clipboard.writeText(n),Y({title:`Copied to clipboard`,description:`Error details have been copied to your clipboard.`})}catch{Y({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},e[0]=n,e[1]=i);let a=i,o;e[2]===r?o=e[3]:(o=()=>{r(null)},e[2]=r,e[3]=o);let s=o,l=ve,u;e[4]===s?u=e[5]:(u=e=>!e&&s(),e[4]=s,e[5]=u);let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsxs)(D,{children:[(0,Q.jsxs)(k,{className:`flex items-center gap-2 text-destructive`,children:[(0,Q.jsx)(c,{className:`h-5 w-5`}),`Kernel Startup Failed`]}),(0,Q.jsx)(E,{children:`The kernel failed to start. This usually happens when the package manager can't install your notebook's dependencies.`})]}),e[6]=d):d=e[6];let f;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Error Details`}),e[7]=f):f=e[7];let p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(R,{className:`h-3 w-3`}),e[8]=p):p=e[8];let m;e[9]===a?m=e[10]:(m=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[f,(0,Q.jsxs)(L,{variant:`outline`,size:`xs`,onClick:a,className:`flex items-center gap-1`,children:[p,`Copy`]})]}),e[9]=a,e[10]=m);let h;e[11]===n?h=e[12]:(h=(0,Q.jsx)(`pre`,{className:`bg-muted p-4 rounded-md text-sm font-mono overflow-auto max-h-80`,children:n}),e[11]=n,e[12]=h);let g;e[13]!==m||e[14]!==h?(g=(0,Q.jsxs)(`div`,{className:`my-4 overflow-hidden`,children:[m,h]}),e[13]=m,e[14]=h,e[15]=g):g=e[15];let _;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsxs)(L,{variant:`outline`,onClick:l,className:`flex items-center gap-2`,children:[(0,Q.jsx)(oe,{className:`h-4 w-4`}),`Return to Home`]}),e[16]=_):_=e[16];let v;e[17]===s?v=e[18]:(v=(0,Q.jsxs)(j,{children:[_,(0,Q.jsx)(A,{onClick:s,children:`Dismiss`})]}),e[17]=s,e[18]=v);let y;e[19]!==v||e[20]!==g?(y=(0,Q.jsxs)(O,{className:`max-w-2xl`,children:[d,g,v]}),e[19]=v,e[20]=g,e[21]=y):y=e[21];let b;return e[22]!==y||e[23]!==u?(b=(0,Q.jsx)(M,{open:!0,onOpenChange:u,children:y}),e[22]=y,e[23]=u,e[24]=b):b=e[24],b};function ve(){let e=document.baseURI.split(`?`)[0];window.open(e,`_self`)}var ye=e=>{let t=(0,Z.c)(2),{reason:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`font-mono text-center text-base text-(--red-11)`,children:(0,Q.jsx)(`p`,{children:n})}),t[0]=n,t[1]=r),r},be=e=>{let t=(0,Z.c)(7),{connection:n,className:r,children:i}=e,a;t[0]!==n.reason||t[1]!==n.state?(a=n.state===b.CLOSED&&(0,Q.jsx)(ye,{reason:n.reason}),t[0]=n.reason,t[1]=n.state,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==r||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:r,children:[i,a]}),t[3]=i,t[4]=r,t[5]=a,t[6]=o):o=t[6],o},xe=n(e=>e(s)||!C(e(x).state)),Se=e=>{let t=(0,Z.c)(22),{appConfig:n,hideHeader:i}=e,{setCells:o}=a(),{sendComponentValues:s}=se(),c;t[0]===s?c=t[1]:(c=()=>(m.INSTANCE.start(s),Ce),t[0]=s,t[1]=c);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[2]=h):h=t[2],(0,ge.useEffect)(c,h);let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=y(),t[3]=g):g=t[3];let _;t[4]===o?_=t[5]:(_={autoInstantiate:!0,setCells:o,sessionId:g},t[4]=o,t[5]=_);let{connection:v,reconnect:b}=f(_),x=r(l),S;if(t[6]===Symbol.for(`react.memo_cache_sentinel`)){bb0:{if(typeof window>`u`){S=null;break bb0}let e=new URL(window.location.href);if(!e.searchParams.has(`file`)){S=null;break bb0}e.searchParams.delete(`file`);let t=e.searchParams.toString();S=t?`${e.pathname}?${t}`:e.pathname}t[6]=S}else S=t[6];let C=S,T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(_e,{}),t[7]=T):T=t[7];let E=i?`hidden`:`sm:pt-8`,D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=C&&(0,Q.jsx)(`div`,{className:`flex items-center px-6 pt-4 sm:-mt-8`,children:(0,Q.jsxs)(`a`,{href:C,"aria-label":`Back to gallery`,className:w(I({variant:`text`,size:`sm`}),`gap-2 px-0 text-muted-foreground hover:text-foreground`),children:[(0,Q.jsx)(ae,{className:`size-4`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:`Back`})]})}),t[8]=D):D=t[8];let O;t[9]!==v||t[10]!==E?(O=(0,Q.jsx)(be,{connection:v,className:E,children:D}),t[9]=v,t[10]=E,t[11]=O):O=t[11];let k;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{className:`mx-auto`}),(0,Q.jsx)(`p`,{className:`text-center text-sm text-muted-foreground mt-2`,children:`Connecting...`})]}),t[12]=k):k=t[12];let A;t[13]===n?A=t[14]:(A=(0,Q.jsx)(p,{requires:xe,delay:2e3,fallback:k,children:(0,Q.jsx)(d,{appConfig:n,mode:`read`})}),t[13]=n,t[14]=A);let j;return t[15]!==n.width||t[16]!==v||t[17]!==x||t[18]!==b||t[19]!==A||t[20]!==O?(j=(0,Q.jsxs)(u,{connection:v,isRunning:x,width:n.width,onReconnect:b,children:[T,O,A]}),t[15]=n.width,t[16]=v,t[17]=x,t[18]=b,t[19]=A,t[20]=O,t[21]=j):j=t[21],j};function Ce(){m.INSTANCE.stop()}var we=()=>{let e=(0,Z.c)(3),t=r(o);if(!S()||!t)return null;let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`span`,{children:[`Static`,` `,(0,Q.jsx)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) font-medium underline`,children:`marimo`}),` `,`notebook - Run or edit for full interactivity`]}),e[0]=n):n=e[0];let i;return e[1]===t?i=e[2]:(i=(0,Q.jsxs)(`div`,{className:`px-4 py-2 bg-(--sky-2) border-b border-(--sky-7) text-(--sky-11) flex justify-between items-center gap-4 print:hidden text-sm`,"data-testid":`static-notebook-banner`,children:[n,(0,Q.jsx)(`span`,{className:`shrink-0`,children:(0,Q.jsx)(Te,{code:t})})]}),e[1]=t,e[2]=i),i},Te=e=>{let t=(0,Z.c)(44),{code:n}=e,r=ie.basename(X()||`notebook.py`),[i]=_(),a=i.sharing?.molab??!0,o=Ee(window.location.href,r),s=o!==r,c=ce(o),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(L,{"data-testid":`static-notebook-dialog-trigger`,variant:`outline`,size:`xs`,children:`Run or Edit`})}),t[0]=l):l=t[0];let u;t[1]===r?u=t[2]:(u=(0,Q.jsx)(q,{children:r}),t[1]=r,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) hover:underline font-medium`,children:`marimo`}),t[3]=d):d=t[3];let f=s?`Run it`:`Download it, then run it`,p;t[4]===f?p=t[5]:(p=(0,Q.jsxs)(`p`,{children:[`This is a static`,` `,d,` `,`notebook. `,f,` `,`locally for full interactivity.`]}),t[4]=f,t[5]=p);let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsxs)(ne,{"aria-label":`Package manager`,children:[(0,Q.jsx)(P,{value:`uv`,children:`uv`}),(0,Q.jsx)(P,{value:`pip`,children:`pip`}),(0,Q.jsx)(P,{value:`conda`,children:`conda`})]}),t[6]=m):m=t[6];let h=`uvx marimo edit --sandbox ${c}`,g;t[7]===h?g=t[8]:(g=(0,Q.jsx)(F,{value:`uv`,children:(0,Q.jsx)($,{command:h})}),t[7]=h,t[8]=g);let y=`pip install marimo\nmarimo edit ${c}`,b;t[9]===y?b=t[10]:(b=(0,Q.jsx)(F,{value:`pip`,children:(0,Q.jsx)($,{command:y})}),t[9]=y,t[10]=b);let x=`conda install -c conda-forge marimo\nmarimo edit ${c}`,S;t[11]===x?S=t[12]:(S=(0,Q.jsx)(F,{value:`conda`,children:(0,Q.jsx)($,{command:x})}),t[11]=x,t[12]=S);let C;t[13]!==b||t[14]!==S||t[15]!==g?(C=(0,Q.jsxs)(re,{defaultValue:`uv`,children:[m,g,b,S]}),t[13]=b,t[14]=S,t[15]=g,t[16]=C):C=t[16];let w;t[17]!==n||t[18]!==a?(w=a&&(0,Q.jsx)(De,{code:n}),t[17]=n,t[18]=a,t[19]=w):w=t[19];let T;t[20]!==C||t[21]!==w||t[22]!==p?(T=(0,Q.jsx)(W,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`pt-3 text-left space-y-3`,children:[p,C,w]})}),t[20]=C,t[21]=w,t[22]=p,t[23]=T):T=t[23];let E;t[24]!==T||t[25]!==u?(E=(0,Q.jsxs)(U,{children:[u,T]}),t[24]=T,t[25]=u,t[26]=E):E=t[26];let D;t[27]===n?D=t[28]:(D=async()=>{await J(n),Y({title:`Copied to clipboard`})},t[27]=n,t[28]=D);let O;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(R,{className:`w-3 h-3 mr-2`}),t[29]=O):O=t[29];let k;t[30]===D?k=t[31]:(k=(0,Q.jsxs)(L,{"data-testid":`copy-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:D,children:[O,`Copy code`]}),t[30]=D,t[31]=k);let A;t[32]!==n||t[33]!==r?(A=()=>{te(new Blob([n],{type:`text/plain`}),r)},t[32]=n,t[33]=r,t[34]=A):A=t[34];let j;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(ee,{className:`w-3 h-3 mr-2`}),t[35]=j):j=t[35];let M;t[36]===A?M=t[37]:(M=(0,Q.jsxs)(L,{"data-testid":`download-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:A,children:[j,`Download`]}),t[36]=A,t[37]=M);let N;t[38]!==k||t[39]!==M?(N=(0,Q.jsxs)(`div`,{className:`flex gap-3 pt-2`,children:[k,M]}),t[38]=k,t[39]=M,t[40]=N):N=t[40];let I;return t[41]!==E||t[42]!==N?(I=(0,Q.jsxs)(H,{children:[l,(0,Q.jsxs)(G,{children:[E,N]})]}),t[41]=E,t[42]=N,t[43]=I):I=t[43],I};function Ee(e,t){let n=new URL(e);if(n.protocol!==`http:`&&n.protocol!==`https:`)return t;let r=n.pathname.endsWith(`.html`)&&n.search===``,i=n.protocol===`https:`&&(n.hostname===`marimo.app`||n.hostname===`links.marimo.app`||n.hostname===`static.marimo.app`&&n.pathname.startsWith(`/static`)||n.pathname.includes(`/notebooks/nb`));return!r&&!i?t:(n.hash=``,n.href)}var $=e=>{let t=(0,Z.c)(10),{command:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(`pre`,{className:`p-3 pr-10 font-mono text-(--sky-11) leading-relaxed whitespace-pre-wrap break-all`,children:n}),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=async()=>{await J(n),Y({title:`Command copied to clipboard`})},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(R,{className:`w-3.5 h-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Q.jsx)(L,{"aria-label":`Copy command`,className:`absolute right-2 top-2`,variant:`ghost`,size:`icon`,onClick:i,children:a}),t[5]=i,t[6]=o);let s;return t[7]!==r||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`relative rounded-lg border bg-(--sky-2) border-(--sky-7)`,children:[r,o]}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s},De=e=>{let t=(0,Z.c)(8),{code:n}=e,r;t[0]===n?r=t[1]:(r=le({code:n,baseUrl:`${v.molab}/new`}),t[0]=n,t[1]=r);let i=r,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(pe,{size:12,strokeWidth:1.5,className:`mr-1.5 mt-px text-(--grass-11)`}),t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Q.jsx)(L,{asChild:!0,variant:`outline`,size:`xs`,className:`shrink-0`,children:(0,Q.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open in molab`]})}),t[3]=i,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsxs)(`p`,{className:`text-sm text-(--sky-12)`,children:[`Run this notebook in `,(0,Q.jsx)(`span`,{className:`font-semibold`,children:`molab`}),`, marimo's cloud-hosted notebook platform.`]}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,Q.jsxs)(`div`,{className:`pt-3 border-t flex gap-2 items-center`,children:[o,s]}),t[6]=o,t[7]=c),c},Oe=e=>{let t=(0,Z.c)(17),n=r(fe).kind,i=n===`static`||n===`wasm`,{selectedLayout:a}=B(),o;t[0]===a?o=t[1]:(o=V({selectedLayout:a,isReading:!0,searchParams:new URLSearchParams(window.location.search)}),t[0]=a,t[1]=o);let s=i&&o===`slides`,c;t[2]===s?c=t[3]:(c=!s&&(0,Q.jsx)(we,{}),t[2]=s,t[3]=c);let l;t[4]!==s||t[5]!==e.appConfig?(l=(0,Q.jsx)(Se,{appConfig:e.appConfig,hideHeader:s}),t[4]=s,t[5]=e.appConfig,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==s?(u=i&&!s&&(0,Q.jsx)(ke,{}),t[7]=i,t[8]=s,t[9]=u):u=t[9];let d;t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(de,{children:[c,l,u]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(N,{}),t[14]=f):f=t[14];let p;return t[15]===d?p=t[16]:(p=(0,Q.jsx)(h,{children:(0,Q.jsxs)(ue,{direction:`horizontal`,autoSaveId:`marimo:chrome:v1:run1`,children:[d,f]})}),t[15]=d,t[16]=p),p},ke=()=>{let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`fixed bottom-0 right-0 z-50 print:hidden`,"data-testid":`watermark`,children:(0,Q.jsxs)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-sm text-(--grass-11) font-bold tracking-wide transition-colors bg-(--grass-4) hover:bg-(--grass-5) border-t border-l border-(--grass-8) px-3 py-1 rounded-tl-md flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:`made with marimo`}),(0,Q.jsx)(me,{className:`h-4 w-auto`})]})}),e[0]=t):t=e[0],t};export{Oe as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{D as a,La as o,g as s,oo as c,x as l}from"./cells-T9_Y4Jlv.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./panels-Cez8PgGB.js";import{t as g}from"./compiler-runtime-BrajqUja.js";import{C as _}from"./config-DGX7JYor.js";import{r as v}from"./utils-B4K466FK.js";import{t as y}from"./session-B8Y-GJnS.js";import{T as b,_ as x,l as S,p as C}from"./config-DzdxZb17.js";import{t as w}from"./cn-ldLVeaqm.js";import{t as T}from"./jsx-runtime-B74pBk57.js";import{a as E,c as D,i as O,l as k,n as A,s as j,t as M}from"./alert-dialog-C-sWmKva.js";import{F as N,Ft as ee}from"./JsonOutput-Pm6OCP3J.js";import{n as te}from"./download-C8Gw-D0Y.js";import{i as P,n as F,r as ne,t as re}from"./tabs-CY8E4r9U.js";import{n as I,t as L}from"./button-D8gVKwe-.js";import{n as ie}from"./paths-bkIFVj8h.js";import{t as ae}from"./arrow-left-BaPN-xbg.js";import{t as R}from"./copy-Djr5m5ac.js";import{t as oe}from"./house-CpsMWsLL.js";import{t as z}from"./spinner-DyNE-o8o.js";import{l as B,s as V}from"./readonly-python-code-B81AjzXM.js";import{Jt as H,Qt as U,Xt as W,Yt as G,nn as K,tn as q}from"./input-BZdRe7pb.js";import{n as J}from"./copy-KlhazlhB.js";import{t as Y}from"./use-toast-Wu434mLr.js";import{r as se}from"./requests-lt0JK8Jt.js";import{t as ce}from"./shell-Fj8a65ii.js";import{t as le}from"./share-BZW3tzEX.js";import{a as X}from"./cell-link-DFqfW-Ym.js";import{n as ue,t as de}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{n as fe}from"./code-visibility-CV3S4xuf.js";import{n as pe,t as me}from"./marimo-icons-CqliHyTr.js";import{t as he}from"./state-Ck7FMD5A.js";var ge=e(i(),1),Z=g(),Q=T(),_e=()=>{let e=(0,Z.c)(25),[n,r]=t(he);if(n===null)return null;let i;e[0]===n?i=e[1]:(i=async()=>{try{await navigator.clipboard.writeText(n),Y({title:`Copied to clipboard`,description:`Error details have been copied to your clipboard.`})}catch{Y({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},e[0]=n,e[1]=i);let a=i,o;e[2]===r?o=e[3]:(o=()=>{r(null)},e[2]=r,e[3]=o);let s=o,l=ve,u;e[4]===s?u=e[5]:(u=e=>!e&&s(),e[4]=s,e[5]=u);let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsxs)(D,{children:[(0,Q.jsxs)(k,{className:`flex items-center gap-2 text-destructive`,children:[(0,Q.jsx)(c,{className:`h-5 w-5`}),`Kernel Startup Failed`]}),(0,Q.jsx)(E,{children:`The kernel failed to start. This usually happens when the package manager can't install your notebook's dependencies.`})]}),e[6]=d):d=e[6];let f;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Error Details`}),e[7]=f):f=e[7];let p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(R,{className:`h-3 w-3`}),e[8]=p):p=e[8];let m;e[9]===a?m=e[10]:(m=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[f,(0,Q.jsxs)(L,{variant:`outline`,size:`xs`,onClick:a,className:`flex items-center gap-1`,children:[p,`Copy`]})]}),e[9]=a,e[10]=m);let h;e[11]===n?h=e[12]:(h=(0,Q.jsx)(`pre`,{className:`bg-muted p-4 rounded-md text-sm font-mono overflow-auto max-h-80`,children:n}),e[11]=n,e[12]=h);let g;e[13]!==m||e[14]!==h?(g=(0,Q.jsxs)(`div`,{className:`my-4 overflow-hidden`,children:[m,h]}),e[13]=m,e[14]=h,e[15]=g):g=e[15];let _;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsxs)(L,{variant:`outline`,onClick:l,className:`flex items-center gap-2`,children:[(0,Q.jsx)(oe,{className:`h-4 w-4`}),`Return to Home`]}),e[16]=_):_=e[16];let v;e[17]===s?v=e[18]:(v=(0,Q.jsxs)(j,{children:[_,(0,Q.jsx)(A,{onClick:s,children:`Dismiss`})]}),e[17]=s,e[18]=v);let y;e[19]!==v||e[20]!==g?(y=(0,Q.jsxs)(O,{className:`max-w-2xl`,children:[d,g,v]}),e[19]=v,e[20]=g,e[21]=y):y=e[21];let b;return e[22]!==y||e[23]!==u?(b=(0,Q.jsx)(M,{open:!0,onOpenChange:u,children:y}),e[22]=y,e[23]=u,e[24]=b):b=e[24],b};function ve(){let e=document.baseURI.split(`?`)[0];window.open(e,`_self`)}var ye=e=>{let t=(0,Z.c)(2),{reason:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`font-mono text-center text-base text-(--red-11)`,children:(0,Q.jsx)(`p`,{children:n})}),t[0]=n,t[1]=r),r},be=e=>{let t=(0,Z.c)(7),{connection:n,className:r,children:i}=e,a;t[0]!==n.reason||t[1]!==n.state?(a=n.state===b.CLOSED&&(0,Q.jsx)(ye,{reason:n.reason}),t[0]=n.reason,t[1]=n.state,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==r||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:r,children:[i,a]}),t[3]=i,t[4]=r,t[5]=a,t[6]=o):o=t[6],o},xe=n(e=>e(s)||!C(e(x).state)),Se=e=>{let t=(0,Z.c)(22),{appConfig:n,hideHeader:i}=e,{setCells:o}=a(),{sendComponentValues:s}=se(),c;t[0]===s?c=t[1]:(c=()=>(m.INSTANCE.start(s),Ce),t[0]=s,t[1]=c);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[2]=h):h=t[2],(0,ge.useEffect)(c,h);let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=y(),t[3]=g):g=t[3];let _;t[4]===o?_=t[5]:(_={autoInstantiate:!0,setCells:o,sessionId:g},t[4]=o,t[5]=_);let{connection:v,reconnect:b}=f(_),x=r(l),S;if(t[6]===Symbol.for(`react.memo_cache_sentinel`)){bb0:{if(typeof window>`u`){S=null;break bb0}let e=new URL(window.location.href);if(!e.searchParams.has(`file`)){S=null;break bb0}e.searchParams.delete(`file`);let t=e.searchParams.toString();S=t?`${e.pathname}?${t}`:e.pathname}t[6]=S}else S=t[6];let C=S,T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(_e,{}),t[7]=T):T=t[7];let E=i?`hidden`:`sm:pt-8`,D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=C&&(0,Q.jsx)(`div`,{className:`flex items-center px-6 pt-4 sm:-mt-8`,children:(0,Q.jsxs)(`a`,{href:C,"aria-label":`Back to gallery`,className:w(I({variant:`text`,size:`sm`}),`gap-2 px-0 text-muted-foreground hover:text-foreground`),children:[(0,Q.jsx)(ae,{className:`size-4`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:`Back`})]})}),t[8]=D):D=t[8];let O;t[9]!==v||t[10]!==E?(O=(0,Q.jsx)(be,{connection:v,className:E,children:D}),t[9]=v,t[10]=E,t[11]=O):O=t[11];let k;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{className:`mx-auto`}),(0,Q.jsx)(`p`,{className:`text-center text-sm text-muted-foreground mt-2`,children:`Connecting...`})]}),t[12]=k):k=t[12];let A;t[13]===n?A=t[14]:(A=(0,Q.jsx)(p,{requires:xe,delay:2e3,fallback:k,children:(0,Q.jsx)(d,{appConfig:n,mode:`read`})}),t[13]=n,t[14]=A);let j;return t[15]!==n.width||t[16]!==v||t[17]!==x||t[18]!==b||t[19]!==A||t[20]!==O?(j=(0,Q.jsxs)(u,{connection:v,isRunning:x,width:n.width,onReconnect:b,children:[T,O,A]}),t[15]=n.width,t[16]=v,t[17]=x,t[18]=b,t[19]=A,t[20]=O,t[21]=j):j=t[21],j};function Ce(){m.INSTANCE.stop()}var we=()=>{let e=(0,Z.c)(3),t=r(o);if(!S()||!t)return null;let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`span`,{children:[`Static`,` `,(0,Q.jsx)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) font-medium underline`,children:`marimo`}),` `,`notebook - Run or edit for full interactivity`]}),e[0]=n):n=e[0];let i;return e[1]===t?i=e[2]:(i=(0,Q.jsxs)(`div`,{className:`px-4 py-2 bg-(--sky-2) border-b border-(--sky-7) text-(--sky-11) flex justify-between items-center gap-4 print:hidden text-sm`,"data-testid":`static-notebook-banner`,children:[n,(0,Q.jsx)(`span`,{className:`shrink-0`,children:(0,Q.jsx)(Te,{code:t})})]}),e[1]=t,e[2]=i),i},Te=e=>{let t=(0,Z.c)(44),{code:n}=e,r=ie.basename(X()||`notebook.py`),[i]=_(),a=i.sharing?.molab??!0,o=Ee(window.location.href,r),s=o!==r,c=ce(o),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(L,{"data-testid":`static-notebook-dialog-trigger`,variant:`outline`,size:`xs`,children:`Run or Edit`})}),t[0]=l):l=t[0];let u;t[1]===r?u=t[2]:(u=(0,Q.jsx)(q,{children:r}),t[1]=r,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) hover:underline font-medium`,children:`marimo`}),t[3]=d):d=t[3];let f=s?`Run it`:`Download it, then run it`,p;t[4]===f?p=t[5]:(p=(0,Q.jsxs)(`p`,{children:[`This is a static`,` `,d,` `,`notebook. `,f,` `,`locally for full interactivity.`]}),t[4]=f,t[5]=p);let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsxs)(ne,{"aria-label":`Package manager`,children:[(0,Q.jsx)(P,{value:`uv`,children:`uv`}),(0,Q.jsx)(P,{value:`pip`,children:`pip`}),(0,Q.jsx)(P,{value:`conda`,children:`conda`})]}),t[6]=m):m=t[6];let h=`uvx marimo edit --sandbox ${c}`,g;t[7]===h?g=t[8]:(g=(0,Q.jsx)(F,{value:`uv`,children:(0,Q.jsx)($,{command:h})}),t[7]=h,t[8]=g);let y=`pip install marimo\nmarimo edit ${c}`,b;t[9]===y?b=t[10]:(b=(0,Q.jsx)(F,{value:`pip`,children:(0,Q.jsx)($,{command:y})}),t[9]=y,t[10]=b);let x=`conda install -c conda-forge marimo\nmarimo edit ${c}`,S;t[11]===x?S=t[12]:(S=(0,Q.jsx)(F,{value:`conda`,children:(0,Q.jsx)($,{command:x})}),t[11]=x,t[12]=S);let C;t[13]!==b||t[14]!==S||t[15]!==g?(C=(0,Q.jsxs)(re,{defaultValue:`uv`,children:[m,g,b,S]}),t[13]=b,t[14]=S,t[15]=g,t[16]=C):C=t[16];let w;t[17]!==n||t[18]!==a?(w=a&&(0,Q.jsx)(De,{code:n}),t[17]=n,t[18]=a,t[19]=w):w=t[19];let T;t[20]!==C||t[21]!==w||t[22]!==p?(T=(0,Q.jsx)(W,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`pt-3 text-left space-y-3`,children:[p,C,w]})}),t[20]=C,t[21]=w,t[22]=p,t[23]=T):T=t[23];let E;t[24]!==T||t[25]!==u?(E=(0,Q.jsxs)(U,{children:[u,T]}),t[24]=T,t[25]=u,t[26]=E):E=t[26];let D;t[27]===n?D=t[28]:(D=async()=>{await J(n),Y({title:`Copied to clipboard`})},t[27]=n,t[28]=D);let O;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(R,{className:`w-3 h-3 mr-2`}),t[29]=O):O=t[29];let k;t[30]===D?k=t[31]:(k=(0,Q.jsxs)(L,{"data-testid":`copy-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:D,children:[O,`Copy code`]}),t[30]=D,t[31]=k);let A;t[32]!==n||t[33]!==r?(A=()=>{te(new Blob([n],{type:`text/plain`}),r)},t[32]=n,t[33]=r,t[34]=A):A=t[34];let j;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(ee,{className:`w-3 h-3 mr-2`}),t[35]=j):j=t[35];let M;t[36]===A?M=t[37]:(M=(0,Q.jsxs)(L,{"data-testid":`download-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:A,children:[j,`Download`]}),t[36]=A,t[37]=M);let N;t[38]!==k||t[39]!==M?(N=(0,Q.jsxs)(`div`,{className:`flex gap-3 pt-2`,children:[k,M]}),t[38]=k,t[39]=M,t[40]=N):N=t[40];let I;return t[41]!==E||t[42]!==N?(I=(0,Q.jsxs)(H,{children:[l,(0,Q.jsxs)(G,{children:[E,N]})]}),t[41]=E,t[42]=N,t[43]=I):I=t[43],I};function Ee(e,t){let n=new URL(e);if(n.protocol!==`http:`&&n.protocol!==`https:`)return t;let r=n.pathname.endsWith(`.html`)&&n.search===``,i=n.protocol===`https:`&&(n.hostname===`marimo.app`||n.hostname===`links.marimo.app`||n.hostname===`static.marimo.app`&&n.pathname.startsWith(`/static`)||n.pathname.includes(`/notebooks/nb`));return!r&&!i?t:(n.hash=``,n.href)}var $=e=>{let t=(0,Z.c)(10),{command:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(`pre`,{className:`p-3 pr-10 font-mono text-(--sky-11) leading-relaxed whitespace-pre-wrap break-all`,children:n}),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=async()=>{await J(n),Y({title:`Command copied to clipboard`})},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(R,{className:`w-3.5 h-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Q.jsx)(L,{"aria-label":`Copy command`,className:`absolute right-2 top-2`,variant:`ghost`,size:`icon`,onClick:i,children:a}),t[5]=i,t[6]=o);let s;return t[7]!==r||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`relative rounded-lg border bg-(--sky-2) border-(--sky-7)`,children:[r,o]}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s},De=e=>{let t=(0,Z.c)(8),{code:n}=e,r;t[0]===n?r=t[1]:(r=le({code:n,baseUrl:`${v.molab}/new`}),t[0]=n,t[1]=r);let i=r,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(pe,{size:12,strokeWidth:1.5,className:`mr-1.5 mt-px text-(--grass-11)`}),t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Q.jsx)(L,{asChild:!0,variant:`outline`,size:`xs`,className:`shrink-0`,children:(0,Q.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open in molab`]})}),t[3]=i,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsxs)(`p`,{className:`text-sm text-(--sky-12)`,children:[`Run this notebook in `,(0,Q.jsx)(`span`,{className:`font-semibold`,children:`molab`}),`, marimo's cloud-hosted notebook platform.`]}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,Q.jsxs)(`div`,{className:`pt-3 border-t flex gap-2 items-center`,children:[o,s]}),t[6]=o,t[7]=c),c},Oe=e=>{let t=(0,Z.c)(17),n=r(fe).kind,i=n===`static`||n===`wasm`,{selectedLayout:a}=B(),o;t[0]===a?o=t[1]:(o=V({selectedLayout:a,isReading:!0,searchParams:new URLSearchParams(window.location.search)}),t[0]=a,t[1]=o);let s=i&&o===`slides`,c;t[2]===s?c=t[3]:(c=!s&&(0,Q.jsx)(we,{}),t[2]=s,t[3]=c);let l;t[4]!==s||t[5]!==e.appConfig?(l=(0,Q.jsx)(Se,{appConfig:e.appConfig,hideHeader:s}),t[4]=s,t[5]=e.appConfig,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==s?(u=i&&!s&&(0,Q.jsx)(ke,{}),t[7]=i,t[8]=s,t[9]=u):u=t[9];let d;t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(de,{children:[c,l,u]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(N,{}),t[14]=f):f=t[14];let p;return t[15]===d?p=t[16]:(p=(0,Q.jsx)(h,{children:(0,Q.jsxs)(ue,{direction:`horizontal`,autoSaveId:`marimo:chrome:v1:run1`,children:[d,f]})}),t[15]=d,t[16]=p),p},ke=()=>{let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`fixed bottom-0 right-0 z-50 print:hidden`,"data-testid":`watermark`,children:(0,Q.jsxs)(`a`,{href:v.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-sm text-(--grass-11) font-bold tracking-wide transition-colors bg-(--grass-4) hover:bg-(--grass-5) border-t border-l border-(--grass-8) px-3 py-1 rounded-tl-md flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:`made with marimo`}),(0,Q.jsx)(me,{className:`h-4 w-auto`})]})}),e[0]=t):t=e[0],t};export{Oe as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as ee,t as r,u as te}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{D as ne,I as re,Qr as a,Rt as ie,So as o,xo as ae}from"./cells-T9_Y4Jlv.js";import{t as s}from"./compiler-runtime-BrajqUja.js";import{C as oe}from"./config-DGX7JYor.js";import{_ as se}from"./useEventListener-CjDeLqFC.js";import{n as ce}from"./utils-B4K466FK.js";import{k as c}from"./config-DzdxZb17.js";import{t as le}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{n as ue}from"./JsonOutput-Pm6OCP3J.js";import{t as u}from"./tooltip-CkGm8X7m.js";import{t as d}from"./button-D8gVKwe-.js";import{t as f}from"./createLucideIcon-DfJ2oMlA.js";import{l as de}from"./layout-sYdHI-lW.js";import{n as fe,t as pe}from"./LazyAnyLanguageCodeMirror-BPYE76jR.js";import{s as me}from"./toDate-DOj9Q6uC.js";import{t as he}from"./cell-editor-3cVIcyHK.js";import{t as ge}from"./spinner-DyNE-o8o.js";import{i as _e}from"./useDeleteCell-BV4VemCv.js";import{r as ve}from"./requests-lt0JK8Jt.js";import{r as ye}from"./useTheme-DLtPc-39.js";import{n as be,r as xe,t as Se}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{a as Ce}from"./renderShortcut-H60uiHBp.js";import{n as we,r as Te}from"./panel-context-C2QXpKfx.js";import{t as Ee}from"./kiosk-mode-BGmMSc7A.js";var De=f(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Oe=f(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),p=e(i(),1),ke=s(),m=15,h=c(`marimo:scratchpadHistory:v1`,[],a),Ae=n(!1),je=n(null,(e,t,n)=>{if(n=n.trim(),!n)return;let ee=e(h);t(h,[n,...ee.filter(e=>e!==n)].slice(0,m))}),g=l(),Me={hide_code:!1,disabled:!1},_=()=>{let e=(0,ke.c)(60),n=re(),[i]=oe(),{theme:a}=ye(),s=(0,p.useRef)(null),c=ie(),{createNewCell:l,updateCellCode:f}=ne(),{sendRunScratchpad:m}=ve(),_=we(),v=Te(),y=n.cellRuntime[o],b=y?.output,x=y?.status,S=y?.consoleOutputs,C=n.cellData.__scratch__?.code??``,w=te(je),[T,E]=t(Ae),D=ee(h),O;e[0]!==w||e[1]!==C||e[2]!==m?(O=()=>{m({code:C}),w(C)},e[0]=w,e[1]=C,e[2]=m,e[3]=O):O=e[3];let k=r(O),A;e[4]!==C||e[5]!==l||e[6]!==c?(A=()=>{C.trim()&&l({code:C,before:!1,cellId:c??`__end__`})},e[4]=C,e[5]=l,e[6]=c,e[7]=A):A=e[7];let j=r(A),M;e[8]!==m||e[9]!==f?(M=()=>{f({cellId:o,code:``,formattingChange:!1}),m({code:``});let e=s.current;e&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:``}})},e[8]=m,e[9]=f,e[10]=M):M=e[10];let N=r(M),P;e[11]!==E||e[12]!==f?(P=e=>{E(!1),f({cellId:o,code:e,formattingChange:!1});let t=s.current;t&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}})},e[11]=E,e[12]=f,e[13]=P):P=e[13];let F=r(P),[I,Ne]=(0,p.useState)(),L;e[14]!==F||e[15]!==D||e[16]!==T||e[17]!==a?(L=()=>T?(0,g.jsx)(`div`,{className:`absolute inset-0 z-100 bg-background p-3 border-none overflow-auto`,children:(0,g.jsx)(`div`,{className:`overflow-auto flex flex-col gap-3`,children:D.map((e,t)=>(0,g.jsx)(`div`,{className:`border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden`,onClick:()=>F(e),children:(0,g.jsx)(p.Suspense,{children:(0,g.jsx)(pe,{language:`python`,theme:a,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:e.trim(),editable:!1,readOnly:!0})})},t))})}):null,e[14]=F,e[15]=D,e[16]=T,e[17]=a,e[18]=L):L=e[18];let R=L,z;e[19]!==N||e[20]!==j||e[21]!==k||e[22]!==D.length||e[23]!==T||e[24]!==E||e[25]!==x?(z=()=>(0,g.jsxs)(`div`,{className:`flex items-center shrink-0 border-b`,children:[(0,g.jsx)(u,{content:Ce(`cell.run`),children:(0,g.jsx)(d,{"data-testid":`scratchpad-run-button`,onClick:k,disabled:T,variant:`text`,size:`xs`,children:(0,g.jsx)(_e,{color:`var(--grass-11)`,size:16})})}),(0,g.jsx)(u,{content:`Clear code and outputs`,children:(0,g.jsx)(d,{disabled:T,size:`xs`,variant:`text`,onClick:N,children:(0,g.jsx)(De,{size:16})})}),(0,g.jsx)(Ee,{children:(0,g.jsx)(u,{content:`Insert code`,children:(0,g.jsx)(d,{disabled:T,size:`xs`,variant:`text`,onClick:j,children:(0,g.jsx)(fe,{size:16})})})}),(x===`running`||x===`queued`)&&(0,g.jsx)(ge,{className:`inline`,size:`small`}),(0,g.jsx)(`div`,{className:`flex-1`}),(0,g.jsx)(u,{content:`Toggle history`,children:(0,g.jsx)(d,{size:`xs`,variant:`text`,className:le(T&&`bg-(--sky-3) rounded-none`),onClick:()=>E(!T),disabled:D.length===0,children:(0,g.jsx)(Oe,{size:16})})}),(0,g.jsx)(u,{content:(0,g.jsx)(`span`,{className:`block max-w-prose`,children:`Use this scratchpad to experiment with code without restrictions on variable names. Variables defined here aren't saved to notebook memory, and the code is not saved in the notebook file.`}),children:(0,g.jsx)(d,{size:`xs`,variant:`text`,children:(0,g.jsx)(me,{size:16})})})]}),e[19]=N,e[20]=j,e[21]=k,e[22]=D.length,e[23]=T,e[24]=E,e[25]=x,e[26]=z):z=e[26];let B=z,Pe=_===`vertical`,V;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(V=ae.create(o),e[27]=V):V=e[27];let H;e[28]===B?H=e[29]:(H=B(),e[28]=B,e[29]=H);let U;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{s.current=e},e[30]=U):U=e[30];let W;e[31]!==C||e[32]!==k||e[33]!==I||e[34]!==a||e[35]!==i?(W=(0,g.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,g.jsx)(he,{theme:a,showPlaceholder:!1,id:o,code:C,config:Me,status:`idle`,serializedEditorState:null,runCell:k,userConfig:i,editorViewRef:s,setEditorView:U,hidden:!1,showHiddenCode:se.NOOP,languageAdapter:I,setLanguageAdapter:Ne})}),e[31]=C,e[32]=k,e[33]=I,e[34]=a,e[35]=i,e[36]=W):W=e[36];let G;e[37]===R?G=e[38]:(G=R(),e[37]=R,e[38]=G);let K;e[39]!==G||e[40]!==H||e[41]!==W?(K=(0,g.jsx)(Se,{defaultSize:40,minSize:20,maxSize:70,children:(0,g.jsxs)(`div`,{className:`h-full flex flex-col overflow-hidden relative`,children:[H,W,G]})}),e[39]=G,e[40]=H,e[41]=W,e[42]=K):K=e[42];let q=Pe?`h-1`:`w-1`,J;e[43]===q?J=e[44]:(J=le(`bg-border hover:bg-primary/50 transition-colors`,q),e[43]=q,e[44]=J);let Y;e[45]===J?Y=e[46]:(Y=(0,g.jsx)(xe,{className:J}),e[45]=J,e[46]=Y);let X;e[47]===b?X=e[48]:(X=(0,g.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,g.jsx)(ue,{allowExpand:!1,output:b,className:ce.outputArea,cellId:o,stale:!1,loading:!1})}),e[47]=b,e[48]=X);let Z;e[49]===S?Z=e[50]:(Z=(0,g.jsx)(`div`,{className:`overflow-auto shrink-0 max-h-[50%]`,children:(0,g.jsx)(de,{consoleOutputs:S,className:`overflow-auto`,stale:!1,interrupted:!1,cellName:`_`,onSubmitDebugger:se.NOOP,cellId:o,debuggerActive:!1})}),e[49]=S,e[50]=Z);let Q;e[51]!==X||e[52]!==Z?(Q=(0,g.jsx)(Se,{defaultSize:60,minSize:20,children:(0,g.jsxs)(`div`,{className:`h-full flex flex-col divide-y overflow-hidden`,children:[X,Z]})}),e[51]=X,e[52]=Z,e[53]=Q):Q=e[53];let $;return e[54]!==_||e[55]!==v||e[56]!==K||e[57]!==Y||e[58]!==Q?($=(0,g.jsx)(`div`,{className:`flex flex-col h-full overflow-hidden`,id:V,children:(0,g.jsxs)(be,{direction:_,className:`h-full`,children:[K,Y,Q]},v)}),e[54]=_,e[55]=v,e[56]=K,e[57]=Y,e[58]=Q,e[59]=$):$=e[59],$},v=()=>{let e=(0,ke.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,g.jsx)(_,{}),e[0]=t):t=e[0],t};export{v as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as ee,t as r,u as te}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{D as ne,I as re,Qr as a,Rt as ie,So as o,xo as ae}from"./cells-T9_Y4Jlv.js";import{t as s}from"./compiler-runtime-BrajqUja.js";import{C as oe}from"./config-DGX7JYor.js";import{_ as se}from"./useEventListener-CjDeLqFC.js";import{n as ce}from"./utils-B4K466FK.js";import{k as c}from"./config-DzdxZb17.js";import{t as le}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{n as ue}from"./JsonOutput-Pm6OCP3J.js";import{t as u}from"./tooltip-CkGm8X7m.js";import{t as d}from"./button-D8gVKwe-.js";import{t as f}from"./createLucideIcon-DfJ2oMlA.js";import{l as de}from"./layout-CGC8ajpe.js";import{n as fe,t as pe}from"./LazyAnyLanguageCodeMirror-BPYE76jR.js";import{s as me}from"./toDate-DOj9Q6uC.js";import{t as he}from"./cell-editor-M8dEnDzk.js";import{t as ge}from"./spinner-DyNE-o8o.js";import{i as _e}from"./useDeleteCell-BV4VemCv.js";import{r as ve}from"./requests-lt0JK8Jt.js";import{r as ye}from"./useTheme-DLtPc-39.js";import{n as be,r as xe,t as Se}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{a as Ce}from"./renderShortcut-H60uiHBp.js";import{n as we,r as Te}from"./panel-context-C2QXpKfx.js";import{t as Ee}from"./kiosk-mode-BGmMSc7A.js";var De=f(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Oe=f(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),p=e(i(),1),ke=s(),m=15,h=c(`marimo:scratchpadHistory:v1`,[],a),Ae=n(!1),je=n(null,(e,t,n)=>{if(n=n.trim(),!n)return;let ee=e(h);t(h,[n,...ee.filter(e=>e!==n)].slice(0,m))}),g=l(),Me={hide_code:!1,disabled:!1},_=()=>{let e=(0,ke.c)(60),n=re(),[i]=oe(),{theme:a}=ye(),s=(0,p.useRef)(null),c=ie(),{createNewCell:l,updateCellCode:f}=ne(),{sendRunScratchpad:m}=ve(),_=we(),v=Te(),y=n.cellRuntime[o],b=y?.output,x=y?.status,S=y?.consoleOutputs,C=n.cellData.__scratch__?.code??``,w=te(je),[T,E]=t(Ae),D=ee(h),O;e[0]!==w||e[1]!==C||e[2]!==m?(O=()=>{m({code:C}),w(C)},e[0]=w,e[1]=C,e[2]=m,e[3]=O):O=e[3];let k=r(O),A;e[4]!==C||e[5]!==l||e[6]!==c?(A=()=>{C.trim()&&l({code:C,before:!1,cellId:c??`__end__`})},e[4]=C,e[5]=l,e[6]=c,e[7]=A):A=e[7];let j=r(A),M;e[8]!==m||e[9]!==f?(M=()=>{f({cellId:o,code:``,formattingChange:!1}),m({code:``});let e=s.current;e&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:``}})},e[8]=m,e[9]=f,e[10]=M):M=e[10];let N=r(M),P;e[11]!==E||e[12]!==f?(P=e=>{E(!1),f({cellId:o,code:e,formattingChange:!1});let t=s.current;t&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}})},e[11]=E,e[12]=f,e[13]=P):P=e[13];let F=r(P),[I,Ne]=(0,p.useState)(),L;e[14]!==F||e[15]!==D||e[16]!==T||e[17]!==a?(L=()=>T?(0,g.jsx)(`div`,{className:`absolute inset-0 z-100 bg-background p-3 border-none overflow-auto`,children:(0,g.jsx)(`div`,{className:`overflow-auto flex flex-col gap-3`,children:D.map((e,t)=>(0,g.jsx)(`div`,{className:`border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden`,onClick:()=>F(e),children:(0,g.jsx)(p.Suspense,{children:(0,g.jsx)(pe,{language:`python`,theme:a,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:e.trim(),editable:!1,readOnly:!0})})},t))})}):null,e[14]=F,e[15]=D,e[16]=T,e[17]=a,e[18]=L):L=e[18];let R=L,z;e[19]!==N||e[20]!==j||e[21]!==k||e[22]!==D.length||e[23]!==T||e[24]!==E||e[25]!==x?(z=()=>(0,g.jsxs)(`div`,{className:`flex items-center shrink-0 border-b`,children:[(0,g.jsx)(u,{content:Ce(`cell.run`),children:(0,g.jsx)(d,{"data-testid":`scratchpad-run-button`,onClick:k,disabled:T,variant:`text`,size:`xs`,children:(0,g.jsx)(_e,{color:`var(--grass-11)`,size:16})})}),(0,g.jsx)(u,{content:`Clear code and outputs`,children:(0,g.jsx)(d,{disabled:T,size:`xs`,variant:`text`,onClick:N,children:(0,g.jsx)(De,{size:16})})}),(0,g.jsx)(Ee,{children:(0,g.jsx)(u,{content:`Insert code`,children:(0,g.jsx)(d,{disabled:T,size:`xs`,variant:`text`,onClick:j,children:(0,g.jsx)(fe,{size:16})})})}),(x===`running`||x===`queued`)&&(0,g.jsx)(ge,{className:`inline`,size:`small`}),(0,g.jsx)(`div`,{className:`flex-1`}),(0,g.jsx)(u,{content:`Toggle history`,children:(0,g.jsx)(d,{size:`xs`,variant:`text`,className:le(T&&`bg-(--sky-3) rounded-none`),onClick:()=>E(!T),disabled:D.length===0,children:(0,g.jsx)(Oe,{size:16})})}),(0,g.jsx)(u,{content:(0,g.jsx)(`span`,{className:`block max-w-prose`,children:`Use this scratchpad to experiment with code without restrictions on variable names. Variables defined here aren't saved to notebook memory, and the code is not saved in the notebook file.`}),children:(0,g.jsx)(d,{size:`xs`,variant:`text`,children:(0,g.jsx)(me,{size:16})})})]}),e[19]=N,e[20]=j,e[21]=k,e[22]=D.length,e[23]=T,e[24]=E,e[25]=x,e[26]=z):z=e[26];let B=z,Pe=_===`vertical`,V;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(V=ae.create(o),e[27]=V):V=e[27];let H;e[28]===B?H=e[29]:(H=B(),e[28]=B,e[29]=H);let U;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{s.current=e},e[30]=U):U=e[30];let W;e[31]!==C||e[32]!==k||e[33]!==I||e[34]!==a||e[35]!==i?(W=(0,g.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,g.jsx)(he,{theme:a,showPlaceholder:!1,id:o,code:C,config:Me,status:`idle`,serializedEditorState:null,runCell:k,userConfig:i,editorViewRef:s,setEditorView:U,hidden:!1,showHiddenCode:se.NOOP,languageAdapter:I,setLanguageAdapter:Ne})}),e[31]=C,e[32]=k,e[33]=I,e[34]=a,e[35]=i,e[36]=W):W=e[36];let G;e[37]===R?G=e[38]:(G=R(),e[37]=R,e[38]=G);let K;e[39]!==G||e[40]!==H||e[41]!==W?(K=(0,g.jsx)(Se,{defaultSize:40,minSize:20,maxSize:70,children:(0,g.jsxs)(`div`,{className:`h-full flex flex-col overflow-hidden relative`,children:[H,W,G]})}),e[39]=G,e[40]=H,e[41]=W,e[42]=K):K=e[42];let q=Pe?`h-1`:`w-1`,J;e[43]===q?J=e[44]:(J=le(`bg-border hover:bg-primary/50 transition-colors`,q),e[43]=q,e[44]=J);let Y;e[45]===J?Y=e[46]:(Y=(0,g.jsx)(xe,{className:J}),e[45]=J,e[46]=Y);let X;e[47]===b?X=e[48]:(X=(0,g.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,g.jsx)(ue,{allowExpand:!1,output:b,className:ce.outputArea,cellId:o,stale:!1,loading:!1})}),e[47]=b,e[48]=X);let Z;e[49]===S?Z=e[50]:(Z=(0,g.jsx)(`div`,{className:`overflow-auto shrink-0 max-h-[50%]`,children:(0,g.jsx)(de,{consoleOutputs:S,className:`overflow-auto`,stale:!1,interrupted:!1,cellName:`_`,onSubmitDebugger:se.NOOP,cellId:o,debuggerActive:!1})}),e[49]=S,e[50]=Z);let Q;e[51]!==X||e[52]!==Z?(Q=(0,g.jsx)(Se,{defaultSize:60,minSize:20,children:(0,g.jsxs)(`div`,{className:`h-full flex flex-col divide-y overflow-hidden`,children:[X,Z]})}),e[51]=X,e[52]=Z,e[53]=Q):Q=e[53];let $;return e[54]!==_||e[55]!==v||e[56]!==K||e[57]!==Y||e[58]!==Q?($=(0,g.jsx)(`div`,{className:`flex flex-col h-full overflow-hidden`,id:V,children:(0,g.jsxs)(be,{direction:_,className:`h-full`,children:[K,Y,Q]},v)}),e[54]=_,e[55]=v,e[56]=K,e[57]=Y,e[58]=Q,e[59]=$):$=e[59],$},v=()=>{let e=(0,ke.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,g.jsx)(_,{}),e[0]=t):t=e[0],t};export{v as default};