@marimo-team/frontend 0.24.1-dev48 → 0.24.1-dev49
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/command-palette-DkGgAhyM.js +1 -0
- package/dist/assets/{edit-page-DxMQN491.js → edit-page-Bpqbjwkb.js} +3 -3
- package/dist/assets/{index-DUJeB0WY.js → index-CRLe8Sox.js} +2 -2
- package/dist/assets/{useNotebookActions-ClT4GmnB.js → useNotebookActions-DpphIKt5.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/components/editor/actions/types.ts +1 -2
- package/src/components/editor/actions/useNotebookActions.tsx +1 -0
- package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +41 -32
- package/dist/assets/command-palette-DtZy0Am-.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./home-page-Chy6SA41.js","./rolldown-runtime-B0Z9INg1.js","./useEvent-xfs0Sn4r.js","./react-CBDbhulC.js","./compiler-runtime-CYIjoINj.js","./cells-B1S_6FG3.js","./react-dom-BQrReHnR.js","./schemas-aTUejmFi.js","./debounce-aFmHgJZY.js","./isObject-BCaOs5rp.js","./now-Cmx0b_zA.js","./isSymbol-oX0TOjjx.js","./useEventListener-D27Dii_l.js","./objects-snlMn4yk.js","./jsx-runtime-B74pBk57.js","./invariant-Ci2dTZ72.js","./utils-R_pHe-RB.js","./merge-DxlVKwwO.js","./isArrayLikeObject-DnwgSs_Z.js","./_initCloneObject-CM3WilQg.js","./config-CUBl5qBg.js","./constants-BDbGiS7O.js","./Deferred-CrTnjj37.js","./session-CEdta5_Q.js","./cn-ldLVeaqm.js","./clsx-DB0hHKMi.js","./fullscreen-0EEPR7uc.js","./dist-BgL43w5r.js","./menu-items-BSVrMleU.js","./alert-dialog-DBoy-FMx.js","./button-BMBznEru.js","./select-BUEX2Vfl.js","./check-BoA6XBpj.js","./createLucideIcon-B7HeEoG2.js","./useNumberFormatter-DHJ9s6Vk.js","./context-Do8M9TDF.js","./circle--ysFeW9z.js","./tooltip-D7dq6bnc.js","./dist-PIe1xcZo.js","./dist-CbQrIaPV.js","./arrays-BqUx5USx.js","./once-Haz_uxEL.js","./capabilities-LWzb3E3M.js","./cjs-C49f7GXV.js","./createReducer-Bq-nQJiK.js","./dist-Dz_04liz.js","./useNonce-BTM6-ANi.js","./strings-CpYReX2Q.js","./requests-C6_IaFh7.js","./dist-B97dKQGP.js","./useLifecycle-BUaJcygz.js","./toDate-hGYJX0Ha.js","./database-zap-CloO6gbw.js","./write-secret-modal-BG_B6y1P.js","./input-DeyycFtq.js","./numbers-DKurV_vq.js","./useDebounce-Dulm61-t.js","./uuid-k9DpjH68.js","./use-toast-DpWHUGuF.js","./plus-C4J9gIE1.js","./trash-2-D_HX-0qx.js","./badge-D_-uqy2N.js","./preload-helper-HclGiUj8.js","./dist-DCc0VfiO.js","./dist-7qdHLg-L.js","./dist-BO5c5n_b.js","./dist-CO1Hfv5H.js","./dist-DzAWvPVK.js","./stex-Dc5bKD4z.js","./paths-zcL04qUW.js","./useTheme-BRnykVDX.js","./useAsyncData-Buhk-UgR.js","./purify.es-DrVcFY1Q.js","./cells-D-c15Ks-.css","./ErrorBoundary-TUuUdxHz.js","./dropdown-menu-CqNabM1f.js","./chevron-right-CKA5zVsM.js","./chart-no-axes-column-ChZdjJhj.js","./tree-actions-CrWpuExP.js","./eye-off-CFuPxa9F.js","./refresh-cw-Bf-rx_aV.js","./circle-play-CQiat61_.js","./external-link-Bp3BxyRA.js","./file-icons-Bo1Ewf1W.js","./file-headphone-rFCxFRI8.js","./file-DF8n85RA.js","./image-ab13yGv4.js","./youtube-DCJ-ihUU.js","./link-Cap-MZiw.js","./spinner-Ck-Hgfvj.js","./package-DPlscLzt.js","./file-name-input-BeYyD2dj.js","./tabs-c6mpccpH.js","./copy-BMXKNElG.js","./errors-DzO-nXy-.js","./extends-CvVTau-c.js","./pathUtils-Cryrlpma.js","./semaphore-BjoL5P0h.js","./app-config-button-COFLeJCU.js","./ai-model-dropdown-DjQy2bo-.js","./get-DjNf4SIX.js","./has-sKqQhP6r.js","./_hasPath-BmRQipI0.js","./switch-CBR-ykv3.js","./config-DcB2swfZ.js","./triangle-alert-MihykDYG.js","./VisuallyHidden-DurJ_JBW.js","./SelectionIndicator-DPl6HPLh.js","./copy-Cg05mM3C.js","./kbd-Cwh96ZBE.js","./alert-dmKwNsrp.js","./error-banner-B3KYUlCX.js","./table-DmqOOjfe.js","./renderShortcut-D9XYVNe3.js","./azure-Dcn397wY.js","./card-dYXwy2mo.js","./settings-C-cYas75.js","./Inputs-E85rt2lh.js","./Inputs-C4Oo7q-H.css","./dates-DK5JikJo.js","./en-US-yTIMUO13.js","./isValid-nQ3Iam8J.js","./react-icons.esm-hr79-MCS.js","./icons-CjLa9BiH.js","./github-YRgb6LMu.js","./marimo-icons-C3KxMV9A.js","./links-DPh7yoP-.js","./useInterval-B1_J4wdT.js","./run-page-DXZapRtY.js","./JsonOutput-BI2qFHVr.js","./download-CIdXYNHv.js","./html-to-image-DMn_7CCA.js","./LazyAnyLanguageCodeMirror-YVX2AZaI.js","./table-CUK1W5bI.js","./markdown-renderer-DIXiKP4m.js","./chunk-5FQGJX7Z-CRg4xQWg.js","./micromark-factory-space-D9Dr-k4J.js","./markdown-renderer-CU2Wa_Bt.css","./ellipsis-Dfik_tuW.js","./message-circle-BQB1AIAg.js","./MarimoErrorOutput-BXh29HCp.js","./hat-glasses-C8LSY3HT.js","./datasource-BrSYgi6C.js","./RenderHTML-COTZYPO7.js","./copy-icon-LPQzn7_f.js","./useRunCells-DHnbXALT.js","./useInstallPackage-Bq7SlWgN.js","./state-llVv0lIh.js","./cell-link-BbAJokoX.js","./useDateFormatter-BiqAQ-zI.js","./tooltip-Cwltdez8.js","./vega-loader.browser-AQmjV9CX.js","./precisionRound-Bq_nmf5u.js","./defaultLocale-CNPGWpMu.js","./defaultLocale-Dm4DaIgg.js","./emotion-is-prop-valid.esm-nLO-SoUf.js","./useIframeCapabilities-DEpTCh1Q.js","./utils-49LGK4zG.js","./formats-DSzGCKeO.js","./react-resizable-panels.browser.esm-BSRAHC4P.js","./JsonOutput-BQtz7-np.css","./arrow-left-DrqK6gPp.js","./panels-D53vWR00.js","./state-MlBpc9qi.js","./_baseSet-gX6o3Pih.js","./readonly-python-code-De0vvuWh.js","./esm-Dw0vvSg2.js","./useAddCell-DIdbaU70.js","./blob-BBiZd3vX.js","./share-C2MPy_VX.js","./events-CbeVJ6OD.js","./layout-Ddsz1eHh.js","./code-xml-B7x62Eeh.js","./code-CF0HKE9K.js","./useDeleteCell-CSCMg7Up.js","./trash-DS1-SuM0.js","./prop-types-Djf4O40e.js","./floating-outline-CNsG18LK.js","./process-output-DNhz9LLW.js","./name-cell-input-zqypwqoZ.js","./name-cell-input-ujOhus_y.css","./esm-BGpfQNhD.js","./dist-BcfF-rkl.js","./dist-fxnYzq-R.js","./dist-CEeRVpMD.js","./dist-CidBzUqR.js","./dist-DkCO0b-0.js","./dist-DoAjHgMj.js","./dist-CxxZaSme.js","./dist-BcYW-EJk.js","./dist-DIkuvChK.js","./dist-Cqm1W-Zm.js","./dist-Dbu5sPgR.js","./dist-BKx0MLbb.js","./dist-DL1Thauf.js","./apl-CYIAEF37.js","./asciiarmor-CF6FHpQl.js","./asn1-CmtZ6NID.js","./brainfuck-vE42J6oQ.js","./cobol-ttQu-eUm.js","./clike-Bo1_pR8B.js","./clojure-1zb6N0Kd.js","./css-aD3t-znF.js","./cmake-DSEb40G9.js","./coffeescript-CcHmp8ZW.js","./commonlisp-DHrixoxv.js","./cypher-q6-coHOK.js","./python-C4CVWZ7v.js","./crystal-fOwNIMzy.js","./d-Drt6ZXrF.js","./diff-CYBnW6ZU.js","./dtd-DqGG8R4P.js","./dylan-BTCYgsmh.js","./ecl-BPsxRGqR.js","./eiffel-BCguJEP-.js","./elm-DnNeI1M2.js","./erlang-DkHPV6ru.js","./factor-ZZBBZpXK.js","./simple-mode-DXiLM1-G.js","./forth-DUDizG3o.js","./fortran-BarbOvgW.js","./mllike-BKN6OcTc.js","./gas-mybzrfIH.js","./gherkin-BlnXaZZf.js","./groovy-cYuFC_ot.js","./haskell-CuLp9g3a.js","./haxe-CiIUZbdX.js","./idl-BHq7WyPV.js","./javascript-D-FtdkNC.js","./julia-CoYYMTcZ.js","./livescript-C1gEZ5Hk.js","./lua-CRIS5afH.js","./mirc-CTGUd79I.js","./mathematica-CwlrU_TQ.js","./modelica-DZs5SjV_.js","./mumps-BNg2Yq-1.js","./mbox-skR0V6cu.js","./nsis-8kQdxo7f.js","./ntriples-Ck5rp6GE.js","./octave-BRpd3hBF.js","./oz-BUEZmvHT.js","./pascal-DBfxUwpj.js","./perl-v9vsztCj.js","./pig-CrKTIB-m.js","./powershell-89xdb5K_.js","./properties-DaUFoXFR.js","./protobuf-Ci5XvpF4.js","./pug-DPY-Ajan.js","./puppet-Da8ZxG7z.js","./q-BjtI5Irp.js","./r-vSi6pWDr.js","./rpm-Cv5HmAkX.js","./ruby-UyKn0rKt.js","./sas-D3-6PWmJ.js","./scheme-DqTb0ELD.js","./shell-DySzVBqR.js","./sieve-CoBbN2aF.js","./smalltalk-CJJAzHnb.js","./sparql-CjwbV0fX.js","./stylus-uh0Gd-Iz.js","./swift-D5IK5OrP.js","./verilog-DPWRmpYS.js","./tcl-BvqzOD3a.js","./textile--JQHE1pJ.js","./toml-lWmHdWv5.js","./troff-r7W702V9.js","./ttcn-1CwPIugQ.js","./ttcn-cfg-CHYEAF6D.js","./turtle-D_5eCUwg.js","./webidl-CNY2gQL0.js","./vb-Vd6lTutg.js","./vbscript-CcW6E3ma.js","./velocity-CuSicjhq.js","./vhdl-sLYad3YP.js","./xquery-d3Qdoigy.js","./yacas-BjDXhrkW.js","./z80-z4BkVl0y.js","./mscgen-Bo5N9WUj.js","./dist-DeuWxYVk.js","./readonly-code-display-CKT-gv1m.js","./layout-D-WxHzKd.css","./requests-S_7PqcSt.js","./ws-DLVysDhS.js","./types-CoHi_MQq.js","./runs-BQTlv6Ja.js","./panels-DDsRoC3H.css","./edit-page-
|
|
2
|
-
import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{c as n,l as r,o as i,r as a,s as o,t as s}from"./useEvent-xfs0Sn4r.js";import{t as c}from"./react-CBDbhulC.js";import{$ as l,$i as u,$t as d,Ai as f,An as p,Ao as m,Bo as h,Cn as g,Co as _,Eo as v,Fo as y,Go as b,Gt as x,Ho as S,Ht as C,Io as w,Jt as T,Kt as E,Li as D,Mn as O,Mo as k,Nn as A,No as j,On as M,Oo as N,Pn as P,Po as F,Q as I,Qi as L,Qt as ee,R as te,Ra as ne,Sn as re,Tn as ie,To as ae,Ui as oe,Uo as se,Vo as ce,Vt as le,Wn as ue,Wo as de,X as fe,Y as pe,Yi as me,Yt as he,Z as ge,Zi as _e,Zt as ve,_o as ye,an as be,bn as xe,bo as Se,cn as Ce,dn as we,en as Te,et as Ee,gn as De,go as Oe,ho as ke,ia as Ae,in as je,ji as Me,jn as Ne,kn as Pe,ln as Fe,mo as Ie,mt as Le,on as Re,pt as ze,qt as Be,rn as Ve,sn as He,so as Ue,ta as We,tn as Ge,tt as Ke,un as qe,uo as Je,vn as Ye,wo as Xe,x as Ze,xn as Qe,y as $e}from"./cells-B1S_6FG3.js";import{t as et}from"./react-dom-BQrReHnR.js";import{Cn as R,In as z,It as tt,Jn as nt,Sn as B,Tt as V,W as rt,Wn as it,Yn as at,at as ot,bt as st,cn as ct,hn as lt,hr as ut,jn as dt,kt as H,lc as ft,ln as pt,n as mt,un as ht,vt as gt,wn as _t,wt as vt,xt as yt}from"./schemas-aTUejmFi.js";import{t as bt}from"./compiler-runtime-CYIjoINj.js";import{t as xt}from"./get-DjNf4SIX.js";import{t as St}from"./pick-Bs4cJfJU.js";import{S as Ct,a as wt,c as Tt,d as Et,f as Dt,h as Ot,i as kt,l as At,o as jt,p as Mt,r as Nt,s as Pt,u as Ft,y as It}from"./state-MlBpc9qi.js";import{_ as Lt,a as Rt,g as U,o as zt,t as Bt}from"./useEventListener-D27Dii_l.js";import{t as Vt}from"./objects-snlMn4yk.js";import{t as Ht}from"./invariant-Ci2dTZ72.js";import{C as Ut,E as Wt,M as Gt,N as Kt,P as qt,S as Jt,d as Yt,o as Xt,t as Zt,y as Qt}from"./utils-R_pHe-RB.js";import{r as $t}from"./constants-BDbGiS7O.js";import{C as en,D as tn,E as nn,M as rn,N as an,S as on,T as sn,a as cn,b as ln,i as un,l as dn,r as fn,s as pn,t as mn,v as hn}from"./config-CUBl5qBg.js";import{a as gn,i as _n,n as vn,o as yn,r as bn,t as xn}from"./switch-CBR-ykv3.js";import{a as Sn,o as Cn,s as wn,t as Tn}from"./readonly-python-code-De0vvuWh.js";import{t as En}from"./ErrorBoundary-TUuUdxHz.js";import{n as Dn,t as W}from"./cn-ldLVeaqm.js";import{t as On}from"./jsx-runtime-B74pBk57.js";import{C as kn,T as An,_ as jn,a as Mn,b as Nn,g as Pn,m as Fn,o as In,r as Ln,v as Rn,w as zn,x as Bn,y as Vn}from"./fullscreen-0EEPR7uc.js";import{o as Hn,s as Un}from"./dist-BgL43w5r.js";import{d as Wn,u as Gn}from"./menu-items-BSVrMleU.js";import{a as Kn,c as qn,i as Jn,l as Yn,o as Xn,r as Zn,s as Qn,u as $n}from"./config-DcB2swfZ.js";import{a as er,c as tr,i as nr,l as rr,n as ir,s as ar,t as or}from"./alert-dialog-DBoy-FMx.js";import{i as sr,n as cr,r as lr,t as ur}from"./tabs-c6mpccpH.js";import{a as dr,c as fr,d as pr,f as mr,h as hr,i as gr,l as _r,m as vr,n as yr,o as br,p as xr,r as Sr,s as Cr,t as wr}from"./select-BUEX2Vfl.js";import{t as Tr}from"./circle--ysFeW9z.js";import{a as Er,c as Dr,i as Or,o as kr,p as Ar,r as jr,t as Mr}from"./dropdown-menu-CqNabM1f.js";import{A as Nr,Ct as Pr,F as Fr,Ft as Ir,G as Lr,H as Rr,I as zr,It as Br,J as Vr,K as Hr,L as Ur,Lt as Wr,M as Gr,Mt as Kr,O as qr,Ot as Jr,P as Yr,Pt as Xr,R as Zr,St as Qr,U as $r,W as ei,Y as ti,Z as ni,at as ri,b as ii,bt as ai,c as oi,d as si,dt as ci,f as li,ft as ui,g as di,gt as fi,h as pi,ht as mi,it as hi,j as gi,k as _i,kt as vi,lt as yi,m as bi,mt as xi,ot as Si,pt as Ci,q as wi,r as Ti,t as Ei,u as Di,ut as Oi,v as ki,vt as Ai,wt as ji,x as Mi,xt as Ni,y as Pi,yt as Fi,z as Ii}from"./JsonOutput-BI2qFHVr.js";import{h as Li,l as Ri,n as zi,p as Bi,r as Vi}from"./download-CIdXYNHv.js";import{a as Hi,i as Ui,n as Wi,o as Gi,r as Ki,t as qi}from"./tooltip-D7dq6bnc.js";import{n as Ji,t as Yi}from"./button-BMBznEru.js";import{st as Xi}from"./dist-PIe1xcZo.js";import{d as Zi,o as Qi,p as $i,t as ea}from"./arrays-BqUx5USx.js";import{n as ta,t as na}from"./once-Haz_uxEL.js";import{n as ra,r as ia,t as aa}from"./strings-CpYReX2Q.js";import{n as oa}from"./requests-C6_IaFh7.js";import{t as sa}from"./createLucideIcon-B7HeEoG2.js";import{D as ca,E as la,S as ua,T as da,_ as fa,a as pa,c as ma,d as ha,f as ga,g as _a,h as va,i as ya,l as ba,m as xa,n as Sa,o as Ca,p as wa,r as Ta,s as Ea,t as Da,u as Oa,v as ka,w as Aa,x as ja,y as Ma}from"./spec-CUFquO6R.js";import{n as Na,r as Pa,t as Fa}from"./fileToBase64-NhpNrK5l.js";import{t as Ia}from"./LazyAnyLanguageCodeMirror-YVX2AZaI.js";import{i as La,n as Ra,o as za}from"./useLifecycle-BUaJcygz.js";import{a as Ba,c as Va,i as Ha,n as Ua,s as Wa,t as Ga}from"./useBoolean-DfDMEVCI.js";import{a as Ka,r as qa,t as Ja}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as Ya}from"./chevron-right-CKA5zVsM.js";import{t as Xa}from"./code-xml-B7x62Eeh.js";import{t as Za}from"./copy-BMXKNElG.js";import{t as Qa}from"./eye-off-CFuPxa9F.js";import{n as $a}from"./file-headphone-rFCxFRI8.js";import{r as eo,t as to}from"./file-icons-Bo1Ewf1W.js";import{t as no}from"./globe-BQf75qV_.js";import{i as ro,n as io}from"./markdown-export-0rLbaq8b.js";import{C as ao,S as oo,x as so,y as co}from"./write-secret-modal-BG_B6y1P.js";import{n as lo,t as uo}from"./spinner-Ck-Hgfvj.js";import{n as fo,t as po}from"./types-BflGgckY.js";import{t as mo}from"./plus-C4J9gIE1.js";import{t as ho}from"./refresh-cw-Bf-rx_aV.js";import{i as go,n as _o,o as vo,r as yo,t as bo}from"./input-DeyycFtq.js";import{t as xo}from"./square-function-DkZweMAs.js";import{a as So,i as Co,r as wo,t as To}from"./column-preview-D6cIOnWQ.js";import{t as Eo}from"./square-B58Ib8Ir.js";import{t as Do}from"./trash-2-D_HX-0qx.js";import{t as Oo}from"./triangle-alert-MihykDYG.js";import{n as ko,t as Ao}from"./es-BuMFDpR4.js";import{t as jo}from"./preload-helper-HclGiUj8.js";import{n as Mo,t as No}from"./use-toast-DpWHUGuF.js";import{n as Po,t as Fo}from"./paths-zcL04qUW.js";import{l as Io,r as Lo,s as Ro}from"./session-CEdta5_Q.js";import{r as zo}from"./useTheme-BRnykVDX.js";import{n as Bo,t as Vo}from"./context-Do8M9TDF.js";import{a as Ho,i as Uo,o as Wo,t as Go}from"./numbers-DKurV_vq.js";import{n as Ko,t as qo}from"./useDebounce-Dulm61-t.js";import{n as Jo}from"./useAsyncData-Buhk-UgR.js";import{n as Yo,r as Xo,t as Zo}from"./dates-DK5JikJo.js";import{t as Qo}from"./copy-icon-LPQzn7_f.js";import{t as $o}from"./RenderHTML-COTZYPO7.js";import{a as es,i as ts,n as ns,r as rs,t as is}from"./errors-DzO-nXy-.js";import{i as as,r as os,t as ss}from"./tooltip-Cwltdez8.js";import{a as cs}from"./react-icons.esm-hr79-MCS.js";import{a as ls,i as us,n as ds,t as fs}from"./events-CbeVJ6OD.js";import{n as ps,r as ms,t as hs}from"./alert-dmKwNsrp.js";import{n as gs,t as _s}from"./error-banner-B3KYUlCX.js";import{n as vs,t as ys}from"./utils-49LGK4zG.js";import{a as bs,i as xs,n as Ss,o as Cs,r as ws,t as Ts}from"./table-DmqOOjfe.js";import{t as Es}from"./renderShortcut-D9XYVNe3.js";import{t as Ds}from"./bundle.esm-DzY74mzC.js";import{n as Os}from"./icons-CjLa9BiH.js";import{t as ks}from"./useDeepCompareMemoize-CLytDdMl.js";import{t as As}from"./pathUtils-Cryrlpma.js";import{i as js,n as Ms,r as Ns}from"./floating-outline-CNsG18LK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var G=e(c(),1),Ps=e(et(),1),K=On(),Fs=`NavigationMenu`,[Is,Ls,Rs]=Wn(Fs),[zs,Bs,Vs]=Wn(Fs),[Hs,Us]=kn(Fs,[Rs,Vs]),[Ws,Gs]=Hs(Fs),[Ks,qs]=Hs(Fs),Js=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:a,delayDuration:o=200,skipDelayDuration:s=300,orientation:c=`horizontal`,dir:l,...u}=e,[d,f]=G.useState(null),p=zt(t,e=>f(e)),m=Gn(l),h=G.useRef(0),g=G.useRef(0),_=G.useRef(0),[v,y]=G.useState(!0),[b,x]=Vn({prop:r,onChange:e=>{let t=e!==``,n=s>0;t?(window.clearTimeout(_.current),n&&y(!1)):(window.clearTimeout(_.current),_.current=window.setTimeout(()=>y(!0),s)),i?.(e)},defaultProp:a??``,caller:Fs}),S=G.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>x(``),150)},[x]),C=G.useCallback(e=>{window.clearTimeout(g.current),x(e)},[x]),w=G.useCallback(e=>{b===e?window.clearTimeout(g.current):h.current=window.setTimeout(()=>{window.clearTimeout(g.current),x(e)},o)},[b,x,o]);return G.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(g.current),window.clearTimeout(_.current)},[]),(0,K.jsx)(Zs,{scope:n,isRootMenu:!0,value:b,dir:m,orientation:c,rootNavigationMenu:d,onTriggerEnter:e=>{window.clearTimeout(h.current),v?w(e):C(e)},onTriggerLeave:()=>{window.clearTimeout(h.current),S()},onContentEnter:()=>window.clearTimeout(g.current),onContentLeave:S,onItemSelect:e=>{x(t=>t===e?``:e)},onItemDismiss:()=>x(``),children:(0,K.jsx)(zn.nav,{"aria-label":`Main`,"data-orientation":c,dir:m,...u,ref:p})})});Js.displayName=Fs;var Ys=`NavigationMenuSub`,Xs=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,...s}=e,c=Gs(Ys,n),[l,u]=Vn({prop:r,onChange:i,defaultProp:a??``,caller:Ys});return(0,K.jsx)(Zs,{scope:n,isRootMenu:!1,value:l,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:e=>u(e),onItemSelect:e=>u(e),onItemDismiss:()=>u(``),children:(0,K.jsx)(zn.div,{"data-orientation":o,...s,ref:t})})});Xs.displayName=Ys;var Zs=e=>{let{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:a,children:o,value:s,onItemSelect:c,onItemDismiss:l,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:p}=e,[m,h]=G.useState(null),[g,_]=G.useState(new Map),[v,y]=G.useState(null);return(0,K.jsx)(Ws,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:hr(s),baseId:jn(),dir:i,orientation:a,viewport:m,onViewportChange:h,indicatorTrack:v,onIndicatorTrackChange:y,onTriggerEnter:Pn(u),onTriggerLeave:Pn(d),onContentEnter:Pn(f),onContentLeave:Pn(p),onItemSelect:Pn(c),onItemDismiss:Pn(l),onViewportContentChange:G.useCallback((e,t)=>{_(n=>(n.set(e,t),new Map(n)))},[]),onViewportContentRemove:G.useCallback(e=>{_(t=>t.has(e)?(t.delete(e),new Map(t)):t)},[]),children:(0,K.jsx)(Is.Provider,{scope:t,children:(0,K.jsx)(Ks,{scope:t,items:g,children:o})})})},Qs=`NavigationMenuList`,$s=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=Gs(Qs,n),a=(0,K.jsx)(zn.ul,{"data-orientation":i.orientation,...r,ref:t});return(0,K.jsx)(zn.div,{style:{position:`relative`},ref:i.onIndicatorTrackChange,children:(0,K.jsx)(Is.Slot,{scope:n,children:i.isRootMenu?(0,K.jsx)(xc,{asChild:!0,children:a}):a})})});$s.displayName=Qs;var ec=`NavigationMenuItem`,[tc,nc]=Hs(ec),rc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,...i}=e,a=jn(),o=r||a||`LEGACY_REACT_AUTO_VALUE`,s=G.useRef(null),c=G.useRef(null),l=G.useRef(null),u=G.useRef(()=>{}),d=G.useRef(!1),f=G.useCallback((e=`start`)=>{if(s.current){u.current();let t=Tc(s.current);t.length&&Ec(e===`start`?t:t.reverse())}},[]),p=G.useCallback(()=>{if(s.current){let e=Tc(s.current);e.length&&(u.current=Dc(e))}},[]);return(0,K.jsx)(tc,{scope:n,value:o,triggerRef:c,contentRef:s,focusProxyRef:l,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:p,onContentFocusOutside:p,children:(0,K.jsx)(zn.li,{...i,ref:t})})});rc.displayName=ec;var ic=`NavigationMenuTrigger`,ac=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,disabled:r,...i}=e,a=Gs(ic,e.__scopeNavigationMenu),o=nc(ic,e.__scopeNavigationMenu),s=G.useRef(null),c=zt(s,o.triggerRef,t),l=Ac(a.baseId,o.value),u=jc(a.baseId,o.value),d=G.useRef(!1),f=G.useRef(!1),p=o.value===a.value;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Is.ItemSlot,{scope:n,value:o.value,children:(0,K.jsx)(wc,{asChild:!0,children:(0,K.jsx)(zn.button,{id:l,disabled:r,"data-disabled":r?``:void 0,"data-state":kc(p),"aria-expanded":p,"aria-controls":u,...i,ref:c,onPointerEnter:Bn(e.onPointerEnter,()=>{f.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:Bn(e.onPointerMove,Mc(()=>{r||f.current||o.wasEscapeCloseRef.current||d.current||(a.onTriggerEnter(o.value),d.current=!0)})),onPointerLeave:Bn(e.onPointerLeave,Mc(()=>{r||(a.onTriggerLeave(),d.current=!1)})),onClick:Bn(e.onClick,()=>{a.onItemSelect(o.value),f.current=p}),onKeyDown:Bn(e.onKeyDown,e=>{let t={horizontal:`ArrowDown`,vertical:a.dir===`rtl`?`ArrowLeft`:`ArrowRight`}[a.orientation];p&&e.key===t&&(o.onEntryKeyDown(),e.preventDefault())})})})}),p&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Un,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:e=>{let t=o.contentRef.current,n=e.relatedTarget,r=n===s.current,i=t?.contains(n);(r||!i)&&o.onFocusProxyEnter(r?`start`:`end`)}}),a.viewport&&(0,K.jsx)(`span`,{"aria-owns":u})]})]})});ac.displayName=ic;var oc=`NavigationMenuLink`,sc=`navigationMenu.linkSelect`,cc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,active:r,onSelect:i,...a}=e;return(0,K.jsx)(wc,{asChild:!0,children:(0,K.jsx)(zn.a,{"data-active":r?``:void 0,"aria-current":r?`page`:void 0,...a,ref:t,onClick:Bn(e.onClick,e=>{let t=e.target,n=new CustomEvent(sc,{bubbles:!0,cancelable:!0});if(t.addEventListener(sc,e=>i?.(e),{once:!0}),An(t,n),!n.defaultPrevented&&!e.metaKey){let e=new CustomEvent(hc,{bubbles:!0,cancelable:!0});An(t,e)}},{checkForDefaultPrevented:!1})})})});cc.displayName=oc;var lc=`NavigationMenuIndicator`,uc=G.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Gs(lc,e.__scopeNavigationMenu),a=!!i.value;return i.indicatorTrack?Ps.createPortal((0,K.jsx)(Rn,{present:n||a,children:(0,K.jsx)(dc,{...r,ref:t})}),i.indicatorTrack):null});uc.displayName=lc;var dc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=Gs(lc,n),a=Ls(n),[o,s]=G.useState(null),[c,l]=G.useState(null),u=i.orientation===`horizontal`,d=!!i.value;G.useEffect(()=>{let e=a().find(e=>e.value===i.value)?.ref.current;e&&s(e)},[a,i.value]);let f=()=>{o&&l({size:u?o.offsetWidth:o.offsetHeight,offset:u?o.offsetLeft:o.offsetTop})};return Oc(o,f),Oc(i.indicatorTrack,f),c?(0,K.jsx)(zn.div,{"aria-hidden":!0,"data-state":d?`visible`:`hidden`,"data-orientation":i.orientation,...r,ref:t,style:{position:`absolute`,...u?{left:0,width:c.size+`px`,transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+`px`,transform:`translateY(${c.offset}px)`},...r.style}}):null}),fc=`NavigationMenuContent`,pc=G.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Gs(fc,e.__scopeNavigationMenu),a=nc(fc,e.__scopeNavigationMenu),o=zt(a.contentRef,t),s=a.value===i.value,c={value:a.value,triggerRef:a.triggerRef,focusProxyRef:a.focusProxyRef,wasEscapeCloseRef:a.wasEscapeCloseRef,onContentFocusOutside:a.onContentFocusOutside,onRootContentClose:a.onRootContentClose,...r};return i.viewport?(0,K.jsx)(mc,{forceMount:n,...c,ref:o}):(0,K.jsx)(Rn,{present:n||s,children:(0,K.jsx)(gc,{"data-state":kc(s),...c,ref:o,onPointerEnter:Bn(e.onPointerEnter,i.onContentEnter),onPointerLeave:Bn(e.onPointerLeave,Mc(i.onContentLeave)),style:{pointerEvents:!s&&i.isRootMenu?`none`:void 0,...c.style}})})});pc.displayName=fc;var mc=G.forwardRef((e,t)=>{let{onViewportContentChange:n,onViewportContentRemove:r}=Gs(fc,e.__scopeNavigationMenu);return Nn(()=>{n(e.value,{ref:t,...e})},[e,t,n]),Nn(()=>()=>r(e.value),[e.value,r]),null}),hc=`navigationMenu.rootContentDismiss`,gc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:a,wasEscapeCloseRef:o,onRootContentClose:s,onContentFocusOutside:c,...l}=e,u=Gs(fc,n),d=G.useRef(null),f=zt(d,t),p=Ac(u.baseId,r),m=jc(u.baseId,r),h=Ls(n),g=G.useRef(null),{onItemDismiss:_}=u;G.useEffect(()=>{let e=d.current;if(u.isRootMenu&&e){let t=()=>{_(),s(),e.contains(document.activeElement)&&i.current?.focus()};return e.addEventListener(hc,t),()=>e.removeEventListener(hc,t)}},[u.isRootMenu,e.value,i,_,s]);let v=G.useMemo(()=>{let e=h().map(e=>e.value);u.dir===`rtl`&&e.reverse();let t=e.indexOf(u.value),n=e.indexOf(u.previousValue),i=r===u.value,a=n===e.indexOf(r);if(!i&&!a)return g.current;let o=(()=>{if(t!==n){if(i&&n!==-1)return t>n?`from-end`:`from-start`;if(a&&t!==-1)return t>n?`to-start`:`to-end`}return null})();return g.current=o,o},[u.previousValue,u.value,u.dir,h,r]);return(0,K.jsx)(xc,{asChild:!0,children:(0,K.jsx)(Fn,{id:m,"aria-labelledby":p,"data-motion":v,"data-orientation":u.orientation,...l,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{let e=new Event(hc,{bubbles:!0,cancelable:!0});d.current?.dispatchEvent(e)},onFocusOutside:Bn(e.onFocusOutside,e=>{c();let t=e.target;u.rootNavigationMenu?.contains(t)&&e.preventDefault()}),onPointerDownOutside:Bn(e.onPointerDownOutside,e=>{let t=e.target,n=h().some(e=>e.ref.current?.contains(t)),r=u.isRootMenu&&u.viewport?.contains(t);(n||r||!u.isRootMenu)&&e.preventDefault()}),onKeyDown:Bn(e.onKeyDown,e=>{let t=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!t){let t=Tc(e.currentTarget),n=document.activeElement,r=t.findIndex(e=>e===n);Ec(e.shiftKey?t.slice(0,r).reverse():t.slice(r+1,t.length))?e.preventDefault():a.current?.focus()}}),onEscapeKeyDown:Bn(e.onEscapeKeyDown,e=>{o.current=!0})})})}),_c=`NavigationMenuViewport`,vc=G.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=!!Gs(_c,e.__scopeNavigationMenu).value;return(0,K.jsx)(Rn,{present:n||i,children:(0,K.jsx)(yc,{...r,ref:t})})});vc.displayName=_c;var yc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,children:r,...i}=e,a=Gs(_c,n),o=zt(t,a.onViewportChange),s=qs(fc,e.__scopeNavigationMenu),[c,l]=G.useState(null),[u,d]=G.useState(null),f=c?c?.width+`px`:void 0,p=c?c?.height+`px`:void 0,m=!!a.value,h=m?a.value:a.previousValue;return Oc(u,()=>{u&&l({width:u.offsetWidth,height:u.offsetHeight})}),(0,K.jsx)(zn.div,{"data-state":kc(m),"data-orientation":a.orientation,...i,ref:o,style:{pointerEvents:!m&&a.isRootMenu?`none`:void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":p,...i.style},onPointerEnter:Bn(e.onPointerEnter,a.onContentEnter),onPointerLeave:Bn(e.onPointerLeave,Mc(a.onContentLeave)),children:Array.from(s.items).map(([e,{ref:t,forceMount:n,...r}])=>{let i=h===e;return(0,K.jsx)(Rn,{present:n||i,children:(0,K.jsx)(gc,{...r,ref:Rt(t,e=>{i&&e&&d(e)})})},e)})})}),bc=`FocusGroup`,xc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=Gs(bc,n);return(0,K.jsx)(zs.Provider,{scope:n,children:(0,K.jsx)(zs.Slot,{scope:n,children:(0,K.jsx)(zn.div,{dir:i.dir,...r,ref:t})})})}),Sc=[`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`],Cc=`FocusGroupItem`,wc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=Bs(n),a=Gs(Cc,n);return(0,K.jsx)(zs.ItemSlot,{scope:n,children:(0,K.jsx)(zn.button,{...r,ref:t,onKeyDown:Bn(e.onKeyDown,e=>{if([`Home`,`End`,...Sc].includes(e.key)){let t=i().map(e=>e.ref.current);if([a.dir===`rtl`?`ArrowRight`:`ArrowLeft`,`ArrowUp`,`End`].includes(e.key)&&t.reverse(),Sc.includes(e.key)){let n=t.indexOf(e.currentTarget);t=t.slice(n+1)}setTimeout(()=>Ec(t)),e.preventDefault()}})})})});function Tc(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ec(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}function Dc(e){return e.forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)}),()=>{e.forEach(e=>{let t=e.dataset.tabindex;e.setAttribute(`tabindex`,t)})}}function Oc(e,t){let n=Pn(t);Nn(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}function kc(e){return e?`open`:`closed`}function Ac(e,t){return`${e}-trigger-${t}`}function jc(e,t){return`${e}-content-${t}`}function Mc(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Nc=Js,Pc=$s,Fc=rc,Ic=ac,Lc=cc,Rc=uc,zc=pc,Bc=vc,Vc=[`PageUp`,`PageDown`],Hc=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Uc={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Wc=`Slider`,[Gc,Kc,qc]=Wn(Wc),[Jc,Yc]=kn(Wc,[qc]),[Xc,Zc]=Jc(Wc),Qc=G.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...h}=e,g=G.useRef(new Set),_=G.useRef(0),v=o===`horizontal`?tl:nl,[y=[],b]=Vn({prop:u,defaultProp:l,onChange:e=>{[...g.current][_.current]?.focus(),d(e)}}),x=G.useRef(y);function S(e){T(e,gl(y,e))}function C(e){T(e,_.current)}function w(){let e=x.current[_.current];y[_.current]!==e&&f(y)}function T(e,t,{commit:n}={commit:!1}){let o=xl(a),s=Sl(Math.round((e-r)/a)*a+r,o),l=vr(s,[r,i]);b((e=[])=>{let r=pl(e,l,t);if(yl(r,c*a)){_.current=r.indexOf(l);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e})}return(0,K.jsx)(Xc,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:_,thumbs:g.current,values:y,orientation:o,form:m,children:(0,K.jsx)(Gc.Provider,{scope:e.__scopeSlider,children:(0,K.jsx)(Gc.Slot,{scope:e.__scopeSlider,children:(0,K.jsx)(v,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:t,onPointerDown:Bn(h.onPointerDown,()=>{s||(x.current=y)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:S,onSlideMove:s?void 0:C,onSlideEnd:s?void 0:w,onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(i,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=Vc.includes(e.key)||e.shiftKey&&Hc.includes(e.key)?10:1,r=_.current,i=y[r];T(i+a*n*t,r,{commit:!0})}}})})})})});Qc.displayName=Wc;var[$c,el]=Jc(Wc,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),tl=G.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=G.useState(null),p=zt(t,e=>f(e)),m=G.useRef(void 0),h=Gn(i),g=h===`ltr`,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=bl([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,K.jsx)($c,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:(0,K.jsx)(rl,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=Uc[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),nl=G.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=G.useRef(null),d=zt(t,u),f=G.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=bl([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,K.jsx)($c,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,K.jsx)(rl,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=Uc[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),rl=G.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Zc(Wc,n);return(0,K.jsx)(zn.span,{...l,ref:t,onKeyDown:Bn(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Vc.concat(Hc).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:Bn(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:Bn(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:Bn(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),il=`SliderTrack`,al=G.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Zc(il,n);return(0,K.jsx)(zn.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});al.displayName=il;var ol=`SliderRange`,sl=G.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Zc(ol,n),a=el(ol,n),o=G.useRef(null),s=zt(t,o),c=i.values.length,l=i.values.map(e=>ml(e,i.min,i.max)),u=c>1?Math.min(...l):0,d=100-Math.max(...l);return(0,K.jsx)(zn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:s,style:{...e.style,[a.startEdge]:u+`%`,[a.endEdge]:d+`%`}})});sl.displayName=ol;var cl=`SliderThumb`,ll=G.forwardRef((e,t)=>{let n=Kc(e.__scopeSlider),[r,i]=G.useState(null),a=zt(t,e=>i(e)),o=G.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,K.jsx)(ul,{...e,ref:a,index:o})}),ul=G.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=Zc(cl,n),s=el(cl,n),[c,l]=G.useState(null),u=zt(t,e=>l(e)),d=!c||o.form||!!c.closest(`form`),f=Hn(c),p=o.values[r],m=p===void 0?0:ml(p,o.min,o.max),h=hl(r,o.values.length),g=f?.[s.size],_=g?_l(g,m,s.direction):0;return G.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,K.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${_}px)`},children:[(0,K.jsx)(Gc.ItemSlot,{scope:e.__scopeSlider,children:(0,K.jsx)(zn.span,{role:`slider`,"aria-label":e[`aria-label`]||h,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,tabIndex:o.disabled?void 0:0,...a,ref:u,style:p===void 0?{display:`none`}:e.style,onFocus:Bn(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&(0,K.jsx)(fl,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});ll.displayName=cl;var dl=`RadioBubbleInput`,fl=G.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=G.useRef(null),a=zt(i,r),o=hr(t);return G.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,K.jsx)(zn.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});fl.displayName=dl;function pl(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function ml(e,t,n){let r=100/(n-t)*(e-t);return vr(r,[0,100])}function hl(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function gl(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function _l(e,t,n){let r=e/2;return(r-bl([0,50],[0,r])(t)*n)*n}function vl(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function yl(e,t){if(t>0){let n=vl(e);return Math.min(...n)>=t}return!0}function bl(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function xl(e){return(String(e).split(`.`)[1]||``).length}function Sl(e,t){let n=10**t;return Math.round(e*n)/n}var Cl=Qc,wl=al,Tl=sl,El=ll,Dl=sa(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Ol=sa(`arrow-up-wide-narrow`,[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 16h7`,key:`uosisv`}],[`path`,{d:`M11 20h4`,key:`1krc32`}]]),kl=sa(`binary`,[[`rect`,{x:`14`,y:`14`,width:`4`,height:`6`,rx:`2`,key:`p02svl`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`6`,rx:`2`,key:`xm4xkj`}],[`path`,{d:`M6 20h4`,key:`1i6q5t`}],[`path`,{d:`M14 10h4`,key:`ru81e7`}],[`path`,{d:`M6 14h2v6`,key:`16z9wg`}],[`path`,{d:`M14 4h2v6`,key:`1idq9u`}]]),Al=sa(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),jl=sa(`combine`,[[`path`,{d:`M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1`,key:`1l7d7l`}],[`path`,{d:`M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1`,key:`9955pe`}],[`path`,{d:`m7 15 3 3`,key:`4hkfgk`}],[`path`,{d:`m7 21 3-3H5a2 2 0 0 1-2-2v-2`,key:`1xljwe`}],[`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1cdgtw`}],[`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1`,key:`zi3rio`}]]),Ml=sa(`copy-slash`,[[`line`,{x1:`12`,x2:`18`,y1:`18`,y2:`12`,key:`ebkxgr`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Nl=sa(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),Pl=sa(`group`,[[`path`,{d:`M3 7V5c0-1.1.9-2 2-2h2`,key:`adw53z`}],[`path`,{d:`M17 3h2c1.1 0 2 .9 2 2v2`,key:`an4l38`}],[`path`,{d:`M21 17v2c0 1.1-.9 2-2 2h-2`,key:`144t0e`}],[`path`,{d:`M7 21H5c-1.1 0-2-.9-2-2v-2`,key:`rtnfgi`}],[`rect`,{width:`7`,height:`5`,x:`7`,y:`7`,rx:`1`,key:`1eyiv7`}],[`rect`,{width:`7`,height:`5`,x:`10`,y:`12`,rx:`1`,key:`1qlmkx`}]]),Fl=sa(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]),Il=sa(`square-dashed-mouse-pointer`,[[`path`,{d:`M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z`,key:`xwnzip`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h2`,key:`1qve2z`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v2`,key:`p14lih`}],[`path`,{d:`M3 14v1`,key:`vnatye`}]]),Ll=sa(`square-mouse-pointer`,[[`path`,{d:`M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z`,key:`xwnzip`}],[`path`,{d:`M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6`,key:`14rsvq`}]]),Rl=sa(`triangle`,[[`path`,{d:`M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`,key:`14u9p9`}]]),zl=e(b(),1),Bl={INSERT:`insert`,DELETE:`delete`,SUBSTITUTE:`substitute`,MATCH:`match`};function Vl(e,t,n){let r=e.length,i=t.length,a=Array.from({length:r+1},()=>Array.from({length:i+1}).fill(0));for(let e=0;e<=r;e++)a[e][0]=e;for(let e=0;e<=i;e++)a[0][e]=e;for(let o=1;o<=r;o++)for(let r=1;r<=i;r++)a[o][r]=n(e[o-1],t[r-1])?a[o-1][r-1]:1+Math.min(a[o-1][r],a[o][r-1],a[o-1][r-1]);let o=[],s=r,c=i;for(;s>0||c>0;)s>0&&c>0&&n(e[s-1],t[c-1])?(o.unshift({type:Bl.MATCH,position:s-1}),s--,c--):s>0&&c>0&&a[s][c]===a[s-1][c-1]+1?(o.unshift({type:Bl.SUBSTITUTE,position:s-1}),s--,c--):s>0&&a[s][c]===a[s-1][c]+1?(o.unshift({type:Bl.DELETE,position:s-1}),s--):c>0&&a[s][c]===a[s][c-1]+1&&(o.unshift({type:Bl.INSERT,position:s}),c--);return{distance:a[r][i],operations:o}}function Hl(e,t,n){let r=[],i=0;for(let a of t)switch(a.type){case Bl.MATCH:r.push(e[i]),i++;break;case Bl.DELETE:i++;break;case Bl.INSERT:r.push(n);break;case Bl.SUBSTITUTE:r.push(n),i++}return r}function Ul(e,t,n,r){let i=Vl(e,t,n);return{merged:Hl(e,i.operations,r),edits:i}}var Wl=0,Gl=``;function Kl(e){return e.id?e.id:e.name===`setup`?k:N.create()}function ql(e,t){let n=new Map,r=new Map;if(!e&&!t)return{cellIds:[],sessionCellData:n,notebookCellData:r};if(!e){let e=t?.cells.map(e=>Kl(e))||[];return{cellIds:e,sessionCellData:new Map(e.map((e,t)=>[e,null])),notebookCellData:new Map(e.map((e,n)=>[e,t?.cells[n]||Jl()]))}}if(!t){let t=e.cells.map(e=>Kl(e));return{cellIds:t,sessionCellData:new Map(t.map((t,n)=>[t,e.cells[n]])),notebookCellData:new Map(t.map(e=>[e,Jl()]))}}let{merged:i,edits:a}=Ul(e.cells,t.cells,(e,t)=>{let n=e.code_hash;return n?t.code_hash===n:!1},Yl());a.distance>0&&U.warn(`Session and notebook have different cells, attempted merge.`);let o=[];for(let e=0;e<t.cells.length;e++){let a=t.cells[e];if(a){let t=Kl(a);o.push(t);let s=i[e]||Yl();s.id=t,n.set(t,s),r.set(t,a)}else U.warn(`Merged notebook cell is null at index`,e)}return{cellIds:o,sessionCellData:n,notebookCellData:r}}function Jl(){return{id:N.create(),name:Gl,code:Gl,code_hash:null,config:{column:null,disabled:!1,hide_code:!1}}}function Yl(){return{id:N.create(),code_hash:null,console:[],outputs:[]}}function Xl(e,t){return{id:e,name:t.name??Gl,code:t.code??Gl,edited:!1,lastCodeRun:null,lastExecutionTime:null,config:{column:t.config?.column??null,disabled:t.config?.disabled??!1,hide_code:t.config?.hide_code??!1},serializedEditorState:null}}function Zl(e){let t=te();if(!e)return t;let n=e.outputs||[],r=n.find(e=>e.type===`data`)||n.find(e=>e.type===`error`)||n[0];if(r){if(r.type===`error`)t.output={channel:`marimo-error`,data:[{type:`unknown`,msg:r.evalue}],mimetype:`application/vnd.marimo+error`,timestamp:Wl};else if(r.type===`data`){let e=Object.keys(r.data)[0];t.output={channel:`output`,data:Object.values(r.data)[0],mimetype:e,timestamp:Wl}}}let i=e.console||[];return{...t,outline:t.output?ze(t.output):null,consoleOutputs:i.map(e=>e.type===`streamMedia`?{channel:`media`,data:e.data,mimetype:e.mimetype,timestamp:Wl}:{channel:e.name===`stderr`?`stderr`:`stdout`,data:e.text,mimetype:e.mimetype??`text/plain`,timestamp:Wl})}}function Ql(e,t){let{cellIds:n,sessionCellData:r,notebookCellData:i}=ql(e,t);if(n.length===0)return null;let a={},o={};for(let e of n){let t=r.get(e),n=i.get(e);n&&(a[e]=Xl(e,n)),o[e]=Zl(t)}return{cellIds:Ue.from([n]),cellData:a,cellRuntime:o,cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set}}var q=bt(),$l=Object.freeze({left:0,top:0,width:16,height:16}),eu=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),tu=Object.freeze({...$l,...eu}),nu=Object.freeze({...tu,body:``,hidden:!1}),ru=Object.freeze({width:null,height:null}),iu=Object.freeze({...ru,...eu});function au(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}var ou=/[\s,]+/;function su(e,t){t.split(ou).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0}})}var cu={...iu,preserveAspectRatio:``};function lu(e){let t={...cu},n=(t,n)=>e.getAttribute(t)||n;return t.width=n(`width`,null),t.height=n(`height`,null),t.rotate=au(n(`rotate`,``)),su(t,n(`flip`,``)),t.preserveAspectRatio=n(`preserveAspectRatio`,n(`preserveaspectratio`,``)),t}function uu(e,t){for(let n in cu)if(e[n]!==t[n])return!0;return!1}var du=/^[a-z0-9]+(-[a-z0-9]+)*$/,fu=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!pu(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!pu(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!pu(e,n)?null:e}return null},pu=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function mu(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function hu(e,t){let n=mu(e,t);for(let r in nu)r in eu?r in e&&!(r in n)&&(n[r]=eu[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function gu(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}function _u(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=hu(r[e]||i[e],a)}return o(t),n.forEach(o),hu(e,a)}function vu(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=gu(e);for(let i in r){let a=r[i];a&&(t(i,_u(e,i,a)),n.push(i))}return n}var yu={provider:``,aliases:{},not_found:{},...$l};function bu(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function xu(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!bu(e,yu))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!bu(t,nu))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!bu(t,nu))return null}return t}var Su=Object.create(null);function Cu(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function wu(e,t){let n=Su[e]||(Su[e]=Object.create(null));return n[t]||(n[t]=Cu(e,t))}function Tu(e,t){return xu(t)?vu(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function Eu(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}function Du(e,t){let n=[];return(typeof e==`string`?[e]:Object.keys(Su)).forEach(e=>{(typeof e==`string`&&typeof t==`string`?[t]:Object.keys(Su[e]||{})).forEach(t=>{let r=wu(e,t);n=n.concat(Object.keys(r.icons).map(n=>(e===``?``:`@`+e+`:`)+t+`:`+n))})}),n}var Ou=!1;function ku(e){return typeof e==`boolean`&&(Ou=e),Ou}function Au(e){let t=typeof e==`string`?fu(e,!0,Ou):e;if(t){let e=wu(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function ju(e,t){let n=fu(e,!0,Ou);if(!n)return!1;let r=wu(n.provider,n.prefix);return t?Eu(r,n.name,t):(r.missing.add(n.name),!0)}function Mu(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),Ou&&!t&&!e.prefix){let t=!1;return xu(e)&&(e.prefix=``,vu(e,(e,n)=>{ju(e,n)&&(t=!0)})),t}let n=e.prefix;return pu({provider:t,prefix:n,name:`a`})?!!Tu(wu(t,n),e):!1}function Nu(e){return!!Au(e)}function Pu(e){let t=Au(e);return t&&{...tu,...t}}function Fu(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=wu(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function Iu(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Lu(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||Iu([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ru=0;function zu(e,t,n){let r=Ru++,i=Iu.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}var Bu=Object.create(null);function Vu(e,t){Bu[e]=t}function Hu(e){return Bu[e]||Bu[``]}function Uu(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?fu(e,t,n):e;i&&r.push(i)}),r}var Wu={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Gu(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function Ku(e){let t={...Wu,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Gu(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function qu(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var Ju=Object.create(null),Yu=[`https://api.simplesvg.com`,`https://api.unisvg.com`],Xu=[];Yu.length>0;)Yu.length===1||Math.random()>.5?Xu.push(Yu.shift()):Xu.push(Yu.pop());Ju[``]=qu({resources:[`https://api.iconify.design`].concat(Xu)});function Zu(e,t){let n=qu(t);return n!==null&&(Ju[e]=n,!0)}function Qu(e){return Ju[e]}function $u(){return Object.keys(Ju)}function ed(){}var td=Object.create(null);function nd(e){if(!td[e]){let t=Qu(e);if(!t)return;td[e]={config:t,redundancy:Ku(t)}}return td[e]}function rd(e,t,n){let r,i;if(typeof e==`string`){let t=Hu(e);if(!t)return n(void 0,424),ed;i=t.send;let a=nd(e);a&&(r=a.redundancy)}else{let t=qu(e);if(t){r=Ku(t);let n=Hu(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),ed):r.query(t,i,n)().abort}function id(){}function ad(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Lu(e)}))}function od(e){let t=[],n=[];return e.forEach(e=>{(e.match(du)?t:n).push(e)}),{valid:t,invalid:n}}function sd(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!Tu(e,n).length){r();return}}catch(e){console.error(e)}r(),ad(e)}function cd(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function ld(e,t){e.iconsToLoad=e.iconsToLoad?e.iconsToLoad.concat(t).sort():t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){cd(e.loadIcons(r,n,t),t=>{sd(e,r,t)});return}if(i){r.forEach(r=>{cd(i(r,n,t),t=>{sd(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=od(r);if(o.length&&sd(e,o,null),!a.length)return;let s=n.match(du)?Hu(t):null;if(!s){sd(e,a,null);return}s.prepare(t,n,a).forEach(n=>{rd(t,n,t=>{sd(e,n.icons,t)})})}))}var ud=(e,t)=>{let n=Fu(Uu(e,!0,ku()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,id)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(wu(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=wu(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&ld(e,t)}),t?zu(t,n,i):id},dd=e=>new Promise((t,n)=>{let r=typeof e==`string`?fu(e,!0):e;if(!r){n(e);return}ud([r||e],i=>{if(i.length&&r){let e=Au(r);if(e){t({...tu,...e});return}}n(e)})});function fd(e){try{let t=typeof e==`string`?JSON.parse(e):e;if(typeof t.body==`string`)return{...t}}catch{}}function pd(e,t){if(typeof e==`object`)return{data:fd(e),value:e};if(typeof e!=`string`)return{value:e};if(e.includes(`{`)){let t=fd(e);if(t)return{data:t,value:e}}let n=fu(e,!0,!0);if(!n)return{value:e};let r=Au(n);return r!==void 0||!n.prefix?{value:e,name:n,data:r}:{value:e,name:n,loading:ud([n],()=>t(e,n,Au(n)))}}var md=!1;try{md=navigator.vendor.indexOf(`Apple`)===0}catch{}function hd(e,t){switch(t){case`svg`:case`bg`:case`mask`:return t}return t!==`style`&&(md||e.indexOf(`<a`)===-1)?`svg`:e.indexOf(`currentColor`)===-1?`bg`:`mask`}var gd=/(-?[0-9.]*[0-9]+[0-9.]*)/g,_d=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function vd(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(gd);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=_d.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function yd(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function bd(e,t){return e?`<defs>`+e+`</defs>`+t:t}function xd(e,t,n){let r=yd(e);return bd(r.defs,t+r.content+n)}var Sd=e=>e===`unset`||e===`undefined`||e===`none`;function Cd(e,t){let n={...tu,...e},r={...iu,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=xd(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=vd(d,c/l)):(u=o===`auto`?c:o,d=s===null?vd(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Sd(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}function wd(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Td(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Ed(e){return`data:image/svg+xml,`+Td(e)}function Dd(e){return`url("`+Ed(e)+`")`}var Od=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function kd(e){Od=e}function Ad(){return Od}function jd(e,t){let n=Qu(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function Md(e){return e===404}var Nd=(e,t,n)=>{let r=[],i=jd(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Pd(e){if(typeof e==`string`){let t=Qu(e);if(t)return t.path}return`/`}var Fd={prepare:Nd,send:(e,t,n)=>{if(!Od){n(`abort`,424);return}let r=Pd(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;Od(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Md(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function Id(e,t,n){wu(n||``,t).loadIcons=e}function Ld(e,t,n){wu(n||``,t).loadIcon=e}var Rd=`data-style`,zd=``;function Bd(e){zd=e}function Vd(e,t){let n=Array.from(e.childNodes).find(e=>e.hasAttribute&&e.hasAttribute(Rd));n||(n=document.createElement(`style`),n.setAttribute(Rd,Rd),e.appendChild(n)),n.textContent=`:host{display:inline-block;vertical-align:`+(t?`-0.125em`:`0`)+`}span,svg{display:block;margin:auto}`+zd}function Hd(){Vu(``,Fd),ku(!0);let e;try{e=window}catch{}if(e){if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!Mu(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Zu(e,r)||console.error(n)}catch{console.error(n)}}}}return{enableCache:e=>{},disableCache:e=>{},iconLoaded:Nu,iconExists:Nu,getIcon:Pu,listIcons:Du,addIcon:ju,addCollection:Mu,calculateSize:vd,buildIcon:Cd,iconToHTML:wd,svgToURL:Dd,loadIcons:ud,loadIcon:dd,addAPIProvider:Zu,setCustomIconLoader:Ld,setCustomIconsLoader:Id,appendCustomStyle:Bd,_api:{getAPIConfig:Qu,setAPIModule:Vu,sendAPIQuery:rd,setFetch:kd,getFetch:Ad,listAPIProviders:$u}}}var Ud={"background-color":`currentColor`},Wd={"background-color":`transparent`},Gd={image:`var(--svg)`,repeat:`no-repeat`,size:`100% 100%`},Kd={"-webkit-mask":Ud,mask:Ud,background:Wd};for(let e in Kd){let t=Kd[e];for(let n in Gd)t[e+`-`+n]=Gd[n]}function qd(e){return e?e+(e.match(/^[-0-9.]+$/)?`px`:``):`inherit`}function Jd(e,t,n){let r=document.createElement(`span`),i=e.body;i.indexOf(`<a`)!==-1&&(i+=`<!-- `+Date.now()+` -->`);let a=e.attributes,o=Dd(wd(i,{...a,width:t.width+``,height:t.height+``})),s=r.style,c={"--svg":o,width:qd(a.width),height:qd(a.height),...n?Ud:Wd};for(let e in c)s.setProperty(e,c[e]);return r}var Yd;function Xd(){try{Yd=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{Yd=null}}function Zd(e){return Yd===void 0&&Xd(),Yd?Yd.createHTML(e):e}function Qd(e){let t=document.createElement(`span`),n=e.attributes,r=``;return n.width||(r=`width: inherit;`),n.height||(r+=`height: inherit;`),r&&(n.style=r),t.innerHTML=Zd(wd(e.body,n)),t.firstChild}function $d(e){return Array.from(e.childNodes).find(e=>{let t=e.tagName&&e.tagName.toUpperCase();return t===`SPAN`||t===`SVG`})}function ef(e,t){let n=t.icon.data,r=t.customisations,i=Cd(n,r);r.preserveAspectRatio&&(i.attributes.preserveAspectRatio=r.preserveAspectRatio);let a=t.renderedMode,o;switch(a){case`svg`:o=Qd(i);break;default:o=Jd(i,{...tu,...n},a===`mask`)}let s=$d(e);s?o.tagName===`SPAN`&&s.tagName===o.tagName?s.setAttribute(`style`,o.getAttribute(`style`)):e.replaceChild(o,s):e.appendChild(o)}function tf(e,t,n){return{rendered:!1,inline:t,icon:e,lastRender:n&&(n.rendered?n:n.lastRender)}}function nf(e=`iconify-icon`){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;let r=t.get(e);if(r)return r;let i=[`icon`,`mode`,`inline`,`noobserver`,`width`,`height`,`rotate`,`flip`],a=class extends n{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();let e=this._shadowRoot=this.attachShadow({mode:`open`}),t=this.hasAttribute(`inline`);Vd(e,t),this._state=tf({value:``},t),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return i.slice(0)}attributeChangedCallback(e){switch(e){case`inline`:{let e=this.hasAttribute(`inline`),t=this._state;e!==t.inline&&(t.inline=e,Vd(this._shadowRoot,e));break}case`noobserver`:this.hasAttribute(`noobserver`)?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){let e=this.getAttribute(`icon`);if(e&&e.slice(0,1)===`{`)try{return JSON.parse(e)}catch{}return e}set icon(e){typeof e==`object`&&(e=JSON.stringify(e)),this.setAttribute(`icon`,e)}get inline(){return this.hasAttribute(`inline`)}set inline(e){e?this.setAttribute(`inline`,`true`):this.removeAttribute(`inline`)}get observer(){return this.hasAttribute(`observer`)}set observer(e){e?this.setAttribute(`observer`,`true`):this.removeAttribute(`observer`)}restartAnimation(){let e=this._state;if(e.rendered){let t=this._shadowRoot;if(e.renderedMode===`svg`)try{t.lastChild.setCurrentTime(0);return}catch{}ef(t,e)}}get status(){let e=this._state;return e.rendered?`rendered`:e.icon.data===null?`failed`:`loading`}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;let e=this._state,t=this.getAttribute(`icon`);if(t!==e.icon.value){this._iconChanged(t);return}if(!e.rendered||!this._visible)return;let n=this.getAttribute(`mode`),r=lu(this);(e.attrMode!==n||uu(e.customisations,r)||!$d(this._shadowRoot))&&this._renderIcon(e.icon,r,n)}_iconChanged(e){let t=pd(e,(e,t,n)=>{let r=this._state;if(r.rendered||this.getAttribute(`icon`)!==e)return;let i={value:e,name:t,data:n};i.data?this._gotIconData(i):r.icon=i});t.data?this._gotIconData(t):this._state=tf(t,this._state.inline,this._state)}_forceRender(){if(!this._visible){let e=$d(this._shadowRoot);e&&this._shadowRoot.removeChild(e);return}this._queueCheck()}_gotIconData(e){this._checkQueued=!1,this._renderIcon(e,lu(this),this.getAttribute(`mode`))}_renderIcon(e,t,n){let r=hd(e.data.body,n),i=this._state.inline;ef(this._shadowRoot,this._state={rendered:!0,icon:e,inline:i,customisations:t,attrMode:n,renderedMode:r})}startObserver(){if(!this._observer&&!this.hasAttribute(`noobserver`))try{this._observer=new IntersectionObserver(e=>{let t=e.some(e=>e.isIntersecting);t!==this._visible&&(this._visible=t,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};i.forEach(e=>{e in a.prototype||Object.defineProperty(a.prototype,e,{get:function(){return this.getAttribute(e)},set:function(t){t===null?this.removeAttribute(e):this.setAttribute(e,t)}})});let o=Hd();for(let e in o)a[e]=a.prototype[e]=o[e];return t.define(e,a),a}var{enableCache:rf,disableCache:af,iconLoaded:of,iconExists:sf,getIcon:cf,listIcons:lf,addIcon:uf,addCollection:df,calculateSize:ff,buildIcon:pf,iconToHTML:mf,svgToURL:hf,loadIcons:gf,loadIcon:_f,setCustomIconLoader:vf,setCustomIconsLoader:yf,addAPIProvider:bf,_api:xf}=nf()||Hd(),Sf=()=>((0,q.c)(1),null),Cf=(0,G.memo)(e=>{let t=(0,q.c)(3),{children:n}=e,{theme:r}=zo(),i,a;return t[0]===r?(i=t[1],a=t[2]):(i=()=>(document.body.classList.add(r,`${r}-theme`),document.body.dataset.theme=r,()=>{document.body.classList.remove(r,`${r}-theme`),delete document.body.dataset.theme}),a=[r],t[0]=r,t[1]=i,t[2]=a),(0,G.useLayoutEffect)(i,a),n});Cf.displayName=`ThemeProvider`;var wf=e=>{let t=(0,q.c)(3),{variables:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,K.jsx)(`div`,{className:`contents`,style:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i},Tf=()=>{let e=(0,q.c)(25),[t,r]=n(It);if(t===null)return null;let i;e[0]===t?i=e[1]:(i=async()=>{try{await navigator.clipboard.writeText(t),No({title:`Copied to clipboard`,description:`Error details have been copied to your clipboard.`})}catch{No({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},e[0]=t,e[1]=i);let a=i,o;e[2]===r?o=e[3]:(o=()=>{r(null)},e[2]=r,e[3]=o);let s=o,c=Ef,l;e[4]===s?l=e[5]:(l=e=>!e&&s(),e[4]=s,e[5]=l);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsxs)(tr,{children:[(0,K.jsxs)(rr,{className:`flex items-center gap-2 text-destructive`,children:[(0,K.jsx)(We,{className:`h-5 w-5`}),`Kernel Startup Failed`]}),(0,K.jsx)(er,{children:`The kernel failed to start. This usually happens when the package manager can't install your notebook's dependencies.`})]}),e[6]=u):u=e[6];let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Error Details`}),e[7]=d):d=e[7];let f;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(Za,{className:`h-3 w-3`}),e[8]=f):f=e[8];let p;e[9]===a?p=e[10]:(p=(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[d,(0,K.jsxs)(Yi,{variant:`outline`,size:`xs`,onClick:a,className:`flex items-center gap-1`,children:[f,`Copy`]})]}),e[9]=a,e[10]=p);let m;e[11]===t?m=e[12]:(m=(0,K.jsx)(`pre`,{className:`bg-muted p-4 rounded-md text-sm font-mono overflow-auto max-h-80`,children:t}),e[11]=t,e[12]=m);let h;e[13]!==p||e[14]!==m?(h=(0,K.jsxs)(`div`,{className:`my-4 overflow-hidden`,children:[p,m]}),e[13]=p,e[14]=m,e[15]=h):h=e[15];let g;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,K.jsxs)(Yi,{variant:`outline`,onClick:c,className:`flex items-center gap-2`,children:[(0,K.jsx)(ro,{className:`h-4 w-4`}),`Return to Home`]}),e[16]=g):g=e[16];let _;e[17]===s?_=e[18]:(_=(0,K.jsxs)(ar,{children:[g,(0,K.jsx)(ir,{onClick:s,children:`Dismiss`})]}),e[17]=s,e[18]=_);let v;e[19]!==_||e[20]!==h?(v=(0,K.jsxs)(nr,{className:`max-w-2xl`,children:[u,h,_]}),e[19]=_,e[20]=h,e[21]=v):v=e[21];let y;return e[22]!==v||e[23]!==l?(y=(0,K.jsx)(or,{open:!0,onOpenChange:l,children:v}),e[22]=v,e[23]=l,e[24]=y):y=e[24],y};function Ef(){let e=document.baseURI.split(`?`)[0];window.open(e,`_self`)}var Df=e=>{let t=(0,q.c)(30),{isOpen:n,onClose:r,traceback:i,errorMessage:a}=e,o;t[0]===i?o=t[1]:(o=async()=>{let e=document.createElement(`div`);e.innerHTML=Le(i);let t=e.textContent||e.innerText||``;try{await navigator.clipboard.writeText(t),No({title:`Copied to clipboard`,description:`Traceback has been copied to your clipboard.`})}catch{No({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},t[0]=i,t[1]=o);let s=o,c;t[2]===r?c=t[3]:(c=e=>!e&&r(),t[2]=r,t[3]=c);let l;t[4]===a?l=t[5]:(l=(0,K.jsx)(rr,{className:`text-destructive`,children:a}),t[4]=a,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(er,{children:`Click the traceback to select and copy.`}),t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,K.jsxs)(tr,{children:[l,u]}),t[7]=l,t[8]=d);let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Traceback`}),t[9]=f):f=t[9];let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(Za,{className:`h-3 w-3`}),t[10]=p):p=t[10];let m;t[11]===s?m=t[12]:(m=(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[f,(0,K.jsxs)(Yi,{variant:`outline`,size:`xs`,onClick:s,className:`flex items-center gap-1`,children:[p,`Copy`]})]}),t[11]=s,t[12]=m);let h;t[13]===i?h=t[14]:(h=$o({html:i}),t[13]=i,t[14]=h);let g;t[15]===h?g=t[16]:(g=(0,K.jsx)(`div`,{className:`font-code text-sm p-4 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text`,children:h}),t[15]=h,t[16]=g);let _;t[17]!==g||t[18]!==m?(_=(0,K.jsxs)(`div`,{className:`my-4 overflow-auto`,children:[m,g]}),t[17]=g,t[18]=m,t[19]=_):_=t[19];let v;t[20]===r?v=t[21]:(v=(0,K.jsx)(ar,{children:(0,K.jsx)(ir,{onClick:r,children:`Close`})}),t[20]=r,t[21]=v);let y;t[22]!==_||t[23]!==v||t[24]!==d?(y=(0,K.jsxs)(nr,{className:`max-w-4xl max-h-[80vh]`,children:[d,_,v]}),t[22]=_,t[23]=v,t[24]=d,t[25]=y):y=t[25];let b;return t[26]!==n||t[27]!==y||t[28]!==c?(b=(0,K.jsx)(or,{open:n,onOpenChange:c,children:y}),t[26]=n,t[27]=y,t[28]=c,t[29]=b):b=t[29],b},Of=()=>{let e=(0,q.c)(6),[t,r]=n(Ke);if(!t)return null;let i;e[0]===r?i=e[1]:(i=()=>r(null),e[0]=r,e[1]=i);let a;return e[2]!==i||e[3]!==t.errorMessage||e[4]!==t.traceback?(a=(0,K.jsx)(Df,{isOpen:!0,onClose:i,traceback:t.traceback,errorMessage:t.errorMessage}),e[2]=i,e[3]=t.errorMessage,e[4]=t.traceback,e[5]=a):a=e[5],a},kf=()=>{let e=(0,q.c)(5),{toasts:t}=Mo(),n;e[0]===t?n=e[1]:(n=t.map(Mf),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(Af,{}),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,K.jsxs)(I,{children:[n,r]}),e[3]=n,e[4]=i),i},Af=Ln(({container:e})=>(0,Ps.createPortal)((0,K.jsx)(In,{children:(0,K.jsx)(Ee,{})}),e??document.body)),jf=e=>{let t=(0,q.c)(23),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({toastTitle:a,toastDescription:i,action:n,variant:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=(0,G.useRef)(null),c=!!i&&!n&&o===`danger`,u;t[6]===a?u=t[7]:(u=a&&(0,K.jsx)(l,{children:a}),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=i&&(0,K.jsx)(ge,{ref:s,children:i}),t[8]=i,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,K.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[u,d]}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==c||t[14]!==i?(p=c&&(0,K.jsx)(Qo,{tooltip:`Copy error`,ariaLabel:`Copy error`,className:`h-4 w-4`,buttonClassName:W(`absolute right-8 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity`,`hover:text-foreground focus:opacity-100 focus:outline-hidden group-hover:opacity-100`,`group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-500 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600`),value:()=>s.current?.innerText??(typeof i==`string`?i:``)}),t[13]=c,t[14]=i,t[15]=p):p=t[15];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(fe,{}),t[16]=m):m=t[16];let h;return t[17]!==n||t[18]!==r||t[19]!==f||t[20]!==p||t[21]!==o?(h=(0,K.jsxs)(pe,{variant:o,...r,children:[f,n,p,m]}),t[17]=n,t[18]=r,t[19]=f,t[20]=p,t[21]=o,t[22]=h):h=t[22],h};function Mf(e){let{id:t,title:n,description:r,action:i,variant:a,...o}=e;return(0,K.jsx)(jf,{toastTitle:n,toastDescription:r,action:i,variant:a,...o},t)}var Nf=e=>{let t=(0,q.c)(5),{children:n}=e,i=r(Qt),a;t[0]===i?a=t[1]:(a=Qr(i),t[0]=i,t[1]=a);let o;return t[2]!==n||t[3]!==a?(o=(0,K.jsx)(Bo,{locale:a,children:n}),t[2]=n,t[3]=a,t[4]=o):o=t[4],o},Pf=Wa(()=>jo(()=>import(`./home-page-Chy6SA41.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127]),import.meta.url)),Ff=Wa(()=>jo(()=>import(`./run-page-DXZapRtY.js`),__vite__mapDeps([128,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,129,74,92,75,76,130,94,131,132,133,78,79,80,134,108,135,136,137,93,138,82,89,139,140,104,141,90,142,143,144,145,109,110,146,147,148,106,149,119,120,121,150,151,152,153,154,122,155,95,156,111,157,158,112,159,160,161,162,163,100,164,103,165,166,167,168,169,170,171,172,173,86,174,113,175,107,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,125]),import.meta.url)),If=Wa(()=>jo(()=>import(`./edit-page-DxMQN491.js`),__vite__mapDeps([286,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,163,100,164,103,94,165,93,79,108,166,95,167,134,132,135,136,137,143,144,145,168,169,170,99,101,102,104,92,75,76,89,80,105,106,107,109,110,111,112,113,114,115,74,129,130,131,133,78,138,82,139,140,141,90,142,146,147,148,149,119,120,121,150,151,152,153,154,122,155,156,157,158,159,160,171,172,173,86,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,161,287,288,289,88,123,290,291,292,293,294,85,295,87,296,124,297,116,298,299,300,301,125,126,302,127,283,303,304,97,305,306,83,84,307,308,281,309,310,311,282,117,118,312,313,162,284,285,98,314,315,316,317,318,319,320,321,322,323]),import.meta.url)),Lf=Wa(()=>jo(()=>import(`./gallery-page-4dZlIWMe.js`),__vite__mapDeps([324,1,3,4,74,21,14,30,12,13,24,25,48,2,15,89,33,54,6,26,34,35,55,41,40,56,8,9,10,11,69,23,71,94,7,111,29,115]),import.meta.url));function Rf(e){switch(e){case`home`:Pf.preload();break;case`gallery`:Lf.preload();break;case`read`:Ff.preload();break;default:If.preload()}}var zf=(0,G.memo)(()=>{let e=(0,q.c)(12),[t]=Ut(),[n]=Jt(),r;e[0]===t.display.code_editor_font_size?r=e[1]:(r=Vf(t.display.code_editor_font_size),e[0]=t.display.code_editor_font_size,e[1]=r);let i=r,a;e[2]!==n||e[3]!==t?(a=()=>{let e=nn();return e===`home`?(0,K.jsx)(Pf.Component,{}):e===`gallery`?(0,K.jsx)(Lf.Component,{}):e===`read`?(0,K.jsx)(Ff.Component,{appConfig:n}):(0,K.jsx)(If.Component,{userConfig:t,appConfig:n})},e[2]=n,e[3]=t,e[4]=a):a=e[4];let o=a,s;e[5]===i?s=e[6]:(s={"--marimo-code-editor-font-size":i},e[5]=i,e[6]=s);let c;e[7]===o?c=e[8]:(c=(0,K.jsx)(Nf,{children:o()}),e[7]=o,e[8]=c);let l;return e[9]!==s||e[10]!==c?(l=(0,K.jsx)(Bf,{children:(0,K.jsx)(wf,{variables:s,children:c})}),e[9]=s,e[10]=c,e[11]=l):l=e[11],l});zf.displayName=`MarimoApp`;var Bf=(0,G.memo)(e=>{let t=(0,q.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(kf,{}),i=(0,K.jsx)(Sf,{}),a=(0,K.jsx)(Tf,{}),o=(0,K.jsx)(Of,{}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):(r=t[0],i=t[1],a=t[2],o=t[3]);let s;return t[4]===n?s=t[5]:(s=(0,K.jsx)(En,{children:(0,K.jsx)(G.Suspense,{children:(0,K.jsx)(Ui,{children:(0,K.jsx)(ji,{controller:Ni,children:(0,K.jsx)(Nf,{children:(0,K.jsxs)(co,{children:[n,r,i,a,o]})})})})})}),t[4]=n,t[5]=s),s});Bf.displayName=`Providers`;function Vf(e){return`${e/16}rem`}function Hf(){Ro(e=>{e.delete($t.accessToken)})}var Uf={sendComponentValues:`startConnection`,sendModelValue:`startConnection`,sendInstantiate:`startConnectionWithoutKernel`,sendRun:`startConnection`,sendDeleteCell:`startConnection`,sendRunScratchpad:`startConnection`,saveAppConfig:`startConnection`,saveCellConfig:`startConnection`,discoverDataSources:`startConnection`,exportAsHTML:`startConnection`,exportAsIPYNB:`startConnection`,exportAsMarkdown:`startConnection`,exportAsScript:`startConnection`,exportAsPDF:`startConnection`,readCode:`startConnection`,sendCopy:`throwError`,sendFormat:`throwError`,sendRestart:`throwError`,sendSave:`waitForConnectionOpen`,invokeAiTool:`waitForConnectionOpen`,sendFunctionRequest:`waitForConnectionOpen`,sendRename:`waitForConnectionOpen`,autoExportAsHTML:`waitForConnectionOpen`,autoExportAsMarkdown:`waitForConnectionOpen`,autoExportAsIPYNB:`waitForConnectionOpen`,updateCellOutputs:`waitForConnectionOpen`,listSecretKeys:`throwError`,writeSecret:`throwError`,clearCache:`throwError`,getCacheInfo:`throwError`,saveUserConfig:`throwError`,sendShutdown:`throwError`,getPackageList:`throwError`,getDependencyTree:`throwError`,addPackage:`throwError`,removePackage:`throwError`,sendListFiles:`startConnection`,sendSearchFiles:`startConnection`,sendCreateFileOrFolder:`throwError`,sendDeleteFileOrFolder:`throwError`,sendCopyFileOrFolder:`throwError`,sendRenameFileOrFolder:`throwError`,sendUpdateFile:`throwError`,sendFileDetails:`throwError`,openFile:`throwError`,getEnvironmentInfo:`serverOnly`,getExportAvailability:`serverOnly`,installExportRequirements:`startConnectionWithoutKernel`,getRecentFiles:`startConnection`,getWorkspaceFiles:`startConnection`,getRunningNotebooks:`startConnection`,shutdownSession:`startConnection`,openTutorial:`startConnection`,getUsageStats:`waitForConnectionOpen`,sendStdin:`waitForConnectionOpen`,sendInterrupt:`waitForConnectionOpen`,sendPdb:`waitForConnectionOpen`,sendSetBreakpoints:`waitForConnectionOpen`,sendInstallMissingPackages:`waitForConnectionOpen`,readSnippets:`waitForConnectionOpen`,previewDatasetColumn:`waitForConnectionOpen`,previewSQLTable:`waitForConnectionOpen`,previewSQLTableList:`waitForConnectionOpen`,previewSQLSchemaList:`waitForConnectionOpen`,previewDataSourceConnection:`waitForConnectionOpen`,validateSQL:`waitForConnectionOpen`,listStorageEntries:`waitForConnectionOpen`,downloadStorage:`waitForConnectionOpen`,sendDocumentTransaction:`waitForConnectionOpen`,sendCodeCompletionRequest:`waitForConnectionOpen`};function Wf(e,t){let n=na(async e=>{a.set(hn,{state:sn.CONNECTING}),await e.init()});function r(e,r){let i=Uf[r];return(async(...a)=>{let o=t();if(!o.isLazy)return e(...a);switch(i){case`serverOnly`:return e(...a);case`dropRequest`:U.debug(`Dropping request: ${r}, since not connected to a kernel.`);return;case`throwError`:throw new ts;case`waitForConnectionOpen`:return await on(),await Sn(),e(...a);case`startConnectionWithoutKernel`:case`startConnection`:return await n(o),await on(),i===`startConnection`&&await Sn(),e(...a);default:throw Error(`Unknown action for "${r}"`)}})}return Vt.mapValues(e,(e,t)=>r(e,t))}var Gf=`download`;function Kf(){let e=a.get(Oe);if(!e)return;let t=Po.basename(e);return Bi.withoutExtension(t)}function qf(e){let t=Kf();return t?`${t}.${e}`:`${Gf}.${e}`}function Jf(e){let t=io[e??`pymdown`];return qf(t)}function Yf(e){return{body:e,bodySerializer:e=>e}}var{handleExportResponse:Xf,handleResponse:Zf,handleResponseReturnNull:Qf}=vn;function $f(){let e=ta(()=>{let e=fn();return bn(e)}),t=()=>fn().sessionHeaders(),n=()=>({header:t()});return{sendComponentValues:t=>e().POST(`/api/kernel/set_ui_element_value`,{body:t,params:n()}).then(Qf),sendModelValue:t=>e().POST(`/api/kernel/set_model_value`,{body:t,params:n()}).then(Qf),sendRestart:()=>e().POST(`/api/kernel/restart_session`,{params:n()}).then(Qf),sendDocumentTransaction:async t=>(await on(),e().POST(`/api/document/transaction`,{body:t,params:n()}).then(Qf)),sendRename:t=>e().POST(`/api/kernel/rename`,{body:t,params:n()}).then(Qf),sendSave:t=>e().POST(`/api/kernel/save`,{body:t,parseAs:`text`,params:n()}).then(Qf),sendCopy:t=>e().POST(`/api/kernel/copy`,{body:t,parseAs:`text`,params:n()}).then(Qf),sendFormat:t=>e().POST(`/api/kernel/format`,{body:t}).then(Zf),sendInterrupt:()=>e().POST(`/api/kernel/interrupt`,{params:n()}).then(Qf),sendShutdown:()=>e().POST(`/api/kernel/shutdown`).then(Qf),sendRun:async t=>(await on(),e().POST(`/api/kernel/run`,{body:t,params:n()}).then(Qf)),sendRunScratchpad:async t=>(await on(),e().POST(`/api/kernel/scratchpad/run`,{body:t,params:n()}).then(Qf)),sendInstantiate:async t=>(await on(),e().POST(`/api/kernel/instantiate`,{body:t,params:n()}).then(Qf)),sendDeleteCell:t=>e().POST(`/api/kernel/delete`,{body:t,params:n()}).then(Qf),sendCodeCompletionRequest:async t=>(await on(),e().POST(`/api/kernel/code_autocomplete`,{body:t,params:n()}).then(Qf)),saveUserConfig:t=>e().POST(`/api/kernel/save_user_config`,{body:t}).then(Qf),saveAppConfig:t=>e().POST(`/api/kernel/save_app_config`,{body:t,parseAs:`text`,params:n()}).then(Qf),saveCellConfig:t=>e().POST(`/api/kernel/set_cell_config`,{body:t,params:n()}).then(Qf),sendFunctionRequest:t=>e().POST(`/api/kernel/function_call`,{body:t,params:n()}).then(Qf),sendStdin:t=>e().POST(`/api/kernel/stdin`,{body:t,params:n()}).then(Qf),sendInstallMissingPackages:t=>e().POST(`/api/kernel/install_missing_packages`,{body:t,params:n()}).then(Qf),readCode:async()=>(await on(),e().POST(`/api/kernel/read_code`,{params:n()}).then(Zf)),readSnippets:async()=>(await on(),e().GET(`/api/documentation/snippets`,{params:n()}).then(Zf)),previewDatasetColumn:t=>e().POST(`/api/datasources/preview_column`,{body:t,params:n()}).then(Qf),previewSQLTable:t=>e().POST(`/api/datasources/preview_sql_table`,{body:t,params:n()}).then(Qf),previewSQLTableList:t=>e().POST(`/api/datasources/preview_sql_table_list`,{body:t,params:n()}).then(Qf),previewSQLSchemaList:t=>e().POST(`/api/datasources/preview_sql_schema_list`,{body:t,params:n()}).then(Qf),previewDataSourceConnection:t=>e().POST(`/api/datasources/preview_datasource_connection`,{body:t,params:n()}).then(Qf),discoverDataSources:t=>e().POST(`/api/datasources/discover`,{body:t,params:n()}).then(Qf),validateSQL:t=>e().POST(`/api/sql/validate`,{body:t,params:n()}).then(Qf),openFile:async t=>(await on(),await e().POST(`/api/files/open`,{body:t}).then(Qf),null),getUsageStats:async()=>(await on(),e().GET(`/api/usage`).then(Zf)),getEnvironmentInfo:()=>e().GET(`/api/environment`).then(Zf),sendPdb:t=>e().POST(`/api/kernel/pdb/pm`,{body:t,params:n()}).then(Qf),sendSetBreakpoints:t=>e().POST(`/api/kernel/pdb/breakpoints`,{body:t,params:n()}).then(Qf),sendListFiles:async t=>(await on(),e().POST(`/api/files/list_files`,{body:t}).then(Zf)),sendSearchFiles:async t=>(await on(),e().POST(`/api/files/search`,{body:t}).then(Zf)),sendCreateFileOrFolder:async t=>{await on();let n=new FormData;return n.append(`path`,t.path),n.append(`type`,t.type),n.append(`name`,t.name),t.file&&n.append(`file`,t.file,t.name),e().POST(`/api/files/create`,Yf(n)).then(Zf)},sendDeleteFileOrFolder:async t=>e().POST(`/api/files/delete`,{body:t}).then(Zf),sendCopyFileOrFolder:async t=>e().POST(`/api/files/copy`,{body:t}).then(Zf),sendRenameFileOrFolder:async t=>e().POST(`/api/files/move`,{body:t}).then(Zf),sendUpdateFile:async t=>(await on(),e().POST(`/api/files/update`,{body:t}).then(Zf)),sendFileDetails:async t=>(await on(),e().POST(`/api/files/file_details`,{body:t}).then(Zf)),openTutorial:t=>e().POST(`/api/home/tutorial/open`,{body:t}).then(Zf),getRecentFiles:()=>e().POST(`/api/home/recent_files`).then(Zf),getWorkspaceFiles:t=>e().POST(`/api/home/workspace_files`,{body:t}).then(Zf),getRunningNotebooks:()=>e().POST(`/api/home/running_notebooks`).then(Zf),shutdownSession:t=>e().POST(`/api/home/shutdown_session`,{body:t}).then(Zf),getExportAvailability:()=>e().GET(`/api/export/availability`).then(Zf),installExportRequirements:t=>e().POST(`/api/export/requirements/install`,{body:t,params:n()}).then(Zf),exportAsHTML:async t=>e().POST(`/api/export/html`,{body:t,parseAs:`text`,params:n()}).then(e=>Xf(e,{defaultFilename:qf(`html`)})),exportAsMarkdown:async t=>e().POST(`/api/export/markdown`,{body:t,parseAs:`text`,params:n()}).then(e=>Xf(e,{defaultFilename:Jf(t.flavor)})),exportAsScript:async t=>e().POST(`/api/export/script`,{body:t,parseAs:`text`,params:n()}).then(e=>Xf(e,{defaultFilename:qf(`script.py`)})),exportAsIPYNB:async t=>e().POST(`/api/export/ipynb`,{body:t,parseAs:`text`,params:n()}).then(e=>Xf(e,{defaultFilename:qf(`ipynb`)})),exportAsPDF:async t=>e().POST(`/api/export/pdf`,{body:t,parseAs:`blob`,params:n()}).then(e=>Xf(e,{defaultFilename:qf(`pdf`)})),autoExportAsHTML:async t=>e().POST(`/api/export/auto_export/html`,{body:t,params:n()}).then(Qf),autoExportAsMarkdown:async t=>e().POST(`/api/export/auto_export/markdown`,{body:t,params:n()}).then(Qf),autoExportAsIPYNB:async t=>e().POST(`/api/export/auto_export/ipynb`,{body:t,params:n()}).then(Qf),updateCellOutputs:async t=>e().POST(`/api/export/update_cell_outputs`,{body:t,params:n()}).then(Qf),addPackage:t=>e().POST(`/api/packages/add`,{body:t}).then(Zf),removePackage:t=>e().POST(`/api/packages/remove`,{body:t}).then(Zf),getPackageList:async()=>(await en(),e().GET(`/api/packages/list`).then(Zf)),getDependencyTree:async()=>(await en(),e().GET(`/api/packages/tree`).then(Zf)),listSecretKeys:async t=>(await on(),e().POST(`/api/secrets/keys`,{body:t,params:n()}).then(Qf)),writeSecret:async t=>e().POST(`/api/secrets/create`,{body:t,params:n()}).then(Qf),invokeAiTool:async t=>e().POST(`/api/ai/invoke_tool`,{body:t,params:n()}).then(Zf),clearCache:async()=>e().POST(`/api/cache/clear`,{body:{},params:n()}).then(Qf),getCacheInfo:async()=>e().POST(`/api/cache/info`,{body:{},params:n()}).then(Qf),listStorageEntries:t=>e().POST(`/api/storage/list_entries`,{body:t,params:n()}).then(Qf),downloadStorage:t=>e().POST(`/api/storage/download`,{body:t,params:n()}).then(Qf)}}var ep=`static-notebook`;function tp(){No({id:ep,once:!0,title:`Static notebook`,description:`This notebook is not connected to a kernel. Any interactive elements will not work.`})}function np(){let e=()=>{throw Error(`Unreachable. Expected to be in run mode`)};return{sendComponentValues:async()=>(tp(),U.log(`Updating UI elements is not supported in static mode`),null),sendModelValue:async()=>(U.log(`Updating model values is not supported in static mode`),null),sendInstantiate:async()=>(U.log(`Viewing as static notebook`),null),sendFunctionRequest:async()=>(tp(),U.log(`Function requests are not supported in static mode`),null),sendRestart:e,sendDocumentTransaction:e,sendRun:e,sendRunScratchpad:e,sendRename:e,sendSave:e,sendCopy:e,sendInterrupt:e,sendShutdown:e,sendFormat:e,sendDeleteCell:e,sendCodeCompletionRequest:e,saveUserConfig:e,saveAppConfig:e,saveCellConfig:e,sendStdin:e,readCode:e,readSnippets:e,previewDatasetColumn:e,previewSQLTable:e,previewSQLTableList:e,previewSQLSchemaList:e,previewDataSourceConnection:e,discoverDataSources:e,validateSQL:e,openFile:e,getUsageStats:e,getEnvironmentInfo:e,sendListFiles:e,sendSearchFiles:e,sendPdb:e,sendSetBreakpoints:e,sendCreateFileOrFolder:e,sendDeleteFileOrFolder:e,sendCopyFileOrFolder:e,sendRenameFileOrFolder:e,sendUpdateFile:e,sendFileDetails:e,openTutorial:e,sendInstallMissingPackages:e,getRecentFiles:e,getWorkspaceFiles:e,getRunningNotebooks:e,shutdownSession:e,getExportAvailability:e,installExportRequirements:e,exportAsHTML:e,exportAsIPYNB:e,exportAsMarkdown:e,exportAsScript:e,exportAsPDF:e,autoExportAsHTML:e,autoExportAsMarkdown:e,autoExportAsIPYNB:e,updateCellOutputs:e,addPackage:e,removePackage:e,getPackageList:e,getDependencyTree:e,listSecretKeys:e,writeSecret:e,invokeAiTool:e,clearCache:e,getCacheInfo:e,listStorageEntries:e,downloadStorage:e}}function rp(e){let t={sendComponentValues:`Failed update value`,sendModelValue:`Failed to update model value`,sendInstantiate:`Failed to instantiate`,sendFunctionRequest:`Failed to send function request`,sendRestart:`Failed to restart`,sendDocumentTransaction:`Failed to sync document transaction`,sendRun:`Failed to run`,sendRunScratchpad:`Failed to run scratchpad`,sendRename:`Failed to rename`,sendSave:`Failed to save`,sendCopy:`Failed to copy`,sendInterrupt:`Failed to interrupt`,sendShutdown:`Failed to shutdown`,sendFormat:`Failed to format`,sendDeleteCell:`Failed to delete cell`,sendCodeCompletionRequest:`Failed to complete code`,saveUserConfig:`Failed to save user config`,saveAppConfig:`Failed to save app config`,saveCellConfig:`Failed to save cell config`,sendStdin:`Failed to send stdin`,readCode:`Failed to read code`,readSnippets:`Failed to fetch snippets`,previewDatasetColumn:`Failed to fetch data sources`,previewSQLTable:`Failed to fetch SQL table`,previewSQLTableList:`Failed to fetch SQL table list`,previewSQLSchemaList:`Failed to fetch SQL schema list`,previewDataSourceConnection:`Failed to preview data source connection`,discoverDataSources:`Failed to discover data sources`,validateSQL:`Failed to validate SQL`,openFile:`Failed to open file`,getUsageStats:``,getEnvironmentInfo:``,sendListFiles:`Failed to list files`,sendSearchFiles:`Failed to search files`,sendPdb:`Failed to start debug session`,sendSetBreakpoints:``,sendCreateFileOrFolder:`Failed to create file or folder`,sendDeleteFileOrFolder:`Failed to delete file or folder`,sendCopyFileOrFolder:`Failed to duplicate file or folder`,sendRenameFileOrFolder:`Failed to rename file or folder`,sendUpdateFile:`Failed to update file`,sendFileDetails:`Failed to get file details`,openTutorial:`Failed to open tutorial`,sendInstallMissingPackages:`Failed to install missing packages`,getRecentFiles:`Failed to get recent files`,getWorkspaceFiles:`Failed to get workspace files`,getRunningNotebooks:`Failed to get running notebooks`,shutdownSession:`Failed to shutdown session`,getExportAvailability:``,installExportRequirements:`Failed to install export requirements`,exportAsHTML:`Failed to export HTML`,exportAsIPYNB:`Failed to export ipynb`,exportAsMarkdown:`Failed to export Markdown`,exportAsScript:`Failed to export Script`,exportAsPDF:`Failed to export PDF`,autoExportAsHTML:``,autoExportAsMarkdown:``,autoExportAsIPYNB:``,updateCellOutputs:``,addPackage:`Failed to add package`,removePackage:`Failed to remove package`,getPackageList:`Failed to get package list`,getDependencyTree:`Failed to get dependency tree`,listSecretKeys:`Failed to fetch secrets`,writeSecret:`Failed to write secret`,invokeAiTool:`Failed to invoke AI tool`,clearCache:`Failed to clear cache`,getCacheInfo:``,listStorageEntries:`Failed to list storage entries`,downloadStorage:`Failed to download storage entry`},n={};for(let[r,i]of Object.entries(e)){let e=r;n[e]=async(...n)=>{try{return await i(...n)}catch(n){if(n instanceof ts){if(a.get(ln))return;let e=No({title:`Kernel Not Connected`,description:`You need to connect to a kernel to perform this action.`,variant:`default`,action:(0,K.jsx)(ip,{onConnect:()=>e.dismiss()})});throw U.error(`Failed to handle request: ${r}`,n),n}if(n instanceof rs&&n.status===403)throw U.warn(`Request refused, connection is read-only: ${r}`),n;let i=t[e],o=es(n);throw i&&No({title:i,description:o,variant:`danger`}),U.error(`Failed to handle request: ${r}`,n),n}}}return n}var ip=e=>{let t=(0,q.c)(9),{onConnect:n}=e,i=cn(),a=r(ln),o;t[0]!==i||t[1]!==n?(o=()=>{i(),setTimeout(()=>{n()},800)},t[0]=i,t[1]=n,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=a&&(0,K.jsx)(uo,{size:`small`,className:`mr-1`}),t[3]=a,t[4]=s);let c;return t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,K.jsxs)(Yi,{size:`xs`,onClick:o,disabled:a,children:[s,`Connect`]}),t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c};function ap(){let e;return e=an()?Mt.INSTANCE:dn()?np():Wf($f(),()=>fn()),rp(e)}var op=G.forwardRef((e,t)=>{let n=(0,q.c)(16),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,children:r,orientation:a,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a===`horizontal`&&`max-w-max flex-1 items-center justify-center`,c=a===`vertical`&&``,l;n[5]!==i||n[6]!==s||n[7]!==c?(l=W(s,c,`relative z-10`,i),n[5]=i,n[6]=s,n[7]=c,n[8]=l):l=n[8];let u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(mp,{}),n[9]=u):u=n[9];let d;return n[10]!==r||n[11]!==a||n[12]!==o||n[13]!==t||n[14]!==l?(d=(0,K.jsxs)(Nc,{ref:t,className:l,orientation:a,...o,children:[r,u]}),n[10]=r,n[11]=a,n[12]=o,n[13]=t,n[14]=l,n[15]=d):d=n[15],d});op.displayName=Nc.displayName;var sp=Dn(`group flex list-none gap-1`,{variants:{orientation:{horizontal:`flex items-center`,vertical:`flex flex-col`}},defaultVariants:{orientation:`horizontal`}}),cp=G.forwardRef((e,t)=>{let n=(0,q.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,orientation:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]!==r||n[5]!==i?(o=W(sp({orientation:i}),r),n[4]=r,n[5]=i,n[6]=o):o=n[6];let s;return n[7]!==a||n[8]!==t||n[9]!==o?(s=(0,K.jsx)(Pc,{ref:t,className:o,...a}),n[7]=a,n[8]=t,n[9]=o,n[10]=s):s=n[10],s});cp.displayName=Pc.displayName;var lp=Fc,up=Dn(`group inline-flex rounded-md bg-background px-4 py-2 text-lg font-medium text-(--slate-12) transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-active:bg-accent/50 data-[state=open]:bg-accent/50`,{variants:{orientation:{horizontal:`w-max items-center justify-center`,vertical:`w-full`}},defaultVariants:{orientation:`horizontal`}}),dp=G.forwardRef((e,t)=>{let n=(0,q.c)(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=W(up(),`group`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(cs,{className:`relative top-px ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180`,"aria-hidden":`true`}),n[6]=s):s=n[6];let c;return n[7]!==r||n[8]!==a||n[9]!==t||n[10]!==o?(c=(0,K.jsxs)(Ic,{ref:t,className:o,...a,children:[r,` `,s]}),n[7]=r,n[8]=a,n[9]=t,n[10]=o,n[11]=c):c=n[11],c});dp.displayName=Ic.displayName;var fp=G.forwardRef((e,t)=>{let n=(0,q.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=W(`left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto `,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,K.jsx)(zc,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});fp.displayName=zc.displayName;var pp=Lc,mp=G.forwardRef((e,t)=>{let n=(0,q.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=W(`absolute left-0 top-full flex justify-center`),n[3]=a):a=n[3];let o;n[4]===r?o=n[5]:(o=W(`origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-(--radix-navigation-menu-viewport-width)`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==t||n[8]!==o?(s=(0,K.jsx)(`div`,{className:a,children:(0,K.jsx)(Bc,{className:o,ref:t,...i})}),n[6]=i,n[7]=t,n[8]=o,n[9]=s):s=n[9],s});mp.displayName=Bc.displayName;var hp=G.forwardRef((e,t)=>{let n=(0,q.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=W(`top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(`div`,{className:`relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,K.jsx)(Rc,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});hp.displayName=Rc.displayName;var gp=e=>{let t=(0,q.c)(23),{item:n,preserveQueryParams:r,target:i}=e,a=G.useRef(null),[o,s]=G.useState(!1),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>s(e!==``),t[0]=c):c=t[0];let l;t[1]===n.label?l=t[2]:(l=$o({html:n.label}),t[1]=n.label,t[2]=l);let u;t[3]===l?u=t[4]:(u=(0,K.jsx)(dp,{ref:a,children:l}),t[3]=l,t[4]=u);let d;if(t[5]!==n.items||t[6]!==r||t[7]!==i){let e;t[9]!==r||t[10]!==i?(e=e=>(0,K.jsx)(Sp,{label:e.label,href:r(e.href),target:i(e.href),children:e.description&&$o({html:e.description})},e.label),t[9]=r,t[10]=i,t[11]=e):e=t[11],d=n.items.map(e),t[5]=n.items,t[6]=r,t[7]=i,t[8]=d}else d=t[8];let f;t[12]===d?f=t[13]:(f=(0,K.jsx)(fp,{className:`w-auto`,children:(0,K.jsx)(`ul`,{className:`grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px] `,children:d})}),t[12]=d,t[13]=f);let p;t[14]!==u||t[15]!==f?(p=(0,K.jsx)(cp,{children:(0,K.jsxs)(lp,{children:[u,f]})}),t[14]=u,t[15]=f,t[16]=p):p=t[16];let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(mp,{}),t[17]=m):m=t[17];let h;t[18]===o?h=t[19]:(h=(0,K.jsx)(yp,{anchorRef:a,open:o,children:m}),t[18]=o,t[19]=h);let g;return t[20]!==p||t[21]!==h?(g=(0,K.jsxs)(Nc,{className:`relative z-10 max-w-max flex-1 items-center justify-center`,orientation:`horizontal`,onValueChange:c,children:[p,h]}),t[20]=p,t[21]=h,t[22]=g):g=t[22],g},_p=Ln(({container:e,children:t})=>(0,Ps.createPortal)(t,e??document.body)),vp=8,yp=e=>{let t=(0,q.c)(18),{anchorRef:n,open:r,children:i}=e,[a,o]=G.useState(null),s=G.useRef(null),c;t[0]===n?c=t[1]:(c=()=>{if(!n.current)return;let e=n.current.getBoundingClientRect(),t=s.current?.firstElementChild?.scrollWidth??0,r=window.innerWidth-t-vp;o({left:Math.max(vp,Math.min(e.left,r)),top:e.bottom})},t[0]=n,t[1]=c);let l=c,u,d;t[2]!==r||t[3]!==l?(u=()=>{if(l(),r){let e=requestAnimationFrame(l);return()=>cancelAnimationFrame(e)}},d=[r,l],t[2]=r,t[3]=l,t[4]=u,t[5]=d):(u=t[4],d=t[5]),G.useLayoutEffect(u,d);let f;t[6]!==n||t[7]!==l?(f={ref:n,onResize:l},t[6]=n,t[7]=l,t[8]=f):f=t[8],Ha(f);let p,m;if(t[9]===l?(p=t[10],m=t[11]):(p=()=>{if(!(typeof window>`u`))return window.addEventListener(`resize`,l),document.addEventListener(`scroll`,l,{capture:!0}),()=>{window.removeEventListener(`resize`,l),document.removeEventListener(`scroll`,l,{capture:!0})}},m=[l],t[9]=l,t[10]=p,t[11]=m),G.useEffect(p,m),!a||typeof document>`u`)return null;let h;t[12]!==a.left||t[13]!==a.top?(h={left:a.left,top:a.top},t[12]=a.left,t[13]=a.top,t[14]=h):h=t[14];let g;return t[15]!==i||t[16]!==h?(g=(0,K.jsx)(_p,{children:(0,K.jsx)(`div`,{ref:s,className:`fixed z-50`,style:h,children:i})}),t[15]=i,t[16]=h,t[17]=g):g=t[17],g},bp=class{tagName=`marimo-nav-menu`;menuItemValidator=R({label:z(),href:z(),description:z().nullish()});menuItemGroupValidator=R({label:z(),items:V(this.menuItemValidator)});validator=R({items:V(nt([this.menuItemValidator,this.menuItemGroupValidator])),orientation:gt([`horizontal`,`vertical`])});render(e){return(0,K.jsx)(xp,{...e.data})}},xp=e=>{let t=(0,q.c)(13),{items:n,orientation:r}=e,i=Cp,a=wp,o=Tp,s;t[0]===r?s=t[1]:(s=e=>`items`in e?r===`horizontal`?(0,K.jsx)(gp,{item:e,preserveQueryParams:o,target:a},e.label):(0,K.jsxs)(lp,{children:[(0,K.jsx)(`div`,{className:`inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-base font-medium text-muted-foreground/80 tracking-wide font-semibold`,children:$o({html:e.label})}),(0,K.jsx)(cp,{className:`ml-4 auto-collapse-nav`,orientation:r,children:e.items.map(e=>(0,K.jsx)(G.Fragment,{children:i((0,K.jsx)(pp,{href:o(e.href),target:a(e.href),className:up({orientation:r}),children:$o({html:e.label})},e.label),e.description)},e.label))})]},e.label):(0,K.jsx)(lp,{children:(0,K.jsx)(pp,{href:o(e.href),target:a(e.href),className:up({orientation:r}),children:$o({html:e.label})})},e.label),t[0]=r,t[1]=s);let c=s,l;if(t[2]!==n||t[3]!==c){let e;t[5]===c?e=t[6]:(e=e=>c(e),t[5]=c,t[6]=e),l=n.map(e),t[2]=n,t[3]=c,t[4]=l}else l=t[4];let u;t[7]!==r||t[8]!==l?(u=(0,K.jsx)(cp,{className:`auto-collapse-nav`,orientation:r,children:l}),t[7]=r,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==r||t[11]!==u?(d=(0,K.jsx)(op,{orientation:r,children:u}),t[10]=r,t[11]=u,t[12]=d):d=t[12],d},Sp=G.forwardRef((e,t)=>{let n=(0,q.c)(19),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,label:a,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s;n[5]===i?s=n[6]:(s=W(`block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-hidden transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground`,i),n[5]=i,n[6]=s);let c;n[7]===a?c=n[8]:(c=$o({html:a}),n[7]=a,n[8]=c);let l;n[9]===c?l=n[10]:(l=(0,K.jsx)(`div`,{className:`text-base font-medium leading-none`,children:c}),n[9]=c,n[10]=l);let u;n[11]===r?u=n[12]:(u=r&&(0,K.jsx)(`p`,{className:`line-clamp-2 text-sm leading-snug text-muted-foreground`,children:r}),n[11]=r,n[12]=u);let d;return n[13]!==o||n[14]!==t||n[15]!==s||n[16]!==l||n[17]!==u?(d=(0,K.jsx)(`li`,{children:(0,K.jsx)(pp,{asChild:!0,children:(0,K.jsxs)(`a`,{ref:t,className:s,...o,children:[l,u]})})}),n[13]=o,n[14]=t,n[15]=s,n[16]=l,n[17]=u,n[18]=d):d=n[18],d});Sp.displayName=`ListItem`;function Cp(e,t){return t?(0,K.jsx)(qi,{delayDuration:200,content:$o({html:t}),children:e}):e}function wp(e){return e.startsWith(`http`)?`_blank`:`_self`}function Tp(e){let t=new URL(globalThis.location.href);return Lo({href:e,queryParams:t.search,keys:[$t.filePath]})}function Ep(e,t){return e===t?!0:e==null||t==null?!1:Array.isArray(e)&&Array.isArray(t)?Qi(e,t):typeof e==`object`&&typeof t==`object`&&Dp(e,t)}function Dp(e,t){return Object.keys(e).length===Object.keys(t).length&&Vt.keys(e).every(n=>e[n]===t[n])}function Op(e,t){if(!window?.customElements){U.warn(`Custom elements not supported`);return}if(window.customElements.get(e)){U.warn(`Custom element ${e} already defined`);return}window.customElements.define(e,t)}function kp(e,t){if(!t)return[];let n=e;if(ui(t))return[{column_id:n,operator:t.operator,type:`condition`,negate:!1}];switch(t.type){case`number`:switch(t.operator){case`between`:return[{column_id:n,operator:`between`,value:{min:t.min,max:t.max},type:`condition`,negate:!1}];case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return[{column_id:n,operator:t.operator,value:t.value,type:`condition`,negate:!1}];case`in`:case`not_in`:return[{column_id:n,operator:t.operator,value:t.values,type:`condition`,negate:!1}];default:ia(t)}case`text`:switch(t.operator){case`contains`:case`equals`:case`does_not_equal`:case`regex`:case`starts_with`:case`ends_with`:return[{column_id:n,operator:t.operator,value:t.text,type:`condition`,negate:!1}];case`in`:case`not_in`:return[{column_id:n,operator:t.operator,value:t.values,type:`condition`,negate:!1}];case`is_empty`:return[{column_id:n,operator:`is_empty`,type:`condition`,negate:!1}];default:ia(t)}case`date`:case`datetime`:case`time`:{let e=t.type===`date`?Zo:t.type===`time`?Xo:Yo;switch(t.operator){case`between`:return[{column_id:n,operator:`between`,value:{min:e(t.min),max:e(t.max)},type:`condition`,negate:!1}];case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return[{column_id:n,operator:t.operator,value:e(t.value),type:`condition`,negate:!1}];default:ia(t)}}case`boolean`:return[{column_id:n,operator:t.operator,type:`condition`,negate:!1}];default:ia(t)}}function Ap(e){return{type:`group`,operator:`and`,children:e.flatMap(e=>kp(e.id,e.value)),negate:!1}}var jp=0,Mp=1,Np=2,Pp=4;function Fp(e){return()=>e}function Ip(e){e()}function Lp(e,t){return n=>e(t(n))}function Rp(e,t){return()=>e(t)}function zp(e,t){return n=>e(t,n)}function Bp(e){return e!==void 0}function Vp(...e){return()=>{e.map(Ip)}}function Hp(){}function Up(e,t){return t(e),e}function Wp(e,t){return t(e)}function Gp(...e){return e}function Kp(e,t){return e(Mp,t)}function qp(e,t){e(jp,t)}function Jp(e){e(Np)}function Yp(e){return e(Pp)}function J(e,t){return Kp(e,zp(t,jp))}function Xp(e,t){let n=e(Mp,e=>{n(),t(e)});return n}function Zp(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Qp(e,t){return e===t}function $p(e=Qp){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Y(e){return t=>n=>{e(n)&&t(n)}}function X(e){return t=>Lp(t,e)}function em(e){return t=>()=>{t(e)}}function Z(e,...t){let n=am(...t);return((t,r)=>{switch(t){case Np:Jp(e);return;case Mp:return Kp(e,n(r))}})}function tm(e,t){return n=>r=>{n(t=e(t,r))}}function nm(e){return t=>n=>{e>0?e--:t(n)}}function rm(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function im(...e){let t=Array(e.length),n=0,r=null,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;Kp(e,e=>{let s=n;n|=o,t[a]=e,s!==i&&n===i&&r&&(r(),r=null)})}),e=>a=>{let o=()=>{e([a].concat(t))};n===i?o():r=o}}function am(...e){return t=>e.reduceRight(Wp,t)}function om(e){let t,n,r=()=>t?.();return function(i,a){switch(i){case Mp:return a?n===a?void 0:(r(),n=a,t=Kp(e,a),t):(r(),Hp);case Np:r(),n=null;return}}}function Q(e){let t=e,n=cm();return((e,r)=>{switch(e){case jp:t=r;break;case Mp:r(t);break;case Pp:return t}return n(e,r)})}function sm(e,t){return Up(Q(t),t=>J(e,t))}function cm(){let e=[];return((t,n)=>{switch(t){case jp:e.slice().forEach(e=>{e(n)});return;case Np:e.splice(0,e.length);return;case Mp:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}})}function lm(e){return Up(cm(),t=>J(e,t))}function um(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:dm(),singleton:n}}var dm=()=>Symbol();function fm(e){let t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);let o=e(r.map(e=>n(e)));return a&&t.set(i,o),o};return n(e)}function pm(...e){let t=cm(),n=Array(e.length),r=0,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;Kp(e,e=>{n[a]=e,r|=o,r===i&&qp(t,n)})}),function(e,a){switch(e){case Np:Jp(t);return;case Mp:return r===i&&a(n),Kp(t,a)}}}function $(e,t=Qp){return Z(e,$p(t))}function mm(...e){return function(t,n){switch(t){case Np:return;case Mp:return Vp(...e.map(e=>Kp(e,n)))}}}var hm=(e=>(e[e.DEBUG=0]=`DEBUG`,e[e.INFO=1]=`INFO`,e[e.WARN=2]=`WARN`,e[e.ERROR=3]=`ERROR`,e))(hm||{}),gm={0:`debug`,3:`error`,1:`log`,2:`warn`},_m=()=>typeof globalThis>`u`?window:globalThis,vm=um(()=>{let e=Q(3);return{log:Q((t,n,r=1)=>{r>=(_m().VIRTUOSO_LOG_LEVEL??Yp(e))&&console[gm[r]](`%creact-virtuoso: %c%s %o`,`color: #0253b3; font-weight: bold`,`color: initial`,t,n)}),logLevel:e}},[],{singleton:!0});function ym(e,t,n){return bm(e,t,n).callbackRef}function bm(e,t,n){let r=G.useRef(null),i=e=>{},a=G.useMemo(()=>typeof ResizeObserver<`u`?new ResizeObserver(t=>{let r=()=>{let n=t[0].target;n.offsetParent!==null&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return i=e=>{e&&t?(a?.observe(e),r.current=e):(r.current&&a?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function xm(e,t,n,r,i,a,o,s,c){return bm(G.useCallback(n=>{let c=Sm(n.children,t,s?`offsetWidth`:`offsetHeight`,i),l=n.parentElement;for(;!l.dataset.virtuosoScroller;)l=l.parentElement;let u=l.lastElementChild.dataset.viewportType===`window`,d;u&&(d=l.ownerDocument.defaultView);let f=o?s?o.scrollLeft:o.scrollTop:u?s?d.scrollX||d.document.documentElement.scrollLeft:d.scrollY||d.document.documentElement.scrollTop:s?l.scrollLeft:l.scrollTop,p=o?s?o.scrollWidth:o.scrollHeight:u?s?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:s?l.scrollWidth:l.scrollHeight,m=o?s?o.offsetWidth:o.offsetHeight:u?s?d.innerWidth:d.innerHeight:s?l.offsetWidth:l.offsetHeight;r({scrollHeight:p,scrollTop:Math.max(f,0),viewportHeight:m}),a?.(s?Cm(`column-gap`,getComputedStyle(n).columnGap,i):Cm(`row-gap`,getComputedStyle(n).rowGap,i)),c!==null&&e(c)},[e,t,i,a,o,r,s]),n,c)}function Sm(e,t,n,r){let i=e.length;if(i===0)return null;let a=[];for(let o=0;o<i;o++){let i=e.item(o);if(i.dataset.index===void 0)continue;let s=parseInt(i.dataset.index),c=parseFloat(i.dataset.knownSize),l=t(i,n);if(l===0&&r(`Zero-sized element, this should not happen`,{child:i},hm.ERROR),l===c)continue;let u=a[a.length-1];a.length===0||u.size!==l||u.endIndex!==s-1?a.push({endIndex:s,size:l,startIndex:s}):a[a.length-1].endIndex++}return a}function Cm(e,t,n){return t!==`normal`&&!(t!=null&&t.endsWith(`px`))&&n(`${e} was not resolved to pixel value correctly`,t,hm.WARN),t===`normal`?0:parseInt(t??`0`,10)}function wm(e,t,n){let r=G.useRef(null),i=G.useCallback(n=>{if(!(n!=null&&n.offsetParent))return;let i=n.getBoundingClientRect(),a=i.width,s,c;if(t){let e=t.getBoundingClientRect(),n=i.top-e.top;c=e.height-Math.max(0,n),s=n+t.scrollTop}else{let e=o.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,i.top),s=i.top+e.scrollY}r.current={offsetTop:s,visibleHeight:c,visibleWidth:a},e(r.current)},[e,t]),{callbackRef:a,ref:o}=bm(i,!0,n),s=G.useCallback(()=>{i(o.current)},[i,o]);return G.useEffect(()=>{if(t){t.addEventListener(`scroll`,s);let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener(`scroll`,s),e.unobserve(t)}}{let e=o.current?.ownerDocument.defaultView;return e?.addEventListener(`scroll`,s),e?.addEventListener(`resize`,s),()=>{e?.removeEventListener(`scroll`,s),e?.removeEventListener(`resize`,s)}}},[s,t,o]),a}var Tm=um(()=>{let e=cm(),t=cm(),n=Q(0),r=cm(),i=Q(0),a=cm(),o=cm(),s=Q(0),c=Q(0),l=Q(0),u=Q(0),d=cm(),f=cm(),p=Q(!1),m=Q(!1),h=Q(!1);return J(Z(e,X(({scrollTop:e})=>e)),t),J(Z(e,X(({scrollHeight:e})=>e)),o),J(t,i),{deviation:n,fixedFooterHeight:l,fixedHeaderHeight:c,footerHeight:u,headerHeight:s,horizontalDirection:m,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:p,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:h,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),Em={lvl:0};function Dm(e,t){let n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]),a=[];for(let o=1;o<n;o++){let{index:n,value:s}=t(e[o]);a.push({end:n-1,start:r,value:i}),r=n,i=s}return a.push({end:1/0,start:r,value:i}),a}function Om(e){return e===Em}function km(e,t){if(!Om(e))return t===e.k?e.v:t<e.k?km(e.l,t):km(e.r,t)}function Am(e,t,n=`k`){if(Om(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let r=Am(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Am(e.l,t,n)}function jm(e,t,n){return Om(e)?Hm(t,n,1):t===e.k?Rm(e,{k:t,v:n}):t<e.k?Um(Rm(e,{l:jm(e.l,t,n)})):Um(Rm(e,{r:jm(e.r,t,n)}))}function Mm(){return Em}function Nm(e,t,n){if(Om(e))return[];let r=Am(e,t)[0];return Km(Im(e,r,n))}function Pm(e,t){if(Om(e))return Em;let{k:n,l:r,r:i}=e;if(t===n){if(Om(r))return i;if(Om(i))return r;{let[t,n]=Vm(r);return Lm(Rm(e,{k:t,l:zm(r),v:n}))}}return Lm(t<n?Rm(e,{l:Pm(r,t)}):Rm(e,{r:Pm(i,t)}))}function Fm(e){return Om(e)?[]:[...Fm(e.l),{k:e.k,v:e.v},...Fm(e.r)]}function Im(e,t,n){if(Om(e))return[];let{k:r,l:i,r:a,v:o}=e,s=[];return r>t&&(s=s.concat(Im(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Im(a,t,n))),s}function Lm(e){let{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(Bm(t))return Wm(Rm(e,{lvl:n-1}));if(!Om(t)&&!Om(t.r))return Rm(t.r,{l:Rm(t,{r:t.r.l}),lvl:n,r:Rm(e,{l:t.r.r,lvl:n-1})});throw Error(`Unexpected empty nodes`)}if(Bm(e))return Gm(Rm(e,{lvl:n-1}));if(!Om(r)&&!Om(r.l)){let t=r.l,i=Bm(t)?r.lvl-1:r.lvl;return Rm(t,{l:Rm(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:Gm(Rm(r,{l:t.r,lvl:i}))})}throw Error(`Unexpected empty nodes`)}function Rm(e,t){return Hm(t.k===void 0?e.k:t.k,t.v===void 0?e.v:t.v,t.lvl===void 0?e.lvl:t.lvl,t.l===void 0?e.l:t.l,t.r===void 0?e.r:t.r)}function zm(e){return Om(e.r)?e.l:Lm(Rm(e,{r:zm(e.r)}))}function Bm(e){return Om(e)||e.lvl>e.r.lvl}function Vm(e){return Om(e.r)?[e.k,e.v]:Vm(e.r)}function Hm(e,t,n,r=Em,i=Em){return{k:e,l:r,lvl:n,r:i,v:t}}function Um(e){return Gm(Wm(e))}function Wm(e){let{l:t}=e;return!Om(t)&&t.lvl===e.lvl?Rm(t,{r:Rm(e,{l:t.r})}):e}function Gm(e){let{lvl:t,r:n}=e;return!Om(n)&&!Om(n.r)&&n.lvl===t&&n.r.lvl===t?Rm(n,{l:Rm(e,{r:n.l}),lvl:t+1}):e}function Km(e){return Dm(e,({k:e,v:t})=>({index:e,value:t}))}function qm(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function Jm(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}var Ym=um(()=>({recalcInProgress:Q(!1)}),[],{singleton:!0});function Xm(e,t,n){return e[Zm(e,t,n)]}function Zm(e,t,n,r=0){let i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw Error(`Failed binary finding record in array - ${e.join(`,`)}, searched for ${t}`)}function Qm(e,t,n,r){let i=Zm(e,t,r),a=Zm(e,n,r,i);return e.slice(i,a+1)}function $m(e,t){return Math.round(e.getBoundingClientRect()[t])}function eh(e){return!Om(e.groupOffsetTree)}function th({index:e},t){return t===e?0:t<e?-1:1}function nh(){return{groupIndices:[],groupOffsetTree:Mm(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Mm()}}function rh(e,t){let n=Om(e)?0:1/0;for(let r of t){let{endIndex:t,size:i,startIndex:a}=r;if(n=Math.min(n,a),Om(e)){e=jm(e,0,i);continue}let o=Nm(e,a-1,t+1);if(o.some(hh(r)))continue;let s=!1,c=!1;for(let{end:n,start:r,value:a}of o)s?(t>=r||i===a)&&(e=Pm(e,r)):(c=a!==i,s=!0),n>t&&t>=r&&a!==i&&(e=jm(e,t+1,a));c&&(e=jm(e,a,i))}return[e,n]}function ih(e){return typeof e.groupIndex<`u`}function ah({offset:e},t){return t===e?0:t<e?-1:1}function oh(e,t,n){if(t.length===0)return 0;let{index:r,offset:i,size:a}=Xm(t,e,th),o=e-r,s=a*o+(o-1)*n+i;return s>0?s+n:s}function sh(e,t){if(!eh(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function ch(e,t,n){if(ih(e))return t.groupIndices[e.groupIndex]+1;{let r=sh(e.index===`LAST`?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function lh(e,t,n,r=0){return r>0&&(t=Math.max(t,Xm(e,r,th).offset)),Dm(Qm(e,t,n,ah),mh)}function uh(e,[t,n,r,i]){t.length>0&&r(`received item sizes`,t,hm.DEBUG);let a=e.sizeTree,o=a,s=0;if(n.length>0&&Om(a)&&t.length===2){let e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>jm(jm(t,n,e),n+1,r),o)}else[o,s]=rh(o,t);if(o===a)return e;let{lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d}=ph(e.offsetTree,s,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>jm(e,t,oh(t,d,i)),Mm()),lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d,sizeTree:o}}function dh(e){return Fm(e).map(({k:e,v:t},n,r)=>{let i=r[n+1];return{endIndex:i?i.k-1:1/0,size:t,startIndex:e}})}function fh(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function ph(e,t,n,r){let i=e,a=0,o=0,s=0,c=0;if(t!==0){c=Zm(i,t-1,th),s=i[c].offset;let e=Am(n,t-1);a=e[0],o=e[1],i.length&&i[c].size===Am(n,t)[1]&&--c,i=i.slice(0,c+1)}else i=[];for(let{start:e,value:c}of Nm(n,t,1/0)){let t=e-a,n=t*o+s+t*r;i.push({index:e,offset:n,size:c}),a=e,s=n,o=c}return{lastIndex:a,lastOffset:s,lastSize:o,offsetTree:i}}function mh(e){return{index:e.index,value:e}}function hh(e){let{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}var gh={offsetHeight:`height`,offsetWidth:`width`},_h=um(([{log:e},{recalcInProgress:t}])=>{let n=cm(),r=cm(),i=sm(r,0),a=cm(),o=cm(),s=Q(0),c=Q([]),l=Q(void 0),u=Q(void 0),d=Q(void 0),f=Q(void 0),p=Q((e,t)=>$m(e,gh[t])),m=Q(void 0),h=Q(0),g=nh(),_=sm(Z(n,im(c,e,h),tm(uh,g),$p()),g),v=sm(Z(c,$p(),tm((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),X(({prev:e})=>e)),[]);J(Z(c,Y(e=>e.length>0),im(_,h),X(([e,t,n])=>{let r=e.reduce((e,r,i)=>jm(e,r,oh(r,t.offsetTree,n)||i),Mm());return{...t,groupIndices:e,groupOffsetTree:r}})),_),J(Z(r,im(_),Y(([e,{lastIndex:t}])=>e<t),X(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),J(l,u);let y=sm(Z(l,X(e=>e===void 0)),!0);J(Z(u,Y(e=>e!==void 0&&Om(Yp(_).sizeTree)),X(e=>{let t=Yp(d),n=Yp(c).length>0;return t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),J(Z(f,Y(e=>e!==void 0&&e.length>0&&Om(Yp(_).sizeTree)),X(e=>{let t=[],n=e[0],r=0;for(let i=1;i<e.length;i++){let a=e[i];a!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=a,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),J(Z(c,im(d,u),Y(([,e,t])=>e!==void 0&&t!==void 0),X(([e,t,n])=>{let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i+1];r.push({startIndex:a,endIndex:a,size:t}),o!==void 0&&r.push({startIndex:a+1,endIndex:o-1,size:n})}return r})),n);let b=lm(Z(n,im(_),tm(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:g}),X(e=>e.changed)));Kp(Z(s,tm((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),X(e=>e.diff)),e=>{let{groupIndices:n}=Yp(_);if(e>0)qp(t,!0),qp(a,e+fh(e,n));else if(e<0){let t=Yp(v);t.length>0&&(e-=fh(-e,t)),qp(o,e)}}),Kp(Z(s,im(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},hm.ERROR)});let x=lm(a);J(Z(a,im(_),X(([e,t])=>{let n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){let n=km(t.sizeTree,0),a=0,o=0;for(;a<e;){let e=t.groupIndices[o],s=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+s-1,size:i,startIndex:e+1}),o++,a+=s+1}let s=Fm(t.sizeTree);return a!==e&&s.shift(),s.reduce((t,{k:n,v:r})=>{let i=t.ranges;return t.prevSize!==0&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return Fm(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);let S=lm(Z(o,im(_,h),X(([e,{offsetTree:t},n])=>oh(-e,t,n))));return J(Z(o,im(_,h),X(([e,t,n])=>{if(t.groupIndices.length>0){if(Om(t.sizeTree))return t;let r=Mm(),i=Yp(v),a=0,o=0,s=0;for(;a<-e;){s=i[o];let e=i[o+1]-s-1;o++,a+=e+1}if(r=Fm(t.sizeTree).reduce((t,{k:n,v:r})=>jm(t,Math.max(0,n+e),r),r),a!==-e){let n=km(t.sizeTree,s);r=jm(r,0,n);let i=Am(t.sizeTree,-e+1)[1];r=jm(r,1,i)}return{...t,sizeTree:r,...ph(t.offsetTree,0,r,n)}}{let r=Fm(t.sizeTree).reduce((t,{k:n,v:r})=>jm(t,Math.max(0,n+e),r),Mm());return{...t,sizeTree:r,...ph(t.offsetTree,0,r,n)}}})),_),{beforeUnshiftWith:x,data:m,defaultItemSize:u,firstItemIndex:s,fixedItemSize:l,fixedGroupSize:d,gap:h,groupIndices:c,heightEstimates:f,itemSize:p,listRefresh:b,shiftWith:o,shiftWithOffset:S,sizeRanges:n,sizes:_,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:a}},Gp(vm,Ym),{singleton:!0});function vh(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}var yh=um(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{let a=cm(),o=cm(),s=lm(Z(a,X(vh)));return J(Z(s,X(e=>e.totalCount)),n),J(Z(s,X(e=>e.groupIndices)),e),J(Z(pm(i,t,r),Y(([e,t])=>eh(t)),X(([e,t,n])=>Am(t.groupOffsetTree,Math.max(e-n,0),`v`)[0]),$p(),X(e=>[e])),o),{groupCounts:a,topItemsIndexes:o}},Gp(_h,Tm)),bh=um(([{log:e}])=>{let t=Q(!1),n=lm(Z(t,Y(e=>e),$p()));return Kp(t,t=>{t&&Yp(e)(`props updated`,{},hm.DEBUG)}),{didMount:n,propsReady:t}},Gp(vm),{singleton:!0}),xh=typeof document<`u`&&`scrollBehavior`in document.documentElement.style;function Sh(e){let t=typeof e==`number`?{index:e}:e;return t.align||=`start`,(!t.behavior||!xh)&&(t.behavior=`auto`),t.offset||=0,t}var Ch=um(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:s,scrollingInProgress:c,scrollTo:l,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{let p=cm(),m=cm(),h=Q(0),g=null,_=null,v=null;function y(){g&&=(g(),null),v&&=(v(),null),_&&=(clearTimeout(_),null),qp(c,!1)}return J(Z(p,im(n,d,r,h,s,o,f),im(e,a,i),X(([[e,n,r,i,a,o,s,l],d,f,h])=>{let b=Sh(e),{align:x,behavior:S,offset:C}=b,w=i-1,T=ch(b,n,w),E=oh(T,n.offsetTree,d)+o;x===`end`?(E+=f+Am(n.sizeTree,T)[1]-r+h,T===w&&(E+=s)):x===`center`?E+=(f+Am(n.sizeTree,T)[1]-r+h)/2:E-=a,C&&(E+=C);let D=t=>{y(),t?(l(`retrying to scroll to`,{location:e},hm.DEBUG),qp(p,e)):(qp(m,!0),l(`list did not change, scroll successful`,{},hm.DEBUG))};if(y(),S===`smooth`){let e=!1;v=Kp(t,t=>{e||=t}),g=Xp(u,()=>{D(e)})}else g=Xp(Z(t,wh(150)),D);return _=setTimeout(()=>{y()},1200),qp(c,!0),l(`scrolling from index to`,{behavior:S,index:T,top:E},hm.DEBUG),{behavior:S,top:E}})),l),{scrollTargetReached:m,scrollToIndex:p,topListHeight:h}},Gp(_h,Tm,vm),{singleton:!0});function wh(e){return t=>{let n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}function Th(e,t){e==0?t():requestAnimationFrame(()=>{Th(e-1,t)})}function Eh(e,t){let n=t-1;return typeof e==`number`?e:e.index===`LAST`?n:e.index}var Dh=um(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{let s=Q(!0),c=Q(0),l=Q(!0);return J(Z(o,im(c),Y(([e,t])=>!!t),em(!1)),s),J(Z(o,im(c),Y(([e,t])=>!!t),em(!1)),l),Kp(Z(pm(t,o),im(s,n,e,l),Y(([[,e],t,{sizeTree:n},r,i])=>e&&(!Om(n)||Bp(r))&&!t&&!i),im(c)),([,e])=>{Xp(i,()=>{qp(l,!0)}),Th(4,()=>{Xp(r,()=>{qp(s,!0)}),qp(a,e)})}),{initialItemFinalLocationReached:l,initialTopMostItemIndex:c,scrolledToInitialItem:s}},Gp(_h,Tm,Ch,bh),{singleton:!0});function Oh(e,t){return Math.abs(e-t)<1.01}var kh=`up`,Ah=`down`,jh=`none`,Mh={atBottom:!1,notAtBottomBecause:`NOT_SHOWING_LAST_ITEM`,state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Nh=0,Ph=um(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{let o=Q(!1),s=Q(!0),c=cm(),l=cm(),u=Q(4),d=Q(Nh),f=sm(Z(mm(Z($(i),nm(1),em(!0)),Z($(i),nm(1),em(!1),Zp(100))),$p()),!1),p=sm(Z(mm(Z(n,em(!0)),Z(n,em(!1),Zp(200))),$p()),!1);J(Z(pm($(i),$(d)),X(([e,t])=>e<=t),$p()),s),J(Z(s,rm(50)),l);let m=lm(Z(pm(r,$(a),$(t),$(e),$(u)),tm((e,[{scrollHeight:t,scrollTop:n},r,i,a,o])=>{let s=n+r-t>-o,c={scrollHeight:t,scrollTop:n,viewportHeight:r};if(s){let t,r;return n>e.state.scrollTop?(t=`SCROLLED_DOWN`,r=e.state.scrollTop-n):(t=`SIZE_DECREASED`,r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:c}}let l;return l=c.scrollHeight>e.state.scrollHeight?`SIZE_INCREASED`:r<e.state.viewportHeight?`VIEWPORT_HEIGHT_DECREASING`:n<e.state.scrollTop?`SCROLLING_UPWARDS`:`NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM`,{atBottom:!1,notAtBottomBecause:l,state:c}},Mh),$p((e,t)=>e&&e.atBottom===t.atBottom))),h=sm(Z(r,tm((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(Oh(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{let i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Y(e=>e.changed),X(e=>e.jump)),0);J(Z(m,X(e=>e.atBottom)),o),J(Z(o,rm(50)),c);let g=Q(Ah);J(Z(r,X(({scrollTop:e})=>e),$p(),tm((e,t)=>Yp(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?kh:Ah,prevScrollTop:t},{direction:Ah,prevScrollTop:0}),X(e=>e.direction)),g),J(Z(r,rm(50),em(jh)),g);let _=Q(0);return J(Z(f,Y(e=>!e),em(0)),_),J(Z(i,rm(100),im(f),Y(([e,t])=>t),tm(([e,t],[n])=>[t,n],[0,0]),X(([e,t])=>t-e)),_),{atBottomState:m,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:l,atTopThreshold:d,isAtBottom:o,isAtTop:s,isScrolling:f,lastJumpDueToItemResize:h,scrollDirection:g,scrollVelocity:_}},Gp(Tm)),Fh=`top`,Ih=`bottom`,Lh=`none`;function Rh(e,t,n){return typeof e==`number`?n===kh&&t===Fh||n===Ah&&t===Ih?e:0:n===kh?t===Fh?e.main:e.reverse:t===Ih?e.main:e.reverse}function zh(e,t){return typeof e==`number`?e:e[t]??0}var Bh=um(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{let a=cm(),o=Q(0),s=Q(0),c=Q(0);return{increaseViewportBy:s,listBoundary:a,overscan:c,topListHeight:o,visibleRange:sm(Z(pm($(r),$(i),$(n),$(a,Jm),$(c),$(o),$(t),$(e),$(s)),X(([e,t,n,[r,i],a,o,s,c,l])=>{let u=e-c,d=o+s,f=Math.max(n-u,0),p=Lh,m=zh(l,Fh),h=zh(l,Ih);return r-=c,r+=n+s,i+=n+s,i-=c,r>e+d-m&&(p=kh),i<e-f+t+h&&(p=Ah),p===Lh?null:[Math.max(u-n-Rh(a,Fh,p)-m,0),u-f-s+t+Rh(a,Ih,p)+h]}),Y(e=>e!=null),$p(Jm)),[0,0])}},Gp(Tm),{singleton:!0});function Vh(e,t,n){if(eh(t)){let r=sh(e,t);return[{index:Am(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}var Hh={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Uh(e,t,n,r,i,a){let{lastIndex:o,lastOffset:s,lastSize:c}=i,l=0,u=0;if(e.length>0){l=e[0].offset;let t=e[e.length-1];u=t.offset+t.size}let d=n-o,f=s+d*c+(d-1)*r,p=l,m=f-u;return{bottom:u,firstItemIndex:a,items:Gh(e,i,a),offsetBottom:m,offsetTop:l,top:p,topItems:Gh(t,i,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function Wh(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-o>=e)break;o++}let s=e+o,c=Eh(t,s);return Uh(Array.from({length:s}).map((e,t)=>({data:a[t+c],index:t+c,offset:0,size:0})),[],s,i,n,r)}function Gh(e,t,n){if(e.length===0)return[];if(!eh(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let r=e[0].index,i=e[e.length-1].index,a=[],o=Nm(t.groupOffsetTree,r,i),s,c=0;for(let r of e){(!s||s.end<r.index)&&(s=o.shift(),c=t.groupIndices.indexOf(s.start));let e;e=r.index===s.start?{index:c,type:`group`}:{groupIndex:c,index:r.index-(c+1)+n},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function Kh(e,t){return e===void 0?0:typeof e==`number`?e:e[t]??0}var qh=um(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:s,visibleRange:c},{initialTopMostItemIndex:l,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:p},{recalcInProgress:m}])=>{let h=Q([]),g=Q(0),_=cm(),v=Q(0);J(a.topItemsIndexes,h);let y=sm(Z(pm(p,m,$(c,Jm),$(i),$(r),$(l),u,$(h),$(t),$(n),$(v),e),Y(([e,t,,n,,,,,,,,r])=>{let i=r&&r.length!==n;return e&&!t&&!i}),X(([,,[e,t],n,r,i,a,o,s,c,l,u])=>{let d=r,{offsetTree:f,sizeTree:p}=d,m=Yp(g);if(n===0)return{...Hh,totalCount:n};if(e===0&&t===0)return m===0?{...Hh,totalCount:n}:Wh(m,i,r,s,c,u||[]);if(Om(p))return m>0?null:Uh(Vh(Eh(i,n),d,u),[],n,c,d,s);let h=[];if(o.length>0){let e=o[0],t=o[o.length-1],n=0;for(let r of Nm(p,e,t)){let i=r.value,a=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=a;e<=o;e++)h.push({data:u?.[e],index:e,offset:n,size:i}),n+=i}}if(!a)return Uh([],h,n,c,d,s);let _=o.length>0?o[o.length-1]+1:0,v=lh(f,e,t,_);if(v.length===0)return null;let y=n-1,b=Up([],n=>{for(let r of v){let i=r.value,a=i.offset,o=r.start,s=i.size;if(i.offset<e){o+=Math.floor((e-i.offset+c)/(s+c));let t=o-r.start;a+=t*s+t*c}o<_&&(a+=(_-o)*s,o=_);let l=Math.min(r.end,y);for(let e=o;e<=l&&!(a>=t);e++)n.push({data:u?.[e],index:e,offset:a,size:s}),a+=s+c}}),x=Kh(l,Fh),S=Kh(l,Ih);if(b.length>0&&(x>0||S>0)){let e=b[0],t=b[b.length-1];if(x>0&&e.index>_){let t=Math.min(x,e.index-_),n=[],r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){let t=Nm(p,i,i)[0]?.value??e.size;r-=t+c,n.unshift({data:u?.[i],index:i,offset:r,size:t})}b.unshift(...n)}if(S>0&&t.index<y){let e=Math.min(S,y-t.index),n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){let e=Nm(p,r,r)[0]?.value??t.size;b.push({data:u?.[r],index:r,offset:n,size:e}),n+=e+c}}}return Uh(b,h,n,c,d,s)}),Y(e=>e!==null),$p()),Hh);J(Z(e,Y(Bp),X(e=>e?.length)),i),J(Z(y,X(e=>e.topListHeight)),d),J(d,s),J(Z(y,X(e=>[e.top,e.bottom])),o),J(Z(y,X(e=>e.items)),_);let b=lm(Z(y,Y(({items:e})=>e.length>0),im(i,e),Y(([{items:e},t])=>e[e.length-1].originalIndex===t-1),X(([,e,t])=>[e-1,t]),$p(Jm),X(([e])=>e))),x=lm(Z(y,rm(200),Y(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),X(({items:e})=>e[0].index),$p()));return{endReached:b,initialItemCount:g,itemsRendered:_,listState:y,minOverscanItemCount:v,rangeChanged:lm(Z(y,Y(({items:e})=>e.length>0),X(({items:e})=>{let t=0,n=e.length-1;for(;e[t].type===`group`&&t<n;)t++;for(;e[n].type===`group`&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),$p(qm))),startReached:x,topItemsIndexes:h,...f}},Gp(_h,yh,Bh,Dh,Ch,Ph,bh,Ym),{singleton:!0}),Jh=um(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{let a=cm(),o=sm(Z(pm(n,e,r,t,i),X(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return J($(o),a),{totalListHeight:o,totalListHeightChanged:a}},Gp(Tm,qh),{singleton:!0}),Yh=um(([{viewportHeight:e},{totalListHeight:t}])=>{let n=Q(!1);return{alignToBottom:n,paddingTopAddition:sm(Z(pm(n,e,t),Y(([e])=>e),X(([,e,t])=>Math.max(0,e-t)),rm(0),$p()),0)}},Gp(Tm,Jh),{singleton:!0}),Xh=um(()=>({context:Q(null)})),Zh=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??`start`,behavior:r}:e>a?{...i,align:n??`end`,behavior:r}:null,Qh=um(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:s,viewportHeight:c},{scrollToIndex:l}])=>{let u=cm();return J(Z(u,im(t,c,n,a,i,r,s),im(e),X(([[e,t,n,r,i,a,s,c],l])=>{let{align:u,behavior:d,calculateViewLocation:f=Zh,done:p,...m}=e,h=ch(e,t,r-1),g=oh(h,t.offsetTree,l)+i+a,_=g+Am(t.sizeTree,h)[1],v=c+a,y=c+n-s,b=f({itemBottom:_,itemTop:g,locationParams:{align:u,behavior:d,...m},viewportBottom:y,viewportTop:v});return b?p&&Xp(Z(o,Y(e=>!e),nm(Yp(o)?1:2)),p):p?.(),b}),Y(e=>e!==null)),l),{scrollIntoView:u}},Gp(_h,Tm,Ch,qh,vm),{singleton:!0});function $h(e){return e?e===`smooth`?`smooth`:`auto`:!1}var eg=(e,t)=>typeof e==`function`?$h(e(t)):t&&$h(e),tg=um(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:s},{didMount:c,propsReady:l},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:p}])=>{let m=Q(!1),h=cm(),g=null;function _(e){qp(o,{align:`end`,behavior:e,index:`LAST`})}Kp(Z(pm(Z($(t),nm(1)),c),im($(m),a,s,d),X(([[e,t],n,r,i,a])=>{let o=t&&i,s=`auto`;return o&&(s=eg(n,r||a),o&&=!!s),{followOutputBehavior:s,shouldFollow:o,totalCount:e}}),Y(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{g&&=(g(),null),Yp(n)?requestAnimationFrame(()=>{Yp(u)(`following output to `,{totalCount:r},hm.DEBUG),_(t)}):g=Xp(e,()=>{Yp(u)(`following output to `,{totalCount:r},hm.DEBUG),_(t),g=null})});function v(e){let t=Xp(i,t=>{e&&!t.atBottom&&t.notAtBottomBecause===`SIZE_INCREASED`&&!g&&(Yp(u)(`scrolling to bottom due to increased size`,{},hm.DEBUG),_(`auto`))});setTimeout(t,100)}Kp(Z(pm($(m),t,l),Y(([e,,t])=>e&&t),tm(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),Y(({refreshed:e})=>e),im(m,t)),([,e])=>{Yp(s)&&v(e!==!1)}),Kp(h,()=>{v(Yp(m)!==!1)}),Kp(pm($(m),i),([e,t])=>{e&&!t.atBottom&&t.notAtBottomBecause===`VIEWPORT_HEIGHT_DECREASING`&&_(`auto`)});let y=Q(null),b=cm();return J(mm(Z($(r),X(e=>e?.length??0)),Z($(t))),b),Kp(Z(pm(Z(b,nm(1)),c),im($(y),s,d,f),X(([[e,t],n,r,i,a])=>t&&r&&n?.({context:a,totalCount:e,scrollingInProgress:i})),Y(e=>!!e),rm(0)),t=>{g&&=(g(),null),Yp(n)?requestAnimationFrame(()=>{Yp(u)(`scrolling into view`,{}),qp(p,t)}):g=Xp(e,()=>{Yp(u)(`scrolling into view`,{}),qp(p,t),g=null})}),{autoscrollToBottom:h,followOutput:m,scrollIntoViewOnChange:y}},Gp(_h,Ph,Ch,Dh,bh,vm,Tm,Xh,Qh)),ng=um(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(J(Z(s,im(a),Y(([,e])=>e!==0),im(i,r,t,n,e),X(([[,e],t,n,r,i,a=[]])=>Wh(e,t,n,r,i,a))),o),{}),Gp(_h,Dh,qh,bh),{singleton:!0}),rg=um(([{didMount:e},{scrollTo:t},{listState:n}])=>{let r=Q(0);return Kp(Z(e,im(r),Y(([,e])=>e!==0),X(([,e])=>({top:e}))),e=>{Xp(Z(n,nm(1),Y(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{qp(t,e)})})}),{initialScrollTop:r}},Gp(bh,Tm,qh),{singleton:!0}),ig=um(([{scrollVelocity:e}])=>{let t=Q(!1),n=cm(),r=Q(!1);return J(Z(e,im(r,t,n),Y(([e,t])=>!!t),X(([e,t,n,r])=>{let{enter:i,exit:a}=t;if(n){if(a(e,r))return!1}else if(i(e,r))return!0;return n}),$p()),t),Kp(Z(pm(t,e,n),im(r)),([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},Gp(Ph),{singleton:!0}),ag=um(([{scrollContainerState:e,scrollTo:t}])=>{let n=cm(),r=cm(),i=cm(),a=Q(!1),o=Q(void 0);return J(Z(pm(n,r),X(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),J(Z(t,im(r),X(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Gp(Tm)),og=um(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:c}])=>{let l=cm(),u=Q(void 0),d=Q(null),f=Q(null);return J(s,d),J(c,f),Kp(Z(l,im(t,r,o,d,f,n)),([e,t,n,r,i,a,o])=>{let s=dh(t.sizeTree);r&&i!==null&&a!==null&&(n=i.scrollTop-a.offsetTop),n-=o,e({ranges:s,scrollTop:n})}),J(Z(u,Y(Bp),X(sg)),i),J(Z(a,im(u),Y(([,e])=>e!==void 0),$p(),X(([,e])=>e.ranges)),e),{getState:l,restoreStateFrom:u}},Gp(_h,Tm,Dh,bh,ag));function sg(e){return{align:`start`,index:0,offset:e.scrollTop}}var cg=um(([{topItemsIndexes:e}])=>{let t=Q(0);return J(Z(t,Y(e=>e>=0),X(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},Gp(qh));function lg(e){let t=!1,n;return(()=>(t||(t=!0,n=e()),n))}var ug=lg(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),dg=um(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:a,groupIndices:o,heightEstimates:s,itemSize:c,sizeRanges:l,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:p},{initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g},_,v,y,b,{scrollToIndex:x},S,{topItemCount:C},{groupCounts:w},T])=>{let{listState:E,minOverscanItemCount:D,topItemsIndexes:O,rangeChanged:k,...A}=b;return J(k,T.scrollSeekRangeChanged),J(Z(T.windowViewportRect,X(e=>e.visibleHeight)),_.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:a,groupCounts:w,heightEstimates:s,initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g,sizeRanges:l,topItemCount:C,topItemsIndexes:O,totalCount:f,...y,groupIndices:o,itemSize:c,listState:E,minOverscanItemCount:D,scrollToIndex:x,statefulTotalCount:d,trackItemSizes:p,rangeChanged:k,...A,...T,..._,sizes:u,...v}},Gp(_h,Dh,Tm,og,tg,qh,Ch,um(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:s},{listState:c},{beforeUnshiftWith:l,gap:u,shiftWithOffset:d,sizes:f},{log:p},{recalcInProgress:m}])=>{let h=lm(Z(c,im(o),tm(([,e,t,n],[{bottom:r,items:i,offsetBottom:a,totalCount:o},s])=>{let c=r+a,l=0;return t===o&&e.length>0&&i.length>0&&(i[0].originalIndex===0&&e[0].originalIndex===0||(l=c-n,l!==0&&(l+=s))),[l,i,o,c]},[0,[],0,0]),Y(([e])=>e!==0),im(r,s,n,i,p,m),Y(([,e,t,n,,,r])=>!r&&!n&&e!==0&&t===kh),X(([[e],,,,,t])=>(t(`Upward scrolling compensation`,{amount:e},hm.DEBUG),e))));function g(n){n>0?(qp(t,{behavior:`auto`,top:-n}),qp(e,0)):(qp(e,0),qp(t,{behavior:`auto`,top:-n}))}return Kp(Z(h,im(e,a)),([t,n,r])=>{r&&ug()?qp(e,n-t):g(-t)}),Kp(Z(pm(sm(a,!1),e,m),Y(([e,t,n])=>!e&&!n&&t!==0),X(([e,t])=>t),rm(1)),g),J(Z(d,X(e=>({top:-e}))),t),Kp(Z(l,im(f,u),X(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function a(e){return e*(n+i)}if(t.length===0)return a(e);{let n=0,i=km(r,0),o=0,s=0;for(;o<e;){o++,n+=i;let r=t.length===s+1?1/0:t[s+1]-t[s]-1;o+r>e&&(n-=i,r=e-o+1),o+=r,n+=a(r),s++}return n}})),n=>{qp(e,n),requestAnimationFrame(()=>{qp(t,{top:n}),requestAnimationFrame(()=>{qp(e,0),qp(m,!1)})})}),{deviation:e}},Gp(Tm,Ph,qh,_h,vm,Ym)),cg,yh,um(([e,t,n,r,i,a,o,s,c,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...c,...l,...u}),Gp(Bh,ng,bh,ig,Jh,rg,Yh,ag,Qh,vm,Xh))));function fg(e,t){let n={},r={},i=0,a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(let e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}var pg=typeof document<`u`?G.useLayoutEffect:G.useEffect;function mg(e,t,n){let r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=G.createContext({});function c(e,n){e.propsReady&&qp(e.propsReady,!1);for(let i of r){let r=e[t.required[i]];qp(r,n[i])}for(let r of i)if(r in n){let i=e[t.optional[r]];qp(i,n[r])}e.propsReady&&qp(e.propsReady,!0)}function l(e){return a.reduce((n,r)=>(n[r]=n=>{let i=e[t.methods[r]];qp(i,n)},n),{})}function u(e){return o.reduce((n,r)=>(n[r]=om(e[t.events[r]]),n),{})}return{Component:G.forwardRef((t,a)=>{let{children:d,...f}=t,[p]=G.useState(()=>Up(fm(e),e=>{c(e,f)})),[m]=G.useState(Rp(u,p));pg(()=>{for(let e of o)e in f&&Kp(m[e],f[e]);return()=>{Object.values(m).map(Jp)}},[f,m,p]),pg(()=>{c(p,f)}),G.useImperativeHandle(a,Fp(l(p)));let h=n;return(0,K.jsx)(s.Provider,{value:p,children:n?(0,K.jsx)(h,{...fg([...r,...i,...o],f),children:d}):d})}),useEmitter:(e,t)=>{let n=G.useContext(s)[e];pg(()=>Kp(n,t),[t,n])},useEmitterValue:e=>{let t=G.useContext(s)[e],[n,r]=G.useState(Rp(Yp,t));return pg(()=>Kp(t,e=>{e!==n&&r(Fp(e))}),[t,n]),n},usePublisher:e=>{let t=G.useContext(s);return G.useCallback(n=>{qp(t[e],n)},[t,e])}}}var hg=G.createContext(void 0),gg=G.createContext(void 0),_g=typeof document<`u`?G.useLayoutEffect:G.useEffect;function vg(e){return`self`in e}function yg(e){return`body`in e}function bg(e,t,n,r=Hp,i,a){let o=G.useRef(null),s=G.useRef(null),c=G.useRef(null),l=G.useCallback(n=>{let r,i,o,l=n.target;if(yg(l)||vg(l)){let e=vg(l)?l:l.defaultView;o=a?e.scrollX:e.scrollY,r=a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a?e.innerWidth:e.innerHeight}else o=a?l.scrollLeft:l.scrollTop,r=a?l.scrollWidth:l.scrollHeight,i=a?l.offsetWidth:l.offsetHeight;let u=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync?u():Ps.flushSync(u),s.current!==null&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&=(clearTimeout(c.current),null))},[e,t,a]);G.useEffect(()=>{let e=i||o.current;return r(i||o.current),l({suppressFlushSync:!0,target:e}),e.addEventListener(`scroll`,l,{passive:!0}),()=>{r(null),e.removeEventListener(`scroll`,l)}},[o,l,n,r,i]);function u(n){let r=o.current;if(!r||(a?`offsetWidth`in r&&r.offsetWidth===0:`offsetHeight`in r&&r.offsetHeight===0))return;let i=n.behavior===`smooth`,l,u,d;vg(r)?(u=Math.max($m(r.document.documentElement,a?`width`:`height`),a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),l=a?r.innerWidth:r.innerHeight,d=a?window.scrollX:window.scrollY):(u=r[a?`scrollWidth`:`scrollHeight`],l=$m(r,a?`width`:`height`),d=r[a?`scrollLeft`:`scrollTop`]);let f=u-l;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),Oh(l,u)||n.top===d){e({scrollHeight:u,scrollTop:d,viewportHeight:l}),i&&t(!0);return}i?(s.current=n.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,a&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}function d(e){a&&(e={behavior:e.behavior,left:e.top}),o.current.scrollBy(e)}return{scrollByCallback:d,scrollerRef:o,scrollToCallback:u}}var xg=`-webkit-sticky`,Sg=`sticky`,Cg=lg(()=>{if(typeof document>`u`)return Sg;let e=document.createElement(`div`);return e.style.position=xg,e.style.position===xg?xg:Sg});function wg(e){return e}var Tg=um(([e,t])=>({...e,...t}),Gp(dg,um(()=>{let e=Q(e=>`Item ${e}`),t=Q(e=>`Group ${e}`),n=Q({}),r=Q(wg),i=Q(`div`),a=Q(Hp),o=(e,t=null)=>sm(Z(n,X(t=>t[e]),$p()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o(`EmptyPlaceholder`),FooterComponent:o(`Footer`),GroupComponent:o(`Group`,`div`),groupContent:t,HeaderComponent:o(`Header`),HeaderFooterTag:i,ItemComponent:o(`Item`,`div`),itemContent:e,ListComponent:o(`List`,`div`),ScrollerComponent:o(`Scroller`,`div`),scrollerRef:a,ScrollSeekPlaceholder:o(`ScrollSeekPlaceholder`),TopItemListComponent:o(`TopItemList`)}}))),Eg=({height:e})=>(0,K.jsx)(`div`,{style:{height:e}}),Dg={overflowAnchor:`none`,position:Cg(),zIndex:1},Og={overflowAnchor:`none`},kg={...Og,display:`inline-block`,height:`100%`},Ag=G.memo(function({showTopList:e=!1}){let t=Kg(`listState`),n=qg(`sizeRanges`),r=Kg(`useWindowScroll`),i=Kg(`customScrollParent`),a=qg(`windowScrollContainerState`),o=qg(`scrollContainerState`),s=i||r?a:o,c=Kg(`itemContent`),l=Kg(`context`),u=Kg(`groupContent`),d=Kg(`trackItemSizes`),f=Kg(`itemSize`),p=Kg(`log`),m=qg(`gap`),h=Kg(`horizontalDirection`),{callbackRef:g}=xm(n,f,d,e?Hp:s,p,m,i,h,Kg(`skipAnimationFrameInResizeObserver`)),[_,v]=G.useState(0);Gg(`deviation`,e=>{_!==e&&v(e)});let y=Kg(`EmptyPlaceholder`),b=Kg(`ScrollSeekPlaceholder`)||Eg,x=Kg(`ListComponent`),S=Kg(`ItemComponent`),C=Kg(`GroupComponent`),w=Kg(`computeItemKey`),T=Kg(`isSeeking`),E=Kg(`groupIndices`).length>0,D=Kg(`alignToBottom`),O=Kg(`initialItemFinalLocationReached`),k=e?{}:{boxSizing:`border-box`,...h?{display:`inline-block`,height:`100%`,marginLeft:_===0?D?`auto`:0:_,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:`nowrap`}:{marginTop:_===0?D?`auto`:0:_,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...O?{}:{visibility:`hidden`}};return!e&&t.totalCount===0&&y?(0,K.jsx)(y,{...Fg(y,l)}):(0,K.jsx)(x,{...Fg(x,l),"data-testid":e?`virtuoso-top-item-list`:`virtuoso-item-list`,ref:g,style:k,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,r=w(n+t.firstItemIndex,e.data,l);return T?(0,G.createElement)(b,{...Fg(b,l),height:e.size,index:e.index,key:r,type:e.type||`item`,...e.type===`group`?{}:{groupIndex:e.groupIndex}}):e.type===`group`?(0,G.createElement)(C,{...Fg(C,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:r,style:Dg},u(e.index,l)):(0,G.createElement)(S,{...Fg(S,l),...Ig(S,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:h?kg:Og},E?c(e.index,e.groupIndex,e.data,l):c(e.index,e.data,l))})})}),jg={height:`100%`,outline:`none`,overflowY:`auto`,position:`relative`,WebkitOverflowScrolling:`touch`},Mg={outline:`none`,overflowX:`auto`,position:`relative`},Ng=e=>({height:`100%`,position:`absolute`,top:0,width:`100%`,...e?{display:`flex`,flexDirection:`column`}:{}}),Pg={position:Cg(),top:0,width:`100%`,zIndex:1};function Fg(e,t){if(typeof e!=`string`)return{context:t}}function Ig(e,t){return{item:typeof e==`string`?void 0:t}}var Lg=G.memo(function(){let e=Kg(`HeaderComponent`),t=qg(`headerHeight`),n=Kg(`HeaderFooterTag`),r=ym(G.useMemo(()=>e=>{t($m(e,`height`))},[t]),!0,Kg(`skipAnimationFrameInResizeObserver`)),i=Kg(`context`);return e?(0,K.jsx)(n,{ref:r,children:(0,K.jsx)(e,{...Fg(e,i)})}):null}),Rg=G.memo(function(){let e=Kg(`FooterComponent`),t=qg(`footerHeight`),n=Kg(`HeaderFooterTag`),r=ym(G.useMemo(()=>e=>{t($m(e,`height`))},[t]),!0,Kg(`skipAnimationFrameInResizeObserver`)),i=Kg(`context`);return e?(0,K.jsx)(n,{ref:r,children:(0,K.jsx)(e,{...Fg(e,i)})}):null});function zg({useEmitter:e,useEmitterValue:t,usePublisher:n}){return G.memo(function({children:r,style:i,context:a,...o}){let s=n(`scrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`scrollerRef`),d=t(`horizontalDirection`)||!1,{scrollByCallback:f,scrollerRef:p,scrollToCallback:m}=bg(s,l,c,u,void 0,d);return e(`scrollTo`,m),e(`scrollBy`,f),(0,K.jsx)(c,{"data-testid":`virtuoso-scroller`,"data-virtuoso-scroller":!0,ref:p,style:{...d?Mg:jg,...i},tabIndex:0,...o,...Fg(c,a),children:r})})}function Bg({useEmitter:e,useEmitterValue:t,usePublisher:n}){return G.memo(function({children:r,style:i,context:a,...o}){let s=n(`windowScrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`totalListHeight`),d=t(`deviation`),f=t(`customScrollParent`),p=G.useRef(null),{scrollByCallback:m,scrollerRef:h,scrollToCallback:g}=bg(s,l,c,t(`scrollerRef`),f);return _g(()=>(h.current=f||p.current?.ownerDocument.defaultView,()=>{h.current=null}),[h,f]),e(`windowScrollTo`,g),e(`scrollBy`,m),(0,K.jsx)(c,{ref:p,"data-virtuoso-scroller":!0,style:{position:`relative`,...i,...u===0?{}:{height:u+d}},...o,...Fg(c,a),children:r})})}var Vg=({children:e})=>{let t=G.useContext(hg),n=qg(`viewportHeight`),r=qg(`fixedItemHeight`),i=Kg(`alignToBottom`),a=Kg(`horizontalDirection`),o=ym(G.useMemo(()=>Lp(n,e=>$m(e,a?`width`:`height`)),[n,a]),!0,Kg(`skipAnimationFrameInResizeObserver`));return G.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,K.jsx)(`div`,{"data-viewport-type":`element`,ref:o,style:Ng(i),children:e})},Hg=({children:e})=>{let t=G.useContext(hg),n=qg(`windowViewportRect`),r=qg(`fixedItemHeight`),i=wm(n,Kg(`customScrollParent`),Kg(`skipAnimationFrameInResizeObserver`)),a=Kg(`alignToBottom`);return G.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,K.jsx)(`div`,{"data-viewport-type":`window`,ref:i,style:Ng(a),children:e})},Ug=({children:e})=>{let t=Kg(`TopItemListComponent`)||`div`,n=Kg(`headerHeight`),r={...Pg,marginTop:`${n}px`},i=Kg(`context`);return(0,K.jsx)(t,{style:r,...Fg(t,i),children:e})},{Component:Wg,useEmitter:Gg,useEmitterValue:Kg,usePublisher:qg}=mg(Tg,{required:{},optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,scrollIntoViewOnChange:`scrollIntoViewOnChange`,itemContent:`itemContent`,groupContent:`groupContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,groupCounts:`groupCounts`,topItemCount:`topItemCount`,firstItemIndex:`firstItemIndex`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,heightEstimates:`heightEstimates`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`HeaderFooterTag`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,horizontalDirection:`horizontalDirection`,skipAnimationFrameInResizeObserver:`skipAnimationFrameInResizeObserver`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,autoscrollToBottom:`autoscrollToBottom`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},G.memo(function(e){let t=Kg(`useWindowScroll`),n=Kg(`topItemsIndexes`).length>0,r=Kg(`customScrollParent`),i=Kg(`context`);return(0,K.jsxs)(r||t?Yg:Jg,{...e,context:i,children:[n&&(0,K.jsx)(Ug,{children:(0,K.jsx)(Ag,{showTopList:!0})}),(0,K.jsxs)(r||t?Hg:Vg,{children:[(0,K.jsx)(Lg,{}),(0,K.jsx)(Ag,{}),(0,K.jsx)(Rg,{})]})]})})),Jg=zg({useEmitter:Gg,useEmitterValue:Kg,usePublisher:qg}),Yg=Bg({useEmitter:Gg,useEmitterValue:Kg,usePublisher:qg}),Xg=Wg,Zg=um(([e,t])=>({...e,...t}),Gp(dg,um(()=>{let e=Q(e=>(0,K.jsxs)(`td`,{children:[`Item $`,e]})),t=Q(null),n=Q(e=>(0,K.jsxs)(`td`,{colSpan:1e3,children:[`Group `,e]})),r=Q(null),i=Q(null),a=Q({}),o=Q(wg),s=Q(Hp),c=(e,t=null)=>sm(Z(a,X(t=>t[e]),$p()),t);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:c(`EmptyPlaceholder`),FillerRow:c(`FillerRow`),fixedFooterContent:i,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`),TableBodyComponent:c(`TableBody`,`tbody`),TableComponent:c(`Table`,`table`),TableFooterComponent:c(`TableFoot`,`tfoot`),TableHeadComponent:c(`TableHead`,`thead`),TableRowComponent:c(`TableRow`,`tr`),GroupComponent:c(`Group`,`tr`)}}))),Qg=({height:e})=>(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{style:{height:e}})}),$g=({height:e})=>(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{style:{border:0,height:e,padding:0}})}),e_={overflowAnchor:`none`},t_={position:Cg(),zIndex:2,overflowAnchor:`none`},n_=G.memo(function({showTopList:e=!1}){let t=c_(`listState`),n=c_(`computeItemKey`),r=c_(`firstItemIndex`),i=c_(`context`),a=c_(`isSeeking`),o=c_(`fixedHeaderHeight`),s=c_(`groupIndices`).length>0,c=c_(`itemContent`),l=c_(`groupContent`),u=c_(`ScrollSeekPlaceholder`)||Qg,d=c_(`GroupComponent`),f=c_(`TableRowComponent`),p=(e?t.topItems:[]).reduce((e,t,n)=>(n===0?e.push(t.size):e.push(e[n-1]+t.size),e),[]),m=(e?t.topItems:t.items).map(t=>{let m=t.originalIndex,h=n(m+r,t.data,i),g=e?m===0?0:p[m-1]:0;return a?(0,G.createElement)(u,{...Fg(u,i),height:t.size,index:t.index,key:h,type:t.type||`item`}):t.type===`group`?(0,G.createElement)(d,{...Fg(d,i),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,key:h,style:{...t_,top:o}},l(t.index,i)):(0,G.createElement)(f,{...Fg(f,i),...Ig(f,t.data),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:h,style:e?{...t_,top:o+g}:e_},s?c(t.index,t.groupIndex,t.data,i):c(t.index,t.data,i))});return(0,K.jsx)(K.Fragment,{children:m})}),r_=G.memo(function(){let e=c_(`listState`),t=c_(`topItemsIndexes`).length>0,n=l_(`sizeRanges`),r=c_(`useWindowScroll`),i=c_(`customScrollParent`),a=l_(`windowScrollContainerState`),o=l_(`scrollContainerState`),s=i||r?a:o,c=c_(`trackItemSizes`),{callbackRef:l,ref:u}=xm(n,c_(`itemSize`),c,s,c_(`log`),void 0,i,!1,c_(`skipAnimationFrameInResizeObserver`)),[d,f]=G.useState(0);s_(`deviation`,e=>{d!==e&&(u.current.style.marginTop=`${e}px`,f(e))});let p=c_(`EmptyPlaceholder`),m=c_(`FillerRow`)||$g,h=c_(`TableBodyComponent`),g=c_(`paddingTopAddition`),_=c_(`statefulTotalCount`),v=c_(`context`);if(_===0&&p)return(0,K.jsx)(p,{...Fg(p,v)});let y=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),b=e.offsetTop+g+d-y,x=e.offsetBottom,S=b>0?(0,K.jsx)(m,{context:v,height:b},`padding-top`):null,C=x>0?(0,K.jsx)(m,{context:v,height:x},`padding-bottom`):null;return(0,K.jsxs)(h,{"data-testid":`virtuoso-item-list`,ref:l,...Fg(h,v),children:[S,t&&(0,K.jsx)(n_,{showTopList:!0}),(0,K.jsx)(n_,{}),C]})}),i_=({children:e})=>{let t=G.useContext(hg),n=l_(`viewportHeight`),r=l_(`fixedItemHeight`),i=ym(G.useMemo(()=>Lp(n,e=>$m(e,`height`)),[n]),!0,c_(`skipAnimationFrameInResizeObserver`));return G.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,K.jsx)(`div`,{"data-viewport-type":`element`,ref:i,style:Ng(!1),children:e})},a_=({children:e})=>{let t=G.useContext(hg),n=l_(`windowViewportRect`),r=l_(`fixedItemHeight`),i=wm(n,c_(`customScrollParent`),c_(`skipAnimationFrameInResizeObserver`));return G.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,K.jsx)(`div`,{"data-viewport-type":`window`,ref:i,style:Ng(!1),children:e})},{Component:o_,useEmitter:s_,useEmitterValue:c_,usePublisher:l_}=mg(Zg,{required:{},optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,firstItemIndex:`firstItemIndex`,itemContent:`itemContent`,groupContent:`groupContent`,fixedHeaderContent:`fixedHeaderContent`,fixedFooterContent:`fixedFooterContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,topItemCount:`topItemCount`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,groupCounts:`groupCounts`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},G.memo(function(e){let t=c_(`useWindowScroll`),n=c_(`customScrollParent`),r=l_(`fixedHeaderHeight`),i=l_(`fixedFooterHeight`),a=c_(`fixedHeaderContent`),o=c_(`fixedFooterContent`),s=c_(`context`),c=ym(G.useMemo(()=>Lp(r,e=>$m(e,`height`)),[r]),!0,c_(`skipAnimationFrameInResizeObserver`)),l=ym(G.useMemo(()=>Lp(i,e=>$m(e,`height`)),[i]),!0,c_(`skipAnimationFrameInResizeObserver`)),u=n||t?d_:u_,d=n||t?a_:i_,f=c_(`TableComponent`),p=c_(`TableHeadComponent`),m=c_(`TableFooterComponent`),h=a?(0,K.jsx)(p,{ref:c,style:{position:`sticky`,top:0,zIndex:2},...Fg(p,s),children:a()},`TableHead`):null,g=o?(0,K.jsx)(m,{ref:l,style:{bottom:0,position:`sticky`,zIndex:1},...Fg(m,s),children:o()},`TableFoot`):null;return(0,K.jsx)(u,{...e,...Fg(u,s),children:(0,K.jsx)(d,{children:(0,K.jsxs)(f,{style:{borderSpacing:0,overflowAnchor:`none`},...Fg(f,s),children:[h,(0,K.jsx)(r_,{},`TableBody`),g]})})})})),u_=zg({useEmitter:s_,useEmitterValue:c_,usePublisher:l_}),d_=Bg({useEmitter:s_,useEmitterValue:c_,usePublisher:l_}),f_={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},p_={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:m_,floor:h_,max:g_,min:__,round:v_}=Math;function y_(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:n===null?null:n[r+e],index:r+e}))}function b_(e){return{...p_,items:e}}function x_(e,t){return e&&e.width===t.width&&e.height===t.height}function S_(e,t){return e&&e.column===t.column&&e.row===t.row}var C_=um(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:s,scrollTo:c,scrollTop:l,smoothScrollTargetReached:u,viewportHeight:d},f,p,{didMount:m,propsReady:h},{customScrollParent:g,useWindowScroll:_,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b},x])=>{let S=Q(0),C=Q(0),w=Q(f_),T=Q({height:0,width:0}),E=Q({height:0,width:0}),D=cm(),O=cm(),k=Q(0),A=Q(null),j=Q({column:0,row:0}),M=cm(),N=cm(),P=Q(!1),F=Q(0),I=Q(!0),L=Q(!1),ee=Q(!1);Kp(Z(m,im(F),Y(([e,t])=>!!t)),()=>{qp(I,!1)}),Kp(Z(pm(m,I,E,T,F,L),Y(([e,t,n,r,,i])=>e&&!t&&n.height!==0&&r.height!==0&&!i)),([,,,,e])=>{qp(L,!0),Th(1,()=>{qp(D,e)}),Xp(Z(l),()=>{qp(t,[0,0]),qp(I,!0)})}),J(Z(N,Y(e=>e!=null&&e.scrollTop>0),em(0)),C),Kp(Z(m,im(N),Y(([,e])=>e!=null)),([,e])=>{e&&(qp(T,e.viewport),qp(E,e.item),qp(j,e.gap),e.scrollTop>0&&(qp(P,!0),Xp(Z(l,nm(1)),e=>{qp(P,!1)}),qp(c,{top:e.scrollTop})))}),J(Z(T,X(({height:e})=>e)),d),J(Z(pm($(T,x_),$(E,x_),$(j,(e,t)=>e&&e.column===t.column&&e.row===t.row),$(l)),X(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),M),J(Z(pm($(S),r,$(j,S_),$(E,x_),$(T,x_),$(A),$(C),$(P),$(I),$(F)),Y(([,,,,,,,e])=>!e),X(([e,[t,n],r,i,a,o,s,,c,l])=>{let{column:u,row:d}=r,{height:f,width:p}=i,{width:m}=a;if(s===0&&(e===0||m===0))return f_;if(p===0){let t=Eh(l,e);return b_(y_(t,t+Math.max(s-1,0),o))}let h=w_(m,p,u),g,_;c?t===0&&n===0&&s>0?(g=0,_=s-1):(g=h*h_((t+d)/(f+d)),_=h*m_((n+d)/(f+d))-1,_=__(e-1,g_(_,h-1)),g=__(_,g_(0,g))):(g=0,_=-1);let v=y_(g,_,o),{bottom:y,top:b}=T_(a,r,i,v),x=m_(e/h);return{bottom:y,itemHeight:f,items:v,itemWidth:p,offsetBottom:x*f+(x-1)*d-y,offsetTop:b,top:b}})),w),J(Z(A,Y(e=>e!==null),X(e=>e.length)),S),J(Z(pm(T,E,w,j),Y(([e,t,{items:n}])=>n.length>0&&t.height!==0&&e.height!==0),X(([e,t,{items:n},r])=>{let{bottom:i,top:a}=T_(e,r,t,n);return[a,i]}),$p(Jm)),t);let te=Q(!1);J(Z(l,im(te),X(([e,t])=>t||e!==0)),te);let ne=lm(Z(pm(w,S),Y(([{items:e}])=>e.length>0),im(te),Y(([[e,t],n])=>{let r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&e.offsetBottom===0&&e.items.length===t)&&r}),X(([[,e]])=>e-1),$p())),re=lm(Z($(w),Y(({items:e})=>e.length>0&&e[0].index===0),em(0),$p())),ie=lm(Z($(w),im(P),Y(([{items:e},t])=>e.length>0&&!t),X(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),$p(qm),rm(0)));J(ie,p.scrollSeekRangeChanged),J(Z(D,im(T,E,S,j),X(([e,t,n,r,i])=>{let a=Sh(e),{align:o,behavior:s,offset:c}=a,l=a.index;l===`LAST`&&(l=r-1),l=g_(0,l,__(r-1,l));let u=E_(t,i,n,l);return o===`end`?u=v_(u-t.height+n.height):o===`center`&&(u=v_(u-t.height/2+n.height/2)),c&&(u+=c),{behavior:s,top:u}})),c);let ae=sm(Z(w,X(e=>e.offsetBottom+e.bottom)),0);return J(Z(b,X(e=>({height:e.visibleHeight,width:e.visibleWidth}))),T),{customScrollParent:g,data:A,deviation:k,footerHeight:i,gap:j,headerHeight:a,increaseViewportBy:e,initialItemCount:C,itemDimensions:E,overscan:n,restoreStateFrom:N,scrollBy:o,scrollContainerState:s,scrollHeight:O,scrollTo:c,scrollToIndex:D,scrollTop:l,smoothScrollTargetReached:u,totalCount:S,useWindowScroll:_,viewportDimensions:T,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b,...p,gridState:w,horizontalDirection:ee,initialTopMostItemIndex:F,totalListHeight:ae,...f,endReached:ne,propsReady:h,rangeChanged:ie,startReached:re,stateChanged:M,stateRestoreInProgress:P,...x}},Gp(Bh,Tm,Ph,ig,bh,ag,vm));function w_(e,t,n){return g_(1,h_((e+n)/(h_(t)+n)))}function T_(e,t,n,r){let{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};let a=E_(e,t,n,r[0].index);return{bottom:E_(e,t,n,r[r.length-1].index)+i,top:a}}function E_(e,t,n,r){let i=h_(r/w_(e.width,n.width,t.column)),a=i*n.height+g_(0,i-1)*t.row;return a>0?a+t.row:a}var D_=um(([e,t])=>({...e,...t}),Gp(C_,um(()=>{let e=Q(e=>`Item ${e}`),t=Q({}),n=Q(null),r=Q(`virtuoso-grid-item`),i=Q(`virtuoso-grid-list`),a=Q(wg),o=Q(`div`),s=Q(Hp),c=(e,n=null)=>sm(Z(t,X(t=>t[e]),$p()),n),l=Q(!1),u=Q(!1);return J($(u),l),{components:t,computeItemKey:a,context:n,FooterComponent:c(`Footer`),HeaderComponent:c(`Header`),headerFooterTag:o,itemClassName:r,ItemComponent:c(`Item`,`div`),itemContent:e,listClassName:i,ListComponent:c(`List`,`div`),readyStateChanged:l,reportReadyState:u,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`,`div`)}}))),O_=G.memo(function(){let e=F_(`gridState`),t=F_(`listClassName`),n=F_(`itemClassName`),r=F_(`itemContent`),i=F_(`computeItemKey`),a=F_(`isSeeking`),o=I_(`scrollHeight`),s=F_(`ItemComponent`),c=F_(`ListComponent`),l=F_(`ScrollSeekPlaceholder`),u=F_(`context`),d=I_(`itemDimensions`),f=I_(`gap`),p=F_(`log`),m=F_(`stateRestoreInProgress`),h=I_(`reportReadyState`),g=ym(G.useMemo(()=>e=>{let t=e.parentElement.parentElement.scrollHeight;o(t);let n=e.firstChild;if(n){let{height:e,width:t}=n.getBoundingClientRect();d({height:e,width:t})}f({column:z_(`column-gap`,getComputedStyle(e).columnGap,p),row:z_(`row-gap`,getComputedStyle(e).rowGap,p)})},[o,d,f,p]),!0,!1);return _g(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),m?null:(0,K.jsx)(c,{className:t,ref:g,...Fg(c,u),"data-testid":`virtuoso-item-list`,style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let o=i(t.index,t.data,u);return a?(0,K.jsx)(l,{...Fg(l,u),height:e.itemHeight,index:t.index,width:e.itemWidth},o):(0,G.createElement)(s,{...Fg(s,u),className:n,"data-index":t.index,key:o},r(t.index,t.data,u))})})}),k_=G.memo(function(){let e=F_(`HeaderComponent`),t=I_(`headerHeight`),n=F_(`headerFooterTag`),r=ym(G.useMemo(()=>e=>{t($m(e,`height`))},[t]),!0,!1),i=F_(`context`);return e?(0,K.jsx)(n,{ref:r,children:(0,K.jsx)(e,{...Fg(e,i)})}):null}),A_=G.memo(function(){let e=F_(`FooterComponent`),t=I_(`footerHeight`),n=F_(`headerFooterTag`),r=ym(G.useMemo(()=>e=>{t($m(e,`height`))},[t]),!0,!1),i=F_(`context`);return e?(0,K.jsx)(n,{ref:r,children:(0,K.jsx)(e,{...Fg(e,i)})}):null}),j_=({children:e})=>{let t=G.useContext(gg),n=I_(`itemDimensions`),r=I_(`viewportDimensions`),i=ym(G.useMemo(()=>e=>{r(e.getBoundingClientRect())},[r]),!0,!1);return G.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),(0,K.jsx)(`div`,{ref:i,style:Ng(!1),children:e})},M_=({children:e})=>{let t=G.useContext(gg),n=I_(`windowViewportRect`),r=I_(`itemDimensions`),i=wm(n,F_(`customScrollParent`),!1);return G.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),(0,K.jsx)(`div`,{ref:i,style:Ng(!1),children:e})},{Component:N_,useEmitter:P_,useEmitterValue:F_,usePublisher:I_}=mg(D_,{optional:{context:`context`,totalCount:`totalCount`,overscan:`overscan`,itemContent:`itemContent`,components:`components`,computeItemKey:`computeItemKey`,data:`data`,initialItemCount:`initialItemCount`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`headerFooterTag`,listClassName:`listClassName`,itemClassName:`itemClassName`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,restoreStateFrom:`restoreStateFrom`,initialTopMostItemIndex:`initialTopMostItemIndex`,increaseViewportBy:`increaseViewportBy`},methods:{scrollTo:`scrollTo`,scrollBy:`scrollBy`,scrollToIndex:`scrollToIndex`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,stateChanged:`stateChanged`,readyStateChanged:`readyStateChanged`}},G.memo(function({...e}){let t=F_(`useWindowScroll`),n=F_(`customScrollParent`),r=n||t?R_:L_,i=n||t?M_:j_,a=F_(`context`);return(0,K.jsx)(r,{...e,...Fg(r,a),children:(0,K.jsxs)(i,{children:[(0,K.jsx)(k_,{}),(0,K.jsx)(O_,{}),(0,K.jsx)(A_,{})]})})})),L_=zg({useEmitter:P_,useEmitterValue:F_,usePublisher:I_}),R_=Bg({useEmitter:P_,useEmitterValue:F_,usePublisher:I_});function z_(e,t,n){return t!==`normal`&&!(t!=null&&t.endsWith(`px`))&&n(`${e} was not resolved to pixel value correctly`,t,hm.WARN),t===`normal`?0:parseInt(t??`0`,10)}function B_(e){let t=(0,q.c)(9),{option:n,checked:r,renderOption:i}=e,a=r||void 0,o=n.value,s;t[0]!==r||t[1]!==n||t[2]!==i?(s=i?i(n,{checked:r}):n.label,t[0]=r,t[1]=n,t[2]=i,t[3]=s):s=t[3];let c;return t[4]!==n.disabled||t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,K.jsx)(we,{"data-slot":`select-option`,"data-checked":a,value:o,disabled:n.disabled,children:s}),t[4]=n.disabled,t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c}var V_=G.memo(B_);function H_(e,...t){return typeof e==`function`?e(...t):e}function U_(e){switch(e.kind){case`select-all`:return`Select all`;case`deselect-all`:return`Deselect all`;case`select-matching`:return`Select ${e.items.length} matching`;case`deselect-matching`:return`Deselect ${e.items.length} matching`}}function W_(e){let t=(0,q.c)(55),{options:n,value:r,onChange:i,multiple:a,maxSelections:o,allowSelectNone:s,pinSelected:c,compactChipTrigger:l,placeholder:u,disabled:d,fullWidth:f,className:p,id:m,renderOption:h,renderEmpty:_,virtualizeThreshold:v,virtualizedHeight:y}=e,b=c!==void 0&&c,x=l!==void 0&&l,S=u===void 0?`Select...`:u,C=d!==void 0&&d,w=f!==void 0&&f,T=_===void 0?`Nothing found.`:_,E=v===void 0?200:v,D=y===void 0?200:y,O;t[0]!==s||t[1]!==o||t[2]!==a||t[3]!==i||t[4]!==n||t[5]!==b||t[6]!==r?(O={options:n,value:r,onChange:i,multiple:a,maxSelections:o,allowSelectNone:s,pinSelected:b},t[0]=s,t[1]=o,t[2]=a,t[3]=i,t[4]=n,t[5]=b,t[6]=r,t[7]=O):O=t[7];let k=_i(O),A;t[8]!==s||t[9]!==o||t[10]!==a||t[11]!==i?(A=e=>{if(!a){if(e==null&&!s)return;i(e);return}let t=Array.isArray(e)?e:[];o!=null&&t.length>o&&(t=t.slice(-o)),i(t)},t[8]=s,t[9]=o,t[10]=a,t[11]=i,t[12]=A):A=t[12];let j=A,M;if(t[13]!==k.bulkActions){if(M=k.bulkActions.map(G_),M.length>0){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(g,{"data-slot":`select-separator`},`_bulk_separator`),t[15]=e):e=t[15],M.push(e)}t[13]=k.bulkActions,t[14]=M}else M=t[14];let N;t[16]!==k.pinnedCount||t[17]!==k.visibleOptions.length?(N=e=>k.pinnedCount>0&&e===k.pinnedCount&&k.pinnedCount<k.visibleOptions.length?(0,K.jsx)(g,{"data-slot":`select-separator`},`_pinned_separator`):null,t[16]=k.pinnedCount,t[17]=k.visibleOptions.length,t[18]=N):N=t[18];let P=N,F;t[19]!==M||t[20]!==k||t[21]!==P||t[22]!==h||t[23]!==E||t[24]!==D?(F=()=>{if(k.visibleOptions.length>E)return(0,K.jsx)(Xg,{"data-slot":`select-list`,style:{height:D},totalCount:k.visibleOptions.length,overscan:50,itemContent:e=>{let t=k.visibleOptions[e];return(0,K.jsxs)(K.Fragment,{children:[e===0&&M,P(e),(0,K.jsx)(V_,{option:t,checked:k.isChecked(t.value),renderOption:h})]})}});let e=k.visibleOptions.flatMap((e,t)=>{let n=P(t),r=(0,K.jsx)(V_,{option:e,checked:k.isChecked(e.value),renderOption:h},String(e.value));return n?[n,r]:[r]});return(0,K.jsxs)(K.Fragment,{children:[M,e]})},t[19]=M,t[20]=k,t[21]=P,t[22]=h,t[23]=E,t[24]=D,t[25]=F):F=t[25];let I=F,L;t[26]!==k.labelOf||t[27]!==S?(L=e=>{let t=Array.isArray(e)?e:e==null?[]:[e];return t.length===0?(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:S}):(0,K.jsx)(Nr,{items:t.map(k.labelOf),max:3})},t[26]=k.labelOf,t[27]=S,t[28]=L):L=t[28];let ee=L,te=e[`data-testid`],ne;t[29]===k?ne=t[30]:(ne=e=>k.labelOf(e),t[29]=k,t[30]=ne);let re=x?ee:void 0,ie;t[31]!==p||t[32]!==w?(ie=W({"w-full":w},p),t[31]=p,t[32]=w,t[33]=ie):ie=t[33];let ae=k.searchQuery,oe=k.setSearchQuery,se=k.open,ce=k.setOpen,le;t[34]===T?le=t[35]:(le=H_(T),t[34]=T,t[35]=le);let ue;t[36]!==C||t[37]!==m||t[38]!==k.open||t[39]!==k.searchQuery||t[40]!==k.setOpen||t[41]!==k.setSearchQuery||t[42]!==S||t[43]!==te||t[44]!==ne||t[45]!==re||t[46]!==ie||t[47]!==le?(ue={"data-slot":`select-root`,"data-testid":te,displayValue:ne,renderValue:re,placeholder:S,className:ie,shouldFilter:!1,search:ae,onSearchChange:oe,open:se,onOpenChange:ce,emptyState:le,disabled:C,id:m},t[36]=C,t[37]=m,t[38]=k.open,t[39]=k.searchQuery,t[40]=k.setOpen,t[41]=k.setSearchQuery,t[42]=S,t[43]=te,t[44]=ne,t[45]=re,t[46]=ie,t[47]=le,t[48]=ue):ue=t[48];let de=ue,fe;return t[49]!==de||t[50]!==j||t[51]!==a||t[52]!==I||t[53]!==r?(fe=a?(0,K.jsx)(qe,{...de,multiple:!0,value:r,onValueChange:j,children:I()}):(0,K.jsx)(qe,{...de,multiple:!1,value:r,onValueChange:j,children:I()}),t[49]=de,t[50]=j,t[51]=a,t[52]=I,t[53]=r,t[54]=fe):fe=t[54],fe}function G_(e){let t=`enabled`in e?!e.enabled:e.items.length===0;return(0,K.jsx)(Qe,{"data-slot":`select-bulk`,className:`pl-6 m-1 py-1`,value:`__bulk_${e.kind}`,disabled:t,onSelect:()=>{t||e.run()},children:U_(e)},e.kind)}var K_=Yn,q_=Qn,J_=qn,Y_=$n,X_=e=>{let t=(0,q.c)(16),{error:n,badData:r,shadowRoot:i}=e;if(n instanceof ut){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(ms,{children:`Bad Data`}),t[0]=e):e=t[0];let a;t[1]===n.issues?a=t[2]:(a=n.issues.map(Q_),t[1]=n.issues,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,K.jsx)(`div`,{className:`text-md prose dark:prose-invert`,children:(0,K.jsx)(`ul`,{children:a})}),t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(Y_,{className:`py-2 text-[0.84375rem]`,children:`View Data:`}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=(0,K.jsx)(Ei,{data:r}),t[6]=r,t[7]=c);let l;t[8]!==i||t[9]!==c?(l=(0,K.jsx)(K_,{type:`single`,collapsible:!0,children:(0,K.jsxs)(J_,{value:`item-1`,className:`text-muted-foreground border-muted-foreground-20`,children:[s,(0,K.jsx)(q_,{className:`text-[0.84375rem]`,children:(0,K.jsx)(Fi,{container:i,children:c})})]})}),t[8]=i,t[9]=c,t[10]=l):l=t[10];let u;return t[11]!==o||t[12]!==l?(u=(0,K.jsxs)(hs,{variant:`destructive`,children:[e,o,l]}),t[11]=o,t[12]=l,t[13]=u):u=t[13],u}let a;return t[14]===n.message?a=t[15]:(a=(0,K.jsx)(`div`,{children:n.message}),t[14]=n.message,t[15]=a),a};function Z_(e,t,n){return(0,K.jsx)(X_,{error:e,badData:t,shadowRoot:n})}function Q_(e){let t=e.path.join(`.`);return(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`font-bold`,children:t}),`: `,e.message]},t)}var $_=3,ev=150;function tv({hostElement:e,plugin:t,children:n,getInitialValue:r},i){let[o,c]=(0,G.useState)(n),[l,u]=(0,G.useState)(r()),{theme:d}=zo(),[f,p]=(0,G.useState)(()=>t.validator.safeParse(ae(e))),[h,g]=(0,G.useState)(0);(0,G.useImperativeHandle)(i,()=>({reset:()=>{u(r()),p(t.validator.safeParse(ae(e))),g(e=>e+1)},setChildren:e=>{c(e)}})),Bt(e,us.TYPE,t=>{t.detail.element===e&&u(t.detail.value)}),(0,G.useEffect)(()=>{let n=new MutationObserver(n=>{n.some(e=>e.type===`attributes`&&e.attributeName?.startsWith(`data-`))&&p(t.validator.safeParse(ae(e)))});return n.observe(e,{attributes:!0}),()=>{n.disconnect()}},[e,t.validator]);let _=s(t=>{u(n=>{let r=Lt.asUpdater(t)(n);return Ep(r,n)||e.dispatchEvent(ls(r,e)),r})}),v=(0,G.useMemo)(()=>{if(!t.functions)return{};let n={};for(let[r,i]of Vt.entries(t.functions)){let{input:t,output:o}=i;n[r]=async(...n)=>{Ht(n.length<=1,`Plugin functions only supports a single argument. Called ${r}`);let i=dn(),s=m.findElementThroughShadowDOMs(e)?.id,c=s?m.parse(s):null;if(c&&!i){let e=a.get($e),t=e.cellRuntime[c],n=e.cellData[c];if(ne({executionTime:t.runElapsedTimeMs??n.lastExecutionTime,status:t.status,errored:t.errored,interrupted:t.interrupted,stopped:t.stopped}))throw new is}else U.warn(`Cell ID ${c} cannot be found`);let l=cv(t,n[0]);for(let t=0;;t++){let n=dv(e);Ht(n,`Object ID should exist`);let i=await kt.request({args:l,functionName:r,namespace:n});if(i.status.code===`ok`)return cv(o,i.return_value);let a=i.found===!1;if(a&&t<$_){let e=ev*2**t;await new Promise(t=>setTimeout(t,e));continue}throw U.error(i.status),a?new ns:Error(i.status.message||`Unknown error`)}}}return n},[t.functions,e,h]);return f.success?(0,K.jsx)(In,{children:(0,K.jsx)(`div`,{className:`contents ${d}`,children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(`div`,{}),children:(0,K.jsx)(Ui,{children:t.render({setValue:_,value:l,data:f.data,children:o,host:e,functions:v})})})})}):Z_(f.error,Vt.mapValues(e.dataset,e=>typeof e==`string`?Xe(e):e),e.shadowRoot)}var nv=G.forwardRef(tv),rv=new Map,iv=`__custom_marimo_element__`;function av(e){let t=class extends HTMLElement{observer;root;mounted=!1;pluginRef=(0,G.createRef)();__type__=iv;constructor(){super(),this.attachShadow({mode:`open`}),this.copyStyles(),this.observer=new MutationObserver(()=>{this.pluginRef.current?.setChildren(this.getChildren())})}connectedCallback(){this.isLightDOMChildOfMarimoElement()||(this.mounted||(Ht(this.shadowRoot,`Shadow root should exist`),this.root&&this.root.unmount(),this.root=zl.createRoot(this.shadowRoot),this.mountReactComponent()),this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this.observer.disconnect(),this.root?.unmount(),this.mounted&&=!1}isLightDOMChildOfMarimoElement(){let e=this.parentElement;for(;e;){if(sv(e))return!0;e=e.parentElement}return!1}reset(){this.dispatchEvent(ls(Xe(this.dataset.initialValue),this)),this.rerender()}rerender(){this.pluginRef.current?.reset()}getChildren(){return this.children.length===0?null:this.children.length===1?$o({html:this.innerHTML,alwaysSanitizeHtml:!1}):Array.from(this.children).map((e,t)=>(0,K.jsx)(G.Fragment,{children:$o({html:e.outerHTML,alwaysSanitizeHtml:!1})},t))}async mountReactComponent(){this.mounted=!0,Ht(this.root,`Root must be defined`),this.root.render((0,K.jsx)(o,{store:a,children:(0,K.jsx)(Nf,{children:(0,K.jsx)(nv,{hostElement:this,plugin:e,ref:this.pluginRef,getInitialValue:()=>v(this,wt.INSTANCE),children:this.getChildren()})})}))}async copyStyles(){let t=this.shadowRoot;if(Ht(t,`Shadow root should exist`),!this.isAdoptedStyleSheetsSupported()){U.warn(`adoptedStyleSheets not supported, copying stylesheets in a less performance way. Please consider upgrading your browser.`),this.copyStylesFallback();return}let n=Array.from(document.styleSheets).filter(e=>e.ownerNode instanceof HTMLElement&&e.ownerNode.dataset.viteDevId?!0:ov(e));for(let e of n){let t=e.href??(e.ownerNode instanceof HTMLElement?e.ownerNode.dataset.viteDevId:void 0)??e.title;if(t&&!rv.has(t)){let n=new CSSStyleSheet;try{n.replaceSync(Array.from(e.cssRules).map(e=>e.cssText.includes(`@import`)?``:e.cssText).join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./home-page-Chy6SA41.js","./rolldown-runtime-B0Z9INg1.js","./useEvent-xfs0Sn4r.js","./react-CBDbhulC.js","./compiler-runtime-CYIjoINj.js","./cells-B1S_6FG3.js","./react-dom-BQrReHnR.js","./schemas-aTUejmFi.js","./debounce-aFmHgJZY.js","./isObject-BCaOs5rp.js","./now-Cmx0b_zA.js","./isSymbol-oX0TOjjx.js","./useEventListener-D27Dii_l.js","./objects-snlMn4yk.js","./jsx-runtime-B74pBk57.js","./invariant-Ci2dTZ72.js","./utils-R_pHe-RB.js","./merge-DxlVKwwO.js","./isArrayLikeObject-DnwgSs_Z.js","./_initCloneObject-CM3WilQg.js","./config-CUBl5qBg.js","./constants-BDbGiS7O.js","./Deferred-CrTnjj37.js","./session-CEdta5_Q.js","./cn-ldLVeaqm.js","./clsx-DB0hHKMi.js","./fullscreen-0EEPR7uc.js","./dist-BgL43w5r.js","./menu-items-BSVrMleU.js","./alert-dialog-DBoy-FMx.js","./button-BMBznEru.js","./select-BUEX2Vfl.js","./check-BoA6XBpj.js","./createLucideIcon-B7HeEoG2.js","./useNumberFormatter-DHJ9s6Vk.js","./context-Do8M9TDF.js","./circle--ysFeW9z.js","./tooltip-D7dq6bnc.js","./dist-PIe1xcZo.js","./dist-CbQrIaPV.js","./arrays-BqUx5USx.js","./once-Haz_uxEL.js","./capabilities-LWzb3E3M.js","./cjs-C49f7GXV.js","./createReducer-Bq-nQJiK.js","./dist-Dz_04liz.js","./useNonce-BTM6-ANi.js","./strings-CpYReX2Q.js","./requests-C6_IaFh7.js","./dist-B97dKQGP.js","./useLifecycle-BUaJcygz.js","./toDate-hGYJX0Ha.js","./database-zap-CloO6gbw.js","./write-secret-modal-BG_B6y1P.js","./input-DeyycFtq.js","./numbers-DKurV_vq.js","./useDebounce-Dulm61-t.js","./uuid-k9DpjH68.js","./use-toast-DpWHUGuF.js","./plus-C4J9gIE1.js","./trash-2-D_HX-0qx.js","./badge-D_-uqy2N.js","./preload-helper-HclGiUj8.js","./dist-DCc0VfiO.js","./dist-7qdHLg-L.js","./dist-BO5c5n_b.js","./dist-CO1Hfv5H.js","./dist-DzAWvPVK.js","./stex-Dc5bKD4z.js","./paths-zcL04qUW.js","./useTheme-BRnykVDX.js","./useAsyncData-Buhk-UgR.js","./purify.es-DrVcFY1Q.js","./cells-D-c15Ks-.css","./ErrorBoundary-TUuUdxHz.js","./dropdown-menu-CqNabM1f.js","./chevron-right-CKA5zVsM.js","./chart-no-axes-column-ChZdjJhj.js","./tree-actions-CrWpuExP.js","./eye-off-CFuPxa9F.js","./refresh-cw-Bf-rx_aV.js","./circle-play-CQiat61_.js","./external-link-Bp3BxyRA.js","./file-icons-Bo1Ewf1W.js","./file-headphone-rFCxFRI8.js","./file-DF8n85RA.js","./image-ab13yGv4.js","./youtube-DCJ-ihUU.js","./link-Cap-MZiw.js","./spinner-Ck-Hgfvj.js","./package-DPlscLzt.js","./file-name-input-BeYyD2dj.js","./tabs-c6mpccpH.js","./copy-BMXKNElG.js","./errors-DzO-nXy-.js","./extends-CvVTau-c.js","./pathUtils-Cryrlpma.js","./semaphore-BjoL5P0h.js","./app-config-button-COFLeJCU.js","./ai-model-dropdown-DjQy2bo-.js","./get-DjNf4SIX.js","./has-sKqQhP6r.js","./_hasPath-BmRQipI0.js","./switch-CBR-ykv3.js","./config-DcB2swfZ.js","./triangle-alert-MihykDYG.js","./VisuallyHidden-DurJ_JBW.js","./SelectionIndicator-DPl6HPLh.js","./copy-Cg05mM3C.js","./kbd-Cwh96ZBE.js","./alert-dmKwNsrp.js","./error-banner-B3KYUlCX.js","./table-DmqOOjfe.js","./renderShortcut-D9XYVNe3.js","./azure-Dcn397wY.js","./card-dYXwy2mo.js","./settings-C-cYas75.js","./Inputs-E85rt2lh.js","./Inputs-C4Oo7q-H.css","./dates-DK5JikJo.js","./en-US-yTIMUO13.js","./isValid-nQ3Iam8J.js","./react-icons.esm-hr79-MCS.js","./icons-CjLa9BiH.js","./github-YRgb6LMu.js","./marimo-icons-C3KxMV9A.js","./links-DPh7yoP-.js","./useInterval-B1_J4wdT.js","./run-page-DXZapRtY.js","./JsonOutput-BI2qFHVr.js","./download-CIdXYNHv.js","./html-to-image-DMn_7CCA.js","./LazyAnyLanguageCodeMirror-YVX2AZaI.js","./table-CUK1W5bI.js","./markdown-renderer-DIXiKP4m.js","./chunk-5FQGJX7Z-CRg4xQWg.js","./micromark-factory-space-D9Dr-k4J.js","./markdown-renderer-CU2Wa_Bt.css","./ellipsis-Dfik_tuW.js","./message-circle-BQB1AIAg.js","./MarimoErrorOutput-BXh29HCp.js","./hat-glasses-C8LSY3HT.js","./datasource-BrSYgi6C.js","./RenderHTML-COTZYPO7.js","./copy-icon-LPQzn7_f.js","./useRunCells-DHnbXALT.js","./useInstallPackage-Bq7SlWgN.js","./state-llVv0lIh.js","./cell-link-BbAJokoX.js","./useDateFormatter-BiqAQ-zI.js","./tooltip-Cwltdez8.js","./vega-loader.browser-AQmjV9CX.js","./precisionRound-Bq_nmf5u.js","./defaultLocale-CNPGWpMu.js","./defaultLocale-Dm4DaIgg.js","./emotion-is-prop-valid.esm-nLO-SoUf.js","./useIframeCapabilities-DEpTCh1Q.js","./utils-49LGK4zG.js","./formats-DSzGCKeO.js","./react-resizable-panels.browser.esm-BSRAHC4P.js","./JsonOutput-BQtz7-np.css","./arrow-left-DrqK6gPp.js","./panels-D53vWR00.js","./state-MlBpc9qi.js","./_baseSet-gX6o3Pih.js","./readonly-python-code-De0vvuWh.js","./esm-Dw0vvSg2.js","./useAddCell-DIdbaU70.js","./blob-BBiZd3vX.js","./share-C2MPy_VX.js","./events-CbeVJ6OD.js","./layout-Ddsz1eHh.js","./code-xml-B7x62Eeh.js","./code-CF0HKE9K.js","./useDeleteCell-CSCMg7Up.js","./trash-DS1-SuM0.js","./prop-types-Djf4O40e.js","./floating-outline-CNsG18LK.js","./process-output-DNhz9LLW.js","./name-cell-input-zqypwqoZ.js","./name-cell-input-ujOhus_y.css","./esm-BGpfQNhD.js","./dist-BcfF-rkl.js","./dist-fxnYzq-R.js","./dist-CEeRVpMD.js","./dist-CidBzUqR.js","./dist-DkCO0b-0.js","./dist-DoAjHgMj.js","./dist-CxxZaSme.js","./dist-BcYW-EJk.js","./dist-DIkuvChK.js","./dist-Cqm1W-Zm.js","./dist-Dbu5sPgR.js","./dist-BKx0MLbb.js","./dist-DL1Thauf.js","./apl-CYIAEF37.js","./asciiarmor-CF6FHpQl.js","./asn1-CmtZ6NID.js","./brainfuck-vE42J6oQ.js","./cobol-ttQu-eUm.js","./clike-Bo1_pR8B.js","./clojure-1zb6N0Kd.js","./css-aD3t-znF.js","./cmake-DSEb40G9.js","./coffeescript-CcHmp8ZW.js","./commonlisp-DHrixoxv.js","./cypher-q6-coHOK.js","./python-C4CVWZ7v.js","./crystal-fOwNIMzy.js","./d-Drt6ZXrF.js","./diff-CYBnW6ZU.js","./dtd-DqGG8R4P.js","./dylan-BTCYgsmh.js","./ecl-BPsxRGqR.js","./eiffel-BCguJEP-.js","./elm-DnNeI1M2.js","./erlang-DkHPV6ru.js","./factor-ZZBBZpXK.js","./simple-mode-DXiLM1-G.js","./forth-DUDizG3o.js","./fortran-BarbOvgW.js","./mllike-BKN6OcTc.js","./gas-mybzrfIH.js","./gherkin-BlnXaZZf.js","./groovy-cYuFC_ot.js","./haskell-CuLp9g3a.js","./haxe-CiIUZbdX.js","./idl-BHq7WyPV.js","./javascript-D-FtdkNC.js","./julia-CoYYMTcZ.js","./livescript-C1gEZ5Hk.js","./lua-CRIS5afH.js","./mirc-CTGUd79I.js","./mathematica-CwlrU_TQ.js","./modelica-DZs5SjV_.js","./mumps-BNg2Yq-1.js","./mbox-skR0V6cu.js","./nsis-8kQdxo7f.js","./ntriples-Ck5rp6GE.js","./octave-BRpd3hBF.js","./oz-BUEZmvHT.js","./pascal-DBfxUwpj.js","./perl-v9vsztCj.js","./pig-CrKTIB-m.js","./powershell-89xdb5K_.js","./properties-DaUFoXFR.js","./protobuf-Ci5XvpF4.js","./pug-DPY-Ajan.js","./puppet-Da8ZxG7z.js","./q-BjtI5Irp.js","./r-vSi6pWDr.js","./rpm-Cv5HmAkX.js","./ruby-UyKn0rKt.js","./sas-D3-6PWmJ.js","./scheme-DqTb0ELD.js","./shell-DySzVBqR.js","./sieve-CoBbN2aF.js","./smalltalk-CJJAzHnb.js","./sparql-CjwbV0fX.js","./stylus-uh0Gd-Iz.js","./swift-D5IK5OrP.js","./verilog-DPWRmpYS.js","./tcl-BvqzOD3a.js","./textile--JQHE1pJ.js","./toml-lWmHdWv5.js","./troff-r7W702V9.js","./ttcn-1CwPIugQ.js","./ttcn-cfg-CHYEAF6D.js","./turtle-D_5eCUwg.js","./webidl-CNY2gQL0.js","./vb-Vd6lTutg.js","./vbscript-CcW6E3ma.js","./velocity-CuSicjhq.js","./vhdl-sLYad3YP.js","./xquery-d3Qdoigy.js","./yacas-BjDXhrkW.js","./z80-z4BkVl0y.js","./mscgen-Bo5N9WUj.js","./dist-DeuWxYVk.js","./readonly-code-display-CKT-gv1m.js","./layout-D-WxHzKd.css","./requests-S_7PqcSt.js","./ws-DLVysDhS.js","./types-CoHi_MQq.js","./runs-BQTlv6Ja.js","./panels-DDsRoC3H.css","./edit-page-Bpqbjwkb.js","./arrow-right-CMihiUEa.js","./useBoolean-DfDMEVCI.js","./useCellActionButton-DXyUqFdJ.js","./multi-icon-COhkNiC1.js","./multi-icon-CW3_9bja.css","./useSplitCell-CxlsGCB_.js","./circle-check-CUWv70QX.js","./useNotebookActions-DpphIKt5.js","./globe-BQf75qV_.js","./components-DwH_Yb1N.js","./markdown-export-0rLbaq8b.js","./square-B58Ib8Ir.js","./error-entries-DEjvzkum.js","./pair-with-agent-modal-CBIL9_6g.js","./add-connection-dialog-CcnJ2LkX.js","./skeleton-CxFczTPo.js","./add-cell-with-ai-B0RdHenk.js","./fileToBase64-NhpNrK5l.js","./clipboard-paste-C7rY4OqM.js","./cell-editor-5wcJHF0s.js","./save-BybsbOKz.js","./dist-8lhGoJ54.js","./formatting-BJlT1s_3.js","./panel-accordion-state-DmV3OgfX.js","./loro_wasm_bg-BRA1AbB3.js","./cell-editor-_cVIHMNI.css","./RunButton-DTUzITFm.js","./rotate-ccw-BKamGvhU.js","./square-function-DkZweMAs.js","./CellStatus-B6CWKORY.js","./ban-CwXfMsC1.js","./workflow-SJ9KZapt.js","./CellStatus-2Psjnl5F.css","./useDependencyPanelTab-Bt7aBDpS.js","./panel-context-CiVjnt80.js","./kiosk-mode-B2WU6CYc.js","./edit-page-Dstp9NQ5.css","./gallery-page-4dZlIWMe.js","./chat-ui-CNvkb287.js","./bot-message-square-CGhPjWFf.js","./chat-display-ClG9MRI_.js","./isEmpty-BJso7_X0.js","./glide-data-editor-BQNVc0zc.js","./types-BflGgckY.js","./click-outside-container-n76g8dsY.js","./dist-DQS4kic4.js","./glide-data-editor-CDvI1PvV.css","./ConnectedDataExplorerComponent-DZnvpjue.js","./spec-CUFquO6R.js","./react-vega-C3-Qk46W.js","./linear-BMUPXU7z.js","./init-ZlXS9mIS.js","./timer-DnhpN6F0.js","./ordinal-BdBDtYTt.js","./time-BWPrZCK3.js","./range-EplFIxc7.js","./path-BCdg30Y0.js","./math-Bi_r_ZWc.js","./arc-Yxk2k_uq.js","./array-BifhSqXX.js","./step-CqgdNM3U.js","./line-io_go0HI.js","./colors-Cg5Vh3br.js","./treemap-BfjIY-m6.js","./Plot-Cea4bVaX.js","./vega-component-CzgE5HEs.js","./useDeepCompareMemoize-CLytDdMl.js","./use-vega-container-remeasure-xx9nX6Kv.js","./swiper-component-BlZbNN5w.js","./swiper-component-BQTNpogT.css","./slides-BQsAdh8K.css","./ImageComparisonComponent-BKLXMG6c.js","./mermaid-CwvTqKGz.js","./chunk-NSK5VX7P-CF0xJC4h.js","./src-HeEQIfJi.js","./chunk-Y2CYZVJY-DsF7k-Jl.js","./src-CAQsWNvA.js","./chunk-I66GZJ75-mACCwHgj.js","./dist-CeoU7cfW.js","./chunk-3NCLNEKW-zNdfrgTx.js","./chunk-ZIRB5QZD-O39ZBUk3.js","./chunk-W5SLKNZC-ASg9U-2L.js","./chunk-UBXNYLIW-DoU728rU.js","./chunk-4I5QYGJK-CRhC3ilJ.js","./chunk-WRU74C26-CWPrh85f.js","./chunk-QR6OTTB3-Bo5GoXIC.js","./rough.esm-Dy-Kn_BL.js","./chunk-7BUUIJ7U-Bb538aSH.js","./chunk-7Z6QIM7H-D1BVG1pf.js","./chunk-J7OUQ5F2-BYO9AUEf.js","./katex-CfcQV1c4.js","./katex-DWOHUIcL.js","./mhchem-BCzq34a8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{c as n,l as r,o as i,r as a,s as o,t as s}from"./useEvent-xfs0Sn4r.js";import{t as c}from"./react-CBDbhulC.js";import{$ as l,$i as u,$t as d,Ai as f,An as p,Ao as m,Bo as h,Cn as g,Co as _,Eo as v,Fo as y,Go as b,Gt as x,Ho as S,Ht as C,Io as w,Jt as T,Kt as E,Li as D,Mn as O,Mo as k,Nn as A,No as j,On as M,Oo as N,Pn as P,Po as F,Q as I,Qi as L,Qt as ee,R as te,Ra as ne,Sn as re,Tn as ie,To as ae,Ui as oe,Uo as se,Vo as ce,Vt as le,Wn as ue,Wo as de,X as fe,Y as pe,Yi as me,Yt as he,Z as ge,Zi as _e,Zt as ve,_o as ye,an as be,bn as xe,bo as Se,cn as Ce,dn as we,en as Te,et as Ee,gn as De,go as Oe,ho as ke,ia as Ae,in as je,ji as Me,jn as Ne,kn as Pe,ln as Fe,mo as Ie,mt as Le,on as Re,pt as ze,qt as Be,rn as Ve,sn as He,so as Ue,ta as We,tn as Ge,tt as Ke,un as qe,uo as Je,vn as Ye,wo as Xe,x as Ze,xn as Qe,y as $e}from"./cells-B1S_6FG3.js";import{t as et}from"./react-dom-BQrReHnR.js";import{Cn as R,In as z,It as tt,Jn as nt,Sn as B,Tt as V,W as rt,Wn as it,Yn as at,at as ot,bt as st,cn as ct,hn as lt,hr as ut,jn as dt,kt as H,lc as ft,ln as pt,n as mt,un as ht,vt as gt,wn as _t,wt as vt,xt as yt}from"./schemas-aTUejmFi.js";import{t as bt}from"./compiler-runtime-CYIjoINj.js";import{t as xt}from"./get-DjNf4SIX.js";import{t as St}from"./pick-Bs4cJfJU.js";import{S as Ct,a as wt,c as Tt,d as Et,f as Dt,h as Ot,i as kt,l as At,o as jt,p as Mt,r as Nt,s as Pt,u as Ft,y as It}from"./state-MlBpc9qi.js";import{_ as Lt,a as Rt,g as U,o as zt,t as Bt}from"./useEventListener-D27Dii_l.js";import{t as Vt}from"./objects-snlMn4yk.js";import{t as Ht}from"./invariant-Ci2dTZ72.js";import{C as Ut,E as Wt,M as Gt,N as Kt,P as qt,S as Jt,d as Yt,o as Xt,t as Zt,y as Qt}from"./utils-R_pHe-RB.js";import{r as $t}from"./constants-BDbGiS7O.js";import{C as en,D as tn,E as nn,M as rn,N as an,S as on,T as sn,a as cn,b as ln,i as un,l as dn,r as fn,s as pn,t as mn,v as hn}from"./config-CUBl5qBg.js";import{a as gn,i as _n,n as vn,o as yn,r as bn,t as xn}from"./switch-CBR-ykv3.js";import{a as Sn,o as Cn,s as wn,t as Tn}from"./readonly-python-code-De0vvuWh.js";import{t as En}from"./ErrorBoundary-TUuUdxHz.js";import{n as Dn,t as W}from"./cn-ldLVeaqm.js";import{t as On}from"./jsx-runtime-B74pBk57.js";import{C as kn,T as An,_ as jn,a as Mn,b as Nn,g as Pn,m as Fn,o as In,r as Ln,v as Rn,w as zn,x as Bn,y as Vn}from"./fullscreen-0EEPR7uc.js";import{o as Hn,s as Un}from"./dist-BgL43w5r.js";import{d as Wn,u as Gn}from"./menu-items-BSVrMleU.js";import{a as Kn,c as qn,i as Jn,l as Yn,o as Xn,r as Zn,s as Qn,u as $n}from"./config-DcB2swfZ.js";import{a as er,c as tr,i as nr,l as rr,n as ir,s as ar,t as or}from"./alert-dialog-DBoy-FMx.js";import{i as sr,n as cr,r as lr,t as ur}from"./tabs-c6mpccpH.js";import{a as dr,c as fr,d as pr,f as mr,h as hr,i as gr,l as _r,m as vr,n as yr,o as br,p as xr,r as Sr,s as Cr,t as wr}from"./select-BUEX2Vfl.js";import{t as Tr}from"./circle--ysFeW9z.js";import{a as Er,c as Dr,i as Or,o as kr,p as Ar,r as jr,t as Mr}from"./dropdown-menu-CqNabM1f.js";import{A as Nr,Ct as Pr,F as Fr,Ft as Ir,G as Lr,H as Rr,I as zr,It as Br,J as Vr,K as Hr,L as Ur,Lt as Wr,M as Gr,Mt as Kr,O as qr,Ot as Jr,P as Yr,Pt as Xr,R as Zr,St as Qr,U as $r,W as ei,Y as ti,Z as ni,at as ri,b as ii,bt as ai,c as oi,d as si,dt as ci,f as li,ft as ui,g as di,gt as fi,h as pi,ht as mi,it as hi,j as gi,k as _i,kt as vi,lt as yi,m as bi,mt as xi,ot as Si,pt as Ci,q as wi,r as Ti,t as Ei,u as Di,ut as Oi,v as ki,vt as Ai,wt as ji,x as Mi,xt as Ni,y as Pi,yt as Fi,z as Ii}from"./JsonOutput-BI2qFHVr.js";import{h as Li,l as Ri,n as zi,p as Bi,r as Vi}from"./download-CIdXYNHv.js";import{a as Hi,i as Ui,n as Wi,o as Gi,r as Ki,t as qi}from"./tooltip-D7dq6bnc.js";import{n as Ji,t as Yi}from"./button-BMBznEru.js";import{st as Xi}from"./dist-PIe1xcZo.js";import{d as Zi,o as Qi,p as $i,t as ea}from"./arrays-BqUx5USx.js";import{n as ta,t as na}from"./once-Haz_uxEL.js";import{n as ra,r as ia,t as aa}from"./strings-CpYReX2Q.js";import{n as oa}from"./requests-C6_IaFh7.js";import{t as sa}from"./createLucideIcon-B7HeEoG2.js";import{D as ca,E as la,S as ua,T as da,_ as fa,a as pa,c as ma,d as ha,f as ga,g as _a,h as va,i as ya,l as ba,m as xa,n as Sa,o as Ca,p as wa,r as Ta,s as Ea,t as Da,u as Oa,v as ka,w as Aa,x as ja,y as Ma}from"./spec-CUFquO6R.js";import{n as Na,r as Pa,t as Fa}from"./fileToBase64-NhpNrK5l.js";import{t as Ia}from"./LazyAnyLanguageCodeMirror-YVX2AZaI.js";import{i as La,n as Ra,o as za}from"./useLifecycle-BUaJcygz.js";import{a as Ba,c as Va,i as Ha,n as Ua,s as Wa,t as Ga}from"./useBoolean-DfDMEVCI.js";import{a as Ka,r as qa,t as Ja}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as Ya}from"./chevron-right-CKA5zVsM.js";import{t as Xa}from"./code-xml-B7x62Eeh.js";import{t as Za}from"./copy-BMXKNElG.js";import{t as Qa}from"./eye-off-CFuPxa9F.js";import{n as $a}from"./file-headphone-rFCxFRI8.js";import{r as eo,t as to}from"./file-icons-Bo1Ewf1W.js";import{t as no}from"./globe-BQf75qV_.js";import{i as ro,n as io}from"./markdown-export-0rLbaq8b.js";import{C as ao,S as oo,x as so,y as co}from"./write-secret-modal-BG_B6y1P.js";import{n as lo,t as uo}from"./spinner-Ck-Hgfvj.js";import{n as fo,t as po}from"./types-BflGgckY.js";import{t as mo}from"./plus-C4J9gIE1.js";import{t as ho}from"./refresh-cw-Bf-rx_aV.js";import{i as go,n as _o,o as vo,r as yo,t as bo}from"./input-DeyycFtq.js";import{t as xo}from"./square-function-DkZweMAs.js";import{a as So,i as Co,r as wo,t as To}from"./column-preview-D6cIOnWQ.js";import{t as Eo}from"./square-B58Ib8Ir.js";import{t as Do}from"./trash-2-D_HX-0qx.js";import{t as Oo}from"./triangle-alert-MihykDYG.js";import{n as ko,t as Ao}from"./es-BuMFDpR4.js";import{t as jo}from"./preload-helper-HclGiUj8.js";import{n as Mo,t as No}from"./use-toast-DpWHUGuF.js";import{n as Po,t as Fo}from"./paths-zcL04qUW.js";import{l as Io,r as Lo,s as Ro}from"./session-CEdta5_Q.js";import{r as zo}from"./useTheme-BRnykVDX.js";import{n as Bo,t as Vo}from"./context-Do8M9TDF.js";import{a as Ho,i as Uo,o as Wo,t as Go}from"./numbers-DKurV_vq.js";import{n as Ko,t as qo}from"./useDebounce-Dulm61-t.js";import{n as Jo}from"./useAsyncData-Buhk-UgR.js";import{n as Yo,r as Xo,t as Zo}from"./dates-DK5JikJo.js";import{t as Qo}from"./copy-icon-LPQzn7_f.js";import{t as $o}from"./RenderHTML-COTZYPO7.js";import{a as es,i as ts,n as ns,r as rs,t as is}from"./errors-DzO-nXy-.js";import{i as as,r as os,t as ss}from"./tooltip-Cwltdez8.js";import{a as cs}from"./react-icons.esm-hr79-MCS.js";import{a as ls,i as us,n as ds,t as fs}from"./events-CbeVJ6OD.js";import{n as ps,r as ms,t as hs}from"./alert-dmKwNsrp.js";import{n as gs,t as _s}from"./error-banner-B3KYUlCX.js";import{n as vs,t as ys}from"./utils-49LGK4zG.js";import{a as bs,i as xs,n as Ss,o as Cs,r as ws,t as Ts}from"./table-DmqOOjfe.js";import{t as Es}from"./renderShortcut-D9XYVNe3.js";import{t as Ds}from"./bundle.esm-DzY74mzC.js";import{n as Os}from"./icons-CjLa9BiH.js";import{t as ks}from"./useDeepCompareMemoize-CLytDdMl.js";import{t as As}from"./pathUtils-Cryrlpma.js";import{i as js,n as Ms,r as Ns}from"./floating-outline-CNsG18LK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var G=e(c(),1),Ps=e(et(),1),K=On(),Fs=`NavigationMenu`,[Is,Ls,Rs]=Wn(Fs),[zs,Bs,Vs]=Wn(Fs),[Hs,Us]=kn(Fs,[Rs,Vs]),[Ws,Gs]=Hs(Fs),[Ks,qs]=Hs(Fs),Js=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:a,delayDuration:o=200,skipDelayDuration:s=300,orientation:c=`horizontal`,dir:l,...u}=e,[d,f]=G.useState(null),p=zt(t,e=>f(e)),m=Gn(l),h=G.useRef(0),g=G.useRef(0),_=G.useRef(0),[v,y]=G.useState(!0),[b,x]=Vn({prop:r,onChange:e=>{let t=e!==``,n=s>0;t?(window.clearTimeout(_.current),n&&y(!1)):(window.clearTimeout(_.current),_.current=window.setTimeout(()=>y(!0),s)),i?.(e)},defaultProp:a??``,caller:Fs}),S=G.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>x(``),150)},[x]),C=G.useCallback(e=>{window.clearTimeout(g.current),x(e)},[x]),w=G.useCallback(e=>{b===e?window.clearTimeout(g.current):h.current=window.setTimeout(()=>{window.clearTimeout(g.current),x(e)},o)},[b,x,o]);return G.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(g.current),window.clearTimeout(_.current)},[]),(0,K.jsx)(Zs,{scope:n,isRootMenu:!0,value:b,dir:m,orientation:c,rootNavigationMenu:d,onTriggerEnter:e=>{window.clearTimeout(h.current),v?w(e):C(e)},onTriggerLeave:()=>{window.clearTimeout(h.current),S()},onContentEnter:()=>window.clearTimeout(g.current),onContentLeave:S,onItemSelect:e=>{x(t=>t===e?``:e)},onItemDismiss:()=>x(``),children:(0,K.jsx)(zn.nav,{"aria-label":`Main`,"data-orientation":c,dir:m,...u,ref:p})})});Js.displayName=Fs;var Ys=`NavigationMenuSub`,Xs=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,...s}=e,c=Gs(Ys,n),[l,u]=Vn({prop:r,onChange:i,defaultProp:a??``,caller:Ys});return(0,K.jsx)(Zs,{scope:n,isRootMenu:!1,value:l,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:e=>u(e),onItemSelect:e=>u(e),onItemDismiss:()=>u(``),children:(0,K.jsx)(zn.div,{"data-orientation":o,...s,ref:t})})});Xs.displayName=Ys;var Zs=e=>{let{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:a,children:o,value:s,onItemSelect:c,onItemDismiss:l,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:p}=e,[m,h]=G.useState(null),[g,_]=G.useState(new Map),[v,y]=G.useState(null);return(0,K.jsx)(Ws,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:hr(s),baseId:jn(),dir:i,orientation:a,viewport:m,onViewportChange:h,indicatorTrack:v,onIndicatorTrackChange:y,onTriggerEnter:Pn(u),onTriggerLeave:Pn(d),onContentEnter:Pn(f),onContentLeave:Pn(p),onItemSelect:Pn(c),onItemDismiss:Pn(l),onViewportContentChange:G.useCallback((e,t)=>{_(n=>(n.set(e,t),new Map(n)))},[]),onViewportContentRemove:G.useCallback(e=>{_(t=>t.has(e)?(t.delete(e),new Map(t)):t)},[]),children:(0,K.jsx)(Is.Provider,{scope:t,children:(0,K.jsx)(Ks,{scope:t,items:g,children:o})})})},Qs=`NavigationMenuList`,$s=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=Gs(Qs,n),a=(0,K.jsx)(zn.ul,{"data-orientation":i.orientation,...r,ref:t});return(0,K.jsx)(zn.div,{style:{position:`relative`},ref:i.onIndicatorTrackChange,children:(0,K.jsx)(Is.Slot,{scope:n,children:i.isRootMenu?(0,K.jsx)(xc,{asChild:!0,children:a}):a})})});$s.displayName=Qs;var ec=`NavigationMenuItem`,[tc,nc]=Hs(ec),rc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,...i}=e,a=jn(),o=r||a||`LEGACY_REACT_AUTO_VALUE`,s=G.useRef(null),c=G.useRef(null),l=G.useRef(null),u=G.useRef(()=>{}),d=G.useRef(!1),f=G.useCallback((e=`start`)=>{if(s.current){u.current();let t=Tc(s.current);t.length&&Ec(e===`start`?t:t.reverse())}},[]),p=G.useCallback(()=>{if(s.current){let e=Tc(s.current);e.length&&(u.current=Dc(e))}},[]);return(0,K.jsx)(tc,{scope:n,value:o,triggerRef:c,contentRef:s,focusProxyRef:l,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:p,onContentFocusOutside:p,children:(0,K.jsx)(zn.li,{...i,ref:t})})});rc.displayName=ec;var ic=`NavigationMenuTrigger`,ac=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,disabled:r,...i}=e,a=Gs(ic,e.__scopeNavigationMenu),o=nc(ic,e.__scopeNavigationMenu),s=G.useRef(null),c=zt(s,o.triggerRef,t),l=Ac(a.baseId,o.value),u=jc(a.baseId,o.value),d=G.useRef(!1),f=G.useRef(!1),p=o.value===a.value;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Is.ItemSlot,{scope:n,value:o.value,children:(0,K.jsx)(wc,{asChild:!0,children:(0,K.jsx)(zn.button,{id:l,disabled:r,"data-disabled":r?``:void 0,"data-state":kc(p),"aria-expanded":p,"aria-controls":u,...i,ref:c,onPointerEnter:Bn(e.onPointerEnter,()=>{f.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:Bn(e.onPointerMove,Mc(()=>{r||f.current||o.wasEscapeCloseRef.current||d.current||(a.onTriggerEnter(o.value),d.current=!0)})),onPointerLeave:Bn(e.onPointerLeave,Mc(()=>{r||(a.onTriggerLeave(),d.current=!1)})),onClick:Bn(e.onClick,()=>{a.onItemSelect(o.value),f.current=p}),onKeyDown:Bn(e.onKeyDown,e=>{let t={horizontal:`ArrowDown`,vertical:a.dir===`rtl`?`ArrowLeft`:`ArrowRight`}[a.orientation];p&&e.key===t&&(o.onEntryKeyDown(),e.preventDefault())})})})}),p&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Un,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:e=>{let t=o.contentRef.current,n=e.relatedTarget,r=n===s.current,i=t?.contains(n);(r||!i)&&o.onFocusProxyEnter(r?`start`:`end`)}}),a.viewport&&(0,K.jsx)(`span`,{"aria-owns":u})]})]})});ac.displayName=ic;var oc=`NavigationMenuLink`,sc=`navigationMenu.linkSelect`,cc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,active:r,onSelect:i,...a}=e;return(0,K.jsx)(wc,{asChild:!0,children:(0,K.jsx)(zn.a,{"data-active":r?``:void 0,"aria-current":r?`page`:void 0,...a,ref:t,onClick:Bn(e.onClick,e=>{let t=e.target,n=new CustomEvent(sc,{bubbles:!0,cancelable:!0});if(t.addEventListener(sc,e=>i?.(e),{once:!0}),An(t,n),!n.defaultPrevented&&!e.metaKey){let e=new CustomEvent(hc,{bubbles:!0,cancelable:!0});An(t,e)}},{checkForDefaultPrevented:!1})})})});cc.displayName=oc;var lc=`NavigationMenuIndicator`,uc=G.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Gs(lc,e.__scopeNavigationMenu),a=!!i.value;return i.indicatorTrack?Ps.createPortal((0,K.jsx)(Rn,{present:n||a,children:(0,K.jsx)(dc,{...r,ref:t})}),i.indicatorTrack):null});uc.displayName=lc;var dc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=Gs(lc,n),a=Ls(n),[o,s]=G.useState(null),[c,l]=G.useState(null),u=i.orientation===`horizontal`,d=!!i.value;G.useEffect(()=>{let e=a().find(e=>e.value===i.value)?.ref.current;e&&s(e)},[a,i.value]);let f=()=>{o&&l({size:u?o.offsetWidth:o.offsetHeight,offset:u?o.offsetLeft:o.offsetTop})};return Oc(o,f),Oc(i.indicatorTrack,f),c?(0,K.jsx)(zn.div,{"aria-hidden":!0,"data-state":d?`visible`:`hidden`,"data-orientation":i.orientation,...r,ref:t,style:{position:`absolute`,...u?{left:0,width:c.size+`px`,transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+`px`,transform:`translateY(${c.offset}px)`},...r.style}}):null}),fc=`NavigationMenuContent`,pc=G.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Gs(fc,e.__scopeNavigationMenu),a=nc(fc,e.__scopeNavigationMenu),o=zt(a.contentRef,t),s=a.value===i.value,c={value:a.value,triggerRef:a.triggerRef,focusProxyRef:a.focusProxyRef,wasEscapeCloseRef:a.wasEscapeCloseRef,onContentFocusOutside:a.onContentFocusOutside,onRootContentClose:a.onRootContentClose,...r};return i.viewport?(0,K.jsx)(mc,{forceMount:n,...c,ref:o}):(0,K.jsx)(Rn,{present:n||s,children:(0,K.jsx)(gc,{"data-state":kc(s),...c,ref:o,onPointerEnter:Bn(e.onPointerEnter,i.onContentEnter),onPointerLeave:Bn(e.onPointerLeave,Mc(i.onContentLeave)),style:{pointerEvents:!s&&i.isRootMenu?`none`:void 0,...c.style}})})});pc.displayName=fc;var mc=G.forwardRef((e,t)=>{let{onViewportContentChange:n,onViewportContentRemove:r}=Gs(fc,e.__scopeNavigationMenu);return Nn(()=>{n(e.value,{ref:t,...e})},[e,t,n]),Nn(()=>()=>r(e.value),[e.value,r]),null}),hc=`navigationMenu.rootContentDismiss`,gc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:a,wasEscapeCloseRef:o,onRootContentClose:s,onContentFocusOutside:c,...l}=e,u=Gs(fc,n),d=G.useRef(null),f=zt(d,t),p=Ac(u.baseId,r),m=jc(u.baseId,r),h=Ls(n),g=G.useRef(null),{onItemDismiss:_}=u;G.useEffect(()=>{let e=d.current;if(u.isRootMenu&&e){let t=()=>{_(),s(),e.contains(document.activeElement)&&i.current?.focus()};return e.addEventListener(hc,t),()=>e.removeEventListener(hc,t)}},[u.isRootMenu,e.value,i,_,s]);let v=G.useMemo(()=>{let e=h().map(e=>e.value);u.dir===`rtl`&&e.reverse();let t=e.indexOf(u.value),n=e.indexOf(u.previousValue),i=r===u.value,a=n===e.indexOf(r);if(!i&&!a)return g.current;let o=(()=>{if(t!==n){if(i&&n!==-1)return t>n?`from-end`:`from-start`;if(a&&t!==-1)return t>n?`to-start`:`to-end`}return null})();return g.current=o,o},[u.previousValue,u.value,u.dir,h,r]);return(0,K.jsx)(xc,{asChild:!0,children:(0,K.jsx)(Fn,{id:m,"aria-labelledby":p,"data-motion":v,"data-orientation":u.orientation,...l,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{let e=new Event(hc,{bubbles:!0,cancelable:!0});d.current?.dispatchEvent(e)},onFocusOutside:Bn(e.onFocusOutside,e=>{c();let t=e.target;u.rootNavigationMenu?.contains(t)&&e.preventDefault()}),onPointerDownOutside:Bn(e.onPointerDownOutside,e=>{let t=e.target,n=h().some(e=>e.ref.current?.contains(t)),r=u.isRootMenu&&u.viewport?.contains(t);(n||r||!u.isRootMenu)&&e.preventDefault()}),onKeyDown:Bn(e.onKeyDown,e=>{let t=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!t){let t=Tc(e.currentTarget),n=document.activeElement,r=t.findIndex(e=>e===n);Ec(e.shiftKey?t.slice(0,r).reverse():t.slice(r+1,t.length))?e.preventDefault():a.current?.focus()}}),onEscapeKeyDown:Bn(e.onEscapeKeyDown,e=>{o.current=!0})})})}),_c=`NavigationMenuViewport`,vc=G.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=!!Gs(_c,e.__scopeNavigationMenu).value;return(0,K.jsx)(Rn,{present:n||i,children:(0,K.jsx)(yc,{...r,ref:t})})});vc.displayName=_c;var yc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,children:r,...i}=e,a=Gs(_c,n),o=zt(t,a.onViewportChange),s=qs(fc,e.__scopeNavigationMenu),[c,l]=G.useState(null),[u,d]=G.useState(null),f=c?c?.width+`px`:void 0,p=c?c?.height+`px`:void 0,m=!!a.value,h=m?a.value:a.previousValue;return Oc(u,()=>{u&&l({width:u.offsetWidth,height:u.offsetHeight})}),(0,K.jsx)(zn.div,{"data-state":kc(m),"data-orientation":a.orientation,...i,ref:o,style:{pointerEvents:!m&&a.isRootMenu?`none`:void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":p,...i.style},onPointerEnter:Bn(e.onPointerEnter,a.onContentEnter),onPointerLeave:Bn(e.onPointerLeave,Mc(a.onContentLeave)),children:Array.from(s.items).map(([e,{ref:t,forceMount:n,...r}])=>{let i=h===e;return(0,K.jsx)(Rn,{present:n||i,children:(0,K.jsx)(gc,{...r,ref:Rt(t,e=>{i&&e&&d(e)})})},e)})})}),bc=`FocusGroup`,xc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=Gs(bc,n);return(0,K.jsx)(zs.Provider,{scope:n,children:(0,K.jsx)(zs.Slot,{scope:n,children:(0,K.jsx)(zn.div,{dir:i.dir,...r,ref:t})})})}),Sc=[`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`],Cc=`FocusGroupItem`,wc=G.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=Bs(n),a=Gs(Cc,n);return(0,K.jsx)(zs.ItemSlot,{scope:n,children:(0,K.jsx)(zn.button,{...r,ref:t,onKeyDown:Bn(e.onKeyDown,e=>{if([`Home`,`End`,...Sc].includes(e.key)){let t=i().map(e=>e.ref.current);if([a.dir===`rtl`?`ArrowRight`:`ArrowLeft`,`ArrowUp`,`End`].includes(e.key)&&t.reverse(),Sc.includes(e.key)){let n=t.indexOf(e.currentTarget);t=t.slice(n+1)}setTimeout(()=>Ec(t)),e.preventDefault()}})})})});function Tc(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ec(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}function Dc(e){return e.forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)}),()=>{e.forEach(e=>{let t=e.dataset.tabindex;e.setAttribute(`tabindex`,t)})}}function Oc(e,t){let n=Pn(t);Nn(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}function kc(e){return e?`open`:`closed`}function Ac(e,t){return`${e}-trigger-${t}`}function jc(e,t){return`${e}-content-${t}`}function Mc(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Nc=Js,Pc=$s,Fc=rc,Ic=ac,Lc=cc,Rc=uc,zc=pc,Bc=vc,Vc=[`PageUp`,`PageDown`],Hc=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Uc={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Wc=`Slider`,[Gc,Kc,qc]=Wn(Wc),[Jc,Yc]=kn(Wc,[qc]),[Xc,Zc]=Jc(Wc),Qc=G.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...h}=e,g=G.useRef(new Set),_=G.useRef(0),v=o===`horizontal`?tl:nl,[y=[],b]=Vn({prop:u,defaultProp:l,onChange:e=>{[...g.current][_.current]?.focus(),d(e)}}),x=G.useRef(y);function S(e){T(e,gl(y,e))}function C(e){T(e,_.current)}function w(){let e=x.current[_.current];y[_.current]!==e&&f(y)}function T(e,t,{commit:n}={commit:!1}){let o=xl(a),s=Sl(Math.round((e-r)/a)*a+r,o),l=vr(s,[r,i]);b((e=[])=>{let r=pl(e,l,t);if(yl(r,c*a)){_.current=r.indexOf(l);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e})}return(0,K.jsx)(Xc,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:_,thumbs:g.current,values:y,orientation:o,form:m,children:(0,K.jsx)(Gc.Provider,{scope:e.__scopeSlider,children:(0,K.jsx)(Gc.Slot,{scope:e.__scopeSlider,children:(0,K.jsx)(v,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:t,onPointerDown:Bn(h.onPointerDown,()=>{s||(x.current=y)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:S,onSlideMove:s?void 0:C,onSlideEnd:s?void 0:w,onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(i,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=Vc.includes(e.key)||e.shiftKey&&Hc.includes(e.key)?10:1,r=_.current,i=y[r];T(i+a*n*t,r,{commit:!0})}}})})})})});Qc.displayName=Wc;var[$c,el]=Jc(Wc,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),tl=G.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=G.useState(null),p=zt(t,e=>f(e)),m=G.useRef(void 0),h=Gn(i),g=h===`ltr`,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=bl([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,K.jsx)($c,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:(0,K.jsx)(rl,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=Uc[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),nl=G.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=G.useRef(null),d=zt(t,u),f=G.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=bl([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,K.jsx)($c,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,K.jsx)(rl,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=Uc[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),rl=G.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Zc(Wc,n);return(0,K.jsx)(zn.span,{...l,ref:t,onKeyDown:Bn(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Vc.concat(Hc).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:Bn(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:Bn(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:Bn(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),il=`SliderTrack`,al=G.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Zc(il,n);return(0,K.jsx)(zn.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});al.displayName=il;var ol=`SliderRange`,sl=G.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Zc(ol,n),a=el(ol,n),o=G.useRef(null),s=zt(t,o),c=i.values.length,l=i.values.map(e=>ml(e,i.min,i.max)),u=c>1?Math.min(...l):0,d=100-Math.max(...l);return(0,K.jsx)(zn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:s,style:{...e.style,[a.startEdge]:u+`%`,[a.endEdge]:d+`%`}})});sl.displayName=ol;var cl=`SliderThumb`,ll=G.forwardRef((e,t)=>{let n=Kc(e.__scopeSlider),[r,i]=G.useState(null),a=zt(t,e=>i(e)),o=G.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,K.jsx)(ul,{...e,ref:a,index:o})}),ul=G.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=Zc(cl,n),s=el(cl,n),[c,l]=G.useState(null),u=zt(t,e=>l(e)),d=!c||o.form||!!c.closest(`form`),f=Hn(c),p=o.values[r],m=p===void 0?0:ml(p,o.min,o.max),h=hl(r,o.values.length),g=f?.[s.size],_=g?_l(g,m,s.direction):0;return G.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,K.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${_}px)`},children:[(0,K.jsx)(Gc.ItemSlot,{scope:e.__scopeSlider,children:(0,K.jsx)(zn.span,{role:`slider`,"aria-label":e[`aria-label`]||h,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,tabIndex:o.disabled?void 0:0,...a,ref:u,style:p===void 0?{display:`none`}:e.style,onFocus:Bn(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&(0,K.jsx)(fl,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});ll.displayName=cl;var dl=`RadioBubbleInput`,fl=G.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=G.useRef(null),a=zt(i,r),o=hr(t);return G.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,K.jsx)(zn.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});fl.displayName=dl;function pl(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function ml(e,t,n){let r=100/(n-t)*(e-t);return vr(r,[0,100])}function hl(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function gl(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function _l(e,t,n){let r=e/2;return(r-bl([0,50],[0,r])(t)*n)*n}function vl(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function yl(e,t){if(t>0){let n=vl(e);return Math.min(...n)>=t}return!0}function bl(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function xl(e){return(String(e).split(`.`)[1]||``).length}function Sl(e,t){let n=10**t;return Math.round(e*n)/n}var Cl=Qc,wl=al,Tl=sl,El=ll,Dl=sa(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Ol=sa(`arrow-up-wide-narrow`,[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 16h7`,key:`uosisv`}],[`path`,{d:`M11 20h4`,key:`1krc32`}]]),kl=sa(`binary`,[[`rect`,{x:`14`,y:`14`,width:`4`,height:`6`,rx:`2`,key:`p02svl`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`6`,rx:`2`,key:`xm4xkj`}],[`path`,{d:`M6 20h4`,key:`1i6q5t`}],[`path`,{d:`M14 10h4`,key:`ru81e7`}],[`path`,{d:`M6 14h2v6`,key:`16z9wg`}],[`path`,{d:`M14 4h2v6`,key:`1idq9u`}]]),Al=sa(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),jl=sa(`combine`,[[`path`,{d:`M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1`,key:`1l7d7l`}],[`path`,{d:`M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1`,key:`9955pe`}],[`path`,{d:`m7 15 3 3`,key:`4hkfgk`}],[`path`,{d:`m7 21 3-3H5a2 2 0 0 1-2-2v-2`,key:`1xljwe`}],[`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1cdgtw`}],[`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1`,key:`zi3rio`}]]),Ml=sa(`copy-slash`,[[`line`,{x1:`12`,x2:`18`,y1:`18`,y2:`12`,key:`ebkxgr`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Nl=sa(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),Pl=sa(`group`,[[`path`,{d:`M3 7V5c0-1.1.9-2 2-2h2`,key:`adw53z`}],[`path`,{d:`M17 3h2c1.1 0 2 .9 2 2v2`,key:`an4l38`}],[`path`,{d:`M21 17v2c0 1.1-.9 2-2 2h-2`,key:`144t0e`}],[`path`,{d:`M7 21H5c-1.1 0-2-.9-2-2v-2`,key:`rtnfgi`}],[`rect`,{width:`7`,height:`5`,x:`7`,y:`7`,rx:`1`,key:`1eyiv7`}],[`rect`,{width:`7`,height:`5`,x:`10`,y:`12`,rx:`1`,key:`1qlmkx`}]]),Fl=sa(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]),Il=sa(`square-dashed-mouse-pointer`,[[`path`,{d:`M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z`,key:`xwnzip`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h2`,key:`1qve2z`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v2`,key:`p14lih`}],[`path`,{d:`M3 14v1`,key:`vnatye`}]]),Ll=sa(`square-mouse-pointer`,[[`path`,{d:`M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z`,key:`xwnzip`}],[`path`,{d:`M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6`,key:`14rsvq`}]]),Rl=sa(`triangle`,[[`path`,{d:`M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`,key:`14u9p9`}]]),zl=e(b(),1),Bl={INSERT:`insert`,DELETE:`delete`,SUBSTITUTE:`substitute`,MATCH:`match`};function Vl(e,t,n){let r=e.length,i=t.length,a=Array.from({length:r+1},()=>Array.from({length:i+1}).fill(0));for(let e=0;e<=r;e++)a[e][0]=e;for(let e=0;e<=i;e++)a[0][e]=e;for(let o=1;o<=r;o++)for(let r=1;r<=i;r++)a[o][r]=n(e[o-1],t[r-1])?a[o-1][r-1]:1+Math.min(a[o-1][r],a[o][r-1],a[o-1][r-1]);let o=[],s=r,c=i;for(;s>0||c>0;)s>0&&c>0&&n(e[s-1],t[c-1])?(o.unshift({type:Bl.MATCH,position:s-1}),s--,c--):s>0&&c>0&&a[s][c]===a[s-1][c-1]+1?(o.unshift({type:Bl.SUBSTITUTE,position:s-1}),s--,c--):s>0&&a[s][c]===a[s-1][c]+1?(o.unshift({type:Bl.DELETE,position:s-1}),s--):c>0&&a[s][c]===a[s][c-1]+1&&(o.unshift({type:Bl.INSERT,position:s}),c--);return{distance:a[r][i],operations:o}}function Hl(e,t,n){let r=[],i=0;for(let a of t)switch(a.type){case Bl.MATCH:r.push(e[i]),i++;break;case Bl.DELETE:i++;break;case Bl.INSERT:r.push(n);break;case Bl.SUBSTITUTE:r.push(n),i++}return r}function Ul(e,t,n,r){let i=Vl(e,t,n);return{merged:Hl(e,i.operations,r),edits:i}}var Wl=0,Gl=``;function Kl(e){return e.id?e.id:e.name===`setup`?k:N.create()}function ql(e,t){let n=new Map,r=new Map;if(!e&&!t)return{cellIds:[],sessionCellData:n,notebookCellData:r};if(!e){let e=t?.cells.map(e=>Kl(e))||[];return{cellIds:e,sessionCellData:new Map(e.map((e,t)=>[e,null])),notebookCellData:new Map(e.map((e,n)=>[e,t?.cells[n]||Jl()]))}}if(!t){let t=e.cells.map(e=>Kl(e));return{cellIds:t,sessionCellData:new Map(t.map((t,n)=>[t,e.cells[n]])),notebookCellData:new Map(t.map(e=>[e,Jl()]))}}let{merged:i,edits:a}=Ul(e.cells,t.cells,(e,t)=>{let n=e.code_hash;return n?t.code_hash===n:!1},Yl());a.distance>0&&U.warn(`Session and notebook have different cells, attempted merge.`);let o=[];for(let e=0;e<t.cells.length;e++){let a=t.cells[e];if(a){let t=Kl(a);o.push(t);let s=i[e]||Yl();s.id=t,n.set(t,s),r.set(t,a)}else U.warn(`Merged notebook cell is null at index`,e)}return{cellIds:o,sessionCellData:n,notebookCellData:r}}function Jl(){return{id:N.create(),name:Gl,code:Gl,code_hash:null,config:{column:null,disabled:!1,hide_code:!1}}}function Yl(){return{id:N.create(),code_hash:null,console:[],outputs:[]}}function Xl(e,t){return{id:e,name:t.name??Gl,code:t.code??Gl,edited:!1,lastCodeRun:null,lastExecutionTime:null,config:{column:t.config?.column??null,disabled:t.config?.disabled??!1,hide_code:t.config?.hide_code??!1},serializedEditorState:null}}function Zl(e){let t=te();if(!e)return t;let n=e.outputs||[],r=n.find(e=>e.type===`data`)||n.find(e=>e.type===`error`)||n[0];if(r){if(r.type===`error`)t.output={channel:`marimo-error`,data:[{type:`unknown`,msg:r.evalue}],mimetype:`application/vnd.marimo+error`,timestamp:Wl};else if(r.type===`data`){let e=Object.keys(r.data)[0];t.output={channel:`output`,data:Object.values(r.data)[0],mimetype:e,timestamp:Wl}}}let i=e.console||[];return{...t,outline:t.output?ze(t.output):null,consoleOutputs:i.map(e=>e.type===`streamMedia`?{channel:`media`,data:e.data,mimetype:e.mimetype,timestamp:Wl}:{channel:e.name===`stderr`?`stderr`:`stdout`,data:e.text,mimetype:e.mimetype??`text/plain`,timestamp:Wl})}}function Ql(e,t){let{cellIds:n,sessionCellData:r,notebookCellData:i}=ql(e,t);if(n.length===0)return null;let a={},o={};for(let e of n){let t=r.get(e),n=i.get(e);n&&(a[e]=Xl(e,n)),o[e]=Zl(t)}return{cellIds:Ue.from([n]),cellData:a,cellRuntime:o,cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set}}var q=bt(),$l=Object.freeze({left:0,top:0,width:16,height:16}),eu=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),tu=Object.freeze({...$l,...eu}),nu=Object.freeze({...tu,body:``,hidden:!1}),ru=Object.freeze({width:null,height:null}),iu=Object.freeze({...ru,...eu});function au(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}var ou=/[\s,]+/;function su(e,t){t.split(ou).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0}})}var cu={...iu,preserveAspectRatio:``};function lu(e){let t={...cu},n=(t,n)=>e.getAttribute(t)||n;return t.width=n(`width`,null),t.height=n(`height`,null),t.rotate=au(n(`rotate`,``)),su(t,n(`flip`,``)),t.preserveAspectRatio=n(`preserveAspectRatio`,n(`preserveaspectratio`,``)),t}function uu(e,t){for(let n in cu)if(e[n]!==t[n])return!0;return!1}var du=/^[a-z0-9]+(-[a-z0-9]+)*$/,fu=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!pu(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!pu(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!pu(e,n)?null:e}return null},pu=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function mu(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function hu(e,t){let n=mu(e,t);for(let r in nu)r in eu?r in e&&!(r in n)&&(n[r]=eu[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function gu(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}function _u(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=hu(r[e]||i[e],a)}return o(t),n.forEach(o),hu(e,a)}function vu(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=gu(e);for(let i in r){let a=r[i];a&&(t(i,_u(e,i,a)),n.push(i))}return n}var yu={provider:``,aliases:{},not_found:{},...$l};function bu(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function xu(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!bu(e,yu))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!bu(t,nu))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!bu(t,nu))return null}return t}var Su=Object.create(null);function Cu(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function wu(e,t){let n=Su[e]||(Su[e]=Object.create(null));return n[t]||(n[t]=Cu(e,t))}function Tu(e,t){return xu(t)?vu(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function Eu(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}function Du(e,t){let n=[];return(typeof e==`string`?[e]:Object.keys(Su)).forEach(e=>{(typeof e==`string`&&typeof t==`string`?[t]:Object.keys(Su[e]||{})).forEach(t=>{let r=wu(e,t);n=n.concat(Object.keys(r.icons).map(n=>(e===``?``:`@`+e+`:`)+t+`:`+n))})}),n}var Ou=!1;function ku(e){return typeof e==`boolean`&&(Ou=e),Ou}function Au(e){let t=typeof e==`string`?fu(e,!0,Ou):e;if(t){let e=wu(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function ju(e,t){let n=fu(e,!0,Ou);if(!n)return!1;let r=wu(n.provider,n.prefix);return t?Eu(r,n.name,t):(r.missing.add(n.name),!0)}function Mu(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),Ou&&!t&&!e.prefix){let t=!1;return xu(e)&&(e.prefix=``,vu(e,(e,n)=>{ju(e,n)&&(t=!0)})),t}let n=e.prefix;return pu({provider:t,prefix:n,name:`a`})?!!Tu(wu(t,n),e):!1}function Nu(e){return!!Au(e)}function Pu(e){let t=Au(e);return t&&{...tu,...t}}function Fu(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=wu(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function Iu(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Lu(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||Iu([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ru=0;function zu(e,t,n){let r=Ru++,i=Iu.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}var Bu=Object.create(null);function Vu(e,t){Bu[e]=t}function Hu(e){return Bu[e]||Bu[``]}function Uu(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?fu(e,t,n):e;i&&r.push(i)}),r}var Wu={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Gu(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function Ku(e){let t={...Wu,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Gu(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function qu(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var Ju=Object.create(null),Yu=[`https://api.simplesvg.com`,`https://api.unisvg.com`],Xu=[];Yu.length>0;)Yu.length===1||Math.random()>.5?Xu.push(Yu.shift()):Xu.push(Yu.pop());Ju[``]=qu({resources:[`https://api.iconify.design`].concat(Xu)});function Zu(e,t){let n=qu(t);return n!==null&&(Ju[e]=n,!0)}function Qu(e){return Ju[e]}function $u(){return Object.keys(Ju)}function ed(){}var td=Object.create(null);function nd(e){if(!td[e]){let t=Qu(e);if(!t)return;td[e]={config:t,redundancy:Ku(t)}}return td[e]}function rd(e,t,n){let r,i;if(typeof e==`string`){let t=Hu(e);if(!t)return n(void 0,424),ed;i=t.send;let a=nd(e);a&&(r=a.redundancy)}else{let t=qu(e);if(t){r=Ku(t);let n=Hu(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),ed):r.query(t,i,n)().abort}function id(){}function ad(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Lu(e)}))}function od(e){let t=[],n=[];return e.forEach(e=>{(e.match(du)?t:n).push(e)}),{valid:t,invalid:n}}function sd(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!Tu(e,n).length){r();return}}catch(e){console.error(e)}r(),ad(e)}function cd(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function ld(e,t){e.iconsToLoad=e.iconsToLoad?e.iconsToLoad.concat(t).sort():t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){cd(e.loadIcons(r,n,t),t=>{sd(e,r,t)});return}if(i){r.forEach(r=>{cd(i(r,n,t),t=>{sd(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=od(r);if(o.length&&sd(e,o,null),!a.length)return;let s=n.match(du)?Hu(t):null;if(!s){sd(e,a,null);return}s.prepare(t,n,a).forEach(n=>{rd(t,n,t=>{sd(e,n.icons,t)})})}))}var ud=(e,t)=>{let n=Fu(Uu(e,!0,ku()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,id)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(wu(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=wu(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&ld(e,t)}),t?zu(t,n,i):id},dd=e=>new Promise((t,n)=>{let r=typeof e==`string`?fu(e,!0):e;if(!r){n(e);return}ud([r||e],i=>{if(i.length&&r){let e=Au(r);if(e){t({...tu,...e});return}}n(e)})});function fd(e){try{let t=typeof e==`string`?JSON.parse(e):e;if(typeof t.body==`string`)return{...t}}catch{}}function pd(e,t){if(typeof e==`object`)return{data:fd(e),value:e};if(typeof e!=`string`)return{value:e};if(e.includes(`{`)){let t=fd(e);if(t)return{data:t,value:e}}let n=fu(e,!0,!0);if(!n)return{value:e};let r=Au(n);return r!==void 0||!n.prefix?{value:e,name:n,data:r}:{value:e,name:n,loading:ud([n],()=>t(e,n,Au(n)))}}var md=!1;try{md=navigator.vendor.indexOf(`Apple`)===0}catch{}function hd(e,t){switch(t){case`svg`:case`bg`:case`mask`:return t}return t!==`style`&&(md||e.indexOf(`<a`)===-1)?`svg`:e.indexOf(`currentColor`)===-1?`bg`:`mask`}var gd=/(-?[0-9.]*[0-9]+[0-9.]*)/g,_d=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function vd(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(gd);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=_d.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function yd(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function bd(e,t){return e?`<defs>`+e+`</defs>`+t:t}function xd(e,t,n){let r=yd(e);return bd(r.defs,t+r.content+n)}var Sd=e=>e===`unset`||e===`undefined`||e===`none`;function Cd(e,t){let n={...tu,...e},r={...iu,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=xd(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=vd(d,c/l)):(u=o===`auto`?c:o,d=s===null?vd(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Sd(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}function wd(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Td(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Ed(e){return`data:image/svg+xml,`+Td(e)}function Dd(e){return`url("`+Ed(e)+`")`}var Od=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function kd(e){Od=e}function Ad(){return Od}function jd(e,t){let n=Qu(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function Md(e){return e===404}var Nd=(e,t,n)=>{let r=[],i=jd(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Pd(e){if(typeof e==`string`){let t=Qu(e);if(t)return t.path}return`/`}var Fd={prepare:Nd,send:(e,t,n)=>{if(!Od){n(`abort`,424);return}let r=Pd(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;Od(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Md(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function Id(e,t,n){wu(n||``,t).loadIcons=e}function Ld(e,t,n){wu(n||``,t).loadIcon=e}var Rd=`data-style`,zd=``;function Bd(e){zd=e}function Vd(e,t){let n=Array.from(e.childNodes).find(e=>e.hasAttribute&&e.hasAttribute(Rd));n||(n=document.createElement(`style`),n.setAttribute(Rd,Rd),e.appendChild(n)),n.textContent=`:host{display:inline-block;vertical-align:`+(t?`-0.125em`:`0`)+`}span,svg{display:block;margin:auto}`+zd}function Hd(){Vu(``,Fd),ku(!0);let e;try{e=window}catch{}if(e){if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!Mu(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Zu(e,r)||console.error(n)}catch{console.error(n)}}}}return{enableCache:e=>{},disableCache:e=>{},iconLoaded:Nu,iconExists:Nu,getIcon:Pu,listIcons:Du,addIcon:ju,addCollection:Mu,calculateSize:vd,buildIcon:Cd,iconToHTML:wd,svgToURL:Dd,loadIcons:ud,loadIcon:dd,addAPIProvider:Zu,setCustomIconLoader:Ld,setCustomIconsLoader:Id,appendCustomStyle:Bd,_api:{getAPIConfig:Qu,setAPIModule:Vu,sendAPIQuery:rd,setFetch:kd,getFetch:Ad,listAPIProviders:$u}}}var Ud={"background-color":`currentColor`},Wd={"background-color":`transparent`},Gd={image:`var(--svg)`,repeat:`no-repeat`,size:`100% 100%`},Kd={"-webkit-mask":Ud,mask:Ud,background:Wd};for(let e in Kd){let t=Kd[e];for(let n in Gd)t[e+`-`+n]=Gd[n]}function qd(e){return e?e+(e.match(/^[-0-9.]+$/)?`px`:``):`inherit`}function Jd(e,t,n){let r=document.createElement(`span`),i=e.body;i.indexOf(`<a`)!==-1&&(i+=`<!-- `+Date.now()+` -->`);let a=e.attributes,o=Dd(wd(i,{...a,width:t.width+``,height:t.height+``})),s=r.style,c={"--svg":o,width:qd(a.width),height:qd(a.height),...n?Ud:Wd};for(let e in c)s.setProperty(e,c[e]);return r}var Yd;function Xd(){try{Yd=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{Yd=null}}function Zd(e){return Yd===void 0&&Xd(),Yd?Yd.createHTML(e):e}function Qd(e){let t=document.createElement(`span`),n=e.attributes,r=``;return n.width||(r=`width: inherit;`),n.height||(r+=`height: inherit;`),r&&(n.style=r),t.innerHTML=Zd(wd(e.body,n)),t.firstChild}function $d(e){return Array.from(e.childNodes).find(e=>{let t=e.tagName&&e.tagName.toUpperCase();return t===`SPAN`||t===`SVG`})}function ef(e,t){let n=t.icon.data,r=t.customisations,i=Cd(n,r);r.preserveAspectRatio&&(i.attributes.preserveAspectRatio=r.preserveAspectRatio);let a=t.renderedMode,o;switch(a){case`svg`:o=Qd(i);break;default:o=Jd(i,{...tu,...n},a===`mask`)}let s=$d(e);s?o.tagName===`SPAN`&&s.tagName===o.tagName?s.setAttribute(`style`,o.getAttribute(`style`)):e.replaceChild(o,s):e.appendChild(o)}function tf(e,t,n){return{rendered:!1,inline:t,icon:e,lastRender:n&&(n.rendered?n:n.lastRender)}}function nf(e=`iconify-icon`){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;let r=t.get(e);if(r)return r;let i=[`icon`,`mode`,`inline`,`noobserver`,`width`,`height`,`rotate`,`flip`],a=class extends n{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();let e=this._shadowRoot=this.attachShadow({mode:`open`}),t=this.hasAttribute(`inline`);Vd(e,t),this._state=tf({value:``},t),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return i.slice(0)}attributeChangedCallback(e){switch(e){case`inline`:{let e=this.hasAttribute(`inline`),t=this._state;e!==t.inline&&(t.inline=e,Vd(this._shadowRoot,e));break}case`noobserver`:this.hasAttribute(`noobserver`)?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){let e=this.getAttribute(`icon`);if(e&&e.slice(0,1)===`{`)try{return JSON.parse(e)}catch{}return e}set icon(e){typeof e==`object`&&(e=JSON.stringify(e)),this.setAttribute(`icon`,e)}get inline(){return this.hasAttribute(`inline`)}set inline(e){e?this.setAttribute(`inline`,`true`):this.removeAttribute(`inline`)}get observer(){return this.hasAttribute(`observer`)}set observer(e){e?this.setAttribute(`observer`,`true`):this.removeAttribute(`observer`)}restartAnimation(){let e=this._state;if(e.rendered){let t=this._shadowRoot;if(e.renderedMode===`svg`)try{t.lastChild.setCurrentTime(0);return}catch{}ef(t,e)}}get status(){let e=this._state;return e.rendered?`rendered`:e.icon.data===null?`failed`:`loading`}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;let e=this._state,t=this.getAttribute(`icon`);if(t!==e.icon.value){this._iconChanged(t);return}if(!e.rendered||!this._visible)return;let n=this.getAttribute(`mode`),r=lu(this);(e.attrMode!==n||uu(e.customisations,r)||!$d(this._shadowRoot))&&this._renderIcon(e.icon,r,n)}_iconChanged(e){let t=pd(e,(e,t,n)=>{let r=this._state;if(r.rendered||this.getAttribute(`icon`)!==e)return;let i={value:e,name:t,data:n};i.data?this._gotIconData(i):r.icon=i});t.data?this._gotIconData(t):this._state=tf(t,this._state.inline,this._state)}_forceRender(){if(!this._visible){let e=$d(this._shadowRoot);e&&this._shadowRoot.removeChild(e);return}this._queueCheck()}_gotIconData(e){this._checkQueued=!1,this._renderIcon(e,lu(this),this.getAttribute(`mode`))}_renderIcon(e,t,n){let r=hd(e.data.body,n),i=this._state.inline;ef(this._shadowRoot,this._state={rendered:!0,icon:e,inline:i,customisations:t,attrMode:n,renderedMode:r})}startObserver(){if(!this._observer&&!this.hasAttribute(`noobserver`))try{this._observer=new IntersectionObserver(e=>{let t=e.some(e=>e.isIntersecting);t!==this._visible&&(this._visible=t,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};i.forEach(e=>{e in a.prototype||Object.defineProperty(a.prototype,e,{get:function(){return this.getAttribute(e)},set:function(t){t===null?this.removeAttribute(e):this.setAttribute(e,t)}})});let o=Hd();for(let e in o)a[e]=a.prototype[e]=o[e];return t.define(e,a),a}var{enableCache:rf,disableCache:af,iconLoaded:of,iconExists:sf,getIcon:cf,listIcons:lf,addIcon:uf,addCollection:df,calculateSize:ff,buildIcon:pf,iconToHTML:mf,svgToURL:hf,loadIcons:gf,loadIcon:_f,setCustomIconLoader:vf,setCustomIconsLoader:yf,addAPIProvider:bf,_api:xf}=nf()||Hd(),Sf=()=>((0,q.c)(1),null),Cf=(0,G.memo)(e=>{let t=(0,q.c)(3),{children:n}=e,{theme:r}=zo(),i,a;return t[0]===r?(i=t[1],a=t[2]):(i=()=>(document.body.classList.add(r,`${r}-theme`),document.body.dataset.theme=r,()=>{document.body.classList.remove(r,`${r}-theme`),delete document.body.dataset.theme}),a=[r],t[0]=r,t[1]=i,t[2]=a),(0,G.useLayoutEffect)(i,a),n});Cf.displayName=`ThemeProvider`;var wf=e=>{let t=(0,q.c)(3),{variables:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,K.jsx)(`div`,{className:`contents`,style:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i},Tf=()=>{let e=(0,q.c)(25),[t,r]=n(It);if(t===null)return null;let i;e[0]===t?i=e[1]:(i=async()=>{try{await navigator.clipboard.writeText(t),No({title:`Copied to clipboard`,description:`Error details have been copied to your clipboard.`})}catch{No({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},e[0]=t,e[1]=i);let a=i,o;e[2]===r?o=e[3]:(o=()=>{r(null)},e[2]=r,e[3]=o);let s=o,c=Ef,l;e[4]===s?l=e[5]:(l=e=>!e&&s(),e[4]=s,e[5]=l);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsxs)(tr,{children:[(0,K.jsxs)(rr,{className:`flex items-center gap-2 text-destructive`,children:[(0,K.jsx)(We,{className:`h-5 w-5`}),`Kernel Startup Failed`]}),(0,K.jsx)(er,{children:`The kernel failed to start. This usually happens when the package manager can't install your notebook's dependencies.`})]}),e[6]=u):u=e[6];let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Error Details`}),e[7]=d):d=e[7];let f;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(Za,{className:`h-3 w-3`}),e[8]=f):f=e[8];let p;e[9]===a?p=e[10]:(p=(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[d,(0,K.jsxs)(Yi,{variant:`outline`,size:`xs`,onClick:a,className:`flex items-center gap-1`,children:[f,`Copy`]})]}),e[9]=a,e[10]=p);let m;e[11]===t?m=e[12]:(m=(0,K.jsx)(`pre`,{className:`bg-muted p-4 rounded-md text-sm font-mono overflow-auto max-h-80`,children:t}),e[11]=t,e[12]=m);let h;e[13]!==p||e[14]!==m?(h=(0,K.jsxs)(`div`,{className:`my-4 overflow-hidden`,children:[p,m]}),e[13]=p,e[14]=m,e[15]=h):h=e[15];let g;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,K.jsxs)(Yi,{variant:`outline`,onClick:c,className:`flex items-center gap-2`,children:[(0,K.jsx)(ro,{className:`h-4 w-4`}),`Return to Home`]}),e[16]=g):g=e[16];let _;e[17]===s?_=e[18]:(_=(0,K.jsxs)(ar,{children:[g,(0,K.jsx)(ir,{onClick:s,children:`Dismiss`})]}),e[17]=s,e[18]=_);let v;e[19]!==_||e[20]!==h?(v=(0,K.jsxs)(nr,{className:`max-w-2xl`,children:[u,h,_]}),e[19]=_,e[20]=h,e[21]=v):v=e[21];let y;return e[22]!==v||e[23]!==l?(y=(0,K.jsx)(or,{open:!0,onOpenChange:l,children:v}),e[22]=v,e[23]=l,e[24]=y):y=e[24],y};function Ef(){let e=document.baseURI.split(`?`)[0];window.open(e,`_self`)}var Df=e=>{let t=(0,q.c)(30),{isOpen:n,onClose:r,traceback:i,errorMessage:a}=e,o;t[0]===i?o=t[1]:(o=async()=>{let e=document.createElement(`div`);e.innerHTML=Le(i);let t=e.textContent||e.innerText||``;try{await navigator.clipboard.writeText(t),No({title:`Copied to clipboard`,description:`Traceback has been copied to your clipboard.`})}catch{No({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},t[0]=i,t[1]=o);let s=o,c;t[2]===r?c=t[3]:(c=e=>!e&&r(),t[2]=r,t[3]=c);let l;t[4]===a?l=t[5]:(l=(0,K.jsx)(rr,{className:`text-destructive`,children:a}),t[4]=a,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(er,{children:`Click the traceback to select and copy.`}),t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,K.jsxs)(tr,{children:[l,u]}),t[7]=l,t[8]=d);let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Traceback`}),t[9]=f):f=t[9];let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(Za,{className:`h-3 w-3`}),t[10]=p):p=t[10];let m;t[11]===s?m=t[12]:(m=(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[f,(0,K.jsxs)(Yi,{variant:`outline`,size:`xs`,onClick:s,className:`flex items-center gap-1`,children:[p,`Copy`]})]}),t[11]=s,t[12]=m);let h;t[13]===i?h=t[14]:(h=$o({html:i}),t[13]=i,t[14]=h);let g;t[15]===h?g=t[16]:(g=(0,K.jsx)(`div`,{className:`font-code text-sm p-4 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text`,children:h}),t[15]=h,t[16]=g);let _;t[17]!==g||t[18]!==m?(_=(0,K.jsxs)(`div`,{className:`my-4 overflow-auto`,children:[m,g]}),t[17]=g,t[18]=m,t[19]=_):_=t[19];let v;t[20]===r?v=t[21]:(v=(0,K.jsx)(ar,{children:(0,K.jsx)(ir,{onClick:r,children:`Close`})}),t[20]=r,t[21]=v);let y;t[22]!==_||t[23]!==v||t[24]!==d?(y=(0,K.jsxs)(nr,{className:`max-w-4xl max-h-[80vh]`,children:[d,_,v]}),t[22]=_,t[23]=v,t[24]=d,t[25]=y):y=t[25];let b;return t[26]!==n||t[27]!==y||t[28]!==c?(b=(0,K.jsx)(or,{open:n,onOpenChange:c,children:y}),t[26]=n,t[27]=y,t[28]=c,t[29]=b):b=t[29],b},Of=()=>{let e=(0,q.c)(6),[t,r]=n(Ke);if(!t)return null;let i;e[0]===r?i=e[1]:(i=()=>r(null),e[0]=r,e[1]=i);let a;return e[2]!==i||e[3]!==t.errorMessage||e[4]!==t.traceback?(a=(0,K.jsx)(Df,{isOpen:!0,onClose:i,traceback:t.traceback,errorMessage:t.errorMessage}),e[2]=i,e[3]=t.errorMessage,e[4]=t.traceback,e[5]=a):a=e[5],a},kf=()=>{let e=(0,q.c)(5),{toasts:t}=Mo(),n;e[0]===t?n=e[1]:(n=t.map(Mf),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(Af,{}),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,K.jsxs)(I,{children:[n,r]}),e[3]=n,e[4]=i),i},Af=Ln(({container:e})=>(0,Ps.createPortal)((0,K.jsx)(In,{children:(0,K.jsx)(Ee,{})}),e??document.body)),jf=e=>{let t=(0,q.c)(23),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({toastTitle:a,toastDescription:i,action:n,variant:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=(0,G.useRef)(null),c=!!i&&!n&&o===`danger`,u;t[6]===a?u=t[7]:(u=a&&(0,K.jsx)(l,{children:a}),t[6]=a,t[7]=u);let d;t[8]===i?d=t[9]:(d=i&&(0,K.jsx)(ge,{ref:s,children:i}),t[8]=i,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,K.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[u,d]}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==c||t[14]!==i?(p=c&&(0,K.jsx)(Qo,{tooltip:`Copy error`,ariaLabel:`Copy error`,className:`h-4 w-4`,buttonClassName:W(`absolute right-8 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity`,`hover:text-foreground focus:opacity-100 focus:outline-hidden group-hover:opacity-100`,`group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-500 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600`),value:()=>s.current?.innerText??(typeof i==`string`?i:``)}),t[13]=c,t[14]=i,t[15]=p):p=t[15];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(fe,{}),t[16]=m):m=t[16];let h;return t[17]!==n||t[18]!==r||t[19]!==f||t[20]!==p||t[21]!==o?(h=(0,K.jsxs)(pe,{variant:o,...r,children:[f,n,p,m]}),t[17]=n,t[18]=r,t[19]=f,t[20]=p,t[21]=o,t[22]=h):h=t[22],h};function Mf(e){let{id:t,title:n,description:r,action:i,variant:a,...o}=e;return(0,K.jsx)(jf,{toastTitle:n,toastDescription:r,action:i,variant:a,...o},t)}var Nf=e=>{let t=(0,q.c)(5),{children:n}=e,i=r(Qt),a;t[0]===i?a=t[1]:(a=Qr(i),t[0]=i,t[1]=a);let o;return t[2]!==n||t[3]!==a?(o=(0,K.jsx)(Bo,{locale:a,children:n}),t[2]=n,t[3]=a,t[4]=o):o=t[4],o},Pf=Wa(()=>jo(()=>import(`./home-page-Chy6SA41.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127]),import.meta.url)),Ff=Wa(()=>jo(()=>import(`./run-page-DXZapRtY.js`),__vite__mapDeps([128,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,129,74,92,75,76,130,94,131,132,133,78,79,80,134,108,135,136,137,93,138,82,89,139,140,104,141,90,142,143,144,145,109,110,146,147,148,106,149,119,120,121,150,151,152,153,154,122,155,95,156,111,157,158,112,159,160,161,162,163,100,164,103,165,166,167,168,169,170,171,172,173,86,174,113,175,107,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,125]),import.meta.url)),If=Wa(()=>jo(()=>import(`./edit-page-Bpqbjwkb.js`),__vite__mapDeps([286,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,163,100,164,103,94,165,93,79,108,166,95,167,134,132,135,136,137,143,144,145,168,169,170,99,101,102,104,92,75,76,89,80,105,106,107,109,110,111,112,113,114,115,74,129,130,131,133,78,138,82,139,140,141,90,142,146,147,148,149,119,120,121,150,151,152,153,154,122,155,156,157,158,159,160,171,172,173,86,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,161,287,288,289,88,123,290,291,292,293,294,85,295,87,296,124,297,116,298,299,300,301,125,126,302,127,283,303,304,97,305,306,83,84,307,308,281,309,310,311,282,117,118,312,313,162,284,285,98,314,315,316,317,318,319,320,321,322,323]),import.meta.url)),Lf=Wa(()=>jo(()=>import(`./gallery-page-4dZlIWMe.js`),__vite__mapDeps([324,1,3,4,74,21,14,30,12,13,24,25,48,2,15,89,33,54,6,26,34,35,55,41,40,56,8,9,10,11,69,23,71,94,7,111,29,115]),import.meta.url));function Rf(e){switch(e){case`home`:Pf.preload();break;case`gallery`:Lf.preload();break;case`read`:Ff.preload();break;default:If.preload()}}var zf=(0,G.memo)(()=>{let e=(0,q.c)(12),[t]=Ut(),[n]=Jt(),r;e[0]===t.display.code_editor_font_size?r=e[1]:(r=Vf(t.display.code_editor_font_size),e[0]=t.display.code_editor_font_size,e[1]=r);let i=r,a;e[2]!==n||e[3]!==t?(a=()=>{let e=nn();return e===`home`?(0,K.jsx)(Pf.Component,{}):e===`gallery`?(0,K.jsx)(Lf.Component,{}):e===`read`?(0,K.jsx)(Ff.Component,{appConfig:n}):(0,K.jsx)(If.Component,{userConfig:t,appConfig:n})},e[2]=n,e[3]=t,e[4]=a):a=e[4];let o=a,s;e[5]===i?s=e[6]:(s={"--marimo-code-editor-font-size":i},e[5]=i,e[6]=s);let c;e[7]===o?c=e[8]:(c=(0,K.jsx)(Nf,{children:o()}),e[7]=o,e[8]=c);let l;return e[9]!==s||e[10]!==c?(l=(0,K.jsx)(Bf,{children:(0,K.jsx)(wf,{variables:s,children:c})}),e[9]=s,e[10]=c,e[11]=l):l=e[11],l});zf.displayName=`MarimoApp`;var Bf=(0,G.memo)(e=>{let t=(0,q.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(kf,{}),i=(0,K.jsx)(Sf,{}),a=(0,K.jsx)(Tf,{}),o=(0,K.jsx)(Of,{}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):(r=t[0],i=t[1],a=t[2],o=t[3]);let s;return t[4]===n?s=t[5]:(s=(0,K.jsx)(En,{children:(0,K.jsx)(G.Suspense,{children:(0,K.jsx)(Ui,{children:(0,K.jsx)(ji,{controller:Ni,children:(0,K.jsx)(Nf,{children:(0,K.jsxs)(co,{children:[n,r,i,a,o]})})})})})}),t[4]=n,t[5]=s),s});Bf.displayName=`Providers`;function Vf(e){return`${e/16}rem`}function Hf(){Ro(e=>{e.delete($t.accessToken)})}var Uf={sendComponentValues:`startConnection`,sendModelValue:`startConnection`,sendInstantiate:`startConnectionWithoutKernel`,sendRun:`startConnection`,sendDeleteCell:`startConnection`,sendRunScratchpad:`startConnection`,saveAppConfig:`startConnection`,saveCellConfig:`startConnection`,discoverDataSources:`startConnection`,exportAsHTML:`startConnection`,exportAsIPYNB:`startConnection`,exportAsMarkdown:`startConnection`,exportAsScript:`startConnection`,exportAsPDF:`startConnection`,readCode:`startConnection`,sendCopy:`throwError`,sendFormat:`throwError`,sendRestart:`throwError`,sendSave:`waitForConnectionOpen`,invokeAiTool:`waitForConnectionOpen`,sendFunctionRequest:`waitForConnectionOpen`,sendRename:`waitForConnectionOpen`,autoExportAsHTML:`waitForConnectionOpen`,autoExportAsMarkdown:`waitForConnectionOpen`,autoExportAsIPYNB:`waitForConnectionOpen`,updateCellOutputs:`waitForConnectionOpen`,listSecretKeys:`throwError`,writeSecret:`throwError`,clearCache:`throwError`,getCacheInfo:`throwError`,saveUserConfig:`throwError`,sendShutdown:`throwError`,getPackageList:`throwError`,getDependencyTree:`throwError`,addPackage:`throwError`,removePackage:`throwError`,sendListFiles:`startConnection`,sendSearchFiles:`startConnection`,sendCreateFileOrFolder:`throwError`,sendDeleteFileOrFolder:`throwError`,sendCopyFileOrFolder:`throwError`,sendRenameFileOrFolder:`throwError`,sendUpdateFile:`throwError`,sendFileDetails:`throwError`,openFile:`throwError`,getEnvironmentInfo:`serverOnly`,getExportAvailability:`serverOnly`,installExportRequirements:`startConnectionWithoutKernel`,getRecentFiles:`startConnection`,getWorkspaceFiles:`startConnection`,getRunningNotebooks:`startConnection`,shutdownSession:`startConnection`,openTutorial:`startConnection`,getUsageStats:`waitForConnectionOpen`,sendStdin:`waitForConnectionOpen`,sendInterrupt:`waitForConnectionOpen`,sendPdb:`waitForConnectionOpen`,sendSetBreakpoints:`waitForConnectionOpen`,sendInstallMissingPackages:`waitForConnectionOpen`,readSnippets:`waitForConnectionOpen`,previewDatasetColumn:`waitForConnectionOpen`,previewSQLTable:`waitForConnectionOpen`,previewSQLTableList:`waitForConnectionOpen`,previewSQLSchemaList:`waitForConnectionOpen`,previewDataSourceConnection:`waitForConnectionOpen`,validateSQL:`waitForConnectionOpen`,listStorageEntries:`waitForConnectionOpen`,downloadStorage:`waitForConnectionOpen`,sendDocumentTransaction:`waitForConnectionOpen`,sendCodeCompletionRequest:`waitForConnectionOpen`};function Wf(e,t){let n=na(async e=>{a.set(hn,{state:sn.CONNECTING}),await e.init()});function r(e,r){let i=Uf[r];return(async(...a)=>{let o=t();if(!o.isLazy)return e(...a);switch(i){case`serverOnly`:return e(...a);case`dropRequest`:U.debug(`Dropping request: ${r}, since not connected to a kernel.`);return;case`throwError`:throw new ts;case`waitForConnectionOpen`:return await on(),await Sn(),e(...a);case`startConnectionWithoutKernel`:case`startConnection`:return await n(o),await on(),i===`startConnection`&&await Sn(),e(...a);default:throw Error(`Unknown action for "${r}"`)}})}return Vt.mapValues(e,(e,t)=>r(e,t))}var Gf=`download`;function Kf(){let e=a.get(Oe);if(!e)return;let t=Po.basename(e);return Bi.withoutExtension(t)}function qf(e){let t=Kf();return t?`${t}.${e}`:`${Gf}.${e}`}function Jf(e){let t=io[e??`pymdown`];return qf(t)}function Yf(e){return{body:e,bodySerializer:e=>e}}var{handleExportResponse:Xf,handleResponse:Zf,handleResponseReturnNull:Qf}=vn;function $f(){let e=ta(()=>{let e=fn();return bn(e)}),t=()=>fn().sessionHeaders(),n=()=>({header:t()});return{sendComponentValues:t=>e().POST(`/api/kernel/set_ui_element_value`,{body:t,params:n()}).then(Qf),sendModelValue:t=>e().POST(`/api/kernel/set_model_value`,{body:t,params:n()}).then(Qf),sendRestart:()=>e().POST(`/api/kernel/restart_session`,{params:n()}).then(Qf),sendDocumentTransaction:async t=>(await on(),e().POST(`/api/document/transaction`,{body:t,params:n()}).then(Qf)),sendRename:t=>e().POST(`/api/kernel/rename`,{body:t,params:n()}).then(Qf),sendSave:t=>e().POST(`/api/kernel/save`,{body:t,parseAs:`text`,params:n()}).then(Qf),sendCopy:t=>e().POST(`/api/kernel/copy`,{body:t,parseAs:`text`,params:n()}).then(Qf),sendFormat:t=>e().POST(`/api/kernel/format`,{body:t}).then(Zf),sendInterrupt:()=>e().POST(`/api/kernel/interrupt`,{params:n()}).then(Qf),sendShutdown:()=>e().POST(`/api/kernel/shutdown`).then(Qf),sendRun:async t=>(await on(),e().POST(`/api/kernel/run`,{body:t,params:n()}).then(Qf)),sendRunScratchpad:async t=>(await on(),e().POST(`/api/kernel/scratchpad/run`,{body:t,params:n()}).then(Qf)),sendInstantiate:async t=>(await on(),e().POST(`/api/kernel/instantiate`,{body:t,params:n()}).then(Qf)),sendDeleteCell:t=>e().POST(`/api/kernel/delete`,{body:t,params:n()}).then(Qf),sendCodeCompletionRequest:async t=>(await on(),e().POST(`/api/kernel/code_autocomplete`,{body:t,params:n()}).then(Qf)),saveUserConfig:t=>e().POST(`/api/kernel/save_user_config`,{body:t}).then(Qf),saveAppConfig:t=>e().POST(`/api/kernel/save_app_config`,{body:t,parseAs:`text`,params:n()}).then(Qf),saveCellConfig:t=>e().POST(`/api/kernel/set_cell_config`,{body:t,params:n()}).then(Qf),sendFunctionRequest:t=>e().POST(`/api/kernel/function_call`,{body:t,params:n()}).then(Qf),sendStdin:t=>e().POST(`/api/kernel/stdin`,{body:t,params:n()}).then(Qf),sendInstallMissingPackages:t=>e().POST(`/api/kernel/install_missing_packages`,{body:t,params:n()}).then(Qf),readCode:async()=>(await on(),e().POST(`/api/kernel/read_code`,{params:n()}).then(Zf)),readSnippets:async()=>(await on(),e().GET(`/api/documentation/snippets`,{params:n()}).then(Zf)),previewDatasetColumn:t=>e().POST(`/api/datasources/preview_column`,{body:t,params:n()}).then(Qf),previewSQLTable:t=>e().POST(`/api/datasources/preview_sql_table`,{body:t,params:n()}).then(Qf),previewSQLTableList:t=>e().POST(`/api/datasources/preview_sql_table_list`,{body:t,params:n()}).then(Qf),previewSQLSchemaList:t=>e().POST(`/api/datasources/preview_sql_schema_list`,{body:t,params:n()}).then(Qf),previewDataSourceConnection:t=>e().POST(`/api/datasources/preview_datasource_connection`,{body:t,params:n()}).then(Qf),discoverDataSources:t=>e().POST(`/api/datasources/discover`,{body:t,params:n()}).then(Qf),validateSQL:t=>e().POST(`/api/sql/validate`,{body:t,params:n()}).then(Qf),openFile:async t=>(await on(),await e().POST(`/api/files/open`,{body:t}).then(Qf),null),getUsageStats:async()=>(await on(),e().GET(`/api/usage`).then(Zf)),getEnvironmentInfo:()=>e().GET(`/api/environment`).then(Zf),sendPdb:t=>e().POST(`/api/kernel/pdb/pm`,{body:t,params:n()}).then(Qf),sendSetBreakpoints:t=>e().POST(`/api/kernel/pdb/breakpoints`,{body:t,params:n()}).then(Qf),sendListFiles:async t=>(await on(),e().POST(`/api/files/list_files`,{body:t}).then(Zf)),sendSearchFiles:async t=>(await on(),e().POST(`/api/files/search`,{body:t}).then(Zf)),sendCreateFileOrFolder:async t=>{await on();let n=new FormData;return n.append(`path`,t.path),n.append(`type`,t.type),n.append(`name`,t.name),t.file&&n.append(`file`,t.file,t.name),e().POST(`/api/files/create`,Yf(n)).then(Zf)},sendDeleteFileOrFolder:async t=>e().POST(`/api/files/delete`,{body:t}).then(Zf),sendCopyFileOrFolder:async t=>e().POST(`/api/files/copy`,{body:t}).then(Zf),sendRenameFileOrFolder:async t=>e().POST(`/api/files/move`,{body:t}).then(Zf),sendUpdateFile:async t=>(await on(),e().POST(`/api/files/update`,{body:t}).then(Zf)),sendFileDetails:async t=>(await on(),e().POST(`/api/files/file_details`,{body:t}).then(Zf)),openTutorial:t=>e().POST(`/api/home/tutorial/open`,{body:t}).then(Zf),getRecentFiles:()=>e().POST(`/api/home/recent_files`).then(Zf),getWorkspaceFiles:t=>e().POST(`/api/home/workspace_files`,{body:t}).then(Zf),getRunningNotebooks:()=>e().POST(`/api/home/running_notebooks`).then(Zf),shutdownSession:t=>e().POST(`/api/home/shutdown_session`,{body:t}).then(Zf),getExportAvailability:()=>e().GET(`/api/export/availability`).then(Zf),installExportRequirements:t=>e().POST(`/api/export/requirements/install`,{body:t,params:n()}).then(Zf),exportAsHTML:async t=>e().POST(`/api/export/html`,{body:t,parseAs:`text`,params:n()}).then(e=>Xf(e,{defaultFilename:qf(`html`)})),exportAsMarkdown:async t=>e().POST(`/api/export/markdown`,{body:t,parseAs:`text`,params:n()}).then(e=>Xf(e,{defaultFilename:Jf(t.flavor)})),exportAsScript:async t=>e().POST(`/api/export/script`,{body:t,parseAs:`text`,params:n()}).then(e=>Xf(e,{defaultFilename:qf(`script.py`)})),exportAsIPYNB:async t=>e().POST(`/api/export/ipynb`,{body:t,parseAs:`text`,params:n()}).then(e=>Xf(e,{defaultFilename:qf(`ipynb`)})),exportAsPDF:async t=>e().POST(`/api/export/pdf`,{body:t,parseAs:`blob`,params:n()}).then(e=>Xf(e,{defaultFilename:qf(`pdf`)})),autoExportAsHTML:async t=>e().POST(`/api/export/auto_export/html`,{body:t,params:n()}).then(Qf),autoExportAsMarkdown:async t=>e().POST(`/api/export/auto_export/markdown`,{body:t,params:n()}).then(Qf),autoExportAsIPYNB:async t=>e().POST(`/api/export/auto_export/ipynb`,{body:t,params:n()}).then(Qf),updateCellOutputs:async t=>e().POST(`/api/export/update_cell_outputs`,{body:t,params:n()}).then(Qf),addPackage:t=>e().POST(`/api/packages/add`,{body:t}).then(Zf),removePackage:t=>e().POST(`/api/packages/remove`,{body:t}).then(Zf),getPackageList:async()=>(await en(),e().GET(`/api/packages/list`).then(Zf)),getDependencyTree:async()=>(await en(),e().GET(`/api/packages/tree`).then(Zf)),listSecretKeys:async t=>(await on(),e().POST(`/api/secrets/keys`,{body:t,params:n()}).then(Qf)),writeSecret:async t=>e().POST(`/api/secrets/create`,{body:t,params:n()}).then(Qf),invokeAiTool:async t=>e().POST(`/api/ai/invoke_tool`,{body:t,params:n()}).then(Zf),clearCache:async()=>e().POST(`/api/cache/clear`,{body:{},params:n()}).then(Qf),getCacheInfo:async()=>e().POST(`/api/cache/info`,{body:{},params:n()}).then(Qf),listStorageEntries:t=>e().POST(`/api/storage/list_entries`,{body:t,params:n()}).then(Qf),downloadStorage:t=>e().POST(`/api/storage/download`,{body:t,params:n()}).then(Qf)}}var ep=`static-notebook`;function tp(){No({id:ep,once:!0,title:`Static notebook`,description:`This notebook is not connected to a kernel. Any interactive elements will not work.`})}function np(){let e=()=>{throw Error(`Unreachable. Expected to be in run mode`)};return{sendComponentValues:async()=>(tp(),U.log(`Updating UI elements is not supported in static mode`),null),sendModelValue:async()=>(U.log(`Updating model values is not supported in static mode`),null),sendInstantiate:async()=>(U.log(`Viewing as static notebook`),null),sendFunctionRequest:async()=>(tp(),U.log(`Function requests are not supported in static mode`),null),sendRestart:e,sendDocumentTransaction:e,sendRun:e,sendRunScratchpad:e,sendRename:e,sendSave:e,sendCopy:e,sendInterrupt:e,sendShutdown:e,sendFormat:e,sendDeleteCell:e,sendCodeCompletionRequest:e,saveUserConfig:e,saveAppConfig:e,saveCellConfig:e,sendStdin:e,readCode:e,readSnippets:e,previewDatasetColumn:e,previewSQLTable:e,previewSQLTableList:e,previewSQLSchemaList:e,previewDataSourceConnection:e,discoverDataSources:e,validateSQL:e,openFile:e,getUsageStats:e,getEnvironmentInfo:e,sendListFiles:e,sendSearchFiles:e,sendPdb:e,sendSetBreakpoints:e,sendCreateFileOrFolder:e,sendDeleteFileOrFolder:e,sendCopyFileOrFolder:e,sendRenameFileOrFolder:e,sendUpdateFile:e,sendFileDetails:e,openTutorial:e,sendInstallMissingPackages:e,getRecentFiles:e,getWorkspaceFiles:e,getRunningNotebooks:e,shutdownSession:e,getExportAvailability:e,installExportRequirements:e,exportAsHTML:e,exportAsIPYNB:e,exportAsMarkdown:e,exportAsScript:e,exportAsPDF:e,autoExportAsHTML:e,autoExportAsMarkdown:e,autoExportAsIPYNB:e,updateCellOutputs:e,addPackage:e,removePackage:e,getPackageList:e,getDependencyTree:e,listSecretKeys:e,writeSecret:e,invokeAiTool:e,clearCache:e,getCacheInfo:e,listStorageEntries:e,downloadStorage:e}}function rp(e){let t={sendComponentValues:`Failed update value`,sendModelValue:`Failed to update model value`,sendInstantiate:`Failed to instantiate`,sendFunctionRequest:`Failed to send function request`,sendRestart:`Failed to restart`,sendDocumentTransaction:`Failed to sync document transaction`,sendRun:`Failed to run`,sendRunScratchpad:`Failed to run scratchpad`,sendRename:`Failed to rename`,sendSave:`Failed to save`,sendCopy:`Failed to copy`,sendInterrupt:`Failed to interrupt`,sendShutdown:`Failed to shutdown`,sendFormat:`Failed to format`,sendDeleteCell:`Failed to delete cell`,sendCodeCompletionRequest:`Failed to complete code`,saveUserConfig:`Failed to save user config`,saveAppConfig:`Failed to save app config`,saveCellConfig:`Failed to save cell config`,sendStdin:`Failed to send stdin`,readCode:`Failed to read code`,readSnippets:`Failed to fetch snippets`,previewDatasetColumn:`Failed to fetch data sources`,previewSQLTable:`Failed to fetch SQL table`,previewSQLTableList:`Failed to fetch SQL table list`,previewSQLSchemaList:`Failed to fetch SQL schema list`,previewDataSourceConnection:`Failed to preview data source connection`,discoverDataSources:`Failed to discover data sources`,validateSQL:`Failed to validate SQL`,openFile:`Failed to open file`,getUsageStats:``,getEnvironmentInfo:``,sendListFiles:`Failed to list files`,sendSearchFiles:`Failed to search files`,sendPdb:`Failed to start debug session`,sendSetBreakpoints:``,sendCreateFileOrFolder:`Failed to create file or folder`,sendDeleteFileOrFolder:`Failed to delete file or folder`,sendCopyFileOrFolder:`Failed to duplicate file or folder`,sendRenameFileOrFolder:`Failed to rename file or folder`,sendUpdateFile:`Failed to update file`,sendFileDetails:`Failed to get file details`,openTutorial:`Failed to open tutorial`,sendInstallMissingPackages:`Failed to install missing packages`,getRecentFiles:`Failed to get recent files`,getWorkspaceFiles:`Failed to get workspace files`,getRunningNotebooks:`Failed to get running notebooks`,shutdownSession:`Failed to shutdown session`,getExportAvailability:``,installExportRequirements:`Failed to install export requirements`,exportAsHTML:`Failed to export HTML`,exportAsIPYNB:`Failed to export ipynb`,exportAsMarkdown:`Failed to export Markdown`,exportAsScript:`Failed to export Script`,exportAsPDF:`Failed to export PDF`,autoExportAsHTML:``,autoExportAsMarkdown:``,autoExportAsIPYNB:``,updateCellOutputs:``,addPackage:`Failed to add package`,removePackage:`Failed to remove package`,getPackageList:`Failed to get package list`,getDependencyTree:`Failed to get dependency tree`,listSecretKeys:`Failed to fetch secrets`,writeSecret:`Failed to write secret`,invokeAiTool:`Failed to invoke AI tool`,clearCache:`Failed to clear cache`,getCacheInfo:``,listStorageEntries:`Failed to list storage entries`,downloadStorage:`Failed to download storage entry`},n={};for(let[r,i]of Object.entries(e)){let e=r;n[e]=async(...n)=>{try{return await i(...n)}catch(n){if(n instanceof ts){if(a.get(ln))return;let e=No({title:`Kernel Not Connected`,description:`You need to connect to a kernel to perform this action.`,variant:`default`,action:(0,K.jsx)(ip,{onConnect:()=>e.dismiss()})});throw U.error(`Failed to handle request: ${r}`,n),n}if(n instanceof rs&&n.status===403)throw U.warn(`Request refused, connection is read-only: ${r}`),n;let i=t[e],o=es(n);throw i&&No({title:i,description:o,variant:`danger`}),U.error(`Failed to handle request: ${r}`,n),n}}}return n}var ip=e=>{let t=(0,q.c)(9),{onConnect:n}=e,i=cn(),a=r(ln),o;t[0]!==i||t[1]!==n?(o=()=>{i(),setTimeout(()=>{n()},800)},t[0]=i,t[1]=n,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=a&&(0,K.jsx)(uo,{size:`small`,className:`mr-1`}),t[3]=a,t[4]=s);let c;return t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,K.jsxs)(Yi,{size:`xs`,onClick:o,disabled:a,children:[s,`Connect`]}),t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c};function ap(){let e;return e=an()?Mt.INSTANCE:dn()?np():Wf($f(),()=>fn()),rp(e)}var op=G.forwardRef((e,t)=>{let n=(0,q.c)(16),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,children:r,orientation:a,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a===`horizontal`&&`max-w-max flex-1 items-center justify-center`,c=a===`vertical`&&``,l;n[5]!==i||n[6]!==s||n[7]!==c?(l=W(s,c,`relative z-10`,i),n[5]=i,n[6]=s,n[7]=c,n[8]=l):l=n[8];let u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(mp,{}),n[9]=u):u=n[9];let d;return n[10]!==r||n[11]!==a||n[12]!==o||n[13]!==t||n[14]!==l?(d=(0,K.jsxs)(Nc,{ref:t,className:l,orientation:a,...o,children:[r,u]}),n[10]=r,n[11]=a,n[12]=o,n[13]=t,n[14]=l,n[15]=d):d=n[15],d});op.displayName=Nc.displayName;var sp=Dn(`group flex list-none gap-1`,{variants:{orientation:{horizontal:`flex items-center`,vertical:`flex flex-col`}},defaultVariants:{orientation:`horizontal`}}),cp=G.forwardRef((e,t)=>{let n=(0,q.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,orientation:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]!==r||n[5]!==i?(o=W(sp({orientation:i}),r),n[4]=r,n[5]=i,n[6]=o):o=n[6];let s;return n[7]!==a||n[8]!==t||n[9]!==o?(s=(0,K.jsx)(Pc,{ref:t,className:o,...a}),n[7]=a,n[8]=t,n[9]=o,n[10]=s):s=n[10],s});cp.displayName=Pc.displayName;var lp=Fc,up=Dn(`group inline-flex rounded-md bg-background px-4 py-2 text-lg font-medium text-(--slate-12) transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-active:bg-accent/50 data-[state=open]:bg-accent/50`,{variants:{orientation:{horizontal:`w-max items-center justify-center`,vertical:`w-full`}},defaultVariants:{orientation:`horizontal`}}),dp=G.forwardRef((e,t)=>{let n=(0,q.c)(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=W(up(),`group`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(cs,{className:`relative top-px ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180`,"aria-hidden":`true`}),n[6]=s):s=n[6];let c;return n[7]!==r||n[8]!==a||n[9]!==t||n[10]!==o?(c=(0,K.jsxs)(Ic,{ref:t,className:o,...a,children:[r,` `,s]}),n[7]=r,n[8]=a,n[9]=t,n[10]=o,n[11]=c):c=n[11],c});dp.displayName=Ic.displayName;var fp=G.forwardRef((e,t)=>{let n=(0,q.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=W(`left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto `,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,K.jsx)(zc,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});fp.displayName=zc.displayName;var pp=Lc,mp=G.forwardRef((e,t)=>{let n=(0,q.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=W(`absolute left-0 top-full flex justify-center`),n[3]=a):a=n[3];let o;n[4]===r?o=n[5]:(o=W(`origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-(--radix-navigation-menu-viewport-width)`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==t||n[8]!==o?(s=(0,K.jsx)(`div`,{className:a,children:(0,K.jsx)(Bc,{className:o,ref:t,...i})}),n[6]=i,n[7]=t,n[8]=o,n[9]=s):s=n[9],s});mp.displayName=Bc.displayName;var hp=G.forwardRef((e,t)=>{let n=(0,q.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=W(`top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(`div`,{className:`relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,K.jsx)(Rc,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});hp.displayName=Rc.displayName;var gp=e=>{let t=(0,q.c)(23),{item:n,preserveQueryParams:r,target:i}=e,a=G.useRef(null),[o,s]=G.useState(!1),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>s(e!==``),t[0]=c):c=t[0];let l;t[1]===n.label?l=t[2]:(l=$o({html:n.label}),t[1]=n.label,t[2]=l);let u;t[3]===l?u=t[4]:(u=(0,K.jsx)(dp,{ref:a,children:l}),t[3]=l,t[4]=u);let d;if(t[5]!==n.items||t[6]!==r||t[7]!==i){let e;t[9]!==r||t[10]!==i?(e=e=>(0,K.jsx)(Sp,{label:e.label,href:r(e.href),target:i(e.href),children:e.description&&$o({html:e.description})},e.label),t[9]=r,t[10]=i,t[11]=e):e=t[11],d=n.items.map(e),t[5]=n.items,t[6]=r,t[7]=i,t[8]=d}else d=t[8];let f;t[12]===d?f=t[13]:(f=(0,K.jsx)(fp,{className:`w-auto`,children:(0,K.jsx)(`ul`,{className:`grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px] `,children:d})}),t[12]=d,t[13]=f);let p;t[14]!==u||t[15]!==f?(p=(0,K.jsx)(cp,{children:(0,K.jsxs)(lp,{children:[u,f]})}),t[14]=u,t[15]=f,t[16]=p):p=t[16];let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(mp,{}),t[17]=m):m=t[17];let h;t[18]===o?h=t[19]:(h=(0,K.jsx)(yp,{anchorRef:a,open:o,children:m}),t[18]=o,t[19]=h);let g;return t[20]!==p||t[21]!==h?(g=(0,K.jsxs)(Nc,{className:`relative z-10 max-w-max flex-1 items-center justify-center`,orientation:`horizontal`,onValueChange:c,children:[p,h]}),t[20]=p,t[21]=h,t[22]=g):g=t[22],g},_p=Ln(({container:e,children:t})=>(0,Ps.createPortal)(t,e??document.body)),vp=8,yp=e=>{let t=(0,q.c)(18),{anchorRef:n,open:r,children:i}=e,[a,o]=G.useState(null),s=G.useRef(null),c;t[0]===n?c=t[1]:(c=()=>{if(!n.current)return;let e=n.current.getBoundingClientRect(),t=s.current?.firstElementChild?.scrollWidth??0,r=window.innerWidth-t-vp;o({left:Math.max(vp,Math.min(e.left,r)),top:e.bottom})},t[0]=n,t[1]=c);let l=c,u,d;t[2]!==r||t[3]!==l?(u=()=>{if(l(),r){let e=requestAnimationFrame(l);return()=>cancelAnimationFrame(e)}},d=[r,l],t[2]=r,t[3]=l,t[4]=u,t[5]=d):(u=t[4],d=t[5]),G.useLayoutEffect(u,d);let f;t[6]!==n||t[7]!==l?(f={ref:n,onResize:l},t[6]=n,t[7]=l,t[8]=f):f=t[8],Ha(f);let p,m;if(t[9]===l?(p=t[10],m=t[11]):(p=()=>{if(!(typeof window>`u`))return window.addEventListener(`resize`,l),document.addEventListener(`scroll`,l,{capture:!0}),()=>{window.removeEventListener(`resize`,l),document.removeEventListener(`scroll`,l,{capture:!0})}},m=[l],t[9]=l,t[10]=p,t[11]=m),G.useEffect(p,m),!a||typeof document>`u`)return null;let h;t[12]!==a.left||t[13]!==a.top?(h={left:a.left,top:a.top},t[12]=a.left,t[13]=a.top,t[14]=h):h=t[14];let g;return t[15]!==i||t[16]!==h?(g=(0,K.jsx)(_p,{children:(0,K.jsx)(`div`,{ref:s,className:`fixed z-50`,style:h,children:i})}),t[15]=i,t[16]=h,t[17]=g):g=t[17],g},bp=class{tagName=`marimo-nav-menu`;menuItemValidator=R({label:z(),href:z(),description:z().nullish()});menuItemGroupValidator=R({label:z(),items:V(this.menuItemValidator)});validator=R({items:V(nt([this.menuItemValidator,this.menuItemGroupValidator])),orientation:gt([`horizontal`,`vertical`])});render(e){return(0,K.jsx)(xp,{...e.data})}},xp=e=>{let t=(0,q.c)(13),{items:n,orientation:r}=e,i=Cp,a=wp,o=Tp,s;t[0]===r?s=t[1]:(s=e=>`items`in e?r===`horizontal`?(0,K.jsx)(gp,{item:e,preserveQueryParams:o,target:a},e.label):(0,K.jsxs)(lp,{children:[(0,K.jsx)(`div`,{className:`inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-base font-medium text-muted-foreground/80 tracking-wide font-semibold`,children:$o({html:e.label})}),(0,K.jsx)(cp,{className:`ml-4 auto-collapse-nav`,orientation:r,children:e.items.map(e=>(0,K.jsx)(G.Fragment,{children:i((0,K.jsx)(pp,{href:o(e.href),target:a(e.href),className:up({orientation:r}),children:$o({html:e.label})},e.label),e.description)},e.label))})]},e.label):(0,K.jsx)(lp,{children:(0,K.jsx)(pp,{href:o(e.href),target:a(e.href),className:up({orientation:r}),children:$o({html:e.label})})},e.label),t[0]=r,t[1]=s);let c=s,l;if(t[2]!==n||t[3]!==c){let e;t[5]===c?e=t[6]:(e=e=>c(e),t[5]=c,t[6]=e),l=n.map(e),t[2]=n,t[3]=c,t[4]=l}else l=t[4];let u;t[7]!==r||t[8]!==l?(u=(0,K.jsx)(cp,{className:`auto-collapse-nav`,orientation:r,children:l}),t[7]=r,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==r||t[11]!==u?(d=(0,K.jsx)(op,{orientation:r,children:u}),t[10]=r,t[11]=u,t[12]=d):d=t[12],d},Sp=G.forwardRef((e,t)=>{let n=(0,q.c)(19),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,label:a,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s;n[5]===i?s=n[6]:(s=W(`block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-hidden transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground`,i),n[5]=i,n[6]=s);let c;n[7]===a?c=n[8]:(c=$o({html:a}),n[7]=a,n[8]=c);let l;n[9]===c?l=n[10]:(l=(0,K.jsx)(`div`,{className:`text-base font-medium leading-none`,children:c}),n[9]=c,n[10]=l);let u;n[11]===r?u=n[12]:(u=r&&(0,K.jsx)(`p`,{className:`line-clamp-2 text-sm leading-snug text-muted-foreground`,children:r}),n[11]=r,n[12]=u);let d;return n[13]!==o||n[14]!==t||n[15]!==s||n[16]!==l||n[17]!==u?(d=(0,K.jsx)(`li`,{children:(0,K.jsx)(pp,{asChild:!0,children:(0,K.jsxs)(`a`,{ref:t,className:s,...o,children:[l,u]})})}),n[13]=o,n[14]=t,n[15]=s,n[16]=l,n[17]=u,n[18]=d):d=n[18],d});Sp.displayName=`ListItem`;function Cp(e,t){return t?(0,K.jsx)(qi,{delayDuration:200,content:$o({html:t}),children:e}):e}function wp(e){return e.startsWith(`http`)?`_blank`:`_self`}function Tp(e){let t=new URL(globalThis.location.href);return Lo({href:e,queryParams:t.search,keys:[$t.filePath]})}function Ep(e,t){return e===t?!0:e==null||t==null?!1:Array.isArray(e)&&Array.isArray(t)?Qi(e,t):typeof e==`object`&&typeof t==`object`&&Dp(e,t)}function Dp(e,t){return Object.keys(e).length===Object.keys(t).length&&Vt.keys(e).every(n=>e[n]===t[n])}function Op(e,t){if(!window?.customElements){U.warn(`Custom elements not supported`);return}if(window.customElements.get(e)){U.warn(`Custom element ${e} already defined`);return}window.customElements.define(e,t)}function kp(e,t){if(!t)return[];let n=e;if(ui(t))return[{column_id:n,operator:t.operator,type:`condition`,negate:!1}];switch(t.type){case`number`:switch(t.operator){case`between`:return[{column_id:n,operator:`between`,value:{min:t.min,max:t.max},type:`condition`,negate:!1}];case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return[{column_id:n,operator:t.operator,value:t.value,type:`condition`,negate:!1}];case`in`:case`not_in`:return[{column_id:n,operator:t.operator,value:t.values,type:`condition`,negate:!1}];default:ia(t)}case`text`:switch(t.operator){case`contains`:case`equals`:case`does_not_equal`:case`regex`:case`starts_with`:case`ends_with`:return[{column_id:n,operator:t.operator,value:t.text,type:`condition`,negate:!1}];case`in`:case`not_in`:return[{column_id:n,operator:t.operator,value:t.values,type:`condition`,negate:!1}];case`is_empty`:return[{column_id:n,operator:`is_empty`,type:`condition`,negate:!1}];default:ia(t)}case`date`:case`datetime`:case`time`:{let e=t.type===`date`?Zo:t.type===`time`?Xo:Yo;switch(t.operator){case`between`:return[{column_id:n,operator:`between`,value:{min:e(t.min),max:e(t.max)},type:`condition`,negate:!1}];case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return[{column_id:n,operator:t.operator,value:e(t.value),type:`condition`,negate:!1}];default:ia(t)}}case`boolean`:return[{column_id:n,operator:t.operator,type:`condition`,negate:!1}];default:ia(t)}}function Ap(e){return{type:`group`,operator:`and`,children:e.flatMap(e=>kp(e.id,e.value)),negate:!1}}var jp=0,Mp=1,Np=2,Pp=4;function Fp(e){return()=>e}function Ip(e){e()}function Lp(e,t){return n=>e(t(n))}function Rp(e,t){return()=>e(t)}function zp(e,t){return n=>e(t,n)}function Bp(e){return e!==void 0}function Vp(...e){return()=>{e.map(Ip)}}function Hp(){}function Up(e,t){return t(e),e}function Wp(e,t){return t(e)}function Gp(...e){return e}function Kp(e,t){return e(Mp,t)}function qp(e,t){e(jp,t)}function Jp(e){e(Np)}function Yp(e){return e(Pp)}function J(e,t){return Kp(e,zp(t,jp))}function Xp(e,t){let n=e(Mp,e=>{n(),t(e)});return n}function Zp(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Qp(e,t){return e===t}function $p(e=Qp){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Y(e){return t=>n=>{e(n)&&t(n)}}function X(e){return t=>Lp(t,e)}function em(e){return t=>()=>{t(e)}}function Z(e,...t){let n=am(...t);return((t,r)=>{switch(t){case Np:Jp(e);return;case Mp:return Kp(e,n(r))}})}function tm(e,t){return n=>r=>{n(t=e(t,r))}}function nm(e){return t=>n=>{e>0?e--:t(n)}}function rm(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function im(...e){let t=Array(e.length),n=0,r=null,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;Kp(e,e=>{let s=n;n|=o,t[a]=e,s!==i&&n===i&&r&&(r(),r=null)})}),e=>a=>{let o=()=>{e([a].concat(t))};n===i?o():r=o}}function am(...e){return t=>e.reduceRight(Wp,t)}function om(e){let t,n,r=()=>t?.();return function(i,a){switch(i){case Mp:return a?n===a?void 0:(r(),n=a,t=Kp(e,a),t):(r(),Hp);case Np:r(),n=null;return}}}function Q(e){let t=e,n=cm();return((e,r)=>{switch(e){case jp:t=r;break;case Mp:r(t);break;case Pp:return t}return n(e,r)})}function sm(e,t){return Up(Q(t),t=>J(e,t))}function cm(){let e=[];return((t,n)=>{switch(t){case jp:e.slice().forEach(e=>{e(n)});return;case Np:e.splice(0,e.length);return;case Mp:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}})}function lm(e){return Up(cm(),t=>J(e,t))}function um(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:dm(),singleton:n}}var dm=()=>Symbol();function fm(e){let t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);let o=e(r.map(e=>n(e)));return a&&t.set(i,o),o};return n(e)}function pm(...e){let t=cm(),n=Array(e.length),r=0,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;Kp(e,e=>{n[a]=e,r|=o,r===i&&qp(t,n)})}),function(e,a){switch(e){case Np:Jp(t);return;case Mp:return r===i&&a(n),Kp(t,a)}}}function $(e,t=Qp){return Z(e,$p(t))}function mm(...e){return function(t,n){switch(t){case Np:return;case Mp:return Vp(...e.map(e=>Kp(e,n)))}}}var hm=(e=>(e[e.DEBUG=0]=`DEBUG`,e[e.INFO=1]=`INFO`,e[e.WARN=2]=`WARN`,e[e.ERROR=3]=`ERROR`,e))(hm||{}),gm={0:`debug`,3:`error`,1:`log`,2:`warn`},_m=()=>typeof globalThis>`u`?window:globalThis,vm=um(()=>{let e=Q(3);return{log:Q((t,n,r=1)=>{r>=(_m().VIRTUOSO_LOG_LEVEL??Yp(e))&&console[gm[r]](`%creact-virtuoso: %c%s %o`,`color: #0253b3; font-weight: bold`,`color: initial`,t,n)}),logLevel:e}},[],{singleton:!0});function ym(e,t,n){return bm(e,t,n).callbackRef}function bm(e,t,n){let r=G.useRef(null),i=e=>{},a=G.useMemo(()=>typeof ResizeObserver<`u`?new ResizeObserver(t=>{let r=()=>{let n=t[0].target;n.offsetParent!==null&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return i=e=>{e&&t?(a?.observe(e),r.current=e):(r.current&&a?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function xm(e,t,n,r,i,a,o,s,c){return bm(G.useCallback(n=>{let c=Sm(n.children,t,s?`offsetWidth`:`offsetHeight`,i),l=n.parentElement;for(;!l.dataset.virtuosoScroller;)l=l.parentElement;let u=l.lastElementChild.dataset.viewportType===`window`,d;u&&(d=l.ownerDocument.defaultView);let f=o?s?o.scrollLeft:o.scrollTop:u?s?d.scrollX||d.document.documentElement.scrollLeft:d.scrollY||d.document.documentElement.scrollTop:s?l.scrollLeft:l.scrollTop,p=o?s?o.scrollWidth:o.scrollHeight:u?s?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:s?l.scrollWidth:l.scrollHeight,m=o?s?o.offsetWidth:o.offsetHeight:u?s?d.innerWidth:d.innerHeight:s?l.offsetWidth:l.offsetHeight;r({scrollHeight:p,scrollTop:Math.max(f,0),viewportHeight:m}),a?.(s?Cm(`column-gap`,getComputedStyle(n).columnGap,i):Cm(`row-gap`,getComputedStyle(n).rowGap,i)),c!==null&&e(c)},[e,t,i,a,o,r,s]),n,c)}function Sm(e,t,n,r){let i=e.length;if(i===0)return null;let a=[];for(let o=0;o<i;o++){let i=e.item(o);if(i.dataset.index===void 0)continue;let s=parseInt(i.dataset.index),c=parseFloat(i.dataset.knownSize),l=t(i,n);if(l===0&&r(`Zero-sized element, this should not happen`,{child:i},hm.ERROR),l===c)continue;let u=a[a.length-1];a.length===0||u.size!==l||u.endIndex!==s-1?a.push({endIndex:s,size:l,startIndex:s}):a[a.length-1].endIndex++}return a}function Cm(e,t,n){return t!==`normal`&&!(t!=null&&t.endsWith(`px`))&&n(`${e} was not resolved to pixel value correctly`,t,hm.WARN),t===`normal`?0:parseInt(t??`0`,10)}function wm(e,t,n){let r=G.useRef(null),i=G.useCallback(n=>{if(!(n!=null&&n.offsetParent))return;let i=n.getBoundingClientRect(),a=i.width,s,c;if(t){let e=t.getBoundingClientRect(),n=i.top-e.top;c=e.height-Math.max(0,n),s=n+t.scrollTop}else{let e=o.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,i.top),s=i.top+e.scrollY}r.current={offsetTop:s,visibleHeight:c,visibleWidth:a},e(r.current)},[e,t]),{callbackRef:a,ref:o}=bm(i,!0,n),s=G.useCallback(()=>{i(o.current)},[i,o]);return G.useEffect(()=>{if(t){t.addEventListener(`scroll`,s);let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener(`scroll`,s),e.unobserve(t)}}{let e=o.current?.ownerDocument.defaultView;return e?.addEventListener(`scroll`,s),e?.addEventListener(`resize`,s),()=>{e?.removeEventListener(`scroll`,s),e?.removeEventListener(`resize`,s)}}},[s,t,o]),a}var Tm=um(()=>{let e=cm(),t=cm(),n=Q(0),r=cm(),i=Q(0),a=cm(),o=cm(),s=Q(0),c=Q(0),l=Q(0),u=Q(0),d=cm(),f=cm(),p=Q(!1),m=Q(!1),h=Q(!1);return J(Z(e,X(({scrollTop:e})=>e)),t),J(Z(e,X(({scrollHeight:e})=>e)),o),J(t,i),{deviation:n,fixedFooterHeight:l,fixedHeaderHeight:c,footerHeight:u,headerHeight:s,horizontalDirection:m,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:p,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:h,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),Em={lvl:0};function Dm(e,t){let n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]),a=[];for(let o=1;o<n;o++){let{index:n,value:s}=t(e[o]);a.push({end:n-1,start:r,value:i}),r=n,i=s}return a.push({end:1/0,start:r,value:i}),a}function Om(e){return e===Em}function km(e,t){if(!Om(e))return t===e.k?e.v:t<e.k?km(e.l,t):km(e.r,t)}function Am(e,t,n=`k`){if(Om(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let r=Am(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Am(e.l,t,n)}function jm(e,t,n){return Om(e)?Hm(t,n,1):t===e.k?Rm(e,{k:t,v:n}):t<e.k?Um(Rm(e,{l:jm(e.l,t,n)})):Um(Rm(e,{r:jm(e.r,t,n)}))}function Mm(){return Em}function Nm(e,t,n){if(Om(e))return[];let r=Am(e,t)[0];return Km(Im(e,r,n))}function Pm(e,t){if(Om(e))return Em;let{k:n,l:r,r:i}=e;if(t===n){if(Om(r))return i;if(Om(i))return r;{let[t,n]=Vm(r);return Lm(Rm(e,{k:t,l:zm(r),v:n}))}}return Lm(t<n?Rm(e,{l:Pm(r,t)}):Rm(e,{r:Pm(i,t)}))}function Fm(e){return Om(e)?[]:[...Fm(e.l),{k:e.k,v:e.v},...Fm(e.r)]}function Im(e,t,n){if(Om(e))return[];let{k:r,l:i,r:a,v:o}=e,s=[];return r>t&&(s=s.concat(Im(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Im(a,t,n))),s}function Lm(e){let{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(Bm(t))return Wm(Rm(e,{lvl:n-1}));if(!Om(t)&&!Om(t.r))return Rm(t.r,{l:Rm(t,{r:t.r.l}),lvl:n,r:Rm(e,{l:t.r.r,lvl:n-1})});throw Error(`Unexpected empty nodes`)}if(Bm(e))return Gm(Rm(e,{lvl:n-1}));if(!Om(r)&&!Om(r.l)){let t=r.l,i=Bm(t)?r.lvl-1:r.lvl;return Rm(t,{l:Rm(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:Gm(Rm(r,{l:t.r,lvl:i}))})}throw Error(`Unexpected empty nodes`)}function Rm(e,t){return Hm(t.k===void 0?e.k:t.k,t.v===void 0?e.v:t.v,t.lvl===void 0?e.lvl:t.lvl,t.l===void 0?e.l:t.l,t.r===void 0?e.r:t.r)}function zm(e){return Om(e.r)?e.l:Lm(Rm(e,{r:zm(e.r)}))}function Bm(e){return Om(e)||e.lvl>e.r.lvl}function Vm(e){return Om(e.r)?[e.k,e.v]:Vm(e.r)}function Hm(e,t,n,r=Em,i=Em){return{k:e,l:r,lvl:n,r:i,v:t}}function Um(e){return Gm(Wm(e))}function Wm(e){let{l:t}=e;return!Om(t)&&t.lvl===e.lvl?Rm(t,{r:Rm(e,{l:t.r})}):e}function Gm(e){let{lvl:t,r:n}=e;return!Om(n)&&!Om(n.r)&&n.lvl===t&&n.r.lvl===t?Rm(n,{l:Rm(e,{r:n.l}),lvl:t+1}):e}function Km(e){return Dm(e,({k:e,v:t})=>({index:e,value:t}))}function qm(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function Jm(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}var Ym=um(()=>({recalcInProgress:Q(!1)}),[],{singleton:!0});function Xm(e,t,n){return e[Zm(e,t,n)]}function Zm(e,t,n,r=0){let i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw Error(`Failed binary finding record in array - ${e.join(`,`)}, searched for ${t}`)}function Qm(e,t,n,r){let i=Zm(e,t,r),a=Zm(e,n,r,i);return e.slice(i,a+1)}function $m(e,t){return Math.round(e.getBoundingClientRect()[t])}function eh(e){return!Om(e.groupOffsetTree)}function th({index:e},t){return t===e?0:t<e?-1:1}function nh(){return{groupIndices:[],groupOffsetTree:Mm(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Mm()}}function rh(e,t){let n=Om(e)?0:1/0;for(let r of t){let{endIndex:t,size:i,startIndex:a}=r;if(n=Math.min(n,a),Om(e)){e=jm(e,0,i);continue}let o=Nm(e,a-1,t+1);if(o.some(hh(r)))continue;let s=!1,c=!1;for(let{end:n,start:r,value:a}of o)s?(t>=r||i===a)&&(e=Pm(e,r)):(c=a!==i,s=!0),n>t&&t>=r&&a!==i&&(e=jm(e,t+1,a));c&&(e=jm(e,a,i))}return[e,n]}function ih(e){return typeof e.groupIndex<`u`}function ah({offset:e},t){return t===e?0:t<e?-1:1}function oh(e,t,n){if(t.length===0)return 0;let{index:r,offset:i,size:a}=Xm(t,e,th),o=e-r,s=a*o+(o-1)*n+i;return s>0?s+n:s}function sh(e,t){if(!eh(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function ch(e,t,n){if(ih(e))return t.groupIndices[e.groupIndex]+1;{let r=sh(e.index===`LAST`?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function lh(e,t,n,r=0){return r>0&&(t=Math.max(t,Xm(e,r,th).offset)),Dm(Qm(e,t,n,ah),mh)}function uh(e,[t,n,r,i]){t.length>0&&r(`received item sizes`,t,hm.DEBUG);let a=e.sizeTree,o=a,s=0;if(n.length>0&&Om(a)&&t.length===2){let e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>jm(jm(t,n,e),n+1,r),o)}else[o,s]=rh(o,t);if(o===a)return e;let{lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d}=ph(e.offsetTree,s,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>jm(e,t,oh(t,d,i)),Mm()),lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d,sizeTree:o}}function dh(e){return Fm(e).map(({k:e,v:t},n,r)=>{let i=r[n+1];return{endIndex:i?i.k-1:1/0,size:t,startIndex:e}})}function fh(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function ph(e,t,n,r){let i=e,a=0,o=0,s=0,c=0;if(t!==0){c=Zm(i,t-1,th),s=i[c].offset;let e=Am(n,t-1);a=e[0],o=e[1],i.length&&i[c].size===Am(n,t)[1]&&--c,i=i.slice(0,c+1)}else i=[];for(let{start:e,value:c}of Nm(n,t,1/0)){let t=e-a,n=t*o+s+t*r;i.push({index:e,offset:n,size:c}),a=e,s=n,o=c}return{lastIndex:a,lastOffset:s,lastSize:o,offsetTree:i}}function mh(e){return{index:e.index,value:e}}function hh(e){let{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}var gh={offsetHeight:`height`,offsetWidth:`width`},_h=um(([{log:e},{recalcInProgress:t}])=>{let n=cm(),r=cm(),i=sm(r,0),a=cm(),o=cm(),s=Q(0),c=Q([]),l=Q(void 0),u=Q(void 0),d=Q(void 0),f=Q(void 0),p=Q((e,t)=>$m(e,gh[t])),m=Q(void 0),h=Q(0),g=nh(),_=sm(Z(n,im(c,e,h),tm(uh,g),$p()),g),v=sm(Z(c,$p(),tm((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),X(({prev:e})=>e)),[]);J(Z(c,Y(e=>e.length>0),im(_,h),X(([e,t,n])=>{let r=e.reduce((e,r,i)=>jm(e,r,oh(r,t.offsetTree,n)||i),Mm());return{...t,groupIndices:e,groupOffsetTree:r}})),_),J(Z(r,im(_),Y(([e,{lastIndex:t}])=>e<t),X(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),J(l,u);let y=sm(Z(l,X(e=>e===void 0)),!0);J(Z(u,Y(e=>e!==void 0&&Om(Yp(_).sizeTree)),X(e=>{let t=Yp(d),n=Yp(c).length>0;return t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),J(Z(f,Y(e=>e!==void 0&&e.length>0&&Om(Yp(_).sizeTree)),X(e=>{let t=[],n=e[0],r=0;for(let i=1;i<e.length;i++){let a=e[i];a!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=a,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),J(Z(c,im(d,u),Y(([,e,t])=>e!==void 0&&t!==void 0),X(([e,t,n])=>{let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i+1];r.push({startIndex:a,endIndex:a,size:t}),o!==void 0&&r.push({startIndex:a+1,endIndex:o-1,size:n})}return r})),n);let b=lm(Z(n,im(_),tm(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:g}),X(e=>e.changed)));Kp(Z(s,tm((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),X(e=>e.diff)),e=>{let{groupIndices:n}=Yp(_);if(e>0)qp(t,!0),qp(a,e+fh(e,n));else if(e<0){let t=Yp(v);t.length>0&&(e-=fh(-e,t)),qp(o,e)}}),Kp(Z(s,im(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},hm.ERROR)});let x=lm(a);J(Z(a,im(_),X(([e,t])=>{let n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){let n=km(t.sizeTree,0),a=0,o=0;for(;a<e;){let e=t.groupIndices[o],s=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+s-1,size:i,startIndex:e+1}),o++,a+=s+1}let s=Fm(t.sizeTree);return a!==e&&s.shift(),s.reduce((t,{k:n,v:r})=>{let i=t.ranges;return t.prevSize!==0&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return Fm(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);let S=lm(Z(o,im(_,h),X(([e,{offsetTree:t},n])=>oh(-e,t,n))));return J(Z(o,im(_,h),X(([e,t,n])=>{if(t.groupIndices.length>0){if(Om(t.sizeTree))return t;let r=Mm(),i=Yp(v),a=0,o=0,s=0;for(;a<-e;){s=i[o];let e=i[o+1]-s-1;o++,a+=e+1}if(r=Fm(t.sizeTree).reduce((t,{k:n,v:r})=>jm(t,Math.max(0,n+e),r),r),a!==-e){let n=km(t.sizeTree,s);r=jm(r,0,n);let i=Am(t.sizeTree,-e+1)[1];r=jm(r,1,i)}return{...t,sizeTree:r,...ph(t.offsetTree,0,r,n)}}{let r=Fm(t.sizeTree).reduce((t,{k:n,v:r})=>jm(t,Math.max(0,n+e),r),Mm());return{...t,sizeTree:r,...ph(t.offsetTree,0,r,n)}}})),_),{beforeUnshiftWith:x,data:m,defaultItemSize:u,firstItemIndex:s,fixedItemSize:l,fixedGroupSize:d,gap:h,groupIndices:c,heightEstimates:f,itemSize:p,listRefresh:b,shiftWith:o,shiftWithOffset:S,sizeRanges:n,sizes:_,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:a}},Gp(vm,Ym),{singleton:!0});function vh(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}var yh=um(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{let a=cm(),o=cm(),s=lm(Z(a,X(vh)));return J(Z(s,X(e=>e.totalCount)),n),J(Z(s,X(e=>e.groupIndices)),e),J(Z(pm(i,t,r),Y(([e,t])=>eh(t)),X(([e,t,n])=>Am(t.groupOffsetTree,Math.max(e-n,0),`v`)[0]),$p(),X(e=>[e])),o),{groupCounts:a,topItemsIndexes:o}},Gp(_h,Tm)),bh=um(([{log:e}])=>{let t=Q(!1),n=lm(Z(t,Y(e=>e),$p()));return Kp(t,t=>{t&&Yp(e)(`props updated`,{},hm.DEBUG)}),{didMount:n,propsReady:t}},Gp(vm),{singleton:!0}),xh=typeof document<`u`&&`scrollBehavior`in document.documentElement.style;function Sh(e){let t=typeof e==`number`?{index:e}:e;return t.align||=`start`,(!t.behavior||!xh)&&(t.behavior=`auto`),t.offset||=0,t}var Ch=um(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:s,scrollingInProgress:c,scrollTo:l,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{let p=cm(),m=cm(),h=Q(0),g=null,_=null,v=null;function y(){g&&=(g(),null),v&&=(v(),null),_&&=(clearTimeout(_),null),qp(c,!1)}return J(Z(p,im(n,d,r,h,s,o,f),im(e,a,i),X(([[e,n,r,i,a,o,s,l],d,f,h])=>{let b=Sh(e),{align:x,behavior:S,offset:C}=b,w=i-1,T=ch(b,n,w),E=oh(T,n.offsetTree,d)+o;x===`end`?(E+=f+Am(n.sizeTree,T)[1]-r+h,T===w&&(E+=s)):x===`center`?E+=(f+Am(n.sizeTree,T)[1]-r+h)/2:E-=a,C&&(E+=C);let D=t=>{y(),t?(l(`retrying to scroll to`,{location:e},hm.DEBUG),qp(p,e)):(qp(m,!0),l(`list did not change, scroll successful`,{},hm.DEBUG))};if(y(),S===`smooth`){let e=!1;v=Kp(t,t=>{e||=t}),g=Xp(u,()=>{D(e)})}else g=Xp(Z(t,wh(150)),D);return _=setTimeout(()=>{y()},1200),qp(c,!0),l(`scrolling from index to`,{behavior:S,index:T,top:E},hm.DEBUG),{behavior:S,top:E}})),l),{scrollTargetReached:m,scrollToIndex:p,topListHeight:h}},Gp(_h,Tm,vm),{singleton:!0});function wh(e){return t=>{let n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}function Th(e,t){e==0?t():requestAnimationFrame(()=>{Th(e-1,t)})}function Eh(e,t){let n=t-1;return typeof e==`number`?e:e.index===`LAST`?n:e.index}var Dh=um(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{let s=Q(!0),c=Q(0),l=Q(!0);return J(Z(o,im(c),Y(([e,t])=>!!t),em(!1)),s),J(Z(o,im(c),Y(([e,t])=>!!t),em(!1)),l),Kp(Z(pm(t,o),im(s,n,e,l),Y(([[,e],t,{sizeTree:n},r,i])=>e&&(!Om(n)||Bp(r))&&!t&&!i),im(c)),([,e])=>{Xp(i,()=>{qp(l,!0)}),Th(4,()=>{Xp(r,()=>{qp(s,!0)}),qp(a,e)})}),{initialItemFinalLocationReached:l,initialTopMostItemIndex:c,scrolledToInitialItem:s}},Gp(_h,Tm,Ch,bh),{singleton:!0});function Oh(e,t){return Math.abs(e-t)<1.01}var kh=`up`,Ah=`down`,jh=`none`,Mh={atBottom:!1,notAtBottomBecause:`NOT_SHOWING_LAST_ITEM`,state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Nh=0,Ph=um(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{let o=Q(!1),s=Q(!0),c=cm(),l=cm(),u=Q(4),d=Q(Nh),f=sm(Z(mm(Z($(i),nm(1),em(!0)),Z($(i),nm(1),em(!1),Zp(100))),$p()),!1),p=sm(Z(mm(Z(n,em(!0)),Z(n,em(!1),Zp(200))),$p()),!1);J(Z(pm($(i),$(d)),X(([e,t])=>e<=t),$p()),s),J(Z(s,rm(50)),l);let m=lm(Z(pm(r,$(a),$(t),$(e),$(u)),tm((e,[{scrollHeight:t,scrollTop:n},r,i,a,o])=>{let s=n+r-t>-o,c={scrollHeight:t,scrollTop:n,viewportHeight:r};if(s){let t,r;return n>e.state.scrollTop?(t=`SCROLLED_DOWN`,r=e.state.scrollTop-n):(t=`SIZE_DECREASED`,r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:c}}let l;return l=c.scrollHeight>e.state.scrollHeight?`SIZE_INCREASED`:r<e.state.viewportHeight?`VIEWPORT_HEIGHT_DECREASING`:n<e.state.scrollTop?`SCROLLING_UPWARDS`:`NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM`,{atBottom:!1,notAtBottomBecause:l,state:c}},Mh),$p((e,t)=>e&&e.atBottom===t.atBottom))),h=sm(Z(r,tm((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(Oh(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{let i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Y(e=>e.changed),X(e=>e.jump)),0);J(Z(m,X(e=>e.atBottom)),o),J(Z(o,rm(50)),c);let g=Q(Ah);J(Z(r,X(({scrollTop:e})=>e),$p(),tm((e,t)=>Yp(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?kh:Ah,prevScrollTop:t},{direction:Ah,prevScrollTop:0}),X(e=>e.direction)),g),J(Z(r,rm(50),em(jh)),g);let _=Q(0);return J(Z(f,Y(e=>!e),em(0)),_),J(Z(i,rm(100),im(f),Y(([e,t])=>t),tm(([e,t],[n])=>[t,n],[0,0]),X(([e,t])=>t-e)),_),{atBottomState:m,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:l,atTopThreshold:d,isAtBottom:o,isAtTop:s,isScrolling:f,lastJumpDueToItemResize:h,scrollDirection:g,scrollVelocity:_}},Gp(Tm)),Fh=`top`,Ih=`bottom`,Lh=`none`;function Rh(e,t,n){return typeof e==`number`?n===kh&&t===Fh||n===Ah&&t===Ih?e:0:n===kh?t===Fh?e.main:e.reverse:t===Ih?e.main:e.reverse}function zh(e,t){return typeof e==`number`?e:e[t]??0}var Bh=um(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{let a=cm(),o=Q(0),s=Q(0),c=Q(0);return{increaseViewportBy:s,listBoundary:a,overscan:c,topListHeight:o,visibleRange:sm(Z(pm($(r),$(i),$(n),$(a,Jm),$(c),$(o),$(t),$(e),$(s)),X(([e,t,n,[r,i],a,o,s,c,l])=>{let u=e-c,d=o+s,f=Math.max(n-u,0),p=Lh,m=zh(l,Fh),h=zh(l,Ih);return r-=c,r+=n+s,i+=n+s,i-=c,r>e+d-m&&(p=kh),i<e-f+t+h&&(p=Ah),p===Lh?null:[Math.max(u-n-Rh(a,Fh,p)-m,0),u-f-s+t+Rh(a,Ih,p)+h]}),Y(e=>e!=null),$p(Jm)),[0,0])}},Gp(Tm),{singleton:!0});function Vh(e,t,n){if(eh(t)){let r=sh(e,t);return[{index:Am(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}var Hh={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Uh(e,t,n,r,i,a){let{lastIndex:o,lastOffset:s,lastSize:c}=i,l=0,u=0;if(e.length>0){l=e[0].offset;let t=e[e.length-1];u=t.offset+t.size}let d=n-o,f=s+d*c+(d-1)*r,p=l,m=f-u;return{bottom:u,firstItemIndex:a,items:Gh(e,i,a),offsetBottom:m,offsetTop:l,top:p,topItems:Gh(t,i,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function Wh(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-o>=e)break;o++}let s=e+o,c=Eh(t,s);return Uh(Array.from({length:s}).map((e,t)=>({data:a[t+c],index:t+c,offset:0,size:0})),[],s,i,n,r)}function Gh(e,t,n){if(e.length===0)return[];if(!eh(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let r=e[0].index,i=e[e.length-1].index,a=[],o=Nm(t.groupOffsetTree,r,i),s,c=0;for(let r of e){(!s||s.end<r.index)&&(s=o.shift(),c=t.groupIndices.indexOf(s.start));let e;e=r.index===s.start?{index:c,type:`group`}:{groupIndex:c,index:r.index-(c+1)+n},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function Kh(e,t){return e===void 0?0:typeof e==`number`?e:e[t]??0}var qh=um(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:s,visibleRange:c},{initialTopMostItemIndex:l,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:p},{recalcInProgress:m}])=>{let h=Q([]),g=Q(0),_=cm(),v=Q(0);J(a.topItemsIndexes,h);let y=sm(Z(pm(p,m,$(c,Jm),$(i),$(r),$(l),u,$(h),$(t),$(n),$(v),e),Y(([e,t,,n,,,,,,,,r])=>{let i=r&&r.length!==n;return e&&!t&&!i}),X(([,,[e,t],n,r,i,a,o,s,c,l,u])=>{let d=r,{offsetTree:f,sizeTree:p}=d,m=Yp(g);if(n===0)return{...Hh,totalCount:n};if(e===0&&t===0)return m===0?{...Hh,totalCount:n}:Wh(m,i,r,s,c,u||[]);if(Om(p))return m>0?null:Uh(Vh(Eh(i,n),d,u),[],n,c,d,s);let h=[];if(o.length>0){let e=o[0],t=o[o.length-1],n=0;for(let r of Nm(p,e,t)){let i=r.value,a=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=a;e<=o;e++)h.push({data:u?.[e],index:e,offset:n,size:i}),n+=i}}if(!a)return Uh([],h,n,c,d,s);let _=o.length>0?o[o.length-1]+1:0,v=lh(f,e,t,_);if(v.length===0)return null;let y=n-1,b=Up([],n=>{for(let r of v){let i=r.value,a=i.offset,o=r.start,s=i.size;if(i.offset<e){o+=Math.floor((e-i.offset+c)/(s+c));let t=o-r.start;a+=t*s+t*c}o<_&&(a+=(_-o)*s,o=_);let l=Math.min(r.end,y);for(let e=o;e<=l&&!(a>=t);e++)n.push({data:u?.[e],index:e,offset:a,size:s}),a+=s+c}}),x=Kh(l,Fh),S=Kh(l,Ih);if(b.length>0&&(x>0||S>0)){let e=b[0],t=b[b.length-1];if(x>0&&e.index>_){let t=Math.min(x,e.index-_),n=[],r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){let t=Nm(p,i,i)[0]?.value??e.size;r-=t+c,n.unshift({data:u?.[i],index:i,offset:r,size:t})}b.unshift(...n)}if(S>0&&t.index<y){let e=Math.min(S,y-t.index),n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){let e=Nm(p,r,r)[0]?.value??t.size;b.push({data:u?.[r],index:r,offset:n,size:e}),n+=e+c}}}return Uh(b,h,n,c,d,s)}),Y(e=>e!==null),$p()),Hh);J(Z(e,Y(Bp),X(e=>e?.length)),i),J(Z(y,X(e=>e.topListHeight)),d),J(d,s),J(Z(y,X(e=>[e.top,e.bottom])),o),J(Z(y,X(e=>e.items)),_);let b=lm(Z(y,Y(({items:e})=>e.length>0),im(i,e),Y(([{items:e},t])=>e[e.length-1].originalIndex===t-1),X(([,e,t])=>[e-1,t]),$p(Jm),X(([e])=>e))),x=lm(Z(y,rm(200),Y(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),X(({items:e})=>e[0].index),$p()));return{endReached:b,initialItemCount:g,itemsRendered:_,listState:y,minOverscanItemCount:v,rangeChanged:lm(Z(y,Y(({items:e})=>e.length>0),X(({items:e})=>{let t=0,n=e.length-1;for(;e[t].type===`group`&&t<n;)t++;for(;e[n].type===`group`&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),$p(qm))),startReached:x,topItemsIndexes:h,...f}},Gp(_h,yh,Bh,Dh,Ch,Ph,bh,Ym),{singleton:!0}),Jh=um(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{let a=cm(),o=sm(Z(pm(n,e,r,t,i),X(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return J($(o),a),{totalListHeight:o,totalListHeightChanged:a}},Gp(Tm,qh),{singleton:!0}),Yh=um(([{viewportHeight:e},{totalListHeight:t}])=>{let n=Q(!1);return{alignToBottom:n,paddingTopAddition:sm(Z(pm(n,e,t),Y(([e])=>e),X(([,e,t])=>Math.max(0,e-t)),rm(0),$p()),0)}},Gp(Tm,Jh),{singleton:!0}),Xh=um(()=>({context:Q(null)})),Zh=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??`start`,behavior:r}:e>a?{...i,align:n??`end`,behavior:r}:null,Qh=um(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:s,viewportHeight:c},{scrollToIndex:l}])=>{let u=cm();return J(Z(u,im(t,c,n,a,i,r,s),im(e),X(([[e,t,n,r,i,a,s,c],l])=>{let{align:u,behavior:d,calculateViewLocation:f=Zh,done:p,...m}=e,h=ch(e,t,r-1),g=oh(h,t.offsetTree,l)+i+a,_=g+Am(t.sizeTree,h)[1],v=c+a,y=c+n-s,b=f({itemBottom:_,itemTop:g,locationParams:{align:u,behavior:d,...m},viewportBottom:y,viewportTop:v});return b?p&&Xp(Z(o,Y(e=>!e),nm(Yp(o)?1:2)),p):p?.(),b}),Y(e=>e!==null)),l),{scrollIntoView:u}},Gp(_h,Tm,Ch,qh,vm),{singleton:!0});function $h(e){return e?e===`smooth`?`smooth`:`auto`:!1}var eg=(e,t)=>typeof e==`function`?$h(e(t)):t&&$h(e),tg=um(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:s},{didMount:c,propsReady:l},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:p}])=>{let m=Q(!1),h=cm(),g=null;function _(e){qp(o,{align:`end`,behavior:e,index:`LAST`})}Kp(Z(pm(Z($(t),nm(1)),c),im($(m),a,s,d),X(([[e,t],n,r,i,a])=>{let o=t&&i,s=`auto`;return o&&(s=eg(n,r||a),o&&=!!s),{followOutputBehavior:s,shouldFollow:o,totalCount:e}}),Y(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{g&&=(g(),null),Yp(n)?requestAnimationFrame(()=>{Yp(u)(`following output to `,{totalCount:r},hm.DEBUG),_(t)}):g=Xp(e,()=>{Yp(u)(`following output to `,{totalCount:r},hm.DEBUG),_(t),g=null})});function v(e){let t=Xp(i,t=>{e&&!t.atBottom&&t.notAtBottomBecause===`SIZE_INCREASED`&&!g&&(Yp(u)(`scrolling to bottom due to increased size`,{},hm.DEBUG),_(`auto`))});setTimeout(t,100)}Kp(Z(pm($(m),t,l),Y(([e,,t])=>e&&t),tm(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),Y(({refreshed:e})=>e),im(m,t)),([,e])=>{Yp(s)&&v(e!==!1)}),Kp(h,()=>{v(Yp(m)!==!1)}),Kp(pm($(m),i),([e,t])=>{e&&!t.atBottom&&t.notAtBottomBecause===`VIEWPORT_HEIGHT_DECREASING`&&_(`auto`)});let y=Q(null),b=cm();return J(mm(Z($(r),X(e=>e?.length??0)),Z($(t))),b),Kp(Z(pm(Z(b,nm(1)),c),im($(y),s,d,f),X(([[e,t],n,r,i,a])=>t&&r&&n?.({context:a,totalCount:e,scrollingInProgress:i})),Y(e=>!!e),rm(0)),t=>{g&&=(g(),null),Yp(n)?requestAnimationFrame(()=>{Yp(u)(`scrolling into view`,{}),qp(p,t)}):g=Xp(e,()=>{Yp(u)(`scrolling into view`,{}),qp(p,t),g=null})}),{autoscrollToBottom:h,followOutput:m,scrollIntoViewOnChange:y}},Gp(_h,Ph,Ch,Dh,bh,vm,Tm,Xh,Qh)),ng=um(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(J(Z(s,im(a),Y(([,e])=>e!==0),im(i,r,t,n,e),X(([[,e],t,n,r,i,a=[]])=>Wh(e,t,n,r,i,a))),o),{}),Gp(_h,Dh,qh,bh),{singleton:!0}),rg=um(([{didMount:e},{scrollTo:t},{listState:n}])=>{let r=Q(0);return Kp(Z(e,im(r),Y(([,e])=>e!==0),X(([,e])=>({top:e}))),e=>{Xp(Z(n,nm(1),Y(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{qp(t,e)})})}),{initialScrollTop:r}},Gp(bh,Tm,qh),{singleton:!0}),ig=um(([{scrollVelocity:e}])=>{let t=Q(!1),n=cm(),r=Q(!1);return J(Z(e,im(r,t,n),Y(([e,t])=>!!t),X(([e,t,n,r])=>{let{enter:i,exit:a}=t;if(n){if(a(e,r))return!1}else if(i(e,r))return!0;return n}),$p()),t),Kp(Z(pm(t,e,n),im(r)),([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},Gp(Ph),{singleton:!0}),ag=um(([{scrollContainerState:e,scrollTo:t}])=>{let n=cm(),r=cm(),i=cm(),a=Q(!1),o=Q(void 0);return J(Z(pm(n,r),X(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),J(Z(t,im(r),X(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Gp(Tm)),og=um(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:c}])=>{let l=cm(),u=Q(void 0),d=Q(null),f=Q(null);return J(s,d),J(c,f),Kp(Z(l,im(t,r,o,d,f,n)),([e,t,n,r,i,a,o])=>{let s=dh(t.sizeTree);r&&i!==null&&a!==null&&(n=i.scrollTop-a.offsetTop),n-=o,e({ranges:s,scrollTop:n})}),J(Z(u,Y(Bp),X(sg)),i),J(Z(a,im(u),Y(([,e])=>e!==void 0),$p(),X(([,e])=>e.ranges)),e),{getState:l,restoreStateFrom:u}},Gp(_h,Tm,Dh,bh,ag));function sg(e){return{align:`start`,index:0,offset:e.scrollTop}}var cg=um(([{topItemsIndexes:e}])=>{let t=Q(0);return J(Z(t,Y(e=>e>=0),X(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},Gp(qh));function lg(e){let t=!1,n;return(()=>(t||(t=!0,n=e()),n))}var ug=lg(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),dg=um(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:a,groupIndices:o,heightEstimates:s,itemSize:c,sizeRanges:l,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:p},{initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g},_,v,y,b,{scrollToIndex:x},S,{topItemCount:C},{groupCounts:w},T])=>{let{listState:E,minOverscanItemCount:D,topItemsIndexes:O,rangeChanged:k,...A}=b;return J(k,T.scrollSeekRangeChanged),J(Z(T.windowViewportRect,X(e=>e.visibleHeight)),_.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:a,groupCounts:w,heightEstimates:s,initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g,sizeRanges:l,topItemCount:C,topItemsIndexes:O,totalCount:f,...y,groupIndices:o,itemSize:c,listState:E,minOverscanItemCount:D,scrollToIndex:x,statefulTotalCount:d,trackItemSizes:p,rangeChanged:k,...A,...T,..._,sizes:u,...v}},Gp(_h,Dh,Tm,og,tg,qh,Ch,um(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:s},{listState:c},{beforeUnshiftWith:l,gap:u,shiftWithOffset:d,sizes:f},{log:p},{recalcInProgress:m}])=>{let h=lm(Z(c,im(o),tm(([,e,t,n],[{bottom:r,items:i,offsetBottom:a,totalCount:o},s])=>{let c=r+a,l=0;return t===o&&e.length>0&&i.length>0&&(i[0].originalIndex===0&&e[0].originalIndex===0||(l=c-n,l!==0&&(l+=s))),[l,i,o,c]},[0,[],0,0]),Y(([e])=>e!==0),im(r,s,n,i,p,m),Y(([,e,t,n,,,r])=>!r&&!n&&e!==0&&t===kh),X(([[e],,,,,t])=>(t(`Upward scrolling compensation`,{amount:e},hm.DEBUG),e))));function g(n){n>0?(qp(t,{behavior:`auto`,top:-n}),qp(e,0)):(qp(e,0),qp(t,{behavior:`auto`,top:-n}))}return Kp(Z(h,im(e,a)),([t,n,r])=>{r&&ug()?qp(e,n-t):g(-t)}),Kp(Z(pm(sm(a,!1),e,m),Y(([e,t,n])=>!e&&!n&&t!==0),X(([e,t])=>t),rm(1)),g),J(Z(d,X(e=>({top:-e}))),t),Kp(Z(l,im(f,u),X(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function a(e){return e*(n+i)}if(t.length===0)return a(e);{let n=0,i=km(r,0),o=0,s=0;for(;o<e;){o++,n+=i;let r=t.length===s+1?1/0:t[s+1]-t[s]-1;o+r>e&&(n-=i,r=e-o+1),o+=r,n+=a(r),s++}return n}})),n=>{qp(e,n),requestAnimationFrame(()=>{qp(t,{top:n}),requestAnimationFrame(()=>{qp(e,0),qp(m,!1)})})}),{deviation:e}},Gp(Tm,Ph,qh,_h,vm,Ym)),cg,yh,um(([e,t,n,r,i,a,o,s,c,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...c,...l,...u}),Gp(Bh,ng,bh,ig,Jh,rg,Yh,ag,Qh,vm,Xh))));function fg(e,t){let n={},r={},i=0,a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(let e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}var pg=typeof document<`u`?G.useLayoutEffect:G.useEffect;function mg(e,t,n){let r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=G.createContext({});function c(e,n){e.propsReady&&qp(e.propsReady,!1);for(let i of r){let r=e[t.required[i]];qp(r,n[i])}for(let r of i)if(r in n){let i=e[t.optional[r]];qp(i,n[r])}e.propsReady&&qp(e.propsReady,!0)}function l(e){return a.reduce((n,r)=>(n[r]=n=>{let i=e[t.methods[r]];qp(i,n)},n),{})}function u(e){return o.reduce((n,r)=>(n[r]=om(e[t.events[r]]),n),{})}return{Component:G.forwardRef((t,a)=>{let{children:d,...f}=t,[p]=G.useState(()=>Up(fm(e),e=>{c(e,f)})),[m]=G.useState(Rp(u,p));pg(()=>{for(let e of o)e in f&&Kp(m[e],f[e]);return()=>{Object.values(m).map(Jp)}},[f,m,p]),pg(()=>{c(p,f)}),G.useImperativeHandle(a,Fp(l(p)));let h=n;return(0,K.jsx)(s.Provider,{value:p,children:n?(0,K.jsx)(h,{...fg([...r,...i,...o],f),children:d}):d})}),useEmitter:(e,t)=>{let n=G.useContext(s)[e];pg(()=>Kp(n,t),[t,n])},useEmitterValue:e=>{let t=G.useContext(s)[e],[n,r]=G.useState(Rp(Yp,t));return pg(()=>Kp(t,e=>{e!==n&&r(Fp(e))}),[t,n]),n},usePublisher:e=>{let t=G.useContext(s);return G.useCallback(n=>{qp(t[e],n)},[t,e])}}}var hg=G.createContext(void 0),gg=G.createContext(void 0),_g=typeof document<`u`?G.useLayoutEffect:G.useEffect;function vg(e){return`self`in e}function yg(e){return`body`in e}function bg(e,t,n,r=Hp,i,a){let o=G.useRef(null),s=G.useRef(null),c=G.useRef(null),l=G.useCallback(n=>{let r,i,o,l=n.target;if(yg(l)||vg(l)){let e=vg(l)?l:l.defaultView;o=a?e.scrollX:e.scrollY,r=a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a?e.innerWidth:e.innerHeight}else o=a?l.scrollLeft:l.scrollTop,r=a?l.scrollWidth:l.scrollHeight,i=a?l.offsetWidth:l.offsetHeight;let u=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync?u():Ps.flushSync(u),s.current!==null&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&=(clearTimeout(c.current),null))},[e,t,a]);G.useEffect(()=>{let e=i||o.current;return r(i||o.current),l({suppressFlushSync:!0,target:e}),e.addEventListener(`scroll`,l,{passive:!0}),()=>{r(null),e.removeEventListener(`scroll`,l)}},[o,l,n,r,i]);function u(n){let r=o.current;if(!r||(a?`offsetWidth`in r&&r.offsetWidth===0:`offsetHeight`in r&&r.offsetHeight===0))return;let i=n.behavior===`smooth`,l,u,d;vg(r)?(u=Math.max($m(r.document.documentElement,a?`width`:`height`),a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),l=a?r.innerWidth:r.innerHeight,d=a?window.scrollX:window.scrollY):(u=r[a?`scrollWidth`:`scrollHeight`],l=$m(r,a?`width`:`height`),d=r[a?`scrollLeft`:`scrollTop`]);let f=u-l;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),Oh(l,u)||n.top===d){e({scrollHeight:u,scrollTop:d,viewportHeight:l}),i&&t(!0);return}i?(s.current=n.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,a&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}function d(e){a&&(e={behavior:e.behavior,left:e.top}),o.current.scrollBy(e)}return{scrollByCallback:d,scrollerRef:o,scrollToCallback:u}}var xg=`-webkit-sticky`,Sg=`sticky`,Cg=lg(()=>{if(typeof document>`u`)return Sg;let e=document.createElement(`div`);return e.style.position=xg,e.style.position===xg?xg:Sg});function wg(e){return e}var Tg=um(([e,t])=>({...e,...t}),Gp(dg,um(()=>{let e=Q(e=>`Item ${e}`),t=Q(e=>`Group ${e}`),n=Q({}),r=Q(wg),i=Q(`div`),a=Q(Hp),o=(e,t=null)=>sm(Z(n,X(t=>t[e]),$p()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o(`EmptyPlaceholder`),FooterComponent:o(`Footer`),GroupComponent:o(`Group`,`div`),groupContent:t,HeaderComponent:o(`Header`),HeaderFooterTag:i,ItemComponent:o(`Item`,`div`),itemContent:e,ListComponent:o(`List`,`div`),ScrollerComponent:o(`Scroller`,`div`),scrollerRef:a,ScrollSeekPlaceholder:o(`ScrollSeekPlaceholder`),TopItemListComponent:o(`TopItemList`)}}))),Eg=({height:e})=>(0,K.jsx)(`div`,{style:{height:e}}),Dg={overflowAnchor:`none`,position:Cg(),zIndex:1},Og={overflowAnchor:`none`},kg={...Og,display:`inline-block`,height:`100%`},Ag=G.memo(function({showTopList:e=!1}){let t=Kg(`listState`),n=qg(`sizeRanges`),r=Kg(`useWindowScroll`),i=Kg(`customScrollParent`),a=qg(`windowScrollContainerState`),o=qg(`scrollContainerState`),s=i||r?a:o,c=Kg(`itemContent`),l=Kg(`context`),u=Kg(`groupContent`),d=Kg(`trackItemSizes`),f=Kg(`itemSize`),p=Kg(`log`),m=qg(`gap`),h=Kg(`horizontalDirection`),{callbackRef:g}=xm(n,f,d,e?Hp:s,p,m,i,h,Kg(`skipAnimationFrameInResizeObserver`)),[_,v]=G.useState(0);Gg(`deviation`,e=>{_!==e&&v(e)});let y=Kg(`EmptyPlaceholder`),b=Kg(`ScrollSeekPlaceholder`)||Eg,x=Kg(`ListComponent`),S=Kg(`ItemComponent`),C=Kg(`GroupComponent`),w=Kg(`computeItemKey`),T=Kg(`isSeeking`),E=Kg(`groupIndices`).length>0,D=Kg(`alignToBottom`),O=Kg(`initialItemFinalLocationReached`),k=e?{}:{boxSizing:`border-box`,...h?{display:`inline-block`,height:`100%`,marginLeft:_===0?D?`auto`:0:_,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:`nowrap`}:{marginTop:_===0?D?`auto`:0:_,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...O?{}:{visibility:`hidden`}};return!e&&t.totalCount===0&&y?(0,K.jsx)(y,{...Fg(y,l)}):(0,K.jsx)(x,{...Fg(x,l),"data-testid":e?`virtuoso-top-item-list`:`virtuoso-item-list`,ref:g,style:k,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,r=w(n+t.firstItemIndex,e.data,l);return T?(0,G.createElement)(b,{...Fg(b,l),height:e.size,index:e.index,key:r,type:e.type||`item`,...e.type===`group`?{}:{groupIndex:e.groupIndex}}):e.type===`group`?(0,G.createElement)(C,{...Fg(C,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:r,style:Dg},u(e.index,l)):(0,G.createElement)(S,{...Fg(S,l),...Ig(S,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:h?kg:Og},E?c(e.index,e.groupIndex,e.data,l):c(e.index,e.data,l))})})}),jg={height:`100%`,outline:`none`,overflowY:`auto`,position:`relative`,WebkitOverflowScrolling:`touch`},Mg={outline:`none`,overflowX:`auto`,position:`relative`},Ng=e=>({height:`100%`,position:`absolute`,top:0,width:`100%`,...e?{display:`flex`,flexDirection:`column`}:{}}),Pg={position:Cg(),top:0,width:`100%`,zIndex:1};function Fg(e,t){if(typeof e!=`string`)return{context:t}}function Ig(e,t){return{item:typeof e==`string`?void 0:t}}var Lg=G.memo(function(){let e=Kg(`HeaderComponent`),t=qg(`headerHeight`),n=Kg(`HeaderFooterTag`),r=ym(G.useMemo(()=>e=>{t($m(e,`height`))},[t]),!0,Kg(`skipAnimationFrameInResizeObserver`)),i=Kg(`context`);return e?(0,K.jsx)(n,{ref:r,children:(0,K.jsx)(e,{...Fg(e,i)})}):null}),Rg=G.memo(function(){let e=Kg(`FooterComponent`),t=qg(`footerHeight`),n=Kg(`HeaderFooterTag`),r=ym(G.useMemo(()=>e=>{t($m(e,`height`))},[t]),!0,Kg(`skipAnimationFrameInResizeObserver`)),i=Kg(`context`);return e?(0,K.jsx)(n,{ref:r,children:(0,K.jsx)(e,{...Fg(e,i)})}):null});function zg({useEmitter:e,useEmitterValue:t,usePublisher:n}){return G.memo(function({children:r,style:i,context:a,...o}){let s=n(`scrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`scrollerRef`),d=t(`horizontalDirection`)||!1,{scrollByCallback:f,scrollerRef:p,scrollToCallback:m}=bg(s,l,c,u,void 0,d);return e(`scrollTo`,m),e(`scrollBy`,f),(0,K.jsx)(c,{"data-testid":`virtuoso-scroller`,"data-virtuoso-scroller":!0,ref:p,style:{...d?Mg:jg,...i},tabIndex:0,...o,...Fg(c,a),children:r})})}function Bg({useEmitter:e,useEmitterValue:t,usePublisher:n}){return G.memo(function({children:r,style:i,context:a,...o}){let s=n(`windowScrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`totalListHeight`),d=t(`deviation`),f=t(`customScrollParent`),p=G.useRef(null),{scrollByCallback:m,scrollerRef:h,scrollToCallback:g}=bg(s,l,c,t(`scrollerRef`),f);return _g(()=>(h.current=f||p.current?.ownerDocument.defaultView,()=>{h.current=null}),[h,f]),e(`windowScrollTo`,g),e(`scrollBy`,m),(0,K.jsx)(c,{ref:p,"data-virtuoso-scroller":!0,style:{position:`relative`,...i,...u===0?{}:{height:u+d}},...o,...Fg(c,a),children:r})})}var Vg=({children:e})=>{let t=G.useContext(hg),n=qg(`viewportHeight`),r=qg(`fixedItemHeight`),i=Kg(`alignToBottom`),a=Kg(`horizontalDirection`),o=ym(G.useMemo(()=>Lp(n,e=>$m(e,a?`width`:`height`)),[n,a]),!0,Kg(`skipAnimationFrameInResizeObserver`));return G.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,K.jsx)(`div`,{"data-viewport-type":`element`,ref:o,style:Ng(i),children:e})},Hg=({children:e})=>{let t=G.useContext(hg),n=qg(`windowViewportRect`),r=qg(`fixedItemHeight`),i=wm(n,Kg(`customScrollParent`),Kg(`skipAnimationFrameInResizeObserver`)),a=Kg(`alignToBottom`);return G.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,K.jsx)(`div`,{"data-viewport-type":`window`,ref:i,style:Ng(a),children:e})},Ug=({children:e})=>{let t=Kg(`TopItemListComponent`)||`div`,n=Kg(`headerHeight`),r={...Pg,marginTop:`${n}px`},i=Kg(`context`);return(0,K.jsx)(t,{style:r,...Fg(t,i),children:e})},{Component:Wg,useEmitter:Gg,useEmitterValue:Kg,usePublisher:qg}=mg(Tg,{required:{},optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,scrollIntoViewOnChange:`scrollIntoViewOnChange`,itemContent:`itemContent`,groupContent:`groupContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,groupCounts:`groupCounts`,topItemCount:`topItemCount`,firstItemIndex:`firstItemIndex`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,heightEstimates:`heightEstimates`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`HeaderFooterTag`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,horizontalDirection:`horizontalDirection`,skipAnimationFrameInResizeObserver:`skipAnimationFrameInResizeObserver`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,autoscrollToBottom:`autoscrollToBottom`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},G.memo(function(e){let t=Kg(`useWindowScroll`),n=Kg(`topItemsIndexes`).length>0,r=Kg(`customScrollParent`),i=Kg(`context`);return(0,K.jsxs)(r||t?Yg:Jg,{...e,context:i,children:[n&&(0,K.jsx)(Ug,{children:(0,K.jsx)(Ag,{showTopList:!0})}),(0,K.jsxs)(r||t?Hg:Vg,{children:[(0,K.jsx)(Lg,{}),(0,K.jsx)(Ag,{}),(0,K.jsx)(Rg,{})]})]})})),Jg=zg({useEmitter:Gg,useEmitterValue:Kg,usePublisher:qg}),Yg=Bg({useEmitter:Gg,useEmitterValue:Kg,usePublisher:qg}),Xg=Wg,Zg=um(([e,t])=>({...e,...t}),Gp(dg,um(()=>{let e=Q(e=>(0,K.jsxs)(`td`,{children:[`Item $`,e]})),t=Q(null),n=Q(e=>(0,K.jsxs)(`td`,{colSpan:1e3,children:[`Group `,e]})),r=Q(null),i=Q(null),a=Q({}),o=Q(wg),s=Q(Hp),c=(e,t=null)=>sm(Z(a,X(t=>t[e]),$p()),t);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:c(`EmptyPlaceholder`),FillerRow:c(`FillerRow`),fixedFooterContent:i,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`),TableBodyComponent:c(`TableBody`,`tbody`),TableComponent:c(`Table`,`table`),TableFooterComponent:c(`TableFoot`,`tfoot`),TableHeadComponent:c(`TableHead`,`thead`),TableRowComponent:c(`TableRow`,`tr`),GroupComponent:c(`Group`,`tr`)}}))),Qg=({height:e})=>(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{style:{height:e}})}),$g=({height:e})=>(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{style:{border:0,height:e,padding:0}})}),e_={overflowAnchor:`none`},t_={position:Cg(),zIndex:2,overflowAnchor:`none`},n_=G.memo(function({showTopList:e=!1}){let t=c_(`listState`),n=c_(`computeItemKey`),r=c_(`firstItemIndex`),i=c_(`context`),a=c_(`isSeeking`),o=c_(`fixedHeaderHeight`),s=c_(`groupIndices`).length>0,c=c_(`itemContent`),l=c_(`groupContent`),u=c_(`ScrollSeekPlaceholder`)||Qg,d=c_(`GroupComponent`),f=c_(`TableRowComponent`),p=(e?t.topItems:[]).reduce((e,t,n)=>(n===0?e.push(t.size):e.push(e[n-1]+t.size),e),[]),m=(e?t.topItems:t.items).map(t=>{let m=t.originalIndex,h=n(m+r,t.data,i),g=e?m===0?0:p[m-1]:0;return a?(0,G.createElement)(u,{...Fg(u,i),height:t.size,index:t.index,key:h,type:t.type||`item`}):t.type===`group`?(0,G.createElement)(d,{...Fg(d,i),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,key:h,style:{...t_,top:o}},l(t.index,i)):(0,G.createElement)(f,{...Fg(f,i),...Ig(f,t.data),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:h,style:e?{...t_,top:o+g}:e_},s?c(t.index,t.groupIndex,t.data,i):c(t.index,t.data,i))});return(0,K.jsx)(K.Fragment,{children:m})}),r_=G.memo(function(){let e=c_(`listState`),t=c_(`topItemsIndexes`).length>0,n=l_(`sizeRanges`),r=c_(`useWindowScroll`),i=c_(`customScrollParent`),a=l_(`windowScrollContainerState`),o=l_(`scrollContainerState`),s=i||r?a:o,c=c_(`trackItemSizes`),{callbackRef:l,ref:u}=xm(n,c_(`itemSize`),c,s,c_(`log`),void 0,i,!1,c_(`skipAnimationFrameInResizeObserver`)),[d,f]=G.useState(0);s_(`deviation`,e=>{d!==e&&(u.current.style.marginTop=`${e}px`,f(e))});let p=c_(`EmptyPlaceholder`),m=c_(`FillerRow`)||$g,h=c_(`TableBodyComponent`),g=c_(`paddingTopAddition`),_=c_(`statefulTotalCount`),v=c_(`context`);if(_===0&&p)return(0,K.jsx)(p,{...Fg(p,v)});let y=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),b=e.offsetTop+g+d-y,x=e.offsetBottom,S=b>0?(0,K.jsx)(m,{context:v,height:b},`padding-top`):null,C=x>0?(0,K.jsx)(m,{context:v,height:x},`padding-bottom`):null;return(0,K.jsxs)(h,{"data-testid":`virtuoso-item-list`,ref:l,...Fg(h,v),children:[S,t&&(0,K.jsx)(n_,{showTopList:!0}),(0,K.jsx)(n_,{}),C]})}),i_=({children:e})=>{let t=G.useContext(hg),n=l_(`viewportHeight`),r=l_(`fixedItemHeight`),i=ym(G.useMemo(()=>Lp(n,e=>$m(e,`height`)),[n]),!0,c_(`skipAnimationFrameInResizeObserver`));return G.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,K.jsx)(`div`,{"data-viewport-type":`element`,ref:i,style:Ng(!1),children:e})},a_=({children:e})=>{let t=G.useContext(hg),n=l_(`windowViewportRect`),r=l_(`fixedItemHeight`),i=wm(n,c_(`customScrollParent`),c_(`skipAnimationFrameInResizeObserver`));return G.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,K.jsx)(`div`,{"data-viewport-type":`window`,ref:i,style:Ng(!1),children:e})},{Component:o_,useEmitter:s_,useEmitterValue:c_,usePublisher:l_}=mg(Zg,{required:{},optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,firstItemIndex:`firstItemIndex`,itemContent:`itemContent`,groupContent:`groupContent`,fixedHeaderContent:`fixedHeaderContent`,fixedFooterContent:`fixedFooterContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,topItemCount:`topItemCount`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,groupCounts:`groupCounts`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},G.memo(function(e){let t=c_(`useWindowScroll`),n=c_(`customScrollParent`),r=l_(`fixedHeaderHeight`),i=l_(`fixedFooterHeight`),a=c_(`fixedHeaderContent`),o=c_(`fixedFooterContent`),s=c_(`context`),c=ym(G.useMemo(()=>Lp(r,e=>$m(e,`height`)),[r]),!0,c_(`skipAnimationFrameInResizeObserver`)),l=ym(G.useMemo(()=>Lp(i,e=>$m(e,`height`)),[i]),!0,c_(`skipAnimationFrameInResizeObserver`)),u=n||t?d_:u_,d=n||t?a_:i_,f=c_(`TableComponent`),p=c_(`TableHeadComponent`),m=c_(`TableFooterComponent`),h=a?(0,K.jsx)(p,{ref:c,style:{position:`sticky`,top:0,zIndex:2},...Fg(p,s),children:a()},`TableHead`):null,g=o?(0,K.jsx)(m,{ref:l,style:{bottom:0,position:`sticky`,zIndex:1},...Fg(m,s),children:o()},`TableFoot`):null;return(0,K.jsx)(u,{...e,...Fg(u,s),children:(0,K.jsx)(d,{children:(0,K.jsxs)(f,{style:{borderSpacing:0,overflowAnchor:`none`},...Fg(f,s),children:[h,(0,K.jsx)(r_,{},`TableBody`),g]})})})})),u_=zg({useEmitter:s_,useEmitterValue:c_,usePublisher:l_}),d_=Bg({useEmitter:s_,useEmitterValue:c_,usePublisher:l_}),f_={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},p_={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:m_,floor:h_,max:g_,min:__,round:v_}=Math;function y_(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:n===null?null:n[r+e],index:r+e}))}function b_(e){return{...p_,items:e}}function x_(e,t){return e&&e.width===t.width&&e.height===t.height}function S_(e,t){return e&&e.column===t.column&&e.row===t.row}var C_=um(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:s,scrollTo:c,scrollTop:l,smoothScrollTargetReached:u,viewportHeight:d},f,p,{didMount:m,propsReady:h},{customScrollParent:g,useWindowScroll:_,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b},x])=>{let S=Q(0),C=Q(0),w=Q(f_),T=Q({height:0,width:0}),E=Q({height:0,width:0}),D=cm(),O=cm(),k=Q(0),A=Q(null),j=Q({column:0,row:0}),M=cm(),N=cm(),P=Q(!1),F=Q(0),I=Q(!0),L=Q(!1),ee=Q(!1);Kp(Z(m,im(F),Y(([e,t])=>!!t)),()=>{qp(I,!1)}),Kp(Z(pm(m,I,E,T,F,L),Y(([e,t,n,r,,i])=>e&&!t&&n.height!==0&&r.height!==0&&!i)),([,,,,e])=>{qp(L,!0),Th(1,()=>{qp(D,e)}),Xp(Z(l),()=>{qp(t,[0,0]),qp(I,!0)})}),J(Z(N,Y(e=>e!=null&&e.scrollTop>0),em(0)),C),Kp(Z(m,im(N),Y(([,e])=>e!=null)),([,e])=>{e&&(qp(T,e.viewport),qp(E,e.item),qp(j,e.gap),e.scrollTop>0&&(qp(P,!0),Xp(Z(l,nm(1)),e=>{qp(P,!1)}),qp(c,{top:e.scrollTop})))}),J(Z(T,X(({height:e})=>e)),d),J(Z(pm($(T,x_),$(E,x_),$(j,(e,t)=>e&&e.column===t.column&&e.row===t.row),$(l)),X(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),M),J(Z(pm($(S),r,$(j,S_),$(E,x_),$(T,x_),$(A),$(C),$(P),$(I),$(F)),Y(([,,,,,,,e])=>!e),X(([e,[t,n],r,i,a,o,s,,c,l])=>{let{column:u,row:d}=r,{height:f,width:p}=i,{width:m}=a;if(s===0&&(e===0||m===0))return f_;if(p===0){let t=Eh(l,e);return b_(y_(t,t+Math.max(s-1,0),o))}let h=w_(m,p,u),g,_;c?t===0&&n===0&&s>0?(g=0,_=s-1):(g=h*h_((t+d)/(f+d)),_=h*m_((n+d)/(f+d))-1,_=__(e-1,g_(_,h-1)),g=__(_,g_(0,g))):(g=0,_=-1);let v=y_(g,_,o),{bottom:y,top:b}=T_(a,r,i,v),x=m_(e/h);return{bottom:y,itemHeight:f,items:v,itemWidth:p,offsetBottom:x*f+(x-1)*d-y,offsetTop:b,top:b}})),w),J(Z(A,Y(e=>e!==null),X(e=>e.length)),S),J(Z(pm(T,E,w,j),Y(([e,t,{items:n}])=>n.length>0&&t.height!==0&&e.height!==0),X(([e,t,{items:n},r])=>{let{bottom:i,top:a}=T_(e,r,t,n);return[a,i]}),$p(Jm)),t);let te=Q(!1);J(Z(l,im(te),X(([e,t])=>t||e!==0)),te);let ne=lm(Z(pm(w,S),Y(([{items:e}])=>e.length>0),im(te),Y(([[e,t],n])=>{let r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&e.offsetBottom===0&&e.items.length===t)&&r}),X(([[,e]])=>e-1),$p())),re=lm(Z($(w),Y(({items:e})=>e.length>0&&e[0].index===0),em(0),$p())),ie=lm(Z($(w),im(P),Y(([{items:e},t])=>e.length>0&&!t),X(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),$p(qm),rm(0)));J(ie,p.scrollSeekRangeChanged),J(Z(D,im(T,E,S,j),X(([e,t,n,r,i])=>{let a=Sh(e),{align:o,behavior:s,offset:c}=a,l=a.index;l===`LAST`&&(l=r-1),l=g_(0,l,__(r-1,l));let u=E_(t,i,n,l);return o===`end`?u=v_(u-t.height+n.height):o===`center`&&(u=v_(u-t.height/2+n.height/2)),c&&(u+=c),{behavior:s,top:u}})),c);let ae=sm(Z(w,X(e=>e.offsetBottom+e.bottom)),0);return J(Z(b,X(e=>({height:e.visibleHeight,width:e.visibleWidth}))),T),{customScrollParent:g,data:A,deviation:k,footerHeight:i,gap:j,headerHeight:a,increaseViewportBy:e,initialItemCount:C,itemDimensions:E,overscan:n,restoreStateFrom:N,scrollBy:o,scrollContainerState:s,scrollHeight:O,scrollTo:c,scrollToIndex:D,scrollTop:l,smoothScrollTargetReached:u,totalCount:S,useWindowScroll:_,viewportDimensions:T,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b,...p,gridState:w,horizontalDirection:ee,initialTopMostItemIndex:F,totalListHeight:ae,...f,endReached:ne,propsReady:h,rangeChanged:ie,startReached:re,stateChanged:M,stateRestoreInProgress:P,...x}},Gp(Bh,Tm,Ph,ig,bh,ag,vm));function w_(e,t,n){return g_(1,h_((e+n)/(h_(t)+n)))}function T_(e,t,n,r){let{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};let a=E_(e,t,n,r[0].index);return{bottom:E_(e,t,n,r[r.length-1].index)+i,top:a}}function E_(e,t,n,r){let i=h_(r/w_(e.width,n.width,t.column)),a=i*n.height+g_(0,i-1)*t.row;return a>0?a+t.row:a}var D_=um(([e,t])=>({...e,...t}),Gp(C_,um(()=>{let e=Q(e=>`Item ${e}`),t=Q({}),n=Q(null),r=Q(`virtuoso-grid-item`),i=Q(`virtuoso-grid-list`),a=Q(wg),o=Q(`div`),s=Q(Hp),c=(e,n=null)=>sm(Z(t,X(t=>t[e]),$p()),n),l=Q(!1),u=Q(!1);return J($(u),l),{components:t,computeItemKey:a,context:n,FooterComponent:c(`Footer`),HeaderComponent:c(`Header`),headerFooterTag:o,itemClassName:r,ItemComponent:c(`Item`,`div`),itemContent:e,listClassName:i,ListComponent:c(`List`,`div`),readyStateChanged:l,reportReadyState:u,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`,`div`)}}))),O_=G.memo(function(){let e=F_(`gridState`),t=F_(`listClassName`),n=F_(`itemClassName`),r=F_(`itemContent`),i=F_(`computeItemKey`),a=F_(`isSeeking`),o=I_(`scrollHeight`),s=F_(`ItemComponent`),c=F_(`ListComponent`),l=F_(`ScrollSeekPlaceholder`),u=F_(`context`),d=I_(`itemDimensions`),f=I_(`gap`),p=F_(`log`),m=F_(`stateRestoreInProgress`),h=I_(`reportReadyState`),g=ym(G.useMemo(()=>e=>{let t=e.parentElement.parentElement.scrollHeight;o(t);let n=e.firstChild;if(n){let{height:e,width:t}=n.getBoundingClientRect();d({height:e,width:t})}f({column:z_(`column-gap`,getComputedStyle(e).columnGap,p),row:z_(`row-gap`,getComputedStyle(e).rowGap,p)})},[o,d,f,p]),!0,!1);return _g(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),m?null:(0,K.jsx)(c,{className:t,ref:g,...Fg(c,u),"data-testid":`virtuoso-item-list`,style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let o=i(t.index,t.data,u);return a?(0,K.jsx)(l,{...Fg(l,u),height:e.itemHeight,index:t.index,width:e.itemWidth},o):(0,G.createElement)(s,{...Fg(s,u),className:n,"data-index":t.index,key:o},r(t.index,t.data,u))})})}),k_=G.memo(function(){let e=F_(`HeaderComponent`),t=I_(`headerHeight`),n=F_(`headerFooterTag`),r=ym(G.useMemo(()=>e=>{t($m(e,`height`))},[t]),!0,!1),i=F_(`context`);return e?(0,K.jsx)(n,{ref:r,children:(0,K.jsx)(e,{...Fg(e,i)})}):null}),A_=G.memo(function(){let e=F_(`FooterComponent`),t=I_(`footerHeight`),n=F_(`headerFooterTag`),r=ym(G.useMemo(()=>e=>{t($m(e,`height`))},[t]),!0,!1),i=F_(`context`);return e?(0,K.jsx)(n,{ref:r,children:(0,K.jsx)(e,{...Fg(e,i)})}):null}),j_=({children:e})=>{let t=G.useContext(gg),n=I_(`itemDimensions`),r=I_(`viewportDimensions`),i=ym(G.useMemo(()=>e=>{r(e.getBoundingClientRect())},[r]),!0,!1);return G.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),(0,K.jsx)(`div`,{ref:i,style:Ng(!1),children:e})},M_=({children:e})=>{let t=G.useContext(gg),n=I_(`windowViewportRect`),r=I_(`itemDimensions`),i=wm(n,F_(`customScrollParent`),!1);return G.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),(0,K.jsx)(`div`,{ref:i,style:Ng(!1),children:e})},{Component:N_,useEmitter:P_,useEmitterValue:F_,usePublisher:I_}=mg(D_,{optional:{context:`context`,totalCount:`totalCount`,overscan:`overscan`,itemContent:`itemContent`,components:`components`,computeItemKey:`computeItemKey`,data:`data`,initialItemCount:`initialItemCount`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`headerFooterTag`,listClassName:`listClassName`,itemClassName:`itemClassName`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,restoreStateFrom:`restoreStateFrom`,initialTopMostItemIndex:`initialTopMostItemIndex`,increaseViewportBy:`increaseViewportBy`},methods:{scrollTo:`scrollTo`,scrollBy:`scrollBy`,scrollToIndex:`scrollToIndex`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,stateChanged:`stateChanged`,readyStateChanged:`readyStateChanged`}},G.memo(function({...e}){let t=F_(`useWindowScroll`),n=F_(`customScrollParent`),r=n||t?R_:L_,i=n||t?M_:j_,a=F_(`context`);return(0,K.jsx)(r,{...e,...Fg(r,a),children:(0,K.jsxs)(i,{children:[(0,K.jsx)(k_,{}),(0,K.jsx)(O_,{}),(0,K.jsx)(A_,{})]})})})),L_=zg({useEmitter:P_,useEmitterValue:F_,usePublisher:I_}),R_=Bg({useEmitter:P_,useEmitterValue:F_,usePublisher:I_});function z_(e,t,n){return t!==`normal`&&!(t!=null&&t.endsWith(`px`))&&n(`${e} was not resolved to pixel value correctly`,t,hm.WARN),t===`normal`?0:parseInt(t??`0`,10)}function B_(e){let t=(0,q.c)(9),{option:n,checked:r,renderOption:i}=e,a=r||void 0,o=n.value,s;t[0]!==r||t[1]!==n||t[2]!==i?(s=i?i(n,{checked:r}):n.label,t[0]=r,t[1]=n,t[2]=i,t[3]=s):s=t[3];let c;return t[4]!==n.disabled||t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,K.jsx)(we,{"data-slot":`select-option`,"data-checked":a,value:o,disabled:n.disabled,children:s}),t[4]=n.disabled,t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c}var V_=G.memo(B_);function H_(e,...t){return typeof e==`function`?e(...t):e}function U_(e){switch(e.kind){case`select-all`:return`Select all`;case`deselect-all`:return`Deselect all`;case`select-matching`:return`Select ${e.items.length} matching`;case`deselect-matching`:return`Deselect ${e.items.length} matching`}}function W_(e){let t=(0,q.c)(55),{options:n,value:r,onChange:i,multiple:a,maxSelections:o,allowSelectNone:s,pinSelected:c,compactChipTrigger:l,placeholder:u,disabled:d,fullWidth:f,className:p,id:m,renderOption:h,renderEmpty:_,virtualizeThreshold:v,virtualizedHeight:y}=e,b=c!==void 0&&c,x=l!==void 0&&l,S=u===void 0?`Select...`:u,C=d!==void 0&&d,w=f!==void 0&&f,T=_===void 0?`Nothing found.`:_,E=v===void 0?200:v,D=y===void 0?200:y,O;t[0]!==s||t[1]!==o||t[2]!==a||t[3]!==i||t[4]!==n||t[5]!==b||t[6]!==r?(O={options:n,value:r,onChange:i,multiple:a,maxSelections:o,allowSelectNone:s,pinSelected:b},t[0]=s,t[1]=o,t[2]=a,t[3]=i,t[4]=n,t[5]=b,t[6]=r,t[7]=O):O=t[7];let k=_i(O),A;t[8]!==s||t[9]!==o||t[10]!==a||t[11]!==i?(A=e=>{if(!a){if(e==null&&!s)return;i(e);return}let t=Array.isArray(e)?e:[];o!=null&&t.length>o&&(t=t.slice(-o)),i(t)},t[8]=s,t[9]=o,t[10]=a,t[11]=i,t[12]=A):A=t[12];let j=A,M;if(t[13]!==k.bulkActions){if(M=k.bulkActions.map(G_),M.length>0){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(g,{"data-slot":`select-separator`},`_bulk_separator`),t[15]=e):e=t[15],M.push(e)}t[13]=k.bulkActions,t[14]=M}else M=t[14];let N;t[16]!==k.pinnedCount||t[17]!==k.visibleOptions.length?(N=e=>k.pinnedCount>0&&e===k.pinnedCount&&k.pinnedCount<k.visibleOptions.length?(0,K.jsx)(g,{"data-slot":`select-separator`},`_pinned_separator`):null,t[16]=k.pinnedCount,t[17]=k.visibleOptions.length,t[18]=N):N=t[18];let P=N,F;t[19]!==M||t[20]!==k||t[21]!==P||t[22]!==h||t[23]!==E||t[24]!==D?(F=()=>{if(k.visibleOptions.length>E)return(0,K.jsx)(Xg,{"data-slot":`select-list`,style:{height:D},totalCount:k.visibleOptions.length,overscan:50,itemContent:e=>{let t=k.visibleOptions[e];return(0,K.jsxs)(K.Fragment,{children:[e===0&&M,P(e),(0,K.jsx)(V_,{option:t,checked:k.isChecked(t.value),renderOption:h})]})}});let e=k.visibleOptions.flatMap((e,t)=>{let n=P(t),r=(0,K.jsx)(V_,{option:e,checked:k.isChecked(e.value),renderOption:h},String(e.value));return n?[n,r]:[r]});return(0,K.jsxs)(K.Fragment,{children:[M,e]})},t[19]=M,t[20]=k,t[21]=P,t[22]=h,t[23]=E,t[24]=D,t[25]=F):F=t[25];let I=F,L;t[26]!==k.labelOf||t[27]!==S?(L=e=>{let t=Array.isArray(e)?e:e==null?[]:[e];return t.length===0?(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:S}):(0,K.jsx)(Nr,{items:t.map(k.labelOf),max:3})},t[26]=k.labelOf,t[27]=S,t[28]=L):L=t[28];let ee=L,te=e[`data-testid`],ne;t[29]===k?ne=t[30]:(ne=e=>k.labelOf(e),t[29]=k,t[30]=ne);let re=x?ee:void 0,ie;t[31]!==p||t[32]!==w?(ie=W({"w-full":w},p),t[31]=p,t[32]=w,t[33]=ie):ie=t[33];let ae=k.searchQuery,oe=k.setSearchQuery,se=k.open,ce=k.setOpen,le;t[34]===T?le=t[35]:(le=H_(T),t[34]=T,t[35]=le);let ue;t[36]!==C||t[37]!==m||t[38]!==k.open||t[39]!==k.searchQuery||t[40]!==k.setOpen||t[41]!==k.setSearchQuery||t[42]!==S||t[43]!==te||t[44]!==ne||t[45]!==re||t[46]!==ie||t[47]!==le?(ue={"data-slot":`select-root`,"data-testid":te,displayValue:ne,renderValue:re,placeholder:S,className:ie,shouldFilter:!1,search:ae,onSearchChange:oe,open:se,onOpenChange:ce,emptyState:le,disabled:C,id:m},t[36]=C,t[37]=m,t[38]=k.open,t[39]=k.searchQuery,t[40]=k.setOpen,t[41]=k.setSearchQuery,t[42]=S,t[43]=te,t[44]=ne,t[45]=re,t[46]=ie,t[47]=le,t[48]=ue):ue=t[48];let de=ue,fe;return t[49]!==de||t[50]!==j||t[51]!==a||t[52]!==I||t[53]!==r?(fe=a?(0,K.jsx)(qe,{...de,multiple:!0,value:r,onValueChange:j,children:I()}):(0,K.jsx)(qe,{...de,multiple:!1,value:r,onValueChange:j,children:I()}),t[49]=de,t[50]=j,t[51]=a,t[52]=I,t[53]=r,t[54]=fe):fe=t[54],fe}function G_(e){let t=`enabled`in e?!e.enabled:e.items.length===0;return(0,K.jsx)(Qe,{"data-slot":`select-bulk`,className:`pl-6 m-1 py-1`,value:`__bulk_${e.kind}`,disabled:t,onSelect:()=>{t||e.run()},children:U_(e)},e.kind)}var K_=Yn,q_=Qn,J_=qn,Y_=$n,X_=e=>{let t=(0,q.c)(16),{error:n,badData:r,shadowRoot:i}=e;if(n instanceof ut){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(ms,{children:`Bad Data`}),t[0]=e):e=t[0];let a;t[1]===n.issues?a=t[2]:(a=n.issues.map(Q_),t[1]=n.issues,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,K.jsx)(`div`,{className:`text-md prose dark:prose-invert`,children:(0,K.jsx)(`ul`,{children:a})}),t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(Y_,{className:`py-2 text-[0.84375rem]`,children:`View Data:`}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=(0,K.jsx)(Ei,{data:r}),t[6]=r,t[7]=c);let l;t[8]!==i||t[9]!==c?(l=(0,K.jsx)(K_,{type:`single`,collapsible:!0,children:(0,K.jsxs)(J_,{value:`item-1`,className:`text-muted-foreground border-muted-foreground-20`,children:[s,(0,K.jsx)(q_,{className:`text-[0.84375rem]`,children:(0,K.jsx)(Fi,{container:i,children:c})})]})}),t[8]=i,t[9]=c,t[10]=l):l=t[10];let u;return t[11]!==o||t[12]!==l?(u=(0,K.jsxs)(hs,{variant:`destructive`,children:[e,o,l]}),t[11]=o,t[12]=l,t[13]=u):u=t[13],u}let a;return t[14]===n.message?a=t[15]:(a=(0,K.jsx)(`div`,{children:n.message}),t[14]=n.message,t[15]=a),a};function Z_(e,t,n){return(0,K.jsx)(X_,{error:e,badData:t,shadowRoot:n})}function Q_(e){let t=e.path.join(`.`);return(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`font-bold`,children:t}),`: `,e.message]},t)}var $_=3,ev=150;function tv({hostElement:e,plugin:t,children:n,getInitialValue:r},i){let[o,c]=(0,G.useState)(n),[l,u]=(0,G.useState)(r()),{theme:d}=zo(),[f,p]=(0,G.useState)(()=>t.validator.safeParse(ae(e))),[h,g]=(0,G.useState)(0);(0,G.useImperativeHandle)(i,()=>({reset:()=>{u(r()),p(t.validator.safeParse(ae(e))),g(e=>e+1)},setChildren:e=>{c(e)}})),Bt(e,us.TYPE,t=>{t.detail.element===e&&u(t.detail.value)}),(0,G.useEffect)(()=>{let n=new MutationObserver(n=>{n.some(e=>e.type===`attributes`&&e.attributeName?.startsWith(`data-`))&&p(t.validator.safeParse(ae(e)))});return n.observe(e,{attributes:!0}),()=>{n.disconnect()}},[e,t.validator]);let _=s(t=>{u(n=>{let r=Lt.asUpdater(t)(n);return Ep(r,n)||e.dispatchEvent(ls(r,e)),r})}),v=(0,G.useMemo)(()=>{if(!t.functions)return{};let n={};for(let[r,i]of Vt.entries(t.functions)){let{input:t,output:o}=i;n[r]=async(...n)=>{Ht(n.length<=1,`Plugin functions only supports a single argument. Called ${r}`);let i=dn(),s=m.findElementThroughShadowDOMs(e)?.id,c=s?m.parse(s):null;if(c&&!i){let e=a.get($e),t=e.cellRuntime[c],n=e.cellData[c];if(ne({executionTime:t.runElapsedTimeMs??n.lastExecutionTime,status:t.status,errored:t.errored,interrupted:t.interrupted,stopped:t.stopped}))throw new is}else U.warn(`Cell ID ${c} cannot be found`);let l=cv(t,n[0]);for(let t=0;;t++){let n=dv(e);Ht(n,`Object ID should exist`);let i=await kt.request({args:l,functionName:r,namespace:n});if(i.status.code===`ok`)return cv(o,i.return_value);let a=i.found===!1;if(a&&t<$_){let e=ev*2**t;await new Promise(t=>setTimeout(t,e));continue}throw U.error(i.status),a?new ns:Error(i.status.message||`Unknown error`)}}}return n},[t.functions,e,h]);return f.success?(0,K.jsx)(In,{children:(0,K.jsx)(`div`,{className:`contents ${d}`,children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(`div`,{}),children:(0,K.jsx)(Ui,{children:t.render({setValue:_,value:l,data:f.data,children:o,host:e,functions:v})})})})}):Z_(f.error,Vt.mapValues(e.dataset,e=>typeof e==`string`?Xe(e):e),e.shadowRoot)}var nv=G.forwardRef(tv),rv=new Map,iv=`__custom_marimo_element__`;function av(e){let t=class extends HTMLElement{observer;root;mounted=!1;pluginRef=(0,G.createRef)();__type__=iv;constructor(){super(),this.attachShadow({mode:`open`}),this.copyStyles(),this.observer=new MutationObserver(()=>{this.pluginRef.current?.setChildren(this.getChildren())})}connectedCallback(){this.isLightDOMChildOfMarimoElement()||(this.mounted||(Ht(this.shadowRoot,`Shadow root should exist`),this.root&&this.root.unmount(),this.root=zl.createRoot(this.shadowRoot),this.mountReactComponent()),this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this.observer.disconnect(),this.root?.unmount(),this.mounted&&=!1}isLightDOMChildOfMarimoElement(){let e=this.parentElement;for(;e;){if(sv(e))return!0;e=e.parentElement}return!1}reset(){this.dispatchEvent(ls(Xe(this.dataset.initialValue),this)),this.rerender()}rerender(){this.pluginRef.current?.reset()}getChildren(){return this.children.length===0?null:this.children.length===1?$o({html:this.innerHTML,alwaysSanitizeHtml:!1}):Array.from(this.children).map((e,t)=>(0,K.jsx)(G.Fragment,{children:$o({html:e.outerHTML,alwaysSanitizeHtml:!1})},t))}async mountReactComponent(){this.mounted=!0,Ht(this.root,`Root must be defined`),this.root.render((0,K.jsx)(o,{store:a,children:(0,K.jsx)(Nf,{children:(0,K.jsx)(nv,{hostElement:this,plugin:e,ref:this.pluginRef,getInitialValue:()=>v(this,wt.INSTANCE),children:this.getChildren()})})}))}async copyStyles(){let t=this.shadowRoot;if(Ht(t,`Shadow root should exist`),!this.isAdoptedStyleSheetsSupported()){U.warn(`adoptedStyleSheets not supported, copying stylesheets in a less performance way. Please consider upgrading your browser.`),this.copyStylesFallback();return}let n=Array.from(document.styleSheets).filter(e=>e.ownerNode instanceof HTMLElement&&e.ownerNode.dataset.viteDevId?!0:ov(e));for(let e of n){let t=e.href??(e.ownerNode instanceof HTMLElement?e.ownerNode.dataset.viteDevId:void 0)??e.title;if(t&&!rv.has(t)){let n=new CSSStyleSheet;try{n.replaceSync(Array.from(e.cssRules).map(e=>e.cssText.includes(`@import`)?``:e.cssText).join(`
|
|
3
3
|
`))}catch{}rv.set(t,n)}}if(t.adoptedStyleSheets=[...rv.values()],e.cssStyles){let n=new CSSStyleSheet;n.replaceSync(e.cssStyles.join(`
|
|
4
4
|
`)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n]}}copyStylesFallback(){let t=this.shadowRoot;Ht(t,`Shadow root should exist`),U.warn(`adoptedStyleSheets not supported, copying stylesheets in a less performance way. Please consider upgrading your browser.`);let n=Array.from(document.styleSheets).flatMap(e=>{if(!ov(e))return[];let t=document.createElement(`style`);try{t.textContent=Array.from(e.cssRules).map(e=>e.cssText).join(`
|
|
5
5
|
`)}catch{return[]}return[t]});if(t.append(...n),e.cssStyles){let n=document.createElement(`style`);n.textContent=e.cssStyles.join(`
|