@marimo-team/frontend 0.19.8-dev16 → 0.19.8-dev18

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 (71) hide show
  1. package/dist/assets/{CellStatus-DbwQRhK0.js → CellStatus-BU_cY1M-.js} +1 -1
  2. package/dist/assets/{JsonOutput-BTXiwFjF.js → JsonOutput-BSoo6rnn.js} +5 -5
  3. package/dist/assets/{MarimoErrorOutput-lr6vqAph.js → MarimoErrorOutput-CAX5i2GE.js} +5 -5
  4. package/dist/assets/{RenderHTML-hMZtS42w.js → RenderHTML-D9vJ9neG.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-DdyvzMmu.js → add-cell-with-ai-BN_m4VjP.js} +8 -8
  6. package/dist/assets/{add-database-form-CUZKNC1e.js → add-database-form-CvczP0Mq.js} +1 -1
  7. package/dist/assets/{agent-panel-IMNT3-jn.js → agent-panel-CbBdQTaH.js} +3 -3
  8. package/dist/assets/{ai-model-dropdown-C_Fhvna-.js → ai-model-dropdown-Bfoz25CZ.js} +4 -4
  9. package/dist/assets/{app-config-button-BqV8GA-q.js → app-config-button-CrXbU4T9.js} +1 -1
  10. package/dist/assets/{cell-editor-BOEKMtAl.js → cell-editor-BAqUkTV8.js} +9 -9
  11. package/dist/assets/cell-link-BoOn0OpK.js +1 -0
  12. package/dist/assets/{cells-DdLMh4kY.js → cells-DbD2lYze.js} +46 -46
  13. package/dist/assets/{chat-components-jnrAy95o.js → chat-components-C2rqCcnp.js} +1 -1
  14. package/dist/assets/{chat-display-rXqWwmbx.js → chat-display-CKRYf3fp.js} +1 -1
  15. package/dist/assets/chat-panel-CYVu9MUa.js +3 -0
  16. package/dist/assets/{column-preview-t0CyBVJf.js → column-preview-DtEv_bAg.js} +1 -1
  17. package/dist/assets/{command-cs3Dd1TU.js → command-PbcrObnK.js} +1 -1
  18. package/dist/assets/{command-palette-CPnBRjW3.js → command-palette-A_nn_y2h.js} +1 -1
  19. package/dist/assets/{common-VAE3DrnP.js → common-DRWuidzm.js} +1 -1
  20. package/dist/assets/{datasource-BBMMxrje.js → datasource-Dkywo3Kg.js} +2 -2
  21. package/dist/assets/{dependency-graph-panel-D16tZkyM.js → dependency-graph-panel-ZnsWxFY3.js} +2 -2
  22. package/dist/assets/{documentation-panel-0BCnCatP.js → documentation-panel-CZJavCAM.js} +1 -1
  23. package/dist/assets/{download-BodpSpiQ.js → download-CmdFQXRz.js} +1 -1
  24. package/dist/assets/{edit-page-DEmceOIJ.js → edit-page-COE4a7-G.js} +7 -7
  25. package/dist/assets/{error-panel-D7CVHSby.js → error-panel-B1n50cDF.js} +1 -1
  26. package/dist/assets/{file-explorer-panel-d9LDZt_k.js → file-explorer-panel-Ctq6A5l_.js} +1 -1
  27. package/dist/assets/{floating-outline-C8UBGhNL.js → floating-outline-BULIQxKU.js} +1 -1
  28. package/dist/assets/{focus-Bd_p77qK.js → focus-BEf2RhRf.js} +1 -1
  29. package/dist/assets/{form-D23zs2fF.js → form-94alAnRh.js} +2 -2
  30. package/dist/assets/{globals-BgJBhxFI.js → globals-BXYmO-WL.js} +1 -1
  31. package/dist/assets/{home-page-DXMa3CyZ.js → home-page-CyLRJEZg.js} +2 -2
  32. package/dist/assets/{hooks-BelJFeV-.js → hooks-DfBLwtVf.js} +1 -1
  33. package/dist/assets/{html-to-image-Bc6qDa9c.js → html-to-image-DrmKVKna.js} +1 -1
  34. package/dist/assets/{index-CNSzdqo2.js → index-Ud-15Gp2.js} +10 -10
  35. package/dist/assets/{kiosk-mode-BlAqMmYG.js → kiosk-mode-BWCEjQ_F.js} +1 -1
  36. package/dist/assets/{layout-DQygoZG8.js → layout-DFhAD73H.js} +3 -3
  37. package/dist/assets/{logs-panel-B3aMPrwV.js → logs-panel-y2i-7VQF.js} +1 -1
  38. package/dist/assets/{markdown-renderer-Dy-FX527.js → markdown-renderer-D8AmLSIR.js} +1 -1
  39. package/dist/assets/{mode-BfhhQnCm.js → mode-CjmQoGEk.js} +1 -1
  40. package/dist/assets/{name-cell-input-DvFZv__e.js → name-cell-input-BthamWJY.js} +1 -1
  41. package/dist/assets/{outline-panel-DH2X9Yaa.js → outline-panel-DsM57ZnT.js} +1 -1
  42. package/dist/assets/{packages-panel-BWx1vxzx.js → packages-panel-BMqAMJxC.js} +1 -1
  43. package/dist/assets/{panels-COeRVsZl.js → panels-BPRD9NT1.js} +1 -1
  44. package/dist/assets/{process-output-CHXcfo-X.js → process-output-OTqBNunj.js} +1 -1
  45. package/dist/assets/{readonly-python-code-iXJtea8u.js → readonly-python-code-C_8a4fwz.js} +1 -1
  46. package/dist/assets/{run-page-DY_aoUra.js → run-page-CPt0ml4p.js} +1 -1
  47. package/dist/assets/{scratchpad-panel-B_QupDvF.js → scratchpad-panel-DJdZVxe5.js} +1 -1
  48. package/dist/assets/{session-panel-IeLEqwsB.js → session-panel-Bqe3Jmko.js} +1 -1
  49. package/dist/assets/{snippets-panel-nld0VX-j.js → snippets-panel-WBcYsSsb.js} +1 -1
  50. package/dist/assets/{state-yRkQ_uSW.js → state-DlF73owK.js} +1 -1
  51. package/dist/assets/{switch-D-TxHKpg.js → switch-BUKXfBTu.js} +1 -1
  52. package/dist/assets/{textarea-BFfMAEaQ.js → textarea-8F9GOEGf.js} +1 -1
  53. package/dist/assets/{tracing-DB7ckaG0.js → tracing-DGYwY__a.js} +1 -1
  54. package/dist/assets/{tracing-panel-CxTR1RYC.js → tracing-panel-BHnlOWW9.js} +2 -2
  55. package/dist/assets/{types-D-xsoOE8.js → types-7nV0hgXj.js} +1 -1
  56. package/dist/assets/{useAddCell-Bc2_jloT.js → useAddCell-Cx99GRHQ.js} +1 -1
  57. package/dist/assets/{useCellActionButton-DUpWwYW8.js → useCellActionButton-VRGP_KkG.js} +1 -1
  58. package/dist/assets/{useDeleteCell-6jBNYEDG.js → useDeleteCell-DHPNhAtW.js} +1 -1
  59. package/dist/assets/{useDependencyPanelTab-Dq7NTXk8.js → useDependencyPanelTab-UoJrnugs.js} +1 -1
  60. package/dist/assets/{useNotebookActions-BJzm4sz2.js → useNotebookActions-DY_TVOaP.js} +1 -1
  61. package/dist/assets/useRunCells-BOowME8Z.js +1 -0
  62. package/dist/assets/{useSplitCell-DE71CDKv.js → useSplitCell-h8RpNtuv.js} +1 -1
  63. package/dist/assets/{utilities.esm-DHgCWD2S.js → utilities.esm-D1YtU9uV.js} +3 -3
  64. package/dist/index.html +31 -31
  65. package/package.json +1 -1
  66. package/src/components/app-config/user-config-form.tsx +0 -54
  67. package/src/components/chat/chat-panel.tsx +23 -26
  68. package/src/core/config/feature-flag.tsx +0 -4
  69. package/dist/assets/cell-link-OwIbBa8Q.js +0 -1
  70. package/dist/assets/chat-panel-ims98I-K.js +0 -3
  71. package/dist/assets/useRunCells-CmbQTUeO.js +0 -1
