@iframe-resizer/core 6.0.0-beta.1 → 6.0.0-beta.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 +2 -2
- package/index.cjs.js +13 -19
- package/index.cjs.js.map +1 -1
- package/index.d.ts +165 -3
- package/index.esm.js +431 -444
- package/index.esm.js.map +1 -1
- package/index.umd.js +12 -18
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/types.d.ts +0 -130
package/index.esm.js
CHANGED
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
const _ = "6.0.0-beta.
|
|
3
|
-
`,
|
|
1
|
+
import et, { NORMAL as tt, HIGHLIGHT as c, FOREGROUND as z } from "auto-console-group";
|
|
2
|
+
const _ = "6.0.0-beta.3", he = "iframeResizer", A = ":", nt = "[iFrameResizerChild]Ready", ge = "autoResize", ot = "beforeUnload", it = "close", st = "inPageLink", $ = "init", de = "iframeReady", rt = "lazy", G = "load", L = "message", lt = "mouseenter", at = "mouseleave", ye = "onload", me = "pageInfo", be = "parentInfo", ct = "pageInfoStop", ut = "parentInfoStop", V = "reset", ve = "resize", ft = "scrollBy", pt = "scrollTo", ht = "scrollToOffset", gt = "title", Q = 1, dt = "height", yt = "width", mt = "offset", bt = "offsetSize", ee = "scroll", C = `
|
|
3
|
+
`, vt = "hidden", zt = "child", U = "parent", Y = "string", wt = "number", ze = "object", Et = "function", q = "auto", Ot = "font-weight: bold;", we = "none", Ee = "both", W = "vertical", Oe = "horizontal", kt = "omit", Tt = L.length, B = "[iFrameSizer]", Z = B.length, jt = Object.freeze({
|
|
4
4
|
max: 1,
|
|
5
5
|
scroll: 1,
|
|
6
6
|
bodyScroll: 1,
|
|
7
7
|
documentElementScroll: 1
|
|
8
|
-
}),
|
|
9
|
-
[
|
|
10
|
-
[
|
|
8
|
+
}), te = Object.freeze({
|
|
9
|
+
[ye]: 1,
|
|
10
|
+
[$]: 1,
|
|
11
11
|
[de]: 1
|
|
12
|
-
}),
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
}),
|
|
16
|
-
function
|
|
17
|
-
if (!
|
|
12
|
+
}), I = "expanded", M = "collapsed", ke = 0, Te = 1, je = 2, It = Object.freeze({
|
|
13
|
+
[I]: 1,
|
|
14
|
+
[M]: 1
|
|
15
|
+
}), Mt = "Use of the old name will be removed in a future version of <i>iframe-resizer</>.", Ie = (e) => typeof e === ze && e !== null, X = (e) => typeof e === Y;
|
|
16
|
+
function St(e) {
|
|
17
|
+
if (!Ie(e)) return !1;
|
|
18
18
|
try {
|
|
19
19
|
return e.tagName === "IFRAME" || e instanceof HTMLIFrameElement;
|
|
20
20
|
} catch {
|
|
21
21
|
return !1;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const $t = (e, ...t) => setTimeout(() => e(...t), 0), Rt = (e) => {
|
|
25
25
|
let t = !1;
|
|
26
26
|
return function(...n) {
|
|
27
27
|
return t ? void 0 : (t = !0, e.apply(this, n));
|
|
28
28
|
};
|
|
29
|
-
},
|
|
29
|
+
}, At = (e, t) => Object.prototype.hasOwnProperty.call(e, t), P = (e, t) => Object.hasOwn ? Object.hasOwn(e, t) : At(e, t), Lt = (e) => e, Pt = (e) => e.charAt(0).toUpperCase() + e.slice(1), Nt = (e) => (
|
|
30
30
|
// eslint-disable-next-line no-underscore-dangle
|
|
31
31
|
e?.__esModule ? e.default : e
|
|
32
|
-
),
|
|
32
|
+
), Ct = (e, t, n) => {
|
|
33
33
|
if (typeof e !== t)
|
|
34
|
-
throw new TypeError(`${n} is not a ${
|
|
35
|
-
},
|
|
36
|
-
r,
|
|
37
|
-
`<rb>Deprecated ${t}(${o.replace("()", "")})</>
|
|
38
|
-
|
|
39
|
-
The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${c}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`
|
|
40
|
-
), Se = {
|
|
34
|
+
throw new TypeError(`${n} is not a ${Pt(t)}`);
|
|
35
|
+
}, Me = {
|
|
41
36
|
br: `
|
|
42
37
|
`,
|
|
43
38
|
rb: "\x1B[31;1m",
|
|
@@ -52,56 +47,53 @@ The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${c}Use of the old $
|
|
|
52
47
|
// underline
|
|
53
48
|
"/": "\x1B[m"
|
|
54
49
|
// reset
|
|
55
|
-
}, xt = Object.keys(
|
|
56
|
-
|
|
57
|
-
), i = {},
|
|
58
|
-
let
|
|
59
|
-
const
|
|
50
|
+
}, xt = Object.keys(Me), _t = new RegExp(`<(${xt.join("|")})>`, "gi"), Bt = (e, t) => Me[t] ?? "", Ft = (e) => e.replace(_t, Bt), Ht = (e) => e.replaceAll("<br>", C).replaceAll(/<\/?[^>]+>/gi, ""), Se = (e) => (t) => e(
|
|
51
|
+
X(t) ? window.chrome ? Ft(t) : Ht(t) : t
|
|
52
|
+
), i = {}, $e = Nt(et);
|
|
53
|
+
let K = !0;
|
|
54
|
+
const Wt = $e({
|
|
60
55
|
expand: !1,
|
|
61
|
-
label:
|
|
62
|
-
}),
|
|
63
|
-
function
|
|
56
|
+
label: U
|
|
57
|
+
}), Dt = (e) => window.top === window.self ? `parent(${e})` : `nested parent(${e})`, Gt = (e) => i[e] ? i[e].log : K;
|
|
58
|
+
function Vt({
|
|
64
59
|
enabled: e,
|
|
65
60
|
expand: t,
|
|
66
61
|
iframeId: n
|
|
67
62
|
}) {
|
|
68
|
-
const o =
|
|
63
|
+
const o = $e({
|
|
69
64
|
expand: t,
|
|
70
|
-
label:
|
|
65
|
+
label: Dt(n)
|
|
71
66
|
});
|
|
72
|
-
|
|
67
|
+
K = e, i[n] || (i[n] = {
|
|
73
68
|
console: o
|
|
74
69
|
});
|
|
75
70
|
}
|
|
76
|
-
const
|
|
71
|
+
const T = (e) => (t, ...n) => i[t] ? i[t].console[e](...n) : Wt[e](...n), Re = (e) => (t, ...n) => Gt(t) === !0 ? T(e)(t, ...n) : null, u = Re("log"), y = u, Ut = Re("debug"), w = T("warn"), qt = T("error"), b = T("event"), Zt = T("purge"), Jt = T("endAutoGroup"), Ae = T("errorBoundary");
|
|
77
72
|
function Yt(e, t) {
|
|
78
73
|
queueMicrotask(
|
|
79
74
|
() => (
|
|
80
75
|
// eslint-disable-next-line no-console
|
|
81
76
|
console.info(
|
|
82
77
|
`%ciframe-resizer ${e}`,
|
|
83
|
-
|
|
78
|
+
K || t < 1 ? Ot : tt
|
|
84
79
|
)
|
|
85
80
|
)
|
|
86
81
|
);
|
|
87
82
|
}
|
|
88
|
-
const Xt = (e) => (...t) => [`${
|
|
89
|
-
const n =
|
|
83
|
+
const Xt = (e) => (...t) => [`${he}(${e})`, ...t].join(" "), Kt = Se(Lt), m = (e, ...t) => i[e] ? i[e].console.warn(...t.map(Kt)) : queueMicrotask(() => {
|
|
84
|
+
const n = Se(Xt(e));
|
|
90
85
|
console?.warn(...t.map(n));
|
|
91
|
-
}),
|
|
92
|
-
typeof i[e.id].onInit === we && (en("init()", "onReady()", "", e.id), i[e.id].onInit(e));
|
|
93
|
-
}, B = Object.freeze({
|
|
86
|
+
}), F = Object.freeze({
|
|
94
87
|
autoResize: !0,
|
|
95
88
|
bodyBackground: null,
|
|
96
89
|
bodyMargin: null,
|
|
97
90
|
bodyPadding: null,
|
|
98
91
|
checkOrigin: !0,
|
|
99
|
-
direction:
|
|
92
|
+
direction: W,
|
|
100
93
|
firstRun: !0,
|
|
101
94
|
inPageLinks: !1,
|
|
102
95
|
heightCalculationMethod: q,
|
|
103
|
-
id: "
|
|
104
|
-
// TODO: v6 change to 'iframeResizer'
|
|
96
|
+
id: "iframeResizer",
|
|
105
97
|
log: !1,
|
|
106
98
|
logExpand: !1,
|
|
107
99
|
license: void 0,
|
|
@@ -121,150 +113,150 @@ const Xt = (e) => (...t) => [`${pe}(${e})`, ...t].join(" "), Kt = je(Lt), m = (e
|
|
|
121
113
|
onBeforeClose: () => !0,
|
|
122
114
|
onAfterClose() {
|
|
123
115
|
},
|
|
124
|
-
onInit: !1,
|
|
125
116
|
onMessage: null,
|
|
126
117
|
onMouseEnter() {
|
|
127
118
|
},
|
|
128
119
|
onMouseLeave() {
|
|
129
120
|
},
|
|
130
|
-
onReady
|
|
121
|
+
onReady() {
|
|
122
|
+
},
|
|
131
123
|
onResized() {
|
|
132
124
|
},
|
|
133
125
|
onScroll: () => !0
|
|
134
126
|
});
|
|
135
|
-
let
|
|
136
|
-
function
|
|
137
|
-
const t = e?.id ||
|
|
138
|
-
return document.getElementById(t) === null ? t : `${t}${
|
|
127
|
+
let ne = 0;
|
|
128
|
+
function Qt(e) {
|
|
129
|
+
const t = e?.id || F.id + ne++;
|
|
130
|
+
return document.getElementById(t) === null ? t : `${t}${ne++}`;
|
|
139
131
|
}
|
|
140
|
-
function
|
|
132
|
+
function en(e, t) {
|
|
141
133
|
let { id: n } = e;
|
|
142
|
-
if (n && !
|
|
143
|
-
throw new TypeError("Invalid id for
|
|
144
|
-
return (!n || n === "") && (n =
|
|
134
|
+
if (n && !X(n))
|
|
135
|
+
throw new TypeError("Invalid id for iframe. Expected String");
|
|
136
|
+
return (!n || n === "") && (n = Qt(t), e.id = n, b(n, "assignId"), u(n, `Added missing iframe ID: ${n} (${e.src})`)), n;
|
|
145
137
|
}
|
|
146
|
-
function
|
|
138
|
+
function tn(e) {
|
|
147
139
|
const { search: t } = window.location;
|
|
148
140
|
if (t.includes("ifrlog"))
|
|
149
141
|
switch (new URLSearchParams(t).get("ifrlog")) {
|
|
150
|
-
case String(
|
|
142
|
+
case String(ke): {
|
|
151
143
|
e.log = !1;
|
|
152
144
|
break;
|
|
153
145
|
}
|
|
154
|
-
case
|
|
155
|
-
case String(
|
|
156
|
-
e.log =
|
|
146
|
+
case I:
|
|
147
|
+
case String(je): {
|
|
148
|
+
e.log = I;
|
|
157
149
|
break;
|
|
158
150
|
}
|
|
159
|
-
case
|
|
160
|
-
case String(
|
|
161
|
-
e.log =
|
|
151
|
+
case M:
|
|
152
|
+
case String(Te): {
|
|
153
|
+
e.log = M;
|
|
162
154
|
break;
|
|
163
155
|
}
|
|
164
156
|
default:
|
|
165
|
-
e.log =
|
|
157
|
+
e.log = M;
|
|
166
158
|
}
|
|
167
159
|
}
|
|
168
|
-
const N = (e, t, n, o) => e.addEventListener(t, n, o || !1),
|
|
169
|
-
function
|
|
160
|
+
const N = (e, t, n, o) => e.addEventListener(t, n, o || !1), oe = (e, t, n) => e.removeEventListener(t, n, !1), nn = (e) => e.split(A).filter((t, n) => n !== 19).join(A);
|
|
161
|
+
function on(e, t, n) {
|
|
170
162
|
function o(f) {
|
|
171
|
-
const
|
|
172
|
-
y(n, f,
|
|
163
|
+
const p = e in te ? nn(t) : t;
|
|
164
|
+
y(n, f, c, z, c), y(n, `Message data: %c${p}`, c);
|
|
173
165
|
}
|
|
174
|
-
const { iframe: s, postMessageTarget:
|
|
166
|
+
const { iframe: s, postMessageTarget: a, sameOrigin: r, targetOrigin: l } = i[n];
|
|
175
167
|
if (r)
|
|
176
168
|
try {
|
|
177
|
-
s.contentWindow.iframeChildListener(
|
|
169
|
+
s.contentWindow.iframeChildListener(B + t), o(`Sending message to iframe %c${n}%c via same origin%c`);
|
|
178
170
|
return;
|
|
179
171
|
} catch {
|
|
180
|
-
e in
|
|
172
|
+
e in te ? (i[n].sameOrigin = !1, u(n, "New iframe does not support same origin")) : w(n, "Same origin messaging failed, falling back to postMessage");
|
|
181
173
|
}
|
|
182
174
|
o(
|
|
183
|
-
`Sending message to iframe: %c${n}%c targetOrigin: %c${
|
|
175
|
+
`Sending message to iframe: %c${n}%c targetOrigin: %c${l.join(", ")}`
|
|
184
176
|
);
|
|
185
|
-
for (const f of
|
|
186
|
-
|
|
177
|
+
for (const f of l)
|
|
178
|
+
a.postMessage(B + t, f);
|
|
187
179
|
}
|
|
188
|
-
function
|
|
180
|
+
function S(e, t, n) {
|
|
189
181
|
if (b(n, e), !i[n]?.postMessageTarget) {
|
|
190
|
-
|
|
182
|
+
w(n, "Iframe not found");
|
|
191
183
|
return;
|
|
192
184
|
}
|
|
193
|
-
|
|
185
|
+
on(e, t, n);
|
|
194
186
|
}
|
|
195
|
-
const
|
|
196
|
-
function
|
|
197
|
-
document.hidden !== !0 &&
|
|
187
|
+
const sn = (e, t) => Object.values(i).filter(({ autoResize: n, firstRun: o }) => n && !o).forEach(({ iframe: n }) => S(e, t, n.id));
|
|
188
|
+
function rn() {
|
|
189
|
+
document.hidden !== !0 && sn("tabVisible", ve);
|
|
198
190
|
}
|
|
199
|
-
function
|
|
191
|
+
function ln(e) {
|
|
200
192
|
if (e.boxSizing !== "border-box") return 0;
|
|
201
193
|
const t = e.paddingTop ? parseInt(e.paddingTop, 10) : 0, n = e.paddingBottom ? parseInt(e.paddingBottom, 10) : 0;
|
|
202
194
|
return t + n;
|
|
203
195
|
}
|
|
204
|
-
function
|
|
196
|
+
function an(e) {
|
|
205
197
|
if (e.boxSizing !== "border-box") return 0;
|
|
206
198
|
const t = e.borderTopWidth ? parseInt(e.borderTopWidth, 10) : 0, n = e.borderBottomWidth ? parseInt(e.borderBottomWidth, 10) : 0;
|
|
207
199
|
return t + n;
|
|
208
200
|
}
|
|
209
|
-
function
|
|
210
|
-
const t = e.slice(Z).split(":"), n = t[1] ? Number(t[1]) : 0, o = i[t[0]]?.iframe, s = getComputedStyle(o),
|
|
201
|
+
function cn(e) {
|
|
202
|
+
const t = e.slice(Z).split(":"), n = t[1] ? Number(t[1]) : 0, o = i[t[0]]?.iframe, s = o ? getComputedStyle(o) : null, a = s ? ln(s) + an(s) : 0, r = {
|
|
211
203
|
iframe: o,
|
|
212
204
|
id: t[0],
|
|
213
|
-
height: n +
|
|
205
|
+
height: n + a,
|
|
214
206
|
width: Number(t[2]),
|
|
215
207
|
type: t[3],
|
|
216
208
|
msg: t[4],
|
|
217
209
|
message: t[4]
|
|
218
210
|
};
|
|
219
|
-
return t[5] && (
|
|
211
|
+
return t[5] && (r.mode = t[5]), r;
|
|
220
212
|
}
|
|
221
|
-
const
|
|
222
|
-
function
|
|
223
|
-
const { id: t, msg: n, iframe: o } = e, s =
|
|
224
|
-
return s || (u(t, `Received: %c${n}`,
|
|
213
|
+
const un = { true: 1, false: 1, undefined: 1 };
|
|
214
|
+
function fn(e) {
|
|
215
|
+
const { id: t, msg: n, iframe: o } = e, s = St(o);
|
|
216
|
+
return s || (u(t, `Received: %c${n}`, c), w(t, "The target iframe was not found.")), s;
|
|
225
217
|
}
|
|
226
|
-
function
|
|
218
|
+
function pn(e, t) {
|
|
227
219
|
const { id: n } = e, { data: o, origin: s } = t;
|
|
228
220
|
if ("sameOrigin" in t && t.sameOrigin) return !0;
|
|
229
221
|
const r = i[n]?.checkOrigin;
|
|
230
|
-
function
|
|
222
|
+
function l() {
|
|
231
223
|
function f() {
|
|
232
224
|
u(
|
|
233
225
|
n,
|
|
234
226
|
`Checking connection is from allowed list of origins: %c${r}`,
|
|
235
|
-
|
|
227
|
+
c
|
|
236
228
|
);
|
|
237
|
-
for (const
|
|
238
|
-
if (
|
|
229
|
+
for (const h of r)
|
|
230
|
+
if (h === s)
|
|
239
231
|
return !0;
|
|
240
232
|
return !1;
|
|
241
233
|
}
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
return u(n, `Checking connection is from: %c${
|
|
234
|
+
function p() {
|
|
235
|
+
const h = i[n]?.remoteHost;
|
|
236
|
+
return u(n, `Checking connection is from: %c${h}`, c), s === h;
|
|
245
237
|
}
|
|
246
|
-
return r.constructor === Array ? f() :
|
|
238
|
+
return r.constructor === Array ? f() : p();
|
|
247
239
|
}
|
|
248
|
-
if (r && `${s}` != "null" && !
|
|
240
|
+
if (r && `${s}` != "null" && !l())
|
|
249
241
|
throw new Error(
|
|
250
242
|
`Unexpected message received from: ${s} for ${n}. Message was: ${o}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`
|
|
251
243
|
);
|
|
252
244
|
return !0;
|
|
253
245
|
}
|
|
254
|
-
const
|
|
255
|
-
function
|
|
256
|
-
const { id: t, type: n } = e, o = n in
|
|
246
|
+
const hn = (e) => B === `${e}`.slice(0, Z) && e.slice(Z).split(":")[0] in i;
|
|
247
|
+
function gn(e) {
|
|
248
|
+
const { id: t, type: n } = e, o = n in un;
|
|
257
249
|
return o && u(t, "Ignoring init message from meta parent page"), o;
|
|
258
250
|
}
|
|
259
|
-
function
|
|
251
|
+
function dn(e) {
|
|
260
252
|
try {
|
|
261
253
|
i[e].sameOrigin = !!i[e]?.iframe?.contentWindow?.iframeChildListener;
|
|
262
254
|
} catch {
|
|
263
255
|
i[e].sameOrigin = !1;
|
|
264
256
|
}
|
|
265
|
-
u(e, `sameOrigin: %c${i[e].sameOrigin}`,
|
|
257
|
+
u(e, `sameOrigin: %c${i[e].sameOrigin}`, c);
|
|
266
258
|
}
|
|
267
|
-
function
|
|
259
|
+
function yn(e, t) {
|
|
268
260
|
if (t !== _) {
|
|
269
261
|
if (t === void 0) {
|
|
270
262
|
m(
|
|
@@ -281,35 +273,35 @@ See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
|
|
|
281
273
|
u(
|
|
282
274
|
e,
|
|
283
275
|
`Version mismatch (Child: %c${t}%c !== Parent: %c${_})`,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
276
|
+
c,
|
|
277
|
+
z,
|
|
278
|
+
c
|
|
287
279
|
);
|
|
288
280
|
}
|
|
289
281
|
}
|
|
290
|
-
function
|
|
282
|
+
function k(e, t, n) {
|
|
291
283
|
if (!i[e]) return null;
|
|
292
284
|
const o = i[e][t];
|
|
293
|
-
if (typeof o !==
|
|
285
|
+
if (typeof o !== Et)
|
|
294
286
|
throw new TypeError(`${t} on iframe[${e}] is not a function`);
|
|
295
287
|
if (t !== "onBeforeClose" && t !== "onScroll")
|
|
296
|
-
return
|
|
288
|
+
return $t(o, n);
|
|
297
289
|
try {
|
|
298
290
|
return o(n);
|
|
299
291
|
} catch (s) {
|
|
300
|
-
return console.error(s),
|
|
292
|
+
return console.error(s), w(e, `Error in ${t} callback`), null;
|
|
301
293
|
}
|
|
302
294
|
}
|
|
303
|
-
function
|
|
295
|
+
function mn(e, t) {
|
|
304
296
|
const { id: n, iframe: o } = e;
|
|
305
297
|
u(
|
|
306
298
|
n,
|
|
307
299
|
`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
),
|
|
300
|
+
c,
|
|
301
|
+
z,
|
|
302
|
+
c,
|
|
303
|
+
z
|
|
304
|
+
), k(n, "onMessage", {
|
|
313
305
|
iframe: o,
|
|
314
306
|
message: JSON.parse(t)
|
|
315
307
|
});
|
|
@@ -317,159 +309,167 @@ function wn(e, t) {
|
|
|
317
309
|
function x(e, t) {
|
|
318
310
|
const { lastMessage: n } = i[e];
|
|
319
311
|
return n.slice(
|
|
320
|
-
n.indexOf(
|
|
312
|
+
n.indexOf(A) + Tt + t
|
|
321
313
|
);
|
|
322
314
|
}
|
|
323
|
-
function
|
|
324
|
-
const { id: n, iframe: o, height: s, type:
|
|
325
|
-
let
|
|
315
|
+
function ie(e, t) {
|
|
316
|
+
const { id: n, iframe: o, height: s, type: a, width: r } = t;
|
|
317
|
+
let l = { x: 0, y: 0 };
|
|
326
318
|
if (r === 0 && s === 0) {
|
|
327
|
-
const f = x(n, 9).split(
|
|
328
|
-
|
|
319
|
+
const f = x(n, 9).split(A);
|
|
320
|
+
l = {
|
|
329
321
|
x: f[1],
|
|
330
322
|
y: f[0]
|
|
331
323
|
};
|
|
332
324
|
} else
|
|
333
|
-
|
|
325
|
+
l = {
|
|
334
326
|
x: r,
|
|
335
327
|
y: s
|
|
336
328
|
};
|
|
337
|
-
|
|
329
|
+
k(n, e, {
|
|
338
330
|
iframe: o,
|
|
339
|
-
screenX: Number(
|
|
340
|
-
screenY: Number(
|
|
341
|
-
type:
|
|
331
|
+
screenX: Number(l.x),
|
|
332
|
+
screenY: Number(l.y),
|
|
333
|
+
type: a
|
|
342
334
|
});
|
|
343
335
|
}
|
|
344
|
-
const
|
|
336
|
+
const g = {
|
|
345
337
|
position: null,
|
|
346
338
|
version: _
|
|
347
339
|
};
|
|
348
|
-
function
|
|
349
|
-
|
|
340
|
+
function Le() {
|
|
341
|
+
g.position = null;
|
|
350
342
|
}
|
|
351
|
-
const
|
|
352
|
-
function
|
|
353
|
-
|
|
343
|
+
const bn = () => g.position;
|
|
344
|
+
function vn(e) {
|
|
345
|
+
g.position = e;
|
|
354
346
|
}
|
|
355
|
-
function
|
|
356
|
-
return
|
|
347
|
+
function Pe(e) {
|
|
348
|
+
return g.position === null && (g.position = {
|
|
357
349
|
x: window.scrollX,
|
|
358
350
|
y: window.scrollY
|
|
359
351
|
}), u(
|
|
360
352
|
e,
|
|
361
|
-
`Get page position: %c${
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
),
|
|
353
|
+
`Get page position: %c${g.position.x}%c, %c${g.position.y}`,
|
|
354
|
+
c,
|
|
355
|
+
z,
|
|
356
|
+
c
|
|
357
|
+
), g.position;
|
|
366
358
|
}
|
|
367
|
-
function
|
|
368
|
-
|
|
359
|
+
function Ne(e) {
|
|
360
|
+
g.position !== null && (window.scrollTo(g.position.x, g.position.y), y(
|
|
369
361
|
e,
|
|
370
|
-
`Set page position: %c${
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
),
|
|
362
|
+
`Set page position: %c${g.position.x}%c, %c${g.position.y}`,
|
|
363
|
+
c,
|
|
364
|
+
z,
|
|
365
|
+
c
|
|
366
|
+
), Le());
|
|
375
367
|
}
|
|
376
|
-
function
|
|
368
|
+
function se(e, t) {
|
|
377
369
|
const { id: n } = t, o = `${t[e]}px`;
|
|
378
|
-
i[n].iframe.style[e] = o, y(n, `Set ${e}: %c${o}`,
|
|
370
|
+
i[n].iframe.style[e] = o, y(n, `Set ${e}: %c${o}`, c);
|
|
379
371
|
}
|
|
380
|
-
function
|
|
372
|
+
function Ce(e) {
|
|
381
373
|
const { id: t } = e, { sizeHeight: n, sizeWidth: o } = i[t];
|
|
382
|
-
n &&
|
|
374
|
+
n && se(dt, e), o && se(yt, e);
|
|
383
375
|
}
|
|
384
|
-
function
|
|
376
|
+
function re(e) {
|
|
385
377
|
const { id: t } = e;
|
|
386
|
-
|
|
378
|
+
Ce(e), Ne(t), k(t, "onResized", e);
|
|
387
379
|
}
|
|
388
|
-
function
|
|
380
|
+
function xe(e) {
|
|
389
381
|
const { id: t } = e;
|
|
390
382
|
u(t, "Disconnected from iframe"), delete i[t], delete e.iframeResizer;
|
|
391
383
|
}
|
|
392
|
-
function
|
|
384
|
+
function _e(e) {
|
|
393
385
|
const { id: t } = e;
|
|
394
|
-
if (
|
|
386
|
+
if (k(t, "onBeforeClose", t) === !1) {
|
|
395
387
|
u(t, "Close iframe cancelled by onBeforeClose");
|
|
396
388
|
return;
|
|
397
389
|
}
|
|
398
|
-
u(t, `Removing
|
|
390
|
+
u(t, `Removing iframe: %c${t}`, c);
|
|
399
391
|
try {
|
|
400
392
|
e.parentNode && e.remove();
|
|
401
393
|
} catch (n) {
|
|
402
|
-
|
|
394
|
+
w(t, n);
|
|
403
395
|
}
|
|
404
|
-
|
|
396
|
+
k(t, "onAfterClose", t), xe(e);
|
|
405
397
|
}
|
|
406
398
|
function Be(e) {
|
|
407
399
|
const { id: t, type: n } = e;
|
|
408
400
|
u(
|
|
409
401
|
t,
|
|
410
|
-
`Size reset requested by ${n ===
|
|
411
|
-
),
|
|
402
|
+
`Size reset requested by ${n === $ ? "parent page" : "child page"}`
|
|
403
|
+
), Pe(t), Ce(e), S(V, V, t);
|
|
412
404
|
}
|
|
413
|
-
const
|
|
405
|
+
const Fe = (e, t) => {
|
|
414
406
|
const n = {};
|
|
415
407
|
return (o, s) => {
|
|
416
|
-
const { iframe:
|
|
417
|
-
function r(f,
|
|
418
|
-
n[
|
|
419
|
-
n[
|
|
408
|
+
const { iframe: a } = i[s];
|
|
409
|
+
function r(f, p) {
|
|
410
|
+
n[p] || (f(), n[p] = requestAnimationFrame(() => {
|
|
411
|
+
n[p] = null;
|
|
420
412
|
}));
|
|
421
413
|
}
|
|
422
|
-
function
|
|
423
|
-
|
|
414
|
+
function l() {
|
|
415
|
+
S(`${o} (${e})`, `${e}:${t(a)}`, s);
|
|
424
416
|
}
|
|
425
|
-
r(
|
|
417
|
+
r(l, s);
|
|
426
418
|
};
|
|
427
|
-
},
|
|
419
|
+
}, He = (e) => (t) => {
|
|
428
420
|
e in i[t] && (i[t][e](), delete i[t][e]);
|
|
429
|
-
},
|
|
421
|
+
}, We = (
|
|
430
422
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
431
423
|
((e, t) => (n) => {
|
|
432
424
|
let o = !1;
|
|
433
425
|
const s = (d) => () => {
|
|
434
426
|
i[n] ? (!o || o === d) && (e(d, n), o = d, requestAnimationFrame(() => {
|
|
435
427
|
o = !1;
|
|
436
|
-
})) :
|
|
437
|
-
},
|
|
438
|
-
function
|
|
439
|
-
u(n, `${d}listeners for send${t}`), E(window,
|
|
428
|
+
})) : h();
|
|
429
|
+
}, a = s(ee), r = s("resize window"), l = new ResizeObserver(s("pageObserver")), f = new ResizeObserver(s("iframeObserver"));
|
|
430
|
+
function p(d, E) {
|
|
431
|
+
u(n, `${d}listeners for send${t}`), E(window, ee, a), E(window, ve, r);
|
|
440
432
|
}
|
|
441
|
-
function
|
|
442
|
-
b(n, `stop${t}`),
|
|
433
|
+
function h() {
|
|
434
|
+
b(n, `stop${t}`), p("Remove ", oe), l.disconnect(), f.disconnect(), i[n] && oe(i[n].iframe, G, h);
|
|
443
435
|
}
|
|
444
|
-
function
|
|
445
|
-
|
|
436
|
+
function j() {
|
|
437
|
+
p("Add ", N), l.observe(document.body), f.observe(i[n].iframe);
|
|
446
438
|
}
|
|
447
|
-
i[n] && (i[n][`stop${t}`] =
|
|
439
|
+
i[n] && (i[n][`stop${t}`] = h, N(i[n].iframe, G, h), j());
|
|
448
440
|
})
|
|
449
441
|
);
|
|
450
|
-
function
|
|
451
|
-
const t = document.body.getBoundingClientRect(), n = e.getBoundingClientRect(), { scrollY: o, scrollX: s, innerHeight:
|
|
442
|
+
function zn(e) {
|
|
443
|
+
const t = document.body.getBoundingClientRect(), n = e.getBoundingClientRect(), { scrollY: o, scrollX: s, innerHeight: a, innerWidth: r } = window, { clientHeight: l, clientWidth: f } = document.documentElement;
|
|
452
444
|
return JSON.stringify({
|
|
453
445
|
iframeHeight: n.height,
|
|
454
446
|
iframeWidth: n.width,
|
|
455
|
-
clientHeight: Math.max(
|
|
447
|
+
clientHeight: Math.max(l, a || 0),
|
|
456
448
|
clientWidth: Math.max(f, r || 0),
|
|
457
449
|
offsetTop: Math.trunc(n.top - t.top),
|
|
458
450
|
offsetLeft: Math.trunc(n.left - t.left),
|
|
459
451
|
scrollTop: o,
|
|
460
452
|
scrollLeft: s,
|
|
461
|
-
documentHeight:
|
|
453
|
+
documentHeight: l,
|
|
462
454
|
documentWidth: f,
|
|
463
|
-
windowHeight:
|
|
455
|
+
windowHeight: a,
|
|
464
456
|
windowWidth: r
|
|
465
457
|
});
|
|
466
458
|
}
|
|
467
|
-
const
|
|
468
|
-
|
|
459
|
+
const wn = Fe(me, zn), En = We(
|
|
460
|
+
wn,
|
|
469
461
|
"PageInfo"
|
|
470
|
-
),
|
|
471
|
-
function
|
|
472
|
-
const { scrollWidth: t, scrollHeight: n } = document.documentElement,
|
|
462
|
+
), On = He("stopPageInfo");
|
|
463
|
+
function kn(e) {
|
|
464
|
+
const { scrollWidth: t, scrollHeight: n } = document.documentElement, o = typeof window < "u" && window.visualViewport ? window.visualViewport : {}, {
|
|
465
|
+
width: s = 0,
|
|
466
|
+
height: a = 0,
|
|
467
|
+
offsetLeft: r = 0,
|
|
468
|
+
offsetTop: l = 0,
|
|
469
|
+
pageLeft: f = 0,
|
|
470
|
+
pageTop: p = 0,
|
|
471
|
+
scale: h = 1
|
|
472
|
+
} = o;
|
|
473
473
|
return JSON.stringify({
|
|
474
474
|
iframe: e.getBoundingClientRect(),
|
|
475
475
|
document: {
|
|
@@ -477,73 +477,73 @@ function $n(e) {
|
|
|
477
477
|
scrollHeight: n
|
|
478
478
|
},
|
|
479
479
|
viewport: {
|
|
480
|
-
width:
|
|
481
|
-
height:
|
|
482
|
-
offsetLeft:
|
|
483
|
-
offsetTop:
|
|
484
|
-
pageLeft:
|
|
485
|
-
pageTop:
|
|
480
|
+
width: s,
|
|
481
|
+
height: a,
|
|
482
|
+
offsetLeft: r,
|
|
483
|
+
offsetTop: l,
|
|
484
|
+
pageLeft: f,
|
|
485
|
+
pageTop: p,
|
|
486
486
|
scale: h
|
|
487
487
|
}
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
|
-
const
|
|
491
|
-
|
|
490
|
+
const Tn = Fe(be, kn), jn = We(
|
|
491
|
+
Tn,
|
|
492
492
|
"ParentInfo"
|
|
493
|
-
),
|
|
494
|
-
function
|
|
495
|
-
const t = e.getBoundingClientRect(), n =
|
|
493
|
+
), In = He("stopParentInfo");
|
|
494
|
+
function De(e) {
|
|
495
|
+
const t = e.getBoundingClientRect(), n = Pe(e.id);
|
|
496
496
|
return {
|
|
497
497
|
x: Number(t.left) + Number(n.x),
|
|
498
498
|
y: Number(t.top) + Number(n.y)
|
|
499
499
|
};
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
const { x: t, y: n } =
|
|
503
|
-
if (
|
|
504
|
-
|
|
501
|
+
function Ge(e) {
|
|
502
|
+
const { x: t, y: n } = bn(), o = i[e]?.iframe;
|
|
503
|
+
if (k(e, "onScroll", { iframe: o, top: n, left: t, x: t, y: n }) === !1) {
|
|
504
|
+
Le();
|
|
505
505
|
return;
|
|
506
506
|
}
|
|
507
|
-
|
|
507
|
+
Ne(e);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Mn(e) {
|
|
510
510
|
const { id: t, height: n, width: o } = e, s = window.parentIframe || window.parentIFrame || window;
|
|
511
511
|
y(
|
|
512
512
|
t,
|
|
513
513
|
`scrollBy: x: %c${o}%c y: %c${n}`,
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
514
|
+
c,
|
|
515
|
+
z,
|
|
516
|
+
c
|
|
517
517
|
), s.scrollBy(o, n);
|
|
518
518
|
}
|
|
519
519
|
const Ve = (e) => (t) => {
|
|
520
|
-
const { id: n, iframe: o, height: s, width:
|
|
520
|
+
const { id: n, iframe: o, height: s, width: a } = t;
|
|
521
521
|
function r(d) {
|
|
522
|
-
|
|
522
|
+
vn(d), Ge(n);
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function l(d, E) {
|
|
525
525
|
d[`scrollTo${e ? "Offset" : ""}`](
|
|
526
526
|
E.x,
|
|
527
527
|
E.y
|
|
528
528
|
);
|
|
529
529
|
}
|
|
530
530
|
const f = (d) => ({
|
|
531
|
-
x:
|
|
531
|
+
x: a + d.x,
|
|
532
532
|
y: s + d.y
|
|
533
|
-
}),
|
|
533
|
+
}), p = e ? De(o) : { x: 0, y: 0 }, h = f(p), j = window.parentIframe || window.parentIFrame;
|
|
534
534
|
y(
|
|
535
535
|
n,
|
|
536
|
-
`Reposition requested (offset x:%c${
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
),
|
|
541
|
-
},
|
|
542
|
-
function
|
|
543
|
-
const { x: o, y: s } =
|
|
544
|
-
y(e, `Moving to in page link: %c#${t}`,
|
|
545
|
-
}
|
|
546
|
-
function
|
|
536
|
+
`Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,
|
|
537
|
+
c,
|
|
538
|
+
z,
|
|
539
|
+
c
|
|
540
|
+
), j ? l(j, h) : r(h);
|
|
541
|
+
}, Sn = Ve(!1), $n = Ve(!0);
|
|
542
|
+
function Rn(e, t, n) {
|
|
543
|
+
const { x: o, y: s } = De(n);
|
|
544
|
+
y(e, `Moving to in page link: %c#${t}`, c), g.position = { x: o, y: s }, Ge(e), window.location.hash = t;
|
|
545
|
+
}
|
|
546
|
+
function An(e, t) {
|
|
547
547
|
const n = window.parentIframe || window.parentIFrame;
|
|
548
548
|
if (!n) {
|
|
549
549
|
u(e, `In page link #${t} not found`);
|
|
@@ -551,26 +551,26 @@ function Nn(e, t) {
|
|
|
551
551
|
}
|
|
552
552
|
n.moveToAnchor(t);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Ln(e, t) {
|
|
555
555
|
const n = t.split("#")[1] || "", o = decodeURIComponent(n), s = document.getElementById(o) || document.getElementsByName(o)[0];
|
|
556
556
|
if (s) {
|
|
557
|
-
|
|
557
|
+
Rn(e, n, s);
|
|
558
558
|
return;
|
|
559
559
|
}
|
|
560
560
|
if (window.top === window.self) {
|
|
561
561
|
u(e, `In page link #${n} not found`);
|
|
562
562
|
return;
|
|
563
563
|
}
|
|
564
|
-
|
|
564
|
+
An(e, n);
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function Pn(e) {
|
|
567
567
|
const t = i[e]?.iframe?.title;
|
|
568
568
|
return t === "" || t === void 0;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
571
|
-
i[e]?.syncTitle && (i[e].iframe.title = t, y(e, `Set iframe title attribute: %c${t}`,
|
|
570
|
+
function Nn(e, t) {
|
|
571
|
+
i[e]?.syncTitle && (i[e].iframe.title = t, y(e, `Set iframe title attribute: %c${t}`, c));
|
|
572
572
|
}
|
|
573
|
-
const
|
|
573
|
+
const H = (e) => {
|
|
574
574
|
if (!e) return "";
|
|
575
575
|
let t = -559038744, n = 1103547984;
|
|
576
576
|
for (let o, s = 0; s < e.length; s++)
|
|
@@ -581,25 +581,23 @@ const W = (e) => {
|
|
|
581
581
|
(t) => String.fromCodePoint(
|
|
582
582
|
(t <= "Z" ? 90 : 122) >= (t = t.codePointAt(0) + 19) ? t : t - 26
|
|
583
583
|
)
|
|
584
|
-
),
|
|
585
|
-
e[0],
|
|
586
|
-
...e.slice(1).map((t) => `${t} - lewpylk`),
|
|
587
|
-
`${e[4]} - lewpylk`,
|
|
588
|
-
...e.slice(1)
|
|
589
|
-
], R = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], Wn = [
|
|
584
|
+
), Cn = /* @__PURE__ */ new Date(), Ue = (e) => new Set(Array.from({ length: 9 }, e)), le = " - lewpylk", R = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], xn = [
|
|
590
585
|
"<yi>Puchspk Spjluzl Rlf</><iy><iy>",
|
|
591
586
|
"<yi>Tpzzpun Spjluzl Rlf</><iy><iy>",
|
|
592
|
-
"Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3
|
|
587
|
+
"Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>. Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>",
|
|
593
588
|
"<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.",
|
|
594
589
|
"<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.",
|
|
595
590
|
"Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.",
|
|
596
|
-
"<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>
|
|
597
|
-
|
|
598
|
-
"<yi>
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
591
|
+
"<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> fvb jhu bzl aol <i>mpyza 11 johyhjalyz vm fvb spjluzl rlf</> av nla h 60% kpzjvbua ha oaawz://pmyhtl-ylzpgly.jvt/wypjpun.",
|
|
592
|
+
"<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.<iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.",
|
|
593
|
+
"<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.",
|
|
594
|
+
"<yi>Bzl dpao slnhjf jspluaz</><iy><iy>Dolu bzpun <p>pmyhtl-ylzpgly</> jopsk whjrhnl dpao hu vskly clyzpvu vm aol whylua, fvb jhu zla aol spjluzl rlf pu aol pmyhtl. Mvy klahpsz vu ovd av zla aopz bw, wslhzl zll aol kvjbtluahapvu ha:<iy><iy>oaawz://pmyhtl-ylzpgly.jvt/zlabw/jopsk/#spjluzl"
|
|
595
|
+
], _n = (e) => [
|
|
596
|
+
e[0],
|
|
597
|
+
...e.slice(1).map((t) => `${t}${le}`),
|
|
598
|
+
`${e[4]}${le}`,
|
|
599
|
+
...e.slice(1)
|
|
600
|
+
], Bn = _n(["NWSc3", "zvsv", "wyv", "ibzpulzz", "VLT"]), ae = Object.fromEntries(
|
|
603
601
|
[
|
|
604
602
|
"2cgs7fdf4xb",
|
|
605
603
|
"1c9ctcccr4z",
|
|
@@ -613,114 +611,114 @@ const W = (e) => {
|
|
|
613
611
|
"oclbb4thgl",
|
|
614
612
|
"igb1wzrjqr"
|
|
615
613
|
].map((e, t) => [e, Math.max(0, t - 1)])
|
|
616
|
-
),
|
|
614
|
+
), qe = Cn[v(R[4])](), Fn = Ue((e, t) => H(`${qe + t}`)), Hn = Ue((e, t) => H(`${qe - ++t}`)), Wn = (e) => Fn.has(e) ? 9 : Hn.has(e) ? 5 : -2, O = (e) => v(xn[e]), Dn = (e) => v(Bn[e]), Gn = (e) => {
|
|
617
615
|
const t = e[v(R[0])] || e[v(R[1])] || e[v(R[2])] || e[v(R[3])];
|
|
618
616
|
if (!t) return -1;
|
|
619
617
|
const n = t.split("-");
|
|
620
|
-
let o = (function(s = "",
|
|
618
|
+
let o = (function(s = "", a = "") {
|
|
621
619
|
let r = -2;
|
|
622
|
-
const
|
|
623
|
-
return
|
|
620
|
+
const l = H(v(s));
|
|
621
|
+
return l in ae && (r = ae[l]), r === 9 ? Wn(a) : r;
|
|
624
622
|
})(...n);
|
|
625
|
-
return o === 0 || ((s) => s[2] ===
|
|
623
|
+
return o === 0 || ((s) => s[2] === H(s[0] + s[1]))(n) || (o = -2), o;
|
|
626
624
|
};
|
|
627
|
-
let J = !1,
|
|
628
|
-
function
|
|
625
|
+
let J = !1, Ze = !1;
|
|
626
|
+
function Je(e, t = -3) {
|
|
629
627
|
if (J) return;
|
|
630
628
|
const n = Math.max(i[e].mode, t);
|
|
631
629
|
if (n > i[e].mode && (i[e].mode = n), n < 0)
|
|
632
630
|
throw Zt(e), i[e].vAdvised || m(e || "Parent", `${O(n + 2)}${O(2)}`), i[e].vAdvised = !0, O(n + 2).replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
|
|
633
|
-
switch (n > 5 &&
|
|
631
|
+
switch (n > 5 && Ze || Yt(`v${_} (${Dn(n)})`, n), n) {
|
|
634
632
|
case 1:
|
|
635
633
|
case 2:
|
|
636
634
|
case 3:
|
|
637
|
-
m(
|
|
635
|
+
m("Parent", O(6));
|
|
638
636
|
break;
|
|
639
637
|
case 4:
|
|
640
|
-
m(
|
|
638
|
+
m("Parent", O(7));
|
|
641
639
|
break;
|
|
642
640
|
case 5:
|
|
643
|
-
m(
|
|
641
|
+
m("Parent", O(8));
|
|
644
642
|
break;
|
|
645
643
|
default:
|
|
646
644
|
n < 1 && m("Parent", O(3));
|
|
647
645
|
}
|
|
648
646
|
J = !0;
|
|
649
647
|
}
|
|
650
|
-
function
|
|
648
|
+
function Vn(e) {
|
|
651
649
|
if (J) return;
|
|
652
650
|
const { mode: t } = i[e];
|
|
653
|
-
t > 5 &&
|
|
651
|
+
t > 5 && Je(e, t);
|
|
654
652
|
}
|
|
655
|
-
function
|
|
656
|
-
e?.log === -1 && (e.log = !1,
|
|
653
|
+
function Un(e) {
|
|
654
|
+
e?.log === -1 && (e.log = !1, Ze = !0);
|
|
657
655
|
}
|
|
658
|
-
function
|
|
659
|
-
i[e] && (u(e, `First run for ${e}`),
|
|
656
|
+
function qn(e, t) {
|
|
657
|
+
i[e] && (u(e, `First run for ${e}`), Je(e, t === void 0 ? void 0 : Number(t)), i[e].firstRun = !1);
|
|
660
658
|
}
|
|
661
|
-
function
|
|
662
|
-
const { height: t, id: n, iframe: o, mode: s, message:
|
|
663
|
-
switch (i[n]?.firstRun &&
|
|
659
|
+
function Zn(e) {
|
|
660
|
+
const { height: t, id: n, iframe: o, mode: s, message: a, type: r, width: l } = e, { lastMessage: f } = i[n];
|
|
661
|
+
switch (i[n]?.firstRun && qn(n, s), u(n, `Received: %c${f}`, c), r) {
|
|
664
662
|
case ge:
|
|
665
663
|
i[n].autoResize = JSON.parse(x(n, 9));
|
|
666
664
|
break;
|
|
667
|
-
case
|
|
665
|
+
case ot:
|
|
668
666
|
y(n, "Ready state reset"), i[n].initialised = !1;
|
|
669
667
|
break;
|
|
668
|
+
case it:
|
|
669
|
+
_e(o);
|
|
670
|
+
break;
|
|
670
671
|
case st:
|
|
671
|
-
|
|
672
|
+
Ln(n, x(n, 9));
|
|
672
673
|
break;
|
|
673
|
-
case
|
|
674
|
-
|
|
674
|
+
case $:
|
|
675
|
+
re(e), dn(n), yn(n, a), i[n].initialised = !0, k(n, "onReady", o);
|
|
675
676
|
break;
|
|
676
|
-
case
|
|
677
|
-
|
|
677
|
+
case L:
|
|
678
|
+
mn(e, x(n, 6));
|
|
678
679
|
break;
|
|
679
|
-
case
|
|
680
|
-
|
|
680
|
+
case lt:
|
|
681
|
+
ie("onMouseEnter", e);
|
|
681
682
|
break;
|
|
682
683
|
case at:
|
|
683
|
-
|
|
684
|
+
ie("onMouseLeave", e);
|
|
684
685
|
break;
|
|
685
|
-
case
|
|
686
|
-
|
|
687
|
-
break;
|
|
688
|
-
case ye:
|
|
689
|
-
In(n);
|
|
686
|
+
case me:
|
|
687
|
+
En(n);
|
|
690
688
|
break;
|
|
691
689
|
case be:
|
|
692
|
-
|
|
690
|
+
jn(n);
|
|
693
691
|
break;
|
|
694
|
-
case
|
|
695
|
-
|
|
692
|
+
case ct:
|
|
693
|
+
On(n);
|
|
696
694
|
break;
|
|
697
|
-
case
|
|
698
|
-
|
|
695
|
+
case ut:
|
|
696
|
+
In(n);
|
|
699
697
|
break;
|
|
700
|
-
case
|
|
698
|
+
case V:
|
|
701
699
|
Be(e);
|
|
702
700
|
break;
|
|
703
|
-
case
|
|
704
|
-
|
|
701
|
+
case ft:
|
|
702
|
+
Mn(e);
|
|
705
703
|
break;
|
|
706
704
|
case pt:
|
|
707
|
-
|
|
705
|
+
Sn(e);
|
|
708
706
|
break;
|
|
709
|
-
case
|
|
710
|
-
|
|
707
|
+
case ht:
|
|
708
|
+
$n(e);
|
|
711
709
|
break;
|
|
712
|
-
case
|
|
713
|
-
|
|
710
|
+
case gt:
|
|
711
|
+
Nn(n, a);
|
|
714
712
|
break;
|
|
715
713
|
default:
|
|
716
|
-
if (
|
|
717
|
-
|
|
714
|
+
if (l === 0 && t === 0) {
|
|
715
|
+
w(
|
|
718
716
|
n,
|
|
719
717
|
`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`
|
|
720
718
|
);
|
|
721
719
|
return;
|
|
722
720
|
}
|
|
723
|
-
if (
|
|
721
|
+
if (l === 0 || t === 0) {
|
|
724
722
|
u(n, "Ignoring message with 0 height or width");
|
|
725
723
|
return;
|
|
726
724
|
}
|
|
@@ -728,42 +726,42 @@ function Xn(e) {
|
|
|
728
726
|
u(n, "Page hidden - ignored resize request");
|
|
729
727
|
return;
|
|
730
728
|
}
|
|
731
|
-
|
|
729
|
+
re(e);
|
|
732
730
|
}
|
|
733
731
|
}
|
|
734
|
-
const
|
|
732
|
+
const Jn = (e) => ({
|
|
735
733
|
initChild: t,
|
|
736
734
|
postMessageTarget: n
|
|
737
735
|
}) => {
|
|
738
736
|
e === n && t();
|
|
739
|
-
},
|
|
740
|
-
function
|
|
737
|
+
}, Yn = (e) => Object.values(i).forEach(Jn(e));
|
|
738
|
+
function ce(e) {
|
|
741
739
|
const t = e.data;
|
|
742
|
-
if (t ===
|
|
743
|
-
|
|
740
|
+
if (t === nt) {
|
|
741
|
+
Yn(e.source);
|
|
744
742
|
return;
|
|
745
743
|
}
|
|
746
|
-
if (!
|
|
747
|
-
if (typeof t !==
|
|
748
|
-
b(
|
|
744
|
+
if (!hn(t)) {
|
|
745
|
+
if (typeof t !== Y) return;
|
|
746
|
+
b(U, "ignoredMessage"), Ut(U, t);
|
|
749
747
|
return;
|
|
750
748
|
}
|
|
751
|
-
const n =
|
|
749
|
+
const n = cn(t), { id: o, type: s } = n;
|
|
752
750
|
switch (b(o, s), !0) {
|
|
753
751
|
case !i[o]:
|
|
754
752
|
throw new Error(`${s} No settings for ${o}. Message was: ${t}`);
|
|
755
|
-
case !
|
|
756
|
-
case
|
|
757
|
-
case !
|
|
753
|
+
case !fn(n):
|
|
754
|
+
case gn(n):
|
|
755
|
+
case !pn(n, e):
|
|
758
756
|
return;
|
|
759
757
|
default:
|
|
760
|
-
i[o].lastMessage = e.data, Ae(o,
|
|
758
|
+
i[o].lastMessage = e.data, Ae(o, Zn)(n);
|
|
761
759
|
}
|
|
762
760
|
}
|
|
763
|
-
const
|
|
764
|
-
N(window,
|
|
761
|
+
const Xn = Rt(() => {
|
|
762
|
+
N(window, L, ce), N(document, "visibilitychange", rn), window.iframeParentListener = (e) => setTimeout(() => ce({ data: e, sameOrigin: !0 }));
|
|
765
763
|
}), ue = {};
|
|
766
|
-
function
|
|
764
|
+
function Kn(e) {
|
|
767
765
|
if (ue[e] === !0) return !1;
|
|
768
766
|
const t = document.querySelectorAll(`iframe#${CSS.escape(e)}`);
|
|
769
767
|
if (t.length <= 1) return !0;
|
|
@@ -784,151 +782,140 @@ Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,
|
|
|
784
782
|
C
|
|
785
783
|
), !1;
|
|
786
784
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${$e}`, oo = `<rb>Deprecated Method</>
|
|
790
|
-
|
|
791
|
-
Use of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As there are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code.`;
|
|
792
|
-
function io(e) {
|
|
785
|
+
function Qn(e) {
|
|
793
786
|
if (i[e]) {
|
|
794
|
-
const { iframe: t } = i[e]
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
787
|
+
const { iframe: t } = i[e];
|
|
788
|
+
t.iframeResizer = {
|
|
789
|
+
close: _e.bind(null, t),
|
|
790
|
+
disconnect: xe.bind(null, t),
|
|
791
|
+
moveToAnchor(n) {
|
|
792
|
+
Ct(n, Y, "moveToAnchor(anchor) anchor"), S("Move to anchor", `moveToAnchor:${n}`, e);
|
|
799
793
|
},
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
},
|
|
803
|
-
resize() {
|
|
804
|
-
m(e, oo), T("Window resize", Y, e);
|
|
805
|
-
},
|
|
806
|
-
sendMessage(o) {
|
|
807
|
-
o = JSON.stringify(o), T(A, `${A}:${o}`, e);
|
|
794
|
+
sendMessage(n) {
|
|
795
|
+
n = JSON.stringify(n), S(L, `${L}:${n}`, e);
|
|
808
796
|
}
|
|
809
797
|
};
|
|
810
|
-
t.iframeResizer = n, t.iFrameResizer = n;
|
|
811
798
|
}
|
|
812
799
|
}
|
|
813
|
-
const
|
|
814
|
-
function
|
|
800
|
+
const eo = "8", to = "32", no = zt, oo = !0;
|
|
801
|
+
function io(e) {
|
|
815
802
|
const {
|
|
816
803
|
autoResize: t,
|
|
817
804
|
bodyBackground: n,
|
|
818
805
|
bodyMargin: o,
|
|
819
806
|
bodyPadding: s,
|
|
820
|
-
heightCalculationMethod:
|
|
807
|
+
heightCalculationMethod: a,
|
|
821
808
|
inPageLinks: r,
|
|
822
|
-
license:
|
|
809
|
+
license: l,
|
|
823
810
|
log: f,
|
|
824
|
-
logExpand:
|
|
825
|
-
mouseEvents:
|
|
826
|
-
offsetHeight:
|
|
811
|
+
logExpand: p,
|
|
812
|
+
mouseEvents: h,
|
|
813
|
+
offsetHeight: j,
|
|
827
814
|
offsetWidth: d,
|
|
828
815
|
mode: E,
|
|
829
|
-
sizeHeight:
|
|
816
|
+
sizeHeight: Ye,
|
|
830
817
|
// sizeSelector,
|
|
831
|
-
sizeWidth:
|
|
832
|
-
tolerance:
|
|
833
|
-
widthCalculationMethod:
|
|
818
|
+
sizeWidth: Xe,
|
|
819
|
+
tolerance: Ke,
|
|
820
|
+
widthCalculationMethod: Qe
|
|
834
821
|
} = i[e];
|
|
835
822
|
return [
|
|
836
823
|
e,
|
|
837
|
-
|
|
838
|
-
|
|
824
|
+
eo,
|
|
825
|
+
Xe,
|
|
839
826
|
f,
|
|
840
|
-
|
|
841
|
-
|
|
827
|
+
to,
|
|
828
|
+
oo,
|
|
842
829
|
t,
|
|
843
830
|
o,
|
|
844
|
-
|
|
831
|
+
a,
|
|
845
832
|
n,
|
|
846
833
|
s,
|
|
847
|
-
|
|
834
|
+
Ke,
|
|
848
835
|
r,
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
836
|
+
no,
|
|
837
|
+
Qe,
|
|
838
|
+
h,
|
|
839
|
+
j,
|
|
853
840
|
d,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
841
|
+
Ye,
|
|
842
|
+
l,
|
|
843
|
+
g.version,
|
|
857
844
|
E,
|
|
858
845
|
"",
|
|
859
846
|
// sizeSelector,
|
|
860
|
-
|
|
861
|
-
].join(
|
|
847
|
+
p
|
|
848
|
+
].join(A);
|
|
862
849
|
}
|
|
863
|
-
const
|
|
864
|
-
function
|
|
850
|
+
const so = "0";
|
|
851
|
+
function ro(e) {
|
|
865
852
|
const { bodyMargin: t } = i[e];
|
|
866
|
-
(typeof t ===
|
|
853
|
+
(typeof t === wt || t === so) && (i[e].bodyMargin = `${t}px`);
|
|
867
854
|
}
|
|
868
|
-
const
|
|
855
|
+
const lo = (e) => {
|
|
869
856
|
try {
|
|
870
857
|
return new URL(e).origin;
|
|
871
858
|
} catch {
|
|
872
859
|
return null;
|
|
873
860
|
}
|
|
874
|
-
},
|
|
875
|
-
function
|
|
861
|
+
}, ao = (e) => typeof e === ze && e.length > 0 && !(e.contains("allow-scripts") && e.contains("allow-same-origin"));
|
|
862
|
+
function co(e, t) {
|
|
876
863
|
const {
|
|
877
864
|
checkOrigin: n,
|
|
878
865
|
iframe: { src: o, sandbox: s },
|
|
879
|
-
initialisedFirstPage:
|
|
866
|
+
initialisedFirstPage: a,
|
|
880
867
|
waitForLoad: r
|
|
881
|
-
} = t[e],
|
|
868
|
+
} = t[e], l = lo(o);
|
|
882
869
|
b(e, "noResponse"), m(
|
|
883
870
|
e,
|
|
884
871
|
`<rb>No response from iframe</>
|
|
885
872
|
|
|
886
873
|
The iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout / 1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.
|
|
887
|
-
${n &&
|
|
888
|
-
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${
|
|
889
|
-
` : ""}${r && !
|
|
874
|
+
${n && l ? `
|
|
875
|
+
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${l}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.
|
|
876
|
+
` : ""}${r && !a ? `
|
|
890
877
|
The <b>waitForLoad</> option is currently set to <bb>true</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <bb>false</>.
|
|
891
|
-
` : ""}${
|
|
878
|
+
` : ""}${ao(s) ? `
|
|
892
879
|
The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
|
|
893
880
|
` : ""}
|
|
894
881
|
This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.
|
|
895
882
|
`
|
|
896
883
|
);
|
|
897
884
|
}
|
|
898
|
-
function
|
|
885
|
+
function uo(e, t) {
|
|
899
886
|
function n() {
|
|
900
887
|
if (t[e] === void 0) return;
|
|
901
|
-
const { initialised:
|
|
902
|
-
if (t[e].msgTimeout = void 0,
|
|
888
|
+
const { initialised: a, loadErrorShown: r } = t[e];
|
|
889
|
+
if (t[e].msgTimeout = void 0, a) {
|
|
903
890
|
t[e].initialisedFirstPage = !0;
|
|
904
891
|
return;
|
|
905
892
|
}
|
|
906
|
-
r || (t[e].loadErrorShown = !0,
|
|
893
|
+
r || (t[e].loadErrorShown = !0, co(e, t));
|
|
907
894
|
}
|
|
908
895
|
const { msgTimeout: o, warningTimeout: s } = t[e];
|
|
909
896
|
s && (o && clearTimeout(o), t[e].msgTimeout = setTimeout(n, s));
|
|
910
897
|
}
|
|
911
|
-
const
|
|
912
|
-
function
|
|
913
|
-
i[e]?.heightCalculationMethod in
|
|
898
|
+
const fo = 1, po = (e) => e.loading === rt, ho = (e) => e === $;
|
|
899
|
+
function go(e) {
|
|
900
|
+
i[e]?.heightCalculationMethod in jt && Be({
|
|
914
901
|
id: e,
|
|
915
902
|
iframe: i[e].iframe,
|
|
916
|
-
height:
|
|
917
|
-
width:
|
|
918
|
-
type:
|
|
903
|
+
height: Q,
|
|
904
|
+
width: Q,
|
|
905
|
+
type: $
|
|
919
906
|
});
|
|
920
907
|
}
|
|
921
|
-
function
|
|
922
|
-
N(e, G, () => setTimeout(t,
|
|
908
|
+
function yo(e, t) {
|
|
909
|
+
N(e, G, () => setTimeout(t, fo));
|
|
923
910
|
}
|
|
924
|
-
const
|
|
911
|
+
const mo = (e) => {
|
|
925
912
|
const { src: t, srcdoc: n } = e;
|
|
926
913
|
return !n && (t == null || t === "" || t === "about:blank");
|
|
927
914
|
};
|
|
928
|
-
function
|
|
915
|
+
function bo(e, t) {
|
|
929
916
|
const { iframe: n, waitForLoad: o } = i[e];
|
|
930
917
|
if (o !== !0) {
|
|
931
|
-
if (
|
|
918
|
+
if (mo(n)) {
|
|
932
919
|
setTimeout(() => {
|
|
933
920
|
b(e, "noContent"), y(e, "No content detected in the iframe, delaying initialisation");
|
|
934
921
|
});
|
|
@@ -937,34 +924,34 @@ function Oo(e, t) {
|
|
|
937
924
|
setTimeout(t);
|
|
938
925
|
}
|
|
939
926
|
}
|
|
940
|
-
function
|
|
927
|
+
function vo(e, t) {
|
|
941
928
|
const n = (s) => () => {
|
|
942
929
|
if (!i[e]) return;
|
|
943
|
-
const { firstRun:
|
|
944
|
-
|
|
930
|
+
const { firstRun: a, iframe: r } = i[e];
|
|
931
|
+
S(s, t, e), ho(s) && po(r) || uo(e, i), a || go(e);
|
|
945
932
|
}, { iframe: o } = i[e];
|
|
946
|
-
i[e].initChild = n(de),
|
|
933
|
+
i[e].initChild = n(de), yo(o, n(ye)), bo(e, n($));
|
|
947
934
|
}
|
|
948
|
-
function
|
|
935
|
+
function zo(e, t) {
|
|
949
936
|
return t ? (("sizeWidth" in t || "sizeHeight" in t || ge in t) && m(
|
|
950
937
|
e,
|
|
951
938
|
`<rb>Deprecated Option</>
|
|
952
939
|
|
|
953
|
-
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${
|
|
940
|
+
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${W}</>, <bb>${Oe}</>, <bb>${Ee}</> or <bb>${we}</>.
|
|
954
941
|
`
|
|
955
942
|
), t) : {};
|
|
956
943
|
}
|
|
957
|
-
function
|
|
958
|
-
i[e].warningTimeout || y(e, "warningTimeout:%c disabled",
|
|
944
|
+
function wo(e) {
|
|
945
|
+
i[e].warningTimeout || y(e, "warningTimeout:%c disabled", c);
|
|
959
946
|
}
|
|
960
|
-
function
|
|
947
|
+
function Eo(e, { offset: t, offsetSize: n }) {
|
|
961
948
|
const o = n || t;
|
|
962
|
-
o && (i[e].direction ===
|
|
949
|
+
o && (i[e].direction === W ? (i[e].offsetHeight = o, u(e, `Offset height: %c${o}`, c)) : (i[e].offsetWidth = o, u(e, `Offset width: %c${o}`, c)));
|
|
963
950
|
}
|
|
964
|
-
function
|
|
951
|
+
function Oo(e) {
|
|
965
952
|
const { direction: t } = i[e];
|
|
966
953
|
switch (t) {
|
|
967
|
-
case
|
|
954
|
+
case W:
|
|
968
955
|
break;
|
|
969
956
|
case Oe:
|
|
970
957
|
i[e].sizeHeight = !1;
|
|
@@ -972,100 +959,100 @@ function Mo(e) {
|
|
|
972
959
|
case Ee:
|
|
973
960
|
i[e].sizeWidth = !0;
|
|
974
961
|
break;
|
|
975
|
-
case
|
|
962
|
+
case we:
|
|
976
963
|
i[e].sizeWidth = !1, i[e].sizeHeight = !1, i[e].autoResize = !1;
|
|
977
964
|
break;
|
|
978
965
|
default:
|
|
979
966
|
throw new TypeError(`Direction value of "${t}" is not valid`);
|
|
980
967
|
}
|
|
981
|
-
u(e, `direction: %c${t}`,
|
|
968
|
+
u(e, `direction: %c${t}`, c);
|
|
982
969
|
}
|
|
983
970
|
const fe = (e) => e === "" || e.match(/^(about:blank|javascript:|file:\/\/)/) !== null ? "*" : e;
|
|
984
|
-
function
|
|
971
|
+
function ko(e) {
|
|
985
972
|
const { checkOrigin: t, remoteHost: n } = i[e];
|
|
986
|
-
Array.isArray(t) && t.length === 0 &&
|
|
973
|
+
Array.isArray(t) && t.length === 0 && w(
|
|
987
974
|
e,
|
|
988
975
|
"checkOrigin is an empty array — no messages will be sent to the iframe"
|
|
989
976
|
), i[e].targetOrigin = Array.isArray(t) ? t.map(fe) : [t === !1 ? "*" : fe(n)];
|
|
990
977
|
}
|
|
991
|
-
function
|
|
978
|
+
function To(e) {
|
|
992
979
|
const { id: t } = e;
|
|
993
980
|
i[t].postMessageTarget === null && (i[t].postMessageTarget = e.contentWindow);
|
|
994
981
|
}
|
|
995
|
-
function
|
|
982
|
+
function D(e, t, n) {
|
|
996
983
|
P(i[e], t) && (m(
|
|
997
984
|
e,
|
|
998
985
|
`<rb>Deprecated option</>
|
|
999
986
|
|
|
1000
|
-
The <b>${t}</> option has been renamed to <b>${n}</>. ${
|
|
987
|
+
The <b>${t}</> option has been renamed to <b>${n}</>. ${Mt}`
|
|
1001
988
|
), i[e][n] = i[e][t], delete i[e][t]);
|
|
1002
989
|
}
|
|
1003
|
-
function
|
|
1004
|
-
|
|
990
|
+
function jo(e) {
|
|
991
|
+
D(e, mt, bt), D(e, "onClose", "onBeforeClose"), D(e, "onClosed", "onAfterClose");
|
|
1005
992
|
}
|
|
1006
|
-
const
|
|
1007
|
-
function
|
|
993
|
+
const Io = (e) => P(e, "onMouseEnter") || P(e, "onMouseLeave");
|
|
994
|
+
function Mo(e, t) {
|
|
1008
995
|
const { id: n } = e;
|
|
1009
996
|
i[n] = {
|
|
1010
997
|
...i[n],
|
|
1011
998
|
iframe: e,
|
|
1012
999
|
remoteHost: e?.src.split("/").slice(0, 3).join("/"),
|
|
1013
|
-
...
|
|
1014
|
-
...
|
|
1015
|
-
mouseEvents:
|
|
1016
|
-
mode:
|
|
1017
|
-
syncTitle:
|
|
1018
|
-
},
|
|
1019
|
-
}
|
|
1020
|
-
const
|
|
1021
|
-
function
|
|
1000
|
+
...F,
|
|
1001
|
+
...zo(n, t),
|
|
1002
|
+
mouseEvents: Io(t),
|
|
1003
|
+
mode: Gn(t),
|
|
1004
|
+
syncTitle: Pn(n)
|
|
1005
|
+
}, jo(n), Oo(n), Eo(n, t), wo(n), To(e), ko(n);
|
|
1006
|
+
}
|
|
1007
|
+
const So = "yes", pe = "no";
|
|
1008
|
+
function $o(e) {
|
|
1022
1009
|
const { id: t } = e;
|
|
1023
1010
|
switch (u(
|
|
1024
1011
|
t,
|
|
1025
1012
|
`Iframe scrolling ${i[t]?.scrolling ? "enabled" : "disabled"} for ${t}`
|
|
1026
|
-
), e.style.overflow = i[t]?.scrolling === !1 ?
|
|
1027
|
-
case
|
|
1013
|
+
), e.style.overflow = i[t]?.scrolling === !1 ? vt : q, i[t]?.scrolling) {
|
|
1014
|
+
case kt:
|
|
1028
1015
|
break;
|
|
1029
1016
|
case !0:
|
|
1030
|
-
e.scrolling =
|
|
1017
|
+
e.scrolling = So;
|
|
1031
1018
|
break;
|
|
1032
1019
|
case !1:
|
|
1033
|
-
e.scrolling =
|
|
1020
|
+
e.scrolling = pe;
|
|
1034
1021
|
break;
|
|
1035
1022
|
default:
|
|
1036
|
-
e.scrolling = i[t]?.scrolling ||
|
|
1023
|
+
e.scrolling = i[t]?.scrolling || pe;
|
|
1037
1024
|
}
|
|
1038
1025
|
}
|
|
1039
|
-
function
|
|
1040
|
-
|
|
1026
|
+
function Ro(e, t, n) {
|
|
1027
|
+
Mo(t, n), u(e, `src: %c${t.srcdoc || t.src}`, c), Vn(e), $o(t), ro(e), vo(e, io(e)), Qn(e), u(e, "Setup complete");
|
|
1041
1028
|
}
|
|
1042
|
-
function
|
|
1029
|
+
function Ao(e, t) {
|
|
1043
1030
|
const { id: n } = e;
|
|
1044
|
-
b(n, "setup"),
|
|
1031
|
+
b(n, "setup"), Kn(n) && Ro(n, e, t), Jt(n);
|
|
1045
1032
|
}
|
|
1046
|
-
function
|
|
1047
|
-
t.log ===
|
|
1048
|
-
const n = P(t, "log"), o =
|
|
1049
|
-
P(t, "logExpand") || (t.logExpand = n && o ? t.log ===
|
|
1033
|
+
function Lo(e, t) {
|
|
1034
|
+
t.log === ke ? t.log = !1 : t.log === Te ? t.log = M : t.log === je && (t.log = I);
|
|
1035
|
+
const n = P(t, "log"), o = X(t.log), s = n ? o ? !0 : t.log : F.log;
|
|
1036
|
+
P(t, "logExpand") || (t.logExpand = n && o ? t.log === I : F.logExpand), Un(t), Vt({
|
|
1050
1037
|
enabled: s,
|
|
1051
1038
|
expand: t.logExpand,
|
|
1052
1039
|
iframeId: e
|
|
1053
|
-
}), o && !(t.log in
|
|
1040
|
+
}), o && !(t.log in It) && qt(
|
|
1054
1041
|
e,
|
|
1055
|
-
`Invalid value for options.log: Accepted values are "${
|
|
1042
|
+
`Invalid value for options.log: Accepted values are "${I}" and "${M}"`
|
|
1056
1043
|
), t.log = s;
|
|
1057
1044
|
}
|
|
1058
|
-
function
|
|
1059
|
-
if (!
|
|
1060
|
-
return
|
|
1061
|
-
const n =
|
|
1062
|
-
return
|
|
1045
|
+
function No(e) {
|
|
1046
|
+
if (!Ie(e)) throw new TypeError("Options is not an object");
|
|
1047
|
+
return Xn(), tn(e), (t) => {
|
|
1048
|
+
const n = en(t, e);
|
|
1049
|
+
return he in t ? (b(n, "alreadySetup"), w(n, `Ignored iframe (${n}), already setup.`)) : (Lo(n, e), Ae(n, Ao)(t, e)), t?.iframeResizer;
|
|
1063
1050
|
};
|
|
1064
1051
|
}
|
|
1065
1052
|
export {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1053
|
+
Te as LOG_COLLAPSED,
|
|
1054
|
+
ke as LOG_DISABLED,
|
|
1055
|
+
je as LOG_EXPANDED,
|
|
1056
|
+
No as default
|
|
1070
1057
|
};
|
|
1071
1058
|
//# sourceMappingURL=index.esm.js.map
|