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