@marimo-team/frontend 0.19.3-dev4 → 0.19.3-dev42

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.
Files changed (179) hide show
  1. package/dist/assets/{CellStatus-Ba6Af_Tb.js → CellStatus-b7Yo2X9j.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-KlUs_Sz3.js → ConnectedDataExplorerComponent-Cr6-n9Em.js} +1 -1
  3. package/dist/assets/{ErrorBoundary-Drf1manw.js → ErrorBoundary-C7JBxSzd.js} +1 -1
  4. package/dist/assets/{ImperativeModal-q6QlC2aZ.js → ImperativeModal-DVhvP4lH.js} +1 -1
  5. package/dist/assets/{JsonOutput-4ruRfyOj.js → JsonOutput-C8Eo1zBR.js} +5 -5
  6. package/dist/assets/{LazyAnyLanguageCodeMirror-jpEDlD0M.js → LazyAnyLanguageCodeMirror-Cp2punaU.js} +2 -2
  7. package/dist/assets/{MarimoErrorOutput-DnjH3pD8.js → MarimoErrorOutput-CXBGzjO2.js} +2 -2
  8. package/dist/assets/{RenderHTML-DaJXe2U2.js → RenderHTML-SoetmcW2.js} +1 -1
  9. package/dist/assets/VisuallyHidden-B9t3FhTP.js +1 -0
  10. package/dist/assets/{add-cell-with-ai-Bsds_6SU.js → add-cell-with-ai-D2qS3Nos.js} +21 -21
  11. package/dist/assets/{add-database-form-CqIp3_WN.js → add-database-form-BBkiGMZ_.js} +2 -2
  12. package/dist/assets/agent-panel-BzV4XUTo.js +287 -0
  13. package/dist/assets/{ai-model-dropdown-LK8Wr5iu.js → ai-model-dropdown-CrMTCgo7.js} +1 -1
  14. package/dist/assets/{alert-dialog-k5KxevGr.js → alert-dialog-jcHA5geR.js} +1 -1
  15. package/dist/assets/{any-language-editor-DQu1Tt2N.js → any-language-editor-Cm83E7D_.js} +1 -1
  16. package/dist/assets/{app-config-button-BaVc4Y5z.js → app-config-button-9izWmQ0X.js} +1 -1
  17. package/dist/assets/button-B8cGZzP5.js +1 -0
  18. package/dist/assets/{cache-panel-C1So4Zu3.js → cache-panel-1FqnpB9y.js} +1 -1
  19. package/dist/assets/cell-editor-Do6lWWk9.js +23 -0
  20. package/dist/assets/cell-link-BP7_Ns0N.js +1 -0
  21. package/dist/assets/{cells-KYKWFk6C.js → cells-Cv9PtwL9.js} +49 -49
  22. package/dist/assets/{chat-components-O6DUIpBx.js → chat-components-Be6BPrbT.js} +1 -1
  23. package/dist/assets/{chat-display-DD3KokYi.js → chat-display-BRKfnhbm.js} +1 -1
  24. package/dist/assets/{chat-panel-D4DIcOM1.js → chat-panel-71zcilvi.js} +2 -2
  25. package/dist/assets/client-CGOlSEYr.js +4 -0
  26. package/dist/assets/{column-preview-EpCGr4Xp.js → column-preview-MC6VOHbd.js} +1 -1
  27. package/dist/assets/{command-Dqe0kvHp.js → command-n_oMaKjl.js} +1 -1
  28. package/dist/assets/{command-palette-DWacsFDk.js → command-palette-DfZNcw7W.js} +1 -1
  29. package/dist/assets/common-MUZIZluQ.js +1 -0
  30. package/dist/assets/config-DFDEcYvy.js +1 -0
  31. package/dist/assets/context-DHfVoQfl.js +1 -0
  32. package/dist/assets/{copy-icon-B69c-352.js → copy-icon-jWsqdLn1.js} +1 -1
  33. package/dist/assets/{datasource-JeWYnuIr.js → datasource-CEsMStKs.js} +2 -2
  34. package/dist/assets/{dependency-graph-panel-BJibnwCO.js → dependency-graph-panel-CNTGbfLZ.js} +4 -4
  35. package/dist/assets/{dialog-DUEuLcT2.js → dialog-CF5DtF1E.js} +1 -1
  36. package/dist/assets/{dist-DOFFh6Ii.js → dist-Dg7UO_Vw.js} +1 -1
  37. package/dist/assets/{documentation-panel-B2W3q2YB.js → documentation-panel-Cb9AHO2C.js} +1 -1
  38. package/dist/assets/{download-NfnO_JCs.js → download-24bI2vH0.js} +1 -1
  39. package/dist/assets/edit-page-DSuXLdcn.js +12 -0
  40. package/dist/assets/{error-banner-DU5Qb8a8.js → error-banner-DvT0IGDZ.js} +1 -1
  41. package/dist/assets/{error-panel-Bv-7GYgJ.js → error-panel-CpYH0GfR.js} +1 -1
  42. package/dist/assets/{es-KtEicG7U.js → es-BITbuY9w.js} +1 -1
  43. package/dist/assets/{field-DDKGFzpC.js → field-Clr_fqUr.js} +1 -1
  44. package/dist/assets/{file-explorer-panel-CToUezud.js → file-explorer-panel-CdA81LHh.js} +1 -1
  45. package/dist/assets/{floating-outline-Db40vhG8.js → floating-outline-BbJ4ldyu.js} +1 -1
  46. package/dist/assets/{focus-BCdX47jS.js → focus-D1y1tXyC.js} +1 -1
  47. package/dist/assets/{form-DwtJQd_Z.js → form-BAtvsPJL.js} +2 -2
  48. package/dist/assets/{glide-data-editor-D_bRnWfy.js → glide-data-editor-Dv8ZW9dk.js} +1 -1
  49. package/dist/assets/{globals-MS86g8oR.js → globals-C6OH39EA.js} +1 -1
  50. package/dist/assets/{home-page-BfVf41OG.js → home-page-B_YprqxM.js} +2 -2
  51. package/dist/assets/house-CncUa_LL.js +1 -0
  52. package/dist/assets/index-C30GhE0W.css +2 -0
  53. package/dist/assets/index-DoE3JZXY.js +43 -0
  54. package/dist/assets/input-B80Yt1uu.js +1 -0
  55. package/dist/assets/{kiosk-mode-CEhvsEr0.js → kiosk-mode-DfyjlR7p.js} +1 -1
  56. package/dist/assets/{label-qwandMoh.js → label-CNZLffHW.js} +1 -1
  57. package/dist/assets/{layout-Cvaok8Kj.js → layout-9uQoV-6h.js} +4 -4
  58. package/dist/assets/links-DbDrjRnm.js +1 -0
  59. package/dist/assets/{logs-panel-J2FKnKaj.js → logs-panel-svcirwjp.js} +1 -1
  60. package/dist/assets/{markdown-renderer-BlG9DgUG.js → markdown-renderer-DlVqlHOL.js} +2 -2
  61. package/dist/assets/mode-PeuS_Lp-.js +1 -0
  62. package/dist/assets/{multi-map-fjX9ImVF.js → multi-map-CQd4MZr5.js} +1 -1
  63. package/dist/assets/name-cell-input-YMoA0SQj.js +1 -0
  64. package/dist/assets/{outline-panel-Doj3GJrQ.js → outline-panel-RKJ5Mqrt.js} +1 -1
  65. package/dist/assets/{packages-panel-nqWXQzKf.js → packages-panel-BuiAGEBw.js} +1 -1
  66. package/dist/assets/panels-BKsZUDjc.js +1 -0
  67. package/dist/assets/{process-output-DiSW8Nbo.js → process-output-KJWsSvCT.js} +1 -1
  68. package/dist/assets/{readonly-python-code-CKY5LsMp.js → readonly-python-code-HPlG_YPX.js} +1 -1
  69. package/dist/assets/run-page-CBDzVDX3.js +1 -0
  70. package/dist/assets/scratchpad-panel-CarbQVYs.js +1 -0
  71. package/dist/assets/{secrets-panel-CDWmmmBS.js → secrets-panel-BMY6PPth.js} +1 -1
  72. package/dist/assets/{select-D0g5GnIs.js → select-D9lTzMzP.js} +1 -1
  73. package/dist/assets/{session-panel-CGFRSBw9.js → session-panel-Cv14Ehfm.js} +1 -1
  74. package/dist/assets/{slides-component-MkPkpql1.js → slides-component-Dp0Yv5b0.js} +1 -1
  75. package/dist/assets/{snippets-panel-ClHeSpc5.js → snippets-panel-OAdQXQ93.js} +1 -1
  76. package/dist/assets/state-DYG6kYly.js +1 -0
  77. package/dist/assets/state-xh6GqNrp.js +1 -0
  78. package/dist/assets/{switch-BmbGJWHc.js → switch-DPeh0R76.js} +1 -1
  79. package/dist/assets/{terminal-BvgBa6Ri.js → terminal-BbAhzgnR.js} +1 -1
  80. package/dist/assets/{textarea-WklymBeK.js → textarea-wbzgrXvB.js} +1 -1
  81. package/dist/assets/{tracing-D0WYhZdr.js → tracing-Bh3EJxAS.js} +1 -1
  82. package/dist/assets/{tracing-panel-CNxN58z7.js → tracing-panel-BzSQ7qvB.js} +2 -2
  83. package/dist/assets/{types-BrgXpvGt.js → types-B8Qb1FfB.js} +1 -1
  84. package/dist/assets/{useAddCell-a9qZ0_KE.js → useAddCell-DBGvrN8K.js} +1 -1
  85. package/dist/assets/{useBoolean-5kuXz69O.js → useBoolean-CyOFPk5r.js} +1 -1
  86. package/dist/assets/{useCellActionButton-9W_R41MM.js → useCellActionButton-BlS_HKk-.js} +1 -1
  87. package/dist/assets/{useDateFormatter-CV0QXb5P.js → useDateFormatter-DsANziQR.js} +1 -1
  88. package/dist/assets/useDeleteCell-BvQIJfpI.js +1 -0
  89. package/dist/assets/{useDependencyPanelTab-0reaqvvh.js → useDependencyPanelTab-BqEhbPr2.js} +1 -1
  90. package/dist/assets/useInterval-BGPIviJp.js +1 -0
  91. package/dist/assets/useNotebookActions-D1Woz3AV.js +1 -0
  92. package/dist/assets/{useNumberFormatter-D8ks3oPN.js → useNumberFormatter-FoXhpyAb.js} +1 -1
  93. package/dist/assets/usePress-DTwIUo40.js +7 -0
  94. package/dist/assets/useRunCells-B9Xr4tcH.js +1 -0
  95. package/dist/assets/useSplitCell-7xBW3b8-.js +1 -0
  96. package/dist/assets/utilities.esm-xahhGpny.js +3 -0
  97. package/dist/assets/{vega-component-DpAAiTdH.js → vega-component-dUiiVmIx.js} +1 -1
  98. package/dist/assets/{write-secret-modal-CLm48gMe.js → write-secret-modal-hOetwavI.js} +1 -1
  99. package/dist/index.html +54 -54
  100. package/package.json +5 -5
  101. package/src/__mocks__/requests.ts +1 -0
  102. package/src/__tests__/mount.test.ts +128 -0
  103. package/src/components/app-config/__tests__/get-dirty-values.test.ts +1 -1
  104. package/src/components/app-config/user-config-form.tsx +1 -1
  105. package/src/components/chat/acp/agent-panel.tsx +56 -43
  106. package/src/components/chat/chat-utils.ts +0 -19
  107. package/src/components/data-table/column-header.tsx +1 -1
  108. package/src/components/editor/KernelStartupErrorModal.tsx +101 -0
  109. package/src/components/editor/actions/name-cell-input.tsx +10 -4
  110. package/src/components/editor/ai/completion-handlers.tsx +1 -1
  111. package/src/components/editor/alerts/connecting-alert.tsx +33 -6
  112. package/src/components/editor/chrome/types.ts +2 -4
  113. package/src/components/editor/chrome/wrapper/app-chrome.tsx +55 -58
  114. package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +150 -96
  115. package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +27 -0
  116. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +6 -0
  117. package/src/components/utils/lazy-mount.tsx +29 -8
  118. package/src/core/MarimoApp.tsx +2 -0
  119. package/src/core/cells/cells.ts +2 -0
  120. package/src/core/cells/scrollCellIntoView.ts +3 -2
  121. package/src/core/codemirror/cm.ts +2 -0
  122. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +123 -0
  123. package/src/core/codemirror/lsp/notebook-lsp.ts +44 -4
  124. package/src/core/codemirror/misc/__tests__/string-braces.test.ts +200 -0
  125. package/src/core/codemirror/misc/string-braces.ts +37 -0
  126. package/src/core/errors/state.ts +7 -1
  127. package/src/core/export/__tests__/hooks.test.ts +504 -0
  128. package/src/core/export/hooks.ts +93 -4
  129. package/src/core/islands/bridge.ts +1 -0
  130. package/src/core/islands/main.ts +2 -0
  131. package/src/core/kernel/__tests__/handlers.test.ts +2 -2
  132. package/src/core/kernel/state.ts +1 -0
  133. package/src/core/network/__tests__/requests-lazy.test.ts +1 -1
  134. package/src/core/network/__tests__/requests-network.test.ts +0 -18
  135. package/src/core/network/requests-lazy.ts +3 -2
  136. package/src/core/network/requests-network.ts +10 -7
  137. package/src/core/network/requests-static.ts +1 -0
  138. package/src/core/network/requests-toasting.tsx +1 -0
  139. package/src/core/network/types.ts +2 -0
  140. package/src/core/wasm/bridge.ts +1 -0
  141. package/src/core/websocket/types.ts +1 -0
  142. package/src/core/websocket/useMarimoKernelConnection.tsx +18 -1
  143. package/src/css/globals.css +2 -0
  144. package/src/hooks/__tests__/useInterval.test.tsx +104 -0
  145. package/src/hooks/useInterval.ts +32 -6
  146. package/src/mount.tsx +6 -0
  147. package/src/plugins/impl/chat/chat-ui.tsx +16 -4
  148. package/src/plugins/impl/chat/types.ts +5 -12
  149. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +3 -1
  150. package/src/utils/events.ts +1 -0
  151. package/dist/assets/VisuallyHidden-BodIky8L.js +0 -1
  152. package/dist/assets/agent-panel-CaAPVPdJ.js +0 -287
  153. package/dist/assets/button-DuYGqRtX.js +0 -1
  154. package/dist/assets/cell-editor-OFm-OSAP.js +0 -23
  155. package/dist/assets/cell-link-CfLJRl3p.js +0 -1
  156. package/dist/assets/client-Cha_JfGC.js +0 -4
  157. package/dist/assets/common-A6YWtmpq.js +0 -1
  158. package/dist/assets/config-babG4OBR.js +0 -1
  159. package/dist/assets/context-BAYdLMF_.js +0 -1
  160. package/dist/assets/edit-page-nuU4FVXi.js +0 -12
  161. package/dist/assets/globe-CY9im410.js +0 -1
  162. package/dist/assets/index-BI88xbv4.js +0 -43
  163. package/dist/assets/index-Chgc_07S.css +0 -2
  164. package/dist/assets/input-CaEtLL8p.js +0 -1
  165. package/dist/assets/links-ENMiP32L.js +0 -1
  166. package/dist/assets/mode-CK5Oq-Jz.js +0 -1
  167. package/dist/assets/name-cell-input-D7axzd6k.js +0 -1
  168. package/dist/assets/panels-CdYbZBqo.js +0 -1
  169. package/dist/assets/run-page-GP8eGE39.js +0 -1
  170. package/dist/assets/scratchpad-panel-B1p8zqAE.js +0 -1
  171. package/dist/assets/state-BBgXjqJI.js +0 -1
  172. package/dist/assets/state-CP7_TGWl.js +0 -1
  173. package/dist/assets/useDeleteCell-5kJUaejE.js +0 -1
  174. package/dist/assets/useInterval-DpipYmgs.js +0 -1
  175. package/dist/assets/useNotebookActions-o341ZCMJ.js +0 -1
  176. package/dist/assets/usePress-C2LPFxyv.js +0 -7
  177. package/dist/assets/useRunCells-wXhl9zOP.js +0 -1
  178. package/dist/assets/useSplitCell-mmm5jxn2.js +0 -1
  179. package/dist/assets/utilities.esm-Ckt5kMF-.js +0 -3
