@vouchfor/embeds 0.0.0-experiment.ace6cf6 → 0.0.0-experiment.ae8c0d8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/embeds.js +437 -321
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/{components → src/components}/Embed/controllers/fetcher.d.ts +1 -0
- package/dist/es/{components → src/components}/Embed/controllers/tracking.d.ts +4 -0
- package/dist/es/{components → src/components}/Embed/index.d.ts +5 -1
- package/dist/iife/embeds.iife.js +387 -261
- package/dist/iife/embeds.iife.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Embed/Embed.stories.ts +14 -1
- package/src/components/Embed/controllers/fetcher.ts +27 -8
- package/src/components/Embed/controllers/tracking.ts +74 -50
- package/src/components/Embed/index.ts +20 -5
- /package/dist/es/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/es/{utils → src/utils}/env.d.ts +0 -0
- /package/dist/es/{utils → src/utils}/events.d.ts +0 -0
package/dist/es/embeds.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { property as
|
2
|
-
import { ifDefined as
|
3
|
-
import { createRef as
|
4
|
-
import { Task as
|
1
|
+
import { property as y, state as Wt, customElement as de } from "lit/decorators.js";
|
2
|
+
import { ifDefined as gt } from "lit/directives/if-defined.js";
|
3
|
+
import { createRef as qt, ref as Xt } from "lit/directives/ref.js";
|
4
|
+
import { Task as yt } from "@lit/task";
|
5
5
|
import { v4 as P } from "uuid";
|
6
6
|
import "@vouchfor/media-player";
|
7
7
|
/**
|
@@ -9,10 +9,10 @@ import "@vouchfor/media-player";
|
|
9
9
|
* Copyright 2019 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
11
|
*/
|
12
|
-
const G = globalThis, _t = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
13
|
-
let
|
12
|
+
const G = globalThis, _t = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Jt = Symbol(), vt = /* @__PURE__ */ new WeakMap();
|
13
|
+
let ce = class {
|
14
14
|
constructor(t, e, i) {
|
15
|
-
if (this._$cssResult$ = !0, i !==
|
15
|
+
if (this._$cssResult$ = !0, i !== Jt)
|
16
16
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
17
17
|
this.cssText = t, this.t = e;
|
18
18
|
}
|
@@ -21,7 +21,7 @@ let le = class {
|
|
21
21
|
const e = this.t;
|
22
22
|
if (_t && t === void 0) {
|
23
23
|
const i = e !== void 0 && e.length === 1;
|
24
|
-
i && (t =
|
24
|
+
i && (t = vt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && vt.set(e, t));
|
25
25
|
}
|
26
26
|
return t;
|
27
27
|
}
|
@@ -29,7 +29,7 @@ let le = class {
|
|
29
29
|
return this.cssText;
|
30
30
|
}
|
31
31
|
};
|
32
|
-
const
|
32
|
+
const pe = (r) => new ce(typeof r == "string" ? r : r + "", void 0, Jt), ue = (r, t) => {
|
33
33
|
if (_t)
|
34
34
|
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
35
35
|
else
|
@@ -37,21 +37,21 @@ const ce = (r) => new le(typeof r == "string" ? r : r + "", void 0, Wt), de = (r
|
|
37
37
|
const i = document.createElement("style"), s = G.litNonce;
|
38
38
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
|
39
39
|
}
|
40
|
-
},
|
40
|
+
}, At = _t ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
41
41
|
let e = "";
|
42
42
|
for (const i of t.cssRules)
|
43
43
|
e += i.cssText;
|
44
|
-
return
|
44
|
+
return pe(e);
|
45
45
|
})(r) : r;
|
46
46
|
/**
|
47
47
|
* @license
|
48
48
|
* Copyright 2017 Google LLC
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
50
50
|
*/
|
51
|
-
const { is:
|
51
|
+
const { is: _e, defineProperty: me, getOwnPropertyDescriptor: $e, getOwnPropertyNames: fe, getOwnPropertySymbols: ge, getPrototypeOf: ye } = Object, b = globalThis, bt = b.trustedTypes, ve = bt ? bt.emptyScript : "", rt = b.reactiveElementPolyfillSupport, I = (r, t) => r, ct = { toAttribute(r, t) {
|
52
52
|
switch (t) {
|
53
53
|
case Boolean:
|
54
|
-
r = r ?
|
54
|
+
r = r ? ve : null;
|
55
55
|
break;
|
56
56
|
case Object:
|
57
57
|
case Array:
|
@@ -76,23 +76,23 @@ const { is: pe, defineProperty: ue, getOwnPropertyDescriptor: _e, getOwnProperty
|
|
76
76
|
}
|
77
77
|
}
|
78
78
|
return e;
|
79
|
-
} },
|
80
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
81
|
-
let
|
79
|
+
} }, Kt = (r, t) => !_e(r, t), Et = { attribute: !0, type: String, converter: ct, reflect: !1, hasChanged: Kt };
|
80
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), b.litPropertyMetadata ?? (b.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
81
|
+
let N = class extends HTMLElement {
|
82
82
|
static addInitializer(t) {
|
83
83
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
84
84
|
}
|
85
85
|
static get observedAttributes() {
|
86
86
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
87
87
|
}
|
88
|
-
static createProperty(t, e =
|
88
|
+
static createProperty(t, e = Et) {
|
89
89
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
90
90
|
const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
91
|
-
s !== void 0 &&
|
91
|
+
s !== void 0 && me(this.prototype, t, s);
|
92
92
|
}
|
93
93
|
}
|
94
94
|
static getPropertyDescriptor(t, e, i) {
|
95
|
-
const { get: s, set: n } =
|
95
|
+
const { get: s, set: n } = $e(this.prototype, t) ?? { get() {
|
96
96
|
return this[e];
|
97
97
|
}, set(o) {
|
98
98
|
this[e] = o;
|
@@ -100,24 +100,24 @@ let L = class extends HTMLElement {
|
|
100
100
|
return { get() {
|
101
101
|
return s == null ? void 0 : s.call(this);
|
102
102
|
}, set(o) {
|
103
|
-
const
|
104
|
-
n.call(this, o), this.requestUpdate(t,
|
103
|
+
const h = s == null ? void 0 : s.call(this);
|
104
|
+
n.call(this, o), this.requestUpdate(t, h, i);
|
105
105
|
}, configurable: !0, enumerable: !0 };
|
106
106
|
}
|
107
107
|
static getPropertyOptions(t) {
|
108
|
-
return this.elementProperties.get(t) ??
|
108
|
+
return this.elementProperties.get(t) ?? Et;
|
109
109
|
}
|
110
110
|
static _$Ei() {
|
111
111
|
if (this.hasOwnProperty(I("elementProperties")))
|
112
112
|
return;
|
113
|
-
const t =
|
113
|
+
const t = ye(this);
|
114
114
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
115
115
|
}
|
116
116
|
static finalize() {
|
117
117
|
if (this.hasOwnProperty(I("finalized")))
|
118
118
|
return;
|
119
119
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(I("properties"))) {
|
120
|
-
const e = this.properties, i = [
|
120
|
+
const e = this.properties, i = [...fe(e), ...ge(e)];
|
121
121
|
for (const s of i)
|
122
122
|
this.createProperty(s, e[s]);
|
123
123
|
}
|
@@ -140,9 +140,9 @@ let L = class extends HTMLElement {
|
|
140
140
|
if (Array.isArray(t)) {
|
141
141
|
const i = new Set(t.flat(1 / 0).reverse());
|
142
142
|
for (const s of i)
|
143
|
-
e.unshift(
|
143
|
+
e.unshift(At(s));
|
144
144
|
} else
|
145
|
-
t !== void 0 && e.push(
|
145
|
+
t !== void 0 && e.push(At(t));
|
146
146
|
return e;
|
147
147
|
}
|
148
148
|
static _$Eu(t, e) {
|
@@ -172,7 +172,7 @@ let L = class extends HTMLElement {
|
|
172
172
|
}
|
173
173
|
createRenderRoot() {
|
174
174
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
175
|
-
return
|
175
|
+
return ue(t, this.constructor.elementStyles), t;
|
176
176
|
}
|
177
177
|
connectedCallback() {
|
178
178
|
var t;
|
@@ -197,7 +197,7 @@ let L = class extends HTMLElement {
|
|
197
197
|
var n;
|
198
198
|
const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
|
199
199
|
if (s !== void 0 && i.reflect === !0) {
|
200
|
-
const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter :
|
200
|
+
const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : ct).toAttribute(e, i.type);
|
201
201
|
this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
202
202
|
}
|
203
203
|
}
|
@@ -205,13 +205,13 @@ let L = class extends HTMLElement {
|
|
205
205
|
var n;
|
206
206
|
const i = this.constructor, s = i._$Eh.get(t);
|
207
207
|
if (s !== void 0 && this._$Em !== s) {
|
208
|
-
const o = i.getPropertyOptions(s),
|
209
|
-
this._$Em = s, this[s] =
|
208
|
+
const o = i.getPropertyOptions(s), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : ct;
|
209
|
+
this._$Em = s, this[s] = h.fromAttribute(e, o.type), this._$Em = null;
|
210
210
|
}
|
211
211
|
}
|
212
212
|
requestUpdate(t, e, i, s = !1, n) {
|
213
213
|
if (t !== void 0) {
|
214
|
-
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ??
|
214
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? Kt)(s ? n : this[t], e))
|
215
215
|
return;
|
216
216
|
this.C(t, e, i);
|
217
217
|
}
|
@@ -289,86 +289,86 @@ let L = class extends HTMLElement {
|
|
289
289
|
firstUpdated(t) {
|
290
290
|
}
|
291
291
|
};
|
292
|
-
|
292
|
+
N.elementStyles = [], N.shadowRootOptions = { mode: "open" }, N[I("elementProperties")] = /* @__PURE__ */ new Map(), N[I("finalized")] = /* @__PURE__ */ new Map(), rt == null || rt({ ReactiveElement: N }), (b.reactiveElementVersions ?? (b.reactiveElementVersions = [])).push("2.0.2");
|
293
293
|
/**
|
294
294
|
* @license
|
295
295
|
* Copyright 2017 Google LLC
|
296
296
|
* SPDX-License-Identifier: BSD-3-Clause
|
297
297
|
*/
|
298
|
-
const V = globalThis, Y = V.trustedTypes,
|
299
|
-
\f\r]`,
|
300
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
301
|
-
function
|
298
|
+
const V = globalThis, Y = V.trustedTypes, St = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Ft = "$lit$", v = `lit$${(Math.random() + "").slice(9)}$`, Gt = "?" + v, Ae = `<${Gt}>`, T = document, Q = () => T.createComment(""), B = (r) => r === null || typeof r != "object" && typeof r != "function", Zt = Array.isArray, be = (r) => Zt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", nt = `[
|
299
|
+
\f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, Pt = />/g, S = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
|
300
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Ut = /"/g, Yt = /^(?:script|style|textarea|title)$/i, W = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Tt = /* @__PURE__ */ new WeakMap(), C = T.createTreeWalker(T, 129);
|
301
|
+
function Qt(r, t) {
|
302
302
|
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
303
303
|
throw Error("invalid template strings array");
|
304
|
-
return
|
304
|
+
return St !== void 0 ? St.createHTML(t) : t;
|
305
305
|
}
|
306
|
-
const
|
306
|
+
const Ee = (r, t) => {
|
307
307
|
const e = r.length - 1, i = [];
|
308
|
-
let s, n = t === 2 ? "<svg>" : "", o =
|
309
|
-
for (let
|
310
|
-
const
|
311
|
-
let
|
312
|
-
for (; p <
|
313
|
-
p = o.lastIndex, o ===
|
314
|
-
const u = o ===
|
315
|
-
n += o ===
|
316
|
-
}
|
317
|
-
return [
|
308
|
+
let s, n = t === 2 ? "<svg>" : "", o = L;
|
309
|
+
for (let h = 0; h < e; h++) {
|
310
|
+
const a = r[h];
|
311
|
+
let d, c, l = -1, p = 0;
|
312
|
+
for (; p < a.length && (o.lastIndex = p, c = o.exec(a), c !== null); )
|
313
|
+
p = o.lastIndex, o === L ? c[1] === "!--" ? o = wt : c[1] !== void 0 ? o = Pt : c[2] !== void 0 ? (Yt.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = S) : c[3] !== void 0 && (o = S) : o === S ? c[0] === ">" ? (o = s ?? L, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, d = c[1], o = c[3] === void 0 ? S : c[3] === '"' ? Ut : Ct) : o === Ut || o === Ct ? o = S : o === wt || o === Pt ? o = L : (o = S, s = void 0);
|
314
|
+
const u = o === S && r[h + 1].startsWith("/>") ? " " : "";
|
315
|
+
n += o === L ? a + Ae : l >= 0 ? (i.push(d), a.slice(0, l) + Ft + a.slice(l) + v + u) : a + v + (l === -2 ? h : u);
|
316
|
+
}
|
317
|
+
return [Qt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
318
318
|
};
|
319
|
-
let pt = class
|
319
|
+
let pt = class te {
|
320
320
|
constructor({ strings: t, _$litType$: e }, i) {
|
321
321
|
let s;
|
322
322
|
this.parts = [];
|
323
323
|
let n = 0, o = 0;
|
324
|
-
const
|
325
|
-
if (this.el =
|
324
|
+
const h = t.length - 1, a = this.parts, [d, c] = Ee(t, e);
|
325
|
+
if (this.el = te.createElement(d, i), C.currentNode = this.el.content, e === 2) {
|
326
326
|
const l = this.el.content.firstChild;
|
327
327
|
l.replaceWith(...l.childNodes);
|
328
328
|
}
|
329
|
-
for (; (s = C.nextNode()) !== null &&
|
329
|
+
for (; (s = C.nextNode()) !== null && a.length < h; ) {
|
330
330
|
if (s.nodeType === 1) {
|
331
331
|
if (s.hasAttributes())
|
332
332
|
for (const l of s.getAttributeNames())
|
333
|
-
if (l.endsWith(
|
334
|
-
const p =
|
335
|
-
|
333
|
+
if (l.endsWith(Ft)) {
|
334
|
+
const p = c[o++], u = s.getAttribute(l).split(v), g = /([.?@])?(.*)/.exec(p);
|
335
|
+
a.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? we : g[1] === "?" ? Pe : g[1] === "@" ? Ce : it }), s.removeAttribute(l);
|
336
336
|
} else
|
337
|
-
l.startsWith(
|
338
|
-
if (
|
339
|
-
const l = s.textContent.split(
|
337
|
+
l.startsWith(v) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
|
338
|
+
if (Yt.test(s.tagName)) {
|
339
|
+
const l = s.textContent.split(v), p = l.length - 1;
|
340
340
|
if (p > 0) {
|
341
341
|
s.textContent = Y ? Y.emptyScript : "";
|
342
342
|
for (let u = 0; u < p; u++)
|
343
|
-
s.append(l[u], Q()), C.nextNode(),
|
343
|
+
s.append(l[u], Q()), C.nextNode(), a.push({ type: 2, index: ++n });
|
344
344
|
s.append(l[p], Q());
|
345
345
|
}
|
346
346
|
}
|
347
347
|
} else if (s.nodeType === 8)
|
348
|
-
if (s.data ===
|
349
|
-
|
348
|
+
if (s.data === Gt)
|
349
|
+
a.push({ type: 2, index: n });
|
350
350
|
else {
|
351
351
|
let l = -1;
|
352
|
-
for (; (l = s.data.indexOf(
|
353
|
-
|
352
|
+
for (; (l = s.data.indexOf(v, l + 1)) !== -1; )
|
353
|
+
a.push({ type: 7, index: n }), l += v.length - 1;
|
354
354
|
}
|
355
355
|
n++;
|
356
356
|
}
|
357
357
|
}
|
358
358
|
static createElement(t, e) {
|
359
|
-
const i =
|
359
|
+
const i = T.createElement("template");
|
360
360
|
return i.innerHTML = t, i;
|
361
361
|
}
|
362
362
|
};
|
363
363
|
function H(r, t, e = r, i) {
|
364
|
-
var o,
|
364
|
+
var o, h;
|
365
365
|
if (t === W)
|
366
366
|
return t;
|
367
367
|
let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
|
368
368
|
const n = B(t) ? void 0 : t._$litDirective$;
|
369
|
-
return (s == null ? void 0 : s.constructor) !== n && ((
|
369
|
+
return (s == null ? void 0 : s.constructor) !== n && ((h = s == null ? void 0 : s._$AO) == null || h.call(s, !1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = H(r, s._$AS(r, t.values), s, i)), t;
|
370
370
|
}
|
371
|
-
let
|
371
|
+
let Se = class {
|
372
372
|
constructor(t, e) {
|
373
373
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
374
374
|
}
|
@@ -379,24 +379,24 @@ let Ee = class {
|
|
379
379
|
return this._$AM._$AU;
|
380
380
|
}
|
381
381
|
u(t) {
|
382
|
-
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ??
|
382
|
+
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? T).importNode(e, !0);
|
383
383
|
C.currentNode = s;
|
384
|
-
let n = C.nextNode(), o = 0,
|
385
|
-
for (;
|
386
|
-
if (o ===
|
387
|
-
let
|
388
|
-
|
384
|
+
let n = C.nextNode(), o = 0, h = 0, a = i[0];
|
385
|
+
for (; a !== void 0; ) {
|
386
|
+
if (o === a.index) {
|
387
|
+
let d;
|
388
|
+
a.type === 2 ? d = new ee(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ue(n, this, t)), this._$AV.push(d), a = i[++h];
|
389
389
|
}
|
390
|
-
o !== (
|
390
|
+
o !== (a == null ? void 0 : a.index) && (n = C.nextNode(), o++);
|
391
391
|
}
|
392
|
-
return C.currentNode =
|
392
|
+
return C.currentNode = T, s;
|
393
393
|
}
|
394
394
|
p(t) {
|
395
395
|
let e = 0;
|
396
396
|
for (const i of this._$AV)
|
397
397
|
i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
398
398
|
}
|
399
|
-
},
|
399
|
+
}, ee = class ie {
|
400
400
|
get _$AU() {
|
401
401
|
var t;
|
402
402
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
@@ -416,7 +416,7 @@ let Ee = class {
|
|
416
416
|
return this._$AB;
|
417
417
|
}
|
418
418
|
_$AI(t, e = this) {
|
419
|
-
t = H(this, t, e), B(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== W && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) :
|
419
|
+
t = H(this, t, e), B(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== W && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : be(t) ? this.T(t) : this._(t);
|
420
420
|
}
|
421
421
|
k(t) {
|
422
422
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
@@ -425,28 +425,28 @@ let Ee = class {
|
|
425
425
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
426
426
|
}
|
427
427
|
_(t) {
|
428
|
-
this._$AH !== _ && B(this._$AH) ? this._$AA.nextSibling.data = t : this.$(
|
428
|
+
this._$AH !== _ && B(this._$AH) ? this._$AA.nextSibling.data = t : this.$(T.createTextNode(t)), this._$AH = t;
|
429
429
|
}
|
430
430
|
g(t) {
|
431
431
|
var n;
|
432
|
-
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = pt.createElement(
|
432
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = pt.createElement(Qt(i.h, i.h[0]), this.options)), i);
|
433
433
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
|
434
434
|
this._$AH.p(e);
|
435
435
|
else {
|
436
|
-
const o = new
|
437
|
-
o.p(e), this.$(
|
436
|
+
const o = new Se(s, this), h = o.u(this.options);
|
437
|
+
o.p(e), this.$(h), this._$AH = o;
|
438
438
|
}
|
439
439
|
}
|
440
440
|
_$AC(t) {
|
441
|
-
let e =
|
442
|
-
return e === void 0 &&
|
441
|
+
let e = Tt.get(t.strings);
|
442
|
+
return e === void 0 && Tt.set(t.strings, e = new pt(t)), e;
|
443
443
|
}
|
444
444
|
T(t) {
|
445
|
-
|
445
|
+
Zt(this._$AH) || (this._$AH = [], this._$AR());
|
446
446
|
const e = this._$AH;
|
447
447
|
let i, s = 0;
|
448
448
|
for (const n of t)
|
449
|
-
s === e.length ? e.push(i = new
|
449
|
+
s === e.length ? e.push(i = new ie(this.k(Q()), this.k(Q()), this, this.options)) : i = e[s], i._$AI(n), s++;
|
450
450
|
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
451
451
|
}
|
452
452
|
_$AR(t = this._$AA.nextSibling, e) {
|
@@ -476,31 +476,31 @@ let Ee = class {
|
|
476
476
|
if (n === void 0)
|
477
477
|
t = H(this, t, e, 0), o = !B(t) || t !== this._$AH && t !== W, o && (this._$AH = t);
|
478
478
|
else {
|
479
|
-
const
|
480
|
-
let
|
481
|
-
for (t = n[0],
|
482
|
-
|
479
|
+
const h = t;
|
480
|
+
let a, d;
|
481
|
+
for (t = n[0], a = 0; a < n.length - 1; a++)
|
482
|
+
d = H(this, h[i + a], e, a), d === W && (d = this._$AH[a]), o || (o = !B(d) || d !== this._$AH[a]), d === _ ? t = _ : t !== _ && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
|
483
483
|
}
|
484
484
|
o && !s && this.O(t);
|
485
485
|
}
|
486
486
|
O(t) {
|
487
487
|
t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
488
488
|
}
|
489
|
-
},
|
489
|
+
}, we = class extends it {
|
490
490
|
constructor() {
|
491
491
|
super(...arguments), this.type = 3;
|
492
492
|
}
|
493
493
|
O(t) {
|
494
494
|
this.element[this.name] = t === _ ? void 0 : t;
|
495
495
|
}
|
496
|
-
},
|
496
|
+
}, Pe = class extends it {
|
497
497
|
constructor() {
|
498
498
|
super(...arguments), this.type = 4;
|
499
499
|
}
|
500
500
|
O(t) {
|
501
501
|
this.element.toggleAttribute(this.name, !!t && t !== _);
|
502
502
|
}
|
503
|
-
},
|
503
|
+
}, Ce = class extends it {
|
504
504
|
constructor(t, e, i, s, n) {
|
505
505
|
super(t, e, i, s, n), this.type = 5;
|
506
506
|
}
|
@@ -514,7 +514,7 @@ let Ee = class {
|
|
514
514
|
var e;
|
515
515
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
516
516
|
}
|
517
|
-
},
|
517
|
+
}, Ue = class {
|
518
518
|
constructor(t, e, i) {
|
519
519
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
520
520
|
}
|
@@ -526,25 +526,25 @@ let Ee = class {
|
|
526
526
|
}
|
527
527
|
};
|
528
528
|
const ot = V.litHtmlPolyfillSupport;
|
529
|
-
ot == null || ot(pt,
|
529
|
+
ot == null || ot(pt, ee), (V.litHtmlVersions ?? (V.litHtmlVersions = [])).push("3.1.0");
|
530
530
|
/**
|
531
531
|
* @license
|
532
532
|
* Copyright 2019 Google LLC
|
533
533
|
* SPDX-License-Identifier: BSD-3-Clause
|
534
534
|
*/
|
535
|
-
const Z = globalThis,
|
536
|
-
let
|
535
|
+
const Z = globalThis, mt = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, $t = Symbol(), xt = /* @__PURE__ */ new WeakMap();
|
536
|
+
let se = class {
|
537
537
|
constructor(t, e, i) {
|
538
|
-
if (this._$cssResult$ = !0, i !==
|
538
|
+
if (this._$cssResult$ = !0, i !== $t)
|
539
539
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
540
540
|
this.cssText = t, this.t = e;
|
541
541
|
}
|
542
542
|
get styleSheet() {
|
543
543
|
let t = this.o;
|
544
544
|
const e = this.t;
|
545
|
-
if (
|
545
|
+
if (mt && t === void 0) {
|
546
546
|
const i = e !== void 0 && e.length === 1;
|
547
|
-
i && (t =
|
547
|
+
i && (t = xt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && xt.set(e, t));
|
548
548
|
}
|
549
549
|
return t;
|
550
550
|
}
|
@@ -552,15 +552,24 @@ let Ce = class {
|
|
552
552
|
return this.cssText;
|
553
553
|
}
|
554
554
|
};
|
555
|
-
const Te = (r) => new
|
556
|
-
|
555
|
+
const Te = (r) => new se(typeof r == "string" ? r : r + "", void 0, $t), xe = (r, ...t) => {
|
556
|
+
const e = r.length === 1 ? r[0] : t.reduce((i, s, n) => i + ((o) => {
|
557
|
+
if (o._$cssResult$ === !0)
|
558
|
+
return o.cssText;
|
559
|
+
if (typeof o == "number")
|
560
|
+
return o;
|
561
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
562
|
+
})(s) + r[n + 1], r[0]);
|
563
|
+
return new se(e, r, $t);
|
564
|
+
}, Re = (r, t) => {
|
565
|
+
if (mt)
|
557
566
|
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
558
567
|
else
|
559
568
|
for (const e of t) {
|
560
569
|
const i = document.createElement("style"), s = Z.litNonce;
|
561
570
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
|
562
571
|
}
|
563
|
-
},
|
572
|
+
}, Rt = mt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
564
573
|
let e = "";
|
565
574
|
for (const i of t.cssRules)
|
566
575
|
e += i.cssText;
|
@@ -571,10 +580,10 @@ const Te = (r) => new Ce(typeof r == "string" ? r : r + "", void 0, te), Ue = (r
|
|
571
580
|
* Copyright 2017 Google LLC
|
572
581
|
* SPDX-License-Identifier: BSD-3-Clause
|
573
582
|
*/
|
574
|
-
const { is:
|
583
|
+
const { is: He, defineProperty: ke, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Ne, getOwnPropertySymbols: Le, getPrototypeOf: Me } = Object, E = globalThis, Ht = E.trustedTypes, Ie = Ht ? Ht.emptyScript : "", at = E.reactiveElementPolyfillSupport, D = (r, t) => r, ut = { toAttribute(r, t) {
|
575
584
|
switch (t) {
|
576
585
|
case Boolean:
|
577
|
-
r = r ?
|
586
|
+
r = r ? Ie : null;
|
578
587
|
break;
|
579
588
|
case Object:
|
580
589
|
case Array:
|
@@ -599,23 +608,23 @@ const { is: Re, defineProperty: xe, getOwnPropertyDescriptor: He, getOwnProperty
|
|
599
608
|
}
|
600
609
|
}
|
601
610
|
return e;
|
602
|
-
} },
|
603
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
604
|
-
class
|
611
|
+
} }, re = (r, t) => !He(r, t), kt = { attribute: !0, type: String, converter: ut, reflect: !1, hasChanged: re };
|
612
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), E.litPropertyMetadata ?? (E.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
613
|
+
class R extends HTMLElement {
|
605
614
|
static addInitializer(t) {
|
606
615
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
607
616
|
}
|
608
617
|
static get observedAttributes() {
|
609
618
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
610
619
|
}
|
611
|
-
static createProperty(t, e =
|
620
|
+
static createProperty(t, e = kt) {
|
612
621
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
613
622
|
const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
614
|
-
s !== void 0 &&
|
623
|
+
s !== void 0 && ke(this.prototype, t, s);
|
615
624
|
}
|
616
625
|
}
|
617
626
|
static getPropertyDescriptor(t, e, i) {
|
618
|
-
const { get: s, set: n } =
|
627
|
+
const { get: s, set: n } = Oe(this.prototype, t) ?? { get() {
|
619
628
|
return this[e];
|
620
629
|
}, set(o) {
|
621
630
|
this[e] = o;
|
@@ -623,24 +632,24 @@ class x extends HTMLElement {
|
|
623
632
|
return { get() {
|
624
633
|
return s == null ? void 0 : s.call(this);
|
625
634
|
}, set(o) {
|
626
|
-
const
|
627
|
-
n.call(this, o), this.requestUpdate(t,
|
635
|
+
const h = s == null ? void 0 : s.call(this);
|
636
|
+
n.call(this, o), this.requestUpdate(t, h, i);
|
628
637
|
}, configurable: !0, enumerable: !0 };
|
629
638
|
}
|
630
639
|
static getPropertyOptions(t) {
|
631
|
-
return this.elementProperties.get(t) ??
|
640
|
+
return this.elementProperties.get(t) ?? kt;
|
632
641
|
}
|
633
642
|
static _$Ei() {
|
634
643
|
if (this.hasOwnProperty(D("elementProperties")))
|
635
644
|
return;
|
636
|
-
const t =
|
645
|
+
const t = Me(this);
|
637
646
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
638
647
|
}
|
639
648
|
static finalize() {
|
640
649
|
if (this.hasOwnProperty(D("finalized")))
|
641
650
|
return;
|
642
651
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(D("properties"))) {
|
643
|
-
const e = this.properties, i = [...
|
652
|
+
const e = this.properties, i = [...Ne(e), ...Le(e)];
|
644
653
|
for (const s of i)
|
645
654
|
this.createProperty(s, e[s]);
|
646
655
|
}
|
@@ -663,9 +672,9 @@ class x extends HTMLElement {
|
|
663
672
|
if (Array.isArray(t)) {
|
664
673
|
const i = new Set(t.flat(1 / 0).reverse());
|
665
674
|
for (const s of i)
|
666
|
-
e.unshift(
|
675
|
+
e.unshift(Rt(s));
|
667
676
|
} else
|
668
|
-
t !== void 0 && e.push(
|
677
|
+
t !== void 0 && e.push(Rt(t));
|
669
678
|
return e;
|
670
679
|
}
|
671
680
|
static _$Eu(t, e) {
|
@@ -695,7 +704,7 @@ class x extends HTMLElement {
|
|
695
704
|
}
|
696
705
|
createRenderRoot() {
|
697
706
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
698
|
-
return
|
707
|
+
return Re(t, this.constructor.elementStyles), t;
|
699
708
|
}
|
700
709
|
connectedCallback() {
|
701
710
|
var t;
|
@@ -728,13 +737,13 @@ class x extends HTMLElement {
|
|
728
737
|
var n;
|
729
738
|
const i = this.constructor, s = i._$Eh.get(t);
|
730
739
|
if (s !== void 0 && this._$Em !== s) {
|
731
|
-
const o = i.getPropertyOptions(s),
|
732
|
-
this._$Em = s, this[s] =
|
740
|
+
const o = i.getPropertyOptions(s), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : ut;
|
741
|
+
this._$Em = s, this[s] = h.fromAttribute(e, o.type), this._$Em = null;
|
733
742
|
}
|
734
743
|
}
|
735
744
|
requestUpdate(t, e, i, s = !1, n) {
|
736
745
|
if (t !== void 0) {
|
737
|
-
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ??
|
746
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? re)(s ? n : this[t], e))
|
738
747
|
return;
|
739
748
|
this.C(t, e, i);
|
740
749
|
}
|
@@ -812,86 +821,86 @@ class x extends HTMLElement {
|
|
812
821
|
firstUpdated(t) {
|
813
822
|
}
|
814
823
|
}
|
815
|
-
|
824
|
+
R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[D("elementProperties")] = /* @__PURE__ */ new Map(), R[D("finalized")] = /* @__PURE__ */ new Map(), at == null || at({ ReactiveElement: R }), (E.reactiveElementVersions ?? (E.reactiveElementVersions = [])).push("2.0.2");
|
816
825
|
/**
|
817
826
|
* @license
|
818
827
|
* Copyright 2017 Google LLC
|
819
828
|
* SPDX-License-Identifier: BSD-3-Clause
|
820
829
|
*/
|
821
|
-
const z = globalThis, tt = z.trustedTypes,
|
822
|
-
\f\r]`,
|
823
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
824
|
-
function
|
830
|
+
const z = globalThis, tt = z.trustedTypes, Ot = tt ? tt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ne = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, oe = "?" + A, Ve = `<${oe}>`, x = document, q = () => x.createComment(""), X = (r) => r === null || typeof r != "object" && typeof r != "function", ae = Array.isArray, De = (r) => ae(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", ht = `[
|
831
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Nt = /-->/g, Lt = />/g, w = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
|
832
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Mt = /'/g, It = /"/g, he = /^(?:script|style|textarea|title)$/i, ze = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), je = ze(1), k = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Vt = /* @__PURE__ */ new WeakMap(), U = x.createTreeWalker(x, 129);
|
833
|
+
function le(r, t) {
|
825
834
|
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
826
835
|
throw Error("invalid template strings array");
|
827
|
-
return
|
836
|
+
return Ot !== void 0 ? Ot.createHTML(t) : t;
|
828
837
|
}
|
829
|
-
const
|
838
|
+
const Be = (r, t) => {
|
830
839
|
const e = r.length - 1, i = [];
|
831
|
-
let s, n = t === 2 ? "<svg>" : "", o =
|
832
|
-
for (let
|
833
|
-
const
|
834
|
-
let
|
835
|
-
for (; p <
|
836
|
-
p = o.lastIndex, o ===
|
837
|
-
const u = o === w && r[
|
838
|
-
n += o ===
|
839
|
-
}
|
840
|
-
return [
|
840
|
+
let s, n = t === 2 ? "<svg>" : "", o = M;
|
841
|
+
for (let h = 0; h < e; h++) {
|
842
|
+
const a = r[h];
|
843
|
+
let d, c, l = -1, p = 0;
|
844
|
+
for (; p < a.length && (o.lastIndex = p, c = o.exec(a), c !== null); )
|
845
|
+
p = o.lastIndex, o === M ? c[1] === "!--" ? o = Nt : c[1] !== void 0 ? o = Lt : c[2] !== void 0 ? (he.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = w) : c[3] !== void 0 && (o = w) : o === w ? c[0] === ">" ? (o = s ?? M, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, d = c[1], o = c[3] === void 0 ? w : c[3] === '"' ? It : Mt) : o === It || o === Mt ? o = w : o === Nt || o === Lt ? o = M : (o = w, s = void 0);
|
846
|
+
const u = o === w && r[h + 1].startsWith("/>") ? " " : "";
|
847
|
+
n += o === M ? a + Ve : l >= 0 ? (i.push(d), a.slice(0, l) + ne + a.slice(l) + A + u) : a + A + (l === -2 ? h : u);
|
848
|
+
}
|
849
|
+
return [le(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
841
850
|
};
|
842
|
-
class
|
851
|
+
class J {
|
843
852
|
constructor({ strings: t, _$litType$: e }, i) {
|
844
853
|
let s;
|
845
854
|
this.parts = [];
|
846
855
|
let n = 0, o = 0;
|
847
|
-
const
|
848
|
-
if (this.el =
|
856
|
+
const h = t.length - 1, a = this.parts, [d, c] = Be(t, e);
|
857
|
+
if (this.el = J.createElement(d, i), U.currentNode = this.el.content, e === 2) {
|
849
858
|
const l = this.el.content.firstChild;
|
850
859
|
l.replaceWith(...l.childNodes);
|
851
860
|
}
|
852
|
-
for (; (s =
|
861
|
+
for (; (s = U.nextNode()) !== null && a.length < h; ) {
|
853
862
|
if (s.nodeType === 1) {
|
854
863
|
if (s.hasAttributes())
|
855
864
|
for (const l of s.getAttributeNames())
|
856
|
-
if (l.endsWith(
|
857
|
-
const p =
|
858
|
-
|
865
|
+
if (l.endsWith(ne)) {
|
866
|
+
const p = c[o++], u = s.getAttribute(l).split(A), g = /([.?@])?(.*)/.exec(p);
|
867
|
+
a.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? qe : g[1] === "?" ? Xe : g[1] === "@" ? Je : st }), s.removeAttribute(l);
|
859
868
|
} else
|
860
|
-
l.startsWith(A) && (
|
861
|
-
if (
|
869
|
+
l.startsWith(A) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
|
870
|
+
if (he.test(s.tagName)) {
|
862
871
|
const l = s.textContent.split(A), p = l.length - 1;
|
863
872
|
if (p > 0) {
|
864
873
|
s.textContent = tt ? tt.emptyScript : "";
|
865
874
|
for (let u = 0; u < p; u++)
|
866
|
-
s.append(l[u], q()),
|
875
|
+
s.append(l[u], q()), U.nextNode(), a.push({ type: 2, index: ++n });
|
867
876
|
s.append(l[p], q());
|
868
877
|
}
|
869
878
|
}
|
870
879
|
} else if (s.nodeType === 8)
|
871
|
-
if (s.data ===
|
872
|
-
|
880
|
+
if (s.data === oe)
|
881
|
+
a.push({ type: 2, index: n });
|
873
882
|
else {
|
874
883
|
let l = -1;
|
875
884
|
for (; (l = s.data.indexOf(A, l + 1)) !== -1; )
|
876
|
-
|
885
|
+
a.push({ type: 7, index: n }), l += A.length - 1;
|
877
886
|
}
|
878
887
|
n++;
|
879
888
|
}
|
880
889
|
}
|
881
890
|
static createElement(t, e) {
|
882
|
-
const i =
|
891
|
+
const i = x.createElement("template");
|
883
892
|
return i.innerHTML = t, i;
|
884
893
|
}
|
885
894
|
}
|
886
|
-
function
|
887
|
-
var o,
|
888
|
-
if (t ===
|
895
|
+
function O(r, t, e = r, i) {
|
896
|
+
var o, h;
|
897
|
+
if (t === k)
|
889
898
|
return t;
|
890
899
|
let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
|
891
900
|
const n = X(t) ? void 0 : t._$litDirective$;
|
892
|
-
return (s == null ? void 0 : s.constructor) !== n && ((
|
901
|
+
return (s == null ? void 0 : s.constructor) !== n && ((h = s == null ? void 0 : s._$AO) == null || h.call(s, !1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = O(r, s._$AS(r, t.values), s, i)), t;
|
893
902
|
}
|
894
|
-
class
|
903
|
+
class We {
|
895
904
|
constructor(t, e) {
|
896
905
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
897
906
|
}
|
@@ -902,17 +911,17 @@ class je {
|
|
902
911
|
return this._$AM._$AU;
|
903
912
|
}
|
904
913
|
u(t) {
|
905
|
-
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ??
|
906
|
-
|
907
|
-
let n =
|
908
|
-
for (;
|
909
|
-
if (o ===
|
910
|
-
let
|
911
|
-
|
914
|
+
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? x).importNode(e, !0);
|
915
|
+
U.currentNode = s;
|
916
|
+
let n = U.nextNode(), o = 0, h = 0, a = i[0];
|
917
|
+
for (; a !== void 0; ) {
|
918
|
+
if (o === a.index) {
|
919
|
+
let d;
|
920
|
+
a.type === 2 ? d = new K(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ke(n, this, t)), this._$AV.push(d), a = i[++h];
|
912
921
|
}
|
913
|
-
o !== (
|
922
|
+
o !== (a == null ? void 0 : a.index) && (n = U.nextNode(), o++);
|
914
923
|
}
|
915
|
-
return
|
924
|
+
return U.currentNode = x, s;
|
916
925
|
}
|
917
926
|
p(t) {
|
918
927
|
let e = 0;
|
@@ -920,13 +929,13 @@ class je {
|
|
920
929
|
i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
921
930
|
}
|
922
931
|
}
|
923
|
-
class
|
932
|
+
class K {
|
924
933
|
get _$AU() {
|
925
934
|
var t;
|
926
935
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
927
936
|
}
|
928
937
|
constructor(t, e, i, s) {
|
929
|
-
this.type = 2, this._$AH =
|
938
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
930
939
|
}
|
931
940
|
get parentNode() {
|
932
941
|
let t = this._$AA.parentNode;
|
@@ -940,7 +949,7 @@ class J {
|
|
940
949
|
return this._$AB;
|
941
950
|
}
|
942
951
|
_$AI(t, e = this) {
|
943
|
-
t =
|
952
|
+
t = O(this, t, e), X(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== k && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : De(t) ? this.T(t) : this._(t);
|
944
953
|
}
|
945
954
|
k(t) {
|
946
955
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
@@ -949,28 +958,28 @@ class J {
|
|
949
958
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
950
959
|
}
|
951
960
|
_(t) {
|
952
|
-
this._$AH !==
|
961
|
+
this._$AH !== m && X(this._$AH) ? this._$AA.nextSibling.data = t : this.$(x.createTextNode(t)), this._$AH = t;
|
953
962
|
}
|
954
963
|
g(t) {
|
955
964
|
var n;
|
956
|
-
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el =
|
965
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = J.createElement(le(i.h, i.h[0]), this.options)), i);
|
957
966
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
|
958
967
|
this._$AH.p(e);
|
959
968
|
else {
|
960
|
-
const o = new
|
961
|
-
o.p(e), this.$(
|
969
|
+
const o = new We(s, this), h = o.u(this.options);
|
970
|
+
o.p(e), this.$(h), this._$AH = o;
|
962
971
|
}
|
963
972
|
}
|
964
973
|
_$AC(t) {
|
965
|
-
let e =
|
966
|
-
return e === void 0 &&
|
974
|
+
let e = Vt.get(t.strings);
|
975
|
+
return e === void 0 && Vt.set(t.strings, e = new J(t)), e;
|
967
976
|
}
|
968
977
|
T(t) {
|
969
|
-
|
978
|
+
ae(this._$AH) || (this._$AH = [], this._$AR());
|
970
979
|
const e = this._$AH;
|
971
980
|
let i, s = 0;
|
972
981
|
for (const n of t)
|
973
|
-
s === e.length ? e.push(i = new
|
982
|
+
s === e.length ? e.push(i = new K(this.k(q()), this.k(q()), this, this.options)) : i = e[s], i._$AI(n), s++;
|
974
983
|
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
975
984
|
}
|
976
985
|
_$AR(t = this._$AA.nextSibling, e) {
|
@@ -993,49 +1002,49 @@ class st {
|
|
993
1002
|
return this._$AM._$AU;
|
994
1003
|
}
|
995
1004
|
constructor(t, e, i, s, n) {
|
996
|
-
this.type = 1, this._$AH =
|
1005
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = m;
|
997
1006
|
}
|
998
1007
|
_$AI(t, e = this, i, s) {
|
999
1008
|
const n = this.strings;
|
1000
1009
|
let o = !1;
|
1001
1010
|
if (n === void 0)
|
1002
|
-
t =
|
1011
|
+
t = O(this, t, e, 0), o = !X(t) || t !== this._$AH && t !== k, o && (this._$AH = t);
|
1003
1012
|
else {
|
1004
|
-
const
|
1005
|
-
let
|
1006
|
-
for (t = n[0],
|
1007
|
-
|
1013
|
+
const h = t;
|
1014
|
+
let a, d;
|
1015
|
+
for (t = n[0], a = 0; a < n.length - 1; a++)
|
1016
|
+
d = O(this, h[i + a], e, a), d === k && (d = this._$AH[a]), o || (o = !X(d) || d !== this._$AH[a]), d === m ? t = m : t !== m && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
|
1008
1017
|
}
|
1009
1018
|
o && !s && this.O(t);
|
1010
1019
|
}
|
1011
1020
|
O(t) {
|
1012
|
-
t ===
|
1021
|
+
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
1013
1022
|
}
|
1014
1023
|
}
|
1015
|
-
class
|
1024
|
+
class qe extends st {
|
1016
1025
|
constructor() {
|
1017
1026
|
super(...arguments), this.type = 3;
|
1018
1027
|
}
|
1019
1028
|
O(t) {
|
1020
|
-
this.element[this.name] = t ===
|
1029
|
+
this.element[this.name] = t === m ? void 0 : t;
|
1021
1030
|
}
|
1022
1031
|
}
|
1023
|
-
class
|
1032
|
+
class Xe extends st {
|
1024
1033
|
constructor() {
|
1025
1034
|
super(...arguments), this.type = 4;
|
1026
1035
|
}
|
1027
1036
|
O(t) {
|
1028
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
1037
|
+
this.element.toggleAttribute(this.name, !!t && t !== m);
|
1029
1038
|
}
|
1030
1039
|
}
|
1031
|
-
class
|
1040
|
+
class Je extends st {
|
1032
1041
|
constructor(t, e, i, s, n) {
|
1033
1042
|
super(t, e, i, s, n), this.type = 5;
|
1034
1043
|
}
|
1035
1044
|
_$AI(t, e = this) {
|
1036
|
-
if ((t =
|
1045
|
+
if ((t = O(this, t, e, 0) ?? m) === k)
|
1037
1046
|
return;
|
1038
|
-
const i = this._$AH, s = t ===
|
1047
|
+
const i = this._$AH, s = t === m && i !== m || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== m && (i === m || s);
|
1039
1048
|
s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
1040
1049
|
}
|
1041
1050
|
handleEvent(t) {
|
@@ -1043,7 +1052,7 @@ class qe extends st {
|
|
1043
1052
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
1044
1053
|
}
|
1045
1054
|
}
|
1046
|
-
class
|
1055
|
+
class Ke {
|
1047
1056
|
constructor(t, e, i) {
|
1048
1057
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
1049
1058
|
}
|
@@ -1051,17 +1060,17 @@ class Xe {
|
|
1051
1060
|
return this._$AM._$AU;
|
1052
1061
|
}
|
1053
1062
|
_$AI(t) {
|
1054
|
-
|
1063
|
+
O(this, t);
|
1055
1064
|
}
|
1056
1065
|
}
|
1057
1066
|
const lt = z.litHtmlPolyfillSupport;
|
1058
|
-
lt == null || lt(
|
1059
|
-
const
|
1067
|
+
lt == null || lt(J, K), (z.litHtmlVersions ?? (z.litHtmlVersions = [])).push("3.1.0");
|
1068
|
+
const Fe = (r, t, e) => {
|
1060
1069
|
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
1061
1070
|
let s = i._$litPart$;
|
1062
1071
|
if (s === void 0) {
|
1063
1072
|
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
1064
|
-
i._$litPart$ = s = new
|
1073
|
+
i._$litPart$ = s = new K(t.insertBefore(q(), n), n, void 0, e ?? {});
|
1065
1074
|
}
|
1066
1075
|
return s._$AI(r), s;
|
1067
1076
|
};
|
@@ -1070,7 +1079,7 @@ const Ke = (r, t, e) => {
|
|
1070
1079
|
* Copyright 2017 Google LLC
|
1071
1080
|
* SPDX-License-Identifier: BSD-3-Clause
|
1072
1081
|
*/
|
1073
|
-
class j extends
|
1082
|
+
class j extends R {
|
1074
1083
|
constructor() {
|
1075
1084
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
1076
1085
|
}
|
@@ -1081,7 +1090,7 @@ class j extends x {
|
|
1081
1090
|
}
|
1082
1091
|
update(t) {
|
1083
1092
|
const e = this.render();
|
1084
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
1093
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Fe(e, this.renderRoot, this.renderOptions);
|
1085
1094
|
}
|
1086
1095
|
connectedCallback() {
|
1087
1096
|
var t;
|
@@ -1092,15 +1101,15 @@ class j extends x {
|
|
1092
1101
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
1093
1102
|
}
|
1094
1103
|
render() {
|
1095
|
-
return
|
1104
|
+
return k;
|
1096
1105
|
}
|
1097
1106
|
}
|
1098
|
-
var
|
1099
|
-
j._$litElement$ = !0, j.finalized = !0, (
|
1100
|
-
const
|
1101
|
-
|
1107
|
+
var Bt;
|
1108
|
+
j._$litElement$ = !0, j.finalized = !0, (Bt = globalThis.litElementHydrateSupport) == null || Bt.call(globalThis, { LitElement: j });
|
1109
|
+
const dt = globalThis.litElementPolyfillSupport;
|
1110
|
+
dt == null || dt({ LitElement: j });
|
1102
1111
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.2");
|
1103
|
-
function
|
1112
|
+
function Ge(r, t, e) {
|
1104
1113
|
function i(s) {
|
1105
1114
|
e.dispatchEvent(new CustomEvent(s.type, s));
|
1106
1115
|
}
|
@@ -1108,17 +1117,17 @@ function Je(r, t, e) {
|
|
1108
1117
|
t.removeEventListener(r, i);
|
1109
1118
|
};
|
1110
1119
|
}
|
1111
|
-
class
|
1120
|
+
class Ze {
|
1112
1121
|
constructor(t, e) {
|
1113
|
-
this._events = [], this._cleanup = [], this._forwardElementRef =
|
1122
|
+
this._events = [], this._cleanup = [], this._forwardElementRef = qt(), this.host = t, this._events = e, t.addController(this);
|
1114
1123
|
}
|
1115
1124
|
register() {
|
1116
|
-
return
|
1125
|
+
return Xt(this._forwardElementRef);
|
1117
1126
|
}
|
1118
1127
|
hostConnected() {
|
1119
1128
|
requestAnimationFrame(() => {
|
1120
1129
|
this._events.forEach((t) => {
|
1121
|
-
this._forwardElementRef.value && this._cleanup.push(
|
1130
|
+
this._forwardElementRef.value && this._cleanup.push(Ge(t, this._forwardElementRef.value, this.host));
|
1122
1131
|
});
|
1123
1132
|
});
|
1124
1133
|
}
|
@@ -1128,92 +1137,101 @@ class Fe {
|
|
1128
1137
|
}), this._cleanup = [];
|
1129
1138
|
}
|
1130
1139
|
}
|
1131
|
-
const
|
1140
|
+
const Dt = "https://d2rxhdlm2q91uk.cloudfront.net", Ye = "https://d1ix11aj5kfygl.cloudfront.net", Qe = "https://d157jlwnudd93d.cloudfront.net", zt = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", ti = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", ei = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", ii = "http://localhost:6060/v2", si = "https://embed-dev.vouchfor.com/v2", ri = "https://embed-staging.vouchfor.com/v2", ni = "https://embed.vouchfor.com/v2";
|
1132
1141
|
function et(r) {
|
1133
1142
|
if (!["local", "dev", "staging", "prod"].includes(r))
|
1134
1143
|
throw new Error(`Unknown environment: ${r}`);
|
1135
1144
|
if (r === "local")
|
1136
1145
|
return {
|
1137
|
-
videoUrl:
|
1138
|
-
publicApiUrl:
|
1139
|
-
embedApiUrl:
|
1146
|
+
videoUrl: Dt,
|
1147
|
+
publicApiUrl: zt,
|
1148
|
+
embedApiUrl: ii
|
1140
1149
|
};
|
1141
1150
|
if (r === "dev")
|
1142
1151
|
return {
|
1143
|
-
videoUrl:
|
1144
|
-
publicApiUrl:
|
1145
|
-
embedApiUrl:
|
1152
|
+
videoUrl: Dt,
|
1153
|
+
publicApiUrl: zt,
|
1154
|
+
embedApiUrl: si
|
1146
1155
|
};
|
1147
1156
|
if (r === "staging")
|
1148
1157
|
return {
|
1149
|
-
videoUrl:
|
1150
|
-
publicApiUrl:
|
1151
|
-
embedApiUrl:
|
1158
|
+
videoUrl: Ye,
|
1159
|
+
publicApiUrl: ti,
|
1160
|
+
embedApiUrl: ri
|
1152
1161
|
};
|
1153
1162
|
if (r === "prod")
|
1154
1163
|
return {
|
1155
|
-
videoUrl:
|
1156
|
-
publicApiUrl:
|
1157
|
-
embedApiUrl:
|
1164
|
+
videoUrl: Qe,
|
1165
|
+
publicApiUrl: ei,
|
1166
|
+
embedApiUrl: ni
|
1158
1167
|
};
|
1159
1168
|
}
|
1160
|
-
class
|
1169
|
+
class oi {
|
1161
1170
|
constructor(t) {
|
1162
1171
|
this._fetching = !1, this.getVouch = async (e, i, s) => {
|
1163
|
-
var
|
1164
|
-
const { embedApiUrl: n } = et(e), o = P(),
|
1172
|
+
var c;
|
1173
|
+
const { embedApiUrl: n } = et(e), o = P(), h = await fetch(`${n}/vouches/${s}`, {
|
1165
1174
|
method: "GET",
|
1166
1175
|
headers: [
|
1167
1176
|
["X-Api-Key", i],
|
1168
1177
|
["X-Cache-Check", o]
|
1169
1178
|
]
|
1170
|
-
}),
|
1171
|
-
this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail:
|
1172
|
-
const c = (d = a == null ? void 0 : a.headers) == null ? void 0 : d.get("X-Cache-Check");
|
1173
|
-
return c && c !== o && fetch(`${n}/vouches/${s}`, {
|
1179
|
+
}), a = await h.json();
|
1180
|
+
return this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail: a == null ? void 0 : a.id })), ((c = h == null ? void 0 : h.headers) == null ? void 0 : c.get("X-Cache-Check")) !== o && fetch(`${n}/vouches/${s}`, {
|
1174
1181
|
method: "GET",
|
1175
1182
|
headers: [
|
1176
1183
|
["X-Api-Key", i],
|
1177
1184
|
["Cache-Control", "max-age=0"]
|
1178
1185
|
]
|
1179
|
-
}),
|
1186
|
+
}), a;
|
1180
1187
|
}, this.getTemplate = async (e, i, s) => {
|
1181
|
-
var
|
1182
|
-
const { embedApiUrl: n } = et(e), o = P(),
|
1188
|
+
var c;
|
1189
|
+
const { embedApiUrl: n } = et(e), o = P(), h = await fetch(`${n}/templates/${s}`, {
|
1183
1190
|
method: "GET",
|
1184
1191
|
headers: [
|
1185
1192
|
["X-Api-Key", i],
|
1186
1193
|
["X-Cache-Check", o]
|
1187
1194
|
]
|
1188
|
-
}),
|
1189
|
-
return c
|
1195
|
+
}), a = await h.json();
|
1196
|
+
return ((c = h == null ? void 0 : h.headers) == null ? void 0 : c.get("X-Cache-Check")) !== o && fetch(`${n}/templates/${s}`, {
|
1190
1197
|
method: "GET",
|
1191
1198
|
headers: [
|
1192
1199
|
["X-Api-Key", i],
|
1193
1200
|
["Cache-Control", "max-age=0"]
|
1194
1201
|
]
|
1195
|
-
}),
|
1196
|
-
}, this.host = t, new
|
1202
|
+
}), a;
|
1203
|
+
}, this.host = t, new yt(
|
1197
1204
|
this.host,
|
1198
1205
|
async ([e, i, s, n, o]) => {
|
1199
|
-
var a,
|
1206
|
+
var h, a, d, c;
|
1200
1207
|
try {
|
1201
1208
|
if (t.vouch = void 0, t.template = void 0, s) {
|
1202
1209
|
let l;
|
1203
|
-
o && (this.fetching = !0, l = await this.getTemplate(e, i, o)),
|
1210
|
+
o && (this.fetching = !0, l = await this.getTemplate(e, i, o)), this._vouch = s, t.template = l ?? ((a = (h = s == null ? void 0 : s.settings) == null ? void 0 : h.template) == null ? void 0 : a.instance);
|
1204
1211
|
} else if (n) {
|
1205
1212
|
this.fetching = !0;
|
1206
1213
|
const [l, p] = await Promise.all([
|
1207
1214
|
this.getVouch(e, i, n),
|
1208
1215
|
o ? this.getTemplate(e, i, o) : null
|
1209
1216
|
]);
|
1210
|
-
|
1217
|
+
this._vouch = l, t.template = p ?? ((c = (d = l == null ? void 0 : l.settings) == null ? void 0 : d.template) == null ? void 0 : c.instance);
|
1211
1218
|
}
|
1212
1219
|
} finally {
|
1213
1220
|
this.fetching = !1;
|
1214
1221
|
}
|
1215
1222
|
},
|
1216
1223
|
() => [t.env, t.apiKey, t.data, t.vouchId, t.templateId]
|
1224
|
+
), new yt(
|
1225
|
+
this.host,
|
1226
|
+
([e, i]) => {
|
1227
|
+
t.vouch = e ? {
|
1228
|
+
...e,
|
1229
|
+
questions: {
|
1230
|
+
items: e == null ? void 0 : e.questions.items.filter((s, n) => !(i != null && i.length) || (i == null ? void 0 : i.includes(n + 1)))
|
1231
|
+
}
|
1232
|
+
} : void 0;
|
1233
|
+
},
|
1234
|
+
() => [this._vouch, t.questions]
|
1217
1235
|
);
|
1218
1236
|
}
|
1219
1237
|
set fetching(t) {
|
@@ -1223,8 +1241,85 @@ class ri {
|
|
1223
1241
|
return this._fetching;
|
1224
1242
|
}
|
1225
1243
|
}
|
1226
|
-
const
|
1227
|
-
|
1244
|
+
const ai = "@vouchfor/embeds", hi = "0.0.0-experiment.ae8c0d8", li = "MIT", di = "Aaron Williams", ci = "dist/es/embeds.js", pi = "dist/es/embeds.js", ui = "module", _i = "dist/es/index.d.ts", mi = {
|
1245
|
+
".": "./dist/es/embeds.js"
|
1246
|
+
}, $i = [
|
1247
|
+
"dist",
|
1248
|
+
"src"
|
1249
|
+
], fi = {
|
1250
|
+
tag: "experiment",
|
1251
|
+
access: "public"
|
1252
|
+
}, gi = {
|
1253
|
+
build: "rm -rf dist && tsc && vite build --mode iife && vite build --mode es",
|
1254
|
+
"build:deps": "yarn --cwd ../media-player build",
|
1255
|
+
"build:package": "yarn build",
|
1256
|
+
"build:storybook": "yarn prebuild && storybook build",
|
1257
|
+
"generate:manifest": "wca src --outFile custom-elements.json",
|
1258
|
+
lint: "eslint . --quiet",
|
1259
|
+
"lint:fix": "eslint . --fix",
|
1260
|
+
"lint:staged": "lint-staged",
|
1261
|
+
prepublishOnly: "yarn build",
|
1262
|
+
size: "size-limit",
|
1263
|
+
storybook: "yarn prebuild && storybook dev -p 6007",
|
1264
|
+
prebuild: "yarn build:deps && yarn generate:manifest",
|
1265
|
+
test: "true"
|
1266
|
+
}, yi = {
|
1267
|
+
"@lit/task": "^1.0.0",
|
1268
|
+
"@vouchfor/media-player": "0.0.0-experiment.ae8c0d8",
|
1269
|
+
uuid: "^9.0.1"
|
1270
|
+
}, vi = {
|
1271
|
+
lit: "^3.1.0"
|
1272
|
+
}, Ai = {
|
1273
|
+
"@esm-bundle/chai": "^4.3.4-fix.0",
|
1274
|
+
"@open-wc/testing": "^3.2.0",
|
1275
|
+
"@storybook/addon-essentials": "^7.4.5",
|
1276
|
+
"@storybook/addon-links": "^7.4.5",
|
1277
|
+
"@storybook/blocks": "^7.4.5",
|
1278
|
+
"@storybook/web-components": "^7.4.5",
|
1279
|
+
"@storybook/web-components-vite": "^7.4.5",
|
1280
|
+
"@types/mocha": "^10.0.1",
|
1281
|
+
"@vouchfor/eslint-config": "^1.0.0",
|
1282
|
+
"@vouchfor/prettier-config": "^1.0.0",
|
1283
|
+
"@web/dev-server-esbuild": "^0.4.1",
|
1284
|
+
"@web/test-runner": "^0.17.1",
|
1285
|
+
"@web/test-runner-browserstack": "^0.6.1",
|
1286
|
+
"@web/test-runner-mocha": "^0.8.1",
|
1287
|
+
"@web/test-runner-playwright": "^0.10.1",
|
1288
|
+
dotenv: "^16.3.1",
|
1289
|
+
eslint: "^8.50.0",
|
1290
|
+
"eslint-plugin-import": "^2.28.1",
|
1291
|
+
"lint-staged": "^14.0.1",
|
1292
|
+
lit: "^3.1.0",
|
1293
|
+
prettier: "^3.0.3",
|
1294
|
+
react: "^18.2.0",
|
1295
|
+
"react-dom": "^18.2.0",
|
1296
|
+
storybook: "^7.4.5",
|
1297
|
+
typescript: "^5.1.3",
|
1298
|
+
vite: "^4.4.9",
|
1299
|
+
"vite-plugin-dts": "^3.6.0",
|
1300
|
+
"web-component-analyzer": "^1.1.7"
|
1301
|
+
}, bi = {
|
1302
|
+
name: ai,
|
1303
|
+
version: hi,
|
1304
|
+
license: li,
|
1305
|
+
author: di,
|
1306
|
+
main: ci,
|
1307
|
+
module: pi,
|
1308
|
+
type: ui,
|
1309
|
+
types: _i,
|
1310
|
+
exports: mi,
|
1311
|
+
files: $i,
|
1312
|
+
publishConfig: fi,
|
1313
|
+
scripts: gi,
|
1314
|
+
"lint-staged": {
|
1315
|
+
"**/*.{ts,tsx,js}": "eslint --fix --quiet",
|
1316
|
+
"**/*.{md,json,yml}": "prettier --write"
|
1317
|
+
},
|
1318
|
+
dependencies: yi,
|
1319
|
+
peerDependencies: vi,
|
1320
|
+
devDependencies: Ai
|
1321
|
+
}, jt = 1;
|
1322
|
+
class Ei {
|
1228
1323
|
constructor(t) {
|
1229
1324
|
this._tabId = void 0, this._clientId = void 0, this._visitorId = void 0, this._hasPlayed = !1, this._hasLoaded = {}, this._answersViewed = {}, this._streamStartTime = {}, this._streamLatestTime = {}, this._currentlyPlayingVideo = null, this._createVisitor = (e) => {
|
1230
1325
|
var s, n;
|
@@ -1233,10 +1328,10 @@ class oi {
|
|
1233
1328
|
}, this._getReportingMetadata = () => {
|
1234
1329
|
var n, o;
|
1235
1330
|
const [e, i] = ((o = (n = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : n.split) == null ? void 0 : o.call(n, "/")) ?? [], s = {};
|
1236
|
-
return [...new URLSearchParams(location.search).entries()].forEach(([
|
1237
|
-
if (/utm/.test(
|
1238
|
-
const
|
1239
|
-
s[
|
1331
|
+
return [...new URLSearchParams(location.search).entries()].forEach(([h, a]) => {
|
1332
|
+
if (/utm/.test(h)) {
|
1333
|
+
const d = h.toLowerCase().replace(/[-_][a-z0-9]/g, (c) => c.slice(-1).toUpperCase());
|
1334
|
+
s[d] = a;
|
1240
1335
|
}
|
1241
1336
|
}), {
|
1242
1337
|
source: this.host.trackingSource,
|
@@ -1250,25 +1345,39 @@ class oi {
|
|
1250
1345
|
...s
|
1251
1346
|
};
|
1252
1347
|
}, this._sendTrackingEvent = (e, i) => {
|
1253
|
-
|
1348
|
+
const s = this._findVouchId(i);
|
1349
|
+
if (!s || this.host.disableTracking)
|
1254
1350
|
return;
|
1255
|
-
const { publicApiUrl: n } = et(this.host.env), { client: o, tab:
|
1351
|
+
const { publicApiUrl: n } = et(this.host.env), { client: o, tab: h, request: a, visitor: d } = this._getUids();
|
1256
1352
|
navigator.sendBeacon(
|
1257
|
-
`${n}/api/events`,
|
1353
|
+
`${n}/api/v2/events`,
|
1258
1354
|
JSON.stringify({
|
1259
1355
|
event: e,
|
1260
|
-
payload:
|
1356
|
+
payload: {
|
1357
|
+
...i,
|
1358
|
+
vouchId: s
|
1359
|
+
},
|
1261
1360
|
context: {
|
1262
1361
|
"x-uid-client": o,
|
1263
|
-
"x-uid-tab":
|
1264
|
-
"x-uid-request":
|
1265
|
-
"x-uid-visitor":
|
1266
|
-
"x-reporting-metadata": this._getReportingMetadata()
|
1362
|
+
"x-uid-tab": h,
|
1363
|
+
"x-uid-request": a,
|
1364
|
+
"x-uid-visitor": d,
|
1365
|
+
"x-reporting-metadata": this._getReportingMetadata(),
|
1366
|
+
"x-embeds-version": bi.version
|
1267
1367
|
}
|
1268
1368
|
})
|
1269
1369
|
);
|
1370
|
+
}, this._streamEnded = () => {
|
1371
|
+
if (this._currentlyPlayingVideo) {
|
1372
|
+
const { id: e, key: i } = this._currentlyPlayingVideo;
|
1373
|
+
this._streamLatestTime[i] > this._streamStartTime[i] + jt && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1374
|
+
answerId: e,
|
1375
|
+
streamStart: this._streamStartTime[i],
|
1376
|
+
streamEnd: this._streamLatestTime[i]
|
1377
|
+
}), delete this._streamStartTime[i], delete this._streamLatestTime[i];
|
1378
|
+
}
|
1270
1379
|
}, this._handleVouchLoaded = ({ detail: e }) => {
|
1271
|
-
e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED"), this._hasLoaded[e] = !0));
|
1380
|
+
e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED", { vouchId: e }), this._hasLoaded[e] = !0));
|
1272
1381
|
}, this._handlePlay = () => {
|
1273
1382
|
this._hasPlayed || (this._sendTrackingEvent("VIDEO_PLAYED", {
|
1274
1383
|
streamStart: this.host.currentTime
|
@@ -1276,38 +1385,39 @@ class oi {
|
|
1276
1385
|
}, this._handleVideoPlay = ({ detail: { id: e, key: i, node: s } }) => {
|
1277
1386
|
this._answersViewed[i] || (this._sendTrackingEvent("VOUCH_RESPONSE_VIEWED", {
|
1278
1387
|
answerId: e
|
1279
|
-
}), this._answersViewed[i] = !0), this._streamStartTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime;
|
1388
|
+
}), this._answersViewed[i] = !0), this._streamStartTime[i] || (this._streamStartTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime);
|
1280
1389
|
}, this._handleVideoTimeUpdate = ({ detail: { id: e, key: i, node: s } }) => {
|
1281
1390
|
var n, o;
|
1282
|
-
|
1283
|
-
|
1284
|
-
this.
|
1285
|
-
answerId: e,
|
1286
|
-
streamStart: this._streamStartTime[i],
|
1287
|
-
streamEnd: this._streamLatestTime[i]
|
1288
|
-
}), this._streamStartTime[i] = s.currentTime);
|
1391
|
+
// We only want to count any time that the video is actually playing
|
1392
|
+
!this.host.paused && // Only update the latest time if this event fires for the currently active video
|
1393
|
+
e === ((o = (n = this.host.scene) == null ? void 0 : n.video) == null ? void 0 : o.id) && (this._currentlyPlayingVideo = { id: e, key: i, node: s }, this._streamLatestTime[i] = s.currentTime);
|
1289
1394
|
}, this._handleVideoPause = ({ detail: { id: e, key: i } }) => {
|
1290
|
-
this._streamLatestTime[i] > this._streamStartTime[i] && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1395
|
+
this._streamLatestTime[i] > this._streamStartTime[i] + jt && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1291
1396
|
answerId: e,
|
1292
1397
|
streamStart: this._streamStartTime[i],
|
1293
1398
|
streamEnd: this._streamLatestTime[i]
|
1294
|
-
}),
|
1399
|
+
}), delete this._streamStartTime[i], delete this._streamLatestTime[i];
|
1400
|
+
}, this._pageUnloading = () => {
|
1401
|
+
this._streamEnded(), this.host.pause();
|
1402
|
+
}, this._handleVisibilityChange = () => {
|
1403
|
+
document.visibilityState === "hidden" && this._pageUnloading();
|
1404
|
+
}, this._handlePageHide = () => {
|
1405
|
+
this._pageUnloading();
|
1295
1406
|
}, this.host = t, t.addController(this);
|
1296
1407
|
}
|
1297
|
-
_findVouchId() {
|
1298
|
-
|
1299
|
-
return "uuid" in this.host.vouch ? this.host.vouch.uuid : this.host.vouch.id;
|
1408
|
+
_findVouchId(t) {
|
1409
|
+
return t && "vouchId" in t ? t.vouchId : this.host.vouch ? this.host.vouch.id : null;
|
1300
1410
|
}
|
1301
1411
|
_getUids() {
|
1302
|
-
var n, o, a,
|
1412
|
+
var n, o, h, a, d, c, l, p, u, g, F, ft;
|
1303
1413
|
if (typeof window > "u")
|
1304
1414
|
return {
|
1305
1415
|
client: null,
|
1306
1416
|
tab: null,
|
1307
1417
|
request: P()
|
1308
1418
|
};
|
1309
|
-
const t = this._visitorId || ((o = (n = window.localStorage) == null ? void 0 : n.getItem) == null ? void 0 : o.call(n, "vouch-uid-visitor")) || this._createVisitor(P()), e = this._clientId || ((
|
1310
|
-
return t !== this._visitorId && (this._visitorId = t, (p = (l = window.localStorage) == null ? void 0 : l.setItem) == null || p.call(l, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (g = (u = window.localStorage) == null ? void 0 : u.setItem) == null || g.call(u, "vouch-uid-client", e)), i !== this._tabId && (this._tabId = i, (
|
1419
|
+
const t = this._visitorId || ((o = (n = window.localStorage) == null ? void 0 : n.getItem) == null ? void 0 : o.call(n, "vouch-uid-visitor")) || this._createVisitor(P()), e = this._clientId || ((a = (h = window.localStorage) == null ? void 0 : h.getItem) == null ? void 0 : a.call(h, "vouch-uid-client")) || P(), i = this._tabId || ((c = (d = window.sessionStorage) == null ? void 0 : d.getItem) == null ? void 0 : c.call(d, "vouch-uid-tab")) || P(), s = P();
|
1420
|
+
return t !== this._visitorId && (this._visitorId = t, (p = (l = window.localStorage) == null ? void 0 : l.setItem) == null || p.call(l, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (g = (u = window.localStorage) == null ? void 0 : u.setItem) == null || g.call(u, "vouch-uid-client", e)), i !== this._tabId && (this._tabId = i, (ft = (F = window.sessionStorage) == null ? void 0 : F.setItem) == null || ft.call(F, "vouch-uid-tab", i)), {
|
1311
1421
|
client: e,
|
1312
1422
|
tab: i,
|
1313
1423
|
request: s,
|
@@ -1317,30 +1427,22 @@ class oi {
|
|
1317
1427
|
hostConnected() {
|
1318
1428
|
requestAnimationFrame(() => {
|
1319
1429
|
var t, e, i, s;
|
1320
|
-
this.host.addEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.addEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.addEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.addEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
|
1430
|
+
"onvisibilitychange" in document ? document.addEventListener("visibilitychange", this._handleVisibilityChange) : window.addEventListener("pagehide", this._handlePageHide), this.host.addEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.addEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.addEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.addEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
|
1321
1431
|
});
|
1322
1432
|
}
|
1323
1433
|
hostDisconnected() {
|
1324
1434
|
var t, e, i, s;
|
1325
|
-
|
1326
|
-
const { id: n, key: o } = this._currentlyPlayingVideo;
|
1327
|
-
this._streamLatestTime[o] > this._streamStartTime[o] && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1328
|
-
answerId: n,
|
1329
|
-
streamStart: this._streamStartTime[o],
|
1330
|
-
streamEnd: this._streamLatestTime[o]
|
1331
|
-
});
|
1332
|
-
}
|
1333
|
-
this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.removeEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.removeEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.removeEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
|
1435
|
+
this._streamEnded(), "onvisibilitychange" in document ? document.removeEventListener("visibilitychange", this._handleVisibilityChange) : window.removeEventListener("pagehide", this._handlePageHide), this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.removeEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.removeEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.removeEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
|
1334
1436
|
}
|
1335
1437
|
}
|
1336
|
-
var
|
1337
|
-
for (var s = i > 1 ? void 0 : i ?
|
1438
|
+
var Si = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, f = (r, t, e, i) => {
|
1439
|
+
for (var s = i > 1 ? void 0 : i ? wi(t, e) : t, n = r.length - 1, o; n >= 0; n--)
|
1338
1440
|
(o = r[n]) && (s = (i ? o(t, e, s) : o(s)) || s);
|
1339
|
-
return i && s &&
|
1441
|
+
return i && s && Si(t, e, s), s;
|
1340
1442
|
};
|
1341
|
-
let
|
1443
|
+
let $ = class extends j {
|
1342
1444
|
constructor() {
|
1343
|
-
super(...arguments), this._mediaPlayerRef =
|
1445
|
+
super(...arguments), this._mediaPlayerRef = qt(), this.env = "prod", this.apiKey = "", this.disableTracking = !1, this.trackingSource = "embed", this.preload = "auto", this.autoplay = !1, this.aspectRatio = 0, this.eventController = new Ze(this, [
|
1344
1446
|
"durationchange",
|
1345
1447
|
"ended",
|
1346
1448
|
"error",
|
@@ -1366,7 +1468,7 @@ let m = class extends j {
|
|
1366
1468
|
"video:timeupdate",
|
1367
1469
|
"video:ended",
|
1368
1470
|
"video:error"
|
1369
|
-
]), this._fetcherController = new
|
1471
|
+
]), this._fetcherController = new oi(this), this._trackingController = new Ei(this);
|
1370
1472
|
}
|
1371
1473
|
get fetching() {
|
1372
1474
|
return this._fetcherController.fetching;
|
@@ -1431,6 +1533,10 @@ let m = class extends j {
|
|
1431
1533
|
var r;
|
1432
1534
|
return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.scenes) ?? [];
|
1433
1535
|
}
|
1536
|
+
get sceneConfig() {
|
1537
|
+
var r;
|
1538
|
+
return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.sceneConfig) ?? null;
|
1539
|
+
}
|
1434
1540
|
get videoState() {
|
1435
1541
|
var r;
|
1436
1542
|
return (r = this._mediaPlayerRef.value) == null ? void 0 : r.videoState;
|
@@ -1451,64 +1557,74 @@ let m = class extends j {
|
|
1451
1557
|
(t = this._mediaPlayerRef.value) == null || t.setScene(r);
|
1452
1558
|
}
|
1453
1559
|
render() {
|
1454
|
-
return
|
1455
|
-
<vmp-
|
1456
|
-
${
|
1560
|
+
return je`
|
1561
|
+
<vmp-media-player
|
1562
|
+
${Xt(this._mediaPlayerRef)}
|
1457
1563
|
${this.eventController.register()}
|
1458
1564
|
?autoplay=${this.autoplay}
|
1459
1565
|
?loading=${this.fetching}
|
1460
1566
|
.data=${this.vouch}
|
1461
1567
|
.template=${this.template}
|
1462
|
-
aspectRatio=${
|
1463
|
-
preload=${
|
1568
|
+
aspectRatio=${gt(this.aspectRatio)}
|
1569
|
+
preload=${gt(this.preload)}
|
1464
1570
|
.controls=${this.controls}
|
1465
|
-
></vmp-
|
1571
|
+
></vmp-media-player>
|
1466
1572
|
`;
|
1467
1573
|
}
|
1468
1574
|
};
|
1575
|
+
$.styles = [
|
1576
|
+
xe`
|
1577
|
+
:host {
|
1578
|
+
display: flex;
|
1579
|
+
}
|
1580
|
+
`
|
1581
|
+
];
|
1582
|
+
f([
|
1583
|
+
y({ type: Object })
|
1584
|
+
], $.prototype, "data", 2);
|
1469
1585
|
f([
|
1470
|
-
|
1471
|
-
],
|
1586
|
+
y({ type: String })
|
1587
|
+
], $.prototype, "vouchId", 2);
|
1472
1588
|
f([
|
1473
|
-
|
1474
|
-
],
|
1589
|
+
y({ type: String })
|
1590
|
+
], $.prototype, "templateId", 2);
|
1475
1591
|
f([
|
1476
|
-
|
1477
|
-
],
|
1592
|
+
y({ type: Array })
|
1593
|
+
], $.prototype, "questions", 2);
|
1478
1594
|
f([
|
1479
|
-
|
1480
|
-
],
|
1595
|
+
y({ type: String })
|
1596
|
+
], $.prototype, "env", 2);
|
1481
1597
|
f([
|
1482
|
-
|
1483
|
-
],
|
1598
|
+
y({ type: String })
|
1599
|
+
], $.prototype, "apiKey", 2);
|
1484
1600
|
f([
|
1485
|
-
|
1486
|
-
],
|
1601
|
+
y({ type: Boolean })
|
1602
|
+
], $.prototype, "disableTracking", 2);
|
1487
1603
|
f([
|
1488
|
-
|
1489
|
-
],
|
1604
|
+
y({ type: String })
|
1605
|
+
], $.prototype, "trackingSource", 2);
|
1490
1606
|
f([
|
1491
|
-
|
1492
|
-
],
|
1607
|
+
y({ type: Array })
|
1608
|
+
], $.prototype, "controls", 2);
|
1493
1609
|
f([
|
1494
|
-
|
1495
|
-
],
|
1610
|
+
y({ type: String })
|
1611
|
+
], $.prototype, "preload", 2);
|
1496
1612
|
f([
|
1497
|
-
|
1498
|
-
],
|
1613
|
+
y({ type: Boolean })
|
1614
|
+
], $.prototype, "autoplay", 2);
|
1499
1615
|
f([
|
1500
|
-
|
1501
|
-
],
|
1616
|
+
y({ type: Number })
|
1617
|
+
], $.prototype, "aspectRatio", 2);
|
1502
1618
|
f([
|
1503
|
-
|
1504
|
-
],
|
1619
|
+
Wt()
|
1620
|
+
], $.prototype, "vouch", 2);
|
1505
1621
|
f([
|
1506
|
-
|
1507
|
-
],
|
1508
|
-
|
1509
|
-
|
1510
|
-
],
|
1622
|
+
Wt()
|
1623
|
+
], $.prototype, "template", 2);
|
1624
|
+
$ = f([
|
1625
|
+
de("vouch-embed")
|
1626
|
+
], $);
|
1511
1627
|
export {
|
1512
|
-
|
1628
|
+
$ as Embed
|
1513
1629
|
};
|
1514
1630
|
//# sourceMappingURL=embeds.js.map
|