leesto-connect 0.4.0 → 0.5.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 rt = "login", ot = "rrweb-buffer", it = 6e3, st = 3e3;
2
+ function at(e) {
3
3
  return typeof e == "object" && e !== null && typeof e.type == "string" && e.type.startsWith("leesto:");
4
4
  }
5
- var it = [
5
+ var lt = [
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
+ ], le = "mask_all";
10
+ function ct(e) {
11
+ return typeof e == "string" && lt.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 ut = "leesto_diag", ft = "leesto_run", Le = "X-Leesto-Run-Id", dt = "leesto_mask", pt = /^[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 te(e) {
15
+ return typeof e == "string" && pt.test(e);
16
16
  }
17
- function dt() {
17
+ function ht() {
18
18
  try {
19
19
  const e = globalThis.crypto, t = e?.randomUUID?.();
20
- if (ee(t)) return t;
20
+ if (te(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
- 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;
24
+ const r = Array.from(n, (i) => i.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 te(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(dt), [n] = t;
33
+ return t.some((r) => r !== n) ? le : ct(n) ? n : le;
34
34
  } catch {
35
- return ae;
35
+ return le;
36
36
  }
37
37
  }
38
- function ht(e) {
38
+ function gt(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(ft);
41
+ return te(t) ? t : void 0;
42
42
  } catch {
43
43
  return;
44
44
  }
45
45
  }
46
- function de(e) {
46
+ function pe(e) {
47
47
  try {
48
- return new URLSearchParams(e).get(lt) === "1";
48
+ return new URLSearchParams(e).get(ut) === "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 yt(e, t) {
54
+ if (pe(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 pe(n) ? n : "";
58
58
  }
59
- function gt(e) {
59
+ function vt(e) {
60
60
  try {
61
61
  const t = new URL(e);
62
62
  return `${t.origin}${t.pathname}`;
@@ -64,17 +64,17 @@ 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 Te = "leesto/console", bt = "leesto/network", wt = "leesto/network-ring", Et = "leesto/console-ring", St = {
68
68
  primary: "#08783f",
69
69
  hover: "#066633",
70
70
  foreground: "#f3fff7"
71
- }, Et = {
71
+ }, _t = {
72
72
  primary: "#46c383",
73
73
  hover: "#65d49b",
74
74
  foreground: "#082315"
75
- }, St = {
76
- light: wt,
77
- dark: Et
75
+ }, Rt = {
76
+ light: St,
77
+ dark: _t
78
78
  };
79
79
  function Z(e) {
80
80
  const t = [];
@@ -87,14 +87,14 @@ function Z(e) {
87
87
  }
88
88
  };
89
89
  }
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) {
90
+ var At = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, Lt = /\b\d{3}-\d{2}-\d{4}\b/g, Tt = /\d(?:[ -]?\d){12,18}/g, Ot = /\b(Bearer|Basic|Token)\s+(?=[A-Za-z0-9._~+/=-]*\d)[A-Za-z0-9._~+/=-]{6,}/gi, It = /\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, Nt = /\b((?:set-)?cookie)\b(["']?\s*[:=]\s*["']?)[^"'\r\n]+/gi, Ct = /\b(session(?:[-_]?id)?)\b(["']?\s*[:=]\s*["']?)(?=[^\s"'&,;}]{0,256}\d)[^\s"'&,;}]+/gi, xt = /\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g, Mt = /\bhttps?:\/\/[^\s"'<>)]+/gi, Dt = /(?::\d+){1,2}$/;
91
+ function $t(e) {
92
92
  const t = e.search(/[?#]/);
93
93
  if (t < 0) return e;
94
- const n = xt.exec(e.slice(t))?.[0] ?? "";
94
+ const n = Dt.exec(e.slice(t))?.[0] ?? "";
95
95
  return e.slice(0, t) + n;
96
96
  }
97
- function Dt(e) {
97
+ function Ft(e) {
98
98
  let t = 0, n = !1;
99
99
  for (let r = e.length - 1; r >= 0; r--) {
100
100
  let o = e.charCodeAt(r) - 48;
@@ -103,80 +103,80 @@ function Dt(e) {
103
103
  }
104
104
  return t % 10 === 0;
105
105
  }
106
- function pe(e) {
106
+ function he(e) {
107
107
  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) => {
108
+ let t = e.replace(Mt, $t).replace(It, "$1$2[secret masqué]").replace(Ot, "$1 [secret masqué]").replace(xt, "[jeton masqué]").replace(Nt, "$1$2[secret masqué]").replace(kt, "$1$2[secret masqué]").replace(Ct, "$1$2[secret masqué]");
109
+ return t = t.replace(At, "[email masqué]"), t = t.replace(Lt, "[id masqué]"), t = t.replace(Tt, (n) => {
110
110
  const r = n.replace(/[ -]/g, "");
111
- return r.length >= 13 && r.length <= 19 && Dt(r) ? "[carte masquée]" : n;
111
+ return r.length >= 13 && r.length <= 19 && Ft(r) ? "[carte masquée]" : n;
112
112
  }), t;
113
113
  }
114
114
  function W(e) {
115
115
  const t = typeof e == "string" ? e : e instanceof URL ? e.href : e instanceof Request ? e.url : String(e);
116
116
  try {
117
117
  const n = new URL(t, typeof location < "u" ? location.href : void 0);
118
- return n.origin + pe(n.pathname);
118
+ return n.origin + he(n.pathname);
119
119
  } catch {
120
- return pe(t.split("?")[0] ?? t);
120
+ return he(t.split("?")[0] ?? t);
121
121
  }
122
122
  }
123
- var $t = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]), Pt = ["deprecation", "intervention"], qt = { teardown: () => {
123
+ var Pt = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]), qt = ["deprecation", "intervention"], Bt = { teardown: () => {
124
124
  } };
125
- function Bt(e) {
125
+ function Ut(e) {
126
126
  const t = typeof performance < "u" ? performance.timeOrigin : 0;
127
127
  return Math.round(t + e);
128
128
  }
129
- function Ft(e) {
129
+ function Gt(e) {
130
130
  const t = e.responseStatus;
131
131
  return typeof t == "number" && t > 0 ? t : void 0;
132
132
  }
133
- function Ut(e) {
134
- if ($t.has(e.initiatorType)) return null;
135
- const t = Ft(e), n = e.transferSize || e.encodedBodySize || void 0;
133
+ function Ht(e) {
134
+ if (Pt.has(e.initiatorType)) return null;
135
+ const t = Gt(e), n = e.transferSize || e.encodedBodySize || void 0;
136
136
  return {
137
137
  method: "GET",
138
138
  url: W(e.name),
139
139
  ...t !== void 0 ? { status: t } : {},
140
140
  durationMs: Math.round(e.duration),
141
141
  ...n ? { responseSize: n } : {},
142
- startedAt: Bt(e.startTime),
142
+ startedAt: Ut(e.startTime),
143
143
  ...t !== void 0 && t >= 400 ? { failed: !0 } : {},
144
144
  initiatorType: e.initiatorType
145
145
  };
146
146
  }
147
- function Gt(e) {
148
- if (typeof window > "u") return qt;
147
+ function Wt(e) {
148
+ if (typeof window > "u") return Bt;
149
149
  const t = [];
150
150
  if (typeof PerformanceObserver < "u") try {
151
- const s = new PerformanceObserver((u) => {
151
+ const i = new PerformanceObserver((u) => {
152
152
  for (const l of u.getEntries()) try {
153
- const i = Ut(l);
154
- i && e.onResource(i);
153
+ const s = Ht(l);
154
+ s && e.onResource(s);
155
155
  } catch {
156
156
  }
157
157
  });
158
- s.observe({
158
+ i.observe({
159
159
  type: "resource",
160
160
  buffered: !0
161
- }), t.push(() => s.disconnect());
161
+ }), t.push(() => i.disconnect());
162
162
  } catch {
163
163
  }
164
164
  const n = window.ReportingObserver;
165
165
  if (n) try {
166
- const s = new n(((u) => {
166
+ const i = new n(((u) => {
167
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}`);
168
+ const s = typeof l.body?.message == "string" ? l.body.message : l.type;
169
+ e.onReport("warn", `Navigateur (${l.type}) : ${s}`);
170
170
  }
171
171
  }), {
172
- types: Pt,
172
+ types: qt,
173
173
  buffered: !0
174
174
  });
175
- s.observe(), t.push(() => s.disconnect());
175
+ i.observe(), t.push(() => i.disconnect());
176
176
  } catch {
177
177
  }
178
- const r = (s) => {
179
- const u = s;
178
+ const r = (i) => {
179
+ const u = i;
180
180
  e.onReport("error", `CSP : ${u.blockedURI || "ressource"} bloqué par « ${u.violatedDirective} »`);
181
181
  };
182
182
  window.addEventListener("securitypolicyviolation", r), t.push(() => window.removeEventListener("securitypolicyviolation", r));
@@ -184,27 +184,27 @@ function Gt(e) {
184
184
  return { teardown: () => {
185
185
  if (!o) {
186
186
  o = !0;
187
- for (const s of t) try {
188
- s();
187
+ for (const i of t) try {
188
+ i();
189
189
  } catch {
190
190
  }
191
191
  }
192
192
  } };
193
193
  }
194
- var Ht = 50, Wt = 30, jt = 100, zt = 50, K = 500, Pe = 8e3, Vt = K * 4, Xt = Pe * 2;
194
+ var zt = 50, jt = 30, Vt = 100, Xt = 50, K = 500, Pe = 8e3, Kt = K * 4, Yt = Pe * 2;
195
195
  function qe(e, t, n) {
196
- return pe(e.slice(0, n)).slice(0, t);
196
+ return he(e.slice(0, n)).slice(0, t);
197
197
  }
198
198
  function V(e) {
199
- return qe(e, K, Vt);
199
+ return qe(e, K, Kt);
200
200
  }
201
- var Kt = /(token|secret|passw(or)?d|api[-_]?key|authorization|cookie)$/i;
202
- function le(e) {
201
+ var Zt = /(token|secret|passw(or)?d|api[-_]?key|authorization|cookie)$/i;
202
+ function ce(e) {
203
203
  const t = e instanceof Error ? e.stack : void 0;
204
204
  if (t)
205
- return qe(t, Pe, Xt);
205
+ return qe(t, Pe, Yt);
206
206
  }
207
- function ce(e) {
207
+ function ue(e) {
208
208
  if (e instanceof Error) return `${e.name}: ${e.message}`;
209
209
  if (typeof e == "string") return e;
210
210
  if (typeof e == "object" && e !== null) {
@@ -212,7 +212,7 @@ function ce(e) {
212
212
  let n = K * 8;
213
213
  try {
214
214
  return JSON.stringify(e, (r, o) => {
215
- if (Kt.test(r)) return "[masqué]";
215
+ if (Zt.test(r)) return "[masqué]";
216
216
  if (n -= r.length + (typeof o == "string" ? o.length : 8), n < 0) throw t;
217
217
  return o;
218
218
  }).slice(0, K);
@@ -222,12 +222,12 @@ function ce(e) {
222
222
  }
223
223
  return String(e);
224
224
  }
225
- function Te(e) {
225
+ function Oe(e) {
226
226
  if (!e) return;
227
227
  const t = Number(e);
228
228
  return Number.isFinite(t) && t >= 0 ? t : void 0;
229
229
  }
230
- var Yt = {
230
+ var Jt = {
231
231
  snapshot: () => ({
232
232
  errors: [],
233
233
  logs: [],
@@ -241,9 +241,9 @@ var Yt = {
241
241
  }
242
242
  };
243
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) => {
246
- if (!s) return !1;
244
+ if (typeof window > "u") return Jt;
245
+ const t = Z(zt), n = Z(jt), r = Z(Vt), o = Z(Xt), i = te(e.runId) ? e.runId : void 0, u = (f) => {
246
+ if (!i) return !1;
247
247
  try {
248
248
  const p = new URL(String(f), location.href);
249
249
  return p.origin === location.origin || (e.runIdOrigins ?? []).includes(p.origin);
@@ -252,34 +252,34 @@ function Be(e) {
252
252
  }
253
253
  };
254
254
  let l = e.sink ?? null;
255
- const i = (f, p) => {
255
+ const s = (f, p) => {
256
256
  l?.(f, p);
257
257
  }, a = (f) => {
258
258
  e.captureNetwork && t.push(f);
259
259
  }, c = (f) => {
260
- e.captureNetwork && i(yt, f);
260
+ e.captureNetwork && s(bt, f);
261
261
  }, d = (f, p, m, E = {}) => {
262
262
  if (!p) return;
263
- const L = {
263
+ const I = {
264
264
  level: f,
265
265
  message: p,
266
266
  ...m ? { stack: m } : {},
267
267
  ...E,
268
268
  at: Date.now()
269
269
  };
270
- o.push(L), i(Ae, L);
271
- }, v = (f, p) => {
270
+ o.push(I), s(Te, I);
271
+ }, y = (f, p) => {
272
272
  try {
273
- const m = V(p.map(ce).join(" ")), E = p.find((L) => L instanceof Error);
274
- d(f, m, le(E), {
273
+ const m = V(p.map(ue).join(" ")), E = p.find((I) => I instanceof Error);
274
+ d(f, m, ce(E), {
275
275
  mechanism: "console",
276
276
  ...E instanceof Error && E.name ? { name: E.name } : {}
277
277
  });
278
278
  } catch {
279
279
  }
280
- }, g = (f, p) => {
280
+ }, b = (f, p) => {
281
281
  try {
282
- const m = V(p.map(ce).join(" "));
282
+ const m = V(p.map(ue).join(" "));
283
283
  m && r.push({
284
284
  level: f,
285
285
  message: m,
@@ -287,9 +287,9 @@ function Be(e) {
287
287
  });
288
288
  } catch {
289
289
  }
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) => {
290
+ }, w = console.error, _ = console.warn, R = console.log, S = console.info;
291
+ console.error = (...f) => (y("error", f), w.apply(console, f)), console.warn = (...f) => (y("warn", f), _.apply(console, f)), console.log = (...f) => (b("log", f), R.apply(console, f)), console.info = (...f) => (b("info", f), S.apply(console, f));
292
+ const A = (f) => {
293
293
  const p = f.target;
294
294
  if (p instanceof Element) {
295
295
  const E = p.src || p.href || "";
@@ -301,113 +301,113 @@ function Be(e) {
301
301
  return;
302
302
  }
303
303
  const m = f;
304
- d("error", V(`Erreur non gérée : ${m.message}`), le(m.error), {
304
+ d("error", V(`Erreur non gérée : ${m.message}`), ce(m.error), {
305
305
  mechanism: "window.error",
306
306
  ...typeof m.error?.name == "string" ? { name: m.error.name } : {},
307
307
  ...typeof m.filename == "string" && m.filename ? { sourceUrl: W(m.filename) } : {},
308
308
  ...typeof m.lineno == "number" && m.lineno > 0 ? { line: m.lineno } : {},
309
309
  ...typeof m.colno == "number" && m.colno > 0 ? { column: m.colno } : {}
310
310
  });
311
- }, N = (f) => {
312
- d("error", V(`Promesse rejetée : ${ce(f.reason)}`), le(f.reason), {
311
+ }, C = (f) => {
312
+ d("error", V(`Promesse rejetée : ${ue(f.reason)}`), ce(f.reason), {
313
313
  mechanism: "unhandledrejection",
314
314
  ...f.reason instanceof Error && f.reason.name ? { name: f.reason.name } : {}
315
315
  });
316
316
  };
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 = {
317
+ window.addEventListener("error", A, !0), window.addEventListener("unhandledrejection", C);
318
+ const O = typeof window.fetch == "function" ? window.fetch.bind(window) : null;
319
+ O && (window.fetch = (async (f, p) => {
320
+ const m = Date.now(), E = (p?.method ?? (f instanceof Request ? f.method : "GET") ?? "GET").toUpperCase(), I = W(f);
321
+ let B = p;
322
+ if (i && u(f)) {
323
+ const L = new Headers(f instanceof Request ? f.headers : void 0);
324
+ for (const [T, G] of new Headers(p?.headers)) L.set(T, G);
325
+ L.set(Le, i), B = {
326
326
  ...p,
327
- headers: A
327
+ headers: L
328
328
  };
329
329
  }
330
330
  try {
331
- const A = await x(f, F);
331
+ const L = await O(f, B);
332
332
  try {
333
- const T = A.headers.get("x-request-id"), G = A.headers.get("traceparent");
333
+ const T = L.headers.get("x-request-id"), G = L.headers.get("traceparent");
334
334
  a({
335
335
  method: E,
336
- url: L,
337
- status: A.status,
336
+ url: I,
337
+ status: L.status,
338
338
  durationMs: Date.now() - m,
339
- responseSize: Te(A.headers.get("content-length")),
340
- contentType: A.headers.get("content-type") ?? void 0,
339
+ responseSize: Oe(L.headers.get("content-length")),
340
+ contentType: L.headers.get("content-type") ?? void 0,
341
341
  startedAt: m,
342
342
  ...T ? { requestId: T.slice(0, 200) } : {},
343
343
  ...G ? { traceparent: G.slice(0, 200) } : {},
344
- ...s ? { runId: s } : {}
345
- }), A.ok || c({
344
+ ...i ? { runId: i } : {}
345
+ }), L.ok || c({
346
346
  method: E,
347
- url: L,
348
- status: A.status,
347
+ url: I,
348
+ status: L.status,
349
349
  durationMs: Date.now() - m
350
350
  });
351
351
  } catch {
352
352
  }
353
- return A;
354
- } catch (A) {
353
+ return L;
354
+ } catch (L) {
355
355
  try {
356
356
  const T = Date.now() - m;
357
357
  a({
358
358
  method: E,
359
- url: L,
359
+ url: I,
360
360
  status: 0,
361
361
  durationMs: T,
362
362
  startedAt: m,
363
363
  failed: !0,
364
- ...s ? { runId: s } : {}
364
+ ...i ? { runId: i } : {}
365
365
  }), c({
366
366
  method: E,
367
- url: L,
367
+ url: I,
368
368
  status: 0,
369
369
  durationMs: T
370
370
  });
371
371
  } catch {
372
372
  }
373
- throw A;
373
+ throw L;
374
374
  }
375
375
  }));
376
- const P = XMLHttpRequest.prototype.open, M = XMLHttpRequest.prototype.send, $ = "__echoNet";
376
+ const M = XMLHttpRequest.prototype.open, D = XMLHttpRequest.prototype.send, F = "__echoNet";
377
377
  XMLHttpRequest.prototype.open = function(f, p, ...m) {
378
- return this[$] = {
378
+ return this[F] = {
379
379
  method: (f || "GET").toUpperCase(),
380
380
  url: W(p),
381
381
  start: 0,
382
382
  propagate: u(p)
383
- }, P.apply(this, [
383
+ }, M.apply(this, [
384
384
  f,
385
385
  p,
386
386
  ...m
387
387
  ]);
388
388
  }, XMLHttpRequest.prototype.send = function(...f) {
389
- const p = this[$];
389
+ const p = this[F];
390
390
  if (p) {
391
- if (p.start = Date.now(), s && p.propagate) try {
392
- this.setRequestHeader(_e, s);
391
+ if (p.start = Date.now(), i && p.propagate) try {
392
+ this.setRequestHeader(Le, i);
393
393
  } catch {
394
394
  }
395
395
  this.addEventListener("loadend", () => {
396
396
  try {
397
- const m = Date.now() - p.start, E = this.status, L = E === 0, F = this.getResponseHeader("x-request-id"), A = this.getResponseHeader("traceparent");
397
+ const m = Date.now() - p.start, E = this.status, I = E === 0, B = this.getResponseHeader("x-request-id"), L = this.getResponseHeader("traceparent");
398
398
  a({
399
399
  method: p.method,
400
400
  url: p.url,
401
401
  status: E,
402
402
  durationMs: m,
403
- responseSize: Te(this.getResponseHeader("content-length")),
403
+ responseSize: Oe(this.getResponseHeader("content-length")),
404
404
  contentType: this.getResponseHeader("content-type") ?? void 0,
405
405
  startedAt: p.start,
406
- ...L ? { failed: !0 } : {},
407
- ...s ? { runId: s } : {},
408
- ...F ? { requestId: F.slice(0, 200) } : {},
409
- ...A ? { traceparent: A.slice(0, 200) } : {}
410
- }), (L || E >= 400) && c({
406
+ ...I ? { failed: !0 } : {},
407
+ ...i ? { runId: i } : {},
408
+ ...B ? { requestId: B.slice(0, 200) } : {},
409
+ ...L ? { traceparent: L.slice(0, 200) } : {}
410
+ }), (I || E >= 400) && c({
411
411
  method: p.method,
412
412
  url: p.url,
413
413
  status: E,
@@ -417,47 +417,47 @@ function Be(e) {
417
417
  }
418
418
  }, { once: !0 });
419
419
  }
420
- return M.apply(this, f);
420
+ return D.apply(this, f);
421
421
  };
422
- const B = Gt({
422
+ const q = Wt({
423
423
  onResource: (f) => {
424
- e.captureNetwork && n.push(s ? {
424
+ e.captureNetwork && n.push(i ? {
425
425
  ...f,
426
- runId: s
426
+ runId: i
427
427
  } : f);
428
428
  },
429
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) : [];
430
+ }), $ = () => e.captureNetwork ? [...t.snapshot(), ...n.snapshot()].sort((f, p) => f.startedAt - p.startedAt) : [];
431
431
  let U = !1;
432
432
  return {
433
433
  snapshot: () => ({
434
434
  errors: o.snapshot(),
435
435
  logs: r.snapshot(),
436
- network: D(),
437
- ...s ? { runId: s } : {}
436
+ network: $(),
437
+ ...i ? { runId: i } : {}
438
438
  }),
439
439
  setSink: (f) => {
440
440
  l = f;
441
441
  },
442
442
  flushRings: () => {
443
- const f = D();
444
- f.length > 0 && i(vt, { entries: f });
443
+ const f = $();
444
+ f.length > 0 && s(wt, { entries: f });
445
445
  const p = r.snapshot();
446
- p.length > 0 && i(bt, { entries: p });
446
+ p.length > 0 && s(Et, { entries: p });
447
447
  const m = o.snapshot();
448
- m.length > 0 && i(Ae, { entries: m });
448
+ m.length > 0 && s(Te, { entries: m });
449
449
  },
450
450
  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);
451
+ U || (U = !0, l = null, q.teardown(), console.error = w, console.warn = _, console.log = R, console.info = S, window.removeEventListener("error", A, !0), window.removeEventListener("unhandledrejection", C), O && (window.fetch = O), XMLHttpRequest.prototype.open = M, XMLHttpRequest.prototype.send = D);
452
452
  }
453
453
  };
454
454
  }
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) {
455
+ var ve = "leesto-mask", ne = "[data-leesto-block]", Ue = "leesto-mask-text", Ge = "[data-private]", He = `.${Ue}, ${Ge}`, Qt = 'img, picture, video, canvas, object, embed, svg image, input[type="image"]', en = 'button, a, [role="button"], [role="link"], input[type="button"], input[type="submit"], input[type="reset"]';
456
+ var We = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select';
457
+ function ze(e) {
458
458
  return e.replace(/\S/g, "*");
459
459
  }
460
- function Qt(e, t) {
460
+ function tn(e, t) {
461
461
  try {
462
462
  return e.closest(t);
463
463
  } catch {
@@ -465,27 +465,27 @@ function Qt(e, t) {
465
465
  }
466
466
  }
467
467
  function je(e) {
468
- return Qt(e, Ge) !== null;
468
+ return tn(e, He) !== null;
469
469
  }
470
- var en = `.${ge}, ${te}, ${Ge}`;
470
+ var nn = `.${ve}, ${ne}, ${He}`;
471
471
  function Y(e) {
472
472
  try {
473
- return e.closest(en) !== null;
473
+ return e.closest(nn) !== null;
474
474
  } catch {
475
475
  return !0;
476
476
  }
477
477
  }
478
- function ze(e) {
478
+ function Ve(e) {
479
479
  if (!e || typeof e.closest != "function") return !1;
480
480
  try {
481
- if (je(e) || e.matches(He)) return !1;
482
- const t = e.closest(Jt);
481
+ if (je(e) || e.matches(We)) return !1;
482
+ const t = e.closest(en);
483
483
  return t ? (t.textContent ?? "").trim().length <= 80 : !1;
484
484
  } catch {
485
485
  return !1;
486
486
  }
487
487
  }
488
- var Le = {
488
+ var Ie = {
489
489
  maskAllInputs: !0,
490
490
  maskInputOptions: {
491
491
  password: !0,
@@ -493,23 +493,23 @@ var Le = {
493
493
  tel: !0,
494
494
  text: !0
495
495
  },
496
- blockClass: ge,
497
- maskTextClass: Fe
496
+ blockClass: ve,
497
+ maskTextClass: Ue
498
498
  };
499
- function Ve(e) {
499
+ function Xe(e) {
500
500
  if (e === "inputs_only") return {
501
- ...Le,
502
- blockSelector: te,
503
- maskTextSelector: Ue
501
+ ...Ie,
502
+ blockSelector: ne,
503
+ maskTextSelector: Ge
504
504
  };
505
505
  const t = {
506
- ...Le,
507
- blockSelector: `${te}, ${Zt}`,
506
+ ...Ie,
507
+ blockSelector: `${ne}, ${Qt}`,
508
508
  maskTextSelector: "*"
509
509
  };
510
510
  return e === "labels_visible" ? {
511
511
  ...t,
512
- maskTextFn: (n, r) => ze(r) ? n : We(n)
512
+ maskTextFn: (n, r) => Ve(r) ? n : ze(n)
513
513
  } : t;
514
514
  }
515
515
  var ke = /* @__PURE__ */ new Set([
@@ -522,10 +522,10 @@ var ke = /* @__PURE__ */ new Set([
522
522
  "aria-placeholder",
523
523
  "aria-roledescription",
524
524
  "aria-valuetext"
525
- ]), tn = 2, nn = 3, rn = 4, on = 0, sn = 2;
526
- function an(e, t, n) {
525
+ ]), rn = 2, on = 3, sn = 4, an = 0, ln = 2;
526
+ function cn(e, t, n) {
527
527
  if (e) try {
528
- return e.matches(He);
528
+ return e.matches(We);
529
529
  } catch {
530
530
  return !0;
531
531
  }
@@ -535,7 +535,7 @@ function an(e, t, n) {
535
535
  const o = String(n.type ?? "").toLowerCase();
536
536
  return o !== "button" && o !== "submit" && o !== "reset";
537
537
  }
538
- function Xe(e, t, n) {
538
+ function Ke(e, t, n) {
539
539
  const r = e;
540
540
  if (!r || typeof r != "object" || !r.data) return e;
541
541
  const o = (a) => {
@@ -546,36 +546,36 @@ function Xe(e, t, n) {
546
546
  } catch {
547
547
  return null;
548
548
  }
549
- }, s = (a, c, d, v) => {
549
+ }, i = (a, c, d, y) => {
550
550
  if (c === "value") {
551
- if (an(a, d, v)) return !1;
551
+ if (cn(a, d, y)) return !1;
552
552
  } else if (!ke.has(c)) return !0;
553
- return !a || je(a) ? !1 : t === "inputs_only" ? !0 : t === "labels_visible" ? ze(a) : !1;
553
+ return !a || je(a) ? !1 : t === "inputs_only" ? !0 : t === "labels_visible" ? Ve(a) : !1;
554
554
  }, u = (a, c, d) => {
555
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));
556
+ for (const y of Object.keys(d)) {
557
+ const b = d[y];
558
+ typeof b != "string" || !b || y !== "value" && !ke.has(y) || i(a, y, c, d) || (d[y] = ze(b));
559
559
  }
560
560
  }, l = (a) => {
561
561
  const c = a ? [a] : [];
562
562
  for (; c.length > 0; ) {
563
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);
564
+ d.type === ln && d.attributes && u(o(d.id), String(d.tagName ?? ""), d.attributes), Array.isArray(d.childNodes) && c.push(...d.childNodes);
565
565
  }
566
- }, 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 ?? []) {
566
+ }, s = r.data;
567
+ if (r.type === sn && typeof s.href == "string") s.href = vt(s.href);
568
+ else if (r.type === rn) l(s.node);
569
+ else if (r.type === on && s.source === an) {
570
+ for (const a of s.adds ?? []) l(a.node);
571
+ for (const a of s.attributes ?? []) {
572
572
  const c = o(a.id);
573
573
  u(c, c?.tagName ?? "", a.attributes);
574
574
  }
575
575
  }
576
576
  return e;
577
577
  }
578
- var ln = 80, cn = {
578
+ var un = 80, fn = {
579
579
  a: "link",
580
580
  button: "button",
581
581
  img: "img",
@@ -588,7 +588,7 @@ var ln = 80, cn = {
588
588
  h5: "heading",
589
589
  h6: "heading",
590
590
  dialog: "dialog"
591
- }, un = {
591
+ }, dn = {
592
592
  button: "button",
593
593
  submit: "button",
594
594
  reset: "button",
@@ -597,41 +597,41 @@ var ln = 80, cn = {
597
597
  search: "searchbox"
598
598
  }, H = (e) => {
599
599
  const t = (e ?? "").replace(/\s+/g, " ").trim();
600
- return t ? t.slice(0, ln) : null;
600
+ return t ? t.slice(0, un) : null;
601
601
  };
602
- function fn(e) {
602
+ function pn(e) {
603
603
  const t = [];
604
604
  let n = 0;
605
605
  const r = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT);
606
606
  for (let o = r.nextNode(); o && n < 320; o = r.nextNode()) {
607
- const s = o.parentElement;
608
- if (s && s !== e && Y(s)) continue;
607
+ const i = o.parentElement;
608
+ if (i && i !== e && Y(i)) continue;
609
609
  const u = o.nodeValue ?? "";
610
610
  u.trim() && (t.push(u), n += u.length);
611
611
  }
612
612
  return t.join(" ");
613
613
  }
614
- function dn(e, t) {
614
+ function hn(e, t) {
615
615
  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);
616
+ return n || (t === "input" ? dn[e.type] ?? "textbox" : t === "a" && !e.hasAttribute("href") ? null : fn[t] ?? null);
617
617
  }
618
- function pn(e) {
618
+ function mn(e) {
619
619
  const t = (e.getAttribute("aria-labelledby")?.split(/\s+/).filter(Boolean) ?? []).map((n) => {
620
620
  const r = e.ownerDocument.getElementById(n);
621
621
  return r && !Y(r) ? r.textContent ?? "" : "";
622
622
  });
623
623
  return H(t.join(" "));
624
624
  }
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"));
625
+ function gn(e, t) {
626
+ const n = H(e.getAttribute("aria-label")) ?? mn(e) ?? (t === "img" ? H(e.getAttribute("alt")) : null) ?? H(e.getAttribute("title"));
627
627
  if (n) return n;
628
628
  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"));
629
+ const r = e.getAttribute("id"), o = r ? e.ownerDocument.querySelector(`label[for="${CSS.escape(r)}"]`) : null, i = o && !Y(o) ? o.textContent : null;
630
+ return H(i) ?? H(e.getAttribute("placeholder"));
631
631
  }
632
- return H(fn(e));
632
+ return H(pn(e));
633
633
  }
634
- function mn(e) {
634
+ function yn(e) {
635
635
  if (!e) return null;
636
636
  try {
637
637
  const t = new URL(e, document.baseURI);
@@ -640,29 +640,52 @@ function mn(e) {
640
640
  return null;
641
641
  }
642
642
  }
643
- function gn(e) {
643
+ function vn(e) {
644
644
  const t = e.tagName.toLowerCase(), n = Y(e), r = {
645
645
  tag: t,
646
- role: dn(e, t),
647
- name: n ? null : hn(e, t)
646
+ role: hn(e, t),
647
+ name: n ? null : gn(e, t)
648
648
  };
649
649
  return e instanceof HTMLImageElement && (r.image = {
650
- src: n ? null : mn(e.currentSrc || e.getAttribute("src") || ""),
650
+ src: n ? null : yn(e.currentSrc || e.getAttribute("src") || ""),
651
651
  loaded: e.complete && e.naturalWidth > 0
652
652
  }), r;
653
653
  }
654
- var yn = 100, vn = [
654
+ var bn = /\b(se deconnecter|deconnexion|log ?out|sign ?out)\b/, wn = /\/(logout|log-out|signout|sign-out|deconnexion)\b/i, En = 'a, button, [role="button"], [role="menuitem"], input[type="submit"], input[type="button"]', Sn = 3;
655
+ function me(e) {
656
+ return (e ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/\s+/g, " ").trim().toLowerCase();
657
+ }
658
+ function _n(e) {
659
+ const t = e.getAttribute("aria-label");
660
+ return t || (e instanceof HTMLInputElement ? e.value : e.textContent ?? "");
661
+ }
662
+ function Rn(e) {
663
+ for (const t of Array.from(e.querySelectorAll(En))) {
664
+ if (bn.test(me(_n(t)))) return !0;
665
+ const n = t.getAttribute("href");
666
+ if (n && wn.test(n)) return !0;
667
+ }
668
+ return !1;
669
+ }
670
+ function An(e, t) {
671
+ const n = me(t);
672
+ return n.length < Sn || !e.body ? !1 : me(e.body.innerText ?? e.body.textContent).includes(n);
673
+ }
674
+ function Ln(e, t) {
675
+ return An(e, t) ? "same-account" : Rn(e) ? "signed-in" : "unknown";
676
+ }
677
+ var Tn = 100, On = 800, In = [
655
678
  "hidden",
656
679
  "class",
657
680
  "style",
658
681
  "type",
659
682
  "disabled",
660
683
  "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;
684
+ ], ie = 'input[type="password"]', Ye = 'input[autocomplete="username"], input[autocomplete="email"], input[type="email"]', se = `${ie}, ${Ye}`, re = /\b(connexion|se connecter|connectez[- ]vous|s'identifier|identifiez[- ]vous|login|log ?in|sign ?in)\b/, ge = /\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/, kn = /\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/, Nn = /\b(afficher|masquer|voir|show|hide|toggle)\b/, Cn = /\b(effacer|vider|supprimer|clear|reset)\b/, xn = /[\u{1F441}\u{1F576}\u{1F440}]/u;
662
685
  function X(e) {
663
686
  return (e ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[’‘]/g, "'").replace(/\s+/g, " ").trim().toLowerCase();
664
687
  }
665
- function ie(e) {
688
+ function ae(e) {
666
689
  let t = e;
667
690
  for (; t; ) {
668
691
  if (t.hasAttribute("hidden") || t.getAttribute("aria-hidden") === "true" || t instanceof HTMLInputElement && t.type === "hidden") return !1;
@@ -672,43 +695,43 @@ function ie(e) {
672
695
  }
673
696
  return !0;
674
697
  }
675
- function j(e, t) {
676
- return Array.from(e.querySelectorAll(t)).filter(ie);
698
+ function z(e, t) {
699
+ return Array.from(e.querySelectorAll(t)).filter(ae);
677
700
  }
678
- function Rn(e) {
701
+ function Mn(e) {
679
702
  return e ? e instanceof HTMLInputElement ? e.value : e.textContent ?? "" : "";
680
703
  }
681
- function Ye(e, t) {
704
+ function Ze(e, t) {
682
705
  return !e.outsideForms || !t.closest("form");
683
706
  }
684
707
  function J(e, t) {
685
- return Array.from(e.scope.querySelectorAll(t)).filter((n) => ie(n) && Ye(e, n));
708
+ return Array.from(e.scope.querySelectorAll(t)).filter((n) => ae(n) && Ze(e, n));
686
709
  }
687
- function re(e) {
710
+ function oe(e) {
688
711
  return X(e.getAttribute("aria-label") ?? e.getAttribute("title") ?? e.textContent);
689
712
  }
690
- function _n(e) {
691
- const t = re(e);
692
- return wn.test(t) || Sn.test(t);
713
+ function Dn(e) {
714
+ const t = oe(e);
715
+ return Nn.test(t) || xn.test(t);
693
716
  }
694
- function An(e, t) {
717
+ function $n(e, t) {
695
718
  if (e.getAttribute("type") === "submit" || !t) return !1;
696
719
  const n = e.parentElement;
697
- return !n || j(n, se).length === 0 ? !1 : !n.contains(t);
720
+ return !n || z(n, se).length === 0 ? !1 : !n.contains(t);
698
721
  }
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);
722
+ var Fn = 'button, input[type="submit"], input[type="button"], input[type="image"], a[href]';
723
+ function Pn(e) {
724
+ return Array.from(e.querySelectorAll(Fn)).some(ae);
702
725
  }
703
- function kn(e, t) {
726
+ function qn(e, t) {
704
727
  let n = e.parentElement;
705
728
  for (; n && !n.contains(t); ) {
706
- if (Ln(n)) return !0;
729
+ if (Pn(n)) return !0;
707
730
  n = n.parentElement;
708
731
  }
709
732
  return !1;
710
733
  }
711
- function On(e) {
734
+ function Bn(e) {
712
735
  const t = [
713
736
  e.getAttribute("name"),
714
737
  e.getAttribute("id"),
@@ -722,78 +745,78 @@ function On(e) {
722
745
  }
723
746
  return X(t.filter(Boolean).join(" "));
724
747
  }
725
- function In(e, t) {
748
+ function Un(e, t) {
726
749
  const n = e.parentElement;
727
750
  if (!n) return null;
728
- const r = e.ownerDocument.body, o = (c) => t ? Ze({
751
+ const r = e.ownerDocument.body, o = (c) => t ? Je({
729
752
  scope: c,
730
753
  outsideForms: !0
731
- }, t) : e, s = (c) => me({
754
+ }, t) : e, i = (c) => ye({
732
755
  scope: c,
733
756
  outsideForms: !0
734
- }, e, o(c)), u = (c) => !!o(c) && !!s(c);
735
- let l = n, i = null;
757
+ }, e, o(c)), u = (c) => !!o(c) && !!i(c);
758
+ let l = n, s = null;
736
759
  const a = (c) => {
737
- const d = s(c);
738
- d && !i && ne.test(re(d)) && (i = c);
760
+ const d = i(c);
761
+ d && !s && re.test(oe(d)) && (s = c);
739
762
  };
740
763
  for (a(n); l !== r && !u(l); ) {
741
764
  const c = l.parentElement;
742
765
  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;
766
+ const d = [e], y = o(l);
767
+ y && y !== e && d.push(y);
768
+ const b = !!y;
769
+ if (z(c, se).filter((w) => !w.closest("form") && !d.includes(w)).some((w) => w.matches(ie) || b || ge.test(Bn(w)) ? !0 : qn(w, e))) break;
747
770
  l = c, a(c);
748
771
  }
749
772
  return {
750
- scope: u(l) ? l : i ?? n,
773
+ scope: u(l) ? l : s ?? n,
751
774
  outsideForms: !0
752
775
  };
753
776
  }
754
- function Oe(e, t, n) {
777
+ function Ne(e, t, n) {
755
778
  return e ? {
756
779
  scope: e,
757
780
  outsideForms: !1
758
- } : In(t, n);
781
+ } : Un(t, n);
759
782
  }
760
- function Cn(e, t) {
783
+ function Gn(e, t) {
761
784
  let n = e.parentElement;
762
785
  for (; n && n !== t.scope; ) {
763
- if (j(n, se).length === 1) return !0;
786
+ if (z(n, se).length === 1) return !0;
764
787
  n = n.parentElement;
765
788
  }
766
789
  return !1;
767
790
  }
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));
791
+ function ye(e, t, n) {
792
+ const r = (s) => !!(t.compareDocumentPosition(s) & Node.DOCUMENT_POSITION_FOLLOWING), o = Array.from(e.scope.querySelectorAll('button, input[type="submit"]')).filter((s) => ae(s) && Ze(e, s) && (s.getAttribute("type") === "submit" || r(s)) && !Dn(s) && !Cn.test(oe(s)) && !$n(s, n));
770
793
  if (o.length === 0) return null;
771
- const s = (i, a) => {
772
- const c = r(i);
794
+ const i = (s, a) => {
795
+ const c = r(s);
773
796
  return [
774
- Cn(i, e) ? 1 : 0,
775
- ne.test(re(i)) ? 0 : 1,
776
- i.getAttribute("type") === "submit" ? 0 : 1,
797
+ Gn(s, e) ? 1 : 0,
798
+ re.test(oe(s)) ? 0 : 1,
799
+ s.getAttribute("type") === "submit" ? 0 : 1,
777
800
  c ? 0 : 1,
778
801
  c ? a : -a
779
802
  ];
780
803
  };
781
- let u = o[0], l = s(u, 0);
782
- return o.forEach((i, a) => {
783
- const c = s(i, a);
804
+ let u = o[0], l = i(u, 0);
805
+ return o.forEach((s, a) => {
806
+ const c = i(s, a);
784
807
  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);
808
+ const y = c[d], b = l[d];
809
+ if (y !== b) {
810
+ y < b && (u = s, l = c);
788
811
  return;
789
812
  }
790
813
  }
791
814
  }), u;
792
815
  }
793
- function Ie(e) {
794
- return e.querySelectorAll("form").length + (j(e, se).some((t) => !t.closest("form")) ? 1 : 0) === 1;
816
+ function Ce(e) {
817
+ return e.querySelectorAll("form").length + (z(e, se).some((t) => !t.closest("form")) ? 1 : 0) === 1;
795
818
  }
796
- function Nn(e, t) {
819
+ function Hn(e, t) {
797
820
  if (e) {
798
821
  const n = e.getAttribute("aria-label");
799
822
  if (n) return n;
@@ -804,65 +827,65 @@ function Nn(e, t) {
804
827
  }
805
828
  const o = e.querySelector("h1, h2, h3, legend");
806
829
  if (o) return o.textContent ?? "";
807
- let s = e.previousElementSibling;
808
- for (; s; ) {
809
- const l = /^(h1|h2|h3|legend)$/i.test(s.tagName) ? s : s.querySelector("h1, h2, h3, legend");
830
+ let i = e.previousElementSibling;
831
+ for (; i; ) {
832
+ const l = /^(h1|h2|h3|legend)$/i.test(i.tagName) ? i : i.querySelector("h1, h2, h3, legend");
810
833
  if (l) {
811
- const i = e.parentElement;
812
- return i && Ie(i) ? l.textContent ?? "" : "";
834
+ const s = e.parentElement;
835
+ return s && Ce(s) ? l.textContent ?? "" : "";
813
836
  }
814
- s = s.previousElementSibling;
837
+ i = i.previousElementSibling;
815
838
  }
816
839
  const u = e.closest("section, article, aside, dialog, fieldset, [role='dialog'], [role='region']");
817
840
  if (u && u !== e) {
818
841
  const l = u.querySelector("h1, h2, h3, legend");
819
842
  if (l)
820
- return Ie(u) ? l.textContent ?? "" : "";
843
+ return Ce(u) ? l.textContent ?? "" : "";
821
844
  }
822
845
  return "";
823
846
  }
824
847
  return (t instanceof Document ? t.body : t)?.querySelector("h1, h2, h3")?.textContent ?? "";
825
848
  }
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([
849
+ function xe(e, t, n) {
850
+ const r = X(Mn(n)), o = X(Hn(e, t)), i = (e?.getAttribute("action") ?? "").split("?")[0], u = X([
828
851
  e?.id,
829
852
  e?.getAttribute("name"),
830
853
  e?.className,
831
- s
854
+ i
832
855
  ].filter(Boolean).join(" "));
833
856
  return {
834
- positive: ne.test(r) || ne.test(o),
835
- negative: he.test(r) || he.test(o) || bn.test(u)
857
+ positive: re.test(r) || re.test(o),
858
+ negative: ge.test(r) || ge.test(o) || kn.test(u)
836
859
  };
837
860
  }
838
- function Ze(e, t) {
861
+ function Je(e, t) {
839
862
  const n = J(e, 'input[autocomplete="username"]')[0] ?? J(e, 'input[autocomplete="email"]')[0] ?? J(e, 'input[type="email"]')[0];
840
863
  if (n) return n;
841
864
  if (!t) return null;
842
865
  const r = J(e, 'input[type="text"], input:not([type])').filter((o) => o.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
843
866
  return r[r.length - 1] ?? null;
844
867
  }
845
- function ue(e, t) {
868
+ function fe(e, t) {
846
869
  if (t.querySelector('input[autocomplete="new-password"]')) return null;
847
- const n = j(t, oe);
870
+ const n = z(t, ie);
848
871
  if (n.length > 1) return null;
849
872
  if (n.length === 1) {
850
- const i = n[0], a = Oe(e, i, i);
873
+ const s = n[0], a = Ne(e, s, s);
851
874
  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 : {
875
+ const c = Je(a, s), d = ye(a, s, c), y = xe(e, t, d);
876
+ return !(s.autocomplete === "current-password" || y.positive) || y.negative ? null : {
854
877
  kind: "password",
855
878
  form: e,
856
879
  identifier: c,
857
- password: i,
880
+ password: s,
858
881
  submit: d
859
882
  };
860
883
  }
861
- const r = j(t, Ke);
884
+ const r = z(t, Ye);
862
885
  if (r.length !== 1) return null;
863
- const o = r[0], s = Oe(e, o, null);
864
- if (!s) return null;
865
- const u = me(s, o, o), l = Ce(e, t, u);
886
+ const o = r[0], i = Ne(e, o, null);
887
+ if (!i) return null;
888
+ const u = ye(i, o, o), l = xe(e, t, u);
866
889
  return !(o.autocomplete === "username" || l.positive) || l.negative ? null : {
867
890
  kind: "identifier",
868
891
  form: e,
@@ -871,22 +894,22 @@ function ue(e, t) {
871
894
  submit: u
872
895
  };
873
896
  }
874
- function Ne(e = document) {
897
+ function Q(e = document) {
875
898
  const t = Array.from(e.querySelectorAll("form"));
876
899
  for (const n of t) {
877
- const r = ue(n, n);
900
+ const r = fe(n, n);
878
901
  if (r) return r;
879
902
  }
880
- return t.length === 0 || j(e, oe).find((n) => !n.closest("form")) ? ue(null, e) : null;
903
+ return t.length === 0 || z(e, ie).find((n) => !n.closest("form")) ? fe(null, e) : null;
881
904
  }
882
- function xe(e, t) {
905
+ function Me(e, t) {
883
906
  const n = Object.getPrototypeOf(e), r = Object.getOwnPropertyDescriptor(n, "value")?.set ?? Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
884
907
  r ? r.call(e, t) : e.value = t, e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
885
908
  }
886
- function xn(e) {
909
+ function Wn(e) {
887
910
  return !!e.form || !!e.submit;
888
911
  }
889
- function Mn(e) {
912
+ function zn(e) {
890
913
  const t = e.form, n = t?.noValidate;
891
914
  t && (t.noValidate = !0);
892
915
  try {
@@ -895,28 +918,28 @@ function Mn(e) {
895
918
  t && (t.noValidate = n ?? !1);
896
919
  }
897
920
  }
898
- var Dn = {
921
+ var jn = {
899
922
  identifier: null,
900
923
  password: null
901
924
  };
902
- function Me(e, t) {
925
+ function De(e, t) {
903
926
  return !e || e.disabled || e.readOnly ? !1 : e.value === "" || t !== null && e.value === t;
904
927
  }
905
- function Je(e, t, n) {
928
+ function Qe(e, t, n) {
906
929
  return {
907
- identifier: Me(e.identifier, n.identifier) && !t.identifier,
908
- password: Me(e.password, n.password) && !t.password
930
+ identifier: De(e.identifier, n.identifier) && !t.identifier,
931
+ password: De(e.password, n.password) && !t.password
909
932
  };
910
933
  }
911
- function $n(e, t, n) {
934
+ function Vn(e, t, n) {
912
935
  const r = e.identifier;
913
936
  return !r || n.identifier ? !1 : r.value !== "" && r.value !== t.login;
914
937
  }
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" };
938
+ function Xn(e, t, n, r = jn) {
939
+ const o = Qe(e, n, r);
940
+ return !o.identifier && !o.password ? { error: "nothing-to-fill" } : Vn(e, t, o) ? { error: "identifier-mismatch" } : Wn(e) ? (o.identifier && Me(e.identifier, t.login), o.password && Me(e.password, t.password), zn(e) ? { step: o.identifier && o.password ? "both" : o.password ? "password" : "identifier" } : { error: "no-submit" }) : { error: "no-submit" };
918
941
  }
919
- function qn(e) {
942
+ function Kn(e) {
920
943
  if (typeof window > "u" || typeof MutationObserver > "u") return {
921
944
  watch() {
922
945
  },
@@ -933,101 +956,112 @@ function qn(e) {
933
956
  }, r = {
934
957
  identifier: null,
935
958
  password: null
936
- }, o = !1, s = null, u = null, l = null;
937
- const i = () => {
959
+ }, o = !1, i = null, u = null, l = null, s = null, a = 0;
960
+ const c = () => {
938
961
  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) {
962
+ }, d = () => {
963
+ s && clearTimeout(s), s = null, a = 0;
964
+ }, y = () => {
965
+ if (s = null, a = 0, !t || n.identifier || n.password || Q(document)) return;
966
+ const A = Ln(document, t.login);
967
+ t = null, e.onNoForm(A);
968
+ }, b = () => {
969
+ if (!a) return;
970
+ s && clearTimeout(s);
971
+ const A = Math.max(0, a - Date.now());
972
+ s = setTimeout(y, Math.min(On, A));
973
+ }, w = () => {
974
+ i?.disconnect(), i = null, c(), d(), u && clearTimeout(u), u = null;
975
+ }, _ = () => {
976
+ const A = Q(document);
977
+ if (!A) {
944
978
  o = !1, r = {
945
979
  identifier: null,
946
980
  password: null
947
- }, i();
981
+ }, c();
948
982
  return;
949
983
  }
950
984
  if (!t)
951
985
  o || (o = !0, e.onDetected());
952
986
  else {
953
- const w = Je(g, n, r), S = Pn(g, t, n, r);
954
- if ("error" in S || (w.identifier && (n = {
987
+ const C = Qe(A, n, r), O = Xn(A, t, n, r);
988
+ if ("error" in O || (C.identifier && (n = {
955
989
  ...n,
956
990
  identifier: !0
957
991
  }, r = {
958
992
  ...r,
959
993
  identifier: t.login
960
- }), w.password && (n = {
994
+ }), C.password && (n = {
961
995
  ...n,
962
996
  password: !0
963
997
  }, r = {
964
998
  ...r,
965
999
  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());
1000
+ })), "error" in O) {
1001
+ const M = O.error !== "nothing-to-fill" ? O.error : !n.identifier && !n.password ? "already-filled" : null;
1002
+ M && (e.onError(M), t = null, w());
969
1003
  } else
970
- e.onFilled(S.step), n.password && (t = null, i(), l = setTimeout(() => {
971
- l = null, Ne(document) && (o = !0, e.onDetected());
972
- }, ot));
1004
+ e.onFilled(O.step), n.password && (t = null, c(), l = setTimeout(() => {
1005
+ l = null, Q(document) && (o = !0, e.onDetected());
1006
+ }, it));
973
1007
  }
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, {
1008
+ }, R = () => {
1009
+ b(), u && clearTimeout(u), u = setTimeout(() => {
1010
+ u = null, _();
1011
+ }, Tn);
1012
+ }, S = () => {
1013
+ i || (i = new MutationObserver(R), i.observe(document.body, {
980
1014
  childList: !0,
981
1015
  subtree: !0,
982
1016
  attributes: !0,
983
- attributeFilter: vn
1017
+ attributeFilter: In
984
1018
  }));
985
1019
  };
986
1020
  return {
987
1021
  watch() {
988
- s || (o = !1, v()), c();
1022
+ i || (o = !1, S()), _();
989
1023
  },
990
- fill(g) {
991
- t = g, v(), c();
1024
+ fill(A) {
1025
+ d(), t = A, S(), _(), t && !n.identifier && !n.password && !Q(document) && (a = Date.now() + st, b());
992
1026
  },
993
1027
  cancel() {
994
1028
  t = null, n = {
995
1029
  identifier: !1,
996
1030
  password: !1
997
- }, o = !1, a();
1031
+ }, o = !1, w();
998
1032
  },
999
1033
  teardown() {
1000
- t = null, a();
1034
+ t = null, w();
1001
1035
  }
1002
1036
  };
1003
1037
  }
1004
- var Bn = "leesto/navigation";
1005
- function Fn(e) {
1038
+ var Yn = "leesto/navigation";
1039
+ function Zn(e) {
1006
1040
  const t = e?.timestamp;
1007
1041
  return typeof t == "number" ? t : void 0;
1008
1042
  }
1009
- function Un(e) {
1043
+ function Jn(e) {
1010
1044
  return e?.type === 4;
1011
1045
  }
1012
- function Gn(e) {
1046
+ function Qn(e) {
1013
1047
  try {
1014
1048
  return JSON.stringify(e)?.length ?? 0;
1015
1049
  } catch {
1016
1050
  return 0;
1017
1051
  }
1018
1052
  }
1019
- function Hn(e) {
1020
- const t = e.now ?? Date.now, n = e.measure ?? Gn;
1021
- let r = [], o = 0, s = !1, u = Number.NEGATIVE_INFINITY;
1053
+ function er(e) {
1054
+ const t = e.now ?? Date.now, n = e.measure ?? Qn;
1055
+ let r = [], o = 0, i = !1, u = Number.NEGATIVE_INFINITY;
1022
1056
  const l = () => {
1023
1057
  const a = r.shift();
1024
1058
  a && (o -= a.bytes);
1025
- }, i = () => {
1026
- if (!s) {
1059
+ }, s = () => {
1060
+ if (!i) {
1027
1061
  const d = t() - e.windowMs;
1028
1062
  for (; r.length > 1 && (r[1]?.start ?? Number.POSITIVE_INFINITY) <= d; ) l();
1029
1063
  }
1030
- const a = s ? e.heldMaxBytes : e.maxBytes;
1064
+ const a = i ? e.heldMaxBytes : e.maxBytes;
1031
1065
  for (; o > a && r.length > 1; ) l();
1032
1066
  const c = r[r.length - 1];
1033
1067
  if (o > a && e.requestCheckout && (c?.events.length ?? 0) > 2) {
@@ -1038,8 +1072,8 @@ function Hn(e) {
1038
1072
  return {
1039
1073
  push(a) {
1040
1074
  const c = n(a);
1041
- if (Un(a)) r.push({
1042
- start: Fn(a) ?? t(),
1075
+ if (Jn(a)) r.push({
1076
+ start: Zn(a) ?? t(),
1043
1077
  events: [a],
1044
1078
  bytes: c
1045
1079
  });
@@ -1048,7 +1082,7 @@ function Hn(e) {
1048
1082
  if (!d) return;
1049
1083
  d.events.push(a), d.bytes += c;
1050
1084
  }
1051
- o += c, i();
1085
+ o += c, s();
1052
1086
  },
1053
1087
  snapshot() {
1054
1088
  const a = [];
@@ -1056,10 +1090,10 @@ function Hn(e) {
1056
1090
  return a;
1057
1091
  },
1058
1092
  hold() {
1059
- i(), s = !0;
1093
+ s(), i = !0;
1060
1094
  },
1061
1095
  release() {
1062
- s = !1, i();
1096
+ i = !1, s();
1063
1097
  },
1064
1098
  stats() {
1065
1099
  let a = 0;
@@ -1068,7 +1102,7 @@ function Hn(e) {
1068
1102
  segments: r.length,
1069
1103
  events: a,
1070
1104
  bytes: o,
1071
- held: s
1105
+ held: i
1072
1106
  };
1073
1107
  },
1074
1108
  clear() {
@@ -1076,53 +1110,53 @@ function Hn(e) {
1076
1110
  }
1077
1111
  };
1078
1112
  }
1079
- var Qe = 6e5, et = 1e3, Wn = {
1113
+ var et = 6e5, tt = 1e3, tr = {
1080
1114
  mousemove: 100,
1081
1115
  scroll: 150
1082
- }, jn = {
1116
+ }, nr = {
1083
1117
  windowMs: 12e4,
1084
1118
  checkoutEveryNms: 6e4,
1085
1119
  maxBytes: 8388608,
1086
1120
  heldMaxBytes: 33554432,
1087
1121
  minCheckoutIntervalMs: 15e3,
1088
- sampling: Wn
1089
- }, zn = 5;
1090
- async function Vn(e) {
1122
+ sampling: tr
1123
+ }, rr = 5;
1124
+ async function or(e) {
1091
1125
  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;
1093
- const i = () => {
1094
- if (s.length === 0) return;
1095
- const R = s;
1096
- s = [], e.onBatch(R);
1126
+ let i = [], u = !1, l = 0;
1127
+ const s = () => {
1128
+ if (i.length === 0) return;
1129
+ const R = i;
1130
+ i = [], e.onBatch(R);
1097
1131
  }, a = t({
1098
1132
  emit(R) {
1099
- s.push(Xe(R, r, (_) => t.mirror.getNode(_)));
1133
+ i.push(Ke(R, r, (S) => t.mirror.getNode(S)));
1100
1134
  },
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, _) => {
1135
+ ...Xe(r)
1136
+ }), c = e.diagnostics ?? null, d = a ? c ?? Be({ captureNetwork: e.captureNetwork !== !1 }) : null, y = d !== null && c === null;
1137
+ d?.setSink((R, S) => {
1104
1138
  try {
1105
- n(R, _);
1139
+ n(R, S);
1106
1140
  } catch {
1107
1141
  }
1108
1142
  });
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);
1143
+ const b = setInterval(s, tt), w = { timer: null }, _ = () => (u || (u = !0, clearInterval(b), clearTimeout(w.timer ?? void 0), d?.flushRings(), d?.setSink(null), y && d?.teardown(), a?.(), s(), l = Date.now() - o), l);
1110
1144
  return w.timer = setTimeout(() => {
1111
- S(), e.onCap();
1112
- }, Qe), { stop: S };
1145
+ _(), e.onCap();
1146
+ }, et), { stop: _ };
1113
1147
  }
1114
- async function Xn(e) {
1148
+ async function ir(e) {
1115
1149
  const { record: t, addCustomEvent: n } = await import("./chunks/rrweb-qwppqH_c.js"), r = {
1116
- ...jn,
1150
+ ...nr,
1117
1151
  ...e.config
1118
- }, { diagnostics: o } = e, s = e.maskPolicy ?? "mask_all";
1119
- let u = !1, l = null, i = null;
1152
+ }, { diagnostics: o } = e, i = e.maskPolicy ?? "mask_all";
1153
+ let u = !1, l = null, s = null;
1120
1154
  const a = () => {
1121
1155
  try {
1122
1156
  t.takeFullSnapshot(!0);
1123
1157
  } catch {
1124
1158
  }
1125
- }, c = Hn({
1159
+ }, c = er({
1126
1160
  windowMs: r.windowMs,
1127
1161
  maxBytes: r.maxBytes,
1128
1162
  heldMaxBytes: r.heldMaxBytes,
@@ -1131,30 +1165,30 @@ async function Xn(e) {
1131
1165
  u || a();
1132
1166
  })
1133
1167
  }), d = t({
1134
- emit(g) {
1135
- const w = Xe(g, s, (S) => t.mirror.getNode(S));
1168
+ emit(b) {
1169
+ const w = Ke(b, i, (_) => t.mirror.getNode(_));
1136
1170
  c.push(w), l?.(w);
1137
1171
  },
1138
1172
  checkoutEveryNms: r.checkoutEveryNms,
1139
1173
  sampling: r.sampling,
1140
- ...Ve(s)
1174
+ ...Xe(i)
1141
1175
  });
1142
1176
  if (!d) return null;
1143
- const v = (g, w) => {
1177
+ const y = (b, w) => {
1144
1178
  try {
1145
- n(g, w);
1179
+ n(b, w);
1146
1180
  } catch {
1147
1181
  }
1148
1182
  };
1149
- return o.setSink(v), {
1183
+ return o.setSink(y), {
1150
1184
  snapshot() {
1151
- const g = c.snapshot(), w = Date.now();
1152
- o.setSink((R, _) => {
1153
- g.push({
1154
- type: zn,
1185
+ const b = c.snapshot(), w = Date.now();
1186
+ o.setSink((R, S) => {
1187
+ b.push({
1188
+ type: rr,
1155
1189
  data: {
1156
1190
  tag: R,
1157
- payload: _
1191
+ payload: S
1158
1192
  },
1159
1193
  timestamp: w
1160
1194
  });
@@ -1162,46 +1196,46 @@ async function Xn(e) {
1162
1196
  try {
1163
1197
  o.flushRings();
1164
1198
  } finally {
1165
- o.setSink(u ? null : v);
1199
+ o.setSink(u ? null : y);
1166
1200
  }
1167
- const S = g[0]?.timestamp;
1201
+ const _ = b[0]?.timestamp;
1168
1202
  return {
1169
- events: g,
1170
- durationMs: typeof S == "number" ? Math.max(0, w - S) : 0
1203
+ events: b,
1204
+ durationMs: typeof _ == "number" ? Math.max(0, w - _) : 0
1171
1205
  };
1172
1206
  },
1173
1207
  hold: () => c.hold(),
1174
1208
  release: () => c.release(),
1175
- markNavigation(g) {
1176
- u || v(Bn, { href: W(g) });
1209
+ markNavigation(b) {
1210
+ u || y(Yn, { href: W(b) });
1177
1211
  },
1178
1212
  stats: () => c.stats(),
1179
- stream({ onBatch: g, onCap: w }) {
1180
- i?.stop();
1181
- const S = Date.now();
1182
- let R = [], _ = !1, C = 0;
1183
- const N = () => {
1213
+ stream({ onBatch: b, onCap: w }) {
1214
+ s?.stop();
1215
+ const _ = Date.now();
1216
+ let R = [], S = !1, A = 0;
1217
+ const C = () => {
1184
1218
  if (R.length === 0) return;
1185
- const B = R;
1186
- R = [], g(B);
1187
- }, x = (B) => {
1188
- R.push(B);
1219
+ const q = R;
1220
+ R = [], b(q);
1221
+ }, O = (q) => {
1222
+ R.push(q);
1189
1223
  };
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;
1224
+ l = O, a();
1225
+ const M = setInterval(C, tt), D = { timer: null }, F = { stop() {
1226
+ return S || (S = !0, clearInterval(M), clearTimeout(D.timer ?? void 0), o.flushRings(), l === O && (l = null), s === F && (s = null), C(), A = Date.now() - _), A;
1193
1227
  } };
1194
- return M.timer = setTimeout(() => {
1195
- $.stop(), w();
1196
- }, Qe), i = $, $;
1228
+ return D.timer = setTimeout(() => {
1229
+ F.stop(), w();
1230
+ }, et), s = F, F;
1197
1231
  },
1198
1232
  stop() {
1199
- u || (u = !0, i?.stop(), o.setSink(null), d(), c.clear());
1233
+ u || (u = !0, s?.stop(), o.setSink(null), d(), c.clear());
1200
1234
  }
1201
1235
  };
1202
1236
  }
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) {
1237
+ var sr = ["https://lab.leesto.app", "https://lab-dev.leesto.app"], ar = ["http://localhost:3505", "http://127.0.0.1:3505"];
1238
+ function lr(e) {
1205
1239
  try {
1206
1240
  const t = new URL(e).hostname;
1207
1241
  return t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "[::1]";
@@ -1209,7 +1243,7 @@ function Zn(e) {
1209
1243
  return !1;
1210
1244
  }
1211
1245
  }
1212
- function Jn(e) {
1246
+ function cr(e) {
1213
1247
  const t = e.trim();
1214
1248
  if (!t) return null;
1215
1249
  try {
@@ -1219,33 +1253,33 @@ function Jn(e) {
1219
1253
  return null;
1220
1254
  }
1221
1255
  }
1222
- function Qn(e) {
1223
- const t = (e.explicit ?? []).map(Jn).filter((r) => r !== null);
1256
+ function ur(e) {
1257
+ const t = (e.explicit ?? []).map(cr).filter((r) => r !== null);
1224
1258
  if (t.length > 0) return [...new Set(t)];
1225
- const n = [...Kn];
1226
- return Zn(e.pageOrigin) && n.push(...Yn), [...new Set(n)];
1259
+ const n = [...sr];
1260
+ return lr(e.pageOrigin) && n.push(...ar), [...new Set(n)];
1227
1261
  }
1228
- function fe(e, t) {
1262
+ function de(e, t) {
1229
1263
  return !e || e === "*" || e === "null" ? !1 : t.includes(e);
1230
1264
  }
1231
- function Q() {
1265
+ function ee() {
1232
1266
  return typeof navigator < "u" && navigator.globalPrivacyControl === !0;
1233
1267
  }
1234
- function er(e) {
1268
+ function fr(e) {
1235
1269
  const t = (u) => {
1236
1270
  const l = typeof u == "string" ? u.trim() : "";
1237
1271
  return l.length > 0 ? l : void 0;
1238
1272
  }, n = (u) => {
1239
1273
  if (!(typeof document > "u"))
1240
1274
  return t(document.querySelector(`meta[name="${u}"]`)?.getAttribute("content"));
1241
- }, r = typeof window < "u" ? window.__LEESTO_APP_BUILD__ : void 0, o = t(e?.version) ?? t(r?.version) ?? n("app-version"), s = t(e?.environment) ?? t(r?.environment) ?? n("app-environment");
1242
- if (!(!o && !s))
1275
+ }, r = typeof window < "u" ? window.__LEESTO_APP_BUILD__ : void 0, o = t(e?.version) ?? t(r?.version) ?? n("app-version"), i = t(e?.environment) ?? t(r?.environment) ?? n("app-environment");
1276
+ if (!(!o && !i))
1243
1277
  return {
1244
1278
  ...o ? { version: o } : {},
1245
- ...s ? { environment: s } : {}
1279
+ ...i ? { environment: i } : {}
1246
1280
  };
1247
1281
  }
1248
- function tr() {
1282
+ function dr() {
1249
1283
  if (typeof document > "u") return;
1250
1284
  const e = document.querySelector('link[rel~="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"]');
1251
1285
  if (e?.href)
@@ -1255,46 +1289,46 @@ function tr() {
1255
1289
  return;
1256
1290
  }
1257
1291
  }
1258
- function nr() {
1292
+ function pr() {
1259
1293
  const e = (r) => !!r && r !== "transparent" && !/^rgba\(\s*0,\s*0,\s*0,\s*0\s*\)$/.test(r), t = getComputedStyle(document.body).backgroundColor;
1260
1294
  if (e(t)) return t;
1261
1295
  const n = getComputedStyle(document.documentElement).backgroundColor;
1262
1296
  return e(n) ? n : "#ffffff";
1263
1297
  }
1264
- async function De(e) {
1298
+ async function $e(e) {
1265
1299
  const { domToPng: t } = await import("./chunks/dist-BTlWkbvW.js");
1266
1300
  if (e) {
1267
1301
  const l = document.querySelector(e);
1268
1302
  if (!l) throw new Error("element_not_found");
1269
1303
  return t(l, { quality: 0.92 });
1270
1304
  }
1271
- const n = document.documentElement, r = window.scrollX, o = window.scrollY, s = [], u = [];
1305
+ const n = document.documentElement, r = window.scrollX, o = window.scrollY, i = [], u = [];
1272
1306
  try {
1273
- for (const l of n.querySelectorAll(`.${ge}, ${te}`)) {
1274
- const i = l.getBoundingClientRect();
1275
- if (i.width <= 0 || i.height <= 0) continue;
1307
+ for (const l of n.querySelectorAll(`.${ve}, ${ne}`)) {
1308
+ const s = l.getBoundingClientRect();
1309
+ if (s.width <= 0 || s.height <= 0) continue;
1276
1310
  const a = document.createElement("div");
1277
1311
  a.dataset.leestoCaptureCover = "", Object.assign(a.style, {
1278
1312
  position: "fixed",
1279
- left: `${i.x}px`,
1280
- top: `${i.y}px`,
1281
- width: `${i.width}px`,
1282
- height: `${i.height}px`,
1313
+ left: `${s.x}px`,
1314
+ top: `${s.y}px`,
1315
+ width: `${s.width}px`,
1316
+ height: `${s.height}px`,
1283
1317
  background: "#a1a1aa",
1284
1318
  zIndex: "2147483647",
1285
1319
  pointerEvents: "none"
1286
- }), n.append(a), s.push(a);
1320
+ }), n.append(a), i.push(a);
1287
1321
  }
1288
1322
  for (const l of n.querySelectorAll("*")) {
1289
- const i = getComputedStyle(l).position;
1290
- if (i === "fixed" || i === "sticky") {
1323
+ const s = getComputedStyle(l).position;
1324
+ if (s === "fixed" || s === "sticky") {
1291
1325
  const a = l.style.transform;
1292
1326
  u.push([l, a]), l.style.transform = `translate(${r}px, ${o}px)${a ? ` ${a}` : ""}`;
1293
1327
  }
1294
1328
  }
1295
1329
  return await t(n, {
1296
1330
  quality: 0.92,
1297
- backgroundColor: nr(),
1331
+ backgroundColor: pr(),
1298
1332
  width: n.clientWidth,
1299
1333
  height: n.clientHeight,
1300
1334
  style: {
@@ -1303,11 +1337,11 @@ async function De(e) {
1303
1337
  }
1304
1338
  });
1305
1339
  } finally {
1306
- for (const l of s) l.remove();
1307
- for (const [l, i] of u) l.style.transform = i;
1340
+ for (const l of i) l.remove();
1341
+ for (const [l, s] of u) l.style.transform = s;
1308
1342
  }
1309
1343
  }
1310
- function rr(e) {
1344
+ function hr(e) {
1311
1345
  if (e.id) return `#${CSS.escape(e.id)}`;
1312
1346
  const t = [];
1313
1347
  let n = e;
@@ -1319,73 +1353,73 @@ function rr(e) {
1319
1353
  let r = n.tagName.toLowerCase();
1320
1354
  const o = typeof n.className == "string" ? n.className.trim().split(/\s+/).filter(Boolean)[0] : null;
1321
1355
  o && (r += `.${CSS.escape(o)}`);
1322
- const s = n.parentElement;
1323
- if (s) {
1324
- const u = Array.from(s.children).filter((l) => l.tagName === n?.tagName);
1356
+ const i = n.parentElement;
1357
+ if (i) {
1358
+ const u = Array.from(i.children).filter((l) => l.tagName === n?.tagName);
1325
1359
  u.length > 1 && (r += `:nth-of-type(${u.indexOf(n) + 1})`);
1326
1360
  }
1327
- t.unshift(r), n = s;
1361
+ t.unshift(r), n = i;
1328
1362
  }
1329
1363
  return t.join(" > ");
1330
1364
  }
1331
- function or(e) {
1365
+ function mr(e) {
1332
1366
  const t = e.tagName.toLowerCase();
1333
1367
  if (Y(e)) return t;
1334
1368
  const n = (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 40);
1335
1369
  return n ? `${t} · ${n}` : t;
1336
1370
  }
1337
- var tt = "leesto:shell-origin";
1338
- function sr() {
1371
+ var nt = "leesto:shell-origin";
1372
+ function gr() {
1339
1373
  try {
1340
- return sessionStorage.getItem(tt);
1374
+ return sessionStorage.getItem(nt);
1341
1375
  } catch {
1342
1376
  return null;
1343
1377
  }
1344
1378
  }
1345
- function ir(e) {
1379
+ function yr(e) {
1346
1380
  try {
1347
- sessionStorage.setItem(tt, e);
1381
+ sessionStorage.setItem(nt, e);
1348
1382
  } catch {
1349
1383
  }
1350
1384
  }
1351
- function ar() {
1385
+ function vr() {
1352
1386
  try {
1353
1387
  return typeof window.name == "string" ? window.name : "";
1354
1388
  } catch {
1355
1389
  return "";
1356
1390
  }
1357
1391
  }
1358
- function $e(e = {}) {
1392
+ function Fe(e = {}) {
1359
1393
  if (typeof window > "u" || window.parent === window) return () => {
1360
1394
  };
1361
- const t = window.parent, n = e.highlightColor ?? St.light.primary, r = Qn({
1395
+ const t = window.parent, n = e.highlightColor ?? Rt.light.primary, r = ur({
1362
1396
  explicit: e.shellOrigins,
1363
1397
  pageOrigin: location.origin
1364
1398
  });
1365
1399
  let o = null;
1366
1400
  try {
1367
1401
  const h = document.referrer ? new URL(document.referrer).origin : "";
1368
- fe(h, r) && (o = h);
1402
+ de(h, r) && (o = h);
1369
1403
  } catch {
1370
1404
  }
1371
1405
  if (!o) {
1372
- const h = sr();
1373
- h && fe(h, r) && (o = h);
1406
+ const h = gr();
1407
+ h && de(h, r) && (o = h);
1374
1408
  }
1375
- const s = (h) => {
1409
+ const i = (h) => {
1376
1410
  if (o) {
1377
1411
  t.postMessage(h, o);
1378
1412
  return;
1379
1413
  }
1380
- for (const b of r) t.postMessage(h, b);
1414
+ for (const v of r) t.postMessage(h, v);
1381
1415
  };
1382
1416
  let u = null, l = "";
1383
- const i = () => {
1417
+ const s = () => {
1384
1418
  u && (u.style.outline = l), u = null;
1385
1419
  };
1386
1420
  let a = null;
1387
1421
  const c = () => {
1388
- a?.(), i(), document.querySelector("[data-leesto-picker-outline]")?.remove();
1422
+ a?.(), s(), document.querySelector("[data-leesto-picker-outline]")?.remove();
1389
1423
  const h = document.createElement("div");
1390
1424
  h.dataset.leestoPickerOutline = "", h.setAttribute("aria-hidden", "true"), Object.assign(h.style, {
1391
1425
  position: "fixed",
@@ -1396,192 +1430,196 @@ function $e(e = {}) {
1396
1430
  borderRadius: "4px",
1397
1431
  display: "none"
1398
1432
  }), 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;
1433
+ let v = null, g = null, P = null;
1434
+ const j = document.body.style.cursor, N = () => {
1435
+ const k = g ?? v;
1402
1436
  if (!k) return;
1403
- const I = k.getBoundingClientRect();
1404
- y ? s({
1437
+ const x = k.getBoundingClientRect();
1438
+ g ? i({
1405
1439
  type: "leesto:element-picked",
1406
- selector: rr(k),
1407
- label: or(k),
1440
+ selector: hr(k),
1441
+ label: mr(k),
1408
1442
  rect: {
1409
- x: I.x,
1410
- y: I.y,
1411
- width: I.width,
1412
- height: I.height
1443
+ x: x.x,
1444
+ y: x.y,
1445
+ width: x.width,
1446
+ height: x.height
1413
1447
  },
1414
- ...q ? { point: {
1415
- x: I.x + q.x,
1416
- y: I.y + q.y
1448
+ ...P ? { point: {
1449
+ x: x.x + P.x,
1450
+ y: x.y + P.y
1417
1451
  } } : {},
1418
1452
  viewport: {
1419
1453
  width: document.documentElement.clientWidth,
1420
1454
  height: document.documentElement.clientHeight
1421
1455
  },
1422
- context: gn(k)
1456
+ context: vn(k)
1423
1457
  }) : Object.assign(h.style, {
1424
1458
  display: "block",
1425
- left: `${I.x}px`,
1426
- top: `${I.y}px`,
1427
- width: `${I.width}px`,
1428
- height: `${I.height}px`
1459
+ left: `${x.x}px`,
1460
+ top: `${x.y}px`,
1461
+ width: `${x.width}px`,
1462
+ height: `${x.height}px`
1429
1463
  });
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
1464
  }, 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
1465
+ v = k.target instanceof Element ? k.target : null, N();
1466
+ }, _e = () => {
1467
+ h.remove(), document.removeEventListener("mousemove", Se, !0), document.removeEventListener("click", Re, !0), document.body.style.cursor = j;
1468
+ }, Re = (k) => {
1469
+ if (k.preventDefault(), k.stopPropagation(), g = k.target instanceof Element ? k.target : null, g) {
1470
+ const x = g.getBoundingClientRect();
1471
+ P = {
1472
+ x: k.clientX - x.x,
1473
+ y: k.clientY - x.y
1440
1474
  };
1441
1475
  }
1442
- Ee(), O();
1443
- }, Re = (k) => {
1444
- k.key === "Escape" && (a?.(), s({ type: "leesto:pick-cancelled" }));
1476
+ _e(), N();
1477
+ }, Ae = (k) => {
1478
+ k.key === "Escape" && (a?.(), i({ type: "leesto:pick-cancelled" }));
1445
1479
  };
1446
1480
  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({
1481
+ _e(), document.removeEventListener("keydown", Ae, !0), document.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N), a = null;
1482
+ }, document.body.style.cursor = "crosshair", document.addEventListener("mousemove", Se, !0), document.addEventListener("click", Re, !0), document.addEventListener("keydown", Ae, !0), document.addEventListener("scroll", N, !0), window.addEventListener("resize", N);
1483
+ }, d = yt(location.search, vr()), y = pe(d) && !ee(), b = mt(d), w = y ? gt(d) ?? ht() : void 0, _ = y ? Be({
1450
1484
  captureNetwork: e.captureNetwork !== !1,
1451
1485
  runId: w,
1452
1486
  runIdOrigins: e.runIdOrigins
1453
1487
  }) : null;
1454
1488
  let R = !1;
1455
- const _ = S ? Xn({
1456
- diagnostics: S,
1457
- maskPolicy: g
1489
+ const S = _ ? ir({
1490
+ diagnostics: _,
1491
+ maskPolicy: b
1458
1492
  }).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({
1493
+ let A = null, C = !1, O = !1;
1494
+ const M = () => {
1495
+ if (A) {
1496
+ const h = A.stop();
1497
+ A = null, i({
1464
1498
  type: "leesto:rec-stopped",
1465
1499
  durationMs: h
1466
1500
  });
1467
- } else N && (x = !0);
1468
- }, M = qn({
1469
- onDetected: () => s({ type: "leesto:login-form-detected" }),
1470
- onFilled: (h) => s({
1501
+ } else C && (O = !0);
1502
+ }, D = Kn({
1503
+ onDetected: () => i({ type: "leesto:login-form-detected" }),
1504
+ onFilled: (h) => i({
1471
1505
  type: "leesto:login-filled",
1472
1506
  step: h
1473
1507
  }),
1474
- onError: (h) => s({
1508
+ onError: (h) => i({
1475
1509
  type: "leesto:login-error",
1476
1510
  reason: h
1511
+ }),
1512
+ onNoForm: (h) => i({
1513
+ type: "leesto:login-no-form",
1514
+ signedIn: h
1477
1515
  })
1478
- }), $ = () => M.cancel();
1479
- window.addEventListener("pagehide", $);
1480
- const B = er(e.build), D = window.navigation;
1516
+ }), F = () => D.cancel();
1517
+ window.addEventListener("pagehide", F);
1518
+ const q = fr(e.build), $ = window.navigation;
1481
1519
  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();
1487
- s({
1520
+ const f = () => !U && $?.canGoBack === !0, p = () => !U && $?.canGoForward === !0;
1521
+ let m = p(), E = f(), I = location.href;
1522
+ const B = () => {
1523
+ I = location.href, E = f(), m = p();
1524
+ const h = dr();
1525
+ i({
1488
1526
  type: "leesto:ready",
1489
1527
  url: location.href,
1490
1528
  bridgeVersion: 1,
1491
1529
  capabilities: [
1492
- nt,
1493
- ...D ? ["navigation", "navigation-forward"] : [],
1494
- ..._ ? [rt] : []
1530
+ rt,
1531
+ ...$ ? ["navigation", "navigation-forward"] : [],
1532
+ ...S ? [ot] : []
1495
1533
  ],
1496
1534
  canGoBack: E,
1497
1535
  canGoForward: m,
1498
1536
  ...h ? { favicon: h } : {},
1499
- ...B ? { build: B } : {},
1537
+ ...q ? { build: q } : {},
1500
1538
  ...w ? { diagnosticRunId: w } : {},
1501
- ...Q() ? { gpc: !0 } : {}
1539
+ ...ee() ? { gpc: !0 } : {}
1502
1540
  });
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(() => {
1541
+ }, L = (h) => {
1542
+ if (h.source !== t || !de(h.origin, r) || !at(h.data)) return;
1543
+ o !== h.origin && (o = h.origin, yr(h.origin));
1544
+ const v = h.data;
1545
+ if (v.type === "leesto:ping")
1546
+ i({ type: "leesto:pong" }), B();
1547
+ else if (v.type === "leesto:navigate-back" || v.type === "leesto:navigate-forward") {
1548
+ const g = v.type === "leesto:navigate-forward";
1549
+ if (!$ || !(g ? p() : f())) return;
1550
+ U = !0, T(), Promise.resolve((g ? $.forward() : $.back()).finished).catch(() => {
1513
1551
  }).finally(() => {
1514
1552
  U = !1, R || T();
1515
1553
  });
1516
- } else if (b.type === "leesto:highlight") {
1517
- if (i(), b.selector) {
1518
- let y = null;
1554
+ } else if (v.type === "leesto:highlight") {
1555
+ if (s(), v.selector) {
1556
+ let g = null;
1519
1557
  try {
1520
- y = document.querySelector(b.selector);
1558
+ g = document.querySelector(v.selector);
1521
1559
  } catch {
1522
- y = null;
1560
+ g = null;
1523
1561
  }
1524
- y && (u = y, l = y.style.outline, y.style.outline = `2px solid ${n}`, y.style.outlineOffset = "2px", y.scrollIntoView({
1562
+ g && (u = g, l = g.style.outline, g.style.outline = `2px solid ${n}`, g.style.outlineOffset = "2px", g.scrollIntoView({
1525
1563
  block: "center",
1526
1564
  behavior: "smooth"
1527
1565
  }));
1528
1566
  }
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({
1567
+ } else if (v.type === "leesto:pick-start") c();
1568
+ else if (v.type === "leesto:pick-stop") a?.();
1569
+ else if (v.type === "leesto:capture-request") (v.selector ? $e(v.selector) : (e.capture ?? $e)()).then((g) => i({
1532
1570
  type: "leesto:screenshot",
1533
- dataUrl: y,
1534
- ...b.selector ? { selector: b.selector } : {}
1535
- })).catch((y) => s({
1571
+ dataUrl: g,
1572
+ ...v.selector ? { selector: v.selector } : {}
1573
+ })).catch((g) => i({
1536
1574
  type: "leesto:capture-failed",
1537
- reason: y instanceof Error ? y.message : "capture_error"
1575
+ reason: g instanceof Error ? g.message : "capture_error"
1538
1576
  }));
1539
- else if (b.type === "leesto:rec-start") {
1540
- if (C || N) return;
1541
- if (Q()) {
1542
- s({
1577
+ else if (v.type === "leesto:rec-start") {
1578
+ if (A || C) return;
1579
+ if (ee()) {
1580
+ i({
1543
1581
  type: "leesto:rec-blocked",
1544
1582
  reason: "gpc"
1545
1583
  });
1546
1584
  return;
1547
1585
  }
1548
- N = !0, x = !1;
1549
- const y = (O) => s({
1586
+ C = !0, O = !1;
1587
+ const g = (N) => i({
1550
1588
  type: "leesto:rec-batch",
1551
- events: O
1552
- }), q = () => P(), z = () => Vn({
1553
- onBatch: y,
1554
- onCap: q,
1589
+ events: N
1590
+ }), P = () => M(), j = () => or({
1591
+ onBatch: g,
1592
+ onCap: P,
1555
1593
  captureNetwork: e.captureNetwork,
1556
- maskPolicy: g,
1557
- diagnostics: S
1594
+ maskPolicy: b,
1595
+ diagnostics: _
1558
1596
  });
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) => {
1565
- N = !1, s({
1597
+ (S ? S.then((N) => N ? N.stream({
1598
+ onBatch: g,
1599
+ onCap: P
1600
+ }) : j()) : j()).then((N) => {
1601
+ C = !1, A = N, O && M();
1602
+ }).catch((N) => {
1603
+ C = !1, i({
1566
1604
  type: "leesto:rec-error",
1567
- reason: O instanceof Error ? O.message : "rec_error"
1605
+ reason: N instanceof Error ? N.message : "rec_error"
1568
1606
  });
1569
1607
  });
1570
- } else if (b.type === "leesto:rec-stop") P();
1571
- else if (b.type === "leesto:rec-buffer-request") {
1572
- if (!_) {
1573
- s({
1608
+ } else if (v.type === "leesto:rec-stop") M();
1609
+ else if (v.type === "leesto:rec-buffer-request") {
1610
+ if (!S) {
1611
+ i({
1574
1612
  type: "leesto:rec-buffer",
1575
1613
  events: [],
1576
1614
  durationMs: 0,
1577
- unavailable: Q() ? "gpc" : "not-armed"
1615
+ unavailable: ee() ? "gpc" : "not-armed"
1578
1616
  });
1579
1617
  return;
1580
1618
  }
1581
- _.then((y) => {
1619
+ S.then((g) => {
1582
1620
  if (R) return;
1583
- if (!y) {
1584
- s({
1621
+ if (!g) {
1622
+ i({
1585
1623
  type: "leesto:rec-buffer",
1586
1624
  events: [],
1587
1625
  durationMs: 0,
@@ -1589,33 +1627,33 @@ function $e(e = {}) {
1589
1627
  });
1590
1628
  return;
1591
1629
  }
1592
- const { events: q, durationMs: z } = y.snapshot();
1593
- s({
1630
+ const { events: P, durationMs: j } = g.snapshot();
1631
+ i({
1594
1632
  type: "leesto:rec-buffer",
1595
- events: q,
1596
- durationMs: z
1633
+ events: P,
1634
+ durationMs: j
1597
1635
  });
1598
1636
  });
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({
1637
+ } else v.type === "leesto:rec-buffer-hold" ? S?.then((g) => g?.hold()) : v.type === "leesto:rec-buffer-release" ? S?.then((g) => g?.release()) : v.type === "leesto:diagnostics-request" ? i({
1600
1638
  type: "leesto:diagnostics",
1601
- snapshot: S?.snapshot() ?? {
1639
+ snapshot: _?.snapshot() ?? {
1602
1640
  errors: [],
1603
1641
  logs: [],
1604
1642
  network: []
1605
1643
  }
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();
1644
+ }) : v.type === "leesto:login-watch" ? D.watch() : v.type === "leesto:login-fill" ? D.fill({
1645
+ login: v.login,
1646
+ password: v.password
1647
+ }) : v.type === "leesto:login-cancel" && D.cancel();
1610
1648
  };
1611
- window.addEventListener("message", A), F();
1649
+ window.addEventListener("message", L), B();
1612
1650
  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));
1651
+ if (!(location.href === I && f() === E && p() === m)) {
1652
+ if (location.href !== I) {
1653
+ const v = location.href;
1654
+ S?.then((g) => g?.markNavigation(v));
1617
1655
  }
1618
- L = location.href, E = f(), m = p(), s({
1656
+ I = location.href, E = f(), m = p(), i({
1619
1657
  type: "leesto:location",
1620
1658
  url: location.href,
1621
1659
  canGoBack: E,
@@ -1623,28 +1661,28 @@ function $e(e = {}) {
1623
1661
  navigationType: typeof h == "string" ? h : "traverse"
1624
1662
  });
1625
1663
  }
1626
- }, G = history.pushState, ye = history.replaceState, ve = (...h) => {
1664
+ }, G = history.pushState, be = history.replaceState, we = (...h) => {
1627
1665
  G.apply(history, h), T("push");
1628
- }, be = (...h) => {
1629
- ye.apply(history, h), T("replace");
1666
+ }, Ee = (...h) => {
1667
+ be.apply(history, h), T("replace");
1630
1668
  };
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);
1669
+ return history.pushState = we, history.replaceState = Ee, $?.addEventListener("currententrychange", T), window.addEventListener("popstate", T), window.addEventListener("hashchange", T), () => {
1670
+ R = !0, $?.removeEventListener("currententrychange", T), M(), S?.then((h) => h?.stop()), _?.teardown(), s(), a?.(), D.teardown(), window.removeEventListener("pagehide", F), window.removeEventListener("message", L), window.removeEventListener("popstate", T), window.removeEventListener("hashchange", T), history.pushState === we && (history.pushState = G), history.replaceState === Ee && (history.replaceState = be);
1633
1671
  };
1634
1672
  }
1635
- function lr() {
1673
+ function br() {
1636
1674
  return typeof document > "u" ? null : document.currentScript ?? document.querySelector("script[data-leesto-connect]");
1637
1675
  }
1638
- function cr(e) {
1676
+ function wr(e) {
1639
1677
  const t = {}, n = e?.dataset.highlightColor;
1640
1678
  n && (t.highlightColor = n);
1641
1679
  const r = (e?.dataset.shellOrigin ?? "").split(",").map((o) => o.trim()).filter(Boolean);
1642
1680
  return r.length > 0 && (t.shellOrigins = r), t;
1643
1681
  }
1644
1682
  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));
1683
+ window.LeestoConnect = { connect: (t) => Fe(t) };
1684
+ const e = br();
1685
+ (!e || e.dataset.leestoManual === void 0) && Fe(wr(e));
1648
1686
  }
1649
1687
 
1650
1688
  //# sourceMappingURL=leesto-connect.js.map