@soyio/soyio-widget 2.7.0 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -12
- package/dist/index.d.ts +3 -0
- package/dist/index.js +51 -48
- package/dist/index.umd.cjs +16 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -304,6 +304,7 @@ The **`ConsentBox`** is a component that allows you to embed a consent request d
|
|
|
304
304
|
appearance: {}, // Optional
|
|
305
305
|
actionToken: "<action token>", // Optional
|
|
306
306
|
entityId: "<entity id>", // Optional
|
|
307
|
+
context: "<context>", // Optional
|
|
307
308
|
};
|
|
308
309
|
|
|
309
310
|
// Wait for DOM to be fully loaded
|
|
@@ -347,6 +348,7 @@ The `onEvent` follows the following format:
|
|
|
347
348
|
- **`appearance`**: Customize the appearance of the iframe. [Learn more](https://docs.soyio.id/docs/integration-guide/modules/consent).
|
|
348
349
|
- **`actionToken`**: In case of losing the state of the consent (i.e. page reload), you can use a previously generated `actionToken` to restore the state of the consent.
|
|
349
350
|
- **`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.
|
|
351
|
+
- **`context`**: Additional information that will be saved with the consent. Useful when you want to track the consent from a specific context.
|
|
350
352
|
|
|
351
353
|
# Appearance
|
|
352
354
|
|
|
@@ -388,30 +390,38 @@ interface Variables {
|
|
|
388
390
|
|
|
389
391
|
### Available Variables
|
|
390
392
|
|
|
391
|
-
| Variable | Description
|
|
392
|
-
| ----------------- |
|
|
393
|
-
| `fontFamily` | The font stack to use for text
|
|
394
|
-
| `colorPrimary` | Primary color for interactive elements
|
|
395
|
-
| `
|
|
396
|
-
| `
|
|
397
|
-
| `
|
|
398
|
-
| `
|
|
399
|
-
| `
|
|
393
|
+
| Variable | Description | Default |
|
|
394
|
+
| ----------------- | ---------------------------------------- | ------------------------- |
|
|
395
|
+
| `fontFamily` | The font stack to use for text | `"system-ui, sans-serif"` |
|
|
396
|
+
| `colorPrimary` | Primary color for interactive elements | `"#0570DE"` |
|
|
397
|
+
| `colorSecondary` | Secondary color for interactive elements | `"#0570DE"` |
|
|
398
|
+
| `colorBackground` | Background color | `"#FFFFFF"` |
|
|
399
|
+
| `colorText` | Main text color | `"#1A1F36"` |
|
|
400
|
+
| `borderRadius` | Border radius for elements | `"4px"` |
|
|
401
|
+
| `borderWidth` | Border width for elements | `"1px"` |
|
|
402
|
+
| `borderStyle` | Border style for elements | `"solid"` |
|
|
400
403
|
|
|
401
404
|
## Rules
|
|
402
405
|
|
|
403
406
|
The `rules` object allows you to apply custom CSS to specific elements. Currently, Soyio supports styling for checkbox components.
|
|
404
407
|
|
|
408
|
+
### Supported rules
|
|
409
|
+
|
|
410
|
+
- `.MainContainer` - The main container of the consent request box. Only border CSS properties are allowed to be overridden.
|
|
411
|
+
- `.Button` - The button component.
|
|
412
|
+
- `.Checkbox` - The checkbox component.
|
|
413
|
+
- `.CheckboxInput` - The checkbox input element.
|
|
414
|
+
- `.CheckboxLabel` - The checkbox label.
|
|
415
|
+
|
|
416
|
+

|
|
417
|
+
|
|
405
418
|
### Supported Selectors
|
|
406
419
|
|
|
407
|
-
- `.CheckboxInput` - The checkbox input element
|
|
408
420
|
- `.CheckboxInput--checked` - The checked state of the checkbox
|
|
409
421
|
- `.CheckboxInput:hover` - Hover state of the checkbox
|
|
410
422
|
- `.CheckboxInput:focus` - Focus state of the checkbox
|
|
411
423
|
- `.CheckboxInput:focus-visible` - Focus-visible state of the checkbox
|
|
412
424
|
|
|
413
|
-

|
|
414
|
-
|
|
415
425
|
### Example Configuration
|
|
416
426
|
|
|
417
427
|
```javascript
|
|
@@ -420,6 +430,7 @@ const appearance = {
|
|
|
420
430
|
variables: {
|
|
421
431
|
fontFamily: "system-ui, sans-serif",
|
|
422
432
|
colorPrimary: "#f54c27",
|
|
433
|
+
colorSecondary: "#f54c27",
|
|
423
434
|
colorBackground: "#ffffff",
|
|
424
435
|
colorText: "#1E1B4B",
|
|
425
436
|
borderRadius: "0.5rem",
|
|
@@ -427,6 +438,11 @@ const appearance = {
|
|
|
427
438
|
borderStyle: "dashed",
|
|
428
439
|
},
|
|
429
440
|
rules: {
|
|
441
|
+
".MainContainer": {
|
|
442
|
+
borderWidth: "1px",
|
|
443
|
+
borderColor: "#E5E7EB",
|
|
444
|
+
borderRadius: "0.25rem",
|
|
445
|
+
},
|
|
430
446
|
".CheckboxInput": {
|
|
431
447
|
appearance: "none",
|
|
432
448
|
backgroundColor: "transparent",
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { SignatureAttemptProps } from './widget/types';
|
|
|
15
15
|
import { SignatureRequestConfig } from './widget/types';
|
|
16
16
|
import { SoyioAppearance } from './embeds/appearance/types';
|
|
17
17
|
import { SoyioWidget } from './widget';
|
|
18
|
+
import { TooltipManager as _TooltipManager } from './embeds/tooltip-manager';
|
|
18
19
|
|
|
19
20
|
export { ConsentBox }
|
|
20
21
|
|
|
@@ -42,4 +43,6 @@ export { SoyioTypes }
|
|
|
42
43
|
export { SoyioWidget }
|
|
43
44
|
export default SoyioWidget;
|
|
44
45
|
|
|
46
|
+
export { _TooltipManager }
|
|
47
|
+
|
|
45
48
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
2
|
var N = (e, t, n) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var l = (e, t, n) => (N(e, typeof t != "symbol" ? t + "" : t, n), n), L = (e, t, n) => {
|
|
4
4
|
if (!t.has(e))
|
|
5
5
|
throw TypeError("Cannot " + n);
|
|
6
6
|
};
|
|
@@ -10,7 +10,7 @@ var g = (e, t, n) => {
|
|
|
10
10
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
11
11
|
};
|
|
12
12
|
var w = (e, t, n) => (L(e, t, "access private method"), n);
|
|
13
|
-
async function
|
|
13
|
+
async function P(e, t, n) {
|
|
14
14
|
if (!e.contentWindow)
|
|
15
15
|
throw new Error("Invalid iframe: contentWindow is null");
|
|
16
16
|
const o = await import("./index-yZw-yxuV.js").then((i) => i.i);
|
|
@@ -20,15 +20,15 @@ async function H(e, t, n) {
|
|
|
20
20
|
console.error("Failed to send appearance config:", i);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const S = "https://app.soyio.id", b = "https://sandbox.soyio.id", A = [
|
|
24
24
|
"DISCLOSURE_REQUEST_SUCCESSFUL",
|
|
25
25
|
"IDENTITY_REGISTERED",
|
|
26
26
|
"IDENTITY_SIGNATURE",
|
|
27
27
|
"UNEXPECTED_ERROR",
|
|
28
28
|
"DENIED_CAMERA_PERMISSION",
|
|
29
29
|
"REJECTED_SIGNATURE"
|
|
30
|
-
],
|
|
31
|
-
function
|
|
30
|
+
], H = "WIDGET_CLOSED", D = 420, $ = 720, U = 500;
|
|
31
|
+
function O(e) {
|
|
32
32
|
const t = document.getElementById(e);
|
|
33
33
|
t && (console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."), t.remove());
|
|
34
34
|
}
|
|
@@ -50,7 +50,7 @@ function G(e) {
|
|
|
50
50
|
opacity: 1 !important;
|
|
51
51
|
`, n;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function M(e, t) {
|
|
54
54
|
const n = document.createElement("iframe");
|
|
55
55
|
return n.id = t, n.src = e, n.style.cssText += `
|
|
56
56
|
width: 100% !important;
|
|
@@ -64,38 +64,40 @@ function k(e, t) {
|
|
|
64
64
|
opacity 0.4s 0.1s;
|
|
65
65
|
`, n;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const t = e.isSandbox ?? !1,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
function q(e) {
|
|
68
|
+
const t = ["actionToken", "entityId", "context"], n = e.isSandbox ?? !1, o = e.developmentUrl || (n ? b : S), i = new URLSearchParams();
|
|
69
|
+
t.forEach((a) => {
|
|
70
|
+
e[a] && i.set(a, e[a]);
|
|
71
|
+
});
|
|
72
|
+
const s = i.toString();
|
|
73
|
+
return `${o}/embed/consents/${e.consentTemplateId}${s ? `?${s}` : ""}`;
|
|
72
74
|
}
|
|
73
|
-
const
|
|
75
|
+
const W = "IFRAME_READY", k = "CONSENT_STATE_CHANGE", F = "IFRAME_HEIGHT_CHANGE", B = "TOOLTIP_STATE_CHANGE", r = {
|
|
74
76
|
onHeightChange: {},
|
|
75
77
|
onIframeReady: {},
|
|
76
78
|
onStateChange: {},
|
|
77
79
|
onTooltipChange: {}
|
|
78
80
|
};
|
|
79
|
-
let
|
|
81
|
+
let C, T, y, I;
|
|
80
82
|
async function X() {
|
|
81
83
|
const e = await import("./index-yZw-yxuV.js").then((t) => t.i);
|
|
82
|
-
|
|
83
|
-
const n = t.data, o =
|
|
84
|
+
C || T || y || I || (C = e.on(F, async (t) => {
|
|
85
|
+
const n = t.data, o = r.onHeightChange[n.identifier];
|
|
84
86
|
if (!o)
|
|
85
87
|
throw new Error(`No height change listener found for identifier: ${n.identifier}`);
|
|
86
88
|
o(n.height);
|
|
87
|
-
}),
|
|
88
|
-
const n = t.data, o =
|
|
89
|
+
}), T = e.on(W, async (t) => {
|
|
90
|
+
const n = t.data, o = r.onIframeReady[n.identifier];
|
|
89
91
|
if (!o)
|
|
90
92
|
throw new Error(`No iframe ready listener found for identifier: ${n.identifier}`);
|
|
91
93
|
o();
|
|
92
|
-
}), y = e.on(
|
|
93
|
-
const n = t.data, o =
|
|
94
|
+
}), y = e.on(k, async (t) => {
|
|
95
|
+
const n = t.data, o = r.onStateChange[n.identifier];
|
|
94
96
|
if (!o)
|
|
95
97
|
throw new Error(`No state change listener found for identifier: ${n.identifier}`);
|
|
96
98
|
o(n);
|
|
97
99
|
}), I = e.on(B, async (t) => {
|
|
98
|
-
const n = t.data, o =
|
|
100
|
+
const n = t.data, o = r.onTooltipChange[n.identifier];
|
|
99
101
|
if (!o)
|
|
100
102
|
throw new Error(`No tooltip change listener found for identifier: ${n.identifier}`);
|
|
101
103
|
o(n);
|
|
@@ -106,19 +108,19 @@ function Y(e, t) {
|
|
|
106
108
|
onHeightChange: n,
|
|
107
109
|
onIframeReady: o,
|
|
108
110
|
onStateChange: i,
|
|
109
|
-
onTooltipChange:
|
|
111
|
+
onTooltipChange: s
|
|
110
112
|
} = t;
|
|
111
|
-
|
|
113
|
+
r.onHeightChange[e] = n, r.onIframeReady[e] = o, r.onStateChange[e] = i, r.onTooltipChange[e] = s;
|
|
112
114
|
}
|
|
113
115
|
function j(e) {
|
|
114
|
-
delete
|
|
116
|
+
delete r.onHeightChange[e], delete r.onIframeReady[e], delete r.onStateChange[e], delete r.onTooltipChange[e];
|
|
115
117
|
}
|
|
116
118
|
class V {
|
|
117
119
|
constructor() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
l(this, "tooltipElement", null);
|
|
121
|
+
l(this, "tooltipContent", null);
|
|
122
|
+
l(this, "tooltipClass", "soyio-tooltip");
|
|
123
|
+
l(this, "hideTimeout", null);
|
|
122
124
|
this.createTooltipElement(), this.setupGlobalListeners();
|
|
123
125
|
}
|
|
124
126
|
createTooltipElement() {
|
|
@@ -167,11 +169,11 @@ class V {
|
|
|
167
169
|
}
|
|
168
170
|
class at {
|
|
169
171
|
constructor(t) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
l(this, "appearance");
|
|
173
|
+
l(this, "options");
|
|
174
|
+
l(this, "tooltipManager");
|
|
175
|
+
l(this, "iframe", null);
|
|
176
|
+
l(this, "state", {
|
|
175
177
|
isSelected: !1,
|
|
176
178
|
actionToken: null
|
|
177
179
|
});
|
|
@@ -181,7 +183,7 @@ class at {
|
|
|
181
183
|
this.iframe && (this.iframe.style.height = `${t}px`);
|
|
182
184
|
}
|
|
183
185
|
async handleIframeReady() {
|
|
184
|
-
!this.iframe || !this.appearance || await
|
|
186
|
+
!this.iframe || !this.appearance || await P(this.iframe, this.appearance, this.uniqueIdentifier);
|
|
185
187
|
}
|
|
186
188
|
handleStateChange(t) {
|
|
187
189
|
const { isSelected: n, actionToken: o } = t;
|
|
@@ -202,13 +204,13 @@ class at {
|
|
|
202
204
|
handleTooltipChange(t) {
|
|
203
205
|
if (!this.iframe)
|
|
204
206
|
return;
|
|
205
|
-
const n = this.iframe.getBoundingClientRect(), { text: o, coordinates: i, isVisible:
|
|
206
|
-
|
|
207
|
+
const n = this.iframe.getBoundingClientRect(), { text: o, coordinates: i, isVisible: s } = t, a = i.x + n.left, p = i.y + n.top;
|
|
208
|
+
s ? this.tooltipManager.show(o, a, p) : this.tooltipManager.hide();
|
|
207
209
|
}
|
|
208
210
|
mount(t) {
|
|
209
|
-
|
|
210
|
-
const n = G(t), o =
|
|
211
|
-
return this.iframe =
|
|
211
|
+
O(this.iframeIdentifier);
|
|
212
|
+
const n = G(t), o = q(this.options);
|
|
213
|
+
return this.iframe = M(o, this.iframeIdentifier), n.appendChild(this.iframe), this;
|
|
212
214
|
}
|
|
213
215
|
unmount() {
|
|
214
216
|
j(this.uniqueIdentifier), this.iframe && (this.iframe.remove(), this.iframe = null);
|
|
@@ -231,25 +233,25 @@ function z(e) {
|
|
|
231
233
|
return "disclosureRequestId" in e.configProps ? t += ["disclosures", e.configProps.disclosureRequestId].join("/") : t += e.request, t;
|
|
232
234
|
}
|
|
233
235
|
function K(e) {
|
|
234
|
-
const t = e.isSandbox ?? !1, n = e.developmentUrl || (t ?
|
|
236
|
+
const t = e.isSandbox ?? !1, n = e.developmentUrl || (t ? b : S), o = Object.entries(e.configProps).filter(([s, a]) => a || s === "disclosureRequestId").map(([s, a]) => `${s}=${encodeURIComponent(a)}`).join("&"), i = z(e);
|
|
235
237
|
return `${n}/${i}?sdk=web&${o}`;
|
|
236
238
|
}
|
|
237
239
|
const J = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
238
|
-
let
|
|
240
|
+
let c = null, u = null;
|
|
239
241
|
function m(e = null) {
|
|
240
|
-
|
|
242
|
+
c && !c.closed && c.focus(), e == null || e.preventDefault();
|
|
241
243
|
}
|
|
242
244
|
function f() {
|
|
243
245
|
document.body.style.filter = "", document.body.removeEventListener("click", m);
|
|
244
246
|
}
|
|
245
247
|
function Q() {
|
|
246
248
|
u = setInterval(() => {
|
|
247
|
-
(!
|
|
248
|
-
},
|
|
249
|
+
(!c || c.closed) && (u && clearInterval(u), f());
|
|
250
|
+
}, U);
|
|
249
251
|
}
|
|
250
252
|
function Z(e) {
|
|
251
|
-
const t = K(e), n = D, o = $, i = window.screenLeft !== void 0 ? window.screenLeft : window.screenX,
|
|
252
|
-
document.body.style.filter = "blur(5px)", document.body.addEventListener("click", m),
|
|
253
|
+
const t = K(e), n = D, o = $, i = window.screenLeft !== void 0 ? window.screenLeft : window.screenX, s = window.screenTop !== void 0 ? window.screenTop : window.screenY, a = window.innerWidth || document.documentElement.clientWidth || window.screen.width, p = window.innerHeight || document.documentElement.clientHeight || window.screen.height, E = a / window.screen.availWidth, x = (a - n) / 2 / E + i, R = (p - o) / 2 / E + s;
|
|
254
|
+
document.body.style.filter = "blur(5px)", document.body.addEventListener("click", m), c = window.open(
|
|
253
255
|
t,
|
|
254
256
|
"Soyio",
|
|
255
257
|
`scrollbars=yes,
|
|
@@ -260,7 +262,7 @@ function Z(e) {
|
|
|
260
262
|
), m(), Q();
|
|
261
263
|
}
|
|
262
264
|
function tt() {
|
|
263
|
-
|
|
265
|
+
c && (c.close(), c = null), f();
|
|
264
266
|
}
|
|
265
267
|
const et = "WIDGET_EVENT";
|
|
266
268
|
let d = null;
|
|
@@ -270,7 +272,7 @@ function nt() {
|
|
|
270
272
|
async function ot(e) {
|
|
271
273
|
const { onEvent: t } = e, n = await import("./index-yZw-yxuV.js").then((o) => o.i);
|
|
272
274
|
d && nt(), d = n.on(et, async (o) => {
|
|
273
|
-
t(o.data),
|
|
275
|
+
t(o.data), A.includes(o.data.eventName) ? tt() : o.data.eventName === H && f();
|
|
274
276
|
});
|
|
275
277
|
}
|
|
276
278
|
function it(e) {
|
|
@@ -280,7 +282,7 @@ var h, v;
|
|
|
280
282
|
class lt {
|
|
281
283
|
constructor(t) {
|
|
282
284
|
g(this, h);
|
|
283
|
-
|
|
285
|
+
l(this, "onEvent");
|
|
284
286
|
this.onEvent = t.onEvent, J && (Z(t), it({
|
|
285
287
|
onEvent: w(this, h, v).bind(this)
|
|
286
288
|
}));
|
|
@@ -293,5 +295,6 @@ export {
|
|
|
293
295
|
at as ConsentBox,
|
|
294
296
|
rt as SoyioTypes,
|
|
295
297
|
lt as SoyioWidget,
|
|
298
|
+
V as _TooltipManager,
|
|
296
299
|
lt as default
|
|
297
300
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(A,R){typeof exports=="object"&&typeof module<"u"?R(exports):typeof define=="function"&&define.amd?define(["exports"],R):(A=typeof globalThis<"u"?globalThis:A||self,R(A["soyio-widget"]={}))})(this,function(A){"use strict";var Nn=Object.defineProperty;var Dn=(A,R,H)=>R in A?Nn(A,R,{enumerable:!0,configurable:!0,writable:!0,value:H}):A[R]=H;var k=(A,R,H)=>(Dn(A,typeof R!="symbol"?R+"":R,H),H),jn=(A,R,H)=>{if(!R.has(A))throw TypeError("Cannot "+H)};var
|
|
1
|
+
(function(A,R){typeof exports=="object"&&typeof module<"u"?R(exports):typeof define=="function"&&define.amd?define(["exports"],R):(A=typeof globalThis<"u"?globalThis:A||self,R(A["soyio-widget"]={}))})(this,function(A){"use strict";var Nn=Object.defineProperty;var Dn=(A,R,H)=>R in A?Nn(A,R,{enumerable:!0,configurable:!0,writable:!0,value:H}):A[R]=H;var k=(A,R,H)=>(Dn(A,typeof R!="symbol"?R+"":R,H),H),jn=(A,R,H)=>{if(!R.has(A))throw TypeError("Cannot "+H)};var Tt=(A,R,H)=>{if(R.has(A))throw TypeError("Cannot add the same private member more than once");R instanceof WeakSet?R.add(A):R.set(A,H)};var Ot=(A,R,H)=>(jn(A,R,"access private method"),H);var ve,At;function R(p,w){for(var m=0;m<w.length;m++){const v=w[m];if(typeof v!="string"&&!Array.isArray(v)){for(const g in v)if(g!=="default"&&!(g in p)){const y=Object.getOwnPropertyDescriptor(v,g);y&&Object.defineProperty(p,g,y.get?y:{enumerable:!0,get:()=>v[g]})}}}return Object.freeze(Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}))}async function H(p,w,m){if(!p.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const v=await Promise.resolve().then(()=>Ce);try{await v.send(p.contentWindow,"SET_APPEARANCE",{appearance:w,identifier:m})}catch(g){console.error("Failed to send appearance config:",g)}}const Ue="https://app.soyio.id",Fe="https://sandbox.soyio.id",Rt=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],Nt="WIDGET_CLOSED",Dt=420,jt=720,Mt=500;function zt(p){const w=document.getElementById(p);w&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),w.remove())}function Lt(p){const w=document.querySelector(p);if(!w)throw new Error(`Iframe div container with id '${p}' not found`);if(w.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${p}' must be a <div> element`);const m=w;return m.style.position="relative",m.style.cssText+=`
|
|
2
2
|
padding: 0 !important;
|
|
3
3
|
margin: 0 !important;
|
|
4
4
|
display: flex !important;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
border: none !important;
|
|
8
8
|
transition: height 0.35s !important;
|
|
9
9
|
opacity: 1 !important;
|
|
10
|
-
`,
|
|
10
|
+
`,m}function Ht(p,w){const m=document.createElement("iframe");return m.id=w,m.src=p,m.style.cssText+=`
|
|
11
11
|
width: 100% !important;
|
|
12
12
|
min-width: 375px !important;
|
|
13
13
|
max-width: 36rem !important;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
opacity: 1;
|
|
18
18
|
transition: height 0.35s,
|
|
19
19
|
opacity 0.4s 0.1s;
|
|
20
|
-
`,
|
|
20
|
+
`,m}function Ut(p){const w=["actionToken","entityId","context"],m=p.isSandbox??!1,v=p.developmentUrl||(m?Fe:Ue),g=new URLSearchParams;w.forEach(x=>{p[x]&&g.set(x,p[x])});const y=g.toString();return`${v}/embed/consents/${p.consentTemplateId}${y?`?${y}`:""}`}const Ft="IFRAME_READY",Gt="CONSENT_STATE_CHANGE",_t="IFRAME_HEIGHT_CHANGE",Bt="TOOLTIP_STATE_CHANGE",B={onHeightChange:{},onIframeReady:{},onStateChange:{},onTooltipChange:{}};let Ge,_e,Be,$e;async function $t(){const p=await Promise.resolve().then(()=>Ce);Ge||_e||Be||$e||(Ge=p.on(_t,async w=>{const m=w.data,v=B.onHeightChange[m.identifier];if(!v)throw new Error(`No height change listener found for identifier: ${m.identifier}`);v(m.height)}),_e=p.on(Ft,async w=>{const m=w.data,v=B.onIframeReady[m.identifier];if(!v)throw new Error(`No iframe ready listener found for identifier: ${m.identifier}`);v()}),Be=p.on(Gt,async w=>{const m=w.data,v=B.onStateChange[m.identifier];if(!v)throw new Error(`No state change listener found for identifier: ${m.identifier}`);v(m)}),$e=p.on(Bt,async w=>{const m=w.data,v=B.onTooltipChange[m.identifier];if(!v)throw new Error(`No tooltip change listener found for identifier: ${m.identifier}`);v(m)}))}function qt(p,w){const{onHeightChange:m,onIframeReady:v,onStateChange:g,onTooltipChange:y}=w;B.onHeightChange[p]=m,B.onIframeReady[p]=v,B.onStateChange[p]=g,B.onTooltipChange[p]=y}function kt(p){delete B.onHeightChange[p],delete B.onIframeReady[p],delete B.onStateChange[p],delete B.onTooltipChange[p]}class qe{constructor(){k(this,"tooltipElement",null);k(this,"tooltipContent",null);k(this,"tooltipClass","soyio-tooltip");k(this,"hideTimeout",null);this.createTooltipElement(),this.setupGlobalListeners()}createTooltipElement(){const w=document.querySelector(`.${this.tooltipClass}`);w==null||w.remove(),this.tooltipElement=document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
|
|
21
21
|
position: fixed;
|
|
22
22
|
z-index: 99999;
|
|
23
23
|
background: white;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
transition: opacity 0.2s ease-in-out;
|
|
33
33
|
transform: translateX(-50%) translateY(-100%);
|
|
34
34
|
margin-top: -8px;
|
|
35
|
-
`,this.tooltipContent=document.createElement("div"),this.tooltipElement.appendChild(this.tooltipContent);const
|
|
35
|
+
`,this.tooltipContent=document.createElement("div"),this.tooltipElement.appendChild(this.tooltipContent);const m=document.createElement("div");m.style.cssText=`
|
|
36
36
|
position: absolute;
|
|
37
37
|
bottom: -4px;
|
|
38
38
|
left: 50%;
|
|
@@ -41,24 +41,24 @@
|
|
|
41
41
|
height: 8px;
|
|
42
42
|
background: white;
|
|
43
43
|
box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
|
|
44
|
-
`,this.tooltipElement.appendChild(
|
|
45
|
-
width=${
|
|
44
|
+
`,this.tooltipElement.appendChild(m),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(w,m,v){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=w,this.tooltipElement.style.left=`${m}px`,this.tooltipElement.style.top=`${v}px`,this.tooltipElement.style.opacity="1")}hide(){this.tooltipElement&&(this.tooltipElement.style.opacity="0")}destroy(){var w;(w=this.tooltipElement)==null||w.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}class Jt{constructor(w){k(this,"appearance");k(this,"options");k(this,"tooltipManager");k(this,"iframe",null);k(this,"state",{isSelected:!1,actionToken:null});this.options=w,this.appearance=w.appearance||null,this.tooltipManager=new qe,this.setup()}handleHeightChange(w){this.iframe&&(this.iframe.style.height=`${w}px`)}async handleIframeReady(){!this.iframe||!this.appearance||await H(this.iframe,this.appearance,this.uniqueIdentifier)}handleStateChange(w){const{isSelected:m,actionToken:v}=w;this.state={isSelected:m,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:m,actionToken:v})}async setup(){await $t(),qt(this.uniqueIdentifier,{onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onStateChange:this.handleStateChange.bind(this),onTooltipChange:this.handleTooltipChange.bind(this)})}handleTooltipChange(w){if(!this.iframe)return;const m=this.iframe.getBoundingClientRect(),{text:v,coordinates:g,isVisible:y}=w,x=g.x+m.left,U=g.y+m.top;y?this.tooltipManager.show(v,x,U):this.tooltipManager.hide()}mount(w){zt(this.iframeIdentifier);const m=Lt(w),v=Ut(this.options);return this.iframe=Ht(v,this.iframeIdentifier),m.appendChild(this.iframe),this}unmount(){kt(this.uniqueIdentifier),this.iframe&&(this.iframe.remove(),this.iframe=null)}getState(){return{...this.state}}get iframeIdentifier(){return`consent-box-${this.uniqueIdentifier}`}get uniqueIdentifier(){return this.options.consentTemplateId}}const Yt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Zt(p){let w="widget/";return"disclosureRequestId"in p.configProps?w+=["disclosures",p.configProps.disclosureRequestId].join("/"):w+=p.request,w}function Vt(p){const w=p.isSandbox??!1,m=p.developmentUrl||(w?Fe:Ue),v=Object.entries(p.configProps).filter(([y,x])=>x||y==="disclosureRequestId").map(([y,x])=>`${y}=${encodeURIComponent(x)}`).join("&"),g=Zt(p);return`${m}/${g}?sdk=web&${v}`}const Xt=!!(typeof window<"u"&&window.document&&window.document.createElement);let Y=null,We=null;function Ie(p=null){Y&&!Y.closed&&Y.focus(),p==null||p.preventDefault()}function Pe(){document.body.style.filter="",document.body.removeEventListener("click",Ie)}function Kt(){We=setInterval(()=>{(!Y||Y.closed)&&(We&&clearInterval(We),Pe())},Mt)}function Qt(p){const w=Vt(p),m=Dt,v=jt,g=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,x=window.innerWidth||document.documentElement.clientWidth||window.screen.width,U=window.innerHeight||document.documentElement.clientHeight||window.screen.height,V=x/window.screen.availWidth,re=(x-m)/2/V+g,Z=(U-v)/2/V+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",Ie),Y=window.open(w,"Soyio",`scrollbars=yes,
|
|
45
|
+
width=${m},
|
|
46
46
|
height=${v},
|
|
47
47
|
top=${Z},
|
|
48
|
-
left=${re}`),Ie(),Kt()}function en(){Y&&(Y.close(),Y=null),Pe()}const tn="WIDGET_EVENT";let ie=null;function nn(){ie&&(ie.cancel(),ie=null)}async function rn(p){const{onEvent:
|
|
49
|
-
`;function F(e){return e===void 0&&(e=window),e.location.protocol}function V(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return F(e)}function re(e){return e===void 0&&(e=window),V(e)==="about:"}function Z(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch{}}function Ze(e){if(e===void 0&&(e=window),e&&!Z(e))try{return e.opener}catch{}}function me(e){try{return!0}catch{}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=F(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=Z(e);return r&&me()?we(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function M(e){e===void 0&&(e=window);var n=we(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function Q(e){if(!function(n){try{if(n===window)return!0}catch{}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch{}try{if(re(n)&&me())return!0}catch{}try{if(function(r){return r===void 0&&(r=window),V(r)==="mock:"}(n)&&me())return!0}catch{}try{if(we(n)===we(window))return!0}catch{}return!1}(e))return!1;try{if(e===window||re(e)&&me()||M(window)===M(e))return!0}catch{}return!1}function ge(e){if(!Q(e))throw new Error("Expected window to be same domain");return e}function Ve(e,n){if(!e||!n)return!1;var t=Z(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch{}return o}(n).indexOf(e)!==-1}function Xe(e){var n=[],t;try{t=e.frames}catch{t=e}var r;try{r=t.length}catch{}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch{continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch{return n}if(!c)return n;n.push(c)}return n}var cn=[],dn=[];function $(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch{return!0}try{if(!e)return!0}catch{return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==b}if(n&&Q(e))try{if(e.mockclosed)return!0}catch{}try{if(!e.parent||!e.top)return!0}catch{}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch{}return-1}(cn,e);if(t!==-1){var r=dn[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 Ke(e){return e===void 0&&(e=window),Ze(e=e||window)||Z(e)||void 0}function oe(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 oe(t,n)}))}function ye(e){try{if(e===window)return!0}catch(n){if(n&&n.message===b)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===b)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===b)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===b)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===b)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===b)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch{}return!1}function Qe(e){if(Q(e))return ge(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 fn(e){if(function(t){return t===void 0&&(t=window),!!Z(t)}(e)){var n=Qe(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch{}}function ee(e){try{if(!e)return!1;if(typeof Promise<"u"&&e instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window<"u"&&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{return!1}return!1}var et=[],ae=[],Te=0,se;function tt(){if(!Te&&se){var e=se;se=null,e.resolve()}}function Oe(){Te+=1}function ue(){Te-=1,tt()}var I=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,c=!1,u=!1;Oe();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ue(),this.reject(s);return}ue(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ee(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(ee(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(et.indexOf(i)===-1){et.push(i),setTimeout(function(){throw i},1);for(var c=0;c<ae.length;c++)ae[c](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,Oe();for(var i=function(h,x){return h.then(function(E){x.resolve(E)},function(E){x.reject(E)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,l=c.promise,d=void 0;if(t)try{d=u?u(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 ee(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,ue()}},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>"u")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:ee(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)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ee(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ee(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};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 ae.push(r),{cancel:function(){ae.splice(ae.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;Oe();try{i=t.apply(r,o||[])}catch(a){return ue(),e.reject(a)}return ue(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ee(t)},e.flush=function(){return function(t){var r=se=se||new t;return tt(),r}(e)},e}();function Ee(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch{}return-1}var Ae=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>"u"||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{return!1}}())try{this.weakmap=new WeakMap}catch{}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(ye(i)&&$(i)){if(t)try{t.delete(i)}catch{}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!ye(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{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{}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Ee(c,t);s===-1?(c.push(t),u.push(r)):u[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{delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch{}this._cleanupClosedWindows();var i=Ee(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{delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch{}this._cleanupClosedWindows();var i=this.keys,a=Ee(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{delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch{}return this._cleanupClosedWindows(),Ee(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 nt(e){return e.name||e.__name__||e.displayName||"anonymous"}function rt(e,n){try{delete e.name,e.name=n}catch{}return e.__name__=e.displayName=n,e}function J(){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<"u")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 Se;function ot(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Se=Se||new Ae,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Se.get(r);return o||(o=typeof r+":"+J(),Se.set(r,o)),o}(t)+"]":typeof window<"u"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function ln(){return{}}var ce=0,it=0;function de(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=ce;ce+=1;var u=function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];c<it&&(i=null,a=null,c=ce,ce+=1);var f;f=r?(a=a||new Ae).getOrSet(this,ln):i=i||{};var h;try{h=ot(l)}catch{return e.apply(this,arguments)}var x=f[h];if(x&&o&&Date.now()-x.time<o&&(delete f[h],x=null),x)return x.value;var E=Date.now(),S=e.apply(this,arguments);return f[h]={time:E,value:S},S};return u.reset=function(){i=null,a=null},rt(u,(n.name||nt(e))+"::memoized")}de.clear=function(){it=ce};function hn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];var u=ot(a);return n.hasOwnProperty(u)||(n[u]=I.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},rt(t,nt(e)+"::promiseMemoized")}function te(){}function fe(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+`
|
|
50
|
-
`+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: "+fe(o,n+1)}}function
|
|
48
|
+
left=${re}`),Ie(),Kt()}function en(){Y&&(Y.close(),Y=null),Pe()}const tn="WIDGET_EVENT";let ie=null;function nn(){ie&&(ie.cancel(),ie=null)}async function rn(p){const{onEvent:w}=p,m=await Promise.resolve().then(()=>Ce);ie&&nn(),ie=m.on(tn,async v=>{w(v.data),Rt.includes(v.data.eventName)?en():v.data.eventName===Nt&&Pe()})}function on(p){rn(p)}class ke{constructor(w){Tt(this,ve);k(this,"onEvent");this.onEvent=w.onEvent,Xt&&(Qt(w),on({onEvent:Ot(this,ve,At).bind(this)}))}}ve=new WeakSet,At=function(w){this.onEvent(w)};var an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sn(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var Je={exports:{}},Ye={exports:{}};(function(p,w){(function(m,v){p.exports=v()})(typeof self<"u"?self:an,function(){return function(m){var v={};function g(y){if(v[y])return v[y].exports;var x=v[y]={i:y,l:!1,exports:{}};return m[y].call(x.exports,x,x.exports,g),x.l=!0,x.exports}return g.m=m,g.c=v,g.d=function(y,x,U){g.o(y,x)||Object.defineProperty(y,x,{enumerable:!0,get:U})},g.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},g.t=function(y,x){if(1&x&&(y=g(y)),8&x||4&x&&typeof y=="object"&&y&&y.__esModule)return y;var U=Object.create(null);if(g.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:y}),2&x&&typeof y!="string")for(var V in y)g.d(U,V,(function(re){return y[re]}).bind(null,V));return U},g.n=function(y){var x=y&&y.__esModule?function(){return y.default}:function(){return y};return g.d(x,"a",x),x},g.o=function(y,x){return{}.hasOwnProperty.call(y,x)},g.p="",g(g.s=0)}([function(m,v,g){g.r(v),g.d(v,"Promise",function(){return I}),g.d(v,"TYPES",function(){return An}),g.d(v,"ProxyWindow",function(){return _}),g.d(v,"setup",function(){return Ct}),g.d(v,"destroy",function(){return On}),g.d(v,"serializeMessage",function(){return In}),g.d(v,"deserializeMessage",function(){return Pn}),g.d(v,"createProxyWindow",function(){return Cn}),g.d(v,"toProxyWindow",function(){return Tn}),g.d(v,"on",function(){return X}),g.d(v,"once",function(){return Wn}),g.d(v,"send",function(){return K}),g.d(v,"markWindowKnown",function(){return vt}),g.d(v,"cleanUpWindow",function(){return Rn}),g.d(v,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var x=`Call was rejected by callee.\r
|
|
49
|
+
`;function U(e){return e===void 0&&(e=window),e.location.protocol}function V(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return U(e)}function re(e){return e===void 0&&(e=window),V(e)==="about:"}function Z(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch{}}function Ve(e){if(e===void 0&&(e=window),e&&!Z(e))try{return e.opener}catch{}}function we(e){try{return!0}catch{}return!1}function me(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=U(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=Z(e);return r&&we()?me(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function z(e){e===void 0&&(e=window);var n=me(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function Q(e){if(!function(n){try{if(n===window)return!0}catch{}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch{}try{if(re(n)&&we())return!0}catch{}try{if(function(r){return r===void 0&&(r=window),V(r)==="mock:"}(n)&&we())return!0}catch{}try{if(me(n)===me(window))return!0}catch{}return!1}(e))return!1;try{if(e===window||re(e)&&we()||z(window)===z(e))return!0}catch{}return!1}function ge(e){if(!Q(e))throw new Error("Expected window to be same domain");return e}function Xe(e,n){if(!e||!n)return!1;var t=Z(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch{}return o}(n).indexOf(e)!==-1}function Ke(e){var n=[],t;try{t=e.frames}catch{t=e}var r;try{r=t.length}catch{}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch{continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch{return n}if(!c)return n;n.push(c)}return n}var cn=[],dn=[];function $(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch{return!0}try{if(!e)return!0}catch{return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==x}if(n&&Q(e))try{if(e.mockclosed)return!0}catch{}try{if(!e.parent||!e.top)return!0}catch{}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch{}return-1}(cn,e);if(t!==-1){var r=dn[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 Qe(e){return e===void 0&&(e=window),Ve(e=e||window)||Z(e)||void 0}function oe(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 oe(t,n)}))}function ye(e){try{if(e===window)return!0}catch(n){if(n&&n.message===x)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===x)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===x)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===x)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===x)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===x)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch{}return!1}function et(e){if(Q(e))return ge(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 fn(e){if(function(t){return t===void 0&&(t=window),!!Z(t)}(e)){var n=et(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch{}}function ee(e){try{if(!e)return!1;if(typeof Promise<"u"&&e instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window<"u"&&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{return!1}return!1}var tt=[],ae=[],Te=0,se;function nt(){if(!Te&&se){var e=se;se=null,e.resolve()}}function Oe(){Te+=1}function ue(){Te-=1,nt()}var I=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,c=!1,u=!1;Oe();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ue(),this.reject(s);return}ue(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ee(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(ee(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(tt.indexOf(i)===-1){tt.push(i),setTimeout(function(){throw i},1);for(var c=0;c<ae.length;c++)ae[c](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,Oe();for(var i=function(h,b){return h.then(function(E){b.resolve(E)},function(E){b.reject(E)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,l=c.promise,d=void 0;if(t)try{d=u?u(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 ee(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,ue()}},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>"u")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:ee(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)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ee(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ee(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};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 ae.push(r),{cancel:function(){ae.splice(ae.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;Oe();try{i=t.apply(r,o||[])}catch(a){return ue(),e.reject(a)}return ue(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ee(t)},e.flush=function(){return function(t){var r=se=se||new t;return nt(),r}(e)},e}();function Ee(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch{}return-1}var Ae=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>"u"||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{return!1}}())try{this.weakmap=new WeakMap}catch{}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(ye(i)&&$(i)){if(t)try{t.delete(i)}catch{}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!ye(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{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{}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Ee(c,t);s===-1?(c.push(t),u.push(r)):u[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{delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch{}this._cleanupClosedWindows();var i=Ee(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{delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch{}this._cleanupClosedWindows();var i=this.keys,a=Ee(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{delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch{}return this._cleanupClosedWindows(),Ee(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 rt(e){return e.name||e.__name__||e.displayName||"anonymous"}function ot(e,n){try{delete e.name,e.name=n}catch{}return e.__name__=e.displayName=n,e}function J(){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<"u")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 Se;function it(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Se=Se||new Ae,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Se.get(r);return o||(o=typeof r+":"+J(),Se.set(r,o)),o}(t)+"]":typeof window<"u"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function ln(){return{}}var ce=0,at=0;function de(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=ce;ce+=1;var u=function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];c<at&&(i=null,a=null,c=ce,ce+=1);var f;f=r?(a=a||new Ae).getOrSet(this,ln):i=i||{};var h;try{h=it(l)}catch{return e.apply(this,arguments)}var b=f[h];if(b&&o&&Date.now()-b.time<o&&(delete f[h],b=null),b)return b.value;var E=Date.now(),S=e.apply(this,arguments);return f[h]={time:E,value:S},S};return u.reset=function(){i=null,a=null},ot(u,(n.name||rt(e))+"::memoized")}de.clear=function(){at=ce};function hn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];var u=it(a);return n.hasOwnProperty(u)||(n[u]=I.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},ot(t,rt(e)+"::promiseMemoized")}function te(){}function fe(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+`
|
|
50
|
+
`+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: "+fe(o,n+1)}}function st(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}de(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 Re(e){return{}.toString.call(e)==="[object RegExp]"}function le(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function ut(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function ct(){return!!document.body&&document.readyState==="complete"}function dt(){return!!document.body&&document.readyState==="interactive"}de(function(){return new I(function(e){if(ct()||dt())return e();var n=setInterval(function(){if(ct()||dt())return clearInterval(n),e()},10)})});var xe=typeof document<"u"?document.currentScript:null,pn=de(function(){if(xe||(xe=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{}}()))return xe;throw new Error("Can not determine current script")}),vn=J();de(function(){var e;try{e=pn()}catch{return vn}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=J();return e.setAttribute("data-uid-auto",n),n});function he(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var ft=function(){return{}};function j(e,n){return e===void 0&&(e="store"),n===void 0&&(n=ft),le(he(),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 le(t,r,o)},reset:function(){t=n()},keys:function(){return Object.keys(t)}}})}var wn=function(){};function be(){var e=he();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new wn,e.WINDOW_WILDCARD}function L(e,n){return e===void 0&&(e="store"),n===void 0&&(n=ft),j("windowStore").getOrSet(e,function(){var t=new Ae,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 le(r(o),e,i)}}})}function lt(){return j("instance").getOrSet("instanceID",J)}function ht(e,n){var t=n.domain,r=L("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=I.resolve({domain:t});return r.set(e,i),i}function Ne(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:lt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return ht(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function pt(e,n){var t=n.send;return L("windowInstanceIDPromises").getOrSet(e,function(){return Ne(e,{send:t}).then(function(r){return r.instanceID})})}function vt(e){L("knownWindows").set(e,!0)}function De(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function wt(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 ne(e,n){return{__type__:e,__val__:n}}var F,mn=((F={}).function=function(){},F.error=function(e){return ne("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},F.promise=function(){},F.regex=function(e){return ne("regex",e.source)},F.date=function(e){return ne("date",e.toJSON())},F.array=function(e){return e},F.object=function(e){return e},F.string=function(e){return e},F.number=function(e){return e},F.boolean=function(e){return e},F.null=function(e){return e},F[void 0]=function(e){return ne("undefined",e)},F),gn={},G,yn=((G={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},G.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+`
|
|
51
51
|
|
|
52
|
-
`+o.stack,o},G.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},G.regex=function(e){return new RegExp(e)},G.date=function(e){return new Date(e)},G.array=function(e){return e},G.object=function(e){return e},G.string=function(e){return e},G.number=function(e){return e},G.boolean=function(e){return e},G.null=function(e){return e},G[void 0]=function(){},G),En={};new I(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 je(){for(var e=j("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function mt(e,n){var t=n.send,r=n.id,o=r===void 0?J():r,i=e.then(function(u){if(Q(u))return ge(u).name}),a=e.then(function(u){if($(u))throw new Error("Window is closed, can not determine type");return
|
|
52
|
+
`+o.stack,o},G.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},G.regex=function(e){return new RegExp(e)},G.date=function(e){return new Date(e)},G.array=function(e){return e},G.object=function(e){return e},G.string=function(e){return e},G.number=function(e){return e},G.boolean=function(e){return e},G.null=function(e){return e},G[void 0]=function(){},G),En={};new I(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 je(){for(var e=j("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function mt(e,n){var t=n.send,r=n.id,o=r===void 0?J():r,i=e.then(function(u){if(Q(u))return ge(u).name}),a=e.then(function(u){if($(u))throw new Error("Window is closed, can not determine type");return Ve(u)?"popup":"iframe"});i.catch(te),a.catch(te);var c=function(){return e.then(function(u){if(!$(u))return Q(u)?ge(u).name:i})};return{id:o,getType:function(){return a},getInstanceID:hn(function(){return e.then(function(u){return pt(u,{send:t})})}),close:function(){return e.then(fn)},getName:c,focus:function(){return e.then(function(u){u.focus()})},isClosed:function(){return e.then(function(u){return $(u)})},setLocation:function(u,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,b=s.body;if(u.indexOf("/")===0)u=""+d+u;else if(!u.match(/^https?:\/\//)&&u.indexOf(d)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(u));if(h==="post")return c().then(function(E){if(!E)throw new Error("Can not post to window without target name");(function(S){var P=S.url,D=S.target,T=S.body,C=S.method,M=C===void 0?"post":C,W=document.createElement("form");if(W.setAttribute("target",D),W.setAttribute("method",M),W.setAttribute("action",P),W.style.display="none",T)for(var O=0,q=Object.keys(T);O<q.length;O++){var N,pe=q[O],He=document.createElement("input");He.setAttribute("name",pe),He.setAttribute("value",(N=T[pe])==null?void 0:N.toString()),W.appendChild(He)}ut().appendChild(W),W.submit(),ut().removeChild(W)})({url:u,target:E,method:h,body:b})});if(h!=="get")throw new Error("Unsupported method: "+h);if(Q(l))try{if(l.location&&typeof l.location.replace=="function"){l.location.replace(u);return}}catch{}l.location=u})},setName:function(u){return e.then(function(s){var l=Q(s),d=et(s);if(!l)throw new Error("Can not set name for cross-domain window: "+u);ge(s).name=u,d&&d.setAttribute("name",u),i=I.resolve(u)})}}}var _=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 I,this.serializedWindow=i||mt(this.actualWindowPromise,{send:r}),j("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=I.hash({isPopup:r,name:o}).then(function(c){var u=c.name;c.isPopup&&u&&window.open("",u,"noopener")}),a=this.serializedWindow.focus();return I.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=mt(this.actualWindowPromise,{send:o,id:this.getID()}),L("winToProxyWindow").set(t,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(t,r){var o=this,i=r.send;return I.try(function(){return o.actualWindow?t===o.actualWindow:I.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:pt(t,{send:i})}).then(function(a){var c=a.proxyInstanceID===a.knownWindowInstanceID;return c&&o.setWindow(t,{send:i}),c})})},n.unwrap=function(){return this.actualWindow||this},n.getInstanceID=function(){return this.serializedWindow.getInstanceID()},n.shouldClean=function(){return!!(this.actualWindow&&$(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 je(),e.toProxyWindow(t,{send:o}).serialize()},e.deserialize=function(t,r){var o=r.send;return je(),j("idToProxyWindow").get(t.id)||new e({serializedWindow:t,send:o})},e.isProxyWindow=function(t){return!!(t&&!ye(t)&&t.isProxyWindow)},e.toProxyWindow=function(t,r){var o=r.send;if(je(),e.isProxyWindow(t))return t;var i=t;return L("winToProxyWindow").get(i)||new e({win:i,send:o})},e}();function Me(e,n,t,r,o){var i=L("methodStore"),a=j("proxyWindowMethods");_.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 gt(e,n){var t=L("methodStore"),r=j("proxyWindowMethods");return t.getOrSet(e,function(){return{}})[n]||r.get(n)}function yt(e,n,t,r,o){a=(i={on:o.on,send:o.send}).on,c=i.send,j("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(l){var d=l.source,f=l.origin,h=l.data,b=h.id,E=h.name,S=gt(d,b);if(!S)throw new Error("Could not find method '"+E+"' with id: "+h.id+" in "+z(window));var P=S.source,D=S.domain,T=S.val;return I.try(function(){if(!oe(D,f))throw new Error("Method '"+h.name+"' domain "+JSON.stringify(Re(S.domain)?S.domain.source:S.domain)+" does not match origin "+f+" in "+z(window));if(_.isProxyWindow(P))return P.matchWindow(d,{send:c}).then(function(C){if(!C)throw new Error("Method call '"+h.name+"' failed - proxy window does not match source in "+z(window))})}).then(function(){return T.apply({source:d,origin:f},h.args)},function(C){return I.try(function(){if(T.onError)return T.onError(C)}).then(function(){throw C.stack&&(C.stack="Remote call to "+E+"("+function(M){return M===void 0&&(M=[]),(W=M,[].slice.call(W)).map(function(O){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+">"}).join(", ");var W}(h.args)+`) failed
|
|
53
53
|
|
|
54
|
-
`+C.stack),C})}).then(function(C){return{result:C,id:
|
|
54
|
+
`+C.stack),C})}).then(function(C){return{result:C,id:b,name:E}})})});var i,a,c,u=t.__id__||J();e=_.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+"::")),_.isProxyWindow(e)?(Me(u,t,s,e,n),e.awaitWindow().then(function(l){Me(u,t,s,l,n)})):Me(u,t,s,e,n),ne("cross_domain_function",{id:u,name:s})}function Et(e,n,t,r){var o,i=r.on,a=r.send;return function(c,u){u===void 0&&(u=gn);var s=JSON.stringify(c,function(l){var d=this[l];if(De(this))return d;var f=wt(d);if(!f)return d;var h=u[f]||mn[f];return h?h(d,l):d});return s===void 0?"undefined":s}(t,((o={}).promise=function(c,u){return function(s,l,d,f,h){return ne("cross_domain_zalgo_promise",{then:yt(s,l,function(b,E){return d.then(b,E)},f,{on:h.on,send:h.send})})}(e,n,c,u,{on:i,send:a})},o.function=function(c,u){return yt(e,n,c,u,{on:i,send:a})},o.object=function(c){return ye(c)||_.isProxyWindow(c)?ne("cross_domain_window",_.serialize(c,{send:a})):c},o))}function St(e,n,t,r){var o,i=r.send;return function(a,c){if(c===void 0&&(c=En),a!=="undefined")return JSON.parse(a,function(u,s){if(De(this))return s;var l,d;if(De(s)?(l=s.__type__,d=s.__val__):(l=wt(s),d=s),!l)return d;var f=c[l]||yn[l];return f?f(d,u):d})}(t,((o={}).cross_domain_zalgo_promise=function(a){return function(c,u,s){return new I(s.then)}(0,0,a)},o.cross_domain_function=function(a){return function(c,u,s,l){var d=s.id,f=s.name,h=l.send,b=function(S){S===void 0&&(S={});function P(){var D=arguments;return _.toProxyWindow(c,{send:h}).awaitWindow().then(function(T){var C=gt(T,d);if(C&&C.val!==P)return C.val.apply({source:window,origin:z()},D);var M=[].slice.call(D);return S.fireAndForget?h(T,"postrobot_method",{id:d,name:f,args:M},{domain:u,fireAndForget:!0}):h(T,"postrobot_method",{id:d,name:f,args:M},{domain:u,fireAndForget:!1}).then(function(W){return W.data.result})}).catch(function(T){throw T})}return P.__name__=f,P.__origin__=u,P.__source__=c,P.__id__=d,P.origin=u,P},E=b();return E.fireAndForget=b({fireAndForget:!0}),E}(e,n,a,{send:i})},o.cross_domain_window=function(a){return _.deserialize(a,{send:i})},o))}var ze={};ze.postrobot_post_message=function(e,n,t){t.indexOf("file:")===0&&(t="*"),e.postMessage(n,t)};function Le(e,n,t,r){var o=r.on,i=r.send;return I.try(function(){var a=L().getOrSet(e,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(t),a.flush=a.flush||I.flush().then(function(){if($(e))throw new Error("Window is closed");var c=Et(e,n,((u={}).__post_robot_10_0_46__=a.buffer||[],u),{on:o,send:i}),u;delete a.buffer;for(var s=Object.keys(ze),l=[],d=0;d<s.length;d++){var f=s[d];try{ze[f](e,c,n)}catch(h){l.push(h)}}if(l.length===s.length)throw new Error(`All post-robot messaging strategies failed:
|
|
55
55
|
|
|
56
|
-
`+l.map(function(h,
|
|
56
|
+
`+l.map(function(h,b){return b+". "+fe(h)}).join(`
|
|
57
57
|
|
|
58
|
-
`))}),a.flush.then(function(){delete a.flush})}).then(te)}function
|
|
58
|
+
`))}),a.flush.then(function(){delete a.flush})}).then(te)}function xt(e){return j("responseListeners").get(e)}function bt(e){j("responseListeners").del(e)}function Wt(e){return j("erroredResponseListeners").has(e)}function It(e){var n=e.name,t=e.win,r=e.domain,o=L("requestListeners");if(t==="*"&&(t=null),r==="*"&&(r=null),!n)throw new Error("Name required to get request listener");for(var i=0,a=[t,be()];i<a.length;i++){var c=a[i];if(c){var u=o.get(c);if(u){var s=u[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(oe(f.regex,r))return h}}if(s["*"])return s["*"]}}}}}function Sn(e,n,t,r){var o=r.on,i=r.send,a=It({name:t.name,win:e,domain:n}),c=t.name==="postrobot_method"&&t.data&&typeof t.data.name=="string"?t.data.name+"()":t.name;function u(s,l,d){return I.flush().then(function(){if(!t.fireAndForget&&!$(e))try{return Le(e,n,{id:J(),origin:z(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 "+c+" in "+z()+`
|
|
59
59
|
|
|
60
|
-
`+fe(f))}})}return I.all([I.flush().then(function(){if(!t.fireAndForget&&!$(e))try{return Le(e,n,{id:J(),origin:
|
|
60
|
+
`+fe(f))}})}return I.all([I.flush().then(function(){if(!t.fireAndForget&&!$(e))try{return Le(e,n,{id:J(),origin:z(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 "+c+" in "+z()+`
|
|
61
61
|
|
|
62
|
-
`+fe(s))}}),I.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 u("success",s)},function(s){return u("error",null,s)})]).then(te).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function xn(e,n,t){if(!
|
|
62
|
+
`+fe(s))}}),I.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 u("success",s)},function(s){return u("error",null,s)})]).then(te).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function xn(e,n,t){if(!Wt(t.hash)){var r=xt(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(!oe(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 bn(e,n,t){if(!Wt(t.hash)){var r=xt(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(!oe(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");bt(t.hash),t.ack==="error"?r.promise.reject(t.error):t.ack==="success"&&r.promise.resolve({source:e,origin:n,data:t.data})}}function Pt(e,n){var t=n.on,r=n.send,o=j("receivedMessages");try{if(!window||window.closed||!e.source)return}catch{return}var i=e.source,a=e.origin,c=function(l,d,f,h){var b=h.on,E=h.send,S;try{S=St(d,f,l,{on:b,send:E})}catch{return}if(S&&typeof S=="object"&&S!==null){var P=S.__post_robot_10_0_46__;if(Array.isArray(P))return P}}(e.data,i,a,{on:t,send:r});if(c){vt(i);for(var u=0;u<c.length;u++){var s=c[u];if(o.has(s.id)||(o.set(s.id,!0),$(i)&&!s.fireAndForget))return;s.origin.indexOf("file:")===0&&(a="file://");try{s.type==="postrobot_message_request"?Sn(i,a,s,{on:t,send:r}):s.type==="postrobot_message_response"?bn(i,a,s):s.type==="postrobot_message_ack"&&xn(i,a,s)}catch(l){setTimeout(function(){throw l},0)}}}}function X(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 c=i.name,u=i.win,s=i.domain,l=L("requestListeners");if(!c||typeof c!="string")throw new Error("Name required to add request listener");if(u&&u!=="*"&&_.isProxyWindow(u)){var d=u.awaitWindow().then(function(N){return o({name:c,win:N,domain:s},a)});return{cancel:function(){d.then(function(N){return N.cancel()},te)}}}var f=u;if(Array.isArray(f)){for(var h=[],b=0,E=f;b<E.length;b++)h.push(o({name:c,domain:s,win:E[b]},a));return{cancel:function(){for(var N=0;N<h.length;N++)h[N].cancel()}}}if(Array.isArray(s)){for(var S=[],P=0,D=s;P<D.length;P++)S.push(o({name:c,win:f,domain:D[P]},a));return{cancel:function(){for(var N=0;N<S.length;N++)S[N].cancel()}}}var T=It({name:c,win:f,domain:s});f&&f!=="*"||(f=be());var C=(s=s||"*").toString();if(T)throw f&&s?new Error("Request listener already exists for "+c+" on domain "+s.toString()+" for "+(f===be()?"wildcard":"specified")+" window"):f?new Error("Request listener already exists for "+c+" for "+(f===be()?"wildcard":"specified")+" window"):s?new Error("Request listener already exists for "+c+" on domain "+s.toString()):new Error("Request listener already exists for "+c);var M=l.getOrSet(f,function(){return{}}),W=le(M,c,function(){return{}}),O,q;return Re(s)?(O=le(W,"__domain_regex__",function(){return[]})).push(q={regex:s,listener:a}):W[C]=a,{cancel:function(){delete W[C],q&&(O.splice(O.indexOf(q,1)),O.length||delete W.__domain_regex__),Object.keys(W).length||delete M[c],f&&!Object.keys(M).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 Wn(e,n,t){typeof(n=n||{})=="function"&&(t=n,n={});var r=new I,o;return n.errorHandler=function(i){o.cancel(),r.reject(i)},o=X(e,n,function(i){if(o.cancel(),r.resolve(i),t)return t(i)}),r.cancel=o.cancel,r}var K=function e(n,t,r,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,c=o.timeout||5e3,u=o.fireAndForget||!1;return _.toProxyWindow(n,{send:e}).awaitWindow().then(function(s){return I.try(function(){if(function(l,d,f){if(!l)throw new Error("Expected name");if(f&&typeof f!="string"&&!Array.isArray(f)&&!Re(f))throw new TypeError("Can not send "+l+". Expected domain "+JSON.stringify(f)+" to be a string, array, or regex");if($(d))throw new Error("Can not send "+l+". Target window is closed")}(t,s,i),function(l,d){var f=Qe(d);if(f)return f===l;if(d===l||function(E){E===void 0&&(E=window);try{if(E.top)return E.top}catch{}if(Z(E)===E)return E;try{if(Xe(window,E)&&window.top)return window.top}catch{}try{if(Xe(E,window)&&window.top)return window.top}catch{}for(var S=0,P=function T(C){for(var M=[],W=0,O=Ke(C);W<O.length;W++){var q=O[W];M.push(q);for(var N=0,pe=T(q);N<pe.length;N++)M.push(pe[N])}return M}(E);S<P.length;S++){var D=P[S];try{if(D.top)return D.top}catch{}if(Z(D)===D)return D}}(d)===d)return!1;for(var h=0,b=Ke(l);h<b.length;h++)if(b[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(b){return L("helloPromises").getOrSet(b,function(){return new I})}(l);return d!==-1&&(h=h.timeout(d,new Error(f+" did not load after "+d+"ms"))),h}(s,c)}).then(function(l){return function(d,f,h,b){var E=b.send;return I.try(function(){return typeof f=="string"?f:I.try(function(){return h||Ne(d,{send:E}).then(function(S){return S.domain})}).then(function(S){if(!oe(f,f))throw new Error("Domain "+st(f)+" does not match "+st(f));return S})})}(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 I,b=t+"_"+J();if(!u){var E={name:t,win:s,domain:d,promise:h};(function(W,O){j("responseListeners").set(W,O)})(b,E);var S=L("requestPromises").getOrSet(s,function(){return[]});S.push(h),h.catch(function(){(function(W){j("erroredResponseListeners").set(W,!0)})(b),bt(b)});var P=function(W){return L("knownWindows").get(W,!1)}(s)?1e4:2e3,D=a,T=P,C=D,M=function(W,O){var q;return function N(){q=setTimeout(function(){(function(){if($(s))return h.reject(new Error("Window closed for "+t+" before "+(E.ack?"response":"ack")));if(E.cancelled)return h.reject(new Error("Response listener was cancelled for "+t));T=Math.max(T-500,0),C!==-1&&(C=Math.max(C-500,0)),E.ack||T!==0?C===0&&h.reject(new Error("No response for postMessage "+f+" in "+z()+" in "+D+"ms")):h.reject(new Error("No ack for postMessage "+f+" in "+z()+" in "+P+"ms"))})(),N()},500)}(),{cancel:function(){clearTimeout(q)}}}();h.finally(function(){M.cancel(),S.splice(S.indexOf(h,1))}).catch(te)}return Le(s,d,{id:J(),origin:z(window),type:"postrobot_message_request",hash:b,name:t,data:r,fireAndForget:u},{on:X,send:e}).then(function(){return u?h.resolve():h},function(W){throw new Error("Send request message failed for "+f+" in "+z()+`
|
|
63
63
|
|
|
64
|
-
`+fe(W))})})})};function In(e,n,t){return
|
|
64
|
+
`+fe(W))})})})};function In(e,n,t){return Et(e,n,t,{on:X,send:K})}function Pn(e,n,t){return St(e,n,t,{on:X,send:K})}function Cn(e){return new _({send:K,win:e})}function Tn(e){return _.toProxyWindow(e,{send:K})}function Ct(){he().initialized||(he().initialized=!0,n=(e={on:X,send:K}).on,t=e.send,(r=he()).receiveMessage=r.receiveMessage||function(o){return Pt(o,{on:n,send:t})},function(o){var i=o.on,a=o.send;j().getOrSet("postMessageListener",function(){return function(c,u,s){return c.addEventListener("message",s),{cancel:function(){c.removeEventListener("message",s)}}}(window,0,function(c){(function(u,s){var l=s.on,d=s.send;I.try(function(){var f=u.source||u.sourceElement,h=u.origin||u.originalEvent&&u.originalEvent.origin,b=u.data;if(h==="null"&&(h="file://"),f){if(!h)throw new Error("Post message did not have origin domain");Pt({source:f,origin:h,data:b},{on:l,send:d})}})})(c,{on:i,send:a})})})}({on:X,send:K}),function(o){var i=o.on,a=o.send;j("builtinListeners").getOrSet("helloListener",function(){var c=i("postrobot_hello",{domain:"*"},function(s){return ht(s.source,{domain:s.origin}),{instanceID:lt()}}),u=Qe();return u&&Ne(u,{send:a}).catch(function(s){}),c})}({on:X,send:K}));var e,n,t,r}function On(){(function(){for(var n=j("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=j().get("postMessageListener"))&&e.cancel();var e;delete window.__post_robot_10_0_46__}var An=!0;function Rn(e){for(var n=0,t=L("requestPromises").get(e,[]);n<t.length;n++)t[n].reject(new Error("Window "+($(e)?"closed":"cleaned up")+" before response")).catch(te)}Ct()}])})})(Ye);var un=Ye.exports;(function(p){p.exports=un,p.exports.default=p.exports})(Je);var Ze=Je.exports;const Ce=R({__proto__:null,default:sn(Ze)},[Ze]);A.ConsentBox=Jt,A.SoyioTypes=Yt,A.SoyioWidget=ke,A._TooltipManager=qe,A.default=ke,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|