@trilogy-data/trilogy-studio-components 0.1.25 → 0.1.27

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 (200) hide show
  1. package/dist/AssetAutoImporter-OHphsfW9.js +403 -0
  2. package/dist/ChatCreatorModal-CuXha6Dg.js +218 -0
  3. package/dist/ChatModelSelect-Cz7axWjP.js +40 -0
  4. package/dist/{CodeBlock-PT4no49I.js → CodeBlock-BBsaC6hX.js} +4 -4
  5. package/dist/{CommunityModels-D7zWnHgG.js → CommunityModels-CIQQhO-y.js} +106 -75
  6. package/dist/{ConnectionErrorPopup-FSs7U-Yl.js → ConnectionErrorPopup-7vpqgF0s.js} +1 -1
  7. package/dist/{ConnectionView-COnTTuA4.js → ConnectionView-7Jj_Ggdi.js} +49 -49
  8. package/dist/{CreateEditorFromDatasourcePopup-snOh1d5h.js → CreateEditorFromDatasourcePopup-CrVHUWFl.js} +4 -4
  9. package/dist/{Dashboard-D1ZCTw5r.js → Dashboard-DxSi9W6Q.js} +276 -280
  10. package/dist/{DashboardImportSelector-CNxibXlS.js → DashboardImportSelector-kuDRDYi8.js} +2 -2
  11. package/dist/{DashboardMobile-D_m0xv17.js → DashboardMobile-CZEgTb0R.js} +39 -39
  12. package/dist/{DrilldownPane-CBs5ZojS.js → DrilldownPane-BheRHJMs.js} +5 -7
  13. package/dist/{Editor-DhsP18KE.js → Editor-D6tdutTm.js} +106 -104
  14. package/dist/{ErrorMessage-XMn_08gJ.js → ErrorMessage-D5JeF3Iz.js} +4 -4
  15. package/dist/{GlobalChatPanel-DFx9A4yP.js → GlobalChatPanel-BXZh0sdD.js} +169 -134
  16. package/dist/{IDE-BRMLxTfP.js → IDE-T8PmyAQ_.js} +200 -203
  17. package/dist/{JobsView-C9PYS6pZ.js → JobsView-Ca97MiSd.js} +12 -13
  18. package/dist/{LLMChat-Cqg6pTgC.js → LLMChat-Cch33Yd_.js} +3 -3
  19. package/dist/{LLMView-VkJpP-49.js → LLMView-BDb6wD74.js} +26 -26
  20. package/dist/{LoadingView-s1uznGwG.js → LoadingView-B-xFwd2N.js} +2 -2
  21. package/dist/{MarkdownRenderer-BNDuEyG-.js → MarkdownRenderer-BWvdx0k3.js} +531 -430
  22. package/dist/MobileIDE-DpdEQEqc.js +783 -0
  23. package/dist/{ModelCard-D8tKkK9-.js → ModelCard-DkAMP4X9.js} +19 -20
  24. package/dist/{ModelView-rAurf9n8.js → ModelView-DomyhN8g.js} +7 -7
  25. package/dist/PageLoading-BAvKGo9h.js +5937 -0
  26. package/dist/{ResultComponent-_-1qZCfv.js → ResultComponent-zoOSoRLe.js} +8 -8
  27. package/dist/{Results-CQGpFmPQ.js → Results-dq-SlJbU.js} +17 -19
  28. package/dist/{StatusIcon-BylPx2EO.js → StatusIcon-AbxNvJ6p.js} +2 -2
  29. package/dist/{StoreTokenModal-zCSYhfrw.js → StoreTokenModal-CM8WXdu1.js} +2 -2
  30. package/dist/{SymbolsPane-BpmL___H.js → SymbolsPane-DfaxeaPS.js} +6 -3
  31. package/dist/{TrilogyEmbedProvider-WA_dlv9e.js → TrilogyEmbedProvider-D3h0gYnX.js} +9 -9
  32. package/dist/{TutorialPage-CZGBRJdq.js → TutorialPage-BtEJG7cT.js} +27 -28
  33. package/dist/{VegaLiteChart-CmkOw6yD.js → VegaLiteChart-BVyAab-o.js} +12191 -10975
  34. package/dist/{WelcomePage-CLKvAvk-.js → WelcomePage-BoqzYBLr.js} +5 -5
  35. package/dist/{embedTheme-Bub46ILG.js → _plugin-vue_export-helper-f9Rw-Il4.js} +14 -6
  36. package/dist/assets/{css.worker-9aDGcEUy.js → css.worker-niORQtzO.js} +14 -14
  37. package/dist/assets/{html.worker-D2LKDpnG.js → html.worker-CO5LvJpF.js} +17 -17
  38. package/dist/assets/json.worker-BezHzWUV.js +58 -0
  39. package/dist/assets/{ts.worker-Bz0-EaKK.js → ts.worker-CYhxGg0r.js} +107 -107
  40. package/dist/{results-DTgAKr5j.js → base-DuKnVD-A.js} +216 -45
  41. package/dist/components/AssetAutoImporter.vue.d.ts.map +1 -1
  42. package/dist/components/FeedbackBanner.vue.d.ts +4 -0
  43. package/dist/components/FeedbackBanner.vue.d.ts.map +1 -0
  44. package/dist/components/TipsCTA.vue.d.ts +1 -1
  45. package/dist/components/VegaLiteChart.vue.d.ts.map +1 -1
  46. package/dist/components/chartHelpers.d.ts +9 -1
  47. package/dist/components/chartHelpers.d.ts.map +1 -1
  48. package/dist/components/chartRenderManager.d.ts +4 -1
  49. package/dist/components/chartRenderManager.d.ts.map +1 -1
  50. package/dist/components/community/AddStoreModal.vue.d.ts +1 -1
  51. package/dist/components/community/AddStoreModal.vue.d.ts.map +1 -1
  52. package/dist/components/community/CommunityModelCard.vue.d.ts.map +1 -1
  53. package/dist/components/dashboard/DashboardCreatorIcon.vue.d.ts +54 -0
  54. package/dist/components/dashboard/DashboardCreatorIcon.vue.d.ts.map +1 -0
  55. package/dist/components/dashboard/DashboardProvenance.vue.d.ts +30 -0
  56. package/dist/components/dashboard/DashboardProvenance.vue.d.ts.map +1 -0
  57. package/dist/components/dashboard/ReportLayout.vue.d.ts +19 -0
  58. package/dist/components/dashboard/ReportLayout.vue.d.ts.map +1 -0
  59. package/dist/components/editor/Editor.vue.d.ts +3 -3
  60. package/dist/components/editor/Editor.vue.d.ts.map +1 -1
  61. package/dist/components/editor/EditorCreatorIcon.vue.d.ts +62 -0
  62. package/dist/components/editor/EditorCreatorIcon.vue.d.ts.map +1 -0
  63. package/dist/components/editor/ValidationComponent.vue.d.ts +50 -0
  64. package/dist/components/editor/ValidationComponent.vue.d.ts.map +1 -0
  65. package/dist/components/jobs/JobsAddStoreModal.vue.d.ts.map +1 -1
  66. package/dist/components/llm/ChatCreatorModal.vue.d.ts +17 -1
  67. package/dist/components/llm/ChatCreatorModal.vue.d.ts.map +1 -1
  68. package/dist/components/llm/ChatModelSelect.vue.d.ts +13 -0
  69. package/dist/components/llm/ChatModelSelect.vue.d.ts.map +1 -0
  70. package/dist/components/llm/GlobalChatPanel.vue.d.ts.map +1 -1
  71. package/dist/components/model/ModelCard.vue.d.ts +3 -3
  72. package/dist/components/sidebar/CommunityModelList.vue.d.ts +33 -50
  73. package/dist/components/sidebar/CommunityModelList.vue.d.ts.map +1 -1
  74. package/dist/components/sidebar/CommunityModelListItem.vue.d.ts.map +1 -1
  75. package/dist/components/sidebar/EditorList.vue.d.ts +32 -49
  76. package/dist/components/sidebar/EditorList.vue.d.ts.map +1 -1
  77. package/dist/components/sidebar/LLMConnectionList.vue.d.ts.map +1 -1
  78. package/dist/components/sidebar/Sidebar.vue.d.ts +65 -99
  79. package/dist/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  80. package/dist/components/tutorial/TutorialPrompt.vue.d.ts +3 -3
  81. package/dist/components/tutorial/TutorialPrompt.vue.d.ts.map +1 -1
  82. package/dist/{remoteWorker-Dkv3TJ0j.js → connections-CWH3zwH2.js} +4544 -4126
  83. package/dist/connections.js +3 -4
  84. package/dist/{cssMode-D4Rzr1Cu.js → cssMode-zpO2ap2B.js} +5 -6
  85. package/dist/dashboard.js +54 -57
  86. package/dist/dashboards/layerSpec.d.ts +38 -4
  87. package/dist/dashboards/layerSpec.d.ts.map +1 -1
  88. package/dist/dashboards/lineAreaSpec.d.ts +8 -80
  89. package/dist/dashboards/lineAreaSpec.d.ts.map +1 -1
  90. package/dist/dashboards/mapSpec.d.ts +1 -0
  91. package/dist/dashboards/mapSpec.d.ts.map +1 -1
  92. package/dist/dashboards/spec.d.ts.map +1 -1
  93. package/dist/data/tutorial/documentation.d.ts.map +1 -1
  94. package/dist/data/tutorial/startupScripts.d.ts +3 -0
  95. package/dist/data/tutorial/startupScripts.d.ts.map +1 -0
  96. package/dist/{dist-CXoL8kXK.js → dist-1z5KURzS.js} +55 -50
  97. package/dist/{dist-DKkuvbPb.js → dist-Bv3D2p5A.js} +20 -18
  98. package/dist/{editor.main-Cl8i7rHY.js → editor.main-BQh6DxDB.js} +33 -33
  99. package/dist/{editorRefinementRuntime-C_YmXRy4.js → editorStore-CAlMJftt.js} +2084 -946
  100. package/dist/embed.js +2 -2
  101. package/dist/entry.dashboard.d.ts +1 -0
  102. package/dist/entry.dashboard.d.ts.map +1 -1
  103. package/dist/{freemarker2-fW5NBILf.js → freemarker2-DQBqlEXc.js} +1 -1
  104. package/dist/{globalChatRuntime-oMLiPLNC.js → globalChatRuntime-CyS7vH51.js} +18 -18
  105. package/dist/{handlebars-dG4w8UUY.js → handlebars-tgYxaM70.js} +1 -1
  106. package/dist/{helpers-DcWCa6bX.js → helpers-BbVlA3Pf.js} +39 -39
  107. package/dist/{html-1Dq70BdU.js → html-jJahD3Mi.js} +1 -1
  108. package/dist/{htmlMode--IQmLBeh.js → htmlMode-BA1-8l2e.js} +5 -6
  109. package/dist/{javascript-CTzBM4sF.js → javascript-Cypfo7va.js} +1 -1
  110. package/dist/{jsonMode-DzeJjIEH.js → jsonMode-xJye8PWS.js} +25 -25
  111. package/dist/{liquid-DlHThiki.js → liquid-BGDrv5da.js} +1 -1
  112. package/dist/llm/data/constants.d.ts +1 -1
  113. package/dist/llm/data/constants.d.ts.map +1 -1
  114. package/dist/llm/data/trilogySyntax.generated.d.ts +7 -1
  115. package/dist/llm/data/trilogySyntax.generated.d.ts.map +1 -1
  116. package/dist/llm/docsIndex.d.ts.map +1 -1
  117. package/dist/llm/openai.d.ts +2 -1
  118. package/dist/llm/openai.d.ts.map +1 -1
  119. package/dist/llm-ClU-2rgk.js +18493 -0
  120. package/dist/llm.js +2 -3
  121. package/dist/{localStorage-CSuYS7QE.js → localStorage-CGQ1iJXt.js} +39 -42
  122. package/dist/{lspLanguageFeatures-Cdfs3EKq.js → lspLanguageFeatures-V3e_p9oN.js} +32 -32
  123. package/dist/{mdx-fn3g4PH5.js → mdx-BUR1aImW.js} +1 -1
  124. package/dist/models/helpers.d.ts.map +1 -1
  125. package/dist/monaco.js +3 -3
  126. package/dist/{python-CCVj0pFt.js → python-YLkl0pc6.js} +1 -1
  127. package/dist/{razor-Cj3flYnk.js → razor-BP8TRMDY.js} +1 -1
  128. package/dist/{reconcile-Bk7M797_.js → reconcile-DXIvGwBk.js} +1 -1
  129. package/dist/{remoteStoreSync-CLvZJrTK.js → remoteStoreSync-CuQBWpWf.js} +3 -3
  130. package/dist/remotes/displayHelpers.d.ts.map +1 -1
  131. package/dist/remotes/genericStoreMetadata.d.ts +1 -0
  132. package/dist/remotes/genericStoreMetadata.d.ts.map +1 -1
  133. package/dist/remotes/models.d.ts +37 -5
  134. package/dist/remotes/models.d.ts.map +1 -1
  135. package/dist/remotes/staticStorePresets.d.ts +22 -0
  136. package/dist/remotes/staticStorePresets.d.ts.map +1 -0
  137. package/dist/remotes/storeService.d.ts +25 -4
  138. package/dist/remotes/storeService.d.ts.map +1 -1
  139. package/dist/{rolldown-runtime-Dqa2HsxW.js → rolldown-runtime-B0aSnxlc.js} +2 -2
  140. package/dist/static/test_import.vue.d.ts +4 -0
  141. package/dist/static/test_import.vue.d.ts.map +1 -0
  142. package/dist/stores/communityApiStore.d.ts +32 -60
  143. package/dist/stores/communityApiStore.d.ts.map +1 -1
  144. package/dist/stores/connectionStore.d.ts.map +1 -1
  145. package/dist/stores/resolver.d.ts +5 -0
  146. package/dist/stores/resolver.d.ts.map +1 -1
  147. package/dist/stores/urlStore.d.ts +1 -0
  148. package/dist/stores/urlStore.d.ts.map +1 -1
  149. package/dist/stores-LlyiwSbK.js +2604 -0
  150. package/dist/stores.js +4 -7
  151. package/dist/trilogy-studio-components.css +1 -1
  152. package/dist/{tsMode-GI4xMYAl.js → tsMode-BH9HS_sH.js} +64 -66
  153. package/dist/{typescript-CPibXi3J.js → typescript-BM-ynfk9.js} +1 -1
  154. package/dist/{useChatWithTools-GV1ufcqw.js → useChatWithTools-m3Jn_SV-.js} +11 -11
  155. package/dist/{useDashboard-OoBKkkuQ.js → useDashboard-BOAuvVEw.js} +1013 -1021
  156. package/dist/{tabulator_esm-CxLvGDp8.js → useGlobalChatPanel-DuP1q7_f.js} +1729 -711
  157. package/dist/{useResizableDialog-B0ePSts4.js → useResizableDialog-Cs90WJdF.js} +2 -2
  158. package/dist/views/MobileIDE.vue.d.ts.map +1 -1
  159. package/dist/views/ModelView.vue.d.ts +6 -6
  160. package/dist/views/ModelView.vue.d.ts.map +1 -1
  161. package/dist/views/TutorialPage.vue.d.ts +41 -58
  162. package/dist/views/TutorialPage.vue.d.ts.map +1 -1
  163. package/dist/views.js +193 -195
  164. package/dist/{editor.api2-ClD5pp8H.js → workers-B9Eybl-M.js} +16252 -15926
  165. package/dist/{xml-BNyphceI.js → xml-M5WFPSpA.js} +1 -1
  166. package/dist/{yaml-DE5Vz0PH.js → yaml-CEeFwjz9.js} +1 -1
  167. package/package.json +29 -20
  168. package/dist/AssetAutoImporter-DfMd_DSk.js +0 -403
  169. package/dist/ChatCreatorModal-BTqY06B6.js +0 -177
  170. package/dist/DashboardCreatorInline-LWvf--2x.js +0 -129
  171. package/dist/DataTable-DoRDynP1.js +0 -365
  172. package/dist/EditorCreatorInline-D6_y1H_h.js +0 -125
  173. package/dist/LoadingButton-OH3frQuO.js +0 -138
  174. package/dist/MobileIDE-CHGJoh05.js +0 -781
  175. package/dist/ModalDialog-D1EOG4rl.js +0 -42
  176. package/dist/ModelCreator-DrxLxeyH.js +0 -253
  177. package/dist/PageLoading-I6mr-7NB.js +0 -2666
  178. package/dist/Tooltip-Dihir4zs.js +0 -103
  179. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +0 -8
  180. package/dist/assets/json.worker-CJ5MmO5Q.js +0 -58
  181. package/dist/base-C8IuZWqY.js +0 -164
  182. package/dist/connectionHistoryStorage-DKJHiKJY.js +0 -111
  183. package/dist/connectionHistoryStore-DQeBvStZ.js +0 -61
  184. package/dist/connections-CJSb1TZl.js +0 -229
  185. package/dist/constants-DgFEYN2b.js +0 -7
  186. package/dist/dashboardStore-CNkWQ4r7.js +0 -641
  187. package/dist/demoSetup-DiW3ROFQ.js +0 -2941
  188. package/dist/editorRefinementToolExecutor-mX8ClQ63.js +0 -4498
  189. package/dist/editorStore-Ch7k-gse.js +0 -972
  190. package/dist/formatting-BbJ5ICgh.js +0 -6
  191. package/dist/llm-_807I79k.js +0 -11965
  192. package/dist/llmStore-CSzM1IZd.js +0 -153
  193. package/dist/monaco.contribution-ikesdolO.js +0 -128
  194. package/dist/stores-C1wUWiFm.js +0 -1708
  195. package/dist/trilogy-BroD2Qmp.js +0 -4
  196. package/dist/urlStore-Dgmwx1YI.js +0 -54
  197. package/dist/useGlobalChatPanel-CIeUyZba.js +0 -85
  198. package/dist/useIsMobile-CNpUQAvk.js +0 -8
  199. package/dist/usePrismHighlight-DVyDiDAL.js +0 -183
  200. package/dist/workers-Br7ThUKL.js +0 -47
