@lambforge/agent-chat 0.0.0-stage → 0.0.3

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/index.cjs ADDED
@@ -0,0 +1,3919 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __esm = (fn, res, err) => function __init() {
8
+ if (err) throw err[0];
9
+ try {
10
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
+ } catch (e16) {
12
+ throw err = [e16], e16;
13
+ }
14
+ };
15
+ var __commonJS = (cb, mod) => function __require() {
16
+ try {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ } catch (e16) {
19
+ throw mod = 0, e16;
20
+ }
21
+ };
22
+ var __export = (target, all) => {
23
+ for (var name in all)
24
+ __defProp(target, name, { get: all[name], enumerable: true });
25
+ };
26
+ var __copyProps = (to, from3, except, desc) => {
27
+ if (from3 && typeof from3 === "object" || typeof from3 === "function") {
28
+ for (let key of __getOwnPropNames(from3))
29
+ if (!__hasOwnProp.call(to, key) && key !== except)
30
+ __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable });
31
+ }
32
+ return to;
33
+ };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
35
+ // If the importer is in node compatibility mode or this is not an ESM
36
+ // file that has been converted to a CommonJS file using a Babel-
37
+ // compatible transform (i.e. "__esModule" has not been set), then set
38
+ // "default" to the CommonJS "module.exports" for node compatibility.
39
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
40
+ mod
41
+ ));
42
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
43
+ var __decorateClass = (decorators, target, key, kind) => {
44
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
45
+ for (var i12 = decorators.length - 1, decorator; i12 >= 0; i12--)
46
+ if (decorator = decorators[i12])
47
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
48
+ if (kind && result) __defProp(target, key, result);
49
+ return result;
50
+ };
51
+
52
+ // ../../node_modules/lit-html/lit-html.js
53
+ var lit_html_exports = {};
54
+ __export(lit_html_exports, {
55
+ _$LH: () => L,
56
+ html: () => y,
57
+ noChange: () => x,
58
+ nothing: () => b,
59
+ render: () => Z,
60
+ svg: () => w
61
+ });
62
+ function P(t9, i12, s9 = t9, e16) {
63
+ var o18, n11, l9, h9;
64
+ if (i12 === x) return i12;
65
+ let r7 = void 0 !== e16 ? null === (o18 = s9._$Co) || void 0 === o18 ? void 0 : o18[e16] : s9._$Cl;
66
+ const u5 = d(i12) ? void 0 : i12._$litDirective$;
67
+ return (null == r7 ? void 0 : r7.constructor) !== u5 && (null === (n11 = null == r7 ? void 0 : r7._$AO) || void 0 === n11 || n11.call(r7, false), void 0 === u5 ? r7 = void 0 : (r7 = new u5(t9), r7._$AT(t9, s9, e16)), void 0 !== e16 ? (null !== (l9 = (h9 = s9)._$Co) && void 0 !== l9 ? l9 : h9._$Co = [])[e16] = r7 : s9._$Cl = r7), void 0 !== r7 && (i12 = P(t9, r7._$AS(t9, i12.values), r7, e16)), i12;
68
+ }
69
+ var t, i, s, e, o, n, l, h, r, d, u, c, v, a, f, _, m, p, $, g, y, w, x, b, T, A, E, C, V, N, S, M, R, k, H, I, L, z, Z;
70
+ var init_lit_html = __esm({
71
+ "../../node_modules/lit-html/lit-html.js"() {
72
+ i = window;
73
+ s = i.trustedTypes;
74
+ e = s ? s.createPolicy("lit-html", { createHTML: (t9) => t9 }) : void 0;
75
+ o = `lit$${(Math.random() + "").slice(9)}$`;
76
+ n = "?" + o;
77
+ l = `<${n}>`;
78
+ h = document;
79
+ r = (t9 = "") => h.createComment(t9);
80
+ d = (t9) => null === t9 || "object" != typeof t9 && "function" != typeof t9;
81
+ u = Array.isArray;
82
+ c = (t9) => u(t9) || "function" == typeof (null == t9 ? void 0 : t9[Symbol.iterator]);
83
+ v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
84
+ a = /-->/g;
85
+ f = />/g;
86
+ _ = RegExp(`>|[
87
+ \f\r](?:([^\\s"'>=/]+)([
88
+ \f\r]*=[
89
+ \f\r]*(?:[^
90
+ \f\r"'\`<>=]|("|')|))|$)`, "g");
91
+ m = /'/g;
92
+ p = /"/g;
93
+ $ = /^(?:script|style|textarea|title)$/i;
94
+ g = (t9) => (i12, ...s9) => ({ _$litType$: t9, strings: i12, values: s9 });
95
+ y = g(1);
96
+ w = g(2);
97
+ x = /* @__PURE__ */ Symbol.for("lit-noChange");
98
+ b = /* @__PURE__ */ Symbol.for("lit-nothing");
99
+ T = /* @__PURE__ */ new WeakMap();
100
+ A = h.createTreeWalker(h, 129, null, false);
101
+ E = (t9, i12) => {
102
+ const s9 = t9.length - 1, n11 = [];
103
+ let h9, r7 = 2 === i12 ? "<svg>" : "", d6 = v;
104
+ for (let i13 = 0; i13 < s9; i13++) {
105
+ const s10 = t9[i13];
106
+ let e16, u6, c9 = -1, g2 = 0;
107
+ for (; g2 < s10.length && (d6.lastIndex = g2, u6 = d6.exec(s10), null !== u6); ) g2 = d6.lastIndex, d6 === v ? "!--" === u6[1] ? d6 = a : void 0 !== u6[1] ? d6 = f : void 0 !== u6[2] ? ($.test(u6[2]) && (h9 = RegExp("</" + u6[2], "g")), d6 = _) : void 0 !== u6[3] && (d6 = _) : d6 === _ ? ">" === u6[0] ? (d6 = null != h9 ? h9 : v, c9 = -1) : void 0 === u6[1] ? c9 = -2 : (c9 = d6.lastIndex - u6[2].length, e16 = u6[1], d6 = void 0 === u6[3] ? _ : '"' === u6[3] ? p : m) : d6 === p || d6 === m ? d6 = _ : d6 === a || d6 === f ? d6 = v : (d6 = _, h9 = void 0);
108
+ const y2 = d6 === _ && t9[i13 + 1].startsWith("/>") ? " " : "";
109
+ r7 += d6 === v ? s10 + l : c9 >= 0 ? (n11.push(e16), s10.slice(0, c9) + "$lit$" + s10.slice(c9) + o + y2) : s10 + o + (-2 === c9 ? (n11.push(void 0), i13) : y2);
110
+ }
111
+ const u5 = r7 + (t9[s9] || "<?>") + (2 === i12 ? "</svg>" : "");
112
+ if (!Array.isArray(t9) || !t9.hasOwnProperty("raw")) throw Error("invalid template strings array");
113
+ return [void 0 !== e ? e.createHTML(u5) : u5, n11];
114
+ };
115
+ C = class _C {
116
+ constructor({ strings: t9, _$litType$: i12 }, e16) {
117
+ let l9;
118
+ this.parts = [];
119
+ let h9 = 0, d6 = 0;
120
+ const u5 = t9.length - 1, c9 = this.parts, [v3, a5] = E(t9, i12);
121
+ if (this.el = _C.createElement(v3, e16), A.currentNode = this.el.content, 2 === i12) {
122
+ const t10 = this.el.content, i13 = t10.firstChild;
123
+ i13.remove(), t10.append(...i13.childNodes);
124
+ }
125
+ for (; null !== (l9 = A.nextNode()) && c9.length < u5; ) {
126
+ if (1 === l9.nodeType) {
127
+ if (l9.hasAttributes()) {
128
+ const t10 = [];
129
+ for (const i13 of l9.getAttributeNames()) if (i13.endsWith("$lit$") || i13.startsWith(o)) {
130
+ const s9 = a5[d6++];
131
+ if (t10.push(i13), void 0 !== s9) {
132
+ const t11 = l9.getAttribute(s9.toLowerCase() + "$lit$").split(o), i14 = /([.?@])?(.*)/.exec(s9);
133
+ c9.push({ type: 1, index: h9, name: i14[2], strings: t11, ctor: "." === i14[1] ? M : "?" === i14[1] ? k : "@" === i14[1] ? H : S });
134
+ } else c9.push({ type: 6, index: h9 });
135
+ }
136
+ for (const i13 of t10) l9.removeAttribute(i13);
137
+ }
138
+ if ($.test(l9.tagName)) {
139
+ const t10 = l9.textContent.split(o), i13 = t10.length - 1;
140
+ if (i13 > 0) {
141
+ l9.textContent = s ? s.emptyScript : "";
142
+ for (let s9 = 0; s9 < i13; s9++) l9.append(t10[s9], r()), A.nextNode(), c9.push({ type: 2, index: ++h9 });
143
+ l9.append(t10[i13], r());
144
+ }
145
+ }
146
+ } else if (8 === l9.nodeType) if (l9.data === n) c9.push({ type: 2, index: h9 });
147
+ else {
148
+ let t10 = -1;
149
+ for (; -1 !== (t10 = l9.data.indexOf(o, t10 + 1)); ) c9.push({ type: 7, index: h9 }), t10 += o.length - 1;
150
+ }
151
+ h9++;
152
+ }
153
+ }
154
+ static createElement(t9, i12) {
155
+ const s9 = h.createElement("template");
156
+ return s9.innerHTML = t9, s9;
157
+ }
158
+ };
159
+ V = class {
160
+ constructor(t9, i12) {
161
+ this.u = [], this._$AN = void 0, this._$AD = t9, this._$AM = i12;
162
+ }
163
+ get parentNode() {
164
+ return this._$AM.parentNode;
165
+ }
166
+ get _$AU() {
167
+ return this._$AM._$AU;
168
+ }
169
+ v(t9) {
170
+ var i12;
171
+ const { el: { content: s9 }, parts: e16 } = this._$AD, o18 = (null !== (i12 = null == t9 ? void 0 : t9.creationScope) && void 0 !== i12 ? i12 : h).importNode(s9, true);
172
+ A.currentNode = o18;
173
+ let n11 = A.nextNode(), l9 = 0, r7 = 0, d6 = e16[0];
174
+ for (; void 0 !== d6; ) {
175
+ if (l9 === d6.index) {
176
+ let i13;
177
+ 2 === d6.type ? i13 = new N(n11, n11.nextSibling, this, t9) : 1 === d6.type ? i13 = new d6.ctor(n11, d6.name, d6.strings, this, t9) : 6 === d6.type && (i13 = new I(n11, this, t9)), this.u.push(i13), d6 = e16[++r7];
178
+ }
179
+ l9 !== (null == d6 ? void 0 : d6.index) && (n11 = A.nextNode(), l9++);
180
+ }
181
+ return o18;
182
+ }
183
+ p(t9) {
184
+ let i12 = 0;
185
+ for (const s9 of this.u) void 0 !== s9 && (void 0 !== s9.strings ? (s9._$AI(t9, s9, i12), i12 += s9.strings.length - 2) : s9._$AI(t9[i12])), i12++;
186
+ }
187
+ };
188
+ N = class _N {
189
+ constructor(t9, i12, s9, e16) {
190
+ var o18;
191
+ this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = t9, this._$AB = i12, this._$AM = s9, this.options = e16, this._$Cm = null === (o18 = null == e16 ? void 0 : e16.isConnected) || void 0 === o18 || o18;
192
+ }
193
+ get _$AU() {
194
+ var t9, i12;
195
+ return null !== (i12 = null === (t9 = this._$AM) || void 0 === t9 ? void 0 : t9._$AU) && void 0 !== i12 ? i12 : this._$Cm;
196
+ }
197
+ get parentNode() {
198
+ let t9 = this._$AA.parentNode;
199
+ const i12 = this._$AM;
200
+ return void 0 !== i12 && 11 === t9.nodeType && (t9 = i12.parentNode), t9;
201
+ }
202
+ get startNode() {
203
+ return this._$AA;
204
+ }
205
+ get endNode() {
206
+ return this._$AB;
207
+ }
208
+ _$AI(t9, i12 = this) {
209
+ t9 = P(this, t9, i12), d(t9) ? t9 === b || null == t9 || "" === t9 ? (this._$AH !== b && this._$AR(), this._$AH = b) : t9 !== this._$AH && t9 !== x && this.g(t9) : void 0 !== t9._$litType$ ? this.$(t9) : void 0 !== t9.nodeType ? this.T(t9) : c(t9) ? this.k(t9) : this.g(t9);
210
+ }
211
+ O(t9, i12 = this._$AB) {
212
+ return this._$AA.parentNode.insertBefore(t9, i12);
213
+ }
214
+ T(t9) {
215
+ this._$AH !== t9 && (this._$AR(), this._$AH = this.O(t9));
216
+ }
217
+ g(t9) {
218
+ this._$AH !== b && d(this._$AH) ? this._$AA.nextSibling.data = t9 : this.T(h.createTextNode(t9)), this._$AH = t9;
219
+ }
220
+ $(t9) {
221
+ var i12;
222
+ const { values: s9, _$litType$: e16 } = t9, o18 = "number" == typeof e16 ? this._$AC(t9) : (void 0 === e16.el && (e16.el = C.createElement(e16.h, this.options)), e16);
223
+ if ((null === (i12 = this._$AH) || void 0 === i12 ? void 0 : i12._$AD) === o18) this._$AH.p(s9);
224
+ else {
225
+ const t10 = new V(o18, this), i13 = t10.v(this.options);
226
+ t10.p(s9), this.T(i13), this._$AH = t10;
227
+ }
228
+ }
229
+ _$AC(t9) {
230
+ let i12 = T.get(t9.strings);
231
+ return void 0 === i12 && T.set(t9.strings, i12 = new C(t9)), i12;
232
+ }
233
+ k(t9) {
234
+ u(this._$AH) || (this._$AH = [], this._$AR());
235
+ const i12 = this._$AH;
236
+ let s9, e16 = 0;
237
+ for (const o18 of t9) e16 === i12.length ? i12.push(s9 = new _N(this.O(r()), this.O(r()), this, this.options)) : s9 = i12[e16], s9._$AI(o18), e16++;
238
+ e16 < i12.length && (this._$AR(s9 && s9._$AB.nextSibling, e16), i12.length = e16);
239
+ }
240
+ _$AR(t9 = this._$AA.nextSibling, i12) {
241
+ var s9;
242
+ for (null === (s9 = this._$AP) || void 0 === s9 || s9.call(this, false, true, i12); t9 && t9 !== this._$AB; ) {
243
+ const i13 = t9.nextSibling;
244
+ t9.remove(), t9 = i13;
245
+ }
246
+ }
247
+ setConnected(t9) {
248
+ var i12;
249
+ void 0 === this._$AM && (this._$Cm = t9, null === (i12 = this._$AP) || void 0 === i12 || i12.call(this, t9));
250
+ }
251
+ };
252
+ S = class {
253
+ constructor(t9, i12, s9, e16, o18) {
254
+ this.type = 1, this._$AH = b, this._$AN = void 0, this.element = t9, this.name = i12, this._$AM = e16, this.options = o18, s9.length > 2 || "" !== s9[0] || "" !== s9[1] ? (this._$AH = Array(s9.length - 1).fill(new String()), this.strings = s9) : this._$AH = b;
255
+ }
256
+ get tagName() {
257
+ return this.element.tagName;
258
+ }
259
+ get _$AU() {
260
+ return this._$AM._$AU;
261
+ }
262
+ _$AI(t9, i12 = this, s9, e16) {
263
+ const o18 = this.strings;
264
+ let n11 = false;
265
+ if (void 0 === o18) t9 = P(this, t9, i12, 0), n11 = !d(t9) || t9 !== this._$AH && t9 !== x, n11 && (this._$AH = t9);
266
+ else {
267
+ const e17 = t9;
268
+ let l9, h9;
269
+ for (t9 = o18[0], l9 = 0; l9 < o18.length - 1; l9++) h9 = P(this, e17[s9 + l9], i12, l9), h9 === x && (h9 = this._$AH[l9]), n11 || (n11 = !d(h9) || h9 !== this._$AH[l9]), h9 === b ? t9 = b : t9 !== b && (t9 += (null != h9 ? h9 : "") + o18[l9 + 1]), this._$AH[l9] = h9;
270
+ }
271
+ n11 && !e16 && this.j(t9);
272
+ }
273
+ j(t9) {
274
+ t9 === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, null != t9 ? t9 : "");
275
+ }
276
+ };
277
+ M = class extends S {
278
+ constructor() {
279
+ super(...arguments), this.type = 3;
280
+ }
281
+ j(t9) {
282
+ this.element[this.name] = t9 === b ? void 0 : t9;
283
+ }
284
+ };
285
+ R = s ? s.emptyScript : "";
286
+ k = class extends S {
287
+ constructor() {
288
+ super(...arguments), this.type = 4;
289
+ }
290
+ j(t9) {
291
+ t9 && t9 !== b ? this.element.setAttribute(this.name, R) : this.element.removeAttribute(this.name);
292
+ }
293
+ };
294
+ H = class extends S {
295
+ constructor(t9, i12, s9, e16, o18) {
296
+ super(t9, i12, s9, e16, o18), this.type = 5;
297
+ }
298
+ _$AI(t9, i12 = this) {
299
+ var s9;
300
+ if ((t9 = null !== (s9 = P(this, t9, i12, 0)) && void 0 !== s9 ? s9 : b) === x) return;
301
+ const e16 = this._$AH, o18 = t9 === b && e16 !== b || t9.capture !== e16.capture || t9.once !== e16.once || t9.passive !== e16.passive, n11 = t9 !== b && (e16 === b || o18);
302
+ o18 && this.element.removeEventListener(this.name, this, e16), n11 && this.element.addEventListener(this.name, this, t9), this._$AH = t9;
303
+ }
304
+ handleEvent(t9) {
305
+ var i12, s9;
306
+ "function" == typeof this._$AH ? this._$AH.call(null !== (s9 = null === (i12 = this.options) || void 0 === i12 ? void 0 : i12.host) && void 0 !== s9 ? s9 : this.element, t9) : this._$AH.handleEvent(t9);
307
+ }
308
+ };
309
+ I = class {
310
+ constructor(t9, i12, s9) {
311
+ this.element = t9, this.type = 6, this._$AN = void 0, this._$AM = i12, this.options = s9;
312
+ }
313
+ get _$AU() {
314
+ return this._$AM._$AU;
315
+ }
316
+ _$AI(t9) {
317
+ P(this, t9);
318
+ }
319
+ };
320
+ L = { P: "$lit$", A: o, M: n, C: 1, L: E, R: V, D: c, V: P, I: N, H: S, N: k, U: H, B: M, F: I };
321
+ z = i.litHtmlPolyfillSupport;
322
+ null == z || z(C, N), (null !== (t = i.litHtmlVersions) && void 0 !== t ? t : i.litHtmlVersions = []).push("2.5.0");
323
+ Z = (t9, i12, s9) => {
324
+ var e16, o18;
325
+ const n11 = null !== (e16 = null == s9 ? void 0 : s9.renderBefore) && void 0 !== e16 ? e16 : i12;
326
+ let l9 = n11._$litPart$;
327
+ if (void 0 === l9) {
328
+ const t10 = null !== (o18 = null == s9 ? void 0 : s9.renderBefore) && void 0 !== o18 ? o18 : null;
329
+ n11._$litPart$ = l9 = new N(i12.insertBefore(r(), t10), t10, void 0, null != s9 ? s9 : {});
330
+ }
331
+ return l9._$AI(t9), l9;
332
+ };
333
+ }
334
+ });
335
+
336
+ // ../../node_modules/@rxdi/lit-html/dist/decorators/component.decorator.js
337
+ var require_component_decorator = __commonJS({
338
+ "../../node_modules/@rxdi/lit-html/dist/decorators/component.decorator.js"(exports) {
339
+ "use strict";
340
+ var __setFunctionName = exports && exports.__setFunctionName || function(f4, name, prefix) {
341
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
342
+ return Object.defineProperty(f4, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
343
+ };
344
+ Object.defineProperty(exports, "__esModule", { value: true });
345
+ exports.Component = void 0;
346
+ var lit_html_1 = (init_lit_html(), __toCommonJS(lit_html_exports));
347
+ var legacyCustomElement = (tagName, clazz, options) => {
348
+ window.customElements.define(tagName, clazz, options);
349
+ return clazz;
350
+ };
351
+ var standardCustomElement = (tagName, descriptor, options) => {
352
+ const { kind, elements } = descriptor;
353
+ return {
354
+ kind,
355
+ elements,
356
+ // This callback is called once the class is otherwise fully defined
357
+ finisher(clazz) {
358
+ window.customElements.define(tagName, clazz, options);
359
+ }
360
+ };
361
+ };
362
+ var isFunction = (v3) => typeof v3 === "function";
363
+ var customElement = (tag, config = {}) => (Base) => {
364
+ var _a;
365
+ var _b;
366
+ if ((_a = window._excluded_components) === null || _a === void 0 ? void 0 : _a.includes(config.selector)) {
367
+ return Base;
368
+ }
369
+ if (!tag || tag && tag.indexOf("-") <= 0) {
370
+ throw new Error(`You need at least 1 dash in the custom element name! ${Base}`);
371
+ }
372
+ config.styles = config.styles || [];
373
+ config.components = config.components || [];
374
+ const OnInit = Base.prototype.OnInit || function() {
375
+ };
376
+ const OnDestroy = Base.prototype.OnDestroy || function() {
377
+ };
378
+ const OnUpdate = Base.prototype.OnUpdate || function() {
379
+ };
380
+ const OnUpdateFirst = Base.prototype.OnUpdateFirst || function() {
381
+ };
382
+ const connectedCallback = Base.prototype.connectedCallback || function() {
383
+ };
384
+ const disconnectedCallback = Base.prototype.disconnectedCallback || function() {
385
+ };
386
+ const update = Base.prototype.update || function() {
387
+ };
388
+ const firstUpdated = Base.prototype.firstUpdated || function() {
389
+ };
390
+ if (!config.template) {
391
+ config.template = Base.prototype.render || (() => (0, lit_html_1.html)``);
392
+ }
393
+ if (config.style) {
394
+ config.styles.push(config.style);
395
+ }
396
+ const ModifiedClass = (_b = class extends Base {
397
+ static is() {
398
+ return tag;
399
+ }
400
+ getTemplateResult() {
401
+ return this;
402
+ }
403
+ OnInit() {
404
+ if (config.container) {
405
+ (0, lit_html_1.render)(config.template.call(this), config.container);
406
+ if (config.style) {
407
+ const style = document.createElement("style");
408
+ style.type = "text/css";
409
+ if (style["styleSheet"]) {
410
+ style["styleSheet"].cssText = config.style.toString();
411
+ } else {
412
+ style.appendChild(document.createTextNode(config.style.toString()));
413
+ }
414
+ config.container.prepend(style);
415
+ }
416
+ }
417
+ return OnInit.call(this);
418
+ }
419
+ disconnectedCallback() {
420
+ var _a2;
421
+ OnDestroy.call(this);
422
+ disconnectedCallback.call(this);
423
+ (_a2 = this._registry) === null || _a2 === void 0 ? void 0 : _a2.unsubscribe();
424
+ this._registry = null;
425
+ }
426
+ connectedCallback() {
427
+ var _a2, _c;
428
+ connectedCallback.call(this);
429
+ OnInit.call(this);
430
+ if (isFunction(config.registry)) {
431
+ this._registry = config.registry.call(this);
432
+ }
433
+ if ((_a2 = config.modifiers) === null || _a2 === void 0 ? void 0 : _a2.length) {
434
+ for (const modifier of config.modifiers) {
435
+ if (!modifier) {
436
+ throw new Error(`Provided null value inside modifiers for component "${config.selector}"`);
437
+ }
438
+ if (!modifier.options) {
439
+ throw new Error(`Missing options for attribute inside ${config.selector}`);
440
+ }
441
+ if (!((_c = modifier.options) === null || _c === void 0 ? void 0 : _c.selector)) {
442
+ throw new Error(`Missing attribute selector inside component "${config.selector}"`);
443
+ }
444
+ if (!this._registry && typeof modifier.options.registry === "function") {
445
+ this._registry = modifier.options.registry.call(this);
446
+ }
447
+ if (!this._registry) {
448
+ throw new Error(`Missing attribute registry for attribute "${modifier.options.selector}" and no default registry specified inside component "${config.selector}"`);
449
+ }
450
+ this._registry.define(modifier.options.selector, modifier);
451
+ }
452
+ }
453
+ }
454
+ render() {
455
+ return config.template.call(this);
456
+ }
457
+ update() {
458
+ update.call(this);
459
+ OnUpdate.call(this);
460
+ }
461
+ firstUpdated() {
462
+ firstUpdated.call(this);
463
+ OnUpdateFirst.call(this);
464
+ }
465
+ }, __setFunctionName(_b, "ModifiedClass"), _b.styles = config.styles, _b);
466
+ const registeredElement = window.customElements.get(tag);
467
+ if (registeredElement) {
468
+ console.error(`** IMPORTANT!!! **
469
+ ------------------------------------------
470
+ < ${tag} > </${tag}> Component re-defined multiple times and it is already registered inside customElements registry
471
+ Possible Solutions:
472
+ * Bundle problem where multiple versions of the component are used
473
+ * @Component decorator is used twice for the same component
474
+ * Defined "selector" with the same name in multiple components
475
+
476
+ ** If this is Server Side Rendering you can ignore this message **
477
+ ------------------------------------------
478
+ `);
479
+ return registeredElement;
480
+ }
481
+ if (typeof ModifiedClass === "function") {
482
+ legacyCustomElement(tag, ModifiedClass, {
483
+ extends: config.extends
484
+ });
485
+ } else {
486
+ standardCustomElement(tag, ModifiedClass, { extends: config.extends });
487
+ }
488
+ return ModifiedClass;
489
+ };
490
+ var Component2 = (config) => customElement(config.selector, config);
491
+ exports.Component = Component2;
492
+ }
493
+ });
494
+
495
+ // ../../node_modules/@rxdi/lit-html/dist/decorators/hooks/index.js
496
+ var require_hooks = __commonJS({
497
+ "../../node_modules/@rxdi/lit-html/dist/decorators/hooks/index.js"(exports) {
498
+ "use strict";
499
+ Object.defineProperty(exports, "__esModule", { value: true });
500
+ }
501
+ });
502
+
503
+ // ../../node_modules/@rxdi/lit-html/dist/decorators/index.js
504
+ var require_decorators = __commonJS({
505
+ "../../node_modules/@rxdi/lit-html/dist/decorators/index.js"(exports) {
506
+ "use strict";
507
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o18, m4, k2, k22) {
508
+ if (k22 === void 0) k22 = k2;
509
+ var desc = Object.getOwnPropertyDescriptor(m4, k2);
510
+ if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) {
511
+ desc = { enumerable: true, get: function() {
512
+ return m4[k2];
513
+ } };
514
+ }
515
+ Object.defineProperty(o18, k22, desc);
516
+ }) : (function(o18, m4, k2, k22) {
517
+ if (k22 === void 0) k22 = k2;
518
+ o18[k22] = m4[k2];
519
+ }));
520
+ var __exportStar = exports && exports.__exportStar || function(m4, exports2) {
521
+ for (var p4 in m4) if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p4)) __createBinding(exports2, m4, p4);
522
+ };
523
+ Object.defineProperty(exports, "__esModule", { value: true });
524
+ __exportStar(require_component_decorator(), exports);
525
+ __exportStar(require_hooks(), exports);
526
+ }
527
+ });
528
+
529
+ // ../../node_modules/lit-html/directive.js
530
+ var directive_exports = {};
531
+ __export(directive_exports, {
532
+ Directive: () => i2,
533
+ PartType: () => t2,
534
+ directive: () => e2
535
+ });
536
+ var t2, e2, i2;
537
+ var init_directive = __esm({
538
+ "../../node_modules/lit-html/directive.js"() {
539
+ t2 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
540
+ e2 = (t9) => (...e16) => ({ _$litDirective$: t9, values: e16 });
541
+ i2 = class {
542
+ constructor(t9) {
543
+ }
544
+ get _$AU() {
545
+ return this._$AM._$AU;
546
+ }
547
+ _$AT(t9, e16, i12) {
548
+ this._$Ct = t9, this._$AM = e16, this._$Ci = i12;
549
+ }
550
+ _$AS(t9, e16) {
551
+ return this.update(t9, e16);
552
+ }
553
+ update(t9, e16) {
554
+ return this.render(...e16);
555
+ }
556
+ };
557
+ }
558
+ });
559
+
560
+ // ../../node_modules/lit-html/directive-helpers.js
561
+ var directive_helpers_exports = {};
562
+ __export(directive_helpers_exports, {
563
+ TemplateResultType: () => i3,
564
+ clearPart: () => a2,
565
+ getCommittedValue: () => m2,
566
+ getDirectiveClass: () => v2,
567
+ insertPart: () => r2,
568
+ isDirectiveResult: () => d2,
569
+ isPrimitive: () => t3,
570
+ isSingleExpression: () => e3,
571
+ isTemplateResult: () => n2,
572
+ removePart: () => p2,
573
+ setChildPartValue: () => u2,
574
+ setCommittedValue: () => s2
575
+ });
576
+ var l2, t3, i3, n2, d2, v2, e3, c2, r2, u2, f2, s2, m2, p2, a2;
577
+ var init_directive_helpers = __esm({
578
+ "../../node_modules/lit-html/directive-helpers.js"() {
579
+ init_lit_html();
580
+ ({ I: l2 } = L);
581
+ t3 = (o18) => null === o18 || "object" != typeof o18 && "function" != typeof o18;
582
+ i3 = { HTML: 1, SVG: 2 };
583
+ n2 = (o18, l9) => void 0 === l9 ? void 0 !== (null == o18 ? void 0 : o18._$litType$) : (null == o18 ? void 0 : o18._$litType$) === l9;
584
+ d2 = (o18) => void 0 !== (null == o18 ? void 0 : o18._$litDirective$);
585
+ v2 = (o18) => null == o18 ? void 0 : o18._$litDirective$;
586
+ e3 = (o18) => void 0 === o18.strings;
587
+ c2 = () => document.createComment("");
588
+ r2 = (o18, t9, i12) => {
589
+ var n11;
590
+ const d6 = o18._$AA.parentNode, v3 = void 0 === t9 ? o18._$AB : t9._$AA;
591
+ if (void 0 === i12) {
592
+ const t10 = d6.insertBefore(c2(), v3), n12 = d6.insertBefore(c2(), v3);
593
+ i12 = new l2(t10, n12, o18, o18.options);
594
+ } else {
595
+ const l9 = i12._$AB.nextSibling, t10 = i12._$AM, e16 = t10 !== o18;
596
+ if (e16) {
597
+ let l10;
598
+ null === (n11 = i12._$AQ) || void 0 === n11 || n11.call(i12, o18), i12._$AM = o18, void 0 !== i12._$AP && (l10 = o18._$AU) !== t10._$AU && i12._$AP(l10);
599
+ }
600
+ if (l9 !== v3 || e16) {
601
+ let o19 = i12._$AA;
602
+ for (; o19 !== l9; ) {
603
+ const l10 = o19.nextSibling;
604
+ d6.insertBefore(o19, v3), o19 = l10;
605
+ }
606
+ }
607
+ }
608
+ return i12;
609
+ };
610
+ u2 = (o18, l9, t9 = o18) => (o18._$AI(l9, t9), o18);
611
+ f2 = {};
612
+ s2 = (o18, l9 = f2) => o18._$AH = l9;
613
+ m2 = (o18) => o18._$AH;
614
+ p2 = (o18) => {
615
+ var l9;
616
+ null === (l9 = o18._$AP) || void 0 === l9 || l9.call(o18, false, true);
617
+ let t9 = o18._$AA;
618
+ const i12 = o18._$AB.nextSibling;
619
+ for (; t9 !== i12; ) {
620
+ const o19 = t9.nextSibling;
621
+ t9.remove(), t9 = o19;
622
+ }
623
+ };
624
+ a2 = (o18) => {
625
+ o18._$AR();
626
+ };
627
+ }
628
+ });
629
+
630
+ // ../../node_modules/lit-html/async-directive.js
631
+ var async_directive_exports = {};
632
+ __export(async_directive_exports, {
633
+ AsyncDirective: () => c3,
634
+ Directive: () => i2,
635
+ PartType: () => t2,
636
+ directive: () => e2
637
+ });
638
+ function n3(i12) {
639
+ void 0 !== this._$AN ? (o2(this), this._$AM = i12, r3(this)) : this._$AM = i12;
640
+ }
641
+ function h2(i12, t9 = false, e16 = 0) {
642
+ const r7 = this._$AH, n11 = this._$AN;
643
+ if (void 0 !== n11 && 0 !== n11.size) if (t9) if (Array.isArray(r7)) for (let i13 = e16; i13 < r7.length; i13++) s3(r7[i13], false), o2(r7[i13]);
644
+ else null != r7 && (s3(r7, false), o2(r7));
645
+ else s3(this, i12);
646
+ }
647
+ var s3, o2, r3, l3, c3;
648
+ var init_async_directive = __esm({
649
+ "../../node_modules/lit-html/async-directive.js"() {
650
+ init_directive_helpers();
651
+ init_directive();
652
+ init_directive();
653
+ s3 = (i12, t9) => {
654
+ var e16, o18;
655
+ const r7 = i12._$AN;
656
+ if (void 0 === r7) return false;
657
+ for (const i13 of r7) null === (o18 = (e16 = i13)._$AO) || void 0 === o18 || o18.call(e16, t9, false), s3(i13, t9);
658
+ return true;
659
+ };
660
+ o2 = (i12) => {
661
+ let t9, e16;
662
+ do {
663
+ if (void 0 === (t9 = i12._$AM)) break;
664
+ e16 = t9._$AN, e16.delete(i12), i12 = t9;
665
+ } while (0 === (null == e16 ? void 0 : e16.size));
666
+ };
667
+ r3 = (i12) => {
668
+ for (let t9; t9 = i12._$AM; i12 = t9) {
669
+ let e16 = t9._$AN;
670
+ if (void 0 === e16) t9._$AN = e16 = /* @__PURE__ */ new Set();
671
+ else if (e16.has(i12)) break;
672
+ e16.add(i12), l3(t9);
673
+ }
674
+ };
675
+ l3 = (i12) => {
676
+ var t9, s9, o18, r7;
677
+ i12.type == t2.CHILD && (null !== (t9 = (o18 = i12)._$AP) && void 0 !== t9 || (o18._$AP = h2), null !== (s9 = (r7 = i12)._$AQ) && void 0 !== s9 || (r7._$AQ = n3));
678
+ };
679
+ c3 = class extends i2 {
680
+ constructor() {
681
+ super(...arguments), this._$AN = void 0;
682
+ }
683
+ _$AT(i12, t9, e16) {
684
+ super._$AT(i12, t9, e16), r3(this), this.isConnected = i12._$AU;
685
+ }
686
+ _$AO(i12, t9 = true) {
687
+ var e16, r7;
688
+ i12 !== this.isConnected && (this.isConnected = i12, i12 ? null === (e16 = this.reconnected) || void 0 === e16 || e16.call(this) : null === (r7 = this.disconnected) || void 0 === r7 || r7.call(this)), t9 && (s3(this, i12), o2(this));
689
+ }
690
+ setValue(t9) {
691
+ if (e3(this._$Ct)) this._$Ct._$AI(t9, this);
692
+ else {
693
+ const i12 = [...this._$Ct._$AH];
694
+ i12[this._$Ci] = t9, this._$Ct._$AI(i12, this, 0);
695
+ }
696
+ }
697
+ disconnected() {
698
+ }
699
+ reconnected() {
700
+ }
701
+ };
702
+ }
703
+ });
704
+
705
+ // ../../node_modules/@rxdi/lit-html/dist/async.js
706
+ var require_async = __commonJS({
707
+ "../../node_modules/@rxdi/lit-html/dist/async.js"(exports) {
708
+ "use strict";
709
+ Object.defineProperty(exports, "__esModule", { value: true });
710
+ exports.async = void 0;
711
+ var directive_1 = (init_directive(), __toCommonJS(directive_exports));
712
+ var async_directive_1 = (init_async_directive(), __toCommonJS(async_directive_exports));
713
+ var lit_html_1 = (init_lit_html(), __toCommonJS(lit_html_exports));
714
+ var ObserveDirective = class extends async_directive_1.AsyncDirective {
715
+ // When the observable changes, unsubscribe to the old one and
716
+ // subscribe to the new one
717
+ render(asyncResult) {
718
+ if ("then" in asyncResult) {
719
+ Promise.resolve(asyncResult).then((v3) => this.setValue(v3));
720
+ return "";
721
+ }
722
+ if (this.observable !== asyncResult) {
723
+ this.unsubscribe();
724
+ this.observable = asyncResult;
725
+ if (this.isConnected) {
726
+ this.subscribe(asyncResult);
727
+ }
728
+ }
729
+ return lit_html_1.noChange;
730
+ }
731
+ // Subscribes to the observable, calling the directive's asynchronous
732
+ // setValue API each time the value changes
733
+ subscribe(observable) {
734
+ this.subscription = observable.subscribe((v3) => {
735
+ this.setValue(v3);
736
+ });
737
+ }
738
+ // When the directive is disconnected from the DOM, unsubscribe to ensure
739
+ // the directive instance can be garbage collected
740
+ disconnected() {
741
+ this.unsubscribe();
742
+ }
743
+ unsubscribe() {
744
+ if (this.subscription) {
745
+ this.subscription.unsubscribe();
746
+ }
747
+ }
748
+ // If the subtree the directive is in was disconneted and subsequently
749
+ // re-connected, re-subscribe to make the directive operable again
750
+ reconnected() {
751
+ this.subscribe(this.observable);
752
+ }
753
+ };
754
+ exports.async = (0, directive_1.directive)(ObserveDirective);
755
+ }
756
+ });
757
+
758
+ // ../../node_modules/lit-html/experimental-hydrate.js
759
+ var experimental_hydrate_exports = {};
760
+ __export(experimental_hydrate_exports, {
761
+ digestForTemplateResult: () => m3,
762
+ hydrate: () => f3
763
+ });
764
+ var i4, a3, s4, c4, d3, f3, p3, u3, h3, m3;
765
+ var init_experimental_hydrate = __esm({
766
+ "../../node_modules/lit-html/experimental-hydrate.js"() {
767
+ init_lit_html();
768
+ init_directive();
769
+ init_directive_helpers();
770
+ ({ R: i4, D: a3, V: s4, I: c4, F: d3 } = L);
771
+ f3 = (e16, t9, r7 = {}) => {
772
+ if (void 0 !== t9._$litPart$) throw Error("container already contains a live render");
773
+ let n11, o18;
774
+ const l9 = [], i12 = document.createTreeWalker(t9, NodeFilter.SHOW_COMMENT, null, false);
775
+ let a5;
776
+ for (; null !== (a5 = i12.nextNode()); ) {
777
+ const t10 = a5.data;
778
+ if (t10.startsWith("lit-part")) {
779
+ if (0 === l9.length && void 0 !== n11) throw Error("there must be only one root part per container");
780
+ o18 = p3(e16, a5, l9, r7), null != n11 || (n11 = o18);
781
+ } else if (t10.startsWith("lit-node")) h3(a5, l9, r7);
782
+ else if (t10.startsWith("/lit-part")) {
783
+ if (1 === l9.length && o18 !== n11) throw Error("internal error");
784
+ o18 = u3(a5, o18, l9);
785
+ }
786
+ }
787
+ console.assert(void 0 !== n11, "there should be exactly one root part in a render container"), t9._$litPart$ = n11;
788
+ };
789
+ p3 = (t9, r7, l9, d6) => {
790
+ let f4, p4;
791
+ if (0 === l9.length) p4 = new c4(r7, null, void 0, d6), f4 = t9;
792
+ else {
793
+ const e16 = l9[l9.length - 1];
794
+ if ("template-instance" === e16.type) p4 = new c4(r7, null, e16.instance, d6), e16.instance.u.push(p4), f4 = e16.result.values[e16.instancePartIndex++], e16.templatePartIndex++;
795
+ else if ("iterable" === e16.type) {
796
+ p4 = new c4(r7, null, e16.part, d6);
797
+ const t10 = e16.iterator.next();
798
+ if (t10.done) throw f4 = void 0, e16.done = true, Error("Unhandled shorter than expected iterable");
799
+ f4 = t10.value, e16.part._$AH.push(p4);
800
+ } else p4 = new c4(r7, null, e16.part, d6);
801
+ }
802
+ if (f4 = s4(p4, f4), f4 === x) l9.push({ part: p4, type: "leaf" });
803
+ else if (t3(f4)) l9.push({ part: p4, type: "leaf" }), p4._$AH = f4;
804
+ else if (n2(f4)) {
805
+ const e16 = "lit-part " + m3(f4);
806
+ if (r7.data !== e16) throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");
807
+ {
808
+ const e17 = c4.prototype._$AC(f4), t10 = new i4(e17, p4);
809
+ l9.push({ type: "template-instance", instance: t10, part: p4, templatePartIndex: 0, instancePartIndex: 0, result: f4 }), p4._$AH = t10;
810
+ }
811
+ } else a3(f4) ? (l9.push({ part: p4, type: "iterable", value: f4, iterator: f4[Symbol.iterator](), done: false }), p4._$AH = []) : (l9.push({ part: p4, type: "leaf" }), p4._$AH = null == f4 ? "" : f4);
812
+ return p4;
813
+ };
814
+ u3 = (e16, t9, r7) => {
815
+ if (void 0 === t9) throw Error("unbalanced part marker");
816
+ t9._$AB = e16;
817
+ const n11 = r7.pop();
818
+ if ("iterable" === n11.type && !n11.iterator.next().done) throw Error("unexpected longer than expected iterable");
819
+ if (r7.length > 0) return r7[r7.length - 1].part;
820
+ };
821
+ h3 = (e16, t9, n11) => {
822
+ var o18;
823
+ const i12 = /lit-node (\d+)/.exec(e16.data), a5 = parseInt(i12[1]), c9 = null !== (o18 = e16.previousElementSibling) && void 0 !== o18 ? o18 : e16.parentElement;
824
+ if (null === c9) throw Error("could not find node for attribute parts");
825
+ c9.removeAttribute("defer-hydration");
826
+ const f4 = t9[t9.length - 1];
827
+ if ("template-instance" !== f4.type) throw Error("internal error");
828
+ {
829
+ const e17 = f4.instance;
830
+ for (; ; ) {
831
+ const t10 = e17._$AD.parts[f4.templatePartIndex];
832
+ if (void 0 === t10 || t10.type !== t2.ATTRIBUTE && t10.type !== t2.ELEMENT || t10.index !== a5) break;
833
+ if (t10.type === t2.ATTRIBUTE) {
834
+ const o19 = new t10.ctor(c9, t10.name, t10.strings, f4.instance, n11), i13 = e3(o19) ? f4.result.values[f4.instancePartIndex] : f4.result.values, a6 = !(o19.type === t2.EVENT || o19.type === t2.PROPERTY);
835
+ o19._$AI(i13, o19, f4.instancePartIndex, a6), f4.instancePartIndex += t10.strings.length - 1, e17.u.push(o19);
836
+ } else {
837
+ const t11 = new d3(c9, f4.instance, n11);
838
+ s4(t11, f4.result.values[f4.instancePartIndex++]), e17.u.push(t11);
839
+ }
840
+ f4.templatePartIndex++;
841
+ }
842
+ }
843
+ };
844
+ m3 = (e16) => {
845
+ const t9 = new Uint32Array(2).fill(5381);
846
+ for (const r7 of e16.strings) for (let e17 = 0; e17 < r7.length; e17++) t9[e17 % 2] = 33 * t9[e17 % 2] ^ r7.charCodeAt(e17);
847
+ return btoa(String.fromCharCode(...new Uint8Array(t9.buffer)));
848
+ };
849
+ }
850
+ });
851
+
852
+ // ../../node_modules/lit-element/experimental-hydrate-support.js
853
+ var experimental_hydrate_support_exports = {};
854
+ var init_experimental_hydrate_support = __esm({
855
+ "../../node_modules/lit-element/experimental-hydrate-support.js"() {
856
+ init_lit_html();
857
+ init_experimental_hydrate();
858
+ globalThis.litElementHydrateSupport = ({ LitElement: s9 }) => {
859
+ const e16 = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s9), "observedAttributes").get;
860
+ Object.defineProperty(s9, "observedAttributes", { get() {
861
+ return [...e16.call(this), "defer-hydration"];
862
+ } });
863
+ const h9 = s9.prototype.attributeChangedCallback;
864
+ s9.prototype.attributeChangedCallback = function(t9, i12, s10) {
865
+ "defer-hydration" === t9 && null === s10 && n11.call(this), h9.call(this, t9, i12, s10);
866
+ };
867
+ const n11 = s9.prototype.connectedCallback;
868
+ s9.prototype.connectedCallback = function() {
869
+ this.hasAttribute("defer-hydration") || n11.call(this);
870
+ };
871
+ const o18 = s9.prototype.createRenderRoot;
872
+ s9.prototype.createRenderRoot = function() {
873
+ return this.shadowRoot ? (this._$AG = true, this.shadowRoot) : o18.call(this);
874
+ };
875
+ const r7 = Object.getPrototypeOf(s9.prototype).update;
876
+ s9.prototype.update = function(s10) {
877
+ const e17 = this.render();
878
+ r7.call(this, s10), this._$AG ? (this._$AG = false, f3(e17, this.renderRoot, this.renderOptions)) : Z(e17, this.renderRoot, this.renderOptions);
879
+ };
880
+ };
881
+ }
882
+ });
883
+
884
+ // ../../node_modules/lit-html/polyfill-support.js
885
+ var require_polyfill_support = __commonJS({
886
+ "../../node_modules/lit-html/polyfill-support.js"() {
887
+ !(function(i12) {
888
+ "function" == typeof define && define.amd ? define(i12) : i12();
889
+ })((function() {
890
+ "use strict";
891
+ var i12, n11 = /* @__PURE__ */ new Set(), o18 = /* @__PURE__ */ new Map();
892
+ null !== (i12 = globalThis.litHtmlPolyfillSupport) && void 0 !== i12 || (globalThis.litHtmlPolyfillSupport = function(i13, t9) {
893
+ if (void 0 !== window.ShadyCSS && (!window.ShadyCSS.nativeShadow || window.ShadyCSS.ApplyShim)) {
894
+ var d6 = function(i14) {
895
+ return void 0 !== i14 && !n11.has(i14);
896
+ }, e16 = function(i14) {
897
+ var n12 = o18.get(i14);
898
+ return void 0 === n12 && o18.set(i14, n12 = []), n12;
899
+ }, v3 = /* @__PURE__ */ new Map(), u5 = i13.createElement;
900
+ i13.createElement = function(n12, o19) {
901
+ var t10 = u5.call(i13, n12, o19), v4 = null == o19 ? void 0 : o19.scope;
902
+ if (void 0 !== v4 && (window.ShadyCSS.nativeShadow || window.ShadyCSS.prepareTemplateDom(t10, v4), d6(v4))) {
903
+ var l10 = e16(v4), r8 = t10.content.querySelectorAll("style");
904
+ l10.push.apply(l10, Array.from(r8).map((function(i14) {
905
+ var n13;
906
+ return null === (n13 = i14.parentNode) || void 0 === n13 || n13.removeChild(i14), i14.textContent;
907
+ })));
908
+ }
909
+ return t10;
910
+ };
911
+ var l9 = document.createDocumentFragment(), r7 = document.createComment(""), a5 = t9.prototype, s9 = a5._$AI;
912
+ a5._$AI = function(i14, t10) {
913
+ var v4, u6;
914
+ void 0 === t10 && (t10 = this);
915
+ var a6 = this._$AA.parentNode, w2 = null === (v4 = this.options) || void 0 === v4 ? void 0 : v4.scope;
916
+ if (a6 instanceof ShadowRoot && d6(w2)) {
917
+ var f4 = this._$AA, c9 = this._$AB;
918
+ l9.appendChild(r7), this._$AA = r7, this._$AB = null, s9.call(this, i14, t10);
919
+ var h9 = (null == i14 ? void 0 : i14._$litType$) ? this._$AH._$AD.el : document.createElement("template");
920
+ if ((function(i15, t11) {
921
+ var d7, v5 = e16(i15), u7 = 0 !== v5.length;
922
+ u7 && ((d7 = document.createElement("style")).textContent = v5.join("\n"), t11.content.appendChild(d7)), n11.add(i15), o18.delete(i15), window.ShadyCSS.prepareTemplateStyles(t11, i15), u7 && window.ShadyCSS.nativeShadow && null !== (d7 = t11.content.querySelector("style")) && t11.content.appendChild(d7);
923
+ })(w2, h9), l9.removeChild(r7), null === (u6 = window.ShadyCSS) || void 0 === u6 ? void 0 : u6.nativeShadow) {
924
+ var y2 = h9.content.querySelector("style");
925
+ null !== y2 && l9.appendChild(y2.cloneNode(true));
926
+ }
927
+ a6.insertBefore(l9, c9), this._$AA = f4, this._$AB = c9;
928
+ } else s9.call(this, i14, t10);
929
+ }, a5._$AC = function(n12) {
930
+ var o19, t10 = null === (o19 = this.options) || void 0 === o19 ? void 0 : o19.scope, d7 = v3.get(t10);
931
+ void 0 === d7 && v3.set(t10, d7 = /* @__PURE__ */ new Map());
932
+ var e17 = d7.get(n12.strings);
933
+ return void 0 === e17 && d7.set(n12.strings, e17 = new i13(n12, this.options)), e17;
934
+ };
935
+ }
936
+ });
937
+ }));
938
+ }
939
+ });
940
+
941
+ // ../../node_modules/@lit/reactive-element/css-tag.js
942
+ var t4, e4, s5, n4, o3, r4, i5, S2, c5;
943
+ var init_css_tag = __esm({
944
+ "../../node_modules/@lit/reactive-element/css-tag.js"() {
945
+ t4 = window;
946
+ e4 = t4.ShadowRoot && (void 0 === t4.ShadyCSS || t4.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
947
+ s5 = /* @__PURE__ */ Symbol();
948
+ n4 = /* @__PURE__ */ new WeakMap();
949
+ o3 = class {
950
+ constructor(t9, e16, n11) {
951
+ if (this._$cssResult$ = true, n11 !== s5) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
952
+ this.cssText = t9, this.t = e16;
953
+ }
954
+ get styleSheet() {
955
+ let t9 = this.o;
956
+ const s9 = this.t;
957
+ if (e4 && void 0 === t9) {
958
+ const e16 = void 0 !== s9 && 1 === s9.length;
959
+ e16 && (t9 = n4.get(s9)), void 0 === t9 && ((this.o = t9 = new CSSStyleSheet()).replaceSync(this.cssText), e16 && n4.set(s9, t9));
960
+ }
961
+ return t9;
962
+ }
963
+ toString() {
964
+ return this.cssText;
965
+ }
966
+ };
967
+ r4 = (t9) => new o3("string" == typeof t9 ? t9 : t9 + "", void 0, s5);
968
+ i5 = (t9, ...e16) => {
969
+ const n11 = 1 === t9.length ? t9[0] : e16.reduce(((e17, s9, n12) => e17 + ((t10) => {
970
+ if (true === t10._$cssResult$) return t10.cssText;
971
+ if ("number" == typeof t10) return t10;
972
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + t10 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
973
+ })(s9) + t9[n12 + 1]), t9[0]);
974
+ return new o3(n11, t9, s5);
975
+ };
976
+ S2 = (s9, n11) => {
977
+ e4 ? s9.adoptedStyleSheets = n11.map(((t9) => t9 instanceof CSSStyleSheet ? t9 : t9.styleSheet)) : n11.forEach(((e16) => {
978
+ const n12 = document.createElement("style"), o18 = t4.litNonce;
979
+ void 0 !== o18 && n12.setAttribute("nonce", o18), n12.textContent = e16.cssText, s9.appendChild(n12);
980
+ }));
981
+ };
982
+ c5 = e4 ? (t9) => t9 : (t9) => t9 instanceof CSSStyleSheet ? ((t10) => {
983
+ let e16 = "";
984
+ for (const s9 of t10.cssRules) e16 += s9.cssText;
985
+ return r4(e16);
986
+ })(t9) : t9;
987
+ }
988
+ });
989
+
990
+ // ../../node_modules/@lit/reactive-element/reactive-element.js
991
+ var s6, e5, r5, h4, o4, n5, a4, l4, d4;
992
+ var init_reactive_element = __esm({
993
+ "../../node_modules/@lit/reactive-element/reactive-element.js"() {
994
+ init_css_tag();
995
+ init_css_tag();
996
+ e5 = window;
997
+ r5 = e5.trustedTypes;
998
+ h4 = r5 ? r5.emptyScript : "";
999
+ o4 = e5.reactiveElementPolyfillSupport;
1000
+ n5 = { toAttribute(t9, i12) {
1001
+ switch (i12) {
1002
+ case Boolean:
1003
+ t9 = t9 ? h4 : null;
1004
+ break;
1005
+ case Object:
1006
+ case Array:
1007
+ t9 = null == t9 ? t9 : JSON.stringify(t9);
1008
+ }
1009
+ return t9;
1010
+ }, fromAttribute(t9, i12) {
1011
+ let s9 = t9;
1012
+ switch (i12) {
1013
+ case Boolean:
1014
+ s9 = null !== t9;
1015
+ break;
1016
+ case Number:
1017
+ s9 = null === t9 ? null : Number(t9);
1018
+ break;
1019
+ case Object:
1020
+ case Array:
1021
+ try {
1022
+ s9 = JSON.parse(t9);
1023
+ } catch (t10) {
1024
+ s9 = null;
1025
+ }
1026
+ }
1027
+ return s9;
1028
+ } };
1029
+ a4 = (t9, i12) => i12 !== t9 && (i12 == i12 || t9 == t9);
1030
+ l4 = { attribute: true, type: String, converter: n5, reflect: false, hasChanged: a4 };
1031
+ d4 = class extends HTMLElement {
1032
+ constructor() {
1033
+ super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = false, this.hasUpdated = false, this._$El = null, this.u();
1034
+ }
1035
+ static addInitializer(t9) {
1036
+ var i12;
1037
+ this.finalize(), (null !== (i12 = this.h) && void 0 !== i12 ? i12 : this.h = []).push(t9);
1038
+ }
1039
+ static get observedAttributes() {
1040
+ this.finalize();
1041
+ const t9 = [];
1042
+ return this.elementProperties.forEach(((i12, s9) => {
1043
+ const e16 = this._$Ep(s9, i12);
1044
+ void 0 !== e16 && (this._$Ev.set(e16, s9), t9.push(e16));
1045
+ })), t9;
1046
+ }
1047
+ static createProperty(t9, i12 = l4) {
1048
+ if (i12.state && (i12.attribute = false), this.finalize(), this.elementProperties.set(t9, i12), !i12.noAccessor && !this.prototype.hasOwnProperty(t9)) {
1049
+ const s9 = "symbol" == typeof t9 ? /* @__PURE__ */ Symbol() : "__" + t9, e16 = this.getPropertyDescriptor(t9, s9, i12);
1050
+ void 0 !== e16 && Object.defineProperty(this.prototype, t9, e16);
1051
+ }
1052
+ }
1053
+ static getPropertyDescriptor(t9, i12, s9) {
1054
+ return { get() {
1055
+ return this[i12];
1056
+ }, set(e16) {
1057
+ const r7 = this[t9];
1058
+ this[i12] = e16, this.requestUpdate(t9, r7, s9);
1059
+ }, configurable: true, enumerable: true };
1060
+ }
1061
+ static getPropertyOptions(t9) {
1062
+ return this.elementProperties.get(t9) || l4;
1063
+ }
1064
+ static finalize() {
1065
+ if (this.hasOwnProperty("finalized")) return false;
1066
+ this.finalized = true;
1067
+ const t9 = Object.getPrototypeOf(this);
1068
+ if (t9.finalize(), void 0 !== t9.h && (this.h = [...t9.h]), this.elementProperties = new Map(t9.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
1069
+ const t10 = this.properties, i12 = [...Object.getOwnPropertyNames(t10), ...Object.getOwnPropertySymbols(t10)];
1070
+ for (const s9 of i12) this.createProperty(s9, t10[s9]);
1071
+ }
1072
+ return this.elementStyles = this.finalizeStyles(this.styles), true;
1073
+ }
1074
+ static finalizeStyles(i12) {
1075
+ const s9 = [];
1076
+ if (Array.isArray(i12)) {
1077
+ const e16 = new Set(i12.flat(1 / 0).reverse());
1078
+ for (const i13 of e16) s9.unshift(c5(i13));
1079
+ } else void 0 !== i12 && s9.push(c5(i12));
1080
+ return s9;
1081
+ }
1082
+ static _$Ep(t9, i12) {
1083
+ const s9 = i12.attribute;
1084
+ return false === s9 ? void 0 : "string" == typeof s9 ? s9 : "string" == typeof t9 ? t9.toLowerCase() : void 0;
1085
+ }
1086
+ u() {
1087
+ var t9;
1088
+ this._$E_ = new Promise(((t10) => this.enableUpdating = t10)), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), null === (t9 = this.constructor.h) || void 0 === t9 || t9.forEach(((t10) => t10(this)));
1089
+ }
1090
+ addController(t9) {
1091
+ var i12, s9;
1092
+ (null !== (i12 = this._$ES) && void 0 !== i12 ? i12 : this._$ES = []).push(t9), void 0 !== this.renderRoot && this.isConnected && (null === (s9 = t9.hostConnected) || void 0 === s9 || s9.call(t9));
1093
+ }
1094
+ removeController(t9) {
1095
+ var i12;
1096
+ null === (i12 = this._$ES) || void 0 === i12 || i12.splice(this._$ES.indexOf(t9) >>> 0, 1);
1097
+ }
1098
+ _$Eg() {
1099
+ this.constructor.elementProperties.forEach(((t9, i12) => {
1100
+ this.hasOwnProperty(i12) && (this._$Ei.set(i12, this[i12]), delete this[i12]);
1101
+ }));
1102
+ }
1103
+ createRenderRoot() {
1104
+ var t9;
1105
+ const s9 = null !== (t9 = this.shadowRoot) && void 0 !== t9 ? t9 : this.attachShadow(this.constructor.shadowRootOptions);
1106
+ return S2(s9, this.constructor.elementStyles), s9;
1107
+ }
1108
+ connectedCallback() {
1109
+ var t9;
1110
+ void 0 === this.renderRoot && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), null === (t9 = this._$ES) || void 0 === t9 || t9.forEach(((t10) => {
1111
+ var i12;
1112
+ return null === (i12 = t10.hostConnected) || void 0 === i12 ? void 0 : i12.call(t10);
1113
+ }));
1114
+ }
1115
+ enableUpdating(t9) {
1116
+ }
1117
+ disconnectedCallback() {
1118
+ var t9;
1119
+ null === (t9 = this._$ES) || void 0 === t9 || t9.forEach(((t10) => {
1120
+ var i12;
1121
+ return null === (i12 = t10.hostDisconnected) || void 0 === i12 ? void 0 : i12.call(t10);
1122
+ }));
1123
+ }
1124
+ attributeChangedCallback(t9, i12, s9) {
1125
+ this._$AK(t9, s9);
1126
+ }
1127
+ _$EO(t9, i12, s9 = l4) {
1128
+ var e16;
1129
+ const r7 = this.constructor._$Ep(t9, s9);
1130
+ if (void 0 !== r7 && true === s9.reflect) {
1131
+ const h9 = (void 0 !== (null === (e16 = s9.converter) || void 0 === e16 ? void 0 : e16.toAttribute) ? s9.converter : n5).toAttribute(i12, s9.type);
1132
+ this._$El = t9, null == h9 ? this.removeAttribute(r7) : this.setAttribute(r7, h9), this._$El = null;
1133
+ }
1134
+ }
1135
+ _$AK(t9, i12) {
1136
+ var s9;
1137
+ const e16 = this.constructor, r7 = e16._$Ev.get(t9);
1138
+ if (void 0 !== r7 && this._$El !== r7) {
1139
+ const t10 = e16.getPropertyOptions(r7), h9 = "function" == typeof t10.converter ? { fromAttribute: t10.converter } : void 0 !== (null === (s9 = t10.converter) || void 0 === s9 ? void 0 : s9.fromAttribute) ? t10.converter : n5;
1140
+ this._$El = r7, this[r7] = h9.fromAttribute(i12, t10.type), this._$El = null;
1141
+ }
1142
+ }
1143
+ requestUpdate(t9, i12, s9) {
1144
+ let e16 = true;
1145
+ void 0 !== t9 && (((s9 = s9 || this.constructor.getPropertyOptions(t9)).hasChanged || a4)(this[t9], i12) ? (this._$AL.has(t9) || this._$AL.set(t9, i12), true === s9.reflect && this._$El !== t9 && (void 0 === this._$EC && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t9, s9))) : e16 = false), !this.isUpdatePending && e16 && (this._$E_ = this._$Ej());
1146
+ }
1147
+ async _$Ej() {
1148
+ this.isUpdatePending = true;
1149
+ try {
1150
+ await this._$E_;
1151
+ } catch (t10) {
1152
+ Promise.reject(t10);
1153
+ }
1154
+ const t9 = this.scheduleUpdate();
1155
+ return null != t9 && await t9, !this.isUpdatePending;
1156
+ }
1157
+ scheduleUpdate() {
1158
+ return this.performUpdate();
1159
+ }
1160
+ performUpdate() {
1161
+ var t9;
1162
+ if (!this.isUpdatePending) return;
1163
+ this.hasUpdated, this._$Ei && (this._$Ei.forEach(((t10, i13) => this[i13] = t10)), this._$Ei = void 0);
1164
+ let i12 = false;
1165
+ const s9 = this._$AL;
1166
+ try {
1167
+ i12 = this.shouldUpdate(s9), i12 ? (this.willUpdate(s9), null === (t9 = this._$ES) || void 0 === t9 || t9.forEach(((t10) => {
1168
+ var i13;
1169
+ return null === (i13 = t10.hostUpdate) || void 0 === i13 ? void 0 : i13.call(t10);
1170
+ })), this.update(s9)) : this._$Ek();
1171
+ } catch (t10) {
1172
+ throw i12 = false, this._$Ek(), t10;
1173
+ }
1174
+ i12 && this._$AE(s9);
1175
+ }
1176
+ willUpdate(t9) {
1177
+ }
1178
+ _$AE(t9) {
1179
+ var i12;
1180
+ null === (i12 = this._$ES) || void 0 === i12 || i12.forEach(((t10) => {
1181
+ var i13;
1182
+ return null === (i13 = t10.hostUpdated) || void 0 === i13 ? void 0 : i13.call(t10);
1183
+ })), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t9)), this.updated(t9);
1184
+ }
1185
+ _$Ek() {
1186
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
1187
+ }
1188
+ get updateComplete() {
1189
+ return this.getUpdateComplete();
1190
+ }
1191
+ getUpdateComplete() {
1192
+ return this._$E_;
1193
+ }
1194
+ shouldUpdate(t9) {
1195
+ return true;
1196
+ }
1197
+ update(t9) {
1198
+ void 0 !== this._$EC && (this._$EC.forEach(((t10, i12) => this._$EO(i12, this[i12], t10))), this._$EC = void 0), this._$Ek();
1199
+ }
1200
+ updated(t9) {
1201
+ }
1202
+ firstUpdated(t9) {
1203
+ }
1204
+ };
1205
+ d4.finalized = true, d4.elementProperties = /* @__PURE__ */ new Map(), d4.elementStyles = [], d4.shadowRootOptions = { mode: "open" }, null == o4 || o4({ ReactiveElement: d4 }), (null !== (s6 = e5.reactiveElementVersions) && void 0 !== s6 ? s6 : e5.reactiveElementVersions = []).push("1.5.0");
1206
+ }
1207
+ });
1208
+
1209
+ // ../../node_modules/lit-element/lit-element.js
1210
+ var l5, o5, r6, s7, n6, h5;
1211
+ var init_lit_element = __esm({
1212
+ "../../node_modules/lit-element/lit-element.js"() {
1213
+ init_reactive_element();
1214
+ init_reactive_element();
1215
+ init_lit_html();
1216
+ init_lit_html();
1217
+ r6 = d4;
1218
+ s7 = class extends d4 {
1219
+ constructor() {
1220
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1221
+ }
1222
+ createRenderRoot() {
1223
+ var t9, e16;
1224
+ const i12 = super.createRenderRoot();
1225
+ return null !== (t9 = (e16 = this.renderOptions).renderBefore) && void 0 !== t9 || (e16.renderBefore = i12.firstChild), i12;
1226
+ }
1227
+ update(t9) {
1228
+ const i12 = this.render();
1229
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t9), this._$Do = Z(i12, this.renderRoot, this.renderOptions);
1230
+ }
1231
+ connectedCallback() {
1232
+ var t9;
1233
+ super.connectedCallback(), null === (t9 = this._$Do) || void 0 === t9 || t9.setConnected(true);
1234
+ }
1235
+ disconnectedCallback() {
1236
+ var t9;
1237
+ super.disconnectedCallback(), null === (t9 = this._$Do) || void 0 === t9 || t9.setConnected(false);
1238
+ }
1239
+ render() {
1240
+ return x;
1241
+ }
1242
+ };
1243
+ s7.finalized = true, s7._$litElement$ = true, null === (l5 = globalThis.litElementHydrateSupport) || void 0 === l5 || l5.call(globalThis, { LitElement: s7 });
1244
+ n6 = globalThis.litElementPolyfillSupport;
1245
+ null == n6 || n6({ LitElement: s7 });
1246
+ h5 = { _$AK: (t9, e16, i12) => {
1247
+ t9._$AK(e16, i12);
1248
+ }, _$AL: (t9) => t9._$AL };
1249
+ (null !== (o5 = globalThis.litElementVersions) && void 0 !== o5 ? o5 : globalThis.litElementVersions = []).push("3.2.2");
1250
+ }
1251
+ });
1252
+
1253
+ // ../../node_modules/@lit/reactive-element/decorators/base.js
1254
+ var e6, t5, o6;
1255
+ var init_base = __esm({
1256
+ "../../node_modules/@lit/reactive-element/decorators/base.js"() {
1257
+ e6 = (e16, t9, o18) => {
1258
+ Object.defineProperty(t9, o18, e16);
1259
+ };
1260
+ t5 = (e16, t9) => ({ kind: "method", placement: "prototype", key: t9.key, descriptor: e16 });
1261
+ o6 = ({ finisher: e16, descriptor: t9 }) => (o18, n11) => {
1262
+ var r7;
1263
+ if (void 0 === n11) {
1264
+ const n12 = null !== (r7 = o18.originalKey) && void 0 !== r7 ? r7 : o18.key, i12 = null != t9 ? { kind: "method", placement: "prototype", key: n12, descriptor: t9(o18.key) } : { ...o18, key: n12 };
1265
+ return null != e16 && (i12.finisher = function(t10) {
1266
+ e16(t10, n12);
1267
+ }), i12;
1268
+ }
1269
+ {
1270
+ const r8 = o18.constructor;
1271
+ void 0 !== t9 && Object.defineProperty(o18, n11, t9(n11)), null == e16 || e16(r8, n11);
1272
+ }
1273
+ };
1274
+ }
1275
+ });
1276
+
1277
+ // ../../node_modules/@lit/reactive-element/decorators/custom-element.js
1278
+ var e7;
1279
+ var init_custom_element = __esm({
1280
+ "../../node_modules/@lit/reactive-element/decorators/custom-element.js"() {
1281
+ e7 = (e16) => (n11) => "function" == typeof n11 ? ((e17, n12) => (customElements.define(e17, n12), n12))(e16, n11) : ((e17, n12) => {
1282
+ const { kind: t9, elements: s9 } = n12;
1283
+ return { kind: t9, elements: s9, finisher(n13) {
1284
+ customElements.define(e17, n13);
1285
+ } };
1286
+ })(e16, n11);
1287
+ }
1288
+ });
1289
+
1290
+ // ../../node_modules/@lit/reactive-element/decorators/property.js
1291
+ function e8(e16) {
1292
+ return (n11, t9) => void 0 !== t9 ? ((i12, e17, n12) => {
1293
+ e17.constructor.createProperty(n12, i12);
1294
+ })(e16, n11, t9) : i6(e16, n11);
1295
+ }
1296
+ var i6;
1297
+ var init_property = __esm({
1298
+ "../../node_modules/@lit/reactive-element/decorators/property.js"() {
1299
+ i6 = (i12, e16) => "method" === e16.kind && e16.descriptor && !("value" in e16.descriptor) ? { ...e16, finisher(n11) {
1300
+ n11.createProperty(e16.key, i12);
1301
+ } } : { kind: "field", key: /* @__PURE__ */ Symbol(), placement: "own", descriptor: {}, originalKey: e16.key, initializer() {
1302
+ "function" == typeof e16.initializer && (this[e16.key] = e16.initializer.call(this));
1303
+ }, finisher(n11) {
1304
+ n11.createProperty(e16.key, i12);
1305
+ } };
1306
+ }
1307
+ });
1308
+
1309
+ // ../../node_modules/@lit/reactive-element/decorators/state.js
1310
+ function t6(t9) {
1311
+ return e8({ ...t9, state: true });
1312
+ }
1313
+ var init_state = __esm({
1314
+ "../../node_modules/@lit/reactive-element/decorators/state.js"() {
1315
+ init_property();
1316
+ }
1317
+ });
1318
+
1319
+ // ../../node_modules/@lit/reactive-element/decorators/event-options.js
1320
+ function e9(e16) {
1321
+ return o6({ finisher: (r7, t9) => {
1322
+ Object.assign(r7.prototype[t9], e16);
1323
+ } });
1324
+ }
1325
+ var init_event_options = __esm({
1326
+ "../../node_modules/@lit/reactive-element/decorators/event-options.js"() {
1327
+ init_base();
1328
+ }
1329
+ });
1330
+
1331
+ // ../../node_modules/@lit/reactive-element/decorators/query.js
1332
+ function i7(i12, n11) {
1333
+ return o6({ descriptor: (o18) => {
1334
+ const t9 = { get() {
1335
+ var o19, n12;
1336
+ return null !== (n12 = null === (o19 = this.renderRoot) || void 0 === o19 ? void 0 : o19.querySelector(i12)) && void 0 !== n12 ? n12 : null;
1337
+ }, enumerable: true, configurable: true };
1338
+ if (n11) {
1339
+ const n12 = "symbol" == typeof o18 ? /* @__PURE__ */ Symbol() : "__" + o18;
1340
+ t9.get = function() {
1341
+ var o19, t10;
1342
+ return void 0 === this[n12] && (this[n12] = null !== (t10 = null === (o19 = this.renderRoot) || void 0 === o19 ? void 0 : o19.querySelector(i12)) && void 0 !== t10 ? t10 : null), this[n12];
1343
+ };
1344
+ }
1345
+ return t9;
1346
+ } });
1347
+ }
1348
+ var init_query = __esm({
1349
+ "../../node_modules/@lit/reactive-element/decorators/query.js"() {
1350
+ init_base();
1351
+ }
1352
+ });
1353
+
1354
+ // ../../node_modules/@lit/reactive-element/decorators/query-all.js
1355
+ function e10(e16) {
1356
+ return o6({ descriptor: (r7) => ({ get() {
1357
+ var r8, o18;
1358
+ return null !== (o18 = null === (r8 = this.renderRoot) || void 0 === r8 ? void 0 : r8.querySelectorAll(e16)) && void 0 !== o18 ? o18 : [];
1359
+ }, enumerable: true, configurable: true }) });
1360
+ }
1361
+ var init_query_all = __esm({
1362
+ "../../node_modules/@lit/reactive-element/decorators/query-all.js"() {
1363
+ init_base();
1364
+ }
1365
+ });
1366
+
1367
+ // ../../node_modules/@lit/reactive-element/decorators/query-async.js
1368
+ function e11(e16) {
1369
+ return o6({ descriptor: (r7) => ({ async get() {
1370
+ var r8;
1371
+ return await this.updateComplete, null === (r8 = this.renderRoot) || void 0 === r8 ? void 0 : r8.querySelector(e16);
1372
+ }, enumerable: true, configurable: true }) });
1373
+ }
1374
+ var init_query_async = __esm({
1375
+ "../../node_modules/@lit/reactive-element/decorators/query-async.js"() {
1376
+ init_base();
1377
+ }
1378
+ });
1379
+
1380
+ // ../../node_modules/@lit/reactive-element/decorators/query-assigned-elements.js
1381
+ function l6(n11) {
1382
+ const { slot: l9, selector: t9 } = null != n11 ? n11 : {};
1383
+ return o6({ descriptor: (o18) => ({ get() {
1384
+ var o19;
1385
+ const r7 = "slot" + (l9 ? `[name=${l9}]` : ":not([name])"), i12 = null === (o19 = this.renderRoot) || void 0 === o19 ? void 0 : o19.querySelector(r7), s9 = null != i12 ? e12(i12, n11) : [];
1386
+ return t9 ? s9.filter(((o20) => o20.matches(t9))) : s9;
1387
+ }, enumerable: true, configurable: true }) });
1388
+ }
1389
+ var n7, e12;
1390
+ var init_query_assigned_elements = __esm({
1391
+ "../../node_modules/@lit/reactive-element/decorators/query-assigned-elements.js"() {
1392
+ init_base();
1393
+ e12 = null != (null === (n7 = window.HTMLSlotElement) || void 0 === n7 ? void 0 : n7.prototype.assignedElements) ? (o18, n11) => o18.assignedElements(n11) : (o18, n11) => o18.assignedNodes(n11).filter(((o19) => o19.nodeType === Node.ELEMENT_NODE));
1394
+ }
1395
+ });
1396
+
1397
+ // ../../node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js
1398
+ function o7(o18, n11, r7) {
1399
+ let l9, s9 = o18;
1400
+ return "object" == typeof o18 ? (s9 = o18.slot, l9 = o18) : l9 = { flatten: n11 }, r7 ? l6({ slot: s9, flatten: n11, selector: r7 }) : o6({ descriptor: (e16) => ({ get() {
1401
+ var e17, t9;
1402
+ const o19 = "slot" + (s9 ? `[name=${s9}]` : ":not([name])"), n12 = null === (e17 = this.renderRoot) || void 0 === e17 ? void 0 : e17.querySelector(o19);
1403
+ return null !== (t9 = null == n12 ? void 0 : n12.assignedNodes(l9)) && void 0 !== t9 ? t9 : [];
1404
+ }, enumerable: true, configurable: true }) });
1405
+ }
1406
+ var init_query_assigned_nodes = __esm({
1407
+ "../../node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js"() {
1408
+ init_base();
1409
+ init_query_assigned_elements();
1410
+ }
1411
+ });
1412
+
1413
+ // ../../node_modules/lit-element/index.js
1414
+ var lit_element_exports = {};
1415
+ __export(lit_element_exports, {
1416
+ CSSResult: () => o3,
1417
+ LitElement: () => s7,
1418
+ ReactiveElement: () => d4,
1419
+ UpdatingElement: () => r6,
1420
+ _$LE: () => h5,
1421
+ _$LH: () => L,
1422
+ adoptStyles: () => S2,
1423
+ css: () => i5,
1424
+ customElement: () => e7,
1425
+ decorateProperty: () => o6,
1426
+ defaultConverter: () => n5,
1427
+ eventOptions: () => e9,
1428
+ getCompatibleStyle: () => c5,
1429
+ html: () => y,
1430
+ legacyPrototypeMethod: () => e6,
1431
+ noChange: () => x,
1432
+ notEqual: () => a4,
1433
+ nothing: () => b,
1434
+ property: () => e8,
1435
+ query: () => i7,
1436
+ queryAll: () => e10,
1437
+ queryAssignedElements: () => l6,
1438
+ queryAssignedNodes: () => o7,
1439
+ queryAsync: () => e11,
1440
+ render: () => Z,
1441
+ standardPrototypeMethod: () => t5,
1442
+ state: () => t6,
1443
+ supportsAdoptingStyleSheets: () => e4,
1444
+ svg: () => w,
1445
+ unsafeCSS: () => r4
1446
+ });
1447
+ var init_lit_element2 = __esm({
1448
+ "../../node_modules/lit-element/index.js"() {
1449
+ init_reactive_element();
1450
+ init_lit_html();
1451
+ init_lit_element();
1452
+ init_base();
1453
+ init_custom_element();
1454
+ init_property();
1455
+ init_state();
1456
+ init_event_options();
1457
+ init_query();
1458
+ init_query_all();
1459
+ init_query_async();
1460
+ init_query_assigned_elements();
1461
+ init_query_assigned_nodes();
1462
+ console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.");
1463
+ }
1464
+ });
1465
+
1466
+ // ../../node_modules/lit-html/directives/class-map.js
1467
+ var class_map_exports = {};
1468
+ __export(class_map_exports, {
1469
+ classMap: () => o8
1470
+ });
1471
+ var o8;
1472
+ var init_class_map = __esm({
1473
+ "../../node_modules/lit-html/directives/class-map.js"() {
1474
+ init_lit_html();
1475
+ init_directive();
1476
+ o8 = e2(class extends i2 {
1477
+ constructor(t9) {
1478
+ var i12;
1479
+ if (super(t9), t9.type !== t2.ATTRIBUTE || "class" !== t9.name || (null === (i12 = t9.strings) || void 0 === i12 ? void 0 : i12.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
1480
+ }
1481
+ render(t9) {
1482
+ return " " + Object.keys(t9).filter(((i12) => t9[i12])).join(" ") + " ";
1483
+ }
1484
+ update(i12, [s9]) {
1485
+ var r7, o18;
1486
+ if (void 0 === this.nt) {
1487
+ this.nt = /* @__PURE__ */ new Set(), void 0 !== i12.strings && (this.st = new Set(i12.strings.join(" ").split(/\s/).filter(((t9) => "" !== t9))));
1488
+ for (const t9 in s9) s9[t9] && !(null === (r7 = this.st) || void 0 === r7 ? void 0 : r7.has(t9)) && this.nt.add(t9);
1489
+ return this.render(s9);
1490
+ }
1491
+ const e16 = i12.element.classList;
1492
+ this.nt.forEach(((t9) => {
1493
+ t9 in s9 || (e16.remove(t9), this.nt.delete(t9));
1494
+ }));
1495
+ for (const t9 in s9) {
1496
+ const i13 = !!s9[t9];
1497
+ i13 === this.nt.has(t9) || (null === (o18 = this.st) || void 0 === o18 ? void 0 : o18.has(t9)) || (i13 ? (e16.add(t9), this.nt.add(t9)) : (e16.remove(t9), this.nt.delete(t9)));
1498
+ }
1499
+ return x;
1500
+ }
1501
+ });
1502
+ }
1503
+ });
1504
+
1505
+ // ../../node_modules/lit-html/directives/private-async-helpers.js
1506
+ var t7, s8, i8;
1507
+ var init_private_async_helpers = __esm({
1508
+ "../../node_modules/lit-html/directives/private-async-helpers.js"() {
1509
+ t7 = async (t9, s9) => {
1510
+ for await (const i12 of t9) if (false === await s9(i12)) return;
1511
+ };
1512
+ s8 = class {
1513
+ constructor(t9) {
1514
+ this.Y = t9;
1515
+ }
1516
+ disconnect() {
1517
+ this.Y = void 0;
1518
+ }
1519
+ reconnect(t9) {
1520
+ this.Y = t9;
1521
+ }
1522
+ deref() {
1523
+ return this.Y;
1524
+ }
1525
+ };
1526
+ i8 = class {
1527
+ constructor() {
1528
+ this.Z = void 0, this.q = void 0;
1529
+ }
1530
+ get() {
1531
+ return this.Z;
1532
+ }
1533
+ pause() {
1534
+ var t9;
1535
+ null !== (t9 = this.Z) && void 0 !== t9 || (this.Z = new Promise(((t10) => this.q = t10)));
1536
+ }
1537
+ resume() {
1538
+ var t9;
1539
+ null === (t9 = this.q) || void 0 === t9 || t9.call(this), this.Z = this.q = void 0;
1540
+ }
1541
+ };
1542
+ }
1543
+ });
1544
+
1545
+ // ../../node_modules/lit-html/directives/async-replace.js
1546
+ var async_replace_exports = {};
1547
+ __export(async_replace_exports, {
1548
+ AsyncReplaceDirective: () => o9,
1549
+ asyncReplace: () => h6
1550
+ });
1551
+ var o9, h6;
1552
+ var init_async_replace = __esm({
1553
+ "../../node_modules/lit-html/directives/async-replace.js"() {
1554
+ init_lit_html();
1555
+ init_async_directive();
1556
+ init_private_async_helpers();
1557
+ init_directive();
1558
+ o9 = class extends c3 {
1559
+ constructor() {
1560
+ super(...arguments), this._$CK = new s8(this), this._$CX = new i8();
1561
+ }
1562
+ render(i12, s9) {
1563
+ return x;
1564
+ }
1565
+ update(i12, [s9, r7]) {
1566
+ if (this.isConnected || this.disconnected(), s9 === this._$CJ) return;
1567
+ this._$CJ = s9;
1568
+ let n11 = 0;
1569
+ const { _$CK: o18, _$CX: h9 } = this;
1570
+ return t7(s9, (async (t9) => {
1571
+ for (; h9.get(); ) await h9.get();
1572
+ const i13 = o18.deref();
1573
+ if (void 0 !== i13) {
1574
+ if (i13._$CJ !== s9) return false;
1575
+ void 0 !== r7 && (t9 = r7(t9, n11)), i13.commitValue(t9, n11), n11++;
1576
+ }
1577
+ return true;
1578
+ })), x;
1579
+ }
1580
+ commitValue(t9, i12) {
1581
+ this.setValue(t9);
1582
+ }
1583
+ disconnected() {
1584
+ this._$CK.disconnect(), this._$CX.pause();
1585
+ }
1586
+ reconnected() {
1587
+ this._$CK.reconnect(this), this._$CX.resume();
1588
+ }
1589
+ };
1590
+ h6 = e2(o9);
1591
+ }
1592
+ });
1593
+
1594
+ // ../../node_modules/lit-html/directives/async-append.js
1595
+ var async_append_exports = {};
1596
+ __export(async_append_exports, {
1597
+ asyncAppend: () => c6
1598
+ });
1599
+ var c6;
1600
+ var init_async_append = __esm({
1601
+ "../../node_modules/lit-html/directives/async-append.js"() {
1602
+ init_directive();
1603
+ init_async_replace();
1604
+ init_directive_helpers();
1605
+ c6 = e2(class extends o9 {
1606
+ constructor(r7) {
1607
+ if (super(r7), r7.type !== t2.CHILD) throw Error("asyncAppend can only be used in child expressions");
1608
+ }
1609
+ update(r7, e16) {
1610
+ return this._$Ctt = r7, super.update(r7, e16);
1611
+ }
1612
+ commitValue(r7, e16) {
1613
+ 0 === e16 && a2(this._$Ctt);
1614
+ const s9 = r2(this._$Ctt);
1615
+ u2(s9, r7);
1616
+ }
1617
+ });
1618
+ }
1619
+ });
1620
+
1621
+ // ../../node_modules/lit-html/directives/cache.js
1622
+ var cache_exports = {};
1623
+ __export(cache_exports, {
1624
+ cache: () => d5
1625
+ });
1626
+ var d5;
1627
+ var init_cache = __esm({
1628
+ "../../node_modules/lit-html/directives/cache.js"() {
1629
+ init_lit_html();
1630
+ init_directive();
1631
+ init_directive_helpers();
1632
+ d5 = e2(class extends i2 {
1633
+ constructor(t9) {
1634
+ super(t9), this.et = /* @__PURE__ */ new WeakMap();
1635
+ }
1636
+ render(t9) {
1637
+ return [t9];
1638
+ }
1639
+ update(s9, [e16]) {
1640
+ if (n2(this.it) && (!n2(e16) || this.it.strings !== e16.strings)) {
1641
+ const e17 = m2(s9).pop();
1642
+ let o18 = this.et.get(this.it.strings);
1643
+ if (void 0 === o18) {
1644
+ const s10 = document.createDocumentFragment();
1645
+ o18 = Z(b, s10), o18.setConnected(false), this.et.set(this.it.strings, o18);
1646
+ }
1647
+ s2(o18, [e17]), r2(o18, void 0, e17);
1648
+ }
1649
+ if (n2(e16)) {
1650
+ if (!n2(this.it) || this.it.strings !== e16.strings) {
1651
+ const t9 = this.et.get(e16.strings);
1652
+ if (void 0 !== t9) {
1653
+ const i12 = m2(t9).pop();
1654
+ a2(s9), r2(s9, void 0, i12), s2(s9, [i12]);
1655
+ }
1656
+ }
1657
+ this.it = e16;
1658
+ } else this.it = void 0;
1659
+ return this.render(e16);
1660
+ }
1661
+ });
1662
+ }
1663
+ });
1664
+
1665
+ // ../../node_modules/lit-html/directives/guard.js
1666
+ var guard_exports = {};
1667
+ __export(guard_exports, {
1668
+ guard: () => i9
1669
+ });
1670
+ var e13, i9;
1671
+ var init_guard = __esm({
1672
+ "../../node_modules/lit-html/directives/guard.js"() {
1673
+ init_lit_html();
1674
+ init_directive();
1675
+ e13 = {};
1676
+ i9 = e2(class extends i2 {
1677
+ constructor() {
1678
+ super(...arguments), this.ot = e13;
1679
+ }
1680
+ render(r7, t9) {
1681
+ return t9();
1682
+ }
1683
+ update(t9, [s9, e16]) {
1684
+ if (Array.isArray(s9)) {
1685
+ if (Array.isArray(this.ot) && this.ot.length === s9.length && s9.every(((r7, t10) => r7 === this.ot[t10]))) return x;
1686
+ } else if (this.ot === s9) return x;
1687
+ return this.ot = Array.isArray(s9) ? Array.from(s9) : s9, this.render(s9, e16);
1688
+ }
1689
+ });
1690
+ }
1691
+ });
1692
+
1693
+ // ../../node_modules/lit-html/directives/if-defined.js
1694
+ var if_defined_exports = {};
1695
+ __export(if_defined_exports, {
1696
+ ifDefined: () => l7
1697
+ });
1698
+ var l7;
1699
+ var init_if_defined = __esm({
1700
+ "../../node_modules/lit-html/directives/if-defined.js"() {
1701
+ init_lit_html();
1702
+ l7 = (l9) => null != l9 ? l9 : b;
1703
+ }
1704
+ });
1705
+
1706
+ // ../../node_modules/lit-html/directives/live.js
1707
+ var live_exports = {};
1708
+ __export(live_exports, {
1709
+ live: () => l8
1710
+ });
1711
+ var l8;
1712
+ var init_live = __esm({
1713
+ "../../node_modules/lit-html/directives/live.js"() {
1714
+ init_lit_html();
1715
+ init_directive();
1716
+ init_directive_helpers();
1717
+ l8 = e2(class extends i2 {
1718
+ constructor(r7) {
1719
+ if (super(r7), r7.type !== t2.PROPERTY && r7.type !== t2.ATTRIBUTE && r7.type !== t2.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
1720
+ if (!e3(r7)) throw Error("`live` bindings can only contain a single expression");
1721
+ }
1722
+ render(r7) {
1723
+ return r7;
1724
+ }
1725
+ update(i12, [t9]) {
1726
+ if (t9 === x || t9 === b) return t9;
1727
+ const o18 = i12.element, l9 = i12.name;
1728
+ if (i12.type === t2.PROPERTY) {
1729
+ if (t9 === o18[l9]) return x;
1730
+ } else if (i12.type === t2.BOOLEAN_ATTRIBUTE) {
1731
+ if (!!t9 === o18.hasAttribute(l9)) return x;
1732
+ } else if (i12.type === t2.ATTRIBUTE && o18.getAttribute(l9) === t9 + "") return x;
1733
+ return s2(i12), t9;
1734
+ }
1735
+ });
1736
+ }
1737
+ });
1738
+
1739
+ // ../../node_modules/lit-html/directives/ref.js
1740
+ var ref_exports = {};
1741
+ __export(ref_exports, {
1742
+ createRef: () => e14,
1743
+ ref: () => n8
1744
+ });
1745
+ var e14, o10, h7, n8;
1746
+ var init_ref = __esm({
1747
+ "../../node_modules/lit-html/directives/ref.js"() {
1748
+ init_lit_html();
1749
+ init_async_directive();
1750
+ init_directive();
1751
+ e14 = () => new o10();
1752
+ o10 = class {
1753
+ };
1754
+ h7 = /* @__PURE__ */ new WeakMap();
1755
+ n8 = e2(class extends c3 {
1756
+ render(t9) {
1757
+ return b;
1758
+ }
1759
+ update(t9, [s9]) {
1760
+ var e16;
1761
+ const o18 = s9 !== this.Y;
1762
+ return o18 && void 0 !== this.Y && this.rt(void 0), (o18 || this.lt !== this.ct) && (this.Y = s9, this.dt = null === (e16 = t9.options) || void 0 === e16 ? void 0 : e16.host, this.rt(this.ct = t9.element)), b;
1763
+ }
1764
+ rt(i12) {
1765
+ var t9;
1766
+ if ("function" == typeof this.Y) {
1767
+ const s9 = null !== (t9 = this.dt) && void 0 !== t9 ? t9 : globalThis;
1768
+ let e16 = h7.get(s9);
1769
+ void 0 === e16 && (e16 = /* @__PURE__ */ new WeakMap(), h7.set(s9, e16)), void 0 !== e16.get(this.Y) && this.Y.call(this.dt, void 0), e16.set(this.Y, i12), void 0 !== i12 && this.Y.call(this.dt, i12);
1770
+ } else this.Y.value = i12;
1771
+ }
1772
+ get lt() {
1773
+ var i12, t9, s9;
1774
+ return "function" == typeof this.Y ? null === (t9 = h7.get(null !== (i12 = this.dt) && void 0 !== i12 ? i12 : globalThis)) || void 0 === t9 ? void 0 : t9.get(this.Y) : null === (s9 = this.Y) || void 0 === s9 ? void 0 : s9.value;
1775
+ }
1776
+ disconnected() {
1777
+ this.lt === this.ct && this.rt(void 0);
1778
+ }
1779
+ reconnected() {
1780
+ this.rt(this.ct);
1781
+ }
1782
+ });
1783
+ }
1784
+ });
1785
+
1786
+ // ../../node_modules/lit-html/directives/repeat.js
1787
+ var repeat_exports = {};
1788
+ __export(repeat_exports, {
1789
+ repeat: () => c7
1790
+ });
1791
+ var u4, c7;
1792
+ var init_repeat = __esm({
1793
+ "../../node_modules/lit-html/directives/repeat.js"() {
1794
+ init_lit_html();
1795
+ init_directive();
1796
+ init_directive_helpers();
1797
+ u4 = (e16, s9, t9) => {
1798
+ const r7 = /* @__PURE__ */ new Map();
1799
+ for (let l9 = s9; l9 <= t9; l9++) r7.set(e16[l9], l9);
1800
+ return r7;
1801
+ };
1802
+ c7 = e2(class extends i2 {
1803
+ constructor(e16) {
1804
+ if (super(e16), e16.type !== t2.CHILD) throw Error("repeat() can only be used in text expressions");
1805
+ }
1806
+ ht(e16, s9, t9) {
1807
+ let r7;
1808
+ void 0 === t9 ? t9 = s9 : void 0 !== s9 && (r7 = s9);
1809
+ const l9 = [], o18 = [];
1810
+ let i12 = 0;
1811
+ for (const s10 of e16) l9[i12] = r7 ? r7(s10, i12) : i12, o18[i12] = t9(s10, i12), i12++;
1812
+ return { values: o18, keys: l9 };
1813
+ }
1814
+ render(e16, s9, t9) {
1815
+ return this.ht(e16, s9, t9).values;
1816
+ }
1817
+ update(s9, [t9, r7, c9]) {
1818
+ var d6;
1819
+ const a5 = m2(s9), { values: p4, keys: v3 } = this.ht(t9, r7, c9);
1820
+ if (!Array.isArray(a5)) return this.ut = v3, p4;
1821
+ const h9 = null !== (d6 = this.ut) && void 0 !== d6 ? d6 : this.ut = [], m4 = [];
1822
+ let y2, x2, j = 0, k2 = a5.length - 1, w2 = 0, A2 = p4.length - 1;
1823
+ for (; j <= k2 && w2 <= A2; ) if (null === a5[j]) j++;
1824
+ else if (null === a5[k2]) k2--;
1825
+ else if (h9[j] === v3[w2]) m4[w2] = u2(a5[j], p4[w2]), j++, w2++;
1826
+ else if (h9[k2] === v3[A2]) m4[A2] = u2(a5[k2], p4[A2]), k2--, A2--;
1827
+ else if (h9[j] === v3[A2]) m4[A2] = u2(a5[j], p4[A2]), r2(s9, m4[A2 + 1], a5[j]), j++, A2--;
1828
+ else if (h9[k2] === v3[w2]) m4[w2] = u2(a5[k2], p4[w2]), r2(s9, a5[j], a5[k2]), k2--, w2++;
1829
+ else if (void 0 === y2 && (y2 = u4(v3, w2, A2), x2 = u4(h9, j, k2)), y2.has(h9[j])) if (y2.has(h9[k2])) {
1830
+ const e16 = x2.get(v3[w2]), t10 = void 0 !== e16 ? a5[e16] : null;
1831
+ if (null === t10) {
1832
+ const e17 = r2(s9, a5[j]);
1833
+ u2(e17, p4[w2]), m4[w2] = e17;
1834
+ } else m4[w2] = u2(t10, p4[w2]), r2(s9, a5[j], t10), a5[e16] = null;
1835
+ w2++;
1836
+ } else p2(a5[k2]), k2--;
1837
+ else p2(a5[j]), j++;
1838
+ for (; w2 <= A2; ) {
1839
+ const e16 = r2(s9, m4[A2 + 1]);
1840
+ u2(e16, p4[w2]), m4[w2++] = e16;
1841
+ }
1842
+ for (; j <= k2; ) {
1843
+ const e16 = a5[j++];
1844
+ null !== e16 && p2(e16);
1845
+ }
1846
+ return this.ut = v3, s2(s9, m4), x;
1847
+ }
1848
+ });
1849
+ }
1850
+ });
1851
+
1852
+ // ../../node_modules/lit-html/directives/style-map.js
1853
+ var style_map_exports = {};
1854
+ __export(style_map_exports, {
1855
+ styleMap: () => i10
1856
+ });
1857
+ var i10;
1858
+ var init_style_map = __esm({
1859
+ "../../node_modules/lit-html/directives/style-map.js"() {
1860
+ init_lit_html();
1861
+ init_directive();
1862
+ i10 = e2(class extends i2 {
1863
+ constructor(t9) {
1864
+ var e16;
1865
+ if (super(t9), t9.type !== t2.ATTRIBUTE || "style" !== t9.name || (null === (e16 = t9.strings) || void 0 === e16 ? void 0 : e16.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
1866
+ }
1867
+ render(t9) {
1868
+ return Object.keys(t9).reduce(((e16, r7) => {
1869
+ const s9 = t9[r7];
1870
+ return null == s9 ? e16 : e16 + `${r7 = r7.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s9};`;
1871
+ }), "");
1872
+ }
1873
+ update(e16, [r7]) {
1874
+ const { style: s9 } = e16.element;
1875
+ if (void 0 === this.vt) {
1876
+ this.vt = /* @__PURE__ */ new Set();
1877
+ for (const t9 in r7) this.vt.add(t9);
1878
+ return this.render(r7);
1879
+ }
1880
+ this.vt.forEach(((t9) => {
1881
+ null == r7[t9] && (this.vt.delete(t9), t9.includes("-") ? s9.removeProperty(t9) : s9[t9] = "");
1882
+ }));
1883
+ for (const t9 in r7) {
1884
+ const e17 = r7[t9];
1885
+ null != e17 && (this.vt.add(t9), t9.includes("-") ? s9.setProperty(t9, e17) : s9[t9] = e17);
1886
+ }
1887
+ return x;
1888
+ }
1889
+ });
1890
+ }
1891
+ });
1892
+
1893
+ // ../../node_modules/lit-html/directives/template-content.js
1894
+ var template_content_exports = {};
1895
+ __export(template_content_exports, {
1896
+ templateContent: () => o11
1897
+ });
1898
+ var o11;
1899
+ var init_template_content = __esm({
1900
+ "../../node_modules/lit-html/directives/template-content.js"() {
1901
+ init_lit_html();
1902
+ init_directive();
1903
+ o11 = e2(class extends i2 {
1904
+ constructor(t9) {
1905
+ if (super(t9), t9.type !== t2.CHILD) throw Error("templateContent can only be used in child bindings");
1906
+ }
1907
+ render(r7) {
1908
+ return this.ft === r7 ? x : (this.ft = r7, document.importNode(r7.content, true));
1909
+ }
1910
+ });
1911
+ }
1912
+ });
1913
+
1914
+ // ../../node_modules/lit-html/directives/unsafe-html.js
1915
+ var unsafe_html_exports = {};
1916
+ __export(unsafe_html_exports, {
1917
+ UnsafeHTMLDirective: () => e15,
1918
+ unsafeHTML: () => o12
1919
+ });
1920
+ var e15, o12;
1921
+ var init_unsafe_html = __esm({
1922
+ "../../node_modules/lit-html/directives/unsafe-html.js"() {
1923
+ init_lit_html();
1924
+ init_directive();
1925
+ e15 = class extends i2 {
1926
+ constructor(i12) {
1927
+ if (super(i12), this.it = b, i12.type !== t2.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
1928
+ }
1929
+ render(r7) {
1930
+ if (r7 === b || null == r7) return this._t = void 0, this.it = r7;
1931
+ if (r7 === x) return r7;
1932
+ if ("string" != typeof r7) throw Error(this.constructor.directiveName + "() called with a non-string value");
1933
+ if (r7 === this.it) return this._t;
1934
+ this.it = r7;
1935
+ const s9 = [r7];
1936
+ return s9.raw = s9, this._t = { _$litType$: this.constructor.resultType, strings: s9, values: [] };
1937
+ }
1938
+ };
1939
+ e15.directiveName = "unsafeHTML", e15.resultType = 1;
1940
+ o12 = e2(e15);
1941
+ }
1942
+ });
1943
+
1944
+ // ../../node_modules/lit-html/directives/unsafe-svg.js
1945
+ var unsafe_svg_exports = {};
1946
+ __export(unsafe_svg_exports, {
1947
+ unsafeSVG: () => o13
1948
+ });
1949
+ var t8, o13;
1950
+ var init_unsafe_svg = __esm({
1951
+ "../../node_modules/lit-html/directives/unsafe-svg.js"() {
1952
+ init_directive();
1953
+ init_unsafe_html();
1954
+ t8 = class extends e15 {
1955
+ };
1956
+ t8.directiveName = "unsafeSVG", t8.resultType = 2;
1957
+ o13 = e2(t8);
1958
+ }
1959
+ });
1960
+
1961
+ // ../../node_modules/lit-html/directives/until.js
1962
+ var until_exports = {};
1963
+ __export(until_exports, {
1964
+ UntilDirective: () => h8,
1965
+ until: () => c8
1966
+ });
1967
+ var n9, h8, c8;
1968
+ var init_until = __esm({
1969
+ "../../node_modules/lit-html/directives/until.js"() {
1970
+ init_lit_html();
1971
+ init_directive_helpers();
1972
+ init_async_directive();
1973
+ init_private_async_helpers();
1974
+ init_directive();
1975
+ n9 = (t9) => !t3(t9) && "function" == typeof t9.then;
1976
+ h8 = class extends c3 {
1977
+ constructor() {
1978
+ super(...arguments), this._$Cwt = 1073741823, this._$Cyt = [], this._$CK = new s8(this), this._$CX = new i8();
1979
+ }
1980
+ render(...s9) {
1981
+ var i12;
1982
+ return null !== (i12 = s9.find(((t9) => !n9(t9)))) && void 0 !== i12 ? i12 : x;
1983
+ }
1984
+ update(s9, i12) {
1985
+ const r7 = this._$Cyt;
1986
+ let e16 = r7.length;
1987
+ this._$Cyt = i12;
1988
+ const o18 = this._$CK, h9 = this._$CX;
1989
+ this.isConnected || this.disconnected();
1990
+ for (let t9 = 0; t9 < i12.length && !(t9 > this._$Cwt); t9++) {
1991
+ const s10 = i12[t9];
1992
+ if (!n9(s10)) return this._$Cwt = t9, s10;
1993
+ t9 < e16 && s10 === r7[t9] || (this._$Cwt = 1073741823, e16 = 0, Promise.resolve(s10).then((async (t10) => {
1994
+ for (; h9.get(); ) await h9.get();
1995
+ const i13 = o18.deref();
1996
+ if (void 0 !== i13) {
1997
+ const r8 = i13._$Cyt.indexOf(s10);
1998
+ r8 > -1 && r8 < i13._$Cwt && (i13._$Cwt = r8, i13.setValue(t10));
1999
+ }
2000
+ })));
2001
+ }
2002
+ return x;
2003
+ }
2004
+ disconnected() {
2005
+ this._$CK.disconnect(), this._$CX.pause();
2006
+ }
2007
+ reconnected() {
2008
+ this._$CK.reconnect(this), this._$CX.resume();
2009
+ }
2010
+ };
2011
+ c8 = e2(h8);
2012
+ }
2013
+ });
2014
+
2015
+ // ../../node_modules/lit-html/directives/choose.js
2016
+ var choose_exports = {};
2017
+ __export(choose_exports, {
2018
+ choose: () => o14
2019
+ });
2020
+ var o14;
2021
+ var init_choose = __esm({
2022
+ "../../node_modules/lit-html/directives/choose.js"() {
2023
+ o14 = (o18, r7, n11) => {
2024
+ for (const n12 of r7) if (n12[0] === o18) return (0, n12[1])();
2025
+ return null == n11 ? void 0 : n11();
2026
+ };
2027
+ }
2028
+ });
2029
+
2030
+ // ../../node_modules/lit-html/directives/join.js
2031
+ var join_exports = {};
2032
+ __export(join_exports, {
2033
+ join: () => o15
2034
+ });
2035
+ function* o15(o18, t9) {
2036
+ const f4 = "function" == typeof t9;
2037
+ if (void 0 !== o18) {
2038
+ let i12 = -1;
2039
+ for (const n11 of o18) i12 > -1 && (yield f4 ? t9(i12) : t9), i12++, yield n11;
2040
+ }
2041
+ }
2042
+ var init_join = __esm({
2043
+ "../../node_modules/lit-html/directives/join.js"() {
2044
+ }
2045
+ });
2046
+
2047
+ // ../../node_modules/lit-html/directives/keyed.js
2048
+ var keyed_exports = {};
2049
+ __export(keyed_exports, {
2050
+ keyed: () => i11
2051
+ });
2052
+ var i11;
2053
+ var init_keyed = __esm({
2054
+ "../../node_modules/lit-html/directives/keyed.js"() {
2055
+ init_lit_html();
2056
+ init_directive();
2057
+ init_directive_helpers();
2058
+ i11 = e2(class extends i2 {
2059
+ constructor() {
2060
+ super(...arguments), this.key = b;
2061
+ }
2062
+ render(r7, t9) {
2063
+ return this.key = r7, t9;
2064
+ }
2065
+ update(r7, [t9, e16]) {
2066
+ return t9 !== this.key && (s2(r7), this.key = t9), e16;
2067
+ }
2068
+ });
2069
+ }
2070
+ });
2071
+
2072
+ // ../../node_modules/lit-html/directives/map.js
2073
+ var map_exports = {};
2074
+ __export(map_exports, {
2075
+ map: () => o16
2076
+ });
2077
+ function* o16(o18, f4) {
2078
+ if (void 0 !== o18) {
2079
+ let i12 = 0;
2080
+ for (const t9 of o18) yield f4(t9, i12++);
2081
+ }
2082
+ }
2083
+ var init_map = __esm({
2084
+ "../../node_modules/lit-html/directives/map.js"() {
2085
+ }
2086
+ });
2087
+
2088
+ // ../../node_modules/lit-html/directives/range.js
2089
+ var range_exports = {};
2090
+ __export(range_exports, {
2091
+ range: () => o17
2092
+ });
2093
+ function* o17(o18, l9, n11 = 1) {
2094
+ const t9 = void 0 === l9 ? 0 : o18;
2095
+ null != l9 || (l9 = o18);
2096
+ for (let o19 = t9; n11 > 0 ? o19 < l9 : l9 < o19; o19 += n11) yield o19;
2097
+ }
2098
+ var init_range = __esm({
2099
+ "../../node_modules/lit-html/directives/range.js"() {
2100
+ }
2101
+ });
2102
+
2103
+ // ../../node_modules/lit-html/directives/when.js
2104
+ var when_exports = {};
2105
+ __export(when_exports, {
2106
+ when: () => n10
2107
+ });
2108
+ function n10(n11, o18, r7) {
2109
+ return n11 ? o18() : null == r7 ? void 0 : r7();
2110
+ }
2111
+ var init_when = __esm({
2112
+ "../../node_modules/lit-html/directives/when.js"() {
2113
+ }
2114
+ });
2115
+
2116
+ // ../../node_modules/@rxdi/lit-html/dist/index.js
2117
+ var require_dist = __commonJS({
2118
+ "../../node_modules/@rxdi/lit-html/dist/index.js"(exports) {
2119
+ "use strict";
2120
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o18, m4, k2, k22) {
2121
+ if (k22 === void 0) k22 = k2;
2122
+ var desc = Object.getOwnPropertyDescriptor(m4, k2);
2123
+ if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) {
2124
+ desc = { enumerable: true, get: function() {
2125
+ return m4[k2];
2126
+ } };
2127
+ }
2128
+ Object.defineProperty(o18, k22, desc);
2129
+ }) : (function(o18, m4, k2, k22) {
2130
+ if (k22 === void 0) k22 = k2;
2131
+ o18[k22] = m4[k2];
2132
+ }));
2133
+ var __exportStar = exports && exports.__exportStar || function(m4, exports2) {
2134
+ for (var p4 in m4) if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p4)) __createBinding(exports2, m4, p4);
2135
+ };
2136
+ Object.defineProperty(exports, "__esModule", { value: true });
2137
+ __exportStar(require_decorators(), exports);
2138
+ __exportStar(require_async(), exports);
2139
+ __exportStar((init_lit_html(), __toCommonJS(lit_html_exports)), exports);
2140
+ __exportStar((init_directive(), __toCommonJS(directive_exports)), exports);
2141
+ __exportStar((init_experimental_hydrate(), __toCommonJS(experimental_hydrate_exports)), exports);
2142
+ __exportStar((init_experimental_hydrate_support(), __toCommonJS(experimental_hydrate_support_exports)), exports);
2143
+ __exportStar(require_polyfill_support(), exports);
2144
+ __exportStar((init_directive_helpers(), __toCommonJS(directive_helpers_exports)), exports);
2145
+ __exportStar((init_async_directive(), __toCommonJS(async_directive_exports)), exports);
2146
+ __exportStar((init_lit_element2(), __toCommonJS(lit_element_exports)), exports);
2147
+ __exportStar((init_class_map(), __toCommonJS(class_map_exports)), exports);
2148
+ __exportStar((init_async_append(), __toCommonJS(async_append_exports)), exports);
2149
+ __exportStar((init_async_replace(), __toCommonJS(async_replace_exports)), exports);
2150
+ __exportStar((init_cache(), __toCommonJS(cache_exports)), exports);
2151
+ __exportStar((init_guard(), __toCommonJS(guard_exports)), exports);
2152
+ __exportStar((init_if_defined(), __toCommonJS(if_defined_exports)), exports);
2153
+ __exportStar((init_live(), __toCommonJS(live_exports)), exports);
2154
+ __exportStar((init_ref(), __toCommonJS(ref_exports)), exports);
2155
+ __exportStar((init_repeat(), __toCommonJS(repeat_exports)), exports);
2156
+ __exportStar((init_style_map(), __toCommonJS(style_map_exports)), exports);
2157
+ __exportStar((init_template_content(), __toCommonJS(template_content_exports)), exports);
2158
+ __exportStar((init_unsafe_html(), __toCommonJS(unsafe_html_exports)), exports);
2159
+ __exportStar((init_unsafe_svg(), __toCommonJS(unsafe_svg_exports)), exports);
2160
+ __exportStar((init_until(), __toCommonJS(until_exports)), exports);
2161
+ __exportStar((init_choose(), __toCommonJS(choose_exports)), exports);
2162
+ __exportStar((init_join(), __toCommonJS(join_exports)), exports);
2163
+ __exportStar((init_keyed(), __toCommonJS(keyed_exports)), exports);
2164
+ __exportStar((init_map(), __toCommonJS(map_exports)), exports);
2165
+ __exportStar((init_range(), __toCommonJS(range_exports)), exports);
2166
+ __exportStar((init_when(), __toCommonJS(when_exports)), exports);
2167
+ }
2168
+ });
2169
+
2170
+ // ../../node_modules/@rhtml/renderer/dist/renderer.js
2171
+ var require_renderer = __commonJS({
2172
+ "../../node_modules/@rhtml/renderer/dist/renderer.js"(exports) {
2173
+ "use strict";
2174
+ var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
2175
+ var c9 = arguments.length, r7 = c9 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d6;
2176
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
2177
+ else for (var i12 = decorators.length - 1; i12 >= 0; i12--) if (d6 = decorators[i12]) r7 = (c9 < 3 ? d6(r7) : c9 > 3 ? d6(target, key, r7) : d6(target, key)) || r7;
2178
+ return c9 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
2179
+ };
2180
+ var __metadata = exports && exports.__metadata || function(k2, v3) {
2181
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k2, v3);
2182
+ };
2183
+ var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) {
2184
+ function adopt(value) {
2185
+ return value instanceof P2 ? value : new P2(function(resolve) {
2186
+ resolve(value);
2187
+ });
2188
+ }
2189
+ return new (P2 || (P2 = Promise))(function(resolve, reject) {
2190
+ function fulfilled(value) {
2191
+ try {
2192
+ step(generator.next(value));
2193
+ } catch (e16) {
2194
+ reject(e16);
2195
+ }
2196
+ }
2197
+ function rejected(value) {
2198
+ try {
2199
+ step(generator["throw"](value));
2200
+ } catch (e16) {
2201
+ reject(e16);
2202
+ }
2203
+ }
2204
+ function step(result) {
2205
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
2206
+ }
2207
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2208
+ });
2209
+ };
2210
+ Object.defineProperty(exports, "__esModule", { value: true });
2211
+ exports.Renderer = void 0;
2212
+ var lit_html_1 = require_dist();
2213
+ function Render(config) {
2214
+ return function(cls) {
2215
+ if (!window.customElements.get(config.selector)) {
2216
+ return (0, lit_html_1.Component)(config)(cls);
2217
+ }
2218
+ };
2219
+ }
2220
+ var Renderer = class Renderer extends lit_html_1.LitElement {
2221
+ constructor() {
2222
+ super(...arguments);
2223
+ this.options = {
2224
+ state: {},
2225
+ render: (res, setState, shadowRoot) => (0, lit_html_1.html)` ${res} `,
2226
+ style: (0, lit_html_1.css)``,
2227
+ styles: [],
2228
+ deepCloneState: false,
2229
+ loading: () => (0, lit_html_1.html)``,
2230
+ error: (e16) => (0, lit_html_1.html)`${e16 === null || e16 === void 0 ? void 0 : e16.message}`
2231
+ };
2232
+ this.loading = true;
2233
+ this.state = {};
2234
+ }
2235
+ OnUpdateFirst() {
2236
+ var _a, _b, _c;
2237
+ return __awaiter(this, void 0, void 0, function* () {
2238
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.style) {
2239
+ (0, lit_html_1.adoptStyles)(this.shadowRoot, [this.options.style]);
2240
+ }
2241
+ if ((_c = (_b = this.options) === null || _b === void 0 ? void 0 : _b.styles) === null || _c === void 0 ? void 0 : _c.length) {
2242
+ (0, lit_html_1.adoptStyles)(this.shadowRoot, this.options.styles);
2243
+ }
2244
+ this.options.state = yield this.options.state;
2245
+ if (this.options.state) {
2246
+ if (this.isObservable(this.options.state)) {
2247
+ this.subscription = this.options.state["subscribe"]((detail) => {
2248
+ this.state = detail;
2249
+ this.loading = false;
2250
+ this.dispatchEvent(new CustomEvent("onData", { detail }));
2251
+ }, (error) => {
2252
+ this.state = null;
2253
+ this.error = error;
2254
+ this.loading = false;
2255
+ this.dispatchEvent(new CustomEvent("onError", { detail: error }));
2256
+ });
2257
+ } else {
2258
+ this.loading = false;
2259
+ this.state = this.options.state;
2260
+ }
2261
+ yield this.updateComplete;
2262
+ yield new Promise(requestAnimationFrame);
2263
+ this.dispatchEvent(new CustomEvent("loaded"));
2264
+ }
2265
+ });
2266
+ }
2267
+ isObservable(value) {
2268
+ return this.isFunction(value.lift) && this.isFunction(value.subscribe);
2269
+ }
2270
+ isFunction(value) {
2271
+ return typeof value === "function";
2272
+ }
2273
+ OnDestroy() {
2274
+ if (this.subscription) {
2275
+ this.subscription.unsubscribe();
2276
+ }
2277
+ }
2278
+ renderContent() {
2279
+ if (!this.error && this.options.render) {
2280
+ const template = this.options.render(this.options.deepCloneState ? JSON.parse(JSON.stringify(this.state)) : this.state, (state) => this.state = Object.assign({}, state), this.shadowRoot);
2281
+ if (template === null || template === void 0 ? void 0 : template.strings) {
2282
+ return template;
2283
+ }
2284
+ return (0, lit_html_1.html)``;
2285
+ }
2286
+ return this.state;
2287
+ }
2288
+ };
2289
+ exports.Renderer = Renderer;
2290
+ __decorate([
2291
+ (0, lit_html_1.property)({ type: Object }),
2292
+ __metadata("design:type", Object)
2293
+ ], Renderer.prototype, "options", void 0);
2294
+ __decorate([
2295
+ (0, lit_html_1.property)({ type: Boolean }),
2296
+ __metadata("design:type", Object)
2297
+ ], Renderer.prototype, "loading", void 0);
2298
+ __decorate([
2299
+ (0, lit_html_1.property)({ type: Object }),
2300
+ __metadata("design:type", Error)
2301
+ ], Renderer.prototype, "error", void 0);
2302
+ __decorate([
2303
+ (0, lit_html_1.property)(),
2304
+ __metadata("design:type", Object)
2305
+ ], Renderer.prototype, "state", void 0);
2306
+ exports.Renderer = Renderer = __decorate([
2307
+ Render({
2308
+ selector: "r-renderer",
2309
+ template() {
2310
+ return (0, lit_html_1.html)`
2311
+ ${!this.loading ? this.renderContent() : ""}
2312
+ ${this.loading ? (0, lit_html_1.html)`
2313
+ ${this.isFunction(this.options.loading) ? this.options.loading() : (0, lit_html_1.html)``}
2314
+ ` : ""}
2315
+ ${this.error ? (0, lit_html_1.html)`
2316
+ ${this.isFunction(this.options.error) ? this.options.error(this.error) : (0, lit_html_1.html)` ${this.error} `}
2317
+ ` : ""}
2318
+ `;
2319
+ }
2320
+ })
2321
+ ], Renderer);
2322
+ }
2323
+ });
2324
+
2325
+ // ../../node_modules/@rhtml/renderer/dist/index.js
2326
+ var require_dist2 = __commonJS({
2327
+ "../../node_modules/@rhtml/renderer/dist/index.js"(exports) {
2328
+ "use strict";
2329
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o18, m4, k2, k22) {
2330
+ if (k22 === void 0) k22 = k2;
2331
+ var desc = Object.getOwnPropertyDescriptor(m4, k2);
2332
+ if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) {
2333
+ desc = { enumerable: true, get: function() {
2334
+ return m4[k2];
2335
+ } };
2336
+ }
2337
+ Object.defineProperty(o18, k22, desc);
2338
+ }) : (function(o18, m4, k2, k22) {
2339
+ if (k22 === void 0) k22 = k2;
2340
+ o18[k22] = m4[k2];
2341
+ }));
2342
+ var __exportStar = exports && exports.__exportStar || function(m4, exports2) {
2343
+ for (var p4 in m4) if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p4)) __createBinding(exports2, m4, p4);
2344
+ };
2345
+ Object.defineProperty(exports, "__esModule", { value: true });
2346
+ __exportStar(require_renderer(), exports);
2347
+ }
2348
+ });
2349
+
2350
+ // ../../node_modules/@rhtml/component/dist/index.js
2351
+ var require_dist3 = __commonJS({
2352
+ "../../node_modules/@rhtml/component/dist/index.js"(exports) {
2353
+ "use strict";
2354
+ var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) {
2355
+ function adopt(value) {
2356
+ return value instanceof P2 ? value : new P2(function(resolve) {
2357
+ resolve(value);
2358
+ });
2359
+ }
2360
+ return new (P2 || (P2 = Promise))(function(resolve, reject) {
2361
+ function fulfilled(value) {
2362
+ try {
2363
+ step(generator.next(value));
2364
+ } catch (e16) {
2365
+ reject(e16);
2366
+ }
2367
+ }
2368
+ function rejected(value) {
2369
+ try {
2370
+ step(generator["throw"](value));
2371
+ } catch (e16) {
2372
+ reject(e16);
2373
+ }
2374
+ }
2375
+ function step(result) {
2376
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
2377
+ }
2378
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2379
+ });
2380
+ };
2381
+ Object.defineProperty(exports, "__esModule", { value: true });
2382
+ exports.Component = exports.Partial = exports.DefineDependencies = void 0;
2383
+ require_dist2();
2384
+ var lit_html_1 = require_dist();
2385
+ var DefineDependencies = (...deps) => (injection) => {
2386
+ for (const [index, dep] of deps.entries()) {
2387
+ Object.defineProperty(deps, index, {
2388
+ get: () => (injection === null || injection === void 0 ? void 0 : injection.has(dep)) ? injection.get(dep) : dep
2389
+ });
2390
+ }
2391
+ return deps;
2392
+ };
2393
+ exports.DefineDependencies = DefineDependencies;
2394
+ function waitBeforeTrigger() {
2395
+ var _a;
2396
+ return __awaiter(this, void 0, void 0, function* () {
2397
+ yield this.updateComplete;
2398
+ yield new Promise(requestAnimationFrame);
2399
+ (_a = this.OnRendererLoaded) === null || _a === void 0 ? void 0 : _a.call(this);
2400
+ });
2401
+ }
2402
+ var Partial = (options) => (deps = []) => (state = () => ({})) => (loading2 = () => null) => (error = () => null) => (render = () => state) => (0, lit_html_1.Component)(Object.assign(Object.assign({}, options), { template() {
2403
+ return (0, lit_html_1.html)`
2404
+ <r-renderer
2405
+ style="display: contents;"
2406
+ @loaded=${waitBeforeTrigger.bind(this)}
2407
+ .options=${{
2408
+ state: state.bind(this).call(this, deps),
2409
+ loading: loading2.bind(this),
2410
+ style: options.style,
2411
+ styles: options.styles,
2412
+ error: error.bind(this),
2413
+ deepCloneState: options.deepCloneState,
2414
+ render: (state2, setState, shadowRoot) => {
2415
+ this.shadowRoot.append(shadowRoot);
2416
+ return render(deps).bind(this).call(this, state2, setState, shadowRoot);
2417
+ }
2418
+ }}
2419
+ ></r-renderer>
2420
+ `;
2421
+ } }));
2422
+ exports.Partial = Partial;
2423
+ function Component2({ Settings, Providers, State, Render, Loading, Error: Error2 }) {
2424
+ return (0, exports.Partial)(Settings)(Providers)(State)(Loading)(Error2)(Render);
2425
+ }
2426
+ exports.Component = Component2;
2427
+ }
2428
+ });
2429
+
2430
+ // src/index.ts
2431
+ var index_exports = {};
2432
+ __export(index_exports, {
2433
+ ChatEffects: () => ChatEffects,
2434
+ ChatStore: () => ChatStore,
2435
+ HOSTED_TURNSTILE_URL: () => HOSTED_TURNSTILE_URL,
2436
+ LOCALES: () => LOCALES,
2437
+ LambforgeAgentChat: () => LambforgeAgentChat,
2438
+ TAG: () => TAG,
2439
+ agentEvent: () => agentEvent,
2440
+ agentsLoaded: () => agentsLoaded,
2441
+ chatReducer: () => chatReducer,
2442
+ connecting: () => connecting,
2443
+ errorCode: () => errorCode,
2444
+ failed: () => failed,
2445
+ historyLoaded: () => historyLoaded,
2446
+ initialChatState: () => initialChatState,
2447
+ inline: () => inline,
2448
+ newConversation: () => newConversation,
2449
+ pickAgent: () => pickAgent,
2450
+ pickAgents: () => pickAgents,
2451
+ renderMarkdown: () => renderMarkdown,
2452
+ resume: () => resume,
2453
+ runEnded: () => runEnded,
2454
+ sendMessage: () => sendMessage,
2455
+ shown: () => shown,
2456
+ stop: () => stop,
2457
+ stringsFor: () => stringsFor,
2458
+ toMessage: () => toMessage,
2459
+ turnstileToken: () => turnstileToken,
2460
+ verifying: () => verifying
2461
+ });
2462
+ module.exports = __toCommonJS(index_exports);
2463
+
2464
+ // src/element.ts
2465
+ var import_agents = require("@lambforge/agents");
2466
+ var import_component = __toESM(require_dist3());
2467
+ var import_lit_html19 = __toESM(require_dist());
2468
+ var import_rxjs8 = require("rxjs");
2469
+ var import_operators9 = require("rxjs/operators");
2470
+
2471
+ // src/markdown.ts
2472
+ var import_lit_html18 = __toESM(require_dist());
2473
+ var SAFE_LINK = /^(https?:|mailto:)/i;
2474
+ var BULLET = /^\s*[-*+]\s+/;
2475
+ var NUMBERED = /^\s*\d+[.)]\s+/;
2476
+ var FENCE = /^```\s*([\w+-]*)\s*$/;
2477
+ var HEADING = /^(#{1,6})\s+(.*)$/;
2478
+ function renderMarkdown(text) {
2479
+ const out = [];
2480
+ const lines = String(text ?? "").replace(/\r\n?/g, "\n").split("\n");
2481
+ let i12 = 0;
2482
+ while (i12 < lines.length) {
2483
+ const line = lines[i12];
2484
+ const fence = line.match(FENCE);
2485
+ if (fence) {
2486
+ const code = [];
2487
+ i12++;
2488
+ while (i12 < lines.length && !/^```\s*$/.test(lines[i12])) code.push(lines[i12++]);
2489
+ i12++;
2490
+ out.push(import_lit_html18.html`<pre><code data-lang=${fence[1] || ""}>${code.join("\n")}</code></pre>`);
2491
+ continue;
2492
+ }
2493
+ const heading = line.match(HEADING);
2494
+ if (heading) {
2495
+ out.push(import_lit_html18.html`<p><strong class="h">${inline(heading[2])}</strong></p>`);
2496
+ i12++;
2497
+ continue;
2498
+ }
2499
+ if (BULLET.test(line) || NUMBERED.test(line)) {
2500
+ const ordered = NUMBERED.test(line);
2501
+ const marker = ordered ? NUMBERED : BULLET;
2502
+ const items = [];
2503
+ while (i12 < lines.length && marker.test(lines[i12])) {
2504
+ items.push(import_lit_html18.html`<li>${inline(lines[i12++].replace(marker, ""))}</li>`);
2505
+ }
2506
+ out.push(ordered ? import_lit_html18.html`<ol>${items}</ol>` : import_lit_html18.html`<ul>${items}</ul>`);
2507
+ continue;
2508
+ }
2509
+ if (!line.trim()) {
2510
+ i12++;
2511
+ continue;
2512
+ }
2513
+ const para = [];
2514
+ while (i12 < lines.length && lines[i12].trim() && !/^```/.test(lines[i12]) && !HEADING.test(lines[i12]) && !BULLET.test(lines[i12]) && !NUMBERED.test(lines[i12])) {
2515
+ para.push(lines[i12++]);
2516
+ }
2517
+ out.push(import_lit_html18.html`<p>${para.map((l9, k2) => k2 ? import_lit_html18.html`<br />${inline(l9)}` : inline(l9))}</p>`);
2518
+ }
2519
+ return out;
2520
+ }
2521
+ var TOKEN = /(`[^`]+`)|(\*\*[^*]+\*\*)|(__[^_]+__)|(\*[^*\s][^*]*\*)|(\[[^\]]+\]\([^)\s]+\))|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])/;
2522
+ function inline(text) {
2523
+ const out = [];
2524
+ let rest = text;
2525
+ while (rest) {
2526
+ const m4 = rest.match(TOKEN);
2527
+ if (!m4 || m4.index === void 0) {
2528
+ out.push(rest);
2529
+ break;
2530
+ }
2531
+ if (m4.index) out.push(rest.slice(0, m4.index));
2532
+ const t9 = m4[0];
2533
+ if (m4[1]) out.push(import_lit_html18.html`<code>${t9.slice(1, -1)}</code>`);
2534
+ else if (m4[2] || m4[3]) out.push(import_lit_html18.html`<strong>${inline(t9.slice(2, -2))}</strong>`);
2535
+ else if (m4[4]) out.push(import_lit_html18.html`<em>${inline(t9.slice(1, -1))}</em>`);
2536
+ else if (m4[5]) {
2537
+ const [, label, href] = t9.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/) ?? [];
2538
+ out.push(link(label, href));
2539
+ } else out.push(link(t9, t9));
2540
+ rest = rest.slice(m4.index + t9.length);
2541
+ }
2542
+ return out;
2543
+ }
2544
+ function link(label, href) {
2545
+ if (!SAFE_LINK.test(href)) return label;
2546
+ return import_lit_html18.html`<a href=${href} target="_blank" rel="noopener noreferrer nofollow">${label}</a>`;
2547
+ }
2548
+
2549
+ // ../../node_modules/ts-action/esm5/action.js
2550
+ var __assign = function() {
2551
+ __assign = Object.assign || function(t9) {
2552
+ for (var s9, i12 = 1, n11 = arguments.length; i12 < n11; i12++) {
2553
+ s9 = arguments[i12];
2554
+ for (var p4 in s9) if (Object.prototype.hasOwnProperty.call(s9, p4))
2555
+ t9[p4] = s9[p4];
2556
+ }
2557
+ return t9;
2558
+ };
2559
+ return __assign.apply(this, arguments);
2560
+ };
2561
+ function action(type, config) {
2562
+ if (typeof config === "function") {
2563
+ return defineType(type, function() {
2564
+ var args = [];
2565
+ for (var _i = 0; _i < arguments.length; _i++) {
2566
+ args[_i] = arguments[_i];
2567
+ }
2568
+ return __assign(__assign({}, config.apply(void 0, args)), { type });
2569
+ });
2570
+ }
2571
+ var as = config ? config._as : "empty";
2572
+ switch (as) {
2573
+ case "empty":
2574
+ return defineType(type, function() {
2575
+ return { type };
2576
+ });
2577
+ case "fsa":
2578
+ return defineType(type, function(payload2, meta) {
2579
+ return payload2 instanceof Error ? { error: true, meta, payload: payload2, type } : { error: false, meta, payload: payload2, type };
2580
+ });
2581
+ case "payload":
2582
+ return defineType(type, function(payload2) {
2583
+ return { payload: payload2, type };
2584
+ });
2585
+ case "props":
2586
+ return defineType(type, function(props) {
2587
+ return __assign(__assign({}, props), { type });
2588
+ });
2589
+ default:
2590
+ throw new Error("Unexpected config.");
2591
+ }
2592
+ }
2593
+ function payload() {
2594
+ return { _as: "payload", _p: void 0 };
2595
+ }
2596
+ function defineType(type, creator) {
2597
+ return Object.defineProperty(creator, "type", {
2598
+ value: type,
2599
+ writable: false
2600
+ });
2601
+ }
2602
+
2603
+ // ../../node_modules/ts-action/esm5/reducer.js
2604
+ var __spreadArrays = function() {
2605
+ for (var s9 = 0, i12 = 0, il = arguments.length; i12 < il; i12++) s9 += arguments[i12].length;
2606
+ for (var r7 = Array(s9), k2 = 0, i12 = 0; i12 < il; i12++)
2607
+ for (var a5 = arguments[i12], j = 0, jl = a5.length; j < jl; j++, k2++)
2608
+ r7[k2] = a5[j];
2609
+ return r7;
2610
+ };
2611
+ function on() {
2612
+ var args = [];
2613
+ for (var _i = 0; _i < arguments.length; _i++) {
2614
+ args[_i] = arguments[_i];
2615
+ }
2616
+ var reducer2 = args.pop();
2617
+ var types = args.reduce(function(result, creator) {
2618
+ return __spreadArrays(result, [creator.type]);
2619
+ }, []);
2620
+ return { reducer: reducer2, types };
2621
+ }
2622
+ function reducer(initialState) {
2623
+ var ons = [];
2624
+ for (var _i = 1; _i < arguments.length; _i++) {
2625
+ ons[_i - 1] = arguments[_i];
2626
+ }
2627
+ var map4 = /* @__PURE__ */ new Map();
2628
+ for (var _a = 0, ons_1 = ons; _a < ons_1.length; _a++) {
2629
+ var on_1 = ons_1[_a];
2630
+ for (var _b = 0, _c = on_1.types; _b < _c.length; _b++) {
2631
+ var type = _c[_b];
2632
+ if (!map4.has(type)) {
2633
+ map4.set(type, on_1.reducer);
2634
+ } else {
2635
+ console.warn(type + " already specified in an 'on' call.");
2636
+ }
2637
+ }
2638
+ }
2639
+ return function(state, action2) {
2640
+ if (state === void 0) {
2641
+ state = initialState;
2642
+ }
2643
+ var reducer2 = map4.get(action2.type);
2644
+ return reducer2 ? reducer2(state, action2) : state;
2645
+ };
2646
+ }
2647
+
2648
+ // src/store/chat-actions.ts
2649
+ var shown = action("[chat] shown", payload());
2650
+ var connecting = action("[chat] connecting");
2651
+ var failed = action("[chat] failed", payload());
2652
+ var verifying = action("[chat] verifying", payload());
2653
+ var agentsLoaded = action(
2654
+ "[chat] agents loaded",
2655
+ payload()
2656
+ );
2657
+ var pickAgent = action("[chat] pick agent", payload());
2658
+ var historyLoaded = action(
2659
+ "[chat] history loaded",
2660
+ payload()
2661
+ );
2662
+ var newConversation = action("[chat] new conversation");
2663
+ var sendMessage = action("[chat] send", payload());
2664
+ var resume = action(
2665
+ "[chat] resume",
2666
+ payload()
2667
+ );
2668
+ var agentEvent = action("[chat] event", payload());
2669
+ var runEnded = action("[chat] run ended");
2670
+ var stop = action("[chat] stop", payload());
2671
+
2672
+ // ../../node_modules/@rxdi/redux-store/dist/esm/interfaces.js
2673
+ var FlattenOperator;
2674
+ (function(FlattenOperator2) {
2675
+ FlattenOperator2["switchMap"] = "switchMap";
2676
+ FlattenOperator2["mergeMap"] = "mergeMap";
2677
+ FlattenOperator2["concatMap"] = "concatMap";
2678
+ FlattenOperator2["exhaustMap"] = "exhaustMap";
2679
+ })(FlattenOperator || (FlattenOperator = {}));
2680
+
2681
+ // ../../node_modules/@rxdi/redux-store/dist/esm/store.js
2682
+ var import_rxjs4 = require("rxjs");
2683
+ var import_operators5 = require("rxjs/operators");
2684
+
2685
+ // ../../node_modules/@rxdi/redux-store/dist/esm/reducer.factory.js
2686
+ var import_operators2 = require("rxjs/operators");
2687
+
2688
+ // ../../node_modules/@rxdi/redux-store/dist/esm/utils.js
2689
+ var import_rxjs = require("rxjs");
2690
+ var import_operators = require("rxjs/operators");
2691
+ var isObject = (value) => value !== null && typeof value === "object";
2692
+ var compose = (fns) => fns.reduce((f4, g2) => (...args) => f4(g2(...args)));
2693
+ var catchErr = (0, import_rxjs.pipe)((0, import_operators.catchError)((e16) => (0, import_rxjs.of)(e16)));
2694
+ var flatCatch = (o18) => o18.pipe(catchErr);
2695
+ var mapToObservable = (value) => {
2696
+ if ((0, import_rxjs.isObservable)(value))
2697
+ return value;
2698
+ if (value instanceof Promise)
2699
+ return (0, import_rxjs.from)(value);
2700
+ return (0, import_rxjs.of)(value);
2701
+ };
2702
+
2703
+ // ../../node_modules/@rxdi/redux-store/dist/esm/reducer.factory.js
2704
+ function reducerFactory$([initialState, reducer2, middleware]) {
2705
+ function _reducer(state, action2) {
2706
+ return middleware.length > 0 ? compose(middleware)(reducer2)(state, action2) : reducer2(state, action2);
2707
+ }
2708
+ return (0, import_operators2.scan)(_reducer, initialState);
2709
+ }
2710
+
2711
+ // ../../node_modules/@rxdi/redux-store/dist/esm/defaults.js
2712
+ var import_rxjs2 = require("rxjs");
2713
+ var import_operators3 = require("rxjs/operators");
2714
+ var fop = {
2715
+ switchMap: import_operators3.switchMap,
2716
+ mergeMap: import_operators3.mergeMap,
2717
+ concatMap: import_operators3.concatMap,
2718
+ exhaustMap: import_operators3.exhaustMap
2719
+ };
2720
+ function getDefaults(config = {}, options = {}, dispatchSubject) {
2721
+ var _a;
2722
+ const reducer$ = config && config.reducer$ && config.reducer$.pipe(catchErr) || (0, import_rxjs2.of)((state, action2) => state);
2723
+ const actions$ = new import_rxjs2.Subject();
2724
+ const actionStream$ = (reducer$2) => (0, import_rxjs2.merge)(config && config.actionStream$ && config.actionStream$.pipe(catchErr) || import_rxjs2.EMPTY, dispatchSubject).pipe((0, import_operators3.filter)(isObject), (0, import_operators3.map)(mapToObservable), actionFlatten(flatCatch), (0, import_operators3.tap)(actions$), reducer$2, (0, import_operators3.map)(mapToObservable));
2725
+ const initialState$ = (config && config.initialState$ && config.initialState$.pipe(catchErr) || (0, import_rxjs2.of)({})).pipe((0, import_operators3.share)());
2726
+ const middleware$ = config && config.middleware$ && config.middleware$.pipe(catchErr) || (0, import_rxjs2.of)([]);
2727
+ const destroy$ = ((_a = config === null || config === void 0 ? void 0 : config.destroy$) === null || _a === void 0 ? void 0 : _a.pipe(catchErr)) || import_rxjs2.NEVER;
2728
+ const actionFlatten = fop[options && options.actionFlatOp || FlattenOperator.concatMap];
2729
+ const stateFlatten = fop[options && options.stateFlatOp || FlattenOperator.switchMap];
2730
+ const flattenState$ = (source) => source.pipe(stateFlatten(flatCatch), (0, import_operators3.map)(mapToObservable), stateFlatten(flatCatch));
2731
+ const bufferSize = options && options.bufferSize || 1;
2732
+ const windowTime = options && options.windowTime;
2733
+ const shareReplayConfig = {
2734
+ refCount: false,
2735
+ bufferSize,
2736
+ windowTime
2737
+ };
2738
+ return {
2739
+ reducer$,
2740
+ actions$,
2741
+ actionStream$,
2742
+ initialState$,
2743
+ middleware$,
2744
+ destroy$,
2745
+ flattenState$,
2746
+ shareReplayConfig
2747
+ };
2748
+ }
2749
+
2750
+ // ../../node_modules/@rxdi/redux-store/dist/esm/devtools.js
2751
+ var import_rxjs3 = require("rxjs");
2752
+ var import_operators4 = require("rxjs/operators");
2753
+ var DEVTOOLS_JUMP_TO_STATE = "@@redux-devtools/JUMP_TO_STATE";
2754
+ function normalizeDevToolsConfig(config) {
2755
+ if (!config) {
2756
+ return void 0;
2757
+ }
2758
+ const options = config === true ? {} : config;
2759
+ return options.enabled === false ? void 0 : options;
2760
+ }
2761
+ function withDevToolsTimeTravel(reducerFn) {
2762
+ return (state, action2) => (action2 === null || action2 === void 0 ? void 0 : action2.type) === DEVTOOLS_JUMP_TO_STATE ? action2.state : reducerFn(state, action2);
2763
+ }
2764
+ function connectReduxDevTools(store, options = {}) {
2765
+ var _a, _b;
2766
+ const extension = globalThis.__REDUX_DEVTOOLS_EXTENSION__;
2767
+ if (options.enabled === false || !extension) {
2768
+ return () => void 0;
2769
+ }
2770
+ const devTools = extension.connect(Object.assign({ name: (_a = options.name) !== null && _a !== void 0 ? _a : "RxDI Store", maxAge: (_b = options.maxAge) !== null && _b !== void 0 ? _b : 50 }, options.extensionOptions));
2771
+ const subscription = new import_rxjs3.Subscription();
2772
+ let currentState;
2773
+ subscription.add(store.state$.subscribe((state) => {
2774
+ currentState = state;
2775
+ }));
2776
+ devTools.init(currentState);
2777
+ subscription.add(store.state$.pipe(
2778
+ (0, import_operators4.withLatestFrom)(store.actions$),
2779
+ // Jumps come from the DevTools UI — echoing them back would
2780
+ // pollute the action log.
2781
+ (0, import_operators4.filter)(([, action2]) => action2.type !== DEVTOOLS_JUMP_TO_STATE)
2782
+ ).subscribe(([state, action2]) => devTools.send(action2, state)));
2783
+ const unsubscribeMessages = devTools.subscribe((message) => {
2784
+ var _a2;
2785
+ if (message.type !== "DISPATCH") {
2786
+ return;
2787
+ }
2788
+ const kind = (_a2 = message.payload) === null || _a2 === void 0 ? void 0 : _a2.type;
2789
+ if ((kind === "JUMP_TO_ACTION" || kind === "JUMP_TO_STATE") && message.state) {
2790
+ store.dispatch({
2791
+ type: DEVTOOLS_JUMP_TO_STATE,
2792
+ state: JSON.parse(message.state)
2793
+ });
2794
+ } else if (kind === "COMMIT") {
2795
+ devTools.init(currentState);
2796
+ }
2797
+ });
2798
+ return () => {
2799
+ var _a2;
2800
+ subscription.unsubscribe();
2801
+ if (typeof unsubscribeMessages === "function") {
2802
+ unsubscribeMessages();
2803
+ }
2804
+ (_a2 = devTools.unsubscribe) === null || _a2 === void 0 ? void 0 : _a2.call(devTools);
2805
+ };
2806
+ }
2807
+
2808
+ // ../../node_modules/@rxdi/redux-store/dist/esm/store.js
2809
+ var Store = class {
2810
+ /**
2811
+ * Default configuration
2812
+ *
2813
+ * @param {Object} config
2814
+ * {
2815
+ * reducer$: of(reducer({})),
2816
+ * actionStream$: EMPTY, // if not defined, no actions will be dispatched in the store
2817
+ * initialState$: of({}),
2818
+ * middleware$: of([]),
2819
+ * destroy$: NEVER // if not defined, the state subscription will live forever
2820
+ * }
2821
+ *
2822
+ * @param {Object} options
2823
+ * {
2824
+ * actionFop: FlattenOps.concatMap, // Flatten operator for actions's stream.
2825
+ * stateFop: FlattenOps.switchMap // Flatten operator for state's stream.
2826
+ * windowTime: undefined //Maximum time length of the replay buffer in milliseconds.
2827
+ * bufferSize: 1 //Maximum element count of the replay buffer.
2828
+ * }
2829
+ */
2830
+ constructor(config, options) {
2831
+ var _a, _b, _c, _d;
2832
+ this.config = config;
2833
+ this.options = options;
2834
+ this._dispatch$ = new import_rxjs4.Subject();
2835
+ this.dispatch = (action2) => {
2836
+ this._dispatch$.next(action2);
2837
+ };
2838
+ const devToolsOptions = normalizeDevToolsConfig((_a = this.config) === null || _a === void 0 ? void 0 : _a.devTools);
2839
+ if (devToolsOptions) {
2840
+ this.config = Object.assign(Object.assign({}, this.config), { reducer$: ((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.reducer$) !== null && _c !== void 0 ? _c : (0, import_rxjs4.of)((state) => state)).pipe((0, import_operators5.map)((reducerFn) => withDevToolsTimeTravel(reducerFn))) });
2841
+ }
2842
+ const { reducer$, actions$, actionStream$, middleware$, initialState$, destroy$, flattenState$, shareReplayConfig } = getDefaults(this.config, this.options, this._dispatch$);
2843
+ this.state$ = (0, import_rxjs4.combineLatest)([initialState$, reducer$, middleware$]).pipe((0, import_operators5.map)(reducerFactory$), (0, import_operators5.concatMap)(actionStream$), (0, import_operators5.startWith)(initialState$), flattenState$, (0, import_operators5.takeUntil)(destroy$), (0, import_operators5.shareReplay)(shareReplayConfig));
2844
+ this.state$.subscribe();
2845
+ this.actions$ = actions$.pipe((0, import_operators5.shareReplay)(shareReplayConfig));
2846
+ if ((_d = this.config) === null || _d === void 0 ? void 0 : _d.epic$) {
2847
+ this.config.epic$(this.actions$, this.state$).pipe((0, import_operators5.takeUntil)(destroy$)).subscribe({
2848
+ next: (action2) => this.dispatch(action2),
2849
+ error: (err) => console.error("[Epic] Error:", err)
2850
+ });
2851
+ }
2852
+ if (devToolsOptions) {
2853
+ const disconnect = connectReduxDevTools(this, devToolsOptions);
2854
+ destroy$.subscribe(() => disconnect());
2855
+ }
2856
+ }
2857
+ };
2858
+ function createStore(config = {}, opts = {}) {
2859
+ return new Store(config, opts);
2860
+ }
2861
+
2862
+ // ../../node_modules/@rxdi/redux-store/dist/esm/effects.js
2863
+ var import_rxjs5 = require("rxjs");
2864
+ var import_operators6 = require("rxjs/operators");
2865
+ function ofType(...actionCreators) {
2866
+ const types = new Set(actionCreators.map((creator) => creator.type));
2867
+ return (action$) => action$.pipe((0, import_operators6.filter)((action2) => types.has(action2.type)));
2868
+ }
2869
+ function createEffect(options = { dispatch: true }) {
2870
+ return (effectFactory) => {
2871
+ return (action$, state$) => {
2872
+ const mappedEffect$ = effectFactory(action$, state$);
2873
+ if (options.dispatch === false) {
2874
+ return mappedEffect$.pipe((0, import_operators6.ignoreElements)(), (0, import_operators6.catchError)((error) => {
2875
+ console.error("[Effect] Error:", error);
2876
+ return (0, import_rxjs5.of)();
2877
+ }));
2878
+ }
2879
+ return mappedEffect$.pipe((0, import_operators6.catchError)((error) => {
2880
+ console.error("[Effect] Error:", error);
2881
+ return (0, import_rxjs5.of)();
2882
+ }));
2883
+ };
2884
+ };
2885
+ }
2886
+ function createEpicRegistry(...effects) {
2887
+ return (action$, state$) => {
2888
+ return (0, import_rxjs5.merge)(...effects.map((effect) => effect(action$, state$)));
2889
+ };
2890
+ }
2891
+
2892
+ // src/store/chat-effects.ts
2893
+ var import_rxjs6 = require("rxjs");
2894
+ var import_operators7 = require("rxjs/operators");
2895
+ var errorCode = (e16) => e16?.code || "internal";
2896
+ var fail = (e16) => (0, import_rxjs6.of)(failed(errorCode(e16)));
2897
+ function pickAgents(all, ctx) {
2898
+ const agents = ctx.agents.length ? all.filter((a5) => ctx.agents.includes(a5.id) || ctx.agents.includes(a5.name)) : all;
2899
+ const preferred = agents.find((a5) => a5.id === ctx.agent || a5.name === ctx.agent) ?? agents[0];
2900
+ return { agents, agentId: preferred?.id ?? null };
2901
+ }
2902
+ var ChatEffects = class {
2903
+ constructor(ctx) {
2904
+ this.ctx = ctx;
2905
+ /** The first time the panel is on screen: the agents this session may use. */
2906
+ this.connect$ = createEffect()(
2907
+ (_action$, state$) => state$.pipe(
2908
+ (0, import_operators7.filter)((s9) => s9.shown),
2909
+ (0, import_operators7.take)(1),
2910
+ (0, import_operators7.switchMap)(() => {
2911
+ const client = this.ctx.client;
2912
+ if (!client) return (0, import_rxjs6.of)(failed("unauthorized"));
2913
+ return (0, import_rxjs6.concat)(
2914
+ (0, import_rxjs6.of)(connecting()),
2915
+ client.agents().pipe(
2916
+ (0, import_operators7.take)(1),
2917
+ (0, import_operators7.map)((all) => agentsLoaded(pickAgents(all, this.ctx))),
2918
+ (0, import_operators7.catchError)(fail)
2919
+ )
2920
+ );
2921
+ })
2922
+ )
2923
+ );
2924
+ /** The selected agent's latest conversation (resuming a running answer). */
2925
+ this.select$ = createEffect()(
2926
+ (action$) => (0, import_rxjs6.merge)(
2927
+ action$.pipe(
2928
+ ofType(agentsLoaded),
2929
+ (0, import_operators7.map)(({ payload: payload2 }) => payload2.agentId)
2930
+ ),
2931
+ action$.pipe(
2932
+ ofType(pickAgent),
2933
+ (0, import_operators7.map)(({ payload: payload2 }) => payload2)
2934
+ )
2935
+ ).pipe(
2936
+ (0, import_operators7.filter)((id) => !!id),
2937
+ (0, import_operators7.switchMap)((agentId) => {
2938
+ const client = this.ctx.client;
2939
+ return client.conversations(agentId).pipe(
2940
+ (0, import_operators7.take)(1),
2941
+ (0, import_operators7.switchMap)((list) => {
2942
+ const latest = list?.[0];
2943
+ if (!latest) return import_rxjs6.EMPTY;
2944
+ return client.agent(agentId).conversation(latest.id).history().pipe(
2945
+ (0, import_operators7.mergeMap)(
2946
+ (detail) => (0, import_rxjs6.from)([
2947
+ historyLoaded({ agentId, detail }),
2948
+ ...detail.answering ? [resume({ agentId, conversationId: detail.id, afterSeq: detail.lastSeq ?? 0 })] : []
2949
+ ])
2950
+ )
2951
+ );
2952
+ }),
2953
+ (0, import_operators7.catchError)(fail)
2954
+ );
2955
+ })
2956
+ )
2957
+ );
2958
+ /**
2959
+ * One run at a time: a sent message or a resumed answer, its events as
2960
+ * actions until done / error, cancelled by stop, another agent or a new
2961
+ * conversation.
2962
+ */
2963
+ this.run$ = createEffect()(
2964
+ (action$) => (0, import_rxjs6.merge)(
2965
+ action$.pipe(
2966
+ ofType(sendMessage),
2967
+ (0, import_operators7.map)(({ payload: payload2 }) => {
2968
+ const { agentId, conversationId, text } = payload2;
2969
+ const c9 = this.conversation(agentId, conversationId);
2970
+ return { c: c9, events: c9.send(text) };
2971
+ })
2972
+ ),
2973
+ action$.pipe(
2974
+ ofType(resume),
2975
+ (0, import_operators7.map)(({ payload: payload2 }) => {
2976
+ const { agentId, conversationId, afterSeq } = payload2;
2977
+ const c9 = this.conversation(agentId, conversationId);
2978
+ return { c: c9, events: c9.events(afterSeq) };
2979
+ })
2980
+ )
2981
+ ).pipe(
2982
+ (0, import_operators7.switchMap)(
2983
+ ({ c: c9, events }) => this.follow$(c9, events).pipe(
2984
+ (0, import_operators7.takeUntil)(action$.pipe(ofType(stop, pickAgent, newConversation))),
2985
+ (0, import_operators7.endWith)(runEnded())
2986
+ )
2987
+ )
2988
+ )
2989
+ );
2990
+ /** Tell the server to stop the answer. */
2991
+ this.abort$ = createEffect()(
2992
+ (action$) => action$.pipe(
2993
+ ofType(stop),
2994
+ (0, import_operators7.mergeMap)(({ payload: payload2 }) => {
2995
+ const { agentId, conversationId } = payload2;
2996
+ if (!conversationId || !this.ctx.client) return import_rxjs6.EMPTY;
2997
+ return this.conversation(agentId, conversationId).abort().pipe(
2998
+ (0, import_operators7.ignoreElements)(),
2999
+ (0, import_operators7.catchError)(() => import_rxjs6.EMPTY)
3000
+ );
3001
+ })
3002
+ )
3003
+ );
3004
+ /** Failures also reach the page as an `error` event. */
3005
+ this.failures$ = createEffect()(
3006
+ (action$) => action$.pipe(
3007
+ ofType(failed),
3008
+ (0, import_operators7.tap)(({ payload: payload2 }) => this.ctx.emit("error", { code: payload2 })),
3009
+ (0, import_operators7.ignoreElements)()
3010
+ )
3011
+ );
3012
+ }
3013
+ conversation(agentId, conversationId) {
3014
+ return this.ctx.client.agent(agentId).conversation(conversationId ?? void 0);
3015
+ }
3016
+ follow$(c9, events) {
3017
+ const announced = /* @__PURE__ */ new Set();
3018
+ return events.pipe(
3019
+ (0, import_operators7.takeWhile)((e16) => e16.type !== "done" && e16.type !== "error", true),
3020
+ (0, import_operators7.tap)((e16) => {
3021
+ if (e16.type === "message" && e16.data?.role === "assistant" && !announced.has(e16.data.id)) {
3022
+ announced.add(e16.data.id);
3023
+ this.ctx.emit("answer", { text: e16.data.text, agent: c9.agent, conversationId: e16.conversationId });
3024
+ }
3025
+ if (e16.type === "error") this.ctx.emit("error", { code: e16.data?.code ?? "internal" });
3026
+ }),
3027
+ (0, import_operators7.map)((e16) => agentEvent(e16)),
3028
+ (0, import_operators7.catchError)(fail)
3029
+ );
3030
+ }
3031
+ };
3032
+
3033
+ // src/store/chat-state.ts
3034
+ var initialChatState = {
3035
+ shown: false,
3036
+ agents: [],
3037
+ agentId: null,
3038
+ conversationId: null,
3039
+ messages: [],
3040
+ answering: false,
3041
+ notice: null
3042
+ };
3043
+ function toMessage(m4) {
3044
+ const tools = (m4.toolCalls ?? []).map((c9) => c9?.name).filter((n11) => !!n11);
3045
+ return { id: m4.id, role: m4.role, text: m4.text ?? "", tools: Array.from(new Set(tools)) };
3046
+ }
3047
+
3048
+ // src/store/chat-reducer.ts
3049
+ var LOCAL_ID = /^local:/;
3050
+ var empty = { conversationId: null, messages: [], answering: false, notice: null };
3051
+ var chatReducer = reducer(
3052
+ initialChatState,
3053
+ on(shown, (s9, { payload: payload2 }) => s9.shown || !payload2 ? s9 : { ...s9, shown: true }),
3054
+ on(connecting, (s9) => ({ ...s9, notice: { kind: "busy", what: "connecting" } })),
3055
+ on(failed, (s9, { payload: payload2 }) => ({
3056
+ ...s9,
3057
+ answering: false,
3058
+ notice: { kind: "error", code: payload2 }
3059
+ })),
3060
+ on(verifying, (s9, { payload: payload2 }) => ({
3061
+ ...s9,
3062
+ notice: payload2 ? { kind: "busy", what: "verifying" } : s9.notice?.kind === "busy" && s9.notice.what === "verifying" ? null : s9.notice
3063
+ })),
3064
+ on(agentsLoaded, (s9, { payload: payload2 }) => ({
3065
+ ...s9,
3066
+ agents: payload2.agents,
3067
+ agentId: payload2.agentId,
3068
+ notice: payload2.agentId ? null : { kind: "error", code: "agent-unavailable" }
3069
+ })),
3070
+ on(pickAgent, (s9, { payload: payload2 }) => ({ ...s9, ...empty, agentId: payload2 })),
3071
+ on(
3072
+ historyLoaded,
3073
+ (s9, { payload: payload2 }) => payload2.agentId !== s9.agentId ? s9 : {
3074
+ ...s9,
3075
+ conversationId: payload2.detail.id,
3076
+ messages: (payload2.detail.messages ?? []).map(toMessage),
3077
+ answering: !!payload2.detail.answering,
3078
+ notice: payload2.detail.answering ? { kind: "busy", what: "thinking" } : null
3079
+ }
3080
+ ),
3081
+ on(newConversation, (s9) => ({ ...s9, ...empty })),
3082
+ on(sendMessage, (s9, { payload: payload2 }) => ({
3083
+ ...s9,
3084
+ // shown at once; replaced by the stored copy when it arrives
3085
+ messages: [
3086
+ ...s9.messages,
3087
+ { id: `local:${s9.messages.length}`, role: "user", text: payload2.text, tools: [] }
3088
+ ],
3089
+ answering: true,
3090
+ notice: { kind: "busy", what: "thinking" }
3091
+ })),
3092
+ on(agentEvent, (s9, { payload: payload2 }) => withEvent(s9, payload2)),
3093
+ on(runEnded, (s9) => ({
3094
+ ...s9,
3095
+ answering: false,
3096
+ notice: s9.notice?.kind === "busy" ? null : s9.notice
3097
+ })),
3098
+ on(stop, (s9) => ({ ...s9, answering: false, notice: { kind: "info", what: "stopped" } }))
3099
+ );
3100
+ function withEvent(s9, event) {
3101
+ const conversationId = s9.conversationId ?? event.conversationId;
3102
+ if (event.conversationId !== conversationId) return s9;
3103
+ if (event.type === "error") {
3104
+ return { ...s9, conversationId, notice: { kind: "error", code: event.data?.code ?? "internal" } };
3105
+ }
3106
+ if (event.type !== "message" || !event.data?.id) return { ...s9, conversationId };
3107
+ const message = toMessage(event.data);
3108
+ if (s9.messages.some((m4) => m4.id === message.id)) return { ...s9, conversationId };
3109
+ const messages = [...s9.messages];
3110
+ const local = message.role === "user" ? messages.findIndex((m4) => LOCAL_ID.test(m4.id) && m4.text === message.text) : -1;
3111
+ if (local >= 0) messages[local] = message;
3112
+ else messages.push(message);
3113
+ return { ...s9, conversationId, messages };
3114
+ }
3115
+
3116
+ // src/store/chat-store.ts
3117
+ var import_rxjs7 = require("rxjs");
3118
+ var import_operators8 = require("rxjs/operators");
3119
+ var ChatStore = class {
3120
+ constructor(ctx, initial = {}) {
3121
+ this.destroy$ = new import_rxjs7.Subject();
3122
+ const effects = new ChatEffects(ctx);
3123
+ this.store = createStore({
3124
+ reducer$: (0, import_rxjs7.of)(chatReducer),
3125
+ initialState$: (0, import_rxjs7.of)({ ...initialChatState, ...initial }),
3126
+ // RULE: every effect must be listed here or it never runs.
3127
+ // connect$ LAST: it can start at once (an inline chat is shown from
3128
+ // the first state) and the others must already listen to its actions.
3129
+ epic$: createEpicRegistry(
3130
+ effects.select$,
3131
+ effects.run$,
3132
+ effects.abort$,
3133
+ effects.failures$,
3134
+ effects.connect$
3135
+ ),
3136
+ destroy$: this.destroy$
3137
+ });
3138
+ this.state$ = this.store.state$.pipe((0, import_operators8.distinctUntilChanged)());
3139
+ }
3140
+ dispatch(action2) {
3141
+ this.store.dispatch(action2);
3142
+ }
3143
+ destroy() {
3144
+ this.destroy$.next();
3145
+ this.destroy$.complete();
3146
+ }
3147
+ };
3148
+
3149
+ // src/strings.ts
3150
+ var en = {
3151
+ title: "Chat",
3152
+ open: "Open chat",
3153
+ close: "Close chat",
3154
+ newChat: "New conversation",
3155
+ placeholder: "Type a message",
3156
+ send: "Send",
3157
+ stop: "Stop",
3158
+ thinking: "Thinking",
3159
+ connecting: "Connecting",
3160
+ pickAgent: "Assistant",
3161
+ usedTools: "Used",
3162
+ verifying: "Checking that you are human",
3163
+ errors: {
3164
+ "limit-reached": "This conversation is full - start a new one.",
3165
+ "cap-reached": "The assistant is not available right now - try again later.",
3166
+ "agent-unavailable": "This assistant is not available.",
3167
+ "session-expired": "Your session ended - reload the page.",
3168
+ "credential-expired": "Please sign in again.",
3169
+ aborted: "Stopped.",
3170
+ internal: "Something went wrong - try again.",
3171
+ unauthorized: "This chat is not allowed here.",
3172
+ "bad-request": "That did not work - try again.",
3173
+ network: "No connection - try again.",
3174
+ default: "Something went wrong - try again."
3175
+ }
3176
+ };
3177
+ var bg = {
3178
+ title: "\u0427\u0430\u0442",
3179
+ open: "\u041E\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",
3180
+ close: "\u0417\u0430\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",
3181
+ newChat: "\u041D\u043E\u0432 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440",
3182
+ placeholder: "\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u0441\u044A\u043E\u0431\u0449\u0435\u043D\u0438\u0435",
3183
+ send: "\u0418\u0437\u043F\u0440\u0430\u0442\u0438",
3184
+ stop: "\u0421\u043F\u0440\u0438",
3185
+ thinking: "\u041C\u0438\u0441\u043B\u044F",
3186
+ connecting: "\u0421\u0432\u044A\u0440\u0437\u0432\u0430\u043D\u0435",
3187
+ pickAgent: "\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442",
3188
+ usedTools: "\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u043D\u043E",
3189
+ verifying: "\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430, \u0447\u0435 \u0441\u0442\u0435 \u0447\u043E\u0432\u0435\u043A",
3190
+ errors: {
3191
+ "limit-reached": "\u0420\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u044A\u0442 \u0435 \u043F\u044A\u043B\u0435\u043D - \u0437\u0430\u043F\u043E\u0447\u043D\u0435\u0442\u0435 \u043D\u043E\u0432.",
3192
+ "cap-reached": "\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u044A\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D \u0432 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.",
3193
+ "agent-unavailable": "\u0422\u043E\u0437\u0438 \u0430\u0441\u0438\u0441\u0442\u0435\u043D\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D.",
3194
+ "session-expired": "\u0421\u0435\u0441\u0438\u044F\u0442\u0430 \u0438\u0437\u0442\u0435\u0447\u0435 - \u043F\u0440\u0435\u0437\u0430\u0440\u0435\u0434\u0435\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0442\u0430.",
3195
+ "credential-expired": "\u041C\u043E\u043B\u044F, \u0432\u043B\u0435\u0437\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
3196
+ aborted: "\u0421\u043F\u0440\u044F\u043D\u043E.",
3197
+ internal: "\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
3198
+ unauthorized: "\u0422\u043E\u0437\u0438 \u0447\u0430\u0442 \u043D\u0435 \u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D \u0442\u0443\u043A.",
3199
+ "bad-request": "\u041D\u0435 \u0441\u0435 \u043F\u043E\u043B\u0443\u0447\u0438 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
3200
+ network: "\u041D\u044F\u043C\u0430 \u0432\u0440\u044A\u0437\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
3201
+ default: "\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E."
3202
+ }
3203
+ };
3204
+ var LOCALES = { en, bg };
3205
+ function stringsFor(locale, overrides = {}) {
3206
+ const lang = String(locale || "en").toLowerCase().split("-")[0];
3207
+ const base = LOCALES[lang] ?? en;
3208
+ return {
3209
+ ...base,
3210
+ ...overrides,
3211
+ errors: { ...base.errors, ...overrides.errors ?? {} }
3212
+ };
3213
+ }
3214
+
3215
+ // src/styles.ts
3216
+ var STYLES = `
3217
+ :host {
3218
+ --_accent: var(--lf-chat-accent, #4f46e5);
3219
+ --_accent-fg: var(--lf-chat-accent-fg, #ffffff);
3220
+ --_bg: var(--lf-chat-bg, #ffffff);
3221
+ --_fg: var(--lf-chat-fg, #111827);
3222
+ --_muted: var(--lf-chat-muted, #6b7280);
3223
+ --_border: var(--lf-chat-border, #e5e7eb);
3224
+ --_bot-bg: var(--lf-chat-bot-bg, #f3f4f6);
3225
+ --_bot-fg: var(--lf-chat-bot-fg, var(--_fg));
3226
+ --_user-bg: var(--lf-chat-user-bg, var(--_accent));
3227
+ --_user-fg: var(--lf-chat-user-fg, var(--_accent-fg));
3228
+ --_error: var(--lf-chat-error, #b91c1c);
3229
+ --_radius: var(--lf-chat-radius, 12px);
3230
+ --_font: var(--lf-chat-font, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
3231
+ --_width: var(--lf-chat-width, 380px);
3232
+ --_height: var(--lf-chat-height, min(640px, calc(100vh - 120px)));
3233
+ --_offset: var(--lf-chat-offset, 20px);
3234
+ --_z: var(--lf-chat-z-index, 2147483000);
3235
+ --_launcher: var(--lf-chat-launcher-size, 56px);
3236
+ --_shadow: var(--lf-chat-shadow, 0 12px 40px rgba(0, 0, 0, 0.18));
3237
+ font-family: var(--_font);
3238
+ color: var(--_fg);
3239
+ font-size: 15px;
3240
+ line-height: 1.45;
3241
+ }
3242
+ :host([theme='dark']) {
3243
+ --_bg: var(--lf-chat-bg, #111827);
3244
+ --_fg: var(--lf-chat-fg, #f9fafb);
3245
+ --_muted: var(--lf-chat-muted, #9ca3af);
3246
+ --_border: var(--lf-chat-border, #374151);
3247
+ --_bot-bg: var(--lf-chat-bot-bg, #1f2937);
3248
+ --_error: var(--lf-chat-error, #f87171);
3249
+ }
3250
+ * { box-sizing: border-box; }
3251
+ [hidden] { display: none !important; }
3252
+ button { font: inherit; cursor: pointer; }
3253
+
3254
+ .launcher {
3255
+ position: fixed;
3256
+ bottom: var(--_offset);
3257
+ right: var(--_offset);
3258
+ width: var(--_launcher);
3259
+ height: var(--_launcher);
3260
+ border-radius: 50%;
3261
+ border: 0;
3262
+ background: var(--_accent);
3263
+ color: var(--_accent-fg);
3264
+ box-shadow: var(--_shadow);
3265
+ z-index: var(--_z);
3266
+ display: grid;
3267
+ place-items: center;
3268
+ }
3269
+ :host([position='bottom-left']) .launcher { right: auto; left: var(--_offset); }
3270
+ .launcher svg { width: 26px; height: 26px; }
3271
+
3272
+ .panel {
3273
+ display: flex;
3274
+ flex-direction: column;
3275
+ background: var(--_bg);
3276
+ color: var(--_fg);
3277
+ border: 1px solid var(--_border);
3278
+ border-radius: var(--_radius);
3279
+ overflow: hidden;
3280
+ }
3281
+ :host(:not([mode])) .panel,
3282
+ :host([mode='drawer']) .panel {
3283
+ position: fixed;
3284
+ bottom: calc(var(--_offset) + var(--_launcher) + 12px);
3285
+ right: var(--_offset);
3286
+ width: var(--_width);
3287
+ height: var(--_height);
3288
+ box-shadow: var(--_shadow);
3289
+ z-index: var(--_z);
3290
+ }
3291
+ :host([position='bottom-left']) .panel { right: auto; left: var(--_offset); }
3292
+ :host([mode='inline']) .panel { width: 100%; height: var(--lf-chat-height, 560px); }
3293
+ :host([mode='fullscreen']) .panel {
3294
+ position: fixed; inset: 0; border-radius: 0; border: 0; z-index: var(--_z);
3295
+ }
3296
+ @media (max-width: 640px) {
3297
+ :host(:not([mode])) .panel,
3298
+ :host([mode='drawer']) .panel {
3299
+ inset: 0; width: auto; height: auto; border-radius: 0; border: 0;
3300
+ height: 100dvh;
3301
+ }
3302
+ }
3303
+
3304
+ header {
3305
+ display: flex;
3306
+ align-items: center;
3307
+ gap: 8px;
3308
+ padding: 10px 12px;
3309
+ border-bottom: 1px solid var(--_border);
3310
+ }
3311
+ header .title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3312
+ header select {
3313
+ font: inherit; color: inherit; background: transparent;
3314
+ border: 1px solid var(--_border); border-radius: 8px; padding: 4px 6px; max-width: 45%;
3315
+ }
3316
+ .icon {
3317
+ border: 0; background: transparent; color: var(--_muted);
3318
+ width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
3319
+ }
3320
+ .icon:hover, .icon:focus-visible { background: var(--_bot-bg); color: var(--_fg); }
3321
+ .icon svg { width: 18px; height: 18px; }
3322
+ :host([mode='inline']) .close { display: none; }
3323
+
3324
+ .messages {
3325
+ flex: 1;
3326
+ overflow-y: auto;
3327
+ padding: 14px 12px;
3328
+ display: flex;
3329
+ flex-direction: column;
3330
+ gap: 10px;
3331
+ scrollbar-width: thin;
3332
+ }
3333
+ .msg { max-width: 85%; padding: 8px 12px; border-radius: var(--_radius); overflow-wrap: anywhere; }
3334
+ .msg.user { align-self: flex-end; background: var(--_user-bg); color: var(--_user-fg); white-space: pre-wrap; }
3335
+ .msg.assistant { align-self: flex-start; background: var(--_bot-bg); color: var(--_bot-fg); }
3336
+ .msg p { margin: 0 0 6px; }
3337
+ .msg p:last-child { margin-bottom: 0; }
3338
+ .msg ul, .msg ol { margin: 4px 0 6px; padding-left: 20px; }
3339
+ .msg pre { margin: 6px 0; padding: 8px; overflow-x: auto; border-radius: 8px; background: rgba(0,0,0,0.06); font-size: 13px; }
3340
+ .msg code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
3341
+ .msg a { color: inherit; }
3342
+ .tools { font-size: 12px; color: var(--_muted); margin-top: 4px; }
3343
+
3344
+ .welcome { color: var(--_muted); }
3345
+ .suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
3346
+ .suggestions button {
3347
+ border: 1px solid var(--_border); background: transparent; color: var(--_fg);
3348
+ border-radius: 999px; padding: 6px 10px; font-size: 13px; text-align: left;
3349
+ }
3350
+ .suggestions button:hover, .suggestions button:focus-visible { border-color: var(--_accent); }
3351
+
3352
+ .status { font-size: 13px; color: var(--_muted); padding: 0 12px 6px; min-height: 0; }
3353
+ .status.error { color: var(--_error); }
3354
+ .dots::after { content: '...'; animation: dots 1.2s steps(4, end) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
3355
+ @keyframes dots { from { width: 0; } to { width: 1.2em; } }
3356
+ @media (prefers-reduced-motion: reduce) { .dots::after { animation: none; } }
3357
+
3358
+ .turnstile { padding: 0 12px 6px; }
3359
+ .turnstile iframe { border: 0; width: 100%; height: 70px; }
3360
+
3361
+ form {
3362
+ display: flex;
3363
+ gap: 8px;
3364
+ padding: 10px 12px;
3365
+ border-top: 1px solid var(--_border);
3366
+ align-items: flex-end;
3367
+ }
3368
+ textarea {
3369
+ flex: 1;
3370
+ resize: none;
3371
+ font: inherit;
3372
+ color: inherit;
3373
+ background: transparent;
3374
+ border: 1px solid var(--_border);
3375
+ border-radius: 10px;
3376
+ padding: 8px 10px;
3377
+ max-height: 140px;
3378
+ min-height: 40px;
3379
+ }
3380
+ textarea:focus-visible { outline: 2px solid var(--_accent); outline-offset: 0; border-color: transparent; }
3381
+ .send {
3382
+ border: 0; border-radius: 10px; background: var(--_accent); color: var(--_accent-fg);
3383
+ padding: 0 14px; height: 40px; font-weight: 600;
3384
+ }
3385
+ .send:disabled { opacity: 0.5; cursor: default; }
3386
+ .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
3387
+ `;
3388
+
3389
+ // src/turnstile.ts
3390
+ var HOSTED_TURNSTILE_URL = "https://lambforge.com/agent-turnstile.html";
3391
+ var SCRIPT = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";
3392
+ var TIMEOUT_MS = 12e4;
3393
+ var loading = null;
3394
+ function loadTurnstile(doc) {
3395
+ const win = doc.defaultView;
3396
+ if (win?.turnstile) return Promise.resolve(win.turnstile);
3397
+ if (!loading) {
3398
+ loading = new Promise((resolve, reject) => {
3399
+ const s9 = doc.createElement("script");
3400
+ s9.src = SCRIPT;
3401
+ s9.async = true;
3402
+ s9.onload = () => win.turnstile ? resolve(win.turnstile) : reject(new Error("turnstile did not load"));
3403
+ s9.onerror = () => {
3404
+ loading = null;
3405
+ reject(new Error("turnstile did not load"));
3406
+ };
3407
+ doc.head.append(s9);
3408
+ });
3409
+ }
3410
+ return loading;
3411
+ }
3412
+ function turnstileToken(opts) {
3413
+ const doc = opts.host.ownerDocument;
3414
+ if (opts.sitekey) {
3415
+ return loadTurnstile(doc).then(
3416
+ (api) => new Promise((resolve, reject) => {
3417
+ const box = doc.createElement("div");
3418
+ opts.host.append(box);
3419
+ let id;
3420
+ const end = () => {
3421
+ try {
3422
+ if (id) api.remove(id);
3423
+ } catch {
3424
+ }
3425
+ box.remove();
3426
+ };
3427
+ id = api.render(box, {
3428
+ sitekey: opts.sitekey,
3429
+ appearance: "interaction-only",
3430
+ callback: (token) => {
3431
+ end();
3432
+ resolve(token);
3433
+ },
3434
+ "error-callback": () => {
3435
+ end();
3436
+ reject(new Error("turnstile failed"));
3437
+ }
3438
+ });
3439
+ })
3440
+ );
3441
+ }
3442
+ const url = new URL(opts.hostedUrl || HOSTED_TURNSTILE_URL);
3443
+ const win = doc.defaultView;
3444
+ url.searchParams.set("origin", win.location.origin);
3445
+ return new Promise((resolve, reject) => {
3446
+ const frame = doc.createElement("iframe");
3447
+ frame.title = "Bot check";
3448
+ frame.src = url.href;
3449
+ const timer = setTimeout(() => done(new Error("turnstile timed out")), TIMEOUT_MS);
3450
+ const onMessage = (ev) => {
3451
+ if (ev.origin !== url.origin || ev.source !== frame.contentWindow) return;
3452
+ const data = ev.data;
3453
+ if (data?.type !== "lambforge-turnstile") return;
3454
+ if (data.token) done(null, data.token);
3455
+ else done(new Error(data.error || "turnstile failed"));
3456
+ };
3457
+ const done = (err, token) => {
3458
+ clearTimeout(timer);
3459
+ win.removeEventListener("message", onMessage);
3460
+ frame.remove();
3461
+ if (err) reject(err);
3462
+ else resolve(token);
3463
+ };
3464
+ win.addEventListener("message", onMessage);
3465
+ opts.host.append(frame);
3466
+ });
3467
+ }
3468
+
3469
+ // src/element.ts
3470
+ var TAG = "lambforge-agent-chat";
3471
+ var ICON_CHAT = import_lit_html19.svg`<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>`;
3472
+ var ICON_CLOSE = import_lit_html19.svg`<path d="M18 6 6 18M6 6l12 12"/>`;
3473
+ var ICON_NEW = import_lit_html19.svg`<path d="M12 5v14M5 12h14"/>`;
3474
+ var icon = (paths) => import_lit_html19.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${paths}</svg>`;
3475
+ var LambforgeAgentChat = class extends import_lit_html19.LitElement {
3476
+ constructor() {
3477
+ super(...arguments);
3478
+ this.open = false;
3479
+ this.mode = "drawer";
3480
+ this.position = "bottom-right";
3481
+ this.theme = "light";
3482
+ this.agent = "";
3483
+ this.agents = "";
3484
+ this.locale = "";
3485
+ this.heading = "";
3486
+ this.url = "";
3487
+ this.publishableKey = "";
3488
+ this.tokenUrl = "";
3489
+ this.turnstileSitekey = "";
3490
+ this.turnstileUrl = "";
3491
+ this.strings = {};
3492
+ this.lastCount = 0;
3493
+ }
3494
+ get shown() {
3495
+ return this.mode !== "drawer" || this.open;
3496
+ }
3497
+ get t() {
3498
+ return stringsFor(
3499
+ this.locale || this.ownerDocument.documentElement.lang || "en",
3500
+ this.strings
3501
+ );
3502
+ }
3503
+ /** Cold: <r-renderer> subscribes once; the store lives as long as that. */
3504
+ connect() {
3505
+ return (0, import_rxjs8.defer)(() => {
3506
+ const store = new ChatStore(
3507
+ {
3508
+ client: this.resolveClient(),
3509
+ agent: this.agent,
3510
+ agents: this.agents.split(",").map((s9) => s9.trim()).filter(Boolean),
3511
+ emit: (type, detail) => this.emit(type, detail)
3512
+ },
3513
+ { shown: this.shown }
3514
+ );
3515
+ this.store = store;
3516
+ return store.state$.pipe(
3517
+ (0, import_operators9.finalize)(() => {
3518
+ store.destroy();
3519
+ if (this.store === store) this.store = void 0;
3520
+ })
3521
+ );
3522
+ });
3523
+ }
3524
+ dispatch(action2) {
3525
+ this.store?.dispatch(action2);
3526
+ }
3527
+ OnUpdate() {
3528
+ if (this.shown) this.dispatch(shown(true));
3529
+ }
3530
+ resolveClient() {
3531
+ if (this.client) return this.client;
3532
+ const url = this.url || void 0;
3533
+ if (this.getToken) {
3534
+ const source = this.getToken;
3535
+ this.client = new import_agents.AgentClient({ url, getToken: () => source() });
3536
+ } else if (this.tokenUrl) {
3537
+ const tokenUrl = this.tokenUrl;
3538
+ this.client = new import_agents.AgentClient({
3539
+ url,
3540
+ getToken: () => fetch(tokenUrl, {
3541
+ credentials: "include",
3542
+ headers: { accept: "application/json" }
3543
+ }).then((r7) => {
3544
+ if (!r7.ok) throw new Error(`token-url answered ${r7.status}`);
3545
+ return r7.json();
3546
+ })
3547
+ });
3548
+ } else if (this.publishableKey) {
3549
+ this.client = new import_agents.AgentClient({
3550
+ url,
3551
+ anonymous: {
3552
+ publishableKey: this.publishableKey,
3553
+ turnstileToken: () => this.verifyHuman()
3554
+ }
3555
+ });
3556
+ } else {
3557
+ console.error(`[${TAG}] give it a session: token-url, publishable-key, .getToken or .client`);
3558
+ return null;
3559
+ }
3560
+ return this.client;
3561
+ }
3562
+ verifyHuman() {
3563
+ this.dispatch(verifying(true));
3564
+ return this.turnstileBox().then(
3565
+ (host) => turnstileToken({
3566
+ host,
3567
+ sitekey: this.turnstileSitekey || null,
3568
+ hostedUrl: this.turnstileUrl || null
3569
+ })
3570
+ ).finally(() => this.dispatch(verifying(false)));
3571
+ }
3572
+ /** The (rendered) box the challenge goes into. */
3573
+ async turnstileBox() {
3574
+ for (let i12 = 0; i12 < 100; i12++) {
3575
+ const box = this.shadowRoot?.querySelector(".turnstile");
3576
+ if (box) return box;
3577
+ await new Promise((r7) => setTimeout(r7, 20));
3578
+ }
3579
+ throw new Error("turnstile: the chat is not rendered");
3580
+ }
3581
+ // ------------------------------------------------------------ actions
3582
+ /** Send a message to the selected agent. */
3583
+ send(text) {
3584
+ return ([state]) => {
3585
+ const clean = String(text ?? "").trim();
3586
+ if (!clean || state.answering || !state.agentId) return;
3587
+ this.dispatch(
3588
+ sendMessage({ agentId: state.agentId, conversationId: state.conversationId, text: clean })
3589
+ );
3590
+ };
3591
+ }
3592
+ /** Stop the answer in progress. */
3593
+ stopAnswer() {
3594
+ return ([state]) => {
3595
+ if (!state.agentId) return;
3596
+ this.dispatch(stop({ agentId: state.agentId, conversationId: state.conversationId }));
3597
+ };
3598
+ }
3599
+ pick(agentId) {
3600
+ this.dispatch(pickAgent(agentId));
3601
+ }
3602
+ startOver() {
3603
+ this.dispatch(newConversation());
3604
+ this.focusInput();
3605
+ }
3606
+ setOpen(open) {
3607
+ if (open === this.open) return;
3608
+ this.open = open;
3609
+ this.emit("open-change", { open });
3610
+ if (open) this.focusInput();
3611
+ else this.shadowRoot?.querySelector(".launcher")?.focus();
3612
+ }
3613
+ focusInput() {
3614
+ this.updateComplete.then(
3615
+ () => requestAnimationFrame(
3616
+ () => this.shadowRoot?.querySelector("textarea")?.focus()
3617
+ )
3618
+ );
3619
+ }
3620
+ submit(ev, state) {
3621
+ ev.preventDefault();
3622
+ if (state.answering) return this.stopAnswer()([state]);
3623
+ const input = this.shadowRoot?.querySelector("textarea");
3624
+ if (!input) return;
3625
+ this.send(input.value)([state]);
3626
+ input.value = "";
3627
+ this.autosize(input);
3628
+ }
3629
+ onInputKey(ev, state) {
3630
+ if (ev.key === "Enter" && !ev.shiftKey && !ev.isComposing) {
3631
+ ev.preventDefault();
3632
+ if (!state.answering) this.submit(ev, state);
3633
+ }
3634
+ }
3635
+ autosize(input) {
3636
+ input.style.height = "auto";
3637
+ input.style.height = `${Math.min(input.scrollHeight, 140)}px`;
3638
+ }
3639
+ /** Escape closes the drawer; Tab stays inside the open dialog. */
3640
+ onPanelKey(ev) {
3641
+ if (ev.key === "Escape" && this.mode === "drawer") {
3642
+ ev.stopPropagation();
3643
+ this.setOpen(false);
3644
+ return;
3645
+ }
3646
+ if (ev.key !== "Tab" || this.mode === "inline") return;
3647
+ const panel = this.shadowRoot?.querySelector(".panel");
3648
+ const focusable = Array.from(
3649
+ panel?.querySelectorAll("button:not([disabled]), select, textarea, a[href]") ?? []
3650
+ ).filter((el) => !el.closest("[hidden]"));
3651
+ if (!focusable.length) return;
3652
+ const first = focusable[0];
3653
+ const last = focusable[focusable.length - 1];
3654
+ const active = this.shadowRoot?.activeElement;
3655
+ if (ev.shiftKey && active === first) {
3656
+ ev.preventDefault();
3657
+ last.focus();
3658
+ } else if (!ev.shiftKey && active === last) {
3659
+ ev.preventDefault();
3660
+ first.focus();
3661
+ }
3662
+ }
3663
+ emit(type, detail) {
3664
+ this.dispatchEvent(new CustomEvent(type, { detail, bubbles: true, composed: true }));
3665
+ }
3666
+ // --------------------------------------------------------------- view
3667
+ noticeText(notice) {
3668
+ if (!notice) return "";
3669
+ const t9 = this.t;
3670
+ if (notice.kind === "busy") return t9[notice.what];
3671
+ if (notice.kind === "info") return t9.errors.aborted;
3672
+ return t9.errors[notice.code] ?? t9.errors.default;
3673
+ }
3674
+ view(state) {
3675
+ const t9 = this.t;
3676
+ const drawer = this.mode === "drawer";
3677
+ const agent = state.agents.find((a5) => a5.id === state.agentId) ?? null;
3678
+ const title = this.heading || agent?.name || t9.title;
3679
+ const notice = state.notice;
3680
+ if (state.messages.length !== this.lastCount) {
3681
+ this.lastCount = state.messages.length;
3682
+ this.updateComplete.then(() => requestAnimationFrame(() => this.scrollDown()));
3683
+ }
3684
+ return import_lit_html19.html`
3685
+ <button
3686
+ class="launcher"
3687
+ part="launcher"
3688
+ type="button"
3689
+ aria-haspopup="dialog"
3690
+ aria-expanded=${String(this.open)}
3691
+ aria-label=${t9.open}
3692
+ ?hidden=${!drawer}
3693
+ @click=${() => this.setOpen(!this.open)}
3694
+ >
3695
+ <slot name="launcher">${icon(ICON_CHAT)}</slot>
3696
+ </button>
3697
+ <section
3698
+ class="panel"
3699
+ part="panel"
3700
+ role="dialog"
3701
+ aria-label=${title}
3702
+ aria-modal=${String(drawer)}
3703
+ ?hidden=${!this.shown}
3704
+ @keydown=${(ev) => this.onPanelKey(ev)}
3705
+ >
3706
+ <header part="header">
3707
+ <span class="title">${title}</span>
3708
+ <select
3709
+ class="picker"
3710
+ part="picker"
3711
+ aria-label=${t9.pickAgent}
3712
+ ?hidden=${state.agents.length < 2}
3713
+ @change=${(ev) => this.pick(ev.target.value)}
3714
+ >
3715
+ ${state.agents.map(
3716
+ (a5) => import_lit_html19.html`<option value=${a5.id} ?selected=${a5.id === state.agentId}>${a5.name}</option>`
3717
+ )}
3718
+ </select>
3719
+ <button class="icon new" part="new" type="button" title=${t9.newChat} aria-label=${t9.newChat} @click=${() => this.startOver()}>
3720
+ ${icon(ICON_NEW)}
3721
+ </button>
3722
+ <button class="icon close" part="close" type="button" title=${t9.close} aria-label=${t9.close} @click=${() => this.setOpen(false)}>
3723
+ ${icon(ICON_CLOSE)}
3724
+ </button>
3725
+ </header>
3726
+ <div class="messages" part="messages" role="log" aria-live="polite" aria-relevant="additions">
3727
+ ${state.messages.length ? state.messages.map((m4) => this.bubble(m4)) : this.intro(state)}
3728
+ </div>
3729
+ <div class="turnstile" ?hidden=${notice?.kind !== "busy" || notice.what !== "verifying"}></div>
3730
+ <div
3731
+ class="status ${notice?.kind === "error" ? "error" : ""} ${notice?.kind === "busy" ? "dots" : ""}"
3732
+ part="status"
3733
+ role="status"
3734
+ >${this.noticeText(notice)}</div>
3735
+ <form part="composer" @submit=${(ev) => this.submit(ev, state)}>
3736
+ <label class="sr-only" for="lf-input">${t9.placeholder}</label>
3737
+ <textarea
3738
+ id="lf-input"
3739
+ part="input"
3740
+ rows="1"
3741
+ placeholder=${t9.placeholder}
3742
+ @keydown=${(ev) => this.onInputKey(ev, state)}
3743
+ @input=${(ev) => this.autosize(ev.target)}
3744
+ ></textarea>
3745
+ <button class="send" part="send" type="submit" aria-label=${state.answering ? t9.stop : t9.send}>
3746
+ ${state.answering ? t9.stop : t9.send}
3747
+ </button>
3748
+ </form>
3749
+ </section>
3750
+ `;
3751
+ }
3752
+ bubble(m4) {
3753
+ if (m4.role === "user") {
3754
+ return import_lit_html19.html`<div class="msg user" part="message user">${m4.text}</div>`;
3755
+ }
3756
+ return import_lit_html19.html`<div class="msg assistant" part="message assistant">
3757
+ ${renderMarkdown(m4.text)}
3758
+ ${m4.tools.length ? import_lit_html19.html`<div class="tools">${this.t.usedTools}: ${m4.tools.join(", ")}</div>` : ""}
3759
+ </div>`;
3760
+ }
3761
+ intro(state) {
3762
+ const agent = state.agents.find((a5) => a5.id === state.agentId);
3763
+ if (!agent?.welcome && !agent?.suggestions?.length) return "";
3764
+ return import_lit_html19.html`
3765
+ ${agent.welcome ? import_lit_html19.html`<div class="msg assistant welcome">${renderMarkdown(agent.welcome)}</div>` : ""}
3766
+ ${agent.suggestions?.length ? import_lit_html19.html`<div class="suggestions">
3767
+ ${agent.suggestions.map(
3768
+ (s9) => import_lit_html19.html`<button type="button" part="suggestion" @click=${() => this.send(s9)([state])}>${s9}</button>`
3769
+ )}
3770
+ </div>` : ""}
3771
+ `;
3772
+ }
3773
+ scrollDown() {
3774
+ const m4 = this.shadowRoot?.querySelector(".messages");
3775
+ if (m4) m4.scrollTop = m4.scrollHeight;
3776
+ }
3777
+ };
3778
+ __decorateClass([
3779
+ (0, import_lit_html19.property)({ type: Boolean, reflect: true })
3780
+ ], LambforgeAgentChat.prototype, "open", 2);
3781
+ __decorateClass([
3782
+ (0, import_lit_html19.property)({ reflect: true })
3783
+ ], LambforgeAgentChat.prototype, "mode", 2);
3784
+ __decorateClass([
3785
+ (0, import_lit_html19.property)({ reflect: true })
3786
+ ], LambforgeAgentChat.prototype, "position", 2);
3787
+ __decorateClass([
3788
+ (0, import_lit_html19.property)({ reflect: true })
3789
+ ], LambforgeAgentChat.prototype, "theme", 2);
3790
+ __decorateClass([
3791
+ (0, import_lit_html19.property)()
3792
+ ], LambforgeAgentChat.prototype, "agent", 2);
3793
+ __decorateClass([
3794
+ (0, import_lit_html19.property)()
3795
+ ], LambforgeAgentChat.prototype, "agents", 2);
3796
+ __decorateClass([
3797
+ (0, import_lit_html19.property)()
3798
+ ], LambforgeAgentChat.prototype, "locale", 2);
3799
+ __decorateClass([
3800
+ (0, import_lit_html19.property)({ attribute: "title" })
3801
+ ], LambforgeAgentChat.prototype, "heading", 2);
3802
+ __decorateClass([
3803
+ (0, import_lit_html19.property)()
3804
+ ], LambforgeAgentChat.prototype, "url", 2);
3805
+ __decorateClass([
3806
+ (0, import_lit_html19.property)({ attribute: "publishable-key" })
3807
+ ], LambforgeAgentChat.prototype, "publishableKey", 2);
3808
+ __decorateClass([
3809
+ (0, import_lit_html19.property)({ attribute: "token-url" })
3810
+ ], LambforgeAgentChat.prototype, "tokenUrl", 2);
3811
+ __decorateClass([
3812
+ (0, import_lit_html19.property)({ attribute: "turnstile-sitekey" })
3813
+ ], LambforgeAgentChat.prototype, "turnstileSitekey", 2);
3814
+ __decorateClass([
3815
+ (0, import_lit_html19.property)({ attribute: "turnstile-url" })
3816
+ ], LambforgeAgentChat.prototype, "turnstileUrl", 2);
3817
+ __decorateClass([
3818
+ (0, import_lit_html19.property)({ attribute: false })
3819
+ ], LambforgeAgentChat.prototype, "client", 2);
3820
+ __decorateClass([
3821
+ (0, import_lit_html19.property)({ attribute: false })
3822
+ ], LambforgeAgentChat.prototype, "getToken", 2);
3823
+ __decorateClass([
3824
+ (0, import_lit_html19.property)({ attribute: false })
3825
+ ], LambforgeAgentChat.prototype, "strings", 2);
3826
+ LambforgeAgentChat = __decorateClass([
3827
+ (0, import_component.Component)({
3828
+ Settings: { selector: TAG, styles: [(0, import_lit_html19.unsafeCSS)(STYLES)] },
3829
+ Loading: () => import_lit_html19.html``,
3830
+ Error: () => import_lit_html19.html``,
3831
+ State() {
3832
+ return this.connect();
3833
+ },
3834
+ Render: () => function(state) {
3835
+ return this.view(state);
3836
+ }
3837
+ })
3838
+ ], LambforgeAgentChat);
3839
+ /*! Bundled license information:
3840
+
3841
+ lit-html/lit-html.js:
3842
+ lit-html/directive.js:
3843
+ lit-html/async-directive.js:
3844
+ lit-element/experimental-hydrate-support.js:
3845
+ @lit/reactive-element/reactive-element.js:
3846
+ lit-element/lit-element.js:
3847
+ @lit/reactive-element/decorators/base.js:
3848
+ @lit/reactive-element/decorators/custom-element.js:
3849
+ @lit/reactive-element/decorators/property.js:
3850
+ @lit/reactive-element/decorators/state.js:
3851
+ @lit/reactive-element/decorators/event-options.js:
3852
+ @lit/reactive-element/decorators/query.js:
3853
+ @lit/reactive-element/decorators/query-all.js:
3854
+ @lit/reactive-element/decorators/query-async.js:
3855
+ @lit/reactive-element/decorators/query-assigned-nodes.js:
3856
+ lit-element/index.js:
3857
+ lit-html/directives/async-replace.js:
3858
+ lit-html/directives/async-append.js:
3859
+ lit-html/directives/cache.js:
3860
+ lit-html/directives/repeat.js:
3861
+ lit-html/directives/unsafe-html.js:
3862
+ lit-html/directives/unsafe-svg.js:
3863
+ lit-html/directives/until.js:
3864
+ (**
3865
+ * @license
3866
+ * Copyright 2017 Google LLC
3867
+ * SPDX-License-Identifier: BSD-3-Clause
3868
+ *)
3869
+
3870
+ lit-html/directive-helpers.js:
3871
+ lit-html/directives/live.js:
3872
+ lit-html/directives/ref.js:
3873
+ lit-html/directives/template-content.js:
3874
+ (**
3875
+ * @license
3876
+ * Copyright 2020 Google LLC
3877
+ * SPDX-License-Identifier: BSD-3-Clause
3878
+ *)
3879
+
3880
+ lit-html/experimental-hydrate.js:
3881
+ @lit/reactive-element/css-tag.js:
3882
+ (**
3883
+ * @license
3884
+ * Copyright 2019 Google LLC
3885
+ * SPDX-License-Identifier: BSD-3-Clause
3886
+ *)
3887
+
3888
+ lit-html/polyfill-support.js:
3889
+ (**
3890
+ * @license
3891
+ * Copyright 2017 Google LLC
3892
+ * SPDX-License-Identifier: BSD-3-Clause
3893
+ *)
3894
+
3895
+ @lit/reactive-element/decorators/query-assigned-elements.js:
3896
+ lit-html/directives/private-async-helpers.js:
3897
+ lit-html/directives/choose.js:
3898
+ lit-html/directives/join.js:
3899
+ lit-html/directives/keyed.js:
3900
+ lit-html/directives/map.js:
3901
+ lit-html/directives/range.js:
3902
+ lit-html/directives/when.js:
3903
+ (**
3904
+ * @license
3905
+ * Copyright 2021 Google LLC
3906
+ * SPDX-License-Identifier: BSD-3-Clause
3907
+ *)
3908
+
3909
+ lit-html/directives/class-map.js:
3910
+ lit-html/directives/guard.js:
3911
+ lit-html/directives/if-defined.js:
3912
+ lit-html/directives/style-map.js:
3913
+ (**
3914
+ * @license
3915
+ * Copyright 2018 Google LLC
3916
+ * SPDX-License-Identifier: BSD-3-Clause
3917
+ *)
3918
+ */
3919
+ //# sourceMappingURL=index.cjs.map