@marimo-team/frontend 0.20.3-dev89 → 0.20.3-dev90
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/{cell-editor-B05zgqpc.js → cell-editor-D8xaLLzF.js} +1 -1
- package/dist/assets/{command-palette-Dy_ePPb-.js → command-palette-BkMYWFHq.js} +1 -1
- package/dist/assets/{edit-page-CX7DCA4M.js → edit-page-DXQa188q.js} +3 -3
- package/dist/assets/{index-CRsKr5CB.js → index-BAp5idqc.js} +2 -2
- package/dist/assets/layout-DQyAaEMt.js +5 -0
- package/dist/assets/{panels-CKmNYbiF.js → panels-CeS0F13O.js} +1 -1
- package/dist/assets/{run-page-yn4JEZ_r.js → run-page-8S9mxjlL.js} +1 -1
- package/dist/assets/{scratchpad-panel-BmBKvZA7.js → scratchpad-panel-DzOWeiXN.js} +1 -1
- package/dist/assets/{useNotebookActions-P1v5BUET.js → useNotebookActions-CGdPh6jF.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/components/editor/output/console/ConsoleOutput.tsx +28 -12
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +150 -8
- package/src/hooks/useInputHistory.ts +1 -1
- package/dist/assets/layout-DKgHttkT.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loro_wasm_bg-D0L2fcEg.js","./loro_wasm_bg-DNKZeVyM.js","./chunk-LvLJmgfZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var ud=Object.defineProperty;var Oa=oe=>{throw TypeError(oe)};var dd=(oe,z,he)=>z in oe?ud(oe,z,{enumerable:!0,configurable:!0,writable:!0,value:he}):oe[z]=he;var h=(oe,z,he)=>dd(oe,typeof z!="symbol"?z+"":z,he),fd=(oe,z,he)=>z.has(oe)||Oa("Cannot "+he);var Da=(oe,z,he)=>(fd(oe,z,"read from private field"),he?he.call(oe):z.get(oe)),_a=(oe,z,he)=>z.has(oe)?Oa("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(oe):z.set(oe,he);import{s as Ua}from"./chunk-LvLJmgfZ.js";import{d as Ba,f as yr,i as Z,l as En,n as le,p as Dt,s as kn,u as re}from"./useEvent-WUlsM6MC.js";import{t as md}from"./react-Bj1aDYRI.js";import{$ as wr,B as pd,Ct as hd,Dt as gd,En as bd,Ft as yd,H as ja,Ht as wd,Ir as vr,It as Pa,Jt as Ma,Kt as Er,Mn as vd,Nn as Ed,P as kd,Pn as Nd,Qt as Cd,Rr as Sd,St as xd,T as Nn,Ur as Id,Ut as kr,V as Ra,W as Ga,Wr as Ja,Xt as Td,Zt as Ad,_i as Cn,a as Wa,ar as Fd,b as Ze,bt as Nr,ci as Ld,d as Va,et as Od,fn as Dd,gn as _d,h as Cr,hn as Ud,ht as Bd,in as jd,jr as Pd,ln as Md,lt as Rd,mn as Gd,o as Jd,oi as $a,qt as Ha,st as Wd,tn as Sn,u as qa,wt as _t,xt as xn,yn as Sr,yt as Vd,z as za,zn as $d,zr as Hd,__tla as qd}from"./cells-DVXjWBHI.js";import{P as Ka,R as zd,k as Kd,w as Yd}from"./zod-H_cgTO0M.js";import{t as Re}from"./compiler-runtime-B3qBwwSJ.js";import{C as Xd,f as Qd,m as Zd,p as ef,t as tf,v as nf}from"./ai-model-dropdown-D0ZKojfQ.js";import{a as Ya,c as xr,f as Ir,h as rf,m as ge,t as of}from"./useEventListener-CjXriKgk.js";import{t as Ut}from"./invariant-awXiPaF0.js";import{S as Tr,h as Xa,i as af,m as sf,o as lf,p as Qa,s as Za}from"./utils-CORJ8yYa.js";import{S as cf,d as uf,h as at,o as df,r as ei,x as bt,y as ti}from"./config-vle9v48l.js";import{a as ff,n as ni,t as mf}from"./switch-BQaT8a2B.js";import{n as pf}from"./globals-BAAGjaoU.js";import{t as hf}from"./ErrorBoundary-dVj6GVNE.js";import{t as gf}from"./jsx-runtime-CP2fAiZX.js";import{r as Ar,t as it}from"./button-BmOH9agK.js";import{t as st}from"./cn-d_A4rA-x.js";import{Bt as yt,Ct as ri,Dt as bf,E as yf,Ft as In,H as oi,Ht as Bt,I as wf,J as l,Jt as me,Kt as vf,Lt as Tn,Mt as Ef,P as kf,St as Je,V as ai,Vt as Fr,Wt as lt,Yt as $e,Zt as jt,_ as Nf,a as Cf,at as j,bt as Sf,ct as He,en as An,ft as xf,it as If,lt as Fn,m as Tf,pt as Af,rt as q,st as Ff,vt as Lf,w as Of,wt as Df,yt as _f,zt as Uf}from"./dist-DUY6xZX8.js";import{C as Bf,D as jf,_ as Pf,a as Mf,c as Rf,n as Lr,r as Gf,v as Jf,x as Wf,y as Vf}from"./dist-CU-Ty5ht.js";import{w as $f,__tla as Hf}from"./JsonOutput-DgTX3wDl.js";import{c as ii,n as qf}from"./once-DRC4SgqY.js";import{t as Or}from"./createReducer-BcTiTw8T.js";import{a as zf,c as Kf,f as Ln,h as Yf,i as Xf,l as Pt,n as si,o as Qf,t as Zf}from"./dist-D89dID68.js";import{t as em}from"./main-Cmx6WhDY.js";import{r as Mt,t as tm}from"./requests-DZy_SQ_v.js";import{t as nm}from"./createLucideIcon-BvP5LBIs.js";import{f as rm,r as li,t as om,__tla as am}from"./layout-
|
|
2
|
+
var ud=Object.defineProperty;var Oa=oe=>{throw TypeError(oe)};var dd=(oe,z,he)=>z in oe?ud(oe,z,{enumerable:!0,configurable:!0,writable:!0,value:he}):oe[z]=he;var h=(oe,z,he)=>dd(oe,typeof z!="symbol"?z+"":z,he),fd=(oe,z,he)=>z.has(oe)||Oa("Cannot "+he);var Da=(oe,z,he)=>(fd(oe,z,"read from private field"),he?he.call(oe):z.get(oe)),_a=(oe,z,he)=>z.has(oe)?Oa("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(oe):z.set(oe,he);import{s as Ua}from"./chunk-LvLJmgfZ.js";import{d as Ba,f as yr,i as Z,l as En,n as le,p as Dt,s as kn,u as re}from"./useEvent-WUlsM6MC.js";import{t as md}from"./react-Bj1aDYRI.js";import{$ as wr,B as pd,Ct as hd,Dt as gd,En as bd,Ft as yd,H as ja,Ht as wd,Ir as vr,It as Pa,Jt as Ma,Kt as Er,Mn as vd,Nn as Ed,P as kd,Pn as Nd,Qt as Cd,Rr as Sd,St as xd,T as Nn,Ur as Id,Ut as kr,V as Ra,W as Ga,Wr as Ja,Xt as Td,Zt as Ad,_i as Cn,a as Wa,ar as Fd,b as Ze,bt as Nr,ci as Ld,d as Va,et as Od,fn as Dd,gn as _d,h as Cr,hn as Ud,ht as Bd,in as jd,jr as Pd,ln as Md,lt as Rd,mn as Gd,o as Jd,oi as $a,qt as Ha,st as Wd,tn as Sn,u as qa,wt as _t,xt as xn,yn as Sr,yt as Vd,z as za,zn as $d,zr as Hd,__tla as qd}from"./cells-DVXjWBHI.js";import{P as Ka,R as zd,k as Kd,w as Yd}from"./zod-H_cgTO0M.js";import{t as Re}from"./compiler-runtime-B3qBwwSJ.js";import{C as Xd,f as Qd,m as Zd,p as ef,t as tf,v as nf}from"./ai-model-dropdown-D0ZKojfQ.js";import{a as Ya,c as xr,f as Ir,h as rf,m as ge,t as of}from"./useEventListener-CjXriKgk.js";import{t as Ut}from"./invariant-awXiPaF0.js";import{S as Tr,h as Xa,i as af,m as sf,o as lf,p as Qa,s as Za}from"./utils-CORJ8yYa.js";import{S as cf,d as uf,h as at,o as df,r as ei,x as bt,y as ti}from"./config-vle9v48l.js";import{a as ff,n as ni,t as mf}from"./switch-BQaT8a2B.js";import{n as pf}from"./globals-BAAGjaoU.js";import{t as hf}from"./ErrorBoundary-dVj6GVNE.js";import{t as gf}from"./jsx-runtime-CP2fAiZX.js";import{r as Ar,t as it}from"./button-BmOH9agK.js";import{t as st}from"./cn-d_A4rA-x.js";import{Bt as yt,Ct as ri,Dt as bf,E as yf,Ft as In,H as oi,Ht as Bt,I as wf,J as l,Jt as me,Kt as vf,Lt as Tn,Mt as Ef,P as kf,St as Je,V as ai,Vt as Fr,Wt as lt,Yt as $e,Zt as jt,_ as Nf,a as Cf,at as j,bt as Sf,ct as He,en as An,ft as xf,it as If,lt as Fn,m as Tf,pt as Af,rt as q,st as Ff,vt as Lf,w as Of,wt as Df,yt as _f,zt as Uf}from"./dist-DUY6xZX8.js";import{C as Bf,D as jf,_ as Pf,a as Mf,c as Rf,n as Lr,r as Gf,v as Jf,x as Wf,y as Vf}from"./dist-CU-Ty5ht.js";import{w as $f,__tla as Hf}from"./JsonOutput-DgTX3wDl.js";import{c as ii,n as qf}from"./once-DRC4SgqY.js";import{t as Or}from"./createReducer-BcTiTw8T.js";import{a as zf,c as Kf,f as Ln,h as Yf,i as Xf,l as Pt,n as si,o as Qf,t as Zf}from"./dist-D89dID68.js";import{t as em}from"./main-Cmx6WhDY.js";import{r as Mt,t as tm}from"./requests-DZy_SQ_v.js";import{t as nm}from"./createLucideIcon-BvP5LBIs.js";import{f as rm,r as li,t as om,__tla as am}from"./layout-DQyAaEMt.js";import{M as im,O as sm,a as ci,c as lm,f as cm,k as ui,n as um,o as dm,r as di,s as fm,w as mm}from"./add-cell-with-ai-YgztdOJ9.js";import{t as pm}from"./x-yqLqiq5Q.js";import{r as hm,s as gm,u as bm}from"./download-CNypwy8-.js";import{t as ym}from"./circle-check-CceJVe3L.js";import{r as wm,t as vm}from"./types-DmqhedDv.js";import{n as Em}from"./spinner-Cg6xI4rq.js";import{t as fi}from"./save-BShTD2ty.js";import{I as mi,P as km}from"./input-CRB-lq4Q.js";import{a as Nm,i as Cm,n as pi}from"./state-ejdaxMKR.js";import{t as Sm}from"./preload-helper-y72bE5iF.js";import{t as xm}from"./Deferred-CfyqLOPG.js";import{t as ct}from"./use-toast-BtZldTi5.js";import{n as Ye}from"./paths-BVwhPRFT.js";import{t as Im}from"./session-BQVN1Kxg.js";import{r as Tm}from"./useTheme-0tqyqYah.js";import{t as On}from"./tooltip-D7xdZcKW.js";import{c as hi,i as gi,n as bi,r as Am}from"./dialog-DxCG9U2G.js";import{O as Fm}from"./usePress-C7hs6zHi.js";import{a as Lm,r as Om,t as Dm}from"./popover-2GpKY98n.js";import{n as yi}from"./ImperativeModal-Upm6NvJ2.js";import{r as _m}from"./errors-iwK4b4VF.js";import{t as Um}from"./copy-hG3KkB-h.js";import{t as X}from"./extends-CeSFM22p.js";import{t as Rt}from"./objectWithoutPropertiesLoose-BkUn3I0-.js";import{t as Bm}from"./kbd-CNdD3jWa.js";import{a as Dr}from"./useInstallPackage-z6g4hGCr.js";import{a as jm,o as Pm}from"./cell-link-zwx6SduJ.js";import{n as Mm}from"./useAsyncData-D89z7Kpl.js";import{a as Rm,o as wi,r as Gm,s as vi,t as Jm}from"./command-COYC8fga.js";import{r as Wm}from"./html-to-image-Din4blht.js";import{a as Vm}from"./focus-C2gi0jxY.js";import{a as Ei}from"./renderShortcut-CMdaUbHS.js";import{t as _r}from"./label-CGS9p44y.js";import{n as Ur,t as ki}from"./useDeleteCell-fYxNdCgY.js";import{n as wt}from"./esm-DYDEu0Nq.js";import{n as $m,t as Hm}from"./icons-CHolxgW2.js";import{t as Ni}from"./dist-DU2EJ7el.js";import{t as qm}from"./useSplitCell-CNL377K-.js";import{co as zm,do as Br,fo as Km,ft as Ym,go as vt,ho as Ci,lo as jr,mo as Si,oo as Xm,po as Qm,so as xi,uo as Ii,__tla as Zm}from"./loro_wasm_bg-DNKZeVyM.js";import{t as ep}from"./ws-Sb1KIggW.js";import{n as Ti,t as Pr}from"./useInterval-C2RcswPt.js";let Dn,Mr,Ai,Rr,ut,Gr,be,Gt,Jt,Fi,Li,Oi,Di,_i,_n,Ui,Un,Bi,Bn,tp=Promise.all([(()=>{try{return qd}catch{}})(),(()=>{try{return Hf}catch{}})(),(()=>{try{return am}catch{}})(),(()=>{try{return Zm}catch{}})()]).then(async()=>{var wn,La,we,ve,Ee,ke,Ne,Ce,Se,xe,Ie,Te,Ae,Fe,Le,Oe,De,_e,Ue,Be,je;var oe=nm("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 z={showInput:"Mod-l",acceptEdit:"Mod-y",rejectEdit:"Mod-u"};var he=300;const kt=Bt.define({combine:e=>An(e,{onError:console.error,inputDebounceTime:he,keymaps:z},{onError:(t,n)=>t&&n,inputDebounceTime:(t,n)=>t&&n,keymaps:(t,n)=>t&&n})}),et=me.define(),tt=$e.define({create(){return{show:!1,lineFrom:0,lineTo:0}},update(e,t){for(let n of t.effects)if(n.is(et))return n.value;return e}}),Nt=me.define(),Ct=me.define(),Wr=$e.define({create(){return{shouldFocus:!1,inputValue:""}},update(e,t){let n=e;for(let r of t.effects)r.is(Nt)&&(n={...n,inputValue:r.value}),r.is(Ct)&&(n={...n,shouldFocus:r.value});return n}}),Wt=me.define(),St=$e.define({create(){return null},update(e,t){for(let n of t.effects)if(n.is(Wt))return n.value;return e}}),dt=me.define(),Vr=$e.define({create(){return!1},update(e,t){for(let n of t.effects)if(n.is(dt))return n.value;return e}});var ji=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<ji)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:[et.of({show:!0,lineFrom:i,lineTo:s}),Ct.of(!0),Nt.of("")],selection:yt.cursor(o.from)}),!0},Hr=e=>e.state.field(St)?(e.dispatch({effects:[Wt.of(null),et.of({show:!1,lineFrom:0,lineTo:0}),Ct.of(!1),Nt.of(""),dt.of(!1)]}),!0):!1,qr=e=>{let t=e.state.field(St);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[Wt.of(null),et.of({show:!1,lineFrom:0,lineTo:0}),Ct.of(!1),Nt.of(""),dt.of(!1)]}),!0):!1};var jn={mac:"\u2318",windows:"\u229E Win",default:"Ctrl"};function Pi(){return navigator.platform.startsWith("Mac")?jn.mac:navigator.platform.startsWith("Win")?jn.windows:jn.default}function Pn(e){return e.replace("Mod",Pi()).replace("-"," ").toUpperCase()}function ce(e,t){let n=document.createElement(e);return n.className=t,n}function Mi(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 Vt=$e.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(r=>r.is($t));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),$t=me.define();function Ri(e,t){let n=e.state.selection.main.head,r=[],o=q.widget({widget:new Gi(t),side:1});return r.push(o.range(n)),q.set(r)}var Gi=class extends Fn{constructor(t){super();h(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}},Ji=class{constructor(e){h(this,"cache",new Map);h(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()})}},Wi=(e,t)=>He.fromClass(class{constructor(){h(this,"abortController",null);h(this,"cache");this.cache=new Ji(t.cacheTimeout??1e3)}async update(n){var i,s,c,u,d;if(!n.docChanged||((s=(i=t.events)==null?void 0:i.beforeSuggestionFetch)==null?void 0:s.call(i,n.view))===!1)return;(c=this.abortController)==null||c.abort(),this.abortController=new AbortController;let r=n.state.doc,o=r.toString(),a=this.cache.get(o);if(a){n.view.dispatch({effects:$t.of({text:a,doc:r})});return}try{let f=await e(n.state,this.abortController.signal,n.view);if(this.abortController.signal.aborted||((d=(u=t.events)==null?void 0:u.shouldShowSuggestion)==null?void 0:d.call(u,n.view,f))===!1)return;this.cache.set(o,f),n.view.dispatch({effects:$t.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()}}),Vi=He.fromClass(class{constructor(){h(this,"decorations");this.decorations=q.none}update(e){var n;let t=(n=e.state.field(Vt))==null?void 0:n.suggestion;if(!t){this.decorations=q.none;return}this.decorations=Ri(e.view,t)}},{decorations:e=>e.decorations});function $i(e,t,n,r){return{...e.changeByRange(o=>{if(o===e.selection.main)return{changes:{from:n,to:r,insert:t},range:yt.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:yt.cursor(o.from-a+t.length)}}),userEvent:"input.complete"}}var Hi=e=>{var r,o,a;let t=(r=e.state.field(Vt))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Mn);return e.dispatch({...$i(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(Vt))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Mn);return e.dispatch({effects:$t.of({text:null,doc:e.state.doc})}),(a=(o=n.events)==null?void 0:o.onSuggestionRejected)==null||a.call(o,e,t),!0},qi=Je.of([{key:"Tab",run:Hi},{key:"Escape",run:zr}]),Mn=Bt.define({combine:e=>e.at(-1)});function Kr(e){let{delay:t=500,includeKeymap:n=!0}=e,r=Mi(e.fetchFn,t);return[Vt,Mn.of(e),Wi(r,e),Vi,n?qi:[]]}const zi=j.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 Ki(e){var o,a;let t=e.state.facet(kt),n={...z,...t.keymaps},r=ce("div","cm-ai-tooltip").appendChild(ce("div","cm-ai-tooltip-button"));return r.innerHTML=`<span>Edit <span class="hotkey">${Pn(n.showInput)}</span></span>`,(o=r.querySelector("span"))==null||o.addEventListener("mousedown",i=>{i.stopPropagation(),i.button===0&&i.preventDefault()}),(a=r.querySelector("span"))==null||a.addEventListener("click",i=>{i.preventDefault(),$r(e)}),r}const Rn=Bt.define({combine(e){return An(e,{render:Ki,hideOnBlur:!1})}}),Yi=He.fromClass((La=class{constructor(e){h(this,"view");h(this,"suppress");h(this,"dom");h(this,"mousedown",()=>{this.suppress=!0});h(this,"mouseup",()=>{this.suppress=!1,this.display(this.view)});h(this,"scroll",()=>{this.display(this.view)});h(this,"windowScroll",()=>{this.display(this.view)});_a(this,wn,e=>{var n;let t=e.state.selection.ranges.find(r=>!r.empty);if(t&&!this.suppress){let r=e.coordsAtPos(t.from);if(!r)return;let o=e.dom.getBoundingClientRect(),a=(n=e.dom.parentElement)==null?void 0:n.getBoundingClientRect(),i=r.top>=o.top&&r.top<=o.bottom&&r.left>=o.left&&r.left<=o.right,s=!a||r.top>=a.top&&r.top<=a.bottom&&r.left>=a.left&&r.left<=a.right;if(!i||!s){this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true");return}this.dom.style.display="flex",this.dom.setAttribute("aria-hidden","false");let c=this.dom.getBoundingClientRect(),u=o.width-c.width,d=Math.min(r.left,u),f=r.top-c.height;f=a?Math.max(a.y,f):f,this.dom.style.left=`${d}px`,this.dom.style.top=`${f}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(Rn);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(tt).show){this.dom.style.display="none";return}if(e.state.facet(Rn).hideOnBlur&&!e.hasFocus){this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true");return}e.requestMeasure({read:Da(this,wn)})}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()}},wn=new WeakMap,La));var Xi=j.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 Qi(){return[Yi,Xi]}var Zi=class extends Fn{constructor(t){super();h(this,"oldCode");this.oldCode=t}toDOM(t){let n=ce("div","cm-old-code-container");n.setAttribute("role","region"),n.setAttribute("aria-label","Previous code version");let r=ce("div","cm-old-code cm-line");r.textContent=this.oldCode;let o=ce("div","cm-floating-buttons"),a=t.state.facet(kt),i={...z,...a.keymaps},s=ce("button","cm-floating-button cm-floating-accept");s.innerHTML=`<span class="hotkey">${Pn(i.acceptEdit)}</span> Accept`,s.setAttribute("aria-label","Accept changes"),s.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),t.focus(),Hr(t)});let c=ce("button","cm-floating-button cm-floating-reject");return c.innerHTML=`<span class="hotkey">${Pn(i.rejectEdit)}</span> Reject`,c.setAttribute("aria-label","Reject changes"),c.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),t.focus(),qr(t)}),o.append(s,c),n.append(r,o),n}updateDOM(t,n){return!0}},es=class extends Fn{constructor(t){super();h(this,"complete");h(this,"abortController",null);h(this,"dom",null);h(this,"input",null);h(this,"loadingContainer",null);h(this,"helpInfo",null);h(this,"inputContainer",null);h(this,"form",null);h(this,"view",null);h(this,"onKeyDown",async t=>{t.key==="Enter"&&!t.shiftKey?(t.preventDefault(),await this.handleSubmit()):t.key==="Escape"&&this.onCancel()});h(this,"onCancel",()=>{this.cleanup();let t=this.view;t&&(t.dispatch({effects:[et.of({show:!1,lineFrom:0,lineTo:0}),dt.of(!1)]}),t.focus())});h(this,"handleSubmit",async t=>{var g;let n=this.view;if(!n)return;let r=n.state.facet(kt);t==null||t.stopPropagation();let o=n.state.field(tt),{input:a}=this;if(!a)return;let i=a.value.trim();if(!o.show||!i)return;let s=n.state.doc.line(o.lineFrom),c=n.state.doc.line(o.lineTo),u=s.from,d=c.to,f=n.state.sliceDoc(u,d),p=n.state.sliceDoc(0,u),m=n.state.sliceDoc(d);this.abortController=new AbortController,n.dispatch({effects:dt.of(!0)}),this.toggleLoading(!0);try{let w=await this.complete({prompt:i,selection:f,codeBefore:p,codeAfter:m,editorView:n,signal:this.abortController.signal});if(!n.state.field(tt).show)return;if(!w||typeof w!="string")throw Error("Invalid completion result");n.dispatch({changes:{from:u,to:d,insert:w},effects:[et.of({show:!1,lineFrom:0,lineTo:0}),Wt.of({from:u,to:u+w.length,oldCode:f,newCode:w}),dt.of(!1)]})}catch(w){if(w instanceof DOMException&&w.name==="AbortError")return;(g=r.onError)==null||g.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=ce("div","cm-ai-input-container");this.inputContainer=o,this.dom=o;let a=ce("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=ce("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=ce("div","cm-ai-loading-container");this.loadingContainer=s;let c=ce("div","cm-ai-loading-indicator");c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.textContent="Generating";let u=ce("button","cm-ai-cancel-button");u.textContent="Cancel",u.setAttribute("aria-label","Cancel code generation"),u.addEventListener("click",this.onCancel),s.append(u,c);let d=ce("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 p=ce("button","cm-ai-generate-button");p.textContent="\u23CE Generate",p.setAttribute("aria-label","Generate code"),p.addEventListener("click",this.handleSubmit),this.toggleLoading(r),n.shouldFocus&&requestAnimationFrame(()=>{i.value=n.inputValue,i.focus(),t.dispatch({effects:Ct.of(!1)})}),m(i.value),i.addEventListener("input",w),i.addEventListener("keydown",this.onKeyDown);function m(y){d.replaceChildren(y?p:f)}let g="";function w(){t.dispatch({effects:Nt.of(i.value)});let y=i.value.trim();y!==g&&(g=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 ts(e){if(!e.prompt)throw Error("prompt function is required");let t={...z,...e.keymaps};return[kt.of(e),tt,Wr,St,Vr,Qi(),zi,Je.of([{key:t.showInput,run:$r}]),lt.highest([Je.of([{key:t.acceptEdit,run:Hr},{key:t.rejectEdit,run:qr}])]),ns,rs,os,as]}const ns=j.updateListener.of(e=>{let t=e.state.field(tt);if(!t.show||!e.docChanged)return;let{lineFrom:n,lineTo:r}=t,o=!1;e.changes.iterChanges((a,i,s,c)=>{let u=e.state.doc.lineAt(a).number;if(u<n){let d=e.state.doc.lineAt(c).number-e.state.doc.lineAt(s).number;n+=d,r+=d,o=!0}else if(u<=r){let d=e.state.doc.lineAt(c).number-e.state.doc.lineAt(s).number;r+=d,o=!0}}),o&&e.view.dispatch({effects:[et.of({show:!0,lineFrom:n,lineTo:r})]})}),rs=j.decorations.of(e=>{let t=e.state.field(St);return t?q.set([q.mark({class:"cm-new-code-line"}).range(t.from,t.to)]):q.none}),os=j.decorations.compute([tt],e=>{let t=e.field(tt),n=e.facet(kt),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(q.line({class:"cm-ai-selection"}).range(s)),i===o&&r.push(q.widget({widget:new es(n.prompt),side:-1}).range(s))}}return q.set(r)}),as=$e.define({create(e){return q.none},update(e,t){let n=t.state.field(St);return n?q.set([q.widget({widget:new Zi(n.oldCode),block:!0}).range(n.from)]):q.none},provide:e=>j.decorations.from(e)});var is=Re(),F=Ua(md(),1),Gn=()=>({entries:new Map}),{valueAtom:Yr,useActions:Xr}=Or(Gn,{submit:(e,t)=>{let{cellIds:n,deleteCell:r,deleteManyCells:o,store:a}=t,i=a.get(Ze),s=a.get(vd),c=new Set(i.cellIds.inOrderIds.filter(f=>i.cellData[f].code.trim()==="")),u=new Map;for(let f of n){if(c.has(f)){u.set(f,{cellId:f,type:"simple"});continue}let p=i.cellRuntime[f],m=new Map;for(let w of Object.values(s)){let y=w.declaredBy.includes(f),v=w.usedBy.some(C=>!c.has(C));y&&v&&m.set(w.name,w.usedBy)}let g;p!=null&&p.runElapsedTimeMs&&p.runElapsedTimeMs>2e3&&(g=p.runElapsedTimeMs),m.size===0&&g===void 0?u.set(f,{cellId:f,type:"simple"}):u.set(f,{cellId:f,type:"expensive",executionDurationMs:g,defs:m})}let d=[...u.values()].every(f=>f.type==="simple");return u.size>0&&d?(u.size===1?r({cellId:[...u.values()][0].cellId}):o({cellIds:[...u.values()].map(f=>f.cellId)}),Gn()):{...e,entries:u}},clear:()=>Gn()});Bn=function(){let e=yr(),{submit:t,clear:n}=Xr(),{entries:r}=re(Yr),o=ki(),a=Ur();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])},Bi=function(e){let t=(0,is.c)(16),n=re(Yr),r=Xr(),o=Ur(),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(ss)}),r.clear()},t[6]=r,t[7]=o,t[8]=n.entries,t[9]=s):s=t[9];let c;t[10]===r?c=t[11]:(c=()=>r.clear(),t[10]=r,t[11]=c);let u;return t[12]!==i||t[13]!==s||t[14]!==c?(u={isPending:!0,...i,shouldConfirmDelete:!0,confirm:s,cancel:c},t[12]=i,t[13]=s,t[14]=c,t[15]=u):u=t[15],u};function ss(e){return e.cellId}async function ls(e){var s,c;let t=`
|
|
4
4
|
${e.codeBefore}
|
|
5
5
|
<rewrite_this>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as V}from"./chunk-LvLJmgfZ.js";import{l as X,u as L}from"./useEvent-WUlsM6MC.js";import{t as Y}from"./react-Bj1aDYRI.js";import{ni as Z}from"./cells-DVXjWBHI.js";import"./react-dom-CSu739Rf.js";import{t as T}from"./compiler-runtime-B3qBwwSJ.js";import"./tooltip-BrjpohcK.js";import{S as ee}from"./ai-model-dropdown-D0ZKojfQ.js";import{c as le,f as te,s as ie,t as ae}from"./useEventListener-CjXriKgk.js";import{p as oe,v as ne,y as re}from"./utils-CORJ8yYa.js";import{i as pe}from"./switch-BQaT8a2B.js";import{t as se}from"./jsx-runtime-CP2fAiZX.js";import"./dist-DUY6xZX8.js";import"./JsonOutput-DgTX3wDl.js";import"./cjs-CVt8hZ5L.js";import"./main-Cmx6WhDY.js";import"./useNonce-BY4jV7Yb.js";import{r as de}from"./requests-DZy_SQ_v.js";import"./layout-
|
|
1
|
+
import{s as V}from"./chunk-LvLJmgfZ.js";import{l as X,u as L}from"./useEvent-WUlsM6MC.js";import{t as Y}from"./react-Bj1aDYRI.js";import{ni as Z}from"./cells-DVXjWBHI.js";import"./react-dom-CSu739Rf.js";import{t as T}from"./compiler-runtime-B3qBwwSJ.js";import"./tooltip-BrjpohcK.js";import{S as ee}from"./ai-model-dropdown-D0ZKojfQ.js";import{c as le,f as te,s as ie,t as ae}from"./useEventListener-CjXriKgk.js";import{p as oe,v as ne,y as re}from"./utils-CORJ8yYa.js";import{i as pe}from"./switch-BQaT8a2B.js";import{t as se}from"./jsx-runtime-CP2fAiZX.js";import"./dist-DUY6xZX8.js";import"./JsonOutput-DgTX3wDl.js";import"./cjs-CVt8hZ5L.js";import"./main-Cmx6WhDY.js";import"./useNonce-BY4jV7Yb.js";import{r as de}from"./requests-DZy_SQ_v.js";import"./layout-DQyAaEMt.js";import"./download-CNypwy8-.js";import{t as me}from"./useCellActionButton-DLoBXBqS.js";import"./markdown-renderer-BF7gphWI.js";import{i as he,t as ce}from"./useNotebookActions-CGdPh6jF.js";import"./dist-DRM_TtJV.js";import"./dist-CLn8560E.js";import"./dist-4go66rGa.js";import"./dist-C_w6Go0g.js";import"./dist-D3d3ioNg.js";import"./session-BQVN1Kxg.js";import"./Combination-BM4eSgxb.js";import"./purify.es-DFAhPV1y.js";import"./dates-BL9QfUQ0.js";import"./popover-2GpKY98n.js";import"./share-XjNIMk98.js";import"./vega-loader.browser-xq8miGHn.js";import"./defaultLocale-DPBdGRrH.js";import"./defaultLocale-Lfi0pexn.js";import{a as ye,c as fe,i as z,l as J,n as ue,o as K,r as be,s as ge}from"./command-COYC8fga.js";import"./chunk-5FQGJX7Z-C3tg8qpb.js";import"./katex-0Z75JF53.js";import"./html-to-image-Din4blht.js";import{r as ke}from"./focus-C2gi0jxY.js";import{t as Q}from"./renderShortcut-CMdaUbHS.js";import"./esm-DYDEu0Nq.js";import"./name-cell-input-EJb1YnST.js";import"./multi-icon-OxLi6M3I.js";import"./dist-DBYXupB9.js";import"./dist-CW4ZrmuX.js";import"./dist-DvNh3ph0.js";import"./dist-DrewQ3CS.js";import"./dist-BML9Do7x.js";import"./dist-DWi0RsIc.js";import"./dist-pzEKEf2L.js";import"./dist-CX4tr6LY.js";import"./dist-DkUBUEhC.js";import"./esm-B2VsGmJs.js";var Ce=T(),je=V(Y(),1);function xe(e,l){let t=(0,Ce.c)(11),r;t[0]===l?r=t[1]:(r=new Z(l),t[0]=l,t[1]=r);let p=r,n;t[2]!==e||t[3]!==p?(n=()=>p.get(e),t[2]=e,t[3]=p,t[4]=n):n=t[4];let[m,g]=(0,je.useState)(n),i;t[5]!==e||t[6]!==p?(i=k=>{g(k),p.set(e,k)},t[5]=e,t[6]=p,t[7]=i):i=t[7];let f=i,h;return t[8]!==f||t[9]!==m?(h=[m,f],t[8]=f,t[9]=m,t[10]=h):h=t[10],h}var ve=T(),Se=3;function we(){let e=(0,ve.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),p;e[1]!==t||e[2]!==r?(p=m=>{r(_e([m,...t]).slice(0,Se))},e[1]=t,e[2]=r,e[3]=p):p=e[3];let n;return e[4]!==t||e[5]!==p?(n={recentCommands:t,addRecentCommand:p},e[4]=t,e[5]=p,e[6]=n):n=e[6],n}function _e(e){return[...new Set(e)]}function W(e){return e.dropdown!==void 0}function U(e,l=""){return e.flatMap(t=>t.label?W(t)?U(t.dropdown,`${l+t.label} > `):{...t,label:l+t.label}:[])}var He=T();function Ae(){let e=(0,He.c)(75),[l,t]=re(),[r,p]=ne(),{saveAppConfig:n,saveUserConfig:m}=de(),g;e[0]!==m||e[1]!==t?(g=async d=>{await m({config:d}).then(()=>{t(c=>({...c,...d}))})},e[0]=m,e[1]=t,e[2]=g):g=e[2];let i=g,f;e[3]!==n||e[4]!==p?(f=async d=>{await n({config:d}).then(()=>{p(d)})},e[3]=n,e[4]=p,e[5]=f):f=e[5];let h=f,k;if(e[6]!==r||e[7]!==l.completion||e[8]!==l.display||e[9]!==l.keymap||e[10]!==h||e[11]!==i){let d;e[13]===r?d=e[14]:(d=O=>O!==r.width,e[13]=r,e[14]=d);let c;e[15]!==r||e[16]!==h?(c=O=>({label:`App config > Set width=${O}`,handle:()=>{h({...r,width:O})}}),e[15]=r,e[16]=h,e[17]=c):c=e[17];let H;e[18]!==l.display||e[19]!==i?(H={label:"Config > Set theme: dark",handle:()=>{i({display:{...l.display,theme:"dark"}})}},e[18]=l.display,e[19]=i,e[20]=H):H=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 A;e[24]!==l.display||e[25]!==i?(A={label:"Config > Set theme: system",handle:()=>{i({display:{...l.display,theme:"system"}})}},e[24]=l.display,e[25]=i,e[26]=A):A=e[26];let P=l.keymap.preset==="vim",M;e[27]!==l.keymap||e[28]!==i?(M=()=>{i({keymap:{...l.keymap,preset:"vim"}})},e[27]=l.keymap,e[28]=i,e[29]=M):M=e[29];let N;e[30]!==P||e[31]!==M?(N={label:"Config > Switch keymap to VIM",hidden:P,handle:M},e[30]=P,e[31]=M,e[32]=N):N=e[32];let D=l.keymap.preset==="default",j;e[33]!==l.keymap||e[34]!==i?(j=()=>{i({keymap:{...l.keymap,preset:"default"}})},e[33]=l.keymap,e[34]=i,e[35]=j):j=e[35];let u;e[36]!==D||e[37]!==j?(u={label:"Config > Switch keymap to default (current: VIM)",hidden:D,handle:j},e[36]=D,e[37]=j,e[38]=u):u=e[38];let x;e[39]!==l.completion||e[40]!==i?(x=()=>{i({completion:{...l.completion,copilot:!1}})},e[39]=l.completion,e[40]=i,e[41]=x):x=e[41];let v=l.completion.copilot!=="github",$;e[42]!==x||e[43]!==v?($={label:"Config > Disable GitHub Copilot",handle:x,hidden:v},e[42]=x,e[43]=v,e[44]=$):$=e[44];let S;e[45]!==l.completion||e[46]!==i?(S=()=>{i({completion:{...l.completion,copilot:"github"}})},e[45]=l.completion,e[46]=i,e[47]=S):S=e[47];let I=l.completion.copilot==="github",q;e[48]!==S||e[49]!==I?(q={label:"Config > Enable GitHub Copilot",handle:S,hidden:I},e[48]=S,e[49]=I,e[50]=q):q=e[50];let B=!l.display.reference_highlighting,w;e[51]!==l.display||e[52]!==i?(w=()=>{i({display:{...l.display,reference_highlighting:!1}})},e[51]=l.display,e[52]=i,e[53]=w):w=e[53];let b;e[54]!==B||e[55]!==w?(b={label:"Config > Disable reference highlighting",hidden:B,handle:w},e[54]=B,e[55]=w,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 F;e[60]!==l.display.reference_highlighting||e[61]!==y?(F={label:"Config > Enable reference highlighting",hidden:l.display.reference_highlighting,handle:y},e[60]=l.display.reference_highlighting,e[61]=y,e[62]=F):F=e[62];let o=l.display.cell_output==="above",a;e[63]!==l.display||e[64]!==i?(a=()=>{i({display:{...l.display,cell_output:"above"}})},e[63]=l.display,e[64]=i,e[65]=a):a=e[65];let R;e[66]!==o||e[67]!==a?(R={label:"Config > Set cell output area: above",hidden:o,handle:a},e[66]=o,e[67]=a,e[68]=R):R=e[68];let _=l.display.cell_output==="below",E;e[69]!==l.display||e[70]!==i?(E=()=>{i({display:{...l.display,cell_output:"below"}})},e[69]=l.display,e[70]=i,e[71]=E):E=e[71];let G;e[72]!==_||e[73]!==E?(G={label:"Config > Set cell output area: below",hidden:_,handle:E},e[72]=_,e[73]=E,e[74]=G):G=e[74],k=[...ee().filter(d).map(c),H,C,A,N,u,$,q,b,F,R,G].filter(Me),e[6]=r,e[7]=l.completion,e[8]=l.display,e[9]=l.keymap,e[10]=h,e[11]=i,e[12]=k}else k=e[12];return k}function Me(e){return!e.hidden}var Ne=T(),s=V(se(),1),De=()=>{let e=(0,Ne.c)(37),[l,t]=X(he),r=pe(),p=L(ke),n=L(oe),m;e[0]===p?m=e[1]:(m={cell:p},e[0]=p,e[1]=m);let g=me(m).flat();g=U(g);let i=Ae(),f=ce();f=[...U(f),...U(i)];let h=f.filter(Fe),k=le.keyBy(h,Re),{recentCommands:d,addRecentCommand:c}=we(),H;e[2]===d?H=e[3]:(H=new Set(d),e[2]=d,e[3]=H);let C=H,A;e[4]!==n||e[5]!==t?(A=o=>{te(n.getHotkey("global.commandPalette").key)(o)&&(o.preventDefault(),t(Ee))},e[4]=n,e[5]=t,e[6]=A):A=e[6],ae(document,"keydown",A);let P;e[7]!==c||e[8]!==n||e[9]!==r||e[10]!==t?(P=(o,a)=>{let R=r[o];if(!R)return null;let _=n.getHotkey(o);return(0,s.jsxs)(K,{disabled:a.disabled,onSelect:()=>{c(o),t(!1),requestAnimationFrame(()=>{R()})},value:_.name,children:[(0,s.jsxs)("span",{children:[_.name,a.tooltip&&(0,s.jsx)("span",{className:"ml-2",children:a.tooltip})]}),(0,s.jsx)(J,{children:(0,s.jsx)(Q,{shortcut:_.key})})]},o)},e[7]=c,e[8]=n,e[9]=r,e[10]=t,e[11]=P):P=e[11];let M=P,N;e[12]!==c||e[13]!==n||e[14]!==t?(N=o=>{let{label:a,handle:R,props:_,hotkey:E}=o,G=_===void 0?{}:_;return(0,s.jsxs)(K,{disabled:G.disabled,onSelect:()=>{c(a),t(!1),requestAnimationFrame(()=>{R()})},value:a,children:[(0,s.jsxs)("span",{children:[a,G.tooltip&&(0,s.jsxs)("span",{className:"ml-2",children:["(",G.tooltip,")"]})]}),E&&(0,s.jsx)(J,{children:(0,s.jsx)(Q,{shortcut:n.getHotkey(E).key})})]},a)},e[12]=c,e[13]=n,e[14]=t,e[15]=N):N=e[15];let D=N,j=ue,u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=(0,s.jsx)(ye,{placeholder:"Type to search..."}),e[16]=u):u=e[16];let x=ge,v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(be,{children:"No results found."}),e[17]=v):v=e[17];let $=d.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z,{heading:"Recently Used",children:d.map(o=>{let a=k[o];return ie(o)?M(o,{disabled:a==null?void 0:a.disabled,tooltip:a==null?void 0:a.tooltip}):a&&!W(a)?D({label:a.label,handle:a.handleHeadless||a.handle,props:{disabled:a.disabled,tooltip:a.tooltip}}):null})}),(0,s.jsx)(fe,{})]}),S=z,I=n.iterate().map(o=>{if(C.has(o))return null;let a=k[o];return M(o,{disabled:a==null?void 0:a.disabled,tooltip:a==null?void 0:a.tooltip})}),q=h.map(o=>C.has(o.label)?null:D({label:o.label,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip}})),B;e[18]!==C||e[19]!==D?(B=o=>C.has(o.label)?null:D({label:`Cell > ${o.label}`,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip}}),e[18]=C,e[19]=D,e[20]=B):B=e[20];let w=g.map(B),b;e[21]!==S||e[22]!==q||e[23]!==w||e[24]!==I?(b=(0,s.jsxs)(S,{heading:"Commands",children:[I,q,w]}),e[21]=S,e[22]=q,e[23]=w,e[24]=I,e[25]=b):b=e[25];let y;e[26]!==x||e[27]!==b||e[28]!==v||e[29]!==$?(y=(0,s.jsxs)(x,{children:[v,$,b]}),e[26]=x,e[27]=b,e[28]=v,e[29]=$,e[30]=y):y=e[30];let F;return e[31]!==j||e[32]!==l||e[33]!==t||e[34]!==y||e[35]!==u?(F=(0,s.jsxs)(j,{open:l,onOpenChange:t,children:[u,y]}),e[31]=j,e[32]=l,e[33]=t,e[34]=y,e[35]=u,e[36]=F):F=e[36],F};function Fe(e){return!e.hotkey}function Re(e){return e.label}function Ee(e){return!e}export{De as default};
|