@@ -0,0 +1,403 @@
1
+ import { n as e } from "./rolldown-runtime-B0aSnxlc.js";
2
+ import { t } from "./_plugin-vue_export-helper-f9Rw-Il4.js";
3
+ import { a as n, l as r, o as i, s as a } from "./stores-LlyiwSbK.js";
4
+ import { A as ee, M as te, T as o, j as s, x as c } from "./editorStore-CAlMJftt.js";
5
+ import { c as l } from "./useGlobalChatPanel-DuP1q7_f.js";
6
+ import { t as u } from "./helpers-BbVlA3Pf.js";
7
+ import { n as d, r as f } from "./remoteStoreSync-CuQBWpWf.js";
8
+ import { Fragment as p, computed as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as v, createVNode as ne, defineComponent as re, inject as y, normalizeClass as b, onBeforeUnmount as ie, onMounted as ae, openBlock as x, ref as S, toDisplayString as C, unref as oe, vModelText as w, withDirectives as T } from "vue";
9
+ //#region components/AssetAutoImporter.vue?vue&type=script&setup=true&lang.ts
10
+ var se = { class: "auto-import-container" }, ce = {
11
+ key: 0,
12
+ class: "import-panel import-state error-state",
13
+ role: "alert"
14
+ }, le = { class: "import-headline" }, ue = { class: "error-message" }, de = {
15
+ key: 1,
16
+ class: "import-panel import-state loading-state",
17
+ role: "status"
18
+ }, fe = { class: "loading-content" }, pe = ["src"], me = { class: "import-headline" }, he = { class: "step-indicator" }, ge = { class: "step-icon" }, _e = { key: 0 }, ve = { key: 1 }, ye = { class: "step-icon" }, be = { key: 0 }, xe = { key: 1 }, Se = { key: 2 }, Ce = { class: "step-icon" }, we = { key: 0 }, Te = { key: 1 }, Ee = { key: 2 }, De = { class: "step-icon" }, Oe = { key: 0 }, ke = { key: 1 }, Ae = { key: 2 }, je = { class: "step-text" }, Me = {
19
+ key: 2,
20
+ class: "import-panel import-form"
21
+ }, Ne = { class: "import-header" }, Pe = { class: "import-headline" }, Fe = { class: "import-details" }, Ie = {
22
+ key: 0,
23
+ class: "import-source"
24
+ }, Le = { class: "import-source" }, Re = { class: "connection-setup" }, ze = { class: "setup-description" }, Be = {
25
+ key: 0,
26
+ class: "form-group"
27
+ }, Ve = {
28
+ key: 1,
29
+ class: "form-group"
30
+ }, He = { class: "form-group" }, Ue = { class: "form-group" }, We = { class: "form-group" }, Ge = { class: "form-actions" }, Ke = ["disabled"], qe = 1500, E = /*@__PURE__*/ re({
31
+ __name: "AssetAutoImporter",
32
+ emits: ["importComplete", "fullScreen"],
33
+ setup(e, { emit: t }) {
34
+ let re = t, E = y("dashboardStore"), D = y("connectionStore"), O = y("editorStore"), k = y("modelStore"), A = y("communityApiStore"), Je = y("queryExecutionService"), Ye = y("saveDashboards"), Xe = y("saveAll"), Ze = y("storageSources", []), j = n(), Qe = m(() => Ze.find((e) => e.type === "remote"));
35
+ if (!E || !D || !O || !k || !Ye || !Je || !Xe) throw Error("Required stores not provided");
36
+ let M = S(!0), N = S(""), P = S(""), $e = S(""), et = S("generic"), F = S(""), I = S(!1), L = S(""), R = S("dashboard"), z = S(""), B = S(""), V = S(null), H = S(!1), tt = S(""), U = S(!1), W = S("importing"), G = S(Date.now()), K = S(Date.now()), nt = S("0 ms"), q = null, J = S({
37
+ mdToken: "",
38
+ projectId: "",
39
+ username: "",
40
+ password: "",
41
+ account: "",
42
+ sshPrivateKey: ""
43
+ }), Y = S(!0), rt = {
44
+ duckdb: {
45
+ fields: [],
46
+ autoImport: !0
47
+ },
48
+ motherduck: {
49
+ fields: ["mdToken"],
50
+ autoImport: !1
51
+ },
52
+ bigquery: {
53
+ fields: ["projectId"],
54
+ autoImport: !1
55
+ },
56
+ snowflake: {
57
+ fields: [
58
+ "username",
59
+ "account",
60
+ "sshPrivateKey"
61
+ ],
62
+ autoImport: !1
63
+ }
64
+ }, it = m(() => {
65
+ if (I.value) return !1;
66
+ let e = rt[B.value];
67
+ return !e || !e.autoImport;
68
+ }), at = m(() => {
69
+ let e = rt[B.value];
70
+ return e ? e.fields : [];
71
+ }), ot = m(() => {
72
+ let e = c.find((e) => e.value === B.value);
73
+ return e ? e.label : B.value;
74
+ }), X = m(() => {
75
+ switch (R.value) {
76
+ case "dashboard": return "Dashboard";
77
+ case "editor":
78
+ case "trilogy": return "Editor";
79
+ default: return "Asset";
80
+ }
81
+ }), st = m(() => `A model named "${z.value}" already exists. Overwriting will replace its imported sources. Continue?`), ct = m(() => {
82
+ switch (R.value) {
83
+ case "dashboard": return "Setting up your dashboard...";
84
+ case "editor":
85
+ case "trilogy": return "Setting up your editor...";
86
+ default: return "Setting up your asset...";
87
+ }
88
+ }), lt = (e) => 100, Z = () => {
89
+ Q();
90
+ let e = Date.now() - K.value;
91
+ if (e < 1e3) nt.value = `${e} ms`;
92
+ else if (e < 6e4) {
93
+ let t = (e / 1e3).toFixed(1);
94
+ nt.value = `${t} sec`;
95
+ } else {
96
+ let t = Math.floor(e / 6e4), n = (e % 6e4 / 1e3).toFixed(1);
97
+ nt.value = n === "0.0" ? `${t} min` : `${t} min ${n} sec`;
98
+ }
99
+ if (!V.value && (M.value || H.value)) {
100
+ let t = lt(e);
101
+ q = setTimeout(Z, t);
102
+ }
103
+ }, Q = () => {
104
+ q &&= (clearTimeout(q), null);
105
+ }, ut = async (e) => {
106
+ let t = Date.now() - G.value, n = Math.max(0, qe - t);
107
+ n > 0 && W.value !== "registering" && W.value !== "importing" && await new Promise((e) => setTimeout(e, n)), W.value = e, G.value = Date.now();
108
+ };
109
+ function $() {
110
+ if (!B.value) {
111
+ Y.value = !1;
112
+ return;
113
+ }
114
+ let e = at.value;
115
+ for (let t of e) if (!J.value[t]) {
116
+ Y.value = !1;
117
+ return;
118
+ }
119
+ Y.value = !0;
120
+ }
121
+ let dt = (e) => $e.value || s(e), ft = async () => {
122
+ if (!P.value || !A) return;
123
+ let e = te(P.value), t = dt(e), n = A.stores.find((e) => e.id === t);
124
+ if (n) {
125
+ n.type === "generic" && (F.value && (n.token = F.value), I.value && z.value && (n.name = z.value)), console.log(`Store ${t} already registered`);
126
+ return;
127
+ }
128
+ let r = et.value === "static" ? {
129
+ ...o(e),
130
+ id: t
131
+ } : {
132
+ type: "generic",
133
+ id: t,
134
+ name: I.value && z.value ? z.value : `Auto-registered: ${e}`,
135
+ baseUrl: e,
136
+ token: F.value || void 0
137
+ };
138
+ try {
139
+ await A.addStore(r), console.log(`Store ${t} registered successfully`);
140
+ } catch (e) {
141
+ console.warn(`Failed to register store ${t}:`, e);
142
+ }
143
+ }, pt = () => {
144
+ if (!P.value || !A) return null;
145
+ let e = te(P.value), t = dt(e), n = A.stores.find((e) => e.id === t);
146
+ return n?.type === "generic" ? n : null;
147
+ }, mt = () => {
148
+ U.value = !1, V.value = `Import cancelled. Existing model "${z.value}" was not overwritten.`, M.value = !1, Q();
149
+ }, ht = async () => {
150
+ U.value = !1, V.value = null, await yt();
151
+ }, gt = async () => {
152
+ if (!I.value && k.models[z.value]) {
153
+ M.value = !1, Q(), U.value = !0;
154
+ return;
155
+ }
156
+ await yt();
157
+ }, _t = async () => {
158
+ if (!Qe.value) throw Error("Remote storage is not available in this context.");
159
+ let e = pt();
160
+ if (!e) throw Error("Remote imports require a valid store URL that can be registered.");
161
+ await d(Qe.value, e.id, O, D, k);
162
+ let t = ee(e);
163
+ if (R.value === "dashboard") {
164
+ let e = Object.values(E.dashboards).find((e) => e.name === L.value && e.connection === t);
165
+ if (!e) throw Error(`Dashboard "${L.value}" is not part of the remote store. Remote stores don't serve dashboards — create one locally against this store's connection first.`);
166
+ return E.warmDashboardQueries(e.id, Je, O), {
167
+ foundAssetId: e.id,
168
+ connectionName: t
169
+ };
170
+ }
171
+ let n = `remote:${e.id}:`, r = Object.values(O.editors).filter((e) => e.id.startsWith(n) && e.connection === t), i = (e) => e.replace(/\.[^.]+$/, ""), a = r.find((e) => e.name === L.value || i(e.name) === L.value);
172
+ if (!a) {
173
+ let e = r.map((e) => e.name).join(", ");
174
+ throw Error(`Editor "${L.value}" was not found in the remote store, have ${e}`);
175
+ }
176
+ return {
177
+ foundAssetId: a.id,
178
+ connectionName: t
179
+ };
180
+ }, vt = async () => {
181
+ let e = `${z.value}-connection`, t = new u(O, k, E);
182
+ k.models[z.value] || k.newModelConfig(z.value, !0), D.connectionByName(e) || D.newConnection(e, B.value, {
183
+ mdToken: J.value.mdToken,
184
+ projectId: J.value.projectId,
185
+ username: J.value.username,
186
+ password: J.value.password,
187
+ account: J.value.account,
188
+ privateKey: J.value.sshPrivateKey,
189
+ model: z.value
190
+ });
191
+ let n = pt(), r = await t.importModel(z.value, N.value, e, {
192
+ token: F.value || void 0,
193
+ remote: !1,
194
+ remoteStoreId: n?.id || null,
195
+ remoteBaseUrl: n?.baseUrl || P.value || null
196
+ });
197
+ if (D.connectionByName(e)?.setModel(z.value), R.value === "dashboard") {
198
+ let t = r?.dashboards.get(L.value), n = t ? E.dashboards[t] : void 0;
199
+ if (!n) {
200
+ let t = Object.values(E.dashboards).filter((t) => t.connection === e && t.storage !== "remote").map((e) => e.name).join(", ");
201
+ throw Error(`Dashboard "${L.value}" was not found in the imported model, have ${t}`);
202
+ }
203
+ return E.warmDashboardQueries(n.id, Je, O), {
204
+ foundAssetId: n.id,
205
+ connectionName: e
206
+ };
207
+ }
208
+ let i = r?.trilogy.get(L.value) || r?.sql.get(L.value) || r?.python.get(L.value), a = i ? O.editors[i] : void 0;
209
+ if (!a) {
210
+ let t = Object.values(O.editors).filter((t) => t.connection === e && t.storage !== "remote").map((e) => e.name).join(", ");
211
+ throw Error(`Editor "${L.value}" was not found in the imported model, have ${t}`);
212
+ }
213
+ return {
214
+ foundAssetId: a.id,
215
+ connectionName: e
216
+ };
217
+ }, yt = async () => {
218
+ try {
219
+ if (!z.value || !L.value) {
220
+ V.value = "Missing required import parameters";
221
+ return;
222
+ }
223
+ if (!I.value && !N.value) {
224
+ V.value = "Missing required import parameters";
225
+ return;
226
+ }
227
+ K.value = Date.now(), G.value = Date.now(), M.value = !0, Z(), P.value ? (W.value = "registering", await ft(), await ut("importing")) : W.value = "importing";
228
+ let { foundAssetId: e, connectionName: t } = I.value ? await _t() : await vt();
229
+ await ut("connecting"), tt.value = e, I.value || await Xe();
230
+ let n = D.connectionByName(t);
231
+ n && await D.resetConnection(n.id), await ut("preparing"), M.value = !1, H.value = !0, q && clearTimeout(q), Z(), setTimeout(() => {
232
+ Q();
233
+ }, 2e3), re("importComplete", e, R.value), r(i.IMPORT), r(i.STORE), r(i.STORE_ID), r(i.STORE_KIND), r(i.TOKEN), r(i.ASSET_TYPE), r(i.ASSET_NAME), r(i.DASHBOARD), r(i.REMOTE), setTimeout(() => {
234
+ j.closeTab(null, "asset-import"), R.value === "dashboard" ? (j.openTab("dashboard", null, e), j.setActiveSidebarScreen("dashboard")) : (j.openTab("editors", null, e), j.setActiveSidebarScreen("editors"));
235
+ }, 500);
236
+ } catch (e) {
237
+ console.error("Import failed:", e), V.value = e instanceof Error ? e.message : "Import failed", M.value = !1, Q();
238
+ }
239
+ };
240
+ ae(async () => {
241
+ try {
242
+ K.value = Date.now(), G.value = Date.now(), Z();
243
+ let e = j.modelImport.value, t = a(i.STORE, ""), n = a(i.STORE_ID, ""), r = a(i.STORE_KIND, ""), ee = a(i.TOKEN, ""), te = a(i.REMOTE, ""), o = a(i.ASSET_TYPE, ""), s = a(i.ASSET_NAME, ""), c = a(i.DASHBOARD, ""), l = a(i.MODEL_NAME, ""), u = a(i.CONNECTION, ""), d = "dashboard", f = "";
244
+ o && s ? (d = o, f = s) : c && (d = "dashboard", f = c);
245
+ let p = [
246
+ "true",
247
+ "1",
248
+ "yes"
249
+ ].includes((te || "").toLowerCase());
250
+ if (!f || !l || !p && (!e || !u) || p && !t) {
251
+ V.value = p ? "Missing required import parameters (store, assetName/dashboard, modelName)" : "Missing required import parameters (import, assetName/dashboard, modelName, connection)", M.value = !1, Q();
252
+ return;
253
+ }
254
+ if (N.value = e ? decodeURIComponent(e) : "", P.value = t ? decodeURIComponent(t) : "", $e.value = n ? decodeURIComponent(n) : "", et.value = r === "static" && !p ? "static" : "generic", F.value = ee ? decodeURIComponent(ee) : "", I.value = p, L.value = decodeURIComponent(f), R.value = d, z.value = decodeURIComponent(l), B.value = u, !I.value && !rt[B.value]) {
255
+ V.value = `Unsupported connection type: ${B.value}`, M.value = !1, Q();
256
+ return;
257
+ }
258
+ it.value ? (M.value = !1, Q(), $()) : await gt();
259
+ } catch (e) {
260
+ console.error("Auto-import initialization failed:", e), V.value = e instanceof Error ? e.message : "Failed to initialize import", M.value = !1, Q();
261
+ }
262
+ }), ie(() => {
263
+ Q();
264
+ });
265
+ let bt = async () => {
266
+ if (M.value = !0, !Y.value) throw Error("Form is not valid");
267
+ console.log("performing import"), await gt();
268
+ }, xt = () => {
269
+ R.value === "dashboard" ? (j.setActiveDashboard(null), j.setActiveScreen("dashboard")) : j.setActiveScreen("editors");
270
+ };
271
+ return (e, t) => (x(), g("div", se, [V.value ? (x(), g("div", ce, [
272
+ t[5] ||= _("div", { class: "error-icon" }, "⚠️", -1),
273
+ _("h2", le, C(X.value) + " Load Failed", 1),
274
+ _("p", ue, C(V.value), 1),
275
+ _("div", { class: "error-actions" }, [_("button", {
276
+ onClick: xt,
277
+ class: "import-action manual-import-button"
278
+ }, " Try Manual Import ")])
279
+ ])) : M.value || H.value ? (x(), g("div", de, [_("div", fe, [
280
+ _("img", {
281
+ src: oe(l),
282
+ class: "trilogy-icon spinning",
283
+ alt: "Loading"
284
+ }, null, 8, pe),
285
+ _("h2", me, C(ct.value), 1),
286
+ _("div", he, [
287
+ P.value ? (x(), g("div", {
288
+ key: 0,
289
+ class: b(["step", {
290
+ active: W.value === "registering",
291
+ completed: W.value !== "registering"
292
+ }])
293
+ }, [_("div", ge, [W.value === "registering" ? (x(), g("span", _e, "⟳")) : (x(), g("span", ve, "✓"))]), t[6] ||= _("span", { class: "step-text" }, "Registering store", -1)], 2)) : h("", !0),
294
+ _("div", { class: b(["step", {
295
+ active: W.value === "importing",
296
+ completed: W.value !== "importing" && W.value !== "registering" && (W.value === "connecting" || W.value === "preparing" || H.value)
297
+ }]) }, [_("div", ye, [W.value === "importing" ? (x(), g("span", be, "⟳")) : W.value === "registering" ? (x(), g("span", xe, "○")) : (x(), g("span", Se, "✓"))]), t[7] ||= _("span", { class: "step-text" }, "Importing model", -1)], 2),
298
+ _("div", { class: b(["step", {
299
+ active: W.value === "connecting",
300
+ completed: W.value === "preparing" || H.value
301
+ }]) }, [_("div", Ce, [W.value === "connecting" ? (x(), g("span", we, "⟳")) : W.value === "preparing" || H.value ? (x(), g("span", Te, "✓")) : (x(), g("span", Ee, "○"))]), t[8] ||= _("span", { class: "step-text" }, "Establishing connection", -1)], 2),
302
+ _("div", { class: b(["step", {
303
+ active: W.value === "preparing" || H.value,
304
+ completed: H.value
305
+ }]) }, [_("div", De, [W.value === "preparing" ? (x(), g("span", Oe, "⟳")) : H.value ? (x(), g("span", ke, "✓")) : (x(), g("span", Ae, "○"))]), _("span", je, "Preparing " + C(X.value.toLowerCase()), 1)], 2)
306
+ ]),
307
+ t[9] ||= _("p", { class: "import-details" }, "This may take a few seconds.", -1)
308
+ ])])) : it.value ? (x(), g("div", Me, [
309
+ _("div", Ne, [_("h2", Pe, "Import Model & " + C(X.value), 1), _("div", Fe, [
310
+ _("p", null, [t[10] ||= _("strong", null, "Model:", -1), v(" " + C(z.value), 1)]),
311
+ _("p", null, [_("strong", null, C(X.value) + ":", 1), v(" " + C(L.value), 1)]),
312
+ P.value ? (x(), g("p", Ie, [t[11] ||= _("strong", null, "Store:", -1), v(" " + C(P.value), 1)])) : h("", !0),
313
+ _("p", Le, [t[12] ||= _("strong", null, "From:", -1), v(" " + C(N.value), 1)])
314
+ ])]),
315
+ _("div", Re, [
316
+ _("h3", null, C(ot.value) + " Connection Setup", 1),
317
+ _("p", ze, " This model requires a " + C(B.value) + " connection. Please provide the required configuration: ", 1),
318
+ B.value === "motherduck" ? (x(), g("div", Be, [t[13] ||= _("label", { for: "md-token" }, "MotherDuck Token", -1), T(_("input", {
319
+ type: "text",
320
+ "onUpdate:modelValue": t[0] ||= (e) => J.value.mdToken = e,
321
+ id: "md-token",
322
+ placeholder: "Enter your MotherDuck token",
323
+ class: "sidebar-control-input connection-input",
324
+ onInput: $
325
+ }, null, 544), [[
326
+ w,
327
+ J.value.mdToken,
328
+ void 0,
329
+ { trim: !0 }
330
+ ]])])) : B.value === "bigquery" ? (x(), g("div", Ve, [t[14] ||= _("label", { for: "project-id" }, "BigQuery Project ID", -1), T(_("input", {
331
+ type: "text",
332
+ "onUpdate:modelValue": t[1] ||= (e) => J.value.projectId = e,
333
+ id: "project-id",
334
+ placeholder: "Enter your billing project ID",
335
+ class: "sidebar-control-input connection-input",
336
+ onInput: $
337
+ }, null, 544), [[
338
+ w,
339
+ J.value.projectId,
340
+ void 0,
341
+ { trim: !0 }
342
+ ]])])) : B.value === "snowflake" ? (x(), g(p, { key: 2 }, [
343
+ _("div", He, [t[15] ||= _("label", { for: "snowflake-username" }, "Username", -1), T(_("input", {
344
+ type: "text",
345
+ "onUpdate:modelValue": t[2] ||= (e) => J.value.username = e,
346
+ id: "snowflake-username",
347
+ placeholder: "Snowflake username",
348
+ class: "sidebar-control-input connection-input",
349
+ onInput: $
350
+ }, null, 544), [[
351
+ w,
352
+ J.value.username,
353
+ void 0,
354
+ { trim: !0 }
355
+ ]])]),
356
+ _("div", Ue, [t[16] ||= _("label", { for: "snowflake-account" }, "Account", -1), T(_("input", {
357
+ type: "text",
358
+ "onUpdate:modelValue": t[3] ||= (e) => J.value.account = e,
359
+ id: "snowflake-account",
360
+ placeholder: "Snowflake account identifier",
361
+ class: "sidebar-control-input connection-input",
362
+ onInput: $
363
+ }, null, 544), [[
364
+ w,
365
+ J.value.account,
366
+ void 0,
367
+ { trim: !0 }
368
+ ]])]),
369
+ _("div", We, [t[17] ||= _("label", { for: "snowflake-key" }, "Private Key", -1), T(_("input", {
370
+ type: "text",
371
+ "onUpdate:modelValue": t[4] ||= (e) => J.value.sshPrivateKey = e,
372
+ id: "snowflake-key",
373
+ placeholder: "Private key for authentication",
374
+ class: "sidebar-control-input connection-input",
375
+ onInput: $
376
+ }, null, 544), [[
377
+ w,
378
+ J.value.sshPrivateKey,
379
+ void 0,
380
+ { trim: !0 }
381
+ ]])])
382
+ ], 64)) : h("", !0)
383
+ ]),
384
+ _("div", Ge, [_("button", {
385
+ onClick: bt,
386
+ class: "import-action import-button",
387
+ disabled: !Y.value
388
+ }, " Import Model & " + C(X.value), 9, Ke), _("button", { onClick: xt }, "Cancel")])
389
+ ])) : h("", !0), ne(f, {
390
+ show: U.value,
391
+ title: "Overwrite Existing Model?",
392
+ message: st.value,
393
+ "confirm-label": "Overwrite",
394
+ "cancel-label": "Cancel",
395
+ "confirm-test-id": "confirm-overwrite-model",
396
+ "cancel-test-id": "cancel-overwrite-model",
397
+ onClose: mt,
398
+ onConfirm: ht
399
+ }, null, 8, ["show", "message"])]));
400
+ }
401
+ }), D = /* @__PURE__ */ e({ default: () => O }), O = /*#__PURE__*/ t(E, [["__scopeId", "data-v-331fa5ac"]]);
402
+ //#endregion
403
+ export { D as n, O as t };
@@ -0,0 +1,218 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-f9Rw-Il4.js";
2
+ import { t } from "./StatusIcon-AbxNvJ6p.js";
3
+ import { t as n } from "./ChatModelSelect-Cz7axWjP.js";
4
+ import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, inject as d, normalizeClass as f, openBlock as p, ref as m, renderList as h, resolveComponent as g, toDisplayString as _, vModelSelect as v, vModelText as y, watch as b, withDirectives as x, withModifiers as S } from "vue";
5
+ //#region components/llm/ChatCreatorModal.vue?vue&type=script&lang.ts
6
+ var C = u({
7
+ name: "ChatCreatorModal",
8
+ components: {
9
+ StatusIcon: t,
10
+ ChatModelSelect: n
11
+ },
12
+ props: {
13
+ visible: {
14
+ type: Boolean,
15
+ default: !1
16
+ },
17
+ preselectedConnection: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ activeDataConnection: {
22
+ type: String,
23
+ default: ""
24
+ }
25
+ },
26
+ emits: ["close", "chat-created"],
27
+ setup(e, { emit: t }) {
28
+ let n = d("llmConnectionStore"), r = d("connectionStore", null), a = d("chatStore", null), o = d("saveLLMConnections", null), s = m(e.preselectedConnection || ""), c = m(""), l = m(""), u = m(""), f = m(!1), p = m("");
29
+ b([s, () => e.visible], () => {
30
+ u.value = n?.connections[s.value]?.model || "", p.value = "";
31
+ }, { immediate: !0 }), b(() => e.preselectedConnection, (e) => {
32
+ e && (s.value = e);
33
+ }, { immediate: !0 }), b(() => e.visible, (t) => {
34
+ t && (e.preselectedConnection && (s.value = e.preselectedConnection), c.value = "", l.value = "");
35
+ });
36
+ let h = i(() => n ? Object.values(n.connections).filter((e) => !e.deleted).map((e) => ({
37
+ name: e.name,
38
+ model: e.model || "Unknown",
39
+ connected: e.connected === !0,
40
+ running: e.running === !0,
41
+ error: e.error || null
42
+ })) : []), g = i(() => [...h.value].sort((e, t) => e.connected && !t.connected ? -1 : !e.connected && t.connected ? 1 : e.name.localeCompare(t.name))), _ = i(() => {
43
+ if (!s.value) return null;
44
+ let e = h.value.find((e) => e.name === s.value);
45
+ return e ? e.connected ? e.running ? {
46
+ status: "running",
47
+ message: "Running"
48
+ } : e.error ? {
49
+ status: "failed",
50
+ message: e.error
51
+ } : {
52
+ status: "connected",
53
+ message: "Connected"
54
+ } : {
55
+ status: "disabled",
56
+ message: "Disconnected"
57
+ } : null;
58
+ }), v = i(() => e.activeDataConnection ? e.activeDataConnection.split("+")[0] : ""), y = i(() => !v.value || !r ? "" : r.connectionByName(v.value)?.id || ""), x = i(() => r ? Object.values(r.connections).filter((e) => !e.deleted).map((e) => ({
59
+ id: e.id,
60
+ name: e.name,
61
+ connected: e.connected === !0,
62
+ running: e.running === !0,
63
+ error: e.error || null
64
+ })) : []);
65
+ return {
66
+ selectedLLMConnection: s,
67
+ selectedModel: u,
68
+ isCreating: f,
69
+ creationError: p,
70
+ selectedDataConnectionId: c,
71
+ chatName: l,
72
+ availableLLMConnections: h,
73
+ sortedLLMConnections: g,
74
+ selectedConnectionStatus: _,
75
+ availableDataConnections: x,
76
+ sortedDataConnections: i(() => [...x.value].sort((e, t) => e.connected && !t.connected ? -1 : !e.connected && t.connected ? 1 : e.name.localeCompare(t.name))),
77
+ selectedDataConnectionStatus: i(() => {
78
+ if (!c.value) return null;
79
+ let e = x.value.find((e) => e.id === c.value);
80
+ return e ? e.connected ? e.running ? {
81
+ status: "running",
82
+ message: "Running"
83
+ } : e.error ? {
84
+ status: "failed",
85
+ message: e.error
86
+ } : {
87
+ status: "connected",
88
+ message: "Connected"
89
+ } : {
90
+ status: "disabled",
91
+ message: "Disconnected"
92
+ } : null;
93
+ }),
94
+ activeDataConnectionName: v,
95
+ activeDataConnectionId: y,
96
+ createChat: async () => {
97
+ if (!s.value || !a || f.value) return;
98
+ let e = n?.connections[s.value];
99
+ if (e && u.value && e.model !== u.value) {
100
+ f.value = !0;
101
+ let t = e.model;
102
+ try {
103
+ e.setModel(u.value), await o?.();
104
+ } catch {
105
+ e.setModel(t), p.value = "Could not save the model. Please try again.";
106
+ return;
107
+ } finally {
108
+ f.value = !1;
109
+ }
110
+ }
111
+ n && (n.activeConnection = s.value);
112
+ let i = c.value ? r?.connections[c.value] : null;
113
+ t("chat-created", a.newChat(s.value, i?.name || "", l.value || void 0, i?.id || "")), t("close");
114
+ }
115
+ };
116
+ }
117
+ }), w = { class: "chat-creator-form" }, T = { class: "form-group" }, E = { class: "select-with-status" }, D = ["disabled"], O = ["value", "disabled"], k = { key: 0 }, A = {
118
+ key: 1,
119
+ role: "alert"
120
+ }, j = { class: "form-group" }, M = { class: "select-with-status" }, N = ["disabled"], P = ["value"], F = { class: "form-group" }, I = ["disabled"], L = { class: "button-container" }, R = ["disabled"], z = ["disabled"];
121
+ function B(e, t, n, i, u, d) {
122
+ let m = g("status-icon"), b = g("ChatModelSelect");
123
+ return e.visible ? (p(), s("div", {
124
+ key: 0,
125
+ class: "confirmation-overlay",
126
+ onClick: t[7] ||= (t) => !e.isCreating && e.$emit("close")
127
+ }, [c("div", {
128
+ class: "confirmation-dialog",
129
+ "data-testid": "chat-creator-modal",
130
+ onClick: t[6] ||= S(() => {}, ["stop"])
131
+ }, [t[14] ||= c("h3", null, "Create New Chat", -1), c("div", w, [
132
+ c("div", T, [
133
+ t[9] ||= c("label", { for: "llm-connection" }, [l("LLM Connection: "), c("span", { class: "required" }, "*")], -1),
134
+ c("div", E, [x(c("select", {
135
+ id: "llm-connection",
136
+ "onUpdate:modelValue": t[0] ||= (t) => e.selectedLLMConnection = t,
137
+ required: "",
138
+ disabled: !!e.preselectedConnection || e.isCreating,
139
+ "data-testid": "llm-connection-select"
140
+ }, [t[8] ||= c("option", {
141
+ value: "",
142
+ disabled: ""
143
+ }, "Select an LLM connection...", -1), (p(!0), s(r, null, h(e.sortedLLMConnections, (e) => (p(), s("option", {
144
+ key: e.name,
145
+ value: e.name,
146
+ disabled: !e.connected
147
+ }, _(e.name) + " (" + _(e.model) + ") ", 9, O))), 128))], 8, D), [[v, e.selectedLLMConnection]]), e.selectedConnectionStatus ? (p(), a(m, {
148
+ key: 0,
149
+ status: e.selectedConnectionStatus.status,
150
+ message: e.selectedConnectionStatus.message,
151
+ testName: e.selectedLLMConnection
152
+ }, null, 8, [
153
+ "status",
154
+ "message",
155
+ "testName"
156
+ ])) : o("", !0)]),
157
+ e.selectedLLMConnection ? o("", !0) : (p(), s("small", k, " Required - Select which LLM to use for this chat "))
158
+ ]),
159
+ e.selectedLLMConnection ? (p(), a(b, {
160
+ key: 0,
161
+ class: "form-group",
162
+ "connection-name": e.selectedLLMConnection,
163
+ modelValue: e.selectedModel,
164
+ "onUpdate:modelValue": t[1] ||= (t) => e.selectedModel = t,
165
+ disabled: e.isCreating
166
+ }, null, 8, [
167
+ "connection-name",
168
+ "modelValue",
169
+ "disabled"
170
+ ])) : o("", !0),
171
+ e.creationError ? (p(), s("p", A, _(e.creationError), 1)) : o("", !0),
172
+ c("div", j, [
173
+ t[11] ||= c("label", { for: "data-connection" }, "Data Connection:", -1),
174
+ c("div", M, [x(c("select", {
175
+ id: "data-connection",
176
+ "onUpdate:modelValue": t[2] ||= (t) => e.selectedDataConnectionId = t,
177
+ disabled: e.isCreating,
178
+ "data-testid": "data-connection-select"
179
+ }, [t[10] ||= c("option", { value: "" }, "None - Select later", -1), (p(!0), s(r, null, h(e.sortedDataConnections, (t) => (p(), s("option", {
180
+ key: t.id,
181
+ value: t.id,
182
+ class: f({ "active-connection": t.id === e.activeDataConnectionId })
183
+ }, _(t.name) + _(t.id === e.activeDataConnectionId ? " (active)" : ""), 11, P))), 128))], 8, N), [[v, e.selectedDataConnectionId]]), e.selectedDataConnectionStatus ? (p(), a(m, {
184
+ key: 0,
185
+ status: e.selectedDataConnectionStatus.status,
186
+ message: e.selectedDataConnectionStatus.message,
187
+ testName: "data-" + e.selectedDataConnectionId
188
+ }, null, 8, [
189
+ "status",
190
+ "message",
191
+ "testName"
192
+ ])) : o("", !0)]),
193
+ t[12] ||= c("small", null, " Optional - Select a data source for running queries ", -1)
194
+ ]),
195
+ c("div", F, [t[13] ||= c("label", { for: "chat-name" }, "Chat Name:", -1), x(c("input", {
196
+ id: "chat-name",
197
+ "onUpdate:modelValue": t[3] ||= (t) => e.chatName = t,
198
+ disabled: e.isCreating,
199
+ placeholder: "Auto-generated if empty",
200
+ maxlength: "100",
201
+ "data-testid": "chat-name-input"
202
+ }, null, 8, I), [[y, e.chatName]])]),
203
+ c("div", L, [c("button", {
204
+ class: "cancel-btn",
205
+ disabled: e.isCreating,
206
+ onClick: t[4] ||= (t) => e.$emit("close"),
207
+ "data-testid": "cancel-chat-create"
208
+ }, " Cancel ", 8, R), c("button", {
209
+ class: "primary-button",
210
+ onClick: t[5] ||= (...t) => e.createChat && e.createChat(...t),
211
+ disabled: !e.selectedLLMConnection || e.isCreating,
212
+ "data-testid": "create-chat-btn"
213
+ }, " Create Chat ", 8, z)])
214
+ ])])])) : o("", !0);
215
+ }
216
+ var V = /*#__PURE__*/ e(C, [["render", B], ["__scopeId", "data-v-b00cd718"]]);
217
+ //#endregion
218
+ export { V as default };
@@ -0,0 +1,40 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-f9Rw-Il4.js";
2
+ import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, inject as s, openBlock as c, renderList as l, toDisplayString as u, unref as d, useId as f } from "vue";
3
+ //#region components/llm/ChatModelSelect.vue?vue&type=script&setup=true&lang.ts
4
+ var p = {
5
+ key: 0,
6
+ class: "chat-model-picker"
7
+ }, m = ["for"], h = [
8
+ "id",
9
+ "value",
10
+ "disabled",
11
+ "aria-describedby"
12
+ ], g = ["value"], _ = ["id"], v = /*#__PURE__*/ e(/* @__PURE__ */ o({
13
+ __name: "ChatModelSelect",
14
+ props: {
15
+ connectionName: {},
16
+ modelValue: {},
17
+ disabled: { type: Boolean }
18
+ },
19
+ emits: ["update:modelValue"],
20
+ setup(e, { emit: o }) {
21
+ let v = e, y = o, b = s("llmConnectionStore"), x = f(), S = n(() => b?.connections[v.connectionName]), C = n(() => [.../* @__PURE__ */ new Set([S.value?.model, ...S.value?.models || []])].filter((e) => !!e));
22
+ return (n, o) => S.value ? (c(), i("div", p, [
23
+ a("label", { for: d(x) }, "Model", 8, m),
24
+ a("select", {
25
+ id: d(x),
26
+ value: e.modelValue,
27
+ disabled: e.disabled,
28
+ "aria-describedby": `${d(x)}-notice`,
29
+ "data-testid": "chat-model-select",
30
+ onChange: o[0] ||= (e) => y("update:modelValue", e.target.value)
31
+ }, [(c(!0), i(t, null, l(C.value, (e) => (c(), i("option", {
32
+ key: e,
33
+ value: e
34
+ }, u(e), 9, g))), 128))], 40, h),
35
+ a("small", { id: `${d(x)}-notice` }, " Changing the model updates this connection’s default and affects all chats using it. ", 8, _)
36
+ ])) : r("", !0);
37
+ }
38
+ }), [["__scopeId", "data-v-ee5cd48f"]]);
39
+ //#endregion
40
+ export { v as t };
@@ -1,5 +1,5 @@
1
- import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { n as t, t as n } from "./usePrismHighlight-DVyDiDAL.js";
1
+ import { t as e } from "./_plugin-vue_export-helper-f9Rw-Il4.js";
2
+ import { o as t, s as n } from "./useGlobalChatPanel-DuP1q7_f.js";
3
3
  import { computed as r, createElementBlock as i, createElementVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, toDisplayString as u, toRef as d } from "vue";
4
4
  //#region components/CodeBlock.vue?vue&type=script&lang.ts
5
5
  var f = o({
@@ -20,8 +20,8 @@ var f = o({
20
20
  },
21
21
  emits: ["on-copy"],
22
22
  setup(e, { emit: i }) {
23
- let a = l(null), o = l(!1), s = r(() => `language-${t(e.language)}`);
24
- return n(a, {
23
+ let a = l(null), o = l(!1), s = r(() => `language-${n(e.language)}`);
24
+ return t(a, {
25
25
  languages: () => [e.language],
26
26
  watchSources: [d(e, "content"), d(e, "language")]
27
27
  }), {