@marimo-team/frontend 0.23.3 → 0.23.4-dev1
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-BTL_sgUY.js → CellStatus-PIeZtHEl.js} +1 -1
- package/dist/assets/JsonOutput-BVAcY5xS.js +49 -0
- package/dist/assets/{MarimoErrorOutput-BBD405a6.js → MarimoErrorOutput-B9_RO5eX.js} +2 -2
- package/dist/assets/{RenderHTML-BT9obKLc.js → RenderHTML-DR6lqJGS.js} +1 -1
- package/dist/assets/{add-cell-with-ai-qEfAzC8R.js → add-cell-with-ai-DjfY8mF1.js} +9 -9
- package/dist/assets/{add-connection-dialog-HCShSlr3.js → add-connection-dialog-gd2yD9Qo.js} +2 -2
- package/dist/assets/{agent-panel-CoBHxHpJ.js → agent-panel-TetMUXWP.js} +3 -3
- package/dist/assets/{ai-model-dropdown-CYx9ZfdS.js → ai-model-dropdown-By4Ohb0R.js} +3 -3
- package/dist/assets/{app-config-button-DC5UlXZA.js → app-config-button-YS8lpoUa.js} +1 -1
- package/dist/assets/{cell-editor-BMjfXh0J.js → cell-editor-C6vZfKyj.js} +10 -10
- package/dist/assets/{cell-link-BA7Demf0.js → cell-link-d38hFEon.js} +1 -1
- package/dist/assets/{cells-CJlo_hG2.js → cells-A-ljPpuj.js} +55 -55
- package/dist/assets/{chat-display-DbztpRD4.js → chat-display-Be0U92hE.js} +1 -1
- package/dist/assets/{chat-panel-H-xFzATI.js → chat-panel-BEz970S3.js} +1 -1
- package/dist/assets/{chat-ui-CFqAy2ck.js → chat-ui-CdW7awFa.js} +1 -1
- package/dist/assets/{column-preview-DzN2QumC.js → column-preview-_5uYiy74.js} +1 -1
- package/dist/assets/{command-DbT_zkRP.js → command-CzIDL1VI.js} +1 -1
- package/dist/assets/{command-palette-DSSR50KF.js → command-palette-DfotChyr.js} +1 -1
- package/dist/assets/{common-CquNY-ok.js → common-DC9LEIym.js} +1 -1
- package/dist/assets/{components-BXKuiPiF.js → components-BDnRtsA5.js} +1 -1
- package/dist/assets/{components-BiBOcq1x.js → components-FepcpFGL.js} +1 -1
- package/dist/assets/{datasource-BKDU-4D5.js → datasource-BCnGIjqn.js} +2 -2
- package/dist/assets/{dependency-graph-panel-ayo-Mm2j.js → dependency-graph-panel-Yk1Ch_Gj.js} +1 -1
- package/dist/assets/{documentation-panel-ph6755dz.js → documentation-panel-BMrGuByB.js} +1 -1
- package/dist/assets/{download-mzsKQgiy.js → download-Iyng0xCz.js} +4 -4
- package/dist/assets/{edit-page-Bxa5DWoE.js → edit-page-C-LIP5uT.js} +6 -6
- package/dist/assets/{error-panel-BfG_JeMA.js → error-panel-CHSsnRFF.js} +1 -1
- package/dist/assets/{file-explorer-panel-D7-d0Puf.js → file-explorer-panel-Dlwspu2Y.js} +3 -3
- package/dist/assets/{file-icons-BNrh8MRG.js → file-icons-DTNZv05h.js} +1 -1
- package/dist/assets/{floating-outline-BMB4_phA.js → floating-outline-CSNGDMAm.js} +1 -1
- package/dist/assets/{focus-BX3gXJxx.js → focus-Baz7rlo0.js} +1 -1
- package/dist/assets/form-Dr-_EXr8.js +2 -0
- package/dist/assets/{home-page-B1ELDhn8.js → home-page-QvO22-4u.js} +1 -1
- package/dist/assets/{hooks-b3J1eFE-.js → hooks-CNPv5U-N.js} +1 -1
- package/dist/assets/{html-to-image-Cz8lDF-Y.js → html-to-image-tbPEMBJg.js} +1 -1
- package/dist/assets/{index-BjiE1T38.js → index-BFivsT-R.js} +8 -8
- package/dist/assets/index-DH5UUBE4.css +2 -0
- package/dist/assets/{kiosk-mode-Dxbs5i5g.js → kiosk-mode-cWTXpegb.js} +1 -1
- package/dist/assets/{layout-lxwMDUgI.js → layout-DDh3d8oW.js} +5 -5
- package/dist/assets/{logs-panel-BW6S5AI1.js → logs-panel-Dgkr6V7q.js} +1 -1
- package/dist/assets/{markdown-renderer-CeHY2KoQ.js → markdown-renderer-CFrgiLqu.js} +1 -1
- package/dist/assets/{name-cell-input-B1BCybeo.js → name-cell-input-C5LXTI3T.js} +1 -1
- package/dist/assets/{outline-panel-DgMz83Mx.js → outline-panel-0lyts6z4.js} +1 -1
- package/dist/assets/{packages-panel-CbjavFh2.js → packages-panel-BhI1lbfw.js} +1 -1
- package/dist/assets/{panels-BPzk3EbR.js → panels-CbRenLjk.js} +1 -1
- package/dist/assets/{process-output-CggRIZ6s.js → process-output-BwZ5VxXO.js} +1 -1
- package/dist/assets/{readonly-python-code-Ccd8HM-7.js → readonly-python-code-B0nrQE3U.js} +1 -1
- package/dist/assets/{reveal-component-BamXsTkr.js → reveal-component-CLjsFHmT.js} +1 -1
- package/dist/assets/{run-page-C5cZvltI.js → run-page-C1Wd8dr8.js} +1 -1
- package/dist/assets/{scratchpad-panel-PMFH4Ktp.js → scratchpad-panel-DpqODhZ3.js} +1 -1
- package/dist/assets/{session-panel-CUTSr9rt.js → session-panel-BvCIuxgU.js} +1 -1
- package/dist/assets/{slide-form-Bi8ZYBHP.js → slide-form-CXqvfwGg.js} +1 -1
- package/dist/assets/{snippets-panel-CdhDsAII.js → snippets-panel-COBTGJcr.js} +1 -1
- package/dist/assets/{state-C5AUgyZT.js → state-Bsz477is.js} +1 -1
- package/dist/assets/{state-DHlRrwyY.js → state-LyvUXW6A.js} +2 -2
- package/dist/assets/{textarea-BXPC1-kb.js → textarea-Dd0InTQJ.js} +1 -1
- package/dist/assets/{tracing-wSufGcF9.js → tracing-DjZGgWTo.js} +1 -1
- package/dist/assets/{tracing-panel-BO6MMAXa.js → tracing-panel-8eFzEjG0.js} +2 -2
- package/dist/assets/{useAddCell-CqBbGhrY.js → useAddCell-De9xD63_.js} +1 -1
- package/dist/assets/{useCellActionButton-DYwx4pGE.js → useCellActionButton-Bjxun3wK.js} +1 -1
- package/dist/assets/{useDeleteCell-BJlGbsbV.js → useDeleteCell-C2Stbb6Q.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-rkAIQ6zL.js → useDependencyPanelTab-DFZNQ3a8.js} +1 -1
- package/dist/assets/{useNotebookActions-Dga3qEHF.js → useNotebookActions-F5fGMe9N.js} +1 -1
- package/dist/assets/{useRunCells-B531RIUE.js → useRunCells-DU1tawR-.js} +1 -1
- package/dist/assets/{useSplitCell-BnuJW5uo.js → useSplitCell-BZPuhd8z.js} +1 -1
- package/dist/index.html +25 -25
- package/package.json +1 -1
- package/src/components/data-table/data-table.tsx +11 -2
- package/src/components/data-table/filter-by-values-picker.tsx +238 -0
- package/src/components/data-table/filter-pill-editor.tsx +470 -0
- package/src/components/data-table/filter-pills.tsx +177 -41
- package/src/components/ui/checkbox.tsx +8 -4
- package/src/components/ui/combobox.tsx +3 -0
- package/src/css/app/Cell.css +4 -0
- package/src/plugins/impl/DataTablePlugin.tsx +1 -0
- package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +15 -15
- package/src/utils/sets.ts +13 -0
- package/dist/assets/JsonOutput-DXnOS_Hk.js +0 -49
- package/dist/assets/form-CPDlIjdV.js +0 -2
- package/dist/assets/index-BYLYJcAY.css +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as q}from"./useEvent-D91BmmQi.js";import{In as W,b as G,wi as C}from"./cells-CJlo_hG2.js";import{_ as v}from"./useEventListener-BR0C1MaI.js";import{t as $}from"./requests-DIwGYs0l.js";function I({moduleName:e,variableName:t,onAddImport:r,appStore:n=q}){if(t in n.get(W))return!1;let{cellData:i,cellIds:o}=n.get(G),a=RegExp(`import[ ]+${e}[ ]+as[ ]+${t}`,"g");for(let l of o.inOrderIds)if(a.test(i[l].code))return!1;return r(`import ${e} as ${t}`),!0}function J({autoInstantiate:e,createNewCell:t,fromCellId:r,before:n}){let i=$(),o=null;return I({moduleName:"marimo",variableName:"mo",onAddImport:a=>{o=C.create(),t({cellId:r??"__end__",before:n??!1,code:a,lastCodeRun:e?a:void 0,newCellId:o,skipIfCodeExists:!0,autoFocus:!1}),e&&i.sendRun({cellIds:[o],codes:[a]})}})?o:null}function K({autoInstantiate:e,createNewCell:t,fromCellId:r}){let n=$(),i=null;return I({moduleName:"altair",variableName:"alt",onAddImport:o=>{i=C.create(),t({cellId:r??"__end__",before:!1,code:o,lastCodeRun:e?o:void 0,newCellId:i,skipIfCodeExists:!0,autoFocus:!1}),e&&n.sendRun({cellIds:[i],codes:[o]})}})?i:null}function X(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const Y=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function d(e){let t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}var m=null;function R(e={}){return m||(e.includeStyleProperties?(m=e.includeStyleProperties,m):(m=d(window.getComputedStyle(document.documentElement)),m))}function p(e,t){let r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Z(e){let t=p(e,"border-left-width"),r=p(e,"border-right-width");return e.clientWidth+t+r}function ee(e){let t=p(e,"border-top-width"),r=p(e,"border-bottom-width");return e.clientHeight+t+r}function k(e,t={}){return{width:t.width||Z(e),height:t.height||ee(e)}}function te(){let e,t;try{t=process}catch{}let r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var u=16384;function re(e){(e.width>u||e.height>u)&&(e.width>u&&e.height>u?e.width>e.height?(e.height*=u/e.width,e.width=u):(e.width*=u/e.height,e.height=u):e.width>u?(e.height*=u/e.width,e.width=u):(e.width*=u/e.height,e.height=u))}function w(e){return new Promise((t,r)=>{let n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function ne(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ie(e,t,r){let n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),o=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(e),ne(i)}const c=(e,t)=>{if(e instanceof t)return!0;let r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||c(r,t)};function oe(e){let t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ae(e,t){return R(t).map(r=>`${r}: ${e.getPropertyValue(r)}${e.getPropertyPriority(r)?" !important":""};`).join(" ")}function le(e,t,r,n){let i=`.${e}:${t}`,o=r.cssText?oe(r):ae(r,n);return document.createTextNode(`${i}{${o}}`)}function P(e,t,r,n){let i=window.getComputedStyle(e,r),o=i.getPropertyValue("content");if(o===""||o==="none")return;let a=Y();try{t.className=`${t.className} ${a}`}catch{return}let l=document.createElement("style");l.appendChild(le(a,r,i,n)),t.appendChild(l)}function se(e,t,r){P(e,t,":before",r),P(e,t,":after",r)}var N="application/font-woff",T="image/jpeg",ce={woff:N,woff2:N,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:T,jpeg:T,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ue(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function A(e){return ce[ue(e).toLowerCase()]||""}function de(e){return e.split(/,/)[1]}function x(e){return e.search(/^(data:)/)!==-1}function L(e,t){return`data:${t};base64,${e}`}async function F(e,t,r){let n=await fetch(e,t);if(n.status===404)throw Error(`Resource "${n.url}" not found`);let i=await n.blob();return new Promise((o,a)=>{let l=new FileReader;l.onerror=a,l.onloadend=()=>{try{o(r({res:n,result:l.result}))}catch(s){a(s)}},l.readAsDataURL(i)})}var E={};function fe(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function S(e,t,r){let n=fe(e,t,r.includeQueryParams);if(E[n]!=null)return E[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{i=L(await F(e,r.fetchRequestInit,({res:o,result:a})=>(t||(t=o.headers.get("Content-Type")||""),de(a))),t)}catch(o){i=r.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return E[n]=i,i}async function he(e){let t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):w(t)}async function ge(e,t){if(e.currentSrc){let n=document.createElement("canvas"),i=n.getContext("2d");return n.width=e.clientWidth,n.height=e.clientHeight,i==null||i.drawImage(e,0,0,n.width,n.height),w(n.toDataURL())}let r=e.poster;return w(await S(r,A(r),t))}async function me(e,t){var r;try{if((r=e==null?void 0:e.contentDocument)!=null&&r.body)return await y(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function pe(e,t){return c(e,HTMLCanvasElement)?he(e):c(e,HTMLVideoElement)?ge(e,t):c(e,HTMLIFrameElement)?me(e,t):e.cloneNode(H(e))}var we=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",H=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ye(e,t,r){var i;if(H(t))return t;let n=[];if(we(e)&&e.assignedNodes)n=d(e.assignedNodes());else if(c(e,HTMLIFrameElement))try{(i=e.contentDocument)!=null&&i.body&&(n=d(e.contentDocument.body.childNodes))}catch{}else n=d((e.shadowRoot??e).childNodes);return n.length===0||c(e,HTMLVideoElement)||await n.reduce((o,a)=>o.then(()=>y(a,r)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function be(e,t,r){let n=t.style;if(!n)return;let i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):R(r).forEach(o=>{let a=i.getPropertyValue(o);o==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),c(e,HTMLIFrameElement)&&o==="display"&&a==="inline"&&(a="block"),o==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),n.setProperty(o,a,i.getPropertyPriority(o))})}function Ae(e,t){c(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),c(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function xe(e,t){if(c(e,HTMLSelectElement)){let r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Ee(e,t,r){return c(t,Element)&&(be(e,t,r),se(e,t,r),Ae(e,t),xe(e,t)),t}async function Se(e,t){let r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;let n={};for(let o=0;o<r.length;o++){let a=r[o].getAttribute("xlink:href");if(a){let l=e.querySelector(a),s=document.querySelector(a);!l&&s&&!n[a]&&(n[a]=await y(s,t,!0))}}let i=Object.values(n);if(i.length){let o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";let l=document.createElementNS(o,"defs");a.appendChild(l);for(let s=0;s<i.length;s++)l.appendChild(i[s]);e.appendChild(a)}return e}async function y(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>pe(n,t)).then(n=>ye(e,n,t)).then(n=>Ee(e,n,t)).then(n=>Se(n,t))}var V=/url\((['"]?)([^'"]+?)\1\)/g,Ce=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ve=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function $e(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Ie(e){let t=[];return e.replace(V,(r,n,i)=>(t.push(i),r)),t.filter(r=>!x(r))}async function Re(e,t,r,n,i){try{let o=r?X(t,r):t,a=A(t),l;return l=i?L(await i(o),a):await S(o,a,n),e.replace($e(t),`$1${l}$3`)}catch{}return e}function ke(e,{preferredFontFormat:t}){return t?e.replace(ve,r=>{for(;;){let[n,,i]=Ce.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function D(e){return e.search(V)!==-1}async function M(e,t,r){if(!D(e))return e;let n=ke(e,r);return Ie(n).reduce((i,o)=>i.then(a=>Re(a,o,t,r)),Promise.resolve(n))}async function h(e,t,r){var i;let n=(i=t.style)==null?void 0:i.getPropertyValue(e);if(n){let o=await M(n,null,r);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function Pe(e,t){await h("background",e,t)||await h("background-image",e,t),await h("mask",e,t)||await h("-webkit-mask",e,t)||await h("mask-image",e,t)||await h("-webkit-mask-image",e,t)}async function Ne(e,t){let r=c(e,HTMLImageElement);if(!(r&&!x(e.src))&&!(c(e,SVGImageElement)&&!x(e.href.baseVal)))return;let n=r?e.src:e.href.baseVal,i=await S(n,A(n),t);await new Promise((o,a)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...s)=>{try{o(t.onImageErrorHandler(...s))}catch(f){a(f)}}:a;let l=e;l.decode&&(l.decode=o),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Te(e,t){let r=d(e.childNodes).map(n=>j(n,t));await Promise.all(r).then(()=>e)}async function j(e,t){c(e,Element)&&(await Pe(e,t),await Ne(e,t),await Te(e,t))}function Le(e,t){let{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);let n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}var O={};async function U(e){let t=O[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},O[e]=t,t)}async function _(e,t){let r=e.cssText,n=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async o=>{let a=o.replace(n,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),F(a,t.fetchRequestInit,({result:l})=>(r=r.replace(o,`url(${l})`),[o,l]))});return Promise.all(i).then(()=>r)}function z(e){if(e==null)return[];let t=[],r=e.replace(/(\/\*[\s\S]*?\*\/)/gi,""),n=RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let a=n.exec(r);if(a===null)break;t.push(a[0])}r=r.replace(n,"");let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let a=i.exec(r);if(a===null){if(a=o.exec(r),a===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(a[0])}return t}async function Fe(e,t){let r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{d(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let l=a+1,s=o.href,f=U(s).then(g=>_(g,t)).then(g=>z(g).forEach(b=>{try{i.insertRule(b,b.startsWith("@import")?l+=1:i.cssRules.length)}catch(B){console.error("Error inserting rule from remote css",{rule:b,error:B})}})).catch(g=>{console.error("Error loading remote css",g.toString())});n.push(f)}})}catch(o){let a=e.find(l=>l.href==null)||document.styleSheets[0];i.href!=null&&n.push(U(i.href).then(l=>_(l,t)).then(l=>z(l).forEach(s=>{a.insertRule(s,a.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",o)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{d(i.cssRules||[]).forEach(o=>{r.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),r))}function He(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>D(t.style.getPropertyValue("src")))}async function Ve(e,t){if(e.ownerDocument==null)throw Error("Provided element is not within a Document");return He(await Fe(d(e.ownerDocument.styleSheets),t))}function Q(e){return(e||"").trim().replace(/["']/g,"")}function De(e){let t=new Set;function r(n){let i=n.style.fontFamily||getComputedStyle(n).fontFamily;i&&i.split(",").forEach(o=>{t.add(Q(o))}),Array.from(n.children).forEach(o=>{o instanceof HTMLElement&&r(o)})}return r(e),t}async function Me(e,t){let r=await Ve(e,t),n=De(e);return(await Promise.all(r.filter(i=>n.has(Q(i.style.fontFamily))).map(i=>{let o=i.parentStyleSheet?i.parentStyleSheet.href:null;return M(i.cssText,o,t)}))).join(`
|
|
1
|
+
import{i as q}from"./useEvent-D91BmmQi.js";import{In as W,Ti as C,b as G}from"./cells-A-ljPpuj.js";import{_ as v}from"./useEventListener-BR0C1MaI.js";import{t as $}from"./requests-DIwGYs0l.js";function I({moduleName:e,variableName:t,onAddImport:r,appStore:n=q}){if(t in n.get(W))return!1;let{cellData:i,cellIds:o}=n.get(G),a=RegExp(`import[ ]+${e}[ ]+as[ ]+${t}`,"g");for(let l of o.inOrderIds)if(a.test(i[l].code))return!1;return r(`import ${e} as ${t}`),!0}function J({autoInstantiate:e,createNewCell:t,fromCellId:r,before:n}){let i=$(),o=null;return I({moduleName:"marimo",variableName:"mo",onAddImport:a=>{o=C.create(),t({cellId:r??"__end__",before:n??!1,code:a,lastCodeRun:e?a:void 0,newCellId:o,skipIfCodeExists:!0,autoFocus:!1}),e&&i.sendRun({cellIds:[o],codes:[a]})}})?o:null}function K({autoInstantiate:e,createNewCell:t,fromCellId:r}){let n=$(),i=null;return I({moduleName:"altair",variableName:"alt",onAddImport:o=>{i=C.create(),t({cellId:r??"__end__",before:!1,code:o,lastCodeRun:e?o:void 0,newCellId:i,skipIfCodeExists:!0,autoFocus:!1}),e&&n.sendRun({cellIds:[i],codes:[o]})}})?i:null}function X(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const Y=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function d(e){let t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}var m=null;function R(e={}){return m||(e.includeStyleProperties?(m=e.includeStyleProperties,m):(m=d(window.getComputedStyle(document.documentElement)),m))}function p(e,t){let r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Z(e){let t=p(e,"border-left-width"),r=p(e,"border-right-width");return e.clientWidth+t+r}function ee(e){let t=p(e,"border-top-width"),r=p(e,"border-bottom-width");return e.clientHeight+t+r}function k(e,t={}){return{width:t.width||Z(e),height:t.height||ee(e)}}function te(){let e,t;try{t=process}catch{}let r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var u=16384;function re(e){(e.width>u||e.height>u)&&(e.width>u&&e.height>u?e.width>e.height?(e.height*=u/e.width,e.width=u):(e.width*=u/e.height,e.height=u):e.width>u?(e.height*=u/e.width,e.width=u):(e.width*=u/e.height,e.height=u))}function w(e){return new Promise((t,r)=>{let n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function ne(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ie(e,t,r){let n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),o=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(e),ne(i)}const c=(e,t)=>{if(e instanceof t)return!0;let r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||c(r,t)};function oe(e){let t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ae(e,t){return R(t).map(r=>`${r}: ${e.getPropertyValue(r)}${e.getPropertyPriority(r)?" !important":""};`).join(" ")}function le(e,t,r,n){let i=`.${e}:${t}`,o=r.cssText?oe(r):ae(r,n);return document.createTextNode(`${i}{${o}}`)}function P(e,t,r,n){let i=window.getComputedStyle(e,r),o=i.getPropertyValue("content");if(o===""||o==="none")return;let a=Y();try{t.className=`${t.className} ${a}`}catch{return}let l=document.createElement("style");l.appendChild(le(a,r,i,n)),t.appendChild(l)}function se(e,t,r){P(e,t,":before",r),P(e,t,":after",r)}var N="application/font-woff",T="image/jpeg",ce={woff:N,woff2:N,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:T,jpeg:T,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ue(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function A(e){return ce[ue(e).toLowerCase()]||""}function de(e){return e.split(/,/)[1]}function x(e){return e.search(/^(data:)/)!==-1}function L(e,t){return`data:${t};base64,${e}`}async function F(e,t,r){let n=await fetch(e,t);if(n.status===404)throw Error(`Resource "${n.url}" not found`);let i=await n.blob();return new Promise((o,a)=>{let l=new FileReader;l.onerror=a,l.onloadend=()=>{try{o(r({res:n,result:l.result}))}catch(s){a(s)}},l.readAsDataURL(i)})}var E={};function fe(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function S(e,t,r){let n=fe(e,t,r.includeQueryParams);if(E[n]!=null)return E[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{i=L(await F(e,r.fetchRequestInit,({res:o,result:a})=>(t||(t=o.headers.get("Content-Type")||""),de(a))),t)}catch(o){i=r.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return E[n]=i,i}async function he(e){let t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):w(t)}async function ge(e,t){if(e.currentSrc){let n=document.createElement("canvas"),i=n.getContext("2d");return n.width=e.clientWidth,n.height=e.clientHeight,i==null||i.drawImage(e,0,0,n.width,n.height),w(n.toDataURL())}let r=e.poster;return w(await S(r,A(r),t))}async function me(e,t){var r;try{if((r=e==null?void 0:e.contentDocument)!=null&&r.body)return await y(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function pe(e,t){return c(e,HTMLCanvasElement)?he(e):c(e,HTMLVideoElement)?ge(e,t):c(e,HTMLIFrameElement)?me(e,t):e.cloneNode(H(e))}var we=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",H=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ye(e,t,r){var i;if(H(t))return t;let n=[];if(we(e)&&e.assignedNodes)n=d(e.assignedNodes());else if(c(e,HTMLIFrameElement))try{(i=e.contentDocument)!=null&&i.body&&(n=d(e.contentDocument.body.childNodes))}catch{}else n=d((e.shadowRoot??e).childNodes);return n.length===0||c(e,HTMLVideoElement)||await n.reduce((o,a)=>o.then(()=>y(a,r)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function be(e,t,r){let n=t.style;if(!n)return;let i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):R(r).forEach(o=>{let a=i.getPropertyValue(o);o==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),c(e,HTMLIFrameElement)&&o==="display"&&a==="inline"&&(a="block"),o==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),n.setProperty(o,a,i.getPropertyPriority(o))})}function Ae(e,t){c(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),c(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function xe(e,t){if(c(e,HTMLSelectElement)){let r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Ee(e,t,r){return c(t,Element)&&(be(e,t,r),se(e,t,r),Ae(e,t),xe(e,t)),t}async function Se(e,t){let r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;let n={};for(let o=0;o<r.length;o++){let a=r[o].getAttribute("xlink:href");if(a){let l=e.querySelector(a),s=document.querySelector(a);!l&&s&&!n[a]&&(n[a]=await y(s,t,!0))}}let i=Object.values(n);if(i.length){let o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";let l=document.createElementNS(o,"defs");a.appendChild(l);for(let s=0;s<i.length;s++)l.appendChild(i[s]);e.appendChild(a)}return e}async function y(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>pe(n,t)).then(n=>ye(e,n,t)).then(n=>Ee(e,n,t)).then(n=>Se(n,t))}var V=/url\((['"]?)([^'"]+?)\1\)/g,Ce=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ve=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function $e(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Ie(e){let t=[];return e.replace(V,(r,n,i)=>(t.push(i),r)),t.filter(r=>!x(r))}async function Re(e,t,r,n,i){try{let o=r?X(t,r):t,a=A(t),l;return l=i?L(await i(o),a):await S(o,a,n),e.replace($e(t),`$1${l}$3`)}catch{}return e}function ke(e,{preferredFontFormat:t}){return t?e.replace(ve,r=>{for(;;){let[n,,i]=Ce.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function D(e){return e.search(V)!==-1}async function M(e,t,r){if(!D(e))return e;let n=ke(e,r);return Ie(n).reduce((i,o)=>i.then(a=>Re(a,o,t,r)),Promise.resolve(n))}async function h(e,t,r){var i;let n=(i=t.style)==null?void 0:i.getPropertyValue(e);if(n){let o=await M(n,null,r);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function Pe(e,t){await h("background",e,t)||await h("background-image",e,t),await h("mask",e,t)||await h("-webkit-mask",e,t)||await h("mask-image",e,t)||await h("-webkit-mask-image",e,t)}async function Ne(e,t){let r=c(e,HTMLImageElement);if(!(r&&!x(e.src))&&!(c(e,SVGImageElement)&&!x(e.href.baseVal)))return;let n=r?e.src:e.href.baseVal,i=await S(n,A(n),t);await new Promise((o,a)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...s)=>{try{o(t.onImageErrorHandler(...s))}catch(f){a(f)}}:a;let l=e;l.decode&&(l.decode=o),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Te(e,t){let r=d(e.childNodes).map(n=>j(n,t));await Promise.all(r).then(()=>e)}async function j(e,t){c(e,Element)&&(await Pe(e,t),await Ne(e,t),await Te(e,t))}function Le(e,t){let{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);let n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}var O={};async function U(e){let t=O[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},O[e]=t,t)}async function _(e,t){let r=e.cssText,n=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async o=>{let a=o.replace(n,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),F(a,t.fetchRequestInit,({result:l})=>(r=r.replace(o,`url(${l})`),[o,l]))});return Promise.all(i).then(()=>r)}function z(e){if(e==null)return[];let t=[],r=e.replace(/(\/\*[\s\S]*?\*\/)/gi,""),n=RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let a=n.exec(r);if(a===null)break;t.push(a[0])}r=r.replace(n,"");let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let a=i.exec(r);if(a===null){if(a=o.exec(r),a===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(a[0])}return t}async function Fe(e,t){let r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{d(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let l=a+1,s=o.href,f=U(s).then(g=>_(g,t)).then(g=>z(g).forEach(b=>{try{i.insertRule(b,b.startsWith("@import")?l+=1:i.cssRules.length)}catch(B){console.error("Error inserting rule from remote css",{rule:b,error:B})}})).catch(g=>{console.error("Error loading remote css",g.toString())});n.push(f)}})}catch(o){let a=e.find(l=>l.href==null)||document.styleSheets[0];i.href!=null&&n.push(U(i.href).then(l=>_(l,t)).then(l=>z(l).forEach(s=>{a.insertRule(s,a.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",o)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{d(i.cssRules||[]).forEach(o=>{r.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),r))}function He(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>D(t.style.getPropertyValue("src")))}async function Ve(e,t){if(e.ownerDocument==null)throw Error("Provided element is not within a Document");return He(await Fe(d(e.ownerDocument.styleSheets),t))}function Q(e){return(e||"").trim().replace(/["']/g,"")}function De(e){let t=new Set;function r(n){let i=n.style.fontFamily||getComputedStyle(n).fontFamily;i&&i.split(",").forEach(o=>{t.add(Q(o))}),Array.from(n.children).forEach(o=>{o instanceof HTMLElement&&r(o)})}return r(e),t}async function Me(e,t){let r=await Ve(e,t),n=De(e);return(await Promise.all(r.filter(i=>n.has(Q(i.style.fontFamily))).map(i=>{let o=i.parentStyleSheet?i.parentStyleSheet.href:null;return M(i.cssText,o,t)}))).join(`
|
|
2
2
|
`)}async function je(e,t){let r=t.fontEmbedCSS==null?t.skipFonts?null:await Me(e,t):t.fontEmbedCSS,n=t.extraStyleContent==null?r:(r||"").concat(t.extraStyleContent);if(n){let i=document.createElement("style"),o=document.createTextNode(n);i.appendChild(o),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function Oe(e,t={}){let{width:r,height:n}=k(e,t),i=await y(e,t,!0);return await je(i,t),await j(i,t),Le(i,t),await ie(i,r,n)}async function Ue(e,t={}){let{width:r,height:n}=k(e,t),i=await w(await Oe(e,t)),o=document.createElement("canvas"),a=o.getContext("2d"),l=t.pixelRatio||te(),s=t.canvasWidth||r,f=t.canvasHeight||n;return o.width=s*l,o.height=f*l,t.skipAutoScale||re(o),o.style.width=`${s}`,o.style.height=`${f}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,o.width,o.height)),a.drawImage(i,0,0,o.width,o.height),o}async function _e(e,t={}){return(await Ue(e,t)).toDataURL()}const ze={filter:e=>{try{if("classList"in e){let t=e.classList;if(t.contains("mpl-toolbar")||t.contains("print:hidden"))return!1}return!0}catch(t){return v.error("Error filtering node:",t),!0}},imagePlaceholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQI12NgAAIABQABNjN9GQAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAA0lEQVQI12P4z8BQDwAEgAF/QualIQAAAABJRU5ErkJggg==",onImageErrorHandler:e=>{v.error("Error loading image:",e)},includeStyleProperties:"width.height.min-width.min-height.max-width.max-height.box-sizing.aspect-ratio.display.position.top.left.bottom.right.z-index.float.clear.flex.flex-direction.flex-wrap.flex-grow.flex-shrink.flex-basis.align-items.align-self.justify-content.gap.order.grid-template-columns.grid-template-rows.grid-column.grid-row.row-gap.column-gap.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.font.font-family.font-size.font-weight.font-style.line-height.letter-spacing.word-spacing.text-align.text-decoration.text-transform.text-indent.text-shadow.white-space.text-wrap.word-break.text-overflow.vertical-align.color.background.background-color.background-image.background-size.background-position.background-repeat.background-clip.border.border-width.border-style.border-color.border-top.border-right.border-bottom.border-left.border-radius.outline.box-shadow.text-shadow.opacity.filter.backdrop-filter.mix-blend-mode.transform.clip-path.overflow.overflow-x.overflow-y.visibility.fill.stroke.stroke-width.object-fit.object-position.list-style.list-style-type.border-collapse.border-spacing.content.cursor".split(".")};async function Qe(e,t){return _e(e,{...ze,...t})}export{K as n,J as r,Qe as t};
|