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