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