drizzle-cube 0.4.13 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/adapters/express/index.cjs +6 -6
- package/dist/adapters/express/index.js +73 -72
- package/dist/adapters/fastify/index.cjs +5 -5
- package/dist/adapters/fastify/index.js +110 -109
- package/dist/adapters/{handler-CQkIwtxp.js → handler-DZnCbydH.js} +719 -272
- package/dist/adapters/handler-ZDYlokiM.cjs +25 -0
- package/dist/adapters/hono/index.cjs +6 -6
- package/dist/adapters/hono/index.js +121 -120
- package/dist/adapters/nextjs/index.cjs +5 -5
- package/dist/adapters/nextjs/index.js +92 -91
- package/dist/client/charts.js +67 -59
- package/dist/client/charts.js.map +1 -1
- package/dist/client/chunks/{RetentionCombinedChart-CEI8KQ3t.js → RetentionCombinedChart-CLq89aOJ.js} +2 -2
- package/dist/client/chunks/{RetentionCombinedChart-CEI8KQ3t.js.map → RetentionCombinedChart-CLq89aOJ.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-BMmWeFPr.js → analysis-builder-C5e52Z3p.js} +419 -411
- package/dist/client/chunks/analysis-builder-C5e52Z3p.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-D56zYeV0.js → analysis-builder-shared-EnM-8plh.js} +2 -2
- package/dist/client/chunks/{analysis-builder-shared-D56zYeV0.js.map → analysis-builder-shared-EnM-8plh.js.map} +1 -1
- package/dist/client/chunks/{chart-activity-grid-CE7xGFQo.js → chart-activity-grid-CPGcTSuh.js} +2 -2
- package/dist/client/chunks/{chart-activity-grid-CE7xGFQo.js.map → chart-activity-grid-CPGcTSuh.js.map} +1 -1
- package/dist/client/chunks/{chart-area-BJAgusst.js → chart-area-ByJQ7NZd.js} +3 -3
- package/dist/client/chunks/{chart-area-BJAgusst.js.map → chart-area-ByJQ7NZd.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-Blypx8O4.js → chart-bar-dj14frMt.js} +2 -2
- package/dist/client/chunks/{chart-bar-Blypx8O4.js.map → chart-bar-dj14frMt.js.map} +1 -1
- package/dist/client/chunks/chart-box-plot-ZatBpatq.js +322 -0
- package/dist/client/chunks/chart-box-plot-ZatBpatq.js.map +1 -0
- package/dist/client/chunks/{chart-bubble-Bf42A1-B.js → chart-bubble-CemotLx-.js} +2 -2
- package/dist/client/chunks/{chart-bubble-Bf42A1-B.js.map → chart-bubble-CemotLx-.js.map} +1 -1
- package/dist/client/chunks/chart-candlestick-BIR4uGGt.js +269 -0
- package/dist/client/chunks/chart-candlestick-BIR4uGGt.js.map +1 -0
- package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js +38 -0
- package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js.map +1 -0
- package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js +70 -0
- package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js.map +1 -0
- package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js +64 -0
- package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js.map +1 -0
- package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js +70 -0
- package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js.map +1 -0
- package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js +60 -0
- package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-Ba_6tuJw.js → chart-data-table-D5G8nMnb.js} +2 -2
- package/dist/client/chunks/{chart-data-table-Ba_6tuJw.js.map → chart-data-table-D5G8nMnb.js.map} +1 -1
- package/dist/client/chunks/{chart-funnel-C9kenCpp.js → chart-funnel-dofnhD24.js} +2 -2
- package/dist/client/chunks/{chart-funnel-C9kenCpp.js.map → chart-funnel-dofnhD24.js.map} +1 -1
- package/dist/client/chunks/chart-gauge-CKJJ8m3b.js +374 -0
- package/dist/client/chunks/chart-gauge-CKJJ8m3b.js.map +1 -0
- package/dist/client/chunks/{chart-heat-map-CYGemyPB.js → chart-heat-map-BVuPUKHT.js} +2 -2
- package/dist/client/chunks/{chart-heat-map-CYGemyPB.js.map → chart-heat-map-BVuPUKHT.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-D9XJoKuA.js → chart-kpi-delta-Dgg2eYRl.js} +3 -3
- package/dist/client/chunks/{chart-kpi-delta-D9XJoKuA.js.map → chart-kpi-delta-Dgg2eYRl.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-C29Vj2g8.js → chart-kpi-number-DkoO99c1.js} +2 -2
- package/dist/client/chunks/{chart-kpi-number-C29Vj2g8.js.map → chart-kpi-number-DkoO99c1.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-CgjjrurK.js → chart-kpi-text-1O6_lmz7.js} +3 -3
- package/dist/client/chunks/{chart-kpi-text-CgjjrurK.js.map → chart-kpi-text-1O6_lmz7.js.map} +1 -1
- package/dist/client/chunks/{chart-line-zi6olZet.js → chart-line-DzyZkugh.js} +3 -3
- package/dist/client/chunks/{chart-line-zi6olZet.js.map → chart-line-DzyZkugh.js.map} +1 -1
- package/dist/client/chunks/chart-measure-profile-C2IkBG3V.js +114 -0
- package/dist/client/chunks/chart-measure-profile-C2IkBG3V.js.map +1 -0
- package/dist/client/chunks/{chart-pie-C4SuxKSN.js → chart-pie-akbfRfb9.js} +2 -2
- package/dist/client/chunks/{chart-pie-C4SuxKSN.js.map → chart-pie-akbfRfb9.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-BW3Z_-Ly.js → chart-radar-BaN-Kjww.js} +2 -2
- package/dist/client/chunks/{chart-radar-BW3Z_-Ly.js.map → chart-radar-BaN-Kjww.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-0Fa3aeP5.js → chart-radial-bar-DpptEL3s.js} +2 -2
- package/dist/client/chunks/{chart-radial-bar-0Fa3aeP5.js.map → chart-radial-bar-DpptEL3s.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-DBghfbg1.js → chart-sankey-CG-3hHmX.js} +2 -2
- package/dist/client/chunks/{chart-sankey-DBghfbg1.js.map → chart-sankey-CG-3hHmX.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-DOVu1TNq.js → chart-scatter-l_yTVxF3.js} +2 -2
- package/dist/client/chunks/{chart-scatter-DOVu1TNq.js.map → chart-scatter-l_yTVxF3.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-LfNthFlZ.js → chart-sunburst-KhDcKhmZ.js} +2 -2
- package/dist/client/chunks/{chart-sunburst-LfNthFlZ.js.map → chart-sunburst-KhDcKhmZ.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-DZtQPyWX.js → chart-tree-map-CBbiaBXV.js} +2 -2
- package/dist/client/chunks/{chart-tree-map-DZtQPyWX.js.map → chart-tree-map-CBbiaBXV.js.map} +1 -1
- package/dist/client/chunks/chart-waterfall-CX3vx_lI.js +191 -0
- package/dist/client/chunks/chart-waterfall-CX3vx_lI.js.map +1 -0
- package/dist/client/chunks/{charts-core-DmGfleFz.js → charts-core-CU9u_HtL.js} +2 -1
- package/dist/client/chunks/charts-core-CU9u_HtL.js.map +1 -0
- package/dist/client/chunks/{charts-loader-CH0_S06T.js → charts-loader-AW3T1nv5.js} +58 -42
- package/dist/client/chunks/charts-loader-AW3T1nv5.js.map +1 -0
- package/dist/client/chunks/{components-ClQziOcT.js → components-BkeSy9xv.js} +4 -4
- package/dist/client/chunks/components-BkeSy9xv.js.map +1 -0
- package/dist/client/components/AgenticNotebook/AgentChatPanel.d.ts +10 -0
- package/dist/client/components/AgenticNotebook/ChatMessage.d.ts +2 -0
- package/dist/client/components/AgenticNotebook/index.d.ts +11 -1
- package/dist/client/components/LoadingIndicator.d.ts +2 -2
- package/dist/client/components/charts/BoxPlotChart.config.d.ts +1 -7
- package/dist/client/components/charts/CandlestickChart.config.d.ts +5 -0
- package/dist/client/components/charts/CandlestickChart.d.ts +4 -0
- package/dist/client/components/charts/GaugeChart.config.d.ts +5 -0
- package/dist/client/components/charts/GaugeChart.d.ts +4 -0
- package/dist/client/components/charts/MeasureProfileChart.config.d.ts +5 -0
- package/dist/client/components/charts/MeasureProfileChart.d.ts +4 -0
- package/dist/client/components/charts/WaterfallChart.config.d.ts +5 -0
- package/dist/client/components/charts/WaterfallChart.d.ts +4 -0
- package/dist/client/components/charts/index.d.ts +4 -0
- package/dist/client/components.js +1 -1
- package/dist/client/hooks/useAgentChat.d.ts +20 -2
- package/dist/client/index.js +583 -522
- package/dist/client/index.js.map +1 -1
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +19 -1
- package/dist/client/utils.js +4 -4
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.cjs +47 -45
- package/dist/server/index.d.ts +37 -0
- package/dist/server/index.js +1745 -1298
- package/package.json +4 -1
- package/dist/adapters/handler-dnkqpznh.cjs +0 -23
- package/dist/client/chunks/analysis-builder-BMmWeFPr.js.map +0 -1
- package/dist/client/chunks/chart-box-plot-Dja4LS3O.js +0 -313
- package/dist/client/chunks/chart-box-plot-Dja4LS3O.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-D3DA7_pr.js +0 -85
- package/dist/client/chunks/chart-config-box-plot-D3DA7_pr.js.map +0 -1
- package/dist/client/chunks/charts-core-DmGfleFz.js.map +0 -1
- package/dist/client/chunks/charts-loader-CH0_S06T.js.map +0 -1
- package/dist/client/chunks/components-ClQziOcT.js.map +0 -1
package/dist/client/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { i as
|
|
3
|
-
import { jsx as r, jsxs as
|
|
4
|
-
import
|
|
5
|
-
import { c as
|
|
6
|
-
import { a as
|
|
7
|
-
import { D as
|
|
8
|
-
import { Q as
|
|
9
|
-
import { f as
|
|
10
|
-
import { h as
|
|
11
|
-
import { L as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { c as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
1
|
+
import { D as re, A as ae, e as ce, P as ne } from "./chunks/components-BkeSy9xv.js";
|
|
2
|
+
import { i as ot, a as dt, C as it, h as lt, g as ut, b as mt, j as pt, f as ht, d as ft, M as gt, c as bt, n as yt, T as xt, R as vt, Q as Ct, O as kt, S as Nt, V as wt, I as St, H as Dt, K as At, W as Tt, G as Mt, J as It, X as Et, L as Rt, N as Bt, U as Lt, Y as Pt, Z as Qt, z as Ft, q as _t, x as Vt, t as jt, s as qt, w as Ut, p as Kt, v as Ot, o as $t, r as zt, y as Wt, u as Jt, k as Gt, l as Ht, m as Xt, F as Yt, E as Zt, B as es } from "./chunks/components-BkeSy9xv.js";
|
|
3
|
+
import { jsx as r, jsxs as x, Fragment as oe } from "react/jsx-runtime";
|
|
4
|
+
import Q, { useRef as C, createContext as de, useContext as ie, useState as j, useCallback as g, useEffect as P } from "react";
|
|
5
|
+
import { c as le, d as ue, e as me, s as pe, f as O } from "./chunks/vendor-AVsJ2ni0.js";
|
|
6
|
+
import { a as q } from "./chunks/icons-DAeqv1iX.js";
|
|
7
|
+
import { D as ss, h as rs, i as as, b as cs, e as ns, f as os, g as ds, r as is, c as ls, s as us } from "./chunks/icons-DAeqv1iX.js";
|
|
8
|
+
import { Q as he } from "./chunks/chart-markdown-Du4Z2iqK.js";
|
|
9
|
+
import { f as fe } from "./chunks/providers-CgxXm6Ll.js";
|
|
10
|
+
import { h as ps, a as hs, S as fs, e as gs, d as bs, i as ys, b as xs, g as vs, u as Cs, j as ks, c as Ns, w as ws } from "./chunks/providers-CgxXm6Ll.js";
|
|
11
|
+
import { L as ge } from "./chunks/charts-core-CU9u_HtL.js";
|
|
12
|
+
import { u as Ds } from "./chunks/charts-core-CU9u_HtL.js";
|
|
13
|
+
import { L as Ts, g as Ms, c as Is, b as Es, i as Rs, p as Bs, a as Ls } from "./chunks/charts-loader-AW3T1nv5.js";
|
|
14
|
+
import { E as Qs, a as Fs, p as _s, q as Vs, m as js, l as qs, r as Us, C as Ks, D as Os, o as $s, B as zs, n as Ws, w as Js, t as Gs, d as Hs, f as Xs, s as Ys, e as Zs, i as er, c as tr, h as sr, g as rr, u as ar, b as cr, y as nr, A as or, x as dr, k as ir, v as lr, z as ur, j as mr } from "./chunks/analysis-builder-shared-EnM-8plh.js";
|
|
15
|
+
import { u as hr } from "./chunks/chart-bubble-CemotLx-.js";
|
|
16
|
+
import { c as gr, f as br } from "./chunks/index-CApFCBF9.js";
|
|
17
|
+
import { e as xr, c as vr, l as Cr, h as kr, k as Nr, j as wr, i as Sr, m as Dr, g as Ar, f as Tr, u as Mr, u as Ir, d as Er, b as Rr, a as Br, v as Lr } from "./chunks/useDirtyStateTracking-Cu1HSjmo.js";
|
|
18
|
+
import { c as Qr, b as Fr, f as _r, g as Vr, a as jr, i as qr, t as Ur } from "./chunks/funnel-utils-CyonoNeC.js";
|
|
19
|
+
import { T as Or, c as $r, g as zr, a as Wr, i as Jr, r as Gr, s as Hr, b as Xr, w as Yr } from "./chunks/theme-Dp3hFed1.js";
|
|
20
|
+
import { createExplainQueryKey as ea, useDryRunQueries as ta, useDryRunQuery as sa, useExplainAI as ra, useExplainQuery as aa, useMultiDryRunQueries as ca } from "./hooks.js";
|
|
21
|
+
import { i as oa, a as da } from "./chunks/flow-utils-CjQZG5qq.js";
|
|
22
|
+
import { h as la } from "./chunks/syntaxHighlighting-BQfjio-i.js";
|
|
23
|
+
const J = () => ({
|
|
23
24
|
blocks: [],
|
|
24
25
|
messages: [],
|
|
25
26
|
isStreaming: !1,
|
|
26
27
|
sessionId: null,
|
|
27
28
|
inputValue: ""
|
|
28
29
|
});
|
|
29
|
-
function
|
|
30
|
+
function be(e, t) {
|
|
30
31
|
return {
|
|
31
32
|
// Block actions
|
|
32
33
|
addBlock: (s) => e((c) => ({
|
|
@@ -36,7 +37,7 @@ function oe(e, t) {
|
|
|
36
37
|
blocks: c.blocks.filter((a) => a.id !== s)
|
|
37
38
|
})),
|
|
38
39
|
moveBlock: (s, c) => e((a) => {
|
|
39
|
-
const n = a.blocks.findIndex((
|
|
40
|
+
const n = a.blocks.findIndex((d) => d.id === s);
|
|
40
41
|
if (n === -1) return {};
|
|
41
42
|
if (c === "up" && n === 0) return {};
|
|
42
43
|
if (c === "down" && n === a.blocks.length - 1) return {};
|
|
@@ -73,7 +74,7 @@ function oe(e, t) {
|
|
|
73
74
|
updateLastToolCall: (s) => e((c) => {
|
|
74
75
|
const a = [...c.messages], n = a[a.length - 1];
|
|
75
76
|
if (n?.role === "assistant" && n.toolCalls?.length) {
|
|
76
|
-
const o = [...n.toolCalls], l = s.id ? o.findIndex((
|
|
77
|
+
const o = [...n.toolCalls], l = s.id ? o.findIndex((d) => d.id === s.id) : o.length - 1;
|
|
77
78
|
l !== -1 && (o[l] = { ...o[l], ...s }, a[a.length - 1] = { ...n, toolCalls: o });
|
|
78
79
|
}
|
|
79
80
|
return { messages: a };
|
|
@@ -95,44 +96,44 @@ function oe(e, t) {
|
|
|
95
96
|
messages: s.messages || []
|
|
96
97
|
}),
|
|
97
98
|
// Reset
|
|
98
|
-
reset: () => e(
|
|
99
|
+
reset: () => e(J())
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
-
const e =
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
function ye() {
|
|
103
|
+
const e = J();
|
|
104
|
+
return ue()(
|
|
105
|
+
me(
|
|
106
|
+
pe((t, s) => ({
|
|
106
107
|
...e,
|
|
107
|
-
...
|
|
108
|
+
...be(t, s)
|
|
108
109
|
})),
|
|
109
110
|
{ name: "NotebookStore" }
|
|
110
111
|
)
|
|
111
112
|
);
|
|
112
113
|
}
|
|
113
|
-
const
|
|
114
|
-
function
|
|
114
|
+
const G = de(null);
|
|
115
|
+
function xe({
|
|
115
116
|
children: e,
|
|
116
117
|
initialConfig: t
|
|
117
118
|
}) {
|
|
118
|
-
const s =
|
|
119
|
+
const s = C(null);
|
|
119
120
|
if (!s.current) {
|
|
120
|
-
const c =
|
|
121
|
+
const c = ye();
|
|
121
122
|
t && c.getState().load(t), s.current = c;
|
|
122
123
|
}
|
|
123
|
-
return /* @__PURE__ */ r(
|
|
124
|
+
return /* @__PURE__ */ r(G.Provider, { value: s.current, children: e });
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
-
const t =
|
|
126
|
+
function A(e) {
|
|
127
|
+
const t = ie(G);
|
|
127
128
|
if (!t)
|
|
128
129
|
throw new Error("useNotebookStore must be used within NotebookStoreProvider");
|
|
129
|
-
return
|
|
130
|
+
return le(t, e);
|
|
130
131
|
}
|
|
131
|
-
const
|
|
132
|
+
const ve = (e) => e.blocks, Ye = (e) => e.messages, Ze = (e) => e.isStreaming, et = (e) => e.sessionId, tt = (e) => e.inputValue, Ce = (e) => ({
|
|
132
133
|
messages: e.messages,
|
|
133
134
|
isStreaming: e.isStreaming,
|
|
134
135
|
inputValue: e.inputValue
|
|
135
|
-
}),
|
|
136
|
+
}), ke = (e) => ({
|
|
136
137
|
addMessage: e.addMessage,
|
|
137
138
|
appendToLastAssistantMessage: e.appendToLastAssistantMessage,
|
|
138
139
|
setLastAssistantError: e.setLastAssistantError,
|
|
@@ -141,12 +142,12 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
141
142
|
setIsStreaming: e.setIsStreaming,
|
|
142
143
|
setInputValue: e.setInputValue,
|
|
143
144
|
setSessionId: e.setSessionId
|
|
144
|
-
}),
|
|
145
|
+
}), Ne = (e) => ({
|
|
145
146
|
addBlock: e.addBlock,
|
|
146
147
|
removeBlock: e.removeBlock,
|
|
147
148
|
moveBlock: e.moveBlock,
|
|
148
149
|
updateBlock: e.updateBlock
|
|
149
|
-
}),
|
|
150
|
+
}), K = { width: "16px", height: "16px", color: "currentColor" }, we = q("chevronUp"), Se = q("chevronDown"), De = q("edit"), Ae = q("delete"), Te = Q.memo(function({
|
|
150
151
|
block: t,
|
|
151
152
|
onRemove: s,
|
|
152
153
|
onMoveUp: c,
|
|
@@ -155,33 +156,33 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
155
156
|
isFirst: o,
|
|
156
157
|
isLast: l
|
|
157
158
|
}) {
|
|
158
|
-
const [
|
|
159
|
-
|
|
159
|
+
const [d, w] = j(null), m = g((k) => {
|
|
160
|
+
w(k);
|
|
160
161
|
}, []);
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ x("div", { className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col", children: [
|
|
163
|
+
/* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-3 dc:py-1.5 dc:border-b border-dc-border dc:shrink-0 bg-dc-surface-secondary dc:rounded-t-lg", children: [
|
|
164
|
+
/* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0", children: [
|
|
164
165
|
/* @__PURE__ */ r("h3", { className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate", children: t.title || "Untitled" }),
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
d && /* @__PURE__ */ r(
|
|
167
|
+
re,
|
|
167
168
|
{
|
|
168
|
-
chartConfig:
|
|
169
|
-
displayConfig:
|
|
170
|
-
queryObject:
|
|
171
|
-
data:
|
|
172
|
-
chartType:
|
|
173
|
-
cacheInfo:
|
|
169
|
+
chartConfig: d.chartConfig,
|
|
170
|
+
displayConfig: d.displayConfig,
|
|
171
|
+
queryObject: d.queryObject,
|
|
172
|
+
data: d.data,
|
|
173
|
+
chartType: d.chartType,
|
|
174
|
+
cacheInfo: d.cacheInfo ?? void 0
|
|
174
175
|
}
|
|
175
176
|
)
|
|
176
177
|
] }),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:gap-1 dc:shrink-0 dc:ml-4 dc:-mr-2", children: [
|
|
178
179
|
!o && /* @__PURE__ */ r(
|
|
179
180
|
"button",
|
|
180
181
|
{
|
|
181
182
|
onClick: () => c(t.id),
|
|
182
183
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
183
184
|
title: "Move up",
|
|
184
|
-
children: /* @__PURE__ */ r(
|
|
185
|
+
children: /* @__PURE__ */ r(we, { style: K })
|
|
185
186
|
}
|
|
186
187
|
),
|
|
187
188
|
!l && /* @__PURE__ */ r(
|
|
@@ -190,7 +191,7 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
190
191
|
onClick: () => a(t.id),
|
|
191
192
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
192
193
|
title: "Move down",
|
|
193
|
-
children: /* @__PURE__ */ r(
|
|
194
|
+
children: /* @__PURE__ */ r(Se, { style: K })
|
|
194
195
|
}
|
|
195
196
|
),
|
|
196
197
|
/* @__PURE__ */ r(
|
|
@@ -199,7 +200,7 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
199
200
|
onClick: () => n(t),
|
|
200
201
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
201
202
|
title: "Edit visualization",
|
|
202
|
-
children: /* @__PURE__ */ r(
|
|
203
|
+
children: /* @__PURE__ */ r(De, { style: K })
|
|
203
204
|
}
|
|
204
205
|
),
|
|
205
206
|
/* @__PURE__ */ r(
|
|
@@ -208,13 +209,13 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
208
209
|
onClick: () => s(t.id),
|
|
209
210
|
className: "dc:p-1 dc:mr-0.5 dc:bg-transparent dc:border-none dc:rounded-sm dc:cursor-pointer dc:hover:bg-dc-danger-bg text-dc-danger dc:transition-colors",
|
|
210
211
|
title: "Remove",
|
|
211
|
-
children: /* @__PURE__ */ r(
|
|
212
|
+
children: /* @__PURE__ */ r(Ae, { style: K })
|
|
212
213
|
}
|
|
213
214
|
)
|
|
214
215
|
] })
|
|
215
216
|
] }),
|
|
216
217
|
/* @__PURE__ */ r("div", { className: "dc:flex-1 dc:min-h-0", children: /* @__PURE__ */ r(
|
|
217
|
-
|
|
218
|
+
ae,
|
|
218
219
|
{
|
|
219
220
|
query: t.query,
|
|
220
221
|
chartType: t.chartType,
|
|
@@ -222,11 +223,11 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
222
223
|
displayConfig: t.displayConfig,
|
|
223
224
|
height: 400,
|
|
224
225
|
eagerLoad: !0,
|
|
225
|
-
onDebugDataReady:
|
|
226
|
+
onDebugDataReady: m
|
|
226
227
|
}
|
|
227
228
|
) })
|
|
228
229
|
] });
|
|
229
|
-
}),
|
|
230
|
+
}), Me = {
|
|
230
231
|
overrides: {
|
|
231
232
|
h1: { props: { className: "dc:text-lg dc:font-bold text-dc-text dc:mb-2 dc:mt-3" } },
|
|
232
233
|
h2: { props: { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
|
|
@@ -247,7 +248,7 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
247
248
|
td: { props: { className: "dc:px-3 dc:py-2 dc:text-sm text-dc-text border-dc-border dc:border-b" } },
|
|
248
249
|
tr: { props: { className: "dc:hover:opacity-80" } }
|
|
249
250
|
}
|
|
250
|
-
},
|
|
251
|
+
}, Ie = Q.memo(function({
|
|
251
252
|
block: t,
|
|
252
253
|
onRemove: s,
|
|
253
254
|
onMoveUp: c,
|
|
@@ -255,8 +256,8 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
255
256
|
isFirst: n,
|
|
256
257
|
isLast: o
|
|
257
258
|
}) {
|
|
258
|
-
return /* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ x("div", { className: "dc:group dc:relative dc:mb-4", children: [
|
|
260
|
+
/* @__PURE__ */ x("div", { className: "dc:absolute dc:right-2 dc:top-2 dc:z-10 dc:flex dc:gap-1 dc:opacity-0 dc:group-hover:opacity-100 dc:transition-opacity", children: [
|
|
260
261
|
!n && /* @__PURE__ */ r(
|
|
261
262
|
"button",
|
|
262
263
|
{
|
|
@@ -286,66 +287,66 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
286
287
|
)
|
|
287
288
|
] }),
|
|
288
289
|
t.title && /* @__PURE__ */ r("h4", { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2 dc:px-1", children: t.title }),
|
|
289
|
-
/* @__PURE__ */ r("div", { className: "dc:rounded-lg dc:p-4 bg-dc-surface border-dc-border dc:border", children: /* @__PURE__ */ r(
|
|
290
|
+
/* @__PURE__ */ r("div", { className: "dc:rounded-lg dc:p-4 bg-dc-surface border-dc-border dc:border", children: /* @__PURE__ */ r(he, { options: Me, children: t.content }) })
|
|
290
291
|
] });
|
|
291
|
-
}),
|
|
292
|
-
const t =
|
|
292
|
+
}), Ee = Q.memo(function() {
|
|
293
|
+
const t = A(ve), { removeBlock: s, moveBlock: c, updateBlock: a } = A(O(Ne)), n = C(null), [o, l] = j(null), d = C(t.length);
|
|
293
294
|
P(() => {
|
|
294
|
-
t.length >
|
|
295
|
+
t.length > d.current && n.current?.scrollIntoView({ behavior: "smooth" }), d.current = t.length;
|
|
295
296
|
}, [t.length]);
|
|
296
|
-
const
|
|
297
|
+
const w = g((p) => s(p), [s]), m = g((p) => c(p, "up"), [c]), k = g((p) => c(p, "down"), [c]), h = g((p) => l(p), []), N = g((p) => {
|
|
297
298
|
if (!o) return;
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
299
|
+
const i = ce(p), { analysisConfig: f } = i;
|
|
300
|
+
if (f) {
|
|
301
|
+
const b = f.charts[f.analysisType];
|
|
301
302
|
a(o.id, {
|
|
302
|
-
title:
|
|
303
|
-
query: JSON.stringify(
|
|
304
|
-
chartType:
|
|
305
|
-
chartConfig:
|
|
306
|
-
displayConfig:
|
|
303
|
+
title: p.title,
|
|
304
|
+
query: JSON.stringify(f.query),
|
|
305
|
+
chartType: b?.chartType || "bar",
|
|
306
|
+
chartConfig: b?.chartConfig,
|
|
307
|
+
displayConfig: b?.displayConfig
|
|
307
308
|
});
|
|
308
309
|
}
|
|
309
310
|
l(null);
|
|
310
311
|
}, [o, a]);
|
|
311
|
-
return t.length === 0 ? /* @__PURE__ */ r("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */
|
|
312
|
+
return t.length === 0 ? /* @__PURE__ */ r("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ x("div", { className: "dc:text-center dc:max-w-sm dc:px-6", children: [
|
|
312
313
|
/* @__PURE__ */ r("h3", { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2", children: "Your notebook is empty" }),
|
|
313
314
|
/* @__PURE__ */ r("p", { className: "dc:text-sm text-dc-text-secondary", children: "Ask the AI assistant a question about your data. Charts and insights will appear here as the assistant analyzes your data." })
|
|
314
|
-
] }) }) : /* @__PURE__ */
|
|
315
|
-
t.map((
|
|
316
|
-
const
|
|
317
|
-
return
|
|
318
|
-
|
|
315
|
+
] }) }) : /* @__PURE__ */ x("div", { className: "dc:h-full dc:overflow-y-auto dc:p-4", children: [
|
|
316
|
+
t.map((p, i) => {
|
|
317
|
+
const f = i === 0, b = i === t.length - 1;
|
|
318
|
+
return p.type === "portlet" ? /* @__PURE__ */ r(
|
|
319
|
+
Te,
|
|
319
320
|
{
|
|
320
|
-
block:
|
|
321
|
-
onRemove:
|
|
322
|
-
onMoveUp:
|
|
323
|
-
onMoveDown:
|
|
324
|
-
onEdit:
|
|
325
|
-
isFirst:
|
|
326
|
-
isLast:
|
|
321
|
+
block: p,
|
|
322
|
+
onRemove: w,
|
|
323
|
+
onMoveUp: m,
|
|
324
|
+
onMoveDown: k,
|
|
325
|
+
onEdit: h,
|
|
326
|
+
isFirst: f,
|
|
327
|
+
isLast: b
|
|
327
328
|
},
|
|
328
|
-
|
|
329
|
-
) :
|
|
330
|
-
|
|
329
|
+
p.id
|
|
330
|
+
) : p.type === "markdown" ? /* @__PURE__ */ r(
|
|
331
|
+
Ie,
|
|
331
332
|
{
|
|
332
|
-
block:
|
|
333
|
-
onRemove:
|
|
334
|
-
onMoveUp:
|
|
335
|
-
onMoveDown:
|
|
336
|
-
isFirst:
|
|
337
|
-
isLast:
|
|
333
|
+
block: p,
|
|
334
|
+
onRemove: w,
|
|
335
|
+
onMoveUp: m,
|
|
336
|
+
onMoveDown: k,
|
|
337
|
+
isFirst: f,
|
|
338
|
+
isLast: b
|
|
338
339
|
},
|
|
339
|
-
|
|
340
|
+
p.id
|
|
340
341
|
) : null;
|
|
341
342
|
}),
|
|
342
343
|
/* @__PURE__ */ r("div", { ref: n }),
|
|
343
344
|
/* @__PURE__ */ r(
|
|
344
|
-
|
|
345
|
+
ne,
|
|
345
346
|
{
|
|
346
347
|
isOpen: !!o,
|
|
347
348
|
onClose: () => l(null),
|
|
348
|
-
onSave:
|
|
349
|
+
onSave: N,
|
|
349
350
|
portlet: o ? {
|
|
350
351
|
id: o.id,
|
|
351
352
|
title: o.title,
|
|
@@ -364,7 +365,7 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
|
|
|
364
365
|
)
|
|
365
366
|
] });
|
|
366
367
|
});
|
|
367
|
-
function
|
|
368
|
+
function Re(e) {
|
|
368
369
|
if (e.startsWith("{") || e.includes('"type":"error"'))
|
|
369
370
|
try {
|
|
370
371
|
const t = JSON.parse(e.replace(/^Error:\s*/, "")), s = t.error?.type || t.type || "";
|
|
@@ -383,144 +384,140 @@ function ke(e) {
|
|
|
383
384
|
}
|
|
384
385
|
return e;
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
-
const {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
onToolStart: o,
|
|
394
|
-
onToolResult: l,
|
|
395
|
-
onTurnComplete: i,
|
|
396
|
-
onDone: g,
|
|
397
|
-
onError: b
|
|
398
|
-
} = e, { cubeApi: v } = ne(), m = N(null), [A, d] = _(!1), C = f(async (k, D) => {
|
|
399
|
-
function I(h) {
|
|
400
|
-
switch (h.type) {
|
|
387
|
+
function Be(e) {
|
|
388
|
+
const { agentEndpoint: t, agentApiKey: s } = e, { cubeApi: c } = fe(), a = C(null), [n, o] = j(!1), l = C(e);
|
|
389
|
+
l.current = e;
|
|
390
|
+
const d = g(async (m, k, h) => {
|
|
391
|
+
function N(i) {
|
|
392
|
+
const f = l.current;
|
|
393
|
+
switch (i.type) {
|
|
401
394
|
case "text_delta":
|
|
402
|
-
|
|
395
|
+
f.onTextDelta(i.data);
|
|
403
396
|
break;
|
|
404
397
|
case "tool_use_start":
|
|
405
|
-
|
|
398
|
+
f.onToolStart(i.data.id, i.data.name, i.data.input);
|
|
406
399
|
break;
|
|
407
400
|
case "tool_use_result":
|
|
408
|
-
|
|
401
|
+
f.onToolResult(i.data.id, i.data.name, i.data.result, i.data.isError);
|
|
409
402
|
break;
|
|
410
403
|
case "add_portlet":
|
|
411
|
-
|
|
412
|
-
...
|
|
404
|
+
f.onAddPortlet({
|
|
405
|
+
...i.data,
|
|
413
406
|
type: "portlet"
|
|
414
407
|
});
|
|
415
408
|
break;
|
|
416
409
|
case "add_markdown":
|
|
417
|
-
|
|
418
|
-
...
|
|
410
|
+
f.onAddMarkdown({
|
|
411
|
+
...i.data,
|
|
419
412
|
type: "markdown"
|
|
420
413
|
});
|
|
421
414
|
break;
|
|
415
|
+
case "dashboard_saved":
|
|
416
|
+
f.onDashboardSaved?.(i.data);
|
|
417
|
+
break;
|
|
422
418
|
case "turn_complete":
|
|
423
|
-
|
|
419
|
+
f.onTurnComplete?.();
|
|
424
420
|
break;
|
|
425
421
|
case "done":
|
|
426
|
-
|
|
422
|
+
f.onDone(i.data.sessionId);
|
|
427
423
|
break;
|
|
428
424
|
case "error":
|
|
429
|
-
|
|
425
|
+
f.onError(i.data.message);
|
|
430
426
|
break;
|
|
431
427
|
}
|
|
432
428
|
}
|
|
433
|
-
|
|
429
|
+
a.current && a.current.abort();
|
|
434
430
|
const p = new AbortController();
|
|
435
|
-
|
|
431
|
+
a.current = p, o(!0);
|
|
436
432
|
try {
|
|
437
|
-
const
|
|
433
|
+
const i = c.apiUrl || "/cubejs-api/v1", f = t || `${i}/agent/chat`, b = {
|
|
438
434
|
"Content-Type": "application/json",
|
|
439
|
-
...
|
|
435
|
+
...c.headers
|
|
440
436
|
};
|
|
441
|
-
s && (
|
|
442
|
-
const
|
|
437
|
+
s && (b["X-Agent-Api-Key"] = s);
|
|
438
|
+
const v = await fetch(f, {
|
|
443
439
|
method: "POST",
|
|
444
|
-
headers:
|
|
445
|
-
credentials:
|
|
440
|
+
headers: b,
|
|
441
|
+
credentials: c.credentials ?? "include",
|
|
446
442
|
body: JSON.stringify({
|
|
447
|
-
message:
|
|
448
|
-
...
|
|
443
|
+
message: m,
|
|
444
|
+
...k ? { sessionId: k } : {},
|
|
445
|
+
...h && h.length > 0 ? { history: h } : {}
|
|
449
446
|
}),
|
|
450
447
|
signal: p.signal
|
|
451
448
|
});
|
|
452
|
-
if (!
|
|
453
|
-
const
|
|
454
|
-
throw new Error(
|
|
449
|
+
if (!v.ok) {
|
|
450
|
+
const D = await v.json().catch(() => ({}));
|
|
451
|
+
throw new Error(D.error || `Agent request failed: ${v.status}`);
|
|
455
452
|
}
|
|
456
|
-
if (!
|
|
453
|
+
if (!v.body)
|
|
457
454
|
throw new Error("No response body received");
|
|
458
|
-
const
|
|
459
|
-
let
|
|
455
|
+
const S = v.body.getReader(), R = new TextDecoder();
|
|
456
|
+
let T = "";
|
|
460
457
|
for (; ; ) {
|
|
461
|
-
const { done:
|
|
462
|
-
if (
|
|
463
|
-
|
|
464
|
-
const
|
|
458
|
+
const { done: D, value: y } = await S.read();
|
|
459
|
+
if (D) break;
|
|
460
|
+
T += R.decode(y, { stream: !0 });
|
|
461
|
+
const I = T.split(`
|
|
465
462
|
|
|
466
463
|
`);
|
|
467
|
-
|
|
468
|
-
for (const
|
|
469
|
-
const
|
|
464
|
+
T = I.pop() || "";
|
|
465
|
+
for (const L of I) {
|
|
466
|
+
const F = L.trim().split(`
|
|
470
467
|
`);
|
|
471
|
-
for (const
|
|
472
|
-
if (
|
|
468
|
+
for (const B of F)
|
|
469
|
+
if (B.startsWith("data: "))
|
|
473
470
|
try {
|
|
474
|
-
const
|
|
475
|
-
|
|
471
|
+
const M = JSON.parse(B.slice(6));
|
|
472
|
+
N(M);
|
|
476
473
|
} catch {
|
|
477
474
|
}
|
|
478
475
|
}
|
|
479
476
|
}
|
|
480
|
-
if (
|
|
481
|
-
const
|
|
477
|
+
if (T.trim()) {
|
|
478
|
+
const D = T.trim().split(`
|
|
482
479
|
`);
|
|
483
|
-
for (const
|
|
484
|
-
if (
|
|
480
|
+
for (const y of D)
|
|
481
|
+
if (y.startsWith("data: "))
|
|
485
482
|
try {
|
|
486
|
-
const
|
|
487
|
-
I
|
|
483
|
+
const I = JSON.parse(y.slice(6));
|
|
484
|
+
N(I);
|
|
488
485
|
} catch {
|
|
489
486
|
}
|
|
490
487
|
}
|
|
491
|
-
} catch (
|
|
492
|
-
if (
|
|
493
|
-
const
|
|
494
|
-
|
|
488
|
+
} catch (i) {
|
|
489
|
+
if (i.name !== "AbortError") {
|
|
490
|
+
const f = i instanceof Error ? i.message : "Stream failed";
|
|
491
|
+
l.current.onError(Re(f));
|
|
495
492
|
}
|
|
496
493
|
} finally {
|
|
497
|
-
|
|
494
|
+
o(!1), a.current = null;
|
|
498
495
|
}
|
|
499
|
-
}, [
|
|
500
|
-
|
|
496
|
+
}, [c, t, s]), w = g(() => {
|
|
497
|
+
a.current && (a.current.abort(), a.current = null, o(!1));
|
|
501
498
|
}, []);
|
|
502
499
|
return {
|
|
503
|
-
sendMessage:
|
|
504
|
-
isStreaming:
|
|
505
|
-
abort:
|
|
500
|
+
sendMessage: d,
|
|
501
|
+
isStreaming: n,
|
|
502
|
+
abort: w
|
|
506
503
|
};
|
|
507
504
|
}
|
|
508
|
-
function
|
|
505
|
+
function Le(e) {
|
|
509
506
|
const t = [];
|
|
510
507
|
let s = e, c = 0;
|
|
511
508
|
for (; s; ) {
|
|
512
509
|
const a = s.match(/^(.*?)`([^`]+)`(.*)$/);
|
|
513
510
|
if (a) {
|
|
514
|
-
const [, o, l,
|
|
511
|
+
const [, o, l, d] = a;
|
|
515
512
|
o && t.push(/* @__PURE__ */ r("span", { children: o }, c++)), t.push(
|
|
516
513
|
/* @__PURE__ */ r("code", { className: "dc:px-1 dc:py-0.5 dc:rounded dc:text-xs bg-dc-surface dc:font-mono", children: l }, c++)
|
|
517
|
-
), s =
|
|
514
|
+
), s = d;
|
|
518
515
|
continue;
|
|
519
516
|
}
|
|
520
517
|
const n = s.match(/^(.*?)\*\*([^*]+)\*\*(.*)$/);
|
|
521
518
|
if (n) {
|
|
522
|
-
const [, o, l,
|
|
523
|
-
o && t.push(/* @__PURE__ */ r("span", { children: o }, c++)), t.push(/* @__PURE__ */ r("strong", { className: "dc:font-semibold", children: l }, c++)), s =
|
|
519
|
+
const [, o, l, d] = n;
|
|
520
|
+
o && t.push(/* @__PURE__ */ r("span", { children: o }, c++)), t.push(/* @__PURE__ */ r("strong", { className: "dc:font-semibold", children: l }, c++)), s = d;
|
|
524
521
|
continue;
|
|
525
522
|
}
|
|
526
523
|
t.push(/* @__PURE__ */ r("span", { children: s }, c));
|
|
@@ -528,51 +525,60 @@ function we(e) {
|
|
|
528
525
|
}
|
|
529
526
|
return t;
|
|
530
527
|
}
|
|
531
|
-
const
|
|
528
|
+
const Pe = {
|
|
532
529
|
discover_cubes: "Discovering cubes",
|
|
533
530
|
get_cube_metadata: "Reading metadata",
|
|
534
531
|
execute_query: "Executing query",
|
|
535
532
|
add_portlet: "Adding visualization",
|
|
536
533
|
add_markdown: "Adding explanation"
|
|
537
534
|
};
|
|
538
|
-
function
|
|
539
|
-
const [
|
|
540
|
-
return /* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
535
|
+
function Qe({ toolCall: e, loadingComponent: t }) {
|
|
536
|
+
const [s, c] = j(!1), a = Pe[e.name] || e.name, n = e.status === "running";
|
|
537
|
+
return /* @__PURE__ */ x("div", { className: "dc:my-1 dc:text-xs", children: [
|
|
538
|
+
/* @__PURE__ */ x(
|
|
542
539
|
"button",
|
|
543
540
|
{
|
|
544
|
-
onClick: () =>
|
|
541
|
+
onClick: () => c(!s),
|
|
545
542
|
className: "dc:flex dc:items-center dc:gap-1.5 text-dc-text-secondary dc:hover:opacity-80 dc:transition-opacity",
|
|
546
543
|
children: [
|
|
547
|
-
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
|
|
550
|
-
|
|
544
|
+
n ? t ? /* @__PURE__ */ r("span", { className: "dc:inline-flex dc:items-center dc:justify-center dc:h-3 dc:w-3", children: t }) : /* @__PURE__ */ r(ge, { size: "xs" }) : /* @__PURE__ */ r("span", { className: "dc:text-xs", children: e.status === "error" ? "✗" : "✓" }),
|
|
545
|
+
/* @__PURE__ */ x("span", { children: [
|
|
546
|
+
a,
|
|
547
|
+
n ? "..." : ""
|
|
551
548
|
] }),
|
|
552
|
-
!
|
|
549
|
+
!n && /* @__PURE__ */ r("span", { className: "dc:text-[10px] dc:opacity-60", children: s ? "▲" : "▼" })
|
|
553
550
|
]
|
|
554
551
|
}
|
|
555
552
|
),
|
|
556
|
-
|
|
553
|
+
s && e.result != null && /* @__PURE__ */ r("pre", { className: "dc:mt-1 dc:p-2 dc:rounded dc:text-[11px] dc:overflow-x-auto dc:max-h-32 dc:overflow-y-auto bg-dc-surface-secondary text-dc-text-secondary", children: typeof e.result == "string" ? e.result : JSON.stringify(e.result, null, 2) })
|
|
557
554
|
] });
|
|
558
555
|
}
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
|
|
556
|
+
const Fe = {
|
|
557
|
+
animation: "dc-msg-in 100ms ease-out"
|
|
558
|
+
}, _e = Q.memo(function({ message: t, loadingComponent: s }) {
|
|
559
|
+
const c = t.role === "user", a = !!t.content?.trim(), n = !!t.error, o = t.toolCalls && t.toolCalls.length > 0;
|
|
560
|
+
return !c && !a && !n && !o ? null : /* @__PURE__ */ r(
|
|
562
561
|
"div",
|
|
563
562
|
{
|
|
564
|
-
className: `dc:
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
563
|
+
className: `dc:flex dc:mb-3 ${c ? "dc:justify-end" : "dc:justify-start"}`,
|
|
564
|
+
style: Fe,
|
|
565
|
+
children: /* @__PURE__ */ x(
|
|
566
|
+
"div",
|
|
567
|
+
{
|
|
568
|
+
className: `dc:max-w-[85%] dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm ${c ? "bg-dc-accent text-dc-accent-text dc:rounded-br-sm" : n && !a ? "bg-dc-warning-bg text-dc-text dc:rounded-bl-sm" : "bg-dc-surface-secondary text-dc-text dc:rounded-bl-sm"}`,
|
|
569
|
+
children: [
|
|
570
|
+
a && /* @__PURE__ */ r("div", { className: "dc:whitespace-pre-wrap dc:break-words", children: c ? t.content : Le(t.content) }),
|
|
571
|
+
n && /* @__PURE__ */ x("div", { className: `dc:flex dc:items-start dc:gap-2 ${a ? "dc:mt-2 dc:pt-2 dc:border-t dc:border-current dc:border-opacity-10" : ""}`, children: [
|
|
572
|
+
/* @__PURE__ */ r("span", { className: "dc:text-base dc:leading-none dc:mt-0.5 text-dc-warning dc:flex-shrink-0", children: "⚠" }),
|
|
573
|
+
/* @__PURE__ */ r("span", { className: "text-dc-text-secondary", children: t.error })
|
|
574
|
+
] }),
|
|
575
|
+
o && /* @__PURE__ */ r("div", { className: a || n ? "dc:mt-1 dc:border-t dc:border-current dc:border-opacity-10 dc:pt-1" : "", children: t.toolCalls.map((l, d) => /* @__PURE__ */ r(Qe, { toolCall: l, loadingComponent: s }, l.id || d)) })
|
|
576
|
+
]
|
|
577
|
+
}
|
|
578
|
+
)
|
|
573
579
|
}
|
|
574
|
-
)
|
|
575
|
-
}),
|
|
580
|
+
);
|
|
581
|
+
}), Ve = Q.memo(function({
|
|
576
582
|
value: t,
|
|
577
583
|
onChange: s,
|
|
578
584
|
onSend: c,
|
|
@@ -580,30 +586,30 @@ const De = R.memo(function({ message: t }) {
|
|
|
580
586
|
onContinue: n,
|
|
581
587
|
isStreaming: o = !1,
|
|
582
588
|
showContinue: l = !1,
|
|
583
|
-
disabled:
|
|
584
|
-
placeholder:
|
|
589
|
+
disabled: d = !1,
|
|
590
|
+
placeholder: w = "Ask about your data..."
|
|
585
591
|
}) {
|
|
586
|
-
const
|
|
592
|
+
const m = C(null);
|
|
587
593
|
P(() => {
|
|
588
|
-
const
|
|
589
|
-
|
|
594
|
+
const h = m.current;
|
|
595
|
+
h && (h.style.height = "auto", h.style.height = `${Math.min(h.scrollHeight, 150)}px`);
|
|
590
596
|
}, [t]);
|
|
591
|
-
const
|
|
592
|
-
(
|
|
593
|
-
|
|
597
|
+
const k = g(
|
|
598
|
+
(h) => {
|
|
599
|
+
h.key === "Enter" && !h.shiftKey && (h.preventDefault(), !d && t.trim() && c());
|
|
594
600
|
},
|
|
595
|
-
[
|
|
601
|
+
[d, t, c]
|
|
596
602
|
);
|
|
597
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ x("div", { className: "dc:flex dc:gap-2 dc:items-end dc:p-3 border-dc-border dc:border-t", children: [
|
|
598
604
|
/* @__PURE__ */ r(
|
|
599
605
|
"textarea",
|
|
600
606
|
{
|
|
601
|
-
ref:
|
|
607
|
+
ref: m,
|
|
602
608
|
value: t,
|
|
603
|
-
onChange: (
|
|
604
|
-
onKeyDown:
|
|
605
|
-
placeholder:
|
|
606
|
-
disabled:
|
|
609
|
+
onChange: (h) => s(h.target.value),
|
|
610
|
+
onKeyDown: k,
|
|
611
|
+
placeholder: w,
|
|
612
|
+
disabled: d,
|
|
607
613
|
rows: 1,
|
|
608
614
|
className: "dc:flex-1 dc:resize-none dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm bg-dc-surface-secondary text-dc-text border-dc-border dc:border dc:outline-none dc:focus:ring-1 focus:ring-dc-accent dc:disabled:opacity-50"
|
|
609
615
|
}
|
|
@@ -615,12 +621,12 @@ const De = R.memo(function({ message: t }) {
|
|
|
615
621
|
className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors text-dc-error border-dc-border dc:border dc:hover:opacity-80 dc:shrink-0",
|
|
616
622
|
children: "Stop"
|
|
617
623
|
}
|
|
618
|
-
) : /* @__PURE__ */
|
|
624
|
+
) : /* @__PURE__ */ x(oe, { children: [
|
|
619
625
|
l && !t.trim() && /* @__PURE__ */ r(
|
|
620
626
|
"button",
|
|
621
627
|
{
|
|
622
628
|
onClick: () => {
|
|
623
|
-
n?.(),
|
|
629
|
+
n?.(), m.current?.focus();
|
|
624
630
|
},
|
|
625
631
|
className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors border-dc-border dc:border text-dc-text-secondary dc:hover:opacity-80 dc:shrink-0",
|
|
626
632
|
children: "Continue"
|
|
@@ -630,212 +636,267 @@ const De = R.memo(function({ message: t }) {
|
|
|
630
636
|
"button",
|
|
631
637
|
{
|
|
632
638
|
onClick: c,
|
|
633
|
-
disabled:
|
|
639
|
+
disabled: d || !t.trim(),
|
|
634
640
|
className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors bg-dc-accent text-dc-accent-text dc:hover:opacity-90 dc:disabled:opacity-40 dc:disabled:cursor-not-allowed dc:shrink-0",
|
|
635
641
|
children: "Send"
|
|
636
642
|
}
|
|
637
643
|
)
|
|
638
644
|
] })
|
|
639
645
|
] });
|
|
640
|
-
}),
|
|
646
|
+
}), je = Q.memo(function({
|
|
641
647
|
agentEndpoint: t,
|
|
642
648
|
agentApiKey: s,
|
|
643
|
-
onClear: c
|
|
649
|
+
onClear: c,
|
|
650
|
+
onDashboardSaved: a,
|
|
651
|
+
loadingComponent: n,
|
|
652
|
+
initialPrompt: o
|
|
644
653
|
}) {
|
|
645
|
-
const
|
|
646
|
-
addMessage:
|
|
647
|
-
appendToLastAssistantMessage:
|
|
648
|
-
setLastAssistantError:
|
|
649
|
-
addToolCallToLastAssistant:
|
|
650
|
-
updateLastToolCall:
|
|
651
|
-
setIsStreaming:
|
|
652
|
-
setInputValue:
|
|
653
|
-
setSessionId:
|
|
654
|
-
} =
|
|
655
|
-
|
|
654
|
+
const l = C(null), d = C(!1), w = C(!1), { messages: m, isStreaming: k, inputValue: h } = A(O(Ce)), {
|
|
655
|
+
addMessage: N,
|
|
656
|
+
appendToLastAssistantMessage: p,
|
|
657
|
+
setLastAssistantError: i,
|
|
658
|
+
addToolCallToLastAssistant: f,
|
|
659
|
+
updateLastToolCall: b,
|
|
660
|
+
setIsStreaming: v,
|
|
661
|
+
setInputValue: S,
|
|
662
|
+
setSessionId: R
|
|
663
|
+
} = A(O(ke)), T = A((u) => u.sessionId), D = A((u) => u.addBlock), y = A((u) => u.reset), I = A((u) => u.blocks.filter((V) => V.type === "portlet").length), L = C(m);
|
|
664
|
+
L.current = m;
|
|
665
|
+
const F = C(k);
|
|
666
|
+
F.current = k;
|
|
667
|
+
const B = C(T);
|
|
668
|
+
B.current = T;
|
|
669
|
+
const M = g(() => {
|
|
670
|
+
w.current && (w.current = !1, N({
|
|
656
671
|
id: `msg-${Date.now()}`,
|
|
657
672
|
role: "assistant",
|
|
658
673
|
content: "",
|
|
659
674
|
toolCalls: [],
|
|
660
675
|
timestamp: Date.now()
|
|
661
676
|
}));
|
|
662
|
-
}, [
|
|
677
|
+
}, [N]), $ = C(m.length);
|
|
663
678
|
P(() => {
|
|
664
|
-
|
|
665
|
-
}, [
|
|
666
|
-
const { sendMessage:
|
|
679
|
+
m.length > $.current && l.current?.scrollIntoView({ behavior: "smooth" }), $.current = m.length;
|
|
680
|
+
}, [m]);
|
|
681
|
+
const { sendMessage: z, abort: U } = Be({
|
|
667
682
|
agentEndpoint: t,
|
|
668
683
|
agentApiKey: s,
|
|
669
|
-
onTextDelta:
|
|
670
|
-
|
|
671
|
-
}, [
|
|
672
|
-
onToolStart:
|
|
673
|
-
|
|
674
|
-
}, [
|
|
675
|
-
onToolResult:
|
|
676
|
-
|
|
677
|
-
}, [
|
|
678
|
-
onAddPortlet:
|
|
684
|
+
onTextDelta: g((u) => {
|
|
685
|
+
M(), p(u);
|
|
686
|
+
}, [M, p]),
|
|
687
|
+
onToolStart: g((u, V, E) => {
|
|
688
|
+
M(), f({ id: u, name: V, input: E, status: "running" });
|
|
689
|
+
}, [M, f]),
|
|
690
|
+
onToolResult: g((u, V, E, se) => {
|
|
691
|
+
b({ id: u, status: se ? "error" : "complete", result: E });
|
|
692
|
+
}, [b]),
|
|
693
|
+
onAddPortlet: g((u) => {
|
|
679
694
|
D(u);
|
|
680
695
|
}, [D]),
|
|
681
|
-
onAddMarkdown:
|
|
696
|
+
onAddMarkdown: g((u) => {
|
|
682
697
|
D(u);
|
|
683
698
|
}, [D]),
|
|
684
|
-
|
|
685
|
-
|
|
699
|
+
onDashboardSaved: a,
|
|
700
|
+
onTurnComplete: g(() => {
|
|
701
|
+
w.current = !0;
|
|
686
702
|
}, []),
|
|
687
|
-
onDone:
|
|
688
|
-
|
|
689
|
-
}, [
|
|
690
|
-
onError:
|
|
691
|
-
|
|
692
|
-
}, [
|
|
693
|
-
}),
|
|
694
|
-
!u ||
|
|
703
|
+
onDone: g((u) => {
|
|
704
|
+
w.current = !1, R(u), v(!1);
|
|
705
|
+
}, [R, v]),
|
|
706
|
+
onError: g((u) => {
|
|
707
|
+
M(), i(u), v(!1);
|
|
708
|
+
}, [M, i, v])
|
|
709
|
+
}), _ = g((u) => {
|
|
710
|
+
if (!u || F.current) return;
|
|
711
|
+
w.current = !1;
|
|
712
|
+
const V = L.current.map((E) => ({
|
|
713
|
+
role: E.role,
|
|
714
|
+
content: E.content,
|
|
715
|
+
...E.toolCalls && E.toolCalls.length > 0 ? { toolCalls: E.toolCalls } : {}
|
|
716
|
+
}));
|
|
717
|
+
N({
|
|
695
718
|
id: `msg-${Date.now()}`,
|
|
696
719
|
role: "user",
|
|
697
720
|
content: u,
|
|
698
721
|
timestamp: Date.now()
|
|
699
|
-
}),
|
|
722
|
+
}), N({
|
|
700
723
|
id: `msg-${Date.now() + 1}`,
|
|
701
724
|
role: "assistant",
|
|
702
725
|
content: "",
|
|
703
726
|
toolCalls: [],
|
|
704
727
|
timestamp: Date.now()
|
|
705
|
-
}),
|
|
706
|
-
}, [
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
728
|
+
}), S(""), v(!0), z(u, B.current, V);
|
|
729
|
+
}, [N, S, v, z]);
|
|
730
|
+
P(() => {
|
|
731
|
+
if (o && !d.current && m.length === 0) {
|
|
732
|
+
d.current = !0;
|
|
733
|
+
const u = setTimeout(() => _(o), 100);
|
|
734
|
+
return () => clearTimeout(u);
|
|
735
|
+
}
|
|
736
|
+
}, [o, m.length, _]);
|
|
737
|
+
const W = C(h);
|
|
738
|
+
W.current = h;
|
|
739
|
+
const H = g(() => {
|
|
740
|
+
_(W.current.trim());
|
|
741
|
+
}, [_]), X = g(() => {
|
|
742
|
+
U(), v(!1);
|
|
743
|
+
}, [U, v]), Y = g(() => {
|
|
744
|
+
S("");
|
|
745
|
+
}, [S]), Z = g(() => {
|
|
746
|
+
U(), v(!1), y(), c?.();
|
|
747
|
+
}, [U, v, y, c]), ee = g(() => {
|
|
748
|
+
_(
|
|
749
|
+
"Save the current notebook as a dashboard with a professional layout, section headers, and appropriate filters."
|
|
750
|
+
);
|
|
751
|
+
}, [_]), te = !!a && !k && I > 0 && m.length > 0;
|
|
752
|
+
return /* @__PURE__ */ x("div", { className: "dc:flex dc:flex-col dc:h-full bg-dc-surface", children: [
|
|
753
|
+
/* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-4 dc:py-3 border-dc-border dc:border-b", children: [
|
|
717
754
|
/* @__PURE__ */ r("h3", { className: "dc:text-sm dc:font-semibold text-dc-text", children: "AI Assistant" }),
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
755
|
+
/* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:gap-1", children: [
|
|
756
|
+
te && /* @__PURE__ */ r(
|
|
757
|
+
"button",
|
|
758
|
+
{
|
|
759
|
+
onClick: ee,
|
|
760
|
+
className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-accent dc:hover:opacity-80",
|
|
761
|
+
title: "Save notebook as a dashboard",
|
|
762
|
+
children: "Save as Dashboard"
|
|
763
|
+
}
|
|
764
|
+
),
|
|
765
|
+
m.length > 0 && /* @__PURE__ */ r(
|
|
766
|
+
"button",
|
|
767
|
+
{
|
|
768
|
+
onClick: Z,
|
|
769
|
+
disabled: k,
|
|
770
|
+
className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-text-secondary dc:hover:opacity-80 dc:disabled:opacity-40",
|
|
771
|
+
title: "Clear notebook and chat",
|
|
772
|
+
children: "Clear"
|
|
773
|
+
}
|
|
774
|
+
)
|
|
775
|
+
] })
|
|
728
776
|
] }),
|
|
729
|
-
/* @__PURE__ */
|
|
730
|
-
|
|
731
|
-
|
|
777
|
+
/* @__PURE__ */ x("div", { className: "dc:flex-1 dc:overflow-y-auto dc:px-4 dc:py-3", children: [
|
|
778
|
+
m.length === 0 ? /* @__PURE__ */ r(qe, {}) : m.map((u) => /* @__PURE__ */ r(
|
|
779
|
+
_e,
|
|
780
|
+
{
|
|
781
|
+
message: u,
|
|
782
|
+
loadingComponent: n
|
|
783
|
+
},
|
|
784
|
+
u.id
|
|
785
|
+
)),
|
|
786
|
+
/* @__PURE__ */ r("div", { ref: l })
|
|
732
787
|
] }),
|
|
733
788
|
/* @__PURE__ */ r(
|
|
734
|
-
|
|
789
|
+
Ve,
|
|
735
790
|
{
|
|
736
|
-
value:
|
|
737
|
-
onChange:
|
|
738
|
-
onSend:
|
|
739
|
-
onStop:
|
|
740
|
-
onContinue:
|
|
741
|
-
isStreaming:
|
|
742
|
-
showContinue: !
|
|
791
|
+
value: h,
|
|
792
|
+
onChange: S,
|
|
793
|
+
onSend: H,
|
|
794
|
+
onStop: X,
|
|
795
|
+
onContinue: Y,
|
|
796
|
+
isStreaming: k,
|
|
797
|
+
showContinue: !k && m.length > 0
|
|
743
798
|
}
|
|
744
799
|
)
|
|
745
800
|
] });
|
|
746
801
|
});
|
|
747
|
-
function
|
|
748
|
-
return /* @__PURE__ */ r("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */
|
|
802
|
+
function qe() {
|
|
803
|
+
return /* @__PURE__ */ r("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ x("div", { className: "dc:text-center dc:max-w-xs", children: [
|
|
749
804
|
/* @__PURE__ */ r("div", { className: "dc:text-lg dc:font-semibold text-dc-text dc:mb-2", children: "Data Analysis Assistant" }),
|
|
750
805
|
/* @__PURE__ */ r("p", { className: "dc:text-sm text-dc-text-secondary dc:mb-4", children: "Ask me about your data and I'll create visualizations and insights." }),
|
|
751
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ x("div", { className: "dc:space-y-2 dc:text-xs text-dc-text-muted", children: [
|
|
752
807
|
/* @__PURE__ */ r("p", { children: '"Show me employee productivity trends"' }),
|
|
753
808
|
/* @__PURE__ */ r("p", { children: '"What are the top departments by headcount?"' }),
|
|
754
809
|
/* @__PURE__ */ r("p", { children: '"Compare revenue across product categories"' })
|
|
755
810
|
] })
|
|
756
811
|
] }) });
|
|
757
812
|
}
|
|
758
|
-
function
|
|
813
|
+
function Ue({
|
|
759
814
|
agentEndpoint: e,
|
|
760
815
|
agentApiKey: t,
|
|
761
816
|
onSave: s,
|
|
762
817
|
onDirtyStateChange: c,
|
|
763
|
-
|
|
818
|
+
onDashboardSaved: a,
|
|
819
|
+
loadingComponent: n,
|
|
820
|
+
className: o,
|
|
821
|
+
initialPrompt: l
|
|
764
822
|
}) {
|
|
765
|
-
const [
|
|
823
|
+
const [d, w] = j(60), m = C(null), k = C(!1), h = A((y) => y.blocks.length), N = A((y) => y.messages.length), p = A((y) => y.isStreaming), i = A((y) => y.save), f = C({ blockCount: h, msgCount: N });
|
|
766
824
|
P(() => {
|
|
767
|
-
const
|
|
768
|
-
c?.(
|
|
769
|
-
}, [
|
|
770
|
-
const
|
|
771
|
-
|
|
772
|
-
const
|
|
825
|
+
const y = h !== f.current.blockCount || N !== f.current.msgCount;
|
|
826
|
+
c?.(y);
|
|
827
|
+
}, [h, N, c]);
|
|
828
|
+
const b = C(), v = C(!1), S = C(s);
|
|
829
|
+
S.current = s;
|
|
830
|
+
const R = C(h > 0 || N > 0);
|
|
773
831
|
P(() => {
|
|
774
|
-
if ((
|
|
775
|
-
if (
|
|
776
|
-
|
|
832
|
+
if ((h > 0 || N > 0) && (R.current = !0), !(!S.current || !R.current)) {
|
|
833
|
+
if (p) {
|
|
834
|
+
v.current = !0, b.current && clearTimeout(b.current);
|
|
777
835
|
return;
|
|
778
836
|
}
|
|
779
|
-
return
|
|
780
|
-
|
|
781
|
-
const
|
|
782
|
-
|
|
837
|
+
return b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
838
|
+
v.current = !1;
|
|
839
|
+
const y = i();
|
|
840
|
+
S.current?.(y);
|
|
783
841
|
}, 1e3), () => {
|
|
784
|
-
|
|
842
|
+
b.current && clearTimeout(b.current);
|
|
785
843
|
};
|
|
786
844
|
}
|
|
787
|
-
}, [
|
|
788
|
-
!
|
|
789
|
-
|
|
790
|
-
const
|
|
791
|
-
|
|
845
|
+
}, [h, N, p, i]), P(() => {
|
|
846
|
+
!p && v.current && S.current && R.current && (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
847
|
+
v.current = !1;
|
|
848
|
+
const y = i();
|
|
849
|
+
S.current?.(y);
|
|
792
850
|
}, 1e3));
|
|
793
|
-
}, [
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
}, []),
|
|
797
|
-
|
|
798
|
-
const
|
|
799
|
-
if (!
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
},
|
|
803
|
-
|
|
851
|
+
}, [p, i]);
|
|
852
|
+
const T = g(() => {
|
|
853
|
+
S.current && (b.current && clearTimeout(b.current), S.current({ blocks: [], messages: [] }));
|
|
854
|
+
}, []), D = g((y) => {
|
|
855
|
+
y.preventDefault(), k.current = !0;
|
|
856
|
+
const I = (F) => {
|
|
857
|
+
if (!k.current || !m.current) return;
|
|
858
|
+
const B = m.current.getBoundingClientRect(), M = (F.clientX - B.left) / B.width * 100;
|
|
859
|
+
w(Math.min(Math.max(M, 30), 80));
|
|
860
|
+
}, L = () => {
|
|
861
|
+
k.current = !1, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", L);
|
|
804
862
|
};
|
|
805
|
-
document.addEventListener("mousemove",
|
|
863
|
+
document.addEventListener("mousemove", I), document.addEventListener("mouseup", L);
|
|
806
864
|
}, []);
|
|
807
|
-
return /* @__PURE__ */
|
|
865
|
+
return /* @__PURE__ */ x(
|
|
808
866
|
"div",
|
|
809
867
|
{
|
|
810
|
-
ref:
|
|
811
|
-
className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${
|
|
868
|
+
ref: m,
|
|
869
|
+
className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${o || ""}`,
|
|
812
870
|
children: [
|
|
813
871
|
/* @__PURE__ */ r(
|
|
814
872
|
"div",
|
|
815
873
|
{
|
|
816
874
|
className: "dc:h-full dc:overflow-hidden",
|
|
817
|
-
style: { width: `${
|
|
818
|
-
children: /* @__PURE__ */ r(
|
|
875
|
+
style: { width: `${d}%` },
|
|
876
|
+
children: /* @__PURE__ */ r(Ee, {})
|
|
819
877
|
}
|
|
820
878
|
),
|
|
821
879
|
/* @__PURE__ */ r(
|
|
822
880
|
"div",
|
|
823
881
|
{
|
|
824
882
|
className: "dc:w-1 dc:h-full dc:cursor-col-resize dc:flex-shrink-0 dc:transition-colors bg-dc-border dc:hover:bg-dc-accent",
|
|
825
|
-
onMouseDown:
|
|
883
|
+
onMouseDown: D
|
|
826
884
|
}
|
|
827
885
|
),
|
|
828
886
|
/* @__PURE__ */ r(
|
|
829
887
|
"div",
|
|
830
888
|
{
|
|
831
889
|
className: "dc:h-full dc:overflow-hidden",
|
|
832
|
-
style: { width: `${100 -
|
|
890
|
+
style: { width: `${100 - d}%` },
|
|
833
891
|
children: /* @__PURE__ */ r(
|
|
834
|
-
|
|
892
|
+
je,
|
|
835
893
|
{
|
|
836
894
|
agentEndpoint: e,
|
|
837
895
|
agentApiKey: t,
|
|
838
|
-
onClear:
|
|
896
|
+
onClear: T,
|
|
897
|
+
onDashboardSaved: a,
|
|
898
|
+
loadingComponent: n,
|
|
899
|
+
initialPrompt: l
|
|
839
900
|
}
|
|
840
901
|
)
|
|
841
902
|
}
|
|
@@ -844,26 +905,26 @@ function Ee({
|
|
|
844
905
|
}
|
|
845
906
|
);
|
|
846
907
|
}
|
|
847
|
-
const
|
|
908
|
+
const st = Q.memo(function({
|
|
848
909
|
config: t,
|
|
849
910
|
...s
|
|
850
911
|
}) {
|
|
851
|
-
return /* @__PURE__ */ r(
|
|
912
|
+
return /* @__PURE__ */ r(xe, { initialConfig: t, children: /* @__PURE__ */ r(Ue, { ...s }) });
|
|
852
913
|
});
|
|
853
|
-
function
|
|
914
|
+
function rt() {
|
|
854
915
|
return /* @__PURE__ */ r("div", { children: "Analytics Page - Coming in Phase 4" });
|
|
855
916
|
}
|
|
856
|
-
const
|
|
857
|
-
function
|
|
917
|
+
const Ke = q("segment");
|
|
918
|
+
function at({
|
|
858
919
|
className: e = ""
|
|
859
920
|
}) {
|
|
860
921
|
return /* @__PURE__ */ r(
|
|
861
922
|
"div",
|
|
862
923
|
{
|
|
863
924
|
className: `dc:flex dc:items-center dc:justify-center bg-dc-bg-secondary ${e}`,
|
|
864
|
-
children: /* @__PURE__ */
|
|
925
|
+
children: /* @__PURE__ */ x("div", { className: "dc:text-center", children: [
|
|
865
926
|
/* @__PURE__ */ r(
|
|
866
|
-
|
|
927
|
+
Ke,
|
|
867
928
|
{
|
|
868
929
|
className: "dc:w-8 dc:h-8 dc:mx-auto dc:mb-2 text-dc-text-muted dc:opacity-50"
|
|
869
930
|
}
|
|
@@ -874,178 +935,178 @@ function ze({
|
|
|
874
935
|
);
|
|
875
936
|
}
|
|
876
937
|
export {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
938
|
+
st as AgenticNotebook,
|
|
939
|
+
ot as AnalysisBuilder,
|
|
940
|
+
dt as AnalyticsDashboard,
|
|
941
|
+
rt as AnalyticsPage,
|
|
942
|
+
ae as AnalyticsPortlet,
|
|
943
|
+
it as ChartErrorBoundary,
|
|
944
|
+
lt as ConfirmModal,
|
|
945
|
+
ps as CubeClient,
|
|
946
|
+
hs as CubeProvider,
|
|
947
|
+
ss as DEFAULT_ICONS,
|
|
948
|
+
ut as DashboardEditModal,
|
|
949
|
+
mt as DashboardGrid,
|
|
950
|
+
pt as DashboardStoreProvider,
|
|
951
|
+
at as DashboardThumbnailPlaceholder,
|
|
952
|
+
ht as DrillBreadcrumb,
|
|
953
|
+
ft as DrillMenu,
|
|
954
|
+
Qs as ExecutionPlanPanel,
|
|
955
|
+
Fs as ExplainAIPanel,
|
|
956
|
+
Ts as LazyChart,
|
|
957
|
+
ge as LoadingIndicator,
|
|
958
|
+
gt as Modal,
|
|
959
|
+
xe as NotebookStoreProvider,
|
|
960
|
+
ne as PortletAnalysisModal,
|
|
961
|
+
bt as PortletContainer,
|
|
962
|
+
fs as ScrollContainerProvider,
|
|
963
|
+
Or as THEME_PRESETS,
|
|
964
|
+
$r as applyTheme,
|
|
965
|
+
Qr as buildFunnelConfigFromQueries,
|
|
966
|
+
Fr as buildServerFunnelQuery,
|
|
967
|
+
gs as captureThumbnail,
|
|
968
|
+
_s as compressAndEncode,
|
|
969
|
+
bs as createCubeClient,
|
|
970
|
+
gr as createDashboardLayout,
|
|
971
|
+
yt as createDashboardStore,
|
|
972
|
+
xt as createDefaultConfig,
|
|
973
|
+
vt as createDefaultFlowConfig,
|
|
974
|
+
Ct as createDefaultFunnelConfig,
|
|
975
|
+
kt as createDefaultQueryConfig,
|
|
976
|
+
Nt as createDefaultRetentionConfig,
|
|
977
|
+
wt as createDefaultWorkspace,
|
|
978
|
+
ea as createExplainQueryKey,
|
|
979
|
+
xr as createFlowQueryKey,
|
|
980
|
+
vr as createFunnelQueryKey,
|
|
981
|
+
ye as createNotebookStore,
|
|
982
|
+
Vs as decodeAndDecompress,
|
|
983
|
+
js as detectAsymmetricDateRanges,
|
|
984
|
+
qs as detectMeasureCollisions,
|
|
985
|
+
br as formatChartData,
|
|
986
|
+
_r as formatDuration,
|
|
987
|
+
Cr as generateQueryLabel,
|
|
988
|
+
Us as generateShareUrl,
|
|
989
|
+
Ks as getAvailableBindingKeyDimensions,
|
|
990
|
+
Ms as getAvailableChartTypes,
|
|
991
|
+
Vr as getBindingKeyField,
|
|
992
|
+
Os as getBindingKeyLabel,
|
|
993
|
+
rs as getChartTypeIcon,
|
|
994
|
+
kr as getCombinedFields,
|
|
995
|
+
jr as getCubeNameFromQuery,
|
|
996
|
+
as as getFieldTypeIcon,
|
|
997
|
+
q as getIcon,
|
|
998
|
+
cs as getIconData,
|
|
999
|
+
ns as getIconRegistry,
|
|
1000
|
+
os as getIconsByCategory,
|
|
1001
|
+
ds as getMeasureTypeIcon,
|
|
1002
|
+
Nr as getQueryIndices,
|
|
1003
|
+
wr as getQueryLabels,
|
|
1004
|
+
zr as getTheme,
|
|
1005
|
+
Wr as getThemeVariable,
|
|
1006
|
+
Is as getUnavailableChartTypes,
|
|
1007
|
+
$s as getValidationSummary,
|
|
1008
|
+
la as highlightCodeBlocks,
|
|
1009
|
+
Es as isChartTypeAvailable,
|
|
1010
|
+
Jr as isDarkMode,
|
|
1011
|
+
St as isFlowConfig,
|
|
1012
|
+
Dt as isFunnelConfig,
|
|
1013
|
+
qr as isFunnelData,
|
|
1014
|
+
zs as isMinimumFunnelConfigValid,
|
|
1015
|
+
At as isMultiQuery,
|
|
1016
|
+
Tt as isMultiQueryConfig,
|
|
1017
|
+
Sr as isMultiQueryData,
|
|
1018
|
+
Ws as isMultiQueryValid,
|
|
1019
|
+
Mt as isQueryConfig,
|
|
1020
|
+
It as isRetentionConfig,
|
|
1021
|
+
oa as isSankeyData,
|
|
1022
|
+
da as isServerFlowQuery,
|
|
1023
|
+
Et as isServerFunnelQuery,
|
|
1024
|
+
Js as isShareableSize,
|
|
1025
|
+
Rt as isSingleQuery,
|
|
1026
|
+
ys as isThumbnailCaptureAvailable,
|
|
1027
|
+
Bt as isValidAnalysisConfig,
|
|
1028
|
+
Lt as isValidAnalysisWorkspace,
|
|
1029
|
+
Rs as isValidChartType,
|
|
1030
|
+
Dr as mergeQueryResults,
|
|
1031
|
+
Ar as mergeResultsByKey,
|
|
1032
|
+
Tr as mergeResultsConcat,
|
|
1033
|
+
Pt as migrateConfig,
|
|
1034
|
+
Qt as migrateLegacyPortlet,
|
|
1035
|
+
Gs as parseShareUrl,
|
|
1036
|
+
Bs as preloadChart,
|
|
1037
|
+
Ls as preloadCharts,
|
|
1038
|
+
is as registerIcons,
|
|
1039
|
+
ls as resetIcons,
|
|
1040
|
+
Gr as resetTheme,
|
|
1041
|
+
Ft as selectAllActions,
|
|
1042
|
+
Ne as selectBlockActions,
|
|
1043
|
+
ve as selectBlocks,
|
|
1044
|
+
Hs as selectBreakdowns,
|
|
1045
|
+
Xs as selectChartConfig,
|
|
1046
|
+
ke as selectChatActions,
|
|
1047
|
+
Ce as selectChatState,
|
|
1048
|
+
Ys as selectCurrentState,
|
|
1049
|
+
_t as selectDebugData,
|
|
1050
|
+
Vt as selectDebugDataActions,
|
|
1051
|
+
jt as selectEditModeActions,
|
|
1052
|
+
qt as selectEditModeState,
|
|
1053
|
+
Zs as selectFilters,
|
|
1054
|
+
er as selectFunnelState,
|
|
1055
|
+
tt as selectInputValue,
|
|
1056
|
+
Ze as selectIsStreaming,
|
|
1057
|
+
Ut as selectLayoutActions,
|
|
1058
|
+
Kt as selectLayoutState,
|
|
1059
|
+
Ye as selectMessages,
|
|
1060
|
+
tr as selectMetrics,
|
|
1061
|
+
Ot as selectModalActions,
|
|
1062
|
+
$t as selectModalState,
|
|
1063
|
+
sr as selectMultiQueryState,
|
|
1064
|
+
zt as selectPortletDebugData,
|
|
1065
|
+
et as selectSessionId,
|
|
1066
|
+
Wt as selectThumbnailDirty,
|
|
1067
|
+
rr as selectUIState,
|
|
1068
|
+
us as setIcon,
|
|
1069
|
+
Hr as setTheme,
|
|
1070
|
+
Xr as setThemeVariable,
|
|
1071
|
+
Ur as transformServerFunnelResult,
|
|
1072
|
+
Be as useAgentChat,
|
|
1073
|
+
ar as useAnalysisBuilder,
|
|
1074
|
+
cr as useAnalysisBuilderStore,
|
|
1075
|
+
fe as useCubeApi,
|
|
1076
|
+
xs as useCubeContext,
|
|
1077
|
+
vs as useCubeFeatures,
|
|
1078
|
+
Ds as useCubeFieldLabel,
|
|
1079
|
+
Mr as useCubeLoadQuery,
|
|
1080
|
+
Cs as useCubeMeta,
|
|
1081
|
+
ks as useCubeMetaQuery,
|
|
1082
|
+
Ir as useCubeQuery,
|
|
1083
|
+
Jt as useDashboard,
|
|
1084
|
+
Gt as useDashboardStore,
|
|
1085
|
+
Ht as useDashboardStoreApi,
|
|
1086
|
+
Xt as useDashboardStoreOptional,
|
|
1087
|
+
Yt as useDrillInteraction,
|
|
1088
|
+
ta as useDryRunQueries,
|
|
1089
|
+
sa as useDryRunQuery,
|
|
1090
|
+
Zt as useElementVisibility,
|
|
1091
|
+
ra as useExplainAI,
|
|
1092
|
+
aa as useExplainQuery,
|
|
1093
|
+
Er as useFlowQuery,
|
|
1094
|
+
Rr as useFunnelQuery,
|
|
1095
|
+
Br as useMultiCubeLoadQuery,
|
|
1096
|
+
ca as useMultiDryRunQueries,
|
|
1097
|
+
A as useNotebookStore,
|
|
1098
|
+
Ns as useScrollContainer,
|
|
1099
|
+
es as useScrollDetection,
|
|
1100
|
+
hr as useTheme,
|
|
1101
|
+
nr as validateBindingKeyExists,
|
|
1102
|
+
or as validateBindingKeyForSteps,
|
|
1103
|
+
dr as validateFunnelConfig,
|
|
1104
|
+
Lr as validateMergeKey,
|
|
1105
|
+
ir as validateMergeKeys,
|
|
1106
|
+
lr as validateMultiQueryConfig,
|
|
1107
|
+
ur as validateStepQueries,
|
|
1108
|
+
mr as validateTimeDimensionAlignment,
|
|
1109
|
+
ws as warnIfScreenshotLibMissing,
|
|
1110
|
+
Yr as watchThemeChanges
|
|
1050
1111
|
};
|
|
1051
1112
|
//# sourceMappingURL=index.js.map
|