@seed-ship/mcp-ui-solid 2.8.3 → 2.10.0
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/components/ScratchpadPanel.cjs +732 -180
- package/dist/components/ScratchpadPanel.cjs.map +1 -1
- package/dist/components/ScratchpadPanel.d.ts +2 -13
- package/dist/components/ScratchpadPanel.d.ts.map +1 -1
- package/dist/components/ScratchpadPanel.js +733 -181
- package/dist/components/ScratchpadPanel.js.map +1 -1
- package/dist/types/chat-bus.d.ts +25 -1
- package/dist/types/chat-bus.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ScratchpadPanel.tsx +458 -165
- package/src/types/chat-bus.ts +21 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { delegateEvents, getNextElement, template, getNextMarker, insert, createComponent, effect, setAttribute, runHydrationEvents, memo, className, setStyleProperty } from "solid-js/web";
|
|
1
|
+
import { delegateEvents, getNextElement, template, getNextMarker, insert, createComponent, effect, setAttribute, runHydrationEvents, memo, className, setStyleProperty, setProperty } from "solid-js/web";
|
|
2
2
|
import { createSignal, createEffect, onCleanup, Show, For, Switch, Match } from "solid-js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
`), _tmpl$9 = /* @__PURE__ */ template(`<div><span class="flex-shrink-0 mt-0.5"></span><p>`), _tmpl$0 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 mb-2"><span class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide">Preview</span><span class="px-1.5 py-0.5 text-xs font-bold bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded">`), _tmpl$1 = /* @__PURE__ */ template(`<p class="text-sm text-gray-700 dark:text-gray-300">`), _tmpl$10 = /* @__PURE__ */ template(`<div class="mt-2 overflow-x-auto"><table class="min-w-full text-xs"><thead><tr></tr></thead><tbody>`), _tmpl$11 = /* @__PURE__ */ template(`<th class="px-2 py-1 text-left font-medium text-gray-500 dark:text-gray-400">`), _tmpl$12 = /* @__PURE__ */ template(`<tr class="border-t border-gray-100 dark:border-gray-700">`), _tmpl$13 = /* @__PURE__ */ template(`<td class="px-2 py-1 text-gray-700 dark:text-gray-300">`), _tmpl$14 = /* @__PURE__ */ template(`<pre class="text-xs text-gray-500 dark:text-gray-400 overflow-auto">`), _tmpl$15 = /* @__PURE__ */ template(`<div class="px-4 py-3"><h4 class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-2"></h4><!$><!/>`), _tmpl$16 = /* @__PURE__ */ template(`<div class=space-y-1>`), _tmpl$17 = /* @__PURE__ */ template(`<div class="flex gap-2 text-sm"><span class="text-gray-500 dark:text-gray-400 font-mono text-xs min-w-[120px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white text-xs">`), _tmpl$18 = /* @__PURE__ */ template(`<p class="text-xs text-gray-400 italic">No filters applied`), _tmpl$19 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-1.5"><!$><!/><!$><!/>`), _tmpl$20 = /* @__PURE__ */ template(`<button type=button class="ml-0.5 hover:text-blue-900 dark:hover:text-blue-100 transition-colors">×`), _tmpl$21 = /* @__PURE__ */ template(`<span class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-full"><span class="text-blue-500 dark:text-blue-400"><!$><!/>:</span><!$><!/><!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-2">`), _tmpl$23 = /* @__PURE__ */ template(`<span class=mr-1>`), _tmpl$24 = /* @__PURE__ */ template(`<button type=button><!$><!/><!$><!/>`), _tmpl$25 = /* @__PURE__ */ template(`<div class="flex items-center gap-1">`), _tmpl$26 = /* @__PURE__ */ template(`<div>`), _tmpl$27 = /* @__PURE__ */ template(`<div><!$><!/><!$><!/>`);
|
|
3
|
+
import { FormFieldRenderer } from "./FormFieldRenderer.js";
|
|
4
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M19 9l-7 7-7-7">`), _tmpl$2 = /* @__PURE__ */ template(`<button class="p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"aria-label=Close><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M6 18L18 6M6 6l12 12">`), _tmpl$3 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-100 dark:border-gray-700 flex flex-wrap items-center gap-1.5">`), _tmpl$4 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700 space-y-2">`), _tmpl$5 = /* @__PURE__ */ template(`<div class="flex flex-col items-center gap-2 py-4 text-center"><span class=text-2xl>🔍</span><p class="text-sm text-gray-500 dark:text-gray-400">No results for these filters</p><button type=button class="px-3 py-1.5 text-xs font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors">Modify filters`), _tmpl$6 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700">`), _tmpl$7 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700"><button type=button class="w-full px-4 py-2.5 text-sm font-semibold rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors flex items-center justify-center gap-2"><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>Search`), _tmpl$8 = /* @__PURE__ */ template(`<div style=overflow-y:auto><!$><!/><div class="divide-y divide-gray-100 dark:divide-gray-700"></div><!$><!/><!$><!/><!$><!/>`), _tmpl$9 = /* @__PURE__ */ template(`<div style="animation:scratchpad-slide-down 0.2s ease-out"><div><div class="flex items-center gap-2"><span class=text-base>📝</span><h3 class="text-sm font-semibold text-gray-900 dark:text-white"></h3><!$><!/></div><div class="flex items-center gap-2"><span></span><!$><!/></div></div><!$><!/><style>
|
|
5
|
+
@keyframes scratchpad-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
|
|
6
|
+
`), _tmpl$0 = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-gray-300 dark:text-gray-600 flex-shrink-0"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 5l7 7-7 7">`), _tmpl$1 = /* @__PURE__ */ template(`<span class="ml-1 font-normal opacity-75">— <!$><!/>`), _tmpl$10 = /* @__PURE__ */ template(`<span><!$><!/> <!$><!/><!$><!/>`), _tmpl$11 = /* @__PURE__ */ template(`<div><span class="flex-shrink-0 mt-0.5"></span><p>`), _tmpl$12 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 mb-2"><span class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide">Preview</span><span class="px-1.5 py-0.5 text-xs font-bold bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded">`), _tmpl$13 = /* @__PURE__ */ template(`<p class="text-sm text-gray-700 dark:text-gray-300">`), _tmpl$14 = /* @__PURE__ */ template(`<div class="mt-2 overflow-x-auto"><table class="min-w-full text-xs"><thead><tr></tr></thead><tbody>`), _tmpl$15 = /* @__PURE__ */ template(`<th class="px-2 py-1 text-left font-medium text-gray-500 dark:text-gray-400">`), _tmpl$16 = /* @__PURE__ */ template(`<tr class="border-t border-gray-100 dark:border-gray-700">`), _tmpl$17 = /* @__PURE__ */ template(`<td class="px-2 py-1 text-gray-700 dark:text-gray-300">`), _tmpl$18 = /* @__PURE__ */ template(`<pre class="text-xs text-gray-500 overflow-auto">`), _tmpl$19 = /* @__PURE__ */ template(`<div class="px-4 py-3"><h4 class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-2"></h4><!$><!/>`), _tmpl$20 = /* @__PURE__ */ template(`<div class=space-y-1>`), _tmpl$21 = /* @__PURE__ */ template(`<div class="flex gap-2 text-xs"><span class="text-gray-500 dark:text-gray-400 font-mono min-w-[120px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white">`), _tmpl$22 = /* @__PURE__ */ template(`<p class="text-xs text-gray-400 italic">No filters`), _tmpl$23 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-1.5"><!$><!/><!$><!/>`), _tmpl$24 = /* @__PURE__ */ template(`<button type=button class="ml-0.5 hover:text-blue-900 dark:hover:text-blue-100">×`), _tmpl$25 = /* @__PURE__ */ template(`<span class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-full"><button type=button class=hover:underline><span class="text-blue-500 dark:text-blue-400"><!$><!/>:</span> <!$><!/></button><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<div class="max-h-48 overflow-y-auto">`), _tmpl$27 = /* @__PURE__ */ template(`<button type=button class="mt-1 w-full px-2 py-1 text-xs text-gray-500 hover:text-gray-700 text-center">Cancel`), _tmpl$28 = /* @__PURE__ */ template(`<div class="absolute z-50 mt-1 left-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg p-2 min-w-[200px]">`), _tmpl$29 = /* @__PURE__ */ template(`<div class=relative><!$><!/><!$><!/>`), _tmpl$30 = /* @__PURE__ */ template(`<button type=button class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium border border-dashed border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 rounded-full hover:border-blue-400 hover:text-blue-500 transition-colors">+ <!$><!/>`), _tmpl$31 = /* @__PURE__ */ template(`<form class="flex gap-1"><input type=text autofocus class="flex-1 px-2 py-1 text-sm border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:border-blue-400 outline-none"><button type=submit class="px-2 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700">OK</button><button type=button class="px-2 py-1 text-xs text-gray-500 hover:text-gray-700">Cancel`), _tmpl$32 = /* @__PURE__ */ template(`<span class=ml-1>✓`), _tmpl$33 = /* @__PURE__ */ template(`<button type=button><!$><!/><!$><!/>`), _tmpl$34 = /* @__PURE__ */ template(`<form class="flex flex-col gap-3"><!$><!/><div class="flex justify-end"><button type=submit class="px-4 py-2 text-sm font-medium rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors">`), _tmpl$35 = /* @__PURE__ */ template(`<div class="flex justify-end"><button type=button class="px-3 py-1.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors flex items-center gap-1">Next <svg class="w-3.5 h-3.5"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 5l7 7-7 7">`), _tmpl$36 = /* @__PURE__ */ template(`<div class=space-y-3><!$><!/><!$><!/>`), _tmpl$37 = /* @__PURE__ */ template(`<span class="text-xs font-normal text-gray-500 dark:text-gray-400">— <!$><!/>`), _tmpl$38 = /* @__PURE__ */ template(`<div class="mt-2 ml-6">`), _tmpl$39 = /* @__PURE__ */ template(`<div><div><span></span><!$><!/><!$><!/></div><!$><!/>`), _tmpl$40 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-2">`), _tmpl$41 = /* @__PURE__ */ template(`<span class=mr-1>`), _tmpl$42 = /* @__PURE__ */ template(`<div class=space-y-2><div class=space-y-1.5></div><!$><!/>`), _tmpl$43 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 text-sm"><span></span><span class="text-gray-900 dark:text-white">`), _tmpl$44 = /* @__PURE__ */ template(`<div class="flex items-start gap-1.5 text-xs text-amber-600 dark:text-amber-400"><span class=flex-shrink-0>⚠️</span><span>`), _tmpl$45 = /* @__PURE__ */ template(`<input type=text class="w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:border-blue-400 outline-none">`), _tmpl$46 = /* @__PURE__ */ template(`<div class=space-y-3><p class="text-sm text-gray-700 dark:text-gray-300"></p><div class="flex gap-2"><button type=button class="px-3 py-1.5 text-sm font-medium rounded-lg bg-green-600 text-white hover:bg-green-700 transition-colors flex items-center gap-1">👍 <!$><!/></button><button type=button class="px-3 py-1.5 text-sm font-medium rounded-lg border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex items-center gap-1">👎 <!$><!/></button></div><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 italic">"<!$><!/>"`), _tmpl$48 = /* @__PURE__ */ template(`<div class="mt-2 px-3 py-2 bg-blue-50 dark:bg-blue-900/10 rounded-lg text-sm text-blue-700 dark:text-blue-300"><span class=font-medium>Plan:</span> <!$><!/>`), _tmpl$49 = /* @__PURE__ */ template(`<button type=button class="text-xs text-blue-600 dark:text-blue-400 hover:underline flex items-center gap-1">✎ Modify`), _tmpl$50 = /* @__PURE__ */ template(`<div class=space-y-2><!$><!/><div class=space-y-1></div><!$><!/><!$><!/>`), _tmpl$51 = /* @__PURE__ */ template(`<div class="flex gap-2 text-sm"><span class="text-gray-500 dark:text-gray-400 font-medium min-w-[80px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white">`);
|
|
9
7
|
const STATUS_BADGES = {
|
|
10
8
|
loading: {
|
|
11
9
|
label: "Loading...",
|
|
@@ -30,9 +28,13 @@ const STATUS_BADGES = {
|
|
|
30
28
|
};
|
|
31
29
|
const ScratchpadPanel = (props) => {
|
|
32
30
|
const [collapsed, setCollapsed] = createSignal(false);
|
|
31
|
+
const [localPreview, setLocalPreview] = createSignal(void 0);
|
|
32
|
+
let previewTimer = null;
|
|
33
33
|
const badge = () => STATUS_BADGES[props.state.status] || STATUS_BADGES.loading;
|
|
34
34
|
const isClosable = () => props.closable !== false;
|
|
35
35
|
const isCollapsible = () => props.collapsible !== false;
|
|
36
|
+
const preview = () => localPreview() || props.state.preview;
|
|
37
|
+
const hasFilters = () => Object.keys(props.state.filters || {}).length > 0;
|
|
36
38
|
createEffect(() => {
|
|
37
39
|
if (props.state.status === "complete" && props.autoCloseDelay) {
|
|
38
40
|
const timer = setTimeout(() => {
|
|
@@ -42,13 +44,36 @@ const ScratchpadPanel = (props) => {
|
|
|
42
44
|
onCleanup(() => clearTimeout(timer));
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
createEffect(() => {
|
|
48
|
+
const endpoint = props.state.previewEndpoint;
|
|
49
|
+
if (!endpoint) return;
|
|
50
|
+
const filters = props.state.filters;
|
|
51
|
+
if (!filters || Object.keys(filters).length === 0) return;
|
|
52
|
+
if (previewTimer) clearTimeout(previewTimer);
|
|
53
|
+
previewTimer = setTimeout(async () => {
|
|
54
|
+
try {
|
|
55
|
+
const res = await fetch(endpoint, {
|
|
56
|
+
method: "POST",
|
|
57
|
+
headers: {
|
|
58
|
+
"Content-Type": "application/json"
|
|
59
|
+
},
|
|
60
|
+
credentials: "include",
|
|
61
|
+
body: JSON.stringify({
|
|
62
|
+
filters
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
if (res.ok) setLocalPreview(await res.json());
|
|
66
|
+
} catch {
|
|
67
|
+
}
|
|
68
|
+
}, props.state.previewDebounce || 500);
|
|
69
|
+
});
|
|
70
|
+
onCleanup(() => {
|
|
71
|
+
if (previewTimer) clearTimeout(previewTimer);
|
|
72
|
+
});
|
|
48
73
|
return (() => {
|
|
49
|
-
var _el$ = getNextElement(_tmpl$
|
|
50
|
-
_el$
|
|
51
|
-
_el$2.$$click =
|
|
74
|
+
var _el$ = getNextElement(_tmpl$9), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$7 = _el$5.nextSibling, [_el$8, _co$] = getNextMarker(_el$7.nextSibling), _el$9 = _el$3.nextSibling, _el$0 = _el$9.firstChild, _el$10 = _el$0.nextSibling, [_el$11, _co$2] = getNextMarker(_el$10.nextSibling), _el$32 = _el$2.nextSibling, [_el$33, _co$7] = getNextMarker(_el$32.nextSibling);
|
|
75
|
+
_el$33.nextSibling;
|
|
76
|
+
_el$2.$$click = () => isCollapsible() && setCollapsed(!collapsed());
|
|
52
77
|
insert(_el$5, () => props.state.title);
|
|
53
78
|
insert(_el$3, createComponent(Show, {
|
|
54
79
|
get when() {
|
|
@@ -81,8 +106,49 @@ const ScratchpadPanel = (props) => {
|
|
|
81
106
|
return !collapsed();
|
|
82
107
|
},
|
|
83
108
|
get children() {
|
|
84
|
-
var _el$12 = getNextElement(_tmpl$
|
|
85
|
-
insert(_el$
|
|
109
|
+
var _el$12 = getNextElement(_tmpl$8), _el$23 = _el$12.firstChild, [_el$24, _co$3] = getNextMarker(_el$23.nextSibling), _el$14 = _el$24.nextSibling, _el$25 = _el$14.nextSibling, [_el$26, _co$4] = getNextMarker(_el$25.nextSibling), _el$27 = _el$26.nextSibling, [_el$28, _co$5] = getNextMarker(_el$27.nextSibling), _el$29 = _el$28.nextSibling, [_el$30, _co$6] = getNextMarker(_el$29.nextSibling);
|
|
110
|
+
insert(_el$12, createComponent(Show, {
|
|
111
|
+
get when() {
|
|
112
|
+
return memo(() => !!props.state.turnHistory)() && props.state.turnHistory.length > 0;
|
|
113
|
+
},
|
|
114
|
+
get children() {
|
|
115
|
+
var _el$13 = getNextElement(_tmpl$3);
|
|
116
|
+
insert(_el$13, createComponent(For, {
|
|
117
|
+
get each() {
|
|
118
|
+
return props.state.turnHistory;
|
|
119
|
+
},
|
|
120
|
+
children: (turn, i) => [createComponent(Show, {
|
|
121
|
+
get when() {
|
|
122
|
+
return i() > 0;
|
|
123
|
+
},
|
|
124
|
+
get children() {
|
|
125
|
+
return getNextElement(_tmpl$0);
|
|
126
|
+
}
|
|
127
|
+
}), (() => {
|
|
128
|
+
var _el$35 = getNextElement(_tmpl$10), _el$41 = _el$35.firstChild, [_el$42, _co$9] = getNextMarker(_el$41.nextSibling), _el$36 = _el$42.nextSibling, _el$43 = _el$36.nextSibling, [_el$44, _co$0] = getNextMarker(_el$43.nextSibling), _el$45 = _el$44.nextSibling, [_el$46, _co$1] = getNextMarker(_el$45.nextSibling);
|
|
129
|
+
insert(_el$35, (() => {
|
|
130
|
+
var _c$ = memo(() => turn.status === "done");
|
|
131
|
+
return () => _c$() ? "✅" : turn.status === "active" ? "●" : "○";
|
|
132
|
+
})(), _el$42, _co$9);
|
|
133
|
+
insert(_el$35, () => turn.label, _el$44, _co$0);
|
|
134
|
+
insert(_el$35, createComponent(Show, {
|
|
135
|
+
get when() {
|
|
136
|
+
return turn.summary;
|
|
137
|
+
},
|
|
138
|
+
get children() {
|
|
139
|
+
var _el$37 = getNextElement(_tmpl$1), _el$38 = _el$37.firstChild, _el$39 = _el$38.nextSibling, [_el$40, _co$8] = getNextMarker(_el$39.nextSibling);
|
|
140
|
+
insert(_el$37, () => turn.summary, _el$40, _co$8);
|
|
141
|
+
return _el$37;
|
|
142
|
+
}
|
|
143
|
+
}), _el$46, _co$1);
|
|
144
|
+
effect(() => className(_el$35, `text-xs font-medium px-2 py-0.5 rounded-full ${turn.status === "done" ? "bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400" : turn.status === "active" ? "bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400" : turn.status === "skipped" ? "bg-gray-100 dark:bg-gray-700 text-gray-400 line-through" : "bg-gray-100 dark:bg-gray-700 text-gray-400"}`));
|
|
145
|
+
return _el$35;
|
|
146
|
+
})()]
|
|
147
|
+
}));
|
|
148
|
+
return _el$13;
|
|
149
|
+
}
|
|
150
|
+
}), _el$24, _co$3);
|
|
151
|
+
insert(_el$14, createComponent(For, {
|
|
86
152
|
get each() {
|
|
87
153
|
return props.state.sections;
|
|
88
154
|
},
|
|
@@ -107,117 +173,126 @@ const ScratchpadPanel = (props) => {
|
|
|
107
173
|
return props.state.agentMessages.length > 0;
|
|
108
174
|
},
|
|
109
175
|
get children() {
|
|
110
|
-
var _el$
|
|
111
|
-
insert(_el$
|
|
176
|
+
var _el$15 = getNextElement(_tmpl$4);
|
|
177
|
+
insert(_el$15, createComponent(For, {
|
|
112
178
|
get each() {
|
|
113
179
|
return props.state.agentMessages;
|
|
114
180
|
},
|
|
115
181
|
children: (msg) => (() => {
|
|
116
|
-
var _el$
|
|
117
|
-
insert(_el$
|
|
118
|
-
var _c$ = memo(() => msg.type === "warning");
|
|
119
|
-
return () => _c$() ? "⚠️" : msg.type === "question" ? "❓" : "ℹ️";
|
|
182
|
+
var _el$47 = getNextElement(_tmpl$11), _el$48 = _el$47.firstChild, _el$49 = _el$48.nextSibling;
|
|
183
|
+
insert(_el$48, (() => {
|
|
184
|
+
var _c$2 = memo(() => msg.type === "warning");
|
|
185
|
+
return () => _c$2() ? "⚠️" : msg.type === "question" ? "❓" : "ℹ️";
|
|
120
186
|
})());
|
|
121
|
-
insert(_el$
|
|
122
|
-
effect(() => className(_el$
|
|
123
|
-
return _el$
|
|
187
|
+
insert(_el$49, () => msg.text);
|
|
188
|
+
effect(() => className(_el$47, `flex items-start gap-2 text-sm rounded-lg px-3 py-2 ${msg.type === "warning" ? "bg-amber-50 dark:bg-amber-900/10 text-amber-700 dark:text-amber-400" : msg.type === "question" ? "bg-blue-50 dark:bg-blue-900/10 text-blue-700 dark:text-blue-400 border border-blue-200 dark:border-blue-800" : "bg-gray-50 dark:bg-gray-700/50 text-gray-600 dark:text-gray-400"}`));
|
|
189
|
+
return _el$47;
|
|
124
190
|
})()
|
|
125
191
|
}));
|
|
126
|
-
return _el$
|
|
192
|
+
return _el$15;
|
|
127
193
|
}
|
|
128
|
-
}), _el$
|
|
194
|
+
}), _el$26, _co$4);
|
|
129
195
|
insert(_el$12, createComponent(Show, {
|
|
130
196
|
get when() {
|
|
131
|
-
return
|
|
197
|
+
return preview();
|
|
132
198
|
},
|
|
133
199
|
get children() {
|
|
134
|
-
var _el$
|
|
135
|
-
insert(_el$
|
|
200
|
+
var _el$16 = getNextElement(_tmpl$6);
|
|
201
|
+
insert(_el$16, createComponent(Show, {
|
|
136
202
|
get when() {
|
|
137
|
-
return
|
|
203
|
+
return preview().count === 0;
|
|
138
204
|
},
|
|
139
205
|
get fallback() {
|
|
140
206
|
return [(() => {
|
|
141
|
-
var _el$
|
|
142
|
-
insert(_el$
|
|
143
|
-
return _el$
|
|
207
|
+
var _el$50 = getNextElement(_tmpl$12), _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling;
|
|
208
|
+
insert(_el$52, () => preview().count.toLocaleString());
|
|
209
|
+
return _el$50;
|
|
144
210
|
})(), (() => {
|
|
145
|
-
var _el$
|
|
146
|
-
insert(_el$
|
|
147
|
-
return _el$
|
|
211
|
+
var _el$53 = getNextElement(_tmpl$13);
|
|
212
|
+
insert(_el$53, () => preview().summary);
|
|
213
|
+
return _el$53;
|
|
148
214
|
})(), createComponent(Show, {
|
|
149
215
|
get when() {
|
|
150
|
-
return memo(() => !!
|
|
216
|
+
return memo(() => !!preview().rows)() && preview().rows.length > 0;
|
|
151
217
|
},
|
|
152
218
|
get children() {
|
|
153
|
-
var _el$
|
|
154
|
-
insert(_el$
|
|
219
|
+
var _el$54 = getNextElement(_tmpl$14), _el$55 = _el$54.firstChild, _el$56 = _el$55.firstChild, _el$57 = _el$56.firstChild, _el$58 = _el$56.nextSibling;
|
|
220
|
+
insert(_el$57, createComponent(For, {
|
|
155
221
|
get each() {
|
|
156
|
-
return Object.keys(
|
|
222
|
+
return Object.keys(preview().rows[0]);
|
|
157
223
|
},
|
|
158
|
-
children: (
|
|
159
|
-
var _el$
|
|
160
|
-
insert(_el$
|
|
161
|
-
return _el$
|
|
224
|
+
children: (k) => (() => {
|
|
225
|
+
var _el$59 = getNextElement(_tmpl$15);
|
|
226
|
+
insert(_el$59, k);
|
|
227
|
+
return _el$59;
|
|
162
228
|
})()
|
|
163
229
|
}));
|
|
164
|
-
insert(_el$
|
|
230
|
+
insert(_el$58, createComponent(For, {
|
|
165
231
|
get each() {
|
|
166
|
-
return
|
|
232
|
+
return preview().rows.slice(0, 5);
|
|
167
233
|
},
|
|
168
234
|
children: (row) => (() => {
|
|
169
|
-
var _el$
|
|
170
|
-
insert(_el$
|
|
235
|
+
var _el$60 = getNextElement(_tmpl$16);
|
|
236
|
+
insert(_el$60, createComponent(For, {
|
|
171
237
|
get each() {
|
|
172
238
|
return Object.values(row);
|
|
173
239
|
},
|
|
174
|
-
children: (
|
|
175
|
-
var _el$
|
|
176
|
-
insert(_el$
|
|
177
|
-
return _el$
|
|
240
|
+
children: (v) => (() => {
|
|
241
|
+
var _el$61 = getNextElement(_tmpl$17);
|
|
242
|
+
insert(_el$61, () => String(v));
|
|
243
|
+
return _el$61;
|
|
178
244
|
})()
|
|
179
245
|
}));
|
|
180
|
-
return _el$
|
|
246
|
+
return _el$60;
|
|
181
247
|
})()
|
|
182
248
|
}));
|
|
183
|
-
return _el$
|
|
249
|
+
return _el$54;
|
|
184
250
|
}
|
|
185
251
|
})];
|
|
186
252
|
},
|
|
187
253
|
get children() {
|
|
188
|
-
var _el$
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
_el$19.$$click = () => {
|
|
196
|
-
var _a;
|
|
197
|
-
return (_a = props.onAction) == null ? void 0 : _a.call(props, "refine_filters");
|
|
198
|
-
};
|
|
199
|
-
runHydrationEvents();
|
|
200
|
-
return _el$19;
|
|
201
|
-
}
|
|
202
|
-
}), _el$21, _co$3);
|
|
203
|
-
return _el$16;
|
|
254
|
+
var _el$17 = getNextElement(_tmpl$5), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$19.nextSibling;
|
|
255
|
+
_el$20.$$click = () => {
|
|
256
|
+
var _a;
|
|
257
|
+
return (_a = props.onAction) == null ? void 0 : _a.call(props, "refine_filters");
|
|
258
|
+
};
|
|
259
|
+
runHydrationEvents();
|
|
260
|
+
return _el$17;
|
|
204
261
|
}
|
|
205
262
|
}));
|
|
206
|
-
return _el$
|
|
263
|
+
return _el$16;
|
|
207
264
|
}
|
|
208
|
-
}), _el$
|
|
209
|
-
|
|
265
|
+
}), _el$28, _co$5);
|
|
266
|
+
insert(_el$12, createComponent(Show, {
|
|
267
|
+
get when() {
|
|
268
|
+
return memo(() => props.state.status === "waiting_human")() && hasFilters();
|
|
269
|
+
},
|
|
270
|
+
get children() {
|
|
271
|
+
var _el$21 = getNextElement(_tmpl$7), _el$22 = _el$21.firstChild;
|
|
272
|
+
_el$22.$$click = () => {
|
|
273
|
+
var _a;
|
|
274
|
+
return (_a = props.onAction) == null ? void 0 : _a.call(props, "search", {
|
|
275
|
+
filters: props.state.filters
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
runHydrationEvents();
|
|
279
|
+
return _el$21;
|
|
280
|
+
}
|
|
281
|
+
}), _el$30, _co$6);
|
|
282
|
+
effect((_$p) => setStyleProperty(_el$12, "max-height", props.maxHeight || "500px"));
|
|
210
283
|
return _el$12;
|
|
211
284
|
}
|
|
212
|
-
}), _el$
|
|
285
|
+
}), _el$33, _co$7);
|
|
213
286
|
effect((_p$) => {
|
|
214
|
-
var _v$ = `flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-700 ${isCollapsible() ? "cursor-pointer select-none hover:bg-gray-50 dark:hover:bg-gray-750" : ""}`, _v$
|
|
215
|
-
_v$ !== _p$.e && className(_el
|
|
216
|
-
_v$2 !== _p$.t && className(_el$
|
|
287
|
+
var _v$ = `w-full bg-white dark:bg-gray-800 rounded-xl border shadow-lg overflow-visible ${props.state.status === "waiting_human" ? "border-blue-300 dark:border-blue-600" : "border-gray-200 dark:border-gray-700"}`, _v$2 = `flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-700 ${isCollapsible() ? "cursor-pointer select-none hover:bg-gray-50 dark:hover:bg-gray-750" : ""}`, _v$3 = `px-2 py-0.5 text-xs font-medium rounded-full ${badge().class}`;
|
|
288
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
289
|
+
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
290
|
+
_v$3 !== _p$.a && className(_el$0, _p$.a = _v$3);
|
|
217
291
|
return _p$;
|
|
218
292
|
}, {
|
|
219
293
|
e: void 0,
|
|
220
|
-
t: void 0
|
|
294
|
+
t: void 0,
|
|
295
|
+
a: void 0
|
|
221
296
|
});
|
|
222
297
|
runHydrationEvents();
|
|
223
298
|
return _el$;
|
|
@@ -225,9 +300,9 @@ const ScratchpadPanel = (props) => {
|
|
|
225
300
|
};
|
|
226
301
|
const SectionRenderer = (props) => {
|
|
227
302
|
return (() => {
|
|
228
|
-
var _el$
|
|
229
|
-
insert(_el$
|
|
230
|
-
insert(_el$
|
|
303
|
+
var _el$62 = getNextElement(_tmpl$19), _el$63 = _el$62.firstChild, _el$66 = _el$63.nextSibling, [_el$67, _co$10] = getNextMarker(_el$66.nextSibling);
|
|
304
|
+
insert(_el$63, () => props.section.title);
|
|
305
|
+
insert(_el$62, createComponent(Switch, {
|
|
231
306
|
get children() {
|
|
232
307
|
return [createComponent(Match, {
|
|
233
308
|
get when() {
|
|
@@ -245,7 +320,10 @@ const SectionRenderer = (props) => {
|
|
|
245
320
|
return props.section.type === "filter";
|
|
246
321
|
},
|
|
247
322
|
get children() {
|
|
248
|
-
return createComponent(
|
|
323
|
+
return createComponent(InteractiveFilterSection, {
|
|
324
|
+
get content() {
|
|
325
|
+
return props.section.content;
|
|
326
|
+
},
|
|
249
327
|
get filters() {
|
|
250
328
|
return props.filters;
|
|
251
329
|
},
|
|
@@ -259,9 +337,9 @@ const SectionRenderer = (props) => {
|
|
|
259
337
|
return props.section.type === "message";
|
|
260
338
|
},
|
|
261
339
|
get children() {
|
|
262
|
-
var _el$
|
|
263
|
-
insert(_el$
|
|
264
|
-
return _el$
|
|
340
|
+
var _el$64 = getNextElement(_tmpl$13);
|
|
341
|
+
insert(_el$64, () => String(props.section.content));
|
|
342
|
+
return _el$64;
|
|
265
343
|
}
|
|
266
344
|
}), createComponent(Match, {
|
|
267
345
|
get when() {
|
|
@@ -282,52 +360,122 @@ const SectionRenderer = (props) => {
|
|
|
282
360
|
return props.section.type === "steps";
|
|
283
361
|
},
|
|
284
362
|
get children() {
|
|
285
|
-
return createComponent(
|
|
363
|
+
return createComponent(EnrichedStepsSection, {
|
|
364
|
+
get content() {
|
|
365
|
+
return props.section.content;
|
|
366
|
+
},
|
|
367
|
+
get onAction() {
|
|
368
|
+
return props.onAction;
|
|
369
|
+
},
|
|
370
|
+
get onFilterChange() {
|
|
371
|
+
return props.onFilterChange;
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}), createComponent(Match, {
|
|
376
|
+
get when() {
|
|
377
|
+
return props.section.type === "form";
|
|
378
|
+
},
|
|
379
|
+
get children() {
|
|
380
|
+
return createComponent(EmbeddedFormSection, {
|
|
381
|
+
get content() {
|
|
382
|
+
return props.section.content;
|
|
383
|
+
},
|
|
384
|
+
get sectionId() {
|
|
385
|
+
return props.section.id;
|
|
386
|
+
},
|
|
387
|
+
get onAction() {
|
|
388
|
+
return props.onAction;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
}), createComponent(Match, {
|
|
393
|
+
get when() {
|
|
394
|
+
return props.section.type === "understanding";
|
|
395
|
+
},
|
|
396
|
+
get children() {
|
|
397
|
+
return createComponent(UnderstandingSection, {
|
|
286
398
|
get content() {
|
|
287
399
|
return props.section.content;
|
|
288
400
|
}
|
|
289
401
|
});
|
|
290
402
|
}
|
|
403
|
+
}), createComponent(Match, {
|
|
404
|
+
get when() {
|
|
405
|
+
return props.section.type === "feedback";
|
|
406
|
+
},
|
|
407
|
+
get children() {
|
|
408
|
+
return createComponent(FeedbackSection, {
|
|
409
|
+
get content() {
|
|
410
|
+
return props.section.content;
|
|
411
|
+
},
|
|
412
|
+
get onAction() {
|
|
413
|
+
return props.onAction;
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}), createComponent(Match, {
|
|
418
|
+
get when() {
|
|
419
|
+
return props.section.type === "prompt";
|
|
420
|
+
},
|
|
421
|
+
get children() {
|
|
422
|
+
return createComponent(PromptSection, {
|
|
423
|
+
get content() {
|
|
424
|
+
return props.section.content;
|
|
425
|
+
},
|
|
426
|
+
get onAction() {
|
|
427
|
+
return props.onAction;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
291
431
|
}), createComponent(Match, {
|
|
292
432
|
when: true,
|
|
293
433
|
get children() {
|
|
294
|
-
var _el$
|
|
295
|
-
insert(_el$
|
|
296
|
-
return _el$
|
|
434
|
+
var _el$65 = getNextElement(_tmpl$18);
|
|
435
|
+
insert(_el$65, () => JSON.stringify(props.section.content, null, 2));
|
|
436
|
+
return _el$65;
|
|
297
437
|
}
|
|
298
438
|
})];
|
|
299
439
|
}
|
|
300
|
-
}), _el$
|
|
301
|
-
return _el$
|
|
440
|
+
}), _el$67, _co$10);
|
|
441
|
+
return _el$62;
|
|
302
442
|
})();
|
|
303
443
|
};
|
|
304
444
|
const DataSection = (props) => {
|
|
305
|
-
const entries = () =>
|
|
306
|
-
if (typeof props.content !== "object" || !props.content) return [];
|
|
307
|
-
return Object.entries(props.content);
|
|
308
|
-
};
|
|
445
|
+
const entries = () => typeof props.content === "object" && props.content ? Object.entries(props.content) : [];
|
|
309
446
|
return (() => {
|
|
310
|
-
var _el$
|
|
311
|
-
insert(_el$
|
|
447
|
+
var _el$68 = getNextElement(_tmpl$20);
|
|
448
|
+
insert(_el$68, createComponent(For, {
|
|
312
449
|
get each() {
|
|
313
450
|
return entries();
|
|
314
451
|
},
|
|
315
|
-
children: ([
|
|
316
|
-
var _el$
|
|
317
|
-
_el$
|
|
318
|
-
var _el$
|
|
319
|
-
insert(_el$
|
|
320
|
-
insert(_el$
|
|
321
|
-
var _c$
|
|
322
|
-
return () => _c$
|
|
452
|
+
children: ([k, v]) => (() => {
|
|
453
|
+
var _el$69 = getNextElement(_tmpl$21), _el$70 = _el$69.firstChild, _el$72 = _el$70.firstChild, [_el$73, _co$11] = getNextMarker(_el$72.nextSibling);
|
|
454
|
+
_el$73.nextSibling;
|
|
455
|
+
var _el$74 = _el$70.nextSibling;
|
|
456
|
+
insert(_el$70, k, _el$73, _co$11);
|
|
457
|
+
insert(_el$74, (() => {
|
|
458
|
+
var _c$3 = memo(() => !!Array.isArray(v));
|
|
459
|
+
return () => _c$3() ? v.join(", ") : String(v);
|
|
323
460
|
})());
|
|
324
|
-
return _el$
|
|
461
|
+
return _el$69;
|
|
325
462
|
})()
|
|
326
463
|
}));
|
|
327
|
-
return _el$
|
|
464
|
+
return _el$68;
|
|
328
465
|
})();
|
|
329
466
|
};
|
|
330
|
-
const
|
|
467
|
+
const InteractiveFilterSection = (props) => {
|
|
468
|
+
const [editingKey, setEditingKey] = createSignal(null);
|
|
469
|
+
const [editValue, setEditValue] = createSignal("");
|
|
470
|
+
const filterDefs = () => {
|
|
471
|
+
if (typeof props.content === "object" && props.content) return props.content;
|
|
472
|
+
return {};
|
|
473
|
+
};
|
|
474
|
+
const allKeys = () => {
|
|
475
|
+
const fromContent = Object.keys(filterDefs());
|
|
476
|
+
const fromFilters = Object.keys(props.filters || {});
|
|
477
|
+
return [.../* @__PURE__ */ new Set([...fromContent, ...fromFilters])];
|
|
478
|
+
};
|
|
331
479
|
const removeFilter = (key) => {
|
|
332
480
|
var _a;
|
|
333
481
|
const next = {
|
|
@@ -336,119 +484,523 @@ const FilterSection = (props) => {
|
|
|
336
484
|
delete next[key];
|
|
337
485
|
(_a = props.onFilterChange) == null ? void 0 : _a.call(props, next);
|
|
338
486
|
};
|
|
339
|
-
const
|
|
487
|
+
const setFilter = (key, value) => {
|
|
488
|
+
var _a;
|
|
489
|
+
(_a = props.onFilterChange) == null ? void 0 : _a.call(props, {
|
|
490
|
+
...props.filters,
|
|
491
|
+
[key]: value
|
|
492
|
+
});
|
|
493
|
+
setEditingKey(null);
|
|
494
|
+
setEditValue("");
|
|
495
|
+
};
|
|
496
|
+
const getDef = (key) => filterDefs()[key] || {};
|
|
340
497
|
return (() => {
|
|
341
|
-
var _el$
|
|
342
|
-
insert(_el$
|
|
498
|
+
var _el$75 = getNextElement(_tmpl$23), _el$77 = _el$75.firstChild, [_el$78, _co$12] = getNextMarker(_el$77.nextSibling), _el$79 = _el$78.nextSibling, [_el$80, _co$13] = getNextMarker(_el$79.nextSibling);
|
|
499
|
+
insert(_el$75, createComponent(For, {
|
|
343
500
|
get each() {
|
|
344
|
-
return
|
|
501
|
+
return allKeys();
|
|
345
502
|
},
|
|
346
|
-
children: (
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
503
|
+
children: (key) => {
|
|
504
|
+
const def = () => getDef(key);
|
|
505
|
+
const value = () => props.filters[key];
|
|
506
|
+
const hasValue = () => value() !== void 0 && value() !== "";
|
|
507
|
+
return (() => {
|
|
508
|
+
var _el$81 = getNextElement(_tmpl$29), _el$97 = _el$81.firstChild, [_el$98, _co$17] = getNextMarker(_el$97.nextSibling), _el$99 = _el$98.nextSibling, [_el$100, _co$18] = getNextMarker(_el$99.nextSibling);
|
|
509
|
+
insert(_el$81, createComponent(Show, {
|
|
510
|
+
get when() {
|
|
511
|
+
return hasValue();
|
|
512
|
+
},
|
|
513
|
+
get fallback() {
|
|
514
|
+
return (() => {
|
|
515
|
+
var _el$101 = getNextElement(_tmpl$30), _el$102 = _el$101.firstChild, _el$103 = _el$102.nextSibling, [_el$104, _co$19] = getNextMarker(_el$103.nextSibling);
|
|
516
|
+
_el$101.$$click = () => {
|
|
517
|
+
setEditingKey(key);
|
|
518
|
+
setEditValue("");
|
|
519
|
+
};
|
|
520
|
+
insert(_el$101, () => {
|
|
521
|
+
var _a;
|
|
522
|
+
return ((_a = def()) == null ? void 0 : _a.label) || key;
|
|
523
|
+
}, _el$104, _co$19);
|
|
524
|
+
runHydrationEvents();
|
|
525
|
+
return _el$101;
|
|
526
|
+
})();
|
|
527
|
+
},
|
|
528
|
+
get children() {
|
|
529
|
+
var _el$82 = getNextElement(_tmpl$25), _el$83 = _el$82.firstChild, _el$84 = _el$83.firstChild, _el$86 = _el$84.firstChild, [_el$87, _co$14] = getNextMarker(_el$86.nextSibling);
|
|
530
|
+
_el$87.nextSibling;
|
|
531
|
+
var _el$88 = _el$84.nextSibling, _el$89 = _el$88.nextSibling, [_el$90, _co$15] = getNextMarker(_el$89.nextSibling), _el$92 = _el$83.nextSibling, [_el$93, _co$16] = getNextMarker(_el$92.nextSibling);
|
|
532
|
+
_el$83.$$click = () => {
|
|
533
|
+
setEditingKey(key);
|
|
534
|
+
setEditValue(String(value() || ""));
|
|
535
|
+
};
|
|
536
|
+
insert(_el$84, () => {
|
|
537
|
+
var _a;
|
|
538
|
+
return ((_a = def()) == null ? void 0 : _a.label) || key;
|
|
539
|
+
}, _el$87, _co$14);
|
|
540
|
+
insert(_el$83, (() => {
|
|
541
|
+
var _c$4 = memo(() => !!Array.isArray(value()));
|
|
542
|
+
return () => _c$4() ? value().join(", ") : String(value());
|
|
543
|
+
})(), _el$90, _co$15);
|
|
544
|
+
insert(_el$82, createComponent(Show, {
|
|
545
|
+
get when() {
|
|
546
|
+
return props.onFilterChange;
|
|
547
|
+
},
|
|
548
|
+
get children() {
|
|
549
|
+
var _el$91 = getNextElement(_tmpl$24);
|
|
550
|
+
_el$91.$$click = () => removeFilter(key);
|
|
551
|
+
setAttribute(_el$91, "aria-label", `Remove ${key}`);
|
|
552
|
+
runHydrationEvents();
|
|
553
|
+
return _el$91;
|
|
554
|
+
}
|
|
555
|
+
}), _el$93, _co$16);
|
|
556
|
+
runHydrationEvents();
|
|
557
|
+
return _el$82;
|
|
558
|
+
}
|
|
559
|
+
}), _el$98, _co$17);
|
|
560
|
+
insert(_el$81, createComponent(Show, {
|
|
561
|
+
get when() {
|
|
562
|
+
return editingKey() === key;
|
|
563
|
+
},
|
|
564
|
+
get children() {
|
|
565
|
+
var _el$94 = getNextElement(_tmpl$28);
|
|
566
|
+
insert(_el$94, createComponent(Show, {
|
|
567
|
+
get when() {
|
|
568
|
+
var _a;
|
|
569
|
+
return (_a = def()) == null ? void 0 : _a.options;
|
|
570
|
+
},
|
|
571
|
+
get fallback() {
|
|
572
|
+
return (() => {
|
|
573
|
+
var _el$105 = getNextElement(_tmpl$31), _el$106 = _el$105.firstChild, _el$107 = _el$106.nextSibling, _el$108 = _el$107.nextSibling;
|
|
574
|
+
_el$105.addEventListener("submit", (e) => {
|
|
575
|
+
e.preventDefault();
|
|
576
|
+
setFilter(key, editValue());
|
|
577
|
+
});
|
|
578
|
+
_el$106.$$input = (e) => setEditValue(e.currentTarget.value);
|
|
579
|
+
_el$108.$$click = () => setEditingKey(null);
|
|
580
|
+
effect(() => {
|
|
581
|
+
var _a;
|
|
582
|
+
return setAttribute(_el$106, "placeholder", ((_a = def()) == null ? void 0 : _a.placeholder) || key);
|
|
583
|
+
});
|
|
584
|
+
effect(() => setProperty(_el$106, "value", editValue()));
|
|
585
|
+
runHydrationEvents();
|
|
586
|
+
return _el$105;
|
|
587
|
+
})();
|
|
588
|
+
},
|
|
589
|
+
get children() {
|
|
590
|
+
return [(() => {
|
|
591
|
+
var _el$95 = getNextElement(_tmpl$26);
|
|
592
|
+
insert(_el$95, createComponent(For, {
|
|
593
|
+
get each() {
|
|
594
|
+
return def().options;
|
|
595
|
+
},
|
|
596
|
+
children: (opt) => (() => {
|
|
597
|
+
var _el$109 = getNextElement(_tmpl$33), _el$111 = _el$109.firstChild, [_el$112, _co$20] = getNextMarker(_el$111.nextSibling), _el$113 = _el$112.nextSibling, [_el$114, _co$21] = getNextMarker(_el$113.nextSibling);
|
|
598
|
+
_el$109.$$click = () => setFilter(key, opt.value);
|
|
599
|
+
insert(_el$109, () => opt.label, _el$112, _co$20);
|
|
600
|
+
insert(_el$109, createComponent(Show, {
|
|
601
|
+
get when() {
|
|
602
|
+
return String(value()) === opt.value;
|
|
603
|
+
},
|
|
604
|
+
get children() {
|
|
605
|
+
return getNextElement(_tmpl$32);
|
|
606
|
+
}
|
|
607
|
+
}), _el$114, _co$21);
|
|
608
|
+
effect(() => className(_el$109, `w-full text-left px-2 py-1.5 text-sm rounded hover:bg-blue-50 dark:hover:bg-blue-900/20 ${String(value()) === opt.value ? "text-blue-600 dark:text-blue-400 bg-blue-50/50 dark:bg-blue-900/10" : "text-gray-900 dark:text-white"}`));
|
|
609
|
+
runHydrationEvents();
|
|
610
|
+
return _el$109;
|
|
611
|
+
})()
|
|
612
|
+
}));
|
|
613
|
+
return _el$95;
|
|
614
|
+
})(), (() => {
|
|
615
|
+
var _el$96 = getNextElement(_tmpl$27);
|
|
616
|
+
_el$96.$$click = () => setEditingKey(null);
|
|
617
|
+
runHydrationEvents();
|
|
618
|
+
return _el$96;
|
|
619
|
+
})()];
|
|
620
|
+
}
|
|
621
|
+
}));
|
|
622
|
+
return _el$94;
|
|
623
|
+
}
|
|
624
|
+
}), _el$100, _co$18);
|
|
625
|
+
return _el$81;
|
|
626
|
+
})();
|
|
627
|
+
}
|
|
628
|
+
}), _el$78, _co$12);
|
|
629
|
+
insert(_el$75, createComponent(Show, {
|
|
630
|
+
get when() {
|
|
631
|
+
return allKeys().length === 0;
|
|
632
|
+
},
|
|
633
|
+
get children() {
|
|
634
|
+
return getNextElement(_tmpl$22);
|
|
635
|
+
}
|
|
636
|
+
}), _el$80, _co$13);
|
|
637
|
+
return _el$75;
|
|
638
|
+
})();
|
|
639
|
+
};
|
|
640
|
+
const EmbeddedFormSection = (props) => {
|
|
641
|
+
const [formData, setFormData] = createSignal({});
|
|
642
|
+
const [dynamicOptions, setDynamicOptions] = createSignal({});
|
|
643
|
+
const config = () => {
|
|
644
|
+
const c = props.content;
|
|
645
|
+
return {
|
|
646
|
+
fields: (c == null ? void 0 : c.fields) || [],
|
|
647
|
+
submitLabel: (c == null ? void 0 : c.submitLabel) || "Submit"
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
const updateField = (name, value) => setFormData((prev) => ({
|
|
651
|
+
...prev,
|
|
652
|
+
[name]: value
|
|
653
|
+
}));
|
|
654
|
+
createEffect(() => {
|
|
655
|
+
const data = formData();
|
|
656
|
+
for (const field of config().fields) {
|
|
657
|
+
const dep = field.depends_on || field.dependsOn;
|
|
658
|
+
if (!dep) continue;
|
|
659
|
+
const parentValue = data[dep.field];
|
|
660
|
+
if (!parentValue) continue;
|
|
661
|
+
const url = (dep.options_endpoint || dep.apiUrl || "").replace("{value}", encodeURIComponent(parentValue));
|
|
662
|
+
if (!url) continue;
|
|
663
|
+
const params = new URLSearchParams(dep.extraParams || dep.extra_params || {});
|
|
664
|
+
fetch(`${url}${url.includes("?") ? "&" : "?"}${params}`).then((r) => r.json()).then((items) => {
|
|
665
|
+
const arr = Array.isArray(items) ? items : items.results || items.features || [];
|
|
666
|
+
const lf = dep.label_field || dep.labelField || "label";
|
|
667
|
+
const vf = dep.value_field || dep.valueField || "value";
|
|
668
|
+
setDynamicOptions((prev) => ({
|
|
669
|
+
...prev,
|
|
670
|
+
[field.name]: arr.map((i) => ({
|
|
671
|
+
label: i[lf] || String(i),
|
|
672
|
+
value: String(i[vf] || i[lf] || i)
|
|
673
|
+
}))
|
|
674
|
+
}));
|
|
675
|
+
}).catch(() => {
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
const getField = (field) => {
|
|
680
|
+
const dynOpts = dynamicOptions()[field.name];
|
|
681
|
+
return dynOpts ? {
|
|
682
|
+
...field,
|
|
683
|
+
options: dynOpts
|
|
684
|
+
} : field;
|
|
685
|
+
};
|
|
686
|
+
const handleSubmit = (e) => {
|
|
687
|
+
var _a;
|
|
688
|
+
e.preventDefault();
|
|
689
|
+
(_a = props.onAction) == null ? void 0 : _a.call(props, "submit_form", {
|
|
690
|
+
sectionId: props.sectionId,
|
|
691
|
+
values: formData()
|
|
692
|
+
});
|
|
693
|
+
};
|
|
694
|
+
return (() => {
|
|
695
|
+
var _el$115 = getNextElement(_tmpl$34), _el$118 = _el$115.firstChild, [_el$119, _co$22] = getNextMarker(_el$118.nextSibling), _el$116 = _el$119.nextSibling, _el$117 = _el$116.firstChild;
|
|
696
|
+
_el$115.addEventListener("submit", handleSubmit);
|
|
697
|
+
insert(_el$115, createComponent(For, {
|
|
698
|
+
get each() {
|
|
699
|
+
return config().fields;
|
|
700
|
+
},
|
|
701
|
+
children: (field) => createComponent(FormFieldRenderer, {
|
|
702
|
+
get field() {
|
|
703
|
+
return getField(field);
|
|
704
|
+
},
|
|
705
|
+
get value() {
|
|
706
|
+
return formData()[field.name];
|
|
707
|
+
},
|
|
708
|
+
onChange: (val) => updateField(field.name, val),
|
|
709
|
+
formData
|
|
710
|
+
})
|
|
711
|
+
}), _el$119, _co$22);
|
|
712
|
+
insert(_el$117, () => config().submitLabel);
|
|
713
|
+
return _el$115;
|
|
714
|
+
})();
|
|
715
|
+
};
|
|
716
|
+
const EnrichedStepsSection = (props) => {
|
|
717
|
+
const stepsData = () => {
|
|
718
|
+
const c = props.content;
|
|
719
|
+
return {
|
|
720
|
+
steps: (c == null ? void 0 : c.steps) || [],
|
|
721
|
+
currentStep: (c == null ? void 0 : c.currentStep) ?? 0
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
return (() => {
|
|
725
|
+
var _el$120 = getNextElement(_tmpl$36), _el$123 = _el$120.firstChild, [_el$124, _co$23] = getNextMarker(_el$123.nextSibling), _el$125 = _el$124.nextSibling, [_el$126, _co$24] = getNextMarker(_el$125.nextSibling);
|
|
726
|
+
insert(_el$120, createComponent(For, {
|
|
727
|
+
get each() {
|
|
728
|
+
return stepsData().steps;
|
|
729
|
+
},
|
|
730
|
+
children: (step) => (() => {
|
|
731
|
+
var _el$127 = getNextElement(_tmpl$39), _el$128 = _el$127.firstChild, _el$129 = _el$128.firstChild, _el$134 = _el$129.nextSibling, [_el$135, _co$26] = getNextMarker(_el$134.nextSibling), _el$136 = _el$135.nextSibling, [_el$137, _co$27] = getNextMarker(_el$136.nextSibling), _el$139 = _el$128.nextSibling, [_el$140, _co$28] = getNextMarker(_el$139.nextSibling);
|
|
732
|
+
insert(_el$129, (() => {
|
|
733
|
+
var _c$5 = memo(() => step.status === "done");
|
|
734
|
+
return () => _c$5() ? "✅" : step.status === "active" ? "●" : "○";
|
|
735
|
+
})());
|
|
736
|
+
insert(_el$128, () => step.label, _el$135, _co$26);
|
|
737
|
+
insert(_el$128, createComponent(Show, {
|
|
356
738
|
get when() {
|
|
357
|
-
return
|
|
739
|
+
return memo(() => !!step.description)() && step.status === "active";
|
|
358
740
|
},
|
|
359
741
|
get children() {
|
|
360
|
-
var _el$
|
|
361
|
-
_el$
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
742
|
+
var _el$130 = getNextElement(_tmpl$37), _el$131 = _el$130.firstChild, _el$132 = _el$131.nextSibling, [_el$133, _co$25] = getNextMarker(_el$132.nextSibling);
|
|
743
|
+
insert(_el$130, () => step.description, _el$133, _co$25);
|
|
744
|
+
return _el$130;
|
|
745
|
+
}
|
|
746
|
+
}), _el$137, _co$27);
|
|
747
|
+
insert(_el$127, createComponent(Show, {
|
|
748
|
+
get when() {
|
|
749
|
+
return memo(() => step.status === "active")() && step.content;
|
|
750
|
+
},
|
|
751
|
+
get children() {
|
|
752
|
+
var _el$138 = getNextElement(_tmpl$38);
|
|
753
|
+
insert(_el$138, createComponent(SectionRenderer, {
|
|
754
|
+
get section() {
|
|
755
|
+
return step.content;
|
|
756
|
+
},
|
|
757
|
+
filters: {},
|
|
758
|
+
get onFilterChange() {
|
|
759
|
+
return props.onFilterChange;
|
|
760
|
+
},
|
|
761
|
+
get onAction() {
|
|
762
|
+
return props.onAction;
|
|
763
|
+
}
|
|
764
|
+
}));
|
|
765
|
+
return _el$138;
|
|
365
766
|
}
|
|
366
|
-
}), _el$
|
|
367
|
-
|
|
767
|
+
}), _el$140, _co$28);
|
|
768
|
+
effect((_p$) => {
|
|
769
|
+
var _v$4 = `rounded-lg ${step.status === "active" ? "bg-blue-50/50 dark:bg-blue-900/10 border border-blue-200 dark:border-blue-800 p-3" : "px-1"}`, _v$5 = `flex items-center gap-2 text-sm font-medium ${step.status === "done" ? "text-green-600 dark:text-green-400" : step.status === "active" ? "text-blue-600 dark:text-blue-400" : "text-gray-400"}`;
|
|
770
|
+
_v$4 !== _p$.e && className(_el$127, _p$.e = _v$4);
|
|
771
|
+
_v$5 !== _p$.t && className(_el$128, _p$.t = _v$5);
|
|
772
|
+
return _p$;
|
|
773
|
+
}, {
|
|
774
|
+
e: void 0,
|
|
775
|
+
t: void 0
|
|
776
|
+
});
|
|
777
|
+
return _el$127;
|
|
368
778
|
})()
|
|
369
|
-
}), _el$
|
|
370
|
-
insert(_el$
|
|
779
|
+
}), _el$124, _co$23);
|
|
780
|
+
insert(_el$120, createComponent(Show, {
|
|
371
781
|
get when() {
|
|
372
|
-
return
|
|
782
|
+
return stepsData().steps.some((s) => s.status === "active");
|
|
373
783
|
},
|
|
374
784
|
get children() {
|
|
375
|
-
|
|
785
|
+
var _el$121 = getNextElement(_tmpl$35), _el$122 = _el$121.firstChild;
|
|
786
|
+
_el$122.$$click = () => {
|
|
787
|
+
var _a;
|
|
788
|
+
return (_a = props.onAction) == null ? void 0 : _a.call(props, "next_step", {
|
|
789
|
+
step: stepsData().currentStep
|
|
790
|
+
});
|
|
791
|
+
};
|
|
792
|
+
runHydrationEvents();
|
|
793
|
+
return _el$121;
|
|
376
794
|
}
|
|
377
|
-
}), _el$
|
|
378
|
-
return _el$
|
|
795
|
+
}), _el$126, _co$24);
|
|
796
|
+
return _el$120;
|
|
379
797
|
})();
|
|
380
798
|
};
|
|
381
799
|
const ActionSection = (props) => {
|
|
382
|
-
const actions = () =>
|
|
383
|
-
if (Array.isArray(props.content)) return props.content;
|
|
384
|
-
return [];
|
|
385
|
-
};
|
|
800
|
+
const actions = () => Array.isArray(props.content) ? props.content : [];
|
|
386
801
|
return (() => {
|
|
387
|
-
var _el$
|
|
388
|
-
insert(_el$
|
|
802
|
+
var _el$141 = getNextElement(_tmpl$40);
|
|
803
|
+
insert(_el$141, createComponent(For, {
|
|
389
804
|
get each() {
|
|
390
805
|
return actions();
|
|
391
806
|
},
|
|
392
807
|
children: (item) => (() => {
|
|
393
|
-
var _el$
|
|
394
|
-
_el$
|
|
808
|
+
var _el$142 = getNextElement(_tmpl$33), _el$144 = _el$142.firstChild, [_el$145, _co$29] = getNextMarker(_el$144.nextSibling), _el$146 = _el$145.nextSibling, [_el$147, _co$30] = getNextMarker(_el$146.nextSibling);
|
|
809
|
+
_el$142.$$click = () => {
|
|
395
810
|
var _a;
|
|
396
811
|
return (_a = props.onAction) == null ? void 0 : _a.call(props, item.value || item.action || item.label, item);
|
|
397
812
|
};
|
|
398
|
-
insert(_el$
|
|
813
|
+
insert(_el$142, createComponent(Show, {
|
|
399
814
|
get when() {
|
|
400
815
|
return item.icon;
|
|
401
816
|
},
|
|
402
817
|
get children() {
|
|
403
|
-
var _el$
|
|
404
|
-
insert(_el$
|
|
405
|
-
return _el$
|
|
818
|
+
var _el$143 = getNextElement(_tmpl$41);
|
|
819
|
+
insert(_el$143, () => item.icon);
|
|
820
|
+
return _el$143;
|
|
406
821
|
}
|
|
407
|
-
}), _el$
|
|
408
|
-
insert(_el$
|
|
409
|
-
effect(() => className(_el$
|
|
822
|
+
}), _el$145, _co$29);
|
|
823
|
+
insert(_el$142, () => item.label, _el$147, _co$30);
|
|
824
|
+
effect(() => className(_el$142, `px-3 py-1.5 text-sm font-medium rounded-lg transition-colors ${item.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700" : item.variant === "danger" ? "bg-red-600 text-white hover:bg-red-700" : "border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`));
|
|
410
825
|
runHydrationEvents();
|
|
411
|
-
return _el$
|
|
826
|
+
return _el$142;
|
|
827
|
+
})()
|
|
828
|
+
}));
|
|
829
|
+
return _el$141;
|
|
830
|
+
})();
|
|
831
|
+
};
|
|
832
|
+
const UnderstandingSection = (props) => {
|
|
833
|
+
const data = () => {
|
|
834
|
+
const c = props.content;
|
|
835
|
+
return {
|
|
836
|
+
detections: (c == null ? void 0 : c.detections) || [],
|
|
837
|
+
warnings: (c == null ? void 0 : c.warnings) || []
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
const confidenceClass = (conf) => {
|
|
841
|
+
switch (conf) {
|
|
842
|
+
case "high":
|
|
843
|
+
return "bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400";
|
|
844
|
+
case "medium":
|
|
845
|
+
return "bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-400";
|
|
846
|
+
case "low":
|
|
847
|
+
return "bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400";
|
|
848
|
+
default:
|
|
849
|
+
return "bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400";
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
return (() => {
|
|
853
|
+
var _el$148 = getNextElement(_tmpl$42), _el$149 = _el$148.firstChild, _el$151 = _el$149.nextSibling, [_el$152, _co$31] = getNextMarker(_el$151.nextSibling);
|
|
854
|
+
insert(_el$149, createComponent(For, {
|
|
855
|
+
get each() {
|
|
856
|
+
return data().detections;
|
|
857
|
+
},
|
|
858
|
+
children: (det) => (() => {
|
|
859
|
+
var _el$153 = getNextElement(_tmpl$43), _el$154 = _el$153.firstChild, _el$155 = _el$154.nextSibling;
|
|
860
|
+
insert(_el$154, () => det.label);
|
|
861
|
+
insert(_el$155, () => det.value);
|
|
862
|
+
effect(() => className(_el$154, `px-1.5 py-0.5 text-xs font-medium rounded ${confidenceClass(det.confidence)}`));
|
|
863
|
+
return _el$153;
|
|
412
864
|
})()
|
|
413
865
|
}));
|
|
414
|
-
|
|
866
|
+
insert(_el$148, createComponent(Show, {
|
|
867
|
+
get when() {
|
|
868
|
+
return data().warnings.length > 0;
|
|
869
|
+
},
|
|
870
|
+
get children() {
|
|
871
|
+
var _el$150 = getNextElement(_tmpl$20);
|
|
872
|
+
insert(_el$150, createComponent(For, {
|
|
873
|
+
get each() {
|
|
874
|
+
return data().warnings;
|
|
875
|
+
},
|
|
876
|
+
children: (w) => (() => {
|
|
877
|
+
var _el$156 = getNextElement(_tmpl$44), _el$157 = _el$156.firstChild, _el$158 = _el$157.nextSibling;
|
|
878
|
+
insert(_el$158, w);
|
|
879
|
+
return _el$156;
|
|
880
|
+
})()
|
|
881
|
+
}));
|
|
882
|
+
return _el$150;
|
|
883
|
+
}
|
|
884
|
+
}), _el$152, _co$31);
|
|
885
|
+
return _el$148;
|
|
415
886
|
})();
|
|
416
887
|
};
|
|
417
|
-
const
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
|
|
888
|
+
const FeedbackSection = (props) => {
|
|
889
|
+
const [comment, setComment] = createSignal("");
|
|
890
|
+
const data = () => {
|
|
891
|
+
const c = props.content;
|
|
892
|
+
return {
|
|
893
|
+
question: (c == null ? void 0 : c.question) || "",
|
|
894
|
+
approve: (c == null ? void 0 : c.approve) || {
|
|
895
|
+
label: "Yes",
|
|
896
|
+
value: "approve"
|
|
897
|
+
},
|
|
898
|
+
reject: (c == null ? void 0 : c.reject) || {
|
|
899
|
+
label: "No",
|
|
900
|
+
value: "reject"
|
|
901
|
+
},
|
|
902
|
+
allowComment: (c == null ? void 0 : c.allowComment) ?? false,
|
|
903
|
+
commentPlaceholder: (c == null ? void 0 : c.commentPlaceholder) || "Add a comment..."
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
const handleFeedback = (approved) => {
|
|
907
|
+
var _a;
|
|
908
|
+
const d = data();
|
|
909
|
+
(_a = props.onAction) == null ? void 0 : _a.call(props, "feedback", {
|
|
910
|
+
approved,
|
|
911
|
+
value: approved ? d.approve.value : d.reject.value,
|
|
912
|
+
comment: comment()
|
|
913
|
+
});
|
|
421
914
|
};
|
|
422
915
|
return (() => {
|
|
423
|
-
var _el$
|
|
424
|
-
insert(_el$
|
|
916
|
+
var _el$159 = getNextElement(_tmpl$46), _el$160 = _el$159.firstChild, _el$161 = _el$160.nextSibling, _el$162 = _el$161.firstChild, _el$163 = _el$162.firstChild, _el$164 = _el$163.nextSibling, [_el$165, _co$32] = getNextMarker(_el$164.nextSibling), _el$166 = _el$162.nextSibling, _el$167 = _el$166.firstChild, _el$168 = _el$167.nextSibling, [_el$169, _co$33] = getNextMarker(_el$168.nextSibling), _el$171 = _el$161.nextSibling, [_el$172, _co$34] = getNextMarker(_el$171.nextSibling);
|
|
917
|
+
insert(_el$160, () => data().question);
|
|
918
|
+
_el$162.$$click = () => handleFeedback(true);
|
|
919
|
+
insert(_el$162, () => data().approve.label, _el$165, _co$32);
|
|
920
|
+
_el$166.$$click = () => handleFeedback(false);
|
|
921
|
+
insert(_el$166, () => data().reject.label, _el$169, _co$33);
|
|
922
|
+
insert(_el$159, createComponent(Show, {
|
|
923
|
+
get when() {
|
|
924
|
+
return data().allowComment;
|
|
925
|
+
},
|
|
926
|
+
get children() {
|
|
927
|
+
var _el$170 = getNextElement(_tmpl$45);
|
|
928
|
+
_el$170.$$input = (e) => setComment(e.currentTarget.value);
|
|
929
|
+
effect(() => setAttribute(_el$170, "placeholder", data().commentPlaceholder));
|
|
930
|
+
effect(() => setProperty(_el$170, "value", comment()));
|
|
931
|
+
runHydrationEvents();
|
|
932
|
+
return _el$170;
|
|
933
|
+
}
|
|
934
|
+
}), _el$172, _co$34);
|
|
935
|
+
runHydrationEvents();
|
|
936
|
+
return _el$159;
|
|
937
|
+
})();
|
|
938
|
+
};
|
|
939
|
+
const PromptSection = (props) => {
|
|
940
|
+
const data = () => {
|
|
941
|
+
const c = props.content;
|
|
942
|
+
return {
|
|
943
|
+
originalQuery: (c == null ? void 0 : c.originalQuery) || "",
|
|
944
|
+
interpretation: (c == null ? void 0 : c.interpretation) || "",
|
|
945
|
+
extracted: (c == null ? void 0 : c.extracted) || {},
|
|
946
|
+
plan: (c == null ? void 0 : c.plan) || "",
|
|
947
|
+
editable: (c == null ? void 0 : c.editable) ?? false
|
|
948
|
+
};
|
|
949
|
+
};
|
|
950
|
+
return (() => {
|
|
951
|
+
var _el$173 = getNextElement(_tmpl$50), _el$186 = _el$173.firstChild, [_el$187, _co$37] = getNextMarker(_el$186.nextSibling), _el$179 = _el$187.nextSibling, _el$188 = _el$179.nextSibling, [_el$189, _co$38] = getNextMarker(_el$188.nextSibling), _el$190 = _el$189.nextSibling, [_el$191, _co$39] = getNextMarker(_el$190.nextSibling);
|
|
952
|
+
insert(_el$173, createComponent(Show, {
|
|
953
|
+
get when() {
|
|
954
|
+
return data().originalQuery;
|
|
955
|
+
},
|
|
956
|
+
get children() {
|
|
957
|
+
var _el$174 = getNextElement(_tmpl$47), _el$175 = _el$174.firstChild, _el$177 = _el$175.nextSibling, [_el$178, _co$35] = getNextMarker(_el$177.nextSibling);
|
|
958
|
+
_el$178.nextSibling;
|
|
959
|
+
insert(_el$174, () => data().originalQuery, _el$178, _co$35);
|
|
960
|
+
return _el$174;
|
|
961
|
+
}
|
|
962
|
+
}), _el$187, _co$37);
|
|
963
|
+
insert(_el$179, createComponent(For, {
|
|
425
964
|
get each() {
|
|
426
|
-
return
|
|
965
|
+
return Object.entries(data().extracted);
|
|
427
966
|
},
|
|
428
|
-
children: (
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
}), (() => {
|
|
438
|
-
var _el$82 = getNextElement(_tmpl$27), _el$83 = _el$82.firstChild, [_el$84, _co$14] = getNextMarker(_el$83.nextSibling), _el$85 = _el$84.nextSibling, [_el$86, _co$15] = getNextMarker(_el$85.nextSibling);
|
|
439
|
-
insert(_el$82, (() => {
|
|
440
|
-
var _c$4 = memo(() => step.status === "done");
|
|
441
|
-
return () => _c$4() ? "✓" : step.status === "active" ? "●" : "○";
|
|
442
|
-
})(), _el$84, _co$14);
|
|
443
|
-
insert(_el$82, () => step.label, _el$86, _co$15);
|
|
444
|
-
effect(() => className(_el$82, `flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium ${step.status === "done" ? "text-green-600 dark:text-green-400" : step.status === "active" ? "text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20" : "text-gray-400"}`));
|
|
445
|
-
return _el$82;
|
|
446
|
-
})()]
|
|
967
|
+
children: ([key, value]) => (() => {
|
|
968
|
+
var _el$192 = getNextElement(_tmpl$51), _el$193 = _el$192.firstChild, _el$195 = _el$193.firstChild, [_el$196, _co$40] = getNextMarker(_el$195.nextSibling);
|
|
969
|
+
_el$196.nextSibling;
|
|
970
|
+
var _el$197 = _el$193.nextSibling;
|
|
971
|
+
insert(_el$193, key, _el$196, _co$40);
|
|
972
|
+
insert(_el$197, () => String(value));
|
|
973
|
+
return _el$192;
|
|
974
|
+
})()
|
|
447
975
|
}));
|
|
448
|
-
|
|
976
|
+
insert(_el$173, createComponent(Show, {
|
|
977
|
+
get when() {
|
|
978
|
+
return data().plan;
|
|
979
|
+
},
|
|
980
|
+
get children() {
|
|
981
|
+
var _el$180 = getNextElement(_tmpl$48), _el$181 = _el$180.firstChild, _el$182 = _el$181.nextSibling, _el$183 = _el$182.nextSibling, [_el$184, _co$36] = getNextMarker(_el$183.nextSibling);
|
|
982
|
+
insert(_el$180, () => data().plan, _el$184, _co$36);
|
|
983
|
+
return _el$180;
|
|
984
|
+
}
|
|
985
|
+
}), _el$189, _co$38);
|
|
986
|
+
insert(_el$173, createComponent(Show, {
|
|
987
|
+
get when() {
|
|
988
|
+
return data().editable;
|
|
989
|
+
},
|
|
990
|
+
get children() {
|
|
991
|
+
var _el$185 = getNextElement(_tmpl$49);
|
|
992
|
+
_el$185.$$click = () => {
|
|
993
|
+
var _a;
|
|
994
|
+
return (_a = props.onAction) == null ? void 0 : _a.call(props, "edit_prompt", data());
|
|
995
|
+
};
|
|
996
|
+
runHydrationEvents();
|
|
997
|
+
return _el$185;
|
|
998
|
+
}
|
|
999
|
+
}), _el$191, _co$39);
|
|
1000
|
+
return _el$173;
|
|
449
1001
|
})();
|
|
450
1002
|
};
|
|
451
|
-
delegateEvents(["click"]);
|
|
1003
|
+
delegateEvents(["click", "input"]);
|
|
452
1004
|
export {
|
|
453
1005
|
ScratchpadPanel
|
|
454
1006
|
};
|