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