@marimo-team/frontend 0.25.3-dev85 → 0.25.3-dev88

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 (29) hide show
  1. package/dist/assets/{JsonOutput-3NheuQEt.js → JsonOutput-DryOywaN.js} +4 -4
  2. package/dist/assets/{agent-panel-BCCe7-0m.js → agent-panel-6t16-QG0.js} +1 -1
  3. package/dist/assets/{cell-editor-B6Wvf232.js → cell-editor-CM_kQ_VW.js} +1 -1
  4. package/dist/assets/{column-preview-BNPxoRnw.js → column-preview-CqFSXTtf.js} +1 -1
  5. package/dist/assets/{command-palette-CFLLUKbE.js → command-palette-CkDj29px.js} +1 -1
  6. package/dist/assets/{edit-page-Bh44QoBu.js → edit-page-Bgkov1Jy.js} +4 -4
  7. package/dist/assets/{file-explorer-panel-CAq2LZFc.js → file-explorer-panel-B9jBSwhj.js} +1 -1
  8. package/dist/assets/{hooks-BPw6SVXo.js → hooks-yjSoxKTw.js} +1 -1
  9. package/dist/assets/{index-D2O1B6ZY.js → index-0pnwTVch.js} +3 -3
  10. package/dist/assets/index-BnhSnwvB.css +2 -0
  11. package/dist/assets/{layout-NkCTvSyj.js → layout-B2MJFBFp.js} +3 -3
  12. package/dist/assets/{panels-CiR0Zzhg.js → panels-DI8gAi31.js} +1 -1
  13. package/dist/assets/{reveal-component-D2xhcDzw.js → reveal-component-BoGgZrdo.js} +1 -1
  14. package/dist/assets/{run-page-B9Jb5LMt.js → run-page-DnvqkxCy.js} +1 -1
  15. package/dist/assets/{scratchpad-panel-B_xrdEvJ.js → scratchpad-panel-DZDmNIPw.js} +1 -1
  16. package/dist/assets/{session-panel-DwuCGJU1.js → session-panel-B1QB5LN7.js} +1 -1
  17. package/dist/assets/{useNotebookActions-DNuGk3m2.js → useNotebookActions-DJuAUAGI.js} +1 -1
  18. package/dist/index.html +4 -4
  19. package/package.json +1 -1
  20. package/src/components/data-table/__tests__/columns.test.tsx +105 -0
  21. package/src/components/data-table/__tests__/search-highlight.test.tsx +109 -0
  22. package/src/components/data-table/__tests__/url-detector.test.tsx +74 -0
  23. package/src/components/data-table/columns.tsx +43 -45
  24. package/src/components/data-table/data-table.tsx +7 -1
  25. package/src/components/data-table/search-highlight.tsx +79 -0
  26. package/src/components/data-table/types.ts +1 -0
  27. package/src/components/data-table/url-detector.tsx +49 -9
  28. package/src/css/globals.css +2 -0
  29. package/dist/assets/index-BdsOMJac.css +0 -2
