@telia-ace/widget-conversation-flamingo 1.1.12 → 1.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/conversation-1bf28a6e.js +572 -0
  2. package/conversation-7da6b954.mjs +2619 -0
  3. package/conversation-component.d.ts +2 -0
  4. package/conversation-platform.d.ts +10 -49
  5. package/conversation-session.d.ts +11 -0
  6. package/conversation.d.ts +23 -0
  7. package/entry.d.ts +9 -0
  8. package/group.d.ts +7 -0
  9. package/{index-1ea0fde8.mjs → index-217978bc.mjs} +320 -319
  10. package/index-43151bb4.js +1 -0
  11. package/index-494250de.js +3 -0
  12. package/index-4ba82b09.mjs +777 -0
  13. package/index.d.ts +6 -10
  14. package/index.js +1 -1
  15. package/index.mjs +7 -9
  16. package/{components/conversation/ui/message-types → message-types}/message-type-html.d.ts +3 -2
  17. package/models/agent.d.ts +8 -0
  18. package/models/conversation-entry.d.ts +11 -0
  19. package/models/conversation-provider.d.ts +19 -0
  20. package/models/conversation-session-state.d.ts +13 -0
  21. package/models/user.d.ts +8 -0
  22. package/package.json +5 -6
  23. package/types.d.ts +9 -123
  24. package/agent.d.ts +0 -20
  25. package/components/conversation/conversation.d.ts +0 -19
  26. package/components/conversation/plugin.d.ts +0 -45
  27. package/components/conversation/ui/message-list.d.ts +0 -9
  28. package/components/conversation/ui/message-types/message-type-link-list.d.ts +0 -8
  29. package/components/conversation/ui/message-types/message-type-separator.d.ts +0 -7
  30. package/components/conversation/ui/message.d.ts +0 -8
  31. package/components/conversation/utils.d.ts +0 -1
  32. package/conversation-5265abc7.js +0 -446
  33. package/conversation-8c2255c2.mjs +0 -1865
  34. package/conversation-controller.d.ts +0 -118
  35. package/conversation-history.d.ts +0 -26
  36. package/conversation-provider.d.ts +0 -32
  37. package/index-5cf6726d.js +0 -156
  38. package/index-836222bd.mjs +0 -3923
  39. package/index-c51d4b6a.js +0 -1
  40. package/send-18482cae.mjs +0 -4
  41. package/send-eb8b9428.js +0 -1
  42. package/store.d.ts +0 -31
  43. package/user.d.ts +0 -9
  44. package/utils/custom-message.d.ts +0 -2
  45. package/utils/index.d.ts +0 -1
  46. package/utils/open-chat-widget.d.ts +0 -4
  47. package/utils/swap-provider.d.ts +0 -8