@@ -1 +1 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X}from"./useEvent-BhXAndur.js";import{t as Z}from"./react-Bj1aDYRI.js";import{St as D}from"./cells-DdLMh4kY.js";import{t as E}from"./compiler-runtime-B3qBwwSJ.js";import{G as $,S as ee,c as te,i as se,l as le,n as ae,u as oe}from"./ai-model-dropdown-C_Fhvna-.js";import{C as ne,v as re,w as Q}from"./utils-YqBXNpsM.js";import{S as ie}from"./config-D2-Bw6QC.js";import{t as ce}from"./jsx-runtime-ZmTK25f3.js";import{t as de}from"./button-CZ3Cs4qb.js";import{l as R}from"./once-Bul8mtFs.js";import{r as U}from"./requests-B4FYHTZl.js";import{t as he}from"./createLucideIcon-BCdY6lG5.js";import{t as me}from"./x-ZP5cObgf.js";import{r as I}from"./input-DHHmNa19.js";import{t as B}from"./settings-OBbrbhij.js";import{a as L,c as M,d as A,g as xe,i as pe,l as F,o as P,p as fe,u as S}from"./textarea-BFfMAEaQ.js";import{t as ue}from"./use-toast-T0_cQDma.js";import{l as Y}from"./select-B7bfltkI.js";import{t as G}from"./tooltip-C_WgOOcZ.js";import{o as je}from"./alert-dialog-Ctz24SMn.js";import{c as ve,l as ge,n as be,t as K}from"./dialog-tQELcltn.js";import{i as we,r as ye,t as Ne}from"./popover-B-131r4d.js";import{n as Ce}from"./useDebounce-B28kFfrM.js";import{n as ke}from"./ImperativeModal-DZr52ffu.js";import{t as O}from"./kbd-Cm6Ba9qg.js";import{t as _e}from"./links-7AQBmdyV.js";import{t as V}from"./Inputs-CbenuziM.js";var Se=he("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Te=E(),s=z(ce(),1);const Le=t=>{let e=(0,Te.c)(15),{description:a,disabled:f,tooltip:r}=t,i=f===void 0?!1:f,u=r===void 0?"Shutdown":r,{openConfirm:b,closeModal:l}=ke(),{sendShutdown:o}=U(),w;e[0]===o?w=e[1]:(w=()=>{o(),setTimeout(Me,200)},e[0]=o,e[1]=w);let j=w;if(ie())return null;let m=i?"disabled":"red",c;e[2]!==l||e[3]!==a||e[4]!==j||e[5]!==b?(c=h=>{h.stopPropagation(),b({title:"Shutdown",description:a,variant:"destructive",confirmAction:(0,s.jsx)(je,{onClick:()=>{j(),l()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=l,e[3]=a,e[4]=j,e[5]=b,e[6]=c):c=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(me,{strokeWidth:1}),e[7]=n):n=e[7];let d;e[8]!==i||e[9]!==m||e[10]!==c?(d=(0,s.jsx)(V,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:m,className:"h-[27px] w-[27px]",disabled:i,onClick:c,children:n}),e[8]=i,e[9]=m,e[10]=c,e[11]=d):d=e[11];let x;return e[12]!==d||e[13]!==u?(x=(0,s.jsx)(G,{content:u,children:d}),e[12]=d,e[13]=u,e[14]=x):x=e[14],x};function Me(){window.close()}var J=E(),W=z(Z(),1),Ae=100;const Fe=()=>{let t=(0,J.c)(37),[e,a]=re(),{saveAppConfig:f}=U(),r=(0,W.useId)(),i=(0,W.useId)(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=fe(ne),t[0]=u):u=t[0];let b;t[1]===e?b=t[2]:(b={resolver:u,defaultValues:e},t[1]=e,t[2]=b);let l=xe(b),o;t[3]!==f||t[4]!==a?(o=async p=>{await f({config:p}).then(()=>{a(p)}).catch(()=>{a(p)})},t[3]=f,t[4]=a,t[5]=o):o=t[5];let w=o,j;t[6]===w?j=t[7]:(j=p=>{w(p)},t[6]=w,t[7]=j);let m=Ce(j,Ae),c;t[8]===e.width?c=t[9]:(c=[e.width],t[8]=e.width,t[9]=c),(0,W.useEffect)(Pe,c);let n;t[10]!==m||t[11]!==l?(n=l.handleSubmit(m),t[10]=m,t[11]=l,t[12]=n):n=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("div",{children:[(0,s.jsx)(oe,{children:"Notebook Settings"}),(0,s.jsx)(le,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=d):d=t[13];let x;t[14]===l.control?x=t[15]:(x=(0,s.jsxs)(H,{title:"Display",children:[(0,s.jsx)(M,{control:l.control,name:"width",render:He}),(0,s.jsx)(M,{control:l.control,name:"app_title",render:Ee})]}),t[14]=l.control,t[15]=x);let h;t[16]===l.control?h=t[17]:(h=(0,s.jsxs)(H,{title:"Custom Files",children:[(0,s.jsx)(M,{control:l.control,name:"css_file",render:Ie}),(0,s.jsx)(M,{control:l.control,name:"html_head_file",render:Oe})]}),t[16]=l.control,t[17]=h);let y;t[18]===l.control?y=t[19]:(y=(0,s.jsx)(H,{title:"Data",children:(0,s.jsx)(M,{control:l.control,name:"sql_output",render:ze})}),t[18]=l.control,t[19]=y);let N;t[20]!==r||t[21]!==i?(N=p=>{let{field:_}=p;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-col gap-2",children:[(0,s.jsx)(L,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:r,"data-testid":"html-checkbox",checked:_.value.includes("html"),onCheckedChange:()=>{_.onChange(R(_.value,"html"))}}),(0,s.jsx)(S,{htmlFor:r,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:i,"data-testid":"ipynb-checkbox",checked:_.value.includes("ipynb"),onCheckedChange:()=>{_.onChange(R(_.value,"ipynb"))}}),(0,s.jsx)(S,{htmlFor:i,children:"IPYNB"})]})]})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(O,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=r,t[21]=i,t[22]=N):N=t[22];let v;t[23]!==l.control||t[24]!==N?(v=(0,s.jsx)(H,{title:"Exporting outputs",children:(0,s.jsx)(M,{control:l.control,name:"auto_download",render:N})}),t[23]=l.control,t[24]=N,t[25]=v):v=t[25];let C;t[26]!==v||t[27]!==x||t[28]!==h||t[29]!==y?(C=(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[x,h,y,v]}),t[26]=v,t[27]=x,t[28]=h,t[29]=y,t[30]=C):C=t[30];let g;t[31]!==C||t[32]!==n?(g=(0,s.jsxs)("form",{onChange:n,className:"flex flex-col gap-6",children:[d,C]}),t[31]=C,t[32]=n,t[33]=g):g=t[33];let k;return t[34]!==l||t[35]!==g?(k=(0,s.jsx)(pe,{...l,children:g}),t[34]=l,t[35]=g,t[36]=k):k=t[36],k};var H=t=>{let e=(0,J.c)(5),{title:a,children:f}=t,r;e[0]===a?r=e[1]:(r=(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",children:a}),e[0]=a,e[1]=r);let i;return e[2]!==f||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,f]}),e[2]=f,e[3]=r,e[4]=i):i=e[4],i};function Pe(){window.dispatchEvent(new Event("resize"))}function qe(t){return(0,s.jsx)("option",{value:t,children:t},t)}function He(t){let{field:e}=t;return(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"Width"}),(0,s.jsx)(L,{children:(0,s.jsx)(Y,{"data-testid":"app-width-select",onChange:a=>e.onChange(a.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:ee().map(qe)})}),(0,s.jsx)(A,{})]})}function Ee(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"App title"}),(0,s.jsx)(L,{children:(0,s.jsx)(I,{...e,value:e.value??"",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Ie(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"Custom CSS"}),(0,s.jsx)(L,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"custom.css",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Oe(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"HTML Head"}),(0,s.jsx)(L,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"head.html",onChange:a=>{e.onChange(a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["A filepath to an HTML file to be injected into the"," ",(0,s.jsx)(O,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function We(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}function ze(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"SQL Output Type"}),(0,s.jsx)(L,{children:(0,s.jsx)(Y,{"data-testid":"sql-output-select",onChange:a=>{e.onChange(a.target.value),ue({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:te.map(We)})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",(0,s.jsx)(O,{className:"inline",children:"native"}),". See the"," ",(0,s.jsx)(_e,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}var De=E();const Qe=t=>{let e=(0,De.c)(32),{showAppConfig:a,disabled:f,tooltip:r}=t,i=a===void 0?!0:a,u=f===void 0?!1:f,b=r===void 0?"Settings":r,[l,o]=X(ae),w=u?"disabled":"hint-green",j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(B,{strokeWidth:1.8}),e[0]=j):j=e[0];let m;e[1]===b?m=e[2]:(m=(0,s.jsx)(G,{content:b,children:j}),e[1]=b,e[2]=m);let c;e[3]!==u||e[4]!==w||e[5]!==m?(c=(0,s.jsx)(V,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:u,color:w,children:m}),e[3]=u,e[4]=w,e[5]=m,e[6]=c):c=e[6];let n=c,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(be,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[(0,s.jsx)($,{children:(0,s.jsx)(ve,{children:"User settings"})}),(0,s.jsx)(se,{})]}),e[7]=d):d=e[7];let x=d;if(!i){let T;e[8]===n?T=e[9]:(T=(0,s.jsx)(ge,{children:n}),e[8]=n,e[9]=T);let q;return e[10]!==o||e[11]!==l||e[12]!==T?(q=(0,s.jsxs)(K,{open:l,onOpenChange:o,children:[T,x]}),e[10]=o,e[11]=l,e[12]=T,e[13]=q):q=e[13],q}let h;e[14]===n?h=e[15]:(h=(0,s.jsx)(we,{asChild:!0,children:n}),e[14]=n,e[15]=h);let y,N;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,s.jsx)(Fe,{}),N=(0,s.jsx)("div",{className:"h-px bg-border my-2"}),e[16]=y,e[17]=N):(y=e[16],N=e[17]);let v;e[18]===o?v=e[19]:(v=()=>o(!0),e[18]=o,e[19]=v);let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(B,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=C):C=e[20];let g;e[21]===v?g=e[22]:(g=(0,s.jsxs)(ye,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Re,children:[y,N,(0,s.jsxs)(de,{onClick:v,variant:"link",className:"px-0",children:[C,"User settings"]})]}),e[21]=v,e[22]=g);let k;e[23]!==g||e[24]!==h?(k=(0,s.jsxs)(Ne,{children:[h,g]}),e[23]=g,e[24]=h,e[25]=k):k=e[25];let p;e[26]!==o||e[27]!==l?(p=(0,s.jsx)(K,{open:l,onOpenChange:o,children:x}),e[26]=o,e[27]=l,e[28]=p):p=e[28];let _;return e[29]!==k||e[30]!==p?(_=(0,s.jsxs)(s.Fragment,{children:[k,p]}),e[29]=k,e[30]=p,e[31]=_):_=e[31],_};function Re(t){return t.preventDefault()}export{Le as n,Se as r,Qe as t};
1
+ import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X}from"./useEvent-BhXAndur.js";import{t as Z}from"./react-Bj1aDYRI.js";import{St as D}from"./cells-DbD2lYze.js";import{t as E}from"./compiler-runtime-B3qBwwSJ.js";import{G as $,S as ee,c as te,i as se,l as le,n as ae,u as oe}from"./ai-model-dropdown-Bfoz25CZ.js";import{C as ne,v as re,w as Q}from"./utils-YqBXNpsM.js";import{S as ie}from"./config-D2-Bw6QC.js";import{t as ce}from"./jsx-runtime-ZmTK25f3.js";import{t as de}from"./button-CZ3Cs4qb.js";import{l as R}from"./once-Bul8mtFs.js";import{r as U}from"./requests-B4FYHTZl.js";import{t as he}from"./createLucideIcon-BCdY6lG5.js";import{t as me}from"./x-ZP5cObgf.js";import{r as I}from"./input-DHHmNa19.js";import{t as B}from"./settings-OBbrbhij.js";import{a as L,c as M,d as A,g as xe,i as pe,l as F,o as P,p as fe,u as S}from"./textarea-8F9GOEGf.js";import{t as ue}from"./use-toast-T0_cQDma.js";import{l as Y}from"./select-B7bfltkI.js";import{t as G}from"./tooltip-C_WgOOcZ.js";import{o as je}from"./alert-dialog-Ctz24SMn.js";import{c as ve,l as ge,n as be,t as K}from"./dialog-tQELcltn.js";import{i as we,r as ye,t as Ne}from"./popover-B-131r4d.js";import{n as Ce}from"./useDebounce-B28kFfrM.js";import{n as ke}from"./ImperativeModal-DZr52ffu.js";import{t as O}from"./kbd-Cm6Ba9qg.js";import{t as _e}from"./links-7AQBmdyV.js";import{t as V}from"./Inputs-CbenuziM.js";var Se=he("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Te=E(),s=z(ce(),1);const Le=t=>{let e=(0,Te.c)(15),{description:a,disabled:f,tooltip:r}=t,i=f===void 0?!1:f,u=r===void 0?"Shutdown":r,{openConfirm:b,closeModal:l}=ke(),{sendShutdown:o}=U(),w;e[0]===o?w=e[1]:(w=()=>{o(),setTimeout(Me,200)},e[0]=o,e[1]=w);let j=w;if(ie())return null;let m=i?"disabled":"red",c;e[2]!==l||e[3]!==a||e[4]!==j||e[5]!==b?(c=h=>{h.stopPropagation(),b({title:"Shutdown",description:a,variant:"destructive",confirmAction:(0,s.jsx)(je,{onClick:()=>{j(),l()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=l,e[3]=a,e[4]=j,e[5]=b,e[6]=c):c=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(me,{strokeWidth:1}),e[7]=n):n=e[7];let d;e[8]!==i||e[9]!==m||e[10]!==c?(d=(0,s.jsx)(V,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:m,className:"h-[27px] w-[27px]",disabled:i,onClick:c,children:n}),e[8]=i,e[9]=m,e[10]=c,e[11]=d):d=e[11];let x;return e[12]!==d||e[13]!==u?(x=(0,s.jsx)(G,{content:u,children:d}),e[12]=d,e[13]=u,e[14]=x):x=e[14],x};function Me(){window.close()}var J=E(),W=z(Z(),1),Ae=100;const Fe=()=>{let t=(0,J.c)(37),[e,a]=re(),{saveAppConfig:f}=U(),r=(0,W.useId)(),i=(0,W.useId)(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=fe(ne),t[0]=u):u=t[0];let b;t[1]===e?b=t[2]:(b={resolver:u,defaultValues:e},t[1]=e,t[2]=b);let l=xe(b),o;t[3]!==f||t[4]!==a?(o=async p=>{await f({config:p}).then(()=>{a(p)}).catch(()=>{a(p)})},t[3]=f,t[4]=a,t[5]=o):o=t[5];let w=o,j;t[6]===w?j=t[7]:(j=p=>{w(p)},t[6]=w,t[7]=j);let m=Ce(j,Ae),c;t[8]===e.width?c=t[9]:(c=[e.width],t[8]=e.width,t[9]=c),(0,W.useEffect)(Pe,c);let n;t[10]!==m||t[11]!==l?(n=l.handleSubmit(m),t[10]=m,t[11]=l,t[12]=n):n=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("div",{children:[(0,s.jsx)(oe,{children:"Notebook Settings"}),(0,s.jsx)(le,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=d):d=t[13];let x;t[14]===l.control?x=t[15]:(x=(0,s.jsxs)(H,{title:"Display",children:[(0,s.jsx)(M,{control:l.control,name:"width",render:He}),(0,s.jsx)(M,{control:l.control,name:"app_title",render:Ee})]}),t[14]=l.control,t[15]=x);let h;t[16]===l.control?h=t[17]:(h=(0,s.jsxs)(H,{title:"Custom Files",children:[(0,s.jsx)(M,{control:l.control,name:"css_file",render:Ie}),(0,s.jsx)(M,{control:l.control,name:"html_head_file",render:Oe})]}),t[16]=l.control,t[17]=h);let y;t[18]===l.control?y=t[19]:(y=(0,s.jsx)(H,{title:"Data",children:(0,s.jsx)(M,{control:l.control,name:"sql_output",render:ze})}),t[18]=l.control,t[19]=y);let N;t[20]!==r||t[21]!==i?(N=p=>{let{field:_}=p;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-col gap-2",children:[(0,s.jsx)(L,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:r,"data-testid":"html-checkbox",checked:_.value.includes("html"),onCheckedChange:()=>{_.onChange(R(_.value,"html"))}}),(0,s.jsx)(S,{htmlFor:r,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:i,"data-testid":"ipynb-checkbox",checked:_.value.includes("ipynb"),onCheckedChange:()=>{_.onChange(R(_.value,"ipynb"))}}),(0,s.jsx)(S,{htmlFor:i,children:"IPYNB"})]})]})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(O,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=r,t[21]=i,t[22]=N):N=t[22];let v;t[23]!==l.control||t[24]!==N?(v=(0,s.jsx)(H,{title:"Exporting outputs",children:(0,s.jsx)(M,{control:l.control,name:"auto_download",render:N})}),t[23]=l.control,t[24]=N,t[25]=v):v=t[25];let C;t[26]!==v||t[27]!==x||t[28]!==h||t[29]!==y?(C=(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[x,h,y,v]}),t[26]=v,t[27]=x,t[28]=h,t[29]=y,t[30]=C):C=t[30];let g;t[31]!==C||t[32]!==n?(g=(0,s.jsxs)("form",{onChange:n,className:"flex flex-col gap-6",children:[d,C]}),t[31]=C,t[32]=n,t[33]=g):g=t[33];let k;return t[34]!==l||t[35]!==g?(k=(0,s.jsx)(pe,{...l,children:g}),t[34]=l,t[35]=g,t[36]=k):k=t[36],k};var H=t=>{let e=(0,J.c)(5),{title:a,children:f}=t,r;e[0]===a?r=e[1]:(r=(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",children:a}),e[0]=a,e[1]=r);let i;return e[2]!==f||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,f]}),e[2]=f,e[3]=r,e[4]=i):i=e[4],i};function Pe(){window.dispatchEvent(new Event("resize"))}function qe(t){return(0,s.jsx)("option",{value:t,children:t},t)}function He(t){let{field:e}=t;return(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"Width"}),(0,s.jsx)(L,{children:(0,s.jsx)(Y,{"data-testid":"app-width-select",onChange:a=>e.onChange(a.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:ee().map(qe)})}),(0,s.jsx)(A,{})]})}function Ee(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"App title"}),(0,s.jsx)(L,{children:(0,s.jsx)(I,{...e,value:e.value??"",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Ie(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"Custom CSS"}),(0,s.jsx)(L,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"custom.css",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Oe(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"HTML Head"}),(0,s.jsx)(L,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"head.html",onChange:a=>{e.onChange(a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["A filepath to an HTML file to be injected into the"," ",(0,s.jsx)(O,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function We(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}function ze(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"SQL Output Type"}),(0,s.jsx)(L,{children:(0,s.jsx)(Y,{"data-testid":"sql-output-select",onChange:a=>{e.onChange(a.target.value),ue({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:te.map(We)})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",(0,s.jsx)(O,{className:"inline",children:"native"}),". See the"," ",(0,s.jsx)(_e,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}var De=E();const Qe=t=>{let e=(0,De.c)(32),{showAppConfig:a,disabled:f,tooltip:r}=t,i=a===void 0?!0:a,u=f===void 0?!1:f,b=r===void 0?"Settings":r,[l,o]=X(ae),w=u?"disabled":"hint-green",j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(B,{strokeWidth:1.8}),e[0]=j):j=e[0];let m;e[1]===b?m=e[2]:(m=(0,s.jsx)(G,{content:b,children:j}),e[1]=b,e[2]=m);let c;e[3]!==u||e[4]!==w||e[5]!==m?(c=(0,s.jsx)(V,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:u,color:w,children:m}),e[3]=u,e[4]=w,e[5]=m,e[6]=c):c=e[6];let n=c,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(be,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[(0,s.jsx)($,{children:(0,s.jsx)(ve,{children:"User settings"})}),(0,s.jsx)(se,{})]}),e[7]=d):d=e[7];let x=d;if(!i){let T;e[8]===n?T=e[9]:(T=(0,s.jsx)(ge,{children:n}),e[8]=n,e[9]=T);let q;return e[10]!==o||e[11]!==l||e[12]!==T?(q=(0,s.jsxs)(K,{open:l,onOpenChange:o,children:[T,x]}),e[10]=o,e[11]=l,e[12]=T,e[13]=q):q=e[13],q}let h;e[14]===n?h=e[15]:(h=(0,s.jsx)(we,{asChild:!0,children:n}),e[14]=n,e[15]=h);let y,N;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,s.jsx)(Fe,{}),N=(0,s.jsx)("div",{className:"h-px bg-border my-2"}),e[16]=y,e[17]=N):(y=e[16],N=e[17]);let v;e[18]===o?v=e[19]:(v=()=>o(!0),e[18]=o,e[19]=v);let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(B,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=C):C=e[20];let g;e[21]===v?g=e[22]:(g=(0,s.jsxs)(ye,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Re,children:[y,N,(0,s.jsxs)(de,{onClick:v,variant:"link",className:"px-0",children:[C,"User settings"]})]}),e[21]=v,e[22]=g);let k;e[23]!==g||e[24]!==h?(k=(0,s.jsxs)(Ne,{children:[h,g]}),e[23]=g,e[24]=h,e[25]=k):k=e[25];let p;e[26]!==o||e[27]!==l?(p=(0,s.jsx)(K,{open:l,onOpenChange:o,children:x}),e[26]=o,e[27]=l,e[28]=p):p=e[28];let _;return e[29]!==k||e[30]!==p?(_=(0,s.jsxs)(s.Fragment,{children:[k,p]}),e[29]=k,e[30]=p,e[31]=_):_=e[31],_};function Re(t){return t.preventDefault()}export{Le as n,Se as r,Qe as t};