@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/index.esm.js CHANGED
@@ -1,106 +1,45 @@
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
- "head",
8
- "body",
9
- "meta",
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 ho(e) {
78
- _e = e.id || Ve, K.label(`${_e}`), K.expand(e.expand), Ye = e.enabled;
12
+ function Yn(e) {
13
+ it = e.id || Ne, Z.label(`${it}`), Z.expand(e.expand), xe = e.enabled;
79
14
  }
80
- const tn = (e) => (...t) => Ye ? K[e](...t) : !0, l = tn("log"), u = l, fe = tn("debug");
81
- function go(e, t) {
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: po,
89
- endAutoGroup: F,
90
- error: nn,
91
- errorBoundary: Qe,
92
- event: h,
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);
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 mt = !1;
128
- function ht(e) {
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(Ln, o);
70
+ e.postMessage(En, o);
132
71
  }
133
- function gt() {
134
- if (document.readyState === "loading" || !s.firstRun || mt) return;
72
+ function dt() {
73
+ if (document.readyState === "loading" || !s.firstRun || ct) return;
135
74
  const { parent: e, top: t } = window;
136
- h("ready"), l(
75
+ g("ready"), a(
137
76
  "Sending%c ready%c to parent from",
138
- a,
139
- z,
77
+ c,
78
+ w,
140
79
  window.location.href
141
- ), ht(e), e !== t && ht(t), mt = !0;
80
+ ), at(e), e !== t && at(t), ct = !0;
142
81
  }
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));
145
- function Mo(e, t) {
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 ko({
88
+ function co({
150
89
  href: e
151
90
  }) {
152
- yt.has(e) || (l("Unable to access stylesheet:", e), yt.add(e));
91
+ ft.has(e) || (a("Unable to access stylesheet:", e), ft.add(e));
153
92
  }
154
- function To(e, t) {
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 d = r.style.getPropertyValue(t);
162
- if (!d) continue;
163
- const { ownerNode: c } = n;
100
+ const f = r.style.getPropertyValue(t);
101
+ if (!f) continue;
102
+ const { ownerNode: d } = n;
164
103
  return {
165
- source: c instanceof Element && c.tagName === "STYLE" ? "an inline <style> block" : `stylesheet (${n.href})`,
166
- value: d
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
- ko(n);
109
+ co(n);
171
110
  }
172
111
  return {
173
112
  source: "cross-origin stylesheet",
174
- value: an(e, t)
113
+ value: Jt(e, t)
175
114
  };
176
115
  }
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);
179
- p(
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 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);
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 Po = ({
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: P,
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: P,
154
+ widthCalcMode: se,
216
155
  onBeforeResize: void 0,
217
156
  onMessage: () => {
218
- B("onMessage function not defined");
157
+ x("onMessage function not defined");
219
158
  },
220
159
  onReady: () => {
221
160
  }
222
- }, A = [a, z, a], ae = {
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
- }, V = {
314
+ }, B = {
226
315
  height: 0,
227
316
  width: 0
228
317
  };
229
- function H(e, t, n) {
230
- return V[e] = t, ae[e] = n, t;
318
+ function D(e, t, n) {
319
+ return B[e] = t, oe[e] = n, t;
231
320
  }
232
- function Co(e) {
321
+ function Do(e) {
233
322
  const t = e.getOffset();
234
- return t !== 0 && u(`Page offsetSize: %c${t}px`, a), t;
323
+ return t !== 0 && l(`Page offsetSize: %c${t}px`, c), t;
235
324
  }
236
- const Lo = (e) => e.documentElementScroll() + Math.max(0, e.getOffset());
237
- function ln(e) {
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`;
239
- let g;
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, J);
331
+ return Math.max(m, W);
243
332
  case n:
244
- u("Found element with data-iframe-size attribute"), g = e.taggedElement();
333
+ l("Found element with data-iframe-size attribute"), h = e.taggedElement();
245
334
  break;
246
- case (!t && s.firstRun && V[r] === 0 && ae[r] === 0):
247
- u(`Initial page size values: ${w}`, ...A), g = H(
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
- c,
338
+ d,
250
339
  m
251
340
  );
252
341
  break;
253
- case (o && c === V[r] && m === ae[r]):
254
- u(`Size unchanged: ${w}`, ...A), g = Math.max(c, m);
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 (c === 0 && m !== 0):
257
- u(`Page is hidden: ${w}`, ...A), g = m;
345
+ case (d === 0 && m !== 0):
346
+ l(`Page is hidden: ${E}`, ...A), h = m;
258
347
  break;
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(
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
- c,
354
+ d,
266
355
  m
267
356
  );
268
357
  break;
269
- case !d:
270
- g = e.taggedElement();
358
+ case !f:
359
+ h = e.taggedElement();
271
360
  break;
272
- case (!t && c < V[r]):
273
- u(`<html> size decreased: ${w}`, ...A), g = H(
361
+ case (!t && d < B[r]):
362
+ l(`<html> size decreased: ${E}`, ...A), h = D(
274
363
  r,
275
- c,
364
+ d,
276
365
  m
277
366
  );
278
367
  break;
279
- case (m === b || m === f):
280
- u(`<html> size equals page size: ${w}`, ...A), g = H(
368
+ case (m === b || m === u):
369
+ l(`<html> size equals page size: ${E}`, ...A), h = D(
281
370
  r,
282
- c,
371
+ d,
283
372
  m
284
373
  );
285
374
  break;
286
- case c > m:
287
- u(`Page size < <html> size: ${w}`, ...A), g = H(
375
+ case d > m:
376
+ l(`Page size < <html> size: ${E}`, ...A), h = D(
288
377
  r,
289
- c,
378
+ d,
290
379
  m
291
380
  );
292
381
  break;
293
382
  case t:
294
- u("Found elements possibly overflowing <html> "), g = e.taggedElement();
383
+ l("Found elements possibly overflowing <html> "), h = e.taggedElement();
295
384
  break;
296
385
  default:
297
- u(`Using <html> size: ${w}`, ...A), g = H(
386
+ l(`Using <html> size: ${E}`, ...A), h = D(
298
387
  r,
299
- c,
388
+ d,
300
389
  m
301
390
  );
302
391
  }
303
- return u(`Content ${r}: %c${g}px`, a), g += Co(e), Math.max(g, J);
392
+ return l(`Content ${r}: %c${h}px`, c), h += Do(e), Math.max(h, W);
304
393
  }
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;
307
- function un() {
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(Xe), performance.clearMarks(me), performance.clearMeasures(dn);
398
+ performance.clearMarks(Ge), performance.clearMarks(ae), performance.clearMeasures(nn);
310
399
  } catch {
311
400
  }
312
401
  }
313
- function Fo() {
314
- De = setInterval(() => {
315
- if (v.length < xo || le.hasTags && le.len < 25) return;
316
- v.sort();
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
- v.reduce((n, o) => n + o, 0) / v.length,
319
- v[Math.floor(v.length / 2)]
320
- ), t = D(e);
321
- t > vt && (vt = t, h("performanceObserver"), l("Mean time:", D(v[Math.floor(v.length / 2)])), l(
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
- 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(
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 (${D(e)}ms).
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 ${le.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`
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
- }, _o);
420
+ }, Fo);
332
421
  }
333
- function Ho(e) {
422
+ function Wo(e) {
334
423
  e.getEntries().forEach((t) => {
335
- if (t.name === me)
424
+ if (t.name === ae)
336
425
  try {
337
426
  const { duration: n } = performance.measure(
338
- dn,
339
- Xe,
340
- me
427
+ nn,
428
+ Ge,
429
+ ae
341
430
  );
342
- le = t.detail, v.push(n), v.length > Bo && v.shift();
431
+ re = t.detail, p.push(n), p.length > Go && p.shift();
343
432
  } catch {
344
433
  }
345
434
  });
346
435
  }
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(), {
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
- un(), clearInterval(De), e.disconnect(), u("Detached%c PerformanceObserver", a);
441
+ on(), clearInterval(ze), e.disconnect(), l("Detached%c PerformanceObserver", c);
353
442
  }
354
443
  };
355
444
  }