@@ -1,1865 +0,0 @@
1
- import { p as Dt, P as ue, h as pe, i as w, n as x, r as k, E as pt, a as Nt, t as at, e as lt, T as f, s as A, x as p, C as V, b as Ht, w as fe } from "./index-836222bd.mjs";
2
- import { s as $e } from "./send-18482cae.mjs";
3
- /**
4
- * @license
5
- * Copyright 2017 Google LLC
6
- * SPDX-License-Identifier: BSD-3-Clause
7
- */
8
- const L = (e) => (t, s) => {
9
- s !== void 0 ? s.addInitializer(() => {
10
- customElements.define(e, t);
11
- }) : customElements.define(e, t);
12
- };
13
- /**
14
- * @license
15
- * Copyright 2021 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- */
18
- let zt = class extends Event {
19
- constructor(t, s, i) {
20
- super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = s, this.subscribe = i ?? !1;
21
- }
22
- };
23
- /**
24
- * @license
25
- * Copyright 2021 Google LLC
26
- * SPDX-License-Identifier: BSD-3-Clause
27
- */
28
- /**
29
- * @license
30
- * Copyright 2021 Google LLC
31
- * SPDX-License-Identifier: BSD-3-Clause
32
- */
33
- let ft = class {
34
- constructor(t, s, i, n) {
35
- if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, r) => {
36
- this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, r)), this.unsubscribe = r;
37
- }, this.host = t, s.context !== void 0) {
38
- const o = s;
39
- this.context = o.context, this.callback = o.callback, this.subscribe = o.subscribe ?? !1;
40
- } else
41
- this.context = s, this.callback = i, this.subscribe = n ?? !1;
42
- this.host.addController(this);
43
- }
44
- hostConnected() {
45
- this.dispatchRequest();
46
- }
47
- hostDisconnected() {
48
- this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
49
- }
50
- dispatchRequest() {
51
- this.host.dispatchEvent(new zt(this.context, this.t, this.subscribe));
52
- }
53
- };
54
- /**
55
- * @license
56
- * Copyright 2021 Google LLC
57
- * SPDX-License-Identifier: BSD-3-Clause
58
- */
59
- let ge = class {
60
- get value() {
61
- return this.o;
62
- }
63
- set value(t) {
64
- this.setValue(t);
65
- }
66
- setValue(t, s = !1) {
67
- const i = s || !Object.is(t, this.o);
68
- this.o = t, i && this.updateObservers();
69
- }
70
- constructor(t) {
71
- this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
72
- for (const [s, { disposer: i }] of this.subscriptions)
73
- s(this.o, i);
74
- }, t !== void 0 && (this.value = t);
75
- }
76
- addCallback(t, s, i) {
77
- if (!i)
78
- return void t(this.value);
79
- this.subscriptions.has(t) || this.subscriptions.set(t, { disposer: () => {
80
- this.subscriptions.delete(t);
81
- }, consumerHost: s });
82
- const { disposer: n } = this.subscriptions.get(t);
83
- t(this.value, n);
84
- }
85
- clearCallbacks() {
86
- this.subscriptions.clear();
87
- }
88
- };
89
- /**
90
- * @license
91
- * Copyright 2021 Google LLC
92
- * SPDX-License-Identifier: BSD-3-Clause
93
- */
94
- let me = class extends Event {
95
- constructor(t) {
96
- super("context-provider", { bubbles: !0, composed: !0 }), this.context = t;
97
- }
98
- }, j = class extends ge {
99
- constructor(t, s, i) {
100
- super(s.context !== void 0 ? s.initialValue : i), this.onContextRequest = (n) => {
101
- const o = n.composedPath()[0];
102
- n.context === this.context && o !== this.host && (n.stopPropagation(), this.addCallback(n.callback, o, n.subscribe));
103
- }, this.onProviderRequest = (n) => {
104
- const o = n.composedPath()[0];
105
- if (n.context !== this.context || o === this.host)
106
- return;
107
- const r = /* @__PURE__ */ new Set();
108
- for (const [a, { consumerHost: l }] of this.subscriptions)
109
- r.has(a) || (r.add(a), l.dispatchEvent(new zt(this.context, a, !0)));
110
- n.stopPropagation();
111
- }, this.host = t, s.context !== void 0 ? this.context = s.context : this.context = s, this.attachListeners(), this.host.addController(this);
112
- }
113
- attachListeners() {
114
- this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
115
- }
116
- hostConnected() {
117
- this.host.dispatchEvent(new me(this.context));
118
- }
119
- };
120
- /**
121
- * @license
122
- * Copyright 2022 Google LLC
123
- * SPDX-License-Identifier: BSD-3-Clause
124
- */
125
- function ve({ context: e, subscribe: t }) {
126
- return (s, i) => {
127
- typeof i == "object" ? i.addInitializer(function() {
128
- new ft(this, { context: e, callback: (n) => {
129
- this[i.name] = n;
130
- }, subscribe: t });
131
- }) : s.constructor.addInitializer((n) => {
132
- new ft(n, { context: e, callback: (o) => {
133
- n[i] = o;
134
- }, subscribe: t });
135
- });
136
- };
137
- }
138
- const be = "children", ye = "descriptor", xe = "container", _e = "context", we = "layout", ke = "properties";
139
- class Ce {
140
- constructor(t) {
141
- (this.host = t).addController(this);
142
- }
143
- hostConnected() {
144
- }
145
- hostDisconnected() {
146
- }
147
- setDescriptor(t) {
148
- this._descriptor = t;
149
- }
150
- setContainer(t) {
151
- this._container = t;
152
- }
153
- async dispatch(t, s) {
154
- if (!this._container || !this._descriptor)
155
- return;
156
- const i = await Dt.getInstance(
157
- this._container
158
- ), n = new ue(i).withId(
159
- this._descriptor.id
160
- );
161
- await i.actions(
162
- n,
163
- this._descriptor.type || pe()
164
- ).dispatch(t, s);
165
- }
166
- }
167
- const Se = (e) => {
168
- const t = {};
169
- return Object.keys(e).forEach((s) => {
170
- s.indexOf("css-") > -1 && (t[s] = e[s]);
171
- }), t;
172
- }, Te = (e, t) => {
173
- const s = Se(t);
174
- Object.entries(s).forEach(([i, n]) => {
175
- e.style.setProperty(i.replace("css-", ""), n);
176
- });
177
- };
178
- var Oe = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, y = (e, t, s, i) => {
179
- for (var n = i > 1 ? void 0 : i ? Pe(t, s) : t, o = e.length - 1, r; o >= 0; o--)
180
- (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
181
- return i && n && Oe(t, s, n), n;
182
- };
183
- const Ae = (e) => {
184
- class t extends e {
185
- constructor() {
186
- super(...arguments), this.entry = "", this._descriptorProvider = new j(
187
- this,
188
- ye,
189
- void 0
190
- ), this._childrenProvider = new j(this, be, []), this._propertiesProvider = new j(this, ke, {}), this._contextProvider = new j(this, _e, {}), this._layoutProvider = new j(this, we, {}), this.actions = new Ce(this), this.context = {}, this.layout = {}, this.properties = {};
191
- }
192
- connectedCallback() {
193
- super.connectedCallback(), this.container && (this.actions.setContainer(this.container), Dt.getInstance(this.container).then(
194
- async (i) => {
195
- var o, r;
196
- const n = i.nodes.get(this.entry);
197
- if (n) {
198
- this._propertyChangeListener = i.events.subscribe(
199
- "components:properties-changed",
200
- (h, u) => {
201
- n.id === u.node.id && this._setProperties(u.node.attributes.properties);
202
- }
203
- ), this._contextChangeListener = i.events.subscribe(
204
- "components:context-changed",
205
- (h, u) => {
206
- n.id === u.node.id && this._setContext(u.node.attributes.context);
207
- }
208
- ), this._layoutChangeListener = i.events.subscribe(
209
- "components:layout-changed",
210
- (h, u) => {
211
- n.id === u.node.id && this._setLayout(u.node.attributes.layout);
212
- }
213
- );
214
- const a = "default";
215
- this._unmountNode = n.mount(this.container), this._setDescriptor(pt(n, a)), this._setProperties(n.attributes.properties), this._setContext(n.attributes.context), this._setLayout(this.layout);
216
- const l = n.getChildren(a).map((h) => pt(h));
217
- this._childrenProvider.setValue(l);
218
- const c = await this.container.getAsync("componentResolver");
219
- if (((o = this.descriptor) == null ? void 0 : o.type) === "area")
220
- return;
221
- const d = c.getComponent(
222
- ((r = this.descriptor) == null ? void 0 : r.type) || ""
223
- );
224
- d.then && d.then((h) => {
225
- this.component = h.default;
226
- });
227
- }
228
- }
229
- ));
230
- }
231
- disconnectedCallback() {
232
- super.disconnectedCallback(), this._propertyChangeListener && this._propertyChangeListener(), this._contextChangeListener && this._contextChangeListener(), this._layoutChangeListener && this._layoutChangeListener(), this._unmountNode && this._unmountNode();
233
- }
234
- updated() {
235
- this.container && this.actions.setContainer(this.container), this.renderRoot.host.style.setProperty(
236
- "--width",
237
- this.layout.size === "full" ? "var(--columns, 1)" : `min(${this.layout.size || "var(--columns)"}, var(--columns))`
238
- ), Te(this.renderRoot.host, this.properties);
239
- }
240
- _setProperties(i) {
241
- this._propertiesProvider.setValue(i), this.properties = i;
242
- }
243
- _setContext(i) {
244
- this._contextProvider.setValue(i), this.context = i;
245
- }
246
- _setLayout(i) {
247
- this._layoutProvider.setValue(i), this.layout = i;
248
- }
249
- _setDescriptor(i) {
250
- this.descriptor = i, this._descriptorProvider.setValue(i), this.actions.setDescriptor(i);
251
- }
252
- }
253
- return t.styles = [
254
- e.styles ?? [],
255
- w`
256
- :host {
257
- font-family: var(--font-family);
258
- grid-column: span var(--width);
259
- max-width: 100%;
260
- overflow: hidden;
261
- box-sizing: border-box;
262
- display: block;
263
- }
264
- * {
265
- box-sizing: border-box;
266
- }
267
- `
268
- ], y([
269
- ve({ context: xe }),
270
- x({ attribute: !1 })
271
- ], t.prototype, "container", 2), y([
272
- x()
273
- ], t.prototype, "entry", 2), y([
274
- k()
275
- ], t.prototype, "descriptor", 2), y([
276
- k()
277
- ], t.prototype, "component", 2), y([
278
- k()
279
- ], t.prototype, "context", 2), y([
280
- k()
281
- ], t.prototype, "layout", 2), y([
282
- k()
283
- ], t.prototype, "properties", 2), t;
284
- };
285
- /**
286
- * @license
287
- * Copyright 2020 Google LLC
288
- * SPDX-License-Identifier: BSD-3-Clause
289
- */
290
- const Le = (e) => e.strings === void 0;
291
- /**
292
- * @license
293
- * Copyright 2017 Google LLC
294
- * SPDX-License-Identifier: BSD-3-Clause
295
- */
296
- const I = (e, t) => {
297
- var i;
298
- const s = e._$AN;
299
- if (s === void 0)
300
- return !1;
301
- for (const n of s)
302
- (i = n._$AO) == null || i.call(n, t, !1), I(n, t);
303
- return !0;
304
- }, M = (e) => {
305
- let t, s;
306
- do {
307
- if ((t = e._$AM) === void 0)
308
- break;
309
- s = t._$AN, s.delete(e), e = t;
310
- } while ((s == null ? void 0 : s.size) === 0);
311
- }, Mt = (e) => {
312
- for (let t; t = e._$AM; e = t) {
313
- let s = t._$AN;
314
- if (s === void 0)
315
- t._$AN = s = /* @__PURE__ */ new Set();
316
- else if (s.has(e))
317
- break;
318
- s.add(e), Ie(t);
319
- }
320
- };
321
- function Ee(e) {
322
- this._$AN !== void 0 ? (M(this), this._$AM = e, Mt(this)) : this._$AM = e;
323
- }
324
- function je(e, t = !1, s = 0) {
325
- const i = this._$AH, n = this._$AN;
326
- if (n !== void 0 && n.size !== 0)
327
- if (t)
328
- if (Array.isArray(i))
329
- for (let o = s; o < i.length; o++)
330
- I(i[o], !1), M(i[o]);
331
- else
332
- i != null && (I(i, !1), M(i));
333
- else
334
- I(this, e);
335
- }
336
- const Ie = (e) => {
337
- e.type == at.CHILD && (e._$AP ?? (e._$AP = je), e._$AQ ?? (e._$AQ = Ee));
338
- };
339
- let Ft = class extends Nt {
340
- constructor() {
341
- super(...arguments), this._$AN = void 0;
342
- }
343
- _$AT(t, s, i) {
344
- super._$AT(t, s, i), Mt(this), this.isConnected = t._$AU;
345
- }
346
- _$AO(t, s = !0) {
347
- var i, n;
348
- t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), s && (I(this, t), M(this));
349
- }
350
- setValue(t) {
351
- if (Le(this._$Ct))
352
- this._$Ct._$AI(t, this);
353
- else {
354
- const s = [...this._$Ct._$AH];
355
- s[this._$Ci] = t, this._$Ct._$AI(s, this, 0);
356
- }
357
- }
358
- disconnected() {
359
- }
360
- reconnected() {
361
- }
362
- };
363
- /**
364
- * @license
365
- * Copyright 2020 Google LLC
366
- * SPDX-License-Identifier: BSD-3-Clause
367
- */
368
- const Re = () => new De();
369
- let De = class {
370
- };
371
- const tt = /* @__PURE__ */ new WeakMap(), Ne = lt(class extends Ft {
372
- render(e) {
373
- return f;
374
- }
375
- update(e, [t]) {
376
- var i;
377
- const s = t !== this.G;
378
- return s && this.G !== void 0 && this.ot(void 0), (s || this.rt !== this.lt) && (this.G = t, this.ct = (i = e.options) == null ? void 0 : i.host, this.ot(this.lt = e.element)), f;
379
- }
380
- ot(e) {
381
- if (typeof this.G == "function") {
382
- const t = this.ct ?? globalThis;
383
- let s = tt.get(t);
384
- s === void 0 && (s = /* @__PURE__ */ new WeakMap(), tt.set(t, s)), s.get(this.G) !== void 0 && this.G.call(this.ct, void 0), s.set(this.G, e), e !== void 0 && this.G.call(this.ct, e);
385
- } else
386
- this.G.value = e;
387
- }
388
- get rt() {
389
- var e, t;
390
- return typeof this.G == "function" ? (e = tt.get(this.ct ?? globalThis)) == null ? void 0 : e.get(this.G) : (t = this.G) == null ? void 0 : t.value;
391
- }
392
- disconnected() {
393
- this.rt === this.lt && this.ot(void 0);
394
- }
395
- reconnected() {
396
- this.ot(this.lt);
397
- }
398
- }), He = /* @__PURE__ */ new WeakMap();
399
- let $t = 0;
400
- const et = /* @__PURE__ */ new Map(), gt = /* @__PURE__ */ new WeakSet(), mt = () => new Promise((e) => requestAnimationFrame(e)), vt = [{ opacity: 0 }], bt = [{ opacity: 0 }, { opacity: 1 }], yt = (e, t) => {
401
- const s = e - t;
402
- return s === 0 ? void 0 : s;
403
- }, xt = (e, t) => {
404
- const s = e / t;
405
- return s === 1 ? void 0 : s;
406
- }, st = { left: (e, t) => {
407
- const s = yt(e, t);
408
- return { value: s, transform: s == null || isNaN(s) ? void 0 : `translateX(${s}px)` };
409
- }, top: (e, t) => {
410
- const s = yt(e, t);
411
- return { value: s, transform: s == null || isNaN(s) ? void 0 : `translateY(${s}px)` };
412
- }, width: (e, t) => {
413
- let s;
414
- t === 0 && (t = 1, s = { width: "1px" });
415
- const i = xt(e, t);
416
- return { value: i, overrideFrom: s, transform: i == null || isNaN(i) ? void 0 : `scaleX(${i})` };
417
- }, height: (e, t) => {
418
- let s;
419
- t === 0 && (t = 1, s = { height: "1px" });
420
- const i = xt(e, t);
421
- return { value: i, overrideFrom: s, transform: i == null || isNaN(i) ? void 0 : `scaleY(${i})` };
422
- } }, ze = { duration: 333, easing: "ease-in-out" }, Me = ["left", "top", "width", "height", "opacity", "color", "background"], _t = /* @__PURE__ */ new WeakMap();
423
- class Fe extends Ft {
424
- constructor(t) {
425
- if (super(t), this.t = null, this.i = null, this.o = !0, this.shouldLog = !1, t.type === at.CHILD)
426
- throw Error("The `animate` directive must be used in attribute position.");
427
- this.createFinished();
428
- }
429
- createFinished() {
430
- var t;
431
- (t = this.resolveFinished) == null || t.call(this), this.finished = new Promise((s) => {
432
- this.h = s;
433
- });
434
- }
435
- async resolveFinished() {
436
- var t;
437
- (t = this.h) == null || t.call(this), this.h = void 0;
438
- }
439
- render(t) {
440
- return f;
441
- }
442
- getController() {
443
- return He.get(this.l);
444
- }
445
- isDisabled() {
446
- var t;
447
- return this.options.disabled || ((t = this.getController()) == null ? void 0 : t.disabled);
448
- }
449
- update(t, [s]) {
450
- var n;
451
- const i = this.l === void 0;
452
- return i && (this.l = (n = t.options) == null ? void 0 : n.host, this.l.addController(this), this.element = t.element, _t.set(this.element, this)), this.optionsOrCallback = s, (i || typeof s != "function") && this.u(s), this.render(s);
453
- }
454
- u(t) {
455
- t = t ?? {};
456
- const s = this.getController();
457
- s !== void 0 && ((t = { ...s.defaultOptions, ...t }).keyframeOptions = { ...s.defaultOptions.keyframeOptions, ...t.keyframeOptions }), t.properties ?? (t.properties = Me), this.options = t;
458
- }
459
- p() {
460
- const t = {}, s = this.element.getBoundingClientRect(), i = getComputedStyle(this.element);
461
- return this.options.properties.forEach((n) => {
462
- const o = s[n] ?? (st[n] ? void 0 : i[n]), r = Number(o);
463
- t[n] = isNaN(r) ? o + "" : r;
464
- }), t;
465
- }
466
- m() {
467
- let t, s = !0;
468
- return this.options.guard && (t = this.options.guard(), s = ((i, n) => {
469
- if (Array.isArray(i)) {
470
- if (Array.isArray(n) && n.length === i.length && i.every((o, r) => o === n[r]))
471
- return !1;
472
- } else if (n === i)
473
- return !1;
474
- return !0;
475
- })(t, this.v)), this.o = this.l.hasUpdated && !this.isDisabled() && !this.isAnimating() && s && this.element.isConnected, this.o && (this.v = Array.isArray(t) ? Array.from(t) : t), this.o;
476
- }
477
- hostUpdate() {
478
- typeof this.optionsOrCallback == "function" && this.u(this.optionsOrCallback()), this.m() && (this.g = this.p(), this.t = this.t ?? this.element.parentNode, this.i = this.element.nextSibling);
479
- }
480
- async hostUpdated() {
481
- if (!this.o || !this.element.isConnected || this.options.skipInitial && !this.isHostRendered)
482
- return;
483
- let t;
484
- this.prepare(), await mt;
485
- const s = this._(), i = this.A(this.options.keyframeOptions, s), n = this.p();
486
- if (this.g !== void 0) {
487
- const { from: o, to: r } = this.O(this.g, n, s);
488
- this.log("measured", [this.g, n, o, r]), t = this.calculateKeyframes(o, r);
489
- } else {
490
- const o = et.get(this.options.inId);
491
- if (o) {
492
- et.delete(this.options.inId);
493
- const { from: r, to: a } = this.O(o, n, s);
494
- t = this.calculateKeyframes(r, a), t = this.options.in ? [{ ...this.options.in[0], ...t[0] }, ...this.options.in.slice(1), t[1]] : t, $t++, t.forEach((l) => l.zIndex = $t);
495
- } else
496
- this.options.in && (t = [...this.options.in, {}]);
497
- }
498
- this.animate(t, i);
499
- }
500
- resetStyles() {
501
- this.j !== void 0 && (this.element.setAttribute("style", this.j ?? ""), this.j = void 0);
502
- }
503
- commitStyles() {
504
- var t, s;
505
- this.j = this.element.getAttribute("style"), (t = this.webAnimation) == null || t.commitStyles(), (s = this.webAnimation) == null || s.cancel();
506
- }
507
- reconnected() {
508
- }
509
- async disconnected() {
510
- var s;
511
- if (!this.o || (this.options.id !== void 0 && et.set(this.options.id, this.g), this.options.out === void 0))
512
- return;
513
- if (this.prepare(), await mt(), (s = this.t) == null ? void 0 : s.isConnected) {
514
- const i = this.i && this.i.parentNode === this.t ? this.i : null;
515
- if (this.t.insertBefore(this.element, i), this.options.stabilizeOut) {
516
- const n = this.p();
517
- this.log("stabilizing out");
518
- const o = this.g.left - n.left, r = this.g.top - n.top;
519
- getComputedStyle(this.element).position !== "static" || o === 0 && r === 0 || (this.element.style.position = "relative"), o !== 0 && (this.element.style.left = o + "px"), r !== 0 && (this.element.style.top = r + "px");
520
- }
521
- }
522
- const t = this.A(this.options.keyframeOptions);
523
- await this.animate(this.options.out, t), this.element.remove();
524
- }
525
- prepare() {
526
- this.createFinished();
527
- }
528
- start() {
529
- var t, s;
530
- (s = (t = this.options).onStart) == null || s.call(t, this);
531
- }
532
- didFinish(t) {
533
- var s, i;
534
- t && ((i = (s = this.options).onComplete) == null || i.call(s, this)), this.g = void 0, this.animatingProperties = void 0, this.frames = void 0, this.resolveFinished();
535
- }
536
- _() {
537
- const t = [];
538
- for (let s = this.element.parentNode; s; s = s == null ? void 0 : s.parentNode) {
539
- const i = _t.get(s);
540
- i && !i.isDisabled() && i && t.push(i);
541
- }
542
- return t;
543
- }
544
- get isHostRendered() {
545
- const t = gt.has(this.l);
546
- return t || this.l.updateComplete.then(() => {
547
- gt.add(this.l);
548
- }), t;
549
- }
550
- A(t, s = this._()) {
551
- const i = { ...ze };
552
- return s.forEach((n) => Object.assign(i, n.options.keyframeOptions)), Object.assign(i, t), i;
553
- }
554
- O(t, s, i) {
555
- t = { ...t }, s = { ...s };
556
- const n = i.map((a) => a.animatingProperties).filter((a) => a !== void 0);
557
- let o = 1, r = 1;
558
- return n !== void 0 && (n.forEach((a) => {
559
- a.width && (o /= a.width), a.height && (r /= a.height);
560
- }), t.left !== void 0 && s.left !== void 0 && (t.left = o * t.left, s.left = o * s.left), t.top !== void 0 && s.top !== void 0 && (t.top = r * t.top, s.top = r * s.top)), { from: t, to: s };
561
- }
562
- calculateKeyframes(t, s, i = !1) {
563
- const n = {}, o = {};
564
- let r = !1;
565
- const a = {};
566
- for (const l in s) {
567
- const c = t[l], d = s[l];
568
- if (l in st) {
569
- const h = st[l];
570
- if (c === void 0 || d === void 0)
571
- continue;
572
- const u = h(c, d);
573
- u.transform !== void 0 && (a[l] = u.value, r = !0, n.transform = `${n.transform ?? ""} ${u.transform}`, u.overrideFrom !== void 0 && Object.assign(n, u.overrideFrom));
574
- } else
575
- c !== d && c !== void 0 && d !== void 0 && (r = !0, n[l] = c, o[l] = d);
576
- }
577
- return n.transformOrigin = o.transformOrigin = i ? "center center" : "top left", this.animatingProperties = a, r ? [n, o] : void 0;
578
- }
579
- async animate(t, s = this.options.keyframeOptions) {
580
- this.start(), this.frames = t;
581
- let i = !1;
582
- if (!this.isAnimating() && !this.isDisabled() && (this.options.onFrames && (this.frames = t = this.options.onFrames(this), this.log("modified frames", t)), t !== void 0)) {
583
- this.log("animate", [t, s]), i = !0, this.webAnimation = this.element.animate(t, s);
584
- const n = this.getController();
585
- n == null || n.add(this);
586
- try {
587
- await this.webAnimation.finished;
588
- } catch {
589
- }
590
- n == null || n.remove(this);
591
- }
592
- return this.didFinish(i), i;
593
- }
594
- isAnimating() {
595
- var t, s;
596
- return ((t = this.webAnimation) == null ? void 0 : t.playState) === "running" || ((s = this.webAnimation) == null ? void 0 : s.pending);
597
- }
598
- log(t, s) {
599
- this.shouldLog && !this.isDisabled() && console.log(t, this.options.id, s);
600
- }
601
- }
602
- const wt = lt(Fe), C = {
603
- allRenderFn: !1,
604
- cmpDidLoad: !0,
605
- cmpDidUnload: !1,
606
- cmpDidUpdate: !0,
607
- cmpDidRender: !0,
608
- cmpWillLoad: !0,
609
- cmpWillUpdate: !0,
610
- cmpWillRender: !0,
611
- connectedCallback: !0,
612
- disconnectedCallback: !0,
613
- element: !0,
614
- event: !0,
615
- hasRenderFn: !0,
616
- lifecycle: !0,
617
- hostListener: !0,
618
- hostListenerTargetWindow: !0,
619
- hostListenerTargetDocument: !0,
620
- hostListenerTargetBody: !0,
621
- hostListenerTargetParent: !1,
622
- hostListenerTarget: !0,
623
- member: !0,
624
- method: !0,
625
- mode: !0,
626
- observeAttribute: !0,
627
- prop: !0,
628
- propMutable: !0,
629
- reflect: !0,
630
- scoped: !0,
631
- shadowDom: !0,
632
- slot: !0,
633
- cssAnnotations: !0,
634
- state: !0,
635
- style: !0,
636
- svg: !0,
637
- updatable: !0,
638
- vdomAttribute: !0,
639
- vdomXlink: !0,
640
- vdomClass: !0,
641
- vdomFunctional: !0,
642
- vdomKey: !0,
643
- vdomListener: !0,
644
- vdomRef: !0,
645
- vdomPropOrAttr: !0,
646
- vdomRender: !0,
647
- vdomStyle: !0,
648
- vdomText: !0,
649
- watchCallback: !0,
650
- taskQueue: !0,
651
- hotModuleReplacement: !1,
652
- isDebug: !1,
653
- isDev: !1,
654
- isTesting: !1,
655
- hydrateServerSide: !1,
656
- hydrateClientSide: !1,
657
- lifecycleDOMEvents: !1,
658
- lazyLoad: !1,
659
- profile: !1,
660
- slotRelocation: !0,
661
- appendChildSlotFix: !1,
662
- cloneNodeFix: !1,
663
- hydratedAttribute: !1,
664
- hydratedClass: !0,
665
- safari10: !1,
666
- scriptDataOpts: !1,
667
- scopedSlotTextContentFix: !1,
668
- shadowDomShim: !1,
669
- slotChildNodesFix: !1,
670
- invisiblePrehydration: !0,
671
- propBoolean: !0,
672
- propNumber: !0,
673
- propString: !0,
674
- cssVarShim: !1,
675
- constructableCSS: !0,
676
- cmpShouldUpdate: !0,
677
- devTools: !1,
678
- dynamicImportShim: !1,
679
- shadowDelegatesFocus: !0,
680
- initializeNextTick: !1,
681
- asyncLoading: !1,
682
- asyncQueue: !1,
683
- transformTagName: !1,
684
- attachStyles: !0
685
- };
686
- let S, Ut, Y, Bt = !1, F = !1, ct = !1, g = !1, kt = null, it = !1;
687
- const J = typeof window < "u" ? window : {}, b = J.document || { head: {} }, Wt = J.HTMLElement || class {
688
- }, $ = {
689
- $flags$: 0,
690
- $resourcesUrl$: "",
691
- jmp: (e) => e(),
692
- raf: (e) => requestAnimationFrame(e),
693
- ael: (e, t, s, i) => e.addEventListener(t, s, i),
694
- rel: (e, t, s, i) => e.removeEventListener(t, s, i),
695
- ce: (e, t) => new CustomEvent(e, t)
696
- }, Ue = /* @__PURE__ */ (() => {
697
- let e = !1;
698
- try {
699
- b.addEventListener("e", null, Object.defineProperty({}, "passive", {
700
- get() {
701
- e = !0;
702
- }
703
- }));
704
- } catch {
705
- }
706
- return e;
707
- })(), Be = (e) => Promise.resolve(e), We = /* @__PURE__ */ (() => {
708
- try {
709
- return new CSSStyleSheet(), typeof new CSSStyleSheet().replace == "function";
710
- } catch {
711
- }
712
- return !1;
713
- })(), qt = (e, t, s, i) => {
714
- s && s.map(([n, o, r]) => {
715
- const a = Ge(e, n), l = qe(t, r), c = Ke(n);
716
- $.ael(a, o, l, c), (t.$rmListeners$ = t.$rmListeners$ || []).push(() => $.rel(a, o, l, c));
717
- });
718
- }, qe = (e, t) => (s) => {
719
- try {
720
- C.lazyLoad || e.$hostElement$[t](s);
721
- } catch (i) {
722
- N(i);
723
- }
724
- }, Ge = (e, t) => t & 4 ? b : t & 8 ? J : t & 16 ? b.body : e, Ke = (e) => Ue ? {
725
- passive: (e & 1) !== 0,
726
- capture: (e & 2) !== 0
727
- } : (e & 2) !== 0, Ct = "http://www.w3.org/1999/xlink", _ = (e, t = "") => () => {
728
- }, St = /* @__PURE__ */ new WeakMap(), Qe = (e, t, s) => {
729
- let i = W.get(e);
730
- We && s ? (i = i || new CSSStyleSheet(), i.replace(t)) : i = t, W.set(e, i);
731
- }, Xe = (e, t, s, i) => {
732
- let n = Gt(t, s), o = W.get(n);
733
- if (e = e.nodeType === 11 ? e : b, o)
734
- if (typeof o == "string") {
735
- e = e.head || e;
736
- let r = St.get(e), a;
737
- r || St.set(e, r = /* @__PURE__ */ new Set()), r.has(n) || (a = b.createElement("style"), a.innerHTML = o, e.insertBefore(a, e.querySelector("link")), r && r.add(n));
738
- } else
739
- e.adoptedStyleSheets.includes(o) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, o]);
740
- return n;
741
- }, Ye = (e) => {
742
- const t = e.$cmpMeta$, s = e.$hostElement$, i = t.$flags$, n = _("attachStyles", t.$tagName$), o = Xe(s.shadowRoot ? s.shadowRoot : s.getRootNode(), t, e.$modeName$);
743
- i & 10 && (s["s-sc"] = o, s.classList.add(o + "-h"), i & 2 && s.classList.add(o + "-s")), n();
744
- }, Gt = (e, t) => "sc-" + (t && e.$flags$ & 32 ? e.$tagName$ + "-" + t : e.$tagName$), Je = (e) => Cs.map((t) => t(e)).find((t) => !!t), Tt = {}, Ze = "http://www.w3.org/2000/svg", Ve = "http://www.w3.org/1999/xhtml", ts = (e) => e != null, dt = (e) => (e = typeof e, e === "object" || e === "function"), O = (e, t, ...s) => {
745
- let i = null, n = null, o = null, r = !1, a = !1, l = [];
746
- const c = (h) => {
747
- for (let u = 0; u < h.length; u++)
748
- i = h[u], Array.isArray(i) ? c(i) : i != null && typeof i != "boolean" && ((r = typeof e != "function" && !dt(i)) && (i = String(i)), r && a ? l[l.length - 1].$text$ += i : l.push(r ? U(null, i) : i), a = r);
749
- };
750
- if (c(s), t) {
751
- t.key && (n = t.key), t.name && (o = t.name);
752
- {
753
- const h = t.className || t.class;
754
- h && (t.class = typeof h != "object" ? h : Object.keys(h).filter((u) => h[u]).join(" "));
755
- }
756
- }
757
- if (typeof e == "function")
758
- return e(t === null ? {} : t, l, ss);
759
- const d = U(e, null);
760
- return d.$attrs$ = t, l.length > 0 && (d.$children$ = l), d.$key$ = n, d.$name$ = o, d;
761
- }, U = (e, t) => {
762
- const s = {
763
- $flags$: 0,
764
- $tag$: e,
765
- $text$: t,
766
- $elm$: null,
767
- $children$: null
768
- };
769
- return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
770
- }, ht = {}, es = (e) => e && e.$tag$ === ht, ss = {
771
- forEach: (e, t) => e.map(Ot).forEach(t),
772
- map: (e, t) => e.map(Ot).map(t).map(is)
773
- }, Ot = (e) => ({
774
- vattrs: e.$attrs$,
775
- vchildren: e.$children$,
776
- vkey: e.$key$,
777
- vname: e.$name$,
778
- vtag: e.$tag$,
779
- vtext: e.$text$
780
- }), is = (e) => {
781
- if (typeof e.vtag == "function") {
782
- const s = Object.assign({}, e.vattrs);
783
- return e.vkey && (s.key = e.vkey), e.vname && (s.name = e.vname), O(e.vtag, s, ...e.vchildren || []);
784
- }
785
- const t = U(e.vtag, e.vtext);
786
- return t.$attrs$ = e.vattrs, t.$children$ = e.vchildren, t.$key$ = e.vkey, t.$name$ = e.vname, t;
787
- }, Pt = (e, t, s, i, n, o) => {
788
- if (s !== i) {
789
- let r = jt(e, t), a = t.toLowerCase();
790
- if (t === "class") {
791
- const l = e.classList, c = At(s), d = At(i);
792
- l.remove(...c.filter((h) => h && !d.includes(h))), l.add(...d.filter((h) => h && !c.includes(h)));
793
- } else if (t === "style") {
794
- for (const l in s)
795
- (!i || i[l] == null) && (l.includes("-") ? e.style.removeProperty(l) : e.style[l] = "");
796
- for (const l in i)
797
- (!s || i[l] !== s[l]) && (l.includes("-") ? e.style.setProperty(l, i[l]) : e.style[l] = i[l]);
798
- } else if (t !== "key")
799
- if (t === "ref")
800
- i && i(e);
801
- else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n")
802
- t[2] === "-" ? t = t.slice(3) : jt(J, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s && $.rel(e, t, s, !1), i && $.ael(e, t, i, !1);
803
- else {
804
- const l = dt(i);
805
- if ((r || l && i !== null) && !n)
806
- try {
807
- if (e.tagName.includes("-"))
808
- e[t] = i;
809
- else {
810
- let d = i ?? "";
811
- t === "list" ? r = !1 : (s == null || e[t] != d) && (e[t] = d);
812
- }
813
- } catch {
814
- }
815
- let c = !1;
816
- a !== (a = a.replace(/^xlink\:?/, "")) && (t = a, c = !0), i == null || i === !1 ? (i !== !1 || e.getAttribute(t) === "") && (c ? e.removeAttributeNS(Ct, t) : e.removeAttribute(t)) : (!r || o & 4 || n) && !l && (i = i === !0 ? "" : i, c ? e.setAttributeNS(Ct, t, i) : e.setAttribute(t, i));
817
- }
818
- }
819
- }, ns = /\s/, At = (e) => e ? e.split(ns) : [], Kt = (e, t, s, i) => {
820
- const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Tt, r = t.$attrs$ || Tt;
821
- for (i in o)
822
- i in r || Pt(n, i, o[i], void 0, s, t.$flags$);
823
- for (i in r)
824
- Pt(n, i, o[i], r[i], s, t.$flags$);
825
- }, B = (e, t, s, i) => {
826
- let n = t.$children$[s], o = 0, r, a, l;
827
- if (Bt || (ct = !0, n.$tag$ === "slot" && (S && i.classList.add(S + "-s"), n.$flags$ |= n.$children$ ? (
828
- // slot element has fallback content
829
- 2
830
- ) : (
831
- // slot element does not have fallback content
832
- 1
833
- ))), n.$text$ !== null)
834
- r = n.$elm$ = b.createTextNode(n.$text$);
835
- else if (n.$flags$ & 1)
836
- r = n.$elm$ = b.createTextNode("");
837
- else {
838
- if (g || (g = n.$tag$ === "svg"), r = n.$elm$ = b.createElementNS(g ? Ze : Ve, n.$flags$ & 2 ? "slot-fb" : n.$tag$), g && n.$tag$ === "foreignObject" && (g = !1), Kt(null, n, g), ts(S) && r["s-si"] !== S && r.classList.add(r["s-si"] = S), n.$children$)
839
- for (o = 0; o < n.$children$.length; ++o)
840
- a = B(e, n, o, r), a && r.appendChild(a);
841
- n.$tag$ === "svg" ? g = !1 : r.tagName === "foreignObject" && (g = !0);
842
- }
843
- return r["s-hn"] = Y, n.$flags$ & 3 && (r["s-sr"] = !0, r["s-cr"] = Ut, r["s-sn"] = n.$name$ || "", l = e && e.$children$ && e.$children$[s], l && l.$tag$ === n.$tag$ && e.$elm$ && R(e.$elm$, !1)), r;
844
- }, R = (e, t) => {
845
- $.$flags$ |= 1;
846
- const s = e.childNodes;
847
- for (let i = s.length - 1; i >= 0; i--) {
848
- const n = s[i];
849
- n["s-hn"] !== Y && n["s-ol"] && (Yt(n).insertBefore(n, ut(n)), n["s-ol"].remove(), n["s-ol"] = void 0, ct = !0), t && R(n, t);
850
- }
851
- $.$flags$ &= -2;
852
- }, Qt = (e, t, s, i, n, o) => {
853
- let r = e["s-cr"] && e["s-cr"].parentNode || e, a;
854
- for (r.shadowRoot && r.tagName === Y && (r = r.shadowRoot); n <= o; ++n)
855
- i[n] && (a = B(null, s, n, e), a && (i[n].$elm$ = a, r.insertBefore(a, ut(t))));
856
- }, Xt = (e, t, s, i, n) => {
857
- for (; t <= s; ++t)
858
- (i = e[t]) && (n = i.$elm$, Vt(i), F = !0, n["s-ol"] ? n["s-ol"].remove() : R(n, !0), n.remove());
859
- }, os = (e, t, s, i) => {
860
- let n = 0, o = 0, r = 0, a = 0, l = t.length - 1, c = t[0], d = t[l], h = i.length - 1, u = i[0], m = i[h], E, H;
861
- for (; n <= l && o <= h; )
862
- if (c == null)
863
- c = t[++n];
864
- else if (d == null)
865
- d = t[--l];
866
- else if (u == null)
867
- u = i[++o];
868
- else if (m == null)
869
- m = i[--h];
870
- else if (z(c, u))
871
- T(c, u), c = t[++n], u = i[++o];
872
- else if (z(d, m))
873
- T(d, m), d = t[--l], m = i[--h];
874
- else if (z(c, m))
875
- (c.$tag$ === "slot" || m.$tag$ === "slot") && R(c.$elm$.parentNode, !1), T(c, m), e.insertBefore(c.$elm$, d.$elm$.nextSibling), c = t[++n], m = i[--h];
876
- else if (z(d, u))
877
- (c.$tag$ === "slot" || m.$tag$ === "slot") && R(d.$elm$.parentNode, !1), T(d, u), e.insertBefore(d.$elm$, c.$elm$), d = t[--l], u = i[++o];
878
- else {
879
- for (r = -1, a = n; a <= l; ++a)
880
- if (t[a] && t[a].$key$ !== null && t[a].$key$ === u.$key$) {
881
- r = a;
882
- break;
883
- }
884
- r >= 0 ? (H = t[r], H.$tag$ !== u.$tag$ ? E = B(t && t[o], s, r, e) : (T(H, u), t[r] = void 0, E = H.$elm$), u = i[++o]) : (E = B(t && t[o], s, o, e), u = i[++o]), E && Yt(c.$elm$).insertBefore(E, ut(c.$elm$));
885
- }
886
- n > l ? Qt(e, i[h + 1] == null ? null : i[h + 1].$elm$, s, i, o, h) : o > h && Xt(t, n, l);
887
- }, z = (e, t) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : e.$key$ === t.$key$ : !1, ut = (e) => e && e["s-ol"] || e, Yt = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, T = (e, t) => {
888
- const s = t.$elm$ = e.$elm$, i = e.$children$, n = t.$children$, o = t.$tag$, r = t.$text$;
889
- let a;
890
- r === null ? (g = o === "svg" ? !0 : o === "foreignObject" ? !1 : g, o === "slot" || Kt(e, t, g), i !== null && n !== null ? os(s, i, t, n) : n !== null ? (e.$text$ !== null && (s.textContent = ""), Qt(s, null, t, n, 0, n.length - 1)) : i !== null && Xt(i, 0, i.length - 1), g && o === "svg" && (g = !1)) : (a = s["s-cr"]) ? a.parentNode.textContent = r : e.$text$ !== r && (s.data = r);
891
- }, Jt = (e) => {
892
- let t = e.childNodes, s, i, n, o, r, a;
893
- for (i = 0, n = t.length; i < n; i++)
894
- if (s = t[i], s.nodeType === 1) {
895
- if (s["s-sr"]) {
896
- for (r = s["s-sn"], s.hidden = !1, o = 0; o < n; o++)
897
- if (a = t[o].nodeType, t[o]["s-hn"] !== s["s-hn"] || r !== "") {
898
- if (a === 1 && r === t[o].getAttribute("slot")) {
899
- s.hidden = !0;
900
- break;
901
- }
902
- } else if (a === 1 || a === 3 && t[o].textContent.trim() !== "") {
903
- s.hidden = !0;
904
- break;
905
- }
906
- }
907
- Jt(s);
908
- }
909
- }, v = [], Zt = (e) => {
910
- let t, s, i, n, o, r, a = 0, l = e.childNodes, c = l.length;
911
- for (; a < c; a++) {
912
- if (t = l[a], t["s-sr"] && (s = t["s-cr"]) && s.parentNode)
913
- for (i = s.parentNode.childNodes, n = t["s-sn"], r = i.length - 1; r >= 0; r--)
914
- s = i[r], !s["s-cn"] && !s["s-nr"] && s["s-hn"] !== t["s-hn"] && (Lt(s, n) ? (o = v.find((d) => d.$nodeToRelocate$ === s), F = !0, s["s-sn"] = s["s-sn"] || n, o ? o.$slotRefNode$ = t : v.push({
915
- $slotRefNode$: t,
916
- $nodeToRelocate$: s
917
- }), s["s-sr"] && v.map((d) => {
918
- Lt(d.$nodeToRelocate$, s["s-sn"]) && (o = v.find((h) => h.$nodeToRelocate$ === s), o && !d.$slotRefNode$ && (d.$slotRefNode$ = o.$slotRefNode$));
919
- })) : v.some((d) => d.$nodeToRelocate$ === s) || v.push({
920
- $nodeToRelocate$: s
921
- }));
922
- t.nodeType === 1 && Zt(t);
923
- }
924
- }, Lt = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", Vt = (e) => {
925
- e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(Vt);
926
- }, rs = (e, t) => {
927
- const s = e.$hostElement$, i = e.$cmpMeta$, n = e.$vnode$ || U(null, null), o = es(t) ? t : O(null, null, t);
928
- Y = s.tagName, i.$attrsToReflect$ && (o.$attrs$ = o.$attrs$ || {}, i.$attrsToReflect$.map(([r, a]) => o.$attrs$[a] = s[r])), o.$tag$ = null, o.$flags$ |= 4, e.$vnode$ = o, o.$elm$ = n.$elm$ = s.shadowRoot || s, S = s["s-sc"], Ut = s["s-cr"], Bt = (i.$flags$ & 1) !== 0, F = !1, T(n, o);
929
- {
930
- if ($.$flags$ |= 1, ct) {
931
- Zt(o.$elm$);
932
- let r, a, l, c, d, h, u = 0;
933
- for (; u < v.length; u++)
934
- r = v[u], a = r.$nodeToRelocate$, a["s-ol"] || (l = b.createTextNode(""), l["s-nr"] = a, a.parentNode.insertBefore(a["s-ol"] = l, a));
935
- for (u = 0; u < v.length; u++)
936
- if (r = v[u], a = r.$nodeToRelocate$, r.$slotRefNode$) {
937
- for (c = r.$slotRefNode$.parentNode, d = r.$slotRefNode$.nextSibling, l = a["s-ol"]; l = l.previousSibling; )
938
- if (h = l["s-nr"], h && h["s-sn"] === a["s-sn"] && c === h.parentNode && (h = h.nextSibling, !h || !h["s-nr"])) {
939
- d = h;
940
- break;
941
- }
942
- (!d && c !== a.parentNode || a.nextSibling !== d) && a !== d && (!a["s-hn"] && a["s-ol"] && (a["s-hn"] = a["s-ol"].parentNode.nodeName), c.insertBefore(a, d));
943
- } else
944
- a.nodeType === 1 && (a.hidden = !0);
945
- }
946
- F && Jt(o.$elm$), $.$flags$ &= -2, v.length = 0;
947
- }
948
- }, as = (e) => e, ls = (e, t, s) => {
949
- const i = as(e);
950
- return {
951
- emit: (n) => cs(i, t, {
952
- bubbles: !!(s & 4),
953
- composed: !!(s & 2),
954
- cancelable: !!(s & 1),
955
- detail: n
956
- })
957
- };
958
- }, cs = (e, t, s) => {
959
- const i = $.ce(t, s);
960
- return e.dispatchEvent(i), i;
961
- }, ds = (e, t) => {
962
- }, te = (e, t) => (e.$flags$ |= 16, ds(e, e.$ancestorComponent$), Os(() => hs(e, t))), hs = (e, t) => {
963
- const s = e.$hostElement$, i = _("scheduleUpdate", e.$cmpMeta$.$tagName$), n = s;
964
- let o;
965
- return t ? o = P(n, "componentWillLoad") : o = P(n, "componentWillUpdate"), o = Et(o, () => P(n, "componentWillRender")), i(), Et(o, () => us(e, n, t));
966
- }, us = async (e, t, s) => {
967
- const i = e.$hostElement$, n = _("update", e.$cmpMeta$.$tagName$);
968
- i["s-rc"], s && Ye(e);
969
- const o = _("render", e.$cmpMeta$.$tagName$);
970
- ps(e, t, i), o(), n(), fs(e);
971
- }, ps = (e, t, s) => {
972
- try {
973
- kt = t, t = t.render && t.render(), e.$flags$ &= -17, e.$flags$ |= 2, (C.hasRenderFn || C.reflect) && (C.vdomRender || C.reflect) && (C.hydrateServerSide || rs(e, t));
974
- } catch (a) {
975
- N(a, e.$hostElement$);
976
- }
977
- return kt = null, null;
978
- }, fs = (e) => {
979
- const t = e.$cmpMeta$.$tagName$, s = e.$hostElement$, i = _("postUpdate", t), n = s;
980
- e.$ancestorComponent$, P(n, "componentDidRender"), e.$flags$ & 64 ? (P(n, "componentDidUpdate"), i()) : (e.$flags$ |= 64, P(n, "componentDidLoad"), i());
981
- }, P = (e, t, s) => {
982
- if (e && e[t])
983
- try {
984
- return e[t](s);
985
- } catch (i) {
986
- N(i);
987
- }
988
- }, Et = (e, t) => e && e.then ? e.then(t) : t(), $s = (e, t) => e != null && !dt(e) ? t & 4 ? e === "false" ? !1 : e === "" || !!e : t & 2 ? parseFloat(e) : t & 1 ? String(e) : e : e, gs = (e, t) => Z(e).$instanceValues$.get(t), ms = (e, t, s, i) => {
989
- const n = Z(e), o = e, r = n.$instanceValues$.get(t), a = n.$flags$, l = o;
990
- s = $s(s, i.$members$[t][0]);
991
- const c = Number.isNaN(r) && Number.isNaN(s);
992
- if (s !== r && !c) {
993
- n.$instanceValues$.set(t, s);
994
- {
995
- if (i.$watchers$ && a & 128) {
996
- const h = i.$watchers$[t];
997
- h && h.map((u) => {
998
- try {
999
- l[u](s, r, t);
1000
- } catch (m) {
1001
- N(m, o);
1002
- }
1003
- });
1004
- }
1005
- if ((a & 18) === 2) {
1006
- if (l.componentShouldUpdate && l.componentShouldUpdate(s, r, t) === !1)
1007
- return;
1008
- te(n, !1);
1009
- }
1010
- }
1011
- }
1012
- }, vs = (e, t, s) => {
1013
- if (t.$members$) {
1014
- e.watchers && (t.$watchers$ = e.watchers);
1015
- const i = Object.entries(t.$members$), n = e.prototype;
1016
- i.map(([o, [r]]) => {
1017
- (r & 31 || r & 32) && Object.defineProperty(n, o, {
1018
- get() {
1019
- return gs(this, o);
1020
- },
1021
- set(a) {
1022
- ms(this, o, a, t);
1023
- },
1024
- configurable: !0,
1025
- enumerable: !0
1026
- });
1027
- });
1028
- {
1029
- const o = /* @__PURE__ */ new Map();
1030
- n.attributeChangedCallback = function(r, a, l) {
1031
- $.jmp(() => {
1032
- const c = o.get(r);
1033
- if (this.hasOwnProperty(c))
1034
- l = this[c], delete this[c];
1035
- else if (n.hasOwnProperty(c) && typeof this[c] == "number" && this[c] == l)
1036
- return;
1037
- this[c] = l === null && typeof this[c] == "boolean" ? !1 : l;
1038
- });
1039
- }, e.observedAttributes = i.filter(
1040
- ([r, a]) => a[0] & 15
1041
- /* HasAttribute */
1042
- ).map(([r, a]) => {
1043
- const l = a[1] || r;
1044
- return o.set(l, r), a[0] & 512 && t.$attrsToReflect$.push([r, l]), l;
1045
- });
1046
- }
1047
- }
1048
- return e;
1049
- }, bs = async (e, t, s, i, n) => {
1050
- if (!(t.$flags$ & 32) && (n = e.constructor, t.$flags$ |= 32, customElements.whenDefined(s.$tagName$).then(() => t.$flags$ |= 128), n.style)) {
1051
- let r = n.style;
1052
- typeof r != "string" && (r = r[t.$modeName$ = Je(e)]);
1053
- const a = Gt(s, t.$modeName$);
1054
- if (!W.has(a)) {
1055
- const l = _("registerStyles", s.$tagName$);
1056
- Qe(a, r, !!(s.$flags$ & 1)), l();
1057
- }
1058
- }
1059
- t.$ancestorComponent$, (() => te(t, !0))();
1060
- }, ys = (e) => {
1061
- }, xs = (e) => {
1062
- if (!($.$flags$ & 1)) {
1063
- const t = Z(e), s = t.$cmpMeta$, i = _("connectedCallback", s.$tagName$);
1064
- t.$flags$ & 1 ? (qt(e, t, s.$listeners$), ys(t.$lazyInstance$)) : (t.$flags$ |= 1, s.$flags$ & 12 && _s(e), s.$members$ && Object.entries(s.$members$).map(([n, [o]]) => {
1065
- if (o & 31 && e.hasOwnProperty(n)) {
1066
- const r = e[n];
1067
- delete e[n], e[n] = r;
1068
- }
1069
- }), bs(e, t, s)), i();
1070
- }
1071
- }, _s = (e) => {
1072
- const t = e["s-cr"] = b.createComment("");
1073
- t["s-cn"] = !0, e.insertBefore(t, e.firstChild);
1074
- }, ws = (e) => {
1075
- if (!($.$flags$ & 1)) {
1076
- const t = Z(e);
1077
- t.$rmListeners$ && (t.$rmListeners$.map((s) => s()), t.$rmListeners$ = void 0);
1078
- }
1079
- }, ee = (e, t) => {
1080
- const s = {
1081
- $flags$: t[0],
1082
- $tagName$: t[1]
1083
- };
1084
- s.$members$ = t[2], s.$listeners$ = t[3], s.$watchers$ = e.$watchers$, s.$attrsToReflect$ = [];
1085
- const i = e.prototype.connectedCallback, n = e.prototype.disconnectedCallback;
1086
- return Object.assign(e.prototype, {
1087
- __registerHost() {
1088
- ks(this, s);
1089
- },
1090
- connectedCallback() {
1091
- xs(this), i && i.call(this);
1092
- },
1093
- disconnectedCallback() {
1094
- ws(this), n && n.call(this);
1095
- },
1096
- __attachShadow() {
1097
- this.attachShadow({
1098
- mode: "open",
1099
- delegatesFocus: !!(s.$flags$ & 16)
1100
- });
1101
- }
1102
- }), e.is = s.$tagName$, vs(e, s);
1103
- }, se = /* @__PURE__ */ new WeakMap(), Z = (e) => se.get(e), ks = (e, t) => {
1104
- const s = {
1105
- $flags$: 0,
1106
- $hostElement$: e,
1107
- $cmpMeta$: t,
1108
- $instanceValues$: /* @__PURE__ */ new Map()
1109
- };
1110
- return qt(e, s, t.$listeners$), se.set(e, s);
1111
- }, jt = (e, t) => t in e, N = (e, t) => (0, console.error)(e, t), W = /* @__PURE__ */ new Map(), Cs = [], It = [], ie = [], Ss = (e, t) => (s) => {
1112
- e.push(s), it || (it = !0, t && $.$flags$ & 4 ? Ts(nt) : $.raf(nt));
1113
- }, Rt = (e) => {
1114
- for (let t = 0; t < e.length; t++)
1115
- try {
1116
- e[t](performance.now());
1117
- } catch (s) {
1118
- N(s);
1119
- }
1120
- e.length = 0;
1121
- }, nt = () => {
1122
- Rt(It), Rt(ie), (it = It.length > 0) && $.raf(nt);
1123
- }, Ts = (e) => Be().then(e), Os = /* @__PURE__ */ Ss(ie, !0), Ps = (e = {}) => {
1124
- const { content: t = "", title: s, attributes: i = [] } = e;
1125
- let n = "", o = [
1126
- { name: "xmlns", value: "http://www.w3.org/2000/svg" },
1127
- { name: "fill", value: "currentColor" },
1128
- ...i
1129
- ];
1130
- return s && (n = `<title>${s}</title>`), `<svg ${o.map((a) => `${a.name}="${a.value}"`).join(" ")}>${n}${t}</svg>`;
1131
- }, As = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim();
1132
- function Ls(e) {
1133
- return `${e.getFullYear()}.${e.getMonth() + 1}`;
1134
- }
1135
- class Es {
1136
- constructor(t) {
1137
- this.voca_component = t, this.voca_added = Ls(/* @__PURE__ */ new Date());
1138
- }
1139
- }
1140
- const js = "telia-vst{display:none}", Is = /* @__PURE__ */ ee(class extends Wt {
1141
- constructor() {
1142
- super(), this.__registerHost(), this.vocaInternalUStats = ls(this, "vocaInternalUStats", 7);
1143
- }
1144
- connectedCallback() {
1145
- this.vocaInternalUStats.emit(new Es(this.dataTrackingId));
1146
- }
1147
- render() {
1148
- return O(ht, null);
1149
- }
1150
- static get style() {
1151
- return js;
1152
- }
1153
- }, [0, "telia-vst", {
1154
- dataTrackingId: [1, "data-tracking-id"]
1155
- }]);
1156
- function ne() {
1157
- if (typeof customElements > "u")
1158
- return;
1159
- ["telia-vst"].forEach((t) => {
1160
- switch (t) {
1161
- case "telia-vst":
1162
- customElements.get(t) || customElements.define(t, Is);
1163
- break;
1164
- }
1165
- });
1166
- }
1167
- ne();
1168
- function ot() {
1169
- return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : { vocadsIcons: void 0, vocadsIconsRegistered: !1 };
1170
- }
1171
- function Rs() {
1172
- if (typeof ot().vocadsIcons !== void 0)
1173
- return ot().vocadsIcons;
1174
- }
1175
- function Ds() {
1176
- return ot().vocadsIconsRegistered;
1177
- }
1178
- const Ns = ".telia-icon{display:inline-block}.telia-icon__container{display:block;height:inherit}.telia-icon svg{display:block}.telia-icon--sm{height:calc(1.6rem * var(--voca-rem-multiplier));min-width:calc(1.6rem * var(--voca-rem-multiplier));width:calc(1.6rem * var(--voca-rem-multiplier))}.telia-icon--md{height:calc(2.4rem * var(--voca-rem-multiplier));min-width:calc(2.4rem * var(--voca-rem-multiplier));width:calc(2.4rem * var(--voca-rem-multiplier))}.telia-icon--lg{height:calc(3.2rem * var(--voca-rem-multiplier));min-width:calc(3.2rem * var(--voca-rem-multiplier));width:calc(3.2rem * var(--voca-rem-multiplier))}", Hs = /* @__PURE__ */ ee(class extends Wt {
1179
- constructor() {
1180
- super(), this.__registerHost(), this.size = "md", this.allyTitle = null, this.dataTrackingId = "telia-icon";
1181
- }
1182
- /**
1183
- * Returns svg string from svg property or svg string from icons bundle if icons bundle is registered
1184
- * @private
1185
- * @returns string
1186
- */
1187
- getSvgString() {
1188
- if (this.svg)
1189
- return this.svg;
1190
- if (Ds() && this.name) {
1191
- const e = Rs();
1192
- return e[this.name] ? e[this.name].svg : "";
1193
- }
1194
- return this.name && console.warn(this.name, "Icons bundle is not registered and will not be rendered. Check if you have registered icons bundle or use svg property"), "";
1195
- }
1196
- render() {
1197
- let e = this.getSvgString(), t = [{ name: "viewBox", value: "0 0 64 64" }];
1198
- this.allyTitle ? t = [...t, { name: "role", value: "img" }] : t = [
1199
- ...t,
1200
- { name: "aria-hidden", value: "true" }
1201
- ];
1202
- const s = Ps({
1203
- content: As(e),
1204
- attributes: t,
1205
- title: this.allyTitle
1206
- });
1207
- return O(ht, { class: `telia-icon telia-icon--${this.size}` }, O("span", { "aria-label": this.allyTitle, class: "telia-icon__container", innerHTML: s }), O("telia-vst", { dataTrackingId: this.dataTrackingId }));
1208
- }
1209
- static get style() {
1210
- return Ns;
1211
- }
1212
- }, [0, "telia-icon", {
1213
- name: [1],
1214
- svg: [1],
1215
- size: [1],
1216
- allyTitle: [1, "ally-title"],
1217
- dataTestid: [1, "data-testid"]
1218
- }]);
1219
- function zs() {
1220
- if (typeof customElements > "u")
1221
- return;
1222
- ["telia-icon", "telia-vst"].forEach((t) => {
1223
- switch (t) {
1224
- case "telia-icon":
1225
- customElements.get(t) || customElements.define(t, Hs);
1226
- break;
1227
- case "telia-vst":
1228
- customElements.get(t) || ne();
1229
- break;
1230
- }
1231
- });
1232
- }
1233
- zs();
1234
- var Ms = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, oe = (e, t, s, i) => {
1235
- for (var n = i > 1 ? void 0 : i ? Fs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1236
- (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1237
- return i && n && Ms(t, s, n), n;
1238
- };
1239
- let q = class extends A {
1240
- _renderTimestamp(e, t) {
1241
- if (!e && !t)
1242
- return f;
1243
- const s = (n) => new Date(n).toLocaleTimeString([], {
1244
- hour: "2-digit",
1245
- minute: "2-digit"
1246
- });
1247
- let i = "";
1248
- return e ? t ? i = `${e}: ${s(t)}` : i = e : t && (i = s(t)), p`<p class="conversation-timestamp">${i}</p>`;
1249
- }
1250
- render() {
1251
- var e, t;
1252
- switch (this.message.type) {
1253
- case V.System:
1254
- return "";
1255
- case V.Agent:
1256
- return p`<div
1257
- class=${Ht({
1258
- "conversation-agent-message": !0,
1259
- "has-avatar": !!((e = this.message.sender) != null && e.avatar)
1260
- })}
1261
- >
1262
- ${typeof ((t = this.message.sender) == null ? void 0 : t.avatar) == "string" ? p`<div class="avatar">
1263
- <img src=${this.message.sender.avatar} />
1264
- </div>` : f}
1265
-
1266
- <div class="content-bundle">
1267
- ${this.message.content.map(
1268
- (s) => p`
1269
- <div class="message-container">
1270
- <div class="message-content">
1271
- <conversation-component-message-list
1272
- .items=${s.items || []}
1273
- ></conversation-component-message-list>
1274
- </div>
1275
- </div>
1276
- `
1277
- )}
1278
- </div>
1279
- ${this._renderTimestamp(
1280
- this.message.sender.name || "",
1281
- this.message.timestamp
1282
- )}
1283
- </div>`;
1284
- case V.User:
1285
- return p`<div class="conversation-user-message">
1286
- <div class="content-bundle">
1287
- ${this.message.content.map(
1288
- (s) => p`
1289
- <div class="message-container">
1290
- <div class="message-content">
1291
- <conversation-component-message-list
1292
- .items=${s.items || []}
1293
- ></conversation-component-message-list>
1294
- </div>
1295
- </div>
1296
- `
1297
- )}
1298
- </div>
1299
- ${this._renderTimestamp(
1300
- "",
1301
- // TODO: properties.userLabel || ''
1302
- this.message.timestamp
1303
- )}
1304
- </div>`;
1305
- default:
1306
- return f;
1307
- }
1308
- }
1309
- };
1310
- q.styles = w`
1311
- :host {
1312
- box-sizing: border-box;
1313
- display: block;
1314
- }
1315
- * {
1316
- box-sizing: border-box;
1317
- }
1318
- .message-content {
1319
- padding: var(--spacing-md);
1320
- display: inline-block;
1321
- margin-top: var(--spacing-md);
1322
- max-width: 100%;
1323
- border: 1px solid var(--gray-color);
1324
- border-radius: var(--border-radius);
1325
- background-color: var(--bubble-bg-color);
1326
- color: var(--bubble-text-color);
1327
- }
1328
-
1329
- .conversation-user-message {
1330
- --bubble-bg-color: var(--conversation-user-bg-color);
1331
- --bubble-text-color: var(--conversation-user-text-color);
1332
- margin-left: 10%;
1333
- width: 90%;
1334
- display: flex;
1335
- flex-direction: column;
1336
- align-items: flex-end;
1337
- }
1338
-
1339
- .conversation-agent-message {
1340
- --bubble-bg-color: var(--conversation-agent-bg-color);
1341
- --bubble-text-color: var(--conversation-agent-text-color);
1342
- display: grid;
1343
- margin-right: 10%;
1344
- width: 90%;
1345
-
1346
- grid-template-columns: 1fr;
1347
- grid-template-rows: 1fr auto;
1348
- grid-template-areas:
1349
- 'content'
1350
- 'info';
1351
- }
1352
- .conversation-agent-message.has-avatar {
1353
- grid-template-columns: auto 1fr;
1354
- grid-template-rows: 1fr auto;
1355
- grid-template-areas:
1356
- 'avatar content'
1357
- '. info';
1358
- }
1359
-
1360
- .avatar {
1361
- grid-area: avatar;
1362
- place-self: flex-end;
1363
- width: 32px;
1364
- height: 32px;
1365
- border-radius: 50%;
1366
- align-self: flex-end;
1367
- justify-self: center;
1368
- overflow: hidden;
1369
- margin-right: var(--spacing-md);
1370
- justify-content: center;
1371
- align-items: center;
1372
- }
1373
- .avatar img {
1374
- height: 100%;
1375
- width: 100%;
1376
- object-fit: cover;
1377
- }
1378
-
1379
- .conversation-timestamp {
1380
- grid-area: info;
1381
- margin: 0;
1382
- line-height: 1.5em;
1383
- grid-area: info;
1384
- color: var(--text-color);
1385
- font-size: 0.8rem;
1386
- font-weight: 300;
1387
- }
1388
-
1389
- .content-bundle {
1390
- grid-area: content;
1391
- }
1392
- `;
1393
- oe([
1394
- x()
1395
- ], q.prototype, "message", 2);
1396
- q = oe([
1397
- L("conversation-component-message")
1398
- ], q);
1399
- var Us = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, re = (e, t, s, i) => {
1400
- for (var n = i > 1 ? void 0 : i ? Bs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1401
- (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1402
- return i && n && Us(t, s, n), n;
1403
- };
1404
- let G = class extends A {
1405
- constructor() {
1406
- super(...arguments), this.items = [];
1407
- }
1408
- _isCustomComponent(e) {
1409
- return !["html", "link-list"].includes(e);
1410
- }
1411
- _createCustomComponent(e, t) {
1412
- const s = customElements.get(e);
1413
- if (s) {
1414
- const i = new s();
1415
- return i.message = t, i;
1416
- }
1417
- return f;
1418
- }
1419
- render() {
1420
- return p` <div class="message-list">
1421
- ${this.items.map(
1422
- ([e, t]) => p`
1423
- ${e === "html" ? p`
1424
- <message-type-html .message=${t}> </message-type-html>
1425
- ` : f}
1426
- ${e === "link-list" ? p`
1427
- <message-type-link-list .message=${t}>
1428
- </message-type-link-list>
1429
- ` : f}
1430
- ${e === "separator" ? p`
1431
- <message-type-separator .message=${t}>
1432
- </message-type-separator>
1433
- ` : f}
1434
- ${this._isCustomComponent(e) ? this._createCustomComponent(e, t) : f}
1435
- `
1436
- )}
1437
- </div>`;
1438
- }
1439
- };
1440
- G.styles = w`
1441
- :host {
1442
- box-sizing: border-box;
1443
- display: block;
1444
- }
1445
- * {
1446
- box-sizing: border-box;
1447
- }
1448
- .message-list {
1449
- display: flex;
1450
- flex-direction: column;
1451
- gap: var(--spacing-md);
1452
- }
1453
- `;
1454
- re([
1455
- x()
1456
- ], G.prototype, "items", 2);
1457
- G = re([
1458
- L("conversation-component-message-list")
1459
- ], G);
1460
- /**
1461
- * @license
1462
- * Copyright 2017 Google LLC
1463
- * SPDX-License-Identifier: BSD-3-Clause
1464
- */
1465
- class rt extends Nt {
1466
- constructor(t) {
1467
- if (super(t), this.et = f, t.type !== at.CHILD)
1468
- throw Error(this.constructor.directiveName + "() can only be used in child bindings");
1469
- }
1470
- render(t) {
1471
- if (t === f || t == null)
1472
- return this.vt = void 0, this.et = t;
1473
- if (t === fe)
1474
- return t;
1475
- if (typeof t != "string")
1476
- throw Error(this.constructor.directiveName + "() called with a non-string value");
1477
- if (t === this.et)
1478
- return this.vt;
1479
- this.et = t;
1480
- const s = [t];
1481
- return s.raw = s, this.vt = { _$litType$: this.constructor.resultType, strings: s, values: [] };
1482
- }
1483
- }
1484
- rt.directiveName = "unsafeHTML", rt.resultType = 1;
1485
- const Ws = lt(rt);
1486
- var qs = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, ae = (e, t, s, i) => {
1487
- for (var n = i > 1 ? void 0 : i ? Gs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1488
- (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1489
- return i && n && qs(t, s, n), n;
1490
- };
1491
- let K = class extends A {
1492
- render() {
1493
- return p`<div class="message-type-html">
1494
- ${Ws(this.message.body)}
1495
- </div>`;
1496
- }
1497
- };
1498
- K.styles = [
1499
- w`
1500
- :host {
1501
- box-sizing: border-box;
1502
- }
1503
- * {
1504
- box-sizing: border-box;
1505
- }
1506
- p {
1507
- margin: 0;
1508
- padding: 0;
1509
- word-break: break-word;
1510
- }
1511
- `
1512
- ];
1513
- ae([
1514
- x({ attribute: !1 })
1515
- ], K.prototype, "message", 2);
1516
- K = ae([
1517
- L("message-type-html")
1518
- ], K);
1519
- var Ks = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, le = (e, t, s, i) => {
1520
- for (var n = i > 1 ? void 0 : i ? Qs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1521
- (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1522
- return i && n && Ks(t, s, n), n;
1523
- };
1524
- let Q = class extends A {
1525
- _onItemClick(e) {
1526
- const t = new CustomEvent("action", {
1527
- bubbles: !0,
1528
- composed: !0,
1529
- detail: {
1530
- actionKey: "action",
1531
- payload: e
1532
- }
1533
- });
1534
- this.dispatchEvent(t);
1535
- }
1536
- render() {
1537
- return p`
1538
- <div class="message-type-link-list">
1539
- ${this.message.header ? p`<h1>${this.message.header}</h1>` : f}
1540
- <ul>
1541
- ${this.message.actions.map(
1542
- (e) => p`
1543
- <li>
1544
- <button @click=${() => this._onItemClick(e)}>
1545
- ${e.label}
1546
- </button>
1547
- </li>
1548
- `
1549
- )}
1550
- </ul>
1551
- </div>
1552
- `;
1553
- }
1554
- };
1555
- Q.styles = [
1556
- w`
1557
- :host {
1558
- box-sizing: border-box;
1559
- }
1560
- * {
1561
- box-sizing: border-box;
1562
- }
1563
- h1 {
1564
- font-size: 1.1rem;
1565
- margin: 0 0 var(--spacing-sm);
1566
- font-weight: normal;
1567
- line-height: 1.8rem;
1568
- color: var(--text-color);
1569
- white-space: normal;
1570
- }
1571
- ul {
1572
- list-style: none;
1573
- margin: 0;
1574
- padding: 0;
1575
- }
1576
- .message-type-link-list button {
1577
- /* color: var(--primary-color); */
1578
- background-color: transparent;
1579
- max-width: 100%;
1580
- border: none;
1581
- cursor: pointer;
1582
- text-transform: none;
1583
- font-weight: 300;
1584
- font-size: inherit;
1585
- text-align: left;
1586
- display: block;
1587
- margin: 0;
1588
- padding: 0;
1589
- }
1590
- .message-type-link-list ul {
1591
- display: flex;
1592
- flex-direction: column;
1593
- gap: var(--spacing-sm);
1594
- }
1595
- `
1596
- ];
1597
- le([
1598
- x({ attribute: !1 })
1599
- ], Q.prototype, "message", 2);
1600
- Q = le([
1601
- L("message-type-link-list")
1602
- ], Q);
1603
- var Xs = Object.defineProperty, Ys = Object.getOwnPropertyDescriptor, ce = (e, t, s, i) => {
1604
- for (var n = i > 1 ? void 0 : i ? Ys(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1605
- (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1606
- return i && n && Xs(t, s, n), n;
1607
- };
1608
- let X = class extends A {
1609
- render() {
1610
- return p`<div class="message-type-separator"></div>`;
1611
- }
1612
- };
1613
- X.styles = [
1614
- w`
1615
- :host {
1616
- box-sizing: border-box;
1617
- }
1618
- * {
1619
- box-sizing: border-box;
1620
- }
1621
- .message-type-separator {
1622
- border-bottom: 1px solid var(--gray-color);
1623
- width: 100%;
1624
- }
1625
- `
1626
- ];
1627
- ce([
1628
- x({ attribute: !1 })
1629
- ], X.prototype, "message", 2);
1630
- X = ce([
1631
- L("message-type-separator")
1632
- ], X);
1633
- const Js = (e) => {
1634
- e.scrollTo ? e.scrollTo({ top: e.scrollHeight, behavior: "smooth" }) : e.scrollTop = e.scrollHeight;
1635
- };
1636
- var Zs = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, de = (e, t, s, i) => {
1637
- for (var n = i > 1 ? void 0 : i ? Vs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1638
- (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1639
- return i && n && Zs(t, s, n), n;
1640
- };
1641
- const he = Ae(A);
1642
- let D = class extends he {
1643
- constructor() {
1644
- super(...arguments), this.message = "", this.conversationContentRef = Re(), this.chatScrollHeight = 0;
1645
- }
1646
- async _onSendMessage(e) {
1647
- e.preventDefault(), await this.actions.dispatch("user-submit", { text: this.message }), this.message = "";
1648
- }
1649
- _inputHandler(e) {
1650
- this.message = e.target.value;
1651
- }
1652
- _actionHandler(e) {
1653
- this.actions.dispatch(e.detail.actionKey, e.detail.payload);
1654
- }
1655
- updated(e) {
1656
- const t = this.conversationContentRef.value;
1657
- t && setTimeout(() => {
1658
- const s = t.scrollHeight;
1659
- s > this.chatScrollHeight && (Js(t), this.chatScrollHeight = s);
1660
- }, 1e3);
1661
- }
1662
- render() {
1663
- return p` <div
1664
- @action=${this._actionHandler}
1665
- class=${Ht({
1666
- conversation: !0,
1667
- "input-has-text": this.message.length > 0
1668
- })}
1669
- >
1670
- <div class="conversation-content" ${Ne(this.conversationContentRef)}>
1671
- <div class="conversation-content-inner">
1672
- ${(this.properties.messages || []).map(
1673
- (e) => p`<div class="conversation-entry" tabindex="-1">
1674
- <conversation-component-message
1675
- .message=${e}
1676
- ${wt({
1677
- keyframeOptions: {},
1678
- in: bt,
1679
- out: vt,
1680
- stabilizeOut: !0,
1681
- skipInitial: !1
1682
- })}
1683
- >
1684
- </conversation-component-message>
1685
- </div>`
1686
- )}
1687
- ${this.properties.loading ? p`<div
1688
- class="loader"
1689
- ${wt({
1690
- in: bt,
1691
- out: vt,
1692
- skipInitial: !1
1693
- })}
1694
- >
1695
- <div></div>
1696
- <div></div>
1697
- <div></div>
1698
- </div>` : f}
1699
- </div>
1700
- </div>
1701
- <form class="conversation-bottom" @submit=${this._onSendMessage}>
1702
- <input
1703
- placeholder=${this.properties.inputPlaceholder || "Type your message here..."}
1704
- .value=${this.message}
1705
- @input=${this._inputHandler}
1706
- />
1707
- <div class="conversation-actions">
1708
- <button class="conversation-send-button" type="submit">
1709
- <telia-icon svg=${$e.svg}></telia-icon>
1710
- </button>
1711
- </div>
1712
- </form>
1713
- </div>`;
1714
- }
1715
- };
1716
- D.styles = [
1717
- he.styles || [],
1718
- w`
1719
- :host {
1720
- font-family: var(--font-family);
1721
- /* --send-icon-color: var(--gray-dark-color, #a6a6a6); */
1722
- --send-icon-opacity: 0.4;
1723
- --send-icon-color: var(--text-color);
1724
- --conversation-bg: #fafafa;
1725
- --conversation-agent-bg-color: var(--secondary-background);
1726
- --conversation-agent-text-color: var(--text-on-secondary-background);
1727
- --conversation-user-bg-color: var(--primary-background);
1728
- --conversation-user-text-color: var(--text-on-primary-background);
1729
-
1730
- scrollbar-width: thin; /* Firefox */
1731
- scrollbar-color: #7f7f7f transparent; /* Firefox */
1732
- }
1733
- ::-webkit-scrollbar {
1734
- width: 3px !important;
1735
- background-color: transparent;
1736
- border-left: none;
1737
- }
1738
- ::-webkit-scrollbar-thumb {
1739
- background-color: #7f7f7f;
1740
- }
1741
- ::-webkit-scrollbar-track {
1742
- -webkit-box-shadow: none !important;
1743
- background-color: transparent;
1744
- }
1745
-
1746
- .conversation {
1747
- display: grid;
1748
- grid-template-rows: 1fr auto;
1749
- gap: var(--spacing-lg);
1750
- height: 100%;
1751
- background-color: transparent;
1752
- }
1753
-
1754
- .conversation.input-has-text {
1755
- /* --send-icon-color: var(--primary-color); */
1756
- --send-icon-opacity: 1;
1757
- }
1758
-
1759
- .conversation-content {
1760
- flex: 1;
1761
- background-color: var(--conversation-bg);
1762
- padding: var(--spacing-md);
1763
- overflow-y: auto;
1764
- overflow-x: hidden;
1765
- border-radius: var(--border-radius-sm);
1766
- }
1767
- .conversation-content-inner {
1768
- display: flex;
1769
- flex-direction: column;
1770
- justify-content: end;
1771
- min-height: 100%;
1772
- }
1773
- .conversation-bottom {
1774
- border-top: 1px solid var(--gray-color);
1775
- border-radius: var(--border-radius-sm);
1776
- background-color: #fff;
1777
- min-height: 50px;
1778
- max-height: 150px;
1779
- display: flex;
1780
- align-items: center;
1781
- padding: 0 var(--spacing-md);
1782
- margin: 0;
1783
- }
1784
- .conversation-bottom-left {
1785
- border-right: 1px solid var(--gray-color);
1786
- padding-right: var(--spacing-md);
1787
- }
1788
- .circle {
1789
- background-color: var(--gray-dark-color, #a6a6a6);
1790
- border-radius: 50%;
1791
- color: #fff;
1792
- padding: var(--spacing-sm, 5px);
1793
- border: none;
1794
- display: flex;
1795
- justify-content: center;
1796
- align-items: center;
1797
- }
1798
- .conversation-send-button {
1799
- border: none;
1800
- background: transparent;
1801
- cursor: pointer;
1802
- color: var(--send-icon-color);
1803
- opacity: var(--send-icon-opacity);
1804
- transition: opacity 200ms ease-in-out;
1805
- }
1806
- .conversation-send-button:hover {
1807
- --send-icon-opacity: 1;
1808
- }
1809
- input {
1810
- border: none;
1811
- font-family: inherit;
1812
- font-size: inherit;
1813
- flex: 1;
1814
- height: 2.5rem;
1815
- outline: none;
1816
- }
1817
-
1818
- @keyframes loaderanim {
1819
- 0% {
1820
- opacity: 0;
1821
- }
1822
- 75% {
1823
- opacity: 1;
1824
- }
1825
- 100% {
1826
- opacity: 0;
1827
- }
1828
- }
1829
-
1830
- .loader {
1831
- display: flex;
1832
- justify-content: center;
1833
- }
1834
-
1835
- .loader > div {
1836
- height: 10px;
1837
- width: 10px;
1838
- border-radius: 50%;
1839
- margin: 5px;
1840
- background-color: var(--text-color);
1841
- animation-name: loaderanim;
1842
- animation-duration: 1s;
1843
- animation-iteration-count: infinite;
1844
- }
1845
-
1846
- .loader > div:nth-of-type(2) {
1847
- animation-delay: 100ms;
1848
- }
1849
-
1850
- .loader > div:nth-of-type(3) {
1851
- animation-delay: 200ms;
1852
- }
1853
- `
1854
- ];
1855
- de([
1856
- k()
1857
- ], D.prototype, "message", 2);
1858
- D = de([
1859
- L("ace-conversation")
1860
- ], D);
1861
- const ci = D;
1862
- export {
1863
- D as ConversationComponent,
1864
- ci as default
1865
- };