@aivue/tabular-intelligence 1.3.0 → 1.3.1

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/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { ref as S, defineComponent as z, createElementBlock as h, openBlock as f, createElementVNode as m, createCommentVNode as E, withDirectives as Z, withKeys as V, withModifiers as R, vModelText as ee, toDisplayString as A, normalizeClass as te, createTextVNode as ne, Fragment as O, renderList as Q, computed as se } from "vue";
2
- function N(c, e) {
1
+ import { ref as S, defineComponent as z, createElementBlock as p, openBlock as f, createElementVNode as m, createCommentVNode as q, withDirectives as Z, withKeys as R, withModifiers as V, vModelText as ee, toDisplayString as A, normalizeClass as te, createTextVNode as ne, Fragment as O, renderList as Q, computed as se } from "vue";
2
+ function P(c, e) {
3
3
  if (c.length === 0)
4
4
  return { columns: [], rowCount: 0, name: e };
5
5
  const t = c[0];
@@ -9,7 +9,7 @@ function N(c, e) {
9
9
  return {
10
10
  name: s,
11
11
  type: a,
12
- nullable: c.some((o) => o[s] == null)
12
+ nullable: c.some((r) => r[s] == null)
13
13
  };
14
14
  }),
15
15
  rowCount: c.length,
@@ -28,59 +28,59 @@ function L(c, e) {
28
28
  const n = new Set(t);
29
29
  return n.size < t.length * 0.5 && n.size < 20 ? "categorical" : "string";
30
30
  }
31
- function B(c, e, t) {
32
- const n = c.map((r) => r[e]).filter((r) => r != null), s = n.length, a = c.length - s, o = {
31
+ function H(c, e, t) {
32
+ const n = c.map((o) => o[e]).filter((o) => o != null), s = n.length, a = c.length - s, r = {
33
33
  column: e,
34
34
  count: s,
35
35
  nullCount: a
36
36
  };
37
37
  if (t === "number") {
38
- const r = n.map(Number).filter((i) => !isNaN(i));
39
- if (r.length > 0) {
40
- const i = [...r].sort((p, u) => p - u), l = r.reduce((p, u) => p + u, 0);
41
- o.mean = l / r.length, o.median = i[Math.floor(i.length / 2)], o.min = i[0], o.max = i[i.length - 1];
42
- const g = r.reduce((p, u) => p + Math.pow(u - o.mean, 2), 0) / r.length;
43
- o.std = Math.sqrt(g), o.percentiles = {
38
+ const o = n.map(Number).filter((i) => !isNaN(i));
39
+ if (o.length > 0) {
40
+ const i = [...o].sort((h, u) => h - u), l = o.reduce((h, u) => h + u, 0);
41
+ r.mean = l / o.length, r.median = i[Math.floor(i.length / 2)], r.min = i[0], r.max = i[i.length - 1];
42
+ const g = o.reduce((h, u) => h + Math.pow(u - r.mean, 2), 0) / o.length;
43
+ r.std = Math.sqrt(g), r.percentiles = {
44
44
  25: i[Math.floor(i.length * 0.25)],
45
- 50: o.median,
45
+ 50: r.median,
46
46
  75: i[Math.floor(i.length * 0.75)],
47
47
  90: i[Math.floor(i.length * 0.9)]
48
48
  };
49
49
  }
50
50
  } else {
51
- const r = new Set(n);
52
- o.uniqueValues = r.size;
51
+ const o = new Set(n);
52
+ r.uniqueValues = o.size;
53
53
  const i = {};
54
54
  n.forEach((g) => {
55
- const p = String(g);
56
- i[p] = (i[p] || 0) + 1;
55
+ const h = String(g);
56
+ i[h] = (i[h] || 0) + 1;
57
57
  });
58
58
  const l = Math.max(...Object.values(i));
59
- o.mode = Object.keys(i).find((g) => i[g] === l);
59
+ r.mode = Object.keys(i).find((g) => i[g] === l);
60
60
  }
61
- return o;
61
+ return r;
62
62
  }
63
63
  function ae(c, e, t = 0.5) {
64
64
  const n = [], s = 1.5 + (1 - t) * 1.5;
65
65
  return e.forEach((a) => {
66
- const o = c.map((y, v) => ({ value: Number(y[a]), idx: v })).filter((y) => !isNaN(y.value));
67
- if (o.length === 0) return;
68
- const r = [...o].sort((y, v) => y.value - v.value), i = r[Math.floor(r.length * 0.25)].value, l = r[Math.floor(r.length * 0.75)].value, g = l - i, p = i - s * g, u = l + s * g;
69
- o.forEach(({ value: y, idx: v }) => {
70
- if (y < p || y > u) {
71
- const $ = n.find((D) => D.rowIndex === v), C = y < p ? `${a}: ${y.toFixed(2)} < ${p.toFixed(2)}` : `${a}: ${y.toFixed(2)} > ${u.toFixed(2)}`;
72
- $ ? ($.reasons.push(C), $.affectedColumns.push(a), $.score = Math.min(1, $.score + 0.2)) : n.push({
66
+ const r = c.map((w, v) => ({ value: Number(w[a]), idx: v })).filter((w) => !isNaN(w.value));
67
+ if (r.length === 0) return;
68
+ const o = [...r].sort((w, v) => w.value - v.value), i = o[Math.floor(o.length * 0.25)].value, l = o[Math.floor(o.length * 0.75)].value, g = l - i, h = i - s * g, u = l + s * g;
69
+ r.forEach(({ value: w, idx: v }) => {
70
+ if (w < h || w > u) {
71
+ const $ = n.find((E) => E.rowIndex === v), k = w < h ? `${a}: ${w.toFixed(2)} < ${h.toFixed(2)}` : `${a}: ${w.toFixed(2)} > ${u.toFixed(2)}`;
72
+ $ ? ($.reasons.push(k), $.affectedColumns.push(a), $.score = Math.min(1, $.score + 0.2)) : n.push({
73
73
  rowIndex: v,
74
74
  row: c[v],
75
75
  score: 0.7,
76
- reasons: [C],
76
+ reasons: [k],
77
77
  affectedColumns: [a]
78
78
  });
79
79
  }
80
80
  });
81
- }), n.sort((a, o) => o.score - a.score);
81
+ }), n.sort((a, r) => r.score - a.score);
82
82
  }
83
- class H {
83
+ class U {
84
84
  constructor(e) {
85
85
  this.config = {
86
86
  maxTokens: 1e3,
@@ -94,9 +94,9 @@ class H {
94
94
  async answerQuestion(e) {
95
95
  const t = Date.now();
96
96
  try {
97
- const { question: n, schema: s, data: a = [], sampleSize: o = 100, includeAggregates: r = !0 } = e, i = a.length > o ? this.sampleData(a, o) : a, l = r ? this.calculateAggregates(a, s) : void 0, g = this.buildPrompt(n, s, i, l, a.length), p = await this.callLLM(g);
97
+ const { question: n, schema: s, data: a = [], sampleSize: r = 100, includeAggregates: o = !0 } = e, i = a.length > r ? this.sampleData(a, r) : a, l = o ? this.calculateAggregates(a, s) : void 0, g = this.buildPrompt(n, s, i, l, a.length), h = await this.callLLM(g);
98
98
  return {
99
- answer: this.parseResponse(p, n, a.length > o),
99
+ answer: this.parseResponse(h, n, a.length > r),
100
100
  processingTime: Date.now() - t
101
101
  };
102
102
  } catch (n) {
@@ -132,7 +132,7 @@ class H {
132
132
  for (const s of t.columns)
133
133
  if (s.type === "number" && e.length > 0)
134
134
  try {
135
- const a = B(e, s.name, "number");
135
+ const a = H(e, s.name, "number");
136
136
  n[s.name] = {
137
137
  mean: a.mean,
138
138
  median: a.median,
@@ -143,9 +143,9 @@ class H {
143
143
  } catch {
144
144
  }
145
145
  else if (s.type === "categorical" || s.type === "string") {
146
- const a = e.map((r) => r[s.name]).filter((r) => r != null), o = new Set(a);
146
+ const a = e.map((o) => o[s.name]).filter((o) => o != null), r = new Set(a);
147
147
  n[s.name] = {
148
- uniqueCount: o.size,
148
+ uniqueCount: r.size,
149
149
  totalCount: a.length,
150
150
  topValues: this.getTopValues(a, 5)
151
151
  };
@@ -165,51 +165,51 @@ class H {
165
165
  * Build prompt for LLM
166
166
  */
167
167
  buildPrompt(e, t, n, s, a) {
168
- const o = a && a > n.length;
169
- let r = `You are a data analyst assistant. Answer the following question about a table dataset.
168
+ const r = a && a > n.length;
169
+ let o = `You are a data analyst assistant. Answer the following question about a table dataset.
170
170
 
171
171
  `;
172
- r += `**Table Schema:**
173
- `, r += `Table: ${t.name}
174
- `, r += `Columns:
172
+ o += `**Table Schema:**
173
+ `, o += `Table: ${t.name}
174
+ `, o += `Columns:
175
175
  `;
176
176
  for (const i of t.columns)
177
- r += `- ${i.name} (${i.type})
177
+ o += `- ${i.name} (${i.type})
178
178
  `;
179
- return r += `
180
- `, s && Object.keys(s).length > 0 && (r += `**Summary Statistics:**
181
- `, r += JSON.stringify(s, null, 2), r += `
179
+ return o += `
180
+ `, s && Object.keys(s).length > 0 && (o += `**Summary Statistics:**
181
+ `, o += JSON.stringify(s, null, 2), o += `
182
182
 
183
- `), r += `**Sample Data** (${n.length} rows${o ? ` out of ${a} total` : ""}):
184
- `, r += JSON.stringify(n.slice(0, 10), null, 2), r += `
183
+ `), o += `**Sample Data** (${n.length} rows${r ? ` out of ${a} total` : ""}):
184
+ `, o += JSON.stringify(n.slice(0, 10), null, 2), o += `
185
185
 
186
- `, r += `**Question:** ${e}
186
+ `, o += `**Question:** ${e}
187
187
 
188
- `, r += `**Instructions:**
189
- `, r += `1. Answer ONLY based on the data provided above.
190
- `, r += `2. If the question cannot be answered from the available data, clearly state "I cannot answer this question from the available data" and explain why.
191
- `, r += `3. Provide a clear, concise answer.
192
- `, r += `4. Include specific numbers or examples from the data when relevant.
193
- `, r += `5. If the answer is based on sampled data, mention that it's an approximation.
194
- `, r += `6. Format your response as JSON with the following structure:
195
- `, r += `{
196
- `, r += ` "answer": "Your answer text here",
197
- `, r += ` "confidence": 0.0-1.0,
198
- `, r += ` "cannotAnswer": false,
199
- `, r += ` "isApproximate": ${o},
200
- `, r += ` "supportingData": { "key": "value" } // optional
201
- `, r += `}
202
- `, r;
188
+ `, o += `**Instructions:**
189
+ `, o += `1. Answer ONLY based on the data provided above.
190
+ `, o += `2. If the question cannot be answered from the available data, clearly state "I cannot answer this question from the available data" and explain why.
191
+ `, o += `3. Provide a clear, concise answer.
192
+ `, o += `4. Include specific numbers or examples from the data when relevant.
193
+ `, o += `5. If the answer is based on sampled data, mention that it's an approximation.
194
+ `, o += `6. Format your response as JSON with the following structure:
195
+ `, o += `{
196
+ `, o += ` "answer": "Your answer text here",
197
+ `, o += ` "confidence": 0.0-1.0,
198
+ `, o += ` "cannotAnswer": false,
199
+ `, o += ` "isApproximate": ${r},
200
+ `, o += ` "supportingData": { "key": "value" } // optional
201
+ `, o += `}
202
+ `, o;
203
203
  }
204
204
  /**
205
205
  * Call LLM API
206
206
  */
207
207
  async callLLM(e) {
208
- const { provider: t, apiKey: n, baseUrl: s, model: a, maxTokens: o, temperature: r } = this.config;
208
+ const { provider: t, apiKey: n, baseUrl: s, model: a, maxTokens: r, temperature: o } = this.config;
209
209
  if (t === "openai")
210
- return this.callOpenAI(e, n, a || "gpt-4-turbo-preview", o, r);
210
+ return this.callOpenAI(e, n, a || "gpt-4-turbo-preview", r, o);
211
211
  if (t === "anthropic")
212
- return this.callAnthropic(e, n, a || "claude-3-5-sonnet-20241022", o, r);
212
+ return this.callAnthropic(e, n, a || "claude-3-5-sonnet-20241022", r, o);
213
213
  if (t === "custom" && s)
214
214
  return this.callCustomAPI(e, s, n);
215
215
  throw new Error(`Unsupported provider: ${t}`);
@@ -219,7 +219,7 @@ class H {
219
219
  */
220
220
  async callOpenAI(e, t, n, s, a) {
221
221
  var i, l;
222
- const o = await fetch("https://api.openai.com/v1/chat/completions", {
222
+ const r = await fetch("https://api.openai.com/v1/chat/completions", {
223
223
  method: "POST",
224
224
  headers: {
225
225
  "Content-Type": "application/json",
@@ -233,16 +233,16 @@ class H {
233
233
  response_format: { type: "json_object" }
234
234
  })
235
235
  });
236
- if (!o.ok)
237
- throw new Error(`OpenAI API error: ${o.statusText}`);
238
- return ((l = (i = (await o.json()).choices[0]) == null ? void 0 : i.message) == null ? void 0 : l.content) || "";
236
+ if (!r.ok)
237
+ throw new Error(`OpenAI API error: ${r.statusText}`);
238
+ return ((l = (i = (await r.json()).choices[0]) == null ? void 0 : i.message) == null ? void 0 : l.content) || "";
239
239
  }
240
240
  /**
241
241
  * Call Anthropic API
242
242
  */
243
243
  async callAnthropic(e, t, n, s, a) {
244
244
  var i;
245
- const o = await fetch("https://api.anthropic.com/v1/messages", {
245
+ const r = await fetch("https://api.anthropic.com/v1/messages", {
246
246
  method: "POST",
247
247
  headers: {
248
248
  "Content-Type": "application/json",
@@ -256,9 +256,9 @@ class H {
256
256
  messages: [{ role: "user", content: e }]
257
257
  })
258
258
  });
259
- if (!o.ok)
260
- throw new Error(`Anthropic API error: ${o.statusText}`);
261
- return ((i = (await o.json()).content[0]) == null ? void 0 : i.text) || "";
259
+ if (!r.ok)
260
+ throw new Error(`Anthropic API error: ${r.statusText}`);
261
+ return ((i = (await r.json()).content[0]) == null ? void 0 : i.text) || "";
262
262
  }
263
263
  /**
264
264
  * Call custom API
@@ -275,8 +275,8 @@ class H {
275
275
  });
276
276
  if (!a.ok)
277
277
  throw new Error(`Custom API error: ${a.statusText}`);
278
- const o = await a.json();
279
- return o.response || o.answer || JSON.stringify(o);
278
+ const r = await a.json();
279
+ return r.response || r.answer || JSON.stringify(r);
280
280
  }
281
281
  /**
282
282
  * Parse LLM response
@@ -311,80 +311,80 @@ class H {
311
311
  return `qa_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
312
312
  }
313
313
  }
314
- function re(c = {}) {
314
+ function oe(c = {}) {
315
315
  const {
316
316
  selector: e = "table",
317
317
  includeHeaders: t = !0,
318
318
  maxRows: n,
319
319
  inferTypes: s = !0,
320
320
  skipEmptyRows: a = !0
321
- } = c, o = document.querySelector(e);
322
- if (!o || o.tagName !== "TABLE")
321
+ } = c, r = document.querySelector(e);
322
+ if (!r || r.tagName !== "TABLE")
323
323
  return console.warn(`No table found with selector: ${e}`), null;
324
- const i = Array.from(o.rows);
324
+ const i = Array.from(r.rows);
325
325
  if (i.length === 0)
326
326
  return null;
327
327
  let l = [], g = 0;
328
328
  if (t && i[0]) {
329
329
  const v = i[0];
330
- l = Array.from(v.cells).map(($, C) => {
330
+ l = Array.from(v.cells).map(($, k) => {
331
331
  var _;
332
- return ((_ = $.textContent) == null ? void 0 : _.trim()) || "" || `Column${C + 1}`;
332
+ return ((_ = $.textContent) == null ? void 0 : _.trim()) || "" || `Column${k + 1}`;
333
333
  }), g = 1;
334
334
  } else {
335
335
  const v = i[0];
336
- l = Array.from(v.cells).map(($, C) => `Column${C + 1}`);
336
+ l = Array.from(v.cells).map(($, k) => `Column${k + 1}`);
337
337
  }
338
- const p = [], u = n ? i.slice(g, g + n) : i.slice(g);
338
+ const h = [], u = n ? i.slice(g, g + n) : i.slice(g);
339
339
  for (const v of u) {
340
340
  const $ = Array.from(v.cells);
341
- if (a && $.every((D) => {
341
+ if (a && $.every((E) => {
342
342
  var _;
343
- return !((_ = D.textContent) != null && _.trim());
343
+ return !((_ = E.textContent) != null && _.trim());
344
344
  }))
345
345
  continue;
346
- const C = {};
347
- $.forEach((D, _) => {
346
+ const k = {};
347
+ $.forEach((E, _) => {
348
348
  var M;
349
349
  const j = l[_] || `Column${_ + 1}`;
350
- let T = ((M = D.textContent) == null ? void 0 : M.trim()) || "";
351
- if (s && T) {
352
- const P = parseFloat(T);
353
- !isNaN(P) && T === P.toString() && (T = P);
350
+ let D = ((M = E.textContent) == null ? void 0 : M.trim()) || "";
351
+ if (s && D) {
352
+ const N = parseFloat(D);
353
+ !isNaN(N) && D === N.toString() && (D = N);
354
354
  }
355
- C[j] = T;
356
- }), p.push(C);
355
+ k[j] = D;
356
+ }), h.push(k);
357
357
  }
358
358
  return {
359
- schema: s && p.length > 0 ? N(p, "Extracted Table") : ie(l, p.length),
360
- data: p,
359
+ schema: s && h.length > 0 ? P(h, "Extracted Table") : ie(l, h.length),
360
+ data: h,
361
361
  source: "dom",
362
362
  metadata: {
363
363
  selector: e,
364
- rowCount: p.length,
364
+ rowCount: h.length,
365
365
  columnCount: l.length,
366
366
  extractedAt: /* @__PURE__ */ new Date()
367
367
  }
368
368
  };
369
369
  }
370
- function oe(c, e, t = {}) {
370
+ function re(c, e, t = {}) {
371
371
  const { maxRows: n, inferTypes: s = !0 } = t, a = n ? c.slice(0, n) : c;
372
- let o;
373
- return e && e.length > 0 ? o = {
372
+ let r;
373
+ return e && e.length > 0 ? r = {
374
374
  name: "Vue Data Grid",
375
- columns: e.map((r) => ({
376
- name: r.field,
377
- type: s && a.length > 0 ? L(a, r.field) : "string",
375
+ columns: e.map((o) => ({
376
+ name: o.field,
377
+ type: s && a.length > 0 ? L(a, o.field) : "string",
378
378
  nullable: !0
379
379
  })),
380
380
  rowCount: a.length
381
- } : a.length > 0 ? o = N(a, "Vue Data Grid") : o = { name: "Vue Data Grid", columns: [], rowCount: 0 }, {
382
- schema: o,
381
+ } : a.length > 0 ? r = P(a, "Vue Data Grid") : r = { name: "Vue Data Grid", columns: [], rowCount: 0 }, {
382
+ schema: r,
383
383
  data: a,
384
384
  source: "vue",
385
385
  metadata: {
386
386
  rowCount: a.length,
387
- columnCount: o.columns.length,
387
+ columnCount: r.columns.length,
388
388
  extractedAt: /* @__PURE__ */ new Date()
389
389
  }
390
390
  };
@@ -405,10 +405,10 @@ function ce(c) {
405
405
  c.variable && c.variable.forEach((a) => {
406
406
  e[a.key] = a.value;
407
407
  });
408
- const t = c.auth ? J(c.auth) : void 0, n = [];
409
- function s(a, o = "") {
410
- a.forEach((r) => {
411
- r.item ? s(r.item, o ? `${o}/${r.name}` : r.name) : r.request && n.push(le(r, t));
408
+ const t = c.auth ? B(c.auth) : void 0, n = [];
409
+ function s(a, r = "") {
410
+ a.forEach((o) => {
411
+ o.item ? s(o.item, r ? `${r}/${o.name}` : o.name) : o.request && n.push(le(o, t));
412
412
  });
413
413
  }
414
414
  return s(c.item), {
@@ -421,14 +421,14 @@ function ce(c) {
421
421
  }
422
422
  function le(c, e) {
423
423
  const t = c.request, n = {};
424
- t.header && t.header.forEach((o) => {
425
- n[o.key] = o.value;
424
+ t.header && t.header.forEach((r) => {
425
+ n[r.key] = r.value;
426
426
  });
427
427
  const s = {};
428
- t.url.query && t.url.query.forEach((o) => {
429
- s[o.key] = o.value;
428
+ t.url.query && t.url.query.forEach((r) => {
429
+ s[r.key] = r.value;
430
430
  });
431
- const a = t.auth ? J(t.auth) : e;
431
+ const a = t.auth ? B(t.auth) : e;
432
432
  return {
433
433
  name: c.name,
434
434
  method: t.method,
@@ -439,7 +439,7 @@ function le(c, e) {
439
439
  auth: a
440
440
  };
441
441
  }
442
- function J(c) {
442
+ function B(c) {
443
443
  const e = {};
444
444
  return c.apikey ? c.apikey.forEach((t) => {
445
445
  e[t.key] = t.value;
@@ -459,12 +459,12 @@ function I(c, e) {
459
459
  t = t.replace(s, e[n]);
460
460
  }), t;
461
461
  }
462
- async function U(c) {
462
+ async function J(c) {
463
463
  const { endpoint: e, variables: t = {}, additionalHeaders: n = {}, additionalParams: s = {} } = c;
464
464
  try {
465
465
  let a = I(e.url, t);
466
- const o = { ...e.queryParams, ...t, ...s }, r = Object.keys(o).filter((u) => o[u] !== void 0 && o[u] !== "").map((u) => `${encodeURIComponent(u)}=${encodeURIComponent(I(String(o[u]), t))}`).join("&");
467
- r && (a = a.includes("?") ? `${a}&${r}` : `${a}?${r}`);
466
+ const r = { ...e.queryParams, ...t, ...s }, o = Object.keys(r).filter((u) => r[u] !== void 0 && r[u] !== "").map((u) => `${encodeURIComponent(u)}=${encodeURIComponent(I(String(r[u]), t))}`).join("&");
467
+ o && (a = a.includes("?") ? `${a}&${o}` : `${a}?${o}`);
468
468
  const i = {
469
469
  "Content-Type": "application/json",
470
470
  ...e.headers,
@@ -474,13 +474,13 @@ async function U(c) {
474
474
  i[u] = I(i[u], t);
475
475
  }), e.auth) {
476
476
  if (e.auth.type === "apikey") {
477
- const u = e.auth.credentials.key || "access_key", y = I(e.auth.credentials.value || "", t);
478
- e.auth.credentials.in === "header" && (i[u] = y);
477
+ const u = e.auth.credentials.key || "access_key", w = I(e.auth.credentials.value || "", t);
478
+ e.auth.credentials.in === "header" && (i[u] = w);
479
479
  } else if (e.auth.type === "bearer") {
480
480
  const u = I(e.auth.credentials.token || "", t);
481
481
  i.Authorization = `Bearer ${u}`;
482
482
  } else if (e.auth.type === "basic") {
483
- const u = I(e.auth.credentials.username || "", t), y = I(e.auth.credentials.password || "", t), v = btoa(`${u}:${y}`);
483
+ const u = I(e.auth.credentials.username || "", t), w = I(e.auth.credentials.password || "", t), v = btoa(`${u}:${w}`);
484
484
  i.Authorization = `Basic ${v}`;
485
485
  }
486
486
  }
@@ -488,8 +488,8 @@ async function U(c) {
488
488
  method: e.method,
489
489
  headers: i
490
490
  }), g = {};
491
- return l.headers.forEach((u, y) => {
492
- g[y] = u;
491
+ return l.headers.forEach((u, w) => {
492
+ g[w] = u;
493
493
  }), l.ok ? {
494
494
  success: !0,
495
495
  data: await l.json(),
@@ -511,7 +511,7 @@ async function U(c) {
511
511
  async function Ge(c, e = {}) {
512
512
  const t = [];
513
513
  for (const n of c) {
514
- const s = await U({ endpoint: n, variables: e });
514
+ const s = await J({ endpoint: n, variables: e });
515
515
  t.push(s);
516
516
  }
517
517
  return t;
@@ -527,13 +527,13 @@ class de {
527
527
  this.config = {
528
528
  timeout: 3e4,
529
529
  ...e
530
- }, t && (this.qaEngine = new H(t));
530
+ }, t && (this.qaEngine = new U(t));
531
531
  }
532
532
  /**
533
533
  * Initialize or update Q&A engine
534
534
  */
535
535
  initializeQA(e) {
536
- this.qaEngine = new H(e);
536
+ this.qaEngine = new U(e);
537
537
  }
538
538
  /**
539
539
  * Generic API call to TFM endpoint
@@ -541,7 +541,9 @@ class de {
541
541
  async callTFM(e) {
542
542
  const t = Date.now();
543
543
  try {
544
- const n = await fetch(this.config.baseUrl, {
544
+ let n = this.config.baseUrl;
545
+ this.config.useCorsProxy && this.config.corsProxyUrl && (this.config.corsProxyUrl.includes("?") ? n = this.config.corsProxyUrl + encodeURIComponent(n) : n = (this.config.corsProxyUrl.endsWith("/") ? this.config.corsProxyUrl : this.config.corsProxyUrl + "/") + n, console.log("Using CORS proxy for TFM API call:", this.config.corsProxyUrl), console.log("Proxied URL:", n));
546
+ const s = await fetch(n, {
545
547
  method: "POST",
546
548
  headers: {
547
549
  "Content-Type": "application/json",
@@ -554,18 +556,18 @@ class de {
554
556
  }),
555
557
  signal: AbortSignal.timeout(this.config.timeout || 3e4)
556
558
  });
557
- if (!n.ok) {
558
- const o = await n.text();
559
- throw new Error(`TFM API error: ${n.status} - ${o}`);
559
+ if (!s.ok) {
560
+ const o = await s.text();
561
+ throw new Error(`TFM API error: ${s.status} - ${o}`);
560
562
  }
561
- const s = await n.json(), a = Date.now() - t;
563
+ const a = await s.json(), r = Date.now() - t;
562
564
  return {
563
565
  success: !0,
564
- result: s.result || s,
566
+ result: a.result || a,
565
567
  metadata: {
566
- processingTime: a,
568
+ processingTime: r,
567
569
  model: this.config.model || "unknown",
568
- version: s.version
570
+ version: a.version
569
571
  }
570
572
  };
571
573
  } catch (n) {
@@ -672,13 +674,13 @@ class de {
672
674
  * Extract table from DOM
673
675
  */
674
676
  extractFromDOM(e) {
675
- return re(e);
677
+ return oe(e);
676
678
  }
677
679
  /**
678
680
  * Normalize Vue data grid data
679
681
  */
680
682
  normalizeVueData(e, t, n) {
681
- return oe(e, t, n);
683
+ return re(e, t, n);
682
684
  }
683
685
  /**
684
686
  * Update configuration
@@ -727,11 +729,11 @@ class de {
727
729
  const s = {
728
730
  ...this.parsedCollection.variables,
729
731
  ...t
730
- }, a = await U({ endpoint: n, variables: s });
732
+ }, a = await J({ endpoint: n, variables: s });
731
733
  if (!a.success)
732
734
  throw new Error(`API request failed: ${a.error}`);
733
- const o = ue(a), r = N(o);
734
- return { data: o, schema: r };
735
+ const r = ue(a), o = P(r);
736
+ return { data: r, schema: o };
735
737
  }
736
738
  /**
737
739
  * Query API data with natural language
@@ -746,12 +748,12 @@ class de {
746
748
  question: e.question,
747
749
  schema: s,
748
750
  data: n
749
- }, o = await this.qaEngine.answerQuestion(a), r = Date.now() - t;
751
+ }, r = await this.qaEngine.answerQuestion(a), o = Date.now() - t;
750
752
  return {
751
- answer: o.answer,
753
+ answer: r.answer,
752
754
  apiResponse: n,
753
755
  endpoint: e.dataSource.endpoint,
754
- executionTime: r
756
+ executionTime: o
755
757
  };
756
758
  }
757
759
  /**
@@ -766,53 +768,53 @@ class de {
766
768
  }
767
769
  }
768
770
  function Ye(c) {
769
- const e = new de(c.config, c.qaConfig), t = S(!1), n = S(null), s = S(null), a = c.data || S([]), o = c.schema || S(null), r = S([]), i = S([]), l = S(null), g = c.maxQuestionHistory || 50, p = c.useLocalFallback !== !1;
770
- async function u(d, w) {
771
+ const e = new de(c.config, c.qaConfig), t = S(!1), n = S(null), s = S(null), a = c.data || S([]), r = c.schema || S(null), o = S([]), i = S([]), l = S(null), g = c.maxQuestionHistory || 50, h = c.useLocalFallback !== !1;
772
+ async function u(d, y) {
771
773
  t.value = !0, n.value = null;
772
774
  try {
773
775
  const b = {
774
776
  type: d,
775
777
  data: a.value,
776
- schema: o.value || void 0,
777
- options: w
778
- }, k = await e.analyze(b);
779
- return s.value = k, k;
778
+ schema: r.value || void 0,
779
+ options: y
780
+ }, C = await e.analyze(b);
781
+ return s.value = C, C;
780
782
  } catch (b) {
781
- if (n.value = b instanceof Error ? b : new Error("Analysis failed"), p)
782
- return y(d, w);
783
+ if (n.value = b instanceof Error ? b : new Error("Analysis failed"), h)
784
+ return w(d, y);
783
785
  throw n.value;
784
786
  } finally {
785
787
  t.value = !1;
786
788
  }
787
789
  }
788
- function y(d, w) {
789
- const b = o.value || N(a.value);
790
+ function w(d, y) {
791
+ const b = r.value || P(a.value);
790
792
  switch (d) {
791
793
  case "descriptive_stats": {
792
- const k = b.columns.map(
793
- (x) => B(a.value, x.name, x.type)
794
+ const C = b.columns.map(
795
+ (T) => H(a.value, T.name, T.type)
794
796
  );
795
797
  return {
796
798
  type: d,
797
799
  timestamp: /* @__PURE__ */ new Date(),
798
- descriptiveStats: k,
799
- summary: `Calculated statistics for ${k.length} columns`,
800
+ descriptiveStats: C,
801
+ summary: `Calculated statistics for ${C.length} columns`,
800
802
  insights: [],
801
803
  confidence: 0.9
802
804
  };
803
805
  }
804
806
  case "anomaly_detection": {
805
- const k = b.columns.filter((q) => q.type === "number").map((q) => q.name), x = ae(
807
+ const C = b.columns.filter((x) => x.type === "number").map((x) => x.name), T = ae(
806
808
  a.value,
807
- k,
808
- w == null ? void 0 : w.sensitivity
809
+ C,
810
+ y == null ? void 0 : y.sensitivity
809
811
  );
810
812
  return {
811
813
  type: d,
812
814
  timestamp: /* @__PURE__ */ new Date(),
813
- anomalies: x,
814
- summary: `Found ${x.length} anomalies`,
815
- insights: x.slice(0, 3).map((q) => q.reasons[0]),
815
+ anomalies: T,
816
+ summary: `Found ${T.length} anomalies`,
817
+ insights: T.slice(0, 3).map((x) => x.reasons[0]),
816
818
  confidence: 0.8
817
819
  };
818
820
  }
@@ -823,36 +825,36 @@ function Ye(c) {
823
825
  async function v() {
824
826
  return (await u("descriptive_stats")).descriptiveStats || [];
825
827
  }
826
- async function $(d, w) {
827
- return (await u("anomaly_detection", { sensitivity: w, features: d })).anomalies || [];
828
+ async function $(d, y) {
829
+ return (await u("anomaly_detection", { sensitivity: y, features: d })).anomalies || [];
828
830
  }
829
- async function C(d, w = 3) {
830
- return u("clustering", { features: d, numClusters: w });
831
+ async function k(d, y = 3) {
832
+ return u("clustering", { features: d, numClusters: y });
831
833
  }
832
- async function D(d, w) {
833
- return u("prediction", { targetColumn: d, ...w });
834
+ async function E(d, y) {
835
+ return u("prediction", { targetColumn: d, ...y });
834
836
  }
835
837
  function _(d) {
836
838
  e.updateConfig(d);
837
839
  }
838
- function j(d, w = !0) {
839
- a.value = d, w && (o.value = N(d));
840
+ function j(d, y = !0) {
841
+ a.value = d, y && (r.value = P(d));
840
842
  }
841
- function T() {
842
- t.value = !1, n.value = null, s.value = null, r.value = [], i.value = [], l.value = null;
843
+ function D() {
844
+ t.value = !1, n.value = null, s.value = null, o.value = [], i.value = [], l.value = null;
843
845
  }
844
- async function M(d, w) {
846
+ async function M(d, y) {
845
847
  t.value = !0, n.value = null;
846
848
  try {
847
- const b = o.value || N(a.value), k = {
849
+ const b = r.value || P(a.value), C = {
848
850
  question: d,
849
851
  schema: b,
850
852
  data: a.value,
851
853
  sampleSize: 100,
852
854
  includeAggregates: !0,
853
- ...w
854
- }, q = (await e.askQuestion(k)).answer, X = {
855
- id: q.questionId,
855
+ ...y
856
+ }, x = (await e.askQuestion(C)).answer, X = {
857
+ id: x.questionId,
856
858
  text: d,
857
859
  timestamp: /* @__PURE__ */ new Date(),
858
860
  context: {
@@ -860,17 +862,17 @@ function Ye(c) {
860
862
  rowCount: a.value.length
861
863
  }
862
864
  };
863
- return r.value.push(X), i.value.push(q), l.value = q, r.value.length > g && (r.value.shift(), i.value.shift()), q;
865
+ return o.value.push(X), i.value.push(x), l.value = x, o.value.length > g && (o.value.shift(), i.value.shift()), x;
864
866
  } catch (b) {
865
867
  throw n.value = b instanceof Error ? b : new Error("Q&A failed"), n.value;
866
868
  } finally {
867
869
  t.value = !1;
868
870
  }
869
871
  }
870
- async function P() {
872
+ async function N() {
871
873
  t.value = !0, n.value = null;
872
874
  try {
873
- const d = o.value || N(a.value);
875
+ const d = r.value || P(a.value);
874
876
  return await e.generateSummary(a.value, d);
875
877
  } catch (d) {
876
878
  throw n.value = d instanceof Error ? d : new Error("Summary generation failed"), n.value;
@@ -879,15 +881,15 @@ function Ye(c) {
879
881
  }
880
882
  }
881
883
  function K() {
882
- r.value = [], i.value = [], l.value = null;
884
+ o.value = [], i.value = [], l.value = null;
883
885
  }
884
886
  function G(d) {
885
- const w = e.extractFromDOM(d);
886
- return w && (a.value = w.data, o.value = w.schema), w;
887
+ const y = e.extractFromDOM(d);
888
+ return y && (a.value = y.data, r.value = y.schema), y;
887
889
  }
888
- function Y(d, w, b) {
889
- const k = e.normalizeVueData(d, w, b);
890
- a.value = k.data, o.value = k.schema;
890
+ function Y(d, y, b) {
891
+ const C = e.normalizeVueData(d, y, b);
892
+ a.value = C.data, r.value = C.schema;
891
893
  }
892
894
  function W(d) {
893
895
  e.initializeQA(d);
@@ -898,30 +900,30 @@ function Ye(c) {
898
900
  error: n,
899
901
  lastResult: s,
900
902
  data: a,
901
- schema: o,
902
- questionHistory: r,
903
+ schema: r,
904
+ questionHistory: o,
903
905
  answerHistory: i,
904
906
  lastAnswer: l,
905
907
  analyze: u,
906
908
  getDescriptiveStats: v,
907
909
  detectAnomalies: $,
908
- performClustering: C,
909
- predict: D,
910
+ performClustering: k,
911
+ predict: E,
910
912
  askQuestion: M,
911
- generateSummary: P,
913
+ generateSummary: N,
912
914
  clearHistory: K,
913
915
  extractFromDOM: G,
914
916
  loadFromVueGrid: Y,
915
917
  updateConfig: _,
916
918
  initializeQA: W,
917
919
  setData: j,
918
- reset: T
920
+ reset: D
919
921
  };
920
922
  }
921
- const me = { class: "ti-question-input" }, pe = { class: "ti-input-wrapper" }, he = ["placeholder", "disabled", "onKeydown"], fe = ["disabled"], ge = { key: 0 }, we = {
923
+ const me = { class: "ti-question-input" }, he = { class: "ti-input-wrapper" }, pe = ["placeholder", "disabled", "onKeydown"], fe = ["disabled"], ge = { key: 0 }, ye = {
922
924
  key: 1,
923
925
  class: "ti-loading"
924
- }, ye = {
926
+ }, we = {
925
927
  key: 0,
926
928
  class: "ti-hint"
927
929
  }, ve = /* @__PURE__ */ z({
@@ -941,32 +943,32 @@ const me = { class: "ti-question-input" }, pe = { class: "ti-input-wrapper" }, h
941
943
  function a() {
942
944
  s.value.trim() && !t.disabled && !t.loading && (n("submit", s.value.trim()), s.value = "");
943
945
  }
944
- function o(r) {
946
+ function r(o) {
945
947
  }
946
- return (r, i) => (f(), h("div", me, [
947
- m("div", pe, [
948
+ return (o, i) => (f(), p("div", me, [
949
+ m("div", he, [
948
950
  Z(m("textarea", {
949
951
  "onUpdate:modelValue": i[0] || (i[0] = (l) => s.value = l),
950
- placeholder: r.placeholder,
951
- disabled: r.disabled,
952
+ placeholder: o.placeholder,
953
+ disabled: o.disabled,
952
954
  class: "ti-textarea",
953
955
  rows: "2",
954
956
  onKeydown: [
955
- V(R(a, ["exact", "prevent"]), ["enter"]),
956
- V(R(o, ["shift"]), ["enter"])
957
+ R(V(a, ["exact", "prevent"]), ["enter"]),
958
+ R(V(r, ["shift"]), ["enter"])
957
959
  ]
958
- }, null, 40, he), [
960
+ }, null, 40, pe), [
959
961
  [ee, s.value]
960
962
  ]),
961
963
  m("button", {
962
- disabled: r.disabled || !s.value.trim(),
964
+ disabled: o.disabled || !s.value.trim(),
963
965
  class: "ti-submit-btn",
964
966
  onClick: a
965
967
  }, [
966
- r.loading ? (f(), h("span", we, A(r.loadingLabel), 1)) : (f(), h("span", ge, A(r.submitLabel), 1))
968
+ o.loading ? (f(), p("span", ye, A(o.loadingLabel), 1)) : (f(), p("span", ge, A(o.submitLabel), 1))
967
969
  ], 8, fe)
968
970
  ]),
969
- r.showHint ? (f(), h("div", ye, A(r.hint), 1)) : E("", !0)
971
+ o.showHint ? (f(), p("div", we, A(o.hint), 1)) : q("", !0)
970
972
  ]));
971
973
  }
972
974
  }), F = (c, e) => {
@@ -974,25 +976,25 @@ const me = { class: "ti-question-input" }, pe = { class: "ti-input-wrapper" }, h
974
976
  for (const [n, s] of e)
975
977
  t[n] = s;
976
978
  return t;
977
- }, We = /* @__PURE__ */ F(ve, [["__scopeId", "data-v-90db5921"]]), be = { class: "ti-answer-header" }, Ae = { class: "ti-answer-icon" }, $e = { key: 0 }, ke = { key: 1 }, Ce = { class: "ti-answer-meta" }, _e = { class: "ti-confidence" }, qe = { class: "ti-timestamp" }, Se = { class: "ti-answer-text" }, Ee = {
979
+ }, We = /* @__PURE__ */ F(ve, [["__scopeId", "data-v-90db5921"]]), be = { class: "ti-answer-header" }, Ae = { class: "ti-answer-icon" }, $e = { key: 0 }, Ce = { key: 1 }, ke = { class: "ti-answer-meta" }, _e = { class: "ti-confidence" }, xe = { class: "ti-timestamp" }, Se = { class: "ti-answer-text" }, qe = {
978
980
  key: 0,
979
981
  class: "ti-approximate-notice"
980
- }, De = {
982
+ }, Ee = {
981
983
  key: 1,
982
984
  class: "ti-reason"
983
- }, Te = {
985
+ }, De = {
984
986
  key: 2,
985
987
  class: "ti-supporting-data"
986
- }, xe = {
988
+ }, Te = {
987
989
  key: 0,
988
990
  class: "ti-supporting-content"
989
991
  }, Ie = {
990
992
  key: 0,
991
993
  class: "ti-aggregates"
992
- }, Ne = {
994
+ }, Pe = {
993
995
  key: 1,
994
996
  class: "ti-rows"
995
- }, Pe = { class: "ti-table-wrapper" }, Me = { class: "ti-table" }, Oe = /* @__PURE__ */ z({
997
+ }, Ne = { class: "ti-table-wrapper" }, Me = { class: "ti-table" }, Oe = /* @__PURE__ */ z({
996
998
  __name: "AnswerDisplay",
997
999
  props: {
998
1000
  answer: {}
@@ -1002,53 +1004,53 @@ const me = { class: "ti-question-input" }, pe = { class: "ti-input-wrapper" }, h
1002
1004
  function t(n) {
1003
1005
  return new Date(n).toLocaleTimeString();
1004
1006
  }
1005
- return (n, s) => (f(), h("div", {
1007
+ return (n, s) => (f(), p("div", {
1006
1008
  class: te(["ti-answer-display", { "ti-cannot-answer": n.answer.cannotAnswer }])
1007
1009
  }, [
1008
1010
  m("div", be, [
1009
1011
  m("div", Ae, [
1010
- n.answer.cannotAnswer ? (f(), h("span", ke, "⚠️")) : (f(), h("span", $e, "💡"))
1012
+ n.answer.cannotAnswer ? (f(), p("span", Ce, "⚠️")) : (f(), p("span", $e, "💡"))
1011
1013
  ]),
1012
- m("div", Ce, [
1014
+ m("div", ke, [
1013
1015
  m("div", _e, " Confidence: " + A(Math.round(n.answer.confidence * 100)) + "% ", 1),
1014
- m("div", qe, A(t(n.answer.timestamp)), 1)
1016
+ m("div", xe, A(t(n.answer.timestamp)), 1)
1015
1017
  ])
1016
1018
  ]),
1017
1019
  m("div", Se, A(n.answer.text), 1),
1018
- n.answer.isApproximate ? (f(), h("div", Ee, " ℹ️ This answer is based on sampled data and may be approximate. ")) : E("", !0),
1019
- n.answer.reason && n.answer.cannotAnswer ? (f(), h("div", De, [
1020
+ n.answer.isApproximate ? (f(), p("div", qe, " ℹ️ This answer is based on sampled data and may be approximate. ")) : q("", !0),
1021
+ n.answer.reason && n.answer.cannotAnswer ? (f(), p("div", Ee, [
1020
1022
  s[1] || (s[1] = m("strong", null, "Reason:", -1)),
1021
1023
  ne(" " + A(n.answer.reason), 1)
1022
- ])) : E("", !0),
1023
- n.answer.supportingData ? (f(), h("div", Te, [
1024
+ ])) : q("", !0),
1025
+ n.answer.supportingData ? (f(), p("div", De, [
1024
1026
  m("button", {
1025
1027
  class: "ti-toggle-btn",
1026
1028
  onClick: s[0] || (s[0] = (a) => e.value = !e.value)
1027
1029
  }, A(e.value ? "▼" : "▶") + " Supporting Data ", 1),
1028
- e.value ? (f(), h("div", xe, [
1029
- n.answer.supportingData.aggregates ? (f(), h("div", Ie, [
1030
+ e.value ? (f(), p("div", Te, [
1031
+ n.answer.supportingData.aggregates ? (f(), p("div", Ie, [
1030
1032
  s[2] || (s[2] = m("h4", null, "Aggregates:", -1)),
1031
1033
  m("pre", null, A(JSON.stringify(n.answer.supportingData.aggregates, null, 2)), 1)
1032
- ])) : E("", !0),
1033
- n.answer.supportingData.rows && n.answer.supportingData.rows.length > 0 ? (f(), h("div", Ne, [
1034
+ ])) : q("", !0),
1035
+ n.answer.supportingData.rows && n.answer.supportingData.rows.length > 0 ? (f(), p("div", Pe, [
1034
1036
  m("h4", null, "Sample Rows (" + A(n.answer.supportingData.rows.length) + "):", 1),
1035
- m("div", Pe, [
1037
+ m("div", Ne, [
1036
1038
  m("table", Me, [
1037
1039
  m("thead", null, [
1038
1040
  m("tr", null, [
1039
- (f(!0), h(O, null, Q(Object.keys(n.answer.supportingData.rows[0]), (a, o) => (f(), h("th", { key: o }, A(a), 1))), 128))
1041
+ (f(!0), p(O, null, Q(Object.keys(n.answer.supportingData.rows[0]), (a, r) => (f(), p("th", { key: r }, A(a), 1))), 128))
1040
1042
  ])
1041
1043
  ]),
1042
1044
  m("tbody", null, [
1043
- (f(!0), h(O, null, Q(n.answer.supportingData.rows.slice(0, 5), (a, o) => (f(), h("tr", { key: o }, [
1044
- (f(!0), h(O, null, Q(Object.keys(a), (r, i) => (f(), h("td", { key: i }, A(a[r]), 1))), 128))
1045
+ (f(!0), p(O, null, Q(n.answer.supportingData.rows.slice(0, 5), (a, r) => (f(), p("tr", { key: r }, [
1046
+ (f(!0), p(O, null, Q(Object.keys(a), (o, i) => (f(), p("td", { key: i }, A(a[o]), 1))), 128))
1045
1047
  ]))), 128))
1046
1048
  ])
1047
1049
  ])
1048
1050
  ])
1049
- ])) : E("", !0)
1050
- ])) : E("", !0)
1051
- ])) : E("", !0)
1051
+ ])) : q("", !0)
1052
+ ])) : q("", !0)
1053
+ ])) : q("", !0)
1052
1054
  ], 2));
1053
1055
  }
1054
1056
  }), Xe = /* @__PURE__ */ F(Oe, [["__scopeId", "data-v-d1aaae1d"]]), Qe = { class: "ti-question-history" }, je = { class: "ti-history-header" }, ze = {
@@ -1057,10 +1059,10 @@ const me = { class: "ti-question-input" }, pe = { class: "ti-input-wrapper" }, h
1057
1059
  }, Fe = {
1058
1060
  key: 1,
1059
1061
  class: "ti-history-list"
1060
- }, Ve = ["onClick"], Re = { class: "ti-question-header" }, He = { class: "ti-question-number" }, Le = { class: "ti-question-time" }, Be = { class: "ti-question-text" }, Je = {
1062
+ }, Re = ["onClick"], Ve = { class: "ti-question-header" }, Ue = { class: "ti-question-number" }, Le = { class: "ti-question-time" }, He = { class: "ti-question-text" }, Be = {
1061
1063
  key: 0,
1062
1064
  class: "ti-question-context"
1063
- }, Ue = /* @__PURE__ */ z({
1065
+ }, Je = /* @__PURE__ */ z({
1064
1066
  __name: "QuestionHistory",
1065
1067
  props: {
1066
1068
  questions: {}
@@ -1069,54 +1071,54 @@ const me = { class: "ti-question-input" }, pe = { class: "ti-input-wrapper" }, h
1069
1071
  setup(c, { emit: e }) {
1070
1072
  const t = c, n = se(() => [...t.questions].reverse());
1071
1073
  function s(a) {
1072
- const o = new Date(a), i = (/* @__PURE__ */ new Date()).getTime() - o.getTime(), l = Math.floor(i / 6e4), g = Math.floor(i / 36e5), p = Math.floor(i / 864e5);
1073
- return l < 1 ? "Just now" : l < 60 ? `${l}m ago` : g < 24 ? `${g}h ago` : `${p}d ago`;
1074
+ const r = new Date(a), i = (/* @__PURE__ */ new Date()).getTime() - r.getTime(), l = Math.floor(i / 6e4), g = Math.floor(i / 36e5), h = Math.floor(i / 864e5);
1075
+ return l < 1 ? "Just now" : l < 60 ? `${l}m ago` : g < 24 ? `${g}h ago` : `${h}d ago`;
1074
1076
  }
1075
- return (a, o) => (f(), h("div", Qe, [
1077
+ return (a, r) => (f(), p("div", Qe, [
1076
1078
  m("div", je, [
1077
- o[1] || (o[1] = m("h3", null, "Question History", -1)),
1078
- a.questions.length > 0 ? (f(), h("button", {
1079
+ r[1] || (r[1] = m("h3", null, "Question History", -1)),
1080
+ a.questions.length > 0 ? (f(), p("button", {
1079
1081
  key: 0,
1080
1082
  class: "ti-clear-btn",
1081
- onClick: o[0] || (o[0] = (r) => a.$emit("clear"))
1082
- }, " Clear History ")) : E("", !0)
1083
+ onClick: r[0] || (r[0] = (o) => a.$emit("clear"))
1084
+ }, " Clear History ")) : q("", !0)
1083
1085
  ]),
1084
- a.questions.length === 0 ? (f(), h("div", ze, o[2] || (o[2] = [
1086
+ a.questions.length === 0 ? (f(), p("div", ze, r[2] || (r[2] = [
1085
1087
  m("div", { class: "ti-empty-icon" }, "💬", -1),
1086
1088
  m("p", null, "No questions asked yet", -1),
1087
1089
  m("p", { class: "ti-empty-hint" }, "Ask a question about your data to get started", -1)
1088
- ]))) : (f(), h("div", Fe, [
1089
- (f(!0), h(O, null, Q(n.value, (r, i) => (f(), h("div", {
1090
- key: r.id,
1090
+ ]))) : (f(), p("div", Fe, [
1091
+ (f(!0), p(O, null, Q(n.value, (o, i) => (f(), p("div", {
1092
+ key: o.id,
1091
1093
  class: "ti-history-item",
1092
- onClick: (l) => a.$emit("select", r)
1094
+ onClick: (l) => a.$emit("select", o)
1093
1095
  }, [
1094
- m("div", Re, [
1095
- m("span", He, "#" + A(a.questions.length - i), 1),
1096
- m("span", Le, A(s(r.timestamp)), 1)
1096
+ m("div", Ve, [
1097
+ m("span", Ue, "#" + A(a.questions.length - i), 1),
1098
+ m("span", Le, A(s(o.timestamp)), 1)
1097
1099
  ]),
1098
- m("div", Be, A(r.text), 1),
1099
- r.context ? (f(), h("div", Je, A(r.context.rowCount) + " rows ", 1)) : E("", !0)
1100
- ], 8, Ve))), 128))
1100
+ m("div", He, A(o.text), 1),
1101
+ o.context ? (f(), p("div", Be, A(o.context.rowCount) + " rows ", 1)) : q("", !0)
1102
+ ], 8, Re))), 128))
1101
1103
  ]))
1102
1104
  ]));
1103
1105
  }
1104
- }), Ze = /* @__PURE__ */ F(Ue, [["__scopeId", "data-v-c66393d9"]]);
1106
+ }), Ze = /* @__PURE__ */ F(Je, [["__scopeId", "data-v-c66393d9"]]);
1105
1107
  export {
1106
1108
  Xe as AnswerDisplay,
1107
- H as QAEngine,
1109
+ U as QAEngine,
1108
1110
  Ze as QuestionHistory,
1109
1111
  We as QuestionInput,
1110
1112
  de as TabularIntelligence,
1111
- B as calculateStats,
1113
+ H as calculateStats,
1112
1114
  ue as convertToTabular,
1113
1115
  ae as detectAnomalies,
1114
- U as executeAPIRequest,
1116
+ J as executeAPIRequest,
1115
1117
  Ge as executeMultipleRequests,
1116
- re as extractFromDOM,
1118
+ oe as extractFromDOM,
1117
1119
  L as inferColumnType,
1118
- N as inferSchema,
1119
- oe as normalizeVueData,
1120
+ P as inferSchema,
1121
+ re as normalizeVueData,
1120
1122
  ce as parsePostmanCollection,
1121
1123
  I as replaceVariables,
1122
1124
  Ye as useTabularIntelligence