@iframe-resizer/child 6.0.0-beta.1 → 6.0.0-beta.2
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 +17 -17
- package/index.cjs.js.map +1 -1
- package/index.esm.js +710 -667
- package/index.esm.js.map +1 -1
- package/index.umd.js +18 -18
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
`, ee = "string",
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
}, Ut = "setOffsetSize", Gt = "resizeObserver",
|
|
1
|
+
import Pn, { NORMAL as Q, HIGHLIGHT as a, FOREGROUND as z, BOLD as lt, ITALIC as Cn } from "auto-console-group";
|
|
2
|
+
const x = "6.0.0-beta.2", Ve = "iframeResizer", ye = ":", Ln = "[iFrameResizerChild]Ready", jn = "autoResize", _n = "beforeUnload", Dn = "close", xn = "inPageLink", ve = "init", Le = "message", Bn = "mouseenter", Fn = "mouseleave", jt = "pageHide", _t = "pageInfo", Dt = "parentInfo", Hn = "pageInfoStop", Vn = "parentInfoStop", Wn = "scrollBy", Un = "scrollTo", xt = "scrollToOffset", Gn = "title", J = 1, be = "data-iframe-size", Bt = "data-iframe-overflowed", X = "data-iframe-ignore", ze = "height", Ft = "width", Me = "offset", ke = "offsetSize", We = `
|
|
3
|
+
`, ee = "string", L = "number", qn = "boolean", Zn = "object", we = "function", Yn = "undefined", Qn = "false", Jn = "null", P = "auto", Ht = "readystatechange", Vt = "bottom", Wt = "right", je = "autoResizeEnabled", dt = /* @__PURE__ */ Symbol("sizeChanged"), Ue = "manualResize", Ge = "parentResize", Te = {
|
|
4
|
+
[Ue]: 1,
|
|
5
|
+
[Ge]: 1
|
|
6
|
+
}, Ut = "setOffsetSize", Gt = "resizeObserver", qe = "overflowObserver", qt = "mutationObserver", Zt = "visibilityObserver", Kn = "font-weight: bold;", Ze = "none", ut = "No change in content size detected", de = "[iFrameSizer]", Yt = de.length, Xn = P, Qt = 128, Jt = /* @__PURE__ */ new Set([
|
|
7
7
|
"head",
|
|
8
8
|
"body",
|
|
9
9
|
"meta",
|
|
@@ -20,35 +20,35 @@ const _ = "6.0.0-beta.1", Ve = "iframeResizer", ve = ":", Ln = "[iFrameResizerCh
|
|
|
20
20
|
"track",
|
|
21
21
|
"wbr",
|
|
22
22
|
"nobr"
|
|
23
|
-
]), eo = (e) => (t, n = "renamed to") => (o,
|
|
24
|
-
|
|
23
|
+
]), eo = (e) => (t, n = "renamed to") => (o, r, d = "", c = "") => e(
|
|
24
|
+
c,
|
|
25
25
|
`<rb>Deprecated ${t}(${o.replace("()", "")})</>
|
|
26
26
|
|
|
27
|
-
The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${
|
|
28
|
-
), to = (e) => typeof e === ee,
|
|
27
|
+
The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${d}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`
|
|
28
|
+
), to = (e) => typeof e === ee, Se = (e, ...t) => setTimeout(() => e(...t), 0), Kt = (e) => {
|
|
29
29
|
let t = !1;
|
|
30
30
|
return function(...n) {
|
|
31
31
|
return t ? void 0 : (t = !0, e.apply(this, n));
|
|
32
32
|
};
|
|
33
|
-
},
|
|
34
|
-
function
|
|
33
|
+
}, ue = (e) => e, ft = 1e3, D = (e) => Math.round(e * ft) / ft, Xt = (e) => e.charAt(0).toUpperCase() + e.slice(1), N = (e) => `${e}` != "" && e !== void 0, no = (e) => e(), oo = (e) => e.toLowerCase();
|
|
34
|
+
function ro(e) {
|
|
35
35
|
switch (!0) {
|
|
36
|
-
case !
|
|
36
|
+
case !N(e):
|
|
37
37
|
return "";
|
|
38
|
-
case
|
|
38
|
+
case N(e.id):
|
|
39
39
|
return `${e.nodeName}#${e.id}`;
|
|
40
|
-
case
|
|
40
|
+
case N(e.name):
|
|
41
41
|
return `${e.nodeName} (${e.name}`;
|
|
42
|
-
case
|
|
42
|
+
case N(e.className):
|
|
43
43
|
return `${e.nodeName}.${e.className}`;
|
|
44
44
|
default:
|
|
45
45
|
return e.nodeName;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const so = (e) => (
|
|
49
49
|
// eslint-disable-next-line no-underscore-dangle
|
|
50
50
|
e?.__esModule ? e.default : e
|
|
51
|
-
),
|
|
51
|
+
), R = (e, t, n) => {
|
|
52
52
|
if (typeof e !== t)
|
|
53
53
|
throw new TypeError(`${n} is not a ${Xt(t)}`);
|
|
54
54
|
}, en = {
|
|
@@ -66,42 +66,42 @@ const ro = (e) => (
|
|
|
66
66
|
// underline
|
|
67
67
|
"/": "\x1B[m"
|
|
68
68
|
// reset
|
|
69
|
-
}, io = Object.keys(en), co = new RegExp(`<(${io.join("|")})>`, "gi"), ao = (e, t) => en[t] ?? "", lo = (e) => e.replace(co, ao), uo = (e) => e.replaceAll("<br>",
|
|
69
|
+
}, io = Object.keys(en), co = new RegExp(`<(${io.join("|")})>`, "gi"), ao = (e, t) => en[t] ?? "", lo = (e) => e.replace(co, ao), uo = (e) => e.replaceAll("<br>", We).replaceAll(/<\/?[^>]+>/gi, ""), fo = (e) => (t) => e(
|
|
70
70
|
to(t) ? window.chrome ? lo(t) : uo(t) : t
|
|
71
71
|
);
|
|
72
|
-
let Ye = !0,
|
|
73
|
-
const mo =
|
|
72
|
+
let Ye = !0, _e = Ve;
|
|
73
|
+
const mo = so(Pn), K = mo({
|
|
74
74
|
label: `${Ve}(child)`,
|
|
75
75
|
expand: !1
|
|
76
76
|
});
|
|
77
77
|
function ho(e) {
|
|
78
|
-
|
|
78
|
+
_e = e.id || Ve, K.label(`${_e}`), K.expand(e.expand), Ye = e.enabled;
|
|
79
79
|
}
|
|
80
|
-
const tn = (e) => (...t) => Ye ? K[e](...t) : !0,
|
|
80
|
+
const tn = (e) => (...t) => Ye ? K[e](...t) : !0, l = tn("log"), u = l, fe = tn("debug");
|
|
81
81
|
function go(e, t) {
|
|
82
82
|
console.info(
|
|
83
|
-
`${
|
|
84
|
-
Ye || t < 1 ? Kn :
|
|
83
|
+
`${_e} %ciframe-resizer ${e}`,
|
|
84
|
+
Ye || t < 1 ? Kn : Q
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
const {
|
|
88
|
-
assert:
|
|
89
|
-
endAutoGroup:
|
|
88
|
+
assert: po,
|
|
89
|
+
endAutoGroup: F,
|
|
90
90
|
error: nn,
|
|
91
|
-
errorBoundary:
|
|
91
|
+
errorBoundary: Qe,
|
|
92
92
|
event: h,
|
|
93
|
-
label:
|
|
94
|
-
purge:
|
|
95
|
-
warn:
|
|
96
|
-
} = K,
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
const
|
|
101
|
-
e.removeEventListener(t, n, o),
|
|
102
|
-
},
|
|
103
|
-
e.addEventListener(t, n, o),
|
|
104
|
-
},
|
|
93
|
+
label: Ai,
|
|
94
|
+
purge: Ii,
|
|
95
|
+
warn: B
|
|
96
|
+
} = K, yo = fo(ue), p = (...e) => K.warn(...e.map(yo)), Je = eo((e, t) => p(t)), on = Je("Method"), vo = Je("Method", "replaced with"), bo = Je("Option"), Ke = [];
|
|
97
|
+
function rn(e, t) {
|
|
98
|
+
l(`${e} event listener: %c${t}`, a);
|
|
99
|
+
}
|
|
100
|
+
const sn = (e, t, n, o) => {
|
|
101
|
+
e.removeEventListener(t, n, o), rn("Removed", t);
|
|
102
|
+
}, j = (e, t, n, o = !1) => {
|
|
103
|
+
e.addEventListener(t, n, o), Ke.push(() => sn(e, t, n, o)), rn("Added", t);
|
|
104
|
+
}, s = {
|
|
105
105
|
applySelectors: null,
|
|
106
106
|
firstRun: !0,
|
|
107
107
|
hasTags: !1,
|
|
@@ -124,64 +124,70 @@ const rn = (e, t, n, o) => {
|
|
|
124
124
|
onPageInfo: null,
|
|
125
125
|
onParentInfo: null
|
|
126
126
|
};
|
|
127
|
-
let
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
let mt = !1;
|
|
128
|
+
function ht(e) {
|
|
129
|
+
const t = window?.iframeResizer?.targetOrigin || "*", n = Array.isArray(t) ? t : [t];
|
|
130
|
+
for (const o of n)
|
|
131
|
+
e.postMessage(Ln, o);
|
|
132
|
+
}
|
|
133
|
+
function gt() {
|
|
134
|
+
if (document.readyState === "loading" || !s.firstRun || mt) return;
|
|
134
135
|
const { parent: e, top: t } = window;
|
|
135
|
-
h("ready"),
|
|
136
|
+
h("ready"), l(
|
|
136
137
|
"Sending%c ready%c to parent from",
|
|
137
|
-
|
|
138
|
+
a,
|
|
138
139
|
z,
|
|
139
140
|
window.location.href
|
|
140
|
-
),
|
|
141
|
+
), ht(e), e !== t && ht(t), mt = !0;
|
|
141
142
|
}
|
|
142
|
-
const
|
|
143
|
-
window.jQuery !== void 0 &&
|
|
143
|
+
const pt = "iframeResize", zo = (e) => de === `${e.data}`.slice(0, Yt), wo = () => pt in window || // @ts-ignore
|
|
144
|
+
window.jQuery !== void 0 && pt in window.jQuery.prototype, So = (e) => e.data.split(ye)[2] in { true: 1, false: 1 }, Eo = () => [document.documentElement, document.body], Oo = ["min-height", "min-width", "max-height", "max-width"], yt = /* @__PURE__ */ new Set(), $o = (e) => !!e && e !== "0px" && e !== P && e !== Ze, cn = (e) => e.tagName ? e.tagName.toLowerCase() : "unknown", an = (e, t) => window.getComputedStyle(e).getPropertyValue(t), Ro = (e, t) => $o(an(e, t));
|
|
144
145
|
function Mo(e, t) {
|
|
145
|
-
const n = e.style
|
|
146
|
+
const n = e.style.getPropertyValue(t);
|
|
146
147
|
return n ? { source: "an inline style attribute", value: n } : null;
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
149
|
+
function ko({
|
|
150
|
+
href: e
|
|
151
|
+
}) {
|
|
152
|
+
yt.has(e) || (l("Unable to access stylesheet:", e), yt.add(e));
|
|
150
153
|
}
|
|
151
|
-
function
|
|
154
|
+
function To(e, t) {
|
|
152
155
|
for (const n of document.styleSheets)
|
|
153
156
|
try {
|
|
154
|
-
for (const o of n.cssRules || [])
|
|
155
|
-
if (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
for (const o of n.cssRules || []) {
|
|
158
|
+
if (!("selectorText" in o)) continue;
|
|
159
|
+
const r = o;
|
|
160
|
+
if (!e.matches(r.selectorText)) continue;
|
|
161
|
+
const d = r.style.getPropertyValue(t);
|
|
162
|
+
if (!d) continue;
|
|
163
|
+
const { ownerNode: c } = n;
|
|
164
|
+
return {
|
|
165
|
+
source: c instanceof Element && c.tagName === "STYLE" ? "an inline <style> block" : `stylesheet (${n.href})`,
|
|
166
|
+
value: d
|
|
167
|
+
};
|
|
168
|
+
}
|
|
163
169
|
} catch {
|
|
164
|
-
|
|
170
|
+
ko(n);
|
|
165
171
|
}
|
|
166
172
|
return {
|
|
167
173
|
source: "cross-origin stylesheet",
|
|
168
174
|
value: an(e, t)
|
|
169
175
|
};
|
|
170
176
|
}
|
|
171
|
-
const
|
|
172
|
-
const { source: n, value: o } =
|
|
177
|
+
const Ao = (e, t) => Mo(e, t) || To(e, t), Io = (e, t) => {
|
|
178
|
+
const { source: n, value: o } = Ao(e, t), r = cn(e);
|
|
173
179
|
p(
|
|
174
|
-
`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${
|
|
180
|
+
`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
|
|
175
181
|
|
|
176
182
|
If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`
|
|
177
183
|
);
|
|
178
184
|
};
|
|
179
|
-
function
|
|
180
|
-
for (const e of
|
|
181
|
-
for (const t of
|
|
182
|
-
|
|
185
|
+
function No() {
|
|
186
|
+
for (const e of Eo())
|
|
187
|
+
for (const t of Oo)
|
|
188
|
+
l(`Checking <${cn(e)}> for blocking CSS: ${t}`), Ro(e, t) && Io(e, t);
|
|
183
189
|
}
|
|
184
|
-
const
|
|
190
|
+
const Po = ({
|
|
185
191
|
calculateWidth: e,
|
|
186
192
|
calculateHeight: t
|
|
187
193
|
}) => e === t, i = {
|
|
@@ -193,7 +199,7 @@ const No = ({
|
|
|
193
199
|
bodyPadding: "",
|
|
194
200
|
calculateHeight: !0,
|
|
195
201
|
calculateWidth: !1,
|
|
196
|
-
heightCalcMode:
|
|
202
|
+
heightCalcMode: P,
|
|
197
203
|
ignoreSelector: "",
|
|
198
204
|
inPageLinks: !1,
|
|
199
205
|
logging: !1,
|
|
@@ -206,273 +212,270 @@ const No = ({
|
|
|
206
212
|
sizeSelector: "",
|
|
207
213
|
targetOrigin: "*",
|
|
208
214
|
tolerance: 0,
|
|
209
|
-
widthCalcMode:
|
|
215
|
+
widthCalcMode: P,
|
|
210
216
|
onBeforeResize: void 0,
|
|
211
217
|
onMessage: () => {
|
|
212
|
-
|
|
218
|
+
B("onMessage function not defined");
|
|
213
219
|
},
|
|
214
220
|
onReady: () => {
|
|
215
221
|
}
|
|
216
|
-
}, A = [
|
|
222
|
+
}, A = [a, z, a], ae = {
|
|
217
223
|
height: 0,
|
|
218
224
|
width: 0
|
|
219
|
-
},
|
|
225
|
+
}, V = {
|
|
220
226
|
height: 0,
|
|
221
227
|
width: 0
|
|
222
228
|
};
|
|
223
|
-
function
|
|
224
|
-
return
|
|
229
|
+
function H(e, t, n) {
|
|
230
|
+
return V[e] = t, ae[e] = n, t;
|
|
225
231
|
}
|
|
226
232
|
function Co(e) {
|
|
227
233
|
const t = e.getOffset();
|
|
228
|
-
return t !== 0 &&
|
|
234
|
+
return t !== 0 && u(`Page offsetSize: %c${t}px`, a), t;
|
|
229
235
|
}
|
|
230
|
-
const
|
|
236
|
+
const Lo = (e) => e.documentElementScroll() + Math.max(0, e.getOffset());
|
|
231
237
|
function ln(e) {
|
|
232
|
-
const { hasOverflow: t, hasTags: n, triggerLocked: o } =
|
|
238
|
+
const { hasOverflow: t, hasTags: n, triggerLocked: o } = s, r = e.label, d = r === ze, c = e.boundingClientRect(), f = Math.ceil(c), b = Math.floor(c), m = Lo(e), w = `HTML: %c${c}px %cPage: %c${m}px`;
|
|
233
239
|
let g;
|
|
234
240
|
switch (!0) {
|
|
235
241
|
case !e.enabled():
|
|
236
|
-
return Math.max(
|
|
242
|
+
return Math.max(m, J);
|
|
237
243
|
case n:
|
|
238
|
-
|
|
244
|
+
u("Found element with data-iframe-size attribute"), g = e.taggedElement();
|
|
239
245
|
break;
|
|
240
|
-
case (!t &&
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
246
|
+
case (!t && s.firstRun && V[r] === 0 && ae[r] === 0):
|
|
247
|
+
u(`Initial page size values: ${w}`, ...A), g = H(
|
|
248
|
+
r,
|
|
249
|
+
c,
|
|
250
|
+
m
|
|
245
251
|
);
|
|
246
252
|
break;
|
|
247
|
-
case (o &&
|
|
248
|
-
|
|
253
|
+
case (o && c === V[r] && m === ae[r]):
|
|
254
|
+
u(`Size unchanged: ${w}`, ...A), g = Math.max(c, m);
|
|
249
255
|
break;
|
|
250
|
-
case (
|
|
251
|
-
|
|
256
|
+
case (c === 0 && m !== 0):
|
|
257
|
+
u(`Page is hidden: ${w}`, ...A), g = m;
|
|
252
258
|
break;
|
|
253
|
-
case (!t &&
|
|
254
|
-
|
|
255
|
-
`Previous <html> size: %c${
|
|
256
|
-
|
|
257
|
-
), g =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
case (!t && c !== V[r] && m <= ae[r]):
|
|
260
|
+
u(`New <html> size: ${w} `, ...A), u(
|
|
261
|
+
`Previous <html> size: %c${V[r]}px`,
|
|
262
|
+
a
|
|
263
|
+
), g = H(
|
|
264
|
+
r,
|
|
265
|
+
c,
|
|
266
|
+
m
|
|
261
267
|
);
|
|
262
268
|
break;
|
|
263
|
-
case !
|
|
269
|
+
case !d:
|
|
264
270
|
g = e.taggedElement();
|
|
265
271
|
break;
|
|
266
|
-
case (!t &&
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
272
|
+
case (!t && c < V[r]):
|
|
273
|
+
u(`<html> size decreased: ${w}`, ...A), g = H(
|
|
274
|
+
r,
|
|
275
|
+
c,
|
|
276
|
+
m
|
|
271
277
|
);
|
|
272
278
|
break;
|
|
273
|
-
case (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
279
|
+
case (m === b || m === f):
|
|
280
|
+
u(`<html> size equals page size: ${w}`, ...A), g = H(
|
|
281
|
+
r,
|
|
282
|
+
c,
|
|
283
|
+
m
|
|
278
284
|
);
|
|
279
285
|
break;
|
|
280
|
-
case
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
286
|
+
case c > m:
|
|
287
|
+
u(`Page size < <html> size: ${w}`, ...A), g = H(
|
|
288
|
+
r,
|
|
289
|
+
c,
|
|
290
|
+
m
|
|
285
291
|
);
|
|
286
292
|
break;
|
|
287
293
|
case t:
|
|
288
|
-
|
|
294
|
+
u("Found elements possibly overflowing <html> "), g = e.taggedElement();
|
|
289
295
|
break;
|
|
290
296
|
default:
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
297
|
+
u(`Using <html> size: ${w}`, ...A), g = H(
|
|
298
|
+
r,
|
|
299
|
+
c,
|
|
300
|
+
m
|
|
295
301
|
);
|
|
296
302
|
}
|
|
297
|
-
return
|
|
303
|
+
return u(`Content ${r}: %c${g}px`, a), g += Co(e), Math.max(g, J);
|
|
298
304
|
}
|
|
299
|
-
const
|
|
300
|
-
let
|
|
305
|
+
const jo = 1e3, _o = 5 * jo, Do = 4, xo = 10, Bo = 100, Xe = "--ifr-start", me = "--ifr-end", dn = "--ifr-measure", v = [];
|
|
306
|
+
let le = {}, vt = 0, De;
|
|
301
307
|
function un() {
|
|
302
308
|
try {
|
|
303
|
-
performance.clearMarks(
|
|
309
|
+
performance.clearMarks(Xe), performance.clearMarks(me), performance.clearMeasures(dn);
|
|
304
310
|
} catch {
|
|
305
311
|
}
|
|
306
312
|
}
|
|
307
|
-
function
|
|
313
|
+
function Fo() {
|
|
308
314
|
De = setInterval(() => {
|
|
309
|
-
if (v.length < xo ||
|
|
315
|
+
if (v.length < xo || le.hasTags && le.len < 25) return;
|
|
310
316
|
v.sort();
|
|
311
317
|
const e = Math.min(
|
|
312
318
|
v.reduce((n, o) => n + o, 0) / v.length,
|
|
313
319
|
v[Math.floor(v.length / 2)]
|
|
314
|
-
), t =
|
|
315
|
-
t >
|
|
320
|
+
), t = D(e);
|
|
321
|
+
t > vt && (vt = t, h("performanceObserver"), l("Mean time:", D(v[Math.floor(v.length / 2)])), l(
|
|
316
322
|
"Median time:",
|
|
317
|
-
|
|
318
|
-
),
|
|
323
|
+
D(v.reduce((n, o) => n + o, 0) / v.length)
|
|
324
|
+
), l("Average time:", t), l("Max time:", D(Math.max(...v)))), un(), !(e <= Do) && (clearInterval(De), p(
|
|
319
325
|
`<rb>Performance Warning</>
|
|
320
326
|
|
|
321
|
-
Calculating the page size is taking an excessive amount of time (${
|
|
327
|
+
Calculating the page size is taking an excessive amount of time (${D(e)}ms).
|
|
322
328
|
|
|
323
|
-
To improve performance add the <b>data-iframe-size</> attribute to the ${
|
|
329
|
+
To improve performance add the <b>data-iframe-size</> attribute to the ${le.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`
|
|
324
330
|
));
|
|
325
|
-
},
|
|
331
|
+
}, _o);
|
|
326
332
|
}
|
|
327
|
-
function
|
|
333
|
+
function Ho(e) {
|
|
328
334
|
e.getEntries().forEach((t) => {
|
|
329
|
-
if (t.name ===
|
|
335
|
+
if (t.name === me)
|
|
330
336
|
try {
|
|
331
337
|
const { duration: n } = performance.measure(
|
|
332
338
|
dn,
|
|
333
|
-
|
|
334
|
-
|
|
339
|
+
Xe,
|
|
340
|
+
me
|
|
335
341
|
);
|
|
336
|
-
|
|
342
|
+
le = t.detail, v.push(n), v.length > Bo && v.shift();
|
|
337
343
|
} catch {
|
|
338
344
|
}
|
|
339
345
|
});
|
|
340
346
|
}
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
const e = new PerformanceObserver(
|
|
344
|
-
return e.observe({ entryTypes: ["mark"] }),
|
|
347
|
+
function Vo() {
|
|
348
|
+
u("Attached%c PerformanceObserver%c to page", a, z);
|
|
349
|
+
const e = new PerformanceObserver(Ho);
|
|
350
|
+
return e.observe({ entryTypes: ["mark"] }), Fo(), {
|
|
345
351
|
disconnect: () => {
|
|
346
|
-
un(), clearInterval(De), e.disconnect(),
|
|
352
|
+
un(), clearInterval(De), e.disconnect(), u("Detached%c PerformanceObserver", a);
|
|
347
353
|
}
|
|
348
354
|
};
|
|
349
355
|
}
|
|
350
|
-
const Wo = (e) => `:not(${e})`,
|
|
351
|
-
function
|
|
352
|
-
const { hasOverflow: e, hasTags: t, overflowedNodeSet: n, taggedElements: o } =
|
|
353
|
-
return t ? o : e ? Array.from(n) :
|
|
356
|
+
const Wo = (e) => `:not(${e})`, Uo = `* ${Array.from(Jt).map(Wo).join("")}`, et = (e) => e.querySelectorAll(Uo);
|
|
357
|
+
function Go() {
|
|
358
|
+
const { hasOverflow: e, hasTags: t, overflowedNodeSet: n, taggedElements: o } = s;
|
|
359
|
+
return t ? o : e ? Array.from(n) : et(document.documentElement);
|
|
354
360
|
}
|
|
355
|
-
function
|
|
361
|
+
function qo(e, t) {
|
|
356
362
|
const n = `margin-${t}`;
|
|
357
|
-
let o,
|
|
358
|
-
for (const
|
|
359
|
-
o =
|
|
360
|
-
return { maxEl:
|
|
363
|
+
let o, r = document.documentElement, d = s.hasTags ? J : document.documentElement.getBoundingClientRect().bottom;
|
|
364
|
+
for (const c of e)
|
|
365
|
+
o = c.getBoundingClientRect()[t] + parseFloat(getComputedStyle(c).getPropertyValue(n)), o > d && (d = o, r = c);
|
|
366
|
+
return { maxEl: r, maxVal: d };
|
|
361
367
|
}
|
|
362
368
|
function fn(e) {
|
|
363
|
-
performance.mark(
|
|
364
|
-
const t = Xt(e), { logging: n } = i, { hasTags: o } =
|
|
365
|
-
return
|
|
369
|
+
performance.mark(Xe);
|
|
370
|
+
const t = Xt(e), { logging: n } = i, { hasTags: o } = s, r = Go(), { maxEl: d, maxVal: c } = qo(r, e);
|
|
371
|
+
return u(`${t} position calculated from:`, d), u(`Checked %c${r.length}%c elements`, a, z), performance.mark(me, {
|
|
366
372
|
detail: {
|
|
367
373
|
hasTags: o,
|
|
368
|
-
len:
|
|
374
|
+
len: r.length,
|
|
369
375
|
logging: n,
|
|
370
376
|
Side: t
|
|
371
377
|
}
|
|
372
|
-
}),
|
|
378
|
+
}), c;
|
|
373
379
|
}
|
|
374
|
-
const
|
|
375
|
-
label:
|
|
380
|
+
const Ee = {
|
|
381
|
+
label: ze,
|
|
376
382
|
enabled: () => i.calculateHeight,
|
|
377
383
|
getOffset: () => i.offsetHeight,
|
|
378
|
-
auto: () => ln(
|
|
384
|
+
auto: () => ln(Ee),
|
|
379
385
|
boundingClientRect: () => Math.max(
|
|
380
386
|
document.documentElement.getBoundingClientRect().bottom,
|
|
381
387
|
document.body.getBoundingClientRect().bottom
|
|
382
388
|
),
|
|
383
389
|
documentElementScroll: () => document.documentElement.scrollHeight,
|
|
384
|
-
taggedElement: () => fn(
|
|
385
|
-
},
|
|
390
|
+
taggedElement: () => fn(Vt)
|
|
391
|
+
}, Oe = {
|
|
386
392
|
label: Ft,
|
|
387
393
|
enabled: () => i.calculateWidth,
|
|
388
394
|
getOffset: () => i.offsetWidth,
|
|
389
|
-
auto: () => ln(
|
|
395
|
+
auto: () => ln(Oe),
|
|
390
396
|
boundingClientRect: () => Math.max(
|
|
391
397
|
document.documentElement.getBoundingClientRect().right,
|
|
392
398
|
document.body.getBoundingClientRect().right
|
|
393
399
|
),
|
|
394
400
|
documentElementScroll: () => document.documentElement.scrollWidth,
|
|
395
|
-
taggedElement: () => fn(
|
|
401
|
+
taggedElement: () => fn(Wt)
|
|
396
402
|
};
|
|
397
403
|
function mn(e, t) {
|
|
398
404
|
const { label: n } = t;
|
|
399
|
-
return e && e !==
|
|
405
|
+
return e && e !== P && p(
|
|
400
406
|
`<rb>Ignored ${n}CalculationMethod (${e})</>
|
|
401
407
|
|
|
402
408
|
This version of <i>iframe-resizer</> auto detects the most suitable ${n} calculation method. The <b>${n}CalculationMethod</> option is no longer supported and has been ignored.
|
|
403
409
|
|
|
404
410
|
To remove this warning, delete the <b>${n}CalculationMethod</> option from your parent page config and/or the <i>window.iframeResizer</> config on the child page.
|
|
405
411
|
`
|
|
406
|
-
),
|
|
407
|
-
}
|
|
408
|
-
function qo() {
|
|
409
|
-
i.heightCalcMode = mn(i.heightCalcMode, Oe);
|
|
412
|
+
), l(`Set ${n} calculation method: %c${P}`, a), P;
|
|
410
413
|
}
|
|
411
414
|
function Zo() {
|
|
412
|
-
i.
|
|
415
|
+
i.heightCalcMode = mn(i.heightCalcMode, Ee);
|
|
416
|
+
}
|
|
417
|
+
function Yo() {
|
|
418
|
+
i.widthCalcMode = mn(i.widthCalcMode, Oe);
|
|
413
419
|
}
|
|
414
420
|
function Qo() {
|
|
415
421
|
try {
|
|
416
|
-
|
|
422
|
+
s.sameOrigin = i.mode === 1 || "iframeParentListener" in window.parent;
|
|
417
423
|
} catch {
|
|
418
|
-
|
|
424
|
+
l("Cross domain iframe detected");
|
|
419
425
|
}
|
|
420
426
|
}
|
|
421
|
-
const
|
|
427
|
+
const Jo = `<rb>Deprecated Attributes</>
|
|
422
428
|
|
|
423
429
|
The <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`;
|
|
424
|
-
function
|
|
430
|
+
function Ko() {
|
|
425
431
|
let e = !1;
|
|
426
432
|
const t = (n) => document.querySelectorAll(`[${n}]`).forEach((o) => {
|
|
427
|
-
o.toggleAttribute(
|
|
433
|
+
o.toggleAttribute(be, !0), o.removeAttribute(n), e = !0;
|
|
428
434
|
});
|
|
429
|
-
t("data-iframe-height"), t("data-iframe-width"), e && p(
|
|
435
|
+
t("data-iframe-height"), t("data-iframe-width"), e && p(Jo);
|
|
430
436
|
}
|
|
431
|
-
let
|
|
432
|
-
function
|
|
437
|
+
let bt = 0;
|
|
438
|
+
function Xo(e) {
|
|
433
439
|
const t = e.length === 1 ? "" : "s";
|
|
434
|
-
|
|
440
|
+
B(
|
|
435
441
|
`%c[${X}]%c found on %c${e.length}%c element${t}`,
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
442
|
+
lt,
|
|
443
|
+
Q,
|
|
444
|
+
lt,
|
|
445
|
+
Q
|
|
440
446
|
);
|
|
441
447
|
}
|
|
442
|
-
function
|
|
448
|
+
function er() {
|
|
443
449
|
const e = document.querySelectorAll(`*[${X}]`), t = e.length > 0;
|
|
444
|
-
return t && e.length !==
|
|
450
|
+
return t && e.length !== bt && (Xo(e), bt = e.length), t;
|
|
445
451
|
}
|
|
446
|
-
const
|
|
452
|
+
const he = (e) => {
|
|
447
453
|
if (!e) return "";
|
|
448
454
|
let t = -559038744, n = 1103547984;
|
|
449
|
-
for (let o,
|
|
450
|
-
o = e.codePointAt(
|
|
455
|
+
for (let o, r = 0; r < e.length; r++)
|
|
456
|
+
o = e.codePointAt(r), t = Math.imul(t ^ o, 2246822519), n = Math.imul(n ^ o, 3266489917);
|
|
451
457
|
return t ^= Math.imul(t ^ n >>> 15, 1935289751), n ^= Math.imul(n ^ t >>> 15, 3405138345), t ^= n >>> 16, n ^= t >>> 16, (2097152 * (n >>> 0) + (t >>> 11)).toString(36);
|
|
452
458
|
}, T = (e) => e.replace(
|
|
453
459
|
/[A-Za-z]/g,
|
|
454
460
|
(t) => String.fromCodePoint(
|
|
455
461
|
(t <= "Z" ? 90 : 122) >= (t = t.codePointAt(0) + 19) ? t : t - 26
|
|
456
462
|
)
|
|
457
|
-
),
|
|
458
|
-
e[0],
|
|
459
|
-
...e.slice(1).map((t) => `${t} - lewpylk`),
|
|
460
|
-
`${e[4]} - lewpylk`,
|
|
461
|
-
...e.slice(1)
|
|
462
|
-
], W = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], ns = [
|
|
463
|
+
), tr = /* @__PURE__ */ new Date(), hn = (e) => new Set(Array.from({ length: 9 }, e)), zt = " - lewpylk", W = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], nr = [
|
|
463
464
|
"<yi>Puchspk Spjluzl Rlf</><iy><iy>",
|
|
464
465
|
"<yi>Tpzzpun Spjluzl Rlf</><iy><iy>",
|
|
465
466
|
"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</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>",
|
|
466
467
|
"<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</>.",
|
|
467
468
|
"<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.",
|
|
468
469
|
"Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.",
|
|
469
|
-
"<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>
|
|
470
|
-
|
|
471
|
-
"<yi>
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
470
|
+
"<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.",
|
|
471
|
+
"<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.",
|
|
472
|
+
"<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."
|
|
473
|
+
], or = (e) => [
|
|
474
|
+
e[0],
|
|
475
|
+
...e.slice(1).map((t) => `${t}${zt}`),
|
|
476
|
+
`${e[4]}${zt}`,
|
|
477
|
+
...e.slice(1)
|
|
478
|
+
], rr = or(["NWSc3", "zvsv", "wyv", "ibzpulzz", "VLT"]), wt = Object.fromEntries(
|
|
476
479
|
[
|
|
477
480
|
"2cgs7fdf4xb",
|
|
478
481
|
"1c9ctcccr4z",
|
|
@@ -486,120 +489,155 @@ const ge = (e) => {
|
|
|
486
489
|
"oclbb4thgl",
|
|
487
490
|
"igb1wzrjqr"
|
|
488
491
|
].map((e, t) => [e, Math.max(0, t - 1)])
|
|
489
|
-
),
|
|
492
|
+
), sr = /* @__PURE__ */ new Set([1, 6]), gn = tr[T(W[4])](), ir = hn((e, t) => he(`${gn + t}`)), cr = hn((e, t) => he(`${gn - ++t}`)), ar = (e) => ir.has(e) ? 9 : cr.has(e) ? 5 : -2, tt = (e) => sr.has(e), I = (e) => T(nr[e]), lr = (e) => T(rr[e]), St = (e) => T(W[e]), Et = (e) => {
|
|
490
493
|
const t = e[T(W[0])] || e[T(W[1])] || e[T(W[2])] || e[T(W[3])];
|
|
491
494
|
if (!t) return -1;
|
|
492
495
|
const n = t.split("-");
|
|
493
|
-
let o = (function(
|
|
494
|
-
let
|
|
495
|
-
const
|
|
496
|
-
return
|
|
496
|
+
let o = (function(r = "", d = "") {
|
|
497
|
+
let c = -2;
|
|
498
|
+
const f = he(T(r));
|
|
499
|
+
return f in wt && (c = wt[f]), c === 9 ? ar(d) : c;
|
|
497
500
|
})(...n);
|
|
498
|
-
return o === 0 || ((
|
|
501
|
+
return o === 0 || ((r) => r[2] === he(r[0] + r[1]))(n) || (o = -2), o;
|
|
499
502
|
};
|
|
500
|
-
function
|
|
503
|
+
function dr(e, t, n) {
|
|
504
|
+
if (!N(n) || t > -1 && e > t) {
|
|
505
|
+
try {
|
|
506
|
+
if (sessionStorage.getItem("ifr") === x) return;
|
|
507
|
+
} catch {
|
|
508
|
+
}
|
|
509
|
+
go(`v${x} (${lr(e)})`, e), e < 2 && p(I(3));
|
|
510
|
+
try {
|
|
511
|
+
sessionStorage.setItem("ifr", x);
|
|
512
|
+
} catch {
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function ur({
|
|
501
517
|
key: e,
|
|
502
518
|
key2: t,
|
|
503
519
|
mode: n,
|
|
504
520
|
version: o
|
|
505
521
|
}) {
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
522
|
+
const r = n, d = N(e) ? Et({ key: e }) : -1, c = N(t) ? Et({ key: t }) : -1;
|
|
523
|
+
let f;
|
|
524
|
+
switch (n = Math.max(d, c), n) {
|
|
525
|
+
case -2:
|
|
526
|
+
case -1:
|
|
527
|
+
f = `${I(Math.min(d, c) + 2)}${I(2)}`, s.firstRun = !1;
|
|
528
|
+
break;
|
|
529
|
+
case 1:
|
|
530
|
+
case 2:
|
|
531
|
+
case 3:
|
|
532
|
+
f = I(6);
|
|
533
|
+
break;
|
|
534
|
+
case 4:
|
|
535
|
+
f = I(7);
|
|
536
|
+
break;
|
|
537
|
+
case 5:
|
|
538
|
+
f = I(8);
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
if (dr(n, r, o), (!N(o) || !s.firstRun) && (f && p(f), n < 0))
|
|
542
|
+
throw f.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
|
|
543
|
+
i.mode = n;
|
|
511
544
|
}
|
|
512
|
-
const
|
|
545
|
+
const fr = "BackCompat", mr = `<rb>Quirks Mode Detected</>
|
|
513
546
|
|
|
514
547
|
This iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.
|
|
515
548
|
|
|
516
549
|
For more information see <u>https://iframe-resizer.com/quirks-mode</>.
|
|
517
550
|
`;
|
|
518
|
-
function
|
|
519
|
-
document.compatMode ===
|
|
551
|
+
function hr() {
|
|
552
|
+
document.compatMode === fr && p(mr);
|
|
520
553
|
}
|
|
521
|
-
const
|
|
554
|
+
const gr = "complete";
|
|
522
555
|
let Ot = !1;
|
|
523
556
|
function pn(e) {
|
|
524
|
-
document.readyState ===
|
|
557
|
+
document.readyState === gr ? Se(e) : Ot || j(
|
|
525
558
|
document,
|
|
526
559
|
Ht,
|
|
527
560
|
() => pn(e)
|
|
528
561
|
), Ot = !0;
|
|
529
562
|
}
|
|
530
|
-
const
|
|
531
|
-
|
|
563
|
+
const pr = () => {
|
|
564
|
+
u(`Set targetOrigin for parent: %c${i.targetOrigin}`, a), i.autoResize !== !0 && l("Auto Resize disabled");
|
|
532
565
|
};
|
|
533
566
|
function yn() {
|
|
534
|
-
|
|
567
|
+
s.taggedElements = document.querySelectorAll(`[${be}]`), s.hasTags = s.taggedElements.length > 0, l(`Tagged elements found: %c${s.hasTags}`, a);
|
|
535
568
|
}
|
|
536
|
-
const
|
|
569
|
+
const yr = `<rb>Legacy version detected on parent page</>
|
|
537
570
|
|
|
538
571
|
Detected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.
|
|
539
572
|
|
|
540
573
|
See <u>https://iframe-resizer.com/setup/</> for more details.
|
|
541
|
-
`,
|
|
574
|
+
`, vr = (e) => `<b>Version mismatch</>
|
|
542
575
|
|
|
543
576
|
The parent and child pages are running different versions of <i>iframe resizer</>.
|
|
544
577
|
|
|
545
|
-
Parent page: ${e} - Child page: ${
|
|
578
|
+
Parent page: ${e} - Child page: ${x}.
|
|
546
579
|
`;
|
|
547
|
-
function
|
|
548
|
-
!e || e === "" || e ===
|
|
580
|
+
function br({ version: e }) {
|
|
581
|
+
!e || e === "" || e === Qn ? p(yr) : e !== x && p(vr(e));
|
|
549
582
|
}
|
|
550
|
-
const
|
|
551
|
-
function
|
|
552
|
-
if (!
|
|
553
|
-
const t =
|
|
554
|
-
|
|
583
|
+
const zr = Kt(() => p(I(4)));
|
|
584
|
+
function wr(e) {
|
|
585
|
+
if (!s.timerActive) return;
|
|
586
|
+
const t = D(performance.now() - s.totalTime), n = e === ve ? `Initialised iframe in %c${t}ms` : `Size calculated in %c${t}ms`;
|
|
587
|
+
l(n, a);
|
|
555
588
|
}
|
|
556
|
-
function
|
|
557
|
-
return e === void 0 ? e = i.targetOrigin :
|
|
589
|
+
function Sr(e) {
|
|
590
|
+
return e === void 0 ? e = i.targetOrigin : l(`Message targetOrigin: %c${e}`, a), e;
|
|
558
591
|
}
|
|
559
|
-
function
|
|
560
|
-
const { mode: n } = i, { sameOrigin: o, target:
|
|
592
|
+
function Er(e, t) {
|
|
593
|
+
const { mode: n } = i, { sameOrigin: o, target: r } = s;
|
|
561
594
|
if (o)
|
|
562
595
|
try {
|
|
563
|
-
window.parent.iframeParentListener(
|
|
564
|
-
} catch (
|
|
565
|
-
if (
|
|
566
|
-
else throw
|
|
596
|
+
window.parent.iframeParentListener(de + e);
|
|
597
|
+
} catch (d) {
|
|
598
|
+
if (tt(n)) zr();
|
|
599
|
+
else throw d;
|
|
567
600
|
return !1;
|
|
568
601
|
}
|
|
569
|
-
else
|
|
602
|
+
else {
|
|
603
|
+
po(r, "Internal error: postMessage target is undefined");
|
|
604
|
+
const d = Sr(t), c = Array.isArray(d) ? d : [d];
|
|
605
|
+
for (const f of c)
|
|
606
|
+
r.postMessage(de + e, f);
|
|
607
|
+
}
|
|
570
608
|
return !0;
|
|
571
609
|
}
|
|
572
|
-
function vn(e, t, n, o,
|
|
573
|
-
const { parentId:
|
|
574
|
-
i.mode < -1 || !
|
|
575
|
-
`Sending message to parent page via ${
|
|
576
|
-
|
|
577
|
-
|
|
610
|
+
function vn(e, t, n, o, r) {
|
|
611
|
+
const { parentId: d } = i, { sameOrigin: c } = s, f = `${e}:${t}`, b = `${d}:${f}:${n}${o === void 0 ? "" : `:${o}`}`;
|
|
612
|
+
i.mode < -1 || !Er(b, r) || (wr(n), u(
|
|
613
|
+
`Sending message to parent page via ${c ? "sameOrigin" : "postMessage"}: %c%c${b}`,
|
|
614
|
+
Cn,
|
|
615
|
+
a
|
|
578
616
|
));
|
|
579
617
|
}
|
|
580
|
-
const y =
|
|
581
|
-
(e, t, n, o,
|
|
582
|
-
h(n), vn(e, t, n, o,
|
|
618
|
+
const y = Qe(
|
|
619
|
+
(e, t, n, o, r) => {
|
|
620
|
+
h(n), vn(e, t, n, o, r), F();
|
|
583
621
|
}
|
|
584
|
-
),
|
|
622
|
+
), Or = (e) => y(0, 0, e.type, `${e.screenY}:${e.screenX}`);
|
|
585
623
|
function $t(e, t) {
|
|
586
|
-
|
|
624
|
+
l(`Add event listener: %c${t}`, a), j(window.document, e, Or);
|
|
587
625
|
}
|
|
588
|
-
function
|
|
626
|
+
function $r({
|
|
589
627
|
mouseEvents: e
|
|
590
628
|
}) {
|
|
591
629
|
e === !0 && ($t(Bn, "Mouse Enter"), $t(Fn, "Mouse Leave"));
|
|
592
630
|
}
|
|
593
|
-
const
|
|
594
|
-
function
|
|
595
|
-
e ||
|
|
631
|
+
const Rr = () => y(0, 0, _n);
|
|
632
|
+
function Mr({ persisted: e }) {
|
|
633
|
+
e || Rr(), h(jt), u("Page persisted:", e), !e && Ke.forEach(no);
|
|
596
634
|
}
|
|
597
|
-
const
|
|
598
|
-
function
|
|
599
|
-
const { calculateHeight: n, calculateWidth: o } = i, { height:
|
|
600
|
-
return n &&
|
|
635
|
+
const kr = () => j(window, oo(jt), Mr), Rt = (e, t) => !(Math.abs(e - t) <= i.tolerance);
|
|
636
|
+
function Tr(e, t) {
|
|
637
|
+
const { calculateHeight: n, calculateWidth: o } = i, { height: r, width: d } = s;
|
|
638
|
+
return n && Rt(r, e) || o && Rt(d, t);
|
|
601
639
|
}
|
|
602
|
-
function
|
|
640
|
+
function Ar(e, t, n) {
|
|
603
641
|
const o = i.onBeforeResize(e, t, n);
|
|
604
642
|
if (o === void 0)
|
|
605
643
|
throw new TypeError(
|
|
@@ -616,657 +654,664 @@ function Is(e, t, n) {
|
|
|
616
654
|
return o;
|
|
617
655
|
}
|
|
618
656
|
const bn = (e, t) => (n, o) => {
|
|
619
|
-
const
|
|
620
|
-
return e.enabled() && i.onBeforeResize !== void 0 ?
|
|
621
|
-
},
|
|
622
|
-
function
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
657
|
+
const r = e[n]();
|
|
658
|
+
return e.enabled() && i.onBeforeResize !== void 0 ? Ar(r, o, t) : r;
|
|
659
|
+
}, Ir = bn(Ee, ze), Nr = bn(Oe, Ft);
|
|
660
|
+
function Pr() {
|
|
661
|
+
(window.scrollY !== 0 || window.scrollX !== 0) && (u("Reset iframe scroll position to (0, 0)"), window.scrollTo(0, 0));
|
|
662
|
+
}
|
|
663
|
+
function Cr(e, t, n, o) {
|
|
664
|
+
const { heightCalcMode: r, widthCalcMode: d } = i;
|
|
665
|
+
Pr();
|
|
666
|
+
const c = n ?? Ir(r, e), f = o ?? Nr(d, e), b = Tr(c, f) ? dt : e;
|
|
667
|
+
switch (l(`Resize event: %c${t}`, a), b) {
|
|
668
|
+
case ve:
|
|
669
|
+
case je:
|
|
670
|
+
case dt:
|
|
671
|
+
case Ue:
|
|
628
672
|
case Ge:
|
|
629
|
-
|
|
630
|
-
r.height = l, r.width = m;
|
|
673
|
+
s.height = c, s.width = f;
|
|
631
674
|
// eslint-disable-next-line no-fallthrough
|
|
632
675
|
case Ut:
|
|
633
|
-
return
|
|
676
|
+
return s;
|
|
634
677
|
// the following case needs {} to prevent a compile error on Next.js
|
|
635
|
-
case
|
|
678
|
+
case qe:
|
|
636
679
|
case qt:
|
|
637
680
|
case Gt:
|
|
638
681
|
case Zt: {
|
|
639
|
-
|
|
682
|
+
l(ut);
|
|
640
683
|
break;
|
|
641
684
|
}
|
|
642
685
|
default:
|
|
643
|
-
|
|
686
|
+
u(ut);
|
|
644
687
|
}
|
|
645
688
|
return null;
|
|
646
689
|
}
|
|
647
|
-
let re = !1,
|
|
648
|
-
function
|
|
649
|
-
const { autoResize:
|
|
690
|
+
let re = !1, Ae = !1, q = null;
|
|
691
|
+
function Lr(e, t, n, o, r) {
|
|
692
|
+
const { autoResize: d } = i, { isHidden: c } = s;
|
|
650
693
|
switch (h(e), !0) {
|
|
651
694
|
// Allow manual and parent resize requests to bypass the hidden check
|
|
652
|
-
case (
|
|
653
|
-
if (
|
|
654
|
-
|
|
695
|
+
case (c === !0 && !(e in Te)): {
|
|
696
|
+
if (Ae === !0) break;
|
|
697
|
+
l("Iframe hidden - Ignored resize request"), Ae = !0, re = !1, cancelAnimationFrame(q), q = null;
|
|
655
698
|
break;
|
|
656
699
|
}
|
|
657
700
|
// Ignore overflowObserver here, as more efficient than using
|
|
658
701
|
// mutationObserver to detect OVERFLOW_ATTR changes
|
|
659
702
|
// Also allow manual and parent resize requests to bypass the pending check
|
|
660
|
-
case (re === !0 && e !==
|
|
661
|
-
|
|
703
|
+
case (re === !0 && e !== qe && !(e in Te)): {
|
|
704
|
+
l("Resize already pending - Ignored resize request");
|
|
662
705
|
break;
|
|
663
706
|
}
|
|
664
|
-
case (!
|
|
665
|
-
|
|
707
|
+
case (!d && !(e in Te)): {
|
|
708
|
+
u("Resizing disabled");
|
|
666
709
|
break;
|
|
667
710
|
}
|
|
668
711
|
default: {
|
|
669
|
-
|
|
670
|
-
const
|
|
712
|
+
Ae = !1, re = !0, s.totalTime = performance.now(), s.timerActive = !0;
|
|
713
|
+
const f = Cr(
|
|
671
714
|
e,
|
|
672
715
|
t,
|
|
673
716
|
n,
|
|
674
717
|
o
|
|
675
718
|
);
|
|
676
|
-
|
|
677
|
-
re = !1, q = null, h("requestAnimationFrame"),
|
|
678
|
-
})),
|
|
719
|
+
f && vn(f.height, f.width, e, r), q || (q = requestAnimationFrame(() => {
|
|
720
|
+
re = !1, q = null, h("requestAnimationFrame"), fe(`Reset sendPending: %c${e}`, a);
|
|
721
|
+
})), s.timerActive = !1;
|
|
679
722
|
}
|
|
680
723
|
}
|
|
681
|
-
|
|
724
|
+
F();
|
|
682
725
|
}
|
|
683
|
-
const M =
|
|
684
|
-
function
|
|
726
|
+
const M = Qe(Lr);
|
|
727
|
+
function Mt({
|
|
685
728
|
eventType: e,
|
|
686
729
|
eventName: t
|
|
687
730
|
}) {
|
|
688
|
-
|
|
731
|
+
j(window, t, () => M(t, e), { passive: !0 });
|
|
689
732
|
}
|
|
690
|
-
function
|
|
691
|
-
|
|
733
|
+
function jr() {
|
|
734
|
+
Mt({
|
|
692
735
|
eventType: "After Print",
|
|
693
736
|
eventName: "afterprint"
|
|
694
|
-
}),
|
|
737
|
+
}), Mt({
|
|
695
738
|
eventType: "Before Print",
|
|
696
739
|
eventName: "beforeprint"
|
|
697
740
|
});
|
|
698
741
|
}
|
|
699
|
-
function
|
|
700
|
-
if (
|
|
701
|
-
|
|
742
|
+
function _r() {
|
|
743
|
+
if (s.triggerLocked) {
|
|
744
|
+
l("TriggerLock blocked calculation");
|
|
702
745
|
return;
|
|
703
746
|
}
|
|
704
|
-
|
|
705
|
-
|
|
747
|
+
s.triggerLocked = !0, fe("Trigger event lock on"), requestAnimationFrame(() => {
|
|
748
|
+
s.triggerLocked = !1, fe("Trigger event lock off");
|
|
706
749
|
});
|
|
707
750
|
}
|
|
708
751
|
function zn(e) {
|
|
709
|
-
const { heightCalcMode: t, widthCalcMode: n } = i, o =
|
|
710
|
-
|
|
752
|
+
const { heightCalcMode: t, widthCalcMode: n } = i, o = Ee[t](), r = Oe[n]();
|
|
753
|
+
l(`Reset trigger event: %c${e}`, a), y(o, r, e);
|
|
711
754
|
}
|
|
712
|
-
function
|
|
755
|
+
function Dr(e) {
|
|
713
756
|
const t = i.heightCalcMode;
|
|
714
|
-
|
|
757
|
+
l(`Reset trigger event: %c${e}`, a), i.heightCalcMode = Xn, _r(), zn("reset"), i.heightCalcMode = t;
|
|
715
758
|
}
|
|
716
|
-
const
|
|
717
|
-
function
|
|
718
|
-
|
|
759
|
+
const xr = `Auto Resize can not be changed when <b>direction</> is set to '${Ze}'.`;
|
|
760
|
+
function Br(e) {
|
|
761
|
+
R(e, qn, "parentIframe.autoResize(enable) enable");
|
|
719
762
|
const {
|
|
720
763
|
autoResize: t,
|
|
721
764
|
calculateHeight: n,
|
|
722
765
|
calculateWidth: o
|
|
723
766
|
} = i;
|
|
724
|
-
return o === !1 && n === !1 ? (h(
|
|
767
|
+
return o === !1 && n === !1 ? (h(je), p(xr), !1) : (e === !0 && t === !1 ? (i.autoResize = !0, queueMicrotask(() => M(je, "Auto Resize enabled"))) : e === !1 && t === !0 && (i.autoResize = !1), y(0, 0, jn, JSON.stringify(i.autoResize)), i.autoResize);
|
|
725
768
|
}
|
|
726
|
-
function
|
|
727
|
-
|
|
769
|
+
function Fr(e) {
|
|
770
|
+
R(e, ee, "parentIframe.moveToAnchor(anchor) anchor"), s.inPageLinks.findTarget(e);
|
|
728
771
|
}
|
|
729
|
-
function
|
|
730
|
-
|
|
772
|
+
function Hr(e) {
|
|
773
|
+
R(e, L, "parentIframe.setOffsetSize(offset) offset"), i.offsetHeight = e, i.offsetWidth = e, M(Ut, `parentIframe.setOffsetSize(${e})`);
|
|
731
774
|
}
|
|
732
|
-
function
|
|
733
|
-
return h("getOrigin"), on("getOrigin()", "getParentOrigin()"),
|
|
775
|
+
function Vr() {
|
|
776
|
+
return h("getOrigin"), on("getOrigin()", "getParentOrigin()"), s.origin;
|
|
734
777
|
}
|
|
735
|
-
const
|
|
736
|
-
function
|
|
737
|
-
|
|
778
|
+
const Wr = () => s.origin;
|
|
779
|
+
function Ur(e) {
|
|
780
|
+
R(
|
|
738
781
|
e,
|
|
739
782
|
ee,
|
|
740
783
|
"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"
|
|
741
|
-
),
|
|
784
|
+
), l(`Set targetOrigin: %c${e}`, a), i.targetOrigin = e;
|
|
742
785
|
}
|
|
743
|
-
function
|
|
744
|
-
if (typeof e ===
|
|
745
|
-
|
|
786
|
+
function Gr(e) {
|
|
787
|
+
if (typeof e === we) {
|
|
788
|
+
s.onPageInfo = e, y(0, 0, _t), vo(
|
|
746
789
|
"getPageInfo()",
|
|
747
790
|
"getParentProps()",
|
|
748
791
|
"See <u>https://iframe-resizer.com/upgrade</> for details. "
|
|
749
792
|
);
|
|
750
793
|
return;
|
|
751
794
|
}
|
|
752
|
-
|
|
795
|
+
s.onPageInfo = null, y(0, 0, Hn);
|
|
753
796
|
}
|
|
754
797
|
function wn(e) {
|
|
755
|
-
return
|
|
798
|
+
return R(
|
|
756
799
|
e,
|
|
757
|
-
|
|
800
|
+
we,
|
|
758
801
|
"parentIframe.getParentProps(callback) callback"
|
|
759
|
-
),
|
|
760
|
-
|
|
802
|
+
), s.onParentInfo = e, y(0, 0, Dt), () => {
|
|
803
|
+
s.onParentInfo = null, y(0, 0, Vn);
|
|
761
804
|
};
|
|
762
805
|
}
|
|
763
|
-
function
|
|
764
|
-
on("getParentProperties()", "getParentProps()"), wn(e);
|
|
806
|
+
function qr(e) {
|
|
807
|
+
return on("getParentProperties()", "getParentProps()"), wn(e);
|
|
765
808
|
}
|
|
766
|
-
const
|
|
809
|
+
const Zr = (e) => `<rb>Deprecated API object name</>
|
|
767
810
|
The <b>window.parentIFrame</> object has been renamed to <b>window.parentIframe</>. Please update your code as the old object will be removed in a future version.
|
|
768
811
|
|
|
769
812
|
Called property: '${String(e)}'
|
|
770
813
|
`;
|
|
771
|
-
function
|
|
814
|
+
function Yr(e) {
|
|
772
815
|
const t = /* @__PURE__ */ new Set();
|
|
773
816
|
return new Proxy(e, {
|
|
774
817
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
775
|
-
get(n, o) {
|
|
776
|
-
t.has(o) || (p(
|
|
777
|
-
const
|
|
778
|
-
return
|
|
818
|
+
get(n, o, r) {
|
|
819
|
+
t.has(o) || (p(Zr(o)), t.add(o));
|
|
820
|
+
const d = Reflect.get(n, o, r), c = Object.getOwnPropertyDescriptor(n, o);
|
|
821
|
+
return c && !c.configurable && !c.writable ? d : typeof d == "function" ? d.bind(n) : d;
|
|
779
822
|
}
|
|
780
823
|
});
|
|
781
824
|
}
|
|
782
|
-
function
|
|
783
|
-
e !== void 0 &&
|
|
825
|
+
function Qr(e, t) {
|
|
826
|
+
e !== void 0 && R(
|
|
784
827
|
e,
|
|
785
|
-
|
|
828
|
+
L,
|
|
786
829
|
"parentIframe.resize(customHeight, customWidth) customHeight"
|
|
787
|
-
), t !== void 0 &&
|
|
830
|
+
), t !== void 0 && R(
|
|
788
831
|
t,
|
|
789
|
-
|
|
832
|
+
L,
|
|
790
833
|
"parentIframe.resize(customHeight, customWidth) customWidth"
|
|
791
834
|
);
|
|
792
|
-
const n =
|
|
835
|
+
const n = e === void 0 ? "" : e, o = t === void 0 ? "" : `,${t}`, r = `${n}${o}`;
|
|
793
836
|
M(
|
|
794
|
-
|
|
795
|
-
`parentIframe.resize(${
|
|
837
|
+
Ue,
|
|
838
|
+
`parentIframe.resize(${r})`,
|
|
796
839
|
e,
|
|
797
840
|
t
|
|
798
841
|
);
|
|
799
842
|
}
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
},
|
|
803
|
-
function
|
|
804
|
-
t &&
|
|
843
|
+
const nt = (e) => (t, n) => {
|
|
844
|
+
R(t, L, `parentIframe.${e}(x, y) x`), R(n, L, `parentIframe.${e}(x, y) y`), y(n, t, e);
|
|
845
|
+
}, Jr = nt(Wn), Kr = nt(Un), Xr = nt(xt);
|
|
846
|
+
function es(e, t) {
|
|
847
|
+
t && R(
|
|
805
848
|
t,
|
|
806
849
|
ee,
|
|
807
850
|
"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"
|
|
808
|
-
), y(0, 0,
|
|
851
|
+
), y(0, 0, Le, JSON.stringify(e), t);
|
|
809
852
|
}
|
|
810
|
-
const
|
|
811
|
-
function
|
|
812
|
-
const { win: e } =
|
|
853
|
+
const ts = () => y(0, 0, Dn), ns = () => i.parentId, os = () => Dr("parentIframe.reset"), rs = () => B("parentIframe.size() has been renamed parentIframe.resize()");
|
|
854
|
+
function ss() {
|
|
855
|
+
const { win: e } = s;
|
|
813
856
|
i.mode !== 1 && (e.parentIframe = Object.freeze({
|
|
814
|
-
autoResize:
|
|
815
|
-
close:
|
|
816
|
-
getId:
|
|
817
|
-
getOrigin:
|
|
857
|
+
autoResize: Br,
|
|
858
|
+
close: ts,
|
|
859
|
+
getId: ns,
|
|
860
|
+
getOrigin: Vr,
|
|
818
861
|
// TODO Remove in V6
|
|
819
|
-
getParentOrigin:
|
|
820
|
-
getPageInfo:
|
|
862
|
+
getParentOrigin: Wr,
|
|
863
|
+
getPageInfo: Gr,
|
|
821
864
|
// TODO Remove in V6
|
|
822
865
|
getParentProps: wn,
|
|
823
|
-
getParentProperties:
|
|
866
|
+
getParentProperties: qr,
|
|
824
867
|
// TODO Remove in V6
|
|
825
|
-
moveToAnchor:
|
|
826
|
-
reset:
|
|
827
|
-
setOffsetSize:
|
|
828
|
-
scrollBy:
|
|
829
|
-
scrollTo:
|
|
830
|
-
scrollToOffset:
|
|
831
|
-
sendMessage:
|
|
832
|
-
setTargetOrigin:
|
|
833
|
-
resize:
|
|
834
|
-
size:
|
|
868
|
+
moveToAnchor: Fr,
|
|
869
|
+
reset: os,
|
|
870
|
+
setOffsetSize: Hr,
|
|
871
|
+
scrollBy: Jr,
|
|
872
|
+
scrollTo: Kr,
|
|
873
|
+
scrollToOffset: Xr,
|
|
874
|
+
sendMessage: es,
|
|
875
|
+
setTargetOrigin: Ur,
|
|
876
|
+
resize: Qr,
|
|
877
|
+
size: rs
|
|
835
878
|
// TODO Remove in V6
|
|
836
|
-
}), e.parentIFrame =
|
|
879
|
+
}), e.parentIFrame = Yr(e.parentIframe));
|
|
837
880
|
}
|
|
838
881
|
const te = (e = "") => (t) => (n) => {
|
|
839
|
-
n.size > 0 &&
|
|
882
|
+
n.size > 0 && fe(
|
|
840
883
|
`${t}Observer ${e}:`,
|
|
841
|
-
...Array.from(n).flatMap((o) => [
|
|
884
|
+
...Array.from(n).flatMap((o) => [We, o])
|
|
842
885
|
);
|
|
843
|
-
},
|
|
886
|
+
}, is = (e = "") => (t) => (n) => {
|
|
844
887
|
n.size > 0 && nn(
|
|
845
888
|
`${t}Observer ${e}:`,
|
|
846
|
-
...Array.from(n).flatMap((o) => [
|
|
889
|
+
...Array.from(n).flatMap((o) => [We, o])
|
|
847
890
|
);
|
|
848
|
-
}, Sn = te("attached to"), En =
|
|
849
|
-
n > 0 &&
|
|
891
|
+
}, Sn = te("attached to"), En = is("already attached"), cs = te("detached from"), $e = (e, t = !0) => (n) => {
|
|
892
|
+
n > 0 && u(
|
|
850
893
|
`${t ? "At" : "De"}tached %c${e}Observer%c ${t ? "to" : "from"} %c${n}%c element${n === 1 ? "" : "s"}`,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
894
|
+
a,
|
|
895
|
+
Q,
|
|
896
|
+
a,
|
|
897
|
+
Q
|
|
855
898
|
);
|
|
856
899
|
}, On = (e, t, n, o) => {
|
|
857
|
-
const
|
|
858
|
-
return (
|
|
859
|
-
const
|
|
860
|
-
let
|
|
861
|
-
for (const b of
|
|
862
|
-
n.has(b) && (t.unobserve(b), n.delete(b),
|
|
863
|
-
|
|
900
|
+
const r = cs(e);
|
|
901
|
+
return (d) => {
|
|
902
|
+
const c = /* @__PURE__ */ new Set();
|
|
903
|
+
let f = 0;
|
|
904
|
+
for (const b of d)
|
|
905
|
+
n.has(b) && (t.unobserve(b), n.delete(b), c.add(b), f += 1);
|
|
906
|
+
r(c), o(f), c.clear();
|
|
864
907
|
};
|
|
865
|
-
},
|
|
908
|
+
}, kt = 16, Tt = 2, as = 200, ot = "Mutation", O = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set(), xe = /* @__PURE__ */ new Set(), ge = [], ls = {
|
|
866
909
|
attributes: !0,
|
|
867
|
-
attributeFilter: [X,
|
|
910
|
+
attributeFilter: [X, be],
|
|
868
911
|
attributeOldValue: !1,
|
|
869
912
|
characterData: !1,
|
|
870
913
|
characterDataOldValue: !1,
|
|
871
914
|
childList: !0,
|
|
872
915
|
subtree: !0
|
|
873
916
|
};
|
|
874
|
-
let
|
|
875
|
-
const
|
|
876
|
-
function
|
|
917
|
+
let Ie = 1, rt, Be = !1, Fe = 0;
|
|
918
|
+
const ds = te("added")(ot), us = te("removed (page)")(ot), fs = te("removed (added)")(ot), $n = (e) => e.nodeType !== Node.ELEMENT_NODE || Jt.has(e.tagName.toLowerCase());
|
|
919
|
+
function ms(e) {
|
|
877
920
|
const t = e.addedNodes;
|
|
878
921
|
for (const n of t)
|
|
879
|
-
$n(n) ||
|
|
922
|
+
$n(n) || O.add(n);
|
|
880
923
|
}
|
|
881
|
-
function
|
|
924
|
+
function hs(e) {
|
|
882
925
|
const t = e.removedNodes;
|
|
883
926
|
for (const n of t)
|
|
884
|
-
$n(n) || (
|
|
927
|
+
$n(n) || (O.has(n) ? (O.delete(n), xe.add(n)) : C.add(n));
|
|
885
928
|
}
|
|
886
|
-
const
|
|
887
|
-
|
|
929
|
+
const gs = (e) => {
|
|
930
|
+
u("Mutations:", e);
|
|
888
931
|
for (const t of e)
|
|
889
|
-
|
|
890
|
-
|
|
932
|
+
ms(t), hs(t);
|
|
933
|
+
ds(O), us(C), fs(xe), xe.clear();
|
|
891
934
|
};
|
|
892
|
-
function
|
|
893
|
-
|
|
894
|
-
`Detected %c${
|
|
895
|
-
|
|
935
|
+
function ps() {
|
|
936
|
+
C.size > 0 && l(
|
|
937
|
+
`Detected %c${C.size} %cremoved element${C.size > 1 ? "s" : ""}`,
|
|
938
|
+
a,
|
|
896
939
|
z
|
|
897
|
-
),
|
|
898
|
-
`Found %c${
|
|
899
|
-
|
|
940
|
+
), O.size > 0 && l(
|
|
941
|
+
`Found %c${O.size} %cnew element${O.size > 1 ? "s" : ""}`,
|
|
942
|
+
a,
|
|
900
943
|
z
|
|
901
944
|
);
|
|
902
945
|
}
|
|
903
|
-
const
|
|
904
|
-
const t = performance.now(), n = t -
|
|
905
|
-
if (n > o && n <
|
|
906
|
-
h("mutationThrottled"),
|
|
907
|
-
`EventLoop busy time: %c${
|
|
908
|
-
|
|
946
|
+
const ys = (e) => () => {
|
|
947
|
+
const t = performance.now(), n = t - Fe, o = kt * Ie++ + Tt;
|
|
948
|
+
if (n > o && n < as) {
|
|
949
|
+
h("mutationThrottled"), u("Update delayed due to heavy workload on the callStack"), u(
|
|
950
|
+
`EventLoop busy time: %c${D(n)}ms %c> Max wait: %c${o - Tt}ms`,
|
|
951
|
+
a,
|
|
909
952
|
z,
|
|
910
|
-
|
|
911
|
-
), setTimeout(rt,
|
|
953
|
+
a
|
|
954
|
+
), setTimeout(rt, kt * Ie), Fe = t;
|
|
912
955
|
return;
|
|
913
956
|
}
|
|
914
|
-
|
|
957
|
+
Ie = 1, ge.forEach(gs), ge.length = 0, Be = !1, ps(), e({ addedNodes: O, removedNodes: C }), O.clear(), C.clear();
|
|
915
958
|
};
|
|
916
|
-
function
|
|
917
|
-
|
|
959
|
+
function vs(e) {
|
|
960
|
+
ge.push(e), !Be && (Fe = performance.now(), Be = !0, requestAnimationFrame(rt));
|
|
918
961
|
}
|
|
919
|
-
function
|
|
920
|
-
const t = new window.MutationObserver(
|
|
921
|
-
return rt =
|
|
922
|
-
...t,
|
|
962
|
+
function bs(e) {
|
|
963
|
+
const t = new window.MutationObserver(vs), n = document.body || document.documentElement;
|
|
964
|
+
return rt = ys(e), t.observe(n, ls), u("Attached%c MutationObserver%c to body", a, z), {
|
|
923
965
|
disconnect: () => {
|
|
924
|
-
|
|
966
|
+
O.clear(), C.clear(), ge.length = 0, t.disconnect(), u("Detached%c MutationObserver", a);
|
|
925
967
|
}
|
|
926
968
|
};
|
|
927
969
|
}
|
|
928
|
-
const
|
|
970
|
+
const zs = {
|
|
929
971
|
characterData: !0,
|
|
930
972
|
childList: !0,
|
|
931
973
|
subtree: !0
|
|
932
974
|
};
|
|
933
|
-
function
|
|
975
|
+
function ws(e) {
|
|
934
976
|
const t = document.querySelector("title") ?? document.head ?? document.documentElement, n = new MutationObserver(e);
|
|
935
|
-
return n.observe(t,
|
|
977
|
+
return n.observe(t, zs), u("Attached%c TitleObserver%c to head", a, z), setTimeout(e), {
|
|
936
978
|
disconnect: () => {
|
|
937
|
-
n.disconnect(),
|
|
979
|
+
n.disconnect(), u("Detached%c TitleObserver", a);
|
|
938
980
|
}
|
|
939
981
|
};
|
|
940
982
|
}
|
|
941
|
-
function
|
|
983
|
+
function Ss(e) {
|
|
942
984
|
const t = new IntersectionObserver(
|
|
943
985
|
(o) => e(o.at(-1)?.isIntersecting ?? !1),
|
|
944
986
|
{
|
|
945
987
|
threshold: 0
|
|
946
988
|
}
|
|
947
989
|
), n = document.documentElement;
|
|
948
|
-
return t.observe(n),
|
|
990
|
+
return t.observe(n), u("Attached%c VisibilityObserver%c to page", a, z), {
|
|
949
991
|
disconnect: () => {
|
|
950
|
-
t.disconnect(),
|
|
992
|
+
t.disconnect(), u("Detached%c VisibilityObserver", a);
|
|
951
993
|
}
|
|
952
994
|
};
|
|
953
995
|
}
|
|
954
996
|
let At = /* @__PURE__ */ new Set();
|
|
955
|
-
function
|
|
997
|
+
function Es(e) {
|
|
956
998
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
957
999
|
for (const o of e)
|
|
958
1000
|
o.closest(`[${X}]`) ? n.add(o) : t.add(o);
|
|
959
1001
|
return n.size > 0 && queueMicrotask(() => {
|
|
960
|
-
h("overflowIgnored"),
|
|
961
|
-
`, n),
|
|
1002
|
+
h("overflowIgnored"), u(`Ignoring elements with [data-iframe-ignore] > *:
|
|
1003
|
+
`, n), F();
|
|
962
1004
|
}), t;
|
|
963
1005
|
}
|
|
964
|
-
function
|
|
965
|
-
const e = document.querySelectorAll(`[${Bt}]`), t =
|
|
966
|
-
let n = !
|
|
967
|
-
return typeof Set.prototype.symmetricDifference ===
|
|
1006
|
+
function Rn() {
|
|
1007
|
+
const e = document.querySelectorAll(`[${Bt}]`), t = Es(e);
|
|
1008
|
+
let n = !0;
|
|
1009
|
+
return typeof Set.prototype.symmetricDifference === we && (n = t.symmetricDifference(At).size > 0), At = t, s.overflowedNodeSet = t, s.hasOverflow = t.size > 0, { hasOverflowUpdated: n, overflowedNodeSet: t };
|
|
968
1010
|
}
|
|
969
|
-
const
|
|
1011
|
+
const $ = {}, Mn = (e) => {
|
|
970
1012
|
const t = /* @__PURE__ */ new Set();
|
|
971
|
-
for (const n of e)
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1013
|
+
for (const n of e)
|
|
1014
|
+
if (n instanceof Element) {
|
|
1015
|
+
t.add(n);
|
|
1016
|
+
for (const o of et(n)) t.add(o);
|
|
1017
|
+
}
|
|
1018
|
+
return u(`Inspecting:
|
|
976
1019
|
`, t), t;
|
|
977
|
-
},
|
|
1020
|
+
}, Os = (e) => {
|
|
978
1021
|
if (e.size === 0) return;
|
|
979
1022
|
h("addObservers");
|
|
980
|
-
const t =
|
|
981
|
-
|
|
982
|
-
},
|
|
1023
|
+
const t = Mn(e);
|
|
1024
|
+
$.overflow.attachObservers(t), $.resize.attachObserverToNonStaticElements(t), F();
|
|
1025
|
+
}, $s = (e) => {
|
|
983
1026
|
if (e.size === 0) return;
|
|
984
1027
|
h("removeObservers");
|
|
985
|
-
const t =
|
|
986
|
-
|
|
1028
|
+
const t = Mn(e);
|
|
1029
|
+
$.overflow.detachObservers(t), $.resize.detachObservers(t), F();
|
|
987
1030
|
};
|
|
988
|
-
function
|
|
1031
|
+
function Rs({
|
|
989
1032
|
addedNodes: e,
|
|
990
1033
|
removedNodes: t
|
|
991
1034
|
}) {
|
|
992
|
-
h("contentMutated"),
|
|
1035
|
+
h("contentMutated"), s.applySelectors(), yn(), Rn(), F(), $s(t), Os(e);
|
|
993
1036
|
}
|
|
994
|
-
function
|
|
995
|
-
|
|
1037
|
+
function Ms(e) {
|
|
1038
|
+
Rs(e), M(qt, "Mutation Observed");
|
|
996
1039
|
}
|
|
997
|
-
const ne = "Overflow",
|
|
1040
|
+
const ne = "Overflow", ks = $e(ne), Ts = $e(ne, !1), As = Sn(ne), Is = En(ne), Ns = (e) => e instanceof HTMLElement && (!!e.hidden || e.offsetParent === null || e.style.display === Ze), Ps = (e, t) => {
|
|
998
1041
|
const n = t.side, o = {
|
|
999
1042
|
root: t.root,
|
|
1000
1043
|
rootMargin: "0px",
|
|
1001
1044
|
threshold: 1
|
|
1002
|
-
},
|
|
1045
|
+
}, r = window?.requestAnimationFrame || ue, d = (S = !1) => e(S), c = (S, k) => S === 0 || S > k[n], f = (S, k) => {
|
|
1046
|
+
S.toggleAttribute(Bt, k);
|
|
1047
|
+
};
|
|
1003
1048
|
function b(S) {
|
|
1004
|
-
for (const
|
|
1005
|
-
const { boundingClientRect: U, rootBounds: G, target:
|
|
1049
|
+
for (const k of S) {
|
|
1050
|
+
const { boundingClientRect: U, rootBounds: G, target: E } = k;
|
|
1006
1051
|
if (!G) continue;
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1052
|
+
const In = U[n], Nn = c(In, G) && !(E instanceof HTMLElement && Ns(E));
|
|
1053
|
+
f(E, Nn);
|
|
1009
1054
|
}
|
|
1010
|
-
|
|
1055
|
+
r(d);
|
|
1011
1056
|
}
|
|
1012
|
-
const
|
|
1057
|
+
const m = new IntersectionObserver(b, o), w = /* @__PURE__ */ new WeakSet();
|
|
1013
1058
|
function g(S) {
|
|
1014
|
-
const
|
|
1059
|
+
const k = /* @__PURE__ */ new Set(), U = /* @__PURE__ */ new Set();
|
|
1015
1060
|
let G = 0;
|
|
1016
|
-
for (const
|
|
1017
|
-
if (
|
|
1018
|
-
if (w.has(
|
|
1019
|
-
|
|
1061
|
+
for (const E of S)
|
|
1062
|
+
if (E instanceof Element) {
|
|
1063
|
+
if (w.has(E)) {
|
|
1064
|
+
k.add(E);
|
|
1020
1065
|
continue;
|
|
1021
1066
|
}
|
|
1022
|
-
|
|
1067
|
+
m.observe(E), w.add(E), U.add(E), G += 1;
|
|
1023
1068
|
}
|
|
1024
|
-
|
|
1069
|
+
Is(k), As(U), ks(G), U.clear(), k.clear();
|
|
1025
1070
|
}
|
|
1026
1071
|
return {
|
|
1027
1072
|
attachObservers: g,
|
|
1028
1073
|
detachObservers: On(
|
|
1029
1074
|
ne,
|
|
1030
|
-
|
|
1075
|
+
m,
|
|
1031
1076
|
w,
|
|
1032
|
-
|
|
1077
|
+
Ts
|
|
1033
1078
|
),
|
|
1034
1079
|
disconnect: () => {
|
|
1035
|
-
|
|
1080
|
+
m.disconnect(), u("Detached%c OverflowObserver", a);
|
|
1036
1081
|
}
|
|
1037
1082
|
};
|
|
1038
1083
|
};
|
|
1039
|
-
function
|
|
1040
|
-
const { hasOverflow: e } =
|
|
1084
|
+
function Cs() {
|
|
1085
|
+
const { hasOverflow: e } = s, { hasOverflowUpdated: t, overflowedNodeSet: n } = Rn();
|
|
1041
1086
|
switch (!0) {
|
|
1042
1087
|
case !t:
|
|
1043
1088
|
return;
|
|
1044
1089
|
case n.size > 1:
|
|
1045
|
-
|
|
1090
|
+
u("Overflowed Elements:", n);
|
|
1046
1091
|
break;
|
|
1047
1092
|
case e:
|
|
1048
1093
|
break;
|
|
1049
1094
|
default:
|
|
1050
|
-
|
|
1095
|
+
u("No overflow detected");
|
|
1051
1096
|
}
|
|
1052
|
-
M(
|
|
1097
|
+
M(qe, "Overflow updated");
|
|
1053
1098
|
}
|
|
1054
|
-
function
|
|
1099
|
+
function Ls(e) {
|
|
1055
1100
|
const t = {
|
|
1056
1101
|
root: document.documentElement,
|
|
1057
|
-
side: i.calculateHeight ?
|
|
1102
|
+
side: i.calculateHeight ? Vt : Wt
|
|
1058
1103
|
};
|
|
1059
|
-
return
|
|
1104
|
+
return $.overflow = Ps(Cs, t), $.overflow.attachObservers(e), $.overflow;
|
|
1060
1105
|
}
|
|
1061
|
-
const oe = "Resize",
|
|
1062
|
-
let
|
|
1063
|
-
function
|
|
1106
|
+
const oe = "Resize", js = $e(oe), _s = $e(oe, !1), Ds = Sn(oe), xs = En(oe), pe = /* @__PURE__ */ new WeakSet(), Ne = /* @__PURE__ */ new Set(), Pe = /* @__PURE__ */ new Set();
|
|
1107
|
+
let Y;
|
|
1108
|
+
function Bs(e) {
|
|
1064
1109
|
let t = 0;
|
|
1065
1110
|
for (const n of e) {
|
|
1066
|
-
if (n
|
|
1111
|
+
if (!(n instanceof Element)) continue;
|
|
1067
1112
|
const o = getComputedStyle(n)?.position;
|
|
1068
1113
|
if (!(o === "" || o === "static")) {
|
|
1069
|
-
if (
|
|
1070
|
-
|
|
1114
|
+
if (pe.has(n)) {
|
|
1115
|
+
Ne.add(n);
|
|
1071
1116
|
continue;
|
|
1072
1117
|
}
|
|
1073
|
-
|
|
1118
|
+
Y.observe(n), pe.add(n), Pe.add(n), t += 1;
|
|
1074
1119
|
}
|
|
1075
1120
|
}
|
|
1076
|
-
|
|
1121
|
+
xs(Ne), Ds(Pe), js(t), Pe.clear(), Ne.clear();
|
|
1077
1122
|
}
|
|
1078
|
-
const
|
|
1079
|
-
attachObserverToNonStaticElements:
|
|
1123
|
+
const Fs = (e) => (Y = new ResizeObserver(e), Y.observe(document.body), pe.add(document.body), u("Attached%c ResizeObserver%c to body", a, z), {
|
|
1124
|
+
attachObserverToNonStaticElements: Bs,
|
|
1080
1125
|
detachObservers: On(
|
|
1081
1126
|
oe,
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1127
|
+
Y,
|
|
1128
|
+
pe,
|
|
1129
|
+
_s
|
|
1085
1130
|
),
|
|
1086
1131
|
disconnect: () => {
|
|
1087
|
-
|
|
1132
|
+
Y.disconnect(), u("Detached%c ResizeObserver", a);
|
|
1088
1133
|
}
|
|
1089
1134
|
});
|
|
1090
|
-
function
|
|
1135
|
+
function Hs(e) {
|
|
1091
1136
|
if (!Array.isArray(e) || e.length === 0) return;
|
|
1092
1137
|
const t = e[0].target;
|
|
1093
|
-
M(Gt, `Element resized <${
|
|
1138
|
+
M(Gt, `Element resized <${ro(t)}>`);
|
|
1094
1139
|
}
|
|
1095
|
-
function
|
|
1096
|
-
return
|
|
1140
|
+
function Vs(e) {
|
|
1141
|
+
return $.resize = Fs(Hs), $.resize.attachObserverToNonStaticElements(e), $.resize;
|
|
1097
1142
|
}
|
|
1098
|
-
let
|
|
1099
|
-
function
|
|
1143
|
+
let It;
|
|
1144
|
+
function Ws() {
|
|
1100
1145
|
const e = document.title;
|
|
1101
|
-
e !==
|
|
1146
|
+
e !== It && (It = e, l(`Title: %c${e}`, a), e && y(0, 0, Gn, e));
|
|
1102
1147
|
}
|
|
1103
|
-
function
|
|
1104
|
-
|
|
1148
|
+
function Us(e) {
|
|
1149
|
+
l(`Visible: %c${e}`, a), s.isHidden = !e, M(Zt, "Visibility changed");
|
|
1105
1150
|
}
|
|
1106
|
-
function
|
|
1107
|
-
|
|
1151
|
+
function Gs(e) {
|
|
1152
|
+
Ke.push(...e.map((t) => t.disconnect));
|
|
1108
1153
|
}
|
|
1109
|
-
function
|
|
1154
|
+
function qs() {
|
|
1110
1155
|
h("attachObservers");
|
|
1111
|
-
const e =
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1156
|
+
const e = et(document.documentElement), t = [
|
|
1157
|
+
bs(Ms),
|
|
1158
|
+
Ls(e),
|
|
1159
|
+
Vo(),
|
|
1160
|
+
Vs(e),
|
|
1161
|
+
ws(Ws),
|
|
1162
|
+
Ss(Us)
|
|
1118
1163
|
];
|
|
1119
|
-
|
|
1164
|
+
Gs(t);
|
|
1120
1165
|
}
|
|
1121
1166
|
const Nt = (e, t, n) => {
|
|
1122
1167
|
if (n !== "") {
|
|
1123
|
-
|
|
1168
|
+
l(`${e}: %c${n}`, a);
|
|
1124
1169
|
for (const o of document.querySelectorAll(n))
|
|
1125
|
-
|
|
1170
|
+
l(`Applying ${t} to:`, o), o.toggleAttribute(t, !0);
|
|
1126
1171
|
}
|
|
1127
1172
|
};
|
|
1128
|
-
function
|
|
1173
|
+
function Zs({
|
|
1129
1174
|
sizeSelector: e,
|
|
1130
1175
|
ignoreSelector: t
|
|
1131
1176
|
}) {
|
|
1132
1177
|
return () => {
|
|
1133
|
-
Nt("sizeSelector",
|
|
1178
|
+
Nt("sizeSelector", be, e), Nt("ignoreSelector", X, t);
|
|
1134
1179
|
};
|
|
1135
1180
|
}
|
|
1136
|
-
function
|
|
1181
|
+
function Ys() {
|
|
1137
1182
|
const e = document.createElement("div");
|
|
1138
1183
|
e.style.clear = "both", e.style.display = "block", e.style.height = "0", document.body.append(e);
|
|
1139
1184
|
}
|
|
1140
|
-
function
|
|
1141
|
-
return t.includes("-") && (
|
|
1185
|
+
function Qs(e, t) {
|
|
1186
|
+
return t.includes("-") && (B(`Negative CSS value ignored for ${e}`), t = ""), t;
|
|
1142
1187
|
}
|
|
1143
|
-
function
|
|
1144
|
-
t === void 0 || t === "" || t === Jn || (document.body.style.setProperty(e, t),
|
|
1188
|
+
function He(e, t) {
|
|
1189
|
+
t === void 0 || t === "" || t === Jn || (document.body.style.setProperty(e, t), u(`Set body ${e}: %c${t}`, a));
|
|
1145
1190
|
}
|
|
1146
|
-
function
|
|
1191
|
+
function Js({
|
|
1147
1192
|
bodyMarginStr: e,
|
|
1148
1193
|
bodyMargin: t
|
|
1149
1194
|
}) {
|
|
1150
|
-
e === void 0 && (e = `${t}px`),
|
|
1195
|
+
e === void 0 && (e = `${t}px`), He("margin", Qs("margin", e));
|
|
1151
1196
|
}
|
|
1152
|
-
const
|
|
1197
|
+
const Ks = () => ({
|
|
1153
1198
|
x: document.documentElement.scrollLeft,
|
|
1154
1199
|
y: document.documentElement.scrollTop
|
|
1155
1200
|
});
|
|
1156
|
-
function
|
|
1157
|
-
const t = e.getBoundingClientRect(), n =
|
|
1201
|
+
function Xs(e) {
|
|
1202
|
+
const t = e.getBoundingClientRect(), n = Ks();
|
|
1158
1203
|
return {
|
|
1159
|
-
x:
|
|
1160
|
-
y:
|
|
1204
|
+
x: Math.round(t.left + n.x),
|
|
1205
|
+
y: Math.round(t.top + n.y)
|
|
1161
1206
|
};
|
|
1162
1207
|
}
|
|
1163
|
-
function
|
|
1164
|
-
const n =
|
|
1165
|
-
|
|
1208
|
+
function ei(e, t) {
|
|
1209
|
+
const n = Xs(t);
|
|
1210
|
+
l(
|
|
1166
1211
|
`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,
|
|
1167
|
-
|
|
1212
|
+
a,
|
|
1168
1213
|
z,
|
|
1169
|
-
|
|
1214
|
+
a,
|
|
1170
1215
|
z,
|
|
1171
|
-
|
|
1172
|
-
), y(n.y, n.x,
|
|
1216
|
+
a
|
|
1217
|
+
), y(n.y, n.x, xt);
|
|
1173
1218
|
}
|
|
1174
|
-
function
|
|
1219
|
+
function st(e) {
|
|
1175
1220
|
const t = e.split("#")[1] || e, n = decodeURIComponent(t), o = document.getElementById(n) || document.getElementsByName(n)[0];
|
|
1176
1221
|
if (o !== void 0) {
|
|
1177
|
-
|
|
1222
|
+
ei(t, o);
|
|
1178
1223
|
return;
|
|
1179
1224
|
}
|
|
1180
|
-
|
|
1225
|
+
l(`In page link (#${t}) not found in iframe, so sending to parent`), y(0, 0, xn, `#${t}`);
|
|
1181
1226
|
}
|
|
1182
|
-
function
|
|
1227
|
+
function kn() {
|
|
1183
1228
|
const { hash: e, href: t } = window.location;
|
|
1184
|
-
e !== "" && e !== "#" &&
|
|
1229
|
+
e !== "" && e !== "#" && st(t);
|
|
1185
1230
|
}
|
|
1186
|
-
function
|
|
1231
|
+
function ti() {
|
|
1187
1232
|
for (const e of document.querySelectorAll('a[href^="#"]'))
|
|
1188
|
-
e.getAttribute("href") !== "#" &&
|
|
1189
|
-
t.preventDefault(),
|
|
1233
|
+
e.getAttribute("href") !== "#" && j(e, "click", (t) => {
|
|
1234
|
+
t.preventDefault(), st(e.getAttribute("href"));
|
|
1190
1235
|
});
|
|
1191
1236
|
}
|
|
1192
|
-
function
|
|
1193
|
-
|
|
1237
|
+
function ni() {
|
|
1238
|
+
j(window, "hashchange", kn);
|
|
1194
1239
|
}
|
|
1195
|
-
function
|
|
1196
|
-
setTimeout(
|
|
1240
|
+
function oi() {
|
|
1241
|
+
setTimeout(kn, Qt);
|
|
1197
1242
|
}
|
|
1198
|
-
function
|
|
1199
|
-
|
|
1200
|
-
findTarget:
|
|
1243
|
+
function ri() {
|
|
1244
|
+
l("Setting up location.hash handlers"), ti(), ni(), oi(), s.inPageLinks = {
|
|
1245
|
+
findTarget: st
|
|
1201
1246
|
};
|
|
1202
1247
|
}
|
|
1203
|
-
function
|
|
1248
|
+
function si(e) {
|
|
1204
1249
|
const { mode: t } = i;
|
|
1205
|
-
e ?
|
|
1250
|
+
e ? tt(t) ? p(I(5)) : ri() : l("In page linking not enabled");
|
|
1206
1251
|
}
|
|
1207
|
-
const
|
|
1208
|
-
function
|
|
1209
|
-
const e = (t) => t.style.setProperty(
|
|
1210
|
-
e(document.documentElement), e(document.body),
|
|
1252
|
+
const ii = "important";
|
|
1253
|
+
function ci() {
|
|
1254
|
+
const e = (t) => t.style.setProperty(ze, P, ii);
|
|
1255
|
+
e(document.documentElement), e(document.body), l("Set HTML & body height: %cauto !important", a);
|
|
1211
1256
|
}
|
|
1212
|
-
const
|
|
1257
|
+
const it = (e) => (t, n) => {
|
|
1213
1258
|
if (n in t) {
|
|
1214
1259
|
if (typeof t[n] === e) return t[n];
|
|
1215
1260
|
throw new TypeError(`${n} is not a ${e}.`);
|
|
1216
1261
|
}
|
|
1217
|
-
},
|
|
1218
|
-
function
|
|
1262
|
+
}, Ce = it(we), se = it(L), ie = it(ee), ai = (e) => e !== null && typeof e === Zn && !Array.isArray(e);
|
|
1263
|
+
function li(e) {
|
|
1219
1264
|
const { calculateHeight: t, calculateWidth: n } = i;
|
|
1220
|
-
let o,
|
|
1221
|
-
return typeof e?.offset ===
|
|
1265
|
+
let o, r;
|
|
1266
|
+
return typeof e?.offset === L && (bo(Me, ke), t && (o = se(e, Me)), n && (r = se(e, Me))), typeof e?.offsetSize === L && (t && (o = se(e, ke)), n && (r = se(e, ke))), { offsetHeight: o, offsetWidth: r };
|
|
1222
1267
|
}
|
|
1223
|
-
function
|
|
1224
|
-
|
|
1225
|
-
const { offsetHeight: t, offsetWidth: n } =
|
|
1268
|
+
function di(e) {
|
|
1269
|
+
l("Reading data from page:", Object.keys(e));
|
|
1270
|
+
const { offsetHeight: t, offsetWidth: n } = li(e);
|
|
1226
1271
|
return {
|
|
1227
1272
|
offsetHeight: t,
|
|
1228
1273
|
offsetWidth: n,
|
|
1229
|
-
ignoreSelector:
|
|
1230
|
-
[St(3)]:
|
|
1231
|
-
sizeSelector:
|
|
1232
|
-
targetOrigin:
|
|
1233
|
-
onBeforeResize:
|
|
1234
|
-
onMessage:
|
|
1235
|
-
onReady:
|
|
1274
|
+
ignoreSelector: ie(e, "ignoreSelector"),
|
|
1275
|
+
[St(3)]: ie(e, St(0)),
|
|
1276
|
+
sizeSelector: ie(e, "sizeSelector"),
|
|
1277
|
+
targetOrigin: ie(e, "targetOrigin"),
|
|
1278
|
+
onBeforeResize: Ce(e, "onBeforeResize"),
|
|
1279
|
+
onMessage: Ce(e, "onMessage"),
|
|
1280
|
+
onReady: Ce(e, "onReady")
|
|
1236
1281
|
};
|
|
1237
1282
|
}
|
|
1238
|
-
function
|
|
1283
|
+
function ui() {
|
|
1239
1284
|
const { mode: e } = i;
|
|
1240
|
-
if (
|
|
1285
|
+
if (tt(e)) return {};
|
|
1241
1286
|
const t = window.iframeResizer || window.iFrameResizer;
|
|
1242
|
-
return
|
|
1287
|
+
return ai(t) ? di(t) : {};
|
|
1243
1288
|
}
|
|
1244
|
-
const
|
|
1289
|
+
const fi = (e) => e === "true", Tn = (e) => (t) => t === void 0 ? void 0 : e(t), _ = Tn(fi), Z = Tn(Number), mi = (e) => ({
|
|
1245
1290
|
parentId: e[0],
|
|
1246
1291
|
bodyMargin: Z(e[1]),
|
|
1247
|
-
calculateWidth:
|
|
1248
|
-
logging:
|
|
1292
|
+
calculateWidth: _(e[2]),
|
|
1293
|
+
logging: _(e[3]),
|
|
1249
1294
|
// data[4] no longer used (was intervalTimer)
|
|
1250
|
-
autoResize:
|
|
1295
|
+
autoResize: _(e[6]),
|
|
1251
1296
|
bodyMarginStr: e[7],
|
|
1252
1297
|
heightCalcMode: e[8],
|
|
1253
1298
|
bodyBackground: e[9],
|
|
1254
1299
|
bodyPadding: e[10],
|
|
1255
1300
|
tolerance: Z(e[11]),
|
|
1256
|
-
inPageLinks:
|
|
1301
|
+
inPageLinks: _(e[12]),
|
|
1257
1302
|
// data[13] no longer used (was resizeFrom)
|
|
1258
1303
|
widthCalcMode: e[14],
|
|
1259
|
-
mouseEvents:
|
|
1304
|
+
mouseEvents: _(e[15]),
|
|
1260
1305
|
offsetHeight: Z(e[16]),
|
|
1261
1306
|
offsetWidth: Z(e[17]),
|
|
1262
|
-
calculateHeight:
|
|
1307
|
+
calculateHeight: _(e[18]),
|
|
1263
1308
|
key: e[19],
|
|
1264
1309
|
version: e[20],
|
|
1265
1310
|
mode: Z(e[21]),
|
|
1266
1311
|
// sizeSelector: data[22] // Now only available via page settings
|
|
1267
|
-
logExpand:
|
|
1312
|
+
logExpand: _(e[23])
|
|
1268
1313
|
});
|
|
1269
|
-
function
|
|
1314
|
+
function hi(e) {
|
|
1270
1315
|
const { mode: t } = i;
|
|
1271
1316
|
e.forEach((n) => {
|
|
1272
1317
|
try {
|
|
@@ -1282,143 +1327,141 @@ Please report the following error message at <u>https://github.com/davidjbradsha
|
|
|
1282
1327
|
}
|
|
1283
1328
|
});
|
|
1284
1329
|
}
|
|
1285
|
-
function
|
|
1330
|
+
function Pt(e) {
|
|
1286
1331
|
for (const [t, n] of Object.entries(e))
|
|
1287
1332
|
n !== void 0 && (i[t] = n);
|
|
1288
1333
|
}
|
|
1289
|
-
function
|
|
1334
|
+
function gi({
|
|
1290
1335
|
logExpand: e,
|
|
1291
1336
|
logging: t,
|
|
1292
|
-
parentId: n
|
|
1337
|
+
parentId: n = ""
|
|
1293
1338
|
}) {
|
|
1294
|
-
ho({ id: n, enabled: t, expand: e }), h("initReceived"),
|
|
1339
|
+
ho({ id: n, enabled: t, expand: e }), h("initReceived"), l(`Initialising iframe v${x} ${window.location.href}`);
|
|
1295
1340
|
}
|
|
1296
|
-
function
|
|
1297
|
-
h("ready"), pn(Kt(e)),
|
|
1341
|
+
function pi(e) {
|
|
1342
|
+
h("ready"), pn(Kt(e)), l("Initialization complete", (({ key: t, key2: n, ...o }) => o)(i));
|
|
1298
1343
|
}
|
|
1299
|
-
function
|
|
1344
|
+
function yi({
|
|
1300
1345
|
bodyBackground: e,
|
|
1301
1346
|
bodyPadding: t,
|
|
1302
1347
|
inPageLinks: n,
|
|
1303
1348
|
onReady: o
|
|
1304
1349
|
}) {
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1307
|
-
() => ys(i),
|
|
1308
|
-
// @ts-ignore
|
|
1309
|
-
() => ls(i),
|
|
1310
|
-
Xo,
|
|
1350
|
+
const r = Po(i), d = [
|
|
1351
|
+
er,
|
|
1311
1352
|
Qo,
|
|
1312
|
-
qo,
|
|
1313
1353
|
Zo,
|
|
1314
|
-
|
|
1315
|
-
|
|
1354
|
+
Yo,
|
|
1355
|
+
Ko,
|
|
1356
|
+
hr,
|
|
1316
1357
|
yn,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
() =>
|
|
1320
|
-
() =>
|
|
1321
|
-
() =>
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
() =>
|
|
1326
|
-
|
|
1327
|
-
() =>
|
|
1328
|
-
|
|
1329
|
-
() =>
|
|
1358
|
+
pr,
|
|
1359
|
+
r ? ue : No,
|
|
1360
|
+
() => Js(i),
|
|
1361
|
+
() => He("background", e),
|
|
1362
|
+
() => He("padding", t),
|
|
1363
|
+
r ? ue : ci,
|
|
1364
|
+
Ys,
|
|
1365
|
+
s.applySelectors,
|
|
1366
|
+
() => si(n),
|
|
1367
|
+
jr,
|
|
1368
|
+
() => $r(i),
|
|
1369
|
+
kr,
|
|
1370
|
+
() => ss(),
|
|
1330
1371
|
() => M(
|
|
1331
|
-
|
|
1372
|
+
ve,
|
|
1332
1373
|
"Init message from host page",
|
|
1333
1374
|
void 0,
|
|
1334
1375
|
void 0,
|
|
1335
|
-
`${
|
|
1376
|
+
`${x}:${i.mode}`
|
|
1336
1377
|
),
|
|
1337
|
-
|
|
1338
|
-
|
|
1378
|
+
qs,
|
|
1379
|
+
F
|
|
1339
1380
|
];
|
|
1340
|
-
|
|
1381
|
+
br(i), ur(i), hi(d), pi(o);
|
|
1341
1382
|
}
|
|
1342
|
-
function
|
|
1343
|
-
|
|
1383
|
+
function vi(e) {
|
|
1384
|
+
s.firstRun && (Pt(mi(e)), gi(i), Pt(ui()), s.applySelectors = Zs(i), yi(i));
|
|
1344
1385
|
}
|
|
1345
|
-
function
|
|
1386
|
+
function bi(e) {
|
|
1346
1387
|
if (document.readyState === "loading") {
|
|
1347
|
-
|
|
1388
|
+
l("Page not ready, ignoring init message");
|
|
1348
1389
|
return;
|
|
1349
1390
|
}
|
|
1350
|
-
const t = e.data.slice(
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
},
|
|
1391
|
+
const t = e.data.slice(Yt).split(ye);
|
|
1392
|
+
s.target = e.source, s.origin = e.origin, vi(t), s.firstRun = !1, setTimeout(() => {
|
|
1393
|
+
s.initLock = !1;
|
|
1394
|
+
}, Qt);
|
|
1354
1395
|
}
|
|
1355
|
-
const { freeze:
|
|
1356
|
-
function
|
|
1396
|
+
const { freeze: zi } = Object, { parse: ct } = JSON, at = (e) => zi(ct(e)), An = (e) => y(0, 0, `${e}Stop`), Re = (e) => e.data.slice(e.data.indexOf(ye) + 1), wi = (e) => So(e) ? ve : e.data.split("]")[1].split(ye)[0];
|
|
1397
|
+
function Si(e) {
|
|
1357
1398
|
const t = Re(e);
|
|
1358
|
-
|
|
1399
|
+
l("onMessage called from parent:%c", a, at(t)), Se(i.onMessage, ct(t));
|
|
1359
1400
|
}
|
|
1360
|
-
function
|
|
1361
|
-
const { onPageInfo: t } =
|
|
1362
|
-
|
|
1401
|
+
function Ei(e) {
|
|
1402
|
+
const { onPageInfo: t } = s, n = Re(e);
|
|
1403
|
+
l("PageInfo received from parent:", at(n)), t ? Se(t, ct(n)) : An(_t);
|
|
1363
1404
|
}
|
|
1364
|
-
function
|
|
1365
|
-
const { onParentInfo: t } =
|
|
1366
|
-
|
|
1405
|
+
function Oi(e) {
|
|
1406
|
+
const { onParentInfo: t } = s, n = at(Re(e));
|
|
1407
|
+
l("ParentInfo received from parent:", n), t ? Se(t, n) : An(Dt);
|
|
1367
1408
|
}
|
|
1368
|
-
function
|
|
1369
|
-
if (
|
|
1370
|
-
|
|
1409
|
+
function $i() {
|
|
1410
|
+
if (s.initLock) {
|
|
1411
|
+
l("Page reset ignored by init");
|
|
1371
1412
|
return;
|
|
1372
1413
|
}
|
|
1373
|
-
|
|
1414
|
+
l("Page size reset by host page"), zn("resetPage");
|
|
1374
1415
|
}
|
|
1375
|
-
function
|
|
1376
|
-
|
|
1416
|
+
function Ri() {
|
|
1417
|
+
l("Resize requested by host page"), M(Ge, "Parent window requested size check");
|
|
1377
1418
|
}
|
|
1378
|
-
const
|
|
1379
|
-
init:
|
|
1380
|
-
reset:
|
|
1381
|
-
resize:
|
|
1382
|
-
moveToAnchor:
|
|
1383
|
-
inPageLink:
|
|
1419
|
+
const Ct = (e) => s.inPageLinks.findTarget(Re(e)), Lt = {
|
|
1420
|
+
init: bi,
|
|
1421
|
+
reset: $i,
|
|
1422
|
+
resize: Ri,
|
|
1423
|
+
moveToAnchor: Ct,
|
|
1424
|
+
inPageLink: Ct,
|
|
1384
1425
|
// Backward compatibility
|
|
1385
|
-
pageInfo:
|
|
1386
|
-
parentInfo:
|
|
1387
|
-
message:
|
|
1426
|
+
pageInfo: Ei,
|
|
1427
|
+
parentInfo: Oi,
|
|
1428
|
+
message: Si
|
|
1388
1429
|
};
|
|
1389
|
-
function
|
|
1390
|
-
const { firstRun: t } =
|
|
1430
|
+
function Mi(e) {
|
|
1431
|
+
const { firstRun: t } = s, n = wi(e);
|
|
1391
1432
|
switch (h(n), !0) {
|
|
1392
1433
|
case n in Lt:
|
|
1393
1434
|
Lt[n](e);
|
|
1394
1435
|
break;
|
|
1395
|
-
case (t &&
|
|
1396
|
-
|
|
1436
|
+
case (t && wo()):
|
|
1437
|
+
B(
|
|
1397
1438
|
`Ignored message of type "${n}". Received before initialization.`
|
|
1398
1439
|
);
|
|
1399
1440
|
break;
|
|
1400
1441
|
default:
|
|
1401
|
-
|
|
1442
|
+
B(
|
|
1402
1443
|
`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`
|
|
1403
1444
|
);
|
|
1404
1445
|
}
|
|
1405
1446
|
}
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1447
|
+
const ce = Qe((e) => {
|
|
1448
|
+
zo(e) && Mi(e);
|
|
1408
1449
|
});
|
|
1409
|
-
function
|
|
1450
|
+
function ki() {
|
|
1410
1451
|
if ("iframeChildListener" in window) {
|
|
1411
|
-
|
|
1452
|
+
B("Already setup");
|
|
1412
1453
|
return;
|
|
1413
1454
|
}
|
|
1414
|
-
window.iframeChildListener = (t) => setTimeout(
|
|
1455
|
+
window.iframeChildListener = ((t) => setTimeout(
|
|
1456
|
+
() => ce({ data: t, sameOrigin: !0 })
|
|
1457
|
+
)), h("listen"), j(window, Le, ce), j(document, Ht, gt), gt();
|
|
1415
1458
|
function e(t) {
|
|
1416
|
-
return
|
|
1459
|
+
return ce(t), s.win;
|
|
1417
1460
|
}
|
|
1418
1461
|
try {
|
|
1419
|
-
top?.document?.getElementById("banner") && (
|
|
1462
|
+
top?.document?.getElementById("banner") && (s.win = {}, window.mockMsgListener = e, sn(window, Le, ce), typeof window.define == "function" && window.define([], () => e));
|
|
1420
1463
|
} catch {
|
|
1421
1464
|
}
|
|
1422
1465
|
}
|
|
1423
|
-
typeof window !==
|
|
1466
|
+
typeof window !== Yn && ki();
|
|
1424
1467
|
//# sourceMappingURL=index.esm.js.map
|