@@ -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 te,Kn as ne,Mr as re,Oo as ie,Ot as ae,R as oe,So as se,St as ce,T as le,Vi as ue,Wn as de,b as fe,ei as pe,g as me,h as he,l as ge,mr as _e,pr as ve,qn as ye,r as be}from"./cells-DfF1DLV_.js";import{C as _,E as v,F as y,I as b,K as xe,N as x,O as Se,R as S,S as C,V as Ce,b as w,c as T,v as E,z as D}from"./schemas-ChRqMOTL.js";import{t as we}from"./compiler-runtime-BrajqUja.js";import{D as Te,d as Ee,w as De}from"./config-DGX7JYor.js";import{c as Oe,i as ke,n as Ae,o as je,p as O,r as Me,s as Ne,t as Pe}from"./state-DUP4ToPd.js";import{g as k,t as A}from"./useEventListener-CjDeLqFC.js";import{t as j}from"./objects-rLPlQ3X_.js";import{i as Fe}from"./utils-B4K466FK.js";import{a as M,f as Ie,m as Le,r as Re,v as ze}from"./session-B8Y-GJnS.js";import{M as Be,T as N,_ as Ve,l as He,o as Ue,w as P,x as We}from"./config-BWKfkUWA.js";import{r as Ge}from"./state-C0irhlOZ.js";import{i as Ke,o as qe,r as Je}from"./state-DaWgt-rn.js";import{r as Ye}from"./ErrorBoundary-BKQo68Df.js";import{n as F,t as I}from"./cn-ldLVeaqm.js";import{t as Xe}from"./jsx-runtime-B74pBk57.js";import{i as L,s as R}from"./fullscreen-BWTs8pYZ.js";import{a as z,c as B,i as V,l as Ze,n as H,o as U,r as Qe,s as $e}from"./use-restore-focus-DdS7Tl0F.js";import{Dt as et,Et as tt,xt as nt}from"./JsonOutput-3NheuQEt.js";import{p as rt}from"./download-CMTzX3rG.js";import{t as it}from"./tooltip-CkGm8X7m.js";import{t as at}from"./button-D8gVKwe-.js";import{t as ot}from"./createLucideIcon-DfJ2oMlA.js";import{P as st,a as ct,c as lt,i as ut,n as dt}from"./layout-NkCTvSyj.js";import{d as ft,n as pt}from"./markdown-renderer-CkN_xAjW.js";import{v as mt}from"./write-secret-modal-7DzehGyr.js";import{n as ht}from"./spinner-DyNE-o8o.js";import{c as gt,l as _t,s as vt}from"./readonly-python-code-DeBED4OB.js";import{s as yt}from"./MarimoErrorOutput-XrTcOYTI.js";import{t as bt}from"./use-toast-Wu434mLr.js";import{i as xt}from"./strings-C25fhMR_.js";import{t as St}from"./requests-lt0JK8Jt.js";import{t as Ct}from"./useDebounce-k9QTpQ9-.js";import{n as wt}from"./useAsyncData-DhhdOGGd.js";import{t as Tt}from"./RenderHTML-DaVbCAsb.js";import{t as Et}from"./package-data-dv4FBHxR.js";import{f as Dt}from"./useInstallPackage-CWcPxSLP.js";import{a as Ot}from"./errors-CNsgAw6m.js";import{s as kt}from"./react-icons.esm-D6tfmvq8.js";import{r as At}from"./events-CbeVJ6OD.js";import{i as jt}from"./cell-link-D8EbRFJJ.js";import{t as Mt}from"./useDelayElapsed-BlsDT4TV.js";import{t as Nt}from"./requests-CgSY1X4a.js";import{r as Pt,s as Ft,t as It}from"./state-Ck7FMD5A.js";import{n as Lt}from"./runs-6lJxKV1w.js";function W(e){return xe(T,e)}var Rt=ot(`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`}]]),zt=ot(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Bt=ot(`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`}]]),G=e(c(),1),K=we(),q=Xe(),Vt=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=Mt(c?0:s);return c?a:l?o:null},Ht=e=>{let t=(0,K.c)(6),{title:n}=e,r=Ct(n,300),i=n===r,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(ht,{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=I(`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,q.jsxs)(`div`,{className:`flex flex-col h-full flex-1 items-center justify-center p-4`,children:[a,(0,q.jsx)(`div`,{className:s,children:r})]}),t[3]=r,t[4]=s,t[5]=c):c=t[5],c};function Ut(e,t){return e===`edit`||e===`home`||e===`gallery`?!0:e===`present`||M(Fe.includeCode,`false`)||M(Fe.showCode,`false`)?!1:M(Fe.showCode,`true`)?!0:t}function Wt(e){let t=Ut(e.mode,e.showAppCode),n=e.hasCells&&e.hasCachedOutputs;return{showCode:t,showCachedOutputs:n,canPaint:e.hasCells&&(t||n||e.allCellsIdle)}}var Gt=r(e=>{let t=!1,n=!0;for(let r of Object.values(e(fe).cellRuntime))pt(r.output)||(t=!0),r.status!==`idle`&&(n=!1);return{hasCachedOutputs:t,allCellsIdle:n}}),Kt=r(e=>e(Gt).hasCachedOutputs),qt=r(e=>e(Gt).allCellsIdle),Jt=r(e=>Wt({mode:e(Ie),showAppCode:e(Ge),hasCells:e(me),hasCachedOutputs:e(Kt),allCellsIdle:e(qt)})),Yt=r(e=>e(Jt).canPaint),Xt=e=>{let t=(0,K.c)(2),{children:n}=e;if(!Be())return n;let r;return t[0]===n?r=t[1]:(r=(0,q.jsx)(Zt,{children:n}),t[0]=n,t[1]=r),r},Zt=e=>{let t=(0,K.c)(8),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let{error:a}=wt($t,r),o=i(Yt),s=(0,G.useRef)(!1),c,l;if(t[1]!==o||t[2]!==a?(c=()=>{a&&o&&!s.current&&(s.current=!0,k.error(`Pyodide failed to initialize`,a),bt({title:`Failed to start the notebook runtime`,description:Ot(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,G.useEffect)(c,l),a&&!o)throw a;let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(Qt,{}),t[5]=u):u=t[5];let d;return t[6]===n?d=t[7]:(d=(0,q.jsx)(Vt,{requires:Yt,fallback:u,children:n}),t[6]=n,t[7]=d),d},Qt=()=>{let e=(0,K.c)(2),t=i(qe),n=t.kind===`loading`?t.message:`Loading…`,r;return e[0]===n?r=e[1]:(r=(0,q.jsx)(Ht,{title:n}),e[0]=n,e[1]=r),r};async function $t(){return await O.INSTANCE.initialized.promise,!0}var en={idle:`./favicon.ico`,success:`data:image/x-icon;base64,AAABAAEAMDAAAAEACACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAAAkAAAAAAAAAAAAAAAEAAAABAAAAAAAAXXQAAFd3AwBWeAQAVngEAFd4AwBXeAQAVnkEAFh3AwBXdwQAVXcGAFd4BQBXeAQAWHgEAFd6AwBXeAMAVnkEAFZ5AwBXdwQAV3cFAFd4BABYeAQAV3gEAFh4BABXeAQA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAgMEBQYZGQYFBAMCAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP//gAH//wAA//4AAH//AAD/+AAAH/8AAP/gAAAH/wAA/8AAAAP/AAD/gAAAAf8AAP8AAAAA/wAA/gAAAAB/AAD8AAAAAD8AAPgAAAAAHwAA+AAAAAAfAADwAAAAAA8AAPAAAAAADwAA4AAAAAAHAADgAAAAAAcAAMAAAAAAAwAAwAAAAAADAADAAAAAAAMAAMAAAAAAAwAAwAAAAAADAADAAAAAAAMAAMAAAAAAAwAAwAAAAAADAADAAAAAAAMAAMAAAAAAAwAAwAAAAAADAADAAAAAAAMAAMAAAAAAAwAAwAAAAAADAADgAAAAAAcAAOAAAAAABwAA8AAAAAAPAADwAAAAAA8AAPgAAAAAHwAA+AAAAAAfAAD8AAAAAD8AAP4AAAAAfwAA/wAAAAD/AAD/gAAAAf8AAP/AAAAD/wAA/+AAAAf/AAD/+AAAH/8AAP/+AAB//wAA//+AAf//AAD///////8AAP///////wAA`};function tn(){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 nn(e){if(document.visibilityState===`visible`)return;let t=()=>{e===0?new Notification(`Execution completed`,{body:`Your notebook run completed successfully.`,icon:en.success}):new Notification(`Execution failed`,{body:`Your notebook run encountered ${e} error(s).`,icon:en.error})};!(`Notification`in window)||Notification.permission===`denied`||(Notification.permission===`granted`?t():Notification.permission==="default"&&Notification.requestPermission().then(e=>{e===`granted`&&t()}))}var rn=e=>{let t=(0,K.c)(11),{isRunning:n}=e,r=i(be),a,o;t[0]!==n||t[1]!==r?(a=()=>{let e=tn();if(!n&&e.href.includes(`favicon`)||(e.href=en[n?`running`:r===0?`success`:`error`],!document.hasFocus()))return;let t=setTimeout(()=>{e.href=en.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,G.useEffect)(a,o);let s=st(n)??n,c,l;t[4]!==n||t[5]!==r||t[6]!==s?(c=()=>{s&&!n&&nn(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,G.useEffect)(c,l);let u;return t[9]===n?u=t[10]:(u=()=>{if(!n){let e=tn();e.href=en.idle}},t[9]=n,t[10]=u),A(window,`focus`,u),null};function an(){let{cellIds:e,cellRuntime:t}=a.get(fe),n=e.inOrderIds.find(e=>t[e]?.status===`running`);n&&jt(n,`focus`)}var on=e=>{let t=(0,K.c)(18),{connection:n,isRunning:r,onReconnect:a}=e,{mode:o}=i(ze),s=n.state===N.CLOSED&&(o===`read`||n.code!==P.KERNEL_STARTUP_ERROR),c=n.state===N.OPEN,l=s&&n.code===P.KERNEL_DISCONNECTED,u;t[0]===s?u=t[1]:(u=s&&(0,q.jsx)(un,{}),t[0]=s,t[1]=u);let d=o===`read`?`fixed`:`absolute`,f;t[2]===d?f=t[3]:(f=I(`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,q.jsx)(ln,{}),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,q.jsx)(cn,{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,q.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,q.jsxs)(q.Fragment,{children:[u,h]}),t[15]=u,t[16]=h,t[17]=g):g=t[17],g},sn=`print:hidden pointer-events-auto hover:cursor-pointer`,cn=e=>{let t=(0,K.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=I(sn,`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,q.jsx)(Bt,{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,q.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,q.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,q.jsx)(it,{content:i,children:u}),t[9]=i,t[10]=u,t[11]=d):d=t[11],d},ln=()=>{let e=(0,K.c)(6),t=i(le),n=t?`Scratchpad is running`:`Jump to running cell`,r=t?void 0:an,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(Rt,{className:`running-app-icon`,size:30,strokeWidth:1}),e[0]=a):a=e[0];let o;e[1]===r?o=e[2]:(o=(0,q.jsx)(`div`,{className:sn,"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,q.jsx)(it,{content:n,side:`right`,children:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5],s},un=()=>{let e=(0,K.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`noise`}),(0,q.jsx)(`div`,{className:`disconnected-gradient`})]}),e[0]=t):t=e[0],t},dn=H,fn=Ze,pn=L($e),mn=G.forwardRef((e,t)=>{let n=(0,K.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=I(`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,q.jsx)(U,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});mn.displayName=U.displayName;var hn=F(`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`}}),gn=G.forwardRef((e,t)=>{let n=(0,K.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,q.jsx)(mn,{}),n[5]=c):c=n[5];let l;n[6]!==i||n[7]!==s?(l=I(hn({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,q.jsxs)(Qe,{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,q.jsx)(kt,{className:`h-4 w-4`}),(0,q.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,q.jsx)(pn,{children:(0,q.jsxs)(R,{children:[c,(0,q.jsxs)(V,{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});gn.displayName=V.displayName;var _n=G.forwardRef((e,t)=>{let n=(0,K.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=I(`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,q.jsx)(B,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});_n.displayName=B.displayName;var vn=G.forwardRef((e,t)=>{let n=(0,K.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=I(`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,q.jsx)(z,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});vn.displayName=z.displayName;var yn=(0,G.memo)(()=>{let e=(0,K.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(tt,{name:nt.SIDEBAR}),e[0]=t):t=e[0],t});yn.displayName=`SidebarSlot`;var bn=e=>{let t=(0,K.c)(6),{openWidth:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,q.jsx)(fn,{className:`lg:hidden`,asChild:!0,children:(0,q.jsx)(at,{variant:`ghost`,className:`bg-background`,children:(0,q.jsx)(zt,{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,q.jsx)(yn,{}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,q.jsxs)(dn,{children:[r,(0,q.jsx)(gn,{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},xn=e=>{let t=(0,K.c)(7),{isOpen:n,toggle:r}=e,i=n?`rotate-0`:`rotate-180`,a;t[0]===i?a=t[1]:(a=I(`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,q.jsx)(rt,{className:a}),t[2]=a,t[3]=o);let s;return t[4]!==o||t[5]!==r?(s=(0,q.jsx)(`div`,{className:`invisible lg:visible absolute top-[12px] right-[16px] z-20`,children:(0,q.jsx)(at,{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},Sn=e=>{let t=(0,K.c)(11),{isOpen:n,toggle:r,width:i}=e,a=n?i:Pe,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=I(`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,q.jsx)(xn,{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,q.jsx)(`div`,{className:`relative h-full flex flex-col px-3 pb-16 pt-14 overflow-y-auto shadow-sm border-l`,children:(0,q.jsx)(yn,{})}),t[6]=l):l=t[6];let u;return t[7]!==n||t[8]!==o||t[9]!==c?(u=(0,q.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},Cn=e=>{let n=(0,K.c)(15),{children:r}=e,[i,a]=t(Me),{isOpen:o,width:s}=i;if(et(nt.SIDEBAR).length===0)return r;let c;n[0]===s?c=n[1]:(c=Ae(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,q.jsx)(Sn,{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,q.jsx)(`div`,{className:`absolute top-3 left-4 flex items-center z-50`,children:(0,q.jsx)(bn,{openWidth:l})}),n[9]=l,n[10]=f);let p;return n[11]!==r||n[12]!==d||n[13]!==f?(p=(0,q.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},wn=e=>{let t=(0,K.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,q.jsx)(rn,{isRunning:i}),t[0]=i,t[1]=c);let l;t[2]!==r||t[3]!==i||t[4]!==o?(l=(0,q.jsx)(on,{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===N.CLOSED&&r.code!==P.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=I(`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,q.jsx)(Xt,{children:(0,q.jsx)(Cn,{children:(0,q.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,q.jsxs)(q.Fragment,{children:[c,l,m]}),t[15]=c,t[16]=l,t[17]=m,t[18]=h):h=t[18],h},Tn=(0,G.memo)(e=>{let t=(0,K.c)(9),{appConfig:n,mode:r,children:a}=e,{selectedLayout:o}=_t();if(!i(Le)&&(r===`edit`||r===`present`&&o===`vertical`))return a;let s=r===`read`,c;t[0]!==o||t[1]!==s?(c=vt({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=ct.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,q.jsx)(En,{appConfig:n,mode:r,plugin:d}),t[5]=n,t[6]=r,t[7]=d,t[8]=f):f=t[8],f});Tn.displayName=`CellsRenderer`;var En=e=>{let t=(0,K.c)(12),{appConfig:n,mode:r,plugin:i}=e,a=_t(),o=g(),{setCurrentLayoutData:s}=gt(),c,l;t[0]!==a||t[1]!==o||t[2]!==i?(c=ge(o),l=ut({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,q.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},Dn=class e{hasStarted=!1;static get INSTANCE(){let t=`_marimo_private_RuntimeState`;return window[t]||(window[t]=new e(je)),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){k.warn(`RuntimeState already started`);return}this._sendComponentValues=e,document.addEventListener(At.TYPE,this.handleReadyEvent),this.hasStarted=!0}stop(){if(!this.hasStarted){k.warn(`RuntimeState already stopped`);return}document.removeEventListener(At.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=>{k.warn(e)})}},On=b().min(1).describe(`Identifies a project. Unique within the host and unchanged while the project exists.`),J=b().min(1).describe(`Identifies a notebook. Unique within the host and unchanged while the notebook exists.`),kn=b().min(1).describe(`Identifies a runtime. Unique within the host; every start and restart creates a new id.`),An=b().min(1).describe(`Identifies an attachment. Unique within the host.`),jn=b().min(1).describe("Identifies a run independently of the request's `Idempotency-Key`. Events carry the key in `request_id`."),Y=b().min(1).describe(`Identifies an execution. Unique within the host.`),Mn=b().min(1).describe(`Identifies a console, display, or variable item. Unique within the host; sending an item again with the same id replaces it.`),X=b().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."),Nn=x({pid:v().min(1).describe(`The process id.`),started_at:W({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");x({version:Se(1).describe(`The version of this record's format. This document describes version 1.`),process:Nn,name:b().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:b().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:b().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 te,Kn as ne,Mr as re,Oo as ie,Ot as ae,R as oe,So as se,St as ce,T as le,Vi as ue,Wn as de,b as fe,ei as pe,g as me,h as he,l as ge,mr as _e,pr as ve,qn as ye,r as be}from"./cells-DfF1DLV_.js";import{C as _,E as v,F as y,I as b,K as xe,N as x,O as Se,R as S,S as C,V as Ce,b as w,c as T,v as E,z as D}from"./schemas-ChRqMOTL.js";import{t as we}from"./compiler-runtime-BrajqUja.js";import{D as Te,d as Ee,w as De}from"./config-DGX7JYor.js";import{c as Oe,i as ke,n as Ae,o as je,p as O,r as Me,s as Ne,t as Pe}from"./state-DUP4ToPd.js";import{g as k,t as A}from"./useEventListener-CjDeLqFC.js";import{t as j}from"./objects-rLPlQ3X_.js";import{i as Fe}from"./utils-B4K466FK.js";import{a as M,f as Ie,m as Le,r as Re,v as ze}from"./session-B8Y-GJnS.js";import{M as Be,T as N,_ as Ve,l as He,o as Ue,w as P,x as We}from"./config-BWKfkUWA.js";import{r as Ge}from"./state-C0irhlOZ.js";import{i as Ke,o as qe,r as Je}from"./state-DaWgt-rn.js";import{r as Ye}from"./ErrorBoundary-BKQo68Df.js";import{n as F,t as I}from"./cn-ldLVeaqm.js";import{t as Xe}from"./jsx-runtime-B74pBk57.js";import{i as L,s as R}from"./fullscreen-BWTs8pYZ.js";import{a as z,c as B,i as V,l as Ze,n as H,o as U,r as Qe,s as $e}from"./use-restore-focus-DdS7Tl0F.js";import{Dt as et,Et as tt,xt as nt}from"./JsonOutput-DryOywaN.js";import{p as rt}from"./download-CMTzX3rG.js";import{t as it}from"./tooltip-CkGm8X7m.js";import{t as at}from"./button-D8gVKwe-.js";import{t as ot}from"./createLucideIcon-DfJ2oMlA.js";import{P as st,a as ct,c as lt,i as ut,n as dt}from"./layout-B2MJFBFp.js";import{d as ft,n as pt}from"./markdown-renderer-CkN_xAjW.js";import{v as mt}from"./write-secret-modal-7DzehGyr.js";import{n as ht}from"./spinner-DyNE-o8o.js";import{c as gt,l as _t,s as vt}from"./readonly-python-code-DeBED4OB.js";import{s as yt}from"./MarimoErrorOutput-XrTcOYTI.js";import{t as bt}from"./use-toast-Wu434mLr.js";import{i as xt}from"./strings-C25fhMR_.js";import{t as St}from"./requests-lt0JK8Jt.js";import{t as Ct}from"./useDebounce-k9QTpQ9-.js";import{n as wt}from"./useAsyncData-DhhdOGGd.js";import{t as Tt}from"./RenderHTML-DaVbCAsb.js";import{t as Et}from"./package-data-dv4FBHxR.js";import{f as Dt}from"./useInstallPackage-CWcPxSLP.js";import{a as Ot}from"./errors-CNsgAw6m.js";import{s as kt}from"./react-icons.esm-D6tfmvq8.js";import{r as At}from"./events-CbeVJ6OD.js";import{i as jt}from"./cell-link-D8EbRFJJ.js";import{t as Mt}from"./useDelayElapsed-BlsDT4TV.js";import{t as Nt}from"./requests-CgSY1X4a.js";import{r as Pt,s as Ft,t as It}from"./state-Ck7FMD5A.js";import{n as Lt}from"./runs-6lJxKV1w.js";function W(e){return xe(T,e)}var Rt=ot(`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`}]]),zt=ot(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Bt=ot(`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`}]]),G=e(c(),1),K=we(),q=Xe(),Vt=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=Mt(c?0:s);return c?a:l?o:null},Ht=e=>{let t=(0,K.c)(6),{title:n}=e,r=Ct(n,300),i=n===r,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(ht,{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=I(`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,q.jsxs)(`div`,{className:`flex flex-col h-full flex-1 items-center justify-center p-4`,children:[a,(0,q.jsx)(`div`,{className:s,children:r})]}),t[3]=r,t[4]=s,t[5]=c):c=t[5],c};function Ut(e,t){return e===`edit`||e===`home`||e===`gallery`?!0:e===`present`||M(Fe.includeCode,`false`)||M(Fe.showCode,`false`)?!1:M(Fe.showCode,`true`)?!0:t}function Wt(e){let t=Ut(e.mode,e.showAppCode),n=e.hasCells&&e.hasCachedOutputs;return{showCode:t,showCachedOutputs:n,canPaint:e.hasCells&&(t||n||e.allCellsIdle)}}var Gt=r(e=>{let t=!1,n=!0;for(let r of Object.values(e(fe).cellRuntime))pt(r.output)||(t=!0),r.status!==`idle`&&(n=!1);return{hasCachedOutputs:t,allCellsIdle:n}}),Kt=r(e=>e(Gt).hasCachedOutputs),qt=r(e=>e(Gt).allCellsIdle),Jt=r(e=>Wt({mode:e(Ie),showAppCode:e(Ge),hasCells:e(me),hasCachedOutputs:e(Kt),allCellsIdle:e(qt)})),Yt=r(e=>e(Jt).canPaint),Xt=e=>{let t=(0,K.c)(2),{children:n}=e;if(!Be())return n;let r;return t[0]===n?r=t[1]:(r=(0,q.jsx)(Zt,{children:n}),t[0]=n,t[1]=r),r},Zt=e=>{let t=(0,K.c)(8),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let{error:a}=wt($t,r),o=i(Yt),s=(0,G.useRef)(!1),c,l;if(t[1]!==o||t[2]!==a?(c=()=>{a&&o&&!s.current&&(s.current=!0,k.error(`Pyodide failed to initialize`,a),bt({title:`Failed to start the notebook runtime`,description:Ot(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,G.useEffect)(c,l),a&&!o)throw a;let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(Qt,{}),t[5]=u):u=t[5];let d;return t[6]===n?d=t[7]:(d=(0,q.jsx)(Vt,{requires:Yt,fallback:u,children:n}),t[6]=n,t[7]=d),d},Qt=()=>{let e=(0,K.c)(2),t=i(qe),n=t.kind===`loading`?t.message:`Loading…`,r;return e[0]===n?r=e[1]:(r=(0,q.jsx)(Ht,{title:n}),e[0]=n,e[1]=r),r};async function $t(){return await O.INSTANCE.initialized.promise,!0}var en={idle:`./favicon.ico`,success:`data:image/x-icon;base64,AAABAAEAMDAAAAEACACoDgAAFgA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP//gAH//wAA//4AAH//AAD/+AAAH/8AAP/gAAAH/wAA/8AAAAP/AAD/gAAAAf8AAP8AAAAA/wAA/gAAAAB/AAD8AAAAAD8AAPgAAAAAHwAA+AAAAAAfAADwAAAAAA8AAPAAAAAADwAA4AAAAAAHAADgAAAAAAcAAMAAAAAAAwAAwAAAAAADAADAAAAAAAMAAMAAAAAAAwAAwAAAAAADAADAAAAAAAMAAMAAAAAAAwAAwAAAAAADAADAAAAAAAMAAMAAAAAAAwAAwAAAAAADAADAAAAAAAMAAMAAAAAAAwAAwAAAAAADAADgAAAAAAcAAOAAAAAABwAA8AAAAAAPAADwAAAAAA8AAPgAAAAAHwAA+AAAAAAfAAD8AAAAAD8AAP4AAAAAfwAA/wAAAAD/AAD/gAAAAf8AAP/AAAAD/wAA/+AAAAf/AAD/+AAAH/8AAP/+AAB//wAA//+AAf//AAD///////8AAP///////wAA`};function tn(){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 nn(e){if(document.visibilityState===`visible`)return;let t=()=>{e===0?new Notification(`Execution completed`,{body:`Your notebook run completed successfully.`,icon:en.success}):new Notification(`Execution failed`,{body:`Your notebook run encountered ${e} error(s).`,icon:en.error})};!(`Notification`in window)||Notification.permission===`denied`||(Notification.permission===`granted`?t():Notification.permission==="default"&&Notification.requestPermission().then(e=>{e===`granted`&&t()}))}var rn=e=>{let t=(0,K.c)(11),{isRunning:n}=e,r=i(be),a,o;t[0]!==n||t[1]!==r?(a=()=>{let e=tn();if(!n&&e.href.includes(`favicon`)||(e.href=en[n?`running`:r===0?`success`:`error`],!document.hasFocus()))return;let t=setTimeout(()=>{e.href=en.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,G.useEffect)(a,o);let s=st(n)??n,c,l;t[4]!==n||t[5]!==r||t[6]!==s?(c=()=>{s&&!n&&nn(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,G.useEffect)(c,l);let u;return t[9]===n?u=t[10]:(u=()=>{if(!n){let e=tn();e.href=en.idle}},t[9]=n,t[10]=u),A(window,`focus`,u),null};function an(){let{cellIds:e,cellRuntime:t}=a.get(fe),n=e.inOrderIds.find(e=>t[e]?.status===`running`);n&&jt(n,`focus`)}var on=e=>{let t=(0,K.c)(18),{connection:n,isRunning:r,onReconnect:a}=e,{mode:o}=i(ze),s=n.state===N.CLOSED&&(o===`read`||n.code!==P.KERNEL_STARTUP_ERROR),c=n.state===N.OPEN,l=s&&n.code===P.KERNEL_DISCONNECTED,u;t[0]===s?u=t[1]:(u=s&&(0,q.jsx)(un,{}),t[0]=s,t[1]=u);let d=o===`read`?`fixed`:`absolute`,f;t[2]===d?f=t[3]:(f=I(`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,q.jsx)(ln,{}),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,q.jsx)(cn,{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,q.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,q.jsxs)(q.Fragment,{children:[u,h]}),t[15]=u,t[16]=h,t[17]=g):g=t[17],g},sn=`print:hidden pointer-events-auto hover:cursor-pointer`,cn=e=>{let t=(0,K.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=I(sn,`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,q.jsx)(Bt,{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,q.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,q.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,q.jsx)(it,{content:i,children:u}),t[9]=i,t[10]=u,t[11]=d):d=t[11],d},ln=()=>{let e=(0,K.c)(6),t=i(le),n=t?`Scratchpad is running`:`Jump to running cell`,r=t?void 0:an,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(Rt,{className:`running-app-icon`,size:30,strokeWidth:1}),e[0]=a):a=e[0];let o;e[1]===r?o=e[2]:(o=(0,q.jsx)(`div`,{className:sn,"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,q.jsx)(it,{content:n,side:`right`,children:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5],s},un=()=>{let e=(0,K.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`noise`}),(0,q.jsx)(`div`,{className:`disconnected-gradient`})]}),e[0]=t):t=e[0],t},dn=H,fn=Ze,pn=L($e),mn=G.forwardRef((e,t)=>{let n=(0,K.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=I(`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,q.jsx)(U,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});mn.displayName=U.displayName;var hn=F(`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`}}),gn=G.forwardRef((e,t)=>{let n=(0,K.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,q.jsx)(mn,{}),n[5]=c):c=n[5];let l;n[6]!==i||n[7]!==s?(l=I(hn({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,q.jsxs)(Qe,{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,q.jsx)(kt,{className:`h-4 w-4`}),(0,q.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,q.jsx)(pn,{children:(0,q.jsxs)(R,{children:[c,(0,q.jsxs)(V,{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});gn.displayName=V.displayName;var _n=G.forwardRef((e,t)=>{let n=(0,K.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=I(`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,q.jsx)(B,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});_n.displayName=B.displayName;var vn=G.forwardRef((e,t)=>{let n=(0,K.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=I(`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,q.jsx)(z,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});vn.displayName=z.displayName;var yn=(0,G.memo)(()=>{let e=(0,K.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(tt,{name:nt.SIDEBAR}),e[0]=t):t=e[0],t});yn.displayName=`SidebarSlot`;var bn=e=>{let t=(0,K.c)(6),{openWidth:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,q.jsx)(fn,{className:`lg:hidden`,asChild:!0,children:(0,q.jsx)(at,{variant:`ghost`,className:`bg-background`,children:(0,q.jsx)(zt,{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,q.jsx)(yn,{}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,q.jsxs)(dn,{children:[r,(0,q.jsx)(gn,{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},xn=e=>{let t=(0,K.c)(7),{isOpen:n,toggle:r}=e,i=n?`rotate-0`:`rotate-180`,a;t[0]===i?a=t[1]:(a=I(`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,q.jsx)(rt,{className:a}),t[2]=a,t[3]=o);let s;return t[4]!==o||t[5]!==r?(s=(0,q.jsx)(`div`,{className:`invisible lg:visible absolute top-[12px] right-[16px] z-20`,children:(0,q.jsx)(at,{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},Sn=e=>{let t=(0,K.c)(11),{isOpen:n,toggle:r,width:i}=e,a=n?i:Pe,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=I(`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,q.jsx)(xn,{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,q.jsx)(`div`,{className:`relative h-full flex flex-col px-3 pb-16 pt-14 overflow-y-auto shadow-sm border-l`,children:(0,q.jsx)(yn,{})}),t[6]=l):l=t[6];let u;return t[7]!==n||t[8]!==o||t[9]!==c?(u=(0,q.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},Cn=e=>{let n=(0,K.c)(15),{children:r}=e,[i,a]=t(Me),{isOpen:o,width:s}=i;if(et(nt.SIDEBAR).length===0)return r;let c;n[0]===s?c=n[1]:(c=Ae(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,q.jsx)(Sn,{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,q.jsx)(`div`,{className:`absolute top-3 left-4 flex items-center z-50`,children:(0,q.jsx)(bn,{openWidth:l})}),n[9]=l,n[10]=f);let p;return n[11]!==r||n[12]!==d||n[13]!==f?(p=(0,q.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},wn=e=>{let t=(0,K.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,q.jsx)(rn,{isRunning:i}),t[0]=i,t[1]=c);let l;t[2]!==r||t[3]!==i||t[4]!==o?(l=(0,q.jsx)(on,{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===N.CLOSED&&r.code!==P.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=I(`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,q.jsx)(Xt,{children:(0,q.jsx)(Cn,{children:(0,q.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,q.jsxs)(q.Fragment,{children:[c,l,m]}),t[15]=c,t[16]=l,t[17]=m,t[18]=h):h=t[18],h},Tn=(0,G.memo)(e=>{let t=(0,K.c)(9),{appConfig:n,mode:r,children:a}=e,{selectedLayout:o}=_t();if(!i(Le)&&(r===`edit`||r===`present`&&o===`vertical`))return a;let s=r===`read`,c;t[0]!==o||t[1]!==s?(c=vt({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=ct.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,q.jsx)(En,{appConfig:n,mode:r,plugin:d}),t[5]=n,t[6]=r,t[7]=d,t[8]=f):f=t[8],f});Tn.displayName=`CellsRenderer`;var En=e=>{let t=(0,K.c)(12),{appConfig:n,mode:r,plugin:i}=e,a=_t(),o=g(),{setCurrentLayoutData:s}=gt(),c,l;t[0]!==a||t[1]!==o||t[2]!==i?(c=ge(o),l=ut({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,q.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},Dn=class e{hasStarted=!1;static get INSTANCE(){let t=`_marimo_private_RuntimeState`;return window[t]||(window[t]=new e(je)),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){k.warn(`RuntimeState already started`);return}this._sendComponentValues=e,document.addEventListener(At.TYPE,this.handleReadyEvent),this.hasStarted=!0}stop(){if(!this.hasStarted){k.warn(`RuntimeState already stopped`);return}document.removeEventListener(At.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=>{k.warn(e)})}},On=b().min(1).describe(`Identifies a project. Unique within the host and unchanged while the project exists.`),J=b().min(1).describe(`Identifies a notebook. Unique within the host and unchanged while the notebook exists.`),kn=b().min(1).describe(`Identifies a runtime. Unique within the host; every start and restart creates a new id.`),An=b().min(1).describe(`Identifies an attachment. Unique within the host.`),jn=b().min(1).describe("Identifies a run independently of the request's `Idempotency-Key`. Events carry the key in `request_id`."),Y=b().min(1).describe(`Identifies an execution. Unique within the host.`),Mn=b().min(1).describe(`Identifies a console, display, or variable item. Unique within the host; sending an item again with the same id replaces it.`),X=b().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."),Nn=x({pid:v().min(1).describe(`The process id.`),started_at:W({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");x({version:Se(1).describe(`The version of this record's format. This document describes version 1.`),process:Nn,name:b().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:b().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:b().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-DfF1DLV_.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-BWKfkUWA.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-3NheuQEt.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-NkCTvSyj.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-B6Wvf232.js";import{n as ie,t as P}from"./RunButton-D3ScLvwb.js";import{t as ae}from"./readonly-python-code-DeBED4OB.js";import{r as oe}from"./useTheme-DLtPc-39.js";import{r as se}from"./useDebounce-k9QTpQ9-.js";import{t as ce}from"./CellStatus-DYRvLOiP.js";import{i as le}from"./useRunCells-CV81rge-.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-ny5n3-GH.js";import{t as he}from"./readonly-code-display-JC_YsLL_.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-DfF1DLV_.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-BWKfkUWA.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-DryOywaN.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-B2MJFBFp.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-CM_kQ_VW.js";import{n as ie,t as P}from"./RunButton-D3ScLvwb.js";import{t as ae}from"./readonly-python-code-DeBED4OB.js";import{r as oe}from"./useTheme-DLtPc-39.js";import{r as se}from"./useDebounce-k9QTpQ9-.js";import{t as ce}from"./CellStatus-DYRvLOiP.js";import{i as le}from"./useRunCells-CV81rge-.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-ny5n3-GH.js";import{t as he}from"./readonly-code-display-JC_YsLL_.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-DfF1DLV_.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./panels-CiR0Zzhg.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-BWKfkUWA.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-3NheuQEt.js";import{n as te}from"./download-CMTzX3rG.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-DeBED4OB.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-D8EbRFJJ.js";import{n as ue,t as de}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{n as fe}from"./code-visibility-ny5n3-GH.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-DfF1DLV_.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./panels-DI8gAi31.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-BWKfkUWA.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-DryOywaN.js";import{n as te}from"./download-CMTzX3rG.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-DeBED4OB.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-D8EbRFJJ.js";import{n as ue,t as de}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{n as fe}from"./code-visibility-ny5n3-GH.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-DfF1DLV_.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{O as c}from"./config-BWKfkUWA.js";import{t as le}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{n as ue}from"./JsonOutput-3NheuQEt.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-NkCTvSyj.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-B6Wvf232.js";import{t as ge}from"./spinner-DyNE-o8o.js";import{i as _e}from"./useDeleteCell-AbkQI6-c.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-DfF1DLV_.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{O as c}from"./config-BWKfkUWA.js";import{t as le}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{n as ue}from"./JsonOutput-DryOywaN.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-B2MJFBFp.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-CM_kQ_VW.js";import{t as ge}from"./spinner-DyNE-o8o.js";import{i as _e}from"./useDeleteCell-AbkQI6-c.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 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,u as i}from"./useEvent-Dfcbgjhg.js";import{t as a}from"./react-DVplv7_D.js";import{$r as o,Ai as s,Bi as c,Bt as l,Cn as u,D as d,Gn as f,Ha as p,Hi as m,Ii as h,Ji as g,Ki as _,Kn as v,Li as y,M as b,Mi as x,P as S,Qr as C,Ri as w,Rn as T,Rt as E,Ui as D,Wa as O,Wi as k,Xi as A,Yi as j,Zi as M,_n as ee,c as N,fn as P,gn as F,i as I,jn as L,qi as R,qn as z,ro as te,ti as ne,to as B,yr as V,yt as H,zi as U}from"./cells-DfF1DLV_.js";import{t as W}from"./compiler-runtime-BrajqUja.js";import{s as re}from"./config-DGX7JYor.js";import{r as ie}from"./config-CP8Y8_R0.js";import{O as ae}from"./config-BWKfkUWA.js";import{t as G}from"./ErrorBoundary-BKQo68Df.js";import{t as oe}from"./cn-ldLVeaqm.js";import{t as se}from"./jsx-runtime-B74pBk57.js";import{_ as ce,at as K,et as q,f as J,g as le,h as ue,it as de,m as fe,nt as pe,rt as me,tt as he,v as ge}from"./JsonOutput-3NheuQEt.js";import{t as _e}from"./tooltip-CkGm8X7m.js";import{r as ve,t as ye}from"./button-D8gVKwe-.js";import{t as be}from"./createLucideIcon-DfJ2oMlA.js";import{i as xe}from"./paths-bkIFVj8h.js";import{r as Se}from"./useNumberFormatter-D7O_26UI.js";import{a as Ce,r as we}from"./tree-actions-Zg3Ycse4.js";import{a as Te}from"./input-BZdRe7pb.js";import{n as Ee,o as De}from"./column-preview-BNPxoRnw.js";import{t as Oe}from"./workflow-cw-0b9g5.js";import{t as ke}from"./copy-icon-8-a5vovc.js";import{l as Ae}from"./arrays-0R2reF2y.js";import{i as je}from"./strings-C25fhMR_.js";import{r as Me}from"./requests-lt0JK8Jt.js";import{t as Ne}from"./I18nProvider-Cg2I_s1_.js";import{n as Pe}from"./useAsyncData-DhhdOGGd.js";import{t as Fe}from"./cell-link-D8EbRFJJ.js";import{a as Ie,i as Le,n as Re,o as ze,r as Be,t as Ve}from"./table-vrvqpuKJ.js";import{n as He}from"./icons-CiZ_8zS-.js";import{t as Ue}from"./useDeepCompareMemoize-DFIVN9dn.js";import{t as We}from"./useAddCell-BX9lq_0J.js";import{t as Ge}from"./empty-state-BaCKb7o3.js";import{n as Ke,t as qe}from"./common-D2oGA09G.js";import{a as Je,i as Ye,n as Xe,o as Ze,r as Qe,s as $e,t as et}from"./components-1zsrzJ_K.js";import{r as tt}from"./panel-accordion-state-CImIsdc8.js";var nt=be(`square-equal`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 10h10`,key:`1101jm`}],[`path`,{d:`M7 14h10`,key:`1mhdw3`}]]),Y=W(),X=e(a(),1),Z=se(),rt=1;function it(e){return 1.75+e*rt}function at(e){return 3+e*rt}function ot(e){return 3.25+e*rt}var Q={engineEmpty:.75,engine:.75,database:1,tableLoading:2.75,tableSchemaless:2,columnLocal:1.25,columnPreview:2.5};function $(e){return{paddingLeft:`${e}rem`}}var st=n(e=>{let t=e(w),n=e(ne),r=e(I);return Ae(t,e=>{if(!e.variable_name)return-1;let t=Object.values(n).find(t=>t.name===e.variable_name);if(!t)return 0;let i=r.inOrderIds.indexOf(t.declaredBy[0]);return i===-1?0:i})}),ct=ae(`marimo:datasources:hideEmpty`,!1,C,{getOnInit:!0});function lt(e){let t=!1,n=[];for(let r of e){if(!k(r)||!m(r)){n.push(r);continue}let e=r.child_schemas??[],i=lt(e);if(r.tables.length===0&&i.length===0){t=!0;continue}if(i===e){n.push(r);continue}t=!0,n.push({...r,child_schemas:i})}return t?n:e}function ut(e){let t=!1,n=[];for(let r of e){if(D(r)&&r.schemas.length===0){t=!0;continue}if(r.schemas.length===0){n.push(r);continue}let e=lt(r.schemas);if(e.length===0){t=!0;continue}if(e===r.schemas){n.push(r);continue}t=!0,n.push({...r,schemas:e})}return t?n:e}var dt=()=>{let e=(0,Y.c)(42),[n,a]=X.useState(``),[o,s]=t(ct),c=i(y),l=r(st),d=r(x),f;bb0:{if(!o){f=d;break bb0}let t,n;e[0]===d?(t=e[1],n=e[2]):(t=!1,n=d.map(e=>{let n=ut(e.databases);return n===e.databases?e:(t=!0,{...e,databases:n})}),e[0]=d,e[1]=t,e[2]=n),f=t?n:d}let p=f;if(l.length===0&&p.length===0){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Ge,{title:`No tables found`,description:`Any datasets/dataframes in the global scope will be shown here.`,action:(0,Z.jsx)(Ze,{group:`database`,label:`Add database or catalog`,variant:`outline`,size:`sm`}),icon:(0,Z.jsx)(xe,{})}),e[3]=t):t=e[3],t}let m;e[4]===n?m=e[5]:(m=n.trim(),e[4]=n,e[5]=m);let h=!!m,g;e[6]===c?g=e[7]:(g=e=>{c(e.length>0),a(e)},e[6]=c,e[7]=g);let _;e[8]!==n||e[9]!==g?(_=(0,Z.jsx)(F,{placeholder:`Search tables...`,className:`h-6 m-1`,value:n,onValueChange:g,rootClassName:`flex-1 border-r border-b-0`}),e[8]=n,e[9]=g,e[10]=_):_=e[10];let v;e[11]===h?v=e[12]:(v=h&&(0,Z.jsx)(`button`,{type:`button`,className:`float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,onClick:()=>a(``),children:(0,Z.jsx)(Se,{className:`h-4 w-4`})}),e[11]=h,e[12]=v);let b=!o,S;e[13]!==o||e[14]!==s?(S=()=>s(!o),e[13]=o,e[14]=s,e[15]=S):S=e[15];let C;e[16]!==b||e[17]!==S?(C=(0,Z.jsx)(Ce,{"data-testid":`datasources-hide-empty-button`,isVisible:b,onToggle:S,showTooltip:`Show empty schemas and databases`,hideTooltip:`Hide empty schemas and databases`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[16]=b,e[17]=S,e[18]=C):C=e[18];let w;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Ze,{group:`database`,label:`Add database or catalog`,compact:!0,variant:`ghost`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[19]=w):w=e[19];let T;e[20]!==_||e[21]!==v||e[22]!==C?(T=(0,Z.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[_,v,C,w]}),e[20]=_,e[21]=v,e[22]=C,e[23]=T):T=e[23];let E;if(e[24]!==p||e[25]!==n){let t;e[27]===n?t=e[28]:(t=e=>(0,Z.jsx)(ft,{connection:e,hasChildren:e.databases.length>0,children:e.databases.map(t=>(0,Z.jsx)(gt,{connection:e,database:t,searchValue:n},t.name))},e.name),e[27]=n,e[28]=t),E=p.map(t),e[24]=p,e[25]=n,e[26]=E}else E=e[26];let D;e[29]!==p.length||e[30]!==l.length?(D=p.length>0&&l.length>0&&(0,Z.jsxs)(fe,{className:`pr-2`,style:$(Q.engine),children:[(0,Z.jsx)(He,{className:`h-4 w-4 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`text-xs`,children:`Python`})]}),e[29]=p.length,e[30]=l.length,e[31]=D):D=e[31];let O;e[32]!==n||e[33]!==l?(O=l.length>0&&(0,Z.jsx)(bt,{tables:l,searchValue:n}),e[32]=n,e[33]=l,e[34]=O):O=e[34];let k;e[35]!==E||e[36]!==D||e[37]!==O?(k=(0,Z.jsxs)(u,{className:`flex flex-col`,children:[E,D,O]}),e[35]=E,e[36]=D,e[37]=O,e[38]=k):k=e[38];let A;return e[39]!==k||e[40]!==T?(A=(0,Z.jsxs)(P,{className:`border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden`,shouldFilter:!1,children:[T,k]}),e[39]=k,e[40]=T,e[41]=A):A=e[41],A},ft=e=>{let t=(0,Y.c)(26),{connection:n,children:r,hasChildren:i}=e,a=n.name===M,o=a?`In-Memory`:n.name,{previewDataSourceConnection:c}=Me(),l;t[0]!==n.name||t[1]!==c?(l=async()=>{await c({engine:n.name})},t[0]=n.name,t[1]=c,t[2]=l):l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=$(Q.engine),t[3]=d):d=t[3];let f;t[4]===n.dialect?f=t[5]:(f=(0,Z.jsx)(L,{className:`h-4 w-4 text-muted-foreground`,name:n.dialect}),t[4]=n.dialect,t[5]=f);let p;t[6]===n.dialect?p=t[7]:(p=s(n.dialect),t[6]=n.dialect,t[7]=p);let m;t[8]===p?m=t[9]:(m=(0,Z.jsx)(`span`,{className:`text-xs`,children:p}),t[8]=p,t[9]=m);let h=o,g;t[10]===h?g=t[11]:(g=(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,(0,Z.jsx)($e,{variableName:h}),`)`]}),t[10]=h,t[11]=g);let _;t[12]!==u||t[13]!==a?(_=!a&&(0,Z.jsx)(we,{onClick:u,tooltip:`Refresh connection`,className:`ml-auto h-4 p-0`,iconClassName:`h-3.5 w-3.5`}),t[12]=u,t[13]=a,t[14]=_):_=t[14];let v;t[15]!==f||t[16]!==m||t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(fe,{className:`pr-2`,style:d,children:[f,m,g,_]}),t[15]=f,t[16]=m,t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==r||t[21]!==i?(y=i?r:(0,Z.jsx)(ue,{content:`No databases available`,style:$(Q.engineEmpty)}),t[20]=r,t[21]=i,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==v?(b=(0,Z.jsxs)(Z.Fragment,{children:[v,y]}),t[23]=y,t[24]=v,t[25]=b):b=t[25],b},pt=X.createContext(null);function mt(){let e=X.useContext(pt);if(e==null)throw Error(`useDataSourceTree must be used within a DataSourceTreeContext.Provider`);return e}function ht(e,{schema:t,schemaPath:n}){return{engine:e.engineName,database:e.databaseName,schema:t,schemaPath:n,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,dialect:e.dialect}}var gt=e=>{let t=(0,Y.c)(21),{connection:n,database:r,searchValue:i}=e,a;t[0]!==n.default_database||t[1]!==n.default_schema||t[2]!==n.dialect||t[3]!==n.name||t[4]!==r.name||t[5]!==i?(a={engineName:n.name,databaseName:r.name,dialect:n.dialect,defaultSchema:n.default_schema,defaultDatabase:n.default_database,searchValue:i},t[0]=n.default_database,t[1]=n.default_schema,t[2]=n.dialect,t[3]=n.name,t[4]=r.name,t[5]=i,t[6]=a):a=t[6];let o=a,s=n.name,c=r.schemas,l;t[7]===r?l=t[8]:(l=D(r),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[9]=u):u=t[9];let d;t[10]!==r.schemas||t[11]!==l?(d=(0,Z.jsx)(vt,{schemas:c,schemasResolved:l,schemaPath:u,depth:0}),t[10]=r.schemas,t[11]=l,t[12]=d):d=t[12];let f;t[13]!==d||t[14]!==o?(f=(0,Z.jsx)(pt.Provider,{value:o,children:d}),t[13]=d,t[14]=o,t[15]=f):f=t[15];let p;return t[16]!==n.name||t[17]!==r||t[18]!==i||t[19]!==f?(p=(0,Z.jsx)(_t,{engineName:s,database:r,searchValue:i,children:f}),t[16]=n.name,t[17]=r,t[18]=i,t[19]=f,t[20]=p):p=t[20],p},_t=e=>{let t=(0,Y.c)(29),{searchValue:n,engineName:r,database:i,children:a}=e,o;t[0]!==i||t[1]!==n?(o=g(i,n),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s=o,[c,l]=X.useState(s),[u,d]=X.useState(!1),[f,p]=X.useState(n),[m,h]=X.useState(s);(f!==n||m!==s)&&(p(n),h(s),l(s));let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=$(Q.database),t[3]=_):_=t[3];let v;t[4]!==c||t[5]!==u?(v=()=>{l(!c),d(!u)},t[4]=c,t[5]=u,t[6]=v):v=t[6];let y=`${r}:${i.name}`,b;t[7]===c?b=t[8]:(b=(0,Z.jsx)(ge,{isExpanded:c}),t[7]=c,t[8]=b);let x=u&&c?`text-foreground`:`text-muted-foreground`,S;t[9]===x?S=t[10]:(S=oe(`h-4 w-4`,x),t[9]=x,t[10]=S);let C;t[11]===S?C=t[12]:(C=(0,Z.jsx)(xe,{className:S}),t[11]=S,t[12]=C);let w=u&&c&&`font-semibold`,T;t[13]===w?T=t[14]:(T=oe(w),t[13]=w,t[14]=T);let E;t[15]===i.name?E=t[16]:(E=i.name===``?(0,Z.jsx)(`i`,{children:`Not connected`}):i.name,t[15]=i.name,t[16]=E);let D;t[17]!==T||t[18]!==E?(D=(0,Z.jsx)(`span`,{className:T,children:E}),t[17]=T,t[18]=E,t[19]=D):D=t[19];let O;t[20]!==D||t[21]!==v||t[22]!==y||t[23]!==b||t[24]!==C?(O=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:_,onSelect:v,value:y,children:[b,C,D]}),t[20]=D,t[21]=v,t[22]=y,t[23]=b,t[24]=C,t[25]=O):O=t[25];let k=c&&a,A;return t[26]!==O||t[27]!==k?(A=(0,Z.jsxs)(Z.Fragment,{children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28],A},vt=e=>{let{schemas:t,schemasResolved:n,depth:r}=e,i=mt(),{engineName:a,databaseName:o,searchValue:s}=i,{addSchemaList:c}=h(),l=Ue(e.schemaPath),[u,d]=X.useState(!1),{isPending:p,error:m}=Pe(async()=>{if(!n&&a){d(!0);try{let e=await f.request({engine:a,database:o,schemaPath:l});c({schemas:e.schemas??[],sqlSchemaContext:{engine:a,database:o,schemaPath:l}})}finally{d(!1)}}},[n,a,o,l]),g=$(it(r));return p||u?(0,Z.jsx)(ce,{message:`Loading schemas...`,style:g}):m?(0,Z.jsx)(le,{error:m,style:g}):t.length===0?(0,Z.jsx)(ue,{content:`No schemas available`,style:g}):(0,Z.jsx)(Z.Fragment,{children:t.map(e=>_(e.name)?(0,Z.jsx)(bt,{tables:e.tables,tablesResolved:k(e),searchValue:s,sqlTableContext:ht(i,{schema:e.name,schemaPath:l})},e.name):(0,Z.jsx)(yt,{schema:e,schemaPath:[...l,e.name],depth:r},e.name))})},yt=e=>{let t=(0,Y.c)(41),{schema:n,schemaPath:r,depth:i}=e,a=mt(),{databaseName:o,searchValue:s}=a,c;t[0]!==n||t[1]!==s?(c=R(n,s),t[0]=n,t[1]=s,t[2]=c):c=t[2];let l=c,[u,d]=X.useState(l),[f,p]=X.useState(!1),[h,g]=X.useState(s),[_,v]=X.useState(l),y;t[3]===r?y=t[4]:(y=r.join(`.`),t[3]=r,t[4]=y);let b=`${o}:${y}`,x;t[5]===n.child_schemas?x=t[6]:(x=n.child_schemas??[],t[5]=n.child_schemas,t[6]=x);let S=x;(h!==s||_!==l)&&(g(s),v(l),d(l));let C;t[7]===i?C=t[8]:(C=$(it(i)),t[7]=i,t[8]=C);let w;t[9]!==u||t[10]!==f?(w=()=>{d(!u),p(!f)},t[9]=u,t[10]=f,t[11]=w):w=t[11];let T;t[12]===u?T=t[13]:(T=(0,Z.jsx)(ge,{isExpanded:u}),t[12]=u,t[13]=T);let E=f&&u&&`text-foreground`,D;t[14]===E?D=t[15]:(D=oe(`h-4 w-4 text-muted-foreground`,E),t[14]=E,t[15]=D);let O;t[16]===D?O=t[17]:(O=(0,Z.jsx)(B,{className:D}),t[16]=D,t[17]=O);let A=f&&u&&`font-semibold`,j;t[18]===A?j=t[19]:(j=oe(A),t[18]=A,t[19]=j);let M;t[20]!==n.name||t[21]!==j?(M=(0,Z.jsx)(`span`,{className:j,children:n.name}),t[20]=n.name,t[21]=j,t[22]=M):M=t[22];let N;t[23]!==M||t[24]!==C||t[25]!==w||t[26]!==T||t[27]!==O||t[28]!==b?(N=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:C,onSelect:w,value:b,children:[T,O,M]}),t[23]=M,t[24]=C,t[25]=w,t[26]=T,t[27]=O,t[28]=b,t[29]=N):N=t[29];let P;t[30]!==S||t[31]!==i||t[32]!==u||t[33]!==n||t[34]!==r||t[35]!==s||t[36]!==a?(P=u&&(0,Z.jsxs)(Z.Fragment,{children:[(S.length>0||!m(n))&&(0,Z.jsx)(vt,{schemas:S,schemasResolved:m(n),schemaPath:r,depth:i+1}),(0,Z.jsx)(bt,{tables:n.tables,tablesResolved:k(n),searchValue:s,tableIndentRem:at(i),columnIndentRem:ot(i),sqlTableContext:ht(a,{schema:n.name,schemaPath:r})})]}),t[30]=S,t[31]=i,t[32]=u,t[33]=n,t[34]=r,t[35]=s,t[36]=a,t[37]=P):P=t[37];let F;return t[38]!==N||t[39]!==P?(F=(0,Z.jsxs)(Z.Fragment,{children:[N,P]}),t[38]=N,t[39]=P,t[40]=F):F=t[40],F},bt=e=>{let t=(0,Y.c)(31),{tables:n,sqlTableContext:r,searchValue:i,tablesResolved:a,tableIndentRem:o,columnIndentRem:s}=e,c=a===void 0||a,{addTableList:l}=h(),[u,d]=X.useState(!1),f;t[0]!==l||t[1]!==r||t[2]!==c?(f=async()=>{if(!c&&r){d(!0);let{engine:e,database:t,schema:n,schemaPath:i}=r,a=await z.request({engine:e,database:t,schema:n,schemaPath:i??[]});if(!a?.tables)throw d(!1),Error(`No tables available`);l({tables:a.tables,sqlTableContext:r}),d(!1)}},t[0]=l,t[1]=r,t[2]=c,t[3]=f):f=t[3];let p;t[4]!==r||t[5]!==c?(p=[c,r],t[4]=r,t[5]=c,t[6]=p):p=t[6];let{isPending:m,error:g}=Pe(f,p),_=o??Q.tableLoading,v;t[7]===_?v=t[8]:(v=$(_),t[7]=_,t[8]=v);let y=v;if(m||u){let e;return t[9]===y?e=t[10]:(e=(0,Z.jsx)(ce,{message:`Loading tables...`,style:y}),t[9]=y,t[10]=e),e}if(g){let e;return t[11]!==g||t[12]!==y?(e=(0,Z.jsx)(le,{error:g,style:y}),t[11]=g,t[12]=y,t[13]=e):e=t[13],e}if(n.length===0){let e;return t[14]===y?e=t[15]:(e=(0,Z.jsx)(ue,{content:`No tables found`,style:y}),t[14]=y,t[15]=e),e}let b;if(t[16]!==s||t[17]!==i||t[18]!==r||t[19]!==o||t[20]!==n){let e;t[22]===i?e=t[23]:(e=e=>!i||e.name.toLowerCase().includes(i.toLowerCase()),t[22]=i,t[23]=e);let a=n.filter(e),c;t[24]!==s||t[25]!==i||t[26]!==r||t[27]!==o?(c=e=>(0,Z.jsx)(xt,{table:e,sqlTableContext:r,isSearching:!!i,tableIndentRem:o,columnIndentRem:s},e.name),t[24]=s,t[25]=i,t[26]=r,t[27]=o,t[28]=c):c=t[28],b=a.map(c),t[16]=s,t[17]=i,t[18]=r,t[19]=o,t[20]=n,t[21]=b}else b=t[21];let x;return t[29]===b?x=t[30]:(x=(0,Z.jsx)(Z.Fragment,{children:b}),t[29]=b,t[30]=x),x},xt=e=>{let t=(0,Y.c)(69),{table:n,sqlTableContext:i,isSearching:a,tableIndentRem:o,columnIndentRem:s}=e,{addTable:c}=h(),[u,f]=X.useState(!1),p=n.columns.length>0,m;t[0]!==c||t[1]!==u||t[2]!==i||t[3]!==n.name||t[4]!==p?(m=async()=>{if(u&&!p&&i){let{engine:e,database:t,schema:r,schemaPath:a}=i,o=await v.request({engine:e,database:t,schema:r,tableName:n.name,schemaPath:a??[]});if(!o?.table)throw Error(`No table details available`);c({table:o.table,sqlTableContext:i})}},t[0]=c,t[1]=u,t[2]=i,t[3]=n.name,t[4]=p,t[5]=m):m=t[5];let g;t[6]!==u||t[7]!==p?(g=[u,p],t[6]=u,t[7]=p,t[8]=g):g=t[8];let{isFetching:_,isPending:y,error:b}=Pe(m,g),x=r(re),S=E(),{createNewCell:C}=d(),w=We(),T;t[9]!==w||t[10]!==x||t[11]!==C||t[12]!==S||t[13]!==i||t[14]!==n?(T=()=>{l({autoInstantiate:x,createNewCell:C,fromCellId:S}),w((()=>{if(n.source_type===`catalog`){let e=i?.database?[i.database,...i.schemaPath??[],n.name].join(`.`):n.name;return`${n.engine}.load_table("${e}")`}if(i)return j({table:n,columnName:`*`,sqlTableContext:i});switch(n.source_type){case`local`:return`mo.ui.table(${n.name})`;case`duckdb`:case`connection`:return j({table:n,columnName:`*`,sqlTableContext:i});default:return je(n.source_type),``}})())},t[9]=w,t[10]=x,t[11]=C,t[12]=S,t[13]=i,t[14]=n,t[15]=T):T=t[15];let D=T,k;t[16]!==n.num_columns||t[17]!==n.num_rows?(k=()=>{let e=[];return n.num_rows!=null&&e.push(`${n.num_rows} rows`),n.num_columns!=null&&e.push(`${n.num_columns} columns`),e.length===0?null:(0,Z.jsx)(`div`,{className:`flex flex-row gap-2 items-center pl-6 group-hover:hidden`,children:(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.join(`, `)})})},t[16]=n.num_columns,t[17]=n.num_rows,t[18]=k):k=t[18];let M=k,N;t[19]!==s||t[20]!==b||t[21]!==_||t[22]!==y||t[23]!==i||t[24]!==n?(N=()=>{let e=$(s??Q.tableLoading);if(y||_)return(0,Z.jsx)(ce,{message:`Loading columns...`,style:e});if(b)return(0,Z.jsx)(le,{error:b,style:e});let t=n.columns;return t.length===0?(0,Z.jsx)(ue,{content:`No columns found`,style:e}):t.map(e=>(0,Z.jsx)(St,{table:n,column:e,sqlTableContext:i,columnIndentRem:s},e.name))},t[19]=s,t[20]=b,t[21]=_,t[22]=y,t[23]=i,t[24]=n,t[25]=N):N=t[25];let P=N,F;t[26]!==u||t[27]!==a||t[28]!==n.source_type||t[29]!==n.type?(F=()=>{if(n.source_type===`local`)return;let e=n.type===`table`?O:te;return(0,Z.jsx)(e,{className:`h-3 w-3`,strokeWidth:u||a?2.5:void 0})},t[26]=u,t[27]=a,t[28]=n.source_type,t[29]=n.type,t[30]=F):F=t[30];let I=F,L;t[31]!==i||t[32]!==n.name?(L=A(i,n.name),t[31]=i,t[32]=n.name,t[33]=L):L=t[33];let R=L,z=o??(i?Q.tableSchemaless:0),ne=(u||a)&&`font-semibold`,B;t[34]===ne?B=t[35]:(B=oe(`rounded-none group h-8 cursor-pointer`,ne),t[34]=ne,t[35]=B);let V;t[36]===z?V=t[37]:(V=$(z),t[36]=z,t[37]=V);let H;t[38]===u?H=t[39]:(H=()=>f(!u),t[38]=u,t[39]=H);let U;t[40]===I?U=t[41]:(U=I(),t[40]=I,t[41]=U);let W;t[42]===n.name?W=t[43]:(W=(0,Z.jsx)(`span`,{className:`text-sm`,children:n.name}),t[42]=n.name,t[43]=W);let ie;t[44]!==U||t[45]!==W?(ie=(0,Z.jsxs)(`div`,{className:`flex gap-2 items-center flex-1 pl-1`,children:[U,W]}),t[44]=U,t[45]=W,t[46]=ie):ie=t[46];let ae;t[47]===M?ae=t[48]:(ae=M(),t[47]=M,t[48]=ae);let G;t[49]===D?G=t[50]:(G=ve.stopPropagation(()=>D()),t[49]=D,t[50]=G);let se;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsx)(De,{className:`h-3 w-3`}),t[51]=se):se=t[51];let K;t[52]===G?K=t[53]:(K=(0,Z.jsx)(_e,{content:`Add table to notebook`,delayDuration:400,children:(0,Z.jsx)(ye,{className:`group-hover:inline-flex hidden`,variant:`text`,size:`icon`,onClick:G,children:se})}),t[52]=G,t[53]=K);let q;t[54]!==u||t[55]!==V||t[56]!==H||t[57]!==ie||t[58]!==ae||t[59]!==K||t[60]!==B||t[61]!==R?(q=(0,Z.jsxs)(ee,{className:B,style:V,value:R,"aria-selected":u,forceMount:!0,onSelect:H,children:[ie,ae,K]}),t[54]=u,t[55]=V,t[56]=H,t[57]=ie,t[58]=ae,t[59]=K,t[60]=B,t[61]=R,t[62]=q):q=t[62];let J;t[63]!==u||t[64]!==P?(J=u&&P(),t[63]=u,t[64]=P,t[65]=J):J=t[65];let de;return t[66]!==q||t[67]!==J?(de=(0,Z.jsxs)(Z.Fragment,{children:[q,J]}),t[66]=q,t[67]=J,t[68]=de):de=t[68],de},St=e=>{let t=(0,Y.c)(51),{table:n,column:a,sqlTableContext:o,columnIndentRem:s}=e,[l,u]=X.useState(!1),d=r(y),f=i(U);d&&l&&u(!1),f(l?e=>new Set([...e,`${n.name}:${a.name}`]):e=>(e.delete(`${n.name}:${a.name}`),new Set(e)));let p=We(),{columnsPreviews:m}=c(),h;t[0]!==a.name||t[1]!==n.primary_keys?(h=n.primary_keys?.includes(a.name)||!1,t[0]=a.name,t[1]=n.primary_keys,t[2]=h):h=t[2];let g=h,_;t[3]!==a.name||t[4]!==n.indexes?(_=n.indexes?.includes(a.name)||!1,t[3]=a.name,t[4]=n.indexes,t[5]=_):_=t[5];let v=_,b;t[6]===p?b=t[7]:(b=e=>{p(e)},t[6]=p,t[7]=b);let x=b,S=Ct,C=l?`font-semibold`:``,w;t[8]!==a.name||t[9]!==C?(w=(0,Z.jsx)(`span`,{className:C,children:a.name}),t[8]=a.name,t[9]=C,t[10]=w):w=t[10];let T=w,E=`${n.name}.${a.name}`,D=`${n.name}.${a.name}`,O;t[11]===l?O=t[12]:(O=()=>u(!l),t[11]=l,t[12]=O);let k;t[13]!==s||t[14]!==o?(k=s??(o?ot(0):Q.columnLocal),t[13]=s,t[14]=o,t[15]=k):k=t[15];let A;t[16]===k?A=t[17]:(A=$(k),t[16]=k,t[17]=A);let j;t[18]!==a.type||t[19]!==T?(j=(0,Z.jsx)(J,{columnName:T,dataType:a.type}),t[18]=a.type,t[19]=T,t[20]=j):j=t[20];let M;t[21]===g?M=t[22]:(M=g&&S({tooltipContent:`Primary key`,content:`PK`}),t[21]=g,t[22]=M);let N;t[23]===v?N=t[24]:(N=v&&S({tooltipContent:`Indexed`,content:`IDX`}),t[23]=v,t[24]=N);let P;t[25]!==A||t[26]!==j||t[27]!==M||t[28]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2 items-center flex-1`,style:A,children:[j,M,N]}),t[25]=A,t[26]=j,t[27]=M,t[28]=N,t[29]=P):P=t[29];let F;t[30]===a.name?F=t[31]:(F=(0,Z.jsx)(_e,{content:`Copy column name`,delayDuration:400,children:(0,Z.jsx)(ye,{variant:`text`,size:`icon`,className:`group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(ke,{tooltip:!1,value:a.name,className:`h-3 w-3`})})}),t[30]=a.name,t[31]=F);let I;t[32]===a.external_type?I=t[33]:(I=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a.external_type}),t[32]=a.external_type,t[33]=I);let L;t[34]!==P||t[35]!==F||t[36]!==I||t[37]!==E||t[38]!==D||t[39]!==O?(L=(0,Z.jsxs)(ee,{className:`rounded-none py-1 group cursor-pointer`,value:D,onSelect:O,children:[P,F,I]},E),t[34]=P,t[35]=F,t[36]=I,t[37]=E,t[38]=D,t[39]=O,t[40]=L):L=t[40];let R;t[41]!==a||t[42]!==m||t[43]!==x||t[44]!==l||t[45]!==o||t[46]!==n?(R=l&&(0,Z.jsx)(`div`,{className:`pr-2 py-2 bg-(--slate-1) shadow-inner border-b`,style:$(Q.columnPreview),children:(0,Z.jsx)(G,{children:(0,Z.jsx)(Ee,{table:n,column:a,onAddColumnChart:x,preview:m.get(o?`${o.database}.${o.schema}.${n.name}:${a.name}`:`${n.name}:${a.name}`),sqlTableContext:o})})}),t[41]=a,t[42]=m,t[43]=x,t[44]=l,t[45]=o,t[46]=n,t[47]=R):R=t[47];let z;return t[48]!==L||t[49]!==R?(z=(0,Z.jsxs)(Z.Fragment,{children:[L,R]}),t[48]=L,t[49]=R,t[50]=z):z=t[50],z};function Ct(e){let{tooltipContent:t,content:n}=e;return(0,Z.jsx)(_e,{content:t,delayDuration:100,children:(0,Z.jsx)(`span`,{className:`text-xs text-black bg-gray-100 dark:invert rounded px-1`,children:n})})}function wt(e){return e}var Tt={name:`name`,type:`type-value`,defs:`defs-refs`},Et=[wt({id:Tt.name,accessorFn:e=>[e.name,e.declaredBy],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(q,{header:`Name`,column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsx)(qe,{name:t,declaredBy:n})}}),wt({id:Tt.type,accessorFn:e=>[e.dataType,e.value],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(q,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Type`}),(0,Z.jsx)(`span`,{children:`Value`})]}),column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsxs)(`div`,{className:`max-w-[150px]`,children:[(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs`,children:t}),(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap`,title:n??``,children:n})]})}}),wt({id:Tt.defs,accessorFn:e=>[e.declaredBy,e.usedBy,e.name,e.declaredByNames,e.usedByNames],enableSorting:!0,sortingFn:`basic`,header:({column:e})=>(0,Z.jsx)(q,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Declared By`}),(0,Z.jsx)(`span`,{children:`Used By`})]}),column:e}),cell:({getValue:e})=>{let[t,n,r]=e(),i=e=>{let t=N(e);t&&V(t,r)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 py-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-center`,children:[(0,Z.jsx)(`span`,{title:`Declared by`,children:(0,Z.jsx)(nt,{className:`w-3.5 h-3.5 text-muted-foreground`})}),t.length===1?(0,Z.jsx)(Fe,{variant:`focus`,cellId:t[0],skipScroll:!0,onClick:()=>i(t[0])}):(0,Z.jsx)(`div`,{className:`text-destructive flex flex-row gap-2`,children:t.slice(0,3).map((e,n)=>(0,Z.jsxs)(`span`,{className:`flex`,children:[(0,Z.jsx)(Fe,{variant:`focus`,cellId:e,skipScroll:!0,className:`whitespace-nowrap text-destructive`,onClick:()=>i(e)},e),n<t.length-1&&`, `]},e))})]}),(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-baseline`,children:[(0,Z.jsx)(`span`,{title:`Used by`,children:(0,Z.jsx)(Oe,{className:`w-3.5 h-3.5 text-muted-foreground`})}),(0,Z.jsx)(Ke,{maxCount:3,cellIds:n,skipScroll:!0,onClick:i})]})]})}})];function Dt({variables:e,sort:t,cellIdToIndex:n}){t||={id:Tt.defs,desc:!1};let r=[];switch(t.id){case Tt.name:r=Ae(e,e=>e.name);break;case Tt.type:r=Ae(e,e=>e.dataType);break;case Tt.defs:r=Ae(e,e=>n.get(e.declaredBy[0]))}return t.desc?r.toReversed():r}var Ot=(0,X.memo)(({className:e,cellIds:t,variables:n})=>{let[r,i]=X.useState([]),[a,o]=X.useState(``),s=S(),{locale:c}=Ne(),l=(0,X.useMemo)(()=>{let e=e=>{let n=s[e];return T(n)?`cell-${t.indexOf(e)}`:n??`cell-${t.indexOf(e)}`};return Object.values(n).map(t=>({...t,declaredByNames:t.declaredBy.map(e),usedByNames:t.usedBy.map(e)}))},[n,s,t]),u=(0,X.useMemo)(()=>{let e=new Map;return t.forEach((t,n)=>e.set(t,n)),Dt({variables:l,sort:r[0],cellIdToIndex:e})},[l,r,t]),d=pe({data:u,columns:Et,getCoreRowModel:me(),onGlobalFilterChange:o,getFilteredRowModel:de(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter(e){return e.columnDef.enableGlobalFilter??!0},globalFilterFn:`auto`,manualSorting:!0,locale:c,onSortingChange:i,getSortedRowModel:K(),state:{sorting:r,globalFilter:a}});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Te,{className:`w-full`,placeholder:`Search`,value:a,onChange:e=>o(e.target.value)}),(0,Z.jsxs)(Ve,{className:oe(`w-full text-sm flex-1 border-separate border-spacing-0`,e),children:[(0,Z.jsx)(Ie,{children:(0,Z.jsx)(ze,{className:`whitespace-nowrap text-xs`,children:d.getFlatHeaders().map(e=>(0,Z.jsx)(Le,{className:`sticky top-0 bg-background border-b`,children:he(e.column.columnDef.header,e.getContext())},e.id))})}),(0,Z.jsx)(Re,{children:d.getRowModel().rows.map(e=>(0,Z.jsx)(ze,{className:`hover:bg-accent`,children:e.getVisibleCells().map(e=>(0,Z.jsx)(Be,{className:`border-b`,children:he(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})]})});Ot.displayName=`VariableTable`;var kt=()=>{let e=(0,Y.c)(30),n=o(),i=b(),a=r(w),s=r(x),c=H(`database`),[l,u]=t(tt),d=a.length+s.length,f;e[0]!==d||e[1]!==l.hasUserInteracted||e[2]!==l.openSections?(f=!l.hasUserInteracted&&d>0?[...new Set([...l.openSections,`datasources`])]:l.openSections,e[0]=d,e[1]=l.hasUserInteracted,e[2]=l.openSections,e[3]=f):f=e[3];let m=f,h;e[4]===u?h=e[5]:(h=e=>{u({openSections:e,hasUserInteracted:!0})},e[4]=u,e[5]=h);let g=h,_;e[6]===m?_=e[7]:(_=m.includes(`datasources`),e[6]=m,e[7]=_);let v=!_&&d>0,y=c.length>0,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(xe,{className:`w-4 h-4`}),e[8]=S):S=e[8];let C;e[9]!==d||e[10]!==v?(C=v&&(0,Z.jsx)(Je,{children:d}),e[9]=d,e[10]=v,e[11]=C):C=e[11];let T;e[12]!==c.length||e[13]!==y?(T=y&&(0,Z.jsx)(et,{count:c.length,type:`database`}),e[12]=c.length,e[13]=y,e[14]=T):T=e[14];let E;e[15]!==C||e[16]!==T?(E=(0,Z.jsxs)(Ye,{children:[S,`Data sources`,C,T]}),e[15]=C,e[16]=T,e[17]=E):E=e[17];let D;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(Xe,{children:(0,Z.jsx)(dt,{})}),e[18]=D):D=e[18];let O;e[19]===E?O=e[20]:(O=(0,Z.jsxs)(Qe,{value:`datasources`,children:[E,D]}),e[19]=E,e[20]=O);let k;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsxs)(Ye,{children:[(0,Z.jsx)(p,{className:`w-4 h-4`}),`Variables`]}),e[21]=k):k=e[21];let A;e[22]!==i||e[23]!==n?(A=(0,Z.jsxs)(Qe,{value:`variables`,lastItem:!0,children:[k,(0,Z.jsx)(Xe,{children:Object.keys(n).length===0?(0,Z.jsx)(`div`,{className:`px-3 py-4 text-sm text-muted-foreground`,children:`No variables defined`}):(0,Z.jsx)(Ot,{cellIds:i.inOrderIds,variables:n})})]}),e[22]=i,e[23]=n,e[24]=A):A=e[24];let j;return e[25]!==g||e[26]!==m||e[27]!==A||e[28]!==O?(j=(0,Z.jsxs)(ie,{type:`multiple`,value:m,onValueChange:g,className:`flex flex-col h-full overflow-auto`,children:[O,A]}),e[25]=g,e[26]=m,e[27]=A,e[28]=O,e[29]=j):j=e[29],j};export{kt as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,u as i}from"./useEvent-Dfcbgjhg.js";import{t as a}from"./react-DVplv7_D.js";import{$r as o,Ai as s,Bi as c,Bt as l,Cn as u,D as d,Gn as f,Ha as p,Hi as m,Ii as h,Ji as g,Ki as _,Kn as v,Li as y,M as b,Mi as x,P as S,Qr as C,Ri as w,Rn as T,Rt as E,Ui as D,Wa as O,Wi as k,Xi as A,Yi as j,Zi as M,_n as ee,c as N,fn as P,gn as F,i as I,jn as L,qi as R,qn as z,ro as te,ti as ne,to as B,yr as V,yt as H,zi as U}from"./cells-DfF1DLV_.js";import{t as W}from"./compiler-runtime-BrajqUja.js";import{s as re}from"./config-DGX7JYor.js";import{r as ie}from"./config-CP8Y8_R0.js";import{O as ae}from"./config-BWKfkUWA.js";import{t as G}from"./ErrorBoundary-BKQo68Df.js";import{t as oe}from"./cn-ldLVeaqm.js";import{t as se}from"./jsx-runtime-B74pBk57.js";import{_ as ce,at as K,et as q,f as J,g as le,h as ue,it as de,m as fe,nt as pe,rt as me,tt as he,v as ge}from"./JsonOutput-DryOywaN.js";import{t as _e}from"./tooltip-CkGm8X7m.js";import{r as ve,t as ye}from"./button-D8gVKwe-.js";import{t as be}from"./createLucideIcon-DfJ2oMlA.js";import{i as xe}from"./paths-bkIFVj8h.js";import{r as Se}from"./useNumberFormatter-D7O_26UI.js";import{a as Ce,r as we}from"./tree-actions-Zg3Ycse4.js";import{a as Te}from"./input-BZdRe7pb.js";import{n as Ee,o as De}from"./column-preview-CqFSXTtf.js";import{t as Oe}from"./workflow-cw-0b9g5.js";import{t as ke}from"./copy-icon-8-a5vovc.js";import{l as Ae}from"./arrays-0R2reF2y.js";import{i as je}from"./strings-C25fhMR_.js";import{r as Me}from"./requests-lt0JK8Jt.js";import{t as Ne}from"./I18nProvider-Cg2I_s1_.js";import{n as Pe}from"./useAsyncData-DhhdOGGd.js";import{t as Fe}from"./cell-link-D8EbRFJJ.js";import{a as Ie,i as Le,n as Re,o as ze,r as Be,t as Ve}from"./table-vrvqpuKJ.js";import{n as He}from"./icons-CiZ_8zS-.js";import{t as Ue}from"./useDeepCompareMemoize-DFIVN9dn.js";import{t as We}from"./useAddCell-BX9lq_0J.js";import{t as Ge}from"./empty-state-BaCKb7o3.js";import{n as Ke,t as qe}from"./common-D2oGA09G.js";import{a as Je,i as Ye,n as Xe,o as Ze,r as Qe,s as $e,t as et}from"./components-1zsrzJ_K.js";import{r as tt}from"./panel-accordion-state-CImIsdc8.js";var nt=be(`square-equal`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 10h10`,key:`1101jm`}],[`path`,{d:`M7 14h10`,key:`1mhdw3`}]]),Y=W(),X=e(a(),1),Z=se(),rt=1;function it(e){return 1.75+e*rt}function at(e){return 3+e*rt}function ot(e){return 3.25+e*rt}var Q={engineEmpty:.75,engine:.75,database:1,tableLoading:2.75,tableSchemaless:2,columnLocal:1.25,columnPreview:2.5};function $(e){return{paddingLeft:`${e}rem`}}var st=n(e=>{let t=e(w),n=e(ne),r=e(I);return Ae(t,e=>{if(!e.variable_name)return-1;let t=Object.values(n).find(t=>t.name===e.variable_name);if(!t)return 0;let i=r.inOrderIds.indexOf(t.declaredBy[0]);return i===-1?0:i})}),ct=ae(`marimo:datasources:hideEmpty`,!1,C,{getOnInit:!0});function lt(e){let t=!1,n=[];for(let r of e){if(!k(r)||!m(r)){n.push(r);continue}let e=r.child_schemas??[],i=lt(e);if(r.tables.length===0&&i.length===0){t=!0;continue}if(i===e){n.push(r);continue}t=!0,n.push({...r,child_schemas:i})}return t?n:e}function ut(e){let t=!1,n=[];for(let r of e){if(D(r)&&r.schemas.length===0){t=!0;continue}if(r.schemas.length===0){n.push(r);continue}let e=lt(r.schemas);if(e.length===0){t=!0;continue}if(e===r.schemas){n.push(r);continue}t=!0,n.push({...r,schemas:e})}return t?n:e}var dt=()=>{let e=(0,Y.c)(42),[n,a]=X.useState(``),[o,s]=t(ct),c=i(y),l=r(st),d=r(x),f;bb0:{if(!o){f=d;break bb0}let t,n;e[0]===d?(t=e[1],n=e[2]):(t=!1,n=d.map(e=>{let n=ut(e.databases);return n===e.databases?e:(t=!0,{...e,databases:n})}),e[0]=d,e[1]=t,e[2]=n),f=t?n:d}let p=f;if(l.length===0&&p.length===0){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Ge,{title:`No tables found`,description:`Any datasets/dataframes in the global scope will be shown here.`,action:(0,Z.jsx)(Ze,{group:`database`,label:`Add database or catalog`,variant:`outline`,size:`sm`}),icon:(0,Z.jsx)(xe,{})}),e[3]=t):t=e[3],t}let m;e[4]===n?m=e[5]:(m=n.trim(),e[4]=n,e[5]=m);let h=!!m,g;e[6]===c?g=e[7]:(g=e=>{c(e.length>0),a(e)},e[6]=c,e[7]=g);let _;e[8]!==n||e[9]!==g?(_=(0,Z.jsx)(F,{placeholder:`Search tables...`,className:`h-6 m-1`,value:n,onValueChange:g,rootClassName:`flex-1 border-r border-b-0`}),e[8]=n,e[9]=g,e[10]=_):_=e[10];let v;e[11]===h?v=e[12]:(v=h&&(0,Z.jsx)(`button`,{type:`button`,className:`float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,onClick:()=>a(``),children:(0,Z.jsx)(Se,{className:`h-4 w-4`})}),e[11]=h,e[12]=v);let b=!o,S;e[13]!==o||e[14]!==s?(S=()=>s(!o),e[13]=o,e[14]=s,e[15]=S):S=e[15];let C;e[16]!==b||e[17]!==S?(C=(0,Z.jsx)(Ce,{"data-testid":`datasources-hide-empty-button`,isVisible:b,onToggle:S,showTooltip:`Show empty schemas and databases`,hideTooltip:`Hide empty schemas and databases`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[16]=b,e[17]=S,e[18]=C):C=e[18];let w;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Ze,{group:`database`,label:`Add database or catalog`,compact:!0,variant:`ghost`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[19]=w):w=e[19];let T;e[20]!==_||e[21]!==v||e[22]!==C?(T=(0,Z.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[_,v,C,w]}),e[20]=_,e[21]=v,e[22]=C,e[23]=T):T=e[23];let E;if(e[24]!==p||e[25]!==n){let t;e[27]===n?t=e[28]:(t=e=>(0,Z.jsx)(ft,{connection:e,hasChildren:e.databases.length>0,children:e.databases.map(t=>(0,Z.jsx)(gt,{connection:e,database:t,searchValue:n},t.name))},e.name),e[27]=n,e[28]=t),E=p.map(t),e[24]=p,e[25]=n,e[26]=E}else E=e[26];let D;e[29]!==p.length||e[30]!==l.length?(D=p.length>0&&l.length>0&&(0,Z.jsxs)(fe,{className:`pr-2`,style:$(Q.engine),children:[(0,Z.jsx)(He,{className:`h-4 w-4 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`text-xs`,children:`Python`})]}),e[29]=p.length,e[30]=l.length,e[31]=D):D=e[31];let O;e[32]!==n||e[33]!==l?(O=l.length>0&&(0,Z.jsx)(bt,{tables:l,searchValue:n}),e[32]=n,e[33]=l,e[34]=O):O=e[34];let k;e[35]!==E||e[36]!==D||e[37]!==O?(k=(0,Z.jsxs)(u,{className:`flex flex-col`,children:[E,D,O]}),e[35]=E,e[36]=D,e[37]=O,e[38]=k):k=e[38];let A;return e[39]!==k||e[40]!==T?(A=(0,Z.jsxs)(P,{className:`border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden`,shouldFilter:!1,children:[T,k]}),e[39]=k,e[40]=T,e[41]=A):A=e[41],A},ft=e=>{let t=(0,Y.c)(26),{connection:n,children:r,hasChildren:i}=e,a=n.name===M,o=a?`In-Memory`:n.name,{previewDataSourceConnection:c}=Me(),l;t[0]!==n.name||t[1]!==c?(l=async()=>{await c({engine:n.name})},t[0]=n.name,t[1]=c,t[2]=l):l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=$(Q.engine),t[3]=d):d=t[3];let f;t[4]===n.dialect?f=t[5]:(f=(0,Z.jsx)(L,{className:`h-4 w-4 text-muted-foreground`,name:n.dialect}),t[4]=n.dialect,t[5]=f);let p;t[6]===n.dialect?p=t[7]:(p=s(n.dialect),t[6]=n.dialect,t[7]=p);let m;t[8]===p?m=t[9]:(m=(0,Z.jsx)(`span`,{className:`text-xs`,children:p}),t[8]=p,t[9]=m);let h=o,g;t[10]===h?g=t[11]:(g=(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,(0,Z.jsx)($e,{variableName:h}),`)`]}),t[10]=h,t[11]=g);let _;t[12]!==u||t[13]!==a?(_=!a&&(0,Z.jsx)(we,{onClick:u,tooltip:`Refresh connection`,className:`ml-auto h-4 p-0`,iconClassName:`h-3.5 w-3.5`}),t[12]=u,t[13]=a,t[14]=_):_=t[14];let v;t[15]!==f||t[16]!==m||t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(fe,{className:`pr-2`,style:d,children:[f,m,g,_]}),t[15]=f,t[16]=m,t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==r||t[21]!==i?(y=i?r:(0,Z.jsx)(ue,{content:`No databases available`,style:$(Q.engineEmpty)}),t[20]=r,t[21]=i,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==v?(b=(0,Z.jsxs)(Z.Fragment,{children:[v,y]}),t[23]=y,t[24]=v,t[25]=b):b=t[25],b},pt=X.createContext(null);function mt(){let e=X.useContext(pt);if(e==null)throw Error(`useDataSourceTree must be used within a DataSourceTreeContext.Provider`);return e}function ht(e,{schema:t,schemaPath:n}){return{engine:e.engineName,database:e.databaseName,schema:t,schemaPath:n,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,dialect:e.dialect}}var gt=e=>{let t=(0,Y.c)(21),{connection:n,database:r,searchValue:i}=e,a;t[0]!==n.default_database||t[1]!==n.default_schema||t[2]!==n.dialect||t[3]!==n.name||t[4]!==r.name||t[5]!==i?(a={engineName:n.name,databaseName:r.name,dialect:n.dialect,defaultSchema:n.default_schema,defaultDatabase:n.default_database,searchValue:i},t[0]=n.default_database,t[1]=n.default_schema,t[2]=n.dialect,t[3]=n.name,t[4]=r.name,t[5]=i,t[6]=a):a=t[6];let o=a,s=n.name,c=r.schemas,l;t[7]===r?l=t[8]:(l=D(r),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[9]=u):u=t[9];let d;t[10]!==r.schemas||t[11]!==l?(d=(0,Z.jsx)(vt,{schemas:c,schemasResolved:l,schemaPath:u,depth:0}),t[10]=r.schemas,t[11]=l,t[12]=d):d=t[12];let f;t[13]!==d||t[14]!==o?(f=(0,Z.jsx)(pt.Provider,{value:o,children:d}),t[13]=d,t[14]=o,t[15]=f):f=t[15];let p;return t[16]!==n.name||t[17]!==r||t[18]!==i||t[19]!==f?(p=(0,Z.jsx)(_t,{engineName:s,database:r,searchValue:i,children:f}),t[16]=n.name,t[17]=r,t[18]=i,t[19]=f,t[20]=p):p=t[20],p},_t=e=>{let t=(0,Y.c)(29),{searchValue:n,engineName:r,database:i,children:a}=e,o;t[0]!==i||t[1]!==n?(o=g(i,n),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s=o,[c,l]=X.useState(s),[u,d]=X.useState(!1),[f,p]=X.useState(n),[m,h]=X.useState(s);(f!==n||m!==s)&&(p(n),h(s),l(s));let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=$(Q.database),t[3]=_):_=t[3];let v;t[4]!==c||t[5]!==u?(v=()=>{l(!c),d(!u)},t[4]=c,t[5]=u,t[6]=v):v=t[6];let y=`${r}:${i.name}`,b;t[7]===c?b=t[8]:(b=(0,Z.jsx)(ge,{isExpanded:c}),t[7]=c,t[8]=b);let x=u&&c?`text-foreground`:`text-muted-foreground`,S;t[9]===x?S=t[10]:(S=oe(`h-4 w-4`,x),t[9]=x,t[10]=S);let C;t[11]===S?C=t[12]:(C=(0,Z.jsx)(xe,{className:S}),t[11]=S,t[12]=C);let w=u&&c&&`font-semibold`,T;t[13]===w?T=t[14]:(T=oe(w),t[13]=w,t[14]=T);let E;t[15]===i.name?E=t[16]:(E=i.name===``?(0,Z.jsx)(`i`,{children:`Not connected`}):i.name,t[15]=i.name,t[16]=E);let D;t[17]!==T||t[18]!==E?(D=(0,Z.jsx)(`span`,{className:T,children:E}),t[17]=T,t[18]=E,t[19]=D):D=t[19];let O;t[20]!==D||t[21]!==v||t[22]!==y||t[23]!==b||t[24]!==C?(O=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:_,onSelect:v,value:y,children:[b,C,D]}),t[20]=D,t[21]=v,t[22]=y,t[23]=b,t[24]=C,t[25]=O):O=t[25];let k=c&&a,A;return t[26]!==O||t[27]!==k?(A=(0,Z.jsxs)(Z.Fragment,{children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28],A},vt=e=>{let{schemas:t,schemasResolved:n,depth:r}=e,i=mt(),{engineName:a,databaseName:o,searchValue:s}=i,{addSchemaList:c}=h(),l=Ue(e.schemaPath),[u,d]=X.useState(!1),{isPending:p,error:m}=Pe(async()=>{if(!n&&a){d(!0);try{let e=await f.request({engine:a,database:o,schemaPath:l});c({schemas:e.schemas??[],sqlSchemaContext:{engine:a,database:o,schemaPath:l}})}finally{d(!1)}}},[n,a,o,l]),g=$(it(r));return p||u?(0,Z.jsx)(ce,{message:`Loading schemas...`,style:g}):m?(0,Z.jsx)(le,{error:m,style:g}):t.length===0?(0,Z.jsx)(ue,{content:`No schemas available`,style:g}):(0,Z.jsx)(Z.Fragment,{children:t.map(e=>_(e.name)?(0,Z.jsx)(bt,{tables:e.tables,tablesResolved:k(e),searchValue:s,sqlTableContext:ht(i,{schema:e.name,schemaPath:l})},e.name):(0,Z.jsx)(yt,{schema:e,schemaPath:[...l,e.name],depth:r},e.name))})},yt=e=>{let t=(0,Y.c)(41),{schema:n,schemaPath:r,depth:i}=e,a=mt(),{databaseName:o,searchValue:s}=a,c;t[0]!==n||t[1]!==s?(c=R(n,s),t[0]=n,t[1]=s,t[2]=c):c=t[2];let l=c,[u,d]=X.useState(l),[f,p]=X.useState(!1),[h,g]=X.useState(s),[_,v]=X.useState(l),y;t[3]===r?y=t[4]:(y=r.join(`.`),t[3]=r,t[4]=y);let b=`${o}:${y}`,x;t[5]===n.child_schemas?x=t[6]:(x=n.child_schemas??[],t[5]=n.child_schemas,t[6]=x);let S=x;(h!==s||_!==l)&&(g(s),v(l),d(l));let C;t[7]===i?C=t[8]:(C=$(it(i)),t[7]=i,t[8]=C);let w;t[9]!==u||t[10]!==f?(w=()=>{d(!u),p(!f)},t[9]=u,t[10]=f,t[11]=w):w=t[11];let T;t[12]===u?T=t[13]:(T=(0,Z.jsx)(ge,{isExpanded:u}),t[12]=u,t[13]=T);let E=f&&u&&`text-foreground`,D;t[14]===E?D=t[15]:(D=oe(`h-4 w-4 text-muted-foreground`,E),t[14]=E,t[15]=D);let O;t[16]===D?O=t[17]:(O=(0,Z.jsx)(B,{className:D}),t[16]=D,t[17]=O);let A=f&&u&&`font-semibold`,j;t[18]===A?j=t[19]:(j=oe(A),t[18]=A,t[19]=j);let M;t[20]!==n.name||t[21]!==j?(M=(0,Z.jsx)(`span`,{className:j,children:n.name}),t[20]=n.name,t[21]=j,t[22]=M):M=t[22];let N;t[23]!==M||t[24]!==C||t[25]!==w||t[26]!==T||t[27]!==O||t[28]!==b?(N=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:C,onSelect:w,value:b,children:[T,O,M]}),t[23]=M,t[24]=C,t[25]=w,t[26]=T,t[27]=O,t[28]=b,t[29]=N):N=t[29];let P;t[30]!==S||t[31]!==i||t[32]!==u||t[33]!==n||t[34]!==r||t[35]!==s||t[36]!==a?(P=u&&(0,Z.jsxs)(Z.Fragment,{children:[(S.length>0||!m(n))&&(0,Z.jsx)(vt,{schemas:S,schemasResolved:m(n),schemaPath:r,depth:i+1}),(0,Z.jsx)(bt,{tables:n.tables,tablesResolved:k(n),searchValue:s,tableIndentRem:at(i),columnIndentRem:ot(i),sqlTableContext:ht(a,{schema:n.name,schemaPath:r})})]}),t[30]=S,t[31]=i,t[32]=u,t[33]=n,t[34]=r,t[35]=s,t[36]=a,t[37]=P):P=t[37];let F;return t[38]!==N||t[39]!==P?(F=(0,Z.jsxs)(Z.Fragment,{children:[N,P]}),t[38]=N,t[39]=P,t[40]=F):F=t[40],F},bt=e=>{let t=(0,Y.c)(31),{tables:n,sqlTableContext:r,searchValue:i,tablesResolved:a,tableIndentRem:o,columnIndentRem:s}=e,c=a===void 0||a,{addTableList:l}=h(),[u,d]=X.useState(!1),f;t[0]!==l||t[1]!==r||t[2]!==c?(f=async()=>{if(!c&&r){d(!0);let{engine:e,database:t,schema:n,schemaPath:i}=r,a=await z.request({engine:e,database:t,schema:n,schemaPath:i??[]});if(!a?.tables)throw d(!1),Error(`No tables available`);l({tables:a.tables,sqlTableContext:r}),d(!1)}},t[0]=l,t[1]=r,t[2]=c,t[3]=f):f=t[3];let p;t[4]!==r||t[5]!==c?(p=[c,r],t[4]=r,t[5]=c,t[6]=p):p=t[6];let{isPending:m,error:g}=Pe(f,p),_=o??Q.tableLoading,v;t[7]===_?v=t[8]:(v=$(_),t[7]=_,t[8]=v);let y=v;if(m||u){let e;return t[9]===y?e=t[10]:(e=(0,Z.jsx)(ce,{message:`Loading tables...`,style:y}),t[9]=y,t[10]=e),e}if(g){let e;return t[11]!==g||t[12]!==y?(e=(0,Z.jsx)(le,{error:g,style:y}),t[11]=g,t[12]=y,t[13]=e):e=t[13],e}if(n.length===0){let e;return t[14]===y?e=t[15]:(e=(0,Z.jsx)(ue,{content:`No tables found`,style:y}),t[14]=y,t[15]=e),e}let b;if(t[16]!==s||t[17]!==i||t[18]!==r||t[19]!==o||t[20]!==n){let e;t[22]===i?e=t[23]:(e=e=>!i||e.name.toLowerCase().includes(i.toLowerCase()),t[22]=i,t[23]=e);let a=n.filter(e),c;t[24]!==s||t[25]!==i||t[26]!==r||t[27]!==o?(c=e=>(0,Z.jsx)(xt,{table:e,sqlTableContext:r,isSearching:!!i,tableIndentRem:o,columnIndentRem:s},e.name),t[24]=s,t[25]=i,t[26]=r,t[27]=o,t[28]=c):c=t[28],b=a.map(c),t[16]=s,t[17]=i,t[18]=r,t[19]=o,t[20]=n,t[21]=b}else b=t[21];let x;return t[29]===b?x=t[30]:(x=(0,Z.jsx)(Z.Fragment,{children:b}),t[29]=b,t[30]=x),x},xt=e=>{let t=(0,Y.c)(69),{table:n,sqlTableContext:i,isSearching:a,tableIndentRem:o,columnIndentRem:s}=e,{addTable:c}=h(),[u,f]=X.useState(!1),p=n.columns.length>0,m;t[0]!==c||t[1]!==u||t[2]!==i||t[3]!==n.name||t[4]!==p?(m=async()=>{if(u&&!p&&i){let{engine:e,database:t,schema:r,schemaPath:a}=i,o=await v.request({engine:e,database:t,schema:r,tableName:n.name,schemaPath:a??[]});if(!o?.table)throw Error(`No table details available`);c({table:o.table,sqlTableContext:i})}},t[0]=c,t[1]=u,t[2]=i,t[3]=n.name,t[4]=p,t[5]=m):m=t[5];let g;t[6]!==u||t[7]!==p?(g=[u,p],t[6]=u,t[7]=p,t[8]=g):g=t[8];let{isFetching:_,isPending:y,error:b}=Pe(m,g),x=r(re),S=E(),{createNewCell:C}=d(),w=We(),T;t[9]!==w||t[10]!==x||t[11]!==C||t[12]!==S||t[13]!==i||t[14]!==n?(T=()=>{l({autoInstantiate:x,createNewCell:C,fromCellId:S}),w((()=>{if(n.source_type===`catalog`){let e=i?.database?[i.database,...i.schemaPath??[],n.name].join(`.`):n.name;return`${n.engine}.load_table("${e}")`}if(i)return j({table:n,columnName:`*`,sqlTableContext:i});switch(n.source_type){case`local`:return`mo.ui.table(${n.name})`;case`duckdb`:case`connection`:return j({table:n,columnName:`*`,sqlTableContext:i});default:return je(n.source_type),``}})())},t[9]=w,t[10]=x,t[11]=C,t[12]=S,t[13]=i,t[14]=n,t[15]=T):T=t[15];let D=T,k;t[16]!==n.num_columns||t[17]!==n.num_rows?(k=()=>{let e=[];return n.num_rows!=null&&e.push(`${n.num_rows} rows`),n.num_columns!=null&&e.push(`${n.num_columns} columns`),e.length===0?null:(0,Z.jsx)(`div`,{className:`flex flex-row gap-2 items-center pl-6 group-hover:hidden`,children:(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.join(`, `)})})},t[16]=n.num_columns,t[17]=n.num_rows,t[18]=k):k=t[18];let M=k,N;t[19]!==s||t[20]!==b||t[21]!==_||t[22]!==y||t[23]!==i||t[24]!==n?(N=()=>{let e=$(s??Q.tableLoading);if(y||_)return(0,Z.jsx)(ce,{message:`Loading columns...`,style:e});if(b)return(0,Z.jsx)(le,{error:b,style:e});let t=n.columns;return t.length===0?(0,Z.jsx)(ue,{content:`No columns found`,style:e}):t.map(e=>(0,Z.jsx)(St,{table:n,column:e,sqlTableContext:i,columnIndentRem:s},e.name))},t[19]=s,t[20]=b,t[21]=_,t[22]=y,t[23]=i,t[24]=n,t[25]=N):N=t[25];let P=N,F;t[26]!==u||t[27]!==a||t[28]!==n.source_type||t[29]!==n.type?(F=()=>{if(n.source_type===`local`)return;let e=n.type===`table`?O:te;return(0,Z.jsx)(e,{className:`h-3 w-3`,strokeWidth:u||a?2.5:void 0})},t[26]=u,t[27]=a,t[28]=n.source_type,t[29]=n.type,t[30]=F):F=t[30];let I=F,L;t[31]!==i||t[32]!==n.name?(L=A(i,n.name),t[31]=i,t[32]=n.name,t[33]=L):L=t[33];let R=L,z=o??(i?Q.tableSchemaless:0),ne=(u||a)&&`font-semibold`,B;t[34]===ne?B=t[35]:(B=oe(`rounded-none group h-8 cursor-pointer`,ne),t[34]=ne,t[35]=B);let V;t[36]===z?V=t[37]:(V=$(z),t[36]=z,t[37]=V);let H;t[38]===u?H=t[39]:(H=()=>f(!u),t[38]=u,t[39]=H);let U;t[40]===I?U=t[41]:(U=I(),t[40]=I,t[41]=U);let W;t[42]===n.name?W=t[43]:(W=(0,Z.jsx)(`span`,{className:`text-sm`,children:n.name}),t[42]=n.name,t[43]=W);let ie;t[44]!==U||t[45]!==W?(ie=(0,Z.jsxs)(`div`,{className:`flex gap-2 items-center flex-1 pl-1`,children:[U,W]}),t[44]=U,t[45]=W,t[46]=ie):ie=t[46];let ae;t[47]===M?ae=t[48]:(ae=M(),t[47]=M,t[48]=ae);let G;t[49]===D?G=t[50]:(G=ve.stopPropagation(()=>D()),t[49]=D,t[50]=G);let se;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsx)(De,{className:`h-3 w-3`}),t[51]=se):se=t[51];let K;t[52]===G?K=t[53]:(K=(0,Z.jsx)(_e,{content:`Add table to notebook`,delayDuration:400,children:(0,Z.jsx)(ye,{className:`group-hover:inline-flex hidden`,variant:`text`,size:`icon`,onClick:G,children:se})}),t[52]=G,t[53]=K);let q;t[54]!==u||t[55]!==V||t[56]!==H||t[57]!==ie||t[58]!==ae||t[59]!==K||t[60]!==B||t[61]!==R?(q=(0,Z.jsxs)(ee,{className:B,style:V,value:R,"aria-selected":u,forceMount:!0,onSelect:H,children:[ie,ae,K]}),t[54]=u,t[55]=V,t[56]=H,t[57]=ie,t[58]=ae,t[59]=K,t[60]=B,t[61]=R,t[62]=q):q=t[62];let J;t[63]!==u||t[64]!==P?(J=u&&P(),t[63]=u,t[64]=P,t[65]=J):J=t[65];let de;return t[66]!==q||t[67]!==J?(de=(0,Z.jsxs)(Z.Fragment,{children:[q,J]}),t[66]=q,t[67]=J,t[68]=de):de=t[68],de},St=e=>{let t=(0,Y.c)(51),{table:n,column:a,sqlTableContext:o,columnIndentRem:s}=e,[l,u]=X.useState(!1),d=r(y),f=i(U);d&&l&&u(!1),f(l?e=>new Set([...e,`${n.name}:${a.name}`]):e=>(e.delete(`${n.name}:${a.name}`),new Set(e)));let p=We(),{columnsPreviews:m}=c(),h;t[0]!==a.name||t[1]!==n.primary_keys?(h=n.primary_keys?.includes(a.name)||!1,t[0]=a.name,t[1]=n.primary_keys,t[2]=h):h=t[2];let g=h,_;t[3]!==a.name||t[4]!==n.indexes?(_=n.indexes?.includes(a.name)||!1,t[3]=a.name,t[4]=n.indexes,t[5]=_):_=t[5];let v=_,b;t[6]===p?b=t[7]:(b=e=>{p(e)},t[6]=p,t[7]=b);let x=b,S=Ct,C=l?`font-semibold`:``,w;t[8]!==a.name||t[9]!==C?(w=(0,Z.jsx)(`span`,{className:C,children:a.name}),t[8]=a.name,t[9]=C,t[10]=w):w=t[10];let T=w,E=`${n.name}.${a.name}`,D=`${n.name}.${a.name}`,O;t[11]===l?O=t[12]:(O=()=>u(!l),t[11]=l,t[12]=O);let k;t[13]!==s||t[14]!==o?(k=s??(o?ot(0):Q.columnLocal),t[13]=s,t[14]=o,t[15]=k):k=t[15];let A;t[16]===k?A=t[17]:(A=$(k),t[16]=k,t[17]=A);let j;t[18]!==a.type||t[19]!==T?(j=(0,Z.jsx)(J,{columnName:T,dataType:a.type}),t[18]=a.type,t[19]=T,t[20]=j):j=t[20];let M;t[21]===g?M=t[22]:(M=g&&S({tooltipContent:`Primary key`,content:`PK`}),t[21]=g,t[22]=M);let N;t[23]===v?N=t[24]:(N=v&&S({tooltipContent:`Indexed`,content:`IDX`}),t[23]=v,t[24]=N);let P;t[25]!==A||t[26]!==j||t[27]!==M||t[28]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2 items-center flex-1`,style:A,children:[j,M,N]}),t[25]=A,t[26]=j,t[27]=M,t[28]=N,t[29]=P):P=t[29];let F;t[30]===a.name?F=t[31]:(F=(0,Z.jsx)(_e,{content:`Copy column name`,delayDuration:400,children:(0,Z.jsx)(ye,{variant:`text`,size:`icon`,className:`group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(ke,{tooltip:!1,value:a.name,className:`h-3 w-3`})})}),t[30]=a.name,t[31]=F);let I;t[32]===a.external_type?I=t[33]:(I=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a.external_type}),t[32]=a.external_type,t[33]=I);let L;t[34]!==P||t[35]!==F||t[36]!==I||t[37]!==E||t[38]!==D||t[39]!==O?(L=(0,Z.jsxs)(ee,{className:`rounded-none py-1 group cursor-pointer`,value:D,onSelect:O,children:[P,F,I]},E),t[34]=P,t[35]=F,t[36]=I,t[37]=E,t[38]=D,t[39]=O,t[40]=L):L=t[40];let R;t[41]!==a||t[42]!==m||t[43]!==x||t[44]!==l||t[45]!==o||t[46]!==n?(R=l&&(0,Z.jsx)(`div`,{className:`pr-2 py-2 bg-(--slate-1) shadow-inner border-b`,style:$(Q.columnPreview),children:(0,Z.jsx)(G,{children:(0,Z.jsx)(Ee,{table:n,column:a,onAddColumnChart:x,preview:m.get(o?`${o.database}.${o.schema}.${n.name}:${a.name}`:`${n.name}:${a.name}`),sqlTableContext:o})})}),t[41]=a,t[42]=m,t[43]=x,t[44]=l,t[45]=o,t[46]=n,t[47]=R):R=t[47];let z;return t[48]!==L||t[49]!==R?(z=(0,Z.jsxs)(Z.Fragment,{children:[L,R]}),t[48]=L,t[49]=R,t[50]=z):z=t[50],z};function Ct(e){let{tooltipContent:t,content:n}=e;return(0,Z.jsx)(_e,{content:t,delayDuration:100,children:(0,Z.jsx)(`span`,{className:`text-xs text-black bg-gray-100 dark:invert rounded px-1`,children:n})})}function wt(e){return e}var Tt={name:`name`,type:`type-value`,defs:`defs-refs`},Et=[wt({id:Tt.name,accessorFn:e=>[e.name,e.declaredBy],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(q,{header:`Name`,column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsx)(qe,{name:t,declaredBy:n})}}),wt({id:Tt.type,accessorFn:e=>[e.dataType,e.value],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(q,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Type`}),(0,Z.jsx)(`span`,{children:`Value`})]}),column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsxs)(`div`,{className:`max-w-[150px]`,children:[(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs`,children:t}),(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap`,title:n??``,children:n})]})}}),wt({id:Tt.defs,accessorFn:e=>[e.declaredBy,e.usedBy,e.name,e.declaredByNames,e.usedByNames],enableSorting:!0,sortingFn:`basic`,header:({column:e})=>(0,Z.jsx)(q,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Declared By`}),(0,Z.jsx)(`span`,{children:`Used By`})]}),column:e}),cell:({getValue:e})=>{let[t,n,r]=e(),i=e=>{let t=N(e);t&&V(t,r)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 py-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-center`,children:[(0,Z.jsx)(`span`,{title:`Declared by`,children:(0,Z.jsx)(nt,{className:`w-3.5 h-3.5 text-muted-foreground`})}),t.length===1?(0,Z.jsx)(Fe,{variant:`focus`,cellId:t[0],skipScroll:!0,onClick:()=>i(t[0])}):(0,Z.jsx)(`div`,{className:`text-destructive flex flex-row gap-2`,children:t.slice(0,3).map((e,n)=>(0,Z.jsxs)(`span`,{className:`flex`,children:[(0,Z.jsx)(Fe,{variant:`focus`,cellId:e,skipScroll:!0,className:`whitespace-nowrap text-destructive`,onClick:()=>i(e)},e),n<t.length-1&&`, `]},e))})]}),(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-baseline`,children:[(0,Z.jsx)(`span`,{title:`Used by`,children:(0,Z.jsx)(Oe,{className:`w-3.5 h-3.5 text-muted-foreground`})}),(0,Z.jsx)(Ke,{maxCount:3,cellIds:n,skipScroll:!0,onClick:i})]})]})}})];function Dt({variables:e,sort:t,cellIdToIndex:n}){t||={id:Tt.defs,desc:!1};let r=[];switch(t.id){case Tt.name:r=Ae(e,e=>e.name);break;case Tt.type:r=Ae(e,e=>e.dataType);break;case Tt.defs:r=Ae(e,e=>n.get(e.declaredBy[0]))}return t.desc?r.toReversed():r}var Ot=(0,X.memo)(({className:e,cellIds:t,variables:n})=>{let[r,i]=X.useState([]),[a,o]=X.useState(``),s=S(),{locale:c}=Ne(),l=(0,X.useMemo)(()=>{let e=e=>{let n=s[e];return T(n)?`cell-${t.indexOf(e)}`:n??`cell-${t.indexOf(e)}`};return Object.values(n).map(t=>({...t,declaredByNames:t.declaredBy.map(e),usedByNames:t.usedBy.map(e)}))},[n,s,t]),u=(0,X.useMemo)(()=>{let e=new Map;return t.forEach((t,n)=>e.set(t,n)),Dt({variables:l,sort:r[0],cellIdToIndex:e})},[l,r,t]),d=pe({data:u,columns:Et,getCoreRowModel:me(),onGlobalFilterChange:o,getFilteredRowModel:de(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter(e){return e.columnDef.enableGlobalFilter??!0},globalFilterFn:`auto`,manualSorting:!0,locale:c,onSortingChange:i,getSortedRowModel:K(),state:{sorting:r,globalFilter:a}});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Te,{className:`w-full`,placeholder:`Search`,value:a,onChange:e=>o(e.target.value)}),(0,Z.jsxs)(Ve,{className:oe(`w-full text-sm flex-1 border-separate border-spacing-0`,e),children:[(0,Z.jsx)(Ie,{children:(0,Z.jsx)(ze,{className:`whitespace-nowrap text-xs`,children:d.getFlatHeaders().map(e=>(0,Z.jsx)(Le,{className:`sticky top-0 bg-background border-b`,children:he(e.column.columnDef.header,e.getContext())},e.id))})}),(0,Z.jsx)(Re,{children:d.getRowModel().rows.map(e=>(0,Z.jsx)(ze,{className:`hover:bg-accent`,children:e.getVisibleCells().map(e=>(0,Z.jsx)(Be,{className:`border-b`,children:he(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})]})});Ot.displayName=`VariableTable`;var kt=()=>{let e=(0,Y.c)(30),n=o(),i=b(),a=r(w),s=r(x),c=H(`database`),[l,u]=t(tt),d=a.length+s.length,f;e[0]!==d||e[1]!==l.hasUserInteracted||e[2]!==l.openSections?(f=!l.hasUserInteracted&&d>0?[...new Set([...l.openSections,`datasources`])]:l.openSections,e[0]=d,e[1]=l.hasUserInteracted,e[2]=l.openSections,e[3]=f):f=e[3];let m=f,h;e[4]===u?h=e[5]:(h=e=>{u({openSections:e,hasUserInteracted:!0})},e[4]=u,e[5]=h);let g=h,_;e[6]===m?_=e[7]:(_=m.includes(`datasources`),e[6]=m,e[7]=_);let v=!_&&d>0,y=c.length>0,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(xe,{className:`w-4 h-4`}),e[8]=S):S=e[8];let C;e[9]!==d||e[10]!==v?(C=v&&(0,Z.jsx)(Je,{children:d}),e[9]=d,e[10]=v,e[11]=C):C=e[11];let T;e[12]!==c.length||e[13]!==y?(T=y&&(0,Z.jsx)(et,{count:c.length,type:`database`}),e[12]=c.length,e[13]=y,e[14]=T):T=e[14];let E;e[15]!==C||e[16]!==T?(E=(0,Z.jsxs)(Ye,{children:[S,`Data sources`,C,T]}),e[15]=C,e[16]=T,e[17]=E):E=e[17];let D;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(Xe,{children:(0,Z.jsx)(dt,{})}),e[18]=D):D=e[18];let O;e[19]===E?O=e[20]:(O=(0,Z.jsxs)(Qe,{value:`datasources`,children:[E,D]}),e[19]=E,e[20]=O);let k;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsxs)(Ye,{children:[(0,Z.jsx)(p,{className:`w-4 h-4`}),`Variables`]}),e[21]=k):k=e[21];let A;e[22]!==i||e[23]!==n?(A=(0,Z.jsxs)(Qe,{value:`variables`,lastItem:!0,children:[k,(0,Z.jsx)(Xe,{children:Object.keys(n).length===0?(0,Z.jsx)(`div`,{className:`px-3 py-4 text-sm text-muted-foreground`,children:`No variables defined`}):(0,Z.jsx)(Ot,{cellIds:i.inOrderIds,variables:n})})]}),e[22]=i,e[23]=n,e[24]=A):A=e[24];let j;return e[25]!==g||e[26]!==m||e[27]!==A||e[28]!==O?(j=(0,Z.jsxs)(ie,{type:`multiple`,value:m,onValueChange:g,className:`flex flex-col h-full overflow-auto`,children:[O,A]}),e[25]=g,e[26]=m,e[27]=A,e[28]=O,e[29]=j):j=e[29],j};export{kt as default};