@marimo-team/frontend 0.18.5-dev168 → 0.18.5-dev169

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-C5QfWAQj.js → CellStatus-DlwC0A_k.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-B0tKPs5t.js → ConnectedDataExplorerComponent-C3aK452q.js} +1 -1
  3. package/dist/assets/{JsonOutput-NOfbbuUx.js → JsonOutput-C7Jn2Hoy.js} +9 -9
  4. package/dist/assets/{MarimoErrorOutput-usFICLUe.js → MarimoErrorOutput-Dtk0CQJu.js} +2 -2
  5. package/dist/assets/{RenderHTML-LxV1eecf.js → RenderHTML-DfrA7ZTv.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-CEKGThxQ.js → add-cell-with-ai-BYCrNUOQ.js} +12 -12
  7. package/dist/assets/{add-database-form-DQyrphh9.js → add-database-form-D-BVTDCT.js} +1 -1
  8. package/dist/assets/{agent-panel-CnTn12AW.js → agent-panel-CNIKszsQ.js} +6 -6
  9. package/dist/assets/{ai-model-dropdown-CxRols0L.js → ai-model-dropdown-CAhqhkRJ.js} +1 -1
  10. package/dist/assets/{app-config-button-DtMP2_j5.js → app-config-button-BhKhGiaG.js} +1 -1
  11. package/dist/assets/{cell-actions-DCZqhhwF.js → cell-actions-C8VD1BFf.js} +1 -1
  12. package/dist/assets/{cell-editor-DJ1tY3mU.js → cell-editor-bDu_ShRz.js} +7 -7
  13. package/dist/assets/cell-link-NwzNlJhp.js +1 -0
  14. package/dist/assets/{cells-DAR6V-0d.js → cells-xPjoZY0S.js} +46 -46
  15. package/dist/assets/{chat-components-CyY2c7cG.js → chat-components-CQFXyizy.js} +1 -1
  16. package/dist/assets/{chat-display-BgCCmGdz.js → chat-display-DqUXDG-o.js} +1 -1
  17. package/dist/assets/{chat-panel-ByuXM3gc.js → chat-panel-8iT2Wjh6.js} +2 -2
  18. package/dist/assets/client-Cbyg6uhC.js +4 -0
  19. package/dist/assets/{column-preview-DBqi4KCj.js → column-preview-BuNifqxS.js} +1 -1
  20. package/dist/assets/{command-BXWdrTY9.js → command-DIcQwElH.js} +1 -1
  21. package/dist/assets/command-palette-D_boTGwg.js +1 -0
  22. package/dist/assets/{common-D10A9aix.js → common-C6NCeVE8.js} +1 -1
  23. package/dist/assets/{config-D3ojpe3F.js → config-DWMmQmTt.js} +1 -1
  24. package/dist/assets/{datasource-CW2RMV2e.js → datasource-CyWtxjKq.js} +2 -2
  25. package/dist/assets/{dependency-graph-panel-CtlDdK0s.js → dependency-graph-panel-C01bMyQK.js} +3 -3
  26. package/dist/assets/{documentation-panel-Cup0ghBs.js → documentation-panel-BPUF-dp2.js} +1 -1
  27. package/dist/assets/{download-D3Uujsn_.js → download-B9UlWvRO.js} +1 -1
  28. package/dist/assets/edit-page-DFkV0LWx.js +13 -0
  29. package/dist/assets/{error-panel-DcRvXIwA.js → error-panel-ClGt4y8j.js} +1 -1
  30. package/dist/assets/{es-DCqUUmrq.js → es-1yDP0Xdp.js} +1 -1
  31. package/dist/assets/{file-explorer-panel-9Bt20tRi.js → file-explorer-panel-3SHWDl17.js} +1 -1
  32. package/dist/assets/{floating-outline-BTc4L5BF.js → floating-outline-C5wKHGsD.js} +1 -1
  33. package/dist/assets/{focus-6-St0ai2.js → focus-DPgrnlZ1.js} +1 -1
  34. package/dist/assets/{form-1WOcPtE8.js → form-B2Db87Zc.js} +2 -2
  35. package/dist/assets/{glide-data-editor-EdMWe-iv.js → glide-data-editor-CwVQm3Mn.js} +1 -1
  36. package/dist/assets/{globals-CJb4gcmW.js → globals-CC2GcyGk.js} +1 -1
  37. package/dist/assets/{home-page-Lqy9A89-.js → home-page-BdK-6xZH.js} +2 -2
  38. package/dist/assets/{index-CIoUDThG.js → index-CEHA_rtG.js} +9 -9
  39. package/dist/assets/index-G6ss-VDT.css +2 -0
  40. package/dist/assets/{kiosk-mode-C3lS9kUL.js → kiosk-mode-CsuyIDk3.js} +1 -1
  41. package/dist/assets/{layout-F63rlsGg.js → layout-DlHn_emH.js} +3 -3
  42. package/dist/assets/links-DR-r1Edb.js +1 -0
  43. package/dist/assets/{logs-panel-fnMYUf4-.js → logs-panel-BIW4BIAP.js} +1 -1
  44. package/dist/assets/{markdown-renderer-B9gYLzJX.js → markdown-renderer-B0tsGAgw.js} +1 -1
  45. package/dist/assets/{mermaid-BUMgiGGr.js → mermaid-BcA-uOhi.js} +1 -1
  46. package/dist/assets/{mode-D4GlAyEq.js → mode-Ii-fBazZ.js} +1 -1
  47. package/dist/assets/{name-cell-input-BMtblyo6.js → name-cell-input-03mNaWsC.js} +1 -1
  48. package/dist/assets/outline-panel-D2OKWKZx.js +1 -0
  49. package/dist/assets/{packages-panel-DyC7zUxG.js → packages-panel-CzdZ8dRE.js} +1 -1
  50. package/dist/assets/{panels-wYHy1fpG.js → panels-DTuGqWrW.js} +1 -1
  51. package/dist/assets/{process-output-D1GR6Ero.js → process-output-Dsqg6AQn.js} +1 -1
  52. package/dist/assets/{readonly-python-code-CGnOB_RP.js → readonly-python-code-CEN7uCAn.js} +1 -1
  53. package/dist/assets/{renderShortcut-CV_tqoEI.js → renderShortcut-DolwKyOI.js} +1 -1
  54. package/dist/assets/{run-page-BLnJcKtg.js → run-page-Bv4-nptx.js} +1 -1
  55. package/dist/assets/{scratchpad-panel-CTJDEy90.js → scratchpad-panel-CwWN2smX.js} +1 -1
  56. package/dist/assets/{session-panel-C3rDPyig.js → session-panel-C35Uxsn7.js} +1 -1
  57. package/dist/assets/{snippets-panel-s0p4CCoa.js → snippets-panel-VLyEWSgW.js} +1 -1
  58. package/dist/assets/{state-BK5o1KAL.js → state-CLVMeQ5K.js} +1 -1
  59. package/dist/assets/{state-DwSzcmzL.js → state-DfW1MJsR.js} +1 -1
  60. package/dist/assets/{switch-C8yab1pC.js → switch-DXLifdeN.js} +1 -1
  61. package/dist/assets/{terminal-CA6CqpuO.js → terminal-O_0qSqHX.js} +1 -1
  62. package/dist/assets/{textarea-DBFtOima.js → textarea-BibopRh1.js} +1 -1
  63. package/dist/assets/tracing-kd2E6r4-.js +1 -0
  64. package/dist/assets/{tracing-panel-C-o1Db4W.js → tracing-panel-CingJf_V.js} +2 -2
  65. package/dist/assets/{types-Bt3U-XJV.js → types-B_DyfI3j.js} +1 -1
  66. package/dist/assets/{useAddCell-CNI3pgez.js → useAddCell-CuNdAB3f.js} +1 -1
  67. package/dist/assets/{useBoolean-C_vQizET.js → useBoolean-DWRpatKF.js} +1 -1
  68. package/dist/assets/{useCellActionButton-BbfiHu5s.js → useCellActionButton-CLGSFvWy.js} +1 -1
  69. package/dist/assets/{useDeleteCell-B_jFiS1Y.js → useDeleteCell-DAgP4oYp.js} +1 -1
  70. package/dist/assets/{useNotebookActions-BeM5fet2.js → useNotebookActions-CLAi2J0h.js} +1 -1
  71. package/dist/assets/useRunCells-BHhExio0.js +1 -0
  72. package/dist/assets/{useSplitCell-COPg5dJw.js → useSplitCell-CF_E2d8x.js} +1 -1
  73. package/dist/assets/{useTheme-CuOCKnyR.js → useTheme-CrojuouA.js} +1 -1
  74. package/dist/assets/{utilities.esm-B7XtzwiJ.js → utilities.esm-lV-KjYEM.js} +2 -2
  75. package/dist/assets/{utils-Cxqw03y3.js → utils-B_xHF0y2.js} +1 -1
  76. package/dist/assets/{vega-component-arPQXQS8.js → vega-component-DTFVCfi1.js} +1 -1
  77. package/dist/index.html +37 -37
  78. package/package.json +1 -1
  79. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  80. package/src/components/editor/chrome/state.ts +30 -15
  81. package/src/components/editor/chrome/types.ts +67 -77
  82. package/src/components/editor/chrome/wrapper/app-chrome.tsx +148 -84
  83. package/src/components/editor/chrome/wrapper/sidebar.tsx +76 -43
  84. package/src/components/ui/reorderable-list.tsx +190 -31
  85. package/dist/assets/cell-link-DjST51KF.js +0 -1
  86. package/dist/assets/client-BQowSjqE.js +0 -4
  87. package/dist/assets/command-palette-CjFiCjws.js +0 -1
  88. package/dist/assets/edit-page-fJ4hHm67.js +0 -13
  89. package/dist/assets/index-D-BWugLn.css +0 -2
  90. package/dist/assets/links-ZVVAwqm7.js +0 -1
  91. package/dist/assets/outline-panel-Blq76m9b.js +0 -1
  92. package/dist/assets/tracing-VZVj-gEo.js +0 -1
  93. package/dist/assets/useRunCells-oeY0TrS1.js +0 -1
