@marimo-team/frontend 0.24.3-dev1 → 0.24.3-dev13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CellStatus-LoTwk7fR.js → CellStatus-LChlPuPv.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-DW6cJ-Lr.js → ConnectedDataExplorerComponent-DiXd-oqU.js} +1 -1
- package/dist/assets/JsonOutput-DCgOfk7t.js +50 -0
- package/dist/assets/LazyAnyLanguageCodeMirror-C_cwGmDg.js +2 -0
- package/dist/assets/{MarimoErrorOutput-DqpoYOvw.js → MarimoErrorOutput-DwGwWsxV.js} +2 -2
- package/dist/assets/{RenderHTML-DwhMAd9l.js → RenderHTML-B73ExmWb.js} +1 -1
- package/dist/assets/{RunButton-BlpbweyH.js → RunButton-iPopny2V.js} +1 -1
- package/dist/assets/add-cell-with-ai-DkDJWJF6.js +76 -0
- package/dist/assets/{add-connection-dialog-BGfpw5lC.js → add-connection-dialog-1fPdJRRj.js} +73 -73
- package/dist/assets/agent-panel-0drx16i_.js +286 -0
- package/dist/assets/ai-model-dropdown-B3zoJxvO.js +3 -0
- package/dist/assets/{any-language-editor-DflLjPSQ.js → any-language-editor-pGZDaSqz.js} +1 -1
- package/dist/assets/app-config-button-DlhlZpGg.js +1 -0
- package/dist/assets/{blob-B2d_dHwI.js → blob-B6ayJpoQ.js} +1 -1
- package/dist/assets/cell-editor-DHWK9sPz.js +21 -0
- package/dist/assets/cell-link-B7ZVGcSl.js +1 -0
- package/dist/assets/{cells-Cp-G34Rz.js → cells-CMLP1Dld.js} +25 -25
- package/dist/assets/chat-display-MSmOss6B.js +1 -0
- package/dist/assets/{chat-panel-BlUwNY5j.js → chat-panel-g8moS06Y.js} +2 -2
- package/dist/assets/{chat-ui-DGiVDzNh.js → chat-ui-CBqyOE_p.js} +4 -4
- package/dist/assets/{column-preview-riSXbYe_.js → column-preview-oex3TMfq.js} +1 -1
- package/dist/assets/{command-palette-CCVzJcyf.js → command-palette-D0CXuYgO.js} +1 -1
- package/dist/assets/{common-CHR7w7aQ.js → common-BN-k-WsU.js} +1 -1
- package/dist/assets/components-BPyy3wXe.js +1 -0
- package/dist/assets/components-DWwMSfV5.js +1 -0
- package/dist/assets/{config-BlNM0caL.js → config-BuGkUPaK.js} +1 -1
- package/dist/assets/{copy-icon-z8fuTE3w.js → copy-icon-BUOcnUgJ.js} +1 -1
- package/dist/assets/{datasource-DrODSIs0.js → datasource-DDYaCFxh.js} +2 -2
- package/dist/assets/{dependency-graph-panel-AY5BEVH2.js → dependency-graph-panel-XotpvJGU.js} +3 -3
- package/dist/assets/dist-0lSCnrrf.js +1 -0
- package/dist/assets/dist-CLXTUtr2.js +1 -0
- package/dist/assets/{documentation-panel-CaJF7e-j.js → documentation-panel-pxfRAT4P.js} +1 -1
- package/dist/assets/{download-DMxOzI7b.js → download-BRrPmrl5.js} +1 -1
- package/dist/assets/dropdown-menu-DnvwbPho.js +1 -0
- package/dist/assets/edit-page-BopkEdmt.js +9 -0
- package/dist/assets/{error-entries-Cv2m1yhc.js → error-entries-Bc5lubx5.js} +1 -1
- package/dist/assets/{error-panel-Bhlvt6_H.js → error-panel-n7jAw6zx.js} +1 -1
- package/dist/assets/file-explorer-panel-BOBUXkRd.js +1 -0
- package/dist/assets/file-icons-wArFRwmS.js +1 -0
- package/dist/assets/{file-name-input-K4MKESI_.js → file-name-input-Brf4MYj_.js} +3 -3
- package/dist/assets/{floating-outline-DaUHnl_e.js → floating-outline-CG-zTB22.js} +1 -1
- package/dist/assets/gallery-page-B39w2KuX.js +1 -0
- package/dist/assets/{glide-data-editor-sICUMEhk.js → glide-data-editor-BufxOYjB.js} +1 -1
- package/dist/assets/home-page-CB-Br4zp.js +4 -0
- package/dist/assets/index-C2Qgy_xA.js +29 -0
- package/dist/assets/{kiosk-mode-mxgb5lWf.js → kiosk-mode-m6yKu6eh.js} +1 -1
- package/dist/assets/{layout-DWnrxIo2.js → layout-YlSl0c7f.js} +5 -5
- package/dist/assets/logs-panel-Dpw-vNvJ.js +1 -0
- package/dist/assets/{markdown-renderer-BZKlbm2Q.js → markdown-renderer-C_dn-F0h.js} +1 -1
- package/dist/assets/{name-cell-input-BMCdK-el.js → name-cell-input-DQ1AN_b1.js} +1 -1
- package/dist/assets/{outline-panel-Dr5u73V6.js → outline-panel-CANEwLJ7.js} +1 -1
- package/dist/assets/packages-panel-l2uEMqBg.js +1 -0
- package/dist/assets/{pair-with-agent-modal-CbUFKJHP.js → pair-with-agent-modal-DYvcjx3q.js} +1 -1
- package/dist/assets/panel-accordion-state-CJxJh72n.js +1 -0
- package/dist/assets/panels-CU5fmJJo.js +4 -0
- package/dist/assets/{pathUtils-Cryrlpma.js → pathUtils-D7lk2rYQ.js} +1 -1
- package/dist/assets/paths-ClYq6Exe.js +1 -0
- package/dist/assets/process-output-DTlZ_jDn.js +1 -0
- package/dist/assets/readonly-code-display-DWORkymT.js +1 -0
- package/dist/assets/{readonly-python-code-DpIyjHqY.js → readonly-python-code-Cvz_-5Jh.js} +1 -1
- package/dist/assets/{renderShortcut-X-CJUSM8.js → renderShortcut-BE8QI9Yi.js} +1 -1
- package/dist/assets/{reveal-component-nZIAapoD.js → reveal-component-B6FIsdxS.js} +2 -2
- package/dist/assets/rotate-cw-CESctpLh.js +1 -0
- package/dist/assets/run-page-DpA2Hz2h.js +1 -0
- package/dist/assets/{scratchpad-panel-BleGt2KM.js → scratchpad-panel-FahrbepP.js} +1 -1
- package/dist/assets/{secrets-panel-D3BpDIgg.js → secrets-panel-Cf-U5wY0.js} +1 -1
- package/dist/assets/select-C1IYgK48.js +1 -0
- package/dist/assets/session-panel-2w7efICk.js +1 -0
- package/dist/assets/share-BZW3tzEX.js +1 -0
- package/dist/assets/{skeleton-BKeh8hf3.js → skeleton-CLUBZ15q.js} +1 -1
- package/dist/assets/{snippets-panel-D5yy7kj0.js → snippets-panel-CvdCemOl.js} +1 -1
- package/dist/assets/{state-B6AklCzD.js → state-CJnYkzhz.js} +1 -1
- package/dist/assets/state-DuyHh3Fk.js +3 -0
- package/dist/assets/switch-DhPDzMo3.js +1 -0
- package/dist/assets/{terminal-CQAFGBfN.js → terminal-DH54UV0y.js} +2 -2
- package/dist/assets/tooltip-BvU0ko_d.js +1 -0
- package/dist/assets/tracing-CnQSHm2x.js +1 -0
- package/dist/assets/tracing-panel-BZHx8nXa.js +2 -0
- package/dist/assets/tree-actions-5rg4Zqxe.js +1 -0
- package/dist/assets/{useAddCell-DdB_uBif.js → useAddCell-4vmbxGw5.js} +1 -1
- package/dist/assets/{useBoolean-BXC4CItZ.js → useBoolean-zcg-oxnj.js} +1 -1
- package/dist/assets/useCellActionButton-BQY2nyr_.js +1 -0
- package/dist/assets/{useDeleteCell-Bz49_cFj.js → useDeleteCell-CM1QzkEs.js} +1 -1
- package/dist/assets/useDependencyPanelTab-BsALWNfv.js +1 -0
- package/dist/assets/useInstallPackage-Cr0TevQm.js +1 -0
- package/dist/assets/useNotebookActions-BxNtZieS.js +10 -0
- package/dist/assets/{useRunCells-CX7oW5zy.js → useRunCells-C2e26LhV.js} +1 -1
- package/dist/assets/{useSplitCell-Dy2_DmJR.js → useSplitCell-CJ8nGq_h.js} +1 -1
- package/dist/assets/{vega-component-C7TCzyaU.js → vega-component-Z8mt9AUF.js} +1 -1
- package/dist/assets/{write-secret-modal-D6zoZgLY.js → write-secret-modal-CSWlDX_Z.js} +1 -1
- package/dist/index.html +36 -35
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +7 -2
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +2 -6
- package/src/components/data-table/column-visibility-dropdown.tsx +9 -3
- package/src/components/datasources/components.tsx +4 -2
- package/src/components/editor/chrome/components/feedback-button.tsx +10 -9
- package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +143 -0
- package/src/components/editor/chrome/panels/packages-panel.tsx +145 -51
- package/src/components/editor/code/__tests__/readonly-diff.test.tsx +65 -0
- package/src/components/editor/code/readonly-diff.tsx +1 -1
- package/src/components/editor/file-tree/__tests__/tree-actions.test.tsx +54 -0
- package/src/components/editor/file-tree/tree-actions.tsx +11 -14
- package/src/components/editor/package-alert.tsx +25 -1
- package/src/components/home/components.tsx +17 -0
- package/src/components/pages/gallery-page.tsx +2 -4
- package/src/components/pages/home-page.tsx +2 -4
- package/src/components/terminal/terminal.tsx +4 -4
- package/src/core/cells/pending-delete-service.ts +12 -16
- package/src/core/codemirror/language/__tests__/sql.test.ts +70 -2
- package/src/core/codemirror/language/languages/sql/sql.ts +16 -1
- package/src/core/datasets/__tests__/data-source.test.ts +2 -0
- package/src/core/datasets/data-source-connections.ts +15 -10
- package/src/core/islands/__tests__/parse.test.ts +140 -7
- package/src/core/islands/parse.ts +20 -0
- package/src/core/packages/__tests__/useInstallPackage.test.tsx +47 -1
- package/src/core/packages/toast-components.tsx +26 -0
- package/src/core/packages/useInstallPackage.ts +7 -2
- package/src/core/runtime/__tests__/runtime.test.ts +11 -0
- package/src/core/runtime/runtime.ts +7 -2
- package/src/core/wasm/bridge.ts +1 -0
- package/src/plugins/layout/AccordionPlugin.tsx +7 -2
- package/src/plugins/layout/__test__/AccordionPlugin.test.tsx +66 -0
- package/dist/assets/JsonOutput-CzIGPEZQ.js +0 -50
- package/dist/assets/LazyAnyLanguageCodeMirror-LboTfNDv.js +0 -2
- package/dist/assets/add-cell-with-ai-R-3DS79K.js +0 -76
- package/dist/assets/agent-panel-Cgt_K0tD.js +0 -286
- package/dist/assets/ai-model-dropdown-DCmiuk7x.js +0 -3
- package/dist/assets/app-config-button-DUJC6b6x.js +0 -1
- package/dist/assets/cell-editor-Dw09J9yD.js +0 -21
- package/dist/assets/cell-link-6burT2XF.js +0 -1
- package/dist/assets/chat-display-Bu405iyc.js +0 -1
- package/dist/assets/components-C7mWrmXr.js +0 -1
- package/dist/assets/dist-DzCQtGkt.js +0 -1
- package/dist/assets/dropdown-menu-C40jM9o4.js +0 -1
- package/dist/assets/edit-page-xlMlcLnI.js +0 -9
- package/dist/assets/file-explorer-panel-s0ohSG_L.js +0 -1
- package/dist/assets/file-icons-DdGYuADJ.js +0 -1
- package/dist/assets/gallery-page-C3pBpHlY.js +0 -1
- package/dist/assets/home-page-BLd6rnbk.js +0 -4
- package/dist/assets/index-4n22QjCD.js +0 -29
- package/dist/assets/logs-panel-BGS2v3ba.js +0 -1
- package/dist/assets/packages-panel-BdpRg9tX.js +0 -1
- package/dist/assets/panel-accordion-state-DjUTN7i5.js +0 -1
- package/dist/assets/panels-CWn0Yh1D.js +0 -4
- package/dist/assets/paths-zcL04qUW.js +0 -1
- package/dist/assets/process-output-Ck7-P_xp.js +0 -1
- package/dist/assets/readonly-code-display--S2daDa6.js +0 -1
- package/dist/assets/run-page-9pl8qhQR.js +0 -1
- package/dist/assets/select-nLt2y0Sw.js +0 -1
- package/dist/assets/session-panel-DRGPlL5J.js +0 -1
- package/dist/assets/share-CPtBiNgr.js +0 -1
- package/dist/assets/state-Di9TbuV9.js +0 -3
- package/dist/assets/switch-DjXr9Y9D.js +0 -1
- package/dist/assets/tooltip-BUtPzKB4.js +0 -1
- package/dist/assets/tracing-DNk3gmWv.js +0 -1
- package/dist/assets/tracing-panel-Yqazr6w_.js +0 -2
- package/dist/assets/tree-actions-CG5g7aUQ.js +0 -1
- package/dist/assets/useCellActionButton-B31neI3m.js +0 -1
- package/dist/assets/useDependencyPanelTab-C_ps0r--.js +0 -1
- package/dist/assets/useInstallPackage-DsD08SLK.js +0 -1
- package/dist/assets/useNotebookActions-CQtbk9CB.js +0 -10
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,t as i,u as a}from"./useEvent-xfs0Sn4r.js";import{t as o}from"./react-CBDbhulC.js";import{Bt as s,Cn as c,K as ee,Sn as l,Tn as u,Vn as d,_n as f,bn as p,gn as m,kn as h,mn as g,vn as _,xn as v}from"./cells-Cp-G34Rz.js";import{t as y}from"./compiler-runtime-CYIjoINj.js";import{t as b}from"./cn-ldLVeaqm.js";import{t as x}from"./jsx-runtime-B74pBk57.js";import{d as te}from"./alert-dialog-CA-2mBs3.js";import{a as ne,n as re,o as ie,t as ae}from"./tooltip-BUtPzKB4.js";import{t as oe}from"./useCellActionButton-B31neI3m.js";import{a as se,i as ce}from"./renderShortcut-X-CJUSM8.js";var S=y(),C=e(o(),1),w=x(),T=C.memo(C.forwardRef((e,t)=>{let n=(0,S.c)(39),{children:r,showTooltip:a,...o}=e,s=a===void 0||a,[y,x]=(0,C.useState)(!1),T;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>x(!1),n[0]=T):T=n[0];let E=T,D=(0,C.useRef)(null),j=oe({cell:o,closePopover:E}).map(O).filter(k),M=te(),N;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{ee(()=>{D.current&&D.current.scrollIntoView({behavior:`auto`,block:`nearest`})})},n[1]=N):N=n[1];let P=i(N),F;n[2]===P?F=n[3]:(F=e=>{x(t=>{let n=typeof e==`function`?e(t):e;return n&&P(),n})},n[2]=P,n[3]=F);let I=i(F),L;n[4]===I?L=n[5]:(L=()=>({toggle:()=>I(A)}),n[4]=I,n[5]=L),(0,C.useImperativeHandle)(t,L);let R=m,z=_,B=d(o.cellId),V;n[6]===B?V=n[7]:(V=(0,w.jsx)(l,{placeholder:`Search actions...`,className:`h-6 m-1`,...B}),n[6]=B,n[7]=V);let H=h,U;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,w.jsx)(p,{children:`No results`}),n[8]=U):U=n[8];let W=j.map((e,t)=>(0,w.jsxs)(C.Fragment,{children:[(0,w.jsx)(v,{children:e.map(e=>{let t=(0,w.jsxs)(`div`,{className:`flex items-center flex-1`,children:[e.icon&&(0,w.jsx)(`div`,{className:`mr-2 w-5 text-muted-foreground`,children:e.icon}),(0,w.jsx)(`div`,{className:`flex-1`,children:e.label}),(0,w.jsxs)(`div`,{className:`shrink-0 text-sm`,children:[e.hotkey&&ce(e.hotkey),e.rightElement]})]});return e.tooltip&&(t=(0,w.jsx)(ae,{content:e.tooltip,delayDuration:100,children:t})),(0,w.jsx)(c,{className:b(e.disabled&&`opacity-50!`),onSelect:()=>{e.disableClick||e.disabled||(e.handle(),x(!1))},variant:e.variant,children:t},e.label)})},t),t<j.length-1&&(0,w.jsx)(u,{})]},t)),G;n[9]!==H||n[10]!==U||n[11]!==W?(G=(0,w.jsxs)(H,{children:[U,W]}),n[9]=H,n[10]=U,n[11]=W,n[12]=G):G=n[12];let K;n[13]!==z||n[14]!==G||n[15]!==V?(K=(0,w.jsxs)(z,{children:[V,G]}),n[13]=z,n[14]=G,n[15]=V,n[16]=K):K=n[16];let q;n[17]!==R||n[18]!==M||n[19]!==K?(q=(0,w.jsx)(R,{className:`w-[300px] p-0 pt-1 overflow-auto`,scrollable:!0,...M,children:K}),n[17]=R,n[18]=M,n[19]=K,n[20]=q):q=n[20];let J=q;if(!s){let e;n[21]===r?e=n[22]:(e=(0,w.jsx)(f,{asChild:!0,children:r}),n[21]=r,n[22]=e);let t;return n[23]!==J||n[24]!==I||n[25]!==y||n[26]!==e?(t=(0,w.jsxs)(g,{open:y,onOpenChange:I,children:[e,J]}),n[23]=J,n[24]=I,n[25]=y,n[26]=e,n[27]=t):t=n[27],t}let Y;n[28]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,w.jsx)(re,{tabIndex:-1,children:se(`cell.cellActions`)}),n[28]=Y):Y=n[28];let X=!y&&Y,Z;n[29]===r?Z=n[30]:(Z=(0,w.jsx)(ie,{ref:D,children:(0,w.jsx)(f,{className:`flex`,children:r})}),n[29]=r,n[30]=Z);let Q;n[31]!==X||n[32]!==Z?(Q=(0,w.jsxs)(ne,{delayDuration:200,disableHoverableContent:!0,children:[X,Z]}),n[31]=X,n[32]=Z,n[33]=Q):Q=n[33];let $;return n[34]!==J||n[35]!==I||n[36]!==y||n[37]!==Q?($=(0,w.jsxs)(g,{open:y,onOpenChange:I,children:[Q,J]}),n[34]=J,n[35]=I,n[36]=y,n[37]=Q,n[38]=$):$=n[38],$})),E=C.memo(e=>{let t=(0,S.c)(5),{children:n,cellId:i}=e,a;t[0]===i?a=t[1]:(a=s(i),t[0]=i,t[1]=a);let o=r(a);if(!o)return null;let c;return t[2]!==n||t[3]!==o?(c=(0,w.jsx)(T,{showTooltip:!1,...o,children:n}),t[2]=n,t[3]=o,t[4]=c):c=t[4],c});E.displayName=`ConnectionCellActionsDropdown`;function D(e){return!e.redundant}function O(e){return e.filter(D)}function k(e){return e.length>0}function A(e){return!e}var j=n(`minimap`);function M(){let e=(0,S.c)(3),[n,r]=t(j),i;return e[0]!==n||e[1]!==r?(i={dependencyPanelTab:n,setDependencyPanelTab:r},e[0]=n,e[1]=r,e[2]=i):i=e[2],i}function N(){return a(j)}export{E as i,N as n,T as r,M as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t}from"./useEvent-xfs0Sn4r.js";import{t as n}from"./react-CBDbhulC.js";import{g as r}from"./useEventListener-92uWqz-P.js";import{t as i}from"./jsx-runtime-B74pBk57.js";import{r as a}from"./requests-C6_IaFh7.js";import{t as o}from"./use-toast-DpWHUGuF.js";import{t as s}from"./kbd-Cwh96ZBE.js";var c=t(null),l=`packages-install-input`,u=()=>{requestAnimationFrame(()=>{let e=document.getElementById(l);e&&e.focus()})},d=e=>{e.openApplication(`packages`),u()},f=e(n(),1),p=i(),m=(e,t)=>{let n=Array.isArray(e)?e:[e];o(t?{title:n.length>1?`Failed to add packages`:`Failed to add package`,description:t,variant:`danger`}:{title:n.length>1?`Packages added`:`Package added`,description:(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`div`,{children:[n.length>1?`The packages `:`The package `,n.map((e,t)=>(0,p.jsxs)(`span`,{children:[t>0&&`, `,(0,p.jsx)(s,{className:`inline`,children:e})]},e)),` `,`and `,n.length>1?`their`:`its`,` dependencies have been added to your environment.`]}),(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})},h=(e,t)=>{o(t?{title:`Failed to upgrade package`,description:t,variant:`danger`}:{title:`Package upgraded`,description:(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`div`,{children:[`The package `,(0,p.jsx)(s,{className:`inline`,children:e}),` has been upgraded.`]}),(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})},g=(e,t)=>{o(t?{title:`Failed to remove package`,description:t,variant:`danger`}:{title:`Package removed`,description:(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`div`,{children:[`The package `,(0,p.jsx)(s,{className:`inline`,children:e}),` has been removed from your environment.`]}),(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})};function _(){let[e,t]=(0,f.useState)(!1),{addPackage:n}=a();return{loading:e,handleInstallPackages:async(e,i)=>{t(!0);try{let t=await n({package:e.join(` `)});t.success?m(e):m(e,t.error),i?.()}catch(e){r.error(e)}finally{t(!1)}}}}export{u as a,l as i,g as n,d as o,h as r,c as s,_ as t};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,r as i,u as a}from"./useEvent-xfs0Sn4r.js";import{t as o}from"./react-CBDbhulC.js";import{$i as s,$r as c,Co as l,D as u,E as d,Hi as f,Jr as p,Kn as m,La as h,Po as g,Qi as _,Qr as v,Rt as y,Tt as b,Vi as x,_ as S,aa as C,b as w,di as T,dn as E,ea as D,ei as ee,h as te,la as ne,mo as O,ni as k,or as A,ra as j,ri as M,t as re,un as N,yo as P}from"./cells-Cp-G34Rz.js";import{Cn as F,kt as I,vt as L}from"./schemas-aTUejmFi.js";import{t as R}from"./compiler-runtime-CYIjoINj.js";import{r as ie,w as z}from"./utils-D5Ywm7-q.js";import{C as B,n as V,r as H}from"./ai-model-dropdown-DCmiuk7x.js";import{g as U,n as W}from"./useEventListener-92uWqz-P.js";import{t as ae}from"./objects-snlMn4yk.js";import{n as G,t as K}from"./constants-BDbGiS7O.js";import{A as q,M as oe,N as J,O as se,T as ce,j as le,k as ue,v as de}from"./config-BlNM0caL.js";import{t as fe}from"./switch-DjXr9Y9D.js";import{g as pe,h as me,m as he,y as ge}from"./readonly-python-code-DpIyjHqY.js";import{t as _e}from"./cn-ldLVeaqm.js";import{t as ve}from"./jsx-runtime-B74pBk57.js";import{o as ye}from"./alert-dialog-CA-2mBs3.js";import{i as be,n as xe,r as Se,t as Ce}from"./tabs-Cy1qXLzH.js";import{a as we,c as Te,i as Ee,n as De,r as Oe,s as ke,t as Ae}from"./select-nLt2y0Sw.js";import{$ as je,Lt as Me}from"./JsonOutput-CzIGPEZQ.js";import{a as Ne,c as Pe,o as Fe,p as Ie,t as Le}from"./download-DMxOzI7b.js";import{t as Re}from"./tooltip-BUtPzKB4.js";import{n as ze,r as Be,t as Ve}from"./button-Dh8EwhsF.js";import{i as He,r as Ue,t as We}from"./strings-CReV1AYG.js";import{r as Ge}from"./requests-C6_IaFh7.js";import{t as Y}from"./createLucideIcon-B7HeEoG2.js";import{L as Ke,R as qe,c as Je,l as Ye,t as Xe,z as Ze}from"./layout-DWnrxIo2.js";import{t as Qe}from"./check-BoA6XBpj.js";import{r as $e}from"./useCellActionButton-B31neI3m.js";import{t as et}from"./code-CF0HKE9K.js";import{t as tt}from"./copy-BMXKNElG.js";import{t as nt}from"./eye-off-CFuPxa9F.js";import{t as rt}from"./external-link-Bp3BxyRA.js";import{t as it}from"./file-DF8n85RA.js";import{t as at}from"./globe-BQf75qV_.js";import{n as ot,r as st,t as ct}from"./youtube-DCJ-ihUU.js";import{n as lt}from"./components-DUYCXngU.js";import{i as ut,n as dt,r as ft}from"./markdown-export-0rLbaq8b.js";import{t as pt}from"./image-ab13yGv4.js";import{D as mt,E as ht,O as gt,T as _t,b as vt,j as yt}from"./write-secret-modal-D6zoZgLY.js";import{t as bt}from"./link-Cap-MZiw.js";import{t as xt}from"./spinner-Ck-Hgfvj.js";import{r as St}from"./input-DEbY281O.js";import{t as Ct}from"./settings-C-cYas75.js";import{t as wt}from"./square-B58Ib8Ir.js";import{t as Tt}from"./triangle-alert-MihykDYG.js";import{t as Et}from"./use-toast-DpWHUGuF.js";import{n as Dt,t as Ot}from"./paths-zcL04qUW.js";import{o as kt}from"./session-Sz5nSFku.js";import{n as At}from"./useAsyncData-Buhk-UgR.js";import{n as jt}from"./copy-DlEomWzI.js";import{t as Mt}from"./copy-icon-z8fuTE3w.js";import{r as Nt}from"./useRunCells-CX7oW5zy.js";import{r as Pt,t as Ft}from"./share-CPtBiNgr.js";import{n as It,t as Lt}from"./alert-dmKwNsrp.js";import{a as Rt}from"./cell-link-6burT2XF.js";import{t as zt}from"./icons-CjLa9BiH.js";import{i as Bt,n as Vt}from"./error-entries-Cv2m1yhc.js";import{t as Ht}from"./shell-DLpUCctE.js";import{t as Ut}from"./pair-with-agent-modal-CbUFKJHP.js";import{i as Wt,n as Gt,r as Kt}from"./add-connection-dialog-BGfpw5lC.js";import{t as qt}from"./github-YRgb6LMu.js";import{n as Jt}from"./marimo-icons-C3KxMV9A.js";import{t as Yt}from"./links-DLvOXyO_.js";import{i as Xt,n as Zt,t as Qt}from"./skeleton-BKeh8hf3.js";var $t=Y(`circle-chevron-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 10-4 4-4-4`,key:`894hmk`}]]),en=Y(`circle-chevron-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m10 8 4 4-4 4`,key:`1wy4r4`}]]),tn=Y(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),nn=Y(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),rn=Y(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),an=Y(`diamond-plus`,[[`path`,{d:`M12 8v8`,key:`napkw2`}],[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z`,key:`1ey20j`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),on=Y(`fast-forward`,[[`path`,{d:`M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z`,key:`b19h5q`}],[`path`,{d:`M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z`,key:`h7h5ge`}]]),sn=Y(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),cn=Y(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ln=Y(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),un=Y(`notebook`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M16 2v20`,key:`rotuqe`}]]),dn=Y(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),fn=Y(`presentation`,[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]),pn=Y(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),mn=Y(`square-power`,[[`path`,{d:`M12 7v4`,key:`xawao1`}],[`path`,{d:`M7.998 9.003a5 5 0 1 0 8-.005`,key:`1pek45`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),hn=Y(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),X=ve(),Z=R(),Q=e(o(),1);function gn(e,t){let n=(0,Z.c)(11),r;n[0]===t?r=n[1]:(r=new O(t),n[0]=t,n[1]=r);let i=r,a;n[2]!==e||n[3]!==i?(a=()=>i.get(e),n[2]=e,n[3]=i,n[4]=a):a=n[4];let[o,s]=(0,Q.useState)(a),c;n[5]!==e||n[6]!==i?(c=t=>{s(t),i.set(e,t)},n[5]=e,n[6]=i,n[7]=c):c=n[7];let l=c,u;return n[8]!==l||n[9]!==o?(u=[o,l],n[8]=l,n[9]=o,n[10]=u):u=n[10],u}function _n(e,t){return{...e,Binaries:{...e.Binaries,Browser:t}}}function vn(e,t,n,r){return{marimo:e,Locale:n||void 0,Binaries:{Browser:t},"Environment Collection Error":r}}function yn(e,t){let n=Math.max(2,...Array.from(t.matchAll(/`+/g),e=>e[0].length)),r="`".repeat(n+1);return`${r}${e}\n${t}\n${r}`}function bn(e,t){let n=e.includes(`?`)?`&`:`?`,r=[],i=e,a=0;for(let[e,o]of Object.entries(t)){if(o.length===0)continue;let t=`${e}=${encodeURIComponent(o)}`,s=`${i}${a===0?n:`&`}${t}`;if(s.length>6e3){r.push(e);continue}i=s,a+=1}return{url:i,omitted:r}}function xn(e,t){return[`<details>`,`<summary>${We.htmlEscape(e)??``}</summary>`,``,t,``,`</details>`].join(`
|
|
2
|
-
`)}function Sn(e){return xn(`Environment`,yn(`json`,JSON.stringify(e,null,2)))}function Cn(e){return xn(`Errors`,yn(`text`,e.map(Vt).join(`
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
`)))}function wn(e){return xn(`Code`,yn(`python`,e))}var Tn=W,En=e=>{let t=(0,Z.c)(16),{content:n}=e,[r,i]=(0,Q.useState)(!1),a=!r&&`max-h-24 overflow-hidden`,o;t[0]===a?o=t[1]:(o=_e(`text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap`,a),t[0]=a,t[1]=o);let s;t[2]!==n||t[3]!==o?(s=(0,X.jsx)(`pre`,{className:o,children:n}),t[2]=n,t[3]=o,t[4]=s):s=t[4];let c;t[5]===r?c=t[6]:(c=!r&&(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 rounded-b bg-gradient-to-b from-transparent to-muted`}),t[5]=r,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,X.jsxs)(`div`,{className:`relative`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>i(kn),t[10]=u):u=t[10];let d=r?`Show less`:`Show more`,f;t[11]===d?f=t[12]:(f=(0,X.jsx)(Ve,{type:`button`,variant:`link`,size:`xs`,className:`self-start`,onClick:u,children:d}),t[11]=d,t[12]=f);let p;return t[13]!==l||t[14]!==f?(p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15],p},Dn=e=>{let t=(0,Z.c)(6),{children:n}=e,{openModal:r,closeModal:i}=vt(),a;t[0]!==i||t[1]!==r?(a=()=>r((0,X.jsx)(On,{onClose:i})),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n||t[4]!==a?(o=(0,X.jsx)(Tn,{onClick:a,children:n}),t[3]=n,t[4]=a,t[5]=o):o=t[5],o},On=()=>{let e=(0,Z.c)(84),{getEnvironmentInfo:t,readCode:n}=Ge(),a,o;e[0]===t?(a=e[1],o=e[2]):(a=async()=>t(),o=[t],e[0]=t,e[1]=a,e[2]=o);let s=At(a,o),c=r(w),l;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=Bt(i),e[3]=l):l=e[3];let u=l,d;if(e[4]!==c.cellData||e[5]!==c.cellIds.inOrderIds){let t;e[7]===c.cellData?t=e[8]:(t=e=>c.cellData[e],e[7]=c.cellData,e[8]=t),d=c.cellIds.inOrderIds.map(t),e[4]=c.cellData,e[5]=c.cellIds.inOrderIds,e[6]=d}else d=e[6];let f=Ye(d),p=r(P),h=r(de),g=p!==null&&f&&h.state===ce.OPEN,_=g?void 0:p===null?`Save the notebook first.`:f?`Connect the notebook to include its source.`:`Notebook source is hidden in this view.`,[v,y]=gn(`marimo:issue-report:include-errors`,!1),[b,x]=gn(`marimo:issue-report:include-code`,!1),S;e[9]!==s.data||e[10]!==s.status?(S=s.data?_n(s.data,navigator.userAgent):s.status===`error`?vn(ge(),navigator.userAgent,navigator.language,`Server environment information unavailable`):void 0,e[9]=s.data,e[10]=s.status,e[11]=S):S=e[11];let C=S,T,E;e[12]!==b||e[13]!==g||e[14]!==n?(T=async()=>{if(!b||!g)return;let{contents:e}=await n();return e},E=[b,g,n],e[12]=b,e[13]=g,e[14]=n,e[15]=T,e[16]=E):(T=e[15],E=e[16]);let D=At(T,E),ee;bb0:{if(!C){let t;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[17]=t):t=e[17];let n;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(n={url:G.bugReportUrl,omitted:t},e[18]=n):n=e[18],ee=n;break bb0}let t;if(e[19]!==D.data||e[20]!==C||e[21]!==b||e[22]!==v){let n={env:Sn(C)};v&&u.length>0&&(n[`bug-description`]=Cn(u)),b&&D.data&&(n[`reproduction-code`]=wn(D.data)),t=bn(G.bugReportUrl,n),e[19]=D.data,e[20]=C,e[21]=b,e[22]=v,e[23]=t}else t=e[23];ee=t}let{url:te,omitted:ne}=ee,O;e[24]===ne?O=e[25]:(O=ne.map(An).join(`, `),e[24]=ne,e[25]=O);let k=O,A;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,X.jsxs)(gt,{children:[(0,X.jsx)(yt,{children:`Report an issue`}),(0,X.jsx)(ht,{children:`Open a GitHub bug report prefilled with your environment, and optionally your current errors and notebook code. Nothing is uploaded automatically; review the details before posting.`})]}),e[26]=A):A=e[26];let j;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,X.jsx)(rt,{className:`w-4 h-4 mr-2`}),e[27]=j):j=e[27];let M;e[28]===te?M=e[29]:(M=(0,X.jsx)(Ve,{type:`button`,variant:`default`,size:`xs`,asChild:!0,className:`self-start`,children:(0,X.jsxs)(`a`,{href:te,target:`_blank`,rel:`noreferrer`,children:[j,`Open GitHub issue`]})}),e[28]=te,e[29]=M);let re;e[30]===y?re=e[31]:(re=e=>y(e===!0),e[30]=y,e[31]=re);let N;e[32]!==v||e[33]!==re?(N=(0,X.jsx)(m,{id:`issue-include-errors`,checked:v,disabled:u.length===0,onCheckedChange:re,"aria-label":`Include errors`}),e[32]=v,e[33]=re,e[34]=N):N=e[34];let F;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,X.jsx)(`label`,{htmlFor:`issue-include-errors`,children:`Include errors`}),e[35]=F):F=e[35];let I;e[36]===N?I=e[37]:(I=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[N,F]}),e[36]=N,e[37]=I);let L=!g,R;e[38]===x?R=e[39]:(R=e=>x(e===!0),e[38]=x,e[39]=R);let ie;e[40]!==b||e[41]!==L||e[42]!==R?(ie=(0,X.jsx)(m,{id:`issue-include-code`,checked:b,disabled:L,onCheckedChange:R,"aria-label":`Include notebook code`}),e[40]=b,e[41]=L,e[42]=R,e[43]=ie):ie=e[43];let z;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsx)(`label`,{htmlFor:`issue-include-code`,children:`Include notebook code`}),e[44]=z):z=e[44];let B;e[45]===ie?B=e[46]:(B=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[ie,z]}),e[45]=ie,e[46]=B);let V;e[47]===_?V=e[48]:(V=_&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground ml-6`,children:_}),e[47]=_,e[48]=V);let H;e[49]!==D.status||e[50]!==b?(H=b&&D.status===`error`&&(0,X.jsx)(`span`,{className:`text-xs text-(--red-11) ml-6`,children:`Notebook source could not be loaded.`}),e[49]=D.status,e[50]=b,e[51]=H):H=e[51];let U;e[52]!==B||e[53]!==V||e[54]!==H?(U=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[B,V,H]}),e[52]=B,e[53]=V,e[54]=H,e[55]=U):U=e[55];let W;e[56]!==I||e[57]!==U?(W=(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[I,U]}),e[56]=I,e[57]=U,e[58]=W):W=e[58];let ae;e[59]===k?ae=e[60]:(ae=k?(0,X.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-(--yellow-11)`,children:[(0,X.jsx)(Tt,{className:`w-3.5 h-3.5 shrink-0 mt-0.5`}),(0,X.jsxs)(`span`,{children:[`Too large to prefill and left out of the link: `,k,`. Paste them into the issue manually.`]})]}):(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your environment is always included.`}),e[59]=k,e[60]=ae);let K;e[61]!==M||e[62]!==W||e[63]!==ae?(K=(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[M,W,ae]}),e[61]=M,e[62]=W,e[63]=ae,e[64]=K):K=e[64];let q;e[65]===s.status?q=e[66]:(q=s.status===`pending`&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading environment details…`}),(0,X.jsx)(Qt,{className:`h-4 w-full`}),(0,X.jsx)(Qt,{className:`h-4 w-3/4`}),(0,X.jsx)(Qt,{className:`h-4 w-1/2`})]}),e[65]=s.status,e[66]=q);let oe;e[67]===s?oe=e[68]:(oe=s.status===`error`&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,X.jsx)(Tt,{className:`w-4 h-4 text-(--yellow-11) shrink-0`}),(0,X.jsx)(`span`,{children:`Server environment information unavailable`}),(0,X.jsx)(Ve,{type:`button`,variant:`link`,size:`xs`,onClick:()=>s.refetch(),children:`Retry`})]}),e[67]=s,e[68]=oe);let J;e[69]===C?J=e[70]:(J=C&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:`Environment details`}),(0,X.jsx)(Mt,{className:`w-3.5 h-3.5`,value:JSON.stringify(C,null,2),ariaLabel:`Copy environment JSON`,toastTitle:`Environment details copied`})]}),(0,X.jsx)(En,{content:JSON.stringify(C,null,2)})]}),e[69]=C,e[70]=J);let se;e[71]===C?se=e[72]:(se=C&&u.length>0&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:`Errors`}),(0,X.jsx)(Mt,{className:`w-3.5 h-3.5`,value:Cn(u),ariaLabel:`Copy errors`,toastTitle:`Errors copied`})]}),(0,X.jsx)(En,{content:u.map(Vt).join(`
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
`)})]}),e[71]=C,e[72]=se);let le;e[73]===C?le=e[74]:(le=C&&u.length===0&&(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No errors detected.`}),e[73]=C,e[74]=le);let ue;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,X.jsx)(`a`,{href:G.feedbackForm,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`two-minute survey`}),e[75]=ue):ue=e[75];let fe;e[76]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,X.jsx)(`div`,{className:`border-t pt-3`,children:(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Other feedback? Take our`,` `,ue,` `,`or chat with us on`,` `,(0,X.jsx)(`a`,{href:G.discordLink,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`Discord`}),`.`]})}),e[76]=fe):fe=e[76];let pe;return e[77]!==K||e[78]!==q||e[79]!==oe||e[80]!==J||e[81]!==se||e[82]!==le?(pe=(0,X.jsxs)(_t,{className:`w-[540px] max-w-[90vw]`,children:[A,(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 max-h-[60vh] overflow-y-auto`,children:[K,q,oe,J,se,le,fe]})]}),e[77]=K,e[78]=q,e[79]=oe,e[80]=J,e[81]=se,e[82]=le,e[83]=pe):pe=e[83],pe};function kn(e){return!e}function An(e){return e===`bug-description`?`errors`:e===`reproduction-code`?`code`:e}var jn=`https://static.marimo.app`,Mn=e=>{let t=(0,Z.c)(26),{onClose:n}=e,[r,i]=(0,Q.useState)(``),{exportAsHTML:a}=Ge(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=Math.random().toString(36).slice(2,6),t[0]=o):o=t[0];let s=`${r}-${o}`,c=`${jn}/static/${s}`,l;t[1]!==a||t[2]!==n||t[3]!==s?(l=async e=>{e.preventDefault(),n();let{contents:t}=await a({download:!1,includeCode:!0,files:Je.INSTANCE.filenames(),layout:await Xe()}),r=Et({title:`Uploading static notebook...`,description:`Please wait.`});await fetch(`${jn}/api/static`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({html:t,path:s})}).catch(()=>{r.dismiss(),Et({title:`Error uploading static page`,description:(0,X.jsxs)(`div`,{children:[`Please try again later. If the problem persists, please file a bug report on`,` `,(0,X.jsx)(`a`,{href:G.issuesPage,target:`_blank`,className:`underline`,children:`GitHub`}),`.`]})})}),r.dismiss(),Et({title:`Static page uploaded!`,description:(0,X.jsxs)(`div`,{children:[`The URL has been copied to your clipboard.`,(0,X.jsx)(`br`,{}),`You can share it with anyone.`]})})},t[1]=a,t[2]=n,t[3]=s,t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsx)(yt,{children:`Share static notebook`}),t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsxs)(gt,{children:[u,(0,X.jsxs)(ht,{children:[`You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on`,` `,(0,X.jsx)(`a`,{href:jn,target:`_blank`,children:jn}),`.`]})]}),t[6]=d):d=t[6];let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=e.target.value.toLowerCase().replaceAll(/\s/g,`-`).replaceAll(/[^\da-z-]/g,``);i(t)},t[7]=f):f=t[7];let p;t[8]===r?p=t[9]:(p=(0,X.jsx)(St,{"data-testid":`slug-input`,id:`slug`,autoFocus:!0,value:r,placeholder:`Notebook slug`,onChange:f,required:!0,autoComplete:`off`}),t[8]=r,t[9]=p);let m;t[10]===c?m=t[11]:(m=(0,X.jsxs)(`div`,{className:`font-semibold text-sm text-muted-foreground gap-2 flex flex-col`,children:[`Anyone will be able to access your notebook at this URL:`,(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Nn,{text:c}),(0,X.jsx)(`span`,{className:`text-primary`,children:c})]})]}),t[10]=c,t[11]=m);let h;t[12]!==p||t[13]!==m?(h=(0,X.jsxs)(`div`,{className:`flex flex-col gap-6 py-4`,children:[p,m]}),t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===n?g=t[16]:(g=(0,X.jsx)(Ve,{"data-testid":`cancel-share-static-notebook-button`,variant:`secondary`,onClick:n,children:`Cancel`}),t[15]=n,t[16]=g);let _;t[17]===c?_=t[18]:(_=(0,X.jsx)(Ve,{"data-testid":`share-static-notebook-button`,"aria-label":`Save`,variant:`default`,type:`submit`,onClick:async()=>{await jt(c)},children:`Create`}),t[17]=c,t[18]=_);let v;t[19]!==_||t[20]!==g?(v=(0,X.jsxs)(mt,{children:[g,_]}),t[19]=_,t[20]=g,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==l||t[24]!==h?(y=(0,X.jsx)(_t,{className:`w-fit`,children:(0,X.jsxs)(`form`,{onSubmit:l,children:[d,h,v]})}),t[22]=v,t[23]=l,t[24]=h,t[25]=y):y=t[25],y},Nn=e=>{let t=(0,Z.c)(8),[n,r]=Q.useState(!1),i;t[0]===e.text?i=t[1]:(i=Be.stopPropagation(async t=>{t.preventDefault(),await jt(e.text),r(!0),setTimeout(()=>r(!1),2e3)}),t[0]=e.text,t[1]=i);let a=i,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(tt,{size:14,strokeWidth:1.5}),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,X.jsx)(Ve,{"data-testid":`copy-static-notebook-url-button`,onClick:a,size:`xs`,variant:`secondary`,children:o}),t[3]=a,t[4]=s);let c;return t[5]!==n||t[6]!==s?(c=(0,X.jsx)(Re,{content:`Copied!`,open:n,children:s}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c};function Pn(){let e=document.getElementsByClassName(K.outputArea);for(let t of e){let e=t.getBoundingClientRect();if(e.bottom>0&&e.top<window.innerHeight){let e=g.findElement(t);if(!e){U.warn(`Could not find HTMLCellId for visible output area`,t);continue}return{cellId:g.parse(e.id)}}}return U.warn(`No visible output area found for scroll anchor`),null}function Fn(e){if(!e){U.warn(`No scroll anchor provided to restore scroll position`);return}let t=document.getElementById(g.create(e.cellId));if(!t){U.warn(`Could not find cell element to restore scroll position`,e.cellId);return}if(!t.querySelector(`.${K.outputArea}`)){U.warn(`Could not find output area to restore scroll position`,e.cellId);return}t.scrollIntoView({block:`start`,behavior:`auto`})}function In(){let e=(0,Z.c)(2),t=a(oe),n;return e[0]===t?n=e[1]:(n=()=>{let e=Pn();t(t=>({mode:q(t.mode),cellAnchor:e?.cellId??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Fn(e)})})},e[0]=t,e[1]=n),n}var Ln=n(!1),Rn=()=>{let e=(0,Z.c)(7),{selectedLayout:t}=me(),{setLayoutView:n}=he();if(J()&&!T(`wasm_layouts`))return null;let r;e[0]===n?r=e[1]:(r=e=>n(e),e[0]=n,e[1]=r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(ke,{className:`min-w-[110px] border-border bg-background`,"data-testid":`layout-select`,children:(0,X.jsx)(Te,{placeholder:`Select a view`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(De,{children:(0,X.jsxs)(Oe,{children:[(0,X.jsx)(we,{children:`View as`}),pe.map(Hn)]})}),e[3]=a):a=e[3];let o;return e[4]!==t||e[5]!==r?(o=(0,X.jsxs)(Ae,{"data-testid":`layout-select`,value:t,onValueChange:r,children:[i,a]}),e[4]=t,e[5]=r,e[6]=o):o=e[6],o};function zn(e){let t=Bn(e);return(0,X.jsx)(t,{className:`h-4 w-4`})}function Bn(e){switch(e){case`vertical`:return cn;case`grid`:return st;case`slides`:return fn;default:return He(e),wt}}function Vn(e){return We.startCase(e)}function Hn(e){return(0,X.jsx)(Ee,{value:e,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 leading-5`,children:[zn(e),(0,X.jsx)(`span`,{children:Vn(e)})]})},e)}var Un=[`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],Wn=[`pymdown`,`qmd`,`mystmd`,`mdx`],Gn=[`topological`,`top-down`],Kn=[`document`,`slides`],qn=[`source`,`flat`];function Jn(e){return typeof e==`string`&&Un.some(t=>t===e)}var $={html:{includeCode:!0},markdown:{flavor:null},ipynb:{sortMode:`topological`,includeOutputs:!1},pdf:{preset:`document`,includeInputs:!0,includeOutputs:!0,webpdf:!0},script:{type:`source`}};function Yn(e,t){return e.default(t).catch(t)}function Xn(e){return F(e).optional().catch(void 0)}var Zn=F({html:Xn({includeCode:Yn(I(),$.html.includeCode)}),markdown:Xn({flavor:Yn(L(Wn).nullable(),$.markdown.flavor)}),ipynb:Xn({sortMode:Yn(L(Gn),$.ipynb.sortMode),includeOutputs:Yn(I(),$.ipynb.includeOutputs)}),pdf:Xn({preset:Yn(L(Kn),$.pdf.preset),includeInputs:Yn(I(),$.pdf.includeInputs),includeOutputs:Yn(I(),$.pdf.includeOutputs),webpdf:Yn(I(),$.pdf.webpdf)}),script:Xn({type:Yn(L(qn),$.script.type)})}).catch({});function Qn(e,t){let n={...e},r=r=>{n[r]={...e[r],...t[r]}};for(let e of Object.keys(t))r(e);return n}function $n(e){return Qn($,Zn.parse(e))}var er=M({toSerializable:e=>e,fromSerializable:$n}),tr=l(`marimo:export:options:v1`,$,er,{getOnInit:!0}),nr=l(`marimo:export:last-format:v1`,`html`,M({toSerializable:e=>e,fromSerializable:e=>Jn(e)?e:`html`}),{getOnInit:!0}),rr={html:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},markdown:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},ipynb:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},pdf:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},script:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1},png:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1}};function ir(e,t){return e===`wasm`&&t===`pdf`}function ar({format:e,options:t,runtime:n,filename:r,availability:i}){let a=e===`script`&&t.script.type===`source`?{...rr.script,requiresNamedNotebookOnServer:!0}:rr[e],o=ir(n,e);if(n===`wasm`&&a.requiresServerRuntime)return{available:o,reason:{type:`wasm-runtime`}};if(n===`server`&&a.requiresNamedNotebookOnServer&&!r)return{available:!1,reason:{type:`notebook-must-be-named`}};if(n===`wasm`||!a.checksServerAvailability)return{available:!0};if(i.status===`pending`)return{available:!1,reason:{type:`checking-requirements`}};if(i.status===`error`||!i.data)return{available:!0,availabilityCheckFailed:!0};let s=i.data.formats.find(t=>t.format===e);return s?s.dependenciesAvailable?{available:!0}:s.missingPackages.length>0?{available:!1,reason:{type:`missing-packages`,packages:s.missingPackages}}:s.missingSetup.length>0?{available:!1,reason:{type:`missing-setup`,requirements:s.missingSetup}}:{available:!0,availabilityCheckFailed:!0}:{available:!0,availabilityCheckFailed:!0}}function or(e,t){return e.map(e=>({value:e,...t[e]}))}var sr=or([`automatic`,...Wn],{automatic:{label:`Automatic`,description:`Chooses a format from the notebook filename. Defaults to Markdown (.md).`},pymdown:{label:`Markdown (.md)`,description:`Creates a .md file with Python code blocks.`},qmd:{label:`Quarto (.qmd)`,description:`Creates a .qmd file for Quarto.`},mystmd:{label:`MyST (.myst.md)`,description:`Creates a .myst.md file for MyST.`},mdx:{label:`MDX (.mdx)`,description:`Creates a .mdx file for MDX.`}}),cr=or(Gn,{"top-down":{label:`Top to bottom`,description:`Keeps cells in the same order as this notebook.`},topological:{label:`Dependency order`,description:`Reorders cells so each cell appears after the cells it depends on.`}}),lr=or(Kn,{document:{label:`Document`,description:`Creates pages for reading or printing.`},slides:{label:`Slides`,description:`Creates presentation slides from the notebook.`}}),ur=or([`browser`,`latex`],{browser:{label:`Browser`,description:`Uses browser rendering to preserve the notebook's visual output.`},latex:{label:`LaTeX first`,description:`Uses Pandoc and TeX when available, then falls back to browser rendering.`}}),dr=or(qn,{source:{label:`Notebook source`,description:`Downloads the saved notebook source for continued editing in marimo.`},flat:{label:`Flat script`,description:`Reorders cells so the Python script runs from top to bottom.`}}),fr={html:{label:`HTML`,actionLabel:`Export HTML`,description:`Save the current notebook as an HTML page.`,Icon:at,Options:pr},markdown:{label:`Markdown`,actionLabel:`Export Markdown`,description:`Save code and text in a Markdown-based file. Cell outputs are not included.`,Icon:_,Options:mr},ipynb:{label:`Jupyter`,actionLabel:`Export Jupyter notebook`,description:`Open the notebook in Jupyter and other compatible tools.`,Icon:un,Options:hr},pdf:{label:`PDF`,actionLabel:`Export PDF`,description:`Save the notebook as a PDF for printing or sharing.`,Icon:it,Options:gr},script:{label:`Python`,actionLabel:`Export flat script`,description:`Save the notebook as a Python file.`,Icon:et,Options:_r},png:{label:`PNG`,actionLabel:`Export PNG`,description:`Capture the current app view as an image.`,Icon:pt,Options:vr}};function pr(e){let t=(0,Z.c)(7),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={checked:`Includes code cells in the webpage.`,unchecked:`Leaves code cells out of the webpage.`},t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(`html`,{includeCode:e}),t[1]=r,t[2]=o);let s;return t[3]!==i||t[4]!==n.html.includeCode||t[5]!==o?(s=(0,X.jsx)(yr,{children:(0,X.jsx)(br,{label:`Include code`,descriptions:a,checked:n.html.includeCode,disabled:i,onCheckedChange:o})}),t[3]=i,t[4]=n.html.includeCode,t[5]=o,t[6]=s):s=t[6],s}function mr(e){let t=(0,Z.c)(6),{options:n,updateOptions:r,disabled:i}=e,a=n.markdown.flavor??`automatic`,o;t[0]===r?o=t[1]:(o=e=>r(`markdown`,{flavor:e===`automatic`?null:e}),t[0]=r,t[1]=o);let s;return t[2]!==i||t[3]!==a||t[4]!==o?(s=(0,X.jsx)(yr,{children:(0,X.jsx)(Cr,{label:`Format`,value:a,disabled:i,onValueChange:o,options:sr})}),t[2]=i,t[3]=a,t[4]=o,t[5]=s):s=t[5],s}function hr(e){let t=(0,Z.c)(16),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`ipynb`,{sortMode:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.ipynb.sortMode||t[4]!==a?(o=(0,X.jsx)(xr,{label:`Cell order`,value:n.ipynb.sortMode,disabled:i,onValueChange:a,options:cr}),t[2]=i,t[3]=n.ipynb.sortMode,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the Jupyter notebook.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`ipynb`,{includeOutputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.ipynb.includeOutputs||t[11]!==c?(l=(0,X.jsx)(br,{label:`Include outputs`,descriptions:s,checked:n.ipynb.includeOutputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.ipynb.includeOutputs,t[11]=c,t[12]=l):l=t[12];let u;return t[13]!==o||t[14]!==l?(u=(0,X.jsxs)(yr,{children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function gr(e){let t=(0,Z.c)(30),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`pdf`,{preset:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.pdf.preset||t[4]!==a?(o=(0,X.jsx)(xr,{label:`Layout`,value:n.pdf.preset,disabled:i,onValueChange:a,options:lr}),t[2]=i,t[3]=n.pdf.preset,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Includes code cells in the PDF.`,unchecked:`Leaves code cells out of the PDF.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`pdf`,{includeInputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.pdf.includeInputs||t[11]!==c?(l=(0,X.jsx)(br,{label:`Include code`,descriptions:s,checked:n.pdf.includeInputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.pdf.includeInputs,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the PDF.`},t[13]=u):u=t[13];let d;t[14]===r?d=t[15]:(d=e=>r(`pdf`,{includeOutputs:e}),t[14]=r,t[15]=d);let f;t[16]!==i||t[17]!==n.pdf.includeOutputs||t[18]!==d?(f=(0,X.jsx)(br,{label:`Include outputs`,descriptions:u,checked:n.pdf.includeOutputs,disabled:i,onCheckedChange:d}),t[16]=i,t[17]=n.pdf.includeOutputs,t[18]=d,t[19]=f):f=t[19];let p;t[20]!==i||t[21]!==n.pdf.preset||t[22]!==n.pdf.webpdf||t[23]!==r?(p=n.pdf.preset===`document`?(0,X.jsx)(xr,{label:`Method`,value:n.pdf.webpdf?`browser`:`latex`,disabled:i,onValueChange:e=>r(`pdf`,{webpdf:e===`browser`}),options:ur}):null,t[20]=i,t[21]=n.pdf.preset,t[22]=n.pdf.webpdf,t[23]=r,t[24]=p):p=t[24];let m;return t[25]!==o||t[26]!==l||t[27]!==f||t[28]!==p?(m=(0,X.jsxs)(yr,{children:[o,l,f,p]}),t[25]=o,t[26]=l,t[27]=f,t[28]=p,t[29]=m):m=t[29],m}function _r(e){let t=(0,Z.c)(6),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`script`,{type:e}),t[0]=r,t[1]=a);let o;return t[2]!==i||t[3]!==n.script.type||t[4]!==a?(o=(0,X.jsx)(yr,{children:(0,X.jsx)(xr,{label:`Format`,value:n.script.type,disabled:i,onValueChange:a,options:dr})}),t[2]=i,t[3]=n.script.type,t[4]=a,t[5]=o):o=t[5],o}function vr(){return null}function yr(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`divide-y rounded-md border`,children:n}),t[0]=n,t[1]=r),r}function br(e){let t=(0,Z.c)(26),{label:n,descriptions:r,descriptionOverride:i,checked:a,disabled:o,onCheckedChange:s}=e,c=(0,Q.useId)(),l=`${c}-description`,u=i??(a?r.checked:r.unchecked),d;t[0]===i?d=t[1]:(d=i?[i]:[],t[0]=i,t[1]=d);let f;t[2]!==r.checked||t[3]!==r.unchecked||t[4]!==d?(f=[r.checked,r.unchecked,...d],t[2]=r.checked,t[3]=r.unchecked,t[4]=d,t[5]=f):f=t[5];let p=f,m;t[6]!==c||t[7]!==n?(m=(0,X.jsx)(`label`,{htmlFor:c,className:`text-sm font-medium leading-5`,children:n}),t[6]=c,t[7]=n,t[8]=m):m=t[8];let h;t[9]!==u||t[10]!==l||t[11]!==p?(h=(0,X.jsx)(Er,{id:l,description:u,possibleDescriptions:p}),t[9]=u,t[10]=l,t[11]=p,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]!==a||t[17]!==l||t[18]!==o||t[19]!==c||t[20]!==n||t[21]!==s?(_=(0,X.jsx)(fe,{id:c,size:`sm`,checked:a,disabled:o,onCheckedChange:s,"aria-label":n,"aria-describedby":l}),t[16]=a,t[17]=l,t[18]=o,t[19]=c,t[20]=n,t[21]=s,t[22]=_):_=t[22];let v;return t[23]!==g||t[24]!==_?(v=(0,X.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between gap-4 px-3 py-2`,children:[g,_]}),t[23]=g,t[24]=_,t[25]=v):v=t[25],v}function xr(e){let t=(0,Z.c)(31),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Q.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]===n?d=t[4]:(d=(0,X.jsx)(`div`,{className:`text-sm font-medium leading-5`,children:n}),t[3]=n,t[4]=d);let f=u??``,p;t[5]===o?p=t[6]:(p=o.map(Sr),t[5]=o,t[6]=p);let m;t[7]!==c||t[8]!==f||t[9]!==p?(m=(0,X.jsx)(Er,{id:c,description:f,possibleDescriptions:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==d||t[12]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[11]=d,t[12]=m,t[13]=h):h=t[13];let g;t[14]===a?g=t[15]:(g=e=>a(e),t[14]=a,t[15]=g);let _;if(t[16]!==s||t[17]!==o){let e;t[19]===s?e=t[20]:(e=(e,t)=>{let n=`${s}-${t}`;return(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(E,{id:n,value:e.value}),(0,X.jsx)(`label`,{htmlFor:n,className:`text-sm`,children:e.label})]},e.value)},t[19]=s,t[20]=e),_=o.map(e),t[16]=s,t[17]=o,t[18]=_}else _=t[18];let v;t[21]!==c||t[22]!==i||t[23]!==n||t[24]!==g||t[25]!==_||t[26]!==r?(v=(0,X.jsx)(N,{value:r,onValueChange:g,className:`flex shrink-0 flex-wrap gap-x-5 gap-y-2 sm:justify-end`,"aria-label":n,"aria-describedby":c,disabled:i,children:_}),t[21]=c,t[22]=i,t[23]=n,t[24]=g,t[25]=_,t[26]=r,t[27]=v):v=t[27];let y;return t[28]!==h||t[29]!==v?(y=(0,X.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,v]}),t[28]=h,t[29]=v,t[30]=y):y=t[30],y}function Sr(e){return e.description}function Cr(e){let t=(0,Z.c)(34),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Q.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]!==s||t[4]!==n?(d=(0,X.jsx)(`label`,{htmlFor:s,className:`text-sm font-medium leading-5`,children:n}),t[3]=s,t[4]=n,t[5]=d):d=t[5];let f=u??``,p;t[6]===o?p=t[7]:(p=o.map(Tr),t[6]=o,t[7]=p);let m;t[8]!==c||t[9]!==f||t[10]!==p?(m=(0,X.jsx)(Er,{id:c,description:f,possibleDescriptions:p}),t[8]=c,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==d||t[13]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[12]=d,t[13]=m,t[14]=h):h=t[14];let g;t[15]===a?g=t[16]:(g=e=>a(e),t[15]=a,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(Te,{}),t[17]=_):_=t[17];let v;t[18]!==c||t[19]!==s?(v=(0,X.jsx)(ke,{id:s,"aria-describedby":c,className:`h-8 w-full shrink-0 sm:w-44`,children:_}),t[18]=c,t[19]=s,t[20]=v):v=t[20];let y;t[21]===o?y=t[22]:(y=o.map(wr),t[21]=o,t[22]=y);let b;t[23]===y?b=t[24]:(b=(0,X.jsx)(De,{children:y}),t[23]=y,t[24]=b);let x;t[25]!==i||t[26]!==b||t[27]!==g||t[28]!==v||t[29]!==r?(x=(0,X.jsxs)(Ae,{value:r,disabled:i,onValueChange:g,children:[v,b]}),t[25]=i,t[26]=b,t[27]=g,t[28]=v,t[29]=r,t[30]=x):x=t[30];let S;return t[31]!==x||t[32]!==h?(S=(0,X.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,x]}),t[31]=x,t[32]=h,t[33]=S):S=t[33],S}function wr(e){return(0,X.jsx)(Ee,{value:e.value,children:e.label},e.value)}function Tr(e){return e.description}function Er(e){let t=(0,Z.c)(15),{id:n,description:r,possibleDescriptions:i}=e,a;t[0]===i?a=t[1]:(a=new Set(i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=[...a],t[2]=a,t[3]=o);let s;t[4]!==r||t[5]!==o?(s=o.filter(e=>e!==r),t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l;t[7]!==r||t[8]!==n?(l=(0,X.jsx)(`p`,{id:n,"aria-live":`polite`,className:`col-start-1 row-start-1`,children:r}),t[7]=r,t[8]=n,t[9]=l):l=t[9];let u;t[10]===c?u=t[11]:(u=c.map(Dr),t[10]=c,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,X.jsxs)(`div`,{className:`mt-0.5 grid text-xs leading-4 text-muted-foreground`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Dr(e){return(0,X.jsx)(`p`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:e},e)}var Or={"playwright-chromium":{description:`PDF export requires Playwright Chromium.`}};function kr(e){let t=(0,Z.c)(10),{status:n}=e;if(n.available&&!n.availabilityCheckFailed)return null;if(n.reason?.type===`checking-requirements`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[(0,X.jsx)(xt,{size:`small`,className:`size-3`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Checking requirements`})]}),t[0]=e):e=t[0],e}let r=n.availabilityCheckFailed?`Requirements unknown`:`Unavailable`,i=n.availabilityCheckFailed?`text-muted-foreground`:`text-(--yellow-11)`,a;t[1]===i?a=t[2]:(a=_e(`size-3`,i),t[1]=i,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,X.jsx)(C,{className:a}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,X.jsx)(`span`,{className:`sr-only`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Ar(e){let t=(0,Z.c)(7),{format:n,formatLabel:r,status:i,onInstall:a,isInstalling:o}=e,s=o!==void 0&&o;if(i.availabilityCheckFailed){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`mb-2.5`,children:(0,X.jsx)(jr,{children:`Couldn't check whether this export is available. You can still try it.`})}),t[0]=e):e=t[0],e}if(!i.reason)return null;let c;return t[1]!==n||t[2]!==r||t[3]!==s||t[4]!==a||t[5]!==i.reason?(c=(0,X.jsx)(`div`,{className:`mb-2.5`,children:(0,X.jsx)(Mr,{format:n,formatLabel:r,reason:i.reason,onInstall:a,isInstalling:s})}),t[1]=n,t[2]=r,t[3]=s,t[4]=a,t[5]=i.reason,t[6]=c):c=t[6],c}function jr(e){let t=(0,Z.c)(9),{children:n,onInstall:r,isInstalling:i}=e,a=i!==void 0&&i,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(C,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:n}),t[1]=n,t[2]=s);let c;t[3]!==a||t[4]!==r?(c=r?(0,X.jsxs)(Ve,{type:`button`,variant:`outline`,size:`xs`,className:`shrink-0 border-input bg-background text-foreground hover:border-input hover:bg-muted hover:text-foreground`,disabled:a,"aria-busy":a,onClick:r,children:[a?(0,X.jsx)(xt,{size:`small`,className:`mr-1.5 size-3.5`}):(0,X.jsx)(nn,{className:`mr-1.5 size-3.5`}),`Install`]}):null,t[3]=a,t[4]=r,t[5]=c):c=t[5];let l;return t[6]!==s||t[7]!==c?(l=(0,X.jsxs)(Lt,{variant:`warning`,className:`flex items-center gap-2.5 px-3 py-2 text-(--yellow-12) has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[o,(0,X.jsxs)(It,{className:`flex min-w-0 flex-1 items-center gap-3 text-sm leading-5`,children:[s,c]})]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function Mr(e){let t=(0,Z.c)(22),{format:n,formatLabel:r,reason:i,onInstall:a,isInstalling:o}=e;switch(i.type){case`checking-requirements`:{let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(xt,{className:`size-4 shrink-0`,size:`small`}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,X.jsxs)(Lt,{role:`status`,variant:`info`,className:`flex items-center gap-2.5 p-3 has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[e,(0,X.jsxs)(It,{className:`min-w-0 flex-1 text-sm leading-5`,children:[`Checking `,r,` requirements…`]})]}),t[1]=r,t[2]=n),n}case`notebook-must-be-named`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(jr,{children:`Name and save this notebook before exporting.`}),t[3]=e):e=t[3],e}case`missing-packages`:{let e;t[4]===i.packages?e=t[5]:(e=i.packages.join(`, `),t[4]=i.packages,t[5]=e);let n;t[6]===e?n=t[7]:(n=(0,X.jsx)(`code`,{className:`break-words font-mono`,children:e}),t[6]=e,t[7]=n);let s;return t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==n?(s=(0,X.jsxs)(jr,{onInstall:a,isInstalling:o,children:[r,` export requires`,` `,n,`.`]}),t[8]=r,t[9]=o,t[10]=a,t[11]=n,t[12]=s):s=t[12],s}case`missing-setup`:{let e;t[13]!==a||t[14]!==i.requirements?(e=a?i.requirements.map(Pr).join(` `):(0,X.jsx)(`span`,{className:`block min-w-0`,children:i.requirements.map(Nr)}),t[13]=a,t[14]=i.requirements,t[15]=e):e=t[15];let n;return t[16]!==o||t[17]!==a||t[18]!==e?(n=(0,X.jsx)(jr,{onInstall:a,isInstalling:o,children:e}),t[16]=o,t[17]=a,t[18]=e,t[19]=n):n=t[19],n}case`wasm-runtime`:{let e=n===`pdf`?`Use your browser's print dialog to save the current app view as a PDF.`:`Open this notebook in a local marimo session to use this export.`,r;return t[20]===e?r=t[21]:(r=(0,X.jsx)(jr,{children:e}),t[20]=e,t[21]=r),r}default:Ue(i)}}function Nr(e){let t=Or[e.name];return(0,X.jsxs)(`span`,{className:`block`,children:[t.description,(0,X.jsx)(`code`,{className:`mt-1 block break-all font-mono`,children:e.command})]},e.name)}function Pr(e){return Or[e.name].description}function Fr(e){return e.endsWith(`.myst.md`)?`mystmd`:e.endsWith(`.qmd`)?`qmd`:e.endsWith(`.mdx`)?`mdx`:`pymdown`}function Ir(e,t){let n=t??Fr(e),r=dt[n],i=ft.find(t=>e.endsWith(t)),a=Ie.withoutExtension(e);i&&(a=e.slice(0,-i.length));let o=`${a}.${r}`;return o===e?`${e.slice(0,-(r.length+1))}.export.${r}`:o}function Lr(e){return Object.entries(e).flatMap(([e,t])=>t===null?[]:t===!0?[`--${e}`]:t===!1?[`--no-${e}`]:[`--${e}=${t}`])}function Rr(e){return e.preset===`document`?e.webpdf:null}var zr={html:{subcommand:`html`,flags:({html:e})=>({"include-code":e.includeCode}),outputFilename:e=>Ie.toHTML(e)},markdown:{subcommand:`md`,flags:({markdown:e})=>({flavor:e.flavor}),outputFilename:(e,{markdown:t})=>Ir(e,t.flavor)},ipynb:{subcommand:`ipynb`,flags:({ipynb:e})=>({sort:e.sortMode,"include-outputs":e.includeOutputs}),outputFilename:e=>Ie.toIPYNB(e)},pdf:{subcommand:`pdf`,flags:({pdf:e})=>({as:e.preset,"include-inputs":e.includeInputs,"include-outputs":e.includeOutputs,webpdf:Rr(e)}),outputFilename:e=>Ie.toPDF(e)},script:{subcommand:`script`,flags:()=>({}),outputFilename:e=>`${Ie.withoutExtension(e)}.script.py`}};function Br({format:e,filename:t,options:n}){if(e===`png`||e===`script`&&n.script.type===`source`||!t)return null;let r=zr[e];return[`marimo`,`export`,r.subcommand,Ht(t),...Lr(r.flags(n)),`-o`,Ht(r.outputFilename(t,n))].join(` `)}async function Vr(e){let{exportOptions:t,captureOutputs:n,downloadPDF:r}=e;t.includeOutputs&&await n(),await r(t)}async function Hr({format:e,options:t,requests:n,sourceFilename:r,htmlFiles:i,getLayout:a,captureOutputs:o,capturePNG:s,downloadFile:c}){switch(e){case`html`:c(await n.exportAsHTML({download:!1,files:i,includeCode:t.html.includeCode,layout:await a()}));return;case`markdown`:c(await n.exportAsMarkdown({download:!1,flavor:t.markdown.flavor}));return;case`ipynb`:t.ipynb.includeOutputs&&await o(),c(await n.exportAsIPYNB({download:!1,sortMode:t.ipynb.sortMode,includeOutputs:t.ipynb.includeOutputs}));return;case`pdf`:await Vr({exportOptions:t.pdf,captureOutputs:o,downloadPDF:async e=>{c(await n.exportAsPDF(e))}});return;case`script`:if(t.script.type===`source`){c({contents:(await n.readCode()).contents,filename:r,mediaType:`text/plain`});return}c(await n.exportAsScript({download:!1}));return;case`png`:await s();return;default:Ue(e)}}var Ur={source:{actionLabel:`Export notebook source`,progressLabel:`notebook source`},flat:{actionLabel:`Export flat script`,progressLabel:`flat script`}};function Wr(e,t){if(e===`wasm`)return{status:`success`,data:null};switch(t.status){case`pending`:case`loading`:return{status:`pending`};case`error`:return{status:`error`};case`success`:return{status:`success`,data:t.data}}}function Gr(e,t){return e===`server`&&t?Dt.basename(t):Ie.toPY(document.title)}function Kr({usesBrowserPrint:e,hasCommand:t,format:n,isNotebookSource:r}){return e?`Uses the browser's print settings for page size and filename.`:t?`Uses the current session state. The copied command exports the saved notebook.`:n!==`png`&&!r?`Save the notebook to copy an equivalent shell command.`:null}function qr(e){let n=Rt(),[r,i]=t(tr),[a,o]=t(nr),[s,c]=(0,Q.useState)(e??a),l=J()?`wasm`:`server`,u=Ge(),d=le(),[f,p]=(0,Q.useState)(!1),m=At(async()=>l===`wasm`?null:u.getExportAvailability(),[l,u]),h=Wr(l,m),g=e=>ar({format:e,options:r,runtime:l,filename:n,availability:h}),_=g(s),v=d&&(_.reason?.type===`missing-packages`||_.reason?.type===`missing-setup`),y=Un.map(e=>({format:e,status:g(e)})),b=ir(l,s),x=fr[s],S=s===`script`&&r.script.type===`source`,{actionLabel:C,progressLabel:w}=s===`script`?Ur[r.script.type]:{actionLabel:x.actionLabel,progressLabel:x.label},T=b?null:Br({format:s,filename:n,options:r}),E=Kr({usesBrowserPrint:b,hasCommand:!!T,format:s,isNotebookSource:S});return(0,Q.useEffect)(()=>{e&&o(e)},[e,o]),{formats:y,options:r,selected:{format:s,status:_,usesBrowserPrint:b,actionLabel:C,command:T,footerDescription:E},exportRequest:{format:s,options:r,sourceFilename:Gr(l,n),available:_.available,usesBrowserPrint:b,progressLabel:w},selectFormat:e=>{Jn(e)&&(c(e),o(e))},updateOptions:(e,t)=>{i(n=>{let r={...n};return r[e]={...n[e],...t},r})},canInstall:v,isInstalling:f,installRequirements:async()=>{if(!(!v||f||s===`png`)){p(!0);try{let e=await u.installExportRequirements({format:s});m.setData(e)}catch{}finally{p(!1)}}}}}async function Jr(e){let t=document.getElementById(`App`);if(!t){let e=`The current app view could not be captured.`;throw Et({title:`Failed to download as PNG`,description:e,variant:`danger`}),Error(e)}let n=e?.style.visibility,r=e?.classList.contains(`print:hidden`);if(!await Fe({element:t,filename:document.title,prepare:()=>{let t=Le();return e&&(e.classList.add(`print:hidden`),e.style.visibility=`hidden`),()=>{t(),e&&(r||e.classList.remove(`print:hidden`),e.style.visibility=n??``)}}}))throw Error(`Failed to capture the current app view.`)}function Yr(e){e(),requestAnimationFrame(()=>{setTimeout(()=>{window.print()},0)})}function Xr({format:e,options:t,sourceFilename:n,available:r,usesBrowserPrint:i,progressLabel:a,onClose:o}){let s=Ge(),c=Xt(),[l,u]=(0,Q.useState)(!1),d=(0,Q.useRef)(null),f=(0,Q.useRef)(!0);(0,Q.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=async e=>{await Zt({takeScreenshots:()=>c({progress:e}),updateCellOutputs:s.updateCellOutputs})},m=async()=>{await ue(()=>Jr(d.current?.parentElement??null))};return{dialogRef:d,isExporting:l,submit:async()=>{if(!(!r||l)){if(i){Yr(o);return}u(!0);try{await Pe(`Exporting ${a}…`,async r=>{await Hr({format:e,options:t,requests:s,sourceFilename:n,htmlFiles:Je.INSTANCE.filenames(),getLayout:Xe,captureOutputs:()=>p(r),capturePNG:m,downloadFile:Ne})}),f.current&&o()}catch(e){U.error(`Export failed`,e)}finally{f.current&&u(!1)}}}}}function Zr(e){let t=(0,Z.c)(15),{initialFormat:n,onClose:r}=e,i=qr(n),a,o,s;t[0]===i?(a=t[1],o=t[2],s=t[3]):({exportRequest:a,selectFormat:o,...s}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==r?(c={...a,onClose:r},t[4]=a,t[5]=r,t[6]=c):c=t[6];let l=Xr(c),u;t[7]!==l||t[8]!==o||t[9]!==s?(u=e=>{!l.isExporting&&!s.isInstalling&&o(e)},t[7]=l,t[8]=o,t[9]=s,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==s||t[13]!==u?(d={...s,...l,selectFormat:u},t[11]=l,t[12]=s,t[13]=u,t[14]=d):d=t[14],d}var Qr=`(min-width: 640px)`,$r=e=>{let t=(0,Z.c)(75),{initialFormat:n,onClose:r,returnFocusRef:i}=e,a;t[0]!==n||t[1]!==r?(a={initialFormat:n,onClose:r},t[0]=n,t[1]=r,t[2]=a):a=t[2];let{dialogRef:o,isExporting:s,isInstalling:c,canInstall:l,formats:u,options:d,selected:f,selectFormat:p,updateOptions:m,installRequirements:h,submit:g}=Zr(a),_=s||c,v=je(Qr),{format:y,status:b,usesBrowserPrint:x,actionLabel:S,command:C,footerDescription:w}=f,T=fr[y],E=T.Options,D;t[3]===i?D=t[4]:(D=i?{onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()}}:{},t[3]=i,t[4]=D);let ee=D,te;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,X.jsxs)(gt,{className:`border-b px-5 py-4 pr-12`,children:[(0,X.jsx)(yt,{children:`Export notebook`}),(0,X.jsx)(ht,{children:`Choose a format and adjust its options.`})]}),t[5]=te):te=t[5];let ne=v?`vertical`:`horizontal`,O;if(t[6]!==u||t[7]!==_){let e;t[9]===_?e=t[10]:(e=e=>{let{format:t,status:n}=e,r=fr[t];return(0,X.jsxs)(be,{value:t,disabled:_,className:`min-w-0 justify-start gap-2 px-2.5 py-2 text-xs data-[state=active]:shadow-xs sm:w-full sm:text-sm`,"data-testid":`export-format-${t}`,children:[(0,X.jsx)(r.Icon,{className:`size-3.5 shrink-0`,strokeWidth:1.5}),(0,X.jsx)(`span`,{className:`truncate`,children:r.label}),(0,X.jsx)(kr,{status:n})]},t)},t[9]=_,t[10]=e),O=u.map(e),t[6]=u,t[7]=_,t[8]=O}else O=t[8];let k;t[11]===O?k=t[12]:(k=(0,X.jsx)(Se,{"aria-label":`Export format`,className:`grid max-h-none shrink-0 grid-cols-2 items-stretch justify-start gap-1 overflow-auto rounded-none border-b bg-muted/20 p-2 min-[360px]:grid-cols-3 sm:flex sm:h-full sm:flex-col sm:border-b-0 sm:border-r`,children:O}),t[11]=O,t[12]=k);let A;if(t[13]!==E||t[14]!==l||t[15]!==T.description||t[16]!==T.label||t[17]!==y||t[18]!==u||t[19]!==h||t[20]!==_||t[21]!==c||t[22]!==d||t[23]!==b||t[24]!==m||t[25]!==x){let e;t[27]!==E||t[28]!==l||t[29]!==T.description||t[30]!==T.label||t[31]!==y||t[32]!==h||t[33]!==_||t[34]!==c||t[35]!==d||t[36]!==b||t[37]!==m||t[38]!==x?(e=e=>{let{format:t}=e;return(0,X.jsxs)(xe,{value:t,className:`mt-0 min-h-0 min-w-0 overflow-y-auto px-4 py-3`,children:[(0,X.jsxs)(`div`,{className:`mb-3`,children:[(0,X.jsx)(`h3`,{className:`text-base font-semibold`,children:T.label}),(0,X.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:T.description})]}),(0,X.jsx)(Ar,{format:y,formatLabel:T.label,status:b,onInstall:l?h:void 0,isInstalling:c}),x?null:(0,X.jsx)(E,{options:d,updateOptions:m,disabled:_})]},t)},t[27]=E,t[28]=l,t[29]=T.description,t[30]=T.label,t[31]=y,t[32]=h,t[33]=_,t[34]=c,t[35]=d,t[36]=b,t[37]=m,t[38]=x,t[39]=e):e=t[39],A=u.map(e),t[13]=E,t[14]=l,t[15]=T.description,t[16]=T.label,t[17]=y,t[18]=u,t[19]=h,t[20]=_,t[21]=c,t[22]=d,t[23]=b,t[24]=m,t[25]=x,t[26]=A}else A=t[26];let j;t[40]!==y||t[41]!==p||t[42]!==ne||t[43]!==k||t[44]!==A?(j=(0,X.jsxs)(Ce,{value:y,onValueChange:p,orientation:ne,className:`flex min-h-0 min-w-0 flex-col overflow-hidden sm:grid sm:grid-cols-[168px_minmax(0,1fr)]`,children:[k,A]}),t[40]=y,t[41]=p,t[42]=ne,t[43]=k,t[44]=A,t[45]=j):j=t[45];let M;t[46]===C?M=t[47]:(M=C?(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-md border bg-background px-2.5 py-2 font-mono text-xs`,children:[(0,X.jsx)(`span`,{className:`select-none text-muted-foreground`,"aria-hidden":!0,children:`$`}),(0,X.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap`,"data-testid":`export-cli-command`,"aria-label":`Equivalent POSIX shell command`,children:C}),(0,X.jsx)(Mt,{value:C,className:`size-3.5`,buttonClassName:_e(ze({variant:`ghost`,size:`icon`}),`shrink-0`),tooltip:`Copy POSIX shell command`,ariaLabel:`Copy POSIX shell command`,toastTitle:`Command copied`})]}):null,t[46]=C,t[47]=M);let re=C&&`mt-3`,N;t[48]===re?N=t[49]:(N=_e(`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,re),t[48]=re,t[49]=N);let P;t[50]===w?P=t[51]:(P=w?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:w}):null,t[50]=w,t[51]=P);let F=!b.available||_,I=!w&&`sm:ml-auto`,L;t[52]===I?L=t[53]:(L=_e(`border-(--blue-11) bg-(--blue-11) hover:border-(--blue-12) hover:bg-(--blue-12) sm:min-w-36 dark:border-(--blue-7) dark:bg-(--blue-5) dark:text-(--blue-12) dark:hover:border-(--blue-8) dark:hover:bg-(--blue-6)`,I),t[52]=I,t[53]=L);let R;t[54]===s?R=t[55]:(R=s&&(0,X.jsx)(xt,{size:`small`,className:`mr-2`,"aria-hidden":!0}),t[54]=s,t[55]=R);let ie=x?`Print to PDF`:S,z;t[56]!==s||t[57]!==g||t[58]!==F||t[59]!==L||t[60]!==R||t[61]!==ie?(z=(0,X.jsxs)(Ve,{type:`button`,disabled:F,"aria-busy":s,onClick:g,className:L,"data-testid":`export-submit`,children:[R,ie]}),t[56]=s,t[57]=g,t[58]=F,t[59]=L,t[60]=R,t[61]=ie,t[62]=z):z=t[62];let B;t[63]!==N||t[64]!==P||t[65]!==z?(B=(0,X.jsxs)(`div`,{className:N,children:[P,z]}),t[63]=N,t[64]=P,t[65]=z,t[66]=B):B=t[66];let V;t[67]!==B||t[68]!==M?(V=(0,X.jsxs)(`footer`,{className:`min-w-0 border-t bg-muted/20 px-4 py-3`,children:[M,B]}),t[67]=B,t[68]=M,t[69]=V):V=t[69];let H;return t[70]!==o||t[71]!==ee||t[72]!==V||t[73]!==j?(H=(0,X.jsxs)(_t,{ref:o,className:`grid h-dvh max-h-[760px] min-w-0 w-[calc(100vw-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-0 overflow-hidden p-0 sm:top-[5vh] sm:h-[90vh] sm:max-h-[640px] sm:max-w-3xl`,"data-testid":`export-dialog`,...ee,children:[te,j,V]}),t[70]=o,t[71]=ee,t[72]=V,t[73]=j,t[74]=H):H=t[74],H};function ei(e){let t=(0,Z.c)(5),{openPrompt:n,closeModal:r}=vt(),{sendCopy:i}=Ge(),a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=()=>{if(!e)return null;let t=Ot.guessDeliminator(e),a=Dt.basename(e);n({title:`Copy notebook`,description:`Enter a new filename for the notebook copy.`,defaultValue:`_${a}`,confirmText:`Copy notebook`,spellCheck:!1,onConfirm:n=>{let a=t.join(Dt.dirname(e),n);i({source:e,destination:a}).then(()=>{r(),Et({title:`Notebook copied`,description:`A copy of the notebook has been created.`}),Yt(a)})}})},t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}function ti(){let e=(0,Z.c)(4),{openConfirm:t}=vt(),n=a(de),{sendRestart:r}=Ge(),i;return e[0]!==t||e[1]!==r||e[2]!==n?(i=()=>{t({title:`Restart Kernel`,description:`This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.`,variant:`destructive`,confirmAction:(0,X.jsx)(ye,{onClick:async()=>{n({state:ce.CLOSING}),await r(),Pt()},"aria-label":`Confirm Restart`,children:`Restart`})})},e[0]=t,e[1]=r,e[2]=n,e[3]=i):i=e[3],i}var ni=new A,ri=e=>ni.isSupported(e)?`markdown`:`code`,ii=()=>{let e=(0,Z.c)(3),{updateCellConfig:t}=u(),{saveCellConfig:n}=Ge(),r;return e[0]!==n||e[1]!==t?(r=async(e,r)=>{let i=te(),a={};for(let t of i.cellIds.inOrderIds){let n=i.cellData[t];n!==void 0&&n.config.hide_code!==e&&ri(n.code)===r&&(a[t]={hide_code:e})}let o=ae.entries(a);if(o.length!==0){await n({configs:a});for(let[e,n]of o)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r},ai=e=>{e?.preventDefault(),e?.stopPropagation()};function oi(e){let n=(0,Z.c)(43),i;n[0]===e?i=n[1]:(i=e===void 0?{}:e,n[0]=e,n[1]=i);let{exportDialogReturnFocusRef:o}=i,l=Rt(),{openModal:m,closeModal:g}=vt(),{toggleApplication:C}=v(),{selectedPanel:w}=c(),[T]=t(oe),E=r(se),O=ii(),[A]=z(),M=r(p),N=r(ie),{updateCellConfig:P,undoDeleteCell:F,clearAllCellOutputs:I,addSetupCellIfDoesntExist:L,collapseAllCells:R,expandAllCells:U}=u(),W=ti(),K=Nt(),q=ei(l),ce=a(Ln),le=a(V),{handleClick:ue}=H(),de=a(B),fe=a(tr),{readCode:ge,saveCellConfig:_e}=Ge(),ve=b(`database`),ye=b(`storage`),be=y(),xe=r(S),Se=r(re),Ce=r(d),{selectedLayout:we}=me(),{setLayoutView:Te}=he(),Ee=In(),De=A.sharing?.html??!0,Oe=A.sharing?.wasm??!0,ke=A.sharing?.molab??!0,Ae=we===`slides`,je;if(n[2]!==be||n[3]!==L||n[4]!==N||n[5]!==Se||n[6]!==M||n[7]!==I||n[8]!==g||n[9]!==R||n[10]!==q||n[11]!==ve||n[12]!==ye||n[13]!==U||n[14]!==o||n[15]!==l||n[16]!==xe||n[17]!==Ae||n[18]!==E||n[19]!==m||n[20]!==ue||n[21]!==ge||n[22]!==W||n[23]!==K||n[24]!==_e||n[25]!==we||n[26]!==w||n[27]!==O||n[28]!==ce||n[29]!==fe||n[30]!==de||n[31]!==Te||n[32]!==le||n[33]!==De||n[34]!==ke||n[35]!==Oe||n[36]!==C||n[37]!==Ee||n[38]!==F||n[39]!==Ce||n[40]!==P||n[41]!==T.mode){let e=[`db`,`sql`,...Wt],t=[`bucket`,`object storage`,...Kt],r=xi,i=(e,t)=>{t&&fe(e=>Qn(e,t)),m((0,X.jsx)($r,{initialFormat:e,onClose:g,returnFocusRef:o}))};je=[{icon:(0,X.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Export…`,additionalKeywords:[`download`,`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],handle:()=>i()},{icon:(0,X.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Download`,redundant:!0,handle:ai,dropdown:[{icon:(0,X.jsx)(Ze,{size:14,strokeWidth:1.5}),label:`Download as HTML`,handle:()=>i(`html`,{html:{includeCode:!0}})},{icon:(0,X.jsx)(Ze,{size:14,strokeWidth:1.5}),label:`Download as HTML (exclude code)`,handle:()=>i(`html`,{html:{includeCode:!1}})},{icon:(0,X.jsx)(zt,{strokeWidth:1.5,style:{width:14,height:14}}),label:`Download as Markdown`,handle:()=>i(`markdown`)},{icon:(0,X.jsx)(un,{size:14,strokeWidth:1.5}),label:`Download as ipynb`,handle:()=>i(`ipynb`)},{icon:(0,X.jsx)(et,{size:14,strokeWidth:1.5}),label:`Download notebook source`,handle:()=>i(`script`,{script:{type:`source`}})},{icon:(0,X.jsx)(et,{size:14,strokeWidth:1.5}),label:`Download flat script`,handle:()=>i(`script`,{script:{type:`flat`}})},{divider:!0,icon:(0,X.jsx)(pt,{size:14,strokeWidth:1.5}),label:`Download as PNG`,handle:()=>i(`png`)},Ae?{divider:!0,icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:ai,dropdown:[{icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Document Layout`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})},{icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Slides Layout`,hidden:J(),rightElement:(0,X.jsx)(`span`,{className:`ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700`,children:`Recommended`}),handle:()=>i(`pdf`,{pdf:{preset:`slides`}})}]}:{divider:!0,icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})}]},{icon:(0,X.jsx)(f,{size:14,strokeWidth:1.5}),label:`Pair with an agent`,hidden:J(),handle:async()=>{m((0,X.jsx)(Ut,{onClose:g}))}},{icon:(0,X.jsx)(pn,{size:14,strokeWidth:1.5}),label:`Share`,handle:ai,hidden:!De&&!Oe&&!ke,dropdown:[{icon:(0,X.jsx)(at,{size:14,strokeWidth:1.5}),label:`Publish HTML to web`,hidden:!De,handle:async()=>{m((0,X.jsx)(Mn,{onClose:g}))}},{icon:(0,X.jsx)(bt,{size:14,strokeWidth:1.5}),label:`Create WebAssembly link`,hidden:!Oe,handle:async()=>{let e=await ge(),t=Ft({code:e.contents});await jt(t),Et({title:`Copied`,description:`Link copied to clipboard.`})}},{icon:(0,X.jsx)(Jt,{size:14,strokeWidth:1.5}),label:`Create molab notebook`,hidden:!ke,handle:async()=>{let e=await ge(),t=Ft({code:e.contents,baseUrl:`${G.molab}/new`});window.open(t,`_blank`)}}]},{icon:(0,X.jsx)(dn,{size:14,strokeWidth:1.5}),label:`Helper panel`,redundant:!0,handle:ai,dropdown:ee.flatMap(e=>{let t=e.type===`ai`&&!N;if(k({panel:e,capabilities:M,aiEnabled:N})&&!t)return[];let{type:n,Icon:i,additionalKeywords:a}=e;return{label:We.startCase(n),rightElement:r(w===n),icon:(0,X.jsx)(i,{size:14,strokeWidth:1.5}),handle:()=>{if(t){ue(`ai`,`ai-features`);return}C(n)},additionalKeywords:a}})},{icon:(0,X.jsx)(fn,{size:14,strokeWidth:1.5}),label:`Present as`,handle:ai,dropdown:[{icon:T.mode===`present`?(0,X.jsx)(x,{size:14,strokeWidth:1.5}):(0,X.jsx)(Ke,{size:14,strokeWidth:1.5}),label:`Toggle app view`,hotkey:`global.hideCode`,handle:()=>{Ee()}},...pe.map((e,t)=>{let n=Bn(e);return{divider:t===0,label:Vn(e),icon:(0,X.jsx)(n,{size:14,strokeWidth:1.5}),rightElement:(0,X.jsx)(`div`,{className:`w-8 flex justify-end`,children:we===e&&(0,X.jsx)(Qe,{size:14})}),handle:()=>{Te(e),T.mode===`edit`&&Ee()}}})]},{icon:(0,X.jsx)(sn,{size:14,strokeWidth:1.5}),label:`Duplicate notebook`,hidden:!l||J(),handle:q},{icon:(0,X.jsx)(tn,{size:14,strokeWidth:1.5}),label:`Copy code to clipboard`,hidden:!l,handle:async()=>{let e=await ge();await jt(e.contents),Et({title:`Copied`,description:`Code copied to clipboard.`})}},{icon:(0,X.jsx)($e,{size:14,strokeWidth:1.5}),label:`Enable all cells`,hidden:!xe||E,handle:async()=>{let e=te(),t=h(e),n=ae.fromEntries(t.map(bi));await _e({configs:n});for(let e of t)P({cellId:e,config:{disabled:!1}})}},{divider:!0,icon:(0,X.jsx)(an,{size:14,strokeWidth:1.5}),label:`Add setup cell`,handle:()=>{L({})}},{icon:(0,X.jsx)(D,{size:14,strokeWidth:1.5}),label:`Add database connection`,additionalKeywords:e,handle:()=>{m((0,X.jsx)(Gt,{onClose:g}))},dropdown:ve.length===0?void 0:[...ve.map(e=>({icon:(0,X.jsx)(f,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>be(e)})),{divider:!0,icon:(0,X.jsx)(D,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:e,handle:()=>{m((0,X.jsx)(Gt,{onClose:g}))}}]},{icon:(0,X.jsx)(lt,{size:14,strokeWidth:1.5}),label:`Add remote storage`,additionalKeywords:t,handle:()=>{m((0,X.jsx)(Gt,{defaultTab:`storage`,onClose:g}))},dropdown:ye.length===0?void 0:[...ye.map(e=>({icon:(0,X.jsx)(f,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>be(e)})),{divider:!0,icon:(0,X.jsx)(lt,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:t,handle:()=>{m((0,X.jsx)(Gt,{defaultTab:`storage`,onClose:g}))}}]},{icon:(0,X.jsx)(hn,{size:14,strokeWidth:1.5}),label:Ce,hidden:!Se||E,handle:()=>{F()}},{icon:(0,X.jsx)(mn,{size:14,strokeWidth:1.5}),label:`Restart kernel`,variant:`danger`,handle:W,additionalKeywords:[`reset`,`reload`,`restart`]},{icon:(0,X.jsx)(on,{size:14,strokeWidth:1.5}),label:`Re-run all cells`,redundant:!0,hotkey:`global.runAll`,handle:async()=>{K()}},{icon:(0,X.jsx)(j,{size:14,strokeWidth:1.5}),label:`Clear all outputs`,redundant:!0,handle:()=>{I()}},{icon:(0,X.jsx)(s,{size:14,strokeWidth:1.5}),label:`Show all code`,hotkey:`global.showAllCode`,handle:()=>O(!1,`code`),redundant:!0},{icon:(0,X.jsx)(nt,{size:14,strokeWidth:1.5}),label:`Hide all code`,hotkey:`global.hideAllCode`,handle:()=>O(!0,`code`),redundant:!0},{icon:(0,X.jsx)(s,{size:14,strokeWidth:1.5}),label:`Show all markdown code`,hotkey:`global.showAllMarkdownCode`,handle:()=>O(!1,`markdown`),redundant:!0},{icon:(0,X.jsx)(nt,{size:14,strokeWidth:1.5}),label:`Hide all markdown code`,hotkey:`global.hideAllMarkdownCode`,handle:()=>O(!0,`markdown`),redundant:!0},{icon:(0,X.jsx)(en,{size:14,strokeWidth:1.5}),label:`Collapse all sections`,hotkey:`global.collapseAllSections`,handle:R,redundant:!0},{icon:(0,X.jsx)($t,{size:14,strokeWidth:1.5}),label:`Expand all sections`,hotkey:`global.expandAllSections`,handle:U,redundant:!0},{divider:!0,icon:(0,X.jsx)(rn,{size:14,strokeWidth:1.5}),label:`Command palette`,hotkey:`global.commandPalette`,handle:()=>ce(yi)},{icon:(0,X.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Keyboard shortcuts`,hotkey:`global.showHelp`,handle:()=>de(vi)},{icon:(0,X.jsx)(Ct,{size:14,strokeWidth:1.5}),label:`User settings`,handle:()=>le(_i),redundant:!0,additionalKeywords:[`preferences`,`options`,`configuration`]},{icon:(0,X.jsx)(ln,{size:14,strokeWidth:1.5}),label:`Report an issue`,additionalKeywords:[`feedback`,`bug`,`issue`,`report`,`diagnostics`],handle:()=>m((0,X.jsx)(On,{onClose:g}))},{icon:(0,X.jsx)(rt,{size:14,strokeWidth:1.5}),label:`Resources`,handle:ai,dropdown:[{icon:(0,X.jsx)(ne,{size:14,strokeWidth:1.5}),label:`Documentation`,handle:gi},{icon:(0,X.jsx)(qt,{className:`h-3.5 w-3.5`}),label:`GitHub`,handle:hi},{icon:(0,X.jsx)(ot,{size:14,strokeWidth:1.5}),label:`Discord Community`,handle:mi},{icon:(0,X.jsx)(ct,{className:`h-3.5 w-3.5`}),label:`YouTube`,handle:pi},{icon:(0,X.jsx)(_,{size:14,strokeWidth:1.5}),label:`Changelog`,handle:fi}]},{divider:!0,icon:(0,X.jsx)(ut,{size:14,strokeWidth:1.5}),label:`Open home`,hidden:!location.search.includes(`file`),handle:di},{icon:(0,X.jsx)(Jt,{size:14,strokeWidth:1.5}),label:`New notebook`,hidden:!location.search.includes(`file`),handle:ui}].filter(li).map(si),n[2]=be,n[3]=L,n[4]=N,n[5]=Se,n[6]=M,n[7]=I,n[8]=g,n[9]=R,n[10]=q,n[11]=ve,n[12]=ye,n[13]=U,n[14]=o,n[15]=l,n[16]=xe,n[17]=Ae,n[18]=E,n[19]=m,n[20]=ue,n[21]=ge,n[22]=W,n[23]=K,n[24]=_e,n[25]=we,n[26]=w,n[27]=O,n[28]=ce,n[29]=fe,n[30]=de,n[31]=Te,n[32]=le,n[33]=De,n[34]=ke,n[35]=Oe,n[36]=C,n[37]=Ee,n[38]=F,n[39]=Ce,n[40]=P,n[41]=T.mode,n[42]=je}else je=n[42];return je}function si(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(ci)}:e}function ci(e){return!e.hidden}function li(e){return!e.hidden}function ui(){let e=kt();window.open(e,`_blank`)}function di(){let e=document.baseURI.split(`?`)[0];window.open(e,`_blank`,`noopener`)}function fi(){window.open(G.releasesPage,`_blank`)}function pi(){window.open(G.youtube,`_blank`)}function mi(){window.open(G.discordLink,`_blank`)}function hi(){window.open(G.githubPage,`_blank`)}function gi(){window.open(G.docsPage,`_blank`)}function _i(e){return!e}function vi(e){return!e}function yi(e){return!e}function bi(e){return[e,{disabled:!1}]}function xi(e){return(0,X.jsx)(`div`,{className:`w-8 flex justify-end`,children:e&&(0,X.jsx)(Qe,{size:14})})}export{Ln as a,gn as c,an as d,rn as f,Rn as i,hn as l,tn as m,ii as n,In as o,nn as p,ti as r,Dn as s,oi as t,ln as u};
|