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