@plures/design-dojo 0.2.0 → 0.4.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/app/ChatInput.svelte.d.ts +1 -0
- package/dist/app/ChatView.svelte.d.ts +1 -0
- package/dist/app/ChatView.types.d.ts +10 -0
- package/dist/app/FirstRunWizard.svelte.d.ts +1 -0
- package/dist/app/FirstRunWizard.types.d.ts +11 -0
- package/dist/app/MemorySidebar.svelte.d.ts +1 -0
- package/dist/app/MemorySidebar.types.d.ts +9 -0
- package/dist/app/ProcedureEditor.svelte.d.ts +1 -0
- package/dist/app/ProcedureEditor.types.d.ts +9 -0
- package/dist/app/SettingsPanel.svelte.d.ts +1 -0
- package/dist/app/SettingsPanel.types.d.ts +19 -0
- package/dist/data/List.svelte.d.ts +1 -0
- package/dist/data/ListItem.svelte.d.ts +1 -0
- package/dist/data/Table.svelte.d.ts +1 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +27 -3
- package/dist/index.js +1964 -486
- package/dist/layout/Box.svelte.d.ts +1 -0
- package/dist/layout/SplitPane.svelte.d.ts +1 -0
- package/dist/layout/StatusBar.svelte.d.ts +1 -0
- package/dist/layout/StatusBarItem.svelte.d.ts +1 -0
- package/dist/layout/StatusBarSpacer.svelte.d.ts +1 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/motion/index.d.ts +1 -0
- package/dist/primitives/Input.svelte.d.ts +1 -0
- package/dist/primitives/Select.svelte.d.ts +1 -0
- package/dist/primitives/Text.svelte.d.ts +1 -0
- package/dist/primitives/index.d.ts +7 -0
- package/dist/surfaces/Pane.svelte.d.ts +1 -0
- package/dist/surfaces/index.d.ts +4 -0
- package/package.json +26 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "svelte/internal/disclose-version";
|
|
2
2
|
import * as e from "svelte/internal/client";
|
|
3
|
-
import { getContext as Re, setContext as
|
|
3
|
+
import { getContext as Re, setContext as Fe, untrack as he } from "svelte";
|
|
4
4
|
const He = {
|
|
5
5
|
/** Gentle hover, focus ring expansion */
|
|
6
6
|
gentle: { stiffness: 120, damping: 14, mass: 1, restThreshold: 0.01 },
|
|
@@ -13,657 +13,2135 @@ const He = {
|
|
|
13
13
|
/** Tooltip, popover */
|
|
14
14
|
quick: { stiffness: 500, damping: 30, mass: 0.5, restThreshold: 0.01 }
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
const { stiffness:
|
|
16
|
+
function Ke(K, t, F) {
|
|
17
|
+
const { stiffness: d, damping: n, mass: _ } = t, f = K.value - K.target, r = -d * f, w = -n * K.velocity, g = (r + w) / _, S = K.velocity + g * F, H = K.value + S * F, I = Math.abs(S) < t.restThreshold && Math.abs(H - K.target) < t.restThreshold;
|
|
18
18
|
return {
|
|
19
|
-
value:
|
|
20
|
-
velocity:
|
|
21
|
-
target:
|
|
22
|
-
done:
|
|
19
|
+
value: I ? K.target : H,
|
|
20
|
+
velocity: I ? 0 : S,
|
|
21
|
+
target: K.target,
|
|
22
|
+
done: I
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
value:
|
|
25
|
+
function ge(K, t = "snappy", F) {
|
|
26
|
+
const d = typeof t == "string" ? He[t] : t;
|
|
27
|
+
let n = {
|
|
28
|
+
value: K,
|
|
29
29
|
velocity: 0,
|
|
30
|
-
target:
|
|
30
|
+
target: K,
|
|
31
31
|
done: !0
|
|
32
|
-
},
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
32
|
+
}, _ = null, f = null;
|
|
33
|
+
function r(g) {
|
|
34
|
+
f === null && (f = g);
|
|
35
|
+
const S = Math.min((g - f) / 1e3, 0.064);
|
|
36
|
+
f = g, n = Ke(n, d, S), F(n.value), n.done ? (_ = null, f = null) : _ = requestAnimationFrame(r);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
38
|
+
function w() {
|
|
39
|
+
_ === null && (f = null, _ = requestAnimationFrame(r));
|
|
40
40
|
}
|
|
41
41
|
return {
|
|
42
42
|
/** Set a new target value. Animation starts automatically. */
|
|
43
|
-
set(
|
|
44
|
-
|
|
43
|
+
set(g) {
|
|
44
|
+
n.target = g, n.done = !1, w();
|
|
45
45
|
},
|
|
46
46
|
/** Jump to value immediately (no animation). */
|
|
47
|
-
jump(
|
|
48
|
-
|
|
47
|
+
jump(g) {
|
|
48
|
+
n = { value: g, velocity: 0, target: g, done: !0 }, F(g);
|
|
49
49
|
},
|
|
50
50
|
/** Add velocity impulse (e.g., from a flick gesture). */
|
|
51
|
-
impulse(
|
|
52
|
-
|
|
51
|
+
impulse(g) {
|
|
52
|
+
n.velocity += g, n.done = !1, w();
|
|
53
53
|
},
|
|
54
54
|
/** Stop animation. */
|
|
55
55
|
stop() {
|
|
56
|
-
|
|
56
|
+
_ !== null && (cancelAnimationFrame(_), _ = null, f = null);
|
|
57
57
|
},
|
|
58
58
|
/** Get current value. */
|
|
59
59
|
get value() {
|
|
60
|
-
return
|
|
60
|
+
return n.value;
|
|
61
61
|
},
|
|
62
62
|
/** Whether the spring has settled. */
|
|
63
63
|
get done() {
|
|
64
|
-
return
|
|
64
|
+
return n.done;
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
70
|
-
Se
|
|
68
|
+
const Se = Symbol("tui");
|
|
69
|
+
function pe(K) {
|
|
70
|
+
Fe(Se, K);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return Re(
|
|
72
|
+
function ie() {
|
|
73
|
+
return Re(Se) ?? (() => !1);
|
|
74
74
|
}
|
|
75
|
-
var
|
|
76
|
-
function
|
|
75
|
+
var Oe = e.from_html('<span class="tui-border-l svelte-5blyfe">╠</span><!><span class="tui-border-r svelte-5blyfe">╣</span>', 1), je = e.from_html("<button><!></button>");
|
|
76
|
+
function Va(K, t) {
|
|
77
77
|
e.push(t, !0);
|
|
78
|
-
let
|
|
79
|
-
const
|
|
80
|
-
let
|
|
81
|
-
const
|
|
78
|
+
let F = e.prop(t, "variant", 3, "solid"), d = e.prop(t, "size", 3, "md"), n = e.prop(t, "disabled", 3, !1), _ = e.prop(t, "tui", 3, !1);
|
|
79
|
+
const f = ie(), r = e.derived(() => _() || f());
|
|
80
|
+
let w = e.state(void 0), g = e.state(1), S = e.state(1), H = e.state(0), I, y, P;
|
|
81
|
+
const N = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1;
|
|
82
82
|
e.user_effect(() => {
|
|
83
|
-
if (!
|
|
84
|
-
return
|
|
85
|
-
|
|
83
|
+
if (!N)
|
|
84
|
+
return I = ge(1, "snappy", (k) => e.set(g, k, !0)), y = ge(1, "snappy", (k) => e.set(S, k, !0)), P = ge(0, "gentle", (k) => e.set(H, k, !0)), () => {
|
|
85
|
+
I == null || I.stop(), y == null || y.stop(), P == null || P.stop();
|
|
86
86
|
};
|
|
87
87
|
});
|
|
88
|
-
function
|
|
89
|
-
|
|
88
|
+
function x() {
|
|
89
|
+
n() || N || (I == null || I.set(0.96), y == null || y.set(0.3));
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
91
|
+
function p() {
|
|
92
|
+
n() || N || (I == null || I.set(1), y == null || y.set(1));
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
94
|
+
function m() {
|
|
95
|
+
n() || N || (I == null || I.set(1), y == null || y.set(1));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
99
|
-
e.set(
|
|
97
|
+
function A() {
|
|
98
|
+
if (N) {
|
|
99
|
+
e.set(H, 1);
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
P == null || P.set(1);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
if (
|
|
106
|
-
e.set(
|
|
104
|
+
function v() {
|
|
105
|
+
if (N) {
|
|
106
|
+
e.set(H, 0);
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
P == null || P.set(0);
|
|
110
110
|
}
|
|
111
|
-
var
|
|
112
|
-
let
|
|
113
|
-
var
|
|
111
|
+
var h = je();
|
|
112
|
+
let l, a;
|
|
113
|
+
var s = e.child(h);
|
|
114
114
|
{
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
e.snippet(
|
|
118
|
-
},
|
|
119
|
-
var
|
|
120
|
-
e.snippet(
|
|
115
|
+
var D = (k) => {
|
|
116
|
+
var M = Oe(), B = e.sibling(e.first_child(M));
|
|
117
|
+
e.snippet(B, () => t.children), e.next(), e.append(k, M);
|
|
118
|
+
}, c = (k) => {
|
|
119
|
+
var M = e.comment(), B = e.first_child(M);
|
|
120
|
+
e.snippet(B, () => t.children), e.append(k, M);
|
|
121
121
|
};
|
|
122
|
-
e.if(
|
|
123
|
-
e.get(
|
|
122
|
+
e.if(s, (k) => {
|
|
123
|
+
e.get(r) ? k(D) : k(c, !1);
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
e.reset(
|
|
127
|
-
|
|
128
|
-
transform: e.get(
|
|
129
|
-
"--shadow-depth": e.get(
|
|
130
|
-
"--focus-opacity": e.get(
|
|
126
|
+
e.reset(h), e.bind_this(h, (k) => e.set(w, k), () => e.get(w)), e.template_effect(() => {
|
|
127
|
+
l = e.set_class(h, 1, `btn btn-${F() ?? ""} btn-${d() ?? ""}`, "svelte-5blyfe", l, { disabled: n(), tui: e.get(r) }), h.disabled = n(), a = e.set_style(h, "", a, {
|
|
128
|
+
transform: e.get(r) ? void 0 : `scale(${e.get(g)})`,
|
|
129
|
+
"--shadow-depth": e.get(r) ? void 0 : e.get(S),
|
|
130
|
+
"--focus-opacity": e.get(H)
|
|
131
131
|
});
|
|
132
|
-
}), e.delegated("click",
|
|
133
|
-
var
|
|
134
|
-
(
|
|
135
|
-
}), e.delegated("pointerdown",
|
|
132
|
+
}), e.delegated("click", h, function(...k) {
|
|
133
|
+
var M;
|
|
134
|
+
(M = t.onclick) == null || M.apply(this, k);
|
|
135
|
+
}), e.delegated("pointerdown", h, x), e.delegated("pointerup", h, p), e.event("pointerleave", h, m), e.event("focus", h, A), e.event("blur", h, v), e.append(K, h), e.pop();
|
|
136
136
|
}
|
|
137
137
|
e.delegate(["click", "pointerdown", "pointerup"]);
|
|
138
|
-
var
|
|
139
|
-
function
|
|
138
|
+
var Ve = e.from_html(' <span class="tui-cursor svelte-a2gbz6">█</span> ', 1), qe = e.from_html('<label><div> </div> <div class="tui-row svelte-a2gbz6"><span>│</span> <span><!></span> <span>│</span></div> <div> </div> <input class="tui-hidden svelte-a2gbz6"/></label>'), Ge = e.from_html("<label> </label>"), Ye = e.from_html('<div><input class="input-field svelte-a2gbz6"/> <!></div>');
|
|
139
|
+
function qa(K, t) {
|
|
140
140
|
e.push(t, !0);
|
|
141
|
-
let
|
|
142
|
-
const
|
|
143
|
-
|
|
141
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "value", 15, ""), n = e.prop(t, "placeholder", 3, ""), _ = e.prop(t, "label", 3, ""), f = e.prop(t, "focused", 3, !1), r = e.prop(t, "disabled", 3, !1), w = e.prop(t, "password", 3, !1), g = e.prop(t, "maxLength", 3, void 0), S = e.prop(t, "class", 3, ""), H = e.prop(t, "cols", 3, 32);
|
|
142
|
+
const I = ie(), y = e.derived(() => F() || I());
|
|
143
|
+
function P() {
|
|
144
|
+
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
145
|
+
return `input-${crypto.randomUUID()}`;
|
|
146
|
+
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
147
|
+
const i = new Uint32Array(1);
|
|
148
|
+
return crypto.getRandomValues(i), `input-${i[0].toString(36)}`;
|
|
149
|
+
}
|
|
150
|
+
return `input-${Date.now().toString(36)}`;
|
|
151
|
+
}
|
|
152
|
+
const N = P();
|
|
153
|
+
let x = e.state(void 0), p = e.state(!1), m = e.state(0), A = e.state(0), v = e.state(0);
|
|
154
|
+
const h = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1;
|
|
155
|
+
let l, a;
|
|
144
156
|
e.user_effect(() => {
|
|
145
|
-
if (!
|
|
146
|
-
return
|
|
147
|
-
|
|
157
|
+
if (!(h || e.get(y)))
|
|
158
|
+
return l = ge(0, "gentle", (i) => e.set(A, i, !0)), a = ge(0, "gentle", (i) => e.set(v, i, !0)), () => {
|
|
159
|
+
l == null || l.stop(), a == null || a.stop();
|
|
148
160
|
};
|
|
161
|
+
});
|
|
162
|
+
const s = e.derived(() => e.get(p) || f() || !!d());
|
|
163
|
+
e.user_effect(() => {
|
|
164
|
+
const i = e.get(s) ? 1 : 0;
|
|
165
|
+
h || e.get(y) ? e.set(A, i, !0) : l == null || l.set(i);
|
|
149
166
|
}), e.user_effect(() => {
|
|
150
|
-
|
|
167
|
+
f() && e.get(x) && !r() && e.get(x).focus();
|
|
151
168
|
});
|
|
152
|
-
|
|
169
|
+
const D = e.derived(() => e.get(p) || f()), c = e.derived(() => Math.max(3, H())), k = e.derived(() => e.get(c) - 2), M = e.derived(() => w() ? "●".repeat((d() ?? "").length) : d() ?? ""), B = e.derived(() => _() ? (() => {
|
|
170
|
+
const i = Math.max(0, e.get(k) - 4), z = `─ ${_().length > i ? _().substring(0, i) : _()} `, E = Math.max(0, e.get(k) - z.length);
|
|
171
|
+
return `┌${z}${"─".repeat(E)}┐`;
|
|
172
|
+
})() : `┌${"─".repeat(e.get(k))}┐`), j = e.derived(() => {
|
|
173
|
+
const i = e.get(M), b = i.length, z = Math.min(Math.max(0, e.get(m)), b);
|
|
174
|
+
if (!e.get(D))
|
|
175
|
+
return i ? {
|
|
176
|
+
kind: "text",
|
|
177
|
+
text: i.substring(0, e.get(k)).padEnd(e.get(k), " ")
|
|
178
|
+
} : {
|
|
179
|
+
kind: "placeholder",
|
|
180
|
+
text: (n() || "").substring(0, e.get(k)).padEnd(e.get(k), " ")
|
|
181
|
+
};
|
|
182
|
+
const E = e.get(k) - 1;
|
|
183
|
+
let q;
|
|
184
|
+
b <= E ? q = 0 : (q = Math.min(z, b - E), q = Math.max(0, q), z < q && (q = z));
|
|
185
|
+
const V = i.substring(q, z), Y = i.substring(z, q + E), J = " ".repeat(Math.max(0, E - V.length - Y.length));
|
|
186
|
+
return { kind: "cursor", before: V, after: Y, pad: J };
|
|
187
|
+
});
|
|
188
|
+
function W() {
|
|
189
|
+
const i = e.get(x);
|
|
190
|
+
i && (typeof queueMicrotask < "u" ? queueMicrotask(() => {
|
|
191
|
+
e.set(m, i.selectionStart ?? (d() ?? "").length, !0);
|
|
192
|
+
}) : e.set(m, i.selectionStart ?? (d() ?? "").length, !0));
|
|
193
|
+
}
|
|
194
|
+
const O = e.derived(() => `└${"─".repeat(e.get(k))}┘`);
|
|
195
|
+
function L(i) {
|
|
196
|
+
var z;
|
|
197
|
+
const b = i.target;
|
|
198
|
+
d(b.value), (z = t.onchange) == null || z.call(t, d()), W();
|
|
199
|
+
}
|
|
200
|
+
function U(i) {
|
|
201
|
+
var b, z;
|
|
202
|
+
(b = t.onkeydown) == null || b.call(t, i), i.key === "Enter" && ((z = t.onsubmit) == null || z.call(t, d() ?? "")), W();
|
|
203
|
+
}
|
|
204
|
+
function u() {
|
|
205
|
+
e.set(p, !0), W(), h || e.get(y) ? e.set(v, 1) : a == null || a.set(1);
|
|
206
|
+
}
|
|
207
|
+
function G() {
|
|
208
|
+
e.set(p, !1), h || e.get(y) ? e.set(v, 0) : a == null || a.set(0);
|
|
209
|
+
}
|
|
210
|
+
var T = e.comment(), C = e.first_child(T);
|
|
211
|
+
{
|
|
212
|
+
var R = (i) => {
|
|
213
|
+
var b = qe();
|
|
214
|
+
let z;
|
|
215
|
+
var E = e.child(b);
|
|
216
|
+
let q;
|
|
217
|
+
var V = e.child(E, !0);
|
|
218
|
+
e.reset(E);
|
|
219
|
+
var Y = e.sibling(E, 2), J = e.child(Y);
|
|
220
|
+
let Z;
|
|
221
|
+
var $ = e.sibling(J, 2);
|
|
222
|
+
let ne;
|
|
223
|
+
var re = e.child($);
|
|
224
|
+
{
|
|
225
|
+
var ae = (X) => {
|
|
226
|
+
var ee = e.text();
|
|
227
|
+
e.template_effect(() => e.set_text(ee, e.get(j).text)), e.append(X, ee);
|
|
228
|
+
}, oe = (X) => {
|
|
229
|
+
var ee = e.text();
|
|
230
|
+
e.template_effect(() => e.set_text(ee, e.get(j).text)), e.append(X, ee);
|
|
231
|
+
}, ue = (X) => {
|
|
232
|
+
var ee = Ve(), le = e.first_child(ee, !0), ve = e.sibling(le, 2);
|
|
233
|
+
e.template_effect(() => {
|
|
234
|
+
e.set_text(le, e.get(j).before), e.set_text(ve, `${e.get(j).after ?? ""}${e.get(j).pad ?? ""}`);
|
|
235
|
+
}), e.append(X, ee);
|
|
236
|
+
};
|
|
237
|
+
e.if(re, (X) => {
|
|
238
|
+
e.get(j).kind === "placeholder" ? X(ae) : e.get(j).kind === "text" ? X(oe, 1) : X(ue, !1);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
e.reset($);
|
|
242
|
+
var de = e.sibling($, 2);
|
|
243
|
+
let ce;
|
|
244
|
+
e.reset(Y);
|
|
245
|
+
var se = e.sibling(Y, 2);
|
|
246
|
+
let te;
|
|
247
|
+
var _e = e.child(se, !0);
|
|
248
|
+
e.reset(se);
|
|
249
|
+
var Q = e.sibling(se, 2);
|
|
250
|
+
e.remove_input_defaults(Q), e.bind_this(Q, (X) => e.set(x, X), () => e.get(x)), e.reset(b), e.template_effect(() => {
|
|
251
|
+
z = e.set_class(b, 1, `tui-input ${S() ?? ""}`, "svelte-a2gbz6", z, { focused: e.get(D), disabled: r() }), q = e.set_class(E, 1, "tui-top svelte-a2gbz6", null, q, { focused: e.get(D) }), e.set_text(V, e.get(B)), Z = e.set_class(J, 1, "tui-side svelte-a2gbz6", null, Z, { focused: e.get(D) }), ne = e.set_class($, 1, "tui-content svelte-a2gbz6", null, ne, { placeholder: e.get(j).kind === "placeholder" }), ce = e.set_class(de, 1, "tui-side svelte-a2gbz6", null, ce, { focused: e.get(D) }), te = e.set_class(se, 1, "tui-bottom svelte-a2gbz6", null, te, { focused: e.get(D) }), e.set_text(_e, e.get(O)), e.set_attribute(Q, "type", w() ? "password" : "text"), e.set_value(Q, d()), Q.disabled = r(), e.set_attribute(Q, "maxlength", g()), e.set_attribute(Q, "aria-label", _() || n() || void 0);
|
|
252
|
+
}), e.delegated("input", Q, L), e.delegated("keydown", Q, U), e.event("focus", Q, u), e.event("blur", Q, G), e.delegated("click", Q, W), e.event("select", Q, W), e.append(i, b);
|
|
253
|
+
}, o = (i) => {
|
|
254
|
+
var b = Ye();
|
|
255
|
+
let z;
|
|
256
|
+
var E = e.child(b);
|
|
257
|
+
e.remove_input_defaults(E);
|
|
258
|
+
let q;
|
|
259
|
+
e.bind_this(E, (J) => e.set(x, J), () => e.get(x));
|
|
260
|
+
var V = e.sibling(E, 2);
|
|
261
|
+
{
|
|
262
|
+
var Y = (J) => {
|
|
263
|
+
var Z = Ge();
|
|
264
|
+
let $, ne;
|
|
265
|
+
var re = e.child(Z, !0);
|
|
266
|
+
e.reset(Z), e.template_effect(
|
|
267
|
+
(ae) => {
|
|
268
|
+
$ = e.set_class(Z, 1, "input-label svelte-a2gbz6", null, $, { active: e.get(s) }), e.set_attribute(Z, "for", N), ne = e.set_style(Z, "", ne, ae), e.set_text(re, _());
|
|
269
|
+
},
|
|
270
|
+
[
|
|
271
|
+
() => ({
|
|
272
|
+
transform: `translateY(calc(-50% - ${(e.get(A) * 14).toFixed(2) ?? ""}px)) scale(${(1 - e.get(A) * 0.2).toFixed(3) ?? ""})`
|
|
273
|
+
})
|
|
274
|
+
]
|
|
275
|
+
), e.append(J, Z);
|
|
276
|
+
};
|
|
277
|
+
e.if(V, (J) => {
|
|
278
|
+
_() && J(Y);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
e.reset(b), e.template_effect(() => {
|
|
282
|
+
z = e.set_class(b, 1, `input-wrapper ${S() ?? ""}`, "svelte-a2gbz6", z, {
|
|
283
|
+
focused: e.get(D),
|
|
284
|
+
filled: !!d(),
|
|
285
|
+
disabled: r()
|
|
286
|
+
}), e.set_attribute(E, "id", N), e.set_attribute(E, "type", w() ? "password" : "text"), e.set_value(E, d()), e.set_attribute(E, "placeholder", _() ? "" : n()), E.disabled = r(), e.set_attribute(E, "maxlength", g()), q = e.set_style(E, "", q, { "--focus-ring": e.get(v) });
|
|
287
|
+
}), e.delegated("input", E, L), e.delegated("keydown", E, U), e.event("focus", E, u), e.event("blur", E, G), e.append(i, b);
|
|
288
|
+
};
|
|
289
|
+
e.if(C, (i) => {
|
|
290
|
+
e.get(y) ? i(R) : i(o, !1);
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
e.append(K, T), e.pop();
|
|
294
|
+
}
|
|
295
|
+
e.delegate(["input", "keydown", "click"]);
|
|
296
|
+
var We = e.from_html('<span class="tui-label svelte-1dtdvx6"> </span>'), Je = e.from_html('<li role="option"> </li>'), Qe = e.from_html('<ul class="tui-dropdown svelte-1dtdvx6" role="listbox"></ul>'), Xe = e.from_html('<div role="combobox" aria-haspopup="listbox"><span class="tui-border-l svelte-1dtdvx6" aria-hidden="true">╠</span> <!> <span class="tui-value svelte-1dtdvx6"> </span> <span class="tui-arrow svelte-1dtdvx6" aria-hidden="true"> </span> <span class="tui-border-r svelte-1dtdvx6" aria-hidden="true">╣</span> <!></div>'), Ze = e.from_html('<label class="select-label svelte-1dtdvx6"> </label>'), $e = e.from_html('<option disabled="" selected=""> </option>'), et = e.from_html("<option> </option>"), tt = e.from_html('<div><!> <div class="select-inner svelte-1dtdvx6"><select class="select svelte-1dtdvx6"><!><!></select> <span class="select-arrow svelte-1dtdvx6" aria-hidden="true">▼</span></div></div>');
|
|
297
|
+
function Ga(K, t) {
|
|
298
|
+
e.push(t, !0);
|
|
299
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "value", 15, ""), n = e.prop(t, "placeholder", 3, "Select…"), _ = e.prop(t, "label", 3, ""), f = e.prop(t, "disabled", 3, !1), r = e.prop(t, "class", 3, "");
|
|
300
|
+
const w = ie(), g = e.derived(() => F() || w()), S = e.derived(() => {
|
|
153
301
|
var a;
|
|
154
|
-
|
|
302
|
+
return ((a = t.options.find((s) => s.value === d())) == null ? void 0 : a.label) ?? n();
|
|
303
|
+
}), H = `select-dropdown-${Math.random().toString(36).slice(2)}`, I = `select-${Math.random().toString(36).slice(2)}`;
|
|
304
|
+
let y = e.state(!1), P = e.state(0);
|
|
305
|
+
function N(a) {
|
|
306
|
+
var D;
|
|
307
|
+
const s = a.currentTarget;
|
|
308
|
+
d(s.value), (D = t.onchange) == null || D.call(t, d());
|
|
309
|
+
}
|
|
310
|
+
function x() {
|
|
311
|
+
f() || (e.set(y, !e.get(y)), e.get(y) && (e.set(P, t.options.findIndex((a) => a.value === d() && !a.disabled), !0), e.get(P) < 0 && e.set(P, t.options.findIndex((a) => !a.disabled), !0)));
|
|
312
|
+
}
|
|
313
|
+
function p(a) {
|
|
314
|
+
var s;
|
|
315
|
+
d(a), (s = t.onchange) == null || s.call(t, d()), e.set(y, !1);
|
|
316
|
+
}
|
|
317
|
+
function m(a) {
|
|
318
|
+
if (!f()) {
|
|
319
|
+
if (!e.get(y)) {
|
|
320
|
+
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), x());
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
if (a.key === "Escape")
|
|
324
|
+
a.preventDefault(), e.set(y, !1);
|
|
325
|
+
else if (a.key === "ArrowDown") {
|
|
326
|
+
a.preventDefault();
|
|
327
|
+
let s = e.get(P) + 1;
|
|
328
|
+
for (; s < t.options.length && t.options[s].disabled; ) s++;
|
|
329
|
+
s < t.options.length && e.set(P, s, !0);
|
|
330
|
+
} else if (a.key === "ArrowUp") {
|
|
331
|
+
a.preventDefault();
|
|
332
|
+
let s = e.get(P) - 1;
|
|
333
|
+
for (; s >= 0 && t.options[s].disabled; ) s--;
|
|
334
|
+
s >= 0 && e.set(P, s, !0);
|
|
335
|
+
} else if (a.key === "Enter" || a.key === " ") {
|
|
336
|
+
a.preventDefault();
|
|
337
|
+
const s = t.options[e.get(P)];
|
|
338
|
+
s && !s.disabled && p(s.value);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
var A = e.comment(), v = e.first_child(A);
|
|
343
|
+
{
|
|
344
|
+
var h = (a) => {
|
|
345
|
+
var s = Xe();
|
|
346
|
+
let D;
|
|
347
|
+
var c = e.sibling(e.child(s), 2);
|
|
348
|
+
{
|
|
349
|
+
var k = (U) => {
|
|
350
|
+
var u = We(), G = e.child(u);
|
|
351
|
+
e.reset(u), e.template_effect(() => e.set_text(G, `${_() ?? ""}:`)), e.append(U, u);
|
|
352
|
+
};
|
|
353
|
+
e.if(c, (U) => {
|
|
354
|
+
_() && U(k);
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
var M = e.sibling(c, 2), B = e.child(M, !0);
|
|
358
|
+
e.reset(M);
|
|
359
|
+
var j = e.sibling(M, 2), W = e.child(j, !0);
|
|
360
|
+
e.reset(j);
|
|
361
|
+
var O = e.sibling(j, 4);
|
|
362
|
+
{
|
|
363
|
+
var L = (U) => {
|
|
364
|
+
var u = Qe();
|
|
365
|
+
e.each(u, 21, () => t.options, e.index, (G, T, C) => {
|
|
366
|
+
var R = Je();
|
|
367
|
+
let o;
|
|
368
|
+
var i = e.child(R, !0);
|
|
369
|
+
e.reset(R), e.template_effect(() => {
|
|
370
|
+
o = e.set_class(R, 1, "tui-option svelte-1dtdvx6", null, o, {
|
|
371
|
+
focused: C === e.get(P),
|
|
372
|
+
selected: e.get(T).value === d(),
|
|
373
|
+
disabled: e.get(T).disabled
|
|
374
|
+
}), e.set_attribute(R, "aria-selected", e.get(T).value === d()), e.set_attribute(R, "aria-disabled", e.get(T).disabled), e.set_text(i, e.get(T).label);
|
|
375
|
+
}), e.delegated("click", R, (b) => {
|
|
376
|
+
b.stopPropagation(), e.get(T).disabled || p(e.get(T).value);
|
|
377
|
+
}), e.delegated("keydown", R, (b) => {
|
|
378
|
+
(b.key === "Enter" || b.key === " ") && (b.stopPropagation(), e.get(T).disabled || p(e.get(T).value));
|
|
379
|
+
}), e.append(G, R);
|
|
380
|
+
}), e.reset(u), e.template_effect(() => e.set_attribute(u, "id", H)), e.append(U, u);
|
|
381
|
+
};
|
|
382
|
+
e.if(O, (U) => {
|
|
383
|
+
e.get(y) && U(L);
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
e.reset(s), e.template_effect(() => {
|
|
387
|
+
D = e.set_class(s, 1, `tui-select ${r() ?? ""}`, "svelte-1dtdvx6", D, { disabled: f() }), e.set_attribute(s, "aria-label", _() || n() || "Select"), e.set_attribute(s, "aria-expanded", e.get(y)), e.set_attribute(s, "aria-controls", H), e.set_attribute(s, "aria-disabled", f()), e.set_attribute(s, "tabindex", f() ? -1 : 0), e.set_text(B, e.get(S)), e.set_text(W, e.get(y) ? "▲" : "▼");
|
|
388
|
+
}), e.delegated("click", s, x), e.delegated("keydown", s, m), e.append(a, s);
|
|
389
|
+
}, l = (a) => {
|
|
390
|
+
var s = tt();
|
|
391
|
+
let D;
|
|
392
|
+
var c = e.child(s);
|
|
393
|
+
{
|
|
394
|
+
var k = (L) => {
|
|
395
|
+
var U = Ze(), u = e.child(U, !0);
|
|
396
|
+
e.reset(U), e.template_effect(() => {
|
|
397
|
+
e.set_attribute(U, "for", I), e.set_text(u, _());
|
|
398
|
+
}), e.append(L, U);
|
|
399
|
+
};
|
|
400
|
+
e.if(c, (L) => {
|
|
401
|
+
_() && L(k);
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
var M = e.sibling(c, 2), B = e.child(M), j = e.child(B);
|
|
405
|
+
{
|
|
406
|
+
var W = (L) => {
|
|
407
|
+
var U = $e(), u = e.child(U, !0);
|
|
408
|
+
e.reset(U), U.value = U.__value = "", e.template_effect(() => e.set_text(u, n())), e.append(L, U);
|
|
409
|
+
};
|
|
410
|
+
e.if(j, (L) => {
|
|
411
|
+
n() && !d() && L(W);
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
var O = e.sibling(j);
|
|
415
|
+
e.each(O, 17, () => t.options, e.index, (L, U) => {
|
|
416
|
+
var u = et(), G = e.child(u, !0);
|
|
417
|
+
e.reset(u);
|
|
418
|
+
var T = {};
|
|
419
|
+
e.template_effect(() => {
|
|
420
|
+
u.disabled = e.get(U).disabled, e.set_text(G, e.get(U).label), T !== (T = e.get(U).value) && (u.value = (u.__value = e.get(U).value) ?? "");
|
|
421
|
+
}), e.append(L, u);
|
|
422
|
+
}), e.reset(B), e.next(2), e.reset(M), e.reset(s), e.template_effect(() => {
|
|
423
|
+
D = e.set_class(s, 1, `select-wrapper ${r() ?? ""}`, "svelte-1dtdvx6", D, { disabled: f() }), e.set_attribute(B, "id", I), B.disabled = f(), e.set_attribute(B, "aria-disabled", f()), e.set_attribute(B, "aria-label", _() || n() || "Select");
|
|
424
|
+
}), e.delegated("change", B, N), e.bind_select_value(B, d), e.append(a, s);
|
|
425
|
+
};
|
|
426
|
+
e.if(v, (a) => {
|
|
427
|
+
e.get(g) ? a(h) : a(l, !1);
|
|
428
|
+
});
|
|
155
429
|
}
|
|
156
|
-
|
|
157
|
-
|
|
430
|
+
e.append(K, A), e.pop();
|
|
431
|
+
}
|
|
432
|
+
e.delegate(["click", "keydown", "change"]);
|
|
433
|
+
var at = e.from_html('<span class="toggle-label svelte-197v0i2"> </span>'), st = e.from_html('<label><!> <div class="toggle-track svelte-197v0i2" role="switch"><div class="toggle-thumb svelte-197v0i2"></div></div></label>');
|
|
434
|
+
function lt(K, t) {
|
|
435
|
+
e.push(t, !0);
|
|
436
|
+
let F = e.prop(t, "checked", 15, !1), d = e.prop(t, "disabled", 3, !1), n = e.prop(t, "label", 3, ""), _ = e.state(e.proxy(F() ? 1 : 0)), f = e.state(0);
|
|
437
|
+
const r = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1;
|
|
438
|
+
let w, g;
|
|
439
|
+
e.user_effect(() => {
|
|
440
|
+
if (!r)
|
|
441
|
+
return w = ge(F() ? 1 : 0, "snappy", (m) => e.set(_, m, !0)), g = ge(0, "gentle", (m) => e.set(f, m, !0)), () => {
|
|
442
|
+
w == null || w.stop(), g == null || g.stop();
|
|
443
|
+
};
|
|
444
|
+
}), e.user_effect(() => {
|
|
445
|
+
r ? e.set(_, F() ? 1 : 0, !0) : w == null || w.set(F() ? 1 : 0);
|
|
446
|
+
});
|
|
447
|
+
function S() {
|
|
448
|
+
var m;
|
|
449
|
+
d() || (F(!F()), (m = t.onchange) == null || m.call(t, F()));
|
|
158
450
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
451
|
+
function H(m) {
|
|
452
|
+
(m.key === " " || m.key === "Enter") && (m.preventDefault(), S());
|
|
453
|
+
}
|
|
454
|
+
var I = st();
|
|
455
|
+
let y;
|
|
456
|
+
var P = e.child(I);
|
|
162
457
|
{
|
|
163
|
-
var
|
|
164
|
-
var
|
|
165
|
-
e.reset(
|
|
458
|
+
var N = (m) => {
|
|
459
|
+
var A = at(), v = e.child(A, !0);
|
|
460
|
+
e.reset(A), e.template_effect(() => e.set_text(v, n())), e.append(m, A);
|
|
166
461
|
};
|
|
167
|
-
e.if(
|
|
168
|
-
|
|
462
|
+
e.if(P, (m) => {
|
|
463
|
+
n() && m(N);
|
|
169
464
|
});
|
|
170
465
|
}
|
|
171
|
-
var
|
|
172
|
-
let
|
|
173
|
-
e.reset(
|
|
174
|
-
(
|
|
175
|
-
|
|
466
|
+
var x = e.sibling(P, 2);
|
|
467
|
+
let p;
|
|
468
|
+
e.reset(I), e.template_effect(
|
|
469
|
+
(m) => {
|
|
470
|
+
y = e.set_class(I, 1, "toggle-wrapper svelte-197v0i2", null, y, { disabled: d() }), e.set_attribute(x, "aria-checked", F()), e.set_attribute(x, "tabindex", d() ? -1 : 0), p = e.set_style(x, "", p, m);
|
|
176
471
|
},
|
|
177
472
|
[
|
|
178
473
|
() => ({
|
|
179
|
-
"--thumb-x": e.get(
|
|
180
|
-
"--track-color": `color-mix(in srgb, var(--color-accent, #6366f1) ${Math.round(e.get(
|
|
181
|
-
"--focus-opacity": e.get(
|
|
474
|
+
"--thumb-x": e.get(_),
|
|
475
|
+
"--track-color": `color-mix(in srgb, var(--color-accent, #6366f1) ${Math.round(e.get(_) * 100)}%, var(--surface-2, #2a2a2a) ${Math.round((1 - e.get(_)) * 100)}%)`,
|
|
476
|
+
"--focus-opacity": e.get(f)
|
|
182
477
|
})
|
|
183
478
|
]
|
|
184
|
-
), e.delegated("click",
|
|
479
|
+
), e.delegated("click", x, S), e.delegated("keydown", x, H), e.event("focus", x, () => r ? e.set(f, 1) : g == null ? void 0 : g.set(1)), e.event("blur", x, () => r ? e.set(f, 0) : g == null ? void 0 : g.set(0)), e.append(K, I), e.pop();
|
|
185
480
|
}
|
|
186
481
|
e.delegate(["click", "keydown"]);
|
|
187
|
-
var
|
|
188
|
-
function
|
|
482
|
+
var it = e.from_html("<span><!></span>"), nt = e.from_html("<div><!></div>"), rt = e.from_html("<span><!></span>"), dt = e.from_html("<p><!></p>");
|
|
483
|
+
function Ya(K, t) {
|
|
189
484
|
e.push(t, !0);
|
|
190
|
-
let
|
|
191
|
-
const
|
|
192
|
-
|
|
485
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "bold", 3, !1), n = e.prop(t, "italic", 3, !1), _ = e.prop(t, "dim", 3, !1), f = e.prop(t, "underline", 3, !1), r = e.prop(t, "color", 3, "default"), w = e.prop(t, "align", 3, "left"), g = e.prop(t, "wrap", 3, !0), S = e.prop(t, "inline", 3, !1), H = e.prop(t, "class", 3, "");
|
|
486
|
+
const I = ie(), y = e.derived(() => F() || I()), P = {
|
|
487
|
+
default: "var(--tui-text, #e0e0e0)",
|
|
488
|
+
accent: "var(--tui-accent, #00d4ff)",
|
|
489
|
+
success: "var(--tui-success, #00ff88)",
|
|
490
|
+
warning: "var(--tui-warning, #ffaa00)",
|
|
491
|
+
error: "var(--tui-error, #ff4444)",
|
|
492
|
+
dim: "var(--tui-text-dim, #888888)"
|
|
493
|
+
}, N = {
|
|
494
|
+
default: "var(--color-text, #e8e8e8)",
|
|
495
|
+
accent: "var(--color-accent, #6366f1)",
|
|
496
|
+
success: "var(--color-success, #22c55e)",
|
|
497
|
+
warning: "var(--color-warning, #f59e0b)",
|
|
498
|
+
error: "var(--color-danger, #ef4444)",
|
|
499
|
+
dim: "var(--color-text-muted, #888888)"
|
|
500
|
+
}, x = e.derived(() => e.get(y) ? P[r()] ?? r() : N[r()] ?? r());
|
|
501
|
+
var p = e.comment(), m = e.first_child(p);
|
|
193
502
|
{
|
|
194
|
-
var
|
|
195
|
-
var
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
503
|
+
var A = (l) => {
|
|
504
|
+
var a = e.comment(), s = e.first_child(a);
|
|
505
|
+
{
|
|
506
|
+
var D = (k) => {
|
|
507
|
+
var M = it();
|
|
508
|
+
let B, j;
|
|
509
|
+
var W = e.child(M);
|
|
510
|
+
e.snippet(W, () => t.children), e.reset(M), e.template_effect(() => {
|
|
511
|
+
B = e.set_class(M, 1, `tui-text ${H() ?? ""}`, "svelte-16j019f", B, {
|
|
512
|
+
bold: d(),
|
|
513
|
+
italic: n(),
|
|
514
|
+
"tui-dim": _(),
|
|
515
|
+
underline: f()
|
|
516
|
+
}), j = e.set_style(M, "", j, {
|
|
517
|
+
color: e.get(x),
|
|
518
|
+
"white-space": g() ? void 0 : "nowrap"
|
|
519
|
+
});
|
|
520
|
+
}), e.append(k, M);
|
|
521
|
+
}, c = (k) => {
|
|
522
|
+
var M = nt();
|
|
523
|
+
let B, j;
|
|
524
|
+
var W = e.child(M);
|
|
525
|
+
e.snippet(W, () => t.children), e.reset(M), e.template_effect(() => {
|
|
526
|
+
B = e.set_class(M, 1, `tui-text tui-block ${H() ?? ""}`, "svelte-16j019f", B, {
|
|
527
|
+
bold: d(),
|
|
528
|
+
italic: n(),
|
|
529
|
+
"tui-dim": _(),
|
|
530
|
+
underline: f()
|
|
531
|
+
}), j = e.set_style(M, "", j, {
|
|
532
|
+
color: e.get(x),
|
|
533
|
+
"text-align": w() !== "left" ? w() : void 0,
|
|
534
|
+
"white-space": g() ? "pre-wrap" : "nowrap"
|
|
535
|
+
});
|
|
536
|
+
}), e.append(k, M);
|
|
537
|
+
};
|
|
538
|
+
e.if(s, (k) => {
|
|
539
|
+
S() ? k(D) : k(c, !1);
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
e.append(l, a);
|
|
543
|
+
}, v = (l) => {
|
|
544
|
+
var a = rt();
|
|
545
|
+
let s, D;
|
|
546
|
+
var c = e.child(a);
|
|
547
|
+
e.snippet(c, () => t.children), e.reset(a), e.template_effect(() => {
|
|
548
|
+
s = e.set_class(a, 1, `gui-text ${H() ?? ""}`, "svelte-16j019f", s, {
|
|
549
|
+
bold: d(),
|
|
550
|
+
italic: n(),
|
|
551
|
+
"gui-dim": _(),
|
|
552
|
+
underline: f()
|
|
553
|
+
}), D = e.set_style(a, "", D, {
|
|
554
|
+
color: e.get(x),
|
|
555
|
+
"white-space": g() ? void 0 : "nowrap"
|
|
556
|
+
});
|
|
557
|
+
}), e.append(l, a);
|
|
558
|
+
}, h = (l) => {
|
|
559
|
+
var a = dt();
|
|
560
|
+
let s, D;
|
|
561
|
+
var c = e.child(a);
|
|
562
|
+
e.snippet(c, () => t.children), e.reset(a), e.template_effect(() => {
|
|
563
|
+
s = e.set_class(a, 1, `gui-text gui-block ${H() ?? ""}`, "svelte-16j019f", s, {
|
|
564
|
+
bold: d(),
|
|
565
|
+
italic: n(),
|
|
566
|
+
"gui-dim": _(),
|
|
567
|
+
underline: f()
|
|
568
|
+
}), D = e.set_style(a, "", D, {
|
|
569
|
+
color: e.get(x),
|
|
570
|
+
"text-align": w() !== "left" ? w() : void 0,
|
|
571
|
+
"white-space": g() ? "normal" : "nowrap"
|
|
572
|
+
});
|
|
573
|
+
}), e.append(l, a);
|
|
215
574
|
};
|
|
216
|
-
e.if(
|
|
217
|
-
e.get(
|
|
575
|
+
e.if(m, (l) => {
|
|
576
|
+
e.get(y) ? l(A) : S() ? l(v, 1) : l(h, !1);
|
|
218
577
|
});
|
|
219
578
|
}
|
|
220
|
-
e.append(
|
|
579
|
+
e.append(K, p), e.pop();
|
|
221
580
|
}
|
|
222
|
-
var
|
|
223
|
-
function
|
|
581
|
+
var ct = e.from_html(' <span class="search-tui__cursor svelte-1xnd4ea">█</span> ', 1), ot = e.from_html('<span class="search-tui__result-gap svelte-1xnd4ea"> </span> <span class="search-tui__result-score svelte-1xnd4ea"> </span>', 1), vt = e.from_html('<div role="option" tabindex="-1"><span class="search-tui__side search-tui__side--dim svelte-1xnd4ea">│</span> <span class="search-tui__result-content svelte-1xnd4ea"><span class="search-tui__result-prefix svelte-1xnd4ea"> </span> <span class="search-tui__result-text svelte-1xnd4ea"> </span> <!></span> <span class="search-tui__side search-tui__side--dim svelte-1xnd4ea">│</span></div>'), ut = e.from_html('<div class="search-tui__separator svelte-1xnd4ea"> </div> <div role="listbox" aria-label="Search suggestions" class="svelte-1xnd4ea"></div>', 1), _t = e.from_html('<label><div> </div> <div class="search-tui__row svelte-1xnd4ea"><span>│</span> <span><!></span> <span>│</span></div> <!> <div class="search-tui__bottom svelte-1xnd4ea"> </div> <input class="search-tui__hidden svelte-1xnd4ea" type="text" aria-label="Search" role="combobox" aria-autocomplete="list" aria-haspopup="listbox"/></label>'), gt = e.from_html('<mark class="search-gui__highlight svelte-1xnd4ea"> </mark>'), ft = e.from_html('<span class="search-gui__score svelte-1xnd4ea"> </span>'), ht = e.from_html('<li role="option" tabindex="-1"><span class="search-gui__option-text svelte-1xnd4ea"></span> <!></li>'), pt = e.from_html('<ul class="search-gui__dropdown svelte-1xnd4ea" role="listbox" aria-label="Search suggestions"></ul>'), mt = e.from_html('<div><div><span class="search-gui__icon svelte-1xnd4ea" aria-hidden="true">⌕</span> <input class="search-gui__input svelte-1xnd4ea" type="text" aria-label="Search" role="combobox" aria-autocomplete="list" aria-haspopup="listbox"/></div> <!></div>');
|
|
582
|
+
function Wa(K, t) {
|
|
224
583
|
e.push(t, !0);
|
|
225
|
-
let
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
584
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "value", 15, ""), n = e.prop(t, "placeholder", 3, "Search..."), _ = e.prop(t, "maxSuggestions", 3, 8), f = e.prop(t, "debounceMs", 3, 100), r = e.prop(t, "showScores", 3, !0), w = e.prop(t, "class", 3, ""), g = e.prop(t, "cols", 3, 48);
|
|
585
|
+
const S = ie(), H = e.derived(() => F() || S());
|
|
586
|
+
let I = e.state(void 0), y = e.state(!1), P = e.state(0), N = e.state(e.proxy([])), x = e.state(-1), p = e.state(!1);
|
|
587
|
+
function m() {
|
|
588
|
+
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
589
|
+
return `search-listbox-${crypto.randomUUID()}`;
|
|
590
|
+
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
591
|
+
const o = new Uint32Array(1);
|
|
592
|
+
return crypto.getRandomValues(o), `search-listbox-${o[0].toString(36)}`;
|
|
593
|
+
}
|
|
594
|
+
return `search-listbox-${Date.now().toString(36)}`;
|
|
595
|
+
}
|
|
596
|
+
const A = m();
|
|
597
|
+
let v;
|
|
598
|
+
const h = e.derived(() => Math.max(6, g())), l = e.derived(() => e.get(h) - 2), a = e.derived(() => (() => {
|
|
599
|
+
const o = "Search", i = Math.max(0, e.get(l) - 4), z = `─ ${o.length > i ? o.substring(0, i) : o} `, E = Math.max(0, e.get(l) - z.length);
|
|
600
|
+
return `┌${z}${"─".repeat(E)}┐`;
|
|
601
|
+
})()), s = e.derived(() => `├${"─".repeat(e.get(l))}┤`), D = e.derived(() => `└${"─".repeat(e.get(l))}┘`), c = e.derived(() => {
|
|
602
|
+
const o = d() ?? "", i = o.length, b = Math.min(Math.max(0, e.get(P)), i);
|
|
603
|
+
if (!e.get(y))
|
|
604
|
+
return o ? {
|
|
605
|
+
kind: "text",
|
|
606
|
+
text: o.substring(0, e.get(l)).padEnd(e.get(l), " ")
|
|
607
|
+
} : {
|
|
608
|
+
kind: "placeholder",
|
|
609
|
+
text: (n() || "").substring(0, e.get(l)).padEnd(e.get(l), " ")
|
|
610
|
+
};
|
|
611
|
+
const z = e.get(l) - 1;
|
|
612
|
+
let E;
|
|
613
|
+
i <= z ? E = 0 : (E = Math.min(b, i - z), E = Math.max(0, E), b < E && (E = b));
|
|
614
|
+
const q = o.substring(E, b), V = o.substring(b, E + z), Y = " ".repeat(Math.max(0, z - q.length - V.length));
|
|
615
|
+
return { kind: "cursor", before: q, after: V, pad: Y };
|
|
616
|
+
});
|
|
617
|
+
function k(o, i) {
|
|
618
|
+
const b = i === e.get(x) ? "› " : " ";
|
|
619
|
+
if (r()) {
|
|
620
|
+
const z = `★ ${o.score.toFixed(2)}`, E = " ", q = Math.max(0, e.get(l) - b.length - E.length - z.length), V = o.text.length > q ? o.text.substring(0, q - 1) + "…" : o.text.padEnd(q, " ");
|
|
621
|
+
return { prefix: b, text: V, gap: E, score: z };
|
|
622
|
+
} else {
|
|
623
|
+
const z = Math.max(0, e.get(l) - b.length), E = o.text.length > z ? o.text.substring(0, z - 1) + "…" : o.text.padEnd(z, " ");
|
|
624
|
+
return { prefix: b, text: E, gap: "", score: "" };
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
async function M(o) {
|
|
628
|
+
if (!o.trim()) {
|
|
629
|
+
e.set(N, [], !0), e.set(p, !1), e.set(x, -1);
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
try {
|
|
633
|
+
const i = await t.onSearch(o);
|
|
634
|
+
e.set(N, i.slice(0, _()), !0), e.set(x, -1), e.set(p, e.get(N).length > 0);
|
|
635
|
+
} catch {
|
|
636
|
+
e.set(N, [], !0), e.set(p, !1);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
function B(o) {
|
|
640
|
+
d(o.text), e.set(N, [], !0), e.set(p, !1), e.set(x, -1), t.onSelect(o);
|
|
641
|
+
}
|
|
642
|
+
function j(o) {
|
|
643
|
+
const i = o.target;
|
|
644
|
+
d(i.value), O(), clearTimeout(v), v = setTimeout(() => M(d() ?? ""), f());
|
|
645
|
+
}
|
|
646
|
+
function W(o) {
|
|
647
|
+
o.key === "ArrowDown" ? (o.preventDefault(), e.get(N).length > 0 && e.set(x, Math.min(e.get(x) + 1, e.get(N).length - 1), !0)) : o.key === "ArrowUp" ? (o.preventDefault(), e.get(N).length > 0 && e.set(x, Math.max(e.get(x) - 1, -1), !0)) : o.key === "Enter" ? (o.preventDefault(), e.get(x) >= 0 && e.get(x) < e.get(N).length && B(e.get(N)[e.get(x)])) : o.key === "Escape" && (e.set(N, [], !0), e.set(p, !1), e.set(x, -1)), O();
|
|
648
|
+
}
|
|
649
|
+
function O() {
|
|
650
|
+
const o = e.get(I);
|
|
651
|
+
o && (typeof queueMicrotask < "u" ? queueMicrotask(() => {
|
|
652
|
+
e.set(P, o.selectionStart ?? (d() ?? "").length, !0);
|
|
653
|
+
}) : e.set(P, o.selectionStart ?? (d() ?? "").length, !0));
|
|
654
|
+
}
|
|
655
|
+
function L() {
|
|
656
|
+
e.set(y, !0), O(), (d() ?? "").trim() && e.get(N).length > 0 && e.set(p, !0);
|
|
657
|
+
}
|
|
658
|
+
function U() {
|
|
659
|
+
e.set(y, !1), setTimeout(
|
|
660
|
+
() => {
|
|
661
|
+
e.set(p, !1);
|
|
662
|
+
},
|
|
663
|
+
150
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
function u(o, i) {
|
|
667
|
+
if (!i.trim()) return [{ text: o, match: !1 }];
|
|
668
|
+
const b = o.toLowerCase(), z = i.trim().toLowerCase(), E = b.indexOf(z);
|
|
669
|
+
return E < 0 ? [{ text: o, match: !1 }] : [
|
|
670
|
+
{ text: o.slice(0, E), match: !1 },
|
|
671
|
+
{ text: o.slice(E, E + z.length), match: !0 },
|
|
672
|
+
{ text: o.slice(E + z.length), match: !1 }
|
|
673
|
+
];
|
|
674
|
+
}
|
|
675
|
+
var G = e.comment(), T = e.first_child(G);
|
|
676
|
+
{
|
|
677
|
+
var C = (o) => {
|
|
678
|
+
var i = _t();
|
|
679
|
+
let b;
|
|
680
|
+
var z = e.child(i);
|
|
681
|
+
let E;
|
|
682
|
+
var q = e.child(z, !0);
|
|
683
|
+
e.reset(z);
|
|
684
|
+
var V = e.sibling(z, 2), Y = e.child(V);
|
|
685
|
+
let J;
|
|
686
|
+
var Z = e.sibling(Y, 2);
|
|
687
|
+
let $;
|
|
688
|
+
var ne = e.child(Z);
|
|
689
|
+
{
|
|
690
|
+
var re = (X) => {
|
|
691
|
+
var ee = e.text();
|
|
692
|
+
e.template_effect(() => e.set_text(ee, e.get(c).text)), e.append(X, ee);
|
|
693
|
+
}, ae = (X) => {
|
|
694
|
+
var ee = e.text();
|
|
695
|
+
e.template_effect(() => e.set_text(ee, e.get(c).text)), e.append(X, ee);
|
|
696
|
+
}, oe = (X) => {
|
|
697
|
+
var ee = ct(), le = e.first_child(ee, !0), ve = e.sibling(le, 2);
|
|
698
|
+
e.template_effect(() => {
|
|
699
|
+
e.set_text(le, e.get(c).before), e.set_text(ve, `${e.get(c).after ?? ""}${e.get(c).pad ?? ""}`);
|
|
700
|
+
}), e.append(X, ee);
|
|
701
|
+
};
|
|
702
|
+
e.if(ne, (X) => {
|
|
703
|
+
e.get(c).kind === "placeholder" ? X(re) : e.get(c).kind === "text" ? X(ae, 1) : X(oe, !1);
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
e.reset(Z);
|
|
707
|
+
var ue = e.sibling(Z, 2);
|
|
708
|
+
let de;
|
|
709
|
+
e.reset(V);
|
|
710
|
+
var ce = e.sibling(V, 2);
|
|
711
|
+
{
|
|
712
|
+
var se = (X) => {
|
|
713
|
+
var ee = ut(), le = e.first_child(ee), ve = e.child(le, !0);
|
|
714
|
+
e.reset(le);
|
|
715
|
+
var me = e.sibling(le, 2);
|
|
716
|
+
e.each(me, 21, () => e.get(N), e.index, (Pe, ze, xe) => {
|
|
717
|
+
const be = e.derived(() => k(e.get(ze), xe));
|
|
718
|
+
var fe = vt();
|
|
719
|
+
let Me;
|
|
720
|
+
var Ce = e.sibling(e.child(fe), 2), ye = e.child(Ce), Ie = e.child(ye, !0);
|
|
721
|
+
e.reset(ye);
|
|
722
|
+
var we = e.sibling(ye, 2), Ne = e.child(we, !0);
|
|
723
|
+
e.reset(we);
|
|
724
|
+
var Le = e.sibling(we, 2);
|
|
725
|
+
{
|
|
726
|
+
var Ae = (ke) => {
|
|
727
|
+
var De = ot(), Te = e.first_child(De), Be = e.child(Te, !0);
|
|
728
|
+
e.reset(Te);
|
|
729
|
+
var Ee = e.sibling(Te, 2), Ue = e.child(Ee, !0);
|
|
730
|
+
e.reset(Ee), e.template_effect(() => {
|
|
731
|
+
e.set_text(Be, e.get(be).gap), e.set_text(Ue, e.get(be).score);
|
|
732
|
+
}), e.append(ke, De);
|
|
733
|
+
};
|
|
734
|
+
e.if(Le, (ke) => {
|
|
735
|
+
e.get(be).score && ke(Ae);
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
e.reset(Ce), e.next(2), e.reset(fe), e.template_effect(() => {
|
|
739
|
+
Me = e.set_class(fe, 1, "search-tui__result svelte-1xnd4ea", null, Me, { "search-tui__result--selected": xe === e.get(x) }), e.set_attribute(fe, "aria-selected", xe === e.get(x)), e.set_text(Ie, e.get(be).prefix), e.set_text(Ne, e.get(be).text);
|
|
740
|
+
}), e.delegated("mousedown", fe, () => B(e.get(ze))), e.append(Pe, fe);
|
|
741
|
+
}), e.reset(me), e.template_effect(() => {
|
|
742
|
+
e.set_text(ve, e.get(s)), e.set_attribute(me, "id", A);
|
|
743
|
+
}), e.append(X, ee);
|
|
744
|
+
};
|
|
745
|
+
e.if(ce, (X) => {
|
|
746
|
+
e.get(p) && e.get(N).length > 0 && X(se);
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
var te = e.sibling(ce, 2), _e = e.child(te, !0);
|
|
750
|
+
e.reset(te);
|
|
751
|
+
var Q = e.sibling(te, 2);
|
|
752
|
+
e.remove_input_defaults(Q), e.bind_this(Q, (X) => e.set(I, X), () => e.get(I)), e.reset(i), e.template_effect(() => {
|
|
753
|
+
b = e.set_class(i, 1, `search-tui ${w() ?? ""}`, "svelte-1xnd4ea", b, { focused: e.get(y) }), E = e.set_class(z, 1, "search-tui__top svelte-1xnd4ea", null, E, { focused: e.get(y) }), e.set_text(q, e.get(a)), J = e.set_class(Y, 1, "search-tui__side svelte-1xnd4ea", null, J, { focused: e.get(y) }), $ = e.set_class(Z, 1, "search-tui__content svelte-1xnd4ea", null, $, {
|
|
754
|
+
"search-tui__content--placeholder": e.get(c).kind === "placeholder"
|
|
755
|
+
}), de = e.set_class(ue, 1, "search-tui__side svelte-1xnd4ea", null, de, { focused: e.get(y) }), e.set_text(_e, e.get(D)), e.set_value(Q, d()), e.set_attribute(Q, "aria-controls", A), e.set_attribute(Q, "aria-expanded", e.get(p));
|
|
756
|
+
}), e.delegated("input", Q, j), e.delegated("keydown", Q, W), e.event("focus", Q, L), e.event("blur", Q, U), e.delegated("click", Q, O), e.event("select", Q, O), e.append(o, i);
|
|
757
|
+
}, R = (o) => {
|
|
758
|
+
var i = mt(), b = e.child(i);
|
|
759
|
+
let z;
|
|
760
|
+
var E = e.sibling(e.child(b), 2);
|
|
761
|
+
e.remove_input_defaults(E), e.bind_this(E, (Y) => e.set(I, Y), () => e.get(I)), e.reset(b);
|
|
762
|
+
var q = e.sibling(b, 2);
|
|
763
|
+
{
|
|
764
|
+
var V = (Y) => {
|
|
765
|
+
var J = pt();
|
|
766
|
+
e.each(J, 21, () => e.get(N), e.index, (Z, $, ne) => {
|
|
767
|
+
const re = e.derived(() => u(e.get($).text, d() ?? ""));
|
|
768
|
+
var ae = ht();
|
|
769
|
+
let oe;
|
|
770
|
+
var ue = e.child(ae);
|
|
771
|
+
e.each(ue, 21, () => e.get(re), e.index, (se, te) => {
|
|
772
|
+
var _e = e.comment(), Q = e.first_child(_e);
|
|
773
|
+
{
|
|
774
|
+
var X = (le) => {
|
|
775
|
+
var ve = gt(), me = e.child(ve, !0);
|
|
776
|
+
e.reset(ve), e.template_effect(() => e.set_text(me, e.get(te).text)), e.append(le, ve);
|
|
777
|
+
}, ee = (le) => {
|
|
778
|
+
var ve = e.text();
|
|
779
|
+
e.template_effect(() => e.set_text(ve, e.get(te).text)), e.append(le, ve);
|
|
780
|
+
};
|
|
781
|
+
e.if(Q, (le) => {
|
|
782
|
+
e.get(te).match ? le(X) : le(ee, !1);
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
e.append(se, _e);
|
|
786
|
+
}), e.reset(ue);
|
|
787
|
+
var de = e.sibling(ue, 2);
|
|
788
|
+
{
|
|
789
|
+
var ce = (se) => {
|
|
790
|
+
var te = ft(), _e = e.child(te);
|
|
791
|
+
e.reset(te), e.template_effect((Q) => e.set_text(_e, `★ ${Q ?? ""}`), [() => e.get($).score.toFixed(2)]), e.append(se, te);
|
|
792
|
+
};
|
|
793
|
+
e.if(de, (se) => {
|
|
794
|
+
r() && se(ce);
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
e.reset(ae), e.template_effect(() => {
|
|
798
|
+
oe = e.set_class(ae, 1, "search-gui__option svelte-1xnd4ea", null, oe, { "search-gui__option--selected": ne === e.get(x) }), e.set_attribute(ae, "aria-selected", ne === e.get(x));
|
|
799
|
+
}), e.delegated("mousedown", ae, () => B(e.get($))), e.event("mouseenter", ae, () => e.set(x, ne, !0)), e.append(Z, ae);
|
|
800
|
+
}), e.reset(J), e.template_effect(() => e.set_attribute(J, "id", A)), e.append(Y, J);
|
|
801
|
+
};
|
|
802
|
+
e.if(q, (Y) => {
|
|
803
|
+
e.get(p) && e.get(N).length > 0 && Y(V);
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
e.reset(i), e.template_effect(() => {
|
|
807
|
+
e.set_class(i, 1, `search-gui ${w() ?? ""}`, "svelte-1xnd4ea"), z = e.set_class(b, 1, "search-gui__field svelte-1xnd4ea", null, z, { "search-gui__field--focused": e.get(y) }), e.set_value(E, d()), e.set_attribute(E, "placeholder", n()), e.set_attribute(E, "aria-controls", A), e.set_attribute(E, "aria-expanded", e.get(p));
|
|
808
|
+
}), e.delegated("input", E, j), e.delegated("keydown", E, W), e.event("focus", E, L), e.event("blur", E, U), e.append(o, i);
|
|
809
|
+
};
|
|
810
|
+
e.if(T, (o) => {
|
|
811
|
+
e.get(H) ? o(C) : o(R, !1);
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
e.append(K, G), e.pop();
|
|
815
|
+
}
|
|
816
|
+
e.delegate(["mousedown", "input", "keydown", "click"]);
|
|
817
|
+
var bt = e.from_html('<div class="tui-panel svelte-1ps7oei"><div class="tui-panel-top svelte-1ps7oei"> </div> <div class="tui-panel-body svelte-1ps7oei"><span class="tui-panel-side svelte-1ps7oei">║</span> <div class="tui-panel-content svelte-1ps7oei"><!></div> <span class="tui-panel-side svelte-1ps7oei">║</span></div> <div class="tui-panel-bottom svelte-1ps7oei"> </div></div>'), xt = e.from_html('<div class="glass svelte-1ps7oei"><!></div>');
|
|
818
|
+
function yt(K, t) {
|
|
819
|
+
e.push(t, !0);
|
|
820
|
+
let F = e.prop(t, "blur", 3, 20), d = e.prop(t, "opacity", 3, 0.6), n = e.prop(t, "radius", 3, "var(--radius-md, 10px)"), _ = e.prop(t, "padding", 3, "var(--space-4, 16px)"), f = e.prop(t, "tui", 3, !1), r = e.prop(t, "cols", 3, 20);
|
|
821
|
+
const w = ie(), g = e.derived(() => f() || w()), S = e.derived(() => "═".repeat(r()));
|
|
822
|
+
var H = e.comment(), I = e.first_child(H);
|
|
823
|
+
{
|
|
824
|
+
var y = (N) => {
|
|
825
|
+
var x = bt();
|
|
826
|
+
let p;
|
|
827
|
+
var m = e.child(x), A = e.child(m);
|
|
828
|
+
e.reset(m);
|
|
829
|
+
var v = e.sibling(m, 2), h = e.sibling(e.child(v), 2), l = e.child(h);
|
|
830
|
+
e.snippet(l, () => t.children), e.reset(h), e.next(2), e.reset(v);
|
|
831
|
+
var a = e.sibling(v, 2), s = e.child(a);
|
|
832
|
+
e.reset(a), e.reset(x), e.template_effect(() => {
|
|
833
|
+
p = e.set_style(x, "", p, { padding: _() }), e.set_text(A, `╔${e.get(S) ?? ""}╗`), e.set_text(s, `╚${e.get(S) ?? ""}╝`);
|
|
834
|
+
}), e.append(N, x);
|
|
835
|
+
}, P = (N) => {
|
|
836
|
+
var x = xt();
|
|
837
|
+
let p;
|
|
838
|
+
var m = e.child(x);
|
|
839
|
+
e.snippet(m, () => t.children), e.reset(x), e.template_effect(() => p = e.set_style(x, "", p, {
|
|
840
|
+
"--blur": `${F() ?? ""}px`,
|
|
841
|
+
"--bg-opacity": d(),
|
|
842
|
+
"border-radius": n(),
|
|
843
|
+
padding: _()
|
|
844
|
+
})), e.append(N, x);
|
|
845
|
+
};
|
|
846
|
+
e.if(I, (N) => {
|
|
847
|
+
e.get(g) ? N(y) : N(P, !1);
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
e.append(K, H), e.pop();
|
|
851
|
+
}
|
|
852
|
+
var wt = e.from_html('<div class="tui-border svelte-vnz7lv" aria-hidden="true"> </div>'), kt = e.from_html('<span class="tui-side svelte-vnz7lv" aria-hidden="true"> </span>'), Tt = e.from_html('<span class="tui-side svelte-vnz7lv" aria-hidden="true"> </span>'), zt = e.from_html('<div class="tui-border svelte-vnz7lv" aria-hidden="true"> </div>'), Mt = e.from_html('<div><!> <div class="tui-body svelte-vnz7lv"><!> <div class="tui-content svelte-vnz7lv"><!></div> <!></div> <!></div>'), Ct = e.from_html("<div><!></div>"), Dt = e.from_html("<div><!></div>");
|
|
853
|
+
function Ja(K, t) {
|
|
854
|
+
e.push(t, !0);
|
|
855
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "glass", 3, !1), n = e.prop(t, "class", 3, "");
|
|
856
|
+
const _ = ie(), f = e.derived(() => F() || _());
|
|
857
|
+
pe(() => e.get(f));
|
|
858
|
+
const r = e.derived(() => t.border ?? (e.get(f) ? "single" : "rounded")), w = {
|
|
859
|
+
single: ["─", "│", "┌", "┐", "└", "┘"],
|
|
860
|
+
rounded: ["─", "│", "╭", "╮", "╰", "╯"],
|
|
861
|
+
double: ["═", "║", "╔", "╗", "╚", "╝"],
|
|
862
|
+
bold: ["━", "┃", "┏", "┓", "┗", "┛"],
|
|
863
|
+
dashed: ["╌", "╎", "┌", "┐", "└", "┘"],
|
|
864
|
+
none: ["", "", "", "", "", ""]
|
|
865
|
+
}, g = e.derived(() => typeof t.width == "number" ? t.width : 30), S = e.derived(() => w[e.get(r)] ?? w.single);
|
|
866
|
+
function H(a, s, D) {
|
|
867
|
+
const [c, , k, M] = a;
|
|
868
|
+
if (!k) return "";
|
|
869
|
+
if (D) {
|
|
870
|
+
const B = ` ${D} `, j = Math.max(0, s - B.length - 1);
|
|
871
|
+
return `${k}${c}${B}${c.repeat(j)}${M}`;
|
|
872
|
+
}
|
|
873
|
+
return `${k}${c.repeat(s)}${M}`;
|
|
874
|
+
}
|
|
875
|
+
function I(a, s) {
|
|
876
|
+
const [D, , , , c, k] = a;
|
|
877
|
+
return c ? `${c}${D.repeat(s)}${k}` : "";
|
|
878
|
+
}
|
|
879
|
+
const y = e.derived(() => typeof t.width == "number" ? `${t.width}px` : t.width ?? void 0), P = e.derived(() => typeof t.height == "number" ? `${t.height}px` : t.height ?? void 0), N = e.derived(() => t.padding !== void 0 ? `${t.padding * 4}px` : "var(--space-4, 16px)"), x = e.derived(() => ({
|
|
880
|
+
none: { border: "none", radius: "0" },
|
|
881
|
+
single: {
|
|
882
|
+
border: "1px solid var(--color-border, #2a2a2a)",
|
|
883
|
+
radius: "0"
|
|
884
|
+
},
|
|
885
|
+
rounded: {
|
|
886
|
+
border: "1px solid var(--color-border, #2a2a2a)",
|
|
887
|
+
radius: "var(--radius-md, 10px)"
|
|
888
|
+
},
|
|
889
|
+
double: {
|
|
890
|
+
border: "3px double var(--color-border, #2a2a2a)",
|
|
891
|
+
radius: "0"
|
|
892
|
+
},
|
|
893
|
+
bold: {
|
|
894
|
+
border: "2px solid var(--color-border, #2a2a2a)",
|
|
895
|
+
radius: "0"
|
|
896
|
+
},
|
|
897
|
+
dashed: {
|
|
898
|
+
border: "1px dashed var(--color-border, #2a2a2a)",
|
|
899
|
+
radius: "0"
|
|
900
|
+
}
|
|
901
|
+
})[e.get(r)] ?? {
|
|
902
|
+
border: "1px solid var(--color-border, #2a2a2a)",
|
|
903
|
+
radius: "var(--radius-md, 10px)"
|
|
904
|
+
}), p = e.derived(() => t.padding !== void 0 && t.padding > 0 ? `${t.padding * 0.5}em ${t.padding}ch` : "0");
|
|
905
|
+
var m = e.comment(), A = e.first_child(m);
|
|
906
|
+
{
|
|
907
|
+
var v = (a) => {
|
|
908
|
+
var s = Mt();
|
|
909
|
+
let D;
|
|
910
|
+
var c = e.child(s);
|
|
911
|
+
{
|
|
912
|
+
var k = (C) => {
|
|
913
|
+
var R = wt(), o = e.child(R, !0);
|
|
914
|
+
e.reset(R), e.template_effect((i) => e.set_text(o, i), [
|
|
915
|
+
() => H(e.get(S), e.get(g), t.title)
|
|
916
|
+
]), e.append(C, R);
|
|
917
|
+
};
|
|
918
|
+
e.if(c, (C) => {
|
|
919
|
+
e.get(r) !== "none" && C(k);
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
var M = e.sibling(c, 2), B = e.child(M);
|
|
923
|
+
{
|
|
924
|
+
var j = (C) => {
|
|
925
|
+
var R = kt(), o = e.child(R, !0);
|
|
926
|
+
e.reset(R), e.template_effect(() => e.set_text(o, e.get(S)[1])), e.append(C, R);
|
|
927
|
+
};
|
|
928
|
+
e.if(B, (C) => {
|
|
929
|
+
e.get(r) !== "none" && C(j);
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
var W = e.sibling(B, 2);
|
|
933
|
+
let O;
|
|
934
|
+
var L = e.child(W);
|
|
935
|
+
e.snippet(L, () => t.children), e.reset(W);
|
|
936
|
+
var U = e.sibling(W, 2);
|
|
937
|
+
{
|
|
938
|
+
var u = (C) => {
|
|
939
|
+
var R = Tt(), o = e.child(R, !0);
|
|
940
|
+
e.reset(R), e.template_effect(() => e.set_text(o, e.get(S)[1])), e.append(C, R);
|
|
941
|
+
};
|
|
942
|
+
e.if(U, (C) => {
|
|
943
|
+
e.get(r) !== "none" && C(u);
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
e.reset(M);
|
|
947
|
+
var G = e.sibling(M, 2);
|
|
948
|
+
{
|
|
949
|
+
var T = (C) => {
|
|
950
|
+
var R = zt(), o = e.child(R, !0);
|
|
951
|
+
e.reset(R), e.template_effect((i) => e.set_text(o, i), [() => I(e.get(S), e.get(g))]), e.append(C, R);
|
|
952
|
+
};
|
|
953
|
+
e.if(G, (C) => {
|
|
954
|
+
e.get(r) !== "none" && C(T);
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
e.reset(s), e.template_effect(() => {
|
|
958
|
+
e.set_class(s, 1, `tui-box ${n() ?? ""}`, "svelte-vnz7lv"), D = e.set_style(s, "", D, {
|
|
959
|
+
width: typeof t.width == "number" ? `${t.width}ch` : void 0
|
|
960
|
+
}), O = e.set_style(W, "", O, { padding: e.get(p) });
|
|
961
|
+
}), e.append(a, s);
|
|
962
|
+
}, h = (a) => {
|
|
963
|
+
var s = Ct(), D = e.child(s);
|
|
964
|
+
yt(D, {
|
|
965
|
+
get padding() {
|
|
966
|
+
return e.get(N);
|
|
967
|
+
},
|
|
968
|
+
children: (k) => {
|
|
969
|
+
var M = e.comment(), B = e.first_child(M);
|
|
970
|
+
e.snippet(B, () => t.children), e.append(k, M);
|
|
971
|
+
},
|
|
972
|
+
$$slots: { default: !0 }
|
|
973
|
+
}), e.reset(s), e.template_effect(() => e.set_class(s, 1, `box ${n() ?? ""}`, "svelte-vnz7lv")), e.append(a, s);
|
|
974
|
+
}, l = (a) => {
|
|
975
|
+
var s = Dt();
|
|
976
|
+
let D;
|
|
977
|
+
var c = e.child(s);
|
|
978
|
+
e.snippet(c, () => t.children), e.reset(s), e.template_effect(() => {
|
|
979
|
+
e.set_class(s, 1, `box ${n() ?? ""}`, "svelte-vnz7lv"), D = e.set_style(s, "", D, {
|
|
980
|
+
width: e.get(y),
|
|
981
|
+
height: e.get(P),
|
|
982
|
+
padding: e.get(N),
|
|
983
|
+
border: e.get(x).border,
|
|
984
|
+
"border-radius": e.get(x).radius
|
|
985
|
+
});
|
|
986
|
+
}), e.append(a, s);
|
|
987
|
+
};
|
|
988
|
+
e.if(A, (a) => {
|
|
989
|
+
e.get(f) ? a(v) : d() ? a(h, 1) : a(l, !1);
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
e.append(K, m), e.pop();
|
|
993
|
+
}
|
|
994
|
+
var Et = e.from_html("<div><!></div>");
|
|
995
|
+
function Qa(K, t) {
|
|
996
|
+
e.push(t, !0);
|
|
997
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "direction", 3, "horizontal"), n = e.prop(t, "class", 3, "");
|
|
998
|
+
const _ = ie(), f = e.derived(() => F() || _());
|
|
999
|
+
pe(() => e.get(f));
|
|
1000
|
+
const r = e.derived(() => d() === "vertical" ? "column" : "row");
|
|
1001
|
+
var w = Et();
|
|
1002
|
+
let g, S;
|
|
1003
|
+
var H = e.child(w);
|
|
1004
|
+
e.snippet(H, () => t.children), e.reset(w), e.template_effect(() => {
|
|
1005
|
+
g = e.set_class(w, 1, `split-pane ${n() ?? ""}`, "svelte-elaebs", g, { "split-pane--tui": e.get(f) }), S = e.set_style(w, "", S, { "flex-direction": e.get(r) });
|
|
1006
|
+
}), e.append(K, w), e.pop();
|
|
1007
|
+
}
|
|
1008
|
+
var St = e.from_html('<div role="status" aria-label="Status bar"><!></div>');
|
|
1009
|
+
function Xa(K, t) {
|
|
1010
|
+
e.push(t, !0);
|
|
1011
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "position", 3, "bottom"), n = e.prop(t, "class", 3, "");
|
|
1012
|
+
const _ = ie(), f = e.derived(() => F() || _());
|
|
1013
|
+
pe(() => e.get(f));
|
|
1014
|
+
var r = St();
|
|
1015
|
+
let w;
|
|
1016
|
+
var g = e.child(r);
|
|
1017
|
+
e.snippet(g, () => t.children), e.reset(r), e.template_effect(() => w = e.set_class(r, 1, `statusbar ${n() ?? ""}`, "svelte-89fci1", w, {
|
|
1018
|
+
tui: e.get(f),
|
|
1019
|
+
gui: !e.get(f),
|
|
1020
|
+
top: !e.get(f) && d() === "top",
|
|
1021
|
+
bottom: !e.get(f) && d() === "bottom"
|
|
1022
|
+
})), e.append(K, r), e.pop();
|
|
1023
|
+
}
|
|
1024
|
+
var Pt = e.from_html('<span class="tui-label svelte-vrcx06"> </span>'), It = e.from_html('<span><!><span class="tui-value svelte-vrcx06"> </span></span>'), Nt = e.from_html('<span class="gui-label svelte-vrcx06"> </span>'), Lt = e.from_html('<!> <span class="gui-value svelte-vrcx06"> </span>', 1), At = e.from_html("<span><!></span>");
|
|
1025
|
+
function Za(K, t) {
|
|
1026
|
+
e.push(t, !0);
|
|
1027
|
+
let F = e.prop(t, "color", 3, "default"), d = e.prop(t, "highlight", 3, !1), n = e.prop(t, "separator", 3, !1);
|
|
1028
|
+
const _ = ie(), f = e.derived(_);
|
|
1029
|
+
var r = At();
|
|
1030
|
+
let w;
|
|
1031
|
+
var g = e.child(r);
|
|
1032
|
+
{
|
|
1033
|
+
var S = (I) => {
|
|
1034
|
+
var y = It();
|
|
1035
|
+
let P;
|
|
1036
|
+
var N = e.child(y);
|
|
1037
|
+
{
|
|
1038
|
+
var x = (A) => {
|
|
1039
|
+
var v = Pt(), h = e.child(v);
|
|
1040
|
+
e.reset(v), e.template_effect(() => e.set_text(h, `${t.label ?? ""}:`)), e.append(A, v);
|
|
1041
|
+
};
|
|
1042
|
+
e.if(N, (A) => {
|
|
1043
|
+
t.label && A(x);
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
var p = e.sibling(N), m = e.child(p, !0);
|
|
1047
|
+
e.reset(p), e.reset(y), e.template_effect(() => {
|
|
1048
|
+
P = e.set_class(y, 1, "tui-content svelte-vrcx06", null, P, { reversed: d() }), e.set_text(m, t.value);
|
|
1049
|
+
}), e.append(I, y);
|
|
1050
|
+
}, H = (I) => {
|
|
1051
|
+
var y = Lt(), P = e.first_child(y);
|
|
1052
|
+
{
|
|
1053
|
+
var N = (m) => {
|
|
1054
|
+
var A = Nt(), v = e.child(A, !0);
|
|
1055
|
+
e.reset(A), e.template_effect(() => e.set_text(v, t.label)), e.append(m, A);
|
|
1056
|
+
};
|
|
1057
|
+
e.if(P, (m) => {
|
|
1058
|
+
t.label && m(N);
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
var x = e.sibling(P, 2), p = e.child(x, !0);
|
|
1062
|
+
e.reset(x), e.template_effect(() => e.set_text(p, t.value)), e.append(I, y);
|
|
1063
|
+
};
|
|
1064
|
+
e.if(g, (I) => {
|
|
1065
|
+
e.get(f) ? I(S) : I(H, !1);
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
e.reset(r), e.template_effect(() => {
|
|
1069
|
+
w = e.set_class(r, 1, "status-item svelte-vrcx06", null, w, {
|
|
1070
|
+
tui: e.get(f),
|
|
1071
|
+
highlight: d(),
|
|
1072
|
+
"has-separator": !e.get(f) && n()
|
|
1073
|
+
}), e.set_attribute(r, "data-color", F());
|
|
1074
|
+
}), e.append(K, r), e.pop();
|
|
1075
|
+
}
|
|
1076
|
+
var Bt = e.from_html('<span aria-hidden="true"></span>');
|
|
1077
|
+
function $a(K, t) {
|
|
1078
|
+
e.push(t, !0);
|
|
1079
|
+
const F = ie(), d = e.derived(F);
|
|
1080
|
+
var n = Bt();
|
|
1081
|
+
let _;
|
|
1082
|
+
e.template_effect(() => _ = e.set_class(n, 1, "status-spacer svelte-1abxoj5", null, _, { tui: e.get(d) })), e.append(K, n), e.pop();
|
|
1083
|
+
}
|
|
1084
|
+
var Ut = e.from_html('<div role="row" tabindex="0"> </div>'), Rt = e.from_html('<div role="grid" aria-label="table"><div class="tui-border svelte-12m6nfw" aria-hidden="true"> </div> <div class="tui-header svelte-12m6nfw" role="row"> </div> <div class="tui-border svelte-12m6nfw" aria-hidden="true"> </div> <!> <div class="tui-border svelte-12m6nfw" aria-hidden="true"> </div></div>'), Ft = e.from_html('<th class="svelte-12m6nfw"> </th>'), Ht = e.from_html('<td class="svelte-12m6nfw"> </td>'), Kt = e.from_html('<tr tabindex="0"></tr>'), Ot = e.from_html('<div><table class="table svelte-12m6nfw" role="grid"><thead class="svelte-12m6nfw"><tr></tr></thead><tbody class="svelte-12m6nfw"></tbody></table></div>');
|
|
1085
|
+
function es(K, t) {
|
|
1086
|
+
e.push(t, !0);
|
|
1087
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "selected", 19, () => -1), n = e.prop(t, "class", 3, "");
|
|
1088
|
+
const _ = ie(), f = e.derived(() => F() || _()), r = e.derived(() => t.columns.map((v) => {
|
|
1089
|
+
const h = t.rows.reduce((l, a) => Math.max(l, (a[v.key] ?? "").length), 0);
|
|
1090
|
+
return v.width ?? Math.max(v.label.length, h, 3);
|
|
1091
|
+
})), w = 2;
|
|
1092
|
+
function g(v, h, l, a) {
|
|
1093
|
+
return h + v.map((s) => "═".repeat(s + w)).join(l) + a;
|
|
1094
|
+
}
|
|
1095
|
+
function S(v, h) {
|
|
1096
|
+
return "║" + v.map((l, a) => " " + l.padEnd(h[a]) + " ").join("║") + "║";
|
|
1097
|
+
}
|
|
1098
|
+
const H = e.derived(() => g(e.get(r), "╔", "╦", "╗")), I = e.derived(() => S(t.columns.map((v) => v.label), e.get(r))), y = e.derived(() => g(e.get(r), "╠", "╬", "╣")), P = e.derived(() => g(e.get(r), "╚", "╩", "╝"));
|
|
1099
|
+
function N(v, h) {
|
|
1100
|
+
var l;
|
|
1101
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), (l = t.onselect) == null || l.call(t, h));
|
|
1102
|
+
}
|
|
1103
|
+
var x = e.comment(), p = e.first_child(x);
|
|
1104
|
+
{
|
|
1105
|
+
var m = (v) => {
|
|
1106
|
+
var h = Rt(), l = e.child(h), a = e.child(l, !0);
|
|
1107
|
+
e.reset(l);
|
|
1108
|
+
var s = e.sibling(l, 2), D = e.child(s, !0);
|
|
1109
|
+
e.reset(s);
|
|
1110
|
+
var c = e.sibling(s, 2), k = e.child(c, !0);
|
|
1111
|
+
e.reset(c);
|
|
1112
|
+
var M = e.sibling(c, 2);
|
|
1113
|
+
e.each(M, 17, () => t.rows, e.index, (W, O, L) => {
|
|
1114
|
+
const U = e.derived(() => t.columns.map((C) => e.get(O)[C.key] ?? ""));
|
|
1115
|
+
var u = Ut();
|
|
1116
|
+
let G;
|
|
1117
|
+
var T = e.child(u, !0);
|
|
1118
|
+
e.reset(u), e.template_effect(
|
|
1119
|
+
(C) => {
|
|
1120
|
+
G = e.set_class(u, 1, "tui-row svelte-12m6nfw", null, G, { selected: L === d() }), e.set_attribute(u, "aria-selected", L === d()), e.set_text(T, C);
|
|
1121
|
+
},
|
|
1122
|
+
[() => S(e.get(U), e.get(r))]
|
|
1123
|
+
), e.delegated("click", u, () => {
|
|
1124
|
+
var C;
|
|
1125
|
+
return (C = t.onselect) == null ? void 0 : C.call(t, L);
|
|
1126
|
+
}), e.delegated("keydown", u, (C) => N(C, L)), e.append(W, u);
|
|
1127
|
+
});
|
|
1128
|
+
var B = e.sibling(M, 2), j = e.child(B, !0);
|
|
1129
|
+
e.reset(B), e.reset(h), e.template_effect(() => {
|
|
1130
|
+
e.set_class(h, 1, `tui-table ${n() ?? ""}`, "svelte-12m6nfw"), e.set_text(a, e.get(H)), e.set_text(D, e.get(I)), e.set_text(k, e.get(y)), e.set_text(j, e.get(P));
|
|
1131
|
+
}), e.append(v, h);
|
|
1132
|
+
}, A = (v) => {
|
|
1133
|
+
var h = Ot(), l = e.child(h), a = e.child(l), s = e.child(a);
|
|
1134
|
+
e.each(s, 21, () => t.columns, e.index, (c, k) => {
|
|
1135
|
+
var M = Ft();
|
|
1136
|
+
let B;
|
|
1137
|
+
var j = e.child(M, !0);
|
|
1138
|
+
e.reset(M), e.template_effect(() => {
|
|
1139
|
+
B = e.set_style(M, "", B, {
|
|
1140
|
+
width: e.get(k).width ? `${e.get(k).width * 8}px` : void 0
|
|
1141
|
+
}), e.set_text(j, e.get(k).label);
|
|
1142
|
+
}), e.append(c, M);
|
|
1143
|
+
}), e.reset(s), e.reset(a);
|
|
1144
|
+
var D = e.sibling(a);
|
|
1145
|
+
e.each(D, 21, () => t.rows, e.index, (c, k, M) => {
|
|
1146
|
+
var B = Kt();
|
|
1147
|
+
let j;
|
|
1148
|
+
e.each(B, 21, () => t.columns, e.index, (W, O) => {
|
|
1149
|
+
var L = Ht(), U = e.child(L, !0);
|
|
1150
|
+
e.reset(L), e.template_effect(() => e.set_text(U, e.get(k)[e.get(O).key] ?? "")), e.append(W, L);
|
|
1151
|
+
}), e.reset(B), e.template_effect(() => {
|
|
1152
|
+
e.set_attribute(B, "aria-selected", M === d()), j = e.set_class(B, 1, "svelte-12m6nfw", null, j, { selected: M === d() });
|
|
1153
|
+
}), e.delegated("click", B, () => {
|
|
1154
|
+
var W;
|
|
1155
|
+
return (W = t.onselect) == null ? void 0 : W.call(t, M);
|
|
1156
|
+
}), e.delegated("keydown", B, (W) => N(W, M)), e.append(c, B);
|
|
1157
|
+
}), e.reset(D), e.reset(l), e.reset(h), e.template_effect(() => e.set_class(h, 1, `table-wrap ${n() ?? ""}`, "svelte-12m6nfw")), e.append(v, h);
|
|
1158
|
+
};
|
|
1159
|
+
e.if(p, (v) => {
|
|
1160
|
+
e.get(f) ? v(m) : v(A, !1);
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
e.append(K, x), e.pop();
|
|
1164
|
+
}
|
|
1165
|
+
e.delegate(["click", "keydown"]);
|
|
1166
|
+
var jt = e.from_html('<li role="option"><span class="prefix svelte-1pivab1" aria-hidden="true"> </span> <span class="label svelte-1pivab1"><!></span></li>');
|
|
1167
|
+
function Vt(K, t) {
|
|
1168
|
+
e.push(t, !0);
|
|
1169
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "highlighted", 3, !1);
|
|
1170
|
+
const n = ie(), _ = e.derived(() => F() || n()), f = e.derived(() => e.get(_) ? d() ? "› " : " " : t.prefix ?? "•");
|
|
1171
|
+
var r = jt();
|
|
1172
|
+
let w;
|
|
1173
|
+
var g = e.child(r), S = e.child(g, !0);
|
|
1174
|
+
e.reset(g);
|
|
1175
|
+
var H = e.sibling(g, 2), I = e.child(H);
|
|
1176
|
+
e.snippet(I, () => t.children), e.reset(H), e.reset(r), e.template_effect(() => {
|
|
1177
|
+
w = e.set_class(r, 1, "list-item svelte-1pivab1", null, w, { tui: e.get(_), highlighted: d() }), e.set_attribute(r, "aria-selected", d()), e.set_attribute(r, "tabindex", t.onclick ? 0 : void 0), e.set_text(S, e.get(f));
|
|
1178
|
+
}), e.delegated("click", r, function(...y) {
|
|
1179
|
+
var P;
|
|
1180
|
+
(P = t.onclick) == null || P.apply(this, y);
|
|
1181
|
+
}), e.delegated("keydown", r, function(...y) {
|
|
1182
|
+
var P;
|
|
1183
|
+
(P = t.onclick ? (N) => {
|
|
1184
|
+
(N.key === "Enter" || N.key === " ") && (N.preventDefault(), N.currentTarget.click());
|
|
1185
|
+
} : void 0) == null || P.apply(this, y);
|
|
1186
|
+
}), e.append(K, r), e.pop();
|
|
1187
|
+
}
|
|
1188
|
+
e.delegate(["click", "keydown"]);
|
|
1189
|
+
var qt = e.from_html('<ul role="listbox"><!></ul>');
|
|
1190
|
+
function ts(K, t) {
|
|
1191
|
+
e.push(t, !0);
|
|
1192
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "selected", 19, () => -1), n = e.prop(t, "scrollable", 3, !1), _ = e.prop(t, "class", 3, "");
|
|
1193
|
+
const f = ie(), r = e.derived(() => F() || f());
|
|
1194
|
+
pe(() => e.get(r));
|
|
1195
|
+
var w = qt();
|
|
1196
|
+
let g;
|
|
1197
|
+
var S = e.child(w);
|
|
1198
|
+
{
|
|
1199
|
+
var H = (y) => {
|
|
1200
|
+
var P = e.comment(), N = e.first_child(P);
|
|
1201
|
+
e.each(N, 17, () => t.items, e.index, (x, p, m) => {
|
|
1202
|
+
{
|
|
1203
|
+
const A = (h) => {
|
|
1204
|
+
e.next();
|
|
1205
|
+
var l = e.text();
|
|
1206
|
+
e.template_effect(() => e.set_text(l, e.get(p).label)), e.append(h, l);
|
|
1207
|
+
};
|
|
1208
|
+
let v = e.derived(() => m === d());
|
|
1209
|
+
Vt(x, {
|
|
1210
|
+
get highlighted() {
|
|
1211
|
+
return e.get(v);
|
|
1212
|
+
},
|
|
1213
|
+
onclick: (h) => {
|
|
1214
|
+
var l;
|
|
1215
|
+
return (l = t.onselect) == null ? void 0 : l.call(t, m);
|
|
1216
|
+
},
|
|
1217
|
+
children: A,
|
|
1218
|
+
$$slots: { default: !0 }
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
}), e.append(y, P);
|
|
1222
|
+
}, I = (y) => {
|
|
1223
|
+
var P = e.comment(), N = e.first_child(P);
|
|
1224
|
+
e.snippet(N, () => t.children), e.append(y, P);
|
|
1225
|
+
};
|
|
1226
|
+
e.if(S, (y) => {
|
|
1227
|
+
t.items !== void 0 ? y(H) : t.children && y(I, 1);
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
e.reset(w), e.template_effect(() => g = e.set_class(w, 1, `list ${_() ?? ""}`, "svelte-6jskls", g, { tui: e.get(r), scrollable: n() })), e.append(K, w), e.pop();
|
|
1231
|
+
}
|
|
1232
|
+
var Gt = e.from_html('<span class="pane-tui__title svelte-1bpdwdy"> </span>'), Yt = e.from_html("<div><!> <div><!></div></div>"), Wt = e.from_html('<div class="pane-gui__title svelte-1bpdwdy"> </div>'), Jt = e.from_html("<div><!> <div><!></div></div>");
|
|
1233
|
+
function as(K, t) {
|
|
1234
|
+
e.push(t, !0);
|
|
1235
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "title", 3, ""), n = e.prop(t, "scrollable", 3, !1), _ = e.prop(t, "class", 3, "");
|
|
1236
|
+
const f = ie(), r = e.derived(() => F() || f());
|
|
1237
|
+
pe(() => e.get(r));
|
|
1238
|
+
const w = e.derived(() => t.border !== void 0 ? t.border : e.get(r)), g = e.derived(() => t.width !== void 0 ? typeof t.width == "number" ? `${t.width}px` : t.width : void 0), S = e.derived(() => t.height !== void 0 ? typeof t.height == "number" ? `${t.height}px` : t.height : void 0), H = e.derived(() => t.flex !== void 0 ? String(t.flex) : void 0);
|
|
1239
|
+
var I = e.comment(), y = e.first_child(I);
|
|
1240
|
+
{
|
|
1241
|
+
var P = (x) => {
|
|
1242
|
+
var p = Yt();
|
|
1243
|
+
let m, A;
|
|
1244
|
+
var v = e.child(p);
|
|
1245
|
+
{
|
|
1246
|
+
var h = (D) => {
|
|
1247
|
+
var c = Gt(), k = e.child(c, !0);
|
|
1248
|
+
e.reset(c), e.template_effect(() => e.set_text(k, d())), e.append(D, c);
|
|
1249
|
+
};
|
|
1250
|
+
e.if(v, (D) => {
|
|
1251
|
+
d() && e.get(w) && D(h);
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
var l = e.sibling(v, 2);
|
|
1255
|
+
let a;
|
|
1256
|
+
var s = e.child(l);
|
|
1257
|
+
e.snippet(s, () => t.children), e.reset(l), e.reset(p), e.template_effect(() => {
|
|
1258
|
+
m = e.set_class(p, 1, `pane-tui ${_() ?? ""}`, "svelte-1bpdwdy", m, { "pane-tui--border": e.get(w) }), A = e.set_style(p, "", A, {
|
|
1259
|
+
"flex-grow": e.get(H),
|
|
1260
|
+
width: e.get(g),
|
|
1261
|
+
height: e.get(S)
|
|
1262
|
+
}), a = e.set_class(l, 1, "pane-tui__content svelte-1bpdwdy", null, a, { "pane-tui__content--scroll": n() });
|
|
1263
|
+
}), e.append(x, p);
|
|
1264
|
+
}, N = (x) => {
|
|
1265
|
+
var p = Jt();
|
|
1266
|
+
let m, A;
|
|
1267
|
+
var v = e.child(p);
|
|
1268
|
+
{
|
|
1269
|
+
var h = (D) => {
|
|
1270
|
+
var c = Wt(), k = e.child(c, !0);
|
|
1271
|
+
e.reset(c), e.template_effect(() => e.set_text(k, d())), e.append(D, c);
|
|
1272
|
+
};
|
|
1273
|
+
e.if(v, (D) => {
|
|
1274
|
+
d() && D(h);
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
var l = e.sibling(v, 2);
|
|
1278
|
+
let a;
|
|
1279
|
+
var s = e.child(l);
|
|
1280
|
+
e.snippet(s, () => t.children), e.reset(l), e.reset(p), e.template_effect(() => {
|
|
1281
|
+
m = e.set_class(p, 1, `pane-gui ${_() ?? ""}`, "svelte-1bpdwdy", m, { "pane-gui--border": e.get(w) }), A = e.set_style(p, "", A, {
|
|
1282
|
+
"flex-grow": e.get(H),
|
|
1283
|
+
width: e.get(g),
|
|
1284
|
+
height: e.get(S)
|
|
1285
|
+
}), a = e.set_class(l, 1, "pane-gui__content svelte-1bpdwdy", null, a, { "pane-gui__content--scroll": n() });
|
|
1286
|
+
}), e.append(x, p);
|
|
1287
|
+
};
|
|
1288
|
+
e.if(y, (x) => {
|
|
1289
|
+
e.get(r) ? x(P) : x(N, !1);
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
e.append(K, I), e.pop();
|
|
1293
|
+
}
|
|
1294
|
+
var Qt = e.from_html('<div><div class="chat-tui__msg-border svelte-10e5u2c" aria-hidden="true"> </div> <div class="chat-tui__msg-body svelte-10e5u2c"><span class="chat-tui__msg-side svelte-10e5u2c" aria-hidden="true">│</span> <div class="chat-tui__msg-content svelte-10e5u2c"> </div> <span class="chat-tui__msg-side svelte-10e5u2c" aria-hidden="true">│</span></div> <div class="chat-tui__msg-border svelte-10e5u2c" aria-hidden="true"> </div></div>'), Xt = e.from_html('<div class="chat-tui__indicator svelte-10e5u2c" role="status" aria-live="polite"><span tabindex="0" role="button" class="svelte-10e5u2c"> </span></div>'), Zt = e.from_html('<div tabindex="0" role="log" aria-live="polite" aria-label="Chat messages"><div class="chat-tui__border svelte-10e5u2c" aria-hidden="true"></div> <div class="chat-tui__body svelte-10e5u2c"><span class="chat-tui__side svelte-10e5u2c" aria-hidden="true">│</span> <div class="chat-tui__content svelte-10e5u2c"><!> <!></div> <span class="chat-tui__side svelte-10e5u2c" aria-hidden="true">│</span></div> <div class="chat-tui__border svelte-10e5u2c" aria-hidden="true"></div></div>'), $t = e.from_html('<span class="chat-gui__msg-time svelte-10e5u2c"> </span>'), ea = e.from_html('<div><div class="chat-gui__msg-header svelte-10e5u2c"><span class="chat-gui__msg-author svelte-10e5u2c"> </span> <!></div> <div class="chat-gui__msg-body svelte-10e5u2c"> </div></div>'), ta = e.from_html('<button class="chat-gui__indicator svelte-10e5u2c" aria-live="polite" aria-label="Jump to latest messages"> </button>'), aa = e.from_html('<div role="log" aria-live="polite" aria-label="Chat messages"><div class="chat-gui__scroll svelte-10e5u2c" tabindex="0" role="region" aria-label="Scrollable message history"><div class="chat-gui__messages svelte-10e5u2c"><!> <div class="chat-gui__sentinel svelte-10e5u2c" aria-hidden="true"></div></div></div> <!></div>');
|
|
1295
|
+
function ss(K, t) {
|
|
1296
|
+
e.push(t, !0);
|
|
1297
|
+
let F = e.prop(t, "tui", 3, !1), d = e.prop(t, "showTimestamps", 3, !0), n = e.prop(t, "class", 3, "");
|
|
1298
|
+
const _ = ie(), f = e.derived(() => F() || _());
|
|
1299
|
+
pe(() => e.get(f));
|
|
1300
|
+
let r = e.state(void 0), w = e.state(void 0), g = e.state(!0), S = e.state(0), H = e.state(0), I = e.state(0);
|
|
229
1301
|
e.user_effect(() => {
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
232
|
-
const
|
|
233
|
-
e.set(
|
|
1302
|
+
const T = t.messages.length;
|
|
1303
|
+
if (T !== e.get(I)) {
|
|
1304
|
+
const C = T - e.get(I);
|
|
1305
|
+
e.set(I, T, !0), e.get(g) ? (e.set(S, 0), e.set(H, T, !0), y()) : C > 0 && e.set(S, e.get(S) + C);
|
|
234
1306
|
}
|
|
235
1307
|
});
|
|
236
|
-
function
|
|
237
|
-
typeof requestAnimationFrame < "u" && requestAnimationFrame(() =>
|
|
1308
|
+
function y() {
|
|
1309
|
+
typeof requestAnimationFrame < "u" && requestAnimationFrame(() => P());
|
|
238
1310
|
}
|
|
239
|
-
function
|
|
240
|
-
e.get(
|
|
1311
|
+
function P() {
|
|
1312
|
+
e.get(r) && (e.get(r).scrollTop = e.get(r).scrollHeight);
|
|
241
1313
|
}
|
|
242
|
-
function
|
|
243
|
-
var
|
|
244
|
-
e.set(
|
|
1314
|
+
function N() {
|
|
1315
|
+
var T;
|
|
1316
|
+
e.set(g, !0), e.set(S, 0), e.set(H, t.messages.length, !0), P(), (T = t.onscrolltolatest) == null || T.call(t);
|
|
245
1317
|
}
|
|
246
|
-
function
|
|
247
|
-
if (!e.get(
|
|
248
|
-
const { scrollTop:
|
|
1318
|
+
function x() {
|
|
1319
|
+
if (!e.get(r)) return;
|
|
1320
|
+
const { scrollTop: T, scrollHeight: C, clientHeight: R } = e.get(r), o = C - T - R, i = e.get(g);
|
|
249
1321
|
e.set(
|
|
250
|
-
|
|
251
|
-
|
|
1322
|
+
g,
|
|
1323
|
+
o < 8
|
|
252
1324
|
// 8px tolerance
|
|
253
|
-
), e.get(
|
|
1325
|
+
), e.get(g) && !i && (e.set(S, 0), e.set(H, t.messages.length, !0));
|
|
254
1326
|
}
|
|
255
|
-
function T
|
|
256
|
-
if (!e.get(
|
|
257
|
-
const { clientHeight:
|
|
258
|
-
switch (
|
|
1327
|
+
function p(T) {
|
|
1328
|
+
if (!e.get(r)) return;
|
|
1329
|
+
const { clientHeight: C } = e.get(r);
|
|
1330
|
+
switch (T.key) {
|
|
259
1331
|
case "PageUp":
|
|
260
|
-
|
|
1332
|
+
T.preventDefault(), e.get(r).scrollBy({ top: -C, behavior: "smooth" });
|
|
261
1333
|
break;
|
|
262
1334
|
case "PageDown":
|
|
263
|
-
|
|
1335
|
+
T.preventDefault(), e.get(r).scrollBy({ top: C, behavior: "smooth" });
|
|
264
1336
|
break;
|
|
265
1337
|
case "Home":
|
|
266
|
-
|
|
1338
|
+
T.preventDefault(), e.get(r).scrollTo({ top: 0, behavior: "smooth" });
|
|
267
1339
|
break;
|
|
268
1340
|
case "End":
|
|
269
|
-
|
|
1341
|
+
T.preventDefault(), P();
|
|
270
1342
|
break;
|
|
271
1343
|
}
|
|
272
1344
|
}
|
|
273
|
-
let
|
|
274
|
-
const
|
|
1345
|
+
let m = e.state(0);
|
|
1346
|
+
const A = 10, v = e.derived(() => e.get(m) >= Math.max(0, t.messages.length - A)), h = e.derived(() => e.get(v) ? 0 : Math.max(0, t.messages.length - (e.get(m) + A))), l = e.derived(() => t.messages.slice(e.get(m), e.get(m) + A));
|
|
275
1347
|
e.user_effect(() => {
|
|
276
|
-
e.get(
|
|
1348
|
+
e.get(f) && e.get(v) && e.set(m, Math.max(0, t.messages.length - A), !0);
|
|
277
1349
|
});
|
|
278
|
-
function
|
|
279
|
-
e.set(
|
|
1350
|
+
function a() {
|
|
1351
|
+
e.set(m, Math.max(0, e.get(m) - 1), !0);
|
|
280
1352
|
}
|
|
281
|
-
function
|
|
282
|
-
e.set(
|
|
1353
|
+
function s() {
|
|
1354
|
+
e.set(m, Math.min(Math.max(0, t.messages.length - A), e.get(m) + 1), !0);
|
|
283
1355
|
}
|
|
284
|
-
function
|
|
285
|
-
e.set(
|
|
1356
|
+
function D() {
|
|
1357
|
+
e.set(m, Math.max(0, e.get(m) - A), !0);
|
|
286
1358
|
}
|
|
287
|
-
function
|
|
288
|
-
e.set(
|
|
1359
|
+
function c() {
|
|
1360
|
+
e.set(m, Math.min(Math.max(0, t.messages.length - A), e.get(m) + A), !0);
|
|
289
1361
|
}
|
|
290
|
-
function
|
|
291
|
-
e.set(
|
|
1362
|
+
function k() {
|
|
1363
|
+
e.set(m, 0);
|
|
292
1364
|
}
|
|
293
|
-
function
|
|
294
|
-
e.set(
|
|
1365
|
+
function M() {
|
|
1366
|
+
e.set(m, Math.max(0, t.messages.length - A), !0);
|
|
295
1367
|
}
|
|
296
|
-
function
|
|
297
|
-
var
|
|
298
|
-
|
|
1368
|
+
function B() {
|
|
1369
|
+
var T;
|
|
1370
|
+
M(), (T = t.onscrolltolatest) == null || T.call(t);
|
|
299
1371
|
}
|
|
300
|
-
function
|
|
301
|
-
switch (
|
|
1372
|
+
function j(T) {
|
|
1373
|
+
switch (T.key) {
|
|
302
1374
|
case "ArrowUp":
|
|
303
|
-
|
|
1375
|
+
T.preventDefault(), a();
|
|
304
1376
|
break;
|
|
305
1377
|
case "ArrowDown":
|
|
306
|
-
|
|
1378
|
+
T.preventDefault(), s();
|
|
307
1379
|
break;
|
|
308
1380
|
case "PageUp":
|
|
309
|
-
|
|
1381
|
+
T.preventDefault(), D();
|
|
310
1382
|
break;
|
|
311
1383
|
case "PageDown":
|
|
312
|
-
|
|
1384
|
+
T.preventDefault(), c();
|
|
313
1385
|
break;
|
|
314
1386
|
case "Home":
|
|
315
|
-
|
|
1387
|
+
T.preventDefault(), k();
|
|
316
1388
|
break;
|
|
317
1389
|
case "End":
|
|
318
|
-
|
|
1390
|
+
T.preventDefault(), M();
|
|
319
1391
|
break;
|
|
320
1392
|
}
|
|
321
1393
|
}
|
|
322
|
-
function
|
|
323
|
-
return
|
|
1394
|
+
function W(T) {
|
|
1395
|
+
return T.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
324
1396
|
}
|
|
325
|
-
function
|
|
326
|
-
return
|
|
1397
|
+
function O(T) {
|
|
1398
|
+
return d() ? `${T.author} · ${W(T.timestamp)}` : T.author;
|
|
327
1399
|
}
|
|
328
|
-
var
|
|
1400
|
+
var L = e.comment(), U = e.first_child(L);
|
|
329
1401
|
{
|
|
330
|
-
var
|
|
331
|
-
var
|
|
332
|
-
|
|
333
|
-
var
|
|
334
|
-
e.each(
|
|
335
|
-
const
|
|
336
|
-
var
|
|
337
|
-
let
|
|
338
|
-
var
|
|
339
|
-
e.reset(
|
|
340
|
-
var
|
|
341
|
-
e.reset(
|
|
342
|
-
var
|
|
343
|
-
e.reset(
|
|
344
|
-
|
|
345
|
-
"chat-tui__msg--user": e.get(
|
|
346
|
-
"chat-tui__msg--system": e.get(
|
|
347
|
-
}), e.set_text(
|
|
348
|
-
}), e.append(
|
|
1402
|
+
var u = (T) => {
|
|
1403
|
+
var C = Zt(), R = e.child(C);
|
|
1404
|
+
R.textContent = `┌─ Chat ${"─".repeat(38) ?? ""}┐`;
|
|
1405
|
+
var o = e.sibling(R, 2), i = e.sibling(e.child(o), 2), b = e.child(i);
|
|
1406
|
+
e.each(b, 17, () => e.get(l), (V) => V.id, (V, Y) => {
|
|
1407
|
+
const J = e.derived(() => O(e.get(Y))), Z = e.derived(() => 38), $ = e.derived(() => `╭─ ${e.get(J)} ${"─".repeat(Math.max(0, e.get(Z) - e.get(J).length - 3))}╮`), ne = e.derived(() => `╰${"─".repeat(e.get(Z) + 1)}╯`);
|
|
1408
|
+
var re = Qt();
|
|
1409
|
+
let ae;
|
|
1410
|
+
var oe = e.child(re), ue = e.child(oe, !0);
|
|
1411
|
+
e.reset(oe);
|
|
1412
|
+
var de = e.sibling(oe, 2), ce = e.sibling(e.child(de), 2), se = e.child(ce, !0);
|
|
1413
|
+
e.reset(ce), e.next(2), e.reset(de);
|
|
1414
|
+
var te = e.sibling(de, 2), _e = e.child(te, !0);
|
|
1415
|
+
e.reset(te), e.reset(re), e.template_effect(() => {
|
|
1416
|
+
ae = e.set_class(re, 1, "chat-tui__msg svelte-10e5u2c", null, ae, {
|
|
1417
|
+
"chat-tui__msg--user": e.get(Y).type === "user",
|
|
1418
|
+
"chat-tui__msg--system": e.get(Y).type === "system"
|
|
1419
|
+
}), e.set_text(ue, e.get($)), e.set_text(se, e.get(Y).content), e.set_text(_e, e.get(ne));
|
|
1420
|
+
}), e.append(V, re);
|
|
349
1421
|
});
|
|
350
|
-
var
|
|
1422
|
+
var z = e.sibling(b, 2);
|
|
351
1423
|
{
|
|
352
|
-
var
|
|
353
|
-
var
|
|
354
|
-
e.reset(
|
|
1424
|
+
var E = (V) => {
|
|
1425
|
+
var Y = Xt(), J = e.child(Y), Z = e.child(J);
|
|
1426
|
+
e.reset(J), e.reset(Y), e.template_effect(() => e.set_text(Z, `▼ ${e.get(h) ?? ""} new ${e.get(h) === 1 ? "message" : "messages"}`)), e.delegated("click", J, B), e.delegated("keydown", J, ($) => ($.key === "Enter" || $.key === " ") && B()), e.append(V, Y);
|
|
355
1427
|
};
|
|
356
|
-
e.if(
|
|
357
|
-
e.get(
|
|
1428
|
+
e.if(z, (V) => {
|
|
1429
|
+
e.get(h) > 0 && V(E);
|
|
358
1430
|
});
|
|
359
1431
|
}
|
|
360
|
-
e.reset(
|
|
361
|
-
var
|
|
362
|
-
|
|
363
|
-
},
|
|
364
|
-
var
|
|
365
|
-
e.each(
|
|
366
|
-
var
|
|
367
|
-
let
|
|
368
|
-
var
|
|
369
|
-
e.reset(
|
|
370
|
-
var
|
|
1432
|
+
e.reset(i), e.next(2), e.reset(o);
|
|
1433
|
+
var q = e.sibling(o, 2);
|
|
1434
|
+
q.textContent = `└${"─".repeat(40) ?? ""}┘`, e.reset(C), e.template_effect(() => e.set_class(C, 1, `chat-tui ${n() ?? ""}`, "svelte-10e5u2c")), e.delegated("keydown", C, j), e.append(T, C);
|
|
1435
|
+
}, G = (T) => {
|
|
1436
|
+
var C = aa(), R = e.child(C), o = e.child(R), i = e.child(o);
|
|
1437
|
+
e.each(i, 17, () => t.messages, (q) => q.id, (q, V) => {
|
|
1438
|
+
var Y = ea();
|
|
1439
|
+
let J;
|
|
1440
|
+
var Z = e.child(Y), $ = e.child(Z), ne = e.child($, !0);
|
|
1441
|
+
e.reset($);
|
|
1442
|
+
var re = e.sibling($, 2);
|
|
371
1443
|
{
|
|
372
|
-
var
|
|
373
|
-
var
|
|
374
|
-
e.reset(
|
|
1444
|
+
var ae = (de) => {
|
|
1445
|
+
var ce = $t(), se = e.child(ce, !0);
|
|
1446
|
+
e.reset(ce), e.template_effect((te) => e.set_text(se, te), [() => W(e.get(V).timestamp)]), e.append(de, ce);
|
|
375
1447
|
};
|
|
376
|
-
e.if(
|
|
377
|
-
|
|
1448
|
+
e.if(re, (de) => {
|
|
1449
|
+
d() && de(ae);
|
|
378
1450
|
});
|
|
379
1451
|
}
|
|
380
|
-
e.reset(
|
|
381
|
-
var
|
|
382
|
-
e.reset(
|
|
383
|
-
|
|
384
|
-
"chat-gui__msg--user": e.get(
|
|
385
|
-
"chat-gui__msg--agent": e.get(
|
|
386
|
-
"chat-gui__msg--system": e.get(
|
|
387
|
-
}), e.set_text(
|
|
388
|
-
}), e.append(
|
|
1452
|
+
e.reset(Z);
|
|
1453
|
+
var oe = e.sibling(Z, 2), ue = e.child(oe, !0);
|
|
1454
|
+
e.reset(oe), e.reset(Y), e.template_effect(() => {
|
|
1455
|
+
J = e.set_class(Y, 1, "chat-gui__msg svelte-10e5u2c", null, J, {
|
|
1456
|
+
"chat-gui__msg--user": e.get(V).type === "user",
|
|
1457
|
+
"chat-gui__msg--agent": e.get(V).type === "agent",
|
|
1458
|
+
"chat-gui__msg--system": e.get(V).type === "system"
|
|
1459
|
+
}), e.set_text(ne, e.get(V).author), e.set_text(ue, e.get(V).content);
|
|
1460
|
+
}), e.append(q, Y);
|
|
389
1461
|
});
|
|
390
|
-
var
|
|
391
|
-
e.bind_this(
|
|
392
|
-
var
|
|
1462
|
+
var b = e.sibling(i, 2);
|
|
1463
|
+
e.bind_this(b, (q) => e.set(w, q), () => e.get(w)), e.reset(o), e.reset(R), e.bind_this(R, (q) => e.set(r, q), () => e.get(r));
|
|
1464
|
+
var z = e.sibling(R, 2);
|
|
393
1465
|
{
|
|
394
|
-
var
|
|
395
|
-
var
|
|
396
|
-
e.reset(
|
|
1466
|
+
var E = (q) => {
|
|
1467
|
+
var V = ta(), Y = e.child(V);
|
|
1468
|
+
e.reset(V), e.template_effect(() => e.set_text(Y, `▼ ${e.get(S) ?? ""} new ${e.get(S) === 1 ? "message" : "messages"}`)), e.delegated("click", V, N), e.append(q, V);
|
|
397
1469
|
};
|
|
398
|
-
e.if(
|
|
399
|
-
e.get(
|
|
1470
|
+
e.if(z, (q) => {
|
|
1471
|
+
e.get(S) > 0 && !e.get(g) && q(E);
|
|
400
1472
|
});
|
|
401
1473
|
}
|
|
402
|
-
e.reset(
|
|
1474
|
+
e.reset(C), e.template_effect(() => e.set_class(C, 1, `chat-gui ${n() ?? ""}`, "svelte-10e5u2c")), e.event("scroll", R, x), e.delegated("keydown", R, p), e.append(T, C);
|
|
403
1475
|
};
|
|
404
|
-
e.if(
|
|
405
|
-
e.get(
|
|
1476
|
+
e.if(U, (T) => {
|
|
1477
|
+
e.get(f) ? T(u) : T(G, !1);
|
|
406
1478
|
});
|
|
407
1479
|
}
|
|
408
|
-
e.append(
|
|
1480
|
+
e.append(K, L), e.pop();
|
|
409
1481
|
}
|
|
410
1482
|
e.delegate(["keydown", "click"]);
|
|
411
|
-
var
|
|
412
|
-
function
|
|
1483
|
+
var sa = e.from_html('<span aria-hidden="true"></span>');
|
|
1484
|
+
function ls(K, t) {
|
|
1485
|
+
let F = e.prop(t, "size", 3, 16), d = e.prop(t, "color", 3, "currentColor"), n = e.prop(t, "class", 3, "");
|
|
1486
|
+
var _ = sa();
|
|
1487
|
+
let f;
|
|
1488
|
+
e.template_effect(() => {
|
|
1489
|
+
e.set_class(_, 1, `nf ${t.icon ?? ""} ${n() ?? ""}`, "svelte-81k4o2"), f = e.set_style(_, "", f, {
|
|
1490
|
+
"font-size": `${F() ?? ""}px`,
|
|
1491
|
+
color: d(),
|
|
1492
|
+
"line-height": `${F() ?? ""}px`
|
|
1493
|
+
});
|
|
1494
|
+
}), e.append(K, _);
|
|
1495
|
+
}
|
|
1496
|
+
var la = e.from_html('<div class="chat-view__system svelte-hdrk38"> </div>'), ia = e.from_html('<span class="chat-view__time svelte-hdrk38"> </span>'), na = e.from_html('<div class="chat-view__streaming svelte-hdrk38" aria-label="Generating response"><span class="chat-view__dot svelte-hdrk38"></span> <span class="chat-view__dot svelte-hdrk38"></span> <span class="chat-view__dot svelte-hdrk38"></span></div>'), ra = e.from_html('<div class="chat-view__content svelte-hdrk38"><!></div>'), da = e.from_html('<div><div class="chat-view__bubble-header svelte-hdrk38"><span class="chat-view__author svelte-hdrk38"> </span> <!></div> <!></div>'), ca = e.from_html("<div><!></div>"), oa = e.from_html('<button class="chat-view__jump svelte-hdrk38" aria-live="polite" aria-label="Jump to latest messages"> </button>'), va = e.from_html('<div role="log" aria-live="polite" aria-label="Chat messages"><div class="chat-view__scroll svelte-hdrk38" tabindex="0" role="region" aria-label="Scrollable message history"><div class="chat-view__messages svelte-hdrk38"><!> <div class="chat-view__sentinel svelte-hdrk38" aria-hidden="true"></div></div></div> <!></div>');
|
|
1497
|
+
function is(K, t) {
|
|
413
1498
|
e.push(t, !0);
|
|
414
|
-
let
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
421
|
-
const s = new Uint32Array(1);
|
|
422
|
-
return crypto.getRandomValues(s), `search-listbox-${s[0].toString(36)}`;
|
|
1499
|
+
let F = e.prop(t, "showTimestamps", 3, !0), d = e.prop(t, "class", 3, ""), n = e.state(void 0), _ = e.state(!0), f = e.state(0), r = e.state(0);
|
|
1500
|
+
e.user_effect(() => {
|
|
1501
|
+
const l = t.messages.length;
|
|
1502
|
+
if (l !== e.get(r)) {
|
|
1503
|
+
const a = l - e.get(r);
|
|
1504
|
+
e.set(r, l, !0), e.get(_) ? (e.set(f, 0), w()) : a > 0 && e.set(f, e.get(f) + a);
|
|
423
1505
|
}
|
|
424
|
-
return `search-listbox-${Date.now().toString(36)}`;
|
|
425
|
-
}
|
|
426
|
-
const E = a();
|
|
427
|
-
let q;
|
|
428
|
-
const P = e.derived(() => Math.max(6, r())), F = e.derived(() => e.get(P) - 2), ee = e.derived(() => (() => {
|
|
429
|
-
const s = "Search", d = Math.max(0, e.get(F) - 4), _ = `─ ${s.length > d ? s.substring(0, d) : s} `, n = Math.max(0, e.get(F) - _.length);
|
|
430
|
-
return `┌${_}${"─".repeat(n)}┐`;
|
|
431
|
-
})()), ie = e.derived(() => `├${"─".repeat(e.get(F))}┤`), re = e.derived(() => `└${"─".repeat(e.get(F))}┘`), O = e.derived(() => {
|
|
432
|
-
const s = p() ?? "", d = s.length, x = Math.min(Math.max(0, e.get(C)), d);
|
|
433
|
-
if (!e.get(h))
|
|
434
|
-
return s ? {
|
|
435
|
-
kind: "text",
|
|
436
|
-
text: s.substring(0, e.get(F)).padEnd(e.get(F), " ")
|
|
437
|
-
} : {
|
|
438
|
-
kind: "placeholder",
|
|
439
|
-
text: (u() || "").substring(0, e.get(F)).padEnd(e.get(F), " ")
|
|
440
|
-
};
|
|
441
|
-
const _ = e.get(F) - 1;
|
|
442
|
-
let n;
|
|
443
|
-
d <= _ ? n = 0 : (n = Math.min(x, d - _), n = Math.max(0, n), x < n && (n = x));
|
|
444
|
-
const M = s.substring(n, x), g = s.substring(x, n + _), b = " ".repeat(Math.max(0, _ - M.length - g.length));
|
|
445
|
-
return { kind: "cursor", before: M, after: g, pad: b };
|
|
446
1506
|
});
|
|
447
|
-
function
|
|
448
|
-
|
|
449
|
-
if (v()) {
|
|
450
|
-
const _ = `★ ${s.score.toFixed(2)}`, n = " ", M = Math.max(0, e.get(F) - x.length - n.length - _.length), g = s.text.length > M ? s.text.substring(0, M - 1) + "…" : s.text.padEnd(M, " ");
|
|
451
|
-
return { prefix: x, text: g, gap: n, score: _ };
|
|
452
|
-
} else {
|
|
453
|
-
const _ = Math.max(0, e.get(F) - x.length), n = s.text.length > _ ? s.text.substring(0, _ - 1) + "…" : s.text.padEnd(_, " ");
|
|
454
|
-
return { prefix: x, text: n, gap: "", score: "" };
|
|
455
|
-
}
|
|
1507
|
+
function w() {
|
|
1508
|
+
typeof requestAnimationFrame < "u" && requestAnimationFrame(() => g());
|
|
456
1509
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
1510
|
+
function g() {
|
|
1511
|
+
e.get(n) && (e.get(n).scrollTop = e.get(n).scrollHeight);
|
|
1512
|
+
}
|
|
1513
|
+
function S() {
|
|
1514
|
+
var l;
|
|
1515
|
+
e.set(_, !0), e.set(f, 0), g(), (l = t.onscrolltolatest) == null || l.call(t);
|
|
1516
|
+
}
|
|
1517
|
+
function H() {
|
|
1518
|
+
if (!e.get(n)) return;
|
|
1519
|
+
const { scrollTop: l, scrollHeight: a, clientHeight: s } = e.get(n), D = e.get(_);
|
|
1520
|
+
e.set(_, a - l - s < 8), e.get(_) && !D && e.set(f, 0);
|
|
1521
|
+
}
|
|
1522
|
+
function I(l) {
|
|
1523
|
+
if (!e.get(n)) return;
|
|
1524
|
+
const a = e.get(n).clientHeight;
|
|
1525
|
+
switch (l.key) {
|
|
1526
|
+
case "PageUp":
|
|
1527
|
+
l.preventDefault(), e.get(n).scrollBy({ top: -a, behavior: "smooth" });
|
|
1528
|
+
break;
|
|
1529
|
+
case "PageDown":
|
|
1530
|
+
l.preventDefault(), e.get(n).scrollBy({ top: a, behavior: "smooth" });
|
|
1531
|
+
break;
|
|
1532
|
+
case "Home":
|
|
1533
|
+
l.preventDefault(), e.get(n).scrollTo({ top: 0, behavior: "smooth" });
|
|
1534
|
+
break;
|
|
1535
|
+
case "End":
|
|
1536
|
+
l.preventDefault(), g();
|
|
1537
|
+
break;
|
|
461
1538
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
1539
|
+
}
|
|
1540
|
+
function y(l) {
|
|
1541
|
+
return l.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1542
|
+
}
|
|
1543
|
+
function P(l) {
|
|
1544
|
+
return l.split(/(```[\s\S]*?```)/g).map((s, D) => {
|
|
1545
|
+
if (D % 2 === 1)
|
|
1546
|
+
return `<pre class="md-pre"><code>${y(s.slice(3, -3).replace(/^\n/, "").replace(/\n$/, ""))}</code></pre>`;
|
|
1547
|
+
let c = y(s);
|
|
1548
|
+
return c = c.replace(/`([^`]+)`/g, '<code class="md-code">$1</code>'), c = c.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), c = c.replace(/\*([^*\n]+)\*/g, "<em>$1</em>"), c = c.replace(/\n/g, "<br>"), c;
|
|
1549
|
+
}).join("");
|
|
1550
|
+
}
|
|
1551
|
+
function N(l) {
|
|
1552
|
+
return l.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
1553
|
+
}
|
|
1554
|
+
var x = va(), p = e.child(x), m = e.child(p), A = e.child(m);
|
|
1555
|
+
e.each(A, 17, () => t.messages, (l) => l.id, (l, a) => {
|
|
1556
|
+
var s = ca();
|
|
1557
|
+
let D;
|
|
1558
|
+
var c = e.child(s);
|
|
1559
|
+
{
|
|
1560
|
+
var k = (B) => {
|
|
1561
|
+
var j = la(), W = e.child(j, !0);
|
|
1562
|
+
e.reset(j), e.template_effect(() => e.set_text(W, e.get(a).content)), e.append(B, j);
|
|
1563
|
+
}, M = (B) => {
|
|
1564
|
+
var j = da();
|
|
1565
|
+
let W;
|
|
1566
|
+
var O = e.child(j), L = e.child(O), U = e.child(L, !0);
|
|
1567
|
+
e.reset(L);
|
|
1568
|
+
var u = e.sibling(L, 2);
|
|
1569
|
+
{
|
|
1570
|
+
var G = (o) => {
|
|
1571
|
+
var i = ia(), b = e.child(i, !0);
|
|
1572
|
+
e.reset(i), e.template_effect((z) => e.set_text(b, z), [() => N(e.get(a).timestamp)]), e.append(o, i);
|
|
1573
|
+
};
|
|
1574
|
+
e.if(u, (o) => {
|
|
1575
|
+
F() && o(G);
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
e.reset(O);
|
|
1579
|
+
var T = e.sibling(O, 2);
|
|
1580
|
+
{
|
|
1581
|
+
var C = (o) => {
|
|
1582
|
+
var i = na();
|
|
1583
|
+
e.append(o, i);
|
|
1584
|
+
}, R = (o) => {
|
|
1585
|
+
var i = ra(), b = e.child(i);
|
|
1586
|
+
e.html(b, () => P(e.get(a).content)), e.reset(i), e.append(o, i);
|
|
1587
|
+
};
|
|
1588
|
+
e.if(T, (o) => {
|
|
1589
|
+
e.get(a).streaming ? o(C) : o(R, !1);
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1592
|
+
e.reset(j), e.template_effect(() => {
|
|
1593
|
+
W = e.set_class(j, 1, "chat-view__bubble svelte-hdrk38", null, W, {
|
|
1594
|
+
"chat-view__bubble--user": e.get(a).type === "user",
|
|
1595
|
+
"chat-view__bubble--agent": e.get(a).type === "agent" || !e.get(a).type
|
|
1596
|
+
}), e.set_text(U, e.get(a).author);
|
|
1597
|
+
}), e.append(B, j);
|
|
1598
|
+
};
|
|
1599
|
+
e.if(c, (B) => {
|
|
1600
|
+
e.get(a).type === "system" ? B(k) : B(M, !1);
|
|
1601
|
+
});
|
|
467
1602
|
}
|
|
1603
|
+
e.reset(s), e.template_effect(() => D = e.set_class(s, 1, "chat-view__row svelte-hdrk38", null, D, {
|
|
1604
|
+
"chat-view__row--user": e.get(a).type === "user",
|
|
1605
|
+
"chat-view__row--agent": e.get(a).type === "agent" || !e.get(a).type,
|
|
1606
|
+
"chat-view__row--system": e.get(a).type === "system"
|
|
1607
|
+
})), e.append(l, s);
|
|
1608
|
+
}), e.next(2), e.reset(m), e.reset(p), e.bind_this(p, (l) => e.set(n, l), () => e.get(n));
|
|
1609
|
+
var v = e.sibling(p, 2);
|
|
1610
|
+
{
|
|
1611
|
+
var h = (l) => {
|
|
1612
|
+
var a = oa(), s = e.child(a);
|
|
1613
|
+
e.reset(a), e.template_effect(() => e.set_text(s, `▼ ${e.get(f) ?? ""} new ${e.get(f) === 1 ? "message" : "messages"}`)), e.delegated("click", a, S), e.append(l, a);
|
|
1614
|
+
};
|
|
1615
|
+
e.if(v, (l) => {
|
|
1616
|
+
e.get(f) > 0 && !e.get(_) && l(h);
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1619
|
+
e.reset(x), e.template_effect(() => e.set_class(x, 1, `chat-view ${d() ?? ""}`, "svelte-hdrk38")), e.event("scroll", p, H), e.delegated("keydown", p, I), e.append(K, x), e.pop();
|
|
1620
|
+
}
|
|
1621
|
+
e.delegate(["keydown", "click"]);
|
|
1622
|
+
var ua = e.from_html('<div class="chat-input__attachment svelte-bicrdd"><span class="chat-input__attachment-name svelte-bicrdd"> </span> <button class="chat-input__attachment-remove svelte-bicrdd" aria-label="Remove attachment" type="button">✕</button></div>'), _a = e.from_html('<div><!> <div class="chat-input__row svelte-bicrdd"><button class="chat-input__attach-btn svelte-bicrdd" type="button" aria-label="Attach file" title="Attach file">📎</button> <textarea class="chat-input__textarea svelte-bicrdd" rows="1" aria-label="Message input" aria-multiline="true"></textarea> <button class="chat-input__send-btn svelte-bicrdd" type="button" aria-label="Send message"><svg class="chat-input__send-icon svelte-bicrdd" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M3 10L17 3L10 17L9 11L3 10Z" fill="currentColor" stroke="currentColor" stroke-width="0.5" stroke-linejoin="round"></path></svg></button></div> <input class="chat-input__file-hidden svelte-bicrdd" type="file" aria-hidden="true" tabindex="-1"/></div>');
|
|
1623
|
+
function ns(K, t) {
|
|
1624
|
+
e.push(t, !0);
|
|
1625
|
+
let F = e.prop(t, "value", 15, ""), d = e.prop(t, "placeholder", 3, "Type a message…"), n = e.prop(t, "disabled", 3, !1), _ = e.prop(t, "maxRows", 3, 5), f = e.prop(t, "class", 3, ""), r = e.state(void 0), w = e.state(void 0), g = e.state(void 0);
|
|
1626
|
+
function S() {
|
|
1627
|
+
const c = e.get(r);
|
|
1628
|
+
if (!c) return;
|
|
1629
|
+
c.style.height = "auto";
|
|
1630
|
+
const M = parseInt(getComputedStyle(c).lineHeight || "20", 10) * _() + parseInt(getComputedStyle(c).paddingTop || "0", 10) * 2;
|
|
1631
|
+
c.style.height = Math.min(c.scrollHeight, M) + "px";
|
|
468
1632
|
}
|
|
469
|
-
function
|
|
470
|
-
|
|
1633
|
+
function H(c) {
|
|
1634
|
+
F(c.target.value), S();
|
|
471
1635
|
}
|
|
472
|
-
function
|
|
473
|
-
|
|
474
|
-
p(d.value), le(), clearTimeout(q), q = setTimeout(() => z(p() ?? ""), m());
|
|
1636
|
+
function I(c) {
|
|
1637
|
+
c.key === "Enter" && !c.shiftKey && (c.preventDefault(), y());
|
|
475
1638
|
}
|
|
476
|
-
function
|
|
477
|
-
|
|
1639
|
+
function y() {
|
|
1640
|
+
var k;
|
|
1641
|
+
const c = (F() ?? "").trim();
|
|
1642
|
+
!c && !e.get(g) || ((k = t.onsend) == null || k.call(t, c, e.get(g)), F(""), e.set(g, void 0), e.get(r) && (e.get(r).style.height = "auto"));
|
|
478
1643
|
}
|
|
479
|
-
function
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
e.set(C, s.selectionStart ?? (p() ?? "").length, !0);
|
|
483
|
-
}) : e.set(C, s.selectionStart ?? (p() ?? "").length, !0));
|
|
1644
|
+
function P() {
|
|
1645
|
+
var c;
|
|
1646
|
+
(c = e.get(w)) == null || c.click();
|
|
484
1647
|
}
|
|
485
|
-
function
|
|
486
|
-
|
|
1648
|
+
function N(c) {
|
|
1649
|
+
var M;
|
|
1650
|
+
const k = c.target;
|
|
1651
|
+
e.set(g, (M = k.files) == null ? void 0 : M[0], !0), k.value = "";
|
|
487
1652
|
}
|
|
488
|
-
function
|
|
489
|
-
e.set(
|
|
490
|
-
|
|
491
|
-
|
|
1653
|
+
function x() {
|
|
1654
|
+
e.set(g, void 0);
|
|
1655
|
+
}
|
|
1656
|
+
var p = _a();
|
|
1657
|
+
let m;
|
|
1658
|
+
var A = e.child(p);
|
|
1659
|
+
{
|
|
1660
|
+
var v = (c) => {
|
|
1661
|
+
var k = ua(), M = e.child(k), B = e.child(M);
|
|
1662
|
+
e.reset(M);
|
|
1663
|
+
var j = e.sibling(M, 2);
|
|
1664
|
+
e.reset(k), e.template_effect(() => e.set_text(B, `📎 ${e.get(g).name ?? ""}`)), e.delegated("click", j, x), e.append(c, k);
|
|
1665
|
+
};
|
|
1666
|
+
e.if(A, (c) => {
|
|
1667
|
+
e.get(g) && c(v);
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
var h = e.sibling(A, 2), l = e.child(h), a = e.sibling(l, 2);
|
|
1671
|
+
e.remove_textarea_child(a), e.bind_this(a, (c) => e.set(r, c), () => e.get(r));
|
|
1672
|
+
var s = e.sibling(a, 2);
|
|
1673
|
+
e.reset(h);
|
|
1674
|
+
var D = e.sibling(h, 2);
|
|
1675
|
+
e.bind_this(D, (c) => e.set(w, c), () => e.get(w)), e.reset(p), e.template_effect(
|
|
1676
|
+
(c) => {
|
|
1677
|
+
m = e.set_class(p, 1, `chat-input ${f() ?? ""}`, "svelte-bicrdd", m, { "chat-input--disabled": n() }), l.disabled = n(), e.set_attribute(a, "placeholder", d()), a.disabled = n(), e.set_value(a, F()), s.disabled = c;
|
|
1678
|
+
},
|
|
1679
|
+
[
|
|
1680
|
+
() => n() || !(F() ?? "").trim() && !e.get(g)
|
|
1681
|
+
]
|
|
1682
|
+
), e.delegated("click", l, P), e.delegated("input", a, H), e.delegated("keydown", a, I), e.delegated("click", s, y), e.delegated("change", D, N), e.append(K, p), e.pop();
|
|
1683
|
+
}
|
|
1684
|
+
e.delegate(["click", "input", "keydown", "change"]);
|
|
1685
|
+
var ga = e.from_html('<p class="memory-sidebar__empty svelte-1kg6yxg"> </p>'), fa = e.from_html('<div class="memory-sidebar__item svelte-1kg6yxg" role="listitem"><div class="memory-sidebar__item-row svelte-1kg6yxg"><span> </span> <span class="memory-sidebar__time svelte-1kg6yxg"> </span></div> <p class="memory-sidebar__content svelte-1kg6yxg"> </p></div>'), ha = e.from_html('<aside aria-label="Memories"><div class="memory-sidebar__header svelte-1kg6yxg"><h2 class="memory-sidebar__title svelte-1kg6yxg">Memories</h2> <span class="memory-sidebar__count svelte-1kg6yxg"> </span></div> <div class="memory-sidebar__search svelte-1kg6yxg"><span class="memory-sidebar__search-icon svelte-1kg6yxg" aria-hidden="true">⌕</span> <input class="memory-sidebar__search-input svelte-1kg6yxg" type="search" placeholder="Search memories…" aria-label="Search memories"/></div> <div class="memory-sidebar__list svelte-1kg6yxg" role="list"><!></div></aside>');
|
|
1686
|
+
function rs(K, t) {
|
|
1687
|
+
e.push(t, !0);
|
|
1688
|
+
let F = e.prop(t, "class", 3, ""), d = e.state("");
|
|
1689
|
+
const n = e.derived(() => e.get(d).trim() ? t.memories.filter((p) => p.content.toLowerCase().includes(e.get(d).trim().toLowerCase())) : t.memories), _ = {
|
|
1690
|
+
fact: "Fact",
|
|
1691
|
+
goal: "Goal",
|
|
1692
|
+
preference: "Pref",
|
|
1693
|
+
context: "Context",
|
|
1694
|
+
other: "Other"
|
|
1695
|
+
};
|
|
1696
|
+
function f(p) {
|
|
1697
|
+
const m = Date.now() - p.getTime(), A = Math.floor(m / 1e3);
|
|
1698
|
+
if (A < 60) return "just now";
|
|
1699
|
+
const v = Math.floor(A / 60);
|
|
1700
|
+
if (v < 60) return `${v}m ago`;
|
|
1701
|
+
const h = Math.floor(v / 60);
|
|
1702
|
+
return h < 24 ? `${h}h ago` : `${Math.floor(h / 24)}d ago`;
|
|
1703
|
+
}
|
|
1704
|
+
var r = ha(), w = e.child(r), g = e.sibling(e.child(w), 2), S = e.child(g, !0);
|
|
1705
|
+
e.reset(g), e.reset(w);
|
|
1706
|
+
var H = e.sibling(w, 2), I = e.sibling(e.child(H), 2);
|
|
1707
|
+
e.remove_input_defaults(I), e.reset(H);
|
|
1708
|
+
var y = e.sibling(H, 2), P = e.child(y);
|
|
1709
|
+
{
|
|
1710
|
+
var N = (p) => {
|
|
1711
|
+
var m = ga(), A = e.child(m, !0);
|
|
1712
|
+
e.reset(m), e.template_effect((v) => e.set_text(A, v), [
|
|
1713
|
+
() => e.get(d).trim() ? "No memories match your search." : "No memories yet."
|
|
1714
|
+
]), e.append(p, m);
|
|
1715
|
+
}, x = (p) => {
|
|
1716
|
+
var m = e.comment(), A = e.first_child(m);
|
|
1717
|
+
e.each(A, 17, () => e.get(n), (v) => v.id, (v, h) => {
|
|
1718
|
+
var l = fa(), a = e.child(l), s = e.child(a), D = e.child(s, !0);
|
|
1719
|
+
e.reset(s);
|
|
1720
|
+
var c = e.sibling(s, 2), k = e.child(c, !0);
|
|
1721
|
+
e.reset(c), e.reset(a);
|
|
1722
|
+
var M = e.sibling(a, 2), B = e.child(M, !0);
|
|
1723
|
+
e.reset(M), e.reset(l), e.template_effect(
|
|
1724
|
+
(j) => {
|
|
1725
|
+
e.set_class(s, 1, `memory-sidebar__badge memory-sidebar__badge--${e.get(h).category ?? ""}`, "svelte-1kg6yxg"), e.set_text(D, _[e.get(h).category]), e.set_text(k, j), e.set_text(B, e.get(h).content);
|
|
1726
|
+
},
|
|
1727
|
+
[() => f(e.get(h).timestamp)]
|
|
1728
|
+
), e.append(v, l);
|
|
1729
|
+
}), e.append(p, m);
|
|
1730
|
+
};
|
|
1731
|
+
e.if(P, (p) => {
|
|
1732
|
+
e.get(n).length === 0 ? p(N) : p(x, !1);
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1735
|
+
e.reset(y), e.reset(r), e.template_effect(() => {
|
|
1736
|
+
e.set_class(r, 1, `memory-sidebar ${F() ?? ""}`, "svelte-1kg6yxg"), e.set_text(S, e.get(n).length);
|
|
1737
|
+
}), e.bind_value(I, () => e.get(d), (p) => e.set(d, p)), e.append(K, r), e.pop();
|
|
1738
|
+
}
|
|
1739
|
+
var pa = e.from_html('<option class="svelte-1igku3k"> </option>'), ma = e.from_html('<label class="settings-panel__field svelte-1igku3k"><span class="settings-panel__label svelte-1igku3k">Channel ID</span> <input class="settings-panel__input svelte-1igku3k" type="text" placeholder="Channel / room ID" autocomplete="off" spellcheck="false"/></label>'), ba = e.from_html('<label class="settings-panel__field svelte-1igku3k"><span class="settings-panel__label svelte-1igku3k">Bot Token</span> <input class="settings-panel__input svelte-1igku3k" type="password" placeholder="Token…" autocomplete="off"/></label> <!>', 1), xa = e.from_html('<section aria-label="Agent settings"><div class="settings-panel__section svelte-1igku3k"><h3 class="settings-panel__section-title svelte-1igku3k">Model</h3> <label class="settings-panel__field svelte-1igku3k"><span class="settings-panel__label svelte-1igku3k">Provider URL</span> <input class="settings-panel__input svelte-1igku3k" type="url" placeholder="http://localhost:11434" autocomplete="off" spellcheck="false"/></label> <label class="settings-panel__field svelte-1igku3k"><span class="settings-panel__label svelte-1igku3k">API Key</span> <div class="settings-panel__input-row svelte-1igku3k"><input class="settings-panel__input svelte-1igku3k" placeholder="sk-…" autocomplete="off"/> <button class="settings-panel__toggle-btn svelte-1igku3k" type="button"> </button></div></label> <label class="settings-panel__field svelte-1igku3k"><span class="settings-panel__label svelte-1igku3k">Model Name</span> <input class="settings-panel__input svelte-1igku3k" type="text" placeholder="llama3.2" autocomplete="off" spellcheck="false"/></label></div> <div class="settings-panel__section svelte-1igku3k"><h3 class="settings-panel__section-title svelte-1igku3k">Channel</h3> <label class="settings-panel__field svelte-1igku3k"><span class="settings-panel__label svelte-1igku3k">Type</span> <select class="settings-panel__select svelte-1igku3k"></select></label> <!></div> <div class="settings-panel__actions svelte-1igku3k"><button class="settings-panel__btn settings-panel__btn--ghost svelte-1igku3k" type="button">Reset</button> <button class="settings-panel__btn settings-panel__btn--solid svelte-1igku3k" type="button">Save Settings</button></div></section>');
|
|
1740
|
+
function ds(K, t) {
|
|
1741
|
+
e.push(t, !0);
|
|
1742
|
+
const F = { providerUrl: "", apiKey: "", modelName: "" }, d = { type: "none", token: "", channelId: "" };
|
|
1743
|
+
let n = e.prop(t, "class", 3, ""), _ = e.state(e.proxy(he(() => {
|
|
1744
|
+
var u;
|
|
1745
|
+
return ((u = t.settings) == null ? void 0 : u.model.providerUrl) ?? "";
|
|
1746
|
+
}))), f = e.state(e.proxy(he(() => {
|
|
1747
|
+
var u;
|
|
1748
|
+
return ((u = t.settings) == null ? void 0 : u.model.apiKey) ?? "";
|
|
1749
|
+
}))), r = e.state(e.proxy(he(() => {
|
|
1750
|
+
var u;
|
|
1751
|
+
return ((u = t.settings) == null ? void 0 : u.model.modelName) ?? "";
|
|
1752
|
+
}))), w = e.state(e.proxy(he(() => {
|
|
1753
|
+
var u;
|
|
1754
|
+
return ((u = t.settings) == null ? void 0 : u.channel.type) ?? "none";
|
|
1755
|
+
}))), g = e.state(e.proxy(he(() => {
|
|
1756
|
+
var u;
|
|
1757
|
+
return ((u = t.settings) == null ? void 0 : u.channel.token) ?? "";
|
|
1758
|
+
}))), S = e.state(e.proxy(he(() => {
|
|
1759
|
+
var u;
|
|
1760
|
+
return ((u = t.settings) == null ? void 0 : u.channel.channelId) ?? "";
|
|
1761
|
+
}))), H = e.state(!1);
|
|
1762
|
+
const I = [
|
|
1763
|
+
{ value: "none", label: "None" },
|
|
1764
|
+
{ value: "discord", label: "Discord" },
|
|
1765
|
+
{ value: "telegram", label: "Telegram" },
|
|
1766
|
+
{ value: "slack", label: "Slack" },
|
|
1767
|
+
{ value: "matrix", label: "Matrix" }
|
|
1768
|
+
], y = e.derived(() => e.get(w) === "discord" || e.get(w) === "slack" || e.get(w) === "matrix");
|
|
1769
|
+
function P() {
|
|
1770
|
+
var u;
|
|
1771
|
+
(u = t.onsave) == null || u.call(t, {
|
|
1772
|
+
model: {
|
|
1773
|
+
providerUrl: e.get(_),
|
|
1774
|
+
apiKey: e.get(f),
|
|
1775
|
+
modelName: e.get(r)
|
|
492
1776
|
},
|
|
493
|
-
|
|
494
|
-
|
|
1777
|
+
channel: {
|
|
1778
|
+
type: e.get(w),
|
|
1779
|
+
token: e.get(g),
|
|
1780
|
+
channelId: e.get(S)
|
|
1781
|
+
}
|
|
1782
|
+
});
|
|
495
1783
|
}
|
|
496
|
-
function
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
return n < 0 ? [{ text: s, match: !1 }] : [
|
|
500
|
-
{ text: s.slice(0, n), match: !1 },
|
|
501
|
-
{ text: s.slice(n, n + _.length), match: !0 },
|
|
502
|
-
{ text: s.slice(n + _.length), match: !1 }
|
|
503
|
-
];
|
|
1784
|
+
function N() {
|
|
1785
|
+
const u = t.settings ?? { model: F, channel: d };
|
|
1786
|
+
e.set(_, u.model.providerUrl, !0), e.set(f, u.model.apiKey, !0), e.set(r, u.model.modelName, !0), e.set(w, u.channel.type, !0), e.set(g, u.channel.token, !0), e.set(S, u.channel.channelId, !0);
|
|
504
1787
|
}
|
|
505
|
-
var
|
|
1788
|
+
var x = xa(), p = e.child(x), m = e.sibling(e.child(p), 2), A = e.sibling(e.child(m), 2);
|
|
1789
|
+
e.remove_input_defaults(A), e.reset(m);
|
|
1790
|
+
var v = e.sibling(m, 2), h = e.sibling(e.child(v), 2), l = e.child(h);
|
|
1791
|
+
e.remove_input_defaults(l);
|
|
1792
|
+
var a = e.sibling(l, 2), s = e.child(a, !0);
|
|
1793
|
+
e.reset(a), e.reset(h), e.reset(v);
|
|
1794
|
+
var D = e.sibling(v, 2), c = e.sibling(e.child(D), 2);
|
|
1795
|
+
e.remove_input_defaults(c), e.reset(D), e.reset(p);
|
|
1796
|
+
var k = e.sibling(p, 2), M = e.sibling(e.child(k), 2), B = e.sibling(e.child(M), 2);
|
|
1797
|
+
e.each(B, 21, () => I, e.index, (u, G) => {
|
|
1798
|
+
var T = pa(), C = e.child(T, !0);
|
|
1799
|
+
e.reset(T);
|
|
1800
|
+
var R = {};
|
|
1801
|
+
e.template_effect(() => {
|
|
1802
|
+
e.set_text(C, e.get(G).label), R !== (R = e.get(G).value) && (T.value = (T.__value = e.get(G).value) ?? "");
|
|
1803
|
+
}), e.append(u, T);
|
|
1804
|
+
}), e.reset(B), e.reset(M);
|
|
1805
|
+
var j = e.sibling(M, 2);
|
|
506
1806
|
{
|
|
507
|
-
var
|
|
508
|
-
var
|
|
509
|
-
|
|
510
|
-
var
|
|
511
|
-
let n;
|
|
512
|
-
var M = e.child(_, !0);
|
|
513
|
-
e.reset(_);
|
|
514
|
-
var g = e.sibling(_, 2), b = e.child(g);
|
|
515
|
-
let I;
|
|
516
|
-
var S = e.sibling(b, 2);
|
|
517
|
-
let H;
|
|
518
|
-
var te = e.child(S);
|
|
1807
|
+
var W = (u) => {
|
|
1808
|
+
var G = ba(), T = e.first_child(G), C = e.sibling(e.child(T), 2);
|
|
1809
|
+
e.remove_input_defaults(C), e.reset(T);
|
|
1810
|
+
var R = e.sibling(T, 2);
|
|
519
1811
|
{
|
|
520
|
-
var
|
|
521
|
-
var
|
|
522
|
-
e.
|
|
523
|
-
}, V = (U) => {
|
|
524
|
-
var G = e.text();
|
|
525
|
-
e.template_effect(() => e.set_text(G, e.get(O).text)), e.append(U, G);
|
|
526
|
-
}, Q = (U) => {
|
|
527
|
-
var G = et(), J = e.first_child(G, !0), $ = e.sibling(J, 2);
|
|
528
|
-
e.template_effect(() => {
|
|
529
|
-
e.set_text(J, e.get(O).before), e.set_text($, `${e.get(O).after ?? ""}${e.get(O).pad ?? ""}`);
|
|
530
|
-
}), e.append(U, G);
|
|
1812
|
+
var o = (i) => {
|
|
1813
|
+
var b = ma(), z = e.sibling(e.child(b), 2);
|
|
1814
|
+
e.remove_input_defaults(z), e.reset(b), e.bind_value(z, () => e.get(S), (E) => e.set(S, E)), e.append(i, b);
|
|
531
1815
|
};
|
|
532
|
-
e.if(
|
|
533
|
-
e.get(
|
|
1816
|
+
e.if(R, (i) => {
|
|
1817
|
+
e.get(y) && i(o);
|
|
534
1818
|
});
|
|
535
1819
|
}
|
|
536
|
-
e.
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
e.
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
1820
|
+
e.bind_value(C, () => e.get(g), (i) => e.set(g, i)), e.append(u, G);
|
|
1821
|
+
};
|
|
1822
|
+
e.if(j, (u) => {
|
|
1823
|
+
e.get(w) !== "none" && u(W);
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
e.reset(k);
|
|
1827
|
+
var O = e.sibling(k, 2), L = e.child(O), U = e.sibling(L, 2);
|
|
1828
|
+
e.reset(O), e.reset(x), e.template_effect(() => {
|
|
1829
|
+
e.set_class(x, 1, `settings-panel ${n() ?? ""}`, "svelte-1igku3k"), e.set_attribute(l, "type", e.get(H) ? "text" : "password"), e.set_attribute(a, "aria-label", e.get(H) ? "Hide API key" : "Show API key"), e.set_text(s, e.get(H) ? "🙈" : "👁");
|
|
1830
|
+
}), e.bind_value(A, () => e.get(_), (u) => e.set(_, u)), e.bind_value(l, () => e.get(f), (u) => e.set(f, u)), e.delegated("click", a, () => e.set(H, !e.get(H))), e.bind_value(c, () => e.get(r), (u) => e.set(r, u)), e.bind_select_value(B, () => e.get(w), (u) => e.set(w, u)), e.delegated("click", L, N), e.delegated("click", U, P), e.append(K, x), e.pop();
|
|
1831
|
+
}
|
|
1832
|
+
e.delegate(["click"]);
|
|
1833
|
+
var ya = e.from_html('<p class="proc-editor__empty svelte-nac98f">No procedures yet. Click "+ Add" to create one.</p>'), wa = e.from_html('<input class="proc-editor__name-input svelte-nac98f" type="text" aria-label="Procedure name"/>'), ka = e.from_html('<span class="proc-editor__name svelte-nac98f"> </span>'), Ta = e.from_html('<span class="proc-editor__desc svelte-nac98f"> </span>'), za = e.from_html('<div class="proc-editor__item-fields svelte-nac98f"><label class="proc-editor__field svelte-nac98f"><span class="proc-editor__field-label svelte-nac98f">Event Type</span> <input class="proc-editor__field-input svelte-nac98f" type="text" placeholder="message" aria-label="Event type"/></label> <label class="proc-editor__field svelte-nac98f"><span class="proc-editor__field-label svelte-nac98f">Priority</span> <input class="proc-editor__field-input proc-editor__field-input--narrow svelte-nac98f" type="number" min="0" max="999" aria-label="Priority"/></label></div>'), Ma = e.from_html('<div class="proc-editor__item-meta svelte-nac98f"><span class="proc-editor__chip svelte-nac98f"> </span> <span class="proc-editor__chip svelte-nac98f"> </span></div>'), Ca = e.from_html('<div role="listitem"><div class="proc-editor__item-main svelte-nac98f"><!> <div class="proc-editor__item-info svelte-nac98f"><!> <!></div> <div class="proc-editor__item-actions svelte-nac98f"><button class="proc-editor__icon-btn svelte-nac98f" type="button" aria-label="Edit procedure" title="Edit">✏️</button> <button class="proc-editor__icon-btn proc-editor__icon-btn--danger svelte-nac98f" type="button" aria-label="Delete procedure" title="Delete">🗑</button></div></div> <!></div>'), Da = e.from_html('<div aria-label="Procedure editor"><div class="proc-editor__header svelte-nac98f"><h3 class="proc-editor__title svelte-nac98f">Procedures</h3> <button class="proc-editor__add-btn svelte-nac98f" type="button" aria-label="Add procedure">+ Add</button></div> <div class="proc-editor__list svelte-nac98f" role="list"><!></div></div>');
|
|
1834
|
+
function cs(K, t) {
|
|
1835
|
+
e.push(t, !0);
|
|
1836
|
+
let F = e.prop(t, "procedures", 27, () => e.proxy([])), d = e.prop(t, "class", 3, ""), n = e.state(e.proxy(F().map((v) => ({ ...v })))), _ = e.state(null);
|
|
1837
|
+
function f() {
|
|
1838
|
+
var v;
|
|
1839
|
+
(v = t.onchange) == null || v.call(t, e.get(n).map((h) => ({ ...h })));
|
|
1840
|
+
}
|
|
1841
|
+
function r(v, h) {
|
|
1842
|
+
e.set(n, e.get(n).map((l) => l.id === v ? { ...l, enabled: h } : l), !0), f();
|
|
1843
|
+
}
|
|
1844
|
+
function w(v, h) {
|
|
1845
|
+
e.set(n, e.get(n).map((l) => l.id === v ? { ...l, eventType: h } : l), !0);
|
|
1846
|
+
}
|
|
1847
|
+
function g(v, h) {
|
|
1848
|
+
const l = parseInt(h, 10);
|
|
1849
|
+
isNaN(l) || e.set(n, e.get(n).map((a) => a.id === v ? { ...a, priority: l } : a), !0);
|
|
1850
|
+
}
|
|
1851
|
+
function S(v) {
|
|
1852
|
+
e.set(_, null), f();
|
|
1853
|
+
}
|
|
1854
|
+
function H(v) {
|
|
1855
|
+
e.set(n, e.get(n).filter((h) => h.id !== v), !0), e.get(_) === v && e.set(_, null), f();
|
|
1856
|
+
}
|
|
1857
|
+
function I() {
|
|
1858
|
+
const v = typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `proc-${crypto.randomUUID()}` : `proc-${Date.now()}-${Math.random().toString(36).slice(2)}`, h = {
|
|
1859
|
+
id: v,
|
|
1860
|
+
name: "New Procedure",
|
|
1861
|
+
enabled: !0,
|
|
1862
|
+
eventType: "message",
|
|
1863
|
+
priority: 0
|
|
1864
|
+
};
|
|
1865
|
+
e.set(n, [...e.get(n), h], !0), e.set(_, v, !0), f();
|
|
1866
|
+
}
|
|
1867
|
+
var y = Da(), P = e.child(y), N = e.sibling(e.child(P), 2);
|
|
1868
|
+
e.reset(P);
|
|
1869
|
+
var x = e.sibling(P, 2), p = e.child(x);
|
|
1870
|
+
{
|
|
1871
|
+
var m = (v) => {
|
|
1872
|
+
var h = ya();
|
|
1873
|
+
e.append(v, h);
|
|
1874
|
+
}, A = (v) => {
|
|
1875
|
+
var h = e.comment(), l = e.first_child(h);
|
|
1876
|
+
e.each(l, 17, () => e.get(n), (a) => a.id, (a, s) => {
|
|
1877
|
+
var D = Ca();
|
|
1878
|
+
let c;
|
|
1879
|
+
var k = e.child(D), M = e.child(k);
|
|
1880
|
+
lt(M, {
|
|
1881
|
+
get checked() {
|
|
1882
|
+
return e.get(s).enabled;
|
|
1883
|
+
},
|
|
1884
|
+
onchange: (i) => r(e.get(s).id, i)
|
|
577
1885
|
});
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
1886
|
+
var B = e.sibling(M, 2), j = e.child(B);
|
|
1887
|
+
{
|
|
1888
|
+
var W = (i) => {
|
|
1889
|
+
var b = wa();
|
|
1890
|
+
e.remove_input_defaults(b), e.template_effect(() => e.set_value(b, e.get(s).name)), e.delegated("input", b, (z) => {
|
|
1891
|
+
const E = z.target.value;
|
|
1892
|
+
e.set(n, e.get(n).map((q) => q.id === e.get(s).id ? { ...q, name: E } : q), !0);
|
|
1893
|
+
}), e.event("blur", b, () => S(e.get(s).id)), e.delegated("keydown", b, (z) => z.key === "Enter" && S(e.get(s).id)), e.append(i, b);
|
|
1894
|
+
}, O = (i) => {
|
|
1895
|
+
var b = ka(), z = e.child(b, !0);
|
|
1896
|
+
e.reset(b), e.template_effect(() => e.set_text(z, e.get(s).name)), e.append(i, b);
|
|
1897
|
+
};
|
|
1898
|
+
e.if(j, (i) => {
|
|
1899
|
+
e.get(_) === e.get(s).id ? i(W) : i(O, !1);
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
var L = e.sibling(j, 2);
|
|
1903
|
+
{
|
|
1904
|
+
var U = (i) => {
|
|
1905
|
+
var b = Ta(), z = e.child(b, !0);
|
|
1906
|
+
e.reset(b), e.template_effect(() => e.set_text(z, e.get(s).description)), e.append(i, b);
|
|
1907
|
+
};
|
|
1908
|
+
e.if(L, (i) => {
|
|
1909
|
+
e.get(s).description && i(U);
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
e.reset(B);
|
|
1913
|
+
var u = e.sibling(B, 2), G = e.child(u), T = e.sibling(G, 2);
|
|
1914
|
+
e.reset(u), e.reset(k);
|
|
1915
|
+
var C = e.sibling(k, 2);
|
|
1916
|
+
{
|
|
1917
|
+
var R = (i) => {
|
|
1918
|
+
var b = za(), z = e.child(b), E = e.sibling(e.child(z), 2);
|
|
1919
|
+
e.remove_input_defaults(E), e.reset(z);
|
|
1920
|
+
var q = e.sibling(z, 2), V = e.sibling(e.child(q), 2);
|
|
1921
|
+
e.remove_input_defaults(V), e.reset(q), e.reset(b), e.template_effect(() => {
|
|
1922
|
+
e.set_value(E, e.get(s).eventType), e.set_value(V, e.get(s).priority);
|
|
1923
|
+
}), e.delegated("input", E, (Y) => w(e.get(s).id, Y.target.value)), e.delegated("input", V, (Y) => g(e.get(s).id, Y.target.value)), e.append(i, b);
|
|
1924
|
+
}, o = (i) => {
|
|
1925
|
+
var b = Ma(), z = e.child(b), E = e.child(z);
|
|
1926
|
+
e.reset(z);
|
|
1927
|
+
var q = e.sibling(z, 2), V = e.child(q);
|
|
1928
|
+
e.reset(q), e.reset(b), e.template_effect(() => {
|
|
1929
|
+
e.set_text(E, `⚡ ${e.get(s).eventType ?? ""}`), e.set_text(V, `↑ ${e.get(s).priority ?? ""}`);
|
|
1930
|
+
}), e.append(i, b);
|
|
1931
|
+
};
|
|
1932
|
+
e.if(C, (i) => {
|
|
1933
|
+
e.get(_) === e.get(s).id ? i(R) : i(o, !1);
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
e.reset(D), e.template_effect(() => c = e.set_class(D, 1, "proc-editor__item svelte-nac98f", null, c, { "proc-editor__item--disabled": !e.get(s).enabled })), e.delegated("click", G, () => e.set(_, e.get(_) === e.get(s).id ? null : e.get(s).id, !0)), e.delegated("click", T, () => H(e.get(s).id)), e.append(a, D);
|
|
1937
|
+
}), e.append(v, h);
|
|
1938
|
+
};
|
|
1939
|
+
e.if(p, (v) => {
|
|
1940
|
+
e.get(n).length === 0 ? v(m) : v(A, !1);
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
e.reset(x), e.reset(y), e.template_effect(() => e.set_class(y, 1, `proc-editor ${d() ?? ""}`, "svelte-nac98f")), e.delegated("click", N, I), e.append(K, y), e.pop();
|
|
1944
|
+
}
|
|
1945
|
+
e.delegate(["click", "input", "keydown"]);
|
|
1946
|
+
var Ea = e.from_svg('<svg viewBox="0 0 12 12" fill="none" aria-hidden="true" width="12" height="12"><path d="M2 6l3 3 5-5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>'), Sa = e.from_html('<div class="wizard__step-connector svelte-nud89b" aria-hidden="true"><div class="wizard__step-connector-fill svelte-nud89b"></div></div>'), Pa = e.from_html('<div role="listitem"><div class="wizard__step-dot svelte-nud89b"><!></div> <span class="wizard__step-label svelte-nud89b"> </span></div> <!>', 1), Ia = e.from_html('<div class="wizard__step-content svelte-nud89b"><h2 class="wizard__step-heading svelte-nud89b">Name your agent</h2> <p class="wizard__step-desc svelte-nud89b">Give your agent a unique name. You can change this later in settings.</p> <label class="wizard__field svelte-nud89b"><span class="wizard__field-label svelte-nud89b">Agent Name</span> <input class="wizard__input svelte-nud89b" type="text" placeholder="e.g. praxis" aria-label="Agent name"/></label></div>'), Na = e.from_html('<div class="wizard__step-content svelte-nud89b"><h2 class="wizard__step-heading svelte-nud89b">Pick a model</h2> <p class="wizard__step-desc svelte-nud89b">Connect to an LLM provider. Ollama running locally is a great start.</p> <label class="wizard__field svelte-nud89b"><span class="wizard__field-label svelte-nud89b">Provider URL</span> <input class="wizard__input svelte-nud89b" type="url" placeholder="http://localhost:11434" aria-label="Provider URL"/></label> <label class="wizard__field svelte-nud89b"><span class="wizard__field-label svelte-nud89b">API Key <span class="wizard__optional svelte-nud89b">(optional)</span></span> <div class="wizard__input-row svelte-nud89b"><input class="wizard__input svelte-nud89b" placeholder="sk-…" autocomplete="off" aria-label="API key"/> <button class="wizard__toggle-btn svelte-nud89b" type="button"> </button></div></label> <label class="wizard__field svelte-nud89b"><span class="wizard__field-label svelte-nud89b">Model Name</span> <input class="wizard__input svelte-nud89b" type="text" placeholder="llama3.2" aria-label="Model name"/></label></div>'), La = e.from_html('<option class="svelte-nud89b"> </option>'), Aa = e.from_html('<label class="wizard__field svelte-nud89b"><span class="wizard__field-label svelte-nud89b">Bot Token</span> <input class="wizard__input svelte-nud89b" type="password" placeholder="Token…" autocomplete="off" aria-label="Bot token"/></label>'), Ba = e.from_html('<div class="wizard__step-content svelte-nud89b"><h2 class="wizard__step-heading svelte-nud89b">Connect a channel</h2> <p class="wizard__step-desc svelte-nud89b">Give your agent a place to talk. You can skip this and add channels later.</p> <label class="wizard__field svelte-nud89b"><span class="wizard__field-label svelte-nud89b">Channel Type</span> <select class="wizard__select svelte-nud89b" aria-label="Channel type"></select></label> <!></div>'), Ua = e.from_html(`<div class="wizard__step-content wizard__step-content--done svelte-nud89b"><div class="wizard__done-icon svelte-nud89b" aria-hidden="true">🎉</div> <h2 class="wizard__step-heading svelte-nud89b">You're all set!</h2> <p class="wizard__step-desc svelte-nud89b"><strong> </strong> is ready. You can adjust model and channel settings
|
|
1947
|
+
at any time from the settings panel.</p> <dl class="wizard__summary svelte-nud89b"><dt class="svelte-nud89b">Agent</dt> <dd class="svelte-nud89b"> </dd> <dt class="svelte-nud89b">Model</dt> <dd class="svelte-nud89b"> </dd> <dt class="svelte-nud89b">Channel</dt><dd class="svelte-nud89b"> </dd></dl></div>`), Ra = e.from_html('<button class="wizard__btn wizard__btn--ghost svelte-nud89b" type="button">← Back</button>'), Fa = e.from_html("<div></div>"), Ha = e.from_html('<button class="wizard__btn wizard__btn--solid svelte-nud89b" type="button"> </button>'), Ka = e.from_html('<div aria-label="First run setup wizard"><div class="wizard__steps svelte-nud89b" role="list"></div> <div class="wizard__body svelte-nud89b"><!></div> <div class="wizard__nav svelte-nud89b"><!> <!></div></div>');
|
|
1948
|
+
function os(K, t) {
|
|
1949
|
+
e.push(t, !0);
|
|
1950
|
+
let F = e.prop(t, "class", 3, ""), d = e.state("name"), n = e.state(""), _ = e.state(""), f = e.state(""), r = e.state(""), w = e.state("none"), g = e.state("");
|
|
1951
|
+
const S = ["name", "model", "channel", "done"], H = {
|
|
1952
|
+
name: "Name Agent",
|
|
1953
|
+
model: "Pick Model",
|
|
1954
|
+
channel: "Connect Channel",
|
|
1955
|
+
done: "Done"
|
|
1956
|
+
}, I = e.derived(() => S.indexOf(e.get(d)));
|
|
1957
|
+
e.derived(() => e.get(I) / (S.length - 1) * 100);
|
|
1958
|
+
const y = e.derived(() => () => {
|
|
1959
|
+
switch (e.get(d)) {
|
|
1960
|
+
case "name":
|
|
1961
|
+
return e.get(n).trim().length > 0;
|
|
1962
|
+
case "model":
|
|
1963
|
+
return e.get(r).trim().length > 0;
|
|
1964
|
+
case "channel":
|
|
1965
|
+
return !0;
|
|
1966
|
+
case // channel is optional
|
|
1967
|
+
"done":
|
|
1968
|
+
return !1;
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
function P() {
|
|
1972
|
+
var L;
|
|
1973
|
+
const O = S.indexOf(e.get(d));
|
|
1974
|
+
O < S.length - 1 && e.set(d, S[O + 1], !0), e.get(d) === "done" && ((L = t.oncomplete) == null || L.call(t, {
|
|
1975
|
+
agentName: e.get(n),
|
|
1976
|
+
providerUrl: e.get(_),
|
|
1977
|
+
apiKey: e.get(f),
|
|
1978
|
+
modelName: e.get(r),
|
|
1979
|
+
channelType: e.get(w),
|
|
1980
|
+
channelToken: e.get(g)
|
|
1981
|
+
}));
|
|
1982
|
+
}
|
|
1983
|
+
function N() {
|
|
1984
|
+
const O = S.indexOf(e.get(d));
|
|
1985
|
+
O > 0 && e.set(d, S[O - 1], !0);
|
|
1986
|
+
}
|
|
1987
|
+
const x = [
|
|
1988
|
+
{ value: "none", label: "None" },
|
|
1989
|
+
{ value: "discord", label: "Discord" },
|
|
1990
|
+
{ value: "telegram", label: "Telegram" },
|
|
1991
|
+
{ value: "slack", label: "Slack" },
|
|
1992
|
+
{ value: "matrix", label: "Matrix" }
|
|
1993
|
+
];
|
|
1994
|
+
let p = e.state(!1);
|
|
1995
|
+
var m = Ka(), A = e.child(m);
|
|
1996
|
+
e.each(A, 21, () => S, e.index, (O, L, U) => {
|
|
1997
|
+
var u = Pa(), G = e.first_child(u);
|
|
1998
|
+
let T;
|
|
1999
|
+
var C = e.child(G), R = e.child(C);
|
|
2000
|
+
{
|
|
2001
|
+
var o = (V) => {
|
|
2002
|
+
var Y = Ea();
|
|
2003
|
+
e.append(V, Y);
|
|
2004
|
+
}, i = (V) => {
|
|
2005
|
+
var Y = e.text();
|
|
2006
|
+
Y.nodeValue = U + 1, e.append(V, Y);
|
|
2007
|
+
};
|
|
2008
|
+
e.if(R, (V) => {
|
|
2009
|
+
U < e.get(I) ? V(o) : V(i, !1);
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
e.reset(C);
|
|
2013
|
+
var b = e.sibling(C, 2), z = e.child(b, !0);
|
|
2014
|
+
e.reset(b), e.reset(G);
|
|
2015
|
+
var E = e.sibling(G, 2);
|
|
2016
|
+
{
|
|
2017
|
+
var q = (V) => {
|
|
2018
|
+
var Y = Sa(), J = e.child(Y);
|
|
2019
|
+
let Z;
|
|
2020
|
+
e.reset(Y), e.template_effect(() => Z = e.set_style(J, "", Z, { width: U < e.get(I) ? "100%" : "0%" })), e.append(V, Y);
|
|
2021
|
+
};
|
|
2022
|
+
e.if(E, (V) => {
|
|
2023
|
+
U < S.length - 1 && V(q);
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
e.template_effect(() => {
|
|
2027
|
+
T = e.set_class(G, 1, "wizard__step svelte-nud89b", null, T, {
|
|
2028
|
+
"wizard__step--active": e.get(L) === e.get(d),
|
|
2029
|
+
"wizard__step--done": U < e.get(I)
|
|
2030
|
+
}), e.set_attribute(G, "aria-current", e.get(L) === e.get(d) ? "step" : void 0), e.set_text(z, H[e.get(L)]);
|
|
2031
|
+
}), e.append(O, u);
|
|
2032
|
+
}), e.reset(A);
|
|
2033
|
+
var v = e.sibling(A, 2), h = e.child(v);
|
|
2034
|
+
{
|
|
2035
|
+
var l = (O) => {
|
|
2036
|
+
var L = Ia(), U = e.sibling(e.child(L), 4), u = e.sibling(e.child(U), 2);
|
|
2037
|
+
e.remove_input_defaults(u), e.reset(U), e.reset(L), e.delegated("keydown", u, (G) => G.key === "Enter" && e.get(y)() && P()), e.bind_value(u, () => e.get(n), (G) => e.set(n, G)), e.append(O, L);
|
|
2038
|
+
}, a = (O) => {
|
|
2039
|
+
var L = Na(), U = e.sibling(e.child(L), 4), u = e.sibling(e.child(U), 2);
|
|
2040
|
+
e.remove_input_defaults(u), e.reset(U);
|
|
2041
|
+
var G = e.sibling(U, 2), T = e.sibling(e.child(G), 2), C = e.child(T);
|
|
2042
|
+
e.remove_input_defaults(C);
|
|
2043
|
+
var R = e.sibling(C, 2), o = e.child(R, !0);
|
|
2044
|
+
e.reset(R), e.reset(T), e.reset(G);
|
|
2045
|
+
var i = e.sibling(G, 2), b = e.sibling(e.child(i), 2);
|
|
2046
|
+
e.remove_input_defaults(b), e.reset(i), e.reset(L), e.template_effect(() => {
|
|
2047
|
+
e.set_attribute(C, "type", e.get(p) ? "text" : "password"), e.set_attribute(R, "aria-label", e.get(p) ? "Hide API key" : "Show API key"), e.set_text(o, e.get(p) ? "🙈" : "👁");
|
|
2048
|
+
}), e.bind_value(u, () => e.get(_), (z) => e.set(_, z)), e.bind_value(C, () => e.get(f), (z) => e.set(f, z)), e.delegated("click", R, () => e.set(p, !e.get(p))), e.delegated("keydown", b, (z) => z.key === "Enter" && e.get(y)() && P()), e.bind_value(b, () => e.get(r), (z) => e.set(r, z)), e.append(O, L);
|
|
2049
|
+
}, s = (O) => {
|
|
2050
|
+
var L = Ba(), U = e.sibling(e.child(L), 4), u = e.sibling(e.child(U), 2);
|
|
2051
|
+
e.each(u, 21, () => x, e.index, (C, R) => {
|
|
2052
|
+
var o = La(), i = e.child(o, !0);
|
|
2053
|
+
e.reset(o);
|
|
2054
|
+
var b = {};
|
|
2055
|
+
e.template_effect(() => {
|
|
2056
|
+
e.set_text(i, e.get(R).label), b !== (b = e.get(R).value) && (o.value = (o.__value = e.get(R).value) ?? "");
|
|
2057
|
+
}), e.append(C, o);
|
|
2058
|
+
}), e.reset(u), e.reset(U);
|
|
2059
|
+
var G = e.sibling(U, 2);
|
|
593
2060
|
{
|
|
594
|
-
var
|
|
595
|
-
var
|
|
596
|
-
e.
|
|
597
|
-
const Z = e.derived(() => pe(e.get(H).text, p() ?? ""));
|
|
598
|
-
var V = rt();
|
|
599
|
-
let Q;
|
|
600
|
-
var se = e.child(V);
|
|
601
|
-
e.each(se, 21, () => e.get(Z), e.index, (X, R) => {
|
|
602
|
-
var ae = e.comment(), N = e.first_child(ae);
|
|
603
|
-
{
|
|
604
|
-
var U = (J) => {
|
|
605
|
-
var $ = lt(), de = e.child($, !0);
|
|
606
|
-
e.reset($), e.template_effect(() => e.set_text(de, e.get(R).text)), e.append(J, $);
|
|
607
|
-
}, G = (J) => {
|
|
608
|
-
var $ = e.text();
|
|
609
|
-
e.template_effect(() => e.set_text($, e.get(R).text)), e.append(J, $);
|
|
610
|
-
};
|
|
611
|
-
e.if(N, (J) => {
|
|
612
|
-
e.get(R).match ? J(U) : J(G, !1);
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
e.append(X, ae);
|
|
616
|
-
}), e.reset(se);
|
|
617
|
-
var j = e.sibling(se, 2);
|
|
618
|
-
{
|
|
619
|
-
var W = (X) => {
|
|
620
|
-
var R = nt(), ae = e.child(R);
|
|
621
|
-
e.reset(R), e.template_effect((N) => e.set_text(ae, `★ ${N ?? ""}`), [() => e.get(H).score.toFixed(2)]), e.append(X, R);
|
|
622
|
-
};
|
|
623
|
-
e.if(j, (X) => {
|
|
624
|
-
v() && X(W);
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
e.reset(V), e.template_effect(() => {
|
|
628
|
-
Q = e.set_class(V, 1, "search-gui__option svelte-1xnd4ea", null, Q, { "search-gui__option--selected": te === e.get(l) }), e.set_attribute(V, "aria-selected", te === e.get(l));
|
|
629
|
-
}), e.delegated("mousedown", V, () => Y(e.get(H))), e.event("mouseenter", V, () => e.set(l, te, !0)), e.append(S, V);
|
|
630
|
-
}), e.reset(I), e.template_effect(() => e.set_attribute(I, "id", E)), e.append(b, I);
|
|
2061
|
+
var T = (C) => {
|
|
2062
|
+
var R = Aa(), o = e.sibling(e.child(R), 2);
|
|
2063
|
+
e.remove_input_defaults(o), e.reset(R), e.bind_value(o, () => e.get(g), (i) => e.set(g, i)), e.append(C, R);
|
|
631
2064
|
};
|
|
632
|
-
e.if(
|
|
633
|
-
e.get(
|
|
2065
|
+
e.if(G, (C) => {
|
|
2066
|
+
e.get(w) !== "none" && C(T);
|
|
634
2067
|
});
|
|
635
2068
|
}
|
|
636
|
-
e.reset(
|
|
637
|
-
|
|
638
|
-
|
|
2069
|
+
e.reset(L), e.bind_select_value(u, () => e.get(w), (C) => e.set(w, C)), e.append(O, L);
|
|
2070
|
+
}, D = (O) => {
|
|
2071
|
+
var L = Ua(), U = e.sibling(e.child(L), 4), u = e.child(U), G = e.child(u, !0);
|
|
2072
|
+
e.reset(u), e.next(), e.reset(U);
|
|
2073
|
+
var T = e.sibling(U, 2), C = e.sibling(e.child(T), 2), R = e.child(C, !0);
|
|
2074
|
+
e.reset(C);
|
|
2075
|
+
var o = e.sibling(C, 4), i = e.child(o, !0);
|
|
2076
|
+
e.reset(o);
|
|
2077
|
+
var b = e.sibling(o, 3), z = e.child(b, !0);
|
|
2078
|
+
e.reset(b), e.reset(T), e.reset(L), e.template_effect(() => {
|
|
2079
|
+
e.set_text(G, e.get(n)), e.set_text(R, e.get(n)), e.set_text(i, e.get(r) || "—"), e.set_text(z, e.get(w) === "none" ? "None" : e.get(w));
|
|
2080
|
+
}), e.append(O, L);
|
|
639
2081
|
};
|
|
640
|
-
e.if(
|
|
641
|
-
e.get(
|
|
2082
|
+
e.if(h, (O) => {
|
|
2083
|
+
e.get(d) === "name" ? O(l) : e.get(d) === "model" ? O(a, 1) : e.get(d) === "channel" ? O(s, 2) : e.get(d) === "done" && O(D, 3);
|
|
642
2084
|
});
|
|
643
2085
|
}
|
|
644
|
-
e.
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
var
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
"line-height": `${w() ?? ""}px`
|
|
2086
|
+
e.reset(v);
|
|
2087
|
+
var c = e.sibling(v, 2), k = e.child(c);
|
|
2088
|
+
{
|
|
2089
|
+
var M = (O) => {
|
|
2090
|
+
var L = Ra();
|
|
2091
|
+
e.template_effect(() => L.disabled = e.get(d) === "done"), e.delegated("click", L, N), e.append(O, L);
|
|
2092
|
+
}, B = (O) => {
|
|
2093
|
+
var L = Fa();
|
|
2094
|
+
e.append(O, L);
|
|
2095
|
+
};
|
|
2096
|
+
e.if(k, (O) => {
|
|
2097
|
+
e.get(d) !== "name" ? O(M) : O(B, !1);
|
|
657
2098
|
});
|
|
658
|
-
}
|
|
2099
|
+
}
|
|
2100
|
+
var j = e.sibling(k, 2);
|
|
2101
|
+
{
|
|
2102
|
+
var W = (O) => {
|
|
2103
|
+
var L = Ha(), U = e.child(L, !0);
|
|
2104
|
+
e.reset(L), e.template_effect(
|
|
2105
|
+
(u) => {
|
|
2106
|
+
L.disabled = u, e.set_text(U, e.get(d) === "channel" && e.get(w) === "none" ? "Skip" : "Next →");
|
|
2107
|
+
},
|
|
2108
|
+
[() => !e.get(y)()]
|
|
2109
|
+
), e.delegated("click", L, P), e.append(O, L);
|
|
2110
|
+
};
|
|
2111
|
+
e.if(j, (O) => {
|
|
2112
|
+
e.get(d) !== "done" && O(W);
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
2115
|
+
e.reset(c), e.reset(m), e.template_effect(() => e.set_class(m, 1, `wizard ${F() ?? ""}`, "svelte-nud89b")), e.append(K, m), e.pop();
|
|
659
2116
|
}
|
|
2117
|
+
e.delegate(["keydown", "click"]);
|
|
660
2118
|
export {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
2119
|
+
Ja as Box,
|
|
2120
|
+
Va as Button,
|
|
2121
|
+
ns as ChatInput,
|
|
2122
|
+
ss as ChatPane,
|
|
2123
|
+
is as ChatView,
|
|
2124
|
+
os as FirstRunWizard,
|
|
2125
|
+
yt as GlassPanel,
|
|
2126
|
+
qa as Input,
|
|
2127
|
+
ts as List,
|
|
2128
|
+
Vt as ListItem,
|
|
2129
|
+
rs as MemorySidebar,
|
|
2130
|
+
ls as NerdFont,
|
|
2131
|
+
as as Pane,
|
|
2132
|
+
cs as ProcedureEditor,
|
|
2133
|
+
He as SPRING_PRESETS,
|
|
2134
|
+
Wa as SearchInput,
|
|
2135
|
+
Ga as Select,
|
|
2136
|
+
ds as SettingsPanel,
|
|
2137
|
+
Qa as SplitPane,
|
|
2138
|
+
Xa as StatusBar,
|
|
2139
|
+
Za as StatusBarItem,
|
|
2140
|
+
$a as StatusBarSpacer,
|
|
2141
|
+
es as Table,
|
|
2142
|
+
Ya as Text,
|
|
2143
|
+
lt as Toggle,
|
|
2144
|
+
ge as createSpring,
|
|
2145
|
+
pe as provideTui,
|
|
2146
|
+
ie as useTui
|
|
669
2147
|
};
|