@marimo-team/frontend 0.24.1-dev65 → 0.24.1-dev66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CellStatus-ByrqmRbF.js → CellStatus-BWCtP3qQ.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-CsYDGDdB.js → ConnectedDataExplorerComponent-BU1NZpRe.js} +1 -1
- package/dist/assets/{ErrorBoundary-TUuUdxHz.js → ErrorBoundary-npvnLp9x.js} +1 -1
- package/dist/assets/{JsonOutput-DbjqR1zZ.js → JsonOutput-DWHV2eQE.js} +1 -1
- package/dist/assets/{LazyAnyLanguageCodeMirror-YVX2AZaI.js → LazyAnyLanguageCodeMirror-zSwE3dvU.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-CidvW8yi.js → MarimoErrorOutput-ZJ6XQKr0.js} +1 -1
- package/dist/assets/{RenderHTML-DyTQ_aJR.js → RenderHTML-B2NEp3vg.js} +1 -1
- package/dist/assets/{RunButton-Cv_ckYEH.js → RunButton-L0fRxWhe.js} +1 -1
- package/dist/assets/{VisuallyHidden-DurJ_JBW.js → VisuallyHidden-SChAyKIQ.js} +1 -1
- package/dist/assets/{add-cell-with-ai-CEAJAnUT.js → add-cell-with-ai-6sxiY1Qo.js} +1 -1
- package/dist/assets/{add-connection-dialog-k-xbLWdR.js → add-connection-dialog-BKzXoKZ7.js} +1 -1
- package/dist/assets/{agent-panel-0w7h8fjy.js → agent-panel-DLDrzioR.js} +1 -1
- package/dist/assets/{ai-model-dropdown-iY9cMHva.js → ai-model-dropdown-C6a5WwzK.js} +1 -1
- package/dist/assets/{alert-dialog-DBoy-FMx.js → alert-dialog-BVi_GyOB.js} +1 -1
- package/dist/assets/{any-language-editor-CthCqXuX.js → any-language-editor-BL8H-DwB.js} +1 -1
- package/dist/assets/{app-config-button-C83eI9fG.js → app-config-button-CGcz18YO.js} +1 -1
- package/dist/assets/{blob-D2x71aTK.js → blob-D0bOT_Rc.js} +1 -1
- package/dist/assets/button-Btj6GXNy.js +1 -0
- package/dist/assets/{cache-panel-MAXVmKkG.js → cache-panel-C7jsiqCa.js} +1 -1
- package/dist/assets/{cell-editor-BcTxGoC3.js → cell-editor-AhmjxpbF.js} +1 -1
- package/dist/assets/{cell-link-c74wFaiz.js → cell-link-BqUCel0u.js} +1 -1
- package/dist/assets/{cells-DNoi9Edm.js → cells-CWhmlx33.js} +1 -1
- package/dist/assets/{chat-display-CKfc8EAz.js → chat-display-hii8QeG4.js} +1 -1
- package/dist/assets/{chat-panel-CCGdZVko.js → chat-panel-DayIrT-i.js} +1 -1
- package/dist/assets/{chat-ui-BUjkvWew.js → chat-ui-BqpUPlJ1.js} +1 -1
- package/dist/assets/{column-preview-BrO557-t.js → column-preview-Cya1--h1.js} +1 -1
- package/dist/assets/{command-palette-CrpkfAuj.js → command-palette-DJBJACGv.js} +1 -1
- package/dist/assets/{common-CAMZMCwq.js → common-B5rT3jZs.js} +1 -1
- package/dist/assets/{components-DJLtV_Mj.js → components-CvZ-6CVz.js} +1 -1
- package/dist/assets/{copy-icon-LPQzn7_f.js → copy-icon-CRxVZTJ9.js} +1 -1
- package/dist/assets/{datasource-DVv7qUFu.js → datasource-BhCWw0_C.js} +1 -1
- package/dist/assets/{dependency-graph-panel-IgEoFXFw.js → dependency-graph-panel-DueUeSqZ.js} +1 -1
- package/dist/assets/{documentation-panel-CpJX3LTt.js → documentation-panel-BecxeHyy.js} +1 -1
- package/dist/assets/{download-CCPBCjzu.js → download-DUFyna0J.js} +1 -1
- package/dist/assets/{edit-page-MQ_4aJhO.js → edit-page-C2RLzDPf.js} +4 -4
- package/dist/assets/{error-banner-B3KYUlCX.js → error-banner-BYN8YUMe.js} +1 -1
- package/dist/assets/{error-entries-DOS37j7f.js → error-entries-BcjSsPlF.js} +1 -1
- package/dist/assets/{error-panel-B3q6q2Gs.js → error-panel-DV40UknQ.js} +1 -1
- package/dist/assets/{file-explorer-panel-uum_XPfd.js → file-explorer-panel-sk8Cp5Qc.js} +1 -1
- package/dist/assets/{file-icons-CLGmPKoJ.js → file-icons-DuifYpwL.js} +1 -1
- package/dist/assets/{file-name-input-DC441YXk.js → file-name-input-itW22sME.js} +1 -1
- package/dist/assets/{floating-outline-W5HJSoBY.js → floating-outline-CnooYKtT.js} +1 -1
- package/dist/assets/{gallery-page-4dZlIWMe.js → gallery-page-TqnFYECu.js} +1 -1
- package/dist/assets/{glide-data-editor-CSrQxrfb.js → glide-data-editor-CzalkCph.js} +1 -1
- package/dist/assets/{home-page-DxYT5GCG.js → home-page-DXqlCga0.js} +1 -1
- package/dist/assets/{index-DfbaUhcq.js → index-Chf7uq-1.js} +5 -5
- package/dist/assets/index-M0P2T5GI.css +2 -0
- package/dist/assets/{input-DeyycFtq.js → input-Daz6sk8l.js} +1 -1
- package/dist/assets/{layout-CrBSkVxt.js → layout-uW1Q3GLe.js} +3 -3
- package/dist/assets/{logs-panel-DmbccYWJ.js → logs-panel-D_fd3qTo.js} +1 -1
- package/dist/assets/{markdown-renderer-CB2UurmB.js → markdown-renderer-KEQXCdvc.js} +1 -1
- package/dist/assets/{mermaid-BmbD1i8H.js → mermaid-Nzih1WTG.js} +1 -1
- package/dist/assets/{name-cell-input-CX4R8mJV.js → name-cell-input-CG5ADThI.js} +1 -1
- package/dist/assets/{outline-panel-LEx0BFUs.js → outline-panel-6jBFNPsH.js} +1 -1
- package/dist/assets/{packages-panel-B1LsIAVY.js → packages-panel-CFqdSgRx.js} +1 -1
- package/dist/assets/{pair-with-agent-modal-TbFSfxnC.js → pair-with-agent-modal-Gg8MZHWW.js} +1 -1
- package/dist/assets/{panel-accordion-state-HNISBQa4.js → panel-accordion-state-Bjtuw5KJ.js} +1 -1
- package/dist/assets/{panels-osKprw9R.js → panels-CF5ptsti.js} +1 -1
- package/dist/assets/{process-output-DIhqtgs6.js → process-output-cqRA_sBO.js} +1 -1
- package/dist/assets/{readonly-code-display-Cee30pk_.js → readonly-code-display-2lCZh8OV.js} +1 -1
- package/dist/assets/{readonly-python-code-m_9bVgtt.js → readonly-python-code-BGVVx228.js} +1 -1
- package/dist/assets/{reveal-component-BD67ldf1.js → reveal-component-B47F3y30.js} +1 -1
- package/dist/assets/{run-page-DhCgyhzD.js → run-page-BrNnwMqh.js} +1 -1
- package/dist/assets/{scratchpad-panel-BWE3ZzQg.js → scratchpad-panel-Da0wZ5MH.js} +1 -1
- package/dist/assets/{scroll-to-bottom-button-D5uTen4e.js → scroll-to-bottom-button-xua0e9rA.js} +1 -1
- package/dist/assets/{secrets-panel-B7Rcwc2I.js → secrets-panel-CZPbFAZH.js} +1 -1
- package/dist/assets/{select-BUEX2Vfl.js → select-czJLm6jf.js} +1 -1
- package/dist/assets/{session-panel-F_IDPTWG.js → session-panel-eEygRlFN.js} +1 -1
- package/dist/assets/{skeleton-Cfr-D0uM.js → skeleton-C7Qu8B6J.js} +1 -1
- package/dist/assets/{snippets-panel-DpCuVkpq.js → snippets-panel-p0q9pZIi.js} +1 -1
- package/dist/assets/{state-CHqSZb7R.js → state-CfUWx1Rb.js} +1 -1
- package/dist/assets/{state-DGgHgBN9.js → state-DRoa41ur.js} +1 -1
- package/dist/assets/{swiper-component-BlZbNN5w.js → swiper-component-Bot7ehYH.js} +1 -1
- package/dist/assets/{switch-27TbonxF.js → switch-Gl6cozkm.js} +1 -1
- package/dist/assets/{tracing-BEJAq4zg.js → tracing-CwHJq7-L.js} +1 -1
- package/dist/assets/{tracing-panel-D8QL7Nar.js → tracing-panel-CzmxtGrv.js} +2 -2
- package/dist/assets/{tree-actions-CxkW_mv4.js → tree-actions-BoQfkAEN.js} +1 -1
- package/dist/assets/{useAddCell-CAX4gqgE.js → useAddCell-BNQmZTYq.js} +1 -1
- package/dist/assets/{useCellActionButton-Cje0V_da.js → useCellActionButton-kd62cHep.js} +1 -1
- package/dist/assets/{useDeleteCell-CL_90v2g.js → useDeleteCell-y9IxNAXA.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BEA9Hqzv.js → useDependencyPanelTab-COHrXfiU.js} +1 -1
- package/dist/assets/{useNotebookActions-D65OgZMy.js → useNotebookActions-Ct-6_c0d.js} +1 -1
- package/dist/assets/{useRunCells-DttzF-pt.js → useRunCells-DpiI4EUr.js} +1 -1
- package/dist/assets/{useSplitCell-BD2q-Clc.js → useSplitCell-BQY-H_fr.js} +1 -1
- package/dist/assets/{vega-component-DCOCpf2B.js → vega-component-B0MZ_r-y.js} +1 -1
- package/dist/assets/{write-secret-modal-BG_B6y1P.js → write-secret-modal-lNU_7c2x.js} +1 -1
- package/dist/index.html +31 -31
- package/package.json +1 -1
- package/src/components/ui/__tests__/button.test.ts +42 -0
- package/src/components/ui/button.tsx +4 -10
- package/src/css/globals.css +36 -9
- package/dist/assets/button-BMBznEru.js +0 -1
- package/dist/assets/index-ecw9ngZu.css +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./compiler-runtime-CYIjoINj.js";import{i as r,o as i,r as a}from"./useEventListener-D27Dii_l.js";import{t as o}from"./cn-ldLVeaqm.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{C as c,S as l,_ as u,c as d,d as ee,f as te,m as ne,o as re,r as ie,s as ae,u as oe,v as f,w as p,x as m,y as se}from"./fullscreen-0EEPR7uc.js";import{n as h}from"./button-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./compiler-runtime-CYIjoINj.js";import{i as r,o as i,r as a}from"./useEventListener-D27Dii_l.js";import{t as o}from"./cn-ldLVeaqm.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{C as c,S as l,_ as u,c as d,d as ee,f as te,m as ne,o as re,r as ie,s as ae,u as oe,v as f,w as p,x as m,y as se}from"./fullscreen-0EEPR7uc.js";import{n as h}from"./button-Btj6GXNy.js";var g=e(t(),1),_=s(),v=`Dialog`,[y,b]=c(v),[ce,x]=y(v),le=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=g.useRef(null),c=g.useRef(null),[l,d]=se({prop:r,defaultProp:i??!1,onChange:a,caller:v});return(0,_.jsx)(ce,{scope:t,triggerRef:s,contentRef:c,contentId:u(),titleId:u(),descriptionId:u(),open:l,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};le.displayName=v;var ue=`DialogTrigger`,S=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=x(ue,n),o=i(t,a.triggerRef);return(0,_.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":L(a.open),...r,ref:o,onClick:m(e.onClick,a.onOpenToggle)})});S.displayName=ue;var C=`DialogPortal`,[de,w]=y(C,{forceMount:void 0}),T=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=x(C,t);return(0,_.jsx)(de,{scope:t,forceMount:n,children:g.Children.map(r,e=>(0,_.jsx)(f,{present:n||a.open,children:(0,_.jsx)(ee,{asChild:!0,container:i,children:e})}))})};T.displayName=C;var E=`DialogOverlay`,D=g.forwardRef((e,t)=>{let n=w(E,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(E,e.__scopeDialog);return a.modal?(0,_.jsx)(f,{present:r||a.open,children:(0,_.jsx)(pe,{...i,ref:t})}):null});D.displayName=E;var fe=a(`DialogOverlay.RemoveScroll`),pe=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(E,n);return(0,_.jsx)(d,{as:fe,allowPinchZoom:!0,shards:[i.contentRef],children:(0,_.jsx)(p.div,{"data-state":L(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),O=`DialogContent`,k=g.forwardRef((e,t)=>{let n=w(O,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(O,e.__scopeDialog);return(0,_.jsx)(f,{present:r||a.open,children:a.modal?(0,_.jsx)(me,{...i,ref:t}):(0,_.jsx)(he,{...i,ref:t})})});k.displayName=O;var me=g.forwardRef((e,t)=>{let n=x(O,e.__scopeDialog),r=g.useRef(null),a=i(t,n.contentRef,r);return g.useEffect(()=>{let e=r.current;if(e)return ae(e)},[]),(0,_.jsx)(A,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault())})}),he=g.forwardRef((e,t)=>{let n=x(O,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return(0,_.jsx)(A,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),A=g.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...s}=e,c=x(O,n),l=g.useRef(null),u=i(t,l);return oe(),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(te,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,_.jsx)(ne,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":L(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(_e,{titleId:c.titleId}),(0,_.jsx)(ye,{contentRef:l,descriptionId:c.descriptionId})]})]})}),j=`DialogTitle`,M=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(j,n);return(0,_.jsx)(p.h2,{id:i.titleId,...r,ref:t})});M.displayName=j;var N=`DialogDescription`,P=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(N,n);return(0,_.jsx)(p.p,{id:i.descriptionId,...r,ref:t})});P.displayName=N;var F=`DialogClose`,I=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(F,n);return(0,_.jsx)(p.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})});I.displayName=F;function L(e){return e?`open`:`closed`}var R=`DialogTitleWarning`,[ge,z]=l(R,{contentName:O,titleName:j,docsSlug:`dialog`}),_e=({titleId:e})=>{let t=z(R),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-B0Z9INg1.js";import{t as e}from"./react-CBDbhulC.js";import{t}from"./compiler-runtime-CYIjoINj.js";import{g as n}from"./useEventListener-D27Dii_l.js";import{t as r}from"./jsx-runtime-B74pBk57.js";import{t as i}from"./copy-icon-
|
|
1
|
+
import"./rolldown-runtime-B0Z9INg1.js";import{t as e}from"./react-CBDbhulC.js";import{t}from"./compiler-runtime-CYIjoINj.js";import{g as n}from"./useEventListener-D27Dii_l.js";import{t as r}from"./jsx-runtime-B74pBk57.js";import{t as i}from"./copy-icon-CRxVZTJ9.js";import{t as a}from"./esm-Dw0vvSg2.js";import{n as o}from"./error-banner-BYN8YUMe.js";import{n as s,t as c}from"./esm-BGpfQNhD.js";var l=t();e();var u=r(),d={python:`py`,python3:`py`,javascript:`js`,typescript:`ts`,shell:`sh`,bash:`sh`,unknown:`text`,undefined:`text`};function f(e){return e?e in c:!1}var p=e=>{let t=(0,l.c)(29),r,p,m,h,g,_;if(t[0]!==e){let{language:n,hideUnsupportedLanguageErrors:i,showCopyButton:a,extensions:o,...s}=e;p=i,g=a,h=s,m=n;let c;t[7]===o?c=t[8]:(c=o===void 0?[]:o,t[7]=o,t[8]=c),r=c,m=d[m||``]||m,_=f(m),t[0]=e,t[1]=r,t[2]=p,t[3]=m,t[4]=h,t[5]=g,t[6]=_}else r=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6];let v=_;v||n.warn(`Language ${m} not found in CodeMirror.`);let y;bb0:{if(!f(m)){y=r;break bb0}let e;t[9]===m?e=t[10]:(e=s(m),t[9]=m,t[10]=e);let n;t[11]!==r||t[12]!==e?(n=[e,...r].filter(Boolean),t[11]=r,t[12]=e,t[13]=n):n=t[13],y=n}let b=y,x;t[14]!==p||t[15]!==v||t[16]!==m?(x=!v&&!p&&(0,u.jsx)(o,{className:`mb-1 rounded-sm`,error:`Language ${m} not supported. Supported languages are: ${Object.keys(c).join(`, `)}`}),t[14]=p,t[15]=v,t[16]=m,t[17]=x):x=t[17];let S;t[18]!==v||t[19]!==h||t[20]!==g?(S=g&&v&&(0,u.jsx)(i,{tooltip:!1,buttonClassName:`absolute top-2 right-2 z-10 hover-action`,className:`h-4 w-4 text-muted-foreground`,value:h.value||``,toastTitle:`Copied to clipboard`}),t[18]=v,t[19]=h,t[20]=g,t[21]=S):S=t[21];let C;t[22]!==b||t[23]!==h?(C=(0,u.jsx)(a,{...h,extensions:b}),t[22]=b,t[23]=h,t[24]=C):C=t[24];let w;return t[25]!==x||t[26]!==S||t[27]!==C?(w=(0,u.jsxs)(`div`,{className:`relative w-full group hover-actions-parent`,children:[x,S,C]}),t[25]=x,t[26]=S,t[27]=C,t[28]=w):w=t[28],w};export{d as LANGUAGE_MAP,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t}from"./useEvent-xfs0Sn4r.js";import{t as n}from"./react-CBDbhulC.js";import{$t as r,An as i,Mn as a,Wn as o,an as s,en as c,fn as l,hn as u,in as d,mn as f,on as p,rn as m,tn as h}from"./cells-DNoi9Edm.js";import{t as g}from"./compiler-runtime-CYIjoINj.js";import{C as _,O as v,k as y}from"./utils-CUZQNAWJ.js";import{E as b,d as x,f as S,i as C,n as w,u as T}from"./ai-model-dropdown-iY9cMHva.js";import{N as E}from"./config-DaNyNpZL.js";import{t as D}from"./jsx-runtime-B74pBk57.js";import{o as O}from"./alert-dialog-DBoy-FMx.js";import{l as k}from"./select-BUEX2Vfl.js";import{t as A}from"./tooltip-D7dq6bnc.js";import{t as j}from"./button-BMBznEru.js";import{s as M}from"./arrays-BqUx5USx.js";import{r as N}from"./requests-C6_IaFh7.js";import{t as P}from"./createLucideIcon-B7HeEoG2.js";import{r as F}from"./useNumberFormatter-DHJ9s6Vk.js";import{M as I,T as L,b as R,j as z,p as ee,w as B}from"./write-secret-modal-BG_B6y1P.js";import{r as V}from"./input-DeyycFtq.js";import{t as H}from"./settings-C-cYas75.js";import{t as te}from"./use-toast-DpWHUGuF.js";import{t as U}from"./VisuallyHidden-DurJ_JBW.js";import{n as W}from"./useDebounce-Dulm61-t.js";import{t as G}from"./kbd-Cwh96ZBE.js";import{t as K}from"./Inputs-E85rt2lh.js";var ne=P(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),q=g(),J=D(),Y=e=>{let t=(0,q.c)(15),{description:n,disabled:r,tooltip:i}=e,a=r!==void 0&&r,o=i===void 0?`Shutdown`:i,{openConfirm:s,closeModal:c}=R(),{sendShutdown:l}=N(),u;t[0]===l?u=t[1]:(u=()=>{l(),setTimeout(X,200)},t[0]=l,t[1]=u);let d=u;if(E())return null;let f=a?`disabled`:`red`,p;t[2]!==c||t[3]!==n||t[4]!==d||t[5]!==s?(p=e=>{e.stopPropagation(),s({title:`Shutdown`,description:n,variant:`destructive`,confirmAction:(0,J.jsx)(O,{onClick:()=>{d(),c()},"aria-label":`Confirm Shutdown`,children:`Shutdown`})})},t[2]=c,t[3]=n,t[4]=d,t[5]=s,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,J.jsx)(F,{strokeWidth:1}),t[7]=m):m=t[7];let h;t[8]!==a||t[9]!==f||t[10]!==p?(h=(0,J.jsx)(K,{"aria-label":`Shutdown`,"data-testid":`shutdown-button`,shape:`circle`,size:`small`,color:f,className:`h-[27px] w-[27px]`,disabled:a,onClick:p,children:m}),t[8]=a,t[9]=f,t[10]=p,t[11]=h):h=t[11];let g;return t[12]!==h||t[13]!==o?(g=(0,J.jsx)(A,{content:o,children:h}),t[12]=h,t[13]=o,t[14]=g):g=t[14],g};function X(){window.close()}var Z=e(n(),1),re=100,ie=()=>{let e=(0,q.c)(37),[t,n]=_(),{saveAppConfig:l}=N(),u=(0,Z.useId)(),f=(0,Z.useId)(),g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=i(v),e[0]=g):g=e[0];let y;e[1]===t?y=e[2]:(y={resolver:g,defaultValues:t},e[1]=t,e[2]=y);let b=a(y),C;e[3]!==l||e[4]!==n?(C=async e=>{await l({config:e}).then(()=>{n(e)}).catch(()=>{n(e)})},e[3]=l,e[4]=n,e[5]=C):C=e[5];let w=C,T;e[6]===w?T=e[7]:(T=e=>{w(e)},e[6]=w,e[7]=T);let E=W(T,re),D;e[8]===t.width?D=e[9]:(D=[t.width],e[8]=t.width,e[9]=D),(0,Z.useEffect)(ae,D);let O;e[10]!==E||e[11]!==b?(O=b.handleSubmit(E),e[10]=E,e[11]=b,e[12]=O):O=e[12];let k;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,J.jsxs)(`div`,{children:[(0,J.jsx)(S,{children:`Notebook Settings`}),(0,J.jsx)(x,{children:`Configure how your notebook or application looks and behaves.`})]}),e[13]=k):k=e[13];let A;e[14]===b.control?A=e[15]:(A=(0,J.jsxs)(Q,{title:`Display`,children:[(0,J.jsx)(m,{control:b.control,name:`width`,render:se}),(0,J.jsx)(m,{control:b.control,name:`app_title`,render:$})]}),e[14]=b.control,e[15]=A);let j;e[16]===b.control?j=e[17]:(j=(0,J.jsxs)(Q,{title:`Custom Files`,children:[(0,J.jsx)(m,{control:b.control,name:`css_file`,render:ce}),(0,J.jsx)(m,{control:b.control,name:`html_head_file`,render:le})]}),e[16]=b.control,e[17]=j);let P;e[18]===b.control?P=e[19]:(P=(0,J.jsx)(Q,{title:`Data`,children:(0,J.jsx)(m,{control:b.control,name:`sql_output`,render:de})}),e[18]=b.control,e[19]=P);let F;e[20]!==u||e[21]!==f?(F=e=>{let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(c,{children:(0,J.jsxs)(`div`,{className:`flex gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,J.jsx)(o,{id:u,"data-testid":`html-checkbox`,checked:t.value.includes(`html`),onCheckedChange:()=>{t.onChange(M(t.value,`html`))}}),(0,J.jsx)(s,{htmlFor:u,children:`HTML`})]}),(0,J.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,J.jsx)(o,{id:f,"data-testid":`ipynb-checkbox`,checked:t.value.includes(`ipynb`),onCheckedChange:()=>{t.onChange(M(t.value,`ipynb`))}}),(0,J.jsx)(s,{htmlFor:f,children:`IPYNB`})]})]})}),(0,J.jsx)(p,{})]}),(0,J.jsxs)(h,{children:[`When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named`,` `,(0,J.jsx)(G,{className:`inline`,children:`__marimo__`}),` next to your notebook file.`]})]})},e[20]=u,e[21]=f,e[22]=F):F=e[22];let I;e[23]!==b.control||e[24]!==F?(I=(0,J.jsx)(Q,{title:`Exporting outputs`,children:(0,J.jsx)(m,{control:b.control,name:`auto_download`,render:F})}),e[23]=b.control,e[24]=F,e[25]=I):I=e[25];let L;e[26]!==I||e[27]!==A||e[28]!==j||e[29]!==P?(L=(0,J.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-8 gap-y-4`,children:[A,j,P,I]}),e[26]=I,e[27]=A,e[28]=j,e[29]=P,e[30]=L):L=e[30];let R;e[31]!==L||e[32]!==O?(R=(0,J.jsxs)(`form`,{onChange:O,className:`flex flex-col gap-6`,children:[k,L]}),e[31]=L,e[32]=O,e[33]=R):R=e[33];let z;return e[34]!==b||e[35]!==R?(z=(0,J.jsx)(r,{...b,children:R}),e[34]=b,e[35]=R,e[36]=z):z=e[36],z},Q=e=>{let t=(0,q.c)(5),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,J.jsx)(`h3`,{className:`text-base font-semibold mb-1`,children:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a};function ae(){window.dispatchEvent(new Event(`resize`))}function oe(e){return(0,J.jsx)(`option`,{value:e,children:e},e)}function se(e){let{field:t}=e;return(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{children:`Width`}),(0,J.jsx)(c,{children:(0,J.jsx)(k,{"data-testid":`app-width-select`,onChange:e=>t.onChange(e.target.value),value:t.value,disabled:t.disabled,className:`inline-flex mr-2`,children:b().map(oe)})}),(0,J.jsx)(p,{})]})}function $(e){let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{children:`App title`}),(0,J.jsx)(c,{children:(0,J.jsx)(V,{...t,value:t.value??``,onChange:e=>{t.onChange(e.target.value),y.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),(0,J.jsx)(p,{})]}),(0,J.jsx)(h,{children:`The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window.`})]})}function ce(e){let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{className:`shrink-0`,children:`Custom CSS`}),(0,J.jsx)(c,{children:(0,J.jsx)(V,{...t,value:t.value??``,placeholder:`custom.css`,onChange:e=>{t.onChange(e.target.value),y.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),(0,J.jsx)(p,{})]}),(0,J.jsx)(h,{children:`A filepath to a custom css file to be injected into the notebook.`})]})}function le(e){let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{className:`shrink-0`,children:`HTML Head`}),(0,J.jsx)(c,{children:(0,J.jsx)(V,{...t,value:t.value??``,placeholder:`head.html`,onChange:e=>{t.onChange(e.target.value)}})}),(0,J.jsx)(p,{})]}),(0,J.jsxs)(h,{children:[`A filepath to an HTML file to be injected into the`,` `,(0,J.jsx)(G,{className:`inline`,children:`<head/>`}),` section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts.`]})]})}function ue(e){return(0,J.jsx)(`option`,{value:e.value,children:e.label},e.value)}function de(e){let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{children:`SQL Output Type`}),(0,J.jsx)(c,{children:(0,J.jsx)(k,{"data-testid":`sql-output-select`,onChange:e=>{t.onChange(e.target.value),te({title:`Kernel Restart Required`,description:`This change requires a kernel restart to take effect.`})},value:t.value,disabled:t.disabled,className:`inline-flex mr-2`,children:T.map(ue)})}),(0,J.jsx)(p,{})]}),(0,J.jsxs)(h,{children:[`The Python type returned by a SQL cell. For best performance with large datasets, we recommend using`,` `,(0,J.jsx)(G,{className:`inline`,children:`native`}),`. See the`,` `,(0,J.jsx)(ee,{href:`https://docs.marimo.io/guides/working_with_data/sql`,children:`SQL guide`}),` `,`for more information.`]})]})}var fe=e=>{let n=(0,q.c)(32),{showAppConfig:r,disabled:i,tooltip:a}=e,o=r===void 0||r,s=i!==void 0&&i,c=a===void 0?`Settings`:a,[d,p]=t(w),m=s?`disabled`:`hint-green`,h;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,J.jsx)(H,{strokeWidth:1.8}),n[0]=h):h=n[0];let g;n[1]===c?g=n[2]:(g=(0,J.jsx)(A,{content:c,children:h}),n[1]=c,n[2]=g);let _;n[3]!==s||n[4]!==m||n[5]!==g?(_=(0,J.jsx)(K,{"aria-label":`Config`,"data-testid":`app-config-button`,shape:`circle`,size:`small`,className:`h-[27px] w-[27px]`,disabled:s,color:m,children:g}),n[3]=s,n[4]=m,n[5]=g,n[6]=_):_=n[6];let v=_,y;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,J.jsxs)(L,{className:`w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0`,children:[(0,J.jsx)(U,{children:(0,J.jsx)(z,{children:`User settings`})}),(0,J.jsx)(C,{})]}),n[7]=y):y=n[7];let b=y;if(!o){let e;n[8]===v?e=n[9]:(e=(0,J.jsx)(I,{children:v}),n[8]=v,n[9]=e);let t;return n[10]!==p||n[11]!==d||n[12]!==e?(t=(0,J.jsxs)(B,{open:d,onOpenChange:p,children:[e,b]}),n[10]=p,n[11]=d,n[12]=e,n[13]=t):t=n[13],t}let x;n[14]===v?x=n[15]:(x=(0,J.jsx)(u,{asChild:!0,children:v}),n[14]=v,n[15]=x);let S,T;n[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,J.jsx)(ie,{}),T=(0,J.jsx)(`div`,{className:`h-px bg-border my-2`}),n[16]=S,n[17]=T):(S=n[16],T=n[17]);let E;n[18]===p?E=n[19]:(E=()=>p(!0),n[18]=p,n[19]=E);let D;n[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(H,{strokeWidth:1.8,className:`w-4 h-4 mr-2`}),n[20]=D):D=n[20];let O;n[21]===E?O=n[22]:(O=(0,J.jsxs)(f,{className:`w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]`,align:`end`,side:`bottom`,onFocusOutside:pe,children:[S,T,(0,J.jsxs)(j,{onClick:E,variant:`link`,className:`px-0`,children:[D,`User settings`]})]}),n[21]=E,n[22]=O);let k;n[23]!==O||n[24]!==x?(k=(0,J.jsxs)(l,{children:[x,O]}),n[23]=O,n[24]=x,n[25]=k):k=n[25];let M;n[26]!==p||n[27]!==d?(M=(0,J.jsx)(B,{open:d,onOpenChange:p,children:b}),n[26]=p,n[27]=d,n[28]=M):M=n[28];let N;return n[29]!==k||n[30]!==M?(N=(0,J.jsxs)(J.Fragment,{children:[k,M]}),n[29]=k,n[30]=M,n[31]=N):N=n[31],N};function pe(e){return e.preventDefault()}export{Y as n,ne as r,fe as t};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t}from"./useEvent-xfs0Sn4r.js";import{t as n}from"./react-CBDbhulC.js";import{$t as r,An as i,Mn as a,Wn as o,an as s,en as c,fn as l,hn as u,in as d,mn as f,on as p,rn as m,tn as h}from"./cells-CWhmlx33.js";import{t as g}from"./compiler-runtime-CYIjoINj.js";import{C as _,O as v,k as y}from"./utils-CUZQNAWJ.js";import{E as b,d as x,f as S,i as C,n as w,u as T}from"./ai-model-dropdown-C6a5WwzK.js";import{N as E}from"./config-DaNyNpZL.js";import{t as D}from"./jsx-runtime-B74pBk57.js";import{o as O}from"./alert-dialog-BVi_GyOB.js";import{l as k}from"./select-czJLm6jf.js";import{t as A}from"./tooltip-D7dq6bnc.js";import{t as j}from"./button-Btj6GXNy.js";import{s as M}from"./arrays-BqUx5USx.js";import{r as N}from"./requests-C6_IaFh7.js";import{t as P}from"./createLucideIcon-B7HeEoG2.js";import{r as F}from"./useNumberFormatter-DHJ9s6Vk.js";import{M as I,T as L,b as R,j as z,p as ee,w as B}from"./write-secret-modal-lNU_7c2x.js";import{r as V}from"./input-Daz6sk8l.js";import{t as H}from"./settings-C-cYas75.js";import{t as te}from"./use-toast-DpWHUGuF.js";import{t as U}from"./VisuallyHidden-SChAyKIQ.js";import{n as W}from"./useDebounce-Dulm61-t.js";import{t as G}from"./kbd-Cwh96ZBE.js";import{t as K}from"./Inputs-E85rt2lh.js";var ne=P(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),q=g(),J=D(),Y=e=>{let t=(0,q.c)(15),{description:n,disabled:r,tooltip:i}=e,a=r!==void 0&&r,o=i===void 0?`Shutdown`:i,{openConfirm:s,closeModal:c}=R(),{sendShutdown:l}=N(),u;t[0]===l?u=t[1]:(u=()=>{l(),setTimeout(X,200)},t[0]=l,t[1]=u);let d=u;if(E())return null;let f=a?`disabled`:`red`,p;t[2]!==c||t[3]!==n||t[4]!==d||t[5]!==s?(p=e=>{e.stopPropagation(),s({title:`Shutdown`,description:n,variant:`destructive`,confirmAction:(0,J.jsx)(O,{onClick:()=>{d(),c()},"aria-label":`Confirm Shutdown`,children:`Shutdown`})})},t[2]=c,t[3]=n,t[4]=d,t[5]=s,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,J.jsx)(F,{strokeWidth:1}),t[7]=m):m=t[7];let h;t[8]!==a||t[9]!==f||t[10]!==p?(h=(0,J.jsx)(K,{"aria-label":`Shutdown`,"data-testid":`shutdown-button`,shape:`circle`,size:`small`,color:f,className:`h-[27px] w-[27px]`,disabled:a,onClick:p,children:m}),t[8]=a,t[9]=f,t[10]=p,t[11]=h):h=t[11];let g;return t[12]!==h||t[13]!==o?(g=(0,J.jsx)(A,{content:o,children:h}),t[12]=h,t[13]=o,t[14]=g):g=t[14],g};function X(){window.close()}var Z=e(n(),1),re=100,ie=()=>{let e=(0,q.c)(37),[t,n]=_(),{saveAppConfig:l}=N(),u=(0,Z.useId)(),f=(0,Z.useId)(),g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=i(v),e[0]=g):g=e[0];let y;e[1]===t?y=e[2]:(y={resolver:g,defaultValues:t},e[1]=t,e[2]=y);let b=a(y),C;e[3]!==l||e[4]!==n?(C=async e=>{await l({config:e}).then(()=>{n(e)}).catch(()=>{n(e)})},e[3]=l,e[4]=n,e[5]=C):C=e[5];let w=C,T;e[6]===w?T=e[7]:(T=e=>{w(e)},e[6]=w,e[7]=T);let E=W(T,re),D;e[8]===t.width?D=e[9]:(D=[t.width],e[8]=t.width,e[9]=D),(0,Z.useEffect)(ae,D);let O;e[10]!==E||e[11]!==b?(O=b.handleSubmit(E),e[10]=E,e[11]=b,e[12]=O):O=e[12];let k;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,J.jsxs)(`div`,{children:[(0,J.jsx)(S,{children:`Notebook Settings`}),(0,J.jsx)(x,{children:`Configure how your notebook or application looks and behaves.`})]}),e[13]=k):k=e[13];let A;e[14]===b.control?A=e[15]:(A=(0,J.jsxs)(Q,{title:`Display`,children:[(0,J.jsx)(m,{control:b.control,name:`width`,render:se}),(0,J.jsx)(m,{control:b.control,name:`app_title`,render:$})]}),e[14]=b.control,e[15]=A);let j;e[16]===b.control?j=e[17]:(j=(0,J.jsxs)(Q,{title:`Custom Files`,children:[(0,J.jsx)(m,{control:b.control,name:`css_file`,render:ce}),(0,J.jsx)(m,{control:b.control,name:`html_head_file`,render:le})]}),e[16]=b.control,e[17]=j);let P;e[18]===b.control?P=e[19]:(P=(0,J.jsx)(Q,{title:`Data`,children:(0,J.jsx)(m,{control:b.control,name:`sql_output`,render:de})}),e[18]=b.control,e[19]=P);let F;e[20]!==u||e[21]!==f?(F=e=>{let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(c,{children:(0,J.jsxs)(`div`,{className:`flex gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,J.jsx)(o,{id:u,"data-testid":`html-checkbox`,checked:t.value.includes(`html`),onCheckedChange:()=>{t.onChange(M(t.value,`html`))}}),(0,J.jsx)(s,{htmlFor:u,children:`HTML`})]}),(0,J.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,J.jsx)(o,{id:f,"data-testid":`ipynb-checkbox`,checked:t.value.includes(`ipynb`),onCheckedChange:()=>{t.onChange(M(t.value,`ipynb`))}}),(0,J.jsx)(s,{htmlFor:f,children:`IPYNB`})]})]})}),(0,J.jsx)(p,{})]}),(0,J.jsxs)(h,{children:[`When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named`,` `,(0,J.jsx)(G,{className:`inline`,children:`__marimo__`}),` next to your notebook file.`]})]})},e[20]=u,e[21]=f,e[22]=F):F=e[22];let I;e[23]!==b.control||e[24]!==F?(I=(0,J.jsx)(Q,{title:`Exporting outputs`,children:(0,J.jsx)(m,{control:b.control,name:`auto_download`,render:F})}),e[23]=b.control,e[24]=F,e[25]=I):I=e[25];let L;e[26]!==I||e[27]!==A||e[28]!==j||e[29]!==P?(L=(0,J.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-8 gap-y-4`,children:[A,j,P,I]}),e[26]=I,e[27]=A,e[28]=j,e[29]=P,e[30]=L):L=e[30];let R;e[31]!==L||e[32]!==O?(R=(0,J.jsxs)(`form`,{onChange:O,className:`flex flex-col gap-6`,children:[k,L]}),e[31]=L,e[32]=O,e[33]=R):R=e[33];let z;return e[34]!==b||e[35]!==R?(z=(0,J.jsx)(r,{...b,children:R}),e[34]=b,e[35]=R,e[36]=z):z=e[36],z},Q=e=>{let t=(0,q.c)(5),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,J.jsx)(`h3`,{className:`text-base font-semibold mb-1`,children:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a};function ae(){window.dispatchEvent(new Event(`resize`))}function oe(e){return(0,J.jsx)(`option`,{value:e,children:e},e)}function se(e){let{field:t}=e;return(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{children:`Width`}),(0,J.jsx)(c,{children:(0,J.jsx)(k,{"data-testid":`app-width-select`,onChange:e=>t.onChange(e.target.value),value:t.value,disabled:t.disabled,className:`inline-flex mr-2`,children:b().map(oe)})}),(0,J.jsx)(p,{})]})}function $(e){let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{children:`App title`}),(0,J.jsx)(c,{children:(0,J.jsx)(V,{...t,value:t.value??``,onChange:e=>{t.onChange(e.target.value),y.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),(0,J.jsx)(p,{})]}),(0,J.jsx)(h,{children:`The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window.`})]})}function ce(e){let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{className:`shrink-0`,children:`Custom CSS`}),(0,J.jsx)(c,{children:(0,J.jsx)(V,{...t,value:t.value??``,placeholder:`custom.css`,onChange:e=>{t.onChange(e.target.value),y.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),(0,J.jsx)(p,{})]}),(0,J.jsx)(h,{children:`A filepath to a custom css file to be injected into the notebook.`})]})}function le(e){let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{className:`shrink-0`,children:`HTML Head`}),(0,J.jsx)(c,{children:(0,J.jsx)(V,{...t,value:t.value??``,placeholder:`head.html`,onChange:e=>{t.onChange(e.target.value)}})}),(0,J.jsx)(p,{})]}),(0,J.jsxs)(h,{children:[`A filepath to an HTML file to be injected into the`,` `,(0,J.jsx)(G,{className:`inline`,children:`<head/>`}),` section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts.`]})]})}function ue(e){return(0,J.jsx)(`option`,{value:e.value,children:e.label},e.value)}function de(e){let{field:t}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,J.jsxs)(d,{className:`flex flex-row items-center space-x-1 space-y-0`,children:[(0,J.jsx)(s,{children:`SQL Output Type`}),(0,J.jsx)(c,{children:(0,J.jsx)(k,{"data-testid":`sql-output-select`,onChange:e=>{t.onChange(e.target.value),te({title:`Kernel Restart Required`,description:`This change requires a kernel restart to take effect.`})},value:t.value,disabled:t.disabled,className:`inline-flex mr-2`,children:T.map(ue)})}),(0,J.jsx)(p,{})]}),(0,J.jsxs)(h,{children:[`The Python type returned by a SQL cell. For best performance with large datasets, we recommend using`,` `,(0,J.jsx)(G,{className:`inline`,children:`native`}),`. See the`,` `,(0,J.jsx)(ee,{href:`https://docs.marimo.io/guides/working_with_data/sql`,children:`SQL guide`}),` `,`for more information.`]})]})}var fe=e=>{let n=(0,q.c)(32),{showAppConfig:r,disabled:i,tooltip:a}=e,o=r===void 0||r,s=i!==void 0&&i,c=a===void 0?`Settings`:a,[d,p]=t(w),m=s?`disabled`:`hint-green`,h;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,J.jsx)(H,{strokeWidth:1.8}),n[0]=h):h=n[0];let g;n[1]===c?g=n[2]:(g=(0,J.jsx)(A,{content:c,children:h}),n[1]=c,n[2]=g);let _;n[3]!==s||n[4]!==m||n[5]!==g?(_=(0,J.jsx)(K,{"aria-label":`Config`,"data-testid":`app-config-button`,shape:`circle`,size:`small`,className:`h-[27px] w-[27px]`,disabled:s,color:m,children:g}),n[3]=s,n[4]=m,n[5]=g,n[6]=_):_=n[6];let v=_,y;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,J.jsxs)(L,{className:`w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0`,children:[(0,J.jsx)(U,{children:(0,J.jsx)(z,{children:`User settings`})}),(0,J.jsx)(C,{})]}),n[7]=y):y=n[7];let b=y;if(!o){let e;n[8]===v?e=n[9]:(e=(0,J.jsx)(I,{children:v}),n[8]=v,n[9]=e);let t;return n[10]!==p||n[11]!==d||n[12]!==e?(t=(0,J.jsxs)(B,{open:d,onOpenChange:p,children:[e,b]}),n[10]=p,n[11]=d,n[12]=e,n[13]=t):t=n[13],t}let x;n[14]===v?x=n[15]:(x=(0,J.jsx)(u,{asChild:!0,children:v}),n[14]=v,n[15]=x);let S,T;n[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,J.jsx)(ie,{}),T=(0,J.jsx)(`div`,{className:`h-px bg-border my-2`}),n[16]=S,n[17]=T):(S=n[16],T=n[17]);let E;n[18]===p?E=n[19]:(E=()=>p(!0),n[18]=p,n[19]=E);let D;n[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(H,{strokeWidth:1.8,className:`w-4 h-4 mr-2`}),n[20]=D):D=n[20];let O;n[21]===E?O=n[22]:(O=(0,J.jsxs)(f,{className:`w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]`,align:`end`,side:`bottom`,onFocusOutside:pe,children:[S,T,(0,J.jsxs)(j,{onClick:E,variant:`link`,className:`px-0`,children:[D,`User settings`]})]}),n[21]=E,n[22]=O);let k;n[23]!==O||n[24]!==x?(k=(0,J.jsxs)(l,{children:[x,O]}),n[23]=O,n[24]=x,n[25]=k):k=n[25];let M;n[26]!==p||n[27]!==d?(M=(0,J.jsx)(B,{open:d,onOpenChange:p,children:b}),n[26]=p,n[27]=d,n[28]=M):M=n[28];let N;return n[29]!==k||n[30]!==M?(N=(0,J.jsxs)(J.Fragment,{children:[k,M]}),n[29]=k,n[30]=M,n[31]=N):N=n[31],N};function pe(e){return e.preventDefault()}export{Y as n,ne as r,fe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./markdown-renderer-
|
|
1
|
+
import{a as e}from"./markdown-renderer-KEQXCdvc.js";function t(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result)},r.onerror=e=>{n(Error(`Failed to read blob: ${e.type}`))},r.readAsDataURL(e)})}function n(e){let[t,n]=e.split(`,`,2),r=/^data:(.+);base64$/.exec(t)?.[1],i=atob(n),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e++)o[e]=i.charCodeAt(e);return new Blob([o],{type:r})}function r({contents:t,mimeType:r,isBase64:i}){return i?n(e(t,r)):new Blob([t],{type:r})}export{r as n,t as r,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./compiler-runtime-CYIjoINj.js";import{m as r,n as i,t as a}from"./useEventListener-D27Dii_l.js";import{n as o,t as s}from"./cn-ldLVeaqm.js";import{t as c}from"./jsx-runtime-B74pBk57.js";var l=e(t(),1),u=n(),d={stopPropagation:e=>t=>{t.stopPropagation(),e&&e(t)},onEnter:e=>t=>{t.key===`Enter`&&e&&e(t)},preventFocus:e=>{e.preventDefault()},fromInput:e=>{let t=d.composedTarget(e);return t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName.startsWith(`MARIMO`)||t.isContentEditable||d.fromCodeMirror(t)},fromCodeMirror:e=>e.closest(`.cm-editor`)!==null,shouldIgnoreKeyboardEvent(e){let t=d.composedTarget(e);return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLElement&&(t.isContentEditable||t.tagName===`BUTTON`||t.closest(`[role='textbox']`)!==null||t.closest(`[contenteditable='true']`)!==null||d.fromCodeMirror(t))},composedTarget(e){return`composedPath`in e&&typeof e.composedPath==`function`?e.composedPath()[0]??e.target:e.target},hasModifier:e=>e.ctrlKey||e.metaKey||e.altKey||e.shiftKey,isMetaOrCtrl:e=>e.metaKey||e.ctrlKey},f=c(),p=`active:shadow-none`,m=o(s(`disabled:opacity-50 disabled:pointer-events-none`,`inline-flex items-center justify-center rounded-md text-sm font-medium focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background`),{variants:{variant:{default:s(`bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs border border-primary`,p),destructive:s(`border shadow-xs`,`bg-destructive text-destructive-foreground border-destructive-border hover:bg-destructive-hover`,p),success:s(`border shadow-xs`,`bg-success text-success-foreground border-success-border hover:bg-success-hover`,p),warn:s(`border shadow-xs`,`bg-action text-action-foreground border-action-border hover:bg-action-hover`,p),action:s(`bg-action text-action-foreground shadow-xs`,`hover:bg-action-hover border border-action-border`,p),outline:s(`border border-slate-300 shadow-xs`,`hover:bg-accent hover:text-accent-foreground`,`hover:border-primary`,`aria-selected:text-accent-foreground aria-selected:border-primary`,p),secondary:s(`bg-secondary text-secondary-foreground hover:bg-secondary/80`,`border border-input shadow-xs`,p),text:s(`opacity-80 hover:opacity-100`,`active:opacity-100`),ghost:s(`border border-transparent`,`hover:bg-accent hover:text-accent-foreground hover:shadow-xs`,p,`active:text-accent-foreground`),link:`underline-offset-4 hover:underline text-link`,linkDestructive:`underline-offset-4 hover:underline text-destructive underline-destructive`,outlineDestructive:`border border-destructive text-destructive hover:bg-destructive/10`},size:{default:`h-10 py-2 px-4`,xs:`h-7 px-2 rounded-md text-xs`,sm:`h-9 px-3 rounded-md`,lg:`h-11 px-8 rounded-md`,icon:`h-6 w-6 mb-0`},disabled:{true:`opacity-50 pointer-events-none`}},defaultVariants:{variant:`default`,size:`sm`}}),h=l.forwardRef((e,t)=>{let n=(0,u.c)(19),o,c,p,h,g,_;n[0]===e?(o=n[1],c=n[2],p=n[3],h=n[4],g=n[5],_=n[6]):({className:o,variant:_,size:h,asChild:g,keyboardShortcut:c,...p}=e,n[0]=e,n[1]=o,n[2]=c,n[3]=p,n[4]=h,n[5]=g,n[6]=_);let v=g!==void 0&&g,y=l.useRef(null),b;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>y.current,n[7]=b):b=n[7],l.useImperativeHandle(t,b);let x;n[8]===c?x=n[9]:(x=e=>{!c||e.defaultPrevented||d.shouldIgnoreKeyboardEvent(e)||r(c)(e)&&(e.preventDefault(),e.stopPropagation(),y?.current&&!y.current.disabled&&y.current.click())},n[8]=c,n[9]=x),a(document,`keydown`,x);let S=v?i:`button`,C;n[10]!==o||n[11]!==p.disabled||n[12]!==h||n[13]!==_?(C=s(m({variant:_,size:h,className:o,disabled:p.disabled}),o),n[10]=o,n[11]=p.disabled,n[12]=h,n[13]=_,n[14]=C):C=n[14];let w;return n[15]!==S||n[16]!==p||n[17]!==C?(w=(0,f.jsx)(S,{className:C,ref:y,...p}),n[15]=S,n[16]=p,n[17]=C,n[18]=w):w=n[18],w});h.displayName=`Button`;export{m as n,d as r,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t}from"./useEvent-xfs0Sn4r.js";import{t as n}from"./react-CBDbhulC.js";import{t as r}from"./compiler-runtime-CYIjoINj.js";import{t as i}from"./cn-ldLVeaqm.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{a as o,c as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./alert-dialog-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t}from"./useEvent-xfs0Sn4r.js";import{t as n}from"./react-CBDbhulC.js";import{t as r}from"./compiler-runtime-CYIjoINj.js";import{t as i}from"./cn-ldLVeaqm.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{a as o,c as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./alert-dialog-BVi_GyOB.js";import{t as g}from"./button-Btj6GXNy.js";import{r as _}from"./requests-C6_IaFh7.js";import{t as v}from"./database-zap-CloO6gbw.js";import{t as y}from"./spinner-Ck-Hgfvj.js";import{t as b}from"./refresh-cw-Bf-rx_aV.js";import{t as x}from"./trash-2-D_HX-0qx.js";import{t as S}from"./use-toast-DpWHUGuF.js";import{t as C}from"./context-Do8M9TDF.js";import{i as w}from"./numbers-DKurV_vq.js";import{n as T}from"./useAsyncData-Buhk-UgR.js";import{t as E}from"./empty-state-kWyb5dCS.js";import{t as D}from"./requests-S_7PqcSt.js";import{n as O,t as k}from"./formatting-BJlT1s_3.js";var A=r(),j=e(n(),1),M=a(),N=e=>{let t=(0,A.c)(27),{children:n,title:r,description:i,onConfirm:a,confirmText:g,cancelText:_,destructive:v}=e,y=g===void 0?`Continue`:g,b=_===void 0?`Cancel`:_,x=v!==void 0&&v,[S,C]=j.useState(!1),w;t[0]===a?w=t[1]:(w=()=>{a(),C(!1)},t[0]=a,t[1]=w);let T=w,E=x?d:u,D;t[2]===n?D=t[3]:(D=(0,M.jsx)(h,{asChild:!0,children:n}),t[2]=n,t[3]=D);let O;t[4]===r?O=t[5]:(O=(0,M.jsx)(l,{children:r}),t[4]=r,t[5]=O);let k;t[6]===i?k=t[7]:(k=(0,M.jsx)(o,{children:i}),t[6]=i,t[7]=k);let N;t[8]!==O||t[9]!==k?(N=(0,M.jsxs)(s,{children:[O,k]}),t[8]=O,t[9]=k,t[10]=N):N=t[10];let P;t[11]===b?P=t[12]:(P=(0,M.jsx)(f,{children:b}),t[11]=b,t[12]=P);let F;t[13]!==E||t[14]!==y||t[15]!==T?(F=(0,M.jsx)(E,{onClick:T,children:y}),t[13]=E,t[14]=y,t[15]=T,t[16]=F):F=t[16];let I;t[17]!==F||t[18]!==P?(I=(0,M.jsxs)(p,{children:[P,F]}),t[17]=F,t[18]=P,t[19]=I):I=t[19];let L;t[20]!==I||t[21]!==N?(L=(0,M.jsxs)(c,{children:[N,I]}),t[20]=I,t[21]=N,t[22]=L):L=t[22];let R;return t[23]!==S||t[24]!==L||t[25]!==D?(R=(0,M.jsxs)(m,{open:S,onOpenChange:C,children:[D,L]}),t[23]=S,t[24]=L,t[25]=D,t[26]=R):R=t[26],R},P=()=>{let{clearCache:e,getCacheInfo:n}=_(),r=t(D),[a,o]=(0,j.useState)(!1),{locale:s}=C(),{isPending:c,isFetching:l,refetch:u}=T(async()=>{await n(),await new Promise(e=>setTimeout(e,500))},[]),d=async()=>{try{o(!0),await e(),S({title:`Cache purged`,description:`All cached data has been cleared`}),u()}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to purge cache`,variant:`danger`})}finally{o(!1)}};if(c&&!r)return(0,M.jsx)(y,{size:`medium`,centered:!0});let f=(0,M.jsxs)(g,{variant:`outline`,size:`sm`,onClick:u,disabled:l,children:[l?(0,M.jsx)(y,{size:`small`,className:`w-4 h-4 mr-2`}):(0,M.jsx)(b,{className:`w-4 h-4 mr-2`}),`Refresh`]});if(!r)return(0,M.jsx)(E,{title:`No cache data`,description:`Cache information is not available.`,icon:(0,M.jsx)(v,{}),action:f});let p=r.hits,m=r.misses,h=r.time,A=r.disk_total,P=r.disk_to_free,I=p+m,L=I>0?p/I*100:0;return I===0?(0,M.jsx)(E,{title:`No cache activity`,description:`The cache has not been used yet. Cached functions will appear here once they are executed.`,icon:(0,M.jsx)(v,{}),action:f}):(0,M.jsx)(`div`,{className:`flex flex-col h-full overflow-auto`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 h-full`,children:[(0,M.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,M.jsx)(g,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:u,disabled:l,children:(0,M.jsx)(b,{className:i(`h-4 w-4 text-muted-foreground hover:text-foreground`,l&&`animate-[spin_0.5s]`)})})}),(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Statistics`}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,M.jsx)(F,{label:`Time saved`,value:O(h,s),description:`Total execution time saved`}),(0,M.jsx)(F,{label:`Hit rate`,value:I>0?`${w(L,s)}%`:`—`,description:`${w(p,s)} hits / ${w(I,s)} total`}),(0,M.jsx)(F,{label:`Cache hits`,value:w(p,s),description:`Successful cache retrievals`}),(0,M.jsx)(F,{label:`Cache misses`,value:w(m,s),description:`Cache not found`})]})]}),A>0&&(0,M.jsxs)(`div`,{className:`space-y-3 pt-2 border-t`,children:[(0,M.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Storage`}),(0,M.jsx)(`div`,{className:`grid grid-cols-1 gap-3`,children:(0,M.jsx)(F,{label:`Disk usage`,value:k(A,s),description:P>0?`${k(P,s)} can be freed`:`Cache storage on disk`})})]}),(0,M.jsx)(`div`,{className:`my-auto`}),(0,M.jsx)(`div`,{className:`pt-2 border-t`,children:(0,M.jsx)(N,{title:`Purge cache?`,description:`This will permanently delete all cached data. This action cannot be undone.`,confirmText:`Purge`,destructive:!0,onConfirm:d,children:(0,M.jsxs)(g,{variant:`outlineDestructive`,size:`xs`,disabled:a,className:`w-full`,children:[a?(0,M.jsx)(y,{size:`small`,className:`w-3 h-3 mr-2`}):(0,M.jsx)(x,{className:`w-3 h-3 mr-2`}),`Purge Cache`]})})})]})})},F=e=>{let t=(0,A.c)(10),{label:n,value:r,description:i}=e,a;t[0]===n?a=t[1]:(a=(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,M.jsx)(`span`,{className:`text-lg font-semibold`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i&&(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i}),t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 p-3 rounded-lg border bg-card`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c};export{P as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loro_wasm_bg-BzjWitFM.js","./loro_wasm_bg-BRA1AbB3.js","./rolldown-runtime-B0Z9INg1.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,d as n,f as r,l as i,o as a,r as o,s,t as c,u as l}from"./useEvent-xfs0Sn4r.js";import{t as u}from"./react-CBDbhulC.js";import{$a as d,$n as f,Aa as p,B as m,Ba as h,Bi as g,Br as _,Ci as v,Di as y,Dr as b,E as x,Ei as S,F as C,Fr as w,Gn as T,H as E,Hr as D,Ja as O,Jr as k,K as ee,Ko as te,Ln as A,Lr as ne,No as j,Oi as re,Qa as ie,Qi as ae,Rr as M,Sn as oe,So as se,Sr as N,St as ce,Ti as le,U as P,Ur as F,V as ue,Vr as de,Vt as fe,W as pe,Wn as me,Wr as he,Wt as ge,_i as _e,_t as ve,ai as ye,ar as be,bn as xe,bt as Se,ct as Ce,da as we,di as Te,dr as Ee,fi as De,fn as Oe,fr as ke,ga as Ae,gi as je,gn as Me,go as Ne,gt as Pe,ht as Fe,i as Ie,ja as Le,jo as Re,jr as ze,l as Be,li as Ve,lr as He,lt as Ue,m as We,mi as Ge,mn as Ke,oi as qe,or as Je,pi as Ye,pr as Xe,qa as Ze,qr as Qe,si as $e,sr as et,to as tt,tr as nt,u as rt,ur as it,ut as at,vn as ot,vt as st,wi as ct,wt as lt,xi as ut,xn as dt,xt as ft,y as pt,yo as mt,yt as ht,za as gt,zr as _t}from"./cells-
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,d as n,f as r,l as i,o as a,r as o,s,t as c,u as l}from"./useEvent-xfs0Sn4r.js";import{t as u}from"./react-CBDbhulC.js";import{$a as d,$n as f,Aa as p,B as m,Ba as h,Bi as g,Br as _,Ci as v,Di as y,Dr as b,E as x,Ei as S,F as C,Fr as w,Gn as T,H as E,Hr as D,Ja as O,Jr as k,K as ee,Ko as te,Ln as A,Lr as ne,No as j,Oi as re,Qa as ie,Qi as ae,Rr as M,Sn as oe,So as se,Sr as N,St as ce,Ti as le,U as P,Ur as F,V as ue,Vr as de,Vt as fe,W as pe,Wn as me,Wr as he,Wt as ge,_i as _e,_t as ve,ai as ye,ar as be,bn as xe,bt as Se,ct as Ce,da as we,di as Te,dr as Ee,fi as De,fn as Oe,fr as ke,ga as Ae,gi as je,gn as Me,go as Ne,gt as Pe,ht as Fe,i as Ie,ja as Le,jo as Re,jr as ze,l as Be,li as Ve,lr as He,lt as Ue,m as We,mi as Ge,mn as Ke,oi as qe,or as Je,pi as Ye,pr as Xe,qa as Ze,qr as Qe,si as $e,sr as et,to as tt,tr as nt,u as rt,ur as it,ut as at,vn as ot,vt as st,wi as ct,wt as lt,xi as ut,xn as dt,xt as ft,y as pt,yo as mt,yt as ht,za as gt,zr as _t}from"./cells-CWhmlx33.js";import{t as vt}from"./react-dom-BQrReHnR.js";import{Cn as yt,In as bt,Jn as xt,Sn as St,Tt as Ct,kt as wt,ln as Tt,xt as Et}from"./schemas-aTUejmFi.js";import{t as Dt}from"./compiler-runtime-CYIjoINj.js";import{t as Ot}from"./debounce-aFmHgJZY.js";import{D as kt,_ as At,c as jt,g as Mt,l as Nt,v as Pt}from"./utils-CUZQNAWJ.js";import{D as Ft,O as It,b as Lt,g as Rt,h as zt,m as Bt,t as Vt,w as Ht}from"./ai-model-dropdown-C6a5WwzK.js";import{_ as Ut,c as Wt,g as Gt,m as Kt,t as qt}from"./useEventListener-D27Dii_l.js";import{t as Jt}from"./invariant-Ci2dTZ72.js";import{E as Yt,N as Xt,O as Zt,S as Qt,T as $t,m as en,o as tn,r as nn,v as rn}from"./config-DaNyNpZL.js";import{n as an,t as on}from"./switch-Gl6cozkm.js";import{c as sn,n as cn,r as ln}from"./readonly-python-code-BGVVx228.js";import{t as un}from"./ErrorBoundary-npvnLp9x.js";import{t as dn}from"./cn-ldLVeaqm.js";import{t as fn}from"./jsx-runtime-B74pBk57.js";import{d as pn}from"./select-czJLm6jf.js";import{J as mn,Y as hn}from"./JsonOutput-DWHV2eQE.js";import{n as gn}from"./download-DUFyna0J.js";import{t as _n}from"./tooltip-D7dq6bnc.js";import{r as vn,t as yn}from"./button-Btj6GXNy.js";import{At as bn,Bt as xn,Ct as Sn,Dt as Cn,E as wn,Et as Tn,Ft as En,Gt as Dn,H as On,Ht as kn,I as An,P as jn,Pt as Mn,Qt as Nn,Rt as Pn,St as Fn,Tt as In,Ut as Ln,V as Rn,Wt as zn,Yt as Bn,Zt as I,_ as Vn,at as L,dt as Hn,en as Un,gt as Wn,ht as Gn,lt as Kn,m as qn,ot as Jn,qt as Yn,rn as Xn,st as R,ut as Zn,w as Qn,xt as $n}from"./dist-PIe1xcZo.js";import{C as er,E as tr,I as nr,O as rr,S as ir,a as ar,c as or,n as sr,r as cr,w as lr}from"./dist-CbQrIaPV.js";import{o as ur}from"./arrays-BqUx5USx.js";import{n as dr}from"./once-Haz_uxEL.js";import{t as fr}from"./createReducer-Bq-nQJiK.js";import{a as pr,c as mr,f as hr,h as gr,i as _r,l as vr,n as yr,o as br,t as xr}from"./dist-Dz_04liz.js";import{r as Sr}from"./strings-CpYReX2Q.js";import{r as Cr,t as wr}from"./requests-C6_IaFh7.js";import{t as Tr}from"./createLucideIcon-B7HeEoG2.js";import{r as Er,t as Dr}from"./layout-uW1Q3GLe.js";import{r as Or}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as kr}from"./circle-check-CUWv70QX.js";import{B as Ar,F as jr,G as Mr,I as Nr,L as Pr,M as Fr,R as Ir,T as Lr,V as Rr,W as zr,c as Br,f as Vr,i as Hr,n as Ur,o as Wr,r as Gr,s as Kr,w as qr,z as Jr}from"./add-cell-with-ai-6sxiY1Qo.js";import{t as Yr}from"./database-zap-CloO6gbw.js";import{r as Xr,t as Zr}from"./file-icons-DuifYpwL.js";import{t as Qr}from"./components-ib4asSo7.js";import{D as $r,E as ei,T as ti,b as ni,j as ri}from"./write-secret-modal-lNU_7c2x.js";import{n as ii}from"./spinner-Ck-Hgfvj.js";import{n as ai,t as oi}from"./useDeleteCell-y9IxNAXA.js";import{t as si}from"./save-BybsbOKz.js";import{I as ci,Mt as li,P as ui}from"./input-Daz6sk8l.js";import{t as di}from"./badge-D_-uqy2N.js";import{t as fi}from"./preload-helper-HclGiUj8.js";import{a as pi}from"./dist-DzAWvPVK.js";import{t as mi}from"./use-toast-DpWHUGuF.js";import{n as hi}from"./paths-zcL04qUW.js";import{t as gi}from"./session-CEdta5_Q.js";import{r as _i}from"./useTheme-D3zvxdF3.js";import{t as vi}from"./context-Do8M9TDF.js";import{i as yi}from"./numbers-DKurV_vq.js";import{n as bi}from"./useAsyncData-Buhk-UgR.js";import{n as xi}from"./copy-Cg05mM3C.js";import{a as Si}from"./useRunCells-DpiI4EUr.js";import{a as Ci}from"./errors-DzO-nXy-.js";import{t as z}from"./extends-CvVTau-c.js";import{i as wi,n as Ti}from"./esm-Dw0vvSg2.js";import{t as Ei}from"./kbd-Cwh96ZBE.js";import{a as Di}from"./useInstallPackage-Bq7SlWgN.js";import{a as Oi,n as ki}from"./state-CfUWx1Rb.js";import{a as Ai,o as ji}from"./cell-link-BqUCel0u.js";import{a as Mi}from"./renderShortcut-CS4ccH3x.js";import{n as Ni,t as Pi}from"./icons-CjLa9BiH.js";import{t as Fi}from"./dist-8lhGoJ54.js";import{t as Ii}from"./requests-S_7PqcSt.js";import{n as Li}from"./formatting-BJlT1s_3.js";import{t as Ri}from"./useSplitCell-BQY-H_fr.js";import{n as zi,r as Bi,t as Vi}from"./panel-accordion-state-Bjtuw5KJ.js";import{co as Hi,do as Ui,fo as Wi,ft as Gi,go as Ki,ho as qi,lo as Ji,mo as Yi,oo as Xi,po as Zi,so as Qi,uo as $i}from"./loro_wasm_bg-BRA1AbB3.js";import{t as ea}from"./ws-DLVysDhS.js";import{t as ta}from"./Inputs-E85rt2lh.js";import{r as na,t as ra}from"./skeleton-C7Qu8B6J.js";var ia=Tr(`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`}]]),aa={showInput:`Mod-l`,acceptEdit:`Mod-y`,rejectEdit:`Mod-u`},oa=300,sa=Dn.define({combine:e=>Xn(e,{onError:console.error,inputDebounceTime:oa,keymaps:aa},{onError:(e,t)=>e&&t,inputDebounceTime:(e,t)=>e&&t,keymaps:(e,t)=>e&&t})}),ca=I.define(),la=Nn.define({create(){return{show:!1,lineFrom:0,lineTo:0}},update(e,t){for(let e of t.effects)if(e.is(ca))return e.value;return e}}),ua=I.define(),da=I.define(),fa=Nn.define({create(){return{shouldFocus:!1,inputValue:``}},update(e,t){let n=e;for(let e of t.effects)e.is(ua)&&(n={...n,inputValue:e.value}),e.is(da)&&(n={...n,shouldFocus:e.value});return n}}),pa=I.define(),ma=Nn.define({create(){return null},update(e,t){for(let e of t.effects)if(e.is(pa))return e.value;return e}}),ha=I.define(),ga=Nn.define({create(){return!1},update(e,t){for(let e of t.effects)if(e.is(ha))return e.value;return e}}),_a=1,va=e=>{let{state:t}=e,n=t.selection.main;if(n.empty)return!1;let r=t.doc,i=r.lineAt(n.from),a=r.lineAt(n.to);if(t.sliceDoc(i.from,a.to).trim().length<_a)return!1;let o=Math.max(1,Math.min(i.number,r.lines)),s=Math.max(1,Math.min(a.number,r.lines));return e.dispatch({effects:[ca.of({show:!0,lineFrom:o,lineTo:s}),da.of(!0),ua.of(``)],selection:Ln.cursor(i.from)}),!0},ya=e=>e.state.field(ma)?(e.dispatch({effects:[pa.of(null),ca.of({show:!1,lineFrom:0,lineTo:0}),da.of(!1),ua.of(``),ha.of(!1)]}),!0):!1,ba=e=>{let t=e.state.field(ma);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[pa.of(null),ca.of({show:!1,lineFrom:0,lineTo:0}),da.of(!1),ua.of(``),ha.of(!1)]}),!0):!1},xa={mac:`⌘`,windows:`⊞ Win`,default:`Ctrl`};function Sa(){return navigator.platform.startsWith(`Mac`)?xa.mac:navigator.platform.startsWith(`Win`)?xa.windows:xa.default}function Ca(e){return e.replace(`Mod`,Sa()).replace(`-`,` `).toUpperCase()}function B(e,t){let n=document.createElement(e);return n.className=t,n}function wa(e,t,n=void 0){let r=()=>{};return(...i)=>(r(),new Promise((a,o)=>{let s=setTimeout(()=>a(e(...i)),t);r=()=>{clearTimeout(s),n!==void 0&&o(n)}}))}var Ta=Nn.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(e=>e.is(Ea));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),Ea=I.define();function Da(e,t){let n=e.state.selection.main.head,r=[],i=L.widget({widget:new Oa(t),side:1});return r.push(i.range(n)),L.set(r)}var Oa=class extends Hn{suggestion;constructor(e){super(),this.suggestion=e}toDOM(){let e=document.createElement(`span`);return e.style.opacity=`0.4`,e.className=`cm-inline-suggestion`,e.textContent=this.suggestion,e.setAttribute(`role`,`suggestion`),e.setAttribute(`aria-label`,`Suggestion: ${this.suggestion}`),e}get lineBreaks(){return this.suggestion.split(`
|
|
3
3
|
`).length-1}},ka=class{cache=new Map;timeout;constructor(e){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()})}},Aa=(e,t)=>Zn.fromClass(class{abortController=null;cache;constructor(){this.cache=new ka(t.cacheTimeout??1e3)}async update(n){if(!n.docChanged||t.events?.beforeSuggestionFetch?.(n.view)===!1)return;this.abortController?.abort(),this.abortController=new AbortController;let r=n.state.doc,i=r.toString(),a=this.cache.get(i);if(a){n.view.dispatch({effects:Ea.of({text:a,doc:r})});return}try{let a=await e(n.state,this.abortController.signal,n.view);if(this.abortController.signal.aborted||t.events?.shouldShowSuggestion?.(n.view,a)===!1)return;this.cache.set(i,a),n.view.dispatch({effects:Ea.of({text:a,doc:r})})}catch(e){e instanceof Error&&e.name!==`AbortError`&&console.error(`Suggestion fetch error:`,e)}}destroy(){this.abortController?.abort()}}),ja=Zn.fromClass(class{decorations;constructor(){this.decorations=L.none}update(e){let t=e.state.field(Ta)?.suggestion;if(!t){this.decorations=L.none;return}this.decorations=Da(e.view,t)}},{decorations:e=>e.decorations});function Ma(e,t,n,r){return{...e.changeByRange(i=>{if(i===e.selection.main)return{changes:{from:n,to:r,insert:t},range:Ln.cursor(n+t.length)};let a=r-n;return!i.empty||a&&e.sliceDoc(i.from-a,i.from)!==e.sliceDoc(n,r)?{range:i}:{changes:{from:i.from-a,to:i.from,insert:t},range:Ln.cursor(i.from-a+t.length)}}),userEvent:`input.complete`}}var Na=e=>{let t=e.state.field(Ta)?.suggestion;if(!t)return!1;let n=e.state.facet(Ia);return e.dispatch({...Ma(e.state,t,e.state.selection.main.head,e.state.selection.main.head)}),n.events?.onSuggestionAccepted?.(e,t),!0},Pa=e=>{let t=e.state.field(Ta)?.suggestion;if(!t)return!1;let n=e.state.facet(Ia);return e.dispatch({effects:Ea.of({text:null,doc:e.state.doc})}),n.events?.onSuggestionRejected?.(e,t),!0},Fa=In.of([{key:`Tab`,run:Na},{key:`Escape`,run:Pa}]),Ia=Dn.define({combine:e=>e.at(-1)});function La(e){let{delay:t=500,includeKeymap:n=!0}=e,r=wa(e.fetchFn,t);return[Ta,Ia.of(e),Aa(r,e),ja,n?Fa:[]]}var Ra=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 za(e){let t=e.state.facet(sa),n={...aa,...t.keymaps},r=e.state.facet(Ba),i=B(`div`,`cm-ai-tooltip`).appendChild(B(`div`,`cm-ai-tooltip-button`)),a=i.appendChild(document.createElement(`span`));a.textContent=`${r.label} `;let o=a.appendChild(document.createElement(`span`));return o.className=`hotkey`,o.textContent=Ca(n.showInput),i.querySelector(`span`)?.addEventListener(`mousedown`,e=>{e.stopPropagation(),e.button===0&&e.preventDefault()}),i.querySelector(`span`)?.addEventListener(`click`,t=>{t.preventDefault(),va(e)}),i}var Ba=Dn.define({combine(e){return Xn(e,{render:za,hideOnBlur:!1,label:`Edit with AI`})}}),Va=Zn.fromClass(class{view;suppress;dom;mousedown=()=>{this.suppress=!0};mouseup=()=>{this.suppress=!1,this.display(this.view)};scroll=()=>{this.display(this.view)};windowScroll=()=>{this.display(this.view)};constructor(e){this.view=e;let t=e.state.facet(Ba);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(la).show){this.dom.style.display=`none`;return}if(e.state.facet(Ba).hideOnBlur&&!e.hasFocus){this.dom.style.display=`none`,this.dom.setAttribute(`aria-hidden`,`true`);return}e.requestMeasure({read:this.#e})}#e=e=>{let t=e.state.selection.ranges.find(e=>!e.empty);if(t&&!this.suppress){let n=e.coordsAtPos(t.from),r=e.coordsAtPos(t.to);if(!n||!r)return;let i=e.dom.getBoundingClientRect(),a=e.dom.parentElement?.getBoundingClientRect(),o=e=>e.top>=i.top&&e.top<=i.bottom&&e.left>=i.left&&e.left<=i.right,s=e=>!a||e.top>=a.top&&e.top<=a.bottom&&e.left>=a.left&&e.left<=a.right,c=o(n)||o(r),l=s(n)||s(r);if(!c||!l){this.dom.style.display=`none`,this.dom.setAttribute(`aria-hidden`,`true`);return}this.dom.style.display=`flex`,this.dom.setAttribute(`aria-hidden`,`false`);let u=this.dom.getBoundingClientRect(),d=o(n)?n:r,f=i.right-u.width,p=Math.min(d.left,f),m=d.top-u.height,h=a?a.y:-1/0;m<h&&(m=r.bottom),this.dom.style.left=`${p}px`,this.dom.style.top=`${m}px`,requestAnimationFrame(()=>{this.dom&&this.dom.setAttribute(`aria-hidden`,`false`)})}else this.dom.style.display=`none`,this.dom.setAttribute(`aria-hidden`,`true`)};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()}}),Ha=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 Ua(){return[Va,Ha]}var Wa=class extends Hn{oldCode;constructor(e){super(),this.oldCode=e}toDOM(e){let t=B(`div`,`cm-old-code-container`);t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Previous code version`);let n=B(`div`,`cm-old-code cm-line`);n.textContent=this.oldCode;let r=B(`div`,`cm-floating-buttons`),i=e.state.facet(sa),a={...aa,...i.keymaps},o=B(`button`,`cm-floating-button cm-floating-accept`);o.innerHTML=`<span class="hotkey">${Ca(a.acceptEdit)}</span> Accept`,o.setAttribute(`aria-label`,`Accept changes`),o.addEventListener(`click`,t=>{t.preventDefault(),t.stopPropagation(),e.focus(),ya(e)});let s=B(`button`,`cm-floating-button cm-floating-reject`);return s.innerHTML=`<span class="hotkey">${Ca(a.rejectEdit)}</span> Reject`,s.setAttribute(`aria-label`,`Reject changes`),s.addEventListener(`click`,t=>{t.preventDefault(),t.stopPropagation(),e.focus(),ba(e)}),r.append(o,s),t.append(n,r),t}updateDOM(e,t){return!0}},Ga=class extends Hn{complete;abortController=null;dom=null;input=null;loadingContainer=null;helpInfo=null;inputContainer=null;form=null;view=null;constructor(e){super(),this.complete=e}toDOM(e){if(this.dom)return this.dom;this.view=e;let t=e.state.field(fa),n=e.state.field(ga),r=B(`div`,`cm-ai-input-container`);this.inputContainer=r,this.dom=r;let i=B(`form`,`cm-ai-input-form`);this.form=i,i.setAttribute(`role`,`search`),i.setAttribute(`aria-label`,`AI editing instructions`),i.addEventListener(`submit`,e=>e.preventDefault());let a=B(`input`,`cm-ai-input`);this.input=a,i.append(a),a.placeholder=`Editing instructions...`,a.setAttribute(`aria-label`,`AI editing instructions`),a.setAttribute(`autocomplete`,`off`),a.setAttribute(`spellcheck`,`true`),a.value=t.inputValue;let o=B(`div`,`cm-ai-loading-container`);this.loadingContainer=o;let s=B(`div`,`cm-ai-loading-indicator`);s.setAttribute(`role`,`status`),s.setAttribute(`aria-live`,`polite`),s.textContent=`Generating`;let c=B(`button`,`cm-ai-cancel-button`);c.textContent=`Cancel`,c.setAttribute(`aria-label`,`Cancel code generation`),c.addEventListener(`click`,this.onCancel),o.append(c,s);let l=B(`div`,`cm-ai-help-info`);this.helpInfo=l;let u=l.appendChild(document.createElement(`button`));u.className=`cm-ai-help-info-button`,u.textContent=`Esc to close`,u.addEventListener(`click`,this.onCancel);let d=B(`button`,`cm-ai-generate-button`);d.textContent=`⏎ Generate`,d.setAttribute(`aria-label`,`Generate code`),d.addEventListener(`click`,this.handleSubmit),this.toggleLoading(n),t.shouldFocus&&requestAnimationFrame(()=>{a.value=t.inputValue,a.focus(),e.dispatch({effects:da.of(!1)})}),f(a.value),a.addEventListener(`input`,m),a.addEventListener(`keydown`,this.onKeyDown);function f(e){l.replaceChildren(e?d:u)}let p=``;function m(){e.dispatch({effects:ua.of(a.value)});let t=a.value.trim();t!==p&&(p=t,f(t))}return r}toggleLoading(e){this.inputContainer&&this.form&&this.loadingContainer&&this.helpInfo&&this.inputContainer?.replaceChildren(this.form,e?this.loadingContainer:this.helpInfo)}onKeyDown=async e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),await this.handleSubmit()):e.key===`Escape`&&this.onCancel()};onCancel=()=>{this.cleanup();let e=this.view;e&&(e.dispatch({effects:[ca.of({show:!1,lineFrom:0,lineTo:0}),ha.of(!1)]}),e.focus())};handleSubmit=async e=>{let t=this.view;if(!t)return;let n=t.state.facet(sa);e?.stopPropagation();let r=t.state.field(la),{input:i}=this;if(!i)return;let a=i.value.trim();if(!r.show||!a)return;let o=t.state.doc.line(r.lineFrom),s=t.state.doc.line(r.lineTo),c=o.from,l=s.to,u=t.state.sliceDoc(c,l),d=t.state.sliceDoc(0,c),f=t.state.sliceDoc(l);this.abortController=new AbortController,t.dispatch({effects:ha.of(!0)}),this.toggleLoading(!0);try{let e=await this.complete({prompt:a,selection:u,codeBefore:d,codeAfter:f,editorView:t,signal:this.abortController.signal});if(!t.state.field(la).show)return;if(!e||typeof e!=`string`)throw Error(`Invalid completion result`);t.dispatch({changes:{from:c,to:l,insert:e},effects:[ca.of({show:!1,lineFrom:0,lineTo:0}),pa.of({from:c,to:c+e.length,oldCode:u,newCode:e}),ha.of(!1)]})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;n.onError?.(e)}finally{this.cleanup(),this.toggleLoading(!1),t.focus()}};updateDOM(e,t){return this.dom=e,this.input=e.querySelector(`.cm-ai-input`),!0}cleanup(){this.abortController?.abort(),this.abortController=null,this.dom?.remove(),this.input?.remove(),this.dom=null,this.input=null}destroy(){this.cleanup()}};function Ka(e){if(!e.prompt)throw Error(`prompt function is required`);let t={...aa,...e.keymaps};return[sa.of(e),la,fa,ma,ga,Ua(),Ra,In.of([{key:t.showInput,run:va}]),Yn.highest([In.of([{key:t.acceptEdit,run:ya},{key:t.rejectEdit,run:ba}])]),qa,Ja,Ya,Xa]}var qa=R.updateListener.of(e=>{let t=e.state.field(la);if(!t.show||!e.docChanged)return;let{lineFrom:n,lineTo:r}=t,i=!1;e.changes.iterChanges((t,a,o,s)=>{let c=e.state.doc.lineAt(t).number;if(c<n){let t=e.state.doc.lineAt(s).number-e.state.doc.lineAt(o).number;n+=t,r+=t,i=!0}else if(c<=r){let t=e.state.doc.lineAt(s).number-e.state.doc.lineAt(o).number;r+=t,i=!0}}),i&&e.view.dispatch({effects:[ca.of({show:!0,lineFrom:n,lineTo:r})]})}),Ja=R.decorations.of(e=>{let t=e.state.field(ma);return t?L.set([L.mark({class:`cm-new-code-line`}).range(t.from,t.to)]):L.none}),Ya=R.decorations.compute([la],e=>{let t=e.field(la),n=e.facet(sa),r=[];if(t.show){let i=t.lineFrom,a=t.lineTo;for(let t=i;t<=a;t++){let a=e.doc.line(t).from;r.push(L.line({class:`cm-ai-selection`}).range(a)),t===i&&r.push(L.widget({widget:new Ga(n.prompt),side:-1}).range(a))}}return L.set(r)}),Xa=Nn.define({create(e){return L.none},update(e,t){let n=t.state.field(ma);return n?L.set([L.widget({widget:new Wa(n.oldCode),block:!0}).range(n.from)]):L.none},provide:e=>R.decorations.from(e)}),V=Dt(),H=e(u(),1),Za=()=>({entries:new Map}),{valueAtom:Qa,useActions:$a}=fr(Za,{submit:(e,t)=>{let{cellIds:n,deleteCell:r,deleteManyCells:i,store:a}=t,o=a.get(pt),s=a.get(ye),c=new Set(o.cellIds.inOrderIds.filter(e=>o.cellData[e].code.trim()===``)),l=new Map;for(let e of n){if(c.has(e)){l.set(e,{cellId:e,type:`simple`});continue}let t=o.cellRuntime[e],n=new Map;for(let t of Object.values(s)){let r=t.declaredBy.includes(e),i=t.usedBy.some(e=>!c.has(e));r&&i&&n.set(t.name,t.usedBy)}let r;t?.runElapsedTimeMs&&t.runElapsedTimeMs>2e3&&(r=t.runElapsedTimeMs),n.size===0&&r===void 0?l.set(e,{cellId:e,type:`simple`}):l.set(e,{cellId:e,type:`expensive`,executionDurationMs:r,defs:n})}let u=[...l.values()].every(e=>e.type===`simple`);return l.size>0&&u?(l.size===1?r({cellId:[...l.values()][0].cellId}):i({cellIds:[...l.values()].map(e=>e.cellId)}),Za()):{...e,entries:l}},clear:()=>Za()});function eo(){let e=n(),{submit:t,clear:r}=$a(),{entries:a}=i(Qa),o=oi(),s=ai();return(0,H.useMemo)(()=>({submit:n=>{t({cellIds:n,deleteCell:o,deleteManyCells:s,store:e})},clear:r,get idle(){return a.size===0},get shouldConfirmDelete(){return a.size>1}}),[e,t,r,a,o,s])}function to(e){let t=(0,V.c)(16),n=i(Qa),r=$a(),a=ai(),o;t[0]!==e||t[1]!==n.entries?(o=n.entries.get(e),t[0]=e,t[1]=n.entries,t[2]=o):o=t[2];let s=o;if(!s){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={isPending:!1},t[3]=e):e=t[3],e}if(n.entries.size!==1){let e;return t[4]===s?e=t[5]:(e={isPending:!0,shouldConfirmDelete:!1,...s},t[4]=s,t[5]=e),e}let c;t[6]!==r||t[7]!==a||t[8]!==n.entries?(c=()=>{a({cellIds:[...n.entries.values()].map(no)}),r.clear()},t[6]=r,t[7]=a,t[8]=n.entries,t[9]=c):c=t[9];let l;t[10]===r?l=t[11]:(l=()=>r.clear(),t[10]=r,t[11]=l);let u;return t[12]!==s||t[13]!==c||t[14]!==l?(u={isPending:!0,...s,shouldConfirmDelete:!0,confirm:c,cancel:l},t[12]=s,t[13]=c,t[14]=l,t[15]=u):u=t[15],u}function no(e){return e.cellId}async function ro(e){if(!e.ok)throw Error(await e.text());if(!e.body)throw Error(`Failed to get response body`);let t=null,n=!1;if(await Rr({stream:Mr({stream:e.body,schema:zr}).pipeThrough(new TransformStream({transform(e){if(!e.success)throw e.error;let r=e.value;if(Pr(r)&&r.type===jr)t=Nr.parse(r.data).code;else if(r.type===`error`)throw Error(r.errorText);else r.type===`finish`&&(n=r.finishReason===`stop`)}})),onError:e=>{throw e}}),!n)throw Error(`AI completion ended before final validation`);if(t===null)throw Error(`AI completion returned no cell code`);return t}async function io(e){let t=`
|
|
4
4
|
${e.codeBefore}
|
|
5
5
|
<rewrite_this>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,l as t,t as n,u as r}from"./useEvent-xfs0Sn4r.js";import{Bn as i,E as a,N as o,br as s,go as c,j as l,jo as u}from"./cells-
|
|
1
|
+
import{c as e,l as t,t as n,u as r}from"./useEvent-xfs0Sn4r.js";import{Bn as i,E as a,N as o,br as s,go as c,j as l,jo as u}from"./cells-CWhmlx33.js";import{t as d}from"./compiler-runtime-CYIjoINj.js";import{m as f}from"./utils-CUZQNAWJ.js";import{g as p}from"./useEventListener-D27Dii_l.js";import{r as m}from"./constants-BDbGiS7O.js";import{T as h,v as g}from"./config-DaNyNpZL.js";import{t as _}from"./cn-ldLVeaqm.js";import{t as v}from"./jsx-runtime-B74pBk57.js";import{r as y}from"./requests-C6_IaFh7.js";import{b}from"./write-secret-modal-lNU_7c2x.js";import{n as x}from"./paths-zcL04qUW.js";import{s as S}from"./session-CEdta5_Q.js";var C=d();function w(){return t(c)}function T(){let t=(0,C.c)(5),[i]=e(g),a=r(c),{openAlert:o}=b(),{sendRename:s}=y(),l;return t[0]!==i.state||t[1]!==o||t[2]!==s||t[3]!==a?(l=async e=>{let t=f();return i.state===h.OPEN?(S(t=>{e===null?t.delete(m.filePath):t.set(m.filePath,e)}),s({filename:e}).then(()=>(a(e),document.title=t.app_title||x.basename(e)||`Untitled Notebook`,e)).catch(e=>(o(e.message),null))):(o(`Failed to save notebook: not connected to a kernel.`),null)},t[0]=i.state,t[1]=o,t[2]=s,t[3]=a,t[4]=l):l=t[4],n(l)}var E=v(),D=e=>{let t=(0,C.c)(12),{className:n,cellId:r,variant:s,onClick:c,formatCellName:u,skipScroll:d}=e,f=o()[r]??``,p=l().inOrderIds.indexOf(r),{showCellIfHidden:m}=a(),h=u??j,g;t[0]===n?g=t[1]:(g=_(`inline-block cursor-pointer text-link hover:underline`,n),t[0]=n,t[1]=g);let v;t[2]!==r||t[3]!==c||t[4]!==m||t[5]!==d||t[6]!==s?(v=e=>{if(r===`__scratch__`)return!1;m({cellId:r}),e.stopPropagation(),e.preventDefault(),requestAnimationFrame(()=>{A(r,s,d)&&c?.()})},t[2]=r,t[3]=c,t[4]=m,t[5]=d,t[6]=s,t[7]=v):v=t[7];let y=h(i(f,p)),b;return t[8]!==g||t[9]!==v||t[10]!==y?(b=(0,E.jsx)(`div`,{className:g,role:`link`,tabIndex:-1,onClick:v,children:y}),t[8]=g,t[9]=v,t[10]=y,t[11]=b):b=t[11],b},O=e=>{let t=(0,C.c)(2),n;return t[0]===e?n=t[1]:(n=(0,E.jsx)(D,{...e,variant:`destructive`}),t[0]=e,t[1]=n),n},k=e=>{let t=(0,C.c)(10),{cellId:n,lineNumber:r}=e,i=w(),a;t[0]!==n||t[1]!==r?(a=()=>s(n,r),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o;t[3]!==n||t[4]!==i?(o=e=>n===`__scratch__`?`scratch`:`marimo://${i||`untitled`}#cell=${e}`,t[3]=n,t[4]=i,t[5]=o):o=t[5];let c;return t[6]!==n||t[7]!==a||t[8]!==o?(c=(0,E.jsx)(D,{cellId:n,onClick:a,skipScroll:!0,variant:`destructive`,className:`traceback-cell-link`,formatCellName:o}),t[6]=n,t[7]=a,t[8]=o,t[9]=c):c=t[9],c};function A(e,t,n){let r=u.create(e),i=document.getElementById(r),a=i?.classList.contains(`has-error`);return i===null?(p.error(`Cell ${r} not found on page.`),!1):(n||i.scrollIntoView({behavior:`smooth`,block:`center`}),(t===`destructive`||a&&t===void 0)&&(i.classList.add(`error-outline`),setTimeout(()=>{i.classList.remove(`error-outline`)},2e3)),(t===`focus`||!a&&t===void 0)&&(i.classList.add(`focus-outline`),setTimeout(()=>{i.classList.remove(`focus-outline`)},2e3)),!0)}function j(e){return e}export{w as a,A as i,O as n,T as o,k as r,D as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-ChMklRTi.js","./rolldown-runtime-B0Z9INg1.js","./dist-CXmhxecl.js","./dist-B97dKQGP.js","./dist-PIe1xcZo.js","./dist-Dz_04liz.js","./dist-Bke0Ybxy.js","./dist-BcfF-rkl.js","./dist-DdPuhs_-.js","./dist-BO5c5n_b.js","./dist-CLi0j3bw.js","./dist-fxnYzq-R.js","./dist-mY1j_5eA.js","./dist-7qdHLg-L.js","./dist-CO1Hfv5H.js","./dist-D7aYPqs9.js","./dist-CEeRVpMD.js","./dist-CMIyXejt.js","./dist-BwmO3SSk.js","./dist-CidBzUqR.js","./dist-DKCF5R0T.js","./dist-DkCO0b-0.js","./dist-tg3aVnpD.js","./dist-DoAjHgMj.js","./dist-2oRmY-BC.js","./dist-CxxZaSme.js","./dist-C3KxgR0m.js","./dist-DCc0VfiO.js","./dist-CpgfIIzU.js","./dist-BcYW-EJk.js","./dist-DkfdZExz.js","./dist-DzAWvPVK.js","./dist-DbFa9cik.js","./dist-DIkuvChK.js","./dist-Bw8CAY5i.js","./dist-Cqm1W-Zm.js","./dist-hOh6JBwi.js","./dist-Dbu5sPgR.js","./dist-B4QaGCvF.js","./dist-BKx0MLbb.js","./dist-B_ABJVTW.js","./dist-DL1Thauf.js","./apl-gw27yJ2n.js","./apl-CYIAEF37.js","./asciiarmor-Cor5STs8.js","./asciiarmor-CF6FHpQl.js","./asn1-CPEENLyz.js","./asn1-CmtZ6NID.js","./brainfuck-a_fzgFtj.js","./brainfuck-vE42J6oQ.js","./cobol-BYACvGhO.js","./cobol-ttQu-eUm.js","./clike-DZROJv43.js","./clike-Bo1_pR8B.js","./clojure-sW2N62b5.js","./clojure-1zb6N0Kd.js","./css-CbZNFbVv.js","./css-aD3t-znF.js","./cmake-DA9yMhzJ.js","./cmake-DSEb40G9.js","./coffeescript-73GxLNLH.js","./coffeescript-CcHmp8ZW.js","./commonlisp-BAY0IMda.js","./commonlisp-DHrixoxv.js","./cypher-CpQ0ACJl.js","./cypher-q6-coHOK.js","./python-xiYauDc4.js","./python-C4CVWZ7v.js","./crystal-DLlr59il.js","./crystal-fOwNIMzy.js","./d-BFwRCF-p.js","./d-Drt6ZXrF.js","./diff-Ib_BKd8h.js","./diff-CYBnW6ZU.js","./dockerfile-DJkHQgkl.js","./simple-mode-DXiLM1-G.js","./dtd-DgBHwr-e.js","./dtd-DqGG8R4P.js","./dylan-fdbf6J3T.js","./dylan-BTCYgsmh.js","./ecl-K_KNI3_u.js","./ecl-BPsxRGqR.js","./eiffel-DatcW1fL.js","./eiffel-BCguJEP-.js","./elm-DbcUgz-o.js","./elm-DnNeI1M2.js","./erlang-BistxQAs.js","./erlang-DkHPV6ru.js","./factor-DwQNJbiW.js","./factor-ZZBBZpXK.js","./forth-B-tqi4f_.js","./forth-DUDizG3o.js","./fortran-C9M6nI39.js","./fortran-BarbOvgW.js","./mllike-DHDLWZl9.js","./mllike-BKN6OcTc.js","./gas-DJ-ntEw0.js","./gas-mybzrfIH.js","./gherkin-Co7qm0Mt.js","./gherkin-BlnXaZZf.js","./groovy-DkYAhc5g.js","./groovy-cYuFC_ot.js","./haskell-QbTWCmtk.js","./haskell-CuLp9g3a.js","./haxe-CmR2u-6B.js","./haxe-CiIUZbdX.js","./idl-DY5VfUGL.js","./idl-BHq7WyPV.js","./javascript-BWjar7HY.js","./javascript-D-FtdkNC.js","./julia-CBfVM-ng.js","./julia-CoYYMTcZ.js","./livescript-CC7i4CEo.js","./livescript-C1gEZ5Hk.js","./lua-_4wuYo1j.js","./lua-CRIS5afH.js","./mirc-BASUkO3C.js","./mirc-CTGUd79I.js","./mathematica-DWMBVyLs.js","./mathematica-CwlrU_TQ.js","./modelica-C2NfUrdY.js","./modelica-DZs5SjV_.js","./mumps-DwVYUX8b.js","./mumps-BNg2Yq-1.js","./mbox-DvNfx9hX.js","./mbox-skR0V6cu.js","./nsis-CSHYJZux.js","./nsis-8kQdxo7f.js","./ntriples-CSqEHNgf.js","./ntriples-Ck5rp6GE.js","./octave-ImTMIie9.js","./octave-BRpd3hBF.js","./oz-BuYcBdKy.js","./oz-BUEZmvHT.js","./pascal-B50DmceL.js","./pascal-DBfxUwpj.js","./perl-DmFVAwdF.js","./perl-v9vsztCj.js","./pig-BnQuru9N.js","./pig-CrKTIB-m.js","./powershell-B1pJyAAD.js","./powershell-89xdb5K_.js","./properties-Ci7guRqV.js","./properties-DaUFoXFR.js","./protobuf-CoqP8wM5.js","./protobuf-Ci5XvpF4.js","./pug-CJsoo9v0.js","./pug-DPY-Ajan.js","./puppet-C9UYpvtZ.js","./puppet-Da8ZxG7z.js","./q-CKkOe1xA.js","./q-BjtI5Irp.js","./r-Bwc-y-iL.js","./r-vSi6pWDr.js","./rpm-UQSdNQr2.js","./rpm-Cv5HmAkX.js","./ruby-Bbksypm5.js","./ruby-UyKn0rKt.js","./sas-CssadkTB.js","./sas-D3-6PWmJ.js","./scheme-CkJWoRmu.js","./scheme-DqTb0ELD.js","./shell-FgUEpLdy.js","./shell-DySzVBqR.js","./sieve-BLxcNk7A.js","./sieve-CoBbN2aF.js","./smalltalk-d1Dbk6V4.js","./smalltalk-CJJAzHnb.js","./sparql-CUZhKeRb.js","./sparql-CjwbV0fX.js","./stylus-BvudHrj4.js","./stylus-uh0Gd-Iz.js","./swift-CUIczYYb.js","./swift-D5IK5OrP.js","./stex-3SJlFZg3.js","./stex-Dc5bKD4z.js","./verilog-DH7aBYt7.js","./verilog-DPWRmpYS.js","./tcl-SjROh4xB.js","./tcl-BvqzOD3a.js","./textile-DgW6fC9R.js","./textile--JQHE1pJ.js","./toml-BcC_uO4q.js","./toml-lWmHdWv5.js","./troff-BMlKH74u.js","./troff-r7W702V9.js","./ttcn-P2iYmK_j.js","./ttcn-1CwPIugQ.js","./ttcn-cfg-2bl9aE98.js","./ttcn-cfg-CHYEAF6D.js","./turtle-DDf6uD3p.js","./turtle-D_5eCUwg.js","./webidl-dw5if_Lv.js","./webidl-CNY2gQL0.js","./vb-CrfmF706.js","./vb-Vd6lTutg.js","./vbscript-Cpiv2llq.js","./vbscript-CcW6E3ma.js","./velocity-5N54agTA.js","./velocity-CuSicjhq.js","./vhdl-BmegRbqn.js","./vhdl-sLYad3YP.js","./xquery-CuDTgW6S.js","./xquery-d3Qdoigy.js","./yacas-Dn2coKff.js","./yacas-BjDXhrkW.js","./z80-ByJO5ysu.js","./z80-z4BkVl0y.js","./mscgen-C7woTLsY.js","./mscgen-Bo5N9WUj.js","./dist-CLE562nZ.js","./dist-DeuWxYVk.js","./dist-DTM7BAUu.js","./node-sql-parser-gD9ga-kL.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-B0Z9INg1.js";import{c as a,f as o,l as s,n as c,o as l,r as u,s as d}from"./useEvent-xfs0Sn4r.js";import{t as f}from"./react-CBDbhulC.js";import{t as p}from"./react-dom-BQrReHnR.js";import{$ as m,$a as h,$i as g,$n as _,$o as v,$r as y,$s as b,$t as x,A as S,Aa as C,Ai as w,An as T,Ao as E,Ar as D,As as O,At as k,B as ee,Ba as A,Bi as te,Bn as ne,Bo as j,Br as M,Bs as N,Bt as re,C as ie,Ca as P,Cc as ae,Ci as F,Cn as I,Co as oe,Cr as se,Cs as ce,Ct as le,D as ue,Da as de,Di as fe,Dn as pe,Do as me,Dr as he,Ds as ge,Dt as _e,E as ve,Ea as ye,Ei as be,En as xe,Eo as Se,Er as Ce,Es as we,Et as Te,F as Ee,Fa as De,Fi as Oe,Fn as ke,Fo as Ae,Fr as je,Fs as Me,Ft as Ne,G as Pe,Ga as Fe,Gi as Ie,Gn as Le,Go as Re,Gr as ze,Gs as Be,Gt as Ve,H as He,Ha as Ue,Hi as We,Hn as Ge,Ho as Ke,Hr as qe,Hs as Je,Ht as Ye,I as Xe,Ia as Ze,Ii as Qe,In as $e,Io as et,Ir as tt,Is as nt,It as rt,J as it,Ja as at,Ji as ot,Jn as st,Jo as ct,Jr as lt,Js as ut,Jt as dt,K as ft,Ka as pt,Ki as mt,Kn as ht,Ko as gt,Kr as _t,Ks as vt,Kt as yt,L as bt,La as xt,Li as St,Ln as Ct,Lo as wt,Lr as Tt,Ls as Et,Lt as Dt,M as Ot,Ma as kt,Mi as At,Mn as jt,Mo as Mt,Mr as Nt,Ms as Pt,Mt as Ft,N as It,Na as Lt,Ni as Rt,Nn as zt,No as Bt,Nr as Vt,Ns as Ht,Nt as Ut,O as Wt,Oa as Gt,Oi as Kt,On as qt,Oo as Jt,Or as Yt,Os as Xt,Ot as Zt,P as Qt,Pa as $t,Pi as en,Pn as tn,Po as nn,Pr as rn,Ps as an,Pt as on,Q as sn,Qa as cn,Qi as ln,Qn as un,Qo as dn,Qr as fn,Qs as pn,Qt as mn,R as hn,Ra as gn,Ri as _n,Rn as vn,Ro as yn,Rr as bn,Rs as xn,Rt as Sn,S as Cn,Sa as wn,Sc as Tn,Si as En,Sn as Dn,So as On,Sr as kn,Ss as An,St as jn,T as Mn,Ta as Nn,Ti as Pn,Tn as Fn,To as In,Tr as Ln,Ts as Rn,Tt as zn,U as Bn,Ua as Vn,Ui as Hn,Un,Uo as Wn,Ur as Gn,Us as Kn,Ut as qn,V as Jn,Va as Yn,Vi as Xn,Vn as Zn,Vo as Qn,Vr as $n,Vs as er,Vt as tr,W as nr,Wa as rr,Wi as ir,Wn as ar,Wo as or,Wr as sr,Ws as cr,Wt as lr,X as ur,Xa as dr,Xi as fr,Xn as pr,Xo as mr,Xr as hr,Xs as gr,Xt as _r,Y as vr,Ya as yr,Yi as br,Yn as xr,Yo as Sr,Yr as Cr,Ys as wr,Yt as Tr,Z as Er,Za as Dr,Zi as Or,Zn as kr,Zo as Ar,Zr as jr,Zs as Mr,Zt as Nr,_ as Pr,_a as Fr,_c as Ir,_i as Lr,_n as Rr,_o as zr,_r as Br,_s as Vr,_t as Hr,a as Ur,aa as Wr,ac as Gr,ai as Kr,an as qr,ao as Jr,ar as Yr,as as Xr,at as Zr,b as Qr,ba as $r,bc as ei,bi as ti,bn as ni,bo as ri,br as ii,bs as ai,bt as oi,c as si,ca as ci,cc as li,ci as ui,cn as di,co as fi,cr as pi,cs as mi,ct as hi,d as gi,da as _i,dc as vi,di as yi,dn as bi,do as xi,dr as Si,ds as Ci,dt as wi,ea as Ti,ec as Ei,ei as Di,en as Oi,eo as ki,er as Ai,es as ji,et as Mi,f as Ni,fa as Pi,fc as Fi,fi as Ii,fn as Li,fo as Ri,fr as zi,fs as Bi,ft as Vi,g as Hi,ga as Ui,gc as Wi,gi as Gi,gn as Ki,go as qi,gr as Ji,gs as Yi,gt as Xi,h as Zi,ha as Qi,hc as L,hi as $i,hn as ea,ho as ta,hr as na,hs as ra,ht as ia,i as aa,ia as oa,ic as sa,ii as ca,in as la,io as ua,ir as da,is as fa,it as pa,j as ma,ja as ha,ji as ga,jn as _a,jo as va,jr as ya,js as ba,jt as xa,k as Sa,ka as Ca,ki as wa,kn as Ta,ko as Ea,kr as Da,ks as Oa,kt as ka,l as Aa,la as ja,lc as Ma,li as Na,ln as Pa,lo as Fa,lr as Ia,ls as La,lt as Ra,m as za,ma as Ba,mc as R,mi as Va,mn as Ha,mo as Ua,mr as Wa,ms as Ga,mt as Ka,n as qa,na as Ja,nc as Ya,ni as Xa,nn as Za,no as Qa,nr as $a,ns as eo,nt as to,o as no,oa as ro,oc as io,oi as ao,on as oo,oo as so,or as co,os as lo,ot as uo,p as fo,pa as po,pc as z,pi as mo,pn as ho,po as go,pr as _o,ps as vo,pt as yo,q as bo,qa as xo,qi as So,qn as Co,qo as wo,qr as To,qs as Eo,qt as Do,r as Oo,ra as ko,rc as Ao,ri as jo,rn as Mo,ro as No,rr as Po,rs as Fo,rt as Io,s as Lo,sa as Ro,sc as zo,si as Bo,sn as Vo,so as Ho,sr as Uo,ss as Wo,st as Go,t as Ko,ta as qo,tc as Jo,ti as Yo,tn as Xo,to as Zo,tr as Qo,ts as $o,tt as es,u as ts,ua as ns,uc as rs,ui as is,un as as,uo as os,ur as ss,us as cs,ut as ls,v as us,va as ds,vc as fs,vi as ps,vn as ms,vo as hs,vr as gs,vs as _s,vt as vs,w as ys,wa as bs,wi as xs,wn as Ss,wo as Cs,wr as ws,ws as Ts,wt as Es,x as Ds,xa as Os,xc as ks,xi as As,xn as js,xo as Ms,xr as Ns,xs as Ps,xt as Fs,y as Is,ya as Ls,yc as Rs,yi as zs,yn as Bs,yo as Vs,yr as Hs,ys as Us,yt as Ws,z as Gs,za as Ks,zi as qs,zn as Js,zo as Ys,zr as Xs,zs as Zs,zt as Qs}from"./schemas-aTUejmFi.js";import{t as $s}from"./compiler-runtime-CYIjoINj.js";import{t as ec}from"./debounce-aFmHgJZY.js";import{c as tc,g as nc,h as rc,t as ic,x as ac}from"./utils-CUZQNAWJ.js";import{_ as oc,a as sc,d as cc,f as lc,g as B,n as uc,o as dc,r as fc}from"./useEventListener-D27Dii_l.js";import{t as pc}from"./objects-snlMn4yk.js";import{t as mc}from"./invariant-Ci2dTZ72.js";import{C as hc,D as gc,N as _c,O as vc,P as yc,S as bc,r as xc}from"./config-DaNyNpZL.js";import{n as Sc,t as V}from"./cn-ldLVeaqm.js";import{t as Cc}from"./jsx-runtime-B74pBk57.js";import{C as wc,T as Tc,_ as Ec,b as Dc,c as Oc,d as kc,f as Ac,g as jc,h as Mc,i as Nc,m as Pc,o as Fc,p as Ic,r as Lc,s as Rc,t as zc,u as Bc,v as Vc,w as Hc,x as Uc,y as Wc}from"./fullscreen-0EEPR7uc.js";import{a as Gc,i as Kc,l as qc,n as Jc,o as Yc,r as Xc,t as Zc}from"./dist-BgL43w5r.js";import{c as Qc,d as $c,n as el,o as tl,t as nl,u as rl}from"./menu-items-BSVrMleU.js";import{_ as il,g as al,h as ol,p as sl}from"./alert-dialog-DBoy-FMx.js";import{a as cl,c as ll,d as ul,h as dl,i as fl,l as pl,n as ml,o as hl,r as gl,s as _l,t as vl}from"./select-BUEX2Vfl.js";import{i as yl,n as bl,r as xl,t as Sl}from"./circle--ysFeW9z.js";import{i as Cl,t as wl}from"./tooltip-D7dq6bnc.js";import{r as Tl,t as El}from"./button-BMBznEru.js";import{$t as Dl,A as Ol,C as kl,D as Al,Gt as jl,H as Ml,Ht as Nl,I as Pl,Jt as Fl,K as Il,Kt as Ll,Nt as Rl,Pt as zl,Qt as Bl,Rt as Vl,S as Hl,T as Ul,Tt as H,U as Wl,Ut as U,W as Gl,Wt as Kl,X as ql,Yt as Jl,Zt as Yl,_t as Xl,at as Zl,b as Ql,bt as $l,ct as eu,dt as tu,en as nu,f as ru,it as iu,jt as au,k as ou,kt as su,l as W,ot as cu,p as lu,pt as uu,q as du,qt as fu,st as pu,u as mu,ut as hu,wt as gu,z as _u}from"./dist-PIe1xcZo.js";import{A as vu,C as yu,D as bu,E as xu,S as Su,T as Cu,_ as wu,d as Tu,h as Eu,j as Du,k as Ou,m as ku,n as Au,o as ju,s as Mu,t as Nu,u as Pu,v as Fu,z as Iu}from"./dist-CbQrIaPV.js";import{a as Lu,i as Ru,l as zu,n as Bu,p as Vu,r as Hu}from"./arrays-BqUx5USx.js";import{n as Uu}from"./once-Haz_uxEL.js";import{t as Wu}from"./capabilities-LWzb3E3M.js";import{t as Gu}from"./cjs-C49f7GXV.js";import{t as Ku}from"./createReducer-Bq-nQJiK.js";import{d as qu,l as Ju,n as Yu,o as Xu,p as Zu,r as Qu}from"./dist-Dz_04liz.js";import{n as $u,t as ed}from"./useNonce-BTM6-ANi.js";import{i as td,r as nd,t as rd}from"./strings-CpYReX2Q.js";import{t as id}from"./requests-C6_IaFh7.js";import{a as ad,c as od,d as sd,f as cd,i as ld,l as ud,n as dd,o as fd,r as pd,s as md,t as hd,u as gd}from"./dist-B97dKQGP.js";import{t as _d}from"./createLucideIcon-B7HeEoG2.js";import{a as vd,i as yd,o as bd,r as xd,t as Sd}from"./useLifecycle-BUaJcygz.js";import{t as Cd}from"./check-BoA6XBpj.js";import{a as wd,r as Td}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as Ed,u as Dd}from"./toDate-hGYJX0Ha.js";import{t as Od}from"./database-zap-CloO6gbw.js";import{C as kd,N as Ad,P as jd,T as Md,b as Nd,c as Pd,d as Fd,f as Id,i as Ld,n as Rd,o as zd,s as Bd,t as Vd,u as Hd,v as Ud,w as Wd}from"./write-secret-modal-BG_B6y1P.js";import{t as Gd}from"./plus-C4J9gIE1.js";import{Wt as Kd,n as qd,t as Jd}from"./input-DeyycFtq.js";import{t as Yd}from"./trash-2-D_HX-0qx.js";import{t as Xd}from"./badge-D_-uqy2N.js";import{t as G}from"./preload-helper-HclGiUj8.js";import{a as Zd,s as Qd}from"./dist-DCc0VfiO.js";import{a as $d,i as ef,n as tf,r as nf,t as rf}from"./dist-DzAWvPVK.js";import{n as af}from"./stex-Dc5bKD4z.js";import{t as of}from"./use-toast-DpWHUGuF.js";import{n as sf}from"./paths-zcL04qUW.js";import{n as cf}from"./useTheme-D3zvxdF3.js";import{n as lf}from"./useAsyncData-Buhk-UgR.js";import{t as uf}from"./purify.es-DrVcFY1Q.js";var df=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ff=i(((e,t)=>{t.exports=df()})),pf=i((e=>{var t=ff(),n=f(),r=p();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function ne(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?ne(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var j=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],P=-1;function ae(e){return{current:e}}function F(e){0>P||(e.current=ie[P],ie[P]=null,P--)}function I(e,t){P++,ie[P]=e.current,e.current=t}var oe=ae(null),se=ae(null),ce=ae(null),le=ae(null);function ue(e,t){switch(I(ce,t),I(se,e),I(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yd(t),e=Xd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(oe),I(oe,e)}function de(){F(oe),F(se),F(ce)}function fe(e){e.memoizedState!==null&&I(le,e);var t=oe.current,n=Xd(t,e.type);t!==n&&(I(se,e),I(oe,n))}function pe(e){se.current===e&&(F(oe),F(se)),le.current===e&&(F(le),op._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
|
|
2
|
+
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-B0Z9INg1.js";import{c as a,f as o,l as s,n as c,o as l,r as u,s as d}from"./useEvent-xfs0Sn4r.js";import{t as f}from"./react-CBDbhulC.js";import{t as p}from"./react-dom-BQrReHnR.js";import{$ as m,$a as h,$i as g,$n as _,$o as v,$r as y,$s as b,$t as x,A as S,Aa as C,Ai as w,An as T,Ao as E,Ar as D,As as O,At as k,B as ee,Ba as A,Bi as te,Bn as ne,Bo as j,Br as M,Bs as N,Bt as re,C as ie,Ca as P,Cc as ae,Ci as F,Cn as I,Co as oe,Cr as se,Cs as ce,Ct as le,D as ue,Da as de,Di as fe,Dn as pe,Do as me,Dr as he,Ds as ge,Dt as _e,E as ve,Ea as ye,Ei as be,En as xe,Eo as Se,Er as Ce,Es as we,Et as Te,F as Ee,Fa as De,Fi as Oe,Fn as ke,Fo as Ae,Fr as je,Fs as Me,Ft as Ne,G as Pe,Ga as Fe,Gi as Ie,Gn as Le,Go as Re,Gr as ze,Gs as Be,Gt as Ve,H as He,Ha as Ue,Hi as We,Hn as Ge,Ho as Ke,Hr as qe,Hs as Je,Ht as Ye,I as Xe,Ia as Ze,Ii as Qe,In as $e,Io as et,Ir as tt,Is as nt,It as rt,J as it,Ja as at,Ji as ot,Jn as st,Jo as ct,Jr as lt,Js as ut,Jt as dt,K as ft,Ka as pt,Ki as mt,Kn as ht,Ko as gt,Kr as _t,Ks as vt,Kt as yt,L as bt,La as xt,Li as St,Ln as Ct,Lo as wt,Lr as Tt,Ls as Et,Lt as Dt,M as Ot,Ma as kt,Mi as At,Mn as jt,Mo as Mt,Mr as Nt,Ms as Pt,Mt as Ft,N as It,Na as Lt,Ni as Rt,Nn as zt,No as Bt,Nr as Vt,Ns as Ht,Nt as Ut,O as Wt,Oa as Gt,Oi as Kt,On as qt,Oo as Jt,Or as Yt,Os as Xt,Ot as Zt,P as Qt,Pa as $t,Pi as en,Pn as tn,Po as nn,Pr as rn,Ps as an,Pt as on,Q as sn,Qa as cn,Qi as ln,Qn as un,Qo as dn,Qr as fn,Qs as pn,Qt as mn,R as hn,Ra as gn,Ri as _n,Rn as vn,Ro as yn,Rr as bn,Rs as xn,Rt as Sn,S as Cn,Sa as wn,Sc as Tn,Si as En,Sn as Dn,So as On,Sr as kn,Ss as An,St as jn,T as Mn,Ta as Nn,Ti as Pn,Tn as Fn,To as In,Tr as Ln,Ts as Rn,Tt as zn,U as Bn,Ua as Vn,Ui as Hn,Un,Uo as Wn,Ur as Gn,Us as Kn,Ut as qn,V as Jn,Va as Yn,Vi as Xn,Vn as Zn,Vo as Qn,Vr as $n,Vs as er,Vt as tr,W as nr,Wa as rr,Wi as ir,Wn as ar,Wo as or,Wr as sr,Ws as cr,Wt as lr,X as ur,Xa as dr,Xi as fr,Xn as pr,Xo as mr,Xr as hr,Xs as gr,Xt as _r,Y as vr,Ya as yr,Yi as br,Yn as xr,Yo as Sr,Yr as Cr,Ys as wr,Yt as Tr,Z as Er,Za as Dr,Zi as Or,Zn as kr,Zo as Ar,Zr as jr,Zs as Mr,Zt as Nr,_ as Pr,_a as Fr,_c as Ir,_i as Lr,_n as Rr,_o as zr,_r as Br,_s as Vr,_t as Hr,a as Ur,aa as Wr,ac as Gr,ai as Kr,an as qr,ao as Jr,ar as Yr,as as Xr,at as Zr,b as Qr,ba as $r,bc as ei,bi as ti,bn as ni,bo as ri,br as ii,bs as ai,bt as oi,c as si,ca as ci,cc as li,ci as ui,cn as di,co as fi,cr as pi,cs as mi,ct as hi,d as gi,da as _i,dc as vi,di as yi,dn as bi,do as xi,dr as Si,ds as Ci,dt as wi,ea as Ti,ec as Ei,ei as Di,en as Oi,eo as ki,er as Ai,es as ji,et as Mi,f as Ni,fa as Pi,fc as Fi,fi as Ii,fn as Li,fo as Ri,fr as zi,fs as Bi,ft as Vi,g as Hi,ga as Ui,gc as Wi,gi as Gi,gn as Ki,go as qi,gr as Ji,gs as Yi,gt as Xi,h as Zi,ha as Qi,hc as L,hi as $i,hn as ea,ho as ta,hr as na,hs as ra,ht as ia,i as aa,ia as oa,ic as sa,ii as ca,in as la,io as ua,ir as da,is as fa,it as pa,j as ma,ja as ha,ji as ga,jn as _a,jo as va,jr as ya,js as ba,jt as xa,k as Sa,ka as Ca,ki as wa,kn as Ta,ko as Ea,kr as Da,ks as Oa,kt as ka,l as Aa,la as ja,lc as Ma,li as Na,ln as Pa,lo as Fa,lr as Ia,ls as La,lt as Ra,m as za,ma as Ba,mc as R,mi as Va,mn as Ha,mo as Ua,mr as Wa,ms as Ga,mt as Ka,n as qa,na as Ja,nc as Ya,ni as Xa,nn as Za,no as Qa,nr as $a,ns as eo,nt as to,o as no,oa as ro,oc as io,oi as ao,on as oo,oo as so,or as co,os as lo,ot as uo,p as fo,pa as po,pc as z,pi as mo,pn as ho,po as go,pr as _o,ps as vo,pt as yo,q as bo,qa as xo,qi as So,qn as Co,qo as wo,qr as To,qs as Eo,qt as Do,r as Oo,ra as ko,rc as Ao,ri as jo,rn as Mo,ro as No,rr as Po,rs as Fo,rt as Io,s as Lo,sa as Ro,sc as zo,si as Bo,sn as Vo,so as Ho,sr as Uo,ss as Wo,st as Go,t as Ko,ta as qo,tc as Jo,ti as Yo,tn as Xo,to as Zo,tr as Qo,ts as $o,tt as es,u as ts,ua as ns,uc as rs,ui as is,un as as,uo as os,ur as ss,us as cs,ut as ls,v as us,va as ds,vc as fs,vi as ps,vn as ms,vo as hs,vr as gs,vs as _s,vt as vs,w as ys,wa as bs,wi as xs,wn as Ss,wo as Cs,wr as ws,ws as Ts,wt as Es,x as Ds,xa as Os,xc as ks,xi as As,xn as js,xo as Ms,xr as Ns,xs as Ps,xt as Fs,y as Is,ya as Ls,yc as Rs,yi as zs,yn as Bs,yo as Vs,yr as Hs,ys as Us,yt as Ws,z as Gs,za as Ks,zi as qs,zn as Js,zo as Ys,zr as Xs,zs as Zs,zt as Qs}from"./schemas-aTUejmFi.js";import{t as $s}from"./compiler-runtime-CYIjoINj.js";import{t as ec}from"./debounce-aFmHgJZY.js";import{c as tc,g as nc,h as rc,t as ic,x as ac}from"./utils-CUZQNAWJ.js";import{_ as oc,a as sc,d as cc,f as lc,g as B,n as uc,o as dc,r as fc}from"./useEventListener-D27Dii_l.js";import{t as pc}from"./objects-snlMn4yk.js";import{t as mc}from"./invariant-Ci2dTZ72.js";import{C as hc,D as gc,N as _c,O as vc,P as yc,S as bc,r as xc}from"./config-DaNyNpZL.js";import{n as Sc,t as V}from"./cn-ldLVeaqm.js";import{t as Cc}from"./jsx-runtime-B74pBk57.js";import{C as wc,T as Tc,_ as Ec,b as Dc,c as Oc,d as kc,f as Ac,g as jc,h as Mc,i as Nc,m as Pc,o as Fc,p as Ic,r as Lc,s as Rc,t as zc,u as Bc,v as Vc,w as Hc,x as Uc,y as Wc}from"./fullscreen-0EEPR7uc.js";import{a as Gc,i as Kc,l as qc,n as Jc,o as Yc,r as Xc,t as Zc}from"./dist-BgL43w5r.js";import{c as Qc,d as $c,n as el,o as tl,t as nl,u as rl}from"./menu-items-BSVrMleU.js";import{_ as il,g as al,h as ol,p as sl}from"./alert-dialog-BVi_GyOB.js";import{a as cl,c as ll,d as ul,h as dl,i as fl,l as pl,n as ml,o as hl,r as gl,s as _l,t as vl}from"./select-czJLm6jf.js";import{i as yl,n as bl,r as xl,t as Sl}from"./circle--ysFeW9z.js";import{i as Cl,t as wl}from"./tooltip-D7dq6bnc.js";import{r as Tl,t as El}from"./button-Btj6GXNy.js";import{$t as Dl,A as Ol,C as kl,D as Al,Gt as jl,H as Ml,Ht as Nl,I as Pl,Jt as Fl,K as Il,Kt as Ll,Nt as Rl,Pt as zl,Qt as Bl,Rt as Vl,S as Hl,T as Ul,Tt as H,U as Wl,Ut as U,W as Gl,Wt as Kl,X as ql,Yt as Jl,Zt as Yl,_t as Xl,at as Zl,b as Ql,bt as $l,ct as eu,dt as tu,en as nu,f as ru,it as iu,jt as au,k as ou,kt as su,l as W,ot as cu,p as lu,pt as uu,q as du,qt as fu,st as pu,u as mu,ut as hu,wt as gu,z as _u}from"./dist-PIe1xcZo.js";import{A as vu,C as yu,D as bu,E as xu,S as Su,T as Cu,_ as wu,d as Tu,h as Eu,j as Du,k as Ou,m as ku,n as Au,o as ju,s as Mu,t as Nu,u as Pu,v as Fu,z as Iu}from"./dist-CbQrIaPV.js";import{a as Lu,i as Ru,l as zu,n as Bu,p as Vu,r as Hu}from"./arrays-BqUx5USx.js";import{n as Uu}from"./once-Haz_uxEL.js";import{t as Wu}from"./capabilities-LWzb3E3M.js";import{t as Gu}from"./cjs-C49f7GXV.js";import{t as Ku}from"./createReducer-Bq-nQJiK.js";import{d as qu,l as Ju,n as Yu,o as Xu,p as Zu,r as Qu}from"./dist-Dz_04liz.js";import{n as $u,t as ed}from"./useNonce-BTM6-ANi.js";import{i as td,r as nd,t as rd}from"./strings-CpYReX2Q.js";import{t as id}from"./requests-C6_IaFh7.js";import{a as ad,c as od,d as sd,f as cd,i as ld,l as ud,n as dd,o as fd,r as pd,s as md,t as hd,u as gd}from"./dist-B97dKQGP.js";import{t as _d}from"./createLucideIcon-B7HeEoG2.js";import{a as vd,i as yd,o as bd,r as xd,t as Sd}from"./useLifecycle-BUaJcygz.js";import{t as Cd}from"./check-BoA6XBpj.js";import{a as wd,r as Td}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as Ed,u as Dd}from"./toDate-hGYJX0Ha.js";import{t as Od}from"./database-zap-CloO6gbw.js";import{C as kd,N as Ad,P as jd,T as Md,b as Nd,c as Pd,d as Fd,f as Id,i as Ld,n as Rd,o as zd,s as Bd,t as Vd,u as Hd,v as Ud,w as Wd}from"./write-secret-modal-lNU_7c2x.js";import{t as Gd}from"./plus-C4J9gIE1.js";import{Wt as Kd,n as qd,t as Jd}from"./input-Daz6sk8l.js";import{t as Yd}from"./trash-2-D_HX-0qx.js";import{t as Xd}from"./badge-D_-uqy2N.js";import{t as G}from"./preload-helper-HclGiUj8.js";import{a as Zd,s as Qd}from"./dist-DCc0VfiO.js";import{a as $d,i as ef,n as tf,r as nf,t as rf}from"./dist-DzAWvPVK.js";import{n as af}from"./stex-Dc5bKD4z.js";import{t as of}from"./use-toast-DpWHUGuF.js";import{n as sf}from"./paths-zcL04qUW.js";import{n as cf}from"./useTheme-D3zvxdF3.js";import{n as lf}from"./useAsyncData-Buhk-UgR.js";import{t as uf}from"./purify.es-DrVcFY1Q.js";var df=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ff=i(((e,t)=>{t.exports=df()})),pf=i((e=>{var t=ff(),n=f(),r=p();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function ne(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?ne(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var j=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],P=-1;function ae(e){return{current:e}}function F(e){0>P||(e.current=ie[P],ie[P]=null,P--)}function I(e,t){P++,ie[P]=e.current,e.current=t}var oe=ae(null),se=ae(null),ce=ae(null),le=ae(null);function ue(e,t){switch(I(ce,t),I(se,e),I(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yd(t),e=Xd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(oe),I(oe,e)}function de(){F(oe),F(se),F(ce)}function fe(e){e.memoizedState!==null&&I(le,e);var t=oe.current,n=Xd(t,e.type);t!==n&&(I(se,e),I(oe,n))}function pe(e){se.current===e&&(F(oe),F(se)),le.current===e&&(F(le),op._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
5
|
`),l=s.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{Xi as n,Yi as r,ta as i}from"./cells-DNoi9Edm.js";import{In as a,kt as o,un as s,wt as c}from"./schemas-aTUejmFi.js";import{t as l}from"./compiler-runtime-CYIjoINj.js";import{t as u}from"./isEmpty-BJso7_X0.js";import{et as d}from"./ai-model-dropdown-iY9cMHva.js";import{g as f}from"./useEventListener-D27Dii_l.js";import{t as p}from"./cn-ldLVeaqm.js";import{t as m}from"./jsx-runtime-B74pBk57.js";import{a as h,i as g,o as _,r as v}from"./config-Cl3eMWxb.js";import{t as y}from"./button-BMBznEru.js";import{i as b}from"./strings-CpYReX2Q.js";import{t as x}from"./createLucideIcon-B7HeEoG2.js";import{t as S}from"./ban-CwXfMsC1.js";import{t as C}from"./bot-message-square-CGhPjWFf.js";import{a as w}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as T}from"./markdown-renderer-CB2UurmB.js";import{p as E,u as D}from"./add-cell-with-ai-CEAJAnUT.js";import{t as O}from"./external-link-Bp3BxyRA.js";import{n as k}from"./spinner-Ck-Hgfvj.js";import{l as A}from"./datasource-DVv7qUFu.js";import{t as j}from"./RenderHTML-DyTQ_aJR.js";var M=x(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),N=x(`shield-question-mark`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),P=`user_cancelled`;function F(e){if(e.type===`abort`)return e.reason}function I(e){return e.isAbort?e.streamReason||`user_cancelled`:null}function L(e){switch(e){case P:return`Generation stopped`;case`timeout`:return`Generation stopped: timed out`;default:return`Generation stopped: ${e}`}}var R=l(),z=e(t(),1),B=m(),V=e=>{let t=(0,R.c)(13),{reasoning:n,index:r,isStreaming:i}=e,a=r===void 0?0:r,o=i!==void 0&&i,[s,c]=z.useState(``);if(!n&&!o)return null;let l=o?`reasoning`:s,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,B.jsx)(C,{className:`h-3 w-3`}),t[0]=u):u=t[0];let d=o?`Thinking`:`View reasoning`,f=n.length>0&&` (${n.length} chars)`,p;t[1]!==d||t[2]!==f?(p=(0,B.jsx)(_,{className:`text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[u,d,f]})}),t[1]=d,t[2]=f,t[3]=p):p=t[3];let m;t[4]===n?m=t[5]:(m=(0,B.jsx)(g,{className:`pb-2 px-2`,children:(0,B.jsx)(`div`,{className:`bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative`,children:(0,B.jsx)(`div`,{className:`pr-6`,children:(0,B.jsx)(T,{content:n})})})}),t[4]=n,t[5]=m);let y;t[6]!==p||t[7]!==m?(y=(0,B.jsxs)(h,{value:`reasoning`,className:`border-0`,children:[p,m]}),t[6]=p,t[7]=m,t[8]=y):y=t[8];let b;return t[9]!==a||t[10]!==l||t[11]!==y?(b=(0,B.jsx)(v,{type:`single`,collapsible:!0,className:`w-full mb-2`,value:l,onValueChange:c,children:y},a),t[9]=a,t[10]=l,t[11]=y,t[12]=b):b=t[12],b};function H(e){return e.replace(`tool-`,``)}var U=e=>{let t=(0,R.c)(9),{input:n,label:r}=e,i=r===void 0?`Tool Request`:r;if(n==null)return null;let a;t[0]===i?a=t[1]:(a=(0,B.jsx)(`h3`,{className:`text-xs font-semibold text-muted-foreground`,children:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=JSON.stringify(n,null,2),t[2]=n,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,B.jsx)(`pre`,{className:`bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64`,children:o}),t[4]=o,t[5]=s);let c;return t[6]!==a||t[7]!==s?(c=(0,B.jsxs)(`div`,{className:`space-y-2`,children:[a,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8],c},W=e=>{let t=(0,R.c)(27),{toolName:n,input:r,approval:i,onApprove:a,className:o}=e,s;t[0]===o?s=t[1]:(s=p(`rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3`,o),t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=H(n),t[2]=n,t[3]=c);let l=`Approval required for ${c}`,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,B.jsx)(N,{className:`h-4 w-4 text-(--amber-11) mt-0.5 shrink-0`}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(`span`,{className:`font-semibold`,children:`Approval required:`}),t[5]=d):d=t[5];let f;t[6]===n?f=t[7]:(f=H(n),t[6]=n,t[7]=f);let m;t[8]===f?m=t[9]:(m=(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[u,(0,B.jsxs)(`div`,{className:`text-xs text-(--amber-11) leading-relaxed`,children:[d,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:f})]})]}),t[8]=f,t[9]=m);let h;t[10]===r?h=t[11]:(h=(0,B.jsx)(U,{input:r}),t[10]=r,t[11]=h);let g;t[12]!==i.id||t[13]!==a?(g=(0,B.jsx)(y,{size:`xs`,variant:`outline`,onClick:()=>a({id:i.id,approved:!1}),children:`Deny`}),t[12]=i.id,t[13]=a,t[14]=g):g=t[14];let _;t[15]!==i.id||t[16]!==a?(_=(0,B.jsx)(y,{size:`xs`,onClick:()=>a({id:i.id,approved:!0}),children:`Approve`}),t[15]=i.id,t[16]=a,t[17]=_):_=t[17];let v;t[18]!==_||t[19]!==g?(v=(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[g,_]}),t[18]=_,t[19]=g,t[20]=v):v=t[20];let b;return t[21]!==s||t[22]!==v||t[23]!==l||t[24]!==m||t[25]!==h?(b=(0,B.jsxs)(`div`,{className:s,role:`alertdialog`,"aria-label":l,children:[m,h,v]}),t[21]=s,t[22]=v,t[23]=l,t[24]=m,t[25]=h,t[26]=b):b=t[26],b},G=e=>{let t=(0,R.c)(28),{toolName:n,input:r,errorText:a,isLive:o,className:s}=e,[c,l]=z.useState(o),u=z.useRef(o),d,f;t[0]===o?(d=t[1],f=t[2]):(d=()=>{u.current&&!o&&l(!1),u.current=o},f=[o],t[0]=o,t[1]=d,t[2]=f),z.useEffect(d,f);let m;t[3]===s?m=t[4]:(m=p(`rounded-md border border-(--red-6) bg-(--red-2)`,s),t[3]=s,t[4]=m);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>l(K),t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,B.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`}),t[6]=g):g=t[6];let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,B.jsx)(`span`,{className:`font-semibold`,children:`Failed:`}),t[7]=_):_=t[7];let v;t[8]===n?v=t[9]:(v=H(n),t[8]=n,t[9]=v);let y;t[10]===v?y=t[11]:(y=(0,B.jsxs)(`span`,{className:`flex-1 text-left`,children:[_,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:v})]}),t[10]=v,t[11]=y);let b=c&&`rotate-180`,x;t[12]===b?x=t[13]:(x=p(`h-3.5 w-3.5 shrink-0 transition-transform`,b),t[12]=b,t[13]=x);let S;t[14]===x?S=t[15]:(S=(0,B.jsx)(w,{className:x}),t[14]=x,t[15]=S);let C;t[16]!==c||t[17]!==S||t[18]!==y?(C=(0,B.jsxs)(`button`,{type:`button`,onClick:h,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-(--red-11) hover:bg-(--red-3) rounded-md transition-colors`,"aria-expanded":c,children:[g,y,S]}),t[16]=c,t[17]=S,t[18]=y,t[19]=C):C=t[19];let T;t[20]!==a||t[21]!==r||t[22]!==c?(T=c&&(0,B.jsxs)(`div`,{className:`px-3 pb-3 space-y-3 border-t border-(--red-6)/40 pt-3`,children:[(0,B.jsx)(U,{input:r}),a&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-xs font-semibold text-(--red-11) mb-1`,children:`Error`}),(0,B.jsx)(`pre`,{className:`bg-(--red-2) border border-(--red-6) rounded p-2 text-xs text-(--red-11) leading-relaxed overflow-auto scrollbar-thin max-h-64 whitespace-pre-wrap`,children:a})]})]}),t[20]=a,t[21]=r,t[22]=c,t[23]=T):T=t[23];let E;return t[24]!==C||t[25]!==T||t[26]!==m?(E=(0,B.jsxs)(`div`,{className:m,children:[C,T]}),t[24]=C,t[25]=T,t[26]=m,t[27]=E):E=t[27],E};function K(e){return!e}function q(e){return e==null||typeof e==`object`&&u(e)}var J=s({status:a().default(`success`),auth_required:o().default(!1),action_url:c(),next_steps:c(),meta:c(),message:a().nullish()}),Y=e=>{let t=(0,R.c)(12),{data:n}=e,i;if(t[0]!==n){let{status:e,auth_required:a,action_url:o,meta:s,next_steps:c,message:l,...u}=n,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(`h3`,{className:`text-xs font-semibold text-muted-foreground`,children:`Tool Result`}),t[2]=d):d=t[2];let f;t[3]===e?f=t[4]:(f=(0,B.jsx)(`span`,{className:`text-xs px-2 py-0.5 bg-(--grass-2) text-(--grass-11) rounded-full font-medium capitalize`,children:e}),t[3]=e,t[4]=f);let p;t[5]===a?p=t[6]:(p=a&&(0,B.jsx)(`span`,{className:`text-xs px-2 py-0.5 bg-(--amber-2) text-(--amber-11) rounded-full`,children:`Auth Required`}),t[5]=a,t[6]=p);let m;t[7]!==f||t[8]!==p?(m=(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[d,(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f,p]})]}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===l?h=t[11]:(h=l&&(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,B.jsx)(r,{className:`h-3 w-3 text-(--blue-11) mt-0.5 shrink-0`}),(0,B.jsx)(`div`,{className:`text-xs text-foreground`,children:l})]}),t[10]=l,t[11]=h),i=(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[m,h,u&&(0,B.jsx)(`div`,{className:`space-y-3`,children:Object.entries(u).map(Z)})]}),t[0]=n,t[1]=i}else i=t[1];return i},X=e=>{let t=(0,R.c)(8),{result:n}=e,r;t[0]===n?r=t[1]:(r=J.safeParse(n),t[0]=n,t[1]=r);let i=r;if(i.success){let e;return t[2]===i.data?e=t[3]:(e=(0,B.jsx)(Y,{data:i.data}),t[2]=i.data,t[3]=e),e}let a;t[4]===n?a=t[5]:(a=typeof n==`string`?n:JSON.stringify(n,null,2),t[4]=n,t[5]=a);let o;return t[6]===a?o=t[7]:(o=(0,B.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-1 max-h-64 overflow-y-auto scrollbar-thin`,children:a}),t[6]=a,t[7]=o),o};function Z(e){let[t,n]=e;return q(n)?null:(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}),(0,B.jsx)(`pre`,{className:`bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64`,children:JSON.stringify(n,null,2)})]},t)}var ee={"input-streaming":`Generating`,"input-available":`Running`,"approval-responded":`Awaiting result`,"output-available":`Done`,"output-denied":`Denied`},te=new Set([`input-streaming`,`input-available`,`approval-responded`]),ne=e=>{let t=(0,R.c)(5),{state:n,interrupted:r}=e;if(r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(M,{className:`h-3 w-3 text-muted-foreground`}),t[0]=e):e=t[0],e}switch(n){case`input-streaming`:case`input-available`:case`approval-responded`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(k,{className:`h-3 w-3 animate-spin`}),t[1]=e):e=t[1],e}case`output-available`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(d,{className:`h-3 w-3 text-(--grass-11)`}),t[2]=e):e=t[2],e}case`output-denied`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(S,{className:`h-3 w-3 text-muted-foreground`}),t[3]=e):e=t[3],e}default:{b(n);let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(A,{className:`h-3 w-3`}),t[4]=e):e=t[4],e}}};function re(e){switch(e){case`output-available`:return`text-(--grass-11)/80`;case`output-denied`:return`text-muted-foreground`;case`input-streaming`:case`input-available`:case`approval-responded`:return``;default:return b(e),``}}var Q=e=>{let t=(0,R.c)(34),{toolName:n,state:r,input:i,result:a,approval:o,index:s,className:c,isActive:l}=e,u=s===void 0?0:s,d=l===void 0||l,f;t[0]!==d||t[1]!==r?(f=!d&&te.has(r),t[0]=d,t[1]=r,t[2]=f):f=t[2];let m=f,y=`tool-${u}`,b;t[3]===c?b=t[4]:(b=p(`w-full`,c),t[3]=c,t[4]=b);let x;t[5]!==m||t[6]!==r?(x=p(`h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline`,m?`text-muted-foreground`:re(r)),t[5]=m,t[6]=r,t[7]=x):x=t[7];let S;t[8]!==m||t[9]!==r?(S=(0,B.jsx)(ne,{state:r,interrupted:m}),t[8]=m,t[9]=r,t[10]=S):S=t[10];let C=m?`Interrupted`:ee[r],w;t[11]===n?w=t[12]:(w=H(n),t[11]=n,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:w}),t[13]=w,t[14]=T);let E;t[15]!==T||t[16]!==S||t[17]!==C?(E=(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[S,C,`:`,T]}),t[15]=T,t[16]=S,t[17]=C,t[18]=E):E=t[18];let D;t[19]!==E||t[20]!==x?(D=(0,B.jsx)(_,{className:x,children:E}),t[19]=E,t[20]=x,t[21]=D):D=t[21];let O;t[22]!==o||t[23]!==i||t[24]!==a||t[25]!==r?(O=(0,B.jsx)(g,{className:`py-2 px-2`,children:(0,B.jsx)(ie,{state:r,input:i,result:a,approval:o})}),t[22]=o,t[23]=i,t[24]=a,t[25]=r,t[26]=O):O=t[26];let k;t[27]!==D||t[28]!==O?(k=(0,B.jsxs)(h,{value:`tool-call`,className:`border-0`,children:[D,O]}),t[27]=D,t[28]=O,t[29]=k):k=t[29];let A;return t[30]!==k||t[31]!==y||t[32]!==b?(A=(0,B.jsx)(v,{type:`single`,collapsible:!0,className:b,children:k},y),t[30]=k,t[31]=y,t[32]=b,t[33]=A):A=t[33],A},ie=e=>{let t=(0,R.c)(16),{state:n,input:r,result:i,approval:a}=e;switch(n){case`input-streaming`:case`input-available`:case`approval-responded`:{let e;return t[0]===r?e=t[1]:(e=(0,B.jsx)(U,{input:r}),t[0]=r,t[1]=e),e}case`output-available`:{let e;t[2]===r?e=t[3]:(e=(0,B.jsx)(U,{input:r}),t[2]=r,t[3]=e);let n;t[4]===i?n=t[5]:(n=i!=null&&(0,B.jsx)(X,{result:i}),t[4]=i,t[5]=n);let a;return t[6]!==e||t[7]!==n?(a=(0,B.jsxs)(`div`,{className:`space-y-3`,children:[e,n]}),t[6]=e,t[7]=n,t[8]=a):a=t[8],a}case`output-denied`:{let e;t[9]===r?e=t[10]:(e=(0,B.jsx)(U,{input:r}),t[9]=r,t[10]=e);let n=a?.reason?`: ${a.reason}`:`.`,i;t[11]===n?i=t[12]:(i=(0,B.jsxs)(`div`,{className:`bg-muted/40 border border-border rounded-md p-3 text-xs text-muted-foreground leading-relaxed`,children:[`Tool execution was denied`,n]}),t[11]=n,t[12]=i);let o;return t[13]!==e||t[14]!==i?(o=(0,B.jsxs)(`div`,{className:`space-y-3`,children:[e,i]}),t[13]=e,t[14]=i,t[15]=o):o=t[15],o}default:return b(n),null}},$=e=>{let t=(0,R.c)(27),{toolName:n,state:r,result:i,errorText:a,input:o,approval:s,onApprove:c,index:l,className:u,isLive:d,isActive:f}=e,p=d===void 0||d,m=f===void 0||f;switch(r){case`approval-requested`:{if(s!=null&&c!=null){let e;return t[0]!==s||t[1]!==u||t[2]!==o||t[3]!==c||t[4]!==n?(e=(0,B.jsx)(W,{toolName:n,input:o,approval:s,onApprove:c,className:u}),t[0]=s,t[1]=u,t[2]=o,t[3]=c,t[4]=n,t[5]=e):e=t[5],e}let e;return t[6]!==u||t[7]!==l||t[8]!==o||t[9]!==m||t[10]!==n?(e=(0,B.jsx)(Q,{toolName:n,state:`input-available`,input:o,index:l,className:u,isActive:m}),t[6]=u,t[7]=l,t[8]=o,t[9]=m,t[10]=n,t[11]=e):e=t[11],e}case`output-error`:{let e;return t[12]!==u||t[13]!==a||t[14]!==o||t[15]!==p||t[16]!==n?(e=(0,B.jsx)(G,{toolName:n,input:o,errorText:a,isLive:p,className:u}),t[12]=u,t[13]=a,t[14]=o,t[15]=p,t[16]=n,t[17]=e):e=t[17],e}case`input-streaming`:case`input-available`:case`approval-responded`:case`output-available`:case`output-denied`:{let e;return t[18]!==s||t[19]!==u||t[20]!==l||t[21]!==o||t[22]!==m||t[23]!==i||t[24]!==r||t[25]!==n?(e=(0,B.jsx)(Q,{toolName:n,state:r,input:o,result:i,approval:s,index:l,className:u,isActive:m}),t[18]=s,t[19]=u,t[20]=l,t[21]=o,t[22]=m,t[23]=i,t[24]=r,t[25]=n,t[26]=e):e=t[26],e}default:return b(r),null}},ae=({message:e,isStreamingReasoning:t,isLast:r,isActive:i,addToolApprovalResponse:a})=>{return(0,B.jsx)(B.Fragment,{children:e.parts.map((e,t)=>o(e,t))});function o(o,s){if(oe(o))return(0,B.jsx)($,{index:s,toolName:o.type,result:o.output,errorText:o.state===`output-error`?o.errorText:void 0,className:`my-2`,state:o.state,input:o.input,approval:o.approval,onApprove:a,isLive:r,isActive:i},s);if(se(o))return f.debug(`Found data part`,o),null;switch(o.type){case`text`:return o.text.includes(`<marimo-`)?(0,B.jsx)(z.Fragment,{children:j({html:o.text})},s):(0,B.jsx)(T,{content:o.text},s);case`reasoning`:return(0,B.jsx)(V,{reasoning:o.text,index:s,isStreaming:t&&r&&s===(e.parts.length||0)-1},s);case`file`:return(0,B.jsx)(D,{attachment:o},s);case`reasoning-file`:return(0,B.jsx)(D,{attachment:{type:`file`,mediaType:o.mediaType,url:o.url}},s);case`dynamic-tool`:return(0,B.jsx)($,{toolName:o.toolName,result:o.output,errorText:o.state===`output-error`?o.errorText:void 0,state:o.state,input:o.input,approval:o.approval,onApprove:a,isLive:r,isActive:i},s);case`source-document`:return(0,B.jsx)(E,{icon:(0,B.jsx)(n,{className:`h-3 w-3 shrink-0`}),title:o.title,subtitle:o.filename},s);case`source-url`:return(0,B.jsx)(E,{icon:(0,B.jsx)(O,{className:`h-3 w-3 shrink-0`}),title:o.title??o.url,subtitle:o.title?o.url:void 0,href:o.url},s);case`custom`:return(0,B.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:o.kind},s);case`step-start`:return null;default:return b(o),null}}};function oe(e){return e.type.startsWith(`tool-`)}function se(e){return e.type.startsWith(`data-`)}export{I as i,L as n,F as r,ae as t};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{Xi as n,Yi as r,ta as i}from"./cells-CWhmlx33.js";import{In as a,kt as o,un as s,wt as c}from"./schemas-aTUejmFi.js";import{t as l}from"./compiler-runtime-CYIjoINj.js";import{t as u}from"./isEmpty-BJso7_X0.js";import{et as d}from"./ai-model-dropdown-C6a5WwzK.js";import{g as f}from"./useEventListener-D27Dii_l.js";import{t as p}from"./cn-ldLVeaqm.js";import{t as m}from"./jsx-runtime-B74pBk57.js";import{a as h,i as g,o as _,r as v}from"./config-Cl3eMWxb.js";import{t as y}from"./button-Btj6GXNy.js";import{i as b}from"./strings-CpYReX2Q.js";import{t as x}from"./createLucideIcon-B7HeEoG2.js";import{t as S}from"./ban-CwXfMsC1.js";import{t as C}from"./bot-message-square-CGhPjWFf.js";import{a as w}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as T}from"./markdown-renderer-KEQXCdvc.js";import{p as E,u as D}from"./add-cell-with-ai-6sxiY1Qo.js";import{t as O}from"./external-link-Bp3BxyRA.js";import{n as k}from"./spinner-Ck-Hgfvj.js";import{l as A}from"./datasource-BhCWw0_C.js";import{t as j}from"./RenderHTML-B2NEp3vg.js";var M=x(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),N=x(`shield-question-mark`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),P=`user_cancelled`;function F(e){if(e.type===`abort`)return e.reason}function I(e){return e.isAbort?e.streamReason||`user_cancelled`:null}function L(e){switch(e){case P:return`Generation stopped`;case`timeout`:return`Generation stopped: timed out`;default:return`Generation stopped: ${e}`}}var R=l(),z=e(t(),1),B=m(),V=e=>{let t=(0,R.c)(13),{reasoning:n,index:r,isStreaming:i}=e,a=r===void 0?0:r,o=i!==void 0&&i,[s,c]=z.useState(``);if(!n&&!o)return null;let l=o?`reasoning`:s,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,B.jsx)(C,{className:`h-3 w-3`}),t[0]=u):u=t[0];let d=o?`Thinking`:`View reasoning`,f=n.length>0&&` (${n.length} chars)`,p;t[1]!==d||t[2]!==f?(p=(0,B.jsx)(_,{className:`text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[u,d,f]})}),t[1]=d,t[2]=f,t[3]=p):p=t[3];let m;t[4]===n?m=t[5]:(m=(0,B.jsx)(g,{className:`pb-2 px-2`,children:(0,B.jsx)(`div`,{className:`bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative`,children:(0,B.jsx)(`div`,{className:`pr-6`,children:(0,B.jsx)(T,{content:n})})})}),t[4]=n,t[5]=m);let y;t[6]!==p||t[7]!==m?(y=(0,B.jsxs)(h,{value:`reasoning`,className:`border-0`,children:[p,m]}),t[6]=p,t[7]=m,t[8]=y):y=t[8];let b;return t[9]!==a||t[10]!==l||t[11]!==y?(b=(0,B.jsx)(v,{type:`single`,collapsible:!0,className:`w-full mb-2`,value:l,onValueChange:c,children:y},a),t[9]=a,t[10]=l,t[11]=y,t[12]=b):b=t[12],b};function H(e){return e.replace(`tool-`,``)}var U=e=>{let t=(0,R.c)(9),{input:n,label:r}=e,i=r===void 0?`Tool Request`:r;if(n==null)return null;let a;t[0]===i?a=t[1]:(a=(0,B.jsx)(`h3`,{className:`text-xs font-semibold text-muted-foreground`,children:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=JSON.stringify(n,null,2),t[2]=n,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,B.jsx)(`pre`,{className:`bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64`,children:o}),t[4]=o,t[5]=s);let c;return t[6]!==a||t[7]!==s?(c=(0,B.jsxs)(`div`,{className:`space-y-2`,children:[a,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8],c},W=e=>{let t=(0,R.c)(27),{toolName:n,input:r,approval:i,onApprove:a,className:o}=e,s;t[0]===o?s=t[1]:(s=p(`rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3`,o),t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=H(n),t[2]=n,t[3]=c);let l=`Approval required for ${c}`,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,B.jsx)(N,{className:`h-4 w-4 text-(--amber-11) mt-0.5 shrink-0`}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(`span`,{className:`font-semibold`,children:`Approval required:`}),t[5]=d):d=t[5];let f;t[6]===n?f=t[7]:(f=H(n),t[6]=n,t[7]=f);let m;t[8]===f?m=t[9]:(m=(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[u,(0,B.jsxs)(`div`,{className:`text-xs text-(--amber-11) leading-relaxed`,children:[d,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:f})]})]}),t[8]=f,t[9]=m);let h;t[10]===r?h=t[11]:(h=(0,B.jsx)(U,{input:r}),t[10]=r,t[11]=h);let g;t[12]!==i.id||t[13]!==a?(g=(0,B.jsx)(y,{size:`xs`,variant:`outline`,onClick:()=>a({id:i.id,approved:!1}),children:`Deny`}),t[12]=i.id,t[13]=a,t[14]=g):g=t[14];let _;t[15]!==i.id||t[16]!==a?(_=(0,B.jsx)(y,{size:`xs`,onClick:()=>a({id:i.id,approved:!0}),children:`Approve`}),t[15]=i.id,t[16]=a,t[17]=_):_=t[17];let v;t[18]!==_||t[19]!==g?(v=(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[g,_]}),t[18]=_,t[19]=g,t[20]=v):v=t[20];let b;return t[21]!==s||t[22]!==v||t[23]!==l||t[24]!==m||t[25]!==h?(b=(0,B.jsxs)(`div`,{className:s,role:`alertdialog`,"aria-label":l,children:[m,h,v]}),t[21]=s,t[22]=v,t[23]=l,t[24]=m,t[25]=h,t[26]=b):b=t[26],b},G=e=>{let t=(0,R.c)(28),{toolName:n,input:r,errorText:a,isLive:o,className:s}=e,[c,l]=z.useState(o),u=z.useRef(o),d,f;t[0]===o?(d=t[1],f=t[2]):(d=()=>{u.current&&!o&&l(!1),u.current=o},f=[o],t[0]=o,t[1]=d,t[2]=f),z.useEffect(d,f);let m;t[3]===s?m=t[4]:(m=p(`rounded-md border border-(--red-6) bg-(--red-2)`,s),t[3]=s,t[4]=m);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>l(K),t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,B.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`}),t[6]=g):g=t[6];let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,B.jsx)(`span`,{className:`font-semibold`,children:`Failed:`}),t[7]=_):_=t[7];let v;t[8]===n?v=t[9]:(v=H(n),t[8]=n,t[9]=v);let y;t[10]===v?y=t[11]:(y=(0,B.jsxs)(`span`,{className:`flex-1 text-left`,children:[_,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:v})]}),t[10]=v,t[11]=y);let b=c&&`rotate-180`,x;t[12]===b?x=t[13]:(x=p(`h-3.5 w-3.5 shrink-0 transition-transform`,b),t[12]=b,t[13]=x);let S;t[14]===x?S=t[15]:(S=(0,B.jsx)(w,{className:x}),t[14]=x,t[15]=S);let C;t[16]!==c||t[17]!==S||t[18]!==y?(C=(0,B.jsxs)(`button`,{type:`button`,onClick:h,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-(--red-11) hover:bg-(--red-3) rounded-md transition-colors`,"aria-expanded":c,children:[g,y,S]}),t[16]=c,t[17]=S,t[18]=y,t[19]=C):C=t[19];let T;t[20]!==a||t[21]!==r||t[22]!==c?(T=c&&(0,B.jsxs)(`div`,{className:`px-3 pb-3 space-y-3 border-t border-(--red-6)/40 pt-3`,children:[(0,B.jsx)(U,{input:r}),a&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-xs font-semibold text-(--red-11) mb-1`,children:`Error`}),(0,B.jsx)(`pre`,{className:`bg-(--red-2) border border-(--red-6) rounded p-2 text-xs text-(--red-11) leading-relaxed overflow-auto scrollbar-thin max-h-64 whitespace-pre-wrap`,children:a})]})]}),t[20]=a,t[21]=r,t[22]=c,t[23]=T):T=t[23];let E;return t[24]!==C||t[25]!==T||t[26]!==m?(E=(0,B.jsxs)(`div`,{className:m,children:[C,T]}),t[24]=C,t[25]=T,t[26]=m,t[27]=E):E=t[27],E};function K(e){return!e}function q(e){return e==null||typeof e==`object`&&u(e)}var J=s({status:a().default(`success`),auth_required:o().default(!1),action_url:c(),next_steps:c(),meta:c(),message:a().nullish()}),Y=e=>{let t=(0,R.c)(12),{data:n}=e,i;if(t[0]!==n){let{status:e,auth_required:a,action_url:o,meta:s,next_steps:c,message:l,...u}=n,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(`h3`,{className:`text-xs font-semibold text-muted-foreground`,children:`Tool Result`}),t[2]=d):d=t[2];let f;t[3]===e?f=t[4]:(f=(0,B.jsx)(`span`,{className:`text-xs px-2 py-0.5 bg-(--grass-2) text-(--grass-11) rounded-full font-medium capitalize`,children:e}),t[3]=e,t[4]=f);let p;t[5]===a?p=t[6]:(p=a&&(0,B.jsx)(`span`,{className:`text-xs px-2 py-0.5 bg-(--amber-2) text-(--amber-11) rounded-full`,children:`Auth Required`}),t[5]=a,t[6]=p);let m;t[7]!==f||t[8]!==p?(m=(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[d,(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f,p]})]}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===l?h=t[11]:(h=l&&(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,B.jsx)(r,{className:`h-3 w-3 text-(--blue-11) mt-0.5 shrink-0`}),(0,B.jsx)(`div`,{className:`text-xs text-foreground`,children:l})]}),t[10]=l,t[11]=h),i=(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[m,h,u&&(0,B.jsx)(`div`,{className:`space-y-3`,children:Object.entries(u).map(Z)})]}),t[0]=n,t[1]=i}else i=t[1];return i},X=e=>{let t=(0,R.c)(8),{result:n}=e,r;t[0]===n?r=t[1]:(r=J.safeParse(n),t[0]=n,t[1]=r);let i=r;if(i.success){let e;return t[2]===i.data?e=t[3]:(e=(0,B.jsx)(Y,{data:i.data}),t[2]=i.data,t[3]=e),e}let a;t[4]===n?a=t[5]:(a=typeof n==`string`?n:JSON.stringify(n,null,2),t[4]=n,t[5]=a);let o;return t[6]===a?o=t[7]:(o=(0,B.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-1 max-h-64 overflow-y-auto scrollbar-thin`,children:a}),t[6]=a,t[7]=o),o};function Z(e){let[t,n]=e;return q(n)?null:(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}),(0,B.jsx)(`pre`,{className:`bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64`,children:JSON.stringify(n,null,2)})]},t)}var ee={"input-streaming":`Generating`,"input-available":`Running`,"approval-responded":`Awaiting result`,"output-available":`Done`,"output-denied":`Denied`},te=new Set([`input-streaming`,`input-available`,`approval-responded`]),ne=e=>{let t=(0,R.c)(5),{state:n,interrupted:r}=e;if(r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(M,{className:`h-3 w-3 text-muted-foreground`}),t[0]=e):e=t[0],e}switch(n){case`input-streaming`:case`input-available`:case`approval-responded`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(k,{className:`h-3 w-3 animate-spin`}),t[1]=e):e=t[1],e}case`output-available`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(d,{className:`h-3 w-3 text-(--grass-11)`}),t[2]=e):e=t[2],e}case`output-denied`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(S,{className:`h-3 w-3 text-muted-foreground`}),t[3]=e):e=t[3],e}default:{b(n);let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(A,{className:`h-3 w-3`}),t[4]=e):e=t[4],e}}};function re(e){switch(e){case`output-available`:return`text-(--grass-11)/80`;case`output-denied`:return`text-muted-foreground`;case`input-streaming`:case`input-available`:case`approval-responded`:return``;default:return b(e),``}}var Q=e=>{let t=(0,R.c)(34),{toolName:n,state:r,input:i,result:a,approval:o,index:s,className:c,isActive:l}=e,u=s===void 0?0:s,d=l===void 0||l,f;t[0]!==d||t[1]!==r?(f=!d&&te.has(r),t[0]=d,t[1]=r,t[2]=f):f=t[2];let m=f,y=`tool-${u}`,b;t[3]===c?b=t[4]:(b=p(`w-full`,c),t[3]=c,t[4]=b);let x;t[5]!==m||t[6]!==r?(x=p(`h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline`,m?`text-muted-foreground`:re(r)),t[5]=m,t[6]=r,t[7]=x):x=t[7];let S;t[8]!==m||t[9]!==r?(S=(0,B.jsx)(ne,{state:r,interrupted:m}),t[8]=m,t[9]=r,t[10]=S):S=t[10];let C=m?`Interrupted`:ee[r],w;t[11]===n?w=t[12]:(w=H(n),t[11]=n,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:w}),t[13]=w,t[14]=T);let E;t[15]!==T||t[16]!==S||t[17]!==C?(E=(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[S,C,`:`,T]}),t[15]=T,t[16]=S,t[17]=C,t[18]=E):E=t[18];let D;t[19]!==E||t[20]!==x?(D=(0,B.jsx)(_,{className:x,children:E}),t[19]=E,t[20]=x,t[21]=D):D=t[21];let O;t[22]!==o||t[23]!==i||t[24]!==a||t[25]!==r?(O=(0,B.jsx)(g,{className:`py-2 px-2`,children:(0,B.jsx)(ie,{state:r,input:i,result:a,approval:o})}),t[22]=o,t[23]=i,t[24]=a,t[25]=r,t[26]=O):O=t[26];let k;t[27]!==D||t[28]!==O?(k=(0,B.jsxs)(h,{value:`tool-call`,className:`border-0`,children:[D,O]}),t[27]=D,t[28]=O,t[29]=k):k=t[29];let A;return t[30]!==k||t[31]!==y||t[32]!==b?(A=(0,B.jsx)(v,{type:`single`,collapsible:!0,className:b,children:k},y),t[30]=k,t[31]=y,t[32]=b,t[33]=A):A=t[33],A},ie=e=>{let t=(0,R.c)(16),{state:n,input:r,result:i,approval:a}=e;switch(n){case`input-streaming`:case`input-available`:case`approval-responded`:{let e;return t[0]===r?e=t[1]:(e=(0,B.jsx)(U,{input:r}),t[0]=r,t[1]=e),e}case`output-available`:{let e;t[2]===r?e=t[3]:(e=(0,B.jsx)(U,{input:r}),t[2]=r,t[3]=e);let n;t[4]===i?n=t[5]:(n=i!=null&&(0,B.jsx)(X,{result:i}),t[4]=i,t[5]=n);let a;return t[6]!==e||t[7]!==n?(a=(0,B.jsxs)(`div`,{className:`space-y-3`,children:[e,n]}),t[6]=e,t[7]=n,t[8]=a):a=t[8],a}case`output-denied`:{let e;t[9]===r?e=t[10]:(e=(0,B.jsx)(U,{input:r}),t[9]=r,t[10]=e);let n=a?.reason?`: ${a.reason}`:`.`,i;t[11]===n?i=t[12]:(i=(0,B.jsxs)(`div`,{className:`bg-muted/40 border border-border rounded-md p-3 text-xs text-muted-foreground leading-relaxed`,children:[`Tool execution was denied`,n]}),t[11]=n,t[12]=i);let o;return t[13]!==e||t[14]!==i?(o=(0,B.jsxs)(`div`,{className:`space-y-3`,children:[e,i]}),t[13]=e,t[14]=i,t[15]=o):o=t[15],o}default:return b(n),null}},$=e=>{let t=(0,R.c)(27),{toolName:n,state:r,result:i,errorText:a,input:o,approval:s,onApprove:c,index:l,className:u,isLive:d,isActive:f}=e,p=d===void 0||d,m=f===void 0||f;switch(r){case`approval-requested`:{if(s!=null&&c!=null){let e;return t[0]!==s||t[1]!==u||t[2]!==o||t[3]!==c||t[4]!==n?(e=(0,B.jsx)(W,{toolName:n,input:o,approval:s,onApprove:c,className:u}),t[0]=s,t[1]=u,t[2]=o,t[3]=c,t[4]=n,t[5]=e):e=t[5],e}let e;return t[6]!==u||t[7]!==l||t[8]!==o||t[9]!==m||t[10]!==n?(e=(0,B.jsx)(Q,{toolName:n,state:`input-available`,input:o,index:l,className:u,isActive:m}),t[6]=u,t[7]=l,t[8]=o,t[9]=m,t[10]=n,t[11]=e):e=t[11],e}case`output-error`:{let e;return t[12]!==u||t[13]!==a||t[14]!==o||t[15]!==p||t[16]!==n?(e=(0,B.jsx)(G,{toolName:n,input:o,errorText:a,isLive:p,className:u}),t[12]=u,t[13]=a,t[14]=o,t[15]=p,t[16]=n,t[17]=e):e=t[17],e}case`input-streaming`:case`input-available`:case`approval-responded`:case`output-available`:case`output-denied`:{let e;return t[18]!==s||t[19]!==u||t[20]!==l||t[21]!==o||t[22]!==m||t[23]!==i||t[24]!==r||t[25]!==n?(e=(0,B.jsx)(Q,{toolName:n,state:r,input:o,result:i,approval:s,index:l,className:u,isActive:m}),t[18]=s,t[19]=u,t[20]=l,t[21]=o,t[22]=m,t[23]=i,t[24]=r,t[25]=n,t[26]=e):e=t[26],e}default:return b(r),null}},ae=({message:e,isStreamingReasoning:t,isLast:r,isActive:i,addToolApprovalResponse:a})=>{return(0,B.jsx)(B.Fragment,{children:e.parts.map((e,t)=>o(e,t))});function o(o,s){if(oe(o))return(0,B.jsx)($,{index:s,toolName:o.type,result:o.output,errorText:o.state===`output-error`?o.errorText:void 0,className:`my-2`,state:o.state,input:o.input,approval:o.approval,onApprove:a,isLive:r,isActive:i},s);if(se(o))return f.debug(`Found data part`,o),null;switch(o.type){case`text`:return o.text.includes(`<marimo-`)?(0,B.jsx)(z.Fragment,{children:j({html:o.text})},s):(0,B.jsx)(T,{content:o.text},s);case`reasoning`:return(0,B.jsx)(V,{reasoning:o.text,index:s,isStreaming:t&&r&&s===(e.parts.length||0)-1},s);case`file`:return(0,B.jsx)(D,{attachment:o},s);case`reasoning-file`:return(0,B.jsx)(D,{attachment:{type:`file`,mediaType:o.mediaType,url:o.url}},s);case`dynamic-tool`:return(0,B.jsx)($,{toolName:o.toolName,result:o.output,errorText:o.state===`output-error`?o.errorText:void 0,state:o.state,input:o.input,approval:o.approval,onApprove:a,isLive:r,isActive:i},s);case`source-document`:return(0,B.jsx)(E,{icon:(0,B.jsx)(n,{className:`h-3 w-3 shrink-0`}),title:o.title,subtitle:o.filename},s);case`source-url`:return(0,B.jsx)(E,{icon:(0,B.jsx)(O,{className:`h-3 w-3 shrink-0`}),title:o.title??o.url,subtitle:o.title?o.url:void 0,href:o.url},s);case`custom`:return(0,B.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:o.kind},s);case`step-start`:return null;default:return b(o),null}}};function oe(e){return e.type.startsWith(`tool-`)}function se(e){return e.type.startsWith(`data-`)}export{I as i,L as n,F as r,ae as t};
|