@telia-ace/widget-site 1.0.2 → 1.0.4
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/index.js +8 -8
- package/index.mjs +343 -319
- package/index.umd.js +8 -8
- package/package.json +1 -1
- package/site.component.d.ts +4 -2
- package/widget.component.d.ts +3 -0
package/index.mjs
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
6
|
+
const L = globalThis, J = L.ShadowRoot && (L.ShadyCSS === void 0 || L.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ht = Symbol(), F = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
let ut = class {
|
|
8
|
-
constructor(t, e,
|
|
9
|
-
if (this._$cssResult$ = !0,
|
|
8
|
+
constructor(t, e, i) {
|
|
9
|
+
if (this._$cssResult$ = !0, i !== ht)
|
|
10
10
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
11
11
|
this.cssText = t, this.t = e;
|
|
12
12
|
}
|
|
@@ -14,8 +14,8 @@ let ut = class {
|
|
|
14
14
|
let t = this.o;
|
|
15
15
|
const e = this.t;
|
|
16
16
|
if (J && t === void 0) {
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const i = e !== void 0 && e.length === 1;
|
|
18
|
+
i && (t = F.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && F.set(e, t));
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
@@ -23,56 +23,56 @@ let ut = class {
|
|
|
23
23
|
return this.cssText;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const $t = (
|
|
26
|
+
const $t = (n) => new ut(typeof n == "string" ? n : n + "", void 0, ht), _t = (n, t) => {
|
|
27
27
|
if (J)
|
|
28
|
-
|
|
28
|
+
n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else
|
|
30
30
|
for (const e of t) {
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const i = document.createElement("style"), s = L.litNonce;
|
|
32
|
+
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, n.appendChild(i);
|
|
33
33
|
}
|
|
34
|
-
}, G = J ? (
|
|
34
|
+
}, G = J ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
|
|
35
35
|
let e = "";
|
|
36
|
-
for (const
|
|
37
|
-
e +=
|
|
36
|
+
for (const i of t.cssRules)
|
|
37
|
+
e += i.cssText;
|
|
38
38
|
return $t(e);
|
|
39
|
-
})(
|
|
39
|
+
})(n) : n;
|
|
40
40
|
/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
44
|
*/
|
|
45
|
-
const { is: ft, defineProperty: gt, getOwnPropertyDescriptor: mt, getOwnPropertyNames: yt, getOwnPropertySymbols: At, getPrototypeOf: wt } = Object, f = globalThis, Q = f.trustedTypes, vt = Q ? Q.emptyScript : "",
|
|
45
|
+
const { is: ft, defineProperty: gt, getOwnPropertyDescriptor: mt, getOwnPropertyNames: yt, getOwnPropertySymbols: At, getPrototypeOf: wt } = Object, f = globalThis, Q = f.trustedTypes, vt = Q ? Q.emptyScript : "", D = f.reactiveElementPolyfillSupport, T = (n, t) => n, B = { toAttribute(n, t) {
|
|
46
46
|
switch (t) {
|
|
47
47
|
case Boolean:
|
|
48
|
-
|
|
48
|
+
n = n ? vt : null;
|
|
49
49
|
break;
|
|
50
50
|
case Object:
|
|
51
51
|
case Array:
|
|
52
|
-
|
|
52
|
+
n = n == null ? n : JSON.stringify(n);
|
|
53
53
|
}
|
|
54
|
-
return
|
|
55
|
-
}, fromAttribute(
|
|
56
|
-
let e =
|
|
54
|
+
return n;
|
|
55
|
+
}, fromAttribute(n, t) {
|
|
56
|
+
let e = n;
|
|
57
57
|
switch (t) {
|
|
58
58
|
case Boolean:
|
|
59
|
-
e =
|
|
59
|
+
e = n !== null;
|
|
60
60
|
break;
|
|
61
61
|
case Number:
|
|
62
|
-
e =
|
|
62
|
+
e = n === null ? null : Number(n);
|
|
63
63
|
break;
|
|
64
64
|
case Object:
|
|
65
65
|
case Array:
|
|
66
66
|
try {
|
|
67
|
-
e = JSON.parse(
|
|
67
|
+
e = JSON.parse(n);
|
|
68
68
|
} catch {
|
|
69
69
|
e = null;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return e;
|
|
73
|
-
} }, K = (
|
|
73
|
+
} }, K = (n, t) => !ft(n, t), Y = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: K };
|
|
74
74
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), f.litPropertyMetadata ?? (f.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
75
|
-
class
|
|
75
|
+
class b extends HTMLElement {
|
|
76
76
|
static addInitializer(t) {
|
|
77
77
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
78
78
|
}
|
|
@@ -81,67 +81,67 @@ class w extends HTMLElement {
|
|
|
81
81
|
}
|
|
82
82
|
static createProperty(t, e = Y) {
|
|
83
83
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
84
|
-
const
|
|
85
|
-
|
|
84
|
+
const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
|
85
|
+
s !== void 0 && gt(this.prototype, t, s);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
static getPropertyDescriptor(t, e,
|
|
89
|
-
const { get:
|
|
88
|
+
static getPropertyDescriptor(t, e, i) {
|
|
89
|
+
const { get: s, set: r } = mt(this.prototype, t) ?? { get() {
|
|
90
90
|
return this[e];
|
|
91
91
|
}, set(o) {
|
|
92
92
|
this[e] = o;
|
|
93
93
|
} };
|
|
94
94
|
return { get() {
|
|
95
|
-
return
|
|
95
|
+
return s == null ? void 0 : s.call(this);
|
|
96
96
|
}, set(o) {
|
|
97
|
-
const
|
|
98
|
-
|
|
97
|
+
const c = s == null ? void 0 : s.call(this);
|
|
98
|
+
r.call(this, o), this.requestUpdate(t, c, i);
|
|
99
99
|
}, configurable: !0, enumerable: !0 };
|
|
100
100
|
}
|
|
101
101
|
static getPropertyOptions(t) {
|
|
102
102
|
return this.elementProperties.get(t) ?? Y;
|
|
103
103
|
}
|
|
104
104
|
static _$Ei() {
|
|
105
|
-
if (this.hasOwnProperty(
|
|
105
|
+
if (this.hasOwnProperty(T("elementProperties")))
|
|
106
106
|
return;
|
|
107
107
|
const t = wt(this);
|
|
108
108
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
109
109
|
}
|
|
110
110
|
static finalize() {
|
|
111
|
-
if (this.hasOwnProperty(
|
|
111
|
+
if (this.hasOwnProperty(T("finalized")))
|
|
112
112
|
return;
|
|
113
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
114
|
-
const e = this.properties,
|
|
115
|
-
for (const
|
|
116
|
-
this.createProperty(
|
|
113
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
|
|
114
|
+
const e = this.properties, i = [...yt(e), ...At(e)];
|
|
115
|
+
for (const s of i)
|
|
116
|
+
this.createProperty(s, e[s]);
|
|
117
117
|
}
|
|
118
118
|
const t = this[Symbol.metadata];
|
|
119
119
|
if (t !== null) {
|
|
120
120
|
const e = litPropertyMetadata.get(t);
|
|
121
121
|
if (e !== void 0)
|
|
122
|
-
for (const [
|
|
123
|
-
this.elementProperties.set(
|
|
122
|
+
for (const [i, s] of e)
|
|
123
|
+
this.elementProperties.set(i, s);
|
|
124
124
|
}
|
|
125
125
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
126
|
-
for (const [e,
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
for (const [e, i] of this.elementProperties) {
|
|
127
|
+
const s = this._$Eu(e, i);
|
|
128
|
+
s !== void 0 && this._$Eh.set(s, e);
|
|
129
129
|
}
|
|
130
130
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
131
131
|
}
|
|
132
132
|
static finalizeStyles(t) {
|
|
133
133
|
const e = [];
|
|
134
134
|
if (Array.isArray(t)) {
|
|
135
|
-
const
|
|
136
|
-
for (const
|
|
137
|
-
e.unshift(G(
|
|
135
|
+
const i = new Set(t.flat(1 / 0).reverse());
|
|
136
|
+
for (const s of i)
|
|
137
|
+
e.unshift(G(s));
|
|
138
138
|
} else
|
|
139
139
|
t !== void 0 && e.push(G(t));
|
|
140
140
|
return e;
|
|
141
141
|
}
|
|
142
142
|
static _$Eu(t, e) {
|
|
143
|
-
const
|
|
144
|
-
return
|
|
143
|
+
const i = e.attribute;
|
|
144
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
145
145
|
}
|
|
146
146
|
constructor() {
|
|
147
147
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -160,8 +160,8 @@ class w extends HTMLElement {
|
|
|
160
160
|
}
|
|
161
161
|
_$E_() {
|
|
162
162
|
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
163
|
-
for (const
|
|
164
|
-
this.hasOwnProperty(
|
|
163
|
+
for (const i of e.keys())
|
|
164
|
+
this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
165
165
|
t.size > 0 && (this._$Ep = t);
|
|
166
166
|
}
|
|
167
167
|
createRenderRoot() {
|
|
@@ -171,8 +171,8 @@ class w extends HTMLElement {
|
|
|
171
171
|
connectedCallback() {
|
|
172
172
|
var t;
|
|
173
173
|
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
174
|
-
var
|
|
175
|
-
return (
|
|
174
|
+
var i;
|
|
175
|
+
return (i = e.hostConnected) == null ? void 0 : i.call(e);
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
enableUpdating(t) {
|
|
@@ -180,39 +180,39 @@ class w extends HTMLElement {
|
|
|
180
180
|
disconnectedCallback() {
|
|
181
181
|
var t;
|
|
182
182
|
(t = this._$EO) == null || t.forEach((e) => {
|
|
183
|
-
var
|
|
184
|
-
return (
|
|
183
|
+
var i;
|
|
184
|
+
return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
attributeChangedCallback(t, e,
|
|
188
|
-
this._$AK(t,
|
|
187
|
+
attributeChangedCallback(t, e, i) {
|
|
188
|
+
this._$AK(t, i);
|
|
189
189
|
}
|
|
190
190
|
_$EC(t, e) {
|
|
191
|
-
var
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
const o = (((
|
|
195
|
-
this._$Em = t, o == null ? this.removeAttribute(
|
|
191
|
+
var r;
|
|
192
|
+
const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
|
|
193
|
+
if (s !== void 0 && i.reflect === !0) {
|
|
194
|
+
const o = (((r = i.converter) == null ? void 0 : r.toAttribute) !== void 0 ? i.converter : B).toAttribute(e, i.type);
|
|
195
|
+
this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
_$AK(t, e) {
|
|
199
|
-
var
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
const o =
|
|
203
|
-
this._$Em =
|
|
199
|
+
var r;
|
|
200
|
+
const i = this.constructor, s = i._$Eh.get(t);
|
|
201
|
+
if (s !== void 0 && this._$Em !== s) {
|
|
202
|
+
const o = i.getPropertyOptions(s), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((r = o.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? o.converter : B;
|
|
203
|
+
this._$Em = s, this[s] = c.fromAttribute(e, o.type), this._$Em = null;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
requestUpdate(t, e,
|
|
206
|
+
requestUpdate(t, e, i) {
|
|
207
207
|
if (t !== void 0) {
|
|
208
|
-
if (
|
|
208
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? K)(this[t], e))
|
|
209
209
|
return;
|
|
210
|
-
this.P(t, e,
|
|
210
|
+
this.P(t, e, i);
|
|
211
211
|
}
|
|
212
212
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
213
213
|
}
|
|
214
|
-
P(t, e,
|
|
215
|
-
this._$AL.has(t) || this._$AL.set(t, e),
|
|
214
|
+
P(t, e, i) {
|
|
215
|
+
this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
|
216
216
|
}
|
|
217
217
|
async _$ET() {
|
|
218
218
|
this.isUpdatePending = !0;
|
|
@@ -228,29 +228,29 @@ class w extends HTMLElement {
|
|
|
228
228
|
return this.performUpdate();
|
|
229
229
|
}
|
|
230
230
|
performUpdate() {
|
|
231
|
-
var
|
|
231
|
+
var i;
|
|
232
232
|
if (!this.isUpdatePending)
|
|
233
233
|
return;
|
|
234
234
|
if (!this.hasUpdated) {
|
|
235
235
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
236
|
-
for (const [
|
|
237
|
-
this[
|
|
236
|
+
for (const [r, o] of this._$Ep)
|
|
237
|
+
this[r] = o;
|
|
238
238
|
this._$Ep = void 0;
|
|
239
239
|
}
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
for (const [
|
|
243
|
-
o.wrapped !== !0 || this._$AL.has(
|
|
240
|
+
const s = this.constructor.elementProperties;
|
|
241
|
+
if (s.size > 0)
|
|
242
|
+
for (const [r, o] of s)
|
|
243
|
+
o.wrapped !== !0 || this._$AL.has(r) || this[r] === void 0 || this.P(r, this[r], o);
|
|
244
244
|
}
|
|
245
245
|
let t = !1;
|
|
246
246
|
const e = this._$AL;
|
|
247
247
|
try {
|
|
248
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (
|
|
249
|
-
var
|
|
250
|
-
return (
|
|
248
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$EO) == null || i.forEach((s) => {
|
|
249
|
+
var r;
|
|
250
|
+
return (r = s.hostUpdate) == null ? void 0 : r.call(s);
|
|
251
251
|
}), this.update(e)) : this._$EU();
|
|
252
|
-
} catch (
|
|
253
|
-
throw t = !1, this._$EU(),
|
|
252
|
+
} catch (s) {
|
|
253
|
+
throw t = !1, this._$EU(), s;
|
|
254
254
|
}
|
|
255
255
|
t && this._$AE(e);
|
|
256
256
|
}
|
|
@@ -258,9 +258,9 @@ class w extends HTMLElement {
|
|
|
258
258
|
}
|
|
259
259
|
_$AE(t) {
|
|
260
260
|
var e;
|
|
261
|
-
(e = this._$EO) == null || e.forEach((
|
|
262
|
-
var
|
|
263
|
-
return (
|
|
261
|
+
(e = this._$EO) == null || e.forEach((i) => {
|
|
262
|
+
var s;
|
|
263
|
+
return (s = i.hostUpdated) == null ? void 0 : s.call(i);
|
|
264
264
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
265
265
|
}
|
|
266
266
|
_$EU() {
|
|
@@ -283,84 +283,84 @@ class w extends HTMLElement {
|
|
|
283
283
|
firstUpdated(t) {
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[T("elementProperties")] = /* @__PURE__ */ new Map(), b[T("finalized")] = /* @__PURE__ */ new Map(), D == null || D({ ReactiveElement: b }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.0.4");
|
|
287
287
|
/**
|
|
288
288
|
* @license
|
|
289
289
|
* Copyright 2017 Google LLC
|
|
290
290
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
291
291
|
*/
|
|
292
|
-
const
|
|
293
|
-
\f\r]`,
|
|
294
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
295
|
-
function pt(
|
|
296
|
-
if (!Z(
|
|
292
|
+
const N = globalThis, k = N.trustedTypes, X = k ? k.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ct = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, lt = "?" + _, bt = `<${lt}>`, y = document, H = () => y.createComment(""), M = (n) => n === null || typeof n != "object" && typeof n != "function", Z = Array.isArray, Et = (n) => Z(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", W = `[
|
|
293
|
+
\f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g, g = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
294
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), it = /'/g, st = /"/g, dt = /^(?:script|style|textarea|title)$/i, S = Symbol.for("lit-noChange"), l = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), m = y.createTreeWalker(y, 129);
|
|
295
|
+
function pt(n, t) {
|
|
296
|
+
if (!Z(n) || !n.hasOwnProperty("raw"))
|
|
297
297
|
throw Error("invalid template strings array");
|
|
298
298
|
return X !== void 0 ? X.createHTML(t) : t;
|
|
299
299
|
}
|
|
300
|
-
const St = (
|
|
301
|
-
const e =
|
|
302
|
-
let
|
|
303
|
-
for (let
|
|
304
|
-
const
|
|
305
|
-
let
|
|
306
|
-
for (; u <
|
|
307
|
-
u = o.lastIndex, o ===
|
|
308
|
-
const $ = o === g &&
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
return [pt(
|
|
300
|
+
const St = (n, t) => {
|
|
301
|
+
const e = n.length - 1, i = [];
|
|
302
|
+
let s, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = x;
|
|
303
|
+
for (let c = 0; c < e; c++) {
|
|
304
|
+
const a = n[c];
|
|
305
|
+
let d, p, h = -1, u = 0;
|
|
306
|
+
for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); )
|
|
307
|
+
u = o.lastIndex, o === x ? p[1] === "!--" ? o = tt : p[1] !== void 0 ? o = et : p[2] !== void 0 ? (dt.test(p[2]) && (s = RegExp("</" + p[2], "g")), o = g) : p[3] !== void 0 && (o = g) : o === g ? p[0] === ">" ? (o = s ?? x, h = -1) : p[1] === void 0 ? h = -2 : (h = o.lastIndex - p[2].length, d = p[1], o = p[3] === void 0 ? g : p[3] === '"' ? st : it) : o === st || o === it ? o = g : o === tt || o === et ? o = x : (o = g, s = void 0);
|
|
308
|
+
const $ = o === g && n[c + 1].startsWith("/>") ? " " : "";
|
|
309
|
+
r += o === x ? a + bt : h >= 0 ? (i.push(d), a.slice(0, h) + ct + a.slice(h) + _ + $) : a + _ + (h === -2 ? c : $);
|
|
310
|
+
}
|
|
311
|
+
return [pt(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
312
312
|
};
|
|
313
|
-
class
|
|
314
|
-
constructor({ strings: t, _$litType$: e },
|
|
315
|
-
let
|
|
313
|
+
class R {
|
|
314
|
+
constructor({ strings: t, _$litType$: e }, i) {
|
|
315
|
+
let s;
|
|
316
316
|
this.parts = [];
|
|
317
|
-
let
|
|
318
|
-
const
|
|
319
|
-
if (this.el =
|
|
320
|
-
const
|
|
321
|
-
|
|
317
|
+
let r = 0, o = 0;
|
|
318
|
+
const c = t.length - 1, a = this.parts, [d, p] = St(t, e);
|
|
319
|
+
if (this.el = R.createElement(d, i), m.currentNode = this.el.content, e === 2 || e === 3) {
|
|
320
|
+
const h = this.el.content.firstChild;
|
|
321
|
+
h.replaceWith(...h.childNodes);
|
|
322
322
|
}
|
|
323
|
-
for (; (
|
|
324
|
-
if (
|
|
325
|
-
if (
|
|
326
|
-
for (const
|
|
327
|
-
if (
|
|
328
|
-
const u = p[o++], $ =
|
|
329
|
-
|
|
323
|
+
for (; (s = m.nextNode()) !== null && a.length < c; ) {
|
|
324
|
+
if (s.nodeType === 1) {
|
|
325
|
+
if (s.hasAttributes())
|
|
326
|
+
for (const h of s.getAttributeNames())
|
|
327
|
+
if (h.endsWith(ct)) {
|
|
328
|
+
const u = p[o++], $ = s.getAttribute(h).split(_), j = /([.?@])?(.*)/.exec(u);
|
|
329
|
+
a.push({ type: 1, index: r, name: j[2], strings: $, ctor: j[1] === "." ? Pt : j[1] === "?" ? Ct : j[1] === "@" ? Ot : z }), s.removeAttribute(h);
|
|
330
330
|
} else
|
|
331
|
-
|
|
332
|
-
if (dt.test(
|
|
333
|
-
const
|
|
331
|
+
h.startsWith(_) && (a.push({ type: 6, index: r }), s.removeAttribute(h));
|
|
332
|
+
if (dt.test(s.tagName)) {
|
|
333
|
+
const h = s.textContent.split(_), u = h.length - 1;
|
|
334
334
|
if (u > 0) {
|
|
335
|
-
|
|
335
|
+
s.textContent = k ? k.emptyScript : "";
|
|
336
336
|
for (let $ = 0; $ < u; $++)
|
|
337
|
-
|
|
338
|
-
|
|
337
|
+
s.append(h[$], H()), m.nextNode(), a.push({ type: 2, index: ++r });
|
|
338
|
+
s.append(h[u], H());
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
} else if (
|
|
342
|
-
if (
|
|
343
|
-
|
|
341
|
+
} else if (s.nodeType === 8)
|
|
342
|
+
if (s.data === lt)
|
|
343
|
+
a.push({ type: 2, index: r });
|
|
344
344
|
else {
|
|
345
|
-
let
|
|
346
|
-
for (; (
|
|
347
|
-
|
|
345
|
+
let h = -1;
|
|
346
|
+
for (; (h = s.data.indexOf(_, h + 1)) !== -1; )
|
|
347
|
+
a.push({ type: 7, index: r }), h += _.length - 1;
|
|
348
348
|
}
|
|
349
|
-
|
|
349
|
+
r++;
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
static createElement(t, e) {
|
|
353
|
-
const
|
|
354
|
-
return
|
|
353
|
+
const i = y.createElement("template");
|
|
354
|
+
return i.innerHTML = t, i;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
var o,
|
|
359
|
-
if (t ===
|
|
357
|
+
function U(n, t, e = n, i) {
|
|
358
|
+
var o, c;
|
|
359
|
+
if (t === S)
|
|
360
360
|
return t;
|
|
361
|
-
let
|
|
362
|
-
const
|
|
363
|
-
return (
|
|
361
|
+
let s = i !== void 0 ? (o = e.o) == null ? void 0 : o[i] : e.l;
|
|
362
|
+
const r = M(t) ? void 0 : t._$litDirective$;
|
|
363
|
+
return (s == null ? void 0 : s.constructor) !== r && ((c = s == null ? void 0 : s._$AO) == null || c.call(s, !1), r === void 0 ? s = void 0 : (s = new r(n), s._$AT(n, e, i)), i !== void 0 ? (e.o ?? (e.o = []))[i] = s : e.l = s), s !== void 0 && (t = U(n, s._$AS(n, t.values), s, i)), t;
|
|
364
364
|
}
|
|
365
365
|
class Ut {
|
|
366
366
|
constructor(t, e) {
|
|
@@ -373,31 +373,31 @@ class Ut {
|
|
|
373
373
|
return this._$AM._$AU;
|
|
374
374
|
}
|
|
375
375
|
u(t) {
|
|
376
|
-
const { el: { content: e }, parts:
|
|
377
|
-
m.currentNode =
|
|
378
|
-
let
|
|
379
|
-
for (;
|
|
380
|
-
if (o ===
|
|
381
|
-
let
|
|
382
|
-
|
|
376
|
+
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? y).importNode(e, !0);
|
|
377
|
+
m.currentNode = s;
|
|
378
|
+
let r = m.nextNode(), o = 0, c = 0, a = i[0];
|
|
379
|
+
for (; a !== void 0; ) {
|
|
380
|
+
if (o === a.index) {
|
|
381
|
+
let d;
|
|
382
|
+
a.type === 2 ? d = new I(r, r.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (d = new xt(r, this, t)), this._$AV.push(d), a = i[++c];
|
|
383
383
|
}
|
|
384
|
-
o !== (
|
|
384
|
+
o !== (a == null ? void 0 : a.index) && (r = m.nextNode(), o++);
|
|
385
385
|
}
|
|
386
|
-
return m.currentNode = y,
|
|
386
|
+
return m.currentNode = y, s;
|
|
387
387
|
}
|
|
388
388
|
p(t) {
|
|
389
389
|
let e = 0;
|
|
390
|
-
for (const
|
|
391
|
-
|
|
390
|
+
for (const i of this._$AV)
|
|
391
|
+
i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
class
|
|
394
|
+
class I {
|
|
395
395
|
get _$AU() {
|
|
396
396
|
var t;
|
|
397
397
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this.v;
|
|
398
398
|
}
|
|
399
|
-
constructor(t, e,
|
|
400
|
-
this.type = 2, this._$AH =
|
|
399
|
+
constructor(t, e, i, s) {
|
|
400
|
+
this.type = 2, this._$AH = l, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this.v = (s == null ? void 0 : s.isConnected) ?? !0;
|
|
401
401
|
}
|
|
402
402
|
get parentNode() {
|
|
403
403
|
let t = this._$AA.parentNode;
|
|
@@ -411,7 +411,7 @@ class H {
|
|
|
411
411
|
return this._$AB;
|
|
412
412
|
}
|
|
413
413
|
_$AI(t, e = this) {
|
|
414
|
-
t =
|
|
414
|
+
t = U(this, t, e), M(t) ? t === l || t == null || t === "" ? (this._$AH !== l && this._$AR(), this._$AH = l) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Et(t) ? this.k(t) : this._(t);
|
|
415
415
|
}
|
|
416
416
|
O(t) {
|
|
417
417
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -420,35 +420,35 @@ class H {
|
|
|
420
420
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
421
421
|
}
|
|
422
422
|
_(t) {
|
|
423
|
-
this._$AH !==
|
|
423
|
+
this._$AH !== l && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(y.createTextNode(t)), this._$AH = t;
|
|
424
424
|
}
|
|
425
425
|
$(t) {
|
|
426
|
-
var
|
|
427
|
-
const { values: e, _$litType$:
|
|
428
|
-
if (((
|
|
426
|
+
var r;
|
|
427
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = R.createElement(pt(i.h, i.h[0]), this.options)), i);
|
|
428
|
+
if (((r = this._$AH) == null ? void 0 : r._$AD) === s)
|
|
429
429
|
this._$AH.p(e);
|
|
430
430
|
else {
|
|
431
|
-
const o = new Ut(
|
|
432
|
-
o.p(e), this.T(
|
|
431
|
+
const o = new Ut(s, this), c = o.u(this.options);
|
|
432
|
+
o.p(e), this.T(c), this._$AH = o;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
_$AC(t) {
|
|
436
|
-
let e =
|
|
437
|
-
return e === void 0 &&
|
|
436
|
+
let e = nt.get(t.strings);
|
|
437
|
+
return e === void 0 && nt.set(t.strings, e = new R(t)), e;
|
|
438
438
|
}
|
|
439
439
|
k(t) {
|
|
440
440
|
Z(this._$AH) || (this._$AH = [], this._$AR());
|
|
441
441
|
const e = this._$AH;
|
|
442
|
-
let
|
|
443
|
-
for (const
|
|
444
|
-
|
|
445
|
-
|
|
442
|
+
let i, s = 0;
|
|
443
|
+
for (const r of t)
|
|
444
|
+
s === e.length ? e.push(i = new I(this.O(H()), this.O(H()), this, this.options)) : i = e[s], i._$AI(r), s++;
|
|
445
|
+
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
|
446
446
|
}
|
|
447
447
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
448
|
-
var
|
|
449
|
-
for ((
|
|
450
|
-
const
|
|
451
|
-
t.remove(), t =
|
|
448
|
+
var i;
|
|
449
|
+
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
450
|
+
const s = t.nextSibling;
|
|
451
|
+
t.remove(), t = s;
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
setConnected(t) {
|
|
@@ -456,58 +456,58 @@ class H {
|
|
|
456
456
|
this._$AM === void 0 && (this.v = t, (e = this._$AP) == null || e.call(this, t));
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
class
|
|
459
|
+
class z {
|
|
460
460
|
get tagName() {
|
|
461
461
|
return this.element.tagName;
|
|
462
462
|
}
|
|
463
463
|
get _$AU() {
|
|
464
464
|
return this._$AM._$AU;
|
|
465
465
|
}
|
|
466
|
-
constructor(t, e,
|
|
467
|
-
this.type = 1, this._$AH =
|
|
466
|
+
constructor(t, e, i, s, r) {
|
|
467
|
+
this.type = 1, this._$AH = l, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = l;
|
|
468
468
|
}
|
|
469
|
-
_$AI(t, e = this,
|
|
470
|
-
const
|
|
469
|
+
_$AI(t, e = this, i, s) {
|
|
470
|
+
const r = this.strings;
|
|
471
471
|
let o = !1;
|
|
472
|
-
if (
|
|
473
|
-
t =
|
|
472
|
+
if (r === void 0)
|
|
473
|
+
t = U(this, t, e, 0), o = !M(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
|
|
474
474
|
else {
|
|
475
|
-
const
|
|
476
|
-
let
|
|
477
|
-
for (t =
|
|
478
|
-
|
|
475
|
+
const c = t;
|
|
476
|
+
let a, d;
|
|
477
|
+
for (t = r[0], a = 0; a < r.length - 1; a++)
|
|
478
|
+
d = U(this, c[i + a], e, a), d === S && (d = this._$AH[a]), o || (o = !M(d) || d !== this._$AH[a]), d === l ? t = l : t !== l && (t += (d ?? "") + r[a + 1]), this._$AH[a] = d;
|
|
479
479
|
}
|
|
480
|
-
o && !
|
|
480
|
+
o && !s && this.j(t);
|
|
481
481
|
}
|
|
482
482
|
j(t) {
|
|
483
|
-
t ===
|
|
483
|
+
t === l ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
class Pt extends
|
|
486
|
+
class Pt extends z {
|
|
487
487
|
constructor() {
|
|
488
488
|
super(...arguments), this.type = 3;
|
|
489
489
|
}
|
|
490
490
|
j(t) {
|
|
491
|
-
this.element[this.name] = t ===
|
|
491
|
+
this.element[this.name] = t === l ? void 0 : t;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
class Ct extends
|
|
494
|
+
class Ct extends z {
|
|
495
495
|
constructor() {
|
|
496
496
|
super(...arguments), this.type = 4;
|
|
497
497
|
}
|
|
498
498
|
j(t) {
|
|
499
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
499
|
+
this.element.toggleAttribute(this.name, !!t && t !== l);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
class Ot extends
|
|
503
|
-
constructor(t, e,
|
|
504
|
-
super(t, e,
|
|
502
|
+
class Ot extends z {
|
|
503
|
+
constructor(t, e, i, s, r) {
|
|
504
|
+
super(t, e, i, s, r), this.type = 5;
|
|
505
505
|
}
|
|
506
506
|
_$AI(t, e = this) {
|
|
507
|
-
if ((t =
|
|
507
|
+
if ((t = U(this, t, e, 0) ?? l) === S)
|
|
508
508
|
return;
|
|
509
|
-
const
|
|
510
|
-
|
|
509
|
+
const i = this._$AH, s = t === l && i !== l || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, r = t !== l && (i === l || s);
|
|
510
|
+
s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
511
511
|
}
|
|
512
512
|
handleEvent(t) {
|
|
513
513
|
var e;
|
|
@@ -515,33 +515,33 @@ class Ot extends D {
|
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
class xt {
|
|
518
|
-
constructor(t, e,
|
|
519
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options =
|
|
518
|
+
constructor(t, e, i) {
|
|
519
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
520
520
|
}
|
|
521
521
|
get _$AU() {
|
|
522
522
|
return this._$AM._$AU;
|
|
523
523
|
}
|
|
524
524
|
_$AI(t) {
|
|
525
|
-
|
|
525
|
+
U(this, t);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
const V =
|
|
529
|
-
V == null || V(
|
|
530
|
-
const Tt = (
|
|
531
|
-
const
|
|
532
|
-
let
|
|
533
|
-
if (
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
return
|
|
528
|
+
const V = N.litHtmlPolyfillSupport;
|
|
529
|
+
V == null || V(R, I), (N.litHtmlVersions ?? (N.litHtmlVersions = [])).push("3.2.0");
|
|
530
|
+
const Tt = (n, t, e) => {
|
|
531
|
+
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
532
|
+
let s = i._$litPart$;
|
|
533
|
+
if (s === void 0) {
|
|
534
|
+
const r = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
535
|
+
i._$litPart$ = s = new I(t.insertBefore(H(), r), r, void 0, e ?? {});
|
|
536
|
+
}
|
|
537
|
+
return s._$AI(n), s;
|
|
538
538
|
};
|
|
539
539
|
/**
|
|
540
540
|
* @license
|
|
541
541
|
* Copyright 2017 Google LLC
|
|
542
542
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
543
543
|
*/
|
|
544
|
-
class
|
|
544
|
+
class E extends b {
|
|
545
545
|
constructor() {
|
|
546
546
|
super(...arguments), this.renderOptions = { host: this }, this.o = void 0;
|
|
547
547
|
}
|
|
@@ -563,153 +563,168 @@ class v extends w {
|
|
|
563
563
|
super.disconnectedCallback(), (t = this.o) == null || t.setConnected(!1);
|
|
564
564
|
}
|
|
565
565
|
render() {
|
|
566
|
-
return
|
|
566
|
+
return S;
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
var
|
|
570
|
-
|
|
569
|
+
var at;
|
|
570
|
+
E._$litElement$ = !0, E.finalized = !0, (at = globalThis.litElementHydrateSupport) == null || at.call(globalThis, { LitElement: E });
|
|
571
571
|
const q = globalThis.litElementPolyfillSupport;
|
|
572
|
-
q == null || q({ LitElement:
|
|
572
|
+
q == null || q({ LitElement: E });
|
|
573
573
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.0");
|
|
574
574
|
/**
|
|
575
575
|
* @license
|
|
576
576
|
* Copyright 2017 Google LLC
|
|
577
577
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
578
578
|
*/
|
|
579
|
-
const Nt = { attribute: !0, type: String, converter:
|
|
580
|
-
const { kind:
|
|
581
|
-
let
|
|
582
|
-
if (
|
|
579
|
+
const Nt = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: K }, Ht = (n = Nt, t, e) => {
|
|
580
|
+
const { kind: i, metadata: s } = e;
|
|
581
|
+
let r = globalThis.litPropertyMetadata.get(s);
|
|
582
|
+
if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), r.set(e.name, n), i === "accessor") {
|
|
583
583
|
const { name: o } = e;
|
|
584
|
-
return { set(
|
|
585
|
-
const
|
|
586
|
-
t.set.call(this,
|
|
587
|
-
}, init(
|
|
588
|
-
return
|
|
584
|
+
return { set(c) {
|
|
585
|
+
const a = t.get.call(this);
|
|
586
|
+
t.set.call(this, c), this.requestUpdate(o, a, n);
|
|
587
|
+
}, init(c) {
|
|
588
|
+
return c !== void 0 && this.P(o, void 0, n), c;
|
|
589
589
|
} };
|
|
590
590
|
}
|
|
591
|
-
if (
|
|
591
|
+
if (i === "setter") {
|
|
592
592
|
const { name: o } = e;
|
|
593
|
-
return function(
|
|
594
|
-
const
|
|
595
|
-
t.call(this,
|
|
593
|
+
return function(c) {
|
|
594
|
+
const a = this[o];
|
|
595
|
+
t.call(this, c), this.requestUpdate(o, a, n);
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
|
-
throw Error("Unsupported decorator location: " +
|
|
598
|
+
throw Error("Unsupported decorator location: " + i);
|
|
599
599
|
};
|
|
600
|
-
function A(
|
|
601
|
-
return (t, e) => typeof e == "object" ? Ht(
|
|
602
|
-
const o =
|
|
603
|
-
return
|
|
604
|
-
})(
|
|
600
|
+
function A(n) {
|
|
601
|
+
return (t, e) => typeof e == "object" ? Ht(n, t, e) : ((i, s, r) => {
|
|
602
|
+
const o = s.hasOwnProperty(r);
|
|
603
|
+
return s.constructor.createProperty(r, o ? { ...i, wrapped: !0 } : i), o ? Object.getOwnPropertyDescriptor(s, r) : void 0;
|
|
604
|
+
})(n, t, e);
|
|
605
605
|
}
|
|
606
606
|
/**
|
|
607
607
|
* @license
|
|
608
608
|
* Copyright 2017 Google LLC
|
|
609
609
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
610
610
|
*/
|
|
611
|
-
function
|
|
612
|
-
return A({ ...
|
|
611
|
+
function P(n) {
|
|
612
|
+
return A({ ...n, state: !0, attribute: !1 });
|
|
613
613
|
}
|
|
614
|
-
var Mt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor,
|
|
615
|
-
for (var
|
|
616
|
-
(o = r
|
|
617
|
-
return
|
|
614
|
+
var Mt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, C = (n, t, e, i) => {
|
|
615
|
+
for (var s = i > 1 ? void 0 : i ? Rt(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
616
|
+
(o = n[r]) && (s = (i ? o(t, e, s) : o(s)) || s);
|
|
617
|
+
return i && s && Mt(t, e, s), s;
|
|
618
618
|
};
|
|
619
|
-
const
|
|
620
|
-
|
|
619
|
+
const rt = "https://widgets.ace.teliacompany.net", ot = "https://embed.webprovisions.io", It = () => {
|
|
620
|
+
if (typeof window < "u") {
|
|
621
|
+
const n = history.pushState, t = history.replaceState;
|
|
622
|
+
history.pushState = function(...e) {
|
|
623
|
+
n.apply(history, e), window.dispatchEvent(new Event("locationchange"));
|
|
624
|
+
}, history.replaceState = function(...e) {
|
|
625
|
+
t.apply(history, e), window.dispatchEvent(new Event("locationchange"));
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
class w extends E {
|
|
621
630
|
constructor() {
|
|
622
|
-
super(...arguments), this.apiUrl =
|
|
631
|
+
super(...arguments), this.apiUrl = rt, this.embedUrl = ot, this._site = null, this._widgets = {}, this._path = "";
|
|
623
632
|
}
|
|
624
633
|
async connectedCallback() {
|
|
625
|
-
super.connectedCallback(), await this.loadSite();
|
|
634
|
+
super.connectedCallback(), It(), await this.loadSite(), window.addEventListener("locationchange", this.routeChangeListener);
|
|
635
|
+
}
|
|
636
|
+
disconnectedCallback() {
|
|
637
|
+
super.disconnectedCallback(), window.removeEventListener("locationchange", this.routeChangeListener);
|
|
626
638
|
}
|
|
627
|
-
|
|
628
|
-
|
|
639
|
+
routeChangeListener() {
|
|
640
|
+
this._site && (this._path = window.location.pathname);
|
|
629
641
|
}
|
|
630
642
|
async loadSite() {
|
|
631
|
-
var
|
|
643
|
+
var i;
|
|
632
644
|
const e = await (await fetch(`${this.apiUrl}/api/site/${this.siteId}`)).json();
|
|
633
|
-
this._site = e, (((
|
|
634
|
-
this.addWidgetEl(
|
|
645
|
+
this._site = e, (((i = this._site) == null ? void 0 : i.widgets) || []).forEach(async (s) => {
|
|
646
|
+
this.addWidgetEl(s.widgetId);
|
|
635
647
|
});
|
|
636
648
|
}
|
|
637
649
|
addWidgetEl(t) {
|
|
638
650
|
const e = `ace-widget_${t}`;
|
|
639
|
-
let
|
|
640
|
-
|
|
651
|
+
let i = document.getElementById(e);
|
|
652
|
+
i || (i = document.createElement("ace-widget-wrapper"), i.setAttribute("id", e), i.setAttribute("widgetId", t), this.apiUrl !== rt && i.setAttribute("apiUrl", this.apiUrl), this.embedUrl !== ot && i.setAttribute("embedUrl", this.embedUrl), document.body.appendChild(i)), this._widgets = {
|
|
641
653
|
...this._widgets,
|
|
642
|
-
[t]:
|
|
654
|
+
[t]: i
|
|
643
655
|
}, window.ace = window.ace || {
|
|
644
656
|
_c: [],
|
|
645
657
|
_w: [],
|
|
646
|
-
widget: function(
|
|
647
|
-
window.ace._w.push([
|
|
658
|
+
widget: function(s, r) {
|
|
659
|
+
window.ace._w.push([s, r]);
|
|
648
660
|
},
|
|
649
|
-
configure: function(
|
|
650
|
-
window.ace._c.push(
|
|
661
|
+
configure: function(s) {
|
|
662
|
+
window.ace._c.push(s);
|
|
651
663
|
}
|
|
652
664
|
};
|
|
653
665
|
}
|
|
654
|
-
|
|
666
|
+
render() {
|
|
655
667
|
if (!this._site)
|
|
656
|
-
return
|
|
657
|
-
const t =
|
|
658
|
-
(
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
if ((n.value === s || n.value === "*") && o) {
|
|
664
|
-
let l = { widgetId: "" };
|
|
665
|
-
try {
|
|
666
|
-
l = JSON.parse(n.action.data);
|
|
667
|
-
} catch {
|
|
668
|
-
l = {
|
|
669
|
-
widgetId: ""
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
const p = t.findIndex(
|
|
673
|
-
(u) => u.widgetId === l.widgetId
|
|
674
|
-
) > -1, c = (((h = this._site) == null ? void 0 : h.widgets) || []).find(
|
|
675
|
-
(u) => u.widgetId === l.widgetId
|
|
676
|
-
);
|
|
677
|
-
c && !p && t.push(c);
|
|
678
|
-
}
|
|
679
|
-
});
|
|
680
|
-
});
|
|
681
|
-
for await (const e of t) {
|
|
682
|
-
const s = this._widgets[e.widgetId];
|
|
683
|
-
s && s.activate();
|
|
684
|
-
}
|
|
685
|
-
return d;
|
|
668
|
+
return l;
|
|
669
|
+
const t = jt(this._site);
|
|
670
|
+
for (const [e, i] of Object.entries(this._widgets))
|
|
671
|
+
t.find(
|
|
672
|
+
(r) => r.widgetId === e
|
|
673
|
+
) ? i.isActivated() || i.activate() : i.isActivated() && i.deactivate();
|
|
674
|
+
return l;
|
|
686
675
|
}
|
|
687
676
|
}
|
|
688
|
-
|
|
677
|
+
C([
|
|
689
678
|
A({ attribute: !0 })
|
|
690
|
-
],
|
|
691
|
-
|
|
679
|
+
], w.prototype, "siteId", 2);
|
|
680
|
+
C([
|
|
692
681
|
A()
|
|
693
|
-
],
|
|
694
|
-
|
|
682
|
+
], w.prototype, "apiUrl", 2);
|
|
683
|
+
C([
|
|
695
684
|
A()
|
|
696
|
-
],
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
],
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
],
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
685
|
+
], w.prototype, "embedUrl", 2);
|
|
686
|
+
C([
|
|
687
|
+
P()
|
|
688
|
+
], w.prototype, "_site", 2);
|
|
689
|
+
C([
|
|
690
|
+
P()
|
|
691
|
+
], w.prototype, "_widgets", 2);
|
|
692
|
+
C([
|
|
693
|
+
P()
|
|
694
|
+
], w.prototype, "_path", 2);
|
|
695
|
+
const jt = (n) => {
|
|
696
|
+
const t = [];
|
|
697
|
+
return (n.triggers || []).filter((e) => e.triggerType === "visit").forEach((e) => {
|
|
698
|
+
const i = window.location.pathname, s = e.condition.outputs || [];
|
|
699
|
+
e.condition.type === "url" && s.forEach((r) => {
|
|
700
|
+
const o = r.action.type === "render_widget";
|
|
701
|
+
if ((r.value === i || r.value === "*") && o) {
|
|
702
|
+
let a = { widgetId: "" };
|
|
703
|
+
try {
|
|
704
|
+
a = JSON.parse(r.action.data);
|
|
705
|
+
} catch {
|
|
706
|
+
a = {
|
|
707
|
+
widgetId: ""
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
const d = t.findIndex((h) => h.widgetId === a.widgetId) > -1, p = ((n == null ? void 0 : n.widgets) || []).find(
|
|
711
|
+
(h) => h.widgetId === a.widgetId
|
|
712
|
+
);
|
|
713
|
+
p && !d && t.push(p);
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
}), t;
|
|
717
|
+
};
|
|
718
|
+
window.customElements.get("ace-site") || window.customElements.define("ace-site", w);
|
|
719
|
+
var Lt = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, O = (n, t, e, i) => {
|
|
720
|
+
for (var s = i > 1 ? void 0 : i ? Bt(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
721
|
+
(o = n[r]) && (s = (i ? o(t, e, s) : o(s)) || s);
|
|
722
|
+
return i && s && Lt(t, e, s), s;
|
|
708
723
|
};
|
|
709
724
|
const kt = "https://widgets.ace.teliacompany.net", zt = "https://embed.webprovisions.io";
|
|
710
|
-
class
|
|
725
|
+
class v extends E {
|
|
711
726
|
constructor() {
|
|
712
|
-
super(...arguments), this.apiUrl = kt, this.embedUrl = zt, this.widget = null, this.scriptEl = null;
|
|
727
|
+
super(...arguments), this.apiUrl = kt, this.embedUrl = zt, this.widget = null, this.scriptEl = null, this.activated = !1;
|
|
713
728
|
}
|
|
714
729
|
async connectedCallback() {
|
|
715
730
|
super.connectedCallback(), this.widget = await this._loadWidget(this.widgetId);
|
|
@@ -727,30 +742,39 @@ class U extends v {
|
|
|
727
742
|
`${this.embedUrl}/d/${this.widget.organization}/${this.widget.distributionName}@latest/index.js`
|
|
728
743
|
), this.scriptEl = t;
|
|
729
744
|
}
|
|
745
|
+
isActivated() {
|
|
746
|
+
return this.activated;
|
|
747
|
+
}
|
|
730
748
|
async activate() {
|
|
731
|
-
this.widget || (this.widget = await this._loadWidget(this.widgetId)), this._createEmbedScript();
|
|
749
|
+
this.widget || (this.widget = await this._loadWidget(this.widgetId)), this._createEmbedScript(), console.log("activating"), this.activated = !0;
|
|
750
|
+
}
|
|
751
|
+
async deactivate() {
|
|
752
|
+
console.log("deactivating"), this.activated = !1;
|
|
732
753
|
}
|
|
733
754
|
render() {
|
|
734
|
-
return this.scriptEl ? this.scriptEl :
|
|
755
|
+
return this.scriptEl ? this.scriptEl : l;
|
|
735
756
|
}
|
|
736
757
|
}
|
|
737
|
-
|
|
758
|
+
O([
|
|
738
759
|
A({ attribute: !0 })
|
|
739
|
-
],
|
|
740
|
-
|
|
760
|
+
], v.prototype, "widgetId", 2);
|
|
761
|
+
O([
|
|
741
762
|
A()
|
|
742
|
-
],
|
|
743
|
-
|
|
763
|
+
], v.prototype, "apiUrl", 2);
|
|
764
|
+
O([
|
|
744
765
|
A()
|
|
745
|
-
],
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
],
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
],
|
|
752
|
-
|
|
766
|
+
], v.prototype, "embedUrl", 2);
|
|
767
|
+
O([
|
|
768
|
+
P()
|
|
769
|
+
], v.prototype, "widget", 2);
|
|
770
|
+
O([
|
|
771
|
+
P()
|
|
772
|
+
], v.prototype, "scriptEl", 2);
|
|
773
|
+
O([
|
|
774
|
+
P()
|
|
775
|
+
], v.prototype, "activated", 2);
|
|
776
|
+
customElements.get("ace-widget-wrapper") || customElements.define("ace-widget-wrapper", v);
|
|
753
777
|
export {
|
|
754
|
-
|
|
755
|
-
|
|
778
|
+
w as SiteComponent,
|
|
779
|
+
v as WidgetComponent
|
|
756
780
|
};
|