@iframe-resizer/child 6.0.0-beta.3 → 6.0.0-beta.5

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