@inkandswitch/patchwork-pkg-base 0.0.83 → 0.0.84

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.
@@ -1 +1 @@
1
- automerge:4PUzLD3ZNUa5LVxrMnJe5DWMRY6w
1
+ automerge:X1t4YsLJTr9aK6HwEW5rbRNs7se
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkandswitch/patchwork-pkg-base",
3
- "version": "0.0.83",
3
+ "version": "0.0.84",
4
4
  "type": "module",
5
5
  "description": "Base packages for the Patchwork system",
6
6
  "repository": {
@@ -0,0 +1,600 @@
1
+ const be = (e, t) => e === t, H = {
2
+ equals: be
3
+ };
4
+ let fe = pe;
5
+ const E = 1, B = 2, ue = {
6
+ owned: null,
7
+ cleanups: null,
8
+ context: null,
9
+ owner: null
10
+ };
11
+ var a = null;
12
+ let F = null, xe = null, u = null, m = null, x = null, I = 0;
13
+ function ae(e, t) {
14
+ const n = u, o = a, i = e.length === 0, l = t === void 0 ? o : t, r = i ? ue : {
15
+ owned: null,
16
+ cleanups: null,
17
+ context: l ? l.context : null,
18
+ owner: l
19
+ }, s = i ? e : () => e(() => C(() => N(r)));
20
+ a = r, u = null;
21
+ try {
22
+ return T(s, !0);
23
+ } finally {
24
+ u = n, a = o;
25
+ }
26
+ }
27
+ function $(e, t) {
28
+ t = t ? Object.assign({}, H, t) : H;
29
+ const n = {
30
+ value: e,
31
+ observers: null,
32
+ observerSlots: null,
33
+ comparator: t.equals || void 0
34
+ }, o = (i) => (typeof i == "function" && (i = i(n.value)), he(n, i));
35
+ return [de.bind(n), o];
36
+ }
37
+ function D(e, t, n) {
38
+ const o = K(e, t, !1, E);
39
+ L(o);
40
+ }
41
+ function Ee(e, t, n) {
42
+ fe = Te;
43
+ const o = K(e, t, !1, E);
44
+ n || (o.user = !0), x ? x.push(o) : L(o);
45
+ }
46
+ function _(e, t, n) {
47
+ n = n ? Object.assign({}, H, n) : H;
48
+ const o = K(e, t, !0, 0);
49
+ return o.observers = null, o.observerSlots = null, o.comparator = n.equals || void 0, L(o), de.bind(o);
50
+ }
51
+ function C(e) {
52
+ if (u === null) return e();
53
+ const t = u;
54
+ u = null;
55
+ try {
56
+ return e();
57
+ } finally {
58
+ u = t;
59
+ }
60
+ }
61
+ function ie(e) {
62
+ return a === null || (a.cleanups === null ? a.cleanups = [e] : a.cleanups.push(e)), e;
63
+ }
64
+ function Se() {
65
+ return a;
66
+ }
67
+ function Ce(e, t) {
68
+ const n = a, o = u;
69
+ a = e, u = null;
70
+ try {
71
+ return T(t, !0);
72
+ } catch (i) {
73
+ Q(i);
74
+ } finally {
75
+ a = n, u = o;
76
+ }
77
+ }
78
+ function de() {
79
+ if (this.sources && this.state)
80
+ if (this.state === E) L(this);
81
+ else {
82
+ const e = m;
83
+ m = null, T(() => V(this), !1), m = e;
84
+ }
85
+ if (u) {
86
+ const e = this.observers;
87
+ if (!e || e[e.length - 1] !== u) {
88
+ const t = e ? e.length : 0;
89
+ u.sources ? (u.sources.push(this), u.sourceSlots.push(t)) : (u.sources = [this], u.sourceSlots = [t]), e ? (e.push(u), this.observerSlots.push(u.sources.length - 1)) : (this.observers = [u], this.observerSlots = [u.sources.length - 1]);
90
+ }
91
+ }
92
+ return this.value;
93
+ }
94
+ function he(e, t, n) {
95
+ let o = e.value;
96
+ return (!e.comparator || !e.comparator(o, t)) && (e.value = t, e.observers && e.observers.length && T(() => {
97
+ for (let i = 0; i < e.observers.length; i += 1) {
98
+ const l = e.observers[i], r = F && F.running;
99
+ r && F.disposed.has(l), (r ? !l.tState : !l.state) && (l.pure ? m.push(l) : x.push(l), l.observers && ge(l)), r || (l.state = E);
100
+ }
101
+ if (m.length > 1e6)
102
+ throw m = [], new Error();
103
+ }, !1)), t;
104
+ }
105
+ function L(e) {
106
+ if (!e.fn) return;
107
+ N(e);
108
+ const t = I;
109
+ Ae(e, e.value, t);
110
+ }
111
+ function Ae(e, t, n) {
112
+ let o;
113
+ const i = a, l = u;
114
+ u = a = e;
115
+ try {
116
+ o = e.fn(t);
117
+ } catch (r) {
118
+ return e.pure && (e.state = E, e.owned && e.owned.forEach(N), e.owned = null), e.updatedAt = n + 1, Q(r);
119
+ } finally {
120
+ u = l, a = i;
121
+ }
122
+ (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? he(e, o) : e.value = o, e.updatedAt = n);
123
+ }
124
+ function K(e, t, n, o = E, i) {
125
+ const l = {
126
+ fn: e,
127
+ state: o,
128
+ updatedAt: null,
129
+ owned: null,
130
+ sources: null,
131
+ sourceSlots: null,
132
+ cleanups: null,
133
+ value: t,
134
+ owner: a,
135
+ context: a ? a.context : null,
136
+ pure: n
137
+ };
138
+ return a === null || a !== ue && (a.owned ? a.owned.push(l) : a.owned = [l]), l;
139
+ }
140
+ function U(e) {
141
+ if (e.state === 0) return;
142
+ if (e.state === B) return V(e);
143
+ if (e.suspense && C(e.suspense.inFallback)) return e.suspense.effects.push(e);
144
+ const t = [e];
145
+ for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < I); )
146
+ e.state && t.push(e);
147
+ for (let n = t.length - 1; n >= 0; n--)
148
+ if (e = t[n], e.state === E)
149
+ L(e);
150
+ else if (e.state === B) {
151
+ const o = m;
152
+ m = null, T(() => V(e, t[0]), !1), m = o;
153
+ }
154
+ }
155
+ function T(e, t) {
156
+ if (m) return e();
157
+ let n = !1;
158
+ t || (m = []), x ? n = !0 : x = [], I++;
159
+ try {
160
+ const o = e();
161
+ return ke(n), o;
162
+ } catch (o) {
163
+ n || (x = null), m = null, Q(o);
164
+ }
165
+ }
166
+ function ke(e) {
167
+ if (m && (pe(m), m = null), e) return;
168
+ const t = x;
169
+ x = null, t.length && T(() => fe(t), !1);
170
+ }
171
+ function pe(e) {
172
+ for (let t = 0; t < e.length; t++) U(e[t]);
173
+ }
174
+ function Te(e) {
175
+ let t, n = 0;
176
+ for (t = 0; t < e.length; t++) {
177
+ const o = e[t];
178
+ o.user ? e[n++] = o : U(o);
179
+ }
180
+ for (t = 0; t < n; t++) U(e[t]);
181
+ }
182
+ function V(e, t) {
183
+ e.state = 0;
184
+ for (let n = 0; n < e.sources.length; n += 1) {
185
+ const o = e.sources[n];
186
+ if (o.sources) {
187
+ const i = o.state;
188
+ i === E ? o !== t && (!o.updatedAt || o.updatedAt < I) && U(o) : i === B && V(o, t);
189
+ }
190
+ }
191
+ }
192
+ function ge(e) {
193
+ for (let t = 0; t < e.observers.length; t += 1) {
194
+ const n = e.observers[t];
195
+ n.state || (n.state = B, n.pure ? m.push(n) : x.push(n), n.observers && ge(n));
196
+ }
197
+ }
198
+ function N(e) {
199
+ let t;
200
+ if (e.sources)
201
+ for (; e.sources.length; ) {
202
+ const n = e.sources.pop(), o = e.sourceSlots.pop(), i = n.observers;
203
+ if (i && i.length) {
204
+ const l = i.pop(), r = n.observerSlots.pop();
205
+ o < i.length && (l.sourceSlots[r] = o, i[o] = l, n.observerSlots[o] = r);
206
+ }
207
+ }
208
+ if (e.tOwned) {
209
+ for (t = e.tOwned.length - 1; t >= 0; t--) N(e.tOwned[t]);
210
+ delete e.tOwned;
211
+ }
212
+ if (e.owned) {
213
+ for (t = e.owned.length - 1; t >= 0; t--) N(e.owned[t]);
214
+ e.owned = null;
215
+ }
216
+ if (e.cleanups) {
217
+ for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
218
+ e.cleanups = null;
219
+ }
220
+ e.state = 0;
221
+ }
222
+ function Pe(e) {
223
+ return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
224
+ cause: e
225
+ });
226
+ }
227
+ function Q(e, t = a) {
228
+ throw Pe(e);
229
+ }
230
+ function le(e, t) {
231
+ return C(() => e(t || {}));
232
+ }
233
+ const $e = (e) => `Stale read from <${e}>.`;
234
+ function Ne(e) {
235
+ const t = e.keyed, n = _(() => e.when, void 0, void 0), o = t ? n : _(n, void 0, {
236
+ equals: (i, l) => !i == !l
237
+ });
238
+ return _(() => {
239
+ const i = o();
240
+ if (i) {
241
+ const l = e.children;
242
+ return typeof l == "function" && l.length > 0 ? C(() => l(t ? i : () => {
243
+ if (!C(o)) throw $e("Show");
244
+ return n();
245
+ })) : l;
246
+ }
247
+ return e.fallback;
248
+ }, void 0, void 0);
249
+ }
250
+ function Le(e, t, n) {
251
+ let o = n.length, i = t.length, l = o, r = 0, s = 0, c = t[i - 1].nextSibling, h = null;
252
+ for (; r < i || s < l; ) {
253
+ if (t[r] === n[s]) {
254
+ r++, s++;
255
+ continue;
256
+ }
257
+ for (; t[i - 1] === n[l - 1]; )
258
+ i--, l--;
259
+ if (i === r) {
260
+ const p = l < o ? s ? n[s - 1].nextSibling : n[l - s] : c;
261
+ for (; s < l; ) e.insertBefore(n[s++], p);
262
+ } else if (l === s)
263
+ for (; r < i; )
264
+ (!h || !h.has(t[r])) && t[r].remove(), r++;
265
+ else if (t[r] === n[l - 1] && n[s] === t[i - 1]) {
266
+ const p = t[--i].nextSibling;
267
+ e.insertBefore(n[s++], t[r++].nextSibling), e.insertBefore(n[--l], p), t[i] = n[l];
268
+ } else {
269
+ if (!h) {
270
+ h = /* @__PURE__ */ new Map();
271
+ let y = s;
272
+ for (; y < l; ) h.set(n[y], y++);
273
+ }
274
+ const p = h.get(t[r]);
275
+ if (p != null)
276
+ if (s < p && p < l) {
277
+ let y = r, b = 1, S;
278
+ for (; ++y < i && y < l && !((S = h.get(t[y])) == null || S !== p + b); )
279
+ b++;
280
+ if (b > p - s) {
281
+ const R = t[r];
282
+ for (; s < p; ) e.insertBefore(n[s++], R);
283
+ } else e.replaceChild(n[s++], t[r++]);
284
+ } else r++;
285
+ else t[r++].remove();
286
+ }
287
+ }
288
+ }
289
+ const re = "_$DX_DELEGATE";
290
+ function Oe(e, t, n, o = {}) {
291
+ let i;
292
+ return ae((l) => {
293
+ i = l, t === document ? e() : j(t, e(), t.firstChild ? null : void 0, n);
294
+ }, o.owner), () => {
295
+ i(), t.textContent = "";
296
+ };
297
+ }
298
+ function me(e, t, n, o) {
299
+ let i;
300
+ const l = () => {
301
+ const s = o ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
302
+ return s.innerHTML = e, n ? s.content.firstChild.firstChild : o ? s.firstChild : s.content.firstChild;
303
+ }, r = t ? () => C(() => document.importNode(i || (i = l()), !0)) : () => (i || (i = l())).cloneNode(!0);
304
+ return r.cloneNode = r, r;
305
+ }
306
+ function Me(e, t = window.document) {
307
+ const n = t[re] || (t[re] = /* @__PURE__ */ new Set());
308
+ for (let o = 0, i = e.length; o < i; o++) {
309
+ const l = e[o];
310
+ n.has(l) || (n.add(l), t.addEventListener(l, _e));
311
+ }
312
+ }
313
+ function P(e, t, n) {
314
+ n != null ? e.style.setProperty(t, n) : e.style.removeProperty(t);
315
+ }
316
+ function q(e, t, n) {
317
+ return C(() => e(t, n));
318
+ }
319
+ function j(e, t, n, o) {
320
+ if (n !== void 0 && !o && (o = []), typeof t != "function") return G(e, t, o, n);
321
+ D((i) => G(e, t(), i, n), o);
322
+ }
323
+ function _e(e) {
324
+ let t = e.target;
325
+ const n = `$$${e.type}`, o = e.target, i = e.currentTarget, l = (c) => Object.defineProperty(e, "target", {
326
+ configurable: !0,
327
+ value: c
328
+ }), r = () => {
329
+ const c = t[n];
330
+ if (c && !t.disabled) {
331
+ const h = t[`${n}Data`];
332
+ if (h !== void 0 ? c.call(t, h, e) : c.call(t, e), e.cancelBubble) return;
333
+ }
334
+ return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && l(t.host), !0;
335
+ }, s = () => {
336
+ for (; r() && (t = t._$host || t.parentNode || t.host); ) ;
337
+ };
338
+ if (Object.defineProperty(e, "currentTarget", {
339
+ configurable: !0,
340
+ get() {
341
+ return t || document;
342
+ }
343
+ }), e.composedPath) {
344
+ const c = e.composedPath();
345
+ l(c[0]);
346
+ for (let h = 0; h < c.length - 2 && (t = c[h], !!r()); h++) {
347
+ if (t._$host) {
348
+ t = t._$host, s();
349
+ break;
350
+ }
351
+ if (t.parentNode === i)
352
+ break;
353
+ }
354
+ } else s();
355
+ l(o);
356
+ }
357
+ function G(e, t, n, o, i) {
358
+ for (; typeof n == "function"; ) n = n();
359
+ if (t === n) return n;
360
+ const l = typeof t, r = o !== void 0;
361
+ if (e = r && n[0] && n[0].parentNode || e, l === "string" || l === "number") {
362
+ if (l === "number" && (t = t.toString(), t === n))
363
+ return n;
364
+ if (r) {
365
+ let s = n[0];
366
+ s && s.nodeType === 3 ? s.data !== t && (s.data = t) : s = document.createTextNode(t), n = k(e, n, o, s);
367
+ } else
368
+ n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
369
+ } else if (t == null || l === "boolean")
370
+ n = k(e, n, o);
371
+ else {
372
+ if (l === "function")
373
+ return D(() => {
374
+ let s = t();
375
+ for (; typeof s == "function"; ) s = s();
376
+ n = G(e, s, n, o);
377
+ }), () => n;
378
+ if (Array.isArray(t)) {
379
+ const s = [], c = n && Array.isArray(n);
380
+ if (W(s, t, n, i))
381
+ return D(() => n = G(e, s, n, o, !0)), () => n;
382
+ if (s.length === 0) {
383
+ if (n = k(e, n, o), r) return n;
384
+ } else c ? n.length === 0 ? ce(e, s, o) : Le(e, n, s) : (n && k(e), ce(e, s));
385
+ n = s;
386
+ } else if (t.nodeType) {
387
+ if (Array.isArray(n)) {
388
+ if (r) return n = k(e, n, o, t);
389
+ k(e, n, null, t);
390
+ } else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
391
+ n = t;
392
+ }
393
+ }
394
+ return n;
395
+ }
396
+ function W(e, t, n, o) {
397
+ let i = !1;
398
+ for (let l = 0, r = t.length; l < r; l++) {
399
+ let s = t[l], c = n && n[e.length], h;
400
+ if (!(s == null || s === !0 || s === !1)) if ((h = typeof s) == "object" && s.nodeType)
401
+ e.push(s);
402
+ else if (Array.isArray(s))
403
+ i = W(e, s, c) || i;
404
+ else if (h === "function")
405
+ if (o) {
406
+ for (; typeof s == "function"; ) s = s();
407
+ i = W(e, Array.isArray(s) ? s : [s], Array.isArray(c) ? c : [c]) || i;
408
+ } else
409
+ e.push(s), i = !0;
410
+ else {
411
+ const p = String(s);
412
+ c && c.nodeType === 3 && c.data === p ? e.push(c) : e.push(document.createTextNode(p));
413
+ }
414
+ }
415
+ return i;
416
+ }
417
+ function ce(e, t, n = null) {
418
+ for (let o = 0, i = t.length; o < i; o++) e.insertBefore(t[o], n);
419
+ }
420
+ function k(e, t, n, o) {
421
+ if (n === void 0) return e.textContent = "";
422
+ const i = o || document.createTextNode("");
423
+ if (t.length) {
424
+ let l = !1;
425
+ for (let r = t.length - 1; r >= 0; r--) {
426
+ const s = t[r];
427
+ if (i !== s) {
428
+ const c = s.parentNode === e;
429
+ !l && !r ? c ? e.replaceChild(i, s) : e.insertBefore(i, n) : c && s.remove();
430
+ } else l = !0;
431
+ }
432
+ } else e.insertBefore(i, n);
433
+ return [i];
434
+ }
435
+ const He = "http://www.w3.org/2000/svg";
436
+ function Be(e, t = !1, n = void 0) {
437
+ return t ? document.createElementNS(He, e) : document.createElement(e, {
438
+ is: n
439
+ });
440
+ }
441
+ function De(e) {
442
+ const {
443
+ useShadow: t
444
+ } = e, n = document.createTextNode(""), o = () => e.mount || document.body, i = Se();
445
+ let l;
446
+ return Ee(() => {
447
+ l || (l = Ce(i, () => _(() => e.children)));
448
+ const r = o();
449
+ if (r instanceof HTMLHeadElement) {
450
+ const [s, c] = $(!1), h = () => c(!0);
451
+ ae((p) => j(r, () => s() ? p() : l(), null)), ie(h);
452
+ } else {
453
+ const s = Be(e.isSVG ? "g" : "div", e.isSVG), c = t && s.attachShadow ? s.attachShadow({
454
+ mode: "open"
455
+ }) : s;
456
+ Object.defineProperty(s, "_$host", {
457
+ get() {
458
+ return n.parentNode;
459
+ },
460
+ configurable: !0
461
+ }), j(c, l), r.appendChild(s), e.ref && e.ref(s), ie(() => r.contains(s) && r.removeChild(s));
462
+ }
463
+ }, void 0, {}), n;
464
+ }
465
+ var Ue = /* @__PURE__ */ me("<div class=llm-config-tray-popover><div>"), Ve = /* @__PURE__ */ me('<div class=llm-config-tray><button class=llm-config-tray-button title="LLM model &amp; config"><span>🤖</span><span>model');
466
+ const je = () => import("./patchwork-llm-h1ZevlV6.js");
467
+ function Ge(e) {
468
+ const t = document.createElement("style");
469
+ t.textContent = `
470
+ .llm-config-tray { position: relative; display: inline-flex; align-items: center; }
471
+ .llm-config-tray-button {
472
+ display: inline-flex; align-items: center; gap: var(--studio-space-2xs, 0.25rem);
473
+ height: 1.75rem; padding: 0 var(--studio-space-xs, 0.375rem);
474
+ border: 1px solid var(--studio-chrome-offset-20, var(--studio-fill-offset-20, #d4d4d4));
475
+ border-radius: var(--studio-radius-sm, 4px);
476
+ background: var(--studio-chrome, var(--studio-fill, white));
477
+ color: var(--studio-chrome-line, var(--studio-line, black));
478
+ font: 500 0.75rem/1 var(--studio-family-sans, system-ui, sans-serif); cursor: pointer;
479
+ }
480
+ .llm-config-tray-button:hover {
481
+ background: var(--studio-chrome-offset-10, var(--studio-fill-offset-10, #f2f2f2));
482
+ }
483
+ .llm-config-tray-popover {
484
+ position: fixed; z-index: 2147483000; box-sizing: border-box;
485
+ max-width: min(92vw, 520px); max-height: 80vh; overflow: auto;
486
+ background: var(--studio-fill, white); color: var(--studio-line, black);
487
+ border: 1px solid var(--studio-fill-offset-20, #d4d4d4);
488
+ border-radius: var(--studio-radius-md, 8px);
489
+ box-shadow: var(--studio-shadow-lg, 0 8px 32px rgba(0,0,0,0.24));
490
+ padding: var(--studio-space-sm, 0.5rem);
491
+ }
492
+ `, e.append(t);
493
+ const [n, o] = $(!1), [i, l] = $(), [r, s] = $({}), [c, h] = $(null);
494
+ let p, y, b, S = null;
495
+ function R(f, {
496
+ readScopedConfig: d,
497
+ readConfig: v,
498
+ writeScopeOverride: g,
499
+ writeConfig: M
500
+ }) {
501
+ return f ? {
502
+ read: () => {
503
+ try {
504
+ return d(f);
505
+ } catch {
506
+ return v();
507
+ }
508
+ },
509
+ write: (A) => g(f, A)
510
+ } : {
511
+ read: () => v(),
512
+ write: (A) => M(A)
513
+ };
514
+ }
515
+ async function we() {
516
+ const f = i(), d = r() || {}, v = await je();
517
+ await v.ensureConfig(f, e), b && (b.replaceChildren(), S = v.dom({
518
+ source: R(f, v),
519
+ scope: f,
520
+ toolName: f?.toolName || d.toolName,
521
+ toolPrompt: d.toolPrompt,
522
+ toolTools: d.toolTools
523
+ }), b.append(S));
524
+ }
525
+ function ye() {
526
+ const f = p.getBoundingClientRect(), d = Math.max(0, f.top - 16), v = Math.max(0, window.innerHeight - f.bottom - 16), g = d >= Math.min(window.innerHeight * 0.8, v);
527
+ h({
528
+ left: Math.max(8, f.right - Math.min(520, window.innerWidth * 0.92)),
529
+ top: g ? f.top - 8 : f.bottom + 8,
530
+ maxHeight: Math.min(window.innerHeight * 0.8, g ? d : v),
531
+ above: g
532
+ });
533
+ }
534
+ function X(f, d) {
535
+ l(f?.toolId ? f : void 0), s(d || {}), ye(), o(!0), queueMicrotask(we);
536
+ }
537
+ function O() {
538
+ try {
539
+ S?.destroy?.();
540
+ } catch {
541
+ }
542
+ S = null, o(!1);
543
+ }
544
+ const Y = (f) => {
545
+ const d = f.detail;
546
+ !d || d.component !== "llm-config-tray" || X(d.scope, d);
547
+ };
548
+ document.addEventListener("patchwork:open-tool", Y);
549
+ const J = (f) => {
550
+ if (!n()) return;
551
+ const d = f.composedPath();
552
+ y && d.includes(y) || p && d.includes(p) || O();
553
+ }, Z = (f) => {
554
+ f.key === "Escape" && n() && O();
555
+ };
556
+ document.addEventListener("click", J), document.addEventListener("keydown", Z);
557
+ const ve = Oe(() => (() => {
558
+ var f = Ve(), d = f.firstChild;
559
+ d.$$click = (g) => {
560
+ g.stopPropagation(), n() ? O() : X(void 0, {});
561
+ };
562
+ var v = p;
563
+ return typeof v == "function" ? q(v, d) : p = d, j(f, le(Ne, {
564
+ get when() {
565
+ return n();
566
+ },
567
+ get children() {
568
+ return le(De, {
569
+ get mount() {
570
+ return document.body;
571
+ },
572
+ get children() {
573
+ var g = Ue(), M = g.firstChild;
574
+ g.$$click = (w) => w.stopPropagation();
575
+ var A = y;
576
+ typeof A == "function" ? q(A, g) : y = g;
577
+ var z = b;
578
+ return typeof z == "function" ? q(z, M) : b = M, D((w) => {
579
+ var ee = `${c()?.left ?? 0}px`, te = `${c()?.top ?? 0}px`, ne = `${c()?.maxHeight ?? 0}px`, oe = c()?.above ? "translateY(-100%)" : "none", se = c() ? "visible" : "hidden";
580
+ return ee !== w.e && P(g, "left", w.e = ee), te !== w.t && P(g, "top", w.t = te), ne !== w.a && P(g, "max-height", w.a = ne), oe !== w.o && P(g, "transform", w.o = oe), se !== w.i && P(g, "visibility", w.i = se), w;
581
+ }, {
582
+ e: void 0,
583
+ t: void 0,
584
+ a: void 0,
585
+ o: void 0,
586
+ i: void 0
587
+ }), g;
588
+ }
589
+ });
590
+ }
591
+ }), null), f;
592
+ })(), e);
593
+ return () => {
594
+ O(), ve(), t.remove(), document.removeEventListener("patchwork:open-tool", Y), document.removeEventListener("click", J), document.removeEventListener("keydown", Z);
595
+ };
596
+ }
597
+ Me(["click"]);
598
+ export {
599
+ Ge as LlmConfigTray
600
+ };
@@ -8,7 +8,7 @@ const a = [
8
8
  icon: "Bot",
9
9
  tags: ["system-tray"],
10
10
  async load() {
11
- const { LlmConfigTray: t } = await import("./LlmConfigTray-Ck7LaNf9.js");
11
+ const { LlmConfigTray: t } = await import("./LlmConfigTray-CkM9XUX1.js");
12
12
  return t;
13
13
  }
14
14
  },
