@object-ui/plugin-ai 3.1.2 → 3.1.4
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.js +687 -627
- package/dist/index.umd.cjs +2 -2
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -1,628 +1,688 @@
|
|
|
1
|
-
import { ComponentRegistry as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: l.query }),
|
|
565
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground shrink-0 ml-auto", children: new Date(l.timestamp).toLocaleDateString() })
|
|
566
|
-
]
|
|
567
|
-
},
|
|
568
|
-
u
|
|
569
|
-
)) })
|
|
570
|
-
] })
|
|
571
|
-
] });
|
|
572
|
-
};
|
|
573
|
-
Q.register(
|
|
574
|
-
"ai-form-assist",
|
|
575
|
-
ke,
|
|
576
|
-
{
|
|
577
|
-
label: "AI Form Assist",
|
|
578
|
-
category: "AI",
|
|
579
|
-
inputs: [
|
|
580
|
-
{ name: "formId", type: "string", label: "Form ID" },
|
|
581
|
-
{ name: "objectName", type: "string", label: "Object Name" },
|
|
582
|
-
{ name: "fields", type: "array", label: "Fields to suggest" },
|
|
583
|
-
{ name: "suggestions", type: "code", label: "Suggestions Data" },
|
|
584
|
-
{ name: "autoFill", type: "boolean", label: "Auto Fill", defaultValue: !1 },
|
|
585
|
-
{ name: "showConfidence", type: "boolean", label: "Show Confidence", defaultValue: !0 },
|
|
586
|
-
{ name: "showReasoning", type: "boolean", label: "Show Reasoning", defaultValue: !1 }
|
|
587
|
-
]
|
|
588
|
-
}
|
|
589
|
-
);
|
|
590
|
-
Q.register(
|
|
591
|
-
"ai-recommendations",
|
|
592
|
-
Se,
|
|
593
|
-
{
|
|
594
|
-
label: "AI Recommendations",
|
|
595
|
-
category: "AI",
|
|
596
|
-
inputs: [
|
|
597
|
-
{ name: "objectName", type: "string", label: "Object Name" },
|
|
598
|
-
{ name: "recommendations", type: "code", label: "Recommendations Data" },
|
|
599
|
-
{ name: "maxResults", type: "number", label: "Max Results", defaultValue: 10 },
|
|
600
|
-
{ name: "showScores", type: "boolean", label: "Show Scores", defaultValue: !1 },
|
|
601
|
-
{ name: "layout", type: "enum", label: "Layout", enum: [
|
|
602
|
-
{ label: "List", value: "list" },
|
|
603
|
-
{ label: "Grid", value: "grid" },
|
|
604
|
-
{ label: "Carousel", value: "carousel" }
|
|
605
|
-
], defaultValue: "list" },
|
|
606
|
-
{ name: "emptyMessage", type: "string", label: "Empty Message" }
|
|
607
|
-
]
|
|
608
|
-
}
|
|
609
|
-
);
|
|
610
|
-
Q.register(
|
|
611
|
-
"nl-query",
|
|
612
|
-
Te,
|
|
613
|
-
{
|
|
614
|
-
label: "Natural Language Query",
|
|
615
|
-
category: "AI",
|
|
616
|
-
inputs: [
|
|
617
|
-
{ name: "objectName", type: "string", label: "Object Name" },
|
|
618
|
-
{ name: "placeholder", type: "string", label: "Placeholder Text" },
|
|
619
|
-
{ name: "suggestions", type: "array", label: "Example Queries" },
|
|
620
|
-
{ name: "showHistory", type: "boolean", label: "Show History", defaultValue: !1 }
|
|
621
|
-
]
|
|
622
|
-
}
|
|
623
|
-
);
|
|
624
|
-
export {
|
|
625
|
-
ke as AIFormAssist,
|
|
626
|
-
Se as AIRecommendations,
|
|
627
|
-
Te as NLQueryInput
|
|
1
|
+
import { ComponentRegistry as e } from "@object-ui/core";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { Badge as n, Button as r, Card as i, CardContent as a, CardHeader as o, CardTitle as s, Input as c } from "@object-ui/components";
|
|
4
|
+
import { ArrowRight as l, Check as u, Clock as d, ExternalLink as f, Lightbulb as p, Loader2 as m, RefreshCw as h, Search as g, Sparkles as _, Star as v, Table as y, ThumbsDown as b, ThumbsUp as x, X as S } from "lucide-react";
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
var C = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), w = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
7
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
8
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
9
|
+
}), T = /* @__PURE__ */ C(((e) => {
|
|
10
|
+
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
11
|
+
function r(e, n, r) {
|
|
12
|
+
var i = null;
|
|
13
|
+
if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
|
|
14
|
+
else r = n;
|
|
15
|
+
return n = r.ref, {
|
|
16
|
+
$$typeof: t,
|
|
17
|
+
type: e,
|
|
18
|
+
key: i,
|
|
19
|
+
ref: n === void 0 ? null : n,
|
|
20
|
+
props: r
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
24
|
+
})), E = /* @__PURE__ */ C(((e) => {
|
|
25
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
26
|
+
function t(e) {
|
|
27
|
+
if (e == null) return null;
|
|
28
|
+
if (typeof e == "function") return e.$$typeof === k ? null : e.displayName || e.name || null;
|
|
29
|
+
if (typeof e == "string") return e;
|
|
30
|
+
switch (e) {
|
|
31
|
+
case _: return "Fragment";
|
|
32
|
+
case y: return "Profiler";
|
|
33
|
+
case v: return "StrictMode";
|
|
34
|
+
case C: return "Suspense";
|
|
35
|
+
case T: return "SuspenseList";
|
|
36
|
+
case O: return "Activity";
|
|
37
|
+
}
|
|
38
|
+
if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
|
|
39
|
+
case g: return "Portal";
|
|
40
|
+
case x: return e.displayName || "Context";
|
|
41
|
+
case b: return (e._context.displayName || "Context") + ".Consumer";
|
|
42
|
+
case S:
|
|
43
|
+
var n = e.render;
|
|
44
|
+
return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
|
|
45
|
+
case E: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
|
|
46
|
+
case D:
|
|
47
|
+
n = e._payload, e = e._init;
|
|
48
|
+
try {
|
|
49
|
+
return t(e(n));
|
|
50
|
+
} catch {}
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
function n(e) {
|
|
55
|
+
return "" + e;
|
|
56
|
+
}
|
|
57
|
+
function r(e) {
|
|
58
|
+
try {
|
|
59
|
+
n(e);
|
|
60
|
+
var t = !1;
|
|
61
|
+
} catch {
|
|
62
|
+
t = !0;
|
|
63
|
+
}
|
|
64
|
+
if (t) {
|
|
65
|
+
t = console;
|
|
66
|
+
var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
67
|
+
return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function i(e) {
|
|
71
|
+
if (e === _) return "<>";
|
|
72
|
+
if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
|
|
73
|
+
try {
|
|
74
|
+
var n = t(e);
|
|
75
|
+
return n ? "<" + n + ">" : "<...>";
|
|
76
|
+
} catch {
|
|
77
|
+
return "<...>";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function a() {
|
|
81
|
+
var e = A.A;
|
|
82
|
+
return e === null ? null : e.getOwner();
|
|
83
|
+
}
|
|
84
|
+
function o() {
|
|
85
|
+
return Error("react-stack-top-frame");
|
|
86
|
+
}
|
|
87
|
+
function s(e) {
|
|
88
|
+
if (j.call(e, "key")) {
|
|
89
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
90
|
+
if (t && t.isReactWarning) return !1;
|
|
91
|
+
}
|
|
92
|
+
return e.key !== void 0;
|
|
93
|
+
}
|
|
94
|
+
function c(e, t) {
|
|
95
|
+
function n() {
|
|
96
|
+
P || (P = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
|
|
97
|
+
}
|
|
98
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
99
|
+
get: n,
|
|
100
|
+
configurable: !0
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function l() {
|
|
104
|
+
var e = t(this.type);
|
|
105
|
+
return F[e] || (F[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
|
|
106
|
+
}
|
|
107
|
+
function u(e, t, n, r, i, a) {
|
|
108
|
+
var o = n.ref;
|
|
109
|
+
return e = {
|
|
110
|
+
$$typeof: h,
|
|
111
|
+
type: e,
|
|
112
|
+
key: t,
|
|
113
|
+
props: n,
|
|
114
|
+
_owner: r
|
|
115
|
+
}, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
|
|
116
|
+
enumerable: !1,
|
|
117
|
+
value: null
|
|
118
|
+
}) : Object.defineProperty(e, "ref", {
|
|
119
|
+
enumerable: !1,
|
|
120
|
+
get: l
|
|
121
|
+
}), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
122
|
+
configurable: !1,
|
|
123
|
+
enumerable: !1,
|
|
124
|
+
writable: !0,
|
|
125
|
+
value: 0
|
|
126
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
127
|
+
configurable: !1,
|
|
128
|
+
enumerable: !1,
|
|
129
|
+
writable: !0,
|
|
130
|
+
value: null
|
|
131
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
132
|
+
configurable: !1,
|
|
133
|
+
enumerable: !1,
|
|
134
|
+
writable: !0,
|
|
135
|
+
value: i
|
|
136
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
137
|
+
configurable: !1,
|
|
138
|
+
enumerable: !1,
|
|
139
|
+
writable: !0,
|
|
140
|
+
value: a
|
|
141
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
142
|
+
}
|
|
143
|
+
function d(e, n, i, o, l, d) {
|
|
144
|
+
var p = n.children;
|
|
145
|
+
if (p !== void 0) if (o) if (M(p)) {
|
|
146
|
+
for (o = 0; o < p.length; o++) f(p[o]);
|
|
147
|
+
Object.freeze && Object.freeze(p);
|
|
148
|
+
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
149
|
+
else f(p);
|
|
150
|
+
if (j.call(n, "key")) {
|
|
151
|
+
p = t(e);
|
|
152
|
+
var m = Object.keys(n).filter(function(e) {
|
|
153
|
+
return e !== "key";
|
|
154
|
+
});
|
|
155
|
+
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", R[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), R[p + o] = !0);
|
|
156
|
+
}
|
|
157
|
+
if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
|
|
158
|
+
else i = n;
|
|
159
|
+
return p && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, p, i, a(), l, d);
|
|
160
|
+
}
|
|
161
|
+
function f(e) {
|
|
162
|
+
p(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? p(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
163
|
+
}
|
|
164
|
+
function p(e) {
|
|
165
|
+
return typeof e == "object" && !!e && e.$$typeof === h;
|
|
166
|
+
}
|
|
167
|
+
var m = w("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), A = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, M = Array.isArray, N = console.createTask ? console.createTask : function() {
|
|
168
|
+
return null;
|
|
169
|
+
};
|
|
170
|
+
m = { react_stack_bottom_frame: function(e) {
|
|
171
|
+
return e();
|
|
172
|
+
} };
|
|
173
|
+
var P, F = {}, I = m.react_stack_bottom_frame.bind(m, o)(), L = N(i(o)), R = {};
|
|
174
|
+
e.Fragment = _, e.jsx = function(e, t, n) {
|
|
175
|
+
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
176
|
+
return d(e, t, n, !1, r ? Error("react-stack-top-frame") : I, r ? N(i(e)) : L);
|
|
177
|
+
}, e.jsxs = function(e, t, n) {
|
|
178
|
+
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
179
|
+
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : I, r ? N(i(e)) : L);
|
|
180
|
+
};
|
|
181
|
+
})();
|
|
182
|
+
})), D = (/* @__PURE__ */ C(((e, t) => {
|
|
183
|
+
process.env.NODE_ENV === "production" ? t.exports = T() : t.exports = E();
|
|
184
|
+
})))(), O = ({ schema: e, onApply: c, onRefresh: l }) => {
|
|
185
|
+
let { suggestions: d = [], showConfidence: f = !0, showReasoning: m = !1, autoFill: g = !1 } = e, [v, y] = t(d), [b, x] = t(/* @__PURE__ */ new Set()), [C, w] = t(!1), [T, E] = t(!1), O = (e) => {
|
|
186
|
+
c?.(e), x((t) => new Set(t).add(e.fieldName));
|
|
187
|
+
}, k = () => {
|
|
188
|
+
v.forEach((e) => c?.(e)), x(new Set(v.map((e) => e.fieldName)));
|
|
189
|
+
}, A = (e) => {
|
|
190
|
+
y((t) => t.filter((t) => t.fieldName !== e));
|
|
191
|
+
}, j = () => {
|
|
192
|
+
E(!0), l && l(), setTimeout(() => E(!1), 1e3);
|
|
193
|
+
};
|
|
194
|
+
if (C || v.length === 0) return null;
|
|
195
|
+
let M = v.filter((e) => !b.has(e.fieldName)), N = (e) => e >= .8 ? "text-green-600" : e >= .5 ? "text-yellow-600" : "text-red-600";
|
|
196
|
+
return /* @__PURE__ */ (0, D.jsxs)(i, {
|
|
197
|
+
className: "border-blue-200 bg-blue-50/30",
|
|
198
|
+
children: [/* @__PURE__ */ (0, D.jsx)(o, {
|
|
199
|
+
className: "pb-2",
|
|
200
|
+
children: /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
201
|
+
className: "flex items-center justify-between",
|
|
202
|
+
children: [/* @__PURE__ */ (0, D.jsxs)(s, {
|
|
203
|
+
className: "text-sm flex items-center gap-2",
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ (0, D.jsx)(_, { className: "h-4 w-4 text-blue-500" }),
|
|
206
|
+
"AI Suggestions",
|
|
207
|
+
/* @__PURE__ */ (0, D.jsxs)(n, {
|
|
208
|
+
variant: "secondary",
|
|
209
|
+
className: "text-xs",
|
|
210
|
+
children: [
|
|
211
|
+
M.length,
|
|
212
|
+
" suggestion",
|
|
213
|
+
M.length === 1 ? "" : "s"
|
|
214
|
+
]
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
}), /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
218
|
+
className: "flex items-center gap-1",
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ (0, D.jsx)(r, {
|
|
221
|
+
variant: "ghost",
|
|
222
|
+
size: "sm",
|
|
223
|
+
onClick: j,
|
|
224
|
+
disabled: T,
|
|
225
|
+
className: "h-7",
|
|
226
|
+
children: /* @__PURE__ */ (0, D.jsx)(h, { className: `h-3 w-3 ${T ? "animate-spin" : ""}` })
|
|
227
|
+
}),
|
|
228
|
+
M.length > 1 && /* @__PURE__ */ (0, D.jsx)(r, {
|
|
229
|
+
variant: "outline",
|
|
230
|
+
size: "sm",
|
|
231
|
+
onClick: k,
|
|
232
|
+
className: "h-7 text-xs",
|
|
233
|
+
children: "Apply All"
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ (0, D.jsx)(r, {
|
|
236
|
+
variant: "ghost",
|
|
237
|
+
size: "sm",
|
|
238
|
+
onClick: () => w(!0),
|
|
239
|
+
className: "h-7",
|
|
240
|
+
children: /* @__PURE__ */ (0, D.jsx)(S, { className: "h-3 w-3" })
|
|
241
|
+
})
|
|
242
|
+
]
|
|
243
|
+
})]
|
|
244
|
+
})
|
|
245
|
+
}), /* @__PURE__ */ (0, D.jsxs)(a, {
|
|
246
|
+
className: "space-y-2 pt-0",
|
|
247
|
+
children: [M.map((e) => /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
248
|
+
className: "flex items-center gap-3 p-2 rounded-md bg-white border text-sm",
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ (0, D.jsx)(p, { className: "h-4 w-4 text-yellow-500 shrink-0" }),
|
|
251
|
+
/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
252
|
+
className: "flex-1 min-w-0",
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
255
|
+
className: "flex items-center gap-2",
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ (0, D.jsx)("span", {
|
|
258
|
+
className: "font-medium",
|
|
259
|
+
children: e.fieldName
|
|
260
|
+
}),
|
|
261
|
+
/* @__PURE__ */ (0, D.jsx)("span", {
|
|
262
|
+
className: "text-muted-foreground",
|
|
263
|
+
children: "→"
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ (0, D.jsx)("span", {
|
|
266
|
+
className: "font-mono text-blue-600 truncate",
|
|
267
|
+
children: typeof e.value == "object" ? JSON.stringify(e.value) : String(e.value)
|
|
268
|
+
})
|
|
269
|
+
]
|
|
270
|
+
}),
|
|
271
|
+
f && /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
272
|
+
className: `text-xs ${N(e.confidence)}`,
|
|
273
|
+
children: [Math.round(e.confidence * 100), "% confidence"]
|
|
274
|
+
}),
|
|
275
|
+
m && e.reasoning && /* @__PURE__ */ (0, D.jsx)("div", {
|
|
276
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
277
|
+
children: e.reasoning
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
282
|
+
className: "flex items-center gap-1 shrink-0",
|
|
283
|
+
children: [/* @__PURE__ */ (0, D.jsx)(r, {
|
|
284
|
+
variant: "ghost",
|
|
285
|
+
size: "sm",
|
|
286
|
+
className: "h-7 w-7 p-0 text-green-600 hover:text-green-700 hover:bg-green-50",
|
|
287
|
+
onClick: () => O(e),
|
|
288
|
+
children: /* @__PURE__ */ (0, D.jsx)(u, { className: "h-3.5 w-3.5" })
|
|
289
|
+
}), /* @__PURE__ */ (0, D.jsx)(r, {
|
|
290
|
+
variant: "ghost",
|
|
291
|
+
size: "sm",
|
|
292
|
+
className: "h-7 w-7 p-0 text-red-500 hover:text-red-700 hover:bg-red-50",
|
|
293
|
+
onClick: () => A(e.fieldName),
|
|
294
|
+
children: /* @__PURE__ */ (0, D.jsx)(S, { className: "h-3.5 w-3.5" })
|
|
295
|
+
})]
|
|
296
|
+
})
|
|
297
|
+
]
|
|
298
|
+
}, e.fieldName)), b.size > 0 && /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
299
|
+
className: "text-xs text-green-600 flex items-center gap-1 pt-1",
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ (0, D.jsx)(u, { className: "h-3 w-3" }),
|
|
302
|
+
b.size,
|
|
303
|
+
" suggestion",
|
|
304
|
+
b.size === 1 ? "" : "s",
|
|
305
|
+
" applied"
|
|
306
|
+
]
|
|
307
|
+
})]
|
|
308
|
+
})]
|
|
309
|
+
});
|
|
310
|
+
}, k = ({ schema: e, onSelect: t, onDismiss: c }) => {
|
|
311
|
+
let { recommendations: l = [], showScores: u = !1, layout: d = "list", loading: p = !1, emptyMessage: m = "No recommendations available" } = e, h = (e) => {
|
|
312
|
+
t?.(e);
|
|
313
|
+
}, g = (e) => {
|
|
314
|
+
c?.(e);
|
|
315
|
+
};
|
|
316
|
+
if (p) return /* @__PURE__ */ (0, D.jsx)(i, { children: /* @__PURE__ */ (0, D.jsxs)(a, {
|
|
317
|
+
className: "p-8 text-center",
|
|
318
|
+
children: [/* @__PURE__ */ (0, D.jsx)(_, { className: "h-8 w-8 text-blue-500 mx-auto mb-3 animate-pulse" }), /* @__PURE__ */ (0, D.jsx)("p", {
|
|
319
|
+
className: "text-sm text-muted-foreground",
|
|
320
|
+
children: "Generating recommendations..."
|
|
321
|
+
})]
|
|
322
|
+
}) });
|
|
323
|
+
if (l.length === 0) return /* @__PURE__ */ (0, D.jsx)(i, { children: /* @__PURE__ */ (0, D.jsx)(a, {
|
|
324
|
+
className: "p-8 text-center text-muted-foreground",
|
|
325
|
+
children: m
|
|
326
|
+
}) });
|
|
327
|
+
let y = (e) => {
|
|
328
|
+
if (!u) return null;
|
|
329
|
+
let t = Math.round(e * 100);
|
|
330
|
+
return /* @__PURE__ */ (0, D.jsxs)(n, {
|
|
331
|
+
variant: e >= .7 ? "default" : e >= .4 ? "secondary" : "outline",
|
|
332
|
+
className: "text-xs",
|
|
333
|
+
children: [t, "%"]
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
return /* @__PURE__ */ (0, D.jsxs)(i, { children: [/* @__PURE__ */ (0, D.jsx)(o, { children: /* @__PURE__ */ (0, D.jsxs)(s, {
|
|
337
|
+
className: "flex items-center gap-2 text-sm",
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ (0, D.jsx)(_, { className: "h-4 w-4 text-blue-500" }),
|
|
340
|
+
"Recommendations",
|
|
341
|
+
/* @__PURE__ */ (0, D.jsx)(n, {
|
|
342
|
+
variant: "secondary",
|
|
343
|
+
className: "text-xs",
|
|
344
|
+
children: l.length
|
|
345
|
+
})
|
|
346
|
+
]
|
|
347
|
+
}) }), /* @__PURE__ */ (0, D.jsx)(a, { children: d === "grid" ? /* @__PURE__ */ (0, D.jsx)("div", {
|
|
348
|
+
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",
|
|
349
|
+
children: l.map((e) => /* @__PURE__ */ (0, D.jsx)(i, {
|
|
350
|
+
className: "cursor-pointer hover:shadow-md transition-shadow",
|
|
351
|
+
onClick: () => h(e),
|
|
352
|
+
children: /* @__PURE__ */ (0, D.jsxs)(a, {
|
|
353
|
+
className: "p-4",
|
|
354
|
+
children: [
|
|
355
|
+
/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
356
|
+
className: "flex items-start justify-between mb-2",
|
|
357
|
+
children: [/* @__PURE__ */ (0, D.jsx)(v, { className: "h-4 w-4 text-yellow-500" }), y(e.score)]
|
|
358
|
+
}),
|
|
359
|
+
/* @__PURE__ */ (0, D.jsx)("h4", {
|
|
360
|
+
className: "font-medium text-sm mb-1",
|
|
361
|
+
children: e.title
|
|
362
|
+
}),
|
|
363
|
+
e.description && /* @__PURE__ */ (0, D.jsx)("p", {
|
|
364
|
+
className: "text-xs text-muted-foreground line-clamp-3",
|
|
365
|
+
children: e.description
|
|
366
|
+
}),
|
|
367
|
+
e.category && /* @__PURE__ */ (0, D.jsx)(n, {
|
|
368
|
+
variant: "outline",
|
|
369
|
+
className: "text-xs mt-2",
|
|
370
|
+
children: e.category
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
373
|
+
className: "flex items-center gap-1 mt-3",
|
|
374
|
+
children: [/* @__PURE__ */ (0, D.jsx)(r, {
|
|
375
|
+
variant: "ghost",
|
|
376
|
+
size: "sm",
|
|
377
|
+
className: "h-6 w-6 p-0 text-green-600",
|
|
378
|
+
children: /* @__PURE__ */ (0, D.jsx)(x, { className: "h-3 w-3" })
|
|
379
|
+
}), /* @__PURE__ */ (0, D.jsx)(r, {
|
|
380
|
+
variant: "ghost",
|
|
381
|
+
size: "sm",
|
|
382
|
+
className: "h-6 w-6 p-0 text-red-500",
|
|
383
|
+
children: /* @__PURE__ */ (0, D.jsx)(b, { className: "h-3 w-3" })
|
|
384
|
+
})]
|
|
385
|
+
})
|
|
386
|
+
]
|
|
387
|
+
})
|
|
388
|
+
}, e.id))
|
|
389
|
+
}) : /* @__PURE__ */ (0, D.jsx)("div", {
|
|
390
|
+
className: "space-y-2",
|
|
391
|
+
children: l.map((e) => /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
392
|
+
className: "flex items-start gap-3 p-3 rounded-lg border hover:bg-muted/30 transition-colors cursor-pointer",
|
|
393
|
+
onClick: () => h(e),
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ (0, D.jsx)("div", {
|
|
396
|
+
className: "mt-1 shrink-0",
|
|
397
|
+
children: /* @__PURE__ */ (0, D.jsx)(v, { className: "h-4 w-4 text-yellow-500" })
|
|
398
|
+
}),
|
|
399
|
+
/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
400
|
+
className: "flex-1 min-w-0",
|
|
401
|
+
children: [/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
402
|
+
className: "flex items-center gap-2 mb-1",
|
|
403
|
+
children: [
|
|
404
|
+
/* @__PURE__ */ (0, D.jsx)("span", {
|
|
405
|
+
className: "font-medium text-sm",
|
|
406
|
+
children: e.title
|
|
407
|
+
}),
|
|
408
|
+
e.category && /* @__PURE__ */ (0, D.jsx)(n, {
|
|
409
|
+
variant: "outline",
|
|
410
|
+
className: "text-xs",
|
|
411
|
+
children: e.category
|
|
412
|
+
}),
|
|
413
|
+
y(e.score)
|
|
414
|
+
]
|
|
415
|
+
}), e.description && /* @__PURE__ */ (0, D.jsx)("p", {
|
|
416
|
+
className: "text-xs text-muted-foreground line-clamp-2",
|
|
417
|
+
children: e.description
|
|
418
|
+
})]
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
421
|
+
className: "flex items-center gap-1 shrink-0",
|
|
422
|
+
children: [e.action && /* @__PURE__ */ (0, D.jsx)(r, {
|
|
423
|
+
variant: "ghost",
|
|
424
|
+
size: "sm",
|
|
425
|
+
className: "h-7 w-7 p-0",
|
|
426
|
+
children: /* @__PURE__ */ (0, D.jsx)(f, { className: "h-3.5 w-3.5" })
|
|
427
|
+
}), /* @__PURE__ */ (0, D.jsx)(r, {
|
|
428
|
+
variant: "ghost",
|
|
429
|
+
size: "sm",
|
|
430
|
+
className: "h-7 w-7 p-0 text-muted-foreground",
|
|
431
|
+
onClick: (t) => {
|
|
432
|
+
t.stopPropagation(), g(e);
|
|
433
|
+
},
|
|
434
|
+
children: /* @__PURE__ */ (0, D.jsx)(S, { className: "h-3.5 w-3.5" })
|
|
435
|
+
})]
|
|
436
|
+
})
|
|
437
|
+
]
|
|
438
|
+
}, e.id))
|
|
439
|
+
}) })] });
|
|
440
|
+
}, A = ({ schema: e, onSubmit: u }) => {
|
|
441
|
+
let { placeholder: f = "Ask a question about your data...", result: p, suggestions: h = [], showHistory: v = !1, history: b = [], loading: x = !1 } = e, [S, C] = t(""), [w, T] = t(p), [E, O] = t(!1), k = E || x, A = (e) => {
|
|
442
|
+
let t = e || S;
|
|
443
|
+
t.trim() && (O(!0), u?.(t), u ? O(!1) : setTimeout(() => {
|
|
444
|
+
T({
|
|
445
|
+
query: t,
|
|
446
|
+
summary: `Results for: "${t}"`,
|
|
447
|
+
confidence: .85,
|
|
448
|
+
data: [],
|
|
449
|
+
columns: []
|
|
450
|
+
}), O(!1);
|
|
451
|
+
}, 1e3));
|
|
452
|
+
}, j = (e) => {
|
|
453
|
+
C(e), A(e);
|
|
454
|
+
};
|
|
455
|
+
return /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
456
|
+
className: "space-y-4",
|
|
457
|
+
children: [
|
|
458
|
+
/* @__PURE__ */ (0, D.jsx)(i, { children: /* @__PURE__ */ (0, D.jsxs)(a, {
|
|
459
|
+
className: "p-4",
|
|
460
|
+
children: [/* @__PURE__ */ (0, D.jsx)("div", {
|
|
461
|
+
className: "flex items-center gap-2",
|
|
462
|
+
children: /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
463
|
+
className: "relative flex-1",
|
|
464
|
+
children: [
|
|
465
|
+
/* @__PURE__ */ (0, D.jsx)(g, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
|
|
466
|
+
/* @__PURE__ */ (0, D.jsx)(c, {
|
|
467
|
+
value: S,
|
|
468
|
+
onChange: (e) => C(e.target.value),
|
|
469
|
+
onKeyDown: (e) => e.key === "Enter" && A(),
|
|
470
|
+
placeholder: f,
|
|
471
|
+
className: "pl-10 pr-20",
|
|
472
|
+
disabled: k
|
|
473
|
+
}),
|
|
474
|
+
/* @__PURE__ */ (0, D.jsx)("div", {
|
|
475
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2",
|
|
476
|
+
children: /* @__PURE__ */ (0, D.jsx)(r, {
|
|
477
|
+
size: "sm",
|
|
478
|
+
onClick: () => A(),
|
|
479
|
+
disabled: k || !S.trim(),
|
|
480
|
+
className: "h-7",
|
|
481
|
+
children: k ? /* @__PURE__ */ (0, D.jsx)(m, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, D.jsxs)(D.Fragment, { children: [/* @__PURE__ */ (0, D.jsx)(_, { className: "h-3.5 w-3.5 mr-1" }), "Ask"] })
|
|
482
|
+
})
|
|
483
|
+
})
|
|
484
|
+
]
|
|
485
|
+
})
|
|
486
|
+
}), h.length > 0 && !w && /* @__PURE__ */ (0, D.jsx)("div", {
|
|
487
|
+
className: "mt-3 flex flex-wrap gap-2",
|
|
488
|
+
children: h.map((e, t) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
489
|
+
onClick: () => j(e),
|
|
490
|
+
className: "text-xs px-2.5 py-1 rounded-full border bg-muted/30 hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",
|
|
491
|
+
disabled: k,
|
|
492
|
+
children: e
|
|
493
|
+
}, t))
|
|
494
|
+
})]
|
|
495
|
+
}) }),
|
|
496
|
+
w && /* @__PURE__ */ (0, D.jsxs)(i, { children: [/* @__PURE__ */ (0, D.jsx)(o, {
|
|
497
|
+
className: "pb-2",
|
|
498
|
+
children: /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
499
|
+
className: "flex items-center justify-between",
|
|
500
|
+
children: [/* @__PURE__ */ (0, D.jsxs)(s, {
|
|
501
|
+
className: "text-sm flex items-center gap-2",
|
|
502
|
+
children: [/* @__PURE__ */ (0, D.jsx)(y, { className: "h-4 w-4" }), "Results"]
|
|
503
|
+
}), w.confidence !== void 0 && /* @__PURE__ */ (0, D.jsxs)(n, {
|
|
504
|
+
variant: w.confidence >= .7 ? "default" : "secondary",
|
|
505
|
+
className: "text-xs",
|
|
506
|
+
children: [Math.round(w.confidence * 100), "% match"]
|
|
507
|
+
})]
|
|
508
|
+
})
|
|
509
|
+
}), /* @__PURE__ */ (0, D.jsxs)(a, { children: [
|
|
510
|
+
w.summary && /* @__PURE__ */ (0, D.jsx)("p", {
|
|
511
|
+
className: "text-sm text-muted-foreground mb-3",
|
|
512
|
+
children: w.summary
|
|
513
|
+
}),
|
|
514
|
+
w.data && w.data.length > 0 && w.columns && /* @__PURE__ */ (0, D.jsx)("div", {
|
|
515
|
+
className: "border rounded-lg overflow-hidden",
|
|
516
|
+
children: /* @__PURE__ */ (0, D.jsxs)("table", {
|
|
517
|
+
className: "w-full text-sm",
|
|
518
|
+
children: [/* @__PURE__ */ (0, D.jsx)("thead", {
|
|
519
|
+
className: "bg-muted",
|
|
520
|
+
children: /* @__PURE__ */ (0, D.jsx)("tr", { children: w.columns.map((e, t) => /* @__PURE__ */ (0, D.jsx)("th", {
|
|
521
|
+
className: "px-4 py-2 text-left font-medium",
|
|
522
|
+
children: e.label || e.name
|
|
523
|
+
}, t)) })
|
|
524
|
+
}), /* @__PURE__ */ (0, D.jsx)("tbody", { children: w.data.map((e, t) => /* @__PURE__ */ (0, D.jsx)("tr", {
|
|
525
|
+
className: "border-t",
|
|
526
|
+
children: w.columns.map((t, n) => /* @__PURE__ */ (0, D.jsx)("td", {
|
|
527
|
+
className: "px-4 py-2",
|
|
528
|
+
children: String(e[t.name] ?? "")
|
|
529
|
+
}, n))
|
|
530
|
+
}, t)) })]
|
|
531
|
+
})
|
|
532
|
+
}),
|
|
533
|
+
(!w.data || w.data.length === 0) && /* @__PURE__ */ (0, D.jsx)("div", {
|
|
534
|
+
className: "text-center py-6 text-muted-foreground text-sm",
|
|
535
|
+
children: "No matching records found"
|
|
536
|
+
})
|
|
537
|
+
] })] }),
|
|
538
|
+
v && b.length > 0 && /* @__PURE__ */ (0, D.jsxs)(i, { children: [/* @__PURE__ */ (0, D.jsx)(o, {
|
|
539
|
+
className: "pb-2",
|
|
540
|
+
children: /* @__PURE__ */ (0, D.jsxs)(s, {
|
|
541
|
+
className: "text-xs text-muted-foreground flex items-center gap-1",
|
|
542
|
+
children: [/* @__PURE__ */ (0, D.jsx)(d, { className: "h-3 w-3" }), "Recent Queries"]
|
|
543
|
+
})
|
|
544
|
+
}), /* @__PURE__ */ (0, D.jsx)(a, {
|
|
545
|
+
className: "space-y-1",
|
|
546
|
+
children: b.slice(0, 5).map((e, t) => /* @__PURE__ */ (0, D.jsxs)("button", {
|
|
547
|
+
onClick: () => j(e.query),
|
|
548
|
+
className: "w-full flex items-center gap-2 p-2 rounded-md text-sm text-left hover:bg-muted/50 transition-colors",
|
|
549
|
+
children: [
|
|
550
|
+
/* @__PURE__ */ (0, D.jsx)(l, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
551
|
+
/* @__PURE__ */ (0, D.jsx)("span", {
|
|
552
|
+
className: "truncate",
|
|
553
|
+
children: e.query
|
|
554
|
+
}),
|
|
555
|
+
/* @__PURE__ */ (0, D.jsx)("span", {
|
|
556
|
+
className: "text-xs text-muted-foreground shrink-0 ml-auto",
|
|
557
|
+
children: new Date(e.timestamp).toLocaleDateString()
|
|
558
|
+
})
|
|
559
|
+
]
|
|
560
|
+
}, t))
|
|
561
|
+
})] })
|
|
562
|
+
]
|
|
563
|
+
});
|
|
628
564
|
};
|
|
565
|
+
e.register("ai-form-assist", O, {
|
|
566
|
+
label: "AI Form Assist",
|
|
567
|
+
category: "AI",
|
|
568
|
+
inputs: [
|
|
569
|
+
{
|
|
570
|
+
name: "formId",
|
|
571
|
+
type: "string",
|
|
572
|
+
label: "Form ID"
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
name: "objectName",
|
|
576
|
+
type: "string",
|
|
577
|
+
label: "Object Name"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: "fields",
|
|
581
|
+
type: "array",
|
|
582
|
+
label: "Fields to suggest"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
name: "suggestions",
|
|
586
|
+
type: "code",
|
|
587
|
+
label: "Suggestions Data"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: "autoFill",
|
|
591
|
+
type: "boolean",
|
|
592
|
+
label: "Auto Fill",
|
|
593
|
+
defaultValue: !1
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
name: "showConfidence",
|
|
597
|
+
type: "boolean",
|
|
598
|
+
label: "Show Confidence",
|
|
599
|
+
defaultValue: !0
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
name: "showReasoning",
|
|
603
|
+
type: "boolean",
|
|
604
|
+
label: "Show Reasoning",
|
|
605
|
+
defaultValue: !1
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
}), e.register("ai-recommendations", k, {
|
|
609
|
+
label: "AI Recommendations",
|
|
610
|
+
category: "AI",
|
|
611
|
+
inputs: [
|
|
612
|
+
{
|
|
613
|
+
name: "objectName",
|
|
614
|
+
type: "string",
|
|
615
|
+
label: "Object Name"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
name: "recommendations",
|
|
619
|
+
type: "code",
|
|
620
|
+
label: "Recommendations Data"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
name: "maxResults",
|
|
624
|
+
type: "number",
|
|
625
|
+
label: "Max Results",
|
|
626
|
+
defaultValue: 10
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
name: "showScores",
|
|
630
|
+
type: "boolean",
|
|
631
|
+
label: "Show Scores",
|
|
632
|
+
defaultValue: !1
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
name: "layout",
|
|
636
|
+
type: "enum",
|
|
637
|
+
label: "Layout",
|
|
638
|
+
enum: [
|
|
639
|
+
{
|
|
640
|
+
label: "List",
|
|
641
|
+
value: "list"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
label: "Grid",
|
|
645
|
+
value: "grid"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
label: "Carousel",
|
|
649
|
+
value: "carousel"
|
|
650
|
+
}
|
|
651
|
+
],
|
|
652
|
+
defaultValue: "list"
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
name: "emptyMessage",
|
|
656
|
+
type: "string",
|
|
657
|
+
label: "Empty Message"
|
|
658
|
+
}
|
|
659
|
+
]
|
|
660
|
+
}), e.register("nl-query", A, {
|
|
661
|
+
label: "Natural Language Query",
|
|
662
|
+
category: "AI",
|
|
663
|
+
inputs: [
|
|
664
|
+
{
|
|
665
|
+
name: "objectName",
|
|
666
|
+
type: "string",
|
|
667
|
+
label: "Object Name"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
name: "placeholder",
|
|
671
|
+
type: "string",
|
|
672
|
+
label: "Placeholder Text"
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
name: "suggestions",
|
|
676
|
+
type: "array",
|
|
677
|
+
label: "Example Queries"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
name: "showHistory",
|
|
681
|
+
type: "boolean",
|
|
682
|
+
label: "Show History",
|
|
683
|
+
defaultValue: !1
|
|
684
|
+
}
|
|
685
|
+
]
|
|
686
|
+
});
|
|
687
|
+
//#endregion
|
|
688
|
+
export { O as AIFormAssist, k as AIRecommendations, A as NLQueryInput };
|