@marimo-team/frontend 0.19.3-dev27 → 0.19.3-dev28

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 (93) hide show
  1. package/dist/assets/{CellStatus-DqnjakAQ.js → CellStatus-CjIIwo1z.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-Co1Pcul9.js → ConnectedDataExplorerComponent-Cr6-n9Em.js} +1 -1
  3. package/dist/assets/{ErrorBoundary-Drf1manw.js → ErrorBoundary-C7JBxSzd.js} +1 -1
  4. package/dist/assets/{ImperativeModal-B7kKs9xL.js → ImperativeModal-DVhvP4lH.js} +1 -1
  5. package/dist/assets/{JsonOutput-Dkt5bNmT.js → JsonOutput-p0zb9mQ1.js} +1 -1
  6. package/dist/assets/{LazyAnyLanguageCodeMirror-jpEDlD0M.js → LazyAnyLanguageCodeMirror-Cp2punaU.js} +2 -2
  7. package/dist/assets/{MarimoErrorOutput-BVPr2l2P.js → MarimoErrorOutput-ClRs2jYh.js} +1 -1
  8. package/dist/assets/{RenderHTML-xCb5cqOX.js → RenderHTML-KzGVguaA.js} +1 -1
  9. package/dist/assets/{VisuallyHidden-B44yJgpX.js → VisuallyHidden-B9t3FhTP.js} +1 -1
  10. package/dist/assets/{add-cell-with-ai-6i4jmAOJ.js → add-cell-with-ai-Dq4w_0vC.js} +1 -1
  11. package/dist/assets/{add-database-form-CNi3O1nG.js → add-database-form-BF1XmV3g.js} +1 -1
  12. package/dist/assets/{agent-panel-C8s4K5MP.js → agent-panel-BfZGOZw7.js} +1 -1
  13. package/dist/assets/{ai-model-dropdown-NoEabH3r.js → ai-model-dropdown-DgfCTAMr.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-C-DsnVgg.js → app-config-button-CGT3LJN6.js} +1 -1
  17. package/dist/assets/button-B8cGZzP5.js +1 -0
  18. package/dist/assets/{cache-panel-DrvX9LTs.js → cache-panel-1FqnpB9y.js} +1 -1
  19. package/dist/assets/{cell-editor-BQGBM4CV.js → cell-editor-04MlZjuj.js} +1 -1
  20. package/dist/assets/{cell-link-BW63-8Zi.js → cell-link-Bm4hypmB.js} +1 -1
  21. package/dist/assets/{cells-CxLYaBUM.js → cells-Bybxko6N.js} +1 -1
  22. package/dist/assets/{chat-components-B3msbsyx.js → chat-components-BnEh1lQ3.js} +1 -1
  23. package/dist/assets/{chat-display-CMpQ7Aew.js → chat-display-CpaVYsBS.js} +1 -1
  24. package/dist/assets/{chat-panel-CQYOM0Pr.js → chat-panel-i0LPxeA1.js} +1 -1
  25. package/dist/assets/{client-0ZjIqESP.js → client-BHJbjyLn.js} +1 -1
  26. package/dist/assets/{column-preview-CJ8DoQWh.js → column-preview-CXH7PEzS.js} +1 -1
  27. package/dist/assets/{command-Bt6twrmW.js → command-BGzGALfV.js} +1 -1
  28. package/dist/assets/{command-palette-CR1vRNKO.js → command-palette-DeVuHykX.js} +1 -1
  29. package/dist/assets/{common-Dx7Mlsso.js → common-GkW6UhNG.js} +1 -1
  30. package/dist/assets/{copy-icon-B69c-352.js → copy-icon-jWsqdLn1.js} +1 -1
  31. package/dist/assets/{datasource-eALmG5dT.js → datasource-C9Ibn98W.js} +1 -1
  32. package/dist/assets/{dependency-graph-panel-BtAj3Tto.js → dependency-graph-panel-BrsHwP7n.js} +1 -1
  33. package/dist/assets/{dialog-DUEuLcT2.js → dialog-CF5DtF1E.js} +1 -1
  34. package/dist/assets/{dist-DOFFh6Ii.js → dist-Dg7UO_Vw.js} +1 -1
  35. package/dist/assets/{documentation-panel-Bo90dTx7.js → documentation-panel-B1bUgdJq.js} +1 -1
  36. package/dist/assets/{download-kb4f28me.js → download-DFqv8W29.js} +1 -1
  37. package/dist/assets/{edit-page-A1vWuGPf.js → edit-page-yvETOAn1.js} +3 -3
  38. package/dist/assets/{error-banner-DU5Qb8a8.js → error-banner-DvT0IGDZ.js} +1 -1
  39. package/dist/assets/{error-panel-CF1PQ3LW.js → error-panel-D81fcnK8.js} +1 -1
  40. package/dist/assets/{es-CYXJA6lG.js → es-m6vibNCH.js} +1 -1
  41. package/dist/assets/{field-BJCREuzy.js → field-Clr_fqUr.js} +1 -1
  42. package/dist/assets/{file-explorer-panel-ilDG3HyK.js → file-explorer-panel-CExHg-qi.js} +1 -1
  43. package/dist/assets/{floating-outline-BY_abszS.js → floating-outline-BDi2NbaY.js} +1 -1
  44. package/dist/assets/{focus-CCFhJFiF.js → focus-B3JRNMT5.js} +1 -1
  45. package/dist/assets/{form-DkIxZcIl.js → form-BjfR2hxv.js} +1 -1
  46. package/dist/assets/{glide-data-editor-C5tXJ5b-.js → glide-data-editor-Dv8ZW9dk.js} +1 -1
  47. package/dist/assets/{globals-DLZWqwk9.js → globals-BoC3OJDy.js} +1 -1
  48. package/dist/assets/{home-page-DmTpdUkN.js → home-page-CsSMsmF_.js} +1 -1
  49. package/dist/assets/{index-CY3OpKqp.js → index-Bxyo05m8.js} +6 -6
  50. package/dist/assets/{input-a7Oxxo2e.js → input-B80Yt1uu.js} +1 -1
  51. package/dist/assets/{kiosk-mode-CGG4X99A.js → kiosk-mode-M31wY0Z2.js} +1 -1
  52. package/dist/assets/{label-qwandMoh.js → label-CNZLffHW.js} +1 -1
  53. package/dist/assets/{layout-CJrjJQJ1.js → layout-CExKZnfn.js} +3 -3
  54. package/dist/assets/{logs-panel-BKwLaFJg.js → logs-panel-Dv0ah0zz.js} +1 -1
  55. package/dist/assets/{markdown-renderer-CKkCwEhz.js → markdown-renderer-SDmn1dcA.js} +1 -1
  56. package/dist/assets/{mode-BI49gh_2.js → mode-C0y8rrJY.js} +1 -1
  57. package/dist/assets/{multi-map-fjX9ImVF.js → multi-map-CQd4MZr5.js} +1 -1
  58. package/dist/assets/name-cell-input-DmRA2_vx.js +1 -0
  59. package/dist/assets/{outline-panel-CvIQq0Mk.js → outline-panel-oCJ7sxbY.js} +1 -1
  60. package/dist/assets/{packages-panel-BdsNqBX8.js → packages-panel-Ce4m7a1D.js} +1 -1
  61. package/dist/assets/{panels-DbeDZJ3j.js → panels-qBb6VQPe.js} +1 -1
  62. package/dist/assets/{process-output-BWKbFYsY.js → process-output-dhnUvKF1.js} +1 -1
  63. package/dist/assets/{readonly-python-code-Gk9Vpov-.js → readonly-python-code-Cz2byyYU.js} +1 -1
  64. package/dist/assets/{run-page-yem4JBDj.js → run-page-qahhaONh.js} +1 -1
  65. package/dist/assets/{scratchpad-panel-B7MOpoUC.js → scratchpad-panel-XqKr3sTw.js} +1 -1
  66. package/dist/assets/{secrets-panel-D21iGQ7o.js → secrets-panel-BMY6PPth.js} +1 -1
  67. package/dist/assets/{select-D0g5GnIs.js → select-D9lTzMzP.js} +1 -1
  68. package/dist/assets/{session-panel-DRKMrFQQ.js → session-panel-C0lo88fb.js} +1 -1
  69. package/dist/assets/{slides-component-MkPkpql1.js → slides-component-Dp0Yv5b0.js} +1 -1
  70. package/dist/assets/{snippets-panel-BGCrEheA.js → snippets-panel-B3enTa5R.js} +1 -1
  71. package/dist/assets/{state-DMkGD84_.js → state-C_Zihs8j.js} +1 -1
  72. package/dist/assets/{state-CBLi2yPn.js → state-DSeEWQ7X.js} +1 -1
  73. package/dist/assets/{switch-CKzkriUC.js → switch-BrMSOK9-.js} +1 -1
  74. package/dist/assets/{textarea-CfgJSv-G.js → textarea-CtGg_oNS.js} +1 -1
  75. package/dist/assets/{tracing-D6d2O1r8.js → tracing-CBQUni3z.js} +1 -1
  76. package/dist/assets/{tracing-panel-DEIxVCr3.js → tracing-panel-DBRgqvXk.js} +2 -2
  77. package/dist/assets/{types-rseSmieg.js → types-9ye0mIoa.js} +1 -1
  78. package/dist/assets/{useAddCell-BjCsEEJz.js → useAddCell-Dnxw4Tgv.js} +1 -1
  79. package/dist/assets/{useCellActionButton-uoJaRqwc.js → useCellActionButton-6Zfn7U1K.js} +1 -1
  80. package/dist/assets/{useDeleteCell-CrEKA1bV.js → useDeleteCell-cgZ94jOt.js} +1 -1
  81. package/dist/assets/{useDependencyPanelTab-CRbZ_d-v.js → useDependencyPanelTab-BgvTVQ8s.js} +1 -1
  82. package/dist/assets/{useNotebookActions-HHGcAy1p.js → useNotebookActions-DlrFYxYS.js} +1 -1
  83. package/dist/assets/{useRunCells-CQiKZU8u.js → useRunCells-CcuO6KPm.js} +1 -1
  84. package/dist/assets/{useSplitCell-CSg5yFV8.js → useSplitCell-CrWmr1Ul.js} +1 -1
  85. package/dist/assets/{utilities.esm-C3w5SJ1r.js → utilities.esm-B_yGlyHc.js} +1 -1
  86. package/dist/assets/{vega-component-B8ghmMYW.js → vega-component-BoLFf7jF.js} +1 -1
  87. package/dist/assets/{write-secret-modal-Bl_gDasG.js → write-secret-modal-hOetwavI.js} +1 -1
  88. package/dist/index.html +46 -46
  89. package/package.json +1 -1
  90. package/src/components/editor/actions/name-cell-input.tsx +10 -4
  91. package/src/utils/events.ts +1 -0
  92. package/dist/assets/button-DuYGqRtX.js +0 -1
  93. package/dist/assets/name-cell-input-B68Jbheu.js +0 -1