356
- const Wo = (e) => `:not(${e})`, Uo = `* ${Array.from(Jt).map(Wo).join("")}`, et = (e) => e.querySelectorAll(Uo);
357
- function Go() {
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) : et(document.documentElement);
448
+ return t ? o : e ? Array.from(n) : Ue(document.documentElement);
360
449
  }
361
- function qo(e, t) {
450
+ function Qo(e, t) {
362
451
  const n = `margin-${t}`;
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 };
367
- }
368
- function fn(e) {
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, {
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
- }), c;
467
+ }), d;
379
468
  }
380
- const Ee = {
381
- label: ze,
469
+ const We = {
470
+ label: me,
382
471
  enabled: () => i.calculateHeight,
383
472
  getOffset: () => i.offsetHeight,
384
- auto: () => ln(Ee),
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: () => fn(Vt)
391
- }, Oe = {
392
- label: Ft,
479
+ taggedElement: () => rn(Pe)
480
+ }, qe = {
481
+ label: kt,
393
482
  enabled: () => i.calculateWidth,
394
483
  getOffset: () => i.offsetWidth,
395
- auto: () => ln(Oe),
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: () => fn(Wt)
490
+ taggedElement: () => rn(Nt)
402
491
  };
403
- function mn(e, t) {
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 < J)
502
+ if (o < W)
651
503
  throw new RangeError(
652
- `Out of range value returned from onBeforeResize(): ${o}, must be at least ${J}`
504
+ `Out of range value returned from onBeforeResize(): ${o}, must be at least ${W}`
653
505
  );
654
506
  return o;
655
507
  }