@@ -1 +1 @@
1
- automerge:3EczzaSxpKiaPMgNjXnpiNBFfNPc
1
+ automerge:4AKePh47K9piF2AexJuUty1XoKo9
@@ -1,595 +0,0 @@
1
- import { ensureConfig as xe, dom as Se, writeScopeOverride as Ee, readScopedConfig as Ce, readConfig as ie, writeConfig as Ae } from "./patchwork-llm-h1ZevlV6.js";
2
- const ke = !1, Te = (e, t) => e === t, M = {
3
- equals: Te
4
- };
5
- let ue = ge;
6
- const x = 1, _ = 2, ae = {
7
- owned: null,
8
- cleanups: null,
9
- context: null,
10
- owner: null
11
- };
12
- var d = null;
13
- let R = null, Pe = null, a = null, m = null, b = null, j = 0;
14
- function de(e, t) {
15
- const n = a, o = d, i = e.length === 0, r = t === void 0 ? o : t, l = i ? ae : {
16
- owned: null,
17
- cleanups: null,
18
- context: r ? r.context : null,
19
- owner: r
20
- }, s = i ? e : () => e(() => E(() => $(l)));
21
- d = l, a = null;
22
- try {
23
- return A(s, !0);
24
- } finally {
25
- a = n, d = o;
26
- }
27
- }
28
- function P(e, t) {
29
- t = t ? Object.assign({}, M, t) : M;
30
- const n = {
31
- value: e,
32
- observers: null,
33
- observerSlots: null,
34
- comparator: t.equals || void 0
35
- }, o = (i) => (typeof i == "function" && (i = i(n.value)), pe(n, i));
36
- return [he.bind(n), o];
37
- }
38
- function H(e, t, n) {
39
- const o = q(e, t, !1, x);
40
- N(o);
41
- }
42
- function $e(e, t, n) {
43
- ue = _e;
44
- const o = q(e, t, !1, x);
45
- n || (o.user = !0), b ? b.push(o) : N(o);
46
- }
47
- function O(e, t, n) {
48
- n = n ? Object.assign({}, M, n) : M;
49
- const o = q(e, t, !0, 0);
50
- return o.observers = null, o.observerSlots = null, o.comparator = n.equals || void 0, N(o), he.bind(o);
51
- }
52
- function E(e) {
53
- if (a === null) return e();
54
- const t = a;
55
- a = null;
56
- try {
57
- return e();
58
- } finally {
59
- a = t;
60
- }
61
- }
62
- function re(e) {
63
- return d === null || (d.cleanups === null ? d.cleanups = [e] : d.cleanups.push(e)), e;
64
- }
65
- function Ne() {
66
- return d;
67
- }
68
- function Le(e, t) {
69
- const n = d, o = a;
70
- d = e, a = null;
71
- try {
72
- return A(t, !0);
73
- } catch (i) {
74
- W(i);
75
- } finally {
76
- d = n, a = o;
77
- }
78
- }
79
- function he() {
80
- if (this.sources && this.state)
81
- if (this.state === x) N(this);
82
- else {
83
- const e = m;
84
- m = null, A(() => D(this), !1), m = e;
85
- }
86
- if (a) {
87
- const e = this.observers;
88
- if (!e || e[e.length - 1] !== a) {
89
- const t = e ? e.length : 0;
90
- a.sources ? (a.sources.push(this), a.sourceSlots.push(t)) : (a.sources = [this], a.sourceSlots = [t]), e ? (e.push(a), this.observerSlots.push(a.sources.length - 1)) : (this.observers = [a], this.observerSlots = [a.sources.length - 1]);
91
- }
92
- }
93
- return this.value;
94
- }
95
- function pe(e, t, n) {
96
- let o = e.value;
97
- return (!e.comparator || !e.comparator(o, t)) && (e.value = t, e.observers && e.observers.length && A(() => {
98
- for (let i = 0; i < e.observers.length; i += 1) {
99
- const r = e.observers[i], l = R && R.running;
100
- l && R.disposed.has(r), (l ? !r.tState : !r.state) && (r.pure ? m.push(r) : b.push(r), r.observers && me(r)), l || (r.state = x);
101
- }
102
- if (m.length > 1e6)
103
- throw m = [], new Error();
104
- }, !1)), t;
105
- }
106
- function N(e) {
107
- if (!e.fn) return;
108
- $(e);
109
- const t = j;
110
- Oe(e, e.value, t);
111
- }
112
- function Oe(e, t, n) {
113
- let o;
114
- const i = d, r = a;
115
- a = d = e;
116
- try {
117
- o = e.fn(t);
118
- } catch (l) {
119
- return e.pure && (e.state = x, e.owned && e.owned.forEach($), e.owned = null), e.updatedAt = n + 1, W(l);
120
- } finally {
121
- a = r, d = i;
122
- }
123
- (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? pe(e, o) : e.value = o, e.updatedAt = n);
124
- }
125
- function q(e, t, n, o = x, i) {
126
- const r = {
127
- fn: e,
128
- state: o,
129
- updatedAt: null,
130
- owned: null,
131
- sources: null,
132
- sourceSlots: null,
133
- cleanups: null,
134
- value: t,
135
- owner: d,
136
- context: d ? d.context : null,
137
- pure: n
138
- };
139
- return d === null || d !== ae && (d.owned ? d.owned.push(r) : d.owned = [r]), r;
140
- }
141
- function B(e) {
142
- if (e.state === 0) return;
143
- if (e.state === _) return D(e);
144
- if (e.suspense && E(e.suspense.inFallback)) return e.suspense.effects.push(e);
145
- const t = [e];
146
- for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < j); )
147
- e.state && t.push(e);
148
- for (let n = t.length - 1; n >= 0; n--)
149
- if (e = t[n], e.state === x)
150
- N(e);
151
- else if (e.state === _) {
152
- const o = m;
153
- m = null, A(() => D(e, t[0]), !1), m = o;
154
- }
155
- }
156
- function A(e, t) {
157
- if (m) return e();
158
- let n = !1;
159
- t || (m = []), b ? n = !0 : b = [], j++;
160
- try {
161
- const o = e();
162
- return Me(n), o;
163
- } catch (o) {
164
- n || (b = null), m = null, W(o);
165
- }
166
- }
167
- function Me(e) {
168
- if (m && (ge(m), m = null), e) return;
169
- const t = b;
170
- b = null, t.length && A(() => ue(t), !1);
171
- }
172
- function ge(e) {
173
- for (let t = 0; t < e.length; t++) B(e[t]);
174
- }
175
- function _e(e) {
176
- let t, n = 0;
177
- for (t = 0; t < e.length; t++) {
178
- const o = e[t];
179
- o.user ? e[n++] = o : B(o);
180
- }
181
- for (t = 0; t < n; t++) B(e[t]);
182
- }
183
- function D(e, t) {
184
- e.state = 0;
185
- for (let n = 0; n < e.sources.length; n += 1) {
186
- const o = e.sources[n];
187
- if (o.sources) {
188
- const i = o.state;
189
- i === x ? o !== t && (!o.updatedAt || o.updatedAt < j) && B(o) : i === _ && D(o, t);
190
- }
191
- }
192
- }
193
- function me(e) {
194
- for (let t = 0; t < e.observers.length; t += 1) {
195
- const n = e.observers[t];
196
- n.state || (n.state = _, n.pure ? m.push(n) : b.push(n), n.observers && me(n));
197
- }
198
- }
199
- function $(e) {
200
- let t;
201
- if (e.sources)
202
- for (; e.sources.length; ) {
203
- const n = e.sources.pop(), o = e.sourceSlots.pop(), i = n.observers;
204
- if (i && i.length) {
205
- const r = i.pop(), l = n.observerSlots.pop();
206
- o < i.length && (r.sourceSlots[l] = o, i[o] = r, n.observerSlots[o] = l);
207
- }
208
- }
209
- if (e.tOwned) {
210
- for (t = e.tOwned.length - 1; t >= 0; t--) $(e.tOwned[t]);
211
- delete e.tOwned;
212
- }
213
- if (e.owned) {
214
- for (t = e.owned.length - 1; t >= 0; t--) $(e.owned[t]);
215
- e.owned = null;
216
- }
217
- if (e.cleanups) {
218
- for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
219
- e.cleanups = null;
220
- }
221
- e.state = 0;
222
- }
223
- function He(e) {
224
- return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
225
- cause: e
226
- });
227
- }
228
- function W(e, t = d) {
229
- throw He(e);
230
- }
231
- function le(e, t) {
232
- return E(() => e(t || {}));
233
- }
234
- const Be = (e) => `Stale read from <${e}>.`;
235
- function De(e) {
236
- const t = e.keyed, n = O(() => e.when, void 0, void 0), o = t ? n : O(n, void 0, {
237
- equals: (i, r) => !i == !r
238
- });
239
- return O(() => {
240
- const i = o();
241
- if (i) {
242
- const r = e.children;
243
- return typeof r == "function" && r.length > 0 ? E(() => r(t ? i : () => {
244
- if (!E(o)) throw Be("Show");
245
- return n();
246
- })) : r;
247
- }
248
- return e.fallback;
249
- }, void 0, void 0);
250
- }
251
- function Ue(e, t, n) {
252
- let o = n.length, i = t.length, r = o, l = 0, s = 0, f = t[i - 1].nextSibling, h = null;
253
- for (; l < i || s < r; ) {
254
- if (t[l] === n[s]) {
255
- l++, s++;
256
- continue;
257
- }
258
- for (; t[i - 1] === n[r - 1]; )
259
- i--, r--;
260
- if (i === l) {
261
- const p = r < o ? s ? n[s - 1].nextSibling : n[r - s] : f;
262
- for (; s < r; ) e.insertBefore(n[s++], p);
263
- } else if (r === s)
264
- for (; l < i; )
265
- (!h || !h.has(t[l])) && t[l].remove(), l++;
266
- else if (t[l] === n[r - 1] && n[s] === t[i - 1]) {
267
- const p = t[--i].nextSibling;
268
- e.insertBefore(n[s++], t[l++].nextSibling), e.insertBefore(n[--r], p), t[i] = n[r];
269
- } else {
270
- if (!h) {
271
- h = /* @__PURE__ */ new Map();
272
- let v = s;
273
- for (; v < r; ) h.set(n[v], v++);
274
- }
275
- const p = h.get(t[l]);
276
- if (p != null)
277
- if (s < p && p < r) {
278
- let v = l, y = 1, S;
279
- for (; ++v < i && v < r && !((S = h.get(t[v])) == null || S !== p + y); )
280
- y++;
281
- if (y > p - s) {
282
- const G = t[l];
283
- for (; s < p; ) e.insertBefore(n[s++], G);
284
- } else e.replaceChild(n[s++], t[l++]);
285
- } else l++;
286
- else t[l++].remove();
287
- }
288
- }
289
- }
290
- const fe = "_$DX_DELEGATE";
291
- function Ve(e, t, n, o = {}) {
292
- let i;
293
- return de((r) => {
294
- i = r, t === document ? e() : U(t, e(), t.firstChild ? null : void 0, n);
295
- }, o.owner), () => {
296
- i(), t.textContent = "";
297
- };
298
- }
299
- function we(e, t, n, o) {
300
- let i;
301
- const r = () => {
302
- const s = o ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
303
- return s.innerHTML = e, n ? s.content.firstChild.firstChild : o ? s.firstChild : s.content.firstChild;
304
- }, l = t ? () => E(() => document.importNode(i || (i = r()), !0)) : () => (i || (i = r())).cloneNode(!0);
305
- return l.cloneNode = l, l;
306
- }
307
- function je(e, t = window.document) {
308
- const n = t[fe] || (t[fe] = /* @__PURE__ */ new Set());
309
- for (let o = 0, i = e.length; o < i; o++) {
310
- const r = e[o];
311
- n.has(r) || (n.add(r), t.addEventListener(r, Ge));
312
- }
313
- }
314
- function T(e, t, n) {
315
- n != null ? e.style.setProperty(t, n) : e.style.removeProperty(t);
316
- }
317
- function F(e, t, n) {
318
- return E(() => e(t, n));
319
- }
320
- function U(e, t, n, o) {
321
- if (n !== void 0 && !o && (o = []), typeof t != "function") return V(e, t, o, n);
322
- H((i) => V(e, t(), i, n), o);
323
- }
324
- function Ge(e) {
325
- let t = e.target;
326
- const n = `$$${e.type}`, o = e.target, i = e.currentTarget, r = (f) => Object.defineProperty(e, "target", {
327
- configurable: !0,
328
- value: f
329
- }), l = () => {
330
- const f = t[n];
331
- if (f && !t.disabled) {
332
- const h = t[`${n}Data`];
333
- if (h !== void 0 ? f.call(t, h, e) : f.call(t, e), e.cancelBubble) return;
334
- }
335
- return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && r(t.host), !0;
336
- }, s = () => {
337
- for (; l() && (t = t._$host || t.parentNode || t.host); ) ;
338
- };
339
- if (Object.defineProperty(e, "currentTarget", {
340
- configurable: !0,
341
- get() {
342
- return t || document;
343
- }
344
- }), e.composedPath) {
345
- const f = e.composedPath();
346
- r(f[0]);
347
- for (let h = 0; h < f.length - 2 && (t = f[h], !!l()); h++) {
348
- if (t._$host) {
349
- t = t._$host, s();
350
- break;
351
- }
352
- if (t.parentNode === i)
353
- break;
354
- }
355
- } else s();
356
- r(o);
357
- }
358
- function V(e, t, n, o, i) {
359
- for (; typeof n == "function"; ) n = n();
360
- if (t === n) return n;
361
- const r = typeof t, l = o !== void 0;
362
- if (e = l && n[0] && n[0].parentNode || e, r === "string" || r === "number") {
363
- if (r === "number" && (t = t.toString(), t === n))
364
- return n;
365
- if (l) {
366
- let s = n[0];
367
- s && s.nodeType === 3 ? s.data !== t && (s.data = t) : s = document.createTextNode(t), n = C(e, n, o, s);
368
- } else
369
- n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
370
- } else if (t == null || r === "boolean")
371
- n = C(e, n, o);
372
- else {
373
- if (r === "function")
374
- return H(() => {
375
- let s = t();
376
- for (; typeof s == "function"; ) s = s();
377
- n = V(e, s, n, o);
378
- }), () => n;
379
- if (Array.isArray(t)) {
380
- const s = [], f = n && Array.isArray(n);
381
- if (I(s, t, n, i))
382
- return H(() => n = V(e, s, n, o, !0)), () => n;
383
- if (s.length === 0) {
384
- if (n = C(e, n, o), l) return n;
385
- } else f ? n.length === 0 ? ce(e, s, o) : Ue(e, n, s) : (n && C(e), ce(e, s));
386
- n = s;
387
- } else if (t.nodeType) {
388
- if (Array.isArray(n)) {
389
- if (l) return n = C(e, n, o, t);
390
- C(e, n, null, t);
391
- } else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
392
- n = t;
393
- }
394
- }
395
- return n;
396
- }
397
- function I(e, t, n, o) {
398
- let i = !1;
399
- for (let r = 0, l = t.length; r < l; r++) {
400
- let s = t[r], f = n && n[e.length], h;
401
- if (!(s == null || s === !0 || s === !1)) if ((h = typeof s) == "object" && s.nodeType)
402
- e.push(s);
403
- else if (Array.isArray(s))
404
- i = I(e, s, f) || i;
405
- else if (h === "function")
406
- if (o) {
407
- for (; typeof s == "function"; ) s = s();
408
- i = I(e, Array.isArray(s) ? s : [s], Array.isArray(f) ? f : [f]) || i;
409
- } else
410
- e.push(s), i = !0;
411
- else {
412
- const p = String(s);
413
- f && f.nodeType === 3 && f.data === p ? e.push(f) : e.push(document.createTextNode(p));
414
- }
415
- }
416
- return i;
417
- }
418
- function ce(e, t, n = null) {
419
- for (let o = 0, i = t.length; o < i; o++) e.insertBefore(t[o], n);
420
- }
421
- function C(e, t, n, o) {
422
- if (n === void 0) return e.textContent = "";
423
- const i = o || document.createTextNode("");
424
- if (t.length) {
425
- let r = !1;
426
- for (let l = t.length - 1; l >= 0; l--) {
427
- const s = t[l];
428
- if (i !== s) {
429
- const f = s.parentNode === e;
430
- !r && !l ? f ? e.replaceChild(i, s) : e.insertBefore(i, n) : f && s.remove();
431
- } else r = !0;
432
- }
433
- } else e.insertBefore(i, n);
434
- return [i];
435
- }
436
- const Re = "http://www.w3.org/2000/svg";
437
- function Fe(e, t = !1, n = void 0) {
438
- return t ? document.createElementNS(Re, e) : document.createElement(e, {
439
- is: n
440
- });
441
- }
442
- function Ie(e) {
443
- const {
444
- useShadow: t
445
- } = e, n = document.createTextNode(""), o = () => e.mount || document.body, i = Ne();
446
- let r;
447
- return $e(() => {
448
- r || (r = Le(i, () => O(() => e.children)));
449
- const l = o();
450
- if (l instanceof HTMLHeadElement) {
451
- const [s, f] = P(!1), h = () => f(!0);
452
- de((p) => U(l, () => s() ? p() : r(), null)), re(h);
453
- } else {
454
- const s = Fe(e.isSVG ? "g" : "div", e.isSVG), f = t && s.attachShadow ? s.attachShadow({
455
- mode: "open"
456
- }) : s;
457
- Object.defineProperty(s, "_$host", {
458
- get() {
459
- return n.parentNode;
460
- },
461
- configurable: !0
462
- }), U(f, r), l.appendChild(s), e.ref && e.ref(s), re(() => l.contains(s) && l.removeChild(s));
463
- }
464
- }, void 0, {}), n;
465
- }
466
- var qe = /* @__PURE__ */ we("<div class=llm-config-tray-popover><div>"), We = /* @__PURE__ */ we('<div class=llm-config-tray><button class=llm-config-tray-button title="LLM model &amp; config"><span>🤖</span><span>model');
467
- function Qe(e) {
468
- const t = document.createElement("style");
469
- t.textContent = `
470
- .llm-config-tray { position: relative; display: inline-flex; align-items: center; }
471
- .llm-config-tray-button {
472
- display: inline-flex; align-items: center; gap: var(--studio-space-2xs, 0.25rem);
473
- height: 1.75rem; padding: 0 var(--studio-space-xs, 0.375rem);
474
- border: 1px solid var(--studio-chrome-offset-20, var(--studio-fill-offset-20, #d4d4d4));
475
- border-radius: var(--studio-radius-sm, 4px);
476
- background: var(--studio-chrome, var(--studio-fill, white));
477
- color: var(--studio-chrome-line, var(--studio-line, black));
478
- font: 500 0.75rem/1 var(--studio-family-sans, system-ui, sans-serif); cursor: pointer;
479
- }
480
- .llm-config-tray-button:hover {
481
- background: var(--studio-chrome-offset-10, var(--studio-fill-offset-10, #f2f2f2));
482
- }
483
- .llm-config-tray-popover {
484
- position: fixed; z-index: 2147483000; box-sizing: border-box;
485
- max-width: min(92vw, 520px); max-height: 80vh; overflow: auto;
486
- background: var(--studio-fill, white); color: var(--studio-line, black);
487
- border: 1px solid var(--studio-fill-offset-20, #d4d4d4);
488
- border-radius: var(--studio-radius-md, 8px);
489
- box-shadow: var(--studio-shadow-lg, 0 8px 32px rgba(0,0,0,0.24));
490
- padding: var(--studio-space-sm, 0.5rem);
491
- }
492
- `, e.append(t);
493
- const [n, o] = P(!1), [i, r] = P(), [l, s] = P({}), [f, h] = P(null);
494
- let p, v, y, S = null;
495
- function G(c) {
496
- return c ? {
497
- read: () => {
498
- try {
499
- return Ce(c);
500
- } catch {
501
- return ie();
502
- }
503
- },
504
- write: (u) => Ee(c, u)
505
- } : {
506
- read: () => ie(),
507
- write: (u) => Ae(u)
508
- };
509
- }
510
- async function ve() {
511
- const c = i(), u = l() || {};
512
- await xe(c, e), y && (y.replaceChildren(), S = Se({
513
- source: G(c),
514
- scope: c,
515
- toolName: c?.toolName || u.toolName,
516
- toolPrompt: u.toolPrompt,
517
- toolTools: u.toolTools
518
- }), y.append(S));
519
- }
520
- function ye() {
521
- const c = p.getBoundingClientRect(), u = Math.max(0, c.top - 16), k = Math.max(0, window.innerHeight - c.bottom - 16), g = u >= Math.min(window.innerHeight * 0.8, k);
522
- h({
523
- left: Math.max(8, c.right - Math.min(520, window.innerWidth * 0.92)),
524
- top: g ? c.top - 8 : c.bottom + 8,
525
- maxHeight: Math.min(window.innerHeight * 0.8, g ? u : k),
526
- above: g
527
- });
528
- }
529
- function K(c, u) {
530
- r(c?.toolId ? c : void 0), s(u || {}), ye(), o(!0), queueMicrotask(ve);
531
- }
532
- function L() {
533
- try {
534
- S?.destroy?.();
535
- } catch {
536
- }
537
- S = null, o(!1);
538
- }
539
- const Q = (c) => {
540
- const u = c.detail;
541
- !u || u.component !== "llm-config-tray" || K(u.scope, u);
542
- };
543
- document.addEventListener("patchwork:open-tool", Q);
544
- const X = (c) => {
545
- if (!n()) return;
546
- const u = c.composedPath();
547
- v && u.includes(v) || p && u.includes(p) || L();
548
- }, Y = (c) => {
549
- c.key === "Escape" && n() && L();
550
- };
551
- document.addEventListener("click", X), document.addEventListener("keydown", Y);
552
- const be = Ve(() => (() => {
553
- var c = We(), u = c.firstChild;
554
- u.$$click = (g) => {
555
- g.stopPropagation(), n() ? L() : K(void 0, {});
556
- };
557
- var k = p;
558
- return typeof k == "function" ? F(k, u) : p = u, U(c, le(De, {
559
- get when() {
560
- return n();
561
- },
562
- get children() {
563
- return le(Ie, {
564
- get mount() {
565
- return document.body;
566
- },
567
- get children() {
568
- var g = qe(), J = g.firstChild;
569
- g.$$click = (w) => w.stopPropagation();
570
- var Z = v;
571
- typeof Z == "function" ? F(Z, g) : v = g;
572
- var z = y;
573
- return typeof z == "function" ? F(z, J) : y = J, H((w) => {
574
- var ee = `${f()?.left ?? 0}px`, te = `${f()?.top ?? 0}px`, ne = `${f()?.maxHeight ?? 0}px`, oe = f()?.above ? "translateY(-100%)" : "none", se = f() ? "visible" : "hidden";
575
- return ee !== w.e && T(g, "left", w.e = ee), te !== w.t && T(g, "top", w.t = te), ne !== w.a && T(g, "max-height", w.a = ne), oe !== w.o && T(g, "transform", w.o = oe), se !== w.i && T(g, "visibility", w.i = se), w;
576
- }, {
577
- e: void 0,
578
- t: void 0,
579
- a: void 0,
580
- o: void 0,
581
- i: void 0
582
- }), g;
583
- }
584
- });
585
- }
586
- }), null), c;
587
- })(), e);
588
- return () => {
589
- L(), be(), t.remove(), document.removeEventListener("patchwork:open-tool", Q), document.removeEventListener("click", X), document.removeEventListener("keydown", Y);
590
- };
591
- }
592
- je(["click"]);
593
- export {
594
- Qe as LlmConfigTray
595
- };