@@ -1 +1 @@
1
- import{s as I}from"./chunk-LvLJmgfZ.js";import"./useEvent-DlWF5OMa.js";import{t as P}from"./react-BGmjiNul.js";import{C as q}from"./cells-KYKWFk6C.js";import"./react-dom-C9fstfnp.js";import{t as $}from"./compiler-runtime-DeeZ7FnK.js";import{n as D}from"./constants-Bkp4R3bQ.js";import"./config-babG4OBR.js";import{t as F}from"./jsx-runtime-DN_bIXfG.js";import{i as G,t as y}from"./button-DuYGqRtX.js";import{t as T}from"./cn-C1rgT0yh.js";import{at as W}from"./dist-CAcX026F.js";import"./cjs-Bj40p_Np.js";import"./main-CwSdzVhm.js";import"./useNonce-EAuSVK-5.js";import{r as A}from"./requests-C0HaHO6a.js";import{n as M,t as B}from"./LazyAnyLanguageCodeMirror-jpEDlD0M.js";import{h as J}from"./select-D0g5GnIs.js";import{t as K}from"./spinner-C1czjtp7.js";import{t as L}from"./plus-CHesBJpY.js";import"./dist-HGZzCB0y.js";import"./dist-CVj-_Iiz.js";import"./dist-BVf1IY4_.js";import"./dist-Cq_4nPfh.js";import"./dist-RKnr9SNh.js";import{r as R}from"./useTheme-DfP1CWaW.js";import"./Combination-D1TsGrBC.js";import{t as U}from"./tooltip-CvjcEpZC.js";import{a as V,c as Y,i as Q,n as X,r as Z}from"./dialog-DUEuLcT2.js";import{n as ee}from"./ImperativeModal-q6QlC2aZ.js";import{n as te}from"./error-banner-DU5Qb8a8.js";import{t as se}from"./RenderHTML-DaJXe2U2.js";import"./purify.es-N-2faAGj.js";import{n as re}from"./useAsyncData-BJJJOr9W.js";import{a as le,o as oe,r as ie,t as ae,u as ne}from"./command-Dqe0kvHp.js";import{o as me}from"./focus-BCdX47jS.js";import{n as ce,r as de,t as E}from"./react-resizable-panels.browser.esm-BqxQegSf.js";import{t as pe}from"./empty-state-B0XJ9ZUi.js";import{a as he,i as fe,t as H}from"./kiosk-mode-CEhvsEr0.js";var O=$(),C=I(P(),1),s=I(F(),1);const xe=t=>{let e=(0,O.c)(6),{children:r}=t,{openModal:i,closeModal:o}=ee(),l;e[0]!==o||e[1]!==i?(l=()=>i((0,s.jsx)(ue,{onClose:o})),e[0]=o,e[1]=i,e[2]=l):l=e[2];let a;return e[3]!==r||e[4]!==l?(a=(0,s.jsx)(G,{onClick:l,children:r}),e[3]=r,e[4]=l,e[5]=a):a=e[5],a};var ue=t=>{let e=(0,O.c)(4),{onClose:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)(Y,{children:"Contribute a Snippet"}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=(0,s.jsxs)(V,{children:[i,(0,s.jsxs)(Z,{children:["Have a useful snippet you want to share with the community? Make a pull request"," ",(0,s.jsx)("a",{href:D.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[1]=o):o=e[1];let l;return e[2]===r?l=e[3]:(l=(0,s.jsxs)(X,{className:"max-w-md",children:[o,(0,s.jsx)(Q,{children:(0,s.jsx)(y,{"data-testid":"snippet-close-button",variant:"default",onClick:r,children:"Close"})})]}),e[2]=r,e[3]=l),l},k=$(),je=[W.lineWrapping],ve=()=>{let t=(0,k.c)(24),{readSnippets:e}=A(),[r,i]=C.useState(),o=fe(),l=he(),a;t[0]===e?a=t[1]:(a=()=>e(),t[0]=e,t[1]=a);let c;t[2]===Symbol.for("react.memo_cache_sentinel")?(c=[],t[2]=c):c=t[2];let{data:N,error:j,isPending:g}=re(a,c);if(j){let m;return t[3]===j?m=t[4]:(m=(0,s.jsx)(te,{error:j}),t[3]=j,t[4]=m),m}if(g||!N){let m;return t[5]===Symbol.for("react.memo_cache_sentinel")?(m=(0,s.jsx)(K,{size:"medium",centered:!0}),t[5]=m):m=t[5],m}let _=o==="vertical",v;t[6]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(le,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=v):v=t[6];let h,f;t[7]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsxs)("div",{className:"flex items-center w-full border-b",children:[v,(0,s.jsx)(xe,{children:(0,s.jsx)("button",{className:"float-right px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:(0,s.jsx)(L,{className:"h-4 w-4"})})})]}),f=(0,s.jsx)(ie,{children:"No results"}),t[7]=h,t[8]=f):(h=t[7],f=t[8]);let b;t[9]===Symbol.for("react.memo_cache_sentinel")?(b=m=>i(m),t[9]=b):b=t[9];let d;t[10]===N.snippets?d=t[11]:(d=(0,s.jsx)(E,{defaultSize:40,minSize:20,maxSize:70,children:(0,s.jsxs)(ae,{className:"h-full rounded-none",children:[h,f,(0,s.jsx)(Ne,{onSelect:b,snippets:N.snippets})]})}),t[10]=N.snippets,t[11]=d);let u=_?"h-1":"w-1",p;t[12]===u?p=t[13]:(p=T("bg-border hover:bg-primary/50 transition-colors",u),t[12]=u,t[13]=p);let x;t[14]===p?x=t[15]:(x=(0,s.jsx)(de,{className:p}),t[14]=p,t[15]=x);let n;t[16]===r?n=t[17]:(n=(0,s.jsx)(E,{defaultSize:60,minSize:20,children:(0,s.jsx)(C.Suspense,{children:(0,s.jsx)("div",{className:"h-full snippet-viewer flex flex-col overflow-hidden",children:r?(0,s.jsx)(be,{snippet:r,onClose:()=>i(void 0)},r.title):(0,s.jsx)(pe,{title:"",description:"Click on a snippet to view its content."})})})}),t[16]=r,t[17]=n);let S;return t[18]!==o||t[19]!==l||t[20]!==n||t[21]!==d||t[22]!==x?(S=(0,s.jsx)("div",{className:"flex-1 overflow-hidden h-full",children:(0,s.jsxs)(ce,{direction:o,className:"h-full",children:[d,x,n]},l)}),t[18]=o,t[19]=l,t[20]=n,t[21]=d,t[22]=x,t[23]=S):S=t[23],S},be=t=>{let e=(0,k.c)(33),{snippet:r,onClose:i}=t,{theme:o}=R(),{createNewCell:l}=q(),a=me(),c;e[0]!==l||e[1]!==a||e[2]!==r.sections?(c=()=>{for(let n of[...r.sections].reverse())n.code&&l({code:n.code,before:!1,cellId:a??"__end__",skipIfCodeExists:!0})},e[0]=l,e[1]=a,e[2]=r.sections,e[3]=c):c=e[3];let N=c,j;e[4]!==l||e[5]!==a?(j=n=>{l({code:n,before:!1,cellId:a??"__end__"})},e[4]=l,e[5]=a,e[6]=j):j=e[6];let g=j,_;e[7]===r.title?_=e[8]:(_=(0,s.jsx)("span",{children:r.title}),e[7]=r.title,e[8]=_);let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(J,{className:"h-4 w-4"}),e[9]=v):v=e[9];let h;e[10]===i?h=e[11]:(h=(0,s.jsx)(y,{size:"sm",variant:"ghost",onClick:i,className:"h-6 w-6 p-0 hover:bg-muted-foreground/10",children:v}),e[10]=i,e[11]=h);let f;e[12]!==_||e[13]!==h?(f=(0,s.jsxs)("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center",children:[_,h]}),e[12]=_,e[13]=h,e[14]=f):f=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=(0,s.jsx)(M,{className:"ml-2 h-4 w-4"}),e[15]=b):b=e[15];let d;e[16]===N?d=e[17]:(d=(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(H,{children:(0,s.jsxs)(y,{className:"float-right",size:"xs",variant:"outline",onClick:N,children:["Insert snippet",b]})})}),e[16]=N,e[17]=d);let u;if(e[18]!==g||e[19]!==r.sections||e[20]!==r.title||e[21]!==o){let n;e[23]!==g||e[24]!==r.title||e[25]!==o?(n=S=>{let{code:m,html:z,id:w}=S;return z?(0,s.jsx)("div",{children:se({html:z})},`${r.title}-${w}`):m?(0,s.jsxs)("div",{className:"relative hover-actions-parent pr-2",children:[(0,s.jsx)(H,{children:(0,s.jsx)(U,{content:"Insert snippet",children:(0,s.jsx)(y,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{g(m)},children:(0,s.jsx)(M,{className:"h-5 w-5"})})})}),(0,s.jsx)(C.Suspense,{children:(0,s.jsx)(B,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:je,value:m,readOnly:!0},`${r.title}-${w}`)})]},`${r.title}-${w}`):null},e[23]=g,e[24]=r.title,e[25]=o,e[26]=n):n=e[26],u=r.sections.map(n),e[18]=g,e[19]=r.sections,e[20]=r.title,e[21]=o,e[22]=u}else u=e[22];let p;e[27]!==d||e[28]!==u?(p=(0,s.jsxs)("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[d,u]}),e[27]=d,e[28]=u,e[29]=p):p=e[29];let x;return e[30]!==p||e[31]!==f?(x=(0,s.jsxs)(s.Fragment,{children:[f,p]}),e[30]=p,e[31]=f,e[32]=x):x=e[32],x},Ne=t=>{let e=(0,k.c)(7),{snippets:r,onSelect:i}=t,o;if(e[0]!==i||e[1]!==r){let a;e[3]===i?a=e[4]:(a=c=>(0,s.jsx)(oe,{className:"rounded-none",onSelect:()=>i(c),children:(0,s.jsx)("div",{className:"flex flex-row gap-2 items-center",children:(0,s.jsx)("span",{className:"mt-1 text-accent-foreground",children:c.title})})},c.title),e[3]=i,e[4]=a),o=r.map(a),e[0]=i,e[1]=r,e[2]=o}else o=e[2];let l;return e[5]===o?l=e[6]:(l=(0,s.jsx)(ne,{className:"flex flex-col overflow-auto",children:o}),e[5]=o,e[6]=l),l};export{ve as default};
1
+ import{s as I}from"./chunk-LvLJmgfZ.js";import"./useEvent-DlWF5OMa.js";import{t as P}from"./react-BGmjiNul.js";import{w as q}from"./cells-Cv9PtwL9.js";import"./react-dom-C9fstfnp.js";import{t as $}from"./compiler-runtime-DeeZ7FnK.js";import{n as D}from"./constants-Bkp4R3bQ.js";import"./config-DFDEcYvy.js";import{t as F}from"./jsx-runtime-DN_bIXfG.js";import{i as G,t as w}from"./button-B8cGZzP5.js";import{t as T}from"./cn-C1rgT0yh.js";import{at as W}from"./dist-CAcX026F.js";import"./cjs-Bj40p_Np.js";import"./main-CwSdzVhm.js";import"./useNonce-EAuSVK-5.js";import{r as A}from"./requests-C0HaHO6a.js";import{n as M,t as B}from"./LazyAnyLanguageCodeMirror-Cp2punaU.js";import{h as J}from"./select-D9lTzMzP.js";import{t as K}from"./spinner-C1czjtp7.js";import{t as L}from"./plus-CHesBJpY.js";import"./dist-HGZzCB0y.js";import"./dist-CVj-_Iiz.js";import"./dist-BVf1IY4_.js";import"./dist-Cq_4nPfh.js";import"./dist-RKnr9SNh.js";import{r as R}from"./useTheme-DfP1CWaW.js";import"./Combination-D1TsGrBC.js";import{t as U}from"./tooltip-CvjcEpZC.js";import{a as V,c as Y,i as Q,n as X,r as Z}from"./dialog-CF5DtF1E.js";import{n as ee}from"./ImperativeModal-DVhvP4lH.js";import{n as te}from"./error-banner-DvT0IGDZ.js";import{t as se}from"./RenderHTML-SoetmcW2.js";import"./purify.es-N-2faAGj.js";import{n as re}from"./useAsyncData-BJJJOr9W.js";import{a as le,o as oe,r as ie,t as ae,u as ne}from"./command-n_oMaKjl.js";import{o as me}from"./focus-D1y1tXyC.js";import{n as ce,r as de,t as E}from"./react-resizable-panels.browser.esm-BqxQegSf.js";import{t as pe}from"./empty-state-B0XJ9ZUi.js";import{a as he,i as fe,t as H}from"./kiosk-mode-DfyjlR7p.js";var O=$(),C=I(P(),1),s=I(F(),1);const xe=t=>{let e=(0,O.c)(6),{children:r}=t,{openModal:i,closeModal:o}=ee(),l;e[0]!==o||e[1]!==i?(l=()=>i((0,s.jsx)(ue,{onClose:o})),e[0]=o,e[1]=i,e[2]=l):l=e[2];let a;return e[3]!==r||e[4]!==l?(a=(0,s.jsx)(G,{onClick:l,children:r}),e[3]=r,e[4]=l,e[5]=a):a=e[5],a};var ue=t=>{let e=(0,O.c)(4),{onClose:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)(Y,{children:"Contribute a Snippet"}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=(0,s.jsxs)(V,{children:[i,(0,s.jsxs)(Z,{children:["Have a useful snippet you want to share with the community? Make a pull request"," ",(0,s.jsx)("a",{href:D.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[1]=o):o=e[1];let l;return e[2]===r?l=e[3]:(l=(0,s.jsxs)(X,{className:"max-w-md",children:[o,(0,s.jsx)(Q,{children:(0,s.jsx)(w,{"data-testid":"snippet-close-button",variant:"default",onClick:r,children:"Close"})})]}),e[2]=r,e[3]=l),l},k=$(),je=[W.lineWrapping],ve=()=>{let t=(0,k.c)(24),{readSnippets:e}=A(),[r,i]=C.useState(),o=fe(),l=he(),a;t[0]===e?a=t[1]:(a=()=>e(),t[0]=e,t[1]=a);let c;t[2]===Symbol.for("react.memo_cache_sentinel")?(c=[],t[2]=c):c=t[2];let{data:N,error:j,isPending:g}=re(a,c);if(j){let m;return t[3]===j?m=t[4]:(m=(0,s.jsx)(te,{error:j}),t[3]=j,t[4]=m),m}if(g||!N){let m;return t[5]===Symbol.for("react.memo_cache_sentinel")?(m=(0,s.jsx)(K,{size:"medium",centered:!0}),t[5]=m):m=t[5],m}let _=o==="vertical",v;t[6]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(le,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=v):v=t[6];let h,f;t[7]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsxs)("div",{className:"flex items-center w-full border-b",children:[v,(0,s.jsx)(xe,{children:(0,s.jsx)("button",{className:"float-right px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:(0,s.jsx)(L,{className:"h-4 w-4"})})})]}),f=(0,s.jsx)(ie,{children:"No results"}),t[7]=h,t[8]=f):(h=t[7],f=t[8]);let b;t[9]===Symbol.for("react.memo_cache_sentinel")?(b=m=>i(m),t[9]=b):b=t[9];let d;t[10]===N.snippets?d=t[11]:(d=(0,s.jsx)(E,{defaultSize:40,minSize:20,maxSize:70,children:(0,s.jsxs)(ae,{className:"h-full rounded-none",children:[h,f,(0,s.jsx)(Ne,{onSelect:b,snippets:N.snippets})]})}),t[10]=N.snippets,t[11]=d);let u=_?"h-1":"w-1",p;t[12]===u?p=t[13]:(p=T("bg-border hover:bg-primary/50 transition-colors",u),t[12]=u,t[13]=p);let x;t[14]===p?x=t[15]:(x=(0,s.jsx)(de,{className:p}),t[14]=p,t[15]=x);let n;t[16]===r?n=t[17]:(n=(0,s.jsx)(E,{defaultSize:60,minSize:20,children:(0,s.jsx)(C.Suspense,{children:(0,s.jsx)("div",{className:"h-full snippet-viewer flex flex-col overflow-hidden",children:r?(0,s.jsx)(be,{snippet:r,onClose:()=>i(void 0)},r.title):(0,s.jsx)(pe,{title:"",description:"Click on a snippet to view its content."})})})}),t[16]=r,t[17]=n);let S;return t[18]!==o||t[19]!==l||t[20]!==n||t[21]!==d||t[22]!==x?(S=(0,s.jsx)("div",{className:"flex-1 overflow-hidden h-full",children:(0,s.jsxs)(ce,{direction:o,className:"h-full",children:[d,x,n]},l)}),t[18]=o,t[19]=l,t[20]=n,t[21]=d,t[22]=x,t[23]=S):S=t[23],S},be=t=>{let e=(0,k.c)(33),{snippet:r,onClose:i}=t,{theme:o}=R(),{createNewCell:l}=q(),a=me(),c;e[0]!==l||e[1]!==a||e[2]!==r.sections?(c=()=>{for(let n of[...r.sections].reverse())n.code&&l({code:n.code,before:!1,cellId:a??"__end__",skipIfCodeExists:!0})},e[0]=l,e[1]=a,e[2]=r.sections,e[3]=c):c=e[3];let N=c,j;e[4]!==l||e[5]!==a?(j=n=>{l({code:n,before:!1,cellId:a??"__end__"})},e[4]=l,e[5]=a,e[6]=j):j=e[6];let g=j,_;e[7]===r.title?_=e[8]:(_=(0,s.jsx)("span",{children:r.title}),e[7]=r.title,e[8]=_);let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(J,{className:"h-4 w-4"}),e[9]=v):v=e[9];let h;e[10]===i?h=e[11]:(h=(0,s.jsx)(w,{size:"sm",variant:"ghost",onClick:i,className:"h-6 w-6 p-0 hover:bg-muted-foreground/10",children:v}),e[10]=i,e[11]=h);let f;e[12]!==_||e[13]!==h?(f=(0,s.jsxs)("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center",children:[_,h]}),e[12]=_,e[13]=h,e[14]=f):f=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=(0,s.jsx)(M,{className:"ml-2 h-4 w-4"}),e[15]=b):b=e[15];let d;e[16]===N?d=e[17]:(d=(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(H,{children:(0,s.jsxs)(w,{className:"float-right",size:"xs",variant:"outline",onClick:N,children:["Insert snippet",b]})})}),e[16]=N,e[17]=d);let u;if(e[18]!==g||e[19]!==r.sections||e[20]!==r.title||e[21]!==o){let n;e[23]!==g||e[24]!==r.title||e[25]!==o?(n=S=>{let{code:m,html:z,id:y}=S;return z?(0,s.jsx)("div",{children:se({html:z})},`${r.title}-${y}`):m?(0,s.jsxs)("div",{className:"relative hover-actions-parent pr-2",children:[(0,s.jsx)(H,{children:(0,s.jsx)(U,{content:"Insert snippet",children:(0,s.jsx)(w,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{g(m)},children:(0,s.jsx)(M,{className:"h-5 w-5"})})})}),(0,s.jsx)(C.Suspense,{children:(0,s.jsx)(B,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:je,value:m,readOnly:!0},`${r.title}-${y}`)})]},`${r.title}-${y}`):null},e[23]=g,e[24]=r.title,e[25]=o,e[26]=n):n=e[26],u=r.sections.map(n),e[18]=g,e[19]=r.sections,e[20]=r.title,e[21]=o,e[22]=u}else u=e[22];let p;e[27]!==d||e[28]!==u?(p=(0,s.jsxs)("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[d,u]}),e[27]=d,e[28]=u,e[29]=p):p=e[29];let x;return e[30]!==p||e[31]!==f?(x=(0,s.jsxs)(s.Fragment,{children:[f,p]}),e[30]=p,e[31]=f,e[32]=x):x=e[32],x},Ne=t=>{let e=(0,k.c)(7),{snippets:r,onSelect:i}=t,o;if(e[0]!==i||e[1]!==r){let a;e[3]===i?a=e[4]:(a=c=>(0,s.jsx)(oe,{className:"rounded-none",onSelect:()=>i(c),children:(0,s.jsx)("div",{className:"flex flex-row gap-2 items-center",children:(0,s.jsx)("span",{className:"mt-1 text-accent-foreground",children:c.title})})},c.title),e[3]=i,e[4]=a),o=r.map(a),e[0]=i,e[1]=r,e[2]=o}else o=e[2];let l;return e[5]===o?l=e[6]:(l=(0,s.jsx)(ne,{className:"flex flex-col overflow-auto",children:o}),e[5]=o,e[6]=l),l};export{ve as default};
@@ -0,0 +1 @@
1
+ import{s as el}from"./chunk-LvLJmgfZ.js";import{d as kt,l as lt,n as nt,p as Ct,u as Oe}from"./useEvent-DlWF5OMa.js";import{t as mr}from"./react-BGmjiNul.js";import{G as hr,Jn as pr,Ln as fr,Rn as gr,Wn as xr,nn as yr,qn as vr,vt as re}from"./cells-Cv9PtwL9.js";import{t as tl}from"./react-dom-C9fstfnp.js";import{t as he}from"./compiler-runtime-DeeZ7FnK.js";import{t as ll}from"./get-CyLJYAfP.js";import{c as br,i as jr,l as kr,r as St}from"./client-CGOlSEYr.js";import{d as Ke,r as Cr,s as nl}from"./hotkeys-uKX61F1_.js";import{E as Sr,T as Nr,b as sl,f as wr,l as Kr,v as rl,w as il}from"./utils-CJJIceVn.js";import{j as Me}from"./config-DFDEcYvy.js";import{a as Nt,n as Ir,s as Dr,t as _r}from"./switch-DPeh0R76.js";import{t as Er}from"./jsx-runtime-DN_bIXfG.js";import{n as Pr,r as al,t as ie}from"./button-B8cGZzP5.js";import{t as ue}from"./cn-C1rgT0yh.js";import{l as ol}from"./once-CTiSlR1m.js";import{r as st}from"./requests-C0HaHO6a.js";import{t as He}from"./createLucideIcon-CW2xpJ57.js";import{a as cl,i as Ue,l as dl,n as ul,o as qe,r as Mr,s as Ar,t as Fr}from"./ai-model-dropdown-CrMTCgo7.js";import{t as Tr}from"./check-CrAQug3q.js";import{h as wt,i as ml,l as fe,n as $r,r as Rr,s as Br,t as zr}from"./select-D9lTzMzP.js";import{t as Vr}from"./chevron-right-CqEd11Di.js";import{t as Lr}from"./circle-check-big-OIMTUpe6.js";import{c as Or}from"./dropdown-menu-BP4_BZLr.js";import{t as Hr}from"./copy-gBVL4NN-.js";import{n as rt,t as hl}from"./spinner-C1czjtp7.js";import{t as Ur}from"./plug-Bp1OpH-w.js";import{t as qr}from"./plus-CHesBJpY.js";import{t as pl}from"./refresh-cw-Din9uFKE.js";import{F as fl,G as it,H as Wr,J as Gr,M as Kt,N as Yr,R as Se,S as Xr,V as Zr,X as Qr,Y as gl,Z as We,_ as Jr,ct as ei,et as ti,g as li,it as It,lt as at,o as Ge,ot,r as Ae,st as Dt,z as xl}from"./input-B80Yt1uu.js";import{a as U,c as O,d as G,g as ni,i as si,l as H,o as X,p as ri,r as ii,s as ai,u as L,v as yl,y as vl}from"./textarea-wbzgrXvB.js";import{t as oi}from"./trash-2-C-lF7BNB.js";import{t as _t}from"./triangle-alert-CbD0f2J6.js";import{t as ct}from"./badge-DAnNhy3O.js";import{t as Ne}from"./use-toast-Bzf3rpev.js";import{t as ci}from"./useTheme-DfP1CWaW.js";import{t as Be}from"./tooltip-CvjcEpZC.js";import{a as di}from"./mode-PeuS_Lp-.js";import{a as ui,c as mi,n as hi,o as pi,s as fi,t as gi}from"./dialog-CF5DtF1E.js";import{a as dt,c as xi,d as ze,g as yi,h as vi,i as bi,l as Ee,m as bl,n as Et,p as Fe,s as jl,u as kl}from"./VisuallyHidden-B9t3FhTP.js";import{E as ji,I as Cl,L as ki,O as Pt,P as Sl,R as Ye,_ as Ci,j as Nl,k as ke,l as Si,m as Ni,p as wi,t as wl,v as Kl,y as Ki,z as ut}from"./usePress-DTwIUo40.js";import{t as Il}from"./SSRProvider-DD7JA3RM.js";import{t as mt}from"./context-DHfVoQfl.js";import{i as Ii,r as Di,s as _i,t as Ei}from"./popover-DtnzNVk-.js";import{n as Pi,t as Mi}from"./SelectionIndicator-BtLUNjRz.js";import{n as Ai}from"./useDebounce-em3gna-v.js";import{n as Fi,t as ht}from"./error-banner-DvT0IGDZ.js";import{t as Ti}from"./copy-DRhpWiOq.js";import{a as $i,i as Ri,n as Bi,r as zi}from"./multi-map-CQd4MZr5.js";import{t as ae}from"./kbd-Czc5z_04.js";import{t as oe}from"./links-DNmjkr65.js";import{n as Vi,r as Li,t as Oi}from"./alert-BEdExd6A.js";import{i as Xe,n as pt,r as Dl,t as _l}from"./tabs-Ctk4D03n.js";import{n as El}from"./useAsyncData-BJJJOr9W.js";import{a as Hi,i as ft,n as Ui,o as Pl,r as Mt,t as qi}from"./table--_20dwBZ.js";import{t as At}from"./renderShortcut-D0Pei-OA.js";import{t as Te}from"./label-CNZLffHW.js";var Ml=He("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),Wi=He("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),Al=He("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),Gi=He("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),Yi=He("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),m=el(mr(),1);function Fl(t,e){let l=(0,m.useRef)(!0),s=(0,m.useRef)(null);ut(()=>(l.current=!0,()=>{l.current=!1}),[]),ut(()=>{l.current?l.current=!1:(!s.current||e.some((r,i)=>!Object.is(r,s[i])))&&t(),s.current=e},e)}function Tl(t,e){let{collection:l,onLoadMore:s,scrollOffset:r=1}=t,i=(0,m.useRef)(null),a=wi(c=>{for(let o of c)o.isIntersecting&&s&&s()});ut(()=>(e.current&&(i.current=new IntersectionObserver(a,{root:Fe(e==null?void 0:e.current),rootMargin:`0px ${100*r}% ${100*r}% ${100*r}%`}),i.current.observe(e.current)),()=>{i.current&&i.current.disconnect()}),[l,e,r])}function $l(t){let e=m.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}var Xi="react-aria-clear-focus",Zi="react-aria-focus",Qi=500;function Ji(t){let{isDisabled:e,onLongPressStart:l,onLongPressEnd:s,onLongPress:r,threshold:i=Qi,accessibilityDescription:a}=t,c=(0,m.useRef)(void 0),{addGlobalListener:o,removeGlobalListener:d}=Ni(),{pressProps:h}=wl({isDisabled:e,onPressStart(u){if(u.continuePropagation(),(u.pointerType==="mouse"||u.pointerType==="touch")&&(l&&l({...u,type:"longpressstart"}),c.current=setTimeout(()=>{u.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Sl(u.target).activeElement!==u.target&&Pt(u.target),r&&r({...u,type:"longpress"}),c.current=void 0},i),u.pointerType==="touch")){let f=p=>{p.preventDefault()};o(u.target,"contextmenu",f,{once:!0}),o(window,"pointerup",()=>{setTimeout(()=>{d(u.target,"contextmenu",f)},30)},{once:!0})}},onPressEnd(u){c.current&&clearTimeout(c.current),s&&(u.pointerType==="mouse"||u.pointerType==="touch")&&s({...u,type:"longpressend"})}});return{longPressProps:ke(h,kl(r&&!e?a:void 0))}}function ea(t,e){let l=e==null?void 0:e.isDisabled,[s,r]=(0,m.useState)(!1);return ut(()=>{if(t!=null&&t.current&&!l){let i=()=>{t.current&&r(!!dt(t.current,{tabbable:!0}).nextNode())};i();let a=new MutationObserver(i);return a.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{a.disconnect()}}}),l?!1:s}function Rl(t){let e=la(Sl(t));e!==t&&(e&&ta(e,t),t&&Bl(t,e))}function ta(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function Bl(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function la(t){let e=Nl(t),l=e==null?void 0:e.getAttribute("aria-activedescendant");return l&&t.getElementById(l)||e}function Ft(t){return ji()?t.altKey:t.ctrlKey}function gt(t,e){var r,i;let l=`[data-key="${CSS.escape(String(e))}"]`,s=(r=t.current)==null?void 0:r.dataset.collection;return s&&(l=`[data-collection="${CSS.escape(s)}"]${l}`),(i=t.current)==null?void 0:i.querySelector(l)}var zl=new WeakMap;function na(t){let e=Ye();return zl.set(t,e),e}function sa(t){return zl.get(t)}var ra=1e3;function ia(t){let{keyboardDelegate:e,selectionManager:l,onTypeSelect:s}=t,r=(0,m.useRef)({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?i=>{let a=aa(i.key);if(!(!a||i.ctrlKey||i.metaKey||!i.currentTarget.contains(i.target)||r.search.length===0&&a===" ")){if(a===" "&&r.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),r.search+=a,e.getKeyForSearch!=null){let c=e.getKeyForSearch(r.search,l.focusedKey);c??(c=e.getKeyForSearch(r.search)),c!=null&&(l.setFocusedKey(c),s&&s(c))}clearTimeout(r.timeout),r.timeout=setTimeout(()=>{r.search=""},ra)}}:void 0}}}function aa(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}var oa=tl();function ca(t){let{selectionManager:e,keyboardDelegate:l,ref:s,autoFocus:r=!1,shouldFocusWrap:i=!1,disallowEmptySelection:a=!1,disallowSelectAll:c=!1,escapeKeyBehavior:o="clearSelection",selectOnFocus:d=e.selectionBehavior==="replace",disallowTypeAhead:h=!1,shouldUseVirtualFocus:u,allowsTabNavigation:f=!1,isVirtualized:p,scrollRef:x=s,linkBehavior:j="action"}=t,{direction:k}=mt(),S=Kl(),I=y=>{var R,B,Y,C,Z,Q,ee,D,g,_,J,te,le;if(y.altKey&&y.key==="Tab"&&y.preventDefault(),!((R=s.current)!=null&&R.contains(y.target)))return;let M=(F,ne)=>{if(F!=null){if(e.isLink(F)&&j==="selection"&&d&&!Ft(y)){(0,oa.flushSync)(()=>{e.setFocusedKey(F,ne)});let se=gt(s,F),ce=e.getItemProps(F);se&&S.open(se,y,ce.href,ce.routerOptions);return}if(e.setFocusedKey(F,ne),e.isLink(F)&&j==="override")return;y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(F):d&&!Ft(y)&&e.replaceSelection(F)}};switch(y.key){case"ArrowDown":if(l.getKeyBelow){let F=e.focusedKey==null?(B=l.getFirstKey)==null?void 0:B.call(l):(Y=l.getKeyBelow)==null?void 0:Y.call(l,e.focusedKey);F==null&&i&&(F=(C=l.getFirstKey)==null?void 0:C.call(l,e.focusedKey)),F!=null&&(y.preventDefault(),M(F))}break;case"ArrowUp":if(l.getKeyAbove){let F=e.focusedKey==null?(Z=l.getLastKey)==null?void 0:Z.call(l):(Q=l.getKeyAbove)==null?void 0:Q.call(l,e.focusedKey);F==null&&i&&(F=(ee=l.getLastKey)==null?void 0:ee.call(l,e.focusedKey)),F!=null&&(y.preventDefault(),M(F))}break;case"ArrowLeft":if(l.getKeyLeftOf){let F=e.focusedKey==null?null:(D=l.getKeyLeftOf)==null?void 0:D.call(l,e.focusedKey);F==null&&i&&(F=k==="rtl"?(g=l.getFirstKey)==null?void 0:g.call(l,e.focusedKey):(_=l.getLastKey)==null?void 0:_.call(l,e.focusedKey)),F!=null&&(y.preventDefault(),M(F,k==="rtl"?"first":"last"))}break;case"ArrowRight":if(l.getKeyRightOf){let F=e.focusedKey==null?null:(J=l.getKeyRightOf)==null?void 0:J.call(l,e.focusedKey);F==null&&i&&(F=k==="rtl"?(te=l.getLastKey)==null?void 0:te.call(l,e.focusedKey):(le=l.getFirstKey)==null?void 0:le.call(l,e.focusedKey)),F!=null&&(y.preventDefault(),M(F,k==="rtl"?"last":"first"))}break;case"Home":if(l.getFirstKey){if(e.focusedKey===null&&y.shiftKey)return;y.preventDefault();let F=l.getFirstKey(e.focusedKey,ze(y));e.setFocusedKey(F),F!=null&&(ze(y)&&y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(F):d&&e.replaceSelection(F))}break;case"End":if(l.getLastKey){if(e.focusedKey===null&&y.shiftKey)return;y.preventDefault();let F=l.getLastKey(e.focusedKey,ze(y));e.setFocusedKey(F),F!=null&&(ze(y)&&y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(F):d&&e.replaceSelection(F))}break;case"PageDown":if(l.getKeyPageBelow&&e.focusedKey!=null){let F=l.getKeyPageBelow(e.focusedKey);F!=null&&(y.preventDefault(),M(F))}break;case"PageUp":if(l.getKeyPageAbove&&e.focusedKey!=null){let F=l.getKeyPageAbove(e.focusedKey);F!=null&&(y.preventDefault(),M(F))}break;case"a":ze(y)&&e.selectionMode==="multiple"&&c!==!0&&(y.preventDefault(),e.selectAll());break;case"Escape":o==="clearSelection"&&!a&&e.selectedKeys.size!==0&&(y.stopPropagation(),y.preventDefault(),e.clearSelection());break;case"Tab":if(!f){if(y.shiftKey)s.current.focus();else{let F=dt(s.current,{tabbable:!0}),ne,se;do se=F.lastChild(),se&&(ne=se);while(se);ne&&(!ne.contains(document.activeElement)||document.activeElement&&!Si(document.activeElement))&&Pt(ne)}break}}},v=(0,m.useRef)({top:0,left:0});ot(x,"scroll",p?void 0:()=>{var y,M;v.current={top:((y=x.current)==null?void 0:y.scrollTop)??0,left:((M=x.current)==null?void 0:M.scrollLeft)??0}});let N=y=>{var M,R;if(e.isFocused){y.currentTarget.contains(y.target)||e.setFocused(!1);return}if(y.currentTarget.contains(y.target)){if(e.setFocused(!0),e.focusedKey==null){let B=C=>{C!=null&&(e.setFocusedKey(C),d&&!e.isSelected(C)&&e.replaceSelection(C))},Y=y.relatedTarget;Y&&y.currentTarget.compareDocumentPosition(Y)&Node.DOCUMENT_POSITION_FOLLOWING?B(e.lastSelectedKey??((M=l.getLastKey)==null?void 0:M.call(l))):B(e.firstSelectedKey??((R=l.getFirstKey)==null?void 0:R.call(l)))}else!p&&x.current&&(x.current.scrollTop=v.current.top,x.current.scrollLeft=v.current.left);if(e.focusedKey!=null&&x.current){let B=gt(s,e.focusedKey);B instanceof HTMLElement&&(!B.contains(document.activeElement)&&!u&&Pt(B),xl()==="keyboard"&&Ee(B,{containingElement:s.current}))}}},A=y=>{y.currentTarget.contains(y.relatedTarget)||e.setFocused(!1)},b=(0,m.useRef)(!1);ot(s,Zi,u?y=>{let{detail:M}=y;y.stopPropagation(),e.setFocused(!0),(M==null?void 0:M.focusStrategy)==="first"&&(b.current=!0)}:void 0),Fl(()=>{var y;if(b.current){let M=((y=l.getFirstKey)==null?void 0:y.call(l))??null;if(M==null){let R=Nl();Rl(s.current),Bl(R,null),e.collection.size>0&&(b.current=!1)}else e.setFocusedKey(M),b.current=!1}},[e.collection]),Fl(()=>{e.collection.size>0&&(b.current=!1)},[e.focusedKey]),ot(s,Xi,u?y=>{var M;y.stopPropagation(),e.setFocused(!1),(M=y.detail)!=null&&M.clearFocusKey&&e.setFocusedKey(null)}:void 0);let $=(0,m.useRef)(r),E=(0,m.useRef)(!1);(0,m.useEffect)(()=>{var y,M;if($.current){let R=null;r==="first"&&(R=((y=l.getFirstKey)==null?void 0:y.call(l))??null),r==="last"&&(R=((M=l.getLastKey)==null?void 0:M.call(l))??null);let B=e.selectedKeys;if(B.size){for(let Y of B)if(e.canSelectItem(Y)){R=Y;break}}e.setFocused(!0),e.setFocusedKey(R),R==null&&!u&&s.current&&Se(s.current),e.collection.size>0&&($.current=!1,E.current=!0)}});let K=(0,m.useRef)(e.focusedKey),P=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==K.current||E.current)&&x.current&&s.current){let y=xl(),M=gt(s,e.focusedKey);if(!(M instanceof HTMLElement))return;(y==="keyboard"||E.current)&&(P.current&&cancelAnimationFrame(P.current),P.current=requestAnimationFrame(()=>{x.current&&(xi(x.current,M),y!=="virtual"&&Ee(M,{containingElement:s.current}))}))}!u&&e.isFocused&&e.focusedKey==null&&K.current!=null&&s.current&&Se(s.current),K.current=e.focusedKey,E.current=!1}),(0,m.useEffect)(()=>()=>{P.current&&cancelAnimationFrame(P.current)},[]),ot(s,"react-aria-focus-scope-restore",y=>{y.preventDefault(),e.setFocused(!0)});let z={onKeyDown:I,onFocus:N,onBlur:A,onMouseDown(y){x.current===y.target&&y.preventDefault()}},{typeSelectProps:V}=ia({keyboardDelegate:l,selectionManager:e});h||(z=ke(V,z));let T;u||(T=e.focusedKey==null?0:-1);let w=na(e.collection);return{collectionProps:ke(z,{tabIndex:T,"data-collection":w})}}function Vl(t){let{id:e,selectionManager:l,key:s,ref:r,shouldSelectOnPressUp:i,shouldUseVirtualFocus:a,focus:c,isDisabled:o,onAction:d,allowsDifferentPressOrigin:h,linkBehavior:u="action"}=t,f=Kl();e=Ye(e);let p=C=>{if(C.pointerType==="keyboard"&&Ft(C))l.toggleSelection(s);else{if(l.selectionMode==="none")return;if(l.isLink(s)){if(u==="selection"&&r.current){let Z=l.getItemProps(s);f.open(r.current,C,Z.href,Z.routerOptions),l.setSelectedKeys(l.selectedKeys);return}else if(u==="override"||u==="none")return}l.selectionMode==="single"?l.isSelected(s)&&!l.disallowEmptySelection?l.toggleSelection(s):l.replaceSelection(s):C&&C.shiftKey?l.extendSelection(s):l.selectionBehavior==="toggle"||C&&(ze(C)||C.pointerType==="touch"||C.pointerType==="virtual")?l.toggleSelection(s):l.replaceSelection(s)}};(0,m.useEffect)(()=>{s===l.focusedKey&&l.isFocused&&(a?Rl(r.current):c?c():document.activeElement!==r.current&&r.current&&Se(r.current))},[r,s,l.focusedKey,l.childFocusStrategy,l.isFocused,a]),o||(o=l.isDisabled(s));let x={};!a&&!o?x={tabIndex:s===l.focusedKey?0:-1,onFocus(C){C.target===r.current&&l.setFocusedKey(s)}}:o&&(x.onMouseDown=C=>{C.preventDefault()});let j=l.isLink(s)&&u==="override",k=d&&t.UNSTABLE_itemBehavior==="action",S=l.isLink(s)&&u!=="selection"&&u!=="none",I=!o&&l.canSelectItem(s)&&!j&&!k,v=(d||S)&&!o,N=v&&(l.selectionBehavior==="replace"?!I:!I||l.isEmpty),A=v&&I&&l.selectionBehavior==="replace",b=N||A,$=(0,m.useRef)(null),E=b&&I,K=(0,m.useRef)(!1),P=(0,m.useRef)(!1),z=l.getItemProps(s),V=C=>{if(d){var Z;d(),(Z=r.current)==null||Z.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}S&&r.current&&f.open(r.current,C,z.href,z.routerOptions)},T={ref:r};if(i?(T.onPressStart=C=>{$.current=C.pointerType,K.current=E,C.pointerType==="keyboard"&&(!b||Ol())&&p(C)},h?(T.onPressUp=N?void 0:C=>{C.pointerType==="mouse"&&I&&p(C)},T.onPress=N?V:C=>{C.pointerType!=="keyboard"&&C.pointerType!=="mouse"&&I&&p(C)}):T.onPress=C=>{if(N||A&&C.pointerType!=="mouse"){if(C.pointerType==="keyboard"&&!Ll())return;V(C)}else C.pointerType!=="keyboard"&&I&&p(C)}):(T.onPressStart=C=>{$.current=C.pointerType,K.current=E,P.current=N,I&&(C.pointerType==="mouse"&&!N||C.pointerType==="keyboard"&&(!v||Ol()))&&p(C)},T.onPress=C=>{(C.pointerType==="touch"||C.pointerType==="pen"||C.pointerType==="virtual"||C.pointerType==="keyboard"&&b&&Ll()||C.pointerType==="mouse"&&P.current)&&(b?V(C):I&&p(C))}),x["data-collection"]=sa(l.collection),x["data-key"]=s,T.preventFocusOnPress=a,a&&(T=ke(T,{onPressStart(C){C.pointerType!=="touch"&&(l.setFocused(!0),l.setFocusedKey(s))},onPress(C){C.pointerType==="touch"&&(l.setFocused(!0),l.setFocusedKey(s))}})),z)for(let C of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])z[C]&&(T[C]=Cl(T[C],z[C]));let{pressProps:w,isPressed:y}=wl(T),M=A?C=>{$.current==="mouse"&&(C.stopPropagation(),C.preventDefault(),V(C))}:void 0,{longPressProps:R}=Ji({isDisabled:!E,onLongPress(C){C.pointerType==="touch"&&(p(C),l.setSelectionBehavior("toggle"))}}),B=C=>{$.current==="touch"&&K.current&&C.preventDefault()},Y=u!=="none"&&l.isLink(s)?C=>{Ci.isOpening||C.preventDefault()}:void 0;return{itemProps:ke(x,I||N||a&&!o?w:{},E?R:{},{onDoubleClick:M,onDragStartCapture:B,onClick:Y,id:e},a?{onMouseDown:C=>C.preventDefault()}:void 0),isPressed:y,isSelected:l.isSelected(s),isFocused:l.isFocused&&l.focusedKey===s,isDisabled:o,allowsSelection:I,hasAction:b}}function Ll(){var t;return((t=window.event)==null?void 0:t.key)==="Enter"}function Ol(){let t=window.event;return(t==null?void 0:t.key)===" "||(t==null?void 0:t.code)==="Space"}var Hl=class{getItemRect(t){let e=this.ref.current;if(!e)return null;let l=t==null?null:gt(this.ref,t);if(!l)return null;let s=e.getBoundingClientRect(),r=l.getBoundingClientRect();return{x:r.left-s.left-e.clientLeft+e.scrollLeft,y:r.top-s.top-e.clientTop+e.scrollTop,width:r.width,height:r.height}}getContentSize(){let t=this.ref.current;return{width:(t==null?void 0:t.scrollWidth)??0,height:(t==null?void 0:t.scrollHeight)??0}}getVisibleRect(){let t=this.ref.current;return{x:(t==null?void 0:t.scrollLeft)??0,y:(t==null?void 0:t.scrollTop)??0,width:(t==null?void 0:t.clientWidth)??0,height:(t==null?void 0:t.clientHeight)??0}}constructor(t){this.ref=t}},Tt=class{isDisabled(t){var e;return this.disabledBehavior==="all"&&(((e=t.props)==null?void 0:e.isDisabled)||this.disabledKeys.has(t.key))}findNextNonDisabled(t,e){let l=t;for(;l!=null;){let s=this.collection.getItem(l);if((s==null?void 0:s.type)==="item"&&!this.isDisabled(s))return l;l=e(l)}return null}getNextKey(t){let e=t;return e=this.collection.getKeyAfter(e),this.findNextNonDisabled(e,l=>this.collection.getKeyAfter(l))}getPreviousKey(t){let e=t;return e=this.collection.getKeyBefore(e),this.findNextNonDisabled(e,l=>this.collection.getKeyBefore(l))}findKey(t,e,l){let s=t,r=this.layoutDelegate.getItemRect(s);if(!r||s==null)return null;let i=r;do{if(s=e(s),s==null)break;r=this.layoutDelegate.getItemRect(s)}while(r&&l(i,r)&&s!=null);return s}isSameRow(t,e){return t.y===e.y||t.x!==e.x}isSameColumn(t,e){return t.x===e.x||t.y!==e.y}getKeyBelow(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getNextKey(e),this.isSameRow):this.getNextKey(t)}getKeyAbove(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getPreviousKey(e),this.isSameRow):this.getPreviousKey(t)}getNextColumn(t,e){return e?this.getPreviousKey(t):this.getNextKey(t)}getKeyRightOf(t){let e=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,l=>this.layoutDelegate[e](l))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="rtl"):this.findKey(t,l=>this.getNextColumn(l,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="rtl"):null}getKeyLeftOf(t){let e=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,l=>this.layoutDelegate[e](l))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="ltr"):this.findKey(t,l=>this.getNextColumn(l,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="ltr"):null}getFirstKey(){let t=this.collection.getFirstKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyAfter(e))}getLastKey(){let t=this.collection.getLastKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(t){let e=this.ref.current,l=this.layoutDelegate.getItemRect(t);if(!l)return null;if(e&&!bl(e))return this.getFirstKey();let s=t;if(this.orientation==="horizontal"){let r=Math.max(0,l.x+l.width-this.layoutDelegate.getVisibleRect().width);for(;l&&l.x>r&&s!=null;)s=this.getKeyAbove(s),l=s==null?null:this.layoutDelegate.getItemRect(s)}else{let r=Math.max(0,l.y+l.height-this.layoutDelegate.getVisibleRect().height);for(;l&&l.y>r&&s!=null;)s=this.getKeyAbove(s),l=s==null?null:this.layoutDelegate.getItemRect(s)}return s??this.getFirstKey()}getKeyPageBelow(t){let e=this.ref.current,l=this.layoutDelegate.getItemRect(t);if(!l)return null;if(e&&!bl(e))return this.getLastKey();let s=t;if(this.orientation==="horizontal"){let r=Math.min(this.layoutDelegate.getContentSize().width,l.y-l.width+this.layoutDelegate.getVisibleRect().width);for(;l&&l.x<r&&s!=null;)s=this.getKeyBelow(s),l=s==null?null:this.layoutDelegate.getItemRect(s)}else{let r=Math.min(this.layoutDelegate.getContentSize().height,l.y-l.height+this.layoutDelegate.getVisibleRect().height);for(;l&&l.y<r&&s!=null;)s=this.getKeyBelow(s),l=s==null?null:this.layoutDelegate.getItemRect(s)}return s??this.getLastKey()}getKeyForSearch(t,e){if(!this.collator)return null;let l=this.collection,s=e||this.getFirstKey();for(;s!=null;){let r=l.getItem(s);if(!r)return null;let i=r.textValue.slice(0,t.length);if(r.textValue&&this.collator.compare(i,t)===0)return s;s=this.getNextKey(s)}return null}constructor(...t){if(t.length===1){let e=t[0];this.collection=e.collection,this.ref=e.ref,this.collator=e.collator,this.disabledKeys=e.disabledKeys||new Set,this.disabledBehavior=e.disabledBehavior||"all",this.orientation=e.orientation||"vertical",this.direction=e.direction,this.layout=e.layout||"stack",this.layoutDelegate=e.layoutDelegate||new Hl(e.ref)}else this.collection=t[0],this.disabledKeys=t[1],this.ref=t[2],this.collator=t[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Hl(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}};function Ul(t){let{selectionManager:e,collection:l,disabledKeys:s,ref:r,keyboardDelegate:i,layoutDelegate:a}=t,c=jl({usage:"search",sensitivity:"base"}),o=e.disabledBehavior,d=(0,m.useMemo)(()=>i||new Tt({collection:l,disabledKeys:s,disabledBehavior:o,ref:r,collator:c,layoutDelegate:a}),[i,a,l,s,r,c,o]),{collectionProps:h}=ca({...t,ref:r,selectionManager:e,keyboardDelegate:d});return{listProps:h}}var da=class{build(t,e){return this.context=e,ql(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:e,items:l}=t;if(m.isValidElement(e)&&e.type===m.Fragment)yield*this.iterateCollection({children:e.props.children,items:l});else if(typeof e=="function"){if(!l)throw Error("props.children was a function but props.items is missing");let s=0;for(let r of l)yield*this.getFullNode({value:r,index:s},{renderer:e}),s++}else{let s=[];m.Children.forEach(e,i=>{i&&s.push(i)});let r=0;for(let i of s){let a=this.getFullNode({element:i,index:r},{});for(let c of a)r++,yield c}}}getKey(t,e,l,s){if(t.key!=null)return t.key;if(e.type==="cell"&&e.key!=null)return`${s}${e.key}`;let r=e.value;if(r!=null){let i=r.key??r.id;if(i==null)throw Error("No key found for item");return i}return s?`${s}.${e.index}`:`$.${e.index}`}getChildState(t,e){return{renderer:e.renderer||t.renderer}}*getFullNode(t,e,l,s){if(m.isValidElement(t.element)&&t.element.type===m.Fragment){let c=[];m.Children.forEach(t.element.props.children,d=>{c.push(d)});let o=t.index??0;for(let d of c)yield*this.getFullNode({element:d,index:o++},e,l,s);return}let r=t.element;if(!r&&t.value&&e&&e.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=s?s.key:null,yield c;return}r=e.renderer(t.value)}if(m.isValidElement(r)){let c=r.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let u=r.type;throw Error(`Unknown element <${u}> in collection.`)}let o=c.getCollectionNode(r.props,this.context),d=t.index??0,h=o.next();for(;!h.done&&h.value;){let u=h.value;t.index=d;let f=u.key??null;f??(f=u.element?null:this.getKey(r,t,e,l));let p=[...this.getFullNode({...u,key:f,index:d,wrapper:ua(t.wrapper,u.wrapper)},this.getChildState(e,u),l?`${l}${r.key}`:r.key,s)];for(let x of p){if(x.value=u.value??t.value??null,x.value&&this.cache.set(x.value,x),t.type&&x.type!==t.type)throw Error(`Unsupported type <${$t(x.type)}> in <${$t((s==null?void 0:s.type)??"unknown parent type")}>. Only <${$t(t.type)}> is supported.`);d++,yield x}h=o.next(p)}return}if(t.key==null||t.type==null)return;let i=this,a={type:t.type,props:t.props,key:t.key,parentKey:s?s.key:null,value:t.value??null,level:s?s.level+1:0,index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:ql(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let o of t.childNodes()){o.key!=null&&(o.key=`${a.key}${o.key}`);let d=i.getFullNode({...o,index:c},i.getChildState(e,o),a.key,a);for(let h of d)c++,yield h}})};yield a}constructor(){this.cache=new WeakMap}};function ql(t){let e=[],l=null;return{*[Symbol.iterator](){for(let s of e)yield s;l||(l=t());for(let s of l)e.push(s),yield s}}}function ua(t,e){if(t&&e)return l=>t(e(l));if(t)return t;if(e)return e}function $t(t){return t[0].toUpperCase()+t.slice(1)}function Wl(t,e,l){let s=(0,m.useMemo)(()=>new da,[]),{children:r,items:i,collection:a}=t;return(0,m.useMemo)(()=>a||e(s.build({children:r,items:i},l)),[s,r,i,a,l,e])}function Gl(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function ma(t){return ha(t,0)}function ha(t,e){if(e<0)return;let l=0;for(let s of t){if(l===e)return s;l++}}function Rt(t,e,l){if(e.parentKey===l.parentKey)return e.index-l.index;let s=[...Yl(t,e),e],r=[...Yl(t,l),l],i=s.slice(0,r.length).findIndex((a,c)=>a!==r[c]);return i===-1?s.findIndex(a=>a===l)>=0?1:(r.findIndex(a=>a===e),-1):(e=s[i],l=r[i],e.index-l.index)}function Yl(t,e){let l=[],s=e;for(;(s==null?void 0:s.parentKey)!=null;)s=t.getItem(s.parentKey),s&&l.unshift(s);return l}var $e=class{get childNodes(){throw Error("childNodes is not supported")}clone(){let t=new this.constructor(this.key);return t.value=this.value,t.level=this.level,t.hasChildNodes=this.hasChildNodes,t.rendered=this.rendered,t.textValue=this.textValue,t["aria-label"]=this["aria-label"],t.index=this.index,t.parentKey=this.parentKey,t.prevKey=this.prevKey,t.nextKey=this.nextKey,t.firstChildKey=this.firstChildKey,t.lastChildKey=this.lastChildKey,t.props=this.props,t.render=this.render,t.colSpan=this.colSpan,t.colIndex=this.colIndex,t}filter(t,e,l){let s=this.clone();return e.addDescendants(s,t),s}constructor(t){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=t}},Xl=class extends $e{filter(t,e,l){let[s,r]=Ql(t,e,this.firstChildKey,l),i=this.clone();return i.firstChildKey=s,i.lastChildKey=r,i}},pa=class extends $e{};pa.type="header";var Bt=class extends $e{};Bt.type="loader";var Zl=class extends Xl{filter(t,e,l){if(l(this.textValue,this)){let s=this.clone();return e.addDescendants(s,t),s}return null}};Zl.type="item";var fa=class extends Xl{filter(t,e,l){let s=super.filter(t,e,l);if(s&&s.lastChildKey!==null){let r=t.getItem(s.lastChildKey);if(r&&r.type!=="header")return s}return null}};fa.type="section";var ga=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let t=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;t;)yield t,t=t.nextKey==null?void 0:this.keyMap.get(t.nextKey)}getChildren(t){let e=this.keyMap;return{*[Symbol.iterator](){let l=e.get(t),s=(l==null?void 0:l.firstChildKey)==null?null:e.get(l.firstChildKey);for(;s;)yield s,s=s.nextKey==null?void 0:e.get(s.nextKey)}}}getKeyBefore(t){let e=this.keyMap.get(t);if(!e)return null;if(e.prevKey!=null){for(e=this.keyMap.get(e.prevKey);e&&e.type!=="item"&&e.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}return e.parentKey}getKeyAfter(t){let e=this.keyMap.get(t);if(!e)return null;if(e.type!=="item"&&e.firstChildKey!=null)return e.firstChildKey;for(;e;){if(e.nextKey!=null)return e.nextKey;if(e.parentKey!=null)e=this.keyMap.get(e.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let t=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;(t==null?void 0:t.lastChildKey)!=null;)t=this.keyMap.get(t.lastChildKey);return(t==null?void 0:t.key)??null}getItem(t){return this.keyMap.get(t)??null}at(){throw Error("Not implemented")}clone(){let t=this.constructor,e=new t;return e.keyMap=new Map(this.keyMap),e.firstKey=this.firstKey,e.lastKey=this.lastKey,e.itemCount=this.itemCount,e}addNode(t){if(this.frozen)throw Error("Cannot add a node to a frozen collection");t.type==="item"&&this.keyMap.get(t.key)==null&&this.itemCount++,this.keyMap.set(t.key,t)}addDescendants(t,e){this.addNode(t);let l=e.getChildren(t.key);for(let s of l)this.addDescendants(s,e)}removeNode(t){if(this.frozen)throw Error("Cannot remove a node to a frozen collection");let e=this.keyMap.get(t);e!=null&&e.type==="item"&&this.itemCount--,this.keyMap.delete(t)}commit(t,e,l=!1){if(this.frozen)throw Error("Cannot commit a frozen collection");this.firstKey=t,this.lastKey=e,this.frozen=!l}filter(t){let e=new this.constructor,[l,s]=Ql(this,e,this.firstKey,t);return e==null||e.commit(l,s),e}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function Ql(t,e,l,s){if(l==null)return[null,null];let r=null,i=null,a=t.getItem(l);for(;a!=null;){let c=a.filter(t,e,s);c!=null&&(c.nextKey=null,i&&(c.prevKey=i.key,i.nextKey=c.key),r??(r=c),e.addNode(c),i=c),a=a.nextKey?t.getItem(a.nextKey):null}if(i&&i.type==="separator"){let c=i.prevKey;e.removeNode(i.key),c?(i=e.getItem(c),i.nextKey=null):i=null}return[(r==null?void 0:r.key)??null,(i==null?void 0:i.key)??null]}var Jl=class{*[Symbol.iterator](){let t=this.firstChild;for(;t;)yield t,t=t.nextSibling}get firstChild(){return this._firstChild}set firstChild(t){this._firstChild=t,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(t){this._lastChild=t,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(t){this._previousSibling=t,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(t){this._nextSibling=t,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(t){this._parentNode=t,this.ownerDocument.markDirty(this)}get isConnected(){var t;return((t=this.parentNode)==null?void 0:t.isConnected)||!1}invalidateChildIndices(t){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||t.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=t,this.ownerDocument.markDirty(this))}updateChildIndices(){let t=this._minInvalidChildIndex;for(;t;)t.index=t.previousSibling?t.previousSibling.index+1:0,t=t.nextSibling;this._minInvalidChildIndex=null}appendChild(t){t.parentNode&&t.parentNode.removeChild(t),this.firstChild??(this.firstChild=t),this.lastChild?(this.lastChild.nextSibling=t,t.index=this.lastChild.index+1,t.previousSibling=this.lastChild):(t.previousSibling=null,t.index=0),t.parentNode=this,t.nextSibling=null,this.lastChild=t,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(t,e){if(e==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t),t.nextSibling=e,t.previousSibling=e.previousSibling,t.index=e.index-1,this.firstChild===e?this.firstChild=t:e.previousSibling&&(e.previousSibling.nextSibling=t),e.previousSibling=t,t.parentNode=e.parentNode,this.invalidateChildIndices(t),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(t){t.parentNode===this&&(this._minInvalidChildIndex===t&&(this._minInvalidChildIndex=null),t.nextSibling&&(this.invalidateChildIndices(t.nextSibling),t.nextSibling.previousSibling=t.previousSibling),t.previousSibling&&(t.previousSibling.nextSibling=t.nextSibling),this.firstChild===t&&(this.firstChild=t.nextSibling),this.lastChild===t&&(this.lastChild=t.previousSibling),t.parentNode=null,t.nextSibling=null,t.previousSibling=null,t.index=0,this.ownerDocument.markDirty(t),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let t=this.previousSibling;for(;t&&t.isHidden;)t=t.previousSibling;return t}get nextVisibleSibling(){let t=this.nextSibling;for(;t&&t.isHidden;)t=t.nextSibling;return t}get firstVisibleChild(){let t=this.firstChild;for(;t&&t.isHidden;)t=t.nextSibling;return t}get lastVisibleChild(){let t=this.lastChild;for(;t&&t.isHidden;)t=t.previousSibling;return t}constructor(t){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=t}},zt=class Jt extends Jl{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){var e;return this.parentNode instanceof Jt?this.parentNode.level+(((e=this.node)==null?void 0:e.type)==="item"?1:0):0}getMutableNode(){return this.node==null?null:(this.isMutated||(this.isMutated=(this.node=this.node.clone(),!0)),this.ownerDocument.markDirty(this),this.node)}updateNode(){var s,r,i,a,c,o,d,h;let e=this.nextVisibleSibling,l=this.getMutableNode();if(l!=null&&(l.index=this.index,l.level=this.level,l.parentKey=this.parentNode instanceof Jt?((s=this.parentNode.node)==null?void 0:s.key)??null:null,l.prevKey=((i=(r=this.previousVisibleSibling)==null?void 0:r.node)==null?void 0:i.key)??null,l.nextKey=((a=e==null?void 0:e.node)==null?void 0:a.key)??null,l.hasChildNodes=!!this.firstChild,l.firstChildKey=((o=(c=this.firstVisibleChild)==null?void 0:c.node)==null?void 0:o.key)??null,l.lastChildKey=((h=(d=this.lastVisibleChild)==null?void 0:d.node)==null?void 0:h.key)??null,(l.colSpan!=null||l.colIndex!=null)&&e)){let u=(l.colIndex??l.index)+(l.colSpan??1);if(e.node!=null&&u!==e.node.colIndex){let f=e.getMutableNode();f.colIndex=u}}}setProps(e,l,s,r,i){let a,{value:c,textValue:o,id:d,...h}=e;if(this.node==null?(a=new s(d??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),h.ref=l,a.props=h,a.rendered=r,a.render=i,a.value=c,e["aria-label"]&&(a["aria-label"]=e["aria-label"]),a.textValue=o||(typeof h.children=="string"?h.children:"")||e["aria-label"]||"",d!=null&&d!==a.key)throw Error("Cannot change the id of an item");h.colSpan!=null&&(a.colSpan=h.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?"none":""},set display(l){var r,i;let s=l==="none";if(e.isHidden!==s){(((r=e.parentNode)==null?void 0:r.firstVisibleChild)===e||((i=e.parentNode)==null?void 0:i.lastVisibleChild)===e)&&e.ownerDocument.markDirty(e.parentNode);let a=e.previousVisibleSibling,c=e.nextVisibleSibling;a&&e.ownerDocument.markDirty(a),c&&e.ownerDocument.markDirty(c),e.isHidden=s,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,l){super(l),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},xa=class extends Jl{get isConnected(){return!0}createElement(t){return new zt(t,this)}getMutableCollection(){return this.nextCollection||(this.nextCollection=this.collection.clone()),this.nextCollection}markDirty(t){this.dirtyNodes.add(t)}addNode(t){if(t.isHidden||t.node==null)return;let e=this.getMutableCollection();if(!e.getItem(t.node.key))for(let l of t)this.addNode(l);e.addNode(t.node)}removeNode(t){for(let e of t)this.removeNode(e);t.node&&this.getMutableCollection().removeNode(t.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){var t,e,l,s;for(let r of this.dirtyNodes)r instanceof zt&&(!r.isConnected||r.isHidden)?this.removeNode(r):r.updateChildIndices();for(let r of this.dirtyNodes)r instanceof zt?(r.isConnected&&!r.isHidden&&(r.updateNode(),this.addNode(r)),r.node&&this.dirtyNodes.delete(r),r.isMutated=!1):this.dirtyNodes.delete(r);this.nextCollection&&(this.nextCollection.commit(((e=(t=this.firstVisibleChild)==null?void 0:t.node)==null?void 0:e.key)??null,((s=(l=this.lastVisibleChild)==null?void 0:l.node)==null?void 0:s.key)??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let t of this.subscriptions)t();this.inSubscription=!1}}subscribe(t){return this.subscriptions.add(t),()=>this.subscriptions.delete(t)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(t){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=t,this.nextCollection=t}};function Vt(t){let{children:e,items:l,idScope:s,addIdAndValue:r,dependencies:i=[]}=t,a=(0,m.useMemo)(()=>new WeakMap,i);return(0,m.useMemo)(()=>{if(l&&typeof e=="function"){let c=[];for(let o of l){let d=a.get(o);if(!d){d=e(o);let h=d.props.id??o.key??o.id;if(h==null)throw Error("Could not determine key for item");s!=null&&(h=s+":"+h),d=(0,m.cloneElement)(d,r?{key:h,id:h,value:o}:{key:h}),a.set(o,d)}c.push(d)}return c}else if(typeof e!="function")return e},[e,l,a,s,r])}var ya=tl(),va=_i(),en=(0,m.createContext)(!1),Ze=(0,m.createContext)(null);function tn(t){if((0,m.useContext)(Ze))return t.content;let{collection:e,document:l}=Ca(t.createCollection);return m.createElement(m.Fragment,null,m.createElement(Xr,null,m.createElement(Ze.Provider,{value:l},t.content)),m.createElement(ba,{render:t.children,collection:e}))}function ba({collection:t,render:e}){return e(t)}function ja(t,e,l){let s=Il(),r=(0,m.useRef)(s);return r.current=s,(0,va.useSyncExternalStore)(t,(0,m.useCallback)(()=>r.current?l():e(),[e,l]))}var ka=typeof m.useSyncExternalStore=="function"?m.useSyncExternalStore:ja;function Ca(t){let[e]=(0,m.useState)(()=>new xa((t==null?void 0:t())||new ga));return{collection:ka((0,m.useCallback)(l=>e.subscribe(l),[e]),(0,m.useCallback)(()=>{let l=e.getCollection();return e.isSSR&&e.resetAfterSSR(),l},[e]),(0,m.useCallback)(()=>(e.isSSR=!0,e.getCollection()),[e])),document:e}}var Lt=(0,m.createContext)(null);function Sa(t){var e;return e=class extends $e{},e.type=t,e}function ln(t,e,l,s,r,i){typeof t=="string"&&(t=Sa(t));let a=(0,m.useCallback)(o=>{o==null||o.setProps(e,l,t,s,i)},[e,l,s,i,t]),c=(0,m.useContext)(Lt);if(c){let o=c.ownerDocument.nodesByProps.get(e);return o||(o=c.ownerDocument.createElement(t.type),o.setProps(e,l,t,s,i),c.appendChild(o),c.ownerDocument.updateCollection(),c.ownerDocument.nodesByProps.set(e,o)),r?m.createElement(Lt.Provider,{value:o},r):null}return m.createElement(t.type,{ref:a},r)}function Ot(t,e){let l=({node:r})=>e(r.props,r.props.ref,r),s=(0,m.forwardRef)((r,i)=>{let a=(0,m.useContext)(fl);if(!(0,m.useContext)(en)){if(e.length>=3)throw Error(e.name+" cannot be rendered outside a collection.");return e(r,i)}return ln(t,r,i,"children"in r?r.children:null,null,c=>m.createElement(fl.Provider,{value:a},m.createElement(l,{node:c})))});return s.displayName=e.name,s}function Na(t,e,l=nn){let s=({node:i})=>e(i.props,i.props.ref,i),r=(0,m.forwardRef)((i,a)=>ln(t,i,a,null,l(i),c=>m.createElement(s,{node:c}))??m.createElement(m.Fragment,null));return r.displayName=e.name,r}function nn(t){return Vt({...t,addIdAndValue:!0})}var sn=(0,m.createContext)(null);function rn(t){let e=(0,m.useContext)(sn),l=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),s=t.idScope??(e==null?void 0:e.idScope),r=nn({...t,idScope:s,dependencies:l});return(0,m.useContext)(Ze)&&(r=m.createElement(wa,null,r)),e=(0,m.useMemo)(()=>({dependencies:l,idScope:s}),[s,...l]),m.createElement(sn.Provider,{value:e},r)}function wa({children:t}){let e=(0,m.useContext)(Ze),l=(0,m.useMemo)(()=>m.createElement(Ze.Provider,{value:null},m.createElement(en.Provider,{value:!0},t)),[t]);return Il()?m.createElement(Lt.Provider,{value:e},l):(0,ya.createPortal)(l,e)}var Ka=(0,m.createContext)(null),an={CollectionRoot({collection:t,renderDropIndicator:e}){return on(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:l}){return on(t,e,l)}};function on(t,e,l){return Vt({items:e?t.getChildren(e.key):t,dependencies:[l],children(s){let r=s.render(s);return!l||s.type!=="item"?r:m.createElement(m.Fragment,null,l({type:"item",key:s.key,dropPosition:"before"}),r,Ia(t,s,l))}})}function Ia(t,e,l){let s=e.key,r=t.getKeyAfter(s),i=r==null?null:t.getItem(r);for(;i!=null&&i.type!=="item";)r=t.getKeyAfter(i.key),i=r==null?null:t.getItem(r);let a=e.nextKey==null?null:t.getItem(e.nextKey);for(;a!=null&&a.type!=="item";)a=a.nextKey==null?null:t.getItem(a.nextKey);let c=[];if(a==null){let o=e;for(;(o==null?void 0:o.type)==="item"&&(!i||o.parentKey!==i.parentKey&&i.level<o.level);){let d=l({type:"item",key:o.key,dropPosition:"after"});(0,m.isValidElement)(d)&&c.push((0,m.cloneElement)(d,{key:`${o.key}-after`})),o=o.parentKey==null?null:t.getItem(o.parentKey)}}return c}var xt=(0,m.createContext)(an),Ht=new WeakMap;function Ut(t,e){let{id:l}=Ht.get(t)??{};if(!l)throw Error("Unknown list");return`${l}-${Da(e)}`}function Da(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}var cn={};cn={deselectedItem:t=>`${t.item} \u063A\u064A\u0631 \u0627\u0644\u0645\u062D\u062F\u062F`,longPressToSelect:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u064B\u0627 \u0644\u0644\u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0648\u0636\u0639 \u0627\u0644\u062A\u062D\u062F\u064A\u062F.",select:"\u062A\u062D\u062F\u064A\u062F",selectedAll:"\u062C\u0645\u064A\u0639 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u062D\u062F\u062F\u0629.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0644\u0645 \u064A\u062A\u0645 \u062A\u062D\u062F\u064A\u062F \u0639\u0646\u0627\u0635\u0631",one:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`,other:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`})}.`,selectedItem:t=>`${t.item} \u0627\u0644\u0645\u062D\u062F\u062F`};var dn={};dn={deselectedItem:t=>`${t.item} \u043D\u0435 \u0435 \u0438\u0437\u0431\u0440\u0430\u043D.`,longPressToSelect:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u0438 \u0437\u0430\u0434\u0440\u044A\u0436\u0442\u0435 \u0437\u0430 \u0434\u0430 \u0432\u043B\u0435\u0437\u0435\u0442\u0435 \u0432 \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043B\u0435\u043D \u0440\u0435\u0436\u0438\u043C.",select:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435",selectedAll:"\u0412\u0441\u0438\u0447\u043A\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0441\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u044F\u043C\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438",one:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D \u0435\u043B\u0435\u043C\u0435\u043D\u0442`,other:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438`})}.`,selectedItem:t=>`${t.item} \u0438\u0437\u0431\u0440\u0430\u043D.`};var un={};un={deselectedItem:t=>`Polo\u017Eka ${t.item} nen\xED vybr\xE1na.`,longPressToSelect:"Dlouh\xFDm stisknut\xEDm p\u0159ejdete do re\u017Eimu v\xFDb\u011Bru.",select:"Vybrat",selectedAll:"Vybr\xE1ny v\u0161echny polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nevybr\xE1ny \u017E\xE1dn\xE9 polo\u017Eky",one:()=>`Vybr\xE1na ${e.number(t.count)} polo\u017Eka`,other:()=>`Vybr\xE1no ${e.number(t.count)} polo\u017Eek`})}.`,selectedItem:t=>`Vybr\xE1na polo\u017Eka ${t.item}.`};var mn={};mn={deselectedItem:t=>`${t.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"V\xE6lg",selectedAll:"Alle elementer valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(t.count)} element valgt`,other:()=>`${e.number(t.count)} elementer valgt`})}.`,selectedItem:t=>`${t.item} valgt.`};var hn={};hn={deselectedItem:t=>`${t.item} nicht ausgew\xE4hlt.`,longPressToSelect:"Gedr\xFCckt halten, um Auswahlmodus zu \xF6ffnen.",select:"Ausw\xE4hlen",selectedAll:"Alle Elemente ausgew\xE4hlt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Keine Elemente ausgew\xE4hlt",one:()=>`${e.number(t.count)} Element ausgew\xE4hlt`,other:()=>`${e.number(t.count)} Elemente ausgew\xE4hlt`})}.`,selectedItem:t=>`${t.item} ausgew\xE4hlt.`};var pn={};pn={deselectedItem:t=>`\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`,longPressToSelect:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BC\u03C0\u03B5\u03AF\u03C4\u03B5 \u03C3\u03B5 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE\u03C2.",select:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE",selectedAll:"\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03CC\u03BB\u03B1 \u03C4\u03B1 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",one:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF`,other:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1`})}.`,selectedItem:t=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`};var fn={};fn={deselectedItem:t=>`${t.item} not selected.`,select:"Select",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"No items selected",one:()=>`${e.number(t.count)} item selected`,other:()=>`${e.number(t.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:t=>`${t.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var gn={};gn={deselectedItem:t=>`${t.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selecci\xF3n.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ning\xFAn elemento seleccionado",one:()=>`${e.number(t.count)} elemento seleccionado`,other:()=>`${e.number(t.count)} elementos seleccionados`})}.`,selectedItem:t=>`${t.item} seleccionado.`};var xn={};xn={deselectedItem:t=>`${t.item} pole valitud.`,longPressToSelect:"Valikure\u017Eiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"K\xF5ik \xFCksused valitud.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\xDCksusi pole valitud",one:()=>`${e.number(t.count)} \xFCksus valitud`,other:()=>`${e.number(t.count)} \xFCksust valitud`})}.`,selectedItem:t=>`${t.item} valitud.`};var yn={};yn={deselectedItem:t=>`Kohdetta ${t.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitk\xE4\xE4n.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ei yht\xE4\xE4n kohdetta valittu",one:()=>`${e.number(t.count)} kohde valittu`,other:()=>`${e.number(t.count)} kohdetta valittu`})}.`,selectedItem:t=>`${t.item} valittu.`};var vn={};vn={deselectedItem:t=>`${t.item} non s\xE9lectionn\xE9.`,longPressToSelect:"Appuyez de mani\xE8re prolong\xE9e pour passer en mode de s\xE9lection.",select:"S\xE9lectionner",selectedAll:"Tous les \xE9l\xE9ments s\xE9lectionn\xE9s.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Aucun \xE9l\xE9ment s\xE9lectionn\xE9",one:()=>`${e.number(t.count)} \xE9l\xE9ment s\xE9lectionn\xE9`,other:()=>`${e.number(t.count)} \xE9l\xE9ments s\xE9lectionn\xE9s`})}.`,selectedItem:t=>`${t.item} s\xE9lectionn\xE9.`};var bn={};bn={deselectedItem:t=>`${t.item} \u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8.`,longPressToSelect:"\u05D4\u05E7\u05E9\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DC\u05DB\u05E0\u05D9\u05E1\u05D4 \u05DC\u05DE\u05E6\u05D1 \u05D1\u05D7\u05D9\u05E8\u05D4.",select:"\u05D1\u05D7\u05E8",selectedAll:"\u05DB\u05DC \u05D4\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D5 \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",one:()=>`\u05E4\u05E8\u05D9\u05D8 ${e.number(t.count)} \u05E0\u05D1\u05D7\u05E8`,other:()=>`${e.number(t.count)} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5`})}.`,selectedItem:t=>`${t.item} \u05E0\u05D1\u05D7\u05E8.`};var jn={};jn={deselectedItem:t=>`Stavka ${t.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u na\u010Din odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(t.count)} stavka`,other:()=>`Odabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`Stavka ${t.item} je odabrana.`};var kn={};kn={deselectedItem:t=>`${t.item} nincs kijel\xF6lve.`,longPressToSelect:"Nyomja hosszan a kijel\xF6l\xE9shez.",select:"Kijel\xF6l\xE9s",selectedAll:"Az \xF6sszes elem kijel\xF6lve.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Egy elem sincs kijel\xF6lve",one:()=>`${e.number(t.count)} elem kijel\xF6lve`,other:()=>`${e.number(t.count)} elem kijel\xF6lve`})}.`,selectedItem:t=>`${t.item} kijel\xF6lve.`};var Cn={};Cn={deselectedItem:t=>`${t.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalit\xE0 di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(t.count)} elemento selezionato`,other:()=>`${e.number(t.count)} elementi selezionati`})}.`,selectedItem:t=>`${t.item} selezionato.`};var Sn={};Sn={deselectedItem:t=>`${t.item} \u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,longPressToSelect:"\u9577\u62BC\u3057\u3057\u3066\u9078\u629E\u30E2\u30FC\u30C9\u3092\u958B\u304D\u307E\u3059\u3002",select:"\u9078\u629E",selectedAll:"\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u9805\u76EE\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093",one:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`,other:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`})}\u3002`,selectedItem:t=>`${t.item} \u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002`};var Nn={};Nn={deselectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.`,longPressToSelect:"\uC120\uD0DD \uBAA8\uB4DC\uB85C \uB4E4\uC5B4\uAC00\uB824\uBA74 \uAE38\uAC8C \uB204\uB974\uC2ED\uC2DC\uC624.",select:"\uC120\uD0DD",selectedAll:"\uBAA8\uB4E0 \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\uC120\uD0DD\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",one:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`,other:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`})}.`,selectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`};var wn={};wn={deselectedItem:t=>`${t.item} nepasirinkta.`,longPressToSelect:"Nor\u0117dami \u012Fjungti pasirinkimo re\u017Eim\u0105, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nepasirinktas n\u0117 vienas elementas",one:()=>`Pasirinktas ${e.number(t.count)} elementas`,other:()=>`Pasirinkta element\u0173: ${e.number(t.count)}`})}.`,selectedItem:t=>`Pasirinkta: ${t.item}.`};var Kn={};Kn={deselectedItem:t=>`Vienums ${t.item} nav atlas\u012Bts.`,longPressToSelect:"Ilgi turiet nospiestu. lai iesl\u0113gtu atlases re\u017E\u012Bmu.",select:"Atlas\u012Bt",selectedAll:"Atlas\u012Bti visi vienumi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nav atlas\u012Bts neviens vienums",one:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`,other:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`})}.`,selectedItem:t=>`Atlas\u012Bts vienums ${t.item}.`};var In={};In={deselectedItem:t=>`${t.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for \xE5 g\xE5 inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(t.count)} element er valgt`,other:()=>`${e.number(t.count)} elementer er valgt`})}.`,selectedItem:t=>`${t.item} er valgt.`};var Dn={};Dn={deselectedItem:t=>`${t.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(t.count)} item geselecteerd`,other:()=>`${e.number(t.count)} items geselecteerd`})}.`,selectedItem:t=>`${t.item} geselecteerd.`};var _n={};_n={deselectedItem:t=>`Nie zaznaczono ${t.item}.`,longPressToSelect:"Naci\u015Bnij i przytrzymaj, aby wej\u015B\u0107 do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nie zaznaczono \u017Cadnych element\xF3w",one:()=>`${e.number(t.count)} zaznaczony element`,other:()=>`${e.number(t.count)} zaznaczonych element\xF3w`})}.`,selectedItem:t=>`Zaznaczono ${t.item}.`};var En={};En={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Pn={};Pn={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Mn={};Mn={deselectedItem:t=>`${t.item} neselectat.`,longPressToSelect:"Ap\u0103sa\u021Bi lung pentru a intra \xEEn modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Niciun element selectat",one:()=>`${e.number(t.count)} element selectat`,other:()=>`${e.number(t.count)} elemente selectate`})}.`,selectedItem:t=>`${t.item} selectat.`};var An={};An={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u044B\u0431\u043E\u0440\u0430.",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",selectedAll:"\u0412\u044B\u0431\u0440\u0430\u043D\u044B \u0432\u0441\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",one:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0440\u0430\u043D`,other:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043E`})}.`,selectedItem:t=>`${t.item} \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`};var Fn={};Fn={deselectedItem:t=>`Nevybrat\xE9 polo\u017Eky: ${t.item}.`,longPressToSelect:"Dlh\u0161\xEDm stla\u010Den\xEDm prejdite do re\u017Eimu v\xFDberu.",select:"Vybra\u0165",selectedAll:"V\u0161etky vybrat\xE9 polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u017Diadne vybrat\xE9 polo\u017Eky",one:()=>`${e.number(t.count)} vybrat\xE1 polo\u017Eka`,other:()=>`Po\u010Det vybrat\xFDch polo\u017Eiek:${e.number(t.count)}`})}.`,selectedItem:t=>`Vybrat\xE9 polo\u017Eky: ${t.item}.`};var Tn={};Tn={deselectedItem:t=>`Element ${t.item} ni izbran.`,longPressToSelect:"Za izbirni na\u010Din pritisnite in dlje \u010Dasa dr\u017Eite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(t.count)} element je izbran`,other:()=>`${e.number(t.count)} elementov je izbranih`})}.`,selectedItem:t=>`Element ${t.item} je izbran.`};var $n={};$n={deselectedItem:t=>`${t.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u re\u017Eim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(t.count)} stavka`,other:()=>`Izabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`${t.item} je izabrano.`};var Rn={};Rn={deselectedItem:t=>`${t.item} ej markerat.`,longPressToSelect:"Tryck l\xE4nge n\xE4r du vill \xF6ppna v\xE4ljarl\xE4ge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(t.count)} markerat objekt`,other:()=>`${e.number(t.count)} markerade objekt`})}.`,selectedItem:t=>`${t.item} markerat.`};var Bn={};Bn={deselectedItem:t=>`${t.item} se\xE7ilmedi.`,longPressToSelect:"Se\xE7im moduna girmek i\xE7in uzun bas\u0131n.",select:"Se\xE7",selectedAll:"T\xFCm \xF6geler se\xE7ildi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Hi\xE7bir \xF6ge se\xE7ilmedi",one:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`,other:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`})}.`,selectedItem:t=>`${t.item} se\xE7ildi.`};var zn={};zn={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u0412\u0438\u043A\u043E\u043D\u0430\u0439\u0442\u0435 \u0434\u043E\u0432\u0433\u0435 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u043D\u043D\u044F, \u0449\u043E\u0431 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u0438\u0431\u043E\u0440\u0443.",select:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",selectedAll:"\u0423\u0441\u0456 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0416\u043E\u0434\u043D\u0438\u0445 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",one:()=>`${e.number(t.count)} \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u0438\u0431\u0440\u0430\u043D\u043E`,other:()=>`\u0412\u0438\u0431\u0440\u0430\u043D\u043E \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432: ${e.number(t.count)}`})}.`,selectedItem:t=>`${t.item} \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`};var Vn={};Vn={deselectedItem:t=>`\u672A\u9009\u62E9 ${t.item}\u3002`,longPressToSelect:"\u957F\u6309\u4EE5\u8FDB\u5165\u9009\u62E9\u6A21\u5F0F\u3002",select:"\u9009\u62E9",selectedAll:"\u5DF2\u9009\u62E9\u6240\u6709\u9879\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9009\u62E9\u9879\u76EE",one:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`,other:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9009\u62E9 ${t.item}\u3002`};var Ln={};Ln={deselectedItem:t=>`\u672A\u9078\u53D6\u300C${t.item}\u300D\u3002`,longPressToSelect:"\u9577\u6309\u4EE5\u9032\u5165\u9078\u64C7\u6A21\u5F0F\u3002",select:"\u9078\u53D6",selectedAll:"\u5DF2\u9078\u53D6\u6240\u6709\u9805\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9078\u53D6\u4EFB\u4F55\u9805\u76EE",one:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`,other:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9078\u53D6\u300C${t.item}\u300D\u3002`};var yt={};yt={"ar-AE":cn,"bg-BG":dn,"cs-CZ":un,"da-DK":mn,"de-DE":hn,"el-GR":pn,"en-US":fn,"es-ES":gn,"et-EE":xn,"fi-FI":yn,"fr-FR":vn,"he-IL":bn,"hr-HR":jn,"hu-HU":kn,"it-IT":Cn,"ja-JP":Sn,"ko-KR":Nn,"lt-LT":wn,"lv-LV":Kn,"nb-NO":In,"nl-NL":Dn,"pl-PL":_n,"pt-BR":En,"pt-PT":Pn,"ro-RO":Mn,"ru-RU":An,"sk-SK":Fn,"sl-SI":Tn,"sr-SP":$n,"sv-SE":Rn,"tr-TR":Bn,"uk-UA":zn,"zh-CN":Vn,"zh-TW":Ln};function _a(t){return t&&t.__esModule?t.default:t}function Ea(t,e){let{getRowText:l=c=>{var d,h;var o;return((d=(o=e.collection).getTextValue)==null?void 0:d.call(o,c))??((h=e.collection.getItem(c))==null?void 0:h.textValue)}}=t,s=it(_a(yt),"@react-aria/grid"),r=e.selectionManager.rawSelection,i=(0,m.useRef)(r),a=(0,m.useCallback)(()=>{var u;if(!e.selectionManager.isFocused||r===i.current){i.current=r;return}let c=On(r,i.current),o=On(i.current,r),d=e.selectionManager.selectionBehavior==="replace",h=[];if(e.selectionManager.selectedKeys.size===1&&d){let f=e.selectionManager.selectedKeys.keys().next().value;if(f!=null&&e.collection.getItem(f)){let p=l(f);p&&h.push(s.format("selectedItem",{item:p}))}}else if(c.size===1&&o.size===0){let f=c.keys().next().value;if(f!=null){let p=l(f);p&&h.push(s.format("selectedItem",{item:p}))}}else if(o.size===1&&c.size===0){let f=o.keys().next().value;if(f!=null&&e.collection.getItem(f)){let p=l(f);p&&h.push(s.format("deselectedItem",{item:p}))}}e.selectionManager.selectionMode==="multiple"&&(h.length===0||r==="all"||r.size>1||i.current==="all"||((u=i.current)==null?void 0:u.size)>1)&&h.push(r==="all"?s.format("selectedAll"):s.format("selectedCount",{count:r.size})),h.length>0&&Gr(h.join(" ")),i.current=r},[r,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,l,s]);vi(()=>{if(e.selectionManager.isFocused)a();else{let c=requestAnimationFrame(a);return()=>cancelAnimationFrame(c)}},[r,e.selectionManager.isFocused])}function On(t,e){let l=new Set;if(t==="all"||e==="all")return l;for(let s of t.keys())e.has(s)||l.add(s);return l}function Pa(t){return t&&t.__esModule?t.default:t}function Ma(t){let e=it(Pa(yt),"@react-aria/grid"),l=Zr(),s=(l==="pointer"||l==="virtual"||l==null)&&typeof window<"u"&&"ontouchstart"in window;return kl((0,m.useMemo)(()=>{let r=t.selectionManager.selectionMode,i=t.selectionManager.selectionBehavior,a;return s&&(a=e.format("longPressToSelect")),i==="replace"&&r!=="none"&&t.hasItemActions?a:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,s]))}function Aa(t){return t&&t.__esModule?t.default:t}function Fa(t,e){let{key:l}=t,s=e.selectionManager,r=Ye(),i=!e.selectionManager.canSelectItem(l),a=e.selectionManager.isSelected(l),c=()=>s.toggleSelection(l),o=it(Aa(yt),"@react-aria/grid");return{checkboxProps:{id:r,"aria-label":o.format("select"),isSelected:a,isDisabled:i,onChange:c}}}function Ta(t,e,l){let{isVirtualized:s,keyboardDelegate:r,layoutDelegate:i,onAction:a,disallowTypeAhead:c,linkBehavior:o="action",keyboardNavigationBehavior:d="arrow",escapeKeyBehavior:h="clearSelection",shouldSelectOnPressUp:u}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:f}=Ul({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:l,keyboardDelegate:r,layoutDelegate:i,isVirtualized:s,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:o,disallowTypeAhead:c,autoFocus:t.autoFocus,escapeKeyBehavior:h}),p=Ye(t.id);Ht.set(e,{id:p,onAction:a,linkBehavior:o,keyboardNavigationBehavior:d,shouldSelectOnPressUp:u});let x=Ma({selectionManager:e.selectionManager,hasItemActions:!!a}),j=ea(l,{isDisabled:e.collection.size!==0}),k=ke(at(t,{labelable:!0}),{role:"grid",id:p,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:j?-1:0}:f,x);return s&&(k["aria-rowcount"]=e.collection.size,k["aria-colcount"]=1),Ea({},e),{gridProps:k}}var Hn={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function $a(t,e,l){var P,z,V,T;let{node:s,isVirtualized:r}=t,{direction:i}=mt(),{onAction:a,linkBehavior:c,keyboardNavigationBehavior:o,shouldSelectOnPressUp:d}=Ht.get(e),h=ki(),u=(0,m.useRef)(null),f=()=>{var w;l.current!==null&&(u.current!=null&&s.key!==u.current||!((w=l.current)!=null&&w.contains(document.activeElement)))&&Se(l.current)},p={},x=t.hasChildItems,j=e.selectionManager.isLink(s.key);if(s!=null&&"expandedKeys"in e){var k;let w=(P=(k=e.collection).getChildren)==null?void 0:P.call(k,s.key);x||(x=[...w??[]].length>1),a==null&&!j&&e.selectionManager.selectionMode==="none"&&x&&(a=()=>e.toggleKey(s.key));let y=x?e.expandedKeys.has(s.key):void 0,M=1;if(s.level>0&&(s==null?void 0:s.parentKey)!=null){let R=e.collection.getItem(s.parentKey);if(R){var S;M=[...(z=(S=e.collection).getChildren)==null?void 0:z.call(S,R.key)].filter(B=>B.type==="item").length}}else M=[...e.collection].filter(R=>R.level===0&&R.type==="item").length;p={"aria-expanded":y,"aria-level":s.level+1,"aria-posinset":(s==null?void 0:s.index)+1,"aria-setsize":M}}let{itemProps:I,...v}=Vl({selectionManager:e.selectionManager,key:s.key,ref:l,isVirtualized:r,shouldSelectOnPressUp:t.shouldSelectOnPressUp||d,onAction:a||(V=s.props)!=null&&V.onAction?Cl((T=s.props)==null?void 0:T.onAction,a?()=>a(s.key):void 0):void 0,focus:f,linkBehavior:c}),N=w=>{if(!w.currentTarget.contains(w.target)||!l.current||!document.activeElement)return;let y=dt(l.current);if(y.currentNode=document.activeElement,"expandedKeys"in e&&document.activeElement===l.current){if(w.key===Hn.expand[i]&&e.selectionManager.focusedKey===s.key&&x&&!e.expandedKeys.has(s.key)){e.toggleKey(s.key),w.stopPropagation();return}else if(w.key===Hn.collapse[i]&&e.selectionManager.focusedKey===s.key&&x&&e.expandedKeys.has(s.key)){e.toggleKey(s.key),w.stopPropagation();return}}switch(w.key){case"ArrowLeft":if(o==="arrow"){let R=i==="rtl"?y.nextNode():y.previousNode();if(R)w.preventDefault(),w.stopPropagation(),Se(R),Ee(R,{containingElement:Fe(l.current)});else if(w.preventDefault(),w.stopPropagation(),i==="rtl")Se(l.current),Ee(l.current,{containingElement:Fe(l.current)});else{y.currentNode=l.current;let B=Un(y);B&&(Se(B),Ee(B,{containingElement:Fe(l.current)}))}}break;case"ArrowRight":if(o==="arrow"){let R=i==="rtl"?y.previousNode():y.nextNode();if(R)w.preventDefault(),w.stopPropagation(),Se(R),Ee(R,{containingElement:Fe(l.current)});else if(w.preventDefault(),w.stopPropagation(),i==="ltr")Se(l.current),Ee(l.current,{containingElement:Fe(l.current)});else{y.currentNode=l.current;let B=Un(y);B&&(Se(B),Ee(B,{containingElement:Fe(l.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!w.altKey&&l.current.contains(w.target)){var M;w.stopPropagation(),w.preventDefault(),(M=l.current.parentElement)==null||M.dispatchEvent(new KeyboardEvent(w.nativeEvent.type,w.nativeEvent))}break}},A=w=>{if(u.current=s.key,w.target!==l.current){Wr()||e.selectionManager.setFocusedKey(s.key);return}},b=w=>{if(!(!w.currentTarget.contains(w.target)||!l.current||!document.activeElement))switch(w.key){case"Tab":if(o==="tab"){let y=dt(l.current,{tabbable:!0});y.currentNode=document.activeElement,(w.shiftKey?y.previousNode():y.nextNode())&&w.stopPropagation()}}},$=Ki(s.props),E=ke(I,v.hasAction?$:{},{role:"row",onKeyDownCapture:N,onKeyDown:b,onFocus:A,"aria-label":s["aria-label"]||s.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(s.key)?e.selectionManager.isSelected(s.key):void 0,"aria-disabled":e.selectionManager.isDisabled(s.key)||void 0,"aria-labelledby":h&&(s["aria-label"]||s.textValue)?`${Ut(e,s.key)} ${h}`:void 0,id:Ut(e,s.key)});if(r){let{collection:w}=e;E["aria-rowindex"]=[...w].find(y=>y.type==="section")?[...w.getKeys()].filter(y=>{var M;return((M=w.getItem(y))==null?void 0:M.type)!=="section"}).findIndex(y=>y===s.key)+1:s.index+1}let K={role:"gridcell","aria-colindex":1};return{rowProps:{...ke(E,p)},gridCellProps:K,descriptionProps:{id:h},...v}}function Un(t){let e=null,l=null;do l=t.lastChild(),l&&(e=l);while(l);return e}function Ra(t,e){let{key:l}=t,{checkboxProps:s}=Fa(t,e);return{checkboxProps:{...s,"aria-labelledby":`${s.id} ${Ut(e,l)}`}}}function Ba(t,e,l){let{gridProps:s}=Ta(t,e,l);return s.role="treegrid",{gridProps:s}}var qn={};qn={collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"};var Wn={};Wn={collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"};var Gn={};Gn={collapse:"Sbalit",expand:"Rozt\xE1hnout"};var Yn={};Yn={collapse:"Skjul",expand:"Udvid"};var Xn={};Xn={collapse:"Reduzieren",expand:"Erweitern"};var Zn={};Zn={collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"};var Qn={};Qn={expand:"Expand",collapse:"Collapse"};var Jn={};Jn={collapse:"Contraer",expand:"Ampliar"};var es={};es={collapse:"Ahenda",expand:"Laienda"};var ts={};ts={collapse:"Pienenn\xE4",expand:"Laajenna"};var ls={};ls={collapse:"R\xE9duire",expand:"D\xE9velopper"};var ns={};ns={collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"};var ss={};ss={collapse:"Sa\u017Emi",expand:"Pro\u0161iri"};var rs={};rs={collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"};var is={};is={collapse:"Comprimi",expand:"Espandi"};var as={};as={collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"};var os={};os={collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"};var cs={};cs={collapse:"Sutraukti",expand:"I\u0161skleisti"};var ds={};ds={collapse:"Sak\u013Caut",expand:"Izv\u0113rst"};var us={};us={collapse:"Skjul",expand:"Utvid"};var ms={};ms={collapse:"Samenvouwen",expand:"Uitvouwen"};var hs={};hs={collapse:"Zwi\u0144",expand:"Rozwi\u0144"};var ps={};ps={collapse:"Recolher",expand:"Expandir"};var fs={};fs={collapse:"Colapsar",expand:"Expandir"};var gs={};gs={collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"};var xs={};xs={collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"};var ys={};ys={collapse:"Zbali\u0165",expand:"Rozbali\u0165"};var vs={};vs={collapse:"Strni",expand:"Raz\u0161iri"};var bs={};bs={collapse:" Skupi",expand:"Pro\u0161iri"};var js={};js={collapse:"D\xF6lj",expand:"Expandera"};var ks={};ks={collapse:"Daralt",expand:"Geni\u015Flet"};var Cs={};Cs={collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"};var Ss={};Ss={collapse:"\u6298\u53E0",expand:"\u6269\u5C55"};var Ns={};Ns={collapse:"\u6536\u5408",expand:"\u5C55\u958B"};var ws={};ws={"ar-AE":qn,"bg-BG":Wn,"cs-CZ":Gn,"da-DK":Yn,"de-DE":Xn,"el-GR":Zn,"en-US":Qn,"es-ES":Jn,"et-EE":es,"fi-FI":ts,"fr-FR":ls,"he-IL":ns,"hr-HR":ss,"hu-HU":rs,"it-IT":is,"ja-JP":as,"ko-KR":os,"lt-LT":cs,"lv-LV":ds,"nb-NO":us,"nl-NL":ms,"pl-PL":hs,"pt-BR":ps,"pt-PT":fs,"ro-RO":gs,"ru-RU":xs,"sk-SK":ys,"sl-SI":vs,"sr-SP":bs,"sv-SE":js,"tr-TR":ks,"uk-UA":Cs,"zh-CN":Ss,"zh-TW":Ns};function za(t){return t&&t.__esModule?t.default:t}function Ks(t,e,l){let{node:s}=t,r=$a(t,e,l),i=r.rowProps["aria-expanded"]===!0,a=it(za(ws),"@react-aria/tree"),c=ei({"aria-label":i?a.format("collapse"):a.format("expand"),"aria-labelledby":r.rowProps.id}),o={onPress:()=>{r.isDisabled||(e.toggleKey(s.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(s.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...c};return{...r,expandButtonProps:o}}var Ie=class cr extends Set{constructor(e,l,s){super(e),e instanceof cr?(this.anchorKey=l??e.anchorKey,this.currentKey=s??e.currentKey):(this.anchorKey=l??null,this.currentKey=s??null)}};function Va(t,e){if(t.size!==e.size)return!1;for(let l of t)if(!e.has(l))return!1;return!0}function Is(t){let{selectionMode:e="none",disallowEmptySelection:l=!1,allowDuplicateSelectionEvents:s,selectionBehavior:r="toggle",disabledBehavior:i="all"}=t,a=(0,m.useRef)(!1),[,c]=(0,m.useState)(!1),o=(0,m.useRef)(null),d=(0,m.useRef)(null),[,h]=(0,m.useState)(null),[u,f]=It((0,m.useMemo)(()=>Ds(t.selectedKeys),[t.selectedKeys]),(0,m.useMemo)(()=>Ds(t.defaultSelectedKeys,new Ie),[t.defaultSelectedKeys]),t.onSelectionChange),p=(0,m.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[x,j]=(0,m.useState)(r);r==="replace"&&x==="toggle"&&typeof u=="object"&&u.size===0&&j("replace");let k=(0,m.useRef)(r);return(0,m.useEffect)(()=>{r!==k.current&&(j(r),k.current=r)},[r]),{selectionMode:e,disallowEmptySelection:l,selectionBehavior:x,setSelectionBehavior:j,get isFocused(){return a.current},setFocused(S){a.current=S,c(S)},get focusedKey(){return o.current},get childFocusStrategy(){return d.current},setFocusedKey(S,I="first"){o.current=S,d.current=I,h(S)},selectedKeys:u,setSelectedKeys(S){(s||!Va(S,u))&&f(S)},disabledKeys:p,disabledBehavior:i}}function Ds(t,e){return t?t==="all"?"all":new Ie(t):e}var _s=class dr{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,l){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,l)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let l=this.getKey(e);return l==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(l):this.state.selectedKeys.has(l)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),l=this.state.selectedKeys;return this._isSelectAll=e.every(s=>l.has(s)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let l of this.state.selectedKeys){let s=this.collection.getItem(l);(!e||s&&Rt(this.collection,s,e)<0)&&(e=s)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let l of this.state.selectedKeys){let s=this.collection.getItem(l);(!e||s&&Rt(this.collection,s,e)>0)&&(e=s)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let l=this.getKey(e);if(l==null)return;let s;if(this.state.selectedKeys==="all")s=new Ie([l],l,l);else{let r=this.state.selectedKeys,i=r.anchorKey??l;s=new Ie(r,i,l);for(let a of this.getKeyRange(i,r.currentKey??l))s.delete(a);for(let a of this.getKeyRange(l,i))this.canSelectItem(a)&&s.add(a)}this.state.setSelectedKeys(s)}getKeyRange(e,l){let s=this.collection.getItem(e),r=this.collection.getItem(l);return s&&r?Rt(this.collection,s,r)<=0?this.getKeyRangeInternal(e,l):this.getKeyRangeInternal(l,e):[]}getKeyRangeInternal(e,l){var i;if((i=this.layoutDelegate)!=null&&i.getKeyRange)return this.layoutDelegate.getKeyRange(e,l);let s=[],r=e;for(;r!=null;){let a=this.collection.getItem(r);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&s.push(r),r===l)return s;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let l=this.collection.getItem(e);if(!l||l.type==="cell"&&this.allowsCellSelection)return e;for(;l&&l.type!=="item"&&l.parentKey!=null;)l=this.collection.getItem(l.parentKey);return!l||l.type!=="item"?null:l.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let l=this.getKey(e);if(l==null)return;let s=new Ie(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);s.has(l)?s.delete(l):this.canSelectItem(l)&&(s.add(l),s.anchorKey=l,s.currentKey=l),!(this.disallowEmptySelection&&s.size===0)&&this.state.setSelectedKeys(s)}replaceSelection(e){if(this.selectionMode==="none")return;let l=this.getKey(e);if(l==null)return;let s=this.canSelectItem(l)?new Ie([l],l,l):new Ie;this.state.setSelectedKeys(s)}setSelectedKeys(e){if(this.selectionMode==="none")return;let l=new Ie;for(let s of e){let r=this.getKey(s);if(r!=null&&(l.add(r),this.selectionMode==="single"))break}this.state.setSelectedKeys(l)}getSelectAllKeys(){let e=[],l=s=>{var r;for(;s!=null;){if(this.canSelectItem(s)){let i=this.collection.getItem(s);(i==null?void 0:i.type)==="item"&&e.push(s),i!=null&&i.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&l(((r=ma(Gl(i,this.collection)))==null?void 0:r.key)??null)}s=this.collection.getKeyAfter(s)}};return l(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Ie)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,l){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||l&&(l.pointerType==="touch"||l.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let l=this.selectedKeys;if(e.size!==l.size)return!1;for(let s of e)if(!l.has(s))return!1;for(let s of l)if(!e.has(s))return!1;return!0}canSelectItem(e){var s;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let l=this.collection.getItem(e);return!(!l||l!=null&&((s=l.props)!=null&&s.isDisabled)||l.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var s;var l;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((l=this.collection.getItem(e))!=null&&((s=l.props)!=null&&s.isDisabled)))}isLink(e){var s;var l;return!!((l=this.collection.getItem(e))!=null&&((s=l.props)!=null&&s.href))}getItemProps(e){var l;return(l=this.collection.getItem(e))==null?void 0:l.props}withCollection(e){return new dr(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,l,s){this.collection=e,this.state=l,this.allowsCellSelection=(s==null?void 0:s.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(s==null?void 0:s.layoutDelegate)||null}},La=class{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let e=this.keyMap.get(t);return e?e.prevKey??null:null}getKeyAfter(t){let e=this.keyMap.get(t);return e?e.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){let e=[...this.getKeys()];return this.getItem(e[t])}constructor(t,{expandedKeys:e}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t,e||(e=new Set);let l=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&(i.type==="section"||e.has(i.key)))for(let a of i.childNodes)l(a)};for(let i of t)l(i);let s=null,r=0;for(let[i,a]of this.keyMap)s?(s.nextKey=i,a.prevKey=s.key):(this.firstKey=i,a.prevKey=void 0),a.type==="item"&&(a.index=r++),s=a,s.nextKey=void 0;this.lastKey=(s==null?void 0:s.key)??null}};function Oa(t){let{onExpandedChange:e}=t,[l,s]=It(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),r=Is(t),i=(0,m.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),a=Wl(t,(0,m.useCallback)(c=>new La(c,{expandedKeys:l}),[l]),null);return(0,m.useEffect)(()=>{r.focusedKey!=null&&!a.getItem(r.focusedKey)&&r.setFocusedKey(null)},[a,r.focusedKey]),{collection:a,expandedKeys:l,disabledKeys:i,toggleKey:c=>{s(Ha(l,c))},setExpandedKeys:s,selectionManager:new _s(a,r)}}function Ha(t,e){let l=new Set(t);return l.has(e)?l.delete(e):l.add(e),l}var Qe=(0,m.createContext)({}),qt=(0,m.createContext)(null),Ua=(0,m.forwardRef)(function(t,e){let{render:l}=(0,m.useContext)(qt);return m.createElement(m.Fragment,null,l(t,e))});function Es(t,e){var i;let l=t==null?void 0:t.renderDropIndicator,s=(i=t==null?void 0:t.isVirtualDragging)==null?void 0:i.call(t),r=(0,m.useCallback)(a=>{if(s||e!=null&&e.isDropTarget(a))return l?l(a):m.createElement(Ua,{target:a})},[e==null?void 0:e.target,s,l]);return t!=null&&t.useDropIndicator?r:void 0}function Ps(t,e,l){var i,a,c;let s=t.focusedKey,r=null;if(e!=null&&((i=e.isVirtualDragging)!=null&&i.call(e))&&((a=l==null?void 0:l.target)==null?void 0:a.type)==="item"&&(r=l.target.key,l.target.dropPosition==="after")){let o=l.collection.getKeyAfter(r),d=null;if(o!=null){let h=((c=l.collection.getItem(r))==null?void 0:c.level)??0;for(;o;){let u=l.collection.getItem(o);if(!u)break;if(u.type!=="item"){o=l.collection.getKeyAfter(o);continue}if((u.level??0)<=h)break;d=o,o=l.collection.getKeyAfter(o)}}r=o??d??r}return(0,m.useMemo)(()=>new Set([s,r].filter(o=>o!=null)),[s,r])}var Ms=10,As=5,qa=class{setup(t,e,l){this.delegate=t,this.state=e,this.direction=l}getDropTargetFromPoint(t,e,l){let s=this.delegate.getDropTargetFromPoint(t,e,l);return!s||s.type==="root"?s:this.resolveDropTarget(s,t,e,l)}resolveDropTarget(t,e,l,s){let r=this.pointerTracking,i=l-r.lastY,a=e-r.lastX,c=r.yDirection,o=r.xDirection;if(Math.abs(i)>As&&(c=i>0?"down":"up",r.yDirection=c,r.lastY=l),Math.abs(a)>Ms&&(o=a>0?"right":"left",r.xDirection=o,r.lastX=e),t.dropPosition==="before"){let u=this.state.collection.getKeyBefore(t.key);if(u!=null){let f={type:"item",key:u,dropPosition:"after"};s(f)&&(t=f)}}let d=this.getPotentialTargets(t,s);if(d.length===0)return{type:"root"};let h;return d.length>1?h=this.selectTarget(d,t,e,l,c,o):(h=d[0],r.boundaryContext=null),h}getPotentialTargets(t,e){if(t.dropPosition==="on")return[t];let l=t,s=this.state.collection,r=s.getItem(l.key);for(;r&&(r==null?void 0:r.type)!=="item"&&r.nextKey!=null;)l.key=r.nextKey,r=s.getItem(r.nextKey);let i=[l];if(r&&r.hasChildNodes&&this.state.expandedKeys.has(r.key)&&s.getChildren&&l.dropPosition==="after"){let o=null;for(let d of s.getChildren(r.key))if(d.type==="item"){o=d;break}if(o){let d={type:"item",key:o.key,dropPosition:"before"};return e(d)?[d]:[]}}if((r==null?void 0:r.nextKey)!=null)return[t];let a=r==null?void 0:r.parentKey,c=[];for(;a;){let o=s.getItem(a),d=o!=null&&o.nextKey?s.getItem(o.nextKey):null;if(!d||d.parentKey!==a){let h={type:"item",key:a,dropPosition:"after"};if(e(h)&&c.push(h),d)break}a=o==null?void 0:o.parentKey}if(c.length>0&&i.push(...c),i.length===1){let o=s.getKeyAfter(l.key),d=o?s.getItem(o):null;if(o!=null&&d&&r&&d.level!=null&&r.level!=null&&d.level>r.level){let h={type:"item",key:o,dropPosition:"before"};if(e(h))return[h]}}return i.filter(e)}selectTarget(t,e,l,s,r,i){var h;if(t.length<2)return t[0];let a=this.pointerTracking,c=(h=this.state.collection.getItem(e.key))==null?void 0:h.parentKey;if(!c)return t[0];(!a.boundaryContext||a.boundaryContext.parentKey!==c)&&(a.boundaryContext={parentKey:c,preferredTargetIndex:a.yDirection==="up"?t.length-1:0,lastSwitchY:s,lastSwitchX:l});let o=a.boundaryContext,d=Math.abs(l-o.lastSwitchX);if(Math.abs(s-o.lastSwitchY)>As&&r){let u=o.preferredTargetIndex||0;r==="down"&&u===0?o.preferredTargetIndex=t.length-1:r==="up"&&u===t.length-1&&(o.preferredTargetIndex=0),a.xDirection=null}if(d>Ms&&i){let u=o.preferredTargetIndex||0;i==="left"?this.direction==="ltr"?u<t.length-1&&(o.preferredTargetIndex=u+1,o.lastSwitchX=l):u>0&&(o.preferredTargetIndex=u-1,o.lastSwitchX=l):i==="right"&&(this.direction==="ltr"?u>0&&(o.preferredTargetIndex=u-1,o.lastSwitchX=l):u<t.length-1&&(o.preferredTargetIndex=u+1,o.lastSwitchX=l)),a.yDirection=null}return t[Math.max(0,Math.min(o.preferredTargetIndex||0,t.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction="ltr",this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},Wa=class{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(t){return this.keyMap.get(t)||null}at(t){return this.flattenedRows[t]}getFirstKey(){var t;return(t=this.flattenedRows[0])==null?void 0:t.key}getLastKey(){var t;return(t=this.flattenedRows[this.flattenedRows.length-1])==null?void 0:t.key}getKeyAfter(t){var l;let e=this.flattenedRows.findIndex(s=>s.key===t);return(l=this.flattenedRows[e+1])==null?void 0:l.key}getKeyBefore(t){var l;let e=this.flattenedRows.findIndex(s=>s.key===t);return(l=this.flattenedRows[e-1])==null?void 0:l.key}getChildren(t){let e=this.keyMap;return{*[Symbol.iterator](){let l=e.get(t),s=(l==null?void 0:l.firstChildKey)==null?null:e.get(l.firstChildKey);for(;s;)yield s,s=s.nextKey==null?void 0:e.get(s.nextKey)}}}getTextValue(t){let e=this.getItem(t);return e?e.textValue:""}constructor(t){this.keyMap=new Map,this.itemCount=0;let{collection:e,expandedKeys:l}=t,{flattenedRows:s,keyMap:r,itemCount:i}=Za(e,{expandedKeys:l});this.flattenedRows=s,this.keyMap=r,this.itemCount=i}},Ga=(0,m.createContext)(null),Wt=(0,m.createContext)(null),Ya=(0,m.forwardRef)(function(t,e){return[t,e]=Qr(t,e,Ga),m.createElement(tn,{content:m.createElement(rn,t)},l=>m.createElement(Xa,{props:t,collection:l,treeRef:e}))}),Fs={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Xa({props:t,collection:e,treeRef:l}){let{dragAndDropHooks:s}=t,{direction:r}=mt(),i=jl({usage:"search",sensitivity:"base"}),a=!!(s!=null&&s.useDraggableCollectionState),c=!!(s!=null&&s.useDroppableCollectionState),o=(0,m.useRef)(a),d=(0,m.useRef)(c);(0,m.useEffect)(()=>{o.current!==a&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),d.current!==c&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.")},[a,c]);let{selectionMode:h="none",expandedKeys:u,defaultExpandedKeys:f,onExpandedChange:p,disabledBehavior:x="all"}=t,{CollectionRoot:j,isVirtualized:k,layoutDelegate:S,dropTargetDelegate:I}=(0,m.useContext)(xt),[v,N]=It(u?Vs(u):void 0,f?Vs(f):new Set,p),A=(0,m.useMemo)(()=>new Wa({collection:e,expandedKeys:v}),[e,v]),b=Oa({...t,selectionMode:h,expandedKeys:v,onExpandedChange:N,collection:A,children:void 0,disabledBehavior:x}),{gridProps:$}=Ba({...t,isVirtualized:k,layoutDelegate:S},b,l),E,K,P,z=!1,V=null,T=(0,m.useRef)(null);if(a&&s){E=s.useDraggableCollectionState({collection:b.collection,selectionManager:b.selectionManager,preview:s.renderDragPreview?T:void 0}),s.useDraggableCollection({},E,l);let ee=s.DragPreview;V=s.renderDragPreview?m.createElement(ee,{ref:T},s.renderDragPreview):null}let[w]=(0,m.useState)(()=>new qa);if(c&&s){K=s.useDroppableCollectionState({collection:b.collection,selectionManager:b.selectionManager});let ee=s.dropTargetDelegate||I||new s.ListDropTargetDelegate(b.collection,l,{direction:r});w.setup(ee,b,r);let D=new Tt({collection:b.collection,collator:i,ref:l,disabledKeys:b.selectionManager.disabledKeys,disabledBehavior:b.selectionManager.disabledBehavior,direction:r,layoutDelegate:S});P=s.useDroppableCollection({keyboardDelegate:D,dropTargetDelegate:w,onDropActivate:_=>{var J;if(_.target.type==="item"){let te=_.target.key,le=b.collection.getItem(te),F=v!=="all"&&v.has(te);le&&le.hasChildNodes&&(!F||s!=null&&((J=s.isVirtualDragging)!=null&&J.call(s)))&&b.toggleKey(te)}},onKeyDown:_=>{let J=K==null?void 0:K.target;if(J&&J.type==="item"&&J.dropPosition==="on"){let te=b.collection.getItem(J.key);(_.key===Fs.expand[r]&&(te!=null&&te.hasChildNodes)&&!b.expandedKeys.has(J.key)||_.key===Fs.collapse[r]&&(te!=null&&te.hasChildNodes)&&b.expandedKeys.has(J.key))&&b.toggleKey(J.key)}}},K,l);let g=K.getDropOperation;K.getDropOperation=_=>{var F;let{target:J,isInternal:te}=_,le=(E==null?void 0:E.draggingKeys)??new Set;if(te&&J.type==="item"&&le.size>0){if(le.has(J.key)&&J.dropPosition==="on")return"cancel";let ne=J.key;for(;ne!=null;){let se=(F=b.collection.getItem(ne))==null?void 0:F.parentKey;if(se!=null&&le.has(se))return"cancel";ne=se??null}}return g(_)},z=K.isDropTarget({type:"root"})}let y=!!(a&&!(E!=null&&E.isDisabled)),{focusProps:M,isFocused:R,isFocusVisible:B}=Kt(),Y={isEmpty:b.collection.size===0,isFocused:R,isFocusVisible:B,isDropTarget:z,selectionMode:b.selectionManager.selectionMode,allowsDragging:!!y,state:b},C=We({className:t.className,style:t.style,defaultClassName:"react-aria-Tree",values:Y}),Z=null;if(b.collection.size===0&&t.renderEmptyState){let{isEmpty:ee,...D}=Y,g=t.renderEmptyState({...D});Z=m.createElement("div",{role:"row",style:{display:"contents"},"aria-level":1},m.createElement("div",{role:"gridcell",style:{display:"contents"}},g))}let Q=at(t,{global:!0});return m.createElement(m.Fragment,null,m.createElement(bi,null,m.createElement("div",{...ke(Q,C,$,M,P==null?void 0:P.collectionProps),ref:l,slot:t.slot||void 0,"data-empty":b.collection.size===0||void 0,"data-focused":R||void 0,"data-drop-target":z||void 0,"data-focus-visible":B||void 0,"data-selection-mode":b.selectionManager.selectionMode==="none"?void 0:b.selectionManager.selectionMode,"data-allows-dragging":!!y||void 0},m.createElement(gl,{values:[[Wt,b],[Qe,{dragAndDropHooks:s,dragState:E,dropState:K}],[qt,{render:Qa}]]},c&&m.createElement(to,null),m.createElement(Pi,null,m.createElement(j,{collection:b.collection,persistedKeys:Ps(b.selectionManager,s,K),scrollRef:l,renderDropIndicator:Es(s,K)}))),Z)),V)}var Ts=class extends $e{};Ts.type="content";var $s=Ot(Ts,function(t){let e=(0,m.useContext)(Rs),l=We({children:t.children,values:e});return m.createElement(xt.Provider,{value:an},l.children)}),Rs=(0,m.createContext)(null),Bs=class extends $e{};Bs.type="item";var zs=Na(Bs,(t,e,l)=>{let s=(0,m.useContext)(Wt);e=Dt(e);let{dragAndDropHooks:r,dragState:i,dropState:a}=(0,m.useContext)(Qe),{rowProps:c,gridCellProps:o,expandButtonProps:d,descriptionProps:h,...u}=Ks({node:l,shouldSelectOnPressUp:!!i},s,e),f=c["aria-expanded"]===!0,p=t.hasChildItems||[...s.collection.getChildren(l.key)].length>1,x=c["aria-level"]||1,{hoverProps:j,isHovered:k}=Yr({isDisabled:!u.allowsSelection&&!u.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:S,focusProps:I}=Kt(),{isFocusVisible:v,focusProps:N}=Kt({within:!0}),{checkboxProps:A}=Ra({key:l.key},s),b=null;i&&r&&(b=r.useDraggableItem({key:l.key,hasDragButton:!0},i));let $=null,E=(0,m.useRef)(null),K=(0,m.useRef)(null),P=(0,m.useRef)(null),{visuallyHiddenProps:z}=Et();a&&r&&($=r.useDropIndicator({target:{type:"item",key:l.key,dropPosition:"on"},activateButtonRef:P},a,K));let V=i&&i.isDragging(l.key),T=$==null?void 0:$.isDropTarget,w=s.selectionManager.selectionMode,y=s.selectionManager.selectionBehavior,M=m.useMemo(()=>({...u,isHovered:k,isFocusVisible:S,isExpanded:f,hasChildItems:p,level:x,selectionMode:w,selectionBehavior:y,isFocusVisibleWithin:v,state:s,id:l.key,allowsDragging:!!i,isDragging:V,isDropTarget:T}),[u,k,S,f,p,x,v,s,l.key,i,V,T,y,w]),R=We({...t,id:void 0,children:l.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":x},values:M});(0,m.useEffect)(()=>{l.textValue},[l.textValue]),(0,m.useEffect)(()=>{p&&E.current},[]);let B=(0,m.useRef)(null);(0,m.useEffect)(()=>{i&&B.current},[]);let Y=Vt({items:s.collection.getChildren(l.key),children:Q=>{switch(Q.type){case"content":return Q.render(Q);case"loader":case"item":return m.createElement(m.Fragment,null);default:throw Error("Unsupported element type in TreeRow: "+Q.type)}}}),C=Ye(),Z=at(t,{global:!0});return delete Z.id,delete Z.onClick,m.createElement(m.Fragment,null,$&&!$.isHidden&&m.createElement("div",{role:"row","aria-level":c["aria-level"],"aria-expanded":c["aria-expanded"],"aria-label":$.dropIndicatorProps["aria-label"]},m.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},m.createElement("div",{role:"button",...z,...$.dropIndicatorProps,ref:K}),c["aria-expanded"]==null?null:m.createElement("div",{role:"button",...z,id:C,"aria-label":d["aria-label"],"aria-labelledby":`${C} ${c.id}`,tabIndex:-1,ref:P}))),m.createElement("div",{...ke(Z,c,I,j,N,b==null?void 0:b.dragProps),...R,ref:e,"data-expanded":p&&f||void 0,"data-has-child-items":p||void 0,"data-level":x,"data-selected":u.isSelected||void 0,"data-disabled":u.isDisabled||void 0,"data-hovered":k||void 0,"data-focused":u.isFocused||void 0,"data-focus-visible":S||void 0,"data-pressed":u.isPressed||void 0,"data-selection-mode":s.selectionManager.selectionMode==="none"?void 0:s.selectionManager.selectionMode,"data-allows-dragging":!!i||void 0,"data-dragging":V||void 0,"data-drop-target":T||void 0},m.createElement("div",{...o,style:{display:"contents"}},m.createElement(gl,{values:[[yi,{slots:{selection:A}}],[li,{slots:{[ti]:{},chevron:{...d,ref:E},drag:{...b==null?void 0:b.dragButtonProps,ref:B,style:{pointerEvents:"none"}}}}],[Rs,{...M}],[Mi,{isSelected:u.isSelected}]]},Y))))});Ot(Bt,function(t,e,l){let{isVirtualized:s}=(0,m.useContext)(xt),r=(0,m.useContext)(Wt),{isLoading:i,onLoadMore:a,scrollOffset:c,...o}=t,d=(0,m.useRef)(null);Tl((0,m.useMemo)(()=>({onLoadMore:a,collection:r==null?void 0:r.collection,sentinelRef:d,scrollOffset:c}),[a,c,r==null?void 0:r.collection]),d),e=Dt(e);let{rowProps:h,gridCellProps:u}=Ks({node:l},r,e),f=h["aria-level"]||1,p={role:"row","aria-level":h["aria-level"]},x=We({...o,id:void 0,children:l.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:f}}),j={};return s&&(j={display:"contents"}),m.createElement(m.Fragment,null,m.createElement("div",{style:{position:"relative",width:0,height:0},inert:$l(!0)},m.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"absolute",height:1,width:1}})),i&&x.children&&m.createElement("div",{ref:e,...ke(at(t),p),...x,"data-level":f},m.createElement("div",{...u,style:j},x.children)))});function Vs(t){return t?t==="all"?"all":new Set(t):new Set}function Za(t,e){let{expandedKeys:l=new Set}=e,s=new Map,r=[],i=0,a=new Map,c=o=>{if(o.type==="item"||o.type==="loader"){let d=o==null?void 0:o.parentKey,h={...o};d==null?s.set(o.key,o):([...t.getChildren(d)][0].type!=="item"&&(h.index=(o==null?void 0:o.index)==null?0:(o==null?void 0:o.index)-1),o.type==="loader"&&(h.level=o.level+1),s.set(h.key,h));let u=s.get(o.key)||o;(u.level===0||u.parentKey!=null&&l.has(u.parentKey)&&a.get(u.parentKey))&&(u.type==="item"&&i++,r.push(u),a.set(u.key,!0))}else o.type!==null&&s.set(o.key,o);for(let d of t.getChildren(o.key))c(d)};for(let o of t)c(o);return{flattenedRows:r,keyMap:s,itemCount:i}}function Qa(t,e){var d;e=Dt(e);let{dragAndDropHooks:l,dropState:s}=(0,m.useContext)(Qe),r=(0,m.useRef)(null),{dropIndicatorProps:i,isHidden:a,isDropTarget:c}=l.useDropIndicator(t,s,r);if(a)return null;let o=s&&t.target.type==="item"?(((d=s.collection.getItem(t.target.key))==null?void 0:d.level)||0)+1:1;return m.createElement(eo,{...t,dropIndicatorProps:i,isDropTarget:c,ref:e,buttonRef:r,level:o})}function Ja(t,e){let{dropIndicatorProps:l,isDropTarget:s,buttonRef:r,level:i,...a}=t,{visuallyHiddenProps:c}=Et(),o=We({...a,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":i},values:{isDropTarget:s}});return m.createElement("div",{...o,role:"row","aria-level":i,ref:e,"data-drop-target":s||void 0},m.createElement("div",{role:"gridcell"},m.createElement("div",{...c,role:"button",...l,ref:r}),o.children))}var eo=(0,m.forwardRef)(Ja);function to(){let{dragAndDropHooks:t,dropState:e}=(0,m.useContext)(Qe),l=(0,m.useRef)(null),{dropIndicatorProps:s}=t.useDropIndicator({target:{type:"root"}},e,l),r=e.isDropTarget({type:"root"}),{visuallyHiddenProps:i}=Et();return!r&&s["aria-hidden"]?null:m.createElement("div",{role:"row","aria-hidden":s["aria-hidden"],style:{position:"absolute"}},m.createElement("div",{role:"gridcell"},m.createElement("div",{role:"button",...i,...s,ref:l})))}function Ls(){return["compact","medium","full","columns"]}var lo=he();function Os(t){return t.toLowerCase().replaceAll("+","-").trim()}function no(t,e){let l=t.getHotkeyGroups(),s=e?new Set(l[e]||[]):new Set,r=new Map;for(let c of t.iterate()){if(s.has(c))continue;let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")continue;let d=Os(o.key);r.has(d)||r.set(d,[]);let h=r.get(d);h&&h.push({action:c,name:o.name})}let i=[],a=new Set;for(let[c,o]of r.entries())if(o.length>1){i.push({key:c,actions:o});for(let{action:d}of o)a.add(d)}return{duplicates:i,hasDuplicate:c=>a.has(c),getDuplicatesFor:c=>{let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")return[];let d=Os(o.key),h=i.find(u=>u.key===d);return!h||h.actions.length<=1?[]:h.actions.filter(u=>u.action!==c).map(u=>u.action)}}}function so(t,e){let l=(0,lo.c)(3),s;return l[0]!==t||l[1]!==e?(s=no(t,e),l[0]=t,l[1]=e,l[2]=s):s=l[2],s}var ro=he(),n=el(Er(),1);const io=t=>{let e=(0,ro.c)(7),{duplicates:l}=t;if(l.length===0)return null;let s,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(_t,{className:"h-4 w-4"}),r=(0,n.jsx)(Li,{children:"Duplicate shortcuts"}),e[0]=s,e[1]=r):(s=e[0],r=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)("p",{className:"mb-2",children:"Multiple actions are assigned to the same keyboard shortcut:"}),e[2]=i):i=e[2];let a;e[3]===l?a=e[4]:(a=l.map(oo),e[3]=l,e[4]=a);let c;return e[5]===a?c=e[6]:(c=(0,n.jsxs)(Oi,{variant:"warning",className:"mb-4",children:[s,r,(0,n.jsxs)(Vi,{children:[i,(0,n.jsx)("ul",{className:"space-y-2",children:a})]})]}),e[5]=a,e[6]=c),c};function ao(t){let{action:e,name:l}=t;return(0,n.jsx)("li",{children:l},e)}function oo(t){let{key:e,actions:l}=t;return(0,n.jsxs)("li",{className:"text-xs",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,n.jsx)(At,{shortcut:e}),(0,n.jsx)("span",{className:"font-semibold",children:"is used by:"})]}),(0,n.jsx)("ul",{className:"ml-6 list-disc",children:l.map(ao)})]},e)}const Gt=Ct(!1),co=()=>{let[t,e]=lt(Gt),[l,s]=(0,m.useState)(null),[r,i]=(0,m.useState)([]),[a,c]=rl(),o=Oe(wr),{saveUserConfig:d}=st(),{duplicates:h,hasDuplicate:u,getDuplicatesFor:f}=so(o,"Markdown");Ir("global.showHelp",()=>e(N=>!N));let p=async N=>{let A={...a};c(b=>({...b,...N})),await d({config:N}).catch(b=>{throw c(A),b})},x=async N=>{if(!l)return;let A=N.join("-"),b={keymap:{...a.keymap,overrides:{...a.keymap.overrides,[l]:A}}};s(null),i([]),await p(b)},j=async()=>{if(!l)return;let N={keymap:{...a.keymap,overrides:{...a.keymap.overrides}}};delete N.keymap.overrides[l],s(null),i([]),await p(N)},k=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;let N={keymap:{...a.keymap,overrides:{}}};s(null),i([]),await p(N)};if(!t)return null;let S=N=>{let A=o.getHotkey(N);if(l===N){let E=Cr(N);return(0,n.jsxs)("div",{children:[(0,n.jsx)(Ae,{defaultValue:r.join("+"),placeholder:A.name,onKeyDown:K=>{K.preventDefault();let P=[];if(K.key==="Meta"||K.key==="Control"||K.key==="Alt"||K.key==="Shift"||(K.metaKey&&P.push(nl()?"Cmd":"Meta"),K.ctrlKey&&P.push("Ctrl"),K.altKey&&P.push("Alt"),K.shiftKey&&P.push("Shift"),K.key==="-"))return;if(K.key==="Escape"&&P.length===0){s(null),i([]);return}let z=K.key.toLowerCase();K.key===" "&&(z="Space"),P.push(z),x(P)},autoFocus:!0,endAdornment:(0,n.jsx)(ie,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{s(null),i([])},children:(0,n.jsx)(wt,{className:"w-4 h-4"})})}),(0,n.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),E.key!==A.key&&(0,n.jsxs)("span",{className:"text-xs cursor-pointer text-primary",onClick:j,children:["Reset to default:"," ",(0,n.jsx)("span",{className:"font-mono",children:E.key})]})]})]},N)}let b=u(N),$=b?f(N):[];return(0,n.jsxs)("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[o.isEditable(N)?(0,n.jsx)(vl,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{i([]),s(N)}}):(0,n.jsx)("div",{className:"w-3 h-3"}),(0,n.jsx)(At,{className:"justify-end",shortcut:A.key}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{children:A.name.toLowerCase()}),b&&(0,n.jsxs)("div",{className:"group relative inline-flex",children:[(0,n.jsx)(_t,{className:"w-3 h-3 text-(--yellow-11)"}),(0,n.jsxs)("div",{className:"invisible group-hover:visible absolute left-0 top-5 z-10 w-max max-w-xs rounded-md bg-(--yellow-2) border border-(--yellow-7) p-2 text-xs text-(--yellow-11) shadow-md",children:["Also used by:"," ",$.map(E=>o.getHotkey(E).name.toLowerCase()).join(", ")]})]})]})]},N)},I=o.getHotkeyGroups(),v=(N,A)=>{let b=I[N];return(0,n.jsxs)("div",{className:"mb-[40px] gap-2 flex flex-col",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-medium",children:N}),A]}),b.map(S)]})};return(0,n.jsx)(gi,{open:t,onOpenChange:N=>e(N),children:(0,n.jsxs)(fi,{className:"sm:items-center sm:top-0",children:[(0,n.jsx)(pi,{}),(0,n.jsxs)(hi,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[(0,n.jsx)(ui,{children:(0,n.jsx)(mi,{children:"Shortcuts"})}),(0,n.jsx)(io,{duplicates:h}),(0,n.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,n.jsxs)("div",{className:"w-1/2",children:[v("Editing"),v("Markdown")]}),(0,n.jsxs)("div",{className:"w-1/2",children:[v("Navigation"),v("Running Cells"),v("Creation and Ordering"),(N=>v(N,(0,n.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",a.keymap.preset==="vim"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(At,{shortcut:nl()?"Cmd":"Ctrl"}),(0,n.jsx)(ae,{children:"Esc"})]}):(0,n.jsx)(ae,{children:"Esc"})," ","in a cell to enter command mode"]})))("Command"),v("Other"),(0,n.jsx)(ie,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:k,tabIndex:-1,children:(0,n.jsx)("span",{className:"text-destructive",children:"Reset all to default"})})]})]})]})]})})},Hs=(0,m.memo)(()=>{let[t,e]=lt(br),[l,s]=lt(jr),[r,i]=(0,m.useState)(),[a,c]=(0,m.useState)(!1),o=async u=>{u.preventDefault(),c(!0);try{let f=await mo();if(!(f!=null&&f.verificationUri)||!f.userCode){Ke.error("Copilot#trySignIn: Invalid response from sign-in",{result:f}),s("connectionError"),Ne({title:"GitHub Copilot Connection Error",description:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"});return}let{verificationUri:p,status:x,userCode:j}=f;Ws(x)?e(!0):(s("signingIn"),i({url:p,code:j}))}catch(f){Ke.error("Copilot#trySignIn: Error during sign-in",f),s("connectionError"),Ne({title:"GitHub Copilot Connection Error",description:f instanceof Error?f.message:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"})}finally{c(!1)}},d=async u=>{if(u.preventDefault(),r){c(!0);try{let f=await ho(r.code);f.success?(e(!0),s("signedIn")):f.error==="connection"?(s("connectionError"),Ne({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:(0,n.jsx)(ie,{onClick:o,children:"Retry"})})):s("signInFailed")}finally{c(!1)}}},h=async u=>{u.preventDefault(),await fo(),e(!1),s("signedOut")};return(()=>{switch(l??(t?"signedIn":"connecting")){case"connecting":return(0,n.jsx)(Te,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return(0,n.jsx)(ie,{onClick:o,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return(0,n.jsxs)("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[(0,n.jsx)("li",{children:(0,n.jsxs)("div",{className:"flex items-center",children:["Copy this code:",(0,n.jsx)("strong",{className:"ml-2",children:r==null?void 0:r.code}),(0,n.jsx)(Hr,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{r&&(await Ti(r.code),Ne({description:"Copied to clipboard"}))}})]})}),(0,n.jsxs)("li",{children:["Enter the code at this link:",(0,n.jsx)("a",{href:r==null?void 0:r.url,target:"_blank",rel:"noreferrer",className:Pr({variant:"link",size:"xs"}),children:r==null?void 0:r.url})]}),(0,n.jsxs)("li",{children:["Click here when done:",(0,n.jsxs)(ie,{size:"xs",onClick:d,className:"ml-1",children:[a&&(0,n.jsx)(rt,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),a?(0,n.jsx)(rt,{className:"h-3 w-3 mr-1 animate-spin"}):(0,n.jsx)(ie,{onClick:o,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return(0,n.jsxs)("div",{className:"flex items-center gap-5",children:[(0,n.jsxs)(Te,{className:"font-normal flex items-center",children:[(0,n.jsx)("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:(0,n.jsx)(Tr,{className:"h-3 w-3 text-white"})}),"Connected"]}),(0,n.jsx)(ie,{onClick:h,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(Te,{className:"font-normal flex",children:[(0,n.jsx)(wt,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),(0,n.jsx)("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),(0,n.jsx)(ie,{onClick:o,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(Te,{className:"font-normal flex",children:[(0,n.jsx)(wt,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),(0,n.jsxs)("div",{className:"text-sm",children:["For troubleshooting, see the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});Hs.displayName="CopilotConfig";var Us=5,uo=3e3;async function mo(){return await St().signInInitiate()}async function ho(t){let e=St();try{Ke.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");let{status:l}=await e.signInConfirm({userCode:t});return Ws(l)?(Ke.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(Ke.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:l}),{success:!1})}catch(l){return qs(l)?(Ke.error("Copilot#tryFinishSignIn: Connection error during sign-in",l),{success:!1,error:"connection"}):await po(e)}}async function po(t){for(let e=0;e<Us;e++)try{if(await new Promise(l=>setTimeout(l,uo)),await t.signedIn())return Ke.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(l){if(Ke.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:Us}),qs(l))return{success:!1,error:"connection"}}return Ke.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}async function fo(){await St().signOut()}function qs(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function Ws(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}var vt=he();const q="flex flex-row items-center space-x-1 space-y-0",go=t=>{let e=(0,vt.c)(2),{children:l}=t,s;return e[0]===l?s=e[1]:(s=(0,n.jsx)("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:l}),e[0]=l,e[1]=s),s},Je=t=>{let e=(0,vt.c)(10),l,s,r;e[0]===t?(l=e[1],s=e[2],r=e[3]):({children:l,className:s,...r}=t,e[0]=t,e[1]=l,e[2]=s,e[3]=r);let i;e[4]===s?i=e[5]:(i=ue("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",s),e[4]=s,e[5]=i);let a;return e[6]!==l||e[7]!==r||e[8]!==i?(a=(0,n.jsx)("div",{...r,className:i,children:l}),e[6]=l,e[7]=r,e[8]=i,e[9]=a):a=e[9],a},xo=t=>{let e=(0,vt.c)(2),{children:l}=t,s;return e[0]===l?s=e[1]:(s=(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:l}),e[0]=l,e[1]=s),s},ge=t=>{let e=(0,vt.c)(5),{title:l,children:s}=t,r;e[0]===l?r=e[1]:(r=(0,n.jsx)(Je,{children:l}),e[0]=l,e[1]=r);let i;return e[2]!==s||e[3]!==r?(i=(0,n.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[r,s]}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i},Gs=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],yo="us-east-1.us-east-2.us-west-1.us-west-2.ap-northeast-1.ap-northeast-2.ap-northeast-3.ap-south-1.ap-south-2.ap-southeast-1.ap-southeast-2.ap-southeast-3.ap-southeast-4.ap-southeast-5.ap-southeast-7.ap-east-2.ca-central-1.eu-central-1.eu-central-2.eu-north-1.eu-south-1.eu-south-2.eu-west-1.eu-west-2.eu-west-3.il-central-1.me-central-1.sa-east-1.us-gov-east-1.us-gov-west-1".split(".");var vo=he();const Ys=t=>{let e=(0,vo.c)(12),{value:l,includeSuggestion:s}=t,r=s===void 0?!0:s;if(!l||l.includes("/"))return null;let i;e[0]===l?i=e[1]:(i=qe.parse(l),e[0]=l,e[1]=i);let a=i.id,c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2];let o;e[3]===l?o=e[4]:(o=(0,n.jsxs)("span",{children:["Model id should be in the form"," ",c,". ",l," is missing a provider."]}),e[3]=l,e[4]=o);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)("br",{}),e[5]=d):d=e[5];let h;e[6]!==r||e[7]!==a?(h=r&&a&&(0,n.jsxs)("span",{children:["Did you mean ",(0,n.jsx)("code",{className:"font-bold",children:a}),"?"]}),e[6]=r,e[7]=a,e[8]=h):h=e[8];let u;return e[9]!==o||e[10]!==h?(u=(0,n.jsxs)(ht,{kind:"danger",className:"mt-1",children:[o,d,h]}),e[9]=o,e[10]=h,e[11]=u):u=e[11],u};var Yt=he();function Xs(t,e){let l=(0,Yt.c)(10),s;l[0]!==e||l[1]!==t?(s=ll(t,e),l[0]=e,l[1]=t,l[2]=s):s=l[2];let r=s,i=Oe(Kr),a;l[3]!==e||l[4]!==i?(a=ll(i,e),l[3]=e,l[4]=i,l[5]=a):a=l[5];let c=a,o=c!=null&&r!==c,d;return l[6]!==r||l[7]!==o||l[8]!==c?(d={isOverridden:o,currentValue:r,overriddenValue:c},l[6]=r,l[7]=o,l[8]=c,l[9]=d):d=l[9],d}const bo=t=>{let e=(0,Yt.c)(3),{name:l,children:s}=t,[r]=sl(),{isOverridden:i}=Xs(r,l),a;return e[0]!==s||e[1]!==i?(a=i?(0,n.jsx)(Be,{delayDuration:200,content:(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("p",{children:["This setting is overridden by the"," ",(0,n.jsx)(ae,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),(0,n.jsxs)("p",{children:["To change it, edit the project config"," ",(0,n.jsx)(ae,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:(0,n.jsx)("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:s})}):s,e[0]=s,e[1]=i,e[2]=a):a=e[2],a},W=t=>{let e=(0,Yt.c)(18),{userConfig:l,name:s}=t,{isOverridden:r,currentValue:i,overriddenValue:a}=Xs(l,s);if(!r)return null;let c,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsxs)("span",{children:["This setting is overridden by"," ",(0,n.jsx)(ae,{className:"inline",children:"pyproject.toml"}),"."]}),o=(0,n.jsx)("br",{}),e[0]=c,e[1]=o):(c=e[0],o=e[1]);let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsxs)("span",{children:["Edit the ",(0,n.jsx)(ae,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),h=(0,n.jsx)("br",{}),e[2]=d,e[3]=h):(d=e[2],h=e[3]);let u=String(i),f;e[4]===u?f=e[5]:(f=(0,n.jsxs)("span",{children:["User value: ",(0,n.jsx)("strong",{children:u})]}),e[4]=u,e[5]=f);let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)("br",{}),e[6]=p):p=e[6];let x=String(a),j;e[7]===x?j=e[8]:(j=(0,n.jsxs)("span",{children:["Project value: ",(0,n.jsx)("strong",{children:x})]}),e[7]=x,e[8]=j);let k;e[9]!==f||e[10]!==j?(k=(0,n.jsxs)(n.Fragment,{children:[c,o,d,h,f,p,j]}),e[9]=f,e[10]=j,e[11]=k):k=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=(0,n.jsx)(Al,{className:"w-3 h-3"}),e[12]=S):S=e[12];let I=String(a),v;e[13]===I?v=e[14]:(v=(0,n.jsxs)("span",{className:"text-(--amber-12) text-xs flex items-center gap-1 border rounded px-2 py-1 bg-(--amber-2) border-(--amber-6) ml-1",children:[S,"Overridden by pyproject.toml [",I,"]"]}),e[13]=I,e[14]=v);let N;return e[15]!==k||e[16]!==v?(N=(0,n.jsx)(Be,{content:k,children:v}),e[15]=k,e[16]=v,e[17]=N):N=e[17],N};var Ve=he(),Zs=m.forwardRef((t,e)=>{let l=(0,Ve.c)(9),s,r;l[0]===t?(s=l[1],r=l[2]):({className:s,...r}=t,l[0]=t,l[1]=s,l[2]=r);let i;l[3]===s?i=l[4]:(i=ue("rounded-xl border bg-card text-card-foreground shadow",s),l[3]=s,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,n.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});Zs.displayName="Card";var Qs=m.forwardRef((t,e)=>{let l=(0,Ve.c)(9),s,r;l[0]===t?(s=l[1],r=l[2]):({className:s,...r}=t,l[0]=t,l[1]=s,l[2]=r);let i;l[3]===s?i=l[4]:(i=ue("flex flex-col space-y-1.5 p-6",s),l[3]=s,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,n.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});Qs.displayName="CardHeader";var Js=m.forwardRef((t,e)=>{let l=(0,Ve.c)(9),s,r;l[0]===t?(s=l[1],r=l[2]):({className:s,...r}=t,l[0]=t,l[1]=s,l[2]=r);let i;l[3]===s?i=l[4]:(i=ue("font-semibold leading-none tracking-tight",s),l[3]=s,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,n.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});Js.displayName="CardTitle";var er=m.forwardRef((t,e)=>{let l=(0,Ve.c)(9),s,r;l[0]===t?(s=l[1],r=l[2]):({className:s,...r}=t,l[0]=t,l[1]=s,l[2]=r);let i;l[3]===s?i=l[4]:(i=ue("text-sm text-muted-foreground",s),l[3]=s,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,n.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});er.displayName="CardDescription";var tr=m.forwardRef((t,e)=>{let l=(0,Ve.c)(9),s,r;l[0]===t?(s=l[1],r=l[2]):({className:s,...r}=t,l[0]=t,l[1]=s,l[2]=r);let i;l[3]===s?i=l[4]:(i=ue("p-6 pt-0",s),l[3]=s,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,n.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});tr.displayName="CardContent";var jo=m.forwardRef((t,e)=>{let l=(0,Ve.c)(9),s,r;l[0]===t?(s=l[1],r=l[2]):({className:s,...r}=t,l[0]=t,l[1]=s,l[2]=r);let i;l[3]===s?i=l[4]:(i=ue("flex items-center p-6 pt-0",s),l[3]=s,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,n.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});jo.displayName="CardFooter";var ko=he();function lr(){let t=(0,ko.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],El(Co,e)}async function Co(){return Nt.get("/ai/mcp/status")}function So(){let[t,e]=(0,m.useState)(!1);return{refresh:async()=>{e(!0);try{await Nt.post("/ai/mcp/refresh",{}),Ne({title:"MCP refreshed",description:"MCP server configuration has been refreshed successfully"})}catch(l){Ne({title:"Refresh failed",description:l instanceof Error?l.message:"Failed to refresh MCP",variant:"danger"})}finally{e(!1)}},isRefreshing:t}}var nr=he();const No=()=>{let t=(0,nr.c)(27),{data:e,refetch:l,isFetching:s}=lr(),r;t[0]===l?r=t[1]:(r=async()=>{try{await Nt.post("/ai/mcp/refresh",{}),Ne({title:"MCP refreshed",description:"MCP server configuration has been refreshed"}),l()}catch(N){let A=N;Ne({title:"Refresh failed",description:A instanceof Error?A.message:"Failed to refresh MCP",variant:"danger"})}},t[0]=l,t[1]=r);let i=r,a;t[2]===(e==null?void 0:e.servers)?a=t[3]:(a=(e==null?void 0:e.servers)||{},t[2]=e==null?void 0:e.servers,t[3]=a);let c=a,o=Object.keys(c).length>0,d=(e==null?void 0:e.status)==="ok"&&"text-green-500",h=(e==null?void 0:e.status)==="partial"&&"text-yellow-500",u=(e==null?void 0:e.status)==="error"&&o&&"text-red-500",f;t[4]!==d||t[5]!==h||t[6]!==u?(f=ue("h-4 w-4",d,h,u),t[4]=d,t[5]=h,t[6]=u,t[7]=f):f=t[7];let p;t[8]===f?p=t[9]:(p=(0,n.jsx)(Be,{content:"MCP Status",children:(0,n.jsx)(Ii,{asChild:!0,children:(0,n.jsx)(ie,{variant:"text",size:"icon",children:(0,n.jsx)(Ur,{className:f})})})}),t[8]=f,t[9]=p);let x;t[10]===Symbol.for("react.memo_cache_sentinel")?(x=(0,n.jsx)("h4",{className:"font-medium text-sm",children:"MCP Server Status"}),t[10]=x):x=t[10];let j;t[11]===s?j=t[12]:(j=s?(0,n.jsx)(rt,{className:"h-3 w-3 animate-spin"}):(0,n.jsx)(pl,{className:"h-3 w-3"}),t[11]=s,t[12]=j);let k;t[13]!==i||t[14]!==s||t[15]!==j?(k=(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[x,(0,n.jsx)(ie,{variant:"ghost",size:"xs",onClick:i,disabled:s,children:j})]}),t[13]=i,t[14]=s,t[15]=j,t[16]=k):k=t[16];let S;t[17]!==o||t[18]!==c||t[19]!==e?(S=e&&(0,n.jsxs)("div",{className:"text-xs space-y-2",children:[o&&(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Overall:"}),(0,n.jsx)(bt,{status:e.status})]}),e.error&&(0,n.jsx)("div",{className:"text-xs text-red-500 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:e.error}),o&&(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("div",{className:"text-muted-foreground font-medium",children:"Servers:"}),Object.entries(c).map(wo)]}),!o&&(0,n.jsxs)("div",{className:"text-muted-foreground text-center py-2",children:["No MCP servers configured. ",(0,n.jsx)("br",{})," Configure under"," ",(0,n.jsx)("b",{children:"Settings > AI > MCP"})]})]}),t[17]=o,t[18]=c,t[19]=e,t[20]=S):S=t[20];let I;t[21]!==S||t[22]!==k?(I=(0,n.jsx)(Di,{className:"w-[320px]",align:"start",side:"right",children:(0,n.jsxs)("div",{className:"space-y-3",children:[k,S]})}),t[21]=S,t[22]=k,t[23]=I):I=t[23];let v;return t[24]!==I||t[25]!==p?(v=(0,n.jsxs)(Ei,{children:[p,I]}),t[24]=I,t[25]=p,t[26]=v):v=t[26],v},bt=t=>{let e=(0,nr.c)(11),{status:l}=t,s=l==="ok"&&"text-green-500",r=l==="partial"&&"text-yellow-500",i=l==="error"&&"text-red-500",a=l==="failed"&&"text-red-500",c=l==="disconnected"&&"text-gray-500",o=l==="pending"&&"text-yellow-500",d=l==="connected"&&"text-green-500",h;e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==a||e[4]!==c||e[5]!==o||e[6]!==d?(h=ue("text-xs font-medium",s,r,i,a,c,o,d),e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=o,e[6]=d,e[7]=h):h=e[7];let u;return e[8]!==l||e[9]!==h?(u=(0,n.jsx)("span",{className:h,children:l}),e[8]=l,e[9]=h,e[10]=u):u=e[10],u};function wo(t){let[e,l]=t;return(0,n.jsxs)("div",{className:"flex justify-between items-center pl-2",children:[(0,n.jsx)("span",{className:"text-muted-foreground truncate max-w-[180px]",children:e}),(0,n.jsx)(bt,{status:l})]},e)}var Ko=he(),Io=[{id:"marimo",title:"marimo (docs)",description:"Access marimo documentation"},{id:"context7",title:"Context7",description:"Connect to Context7 MCP server"}];const Do=t=>{let e=(0,Ko.c)(36),{form:l,onSubmit:s}=t,{handleClick:r}=or(),{data:i,refetch:a,isFetching:c}=lr(),{refresh:o,isRefreshing:d}=So(),h;e[0]!==a||e[1]!==o?(h=async()=>{await o(),a()},e[0]=a,e[1]=o,e[2]=h):h=e[2];let u=h,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(Je,{children:"MCP Servers"}),e[3]=f):f=e[3];let p;e[4]===i?p=e[5]:(p=i&&(0,n.jsx)(bt,{status:i.status}),e[4]=i,e[5]=p);let x=d||c,j;e[6]!==c||e[7]!==d?(j=d||c?(0,n.jsx)(rt,{className:"h-3 w-3 animate-spin"}):(0,n.jsx)(pl,{className:"h-3 w-3"}),e[6]=c,e[7]=d,e[8]=j):j=e[8];let k;e[9]!==u||e[10]!==x||e[11]!==j?(k=(0,n.jsx)(ie,{variant:"outline",size:"xs",onClick:u,disabled:x,children:j}),e[9]=u,e[10]=x,e[11]=j,e[12]=k):k=e[12];let S;e[13]!==p||e[14]!==k?(S=(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[f,(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[p,k]})]}),e[13]=p,e[14]=k,e[15]=S):S=e[15];let I;e[16]===i?I=e[17]:(I=(i==null?void 0:i.error)&&(0,n.jsx)("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:i.error}),e[16]=i,e[17]=I);let v;e[18]===i?v=e[19]:(v=(i==null?void 0:i.servers)&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:Object.entries(i.servers).map(_o)}),e[18]=i,e[19]=v);let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enable Model Context Protocol (MCP) servers to provide additional capabilities and data sources for AI features."}),e[20]=N):N=e[20];let A;e[21]===Symbol.for("react.memo_cache_sentinel")?(A=(0,n.jsx)(ae,{className:"inline",children:"marimo[mcp]"}),e[21]=A):A=e[21];let b;e[22]===r?b=e[23]:(b=(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["This feature requires the ",A," ","package. See"," ",(0,n.jsx)(ie,{variant:"link",onClick:()=>r("optionalDeps"),size:"xs",children:"Optional Features"})," ","for more details."]}),e[22]=r,e[23]=b);let $;e[24]!==l||e[25]!==s?($=P=>{let{field:z}=P,V=z.value||[],T=w=>{let y=V.includes(w)?V.filter(M=>M!==w):[...V,w];z.onChange(y),s(l.getValues())};return(0,n.jsx)(H,{children:(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Io.map(w=>{let y=V.includes(w.id);return(0,n.jsxs)(Zs,{className:`cursor-pointer transition-all ${y?"border-[var(--blue-9)] bg-[var(--blue-2)]":"hover:border-[var(--blue-7)]"}`,onClick:()=>T(w.id),children:[(0,n.jsx)(Qs,{children:(0,n.jsxs)("div",{className:"flex items-start justify-between",children:[(0,n.jsx)(Js,{className:"text-base",children:w.title}),(0,n.jsx)("span",{className:`h-5 w-5 flex items-center justify-center rounded border ${y?"border-[var(--blue-7)] bg-[var(--blue-7)] text-foreground":"border-muted bg-background text-muted-foreground"}`,children:y?(0,n.jsx)(Yi,{}):null})]})}),(0,n.jsx)(tr,{children:(0,n.jsx)(er,{children:w.description})})]},w.id)})})})},e[24]=l,e[25]=s,e[26]=$):$=e[26];let E;e[27]!==l.control||e[28]!==$?(E=(0,n.jsx)(O,{control:l.control,name:"mcp.presets",render:$}),e[27]=l.control,e[28]=$,e[29]=E):E=e[29];let K;return e[30]!==b||e[31]!==E||e[32]!==S||e[33]!==I||e[34]!==v?(K=(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[S,I,v,N,b,E]}),e[30]=b,e[31]=E,e[32]=S,e[33]=I,e[34]=v,e[35]=K):K=e[35],K};function _o(t){let[e,l]=t;return(0,n.jsxs)("div",{children:[e,": ",(0,n.jsx)(bt,{status:l})]},e)}var me=he();const Eo=t=>{let e=(0,me.c)(5),{provider:l,children:s}=t,r;e[0]===l?r=e[1]:(r=l&&(0,n.jsx)(Ue,{provider:l,className:"mr-2"}),e[0]=l,e[1]=r);let i;return e[2]!==s||e[3]!==r?(i=(0,n.jsxs)("div",{className:"flex items-center text-base font-semibold",children:[r,s]}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i},De=t=>{let e=(0,me.c)(10),{form:l,config:s,name:r,placeholder:i,testId:a,description:c}=t,o;e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==a?(o=h=>{let{field:u}=h;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"API Key"}),(0,n.jsx)(U,{children:(0,n.jsx)(Ae,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:i,type:"password",...u,value:et(u.value),onChange:f=>{let p=f.target.value;p.includes("*")||u.onChange(p)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:r})]}),c&&(0,n.jsx)(X,{children:c})]})},e[0]=s,e[1]=c,e[2]=r,e[3]=i,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==l.control||e[7]!==r||e[8]!==o?(d=(0,n.jsx)(O,{control:l.control,name:r,render:o}),e[6]=l.control,e[7]=r,e[8]=o,e[9]=d):d=e[9],d};function et(t){if(t!=null)return typeof t=="string"?t:String(t)}const Re=t=>{let e=(0,me.c)(12),{form:l,config:s,name:r,placeholder:i,testId:a,description:c,disabled:o,defaultValue:d}=t,h=o===void 0?!1:o,u;e[0]!==s||e[1]!==d||e[2]!==c||e[3]!==r||e[4]!==i||e[5]!==a?(u=p=>{let{field:x}=p;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Base URL"}),(0,n.jsx)(U,{children:(0,n.jsx)(Ae,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:i,defaultValue:d,...x,value:et(x.value)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:r})]}),c&&(0,n.jsx)(X,{children:c})]})},e[0]=s,e[1]=d,e[2]=c,e[3]=r,e[4]=i,e[5]=a,e[6]=u):u=e[6];let f;return e[7]!==h||e[8]!==l.control||e[9]!==r||e[10]!==u?(f=(0,n.jsx)(O,{control:l.control,name:r,disabled:h,render:u}),e[7]=h,e[8]=l.control,e[9]=r,e[10]=u,e[11]=f):f=e[11],f},Xt=t=>{let e=(0,me.c)(15),{form:l,config:s,name:r,placeholder:i,testId:a,description:c,disabled:o,label:d,forRole:h,onSubmit:u}=t,f=o===void 0?!1:o,p;e[0]!==s||e[1]!==c||e[2]!==h||e[3]!==l||e[4]!==d||e[5]!==r||e[6]!==u||e[7]!==i||e[8]!==a?(p=j=>{let{field:k}=j,S=et(k.value),I=v=>{k.onChange(v),u(l.getValues())};return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:d}),(0,n.jsx)(U,{children:(0,n.jsx)(Fr,{value:S,placeholder:i,onSelect:I,triggerClassName:"text-sm",customDropdownContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Or,{}),(0,n.jsxs)("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",(0,n.jsx)(Be,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:(0,n.jsx)(gr,{className:"h-3 w-3"})})]}),(0,n.jsxs)("div",{className:"px-2 py-1",children:[(0,n.jsx)(Ae,{"data-testid":a,className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:i,...k,value:et(k.value),onKeyDown:al.stopPropagation()}),S&&(0,n.jsx)(Ys,{value:S,includeSuggestion:!1})]})]}),forRole:h})}),(0,n.jsx)(G,{})]}),(0,n.jsx)(W,{userConfig:s,name:r}),(0,n.jsx)(Ys,{value:S}),c&&(0,n.jsx)(X,{children:c})]})},e[0]=s,e[1]=c,e[2]=h,e[3]=l,e[4]=d,e[5]=r,e[6]=u,e[7]=i,e[8]=a,e[9]=p):p=e[9];let x;return e[10]!==f||e[11]!==l.control||e[12]!==r||e[13]!==p?(x=(0,n.jsx)(O,{control:l.control,name:r,disabled:f,render:p}),e[10]=f,e[11]=l.control,e[12]=r,e[13]=p,e[14]=x):x=e[14],x},Po=t=>{let e=(0,me.c)(10),{form:l,config:s,name:r,options:i,testId:a,disabled:c}=t,o=c===void 0?!1:c,d;e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==a?(d=u=>{let{field:f}=u;return(0,n.jsx)("div",{className:"flex flex-col space-y-1",children:(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Provider"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":a,onChange:p=>{p.target.value==="none"?f.onChange(!1):f.onChange(p.target.value)},value:et(f.value===!0?"github":f.value===!1?"none":f.value),disabled:f.disabled,className:"inline-flex mr-2",children:i.map(Oo)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:r})]})})},e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=d):d=e[4];let h;return e[5]!==o||e[6]!==l.control||e[7]!==r||e[8]!==d?(h=(0,n.jsx)(O,{control:l.control,name:r,disabled:o,render:d}),e[5]=o,e[6]=l.control,e[7]=r,e[8]=d,e[9]=h):h=e[9],h};var Mo=({form:t,config:e,onSubmit:l})=>{let s=t.getValues("completion.copilot");if(s===!1)return null;if(s==="codeium")return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),(0,n.jsx)(De,{form:t,config:e,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]});if(s==="github")return(0,n.jsx)(Hs,{});if(s==="custom")return(0,n.jsx)(Xt,{label:"Autocomplete Model",form:t,config:e,name:"ai.models.autocomplete_model",placeholder:"ollama/qwen2.5-coder:1.5b",testId:"custom-model-input",description:"Model to use for code completion when using a custom provider.",onSubmit:l,forRole:"autocomplete"})},jt=t=>{let e=(0,me.c)(5),{children:l,className:s}=t,r;e[0]===s?r=e[1]:(r=ue("flex flex-col gap-4 pb-4",s),e[0]=s,e[1]=r);let i;return e[2]!==l||e[3]!==r?(i=(0,n.jsx)("div",{className:r,children:l}),e[2]=l,e[3]=r,e[4]=i):i=e[4],i},Ao=t=>{let e=(0,me.c)(23),{qualifiedId:l,model:s,isEnabled:r,onToggle:i,onDelete:a}=t,c;e[0]!==i||e[1]!==l?(c=()=>{i(l)},e[0]=i,e[1]=l,e[2]=c):c=e[2];let o=c,d;e[3]!==a||e[4]!==l?(d=k=>{k.stopPropagation(),k.preventDefault(),a(l)},e[3]=a,e[4]=l,e[5]=d):d=e[5];let h=d,u;e[6]===s?u=e[7]:(u=(0,n.jsx)(Fo,{model:s}),e[6]=s,e[7]=u);let f;e[8]!==h||e[9]!==s.custom?(f=s.custom&&(0,n.jsx)(ie,{variant:"ghost",size:"icon",onClick:h,className:"mr-2 hover:bg-transparent",children:(0,n.jsx)(oi,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[8]=h,e[9]=s.custom,e[10]=f):f=e[10];let p;e[11]!==o||e[12]!==r?(p=(0,n.jsx)(_r,{checked:r,onClick:o,size:"sm"}),e[11]=o,e[12]=r,e[13]=p):p=e[13];let x;e[14]!==u||e[15]!==f||e[16]!==p?(x=(0,n.jsx)($s,{children:(0,n.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b last:border-b-0 cursor-pointer outline-none",children:[u,f,p]})}),e[14]=u,e[15]=f,e[16]=p,e[17]=x):x=e[17];let j;return e[18]!==o||e[19]!==s.name||e[20]!==l||e[21]!==x?(j=(0,n.jsx)(zs,{id:l,textValue:s.name,className:"pl-6 outline-none data-focused:bg-muted/50 hover:bg-muted/50",onAction:o,children:x}),e[18]=o,e[19]=s.name,e[20]=l,e[21]=x,e[22]=j):j=e[22],j},Fo=t=>{let e=(0,me.c)(18),{model:l}=t,s;e[0]===l.name?s=e[1]:(s=(0,n.jsx)("h3",{className:"font-medium text-sm",children:l.name}),e[0]=l.name,e[1]=s);let r;e[2]===l.custom?r=e[3]:(r=l.custom&&(0,n.jsx)(pr,{className:"h-4 w-4"}),e[2]=l.custom,e[3]=r);let i;e[4]===r?i=e[5]:(i=(0,n.jsx)(Be,{content:"Custom model",children:r}),e[4]=r,e[5]=i);let a;e[6]===l.thinking?a=e[7]:(a=l.thinking&&(0,n.jsxs)("div",{className:ue("flex items-center gap-1 rounded px-1 py-0.5 w-fit",Mr("thinking")),children:[(0,n.jsx)(dl,{className:"h-3 w-3"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[6]=l.thinking,e[7]=a);let c;e[8]!==s||e[9]!==i||e[10]!==a?(c=(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[s,i,a]}),e[8]=s,e[9]=i,e[10]=a,e[11]=c):c=e[11];let o;e[12]!==l.custom||e[13]!==l.description?(o=l.description&&!l.custom&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:l.description}),e[12]=l.custom,e[13]=l.description,e[14]=o):o=e[14];let d;return e[15]!==c||e[16]!==o?(d=(0,n.jsxs)("div",{className:"flex flex-col flex-1 gap-0.5",children:[c,o]}),e[15]=c,e[16]=o,e[17]=d):d=e[17],d};const To=t=>{let e=(0,me.c)(13),{form:l,config:s,onSubmit:r}=t,i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)(Je,{children:"Code Completion"}),a=(0,n.jsx)("p",{className:"text-sm text-muted-secondary",children:"Choose GitHub Copilot, Codeium, or a custom provider (such as Ollama) to enable AI-powered code completion."}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["none","github","codeium","custom"],e[2]=c):c=e[2];let o;e[3]!==s||e[4]!==l?(o=(0,n.jsx)(Po,{form:l,config:s,name:"completion.copilot",options:c,testId:"copilot-select"}),e[3]=s,e[4]=l,e[5]=o):o=e[5];let d;e[6]!==s||e[7]!==l||e[8]!==r?(d=Mo({form:l,config:s,onSubmit:r}),e[6]=s,e[7]=l,e[8]=r,e[9]=d):d=e[9];let h;return e[10]!==o||e[11]!==d?(h=(0,n.jsxs)(jt,{children:[i,a,o,d]}),e[10]=o,e[11]=d,e[12]=h):h=e[12],h};var we=t=>{let e=(0,me.c)(15),{title:l,triggerClassName:s,provider:r,children:i,isConfigured:a}=t,c;e[0]===a?c=e[1]:(c=a&&(0,n.jsx)("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=a,e[1]=c);let o;e[2]!==r||e[3]!==c||e[4]!==l?(o=(0,n.jsxs)(Eo,{provider:r,children:[l,c]}),e[2]=r,e[3]=c,e[4]=l,e[5]=o):o=e[5];let d;e[6]!==o||e[7]!==s?(d=(0,n.jsx)($i,{className:s,children:o}),e[6]=o,e[7]=s,e[8]=d):d=e[8];let h;e[9]===i?h=e[10]:(h=(0,n.jsx)(zi,{wrapperClassName:"flex flex-col gap-4",children:i}),e[9]=i,e[10]=h);let u;return e[11]!==r||e[12]!==d||e[13]!==h?(u=(0,n.jsxs)(Ri,{value:r,children:[d,h]}),e[11]=r,e[12]=d,e[13]=h,e[14]=u):u=e[14],u};const $o=t=>{let e=(0,me.c)(108),{form:l,config:s}=t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Me(),e[0]=r):r=e[0];let i=r,a;e[1]===l?a=e[2]:(a=Le=>!!l.getValues(Le),e[1]=l,e[2]=a);let c=a,o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)(ae,{className:"inline",children:"marimo.toml"}),e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:["Add your API keys below or to ",o," ","to set up a provider for the Code Completion and Assistant features; see"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm",children:"docs"})," ","for more info."]}),e[4]=d):d=e[4];let h=c("ai.open_ai.api_key"),u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsxs)(n.Fragment,{children:["Your OpenAI API key from"," ",(0,n.jsx)(oe,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=u):u=e[5];let f,p;e[6]!==s||e[7]!==l?(f=(0,n.jsx)(De,{form:l,config:s,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:u}),p=(0,n.jsx)(Re,{form:l,config:s,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:i}),e[6]=s,e[7]=l,e[8]=f,e[9]=p):(f=e[8],p=e[9]);let x;e[10]!==h||e[11]!==f||e[12]!==p?(x=(0,n.jsxs)(we,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:h,children:[f,p]}),e[10]=h,e[11]=f,e[12]=p,e[13]=x):x=e[13];let j=c("ai.anthropic.api_key"),k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=(0,n.jsxs)(n.Fragment,{children:["Your Anthropic API key from"," ",(0,n.jsx)(oe,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=k):k=e[14];let S;e[15]!==s||e[16]!==l?(S=(0,n.jsx)(De,{form:l,config:s,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:k}),e[15]=s,e[16]=l,e[17]=S):S=e[17];let I;e[18]!==j||e[19]!==S?(I=(0,n.jsx)(we,{title:"Anthropic",provider:"anthropic",isConfigured:j,children:S}),e[18]=j,e[19]=S,e[20]=I):I=e[20];let v=c("ai.google.api_key"),N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=(0,n.jsxs)(n.Fragment,{children:["Your Google AI API key from"," ",(0,n.jsx)(oe,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=N):N=e[21];let A;e[22]!==s||e[23]!==l?(A=(0,n.jsx)(De,{form:l,config:s,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:N}),e[22]=s,e[23]=l,e[24]=A):A=e[24];let b;e[25]!==v||e[26]!==A?(b=(0,n.jsx)(we,{title:"Google",provider:"google",isConfigured:v,children:A}),e[25]=v,e[26]=A,e[27]=b):b=e[27];let $=c("ai.ollama.base_url"),E;e[28]!==s||e[29]!==l?(E=(0,n.jsx)(Re,{form:l,config:s,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",defaultValue:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=s,e[29]=l,e[30]=E):E=e[30];let K;e[31]!==$||e[32]!==E?(K=(0,n.jsx)(we,{title:"Ollama",provider:"ollama",isConfigured:$,children:E}),e[31]=$,e[32]=E,e[33]=K):K=e[33];let P=c("ai.github.api_key"),z;e[34]===Symbol.for("react.memo_cache_sentinel")?(z=(0,n.jsxs)(n.Fragment,{children:["Your GitHub API token from"," ",(0,n.jsx)(ae,{className:"inline",children:"gh auth token"}),"."]}),e[34]=z):z=e[34];let V,T;e[35]!==s||e[36]!==l?(V=(0,n.jsx)(De,{form:l,config:s,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:z}),T=(0,n.jsx)(Re,{form:l,config:s,name:"ai.github.base_url",placeholder:"https://api.githubcopilot.com/",testId:"ai-github-base-url-input"}),e[35]=s,e[36]=l,e[37]=V,e[38]=T):(V=e[37],T=e[38]);let w;e[39]!==P||e[40]!==V||e[41]!==T?(w=(0,n.jsxs)(we,{title:"GitHub",provider:"github",isConfigured:P,children:[V,T]}),e[39]=P,e[40]=V,e[41]=T,e[42]=w):w=e[42];let y=c("ai.openrouter.api_key"),M;e[43]===Symbol.for("react.memo_cache_sentinel")?(M=(0,n.jsxs)(n.Fragment,{children:["Your OpenRouter API key from ","",(0,n.jsx)(oe,{href:"https://openrouter.ai/keys",children:"openrouter.ai"}),"."]}),e[43]=M):M=e[43];let R,B;e[44]!==s||e[45]!==l?(R=(0,n.jsx)(De,{form:l,config:s,name:"ai.openrouter.api_key",placeholder:"or-...",testId:"ai-openrouter-api-key-input",description:M}),B=(0,n.jsx)(Re,{form:l,config:s,name:"ai.openrouter.base_url",placeholder:"https://openrouter.ai/api/v1/",testId:"ai-openrouter-base-url-input"}),e[44]=s,e[45]=l,e[46]=R,e[47]=B):(R=e[46],B=e[47]);let Y;e[48]!==y||e[49]!==R||e[50]!==B?(Y=(0,n.jsxs)(we,{title:"OpenRouter",provider:"openrouter",isConfigured:y,children:[R,B]}),e[48]=y,e[49]=R,e[50]=B,e[51]=Y):Y=e[51];let C=c("ai.wandb.api_key"),Z;e[52]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,n.jsxs)(n.Fragment,{children:["Your Weights & Biases API key from"," ",(0,n.jsx)(oe,{href:"https://wandb.ai/authorize",children:"wandb.ai"}),"."]}),e[52]=Z):Z=e[52];let Q,ee;e[53]!==s||e[54]!==l?(Q=(0,n.jsx)(De,{form:l,config:s,name:"ai.wandb.api_key",placeholder:"your-wandb-api-key",testId:"ai-wandb-api-key-input",description:Z}),ee=(0,n.jsx)(Re,{form:l,config:s,name:"ai.wandb.base_url",placeholder:"https://api.inference.wandb.ai/v1/",testId:"ai-wandb-base-url-input"}),e[53]=s,e[54]=l,e[55]=Q,e[56]=ee):(Q=e[55],ee=e[56]);let D;e[57]!==C||e[58]!==Q||e[59]!==ee?(D=(0,n.jsxs)(we,{title:"Weights & Biases",provider:"wandb",isConfigured:C,children:[Q,ee]}),e[57]=C,e[58]=Q,e[59]=ee,e[60]=D):D=e[60];let g=c("ai.azure.api_key")&&c("ai.azure.base_url"),_;e[61]===Symbol.for("react.memo_cache_sentinel")?(_=(0,n.jsxs)(n.Fragment,{children:["Your Azure API key from"," ",(0,n.jsx)(oe,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[61]=_):_=e[61];let J,te;e[62]!==s||e[63]!==l?(J=(0,n.jsx)(De,{form:l,config:s,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:_}),te=(0,n.jsx)(Re,{form:l,config:s,name:"ai.azure.base_url",placeholder:"https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>",defaultValue:"https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>",testId:"ai-azure-base-url-input"}),e[62]=s,e[63]=l,e[64]=J,e[65]=te):(J=e[64],te=e[65]);let le;e[66]!==g||e[67]!==J||e[68]!==te?(le=(0,n.jsxs)(we,{title:"Azure",provider:"azure",isConfigured:g,children:[J,te]}),e[66]=g,e[67]=J,e[68]=te,e[69]=le):le=e[69];let F=c("ai.bedrock.region_name"),ne;e[70]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,n.jsxs)("p",{className:"text-sm text-muted-secondary mb-2",children:["To use AWS Bedrock, you need to configure AWS credentials and region. See the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[70]=ne):ne=e[70];let se;e[71]===s?se=e[72]:(se=Le=>{let{field:Pe}=Le;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"AWS Region"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"bedrock-region-select",onChange:ur=>Pe.onChange(ur.target.value),value:typeof Pe.value=="string"?Pe.value:"us-east-1",disabled:Pe.disabled,className:"inline-flex mr-2",children:yo.map(Ho)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:"ai.bedrock.region_name"})]}),(0,n.jsx)(X,{children:"The AWS region where Bedrock service is available."})]})},e[71]=s,e[72]=se);let ce;e[73]!==l.control||e[74]!==se?(ce=(0,n.jsx)(O,{control:l.control,disabled:i,name:"ai.bedrock.region_name",render:se}),e[73]=l.control,e[74]=se,e[75]=ce):ce=e[75];let xe;e[76]===s?xe=e[77]:(xe=Le=>{let{field:Pe}=Le;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"AWS Profile Name (Optional)"}),(0,n.jsx)(U,{children:(0,n.jsx)(Ae,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...Pe,value:Pe.value||""})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:"ai.bedrock.profile_name"})]}),(0,n.jsx)(X,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[76]=s,e[77]=xe);let Ce;e[78]!==l.control||e[79]!==xe?(Ce=(0,n.jsx)(O,{control:l.control,disabled:i,name:"ai.bedrock.profile_name",render:xe}),e[78]=l.control,e[79]=xe,e[80]=Ce):Ce=e[80];let ye;e[81]!==F||e[82]!==ce||e[83]!==Ce?(ye=(0,n.jsxs)(we,{title:"AWS Bedrock",provider:"bedrock",isConfigured:F,children:[ne,ce,Ce]}),e[81]=F,e[82]=ce,e[83]=Ce,e[84]=ye):ye=e[84];let _e=c("ai.open_ai_compatible.api_key")&&c("ai.open_ai_compatible.base_url"),ve;e[85]===Symbol.for("react.memo_cache_sentinel")?(ve=(0,n.jsx)(n.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[85]=ve):ve=e[85];let pe;e[86]!==s||e[87]!==l?(pe=(0,n.jsx)(De,{form:l,config:s,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:ve}),e[86]=s,e[87]=l,e[88]=pe):pe=e[88];let be;e[89]===Symbol.for("react.memo_cache_sentinel")?(be=(0,n.jsx)(n.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[89]=be):be=e[89];let je;e[90]!==s||e[91]!==l?(je=(0,n.jsx)(Re,{form:l,config:s,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:be}),e[90]=s,e[91]=l,e[92]=je):je=e[92];let de;e[93]!==_e||e[94]!==pe||e[95]!==je?(de=(0,n.jsxs)(we,{title:"OpenAI-Compatible",provider:"openai-compatible",isConfigured:_e,children:[pe,je]}),e[93]=_e,e[94]=pe,e[95]=je,e[96]=de):de=e[96];let tt;return e[97]!==I||e[98]!==b||e[99]!==K||e[100]!==w||e[101]!==Y||e[102]!==D||e[103]!==le||e[104]!==ye||e[105]!==de||e[106]!==x?(tt=(0,n.jsxs)(jt,{children:[d,(0,n.jsxs)(Bi,{type:"multiple",children:[x,I,b,K,w,Y,D,le,ye,de]})]}),e[97]=I,e[98]=b,e[99]=K,e[100]=w,e[101]=Y,e[102]=D,e[103]=le,e[104]=ye,e[105]=de,e[106]=x,e[107]=tt):tt=e[107],tt},Ro=t=>{let e=(0,me.c)(26),{form:l,config:s,onSubmit:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Me(),e[0]=i):i=e[0];let a=i,c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(Je,{children:"AI Assistant"}),e[1]=c):c=e[1];let o;e[2]===l.control?o=e[3]:(o=(0,n.jsx)(O,{control:l.control,name:"ai.inline_tooltip",render:Uo}),e[2]=l.control,e[3]=o);let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)(ai,{}),e[4]=d):d=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)("span",{children:"Model to use for chat conversations in the Chat panel."}),e[5]=h):h=e[5];let u;e[6]!==s||e[7]!==l||e[8]!==r?(u=(0,n.jsx)(Xt,{label:"Chat Model",form:l,config:s,name:"ai.models.chat_model",placeholder:il,testId:"ai-chat-model-input",disabled:a,description:h,forRole:"chat",onSubmit:r}),e[6]=s,e[7]=l,e[8]=r,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsxs)("span",{children:["Model to use for code editing with the"," ",(0,n.jsx)(ae,{className:"inline",children:"Generate with AI"})," button."]}),e[10]=f):f=e[10];let p;e[11]!==s||e[12]!==l||e[13]!==r?(p=(0,n.jsx)(Xt,{label:"Edit Model",form:l,config:s,name:"ai.models.edit_model",placeholder:il,testId:"ai-edit-model-input",disabled:a,description:f,forRole:"edit",onSubmit:r}),e[11]=s,e[12]=l,e[13]=r,e[14]=p):p=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=(0,n.jsxs)("ul",{className:"bg-muted p-2 rounded-md list-disc space-y-1 pl-6",children:[(0,n.jsx)("li",{className:"text-xs text-muted-secondary",children:'Models should include the provider name and model name separated by a slash. For example, "anthropic/claude-3-5-sonnet-latest" or "google/gemini-2.0-flash-exp"'}),(0,n.jsx)("li",{className:"text-xs text-muted-secondary",children:"Depending on the provider, we will use the respective API key and additional configuration."})]}),e[15]=x):x=e[15];let j;e[16]===s?j=e[17]:(j=I=>{let{field:v}=I;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)(H,{children:[(0,n.jsx)(L,{children:"Custom Rules"}),(0,n.jsx)(U,{children:(0,n.jsx)(ii,{"data-testid":"ai-rules-input",className:"m-0 inline-flex w-full h-32 p-2 text-sm",placeholder:"e.g. Always use type hints; prefer polars over pandas",...v,value:v.value})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:"ai.rules"})]}),(0,n.jsx)(X,{children:"Custom rules to include in all AI completion prompts."})]})},e[16]=s,e[17]=j);let k;e[18]!==l.control||e[19]!==j?(k=(0,n.jsx)(O,{control:l.control,name:"ai.rules",render:j}),e[18]=l.control,e[19]=j,e[20]=k):k=e[20];let S;return e[21]!==k||e[22]!==o||e[23]!==u||e[24]!==p?(S=(0,n.jsxs)(jt,{children:[c,o,d,u,p,x,k]}),e[21]=k,e[22]=o,e[23]=u,e[24]=p,e[25]=S):S=e[25],S};var Bo=t=>{let e=(0,me.c)(51),{providerId:l,models:s,enabledModels:r,onToggleModel:i,onToggleProvider:a,onDeleteModel:c}=t,o;if(e[0]!==r||e[1]!==s||e[2]!==l){let V;e[4]!==r||e[5]!==l?(V=T=>r.has(new qe(l,T.model).id),e[4]=r,e[5]=l,e[6]=V):V=e[6],o=s.filter(V),e[0]=r,e[1]=s,e[2]=l,e[3]=o}else o=e[3];let d=o.length,h=s.length,u;e[7]===l?u=e[8]:(u=cl.getProviderInfo(l),e[7]=l,e[8]=u);let f=u,p;e[9]!==(f==null?void 0:f.name)||e[10]!==l?(p=(f==null?void 0:f.name)||hr.startCase(l),e[9]=f==null?void 0:f.name,e[10]=l,e[11]=p):p=e[11];let x=p,j=d===0?!1:d===h?!0:"indeterminate",k;e[12]!==d||e[13]!==a||e[14]!==l||e[15]!==h?(k=()=>{a(l,d<h/2)},e[12]=d,e[13]=a,e[14]=l,e[15]=h,e[16]=k):k=e[16];let S=nt(k),I;e[17]===Symbol.for("react.memo_cache_sentinel")?(I=al.stopPropagation(),e[17]=I):I=e[17];let v;e[18]!==j||e[19]!==S?(v=(0,n.jsx)(re,{checked:j,onCheckedChange:S,onClick:I}),e[18]=j,e[19]=S,e[20]=v):v=e[20];let N;e[21]===l?N=e[22]:(N=(0,n.jsx)(Ue,{provider:l,className:"h-5 w-5"}),e[21]=l,e[22]=N);let A;e[23]===x?A=e[24]:(A=(0,n.jsx)("h2",{className:"font-semibold",children:x}),e[23]=x,e[24]=A);let b;e[25]!==d||e[26]!==h?(b=(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:[d,"/",h," models"]}),e[25]=d,e[26]=h,e[27]=b):b=e[27];let $;e[28]!==A||e[29]!==b?($=(0,n.jsxs)("div",{className:"flex items-center justify-between w-full",children:[A,b]}),e[28]=A,e[29]=b,e[30]=$):$=e[30];let E;e[31]===Symbol.for("react.memo_cache_sentinel")?(E=(0,n.jsx)(Jr,{slot:"chevron",children:(0,n.jsx)(Vr,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-expanded:rotate-90"})}),e[31]=E):E=e[31];let K;e[32]!==$||e[33]!==v||e[34]!==N?(K=(0,n.jsx)($s,{children:(0,n.jsxs)("div",{className:"flex items-center gap-3 px-2 py-3 hover:bg-muted/50 cursor-pointer outline-none focus-visible:outline-none border-b group-data-expanded:border-b-0 rounded-sm",children:[v,N,$,E]})}),e[32]=$,e[33]=v,e[34]=N,e[35]=K):K=e[35];let P;if(e[36]!==r||e[37]!==s||e[38]!==c||e[39]!==i||e[40]!==l){let V;e[42]!==r||e[43]!==c||e[44]!==i||e[45]!==l?(V=T=>{let w=new qe(l,T.model).id;return(0,n.jsx)(Ao,{qualifiedId:w,model:T,isEnabled:r.has(w),onToggle:i,onDelete:c},w)},e[42]=r,e[43]=c,e[44]=i,e[45]=l,e[46]=V):V=e[46],P=s.map(V),e[36]=r,e[37]=s,e[38]=c,e[39]=i,e[40]=l,e[41]=P}else P=e[41];let z;return e[47]!==l||e[48]!==K||e[49]!==P?(z=(0,n.jsxs)(zs,{id:l,hasChildItems:!0,textValue:l,className:"outline-none data-focused:bg-muted/50 group",children:[K,P]}),e[47]=l,e[48]=K,e[49]=P,e[50]=z):z=e[50],z};const zo=({form:t,onSubmit:e})=>{let l=yl({control:t.control,name:"ai.models.custom_models"}),s=(0,m.useMemo)(()=>cl.create({displayedModels:[],customModels:l}),[l]),r=yl({control:t.control,name:"ai.models.displayed_models",defaultValue:[]}),i=new Set(r),a=s.getGroupedModelsByProvider(),c=s.getListModelsByProvider(),o=nt(u=>{let f=i.has(u)?r.filter(p=>p!==u):[...r,u];t.setValue("ai.models.displayed_models",f),e(t.getValues())}),d=nt(async(u,f)=>{let p=a.get(u)||[],x=new Set(p.map(k=>new qe(u,k.model).id)),j=f?[...new Set([...r,...x])]:r.filter(k=>!x.has(k));t.setValue("ai.models.displayed_models",j),e(t.getValues())}),h=nt(u=>{let f=l.filter(p=>p!==u);t.setValue("ai.models.custom_models",f),e(t.getValues())});return(0,n.jsxs)(jt,{className:"gap-2",children:[(0,n.jsx)("p",{className:"text-sm text-muted-secondary",children:"Control which AI models are displayed in model selection dropdowns. When no models are selected, all available models will be shown."}),(0,n.jsx)("div",{className:"bg-background",children:(0,n.jsx)(Ya,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-none focus-visible:outline-none",selectionMode:"none",children:c.map(([u,f])=>(0,n.jsx)(Bo,{providerId:u,models:f,enabledModels:i,onToggleModel:o,onToggleProvider:d,onDeleteModel:h},u))})}),(0,n.jsx)(Vo,{form:t,customModels:l,onSubmit:e})]})},Vo=t=>{let e=(0,me.c)(70),{form:l,customModels:s,onSubmit:r}=t,[i,a]=(0,m.useState)(!1),[c,o]=(0,m.useState)(!1),[d,h]=(0,m.useState)(null),[u,f]=(0,m.useState)(""),[p,x]=(0,m.useState)(""),j=(0,m.useId)(),k=(0,m.useId)(),S=(0,m.useId)(),I=d==="custom",v=I?u:d,N;e[0]!==p||e[1]!==v?(N=(v==null?void 0:v.trim())&&(p==null?void 0:p.trim()),e[0]=p,e[1]=v,e[2]=N):N=e[2];let A=N,b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{h(null),f(""),x(""),a(!1)},e[3]=b):b=e[3];let $=b,E;e[4]!==s||e[5]!==l||e[6]!==A||e[7]!==p||e[8]!==r||e[9]!==v?(E=()=>{if(!A)return;let de=new qe(v,p);l.setValue("ai.models.custom_models",[de.id,...s]),r(l.getValues()),$(),o(!0),setTimeout(()=>o(!1),2e3)},e[4]=s,e[5]=l,e[6]=A,e[7]=p,e[8]=r,e[9]=v,e[10]=E):E=e[10];let K=E,P;e[11]===j?P=e[12]:(P=(0,n.jsx)(Te,{htmlFor:j,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[11]=j,e[12]=P);let z=d||"",V;e[13]===Symbol.for("react.memo_cache_sentinel")?(V=de=>h(de),e[13]=V):V=e[13];let T;e[14]===d?T=e[15]:(T=d?(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(Ue,{provider:d,className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{children:ul(d)})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"Select..."}),e[14]=d,e[15]=T);let w;e[16]!==j||e[17]!==T?(w=(0,n.jsx)(Br,{id:j,className:"w-40 truncate",children:T}),e[16]=j,e[17]=T,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=(0,n.jsx)($r,{children:(0,n.jsxs)(Rr,{children:[(0,n.jsx)(ml,{value:"custom",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Ue,{provider:"openai-compatible",className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Custom"})]})}),Ar.filter(qo).map(Wo)]})}),e[19]=y):y=e[19];let M;e[20]!==z||e[21]!==w?(M=(0,n.jsxs)(zr,{value:z,onValueChange:V,children:[w,y]}),e[20]=z,e[21]=w,e[22]=M):M=e[22];let R;e[23]!==M||e[24]!==P?(R=(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[P,M]}),e[23]=M,e[24]=P,e[25]=R):R=e[25];let B;e[26]!==k||e[27]!==u||e[28]!==I?(B=I&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Te,{htmlFor:k,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),(0,n.jsx)(Ae,{id:k,value:u,onChange:de=>f(de.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[26]=k,e[27]=u,e[28]=I,e[29]=B):B=e[29];let Y;e[30]!==R||e[31]!==B?(Y=(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[R,B]}),e[30]=R,e[31]=B,e[32]=Y):Y=e[32];let C=Y,Z=I&&"self-start",Q;e[33]===Z?Q=e[34]:(Q=ue("flex items-center gap-2",Z),e[33]=Z,e[34]=Q);let ee;e[35]===S?ee=e[36]:(ee=(0,n.jsx)(Te,{htmlFor:S,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[35]=S,e[36]=ee);let D;e[37]===Symbol.for("react.memo_cache_sentinel")?(D=de=>x(de.target.value),e[37]=D):D=e[37];let g;e[38]!==p||e[39]!==S?(g=(0,n.jsx)(Ae,{id:S,value:p,onChange:D,placeholder:"gpt-4",className:"text-xs mb-0"}),e[38]=p,e[39]=S,e[40]=g):g=e[40];let _;e[41]!==Q||e[42]!==ee||e[43]!==g?(_=(0,n.jsxs)("div",{className:Q,children:[ee,g]}),e[41]=Q,e[42]=ee,e[43]=g,e[44]=_):_=e[44];let J=_,te=I&&"self-end",le;e[45]===te?le=e[46]:(le=ue("flex gap-1.5 ml-auto",te),e[45]=te,e[46]=le);let F=!A,ne;e[47]!==K||e[48]!==F?(ne=(0,n.jsx)(ie,{onClick:K,disabled:F,size:"xs",children:"Add"}),e[47]=K,e[48]=F,e[49]=ne):ne=e[49];let se;e[50]===Symbol.for("react.memo_cache_sentinel")?(se=(0,n.jsx)(ie,{variant:"outline",onClick:$,size:"xs",children:"Cancel"}),e[50]=se):se=e[50];let ce;e[51]!==le||e[52]!==ne?(ce=(0,n.jsxs)("div",{className:le,children:[ne,se]}),e[51]=le,e[52]=ne,e[53]=ce):ce=e[53];let xe;e[54]!==J||e[55]!==C||e[56]!==ce?(xe=(0,n.jsxs)("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[C,J,ce]}),e[54]=J,e[55]=C,e[56]=ce,e[57]=xe):xe=e[57];let Ce=i&&xe,ye;e[58]===Symbol.for("react.memo_cache_sentinel")?(ye=de=>{de.preventDefault(),a(!0)},e[58]=ye):ye=e[58];let _e;e[59]===Symbol.for("react.memo_cache_sentinel")?(_e=(0,n.jsx)(qr,{className:"h-4 w-4 mr-2 mb-0.5"}),e[59]=_e):_e=e[59];let ve;e[60]===i?ve=e[61]:(ve=(0,n.jsxs)(ie,{onClick:ye,variant:"link",disabled:i,children:[_e,"Add Model"]}),e[60]=i,e[61]=ve);let pe;e[62]===c?pe=e[63]:(pe=c&&(0,n.jsx)("div",{className:"flex items-center gap-1 text-green-700 bg-green-500/10 px-2 py-1 rounded-md ml-auto",children:"\u2713 Model added"}),e[62]=c,e[63]=pe);let be;e[64]!==ve||e[65]!==pe?(be=(0,n.jsxs)("div",{className:"flex flex-row text-sm",children:[ve,pe]}),e[64]=ve,e[65]=pe,e[66]=be):be=e[66];let je;return e[67]!==Ce||e[68]!==be?(je=(0,n.jsxs)("div",{children:[Ce,be]}),e[67]=Ce,e[68]=be,e[69]=je):je=e[69],je},Lo=t=>{let e=(0,me.c)(22),{form:l,config:s,onSubmit:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Me(),e[0]=i):i=e[0];let a=i,c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsxs)(Dl,{className:"mb-2",children:[(0,n.jsx)(Xe,{value:"ai-features",children:"AI Features"}),(0,n.jsx)(Xe,{value:"ai-providers",children:"AI Providers"}),(0,n.jsx)(Xe,{value:"ai-models",children:"AI Models"}),!a&&(0,n.jsx)(Xe,{value:"mcp",children:"MCP"})]}),e[1]=c):c=e[1];let o;e[2]!==s||e[3]!==l||e[4]!==r?(o=(0,n.jsxs)(pt,{value:"ai-features",children:[(0,n.jsx)(To,{form:l,config:s,onSubmit:r}),(0,n.jsx)(Ro,{form:l,config:s,onSubmit:r})]}),e[2]=s,e[3]=l,e[4]=r,e[5]=o):o=e[5];let d;e[6]!==s||e[7]!==l||e[8]!==r?(d=(0,n.jsx)(pt,{value:"ai-providers",children:(0,n.jsx)($o,{form:l,config:s,onSubmit:r})}),e[6]=s,e[7]=l,e[8]=r,e[9]=d):d=e[9];let h;e[10]!==s||e[11]!==l||e[12]!==r?(h=(0,n.jsx)(pt,{value:"ai-models",children:(0,n.jsx)(zo,{form:l,config:s,onSubmit:r})}),e[10]=s,e[11]=l,e[12]=r,e[13]=h):h=e[13];let u;e[14]!==l||e[15]!==r?(u=!a&&(0,n.jsx)(pt,{value:"mcp",children:(0,n.jsx)(Do,{form:l,onSubmit:r})}),e[14]=l,e[15]=r,e[16]=u):u=e[16];let f;return e[17]!==o||e[18]!==d||e[19]!==h||e[20]!==u?(f=(0,n.jsxs)(_l,{defaultValue:"ai-features",className:"flex-1",children:[c,o,d,h,u]}),e[17]=o,e[18]=d,e[19]=h,e[20]=u,e[21]=f):f=e[21],f};function Oo(t){return(0,n.jsx)("option",{value:t,children:t},t)}function Ho(t){return(0,n.jsx)("option",{value:t,children:t},t)}function Uo(t){let{field:e}=t;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"AI Edit Tooltip"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,n.jsx)(X,{children:'Enable "Edit with AI" tooltip when selecting code.'})]})}function qo(t){return t!=="marimo"}function Wo(t){return(0,n.jsx)(ml,{value:t,children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Ue,{provider:t,className:"h-4 w-4"}),(0,n.jsx)("span",{children:ul(t)})]})},t)}var Go=he(),Yo=["auto","true","false"];const Xo=t=>{let e=(0,Go.c)(47),{form:l,config:s,onSubmit:r}=t,i;e[0]!==s||e[1]!==l.control?(i=(E,K)=>(0,n.jsx)(O,{control:l.control,name:E,render:P=>{let{field:z}=P,V=T=>{let w=T.target.value;z.onChange(w==="true"?!0:w==="false"?!1:w)};return(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"text-sm font-normal w-16",children:K}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"auto-discover-schemas-select",onChange:V,value:z.value===void 0?"auto":z.value.toString(),disabled:z.disabled,className:"w-[100px]",children:Yo.map(Zo)})}),(0,n.jsx)(W,{userConfig:s,name:E})]})}}),e[0]=s,e[1]=l.control,e[2]=i):i=e[2];let a=i,c;e[3]===s?c=e[4]:(c=E=>{let{field:K}=E;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Dataframe viewer"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"display-dataframes-select",onChange:P=>K.onChange(P.target.value),value:K.value,disabled:K.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(Qo)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:"display.dataframes"})]}),(0,n.jsx)(X,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})},e[3]=s,e[4]=c);let o;e[5]!==l.control||e[6]!==c?(o=(0,n.jsx)(O,{control:l.control,name:"display.dataframes",render:c}),e[5]=l.control,e[6]=c,e[7]=o):o=e[7];let d;e[8]!==s||e[9]!==l||e[10]!==r?(d=E=>{let{field:K}=E;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Default table page size"}),(0,n.jsx)(U,{children:(0,n.jsx)(Ge,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...K,value:K.value,minValue:1,step:1,onChange:P=>{K.onChange(P),Number.isNaN(P)||r(l.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:"display.default_table_page_size"})]}),(0,n.jsx)(X,{children:"The default number of rows displayed in dataframes and SQL results."})]})},e[8]=s,e[9]=l,e[10]=r,e[11]=d):d=e[11];let h;e[12]!==l.control||e[13]!==d?(h=(0,n.jsx)(O,{control:l.control,name:"display.default_table_page_size",render:d}),e[12]=l.control,e[13]=d,e[14]=h):h=e[14];let u;e[15]!==s||e[16]!==l||e[17]!==r?(u=E=>{let{field:K}=E;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Default table max columns"}),(0,n.jsx)(U,{children:(0,n.jsx)(Ge,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...K,value:K.value,minValue:1,step:1,onChange:P=>{K.onChange(P),Number.isNaN(P)||r(l.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:"display.default_table_max_columns"})]}),(0,n.jsx)(X,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})},e[15]=s,e[16]=l,e[17]=r,e[18]=u):u=e[18];let f;e[19]!==l.control||e[20]!==u?(f=(0,n.jsx)(O,{control:l.control,name:"display.default_table_max_columns",render:u}),e[19]=l.control,e[20]=u,e[21]=f):f=e[21];let p;e[22]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)("div",{className:"text-sm text-foreground",children:"Database Schema Discovery"}),e[22]=p):p=e[22];let x,j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=(0,n.jsx)("br",{}),x=(0,n.jsx)("span",{className:"font-semibold",children:"Can be expensive for large databases."}),e[23]=x,e[24]=j):(x=e[23],j=e[24]);let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=(0,n.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["Whether database schemas, tables, and columns are automatically discovered.",j,x," ","Use 'auto' to determine introspection based on the"," ",(0,n.jsx)("a",{className:"text-link hover:underline",rel:"noopener noreferrer",target:"_blank",href:"https://docs.marimo.io/guides/working_with_data/sql/?h=database#database-schema-and-table-auto-discovery",children:"database"}),"."]}),e[25]=k):k=e[25];let S;e[26]===a?S=e[27]:(S=(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[p,k,a("datasources.auto_discover_schemas","Schemas"),a("datasources.auto_discover_tables","Tables"),a("datasources.auto_discover_columns","Columns")]}),e[26]=a,e[27]=S);let I;e[28]===s?I=e[29]:(I=E=>{let{field:K}=E;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"SQL Linter"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"sql-linter-checkbox",checked:K.value,onCheckedChange:K.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:"diagnostics.sql_linter"})]}),(0,n.jsx)(X,{children:"Better linting and autocompletions for SQL cells."})]})},e[28]=s,e[29]=I);let v;e[30]!==l.control||e[31]!==I?(v=(0,n.jsx)(O,{control:l.control,name:"diagnostics.sql_linter",render:I}),e[30]=l.control,e[31]=I,e[32]=v):v=e[32];let N;e[33]===s?N=e[34]:(N=E=>{let{field:K}=E;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Default SQL output"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"user-config-sql-output-select",onChange:P=>K.onChange(P.target.value),value:K.value,disabled:K.disabled,className:"inline-flex mr-2",children:Gs.map(Jo)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:s,name:"runtime.default_sql_output"})]}),(0,n.jsx)(X,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})},e[33]=s,e[34]=N);let A;e[35]!==l.control||e[36]!==N?(A=(0,n.jsx)(O,{control:l.control,name:"runtime.default_sql_output",render:N}),e[35]=l.control,e[36]=N,e[37]=A):A=e[37];let b;e[38]!==S||e[39]!==v||e[40]!==A?(b=(0,n.jsxs)(ge,{title:"SQL",children:[S,v,A]}),e[38]=S,e[39]=v,e[40]=A,e[41]=b):b=e[41];let $;return e[42]!==b||e[43]!==o||e[44]!==h||e[45]!==f?($=(0,n.jsxs)(n.Fragment,{children:[o,h,f,b]}),e[42]=b,e[43]=o,e[44]=h,e[45]=f,e[46]=$):$=e[46],$};function Zo(t){return(0,n.jsx)("option",{value:t,children:t},t)}function Qo(t){return(0,n.jsx)("option",{value:t,children:t},t)}function Jo(t){return(0,n.jsx)("option",{value:t.value,children:t.label},t.value)}var ec=he(),sr=[{id:"sql",packagesRequired:[{name:"duckdb"},{name:"sqlglot"}],additionalPackageInstalls:[{name:"polars[pyarrow]"}],description:"SQL cells"},{id:"charts",packagesRequired:[{name:"altair"}],additionalPackageInstalls:[],description:"Charts in datasource viewer"},{id:"fast-charts",packagesRequired:[{name:"vegafusion"},{name:"vl-convert-python"}],additionalPackageInstalls:[],description:"Fast server-side charts"},{id:"formatting",packagesRequired:[Me()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"mcp",packagesRequired:[{name:"mcp",minVersion:"1"}],additionalPackageInstalls:[{name:"pydantic",minVersion:"2"}],description:"Connect to MCP servers"},{id:"ipy-export",packagesRequired:[{name:"nbformat"}],additionalPackageInstalls:[],description:"Export as IPYNB"},{id:"testing",packagesRequired:[{name:"pytest"}],additionalPackageInstalls:[],description:"Autorun unit tests"}];Me()||sr.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const tc=()=>{let t=(0,ec.c)(21),[e]=rl(),l=e.package_management.manager,{getPackageList:s}=st(),r;t[0]===s?r=t[1]:(r=()=>s(),t[0]=s,t[1]=r);let i;t[2]===l?i=t[3]:(i=[l],t[2]=l,t[3]=i);let{data:a,error:c,refetch:o,isPending:d}=El(r,i);if(d){let v;return t[4]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsx)(hl,{size:"medium",centered:!0}),t[4]=v):v=t[4],v}if(c){let v;return t[5]===c?v=t[6]:(v=(0,n.jsx)(Fi,{error:c}),t[5]=c,t[6]=v),v}let h;if(t[7]!==(a==null?void 0:a.packages)){let v=(a==null?void 0:a.packages)||[];h=new Set(v.map(nc)),t[7]=a==null?void 0:a.packages,t[8]=h}else h=t[8];let u=h,f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(Je,{children:"Optional Features"}),t[9]=f):f=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",(0,n.jsx)("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=p):p=t[10];let x;t[11]===Symbol.for("react.memo_cache_sentinel")?(x=(0,n.jsx)(Hi,{children:(0,n.jsxs)(Pl,{children:[(0,n.jsx)(ft,{children:"Dependency"}),(0,n.jsx)(ft,{children:"Feature"}),(0,n.jsx)(ft,{children:"Status"}),(0,n.jsx)(ft,{})]})}),t[11]=x):x=t[11];let j;t[12]!==u||t[13]!==l||t[14]!==o?(j=sr.map(v=>{let N=v.packagesRequired.every(b=>u.has(b.name.split("[")[0])),A=v.packagesRequired.map(sc).join(", ");return(0,n.jsxs)(Pl,{className:"text-sm",children:[(0,n.jsx)(Mt,{children:v.description}),(0,n.jsx)(Mt,{className:"font-mono text-xs",children:A}),(0,n.jsx)(Mt,{children:N?(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(Lr,{className:"h-4 w-4 text-(--grass-10) mr-2"}),(0,n.jsx)("span",{children:"Installed"})]}):(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(xr,{className:"h-4 w-4 text-(--red-10) mr-2"}),(0,n.jsx)(lc,{packageSpecs:[...v.packagesRequired,...v.additionalPackageInstalls],packageManager:l,onSuccess:o})]})})]},v.id)}),t[12]=u,t[13]=l,t[14]=o,t[15]=j):j=t[15];let k;t[16]===j?k=t[17]:(k=(0,n.jsxs)(qi,{children:[x,(0,n.jsx)(Ui,{children:j})]}),t[16]=j,t[17]=k);let S;t[18]===Symbol.for("react.memo_cache_sentinel")?(S=(0,n.jsx)("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=S):S=t[18];let I;return t[19]===k?I=t[20]:(I=(0,n.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[f,p,k,S]}),t[19]=k,t[20]=I),I};var lc=({packageSpecs:t,packageManager:e,onSuccess:l})=>{let[s,r]=m.useState(!1),{addPackage:i}=st();return(0,n.jsxs)(ie,{size:"xs",variant:"outline",className:ue("text-xs",s&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{r(!0);let a=await i({package:t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),dev:!0});a.success?(l(),Ne({title:"Package installed",description:(0,n.jsxs)("span",{children:["The packages"," ",(0,n.jsx)(ae,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):Ne({title:"Failed to install package",description:a.error,variant:"danger"})}finally{r(!1)}},disabled:s,children:[s?(0,n.jsx)(hl,{size:"small",className:"mr-2 h-3 w-3"}):(0,n.jsx)(vr,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function nc(t){return t.name}function sc(t){return t.name}var rc=he();function Zt(t,e){let l={};for(let s of Object.keys(e)){let r=e[s];if(r===!0)l[s]=t[s];else if(typeof r=="object"&&r){let i=Zt(t[s],r);Object.keys(i).length>0&&(l[s]=i)}}return l}var rr=[{id:"editor",label:"Editor",Icon:vl,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:Gi,className:"bg-(--grass-4)"},{id:"packageManagementAndData",label:"Packages & Data",Icon:fr,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:Ml,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:dl,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Al,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:Wi,className:"bg-(--slate-4)"}];const ir=Ct(rr[0].id);var ic=100,Qt="__system__";const ac=()=>{let t=(0,rc.c)(53),[e,l]=sl(),s=(0,m.useRef)(null),r=kt(Gt),[i,a]=lt(ir),c=Oe(yr);Oe(di).mode==="home"&&(c={terminal:!0,pylsp:!0,ty:!0,basedpyright:!0});let o=Oe(Dr),{locale:d}=mt(),{saveUserConfig:h}=st(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=ri(Sr),t[0]=u):u=t[0];let f;t[1]===e?f=t[2]:(f={resolver:u,defaultValues:e},t[1]=e,t[2]=f);let p=ni(f),x;t[3]!==p.formState.dirtyFields||t[4]!==h||t[5]!==l?(x=async D=>{let g=Zt(D,p.formState.dirtyFields);Object.keys(g).length!==0&&await h({config:g}).then(()=>{l(_=>({..._,...D}))})},t[3]=p.formState.dirtyFields,t[4]=h,t[5]=l,t[6]=x):x=t[6];let j=Ai(x,ic),k;t[7]===Symbol.for("react.memo_cache_sentinel")?(k=Me(),t[7]=k):k=t[7];let S=k,I=(0,m.useId)(),v=(0,m.useId)(),N;t[8]!==i||t[9]!==c||t[10]!==e||t[11]!==p||t[12]!==I||t[13]!==v||t[14]!==j||t[15]!==a||t[16]!==r?(N=()=>{switch(i){case"editor":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ge,{title:"Autosave",children:[(0,n.jsx)(O,{control:p.control,name:"save.autosave",render:D=>{let{field:g}=D;return(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Autosave enabled"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"autosave-checkbox",checked:g.value==="after_delay",disabled:g.disabled,onCheckedChange:_=>{g.onChange(_?"after_delay":"off")}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"save.autosave"})]})}}),(0,n.jsx)(O,{control:p.control,name:"save.autosave_delay",render:D=>{let{field:g}=D;return(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Autosave delay (seconds)"}),(0,n.jsx)(U,{children:(0,n.jsx)(Ge,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:p.getValues("save.autosave")!=="after_delay",...g,value:g.value/1e3,minValue:1,onChange:_=>{g.onChange(_*1e3),Number.isNaN(_)||j(p.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"save.autosave_delay"})]})}}),(0,n.jsx)(O,{control:p.control,name:"runtime.default_auto_download",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Save cell outputs as"}),(0,n.jsx)(U,{children:(0,n.jsxs)("div",{className:"flex gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(re,{id:I,checked:Array.isArray(g.value)&&g.value.includes("html"),onCheckedChange:()=>{let _=Array.isArray(g.value)?g.value:[];g.onChange(ol(_,"html"))}}),(0,n.jsx)(L,{htmlFor:I,children:"HTML"})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(re,{id:v,checked:Array.isArray(g.value)&&g.value.includes("ipynb"),onCheckedChange:()=>{let _=Array.isArray(g.value)?g.value:[];g.onChange(ol(_,"ipynb"))}}),(0,n.jsx)(L,{htmlFor:v,children:"IPYNB"})]})]})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"runtime.default_auto_download"})]}),(0,n.jsxs)(X,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",(0,n.jsx)(ae,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}})]}),(0,n.jsxs)(ge,{title:"Formatting",children:[(0,n.jsx)(O,{control:p.control,name:"save.format_on_save",render:D=>{let{field:g}=D;return(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Format on save"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"format-on-save-checkbox",checked:g.value,disabled:g.disabled,onCheckedChange:_=>{g.onChange(_)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"save.format_on_save"})]})}}),(0,n.jsx)(O,{control:p.control,name:"formatting.line_length",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Line length"}),(0,n.jsx)(U,{children:(0,n.jsx)(Ge,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...g,value:g.value,minValue:1,maxValue:1e3,onChange:_=>{g.onChange(_),Number.isNaN(_)||j(p.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"formatting.line_length"})]}),(0,n.jsx)(X,{children:"Maximum line length when formatting code."})]})}})]}),(0,n.jsxs)(ge,{title:"Autocomplete",children:[(0,n.jsx)(O,{control:p.control,name:"completion.activate_on_typing",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Autocomplete"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"autocomplete-checkbox",checked:g.value,disabled:g.disabled,onCheckedChange:_=>{g.onChange(!!_)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"completion.activate_on_typing"})]}),(0,n.jsx)(X,{children:"When unchecked, code completion is still available through a hotkey."}),(0,n.jsx)("div",{children:(0,n.jsx)(ie,{variant:"link",className:"mb-0 px-0",type:"button",onClick:_=>{_.preventDefault(),_.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}}),(0,n.jsx)(O,{control:p.control,name:"completion.signature_hint_on_typing",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Signature hints"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"signature-hint-on-type-checkbox",checked:g.value??!1,disabled:g.disabled,onCheckedChange:_=>{g.onChange(!!_)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"completion.signature_hint_on_typing"})]}),(0,n.jsx)(X,{children:"Display signature hints while typing within function calls."})]})}})]}),(0,n.jsxs)(ge,{title:"Language Servers",children:[(0,n.jsxs)(X,{children:["See the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),(0,n.jsxs)(X,{children:[(0,n.jsx)("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),(0,n.jsx)(O,{control:p.control,name:"language_servers.pylsp.enabled",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsxs)(L,{children:[(0,n.jsx)(ct,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",(0,n.jsx)(oe,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"pylsp-checkbox",checked:g.value,disabled:g.disabled,onCheckedChange:_=>{g.onChange(!!_)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),g.value&&!c.pylsp&&(0,n.jsxs)(ht,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",(0,n.jsx)(ae,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),(0,n.jsx)(O,{control:p.control,name:"language_servers.basedpyright.enabled",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsxs)(L,{children:[(0,n.jsx)(ct,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",(0,n.jsx)(oe,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"basedpyright-checkbox",checked:g.value,disabled:g.disabled,onCheckedChange:_=>{g.onChange(!!_)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"language_servers.basedpyright.enabled"})]}),g.value&&!c.basedpyright&&(0,n.jsxs)(ht,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",(0,n.jsx)(ae,{className:"inline",children:"basedpyright"})," in your environment."]})]})}}),(0,n.jsx)(O,{control:p.control,name:"language_servers.ty.enabled",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsxs)(L,{children:[(0,n.jsx)(ct,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",(0,n.jsx)(oe,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"ty-checkbox",checked:g.value,disabled:g.disabled,onCheckedChange:_=>{g.onChange(!!_)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"language_servers.ty.enabled"})]}),g.value&&!c.ty&&(0,n.jsxs)(ht,{kind:"danger",children:["ty is not available in your current environment. Please install ",(0,n.jsx)(ae,{className:"inline",children:"ty"})," in your environment."]})]})}}),(0,n.jsx)(O,{control:p.control,name:"diagnostics.enabled",render:D=>{let{field:g}=D;return(0,n.jsxs)(H,{className:q,children:[(0,n.jsxs)(L,{children:[(0,n.jsx)(ct,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"diagnostics-checkbox",checked:g.value,disabled:g.disabled,onCheckedChange:_=>{g.onChange(!!_)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),(0,n.jsxs)(ge,{title:"Keymap",children:[(0,n.jsx)(O,{control:p.control,name:"keymap.preset",render:D=>{let{field:g}=D;return(0,n.jsx)("div",{className:"flex flex-col space-y-1",children:(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Keymap"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"keymap-select",onChange:_=>g.onChange(_.target.value),value:g.value,disabled:g.disabled,className:"inline-flex mr-2",children:kr.map(oc)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"keymap.preset"})]})})}}),(0,n.jsx)(O,{control:p.control,name:"keymap.destructive_delete",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Destructive delete"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"destructive-delete-checkbox",checked:g.value,disabled:g.disabled,onCheckedChange:_=>{g.onChange(!!_)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"keymap.destructive_delete"})]}),(0,n.jsxs)(X,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",(0,n.jsx)(Be,{content:(0,n.jsxs)("div",{className:"max-w-xs",children:[(0,n.jsx)("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:(0,n.jsx)(_t,{className:"w-3 h-3 text-(--amber-11)"})})]}),(0,n.jsx)("div",{children:(0,n.jsx)(ie,{variant:"link",className:"mb-0 px-0",type:"button",onClick:_=>{_.preventDefault(),_.stopPropagation(),r(!0)},children:"Edit Keyboard Shortcuts"})})]})}})]})]});case"display":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ge,{title:"Display",children:[(0,n.jsx)(O,{control:p.control,name:"display.default_width",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Default width"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"user-config-width-select",onChange:_=>g.onChange(_.target.value),value:g.value,disabled:g.disabled,className:"inline-flex mr-2",children:Ls().map(cc)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"display.default_width"})]}),(0,n.jsx)(X,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),(0,n.jsx)(O,{control:p.control,name:"display.theme",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Theme"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"theme-select",onChange:_=>g.onChange(_.target.value),value:g.value,disabled:g.disabled,className:"inline-flex mr-2",children:ci.map(dc)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"display.theme"})]}),(0,n.jsx)(X,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),(0,n.jsx)(O,{control:p.control,name:"display.code_editor_font_size",render:D=>{let{field:g}=D;return(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Code editor font size (px)"}),(0,n.jsx)(U,{children:(0,n.jsx)("span",{className:"inline-flex mr-2",children:(0,n.jsx)(Ge,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...g,value:g.value,minValue:8,maxValue:32,onChange:_=>{g.onChange(_),j(p.getValues())}})})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"display.code_editor_font_size"})]})}}),(0,n.jsx)(O,{control:p.control,name:"display.locale",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Locale"}),(0,n.jsx)(U,{children:(0,n.jsxs)(fe,{"data-testid":"locale-select",onChange:_=>{_.target.value===Qt?g.onChange(void 0):g.onChange(_.target.value)},value:g.value||Qt,disabled:g.disabled,className:"inline-flex mr-2",children:[(0,n.jsx)("option",{value:Qt,children:"System"}),navigator.languages.map(uc)]})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"display.locale"})]}),(0,n.jsxs)(X,{children:["The locale to use for the notebook. If your desired locale is not listed, you can change it manually via"," ",(0,n.jsx)(ae,{className:"inline",children:"marimo config show"}),"."]})]})}}),(0,n.jsx)(O,{control:p.control,name:"display.reference_highlighting",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Reference highlighting"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"reference-highlighting-checkbox",checked:g.value,onCheckedChange:g.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"display.reference_highlighting"})]}),(0,n.jsx)(X,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})}})]}),(0,n.jsx)(ge,{title:"Outputs",children:(0,n.jsx)(O,{control:p.control,name:"display.cell_output",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Cell output area"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"cell-output-select",onChange:_=>g.onChange(_.target.value),value:g.value,disabled:g.disabled,className:"inline-flex mr-2",children:["above","below"].map(mc)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"display.cell_output"})]}),(0,n.jsx)(X,{children:"Where to display cell's output."})]})}})})]});case"packageManagementAndData":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ge,{title:"Package Management",children:(0,n.jsx)(O,{control:p.control,disabled:S,name:"package_management.manager",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{children:"Manager"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"package-manager-select",onChange:_=>g.onChange(_.target.value),value:g.value,disabled:g.disabled,className:"inline-flex mr-2",children:Nr.map(hc)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"package_management.manager"})]}),(0,n.jsxs)(X,{children:["When marimo comes across a module that is not installed, you will be prompted to install it using your preferred package manager. Learn more in the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),"Running marimo in a"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",children:"sandboxed environment"})," ","is only supported by ",(0,n.jsx)(ae,{className:"inline",children:"uv"})]})]})}})}),(0,n.jsx)(ge,{title:"Data",children:(0,n.jsx)(Xo,{form:p,config:e,onSubmit:j})})]});case"runtime":return(0,n.jsxs)(ge,{title:"Runtime configuration",children:[(0,n.jsx)(O,{control:p.control,name:"runtime.auto_instantiate",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Autorun on startup"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"auto-instantiate-checkbox",disabled:g.disabled,checked:g.value,onCheckedChange:g.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"runtime.auto_instantiate"})]}),(0,n.jsx)(X,{children:"Whether to automatically run all cells on startup."})]})}}),(0,n.jsx)(O,{control:p.control,name:"runtime.on_cell_change",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"On cell change"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"on-cell-change-select",onChange:_=>g.onChange(_.target.value),value:g.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(pc)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"runtime.on_cell_change"})]}),(0,n.jsx)(X,{children:`Whether marimo should automatically run cells or just mark them as stale. If "autorun", marimo will automatically run affected cells when a cell is run or a UI element is interacted with; if "lazy", marimo will mark affected cells as stale but won't re-run them.`})]})}}),(0,n.jsx)(O,{control:p.control,name:"runtime.auto_reload",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"On module change"}),(0,n.jsx)(U,{children:(0,n.jsx)(fe,{"data-testid":"auto-reload-select",onChange:_=>g.onChange(_.target.value),value:g.value,disabled:S,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(fc)})}),(0,n.jsx)(G,{}),(0,n.jsx)(W,{userConfig:e,name:"runtime.auto_reload"})]}),(0,n.jsx)(X,{children:'Whether marimo should automatically reload modules before executing cells. If "lazy", marimo will mark cells affected by module modifications as stale; if "autorun", affected cells will be automatically re-run.'})]})}}),(0,n.jsx)(O,{control:p.control,name:"runtime.reactive_tests",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Autorun Unit Tests"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"reactive-test-checkbox",checked:g.value,onCheckedChange:g.onChange})})]}),(0,n.jsx)(W,{userConfig:e,name:"runtime.reactive_tests"}),(0,n.jsx)(G,{}),(0,n.jsx)(X,{children:"Enable reactive pytest tests in notebook. When a cell contains only test functions (test_*) and classes (Test_*), marimo will automatically run them with pytest (requires notebook restart)."})," "]})}}),(0,n.jsxs)(X,{children:["Learn more in the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return(0,n.jsx)(Lo,{form:p,config:e,onSubmit:j});case"optionalDeps":return(0,n.jsx)(tc,{});case"labs":return(0,n.jsxs)(ge,{title:"Experimental Features",children:[(0,n.jsx)("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),(0,n.jsx)(O,{control:p.control,name:"experimental.rtc_v2",render:gc}),(0,n.jsx)(O,{control:p.control,name:"experimental.performant_table_charts",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Performant Table Charts"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"performant-table-charts-checkbox",checked:g.value===!0,onCheckedChange:g.onChange})})]}),(0,n.jsx)(W,{userConfig:e,name:"experimental.performant_table_charts"}),(0,n.jsx)(X,{children:"Enable experimental table charts which are computed on the backend."})]})}}),(0,n.jsx)(O,{control:p.control,name:"experimental.external_agents",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"External Agents"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"external-agents-checkbox",checked:g.value===!0,onCheckedChange:g.onChange})})]}),(0,n.jsx)(W,{userConfig:e,name:"experimental.external_agents"}),(0,n.jsxs)(X,{children:["Enable experimental external agents such as Claude Code and Gemini CLI. Learn more in the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/agents/",children:"docs"}),"."]})]})}}),(0,n.jsx)(O,{control:p.control,name:"experimental.chat_modes",render:D=>{let{field:g}=D;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Chat Mode"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"chat-mode-checkbox",checked:g.value===!0,onCheckedChange:g.onChange})})]}),(0,n.jsx)(W,{userConfig:e,name:"experimental.chat_modes"}),(0,n.jsx)(X,{children:"Switch between different modes in the Chat sidebar, to enable tool use."})]})}})]})}},t[8]=i,t[9]=c,t[10]=e,t[11]=p,t[12]=I,t[13]=v,t[14]=j,t[15]=a,t[16]=r,t[17]=N):N=t[17];let A=N,b,$;t[18]===Symbol.for("react.memo_cache_sentinel")?(b=(0,n.jsx)(ae,{className:"inline",children:"marimo.toml"}),$=(0,n.jsx)("br",{}),t[18]=b,t[19]=$):(b=t[18],$=t[19]);let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=(0,n.jsxs)("p",{className:"text-muted-secondary",children:["User configuration is stored in ",b,$,"Run ",(0,n.jsx)(ae,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[20]=E):E=t[20];let K=E,P;t[21]!==p||t[22]!==j?(P=p.handleSubmit(j),t[21]=p,t[22]=j,t[23]=P):P=t[23];let z;t[24]===a?z=t[25]:(z=D=>a(D),t[24]=a,t[25]=z);let V;t[26]===Symbol.for("react.memo_cache_sentinel")?(V=rr.map(xc),t[26]=V):V=t[26];let T;t[27]===o?T=t[28]:(T=(0,n.jsxs)("span",{children:["Version: ",o]}),t[27]=o,t[28]=T);let w;t[29]===d?w=t[30]:(w=(0,n.jsxs)("span",{children:["Locale: ",d]}),t[29]=d,t[30]=w);let y;t[31]!==T||t[32]!==w?(y=(0,n.jsxs)("div",{className:"p-2 text-xs text-muted-foreground self-start flex flex-col gap-1",children:[T,w]}),t[31]=T,t[32]=w,t[33]=y):y=t[33];let M,R;t[34]===Symbol.for("react.memo_cache_sentinel")?(M=(0,n.jsx)("div",{className:"flex-1"}),R=!Me()&&K,t[34]=M,t[35]=R):(M=t[34],R=t[35]);let B;t[36]===y?B=t[37]:(B=(0,n.jsxs)(Dl,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[V,y,M,R]}),t[36]=y,t[37]=B);let Y;t[38]!==i||t[39]!==B||t[40]!==z?(Y=(0,n.jsx)(_l,{value:i,onValueChange:z,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:B}),t[38]=i,t[39]=B,t[40]=z,t[41]=Y):Y=t[41];let C;t[42]===A?C=t[43]:(C=A(),t[42]=A,t[43]=C);let Z;t[44]===C?Z=t[45]:(Z=(0,n.jsx)("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:C}),t[44]=C,t[45]=Z);let Q;t[46]!==Y||t[47]!==Z||t[48]!==P?(Q=(0,n.jsxs)("form",{ref:s,onChange:P,className:"flex text-pretty overflow-hidden",children:[Y,Z]}),t[46]=Y,t[47]=Z,t[48]=P,t[49]=Q):Q=t[49];let ee;return t[50]!==p||t[51]!==Q?(ee=(0,n.jsx)(si,{...p,children:Q}),t[50]=p,t[51]=Q,t[52]=ee):ee=t[52],ee};function oc(t){return(0,n.jsx)("option",{value:t,children:t},t)}function cc(t){return(0,n.jsx)("option",{value:t,children:t},t)}function dc(t){return(0,n.jsx)("option",{value:t,children:t},t)}function uc(t){return(0,n.jsx)("option",{value:t,children:t},t)}function mc(t){return(0,n.jsx)("option",{value:t,children:t},t)}function hc(t){return(0,n.jsx)("option",{value:t,children:t},t)}function pc(t){return(0,n.jsx)("option",{value:t,children:t},t)}function fc(t){return(0,n.jsx)("option",{value:t,children:t},t)}function gc(t){let{field:e}=t;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(H,{className:q,children:[(0,n.jsx)(L,{className:"font-normal",children:"Real-Time Collaboration"}),(0,n.jsx)(U,{children:(0,n.jsx)(re,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,n.jsx)(X,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function xc(t){return(0,n.jsx)(Xe,{value:t.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:(0,n.jsxs)("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[(0,n.jsx)("span",{className:ue(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:(0,n.jsx)(t.Icon,{className:"w-4 h-4"})}),(0,n.jsx)("span",{className:"truncate",children:t.label})]})},t.id)}var yc=he();const ar=Ct(!1);function or(){let t=(0,yc.c)(3),e=kt(ir),l=kt(ar),s;return t[0]!==e||t[1]!==l?(s={handleClick:r=>{e(r),l(!0)}},t[0]=e,t[1]=l,t[2]=s):s=t[2],s}export{Tt as A,rn as C,Gl as D,Zl as E,$l as M,Tl as N,Wl as O,Ml as P,tn as S,$e as T,_s as _,No as a,Ka as b,xo as c,Gt as d,Ls as f,qt as g,Ps as h,Zt as i,Vl as j,Ul as k,go as l,Qe as m,or as n,bo as o,Es as p,ac as r,Gs as s,ar as t,co as u,Is as v,Bt as w,Ot as x,xt as y};
@@ -0,0 +1 @@
1
+ import{p as i}from"./useEvent-DlWF5OMa.js";import{fn as o,pn as h,qr as l}from"./cells-Cv9PtwL9.js";import{d as m}from"./once-CTiSlR1m.js";import{t as d}from"./createLucideIcon-CW2xpJ57.js";var p=d("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),f="marimo:ai:chatState:v5";const v=i(null),u=l("marimo:ai:includeOtherCells",!0,h);function C(a){let t=new Map;for(let[s,e]of a.entries()){if(e.messages.length===0)continue;let c=m(e.messages,n=>n.id);t.set(s,{...e,messages:c})}return t}const r=l(f,{chats:new Map,activeChatId:null},o({toSerializable:a=>({chats:[...C(a.chats).entries()],activeChatId:a.activeChatId}),fromSerializable:a=>({chats:new Map(a.chats),activeChatId:a.activeChatId})})),I=i(a=>{let t=a(r);return t.activeChatId?t.chats.get(t.activeChatId):null},(a,t,s)=>{t(r,e=>({...e,activeChatId:s}))});export{p as a,u as i,v as n,r,I as t};