656
- const bn = (e, t) => (n, o) => {
508
+ const sn = (e, t) => (n, o) => {
657
509
  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:
672
- case Ge:
673
- s.height = c, s.width = f;
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 Ut:
527
+ case _t:
676
528
  return s;
677
529
  // the following case needs {} to prevent a compile error on Next.js
678
- case qe:
679
- case qt:
680
- case Gt:
681
- case Zt: {
682
- l(ut);
530
+ case _e:
531
+ case Pt:
532
+ case Ct:
533
+ case Lt: {
534
+ a(et);
683
535
  break;
684
536
  }
685
537
  default:
686
- u(ut);
538
+ l(et);
687
539
  }
688
540
  return null;
689
541
  }
690
- let re = !1, Ae = !1, q = null;
691
- function Lr(e, t, n, o, r) {
692
- const { autoResize: d } = i, { isHidden: c } = s;
693
- switch (h(e), !0) {
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 (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;
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 (re === !0 && e !== qe && !(e in Te)): {
704
- l("Resize already pending - Ignored resize request");
555
+ case (X === !0 && e !== _e && !(e in we)): {
556
+ a("Resize already pending - Ignored resize request");
705
557
  break;
706
558
  }
707
- case (!d && !(e in Te)): {
708
- u("Resizing disabled");
559
+ case (!f && !(e in we)): {
560
+ l("Resizing disabled");
709
561
  break;
710
562
  }
711
563
  default: {
712
- Ae = !1, re = !0, s.totalTime = performance.now(), s.timerActive = !0;
713
- const f = Cr(
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
- f && vn(f.height, f.width, e, r), q || (q = requestAnimationFrame(() => {
720
- re = !1, q = null, h("requestAnimationFrame"), fe(`Reset sendPending: %c${e}`, a);
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
- F();
576
+ _();
725
577
  }
726
- const M = Qe(Lr);
727
- function Mt({
578
+ const z = Fe(nr);
579
+ function bt({
728
580
  eventType: e,
729
581
  eventName: t
730
582
  }) {
731
- j(window, t, () => M(t, e), { passive: !0 });
583
+ N(window, t, () => z(t, e), { passive: !0 });
732
584
  }
733
- function jr() {
734
- Mt({
585
+ function or() {
586
+ bt({
735
587
  eventType: "After Print",
736
588
  eventName: "afterprint"
737
- }), Mt({
589
+ }), bt({
738
590
  eventType: "Before Print",
739
591
  eventName: "beforeprint"
740
592
  });
741
593
  }
742
- function _r() {
594
+ function rr() {
743
595
  if (s.triggerLocked) {
744
- l("TriggerLock blocked calculation");
596
+ a("TriggerLock blocked calculation");
745
597
  return;
746
598
  }
747
- s.triggerLocked = !0, fe("Trigger event lock on"), requestAnimationFrame(() => {
748
- s.triggerLocked = !1, fe("Trigger event lock off");
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 zn(e) {
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);
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 Dr(e) {
607
+ function sr(e) {
756
608
  const t = i.heightCalcMode;
757
- l(`Reset trigger event: %c${e}`, a), i.heightCalcMode = Xn, _r(), zn("reset"), i.heightCalcMode = t;
609
+ a(`Reset trigger event: %c${e}`, c), i.heightCalcMode = Mn, rr(), cn("reset"), i.heightCalcMode = t;
758
610
  }
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");
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 ? (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);
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 Hr(e) {
773
- R(e, L, "parentIframe.setOffsetSize(offset) offset"), i.offsetHeight = e, i.offsetWidth = e, M(Ut, `parentIframe.setOffsetSize(${e})`);
621
+ function ar(e) {
622
+ T(e, ge, "parentIframe.moveToAnchor(anchor) anchor"), s.inPageLinks.findTarget(e);
774
623
  }
775
- function Vr() {
776
- return h("getOrigin"), on("getOrigin()", "getParentOrigin()"), s.origin;
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 Wr = () => s.origin;
779
- function Ur(e) {
780
- R(
627
+ const lr = () => s.origin;
628
+ function fr(e) {
629
+ T(
781
630
  e,
782
- ee,
631
+ ge,
783
632
  "parentIframe.setTargetOrigin(targetOrigin) targetOrigin"
784
- ), l(`Set targetOrigin: %c${e}`, a), i.targetOrigin = e;
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 wn(e) {
798
- return R(
635
+ function ur(e) {
636
+ return T(
799
637
  e,
800
- we,
638
+ De,
801
639
  "parentIframe.getParentProps(callback) callback"
802
- ), s.onParentInfo = e, y(0, 0, Dt), () => {
803
- s.onParentInfo = null, y(0, 0, Vn);
640
+ ), s.onParentInfo = e, v(0, 0, xt), () => {
641
+ s.onParentInfo = null, v(0, 0, $n);
804
642
  };
805
643
  }
806
- function qr(e) {
807
- return on("getParentProperties()", "getParentProps()"), wn(e);
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
- L,
647
+ P,
829
648
  "parentIframe.resize(customHeight, customWidth) customHeight"
830
- ), t !== void 0 && R(
649
+ ), t !== void 0 && T(
831
650
  t,
832
- L,
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
- M(
837
- Ue,
655
+ z(
656
+ Bt,
838
657
  `parentIframe.resize(${r})`,
839
658
  e,
840
659
  t
841
660
  );
842
661
  }
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(
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
- ee,
668
+ ge,
850
669
  "parentIframe.sendMessage(msg, targetOrigin) targetOrigin"
851
- ), y(0, 0, Le, JSON.stringify(e), t);
670
+ ), v(0, 0, Te, JSON.stringify(e), t);
852
671
  }
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() {
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: Br,
858
- close: ts,
859
- getId: ns,
860
- getOrigin: Vr,
861
- // TODO Remove in V6
862
- getParentOrigin: Wr,
863
- getPageInfo: Gr,
864
- // TODO Remove in V6
865
- getParentProps: wn,
866
- getParentProperties: qr,
867
- // TODO Remove in V6
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
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) => [We, o])
695
+ ...Array.from(n).flatMap((o) => [Ht, o])
885
696
  );
886
- }, is = (e = "") => (t) => (n) => {
887
- n.size > 0 && nn(
697
+ }, yr = (e = "") => (t) => (n) => {
698
+ n.size > 0 && qt(
888
699
  `${t}Observer ${e}:`,
889
- ...Array.from(n).flatMap((o) => [We, o])
700
+ ...Array.from(n).flatMap((o) => [Ht, o])
890
701
  );
891
- }, Sn = te("attached to"), En = is("already attached"), cs = te("detached from"), $e = (e, t = !0) => (n) => {
892
- n > 0 && u(
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
- a,
895
- Q,
896
- a,
897
- Q
705
+ c,
706
+ q,
707
+ c,
708
+ q
898
709
  );
899
- }, On = (e, t, n, o) => {
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();
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
- }, kt = 16, Tt = 2, as = 200, ot = "Mutation", O = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set(), xe = /* @__PURE__ */ new Set(), ge = [], ls = {
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: [X, be],
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 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) {
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
- $n(n) || O.add(n);
733
+ fn(n) || R.add(n);
923
734
  }
924
- function hs(e) {
735
+ function Ar(e) {
925
736
  const t = e.removedNodes;
926
737
  for (const n of t)
927
- $n(n) || (O.has(n) ? (O.delete(n), xe.add(n)) : C.add(n));
738
+ fn(n) || (R.has(n) ? (R.delete(n), $e.add(n)) : k.add(n));
928
739
  }
929
- const gs = (e) => {
930
- u("Mutations:", e);
740
+ const kr = (e) => {
741
+ l("Mutations:", e);
931
742
  for (const t of e)
932
- ms(t), hs(t);
933
- ds(O), us(C), fs(xe), xe.clear();
743
+ Ir(t), Ar(t);
744
+ Tr(R), zr(k), $r($e), $e.clear();
934
745
  };
935
- function ps() {
936
- C.size > 0 && l(
937
- `Detected %c${C.size} %cremoved element${C.size > 1 ? "s" : ""}`,
938
- a,
939
- z
940
- ), O.size > 0 && l(
941
- `Found %c${O.size} %cnew element${O.size > 1 ? "s" : ""}`,
942
- a,
943
- z
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 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,
952
- z,
953
- a
954
- ), setTimeout(rt, kt * Ie), Fe = t;
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
- Ie = 1, ge.forEach(gs), ge.length = 0, Be = !1, ps(), e({ addedNodes: O, removedNodes: C }), O.clear(), C.clear();
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 vs(e) {
960
- ge.push(e), !Be && (Fe = performance.now(), Be = !0, requestAnimationFrame(rt));
770
+ function Cr(e) {
771
+ de.push(e), !Ie && (Ae = performance.now(), Ie = !0, requestAnimationFrame(Ye));
961
772
  }
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), {
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
- O.clear(), C.clear(), ge.length = 0, t.disconnect(), u("Detached%c MutationObserver", a);
777
+ R.clear(), k.clear(), de.length = 0, t.disconnect(), l("Detached%c MutationObserver", c);
967
778
  }
968
779
  };
969
780
  }
970
- const zs = {
781
+ const _r = {
971
782
  characterData: !0,
972
783
  childList: !0,
973
784
  subtree: !0
974
785
  };
975
- function ws(e) {
786
+ function Dr(e) {
976
787
  const t = document.querySelector("title") ?? document.head ?? document.documentElement, n = new MutationObserver(e);
977
- return n.observe(t, zs), u("Attached%c TitleObserver%c to head", a, z), setTimeout(e), {
788
+ return n.observe(t, _r), l("Attached%c TitleObserver%c to head", c, w), setTimeout(e), {
978
789
  disconnect: () => {
979
- n.disconnect(), u("Detached%c TitleObserver", a);
790
+ n.disconnect(), l("Detached%c TitleObserver", c);
980
791
  }
981
792
  };
982
793
  }
983
- function Ss(e) {
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), u("Attached%c VisibilityObserver%c to page", a, z), {
801
+ return t.observe(n), l("Attached%c VisibilityObserver%c to page", c, w), {
991
802
  disconnect: () => {
992
- t.disconnect(), u("Detached%c VisibilityObserver", a);
803
+ t.disconnect(), l("Detached%c VisibilityObserver", c);
993
804
  }
994
805
  };
995
806
  }
996
- let At = /* @__PURE__ */ new Set();
997
- function Es(e) {
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(`[${X}]`) ? n.add(o) : t.add(o);
811
+ o.closest(`[${j}]`) ? n.add(o) : t.add(o);
1001
812
  return n.size > 0 && queueMicrotask(() => {
1002
- h("overflowIgnored"), u(`Ignoring elements with [data-iframe-ignore] > *:
1003
- `, n), F();
813
+ g("overflowIgnored"), l(`Ignoring elements with [data-iframe-ignore] > *:
814
+ `, n), _();
1004
815
  }), t;
1005
816
  }
1006
- function Rn() {
1007
- const e = document.querySelectorAll(`[${Bt}]`), t = Es(e);
817
+ function un() {
818
+ const e = document.querySelectorAll(`[${Vt}]`), t = xr(e);
1008
819
  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 };
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 $ = {}, Mn = (e) => {
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 et(n)) t.add(o);
827
+ for (const o of Ue(n)) t.add(o);
1017
828
  }
1018
- return u(`Inspecting:
829
+ return l(`Inspecting:
1019
830
  `, t), t;
1020
- }, Os = (e) => {
831
+ }, Fr = (e) => {
1021
832
  if (e.size === 0) return;
1022
- h("addObservers");
1023
- const t = Mn(e);
1024
- $.overflow.attachObservers(t), $.resize.attachObserverToNonStaticElements(t), F();
1025
- }, $s = (e) => {
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
- h("removeObservers");
1028
- const t = Mn(e);
1029
- $.overflow.detachObservers(t), $.resize.detachObservers(t), F();
838
+ g("removeObservers");
839
+ const t = mn(e);
840
+ M.overflow.detachObservers(t), M.resize.detachObservers(t), _();
1030
841
  };
1031
- function Rs({
842
+ function Vr({
1032
843
  addedNodes: e,
1033
844
  removedNodes: t
1034
845
  }) {
1035
- h("contentMutated"), s.applySelectors(), yn(), Rn(), F(), $s(t), Os(e);
846
+ g("contentMutated"), s.applySelectors(), Xt(), un(), _(), Hr(t), Fr(e);
1036
847
  }
1037
- function Ms(e) {
1038
- Rs(e), M(qt, "Mutation Observed");
848
+ function Gr(e) {
849
+ Vr(e), z(Pt, "Mutation Observed");
1039
850
  }
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) => {
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 || ue, d = (S = !1) => e(S), c = (S, k) => S === 0 || S > k[n], f = (S, k) => {
1046
- S.toggleAttribute(Bt, k);
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(S) {
1049
- for (const k of S) {
1050
- const { boundingClientRect: U, rootBounds: G, target: E } = k;
1051
- if (!G) continue;
1052
- const In = U[n], Nn = c(In, G) && !(E instanceof HTMLElement && Ns(E));
1053
- f(E, Nn);
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(d);
866
+ r(f);
1056
867
  }
1057
- const m = new IntersectionObserver(b, o), w = /* @__PURE__ */ new WeakSet();
1058
- function g(S) {
1059
- const k = /* @__PURE__ */ new Set(), U = /* @__PURE__ */ new Set();
1060
- let G = 0;
1061
- for (const E of S)
1062
- if (E instanceof Element) {
1063
- if (w.has(E)) {
1064
- k.add(E);
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(E), w.add(E), U.add(E), G += 1;
878
+ m.observe(S), E.add(S), F.add(S), H += 1;
1068
879
  }
1069
- Is(k), As(U), ks(G), U.clear(), k.clear();
880
+ Zr($), qr(F), Ur(H), F.clear(), $.clear();
1070
881
  }
1071
882
  return {
1072
- attachObservers: g,
1073
- detachObservers: On(
1074
- ne,
883
+ attachObservers: h,
884
+ detachObservers: ln(
885
+ J,
1075
886
  m,
1076
- w,
1077
- Ts
887
+ E,
888
+ Wr
1078
889
  ),
1079
890
  disconnect: () => {
1080
- m.disconnect(), u("Detached%c OverflowObserver", a);
891
+ m.disconnect(), l("Detached%c OverflowObserver", c);
1081
892
  }
1082
893
  };
1083
894
  };
1084
- function Cs() {
1085
- const { hasOverflow: e } = s, { hasOverflowUpdated: t, overflowedNodeSet: n } = Rn();
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
- u("Overflowed Elements:", n);
901
+ l("Overflowed Elements:", n);
1091
902
  break;
1092
903
  case e:
1093
904
  break;
1094
905
  default:
1095
- u("No overflow detected");
906
+ l("No overflow detected");
1096
907
  }
1097
- M(qe, "Overflow updated");
908
+ z(_e, "Overflow updated");
1098
909
  }
1099
- function Ls(e) {
910
+ function Jr(e) {
1100
911
  const t = {
1101
912
  root: document.documentElement,
1102
- side: i.calculateHeight ? Vt : Wt
913
+ side: i.calculateHeight ? Pe : Nt
1103
914
  };
1104
- return $.overflow = Ps(Cs, t), $.overflow.attachObservers(e), $.overflow;
915
+ return M.overflow = Yr(Qr, t), M.overflow.attachObservers(e), M.overflow;
1105
916
  }
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) {
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 (pe.has(n)) {
1115
- Ne.add(n);
925
+ if (le.has(n)) {
926
+ Oe.add(n);
1116
927
  continue;
1117
928
  }
1118
- Y.observe(n), pe.add(n), Pe.add(n), t += 1;
929
+ U.observe(n), le.add(n), ye.add(n), t += 1;
1119
930
  }
1120
931
  }
1121
- xs(Ne), Ds(Pe), js(t), Pe.clear(), Ne.clear();
1122
- }
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,
1125
- detachObservers: On(
1126
- oe,
1127
- Y,
1128
- pe,
1129
- _s
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
- Y.disconnect(), u("Detached%c ResizeObserver", a);
943
+ U.disconnect(), l("Detached%c ResizeObserver", c);
1133
944
  }
1134
945
  });
1135
- function Hs(e) {
946
+ function rs(e) {
1136
947
  if (!Array.isArray(e) || e.length === 0) return;
1137
948
  const t = e[0].target;
1138
- M(Gt, `Element resized <${ro(t)}>`);
949
+ z(Ct, `Element resized <${Un(t)}>`);
1139
950
  }
1140
- function Vs(e) {
1141
- return $.resize = Fs(Hs), $.resize.attachObserverToNonStaticElements(e), $.resize;
951
+ function ss(e) {
952
+ return M.resize = os(rs), M.resize.attachObserverToNonStaticElements(e), M.resize;
1142
953
  }
1143
- let It;
1144
- function Ws() {
954
+ let Ot;
955
+ function is() {
1145
956
  const e = document.title;
1146
- e !== It && (It = e, l(`Title: %c${e}`, a), e && y(0, 0, Gn, e));
1147
- }
1148
- function Us(e) {
1149
- l(`Visible: %c${e}`, a), s.isHidden = !e, M(Zt, "Visibility changed");
1150
- }
1151
- function Gs(e) {
1152
- Ke.push(...e.map((t) => t.disconnect));
1153
- }
1154
- function qs() {
1155
- h("attachObservers");
1156
- const e = et(document.documentElement), t = [
1157
- bs(Ms),
1158
- Ls(e),
1159
- Vo(),
1160
- Vs(e),
1161
- ws(Ws),
1162
- Ss(Us)
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
- Gs(t);
975
+ as(t);
1165
976
  }
1166
- const Nt = (e, t, n) => {
977
+ const yt = (e, t, n) => {
1167
978
  if (n !== "") {
1168
- l(`${e}: %c${n}`, a);
979
+ a(`${e}: %c${n}`, c);
1169
980
  for (const o of document.querySelectorAll(n))
1170
- l(`Applying ${t} to:`, o), o.toggleAttribute(t, !0);
981
+ a(`Applying ${t} to:`, o), o.toggleAttribute(t, !0);
1171
982
  }
1172
983
  };
1173
- function Zs({
984
+ function ls({
1174
985
  sizeSelector: e,
1175
986
  ignoreSelector: t
1176
987
  }) {
1177
988
  return () => {
1178
- Nt("sizeSelector", be, e), Nt("ignoreSelector", X, t);
989
+ yt("sizeSelector", Ce, e), yt("ignoreSelector", j, t);
1179
990
  };
1180
991
  }
1181
- function Ys() {
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 Qs(e, t) {
1186
- return t.includes("-") && (B(`Negative CSS value ignored for ${e}`), t = ""), t;
996
+ function us(e, t) {
997
+ return t.includes("-") && (x(`Negative CSS value ignored for ${e}`), t = ""), t;
1187
998
  }
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));
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 Js({
1002
+ function ms({
1192
1003
  bodyMarginStr: e,
1193
1004
  bodyMargin: t
1194
1005
  }) {
1195
- e === void 0 && (e = `${t}px`), He("margin", Qs("margin", e));
1006
+ e === void 0 && (e = `${t}px`), ke("margin", us("margin", e));
1196
1007
  }
1197
- const Ks = () => ({
1008
+ const gs = () => ({
1198
1009
  x: document.documentElement.scrollLeft,
1199
1010
  y: document.documentElement.scrollTop
1200
1011
  });
1201
- function Xs(e) {
1202
- const t = e.getBoundingClientRect(), n = Ks();
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 ei(e, t) {
1209
- const n = Xs(t);
1210
- l(
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
- a,
1213
- z,
1214
- a,
1215
- z,
1216
- a
1217
- ), y(n.y, n.x, xt);
1218
- }
1219
- function st(e) {
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
- ei(t, o);
1033
+ ps(t, o);
1223
1034
  return;
1224
1035
  }
1225
- l(`In page link (#${t}) not found in iframe, so sending to parent`), y(0, 0, xn, `#${t}`);
1036
+ a(`In page link (#${t}) not found in iframe, so sending to parent`), v(0, 0, Cn, `#${t}`);
1226
1037
  }
1227
- function kn() {
1038
+ function gn() {
1228
1039
  const { hash: e, href: t } = window.location;
1229
- e !== "" && e !== "#" && st(t);
1040
+ e !== "" && e !== "#" && Qe(t);
1230
1041
  }
1231
- function ti() {
1042
+ function bs() {
1232
1043
  for (const e of document.querySelectorAll('a[href^="#"]'))
1233
- e.getAttribute("href") !== "#" && j(e, "click", (t) => {
1234
- t.preventDefault(), st(e.getAttribute("href"));
1044
+ e.getAttribute("href") !== "#" && N(e, "click", (t) => {
1045
+ t.preventDefault(), Qe(e.getAttribute("href"));
1235
1046
  });
1236
1047
  }
1237
- function ni() {
1238
- j(window, "hashchange", kn);
1048
+ function ws() {
1049
+ N(window, "hashchange", gn);
1239
1050
  }
1240
- function oi() {
1241
- setTimeout(kn, Qt);
1051
+ function vs() {
1052
+ setTimeout(gn, Gt);
1242
1053
  }
1243
- function ri() {
1244
- l("Setting up location.hash handlers"), ti(), ni(), oi(), s.inPageLinks = {
1245
- findTarget: st
1054
+ function Es() {
1055
+ a("Setting up location.hash handlers"), bs(), ws(), vs(), s.inPageLinks = {
1056
+ findTarget: Qe
1246
1057
  };
1247
1058
  }
1248
- function si(e) {
1059
+ function Os(e) {
1249
1060
  const { mode: t } = i;
1250
- e ? tt(t) ? p(I(5)) : ri() : l("In page linking not enabled");
1061
+ e ? Be(t) ? O(I(5)) : Es() : a("In page linking not enabled");
1251
1062
  }
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);
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 it = (e) => (t, n) => {
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
- }, Ce = it(we), se = it(L), ie = it(ee), ai = (e) => e !== null && typeof e === Zn && !Array.isArray(e);
1263
- function li(e) {
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?.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 };
1077
+ return typeof e?.offsetSize === P && (t && (o = St(e, nt)), n && (r = St(e, nt))), { offsetHeight: o, offsetWidth: r };
1267
1078
  }
1268
- function di(e) {
1269
- l("Reading data from page:", Object.keys(e));
1270
- const { offsetHeight: t, offsetWidth: n } = li(e);
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: 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")
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 ui() {
1094
+ function zs() {
1284
1095
  const { mode: e } = i;
1285
- if (tt(e)) return {};
1096
+ if (Be(e)) return {};
1286
1097
  const t = window.iframeResizer || window.iFrameResizer;
1287
- return ai(t) ? di(t) : {};
1098
+ return Rs(t) ? Ts(t) : {};
1288
1099
  }
1289
- const fi = (e) => e === "true", Tn = (e) => (t) => t === void 0 ? void 0 : e(t), _ = Tn(fi), Z = Tn(Number), mi = (e) => ({
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: Z(e[1]),
1292
- calculateWidth: _(e[2]),
1293
- logging: _(e[3]),
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: _(e[6]),
1106
+ autoResize: L(e[6]),
1296
1107
  bodyMarginStr: e[7],
1297
- heightCalcMode: e[8],
1108
+ // data[8] no longer used (was heightCalcMode)
1298
1109
  bodyBackground: e[9],
1299
1110
  bodyPadding: e[10],
1300
- tolerance: Z(e[11]),
1301
- inPageLinks: _(e[12]),
1111
+ tolerance: G(e[11]),
1112
+ inPageLinks: L(e[12]),
1302
1113
  // data[13] no longer used (was resizeFrom)
1303
- widthCalcMode: e[14],
1304
- mouseEvents: _(e[15]),
1305
- offsetHeight: Z(e[16]),
1306
- offsetWidth: Z(e[17]),
1307
- calculateHeight: _(e[18]),
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: Z(e[21]),
1121
+ mode: G(e[21]),
1311
1122
  // sizeSelector: data[22] // Now only available via page settings
1312
- logExpand: _(e[23])
1123
+ logExpand: L(e[23])
1313
1124
  });
1314
- function hi(e) {
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
- p(
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
- ), nn(o);
1137
+ ), qt(o);
1327
1138
  }
1328
1139
  });
1329
1140
  }
1330
- function Pt(e) {
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 gi({
1145
+ function ks({
1335
1146
  logExpand: e,
1336
1147
  logging: t,
1337
1148
  parentId: n = ""
1338
1149
  }) {
1339
- ho({ id: n, enabled: t, expand: e }), h("initReceived"), l(`Initialising iframe v${x} ${window.location.href}`);
1150
+ Yn({ id: n, enabled: t, expand: e }), g("initReceived"), a(`Initialising iframe v${Y} ${window.location.href}`);
1340
1151
  }
1341
- function pi(e) {
1342
- h("ready"), pn(Kt(e)), l("Initialization complete", (({ key: t, key2: n, ...o }) => o)(i));
1152
+ function Ns(e) {
1153
+ g("ready"), Kt(Ut(e)), a("Initialization complete", (({ key: t, key2: n, ...o }) => o)(i));
1343
1154
  }
1344
- function yi({
1155
+ function Ls({
1345
1156
  bodyBackground: e,
1346
1157
  bodyPadding: t,
1347
1158
  inPageLinks: n,
1348
1159
  onReady: o
1349
1160
  }) {
1350
- const r = Po(i), d = [
1351
- er,
1352
- Qo,
1353
- Zo,
1354
- Yo,
1355
- Ko,
1356
- hr,
1357
- yn,
1358
- pr,
1359
- r ? ue : No,
1360
- () => Js(i),
1361
- () => He("background", e),
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
- () => si(n),
1367
- jr,
1368
- () => $r(i),
1369
- kr,
1370
- () => ss(),
1371
- () => M(
1372
- ve,
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
- `${x}:${i.mode}`
1184
+ `${Y}:${i.mode}`
1377
1185
  ),
1378
- qs,
1379
- F
1186
+ ds,
1187
+ _
1380
1188
  ];
1381
- br(i), ur(i), hi(d), pi(o);
1189
+ To(i), wo(i), As(f), Ns(o);
1382
1190
  }
1383
- function vi(e) {
1384
- s.firstRun && (Pt(mi(e)), gi(i), Pt(ui()), s.applySelectors = Zs(i), yi(i));
1191
+ function Cs(e) {
1192
+ s.firstRun && (Rt(Is(e)), ks(i), Rt(zs()), s.applySelectors = ls(i), Ls(i));
1385
1193
  }
1386
- function bi(e) {
1194
+ function Ps(e) {
1387
1195
  if (document.readyState === "loading") {
1388
- l("Page not ready, ignoring init message");
1196
+ a("Page not ready, ignoring init message");
1389
1197
  return;
1390
1198
  }
1391
- const t = e.data.slice(Yt).split(ye);
1392
- s.target = e.source, s.origin = e.origin, vi(t), s.firstRun = !1, setTimeout(() => {
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
- }, Qt);
1202
+ }, Gt);
1395
1203
  }
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) {
1398
- const t = Re(e);
1399
- l("onMessage called from parent:%c", a, at(t)), Se(i.onMessage, ct(t));
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 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);
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 Oi(e) {
1406
- const { onParentInfo: t } = s, n = at(Re(e));
1407
- l("ParentInfo received from parent:", n), t ? Se(t, n) : An(Dt);
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 $i() {
1217
+ function Hs() {
1410
1218
  if (s.initLock) {
1411
- l("Page reset ignored by init");
1219
+ a("Page reset ignored by init");
1412
1220
  return;
1413
1221
  }
1414
- l("Page size reset by host page"), zn("resetPage");
1222
+ a("Page size reset by host page"), cn("resetPage");
1415
1223
  }
1416
- function Ri() {
1417
- l("Resize requested by host page"), M(Ge, "Parent window requested size check");
1224
+ function Vs() {
1225
+ a("Resize requested by host page"), z(Dt, "Parent window requested size check");
1418
1226
  }
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,
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: Ei,
1427
- parentInfo: Oi,
1428
- message: Si
1234
+ pageInfo: xs,
1235
+ parentInfo: Fs,
1236
+ message: Bs
1429
1237
  };
1430
- function Mi(e) {
1431
- const { firstRun: t } = s, n = wi(e);
1432
- switch (h(n), !0) {
1433
- case n in Lt:
1434
- Lt[n](e);
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 && wo()):
1437
- B(
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
- B(
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 ce = Qe((e) => {
1448
- zo(e) && Mi(e);
1255
+ const te = Fe((e) => {
1256
+ Xn(e) && Gs(e);
1449
1257
  });
1450
- function ki() {
1258
+ function Us() {
1451
1259
  if ("iframeChildListener" in window) {
1452
- B("Already setup");
1260
+ x("Already setup");
1453
1261
  return;
1454
1262
  }
1455
- window.iframeChildListener = ((t) => setTimeout(
1456
- () => ce({ data: t, sameOrigin: !0 })
1457
- )), h("listen"), j(window, Le, ce), j(document, Ht, gt), gt();
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 ce(t), s.win;
1267
+ return te(t), s.win;
1460
1268
  }
1461
1269
  try {
1462
- top?.document?.getElementById("banner") && (s.win = {}, window.mockMsgListener = e, sn(window, Le, ce), typeof window.define == "function" && window.define([], () => 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 !== Yn && ki();
1274
+ typeof window !== Dn && Us();
1467
1275
  //# sourceMappingURL=index.esm.js.map