@plures/design-dojo 0.2.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/LICENSE +661 -0
- package/README.md +153 -0
- package/dist/icons/NerdFont.svelte.d.ts +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +669 -0
- package/dist/motion/spring.d.ts +87 -0
- package/dist/primitives/Button.svelte.d.ts +1 -0
- package/dist/primitives/SearchInput.svelte.d.ts +1 -0
- package/dist/primitives/Toggle.svelte.d.ts +1 -0
- package/dist/primitives/search-input-types.d.ts +7 -0
- package/dist/surfaces/ChatPane.svelte.d.ts +1 -0
- package/dist/surfaces/ChatPane.types.d.ts +8 -0
- package/dist/surfaces/GlassPanel.svelte.d.ts +1 -0
- package/dist/useTui.d.ts +25 -0
- package/package.json +48 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
import "svelte/internal/disclose-version";
|
|
2
|
+
import * as e from "svelte/internal/client";
|
|
3
|
+
import { getContext as Re, setContext as Se } from "svelte";
|
|
4
|
+
const He = {
|
|
5
|
+
/** Gentle hover, focus ring expansion */
|
|
6
|
+
gentle: { stiffness: 120, damping: 14, mass: 1, restThreshold: 0.01 },
|
|
7
|
+
/** Button press, toggle switch */
|
|
8
|
+
snappy: { stiffness: 300, damping: 24, mass: 1, restThreshold: 0.01 },
|
|
9
|
+
/** Playful bounce, notification pop */
|
|
10
|
+
bouncy: { stiffness: 400, damping: 10, mass: 1, restThreshold: 0.01 },
|
|
11
|
+
/** Modal open, panel slide */
|
|
12
|
+
heavy: { stiffness: 200, damping: 30, mass: 1.5, restThreshold: 0.01 },
|
|
13
|
+
/** Tooltip, popover */
|
|
14
|
+
quick: { stiffness: 500, damping: 30, mass: 0.5, restThreshold: 0.01 }
|
|
15
|
+
};
|
|
16
|
+
function Ne(y, t, w) {
|
|
17
|
+
const { stiffness: p, damping: u, mass: f } = t, m = y.value - y.target, v = -p * m, D = -u * y.velocity, r = (v + D) / f, k = y.velocity + r * w, A = y.value + k * w, o = Math.abs(k) < t.restThreshold && Math.abs(A - y.target) < t.restThreshold;
|
|
18
|
+
return {
|
|
19
|
+
value: o ? y.target : A,
|
|
20
|
+
velocity: o ? 0 : k,
|
|
21
|
+
target: y.target,
|
|
22
|
+
done: o
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function ve(y, t = "snappy", w) {
|
|
26
|
+
const p = typeof t == "string" ? He[t] : t;
|
|
27
|
+
let u = {
|
|
28
|
+
value: y,
|
|
29
|
+
velocity: 0,
|
|
30
|
+
target: y,
|
|
31
|
+
done: !0
|
|
32
|
+
}, f = null, m = null;
|
|
33
|
+
function v(r) {
|
|
34
|
+
m === null && (m = r);
|
|
35
|
+
const k = Math.min((r - m) / 1e3, 0.064);
|
|
36
|
+
m = r, u = Ne(u, p, k), w(u.value), u.done ? (f = null, m = null) : f = requestAnimationFrame(v);
|
|
37
|
+
}
|
|
38
|
+
function D() {
|
|
39
|
+
f === null && (m = null, f = requestAnimationFrame(v));
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
/** Set a new target value. Animation starts automatically. */
|
|
43
|
+
set(r) {
|
|
44
|
+
u.target = r, u.done = !1, D();
|
|
45
|
+
},
|
|
46
|
+
/** Jump to value immediately (no animation). */
|
|
47
|
+
jump(r) {
|
|
48
|
+
u = { value: r, velocity: 0, target: r, done: !0 }, w(r);
|
|
49
|
+
},
|
|
50
|
+
/** Add velocity impulse (e.g., from a flick gesture). */
|
|
51
|
+
impulse(r) {
|
|
52
|
+
u.velocity += r, u.done = !1, D();
|
|
53
|
+
},
|
|
54
|
+
/** Stop animation. */
|
|
55
|
+
stop() {
|
|
56
|
+
f !== null && (cancelAnimationFrame(f), f = null, m = null);
|
|
57
|
+
},
|
|
58
|
+
/** Get current value. */
|
|
59
|
+
get value() {
|
|
60
|
+
return u.value;
|
|
61
|
+
},
|
|
62
|
+
/** Whether the spring has settled. */
|
|
63
|
+
get done() {
|
|
64
|
+
return u.done;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const Ee = Symbol("tui");
|
|
69
|
+
function Ve(y) {
|
|
70
|
+
Se(Ee, y);
|
|
71
|
+
}
|
|
72
|
+
function fe() {
|
|
73
|
+
return Re(Ee) ?? (() => !1);
|
|
74
|
+
}
|
|
75
|
+
var qe = e.from_html('<span class="tui-border-l svelte-5blyfe">╠</span><!><span class="tui-border-r svelte-5blyfe">╣</span>', 1), ze = e.from_html("<button><!></button>");
|
|
76
|
+
function _t(y, t) {
|
|
77
|
+
e.push(t, !0);
|
|
78
|
+
let w = e.prop(t, "variant", 3, "solid"), p = e.prop(t, "size", 3, "md"), u = e.prop(t, "disabled", 3, !1), f = e.prop(t, "tui", 3, !1);
|
|
79
|
+
const m = fe(), v = e.derived(() => f() || m());
|
|
80
|
+
let D = e.state(void 0), r = e.state(1), k = e.state(1), A = e.state(0), o, h, C;
|
|
81
|
+
const c = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1;
|
|
82
|
+
e.user_effect(() => {
|
|
83
|
+
if (!c)
|
|
84
|
+
return o = ve(1, "snappy", (L) => e.set(r, L, !0)), h = ve(1, "snappy", (L) => e.set(k, L, !0)), C = ve(0, "gentle", (L) => e.set(A, L, !0)), () => {
|
|
85
|
+
o == null || o.stop(), h == null || h.stop(), C == null || C.stop();
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
function l() {
|
|
89
|
+
u() || c || (o == null || o.set(0.96), h == null || h.set(0.3));
|
|
90
|
+
}
|
|
91
|
+
function T() {
|
|
92
|
+
u() || c || (o == null || o.set(1), h == null || h.set(1));
|
|
93
|
+
}
|
|
94
|
+
function a() {
|
|
95
|
+
u() || c || (o == null || o.set(1), h == null || h.set(1));
|
|
96
|
+
}
|
|
97
|
+
function E() {
|
|
98
|
+
if (c) {
|
|
99
|
+
e.set(A, 1);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
C == null || C.set(1);
|
|
103
|
+
}
|
|
104
|
+
function q() {
|
|
105
|
+
if (c) {
|
|
106
|
+
e.set(A, 0);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
C == null || C.set(0);
|
|
110
|
+
}
|
|
111
|
+
var P = ze();
|
|
112
|
+
let F, ee;
|
|
113
|
+
var ie = e.child(P);
|
|
114
|
+
{
|
|
115
|
+
var re = (L) => {
|
|
116
|
+
var z = qe(), Y = e.sibling(e.first_child(z));
|
|
117
|
+
e.snippet(Y, () => t.children), e.next(), e.append(L, z);
|
|
118
|
+
}, O = (L) => {
|
|
119
|
+
var z = e.comment(), Y = e.first_child(z);
|
|
120
|
+
e.snippet(Y, () => t.children), e.append(L, z);
|
|
121
|
+
};
|
|
122
|
+
e.if(ie, (L) => {
|
|
123
|
+
e.get(v) ? L(re) : L(O, !1);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
e.reset(P), e.bind_this(P, (L) => e.set(D, L), () => e.get(D)), e.template_effect(() => {
|
|
127
|
+
F = e.set_class(P, 1, `btn btn-${w() ?? ""} btn-${p() ?? ""}`, "svelte-5blyfe", F, { disabled: u(), tui: e.get(v) }), P.disabled = u(), ee = e.set_style(P, "", ee, {
|
|
128
|
+
transform: e.get(v) ? void 0 : `scale(${e.get(r)})`,
|
|
129
|
+
"--shadow-depth": e.get(v) ? void 0 : e.get(k),
|
|
130
|
+
"--focus-opacity": e.get(A)
|
|
131
|
+
});
|
|
132
|
+
}), e.delegated("click", P, function(...L) {
|
|
133
|
+
var z;
|
|
134
|
+
(z = t.onclick) == null || z.apply(this, L);
|
|
135
|
+
}), e.delegated("pointerdown", P, l), e.delegated("pointerup", P, T), e.event("pointerleave", P, a), e.event("focus", P, E), e.event("blur", P, q), e.append(y, P), e.pop();
|
|
136
|
+
}
|
|
137
|
+
e.delegate(["click", "pointerdown", "pointerup"]);
|
|
138
|
+
var Ke = e.from_html('<span class="toggle-label svelte-197v0i2"> </span>'), Ge = e.from_html('<label><!> <div class="toggle-track svelte-197v0i2" role="switch"><div class="toggle-thumb svelte-197v0i2"></div></div></label>');
|
|
139
|
+
function gt(y, t) {
|
|
140
|
+
e.push(t, !0);
|
|
141
|
+
let w = e.prop(t, "checked", 15, !1), p = e.prop(t, "disabled", 3, !1), u = e.prop(t, "label", 3, ""), f = e.state(e.proxy(w() ? 1 : 0)), m = e.state(0);
|
|
142
|
+
const v = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1;
|
|
143
|
+
let D, r;
|
|
144
|
+
e.user_effect(() => {
|
|
145
|
+
if (!v)
|
|
146
|
+
return D = ve(w() ? 1 : 0, "snappy", (a) => e.set(f, a, !0)), r = ve(0, "gentle", (a) => e.set(m, a, !0)), () => {
|
|
147
|
+
D == null || D.stop(), r == null || r.stop();
|
|
148
|
+
};
|
|
149
|
+
}), e.user_effect(() => {
|
|
150
|
+
v ? e.set(f, w() ? 1 : 0, !0) : D == null || D.set(w() ? 1 : 0);
|
|
151
|
+
});
|
|
152
|
+
function k() {
|
|
153
|
+
var a;
|
|
154
|
+
p() || (w(!w()), (a = t.onchange) == null || a.call(t, w()));
|
|
155
|
+
}
|
|
156
|
+
function A(a) {
|
|
157
|
+
(a.key === " " || a.key === "Enter") && (a.preventDefault(), k());
|
|
158
|
+
}
|
|
159
|
+
var o = Ge();
|
|
160
|
+
let h;
|
|
161
|
+
var C = e.child(o);
|
|
162
|
+
{
|
|
163
|
+
var c = (a) => {
|
|
164
|
+
var E = Ke(), q = e.child(E, !0);
|
|
165
|
+
e.reset(E), e.template_effect(() => e.set_text(q, u())), e.append(a, E);
|
|
166
|
+
};
|
|
167
|
+
e.if(C, (a) => {
|
|
168
|
+
u() && a(c);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
var l = e.sibling(C, 2);
|
|
172
|
+
let T;
|
|
173
|
+
e.reset(o), e.template_effect(
|
|
174
|
+
(a) => {
|
|
175
|
+
h = e.set_class(o, 1, "toggle-wrapper svelte-197v0i2", null, h, { disabled: p() }), e.set_attribute(l, "aria-checked", w()), e.set_attribute(l, "tabindex", p() ? -1 : 0), T = e.set_style(l, "", T, a);
|
|
176
|
+
},
|
|
177
|
+
[
|
|
178
|
+
() => ({
|
|
179
|
+
"--thumb-x": e.get(f),
|
|
180
|
+
"--track-color": `color-mix(in srgb, var(--color-accent, #6366f1) ${Math.round(e.get(f) * 100)}%, var(--surface-2, #2a2a2a) ${Math.round((1 - e.get(f)) * 100)}%)`,
|
|
181
|
+
"--focus-opacity": e.get(m)
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
), e.delegated("click", l, k), e.delegated("keydown", l, A), e.event("focus", l, () => v ? e.set(m, 1) : r == null ? void 0 : r.set(1)), e.event("blur", l, () => v ? e.set(m, 0) : r == null ? void 0 : r.set(0)), e.append(y, o), e.pop();
|
|
185
|
+
}
|
|
186
|
+
e.delegate(["click", "keydown"]);
|
|
187
|
+
var Je = 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>'), Oe = e.from_html('<div class="glass svelte-1ps7oei"><!></div>');
|
|
188
|
+
function ht(y, t) {
|
|
189
|
+
e.push(t, !0);
|
|
190
|
+
let w = e.prop(t, "blur", 3, 20), p = e.prop(t, "opacity", 3, 0.6), u = e.prop(t, "radius", 3, "var(--radius-md, 10px)"), f = e.prop(t, "padding", 3, "var(--space-4, 16px)"), m = e.prop(t, "tui", 3, !1), v = e.prop(t, "cols", 3, 20);
|
|
191
|
+
const D = fe(), r = e.derived(() => m() || D()), k = e.derived(() => "═".repeat(v()));
|
|
192
|
+
var A = e.comment(), o = e.first_child(A);
|
|
193
|
+
{
|
|
194
|
+
var h = (c) => {
|
|
195
|
+
var l = Je();
|
|
196
|
+
let T;
|
|
197
|
+
var a = e.child(l), E = e.child(a);
|
|
198
|
+
e.reset(a);
|
|
199
|
+
var q = e.sibling(a, 2), P = e.sibling(e.child(q), 2), F = e.child(P);
|
|
200
|
+
e.snippet(F, () => t.children), e.reset(P), e.next(2), e.reset(q);
|
|
201
|
+
var ee = e.sibling(q, 2), ie = e.child(ee);
|
|
202
|
+
e.reset(ee), e.reset(l), e.template_effect(() => {
|
|
203
|
+
T = e.set_style(l, "", T, { padding: f() }), e.set_text(E, `╔${e.get(k) ?? ""}╗`), e.set_text(ie, `╚${e.get(k) ?? ""}╝`);
|
|
204
|
+
}), e.append(c, l);
|
|
205
|
+
}, C = (c) => {
|
|
206
|
+
var l = Oe();
|
|
207
|
+
let T;
|
|
208
|
+
var a = e.child(l);
|
|
209
|
+
e.snippet(a, () => t.children), e.reset(l), e.template_effect(() => T = e.set_style(l, "", T, {
|
|
210
|
+
"--blur": `${w() ?? ""}px`,
|
|
211
|
+
"--bg-opacity": p(),
|
|
212
|
+
"border-radius": u(),
|
|
213
|
+
padding: f()
|
|
214
|
+
})), e.append(c, l);
|
|
215
|
+
};
|
|
216
|
+
e.if(o, (c) => {
|
|
217
|
+
e.get(r) ? c(h) : c(C, !1);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
e.append(y, A), e.pop();
|
|
221
|
+
}
|
|
222
|
+
var je = 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>'), Qe = 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>'), We = 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>'), Xe = e.from_html('<span class="chat-gui__msg-time svelte-10e5u2c"> </span>'), Ye = 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>'), Ze = e.from_html('<button class="chat-gui__indicator svelte-10e5u2c" aria-live="polite" aria-label="Jump to latest messages"> </button>'), $e = 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>');
|
|
223
|
+
function ft(y, t) {
|
|
224
|
+
e.push(t, !0);
|
|
225
|
+
let w = e.prop(t, "tui", 3, !1), p = e.prop(t, "showTimestamps", 3, !0), u = e.prop(t, "class", 3, "");
|
|
226
|
+
const f = fe(), m = e.derived(() => w() || f());
|
|
227
|
+
Ve(() => e.get(m));
|
|
228
|
+
let v = e.state(void 0), D = e.state(void 0), r = e.state(!0), k = e.state(0), A = e.state(0), o = e.state(0);
|
|
229
|
+
e.user_effect(() => {
|
|
230
|
+
const i = t.messages.length;
|
|
231
|
+
if (i !== e.get(o)) {
|
|
232
|
+
const B = i - e.get(o);
|
|
233
|
+
e.set(o, i, !0), e.get(r) ? (e.set(k, 0), e.set(A, i, !0), h()) : B > 0 && e.set(k, e.get(k) + B);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
function h() {
|
|
237
|
+
typeof requestAnimationFrame < "u" && requestAnimationFrame(() => C());
|
|
238
|
+
}
|
|
239
|
+
function C() {
|
|
240
|
+
e.get(v) && (e.get(v).scrollTop = e.get(v).scrollHeight);
|
|
241
|
+
}
|
|
242
|
+
function c() {
|
|
243
|
+
var i;
|
|
244
|
+
e.set(r, !0), e.set(k, 0), e.set(A, t.messages.length, !0), C(), (i = t.onscrolltolatest) == null || i.call(t);
|
|
245
|
+
}
|
|
246
|
+
function l() {
|
|
247
|
+
if (!e.get(v)) return;
|
|
248
|
+
const { scrollTop: i, scrollHeight: B, clientHeight: K } = e.get(v), s = B - i - K, d = e.get(r);
|
|
249
|
+
e.set(
|
|
250
|
+
r,
|
|
251
|
+
s < 8
|
|
252
|
+
// 8px tolerance
|
|
253
|
+
), e.get(r) && !d && (e.set(k, 0), e.set(A, t.messages.length, !0));
|
|
254
|
+
}
|
|
255
|
+
function T(i) {
|
|
256
|
+
if (!e.get(v)) return;
|
|
257
|
+
const { clientHeight: B } = e.get(v);
|
|
258
|
+
switch (i.key) {
|
|
259
|
+
case "PageUp":
|
|
260
|
+
i.preventDefault(), e.get(v).scrollBy({ top: -B, behavior: "smooth" });
|
|
261
|
+
break;
|
|
262
|
+
case "PageDown":
|
|
263
|
+
i.preventDefault(), e.get(v).scrollBy({ top: B, behavior: "smooth" });
|
|
264
|
+
break;
|
|
265
|
+
case "Home":
|
|
266
|
+
i.preventDefault(), e.get(v).scrollTo({ top: 0, behavior: "smooth" });
|
|
267
|
+
break;
|
|
268
|
+
case "End":
|
|
269
|
+
i.preventDefault(), C();
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
let a = e.state(0);
|
|
274
|
+
const E = 10, q = e.derived(() => e.get(a) >= Math.max(0, t.messages.length - E)), P = e.derived(() => e.get(q) ? 0 : Math.max(0, t.messages.length - (e.get(a) + E))), F = e.derived(() => t.messages.slice(e.get(a), e.get(a) + E));
|
|
275
|
+
e.user_effect(() => {
|
|
276
|
+
e.get(m) && e.get(q) && e.set(a, Math.max(0, t.messages.length - E), !0);
|
|
277
|
+
});
|
|
278
|
+
function ee() {
|
|
279
|
+
e.set(a, Math.max(0, e.get(a) - 1), !0);
|
|
280
|
+
}
|
|
281
|
+
function ie() {
|
|
282
|
+
e.set(a, Math.min(Math.max(0, t.messages.length - E), e.get(a) + 1), !0);
|
|
283
|
+
}
|
|
284
|
+
function re() {
|
|
285
|
+
e.set(a, Math.max(0, e.get(a) - E), !0);
|
|
286
|
+
}
|
|
287
|
+
function O() {
|
|
288
|
+
e.set(a, Math.min(Math.max(0, t.messages.length - E), e.get(a) + E), !0);
|
|
289
|
+
}
|
|
290
|
+
function L() {
|
|
291
|
+
e.set(a, 0);
|
|
292
|
+
}
|
|
293
|
+
function z() {
|
|
294
|
+
e.set(a, Math.max(0, t.messages.length - E), !0);
|
|
295
|
+
}
|
|
296
|
+
function Y() {
|
|
297
|
+
var i;
|
|
298
|
+
z(), (i = t.onscrolltolatest) == null || i.call(t);
|
|
299
|
+
}
|
|
300
|
+
function _e(i) {
|
|
301
|
+
switch (i.key) {
|
|
302
|
+
case "ArrowUp":
|
|
303
|
+
i.preventDefault(), ee();
|
|
304
|
+
break;
|
|
305
|
+
case "ArrowDown":
|
|
306
|
+
i.preventDefault(), ie();
|
|
307
|
+
break;
|
|
308
|
+
case "PageUp":
|
|
309
|
+
i.preventDefault(), re();
|
|
310
|
+
break;
|
|
311
|
+
case "PageDown":
|
|
312
|
+
i.preventDefault(), O();
|
|
313
|
+
break;
|
|
314
|
+
case "Home":
|
|
315
|
+
i.preventDefault(), L();
|
|
316
|
+
break;
|
|
317
|
+
case "End":
|
|
318
|
+
i.preventDefault(), z();
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
function oe(i) {
|
|
323
|
+
return i.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
324
|
+
}
|
|
325
|
+
function le(i) {
|
|
326
|
+
return p() ? `${i.author} · ${oe(i.timestamp)}` : i.author;
|
|
327
|
+
}
|
|
328
|
+
var ce = e.comment(), ge = e.first_child(ce);
|
|
329
|
+
{
|
|
330
|
+
var pe = (i) => {
|
|
331
|
+
var B = We(), K = e.child(B);
|
|
332
|
+
K.textContent = `┌─ Chat ${"─".repeat(38) ?? ""}┐`;
|
|
333
|
+
var s = e.sibling(K, 2), d = e.sibling(e.child(s), 2), x = e.child(d);
|
|
334
|
+
e.each(x, 17, () => e.get(F), (g) => g.id, (g, b) => {
|
|
335
|
+
const I = e.derived(() => le(e.get(b))), S = e.derived(() => 38), H = e.derived(() => `╭─ ${e.get(I)} ${"─".repeat(Math.max(0, e.get(S) - e.get(I).length - 3))}╮`), te = e.derived(() => `╰${"─".repeat(e.get(S) + 1)}╯`);
|
|
336
|
+
var Z = je();
|
|
337
|
+
let V;
|
|
338
|
+
var Q = e.child(Z), se = e.child(Q, !0);
|
|
339
|
+
e.reset(Q);
|
|
340
|
+
var j = e.sibling(Q, 2), W = e.sibling(e.child(j), 2), X = e.child(W, !0);
|
|
341
|
+
e.reset(W), e.next(2), e.reset(j);
|
|
342
|
+
var R = e.sibling(j, 2), ae = e.child(R, !0);
|
|
343
|
+
e.reset(R), e.reset(Z), e.template_effect(() => {
|
|
344
|
+
V = e.set_class(Z, 1, "chat-tui__msg svelte-10e5u2c", null, V, {
|
|
345
|
+
"chat-tui__msg--user": e.get(b).type === "user",
|
|
346
|
+
"chat-tui__msg--system": e.get(b).type === "system"
|
|
347
|
+
}), e.set_text(se, e.get(H)), e.set_text(X, e.get(b).content), e.set_text(ae, e.get(te));
|
|
348
|
+
}), e.append(g, Z);
|
|
349
|
+
});
|
|
350
|
+
var _ = e.sibling(x, 2);
|
|
351
|
+
{
|
|
352
|
+
var n = (g) => {
|
|
353
|
+
var b = Qe(), I = e.child(b), S = e.child(I);
|
|
354
|
+
e.reset(I), e.reset(b), e.template_effect(() => e.set_text(S, `▼ ${e.get(P) ?? ""} new ${e.get(P) === 1 ? "message" : "messages"}`)), e.delegated("click", I, Y), e.delegated("keydown", I, (H) => (H.key === "Enter" || H.key === " ") && Y()), e.append(g, b);
|
|
355
|
+
};
|
|
356
|
+
e.if(_, (g) => {
|
|
357
|
+
e.get(P) > 0 && g(n);
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
e.reset(d), e.next(2), e.reset(s);
|
|
361
|
+
var M = e.sibling(s, 2);
|
|
362
|
+
M.textContent = `└${"─".repeat(40) ?? ""}┘`, e.reset(B), e.template_effect(() => e.set_class(B, 1, `chat-tui ${u() ?? ""}`, "svelte-10e5u2c")), e.delegated("keydown", B, _e), e.append(i, B);
|
|
363
|
+
}, he = (i) => {
|
|
364
|
+
var B = $e(), K = e.child(B), s = e.child(K), d = e.child(s);
|
|
365
|
+
e.each(d, 17, () => t.messages, (M) => M.id, (M, g) => {
|
|
366
|
+
var b = Ye();
|
|
367
|
+
let I;
|
|
368
|
+
var S = e.child(b), H = e.child(S), te = e.child(H, !0);
|
|
369
|
+
e.reset(H);
|
|
370
|
+
var Z = e.sibling(H, 2);
|
|
371
|
+
{
|
|
372
|
+
var V = (j) => {
|
|
373
|
+
var W = Xe(), X = e.child(W, !0);
|
|
374
|
+
e.reset(W), e.template_effect((R) => e.set_text(X, R), [() => oe(e.get(g).timestamp)]), e.append(j, W);
|
|
375
|
+
};
|
|
376
|
+
e.if(Z, (j) => {
|
|
377
|
+
p() && j(V);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
e.reset(S);
|
|
381
|
+
var Q = e.sibling(S, 2), se = e.child(Q, !0);
|
|
382
|
+
e.reset(Q), e.reset(b), e.template_effect(() => {
|
|
383
|
+
I = e.set_class(b, 1, "chat-gui__msg svelte-10e5u2c", null, I, {
|
|
384
|
+
"chat-gui__msg--user": e.get(g).type === "user",
|
|
385
|
+
"chat-gui__msg--agent": e.get(g).type === "agent",
|
|
386
|
+
"chat-gui__msg--system": e.get(g).type === "system"
|
|
387
|
+
}), e.set_text(te, e.get(g).author), e.set_text(se, e.get(g).content);
|
|
388
|
+
}), e.append(M, b);
|
|
389
|
+
});
|
|
390
|
+
var x = e.sibling(d, 2);
|
|
391
|
+
e.bind_this(x, (M) => e.set(D, M), () => e.get(D)), e.reset(s), e.reset(K), e.bind_this(K, (M) => e.set(v, M), () => e.get(v));
|
|
392
|
+
var _ = e.sibling(K, 2);
|
|
393
|
+
{
|
|
394
|
+
var n = (M) => {
|
|
395
|
+
var g = Ze(), b = e.child(g);
|
|
396
|
+
e.reset(g), e.template_effect(() => e.set_text(b, `▼ ${e.get(k) ?? ""} new ${e.get(k) === 1 ? "message" : "messages"}`)), e.delegated("click", g, c), e.append(M, g);
|
|
397
|
+
};
|
|
398
|
+
e.if(_, (M) => {
|
|
399
|
+
e.get(k) > 0 && !e.get(r) && M(n);
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
e.reset(B), e.template_effect(() => e.set_class(B, 1, `chat-gui ${u() ?? ""}`, "svelte-10e5u2c")), e.event("scroll", K, l), e.delegated("keydown", K, T), e.append(i, B);
|
|
403
|
+
};
|
|
404
|
+
e.if(ge, (i) => {
|
|
405
|
+
e.get(m) ? i(pe) : i(he, !1);
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
e.append(y, ce), e.pop();
|
|
409
|
+
}
|
|
410
|
+
e.delegate(["keydown", "click"]);
|
|
411
|
+
var et = e.from_html(' <span class="search-tui__cursor svelte-1xnd4ea">█</span> ', 1), tt = e.from_html('<span class="search-tui__result-gap svelte-1xnd4ea"> </span> <span class="search-tui__result-score svelte-1xnd4ea"> </span>', 1), st = 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>'), at = e.from_html('<div class="search-tui__separator svelte-1xnd4ea"> </div> <div role="listbox" aria-label="Search suggestions" class="svelte-1xnd4ea"></div>', 1), it = 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>'), lt = e.from_html('<mark class="search-gui__highlight svelte-1xnd4ea"> </mark>'), nt = e.from_html('<span class="search-gui__score svelte-1xnd4ea"> </span>'), rt = e.from_html('<li role="option" tabindex="-1"><span class="search-gui__option-text svelte-1xnd4ea"></span> <!></li>'), ot = e.from_html('<ul class="search-gui__dropdown svelte-1xnd4ea" role="listbox" aria-label="Search suggestions"></ul>'), ct = 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>');
|
|
412
|
+
function pt(y, t) {
|
|
413
|
+
e.push(t, !0);
|
|
414
|
+
let w = e.prop(t, "tui", 3, !1), p = e.prop(t, "value", 15, ""), u = e.prop(t, "placeholder", 3, "Search..."), f = e.prop(t, "maxSuggestions", 3, 8), m = e.prop(t, "debounceMs", 3, 100), v = e.prop(t, "showScores", 3, !0), D = e.prop(t, "class", 3, ""), r = e.prop(t, "cols", 3, 48);
|
|
415
|
+
const k = fe(), A = e.derived(() => w() || k());
|
|
416
|
+
let o = e.state(void 0), h = e.state(!1), C = e.state(0), c = e.state(e.proxy([])), l = e.state(-1), T = e.state(!1);
|
|
417
|
+
function a() {
|
|
418
|
+
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
419
|
+
return `search-listbox-${crypto.randomUUID()}`;
|
|
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)}`;
|
|
423
|
+
}
|
|
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
|
+
});
|
|
447
|
+
function L(s, d) {
|
|
448
|
+
const x = d === e.get(l) ? "› " : " ";
|
|
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
|
+
}
|
|
456
|
+
}
|
|
457
|
+
async function z(s) {
|
|
458
|
+
if (!s.trim()) {
|
|
459
|
+
e.set(c, [], !0), e.set(T, !1), e.set(l, -1);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
try {
|
|
463
|
+
const d = await t.onSearch(s);
|
|
464
|
+
e.set(c, d.slice(0, f()), !0), e.set(l, -1), e.set(T, e.get(c).length > 0);
|
|
465
|
+
} catch {
|
|
466
|
+
e.set(c, [], !0), e.set(T, !1);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
function Y(s) {
|
|
470
|
+
p(s.text), e.set(c, [], !0), e.set(T, !1), e.set(l, -1), t.onSelect(s);
|
|
471
|
+
}
|
|
472
|
+
function _e(s) {
|
|
473
|
+
const d = s.target;
|
|
474
|
+
p(d.value), le(), clearTimeout(q), q = setTimeout(() => z(p() ?? ""), m());
|
|
475
|
+
}
|
|
476
|
+
function oe(s) {
|
|
477
|
+
s.key === "ArrowDown" ? (s.preventDefault(), e.get(c).length > 0 && e.set(l, Math.min(e.get(l) + 1, e.get(c).length - 1), !0)) : s.key === "ArrowUp" ? (s.preventDefault(), e.get(c).length > 0 && e.set(l, Math.max(e.get(l) - 1, -1), !0)) : s.key === "Enter" ? (s.preventDefault(), e.get(l) >= 0 && e.get(l) < e.get(c).length && Y(e.get(c)[e.get(l)])) : s.key === "Escape" && (e.set(c, [], !0), e.set(T, !1), e.set(l, -1)), le();
|
|
478
|
+
}
|
|
479
|
+
function le() {
|
|
480
|
+
const s = e.get(o);
|
|
481
|
+
s && (typeof queueMicrotask < "u" ? queueMicrotask(() => {
|
|
482
|
+
e.set(C, s.selectionStart ?? (p() ?? "").length, !0);
|
|
483
|
+
}) : e.set(C, s.selectionStart ?? (p() ?? "").length, !0));
|
|
484
|
+
}
|
|
485
|
+
function ce() {
|
|
486
|
+
e.set(h, !0), le(), (p() ?? "").trim() && e.get(c).length > 0 && e.set(T, !0);
|
|
487
|
+
}
|
|
488
|
+
function ge() {
|
|
489
|
+
e.set(h, !1), setTimeout(
|
|
490
|
+
() => {
|
|
491
|
+
e.set(T, !1);
|
|
492
|
+
},
|
|
493
|
+
150
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
function pe(s, d) {
|
|
497
|
+
if (!d.trim()) return [{ text: s, match: !1 }];
|
|
498
|
+
const x = s.toLowerCase(), _ = d.trim().toLowerCase(), n = x.indexOf(_);
|
|
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
|
+
];
|
|
504
|
+
}
|
|
505
|
+
var he = e.comment(), i = e.first_child(he);
|
|
506
|
+
{
|
|
507
|
+
var B = (s) => {
|
|
508
|
+
var d = it();
|
|
509
|
+
let x;
|
|
510
|
+
var _ = e.child(d);
|
|
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);
|
|
519
|
+
{
|
|
520
|
+
var Z = (U) => {
|
|
521
|
+
var G = e.text();
|
|
522
|
+
e.template_effect(() => e.set_text(G, e.get(O).text)), e.append(U, G);
|
|
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);
|
|
531
|
+
};
|
|
532
|
+
e.if(te, (U) => {
|
|
533
|
+
e.get(O).kind === "placeholder" ? U(Z) : e.get(O).kind === "text" ? U(V, 1) : U(Q, !1);
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
e.reset(S);
|
|
537
|
+
var se = e.sibling(S, 2);
|
|
538
|
+
let j;
|
|
539
|
+
e.reset(g);
|
|
540
|
+
var W = e.sibling(g, 2);
|
|
541
|
+
{
|
|
542
|
+
var X = (U) => {
|
|
543
|
+
var G = at(), J = e.first_child(G), $ = e.child(J, !0);
|
|
544
|
+
e.reset(J);
|
|
545
|
+
var de = e.sibling(J, 2);
|
|
546
|
+
e.each(de, 21, () => e.get(c), e.index, (Pe, ke, me) => {
|
|
547
|
+
const ue = e.derived(() => L(e.get(ke), me));
|
|
548
|
+
var ne = st();
|
|
549
|
+
let Te;
|
|
550
|
+
var Me = e.sibling(e.child(ne), 2), xe = e.child(Me), Le = e.child(xe, !0);
|
|
551
|
+
e.reset(xe);
|
|
552
|
+
var be = e.sibling(xe, 2), Be = e.child(be, !0);
|
|
553
|
+
e.reset(be);
|
|
554
|
+
var Ae = e.sibling(be, 2);
|
|
555
|
+
{
|
|
556
|
+
var Fe = (ye) => {
|
|
557
|
+
var De = tt(), we = e.first_child(De), Ie = e.child(we, !0);
|
|
558
|
+
e.reset(we);
|
|
559
|
+
var Ce = e.sibling(we, 2), Ue = e.child(Ce, !0);
|
|
560
|
+
e.reset(Ce), e.template_effect(() => {
|
|
561
|
+
e.set_text(Ie, e.get(ue).gap), e.set_text(Ue, e.get(ue).score);
|
|
562
|
+
}), e.append(ye, De);
|
|
563
|
+
};
|
|
564
|
+
e.if(Ae, (ye) => {
|
|
565
|
+
e.get(ue).score && ye(Fe);
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
e.reset(Me), e.next(2), e.reset(ne), e.template_effect(() => {
|
|
569
|
+
Te = e.set_class(ne, 1, "search-tui__result svelte-1xnd4ea", null, Te, { "search-tui__result--selected": me === e.get(l) }), e.set_attribute(ne, "aria-selected", me === e.get(l)), e.set_text(Le, e.get(ue).prefix), e.set_text(Be, e.get(ue).text);
|
|
570
|
+
}), e.delegated("mousedown", ne, () => Y(e.get(ke))), e.append(Pe, ne);
|
|
571
|
+
}), e.reset(de), e.template_effect(() => {
|
|
572
|
+
e.set_text($, e.get(ie)), e.set_attribute(de, "id", E);
|
|
573
|
+
}), e.append(U, G);
|
|
574
|
+
};
|
|
575
|
+
e.if(W, (U) => {
|
|
576
|
+
e.get(T) && e.get(c).length > 0 && U(X);
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
var R = e.sibling(W, 2), ae = e.child(R, !0);
|
|
580
|
+
e.reset(R);
|
|
581
|
+
var N = e.sibling(R, 2);
|
|
582
|
+
e.remove_input_defaults(N), e.bind_this(N, (U) => e.set(o, U), () => e.get(o)), e.reset(d), e.template_effect(() => {
|
|
583
|
+
x = e.set_class(d, 1, `search-tui ${D() ?? ""}`, "svelte-1xnd4ea", x, { focused: e.get(h) }), n = e.set_class(_, 1, "search-tui__top svelte-1xnd4ea", null, n, { focused: e.get(h) }), e.set_text(M, e.get(ee)), I = e.set_class(b, 1, "search-tui__side svelte-1xnd4ea", null, I, { focused: e.get(h) }), H = e.set_class(S, 1, "search-tui__content svelte-1xnd4ea", null, H, {
|
|
584
|
+
"search-tui__content--placeholder": e.get(O).kind === "placeholder"
|
|
585
|
+
}), j = e.set_class(se, 1, "search-tui__side svelte-1xnd4ea", null, j, { focused: e.get(h) }), e.set_text(ae, e.get(re)), e.set_value(N, p()), e.set_attribute(N, "aria-controls", E), e.set_attribute(N, "aria-expanded", e.get(T));
|
|
586
|
+
}), e.delegated("input", N, _e), e.delegated("keydown", N, oe), e.event("focus", N, ce), e.event("blur", N, ge), e.delegated("click", N, le), e.event("select", N, le), e.append(s, d);
|
|
587
|
+
}, K = (s) => {
|
|
588
|
+
var d = ct(), x = e.child(d);
|
|
589
|
+
let _;
|
|
590
|
+
var n = e.sibling(e.child(x), 2);
|
|
591
|
+
e.remove_input_defaults(n), e.bind_this(n, (b) => e.set(o, b), () => e.get(o)), e.reset(x);
|
|
592
|
+
var M = e.sibling(x, 2);
|
|
593
|
+
{
|
|
594
|
+
var g = (b) => {
|
|
595
|
+
var I = ot();
|
|
596
|
+
e.each(I, 21, () => e.get(c), e.index, (S, H, te) => {
|
|
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);
|
|
631
|
+
};
|
|
632
|
+
e.if(M, (b) => {
|
|
633
|
+
e.get(T) && e.get(c).length > 0 && b(g);
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
e.reset(d), e.template_effect(() => {
|
|
637
|
+
e.set_class(d, 1, `search-gui ${D() ?? ""}`, "svelte-1xnd4ea"), _ = e.set_class(x, 1, "search-gui__field svelte-1xnd4ea", null, _, { "search-gui__field--focused": e.get(h) }), e.set_value(n, p()), e.set_attribute(n, "placeholder", u()), e.set_attribute(n, "aria-controls", E), e.set_attribute(n, "aria-expanded", e.get(T));
|
|
638
|
+
}), e.delegated("input", n, _e), e.delegated("keydown", n, oe), e.event("focus", n, ce), e.event("blur", n, ge), e.append(s, d);
|
|
639
|
+
};
|
|
640
|
+
e.if(i, (s) => {
|
|
641
|
+
e.get(A) ? s(B) : s(K, !1);
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
e.append(y, he), e.pop();
|
|
645
|
+
}
|
|
646
|
+
e.delegate(["mousedown", "input", "keydown", "click"]);
|
|
647
|
+
var dt = e.from_html('<span aria-hidden="true"></span>');
|
|
648
|
+
function mt(y, t) {
|
|
649
|
+
let w = e.prop(t, "size", 3, 16), p = e.prop(t, "color", 3, "currentColor"), u = e.prop(t, "class", 3, "");
|
|
650
|
+
var f = dt();
|
|
651
|
+
let m;
|
|
652
|
+
e.template_effect(() => {
|
|
653
|
+
e.set_class(f, 1, `nf ${t.icon ?? ""} ${u() ?? ""}`, "svelte-81k4o2"), m = e.set_style(f, "", m, {
|
|
654
|
+
"font-size": `${w() ?? ""}px`,
|
|
655
|
+
color: p(),
|
|
656
|
+
"line-height": `${w() ?? ""}px`
|
|
657
|
+
});
|
|
658
|
+
}), e.append(y, f);
|
|
659
|
+
}
|
|
660
|
+
export {
|
|
661
|
+
_t as Button,
|
|
662
|
+
ft as ChatPane,
|
|
663
|
+
ht as GlassPanel,
|
|
664
|
+
mt as NerdFont,
|
|
665
|
+
pt as SearchInput,
|
|
666
|
+
gt as Toggle,
|
|
667
|
+
Ve as provideTui,
|
|
668
|
+
fe as useTui
|
|
669
|
+
};
|