@marimo-team/frontend 0.23.2-dev21 → 0.23.2-dev24
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-BvL64bS5.js → CellStatus-DeF3Yt9c.js} +1 -1
- package/dist/assets/{ErrorBoundary-Cg1jAW_O.js → ErrorBoundary-BB1jw72T.js} +1 -1
- package/dist/assets/{JsonOutput-BquC7Hx9.js → JsonOutput-BEqVi4Tv.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-B3BGiMIG.js → MarimoErrorOutput-CqfRNFl6.js} +1 -1
- package/dist/assets/{RenderHTML-Bk1VwPJp.js → RenderHTML-B0R0iGuJ.js} +1 -1
- package/dist/assets/{add-cell-with-ai-fBaf1mGA.js → add-cell-with-ai-7PizChYl.js} +1 -1
- package/dist/assets/{add-connection-dialog-BLVsSASB.js → add-connection-dialog-Y6b-vKus.js} +1 -1
- package/dist/assets/{agent-panel-CKrehUib.js → agent-panel-HDpBKqEw.js} +1 -1
- package/dist/assets/{ai-model-dropdown-fWWswEFq.js → ai-model-dropdown-Cvc4Tt2A.js} +1 -1
- package/dist/assets/{app-config-button-f2SIt0wH.js → app-config-button-QMGIVLCt.js} +1 -1
- package/dist/assets/{cell-editor-BvO4VoL8.js → cell-editor-BO4OCaeK.js} +1 -1
- package/dist/assets/{cell-link-CySPtY7P.js → cell-link-Dv_KtdBn.js} +1 -1
- package/dist/assets/{cells-CN4JOik9.js → cells-CjMq7Ben.js} +1 -1
- package/dist/assets/{chat-display-Dl2y-jxb.js → chat-display-DZzDxgY3.js} +1 -1
- package/dist/assets/{chat-panel-DehYD5Ar.js → chat-panel-D2e5zJla.js} +1 -1
- package/dist/assets/{chat-ui-D0D_Tgrg.js → chat-ui-CcWKeHFA.js} +1 -1
- package/dist/assets/{column-preview-1XDTrVH6.js → column-preview-BSZiY_3c.js} +1 -1
- package/dist/assets/{command-palette-imKIqkvX.js → command-palette-DG1U1ccU.js} +1 -1
- package/dist/assets/{common-BgwczVLf.js → common-DGX-r1qB.js} +1 -1
- package/dist/assets/{components-B1Jvw8_u.js → components-BgqBBoj1.js} +1 -1
- package/dist/assets/{components-CVrxppLm.js → components-C3pJ-LE1.js} +1 -1
- package/dist/assets/{config-CkVlfvRx.js → config-CwFllgX7.js} +1 -1
- package/dist/assets/{constants-DWFgp1e4.js → constants-BKqVABV7.js} +1 -1
- package/dist/assets/{datasource-DWCvUXwI.js → datasource-mA_7y0mc.js} +1 -1
- package/dist/assets/{dependency-graph-panel-C3YQnK_2.js → dependency-graph-panel-DacznpcC.js} +1 -1
- package/dist/assets/{documentation-panel-CoPdjwTI.js → documentation-panel-BiyLQG3M.js} +1 -1
- package/dist/assets/{download-CH6PUCSY.js → download-DtbnVlWH.js} +1 -1
- package/dist/assets/{edit-page-BjsTTiqH.js → edit-page-CXsD0itx.js} +3 -3
- package/dist/assets/{error-panel-BoMNfYwb.js → error-panel-BUR1NUhu.js} +1 -1
- package/dist/assets/{file-explorer-panel-D_SB7122.js → file-explorer-panel-DMGTsLGV.js} +1 -1
- package/dist/assets/{file-icons-BycqkWhw.js → file-icons-DAkVxxY8.js} +1 -1
- package/dist/assets/{floating-outline-C4dt1jl4.js → floating-outline-OYQYvs9I.js} +1 -1
- package/dist/assets/{focus-BE82vdGd.js → focus-C-zxJ7HG.js} +1 -1
- package/dist/assets/{form-BGmIf9Es.js → form-B16XbwAT.js} +1 -1
- package/dist/assets/{gallery-page-Bmi2KIqR.js → gallery-page-wuiZIzWJ.js} +1 -1
- package/dist/assets/{glide-data-editor-BZ6Y2pFa.js → glide-data-editor-BBujJw-y.js} +1 -1
- package/dist/assets/{globals-0zSNxwQt.js → globals-DzRjmUrN.js} +1 -1
- package/dist/assets/{home-page-Cp2Z6wh4.js → home-page-5lvsZkmy.js} +1 -1
- package/dist/assets/{hooks-DMOBb9Q_.js → hooks-B0zKOo0q.js} +1 -1
- package/dist/assets/{html-to-image-C7wSf7pF.js → html-to-image-BRaZJw5p.js} +1 -1
- package/dist/assets/{index-BY7K9ILo.js → index-Cirq9H2S.js} +15 -15
- package/dist/assets/{kiosk-mode-DL0LBabq.js → kiosk-mode-CSF94Ln6.js} +1 -1
- package/dist/assets/{layout-DKYga6K1.js → layout-CauPzZ-X.js} +1 -1
- package/dist/assets/{links-BIGPU8xf.js → links-BDKBPHFA.js} +1 -1
- package/dist/assets/{logs-panel-BbKndiXR.js → logs-panel-CpyeJ9VT.js} +1 -1
- package/dist/assets/{markdown-renderer-D_1o4iKe.js → markdown-renderer-CwgOVSk3.js} +1 -1
- package/dist/assets/{name-cell-input-BiK_2x8J.js → name-cell-input-D35niRNI.js} +1 -1
- package/dist/assets/{outline-panel-DZF1B0eZ.js → outline-panel-BF7Ay2AH.js} +1 -1
- package/dist/assets/{packages-panel-DmFEdzEr.js → packages-panel-R3a1U_Xl.js} +1 -1
- package/dist/assets/{panels-C_BxuFvQ.js → panels-DnIlXVqT.js} +1 -1
- package/dist/assets/{process-output-DdKsNtZ4.js → process-output-DM0jG9Gu.js} +1 -1
- package/dist/assets/{readonly-python-code-9BGqT8OP.js → readonly-python-code-B-EP3c3e.js} +1 -1
- package/dist/assets/{run-page-Clf67Ril.js → run-page-BwW5txln.js} +1 -1
- package/dist/assets/{scratchpad-panel-DC8iF-LF.js → scratchpad-panel-DdEE06P0.js} +1 -1
- package/dist/assets/{session-DfoGrBjA.js → session-BW-irhFD.js} +1 -1
- package/dist/assets/{session-panel-B_rAAceA.js → session-panel-ADGY48Rh.js} +1 -1
- package/dist/assets/{snippets-panel-CKQeEqe5.js → snippets-panel-O_qaF0F3.js} +1 -1
- package/dist/assets/{state-DjRHh7TA.js → state-CYRi4Tmn.js} +1 -1
- package/dist/assets/{state-CXy0QO_B.js → state-DtbyH1O2.js} +1 -1
- package/dist/assets/{switch-JUwRcs7x.js → switch-CGy0ENED.js} +1 -1
- package/dist/assets/{terminal-BGENI76X.js → terminal-DJ86w99G.js} +1 -1
- package/dist/assets/{textarea-fSjjU253.js → textarea-mL3OKL7B.js} +1 -1
- package/dist/assets/{tracing-BE0u07y8.js → tracing-H1igKEBs.js} +1 -1
- package/dist/assets/{tracing-panel-ubHwtLKM.js → tracing-panel-B71qoh61.js} +2 -2
- package/dist/assets/{useAddCell-CuX1FWbO.js → useAddCell-BtoTyJxA.js} +1 -1
- package/dist/assets/{useBoolean-DogbZVm8.js → useBoolean-DV4TJRr3.js} +1 -1
- package/dist/assets/{useCellActionButton-Vec15a70.js → useCellActionButton-TGTA8Sr7.js} +1 -1
- package/dist/assets/{useDeleteCell-CYrf0eBQ.js → useDeleteCell-D7inwr6u.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-B7icvn-H.js → useDependencyPanelTab-BZ7uDSP6.js} +1 -1
- package/dist/assets/useNotebookActions-C2S0dCWj.js +1 -0
- package/dist/assets/{useRunCells-erCNrS6-.js → useRunCells-CWOv4yZS.js} +1 -1
- package/dist/assets/{useSplitCell-BBTNeIO1.js → useSplitCell-c4zhuIEb.js} +1 -1
- package/dist/assets/{vega-component-C0zntEWx.js → vega-component-sUwgClGq.js} +1 -1
- package/dist/index.html +29 -29
- package/package.json +1 -1
- package/src/components/editor/actions/useNotebookActions.tsx +12 -0
- package/src/core/constants.ts +1 -0
- package/src/plugins/impl/TabsPlugin.tsx +18 -12
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +16 -0
- package/dist/assets/useNotebookActions-DUxZwNHa.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as z}from"./chunk-LvLJmgfZ.js";import{n as C}from"./useEvent-D91BmmQi.js";import{t as Y}from"./react-Bj1aDYRI.js";import"./react-dom-CSu739Rf.js";import{t as tt}from"./compiler-runtime-B3qBwwSJ.js";import{t as et}from"./debounce-Cb5PDIgD.js";import{_,d as T}from"./useEventListener-BnjleyM2.js";import{n as V}from"./config-CkVlfvRx.js";import{t as nt}from"./cn-F7c1N498.js";import{t as rt}from"./jsx-runtime-BO1WBD9_.js";import"./fullscreen-C3QZHzf_.js";import{t as at}from"./tooltip-vbfMvhVs.js";import{r as it}from"./button-C5UWwVi3.js";import{d as N}from"./arrays-BaqpS_0_.js";import{u as ot}from"./toDate-Nxy2VUjU.js";import"./session-DfoGrBjA.js";import{r as lt}from"./useTheme-COghVmLN.js";import{t as ct}from"./isValid-D56448WG.js";import{a as st,r as mt,t as pt}from"./utils-BP_gMsN5.js";import{n as ut}from"./vega-loader.browser-BlkwfOz9.js";import{t as ft}from"./react-vega-BSH8evxY.js";import"./defaultLocale-CIhzTQNN.js";import"./defaultLocale-CUv_V9gw.js";import{r as dt,t as ht}from"./alert-BNfhR2Oi.js";import{n as gt}from"./error-banner-D_mjMaFz.js";import{n as yt}from"./useAsyncData-Dfrk_sGQ.js";import{t as vt}from"./formats-CS_lNt7H.js";import{t as H}from"./useDeepCompareMemoize-606Ao2HX.js";var kt=tt(),S=z(Y(),1);function bt(t){return t.data&&"url"in t.data&&(t.data.url=V(t.data.url).href),t}const u={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"};var F=new Set(["boxplot","errorband","errorbar"]);const x={getMarkType(t){let e=typeof t=="string"?t:t.type;if(F.has(e))throw Error("Not supported");return e},isInteractive(t){let e=typeof t=="string"?t:t.type;return!F.has(e)},makeClickable(t){let e=typeof t=="string"?t:t.type;return e in u?typeof t=="string"?{type:t,cursor:"pointer",tooltip:!0}:{...t,type:e,cursor:"pointer",tooltip:!0}:t},getOpacity(t){return typeof t=="string"?null:"opacity"in t&&typeof t.opacity=="number"?t.opacity:null}},y={point(t){return t==null?"select_point":`select_point_${t}`},interval(t){return t==null?"select_interval":`select_interval_${t}`},legendSelection(t){return`legend_selection_${t}`},binColoring(t){return t==null?"bin_coloring":`bin_coloring_${t}`},HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint(t){return t.some(e=>e.startsWith("select_point"))},hasInterval(t){return t.some(e=>e.startsWith("select_interval"))},hasLegend(t){return t.some(e=>e.startsWith("legend_selection"))},hasPanZoom(t){return t.some(e=>e.startsWith("pan_zoom"))},isBinColoring(t){return t.startsWith("bin_coloring")}},j={highlight(){return{name:y.HIGHLIGHT,select:{type:"point",on:"mouseover"}}},interval(t,e){return{name:y.interval(e),select:{type:"interval",encodings:W(t),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}},point(t,e){return{name:y.point(e),select:{type:"point",encodings:W(t),on:"click[!event.metaKey]"}}},binColoring(t){return{name:y.binColoring(t),select:{type:"point",on:"click[!event.metaKey]"}}},legend(t){return{name:y.legendSelection(t),select:{type:"point",fields:[t]},bind:"legend"}},panZoom(){return{name:y.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}}}};function W(t){switch(x.getMarkType(t.mark)){case u.image:case u.trail:return;case u.area:case u.arc:return["color"];case u.bar:{let e=wt(t);return e==="horizontal"?["y"]:e==="vertical"?["x"]:void 0}case u.circle:case u.geoshape:case u.line:case u.point:case u.rect:case u.rule:case u.square:case u.text:case u.tick:return["x","y"]}}function P(t){return"params"in t&&t.params&&t.params.length>0?N(t.params.filter(e=>e==null?!1:"select"in e&&e.select!==void 0).map(e=>e.name)):"layer"in t?N(t.layer.flatMap(P)):"vconcat"in t?N(t.vconcat.flatMap(P)):"hconcat"in t?N(t.hconcat.flatMap(P)):[]}function wt(t){var a,r;if(!t||!("mark"in t))return;let e=(a=t.encoding)==null?void 0:a.x,n=(r=t.encoding)==null?void 0:r.y;if(e&&"type"in e&&e.type==="nominal")return"vertical";if(n&&"type"in n&&n.type==="nominal"||e&&"aggregate"in e)return"horizontal";if(n&&"aggregate"in n)return"vertical"}function St(t){if(!t.encoding)return[];let e=[];for(let n of Object.values(t.encoding))n&&typeof n=="object"&&"bin"in n&&n.bin&&"field"in n&&typeof n.field=="string"&&e.push(n.field);return e}function D(t){if(!t||!("encoding"in t))return[];let{encoding:e}=t;return e?Object.entries(e).flatMap(n=>{let[a,r]=n;return!r||!xt.has(a)?[]:"field"in r&&typeof r.field=="string"?[r.field]:"condition"in r&&r.condition&&typeof r.condition=="object"&&"field"in r.condition&&r.condition.field&&typeof r.condition.field=="string"?[r.condition.field]:[]}):[]}var xt=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function G(t,e,n,a){let r=n.filter(o=>y.isBinColoring(o)),i={and:(r.length>0?r:n).map(o=>({param:o}))};if(t==="opacity"){let o=x.getOpacity(a)||1;return{...e,opacity:{condition:{test:i,value:o},value:o/5}}}else return e}function At(t){if(!("select"in t)||!t.select)return JSON.stringify(t);let e=t.select;if(typeof e=="string")return JSON.stringify({type:e,bind:t.bind});let n={type:e.type,encodings:"encodings"in e&&e.encodings?[...e.encodings].toSorted():void 0,fields:"fields"in e&&e.fields?[...e.fields].toSorted():void 0,bind:t.bind};return JSON.stringify(n)}function $(t){let e=E(t);if(e.length===0)return t;let n=_t(e);return n.length===0?t:{...L(K(t,new Set(n.map(a=>a.name))),n.map(a=>a.name)),params:[...t.params||[],...n]}}function E(t){let e=[];if("vconcat"in t&&Array.isArray(t.vconcat))for(let n of t.vconcat)e.push(...E(n));else if("hconcat"in t&&Array.isArray(t.hconcat))for(let n of t.hconcat)e.push(...E(n));else{if("layer"in t)return[];"mark"in t&&"params"in t&&t.params&&t.params.length>0&&e.push({params:t.params})}return e}function _t(t){if(t.length===0)return[];let e=new Map,n=t.length;for(let{params:r}of t){let i=new Set;for(let o of r){let l=At(o);i.has(l)||(i.add(l),e.has(l)||e.set(l,{count:0,param:o}),e.get(l).count++)}}let a=[];for(let[,{count:r,param:i}]of e)r===n&&a.push(i);return a}function K(t,e){if("vconcat"in t&&Array.isArray(t.vconcat))return{...t,vconcat:t.vconcat.map(n=>K(n,e))};if("hconcat"in t&&Array.isArray(t.hconcat))return{...t,hconcat:t.hconcat.map(n=>K(n,e))};if("mark"in t&&"params"in t&&t.params){let n=t.params,a=[];for(let r of n){if(!r||typeof r!="object"||!("name"in r)){a.push(r);continue}e.has(r.name)||a.push(r)}if(a.length===0){let{params:r,...i}=t;return i}return{...t,params:a}}return t}function L(t,e){return"vconcat"in t&&Array.isArray(t.vconcat)?{...t,vconcat:t.vconcat.map(n=>L(n,e))}:"hconcat"in t&&Array.isArray(t.hconcat)?{...t,hconcat:t.hconcat.map(n=>L(n,e))}:"layer"in t?t:"mark"in t&&x.isInteractive(t.mark)?{...t,mark:x.makeClickable(t.mark),encoding:G("opacity",t.encoding||{},e,t.mark)}:t}function Z(t,e){var l,k;let{chartSelection:n=!0,fieldSelection:a=!0}=e;if(!n&&!a)return t;(l=t.params)!=null&&l.some(s=>s.bind==="legend")&&(a=!1);let r=(k=t.params)==null?void 0:k.some(s=>!s.bind);r&&(n=!1);let i="vconcat"in t||"hconcat"in t;if(r&&i)return t;if("vconcat"in t){let s=t.vconcat.map(m=>"mark"in m?Z(m,{chartSelection:n,fieldSelection:a}):m);return $({...t,vconcat:s})}if("hconcat"in t){let s=t.hconcat.map(m=>"mark"in m?Z(m,{chartSelection:n,fieldSelection:a}):m);return $({...t,hconcat:s})}if("layer"in t){let s=t.params&&t.params.length>0,m=a!==!1&&!s,v=[];if(m){let p=t.layer.flatMap(f=>"mark"in f?D(f):[]);v=[...new Set(p)],Array.isArray(a)&&(v=v.filter(f=>a.includes(f)))}let w=t.layer.map((p,f)=>{if(!("mark"in p))return p;let h=p;if(f===0&&v.length>0){let O=v.map(M=>j.legend(M));h={...h,params:[...h.params||[],...O]}}return h=q(h,n,f),h=R(h),f===0&&(h=J(h)),h});return{...t,layer:w}}if(!("mark"in t)||!x.isInteractive(t.mark))return t;let o=t;return o=jt(o,a),o=q(o,n,void 0),o=R(o),o=J(o),o}function jt(t,e){if(e===!1)return t;let n=D(t);Array.isArray(e)&&(n=n.filter(i=>e.includes(i)));let a=n.map(i=>j.legend(i)),r=[...t.params||[],...a];return{...t,params:r}}function q(t,e,n){if(e===!1)return t;let a;try{a=x.getMarkType(t.mark)}catch{return t}if(a==="geoshape")return t;let r=St(t),i=e===!0?r.length>0?["point"]:Ot(a):[e];if(!i||i.length===0)return t;let o=i.map(k=>k==="interval"?j.interval(t,n):j.point(t,n)),l=[...t.params||[],...o];return r.length>0&&i.includes("point")&&l.push(j.binColoring(n)),{...t,params:l}}function J(t){let e;try{e=x.getMarkType(t.mark)}catch{}if(e==="geoshape")return t;let n=t.params||[];return n.some(a=>a.bind==="scales")?t:{...t,params:[...n,j.panZoom()]}}function R(t){let e="encoding"in t?t.encoding:void 0,n=t.params||[],a=n.map(r=>r.name);return n.length===0||!x.isInteractive(t.mark)?t:{...t,mark:x.makeClickable(t.mark),encoding:G("opacity",e||{},a,t.mark)}}function Ot(t){switch(t){case"arc":case"area":return["point"];case"text":case"bar":return["point","interval"];case"line":return;default:return["point","interval"]}}async function Mt(t){if(!t)return t;let e="datasets"in t?{...t.datasets}:{},n=async r=>{if(!r)return r;if("layer"in r){let l=await Promise.all(r.layer.map(n));r={...r,layer:l}}if("hconcat"in r){let l=await Promise.all(r.hconcat.map(n));r={...r,hconcat:l}}if("vconcat"in r){let l=await Promise.all(r.vconcat.map(n));r={...r,vconcat:l}}if("spec"in r&&(r={...r,spec:await n(r.spec)}),!r.data||!("url"in r.data))return r;let i;try{i=V(r.data.url)}catch{return r}let o=await st(i.href,r.data.format);return e[i.pathname]=o,{...r,data:{name:i.pathname}}},a=await n(t);return Object.keys(e).length===0?a:{...a,datasets:e}}var d=z(rt(),1);ut("arrow",vt);var Nt=t=>{let e=(0,kt.c)(12),{value:n,setValue:a,chartSelection:r,fieldSelection:i,spec:o,embedOptions:l}=t,k,s;e[0]===o?(k=e[1],s=e[2]):(k=async()=>Mt(o),s=[o],e[0]=o,e[1]=k,e[2]=s);let{data:m,error:v}=yt(k,s);if(v){let p;return e[3]===v?p=e[4]:(p=(0,d.jsx)(gt,{error:v}),e[3]=v,e[4]=p),p}if(!m)return null;let w;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==m||e[9]!==a||e[10]!==n?(w=(0,d.jsx)(Pt,{value:n,setValue:a,chartSelection:r,fieldSelection:i,spec:m,embedOptions:l}),e[5]=r,e[6]=l,e[7]=i,e[8]=m,e[9]=a,e[10]=n,e[11]=w):w=e[11],w},Pt=({value:t,setValue:e,chartSelection:n,fieldSelection:a,spec:r,embedOptions:i})=>{let{theme:o}=lt(),l=(0,S.useRef)(null),k=(0,S.useRef)(void 0),[s,m]=(0,S.useState)(),v=(0,S.useMemo)(()=>i&&"actions"in i?i.actions:{source:!1,compiled:!1},[i]),w=H(r),p=(0,S.useMemo)(()=>Z(bt(w),{chartSelection:n,fieldSelection:a}),[w,n,a]),f=(0,S.useMemo)(()=>P(p),[p]),h=C(c=>{e({...t,...c})}),O=(0,S.useMemo)(()=>et((c,g)=>{_.debug("[Vega signal]",c,g);let b=T.mapValues(g,Ct);b=T.mapValues(b,It),h({[c]:b})},100),[h]),M=H(f),I=(0,S.useMemo)(()=>M.reduce((c,g)=>(y.PAN_ZOOM===g||y.isBinColoring(g)||c.push({signalName:g,handler:(b,X)=>O(b,X)}),c),[]),[M,O]),B=C(c=>{_.error(c),_.debug(p),m(c)}),Q=C(c=>{_.debug("[Vega view] created",c),k.current=c,m(void 0)}),U=()=>{let c=[];return y.hasPoint(f)&&c.push(["Point selection","click to select a point; hold shift for multi-select"]),y.hasInterval(f)&&c.push(["Interval selection","click and drag to select an interval"]),y.hasLegend(f)&&c.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),y.hasPanZoom(f)&&c.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),c.length===0?null:(0,d.jsx)(at,{delayDuration:300,side:"left",content:(0,d.jsx)("div",{className:"text-xs flex flex-col",children:c.map((g,b)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{className:"font-bold tracking-wide",children:[g[0],":"]})," ",g[1]]},b))}),children:(0,d.jsx)(ot,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})},A=ft({ref:l,spec:p,options:{theme:o==="dark"?"dark":void 0,actions:v,mode:"vega-lite",tooltip:mt.call,renderer:"canvas"},onError:B,onEmbed:Q});return(0,S.useEffect)(()=>(I.forEach(({signalName:c,handler:g})=>{try{A==null||A.view.addSignalListener(c,g)}catch(b){_.error(b)}}),()=>{I.forEach(({signalName:c,handler:g})=>{try{A==null||A.view.removeSignalListener(c,g)}catch(b){_.error(b)}})}),[A,I]),(0,d.jsxs)(d.Fragment,{children:[s&&(0,d.jsxs)(ht,{variant:"destructive",children:[(0,d.jsx)(dt,{children:s.message}),(0,d.jsx)("div",{className:"text-md",children:s.stack})]}),(0,d.jsxs)("div",{className:nt("relative"),onPointerDown:it.stopPropagation(),children:[(0,d.jsx)("div",{ref:l,"data-container-width":pt(p)}),U()]})]})};function It(t){return t instanceof Set?[...t]:t}function Ct(t){return Array.isArray(t)?t.map(e=>e instanceof Date&&ct(e)?new Date(e).getTime():e):t}var Et=Nt;export{Et as default};
|
|
1
|
+
import{s as z}from"./chunk-LvLJmgfZ.js";import{n as C}from"./useEvent-D91BmmQi.js";import{t as Y}from"./react-Bj1aDYRI.js";import"./react-dom-CSu739Rf.js";import{t as tt}from"./compiler-runtime-B3qBwwSJ.js";import{t as et}from"./debounce-Cb5PDIgD.js";import{_,d as T}from"./useEventListener-BnjleyM2.js";import{n as V}from"./config-CwFllgX7.js";import{t as nt}from"./cn-F7c1N498.js";import{t as rt}from"./jsx-runtime-BO1WBD9_.js";import"./fullscreen-C3QZHzf_.js";import{t as at}from"./tooltip-vbfMvhVs.js";import{r as it}from"./button-C5UWwVi3.js";import{d as N}from"./arrays-BaqpS_0_.js";import{u as ot}from"./toDate-Nxy2VUjU.js";import"./session-BW-irhFD.js";import{r as lt}from"./useTheme-COghVmLN.js";import{t as ct}from"./isValid-D56448WG.js";import{a as st,r as mt,t as pt}from"./utils-BP_gMsN5.js";import{n as ut}from"./vega-loader.browser-BlkwfOz9.js";import{t as ft}from"./react-vega-BSH8evxY.js";import"./defaultLocale-CIhzTQNN.js";import"./defaultLocale-CUv_V9gw.js";import{r as dt,t as ht}from"./alert-BNfhR2Oi.js";import{n as gt}from"./error-banner-D_mjMaFz.js";import{n as yt}from"./useAsyncData-Dfrk_sGQ.js";import{t as vt}from"./formats-CS_lNt7H.js";import{t as H}from"./useDeepCompareMemoize-606Ao2HX.js";var kt=tt(),S=z(Y(),1);function bt(t){return t.data&&"url"in t.data&&(t.data.url=V(t.data.url).href),t}const u={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"};var F=new Set(["boxplot","errorband","errorbar"]);const x={getMarkType(t){let e=typeof t=="string"?t:t.type;if(F.has(e))throw Error("Not supported");return e},isInteractive(t){let e=typeof t=="string"?t:t.type;return!F.has(e)},makeClickable(t){let e=typeof t=="string"?t:t.type;return e in u?typeof t=="string"?{type:t,cursor:"pointer",tooltip:!0}:{...t,type:e,cursor:"pointer",tooltip:!0}:t},getOpacity(t){return typeof t=="string"?null:"opacity"in t&&typeof t.opacity=="number"?t.opacity:null}},y={point(t){return t==null?"select_point":`select_point_${t}`},interval(t){return t==null?"select_interval":`select_interval_${t}`},legendSelection(t){return`legend_selection_${t}`},binColoring(t){return t==null?"bin_coloring":`bin_coloring_${t}`},HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint(t){return t.some(e=>e.startsWith("select_point"))},hasInterval(t){return t.some(e=>e.startsWith("select_interval"))},hasLegend(t){return t.some(e=>e.startsWith("legend_selection"))},hasPanZoom(t){return t.some(e=>e.startsWith("pan_zoom"))},isBinColoring(t){return t.startsWith("bin_coloring")}},j={highlight(){return{name:y.HIGHLIGHT,select:{type:"point",on:"mouseover"}}},interval(t,e){return{name:y.interval(e),select:{type:"interval",encodings:W(t),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}},point(t,e){return{name:y.point(e),select:{type:"point",encodings:W(t),on:"click[!event.metaKey]"}}},binColoring(t){return{name:y.binColoring(t),select:{type:"point",on:"click[!event.metaKey]"}}},legend(t){return{name:y.legendSelection(t),select:{type:"point",fields:[t]},bind:"legend"}},panZoom(){return{name:y.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}}}};function W(t){switch(x.getMarkType(t.mark)){case u.image:case u.trail:return;case u.area:case u.arc:return["color"];case u.bar:{let e=wt(t);return e==="horizontal"?["y"]:e==="vertical"?["x"]:void 0}case u.circle:case u.geoshape:case u.line:case u.point:case u.rect:case u.rule:case u.square:case u.text:case u.tick:return["x","y"]}}function P(t){return"params"in t&&t.params&&t.params.length>0?N(t.params.filter(e=>e==null?!1:"select"in e&&e.select!==void 0).map(e=>e.name)):"layer"in t?N(t.layer.flatMap(P)):"vconcat"in t?N(t.vconcat.flatMap(P)):"hconcat"in t?N(t.hconcat.flatMap(P)):[]}function wt(t){var a,r;if(!t||!("mark"in t))return;let e=(a=t.encoding)==null?void 0:a.x,n=(r=t.encoding)==null?void 0:r.y;if(e&&"type"in e&&e.type==="nominal")return"vertical";if(n&&"type"in n&&n.type==="nominal"||e&&"aggregate"in e)return"horizontal";if(n&&"aggregate"in n)return"vertical"}function St(t){if(!t.encoding)return[];let e=[];for(let n of Object.values(t.encoding))n&&typeof n=="object"&&"bin"in n&&n.bin&&"field"in n&&typeof n.field=="string"&&e.push(n.field);return e}function D(t){if(!t||!("encoding"in t))return[];let{encoding:e}=t;return e?Object.entries(e).flatMap(n=>{let[a,r]=n;return!r||!xt.has(a)?[]:"field"in r&&typeof r.field=="string"?[r.field]:"condition"in r&&r.condition&&typeof r.condition=="object"&&"field"in r.condition&&r.condition.field&&typeof r.condition.field=="string"?[r.condition.field]:[]}):[]}var xt=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function G(t,e,n,a){let r=n.filter(o=>y.isBinColoring(o)),i={and:(r.length>0?r:n).map(o=>({param:o}))};if(t==="opacity"){let o=x.getOpacity(a)||1;return{...e,opacity:{condition:{test:i,value:o},value:o/5}}}else return e}function At(t){if(!("select"in t)||!t.select)return JSON.stringify(t);let e=t.select;if(typeof e=="string")return JSON.stringify({type:e,bind:t.bind});let n={type:e.type,encodings:"encodings"in e&&e.encodings?[...e.encodings].toSorted():void 0,fields:"fields"in e&&e.fields?[...e.fields].toSorted():void 0,bind:t.bind};return JSON.stringify(n)}function $(t){let e=E(t);if(e.length===0)return t;let n=_t(e);return n.length===0?t:{...L(K(t,new Set(n.map(a=>a.name))),n.map(a=>a.name)),params:[...t.params||[],...n]}}function E(t){let e=[];if("vconcat"in t&&Array.isArray(t.vconcat))for(let n of t.vconcat)e.push(...E(n));else if("hconcat"in t&&Array.isArray(t.hconcat))for(let n of t.hconcat)e.push(...E(n));else{if("layer"in t)return[];"mark"in t&&"params"in t&&t.params&&t.params.length>0&&e.push({params:t.params})}return e}function _t(t){if(t.length===0)return[];let e=new Map,n=t.length;for(let{params:r}of t){let i=new Set;for(let o of r){let l=At(o);i.has(l)||(i.add(l),e.has(l)||e.set(l,{count:0,param:o}),e.get(l).count++)}}let a=[];for(let[,{count:r,param:i}]of e)r===n&&a.push(i);return a}function K(t,e){if("vconcat"in t&&Array.isArray(t.vconcat))return{...t,vconcat:t.vconcat.map(n=>K(n,e))};if("hconcat"in t&&Array.isArray(t.hconcat))return{...t,hconcat:t.hconcat.map(n=>K(n,e))};if("mark"in t&&"params"in t&&t.params){let n=t.params,a=[];for(let r of n){if(!r||typeof r!="object"||!("name"in r)){a.push(r);continue}e.has(r.name)||a.push(r)}if(a.length===0){let{params:r,...i}=t;return i}return{...t,params:a}}return t}function L(t,e){return"vconcat"in t&&Array.isArray(t.vconcat)?{...t,vconcat:t.vconcat.map(n=>L(n,e))}:"hconcat"in t&&Array.isArray(t.hconcat)?{...t,hconcat:t.hconcat.map(n=>L(n,e))}:"layer"in t?t:"mark"in t&&x.isInteractive(t.mark)?{...t,mark:x.makeClickable(t.mark),encoding:G("opacity",t.encoding||{},e,t.mark)}:t}function Z(t,e){var l,k;let{chartSelection:n=!0,fieldSelection:a=!0}=e;if(!n&&!a)return t;(l=t.params)!=null&&l.some(s=>s.bind==="legend")&&(a=!1);let r=(k=t.params)==null?void 0:k.some(s=>!s.bind);r&&(n=!1);let i="vconcat"in t||"hconcat"in t;if(r&&i)return t;if("vconcat"in t){let s=t.vconcat.map(m=>"mark"in m?Z(m,{chartSelection:n,fieldSelection:a}):m);return $({...t,vconcat:s})}if("hconcat"in t){let s=t.hconcat.map(m=>"mark"in m?Z(m,{chartSelection:n,fieldSelection:a}):m);return $({...t,hconcat:s})}if("layer"in t){let s=t.params&&t.params.length>0,m=a!==!1&&!s,v=[];if(m){let p=t.layer.flatMap(f=>"mark"in f?D(f):[]);v=[...new Set(p)],Array.isArray(a)&&(v=v.filter(f=>a.includes(f)))}let w=t.layer.map((p,f)=>{if(!("mark"in p))return p;let h=p;if(f===0&&v.length>0){let O=v.map(M=>j.legend(M));h={...h,params:[...h.params||[],...O]}}return h=q(h,n,f),h=R(h),f===0&&(h=J(h)),h});return{...t,layer:w}}if(!("mark"in t)||!x.isInteractive(t.mark))return t;let o=t;return o=jt(o,a),o=q(o,n,void 0),o=R(o),o=J(o),o}function jt(t,e){if(e===!1)return t;let n=D(t);Array.isArray(e)&&(n=n.filter(i=>e.includes(i)));let a=n.map(i=>j.legend(i)),r=[...t.params||[],...a];return{...t,params:r}}function q(t,e,n){if(e===!1)return t;let a;try{a=x.getMarkType(t.mark)}catch{return t}if(a==="geoshape")return t;let r=St(t),i=e===!0?r.length>0?["point"]:Ot(a):[e];if(!i||i.length===0)return t;let o=i.map(k=>k==="interval"?j.interval(t,n):j.point(t,n)),l=[...t.params||[],...o];return r.length>0&&i.includes("point")&&l.push(j.binColoring(n)),{...t,params:l}}function J(t){let e;try{e=x.getMarkType(t.mark)}catch{}if(e==="geoshape")return t;let n=t.params||[];return n.some(a=>a.bind==="scales")?t:{...t,params:[...n,j.panZoom()]}}function R(t){let e="encoding"in t?t.encoding:void 0,n=t.params||[],a=n.map(r=>r.name);return n.length===0||!x.isInteractive(t.mark)?t:{...t,mark:x.makeClickable(t.mark),encoding:G("opacity",e||{},a,t.mark)}}function Ot(t){switch(t){case"arc":case"area":return["point"];case"text":case"bar":return["point","interval"];case"line":return;default:return["point","interval"]}}async function Mt(t){if(!t)return t;let e="datasets"in t?{...t.datasets}:{},n=async r=>{if(!r)return r;if("layer"in r){let l=await Promise.all(r.layer.map(n));r={...r,layer:l}}if("hconcat"in r){let l=await Promise.all(r.hconcat.map(n));r={...r,hconcat:l}}if("vconcat"in r){let l=await Promise.all(r.vconcat.map(n));r={...r,vconcat:l}}if("spec"in r&&(r={...r,spec:await n(r.spec)}),!r.data||!("url"in r.data))return r;let i;try{i=V(r.data.url)}catch{return r}let o=await st(i.href,r.data.format);return e[i.pathname]=o,{...r,data:{name:i.pathname}}},a=await n(t);return Object.keys(e).length===0?a:{...a,datasets:e}}var d=z(rt(),1);ut("arrow",vt);var Nt=t=>{let e=(0,kt.c)(12),{value:n,setValue:a,chartSelection:r,fieldSelection:i,spec:o,embedOptions:l}=t,k,s;e[0]===o?(k=e[1],s=e[2]):(k=async()=>Mt(o),s=[o],e[0]=o,e[1]=k,e[2]=s);let{data:m,error:v}=yt(k,s);if(v){let p;return e[3]===v?p=e[4]:(p=(0,d.jsx)(gt,{error:v}),e[3]=v,e[4]=p),p}if(!m)return null;let w;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==m||e[9]!==a||e[10]!==n?(w=(0,d.jsx)(Pt,{value:n,setValue:a,chartSelection:r,fieldSelection:i,spec:m,embedOptions:l}),e[5]=r,e[6]=l,e[7]=i,e[8]=m,e[9]=a,e[10]=n,e[11]=w):w=e[11],w},Pt=({value:t,setValue:e,chartSelection:n,fieldSelection:a,spec:r,embedOptions:i})=>{let{theme:o}=lt(),l=(0,S.useRef)(null),k=(0,S.useRef)(void 0),[s,m]=(0,S.useState)(),v=(0,S.useMemo)(()=>i&&"actions"in i?i.actions:{source:!1,compiled:!1},[i]),w=H(r),p=(0,S.useMemo)(()=>Z(bt(w),{chartSelection:n,fieldSelection:a}),[w,n,a]),f=(0,S.useMemo)(()=>P(p),[p]),h=C(c=>{e({...t,...c})}),O=(0,S.useMemo)(()=>et((c,g)=>{_.debug("[Vega signal]",c,g);let b=T.mapValues(g,Ct);b=T.mapValues(b,It),h({[c]:b})},100),[h]),M=H(f),I=(0,S.useMemo)(()=>M.reduce((c,g)=>(y.PAN_ZOOM===g||y.isBinColoring(g)||c.push({signalName:g,handler:(b,X)=>O(b,X)}),c),[]),[M,O]),B=C(c=>{_.error(c),_.debug(p),m(c)}),Q=C(c=>{_.debug("[Vega view] created",c),k.current=c,m(void 0)}),U=()=>{let c=[];return y.hasPoint(f)&&c.push(["Point selection","click to select a point; hold shift for multi-select"]),y.hasInterval(f)&&c.push(["Interval selection","click and drag to select an interval"]),y.hasLegend(f)&&c.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),y.hasPanZoom(f)&&c.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),c.length===0?null:(0,d.jsx)(at,{delayDuration:300,side:"left",content:(0,d.jsx)("div",{className:"text-xs flex flex-col",children:c.map((g,b)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{className:"font-bold tracking-wide",children:[g[0],":"]})," ",g[1]]},b))}),children:(0,d.jsx)(ot,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})},A=ft({ref:l,spec:p,options:{theme:o==="dark"?"dark":void 0,actions:v,mode:"vega-lite",tooltip:mt.call,renderer:"canvas"},onError:B,onEmbed:Q});return(0,S.useEffect)(()=>(I.forEach(({signalName:c,handler:g})=>{try{A==null||A.view.addSignalListener(c,g)}catch(b){_.error(b)}}),()=>{I.forEach(({signalName:c,handler:g})=>{try{A==null||A.view.removeSignalListener(c,g)}catch(b){_.error(b)}})}),[A,I]),(0,d.jsxs)(d.Fragment,{children:[s&&(0,d.jsxs)(ht,{variant:"destructive",children:[(0,d.jsx)(dt,{children:s.message}),(0,d.jsx)("div",{className:"text-md",children:s.stack})]}),(0,d.jsxs)("div",{className:nt("relative"),onPointerDown:it.stopPropagation(),children:[(0,d.jsx)("div",{ref:l,"data-container-width":pt(p)}),U()]})]})};function It(t){return t instanceof Set?[...t]:t}function Ct(t){return Array.isArray(t)?t.map(e=>e instanceof Date&&ct(e)?new Date(e).getTime():e):t}var Et=Nt;export{Et as default};
|
package/dist/index.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
67
67
|
<!-- /TODO -->
|
|
68
68
|
<title>{{ title }}</title>
|
|
69
|
-
<script type="module" crossorigin src="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-Cirq9H2S.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-DXnewu3N.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
<link rel="modulepreload" crossorigin href="./assets/Deferred-CcWopv8N.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="./assets/uuid-D_ujsK2Y.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="./assets/DeferredRequestRegistry-RxwEQMjI.js">
|
|
105
|
-
<link rel="modulepreload" crossorigin href="./assets/constants-
|
|
106
|
-
<link rel="modulepreload" crossorigin href="./assets/session-
|
|
107
|
-
<link rel="modulepreload" crossorigin href="./assets/config-
|
|
105
|
+
<link rel="modulepreload" crossorigin href="./assets/constants-BKqVABV7.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="./assets/session-BW-irhFD.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="./assets/config-CwFllgX7.js">
|
|
108
108
|
<link rel="modulepreload" crossorigin href="./assets/requests-eZGK4-3l.js">
|
|
109
109
|
<link rel="modulepreload" crossorigin href="./assets/useLifecycle-kv5iY7Oa.js">
|
|
110
110
|
<link rel="modulepreload" crossorigin href="./assets/useNonce-Byj61IpU.js">
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/debounce-Cb5PDIgD.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/database-zap-4H4zyZdL.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/main-BwbZtaFo.js">
|
|
137
|
-
<link rel="modulepreload" crossorigin href="./assets/cells-
|
|
138
|
-
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-CjMq7Ben.js">
|
|
138
|
+
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-BB1jw72T.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/kbd-C2diOgyT.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-DFGhoif2.js">
|
|
141
141
|
<link rel="modulepreload" crossorigin href="./assets/alert-dialog-TGjcoGIT.js">
|
|
@@ -148,33 +148,33 @@
|
|
|
148
148
|
<link rel="modulepreload" crossorigin href="./assets/usePress-CGgbIgki.js">
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/input-p1wVgVWX.js">
|
|
150
150
|
<link rel="modulepreload" crossorigin href="./assets/ImperativeModal-CGCXLZNQ.js">
|
|
151
|
-
<link rel="modulepreload" crossorigin href="./assets/cell-link-
|
|
151
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-link-Dv_KtdBn.js">
|
|
152
152
|
<link rel="modulepreload" crossorigin href="./assets/multi-map-BTTQVlsX.js">
|
|
153
153
|
<link rel="modulepreload" crossorigin href="./assets/alert-BNfhR2Oi.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-DAaXkAc7.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-BP3RNh23.js">
|
|
156
156
|
<link rel="modulepreload" crossorigin href="./assets/links-DriVF7--.js">
|
|
157
|
-
<link rel="modulepreload" crossorigin href="./assets/useRunCells-
|
|
157
|
+
<link rel="modulepreload" crossorigin href="./assets/useRunCells-CWOv4yZS.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/copy-7r5HfDlA.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/copy-Da2RgYqb.js">
|
|
160
160
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-Dj1HNd_Y.js">
|
|
161
|
-
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/datasource-
|
|
163
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
161
|
+
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-B0R0iGuJ.js">
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/datasource-mA_7y0mc.js">
|
|
163
|
+
<link rel="modulepreload" crossorigin href="./assets/state-CYRi4Tmn.js">
|
|
164
164
|
<link rel="modulepreload" crossorigin href="./assets/sparkles-ChCaORbA.js">
|
|
165
|
-
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-
|
|
165
|
+
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-CqfRNFl6.js">
|
|
166
166
|
<link rel="modulepreload" crossorigin href="./assets/spinner-DQEP8eZv.js">
|
|
167
|
-
<link rel="modulepreload" crossorigin href="./assets/html-to-image-
|
|
168
|
-
<link rel="modulepreload" crossorigin href="./assets/focus-
|
|
167
|
+
<link rel="modulepreload" crossorigin href="./assets/html-to-image-BRaZJw5p.js">
|
|
168
|
+
<link rel="modulepreload" crossorigin href="./assets/focus-C-zxJ7HG.js">
|
|
169
169
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-Dfrk_sGQ.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-CcvG8MRt.js">
|
|
171
171
|
<link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-p4Qnjk3c.js">
|
|
172
172
|
<link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-BoZamJn1.js">
|
|
173
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
173
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-CwgOVSk3.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/command-Cl8ZrBr-.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/popover-DI3qDiGn.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/errors-pt9sYxVM.js">
|
|
177
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
177
|
+
<link rel="modulepreload" crossorigin href="./assets/download-DtbnVlWH.js">
|
|
178
178
|
<link rel="modulepreload" crossorigin href="./assets/table-D1etsOld.js">
|
|
179
179
|
<link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-CkUD7bOs.js">
|
|
180
180
|
<link rel="modulepreload" crossorigin href="./assets/error-banner-D_mjMaFz.js">
|
|
@@ -191,44 +191,44 @@
|
|
|
191
191
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-DSvL4pHv.js">
|
|
192
192
|
<link rel="modulepreload" crossorigin href="./assets/message-circle-CLjSaxkw.js">
|
|
193
193
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-CqJ1WMs7.js">
|
|
194
|
-
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-
|
|
194
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-BEqVi4Tv.js">
|
|
195
195
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-Blov7aJ9.js">
|
|
196
196
|
<link rel="modulepreload" crossorigin href="./assets/square-function-B-CQOS2Y.js">
|
|
197
197
|
<link rel="modulepreload" crossorigin href="./assets/spec-Bh-SgSIE.js">
|
|
198
198
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-vertical-srFWqsBV.js">
|
|
199
199
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-COn1o-WB.js">
|
|
200
|
-
<link rel="modulepreload" crossorigin href="./assets/components-
|
|
201
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
200
|
+
<link rel="modulepreload" crossorigin href="./assets/components-C3pJ-LE1.js">
|
|
201
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-BSZiY_3c.js">
|
|
202
202
|
<link rel="modulepreload" crossorigin href="./assets/icons-CXtFyW1a.js">
|
|
203
|
-
<link rel="modulepreload" crossorigin href="./assets/floating-outline-
|
|
204
|
-
<link rel="modulepreload" crossorigin href="./assets/useAddCell-
|
|
203
|
+
<link rel="modulepreload" crossorigin href="./assets/floating-outline-OYQYvs9I.js">
|
|
204
|
+
<link rel="modulepreload" crossorigin href="./assets/useAddCell-BtoTyJxA.js">
|
|
205
205
|
<link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-CUZPaRZf.js">
|
|
206
206
|
<link rel="modulepreload" crossorigin href="./assets/esm-B9SL6Z9c.js">
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-B0Trbt-B.js">
|
|
208
208
|
<link rel="modulepreload" crossorigin href="./assets/plus-0S0GQrJv.js">
|
|
209
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
209
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-B-EP3c3e.js">
|
|
210
210
|
<link rel="modulepreload" crossorigin href="./assets/file-headphone-Bsq83qdM.js">
|
|
211
211
|
<link rel="modulepreload" crossorigin href="./assets/file-D43aig5H.js">
|
|
212
212
|
<link rel="modulepreload" crossorigin href="./assets/image-uxsBjzpQ.js">
|
|
213
|
-
<link rel="modulepreload" crossorigin href="./assets/file-icons-
|
|
214
|
-
<link rel="modulepreload" crossorigin href="./assets/switch-
|
|
213
|
+
<link rel="modulepreload" crossorigin href="./assets/file-icons-DAkVxxY8.js">
|
|
214
|
+
<link rel="modulepreload" crossorigin href="./assets/switch-CGy0ENED.js">
|
|
215
215
|
<link rel="modulepreload" crossorigin href="./assets/events-CKqlBGzI.js">
|
|
216
|
-
<link rel="modulepreload" crossorigin href="./assets/globals-
|
|
216
|
+
<link rel="modulepreload" crossorigin href="./assets/globals-DzRjmUrN.js">
|
|
217
217
|
<link rel="modulepreload" crossorigin href="./assets/share-qhWUqocS.js">
|
|
218
218
|
<link rel="modulepreload" crossorigin href="./assets/blob-Gsfvuteh.js">
|
|
219
219
|
<link rel="modulepreload" crossorigin href="./assets/memoize-BAAodEJh.js">
|
|
220
220
|
<link rel="modulepreload" crossorigin href="./assets/get-B_kAyaPl.js">
|
|
221
221
|
<link rel="modulepreload" crossorigin href="./assets/_baseSet-BmsjVBUa.js">
|
|
222
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
222
|
+
<link rel="modulepreload" crossorigin href="./assets/state-DtbyH1O2.js">
|
|
223
223
|
<link rel="modulepreload" crossorigin href="./assets/label-BoqPL2-A.js">
|
|
224
|
-
<link rel="modulepreload" crossorigin href="./assets/textarea-
|
|
224
|
+
<link rel="modulepreload" crossorigin href="./assets/textarea-mL3OKL7B.js">
|
|
225
225
|
<link rel="modulepreload" crossorigin href="./assets/refresh-ccw-C5Uh6Z-V.js">
|
|
226
226
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-DL_ttIYp.js">
|
|
227
|
-
<link rel="modulepreload" crossorigin href="./assets/form-
|
|
227
|
+
<link rel="modulepreload" crossorigin href="./assets/form-B16XbwAT.js">
|
|
228
228
|
<link rel="modulepreload" crossorigin href="./assets/renderShortcut-xBUAOVxJ.js">
|
|
229
229
|
<link rel="modulepreload" crossorigin href="./assets/field-D3z_dSHm.js">
|
|
230
230
|
<link rel="modulepreload" crossorigin href="./assets/RSPContexts-CQGrGP4m.js">
|
|
231
|
-
<link rel="modulepreload" crossorigin href="./assets/useBoolean-
|
|
231
|
+
<link rel="modulepreload" crossorigin href="./assets/useBoolean-DV4TJRr3.js">
|
|
232
232
|
<link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-606Ao2HX.js">
|
|
233
233
|
<link rel="modulepreload" crossorigin href="./assets/types-PCCK2TgR.js">
|
|
234
234
|
<link rel="modulepreload" crossorigin href="./assets/fileToBase64-BYq7Wf_N.js">
|
package/package.json
CHANGED
|
@@ -381,6 +381,18 @@ export function useNotebookActions() {
|
|
|
381
381
|
});
|
|
382
382
|
},
|
|
383
383
|
},
|
|
384
|
+
{
|
|
385
|
+
icon: <MarimoPlusIcon size={14} strokeWidth={1.5} />,
|
|
386
|
+
label: "Create molab notebook",
|
|
387
|
+
handle: async () => {
|
|
388
|
+
const code = await readCode();
|
|
389
|
+
const url = createShareableLink({
|
|
390
|
+
code: code.contents,
|
|
391
|
+
baseUrl: `${Constants.molab}/new`,
|
|
392
|
+
});
|
|
393
|
+
window.open(url, "_blank");
|
|
394
|
+
},
|
|
395
|
+
},
|
|
384
396
|
],
|
|
385
397
|
},
|
|
386
398
|
|
package/src/core/constants.ts
CHANGED
|
@@ -9,12 +9,14 @@ import {
|
|
|
9
9
|
} from "../../components/ui/tabs";
|
|
10
10
|
import { renderHTML } from "../core/RenderHTML";
|
|
11
11
|
import type { IPlugin, IPluginProps } from "../types";
|
|
12
|
+
import { Labeled } from "./common/labeled";
|
|
12
13
|
|
|
13
14
|
interface Data {
|
|
14
15
|
/**
|
|
15
16
|
* The labels for each tab; raw HTML.
|
|
16
17
|
*/
|
|
17
18
|
tabs: string[];
|
|
19
|
+
label: string | null;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
// Selected tab index
|
|
@@ -25,6 +27,7 @@ export class TabsPlugin implements IPlugin<T, Data> {
|
|
|
25
27
|
|
|
26
28
|
validator = z.object({
|
|
27
29
|
tabs: z.array(z.string()),
|
|
30
|
+
label: z.string().nullable(),
|
|
28
31
|
});
|
|
29
32
|
|
|
30
33
|
render(props: IPluginProps<T, Data>): JSX.Element {
|
|
@@ -47,6 +50,7 @@ interface TabComponentProps extends Data {
|
|
|
47
50
|
|
|
48
51
|
const TabComponent = ({
|
|
49
52
|
tabs,
|
|
53
|
+
label,
|
|
50
54
|
value,
|
|
51
55
|
setValue,
|
|
52
56
|
children,
|
|
@@ -67,17 +71,19 @@ const TabComponent = ({
|
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
return (
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
<Labeled label={label} align="top">
|
|
75
|
+
<Tabs value={internalValue} onValueChange={handleChange}>
|
|
76
|
+
<TabsList>
|
|
77
|
+
{tabs.map((tab, index) => (
|
|
78
|
+
<TabsTrigger key={index} value={index.toString()}>
|
|
79
|
+
{renderHTML({ html: tab })}
|
|
80
|
+
</TabsTrigger>
|
|
81
|
+
))}
|
|
82
|
+
</TabsList>
|
|
83
|
+
{React.Children.map(children, (child, index) => {
|
|
84
|
+
return <TabsContent value={index.toString()}>{child}</TabsContent>;
|
|
85
|
+
})}
|
|
86
|
+
</Tabs>
|
|
87
|
+
</Labeled>
|
|
82
88
|
);
|
|
83
89
|
};
|
|
@@ -380,6 +380,18 @@ export class MatplotlibRenderer {
|
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
+
// Restore selection from backend when the value changed and the user
|
|
384
|
+
// is not actively drawing/dragging/resizing. During active interactions
|
|
385
|
+
// the renderer owns the interaction state — overwriting it would fight
|
|
386
|
+
// the user's pointer.
|
|
387
|
+
const isUserInteracting =
|
|
388
|
+
this.#interaction.type !== "idle" && this.#interaction.action !== null;
|
|
389
|
+
if (state.value !== prev.value && !isUserInteracting) {
|
|
390
|
+
this.#restoreSelection(state.value);
|
|
391
|
+
// #restoreSelection already schedules a redraw
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
|
|
383
395
|
// Redraw if style props changed or dimensions changed
|
|
384
396
|
if (
|
|
385
397
|
needsRedraw ||
|
|
@@ -576,6 +588,10 @@ export class MatplotlibRenderer {
|
|
|
576
588
|
|
|
577
589
|
#restoreSelection = (value: SelectionValue): void => {
|
|
578
590
|
if (!value || !("has_selection" in value) || !value.has_selection) {
|
|
591
|
+
if (this.#interaction.type !== "idle") {
|
|
592
|
+
this.#interaction = { type: "idle" };
|
|
593
|
+
this.#scheduleRedraw();
|
|
594
|
+
}
|
|
579
595
|
return;
|
|
580
596
|
}
|
|
581
597
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as ze}from"./chunk-LvLJmgfZ.js";import{d as $,l as ct,p as ht,u as me}from"./useEvent-D91BmmQi.js";import{t as mt}from"./react-Bj1aDYRI.js";import{E as Me,En as pt,Jt as ut,Rr as ft,Ti as pe,Tn as xt,_ as yt,cr as kt,ct as We,h as _e,kn as bt,ot as wt,pr as jt,st as gt,t as vt,ur as Ct,vr as zt,wn as Mt}from"./cells-CN4JOik9.js";import{t as N}from"./compiler-runtime-B3qBwwSJ.js";import{n as Wt,x as _t}from"./ai-model-dropdown-fWWswEFq.js";import{_ as H,d as Ne}from"./useEventListener-BnjleyM2.js";import{y as Nt}from"./utils-CmtLzRmR.js";import{n as L,t as Se}from"./constants-DWFgp1e4.js";import{S as ue,h as St,n as Dt,o as At,x as Pt}from"./config-CkVlfvRx.js";import{n as It}from"./switch-JUwRcs7x.js";import{t as Et}from"./jsx-runtime-BO1WBD9_.js";import{o as Lt}from"./alert-dialog-TGjcoGIT.js";import{a as Tt,c as fe,o as xe,s as Rt}from"./popover-DI3qDiGn.js";import{a as $t,c as Ht,i as qt,n as Bt,r as Ot,s as Ut,t as Vt}from"./select-Bnp2y4XD.js";import{gt as Ft}from"./JsonOutput-BquC7Hx9.js";import{c as De,d as ye,n as Yt,o as Kt,r as ke,t as Gt}from"./download-CH6PUCSY.js";import{m as Jt}from"./form-BGmIf9Es.js";import{t as Ae}from"./tooltip-vbfMvhVs.js";import{r as Pe,t as q}from"./button-C5UWwVi3.js";import{i as Zt,r as Qt,t as Ie}from"./strings-BeVXmi0D.js";import{r as B}from"./requests-eZGK4-3l.js";import{t as b}from"./createLucideIcon-DoRarqC9.js";import{A as Ee,a as Le,i as Te,j as Xt,k as ea,u as Re}from"./layout-DKYga6K1.js";import{t as be}from"./check-smVHZnuZ.js";import{n as ta}from"./maps-BeNfViz9.js";import{r as aa}from"./useCellActionButton-Vec15a70.js";import{t as $e}from"./copy-Da2RgYqb.js";import{t as oa}from"./eye-off-B0Trbt-B.js";import{t as ae}from"./file-D43aig5H.js";import{t as na}from"./github-DXdCB4uA.js";import{n as sa,r as la,t as ia}from"./youtube-BaPTbToy.js";import{i as ra,n as He}from"./add-connection-dialog-BLVsSASB.js";import{n as da,t as ca}from"./square-Dz8AXD-D.js";import{t as ha}from"./image-uxsBjzpQ.js";import{t as ma}from"./link-nUeo3sOu.js";import{r as pa}from"./input-p1wVgVWX.js";import{t as ua}from"./settings-xPFfv9iY.js";import{t as fa}from"./sparkles-ChCaORbA.js";import{y as xa}from"./textarea-fSjjU253.js";import{t as S}from"./use-toast-DZOInYtM.js";import{n as qe,t as ya}from"./paths-DPsNG1C-.js";import{o as ka}from"./session-DfoGrBjA.js";import{n as O}from"./copy-7r5HfDlA.js";import{r as ba}from"./useRunCells-erCNrS6-.js";import{a as Be,c as Oe,i as Ue,n as Ve,r as Fe}from"./dialog-llZHWFat.js";import{n as we}from"./ImperativeModal-CGCXLZNQ.js";import{r as wa,t as ja}from"./share-qhWUqocS.js";import{a as ga}from"./cell-link-CySPtY7P.js";import{a as va}from"./renderShortcut-xBUAOVxJ.js";import{t as Ca}from"./icons-CXtFyW1a.js";import{n as za}from"./marimo-icons-j39WcG7Q.js";import{t as Ma}from"./links-BIGPU8xf.js";import{r as Wa,t as Ye}from"./hooks-DMOBb9Q_.js";import{t as Ke}from"./types-D8yP89N6.js";var _a=b("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),Na=b("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ge=b("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"}]]),Je=b("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"}]]),Ze=b("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"}]]),Sa=b("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"}]]),Da=b("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"}]]),Aa=b("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Qe=b("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),Pa=b("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"}]]),Ia=b("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"}]]),Ea=b("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Xe=b("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"}]]),La=b("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"}]]),Ta=b("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"}]]),et=b("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"}]]),je=N(),D=ze(mt(),1),a=ze(Et(),1);function Ra(){return"uvx marimo@latest"}function $a(t,e,n){let o=n?" --with-token":"",s=`${Ra()} pair prompt --url '${e}'${o}`;switch(t){case"claude":return`claude "$(${s} --claude)"`;case"codex":return`codex "$(${s} --codex)"`;case"opencode":return`opencode "$(${s} --opencode)"`;default:Qt(t)}}function Ha(t){return t.length<=4?"****":`${"*".repeat(Math.min(t.length-4,8))}${t.slice(-4)}`}var qa="npx skills add marimo-team/marimo-pair";function Ba(){let t=(0,je.c)(2),[e,n]=(0,D.useState)(null),o,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{fetch(Dt("/auth/token").href,{headers:It.headers()}).then(Oa).then(r=>n((r==null?void 0:r.token)??null)).catch(()=>n(null))},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,D.useEffect)(o,s),e}function Oa(t){return t.ok?t.json():null}const Ua=t=>{let e=(0,je.c)(32),{onClose:n}=t,[o,s]=(0,D.useState)("claude"),r=At(),i=Ba(),l=!!i,d;e[0]!==o||e[1]!==l||e[2]!==r.httpURL?(d=$a(o,r.httpURL.toString(),l),e[0]=o,e[1]=l,e[2]=r.httpURL,e[3]=d):d=e[3];let c=d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(Oe,{children:"Pair with an agent"}),e[4]=m):m=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(Be,{children:[m,(0,a.jsxs)(Fe,{children:["Use an AI coding agent to pair-program on this notebook."," ",(0,a.jsx)("a",{href:"https://links.marimo.app/marimo-pair",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Learn more"}),"."]})]}),e[5]=p):p=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"1. Install the skill"}),(0,a.jsx)(U,{command:qa})]}),e[6]=h):h=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)("span",{className:"text-sm font-medium",children:"2. Run in your terminal"}),e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=_=>s(_),e[8]=x):x=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Rt,{className:"w-full",children:[(0,a.jsx)(fe,{value:"claude",className:"flex-1",children:"Claude"}),(0,a.jsx)(fe,{value:"codex",className:"flex-1",children:"Codex"}),(0,a.jsx)(fe,{value:"opencode",className:"flex-1",children:"OpenCode"})]}),e[9]=w):w=e[9];let y;e[10]===c?y=e[11]:(y=(0,a.jsx)(xe,{value:"claude",className:"mt-3",children:(0,a.jsx)(U,{command:c})}),e[10]=c,e[11]=y);let k;e[12]===c?k=e[13]:(k=(0,a.jsx)(xe,{value:"codex",className:"mt-3",children:(0,a.jsx)(U,{command:c})}),e[12]=c,e[13]=k);let j;e[14]===c?j=e[15]:(j=(0,a.jsx)(xe,{value:"opencode",className:"mt-3",children:(0,a.jsx)(U,{command:c})}),e[14]=c,e[15]=j);let g;e[16]!==o||e[17]!==j||e[18]!==y||e[19]!==k?(g=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[u,(0,a.jsxs)(Tt,{value:o,onValueChange:x,children:[w,y,k,j]})]}),e[16]=o,e[17]=j,e[18]=y,e[19]=k,e[20]=g):g=e[20];let z;e[21]!==i||e[22]!==l?(z=l&&i&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"3. Paste when prompted for token"}),(0,a.jsx)(U,{command:i,display:Ha(i)})]}),e[21]=i,e[22]=l,e[23]=z):z=e[23];let v;e[24]!==g||e[25]!==z?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[h,g,z]}),e[24]=g,e[25]=z,e[26]=v):v=e[26];let M;e[27]===n?M=e[28]:(M=(0,a.jsx)(Ue,{children:(0,a.jsx)(q,{variant:"secondary",onClick:n,children:"Close"})}),e[27]=n,e[28]=M);let W;return e[29]!==v||e[30]!==M?(W=(0,a.jsxs)(Ve,{className:"sm:max-w-lg",children:[p,v,M]}),e[29]=v,e[30]=M,e[31]=W):W=e[31],W};var U=t=>{let e=(0,je.c)(15),{command:n,display:o}=t,[s,r]=(0,D.useState)(!1),i;e[0]===n?i=e[1]:(i=Pe.stopPropagation(async x=>{x.preventDefault(),await O(n),r(!0),setTimeout(()=>r(!1),2e3)}),e[0]=n,e[1]=i);let l=i,d=o??n,c;e[2]===d?c=e[3]:(c=(0,a.jsx)("code",{className:"flex-1 select-all break-words",children:d}),e[2]=d,e[3]=c);let m;e[4]===s?m=e[5]:(m=s?(0,a.jsx)(be,{size:14,strokeWidth:1.5}):(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[4]=s,e[5]=m);let p;e[6]!==l||e[7]!==m?(p=(0,a.jsx)(q,{onClick:l,size:"xs",variant:"ghost",children:m}),e[6]=l,e[7]=m,e[8]=p):p=e[8];let h;e[9]!==s||e[10]!==p?(h=(0,a.jsx)(Ae,{content:"Copied!",open:s,children:p}),e[9]=s,e[10]=p,e[11]=h):h=e[11];let u;return e[12]!==c||e[13]!==h?(u=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-xs",children:[c,h]}),e[12]=c,e[13]=h,e[14]=u):u=e[14],u},tt=N(),oe="https://static.marimo.app";const Va=t=>{let e=(0,tt.c)(25),{onClose:n}=t,[o,s]=(0,D.useState)(""),{exportAsHTML:r}=B(),i=`${o}-${Math.random().toString(36).slice(2,6)}`,l=`${oe}/static/${i}`,d;e[0]!==r||e[1]!==n||e[2]!==i?(d=async g=>{g.preventDefault(),n();let z=await r({download:!1,includeCode:!0,files:ea.INSTANCE.filenames()}),v=S({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:z,path:i})}).catch(()=>{v.dismiss(),S({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:L.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),v.dismiss(),S({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},e[0]=r,e[1]=n,e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Oe,{children:"Share static notebook"}),e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsxs)(Be,{children:[c,(0,a.jsxs)(Fe,{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,a.jsx)("a",{href:oe,target:"_blank",children:oe}),"."]})]}),e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=g=>{s(g.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},e[6]=p):p=e[6];let h;e[7]===o?h=e[8]:(h=(0,a.jsx)(pa,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:p,required:!0,autoComplete:"off"}),e[7]=o,e[8]=h);let u;e[9]===l?u=e[10]:(u=(0,a.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,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Fa,{text:l}),(0,a.jsx)("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=u);let x;e[11]!==h||e[12]!==u?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[h,u]}),e[11]=h,e[12]=u,e[13]=x):x=e[13];let w;e[14]===n?w=e[15]:(w=(0,a.jsx)(q,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=w);let y;e[16]===l?y=e[17]:(y=(0,a.jsx)(q,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await O(l)},children:"Create"}),e[16]=l,e[17]=y);let k;e[18]!==w||e[19]!==y?(k=(0,a.jsxs)(Ue,{children:[w,y]}),e[18]=w,e[19]=y,e[20]=k):k=e[20];let j;return e[21]!==d||e[22]!==k||e[23]!==x?(j=(0,a.jsx)(Ve,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[m,x,k]})}),e[21]=d,e[22]=k,e[23]=x,e[24]=j):j=e[24],j};var Fa=t=>{let e=(0,tt.c)(8),[n,o]=D.useState(!1),s;e[0]===t.text?s=e[1]:(s=Pe.stopPropagation(async c=>{c.preventDefault(),await O(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=s);let r=s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2];let l;e[3]===r?l=e[4]:(l=(0,a.jsx)(q,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:i}),e[3]=r,e[4]=l);let d;return e[5]!==n||e[6]!==l?(d=(0,a.jsx)(Ae,{content:"Copied!",open:n,children:l}),e[5]=n,e[6]=l,e[7]=d):d=e[7],d},Ya=N();function Ka(){let t=document.getElementsByClassName(Se.outputArea);for(let e of t){let n=e.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=pe.findElement(e);if(!o){H.warn("Could not find HTMLCellId for visible output area",e);continue}return{cellId:pe.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Ga(t){if(!t){H.warn("No scroll anchor provided to restore scroll position");return}let e=document.getElementById(pe.create(t.cellId));if(!e){H.warn("Could not find cell element to restore scroll position",t.cellId);return}if(!e.querySelector(`.${Se.outputArea}`)){H.warn("Could not find output area to restore scroll position",t.cellId);return}e.scrollIntoView({block:"start",behavior:"auto"})}function at(){let t=(0,Ya.c)(2),e=$(We),n;return t[0]===e?n=t[1]:(n=()=>{let o=Ka();e(s=>({mode:gt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ga(o)})})},t[0]=e,t[1]=n),n}const ot=ht(!1);var Ja=N();const Za=()=>{let t=(0,Ja.c)(7),{selectedLayout:e}=Le(),{setLayoutView:n}=Te();if(ue()&&!bt("wasm_layouts"))return null;let o;t[0]===n?o=t[1]:(o=l=>n(l),t[0]=n,t[1]=o);let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Ut,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Ht,{placeholder:"Select a view"})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Bt,{children:(0,a.jsxs)(Ot,{children:[(0,a.jsx)($t,{children:"View as"}),Ke.map(Xa)]})}),t[3]=r):r=t[3];let i;return t[4]!==e||t[5]!==o?(i=(0,a.jsxs)(Vt,{"data-testid":"layout-select",value:e,onValueChange:o,children:[s,r]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function Qa(t){return(0,a.jsx)(nt(t),{className:"h-4 w-4"})}function nt(t){switch(t){case"vertical":return Pa;case"grid":return la;case"slides":return Xe;default:return Zt(t),ca}}function st(t){return Ie.startCase(t)}function Xa(t){return(0,a.jsx)(qt,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Qa(t),(0,a.jsx)("span",{children:st(t)})]})},t)}async function eo(t){let{filename:e,preset:n,downloadPDF:o}=t;await o({filename:e,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var to=N();function ao(t){let e=(0,to.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=B(),r;return e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==t?(r=()=>{if(!t)return null;let i=ya.guessDeliminator(t);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(t)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:l=>{let d=i.join(qe.dirname(t),l);s({source:t,destination:d}).then(()=>{o(),S({title:"Notebook copied",description:"A copy of the notebook has been created."}),Ma(d)})}})},e[0]=o,e[1]=n,e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const oo=()=>{let{updateCellConfig:t}=Me(),{saveCellConfig:e}=B();return(0,D.useCallback)(async()=>{let n=new ut,o=_e(),s=o.cellIds.inOrderIds,r={};for(let l of s){if(o.cellData[l]===void 0)continue;let{code:d,config:c}=o.cellData[l];c.hide_code||n.isSupported(d)&&(r[l]={hide_code:!0})}let i=Ne.entries(r);if(i.length!==0){await e({configs:r});for(let[l,d]of i)t({cellId:l,config:d})}},[t])};var no=N();function lt(){let t=(0,no.c)(4),{openConfirm:e}=we(),n=$(St),{sendRestart:o}=B(),s;return t[0]!==e||t[1]!==o||t[2]!==n?(s=()=>{e({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,a.jsx)(Lt,{onClick:async()=>{n({state:Pt.CLOSING}),await o(),wa()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}var so=N(),T=t=>{t==null||t.preventDefault(),t==null||t.stopPropagation()};function lo(){var ve,Ce;let t=(0,so.c)(51),e=ga(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=Mt(),{selectedPanel:r}=xt(),[i]=ct(We),l=me(wt),d=oo(),[c]=Nt(),{updateCellConfig:m,undoDeleteCell:p,clearAllCellOutputs:h,addSetupCellIfDoesntExist:u,collapseAllCells:x,expandAllCells:w}=Me(),y=lt(),k=ba(),j=ao(e),g=$(ot),z=$(Wt),v=$(_t),{exportAsIPYNB:M,exportAsMarkdown:W,readCode:_,saveCellConfig:se,updateCellOutputs:A}=B(),P=Wa(),le=me(yt),ie=me(vt),{selectedLayout:V}=Le(),{setLayoutView:re}=Te(),F=at(),Y=((ve=c.sharing)==null?void 0:ve.html)??!0,K=((Ce=c.sharing)==null?void 0:Ce.wasm)??!0,ge=!ue(),de=V==="slides",it=zo,rt=Co,G;t[0]!==e||t[1]!==P||t[2]!==A?(G=async f=>{let{preset:C,title:R}=f;if(!e){ne();return}await De(R,async he=>{await Ye({takeScreenshots:()=>P({progress:he}),updateCellOutputs:A}),await eo({filename:e,preset:C,downloadPDF:Yt})})},t[0]=e,t[1]=P,t[2]=A,t[3]=G):G=t[3];let I=G,J;t[4]===I?J=t[5]:(J=async()=>{if(ge){await I({preset:"document",title:"Downloading Document PDF..."});return}let f=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(f),setTimeout(vo,0),setTimeout(()=>window.dispatchEvent(C),0)},t[4]=I,t[5]=J);let Z=J,Q;t[6]!==M||t[7]!==e||t[8]!==P||t[9]!==A?(Q=async()=>{if(!e){ne();return}await De("Downloading IPYNB...",async f=>{await Ye({takeScreenshots:()=>P({progress:f}),updateCellOutputs:A});let C=await M({download:!1});ke(new Blob([C],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},t[6]=M,t[7]=e,t[8]=P,t[9]=A,t[10]=Q):Q=t[10];let ce=Q,X;t[11]===Symbol.for("react.memo_cache_sentinel")?(X=(0,a.jsx)(Ft,{size:14,strokeWidth:1.5}),t[11]=X):X=t[11];let ee;t[12]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),t[12]=ee):ee=t[12];let E;t[13]===e?E=t[14]:(E=async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!0})},t[13]=e,t[14]=E);let te;return t[15]!==u||t[16]!==ie||t[17]!==h||t[18]!==o||t[19]!==x||t[20]!==j||t[21]!==I||t[22]!==w||t[23]!==W||t[24]!==e||t[25]!==Z||t[26]!==ce||t[27]!==le||t[28]!==d||t[29]!==de||t[30]!==l||t[31]!==n||t[32]!==_||t[33]!==y||t[34]!==k||t[35]!==se||t[36]!==V||t[37]!==r||t[38]!==g||t[39]!==v||t[40]!==re||t[41]!==z||t[42]!==Y||t[43]!==K||t[44]!==E||t[45]!==s||t[46]!==F||t[47]!==p||t[48]!==m||t[49]!==i.mode?(te=[{icon:X,label:"Download",handle:T,dropdown:[{icon:ee,label:"Download as HTML",handle:E},{icon:(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!1})}},{icon:(0,a.jsx)(Ca,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let f=await W({download:!1});ke(new Blob([f],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ce},{icon:(0,a.jsx)(Xt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let f=await _();ke(new Blob([f.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:i.mode!=="present",tooltip:i.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",va("global.hideCode",!1)]}),handle:go},de?{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:T,dropdown:[{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Z},{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:rt(!0),hidden:!ge,handle:async()=>{await I({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Z}]},{icon:(0,a.jsx)(fa,{size:14,strokeWidth:1.5}),label:"Pair with an agent",handle:async()=>{n((0,a.jsx)(Ua,{onClose:o}))}},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Share",handle:T,hidden:!Y&&!K,dropdown:[{icon:(0,a.jsx)(Jt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!Y,handle:async()=>{n((0,a.jsx)(Va,{onClose:o}))}},{icon:(0,a.jsx)(ma,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!K,handle:async()=>{await O(ja({code:(await _()).contents})),S({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ea,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:T,dropdown:pt.flatMap(f=>{let{type:C,Icon:R,hidden:he,additionalKeywords:dt}=f;return he?[]:{label:Ie.startCase(C),rightElement:it(r===C),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),handle:()=>s(C),additionalKeywords:dt}})},{icon:(0,a.jsx)(Xe,{size:14,strokeWidth:1.5}),label:"Present as",handle:T,dropdown:[{icon:i.mode==="present"?(0,a.jsx)(xa,{size:14,strokeWidth:1.5}):(0,a.jsx)(Qe,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{F()}},...Ke.map((f,C)=>{let R=nt(f);return{divider:C===0,label:st(f),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:V===f&&(0,a.jsx)(be,{size:14})}),handle:()=>{re(f),i.mode==="edit"&&F()}}})]},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!e||ue(),handle:j},{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!e,handle:async()=>{await O((await _()).contents),S({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(aa,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!le||l,handle:async()=>{let f=ft(_e());await se({configs:Ne.fromEntries(f.map(jo))});for(let C of f)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Ze,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{u({})}},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(He,{onClose:o}))}},{icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(He,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(et,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ie||l,handle:()=>{p()}},{icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:y,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)(jt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{h()}},{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:x,redundant:!0},{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:w,redundant:!0},{divider:!0,icon:(0,a.jsx)(Je,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>g(wo)},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>v(bo)},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>z(ko),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Resources",handle:T,dropdown:[{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:yo},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"GitHub",handle:xo},{icon:(0,a.jsx)(sa,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:fo},{icon:(0,a.jsx)(ia,{size:14,strokeWidth:1.5}),label:"YouTube",handle:uo},{icon:(0,a.jsx)(kt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:po}]},{divider:!0,icon:(0,a.jsx)(da,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:mo},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:ho}].filter(co).map(io),t[15]=u,t[16]=ie,t[17]=h,t[18]=o,t[19]=x,t[20]=j,t[21]=I,t[22]=w,t[23]=W,t[24]=e,t[25]=Z,t[26]=ce,t[27]=le,t[28]=d,t[29]=de,t[30]=l,t[31]=n,t[32]=_,t[33]=y,t[34]=k,t[35]=se,t[36]=V,t[37]=r,t[38]=g,t[39]=v,t[40]=re,t[41]=z,t[42]=Y,t[43]=K,t[44]=E,t[45]=s,t[46]=F,t[47]=p,t[48]=m,t[49]=i.mode,t[50]=te):te=t[50],te}function io(t){return t.dropdown?{...t,dropdown:t.dropdown.filter(ro)}:t}function ro(t){return!t.hidden}function co(t){return!t.hidden}function ho(){let t=ka();window.open(t,"_blank")}function mo(){let t=document.baseURI.split("?")[0];window.open(t,"_self")}function po(){window.open(L.releasesPage,"_blank")}function uo(){window.open(L.youtube,"_blank")}function fo(){window.open(L.discordLink,"_blank")}function xo(){window.open(L.githubPage,"_blank")}function yo(){window.open(L.docsPage,"_blank")}function ko(t){return!t}function bo(t){return!t}function wo(t){return!t}function jo(t){return[t,{disabled:!1}]}async function go(){let t=document.getElementById("App");t&&await Kt({element:t,filename:document.title,prepare:Gt})}function vo(){return window.print()}function Co(t){return t?(0,a.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"}):null}function zo(t){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:t&&(0,a.jsx)(be,{size:14})})}function ne(){S({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{at as a,Ze as c,ot as i,Je as l,lt as n,et as o,Za as r,Qe as s,lo as t,Ge as u};
|