@marimo-team/frontend 0.23.9-dev45 → 0.23.9-dev46

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.
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loro_wasm_bg-CtNTubKN.js","./loro_wasm_bg-CXnd80ne.js","./chunk-LvLJmgfZ.js"])))=>i.map(i=>d[i]);
2
- var fd=Object.defineProperty;var Ba=Q=>{throw TypeError(Q)};var md=(Q,H,ye)=>H in Q?fd(Q,H,{enumerable:!0,configurable:!0,writable:!0,value:ye}):Q[H]=ye;var p=(Q,H,ye)=>md(Q,typeof H!="symbol"?H+"":H,ye),pd=(Q,H,ye)=>H.has(Q)||Ba("Cannot "+ye);var Pa=(Q,H,ye)=>(pd(Q,H,"read from private field"),ye?ye.call(Q):H.get(Q)),ja=(Q,H,ye)=>H.has(Q)?Ba("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(Q):H.set(Q,ye);import{s as Ma}from"./chunk-LvLJmgfZ.js";import{d as Ra,f as wr,i as Y,l as kn,n as ae,p as Ut,s as Cn,u as ie}from"./useEvent-D91BmmQi.js";import{t as gd}from"./react-Bj1aDYRI.js";import{$r as vr,$t as Ga,Bn as hd,Bt as bd,Ct as yd,D as Sn,Di as wd,Dt as vd,Et as xn,Gn as Ed,Gr as Nd,H as kd,Hn as Ja,I as Cd,Ii as In,Jn as Sd,Jt as xd,K as Wa,Mn as Id,Mt as Ad,Ot as Td,Qn as Fd,Qt as Er,Rn as Ld,Sn as Od,Tn as Nr,U as Va,Un as _d,V as $a,Vt as Ha,W as qa,Wn as Dd,Yt as kr,a as za,at as Ud,b as rt,bn as Bd,d as Ka,en as Ya,h as Bt,hn as Pd,ht as jd,in as Md,kt as Pt,mt as Cr,ni as Rd,nn as Gd,oi as Jd,qn as Wd,rn as Vd,si as Xa,sn as An,st as $d,ti as Hd,u as Qa,un as qd,vn as zd,wi as Za,wt as Sr,xn as Kd,yr as Yd,zn as Xd,__tla as Qd}from"./cells-CFd8A4_A.js";import{B as Zd,N as ef,P as xr,R as ei,S as tf,T as ti,k as nf,w as rf}from"./zod-H_cgTO0M.js";import{t as We}from"./compiler-runtime-B3qBwwSJ.js";import{C as of,f as af,m as sf,p as lf,t as cf,v as uf,w as df}from"./ai-model-dropdown-BToySVta.js";import{_ as Ve,c as ni,h as Ir,t as ff,v as mf}from"./useEventListener-DvoEXWke.js";import{t as jt}from"./invariant-BUdrueMv.js";import{_ as ri,c as pf,g as oi,h as ai,l as ii,w as Ar}from"./utils-CvI-39U6.js";import{S as si,T as gf,m as hf,o as bf,r as li,v as yt,w as Mt}from"./config-DdDKNgb1.js";import{n as yf,t as wf}from"./switch-35WUzMpb.js";import{n as vf}from"./globals-FM_XB1In.js";import{t as Ef}from"./ErrorBoundary-DyYDV0HI.js";import{t as ct}from"./cn-DCUzRj2J.js";import{t as Nf}from"./jsx-runtime-BqBOg78p.js";import{l as kf,r as Cf,t as Sf}from"./popover-Bz_0Vkyf.js";import{B as xf,__tla as If}from"./JsonOutput-B2v_Stn9.js";import{t as Tr}from"./label-xHqFtfdz.js";import{r as Af}from"./download-BaGnGHOq.js";import{t as Tn}from"./tooltip-DTV9tlSr.js";import{r as Fr,t as ut}from"./button-BbCh-29a.js";import{Bt as wt,Ct as ci,Dt as Tf,E as Ff,Ft as Lr,H as ui,Ht as Rt,I as Lf,J as l,Jt as he,Kt as Of,Lt as Fn,Mt as _f,P as Df,St as $e,V as di,Vt as Or,Wt as dt,Yt as Ye,Zt as Gt,_ as Uf,a as Bf,at as R,bt as Pf,ct as Ze,en as Ln,ft as jf,it as Mf,lt as On,m as Rf,pt as Gf,rt as $,st as Jf,vt as Wf,w as Vf,wt as $f,yt as Hf,zt as qf}from"./dist-BrR4M-k3.js";import{E as zf,P as Kf,S as Yf,a as Xf,b as Qf,c as Zf,n as _r,r as em,w as tm,x as nm}from"./dist-CHcznzB-.js";import{o as fi}from"./arrays-DYDL-3-i.js";import{n as rm}from"./once-DRroIaBz.js";import{t as Dr}from"./createReducer-CI9qeK_X.js";import{a as om,c as am,f as _n,h as im,i as sm,l as Jt,n as mi,o as lm,t as cm}from"./dist-HlsDto3K.js";import{t as um}from"./main-B0OX4z33.js";import{r as Dn,t as dm}from"./requests-DIwGYs0l.js";import{t as fm}from"./createLucideIcon-D5guW7EU.js";import{r as pi,t as mm,__tla as pm}from"./layout-KNg4OZ4V.js";import{t as gm}from"./x-C-6liIBr.js";import{t as hm}from"./circle-check-C17zXg7L.js";import{D as gi,E as bm,S as ym,a as hi,d as wm,j as vm,k as Em,n as Nm,o as km,r as bi,s as Cm}from"./add-cell-with-ai-CAC7vFzu.js";import{r as Sm,t as xm}from"./file-icons-CIKQdTpO.js";import{n as Im}from"./spinner-Bhir8k53.js";import{t as yi}from"./save-Clg5dMoP.js";import{Y as Am,Z as wi}from"./input-C3Hrdlqq.js";import{t as Tm}from"./sparkles-lWUAsPhp.js";import{t as Fm}from"./preload-helper-BPPi7vOr.js";import{t as vt}from"./use-toast-IPAtJGea.js";import{n as et}from"./paths-D5zczhUD.js";import{t as Lm}from"./session-0B5NBztP.js";import{r as Om}from"./useTheme-CI2eq4XN.js";import{n as vi}from"./copy-LK56fFow.js";import{k as _m}from"./usePress-DQ_tAz5W.js";import{a as Dm}from"./useRunCells-DQDFDt2R.js";import{c as Ei,i as Ni,n as ki,r as Um}from"./dialog-DzC_QCtT.js";import{t as Ci}from"./useHotkey-TKvjHf1m.js";import{n as Si}from"./ImperativeModal-B3Th7k4R.js";import{r as Bm}from"./errors-vr57w7Ul.js";import{t as z}from"./extends-BiFDv3jB.js";import{t as Wt}from"./objectWithoutPropertiesLoose-DfWeGRFv.js";import{t as Pm}from"./kbd-CTUAEnEx.js";import{a as Ur}from"./useInstallPackage-DUF4IRRI.js";import{i as jm,n as xi}from"./state-CEiXUajw.js";import{a as Mm,o as Rm}from"./cell-link-CW22jH60.js";import{r as Ii}from"./html-to-image-CJxTFjQz.js";import{a as Gm}from"./focus-DjmSWsDI.js";import{n as Jm}from"./useAsyncData-bgszE9F0.js";import{a as Wm,o as Ai,r as Vm,s as Ti,t as $m}from"./command-KARR7KMq.js";import{a as Fi}from"./renderShortcut-CcFk3m01.js";import{n as Hm,t as qm}from"./icons-Ol38nIbL.js";import{n as Et}from"./esm-CqWdmSnV.js";import{t as Li}from"./dist-4ni0fia5.js";import{n as Br,t as Oi}from"./useDeleteCell-CH_1gU2V.js";import{t as zm}from"./useSplitCell-Cle-KXDv.js";import{co as Km,do as Pr,fo as Ym,ft as Xm,go as Nt,ho as _i,lo as jr,mo as Di,oo as Qm,po as Zm,so as Ui,uo as Bi,__tla as ep}from"./loro_wasm_bg-CXnd80ne.js";import{t as tp}from"./ws-BnE9sl8z.js";import{t as Pi}from"./Inputs-C6ftxLAJ.js";import{n as np}from"./hooks-BfsdgkfD.js";let Un,Mr,ji,Rr,ft,Gr,ve,Vt,$t,Mi,Ri,Gi,Ji,Wi,Bn,Vi,Pn,$i,jn,rp=Promise.all([(()=>{try{return Qd}catch{}})(),(()=>{try{return If}catch{}})(),(()=>{try{return pm}catch{}})(),(()=>{try{return ep}catch{}})()]).then(async()=>{var Nn,Ua,Ne,ke,Ce,Se,xe,Ie,Ae,Te,Fe,Le,Oe,_e,De,Ue,Be,Pe,je,Me,Re;var Q=fm("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const H={showInput:"Mod-l",acceptEdit:"Mod-y",rejectEdit:"Mod-u"};var ye=300;const Ct=Rt.define({combine:e=>Ln(e,{onError:console.error,inputDebounceTime:ye,keymaps:H},{onError:(t,n)=>t&&n,inputDebounceTime:(t,n)=>t&&n,keymaps:(t,n)=>t&&n})}),ot=he.define(),at=Ye.define({create(){return{show:!1,lineFrom:0,lineTo:0}},update(e,t){for(let n of t.effects)if(n.is(ot))return n.value;return e}}),St=he.define(),xt=he.define(),Wr=Ye.define({create(){return{shouldFocus:!1,inputValue:""}},update(e,t){let n=e;for(let r of t.effects)r.is(St)&&(n={...n,inputValue:r.value}),r.is(xt)&&(n={...n,shouldFocus:r.value});return n}}),Ht=he.define(),It=Ye.define({create(){return null},update(e,t){for(let n of t.effects)if(n.is(Ht))return n.value;return e}}),mt=he.define(),Vr=Ye.define({create(){return!1},update(e,t){for(let n of t.effects)if(n.is(mt))return n.value;return e}});var Hi=1;const $r=e=>{let{state:t}=e,n=t.selection.main;if(n.empty)return!1;let r=t.doc,o=r.lineAt(n.from),a=r.lineAt(n.to);if(t.sliceDoc(o.from,a.to).trim().length<Hi)return!1;let i=Math.max(1,Math.min(o.number,r.lines)),s=Math.max(1,Math.min(a.number,r.lines));return e.dispatch({effects:[ot.of({show:!0,lineFrom:i,lineTo:s}),xt.of(!0),St.of("")],selection:wt.cursor(o.from)}),!0},Hr=e=>e.state.field(It)?(e.dispatch({effects:[Ht.of(null),ot.of({show:!1,lineFrom:0,lineTo:0}),xt.of(!1),St.of(""),mt.of(!1)]}),!0):!1,qr=e=>{let t=e.state.field(It);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[Ht.of(null),ot.of({show:!1,lineFrom:0,lineTo:0}),xt.of(!1),St.of(""),mt.of(!1)]}),!0):!1};var Mn={mac:"\u2318",windows:"\u229E Win",default:"Ctrl"};function qi(){return navigator.platform.startsWith("Mac")?Mn.mac:navigator.platform.startsWith("Win")?Mn.windows:Mn.default}function Rn(e){return e.replace("Mod",qi()).replace("-"," ").toUpperCase()}function pe(e,t){let n=document.createElement(e);return n.className=t,n}function zi(e,t,n=void 0){let r=()=>{};return(...o)=>(r(),new Promise((a,i)=>{let s=setTimeout(()=>a(e(...o)),t);r=()=>{clearTimeout(s),n!==void 0&&i(n)}}))}var qt=Ye.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(r=>r.is(zt));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),zt=he.define();function Ki(e,t){let n=e.state.selection.main.head,r=[],o=$.widget({widget:new Yi(t),side:1});return r.push(o.range(n)),$.set(r)}var Yi=class extends On{constructor(t){super();p(this,"suggestion");this.suggestion=t}toDOM(){let t=document.createElement("span");return t.style.opacity="0.4",t.className="cm-inline-suggestion",t.textContent=this.suggestion,t.setAttribute("role","suggestion"),t.setAttribute("aria-label",`Suggestion: ${this.suggestion}`),t}get lineBreaks(){return this.suggestion.split(`
2
+ var fd=Object.defineProperty;var Ba=Q=>{throw TypeError(Q)};var md=(Q,H,ye)=>H in Q?fd(Q,H,{enumerable:!0,configurable:!0,writable:!0,value:ye}):Q[H]=ye;var p=(Q,H,ye)=>md(Q,typeof H!="symbol"?H+"":H,ye),pd=(Q,H,ye)=>H.has(Q)||Ba("Cannot "+ye);var Pa=(Q,H,ye)=>(pd(Q,H,"read from private field"),ye?ye.call(Q):H.get(Q)),ja=(Q,H,ye)=>H.has(Q)?Ba("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(Q):H.set(Q,ye);import{s as Ma}from"./chunk-LvLJmgfZ.js";import{d as Ra,f as wr,i as Y,l as kn,n as ae,p as Ut,s as Cn,u as ie}from"./useEvent-D91BmmQi.js";import{t as gd}from"./react-Bj1aDYRI.js";import{$r as vr,$t as Ga,Bn as hd,Bt as bd,Ct as yd,D as Sn,Di as wd,Dt as vd,Et as xn,Gn as Ed,Gr as Nd,H as kd,Hn as Ja,I as Cd,Ii as In,Jn as Sd,Jt as xd,K as Wa,Mn as Id,Mt as Ad,Ot as Td,Qn as Fd,Qt as Er,Rn as Ld,Sn as Od,Tn as Nr,U as Va,Un as _d,V as $a,Vt as Ha,W as qa,Wn as Dd,Yt as kr,a as za,at as Ud,b as rt,bn as Bd,d as Ka,en as Ya,h as Bt,hn as Pd,ht as jd,in as Md,kt as Pt,mt as Cr,ni as Rd,nn as Gd,oi as Jd,qn as Wd,rn as Vd,si as Xa,sn as An,st as $d,ti as Hd,u as Qa,un as qd,vn as zd,wi as Za,wt as Sr,xn as Kd,yr as Yd,zn as Xd,__tla as Qd}from"./cells-CFd8A4_A.js";import{B as Zd,N as ef,P as xr,R as ei,S as tf,T as ti,k as nf,w as rf}from"./zod-H_cgTO0M.js";import{t as We}from"./compiler-runtime-B3qBwwSJ.js";import{C as of,f as af,m as sf,p as lf,t as cf,v as uf,w as df}from"./ai-model-dropdown-BToySVta.js";import{_ as Ve,c as ni,h as Ir,t as ff,v as mf}from"./useEventListener-DvoEXWke.js";import{t as jt}from"./invariant-BUdrueMv.js";import{_ as ri,c as pf,g as oi,h as ai,l as ii,w as Ar}from"./utils-CvI-39U6.js";import{S as si,T as gf,m as hf,o as bf,r as li,v as yt,w as Mt}from"./config-DdDKNgb1.js";import{n as yf,t as wf}from"./switch-35WUzMpb.js";import{n as vf}from"./globals-FM_XB1In.js";import{t as Ef}from"./ErrorBoundary-DyYDV0HI.js";import{t as ct}from"./cn-DCUzRj2J.js";import{t as Nf}from"./jsx-runtime-BqBOg78p.js";import{l as kf,r as Cf,t as Sf}from"./popover-Bz_0Vkyf.js";import{B as xf,__tla as If}from"./JsonOutput-B2v_Stn9.js";import{t as Tr}from"./label-xHqFtfdz.js";import{r as Af}from"./download-BaGnGHOq.js";import{t as Tn}from"./tooltip-DTV9tlSr.js";import{r as Fr,t as ut}from"./button-BbCh-29a.js";import{Bt as wt,Ct as ci,Dt as Tf,E as Ff,Ft as Lr,H as ui,Ht as Rt,I as Lf,J as l,Jt as he,Kt as Of,Lt as Fn,Mt as _f,P as Df,St as $e,V as di,Vt as Or,Wt as dt,Yt as Ye,Zt as Gt,_ as Uf,a as Bf,at as R,bt as Pf,ct as Ze,en as Ln,ft as jf,it as Mf,lt as On,m as Rf,pt as Gf,rt as $,st as Jf,vt as Wf,w as Vf,wt as $f,yt as Hf,zt as qf}from"./dist-BrR4M-k3.js";import{E as zf,P as Kf,S as Yf,a as Xf,b as Qf,c as Zf,n as _r,r as em,w as tm,x as nm}from"./dist-CHcznzB-.js";import{o as fi}from"./arrays-DYDL-3-i.js";import{n as rm}from"./once-DRroIaBz.js";import{t as Dr}from"./createReducer-CI9qeK_X.js";import{a as om,c as am,f as _n,h as im,i as sm,l as Jt,n as mi,o as lm,t as cm}from"./dist-HlsDto3K.js";import{t as um}from"./main-B0OX4z33.js";import{r as Dn,t as dm}from"./requests-DIwGYs0l.js";import{t as fm}from"./createLucideIcon-D5guW7EU.js";import{r as pi,t as mm,__tla as pm}from"./layout-B15A69L1.js";import{t as gm}from"./x-C-6liIBr.js";import{t as hm}from"./circle-check-C17zXg7L.js";import{D as gi,E as bm,S as ym,a as hi,d as wm,j as vm,k as Em,n as Nm,o as km,r as bi,s as Cm}from"./add-cell-with-ai-CAC7vFzu.js";import{r as Sm,t as xm}from"./file-icons-CIKQdTpO.js";import{n as Im}from"./spinner-Bhir8k53.js";import{t as yi}from"./save-Clg5dMoP.js";import{Y as Am,Z as wi}from"./input-C3Hrdlqq.js";import{t as Tm}from"./sparkles-lWUAsPhp.js";import{t as Fm}from"./preload-helper-BPPi7vOr.js";import{t as vt}from"./use-toast-IPAtJGea.js";import{n as et}from"./paths-D5zczhUD.js";import{t as Lm}from"./session-0B5NBztP.js";import{r as Om}from"./useTheme-CI2eq4XN.js";import{n as vi}from"./copy-LK56fFow.js";import{k as _m}from"./usePress-DQ_tAz5W.js";import{a as Dm}from"./useRunCells-DQDFDt2R.js";import{c as Ei,i as Ni,n as ki,r as Um}from"./dialog-DzC_QCtT.js";import{t as Ci}from"./useHotkey-TKvjHf1m.js";import{n as Si}from"./ImperativeModal-B3Th7k4R.js";import{r as Bm}from"./errors-vr57w7Ul.js";import{t as z}from"./extends-BiFDv3jB.js";import{t as Wt}from"./objectWithoutPropertiesLoose-DfWeGRFv.js";import{t as Pm}from"./kbd-CTUAEnEx.js";import{a as Ur}from"./useInstallPackage-DUF4IRRI.js";import{i as jm,n as xi}from"./state-CEiXUajw.js";import{a as Mm,o as Rm}from"./cell-link-CW22jH60.js";import{r as Ii}from"./html-to-image-CJxTFjQz.js";import{a as Gm}from"./focus-DjmSWsDI.js";import{n as Jm}from"./useAsyncData-bgszE9F0.js";import{a as Wm,o as Ai,r as Vm,s as Ti,t as $m}from"./command-KARR7KMq.js";import{a as Fi}from"./renderShortcut-CcFk3m01.js";import{n as Hm,t as qm}from"./icons-Ol38nIbL.js";import{n as Et}from"./esm-CqWdmSnV.js";import{t as Li}from"./dist-4ni0fia5.js";import{n as Br,t as Oi}from"./useDeleteCell-CH_1gU2V.js";import{t as zm}from"./useSplitCell-Cle-KXDv.js";import{co as Km,do as Pr,fo as Ym,ft as Xm,go as Nt,ho as _i,lo as jr,mo as Di,oo as Qm,po as Zm,so as Ui,uo as Bi,__tla as ep}from"./loro_wasm_bg-CXnd80ne.js";import{t as tp}from"./ws-BnE9sl8z.js";import{t as Pi}from"./Inputs-C6ftxLAJ.js";import{n as np}from"./hooks-Cj0_VSui.js";let Un,Mr,ji,Rr,ft,Gr,ve,Vt,$t,Mi,Ri,Gi,Ji,Wi,Bn,Vi,Pn,$i,jn,rp=Promise.all([(()=>{try{return Qd}catch{}})(),(()=>{try{return If}catch{}})(),(()=>{try{return pm}catch{}})(),(()=>{try{return ep}catch{}})()]).then(async()=>{var Nn,Ua,Ne,ke,Ce,Se,xe,Ie,Ae,Te,Fe,Le,Oe,_e,De,Ue,Be,Pe,je,Me,Re;var Q=fm("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const H={showInput:"Mod-l",acceptEdit:"Mod-y",rejectEdit:"Mod-u"};var ye=300;const Ct=Rt.define({combine:e=>Ln(e,{onError:console.error,inputDebounceTime:ye,keymaps:H},{onError:(t,n)=>t&&n,inputDebounceTime:(t,n)=>t&&n,keymaps:(t,n)=>t&&n})}),ot=he.define(),at=Ye.define({create(){return{show:!1,lineFrom:0,lineTo:0}},update(e,t){for(let n of t.effects)if(n.is(ot))return n.value;return e}}),St=he.define(),xt=he.define(),Wr=Ye.define({create(){return{shouldFocus:!1,inputValue:""}},update(e,t){let n=e;for(let r of t.effects)r.is(St)&&(n={...n,inputValue:r.value}),r.is(xt)&&(n={...n,shouldFocus:r.value});return n}}),Ht=he.define(),It=Ye.define({create(){return null},update(e,t){for(let n of t.effects)if(n.is(Ht))return n.value;return e}}),mt=he.define(),Vr=Ye.define({create(){return!1},update(e,t){for(let n of t.effects)if(n.is(mt))return n.value;return e}});var Hi=1;const $r=e=>{let{state:t}=e,n=t.selection.main;if(n.empty)return!1;let r=t.doc,o=r.lineAt(n.from),a=r.lineAt(n.to);if(t.sliceDoc(o.from,a.to).trim().length<Hi)return!1;let i=Math.max(1,Math.min(o.number,r.lines)),s=Math.max(1,Math.min(a.number,r.lines));return e.dispatch({effects:[ot.of({show:!0,lineFrom:i,lineTo:s}),xt.of(!0),St.of("")],selection:wt.cursor(o.from)}),!0},Hr=e=>e.state.field(It)?(e.dispatch({effects:[Ht.of(null),ot.of({show:!1,lineFrom:0,lineTo:0}),xt.of(!1),St.of(""),mt.of(!1)]}),!0):!1,qr=e=>{let t=e.state.field(It);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[Ht.of(null),ot.of({show:!1,lineFrom:0,lineTo:0}),xt.of(!1),St.of(""),mt.of(!1)]}),!0):!1};var Mn={mac:"\u2318",windows:"\u229E Win",default:"Ctrl"};function qi(){return navigator.platform.startsWith("Mac")?Mn.mac:navigator.platform.startsWith("Win")?Mn.windows:Mn.default}function Rn(e){return e.replace("Mod",qi()).replace("-"," ").toUpperCase()}function pe(e,t){let n=document.createElement(e);return n.className=t,n}function zi(e,t,n=void 0){let r=()=>{};return(...o)=>(r(),new Promise((a,i)=>{let s=setTimeout(()=>a(e(...o)),t);r=()=>{clearTimeout(s),n!==void 0&&i(n)}}))}var qt=Ye.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(r=>r.is(zt));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),zt=he.define();function Ki(e,t){let n=e.state.selection.main.head,r=[],o=$.widget({widget:new Yi(t),side:1});return r.push(o.range(n)),$.set(r)}var Yi=class extends On{constructor(t){super();p(this,"suggestion");this.suggestion=t}toDOM(){let t=document.createElement("span");return t.style.opacity="0.4",t.className="cm-inline-suggestion",t.textContent=this.suggestion,t.setAttribute("role","suggestion"),t.setAttribute("aria-label",`Suggestion: ${this.suggestion}`),t}get lineBreaks(){return this.suggestion.split(`
3
3
  `).length-1}},Xi=class{constructor(e){p(this,"cache",new Map);p(this,"timeout");this.timeout=e}get(e){let t=this.cache.get(e);return t?Date.now()-t.timestamp>this.timeout?(this.cache.delete(e),null):t.result:null}set(e,t){this.cache.set(e,{result:t,timestamp:Date.now()})}},Qi=(e,t)=>Ze.fromClass(class{constructor(){p(this,"abortController",null);p(this,"cache");this.cache=new Xi(t.cacheTimeout??1e3)}async update(n){var i,s,u,c,d;if(!n.docChanged||((s=(i=t.events)==null?void 0:i.beforeSuggestionFetch)==null?void 0:s.call(i,n.view))===!1)return;(u=this.abortController)==null||u.abort(),this.abortController=new AbortController;let r=n.state.doc,o=r.toString(),a=this.cache.get(o);if(a){n.view.dispatch({effects:zt.of({text:a,doc:r})});return}try{let f=await e(n.state,this.abortController.signal,n.view);if(this.abortController.signal.aborted||((d=(c=t.events)==null?void 0:c.shouldShowSuggestion)==null?void 0:d.call(c,n.view,f))===!1)return;this.cache.set(o,f),n.view.dispatch({effects:zt.of({text:f,doc:r})})}catch(f){f instanceof Error&&f.name!=="AbortError"&&console.error("Suggestion fetch error:",f)}}destroy(){var n;(n=this.abortController)==null||n.abort()}}),Zi=Ze.fromClass(class{constructor(){p(this,"decorations");this.decorations=$.none}update(e){var n;let t=(n=e.state.field(qt))==null?void 0:n.suggestion;if(!t){this.decorations=$.none;return}this.decorations=Ki(e.view,t)}},{decorations:e=>e.decorations});function es(e,t,n,r){return{...e.changeByRange(o=>{if(o===e.selection.main)return{changes:{from:n,to:r,insert:t},range:wt.cursor(n+t.length)};let a=r-n;return!o.empty||a&&e.sliceDoc(o.from-a,o.from)!==e.sliceDoc(n,r)?{range:o}:{changes:{from:o.from-a,to:o.from,insert:t},range:wt.cursor(o.from-a+t.length)}}),userEvent:"input.complete"}}var ts=e=>{var r,o,a;let t=(r=e.state.field(qt))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Gn);return e.dispatch({...es(e.state,t,e.state.selection.main.head,e.state.selection.main.head)}),(a=(o=n.events)==null?void 0:o.onSuggestionAccepted)==null||a.call(o,e,t),!0},zr=e=>{var r,o,a;let t=(r=e.state.field(qt))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Gn);return e.dispatch({effects:zt.of({text:null,doc:e.state.doc})}),(a=(o=n.events)==null?void 0:o.onSuggestionRejected)==null||a.call(o,e,t),!0},ns=$e.of([{key:"Tab",run:ts},{key:"Escape",run:zr}]),Gn=Rt.define({combine:e=>e.at(-1)});function Kr(e){let{delay:t=500,includeKeymap:n=!0}=e,r=zi(e.fetchFn,t);return[qt,Gn.of(e),Qi(r,e),Zi,n?ns:[]]}const rs=R.baseTheme({".cm-ai-input-container":{display:"flex",flexDirection:"column",gap:"4px",width:"min(calc(100% + 7px), 500px)",padding:"5px 5px",margin:"0 -6px",backgroundColor:"light-dark(rgb(241, 243, 245), rgb(40, 40, 40))"},".cm-ai-input":{display:"block",width:"100%",padding:"3px 8px",border:"2px solid rgb(51, 154, 240)",borderRadius:"5px",fontSize:"12px"},".cm-ai-help-info-button":{fontSize:"10px",paddingLeft:"10px",height:"18px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",display:"block",marginRight:"auto"},".cm-ai-help-info-button:hover":{color:"light-dark(rgb(89, 97, 105), rgb(190, 190, 190))"},".cm-ai-generate-button":{background:"#0E639C",border:"none",padding:"2px 6px",color:"#ffffff",cursor:"pointer",font:"inherit",borderRadius:"4px","&:hover":{backgroundColor:"#1177bb"}},".cm-line.cm-ai-selection, .cm-line.cm-ai-selection.cm-active-line":{backgroundColor:"light-dark(color-mix(in srgb, rgb(223, 227, 232) 50%, transparent), color-mix(in srgb, rgb(50, 50, 50) 50%, transparent)) !important"},".cm-line:has(.cm-new-code-line)":{backgroundColor:"light-dark(color-mix(in srgb, rgb(183, 235, 143) 50%, transparent), color-mix(in srgb, rgb(40, 100, 40) 50%, transparent)) !important"},".cm-old-code-container":{backgroundColor:"light-dark(rgb(255, 205, 205), rgb(100, 40, 40))",position:"relative",display:"flex",paddingTop:"0",width:"100%",alignItems:"center"},".cm-code-button":{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"16px"},".cm-floating-buttons":{fontFamily:"sans-serif",position:"absolute",top:"-20px",left:"5px",display:"flex"},".cm-floating-button":{fontFamily:"sans-serif",padding:"2px 5px",fontSize:"10px",cursor:"pointer",fontWeight:"700"},".cm-floating-accept":{backgroundColor:"light-dark(rgb(55, 125, 34), rgb(40, 80, 25))",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px",color:"white",filter:"brightness(90%)","&:hover":{filter:"brightness(100%)"}},".cm-floating-reject":{backgroundColor:"light-dark(rgb(220, 53, 69), rgb(180, 40, 50))",color:"white",borderTopRightRadius:"5px",borderBottomRightRadius:"5px",filter:"brightness(90%)","&:hover":{filter:"brightness(100%)"}},".hotkey":{display:"inline-block",padding:"0 4px",borderRadius:"3px",backgroundColor:"rgba(255, 255, 255, 0.1)",fontSize:"90%"},".cm-ai-loading-indicator":{fontStyle:"italic",fontSize:"10px",paddingLeft:"12px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",opacity:"0",transition:"opacity 0.3s ease-in-out","&::after":{content:'""',display:"inline-block",animation:"ellipsis-pulse 1.5s steps(4, end) infinite"},"&:not(:empty)":{opacity:"1"}},".cm-ai-input:disabled":{opacity:"0.5"},"@keyframes ellipsis-pulse":{"0%":{content:"'.'"},"25%":{content:"'..'"},"50%":{content:"'...'"},"75%":{content:"''"}},".cm-ai-loading-container":{display:"flex",alignItems:"center",padding:"0 8px"},".cm-ai-cancel-button":{padding:"2px 8px",fontSize:"10px",borderRadius:"4px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",cursor:"pointer","&:hover":{background:"light-dark(rgb(223, 227, 232), rgb(50, 50, 50))"}},".hidden":{display:"none"}});function os(e){var s,u;let t=e.state.facet(Ct),n={...H,...t.keymaps},r=e.state.facet(Kt),o=pe("div","cm-ai-tooltip").appendChild(pe("div","cm-ai-tooltip-button")),a=o.appendChild(document.createElement("span"));a.textContent=`${r.label} `;let i=a.appendChild(document.createElement("span"));return i.className="hotkey",i.textContent=Rn(n.showInput),(s=o.querySelector("span"))==null||s.addEventListener("mousedown",c=>{c.stopPropagation(),c.button===0&&c.preventDefault()}),(u=o.querySelector("span"))==null||u.addEventListener("click",c=>{c.preventDefault(),$r(e)}),o}const Kt=Rt.define({combine(e){return Ln(e,{render:os,hideOnBlur:!1,label:"Edit with AI"})}}),as=Ze.fromClass((Ua=class{constructor(e){p(this,"view");p(this,"suppress");p(this,"dom");p(this,"mousedown",()=>{this.suppress=!0});p(this,"mouseup",()=>{this.suppress=!1,this.display(this.view)});p(this,"scroll",()=>{this.display(this.view)});p(this,"windowScroll",()=>{this.display(this.view)});ja(this,Nn,e=>{var n;let t=e.state.selection.ranges.find(r=>!r.empty);if(t&&!this.suppress){let r=e.coordsAtPos(t.from),o=e.coordsAtPos(t.to);if(!r||!o)return;let a=e.dom.getBoundingClientRect(),i=(n=e.dom.parentElement)==null?void 0:n.getBoundingClientRect(),s=v=>v.top>=a.top&&v.top<=a.bottom&&v.left>=a.left&&v.left<=a.right,u=v=>!i||v.top>=i.top&&v.top<=i.bottom&&v.left>=i.left&&v.left<=i.right,c=s(r)||s(o),d=u(r)||u(o);if(!c||!d){this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true");return}this.dom.style.display="flex",this.dom.setAttribute("aria-hidden","false");let f=this.dom.getBoundingClientRect(),g=s(r)?r:o,m=a.right-f.width,h=Math.min(g.left,m),w=g.top-f.height,y=i?i.y:-1/0;w<y&&(w=o.bottom),this.dom.style.left=`${h}px`,this.dom.style.top=`${w}px`,requestAnimationFrame(()=>{this.dom&&this.dom.setAttribute("aria-hidden","false")})}else this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true")});this.view=e;let t=e.state.facet(Kt);this.suppress=!1,document.addEventListener("mousedown",this.mousedown),document.addEventListener("mouseup",this.mouseup),e.scrollDOM.addEventListener("scroll",this.scroll),window.addEventListener("scroll",this.windowScroll,!0);let n=t.render(e);e.dom.appendChild(n),this.dom=n}update(e){this.display(e.view)}docViewUpdate(e){this.display(e)}display(e){if(e.state.field(at).show){this.dom.style.display="none";return}if(e.state.facet(Kt).hideOnBlur&&!e.hasFocus){this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true");return}e.requestMeasure({read:Pa(this,Nn)})}destroy(){document.removeEventListener("mousedown",this.mousedown),document.removeEventListener("mouseup",this.mouseup),this.view.scrollDOM.removeEventListener("scroll",this.scroll),window.removeEventListener("scroll",this.windowScroll,!0),this.dom.remove()}},Nn=new WeakMap,Ua));var is=R.baseTheme({".cm-ai-tooltip-button":{userSelect:"none",fontFamily:"system-ui, -apple-system, sans-serif",position:"fixed",display:"flex",boxSizing:"border-box",padding:"2px 6px",borderRadius:"4px",fontSize:"12px",backgroundColor:"#0E639C",color:"#ffffff",border:"1px solid transparent",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:"999",transition:"opacity 0.5s","&[aria-hidden='true']":{opacity:"0"},"&[aria-hidden='false']":{opacity:"1"},"& > span":{pointerEvents:"auto",cursor:"pointer",display:"inline-block",padding:"2px"},"&:hover":{backgroundColor:"#1177bb"}}});function ss(){return[as,is]}var ls=class extends On{constructor(t){super();p(this,"oldCode");this.oldCode=t}toDOM(t){let n=pe("div","cm-old-code-container");n.setAttribute("role","region"),n.setAttribute("aria-label","Previous code version");let r=pe("div","cm-old-code cm-line");r.textContent=this.oldCode;let o=pe("div","cm-floating-buttons"),a=t.state.facet(Ct),i={...H,...a.keymaps},s=pe("button","cm-floating-button cm-floating-accept");s.innerHTML=`<span class="hotkey">${Rn(i.acceptEdit)}</span> Accept`,s.setAttribute("aria-label","Accept changes"),s.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),t.focus(),Hr(t)});let u=pe("button","cm-floating-button cm-floating-reject");return u.innerHTML=`<span class="hotkey">${Rn(i.rejectEdit)}</span> Reject`,u.setAttribute("aria-label","Reject changes"),u.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),t.focus(),qr(t)}),o.append(s,u),n.append(r,o),n}updateDOM(t,n){return!0}},cs=class extends On{constructor(t){super();p(this,"complete");p(this,"abortController",null);p(this,"dom",null);p(this,"input",null);p(this,"loadingContainer",null);p(this,"helpInfo",null);p(this,"inputContainer",null);p(this,"form",null);p(this,"view",null);p(this,"onKeyDown",async t=>{t.key==="Enter"&&!t.shiftKey?(t.preventDefault(),await this.handleSubmit()):t.key==="Escape"&&this.onCancel()});p(this,"onCancel",()=>{this.cleanup();let t=this.view;t&&(t.dispatch({effects:[ot.of({show:!1,lineFrom:0,lineTo:0}),mt.of(!1)]}),t.focus())});p(this,"handleSubmit",async t=>{var h;let n=this.view;if(!n)return;let r=n.state.facet(Ct);t==null||t.stopPropagation();let o=n.state.field(at),{input:a}=this;if(!a)return;let i=a.value.trim();if(!o.show||!i)return;let s=n.state.doc.line(o.lineFrom),u=n.state.doc.line(o.lineTo),c=s.from,d=u.to,f=n.state.sliceDoc(c,d),g=n.state.sliceDoc(0,c),m=n.state.sliceDoc(d);this.abortController=new AbortController,n.dispatch({effects:mt.of(!0)}),this.toggleLoading(!0);try{let w=await this.complete({prompt:i,selection:f,codeBefore:g,codeAfter:m,editorView:n,signal:this.abortController.signal});if(!n.state.field(at).show)return;if(!w||typeof w!="string")throw Error("Invalid completion result");n.dispatch({changes:{from:c,to:d,insert:w},effects:[ot.of({show:!1,lineFrom:0,lineTo:0}),Ht.of({from:c,to:c+w.length,oldCode:f,newCode:w}),mt.of(!1)]})}catch(w){if(w instanceof DOMException&&w.name==="AbortError")return;(h=r.onError)==null||h.call(r,w)}finally{this.cleanup(),this.toggleLoading(!1),n.focus()}});this.complete=t}toDOM(t){if(this.dom)return this.dom;this.view=t;let n=t.state.field(Wr),r=t.state.field(Vr),o=pe("div","cm-ai-input-container");this.inputContainer=o,this.dom=o;let a=pe("form","cm-ai-input-form");this.form=a,a.setAttribute("role","search"),a.setAttribute("aria-label","AI editing instructions"),a.addEventListener("submit",y=>y.preventDefault());let i=pe("input","cm-ai-input");this.input=i,a.append(i),i.placeholder="Editing instructions...",i.setAttribute("aria-label","AI editing instructions"),i.setAttribute("autocomplete","off"),i.setAttribute("spellcheck","true"),i.value=n.inputValue;let s=pe("div","cm-ai-loading-container");this.loadingContainer=s;let u=pe("div","cm-ai-loading-indicator");u.setAttribute("role","status"),u.setAttribute("aria-live","polite"),u.textContent="Generating";let c=pe("button","cm-ai-cancel-button");c.textContent="Cancel",c.setAttribute("aria-label","Cancel code generation"),c.addEventListener("click",this.onCancel),s.append(c,u);let d=pe("div","cm-ai-help-info");this.helpInfo=d;let f=d.appendChild(document.createElement("button"));f.className="cm-ai-help-info-button",f.textContent="Esc to close",f.addEventListener("click",this.onCancel);let g=pe("button","cm-ai-generate-button");g.textContent="\u23CE Generate",g.setAttribute("aria-label","Generate code"),g.addEventListener("click",this.handleSubmit),this.toggleLoading(r),n.shouldFocus&&requestAnimationFrame(()=>{i.value=n.inputValue,i.focus(),t.dispatch({effects:xt.of(!1)})}),m(i.value),i.addEventListener("input",w),i.addEventListener("keydown",this.onKeyDown);function m(y){d.replaceChildren(y?g:f)}let h="";function w(){t.dispatch({effects:St.of(i.value)});let y=i.value.trim();y!==h&&(h=y,m(y))}return o}toggleLoading(t){var n;this.inputContainer&&this.form&&this.loadingContainer&&this.helpInfo&&((n=this.inputContainer)==null||n.replaceChildren(this.form,t?this.loadingContainer:this.helpInfo))}updateDOM(t,n){return this.dom=t,this.input=t.querySelector(".cm-ai-input"),!0}cleanup(){var t,n,r;(t=this.abortController)==null||t.abort(),this.abortController=null,(n=this.dom)==null||n.remove(),(r=this.input)==null||r.remove(),this.dom=null,this.input=null}destroy(){this.cleanup()}};function us(e){if(!e.prompt)throw Error("prompt function is required");let t={...H,...e.keymaps};return[Ct.of(e),at,Wr,It,Vr,ss(),rs,$e.of([{key:t.showInput,run:$r}]),dt.highest([$e.of([{key:t.acceptEdit,run:Hr},{key:t.rejectEdit,run:qr}])]),ds,fs,ms,ps]}const ds=R.updateListener.of(e=>{let t=e.state.field(at);if(!t.show||!e.docChanged)return;let{lineFrom:n,lineTo:r}=t,o=!1;e.changes.iterChanges((a,i,s,u)=>{let c=e.state.doc.lineAt(a).number;if(c<n){let d=e.state.doc.lineAt(u).number-e.state.doc.lineAt(s).number;n+=d,r+=d,o=!0}else if(c<=r){let d=e.state.doc.lineAt(u).number-e.state.doc.lineAt(s).number;r+=d,o=!0}}),o&&e.view.dispatch({effects:[ot.of({show:!0,lineFrom:n,lineTo:r})]})}),fs=R.decorations.of(e=>{let t=e.state.field(It);return t?$.set([$.mark({class:"cm-new-code-line"}).range(t.from,t.to)]):$.none}),ms=R.decorations.compute([at],e=>{let t=e.field(at),n=e.facet(Ct),r=[];if(t.show){let o=t.lineFrom,a=t.lineTo;for(let i=o;i<=a;i++){let s=e.doc.line(i).from;r.push($.line({class:"cm-ai-selection"}).range(s)),i===o&&r.push($.widget({widget:new cs(n.prompt),side:-1}).range(s))}}return $.set(r)}),ps=Ye.define({create(e){return $.none},update(e,t){let n=t.state.field(It);return n?$.set([$.widget({widget:new ls(n.oldCode),block:!0}).range(n.from)]):$.none},provide:e=>R.decorations.from(e)});var gs=We(),F=Ma(gd(),1),Jn=()=>({entries:new Map}),{valueAtom:Yr,useActions:Xr}=Dr(Jn,{submit:(e,t)=>{let{cellIds:n,deleteCell:r,deleteManyCells:o,store:a}=t,i=a.get(rt),s=a.get(Ld),u=new Set(i.cellIds.inOrderIds.filter(f=>i.cellData[f].code.trim()==="")),c=new Map;for(let f of n){if(u.has(f)){c.set(f,{cellId:f,type:"simple"});continue}let g=i.cellRuntime[f],m=new Map;for(let w of Object.values(s)){let y=w.declaredBy.includes(f),v=w.usedBy.some(C=>!u.has(C));y&&v&&m.set(w.name,w.usedBy)}let h;g!=null&&g.runElapsedTimeMs&&g.runElapsedTimeMs>2e3&&(h=g.runElapsedTimeMs),m.size===0&&h===void 0?c.set(f,{cellId:f,type:"simple"}):c.set(f,{cellId:f,type:"expensive",executionDurationMs:h,defs:m})}let d=[...c.values()].every(f=>f.type==="simple");return c.size>0&&d?(c.size===1?r({cellId:[...c.values()][0].cellId}):o({cellIds:[...c.values()].map(f=>f.cellId)}),Jn()):{...e,entries:c}},clear:()=>Jn()});jn=function(){let e=wr(),{submit:t,clear:n}=Xr(),{entries:r}=ie(Yr),o=Oi(),a=Br();return(0,F.useMemo)(()=>({submit:i=>{t({cellIds:i,deleteCell:o,deleteManyCells:a,store:e})},clear:n,get idle(){return r.size===0},get shouldConfirmDelete(){return r.size>1}}),[e,t,n,r,o,a])},$i=function(e){let t=(0,gs.c)(16),n=ie(Yr),r=Xr(),o=Br(),a;t[0]!==e||t[1]!==n.entries?(a=n.entries.get(e),t[0]=e,t[1]=n.entries,t[2]=a):a=t[2];let i=a;if(!i){let d;return t[3]===Symbol.for("react.memo_cache_sentinel")?(d={isPending:!1},t[3]=d):d=t[3],d}if(n.entries.size!==1){let d;return t[4]===i?d=t[5]:(d={isPending:!0,shouldConfirmDelete:!1,...i},t[4]=i,t[5]=d),d}let s;t[6]!==r||t[7]!==o||t[8]!==n.entries?(s=()=>{o({cellIds:[...n.entries.values()].map(hs)}),r.clear()},t[6]=r,t[7]=o,t[8]=n.entries,t[9]=s):s=t[9];let u;t[10]===r?u=t[11]:(u=()=>r.clear(),t[10]=r,t[11]=u);let c;return t[12]!==i||t[13]!==s||t[14]!==u?(c={isPending:!0,...i,shouldConfirmDelete:!0,confirm:s,cancel:u},t[12]=i,t[13]=s,t[14]=u,t[15]=c):c=t[15],c};function hs(e){return e.cellId}async function bs(e){var s,u;let t=`
4
4
  ${e.codeBefore}
5
5
  <rewrite_this>
@@ -1 +1 @@
1
- import{s as U}from"./chunk-LvLJmgfZ.js";import{l as X,u as V}from"./useEvent-D91BmmQi.js";import{t as Y}from"./react-Bj1aDYRI.js";import{yi as Z}from"./cells-CFd8A4_A.js";import"./react-dom-CSu739Rf.js";import{t as O}from"./compiler-runtime-B3qBwwSJ.js";import{S as ee}from"./ai-model-dropdown-BToySVta.js";import{d as le,h as te,t as ie,u as ae}from"./useEventListener-DvoEXWke.js";import{b as oe,h as ne,x as re}from"./utils-CvI-39U6.js";import{t as de}from"./jsx-runtime-BqBOg78p.js";import"./fullscreen-eipL3i3Y.js";import"./popover-Bz_0Vkyf.js";import"./JsonOutput-B2v_Stn9.js";import"./download-BaGnGHOq.js";import"./dist-BrR4M-k3.js";import"./cjs-BRGiG41H.js";import"./main-B0OX4z33.js";import"./useNonce-DfoVjkkH.js";import{r as se}from"./requests-DIwGYs0l.js";import"./layout-KNg4OZ4V.js";import{t as pe}from"./useCellActionButton-CXkISThQ.js";import"./markdown-renderer-B1eFOa7V.js";import{i as me,t as he}from"./useNotebookActions-1Xqto4ts.js";import"./dist-CBSMxaO_.js";import"./dist-CpTFpfm_.js";import"./dist-B1U1kGCR.js";import"./dist-ChF5Ln9c.js";import"./dist-CPczQFlJ.js";import"./session-0B5NBztP.js";import"./purify.es-B9KxLTTS.js";import"./dates-CTxr0EqQ.js";import{n as ce}from"./useHotkey-TKvjHf1m.js";import"./share-DMwTZOTH.js";import"./utils-DCL4n9wx.js";import"./vega-loader.browser-C8wT63Va.js";import"./defaultLocale-BLUna9fQ.js";import"./defaultLocale-DzliDDTm.js";import"./chunk-5FQGJX7Z-D9iBG0F7.js";import"./html-to-image-CJxTFjQz.js";import{r as ye}from"./focus-DjmSWsDI.js";import"./react-resizable-panels.browser.esm-CV8-hvjx.js";import{a as ue,c as fe,i as L,l as z,n as be,o as J,r as ge,s as ke}from"./command-KARR7KMq.js";import{t as Q}from"./renderShortcut-CcFk3m01.js";import"./esm-CqWdmSnV.js";import"./name-cell-input-DdwASAQy.js";import"./multi-icon-NVkxesVZ.js";import"./dist-BQeNY9Zl.js";import"./dist-CXBpwk_w.js";import"./dist-DUHHizRG.js";import"./dist-D70Tz1Kr.js";import"./dist-BF6UNR6V.js";import"./dist-CsvFAFh9.js";import"./dist-DqVEVg0c.js";import"./dist-BlOtCkpT.js";import"./dist-C78V1LRz.js";import"./esm-DeiyaVAJ.js";var we=O(),Ce=U(Y(),1);function xe(e,l){let t=(0,we.c)(11),r;t[0]===l?r=t[1]:(r=new Z(l),t[0]=l,t[1]=r);let d=r,n;t[2]!==e||t[3]!==d?(n=()=>d.get(e),t[2]=e,t[3]=d,t[4]=n):n=t[4];let[m,k]=(0,Ce.useState)(n),i;t[5]!==e||t[6]!==d?(i=w=>{k(w),d.set(e,w)},t[5]=e,t[6]=d,t[7]=i):i=t[7];let u=i,h;return t[8]!==u||t[9]!==m?(h=[m,u],t[8]=u,t[9]=m,t[10]=h):h=t[10],h}var je=O(),Se=3;function ve(){let e=(0,je.c)(7),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];let[t,r]=xe("marimo:commands",l),d;e[1]!==t||e[2]!==r?(d=m=>{r(_e([m,...t]).slice(0,Se))},e[1]=t,e[2]=r,e[3]=d):d=e[3];let n;return e[4]!==t||e[5]!==d?(n={recentCommands:t,addRecentCommand:d},e[4]=t,e[5]=d,e[6]=n):n=e[6],n}function _e(e){return[...new Set(e)]}function W(e){return e.dropdown!==void 0}function T(e,l=""){return e.flatMap(t=>t.label?W(t)?T(t.dropdown,`${l+t.label} > `):{...t,label:l+t.label,additionalKeywords:t.additionalKeywords}:[])}var Ke=O();function He(){let e=(0,Ke.c)(75),[l,t]=re(),[r,d]=oe(),{saveAppConfig:n,saveUserConfig:m}=se(),k;e[0]!==m||e[1]!==t?(k=async p=>{await m({config:p}).then(()=>{t(c=>({...c,...p}))})},e[0]=m,e[1]=t,e[2]=k):k=e[2];let i=k,u;e[3]!==n||e[4]!==d?(u=async p=>{await n({config:p}).then(()=>{d(p)})},e[3]=n,e[4]=d,e[5]=u):u=e[5];let h=u,w;if(e[6]!==r||e[7]!==l.completion||e[8]!==l.display||e[9]!==l.keymap||e[10]!==h||e[11]!==i){let p;e[13]===r?p=e[14]:(p=B=>B!==r.width,e[13]=r,e[14]=p);let c;e[15]!==r||e[16]!==h?(c=B=>({label:`App config > Set width=${B}`,handle:()=>{h({...r,width:B})}}),e[15]=r,e[16]=h,e[17]=c):c=e[17];let K;e[18]!==l.display||e[19]!==i?(K={label:"Config > Set theme: dark",handle:()=>{i({display:{...l.display,theme:"dark"}})}},e[18]=l.display,e[19]=i,e[20]=K):K=e[20];let C;e[21]!==l.display||e[22]!==i?(C={label:"Config > Set theme: light",handle:()=>{i({display:{...l.display,theme:"light"}})}},e[21]=l.display,e[22]=i,e[23]=C):C=e[23];let H;e[24]!==l.display||e[25]!==i?(H={label:"Config > Set theme: system",handle:()=>{i({display:{...l.display,theme:"system"}})}},e[24]=l.display,e[25]=i,e[26]=H):H=e[26];let E=l.keymap.preset==="vim",A;e[27]!==l.keymap||e[28]!==i?(A=()=>{i({keymap:{...l.keymap,preset:"vim"}})},e[27]=l.keymap,e[28]=i,e[29]=A):A=e[29];let M;e[30]!==E||e[31]!==A?(M={label:"Config > Switch keymap to VIM",hidden:E,handle:A},e[30]=E,e[31]=A,e[32]=M):M=e[32];let N=l.keymap.preset==="default",x;e[33]!==l.keymap||e[34]!==i?(x=()=>{i({keymap:{...l.keymap,preset:"default"}})},e[33]=l.keymap,e[34]=i,e[35]=x):x=e[35];let f;e[36]!==N||e[37]!==x?(f={label:"Config > Switch keymap to default (current: VIM)",hidden:N,handle:x},e[36]=N,e[37]=x,e[38]=f):f=e[38];let j;e[39]!==l.completion||e[40]!==i?(j=()=>{i({completion:{...l.completion,copilot:!1}})},e[39]=l.completion,e[40]=i,e[41]=j):j=e[41];let S=l.completion.copilot!=="github",P;e[42]!==j||e[43]!==S?(P={label:"Config > Disable GitHub Copilot",handle:j,hidden:S},e[42]=j,e[43]=S,e[44]=P):P=e[44];let v;e[45]!==l.completion||e[46]!==i?(v=()=>{i({completion:{...l.completion,copilot:"github"}})},e[45]=l.completion,e[46]=i,e[47]=v):v=e[47];let G=l.completion.copilot==="github",$;e[48]!==v||e[49]!==G?($={label:"Config > Enable GitHub Copilot",handle:v,hidden:G},e[48]=v,e[49]=G,e[50]=$):$=e[50];let q=!l.display.reference_highlighting,_;e[51]!==l.display||e[52]!==i?(_=()=>{i({display:{...l.display,reference_highlighting:!1}})},e[51]=l.display,e[52]=i,e[53]=_):_=e[53];let b;e[54]!==q||e[55]!==_?(b={label:"Config > Disable reference highlighting",hidden:q,handle:_},e[54]=q,e[55]=_,e[56]=b):b=e[56];let y;e[57]!==l.display||e[58]!==i?(y=()=>{i({display:{...l.display,reference_highlighting:!0}})},e[57]=l.display,e[58]=i,e[59]=y):y=e[59];let D;e[60]!==l.display.reference_highlighting||e[61]!==y?(D={label:"Config > Enable reference highlighting",hidden:l.display.reference_highlighting,handle:y},e[60]=l.display.reference_highlighting,e[61]=y,e[62]=D):D=e[62];let a=l.display.cell_output==="above",o;e[63]!==l.display||e[64]!==i?(o=()=>{i({display:{...l.display,cell_output:"above"}})},e[63]=l.display,e[64]=i,e[65]=o):o=e[65];let F;e[66]!==a||e[67]!==o?(F={label:"Config > Set cell output area: above",hidden:a,handle:o},e[66]=a,e[67]=o,e[68]=F):F=e[68];let g=l.display.cell_output==="below",R;e[69]!==l.display||e[70]!==i?(R=()=>{i({display:{...l.display,cell_output:"below"}})},e[69]=l.display,e[70]=i,e[71]=R):R=e[71];let I;e[72]!==g||e[73]!==R?(I={label:"Config > Set cell output area: below",hidden:g,handle:R},e[72]=g,e[73]=R,e[74]=I):I=e[74],w=[...ee().filter(p).map(c),K,C,H,M,f,P,$,b,D,F,I].filter(Ae),e[6]=r,e[7]=l.completion,e[8]=l.display,e[9]=l.keymap,e[10]=h,e[11]=i,e[12]=w}else w=e[12];return w}function Ae(e){return!e.hidden}var Me=O(),s=U(de(),1),Ne=()=>{let e=(0,Me.c)(37),[l,t]=X(me),r=ce(),d=V(ye),n=V(ne),m;e[0]===d?m=e[1]:(m={cell:d},e[0]=d,e[1]=m);let k=pe(m).flat();k=T(k);let i=He(),u=he();u=[...T(u),...T(i)];let h=u.filter(De),w=le.keyBy(h,Fe),{recentCommands:p,addRecentCommand:c}=ve(),K;e[2]===p?K=e[3]:(K=new Set(p),e[2]=p,e[3]=K);let C=K,H;e[4]!==n||e[5]!==t?(H=a=>{te(n.getHotkey("global.commandPalette").key)(a)&&(a.preventDefault(),t(Re))},e[4]=n,e[5]=t,e[6]=H):H=e[6],ie(document,"keydown",H);let E;e[7]!==c||e[8]!==n||e[9]!==r||e[10]!==t?(E=(a,o)=>{let F=r[a];if(!F)return null;let g=n.getHotkey(a);return(0,s.jsxs)(J,{disabled:o.disabled,keywords:g.additionalKeywords,onSelect:()=>{c(a),t(!1),requestAnimationFrame(()=>{F()})},value:g.name,children:[(0,s.jsxs)("span",{children:[g.name,o.tooltip&&(0,s.jsx)("span",{className:"ml-2",children:o.tooltip})]}),(0,s.jsx)(z,{children:(0,s.jsx)(Q,{shortcut:g.key})})]},a)},e[7]=c,e[8]=n,e[9]=r,e[10]=t,e[11]=E):E=e[11];let A=E,M;e[12]!==c||e[13]!==n||e[14]!==t?(M=a=>{let{label:o,handle:F,props:g,hotkey:R,additionalKeywords:I}=a,B=g===void 0?{}:g;return(0,s.jsxs)(J,{disabled:B.disabled,keywords:I,onSelect:()=>{c(o),t(!1),requestAnimationFrame(()=>{F()})},value:o,children:[(0,s.jsxs)("span",{children:[o,B.tooltip&&(0,s.jsxs)("span",{className:"ml-2",children:["(",B.tooltip,")"]})]}),R&&(0,s.jsx)(z,{children:(0,s.jsx)(Q,{shortcut:n.getHotkey(R).key})})]},o)},e[12]=c,e[13]=n,e[14]=t,e[15]=M):M=e[15];let N=M,x=be,f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsx)(ue,{placeholder:"Type to search..."}),e[16]=f):f=e[16];let j=ke,S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=(0,s.jsx)(ge,{children:"No results found."}),e[17]=S):S=e[17];let P=p.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{heading:"Recently Used",children:p.map(a=>{let o=w[a];return ae(a)?A(a,{disabled:o==null?void 0:o.disabled,tooltip:o==null?void 0:o.tooltip}):o&&!W(o)?N({label:o.label,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip},additionalKeywords:o.additionalKeywords}):null})}),(0,s.jsx)(fe,{})]}),v=L,G=n.iterate().map(a=>{if(C.has(a))return null;let o=w[a];return A(a,{disabled:o==null?void 0:o.disabled,tooltip:o==null?void 0:o.tooltip})}),$=h.map(a=>C.has(a.label)?null:N({label:a.label,handle:a.handleHeadless||a.handle,props:{disabled:a.disabled,tooltip:a.tooltip},additionalKeywords:a.additionalKeywords})),q;e[18]!==C||e[19]!==N?(q=a=>C.has(a.label)?null:N({label:`Cell > ${a.label}`,handle:a.handleHeadless||a.handle,props:{disabled:a.disabled,tooltip:a.tooltip},additionalKeywords:a.additionalKeywords}),e[18]=C,e[19]=N,e[20]=q):q=e[20];let _=k.map(q),b;e[21]!==v||e[22]!==$||e[23]!==_||e[24]!==G?(b=(0,s.jsxs)(v,{heading:"Commands",children:[G,$,_]}),e[21]=v,e[22]=$,e[23]=_,e[24]=G,e[25]=b):b=e[25];let y;e[26]!==j||e[27]!==b||e[28]!==S||e[29]!==P?(y=(0,s.jsxs)(j,{children:[S,P,b]}),e[26]=j,e[27]=b,e[28]=S,e[29]=P,e[30]=y):y=e[30];let D;return e[31]!==x||e[32]!==l||e[33]!==t||e[34]!==y||e[35]!==f?(D=(0,s.jsxs)(x,{open:l,onOpenChange:t,children:[f,y]}),e[31]=x,e[32]=l,e[33]=t,e[34]=y,e[35]=f,e[36]=D):D=e[36],D};function De(e){return!e.hotkey}function Fe(e){return e.label}function Re(e){return!e}export{Ne as default};
1
+ import{s as U}from"./chunk-LvLJmgfZ.js";import{l as X,u as V}from"./useEvent-D91BmmQi.js";import{t as Y}from"./react-Bj1aDYRI.js";import{yi as Z}from"./cells-CFd8A4_A.js";import"./react-dom-CSu739Rf.js";import{t as O}from"./compiler-runtime-B3qBwwSJ.js";import{S as ee}from"./ai-model-dropdown-BToySVta.js";import{d as le,h as te,t as ie,u as ae}from"./useEventListener-DvoEXWke.js";import{b as oe,h as ne,x as re}from"./utils-CvI-39U6.js";import{t as de}from"./jsx-runtime-BqBOg78p.js";import"./fullscreen-eipL3i3Y.js";import"./popover-Bz_0Vkyf.js";import"./JsonOutput-B2v_Stn9.js";import"./download-BaGnGHOq.js";import"./dist-BrR4M-k3.js";import"./cjs-BRGiG41H.js";import"./main-B0OX4z33.js";import"./useNonce-DfoVjkkH.js";import{r as se}from"./requests-DIwGYs0l.js";import"./layout-B15A69L1.js";import{t as pe}from"./useCellActionButton-CXkISThQ.js";import"./markdown-renderer-B1eFOa7V.js";import{i as me,t as he}from"./useNotebookActions-gBMzsDzE.js";import"./dist-CBSMxaO_.js";import"./dist-CpTFpfm_.js";import"./dist-B1U1kGCR.js";import"./dist-ChF5Ln9c.js";import"./dist-CPczQFlJ.js";import"./session-0B5NBztP.js";import"./purify.es-B9KxLTTS.js";import"./dates-CTxr0EqQ.js";import{n as ce}from"./useHotkey-TKvjHf1m.js";import"./share-DMwTZOTH.js";import"./utils-DCL4n9wx.js";import"./vega-loader.browser-C8wT63Va.js";import"./defaultLocale-BLUna9fQ.js";import"./defaultLocale-DzliDDTm.js";import"./chunk-5FQGJX7Z-D9iBG0F7.js";import"./html-to-image-CJxTFjQz.js";import{r as ye}from"./focus-DjmSWsDI.js";import"./react-resizable-panels.browser.esm-CV8-hvjx.js";import{a as ue,c as fe,i as L,l as z,n as be,o as J,r as ge,s as ke}from"./command-KARR7KMq.js";import{t as Q}from"./renderShortcut-CcFk3m01.js";import"./esm-CqWdmSnV.js";import"./name-cell-input-DdwASAQy.js";import"./multi-icon-NVkxesVZ.js";import"./dist-BQeNY9Zl.js";import"./dist-CXBpwk_w.js";import"./dist-DUHHizRG.js";import"./dist-D70Tz1Kr.js";import"./dist-BF6UNR6V.js";import"./dist-CsvFAFh9.js";import"./dist-DqVEVg0c.js";import"./dist-BlOtCkpT.js";import"./dist-C78V1LRz.js";import"./esm-DeiyaVAJ.js";var we=O(),Ce=U(Y(),1);function xe(e,l){let t=(0,we.c)(11),r;t[0]===l?r=t[1]:(r=new Z(l),t[0]=l,t[1]=r);let d=r,n;t[2]!==e||t[3]!==d?(n=()=>d.get(e),t[2]=e,t[3]=d,t[4]=n):n=t[4];let[m,k]=(0,Ce.useState)(n),i;t[5]!==e||t[6]!==d?(i=w=>{k(w),d.set(e,w)},t[5]=e,t[6]=d,t[7]=i):i=t[7];let u=i,h;return t[8]!==u||t[9]!==m?(h=[m,u],t[8]=u,t[9]=m,t[10]=h):h=t[10],h}var je=O(),Se=3;function ve(){let e=(0,je.c)(7),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];let[t,r]=xe("marimo:commands",l),d;e[1]!==t||e[2]!==r?(d=m=>{r(_e([m,...t]).slice(0,Se))},e[1]=t,e[2]=r,e[3]=d):d=e[3];let n;return e[4]!==t||e[5]!==d?(n={recentCommands:t,addRecentCommand:d},e[4]=t,e[5]=d,e[6]=n):n=e[6],n}function _e(e){return[...new Set(e)]}function W(e){return e.dropdown!==void 0}function T(e,l=""){return e.flatMap(t=>t.label?W(t)?T(t.dropdown,`${l+t.label} > `):{...t,label:l+t.label,additionalKeywords:t.additionalKeywords}:[])}var Ke=O();function He(){let e=(0,Ke.c)(75),[l,t]=re(),[r,d]=oe(),{saveAppConfig:n,saveUserConfig:m}=se(),k;e[0]!==m||e[1]!==t?(k=async p=>{await m({config:p}).then(()=>{t(c=>({...c,...p}))})},e[0]=m,e[1]=t,e[2]=k):k=e[2];let i=k,u;e[3]!==n||e[4]!==d?(u=async p=>{await n({config:p}).then(()=>{d(p)})},e[3]=n,e[4]=d,e[5]=u):u=e[5];let h=u,w;if(e[6]!==r||e[7]!==l.completion||e[8]!==l.display||e[9]!==l.keymap||e[10]!==h||e[11]!==i){let p;e[13]===r?p=e[14]:(p=B=>B!==r.width,e[13]=r,e[14]=p);let c;e[15]!==r||e[16]!==h?(c=B=>({label:`App config > Set width=${B}`,handle:()=>{h({...r,width:B})}}),e[15]=r,e[16]=h,e[17]=c):c=e[17];let K;e[18]!==l.display||e[19]!==i?(K={label:"Config > Set theme: dark",handle:()=>{i({display:{...l.display,theme:"dark"}})}},e[18]=l.display,e[19]=i,e[20]=K):K=e[20];let C;e[21]!==l.display||e[22]!==i?(C={label:"Config > Set theme: light",handle:()=>{i({display:{...l.display,theme:"light"}})}},e[21]=l.display,e[22]=i,e[23]=C):C=e[23];let H;e[24]!==l.display||e[25]!==i?(H={label:"Config > Set theme: system",handle:()=>{i({display:{...l.display,theme:"system"}})}},e[24]=l.display,e[25]=i,e[26]=H):H=e[26];let E=l.keymap.preset==="vim",A;e[27]!==l.keymap||e[28]!==i?(A=()=>{i({keymap:{...l.keymap,preset:"vim"}})},e[27]=l.keymap,e[28]=i,e[29]=A):A=e[29];let M;e[30]!==E||e[31]!==A?(M={label:"Config > Switch keymap to VIM",hidden:E,handle:A},e[30]=E,e[31]=A,e[32]=M):M=e[32];let N=l.keymap.preset==="default",x;e[33]!==l.keymap||e[34]!==i?(x=()=>{i({keymap:{...l.keymap,preset:"default"}})},e[33]=l.keymap,e[34]=i,e[35]=x):x=e[35];let f;e[36]!==N||e[37]!==x?(f={label:"Config > Switch keymap to default (current: VIM)",hidden:N,handle:x},e[36]=N,e[37]=x,e[38]=f):f=e[38];let j;e[39]!==l.completion||e[40]!==i?(j=()=>{i({completion:{...l.completion,copilot:!1}})},e[39]=l.completion,e[40]=i,e[41]=j):j=e[41];let S=l.completion.copilot!=="github",P;e[42]!==j||e[43]!==S?(P={label:"Config > Disable GitHub Copilot",handle:j,hidden:S},e[42]=j,e[43]=S,e[44]=P):P=e[44];let v;e[45]!==l.completion||e[46]!==i?(v=()=>{i({completion:{...l.completion,copilot:"github"}})},e[45]=l.completion,e[46]=i,e[47]=v):v=e[47];let G=l.completion.copilot==="github",$;e[48]!==v||e[49]!==G?($={label:"Config > Enable GitHub Copilot",handle:v,hidden:G},e[48]=v,e[49]=G,e[50]=$):$=e[50];let q=!l.display.reference_highlighting,_;e[51]!==l.display||e[52]!==i?(_=()=>{i({display:{...l.display,reference_highlighting:!1}})},e[51]=l.display,e[52]=i,e[53]=_):_=e[53];let b;e[54]!==q||e[55]!==_?(b={label:"Config > Disable reference highlighting",hidden:q,handle:_},e[54]=q,e[55]=_,e[56]=b):b=e[56];let y;e[57]!==l.display||e[58]!==i?(y=()=>{i({display:{...l.display,reference_highlighting:!0}})},e[57]=l.display,e[58]=i,e[59]=y):y=e[59];let D;e[60]!==l.display.reference_highlighting||e[61]!==y?(D={label:"Config > Enable reference highlighting",hidden:l.display.reference_highlighting,handle:y},e[60]=l.display.reference_highlighting,e[61]=y,e[62]=D):D=e[62];let a=l.display.cell_output==="above",o;e[63]!==l.display||e[64]!==i?(o=()=>{i({display:{...l.display,cell_output:"above"}})},e[63]=l.display,e[64]=i,e[65]=o):o=e[65];let F;e[66]!==a||e[67]!==o?(F={label:"Config > Set cell output area: above",hidden:a,handle:o},e[66]=a,e[67]=o,e[68]=F):F=e[68];let g=l.display.cell_output==="below",R;e[69]!==l.display||e[70]!==i?(R=()=>{i({display:{...l.display,cell_output:"below"}})},e[69]=l.display,e[70]=i,e[71]=R):R=e[71];let I;e[72]!==g||e[73]!==R?(I={label:"Config > Set cell output area: below",hidden:g,handle:R},e[72]=g,e[73]=R,e[74]=I):I=e[74],w=[...ee().filter(p).map(c),K,C,H,M,f,P,$,b,D,F,I].filter(Ae),e[6]=r,e[7]=l.completion,e[8]=l.display,e[9]=l.keymap,e[10]=h,e[11]=i,e[12]=w}else w=e[12];return w}function Ae(e){return!e.hidden}var Me=O(),s=U(de(),1),Ne=()=>{let e=(0,Me.c)(37),[l,t]=X(me),r=ce(),d=V(ye),n=V(ne),m;e[0]===d?m=e[1]:(m={cell:d},e[0]=d,e[1]=m);let k=pe(m).flat();k=T(k);let i=He(),u=he();u=[...T(u),...T(i)];let h=u.filter(De),w=le.keyBy(h,Fe),{recentCommands:p,addRecentCommand:c}=ve(),K;e[2]===p?K=e[3]:(K=new Set(p),e[2]=p,e[3]=K);let C=K,H;e[4]!==n||e[5]!==t?(H=a=>{te(n.getHotkey("global.commandPalette").key)(a)&&(a.preventDefault(),t(Re))},e[4]=n,e[5]=t,e[6]=H):H=e[6],ie(document,"keydown",H);let E;e[7]!==c||e[8]!==n||e[9]!==r||e[10]!==t?(E=(a,o)=>{let F=r[a];if(!F)return null;let g=n.getHotkey(a);return(0,s.jsxs)(J,{disabled:o.disabled,keywords:g.additionalKeywords,onSelect:()=>{c(a),t(!1),requestAnimationFrame(()=>{F()})},value:g.name,children:[(0,s.jsxs)("span",{children:[g.name,o.tooltip&&(0,s.jsx)("span",{className:"ml-2",children:o.tooltip})]}),(0,s.jsx)(z,{children:(0,s.jsx)(Q,{shortcut:g.key})})]},a)},e[7]=c,e[8]=n,e[9]=r,e[10]=t,e[11]=E):E=e[11];let A=E,M;e[12]!==c||e[13]!==n||e[14]!==t?(M=a=>{let{label:o,handle:F,props:g,hotkey:R,additionalKeywords:I}=a,B=g===void 0?{}:g;return(0,s.jsxs)(J,{disabled:B.disabled,keywords:I,onSelect:()=>{c(o),t(!1),requestAnimationFrame(()=>{F()})},value:o,children:[(0,s.jsxs)("span",{children:[o,B.tooltip&&(0,s.jsxs)("span",{className:"ml-2",children:["(",B.tooltip,")"]})]}),R&&(0,s.jsx)(z,{children:(0,s.jsx)(Q,{shortcut:n.getHotkey(R).key})})]},o)},e[12]=c,e[13]=n,e[14]=t,e[15]=M):M=e[15];let N=M,x=be,f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsx)(ue,{placeholder:"Type to search..."}),e[16]=f):f=e[16];let j=ke,S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=(0,s.jsx)(ge,{children:"No results found."}),e[17]=S):S=e[17];let P=p.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{heading:"Recently Used",children:p.map(a=>{let o=w[a];return ae(a)?A(a,{disabled:o==null?void 0:o.disabled,tooltip:o==null?void 0:o.tooltip}):o&&!W(o)?N({label:o.label,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip},additionalKeywords:o.additionalKeywords}):null})}),(0,s.jsx)(fe,{})]}),v=L,G=n.iterate().map(a=>{if(C.has(a))return null;let o=w[a];return A(a,{disabled:o==null?void 0:o.disabled,tooltip:o==null?void 0:o.tooltip})}),$=h.map(a=>C.has(a.label)?null:N({label:a.label,handle:a.handleHeadless||a.handle,props:{disabled:a.disabled,tooltip:a.tooltip},additionalKeywords:a.additionalKeywords})),q;e[18]!==C||e[19]!==N?(q=a=>C.has(a.label)?null:N({label:`Cell > ${a.label}`,handle:a.handleHeadless||a.handle,props:{disabled:a.disabled,tooltip:a.tooltip},additionalKeywords:a.additionalKeywords}),e[18]=C,e[19]=N,e[20]=q):q=e[20];let _=k.map(q),b;e[21]!==v||e[22]!==$||e[23]!==_||e[24]!==G?(b=(0,s.jsxs)(v,{heading:"Commands",children:[G,$,_]}),e[21]=v,e[22]=$,e[23]=_,e[24]=G,e[25]=b):b=e[25];let y;e[26]!==j||e[27]!==b||e[28]!==S||e[29]!==P?(y=(0,s.jsxs)(j,{children:[S,P,b]}),e[26]=j,e[27]=b,e[28]=S,e[29]=P,e[30]=y):y=e[30];let D;return e[31]!==x||e[32]!==l||e[33]!==t||e[34]!==y||e[35]!==f?(D=(0,s.jsxs)(x,{open:l,onOpenChange:t,children:[f,y]}),e[31]=x,e[32]=l,e[33]=t,e[34]=y,e[35]=f,e[36]=D):D=e[36],D};function De(e){return!e.hotkey}function Fe(e){return e.label}function Re(e){return!e}export{Ne as default};