@@ -1,2 +1,2 @@
1
- var R0=Object.defineProperty;var U0=(o,e,t)=>e in o?R0(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var A0=(o,e,t)=>U0(o,typeof e!="symbol"?e+"":e,t);import{s as z0}from"./chunk-LvLJmgfZ.js";import{l as D0,u as j0}from"./useEvent-DlWF5OMa.js";import{t as W0}from"./react-BGmjiNul.js";import{qn as G0}from"./cells-CxLYaBUM.js";import{t as $}from"./compiler-runtime-DeeZ7FnK.js";import{t as q0}from"./capitalize-DQeWKRGx.js";import{d as J0}from"./hotkeys-uKX61F1_.js";import{c as _0,n as X0,x as $0}from"./utils-CJJIceVn.js";import{t as e2}from"./jsx-runtime-DN_bIXfG.js";import{t as I0}from"./cn-C1rgT0yh.js";import{n as B0}from"./once-CTiSlR1m.js";import{r as t2}from"./requests-C0HaHO6a.js";import{t as i2}from"./createLucideIcon-CW2xpJ57.js";import{_ as o2}from"./select-D0g5GnIs.js";import{u as s2}from"./toDate-5JckKRQn.js";import{a as a2,c as e0,d as P0,f as S0,p as r2,r as n2,s as l2,t as d2,u as L0}from"./dropdown-menu-BP4_BZLr.js";import{t as t0}from"./tooltip-CvjcEpZC.js";import{t as C0}from"./multi-map-fjX9ImVF.js";var N0=i2("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),c2=$(),m2=o=>{switch(o){case"chat":return"chat_model";case"autocomplete":return"autocomplete_model";case"edit":return"edit_model"}};const O0=()=>{let o=(0,c2.c)(12),[e,t]=D0($0),{saveUserConfig:n}=t2(),r;o[0]!==n||o[1]!==t?(r=async h=>{await n({config:h}).then(()=>{t(u=>({...u,...h}))})},o[0]=n,o[1]=t,o[2]=r):r=o[2];let l=r,p;o[3]!==l||o[4]!==e?(p=async(h,u)=>{var v,f,s,k,x;let g=m2(u);g&&l({ai:{...e.ai,models:{custom_models:((f=(v=e.ai)==null?void 0:v.models)==null?void 0:f.custom_models)??[],displayed_models:((k=(s=e.ai)==null?void 0:s.models)==null?void 0:k.displayed_models)??[],...(x=e.ai)==null?void 0:x.models,[g]:h}}})},o[3]=l,o[4]=e,o[5]=p):p=o[5];let c=p,m;o[6]!==l||o[7]!==e?(m=async h=>{l({ai:{...e.ai,mode:h}})},o[6]=l,o[7]=e,o[8]=m):m=o[8];let a=m,d;return o[9]!==a||o[10]!==c?(d={saveModelChange:c,saveModeChange:a},o[9]=a,o[10]=c,o[11]=d):d=o[11],d},T0=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github","openrouter","wandb","marimo"];var y=class s0{constructor(e,t){this.providerId=e,this.shortModelId=t}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/"))return new s0(p2(e),e);let[t,...n]=e.split("/");return new s0(t,n.join("/"))}};function p2(o){return o.startsWith("gpt")||o.startsWith("o3")||o.startsWith("o1")?"openai":o.startsWith("claude")?"anthropic":o.startsWith("gemini")||o.startsWith("google")?"google":o.startsWith("deepseek")?"deepseek":"ollama"}function i0(o){return T0.includes(o)}const h2=[{name:"Claude 4.5 Opus",model:"claude-opus-4-5",description:"Latest Opus model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4.5 Sonnet",model:"claude-sonnet-4-5",description:"Latest Sonnet model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4.1 Opus",model:"claude-opus-4-1",description:"Latest Opus model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4 Opus",model:"claude-opus-4-0",description:"Most capable model with superior performance on complex tasks and reasoning",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4 Sonnet",model:"claude-sonnet-4-0",description:"Next-generation Sonnet model with advanced reasoning and multimodal capabilities",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 3.7 Sonnet",model:"claude-3-7-sonnet-latest",description:"Enhanced Sonnet model with improved capabilities",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Sonnet",model:"claude-3-5-sonnet-latest",description:"Balanced model with strong performance across reasoning, math, and coding",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Haiku",model:"claude-3-5-haiku-latest",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Gemini 3.0 Pro",model:"gemini-3-pro-preview",description:"Most capable Gemini model with advanced reasoning and large context support",providers:["google"],roles:["chat","edit"],thinking:!0},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",description:"Most capable Gemini model with advanced reasoning and large context support",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Pro Experimental",model:"gemini-2.5-pro-exp",description:"Experimental version of Gemini 2.5 Pro with latest improvements",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Flash",model:"gemini-2.5-flash",description:"Adaptive thinking, cost efficiency",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Flash Lite",model:"gemini-2.5-flash-lite",description:"Most cost-efficient model supporting high throughput",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash",model:"gemini-2.0-flash",description:"Next-generation Flash model with improved performance and capabilities",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Experimental",model:"gemini-2.0-flash-exp",description:"Experimental version of Gemini 2.0 Flash with cutting-edge features",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Lite",model:"gemini-2.0-flash-lite",description:"Lightweight version of Gemini 2.0 Flash optimized for efficiency",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Thinking",model:"gemini-2.0-flash-thinking-exp-01-21",description:"Specialized reasoning model with enhanced thinking capabilities",providers:["google"],roles:["chat"],thinking:!0},{name:"Gemini 1.5 Flash",model:"gemini-1.5-flash",description:"Fast and efficient model optimized for speed and everyday tasks",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 1.5 Flash 8B",model:"gemini-1.5-flash-8b",description:"Lightweight version of Gemini 1.5 Flash with 8 billion parameters",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 1.5 Pro",model:"gemini-1.5-pro",description:"Advanced model with superior reasoning capabilities and large context window",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"GPT-5",model:"gpt-5",description:"The best model for coding and agentic tasks across domains",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"GPT-5 Mini",model:"gpt-5-mini",description:"A faster, cost-efficient version of GPT-5 for well-defined tasks",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"GPT-5 Nano",model:"gpt-5-nano",description:"Fastest, most cost-efficient version of GPT-5",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4.1",model:"gpt-4.1",description:"Fast, highly intelligent model with largest context window (1 million tokens)",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4.1 Mini",model:"gpt-4.1-mini",description:"Balanced for intelligence, speed, and cost",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4o",model:"gpt-4o",description:"Fast, intelligent, flexible GPT model with multimodal capabilities",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4o Mini",model:"gpt-4o-mini",description:"Fast, affordable small model for focused tasks",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"o3",model:"o3",description:"Our most powerful reasoning model with chain-of-thought capabilities",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o3 Mini",model:"o3-mini",description:"A small model alternative to o3 for reasoning tasks",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o3 Pro",model:"o3-pro",description:"Version of o3 designed to think longer and provide most reliable responses",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o4 Mini",model:"o4-mini",description:"Faster, more affordable reasoning model optimized for math, coding, and visual tasks",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"GPT-3.5-turbo",model:"gpt-3.5-turbo",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["github"],roles:["chat","edit"],thinking:!1},{name:"Claude 4.5 Sonnet (Bedrock)",model:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",description:"Enhanced Sonnet model with improved capabilities",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 4.1 Opus (Bedrock)",model:"us.anthropic.claude-opus-4-1-20250805-v1:0",description:"Opus model for deep thinking",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.7 Sonnet (Bedrock)",model:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",description:"Enhanced Sonnet model with improved capabilities",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Sonnet v2 (Bedrock)",model:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",description:"Balanced model with strong performance across reasoning, math, and coding",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Haiku (Bedrock)",model:"us.anthropic.claude-3-5-haiku-20241022-v1:0",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Llama 3.3 70B Instruct",model:"us.meta.llama3-3-70b-instruct-v1:0",description:"Large language model optimized for instruction following and chat",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Cohere Embed Multilingual v3",model:"cohere.embed-multilingual-v3",description:"Multilingual text embedding model for semantic search and similarity",providers:["bedrock"],roles:["embed"],thinking:!1},{name:"Cohere Rerank 3.5",model:"cohere.rerank-v3-5:0",description:"Advanced reranking model for improving search result relevance",providers:["bedrock"],roles:["rerank"],thinking:!1},{name:"gpt-oss 20b",model:"gpt-oss:20b",description:"OpenAI\u2019s open-weight models designed for powerful reasoning, agentic tasks, and versatile developer use cases.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Qwen3 8b",model:"qwen3:8b",description:"Qwen3 is the latest generation of large language models in Qwen series.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Gemma3 12b",model:"gemma3:12b",description:"Lightweight gemma models trained by Google, trained to run on a single GPU.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Meta Llama 3.1 8B (W&B)",model:"meta-llama/Llama-3.1-8B-Instruct",description:"Efficient conversational model optimized for responsive multilingual chatbot interactions",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"OpenAI GPT OSS 120B",model:"openai/gpt-oss-120b",description:"Efficient Mixture-of-Experts model designed for high-reasoning, agentic and general-purpose use cases",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"OpenAI GPT OSS 20B",model:"openai/gpt-oss-20b",description:"Lower latency Mixture-of-Experts model trained on OpenAI's Harmony response format with reasoning capabilities",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"DeepSeek V3-0324",model:"deepseek-ai/DeepSeek-V3-0324",description:"Robust Mixture-of-Experts model tailored for high-complexity language processing and comprehensive document analysis",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"Meta Llama 3.3 70B (W&B)",model:"meta-llama/Llama-3.3-70B-Instruct",description:"Multilingual model excelling in conversational tasks, detailed instruction-following, and coding",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"DeepSeek R1-0528",model:"deepseek-ai/DeepSeek-R1-0528",description:"Optimized for precise reasoning tasks including complex coding, math, and structured document analysis",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"MoonshotAI Kimi K2",model:"moonshotai/Kimi-K2-Instruct",description:"Mixture-of-Experts model optimized for complex tool use, reasoning, and code synthesis",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"Z.AI GLM 4.5",model:"zai-org/GLM-4.5",description:"Mixture-of-Experts model with user-controllable thinking/non-thinking modes for strong reasoning, code generation, and agent alignment",providers:["wandb"],roles:["chat","edit"],thinking:!0}],g2=[{name:"OpenAI",id:"openai",description:"OpenAI's API for GPT models, including GPT-3.5 and GPT-4.",url:"https://platform.openai.com/"},{name:"Amazon Bedrock",id:"bedrock",description:"Amazon Bedrock provides access to foundation models from Amazon and leading AI startups via a unified API.",url:"https://aws.amazon.com/bedrock/"},{name:"Azure",id:"azure",description:"Azure provides access to models via the Azure cloud.",url:"https://azure.microsoft.com/en-us/products/ai-services/"},{name:"Anthropic",id:"anthropic",description:"Anthropic's Claude models for conversational and completion tasks.",url:"https://www.anthropic.com/"},{name:"Google AI",id:"google",description:"Google's Vertex AI and PaLM APIs for generative and conversational models.",url:"https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview"},{name:"Ollama",id:"ollama",description:"Ollama is a lightweight, open-source model server for running and sharing LLMs.",url:"https://ollama.ai/"},{name:"GitHub",id:"github",description:"GitHub's API for GPT models with GitHub-hosted models.",url:"https://github.com/features/copilot"},{name:"marimo",id:"marimo",description:"marimo's hosted models.",url:"https://docs.marimo.io/guides/editor_features/ai_completion/"},{name:"DeepSeek",id:"deepseek",description:"DeepSeek's API for GPT models.",url:"https://deepseek.com/"},{name:"LM Studio",id:"lmstudio",description:"LM Studio's API for GPT models.",url:"https://lmstudio.ai/"},{name:"OpenRouter",id:"openrouter",description:"OpenRouter's API for GPT models.",url:"https://openrouter.ai/"},{name:"Mistral",id:"mistral",description:"Mistral's API for GPT models.",url:"https://mistral.ai/"},{name:"Vercel v0",id:"vercel",description:"Vercel's API for GPT models.",url:"https://vercel.com/"},{name:"Together AI",id:"together",description:"Together AI's API for GPT models.",url:"https://together.ai/"},{name:"xAI",id:"xai",description:"xAI's API for GPT models.",url:"https://x.ai/"},{name:"Weights & Biases",id:"wandb",description:"Weights & Biases' hosted models for ML development and AI inference.",url:"https://wandb.ai/"}];var u2=B0(()=>{let o=new Map;for(let e of h2){let t=e.model,n={...e,model:e.model,roles:e.roles.map(r=>r),providers:e.providers,custom:!1};for(let r of n.providers){let l=`${r}/${t}`;o.set(l,n)}}return o}),F0=B0(()=>{let o=new Map,e=new Map;return g2.forEach((t,n)=>{let r=t.id;o.set(r,t),e.set(r,n)}),{providerMap:o,providerToOrderIdx:e}}),R=class W{constructor(e,t){A0(this,"modelsByProviderMap",new C0);this.customModels=new Set(e),this.displayedModels=new Set(t),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:t}=F0();return t.get(e)}static create(e){let{customModels:t=[],displayedModels:n=[]}=e;return new W(t.map(r=>y.parse(r).id),n.map(r=>y.parse(r).id))}buildMaps(){let e=W.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});e.modelsMap.size===0&&(J0.error("The configured displayed_models have filtered out all registered models. Reverting back to showing all models.",[...this.displayedModels]),e=W.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=e.modelsByProviderMap,this.modelsMap=e.modelsMap}static buildMapsFromConfig(e){let{displayedModels:t,customModels:n}=e,r=t.size>0,l=u2(),p=new Map,c=new Map,m=new C0;for(let a of n){if(r&&!t.has(a))continue;let d=y.parse(a),h={name:d.shortModelId,model:d.shortModelId,description:"Custom model",providers:[d.providerId],roles:[],thinking:!1,custom:!0};p.set(a,h)}if(r)for(let a of t){let d=l.get(a);d&&c.set(a,d)}else c=new Map(l);c=new Map([...p,...c]);for(let[a,d]of c.entries()){let h=y.parse(a);m.add(h.providerId,d)}return{modelsByProviderMap:m,modelsMap:c}}getDisplayedModels(){return this.displayedModels}getCustomModels(){return this.customModels}getModelsByProvider(e){return this.modelsByProviderMap.get(e)||[]}getGroupedModelsByProvider(){return this.modelsByProviderMap}getListModelsByProvider(){let e=[...this.getGroupedModelsByProvider().entries()],t=F0().providerToOrderIdx;return e.sort((n,r)=>{let l=n[0],p=r[0];return(t.get(l)??0)-(t.get(p)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}},E0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAnthropic%3c/title%3e%3cpath%20d='M17.3041%203.541h-3.6718l6.696%2016.918H24Zm-10.6082%200L0%2020.459h3.7442l1.3693-3.5527h7.0052l1.3693%203.5528h3.7442L10.5363%203.5409Zm-.3712%2010.2232%202.2914-5.9456%202.2914%205.9456Z'/%3e%3c/svg%3e",v2="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20y='0'%20x='0'%20id='Layer_1'%20version='1.1'%20viewBox='0%200%20300.67%20179.8'%3e%3cstyle%20id='style1855'%20type='text/css'%3e.st1{fill-rule:evenodd;clip-rule:evenodd;fill:%23f90}%3c/style%3e%3cg%20transform='translate(-1.668%20-1.1)'%20id='g1865'%3e%3cpath%20id='path1857'%20d='M86.4%2066.4c0%203.7.4%206.7%201.1%208.9.8%202.2%201.8%204.6%203.2%207.2.5.8.7%201.6.7%202.3%200%201-.6%202-1.9%203L83.2%2092c-.9.6-1.8.9-2.6.9-1%200-2-.5-3-1.4-1.4-1.5-2.6-3.1-3.6-4.7-1-1.7-2-3.6-3.1-5.9-7.8%209.2-17.6%2013.8-29.4%2013.8-8.4%200-15.1-2.4-20-7.2-4.9-4.8-7.4-11.2-7.4-19.2%200-8.5%203-15.4%209.1-20.6%206.1-5.2%2014.2-7.8%2024.5-7.8%203.4%200%206.9.3%2010.6.8%203.7.5%207.5%201.3%2011.5%202.2v-7.3c0-7.6-1.6-12.9-4.7-16-3.2-3.1-8.6-4.6-16.3-4.6-3.5%200-7.1.4-10.8%201.3-3.7.9-7.3%202-10.8%203.4-1.6.7-2.8%201.1-3.5%201.3-.7.2-1.2.3-1.6.3-1.4%200-2.1-1-2.1-3.1v-4.9c0-1.6.2-2.8.7-3.5.5-.7%201.4-1.4%202.8-2.1%203.5-1.8%207.7-3.3%2012.6-4.5C41%201.9%2046.2%201.3%2051.7%201.3c11.9%200%2020.6%202.7%2026.2%208.1%205.5%205.4%208.3%2013.6%208.3%2024.6v32.4zM45.8%2081.6c3.3%200%206.7-.6%2010.3-1.8%203.6-1.2%206.8-3.4%209.5-6.4%201.6-1.9%202.8-4%203.4-6.4.6-2.4%201-5.3%201-8.7v-4.2c-2.9-.7-6-1.3-9.2-1.7-3.2-.4-6.3-.6-9.4-.6-6.7%200-11.6%201.3-14.9%204-3.3%202.7-4.9%206.5-4.9%2011.5%200%204.7%201.2%208.2%203.7%2010.6%202.4%202.5%205.9%203.7%2010.5%203.7zm80.3%2010.8c-1.8%200-3-.3-3.8-1-.8-.6-1.5-2-2.1-3.9L96.7%2010.2c-.6-2-.9-3.3-.9-4%200-1.6.8-2.5%202.4-2.5h9.8c1.9%200%203.2.3%203.9%201%20.8.6%201.4%202%202%203.9l16.8%2066.2%2015.6-66.2c.5-2%201.1-3.3%201.9-3.9.8-.6%202.2-1%204-1h8c1.9%200%203.2.3%204%201%20.8.6%201.5%202%201.9%203.9l15.8%2067%2017.3-67c.6-2%201.3-3.3%202-3.9.8-.6%202.1-1%203.9-1h9.3c1.6%200%202.5.8%202.5%202.5%200%20.5-.1%201-.2%201.6-.1.6-.3%201.4-.7%202.5l-24.1%2077.3c-.6%202-1.3%203.3-2.1%203.9-.8.6-2.1%201-3.8%201h-8.6c-1.9%200-3.2-.3-4-1-.8-.7-1.5-2-1.9-4L156%2023l-15.4%2064.4c-.5%202-1.1%203.3-1.9%204-.8.7-2.2%201-4%201zm128.5%202.7c-5.2%200-10.4-.6-15.4-1.8-5-1.2-8.9-2.5-11.5-4-1.6-.9-2.7-1.9-3.1-2.8-.4-.9-.6-1.9-.6-2.8v-5.1c0-2.1.8-3.1%202.3-3.1.6%200%201.2.1%201.8.3.6.2%201.5.6%202.5%201%203.4%201.5%207.1%202.7%2011%203.5%204%20.8%207.9%201.2%2011.9%201.2%206.3%200%2011.2-1.1%2014.6-3.3%203.4-2.2%205.2-5.4%205.2-9.5%200-2.8-.9-5.1-2.7-7-1.8-1.9-5.2-3.6-10.1-5.2L246%2052c-7.3-2.3-12.7-5.7-16-10.2-3.3-4.4-5-9.3-5-14.5%200-4.2.9-7.9%202.7-11.1%201.8-3.2%204.2-6%207.2-8.2%203-2.3%206.4-4%2010.4-5.2%204-1.2%208.2-1.7%2012.6-1.7%202.2%200%204.5.1%206.7.4%202.3.3%204.4.7%206.5%201.1%202%20.5%203.9%201%205.7%201.6%201.8.6%203.2%201.2%204.2%201.8%201.4.8%202.4%201.6%203%202.5.6.8.9%201.9.9%203.3v4.7c0%202.1-.8%203.2-2.3%203.2-.8%200-2.1-.4-3.8-1.2-5.7-2.6-12.1-3.9-19.2-3.9-5.7%200-10.2.9-13.3%202.8-3.1%201.9-4.7%204.8-4.7%208.9%200%202.8%201%205.2%203%207.1%202%201.9%205.7%203.8%2011%205.5l14.2%204.5c7.2%202.3%2012.4%205.5%2015.5%209.6%203.1%204.1%204.6%208.8%204.6%2014%200%204.3-.9%208.2-2.6%2011.6-1.8%203.4-4.2%206.4-7.3%208.8-3.1%202.5-6.8%204.3-11.1%205.6-4.5%201.4-9.2%202.1-14.3%202.1z'%20fill='%23252f3e'/%3e%3cg%20id='g1863'%3e%3cpath%20id='path1859'%20d='M273.5%20143.7c-32.9%2024.3-80.7%2037.2-121.8%2037.2-57.6%200-109.5-21.3-148.7-56.7-3.1-2.8-.3-6.6%203.4-4.4%2042.4%2024.6%2094.7%2039.5%20148.8%2039.5%2036.5%200%2076.6-7.6%20113.5-23.2%205.5-2.5%2010.2%203.6%204.8%207.6z'%20class='st1'/%3e%3cpath%20id='path1861'%20d='M287.2%20128.1c-4.2-5.4-27.8-2.6-38.5-1.3-3.2.4-3.7-2.4-.8-4.5%2018.8-13.2%2049.7-9.4%2053.3-5%203.6%204.5-1%2035.4-18.6%2050.2-2.7%202.3-5.3%201.1-4.1-1.9%204-9.9%2012.9-32.2%208.7-37.5z'%20class='st1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",f2="data:image/svg+xml,%3csvg%20width='150'%20height='150'%20viewBox='0%200%2096%2096'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='e399c19f-b68f-429d-b176-18c2117ff73c'%20x1='-1032.172'%20x2='-1059.213'%20y1='145.312'%20y2='65.426'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23114a8b'/%3e%3cstop%20offset='1'%20stop-color='%230669bc'/%3e%3c/linearGradient%3e%3clinearGradient%20id='ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15'%20x1='-1023.725'%20x2='-1029.98'%20y1='108.083'%20y2='105.968'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-opacity='.3'/%3e%3cstop%20offset='.071'%20stop-opacity='.2'/%3e%3cstop%20offset='.321'%20stop-opacity='.1'/%3e%3cstop%20offset='.623'%20stop-opacity='.05'/%3e%3cstop%20offset='1'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='a7fee970-a784-4bb1-af8d-63d18e5f7db9'%20x1='-1027.165'%20x2='-997.482'%20y1='147.642'%20y2='68.561'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%233ccbf4'/%3e%3cstop%20offset='1'%20stop-color='%232892df'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23e399c19f-b68f-429d-b176-18c2117ff73c)'%20d='M33.338%206.544h26.038l-27.03%2080.087a4.152%204.152%200%200%201-3.933%202.824H8.149a4.145%204.145%200%200%201-3.928-5.47L29.404%209.368a4.152%204.152%200%200%201%203.934-2.825z'/%3e%3cpath%20fill='%230078d4'%20d='M71.175%2060.261h-41.29a1.911%201.911%200%200%200-1.305%203.309l26.532%2024.764a4.171%204.171%200%200%200%202.846%201.121h23.38z'/%3e%3cpath%20fill='url(%23ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15)'%20d='M33.338%206.544a4.118%204.118%200%200%200-3.943%202.879L4.252%2083.917a4.14%204.14%200%200%200%203.908%205.538h20.787a4.443%204.443%200%200%200%203.41-2.9l5.014-14.777%2017.91%2016.705a4.237%204.237%200%200%200%202.666.972H81.24L71.024%2060.261l-29.781.007L59.47%206.544z'/%3e%3cpath%20fill='url(%23a7fee970-a784-4bb1-af8d-63d18e5f7db9)'%20d='M66.595%209.364a4.145%204.145%200%200%200-3.928-2.82H33.648a4.146%204.146%200%200%201%203.928%202.82l25.184%2074.62a4.146%204.146%200%200%201-3.928%205.472h29.02a4.146%204.146%200%200%200%203.927-5.472z'/%3e%3c/svg%3e",x2="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDeepSeek%3c/title%3e%3cpath%20d='M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'%3e%3c/path%3e%3c/svg%3e",k2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%3c/title%3e%3cpath%20d='M12%20.297c-6.63%200-12%205.373-12%2012%200%205.303%203.438%209.8%208.205%2011.385.6.113.82-.258.82-.577%200-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422%2018.07%203.633%2017.7%203.633%2017.7c-1.087-.744.084-.729.084-.729%201.205.084%201.838%201.236%201.838%201.236%201.07%201.835%202.809%201.305%203.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93%200-1.31.465-2.38%201.235-3.22-.135-.303-.54-1.523.105-3.176%200%200%201.005-.322%203.3%201.23.96-.267%201.98-.399%203-.405%201.02.006%202.04.138%203%20.405%202.28-1.552%203.285-1.23%203.285-1.23.645%201.653.24%202.873.12%203.176.765.84%201.23%201.91%201.23%203.22%200%204.61-2.805%205.625-5.475%205.92.42.36.81%201.096.81%202.22%200%201.606-.015%202.896-.015%203.286%200%20.315.21.69.825.57C20.565%2022.092%2024%2017.592%2024%2012.297c0-6.627-5.373-12-12-12'/%3e%3c/svg%3e",V0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20Gemini%3c/title%3e%3cpath%20d='M11.04%2019.32Q12%2021.51%2012%2024q0-2.49.93-4.68.96-2.19%202.58-3.81t3.81-2.55Q21.51%2012%2024%2012q-2.49%200-4.68-.93a12.3%2012.3%200%200%201-3.81-2.58%2012.3%2012.3%200%200%201-2.58-3.81Q12%202.49%2012%200q0%202.49-.96%204.68-.93%202.19-2.55%203.81a12.3%2012.3%200%200%201-3.81%202.58Q2.49%2012%200%2012q2.49%200%204.68.96%202.19.93%203.81%202.55t2.55%203.81'/%3e%3c/svg%3e",w2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z'/%3e%3c/svg%3e",H0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.2819%209.8211a5.9847%205.9847%200%200%200-.5157-4.9108%206.0462%206.0462%200%200%200-6.5098-2.9A6.0651%206.0651%200%200%200%204.9807%204.1818a5.9847%205.9847%200%200%200-3.9977%202.9%206.0462%206.0462%200%200%200%20.7427%207.0966%205.98%205.98%200%200%200%20.511%204.9107%206.051%206.051%200%200%200%206.5146%202.9001A5.9847%205.9847%200%200%200%2013.2599%2024a6.0557%206.0557%200%200%200%205.7718-4.2058%205.9894%205.9894%200%200%200%203.9977-2.9001%206.0557%206.0557%200%200%200-.7475-7.0729zm-9.022%2012.6081a4.4755%204.4755%200%200%201-2.8764-1.0408l.1419-.0804%204.7783-2.7582a.7948.7948%200%200%200%20.3927-.6813v-6.7369l2.02%201.1686a.071.071%200%200%201%20.038.052v5.5826a4.504%204.504%200%200%201-4.4945%204.4944zm-9.6607-4.1254a4.4708%204.4708%200%200%201-.5346-3.0137l.142.0852%204.783%202.7582a.7712.7712%200%200%200%20.7806%200l5.8428-3.3685v2.3324a.0804.0804%200%200%201-.0332.0615L9.74%2019.9502a4.4992%204.4992%200%200%201-6.1408-1.6464zM2.3408%207.8956a4.485%204.485%200%200%201%202.3655-1.9728V11.6a.7664.7664%200%200%200%20.3879.6765l5.8144%203.3543-2.0201%201.1685a.0757.0757%200%200%201-.071%200l-4.8303-2.7865A4.504%204.504%200%200%201%202.3408%207.872zm16.5963%203.8558L13.1038%208.364%2015.1192%207.2a.0757.0757%200%200%201%20.071%200l4.8303%202.7913a4.4944%204.4944%200%200%201-.6765%208.1042v-5.6772a.79.79%200%200%200-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759%200%200%200-.7854%200L9.409%209.2297V6.8974a.0662.0662%200%200%201%20.0284-.0615l4.8303-2.7866a4.4992%204.4992%200%200%201%206.6802%204.66zM8.3065%2012.863l-2.02-1.1638a.0804.0804%200%200%201-.038-.0567V6.0742a4.4992%204.4992%200%200%201%207.3757-3.4537l-.142.0805L8.704%205.459a.7948.7948%200%200%200-.3927.6813zm1.0976-2.3654l2.602-1.4998%202.6069%201.4998v2.9994l-2.5974%201.4997-2.6067-1.4997Z'/%3e%3c/svg%3e",M2="data:image/svg+xml,%3csvg%20width='240'%20height='300'%20viewBox='0%200%20240%20300'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1401_86274)'%3e%3cmask%20id='mask0_1401_86274'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='240'%20height='300'%3e%3cpath%20d='M240%200H0V300H240V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1401_86274)'%3e%3cpath%20d='M180%20240H60V120H180V240Z'%20fill='%23CFCECD'/%3e%3cpath%20d='M180%2060H60V240H180V60ZM240%20300H0V0H240V300Z'%20fill='%23211E1E'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1401_86274'%3e%3crect%20width='240'%20height='300'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",b2="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenRouter%3c/title%3e%3cpath%20d='M16.804%201.957l7.22%204.105v.087L16.73%2010.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147%201.352L8.345%2011.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314%201.17.796%202.701%201.866%201.11.775%202.083%201.177%203.147%201.352l.3.045c.694.091%201.375.094%202.825.033l.022-2.159%207.22%204.105v.087L16.589%2022l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997%2021.997%200%2000-.755-.498l-.467-.28a55.927%2055.927%200%2000-.76-.43C2.908%2014.73.563%2014.116%200%2014.116V9.888l.14.004c.564-.007%202.91-.622%203.809-1.124l1.016-.58.438-.274c.428-.28%201.072-.726%202.686-1.853%201.621-1.133%203.186-1.78%204.881-2.059%201.152-.19%201.974-.213%203.814-.138l.02-1.907z'%3e%3c/path%3e%3c/svg%3e",y2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeights%20&%20Biases%3c/title%3e%3cpath%20d='M2.48%200a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.101%201.55%201.55%200%200%200%200-3.101zM12%202.295a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zM2.48%205.272a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zm19.04%200a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zM12%208.496a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm-9.52%203.907a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.102zM12%2013.767a2.48%202.48%200%201%200%200%204.962%202.48%202.48%200%200%200%200-4.962zm-9.52%203.907a2.48%202.48%200%201%200%20.001%204.962%202.48%202.48%200%200%200%200-4.962zm19.04.93a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.101zM12%2020.9a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1Z'/%3e%3c/svg%3e",A2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABtlJREFUWEetV21QlNcVfs67y67KV/EjJIRdBIxJrB9BotFqAtERTIKkk8SxNiGt7Ipa46DsxvjR0rVTKuKKJFYTE1SIxmhFbR0Kwc4YNSraqmNswhSFIrBUBD8QVGTZfU/nvrDLroqQ4Pm179nnnvvc5557zr2EXlj05hSfhgvO10AUB/A4AOHEFMCADOJrBFQx0zki+ajkkA9eyslr6kVYBUIPA8ZaLOr/ttQtYJKXgRHSy6B2EBVKwMZqa+6hnsZ0S2DY8jlD2uxSIYDxPQVx/S+CSZIEpyx3rI5wXIZsslm3neouxoMJMEhvNv6JwcvcwYkw8kk9xoZFYOjgYAT2HwBZlnH99i1UNtbj9KVKVDZcho9KhX4+GtgdDrQ52sVwGYQcbduAFRUbNrTdS+R+AhaLpL9Vu4kZ8wTYV6vFrydNxTsTY/Bk0KCHinHxymVsP/E1vjz1jRvXSQIEOqGxO39esWFbo2cQbwIzZ6r0QwPSWUa6APlp++GgyYLgwCB8dqQEs8a/iEF+/j3uSPW1RqTt2orTVRfBHmgCyjQaObZidRcJLwJPL032b3XSEQaixMqTJr6s7GlDcxNOVpZj13wz9IOG9EhAABxOJ5buyUfB6RNeeCKU+vnpYsssFrvXKYhImzvcQfJXDISH/GQg5kyeiqzifYh5eiSss+ZgoK9fryb2BMnMeG/HZhR+e/peEmtqrFuU/OpQwGKRdC21pSLjJZKwMuEtZBbtw6ujx+LDXxohfD/WWu12JH6UgfL6OncIAtpVKh5VlbW1XCGgMxlnA7xT/H4zeiLO26oVCUtMv1cyuq/2na0aMz7KcB/PzjO6rdaam6wQ0JuNx5h5EhFhybQZyD54AJuS5iNhzPN9nds9fsXeHdhRetgz3m2nv+ox6ig4qnqAped04UqWn6utwr/SrVBLKmWAkPHClS4Jw4c8jsbmmzheUYaA/r6YPjJKUcp24yqOlH8PiQgvDv8pQj2Obf3NG5i8erlSH9wmcTyFmQ2vyQxR8ZASE48vTh7BlGdGYWOSUgYU+76uBtPXW9zfyZOnYnvpYbQ7nYovSh+BJXGvY27en13FB1ofH+Qlp2LyUyPc4xZ/uQX7zohUcxmvJJ05OQ1M64TrMf9ANLTcxOK4RKTFJXZLQKxQZLin9ffRoLVdOVluGxsWib8tWun+/uZCGd7+NNsTkk+hJkMOAanCK2S8225HeuIsGF+a1i2B0KDBGB4cgkP/Oe/GaNRqxI14DkcvlqG59Y7iF/Eurv7EjRGKjU5Pxe22uy7fYdKZjflgfteT1gevvIGFU1/tlsCnv1qIV0ZFY8If30dd0zUFN2PMOGxKWoDMogJsPFSk+IRS1Wu3eKky6+O1KK0sV3xEKBdNZzszv+OJSvpZLDLe6HLdmwP5hsWY8uxoxK5ZoTQiYTOfn4TsXxiw/h8HkF3y124JLCv4HDtPHu2YjtBIOpNhI4DfeBKIDovE/kXLu1WgLwQy/74Xm74udsVuIr3JsJSBNZ4EREs9tyoH/v36K+5HqUBG4R5sPlzSqQDZSG8yTmPwQReBwX7+uHqrBetnG5Sq+KgJpO7Mxf6zJztzgI5TsDnJV8PaRoCV5Y4bOkyp2888EYqChR8owLob15TG5LJ5sdMxIkSHjMK/oKH5puIeHzEcb0+IwVffnUXx+TOuCZAz2+iVhFOyfoeKhsudKUAbOkuxoYAZbwqvODqvR43H7n8ew/73liN6aKRXgL58VDbU4+Ws37pDSISEDgL3bIOQvvjfZ/FsSCj2LlymHKdHYaZdW7Gn835AwBU//2a9KzLpTMYTAE8QE4kJxfWr9vpVrEyYiXmx8X2ev+j8GSzY/gm4s4ISsaXGunWVe2mh5pQXiJ3i+uLV/EVD+vjd+YgfGfWjSYjtFN2w3dnZiAg2lZ9z1CVLXpOXtnqzIZMZHZnnYYLEkvhEpMTEQav26TWR/zVdxx8O7IZYvYexxJRQnZ2rlEsvAuIhUtliKwK4qxF4jBStetqIMYgKi0TEkGA8ERiEwf4BGKDRulFCYtHOd586hr1nSt3d0QUgolU11lx3a70vu8TF9I5MxWBM8qT9eEAQ1CoJthsdtd9LIfEWUPsouWN3OnC3XXkP3G+E7FrrFjPQdVl+YHqHWFIGqG/J+cz8lmcUX41WSU5R/12vn17uRxskMtWuzRVl38sedr5It3TuPJI5k5kDe5yIqAqACoyBAHtcoamE4EyrWbet7MGi9BA5PNUY7FDjfYCTAQT1SKQDcAmMQiLKq1mX65WBP0QBL+ywRYu0dk3rSwx+AUAkCEFg8eLCHWJcYeYaSVKXOyT527qsXFsvieL/FjzLIPLjeMUAAAAASUVORK5CYII=",z2=$(),j2=z0(W0(),1),i=z0(e2(),1),K0={openai:H0,anthropic:E0,claude:E0,gemini:V0,google:V0,codex:H0,ollama:w2,azure:f2,bedrock:v2,deepseek:x2,github:k2,openrouter:b2,wandb:y2,marimo:A2,opencode:M2};const V=o=>{let e=(0,z2.c)(15),t,n,r;e[0]===o?(t=e[1],n=e[2],r=e[3]):({provider:n,className:r,...t}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r);let l=r===void 0?"":r;if(n==="openai-compatible"||!(n in K0)){let a;e[4]===l?a=e[5]:(a=I0("h-4 w-4",l),e[4]=l,e[5]=a);let d;return e[6]===a?d=e[7]:(d=(0,i.jsx)(G0,{className:a}),e[6]=a,e[7]=d),d}let p=K0[n],c;e[8]===l?c=e[9]:(c=I0("h-4 w-4 grayscale dark:invert",l),e[8]=l,e[9]=c);let m;return e[10]!==p||e[11]!==t||e[12]!==n||e[13]!==c?(m=(0,i.jsx)("img",{src:p,alt:n,className:c,...t}),e[10]=p,e[11]=t,e[12]=n,e[13]=c,e[14]=m):m=e[14],m};function U(o){switch(o){case"chat":return"bg-[var(--purple-3)] text-[var(--purple-11)]";case"autocomplete":return"bg-[var(--green-3)] text-[var(--green-11)]";case"edit":return"bg-[var(--blue-3)] text-[var(--blue-11)]";case"thinking":return"bg-[var(--purple-4)] text-[var(--purple-12)]"}return"bg-[var(--mauve-3)] text-[var(--mauve-11)]"}function Z0(o){switch(o){case"chat":return"Current model used for chat conversations";case"autocomplete":return"Current model used for autocomplete autocomplete";case"edit":return"Current model used for code edits";case"rerank":return"Current model used for reranking completions";case"embed":return"Current model used for embedding"}}var D=$();const G2=o=>{var a0,r0,n0,l0,d0,c0,m0,p0,h0,g0,u0,v0,f0,x0,k0,w0,M0,b0;let e=(0,D.c)(58),{value:t,placeholder:n,onSelect:r,triggerClassName:l,customDropdownContent:p,iconSize:c,showAddCustomModelDocs:m,forRole:a,displayIconOnly:d}=o,h=c===void 0?"medium":c,u=m===void 0?!1:m,g=d===void 0?!1:d,[v,f]=j2.useState(!1),s=j0(X0),k=j0(_0),{saveModelChange:x}=O0(),j=k.copilot==="custom"?(a0=s==null?void 0:s.models)==null?void 0:a0.autocomplete_model:void 0,G,I,M,B,P,b,S,L,C;if(e[0]!==((r0=s==null?void 0:s.models)==null?void 0:r0.autocomplete_model)||e[1]!==((n0=s==null?void 0:s.models)==null?void 0:n0.chat_model)||e[2]!==((l0=s==null?void 0:s.models)==null?void 0:l0.custom_models)||e[3]!==((d0=s==null?void 0:s.models)==null?void 0:d0.displayed_models)||e[4]!==((c0=s==null?void 0:s.models)==null?void 0:c0.edit_model)||e[5]!==j||e[6]!==g||e[7]!==a||e[8]!==h||e[9]!==v||e[10]!==r||e[11]!==n||e[12]!==x||e[13]!==l||e[14]!==t){let y0=R.create({customModels:[...((m0=s==null?void 0:s.models)==null?void 0:m0.custom_models)??[],(p0=s==null?void 0:s.models)==null?void 0:p0.chat_model,j,(h0=s==null?void 0:s.models)==null?void 0:h0.edit_model].filter(Boolean),displayedModels:(g0=s==null?void 0:s.models)==null?void 0:g0.displayed_models}),Q0=y0.getListModelsByProvider(),A=a==="autocomplete"?(u0=s==null?void 0:s.models)==null?void 0:u0.autocomplete_model:a==="chat"?(v0=s==null?void 0:s.models)==null?void 0:v0.chat_model:a==="edit"?(f0=s==null?void 0:s.models)==null?void 0:f0.edit_model:void 0,H=t?y.parse(t):A?y.parse(A):void 0,T=h==="medium"?"h-4 w-4":"h-3 w-3",Y0=(w,z)=>{let K=y0.getModel(w.id);return(0,i.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[(0,i.jsx)(V,{provider:w.providerId,className:T}),(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{children:(K==null?void 0:K.name)||w.shortModelId}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:w.id})]}),(0,i.jsx)("div",{className:"ml-auto flex gap-1",children:(0,i.jsx)(t0,{content:Z0(z),children:(0,i.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${U(z)}`,children:z},z)})})]})},Q;e[24]!==a||e[25]!==r||e[26]!==x?(Q=w=>{r?r(w):x(w,a),f(!1)},e[24]=a,e[25]=r,e[26]=x,e[27]=Q):Q=e[27];let q=Q;I=d2,L=v,C=f;let J=`flex items-center justify-between px-2 py-0.5 border rounded-md
1
+ var R0=Object.defineProperty;var U0=(o,e,t)=>e in o?R0(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var A0=(o,e,t)=>U0(o,typeof e!="symbol"?e+"":e,t);import{s as z0}from"./chunk-LvLJmgfZ.js";import{l as D0,u as j0}from"./useEvent-DlWF5OMa.js";import{t as W0}from"./react-BGmjiNul.js";import{qn as G0}from"./cells-Bybxko6N.js";import{t as $}from"./compiler-runtime-DeeZ7FnK.js";import{t as q0}from"./capitalize-DQeWKRGx.js";import{d as J0}from"./hotkeys-uKX61F1_.js";import{c as _0,n as X0,x as $0}from"./utils-CJJIceVn.js";import{t as e2}from"./jsx-runtime-DN_bIXfG.js";import{t as I0}from"./cn-C1rgT0yh.js";import{n as B0}from"./once-CTiSlR1m.js";import{r as t2}from"./requests-C0HaHO6a.js";import{t as i2}from"./createLucideIcon-CW2xpJ57.js";import{_ as o2}from"./select-D9lTzMzP.js";import{u as s2}from"./toDate-5JckKRQn.js";import{a as a2,c as e0,d as P0,f as S0,p as r2,r as n2,s as l2,t as d2,u as L0}from"./dropdown-menu-BP4_BZLr.js";import{t as t0}from"./tooltip-CvjcEpZC.js";import{t as C0}from"./multi-map-CQd4MZr5.js";var N0=i2("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),c2=$(),m2=o=>{switch(o){case"chat":return"chat_model";case"autocomplete":return"autocomplete_model";case"edit":return"edit_model"}};const O0=()=>{let o=(0,c2.c)(12),[e,t]=D0($0),{saveUserConfig:n}=t2(),r;o[0]!==n||o[1]!==t?(r=async h=>{await n({config:h}).then(()=>{t(u=>({...u,...h}))})},o[0]=n,o[1]=t,o[2]=r):r=o[2];let l=r,p;o[3]!==l||o[4]!==e?(p=async(h,u)=>{var v,f,s,k,x;let g=m2(u);g&&l({ai:{...e.ai,models:{custom_models:((f=(v=e.ai)==null?void 0:v.models)==null?void 0:f.custom_models)??[],displayed_models:((k=(s=e.ai)==null?void 0:s.models)==null?void 0:k.displayed_models)??[],...(x=e.ai)==null?void 0:x.models,[g]:h}}})},o[3]=l,o[4]=e,o[5]=p):p=o[5];let c=p,m;o[6]!==l||o[7]!==e?(m=async h=>{l({ai:{...e.ai,mode:h}})},o[6]=l,o[7]=e,o[8]=m):m=o[8];let a=m,d;return o[9]!==a||o[10]!==c?(d={saveModelChange:c,saveModeChange:a},o[9]=a,o[10]=c,o[11]=d):d=o[11],d},T0=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github","openrouter","wandb","marimo"];var y=class s0{constructor(e,t){this.providerId=e,this.shortModelId=t}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/"))return new s0(p2(e),e);let[t,...n]=e.split("/");return new s0(t,n.join("/"))}};function p2(o){return o.startsWith("gpt")||o.startsWith("o3")||o.startsWith("o1")?"openai":o.startsWith("claude")?"anthropic":o.startsWith("gemini")||o.startsWith("google")?"google":o.startsWith("deepseek")?"deepseek":"ollama"}function i0(o){return T0.includes(o)}const h2=[{name:"Claude 4.5 Opus",model:"claude-opus-4-5",description:"Latest Opus model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4.5 Sonnet",model:"claude-sonnet-4-5",description:"Latest Sonnet model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4.1 Opus",model:"claude-opus-4-1",description:"Latest Opus model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4 Opus",model:"claude-opus-4-0",description:"Most capable model with superior performance on complex tasks and reasoning",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4 Sonnet",model:"claude-sonnet-4-0",description:"Next-generation Sonnet model with advanced reasoning and multimodal capabilities",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 3.7 Sonnet",model:"claude-3-7-sonnet-latest",description:"Enhanced Sonnet model with improved capabilities",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Sonnet",model:"claude-3-5-sonnet-latest",description:"Balanced model with strong performance across reasoning, math, and coding",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Haiku",model:"claude-3-5-haiku-latest",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Gemini 3.0 Pro",model:"gemini-3-pro-preview",description:"Most capable Gemini model with advanced reasoning and large context support",providers:["google"],roles:["chat","edit"],thinking:!0},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",description:"Most capable Gemini model with advanced reasoning and large context support",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Pro Experimental",model:"gemini-2.5-pro-exp",description:"Experimental version of Gemini 2.5 Pro with latest improvements",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Flash",model:"gemini-2.5-flash",description:"Adaptive thinking, cost efficiency",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Flash Lite",model:"gemini-2.5-flash-lite",description:"Most cost-efficient model supporting high throughput",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash",model:"gemini-2.0-flash",description:"Next-generation Flash model with improved performance and capabilities",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Experimental",model:"gemini-2.0-flash-exp",description:"Experimental version of Gemini 2.0 Flash with cutting-edge features",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Lite",model:"gemini-2.0-flash-lite",description:"Lightweight version of Gemini 2.0 Flash optimized for efficiency",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Thinking",model:"gemini-2.0-flash-thinking-exp-01-21",description:"Specialized reasoning model with enhanced thinking capabilities",providers:["google"],roles:["chat"],thinking:!0},{name:"Gemini 1.5 Flash",model:"gemini-1.5-flash",description:"Fast and efficient model optimized for speed and everyday tasks",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 1.5 Flash 8B",model:"gemini-1.5-flash-8b",description:"Lightweight version of Gemini 1.5 Flash with 8 billion parameters",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 1.5 Pro",model:"gemini-1.5-pro",description:"Advanced model with superior reasoning capabilities and large context window",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"GPT-5",model:"gpt-5",description:"The best model for coding and agentic tasks across domains",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"GPT-5 Mini",model:"gpt-5-mini",description:"A faster, cost-efficient version of GPT-5 for well-defined tasks",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"GPT-5 Nano",model:"gpt-5-nano",description:"Fastest, most cost-efficient version of GPT-5",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4.1",model:"gpt-4.1",description:"Fast, highly intelligent model with largest context window (1 million tokens)",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4.1 Mini",model:"gpt-4.1-mini",description:"Balanced for intelligence, speed, and cost",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4o",model:"gpt-4o",description:"Fast, intelligent, flexible GPT model with multimodal capabilities",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4o Mini",model:"gpt-4o-mini",description:"Fast, affordable small model for focused tasks",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"o3",model:"o3",description:"Our most powerful reasoning model with chain-of-thought capabilities",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o3 Mini",model:"o3-mini",description:"A small model alternative to o3 for reasoning tasks",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o3 Pro",model:"o3-pro",description:"Version of o3 designed to think longer and provide most reliable responses",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o4 Mini",model:"o4-mini",description:"Faster, more affordable reasoning model optimized for math, coding, and visual tasks",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"GPT-3.5-turbo",model:"gpt-3.5-turbo",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["github"],roles:["chat","edit"],thinking:!1},{name:"Claude 4.5 Sonnet (Bedrock)",model:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",description:"Enhanced Sonnet model with improved capabilities",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 4.1 Opus (Bedrock)",model:"us.anthropic.claude-opus-4-1-20250805-v1:0",description:"Opus model for deep thinking",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.7 Sonnet (Bedrock)",model:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",description:"Enhanced Sonnet model with improved capabilities",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Sonnet v2 (Bedrock)",model:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",description:"Balanced model with strong performance across reasoning, math, and coding",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Haiku (Bedrock)",model:"us.anthropic.claude-3-5-haiku-20241022-v1:0",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Llama 3.3 70B Instruct",model:"us.meta.llama3-3-70b-instruct-v1:0",description:"Large language model optimized for instruction following and chat",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Cohere Embed Multilingual v3",model:"cohere.embed-multilingual-v3",description:"Multilingual text embedding model for semantic search and similarity",providers:["bedrock"],roles:["embed"],thinking:!1},{name:"Cohere Rerank 3.5",model:"cohere.rerank-v3-5:0",description:"Advanced reranking model for improving search result relevance",providers:["bedrock"],roles:["rerank"],thinking:!1},{name:"gpt-oss 20b",model:"gpt-oss:20b",description:"OpenAI\u2019s open-weight models designed for powerful reasoning, agentic tasks, and versatile developer use cases.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Qwen3 8b",model:"qwen3:8b",description:"Qwen3 is the latest generation of large language models in Qwen series.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Gemma3 12b",model:"gemma3:12b",description:"Lightweight gemma models trained by Google, trained to run on a single GPU.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Meta Llama 3.1 8B (W&B)",model:"meta-llama/Llama-3.1-8B-Instruct",description:"Efficient conversational model optimized for responsive multilingual chatbot interactions",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"OpenAI GPT OSS 120B",model:"openai/gpt-oss-120b",description:"Efficient Mixture-of-Experts model designed for high-reasoning, agentic and general-purpose use cases",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"OpenAI GPT OSS 20B",model:"openai/gpt-oss-20b",description:"Lower latency Mixture-of-Experts model trained on OpenAI's Harmony response format with reasoning capabilities",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"DeepSeek V3-0324",model:"deepseek-ai/DeepSeek-V3-0324",description:"Robust Mixture-of-Experts model tailored for high-complexity language processing and comprehensive document analysis",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"Meta Llama 3.3 70B (W&B)",model:"meta-llama/Llama-3.3-70B-Instruct",description:"Multilingual model excelling in conversational tasks, detailed instruction-following, and coding",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"DeepSeek R1-0528",model:"deepseek-ai/DeepSeek-R1-0528",description:"Optimized for precise reasoning tasks including complex coding, math, and structured document analysis",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"MoonshotAI Kimi K2",model:"moonshotai/Kimi-K2-Instruct",description:"Mixture-of-Experts model optimized for complex tool use, reasoning, and code synthesis",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"Z.AI GLM 4.5",model:"zai-org/GLM-4.5",description:"Mixture-of-Experts model with user-controllable thinking/non-thinking modes for strong reasoning, code generation, and agent alignment",providers:["wandb"],roles:["chat","edit"],thinking:!0}],g2=[{name:"OpenAI",id:"openai",description:"OpenAI's API for GPT models, including GPT-3.5 and GPT-4.",url:"https://platform.openai.com/"},{name:"Amazon Bedrock",id:"bedrock",description:"Amazon Bedrock provides access to foundation models from Amazon and leading AI startups via a unified API.",url:"https://aws.amazon.com/bedrock/"},{name:"Azure",id:"azure",description:"Azure provides access to models via the Azure cloud.",url:"https://azure.microsoft.com/en-us/products/ai-services/"},{name:"Anthropic",id:"anthropic",description:"Anthropic's Claude models for conversational and completion tasks.",url:"https://www.anthropic.com/"},{name:"Google AI",id:"google",description:"Google's Vertex AI and PaLM APIs for generative and conversational models.",url:"https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview"},{name:"Ollama",id:"ollama",description:"Ollama is a lightweight, open-source model server for running and sharing LLMs.",url:"https://ollama.ai/"},{name:"GitHub",id:"github",description:"GitHub's API for GPT models with GitHub-hosted models.",url:"https://github.com/features/copilot"},{name:"marimo",id:"marimo",description:"marimo's hosted models.",url:"https://docs.marimo.io/guides/editor_features/ai_completion/"},{name:"DeepSeek",id:"deepseek",description:"DeepSeek's API for GPT models.",url:"https://deepseek.com/"},{name:"LM Studio",id:"lmstudio",description:"LM Studio's API for GPT models.",url:"https://lmstudio.ai/"},{name:"OpenRouter",id:"openrouter",description:"OpenRouter's API for GPT models.",url:"https://openrouter.ai/"},{name:"Mistral",id:"mistral",description:"Mistral's API for GPT models.",url:"https://mistral.ai/"},{name:"Vercel v0",id:"vercel",description:"Vercel's API for GPT models.",url:"https://vercel.com/"},{name:"Together AI",id:"together",description:"Together AI's API for GPT models.",url:"https://together.ai/"},{name:"xAI",id:"xai",description:"xAI's API for GPT models.",url:"https://x.ai/"},{name:"Weights & Biases",id:"wandb",description:"Weights & Biases' hosted models for ML development and AI inference.",url:"https://wandb.ai/"}];var u2=B0(()=>{let o=new Map;for(let e of h2){let t=e.model,n={...e,model:e.model,roles:e.roles.map(r=>r),providers:e.providers,custom:!1};for(let r of n.providers){let l=`${r}/${t}`;o.set(l,n)}}return o}),F0=B0(()=>{let o=new Map,e=new Map;return g2.forEach((t,n)=>{let r=t.id;o.set(r,t),e.set(r,n)}),{providerMap:o,providerToOrderIdx:e}}),R=class W{constructor(e,t){A0(this,"modelsByProviderMap",new C0);this.customModels=new Set(e),this.displayedModels=new Set(t),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:t}=F0();return t.get(e)}static create(e){let{customModels:t=[],displayedModels:n=[]}=e;return new W(t.map(r=>y.parse(r).id),n.map(r=>y.parse(r).id))}buildMaps(){let e=W.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});e.modelsMap.size===0&&(J0.error("The configured displayed_models have filtered out all registered models. Reverting back to showing all models.",[...this.displayedModels]),e=W.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=e.modelsByProviderMap,this.modelsMap=e.modelsMap}static buildMapsFromConfig(e){let{displayedModels:t,customModels:n}=e,r=t.size>0,l=u2(),p=new Map,c=new Map,m=new C0;for(let a of n){if(r&&!t.has(a))continue;let d=y.parse(a),h={name:d.shortModelId,model:d.shortModelId,description:"Custom model",providers:[d.providerId],roles:[],thinking:!1,custom:!0};p.set(a,h)}if(r)for(let a of t){let d=l.get(a);d&&c.set(a,d)}else c=new Map(l);c=new Map([...p,...c]);for(let[a,d]of c.entries()){let h=y.parse(a);m.add(h.providerId,d)}return{modelsByProviderMap:m,modelsMap:c}}getDisplayedModels(){return this.displayedModels}getCustomModels(){return this.customModels}getModelsByProvider(e){return this.modelsByProviderMap.get(e)||[]}getGroupedModelsByProvider(){return this.modelsByProviderMap}getListModelsByProvider(){let e=[...this.getGroupedModelsByProvider().entries()],t=F0().providerToOrderIdx;return e.sort((n,r)=>{let l=n[0],p=r[0];return(t.get(l)??0)-(t.get(p)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}},E0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAnthropic%3c/title%3e%3cpath%20d='M17.3041%203.541h-3.6718l6.696%2016.918H24Zm-10.6082%200L0%2020.459h3.7442l1.3693-3.5527h7.0052l1.3693%203.5528h3.7442L10.5363%203.5409Zm-.3712%2010.2232%202.2914-5.9456%202.2914%205.9456Z'/%3e%3c/svg%3e",v2="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20y='0'%20x='0'%20id='Layer_1'%20version='1.1'%20viewBox='0%200%20300.67%20179.8'%3e%3cstyle%20id='style1855'%20type='text/css'%3e.st1{fill-rule:evenodd;clip-rule:evenodd;fill:%23f90}%3c/style%3e%3cg%20transform='translate(-1.668%20-1.1)'%20id='g1865'%3e%3cpath%20id='path1857'%20d='M86.4%2066.4c0%203.7.4%206.7%201.1%208.9.8%202.2%201.8%204.6%203.2%207.2.5.8.7%201.6.7%202.3%200%201-.6%202-1.9%203L83.2%2092c-.9.6-1.8.9-2.6.9-1%200-2-.5-3-1.4-1.4-1.5-2.6-3.1-3.6-4.7-1-1.7-2-3.6-3.1-5.9-7.8%209.2-17.6%2013.8-29.4%2013.8-8.4%200-15.1-2.4-20-7.2-4.9-4.8-7.4-11.2-7.4-19.2%200-8.5%203-15.4%209.1-20.6%206.1-5.2%2014.2-7.8%2024.5-7.8%203.4%200%206.9.3%2010.6.8%203.7.5%207.5%201.3%2011.5%202.2v-7.3c0-7.6-1.6-12.9-4.7-16-3.2-3.1-8.6-4.6-16.3-4.6-3.5%200-7.1.4-10.8%201.3-3.7.9-7.3%202-10.8%203.4-1.6.7-2.8%201.1-3.5%201.3-.7.2-1.2.3-1.6.3-1.4%200-2.1-1-2.1-3.1v-4.9c0-1.6.2-2.8.7-3.5.5-.7%201.4-1.4%202.8-2.1%203.5-1.8%207.7-3.3%2012.6-4.5C41%201.9%2046.2%201.3%2051.7%201.3c11.9%200%2020.6%202.7%2026.2%208.1%205.5%205.4%208.3%2013.6%208.3%2024.6v32.4zM45.8%2081.6c3.3%200%206.7-.6%2010.3-1.8%203.6-1.2%206.8-3.4%209.5-6.4%201.6-1.9%202.8-4%203.4-6.4.6-2.4%201-5.3%201-8.7v-4.2c-2.9-.7-6-1.3-9.2-1.7-3.2-.4-6.3-.6-9.4-.6-6.7%200-11.6%201.3-14.9%204-3.3%202.7-4.9%206.5-4.9%2011.5%200%204.7%201.2%208.2%203.7%2010.6%202.4%202.5%205.9%203.7%2010.5%203.7zm80.3%2010.8c-1.8%200-3-.3-3.8-1-.8-.6-1.5-2-2.1-3.9L96.7%2010.2c-.6-2-.9-3.3-.9-4%200-1.6.8-2.5%202.4-2.5h9.8c1.9%200%203.2.3%203.9%201%20.8.6%201.4%202%202%203.9l16.8%2066.2%2015.6-66.2c.5-2%201.1-3.3%201.9-3.9.8-.6%202.2-1%204-1h8c1.9%200%203.2.3%204%201%20.8.6%201.5%202%201.9%203.9l15.8%2067%2017.3-67c.6-2%201.3-3.3%202-3.9.8-.6%202.1-1%203.9-1h9.3c1.6%200%202.5.8%202.5%202.5%200%20.5-.1%201-.2%201.6-.1.6-.3%201.4-.7%202.5l-24.1%2077.3c-.6%202-1.3%203.3-2.1%203.9-.8.6-2.1%201-3.8%201h-8.6c-1.9%200-3.2-.3-4-1-.8-.7-1.5-2-1.9-4L156%2023l-15.4%2064.4c-.5%202-1.1%203.3-1.9%204-.8.7-2.2%201-4%201zm128.5%202.7c-5.2%200-10.4-.6-15.4-1.8-5-1.2-8.9-2.5-11.5-4-1.6-.9-2.7-1.9-3.1-2.8-.4-.9-.6-1.9-.6-2.8v-5.1c0-2.1.8-3.1%202.3-3.1.6%200%201.2.1%201.8.3.6.2%201.5.6%202.5%201%203.4%201.5%207.1%202.7%2011%203.5%204%20.8%207.9%201.2%2011.9%201.2%206.3%200%2011.2-1.1%2014.6-3.3%203.4-2.2%205.2-5.4%205.2-9.5%200-2.8-.9-5.1-2.7-7-1.8-1.9-5.2-3.6-10.1-5.2L246%2052c-7.3-2.3-12.7-5.7-16-10.2-3.3-4.4-5-9.3-5-14.5%200-4.2.9-7.9%202.7-11.1%201.8-3.2%204.2-6%207.2-8.2%203-2.3%206.4-4%2010.4-5.2%204-1.2%208.2-1.7%2012.6-1.7%202.2%200%204.5.1%206.7.4%202.3.3%204.4.7%206.5%201.1%202%20.5%203.9%201%205.7%201.6%201.8.6%203.2%201.2%204.2%201.8%201.4.8%202.4%201.6%203%202.5.6.8.9%201.9.9%203.3v4.7c0%202.1-.8%203.2-2.3%203.2-.8%200-2.1-.4-3.8-1.2-5.7-2.6-12.1-3.9-19.2-3.9-5.7%200-10.2.9-13.3%202.8-3.1%201.9-4.7%204.8-4.7%208.9%200%202.8%201%205.2%203%207.1%202%201.9%205.7%203.8%2011%205.5l14.2%204.5c7.2%202.3%2012.4%205.5%2015.5%209.6%203.1%204.1%204.6%208.8%204.6%2014%200%204.3-.9%208.2-2.6%2011.6-1.8%203.4-4.2%206.4-7.3%208.8-3.1%202.5-6.8%204.3-11.1%205.6-4.5%201.4-9.2%202.1-14.3%202.1z'%20fill='%23252f3e'/%3e%3cg%20id='g1863'%3e%3cpath%20id='path1859'%20d='M273.5%20143.7c-32.9%2024.3-80.7%2037.2-121.8%2037.2-57.6%200-109.5-21.3-148.7-56.7-3.1-2.8-.3-6.6%203.4-4.4%2042.4%2024.6%2094.7%2039.5%20148.8%2039.5%2036.5%200%2076.6-7.6%20113.5-23.2%205.5-2.5%2010.2%203.6%204.8%207.6z'%20class='st1'/%3e%3cpath%20id='path1861'%20d='M287.2%20128.1c-4.2-5.4-27.8-2.6-38.5-1.3-3.2.4-3.7-2.4-.8-4.5%2018.8-13.2%2049.7-9.4%2053.3-5%203.6%204.5-1%2035.4-18.6%2050.2-2.7%202.3-5.3%201.1-4.1-1.9%204-9.9%2012.9-32.2%208.7-37.5z'%20class='st1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",f2="data:image/svg+xml,%3csvg%20width='150'%20height='150'%20viewBox='0%200%2096%2096'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='e399c19f-b68f-429d-b176-18c2117ff73c'%20x1='-1032.172'%20x2='-1059.213'%20y1='145.312'%20y2='65.426'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23114a8b'/%3e%3cstop%20offset='1'%20stop-color='%230669bc'/%3e%3c/linearGradient%3e%3clinearGradient%20id='ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15'%20x1='-1023.725'%20x2='-1029.98'%20y1='108.083'%20y2='105.968'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-opacity='.3'/%3e%3cstop%20offset='.071'%20stop-opacity='.2'/%3e%3cstop%20offset='.321'%20stop-opacity='.1'/%3e%3cstop%20offset='.623'%20stop-opacity='.05'/%3e%3cstop%20offset='1'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='a7fee970-a784-4bb1-af8d-63d18e5f7db9'%20x1='-1027.165'%20x2='-997.482'%20y1='147.642'%20y2='68.561'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%233ccbf4'/%3e%3cstop%20offset='1'%20stop-color='%232892df'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23e399c19f-b68f-429d-b176-18c2117ff73c)'%20d='M33.338%206.544h26.038l-27.03%2080.087a4.152%204.152%200%200%201-3.933%202.824H8.149a4.145%204.145%200%200%201-3.928-5.47L29.404%209.368a4.152%204.152%200%200%201%203.934-2.825z'/%3e%3cpath%20fill='%230078d4'%20d='M71.175%2060.261h-41.29a1.911%201.911%200%200%200-1.305%203.309l26.532%2024.764a4.171%204.171%200%200%200%202.846%201.121h23.38z'/%3e%3cpath%20fill='url(%23ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15)'%20d='M33.338%206.544a4.118%204.118%200%200%200-3.943%202.879L4.252%2083.917a4.14%204.14%200%200%200%203.908%205.538h20.787a4.443%204.443%200%200%200%203.41-2.9l5.014-14.777%2017.91%2016.705a4.237%204.237%200%200%200%202.666.972H81.24L71.024%2060.261l-29.781.007L59.47%206.544z'/%3e%3cpath%20fill='url(%23a7fee970-a784-4bb1-af8d-63d18e5f7db9)'%20d='M66.595%209.364a4.145%204.145%200%200%200-3.928-2.82H33.648a4.146%204.146%200%200%201%203.928%202.82l25.184%2074.62a4.146%204.146%200%200%201-3.928%205.472h29.02a4.146%204.146%200%200%200%203.927-5.472z'/%3e%3c/svg%3e",x2="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDeepSeek%3c/title%3e%3cpath%20d='M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'%3e%3c/path%3e%3c/svg%3e",k2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%3c/title%3e%3cpath%20d='M12%20.297c-6.63%200-12%205.373-12%2012%200%205.303%203.438%209.8%208.205%2011.385.6.113.82-.258.82-.577%200-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422%2018.07%203.633%2017.7%203.633%2017.7c-1.087-.744.084-.729.084-.729%201.205.084%201.838%201.236%201.838%201.236%201.07%201.835%202.809%201.305%203.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93%200-1.31.465-2.38%201.235-3.22-.135-.303-.54-1.523.105-3.176%200%200%201.005-.322%203.3%201.23.96-.267%201.98-.399%203-.405%201.02.006%202.04.138%203%20.405%202.28-1.552%203.285-1.23%203.285-1.23.645%201.653.24%202.873.12%203.176.765.84%201.23%201.91%201.23%203.22%200%204.61-2.805%205.625-5.475%205.92.42.36.81%201.096.81%202.22%200%201.606-.015%202.896-.015%203.286%200%20.315.21.69.825.57C20.565%2022.092%2024%2017.592%2024%2012.297c0-6.627-5.373-12-12-12'/%3e%3c/svg%3e",V0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20Gemini%3c/title%3e%3cpath%20d='M11.04%2019.32Q12%2021.51%2012%2024q0-2.49.93-4.68.96-2.19%202.58-3.81t3.81-2.55Q21.51%2012%2024%2012q-2.49%200-4.68-.93a12.3%2012.3%200%200%201-3.81-2.58%2012.3%2012.3%200%200%201-2.58-3.81Q12%202.49%2012%200q0%202.49-.96%204.68-.93%202.19-2.55%203.81a12.3%2012.3%200%200%201-3.81%202.58Q2.49%2012%200%2012q2.49%200%204.68.96%202.19.93%203.81%202.55t2.55%203.81'/%3e%3c/svg%3e",w2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z'/%3e%3c/svg%3e",H0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.2819%209.8211a5.9847%205.9847%200%200%200-.5157-4.9108%206.0462%206.0462%200%200%200-6.5098-2.9A6.0651%206.0651%200%200%200%204.9807%204.1818a5.9847%205.9847%200%200%200-3.9977%202.9%206.0462%206.0462%200%200%200%20.7427%207.0966%205.98%205.98%200%200%200%20.511%204.9107%206.051%206.051%200%200%200%206.5146%202.9001A5.9847%205.9847%200%200%200%2013.2599%2024a6.0557%206.0557%200%200%200%205.7718-4.2058%205.9894%205.9894%200%200%200%203.9977-2.9001%206.0557%206.0557%200%200%200-.7475-7.0729zm-9.022%2012.6081a4.4755%204.4755%200%200%201-2.8764-1.0408l.1419-.0804%204.7783-2.7582a.7948.7948%200%200%200%20.3927-.6813v-6.7369l2.02%201.1686a.071.071%200%200%201%20.038.052v5.5826a4.504%204.504%200%200%201-4.4945%204.4944zm-9.6607-4.1254a4.4708%204.4708%200%200%201-.5346-3.0137l.142.0852%204.783%202.7582a.7712.7712%200%200%200%20.7806%200l5.8428-3.3685v2.3324a.0804.0804%200%200%201-.0332.0615L9.74%2019.9502a4.4992%204.4992%200%200%201-6.1408-1.6464zM2.3408%207.8956a4.485%204.485%200%200%201%202.3655-1.9728V11.6a.7664.7664%200%200%200%20.3879.6765l5.8144%203.3543-2.0201%201.1685a.0757.0757%200%200%201-.071%200l-4.8303-2.7865A4.504%204.504%200%200%201%202.3408%207.872zm16.5963%203.8558L13.1038%208.364%2015.1192%207.2a.0757.0757%200%200%201%20.071%200l4.8303%202.7913a4.4944%204.4944%200%200%201-.6765%208.1042v-5.6772a.79.79%200%200%200-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759%200%200%200-.7854%200L9.409%209.2297V6.8974a.0662.0662%200%200%201%20.0284-.0615l4.8303-2.7866a4.4992%204.4992%200%200%201%206.6802%204.66zM8.3065%2012.863l-2.02-1.1638a.0804.0804%200%200%201-.038-.0567V6.0742a4.4992%204.4992%200%200%201%207.3757-3.4537l-.142.0805L8.704%205.459a.7948.7948%200%200%200-.3927.6813zm1.0976-2.3654l2.602-1.4998%202.6069%201.4998v2.9994l-2.5974%201.4997-2.6067-1.4997Z'/%3e%3c/svg%3e",M2="data:image/svg+xml,%3csvg%20width='240'%20height='300'%20viewBox='0%200%20240%20300'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1401_86274)'%3e%3cmask%20id='mask0_1401_86274'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='240'%20height='300'%3e%3cpath%20d='M240%200H0V300H240V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1401_86274)'%3e%3cpath%20d='M180%20240H60V120H180V240Z'%20fill='%23CFCECD'/%3e%3cpath%20d='M180%2060H60V240H180V60ZM240%20300H0V0H240V300Z'%20fill='%23211E1E'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1401_86274'%3e%3crect%20width='240'%20height='300'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",b2="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenRouter%3c/title%3e%3cpath%20d='M16.804%201.957l7.22%204.105v.087L16.73%2010.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147%201.352L8.345%2011.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314%201.17.796%202.701%201.866%201.11.775%202.083%201.177%203.147%201.352l.3.045c.694.091%201.375.094%202.825.033l.022-2.159%207.22%204.105v.087L16.589%2022l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997%2021.997%200%2000-.755-.498l-.467-.28a55.927%2055.927%200%2000-.76-.43C2.908%2014.73.563%2014.116%200%2014.116V9.888l.14.004c.564-.007%202.91-.622%203.809-1.124l1.016-.58.438-.274c.428-.28%201.072-.726%202.686-1.853%201.621-1.133%203.186-1.78%204.881-2.059%201.152-.19%201.974-.213%203.814-.138l.02-1.907z'%3e%3c/path%3e%3c/svg%3e",y2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeights%20&%20Biases%3c/title%3e%3cpath%20d='M2.48%200a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.101%201.55%201.55%200%200%200%200-3.101zM12%202.295a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zM2.48%205.272a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zm19.04%200a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zM12%208.496a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm-9.52%203.907a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.102zM12%2013.767a2.48%202.48%200%201%200%200%204.962%202.48%202.48%200%200%200%200-4.962zm-9.52%203.907a2.48%202.48%200%201%200%20.001%204.962%202.48%202.48%200%200%200%200-4.962zm19.04.93a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.101zM12%2020.9a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1Z'/%3e%3c/svg%3e",A2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABtlJREFUWEetV21QlNcVfs67y67KV/EjJIRdBIxJrB9BotFqAtERTIKkk8SxNiGt7Ipa46DsxvjR0rVTKuKKJFYTE1SIxmhFbR0Kwc4YNSraqmNswhSFIrBUBD8QVGTZfU/nvrDLroqQ4Pm179nnnvvc5557zr2EXlj05hSfhgvO10AUB/A4AOHEFMCADOJrBFQx0zki+ajkkA9eyslr6kVYBUIPA8ZaLOr/ttQtYJKXgRHSy6B2EBVKwMZqa+6hnsZ0S2DY8jlD2uxSIYDxPQVx/S+CSZIEpyx3rI5wXIZsslm3neouxoMJMEhvNv6JwcvcwYkw8kk9xoZFYOjgYAT2HwBZlnH99i1UNtbj9KVKVDZcho9KhX4+GtgdDrQ52sVwGYQcbduAFRUbNrTdS+R+AhaLpL9Vu4kZ8wTYV6vFrydNxTsTY/Bk0KCHinHxymVsP/E1vjz1jRvXSQIEOqGxO39esWFbo2cQbwIzZ6r0QwPSWUa6APlp++GgyYLgwCB8dqQEs8a/iEF+/j3uSPW1RqTt2orTVRfBHmgCyjQaObZidRcJLwJPL032b3XSEQaixMqTJr6s7GlDcxNOVpZj13wz9IOG9EhAABxOJ5buyUfB6RNeeCKU+vnpYsssFrvXKYhImzvcQfJXDISH/GQg5kyeiqzifYh5eiSss+ZgoK9fryb2BMnMeG/HZhR+e/peEmtqrFuU/OpQwGKRdC21pSLjJZKwMuEtZBbtw6ujx+LDXxohfD/WWu12JH6UgfL6OncIAtpVKh5VlbW1XCGgMxlnA7xT/H4zeiLO26oVCUtMv1cyuq/2na0aMz7KcB/PzjO6rdaam6wQ0JuNx5h5EhFhybQZyD54AJuS5iNhzPN9nds9fsXeHdhRetgz3m2nv+ox6ig4qnqAped04UqWn6utwr/SrVBLKmWAkPHClS4Jw4c8jsbmmzheUYaA/r6YPjJKUcp24yqOlH8PiQgvDv8pQj2Obf3NG5i8erlSH9wmcTyFmQ2vyQxR8ZASE48vTh7BlGdGYWOSUgYU+76uBtPXW9zfyZOnYnvpYbQ7nYovSh+BJXGvY27en13FB1ofH+Qlp2LyUyPc4xZ/uQX7zohUcxmvJJ05OQ1M64TrMf9ANLTcxOK4RKTFJXZLQKxQZLin9ffRoLVdOVluGxsWib8tWun+/uZCGd7+NNsTkk+hJkMOAanCK2S8225HeuIsGF+a1i2B0KDBGB4cgkP/Oe/GaNRqxI14DkcvlqG59Y7iF/Eurv7EjRGKjU5Pxe22uy7fYdKZjflgfteT1gevvIGFU1/tlsCnv1qIV0ZFY8If30dd0zUFN2PMOGxKWoDMogJsPFSk+IRS1Wu3eKky6+O1KK0sV3xEKBdNZzszv+OJSvpZLDLe6HLdmwP5hsWY8uxoxK5ZoTQiYTOfn4TsXxiw/h8HkF3y124JLCv4HDtPHu2YjtBIOpNhI4DfeBKIDovE/kXLu1WgLwQy/74Xm74udsVuIr3JsJSBNZ4EREs9tyoH/v36K+5HqUBG4R5sPlzSqQDZSG8yTmPwQReBwX7+uHqrBetnG5Sq+KgJpO7Mxf6zJztzgI5TsDnJV8PaRoCV5Y4bOkyp2888EYqChR8owLob15TG5LJ5sdMxIkSHjMK/oKH5puIeHzEcb0+IwVffnUXx+TOuCZAz2+iVhFOyfoeKhsudKUAbOkuxoYAZbwqvODqvR43H7n8ew/73liN6aKRXgL58VDbU4+Ws37pDSISEDgL3bIOQvvjfZ/FsSCj2LlymHKdHYaZdW7Gn835AwBU//2a9KzLpTMYTAE8QE4kJxfWr9vpVrEyYiXmx8X2ev+j8GSzY/gm4s4ISsaXGunWVe2mh5pQXiJ3i+uLV/EVD+vjd+YgfGfWjSYjtFN2w3dnZiAg2lZ9z1CVLXpOXtnqzIZMZHZnnYYLEkvhEpMTEQav26TWR/zVdxx8O7IZYvYexxJRQnZ2rlEsvAuIhUtliKwK4qxF4jBStetqIMYgKi0TEkGA8ERiEwf4BGKDRulFCYtHOd586hr1nSt3d0QUgolU11lx3a70vu8TF9I5MxWBM8qT9eEAQ1CoJthsdtd9LIfEWUPsouWN3OnC3XXkP3G+E7FrrFjPQdVl+YHqHWFIGqG/J+cz8lmcUX41WSU5R/12vn17uRxskMtWuzRVl38sedr5It3TuPJI5k5kDe5yIqAqACoyBAHtcoamE4EyrWbet7MGi9BA5PNUY7FDjfYCTAQT1SKQDcAmMQiLKq1mX65WBP0QBL+ywRYu0dk3rSwx+AUAkCEFg8eLCHWJcYeYaSVKXOyT527qsXFsvieL/FjzLIPLjeMUAAAAASUVORK5CYII=",z2=$(),j2=z0(W0(),1),i=z0(e2(),1),K0={openai:H0,anthropic:E0,claude:E0,gemini:V0,google:V0,codex:H0,ollama:w2,azure:f2,bedrock:v2,deepseek:x2,github:k2,openrouter:b2,wandb:y2,marimo:A2,opencode:M2};const V=o=>{let e=(0,z2.c)(15),t,n,r;e[0]===o?(t=e[1],n=e[2],r=e[3]):({provider:n,className:r,...t}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r);let l=r===void 0?"":r;if(n==="openai-compatible"||!(n in K0)){let a;e[4]===l?a=e[5]:(a=I0("h-4 w-4",l),e[4]=l,e[5]=a);let d;return e[6]===a?d=e[7]:(d=(0,i.jsx)(G0,{className:a}),e[6]=a,e[7]=d),d}let p=K0[n],c;e[8]===l?c=e[9]:(c=I0("h-4 w-4 grayscale dark:invert",l),e[8]=l,e[9]=c);let m;return e[10]!==p||e[11]!==t||e[12]!==n||e[13]!==c?(m=(0,i.jsx)("img",{src:p,alt:n,className:c,...t}),e[10]=p,e[11]=t,e[12]=n,e[13]=c,e[14]=m):m=e[14],m};function U(o){switch(o){case"chat":return"bg-[var(--purple-3)] text-[var(--purple-11)]";case"autocomplete":return"bg-[var(--green-3)] text-[var(--green-11)]";case"edit":return"bg-[var(--blue-3)] text-[var(--blue-11)]";case"thinking":return"bg-[var(--purple-4)] text-[var(--purple-12)]"}return"bg-[var(--mauve-3)] text-[var(--mauve-11)]"}function Z0(o){switch(o){case"chat":return"Current model used for chat conversations";case"autocomplete":return"Current model used for autocomplete autocomplete";case"edit":return"Current model used for code edits";case"rerank":return"Current model used for reranking completions";case"embed":return"Current model used for embedding"}}var D=$();const G2=o=>{var a0,r0,n0,l0,d0,c0,m0,p0,h0,g0,u0,v0,f0,x0,k0,w0,M0,b0;let e=(0,D.c)(58),{value:t,placeholder:n,onSelect:r,triggerClassName:l,customDropdownContent:p,iconSize:c,showAddCustomModelDocs:m,forRole:a,displayIconOnly:d}=o,h=c===void 0?"medium":c,u=m===void 0?!1:m,g=d===void 0?!1:d,[v,f]=j2.useState(!1),s=j0(X0),k=j0(_0),{saveModelChange:x}=O0(),j=k.copilot==="custom"?(a0=s==null?void 0:s.models)==null?void 0:a0.autocomplete_model:void 0,G,I,M,B,P,b,S,L,C;if(e[0]!==((r0=s==null?void 0:s.models)==null?void 0:r0.autocomplete_model)||e[1]!==((n0=s==null?void 0:s.models)==null?void 0:n0.chat_model)||e[2]!==((l0=s==null?void 0:s.models)==null?void 0:l0.custom_models)||e[3]!==((d0=s==null?void 0:s.models)==null?void 0:d0.displayed_models)||e[4]!==((c0=s==null?void 0:s.models)==null?void 0:c0.edit_model)||e[5]!==j||e[6]!==g||e[7]!==a||e[8]!==h||e[9]!==v||e[10]!==r||e[11]!==n||e[12]!==x||e[13]!==l||e[14]!==t){let y0=R.create({customModels:[...((m0=s==null?void 0:s.models)==null?void 0:m0.custom_models)??[],(p0=s==null?void 0:s.models)==null?void 0:p0.chat_model,j,(h0=s==null?void 0:s.models)==null?void 0:h0.edit_model].filter(Boolean),displayedModels:(g0=s==null?void 0:s.models)==null?void 0:g0.displayed_models}),Q0=y0.getListModelsByProvider(),A=a==="autocomplete"?(u0=s==null?void 0:s.models)==null?void 0:u0.autocomplete_model:a==="chat"?(v0=s==null?void 0:s.models)==null?void 0:v0.chat_model:a==="edit"?(f0=s==null?void 0:s.models)==null?void 0:f0.edit_model:void 0,H=t?y.parse(t):A?y.parse(A):void 0,T=h==="medium"?"h-4 w-4":"h-3 w-3",Y0=(w,z)=>{let K=y0.getModel(w.id);return(0,i.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[(0,i.jsx)(V,{provider:w.providerId,className:T}),(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{children:(K==null?void 0:K.name)||w.shortModelId}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:w.id})]}),(0,i.jsx)("div",{className:"ml-auto flex gap-1",children:(0,i.jsx)(t0,{content:Z0(z),children:(0,i.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${U(z)}`,children:z},z)})})]})},Q;e[24]!==a||e[25]!==r||e[26]!==x?(Q=w=>{r?r(w):x(w,a),f(!1)},e[24]=a,e[25]=r,e[26]=x,e[27]=Q):Q=e[27];let q=Q;I=d2,L=v,C=f;let J=`flex items-center justify-between px-2 py-0.5 border rounded-md
2
2
  hover:bg-accent hover:text-accent-foreground ${l}`,_=H?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(V,{provider:H.providerId,className:T}),g?null:(0,i.jsx)("span",{className:"truncate",children:i0(H.providerId)?H.shortModelId:H.id})]}):(0,i.jsx)("span",{className:"text-muted-foreground truncate",children:n}),F;e[28]===_?F=e[29]:(F=(0,i.jsx)("div",{className:"flex items-center gap-2 truncate",children:_}),e[28]=_,e[29]=F);let X=`${T} ml-1`,E;e[30]===X?E=e[31]:(E=(0,i.jsx)(o2,{className:X}),e[30]=X,e[31]=E),e[32]!==J||e[33]!==F||e[34]!==E?(M=(0,i.jsxs)(r2,{className:J,children:[F,E]}),e[32]=J,e[33]=F,e[34]=E,e[35]=M):M=e[35],G=n2,B="w-[300px]",P=A&&a&&Y0(y.parse(A),a),e[36]!==A||e[37]!==a?(b=A&&a&&(0,i.jsx)(e0,{}),e[36]=A,e[37]=a,e[38]=b):b=e[38];let Y;e[39]!==q||e[40]!==T?(Y=w=>{let[z,K]=w;return(0,i.jsx)(I2,{provider:z,onSelect:q,models:K,iconSizeClass:T},z)},e[39]=q,e[40]=T,e[41]=Y):Y=e[41],S=Q0.map(Y),e[0]=(x0=s==null?void 0:s.models)==null?void 0:x0.autocomplete_model,e[1]=(k0=s==null?void 0:s.models)==null?void 0:k0.chat_model,e[2]=(w0=s==null?void 0:s.models)==null?void 0:w0.custom_models,e[3]=(M0=s==null?void 0:s.models)==null?void 0:M0.displayed_models,e[4]=(b0=s==null?void 0:s.models)==null?void 0:b0.edit_model,e[5]=j,e[6]=g,e[7]=a,e[8]=h,e[9]=v,e[10]=r,e[11]=n,e[12]=x,e[13]=l,e[14]=t,e[15]=G,e[16]=I,e[17]=M,e[18]=B,e[19]=P,e[20]=b,e[21]=S,e[22]=L,e[23]=C}else G=e[15],I=e[16],M=e[17],B=e[18],P=e[19],b=e[20],S=e[21],L=e[22],C=e[23];let N;e[42]===u?N=e[43]:(N=u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e0,{}),(0,i.jsx)(a2,{className:"flex items-center gap-2",children:(0,i.jsxs)("a",{className:"flex items-center gap-1",href:"https://links.marimo.app/custom-models",target:"_blank",rel:"noreferrer",children:[(0,i.jsx)(s2,{className:"h-3 w-3"}),(0,i.jsx)("span",{children:"How to add a custom model"})]})})]}),e[42]=u,e[43]=N);let O;e[44]!==G||e[45]!==p||e[46]!==N||e[47]!==B||e[48]!==P||e[49]!==b||e[50]!==S?(O=(0,i.jsxs)(G,{className:B,children:[P,b,S,p,N]}),e[44]=G,e[45]=p,e[46]=N,e[47]=B,e[48]=P,e[49]=b,e[50]=S,e[51]=O):O=e[51];let Z;return e[52]!==I||e[53]!==M||e[54]!==O||e[55]!==L||e[56]!==C?(Z=(0,i.jsxs)(I,{open:L,onOpenChange:C,children:[M,O]}),e[52]=I,e[53]=M,e[54]=O,e[55]=L,e[56]=C,e[57]=Z):Z=e[57],Z};var I2=o=>{let e=(0,D.c)(26),{provider:t,onSelect:n,models:r,iconSizeClass:l}=o,p=i0(t)?t:"openai-compatible",c;e[0]===t?c=e[1]:(c=R.getProviderInfo(t),e[0]=t,e[1]=c);let m=c;if(r.length===0)return null;let a;e[2]!==p||e[3]!==l?(a=(0,i.jsx)(V,{provider:p,className:l}),e[2]=p,e[3]=l,e[4]=a):a=e[4];let d;e[5]===t?d=e[6]:(d=o0(t),e[5]=t,e[6]=d);let h;e[7]!==a||e[8]!==d?(h=(0,i.jsx)(S0,{children:(0,i.jsxs)("p",{className:"flex items-center gap-2",children:[a,d]})}),e[7]=a,e[8]=d,e[9]=h):h=e[9];let u=m?-90:0,g;e[10]===m?g=e[11]:(g=m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{className:"text-sm text-muted-foreground p-2 max-w-[300px]",children:[m.description,(0,i.jsx)("br",{})]}),(0,i.jsxs)("p",{className:"text-sm text-muted-foreground p-2 pt-0",children:["For more information, see the"," ",(0,i.jsx)("a",{href:m.url,target:"_blank",className:"underline",rel:"noreferrer","aria-label":"Provider details",children:"provider details"}),"."]}),(0,i.jsx)(e0,{})]}),e[10]=m,e[11]=g);let v;if(e[12]!==r||e[13]!==n||e[14]!==t){let k;e[16]!==n||e[17]!==t?(k=x=>{let j=`${t}/${x.model}`;return(0,i.jsxs)(L0,{children:[(0,i.jsx)(S0,{showChevron:!1,className:"py-2",children:(0,i.jsx)("div",{className:"flex items-center gap-2 w-full cursor-pointer",onClick:()=>{n(j)},children:(0,i.jsx)(B2,{model:x,provider:t})})}),(0,i.jsx)(P0,{className:"p-4 w-80",children:(0,i.jsx)(P2,{model:x,provider:t})})]},j)},e[16]=n,e[17]=t,e[18]=k):k=e[18],v=r.map(k),e[12]=r,e[13]=n,e[14]=t,e[15]=v}else v=e[15];let f;e[19]!==u||e[20]!==g||e[21]!==v?(f=(0,i.jsx)(l2,{children:(0,i.jsxs)(P0,{className:"max-h-[40vh] overflow-y-auto",alignOffset:u,sideOffset:5,children:[g,v]})}),e[19]=u,e[20]=g,e[21]=v,e[22]=f):f=e[22];let s;return e[23]!==h||e[24]!==f?(s=(0,i.jsxs)(L0,{children:[h,f]}),e[23]=h,e[24]=f,e[25]=s):s=e[25],s},B2=o=>{let e=(0,D.c)(17),{model:t,provider:n}=o,r=i0(n)?n:"openai-compatible",l;e[0]===r?l=e[1]:(l=(0,i.jsx)(V,{provider:r,className:"h-4 w-4"}),e[0]=r,e[1]=l);let p;e[2]===t.name?p=e[3]:(p=(0,i.jsx)("span",{children:t.name}),e[2]=t.name,e[3]=p);let c;e[4]===t.thinking?c=e[5]:(c=t.thinking&&(0,i.jsx)(t0,{content:"Reasoning model",children:(0,i.jsx)(N0,{className:`h-5 w-5 rounded-md p-1 ${U("thinking")}`})}),e[4]=t.thinking,e[5]=c);let m;e[6]===c?m=e[7]:(m=(0,i.jsx)("div",{className:"ml-auto",children:c}),e[6]=c,e[7]=m);let a;e[8]!==p||e[9]!==m?(a=(0,i.jsxs)("div",{className:"flex flex-row w-full items-center",children:[p,m]}),e[8]=p,e[9]=m,e[10]=a):a=e[10];let d;e[11]===t.custom?d=e[12]:(d=t.custom&&(0,i.jsx)(t0,{content:"Custom model",children:(0,i.jsx)(G0,{className:"h-5 w-5"})}),e[11]=t.custom,e[12]=d);let h;return e[13]!==l||e[14]!==a||e[15]!==d?(h=(0,i.jsxs)(i.Fragment,{children:[l,a,d]}),e[13]=l,e[14]=a,e[15]=d,e[16]=h):h=e[16],h};const P2=o=>{let e=(0,D.c)(28),{model:t,provider:n}=o,r;e[0]===t.name?r=e[1]:(r=(0,i.jsx)("h4",{className:"font-semibold text-base text-foreground",children:t.name}),e[0]=t.name,e[1]=r);let l;e[2]===t.model?l=e[3]:(l=(0,i.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:t.model}),e[2]=t.model,e[3]=l);let p;e[4]!==r||e[5]!==l?(p=(0,i.jsxs)("div",{children:[r,l]}),e[4]=r,e[5]=l,e[6]=p):p=e[6];let c;e[7]===t.description?c=e[8]:(c=(0,i.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.description}),e[7]=t.description,e[8]=c);let m;e[9]===t.roles?m=e[10]:(m=t.roles.length>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Capabilities:"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-1",children:t.roles.map(S2)})]}),e[9]=t.roles,e[10]=m);let a;e[11]===t.thinking?a=e[12]:(a=t.thinking&&(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-pulse"}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:"Supports thinking mode"})]}),e[11]=t.thinking,e[12]=a);let d;e[13]===n?d=e[14]:(d=(0,i.jsx)(V,{provider:n,className:"h-4 w-4"}),e[13]=n,e[14]=d);let h;e[15]===n?h=e[16]:(h=o0(n),e[15]=n,e[16]=h);let u;e[17]===h?u=e[18]:(u=(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:h}),e[17]=h,e[18]=u);let g;e[19]!==d||e[20]!==u?(g=(0,i.jsxs)("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[d,u]}),e[19]=d,e[20]=u,e[21]=g):g=e[21];let v;return e[22]!==g||e[23]!==p||e[24]!==c||e[25]!==m||e[26]!==a?(v=(0,i.jsxs)("div",{className:"space-y-3",children:[p,c,m,a,g]}),e[22]=g,e[23]=p,e[24]=c,e[25]=m,e[26]=a,e[27]=v):v=e[27],v};function o0(o){let e=R.getProviderInfo(o);return e?e.name:q0(o)}function S2(o){return(0,i.jsx)("span",{className:`px-2 py-1 text-xs rounded-md font-medium ${U(o)}`,title:Z0(o),children:o},o)}export{R as a,O0 as c,V as i,N0 as l,o0 as n,y as o,U as r,T0 as s,G2 as t};
@@ -1,4 +1,4 @@
1
- import{s as E}from"./chunk-LvLJmgfZ.js";import{t as Te}from"./react-BGmjiNul.js";import{t as P}from"./compiler-runtime-DeeZ7FnK.js";import{r as N}from"./useEventListener-COkmyg1v.js";import{t as $e}from"./jsx-runtime-DN_bIXfG.js";import{n as R}from"./button-DuYGqRtX.js";import{t as p}from"./cn-C1rgT0yh.js";import{E as M,S as ke,T as ze,_ as h,a as Be,b as He,d as We,f as b,i as qe,m as Ke,r as Le,s as Ue,t as Ve,u as Ye,w as v,x as w,y as Ze}from"./Combination-D1TsGrBC.js";var i=E(Te(),1),l=E($e(),1),j="Dialog",[S,T]=M(j),[Ge,f]=S(j),$=t=>{let{__scopeDialog:r,children:e,open:a,defaultOpen:o,onOpenChange:n,modal:s=!0}=t,c=i.useRef(null),d=i.useRef(null),[u,x]=ke({prop:a,defaultProp:o??!1,onChange:n,caller:j});return(0,l.jsx)(Ge,{scope:r,triggerRef:c,contentRef:d,contentId:b(),titleId:b(),descriptionId:b(),open:u,onOpenChange:x,onOpenToggle:i.useCallback(()=>x(Se=>!Se),[x]),modal:s,children:e})};$.displayName=j;var k="DialogTrigger",z=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(k,e),n=N(r,o.triggerRef);return(0,l.jsx)(h.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":O(o.open),...a,ref:n,onClick:v(t.onClick,o.onOpenToggle)})});z.displayName=k;var A="DialogPortal",[Je,B]=S(A,{forceMount:void 0}),H=t=>{let{__scopeDialog:r,forceMount:e,children:a,container:o}=t,n=f(A,r);return(0,l.jsx)(Je,{scope:r,forceMount:e,children:i.Children.map(a,s=>(0,l.jsx)(w,{present:e||n.open,children:(0,l.jsx)(We,{asChild:!0,container:o,children:s})}))})};H.displayName=A;var _="DialogOverlay",W=i.forwardRef((t,r)=>{let e=B(_,t.__scopeDialog),{forceMount:a=e.forceMount,...o}=t,n=f(_,t.__scopeDialog);return n.modal?(0,l.jsx)(w,{present:a||n.open,children:(0,l.jsx)(Xe,{...o,ref:r})}):null});W.displayName=_;var Qe=Ze("DialogOverlay.RemoveScroll"),Xe=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(_,e);return(0,l.jsx)(Ve,{as:Qe,allowPinchZoom:!0,shards:[o.contentRef],children:(0,l.jsx)(h.div,{"data-state":O(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),y="DialogContent",q=i.forwardRef((t,r)=>{let e=B(y,t.__scopeDialog),{forceMount:a=e.forceMount,...o}=t,n=f(y,t.__scopeDialog);return(0,l.jsx)(w,{present:a||n.open,children:n.modal?(0,l.jsx)(er,{...o,ref:r}):(0,l.jsx)(rr,{...o,ref:r})})});q.displayName=y;var er=i.forwardRef((t,r)=>{let e=f(y,t.__scopeDialog),a=i.useRef(null),o=N(r,e.contentRef,a);return i.useEffect(()=>{let n=a.current;if(n)return Le(n)},[]),(0,l.jsx)(K,{...t,ref:o,trapFocus:e.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:v(t.onCloseAutoFocus,n=>{var s;n.preventDefault(),(s=e.triggerRef.current)==null||s.focus()}),onPointerDownOutside:v(t.onPointerDownOutside,n=>{let s=n.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&n.preventDefault()}),onFocusOutside:v(t.onFocusOutside,n=>n.preventDefault())})}),rr=i.forwardRef((t,r)=>{let e=f(y,t.__scopeDialog),a=i.useRef(!1),o=i.useRef(!1);return(0,l.jsx)(K,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var s,c;(s=t.onCloseAutoFocus)==null||s.call(t,n),n.defaultPrevented||(a.current||((c=e.triggerRef.current)==null||c.focus()),n.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:n=>{var c,d;(c=t.onInteractOutside)==null||c.call(t,n),n.defaultPrevented||(a.current=!0,n.detail.originalEvent.type==="pointerdown"&&(o.current=!0));let s=n.target;(d=e.triggerRef.current)!=null&&d.contains(s)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&o.current&&n.preventDefault()}})}),K=i.forwardRef((t,r)=>{let{__scopeDialog:e,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:n,...s}=t,c=f(y,e),d=i.useRef(null),u=N(r,d);return Be(),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(qe,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:n,children:(0,l.jsx)(Ke,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":O(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ar,{titleId:c.titleId}),(0,l.jsx)(nr,{contentRef:d,descriptionId:c.descriptionId})]})]})}),C="DialogTitle",L=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(C,e);return(0,l.jsx)(h.h2,{id:o.titleId,...a,ref:r})});L.displayName=C;var U="DialogDescription",V=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(U,e);return(0,l.jsx)(h.p,{id:o.descriptionId,...a,ref:r})});V.displayName=U;var Y="DialogClose",Z=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(Y,e);return(0,l.jsx)(h.button,{type:"button",...a,ref:r,onClick:v(t.onClick,()=>o.onOpenChange(!1))})});Z.displayName=Y;function O(t){return t?"open":"closed"}var G="DialogTitleWarning",[tr,J]=ze(G,{contentName:y,titleName:C,docsSlug:"dialog"}),ar=({titleId:t})=>{let r=J(G),e=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
1
+ import{s as E}from"./chunk-LvLJmgfZ.js";import{t as Te}from"./react-BGmjiNul.js";import{t as P}from"./compiler-runtime-DeeZ7FnK.js";import{r as N}from"./useEventListener-COkmyg1v.js";import{t as $e}from"./jsx-runtime-DN_bIXfG.js";import{n as R}from"./button-B8cGZzP5.js";import{t as p}from"./cn-C1rgT0yh.js";import{E as M,S as ke,T as ze,_ as h,a as Be,b as He,d as We,f as b,i as qe,m as Ke,r as Le,s as Ue,t as Ve,u as Ye,w as v,x as w,y as Ze}from"./Combination-D1TsGrBC.js";var i=E(Te(),1),l=E($e(),1),j="Dialog",[S,T]=M(j),[Ge,f]=S(j),$=t=>{let{__scopeDialog:r,children:e,open:a,defaultOpen:o,onOpenChange:n,modal:s=!0}=t,c=i.useRef(null),d=i.useRef(null),[u,x]=ke({prop:a,defaultProp:o??!1,onChange:n,caller:j});return(0,l.jsx)(Ge,{scope:r,triggerRef:c,contentRef:d,contentId:b(),titleId:b(),descriptionId:b(),open:u,onOpenChange:x,onOpenToggle:i.useCallback(()=>x(Se=>!Se),[x]),modal:s,children:e})};$.displayName=j;var k="DialogTrigger",z=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(k,e),n=N(r,o.triggerRef);return(0,l.jsx)(h.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":O(o.open),...a,ref:n,onClick:v(t.onClick,o.onOpenToggle)})});z.displayName=k;var A="DialogPortal",[Je,B]=S(A,{forceMount:void 0}),H=t=>{let{__scopeDialog:r,forceMount:e,children:a,container:o}=t,n=f(A,r);return(0,l.jsx)(Je,{scope:r,forceMount:e,children:i.Children.map(a,s=>(0,l.jsx)(w,{present:e||n.open,children:(0,l.jsx)(We,{asChild:!0,container:o,children:s})}))})};H.displayName=A;var _="DialogOverlay",W=i.forwardRef((t,r)=>{let e=B(_,t.__scopeDialog),{forceMount:a=e.forceMount,...o}=t,n=f(_,t.__scopeDialog);return n.modal?(0,l.jsx)(w,{present:a||n.open,children:(0,l.jsx)(Xe,{...o,ref:r})}):null});W.displayName=_;var Qe=Ze("DialogOverlay.RemoveScroll"),Xe=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(_,e);return(0,l.jsx)(Ve,{as:Qe,allowPinchZoom:!0,shards:[o.contentRef],children:(0,l.jsx)(h.div,{"data-state":O(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),y="DialogContent",q=i.forwardRef((t,r)=>{let e=B(y,t.__scopeDialog),{forceMount:a=e.forceMount,...o}=t,n=f(y,t.__scopeDialog);return(0,l.jsx)(w,{present:a||n.open,children:n.modal?(0,l.jsx)(er,{...o,ref:r}):(0,l.jsx)(rr,{...o,ref:r})})});q.displayName=y;var er=i.forwardRef((t,r)=>{let e=f(y,t.__scopeDialog),a=i.useRef(null),o=N(r,e.contentRef,a);return i.useEffect(()=>{let n=a.current;if(n)return Le(n)},[]),(0,l.jsx)(K,{...t,ref:o,trapFocus:e.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:v(t.onCloseAutoFocus,n=>{var s;n.preventDefault(),(s=e.triggerRef.current)==null||s.focus()}),onPointerDownOutside:v(t.onPointerDownOutside,n=>{let s=n.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&n.preventDefault()}),onFocusOutside:v(t.onFocusOutside,n=>n.preventDefault())})}),rr=i.forwardRef((t,r)=>{let e=f(y,t.__scopeDialog),a=i.useRef(!1),o=i.useRef(!1);return(0,l.jsx)(K,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var s,c;(s=t.onCloseAutoFocus)==null||s.call(t,n),n.defaultPrevented||(a.current||((c=e.triggerRef.current)==null||c.focus()),n.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:n=>{var c,d;(c=t.onInteractOutside)==null||c.call(t,n),n.defaultPrevented||(a.current=!0,n.detail.originalEvent.type==="pointerdown"&&(o.current=!0));let s=n.target;(d=e.triggerRef.current)!=null&&d.contains(s)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&o.current&&n.preventDefault()}})}),K=i.forwardRef((t,r)=>{let{__scopeDialog:e,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:n,...s}=t,c=f(y,e),d=i.useRef(null),u=N(r,d);return Be(),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(qe,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:n,children:(0,l.jsx)(Ke,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":O(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ar,{titleId:c.titleId}),(0,l.jsx)(nr,{contentRef:d,descriptionId:c.descriptionId})]})]})}),C="DialogTitle",L=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(C,e);return(0,l.jsx)(h.h2,{id:o.titleId,...a,ref:r})});L.displayName=C;var U="DialogDescription",V=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(U,e);return(0,l.jsx)(h.p,{id:o.descriptionId,...a,ref:r})});V.displayName=U;var Y="DialogClose",Z=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(Y,e);return(0,l.jsx)(h.button,{type:"button",...a,ref:r,onClick:v(t.onClick,()=>o.onOpenChange(!1))})});Z.displayName=Y;function O(t){return t?"open":"closed"}var G="DialogTitleWarning",[tr,J]=ze(G,{contentName:y,titleName:C,docsSlug:"dialog"}),ar=({titleId:t})=>{let r=J(G),e=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
2
2
 
3
3
  If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
4
4
 
@@ -1,3 +1,3 @@
1
- import{s as a}from"./chunk-LvLJmgfZ.js";import{t as u}from"./react-BGmjiNul.js";import"./react-dom-C9fstfnp.js";import"./compiler-runtime-DeeZ7FnK.js";import{d}from"./hotkeys-uKX61F1_.js";import{t as f}from"./jsx-runtime-DN_bIXfG.js";import"./dist-CAcX026F.js";import"./dist-HGZzCB0y.js";import"./dist-CVj-_Iiz.js";import"./dist-BVf1IY4_.js";import"./dist-Cq_4nPfh.js";import"./dist-RKnr9SNh.js";import"./Combination-D1TsGrBC.js";import{n as c}from"./error-banner-DU5Qb8a8.js";import{t as h}from"./copy-icon-B69c-352.js";import{t as g}from"./esm-B3JckBtM.js";import"./dist-BRZzJw_5.js";import"./dist-P7JHert4.js";import"./dist-CoiWxjLF.js";import"./dist-cVYW_wBR.js";import"./dist-BAmo7Mv9.js";import"./dist-3oAtECdQ.js";import"./dist-D6Pwf0VF.js";import"./dist-D9HMoxdZ.js";import"./dist-JtCdI6tY.js";import{n as v,t as m}from"./esm-CCqLcax5.js";var j=a(u(),1),t=a(f(),1);const p={python:"py",javascript:"js",typescript:"ts",shell:"sh",bash:"sh"};function e(o){return o?o in m:!1}var x=({language:o,showCopyButton:n,extensions:r=[],...s})=>{o=p[o||""]||o;let i=e(o);i||d.warn(`Language ${o} not found in CodeMirror.`);let l=(0,j.useMemo)(()=>e(o)?[v(o),...r].filter(Boolean):r,[o,r]);return(0,t.jsxs)("div",{className:"relative w-full group hover-actions-parent",children:[!i&&(0,t.jsx)(c,{className:"mb-1 rounded-sm",error:`Language ${o} not supported.
1
+ import{s as a}from"./chunk-LvLJmgfZ.js";import{t as u}from"./react-BGmjiNul.js";import"./react-dom-C9fstfnp.js";import"./compiler-runtime-DeeZ7FnK.js";import{d}from"./hotkeys-uKX61F1_.js";import{t as f}from"./jsx-runtime-DN_bIXfG.js";import"./dist-CAcX026F.js";import"./dist-HGZzCB0y.js";import"./dist-CVj-_Iiz.js";import"./dist-BVf1IY4_.js";import"./dist-Cq_4nPfh.js";import"./dist-RKnr9SNh.js";import"./Combination-D1TsGrBC.js";import{n as c}from"./error-banner-DvT0IGDZ.js";import{t as h}from"./copy-icon-jWsqdLn1.js";import{t as g}from"./esm-B3JckBtM.js";import"./dist-BRZzJw_5.js";import"./dist-P7JHert4.js";import"./dist-CoiWxjLF.js";import"./dist-cVYW_wBR.js";import"./dist-BAmo7Mv9.js";import"./dist-3oAtECdQ.js";import"./dist-D6Pwf0VF.js";import"./dist-D9HMoxdZ.js";import"./dist-JtCdI6tY.js";import{n as v,t as m}from"./esm-CCqLcax5.js";var j=a(u(),1),t=a(f(),1);const p={python:"py",javascript:"js",typescript:"ts",shell:"sh",bash:"sh"};function e(o){return o?o in m:!1}var x=({language:o,showCopyButton:n,extensions:r=[],...s})=>{o=p[o||""]||o;let i=e(o);i||d.warn(`Language ${o} not found in CodeMirror.`);let l=(0,j.useMemo)(()=>e(o)?[v(o),...r].filter(Boolean):r,[o,r]);return(0,t.jsxs)("div",{className:"relative w-full group hover-actions-parent",children:[!i&&(0,t.jsx)(c,{className:"mb-1 rounded-sm",error:`Language ${o} not supported.
2
2
 
3
3
  Supported languages are: ${Object.keys(m).join(", ")}`}),n&&i&&(0,t.jsx)(h,{tooltip:!1,buttonClassName:"absolute top-2 right-2 z-10 hover-action",className:"h-4 w-4 text-muted-foreground",value:s.value||"",toastTitle:"Copied to clipboard"}),(0,t.jsx)(g,{...s,extensions:l})]})};export{p as LANGUAGE_MAP,x as default};
@@ -1 +1 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X}from"./useEvent-DlWF5OMa.js";import{t as Z}from"./react-BGmjiNul.js";import{_t as D}from"./cells-CxLYaBUM.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{C as Q,S as $,_ as ee}from"./utils-CJJIceVn.js";import{M as te}from"./config-Ba3eeYri.js";import{t as se}from"./jsx-runtime-DN_bIXfG.js";import{t as le}from"./button-DuYGqRtX.js";import{l as R}from"./once-CTiSlR1m.js";import{r as U}from"./requests-C0HaHO6a.js";import{t as ae}from"./createLucideIcon-CW2xpJ57.js";import{h as oe,l as B}from"./select-D0g5GnIs.js";import{c as ne,f as re,l as ie,r as ce,s as de,t as he}from"./state-DMkGD84_.js";import{r as I}from"./input-a7Oxxo2e.js";import{t as Y}from"./settings-MTlHVxz3.js";import{a as M,c as L,d as A,g as me,i as xe,l as F,o as P,p as pe,u as S}from"./textarea-CfgJSv-G.js";import{t as fe}from"./use-toast-Bzf3rpev.js";import{t as K}from"./tooltip-CvjcEpZC.js";import{o as ue}from"./alert-dialog-k5KxevGr.js";import{c as je,l as ve,n as ge,t as V}from"./dialog-DUEuLcT2.js";import{t as be}from"./VisuallyHidden-B44yJgpX.js";import{i as we,r as ye,t as Ne}from"./popover-DtnzNVk-.js";import{n as Ce}from"./useDebounce-em3gna-v.js";import{n as ke}from"./ImperativeModal-B7kKs9xL.js";import{t as O}from"./kbd-Czc5z_04.js";import{t as _e}from"./links-DNmjkr65.js";import{t as G}from"./Inputs-DmoeP8nh.js";var Se=ae("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Te=E(),s=z(se(),1);const Me=t=>{let e=(0,Te.c)(15),{description:a,disabled:f,tooltip:r}=t,i=f===void 0?!1:f,u=r===void 0?"Shutdown":r,{openConfirm:b,closeModal:l}=ke(),{sendShutdown:o}=U(),w;e[0]===o?w=e[1]:(w=()=>{o(),setTimeout(Le,200)},e[0]=o,e[1]=w);let j=w;if(te())return null;let m=i?"disabled":"red",c;e[2]!==l||e[3]!==a||e[4]!==j||e[5]!==b?(c=h=>{h.stopPropagation(),b({title:"Shutdown",description:a,variant:"destructive",confirmAction:(0,s.jsx)(ue,{onClick:()=>{j(),l()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=l,e[3]=a,e[4]=j,e[5]=b,e[6]=c):c=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(oe,{strokeWidth:1}),e[7]=n):n=e[7];let d;e[8]!==i||e[9]!==m||e[10]!==c?(d=(0,s.jsx)(G,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:m,className:"h-[27px] w-[27px]",disabled:i,onClick:c,children:n}),e[8]=i,e[9]=m,e[10]=c,e[11]=d):d=e[11];let x;return e[12]!==d||e[13]!==u?(x=(0,s.jsx)(K,{content:u,children:d}),e[12]=d,e[13]=u,e[14]=x):x=e[14],x};function Le(){window.close()}var J=E(),W=z(Z(),1),Ae=100;const Fe=()=>{let t=(0,J.c)(37),[e,a]=ee(),{saveAppConfig:f}=U(),r=(0,W.useId)(),i=(0,W.useId)(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=pe($),t[0]=u):u=t[0];let b;t[1]===e?b=t[2]:(b={resolver:u,defaultValues:e},t[1]=e,t[2]=b);let l=me(b),o;t[3]!==f||t[4]!==a?(o=async p=>{await f({config:p}).then(()=>{a(p)}).catch(()=>{a(p)})},t[3]=f,t[4]=a,t[5]=o):o=t[5];let w=o,j;t[6]===w?j=t[7]:(j=p=>{w(p)},t[6]=w,t[7]=j);let m=Ce(j,Ae),c;t[8]===e.width?c=t[9]:(c=[e.width],t[8]=e.width,t[9]=c),(0,W.useEffect)(Pe,c);let n;t[10]!==m||t[11]!==l?(n=l.handleSubmit(m),t[10]=m,t[11]=l,t[12]=n):n=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("div",{children:[(0,s.jsx)(ie,{children:"Notebook Settings"}),(0,s.jsx)(ne,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=d):d=t[13];let x;t[14]===l.control?x=t[15]:(x=(0,s.jsxs)(H,{title:"Display",children:[(0,s.jsx)(L,{control:l.control,name:"width",render:He}),(0,s.jsx)(L,{control:l.control,name:"app_title",render:Ee})]}),t[14]=l.control,t[15]=x);let h;t[16]===l.control?h=t[17]:(h=(0,s.jsxs)(H,{title:"Custom Files",children:[(0,s.jsx)(L,{control:l.control,name:"css_file",render:Ie}),(0,s.jsx)(L,{control:l.control,name:"html_head_file",render:Oe})]}),t[16]=l.control,t[17]=h);let y;t[18]===l.control?y=t[19]:(y=(0,s.jsx)(H,{title:"Data",children:(0,s.jsx)(L,{control:l.control,name:"sql_output",render:ze})}),t[18]=l.control,t[19]=y);let N;t[20]!==r||t[21]!==i?(N=p=>{let{field:_}=p;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-col gap-2",children:[(0,s.jsx)(M,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:r,"data-testid":"html-checkbox",checked:_.value.includes("html"),onCheckedChange:()=>{_.onChange(R(_.value,"html"))}}),(0,s.jsx)(S,{htmlFor:r,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:i,"data-testid":"ipynb-checkbox",checked:_.value.includes("ipynb"),onCheckedChange:()=>{_.onChange(R(_.value,"ipynb"))}}),(0,s.jsx)(S,{htmlFor:i,children:"IPYNB"})]})]})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(O,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=r,t[21]=i,t[22]=N):N=t[22];let v;t[23]!==l.control||t[24]!==N?(v=(0,s.jsx)(H,{title:"Exporting outputs",children:(0,s.jsx)(L,{control:l.control,name:"auto_download",render:N})}),t[23]=l.control,t[24]=N,t[25]=v):v=t[25];let C;t[26]!==v||t[27]!==x||t[28]!==h||t[29]!==y?(C=(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[x,h,y,v]}),t[26]=v,t[27]=x,t[28]=h,t[29]=y,t[30]=C):C=t[30];let g;t[31]!==C||t[32]!==n?(g=(0,s.jsxs)("form",{onChange:n,className:"flex flex-col gap-6",children:[d,C]}),t[31]=C,t[32]=n,t[33]=g):g=t[33];let k;return t[34]!==l||t[35]!==g?(k=(0,s.jsx)(xe,{...l,children:g}),t[34]=l,t[35]=g,t[36]=k):k=t[36],k};var H=t=>{let e=(0,J.c)(5),{title:a,children:f}=t,r;e[0]===a?r=e[1]:(r=(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",children:a}),e[0]=a,e[1]=r);let i;return e[2]!==f||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,f]}),e[2]=f,e[3]=r,e[4]=i):i=e[4],i};function Pe(){window.dispatchEvent(new Event("resize"))}function qe(t){return(0,s.jsx)("option",{value:t,children:t},t)}function He(t){let{field:e}=t;return(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"Width"}),(0,s.jsx)(M,{children:(0,s.jsx)(B,{"data-testid":"app-width-select",onChange:a=>e.onChange(a.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:re().map(qe)})}),(0,s.jsx)(A,{})]})}function Ee(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"App title"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Ie(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"Custom CSS"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"custom.css",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Oe(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"HTML Head"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"head.html",onChange:a=>{e.onChange(a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["A filepath to an HTML file to be injected into the"," ",(0,s.jsx)(O,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function We(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}function ze(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"SQL Output Type"}),(0,s.jsx)(M,{children:(0,s.jsx)(B,{"data-testid":"sql-output-select",onChange:a=>{e.onChange(a.target.value),fe({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:de.map(We)})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",(0,s.jsx)(O,{className:"inline",children:"native"}),". See the"," ",(0,s.jsx)(_e,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}var De=E();const Qe=t=>{let e=(0,De.c)(32),{showAppConfig:a,disabled:f,tooltip:r}=t,i=a===void 0?!0:a,u=f===void 0?!1:f,b=r===void 0?"Settings":r,[l,o]=X(he),w=u?"disabled":"hint-green",j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(Y,{strokeWidth:1.8}),e[0]=j):j=e[0];let m;e[1]===b?m=e[2]:(m=(0,s.jsx)(K,{content:b,children:j}),e[1]=b,e[2]=m);let c;e[3]!==u||e[4]!==w||e[5]!==m?(c=(0,s.jsx)(G,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:u,color:w,children:m}),e[3]=u,e[4]=w,e[5]=m,e[6]=c):c=e[6];let n=c,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(ge,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[(0,s.jsx)(be,{children:(0,s.jsx)(je,{children:"User settings"})}),(0,s.jsx)(ce,{})]}),e[7]=d):d=e[7];let x=d;if(!i){let T;e[8]===n?T=e[9]:(T=(0,s.jsx)(ve,{children:n}),e[8]=n,e[9]=T);let q;return e[10]!==o||e[11]!==l||e[12]!==T?(q=(0,s.jsxs)(V,{open:l,onOpenChange:o,children:[T,x]}),e[10]=o,e[11]=l,e[12]=T,e[13]=q):q=e[13],q}let h;e[14]===n?h=e[15]:(h=(0,s.jsx)(we,{asChild:!0,children:n}),e[14]=n,e[15]=h);let y,N;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,s.jsx)(Fe,{}),N=(0,s.jsx)("div",{className:"h-px bg-border my-2"}),e[16]=y,e[17]=N):(y=e[16],N=e[17]);let v;e[18]===o?v=e[19]:(v=()=>o(!0),e[18]=o,e[19]=v);let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(Y,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=C):C=e[20];let g;e[21]===v?g=e[22]:(g=(0,s.jsxs)(ye,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Re,children:[y,N,(0,s.jsxs)(le,{onClick:v,variant:"link",className:"px-0",children:[C,"User settings"]})]}),e[21]=v,e[22]=g);let k;e[23]!==g||e[24]!==h?(k=(0,s.jsxs)(Ne,{children:[h,g]}),e[23]=g,e[24]=h,e[25]=k):k=e[25];let p;e[26]!==o||e[27]!==l?(p=(0,s.jsx)(V,{open:l,onOpenChange:o,children:x}),e[26]=o,e[27]=l,e[28]=p):p=e[28];let _;return e[29]!==k||e[30]!==p?(_=(0,s.jsxs)(s.Fragment,{children:[k,p]}),e[29]=k,e[30]=p,e[31]=_):_=e[31],_};function Re(t){return t.preventDefault()}export{Me as n,Se as r,Qe as t};
1
+ import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X}from"./useEvent-DlWF5OMa.js";import{t as Z}from"./react-BGmjiNul.js";import{_t as D}from"./cells-Bybxko6N.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{C as Q,S as $,_ as ee}from"./utils-CJJIceVn.js";import{M as te}from"./config-Ba3eeYri.js";import{t as se}from"./jsx-runtime-DN_bIXfG.js";import{t as le}from"./button-B8cGZzP5.js";import{l as R}from"./once-CTiSlR1m.js";import{r as U}from"./requests-C0HaHO6a.js";import{t as ae}from"./createLucideIcon-CW2xpJ57.js";import{h as oe,l as B}from"./select-D9lTzMzP.js";import{c as ne,f as re,l as ie,r as ce,s as de,t as he}from"./state-C_Zihs8j.js";import{r as I}from"./input-B80Yt1uu.js";import{t as Y}from"./settings-MTlHVxz3.js";import{a as M,c as L,d as A,g as me,i as xe,l as F,o as P,p as pe,u as S}from"./textarea-CtGg_oNS.js";import{t as fe}from"./use-toast-Bzf3rpev.js";import{t as K}from"./tooltip-CvjcEpZC.js";import{o as ue}from"./alert-dialog-jcHA5geR.js";import{c as je,l as ve,n as ge,t as V}from"./dialog-CF5DtF1E.js";import{t as be}from"./VisuallyHidden-B9t3FhTP.js";import{i as we,r as ye,t as Ne}from"./popover-DtnzNVk-.js";import{n as Ce}from"./useDebounce-em3gna-v.js";import{n as ke}from"./ImperativeModal-DVhvP4lH.js";import{t as O}from"./kbd-Czc5z_04.js";import{t as _e}from"./links-DNmjkr65.js";import{t as G}from"./Inputs-DmoeP8nh.js";var Se=ae("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Te=E(),s=z(se(),1);const Me=t=>{let e=(0,Te.c)(15),{description:a,disabled:f,tooltip:r}=t,i=f===void 0?!1:f,u=r===void 0?"Shutdown":r,{openConfirm:b,closeModal:l}=ke(),{sendShutdown:o}=U(),w;e[0]===o?w=e[1]:(w=()=>{o(),setTimeout(Le,200)},e[0]=o,e[1]=w);let j=w;if(te())return null;let m=i?"disabled":"red",c;e[2]!==l||e[3]!==a||e[4]!==j||e[5]!==b?(c=h=>{h.stopPropagation(),b({title:"Shutdown",description:a,variant:"destructive",confirmAction:(0,s.jsx)(ue,{onClick:()=>{j(),l()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=l,e[3]=a,e[4]=j,e[5]=b,e[6]=c):c=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(oe,{strokeWidth:1}),e[7]=n):n=e[7];let d;e[8]!==i||e[9]!==m||e[10]!==c?(d=(0,s.jsx)(G,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:m,className:"h-[27px] w-[27px]",disabled:i,onClick:c,children:n}),e[8]=i,e[9]=m,e[10]=c,e[11]=d):d=e[11];let x;return e[12]!==d||e[13]!==u?(x=(0,s.jsx)(K,{content:u,children:d}),e[12]=d,e[13]=u,e[14]=x):x=e[14],x};function Le(){window.close()}var J=E(),W=z(Z(),1),Ae=100;const Fe=()=>{let t=(0,J.c)(37),[e,a]=ee(),{saveAppConfig:f}=U(),r=(0,W.useId)(),i=(0,W.useId)(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=pe($),t[0]=u):u=t[0];let b;t[1]===e?b=t[2]:(b={resolver:u,defaultValues:e},t[1]=e,t[2]=b);let l=me(b),o;t[3]!==f||t[4]!==a?(o=async p=>{await f({config:p}).then(()=>{a(p)}).catch(()=>{a(p)})},t[3]=f,t[4]=a,t[5]=o):o=t[5];let w=o,j;t[6]===w?j=t[7]:(j=p=>{w(p)},t[6]=w,t[7]=j);let m=Ce(j,Ae),c;t[8]===e.width?c=t[9]:(c=[e.width],t[8]=e.width,t[9]=c),(0,W.useEffect)(Pe,c);let n;t[10]!==m||t[11]!==l?(n=l.handleSubmit(m),t[10]=m,t[11]=l,t[12]=n):n=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("div",{children:[(0,s.jsx)(ie,{children:"Notebook Settings"}),(0,s.jsx)(ne,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=d):d=t[13];let x;t[14]===l.control?x=t[15]:(x=(0,s.jsxs)(H,{title:"Display",children:[(0,s.jsx)(L,{control:l.control,name:"width",render:He}),(0,s.jsx)(L,{control:l.control,name:"app_title",render:Ee})]}),t[14]=l.control,t[15]=x);let h;t[16]===l.control?h=t[17]:(h=(0,s.jsxs)(H,{title:"Custom Files",children:[(0,s.jsx)(L,{control:l.control,name:"css_file",render:Ie}),(0,s.jsx)(L,{control:l.control,name:"html_head_file",render:Oe})]}),t[16]=l.control,t[17]=h);let y;t[18]===l.control?y=t[19]:(y=(0,s.jsx)(H,{title:"Data",children:(0,s.jsx)(L,{control:l.control,name:"sql_output",render:ze})}),t[18]=l.control,t[19]=y);let N;t[20]!==r||t[21]!==i?(N=p=>{let{field:_}=p;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-col gap-2",children:[(0,s.jsx)(M,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:r,"data-testid":"html-checkbox",checked:_.value.includes("html"),onCheckedChange:()=>{_.onChange(R(_.value,"html"))}}),(0,s.jsx)(S,{htmlFor:r,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:i,"data-testid":"ipynb-checkbox",checked:_.value.includes("ipynb"),onCheckedChange:()=>{_.onChange(R(_.value,"ipynb"))}}),(0,s.jsx)(S,{htmlFor:i,children:"IPYNB"})]})]})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(O,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=r,t[21]=i,t[22]=N):N=t[22];let v;t[23]!==l.control||t[24]!==N?(v=(0,s.jsx)(H,{title:"Exporting outputs",children:(0,s.jsx)(L,{control:l.control,name:"auto_download",render:N})}),t[23]=l.control,t[24]=N,t[25]=v):v=t[25];let C;t[26]!==v||t[27]!==x||t[28]!==h||t[29]!==y?(C=(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[x,h,y,v]}),t[26]=v,t[27]=x,t[28]=h,t[29]=y,t[30]=C):C=t[30];let g;t[31]!==C||t[32]!==n?(g=(0,s.jsxs)("form",{onChange:n,className:"flex flex-col gap-6",children:[d,C]}),t[31]=C,t[32]=n,t[33]=g):g=t[33];let k;return t[34]!==l||t[35]!==g?(k=(0,s.jsx)(xe,{...l,children:g}),t[34]=l,t[35]=g,t[36]=k):k=t[36],k};var H=t=>{let e=(0,J.c)(5),{title:a,children:f}=t,r;e[0]===a?r=e[1]:(r=(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",children:a}),e[0]=a,e[1]=r);let i;return e[2]!==f||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,f]}),e[2]=f,e[3]=r,e[4]=i):i=e[4],i};function Pe(){window.dispatchEvent(new Event("resize"))}function qe(t){return(0,s.jsx)("option",{value:t,children:t},t)}function He(t){let{field:e}=t;return(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"Width"}),(0,s.jsx)(M,{children:(0,s.jsx)(B,{"data-testid":"app-width-select",onChange:a=>e.onChange(a.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:re().map(qe)})}),(0,s.jsx)(A,{})]})}function Ee(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"App title"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Ie(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"Custom CSS"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"custom.css",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Oe(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"HTML Head"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"head.html",onChange:a=>{e.onChange(a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["A filepath to an HTML file to be injected into the"," ",(0,s.jsx)(O,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function We(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}function ze(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"SQL Output Type"}),(0,s.jsx)(M,{children:(0,s.jsx)(B,{"data-testid":"sql-output-select",onChange:a=>{e.onChange(a.target.value),fe({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:de.map(We)})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",(0,s.jsx)(O,{className:"inline",children:"native"}),". See the"," ",(0,s.jsx)(_e,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}var De=E();const Qe=t=>{let e=(0,De.c)(32),{showAppConfig:a,disabled:f,tooltip:r}=t,i=a===void 0?!0:a,u=f===void 0?!1:f,b=r===void 0?"Settings":r,[l,o]=X(he),w=u?"disabled":"hint-green",j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(Y,{strokeWidth:1.8}),e[0]=j):j=e[0];let m;e[1]===b?m=e[2]:(m=(0,s.jsx)(K,{content:b,children:j}),e[1]=b,e[2]=m);let c;e[3]!==u||e[4]!==w||e[5]!==m?(c=(0,s.jsx)(G,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:u,color:w,children:m}),e[3]=u,e[4]=w,e[5]=m,e[6]=c):c=e[6];let n=c,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(ge,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[(0,s.jsx)(be,{children:(0,s.jsx)(je,{children:"User settings"})}),(0,s.jsx)(ce,{})]}),e[7]=d):d=e[7];let x=d;if(!i){let T;e[8]===n?T=e[9]:(T=(0,s.jsx)(ve,{children:n}),e[8]=n,e[9]=T);let q;return e[10]!==o||e[11]!==l||e[12]!==T?(q=(0,s.jsxs)(V,{open:l,onOpenChange:o,children:[T,x]}),e[10]=o,e[11]=l,e[12]=T,e[13]=q):q=e[13],q}let h;e[14]===n?h=e[15]:(h=(0,s.jsx)(we,{asChild:!0,children:n}),e[14]=n,e[15]=h);let y,N;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,s.jsx)(Fe,{}),N=(0,s.jsx)("div",{className:"h-px bg-border my-2"}),e[16]=y,e[17]=N):(y=e[16],N=e[17]);let v;e[18]===o?v=e[19]:(v=()=>o(!0),e[18]=o,e[19]=v);let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(Y,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=C):C=e[20];let g;e[21]===v?g=e[22]:(g=(0,s.jsxs)(ye,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Re,children:[y,N,(0,s.jsxs)(le,{onClick:v,variant:"link",className:"px-0",children:[C,"User settings"]})]}),e[21]=v,e[22]=g);let k;e[23]!==g||e[24]!==h?(k=(0,s.jsxs)(Ne,{children:[h,g]}),e[23]=g,e[24]=h,e[25]=k):k=e[25];let p;e[26]!==o||e[27]!==l?(p=(0,s.jsx)(V,{open:l,onOpenChange:o,children:x}),e[26]=o,e[27]=l,e[28]=p):p=e[28];let _;return e[29]!==k||e[30]!==p?(_=(0,s.jsxs)(s.Fragment,{children:[k,p]}),e[29]=k,e[30]=p,e[31]=_):_=e[31],_};function Re(t){return t.preventDefault()}export{Me as n,Se as r,Qe as t};
@@ -0,0 +1 @@
1
+ import{s as k}from"./chunk-LvLJmgfZ.js";import{t as R}from"./react-BGmjiNul.js";import{t as j}from"./compiler-runtime-DeeZ7FnK.js";import{l as I}from"./hotkeys-uKX61F1_.js";import{n as S,t as K}from"./useEventListener-COkmyg1v.js";import{t as O}from"./jsx-runtime-DN_bIXfG.js";import{n as A,t as d}from"./cn-C1rgT0yh.js";var a=k(R(),1),w=k(O(),1),D=Symbol.for("react.lazy"),h=a.use;function P(e){return typeof e=="object"&&!!e&&"then"in e}function C(e){return typeof e=="object"&&!!e&&"$$typeof"in e&&e.$$typeof===D&&"_payload"in e&&P(e._payload)}function N(e){let r=$(e),t=a.forwardRef((n,o)=>{let{children:i,...l}=n;C(i)&&typeof h=="function"&&(i=h(i._payload));let s=a.Children.toArray(i),u=s.find(H);if(u){let p=u.props.children,c=s.map(g=>g===u?a.Children.count(p)>1?a.Children.only(null):a.isValidElement(p)?p.props.children:null:g);return(0,w.jsx)(r,{...l,ref:o,children:a.isValidElement(p)?a.cloneElement(p,void 0,c):null})}return(0,w.jsx)(r,{...l,ref:o,children:i})});return t.displayName=`${e}.Slot`,t}var _=N("Slot");function $(e){let r=a.forwardRef((t,n)=>{let{children:o,...i}=t;if(C(o)&&typeof h=="function"&&(o=h(o._payload)),a.isValidElement(o)){let l=W(o),s=V(i,o.props);return o.type!==a.Fragment&&(s.ref=n?S(n,l):l),a.cloneElement(o,s)}return a.Children.count(o)>1?a.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var z=Symbol("radix.slottable");function H(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===z}function V(e,r){let t={...r};for(let n in r){let o=e[n],i=r[n];/^on[A-Z]/.test(n)?o&&i?t[n]=(...l)=>{let s=i(...l);return o(...l),s}:o&&(t[n]=o):n==="style"?t[n]={...o,...i}:n==="className"&&(t[n]=[o,i].filter(Boolean).join(" "))}return{...e,...t}}function W(e){var n,o;let r=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}const E={stopPropagation:e=>r=>{r.stopPropagation(),e&&e(r)},onEnter:e=>r=>{r.key==="Enter"&&e&&e(r)},preventFocus:e=>{e.preventDefault()},fromInput:e=>{let r=e.target;return r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.tagName.startsWith("MARIMO")||r.isContentEditable||E.fromCodeMirror(e)},fromCodeMirror:e=>e.target.closest(".cm-editor")!==null,shouldIgnoreKeyboardEvent(e){return e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement||e.target instanceof HTMLElement&&(e.target.isContentEditable||e.target.tagName==="BUTTON"||e.target.closest("[role='textbox']")!==null||e.target.closest("[contenteditable='true']")!==null||e.target.closest(".cm-editor")!==null)},hasModifier:e=>e.ctrlKey||e.metaKey||e.altKey||e.shiftKey,isMetaOrCtrl:e=>e.metaKey||e.ctrlKey};var L=j(),f="active:shadow-none",T=A(d("disabled:opacity-50 disabled:pointer-events-none","inline-flex items-center justify-center rounded-md text-sm font-medium focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background"),{variants:{variant:{default:d("bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs border border-primary",f),destructive:d("border shadow-xs","bg-(--red-9) hover:bg-(--red-10) dark:bg-(--red-6) dark:hover:bg-(--red-7)","text-(--red-1) dark:text-(--red-12)","border-(--red-11)",f),success:d("border shadow-xs","bg-(--grass-9) hover:bg-(--grass-10) dark:bg-(--grass-6) dark:hover:bg-(--grass-7)","text-(--grass-1) dark:text-(--grass-12)","border-(--grass-11)",f),warn:d("border shadow-xs","bg-(--yellow-9) hover:bg-(--yellow-10) dark:bg-(--yellow-6) dark:hover:bg-(--yellow-7)","text-(--yellow-12)","border-(--yellow-11)",f),action:d("bg-action text-action-foreground shadow-xs","hover:bg-action-hover border border-action",f),outline:d("border border-slate-300 shadow-xs","hover:bg-accent hover:text-accent-foreground","hover:border-primary","aria-selected:text-accent-foreground aria-selected:border-primary",f),secondary:d("bg-secondary text-secondary-foreground hover:bg-secondary/80","border border-input shadow-xs",f),text:d("opacity-80 hover:opacity-100","active:opacity-100"),ghost:d("border border-transparent","hover:bg-accent hover:text-accent-foreground hover:shadow-xs",f,"active:text-accent-foreground"),link:"underline-offset-4 hover:underline text-link",linkDestructive:"underline-offset-4 hover:underline text-destructive underline-destructive",outlineDestructive:"border border-destructive text-destructive hover:bg-destructive/10"},size:{default:"h-10 py-2 px-4",xs:"h-7 px-2 rounded-md text-xs",sm:"h-9 px-3 rounded-md",lg:"h-11 px-8 rounded-md",icon:"h-6 w-6 mb-0"},disabled:{true:"opacity-50 pointer-events-none"}},defaultVariants:{variant:"default",size:"sm"}}),M=a.forwardRef((e,r)=>{let t=(0,L.c)(7),{className:n,variant:o,size:i,asChild:l,keyboardShortcut:s,...u}=e,p=l===void 0?!1:l,c=a.useRef(null),g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>c.current,t[0]=g):g=t[0],a.useImperativeHandle(r,g);let b;t[1]===s?b=t[2]:(b=y=>{s&&(E.shouldIgnoreKeyboardEvent(y)||I(s)(y)&&(y.preventDefault(),y.stopPropagation(),c!=null&&c.current&&!c.current.disabled&&c.current.click()))},t[1]=s,t[2]=b),K(document,"keydown",b);let v=p?_:"button",x=d(T({variant:o,size:i,className:n,disabled:u.disabled}),n),m;return t[3]!==v||t[4]!==u||t[5]!==x?(m=(0,w.jsx)(v,{className:x,ref:c,...u}),t[3]=v,t[4]=u,t[5]=x,t[6]=m):m=t[6],m});M.displayName="Button";export{N as a,_ as i,T as n,E as r,M as t};
@@ -1 +1 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import{u as O}from"./useEvent-DlWF5OMa.js";import{t as A}from"./react-BGmjiNul.js";import"./react-dom-C9fstfnp.js";import{t as B}from"./compiler-runtime-DeeZ7FnK.js";import{t as R}from"./jsx-runtime-DN_bIXfG.js";import{t as P}from"./button-DuYGqRtX.js";import{t as G}from"./cn-C1rgT0yh.js";import{r as H}from"./requests-C0HaHO6a.js";import{t as _}from"./database-zap-CaVvnK_o.js";import{t as S}from"./spinner-C1czjtp7.js";import{t as F}from"./refresh-cw-Din9uFKE.js";import{t as K}from"./trash-2-C-lF7BNB.js";import{t as D}from"./use-toast-Bzf3rpev.js";import"./Combination-D1TsGrBC.js";import{a as q,c as J,i as Q,l as U,n as V,o as W,r as X,s as Y,t as Z,u as ee}from"./alert-dialog-k5KxevGr.js";import{t as se}from"./context-DHfVoQfl.js";import{r as m}from"./numbers-C9_R_vlY.js";import{n as te}from"./useAsyncData-BJJJOr9W.js";import{t as E}from"./empty-state-B0XJ9ZUi.js";import{t as ae}from"./requests-DiQsDZob.js";var ie=B(),I=z(A(),1),s=z(R(),1);const re=i=>{let e=(0,ie.c)(27),{children:t,title:l,description:r,onConfirm:a,confirmText:c,cancelText:o,destructive:n}=i,y=c===void 0?"Continue":c,u=o===void 0?"Cancel":o,p=n===void 0?!1:n,[j,k]=I.useState(!1),f;e[0]===a?f=e[1]:(f=()=>{a(),k(!1)},e[0]=a,e[1]=f);let v=f,h=p?W:V,x;e[2]===t?x=e[3]:(x=(0,s.jsx)(ee,{asChild:!0,children:t}),e[2]=t,e[3]=x);let d;e[4]===l?d=e[5]:(d=(0,s.jsx)(U,{children:l}),e[4]=l,e[5]=d);let g;e[6]===r?g=e[7]:(g=(0,s.jsx)(q,{children:r}),e[6]=r,e[7]=g);let N;e[8]!==d||e[9]!==g?(N=(0,s.jsxs)(J,{children:[d,g]}),e[8]=d,e[9]=g,e[10]=N):N=e[10];let b;e[11]===u?b=e[12]:(b=(0,s.jsx)(X,{children:u}),e[11]=u,e[12]=b);let C;e[13]!==h||e[14]!==y||e[15]!==v?(C=(0,s.jsx)(h,{onClick:v,children:y}),e[13]=h,e[14]=y,e[15]=v,e[16]=C):C=e[16];let w;e[17]!==C||e[18]!==b?(w=(0,s.jsxs)(Y,{children:[b,C]}),e[17]=C,e[18]=b,e[19]=w):w=e[19];let $;e[20]!==w||e[21]!==N?($=(0,s.jsxs)(Q,{children:[N,w]}),e[20]=w,e[21]=N,e[22]=$):$=e[22];let M;return e[23]!==j||e[24]!==$||e[25]!==x?(M=(0,s.jsxs)(Z,{open:j,onOpenChange:k,children:[x,$]}),e[23]=j,e[24]=$,e[25]=x,e[26]=M):M=e[26],M};function L(i,e){if(i===0||i===-1)return"0 B";let t=1024,l=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(i)/Math.log(t));return`${m(i/t**r,e)} ${l[r]}`}function le(i,e){if(i===0)return"0s";if(i<.001)return`${m(i*1e6,e)}\xB5s`;if(i<1)return`${m(i*1e3,e)}ms`;if(i<60)return`${m(i,e)}s`;let t=Math.floor(i/60),l=i%60;if(t<60)return l>0?`${t}m ${m(l,e)}s`:`${t}m`;let r=Math.floor(t/60),a=t%60;return a>0?`${r}h ${a}m`:`${r}h`}var oe=B(),ce=()=>{let{clearCache:i,getCacheInfo:e}=H(),t=O(ae),[l,r]=(0,I.useState)(!1),{locale:a}=se(),{isPending:c,isFetching:o,refetch:n}=te(async()=>{await e(),await new Promise(d=>setTimeout(d,500))},[]),y=async()=>{try{r(!0),await i(),D({title:"Cache purged",description:"All cached data has been cleared"}),n()}catch(d){D({title:"Error",description:d instanceof Error?d.message:"Failed to purge cache",variant:"danger"})}finally{r(!1)}};if(c&&!t)return(0,s.jsx)(S,{size:"medium",centered:!0});let u=(0,s.jsxs)(P,{variant:"outline",size:"sm",onClick:n,disabled:o,children:[o?(0,s.jsx)(S,{size:"small",className:"w-4 h-4 mr-2"}):(0,s.jsx)(F,{className:"w-4 h-4 mr-2"}),"Refresh"]});if(!t)return(0,s.jsx)(E,{title:"No cache data",description:"Cache information is not available.",icon:(0,s.jsx)(_,{}),action:u});let p=t.hits,j=t.misses,k=t.time,f=t.disk_total,v=t.disk_to_free,h=p+j,x=h>0?p/h*100:0;return h===0?(0,s.jsx)(E,{title:"No cache activity",description:"The cache has not been used yet. Cached functions will appear here once they are executed.",icon:(0,s.jsx)(_,{}),action:u}):(0,s.jsx)("div",{className:"flex flex-col h-full overflow-auto",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4 p-4 h-full",children:[(0,s.jsx)("div",{className:"flex items-center justify-end",children:(0,s.jsx)(P,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:n,disabled:o,children:(0,s.jsx)(F,{className:G("h-4 w-4 text-muted-foreground hover:text-foreground",o&&"animate-[spin_0.5s]")})})}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Statistics"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)(T,{label:"Time saved",value:le(k,a),description:"Total execution time saved"}),(0,s.jsx)(T,{label:"Hit rate",value:h>0?`${m(x,a)}%`:"\u2014",description:`${m(p,a)} hits / ${m(h,a)} total`}),(0,s.jsx)(T,{label:"Cache hits",value:m(p,a),description:"Successful cache retrievals"}),(0,s.jsx)(T,{label:"Cache misses",value:m(j,a),description:"Cache not found"})]})]}),f>0&&(0,s.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Storage"}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3",children:(0,s.jsx)(T,{label:"Disk usage",value:L(f,a),description:v>0?`${L(v,a)} can be freed`:"Cache storage on disk"})})]}),(0,s.jsx)("div",{className:"my-auto"}),(0,s.jsx)("div",{className:"pt-2 border-t",children:(0,s.jsx)(re,{title:"Purge cache?",description:"This will permanently delete all cached data. This action cannot be undone.",confirmText:"Purge",destructive:!0,onConfirm:y,children:(0,s.jsxs)(P,{variant:"outlineDestructive",size:"xs",disabled:l,className:"w-full",children:[l?(0,s.jsx)(S,{size:"small",className:"w-3 h-3 mr-2"}):(0,s.jsx)(K,{className:"w-3 h-3 mr-2"}),"Purge Cache"]})})})]})})},T=i=>{let e=(0,oe.c)(10),{label:t,value:l,description:r}=i,a;e[0]===t?a=e[1]:(a=(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:t}),e[0]=t,e[1]=a);let c;e[2]===l?c=e[3]:(c=(0,s.jsx)("span",{className:"text-lg font-semibold",children:l}),e[2]=l,e[3]=c);let o;e[4]===r?o=e[5]:(o=r&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=o);let n;return e[6]!==a||e[7]!==c||e[8]!==o?(n=(0,s.jsxs)("div",{className:"flex flex-col gap-1 p-3 rounded-lg border bg-card",children:[a,c,o]}),e[6]=a,e[7]=c,e[8]=o,e[9]=n):n=e[9],n},ne=ce;export{ne as default};
1
+ import{s as z}from"./chunk-LvLJmgfZ.js";import{u as O}from"./useEvent-DlWF5OMa.js";import{t as A}from"./react-BGmjiNul.js";import"./react-dom-C9fstfnp.js";import{t as B}from"./compiler-runtime-DeeZ7FnK.js";import{t as R}from"./jsx-runtime-DN_bIXfG.js";import{t as P}from"./button-B8cGZzP5.js";import{t as G}from"./cn-C1rgT0yh.js";import{r as H}from"./requests-C0HaHO6a.js";import{t as _}from"./database-zap-CaVvnK_o.js";import{t as S}from"./spinner-C1czjtp7.js";import{t as F}from"./refresh-cw-Din9uFKE.js";import{t as K}from"./trash-2-C-lF7BNB.js";import{t as D}from"./use-toast-Bzf3rpev.js";import"./Combination-D1TsGrBC.js";import{a as q,c as J,i as Q,l as U,n as V,o as W,r as X,s as Y,t as Z,u as ee}from"./alert-dialog-jcHA5geR.js";import{t as se}from"./context-DHfVoQfl.js";import{r as m}from"./numbers-C9_R_vlY.js";import{n as te}from"./useAsyncData-BJJJOr9W.js";import{t as E}from"./empty-state-B0XJ9ZUi.js";import{t as ae}from"./requests-DiQsDZob.js";var ie=B(),I=z(A(),1),s=z(R(),1);const re=i=>{let e=(0,ie.c)(27),{children:t,title:l,description:r,onConfirm:a,confirmText:c,cancelText:o,destructive:n}=i,y=c===void 0?"Continue":c,u=o===void 0?"Cancel":o,p=n===void 0?!1:n,[j,k]=I.useState(!1),f;e[0]===a?f=e[1]:(f=()=>{a(),k(!1)},e[0]=a,e[1]=f);let v=f,h=p?W:V,x;e[2]===t?x=e[3]:(x=(0,s.jsx)(ee,{asChild:!0,children:t}),e[2]=t,e[3]=x);let d;e[4]===l?d=e[5]:(d=(0,s.jsx)(U,{children:l}),e[4]=l,e[5]=d);let g;e[6]===r?g=e[7]:(g=(0,s.jsx)(q,{children:r}),e[6]=r,e[7]=g);let N;e[8]!==d||e[9]!==g?(N=(0,s.jsxs)(J,{children:[d,g]}),e[8]=d,e[9]=g,e[10]=N):N=e[10];let b;e[11]===u?b=e[12]:(b=(0,s.jsx)(X,{children:u}),e[11]=u,e[12]=b);let C;e[13]!==h||e[14]!==y||e[15]!==v?(C=(0,s.jsx)(h,{onClick:v,children:y}),e[13]=h,e[14]=y,e[15]=v,e[16]=C):C=e[16];let w;e[17]!==C||e[18]!==b?(w=(0,s.jsxs)(Y,{children:[b,C]}),e[17]=C,e[18]=b,e[19]=w):w=e[19];let $;e[20]!==w||e[21]!==N?($=(0,s.jsxs)(Q,{children:[N,w]}),e[20]=w,e[21]=N,e[22]=$):$=e[22];let M;return e[23]!==j||e[24]!==$||e[25]!==x?(M=(0,s.jsxs)(Z,{open:j,onOpenChange:k,children:[x,$]}),e[23]=j,e[24]=$,e[25]=x,e[26]=M):M=e[26],M};function L(i,e){if(i===0||i===-1)return"0 B";let t=1024,l=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(i)/Math.log(t));return`${m(i/t**r,e)} ${l[r]}`}function le(i,e){if(i===0)return"0s";if(i<.001)return`${m(i*1e6,e)}\xB5s`;if(i<1)return`${m(i*1e3,e)}ms`;if(i<60)return`${m(i,e)}s`;let t=Math.floor(i/60),l=i%60;if(t<60)return l>0?`${t}m ${m(l,e)}s`:`${t}m`;let r=Math.floor(t/60),a=t%60;return a>0?`${r}h ${a}m`:`${r}h`}var oe=B(),ce=()=>{let{clearCache:i,getCacheInfo:e}=H(),t=O(ae),[l,r]=(0,I.useState)(!1),{locale:a}=se(),{isPending:c,isFetching:o,refetch:n}=te(async()=>{await e(),await new Promise(d=>setTimeout(d,500))},[]),y=async()=>{try{r(!0),await i(),D({title:"Cache purged",description:"All cached data has been cleared"}),n()}catch(d){D({title:"Error",description:d instanceof Error?d.message:"Failed to purge cache",variant:"danger"})}finally{r(!1)}};if(c&&!t)return(0,s.jsx)(S,{size:"medium",centered:!0});let u=(0,s.jsxs)(P,{variant:"outline",size:"sm",onClick:n,disabled:o,children:[o?(0,s.jsx)(S,{size:"small",className:"w-4 h-4 mr-2"}):(0,s.jsx)(F,{className:"w-4 h-4 mr-2"}),"Refresh"]});if(!t)return(0,s.jsx)(E,{title:"No cache data",description:"Cache information is not available.",icon:(0,s.jsx)(_,{}),action:u});let p=t.hits,j=t.misses,k=t.time,f=t.disk_total,v=t.disk_to_free,h=p+j,x=h>0?p/h*100:0;return h===0?(0,s.jsx)(E,{title:"No cache activity",description:"The cache has not been used yet. Cached functions will appear here once they are executed.",icon:(0,s.jsx)(_,{}),action:u}):(0,s.jsx)("div",{className:"flex flex-col h-full overflow-auto",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4 p-4 h-full",children:[(0,s.jsx)("div",{className:"flex items-center justify-end",children:(0,s.jsx)(P,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:n,disabled:o,children:(0,s.jsx)(F,{className:G("h-4 w-4 text-muted-foreground hover:text-foreground",o&&"animate-[spin_0.5s]")})})}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Statistics"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)(T,{label:"Time saved",value:le(k,a),description:"Total execution time saved"}),(0,s.jsx)(T,{label:"Hit rate",value:h>0?`${m(x,a)}%`:"\u2014",description:`${m(p,a)} hits / ${m(h,a)} total`}),(0,s.jsx)(T,{label:"Cache hits",value:m(p,a),description:"Successful cache retrievals"}),(0,s.jsx)(T,{label:"Cache misses",value:m(j,a),description:"Cache not found"})]})]}),f>0&&(0,s.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Storage"}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3",children:(0,s.jsx)(T,{label:"Disk usage",value:L(f,a),description:v>0?`${L(v,a)} can be freed`:"Cache storage on disk"})})]}),(0,s.jsx)("div",{className:"my-auto"}),(0,s.jsx)("div",{className:"pt-2 border-t",children:(0,s.jsx)(re,{title:"Purge cache?",description:"This will permanently delete all cached data. This action cannot be undone.",confirmText:"Purge",destructive:!0,onConfirm:y,children:(0,s.jsxs)(P,{variant:"outlineDestructive",size:"xs",disabled:l,className:"w-full",children:[l?(0,s.jsx)(S,{size:"small",className:"w-3 h-3 mr-2"}):(0,s.jsx)(K,{className:"w-3 h-3 mr-2"}),"Purge Cache"]})})})]})})},T=i=>{let e=(0,oe.c)(10),{label:t,value:l,description:r}=i,a;e[0]===t?a=e[1]:(a=(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:t}),e[0]=t,e[1]=a);let c;e[2]===l?c=e[3]:(c=(0,s.jsx)("span",{className:"text-lg font-semibold",children:l}),e[2]=l,e[3]=c);let o;e[4]===r?o=e[5]:(o=r&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=o);let n;return e[6]!==a||e[7]!==c||e[8]!==o?(n=(0,s.jsxs)("div",{className:"flex flex-col gap-1 p-3 rounded-lg border bg-card",children:[a,c,o]}),e[6]=a,e[7]=c,e[8]=o,e[9]=n):n=e[9],n},ne=ce;export{ne as default};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loro_wasm_bg-BTbzDT9t.js","./loro_wasm_bg-CghhyG7y.js","./chunk-LvLJmgfZ.js"])))=>i.map(i=>d[i]);
2
- var id=Object.defineProperty;var Fa=re=>{throw TypeError(re)};var sd=(re,q,ge)=>q in re?id(re,q,{enumerable:!0,configurable:!0,writable:!0,value:ge}):re[q]=ge;var p=(re,q,ge)=>sd(re,typeof q!="symbol"?q+"":q,ge),ld=(re,q,ge)=>q.has(re)||Fa("Cannot "+ge);var La=(re,q,ge)=>(ld(re,q,"read from private field"),ge?ge.call(re):q.get(re)),Oa=(re,q,ge)=>q.has(re)?Fa("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(re):q.set(re,ge);import{s as Da}from"./chunk-LvLJmgfZ.js";import{d as _a,f as wr,i as Q,l as En,n as ue,p as Bt,s as Nn,u as oe}from"./useEvent-DlWF5OMa.js";import{t as cd}from"./react-BGmjiNul.js";import{$t as ud,B as Ua,Bn as dd,C as kn,Dt as vr,Er as Ba,Ft as fd,Gr as md,H as ja,Kt as pd,L as Pa,M as hd,Mt as gd,Or as bd,Ot as Ma,Pt as Qe,Q as yd,Qt as wd,R as vd,Rt as Cn,Tr as Ed,Tt as Er,Ur as Ra,Vt as Nd,Yt as kd,Z as Nr,Zt as Cd,_n as Sd,_t as xd,a as Ga,at as Ad,bn as Td,br as Id,ct as Fd,ei as Sn,fr as Ld,gn as Od,hn as Dd,jt as _d,kt as Ja,l as Wa,lt as Ud,nn as kr,ot as Cr,p as Sr,st as xn,u as Va,un as Bd,ut as jt,v as nt,vr as xr,vt as $a,wt as jd,xr as Pd,z as Ha,__tla as Md}from"./cells-CxLYaBUM.js";import{P as qa,R as Rd,k as Gd,w as Jd}from"./zod-Cg4WLWh2.js";import{t as Re}from"./compiler-runtime-DeeZ7FnK.js";import{n as Wd,r as Vd,s as $d,t as Hd,u as qd}from"./client-0ZjIqESP.js";import{d as $e,f as zd,l as Ar,n as za}from"./hotkeys-uKX61F1_.js";import{t as Pt}from"./invariant-C6yE60hi.js";import{f as Ka,i as Kd,m as Ya,o as Yd,p as Xd,s as Xa,x as Tr}from"./utils-CJJIceVn.js";import{M as Qd,b as Zd,j as yt,k as Qa,o as ef,r as Za,s as tf,w as lt}from"./config-Ba3eeYri.js";import{a as nf,n as ei,t as rf}from"./switch-CKzkriUC.js";import{n as of}from"./globals-DLZWqwk9.js";import{t as af}from"./ErrorBoundary-Drf1manw.js";import{t as sf}from"./useEventListener-COkmyg1v.js";import{t as lf}from"./jsx-runtime-DN_bIXfG.js";import{r as Ir,t as He}from"./button-DuYGqRtX.js";import{t as ct}from"./cn-C1rgT0yh.js";import{$t as An,Bt as Fr,Ct as ti,Dt as cf,E as uf,Gt as df,H as ni,I as ff,It as Tn,J as l,Jt as qe,P as mf,Pt as In,Rt as pf,St as Je,Ut as ut,V as ri,Vt as Mt,Xt as Rt,_ as hf,a as gf,at as B,bt as bf,ct as ze,ft as yf,it as wf,jt as vf,lt as Fn,m as Ef,pt as Nf,qt as pe,rt as H,st as kf,vt as Cf,w as Sf,wt as xf,yt as Af,zt as wt}from"./dist-CAcX026F.js";import{C as Tf,D as If,_ as Ff,a as Lf,c as Of,n as Lr,r as Df,v as _f,x as Uf,y as Bf}from"./dist-CI6_zMIl.js";import{E as jf,__tla as Pf}from"./JsonOutput-Dkt5bNmT.js";import{c as oi,n as Mf}from"./once-CTiSlR1m.js";import{t as Or}from"./createReducer-DDa-hVe3.js";import{a as Rf,c as Gf,f as Ln,h as Jf,i as Wf,l as Gt,n as ai,o as Vf,t as $f}from"./dist-DKNOF5xd.js";import{r as Jt,t as Hf}from"./requests-C0HaHO6a.js";import{t as qf}from"./createLucideIcon-CW2xpJ57.js";import{f as zf,r as ii,t as Kf,__tla as Yf}from"./layout-CJrjJQJ1.js";import{O as Xf,S as si,T as Qf,_ as Zf,a as li,k as em,n as tm,o as nm,r as ci,s as rm,x as om}from"./add-cell-with-ai-6i4jmAOJ.js";import{t as am}from"./ai-model-dropdown-NoEabH3r.js";import{h as im}from"./select-D0g5GnIs.js";import{t as sm}from"./download-kb4f28me.js";import{t as lm}from"./circle-check-Cr0N4h9T.js";import{r as cm,t as um}from"./types-rseSmieg.js";import{n as ui}from"./spinner-C1czjtp7.js";import{t as di}from"./save-BOTLFf-P.js";import{I as fi,P as dm}from"./input-a7Oxxo2e.js";import{a as fm,i as mm,n as mi}from"./state-CBLi2yPn.js";import{t as pm}from"./preload-helper-BW0IMuFq.js";import{t as vt}from"./use-toast-Bzf3rpev.js";import{r as hm}from"./useTheme-DfP1CWaW.js";import{t as Et}from"./tooltip-CvjcEpZC.js";import{r as gm,t as bm}from"./mode-BI49gh_2.js";import{c as pi,i as hi,n as gi,r as ym}from"./dialog-DUEuLcT2.js";import{k as wm}from"./usePress-DTwIUo40.js";import{a as vm,r as Em,t as Nm}from"./popover-DtnzNVk-.js";import{n as bi}from"./ImperativeModal-B7kKs9xL.js";import{a as km}from"./error-banner-DU5Qb8a8.js";import{t as Cm}from"./copy-DRhpWiOq.js";import{a as Sm}from"./useRunCells-CQiKZU8u.js";import{t as Y}from"./extends-B9D0JO9U.js";import{t as Wt}from"./objectWithoutPropertiesLoose-CboCOq4o.js";import{t as xm}from"./kbd-Czc5z_04.js";import{a as Dr}from"./useInstallPackage-RldLPyJs.js";import{a as Am,o as Tm}from"./cell-link-BW63-8Zi.js";import{n as Im}from"./useAsyncData-BJJJOr9W.js";import{a as Fm,o as yi,r as Lm,s as wi,t as Om}from"./command-Bt6twrmW.js";import{r as Dm}from"./es-CYXJA6lG.js";import{a as _m}from"./focus-CCFhJFiF.js";import{a as vi}from"./renderShortcut-D0Pei-OA.js";import{t as _r}from"./label-qwandMoh.js";import{n as Ur,t as Ei}from"./useDeleteCell-CrEKA1bV.js";import{n as Nt}from"./esm-B3JckBtM.js";import{n as Um,t as Bm}from"./icons-D4lB4En9.js";import{t as Ni}from"./dist-Ciq1Lh9M.js";import{t as jm}from"./useSplitCell-CSg5yFV8.js";import{t as ki}from"./Inputs-DmoeP8nh.js";import{co as Pm,do as Br,fo as Mm,ft as Rm,go as kt,ho as Ci,lo as jr,mo as Si,oo as xi,po as Gm,so as Ai,uo as Ti,__tla as Jm}from"./loro_wasm_bg-CghhyG7y.js";import{t as Wm}from"./ws-itdlXHqs.js";import{t as Pr}from"./useInterval-DpipYmgs.js";let Ii,Mr,Fi,dt,Li,On,Rr,Vt,Dn,be,Oi,Di,_i,Ui,_n,Bi,Gr,Un,Vm=Promise.all([(()=>{try{return Md}catch{}})(),(()=>{try{return Pf}catch{}})(),(()=>{try{return Yf}catch{}})(),(()=>{try{return Jm}catch{}})()]).then(async()=>{var vn,Ia,we,ve,Ee,Ne,ke,Ce,Se,xe,Ae,Te,Ie,Fe,Le,Oe,De,_e,Ue,Be,je;var re=qf("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const q={showInput:"Mod-l",acceptEdit:"Mod-y",rejectEdit:"Mod-u"};var ge=300;const St=Mt.define({combine:e=>An(e,{onError:console.error,inputDebounceTime:ge,keymaps:q},{onError:(t,n)=>t&&n,inputDebounceTime:(t,n)=>t&&n,keymaps:(t,n)=>t&&n})}),rt=pe.define(),ot=qe.define({create(){return{show:!1,lineFrom:0,lineTo:0}},update(e,t){for(let n of t.effects)if(n.is(rt))return n.value;return e}}),xt=pe.define(),At=pe.define(),Wr=qe.define({create(){return{shouldFocus:!1,inputValue:""}},update(e,t){let n=e;for(let r of t.effects)r.is(xt)&&(n={...n,inputValue:r.value}),r.is(At)&&(n={...n,shouldFocus:r.value});return n}}),$t=pe.define(),Tt=qe.define({create(){return null},update(e,t){for(let n of t.effects)if(n.is($t))return n.value;return e}}),ft=pe.define(),Vr=qe.define({create(){return!1},update(e,t){for(let n of t.effects)if(n.is(ft))return n.value;return e}});var ji=1;const $r=e=>{let{state:t}=e,n=t.selection.main;if(n.empty)return!1;let r=t.doc,o=r.lineAt(n.from),a=r.lineAt(n.to);if(t.sliceDoc(o.from,a.to).trim().length<ji)return!1;let i=Math.max(1,Math.min(o.number,r.lines)),s=Math.max(1,Math.min(a.number,r.lines));return e.dispatch({effects:[rt.of({show:!0,lineFrom:i,lineTo:s}),At.of(!0),xt.of("")],selection:wt.cursor(o.from)}),!0},Hr=e=>e.state.field(Tt)?(e.dispatch({effects:[$t.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),At.of(!1),xt.of(""),ft.of(!1)]}),!0):!1,qr=e=>{let t=e.state.field(Tt);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[$t.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),At.of(!1),xt.of(""),ft.of(!1)]}),!0):!1};var Bn={mac:"\u2318",windows:"\u229E Win",default:"Ctrl"};function Pi(){return navigator.platform.startsWith("Mac")?Bn.mac:navigator.platform.startsWith("Win")?Bn.windows:Bn.default}function jn(e){return e.replace("Mod",Pi()).replace("-"," ").toUpperCase()}function de(e,t){let n=document.createElement(e);return n.className=t,n}function Mi(e,t,n=void 0){let r=()=>{};return(...o)=>(r(),new Promise((a,i)=>{let s=setTimeout(()=>a(e(...o)),t);r=()=>{clearTimeout(s),n!==void 0&&i(n)}}))}var Ht=qe.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(r=>r.is(qt));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),qt=pe.define();function Ri(e,t){let n=e.state.selection.main.head,r=[],o=H.widget({widget:new Gi(t),side:1});return r.push(o.range(n)),H.set(r)}var Gi=class extends Fn{constructor(t){super();p(this,"suggestion");this.suggestion=t}toDOM(){let t=document.createElement("span");return t.style.opacity="0.4",t.className="cm-inline-suggestion",t.textContent=this.suggestion,t.setAttribute("role","suggestion"),t.setAttribute("aria-label",`Suggestion: ${this.suggestion}`),t}get lineBreaks(){return this.suggestion.split(`
2
+ var id=Object.defineProperty;var Fa=re=>{throw TypeError(re)};var sd=(re,q,ge)=>q in re?id(re,q,{enumerable:!0,configurable:!0,writable:!0,value:ge}):re[q]=ge;var p=(re,q,ge)=>sd(re,typeof q!="symbol"?q+"":q,ge),ld=(re,q,ge)=>q.has(re)||Fa("Cannot "+ge);var La=(re,q,ge)=>(ld(re,q,"read from private field"),ge?ge.call(re):q.get(re)),Oa=(re,q,ge)=>q.has(re)?Fa("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(re):q.set(re,ge);import{s as Da}from"./chunk-LvLJmgfZ.js";import{d as _a,f as wr,i as Q,l as En,n as ue,p as Bt,s as Nn,u as oe}from"./useEvent-DlWF5OMa.js";import{t as cd}from"./react-BGmjiNul.js";import{$t as ud,B as Ua,Bn as dd,C as kn,Dt as vr,Er as Ba,Ft as fd,Gr as md,H as ja,Kt as pd,L as Pa,M as hd,Mt as gd,Or as bd,Ot as Ma,Pt as Qe,Q as yd,Qt as wd,R as vd,Rt as Cn,Tr as Ed,Tt as Er,Ur as Ra,Vt as Nd,Yt as kd,Z as Nr,Zt as Cd,_n as Sd,_t as xd,a as Ga,at as Ad,bn as Td,br as Id,ct as Fd,ei as Sn,fr as Ld,gn as Od,hn as Dd,jt as _d,kt as Ja,l as Wa,lt as Ud,nn as kr,ot as Cr,p as Sr,st as xn,u as Va,un as Bd,ut as jt,v as nt,vr as xr,vt as $a,wt as jd,xr as Pd,z as Ha,__tla as Md}from"./cells-Bybxko6N.js";import{P as qa,R as Rd,k as Gd,w as Jd}from"./zod-Cg4WLWh2.js";import{t as Re}from"./compiler-runtime-DeeZ7FnK.js";import{n as Wd,r as Vd,s as $d,t as Hd,u as qd}from"./client-BHJbjyLn.js";import{d as $e,f as zd,l as Ar,n as za}from"./hotkeys-uKX61F1_.js";import{t as Pt}from"./invariant-C6yE60hi.js";import{f as Ka,i as Kd,m as Ya,o as Yd,p as Xd,s as Xa,x as Tr}from"./utils-CJJIceVn.js";import{M as Qd,b as Zd,j as yt,k as Qa,o as ef,r as Za,s as tf,w as lt}from"./config-Ba3eeYri.js";import{a as nf,n as ei,t as rf}from"./switch-BrMSOK9-.js";import{n as of}from"./globals-BoC3OJDy.js";import{t as af}from"./ErrorBoundary-C7JBxSzd.js";import{t as sf}from"./useEventListener-COkmyg1v.js";import{t as lf}from"./jsx-runtime-DN_bIXfG.js";import{r as Ir,t as He}from"./button-B8cGZzP5.js";import{t as ct}from"./cn-C1rgT0yh.js";import{$t as An,Bt as Fr,Ct as ti,Dt as cf,E as uf,Gt as df,H as ni,I as ff,It as Tn,J as l,Jt as qe,P as mf,Pt as In,Rt as pf,St as Je,Ut as ut,V as ri,Vt as Mt,Xt as Rt,_ as hf,a as gf,at as B,bt as bf,ct as ze,ft as yf,it as wf,jt as vf,lt as Fn,m as Ef,pt as Nf,qt as pe,rt as H,st as kf,vt as Cf,w as Sf,wt as xf,yt as Af,zt as wt}from"./dist-CAcX026F.js";import{C as Tf,D as If,_ as Ff,a as Lf,c as Of,n as Lr,r as Df,v as _f,x as Uf,y as Bf}from"./dist-CI6_zMIl.js";import{E as jf,__tla as Pf}from"./JsonOutput-p0zb9mQ1.js";import{c as oi,n as Mf}from"./once-CTiSlR1m.js";import{t as Or}from"./createReducer-DDa-hVe3.js";import{a as Rf,c as Gf,f as Ln,h as Jf,i as Wf,l as Gt,n as ai,o as Vf,t as $f}from"./dist-DKNOF5xd.js";import{r as Jt,t as Hf}from"./requests-C0HaHO6a.js";import{t as qf}from"./createLucideIcon-CW2xpJ57.js";import{f as zf,r as ii,t as Kf,__tla as Yf}from"./layout-CExKZnfn.js";import{O as Xf,S as si,T as Qf,_ as Zf,a as li,k as em,n as tm,o as nm,r as ci,s as rm,x as om}from"./add-cell-with-ai-Dq4w_0vC.js";import{t as am}from"./ai-model-dropdown-DgfCTAMr.js";import{h as im}from"./select-D9lTzMzP.js";import{t as sm}from"./download-DFqv8W29.js";import{t as lm}from"./circle-check-Cr0N4h9T.js";import{r as cm,t as um}from"./types-9ye0mIoa.js";import{n as ui}from"./spinner-C1czjtp7.js";import{t as di}from"./save-BOTLFf-P.js";import{I as fi,P as dm}from"./input-B80Yt1uu.js";import{a as fm,i as mm,n as mi}from"./state-DSeEWQ7X.js";import{t as pm}from"./preload-helper-BW0IMuFq.js";import{t as vt}from"./use-toast-Bzf3rpev.js";import{r as hm}from"./useTheme-DfP1CWaW.js";import{t as Et}from"./tooltip-CvjcEpZC.js";import{r as gm,t as bm}from"./mode-C0y8rrJY.js";import{c as pi,i as hi,n as gi,r as ym}from"./dialog-CF5DtF1E.js";import{k as wm}from"./usePress-DTwIUo40.js";import{a as vm,r as Em,t as Nm}from"./popover-DtnzNVk-.js";import{n as bi}from"./ImperativeModal-DVhvP4lH.js";import{a as km}from"./error-banner-DvT0IGDZ.js";import{t as Cm}from"./copy-DRhpWiOq.js";import{a as Sm}from"./useRunCells-CcuO6KPm.js";import{t as Y}from"./extends-B9D0JO9U.js";import{t as Wt}from"./objectWithoutPropertiesLoose-CboCOq4o.js";import{t as xm}from"./kbd-Czc5z_04.js";import{a as Dr}from"./useInstallPackage-RldLPyJs.js";import{a as Am,o as Tm}from"./cell-link-Bm4hypmB.js";import{n as Im}from"./useAsyncData-BJJJOr9W.js";import{a as Fm,o as yi,r as Lm,s as wi,t as Om}from"./command-BGzGALfV.js";import{r as Dm}from"./es-m6vibNCH.js";import{a as _m}from"./focus-B3JRNMT5.js";import{a as vi}from"./renderShortcut-D0Pei-OA.js";import{t as _r}from"./label-CNZLffHW.js";import{n as Ur,t as Ei}from"./useDeleteCell-cgZ94jOt.js";import{n as Nt}from"./esm-B3JckBtM.js";import{n as Um,t as Bm}from"./icons-D4lB4En9.js";import{t as Ni}from"./dist-Ciq1Lh9M.js";import{t as jm}from"./useSplitCell-CrWmr1Ul.js";import{t as ki}from"./Inputs-DmoeP8nh.js";import{co as Pm,do as Br,fo as Mm,ft as Rm,go as kt,ho as Ci,lo as jr,mo as Si,oo as xi,po as Gm,so as Ai,uo as Ti,__tla as Jm}from"./loro_wasm_bg-CghhyG7y.js";import{t as Wm}from"./ws-itdlXHqs.js";import{t as Pr}from"./useInterval-DpipYmgs.js";let Ii,Mr,Fi,dt,Li,On,Rr,Vt,Dn,be,Oi,Di,_i,Ui,_n,Bi,Gr,Un,Vm=Promise.all([(()=>{try{return Md}catch{}})(),(()=>{try{return Pf}catch{}})(),(()=>{try{return Yf}catch{}})(),(()=>{try{return Jm}catch{}})()]).then(async()=>{var vn,Ia,we,ve,Ee,Ne,ke,Ce,Se,xe,Ae,Te,Ie,Fe,Le,Oe,De,_e,Ue,Be,je;var re=qf("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const q={showInput:"Mod-l",acceptEdit:"Mod-y",rejectEdit:"Mod-u"};var ge=300;const St=Mt.define({combine:e=>An(e,{onError:console.error,inputDebounceTime:ge,keymaps:q},{onError:(t,n)=>t&&n,inputDebounceTime:(t,n)=>t&&n,keymaps:(t,n)=>t&&n})}),rt=pe.define(),ot=qe.define({create(){return{show:!1,lineFrom:0,lineTo:0}},update(e,t){for(let n of t.effects)if(n.is(rt))return n.value;return e}}),xt=pe.define(),At=pe.define(),Wr=qe.define({create(){return{shouldFocus:!1,inputValue:""}},update(e,t){let n=e;for(let r of t.effects)r.is(xt)&&(n={...n,inputValue:r.value}),r.is(At)&&(n={...n,shouldFocus:r.value});return n}}),$t=pe.define(),Tt=qe.define({create(){return null},update(e,t){for(let n of t.effects)if(n.is($t))return n.value;return e}}),ft=pe.define(),Vr=qe.define({create(){return!1},update(e,t){for(let n of t.effects)if(n.is(ft))return n.value;return e}});var ji=1;const $r=e=>{let{state:t}=e,n=t.selection.main;if(n.empty)return!1;let r=t.doc,o=r.lineAt(n.from),a=r.lineAt(n.to);if(t.sliceDoc(o.from,a.to).trim().length<ji)return!1;let i=Math.max(1,Math.min(o.number,r.lines)),s=Math.max(1,Math.min(a.number,r.lines));return e.dispatch({effects:[rt.of({show:!0,lineFrom:i,lineTo:s}),At.of(!0),xt.of("")],selection:wt.cursor(o.from)}),!0},Hr=e=>e.state.field(Tt)?(e.dispatch({effects:[$t.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),At.of(!1),xt.of(""),ft.of(!1)]}),!0):!1,qr=e=>{let t=e.state.field(Tt);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[$t.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),At.of(!1),xt.of(""),ft.of(!1)]}),!0):!1};var Bn={mac:"\u2318",windows:"\u229E Win",default:"Ctrl"};function Pi(){return navigator.platform.startsWith("Mac")?Bn.mac:navigator.platform.startsWith("Win")?Bn.windows:Bn.default}function jn(e){return e.replace("Mod",Pi()).replace("-"," ").toUpperCase()}function de(e,t){let n=document.createElement(e);return n.className=t,n}function Mi(e,t,n=void 0){let r=()=>{};return(...o)=>(r(),new Promise((a,i)=>{let s=setTimeout(()=>a(e(...o)),t);r=()=>{clearTimeout(s),n!==void 0&&i(n)}}))}var Ht=qe.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(r=>r.is(qt));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),qt=pe.define();function Ri(e,t){let n=e.state.selection.main.head,r=[],o=H.widget({widget:new Gi(t),side:1});return r.push(o.range(n)),H.set(r)}var Gi=class extends Fn{constructor(t){super();p(this,"suggestion");this.suggestion=t}toDOM(){let t=document.createElement("span");return t.style.opacity="0.4",t.className="cm-inline-suggestion",t.textContent=this.suggestion,t.setAttribute("role","suggestion"),t.setAttribute("aria-label",`Suggestion: ${this.suggestion}`),t}get lineBreaks(){return this.suggestion.split(`
3
3
  `).length-1}},Ji=class{constructor(e){p(this,"cache",new Map);p(this,"timeout");this.timeout=e}get(e){let t=this.cache.get(e);return t?Date.now()-t.timestamp>this.timeout?(this.cache.delete(e),null):t.result:null}set(e,t){this.cache.set(e,{result:t,timestamp:Date.now()})}},Wi=(e,t)=>ze.fromClass(class{constructor(){p(this,"abortController",null);p(this,"cache");this.cache=new Ji(t.cacheTimeout??1e3)}async update(n){var i,s,c,u,d;if(!n.docChanged||((s=(i=t.events)==null?void 0:i.beforeSuggestionFetch)==null?void 0:s.call(i,n.view))===!1)return;(c=this.abortController)==null||c.abort(),this.abortController=new AbortController;let r=n.state.doc,o=r.toString(),a=this.cache.get(o);if(a){n.view.dispatch({effects:qt.of({text:a,doc:r})});return}try{let f=await e(n.state,this.abortController.signal,n.view);if(this.abortController.signal.aborted||((d=(u=t.events)==null?void 0:u.shouldShowSuggestion)==null?void 0:d.call(u,n.view,f))===!1)return;this.cache.set(o,f),n.view.dispatch({effects:qt.of({text:f,doc:r})})}catch(f){f instanceof Error&&f.name!=="AbortError"&&console.error("Suggestion fetch error:",f)}}destroy(){var n;(n=this.abortController)==null||n.abort()}}),Vi=ze.fromClass(class{constructor(){p(this,"decorations");this.decorations=H.none}update(e){var n;let t=(n=e.state.field(Ht))==null?void 0:n.suggestion;if(!t){this.decorations=H.none;return}this.decorations=Ri(e.view,t)}},{decorations:e=>e.decorations});function $i(e,t,n,r){return{...e.changeByRange(o=>{if(o===e.selection.main)return{changes:{from:n,to:r,insert:t},range:wt.cursor(n+t.length)};let a=r-n;return!o.empty||a&&e.sliceDoc(o.from-a,o.from)!==e.sliceDoc(n,r)?{range:o}:{changes:{from:o.from-a,to:o.from,insert:t},range:wt.cursor(o.from-a+t.length)}}),userEvent:"input.complete"}}var Hi=e=>{var r,o,a;let t=(r=e.state.field(Ht))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Pn);return e.dispatch({...$i(e.state,t,e.state.selection.main.head,e.state.selection.main.head)}),(a=(o=n.events)==null?void 0:o.onSuggestionAccepted)==null||a.call(o,e,t),!0},zr=e=>{var r,o,a;let t=(r=e.state.field(Ht))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Pn);return e.dispatch({effects:qt.of({text:null,doc:e.state.doc})}),(a=(o=n.events)==null?void 0:o.onSuggestionRejected)==null||a.call(o,e,t),!0},qi=Je.of([{key:"Tab",run:Hi},{key:"Escape",run:zr}]),Pn=Mt.define({combine:e=>e.at(-1)});function Kr(e){let{delay:t=500,includeKeymap:n=!0}=e,r=Mi(e.fetchFn,t);return[Ht,Pn.of(e),Wi(r,e),Vi,n?qi:[]]}const zi=B.baseTheme({".cm-ai-input-container":{display:"flex",flexDirection:"column",gap:"4px",width:"min(calc(100% + 7px), 500px)",padding:"5px 5px",margin:"0 -6px",backgroundColor:"light-dark(rgb(241, 243, 245), rgb(40, 40, 40))"},".cm-ai-input":{display:"block",width:"100%",padding:"3px 8px",border:"2px solid rgb(51, 154, 240)",borderRadius:"5px",fontSize:"12px"},".cm-ai-help-info-button":{fontSize:"10px",paddingLeft:"10px",height:"18px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",display:"block",marginRight:"auto"},".cm-ai-help-info-button:hover":{color:"light-dark(rgb(89, 97, 105), rgb(190, 190, 190))"},".cm-ai-generate-button":{background:"#0E639C",border:"none",padding:"2px 6px",color:"#ffffff",cursor:"pointer",font:"inherit",borderRadius:"4px","&:hover":{backgroundColor:"#1177bb"}},".cm-line.cm-ai-selection, .cm-line.cm-ai-selection.cm-active-line":{backgroundColor:"light-dark(color-mix(in srgb, rgb(223, 227, 232) 50%, transparent), color-mix(in srgb, rgb(50, 50, 50) 50%, transparent)) !important"},".cm-line:has(.cm-new-code-line)":{backgroundColor:"light-dark(color-mix(in srgb, rgb(183, 235, 143) 50%, transparent), color-mix(in srgb, rgb(40, 100, 40) 50%, transparent)) !important"},".cm-old-code-container":{backgroundColor:"light-dark(rgb(255, 205, 205), rgb(100, 40, 40))",position:"relative",display:"flex",paddingTop:"0",width:"100%",alignItems:"center"},".cm-code-button":{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"16px"},".cm-floating-buttons":{fontFamily:"sans-serif",position:"absolute",top:"-20px",left:"5px",display:"flex"},".cm-floating-button":{fontFamily:"sans-serif",padding:"2px 5px",fontSize:"10px",cursor:"pointer",fontWeight:"700"},".cm-floating-accept":{backgroundColor:"light-dark(rgb(55, 125, 34), rgb(40, 80, 25))",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px",color:"white",filter:"brightness(90%)","&:hover":{filter:"brightness(100%)"}},".cm-floating-reject":{backgroundColor:"light-dark(rgb(220, 53, 69), rgb(180, 40, 50))",color:"white",borderTopRightRadius:"5px",borderBottomRightRadius:"5px",filter:"brightness(90%)","&:hover":{filter:"brightness(100%)"}},".hotkey":{display:"inline-block",padding:"0 4px",borderRadius:"3px",backgroundColor:"rgba(255, 255, 255, 0.1)",fontSize:"90%"},".cm-ai-loading-indicator":{fontStyle:"italic",fontSize:"10px",paddingLeft:"12px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",opacity:"0",transition:"opacity 0.3s ease-in-out","&::after":{content:'""',display:"inline-block",animation:"ellipsis-pulse 1.5s steps(4, end) infinite"},"&:not(:empty)":{opacity:"1"}},".cm-ai-input:disabled":{opacity:"0.5"},"@keyframes ellipsis-pulse":{"0%":{content:"'.'"},"25%":{content:"'..'"},"50%":{content:"'...'"},"75%":{content:"''"}},".cm-ai-loading-container":{display:"flex",alignItems:"center",padding:"0 8px"},".cm-ai-cancel-button":{padding:"2px 8px",fontSize:"10px",borderRadius:"4px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",cursor:"pointer","&:hover":{background:"light-dark(rgb(223, 227, 232), rgb(50, 50, 50))"}},".hidden":{display:"none"}});function Ki(e){var o,a;let t=e.state.facet(St),n={...q,...t.keymaps},r=de("div","cm-ai-tooltip").appendChild(de("div","cm-ai-tooltip-button"));return r.innerHTML=`<span>Edit <span class="hotkey">${jn(n.showInput)}</span></span>`,(o=r.querySelector("span"))==null||o.addEventListener("mousedown",i=>{i.stopPropagation(),i.button===0&&i.preventDefault()}),(a=r.querySelector("span"))==null||a.addEventListener("click",i=>{i.preventDefault(),$r(e)}),r}const Mn=Mt.define({combine(e){return An(e,{render:Ki,hideOnBlur:!1})}}),Yi=ze.fromClass((Ia=class{constructor(e){p(this,"view");p(this,"suppress");p(this,"dom");p(this,"mousedown",()=>{this.suppress=!0});p(this,"mouseup",()=>{this.suppress=!1,this.display(this.view)});p(this,"scroll",()=>{this.display(this.view)});p(this,"windowScroll",()=>{this.display(this.view)});Oa(this,vn,e=>{var n;let t=e.state.selection.ranges.find(r=>!r.empty);if(t&&!this.suppress){let r=e.coordsAtPos(t.from);if(!r)return;let o=e.dom.getBoundingClientRect(),a=(n=e.dom.parentElement)==null?void 0:n.getBoundingClientRect(),i=r.top>=o.top&&r.top<=o.bottom&&r.left>=o.left&&r.left<=o.right,s=!a||r.top>=a.top&&r.top<=a.bottom&&r.left>=a.left&&r.left<=a.right;if(!i||!s){this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true");return}this.dom.style.display="flex",this.dom.setAttribute("aria-hidden","false");let c=this.dom.getBoundingClientRect(),u=o.width-c.width,d=Math.min(r.left,u),f=r.top-c.height;f=a?Math.max(a.y,f):f,this.dom.style.left=`${d}px`,this.dom.style.top=`${f}px`,requestAnimationFrame(()=>{this.dom&&this.dom.setAttribute("aria-hidden","false")})}else this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true")});this.view=e;let t=e.state.facet(Mn);this.suppress=!1,document.addEventListener("mousedown",this.mousedown),document.addEventListener("mouseup",this.mouseup),e.scrollDOM.addEventListener("scroll",this.scroll),window.addEventListener("scroll",this.windowScroll,!0);let n=t.render(e);e.dom.appendChild(n),this.dom=n}update(e){this.display(e.view)}docViewUpdate(e){this.display(e)}display(e){if(e.state.field(ot).show){this.dom.style.display="none";return}if(e.state.facet(Mn).hideOnBlur&&!e.hasFocus){this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true");return}e.requestMeasure({read:La(this,vn)})}destroy(){document.removeEventListener("mousedown",this.mousedown),document.removeEventListener("mouseup",this.mouseup),this.view.scrollDOM.removeEventListener("scroll",this.scroll),window.removeEventListener("scroll",this.windowScroll,!0),this.dom.remove()}},vn=new WeakMap,Ia));var Xi=B.baseTheme({".cm-ai-tooltip-button":{userSelect:"none",fontFamily:"system-ui, -apple-system, sans-serif",position:"fixed",display:"flex",boxSizing:"border-box",padding:"2px 6px",borderRadius:"4px",fontSize:"12px",backgroundColor:"#0E639C",color:"#ffffff",border:"1px solid transparent",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:"999",transition:"opacity 0.5s","&[aria-hidden='true']":{opacity:"0"},"&[aria-hidden='false']":{opacity:"1"},"& > span":{pointerEvents:"auto",cursor:"pointer",display:"inline-block",padding:"2px"},"&:hover":{backgroundColor:"#1177bb"}}});function Qi(){return[Yi,Xi]}var Zi=class extends Fn{constructor(t){super();p(this,"oldCode");this.oldCode=t}toDOM(t){let n=de("div","cm-old-code-container");n.setAttribute("role","region"),n.setAttribute("aria-label","Previous code version");let r=de("div","cm-old-code cm-line");r.textContent=this.oldCode;let o=de("div","cm-floating-buttons"),a=t.state.facet(St),i={...q,...a.keymaps},s=de("button","cm-floating-button cm-floating-accept");s.innerHTML=`<span class="hotkey">${jn(i.acceptEdit)}</span> Accept`,s.setAttribute("aria-label","Accept changes"),s.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),t.focus(),Hr(t)});let c=de("button","cm-floating-button cm-floating-reject");return c.innerHTML=`<span class="hotkey">${jn(i.rejectEdit)}</span> Reject`,c.setAttribute("aria-label","Reject changes"),c.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),t.focus(),qr(t)}),o.append(s,c),n.append(r,o),n}updateDOM(t,n){return!0}},es=class extends Fn{constructor(t){super();p(this,"complete");p(this,"abortController",null);p(this,"dom",null);p(this,"input",null);p(this,"loadingContainer",null);p(this,"helpInfo",null);p(this,"inputContainer",null);p(this,"form",null);p(this,"view",null);p(this,"onKeyDown",async t=>{t.key==="Enter"&&!t.shiftKey?(t.preventDefault(),await this.handleSubmit()):t.key==="Escape"&&this.onCancel()});p(this,"onCancel",()=>{this.cleanup();let t=this.view;t&&(t.dispatch({effects:[rt.of({show:!1,lineFrom:0,lineTo:0}),ft.of(!1)]}),t.focus())});p(this,"handleSubmit",async t=>{var g;let n=this.view;if(!n)return;let r=n.state.facet(St);t==null||t.stopPropagation();let o=n.state.field(ot),{input:a}=this;if(!a)return;let i=a.value.trim();if(!o.show||!i)return;let s=n.state.doc.line(o.lineFrom),c=n.state.doc.line(o.lineTo),u=s.from,d=c.to,f=n.state.sliceDoc(u,d),h=n.state.sliceDoc(0,u),m=n.state.sliceDoc(d);this.abortController=new AbortController,n.dispatch({effects:ft.of(!0)}),this.toggleLoading(!0);try{let y=await this.complete({prompt:i,selection:f,codeBefore:h,codeAfter:m,editorView:n,signal:this.abortController.signal});if(!n.state.field(ot).show)return;if(!y||typeof y!="string")throw Error("Invalid completion result");n.dispatch({changes:{from:u,to:d,insert:y},effects:[rt.of({show:!1,lineFrom:0,lineTo:0}),$t.of({from:u,to:u+y.length,oldCode:f,newCode:y}),ft.of(!1)]})}catch(y){if(y instanceof DOMException&&y.name==="AbortError")return;(g=r.onError)==null||g.call(r,y)}finally{this.cleanup(),this.toggleLoading(!1),n.focus()}});this.complete=t}toDOM(t){if(this.dom)return this.dom;this.view=t;let n=t.state.field(Wr),r=t.state.field(Vr),o=de("div","cm-ai-input-container");this.inputContainer=o,this.dom=o;let a=de("form","cm-ai-input-form");this.form=a,a.setAttribute("role","search"),a.setAttribute("aria-label","AI editing instructions"),a.addEventListener("submit",w=>w.preventDefault());let i=de("input","cm-ai-input");this.input=i,a.append(i),i.placeholder="Editing instructions...",i.setAttribute("aria-label","AI editing instructions"),i.setAttribute("autocomplete","off"),i.setAttribute("spellcheck","true"),i.value=n.inputValue;let s=de("div","cm-ai-loading-container");this.loadingContainer=s;let c=de("div","cm-ai-loading-indicator");c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.textContent="Generating";let u=de("button","cm-ai-cancel-button");u.textContent="Cancel",u.setAttribute("aria-label","Cancel code generation"),u.addEventListener("click",this.onCancel),s.append(u,c);let d=de("div","cm-ai-help-info");this.helpInfo=d;let f=d.appendChild(document.createElement("button"));f.className="cm-ai-help-info-button",f.textContent="Esc to close",f.addEventListener("click",this.onCancel);let h=de("button","cm-ai-generate-button");h.textContent="\u23CE Generate",h.setAttribute("aria-label","Generate code"),h.addEventListener("click",this.handleSubmit),this.toggleLoading(r),n.shouldFocus&&requestAnimationFrame(()=>{i.value=n.inputValue,i.focus(),t.dispatch({effects:At.of(!1)})}),m(i.value),i.addEventListener("input",y),i.addEventListener("keydown",this.onKeyDown);function m(w){d.replaceChildren(w?h:f)}let g="";function y(){t.dispatch({effects:xt.of(i.value)});let w=i.value.trim();w!==g&&(g=w,m(w))}return o}toggleLoading(t){var n;this.inputContainer&&this.form&&this.loadingContainer&&this.helpInfo&&((n=this.inputContainer)==null||n.replaceChildren(this.form,t?this.loadingContainer:this.helpInfo))}updateDOM(t,n){return this.dom=t,this.input=t.querySelector(".cm-ai-input"),!0}cleanup(){var t,n,r;(t=this.abortController)==null||t.abort(),this.abortController=null,(n=this.dom)==null||n.remove(),(r=this.input)==null||r.remove(),this.dom=null,this.input=null}destroy(){this.cleanup()}};function ts(e){if(!e.prompt)throw Error("prompt function is required");let t={...q,...e.keymaps};return[St.of(e),ot,Wr,Tt,Vr,Qi(),zi,Je.of([{key:t.showInput,run:$r}]),ut.highest([Je.of([{key:t.acceptEdit,run:Hr},{key:t.rejectEdit,run:qr}])]),ns,rs,os,as]}const ns=B.updateListener.of(e=>{let t=e.state.field(ot);if(!t.show||!e.docChanged)return;let{lineFrom:n,lineTo:r}=t,o=!1;e.changes.iterChanges((a,i,s,c)=>{let u=e.state.doc.lineAt(a).number;if(u<n){let d=e.state.doc.lineAt(c).number-e.state.doc.lineAt(s).number;n+=d,r+=d,o=!0}else if(u<=r){let d=e.state.doc.lineAt(c).number-e.state.doc.lineAt(s).number;r+=d,o=!0}}),o&&e.view.dispatch({effects:[rt.of({show:!0,lineFrom:n,lineTo:r})]})}),rs=B.decorations.of(e=>{let t=e.state.field(Tt);return t?H.set([H.mark({class:"cm-new-code-line"}).range(t.from,t.to)]):H.none}),os=B.decorations.compute([ot],e=>{let t=e.field(ot),n=e.facet(St),r=[];if(t.show){let o=t.lineFrom,a=t.lineTo;for(let i=o;i<=a;i++){let s=e.doc.line(i).from;r.push(H.line({class:"cm-ai-selection"}).range(s)),i===o&&r.push(H.widget({widget:new es(n.prompt),side:-1}).range(s))}}return H.set(r)}),as=qe.define({create(e){return H.none},update(e,t){let n=t.state.field(Tt);return n?H.set([H.widget({widget:new Zi(n.oldCode),block:!0}).range(n.from)]):H.none},provide:e=>B.decorations.from(e)});var is=Re(),I=Da(cd(),1),Rn=()=>({entries:new Map}),{valueAtom:Yr,useActions:Xr}=Or(Rn,{submit:(e,t)=>{let{cellIds:n,deleteCell:r,deleteManyCells:o,store:a}=t,i=a.get(nt),s=a.get(Dd),c=new Set(i.cellIds.inOrderIds.filter(f=>i.cellData[f].code.trim()==="")),u=new Map;for(let f of n){if(c.has(f)){u.set(f,{cellId:f,type:"simple"});continue}let h=i.cellRuntime[f],m=new Map;for(let y of Object.values(s)){let w=y.declaredBy.includes(f),k=y.usedBy.some(C=>!c.has(C));w&&k&&m.set(y.name,y.usedBy)}let g;h!=null&&h.runElapsedTimeMs&&h.runElapsedTimeMs>2e3&&(g=h.runElapsedTimeMs),m.size===0&&g===void 0?u.set(f,{cellId:f,type:"simple"}):u.set(f,{cellId:f,type:"expensive",executionDurationMs:g,defs:m})}let d=[...u.values()].every(f=>f.type==="simple");return u.size>0&&d?(u.size===1?r({cellId:[...u.values()][0].cellId}):o({cellIds:[...u.values()].map(f=>f.cellId)}),Rn()):{...e,entries:u}},clear:()=>Rn()});Un=function(){let e=wr(),{submit:t,clear:n}=Xr(),{entries:r}=oe(Yr),o=Ei(),a=Ur();return(0,I.useMemo)(()=>({submit:i=>{t({cellIds:i,deleteCell:o,deleteManyCells:a,store:e})},clear:n,get idle(){return r.size===0},get shouldConfirmDelete(){return r.size>1}}),[e,t,n,r,o,a])},Ii=function(e){let t=(0,is.c)(16),n=oe(Yr),r=Xr(),o=Ur(),a;t[0]!==e||t[1]!==n.entries?(a=n.entries.get(e),t[0]=e,t[1]=n.entries,t[2]=a):a=t[2];let i=a;if(!i){let d;return t[3]===Symbol.for("react.memo_cache_sentinel")?(d={isPending:!1},t[3]=d):d=t[3],d}if(n.entries.size!==1){let d;return t[4]===i?d=t[5]:(d={isPending:!0,shouldConfirmDelete:!1,...i},t[4]=i,t[5]=d),d}let s;t[6]!==r||t[7]!==o||t[8]!==n.entries?(s=()=>{o({cellIds:[...n.entries.values()].map(ss)}),r.clear()},t[6]=r,t[7]=o,t[8]=n.entries,t[9]=s):s=t[9];let c;t[10]===r?c=t[11]:(c=()=>r.clear(),t[10]=r,t[11]=c);let u;return t[12]!==i||t[13]!==s||t[14]!==c?(u={isPending:!0,...i,shouldConfirmDelete:!0,confirm:s,cancel:c},t[12]=i,t[13]=s,t[14]=c,t[15]=u):u=t[15],u};function ss(e){return e.cellId}async function ls(e){var s,c;let t=`
4
4
  ${e.codeBefore}
5
5
  <rewrite_this>
@@ -1 +1 @@
1
- import{s as P}from"./chunk-LvLJmgfZ.js";import{d as j,l as O,n as w,u as y}from"./useEvent-DlWF5OMa.js";import{A,C as L,Gt as E,O as S,Pt as T,Ur as _,ei as $,pt as D}from"./cells-CxLYaBUM.js";import{t as b}from"./compiler-runtime-DeeZ7FnK.js";import{d as F}from"./hotkeys-uKX61F1_.js";import{u as U}from"./utils-CJJIceVn.js";import{r as C}from"./constants-Bkp4R3bQ.js";import{j as q,p as B,w as G}from"./config-Ba3eeYri.js";import{t as H}from"./jsx-runtime-DN_bIXfG.js";import{t as M}from"./cn-C1rgT0yh.js";import{r as R}from"./requests-C0HaHO6a.js";import{n as V}from"./ImperativeModal-B7kKs9xL.js";var z=b();function I(){return y(_)}function J(){let r=(0,z.c)(5),[t]=O(G),e=j(_),{openAlert:a}=V(),{sendRename:o}=R(),s;return r[0]!==t.state||r[1]!==a||r[2]!==o||r[3]!==e?(s=async l=>{let n=U();return t.state===q.OPEN?(B(i=>{l===null?i.delete(C.filePath):i.set(C.filePath,l)}),o({filename:l}).then(()=>(e(l),document.title=n.app_title||T.basename(l)||"Untitled Notebook",l)).catch(i=>(a(i.message),null))):(a("Failed to save notebook: not connected to a kernel."),null)},r[0]=t.state,r[1]=a,r[2]=o,r[3]=e,r[4]=s):s=r[4],w(s)}var p=b(),v=P(H(),1);const k=r=>{let t=(0,p.c)(12),{className:e,cellId:a,variant:o,onClick:s,formatCellName:l,skipScroll:n}=r,i=A()[a]??"",x=S().inOrderIds.indexOf(a),{showCellIfHidden:d}=L(),g=l??W,c;t[0]===e?c=t[1]:(c=M("inline-block cursor-pointer text-link hover:underline",e),t[0]=e,t[1]=c);let m;t[2]!==a||t[3]!==s||t[4]!==d||t[5]!==n||t[6]!==o?(m=h=>{if(a==="__scratch__")return!1;d({cellId:a}),h.stopPropagation(),h.preventDefault(),requestAnimationFrame(()=>{N(a,o,n)&&(s==null||s())})},t[2]=a,t[3]=s,t[4]=d,t[5]=n,t[6]=o,t[7]=m):m=t[7];let f=g(D(i,x)),u;return t[8]!==c||t[9]!==m||t[10]!==f?(u=(0,v.jsx)("div",{className:c,role:"link",tabIndex:-1,onClick:m,children:f}),t[8]=c,t[9]=m,t[10]=f,t[11]=u):u=t[11],u},K=r=>{let t=(0,p.c)(2),e;return t[0]===r?e=t[1]:(e=(0,v.jsx)(k,{...r,variant:"destructive"}),t[0]=r,t[1]=e),e},Q=r=>{let t=(0,p.c)(10),{cellId:e,lineNumber:a}=r,o=I(),s;t[0]!==e||t[1]!==a?(s=()=>E(e,a),t[0]=e,t[1]=a,t[2]=s):s=t[2];let l;t[3]!==e||t[4]!==o?(l=i=>e==="__scratch__"?"scratch":`marimo://${o||"untitled"}#cell=${i}`,t[3]=e,t[4]=o,t[5]=l):l=t[5];let n;return t[6]!==e||t[7]!==s||t[8]!==l?(n=(0,v.jsx)(k,{cellId:e,onClick:s,skipScroll:!0,variant:"destructive",className:"traceback-cell-link",formatCellName:l}),t[6]=e,t[7]=s,t[8]=l,t[9]=n):n=t[9],n};function N(r,t,e){let a=$.create(r),o=document.getElementById(a);return o===null?(F.error(`Cell ${a} not found on page.`),!1):(e||o.scrollIntoView({behavior:"smooth",block:"center"}),t==="destructive"&&(o.classList.add("error-outline"),setTimeout(()=>{o.classList.remove("error-outline")},2e3)),t==="focus"&&(o.classList.add("focus-outline"),setTimeout(()=>{o.classList.remove("focus-outline")},2e3)),!0)}function W(r){return r}export{I as a,N as i,K as n,J as o,Q as r,k as t};
1
+ import{s as P}from"./chunk-LvLJmgfZ.js";import{d as j,l as O,n as w,u as y}from"./useEvent-DlWF5OMa.js";import{A,C as L,Gt as E,O as S,Pt as T,Ur as _,ei as $,pt as D}from"./cells-Bybxko6N.js";import{t as b}from"./compiler-runtime-DeeZ7FnK.js";import{d as F}from"./hotkeys-uKX61F1_.js";import{u as U}from"./utils-CJJIceVn.js";import{r as C}from"./constants-Bkp4R3bQ.js";import{j as q,p as B,w as G}from"./config-Ba3eeYri.js";import{t as H}from"./jsx-runtime-DN_bIXfG.js";import{t as M}from"./cn-C1rgT0yh.js";import{r as R}from"./requests-C0HaHO6a.js";import{n as V}from"./ImperativeModal-DVhvP4lH.js";var z=b();function I(){return y(_)}function J(){let r=(0,z.c)(5),[t]=O(G),e=j(_),{openAlert:a}=V(),{sendRename:o}=R(),s;return r[0]!==t.state||r[1]!==a||r[2]!==o||r[3]!==e?(s=async l=>{let n=U();return t.state===q.OPEN?(B(i=>{l===null?i.delete(C.filePath):i.set(C.filePath,l)}),o({filename:l}).then(()=>(e(l),document.title=n.app_title||T.basename(l)||"Untitled Notebook",l)).catch(i=>(a(i.message),null))):(a("Failed to save notebook: not connected to a kernel."),null)},r[0]=t.state,r[1]=a,r[2]=o,r[3]=e,r[4]=s):s=r[4],w(s)}var p=b(),v=P(H(),1);const k=r=>{let t=(0,p.c)(12),{className:e,cellId:a,variant:o,onClick:s,formatCellName:l,skipScroll:n}=r,i=A()[a]??"",x=S().inOrderIds.indexOf(a),{showCellIfHidden:d}=L(),g=l??W,c;t[0]===e?c=t[1]:(c=M("inline-block cursor-pointer text-link hover:underline",e),t[0]=e,t[1]=c);let m;t[2]!==a||t[3]!==s||t[4]!==d||t[5]!==n||t[6]!==o?(m=h=>{if(a==="__scratch__")return!1;d({cellId:a}),h.stopPropagation(),h.preventDefault(),requestAnimationFrame(()=>{N(a,o,n)&&(s==null||s())})},t[2]=a,t[3]=s,t[4]=d,t[5]=n,t[6]=o,t[7]=m):m=t[7];let f=g(D(i,x)),u;return t[8]!==c||t[9]!==m||t[10]!==f?(u=(0,v.jsx)("div",{className:c,role:"link",tabIndex:-1,onClick:m,children:f}),t[8]=c,t[9]=m,t[10]=f,t[11]=u):u=t[11],u},K=r=>{let t=(0,p.c)(2),e;return t[0]===r?e=t[1]:(e=(0,v.jsx)(k,{...r,variant:"destructive"}),t[0]=r,t[1]=e),e},Q=r=>{let t=(0,p.c)(10),{cellId:e,lineNumber:a}=r,o=I(),s;t[0]!==e||t[1]!==a?(s=()=>E(e,a),t[0]=e,t[1]=a,t[2]=s):s=t[2];let l;t[3]!==e||t[4]!==o?(l=i=>e==="__scratch__"?"scratch":`marimo://${o||"untitled"}#cell=${i}`,t[3]=e,t[4]=o,t[5]=l):l=t[5];let n;return t[6]!==e||t[7]!==s||t[8]!==l?(n=(0,v.jsx)(k,{cellId:e,onClick:s,skipScroll:!0,variant:"destructive",className:"traceback-cell-link",formatCellName:l}),t[6]=e,t[7]=s,t[8]=l,t[9]=n):n=t[9],n};function N(r,t,e){let a=$.create(r),o=document.getElementById(a);return o===null?(F.error(`Cell ${a} not found on page.`),!1):(e||o.scrollIntoView({behavior:"smooth",block:"center"}),t==="destructive"&&(o.classList.add("error-outline"),setTimeout(()=>{o.classList.remove("error-outline")},2e3)),t==="focus"&&(o.classList.add("focus-outline"),setTimeout(()=>{o.classList.remove("focus-outline")},2e3)),!0)}function W(r){return r}export{I as a,N as i,K as n,J as o,Q as r,k as t};