@@ -1,4 +1,4 @@
1
- var Ue=Object.defineProperty;var Ke=(t,e,s)=>e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ne=(t,e,s)=>Ke(t,typeof e!="symbol"?e+"":e,s);import{s as me}from"./chunk-LvLJmgfZ.js";import{t as We}from"./react-BGmjiNul.js";import{C as He,dt as Me,yn as h}from"./cells-DAR6V-0d.js";import{D as oe,P as p,R as d,T as v,_ as ue,i as Qe,k as m,m as Ge}from"./zod-Cg4WLWh2.js";import{t as be}from"./compiler-runtime-DeeZ7FnK.js";import{S as Ve}from"./_Uint8Array-BGESiCQL.js";import{r as re}from"./useLifecycle-BX7GmOQ5.js";import{r as ze,t as Je}from"./_baseEach-BH6a1vAB.js";import{d as Ye}from"./hotkeys-D3ICc8RW.js";import{t as Xe}from"./jsx-runtime-DN_bIXfG.js";import{t as ie}from"./button-C9TEIJJh.js";import{t as fe}from"./cn-C1rgT0yh.js";import{c as Ze,i as et,n as tt,r as st,s as nt,t as ot}from"./select-BJ18Dxpd.js";import{t as rt}from"./circle-plus-D1IRnTdM.js";import{a as ae,c as ge,o as it,p as at,r as ct,t as lt}from"./dropdown-menu-BP4_BZLr.js";import{n as dt}from"./DeferredRequestRegistry-B3BENoUa.js";import{o as ht,r as pt}from"./input-DP44ewsS.js";import{a as mt,c as ut,d as bt,g as ft,l as gt,o as yt,p as St,s as _t,u as wt}from"./textarea-DBFtOima.js";import{a as xt,c as $t,l as kt,n as Ct,r as At,t as jt}from"./dialog-DIUTtzeB.js";import{n as vt}from"./ImperativeModal-7Thr73Oo.js";import{t as Rt}from"./links-DNmjkr65.js";import{n as It}from"./useAsyncData-BJJJOr9W.js";import{o as Tt}from"./focus-6-St0ai2.js";import{o as Dt,t as qt,u as i}from"./form-1WOcPtE8.js";import{t as Lt}from"./request-registry-CAqj3mAX.js";import{n as Pt,t as Nt}from"./write-secret-modal-CIbhcoWF.js";function Ft(t,e,s,o){for(var n=-1,a=t==null?0:t.length;++n<a;){var c=t[n];e(o,c,s(c),t)}return o}var Et=Ft;function Bt(t,e,s,o){return Je(t,function(n,a,c){e(o,n,s(n),c)}),o}var Ot=Bt;function Ut(t,e){return function(s,o){var n=Ve(s)?Et:Ot,a=e?e():{};return n(s,t,ze(o,2),a)}}var Kt=Ut(function(t,e,s){t[s?0:1].push(e)},function(){return[[],[]]});function $(){return d().optional().describe(i.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function ce(t,e){let s=d();return s=e?s.nonempty():s.optional(),s=s.describe(i.of({label:t||"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"})),s}function G(){return d().optional().describe(i.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function le(t,e){let s=d();return s=e?s.nonempty():s.optional(),s.describe(i.of({label:t||"URI",optionRegex:".*uri.*"}))}function x(t){return d().nonempty().describe(i.of({label:t||"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function w(){return d().describe(i.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Wt(){return d().describe(i.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"}))}function k(){return d().nonempty().describe(i.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function C(t){let e=Qe().describe(i.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(s=>s>=0&&s<=65535,{message:"Port must be between 0 and 65535"});return t===void 0?e:e.default(t)}function ye(){return v().default(!1).describe(i.of({label:"Read Only"}))}const Se=p({type:m("postgres"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),_e=p({type:m("mysql"),host:x(),port:C(3306),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),we=p({type:m("sqlite"),database:w().describe(i.of({label:"Database Path"}))}).describe(i.of({direction:"two-columns"})),xe=p({type:m("duckdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),$e=p({type:m("motherduck"),database:w().default("my_db").describe(i.of({label:"Database Name"})),token:ce()}).describe(i.of({direction:"two-columns"})),ke=p({type:m("snowflake"),account:d().nonempty().describe(i.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:d().optional().describe(i.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:w(),schema:d().optional().describe(i.of({label:"Schema",optionRegex:".*snowflake.*"})),username:k(),password:$(),role:d().optional().describe(i.of({label:"Role"}))}).describe(i.of({direction:"two-columns"})),Ce=p({type:m("bigquery"),project:d().nonempty().describe(i.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:d().nonempty().describe(i.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:d().describe(i.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(i.of({direction:"two-columns"})),Ae=p({type:m("clickhouse_connect"),host:x(),port:C(8123).optional(),username:k(),password:$(),secure:v().default(!1).describe(i.of({label:"Use HTTPs"}))}).describe(i.of({direction:"two-columns"})),je=p({type:m("timeplus"),host:x().default("localhost"),port:C(8123).optional(),username:k().default("default"),password:$().default("")}).describe(i.of({direction:"two-columns"})),ve=p({type:m("chdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),Re=p({type:m("trino"),host:x(),port:C(8080),database:w(),schema:Wt().optional(),username:k(),password:$(),async_support:v().default(!1).describe(i.of({label:"Async Support"}))}).describe(i.of({direction:"two-columns"})),Ie=p({type:m("iceberg"),name:d().describe(i.of({label:"Catalog Name"})),catalog:oe("type",[p({type:m("REST"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:ce()}),p({type:m("SQL"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),p({type:m("Hive"),warehouse:G(),uri:le()}),p({type:m("Glue"),warehouse:G(),uri:le()}),p({type:m("DynamoDB"),"dynamodb.profile-name":d().optional().describe(i.of({label:"Profile Name"})),"dynamodb.region":d().optional().describe(i.of({label:"Region"})),"dynamodb.access-key-id":d().optional().describe(i.of({label:"Access Key ID"})),"dynamodb.secret-access-key":d().optional().describe(i.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":d().optional().describe(i.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST",token:void 0}).describe(i.of({special:"tabs"}))}),Te=p({type:m("datafusion"),sessionContext:v().optional().describe(i.of({label:"Use Session Context"}))}),De=p({type:m("pyspark"),host:x().optional(),port:C().optional()}),qe=p({type:m("redshift"),host:x(),port:C(5439),connectionType:oe("type",[p({type:m("IAM credentials"),region:d().describe(i.of({label:"Region"})),aws_access_key_id:d().nonempty().describe(i.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:d().nonempty().describe(i.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:d().optional().describe(i.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),p({type:m("DB credentials"),user:k(),password:$()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:w()}).describe(i.of({direction:"two-columns"})),Le=p({type:m("databricks"),access_token:ce("Access Token",!0),server_hostname:x("Server Hostname"),http_path:le("HTTP Path",!0),catalog:d().optional().describe(i.of({label:"Catalog"})),schema:d().optional().describe(i.of({label:"Schema"}))}).describe(i.of({direction:"two-columns"})),Pe=p({type:m("supabase"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),disable_client_pooling:v().default(!1).describe(i.of({label:"Disable Client-Side Pooling"}))}).describe(i.of({direction:"two-columns"})),Ht=oe("type",[Se,_e,we,xe,$e,ke,Ce,Ae,je,ve,Re,Ie,Te,De,qe,Le,Pe]);var de="env:";function tn(t){return t}function V(t){return typeof t=="string"?t.startsWith(de):!1}function he(t){return`${de}${t}`}function Mt(t){return t.replace(de,"")}const Ne={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var y=class{constructor(t,e,s){this.connection=t,this.orm=e,this.secrets=s}get imports(){let t=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":t.add("import sqlalchemy");break;case"sqlmodel":t.add("import sqlmodel");break;case"duckdb":t.add("import duckdb");break;case"ibis":t.add("import ibis");break}return t}},Qt=t=>`_${t}`,Gt=class{constructor(){ne(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=Qt(t),V(e)){let o=Mt(e),n=s?`os.environ.get("${o}", "${s}")`:`os.environ.get("${o}")`;return this.secrets[t]=n,t}if(s!=null){let o=`os.environ.get("${e}", "${s}")`;return this.secrets[t]=o,t}return typeof e=="number"||typeof e=="number"?`${e}`:typeof e=="boolean"?U(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return U(e);let o=this.print(t,e,s);return o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):`{${o}}`}printPassword(t,e,s,o){let n=s?this.printInFString.bind(this):this.print.bind(this);return V(t)?n(o||"password",t):n(o||"password",e,t)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([t,e])=>`${t} = ${e}`).join(`
1
+ var Ue=Object.defineProperty;var Ke=(t,e,s)=>e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ne=(t,e,s)=>Ke(t,typeof e!="symbol"?e+"":e,s);import{s as me}from"./chunk-LvLJmgfZ.js";import{t as We}from"./react-BGmjiNul.js";import{C as He,dt as Me,vn as h}from"./cells-xPjoZY0S.js";import{D as oe,P as p,R as d,T as v,_ as ue,i as Qe,k as m,m as Ge}from"./zod-Cg4WLWh2.js";import{t as be}from"./compiler-runtime-DeeZ7FnK.js";import{S as Ve}from"./_Uint8Array-BGESiCQL.js";import{r as re}from"./useLifecycle-BX7GmOQ5.js";import{r as ze,t as Je}from"./_baseEach-BH6a1vAB.js";import{d as Ye}from"./hotkeys-D3ICc8RW.js";import{t as Xe}from"./jsx-runtime-DN_bIXfG.js";import{t as ie}from"./button-C9TEIJJh.js";import{t as fe}from"./cn-C1rgT0yh.js";import{c as Ze,i as et,n as tt,r as st,s as nt,t as ot}from"./select-BJ18Dxpd.js";import{t as rt}from"./circle-plus-D1IRnTdM.js";import{a as ae,c as ge,o as it,p as at,r as ct,t as lt}from"./dropdown-menu-BP4_BZLr.js";import{n as dt}from"./DeferredRequestRegistry-B3BENoUa.js";import{o as ht,r as pt}from"./input-DP44ewsS.js";import{a as mt,c as ut,d as bt,g as ft,l as gt,o as yt,p as St,s as _t,u as wt}from"./textarea-BibopRh1.js";import{a as xt,c as $t,l as kt,n as Ct,r as At,t as jt}from"./dialog-DIUTtzeB.js";import{n as vt}from"./ImperativeModal-7Thr73Oo.js";import{t as Rt}from"./links-DNmjkr65.js";import{n as It}from"./useAsyncData-BJJJOr9W.js";import{o as Tt}from"./focus-DPgrnlZ1.js";import{o as Dt,t as qt,u as i}from"./form-B2Db87Zc.js";import{t as Lt}from"./request-registry-CAqj3mAX.js";import{n as Pt,t as Nt}from"./write-secret-modal-CIbhcoWF.js";function Ft(t,e,s,o){for(var n=-1,a=t==null?0:t.length;++n<a;){var c=t[n];e(o,c,s(c),t)}return o}var Et=Ft;function Bt(t,e,s,o){return Je(t,function(n,a,c){e(o,n,s(n),c)}),o}var Ot=Bt;function Ut(t,e){return function(s,o){var n=Ve(s)?Et:Ot,a=e?e():{};return n(s,t,ze(o,2),a)}}var Kt=Ut(function(t,e,s){t[s?0:1].push(e)},function(){return[[],[]]});function $(){return d().optional().describe(i.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function ce(t,e){let s=d();return s=e?s.nonempty():s.optional(),s=s.describe(i.of({label:t||"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"})),s}function G(){return d().optional().describe(i.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function le(t,e){let s=d();return s=e?s.nonempty():s.optional(),s.describe(i.of({label:t||"URI",optionRegex:".*uri.*"}))}function x(t){return d().nonempty().describe(i.of({label:t||"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function w(){return d().describe(i.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Wt(){return d().describe(i.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"}))}function k(){return d().nonempty().describe(i.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function C(t){let e=Qe().describe(i.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(s=>s>=0&&s<=65535,{message:"Port must be between 0 and 65535"});return t===void 0?e:e.default(t)}function ye(){return v().default(!1).describe(i.of({label:"Read Only"}))}const Se=p({type:m("postgres"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),_e=p({type:m("mysql"),host:x(),port:C(3306),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),we=p({type:m("sqlite"),database:w().describe(i.of({label:"Database Path"}))}).describe(i.of({direction:"two-columns"})),xe=p({type:m("duckdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),$e=p({type:m("motherduck"),database:w().default("my_db").describe(i.of({label:"Database Name"})),token:ce()}).describe(i.of({direction:"two-columns"})),ke=p({type:m("snowflake"),account:d().nonempty().describe(i.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:d().optional().describe(i.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:w(),schema:d().optional().describe(i.of({label:"Schema",optionRegex:".*snowflake.*"})),username:k(),password:$(),role:d().optional().describe(i.of({label:"Role"}))}).describe(i.of({direction:"two-columns"})),Ce=p({type:m("bigquery"),project:d().nonempty().describe(i.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:d().nonempty().describe(i.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:d().describe(i.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(i.of({direction:"two-columns"})),Ae=p({type:m("clickhouse_connect"),host:x(),port:C(8123).optional(),username:k(),password:$(),secure:v().default(!1).describe(i.of({label:"Use HTTPs"}))}).describe(i.of({direction:"two-columns"})),je=p({type:m("timeplus"),host:x().default("localhost"),port:C(8123).optional(),username:k().default("default"),password:$().default("")}).describe(i.of({direction:"two-columns"})),ve=p({type:m("chdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),Re=p({type:m("trino"),host:x(),port:C(8080),database:w(),schema:Wt().optional(),username:k(),password:$(),async_support:v().default(!1).describe(i.of({label:"Async Support"}))}).describe(i.of({direction:"two-columns"})),Ie=p({type:m("iceberg"),name:d().describe(i.of({label:"Catalog Name"})),catalog:oe("type",[p({type:m("REST"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:ce()}),p({type:m("SQL"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),p({type:m("Hive"),warehouse:G(),uri:le()}),p({type:m("Glue"),warehouse:G(),uri:le()}),p({type:m("DynamoDB"),"dynamodb.profile-name":d().optional().describe(i.of({label:"Profile Name"})),"dynamodb.region":d().optional().describe(i.of({label:"Region"})),"dynamodb.access-key-id":d().optional().describe(i.of({label:"Access Key ID"})),"dynamodb.secret-access-key":d().optional().describe(i.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":d().optional().describe(i.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST",token:void 0}).describe(i.of({special:"tabs"}))}),Te=p({type:m("datafusion"),sessionContext:v().optional().describe(i.of({label:"Use Session Context"}))}),De=p({type:m("pyspark"),host:x().optional(),port:C().optional()}),qe=p({type:m("redshift"),host:x(),port:C(5439),connectionType:oe("type",[p({type:m("IAM credentials"),region:d().describe(i.of({label:"Region"})),aws_access_key_id:d().nonempty().describe(i.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:d().nonempty().describe(i.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:d().optional().describe(i.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),p({type:m("DB credentials"),user:k(),password:$()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:w()}).describe(i.of({direction:"two-columns"})),Le=p({type:m("databricks"),access_token:ce("Access Token",!0),server_hostname:x("Server Hostname"),http_path:le("HTTP Path",!0),catalog:d().optional().describe(i.of({label:"Catalog"})),schema:d().optional().describe(i.of({label:"Schema"}))}).describe(i.of({direction:"two-columns"})),Pe=p({type:m("supabase"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),disable_client_pooling:v().default(!1).describe(i.of({label:"Disable Client-Side Pooling"}))}).describe(i.of({direction:"two-columns"})),Ht=oe("type",[Se,_e,we,xe,$e,ke,Ce,Ae,je,ve,Re,Ie,Te,De,qe,Le,Pe]);var de="env:";function tn(t){return t}function V(t){return typeof t=="string"?t.startsWith(de):!1}function he(t){return`${de}${t}`}function Mt(t){return t.replace(de,"")}const Ne={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var y=class{constructor(t,e,s){this.connection=t,this.orm=e,this.secrets=s}get imports(){let t=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":t.add("import sqlalchemy");break;case"sqlmodel":t.add("import sqlmodel");break;case"duckdb":t.add("import duckdb");break;case"ibis":t.add("import ibis");break}return t}},Qt=t=>`_${t}`,Gt=class{constructor(){ne(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=Qt(t),V(e)){let o=Mt(e),n=s?`os.environ.get("${o}", "${s}")`:`os.environ.get("${o}")`;return this.secrets[t]=n,t}if(s!=null){let o=`os.environ.get("${e}", "${s}")`;return this.secrets[t]=o,t}return typeof e=="number"||typeof e=="number"?`${e}`:typeof e=="boolean"?U(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return U(e);let o=this.print(t,e,s);return o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):`{${o}}`}printPassword(t,e,s,o){let n=s?this.printInFString.bind(this):this.print.bind(this);return V(t)?n(o||"password",t):n(o||"password",e,t)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([t,e])=>`${t} = ${e}`).join(`
2
2
  `)}},Vt=class extends y{generateImports(){return[]}generateConnectionCode(){let t=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",e=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0);return h(`
3
3
  DATABASE_URL = f"postgresql://${this.secrets.printInFString("username",this.connection.username)}:${e}@${this.secrets.printInFString("host",this.connection.host)}:${this.secrets.printInFString("port",this.connection.port)}/${this.secrets.printInFString("database",this.connection.database)}"
4
4
  engine = ${this.orm}.create_engine(DATABASE_URL${t})