@soyio/soyio-widget 2.8.2 → 2.9.0
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/README.md +13 -0
- package/dist/index.js +191 -188
- package/dist/index.umd.cjs +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -306,6 +306,8 @@ The **`ConsentBox`** is a component that allows you to embed a consent request d
|
|
|
306
306
|
entityId: "<entity id>", // Optional
|
|
307
307
|
context: "<context>", // Optional
|
|
308
308
|
onReady: () => console.log("ConsentBox is ready"), // Optional
|
|
309
|
+
optionalReconsentBehavior: "notice", // Optional
|
|
310
|
+
mandatoryReconsentBehavior: "notice", // Optional
|
|
309
311
|
};
|
|
310
312
|
|
|
311
313
|
// Wait for DOM to be fully loaded
|
|
@@ -351,6 +353,17 @@ The `onEvent` follows the following format:
|
|
|
351
353
|
- **`entityId`**: Identifier of the `entity` associated with a `ConsentAction`. If provided and a consent was previously granted by this entity, the UI will display a message indicating that consent has already been given.
|
|
352
354
|
- **`context`**: Additional information that will be saved with the consent. Useful when you want to track the consent from a specific context.
|
|
353
355
|
- **`onReady`**: Optional callback that executes when the consent box is ready to use. You can use this to handle logic when the iframe is not mounted yet.
|
|
356
|
+
- **`optionalReconsentBehavior`**: What should happen when the consent is initialized with an `entityId` that has already given consent on an optional category.
|
|
357
|
+
- `notice` will show a message letting the user know that they have already given consent,
|
|
358
|
+
- `askAgain` will show the consent as if it wasn't given in the first place,
|
|
359
|
+
- `hide` will not show the consent at all.
|
|
360
|
+
|
|
361
|
+
We strongly recommend using `notice` so the user doesn't have to give the consent again and knows what they have already given consent to.
|
|
362
|
+
- **`mandatoryReconsentBehavior`**: What should happen when the consent is initialized with an `entityId` that has already given consent on a mandatory category.
|
|
363
|
+
- `notice` will show a message letting the user know that they have already given consent,
|
|
364
|
+
- `askAgain` will show the consent as if it wasn't given in the first place,
|
|
365
|
+
|
|
366
|
+
We don't support hiding the mandatory consent, and we strongly recommend using `notice` so the user doesn't have to give the consent again and knows what they have already given consent to.
|
|
354
367
|
|
|
355
368
|
# Appearance
|
|
356
369
|
|
package/dist/index.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
var Qt = Object.defineProperty;
|
|
2
2
|
var vt = Object.getOwnPropertySymbols;
|
|
3
3
|
var en = Object.prototype.hasOwnProperty, tn = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var ze = (
|
|
5
|
-
for (var
|
|
6
|
-
en.call(d,
|
|
4
|
+
var ze = (l, d, f) => d in l ? Qt(l, d, { enumerable: !0, configurable: !0, writable: !0, value: f }) : l[d] = f, wt = (l, d) => {
|
|
5
|
+
for (var f in d || (d = {}))
|
|
6
|
+
en.call(d, f) && ze(l, f, d[f]);
|
|
7
7
|
if (vt)
|
|
8
|
-
for (var
|
|
9
|
-
tn.call(d,
|
|
10
|
-
return
|
|
8
|
+
for (var f of vt(d))
|
|
9
|
+
tn.call(d, f) && ze(l, f, d[f]);
|
|
10
|
+
return l;
|
|
11
11
|
};
|
|
12
|
-
var H = (
|
|
13
|
-
if (!d.has(
|
|
14
|
-
throw TypeError("Cannot " +
|
|
12
|
+
var H = (l, d, f) => (ze(l, typeof d != "symbol" ? d + "" : d, f), f), nn = (l, d, f) => {
|
|
13
|
+
if (!d.has(l))
|
|
14
|
+
throw TypeError("Cannot " + f);
|
|
15
15
|
};
|
|
16
|
-
var gt = (
|
|
17
|
-
if (d.has(
|
|
16
|
+
var gt = (l, d, f) => {
|
|
17
|
+
if (d.has(l))
|
|
18
18
|
throw TypeError("Cannot add the same private member more than once");
|
|
19
|
-
d instanceof WeakSet ? d.add(
|
|
19
|
+
d instanceof WeakSet ? d.add(l) : d.set(l, f);
|
|
20
20
|
};
|
|
21
|
-
var yt = (
|
|
22
|
-
var J = (
|
|
21
|
+
var yt = (l, d, f) => (nn(l, d, "access private method"), f);
|
|
22
|
+
var J = (l, d, f) => new Promise((v, g) => {
|
|
23
23
|
var y = (N) => {
|
|
24
24
|
try {
|
|
25
|
-
C(
|
|
25
|
+
C(f.next(N));
|
|
26
26
|
} catch (M) {
|
|
27
27
|
g(M);
|
|
28
28
|
}
|
|
29
29
|
}, E = (N) => {
|
|
30
30
|
try {
|
|
31
|
-
C(
|
|
31
|
+
C(f.throw(N));
|
|
32
32
|
} catch (M) {
|
|
33
33
|
g(M);
|
|
34
34
|
}
|
|
35
35
|
}, C = (N) => N.done ? v(N.value) : Promise.resolve(N.value).then(y, E);
|
|
36
|
-
C((
|
|
36
|
+
C((f = f.apply(l, d)).next());
|
|
37
37
|
});
|
|
38
|
-
function rn(
|
|
39
|
-
for (var
|
|
40
|
-
const v = d[
|
|
38
|
+
function rn(l, d) {
|
|
39
|
+
for (var f = 0; f < d.length; f++) {
|
|
40
|
+
const v = d[f];
|
|
41
41
|
if (typeof v != "string" && !Array.isArray(v)) {
|
|
42
42
|
for (const g in v)
|
|
43
|
-
if (g !== "default" && !(g in
|
|
43
|
+
if (g !== "default" && !(g in l)) {
|
|
44
44
|
const y = Object.getOwnPropertyDescriptor(v, g);
|
|
45
|
-
y && Object.defineProperty(
|
|
45
|
+
y && Object.defineProperty(l, g, y.get ? y : {
|
|
46
46
|
enumerable: !0,
|
|
47
47
|
get: () => v[g]
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
return Object.freeze(Object.defineProperty(
|
|
52
|
+
return Object.freeze(Object.defineProperty(l, Symbol.toStringTag, { value: "Module" }));
|
|
53
53
|
}
|
|
54
|
-
function on(
|
|
54
|
+
function on(l, d, f) {
|
|
55
55
|
return J(this, null, function* () {
|
|
56
|
-
if (!
|
|
56
|
+
if (!l.contentWindow)
|
|
57
57
|
throw new Error("Invalid iframe: contentWindow is null");
|
|
58
58
|
const v = yield Promise.resolve().then(() => ke);
|
|
59
59
|
try {
|
|
60
|
-
yield v.send(
|
|
60
|
+
yield v.send(l.contentWindow, "SET_APPEARANCE", { appearance: d, identifier: f });
|
|
61
61
|
} catch (g) {
|
|
62
62
|
console.error("Failed to send appearance config:", g);
|
|
63
63
|
}
|
|
@@ -71,18 +71,18 @@ const Wt = "https://app.soyio.id", Ct = "https://sandbox.soyio.id", an = [
|
|
|
71
71
|
"DENIED_CAMERA_PERMISSION",
|
|
72
72
|
"REJECTED_SIGNATURE"
|
|
73
73
|
], sn = "WIDGET_CLOSED", cn = 420, un = 720, dn = 500;
|
|
74
|
-
function fn(
|
|
75
|
-
const d = document.getElementById(
|
|
74
|
+
function fn(l) {
|
|
75
|
+
const d = document.getElementById(l);
|
|
76
76
|
d && (console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."), d.remove());
|
|
77
77
|
}
|
|
78
|
-
function ln(
|
|
79
|
-
const d = document.querySelector(
|
|
78
|
+
function ln(l) {
|
|
79
|
+
const d = document.querySelector(l);
|
|
80
80
|
if (!d)
|
|
81
|
-
throw new Error(`Iframe div container with id '${
|
|
81
|
+
throw new Error(`Iframe div container with id '${l}' not found`);
|
|
82
82
|
if (d.tagName.toLowerCase() !== "div")
|
|
83
|
-
throw new Error(`Iframe container with id '${
|
|
84
|
-
const
|
|
85
|
-
return
|
|
83
|
+
throw new Error(`Iframe container with id '${l}' must be a <div> element`);
|
|
84
|
+
const f = d;
|
|
85
|
+
return f.style.position = "relative", f.style.cssText += `
|
|
86
86
|
padding: 0 !important;
|
|
87
87
|
margin: 0 !important;
|
|
88
88
|
display: flex !important;
|
|
@@ -91,11 +91,11 @@ function ln(f) {
|
|
|
91
91
|
border: none !important;
|
|
92
92
|
transition: height 0.35s !important;
|
|
93
93
|
opacity: 1 !important;
|
|
94
|
-
`,
|
|
94
|
+
`, f;
|
|
95
95
|
}
|
|
96
|
-
function hn(
|
|
97
|
-
const
|
|
98
|
-
return
|
|
96
|
+
function hn(l, d) {
|
|
97
|
+
const f = document.createElement("iframe");
|
|
98
|
+
return f.id = d, f.src = l, f.style.cssText += `
|
|
99
99
|
width: 100% !important;
|
|
100
100
|
min-width: 375px !important;
|
|
101
101
|
max-width: 36rem !important;
|
|
@@ -105,16 +105,16 @@ function hn(f, d) {
|
|
|
105
105
|
opacity: 1;
|
|
106
106
|
transition: height 0.35s,
|
|
107
107
|
opacity 0.4s 0.1s;
|
|
108
|
-
`,
|
|
108
|
+
`, f;
|
|
109
109
|
}
|
|
110
|
-
function mn(
|
|
110
|
+
function mn(l) {
|
|
111
111
|
var E;
|
|
112
|
-
const d = ["actionToken", "entityId", "context"],
|
|
112
|
+
const d = ["actionToken", "entityId", "context", "optionalReconsentBehavior", "mandatoryReconsentBehavior"], f = (E = l.isSandbox) != null ? E : !1, v = l.developmentUrl || (f ? Ct : Wt), g = new URLSearchParams();
|
|
113
113
|
d.forEach((C) => {
|
|
114
|
-
|
|
114
|
+
l[C] && g.set(C, l[C]);
|
|
115
115
|
});
|
|
116
116
|
const y = g.toString();
|
|
117
|
-
return `${v}/embed/consents/${
|
|
117
|
+
return `${v}/embed/consents/${l.consentTemplateId}${y ? `?${y}` : ""}`;
|
|
118
118
|
}
|
|
119
119
|
const pn = "IFRAME_READY", vn = "CONSENT_STATE_CHANGE", wn = "IFRAME_HEIGHT_CHANGE", gn = "TOOLTIP_STATE_CHANGE", q = {
|
|
120
120
|
onHeightChange: {},
|
|
@@ -125,41 +125,41 @@ const pn = "IFRAME_READY", vn = "CONSENT_STATE_CHANGE", wn = "IFRAME_HEIGHT_CHAN
|
|
|
125
125
|
let Et, xt, bt, St;
|
|
126
126
|
function yn() {
|
|
127
127
|
return J(this, null, function* () {
|
|
128
|
-
const
|
|
129
|
-
Et || xt || bt || St || (Et =
|
|
130
|
-
const
|
|
128
|
+
const l = yield Promise.resolve().then(() => ke);
|
|
129
|
+
Et || xt || bt || St || (Et = l.on(wn, (d) => J(this, null, function* () {
|
|
130
|
+
const f = d.data, v = q.onHeightChange[f.identifier];
|
|
131
131
|
if (!v)
|
|
132
|
-
throw new Error(`No height change listener found for identifier: ${
|
|
133
|
-
v(
|
|
134
|
-
})), xt =
|
|
135
|
-
const
|
|
132
|
+
throw new Error(`No height change listener found for identifier: ${f.identifier}`);
|
|
133
|
+
v(f.height);
|
|
134
|
+
})), xt = l.on(pn, (d) => J(this, null, function* () {
|
|
135
|
+
const f = d.data, v = q.onIframeReady[f.identifier];
|
|
136
136
|
if (!v)
|
|
137
|
-
throw new Error(`No iframe ready listener found for identifier: ${
|
|
137
|
+
throw new Error(`No iframe ready listener found for identifier: ${f.identifier}`);
|
|
138
138
|
v();
|
|
139
|
-
})), bt =
|
|
140
|
-
const
|
|
139
|
+
})), bt = l.on(vn, (d) => J(this, null, function* () {
|
|
140
|
+
const f = d.data, v = q.onStateChange[f.identifier];
|
|
141
141
|
if (!v)
|
|
142
|
-
throw new Error(`No state change listener found for identifier: ${
|
|
143
|
-
v(
|
|
144
|
-
})), St =
|
|
145
|
-
const
|
|
142
|
+
throw new Error(`No state change listener found for identifier: ${f.identifier}`);
|
|
143
|
+
v(f);
|
|
144
|
+
})), St = l.on(gn, (d) => J(this, null, function* () {
|
|
145
|
+
const f = d.data, v = q.onTooltipChange[f.identifier];
|
|
146
146
|
if (!v)
|
|
147
|
-
throw new Error(`No tooltip change listener found for identifier: ${
|
|
148
|
-
v(
|
|
147
|
+
throw new Error(`No tooltip change listener found for identifier: ${f.identifier}`);
|
|
148
|
+
v(f);
|
|
149
149
|
})));
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function En(
|
|
152
|
+
function En(l, d) {
|
|
153
153
|
const {
|
|
154
|
-
onHeightChange:
|
|
154
|
+
onHeightChange: f,
|
|
155
155
|
onIframeReady: v,
|
|
156
156
|
onStateChange: g,
|
|
157
157
|
onTooltipChange: y
|
|
158
158
|
} = d;
|
|
159
|
-
q.onHeightChange[
|
|
159
|
+
q.onHeightChange[l] = f, q.onIframeReady[l] = v, q.onStateChange[l] = g, q.onTooltipChange[l] = y;
|
|
160
160
|
}
|
|
161
|
-
function xn(
|
|
162
|
-
delete q.onHeightChange[
|
|
161
|
+
function xn(l) {
|
|
162
|
+
delete q.onHeightChange[l], delete q.onIframeReady[l], delete q.onStateChange[l], delete q.onTooltipChange[l];
|
|
163
163
|
}
|
|
164
164
|
class bn {
|
|
165
165
|
constructor(d) {
|
|
@@ -183,8 +183,8 @@ class bn {
|
|
|
183
183
|
flex-direction: column;
|
|
184
184
|
gap: 1rem;
|
|
185
185
|
`;
|
|
186
|
-
const
|
|
187
|
-
|
|
186
|
+
const f = document.createElement("div");
|
|
187
|
+
f.style.cssText = `
|
|
188
188
|
padding: 1rem;
|
|
189
189
|
height: 100%;
|
|
190
190
|
max-width: 100%;
|
|
@@ -252,8 +252,8 @@ class bn {
|
|
|
252
252
|
flex-direction: column;
|
|
253
253
|
gap: 0.5rem;
|
|
254
254
|
`;
|
|
255
|
-
const
|
|
256
|
-
|
|
255
|
+
const G = document.createElement("div");
|
|
256
|
+
G.style.cssText = `
|
|
257
257
|
height: 0.875rem;
|
|
258
258
|
width: 80%;
|
|
259
259
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
@@ -278,7 +278,7 @@ class bn {
|
|
|
278
278
|
}
|
|
279
279
|
`, document.head.appendChild(V);
|
|
280
280
|
}
|
|
281
|
-
v.appendChild(g), v.appendChild(y), v.appendChild(E), M.appendChild(
|
|
281
|
+
v.appendChild(g), v.appendChild(y), v.appendChild(E), M.appendChild(G), M.appendChild(oe), C.appendChild(N), C.appendChild(M), f.appendChild(v), f.appendChild(C), this.element.appendChild(f);
|
|
282
282
|
}
|
|
283
283
|
cleanupExistingSkeleton() {
|
|
284
284
|
const d = document.getElementById(this.identifier);
|
|
@@ -318,8 +318,8 @@ class Sn {
|
|
|
318
318
|
transform: translateX(-50%) translateY(-100%);
|
|
319
319
|
margin-top: -8px;
|
|
320
320
|
`, this.tooltipContent = document.createElement("div"), this.tooltipContent.style.cssText = "text-align: center;", this.tooltipElement.appendChild(this.tooltipContent);
|
|
321
|
-
const
|
|
322
|
-
|
|
321
|
+
const f = document.createElement("div");
|
|
322
|
+
f.style.cssText = `
|
|
323
323
|
position: absolute;
|
|
324
324
|
bottom: -4px;
|
|
325
325
|
left: 50%;
|
|
@@ -328,13 +328,13 @@ class Sn {
|
|
|
328
328
|
height: 8px;
|
|
329
329
|
background: white;
|
|
330
330
|
box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
|
|
331
|
-
`, this.tooltipElement.appendChild(
|
|
331
|
+
`, this.tooltipElement.appendChild(f), document.body.appendChild(this.tooltipElement);
|
|
332
332
|
}
|
|
333
333
|
setupGlobalListeners() {
|
|
334
334
|
window.addEventListener("scroll", () => this.hide(), !0), window.addEventListener("resize", () => this.hide()), window.addEventListener("orientationchange", () => this.hide());
|
|
335
335
|
}
|
|
336
|
-
show(d,
|
|
337
|
-
!this.tooltipElement || !this.tooltipContent || (this.hideTimeout && (clearTimeout(this.hideTimeout), this.hideTimeout = null), this.tooltipContent.textContent = d, this.tooltipElement.style.left = `${
|
|
336
|
+
show(d, f, v) {
|
|
337
|
+
!this.tooltipElement || !this.tooltipContent || (this.hideTimeout && (clearTimeout(this.hideTimeout), this.hideTimeout = null), this.tooltipContent.textContent = d, this.tooltipElement.style.left = `${f}px`, this.tooltipElement.style.top = `${v}px`, this.tooltipElement.style.opacity = "1");
|
|
338
338
|
}
|
|
339
339
|
hide() {
|
|
340
340
|
this.tooltipElement && (this.tooltipElement.style.opacity = "0");
|
|
@@ -358,7 +358,10 @@ class Hn {
|
|
|
358
358
|
this.options = d, this.appearance = d.appearance || null, this.tooltipManager = new Sn(), this.skeleton = new bn(this.uniqueIdentifier), this.setup();
|
|
359
359
|
}
|
|
360
360
|
handleHeightChange(d) {
|
|
361
|
-
this.iframe
|
|
361
|
+
if (!this.iframe || (this.iframe.style.height = `${d}px`, d > 0))
|
|
362
|
+
return;
|
|
363
|
+
const { parentElement: f } = this.iframe;
|
|
364
|
+
f && (f.style.display = "none");
|
|
362
365
|
}
|
|
363
366
|
handleIframeReady() {
|
|
364
367
|
return J(this, null, function* () {
|
|
@@ -366,10 +369,10 @@ class Hn {
|
|
|
366
369
|
});
|
|
367
370
|
}
|
|
368
371
|
handleStateChange(d) {
|
|
369
|
-
const { isSelected:
|
|
370
|
-
this.state = { isSelected:
|
|
372
|
+
const { isSelected: f, actionToken: v } = d;
|
|
373
|
+
this.state = { isSelected: f, actionToken: v }, this.options.onEvent({
|
|
371
374
|
eventName: "CONSENT_CHECKBOX_CHANGE",
|
|
372
|
-
isSelected:
|
|
375
|
+
isSelected: f,
|
|
373
376
|
actionToken: v
|
|
374
377
|
});
|
|
375
378
|
}
|
|
@@ -386,13 +389,13 @@ class Hn {
|
|
|
386
389
|
handleTooltipChange(d) {
|
|
387
390
|
if (!this.iframe)
|
|
388
391
|
return;
|
|
389
|
-
const
|
|
392
|
+
const f = this.iframe.getBoundingClientRect(), { text: v, coordinates: g, isVisible: y } = d, E = g.x + f.left, C = g.y + f.top;
|
|
390
393
|
y ? this.tooltipManager.show(v, E, C) : this.tooltipManager.hide();
|
|
391
394
|
}
|
|
392
395
|
mount(d) {
|
|
393
396
|
fn(this.iframeIdentifier);
|
|
394
|
-
const
|
|
395
|
-
return this.iframe = hn(v, this.iframeIdentifier), this.skeleton.mount(
|
|
397
|
+
const f = ln(d), v = mn(this.options);
|
|
398
|
+
return this.iframe = hn(v, this.iframeIdentifier), this.skeleton.mount(f), f.appendChild(this.iframe), this;
|
|
396
399
|
}
|
|
397
400
|
unmount() {
|
|
398
401
|
xn(this.uniqueIdentifier), this.skeleton.hide(), this.iframe && (this.iframe.remove(), this.iframe = null);
|
|
@@ -410,19 +413,19 @@ class Hn {
|
|
|
410
413
|
const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
411
414
|
__proto__: null
|
|
412
415
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
413
|
-
function Wn(
|
|
416
|
+
function Wn(l) {
|
|
414
417
|
let d = "widget/";
|
|
415
|
-
return "disclosureRequestId" in
|
|
418
|
+
return "disclosureRequestId" in l.configProps ? d += ["disclosures", l.configProps.disclosureRequestId].join("/") : d += l.request, d;
|
|
416
419
|
}
|
|
417
|
-
function Cn(
|
|
420
|
+
function Cn(l) {
|
|
418
421
|
var y;
|
|
419
|
-
const d = (y =
|
|
420
|
-
return `${
|
|
422
|
+
const d = (y = l.isSandbox) != null ? y : !1, f = l.developmentUrl || (d ? Ct : Wt), v = Object.entries(l.configProps).filter(([E, C]) => C || E === "disclosureRequestId").map(([E, C]) => `${E}=${encodeURIComponent(C)}`).join("&"), g = Wn(l);
|
|
423
|
+
return `${f}/${g}?sdk=web&${v}`;
|
|
421
424
|
}
|
|
422
425
|
const In = !!(typeof window != "undefined" && window.document && window.document.createElement);
|
|
423
426
|
let Z = null, je = null;
|
|
424
|
-
function Me(
|
|
425
|
-
Z && !Z.closed && Z.focus(),
|
|
427
|
+
function Me(l = null) {
|
|
428
|
+
Z && !Z.closed && Z.focus(), l == null || l.preventDefault();
|
|
426
429
|
}
|
|
427
430
|
function Le() {
|
|
428
431
|
document.body.style.filter = "", document.body.removeEventListener("click", Me);
|
|
@@ -432,36 +435,36 @@ function Pn() {
|
|
|
432
435
|
(!Z || Z.closed) && (je && clearInterval(je), Le());
|
|
433
436
|
}, dn);
|
|
434
437
|
}
|
|
435
|
-
function Tn(
|
|
436
|
-
const d = Cn(
|
|
438
|
+
function Tn(l) {
|
|
439
|
+
const d = Cn(l), f = cn, v = un, g = window.screenLeft !== void 0 ? window.screenLeft : window.screenX, y = window.screenTop !== void 0 ? window.screenTop : window.screenY, E = window.innerWidth || document.documentElement.clientWidth || window.screen.width, C = window.innerHeight || document.documentElement.clientHeight || window.screen.height, N = E / window.screen.availWidth, M = (E - f) / 2 / N + g, G = (C - v) / 2 / N + y;
|
|
437
440
|
document.body.style.filter = "blur(5px)", document.body.addEventListener("click", Me), Z = window.open(
|
|
438
441
|
d,
|
|
439
442
|
"Soyio",
|
|
440
443
|
`scrollbars=yes,
|
|
441
|
-
width=${
|
|
444
|
+
width=${f},
|
|
442
445
|
height=${v},
|
|
443
|
-
top=${
|
|
446
|
+
top=${G},
|
|
444
447
|
left=${M}`
|
|
445
448
|
), Me(), Pn();
|
|
446
449
|
}
|
|
447
|
-
function
|
|
450
|
+
function Rn() {
|
|
448
451
|
Z && (Z.close(), Z = null), Le();
|
|
449
452
|
}
|
|
450
|
-
const
|
|
453
|
+
const On = "WIDGET_EVENT";
|
|
451
454
|
let me = null;
|
|
452
455
|
function An() {
|
|
453
456
|
me && (me.cancel(), me = null);
|
|
454
457
|
}
|
|
455
|
-
function Nn(
|
|
458
|
+
function Nn(l) {
|
|
456
459
|
return J(this, null, function* () {
|
|
457
|
-
const { onEvent: d } =
|
|
458
|
-
me && An(), me =
|
|
459
|
-
d(v.data), an.includes(v.data.eventName) ?
|
|
460
|
+
const { onEvent: d } = l, f = yield Promise.resolve().then(() => ke);
|
|
461
|
+
me && An(), me = f.on(On, (v) => J(this, null, function* () {
|
|
462
|
+
d(v.data), an.includes(v.data.eventName) ? Rn() : v.data.eventName === sn && Le();
|
|
460
463
|
}));
|
|
461
464
|
});
|
|
462
465
|
}
|
|
463
|
-
function Dn(
|
|
464
|
-
Nn(
|
|
466
|
+
function Dn(l) {
|
|
467
|
+
Nn(l);
|
|
465
468
|
}
|
|
466
469
|
var be, It;
|
|
467
470
|
class Un {
|
|
@@ -477,15 +480,15 @@ be = new WeakSet(), It = function(d) {
|
|
|
477
480
|
this.onEvent(d);
|
|
478
481
|
};
|
|
479
482
|
var zn = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
480
|
-
function jn(
|
|
481
|
-
return
|
|
483
|
+
function jn(l) {
|
|
484
|
+
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
482
485
|
}
|
|
483
486
|
var Pt = { exports: {} }, Tt = { exports: {} };
|
|
484
|
-
(function(
|
|
485
|
-
(function(
|
|
486
|
-
|
|
487
|
+
(function(l, d) {
|
|
488
|
+
(function(f, v) {
|
|
489
|
+
l.exports = v();
|
|
487
490
|
})(typeof self != "undefined" ? self : zn, function() {
|
|
488
|
-
return function(
|
|
491
|
+
return function(f) {
|
|
489
492
|
var v = {};
|
|
490
493
|
function g(y) {
|
|
491
494
|
if (v[y])
|
|
@@ -495,9 +498,9 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
495
498
|
l: !1,
|
|
496
499
|
exports: {}
|
|
497
500
|
};
|
|
498
|
-
return
|
|
501
|
+
return f[y].call(E.exports, E, E.exports, g), E.l = !0, E.exports;
|
|
499
502
|
}
|
|
500
|
-
return g.m =
|
|
503
|
+
return g.m = f, g.c = v, g.d = function(y, E, C) {
|
|
501
504
|
g.o(y, E) || Object.defineProperty(y, E, {
|
|
502
505
|
enumerable: !0,
|
|
503
506
|
get: C
|
|
@@ -531,13 +534,13 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
531
534
|
}, g.o = function(y, E) {
|
|
532
535
|
return {}.hasOwnProperty.call(y, E);
|
|
533
536
|
}, g.p = "", g(g.s = 0);
|
|
534
|
-
}([function(
|
|
537
|
+
}([function(f, v, g) {
|
|
535
538
|
g.r(v), g.d(v, "Promise", function() {
|
|
536
539
|
return I;
|
|
537
540
|
}), g.d(v, "TYPES", function() {
|
|
538
541
|
return Xt;
|
|
539
542
|
}), g.d(v, "ProxyWindow", function() {
|
|
540
|
-
return
|
|
543
|
+
return B;
|
|
541
544
|
}), g.d(v, "setup", function() {
|
|
542
545
|
return pt;
|
|
543
546
|
}), g.d(v, "destroy", function() {
|
|
@@ -581,7 +584,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
581
584
|
function M(e) {
|
|
582
585
|
return e === void 0 && (e = window), N(e) === "about:";
|
|
583
586
|
}
|
|
584
|
-
function
|
|
587
|
+
function G(e) {
|
|
585
588
|
if (e === void 0 && (e = window), e)
|
|
586
589
|
try {
|
|
587
590
|
if (e.parent && e.parent !== e)
|
|
@@ -590,7 +593,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
590
593
|
}
|
|
591
594
|
}
|
|
592
595
|
function oe(e) {
|
|
593
|
-
if (e === void 0 && (e = window), e && !
|
|
596
|
+
if (e === void 0 && (e = window), e && !G(e))
|
|
594
597
|
try {
|
|
595
598
|
return e.opener;
|
|
596
599
|
} catch (n) {
|
|
@@ -614,7 +617,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
614
617
|
if (t === "file:")
|
|
615
618
|
return "file://";
|
|
616
619
|
if (t === "about:") {
|
|
617
|
-
var r =
|
|
620
|
+
var r = G(e);
|
|
618
621
|
return r && V() ? pe(r) : "about://";
|
|
619
622
|
}
|
|
620
623
|
var o = n.host;
|
|
@@ -675,7 +678,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
675
678
|
function He(e, n) {
|
|
676
679
|
if (!e || !n)
|
|
677
680
|
return !1;
|
|
678
|
-
var t =
|
|
681
|
+
var t = G(n);
|
|
679
682
|
return t ? t === e : function(r) {
|
|
680
683
|
var o = [];
|
|
681
684
|
try {
|
|
@@ -725,7 +728,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
725
728
|
}
|
|
726
729
|
return n;
|
|
727
730
|
}
|
|
728
|
-
var
|
|
731
|
+
var Ot = [], At = [];
|
|
729
732
|
function $(e, n) {
|
|
730
733
|
n === void 0 && (n = !0);
|
|
731
734
|
try {
|
|
@@ -765,7 +768,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
765
768
|
} catch (u) {
|
|
766
769
|
}
|
|
767
770
|
return -1;
|
|
768
|
-
}(
|
|
771
|
+
}(Ot, e);
|
|
769
772
|
if (t !== -1) {
|
|
770
773
|
var r = At[t];
|
|
771
774
|
if (r && function(o) {
|
|
@@ -785,7 +788,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
785
788
|
return !1;
|
|
786
789
|
}
|
|
787
790
|
function Ue(e) {
|
|
788
|
-
return e === void 0 && (e = window), oe(e = e || window) ||
|
|
791
|
+
return e === void 0 && (e = window), oe(e = e || window) || G(e) || void 0;
|
|
789
792
|
}
|
|
790
793
|
function re(e, n) {
|
|
791
794
|
if (typeof e == "string") {
|
|
@@ -854,7 +857,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
854
857
|
}
|
|
855
858
|
return !1;
|
|
856
859
|
}
|
|
857
|
-
function
|
|
860
|
+
function Be(e) {
|
|
858
861
|
if (Q(e))
|
|
859
862
|
return ve(e).frameElement;
|
|
860
863
|
for (var n = 0, t = document.querySelectorAll("iframe"); n < t.length; n++) {
|
|
@@ -865,9 +868,9 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
865
868
|
}
|
|
866
869
|
function Nt(e) {
|
|
867
870
|
if (function(t) {
|
|
868
|
-
return t === void 0 && (t = window), !!
|
|
871
|
+
return t === void 0 && (t = window), !!G(t);
|
|
869
872
|
}(e)) {
|
|
870
|
-
var n =
|
|
873
|
+
var n = Be(e);
|
|
871
874
|
if (n && n.parentElement) {
|
|
872
875
|
n.parentElement.removeChild(n);
|
|
873
876
|
return;
|
|
@@ -899,7 +902,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
899
902
|
}
|
|
900
903
|
return !1;
|
|
901
904
|
}
|
|
902
|
-
var
|
|
905
|
+
var Ge = [], ie = [], Se = 0, ae;
|
|
903
906
|
function $e() {
|
|
904
907
|
if (!Se && ae) {
|
|
905
908
|
var e = ae;
|
|
@@ -950,8 +953,8 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
950
953
|
}
|
|
951
954
|
return this.rejected = !0, this.error = t, this.errorHandled || setTimeout(function() {
|
|
952
955
|
r.errorHandled || function(i, a) {
|
|
953
|
-
if (
|
|
954
|
-
|
|
956
|
+
if (Ge.indexOf(i) === -1) {
|
|
957
|
+
Ge.push(i), setTimeout(function() {
|
|
955
958
|
throw i;
|
|
956
959
|
}, 1);
|
|
957
960
|
for (var u = 0; u < ie.length; u++)
|
|
@@ -1642,7 +1645,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1642
1645
|
return clearInterval(n), e(window.document.body);
|
|
1643
1646
|
}, 10);
|
|
1644
1647
|
});
|
|
1645
|
-
function
|
|
1648
|
+
function Re() {
|
|
1646
1649
|
for (var e = z("idToProxyWindow"), n = 0, t = e.keys(); n < t.length; n++) {
|
|
1647
1650
|
var r = t[n];
|
|
1648
1651
|
e.get(r).shouldClean() && e.del(r);
|
|
@@ -1702,11 +1705,11 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1702
1705
|
if (!x)
|
|
1703
1706
|
throw new Error("Can not post to window without target name");
|
|
1704
1707
|
(function(b) {
|
|
1705
|
-
var P = b.url, D = b.target,
|
|
1706
|
-
if (W.setAttribute("target", D), W.setAttribute("method", j), W.setAttribute("action", P), W.style.display = "none",
|
|
1707
|
-
for (var
|
|
1708
|
-
var A, he = _[
|
|
1709
|
-
De.setAttribute("name", he), De.setAttribute("value", (A =
|
|
1708
|
+
var P = b.url, D = b.target, R = b.body, T = b.method, j = T === void 0 ? "post" : T, W = document.createElement("form");
|
|
1709
|
+
if (W.setAttribute("target", D), W.setAttribute("method", j), W.setAttribute("action", P), W.style.display = "none", R)
|
|
1710
|
+
for (var O = 0, _ = Object.keys(R); O < _.length; O++) {
|
|
1711
|
+
var A, he = _[O], De = document.createElement("input");
|
|
1712
|
+
De.setAttribute("name", he), De.setAttribute("value", (A = R[he]) == null ? void 0 : A.toString()), W.appendChild(De);
|
|
1710
1713
|
}
|
|
1711
1714
|
Ve().appendChild(W), W.submit(), Ve().removeChild(W);
|
|
1712
1715
|
})({
|
|
@@ -1731,7 +1734,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1731
1734
|
},
|
|
1732
1735
|
setName: function(c) {
|
|
1733
1736
|
return e.then(function(s) {
|
|
1734
|
-
var p = Q(s), h =
|
|
1737
|
+
var p = Q(s), h = Be(s);
|
|
1735
1738
|
if (!p)
|
|
1736
1739
|
throw new Error("Can not set name for cross-domain window: " + c);
|
|
1737
1740
|
ve(s).name = c, h && h.setAttribute("name", c), i = I.resolve(c);
|
|
@@ -1739,7 +1742,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1739
1742
|
}
|
|
1740
1743
|
};
|
|
1741
1744
|
}
|
|
1742
|
-
var
|
|
1745
|
+
var B = function() {
|
|
1743
1746
|
function e(t) {
|
|
1744
1747
|
var r = t.send, o = t.win, i = t.serializedWindow;
|
|
1745
1748
|
this.id = void 0, this.isProxyWindow = !0, this.serializedWindow = void 0, this.actualWindow = void 0, this.actualWindowPromise = void 0, this.send = void 0, this.name = void 0, this.actualWindowPromise = new I(), this.serializedWindow = i || it(this.actualWindowPromise, {
|
|
@@ -1824,12 +1827,12 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1824
1827
|
return e.isProxyWindow(t) ? t.unwrap() : t;
|
|
1825
1828
|
}, e.serialize = function(t, r) {
|
|
1826
1829
|
var o = r.send;
|
|
1827
|
-
return
|
|
1830
|
+
return Re(), e.toProxyWindow(t, {
|
|
1828
1831
|
send: o
|
|
1829
1832
|
}).serialize();
|
|
1830
1833
|
}, e.deserialize = function(t, r) {
|
|
1831
1834
|
var o = r.send;
|
|
1832
|
-
return
|
|
1835
|
+
return Re(), z("idToProxyWindow").get(t.id) || new e({
|
|
1833
1836
|
serializedWindow: t,
|
|
1834
1837
|
send: o
|
|
1835
1838
|
});
|
|
@@ -1837,7 +1840,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1837
1840
|
return !!(t && !we(t) && t.isProxyWindow);
|
|
1838
1841
|
}, e.toProxyWindow = function(t, r) {
|
|
1839
1842
|
var o = r.send;
|
|
1840
|
-
if (
|
|
1843
|
+
if (Re(), e.isProxyWindow(t))
|
|
1841
1844
|
return t;
|
|
1842
1845
|
var i = t;
|
|
1843
1846
|
return k("winToProxyWindow").get(i) || new e({
|
|
@@ -1846,9 +1849,9 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1846
1849
|
});
|
|
1847
1850
|
}, e;
|
|
1848
1851
|
}();
|
|
1849
|
-
function
|
|
1852
|
+
function Oe(e, n, t, r, o) {
|
|
1850
1853
|
var i = k("methodStore"), a = z("proxyWindowMethods");
|
|
1851
|
-
|
|
1854
|
+
B.isProxyWindow(r) ? a.set(e, {
|
|
1852
1855
|
val: n,
|
|
1853
1856
|
name: t,
|
|
1854
1857
|
domain: o,
|
|
@@ -1879,11 +1882,11 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1879
1882
|
var h = p.source, m = p.origin, w = p.data, S = w.id, x = w.name, b = at(h, S);
|
|
1880
1883
|
if (!b)
|
|
1881
1884
|
throw new Error("Could not find method '" + x + "' with id: " + w.id + " in " + L(window));
|
|
1882
|
-
var P = b.source, D = b.domain,
|
|
1885
|
+
var P = b.source, D = b.domain, R = b.val;
|
|
1883
1886
|
return I.try(function() {
|
|
1884
1887
|
if (!re(D, m))
|
|
1885
1888
|
throw new Error("Method '" + w.name + "' domain " + JSON.stringify(Ie(b.domain) ? b.domain.source : b.domain) + " does not match origin " + m + " in " + L(window));
|
|
1886
|
-
if (
|
|
1889
|
+
if (B.isProxyWindow(P))
|
|
1887
1890
|
return P.matchWindow(h, {
|
|
1888
1891
|
send: u
|
|
1889
1892
|
}).then(function(T) {
|
|
@@ -1891,18 +1894,18 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1891
1894
|
throw new Error("Method call '" + w.name + "' failed - proxy window does not match source in " + L(window));
|
|
1892
1895
|
});
|
|
1893
1896
|
}).then(function() {
|
|
1894
|
-
return
|
|
1897
|
+
return R.apply({
|
|
1895
1898
|
source: h,
|
|
1896
1899
|
origin: m
|
|
1897
1900
|
}, w.args);
|
|
1898
1901
|
}, function(T) {
|
|
1899
1902
|
return I.try(function() {
|
|
1900
|
-
if (
|
|
1901
|
-
return
|
|
1903
|
+
if (R.onError)
|
|
1904
|
+
return R.onError(T);
|
|
1902
1905
|
}).then(function() {
|
|
1903
1906
|
throw T.stack && (T.stack = "Remote call to " + x + "(" + function(j) {
|
|
1904
|
-
return j === void 0 && (j = []), (W = j, [].slice.call(W)).map(function(
|
|
1905
|
-
return typeof
|
|
1907
|
+
return j === void 0 && (j = []), (W = j, [].slice.call(W)).map(function(O) {
|
|
1908
|
+
return typeof O == "string" ? "'" + O + "'" : O === void 0 ? "undefined" : O === null ? "null" : typeof O == "boolean" ? O.toString() : Array.isArray(O) ? "[ ... ]" : typeof O == "object" ? "{ ... }" : typeof O == "function" ? "() => { ... }" : "<" + typeof O + ">";
|
|
1906
1909
|
}).join(", ");
|
|
1907
1910
|
var W;
|
|
1908
1911
|
}(w.args) + `) failed
|
|
@@ -1919,11 +1922,11 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1919
1922
|
});
|
|
1920
1923
|
});
|
|
1921
1924
|
var i, a, u, c = t.__id__ || Y();
|
|
1922
|
-
e =
|
|
1925
|
+
e = B.unwrap(e);
|
|
1923
1926
|
var s = t.__name__ || t.name || r;
|
|
1924
|
-
return typeof s == "string" && typeof s.indexOf == "function" && s.indexOf("anonymous::") === 0 && (s = s.replace("anonymous::", r + "::")),
|
|
1925
|
-
|
|
1926
|
-
})) :
|
|
1927
|
+
return typeof s == "string" && typeof s.indexOf == "function" && s.indexOf("anonymous::") === 0 && (s = s.replace("anonymous::", r + "::")), B.isProxyWindow(e) ? (Oe(c, t, s, e, n), e.awaitWindow().then(function(p) {
|
|
1928
|
+
Oe(c, t, s, p, n);
|
|
1929
|
+
})) : Oe(c, t, s, e, n), ne("cross_domain_function", {
|
|
1927
1930
|
id: c,
|
|
1928
1931
|
name: s
|
|
1929
1932
|
});
|
|
@@ -1963,7 +1966,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1963
1966
|
send: a
|
|
1964
1967
|
});
|
|
1965
1968
|
}, o.object = function(u) {
|
|
1966
|
-
return we(u) ||
|
|
1969
|
+
return we(u) || B.isProxyWindow(u) ? ne("cross_domain_window", B.serialize(u, {
|
|
1967
1970
|
send: a
|
|
1968
1971
|
})) : u;
|
|
1969
1972
|
}, o));
|
|
@@ -1991,24 +1994,24 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
1991
1994
|
b === void 0 && (b = {});
|
|
1992
1995
|
function P() {
|
|
1993
1996
|
var D = arguments;
|
|
1994
|
-
return
|
|
1997
|
+
return B.toProxyWindow(u, {
|
|
1995
1998
|
send: w
|
|
1996
|
-
}).awaitWindow().then(function(
|
|
1997
|
-
var T = at(
|
|
1999
|
+
}).awaitWindow().then(function(R) {
|
|
2000
|
+
var T = at(R, h);
|
|
1998
2001
|
if (T && T.val !== P)
|
|
1999
2002
|
return T.val.apply({
|
|
2000
2003
|
source: window,
|
|
2001
2004
|
origin: L()
|
|
2002
2005
|
}, D);
|
|
2003
2006
|
var j = [].slice.call(D);
|
|
2004
|
-
return b.fireAndForget ? w(
|
|
2007
|
+
return b.fireAndForget ? w(R, "postrobot_method", {
|
|
2005
2008
|
id: h,
|
|
2006
2009
|
name: m,
|
|
2007
2010
|
args: j
|
|
2008
2011
|
}, {
|
|
2009
2012
|
domain: c,
|
|
2010
2013
|
fireAndForget: !0
|
|
2011
|
-
}) : w(
|
|
2014
|
+
}) : w(R, "postrobot_method", {
|
|
2012
2015
|
id: h,
|
|
2013
2016
|
name: m,
|
|
2014
2017
|
args: j
|
|
@@ -2018,8 +2021,8 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2018
2021
|
}).then(function(W) {
|
|
2019
2022
|
return W.data.result;
|
|
2020
2023
|
});
|
|
2021
|
-
}).catch(function(
|
|
2022
|
-
throw
|
|
2024
|
+
}).catch(function(R) {
|
|
2025
|
+
throw R;
|
|
2023
2026
|
});
|
|
2024
2027
|
}
|
|
2025
2028
|
return P.__name__ = m, P.__origin__ = c, P.__source__ = u, P.__id__ = h, P.origin = c, P;
|
|
@@ -2031,7 +2034,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2031
2034
|
send: i
|
|
2032
2035
|
});
|
|
2033
2036
|
}, o.cross_domain_window = function(a) {
|
|
2034
|
-
return
|
|
2037
|
+
return B.deserialize(a, {
|
|
2035
2038
|
send: i
|
|
2036
2039
|
});
|
|
2037
2040
|
}, o));
|
|
@@ -2112,7 +2115,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2112
2115
|
}
|
|
2113
2116
|
}
|
|
2114
2117
|
}
|
|
2115
|
-
function
|
|
2118
|
+
function Bt(e, n, t, r) {
|
|
2116
2119
|
var o = r.on, i = r.send, a = ht({
|
|
2117
2120
|
name: t.name,
|
|
2118
2121
|
win: e,
|
|
@@ -2178,7 +2181,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2178
2181
|
throw s;
|
|
2179
2182
|
});
|
|
2180
2183
|
}
|
|
2181
|
-
function
|
|
2184
|
+
function Gt(e, n, t) {
|
|
2182
2185
|
if (!lt(t.hash)) {
|
|
2183
2186
|
var r = dt(t.hash);
|
|
2184
2187
|
if (!r)
|
|
@@ -2246,10 +2249,10 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2246
2249
|
return;
|
|
2247
2250
|
s.origin.indexOf("file:") === 0 && (a = "file://");
|
|
2248
2251
|
try {
|
|
2249
|
-
s.type === "postrobot_message_request" ?
|
|
2252
|
+
s.type === "postrobot_message_request" ? Bt(i, a, s, {
|
|
2250
2253
|
on: t,
|
|
2251
2254
|
send: r
|
|
2252
|
-
}) : s.type === "postrobot_message_response" ? $t(i, a, s) : s.type === "postrobot_message_ack" &&
|
|
2255
|
+
}) : s.type === "postrobot_message_response" ? $t(i, a, s) : s.type === "postrobot_message_ack" && Gt(i, a, s);
|
|
2253
2256
|
} catch (p) {
|
|
2254
2257
|
setTimeout(function() {
|
|
2255
2258
|
throw p;
|
|
@@ -2267,7 +2270,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2267
2270
|
var u = i.name, c = i.win, s = i.domain, p = k("requestListeners");
|
|
2268
2271
|
if (!u || typeof u != "string")
|
|
2269
2272
|
throw new Error("Name required to add request listener");
|
|
2270
|
-
if (c && c !== "*" &&
|
|
2273
|
+
if (c && c !== "*" && B.isProxyWindow(c)) {
|
|
2271
2274
|
var h = c.awaitWindow().then(function(A) {
|
|
2272
2275
|
return o({
|
|
2273
2276
|
name: u,
|
|
@@ -2312,28 +2315,28 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2312
2315
|
}
|
|
2313
2316
|
};
|
|
2314
2317
|
}
|
|
2315
|
-
var
|
|
2318
|
+
var R = ht({
|
|
2316
2319
|
name: u,
|
|
2317
2320
|
win: m,
|
|
2318
2321
|
domain: s
|
|
2319
2322
|
});
|
|
2320
2323
|
m && m !== "*" || (m = xe());
|
|
2321
2324
|
var T = (s = s || "*").toString();
|
|
2322
|
-
if (
|
|
2325
|
+
if (R)
|
|
2323
2326
|
throw m && s ? new Error("Request listener already exists for " + u + " on domain " + s.toString() + " for " + (m === xe() ? "wildcard" : "specified") + " window") : m ? new Error("Request listener already exists for " + u + " for " + (m === xe() ? "wildcard" : "specified") + " window") : s ? new Error("Request listener already exists for " + u + " on domain " + s.toString()) : new Error("Request listener already exists for " + u);
|
|
2324
2327
|
var j = p.getOrSet(m, function() {
|
|
2325
2328
|
return {};
|
|
2326
2329
|
}), W = fe(j, u, function() {
|
|
2327
2330
|
return {};
|
|
2328
|
-
}),
|
|
2329
|
-
return Ie(s) ? (
|
|
2331
|
+
}), O, _;
|
|
2332
|
+
return Ie(s) ? (O = fe(W, "__domain_regex__", function() {
|
|
2330
2333
|
return [];
|
|
2331
2334
|
})).push(_ = {
|
|
2332
2335
|
regex: s,
|
|
2333
2336
|
listener: a
|
|
2334
2337
|
}) : W[T] = a, {
|
|
2335
2338
|
cancel: function() {
|
|
2336
|
-
delete W[T], _ && (
|
|
2339
|
+
delete W[T], _ && (O.splice(O.indexOf(_, 1)), O.length || delete W.__domain_regex__), Object.keys(W).length || delete j[u], m && !Object.keys(j).length && p.del(m);
|
|
2337
2340
|
}
|
|
2338
2341
|
};
|
|
2339
2342
|
}({
|
|
@@ -2364,7 +2367,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2364
2367
|
}
|
|
2365
2368
|
var K = function e(n, t, r, o) {
|
|
2366
2369
|
var i = (o = o || {}).domain || "*", a = o.timeout || -1, u = o.timeout || 5e3, c = o.fireAndForget || !1;
|
|
2367
|
-
return
|
|
2370
|
+
return B.toProxyWindow(n, {
|
|
2368
2371
|
send: e
|
|
2369
2372
|
}).awaitWindow().then(function(s) {
|
|
2370
2373
|
return I.try(function() {
|
|
@@ -2384,25 +2387,25 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2384
2387
|
try {
|
|
2385
2388
|
if (x.top)
|
|
2386
2389
|
return x.top;
|
|
2387
|
-
} catch (
|
|
2390
|
+
} catch (R) {
|
|
2388
2391
|
}
|
|
2389
|
-
if (
|
|
2392
|
+
if (G(x) === x)
|
|
2390
2393
|
return x;
|
|
2391
2394
|
try {
|
|
2392
2395
|
if (He(window, x) && window.top)
|
|
2393
2396
|
return window.top;
|
|
2394
|
-
} catch (
|
|
2397
|
+
} catch (R) {
|
|
2395
2398
|
}
|
|
2396
2399
|
try {
|
|
2397
2400
|
if (He(x, window) && window.top)
|
|
2398
2401
|
return window.top;
|
|
2399
|
-
} catch (
|
|
2402
|
+
} catch (R) {
|
|
2400
2403
|
}
|
|
2401
|
-
for (var b = 0, P = function
|
|
2402
|
-
for (var j = [], W = 0,
|
|
2403
|
-
var _ =
|
|
2404
|
+
for (var b = 0, P = function R(T) {
|
|
2405
|
+
for (var j = [], W = 0, O = Fe(T); W < O.length; W++) {
|
|
2406
|
+
var _ = O[W];
|
|
2404
2407
|
j.push(_);
|
|
2405
|
-
for (var A = 0, he =
|
|
2408
|
+
for (var A = 0, he = R(_); A < he.length; A++)
|
|
2406
2409
|
j.push(he[A]);
|
|
2407
2410
|
}
|
|
2408
2411
|
return j;
|
|
@@ -2411,9 +2414,9 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2411
2414
|
try {
|
|
2412
2415
|
if (D.top)
|
|
2413
2416
|
return D.top;
|
|
2414
|
-
} catch (
|
|
2417
|
+
} catch (R) {
|
|
2415
2418
|
}
|
|
2416
|
-
if (
|
|
2419
|
+
if (G(D) === D)
|
|
2417
2420
|
return D;
|
|
2418
2421
|
}
|
|
2419
2422
|
}(h) === h)
|
|
@@ -2460,8 +2463,8 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2460
2463
|
domain: h,
|
|
2461
2464
|
promise: w
|
|
2462
2465
|
};
|
|
2463
|
-
(function(W,
|
|
2464
|
-
z("responseListeners").set(W,
|
|
2466
|
+
(function(W, O) {
|
|
2467
|
+
z("responseListeners").set(W, O);
|
|
2465
2468
|
})(S, x);
|
|
2466
2469
|
var b = k("requestPromises").getOrSet(s, function() {
|
|
2467
2470
|
return [];
|
|
@@ -2473,7 +2476,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2473
2476
|
});
|
|
2474
2477
|
var P = function(W) {
|
|
2475
2478
|
return k("knownWindows").get(W, !1);
|
|
2476
|
-
}(s) ? 1e4 : 2e3, D = a,
|
|
2479
|
+
}(s) ? 1e4 : 2e3, D = a, R = P, T = D, j = function(W, O) {
|
|
2477
2480
|
var _;
|
|
2478
2481
|
return function A() {
|
|
2479
2482
|
_ = setTimeout(function() {
|
|
@@ -2482,7 +2485,7 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2482
2485
|
return w.reject(new Error("Window closed for " + t + " before " + (x.ack ? "response" : "ack")));
|
|
2483
2486
|
if (x.cancelled)
|
|
2484
2487
|
return w.reject(new Error("Response listener was cancelled for " + t));
|
|
2485
|
-
|
|
2488
|
+
R = Math.max(R - 500, 0), T !== -1 && (T = Math.max(T - 500, 0)), x.ack || R !== 0 ? T === 0 && w.reject(new Error("No response for postMessage " + m + " in " + L() + " in " + D + "ms")) : w.reject(new Error("No ack for postMessage " + m + " in " + L() + " in " + P + "ms"));
|
|
2486
2489
|
})(), A();
|
|
2487
2490
|
}, 500);
|
|
2488
2491
|
}(), {
|
|
@@ -2529,13 +2532,13 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2529
2532
|
});
|
|
2530
2533
|
}
|
|
2531
2534
|
function Yt(e) {
|
|
2532
|
-
return new
|
|
2535
|
+
return new B({
|
|
2533
2536
|
send: K,
|
|
2534
2537
|
win: e
|
|
2535
2538
|
});
|
|
2536
2539
|
}
|
|
2537
2540
|
function Zt(e) {
|
|
2538
|
-
return
|
|
2541
|
+
return B.toProxyWindow(e, {
|
|
2539
2542
|
send: K
|
|
2540
2543
|
});
|
|
2541
2544
|
}
|
|
@@ -2627,14 +2630,14 @@ var Pt = { exports: {} }, Tt = { exports: {} };
|
|
|
2627
2630
|
});
|
|
2628
2631
|
})(Tt);
|
|
2629
2632
|
var Mn = Tt.exports;
|
|
2630
|
-
(function(
|
|
2631
|
-
|
|
2633
|
+
(function(l) {
|
|
2634
|
+
l.exports = Mn, l.exports.default = l.exports;
|
|
2632
2635
|
})(Pt);
|
|
2633
|
-
var
|
|
2634
|
-
const Ln = /* @__PURE__ */ jn(
|
|
2636
|
+
var Rt = Pt.exports;
|
|
2637
|
+
const Ln = /* @__PURE__ */ jn(Rt), ke = /* @__PURE__ */ rn({
|
|
2635
2638
|
__proto__: null,
|
|
2636
2639
|
default: Ln
|
|
2637
|
-
}, [
|
|
2640
|
+
}, [Rt]);
|
|
2638
2641
|
export {
|
|
2639
2642
|
Hn as ConsentBox,
|
|
2640
2643
|
Fn as SoyioTypes,
|
package/dist/index.umd.cjs
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
opacity: 1;
|
|
18
18
|
transition: height 0.35s,
|
|
19
19
|
opacity 0.4s 0.1s;
|
|
20
|
-
`,w}function Gt(p){var E;const v=["actionToken","entityId","context"],w=(E=p.isSandbox)!=null?E:!1,m=p.developmentUrl||(w?ce:be),g=new URLSearchParams;v.forEach(
|
|
20
|
+
`,w}function Gt(p){var E;const v=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],w=(E=p.isSandbox)!=null?E:!1,m=p.developmentUrl||(w?ce:be),g=new URLSearchParams;v.forEach(R=>{p[R]&&g.set(R,p[R])});const y=g.toString();return`${m}/embed/consents/${p.consentTemplateId}${y?`?${y}`:""}`}const _t="IFRAME_READY",$t="CONSENT_STATE_CHANGE",qt="IFRAME_HEIGHT_CHANGE",Jt="TOOLTIP_STATE_CHANGE",_={onHeightChange:{},onIframeReady:{},onStateChange:{},onTooltipChange:{}};let Ze,Ve,Xe,Ke;function Yt(){return V(this,null,function*(){const p=yield Promise.resolve().then(()=>Me);Ze||Ve||Xe||Ke||(Ze=p.on(qt,v=>V(this,null,function*(){const w=v.data,m=_.onHeightChange[w.identifier];if(!m)throw new Error(`No height change listener found for identifier: ${w.identifier}`);m(w.height)})),Ve=p.on(_t,v=>V(this,null,function*(){const w=v.data,m=_.onIframeReady[w.identifier];if(!m)throw new Error(`No iframe ready listener found for identifier: ${w.identifier}`);m()})),Xe=p.on($t,v=>V(this,null,function*(){const w=v.data,m=_.onStateChange[w.identifier];if(!m)throw new Error(`No state change listener found for identifier: ${w.identifier}`);m(w)})),Ke=p.on(Jt,v=>V(this,null,function*(){const w=v.data,m=_.onTooltipChange[w.identifier];if(!m)throw new Error(`No tooltip change listener found for identifier: ${w.identifier}`);m(w)})))})}function Zt(p,v){const{onHeightChange:w,onIframeReady:m,onStateChange:g,onTooltipChange:y}=v;_.onHeightChange[p]=w,_.onIframeReady[p]=m,_.onStateChange[p]=g,_.onTooltipChange[p]=y}function Vt(p){delete _.onHeightChange[p],delete _.onIframeReady[p],delete _.onStateChange[p],delete _.onTooltipChange[p]}class Xt{constructor(v){F(this,"element");F(this,"identifier");this.identifier=`skeleton-${v}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
|
|
21
21
|
position: absolute;
|
|
22
22
|
left: 50%;
|
|
23
23
|
top: 50%;
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
border-radius: 50%;
|
|
70
70
|
margin-left: auto;
|
|
71
71
|
margin-right: 3px;
|
|
72
|
-
`;const
|
|
72
|
+
`;const R=document.createElement("div");R.style.cssText=`
|
|
73
73
|
display: flex;
|
|
74
74
|
align-items: center;
|
|
75
75
|
gap: 1rem;
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
0% { background-position: 200% 0; }
|
|
107
107
|
100% { background-position: -200% 0; }
|
|
108
108
|
}
|
|
109
|
-
`,document.head.appendChild(ee)}m.appendChild(g),m.appendChild(y),m.appendChild(E),Z.appendChild($),Z.appendChild(le),
|
|
109
|
+
`,document.head.appendChild(ee)}m.appendChild(g),m.appendChild(y),m.appendChild(E),Z.appendChild($),Z.appendChild(le),R.appendChild(Y),R.appendChild(Z),w.appendChild(m),w.appendChild(R),this.element.appendChild(w)}cleanupExistingSkeleton(){const v=document.getElementById(this.identifier);v&&v.remove()}mount(v){this.cleanupExistingSkeleton(),v.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}class Qe{constructor(){F(this,"tooltipElement",null);F(this,"tooltipContent",null);F(this,"tooltipClass","soyio-tooltip");F(this,"hideTimeout",null);this.createTooltipElement(),this.setupGlobalListeners()}createTooltipElement(){const v=document.querySelector(`.${this.tooltipClass}`);v==null||v.remove(),this.tooltipElement=document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
|
|
110
110
|
position: fixed;
|
|
111
111
|
z-index: 99999;
|
|
112
112
|
background: white;
|
|
@@ -131,24 +131,24 @@
|
|
|
131
131
|
height: 8px;
|
|
132
132
|
background: white;
|
|
133
133
|
box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
|
|
134
|
-
`,this.tooltipElement.appendChild(w),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(v,w,m){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=v,this.tooltipElement.style.left=`${w}px`,this.tooltipElement.style.top=`${m}px`,this.tooltipElement.style.opacity="1")}hide(){this.tooltipElement&&(this.tooltipElement.style.opacity="0")}destroy(){var v;(v=this.tooltipElement)==null||v.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}class Kt{constructor(v){F(this,"appearance");F(this,"options");F(this,"tooltipManager");F(this,"skeleton");F(this,"iframe",null);F(this,"state",{isSelected:!1,actionToken:null});this.options=v,this.appearance=v.appearance||null,this.tooltipManager=new Qe,this.skeleton=new Xt(this.uniqueIdentifier),this.setup()}handleHeightChange(v){this.iframe
|
|
134
|
+
`,this.tooltipElement.appendChild(w),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(v,w,m){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=v,this.tooltipElement.style.left=`${w}px`,this.tooltipElement.style.top=`${m}px`,this.tooltipElement.style.opacity="1")}hide(){this.tooltipElement&&(this.tooltipElement.style.opacity="0")}destroy(){var v;(v=this.tooltipElement)==null||v.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}class Kt{constructor(v){F(this,"appearance");F(this,"options");F(this,"tooltipManager");F(this,"skeleton");F(this,"iframe",null);F(this,"state",{isSelected:!1,actionToken:null});this.options=v,this.appearance=v.appearance||null,this.tooltipManager=new Qe,this.skeleton=new Xt(this.uniqueIdentifier),this.setup()}handleHeightChange(v){if(!this.iframe||(this.iframe.style.height=`${v}px`,v>0))return;const{parentElement:w}=this.iframe;w&&(w.style.display="none")}handleIframeReady(){return V(this,null,function*(){this.iframe&&(this.skeleton.hide(),this.options.onReady&&this.options.onReady(),this.appearance&&P(this.iframe,this.appearance,this.uniqueIdentifier))})}handleStateChange(v){const{isSelected:w,actionToken:m}=v;this.state={isSelected:w,actionToken:m},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:w,actionToken:m})}setup(){return V(this,null,function*(){yield Yt(),Zt(this.uniqueIdentifier,{onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onStateChange:this.handleStateChange.bind(this),onTooltipChange:this.handleTooltipChange.bind(this)})})}handleTooltipChange(v){if(!this.iframe)return;const w=this.iframe.getBoundingClientRect(),{text:m,coordinates:g,isVisible:y}=v,E=g.x+w.left,R=g.y+w.top;y?this.tooltipManager.show(m,E,R):this.tooltipManager.hide()}mount(v){Ft(this.iframeIdentifier);const w=Ut(v),m=Gt(this.options);return this.iframe=Bt(m,this.iframeIdentifier),this.skeleton.mount(w),w.appendChild(this.iframe),this}unmount(){Vt(this.uniqueIdentifier),this.skeleton.hide(),this.iframe&&(this.iframe.remove(),this.iframe=null)}getState(){return Mt({},this.state)}get iframeIdentifier(){return`consent-box-${this.uniqueIdentifier}`}get uniqueIdentifier(){return this.options.consentTemplateId}}const Qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function en(p){let v="widget/";return"disclosureRequestId"in p.configProps?v+=["disclosures",p.configProps.disclosureRequestId].join("/"):v+=p.request,v}function tn(p){var y;const v=(y=p.isSandbox)!=null?y:!1,w=p.developmentUrl||(v?ce:be),m=Object.entries(p.configProps).filter(([E,R])=>R||E==="disclosureRequestId").map(([E,R])=>`${E}=${encodeURIComponent(R)}`).join("&"),g=en(p);return`${w}/${g}?sdk=web&${m}`}const nn=!!(typeof window!="undefined"&&window.document&&window.document.createElement);let Q=null,De=null;function ze(p=null){Q&&!Q.closed&&Q.focus(),p==null||p.preventDefault()}function je(){document.body.style.filter="",document.body.removeEventListener("click",ze)}function rn(){De=setInterval(()=>{(!Q||Q.closed)&&(De&&clearInterval(De),je())},de)}function on(p){const v=tn(p),w=ue,m=K,g=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,R=window.innerHeight||document.documentElement.clientHeight||window.screen.height,Y=E/window.screen.availWidth,Z=(E-w)/2/Y+g,$=(R-m)/2/Y+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",ze),Q=window.open(v,"Soyio",`scrollbars=yes,
|
|
135
135
|
width=${w},
|
|
136
136
|
height=${m},
|
|
137
137
|
top=${$},
|
|
138
|
-
left=${Z}`),ze(),rn()}function an(){Q&&(Q.close(),Q=null),je()}const sn="WIDGET_EVENT";let fe=null;function cn(){fe&&(fe.cancel(),fe=null)}function un(p){return V(this,null,function*(){const{onEvent:v}=p,w=yield Promise.resolve().then(()=>Me);fe&&cn(),fe=w.on(sn,m=>V(this,null,function*(){v(m.data),Ae.includes(m.data.eventName)?an():m.data.eventName===Ne&&je()}))})}function dn(p){un(p)}class et{constructor(v){Lt(this,Se);F(this,"onEvent");this.onEvent=v.onEvent,nn&&(on(v),dn({onEvent:kt(this,Se,Ht).bind(this)}))}}Se=new WeakSet,Ht=function(v){this.onEvent(v)};var fn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ln(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var tt={exports:{}},nt={exports:{}};(function(p,v){(function(w,m){p.exports=m()})(typeof self!="undefined"?self:fn,function(){return function(w){var m={};function g(y){if(m[y])return m[y].exports;var E=m[y]={i:y,l:!1,exports:{}};return w[y].call(E.exports,E,E.exports,g),E.l=!0,E.exports}return g.m=w,g.c=m,g.d=function(y,E,
|
|
139
|
-
`;function O(e){return e===void 0&&(e=window),e.location.protocol}function Y(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return O(e)}function Z(e){return e===void 0&&(e=window),Y(e)==="about:"}function $(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function le(e){if(e===void 0&&(e=window),e&&!$(e))try{return e.opener}catch(n){}}function ee(e){try{return!0}catch(n){}return!1}function We(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=O(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=$(e);return r&&ee()?We(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function k(e){e===void 0&&(e=window);var n=We(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function re(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(Z(n)&&ee())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),Y(r)==="mock:"}(n)&&ee())return!0}catch(r){}try{if(We(n)===We(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||Z(e)&&ee()||k(window)===k(e))return!0}catch(n){}return!1}function Ce(e){if(!re(e))throw new Error("Expected window to be same domain");return e}function ot(e,n){if(!e||!n)return!1;var t=$(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch(i){}return o}(n).indexOf(e)!==-1}function it(e){var n=[],t;try{t=e.frames}catch(c){t=e}var r;try{r=t.length}catch(c){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(c){continue}n.push(i)}return n}for(var a=0;a<100;a++){var u=void 0;try{u=t[a]}catch(c){return n}if(!u)return n;n.push(u)}return n}var mn=[],pn=[];function q(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&re(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(u){}return-1}(mn,e);if(t!==-1){var r=pn[t];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function at(e){return e===void 0&&(e=window),le(e=e||window)||$(e)||void 0}function se(e,n){if(typeof e=="string"){if(typeof n=="string")return e==="*"||n===e;if(y(n)||Array.isArray(n))return!1}return y(e)?y(n)?e.toString()===n.toString():!Array.isArray(n)&&!!n.match(e):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!y(n)&&e.some(function(t){return se(t,n)}))}function Ie(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function st(e){if(re(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function vn(e){if(function(t){return t===void 0&&(t=window),!!$(t)}(e)){var n=st(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function oe(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var ct=[],he=[],Le=0,me;function ut(){if(!Le&&me){var e=me;me=null,e.resolve()}}function ke(){Le+=1}function pe(){Le-=1,ut()}var T=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,u=!1,c=!1;ke();try{t(function(s){c?r.resolve(s):(a=!0,o=s)},function(s){c?r.reject(s):(u=!0,i=s)})}catch(s){pe(),this.reject(s);return}pe(),c=!0,a?this.resolve(o):u&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(oe(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(oe(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(ct.indexOf(i)===-1){ct.push(i),setTimeout(function(){throw i},1);for(var u=0;u<he.length;u++)he[u](i,a)}}(t,r)},1),this.dispatch(),this},n.asyncReject=function(t){return this.errorHandled=!0,this.reject(t),this},n.dispatch=function(){var t=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(t||r)){this.dispatching=!0,ke();for(var i=function(h,S){return h.then(function(x){S.resolve(x)},function(x){S.reject(x)})},a=0;a<o.length;a++){var u=o[a],c=u.onSuccess,s=u.onError,l=u.promise,d=void 0;if(t)try{d=c?c(this.value):this.value}catch(h){l.reject(h);continue}else if(r){if(!s){l.reject(this.error);continue}try{d=s(this.error)}catch(h){l.reject(h);continue}}if(d instanceof e&&(d.resolved||d.rejected)){var f=d;f.resolved?l.resolve(f.value):l.reject(f.error),f.errorHandled=!0}else oe(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?l.resolve(d.value):l.reject(d.error):i(d,l):l.resolve(d)}o.length=0,this.dispatching=!1,pe()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:oe(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,l,d){return l.then(function(f){i[s]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},u=0;u<t.length;u++){var c=t[u];if(c instanceof e){if(c.resolved){i[u]=c.value,o-=1;continue}}else if(!oe(c)){i[u]=c,o-=1;continue}a(u,e.resolve(c),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(u){if(t.hasOwnProperty(u)){var c=t[u];oe(c)?o.push(c.then(function(s){r[u]=s})):r[u]=c}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return he.push(r),{cancel:function(){he.splice(he.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;ke();try{i=t.apply(r,o||[])}catch(a){return pe(),e.reject(a)}return pe(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||oe(t)},e.flush=function(){return function(t){var r=me=me||new t;return ut(),r}(e)},e}();function Te(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var He=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Ie(i)&&q(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Ie(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(l){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var i=this.name,a=t[i];a&&a[0]===t?a[1]=r:Object.defineProperty(t,i,{value:[t,r],writable:!0});return}catch(l){}this._cleanupClosedWindows();var u=this.keys,c=this.values,s=Te(u,t);s===-1?(u.push(t),c.push(r)):c[s]=r},n.get=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return r.get(t)}catch(a){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch(a){}this._cleanupClosedWindows();var i=Te(this.keys,t);if(i!==-1)return this.values[i]},n.delete=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(t)}catch(u){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(u){}this._cleanupClosedWindows();var i=this.keys,a=Te(i,t);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},n.has=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return!0}catch(i){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch(i){}return this._cleanupClosedWindows(),Te(this.keys,t)!==-1},n.getOrSet=function(t,r){if(this.has(t))return this.get(t);var o=r();return this.set(t,o),o},e}();function dt(e){return e.name||e.__name__||e.displayName||"anonymous"}function ft(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function X(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(n){if(typeof btoa=="function")return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer!="undefined")return Buffer.from(n,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Pe;function lt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Pe=Pe||new He,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Pe.get(r);return o||(o=typeof r+":"+X(),Pe.set(r,o)),o}(t)+"]":typeof window!="undefined"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}function wn(){return{}}var ve=0,ht=0;function we(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,u=ve;ve+=1;var c=function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];u<ht&&(i=null,a=null,u=ve,ve+=1);var f;f=r?(a=a||new He).getOrSet(this,wn):i=i||{};var h;try{h=lt(l)}catch(R){return e.apply(this,arguments)}var S=f[h];if(S&&o&&Date.now()-S.time<o&&(delete f[h],S=null),S)return S.value;var x=Date.now(),b=e.apply(this,arguments);return f[h]={time:x,value:b},b};return c.reset=function(){i=null,a=null},ft(c,(n.name||dt(e))+"::memoized")}we.clear=function(){ht=ve};function gn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];var c=lt(a);return n.hasOwnProperty(c)||(n[c]=T.try(function(){return e.apply(o,r)}).finally(function(){delete n[c]})),n[c]}return t.reset=function(){n={}},ft(t,dt(e)+"::promiseMemoized")}function ie(){}function ge(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
|
|
140
|
-
`+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+ge(o,n+1)}}function mt(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}we(function(e){if(Object.values)return Object.values(e);var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push(e[t]);return n});function Fe(e){return{}.toString.call(e)==="[object RegExp]"}function ye(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function pt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function vt(){return!!document.body&&document.readyState==="complete"}function wt(){return!!document.body&&document.readyState==="interactive"}we(function(){return new T(function(e){if(vt()||wt())return e();var n=setInterval(function(){if(vt()||wt())return clearInterval(n),e()},10)})});var
|
|
138
|
+
left=${Z}`),ze(),rn()}function an(){Q&&(Q.close(),Q=null),je()}const sn="WIDGET_EVENT";let fe=null;function cn(){fe&&(fe.cancel(),fe=null)}function un(p){return V(this,null,function*(){const{onEvent:v}=p,w=yield Promise.resolve().then(()=>Me);fe&&cn(),fe=w.on(sn,m=>V(this,null,function*(){v(m.data),Ae.includes(m.data.eventName)?an():m.data.eventName===Ne&&je()}))})}function dn(p){un(p)}class et{constructor(v){Lt(this,Se);F(this,"onEvent");this.onEvent=v.onEvent,nn&&(on(v),dn({onEvent:kt(this,Se,Ht).bind(this)}))}}Se=new WeakSet,Ht=function(v){this.onEvent(v)};var fn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ln(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var tt={exports:{}},nt={exports:{}};(function(p,v){(function(w,m){p.exports=m()})(typeof self!="undefined"?self:fn,function(){return function(w){var m={};function g(y){if(m[y])return m[y].exports;var E=m[y]={i:y,l:!1,exports:{}};return w[y].call(E.exports,E,E.exports,g),E.l=!0,E.exports}return g.m=w,g.c=m,g.d=function(y,E,R){g.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:R})},g.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},g.t=function(y,E){if(1&E&&(y=g(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var R=Object.create(null);if(g.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var Y in y)g.d(R,Y,function(Z){return y[Z]}.bind(null,Y));return R},g.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return g.d(E,"a",E),E},g.o=function(y,E){return{}.hasOwnProperty.call(y,E)},g.p="",g(g.s=0)}([function(w,m,g){g.r(m),g.d(m,"Promise",function(){return T}),g.d(m,"TYPES",function(){return jn}),g.d(m,"ProxyWindow",function(){return G}),g.d(m,"setup",function(){return zt}),g.d(m,"destroy",function(){return zn}),g.d(m,"serializeMessage",function(){return On}),g.d(m,"deserializeMessage",function(){return An}),g.d(m,"createProxyWindow",function(){return Nn}),g.d(m,"toProxyWindow",function(){return Dn}),g.d(m,"on",function(){return te}),g.d(m,"once",function(){return Rn}),g.d(m,"send",function(){return ne}),g.d(m,"markWindowKnown",function(){return bt}),g.d(m,"cleanUpWindow",function(){return Mn}),g.d(m,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
|
|
139
|
+
`;function R(e){return e===void 0&&(e=window),e.location.protocol}function Y(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return R(e)}function Z(e){return e===void 0&&(e=window),Y(e)==="about:"}function $(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function le(e){if(e===void 0&&(e=window),e&&!$(e))try{return e.opener}catch(n){}}function ee(e){try{return!0}catch(n){}return!1}function We(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=R(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=$(e);return r&&ee()?We(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function k(e){e===void 0&&(e=window);var n=We(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function re(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(Z(n)&&ee())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),Y(r)==="mock:"}(n)&&ee())return!0}catch(r){}try{if(We(n)===We(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||Z(e)&&ee()||k(window)===k(e))return!0}catch(n){}return!1}function Ce(e){if(!re(e))throw new Error("Expected window to be same domain");return e}function ot(e,n){if(!e||!n)return!1;var t=$(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch(i){}return o}(n).indexOf(e)!==-1}function it(e){var n=[],t;try{t=e.frames}catch(c){t=e}var r;try{r=t.length}catch(c){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(c){continue}n.push(i)}return n}for(var a=0;a<100;a++){var u=void 0;try{u=t[a]}catch(c){return n}if(!u)return n;n.push(u)}return n}var mn=[],pn=[];function q(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&re(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(u){}return-1}(mn,e);if(t!==-1){var r=pn[t];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function at(e){return e===void 0&&(e=window),le(e=e||window)||$(e)||void 0}function se(e,n){if(typeof e=="string"){if(typeof n=="string")return e==="*"||n===e;if(y(n)||Array.isArray(n))return!1}return y(e)?y(n)?e.toString()===n.toString():!Array.isArray(n)&&!!n.match(e):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!y(n)&&e.some(function(t){return se(t,n)}))}function Ie(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function st(e){if(re(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function vn(e){if(function(t){return t===void 0&&(t=window),!!$(t)}(e)){var n=st(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function oe(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var ct=[],he=[],Le=0,me;function ut(){if(!Le&&me){var e=me;me=null,e.resolve()}}function ke(){Le+=1}function pe(){Le-=1,ut()}var T=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,u=!1,c=!1;ke();try{t(function(s){c?r.resolve(s):(a=!0,o=s)},function(s){c?r.reject(s):(u=!0,i=s)})}catch(s){pe(),this.reject(s);return}pe(),c=!0,a?this.resolve(o):u&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(oe(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(oe(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(ct.indexOf(i)===-1){ct.push(i),setTimeout(function(){throw i},1);for(var u=0;u<he.length;u++)he[u](i,a)}}(t,r)},1),this.dispatch(),this},n.asyncReject=function(t){return this.errorHandled=!0,this.reject(t),this},n.dispatch=function(){var t=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(t||r)){this.dispatching=!0,ke();for(var i=function(h,S){return h.then(function(x){S.resolve(x)},function(x){S.reject(x)})},a=0;a<o.length;a++){var u=o[a],c=u.onSuccess,s=u.onError,l=u.promise,d=void 0;if(t)try{d=c?c(this.value):this.value}catch(h){l.reject(h);continue}else if(r){if(!s){l.reject(this.error);continue}try{d=s(this.error)}catch(h){l.reject(h);continue}}if(d instanceof e&&(d.resolved||d.rejected)){var f=d;f.resolved?l.resolve(f.value):l.reject(f.error),f.errorHandled=!0}else oe(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?l.resolve(d.value):l.reject(d.error):i(d,l):l.resolve(d)}o.length=0,this.dispatching=!1,pe()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:oe(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,l,d){return l.then(function(f){i[s]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},u=0;u<t.length;u++){var c=t[u];if(c instanceof e){if(c.resolved){i[u]=c.value,o-=1;continue}}else if(!oe(c)){i[u]=c,o-=1;continue}a(u,e.resolve(c),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(u){if(t.hasOwnProperty(u)){var c=t[u];oe(c)?o.push(c.then(function(s){r[u]=s})):r[u]=c}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return he.push(r),{cancel:function(){he.splice(he.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;ke();try{i=t.apply(r,o||[])}catch(a){return pe(),e.reject(a)}return pe(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||oe(t)},e.flush=function(){return function(t){var r=me=me||new t;return ut(),r}(e)},e}();function Te(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var He=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Ie(i)&&q(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Ie(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(l){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var i=this.name,a=t[i];a&&a[0]===t?a[1]=r:Object.defineProperty(t,i,{value:[t,r],writable:!0});return}catch(l){}this._cleanupClosedWindows();var u=this.keys,c=this.values,s=Te(u,t);s===-1?(u.push(t),c.push(r)):c[s]=r},n.get=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return r.get(t)}catch(a){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch(a){}this._cleanupClosedWindows();var i=Te(this.keys,t);if(i!==-1)return this.values[i]},n.delete=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(t)}catch(u){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(u){}this._cleanupClosedWindows();var i=this.keys,a=Te(i,t);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},n.has=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return!0}catch(i){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch(i){}return this._cleanupClosedWindows(),Te(this.keys,t)!==-1},n.getOrSet=function(t,r){if(this.has(t))return this.get(t);var o=r();return this.set(t,o),o},e}();function dt(e){return e.name||e.__name__||e.displayName||"anonymous"}function ft(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function X(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(n){if(typeof btoa=="function")return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer!="undefined")return Buffer.from(n,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Pe;function lt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Pe=Pe||new He,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Pe.get(r);return o||(o=typeof r+":"+X(),Pe.set(r,o)),o}(t)+"]":typeof window!="undefined"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}function wn(){return{}}var ve=0,ht=0;function we(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,u=ve;ve+=1;var c=function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];u<ht&&(i=null,a=null,u=ve,ve+=1);var f;f=r?(a=a||new He).getOrSet(this,wn):i=i||{};var h;try{h=lt(l)}catch(O){return e.apply(this,arguments)}var S=f[h];if(S&&o&&Date.now()-S.time<o&&(delete f[h],S=null),S)return S.value;var x=Date.now(),b=e.apply(this,arguments);return f[h]={time:x,value:b},b};return c.reset=function(){i=null,a=null},ft(c,(n.name||dt(e))+"::memoized")}we.clear=function(){ht=ve};function gn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];var c=lt(a);return n.hasOwnProperty(c)||(n[c]=T.try(function(){return e.apply(o,r)}).finally(function(){delete n[c]})),n[c]}return t.reset=function(){n={}},ft(t,dt(e)+"::promiseMemoized")}function ie(){}function ge(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
|
|
140
|
+
`+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+ge(o,n+1)}}function mt(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}we(function(e){if(Object.values)return Object.values(e);var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push(e[t]);return n});function Fe(e){return{}.toString.call(e)==="[object RegExp]"}function ye(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function pt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function vt(){return!!document.body&&document.readyState==="complete"}function wt(){return!!document.body&&document.readyState==="interactive"}we(function(){return new T(function(e){if(vt()||wt())return e();var n=setInterval(function(){if(vt()||wt())return clearInterval(n),e()},10)})});var Re=typeof document!="undefined"?document.currentScript:null,yn=we(function(){if(Re||(Re=function(){try{var e=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),t=n&&n[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===t)return i}}catch(a){}}()))return Re;throw new Error("Can not determine current script")}),En=X();we(function(){var e;try{e=yn()}catch(r){return En}var n=e.getAttribute("data-uid");if(n&&typeof n=="string"||(n=e.getAttribute("data-uid-auto"))&&typeof n=="string")return n;if(e.src){var t=function(r){for(var o="",i=0;i<r.length;i++){var a=r[i].charCodeAt(0)*i;r[i+1]&&(a+=r[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:e.src,dataset:e.dataset}));n="uid_"+t.slice(t.length-30)}else n=X();return e.setAttribute("data-uid-auto",n),n});function Ee(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var gt=function(){return{}};function M(e,n){return e===void 0&&(e="store"),n===void 0&&(n=gt),ye(Ee(),e,function(){var t=n();return{has:function(r){return t.hasOwnProperty(r)},get:function(r,o){return t.hasOwnProperty(r)?t[r]:o},set:function(r,o){return t[r]=o,o},del:function(r){delete t[r]},getOrSet:function(r,o){return ye(t,r,o)},reset:function(){t=n()},keys:function(){return Object.keys(t)}}})}var xn=function(){};function Oe(){var e=Ee();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new xn,e.WINDOW_WILDCARD}function H(e,n){return e===void 0&&(e="store"),n===void 0&&(n=gt),M("windowStore").getOrSet(e,function(){var t=new He,r=function(o){return t.getOrSet(o,n)};return{has:function(o){return r(o).hasOwnProperty(e)},get:function(o,i){var a=r(o);return a.hasOwnProperty(e)?a[e]:i},set:function(o,i){return r(o)[e]=i,i},del:function(o){delete r(o)[e]},getOrSet:function(o,i){return ye(r(o),e,i)}}})}function yt(){return M("instance").getOrSet("instanceID",X)}function Et(e,n){var t=n.domain,r=H("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=T.resolve({domain:t});return r.set(e,i),i}function Ue(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:yt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return Et(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function xt(e,n){var t=n.send;return H("windowInstanceIDPromises").getOrSet(e,function(){return Ue(e,{send:t}).then(function(r){return r.instanceID})})}function bt(e){H("knownWindows").set(e,!0)}function Be(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function St(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function ae(e,n){return{__type__:e,__val__:n}}var U,bn=((U={}).function=function(){},U.error=function(e){return ae("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},U.promise=function(){},U.regex=function(e){return ae("regex",e.source)},U.date=function(e){return ae("date",e.toJSON())},U.array=function(e){return e},U.object=function(e){return e},U.string=function(e){return e},U.number=function(e){return e},U.boolean=function(e){return e},U.null=function(e){return e},U[void 0]=function(e){return ae("undefined",e)},U),Sn={},B,Wn=((B={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},B.error=function(e){var n=e.stack,t=e.code,r=e.data,o=new Error(e.message);return o.code=t,r&&(o.data=r),o.stack=n+`
|
|
141
141
|
|
|
142
|
-
`+o.stack,o},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(e){return new RegExp(e)},B.date=function(e){return new Date(e)},B.array=function(e){return e},B.object=function(e){return e},B.string=function(e){return e},B.number=function(e){return e},B.boolean=function(e){return e},B.null=function(e){return e},B[void 0]=function(){},B),Cn={};new T(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function Ge(){for(var e=M("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function Wt(e,n){var t=n.send,r=n.id,o=r===void 0?X():r,i=e.then(function(c){if(re(c))return Ce(c).name}),a=e.then(function(c){if(q(c))throw new Error("Window is closed, can not determine type");return le(c)?"popup":"iframe"});i.catch(ie),a.catch(ie);var u=function(){return e.then(function(c){if(!q(c))return re(c)?Ce(c).name:i})};return{id:o,getType:function(){return a},getInstanceID:gn(function(){return e.then(function(c){return xt(c,{send:t})})}),close:function(){return e.then(vn)},getName:u,focus:function(){return e.then(function(c){c.focus()})},isClosed:function(){return e.then(function(c){return q(c)})},setLocation:function(c,s){return s===void 0&&(s={}),e.then(function(l){var d=window.location.protocol+"//"+window.location.host,f=s.method,h=f===void 0?"get":f,S=s.body;if(c.indexOf("/")===0)c=""+d+c;else if(!c.match(/^https?:\/\//)&&c.indexOf(d)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(c));if(h==="post")return u().then(function(x){if(!x)throw new Error("Can not post to window without target name");(function(b){var
|
|
142
|
+
`+o.stack,o},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(e){return new RegExp(e)},B.date=function(e){return new Date(e)},B.array=function(e){return e},B.object=function(e){return e},B.string=function(e){return e},B.number=function(e){return e},B.boolean=function(e){return e},B.null=function(e){return e},B[void 0]=function(){},B),Cn={};new T(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function Ge(){for(var e=M("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function Wt(e,n){var t=n.send,r=n.id,o=r===void 0?X():r,i=e.then(function(c){if(re(c))return Ce(c).name}),a=e.then(function(c){if(q(c))throw new Error("Window is closed, can not determine type");return le(c)?"popup":"iframe"});i.catch(ie),a.catch(ie);var u=function(){return e.then(function(c){if(!q(c))return re(c)?Ce(c).name:i})};return{id:o,getType:function(){return a},getInstanceID:gn(function(){return e.then(function(c){return xt(c,{send:t})})}),close:function(){return e.then(vn)},getName:u,focus:function(){return e.then(function(c){c.focus()})},isClosed:function(){return e.then(function(c){return q(c)})},setLocation:function(c,s){return s===void 0&&(s={}),e.then(function(l){var d=window.location.protocol+"//"+window.location.host,f=s.method,h=f===void 0?"get":f,S=s.body;if(c.indexOf("/")===0)c=""+d+c;else if(!c.match(/^https?:\/\//)&&c.indexOf(d)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(c));if(h==="post")return u().then(function(x){if(!x)throw new Error("Can not post to window without target name");(function(b){var O=b.url,j=b.target,N=b.body,A=b.method,L=A===void 0?"post":A,W=document.createElement("form");if(W.setAttribute("target",j),W.setAttribute("method",L),W.setAttribute("action",O),W.style.display="none",N)for(var D=0,J=Object.keys(N);D<J.length;D++){var z,xe=J[D],Je=document.createElement("input");Je.setAttribute("name",xe),Je.setAttribute("value",(z=N[xe])==null?void 0:z.toString()),W.appendChild(Je)}pt().appendChild(W),W.submit(),pt().removeChild(W)})({url:c,target:x,method:h,body:S})});if(h!=="get")throw new Error("Unsupported method: "+h);if(re(l))try{if(l.location&&typeof l.location.replace=="function"){l.location.replace(c);return}}catch(x){}l.location=c})},setName:function(c){return e.then(function(s){var l=re(s),d=st(s);if(!l)throw new Error("Can not set name for cross-domain window: "+c);Ce(s).name=c,d&&d.setAttribute("name",c),i=T.resolve(c)})}}}var G=function(){function e(t){var r=t.send,o=t.win,i=t.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new T,this.serializedWindow=i||Wt(this.actualWindowPromise,{send:r}),M("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:r})}var n=e.prototype;return n.getID=function(){return this.serializedWindow.id},n.getType=function(){return this.serializedWindow.getType()},n.isPopup=function(){return this.getType().then(function(t){return t==="popup"})},n.setLocation=function(t,r){var o=this;return this.serializedWindow.setLocation(t,r).then(function(){return o})},n.getName=function(){return this.serializedWindow.getName()},n.setName=function(t){var r=this;return this.serializedWindow.setName(t).then(function(){return r})},n.close=function(){var t=this;return this.serializedWindow.close().then(function(){return t})},n.focus=function(){var t=this,r=this.isPopup(),o=this.getName(),i=T.hash({isPopup:r,name:o}).then(function(u){var c=u.name;u.isPopup&&c&&window.open("",c,"noopener")}),a=this.serializedWindow.focus();return T.all([i,a]).then(function(){return t})},n.isClosed=function(){return this.serializedWindow.isClosed()},n.getWindow=function(){return this.actualWindow},n.setWindow=function(t,r){var o=r.send;this.actualWindow=t,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=Wt(this.actualWindowPromise,{send:o,id:this.getID()}),H("winToProxyWindow").set(t,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(t,r){var o=this,i=r.send;return T.try(function(){return o.actualWindow?t===o.actualWindow:T.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:xt(t,{send:i})}).then(function(a){var u=a.proxyInstanceID===a.knownWindowInstanceID;return u&&o.setWindow(t,{send:i}),u})})},n.unwrap=function(){return this.actualWindow||this},n.getInstanceID=function(){return this.serializedWindow.getInstanceID()},n.shouldClean=function(){return!!(this.actualWindow&&q(this.actualWindow))},n.serialize=function(){return this.serializedWindow},e.unwrap=function(t){return e.isProxyWindow(t)?t.unwrap():t},e.serialize=function(t,r){var o=r.send;return Ge(),e.toProxyWindow(t,{send:o}).serialize()},e.deserialize=function(t,r){var o=r.send;return Ge(),M("idToProxyWindow").get(t.id)||new e({serializedWindow:t,send:o})},e.isProxyWindow=function(t){return!!(t&&!Ie(t)&&t.isProxyWindow)},e.toProxyWindow=function(t,r){var o=r.send;if(Ge(),e.isProxyWindow(t))return t;var i=t;return H("winToProxyWindow").get(i)||new e({win:i,send:o})},e}();function _e(e,n,t,r,o){var i=H("methodStore"),a=M("proxyWindowMethods");G.isProxyWindow(r)?a.set(e,{val:n,name:t,domain:o,source:r}):(a.del(e),i.getOrSet(r,function(){return{}})[e]={domain:o,name:t,val:n,source:r})}function Ct(e,n){var t=H("methodStore"),r=M("proxyWindowMethods");return t.getOrSet(e,function(){return{}})[n]||r.get(n)}function It(e,n,t,r,o){a=(i={on:o.on,send:o.send}).on,u=i.send,M("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(l){var d=l.source,f=l.origin,h=l.data,S=h.id,x=h.name,b=Ct(d,S);if(!b)throw new Error("Could not find method '"+x+"' with id: "+h.id+" in "+k(window));var O=b.source,j=b.domain,N=b.val;return T.try(function(){if(!se(j,f))throw new Error("Method '"+h.name+"' domain "+JSON.stringify(Fe(b.domain)?b.domain.source:b.domain)+" does not match origin "+f+" in "+k(window));if(G.isProxyWindow(O))return O.matchWindow(d,{send:u}).then(function(A){if(!A)throw new Error("Method call '"+h.name+"' failed - proxy window does not match source in "+k(window))})}).then(function(){return N.apply({source:d,origin:f},h.args)},function(A){return T.try(function(){if(N.onError)return N.onError(A)}).then(function(){throw A.stack&&(A.stack="Remote call to "+x+"("+function(L){return L===void 0&&(L=[]),(W=L,[].slice.call(W)).map(function(D){return typeof D=="string"?"'"+D+"'":D===void 0?"undefined":D===null?"null":typeof D=="boolean"?D.toString():Array.isArray(D)?"[ ... ]":typeof D=="object"?"{ ... }":typeof D=="function"?"() => { ... }":"<"+typeof D+">"}).join(", ");var W}(h.args)+`) failed
|
|
143
143
|
|
|
144
|
-
`+A.stack),A})}).then(function(A){return{result:A,id:S,name:x}})})});var i,a,u,c=t.__id__||X();e=G.unwrap(e);var s=t.__name__||t.name||r;return typeof s=="string"&&typeof s.indexOf=="function"&&s.indexOf("anonymous::")===0&&(s=s.replace("anonymous::",r+"::")),G.isProxyWindow(e)?(_e(c,t,s,e,n),e.awaitWindow().then(function(l){_e(c,t,s,l,n)})):_e(c,t,s,e,n),ae("cross_domain_function",{id:c,name:s})}function Tt(e,n,t,r){var o,i=r.on,a=r.send;return function(u,c){c===void 0&&(c=Sn);var s=JSON.stringify(u,function(l){var d=this[l];if(Be(this))return d;var f=St(d);if(!f)return d;var h=c[f]||bn[f];return h?h(d,l):d});return s===void 0?"undefined":s}(t,((o={}).promise=function(u,c){return function(s,l,d,f,h){return ae("cross_domain_zalgo_promise",{then:It(s,l,function(S,x){return d.then(S,x)},f,{on:h.on,send:h.send})})}(e,n,u,c,{on:i,send:a})},o.function=function(u,c){return It(e,n,u,c,{on:i,send:a})},o.object=function(u){return Ie(u)||G.isProxyWindow(u)?ae("cross_domain_window",G.serialize(u,{send:a})):u},o))}function Pt(e,n,t,r){var o,i=r.send;return function(a,u){if(u===void 0&&(u=Cn),a!=="undefined")return JSON.parse(a,function(c,s){if(Be(this))return s;var l,d;if(Be(s)?(l=s.__type__,d=s.__val__):(l=St(s),d=s),!l)return d;var f=u[l]||Wn[l];return f?f(d,c):d})}(t,((o={}).cross_domain_zalgo_promise=function(a){return function(u,c,s){return new T(s.then)}(0,0,a)},o.cross_domain_function=function(a){return function(u,c,s,l){var d=s.id,f=s.name,h=l.send,S=function(b){b===void 0&&(b={});function
|
|
144
|
+
`+A.stack),A})}).then(function(A){return{result:A,id:S,name:x}})})});var i,a,u,c=t.__id__||X();e=G.unwrap(e);var s=t.__name__||t.name||r;return typeof s=="string"&&typeof s.indexOf=="function"&&s.indexOf("anonymous::")===0&&(s=s.replace("anonymous::",r+"::")),G.isProxyWindow(e)?(_e(c,t,s,e,n),e.awaitWindow().then(function(l){_e(c,t,s,l,n)})):_e(c,t,s,e,n),ae("cross_domain_function",{id:c,name:s})}function Tt(e,n,t,r){var o,i=r.on,a=r.send;return function(u,c){c===void 0&&(c=Sn);var s=JSON.stringify(u,function(l){var d=this[l];if(Be(this))return d;var f=St(d);if(!f)return d;var h=c[f]||bn[f];return h?h(d,l):d});return s===void 0?"undefined":s}(t,((o={}).promise=function(u,c){return function(s,l,d,f,h){return ae("cross_domain_zalgo_promise",{then:It(s,l,function(S,x){return d.then(S,x)},f,{on:h.on,send:h.send})})}(e,n,u,c,{on:i,send:a})},o.function=function(u,c){return It(e,n,u,c,{on:i,send:a})},o.object=function(u){return Ie(u)||G.isProxyWindow(u)?ae("cross_domain_window",G.serialize(u,{send:a})):u},o))}function Pt(e,n,t,r){var o,i=r.send;return function(a,u){if(u===void 0&&(u=Cn),a!=="undefined")return JSON.parse(a,function(c,s){if(Be(this))return s;var l,d;if(Be(s)?(l=s.__type__,d=s.__val__):(l=St(s),d=s),!l)return d;var f=u[l]||Wn[l];return f?f(d,c):d})}(t,((o={}).cross_domain_zalgo_promise=function(a){return function(u,c,s){return new T(s.then)}(0,0,a)},o.cross_domain_function=function(a){return function(u,c,s,l){var d=s.id,f=s.name,h=l.send,S=function(b){b===void 0&&(b={});function O(){var j=arguments;return G.toProxyWindow(u,{send:h}).awaitWindow().then(function(N){var A=Ct(N,d);if(A&&A.val!==O)return A.val.apply({source:window,origin:k()},j);var L=[].slice.call(j);return b.fireAndForget?h(N,"postrobot_method",{id:d,name:f,args:L},{domain:c,fireAndForget:!0}):h(N,"postrobot_method",{id:d,name:f,args:L},{domain:c,fireAndForget:!1}).then(function(W){return W.data.result})}).catch(function(N){throw N})}return O.__name__=f,O.__origin__=c,O.__source__=u,O.__id__=d,O.origin=c,O},x=S();return x.fireAndForget=S({fireAndForget:!0}),x}(e,n,a,{send:i})},o.cross_domain_window=function(a){return G.deserialize(a,{send:i})},o))}var $e={};$e.postrobot_post_message=function(e,n,t){t.indexOf("file:")===0&&(t="*"),e.postMessage(n,t)};function qe(e,n,t,r){var o=r.on,i=r.send;return T.try(function(){var a=H().getOrSet(e,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(t),a.flush=a.flush||T.flush().then(function(){if(q(e))throw new Error("Window is closed");var u=Tt(e,n,((c={}).__post_robot_10_0_46__=a.buffer||[],c),{on:o,send:i}),c;delete a.buffer;for(var s=Object.keys($e),l=[],d=0;d<s.length;d++){var f=s[d];try{$e[f](e,u,n)}catch(h){l.push(h)}}if(l.length===s.length)throw new Error(`All post-robot messaging strategies failed:
|
|
145
145
|
|
|
146
146
|
`+l.map(function(h,S){return S+". "+ge(h)}).join(`
|
|
147
147
|
|
|
148
|
-
`))}),a.flush.then(function(){delete a.flush})}).then(ie)}function
|
|
148
|
+
`))}),a.flush.then(function(){delete a.flush})}).then(ie)}function Rt(e){return M("responseListeners").get(e)}function Ot(e){M("responseListeners").del(e)}function At(e){return M("erroredResponseListeners").has(e)}function Nt(e){var n=e.name,t=e.win,r=e.domain,o=H("requestListeners");if(t==="*"&&(t=null),r==="*"&&(r=null),!n)throw new Error("Name required to get request listener");for(var i=0,a=[t,Oe()];i<a.length;i++){var u=a[i];if(u){var c=o.get(u);if(c){var s=c[n];if(s){if(r&&typeof r=="string"){if(s[r])return s[r];if(s.__domain_regex__)for(var l=0,d=s.__domain_regex__;l<d.length;l++){var f=d[l],h=f.listener;if(se(f.regex,r))return h}}if(s["*"])return s["*"]}}}}}function In(e,n,t,r){var o=r.on,i=r.send,a=Nt({name:t.name,win:e,domain:n}),u=t.name==="postrobot_method"&&t.data&&typeof t.data.name=="string"?t.data.name+"()":t.name;function c(s,l,d){return T.flush().then(function(){if(!t.fireAndForget&&!q(e))try{return qe(e,n,{id:X(),origin:k(window),type:"postrobot_message_response",hash:t.hash,name:t.name,ack:s,data:l,error:d},{on:o,send:i})}catch(f){throw new Error("Send response message failed for "+u+" in "+k()+`
|
|
149
149
|
|
|
150
150
|
`+ge(f))}})}return T.all([T.flush().then(function(){if(!t.fireAndForget&&!q(e))try{return qe(e,n,{id:X(),origin:k(window),type:"postrobot_message_ack",hash:t.hash,name:t.name},{on:o,send:i})}catch(s){throw new Error("Send ack message failed for "+u+" in "+k()+`
|
|
151
151
|
|
|
152
|
-
`+ge(s))}}),T.try(function(){if(!a)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:e,origin:n,data:t.data})}).then(function(s){return c("success",s)},function(s){return c("error",null,s)})]).then(ie).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function Tn(e,n,t){if(!At(t.hash)){var r=
|
|
152
|
+
`+ge(s))}}),T.try(function(){if(!a)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:e,origin:n,data:t.data})}).then(function(s){return c("success",s)},function(s){return c("error",null,s)})]).then(ie).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function Tn(e,n,t){if(!At(t.hash)){var r=Rt(t.hash);if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!se(r.domain,n))throw new Error("Ack origin "+n+" does not match domain "+r.domain.toString());if(e!==r.win)throw new Error("Ack source does not match registered window")}catch(o){r.promise.reject(o)}r.ack=!0}}function Pn(e,n,t){if(!At(t.hash)){var r=Rt(t.hash);if(!r)throw new Error("No handler found for post message response for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!se(r.domain,n))throw new Error("Response origin "+n+" does not match domain "+(o=r.domain,Array.isArray(o)?"("+o.join(" | ")+")":y(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(e!==r.win)throw new Error("Response source does not match registered window");Ot(t.hash),t.ack==="error"?r.promise.reject(t.error):t.ack==="success"&&r.promise.resolve({source:e,origin:n,data:t.data})}}function Dt(e,n){var t=n.on,r=n.send,o=M("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(l){return}var i=e.source,a=e.origin,u=function(l,d,f,h){var S=h.on,x=h.send,b;try{b=Pt(d,f,l,{on:S,send:x})}catch(j){return}if(b&&typeof b=="object"&&b!==null){var O=b.__post_robot_10_0_46__;if(Array.isArray(O))return O}}(e.data,i,a,{on:t,send:r});if(u){bt(i);for(var c=0;c<u.length;c++){var s=u[c];if(o.has(s.id)||(o.set(s.id,!0),q(i)&&!s.fireAndForget))return;s.origin.indexOf("file:")===0&&(a="file://");try{s.type==="postrobot_message_request"?In(i,a,s,{on:t,send:r}):s.type==="postrobot_message_response"?Pn(i,a,s):s.type==="postrobot_message_ack"&&Tn(i,a,s)}catch(l){setTimeout(function(){throw l},0)}}}}function te(e,n,t){if(!e)throw new Error("Expected name");if(typeof(n=n||{})=="function"&&(t=n,n={}),!t)throw new Error("Expected handler");var r=function o(i,a){var u=i.name,c=i.win,s=i.domain,l=H("requestListeners");if(!u||typeof u!="string")throw new Error("Name required to add request listener");if(c&&c!=="*"&&G.isProxyWindow(c)){var d=c.awaitWindow().then(function(z){return o({name:u,win:z,domain:s},a)});return{cancel:function(){d.then(function(z){return z.cancel()},ie)}}}var f=c;if(Array.isArray(f)){for(var h=[],S=0,x=f;S<x.length;S++)h.push(o({name:u,domain:s,win:x[S]},a));return{cancel:function(){for(var z=0;z<h.length;z++)h[z].cancel()}}}if(Array.isArray(s)){for(var b=[],O=0,j=s;O<j.length;O++)b.push(o({name:u,win:f,domain:j[O]},a));return{cancel:function(){for(var z=0;z<b.length;z++)b[z].cancel()}}}var N=Nt({name:u,win:f,domain:s});f&&f!=="*"||(f=Oe());var A=(s=s||"*").toString();if(N)throw f&&s?new Error("Request listener already exists for "+u+" on domain "+s.toString()+" for "+(f===Oe()?"wildcard":"specified")+" window"):f?new Error("Request listener already exists for "+u+" for "+(f===Oe()?"wildcard":"specified")+" window"):s?new Error("Request listener already exists for "+u+" on domain "+s.toString()):new Error("Request listener already exists for "+u);var L=l.getOrSet(f,function(){return{}}),W=ye(L,u,function(){return{}}),D,J;return Fe(s)?(D=ye(W,"__domain_regex__",function(){return[]})).push(J={regex:s,listener:a}):W[A]=a,{cancel:function(){delete W[A],J&&(D.splice(D.indexOf(J,1)),D.length||delete W.__domain_regex__),Object.keys(W).length||delete L[u],f&&!Object.keys(L).length&&l.del(f)}}}({name:e,win:n.window,domain:n.domain||"*"},{handler:t||n.handler,handleError:n.errorHandler||function(o){throw o}});return{cancel:function(){r.cancel()}}}function Rn(e,n,t){typeof(n=n||{})=="function"&&(t=n,n={});var r=new T,o;return n.errorHandler=function(i){o.cancel(),r.reject(i)},o=te(e,n,function(i){if(o.cancel(),r.resolve(i),t)return t(i)}),r.cancel=o.cancel,r}var ne=function e(n,t,r,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,u=o.timeout||5e3,c=o.fireAndForget||!1;return G.toProxyWindow(n,{send:e}).awaitWindow().then(function(s){return T.try(function(){if(function(l,d,f){if(!l)throw new Error("Expected name");if(f&&typeof f!="string"&&!Array.isArray(f)&&!Fe(f))throw new TypeError("Can not send "+l+". Expected domain "+JSON.stringify(f)+" to be a string, array, or regex");if(q(d))throw new Error("Can not send "+l+". Target window is closed")}(t,s,i),function(l,d){var f=at(d);if(f)return f===l;if(d===l||function(x){x===void 0&&(x=window);try{if(x.top)return x.top}catch(N){}if($(x)===x)return x;try{if(ot(window,x)&&window.top)return window.top}catch(N){}try{if(ot(x,window)&&window.top)return window.top}catch(N){}for(var b=0,O=function N(A){for(var L=[],W=0,D=it(A);W<D.length;W++){var J=D[W];L.push(J);for(var z=0,xe=N(J);z<xe.length;z++)L.push(xe[z])}return L}(x);b<O.length;b++){var j=O[b];try{if(j.top)return j.top}catch(N){}if($(j)===j)return j}}(d)===d)return!1;for(var h=0,S=it(l);h<S.length;h++)if(S[h]===d)return!0;return!1}(window,s))return function(l,d,f){d===void 0&&(d=5e3),f===void 0&&(f="Window");var h=function(S){return H("helloPromises").getOrSet(S,function(){return new T})}(l);return d!==-1&&(h=h.timeout(d,new Error(f+" did not load after "+d+"ms"))),h}(s,u)}).then(function(l){return function(d,f,h,S){var x=S.send;return T.try(function(){return typeof f=="string"?f:T.try(function(){return h||Ue(d,{send:x}).then(function(b){return b.domain})}).then(function(b){if(!se(f,f))throw new Error("Domain "+mt(f)+" does not match "+mt(f));return b})})}(s,i,(l===void 0?{}:l).domain,{send:e})}).then(function(l){var d=l,f=t==="postrobot_method"&&r&&typeof r.name=="string"?r.name+"()":t,h=new T,S=t+"_"+X();if(!c){var x={name:t,win:s,domain:d,promise:h};(function(W,D){M("responseListeners").set(W,D)})(S,x);var b=H("requestPromises").getOrSet(s,function(){return[]});b.push(h),h.catch(function(){(function(W){M("erroredResponseListeners").set(W,!0)})(S),Ot(S)});var O=function(W){return H("knownWindows").get(W,!1)}(s)?1e4:2e3,j=a,N=O,A=j,L=function(W,D){var J;return function z(){J=setTimeout(function(){(function(){if(q(s))return h.reject(new Error("Window closed for "+t+" before "+(x.ack?"response":"ack")));if(x.cancelled)return h.reject(new Error("Response listener was cancelled for "+t));N=Math.max(N-500,0),A!==-1&&(A=Math.max(A-500,0)),x.ack||N!==0?A===0&&h.reject(new Error("No response for postMessage "+f+" in "+k()+" in "+j+"ms")):h.reject(new Error("No ack for postMessage "+f+" in "+k()+" in "+O+"ms"))})(),z()},500)}(),{cancel:function(){clearTimeout(J)}}}();h.finally(function(){L.cancel(),b.splice(b.indexOf(h,1))}).catch(ie)}return qe(s,d,{id:X(),origin:k(window),type:"postrobot_message_request",hash:S,name:t,data:r,fireAndForget:c},{on:te,send:e}).then(function(){return c?h.resolve():h},function(W){throw new Error("Send request message failed for "+f+" in "+k()+`
|
|
153
153
|
|
|
154
|
-
`+ge(W))})})})};function
|
|
154
|
+
`+ge(W))})})})};function On(e,n,t){return Tt(e,n,t,{on:te,send:ne})}function An(e,n,t){return Pt(e,n,t,{on:te,send:ne})}function Nn(e){return new G({send:ne,win:e})}function Dn(e){return G.toProxyWindow(e,{send:ne})}function zt(){Ee().initialized||(Ee().initialized=!0,n=(e={on:te,send:ne}).on,t=e.send,(r=Ee()).receiveMessage=r.receiveMessage||function(o){return Dt(o,{on:n,send:t})},function(o){var i=o.on,a=o.send;M().getOrSet("postMessageListener",function(){return function(u,c,s){return u.addEventListener("message",s),{cancel:function(){u.removeEventListener("message",s)}}}(window,0,function(u){(function(c,s){var l=s.on,d=s.send;T.try(function(){var f=c.source||c.sourceElement,h=c.origin||c.originalEvent&&c.originalEvent.origin,S=c.data;if(h==="null"&&(h="file://"),f){if(!h)throw new Error("Post message did not have origin domain");Dt({source:f,origin:h,data:S},{on:l,send:d})}})})(u,{on:i,send:a})})})}({on:te,send:ne}),function(o){var i=o.on,a=o.send;M("builtinListeners").getOrSet("helloListener",function(){var u=i("postrobot_hello",{domain:"*"},function(s){return Et(s.source,{domain:s.origin}),{instanceID:yt()}}),c=at();return c&&Ue(c,{send:a}).catch(function(s){}),u})}({on:te,send:ne}));var e,n,t,r}function zn(){(function(){for(var n=M("responseListeners"),t=0,r=n.keys();t<r.length;t++){var o=r[t],i=n.get(o);i&&(i.cancelled=!0),n.del(o)}})(),(e=M().get("postMessageListener"))&&e.cancel();var e;delete window.__post_robot_10_0_46__}var jn=!0;function Mn(e){for(var n=0,t=H("requestPromises").get(e,[]);n<t.length;n++)t[n].reject(new Error("Window "+(q(e)?"closed":"cleaned up")+" before response")).catch(ie)}zt()}])})})(nt);var hn=nt.exports;(function(p){p.exports=hn,p.exports.default=p.exports})(tt);var rt=tt.exports;const Me=C({__proto__:null,default:ln(rt)},[rt]);I.ConsentBox=Kt,I.SoyioTypes=Qt,I.SoyioWidget=et,I._TooltipManager=Qe,I.default=et,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|