leesto-connect 0.4.0 → 0.6.0

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.
@@ -1,62 +1,62 @@
1
- var nt = "login", rt = "rrweb-buffer", ot = 6e3;
2
- function st(e) {
1
+ var wt = "login", Et = "rrweb-buffer", St = "ambient", _t = 6e3, Tt = 3e3;
2
+ function Rt(e) {
3
3
  return typeof e == "object" && e !== null && typeof e.type == "string" && e.type.startsWith("leesto:");
4
4
  }
5
- var it = [
5
+ var At = [
6
6
  "mask_all",
7
7
  "labels_visible",
8
8
  "inputs_only"
9
- ], ae = "mask_all";
10
- function at(e) {
11
- return typeof e == "string" && it.includes(e);
9
+ ], pe = "mask_all";
10
+ function Lt(e) {
11
+ return typeof e == "string" && At.includes(e);
12
12
  }
13
- var lt = "leesto_diag", ct = "leesto_run", _e = "X-Leesto-Run-Id", ut = "leesto_mask", ft = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
14
- function ee(e) {
15
- return typeof e == "string" && ft.test(e);
13
+ var Ot = "leesto_diag", It = "leesto_run", Be = "X-Leesto-Run-Id", Ct = "leesto_mask", kt = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
14
+ function ie(e) {
15
+ return typeof e == "string" && kt.test(e);
16
16
  }
17
- function dt() {
17
+ function Nt() {
18
18
  try {
19
19
  const e = globalThis.crypto, t = e?.randomUUID?.();
20
- if (ee(t)) return t;
20
+ if (ie(t)) return t;
21
21
  if (!e?.getRandomValues) return;
22
22
  const n = e.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
23
23
  n[6] = (n[6] ?? 0) & 15 | 64, n[8] = (n[8] ?? 0) & 63 | 128;
24
24
  const r = Array.from(n, (s) => s.toString(16).padStart(2, "0")).join(""), o = `${r.slice(0, 8)}-${r.slice(8, 12)}-${r.slice(12, 16)}-${r.slice(16, 20)}-${r.slice(20)}`;
25
- return ee(o) ? o : void 0;
25
+ return ie(o) ? o : void 0;
26
26
  } catch {
27
27
  return;
28
28
  }
29
29
  }
30
- function pt(e) {
30
+ function Mt(e) {
31
31
  try {
32
- const t = new URLSearchParams(e).getAll(ut), [n] = t;
33
- return t.some((r) => r !== n) ? ae : at(n) ? n : ae;
32
+ const t = new URLSearchParams(e).getAll(Ct), [n] = t;
33
+ return t.some((r) => r !== n) ? pe : Lt(n) ? n : pe;
34
34
  } catch {
35
- return ae;
35
+ return pe;
36
36
  }
37
37
  }
38
- function ht(e) {
38
+ function xt(e) {
39
39
  try {
40
- const t = new URLSearchParams(e).get(ct);
41
- return ee(t) ? t : void 0;
40
+ const t = new URLSearchParams(e).get(It);
41
+ return ie(t) ? t : void 0;
42
42
  } catch {
43
43
  return;
44
44
  }
45
45
  }
46
- function de(e) {
46
+ function we(e) {
47
47
  try {
48
- return new URLSearchParams(e).get(lt) === "1";
48
+ return new URLSearchParams(e).get(Ot) === "1";
49
49
  } catch {
50
50
  return !1;
51
51
  }
52
52
  }
53
- function mt(e, t) {
54
- if (de(e)) return e;
53
+ function Dt(e, t) {
54
+ if (we(e)) return e;
55
55
  if (typeof t != "string" || !t.startsWith("leesto-arming?")) return "";
56
56
  const n = `?${t.slice(14)}`;
57
- return de(n) ? n : "";
57
+ return we(n) ? n : "";
58
58
  }
59
- function gt(e) {
59
+ function Ft(e) {
60
60
  try {
61
61
  const t = new URL(e);
62
62
  return `${t.origin}${t.pathname}`;
@@ -64,19 +64,416 @@ function gt(e) {
64
64
  return e.split(/[?#]/)[0] ?? e;
65
65
  }
66
66
  }
67
- var Ae = "leesto/console", yt = "leesto/network", vt = "leesto/network-ring", bt = "leesto/console-ring", wt = {
67
+ var $e = "leesto/console", Pt = "leesto/network", Bt = "leesto/network-ring", $t = "leesto/console-ring", qt = {
68
68
  primary: "#08783f",
69
69
  hover: "#066633",
70
70
  foreground: "#f3fff7"
71
- }, Et = {
71
+ }, Ht = {
72
72
  primary: "#46c383",
73
73
  hover: "#65d49b",
74
74
  foreground: "#082315"
75
- }, St = {
76
- light: wt,
77
- dark: Et
75
+ }, Ut = {
76
+ light: qt,
77
+ dark: Ht
78
+ }, $ = (e) => Math.min(1, Math.max(0, e));
79
+ function Ee(e, [t, n, r]) {
80
+ return e.map((o) => o[0] * t + o[1] * n + o[2] * r);
81
+ }
82
+ var K = (e) => {
83
+ const t = Math.abs(e);
84
+ return t <= 0.04045 ? e / 12.92 : Math.sign(e) * ((t + 0.055) / 1.055) ** 2.4;
85
+ }, he = (e) => {
86
+ const t = Math.abs(e);
87
+ return t <= 31308e-7 ? e * 12.92 : Math.sign(e) * (1.055 * t ** (1 / 2.4) - 0.055);
88
+ }, Gt = [
89
+ [
90
+ 1.2249401762805598,
91
+ -0.22494017628055996,
92
+ 0
93
+ ],
94
+ [
95
+ -0.04205695470968816,
96
+ 1.042056954709688,
97
+ 0
98
+ ],
99
+ [
100
+ -0.019637554590334432,
101
+ -0.07863604555063188,
102
+ 1.0982736001409663
103
+ ]
104
+ ], Wt = [
105
+ [
106
+ 0.955473421488075,
107
+ -0.02309845494876471,
108
+ 0.06325924320057072
109
+ ],
110
+ [
111
+ -0.0283697093338637,
112
+ 1.0099953980813041,
113
+ 0.021041441191917323
114
+ ],
115
+ [
116
+ 0.012314014864481998,
117
+ -0.020507649298898964,
118
+ 1.330365926242124
119
+ ]
120
+ ], Vt = [
121
+ [
122
+ 3.2409699419045226,
123
+ -1.537383177570094,
124
+ -0.4986107602930034
125
+ ],
126
+ [
127
+ -0.9692436362808796,
128
+ 1.8759675015077202,
129
+ 0.04155505740717559
130
+ ],
131
+ [
132
+ 0.05563007969699366,
133
+ -0.20397695888897652,
134
+ 1.0569715142428786
135
+ ]
136
+ ], me = [
137
+ 0.3457 / 0.3585,
138
+ 1,
139
+ 0.2958 / 0.3585
140
+ ];
141
+ function te([e, t, n], r) {
142
+ return {
143
+ r: $(he(e)),
144
+ g: $(he(t)),
145
+ b: $(he(n)),
146
+ a: $(r)
147
+ };
148
+ }
149
+ function qe(e, t, n) {
150
+ const r = (e + 0.3963377774 * t + 0.2158037573 * n) ** 3, o = (e - 0.1055613458 * t - 0.0638541728 * n) ** 3, s = (e - 0.0894841775 * t - 1.291485548 * n) ** 3;
151
+ return [
152
+ 4.0767416621 * r - 3.3077115913 * o + 0.2309699292 * s,
153
+ -1.2684380046 * r + 2.6097574011 * o - 0.3413193965 * s,
154
+ -0.0041960863 * r - 0.7034186147 * o + 1.707614701 * s
155
+ ];
156
+ }
157
+ function He(e, t, n) {
158
+ const r = 903.2962962962963, o = 216 / 24389, s = (e + 16) / 116, u = s + t / 500, a = s - n / 200, i = u ** 3 > o ? u ** 3 : (116 * u - 16) / r, l = e > r * o ? s ** 3 : e / r, c = a ** 3 > o ? a ** 3 : (116 * a - 16) / r, f = [
159
+ i * me[0],
160
+ l * me[1],
161
+ c * me[2]
162
+ ];
163
+ return Ee(Vt, Ee(Wt, f));
164
+ }
165
+ function B(e, t) {
166
+ if (e === void 0) return null;
167
+ if (e === "none") return 0;
168
+ const n = Number.parseFloat(e);
169
+ return Number.isFinite(n) ? e.endsWith("%") ? n / 100 * t : n : null;
170
+ }
171
+ var zt = /^(rgba?|oklch|oklab|lab|lch|color)\((.*)\)$/, jt = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/;
172
+ function Xt(e) {
173
+ const t = e.length <= 4 ? [...e].map((r) => r + r).join("") : e, n = (r) => Number.parseInt(t.slice(r * 2, r * 2 + 2), 16) / 255;
174
+ return {
175
+ r: n(0),
176
+ g: n(1),
177
+ b: n(2),
178
+ a: t.length === 8 ? n(3) : 1
179
+ };
180
+ }
181
+ function Le(e) {
182
+ const t = e.trim().toLowerCase();
183
+ if (t === "transparent") return {
184
+ r: 0,
185
+ g: 0,
186
+ b: 0,
187
+ a: 0
188
+ };
189
+ const n = jt.exec(t);
190
+ if (n) return Xt(n[1] ?? "");
191
+ const r = zt.exec(t);
192
+ if (!r) return null;
193
+ const o = r[1], [s = "", u] = (r[2] ?? "").split("/"), a = s.split(/[\s,]+/).filter(Boolean), i = u?.trim() ?? (o === "color" ? void 0 : a[3]), l = i === void 0 ? 1 : B(i, 1);
194
+ if (l === null) return null;
195
+ if (o === "color") {
196
+ const S = a[0], [v, T, R] = [
197
+ B(a[1], 1),
198
+ B(a[2], 1),
199
+ B(a[3], 1)
200
+ ];
201
+ return v === null || T === null || R === null ? null : S === "srgb" ? {
202
+ r: $(v),
203
+ g: $(T),
204
+ b: $(R),
205
+ a: $(l)
206
+ } : S === "srgb-linear" ? te([
207
+ v,
208
+ T,
209
+ R
210
+ ], l) : S === "display-p3" ? te(Ee(Gt, [
211
+ K(v),
212
+ K(T),
213
+ K(R)
214
+ ]), l) : null;
215
+ }
216
+ if (o === "rgb" || o === "rgba") {
217
+ const [S, v, T] = [
218
+ B(a[0], 255),
219
+ B(a[1], 255),
220
+ B(a[2], 255)
221
+ ];
222
+ return S === null || v === null || T === null ? null : {
223
+ r: $(S / 255),
224
+ g: $(v / 255),
225
+ b: $(T / 255),
226
+ a: $(l)
227
+ };
228
+ }
229
+ const c = o === "lab" || o === "lch", f = B(a[0], c ? 100 : 1);
230
+ if (f === null) return null;
231
+ if (o === "oklab" || o === "lab") {
232
+ const [S, v] = [B(a[1], c ? 125 : 0.4), B(a[2], c ? 125 : 0.4)];
233
+ return S === null || v === null ? null : te(c ? He(f, S, v) : qe(f, S, v), l);
234
+ }
235
+ const [d, h] = [B(a[1], c ? 150 : 0.4), B(a[2], 1)];
236
+ if (d === null || h === null) return null;
237
+ const b = h * Math.PI / 180, [_, A] = [d * Math.cos(b), d * Math.sin(b)];
238
+ return te(c ? He(f, _, A) : qe(f, _, A), l);
239
+ }
240
+ var Kt = /(?:rgba?|oklch|oklab|lab|lch|color)\([^()]*\)|\btransparent\b/g;
241
+ function Yt(e) {
242
+ if (!e.includes("gradient(")) return null;
243
+ const t = (e.toLowerCase().match(Kt) ?? []).map(Le).filter((o) => o !== null);
244
+ if (t.length === 0) return null;
245
+ const n = t.reduce((o, s) => o + s.a, 0);
246
+ if (n === 0) return {
247
+ r: 0,
248
+ g: 0,
249
+ b: 0,
250
+ a: 0
251
+ };
252
+ const r = (o) => t.reduce((s, u) => s + u[o] * u.a, 0) / n;
253
+ return {
254
+ r: r("r"),
255
+ g: r("g"),
256
+ b: r("b"),
257
+ a: n / t.length
258
+ };
259
+ }
260
+ function Se({ r: e, g: t, b: n }) {
261
+ const [r, o, s] = [
262
+ K(e),
263
+ K(t),
264
+ K(n)
265
+ ], u = Math.cbrt(0.4122214708 * r + 0.5363325363 * o + 0.0514459929 * s), a = Math.cbrt(0.2119034982 * r + 0.6806995451 * o + 0.1073969566 * s), i = Math.cbrt(0.0883024619 * r + 0.2817188376 * o + 0.6299787005 * s), l = 0.2104542553 * u + 0.793617785 * a - 0.0040720468 * i, c = 1.9779984951 * u - 2.428592205 * a + 0.4505937099 * i, f = 0.0259040371 * u + 0.7827717662 * a - 0.808675766 * i, d = Math.atan2(f, c) * 180 / Math.PI;
266
+ return {
267
+ L: l,
268
+ C: Math.hypot(c, f),
269
+ H: d < 0 ? d + 360 : d
270
+ };
271
+ }
272
+ var Zt = {
273
+ r: 1,
274
+ g: 1,
275
+ b: 1
276
+ }, Qt = {
277
+ r: 18 / 255,
278
+ g: 18 / 255,
279
+ b: 18 / 255
78
280
  };
79
- function Z(e) {
281
+ function Jt(e, t) {
282
+ return e.includes("dark") && (!e.includes("light") || t) ? Qt : Zt;
283
+ }
284
+ function en(e) {
285
+ const t = [], n = Yt(e.backgroundImage);
286
+ n && n.a > 0 && t.push(n);
287
+ const r = Le(e.backgroundColor);
288
+ return r && r.a > 0 && t.push(r), t;
289
+ }
290
+ function tn(e, t) {
291
+ const n = {
292
+ r: 0,
293
+ g: 0,
294
+ b: 0,
295
+ a: 0
296
+ };
297
+ for (const o of e) {
298
+ const s = (1 - n.a) * o.a;
299
+ n.r += o.r * s, n.g += o.g * s, n.b += o.b * s, n.a += s;
300
+ }
301
+ const r = 1 - n.a;
302
+ return {
303
+ r: n.r + t.r * r,
304
+ g: n.g + t.g * r,
305
+ b: n.b + t.b * r
306
+ };
307
+ }
308
+ function nn(e) {
309
+ const t = e.defaultView;
310
+ if (!t || typeof e.elementsFromPoint != "function") return [];
311
+ const { innerWidth: n, innerHeight: r } = t;
312
+ if (!n || !r) return [];
313
+ const o = Jt(t.getComputedStyle(e.documentElement).colorScheme ?? "", typeof t.matchMedia == "function" && t.matchMedia("(prefers-color-scheme: dark)").matches), s = /* @__PURE__ */ new Map(), u = (i) => {
314
+ let l = s.get(i);
315
+ return l || (l = i.matches("[data-leesto-picker-outline], [data-leesto-capture-cover]") ? [] : en(t.getComputedStyle(i)), s.set(i, l)), l;
316
+ }, a = [];
317
+ for (let i = 0; i < 10; i++) for (let l = 0; l < 16; l++) {
318
+ const c = (l + 0.5) * n / 16, f = (i + 0.5) * r / 10, d = [];
319
+ let h = 0;
320
+ for (const b of e.elementsFromPoint(c, f)) {
321
+ for (const _ of u(b))
322
+ d.push(_), h += (1 - h) * _.a;
323
+ if (h >= 0.95) break;
324
+ }
325
+ a.push(tn(d, o));
326
+ }
327
+ return a;
328
+ }
329
+ function rn(e) {
330
+ const t = e.defaultView, n = [];
331
+ for (const r of e.querySelectorAll('meta[name="theme-color"]')) {
332
+ const o = r.getAttribute("media");
333
+ o && !(typeof t?.matchMedia == "function" && t.matchMedia(o).matches) || n.push(r.content);
334
+ }
335
+ t && n.push(t.getComputedStyle(e.documentElement).getPropertyValue("accent-color"));
336
+ for (const r of n) {
337
+ const o = Le(r);
338
+ if (!o || o.a < 0.95) continue;
339
+ const s = {
340
+ r: o.r,
341
+ g: o.g,
342
+ b: o.b
343
+ };
344
+ if (Se(s).C >= 0.035) return s;
345
+ }
346
+ return null;
347
+ }
348
+ var Ue = (e) => Math.floor(e / 30) % 12;
349
+ function on(e, t = null) {
350
+ if (e.length === 0) return null;
351
+ const n = e.map(Se), r = n.reduce((d, h) => d + h.L, 0) / n.length, o = Math.round(Math.min(1, Math.max(0, r)) * 100) / 100, s = Array.from({ length: 12 }, () => 0), u = Array.from({ length: 12 }, () => 0);
352
+ for (const d of n) {
353
+ if (d.C < 0.035) continue;
354
+ const h = Ue(d.H);
355
+ s[h] = (s[h] ?? 0) + d.C ** 2, u[h] = (u[h] ?? 0) + 1;
356
+ }
357
+ const a = (d, h) => (d[(h + 11) % 12] ?? 0) + (d[h] ?? 0) + (d[(h + 1) % 12] ?? 0);
358
+ let i = null;
359
+ for (let d = 0; d < 12; d++)
360
+ a(u, d) < 4 || (i === null || a(s, d) > a(s, i)) && (i = d);
361
+ if (i === null || a(s, i) < 3e-3) return {
362
+ lightness: o,
363
+ hue: t ? Math.round(Se(t).H) % 360 : null
364
+ };
365
+ const l = /* @__PURE__ */ new Set([
366
+ (i + 11) % 12,
367
+ i,
368
+ (i + 1) % 12
369
+ ]), c = {
370
+ x: 0,
371
+ y: 0
372
+ };
373
+ for (const d of n) {
374
+ if (d.C < 0.035 || !l.has(Ue(d.H))) continue;
375
+ const h = d.C ** 2, b = d.H * Math.PI / 180;
376
+ c.x += h * Math.cos(b), c.y += h * Math.sin(b);
377
+ }
378
+ const f = Math.atan2(c.y, c.x) * 180 / Math.PI;
379
+ return {
380
+ lightness: o,
381
+ hue: Math.round(f + 360) % 360
382
+ };
383
+ }
384
+ function sn(e, t) {
385
+ if (!e || Math.abs(Math.round(e.lightness * 100) - Math.round(t.lightness * 100)) >= 2) return !0;
386
+ if (e.hue === null || t.hue === null) return e.hue !== t.hue;
387
+ const n = Math.abs(e.hue - t.hue) % 360;
388
+ return Math.min(n, 360 - n) >= 10;
389
+ }
390
+ var an = [150, 800], ln = 1e3;
391
+ var cn = 2e3, Ge = [
392
+ "class",
393
+ "style",
394
+ "data-theme",
395
+ "data-mode"
396
+ ];
397
+ function un(e, t = () => on(nn(document), rn(document))) {
398
+ let n = !1, r = !1, o = null, s = Number.NEGATIVE_INFINITY, u = null, a = null, i = null, l = null, c = null;
399
+ const f = /* @__PURE__ */ new Set(), d = () => {
400
+ if (n || document.hidden) return;
401
+ const O = s + 250 - Date.now();
402
+ if (O > 0) {
403
+ u ?? (u = setTimeout(() => {
404
+ u = null, d();
405
+ }, O));
406
+ return;
407
+ }
408
+ s = Date.now();
409
+ let C;
410
+ try {
411
+ C = t();
412
+ } catch {
413
+ return;
414
+ }
415
+ !C || !r && !sn(o, C) || (r = !1, o = C, e(C));
416
+ }, h = (O) => {
417
+ const C = setTimeout(() => {
418
+ f.delete(C), d();
419
+ }, O);
420
+ f.add(C);
421
+ }, b = () => {
422
+ d(), a && clearTimeout(a), a = setTimeout(() => {
423
+ a = null, d();
424
+ }, 250);
425
+ }, _ = () => {
426
+ d(), l && clearTimeout(l), l = setTimeout(() => {
427
+ l = null, d();
428
+ }, ln);
429
+ }, A = () => {
430
+ const O = Date.now();
431
+ c ?? (c = O), i && clearTimeout(i);
432
+ const C = Math.max(0, Math.min(500, c + cn - O));
433
+ i = setTimeout(() => {
434
+ i = null, c = null, d();
435
+ }, C);
436
+ }, S = () => {
437
+ document.hidden || h(0);
438
+ }, v = () => d(), T = typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, R = () => h(0), N = new MutationObserver(_);
439
+ N.observe(document.documentElement, {
440
+ attributes: !0,
441
+ attributeFilter: Ge
442
+ });
443
+ const F = new MutationObserver(A);
444
+ return document.body && (N.observe(document.body, {
445
+ attributes: !0,
446
+ attributeFilter: Ge
447
+ }), F.observe(document.body, {
448
+ subtree: !0,
449
+ childList: !0,
450
+ attributes: !0,
451
+ attributeFilter: ["class", "style"]
452
+ })), document.addEventListener("scroll", b, {
453
+ capture: !0,
454
+ passive: !0
455
+ }), window.addEventListener("resize", b), document.addEventListener("visibilitychange", S), T?.addEventListener("change", R), {
456
+ announce: () => {
457
+ n || (r = !0, document.readyState === "complete" ? d() : window.addEventListener("load", v, { once: !0 }));
458
+ },
459
+ navigated: () => {
460
+ if (!n)
461
+ for (const O of an) h(O);
462
+ },
463
+ stop: () => {
464
+ n = !0;
465
+ for (const O of [
466
+ ...f,
467
+ u,
468
+ a,
469
+ i,
470
+ l
471
+ ]) O && clearTimeout(O);
472
+ f.clear(), N.disconnect(), F.disconnect(), document.removeEventListener("scroll", b, { capture: !0 }), window.removeEventListener("resize", b), document.removeEventListener("visibilitychange", S), window.removeEventListener("load", v), T?.removeEventListener("change", R);
473
+ }
474
+ };
475
+ }
476
+ function ne(e) {
80
477
  const t = [];
81
478
  return {
82
479
  push(n) {
@@ -87,14 +484,14 @@ function Z(e) {
87
484
  }
88
485
  };
89
486
  }
90
- var Rt = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, _t = /\b\d{3}-\d{2}-\d{4}\b/g, At = /\d(?:[ -]?\d){12,18}/g, Tt = /\b(Bearer|Basic|Token)\s+(?=[A-Za-z0-9._~+/=-]*\d)[A-Za-z0-9._~+/=-]{6,}/gi, Lt = /\b((?:proxy-)?authorization)\b(["']?\s*[:=]\s*["']?)(?:Digest\s+[^\r\n]*|(?:(?:Bearer|Basic|Token)\s+)?[^\s"'&,;}]+)/gi, kt = /(token|secret|passw(?:or)?d|api[-_]?key)\b(["']?\s*[:=]\s*["']?)[^\s"'&,;}]+/gi, Ot = /\b((?:set-)?cookie)\b(["']?\s*[:=]\s*["']?)[^"'\r\n]+/gi, It = /\b(session(?:[-_]?id)?)\b(["']?\s*[:=]\s*["']?)(?=[^\s"'&,;}]{0,256}\d)[^\s"'&,;}]+/gi, Ct = /\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g, Nt = /\bhttps?:\/\/[^\s"'<>)]+/gi, xt = /(?::\d+){1,2}$/;
91
- function Mt(e) {
487
+ var fn = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, dn = /\b\d{3}-\d{2}-\d{4}\b/g, pn = /\d(?:[ -]?\d){12,18}/g, hn = /\b(Bearer|Basic|Token)\s+(?=[A-Za-z0-9._~+/=-]*\d)[A-Za-z0-9._~+/=-]{6,}/gi, mn = /\b((?:proxy-)?authorization)\b(["']?\s*[:=]\s*["']?)(?:Digest\s+[^\r\n]*|(?:(?:Bearer|Basic|Token)\s+)?[^\s"'&,;}]+)/gi, gn = /(token|secret|passw(?:or)?d|api[-_]?key)\b(["']?\s*[:=]\s*["']?)[^\s"'&,;}]+/gi, bn = /\b((?:set-)?cookie)\b(["']?\s*[:=]\s*["']?)[^"'\r\n]+/gi, yn = /\b(session(?:[-_]?id)?)\b(["']?\s*[:=]\s*["']?)(?=[^\s"'&,;}]{0,256}\d)[^\s"'&,;}]+/gi, vn = /\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g, wn = /\bhttps?:\/\/[^\s"'<>)]+/gi, En = /(?::\d+){1,2}$/;
488
+ function Sn(e) {
92
489
  const t = e.search(/[?#]/);
93
490
  if (t < 0) return e;
94
- const n = xt.exec(e.slice(t))?.[0] ?? "";
491
+ const n = En.exec(e.slice(t))?.[0] ?? "";
95
492
  return e.slice(0, t) + n;
96
493
  }
97
- function Dt(e) {
494
+ function _n(e) {
98
495
  let t = 0, n = !1;
99
496
  for (let r = e.length - 1; r >= 0; r--) {
100
497
  let o = e.charCodeAt(r) - 48;
@@ -103,54 +500,54 @@ function Dt(e) {
103
500
  }
104
501
  return t % 10 === 0;
105
502
  }
106
- function pe(e) {
503
+ function _e(e) {
107
504
  if (!e) return e;
108
- let t = e.replace(Nt, Mt).replace(Lt, "$1$2[secret masqué]").replace(Tt, "$1 [secret masqué]").replace(Ct, "[jeton masqué]").replace(Ot, "$1$2[secret masqué]").replace(kt, "$1$2[secret masqué]").replace(It, "$1$2[secret masqué]");
109
- return t = t.replace(Rt, "[email masqué]"), t = t.replace(_t, "[id masqué]"), t = t.replace(At, (n) => {
505
+ let t = e.replace(wn, Sn).replace(mn, "$1$2[secret masqué]").replace(hn, "$1 [secret masqué]").replace(vn, "[jeton masqué]").replace(bn, "$1$2[secret masqué]").replace(gn, "$1$2[secret masqué]").replace(yn, "$1$2[secret masqué]");
506
+ return t = t.replace(fn, "[email masqué]"), t = t.replace(dn, "[id masqué]"), t = t.replace(pn, (n) => {
110
507
  const r = n.replace(/[ -]/g, "");
111
- return r.length >= 13 && r.length <= 19 && Dt(r) ? "[carte masquée]" : n;
508
+ return r.length >= 13 && r.length <= 19 && _n(r) ? "[carte masquée]" : n;
112
509
  }), t;
113
510
  }
114
- function W(e) {
511
+ function V(e) {
115
512
  const t = typeof e == "string" ? e : e instanceof URL ? e.href : e instanceof Request ? e.url : String(e);
116
513
  try {
117
514
  const n = new URL(t, typeof location < "u" ? location.href : void 0);
118
- return n.origin + pe(n.pathname);
515
+ return n.origin + _e(n.pathname);
119
516
  } catch {
120
- return pe(t.split("?")[0] ?? t);
517
+ return _e(t.split("?")[0] ?? t);
121
518
  }
122
519
  }
123
- var $t = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]), Pt = ["deprecation", "intervention"], qt = { teardown: () => {
520
+ var Tn = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]), Rn = ["deprecation", "intervention"], An = { teardown: () => {
124
521
  } };
125
- function Bt(e) {
522
+ function Ln(e) {
126
523
  const t = typeof performance < "u" ? performance.timeOrigin : 0;
127
524
  return Math.round(t + e);
128
525
  }
129
- function Ft(e) {
526
+ function On(e) {
130
527
  const t = e.responseStatus;
131
528
  return typeof t == "number" && t > 0 ? t : void 0;
132
529
  }
133
- function Ut(e) {
134
- if ($t.has(e.initiatorType)) return null;
135
- const t = Ft(e), n = e.transferSize || e.encodedBodySize || void 0;
530
+ function In(e) {
531
+ if (Tn.has(e.initiatorType)) return null;
532
+ const t = On(e), n = e.transferSize || e.encodedBodySize || void 0;
136
533
  return {
137
534
  method: "GET",
138
- url: W(e.name),
535
+ url: V(e.name),
139
536
  ...t !== void 0 ? { status: t } : {},
140
537
  durationMs: Math.round(e.duration),
141
538
  ...n ? { responseSize: n } : {},
142
- startedAt: Bt(e.startTime),
539
+ startedAt: Ln(e.startTime),
143
540
  ...t !== void 0 && t >= 400 ? { failed: !0 } : {},
144
541
  initiatorType: e.initiatorType
145
542
  };
146
543
  }
147
- function Gt(e) {
148
- if (typeof window > "u") return qt;
544
+ function Cn(e) {
545
+ if (typeof window > "u") return An;
149
546
  const t = [];
150
547
  if (typeof PerformanceObserver < "u") try {
151
548
  const s = new PerformanceObserver((u) => {
152
- for (const l of u.getEntries()) try {
153
- const i = Ut(l);
549
+ for (const a of u.getEntries()) try {
550
+ const i = In(a);
154
551
  i && e.onResource(i);
155
552
  } catch {
156
553
  }
@@ -164,12 +561,12 @@ function Gt(e) {
164
561
  const n = window.ReportingObserver;
165
562
  if (n) try {
166
563
  const s = new n(((u) => {
167
- for (const l of u) {
168
- const i = typeof l.body?.message == "string" ? l.body.message : l.type;
169
- e.onReport("warn", `Navigateur (${l.type}) : ${i}`);
564
+ for (const a of u) {
565
+ const i = typeof a.body?.message == "string" ? a.body.message : a.type;
566
+ e.onReport("warn", `Navigateur (${a.type}) : ${i}`);
170
567
  }
171
568
  }), {
172
- types: Pt,
569
+ types: Rn,
173
570
  buffered: !0
174
571
  });
175
572
  s.observe(), t.push(() => s.disconnect());
@@ -191,43 +588,43 @@ function Gt(e) {
191
588
  }
192
589
  } };
193
590
  }
194
- var Ht = 50, Wt = 30, jt = 100, zt = 50, K = 500, Pe = 8e3, Vt = K * 4, Xt = Pe * 2;
195
- function qe(e, t, n) {
196
- return pe(e.slice(0, n)).slice(0, t);
591
+ var kn = 50, Nn = 30, Mn = 100, xn = 50, J = 500, tt = 8e3, Dn = J * 4, Fn = tt * 2;
592
+ function nt(e, t, n) {
593
+ return _e(e.slice(0, n)).slice(0, t);
197
594
  }
198
- function V(e) {
199
- return qe(e, K, Vt);
595
+ function Z(e) {
596
+ return nt(e, J, Dn);
200
597
  }
201
- var Kt = /(token|secret|passw(or)?d|api[-_]?key|authorization|cookie)$/i;
202
- function le(e) {
598
+ var Pn = /(token|secret|passw(or)?d|api[-_]?key|authorization|cookie)$/i;
599
+ function ge(e) {
203
600
  const t = e instanceof Error ? e.stack : void 0;
204
601
  if (t)
205
- return qe(t, Pe, Xt);
602
+ return nt(t, tt, Fn);
206
603
  }
207
- function ce(e) {
604
+ function be(e) {
208
605
  if (e instanceof Error) return `${e.name}: ${e.message}`;
209
606
  if (typeof e == "string") return e;
210
607
  if (typeof e == "object" && e !== null) {
211
608
  const t = /* @__PURE__ */ Symbol("overflow");
212
- let n = K * 8;
609
+ let n = J * 8;
213
610
  try {
214
611
  return JSON.stringify(e, (r, o) => {
215
- if (Kt.test(r)) return "[masqué]";
612
+ if (Pn.test(r)) return "[masqué]";
216
613
  if (n -= r.length + (typeof o == "string" ? o.length : 8), n < 0) throw t;
217
614
  return o;
218
- }).slice(0, K);
615
+ }).slice(0, J);
219
616
  } catch (r) {
220
617
  return r === t ? "[objet volumineux]" : "[objet]";
221
618
  }
222
619
  }
223
620
  return String(e);
224
621
  }
225
- function Te(e) {
622
+ function We(e) {
226
623
  if (!e) return;
227
624
  const t = Number(e);
228
625
  return Number.isFinite(t) && t >= 0 ? t : void 0;
229
626
  }
230
- var Yt = {
627
+ var Bn = {
231
628
  snapshot: () => ({
232
629
  errors: [],
233
630
  logs: [],
@@ -240,252 +637,280 @@ var Yt = {
240
637
  teardown: () => {
241
638
  }
242
639
  };
243
- function Be(e) {
244
- if (typeof window > "u") return Yt;
245
- const t = Z(Ht), n = Z(Wt), r = Z(jt), o = Z(zt), s = ee(e.runId) ? e.runId : void 0, u = (f) => {
640
+ function rt(e) {
641
+ if (typeof window > "u") return Bn;
642
+ const t = ne(kn), n = ne(Nn), r = ne(Mn), o = ne(xn), s = ie(e.runId) ? e.runId : void 0, u = (p) => {
246
643
  if (!s) return !1;
247
644
  try {
248
- const p = new URL(String(f), location.href);
249
- return p.origin === location.origin || (e.runIdOrigins ?? []).includes(p.origin);
645
+ const m = new URL(String(p), location.href);
646
+ return m.origin === location.origin || (e.runIdOrigins ?? []).includes(m.origin);
250
647
  } catch {
251
648
  return !1;
252
649
  }
253
650
  };
254
- let l = e.sink ?? null;
255
- const i = (f, p) => {
256
- l?.(f, p);
257
- }, a = (f) => {
258
- e.captureNetwork && t.push(f);
259
- }, c = (f) => {
260
- e.captureNetwork && i(yt, f);
261
- }, d = (f, p, m, E = {}) => {
262
- if (!p) return;
263
- const L = {
264
- level: f,
265
- message: p,
266
- ...m ? { stack: m } : {},
267
- ...E,
651
+ let a = e.sink ?? null;
652
+ const i = (p, m) => {
653
+ a?.(p, m);
654
+ }, l = (p) => {
655
+ e.captureNetwork && t.push(p);
656
+ }, c = (p) => {
657
+ e.captureNetwork && i(Pt, p);
658
+ }, f = (p, m, y, L = {}) => {
659
+ if (!m) return;
660
+ const k = {
661
+ level: p,
662
+ message: m,
663
+ ...y ? { stack: y } : {},
664
+ ...L,
268
665
  at: Date.now()
269
666
  };
270
- o.push(L), i(Ae, L);
271
- }, v = (f, p) => {
667
+ o.push(k), i($e, k);
668
+ }, d = (p, m) => {
272
669
  try {
273
- const m = V(p.map(ce).join(" ")), E = p.find((L) => L instanceof Error);
274
- d(f, m, le(E), {
670
+ const y = Z(m.map(be).join(" ")), L = m.find((k) => k instanceof Error);
671
+ f(p, y, ge(L), {
275
672
  mechanism: "console",
276
- ...E instanceof Error && E.name ? { name: E.name } : {}
673
+ ...L instanceof Error && L.name ? { name: L.name } : {}
277
674
  });
278
675
  } catch {
279
676
  }
280
- }, g = (f, p) => {
677
+ }, h = (p, m) => {
281
678
  try {
282
- const m = V(p.map(ce).join(" "));
283
- m && r.push({
284
- level: f,
285
- message: m,
679
+ const y = Z(m.map(be).join(" "));
680
+ y && r.push({
681
+ level: p,
682
+ message: y,
286
683
  at: Date.now()
287
684
  });
288
685
  } catch {
289
686
  }
290
- }, w = console.error, S = console.warn, R = console.log, _ = console.info;
291
- console.error = (...f) => (v("error", f), w.apply(console, f)), console.warn = (...f) => (v("warn", f), S.apply(console, f)), console.log = (...f) => (g("log", f), R.apply(console, f)), console.info = (...f) => (g("info", f), _.apply(console, f));
292
- const C = (f) => {
293
- const p = f.target;
294
- if (p instanceof Element) {
295
- const E = p.src || p.href || "";
296
- if (!E) return;
297
- d("error", `Ressource non chargée : <${p.tagName.toLowerCase()}> ${W(E)}`.slice(0, K), void 0, {
687
+ }, b = console.error, _ = console.warn, A = console.log, S = console.info;
688
+ console.error = (...p) => (d("error", p), b.apply(console, p)), console.warn = (...p) => (d("warn", p), _.apply(console, p)), console.log = (...p) => (h("log", p), A.apply(console, p)), console.info = (...p) => (h("info", p), S.apply(console, p));
689
+ const v = (p) => {
690
+ const m = p.target;
691
+ if (m instanceof Element) {
692
+ const L = m.src || m.href || "";
693
+ if (!L) return;
694
+ f("error", `Ressource non chargée : <${m.tagName.toLowerCase()}> ${V(L)}`.slice(0, J), void 0, {
298
695
  mechanism: "resource",
299
- sourceUrl: W(E)
696
+ sourceUrl: V(L)
300
697
  });
301
698
  return;
302
699
  }
303
- const m = f;
304
- d("error", V(`Erreur non gérée : ${m.message}`), le(m.error), {
700
+ const y = p;
701
+ f("error", Z(`Erreur non gérée : ${y.message}`), ge(y.error), {
305
702
  mechanism: "window.error",
306
- ...typeof m.error?.name == "string" ? { name: m.error.name } : {},
307
- ...typeof m.filename == "string" && m.filename ? { sourceUrl: W(m.filename) } : {},
308
- ...typeof m.lineno == "number" && m.lineno > 0 ? { line: m.lineno } : {},
309
- ...typeof m.colno == "number" && m.colno > 0 ? { column: m.colno } : {}
703
+ ...typeof y.error?.name == "string" ? { name: y.error.name } : {},
704
+ ...typeof y.filename == "string" && y.filename ? { sourceUrl: V(y.filename) } : {},
705
+ ...typeof y.lineno == "number" && y.lineno > 0 ? { line: y.lineno } : {},
706
+ ...typeof y.colno == "number" && y.colno > 0 ? { column: y.colno } : {}
310
707
  });
311
- }, N = (f) => {
312
- d("error", V(`Promesse rejetée : ${ce(f.reason)}`), le(f.reason), {
708
+ }, T = (p) => {
709
+ f("error", Z(`Promesse rejetée : ${be(p.reason)}`), ge(p.reason), {
313
710
  mechanism: "unhandledrejection",
314
- ...f.reason instanceof Error && f.reason.name ? { name: f.reason.name } : {}
711
+ ...p.reason instanceof Error && p.reason.name ? { name: p.reason.name } : {}
315
712
  });
316
713
  };
317
- window.addEventListener("error", C, !0), window.addEventListener("unhandledrejection", N);
318
- const x = typeof window.fetch == "function" ? window.fetch.bind(window) : null;
319
- x && (window.fetch = (async (f, p) => {
320
- const m = Date.now(), E = (p?.method ?? (f instanceof Request ? f.method : "GET") ?? "GET").toUpperCase(), L = W(f);
321
- let F = p;
322
- if (s && u(f)) {
323
- const A = new Headers(f instanceof Request ? f.headers : void 0);
324
- for (const [T, G] of new Headers(p?.headers)) A.set(T, G);
325
- A.set(_e, s), F = {
326
- ...p,
327
- headers: A
714
+ window.addEventListener("error", v, !0), window.addEventListener("unhandledrejection", T);
715
+ const R = typeof window.fetch == "function" ? window.fetch.bind(window) : null;
716
+ R && (window.fetch = (async (p, m) => {
717
+ const y = Date.now(), L = (m?.method ?? (p instanceof Request ? p.method : "GET") ?? "GET").toUpperCase(), k = V(p);
718
+ let q = m;
719
+ if (s && u(p)) {
720
+ const I = new Headers(p instanceof Request ? p.headers : void 0);
721
+ for (const [P, G] of new Headers(m?.headers)) I.set(P, G);
722
+ I.set(Be, s), q = {
723
+ ...m,
724
+ headers: I
328
725
  };
329
726
  }
330
727
  try {
331
- const A = await x(f, F);
728
+ const I = await R(p, q);
332
729
  try {
333
- const T = A.headers.get("x-request-id"), G = A.headers.get("traceparent");
334
- a({
335
- method: E,
336
- url: L,
337
- status: A.status,
338
- durationMs: Date.now() - m,
339
- responseSize: Te(A.headers.get("content-length")),
340
- contentType: A.headers.get("content-type") ?? void 0,
341
- startedAt: m,
342
- ...T ? { requestId: T.slice(0, 200) } : {},
730
+ const P = I.headers.get("x-request-id"), G = I.headers.get("traceparent");
731
+ l({
732
+ method: L,
733
+ url: k,
734
+ status: I.status,
735
+ durationMs: Date.now() - y,
736
+ responseSize: We(I.headers.get("content-length")),
737
+ contentType: I.headers.get("content-type") ?? void 0,
738
+ startedAt: y,
739
+ ...P ? { requestId: P.slice(0, 200) } : {},
343
740
  ...G ? { traceparent: G.slice(0, 200) } : {},
344
741
  ...s ? { runId: s } : {}
345
- }), A.ok || c({
346
- method: E,
347
- url: L,
348
- status: A.status,
349
- durationMs: Date.now() - m
742
+ }), I.ok || c({
743
+ method: L,
744
+ url: k,
745
+ status: I.status,
746
+ durationMs: Date.now() - y
350
747
  });
351
748
  } catch {
352
749
  }
353
- return A;
354
- } catch (A) {
750
+ return I;
751
+ } catch (I) {
355
752
  try {
356
- const T = Date.now() - m;
357
- a({
358
- method: E,
359
- url: L,
753
+ const P = Date.now() - y;
754
+ l({
755
+ method: L,
756
+ url: k,
360
757
  status: 0,
361
- durationMs: T,
362
- startedAt: m,
758
+ durationMs: P,
759
+ startedAt: y,
363
760
  failed: !0,
364
761
  ...s ? { runId: s } : {}
365
762
  }), c({
366
- method: E,
367
- url: L,
763
+ method: L,
764
+ url: k,
368
765
  status: 0,
369
- durationMs: T
766
+ durationMs: P
370
767
  });
371
768
  } catch {
372
769
  }
373
- throw A;
770
+ throw I;
374
771
  }
375
772
  }));
376
- const P = XMLHttpRequest.prototype.open, M = XMLHttpRequest.prototype.send, $ = "__echoNet";
377
- XMLHttpRequest.prototype.open = function(f, p, ...m) {
378
- return this[$] = {
379
- method: (f || "GET").toUpperCase(),
380
- url: W(p),
773
+ const N = XMLHttpRequest.prototype.open, F = XMLHttpRequest.prototype.send, O = "__echoNet";
774
+ XMLHttpRequest.prototype.open = function(p, m, ...y) {
775
+ return this[O] = {
776
+ method: (p || "GET").toUpperCase(),
777
+ url: V(m),
381
778
  start: 0,
382
- propagate: u(p)
383
- }, P.apply(this, [
384
- f,
779
+ propagate: u(m)
780
+ }, N.apply(this, [
385
781
  p,
386
- ...m
782
+ m,
783
+ ...y
387
784
  ]);
388
- }, XMLHttpRequest.prototype.send = function(...f) {
389
- const p = this[$];
390
- if (p) {
391
- if (p.start = Date.now(), s && p.propagate) try {
392
- this.setRequestHeader(_e, s);
785
+ }, XMLHttpRequest.prototype.send = function(...p) {
786
+ const m = this[O];
787
+ if (m) {
788
+ if (m.start = Date.now(), s && m.propagate) try {
789
+ this.setRequestHeader(Be, s);
393
790
  } catch {
394
791
  }
395
792
  this.addEventListener("loadend", () => {
396
793
  try {
397
- const m = Date.now() - p.start, E = this.status, L = E === 0, F = this.getResponseHeader("x-request-id"), A = this.getResponseHeader("traceparent");
398
- a({
399
- method: p.method,
400
- url: p.url,
401
- status: E,
402
- durationMs: m,
403
- responseSize: Te(this.getResponseHeader("content-length")),
794
+ const y = Date.now() - m.start, L = this.status, k = L === 0, q = this.getResponseHeader("x-request-id"), I = this.getResponseHeader("traceparent");
795
+ l({
796
+ method: m.method,
797
+ url: m.url,
798
+ status: L,
799
+ durationMs: y,
800
+ responseSize: We(this.getResponseHeader("content-length")),
404
801
  contentType: this.getResponseHeader("content-type") ?? void 0,
405
- startedAt: p.start,
406
- ...L ? { failed: !0 } : {},
802
+ startedAt: m.start,
803
+ ...k ? { failed: !0 } : {},
407
804
  ...s ? { runId: s } : {},
408
- ...F ? { requestId: F.slice(0, 200) } : {},
409
- ...A ? { traceparent: A.slice(0, 200) } : {}
410
- }), (L || E >= 400) && c({
411
- method: p.method,
412
- url: p.url,
413
- status: E,
414
- durationMs: m
805
+ ...q ? { requestId: q.slice(0, 200) } : {},
806
+ ...I ? { traceparent: I.slice(0, 200) } : {}
807
+ }), (k || L >= 400) && c({
808
+ method: m.method,
809
+ url: m.url,
810
+ status: L,
811
+ durationMs: y
415
812
  });
416
813
  } catch {
417
814
  }
418
815
  }, { once: !0 });
419
816
  }
420
- return M.apply(this, f);
817
+ return F.apply(this, p);
421
818
  };
422
- const B = Gt({
423
- onResource: (f) => {
819
+ const C = Cn({
820
+ onResource: (p) => {
424
821
  e.captureNetwork && n.push(s ? {
425
- ...f,
822
+ ...p,
426
823
  runId: s
427
- } : f);
824
+ } : p);
428
825
  },
429
- onReport: (f, p) => d(f, V(p), void 0, { mechanism: "report" })
430
- }), D = () => e.captureNetwork ? [...t.snapshot(), ...n.snapshot()].sort((f, p) => f.startedAt - p.startedAt) : [];
431
- let U = !1;
826
+ onReport: (p, m) => f(p, Z(m), void 0, { mechanism: "report" })
827
+ }), Y = () => e.captureNetwork ? [...t.snapshot(), ...n.snapshot()].sort((p, m) => p.startedAt - m.startedAt) : [];
828
+ let j = !1;
432
829
  return {
433
830
  snapshot: () => ({
434
831
  errors: o.snapshot(),
435
832
  logs: r.snapshot(),
436
- network: D(),
833
+ network: Y(),
437
834
  ...s ? { runId: s } : {}
438
835
  }),
439
- setSink: (f) => {
440
- l = f;
836
+ setSink: (p) => {
837
+ a = p;
441
838
  },
442
839
  flushRings: () => {
443
- const f = D();
444
- f.length > 0 && i(vt, { entries: f });
445
- const p = r.snapshot();
446
- p.length > 0 && i(bt, { entries: p });
447
- const m = o.snapshot();
448
- m.length > 0 && i(Ae, { entries: m });
840
+ const p = Y();
841
+ p.length > 0 && i(Bt, { entries: p });
842
+ const m = r.snapshot();
843
+ m.length > 0 && i($t, { entries: m });
844
+ const y = o.snapshot();
845
+ y.length > 0 && i($e, { entries: y });
449
846
  },
450
847
  teardown: () => {
451
- U || (U = !0, l = null, B.teardown(), console.error = w, console.warn = S, console.log = R, console.info = _, window.removeEventListener("error", C, !0), window.removeEventListener("unhandledrejection", N), x && (window.fetch = x), XMLHttpRequest.prototype.open = P, XMLHttpRequest.prototype.send = M);
848
+ j || (j = !0, a = null, C.teardown(), console.error = b, console.warn = _, console.log = A, console.info = S, window.removeEventListener("error", v, !0), window.removeEventListener("unhandledrejection", T), R && (window.fetch = R), XMLHttpRequest.prototype.open = N, XMLHttpRequest.prototype.send = F);
452
849
  }
453
850
  };
454
851
  }
455
- var ge = "leesto-mask", te = "[data-leesto-block]", Fe = "leesto-mask-text", Ue = "[data-private]", Ge = `.${Fe}, ${Ue}`, Zt = 'img, picture, video, canvas, object, embed, svg image, input[type="image"]', Jt = 'button, a, [role="button"], [role="link"], input[type="button"], input[type="submit"], input[type="reset"]';
456
- var He = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select';
457
- function We(e) {
852
+ var $n = "data-leesto-scrollbars", qn = `@supports selector(::-webkit-scrollbar) {
853
+ ::-webkit-scrollbar { width: 10px; height: 10px; }
854
+ ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
855
+ ::-webkit-scrollbar-thumb {
856
+ background-color: rgb(128 128 128 / 0.4);
857
+ background-clip: padding-box;
858
+ border: 3px solid transparent;
859
+ border-radius: 999px;
860
+ }
861
+ }
862
+ @supports not selector(::-webkit-scrollbar) {
863
+ :where(html) { scrollbar-color: rgb(128 128 128 / 0.5) transparent; }
864
+ :where(*) { scrollbar-width: thin; }
865
+ }`;
866
+ function Hn(e) {
867
+ const t = e.createElement("div");
868
+ t.style.cssText = "position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden", e.documentElement.append(t);
869
+ const n = t.offsetWidth - t.clientWidth;
870
+ return t.remove(), n;
871
+ }
872
+ function Un(e = document, t = Hn) {
873
+ if (e.querySelector("style[data-leesto-scrollbars]")) return () => {
874
+ };
875
+ if (t(e) <= 0) return () => {
876
+ };
877
+ const n = e.createElement("style");
878
+ return n.setAttribute($n, ""), n.textContent = qn, (e.head ?? e.documentElement).prepend(n), () => n.remove();
879
+ }
880
+ var Oe = "leesto-mask", ae = "[data-leesto-block]", ot = "leesto-mask-text", st = "[data-private]", it = `.${ot}, ${st}`, Gn = 'img, picture, video, canvas, object, embed, svg image, input[type="image"]', Wn = 'button, a, [role="button"], [role="link"], input[type="button"], input[type="submit"], input[type="reset"]';
881
+ var at = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select';
882
+ function lt(e) {
458
883
  return e.replace(/\S/g, "*");
459
884
  }
460
- function Qt(e, t) {
885
+ function Vn(e, t) {
461
886
  try {
462
887
  return e.closest(t);
463
888
  } catch {
464
889
  return null;
465
890
  }
466
891
  }
467
- function je(e) {
468
- return Qt(e, Ge) !== null;
892
+ function ct(e) {
893
+ return Vn(e, it) !== null;
469
894
  }
470
- var en = `.${ge}, ${te}, ${Ge}`;
471
- function Y(e) {
895
+ var zn = `.${Oe}, ${ae}, ${it}`;
896
+ function ee(e) {
472
897
  try {
473
- return e.closest(en) !== null;
898
+ return e.closest(zn) !== null;
474
899
  } catch {
475
900
  return !0;
476
901
  }
477
902
  }
478
- function ze(e) {
903
+ function ut(e) {
479
904
  if (!e || typeof e.closest != "function") return !1;
480
905
  try {
481
- if (je(e) || e.matches(He)) return !1;
482
- const t = e.closest(Jt);
906
+ if (ct(e) || e.matches(at)) return !1;
907
+ const t = e.closest(Wn);
483
908
  return t ? (t.textContent ?? "").trim().length <= 80 : !1;
484
909
  } catch {
485
910
  return !1;
486
911
  }
487
912
  }
488
- var Le = {
913
+ var Ve = {
489
914
  maskAllInputs: !0,
490
915
  maskInputOptions: {
491
916
  password: !0,
@@ -493,26 +918,26 @@ var Le = {
493
918
  tel: !0,
494
919
  text: !0
495
920
  },
496
- blockClass: ge,
497
- maskTextClass: Fe
921
+ blockClass: Oe,
922
+ maskTextClass: ot
498
923
  };
499
- function Ve(e) {
924
+ function ft(e) {
500
925
  if (e === "inputs_only") return {
501
- ...Le,
502
- blockSelector: te,
503
- maskTextSelector: Ue
926
+ ...Ve,
927
+ blockSelector: ae,
928
+ maskTextSelector: st
504
929
  };
505
930
  const t = {
506
- ...Le,
507
- blockSelector: `${te}, ${Zt}`,
931
+ ...Ve,
932
+ blockSelector: `${ae}, ${Gn}`,
508
933
  maskTextSelector: "*"
509
934
  };
510
935
  return e === "labels_visible" ? {
511
936
  ...t,
512
- maskTextFn: (n, r) => ze(r) ? n : We(n)
937
+ maskTextFn: (n, r) => ut(r) ? n : lt(n)
513
938
  } : t;
514
939
  }
515
- var ke = /* @__PURE__ */ new Set([
940
+ var ze = /* @__PURE__ */ new Set([
516
941
  "placeholder",
517
942
  "title",
518
943
  "alt",
@@ -522,10 +947,10 @@ var ke = /* @__PURE__ */ new Set([
522
947
  "aria-placeholder",
523
948
  "aria-roledescription",
524
949
  "aria-valuetext"
525
- ]), tn = 2, nn = 3, rn = 4, on = 0, sn = 2;
526
- function an(e, t, n) {
950
+ ]), jn = 2, Xn = 3, Kn = 4, Yn = 0, Zn = 2;
951
+ function Qn(e, t, n) {
527
952
  if (e) try {
528
- return e.matches(He);
953
+ return e.matches(at);
529
954
  } catch {
530
955
  return !0;
531
956
  }
@@ -535,47 +960,47 @@ function an(e, t, n) {
535
960
  const o = String(n.type ?? "").toLowerCase();
536
961
  return o !== "button" && o !== "submit" && o !== "reset";
537
962
  }
538
- function Xe(e, t, n) {
963
+ function dt(e, t, n) {
539
964
  const r = e;
540
965
  if (!r || typeof r != "object" || !r.data) return e;
541
- const o = (a) => {
542
- if (typeof a != "number") return null;
966
+ const o = (l) => {
967
+ if (typeof l != "number") return null;
543
968
  try {
544
- const c = n(a);
969
+ const c = n(l);
545
970
  return c && c.nodeType === 1 ? c : null;
546
971
  } catch {
547
972
  return null;
548
973
  }
549
- }, s = (a, c, d, v) => {
974
+ }, s = (l, c, f, d) => {
550
975
  if (c === "value") {
551
- if (an(a, d, v)) return !1;
552
- } else if (!ke.has(c)) return !0;
553
- return !a || je(a) ? !1 : t === "inputs_only" ? !0 : t === "labels_visible" ? ze(a) : !1;
554
- }, u = (a, c, d) => {
555
- if (d)
556
- for (const v of Object.keys(d)) {
557
- const g = d[v];
558
- typeof g != "string" || !g || v !== "value" && !ke.has(v) || s(a, v, c, d) || (d[v] = We(g));
976
+ if (Qn(l, f, d)) return !1;
977
+ } else if (!ze.has(c)) return !0;
978
+ return !l || ct(l) ? !1 : t === "inputs_only" ? !0 : t === "labels_visible" ? ut(l) : !1;
979
+ }, u = (l, c, f) => {
980
+ if (f)
981
+ for (const d of Object.keys(f)) {
982
+ const h = f[d];
983
+ typeof h != "string" || !h || d !== "value" && !ze.has(d) || s(l, d, c, f) || (f[d] = lt(h));
559
984
  }
560
- }, l = (a) => {
561
- const c = a ? [a] : [];
985
+ }, a = (l) => {
986
+ const c = l ? [l] : [];
562
987
  for (; c.length > 0; ) {
563
- const d = c.pop();
564
- d.type === sn && d.attributes && u(o(d.id), String(d.tagName ?? ""), d.attributes), Array.isArray(d.childNodes) && c.push(...d.childNodes);
988
+ const f = c.pop();
989
+ f.type === Zn && f.attributes && u(o(f.id), String(f.tagName ?? ""), f.attributes), Array.isArray(f.childNodes) && c.push(...f.childNodes);
565
990
  }
566
991
  }, i = r.data;
567
- if (r.type === rn && typeof i.href == "string") i.href = gt(i.href);
568
- else if (r.type === tn) l(i.node);
569
- else if (r.type === nn && i.source === on) {
570
- for (const a of i.adds ?? []) l(a.node);
571
- for (const a of i.attributes ?? []) {
572
- const c = o(a.id);
573
- u(c, c?.tagName ?? "", a.attributes);
992
+ if (r.type === Kn && typeof i.href == "string") i.href = Ft(i.href);
993
+ else if (r.type === jn) a(i.node);
994
+ else if (r.type === Xn && i.source === Yn) {
995
+ for (const l of i.adds ?? []) a(l.node);
996
+ for (const l of i.attributes ?? []) {
997
+ const c = o(l.id);
998
+ u(c, c?.tagName ?? "", l.attributes);
574
999
  }
575
1000
  }
576
1001
  return e;
577
1002
  }
578
- var ln = 80, cn = {
1003
+ var Jn = 80, er = {
579
1004
  a: "link",
580
1005
  button: "button",
581
1006
  img: "img",
@@ -588,50 +1013,50 @@ var ln = 80, cn = {
588
1013
  h5: "heading",
589
1014
  h6: "heading",
590
1015
  dialog: "dialog"
591
- }, un = {
1016
+ }, tr = {
592
1017
  button: "button",
593
1018
  submit: "button",
594
1019
  reset: "button",
595
1020
  checkbox: "checkbox",
596
1021
  radio: "radio",
597
1022
  search: "searchbox"
598
- }, H = (e) => {
1023
+ }, W = (e) => {
599
1024
  const t = (e ?? "").replace(/\s+/g, " ").trim();
600
- return t ? t.slice(0, ln) : null;
1025
+ return t ? t.slice(0, Jn) : null;
601
1026
  };
602
- function fn(e) {
1027
+ function nr(e) {
603
1028
  const t = [];
604
1029
  let n = 0;
605
1030
  const r = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT);
606
1031
  for (let o = r.nextNode(); o && n < 320; o = r.nextNode()) {
607
1032
  const s = o.parentElement;
608
- if (s && s !== e && Y(s)) continue;
1033
+ if (s && s !== e && ee(s)) continue;
609
1034
  const u = o.nodeValue ?? "";
610
1035
  u.trim() && (t.push(u), n += u.length);
611
1036
  }
612
1037
  return t.join(" ");
613
1038
  }
614
- function dn(e, t) {
1039
+ function rr(e, t) {
615
1040
  const n = e.getAttribute("role")?.trim().split(/\s+/)[0];
616
- return n || (t === "input" ? un[e.type] ?? "textbox" : t === "a" && !e.hasAttribute("href") ? null : cn[t] ?? null);
1041
+ return n || (t === "input" ? tr[e.type] ?? "textbox" : t === "a" && !e.hasAttribute("href") ? null : er[t] ?? null);
617
1042
  }
618
- function pn(e) {
1043
+ function or(e) {
619
1044
  const t = (e.getAttribute("aria-labelledby")?.split(/\s+/).filter(Boolean) ?? []).map((n) => {
620
1045
  const r = e.ownerDocument.getElementById(n);
621
- return r && !Y(r) ? r.textContent ?? "" : "";
1046
+ return r && !ee(r) ? r.textContent ?? "" : "";
622
1047
  });
623
- return H(t.join(" "));
1048
+ return W(t.join(" "));
624
1049
  }
625
- function hn(e, t) {
626
- const n = H(e.getAttribute("aria-label")) ?? pn(e) ?? (t === "img" ? H(e.getAttribute("alt")) : null) ?? H(e.getAttribute("title"));
1050
+ function sr(e, t) {
1051
+ const n = W(e.getAttribute("aria-label")) ?? or(e) ?? (t === "img" ? W(e.getAttribute("alt")) : null) ?? W(e.getAttribute("title"));
627
1052
  if (n) return n;
628
1053
  if (t === "input" || t === "textarea" || t === "select") {
629
- const r = e.getAttribute("id"), o = r ? e.ownerDocument.querySelector(`label[for="${CSS.escape(r)}"]`) : null, s = o && !Y(o) ? o.textContent : null;
630
- return H(s) ?? H(e.getAttribute("placeholder"));
1054
+ const r = e.getAttribute("id"), o = r ? e.ownerDocument.querySelector(`label[for="${CSS.escape(r)}"]`) : null, s = o && !ee(o) ? o.textContent : null;
1055
+ return W(s) ?? W(e.getAttribute("placeholder"));
631
1056
  }
632
- return H(fn(e));
1057
+ return W(nr(e));
633
1058
  }
634
- function mn(e) {
1059
+ function ir(e) {
635
1060
  if (!e) return null;
636
1061
  try {
637
1062
  const t = new URL(e, document.baseURI);
@@ -640,29 +1065,52 @@ function mn(e) {
640
1065
  return null;
641
1066
  }
642
1067
  }
643
- function gn(e) {
644
- const t = e.tagName.toLowerCase(), n = Y(e), r = {
1068
+ function ar(e) {
1069
+ const t = e.tagName.toLowerCase(), n = ee(e), r = {
645
1070
  tag: t,
646
- role: dn(e, t),
647
- name: n ? null : hn(e, t)
1071
+ role: rr(e, t),
1072
+ name: n ? null : sr(e, t)
648
1073
  };
649
1074
  return e instanceof HTMLImageElement && (r.image = {
650
- src: n ? null : mn(e.currentSrc || e.getAttribute("src") || ""),
1075
+ src: n ? null : ir(e.currentSrc || e.getAttribute("src") || ""),
651
1076
  loaded: e.complete && e.naturalWidth > 0
652
1077
  }), r;
653
1078
  }
654
- var yn = 100, vn = [
1079
+ var lr = /\b(se deconnecter|deconnexion|log ?out|sign ?out)\b/, cr = /\/(logout|log-out|signout|sign-out|deconnexion)\b/i, ur = 'a, button, [role="button"], [role="menuitem"], input[type="submit"], input[type="button"]', fr = 3;
1080
+ function Te(e) {
1081
+ return (e ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/\s+/g, " ").trim().toLowerCase();
1082
+ }
1083
+ function dr(e) {
1084
+ const t = e.getAttribute("aria-label");
1085
+ return t || (e instanceof HTMLInputElement ? e.value : e.textContent ?? "");
1086
+ }
1087
+ function pr(e) {
1088
+ for (const t of Array.from(e.querySelectorAll(ur))) {
1089
+ if (lr.test(Te(dr(t)))) return !0;
1090
+ const n = t.getAttribute("href");
1091
+ if (n && cr.test(n)) return !0;
1092
+ }
1093
+ return !1;
1094
+ }
1095
+ function hr(e, t) {
1096
+ const n = Te(t);
1097
+ return n.length < fr || !e.body ? !1 : Te(e.body.innerText ?? e.body.textContent).includes(n);
1098
+ }
1099
+ function mr(e, t) {
1100
+ return hr(e, t) ? "same-account" : pr(e) ? "signed-in" : "unknown";
1101
+ }
1102
+ var gr = 100, br = 800, yr = [
655
1103
  "hidden",
656
1104
  "class",
657
1105
  "style",
658
1106
  "type",
659
1107
  "disabled",
660
1108
  "aria-hidden"
661
- ], oe = 'input[type="password"]', Ke = 'input[autocomplete="username"], input[autocomplete="email"], input[type="email"]', se = `${oe}, ${Ke}`, ne = /\b(connexion|se connecter|connectez[- ]vous|s'identifier|identifiez[- ]vous|login|log ?in|sign ?in)\b/, he = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|register|create (an |your )?account|mot de passe oublie|oublie|reinitialiser|forgot|reset|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|code|newsletter|abonner|subscribe|enregistrer|sauvegarder|mettre a jour|save|update|confirmer|confirm|supprimer mon compte|delete account|payer|pay)\b/, bn = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|create (an |your )?account|mot de passe oublie|reinitialiser|forgot|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|newsletter|abonner|subscribe)\b/, wn = /\b(afficher|masquer|voir|show|hide|toggle)\b/, En = /\b(effacer|vider|supprimer|clear|reset)\b/, Sn = /[\u{1F441}\u{1F576}\u{1F440}]/u;
662
- function X(e) {
1109
+ ], ue = 'input[type="password"]', pt = 'input[autocomplete="username"], input[autocomplete="email"], input[type="email"]', fe = `${ue}, ${pt}`, le = /\b(connexion|se connecter|connectez[- ]vous|s'identifier|identifiez[- ]vous|login|log ?in|sign ?in)\b/, Re = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|register|create (an |your )?account|mot de passe oublie|oublie|reinitialiser|forgot|reset|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|code|newsletter|abonner|subscribe|enregistrer|sauvegarder|mettre a jour|save|update|confirmer|confirm|supprimer mon compte|delete account|payer|pay)\b/, vr = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|create (an |your )?account|mot de passe oublie|reinitialiser|forgot|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|newsletter|abonner|subscribe)\b/, wr = /\b(afficher|masquer|voir|show|hide|toggle)\b/, Er = /\b(effacer|vider|supprimer|clear|reset)\b/, Sr = /[\u{1F441}\u{1F576}\u{1F440}]/u;
1110
+ function Q(e) {
663
1111
  return (e ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[’‘]/g, "'").replace(/\s+/g, " ").trim().toLowerCase();
664
1112
  }
665
- function ie(e) {
1113
+ function de(e) {
666
1114
  let t = e;
667
1115
  for (; t; ) {
668
1116
  if (t.hasAttribute("hidden") || t.getAttribute("aria-hidden") === "true" || t instanceof HTMLInputElement && t.type === "hidden") return !1;
@@ -672,43 +1120,43 @@ function ie(e) {
672
1120
  }
673
1121
  return !0;
674
1122
  }
675
- function j(e, t) {
676
- return Array.from(e.querySelectorAll(t)).filter(ie);
1123
+ function z(e, t) {
1124
+ return Array.from(e.querySelectorAll(t)).filter(de);
677
1125
  }
678
- function Rn(e) {
1126
+ function _r(e) {
679
1127
  return e ? e instanceof HTMLInputElement ? e.value : e.textContent ?? "" : "";
680
1128
  }
681
- function Ye(e, t) {
1129
+ function ht(e, t) {
682
1130
  return !e.outsideForms || !t.closest("form");
683
1131
  }
684
- function J(e, t) {
685
- return Array.from(e.scope.querySelectorAll(t)).filter((n) => ie(n) && Ye(e, n));
1132
+ function re(e, t) {
1133
+ return Array.from(e.scope.querySelectorAll(t)).filter((n) => de(n) && ht(e, n));
686
1134
  }
687
- function re(e) {
688
- return X(e.getAttribute("aria-label") ?? e.getAttribute("title") ?? e.textContent);
1135
+ function ce(e) {
1136
+ return Q(e.getAttribute("aria-label") ?? e.getAttribute("title") ?? e.textContent);
689
1137
  }
690
- function _n(e) {
691
- const t = re(e);
692
- return wn.test(t) || Sn.test(t);
1138
+ function Tr(e) {
1139
+ const t = ce(e);
1140
+ return wr.test(t) || Sr.test(t);
693
1141
  }
694
- function An(e, t) {
1142
+ function Rr(e, t) {
695
1143
  if (e.getAttribute("type") === "submit" || !t) return !1;
696
1144
  const n = e.parentElement;
697
- return !n || j(n, se).length === 0 ? !1 : !n.contains(t);
1145
+ return !n || z(n, fe).length === 0 ? !1 : !n.contains(t);
698
1146
  }
699
- var Tn = 'button, input[type="submit"], input[type="button"], input[type="image"], a[href]';
700
- function Ln(e) {
701
- return Array.from(e.querySelectorAll(Tn)).some(ie);
1147
+ var Ar = 'button, input[type="submit"], input[type="button"], input[type="image"], a[href]';
1148
+ function Lr(e) {
1149
+ return Array.from(e.querySelectorAll(Ar)).some(de);
702
1150
  }
703
- function kn(e, t) {
1151
+ function Or(e, t) {
704
1152
  let n = e.parentElement;
705
1153
  for (; n && !n.contains(t); ) {
706
- if (Ln(n)) return !0;
1154
+ if (Lr(n)) return !0;
707
1155
  n = n.parentElement;
708
1156
  }
709
1157
  return !1;
710
1158
  }
711
- function On(e) {
1159
+ function Ir(e) {
712
1160
  const t = [
713
1161
  e.getAttribute("name"),
714
1162
  e.getAttribute("id"),
@@ -720,150 +1168,150 @@ function On(e) {
720
1168
  const r = e.ownerDocument.querySelector(`label[for="${CSS.escape(n)}"]`);
721
1169
  r && t.push(r.textContent);
722
1170
  }
723
- return X(t.filter(Boolean).join(" "));
1171
+ return Q(t.filter(Boolean).join(" "));
724
1172
  }
725
- function In(e, t) {
1173
+ function Cr(e, t) {
726
1174
  const n = e.parentElement;
727
1175
  if (!n) return null;
728
- const r = e.ownerDocument.body, o = (c) => t ? Ze({
1176
+ const r = e.ownerDocument.body, o = (c) => t ? mt({
729
1177
  scope: c,
730
1178
  outsideForms: !0
731
- }, t) : e, s = (c) => me({
1179
+ }, t) : e, s = (c) => Ae({
732
1180
  scope: c,
733
1181
  outsideForms: !0
734
1182
  }, e, o(c)), u = (c) => !!o(c) && !!s(c);
735
- let l = n, i = null;
736
- const a = (c) => {
737
- const d = s(c);
738
- d && !i && ne.test(re(d)) && (i = c);
1183
+ let a = n, i = null;
1184
+ const l = (c) => {
1185
+ const f = s(c);
1186
+ f && !i && le.test(ce(f)) && (i = c);
739
1187
  };
740
- for (a(n); l !== r && !u(l); ) {
741
- const c = l.parentElement;
1188
+ for (l(n); a !== r && !u(a); ) {
1189
+ const c = a.parentElement;
742
1190
  if (!c || c.querySelector("form")) break;
743
- const d = [e], v = o(l);
744
- v && v !== e && d.push(v);
745
- const g = !!v;
746
- if (j(c, se).filter((w) => !w.closest("form") && !d.includes(w)).some((w) => w.matches(oe) || g || he.test(On(w)) ? !0 : kn(w, e))) break;
747
- l = c, a(c);
1191
+ const f = [e], d = o(a);
1192
+ d && d !== e && f.push(d);
1193
+ const h = !!d;
1194
+ if (z(c, fe).filter((b) => !b.closest("form") && !f.includes(b)).some((b) => b.matches(ue) || h || Re.test(Ir(b)) ? !0 : Or(b, e))) break;
1195
+ a = c, l(c);
748
1196
  }
749
1197
  return {
750
- scope: u(l) ? l : i ?? n,
1198
+ scope: u(a) ? a : i ?? n,
751
1199
  outsideForms: !0
752
1200
  };
753
1201
  }
754
- function Oe(e, t, n) {
1202
+ function je(e, t, n) {
755
1203
  return e ? {
756
1204
  scope: e,
757
1205
  outsideForms: !1
758
- } : In(t, n);
1206
+ } : Cr(t, n);
759
1207
  }
760
- function Cn(e, t) {
1208
+ function kr(e, t) {
761
1209
  let n = e.parentElement;
762
1210
  for (; n && n !== t.scope; ) {
763
- if (j(n, se).length === 1) return !0;
1211
+ if (z(n, fe).length === 1) return !0;
764
1212
  n = n.parentElement;
765
1213
  }
766
1214
  return !1;
767
1215
  }
768
- function me(e, t, n) {
769
- const r = (i) => !!(t.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_FOLLOWING), o = Array.from(e.scope.querySelectorAll('button, input[type="submit"]')).filter((i) => ie(i) && Ye(e, i) && (i.getAttribute("type") === "submit" || r(i)) && !_n(i) && !En.test(re(i)) && !An(i, n));
1216
+ function Ae(e, t, n) {
1217
+ const r = (i) => !!(t.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_FOLLOWING), o = Array.from(e.scope.querySelectorAll('button, input[type="submit"]')).filter((i) => de(i) && ht(e, i) && (i.getAttribute("type") === "submit" || r(i)) && !Tr(i) && !Er.test(ce(i)) && !Rr(i, n));
770
1218
  if (o.length === 0) return null;
771
- const s = (i, a) => {
1219
+ const s = (i, l) => {
772
1220
  const c = r(i);
773
1221
  return [
774
- Cn(i, e) ? 1 : 0,
775
- ne.test(re(i)) ? 0 : 1,
1222
+ kr(i, e) ? 1 : 0,
1223
+ le.test(ce(i)) ? 0 : 1,
776
1224
  i.getAttribute("type") === "submit" ? 0 : 1,
777
1225
  c ? 0 : 1,
778
- c ? a : -a
1226
+ c ? l : -l
779
1227
  ];
780
1228
  };
781
- let u = o[0], l = s(u, 0);
782
- return o.forEach((i, a) => {
783
- const c = s(i, a);
784
- for (let d = 0; d < c.length; d++) {
785
- const v = c[d], g = l[d];
786
- if (v !== g) {
787
- v < g && (u = i, l = c);
1229
+ let u = o[0], a = s(u, 0);
1230
+ return o.forEach((i, l) => {
1231
+ const c = s(i, l);
1232
+ for (let f = 0; f < c.length; f++) {
1233
+ const d = c[f], h = a[f];
1234
+ if (d !== h) {
1235
+ d < h && (u = i, a = c);
788
1236
  return;
789
1237
  }
790
1238
  }
791
1239
  }), u;
792
1240
  }
793
- function Ie(e) {
794
- return e.querySelectorAll("form").length + (j(e, se).some((t) => !t.closest("form")) ? 1 : 0) === 1;
1241
+ function Xe(e) {
1242
+ return e.querySelectorAll("form").length + (z(e, fe).some((t) => !t.closest("form")) ? 1 : 0) === 1;
795
1243
  }
796
- function Nn(e, t) {
1244
+ function Nr(e, t) {
797
1245
  if (e) {
798
1246
  const n = e.getAttribute("aria-label");
799
1247
  if (n) return n;
800
1248
  const r = e.getAttribute("aria-labelledby");
801
1249
  if (r) {
802
- const l = e.ownerDocument.getElementById(r);
803
- if (l) return l.textContent ?? "";
1250
+ const a = e.ownerDocument.getElementById(r);
1251
+ if (a) return a.textContent ?? "";
804
1252
  }
805
1253
  const o = e.querySelector("h1, h2, h3, legend");
806
1254
  if (o) return o.textContent ?? "";
807
1255
  let s = e.previousElementSibling;
808
1256
  for (; s; ) {
809
- const l = /^(h1|h2|h3|legend)$/i.test(s.tagName) ? s : s.querySelector("h1, h2, h3, legend");
810
- if (l) {
1257
+ const a = /^(h1|h2|h3|legend)$/i.test(s.tagName) ? s : s.querySelector("h1, h2, h3, legend");
1258
+ if (a) {
811
1259
  const i = e.parentElement;
812
- return i && Ie(i) ? l.textContent ?? "" : "";
1260
+ return i && Xe(i) ? a.textContent ?? "" : "";
813
1261
  }
814
1262
  s = s.previousElementSibling;
815
1263
  }
816
1264
  const u = e.closest("section, article, aside, dialog, fieldset, [role='dialog'], [role='region']");
817
1265
  if (u && u !== e) {
818
- const l = u.querySelector("h1, h2, h3, legend");
819
- if (l)
820
- return Ie(u) ? l.textContent ?? "" : "";
1266
+ const a = u.querySelector("h1, h2, h3, legend");
1267
+ if (a)
1268
+ return Xe(u) ? a.textContent ?? "" : "";
821
1269
  }
822
1270
  return "";
823
1271
  }
824
1272
  return (t instanceof Document ? t.body : t)?.querySelector("h1, h2, h3")?.textContent ?? "";
825
1273
  }
826
- function Ce(e, t, n) {
827
- const r = X(Rn(n)), o = X(Nn(e, t)), s = (e?.getAttribute("action") ?? "").split("?")[0], u = X([
1274
+ function Ke(e, t, n) {
1275
+ const r = Q(_r(n)), o = Q(Nr(e, t)), s = (e?.getAttribute("action") ?? "").split("?")[0], u = Q([
828
1276
  e?.id,
829
1277
  e?.getAttribute("name"),
830
1278
  e?.className,
831
1279
  s
832
1280
  ].filter(Boolean).join(" "));
833
1281
  return {
834
- positive: ne.test(r) || ne.test(o),
835
- negative: he.test(r) || he.test(o) || bn.test(u)
1282
+ positive: le.test(r) || le.test(o),
1283
+ negative: Re.test(r) || Re.test(o) || vr.test(u)
836
1284
  };
837
1285
  }
838
- function Ze(e, t) {
839
- const n = J(e, 'input[autocomplete="username"]')[0] ?? J(e, 'input[autocomplete="email"]')[0] ?? J(e, 'input[type="email"]')[0];
1286
+ function mt(e, t) {
1287
+ const n = re(e, 'input[autocomplete="username"]')[0] ?? re(e, 'input[autocomplete="email"]')[0] ?? re(e, 'input[type="email"]')[0];
840
1288
  if (n) return n;
841
1289
  if (!t) return null;
842
- const r = J(e, 'input[type="text"], input:not([type])').filter((o) => o.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
1290
+ const r = re(e, 'input[type="text"], input:not([type])').filter((o) => o.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
843
1291
  return r[r.length - 1] ?? null;
844
1292
  }
845
- function ue(e, t) {
1293
+ function ye(e, t) {
846
1294
  if (t.querySelector('input[autocomplete="new-password"]')) return null;
847
- const n = j(t, oe);
1295
+ const n = z(t, ue);
848
1296
  if (n.length > 1) return null;
849
1297
  if (n.length === 1) {
850
- const i = n[0], a = Oe(e, i, i);
851
- if (!a) return null;
852
- const c = Ze(a, i), d = me(a, i, c), v = Ce(e, t, d);
853
- return !(i.autocomplete === "current-password" || v.positive) || v.negative ? null : {
1298
+ const i = n[0], l = je(e, i, i);
1299
+ if (!l) return null;
1300
+ const c = mt(l, i), f = Ae(l, i, c), d = Ke(e, t, f);
1301
+ return !(i.autocomplete === "current-password" || d.positive) || d.negative ? null : {
854
1302
  kind: "password",
855
1303
  form: e,
856
1304
  identifier: c,
857
1305
  password: i,
858
- submit: d
1306
+ submit: f
859
1307
  };
860
1308
  }
861
- const r = j(t, Ke);
1309
+ const r = z(t, pt);
862
1310
  if (r.length !== 1) return null;
863
- const o = r[0], s = Oe(e, o, null);
1311
+ const o = r[0], s = je(e, o, null);
864
1312
  if (!s) return null;
865
- const u = me(s, o, o), l = Ce(e, t, u);
866
- return !(o.autocomplete === "username" || l.positive) || l.negative ? null : {
1313
+ const u = Ae(s, o, o), a = Ke(e, t, u);
1314
+ return !(o.autocomplete === "username" || a.positive) || a.negative ? null : {
867
1315
  kind: "identifier",
868
1316
  form: e,
869
1317
  identifier: o,
@@ -871,22 +1319,22 @@ function ue(e, t) {
871
1319
  submit: u
872
1320
  };
873
1321
  }
874
- function Ne(e = document) {
1322
+ function oe(e = document) {
875
1323
  const t = Array.from(e.querySelectorAll("form"));
876
1324
  for (const n of t) {
877
- const r = ue(n, n);
1325
+ const r = ye(n, n);
878
1326
  if (r) return r;
879
1327
  }
880
- return t.length === 0 || j(e, oe).find((n) => !n.closest("form")) ? ue(null, e) : null;
1328
+ return t.length === 0 || z(e, ue).find((n) => !n.closest("form")) ? ye(null, e) : null;
881
1329
  }
882
- function xe(e, t) {
1330
+ function Ye(e, t) {
883
1331
  const n = Object.getPrototypeOf(e), r = Object.getOwnPropertyDescriptor(n, "value")?.set ?? Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
884
1332
  r ? r.call(e, t) : e.value = t, e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
885
1333
  }
886
- function xn(e) {
1334
+ function Mr(e) {
887
1335
  return !!e.form || !!e.submit;
888
1336
  }
889
- function Mn(e) {
1337
+ function xr(e) {
890
1338
  const t = e.form, n = t?.noValidate;
891
1339
  t && (t.noValidate = !0);
892
1340
  try {
@@ -895,28 +1343,28 @@ function Mn(e) {
895
1343
  t && (t.noValidate = n ?? !1);
896
1344
  }
897
1345
  }
898
- var Dn = {
1346
+ var Dr = {
899
1347
  identifier: null,
900
1348
  password: null
901
1349
  };
902
- function Me(e, t) {
1350
+ function Ze(e, t) {
903
1351
  return !e || e.disabled || e.readOnly ? !1 : e.value === "" || t !== null && e.value === t;
904
1352
  }
905
- function Je(e, t, n) {
1353
+ function gt(e, t, n) {
906
1354
  return {
907
- identifier: Me(e.identifier, n.identifier) && !t.identifier,
908
- password: Me(e.password, n.password) && !t.password
1355
+ identifier: Ze(e.identifier, n.identifier) && !t.identifier,
1356
+ password: Ze(e.password, n.password) && !t.password
909
1357
  };
910
1358
  }
911
- function $n(e, t, n) {
1359
+ function Fr(e, t, n) {
912
1360
  const r = e.identifier;
913
1361
  return !r || n.identifier ? !1 : r.value !== "" && r.value !== t.login;
914
1362
  }
915
- function Pn(e, t, n, r = Dn) {
916
- const o = Je(e, n, r);
917
- return !o.identifier && !o.password ? { error: "nothing-to-fill" } : $n(e, t, o) ? { error: "identifier-mismatch" } : xn(e) ? (o.identifier && xe(e.identifier, t.login), o.password && xe(e.password, t.password), Mn(e) ? { step: o.identifier && o.password ? "both" : o.password ? "password" : "identifier" } : { error: "no-submit" }) : { error: "no-submit" };
1363
+ function Pr(e, t, n, r = Dr) {
1364
+ const o = gt(e, n, r);
1365
+ return !o.identifier && !o.password ? { error: "nothing-to-fill" } : Fr(e, t, o) ? { error: "identifier-mismatch" } : Mr(e) ? (o.identifier && Ye(e.identifier, t.login), o.password && Ye(e.password, t.password), xr(e) ? { step: o.identifier && o.password ? "both" : o.password ? "password" : "identifier" } : { error: "no-submit" }) : { error: "no-submit" };
918
1366
  }
919
- function qn(e) {
1367
+ function Br(e) {
920
1368
  if (typeof window > "u" || typeof MutationObserver > "u") return {
921
1369
  watch() {
922
1370
  },
@@ -933,127 +1381,138 @@ function qn(e) {
933
1381
  }, r = {
934
1382
  identifier: null,
935
1383
  password: null
936
- }, o = !1, s = null, u = null, l = null;
937
- const i = () => {
938
- l && clearTimeout(l), l = null;
939
- }, a = () => {
940
- s?.disconnect(), s = null, i(), u && clearTimeout(u), u = null;
941
- }, c = () => {
942
- const g = Ne(document);
943
- if (!g) {
1384
+ }, o = !1, s = null, u = null, a = null, i = null, l = 0;
1385
+ const c = () => {
1386
+ a && clearTimeout(a), a = null;
1387
+ }, f = () => {
1388
+ i && clearTimeout(i), i = null, l = 0;
1389
+ }, d = () => {
1390
+ if (i = null, l = 0, !t || n.identifier || n.password || oe(document)) return;
1391
+ const v = mr(document, t.login);
1392
+ t = null, e.onNoForm(v);
1393
+ }, h = () => {
1394
+ if (!l) return;
1395
+ i && clearTimeout(i);
1396
+ const v = Math.max(0, l - Date.now());
1397
+ i = setTimeout(d, Math.min(br, v));
1398
+ }, b = () => {
1399
+ s?.disconnect(), s = null, c(), f(), u && clearTimeout(u), u = null;
1400
+ }, _ = () => {
1401
+ const v = oe(document);
1402
+ if (!v) {
944
1403
  o = !1, r = {
945
1404
  identifier: null,
946
1405
  password: null
947
- }, i();
1406
+ }, c();
948
1407
  return;
949
1408
  }
950
1409
  if (!t)
951
1410
  o || (o = !0, e.onDetected());
952
1411
  else {
953
- const w = Je(g, n, r), S = Pn(g, t, n, r);
954
- if ("error" in S || (w.identifier && (n = {
1412
+ const T = gt(v, n, r), R = Pr(v, t, n, r);
1413
+ if ("error" in R || (T.identifier && (n = {
955
1414
  ...n,
956
1415
  identifier: !0
957
1416
  }, r = {
958
1417
  ...r,
959
1418
  identifier: t.login
960
- }), w.password && (n = {
1419
+ }), T.password && (n = {
961
1420
  ...n,
962
1421
  password: !0
963
1422
  }, r = {
964
1423
  ...r,
965
1424
  password: t.password
966
- })), "error" in S) {
967
- const R = S.error !== "nothing-to-fill" ? S.error : !n.identifier && !n.password ? "already-filled" : null;
968
- R && (e.onError(R), t = null, a());
1425
+ })), "error" in R) {
1426
+ const N = R.error !== "nothing-to-fill" ? R.error : !n.identifier && !n.password ? "already-filled" : null;
1427
+ N && (e.onError(N), t = null, b());
969
1428
  } else
970
- e.onFilled(S.step), n.password && (t = null, i(), l = setTimeout(() => {
971
- l = null, Ne(document) && (o = !0, e.onDetected());
972
- }, ot));
1429
+ e.onFilled(R.step), n.password && (t = null, c(), a = setTimeout(() => {
1430
+ a = null, oe(document) && (o = !0, e.onDetected());
1431
+ }, _t));
973
1432
  }
974
- }, d = () => {
975
- u && clearTimeout(u), u = setTimeout(() => {
976
- u = null, c();
977
- }, yn);
978
- }, v = () => {
979
- s || (s = new MutationObserver(d), s.observe(document.body, {
1433
+ }, A = () => {
1434
+ h(), u && clearTimeout(u), u = setTimeout(() => {
1435
+ u = null, _();
1436
+ }, gr);
1437
+ }, S = () => {
1438
+ s || (s = new MutationObserver(A), s.observe(document.body, {
980
1439
  childList: !0,
981
1440
  subtree: !0,
982
1441
  attributes: !0,
983
- attributeFilter: vn
1442
+ attributeFilter: yr
984
1443
  }));
985
1444
  };
986
1445
  return {
987
1446
  watch() {
988
- s || (o = !1, v()), c();
1447
+ s || (o = !1, S()), _();
989
1448
  },
990
- fill(g) {
991
- t = g, v(), c();
1449
+ fill(v) {
1450
+ f(), t = v, S(), _(), t && !n.identifier && !n.password && !oe(document) && (l = Date.now() + Tt, h());
992
1451
  },
993
1452
  cancel() {
994
1453
  t = null, n = {
995
1454
  identifier: !1,
996
1455
  password: !1
997
- }, o = !1, a();
1456
+ }, o = !1, b();
998
1457
  },
999
1458
  teardown() {
1000
- t = null, a();
1459
+ t = null, b();
1001
1460
  }
1002
1461
  };
1003
1462
  }
1004
- var Bn = "leesto/navigation";
1005
- function Fn(e) {
1463
+ var $r = "leesto/navigation";
1464
+ function qr(e) {
1006
1465
  const t = e?.timestamp;
1007
1466
  return typeof t == "number" ? t : void 0;
1008
1467
  }
1009
- function Un(e) {
1468
+ function Hr(e) {
1010
1469
  return e?.type === 4;
1011
1470
  }
1012
- function Gn(e) {
1471
+ function Ur(e) {
1013
1472
  try {
1014
1473
  return JSON.stringify(e)?.length ?? 0;
1015
1474
  } catch {
1016
1475
  return 0;
1017
1476
  }
1018
1477
  }
1019
- function Hn(e) {
1020
- const t = e.now ?? Date.now, n = e.measure ?? Gn;
1478
+ function Gr(e) {
1479
+ const t = e.now ?? Date.now, n = e.measure ?? Ur;
1021
1480
  let r = [], o = 0, s = !1, u = Number.NEGATIVE_INFINITY;
1022
- const l = () => {
1023
- const a = r.shift();
1024
- a && (o -= a.bytes);
1481
+ const a = () => {
1482
+ const l = r.shift();
1483
+ l && (o -= l.bytes);
1025
1484
  }, i = () => {
1026
1485
  if (!s) {
1027
- const d = t() - e.windowMs;
1028
- for (; r.length > 1 && (r[1]?.start ?? Number.POSITIVE_INFINITY) <= d; ) l();
1486
+ const f = t() - e.windowMs;
1487
+ for (; r.length > 1 && (r[1]?.start ?? Number.POSITIVE_INFINITY) <= f; ) a();
1029
1488
  }
1030
- const a = s ? e.heldMaxBytes : e.maxBytes;
1031
- for (; o > a && r.length > 1; ) l();
1489
+ const l = s ? e.heldMaxBytes : e.maxBytes;
1490
+ for (; o > l && r.length > 1; ) a();
1032
1491
  const c = r[r.length - 1];
1033
- if (o > a && e.requestCheckout && (c?.events.length ?? 0) > 2) {
1034
- const d = t();
1035
- d - u >= e.minCheckoutIntervalMs && (u = d, e.requestCheckout());
1492
+ if (o > l && e.requestCheckout && (c?.events.length ?? 0) > 2) {
1493
+ const f = t();
1494
+ f - u >= e.minCheckoutIntervalMs && (u = f, e.requestCheckout());
1036
1495
  }
1037
1496
  };
1038
1497
  return {
1039
- push(a) {
1040
- const c = n(a);
1041
- if (Un(a)) r.push({
1042
- start: Fn(a) ?? t(),
1043
- events: [a],
1498
+ push(l) {
1499
+ const c = n(l);
1500
+ if (Hr(l)) r.push({
1501
+ start: qr(l) ?? t(),
1502
+ events: [l],
1044
1503
  bytes: c
1045
1504
  });
1046
1505
  else {
1047
- const d = r[r.length - 1];
1048
- if (!d) return;
1049
- d.events.push(a), d.bytes += c;
1506
+ const f = r[r.length - 1];
1507
+ if (!f) return;
1508
+ f.events.push(l), f.bytes += c;
1050
1509
  }
1051
1510
  o += c, i();
1052
1511
  },
1053
1512
  snapshot() {
1054
- const a = [];
1055
- for (const c of r) for (const d of c.events) a.push(d);
1056
- return a;
1513
+ const l = [];
1514
+ for (const c of r) for (const f of c.events) l.push(f);
1515
+ return l;
1057
1516
  },
1058
1517
  hold() {
1059
1518
  i(), s = !0;
@@ -1062,11 +1521,11 @@ function Hn(e) {
1062
1521
  s = !1, i();
1063
1522
  },
1064
1523
  stats() {
1065
- let a = 0;
1066
- for (const c of r) a += c.events.length;
1524
+ let l = 0;
1525
+ for (const c of r) l += c.events.length;
1067
1526
  return {
1068
1527
  segments: r.length,
1069
- events: a,
1528
+ events: l,
1070
1529
  bytes: o,
1071
1530
  held: s
1072
1531
  };
@@ -1076,132 +1535,132 @@ function Hn(e) {
1076
1535
  }
1077
1536
  };
1078
1537
  }
1079
- var Qe = 6e5, et = 1e3, Wn = {
1538
+ var bt = 6e5, yt = 1e3, Wr = {
1080
1539
  mousemove: 100,
1081
1540
  scroll: 150
1082
- }, jn = {
1541
+ }, Vr = {
1083
1542
  windowMs: 12e4,
1084
1543
  checkoutEveryNms: 6e4,
1085
1544
  maxBytes: 8388608,
1086
1545
  heldMaxBytes: 33554432,
1087
1546
  minCheckoutIntervalMs: 15e3,
1088
- sampling: Wn
1089
- }, zn = 5;
1090
- async function Vn(e) {
1547
+ sampling: Wr
1548
+ }, zr = 5;
1549
+ async function jr(e) {
1091
1550
  const { record: t, addCustomEvent: n } = await import("./chunks/rrweb-qwppqH_c.js"), r = e.maskPolicy ?? "mask_all", o = Date.now();
1092
- let s = [], u = !1, l = 0;
1551
+ let s = [], u = !1, a = 0;
1093
1552
  const i = () => {
1094
1553
  if (s.length === 0) return;
1095
- const R = s;
1096
- s = [], e.onBatch(R);
1097
- }, a = t({
1098
- emit(R) {
1099
- s.push(Xe(R, r, (_) => t.mirror.getNode(_)));
1554
+ const A = s;
1555
+ s = [], e.onBatch(A);
1556
+ }, l = t({
1557
+ emit(A) {
1558
+ s.push(dt(A, r, (S) => t.mirror.getNode(S)));
1100
1559
  },
1101
- ...Ve(r)
1102
- }), c = e.diagnostics ?? null, d = a ? c ?? Be({ captureNetwork: e.captureNetwork !== !1 }) : null, v = d !== null && c === null;
1103
- d?.setSink((R, _) => {
1560
+ ...ft(r)
1561
+ }), c = e.diagnostics ?? null, f = l ? c ?? rt({ captureNetwork: e.captureNetwork !== !1 }) : null, d = f !== null && c === null;
1562
+ f?.setSink((A, S) => {
1104
1563
  try {
1105
- n(R, _);
1564
+ n(A, S);
1106
1565
  } catch {
1107
1566
  }
1108
1567
  });
1109
- const g = setInterval(i, et), w = { timer: null }, S = () => (u || (u = !0, clearInterval(g), clearTimeout(w.timer ?? void 0), d?.flushRings(), d?.setSink(null), v && d?.teardown(), a?.(), i(), l = Date.now() - o), l);
1110
- return w.timer = setTimeout(() => {
1111
- S(), e.onCap();
1112
- }, Qe), { stop: S };
1568
+ const h = setInterval(i, yt), b = { timer: null }, _ = () => (u || (u = !0, clearInterval(h), clearTimeout(b.timer ?? void 0), f?.flushRings(), f?.setSink(null), d && f?.teardown(), l?.(), i(), a = Date.now() - o), a);
1569
+ return b.timer = setTimeout(() => {
1570
+ _(), e.onCap();
1571
+ }, bt), { stop: _ };
1113
1572
  }
1114
- async function Xn(e) {
1573
+ async function Xr(e) {
1115
1574
  const { record: t, addCustomEvent: n } = await import("./chunks/rrweb-qwppqH_c.js"), r = {
1116
- ...jn,
1575
+ ...Vr,
1117
1576
  ...e.config
1118
1577
  }, { diagnostics: o } = e, s = e.maskPolicy ?? "mask_all";
1119
- let u = !1, l = null, i = null;
1120
- const a = () => {
1578
+ let u = !1, a = null, i = null;
1579
+ const l = () => {
1121
1580
  try {
1122
1581
  t.takeFullSnapshot(!0);
1123
1582
  } catch {
1124
1583
  }
1125
- }, c = Hn({
1584
+ }, c = Gr({
1126
1585
  windowMs: r.windowMs,
1127
1586
  maxBytes: r.maxBytes,
1128
1587
  heldMaxBytes: r.heldMaxBytes,
1129
1588
  minCheckoutIntervalMs: r.minCheckoutIntervalMs,
1130
1589
  requestCheckout: () => queueMicrotask(() => {
1131
- u || a();
1590
+ u || l();
1132
1591
  })
1133
- }), d = t({
1134
- emit(g) {
1135
- const w = Xe(g, s, (S) => t.mirror.getNode(S));
1136
- c.push(w), l?.(w);
1592
+ }), f = t({
1593
+ emit(h) {
1594
+ const b = dt(h, s, (_) => t.mirror.getNode(_));
1595
+ c.push(b), a?.(b);
1137
1596
  },
1138
1597
  checkoutEveryNms: r.checkoutEveryNms,
1139
1598
  sampling: r.sampling,
1140
- ...Ve(s)
1599
+ ...ft(s)
1141
1600
  });
1142
- if (!d) return null;
1143
- const v = (g, w) => {
1601
+ if (!f) return null;
1602
+ const d = (h, b) => {
1144
1603
  try {
1145
- n(g, w);
1604
+ n(h, b);
1146
1605
  } catch {
1147
1606
  }
1148
1607
  };
1149
- return o.setSink(v), {
1608
+ return o.setSink(d), {
1150
1609
  snapshot() {
1151
- const g = c.snapshot(), w = Date.now();
1152
- o.setSink((R, _) => {
1153
- g.push({
1154
- type: zn,
1610
+ const h = c.snapshot(), b = Date.now();
1611
+ o.setSink((A, S) => {
1612
+ h.push({
1613
+ type: zr,
1155
1614
  data: {
1156
- tag: R,
1157
- payload: _
1615
+ tag: A,
1616
+ payload: S
1158
1617
  },
1159
- timestamp: w
1618
+ timestamp: b
1160
1619
  });
1161
1620
  });
1162
1621
  try {
1163
1622
  o.flushRings();
1164
1623
  } finally {
1165
- o.setSink(u ? null : v);
1624
+ o.setSink(u ? null : d);
1166
1625
  }
1167
- const S = g[0]?.timestamp;
1626
+ const _ = h[0]?.timestamp;
1168
1627
  return {
1169
- events: g,
1170
- durationMs: typeof S == "number" ? Math.max(0, w - S) : 0
1628
+ events: h,
1629
+ durationMs: typeof _ == "number" ? Math.max(0, b - _) : 0
1171
1630
  };
1172
1631
  },
1173
1632
  hold: () => c.hold(),
1174
1633
  release: () => c.release(),
1175
- markNavigation(g) {
1176
- u || v(Bn, { href: W(g) });
1634
+ markNavigation(h) {
1635
+ u || d($r, { href: V(h) });
1177
1636
  },
1178
1637
  stats: () => c.stats(),
1179
- stream({ onBatch: g, onCap: w }) {
1638
+ stream({ onBatch: h, onCap: b }) {
1180
1639
  i?.stop();
1181
- const S = Date.now();
1182
- let R = [], _ = !1, C = 0;
1183
- const N = () => {
1184
- if (R.length === 0) return;
1185
- const B = R;
1186
- R = [], g(B);
1187
- }, x = (B) => {
1188
- R.push(B);
1640
+ const _ = Date.now();
1641
+ let A = [], S = !1, v = 0;
1642
+ const T = () => {
1643
+ if (A.length === 0) return;
1644
+ const C = A;
1645
+ A = [], h(C);
1646
+ }, R = (C) => {
1647
+ A.push(C);
1189
1648
  };
1190
- l = x, a();
1191
- const P = setInterval(N, et), M = { timer: null }, $ = { stop() {
1192
- return _ || (_ = !0, clearInterval(P), clearTimeout(M.timer ?? void 0), o.flushRings(), l === x && (l = null), i === $ && (i = null), N(), C = Date.now() - S), C;
1649
+ a = R, l();
1650
+ const N = setInterval(T, yt), F = { timer: null }, O = { stop() {
1651
+ return S || (S = !0, clearInterval(N), clearTimeout(F.timer ?? void 0), o.flushRings(), a === R && (a = null), i === O && (i = null), T(), v = Date.now() - _), v;
1193
1652
  } };
1194
- return M.timer = setTimeout(() => {
1195
- $.stop(), w();
1196
- }, Qe), i = $, $;
1653
+ return F.timer = setTimeout(() => {
1654
+ O.stop(), b();
1655
+ }, bt), i = O, O;
1197
1656
  },
1198
1657
  stop() {
1199
- u || (u = !0, i?.stop(), o.setSink(null), d(), c.clear());
1658
+ u || (u = !0, i?.stop(), o.setSink(null), f(), c.clear());
1200
1659
  }
1201
1660
  };
1202
1661
  }
1203
- var Kn = ["https://lab.leesto.app", "https://lab-dev.leesto.app"], Yn = ["http://localhost:3505", "http://127.0.0.1:3505"];
1204
- function Zn(e) {
1662
+ var Kr = ["https://lab.leesto.app", "https://lab-dev.leesto.app"], Yr = ["http://localhost:3505", "http://127.0.0.1:3505"];
1663
+ function Zr(e) {
1205
1664
  try {
1206
1665
  const t = new URL(e).hostname;
1207
1666
  return t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "[::1]";
@@ -1209,7 +1668,7 @@ function Zn(e) {
1209
1668
  return !1;
1210
1669
  }
1211
1670
  }
1212
- function Jn(e) {
1671
+ function Qr(e) {
1213
1672
  const t = e.trim();
1214
1673
  if (!t) return null;
1215
1674
  try {
@@ -1219,22 +1678,22 @@ function Jn(e) {
1219
1678
  return null;
1220
1679
  }
1221
1680
  }
1222
- function Qn(e) {
1223
- const t = (e.explicit ?? []).map(Jn).filter((r) => r !== null);
1681
+ function Jr(e) {
1682
+ const t = (e.explicit ?? []).map(Qr).filter((r) => r !== null);
1224
1683
  if (t.length > 0) return [...new Set(t)];
1225
- const n = [...Kn];
1226
- return Zn(e.pageOrigin) && n.push(...Yn), [...new Set(n)];
1684
+ const n = [...Kr];
1685
+ return Zr(e.pageOrigin) && n.push(...Yr), [...new Set(n)];
1227
1686
  }
1228
- function fe(e, t) {
1687
+ function ve(e, t) {
1229
1688
  return !e || e === "*" || e === "null" ? !1 : t.includes(e);
1230
1689
  }
1231
- function Q() {
1690
+ function se() {
1232
1691
  return typeof navigator < "u" && navigator.globalPrivacyControl === !0;
1233
1692
  }
1234
- function er(e) {
1693
+ function eo(e) {
1235
1694
  const t = (u) => {
1236
- const l = typeof u == "string" ? u.trim() : "";
1237
- return l.length > 0 ? l : void 0;
1695
+ const a = typeof u == "string" ? u.trim() : "";
1696
+ return a.length > 0 ? a : void 0;
1238
1697
  }, n = (u) => {
1239
1698
  if (!(typeof document > "u"))
1240
1699
  return t(document.querySelector(`meta[name="${u}"]`)?.getAttribute("content"));
@@ -1245,7 +1704,7 @@ function er(e) {
1245
1704
  ...s ? { environment: s } : {}
1246
1705
  };
1247
1706
  }
1248
- function tr() {
1707
+ function to() {
1249
1708
  if (typeof document > "u") return;
1250
1709
  const e = document.querySelector('link[rel~="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"]');
1251
1710
  if (e?.href)
@@ -1255,26 +1714,39 @@ function tr() {
1255
1714
  return;
1256
1715
  }
1257
1716
  }
1258
- function nr() {
1717
+ function no() {
1259
1718
  const e = (r) => !!r && r !== "transparent" && !/^rgba\(\s*0,\s*0,\s*0,\s*0\s*\)$/.test(r), t = getComputedStyle(document.body).backgroundColor;
1260
1719
  if (e(t)) return t;
1261
1720
  const n = getComputedStyle(document.documentElement).backgroundColor;
1262
1721
  return e(n) ? n : "#ffffff";
1263
1722
  }
1264
- async function De(e) {
1723
+ var Qe = Promise.resolve();
1724
+ function Je(e) {
1725
+ const t = Qe.then(() => oo(e));
1726
+ return Qe = t.catch(() => {
1727
+ }), t;
1728
+ }
1729
+ function ro(e, t, n, r) {
1730
+ if (t !== "sticky") return [n, r];
1731
+ const o = e.getBoundingClientRect(), s = e.style.position;
1732
+ e.style.position = "static";
1733
+ const u = e.getBoundingClientRect();
1734
+ return e.style.position = s, [o.x - u.x, o.y - u.y];
1735
+ }
1736
+ async function oo(e) {
1265
1737
  const { domToPng: t } = await import("./chunks/dist-BTlWkbvW.js");
1266
1738
  if (e) {
1267
- const l = document.querySelector(e);
1268
- if (!l) throw new Error("element_not_found");
1269
- return t(l, { quality: 0.92 });
1739
+ const a = document.querySelector(e);
1740
+ if (!a) throw new Error("element_not_found");
1741
+ return t(a, { quality: 0.92 });
1270
1742
  }
1271
1743
  const n = document.documentElement, r = window.scrollX, o = window.scrollY, s = [], u = [];
1272
1744
  try {
1273
- for (const l of n.querySelectorAll(`.${ge}, ${te}`)) {
1274
- const i = l.getBoundingClientRect();
1745
+ for (const a of n.querySelectorAll(`.${Oe}, ${ae}`)) {
1746
+ const i = a.getBoundingClientRect();
1275
1747
  if (i.width <= 0 || i.height <= 0) continue;
1276
- const a = document.createElement("div");
1277
- a.dataset.leestoCaptureCover = "", Object.assign(a.style, {
1748
+ const l = document.createElement("div");
1749
+ l.dataset.leestoCaptureCover = "", Object.assign(l.style, {
1278
1750
  position: "fixed",
1279
1751
  left: `${i.x}px`,
1280
1752
  top: `${i.y}px`,
@@ -1283,18 +1755,18 @@ async function De(e) {
1283
1755
  background: "#a1a1aa",
1284
1756
  zIndex: "2147483647",
1285
1757
  pointerEvents: "none"
1286
- }), n.append(a), s.push(a);
1758
+ }), n.append(l), s.push(l);
1287
1759
  }
1288
- for (const l of n.querySelectorAll("*")) {
1289
- const i = getComputedStyle(l).position;
1760
+ for (const a of n.querySelectorAll("*")) {
1761
+ const i = getComputedStyle(a).position;
1290
1762
  if (i === "fixed" || i === "sticky") {
1291
- const a = l.style.transform;
1292
- u.push([l, a]), l.style.transform = `translate(${r}px, ${o}px)${a ? ` ${a}` : ""}`;
1763
+ const [l, c] = ro(a, i, r, o), f = a.style.transform;
1764
+ u.push([a, f]), a.style.transform = `translate(${l}px, ${c}px)${f ? ` ${f}` : ""}`;
1293
1765
  }
1294
1766
  }
1295
1767
  return await t(n, {
1296
1768
  quality: 0.92,
1297
- backgroundColor: nr(),
1769
+ backgroundColor: no(),
1298
1770
  width: n.clientWidth,
1299
1771
  height: n.clientHeight,
1300
1772
  style: {
@@ -1303,11 +1775,11 @@ async function De(e) {
1303
1775
  }
1304
1776
  });
1305
1777
  } finally {
1306
- for (const l of s) l.remove();
1307
- for (const [l, i] of u) l.style.transform = i;
1778
+ for (const a of s) a.remove();
1779
+ for (const [a, i] of u) a.style.transform = i;
1308
1780
  }
1309
1781
  }
1310
- function rr(e) {
1782
+ function so(e) {
1311
1783
  if (e.id) return `#${CSS.escape(e.id)}`;
1312
1784
  const t = [];
1313
1785
  let n = e;
@@ -1321,73 +1793,73 @@ function rr(e) {
1321
1793
  o && (r += `.${CSS.escape(o)}`);
1322
1794
  const s = n.parentElement;
1323
1795
  if (s) {
1324
- const u = Array.from(s.children).filter((l) => l.tagName === n?.tagName);
1796
+ const u = Array.from(s.children).filter((a) => a.tagName === n?.tagName);
1325
1797
  u.length > 1 && (r += `:nth-of-type(${u.indexOf(n) + 1})`);
1326
1798
  }
1327
1799
  t.unshift(r), n = s;
1328
1800
  }
1329
1801
  return t.join(" > ");
1330
1802
  }
1331
- function or(e) {
1803
+ function io(e) {
1332
1804
  const t = e.tagName.toLowerCase();
1333
- if (Y(e)) return t;
1805
+ if (ee(e)) return t;
1334
1806
  const n = (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 40);
1335
1807
  return n ? `${t} · ${n}` : t;
1336
1808
  }
1337
- var tt = "leesto:shell-origin";
1338
- function sr() {
1809
+ var vt = "leesto:shell-origin";
1810
+ function ao() {
1339
1811
  try {
1340
- return sessionStorage.getItem(tt);
1812
+ return sessionStorage.getItem(vt);
1341
1813
  } catch {
1342
1814
  return null;
1343
1815
  }
1344
1816
  }
1345
- function ir(e) {
1817
+ function lo(e) {
1346
1818
  try {
1347
- sessionStorage.setItem(tt, e);
1819
+ sessionStorage.setItem(vt, e);
1348
1820
  } catch {
1349
1821
  }
1350
1822
  }
1351
- function ar() {
1823
+ function co() {
1352
1824
  try {
1353
1825
  return typeof window.name == "string" ? window.name : "";
1354
1826
  } catch {
1355
1827
  return "";
1356
1828
  }
1357
1829
  }
1358
- function $e(e = {}) {
1830
+ function et(e = {}) {
1359
1831
  if (typeof window > "u" || window.parent === window) return () => {
1360
1832
  };
1361
- const t = window.parent, n = e.highlightColor ?? St.light.primary, r = Qn({
1833
+ const t = window.parent, n = e.highlightColor ?? Ut.light.primary, r = Jr({
1362
1834
  explicit: e.shellOrigins,
1363
1835
  pageOrigin: location.origin
1364
1836
  });
1365
1837
  let o = null;
1366
1838
  try {
1367
- const h = document.referrer ? new URL(document.referrer).origin : "";
1368
- fe(h, r) && (o = h);
1839
+ const g = document.referrer ? new URL(document.referrer).origin : "";
1840
+ ve(g, r) && (o = g);
1369
1841
  } catch {
1370
1842
  }
1371
1843
  if (!o) {
1372
- const h = sr();
1373
- h && fe(h, r) && (o = h);
1844
+ const g = ao();
1845
+ g && ve(g, r) && (o = g);
1374
1846
  }
1375
- const s = (h) => {
1847
+ const s = (g) => {
1376
1848
  if (o) {
1377
- t.postMessage(h, o);
1849
+ t.postMessage(g, o);
1378
1850
  return;
1379
1851
  }
1380
- for (const b of r) t.postMessage(h, b);
1852
+ for (const E of r) t.postMessage(g, E);
1381
1853
  };
1382
- let u = null, l = "";
1854
+ let u = null, a = "";
1383
1855
  const i = () => {
1384
- u && (u.style.outline = l), u = null;
1856
+ u && (u.style.outline = a), u = null;
1385
1857
  };
1386
- let a = null;
1858
+ let l = null;
1387
1859
  const c = () => {
1388
- a?.(), i(), document.querySelector("[data-leesto-picker-outline]")?.remove();
1389
- const h = document.createElement("div");
1390
- h.dataset.leestoPickerOutline = "", h.setAttribute("aria-hidden", "true"), Object.assign(h.style, {
1860
+ l?.(), i(), document.querySelector("[data-leesto-picker-outline]")?.remove();
1861
+ const g = document.createElement("div");
1862
+ g.dataset.leestoPickerOutline = "", g.setAttribute("aria-hidden", "true"), Object.assign(g.style, {
1391
1863
  position: "fixed",
1392
1864
  pointerEvents: "none",
1393
1865
  zIndex: "2147483647",
@@ -1395,192 +1867,205 @@ function $e(e = {}) {
1395
1867
  border: `2px solid ${n}`,
1396
1868
  borderRadius: "4px",
1397
1869
  display: "none"
1398
- }), document.documentElement.append(h);
1399
- let b = null, y = null, q = null;
1400
- const z = document.body.style.cursor, O = () => {
1401
- const k = y ?? b;
1402
- if (!k) return;
1403
- const I = k.getBoundingClientRect();
1404
- y ? s({
1870
+ }), document.documentElement.append(g);
1871
+ let E = null, w = null, U = null;
1872
+ const X = document.body.style.cursor, x = () => {
1873
+ const M = w ?? E;
1874
+ if (!M) return;
1875
+ const D = M.getBoundingClientRect();
1876
+ w ? s({
1405
1877
  type: "leesto:element-picked",
1406
- selector: rr(k),
1407
- label: or(k),
1878
+ selector: so(M),
1879
+ label: io(M),
1408
1880
  rect: {
1409
- x: I.x,
1410
- y: I.y,
1411
- width: I.width,
1412
- height: I.height
1881
+ x: D.x,
1882
+ y: D.y,
1883
+ width: D.width,
1884
+ height: D.height
1413
1885
  },
1414
- ...q ? { point: {
1415
- x: I.x + q.x,
1416
- y: I.y + q.y
1886
+ ...U ? { point: {
1887
+ x: D.x + U.x,
1888
+ y: D.y + U.y
1417
1889
  } } : {},
1418
1890
  viewport: {
1419
1891
  width: document.documentElement.clientWidth,
1420
1892
  height: document.documentElement.clientHeight
1421
1893
  },
1422
- context: gn(k)
1423
- }) : Object.assign(h.style, {
1894
+ context: ar(M)
1895
+ }) : Object.assign(g.style, {
1424
1896
  display: "block",
1425
- left: `${I.x}px`,
1426
- top: `${I.y}px`,
1427
- width: `${I.width}px`,
1428
- height: `${I.height}px`
1897
+ left: `${D.x}px`,
1898
+ top: `${D.y}px`,
1899
+ width: `${D.width}px`,
1900
+ height: `${D.height}px`
1429
1901
  });
1430
- }, we = (k) => {
1431
- b = k.target instanceof Element ? k.target : null, O();
1432
- }, Ee = () => {
1433
- h.remove(), document.removeEventListener("mousemove", we, !0), document.removeEventListener("click", Se, !0), document.body.style.cursor = z;
1434
- }, Se = (k) => {
1435
- if (k.preventDefault(), k.stopPropagation(), y = k.target instanceof Element ? k.target : null, y) {
1436
- const I = y.getBoundingClientRect();
1437
- q = {
1438
- x: k.clientX - I.x,
1439
- y: k.clientY - I.y
1902
+ }, xe = (M) => {
1903
+ E = M.target instanceof Element ? M.target : null, x();
1904
+ }, De = () => {
1905
+ g.remove(), document.removeEventListener("mousemove", xe, !0), document.removeEventListener("click", Fe, !0), document.body.style.cursor = X;
1906
+ }, Fe = (M) => {
1907
+ if (M.preventDefault(), M.stopPropagation(), w = M.target instanceof Element ? M.target : null, w) {
1908
+ const D = w.getBoundingClientRect();
1909
+ U = {
1910
+ x: M.clientX - D.x,
1911
+ y: M.clientY - D.y
1440
1912
  };
1441
1913
  }
1442
- Ee(), O();
1443
- }, Re = (k) => {
1444
- k.key === "Escape" && (a?.(), s({ type: "leesto:pick-cancelled" }));
1914
+ De(), x();
1915
+ }, Pe = (M) => {
1916
+ M.key === "Escape" && (l?.(), s({ type: "leesto:pick-cancelled" }));
1445
1917
  };
1446
- a = () => {
1447
- Ee(), document.removeEventListener("keydown", Re, !0), document.removeEventListener("scroll", O, !0), window.removeEventListener("resize", O), a = null;
1448
- }, document.body.style.cursor = "crosshair", document.addEventListener("mousemove", we, !0), document.addEventListener("click", Se, !0), document.addEventListener("keydown", Re, !0), document.addEventListener("scroll", O, !0), window.addEventListener("resize", O);
1449
- }, d = mt(location.search, ar()), v = de(d) && !Q(), g = pt(d), w = v ? ht(d) ?? dt() : void 0, S = v ? Be({
1918
+ l = () => {
1919
+ De(), document.removeEventListener("keydown", Pe, !0), document.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x), l = null;
1920
+ }, document.body.style.cursor = "crosshair", document.addEventListener("mousemove", xe, !0), document.addEventListener("click", Fe, !0), document.addEventListener("keydown", Pe, !0), document.addEventListener("scroll", x, !0), window.addEventListener("resize", x);
1921
+ }, f = Dt(location.search, co()), d = we(f) && !se(), h = Mt(f), b = d ? xt(f) ?? Nt() : void 0, _ = d ? rt({
1450
1922
  captureNetwork: e.captureNetwork !== !1,
1451
- runId: w,
1923
+ runId: b,
1452
1924
  runIdOrigins: e.runIdOrigins
1453
1925
  }) : null;
1454
- let R = !1;
1455
- const _ = S ? Xn({
1456
- diagnostics: S,
1457
- maskPolicy: g
1458
- }).then((h) => h && R ? (h.stop(), null) : h).catch(() => null) : null;
1459
- let C = null, N = !1, x = !1;
1460
- const P = () => {
1461
- if (C) {
1462
- const h = C.stop();
1463
- C = null, s({
1926
+ let A = null;
1927
+ const S = () => {
1928
+ A ?? (A = Un());
1929
+ };
1930
+ (o || f) && S();
1931
+ let v = !1;
1932
+ const T = _ ? Xr({
1933
+ diagnostics: _,
1934
+ maskPolicy: h
1935
+ }).then((g) => g && v ? (g.stop(), null) : g).catch(() => null) : null;
1936
+ let R = null, N = !1, F = !1;
1937
+ const O = () => {
1938
+ if (R) {
1939
+ const g = R.stop();
1940
+ R = null, s({
1464
1941
  type: "leesto:rec-stopped",
1465
- durationMs: h
1942
+ durationMs: g
1466
1943
  });
1467
- } else N && (x = !0);
1468
- }, M = qn({
1944
+ } else N && (F = !0);
1945
+ }, C = Br({
1469
1946
  onDetected: () => s({ type: "leesto:login-form-detected" }),
1470
- onFilled: (h) => s({
1947
+ onFilled: (g) => s({
1471
1948
  type: "leesto:login-filled",
1472
- step: h
1949
+ step: g
1473
1950
  }),
1474
- onError: (h) => s({
1951
+ onError: (g) => s({
1475
1952
  type: "leesto:login-error",
1476
- reason: h
1953
+ reason: g
1954
+ }),
1955
+ onNoForm: (g) => s({
1956
+ type: "leesto:login-no-form",
1957
+ signedIn: g
1477
1958
  })
1478
- }), $ = () => M.cancel();
1479
- window.addEventListener("pagehide", $);
1480
- const B = er(e.build), D = window.navigation;
1481
- let U = !1;
1482
- const f = () => !U && D?.canGoBack === !0, p = () => !U && D?.canGoForward === !0;
1483
- let m = p(), E = f(), L = location.href;
1484
- const F = () => {
1485
- L = location.href, E = f(), m = p();
1486
- const h = tr();
1959
+ }), Y = () => C.cancel();
1960
+ window.addEventListener("pagehide", Y);
1961
+ const j = un((g) => s({
1962
+ type: "leesto:ambient",
1963
+ ...g
1964
+ })), p = eo(e.build), m = window.navigation;
1965
+ let y = !1;
1966
+ const L = () => !y && m?.canGoBack === !0, k = () => !y && m?.canGoForward === !0;
1967
+ let q = k(), I = L(), P = location.href;
1968
+ const G = () => {
1969
+ P = location.href, I = L(), q = k();
1970
+ const g = to();
1487
1971
  s({
1488
1972
  type: "leesto:ready",
1489
1973
  url: location.href,
1490
1974
  bridgeVersion: 1,
1491
1975
  capabilities: [
1492
- nt,
1493
- ...D ? ["navigation", "navigation-forward"] : [],
1494
- ..._ ? [rt] : []
1976
+ wt,
1977
+ St,
1978
+ ...m ? ["navigation", "navigation-forward"] : [],
1979
+ ...T ? [Et] : []
1495
1980
  ],
1496
- canGoBack: E,
1497
- canGoForward: m,
1498
- ...h ? { favicon: h } : {},
1499
- ...B ? { build: B } : {},
1500
- ...w ? { diagnosticRunId: w } : {},
1501
- ...Q() ? { gpc: !0 } : {}
1502
- });
1503
- }, A = (h) => {
1504
- if (h.source !== t || !fe(h.origin, r) || !st(h.data)) return;
1505
- o !== h.origin && (o = h.origin, ir(h.origin));
1506
- const b = h.data;
1507
- if (b.type === "leesto:ping")
1508
- s({ type: "leesto:pong" }), F();
1509
- else if (b.type === "leesto:navigate-back" || b.type === "leesto:navigate-forward") {
1510
- const y = b.type === "leesto:navigate-forward";
1511
- if (!D || !(y ? p() : f())) return;
1512
- U = !0, T(), Promise.resolve((y ? D.forward() : D.back()).finished).catch(() => {
1981
+ canGoBack: I,
1982
+ canGoForward: q,
1983
+ ...g ? { favicon: g } : {},
1984
+ ...p ? { build: p } : {},
1985
+ ...b ? { diagnosticRunId: b } : {},
1986
+ ...se() ? { gpc: !0 } : {}
1987
+ }), j.announce();
1988
+ }, Ie = (g) => {
1989
+ if (g.source !== t || !ve(g.origin, r) || !Rt(g.data)) return;
1990
+ o !== g.origin && (o = g.origin, lo(g.origin)), S();
1991
+ const E = g.data;
1992
+ if (E.type === "leesto:ping")
1993
+ s({ type: "leesto:pong" }), G();
1994
+ else if (E.type === "leesto:navigate-back" || E.type === "leesto:navigate-forward") {
1995
+ const w = E.type === "leesto:navigate-forward";
1996
+ if (!m || !(w ? k() : L())) return;
1997
+ y = !0, H(), Promise.resolve((w ? m.forward() : m.back()).finished).catch(() => {
1513
1998
  }).finally(() => {
1514
- U = !1, R || T();
1999
+ y = !1, v || H();
1515
2000
  });
1516
- } else if (b.type === "leesto:highlight") {
1517
- if (i(), b.selector) {
1518
- let y = null;
2001
+ } else if (E.type === "leesto:highlight") {
2002
+ if (i(), E.selector) {
2003
+ let w = null;
1519
2004
  try {
1520
- y = document.querySelector(b.selector);
2005
+ w = document.querySelector(E.selector);
1521
2006
  } catch {
1522
- y = null;
2007
+ w = null;
1523
2008
  }
1524
- y && (u = y, l = y.style.outline, y.style.outline = `2px solid ${n}`, y.style.outlineOffset = "2px", y.scrollIntoView({
2009
+ w && (u = w, a = w.style.outline, w.style.outline = `2px solid ${n}`, w.style.outlineOffset = "2px", w.scrollIntoView({
1525
2010
  block: "center",
1526
2011
  behavior: "smooth"
1527
2012
  }));
1528
2013
  }
1529
- } else if (b.type === "leesto:pick-start") c();
1530
- else if (b.type === "leesto:pick-stop") a?.();
1531
- else if (b.type === "leesto:capture-request") (b.selector ? De(b.selector) : (e.capture ?? De)()).then((y) => s({
2014
+ } else if (E.type === "leesto:pick-start") c();
2015
+ else if (E.type === "leesto:pick-stop") l?.();
2016
+ else if (E.type === "leesto:capture-request") (E.selector ? Je(E.selector) : (e.capture ?? Je)()).then((w) => s({
1532
2017
  type: "leesto:screenshot",
1533
- dataUrl: y,
1534
- ...b.selector ? { selector: b.selector } : {}
1535
- })).catch((y) => s({
2018
+ dataUrl: w,
2019
+ ...E.selector ? { selector: E.selector } : {}
2020
+ })).catch((w) => s({
1536
2021
  type: "leesto:capture-failed",
1537
- reason: y instanceof Error ? y.message : "capture_error"
2022
+ reason: w instanceof Error ? w.message : "capture_error"
1538
2023
  }));
1539
- else if (b.type === "leesto:rec-start") {
1540
- if (C || N) return;
1541
- if (Q()) {
2024
+ else if (E.type === "leesto:rec-start") {
2025
+ if (R || N) return;
2026
+ if (se()) {
1542
2027
  s({
1543
2028
  type: "leesto:rec-blocked",
1544
2029
  reason: "gpc"
1545
2030
  });
1546
2031
  return;
1547
2032
  }
1548
- N = !0, x = !1;
1549
- const y = (O) => s({
2033
+ N = !0, F = !1;
2034
+ const w = (x) => s({
1550
2035
  type: "leesto:rec-batch",
1551
- events: O
1552
- }), q = () => P(), z = () => Vn({
1553
- onBatch: y,
1554
- onCap: q,
2036
+ events: x
2037
+ }), U = () => O(), X = () => jr({
2038
+ onBatch: w,
2039
+ onCap: U,
1555
2040
  captureNetwork: e.captureNetwork,
1556
- maskPolicy: g,
1557
- diagnostics: S
2041
+ maskPolicy: h,
2042
+ diagnostics: _
1558
2043
  });
1559
- (_ ? _.then((O) => O ? O.stream({
1560
- onBatch: y,
1561
- onCap: q
1562
- }) : z()) : z()).then((O) => {
1563
- N = !1, C = O, x && P();
1564
- }).catch((O) => {
2044
+ (T ? T.then((x) => x ? x.stream({
2045
+ onBatch: w,
2046
+ onCap: U
2047
+ }) : X()) : X()).then((x) => {
2048
+ N = !1, R = x, F && O();
2049
+ }).catch((x) => {
1565
2050
  N = !1, s({
1566
2051
  type: "leesto:rec-error",
1567
- reason: O instanceof Error ? O.message : "rec_error"
2052
+ reason: x instanceof Error ? x.message : "rec_error"
1568
2053
  });
1569
2054
  });
1570
- } else if (b.type === "leesto:rec-stop") P();
1571
- else if (b.type === "leesto:rec-buffer-request") {
1572
- if (!_) {
2055
+ } else if (E.type === "leesto:rec-stop") O();
2056
+ else if (E.type === "leesto:rec-buffer-request") {
2057
+ if (!T) {
1573
2058
  s({
1574
2059
  type: "leesto:rec-buffer",
1575
2060
  events: [],
1576
2061
  durationMs: 0,
1577
- unavailable: Q() ? "gpc" : "not-armed"
2062
+ unavailable: se() ? "gpc" : "not-armed"
1578
2063
  });
1579
2064
  return;
1580
2065
  }
1581
- _.then((y) => {
1582
- if (R) return;
1583
- if (!y) {
2066
+ T.then((w) => {
2067
+ if (v) return;
2068
+ if (!w) {
1584
2069
  s({
1585
2070
  type: "leesto:rec-buffer",
1586
2071
  events: [],
@@ -1589,62 +2074,62 @@ function $e(e = {}) {
1589
2074
  });
1590
2075
  return;
1591
2076
  }
1592
- const { events: q, durationMs: z } = y.snapshot();
2077
+ const { events: U, durationMs: X } = w.snapshot();
1593
2078
  s({
1594
2079
  type: "leesto:rec-buffer",
1595
- events: q,
1596
- durationMs: z
2080
+ events: U,
2081
+ durationMs: X
1597
2082
  });
1598
2083
  });
1599
- } else b.type === "leesto:rec-buffer-hold" ? _?.then((y) => y?.hold()) : b.type === "leesto:rec-buffer-release" ? _?.then((y) => y?.release()) : b.type === "leesto:diagnostics-request" ? s({
2084
+ } else E.type === "leesto:rec-buffer-hold" ? T?.then((w) => w?.hold()) : E.type === "leesto:rec-buffer-release" ? T?.then((w) => w?.release()) : E.type === "leesto:diagnostics-request" ? s({
1600
2085
  type: "leesto:diagnostics",
1601
- snapshot: S?.snapshot() ?? {
2086
+ snapshot: _?.snapshot() ?? {
1602
2087
  errors: [],
1603
2088
  logs: [],
1604
2089
  network: []
1605
2090
  }
1606
- }) : b.type === "leesto:login-watch" ? M.watch() : b.type === "leesto:login-fill" ? M.fill({
1607
- login: b.login,
1608
- password: b.password
1609
- }) : b.type === "leesto:login-cancel" && M.cancel();
2091
+ }) : E.type === "leesto:login-watch" ? C.watch() : E.type === "leesto:login-fill" ? C.fill({
2092
+ login: E.login,
2093
+ password: E.password
2094
+ }) : E.type === "leesto:login-cancel" && C.cancel();
1610
2095
  };
1611
- window.addEventListener("message", A), F();
1612
- const T = (h) => {
1613
- if (!(location.href === L && f() === E && p() === m)) {
1614
- if (location.href !== L) {
1615
- const b = location.href;
1616
- _?.then((y) => y?.markNavigation(b));
2096
+ window.addEventListener("message", Ie), G();
2097
+ const H = (g) => {
2098
+ if (!(location.href === P && L() === I && k() === q)) {
2099
+ if (location.href !== P) {
2100
+ const E = location.href;
2101
+ T?.then((w) => w?.markNavigation(E)), j.navigated();
1617
2102
  }
1618
- L = location.href, E = f(), m = p(), s({
2103
+ P = location.href, I = L(), q = k(), s({
1619
2104
  type: "leesto:location",
1620
2105
  url: location.href,
1621
- canGoBack: E,
1622
- canGoForward: m,
1623
- navigationType: typeof h == "string" ? h : "traverse"
2106
+ canGoBack: I,
2107
+ canGoForward: q,
2108
+ navigationType: typeof g == "string" ? g : "traverse"
1624
2109
  });
1625
2110
  }
1626
- }, G = history.pushState, ye = history.replaceState, ve = (...h) => {
1627
- G.apply(history, h), T("push");
1628
- }, be = (...h) => {
1629
- ye.apply(history, h), T("replace");
2111
+ }, Ce = history.pushState, ke = history.replaceState, Ne = (...g) => {
2112
+ Ce.apply(history, g), H("push");
2113
+ }, Me = (...g) => {
2114
+ ke.apply(history, g), H("replace");
1630
2115
  };
1631
- return history.pushState = ve, history.replaceState = be, D?.addEventListener("currententrychange", T), window.addEventListener("popstate", T), window.addEventListener("hashchange", T), () => {
1632
- R = !0, D?.removeEventListener("currententrychange", T), P(), _?.then((h) => h?.stop()), S?.teardown(), i(), a?.(), M.teardown(), window.removeEventListener("pagehide", $), window.removeEventListener("message", A), window.removeEventListener("popstate", T), window.removeEventListener("hashchange", T), history.pushState === ve && (history.pushState = G), history.replaceState === be && (history.replaceState = ye);
2116
+ return history.pushState = Ne, history.replaceState = Me, m?.addEventListener("currententrychange", H), window.addEventListener("popstate", H), window.addEventListener("hashchange", H), () => {
2117
+ v = !0, j.stop(), A?.(), m?.removeEventListener("currententrychange", H), O(), T?.then((g) => g?.stop()), _?.teardown(), i(), l?.(), C.teardown(), window.removeEventListener("pagehide", Y), window.removeEventListener("message", Ie), window.removeEventListener("popstate", H), window.removeEventListener("hashchange", H), history.pushState === Ne && (history.pushState = Ce), history.replaceState === Me && (history.replaceState = ke);
1633
2118
  };
1634
2119
  }
1635
- function lr() {
2120
+ function uo() {
1636
2121
  return typeof document > "u" ? null : document.currentScript ?? document.querySelector("script[data-leesto-connect]");
1637
2122
  }
1638
- function cr(e) {
2123
+ function fo(e) {
1639
2124
  const t = {}, n = e?.dataset.highlightColor;
1640
2125
  n && (t.highlightColor = n);
1641
2126
  const r = (e?.dataset.shellOrigin ?? "").split(",").map((o) => o.trim()).filter(Boolean);
1642
2127
  return r.length > 0 && (t.shellOrigins = r), t;
1643
2128
  }
1644
2129
  if (typeof window < "u") {
1645
- window.LeestoConnect = { connect: (t) => $e(t) };
1646
- const e = lr();
1647
- (!e || e.dataset.leestoManual === void 0) && $e(cr(e));
2130
+ window.LeestoConnect = { connect: (t) => et(t) };
2131
+ const e = uo();
2132
+ (!e || e.dataset.leestoManual === void 0) && et(fo(e));
1648
2133
  }
1649
2134
 
1650
2135
  //# sourceMappingURL=leesto-connect.js.map