review-lens-react 1.0.1 → 1.0.3

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,153 +1,184 @@
1
- import { jsx as i, jsxs as o, Fragment as ae } from "react/jsx-runtime";
2
- import { createContext as mt, useMemo as se, useState as N, useCallback as W, useEffect as B, useContext as pt, useRef as re, useLayoutEffect as gt } from "react";
1
+ import { jsx as i, jsxs as s, Fragment as ae } from "react/jsx-runtime";
2
+ import { createContext as gt, useMemo as oe, useState as x, useCallback as W, useEffect as P, useContext as ft, useRef as re, useLayoutEffect as wt } from "react";
3
3
  const Be = [
4
4
  "https://www.googleapis.com/auth/spreadsheets",
5
5
  "https://www.googleapis.com/auth/userinfo.email"
6
- ], ft = "https://www.googleapis.com/auth/gmail.send", wt = "https://www.googleapis.com/oauth2/v3/userinfo", bt = "https://gmail.googleapis.com/gmail/v1/users/me/messages/send";
7
- function vt(e) {
8
- const t = e.feedbackSheetName ?? "Feedback", n = e.messagesSheetName ?? "Messages", r = e.usersSheetName ?? "Users", s = e.enableEmailNotifications ? [...Be, ft].join(" ") : Be.join(" ");
9
- let c, h;
10
- async function w() {
11
- return c ?? (c = At(e.googleClientId, s)), c;
6
+ ], vt = "https://www.googleapis.com/auth/gmail.send", Pe = "https://www.googleapis.com/oauth2/v3/userinfo", bt = "https://gmail.googleapis.com/gmail/v1/users/me/messages/send", yt = "review-lens-google-token", kt = 6e4;
7
+ function St(e) {
8
+ const t = e.feedbackSheetName ?? "Feedback", n = e.messagesSheetName ?? "Messages", r = e.usersSheetName ?? "Users", o = e.enableEmailNotifications ? [...Be, vt].join(" ") : Be.join(" "), c = $t(e.googleClientId, o);
9
+ let u, w;
10
+ async function g() {
11
+ const p = Mt(c);
12
+ if (p)
13
+ return p.accessToken;
14
+ u ?? (u = Tt(e.googleClientId, o).then((h) => (Bt(c, h), h)));
15
+ const v = await u;
16
+ return Date.now() >= v.expiresAt ? (u = void 0, g()) : v.accessToken;
12
17
  }
13
- async function p(g, f, m) {
14
- const S = await w(), x = await fetch(
15
- `https://sheets.googleapis.com/v4/spreadsheets/${g}${f}`,
18
+ async function b(p, v, h) {
19
+ const k = await g(), l = await fetch(
20
+ `https://sheets.googleapis.com/v4/spreadsheets/${p}${v}`,
16
21
  {
17
- ...m,
22
+ ...h,
18
23
  headers: {
19
- Authorization: `Bearer ${S}`,
24
+ Authorization: `Bearer ${k}`,
20
25
  "Content-Type": "application/json",
21
- ...m == null ? void 0 : m.headers
26
+ ...h == null ? void 0 : h.headers
22
27
  }
23
28
  }
24
29
  );
25
- if (!x.ok)
26
- throw new Error(`Google Sheets request failed with ${x.status}`);
27
- return x.json();
30
+ if (l.status === 401) {
31
+ We(c), u = void 0;
32
+ const C = await g(), f = await fetch(
33
+ `https://sheets.googleapis.com/v4/spreadsheets/${p}${v}`,
34
+ {
35
+ ...h,
36
+ headers: {
37
+ Authorization: `Bearer ${C}`,
38
+ "Content-Type": "application/json",
39
+ ...h == null ? void 0 : h.headers
40
+ }
41
+ }
42
+ );
43
+ if (!f.ok)
44
+ throw new Error(`Google Sheets request failed with ${f.status}`);
45
+ return f.json();
46
+ }
47
+ if (!l.ok)
48
+ throw new Error(`Google Sheets request failed with ${l.status}`);
49
+ return l.json();
28
50
  }
29
- async function b(g, f) {
30
- return (await p(
31
- g,
32
- `/values/${encodeURIComponent(f)}`
51
+ async function A(p, v) {
52
+ return (await b(
53
+ p,
54
+ `/values/${encodeURIComponent(v)}`
33
55
  )).values ?? [];
34
56
  }
35
57
  return {
36
58
  async getCurrentUser() {
37
- if (!h) {
38
- const g = await w(), f = await fetch(wt, {
39
- headers: { Authorization: `Bearer ${g}` }
40
- });
41
- if (!f.ok)
42
- throw new Error(`Google userinfo request failed with ${f.status}`);
43
- h = (await f.json()).email;
44
- }
45
- if (!h)
59
+ if (w || (w = await L()), !w)
46
60
  throw new Error("Google account did not return an email address");
47
- return { email: h };
61
+ return { email: w };
48
62
  },
49
- async getPermissions(g) {
50
- const [{ email: f }, m] = await Promise.all([
63
+ async getPermissions(p) {
64
+ const [{ email: v }, h] = await Promise.all([
51
65
  this.getCurrentUser(),
52
- b(e.usersSpreadsheetId, r)
53
- ]), S = ue(m), x = f.toLowerCase(), E = S.find(
54
- (l) => {
55
- var A;
56
- return ((A = l.email) == null ? void 0 : A.toLowerCase()) === x && l.active !== "false" && (!l.projectKey || l.projectKey === g);
66
+ A(e.usersSpreadsheetId, r)
67
+ ]), k = ue(h), l = v.toLowerCase(), C = k.find(
68
+ (f) => {
69
+ var y;
70
+ return ((y = f.email) == null ? void 0 : y.toLowerCase()) === l && f.active !== "false" && (!f.projectKey || f.projectKey === p);
57
71
  }
58
72
  );
59
- return Nt((E == null ? void 0 : E.role) ?? "designer");
73
+ return Et((C == null ? void 0 : C.role) ?? "designer");
60
74
  },
61
- async listFeedback(g) {
62
- return ue(await b(e.contentSpreadsheetId, t)).map(je).filter((m) => m !== null).filter(
63
- (m) => m.projectKey === g.projectKey && m.contentId === g.contentId && m.normalizedPath === g.normalizedPath
64
- ).sort((m, S) => S.createdAt.localeCompare(m.createdAt));
75
+ async listFeedback(p) {
76
+ return ue(await A(e.contentSpreadsheetId, t)).map(Ue).filter((h) => h !== null).filter(
77
+ (h) => h.projectKey === p.projectKey && h.contentId === p.contentId && h.normalizedPath === p.normalizedPath
78
+ ).sort((h, k) => k.createdAt.localeCompare(h.createdAt));
65
79
  },
66
- async createFeedback(g) {
67
- const f = (/* @__PURE__ */ new Date()).toISOString(), m = {
68
- ...g,
80
+ async createFeedback(p) {
81
+ const v = (/* @__PURE__ */ new Date()).toISOString(), h = {
82
+ ...p,
69
83
  id: crypto.randomUUID(),
70
84
  attachments: [],
71
- createdAt: f,
72
- updatedAt: f
85
+ createdAt: v,
86
+ updatedAt: v
73
87
  };
74
- return await p(
88
+ return await b(
75
89
  e.contentSpreadsheetId,
76
90
  `/values/${encodeURIComponent(t)}:append?valueInputOption=RAW`,
77
91
  {
78
92
  method: "POST",
79
- body: JSON.stringify({ values: [_e(m)] })
93
+ body: JSON.stringify({ values: [je(h)] })
80
94
  }
81
- ), m;
95
+ ), h;
82
96
  },
83
- async updateFeedback(g, f) {
84
- const m = await b(e.contentSpreadsheetId, t), S = m[0] ?? Pe, x = S.indexOf("id");
85
- if (x === -1)
97
+ async updateFeedback(p, v) {
98
+ const h = await A(e.contentSpreadsheetId, t), k = h[0] ?? _e, l = k.indexOf("id");
99
+ if (l === -1)
86
100
  throw new Error(`Sheet ${t} is missing an id column`);
87
- const E = m.findIndex((C, F) => F > 0 && C[x] === g);
88
- if (E < 1)
89
- throw new Error(`Feedback ${g} was not found`);
90
- const l = (/* @__PURE__ */ new Date()).toISOString(), A = je(Ke(S, m[E]));
91
- if (!A)
92
- throw new Error(`Feedback ${g} could not be parsed before updating`);
93
- const v = {
94
- ...A,
95
- ...f,
96
- updatedAt: l
97
- }, y = _e(v);
98
- return await p(
101
+ const C = h.findIndex((M, j) => j > 0 && M[l] === p);
102
+ if (C < 1)
103
+ throw new Error(`Feedback ${p} was not found`);
104
+ const f = (/* @__PURE__ */ new Date()).toISOString(), y = Ue(Oe(k, h[C]));
105
+ if (!y)
106
+ throw new Error(`Feedback ${p} could not be parsed before updating`);
107
+ const N = {
108
+ ...y,
109
+ ...v,
110
+ updatedAt: f
111
+ }, F = je(N);
112
+ return await b(
99
113
  e.contentSpreadsheetId,
100
- `/values/${encodeURIComponent(t)}!A${E + 1}:${Ft(
101
- Pe.length
102
- )}${E + 1}?valueInputOption=RAW`,
114
+ `/values/${encodeURIComponent(t)}!A${C + 1}:${It(
115
+ _e.length
116
+ )}${C + 1}?valueInputOption=RAW`,
103
117
  {
104
118
  method: "PUT",
105
- body: JSON.stringify({ values: [y] })
119
+ body: JSON.stringify({ values: [F] })
106
120
  }
107
- ), v;
121
+ ), N;
108
122
  },
109
- async listMessages(g) {
110
- return ue(await b(e.contentSpreadsheetId, n)).map(kt).filter((m) => m !== null).filter((m) => m.feedbackId === g).sort((m, S) => m.createdAt.localeCompare(S.createdAt));
123
+ async listMessages(p) {
124
+ return ue(await A(e.contentSpreadsheetId, n)).map(Ct).filter((h) => h !== null).filter((h) => h.feedbackId === p).sort((h, k) => h.createdAt.localeCompare(k.createdAt));
111
125
  },
112
- async createMessage(g) {
113
- const f = {
114
- ...g,
126
+ async createMessage(p) {
127
+ const v = {
128
+ ...p,
115
129
  id: crypto.randomUUID(),
116
130
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
117
131
  };
118
- return await p(
132
+ return await b(
119
133
  e.contentSpreadsheetId,
120
134
  `/values/${encodeURIComponent(n)}:append?valueInputOption=RAW`,
121
135
  {
122
136
  method: "POST",
123
- body: JSON.stringify({ values: [St(f)] })
137
+ body: JSON.stringify({ values: [Nt(v)] })
124
138
  }
125
- ), f;
139
+ ), v;
126
140
  },
127
- async sendEmail(g) {
128
- if (!e.enableEmailNotifications || g.to.length === 0)
141
+ async sendEmail(p) {
142
+ if (!e.enableEmailNotifications || p.to.length === 0)
129
143
  return;
130
- const f = await w(), m = await this.getCurrentUser(), S = await fetch(bt, {
144
+ const v = await g(), h = await this.getCurrentUser(), k = await fetch(bt, {
131
145
  method: "POST",
132
146
  headers: {
133
- Authorization: `Bearer ${f}`,
147
+ Authorization: `Bearer ${v}`,
134
148
  "Content-Type": "application/json"
135
149
  },
136
150
  body: JSON.stringify({
137
- raw: It({
138
- from: m.email,
139
- to: g.to,
140
- subject: g.subject,
141
- text: g.text
151
+ raw: _t({
152
+ from: h.email,
153
+ to: p.to,
154
+ subject: p.subject,
155
+ text: p.text
142
156
  })
143
157
  })
144
158
  });
145
- if (!S.ok)
146
- throw new Error(`Gmail send request failed with ${S.status}`);
159
+ if (!k.ok)
160
+ throw new Error(`Gmail send request failed with ${k.status}`);
147
161
  }
148
162
  };
163
+ async function L() {
164
+ const p = await fetch(Pe, {
165
+ headers: { Authorization: `Bearer ${await g()}` }
166
+ });
167
+ if (p.status === 401) {
168
+ We(c), u = void 0;
169
+ const h = await fetch(Pe, {
170
+ headers: { Authorization: `Bearer ${await g()}` }
171
+ });
172
+ if (!h.ok)
173
+ throw new Error(`Google userinfo request failed with ${h.status}`);
174
+ return (await h.json()).email;
175
+ }
176
+ if (!p.ok)
177
+ throw new Error(`Google userinfo request failed with ${p.status}`);
178
+ return (await p.json()).email;
179
+ }
149
180
  }
150
- const Pe = [
181
+ const _e = [
151
182
  "id",
152
183
  "projectKey",
153
184
  "contentId",
@@ -176,8 +207,8 @@ const Pe = [
176
207
  "fixedBy",
177
208
  "resolvedAt",
178
209
  "resolvedBy"
179
- ], yt = ["id", "feedbackId", "body", "authorEmail", "createdAt"];
180
- function _e(e) {
210
+ ], xt = ["id", "feedbackId", "body", "authorEmail", "createdAt"];
211
+ function je(e) {
181
212
  return [
182
213
  e.id,
183
214
  e.projectKey,
@@ -209,17 +240,17 @@ function _e(e) {
209
240
  e.resolvedBy ?? ""
210
241
  ];
211
242
  }
212
- function St(e) {
213
- return yt.map((t) => e[t]);
243
+ function Nt(e) {
244
+ return xt.map((t) => e[t]);
214
245
  }
215
246
  function ue(e) {
216
247
  const [t, ...n] = e;
217
- return t ? n.map((r) => Ke(t, r)) : [];
248
+ return t ? n.map((r) => Oe(t, r)) : [];
218
249
  }
219
- function Ke(e, t) {
250
+ function Oe(e, t) {
220
251
  return Object.fromEntries(e.map((n, r) => [n, t[r] ?? ""]));
221
252
  }
222
- function je(e) {
253
+ function Ue(e) {
223
254
  return e.id ? {
224
255
  id: e.id,
225
256
  projectKey: e.projectKey,
@@ -233,16 +264,16 @@ function je(e) {
233
264
  width: 0,
234
265
  height: 0
235
266
  }),
236
- createdCssSnapshot: Ue(e.createdCssSnapshotJson),
237
- fixedCssSnapshot: e.fixedCssSnapshotJson ? Ue(e.fixedCssSnapshotJson) : void 0,
267
+ createdCssSnapshot: De(e.createdCssSnapshotJson),
268
+ fixedCssSnapshot: e.fixedCssSnapshotJson ? De(e.fixedCssSnapshotJson) : void 0,
238
269
  comment: e.comment,
239
- status: Ct(e.status),
240
- severity: xt(e.severity),
241
- category: Et(e.category),
270
+ status: Lt(e.status),
271
+ severity: At(e.severity),
272
+ category: Ft(e.category),
242
273
  assigneeEmail: e.assigneeEmail || void 0,
243
274
  viewportWidth: Number(e.viewportWidth) || 0,
244
275
  viewportHeight: Number(e.viewportHeight) || 0,
245
- viewportPreset: Lt(e.viewportPreset),
276
+ viewportPreset: Rt(e.viewportPreset),
246
277
  screenshotUrl: e.screenshotUrl || void 0,
247
278
  screenshotThumbnailUrl: e.screenshotThumbnailUrl || void 0,
248
279
  attachments: fe(e.attachmentJson, []),
@@ -255,7 +286,7 @@ function je(e) {
255
286
  resolvedBy: e.resolvedBy || void 0
256
287
  } : null;
257
288
  }
258
- function kt(e) {
289
+ function Ct(e) {
259
290
  return !e.id || !e.feedbackId ? null : {
260
291
  id: e.id,
261
292
  feedbackId: e.feedbackId,
@@ -271,7 +302,7 @@ function fe(e, t) {
271
302
  return t;
272
303
  }
273
304
  }
274
- function Ue(e) {
305
+ function De(e) {
275
306
  const t = fe(e, {});
276
307
  return {
277
308
  margin: t.margin ?? "",
@@ -299,22 +330,22 @@ function Ue(e) {
299
330
  height: t.height ?? 0
300
331
  };
301
332
  }
302
- function Nt(e) {
333
+ function Et(e) {
303
334
  return e === "admin" ? ["create", "read", "reply", "update", "assign"] : e === "developer" ? ["read", "reply", "update", "assign"] : ["create", "read", "reply"];
304
335
  }
305
- function Ct(e) {
336
+ function Lt(e) {
306
337
  return e === "in_progress" || e === "needs_clarification" || e === "fixed" || e === "wontfix" || e === "resolved" ? e : "open";
307
338
  }
308
- function xt(e) {
339
+ function At(e) {
309
340
  return e === "low" || e === "high" ? e : "medium";
310
341
  }
311
- function Et(e) {
342
+ function Ft(e) {
312
343
  return e === "visual" || e === "copy" || e === "accessibility" || e === "responsive" ? e : "bug";
313
344
  }
314
- function Lt(e) {
345
+ function Rt(e) {
315
346
  return e === "mobile" || e === "tablet" || e === "desktop" ? e : "custom";
316
347
  }
317
- function Ft(e) {
348
+ function It(e) {
318
349
  let t = e, n = "";
319
350
  for (; t > 0; ) {
320
351
  const r = (t - 1) % 26;
@@ -322,24 +353,58 @@ function Ft(e) {
322
353
  }
323
354
  return n;
324
355
  }
325
- async function At(e, t) {
326
- return await Rt(), new Promise((n, r) => {
356
+ async function Tt(e, t) {
357
+ return await Pt(), new Promise((n, r) => {
327
358
  var c;
328
- const s = (c = window.google) == null ? void 0 : c.accounts.oauth2.initTokenClient({
359
+ const o = (c = window.google) == null ? void 0 : c.accounts.oauth2.initTokenClient({
329
360
  client_id: e,
330
361
  scope: t,
331
- callback: (h) => {
332
- if (h.error || !h.access_token) {
333
- r(new Error(h.error ?? "Google OAuth did not return an access token"));
362
+ callback: (u) => {
363
+ if (u.error || !u.access_token) {
364
+ r(new Error(u.error ?? "Google OAuth did not return an access token"));
334
365
  return;
335
366
  }
336
- n(h.access_token);
367
+ const w = u.expires_in ?? 3600;
368
+ n({
369
+ accessToken: u.access_token,
370
+ expiresAt: Date.now() + w * 1e3
371
+ });
337
372
  }
338
373
  });
339
- s == null || s.requestAccessToken({ prompt: "" });
374
+ o == null || o.requestAccessToken({ prompt: "" });
340
375
  });
341
376
  }
342
- function Rt() {
377
+ function $t(e, t) {
378
+ return `${yt}:${e}:${t}`;
379
+ }
380
+ function Mt(e) {
381
+ try {
382
+ const t = window.localStorage.getItem(e);
383
+ if (!t)
384
+ return;
385
+ const n = JSON.parse(t);
386
+ if (typeof n.accessToken != "string" || typeof n.expiresAt != "number" || Date.now() >= n.expiresAt - kt) {
387
+ window.localStorage.removeItem(e);
388
+ return;
389
+ }
390
+ return n;
391
+ } catch {
392
+ return;
393
+ }
394
+ }
395
+ function Bt(e, t) {
396
+ try {
397
+ window.localStorage.setItem(e, JSON.stringify(t));
398
+ } catch {
399
+ }
400
+ }
401
+ function We(e) {
402
+ try {
403
+ window.localStorage.removeItem(e);
404
+ } catch {
405
+ }
406
+ }
407
+ function Pt() {
343
408
  var e;
344
409
  return (e = window.google) != null && e.accounts.oauth2 ? Promise.resolve() : new Promise((t, n) => {
345
410
  const r = document.querySelector(
@@ -351,11 +416,11 @@ function Rt() {
351
416
  });
352
417
  return;
353
418
  }
354
- const s = document.createElement("script");
355
- s.src = "https://accounts.google.com/gsi/client", s.async = !0, s.defer = !0, s.onload = () => t(), s.onerror = () => n(new Error("Google Identity failed to load")), document.head.append(s);
419
+ const o = document.createElement("script");
420
+ o.src = "https://accounts.google.com/gsi/client", o.async = !0, o.defer = !0, o.onload = () => t(), o.onerror = () => n(new Error("Google Identity failed to load")), document.head.append(o);
356
421
  });
357
422
  }
358
- function It(e) {
423
+ function _t(e) {
359
424
  const t = [
360
425
  `From: ${e.from}`,
361
426
  `To: ${e.to.join(", ")}`,
@@ -365,26 +430,26 @@ function It(e) {
365
430
  e.text
366
431
  ].join(`\r
367
432
  `);
368
- return Mt(t);
433
+ return jt(t);
369
434
  }
370
- function Mt(e) {
435
+ function jt(e) {
371
436
  const t = new TextEncoder().encode(e);
372
437
  let n = "";
373
438
  return t.forEach((r) => {
374
439
  n += String.fromCharCode(r);
375
440
  }), btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
376
441
  }
377
- function $t(e) {
442
+ function Ut(e) {
378
443
  return new URL(e, window.location.href).pathname.replace(/\/+$/, "") || "/";
379
444
  }
380
- const Je = mt(null);
381
- function wn({ config: e, children: t }) {
382
- const n = se(() => e.adapter ? e.adapter : vt({
445
+ const Ge = gt(null);
446
+ function xn({ config: e, children: t }) {
447
+ const n = oe(() => e.adapter ? e.adapter : St({
383
448
  googleClientId: me(e.googleClientId, "googleClientId"),
384
449
  contentSpreadsheetId: me(e.contentSpreadsheetId, "contentSpreadsheetId"),
385
450
  usersSpreadsheetId: me(e.usersSpreadsheetId, "usersSpreadsheetId"),
386
451
  feedbackSheetName: e.sheetName ?? "Feedback",
387
- enableEmailNotifications: Oe(e)
452
+ enableEmailNotifications: qe(e)
388
453
  }), [
389
454
  e.adapter,
390
455
  e.contentSpreadsheetId,
@@ -392,106 +457,106 @@ function wn({ config: e, children: t }) {
392
457
  e.googleClientId,
393
458
  e.sheetName,
394
459
  e.usersSpreadsheetId
395
- ]), r = e.currentUrl ?? window.location.href, s = (e.normalizeUrl ?? $t)(r), [c, h] = N(), [w, p] = N([]), [b, g] = N([]), f = W(async () => {
396
- const v = await n.listFeedback({
460
+ ]), r = e.currentUrl ?? window.location.href, o = (e.normalizeUrl ?? Ut)(r), [c, u] = x(), [w, g] = x([]), [b, A] = x([]), L = W(async () => {
461
+ const f = await n.listFeedback({
397
462
  projectKey: e.projectKey,
398
463
  contentId: e.contentId,
399
- normalizedPath: s
464
+ normalizedPath: o
400
465
  });
401
- g(v);
402
- }, [n, e.contentId, e.projectKey, s]);
403
- B(() => {
404
- let v = !0;
466
+ A(f);
467
+ }, [n, e.contentId, e.projectKey, o]);
468
+ P(() => {
469
+ let f = !0;
405
470
  async function y() {
406
- const [C, F] = await Promise.all([
471
+ const [N, F] = await Promise.all([
407
472
  n.getCurrentUser(),
408
473
  n.getPermissions(e.projectKey)
409
474
  ]);
410
- v && (h(C), p(F), await f());
475
+ f && (u(N), g(F), await L());
411
476
  }
412
477
  return y(), () => {
413
- v = !1;
478
+ f = !1;
414
479
  };
415
- }, [n, e.projectKey, f]);
416
- const m = W(
417
- async (v) => {
418
- const y = await n.createFeedback(v);
419
- return g((C) => [y, ...C]), pe(e, n, {
420
- actorEmail: (c == null ? void 0 : c.email) ?? v.authorEmail,
480
+ }, [n, e.projectKey, L]);
481
+ const p = W(
482
+ async (f) => {
483
+ const y = await n.createFeedback(f);
484
+ return A((N) => [y, ...N]), pe(e, n, {
485
+ actorEmail: (c == null ? void 0 : c.email) ?? f.authorEmail,
421
486
  item: y,
422
487
  kind: "created"
423
488
  }), y;
424
489
  },
425
490
  [n, e, c == null ? void 0 : c.email]
426
- ), S = W(
427
- async (v, y) => {
428
- const C = b.find((_) => _.id === v), F = await n.updateFeedback(v, y);
429
- return g(
430
- (_) => _.map((H) => H.id === v ? F : H)
491
+ ), v = W(
492
+ async (f, y) => {
493
+ const N = b.find((M) => M.id === f), F = await n.updateFeedback(f, y);
494
+ return A(
495
+ (M) => M.map((j) => j.id === f ? F : j)
431
496
  ), pe(e, n, {
432
497
  actorEmail: c == null ? void 0 : c.email,
433
498
  item: F,
434
- kind: Bt(y),
435
- previousItem: C
499
+ kind: Wt(y),
500
+ previousItem: N
436
501
  }), F;
437
502
  },
438
503
  [n, e, c == null ? void 0 : c.email, b]
439
- ), x = W(
440
- (v) => n.listMessages(v),
504
+ ), h = W(
505
+ (f) => n.listMessages(f),
441
506
  [n]
442
- ), E = W(
443
- async (v) => {
444
- const y = await n.createMessage(v), C = b.find((F) => F.id === v.feedbackId);
445
- return C && pe(e, n, {
446
- actorEmail: v.authorEmail,
447
- item: C,
507
+ ), k = W(
508
+ async (f) => {
509
+ const y = await n.createMessage(f), N = b.find((F) => F.id === f.feedbackId);
510
+ return N && pe(e, n, {
511
+ actorEmail: f.authorEmail,
512
+ item: N,
448
513
  kind: "reply",
449
- replyBody: v.body
514
+ replyBody: f.body
450
515
  }), y;
451
516
  },
452
517
  [n, e, b]
453
518
  ), l = W(
454
- async (v, y) => {
455
- const C = e.uploadAttachment ?? n.uploadAttachment;
456
- if (!C)
519
+ async (f, y) => {
520
+ const N = e.uploadAttachment ?? n.uploadAttachment;
521
+ if (!N)
457
522
  throw new Error("Review Lens attachment upload is not configured");
458
- return C(v, y);
523
+ return N(f, y);
459
524
  },
460
525
  [n, e]
461
- ), A = se(
526
+ ), C = oe(
462
527
  () => ({
463
528
  config: e,
464
529
  adapter: n,
465
530
  currentUser: c,
466
531
  permissions: w,
467
532
  feedback: b,
468
- normalizedPath: s,
469
- refreshFeedback: f,
470
- createFeedback: m,
471
- updateFeedback: S,
472
- listMessages: x,
473
- createMessage: E,
533
+ normalizedPath: o,
534
+ refreshFeedback: L,
535
+ createFeedback: p,
536
+ updateFeedback: v,
537
+ listMessages: h,
538
+ createMessage: k,
474
539
  uploadAttachment: l
475
540
  }),
476
541
  [
477
542
  n,
478
543
  e,
479
- m,
544
+ p,
480
545
  c,
481
546
  b,
482
- s,
547
+ o,
483
548
  w,
484
- f,
485
- S,
486
- x,
487
- E,
549
+ L,
550
+ v,
551
+ h,
552
+ k,
488
553
  l
489
554
  ]
490
555
  );
491
- return /* @__PURE__ */ i(Je.Provider, { value: A, children: t });
556
+ return /* @__PURE__ */ i(Ge.Provider, { value: C, children: t });
492
557
  }
493
- function Tt() {
494
- const e = pt(Je);
558
+ function Dt() {
559
+ const e = ft(Ge);
495
560
  if (!e)
496
561
  throw new Error("useReviewLens must be used inside ReviewLensProvider");
497
562
  return e;
@@ -501,60 +566,60 @@ function me(e, t) {
501
566
  throw new Error(`review-lens-react requires config.${t} when no adapter is provided`);
502
567
  return e;
503
568
  }
504
- function Oe(e) {
569
+ function qe(e) {
505
570
  return typeof e.emailNotifications == "object" ? e.emailNotifications.enabled !== !1 : !!e.emailNotifications;
506
571
  }
507
- function Bt(e) {
572
+ function Wt(e) {
508
573
  return e.status === "resolved" ? "resolved" : e.status === "fixed" || e.fixedAt || e.fixedBy ? "fixed" : e.status ? "status" : "assigneeEmail" in e ? "assigned" : "updated";
509
574
  }
510
575
  async function pe(e, t, n) {
511
- if (!Oe(e) || !t.sendEmail)
576
+ if (!qe(e) || !t.sendEmail)
512
577
  return;
513
- const r = Pt(n);
578
+ const r = zt(n);
514
579
  if (r.length !== 0)
515
580
  try {
516
581
  await t.sendEmail({
517
582
  to: r,
518
- subject: _t(e, n),
519
- text: jt(n)
583
+ subject: Ht(e, n),
584
+ text: Kt(n)
520
585
  });
521
- } catch (s) {
522
- console.warn("Review Lens email notification failed", s);
586
+ } catch (o) {
587
+ console.warn("Review Lens email notification failed", o);
523
588
  }
524
589
  }
525
- function Pt(e) {
590
+ function zt(e) {
526
591
  var n;
527
592
  const t = /* @__PURE__ */ new Set();
528
593
  return t.add(e.item.authorEmail), (n = e.previousItem) != null && n.assigneeEmail && t.add(e.previousItem.assigneeEmail), e.item.assigneeEmail && t.add(e.item.assigneeEmail), [...t].filter((r) => {
529
- var s;
530
- return r ? r.toLowerCase() !== ((s = e.actorEmail) == null ? void 0 : s.toLowerCase()) : !1;
594
+ var o;
595
+ return r ? r.toLowerCase() !== ((o = e.actorEmail) == null ? void 0 : o.toLowerCase()) : !1;
531
596
  });
532
597
  }
533
- function _t(e, t) {
534
- return `${(typeof e.emailNotifications == "object" ? e.emailNotifications : {}).subjectPrefix ?? "Review Lens"}: ${qe(t)}`;
598
+ function Ht(e, t) {
599
+ return `${(typeof e.emailNotifications == "object" ? e.emailNotifications : {}).subjectPrefix ?? "Review Lens"}: ${Ve(t)}`;
535
600
  }
536
- function jt(e) {
601
+ function Kt(e) {
537
602
  const t = [
538
603
  "[Review Lens]",
539
- qe(e),
540
- Ut(e),
604
+ Ve(e),
605
+ Jt(e),
541
606
  "",
542
607
  `Review: ${e.item.comment}`,
543
- `Status: ${Ve(e.item.status)}`,
608
+ `Status: ${Ye(e.item.status)}`,
544
609
  `Author: ${e.item.authorEmail}`,
545
610
  `Assignee: ${e.item.assigneeEmail ?? "Unassigned"}`,
546
- `Link: ${Wt(e.item)}`
611
+ `Link: ${Ot(e.item)}`
547
612
  ];
548
613
  return e.replyBody && t.splice(2, 0, `Reply: ${e.replyBody}`, ""), t.join(`
549
614
  `);
550
615
  }
551
- function Ut(e) {
616
+ function Jt(e) {
552
617
  return e.actorEmail ? `Sent by Review Lens on behalf of ${e.actorEmail}.` : "Sent by Review Lens on behalf of the signed-in Google user.";
553
618
  }
554
- function qe(e) {
555
- return e.kind === "created" ? "New review feedback" : e.kind === "assigned" ? `Review assignment changed to ${e.item.assigneeEmail ?? "unassigned"}` : e.kind === "status" ? `Review status changed to ${Ve(e.item.status)}` : e.kind === "fixed" ? "Review marked fixed" : e.kind === "resolved" ? "Review resolved" : e.kind === "reply" ? "New review reply" : "Review updated";
619
+ function Ve(e) {
620
+ return e.kind === "created" ? "New review feedback" : e.kind === "assigned" ? `Review assignment changed to ${e.item.assigneeEmail ?? "unassigned"}` : e.kind === "status" ? `Review status changed to ${Ye(e.item.status)}` : e.kind === "fixed" ? "Review marked fixed" : e.kind === "resolved" ? "Review resolved" : e.kind === "reply" ? "New review reply" : "Review updated";
556
621
  }
557
- function Wt(e) {
622
+ function Ot(e) {
558
623
  try {
559
624
  const t = new URL(e.originalUrl);
560
625
  return t.searchParams.set("reviewLensFeedback", e.id), t.toString();
@@ -562,10 +627,10 @@ function Wt(e) {
562
627
  return e.originalUrl;
563
628
  }
564
629
  }
565
- function Ve(e) {
630
+ function Ye(e) {
566
631
  return e.replace(/_/g, " ");
567
632
  }
568
- const Dt = [
633
+ const Gt = [
569
634
  "data-review-id",
570
635
  "data-testid",
571
636
  "data-test-id",
@@ -573,43 +638,43 @@ const Dt = [
573
638
  "name"
574
639
  ];
575
640
  function Q(e) {
576
- const t = e.getBoundingClientRect(), n = zt(e);
641
+ const t = e.getBoundingClientRect(), n = qt(e);
577
642
  return {
578
643
  selector: n.selector,
579
644
  selectorStrategy: n.strategy,
580
- fingerprint: Kt(e, t),
581
- cssSnapshot: Jt(e, t),
645
+ fingerprint: Yt(e, t),
646
+ cssSnapshot: Xt(e, t),
582
647
  rect: t
583
648
  };
584
649
  }
585
- function zt(e) {
586
- for (const t of Dt) {
650
+ function qt(e) {
651
+ for (const t of Gt) {
587
652
  const n = e.getAttribute(t);
588
653
  if (n)
589
654
  return {
590
- selector: `[${t}="${We(n)}"]`,
655
+ selector: `[${t}="${ze(n)}"]`,
591
656
  strategy: "stable-attribute"
592
657
  };
593
658
  }
594
- return e.id ? { selector: `#${We(e.id)}`, strategy: "stable-attribute" } : { selector: Ht(e), strategy: "css-path" };
659
+ return e.id ? { selector: `#${ze(e.id)}`, strategy: "stable-attribute" } : { selector: Vt(e), strategy: "css-path" };
595
660
  }
596
- function Ht(e) {
661
+ function Vt(e) {
597
662
  const t = [];
598
663
  let n = e;
599
664
  for (; n && n.nodeType === Node.ELEMENT_NODE && n !== document.body; ) {
600
- const r = n.parentElement, s = n.tagName.toLowerCase();
665
+ const r = n.parentElement, o = n.tagName.toLowerCase();
601
666
  if (!r) {
602
- t.unshift(s);
667
+ t.unshift(o);
603
668
  break;
604
669
  }
605
- const c = n.tagName, h = Array.from(r.children).filter(
606
- (p) => p.tagName === c
607
- ), w = h.indexOf(n) + 1;
608
- t.unshift(h.length > 1 ? `${s}:nth-of-type(${w})` : s), n = r;
670
+ const c = n.tagName, u = Array.from(r.children).filter(
671
+ (g) => g.tagName === c
672
+ ), w = u.indexOf(n) + 1;
673
+ t.unshift(u.length > 1 ? `${o}:nth-of-type(${w})` : o), n = r;
609
674
  }
610
675
  return t.join(" > ");
611
676
  }
612
- function Kt(e, t) {
677
+ function Yt(e, t) {
613
678
  var n;
614
679
  return {
615
680
  tagName: e.tagName.toLowerCase(),
@@ -621,7 +686,7 @@ function Kt(e, t) {
621
686
  height: Math.round(t.height)
622
687
  };
623
688
  }
624
- function Jt(e, t) {
689
+ function Xt(e, t) {
625
690
  const n = window.getComputedStyle(e);
626
691
  return {
627
692
  margin: ge(n.marginTop, n.marginRight, n.marginBottom, n.marginLeft),
@@ -662,11 +727,11 @@ function Jt(e, t) {
662
727
  function ge(e, t, n, r) {
663
728
  return e === t && t === n && n === r ? e : `${e} ${t} ${n} ${r}`;
664
729
  }
665
- function We(e) {
730
+ function ze(e) {
666
731
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&");
667
732
  }
668
- function Ot({ className: e, title: t = "Review Lens logo" }) {
669
- return /* @__PURE__ */ o(
733
+ function Qt({ className: e, title: t = "Review Lens logo" }) {
734
+ return /* @__PURE__ */ s(
670
735
  "svg",
671
736
  {
672
737
  className: e,
@@ -676,44 +741,53 @@ function Ot({ className: e, title: t = "Review Lens logo" }) {
676
741
  fill: "none",
677
742
  xmlns: "http://www.w3.org/2000/svg",
678
743
  children: [
679
- /* @__PURE__ */ i("rect", { x: "4", y: "6", width: "28", height: "28", rx: "8", fill: "#171717" }),
744
+ /* @__PURE__ */ i("rect", { x: "5", y: "5", width: "30", height: "30", rx: "9", fill: "#111827" }),
680
745
  /* @__PURE__ */ i(
681
746
  "path",
682
747
  {
683
- d: "M13 15.5C14.5 13.4 17.1 12 20 12C23.9 12 27.3 14.5 28.7 18C27.3 21.5 23.9 24 20 24C17.1 24 14.5 22.6 13 20.5",
684
- stroke: "#FFFFFF",
685
- strokeWidth: "2.2",
748
+ d: "M11.5 20C14.2 15.7 17.4 13.6 20 13.6C22.6 13.6 25.8 15.7 28.5 20C25.8 24.3 22.6 26.4 20 26.4C17.4 26.4 14.2 24.3 11.5 20Z",
749
+ stroke: "#F8FAFC",
750
+ strokeWidth: "2.4",
686
751
  strokeLinecap: "round",
687
752
  strokeLinejoin: "round"
688
753
  }
689
754
  ),
690
- /* @__PURE__ */ i("circle", { cx: "20", cy: "18", r: "3.4", fill: "#F97316" }),
691
755
  /* @__PURE__ */ i(
692
756
  "path",
693
757
  {
694
- d: "M28.5 26.5L34.5 32.5",
695
- stroke: "#2563EB",
696
- strokeWidth: "4",
758
+ d: "M24.7 24.7L31.5 31.5",
759
+ stroke: "#22D3EE",
760
+ strokeWidth: "3.6",
697
761
  strokeLinecap: "round"
698
762
  }
699
763
  ),
700
- /* @__PURE__ */ i("circle", { cx: "31.8", cy: "29.8", r: "2.1", fill: "#FACC15", stroke: "#171717", strokeWidth: "1.4" })
764
+ /* @__PURE__ */ i("circle", { cx: "20", cy: "20", r: "4.6", fill: "#F8FAFC" }),
765
+ /* @__PURE__ */ i("circle", { cx: "20", cy: "20", r: "2.2", fill: "#2563EB" }),
766
+ /* @__PURE__ */ i(
767
+ "path",
768
+ {
769
+ d: "M14.2 11.6L17 11.6M11.6 14.2L11.6 17M28.4 14.2L28.4 17",
770
+ stroke: "#A7F3D0",
771
+ strokeWidth: "2",
772
+ strokeLinecap: "round"
773
+ }
774
+ )
701
775
  ]
702
776
  }
703
777
  );
704
778
  }
705
- const qt = [
779
+ const Zt = [
706
780
  { label: "Desktop", value: "desktop" },
707
781
  { label: "Tablet", value: "tablet" },
708
782
  { label: "Mobile", value: "mobile" }
709
- ], Ge = [
783
+ ], Xe = [
710
784
  "open",
711
785
  "in_progress",
712
786
  "needs_clarification",
713
787
  "fixed",
714
788
  "wontfix",
715
789
  "resolved"
716
- ], Ye = ["low", "medium", "high"], Xe = ["bug", "visual", "copy", "accessibility", "responsive"], oe = {
790
+ ], Qe = ["low", "medium", "high"], Ze = ["bug", "visual", "copy", "accessibility", "responsive"], se = {
717
791
  open: "Open",
718
792
  in_progress: "In progress",
719
793
  needs_clarification: "Needs clarification",
@@ -731,156 +805,156 @@ const qt = [
731
805
  accessibility: "Accessibility",
732
806
  responsive: "Responsive"
733
807
  };
734
- function bn({
808
+ function Nn({
735
809
  open: e,
736
810
  onOpenChange: t,
737
811
  placement: n = "top-right",
738
812
  showResolved: r = !1,
739
- syncSelectionToUrl: s = !1,
740
- responsivePresets: c = qt
813
+ syncSelectionToUrl: o = !1,
814
+ responsivePresets: c = Zt
741
815
  }) {
742
- var Te;
816
+ var Me;
743
817
  const {
744
- adapter: h,
818
+ adapter: u,
745
819
  config: w,
746
- currentUser: p,
820
+ currentUser: g,
747
821
  feedback: b,
748
- normalizedPath: g,
749
- permissions: f,
750
- createFeedback: m,
751
- updateFeedback: S,
752
- listMessages: x,
753
- createMessage: E,
822
+ normalizedPath: A,
823
+ permissions: L,
824
+ createFeedback: p,
825
+ updateFeedback: v,
826
+ listMessages: h,
827
+ createMessage: k,
754
828
  uploadAttachment: l
755
- } = Tt(), [A, v] = N(), [y, C] = N(), [F, _] = N(""), [H, Ze] = N("medium"), [we, et] = N("visual"), [be, ve] = N(""), [ye, tt] = N(
756
- ((Te = c[0]) == null ? void 0 : Te.value) ?? "desktop"
757
- ), [k, K] = N(), [M, P] = N("review"), [nt, Se] = N(!1), [J, ke] = N("all"), [O, Ne] = N("all"), [q, Ce] = N("all"), [V, xe] = N("all"), [G, Ee] = N("all"), [it, rt] = N(!1), [at, Le] = N({}), [le, de] = N(""), te = re(null), Fe = re(e), ce = re(
758
- s ? new URL(window.location.href).searchParams.get("reviewLensFeedback") : null
759
- ), $ = !!p, T = f.includes("create"), Ae = f.includes("reply"), Re = f.includes("update"), st = f.includes("assign"), j = A ?? y, ot = !!y, lt = !!(w.captureScreenshot && (w.uploadAttachment || h.uploadAttachment)), dt = se(() => {
760
- const a = b.map((u) => u.assigneeEmail).filter((u) => !!u);
761
- return p != null && p.email && a.push(p.email), Array.from(new Set(a)).sort((u, d) => u.localeCompare(d));
762
- }, [p == null ? void 0 : p.email, b]), R = se(
763
- () => b.filter((a) => r || a.status !== "resolved").filter((a) => J === "all" || a.status === J).filter((a) => O === "all" || a.severity === O).filter((a) => q === "all" || a.category === q).filter((a) => V === "all" || a.assigneeEmail === V).filter((a) => G === "all" || a.viewportPreset === G),
829
+ } = Dt(), [C, f] = x(), [y, N] = x(), [F, M] = x(""), [j, tt] = x("medium"), [we, nt] = x("visual"), [ve, be] = x(""), [ye, it] = x(
830
+ ((Me = c[0]) == null ? void 0 : Me.value) ?? "desktop"
831
+ ), [S, K] = x(), [T, _] = x("review"), [rt, ke] = x(!1), [J, Se] = x("all"), [O, xe] = x("all"), [G, Ne] = x("all"), [q, Ce] = x("all"), [V, Ee] = x("all"), [at, ot] = x(!1), [st, Le] = x({}), [le, ce] = x(""), te = re(null), Ae = re(e), de = re(
832
+ o ? new URL(window.location.href).searchParams.get("reviewLensFeedback") : null
833
+ ), $ = !!g, B = L.includes("create"), Fe = L.includes("reply"), Re = L.includes("update"), lt = L.includes("assign"), U = C ?? y, ct = !!y, dt = !!(w.captureScreenshot && (w.uploadAttachment || u.uploadAttachment)), ht = oe(() => {
834
+ const a = b.map((m) => m.assigneeEmail).filter((m) => !!m);
835
+ return g != null && g.email && a.push(g.email), Array.from(new Set(a)).sort((m, d) => m.localeCompare(d));
836
+ }, [g == null ? void 0 : g.email, b]), R = oe(
837
+ () => b.filter((a) => r || a.status !== "resolved").filter((a) => J === "all" || a.status === J).filter((a) => O === "all" || a.severity === O).filter((a) => G === "all" || a.category === G).filter((a) => q === "all" || a.assigneeEmail === q).filter((a) => V === "all" || a.viewportPreset === V),
764
838
  [
765
- V,
766
839
  q,
840
+ G,
767
841
  b,
768
842
  O,
769
843
  r,
770
844
  J,
771
- G
845
+ V
772
846
  ]
773
- ), ct = [
847
+ ), ut = [
774
848
  J,
775
849
  O,
850
+ G,
776
851
  q,
777
- V,
778
- G
852
+ V
779
853
  ].filter((a) => a !== "all").length;
780
- B(() => {
854
+ P(() => {
781
855
  if (e) {
782
- Fe.current = !0;
856
+ Ae.current = !0;
783
857
  return;
784
858
  }
785
- if (v(void 0), C(void 0), _(""), de(""), P("review"), s && Fe.current) {
859
+ if (f(void 0), N(void 0), M(""), ce(""), _("review"), o && Ae.current) {
786
860
  const a = new URL(window.location.href);
787
861
  a.searchParams.has("reviewLensFeedback") && (a.searchParams.delete("reviewLensFeedback"), window.history.replaceState({}, "", a));
788
862
  }
789
- }, [e, s]), B(() => {
790
- $ || (v(void 0), C(void 0));
791
- }, [$]), B(() => {
792
- !y || M !== "review" || window.requestAnimationFrame(() => {
793
- var a, u, d;
794
- (u = (a = te.current) == null ? void 0 : a.scrollIntoView) == null || u.call(a, { block: "nearest" }), (d = te.current) == null || d.focus();
863
+ }, [e, o]), P(() => {
864
+ $ || (f(void 0), N(void 0));
865
+ }, [$]), P(() => {
866
+ !y || T !== "review" || window.requestAnimationFrame(() => {
867
+ var a, m, d;
868
+ (m = (a = te.current) == null ? void 0 : a.scrollIntoView) == null || m.call(a, { block: "nearest" }), (d = te.current) == null || d.focus();
795
869
  });
796
- }, [y, M]), B(() => {
797
- if (!k)
870
+ }, [y, T]), P(() => {
871
+ if (!S)
798
872
  return;
799
873
  let a = !0;
800
- return x(k.id).then((u) => {
801
- a && Le((d) => ({ ...d, [k.id]: u }));
874
+ return h(S.id).then((m) => {
875
+ a && Le((d) => ({ ...d, [S.id]: m }));
802
876
  }), () => {
803
877
  a = !1;
804
878
  };
805
- }, [x, k]), B(() => {
806
- if (!s || !ce.current || b.length === 0)
879
+ }, [h, S]), P(() => {
880
+ if (!o || !de.current || b.length === 0)
807
881
  return;
808
- const a = b.find((u) => u.id === ce.current);
809
- a && (ce.current = null, t == null || t(!0), D(a, { syncUrl: !1 }));
810
- }, [b, s]), B(() => {
811
- if (!e || !s || k || b.length === 0)
882
+ const a = b.find((m) => m.id === de.current);
883
+ a && (de.current = null, t == null || t(!0), z(a, { syncUrl: !1 }));
884
+ }, [b, o]), P(() => {
885
+ if (!e || !o || S || b.length === 0)
812
886
  return;
813
- const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"), u = b.find((d) => d.id === a);
814
- u && D(u, { syncUrl: !1 });
815
- }, [b, e, k, s]), B(() => {
887
+ const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"), m = b.find((d) => d.id === a);
888
+ m && z(m, { syncUrl: !1 });
889
+ }, [b, e, S, o]), P(() => {
816
890
  if (!e)
817
891
  return;
818
892
  function a(d) {
819
- var L;
820
- if (d.key === "Shift" && Se(!0), d.key === "Escape") {
893
+ var E;
894
+ if (d.key === "Shift" && ke(!0), d.key === "Escape") {
821
895
  d.preventDefault(), t == null || t(!1);
822
896
  return;
823
897
  }
824
- hn(d.target) || ((d.key === "n" || d.key === "ArrowDown") && (d.preventDefault(), Ie(1)), (d.key === "p" || d.key === "ArrowUp") && (d.preventDefault(), Ie(-1)), d.key === "c" && (d.preventDefault(), P("review"), (L = te.current) == null || L.focus()), d.key === "f" && k && Re && (d.preventDefault(), $e(k)));
898
+ wn(d.target) || ((d.key === "n" || d.key === "ArrowDown") && (d.preventDefault(), Ie(1)), (d.key === "p" || d.key === "ArrowUp") && (d.preventDefault(), Ie(-1)), d.key === "c" && (d.preventDefault(), _("review"), (E = te.current) == null || E.focus()), d.key === "f" && S && Re && (d.preventDefault(), $e(S)));
825
899
  }
826
- function u(d) {
827
- d.key === "Shift" && Se(!1);
900
+ function m(d) {
901
+ d.key === "Shift" && ke(!1);
828
902
  }
829
- return window.addEventListener("keydown", a), window.addEventListener("keyup", u), () => {
830
- window.removeEventListener("keydown", a), window.removeEventListener("keyup", u);
903
+ return window.addEventListener("keydown", a), window.addEventListener("keyup", m), () => {
904
+ window.removeEventListener("keydown", a), window.removeEventListener("keyup", m);
831
905
  };
832
906
  });
833
907
  const he = W((a) => {
834
- const u = a.target instanceof Element ? a.target : null;
835
- if (u)
836
- return u.closest("[data-review-lens-ui]") ? null : u;
908
+ const m = a.target instanceof Element ? a.target : null;
909
+ if (m)
910
+ return m.closest("[data-review-lens-ui]") ? null : m;
837
911
  const d = document.elementFromPoint(a.clientX, a.clientY);
838
912
  return !d || d.closest("[data-review-lens-ui]") ? null : d;
839
913
  }, []);
840
- if (B(() => {
914
+ if (P(() => {
841
915
  if (!e || !$)
842
916
  return;
843
917
  function a(d) {
844
- const L = he(d);
845
- v(L ? Q(L) : void 0);
918
+ const E = he(d);
919
+ f(E ? Q(E) : void 0);
846
920
  }
847
- function u(d) {
848
- const L = he(d);
849
- L && (d.preventDefault(), d.stopPropagation(), C(Q(L)), P("review"));
921
+ function m(d) {
922
+ const E = he(d);
923
+ E && (d.preventDefault(), d.stopPropagation(), N(Q(E)), _("review"));
850
924
  }
851
- return window.addEventListener("mousemove", a, !0), window.addEventListener("click", u, !0), () => {
852
- window.removeEventListener("mousemove", a, !0), window.removeEventListener("click", u, !0);
925
+ return window.addEventListener("mousemove", a, !0), window.addEventListener("click", m, !0), () => {
926
+ window.removeEventListener("mousemove", a, !0), window.removeEventListener("click", m, !0);
853
927
  };
854
928
  }, [$, he, e]), !e)
855
929
  return null;
856
- function D(a, u = { syncUrl: !0 }) {
857
- var L;
858
- if (K(a), C(void 0), P("feedback"), s && u.syncUrl !== !1) {
930
+ function z(a, m = { syncUrl: !0 }) {
931
+ var E;
932
+ if (K(a), N(void 0), _("feedback"), o && m.syncUrl !== !1) {
859
933
  const ne = new URL(window.location.href);
860
934
  ne.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", ne);
861
935
  }
862
- const d = z(a.selector);
936
+ const d = H(a.selector);
863
937
  if (!d) {
864
- v(void 0);
938
+ f(void 0);
865
939
  return;
866
940
  }
867
- (L = d.scrollIntoView) == null || L.call(d, { behavior: "smooth", block: "center", inline: "center" }), window.requestAnimationFrame(() => {
868
- v(Q(d));
941
+ (E = d.scrollIntoView) == null || E.call(d, { behavior: "smooth", block: "center", inline: "center" }), window.requestAnimationFrame(() => {
942
+ f(Q(d));
869
943
  });
870
944
  }
871
945
  function Ie(a) {
872
946
  if (R.length === 0)
873
947
  return;
874
- const u = k ? R.findIndex((L) => L.id === k.id) : -1, d = u < 0 ? a > 0 ? 0 : R.length - 1 : (u + a + R.length) % R.length;
875
- D(R[d]);
948
+ const m = S ? R.findIndex((E) => E.id === S.id) : -1, d = m < 0 ? a > 0 ? 0 : R.length - 1 : (m + a + R.length) % R.length;
949
+ z(R[d]);
876
950
  }
877
- async function Me() {
878
- if (!y || !F.trim() || !p || !T)
951
+ async function Te() {
952
+ if (!y || !F.trim() || !g || !B)
879
953
  return;
880
- let a = await m({
954
+ let a = await p({
881
955
  projectKey: w.projectKey,
882
956
  contentId: w.contentId,
883
- normalizedPath: g,
957
+ normalizedPath: A,
884
958
  originalUrl: w.currentUrl ?? window.location.href,
885
959
  selector: y.selector,
886
960
  selectorStrategy: y.selectorStrategy,
@@ -888,115 +962,115 @@ function bn({
888
962
  createdCssSnapshot: y.cssSnapshot,
889
963
  comment: F.trim(),
890
964
  status: "open",
891
- severity: H,
965
+ severity: j,
892
966
  category: we,
893
- assigneeEmail: be.trim() || void 0,
967
+ assigneeEmail: ve.trim() || void 0,
894
968
  viewportWidth: window.innerWidth,
895
969
  viewportHeight: window.innerHeight,
896
970
  viewportPreset: ye,
897
971
  screenshotUrl: void 0,
898
972
  screenshotThumbnailUrl: void 0,
899
- authorEmail: p.email
973
+ authorEmail: g.email
900
974
  });
901
975
  if (w.captureScreenshot)
902
976
  try {
903
- const u = await w.captureScreenshot(y), d = await l(a.id, {
977
+ const m = await w.captureScreenshot(y), d = await l(a.id, {
904
978
  type: "screenshot",
905
- data: u,
906
- createdBy: p.email
979
+ data: m,
980
+ createdBy: g.email
907
981
  });
908
- a = await S(a.id, {
982
+ a = await v(a.id, {
909
983
  attachments: [d],
910
984
  screenshotUrl: d.url,
911
985
  screenshotThumbnailUrl: d.thumbnailUrl
912
986
  });
913
987
  } catch {
914
988
  }
915
- if (_(""), ve(""), C(void 0), v(void 0), P("feedback"), K(a), s) {
916
- const u = new URL(window.location.href);
917
- u.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", u);
989
+ if (M(""), be(""), N(void 0), f(void 0), _("feedback"), K(a), o) {
990
+ const m = new URL(window.location.href);
991
+ m.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", m);
918
992
  }
919
993
  }
920
- async function ht(a, u) {
921
- const d = (/* @__PURE__ */ new Date()).toISOString(), L = u === "resolved" ? { status: u, resolvedAt: d, resolvedBy: p == null ? void 0 : p.email } : { status: u }, ne = await S(a.id, L);
994
+ async function mt(a, m) {
995
+ const d = (/* @__PURE__ */ new Date()).toISOString(), E = m === "resolved" ? { status: m, resolvedAt: d, resolvedBy: g == null ? void 0 : g.email } : { status: m }, ne = await v(a.id, E);
922
996
  K(ne);
923
997
  }
924
998
  async function $e(a) {
925
- const u = z(a.selector);
926
- if (!u || !p)
999
+ const m = H(a.selector);
1000
+ if (!m || !g)
927
1001
  return;
928
- const d = Q(u), L = await S(a.id, {
1002
+ const d = Q(m), E = await v(a.id, {
929
1003
  status: "fixed",
930
1004
  fixedCssSnapshot: d.cssSnapshot,
931
1005
  fixedAt: (/* @__PURE__ */ new Date()).toISOString(),
932
- fixedBy: p.email
1006
+ fixedBy: g.email
933
1007
  });
934
- K(L);
1008
+ K(E);
935
1009
  }
936
- async function ut(a) {
937
- if (!le.trim() || !p || !Ae)
1010
+ async function pt(a) {
1011
+ if (!le.trim() || !g || !Fe)
938
1012
  return;
939
- const u = await E({
1013
+ const m = await k({
940
1014
  feedbackId: a.id,
941
1015
  body: le.trim(),
942
- authorEmail: p.email
1016
+ authorEmail: g.email
943
1017
  });
944
1018
  Le((d) => ({
945
1019
  ...d,
946
- [a.id]: [...d[a.id] ?? [], u]
947
- })), de("");
1020
+ [a.id]: [...d[a.id] ?? [], m]
1021
+ })), ce("");
948
1022
  }
949
- return /* @__PURE__ */ o("div", { className: "review-lens-root", "data-review-lens-ui": !0, children: [
950
- $ && j ? /* @__PURE__ */ i(Zt, { target: j, locked: !!y }) : null,
951
- $ && y && A && nt ? /* @__PURE__ */ i(en, { from: y, to: A }) : null,
952
- $ ? /* @__PURE__ */ o(ae, { children: [
1023
+ return /* @__PURE__ */ s("div", { className: "review-lens-root", "data-review-lens-ui": !0, children: [
1024
+ $ && U ? /* @__PURE__ */ i(on, { target: U, locked: !!y }) : null,
1025
+ $ && y && C && rt ? /* @__PURE__ */ i(sn, { from: y, to: C }) : null,
1026
+ $ ? /* @__PURE__ */ s(ae, { children: [
953
1027
  /* @__PURE__ */ i(
954
- tn,
1028
+ ln,
955
1029
  {
956
1030
  feedback: R,
957
- selectedFeedback: k,
958
- onSelect: D
1031
+ selectedFeedback: S,
1032
+ onSelect: z
959
1033
  }
960
1034
  ),
961
1035
  /* @__PURE__ */ i(
962
- rn,
1036
+ dn,
963
1037
  {
964
1038
  feedback: R,
965
- selectedFeedback: k,
966
- onSelect: D
1039
+ selectedFeedback: S,
1040
+ onSelect: z
967
1041
  }
968
1042
  )
969
1043
  ] }) : null,
970
- /* @__PURE__ */ o("aside", { className: `review-lens-panel review-lens-panel--${n}`, "data-review-lens-ui": !0, children: [
971
- /* @__PURE__ */ o("header", { className: "review-lens-panel__header", children: [
972
- /* @__PURE__ */ o("div", { className: "review-lens-brand", children: [
973
- /* @__PURE__ */ i(Ot, { className: "review-lens-brand__mark" }),
974
- /* @__PURE__ */ o("div", { children: [
1044
+ /* @__PURE__ */ s("aside", { className: `review-lens-panel review-lens-panel--${n}`, "data-review-lens-ui": !0, children: [
1045
+ /* @__PURE__ */ s("header", { className: "review-lens-panel__header", children: [
1046
+ /* @__PURE__ */ s("div", { className: "review-lens-brand", children: [
1047
+ /* @__PURE__ */ i(Qt, { className: "review-lens-brand__mark" }),
1048
+ /* @__PURE__ */ s("div", { children: [
975
1049
  /* @__PURE__ */ i("p", { className: "review-lens-kicker", children: "Review Lens" }),
976
- /* @__PURE__ */ i("h2", { children: M === "summary" ? "Summary" : M === "feedback" ? "Feedback" : y ? "Element locked" : "Inspecting" })
1050
+ /* @__PURE__ */ i("h2", { children: T === "summary" ? "Summary" : T === "feedback" ? "Feedback" : y ? "Element locked" : "Inspecting" })
977
1051
  ] })
978
1052
  ] }),
979
1053
  /* @__PURE__ */ i("button", { type: "button", onClick: () => t == null ? void 0 : t(!1), children: "Close" })
980
1054
  ] }),
981
- /* @__PURE__ */ o("div", { className: "review-lens-panel__body", children: [
982
- /* @__PURE__ */ o("div", { className: "review-lens-mode-switch", role: "tablist", "aria-label": "Review Lens mode", children: [
1055
+ /* @__PURE__ */ s("div", { className: "review-lens-panel__body", children: [
1056
+ /* @__PURE__ */ s("div", { className: "review-lens-mode-switch", role: "tablist", "aria-label": "Review Lens mode", children: [
983
1057
  /* @__PURE__ */ i(
984
1058
  "button",
985
1059
  {
986
1060
  type: "button",
987
1061
  role: "tab",
988
- "aria-selected": M === "review",
989
- onClick: () => P("review"),
1062
+ "aria-selected": T === "review",
1063
+ onClick: () => _("review"),
990
1064
  children: "Review"
991
1065
  }
992
1066
  ),
993
- /* @__PURE__ */ o(
1067
+ /* @__PURE__ */ s(
994
1068
  "button",
995
1069
  {
996
1070
  type: "button",
997
1071
  role: "tab",
998
- "aria-selected": M === "feedback",
999
- onClick: () => P("feedback"),
1072
+ "aria-selected": T === "feedback",
1073
+ onClick: () => _("feedback"),
1000
1074
  children: [
1001
1075
  "Feedback ",
1002
1076
  /* @__PURE__ */ i("span", { children: R.length })
@@ -1008,34 +1082,34 @@ function bn({
1008
1082
  {
1009
1083
  type: "button",
1010
1084
  role: "tab",
1011
- "aria-selected": M === "summary",
1012
- onClick: () => P("summary"),
1085
+ "aria-selected": T === "summary",
1086
+ onClick: () => _("summary"),
1013
1087
  children: "Summary"
1014
1088
  }
1015
1089
  )
1016
1090
  ] }),
1017
- M === "review" ? /* @__PURE__ */ o("div", { className: "review-lens-review-pane", role: "tabpanel", children: [
1018
- /* @__PURE__ */ o("div", { className: "review-lens-inspection", children: [
1091
+ T === "review" ? /* @__PURE__ */ s("div", { className: "review-lens-review-pane", role: "tabpanel", children: [
1092
+ /* @__PURE__ */ s("div", { className: "review-lens-inspection", children: [
1019
1093
  $ ? null : /* @__PURE__ */ i("p", { children: "Authenticate with Google to inspect this page." }),
1020
- $ && j ? /* @__PURE__ */ o(ae, { children: [
1021
- /* @__PURE__ */ i(an, { target: j }),
1022
- /* @__PURE__ */ i(De, { title: "Accessibility", items: sn(j) }),
1094
+ $ && U ? /* @__PURE__ */ s(ae, { children: [
1095
+ /* @__PURE__ */ i(hn, { target: U }),
1096
+ /* @__PURE__ */ i(He, { title: "Accessibility", items: un(U) }),
1023
1097
  /* @__PURE__ */ i(
1024
- De,
1098
+ He,
1025
1099
  {
1026
1100
  title: "Design tokens",
1027
- items: on(j.cssSnapshot, w.designTokens)
1101
+ items: mn(U.cssSnapshot, w.designTokens)
1028
1102
  }
1029
1103
  )
1030
1104
  ] }) : null,
1031
- $ && !j ? /* @__PURE__ */ i("p", { children: "Move over the app to inspect." }) : null
1105
+ $ && !U ? /* @__PURE__ */ i("p", { children: "Move over the app to inspect." }) : null
1032
1106
  ] }),
1033
- ot ? /* @__PURE__ */ i("div", { className: "review-lens-composer-panel", children: /* @__PURE__ */ o(
1107
+ ct ? /* @__PURE__ */ i("div", { className: "review-lens-composer-panel", children: /* @__PURE__ */ s(
1034
1108
  "form",
1035
1109
  {
1036
1110
  className: "review-lens-feedback-form",
1037
1111
  onSubmit: (a) => {
1038
- a.preventDefault(), Me();
1112
+ a.preventDefault(), Te();
1039
1113
  },
1040
1114
  children: [
1041
1115
  /* @__PURE__ */ i("label", { htmlFor: "review-lens-comment", children: "New feedback" }),
@@ -1045,181 +1119,181 @@ function bn({
1045
1119
  ref: te,
1046
1120
  id: "review-lens-comment",
1047
1121
  value: F,
1048
- disabled: !T,
1049
- onChange: (a) => _(a.target.value),
1122
+ disabled: !B,
1123
+ onChange: (a) => M(a.target.value),
1050
1124
  onKeyDown: (a) => {
1051
- a.key === "Enter" && a.metaKey && (a.preventDefault(), Me());
1125
+ a.key === "Enter" && a.metaKey && (a.preventDefault(), Te());
1052
1126
  },
1053
- placeholder: T ? "Describe the UX issue..." : "You do not have permission to comment."
1127
+ placeholder: B ? "Describe the UX issue..." : "You do not have permission to comment."
1054
1128
  }
1055
1129
  ),
1056
- /* @__PURE__ */ o("div", { className: "review-lens-form-grid", children: [
1057
- /* @__PURE__ */ o("label", { children: [
1130
+ /* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
1131
+ /* @__PURE__ */ s("label", { children: [
1058
1132
  "Severity",
1059
1133
  /* @__PURE__ */ i(
1060
1134
  "select",
1061
1135
  {
1062
- value: H,
1063
- onChange: (a) => Ze(a.target.value),
1064
- disabled: !T,
1065
- children: Ye.map((a) => /* @__PURE__ */ i("option", { value: a, children: Z[a] }, a))
1136
+ value: j,
1137
+ onChange: (a) => tt(a.target.value),
1138
+ disabled: !B,
1139
+ children: Qe.map((a) => /* @__PURE__ */ i("option", { value: a, children: Z[a] }, a))
1066
1140
  }
1067
1141
  )
1068
1142
  ] }),
1069
- /* @__PURE__ */ o("label", { children: [
1143
+ /* @__PURE__ */ s("label", { children: [
1070
1144
  "Type",
1071
1145
  /* @__PURE__ */ i(
1072
1146
  "select",
1073
1147
  {
1074
1148
  value: we,
1075
- onChange: (a) => et(a.target.value),
1076
- disabled: !T,
1077
- children: Xe.map((a) => /* @__PURE__ */ i("option", { value: a, children: ee[a] }, a))
1149
+ onChange: (a) => nt(a.target.value),
1150
+ disabled: !B,
1151
+ children: Ze.map((a) => /* @__PURE__ */ i("option", { value: a, children: ee[a] }, a))
1078
1152
  }
1079
1153
  )
1080
1154
  ] }),
1081
- /* @__PURE__ */ o("label", { children: [
1155
+ /* @__PURE__ */ s("label", { children: [
1082
1156
  "Assignee",
1083
1157
  /* @__PURE__ */ i(
1084
1158
  "input",
1085
1159
  {
1086
- value: be,
1087
- onChange: (a) => ve(a.target.value),
1088
- disabled: !T,
1160
+ value: ve,
1161
+ onChange: (a) => be(a.target.value),
1162
+ disabled: !B,
1089
1163
  placeholder: "optional@email.com"
1090
1164
  }
1091
1165
  )
1092
1166
  ] }),
1093
- /* @__PURE__ */ o("label", { children: [
1167
+ /* @__PURE__ */ s("label", { children: [
1094
1168
  "Viewport",
1095
1169
  /* @__PURE__ */ i(
1096
1170
  "select",
1097
1171
  {
1098
1172
  value: ye,
1099
- onChange: (a) => tt(a.target.value),
1100
- disabled: !T,
1173
+ onChange: (a) => it(a.target.value),
1174
+ disabled: !B,
1101
1175
  children: c.map((a) => /* @__PURE__ */ i("option", { value: a.value, children: a.label }, a.value))
1102
1176
  }
1103
1177
  )
1104
1178
  ] })
1105
1179
  ] }),
1106
- T ? /* @__PURE__ */ o("p", { className: "review-lens-feedback-form__hint", children: [
1180
+ B ? /* @__PURE__ */ s("p", { className: "review-lens-feedback-form__hint", children: [
1107
1181
  "Press ",
1108
1182
  /* @__PURE__ */ i("kbd", { children: "Command" }),
1109
1183
  " + ",
1110
1184
  /* @__PURE__ */ i("kbd", { children: "Enter" }),
1111
1185
  " to submit.",
1112
- lt ? " Screenshot capture runs after save." : ""
1186
+ dt ? " Screenshot capture runs after save." : ""
1113
1187
  ] }) : null,
1114
- /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !T, children: "Save feedback" }) })
1188
+ /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !B, children: "Save feedback" }) })
1115
1189
  ]
1116
1190
  }
1117
1191
  ) }) : null
1118
1192
  ] }) : null,
1119
- M === "feedback" ? /* @__PURE__ */ o("div", { className: "review-lens-comments", children: [
1193
+ T === "feedback" ? /* @__PURE__ */ s("div", { className: "review-lens-comments", children: [
1120
1194
  /* @__PURE__ */ i(
1121
- Vt,
1195
+ en,
1122
1196
  {
1123
- open: it,
1124
- activeCount: ct,
1197
+ open: at,
1198
+ activeCount: ut,
1125
1199
  statusFilter: J,
1126
1200
  severityFilter: O,
1127
- categoryFilter: q,
1128
- assigneeFilter: V,
1129
- viewportFilter: G,
1130
- assignees: dt,
1201
+ categoryFilter: G,
1202
+ assigneeFilter: q,
1203
+ viewportFilter: V,
1204
+ assignees: ht,
1131
1205
  responsivePresets: c,
1132
- onStatusChange: ke,
1133
- onSeverityChange: Ne,
1134
- onCategoryChange: Ce,
1135
- onAssigneeChange: xe,
1206
+ onStatusChange: Se,
1207
+ onSeverityChange: xe,
1208
+ onCategoryChange: Ne,
1209
+ onAssigneeChange: Ce,
1136
1210
  onViewportChange: Ee,
1137
- onToggle: () => rt((a) => !a),
1211
+ onToggle: () => ot((a) => !a),
1138
1212
  onClear: () => {
1139
- ke("all"), Ne("all"), Ce("all"), xe("all"), Ee("all");
1213
+ Se("all"), xe("all"), Ne("all"), Ce("all"), Ee("all");
1140
1214
  }
1141
1215
  }
1142
1216
  ),
1143
- /* @__PURE__ */ o("div", { className: "review-lens-list-panel", children: [
1144
- /* @__PURE__ */ o("div", { className: "review-lens-comments__header", children: [
1217
+ /* @__PURE__ */ s("div", { className: "review-lens-list-panel", children: [
1218
+ /* @__PURE__ */ s("div", { className: "review-lens-comments__header", children: [
1145
1219
  /* @__PURE__ */ i("h3", { children: "All feedback" }),
1146
1220
  /* @__PURE__ */ i("span", { children: R.length })
1147
1221
  ] }),
1148
- /* @__PURE__ */ o("div", { className: "review-lens-comments__list", children: [
1222
+ /* @__PURE__ */ s("div", { className: "review-lens-comments__list", children: [
1149
1223
  R.length === 0 ? /* @__PURE__ */ i("p", { children: "No feedback for this view." }) : null,
1150
1224
  R.map((a) => /* @__PURE__ */ i(
1151
- Gt,
1225
+ tn,
1152
1226
  {
1153
1227
  item: a,
1154
- selected: (k == null ? void 0 : k.id) === a.id,
1155
- onSelect: D
1228
+ selected: (S == null ? void 0 : S.id) === a.id,
1229
+ onSelect: z
1156
1230
  },
1157
1231
  a.id
1158
1232
  ))
1159
1233
  ] })
1160
1234
  ] }),
1161
- k ? /* @__PURE__ */ o("div", { className: "review-lens-selected-panel", children: [
1235
+ S ? /* @__PURE__ */ s("div", { className: "review-lens-selected-panel", children: [
1162
1236
  /* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
1163
1237
  /* @__PURE__ */ i(
1164
- Yt,
1238
+ nn,
1165
1239
  {
1166
- item: k,
1167
- messages: at[k.id] ?? [],
1240
+ item: S,
1241
+ messages: st[S.id] ?? [],
1168
1242
  messageDraft: le,
1169
- canReply: Ae,
1243
+ canReply: Fe,
1170
1244
  canUpdate: Re,
1171
- canAssign: st,
1172
- syncSelectionToUrl: s,
1173
- onMessageDraftChange: de,
1174
- onSubmitMessage: () => void ut(k),
1175
- onStatusChange: (a) => void ht(k, a),
1176
- onAssigneeChange: (a) => void S(k.id, {
1245
+ canAssign: lt,
1246
+ syncSelectionToUrl: o,
1247
+ onMessageDraftChange: ce,
1248
+ onSubmitMessage: () => void pt(S),
1249
+ onStatusChange: (a) => void mt(S, a),
1250
+ onAssigneeChange: (a) => void v(S.id, {
1177
1251
  assigneeEmail: a.trim() || void 0
1178
1252
  }).then(K),
1179
- onMarkFixed: () => void $e(k)
1253
+ onMarkFixed: () => void $e(S)
1180
1254
  },
1181
- k.id
1255
+ S.id
1182
1256
  )
1183
- ] }) : /* @__PURE__ */ o("div", { className: "review-lens-selected-panel review-lens-selected-panel--empty", children: [
1257
+ ] }) : /* @__PURE__ */ s("div", { className: "review-lens-selected-panel review-lens-selected-panel--empty", children: [
1184
1258
  /* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
1185
1259
  /* @__PURE__ */ i("p", { children: "Select a feedback item above to review status, assignment, drift, and replies." })
1186
1260
  ] })
1187
1261
  ] }) : null,
1188
- M === "summary" ? /* @__PURE__ */ i(Qt, { feedback: b }) : null
1262
+ T === "summary" ? /* @__PURE__ */ i(an, { feedback: b }) : null
1189
1263
  ] })
1190
1264
  ] })
1191
1265
  ] });
1192
1266
  }
1193
- function Vt({
1267
+ function en({
1194
1268
  open: e,
1195
1269
  activeCount: t,
1196
1270
  statusFilter: n,
1197
1271
  severityFilter: r,
1198
- categoryFilter: s,
1272
+ categoryFilter: o,
1199
1273
  assigneeFilter: c,
1200
- viewportFilter: h,
1274
+ viewportFilter: u,
1201
1275
  assignees: w,
1202
- responsivePresets: p,
1276
+ responsivePresets: g,
1203
1277
  onStatusChange: b,
1204
- onSeverityChange: g,
1205
- onCategoryChange: f,
1206
- onAssigneeChange: m,
1207
- onViewportChange: S,
1208
- onToggle: x,
1209
- onClear: E
1278
+ onSeverityChange: A,
1279
+ onCategoryChange: L,
1280
+ onAssigneeChange: p,
1281
+ onViewportChange: v,
1282
+ onToggle: h,
1283
+ onClear: k
1210
1284
  }) {
1211
- return /* @__PURE__ */ o("div", { className: "review-lens-filter-shell", children: [
1212
- /* @__PURE__ */ o("div", { className: "review-lens-filter-bar", children: [
1213
- /* @__PURE__ */ o("button", { type: "button", "aria-expanded": e, onClick: x, children: [
1285
+ return /* @__PURE__ */ s("div", { className: "review-lens-filter-shell", children: [
1286
+ /* @__PURE__ */ s("div", { className: "review-lens-filter-bar", children: [
1287
+ /* @__PURE__ */ s("button", { type: "button", "aria-expanded": e, onClick: h, children: [
1214
1288
  "Filters",
1215
1289
  t > 0 ? /* @__PURE__ */ i("span", { children: t }) : null
1216
1290
  ] }),
1217
- t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick: E, children: "Clear" }) : null
1291
+ t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick: k, children: "Clear" }) : null
1218
1292
  ] }),
1219
- e ? /* @__PURE__ */ o("div", { className: "review-lens-filters", children: [
1220
- /* @__PURE__ */ o("label", { children: [
1293
+ e ? /* @__PURE__ */ s("div", { className: "review-lens-filters", children: [
1294
+ /* @__PURE__ */ s("label", { children: [
1221
1295
  "Status",
1222
- /* @__PURE__ */ o(
1296
+ /* @__PURE__ */ s(
1223
1297
  "select",
1224
1298
  {
1225
1299
  "aria-label": "Filter status",
@@ -1227,49 +1301,49 @@ function Vt({
1227
1301
  onChange: (l) => b(l.target.value),
1228
1302
  children: [
1229
1303
  /* @__PURE__ */ i("option", { value: "all", children: "All statuses" }),
1230
- Ge.map((l) => /* @__PURE__ */ i("option", { value: l, children: oe[l] }, l))
1304
+ Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
1231
1305
  ]
1232
1306
  }
1233
1307
  )
1234
1308
  ] }),
1235
- /* @__PURE__ */ o("label", { children: [
1309
+ /* @__PURE__ */ s("label", { children: [
1236
1310
  "Priority",
1237
- /* @__PURE__ */ o(
1311
+ /* @__PURE__ */ s(
1238
1312
  "select",
1239
1313
  {
1240
1314
  "aria-label": "Filter severity",
1241
1315
  value: r,
1242
- onChange: (l) => g(l.target.value),
1316
+ onChange: (l) => A(l.target.value),
1243
1317
  children: [
1244
1318
  /* @__PURE__ */ i("option", { value: "all", children: "All priorities" }),
1245
- Ye.map((l) => /* @__PURE__ */ i("option", { value: l, children: Z[l] }, l))
1319
+ Qe.map((l) => /* @__PURE__ */ i("option", { value: l, children: Z[l] }, l))
1246
1320
  ]
1247
1321
  }
1248
1322
  )
1249
1323
  ] }),
1250
- /* @__PURE__ */ o("label", { children: [
1324
+ /* @__PURE__ */ s("label", { children: [
1251
1325
  "Type",
1252
- /* @__PURE__ */ o(
1326
+ /* @__PURE__ */ s(
1253
1327
  "select",
1254
1328
  {
1255
1329
  "aria-label": "Filter type",
1256
- value: s,
1257
- onChange: (l) => f(l.target.value),
1330
+ value: o,
1331
+ onChange: (l) => L(l.target.value),
1258
1332
  children: [
1259
1333
  /* @__PURE__ */ i("option", { value: "all", children: "All types" }),
1260
- Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: ee[l] }, l))
1334
+ Ze.map((l) => /* @__PURE__ */ i("option", { value: l, children: ee[l] }, l))
1261
1335
  ]
1262
1336
  }
1263
1337
  )
1264
1338
  ] }),
1265
- /* @__PURE__ */ o("label", { children: [
1339
+ /* @__PURE__ */ s("label", { children: [
1266
1340
  "Assignee",
1267
- /* @__PURE__ */ o(
1341
+ /* @__PURE__ */ s(
1268
1342
  "select",
1269
1343
  {
1270
1344
  "aria-label": "Filter assignee",
1271
1345
  value: c,
1272
- onChange: (l) => m(l.target.value),
1346
+ onChange: (l) => p(l.target.value),
1273
1347
  children: [
1274
1348
  /* @__PURE__ */ i("option", { value: "all", children: "All assignees" }),
1275
1349
  w.map((l) => /* @__PURE__ */ i("option", { value: l, children: l }, l))
@@ -1277,17 +1351,17 @@ function Vt({
1277
1351
  }
1278
1352
  )
1279
1353
  ] }),
1280
- /* @__PURE__ */ o("label", { children: [
1354
+ /* @__PURE__ */ s("label", { children: [
1281
1355
  "Viewport",
1282
- /* @__PURE__ */ o(
1356
+ /* @__PURE__ */ s(
1283
1357
  "select",
1284
1358
  {
1285
1359
  "aria-label": "Filter viewport",
1286
- value: h,
1287
- onChange: (l) => S(l.target.value),
1360
+ value: u,
1361
+ onChange: (l) => v(l.target.value),
1288
1362
  children: [
1289
1363
  /* @__PURE__ */ i("option", { value: "all", children: "All viewports" }),
1290
- p.map((l) => /* @__PURE__ */ i("option", { value: l.value, children: l.label }, l.value))
1364
+ g.map((l) => /* @__PURE__ */ i("option", { value: l.value, children: l.label }, l.value))
1291
1365
  ]
1292
1366
  }
1293
1367
  )
@@ -1295,13 +1369,13 @@ function Vt({
1295
1369
  ] }) : null
1296
1370
  ] });
1297
1371
  }
1298
- function Gt({
1372
+ function tn({
1299
1373
  item: e,
1300
1374
  selected: t,
1301
1375
  onSelect: n
1302
1376
  }) {
1303
- const r = Qe(e);
1304
- return /* @__PURE__ */ o(
1377
+ const r = et(e);
1378
+ return /* @__PURE__ */ s(
1305
1379
  "article",
1306
1380
  {
1307
1381
  tabIndex: 0,
@@ -1311,22 +1385,22 @@ function Gt({
1311
1385
  t ? "review-lens-comment--selected" : ""
1312
1386
  ].filter(Boolean).join(" "),
1313
1387
  onClick: () => n(e),
1314
- onKeyDown: (s) => {
1315
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), n(e));
1388
+ onKeyDown: (o) => {
1389
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), n(e));
1316
1390
  },
1317
1391
  children: [
1318
- /* @__PURE__ */ o("div", { className: "review-lens-comment__header", children: [
1319
- /* @__PURE__ */ i("span", { children: oe[e.status] }),
1392
+ /* @__PURE__ */ s("div", { className: "review-lens-comment__header", children: [
1393
+ /* @__PURE__ */ i("span", { children: se[e.status] }),
1320
1394
  /* @__PURE__ */ i("strong", { children: Z[e.severity] })
1321
1395
  ] }),
1322
- /* @__PURE__ */ o("div", { className: "review-lens-comment__content", children: [
1396
+ /* @__PURE__ */ s("div", { className: "review-lens-comment__content", children: [
1323
1397
  /* @__PURE__ */ i("p", { children: e.comment }),
1324
- /* @__PURE__ */ o("span", { children: [
1398
+ /* @__PURE__ */ s("span", { children: [
1325
1399
  e.authorEmail,
1326
1400
  e.assigneeEmail ? ` -> ${e.assigneeEmail}` : ""
1327
1401
  ] })
1328
1402
  ] }),
1329
- /* @__PURE__ */ o("div", { className: "review-lens-tags", children: [
1403
+ /* @__PURE__ */ s("div", { className: "review-lens-tags", children: [
1330
1404
  /* @__PURE__ */ i("span", { children: ee[e.category] }),
1331
1405
  /* @__PURE__ */ i("span", { children: e.viewportPreset }),
1332
1406
  /* @__PURE__ */ i("span", { children: r.label })
@@ -1335,96 +1409,96 @@ function Gt({
1335
1409
  }
1336
1410
  );
1337
1411
  }
1338
- function Yt({
1412
+ function nn({
1339
1413
  item: e,
1340
1414
  messages: t,
1341
1415
  messageDraft: n,
1342
1416
  canReply: r,
1343
- canUpdate: s,
1417
+ canUpdate: o,
1344
1418
  canAssign: c,
1345
- syncSelectionToUrl: h,
1419
+ syncSelectionToUrl: u,
1346
1420
  onMessageDraftChange: w,
1347
- onSubmitMessage: p,
1421
+ onSubmitMessage: g,
1348
1422
  onStatusChange: b,
1349
- onAssigneeChange: g,
1350
- onMarkFixed: f
1423
+ onAssigneeChange: A,
1424
+ onMarkFixed: L
1351
1425
  }) {
1352
- const [m, S] = N(!1), x = Qe(e);
1353
- function E() {
1426
+ const [p, v] = x(!1), h = et(e);
1427
+ function k() {
1354
1428
  const l = new URL(window.location.href);
1355
- l.searchParams.set("reviewLensFeedback", e.id), Xt(l.toString()).then((A) => {
1356
- A && (S(!0), setTimeout(() => S(!1), 2e3));
1429
+ l.searchParams.set("reviewLensFeedback", e.id), rn(l.toString()).then((C) => {
1430
+ C && (v(!0), setTimeout(() => v(!1), 2e3));
1357
1431
  });
1358
1432
  }
1359
- return /* @__PURE__ */ o("section", { className: "review-lens-detail", "aria-label": "Selected feedback detail", children: [
1360
- /* @__PURE__ */ o("div", { className: "review-lens-detail__header", children: [
1361
- /* @__PURE__ */ o("h3", { children: [
1433
+ return /* @__PURE__ */ s("section", { className: "review-lens-detail", "aria-label": "Selected feedback detail", children: [
1434
+ /* @__PURE__ */ s("div", { className: "review-lens-detail__header", children: [
1435
+ /* @__PURE__ */ s("h3", { children: [
1362
1436
  ee[e.category],
1363
1437
  " feedback"
1364
1438
  ] }),
1365
- /* @__PURE__ */ o("div", { className: "review-lens-detail__header-actions", children: [
1366
- h ? /* @__PURE__ */ i(
1439
+ /* @__PURE__ */ s("div", { className: "review-lens-detail__header-actions", children: [
1440
+ u ? /* @__PURE__ */ i(
1367
1441
  "button",
1368
1442
  {
1369
1443
  type: "button",
1370
1444
  className: "review-lens-copy-link",
1371
- onClick: E,
1445
+ onClick: k,
1372
1446
  "aria-label": "Copy link to this feedback",
1373
- children: m ? "Copied!" : "Copy link"
1447
+ children: p ? "Copied!" : "Copy link"
1374
1448
  }
1375
1449
  ) : null,
1376
1450
  /* @__PURE__ */ i("strong", { children: Z[e.severity] })
1377
1451
  ] })
1378
1452
  ] }),
1379
1453
  /* @__PURE__ */ i("blockquote", { children: e.comment }),
1380
- /* @__PURE__ */ o("dl", { className: "review-lens-detail-meta", children: [
1381
- /* @__PURE__ */ o("div", { children: [
1454
+ /* @__PURE__ */ s("dl", { className: "review-lens-detail-meta", children: [
1455
+ /* @__PURE__ */ s("div", { children: [
1382
1456
  /* @__PURE__ */ i("dt", { children: "Target" }),
1383
- /* @__PURE__ */ i("dd", { children: x.label })
1457
+ /* @__PURE__ */ i("dd", { children: h.label })
1384
1458
  ] }),
1385
- /* @__PURE__ */ o("div", { children: [
1459
+ /* @__PURE__ */ s("div", { children: [
1386
1460
  /* @__PURE__ */ i("dt", { children: "Viewport" }),
1387
1461
  /* @__PURE__ */ i("dd", { children: e.viewportPreset })
1388
1462
  ] }),
1389
- e.screenshotUrl ? /* @__PURE__ */ o("div", { children: [
1463
+ e.screenshotUrl ? /* @__PURE__ */ s("div", { children: [
1390
1464
  /* @__PURE__ */ i("dt", { children: "Evidence" }),
1391
1465
  /* @__PURE__ */ i("dd", { children: /* @__PURE__ */ i("a", { href: e.screenshotUrl, target: "_blank", rel: "noreferrer", children: "Screenshot" }) })
1392
1466
  ] }) : null
1393
1467
  ] }),
1394
- /* @__PURE__ */ o("div", { className: "review-lens-form-grid", children: [
1395
- /* @__PURE__ */ o("label", { children: [
1468
+ /* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
1469
+ /* @__PURE__ */ s("label", { children: [
1396
1470
  "Status",
1397
1471
  /* @__PURE__ */ i(
1398
1472
  "select",
1399
1473
  {
1400
1474
  value: e.status,
1401
- disabled: !s,
1475
+ disabled: !o,
1402
1476
  onChange: (l) => b(l.target.value),
1403
- children: Ge.map((l) => /* @__PURE__ */ i("option", { value: l, children: oe[l] }, l))
1477
+ children: Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
1404
1478
  }
1405
1479
  )
1406
1480
  ] }),
1407
- /* @__PURE__ */ o("label", { children: [
1481
+ /* @__PURE__ */ s("label", { children: [
1408
1482
  "Assignee",
1409
1483
  /* @__PURE__ */ i(
1410
1484
  "input",
1411
1485
  {
1412
1486
  defaultValue: e.assigneeEmail ?? "",
1413
1487
  disabled: !c,
1414
- onBlur: (l) => g(l.target.value),
1488
+ onBlur: (l) => A(l.target.value),
1415
1489
  placeholder: "optional@email.com"
1416
1490
  }
1417
1491
  )
1418
1492
  ] })
1419
1493
  ] }),
1420
- /* @__PURE__ */ o("div", { className: "review-lens-status-actions", children: [
1494
+ /* @__PURE__ */ s("div", { className: "review-lens-status-actions", children: [
1421
1495
  /* @__PURE__ */ i(
1422
1496
  "button",
1423
1497
  {
1424
1498
  type: "button",
1425
1499
  className: "review-lens-button-secondary",
1426
- disabled: !s,
1427
- onClick: f,
1500
+ disabled: !o,
1501
+ onClick: L,
1428
1502
  children: "Mark fixed"
1429
1503
  }
1430
1504
  ),
@@ -1433,19 +1507,19 @@ function Yt({
1433
1507
  {
1434
1508
  type: "button",
1435
1509
  className: "review-lens-button-primary",
1436
- disabled: !s,
1510
+ disabled: !o,
1437
1511
  onClick: () => b("resolved"),
1438
1512
  children: "Resolve"
1439
1513
  }
1440
1514
  )
1441
1515
  ] }),
1442
- /* @__PURE__ */ o("div", { className: "review-lens-thread", children: [
1443
- /* @__PURE__ */ o("div", { className: "review-lens-thread__header", children: [
1516
+ /* @__PURE__ */ s("div", { className: "review-lens-thread", children: [
1517
+ /* @__PURE__ */ s("div", { className: "review-lens-thread__header", children: [
1444
1518
  /* @__PURE__ */ i("h3", { children: "Thread" }),
1445
1519
  /* @__PURE__ */ i("span", { children: t.length })
1446
1520
  ] }),
1447
1521
  t.length === 0 ? /* @__PURE__ */ i("p", { children: "No replies yet." }) : null,
1448
- t.map((l) => /* @__PURE__ */ o("div", { className: "review-lens-thread__message", children: [
1522
+ t.map((l) => /* @__PURE__ */ s("div", { className: "review-lens-thread__message", children: [
1449
1523
  /* @__PURE__ */ i("p", { children: l.body }),
1450
1524
  /* @__PURE__ */ i("span", { children: l.authorEmail })
1451
1525
  ] }, l.id)),
@@ -1459,11 +1533,11 @@ function Yt({
1459
1533
  placeholder: r ? "Reply..." : "You do not have permission to reply."
1460
1534
  }
1461
1535
  ),
1462
- /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick: p, children: "Reply" }) })
1536
+ /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick: g, children: "Reply" }) })
1463
1537
  ] })
1464
1538
  ] });
1465
1539
  }
1466
- async function Xt(e) {
1540
+ async function rn(e) {
1467
1541
  var n;
1468
1542
  if ((n = navigator.clipboard) != null && n.writeText)
1469
1543
  return await navigator.clipboard.writeText(e), !0;
@@ -1475,9 +1549,9 @@ async function Xt(e) {
1475
1549
  t.remove();
1476
1550
  }
1477
1551
  }
1478
- function Qt({ feedback: e }) {
1479
- return /* @__PURE__ */ o("div", { className: "review-lens-summary", role: "tabpanel", children: [
1480
- /* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) => oe[t.status]) }),
1552
+ function an({ feedback: e }) {
1553
+ return /* @__PURE__ */ s("div", { className: "review-lens-summary", role: "tabpanel", children: [
1554
+ /* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) => se[t.status]) }),
1481
1555
  /* @__PURE__ */ i(Y, { title: "Severity", values: X(e, (t) => Z[t.severity]) }),
1482
1556
  /* @__PURE__ */ i(Y, { title: "Type", values: X(e, (t) => ee[t.category]) }),
1483
1557
  /* @__PURE__ */ i(Y, { title: "Assignee", values: X(e, (t) => t.assigneeEmail ?? "Unassigned") }),
@@ -1485,17 +1559,17 @@ function Qt({ feedback: e }) {
1485
1559
  ] });
1486
1560
  }
1487
1561
  function Y({ title: e, values: t }) {
1488
- return /* @__PURE__ */ o("section", { children: [
1562
+ return /* @__PURE__ */ s("section", { children: [
1489
1563
  /* @__PURE__ */ i("h3", { children: e }),
1490
- /* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */ o("div", { children: [
1564
+ /* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
1491
1565
  /* @__PURE__ */ i("dt", { children: n }),
1492
1566
  /* @__PURE__ */ i("dd", { children: r })
1493
1567
  ] }, n)) })
1494
1568
  ] });
1495
1569
  }
1496
- function Zt({ target: e, locked: t }) {
1497
- const n = pn(e), r = dn(e.fingerprint);
1498
- return /* @__PURE__ */ o(
1570
+ function on({ target: e, locked: t }) {
1571
+ const n = yn(e), r = gn(e.fingerprint);
1572
+ return /* @__PURE__ */ s(
1499
1573
  "div",
1500
1574
  {
1501
1575
  className: t ? "review-lens-highlight review-lens-highlight--locked" : "review-lens-highlight",
@@ -1542,9 +1616,9 @@ function Zt({ target: e, locked: t }) {
1542
1616
  }
1543
1617
  }
1544
1618
  ),
1545
- /* @__PURE__ */ o("div", { className: "review-lens-highlight__label", children: [
1619
+ /* @__PURE__ */ s("div", { className: "review-lens-highlight__label", children: [
1546
1620
  /* @__PURE__ */ i("strong", { children: r }),
1547
- /* @__PURE__ */ o("span", { children: [
1621
+ /* @__PURE__ */ s("span", { children: [
1548
1622
  Math.round(e.rect.width),
1549
1623
  " x ",
1550
1624
  Math.round(e.rect.height)
@@ -1554,8 +1628,8 @@ function Zt({ target: e, locked: t }) {
1554
1628
  }
1555
1629
  );
1556
1630
  }
1557
- function en({ from: e, to: t }) {
1558
- const n = cn(e.rect, t.rect);
1631
+ function sn({ from: e, to: t }) {
1632
+ const n = fn(e.rect, t.rect);
1559
1633
  return n.length === 0 ? null : /* @__PURE__ */ i(ae, { children: n.map((r) => /* @__PURE__ */ i(
1560
1634
  "div",
1561
1635
  {
@@ -1571,13 +1645,13 @@ function en({ from: e, to: t }) {
1571
1645
  r.key
1572
1646
  )) });
1573
1647
  }
1574
- function tn({
1648
+ function ln({
1575
1649
  feedback: e,
1576
1650
  selectedFeedback: t,
1577
1651
  onSelect: n
1578
1652
  }) {
1579
1653
  return /* @__PURE__ */ i(ae, { children: e.map((r) => /* @__PURE__ */ i(
1580
- nn,
1654
+ cn,
1581
1655
  {
1582
1656
  feedback: r,
1583
1657
  selected: (t == null ? void 0 : t.id) === r.id,
@@ -1586,23 +1660,23 @@ function tn({
1586
1660
  r.id
1587
1661
  )) });
1588
1662
  }
1589
- function nn({
1663
+ function cn({
1590
1664
  feedback: e,
1591
1665
  selected: t,
1592
1666
  onSelect: n
1593
1667
  }) {
1594
1668
  const r = re(null);
1595
- return gt(() => {
1596
- let s = 0;
1669
+ return wt(() => {
1670
+ let o = 0;
1597
1671
  const c = () => {
1598
- s = 0;
1599
- const w = r.current, p = z(e.selector), b = p == null ? void 0 : p.getBoundingClientRect();
1672
+ o = 0;
1673
+ const w = r.current, g = H(e.selector), b = g == null ? void 0 : g.getBoundingClientRect();
1600
1674
  !w || !b || (w.style.top = `${b.top}px`, w.style.left = `${b.right}px`, w.hidden = b.bottom < 0 || b.top > window.innerHeight);
1601
- }, h = () => {
1602
- s || (s = window.requestAnimationFrame(c));
1675
+ }, u = () => {
1676
+ o || (o = window.requestAnimationFrame(c));
1603
1677
  };
1604
- return c(), window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), () => {
1605
- s && window.cancelAnimationFrame(s), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
1678
+ return c(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
1679
+ o && window.cancelAnimationFrame(o), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
1606
1680
  };
1607
1681
  }, [e.selector]), /* @__PURE__ */ i(
1608
1682
  "button",
@@ -1615,35 +1689,35 @@ function nn({
1615
1689
  }
1616
1690
  );
1617
1691
  }
1618
- function rn({
1692
+ function dn({
1619
1693
  feedback: e,
1620
1694
  selectedFeedback: t,
1621
1695
  onSelect: n
1622
1696
  }) {
1623
- const r = e.map((s) => {
1624
- const c = z(s.selector), h = c == null ? void 0 : c.getBoundingClientRect(), w = Math.max(
1697
+ const r = e.map((o) => {
1698
+ const c = H(o.selector), u = c == null ? void 0 : c.getBoundingClientRect(), w = Math.max(
1625
1699
  document.documentElement.scrollHeight,
1626
1700
  document.body.scrollHeight,
1627
1701
  window.innerHeight
1628
1702
  );
1629
- return !h || w <= 0 ? null : {
1630
- item: s,
1631
- top: Math.min(100, Math.max(0, (h.top + window.scrollY) / w * 100))
1703
+ return !u || w <= 0 ? null : {
1704
+ item: o,
1705
+ top: Math.min(100, Math.max(0, (u.top + window.scrollY) / w * 100))
1632
1706
  };
1633
- }).filter((s) => s !== null);
1634
- return r.length === 0 ? null : /* @__PURE__ */ i("div", { className: "review-lens-minimap", "data-review-lens-ui": !0, "aria-label": "Feedback map", children: r.map((s) => /* @__PURE__ */ i(
1707
+ }).filter((o) => o !== null);
1708
+ return r.length === 0 ? null : /* @__PURE__ */ i("div", { className: "review-lens-minimap", "data-review-lens-ui": !0, "aria-label": "Feedback map", children: r.map((o) => /* @__PURE__ */ i(
1635
1709
  "button",
1636
1710
  {
1637
1711
  type: "button",
1638
- className: (t == null ? void 0 : t.id) === s.item.id ? "review-lens-minimap__point review-lens-minimap__point--selected" : "review-lens-minimap__point",
1639
- style: { top: `${s.top}%` },
1640
- onClick: () => n(s.item),
1641
- "aria-label": `Jump to feedback from ${s.item.authorEmail}`
1712
+ className: (t == null ? void 0 : t.id) === o.item.id ? "review-lens-minimap__point review-lens-minimap__point--selected" : "review-lens-minimap__point",
1713
+ style: { top: `${o.top}%` },
1714
+ onClick: () => n(o.item),
1715
+ "aria-label": `Jump to feedback from ${o.item.authorEmail}`
1642
1716
  },
1643
- s.item.id
1717
+ o.item.id
1644
1718
  )) });
1645
1719
  }
1646
- function an({ target: e }) {
1720
+ function hn({ target: e }) {
1647
1721
  const t = [
1648
1722
  ["Selector", e.selector],
1649
1723
  ["Size", `${e.cssSnapshot.width} x ${e.cssSnapshot.height}`],
@@ -1656,120 +1730,120 @@ function an({ target: e }) {
1656
1730
  ["Color", e.cssSnapshot.color],
1657
1731
  ["Background", e.cssSnapshot.backgroundColor]
1658
1732
  ];
1659
- return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */ o("div", { children: [
1733
+ return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
1660
1734
  /* @__PURE__ */ i("dt", { children: n }),
1661
1735
  /* @__PURE__ */ i("dd", { children: r })
1662
1736
  ] }, n)) });
1663
1737
  }
1664
- function De({ title: e, items: t }) {
1665
- return /* @__PURE__ */ o("section", { className: "review-lens-insights", children: [
1738
+ function He({ title: e, items: t }) {
1739
+ return /* @__PURE__ */ s("section", { className: "review-lens-insights", children: [
1666
1740
  /* @__PURE__ */ i("h3", { children: e }),
1667
1741
  t.length === 0 ? /* @__PURE__ */ i("p", { children: "No issues detected." }) : null,
1668
1742
  t.length > 0 ? /* @__PURE__ */ i("ul", { children: t.map((n) => /* @__PURE__ */ i("li", { children: n }, n)) }) : null
1669
1743
  ] });
1670
1744
  }
1671
- function z(e) {
1745
+ function H(e) {
1672
1746
  try {
1673
1747
  return document.querySelector(e);
1674
1748
  } catch {
1675
1749
  return null;
1676
1750
  }
1677
1751
  }
1678
- function Qe(e) {
1679
- const t = z(e.selector);
1752
+ function et(e) {
1753
+ const t = H(e.selector);
1680
1754
  if (!t)
1681
1755
  return { label: "Target missing", level: "warning" };
1682
1756
  const n = Q(t);
1683
1757
  return n.fingerprint.tagName !== e.elementFingerprint.tagName ? { label: "Element changed", level: "warning" } : Math.abs(n.fingerprint.width - e.elementFingerprint.width) > 2 || Math.abs(n.fingerprint.height - e.elementFingerprint.height) > 2 ? { label: "Size changed", level: "warning" } : n.cssSnapshot.fontSize !== e.createdCssSnapshot.fontSize || n.cssSnapshot.color !== e.createdCssSnapshot.color || n.cssSnapshot.padding !== e.createdCssSnapshot.padding ? { label: "Style changed", level: "warning" } : { label: "Target unchanged", level: "ok" };
1684
1758
  }
1685
- function sn(e) {
1686
- var p;
1687
- const t = z(e.selector);
1759
+ function un(e) {
1760
+ var g;
1761
+ const t = H(e.selector);
1688
1762
  if (!t)
1689
1763
  return ["Selected element is no longer available."];
1690
- const n = [], r = t.tagName.toLowerCase(), s = t.getAttribute("role"), c = ["button", "a", "input", "select", "textarea"].includes(r) || s === "button" || s === "link", h = t.getAttribute("aria-label") || t.getAttribute("title") || ((p = t.textContent) == null ? void 0 : p.trim());
1691
- c && !h && n.push("Interactive element has no accessible name."), c && (e.rect.width < 44 || e.rect.height < 44) && n.push("Tap target is smaller than 44 x 44."), r === "img" && !t.getAttribute("alt") && n.push("Image is missing alt text.");
1764
+ const n = [], r = t.tagName.toLowerCase(), o = t.getAttribute("role"), c = ["button", "a", "input", "select", "textarea"].includes(r) || o === "button" || o === "link", u = t.getAttribute("aria-label") || t.getAttribute("title") || ((g = t.textContent) == null ? void 0 : g.trim());
1765
+ c && !u && n.push("Interactive element has no accessible name."), c && (e.rect.width < 44 || e.rect.height < 44) && n.push("Tap target is smaller than 44 x 44."), r === "img" && !t.getAttribute("alt") && n.push("Image is missing alt text.");
1692
1766
  const w = /^h[1-6]$/.test(r) ? Number(r.slice(1)) : 0;
1693
- return w > 1 && !document.querySelector(`h${w - 1}`) && n.push("Heading may skip the previous level."), un(e.cssSnapshot.color, e.cssSnapshot.backgroundColor) && n.push("Text contrast may be low."), n;
1767
+ return w > 1 && !document.querySelector(`h${w - 1}`) && n.push("Heading may skip the previous level."), vn(e.cssSnapshot.color, e.cssSnapshot.backgroundColor) && n.push("Text contrast may be low."), n;
1694
1768
  }
1695
- function on(e, t = {}) {
1769
+ function mn(e, t = {}) {
1696
1770
  const n = [];
1697
- return U("Padding", e.padding, t.spacing, n, { allowComposite: !0 }), U("Margin", e.margin, t.spacing, n, { allowComposite: !0 }), U("Font size", e.fontSize, t.fontSize, n), U("Line height", e.lineHeight, t.lineHeight, n), U("Text color", e.color, t.color, n), U("Background", e.backgroundColor, t.color, n), U("Radius", e.borderRadius, t.radius, n, { allowComposite: !0 }), n;
1771
+ return D("Padding", e.padding, t.spacing, n, { allowComposite: !0 }), D("Margin", e.margin, t.spacing, n, { allowComposite: !0 }), D("Font size", e.fontSize, t.fontSize, n), D("Line height", e.lineHeight, t.lineHeight, n), D("Text color", e.color, t.color, n), D("Background", e.backgroundColor, t.color, n), D("Radius", e.borderRadius, t.radius, n, { allowComposite: !0 }), n;
1698
1772
  }
1699
- function U(e, t, n, r, s = {}) {
1700
- !n || n.length === 0 || !t || ln(t, n, s) || r.push(`${e} ${t} is outside configured tokens.`);
1773
+ function D(e, t, n, r, o = {}) {
1774
+ !n || n.length === 0 || !t || pn(t, n, o) || r.push(`${e} ${t} is outside configured tokens.`);
1701
1775
  }
1702
- function ln(e, t, n = {}) {
1776
+ function pn(e, t, n = {}) {
1703
1777
  if (t.includes(e))
1704
1778
  return !0;
1705
1779
  if (!n.allowComposite)
1706
1780
  return !1;
1707
1781
  const r = e.trim().split(/\s+/);
1708
- return r.length > 1 && r.every((s) => t.includes(s));
1782
+ return r.length > 1 && r.every((o) => t.includes(o));
1709
1783
  }
1710
- function dn(e) {
1784
+ function gn(e) {
1711
1785
  const t = e.id ? `#${e.id}` : "", n = e.className ? `.${e.className.split(/\s+/).filter(Boolean).slice(0, 2).join(".")}` : "", r = e.ariaLabel ? `[aria-label="${e.ariaLabel}"]` : "";
1712
1786
  return `${e.tagName}${t}${n}${r}` || e.tagName;
1713
1787
  }
1714
- function cn(e, t) {
1715
- const n = [], r = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2, s = (Math.max(e.top, t.top) + Math.min(e.bottom, t.bottom)) / 2;
1788
+ function fn(e, t) {
1789
+ const n = [], r = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2, o = (Math.max(e.top, t.top) + Math.min(e.bottom, t.bottom)) / 2;
1716
1790
  if (e.right <= t.left || t.right <= e.left) {
1717
- const c = e.right <= t.left ? e.right : t.right, h = e.right <= t.left ? t.left : e.left;
1791
+ const c = e.right <= t.left ? e.right : t.right, u = e.right <= t.left ? t.left : e.left;
1718
1792
  n.push({
1719
1793
  key: "horizontal",
1720
1794
  axis: "horizontal",
1721
- top: ze(s, 0, window.innerHeight),
1795
+ top: Ke(o, 0, window.innerHeight),
1722
1796
  left: c,
1723
- width: Math.max(h - c, 1),
1797
+ width: Math.max(u - c, 1),
1724
1798
  height: 1,
1725
- label: `${Math.round(h - c)}px`
1799
+ label: `${Math.round(u - c)}px`
1726
1800
  });
1727
1801
  }
1728
1802
  if (e.bottom <= t.top || t.bottom <= e.top) {
1729
- const c = e.bottom <= t.top ? e.bottom : t.bottom, h = e.bottom <= t.top ? t.top : e.top;
1803
+ const c = e.bottom <= t.top ? e.bottom : t.bottom, u = e.bottom <= t.top ? t.top : e.top;
1730
1804
  n.push({
1731
1805
  key: "vertical",
1732
1806
  axis: "vertical",
1733
1807
  top: c,
1734
- left: ze(r, 0, window.innerWidth),
1808
+ left: Ke(r, 0, window.innerWidth),
1735
1809
  width: 1,
1736
- height: Math.max(h - c, 1),
1737
- label: `${Math.round(h - c)}px`
1810
+ height: Math.max(u - c, 1),
1811
+ label: `${Math.round(u - c)}px`
1738
1812
  });
1739
1813
  }
1740
1814
  return n;
1741
1815
  }
1742
- function ze(e, t, n) {
1816
+ function Ke(e, t, n) {
1743
1817
  return Math.min(Math.max(e, t), n);
1744
1818
  }
1745
1819
  function X(e, t) {
1746
1820
  const n = /* @__PURE__ */ new Map();
1747
1821
  for (const r of e) {
1748
- const s = t(r);
1749
- n.set(s, (n.get(s) ?? 0) + 1);
1822
+ const o = t(r);
1823
+ n.set(o, (n.get(o) ?? 0) + 1);
1750
1824
  }
1751
- return Array.from(n.entries()).sort((r, s) => s[1] - r[1] || r[0].localeCompare(s[0]));
1825
+ return Array.from(n.entries()).sort((r, o) => o[1] - r[1] || r[0].localeCompare(o[0]));
1752
1826
  }
1753
- function hn(e) {
1827
+ function wn(e) {
1754
1828
  return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement || e instanceof HTMLElement && e.isContentEditable;
1755
1829
  }
1756
- function un(e, t) {
1757
- const n = He(e), r = He(t);
1758
- return !n || !r || r.alpha === 0 ? !1 : mn(n, r) < 4.5;
1830
+ function vn(e, t) {
1831
+ const n = Je(e), r = Je(t);
1832
+ return !n || !r || r.alpha === 0 ? !1 : bn(n, r) < 4.5;
1759
1833
  }
1760
- function He(e) {
1834
+ function Je(e) {
1761
1835
  const t = e.match(/rgba?\(([^)]+)\)/);
1762
1836
  if (!t)
1763
1837
  return null;
1764
- const [n, r, s, c = "1"] = t[1].split(",").map((h) => h.trim());
1838
+ const [n, r, o, c = "1"] = t[1].split(",").map((u) => u.trim());
1765
1839
  return {
1766
1840
  red: Number(n),
1767
1841
  green: Number(r),
1768
- blue: Number(s),
1842
+ blue: Number(o),
1769
1843
  alpha: Number(c)
1770
1844
  };
1771
1845
  }
1772
- function mn(e, t) {
1846
+ function bn(e, t) {
1773
1847
  const n = Math.max(ie(e), ie(t)), r = Math.min(ie(e), ie(t));
1774
1848
  return (n + 0.05) / (r + 0.05);
1775
1849
  }
@@ -1780,7 +1854,7 @@ function ie(e) {
1780
1854
  });
1781
1855
  return t[0] * 0.2126 + t[1] * 0.7152 + t[2] * 0.0722;
1782
1856
  }
1783
- function pn(e) {
1857
+ function yn(e) {
1784
1858
  const t = {
1785
1859
  top: I(e.cssSnapshot.marginTop),
1786
1860
  right: I(e.cssSnapshot.marginRight),
@@ -1796,31 +1870,31 @@ function pn(e) {
1796
1870
  right: I(e.cssSnapshot.paddingRight),
1797
1871
  bottom: I(e.cssSnapshot.paddingBottom),
1798
1872
  left: I(e.cssSnapshot.paddingLeft)
1799
- }, s = {
1873
+ }, o = {
1800
1874
  top: e.rect.top,
1801
1875
  left: e.rect.left,
1802
1876
  width: Math.max(e.rect.width, 0),
1803
1877
  height: Math.max(e.rect.height, 0)
1804
1878
  }, c = {
1805
- top: s.top - t.top,
1806
- left: s.left - t.left,
1807
- width: s.width + t.left + t.right,
1808
- height: s.height + t.top + t.bottom
1809
- }, h = {
1810
- top: s.top + n.top,
1811
- left: s.left + n.left,
1812
- width: Math.max(s.width - n.left - n.right, 0),
1813
- height: Math.max(s.height - n.top - n.bottom, 0)
1879
+ top: o.top - t.top,
1880
+ left: o.left - t.left,
1881
+ width: o.width + t.left + t.right,
1882
+ height: o.height + t.top + t.bottom
1883
+ }, u = {
1884
+ top: o.top + n.top,
1885
+ left: o.left + n.left,
1886
+ width: Math.max(o.width - n.left - n.right, 0),
1887
+ height: Math.max(o.height - n.top - n.bottom, 0)
1814
1888
  }, w = {
1815
- top: h.top + r.top,
1816
- left: h.left + r.left,
1817
- width: Math.max(h.width - r.left - r.right, 0),
1818
- height: Math.max(h.height - r.top - r.bottom, 0)
1889
+ top: u.top + r.top,
1890
+ left: u.left + r.left,
1891
+ width: Math.max(u.width - r.left - r.right, 0),
1892
+ height: Math.max(u.height - r.top - r.bottom, 0)
1819
1893
  };
1820
1894
  return {
1821
1895
  margin: c,
1822
- border: s,
1823
- padding: h,
1896
+ border: o,
1897
+ padding: u,
1824
1898
  content: w
1825
1899
  };
1826
1900
  }
@@ -1829,11 +1903,11 @@ function I(e) {
1829
1903
  return Number.isFinite(t) ? t : 0;
1830
1904
  }
1831
1905
  export {
1832
- Ot as ReviewLensLogo,
1833
- bn as ReviewLensOverlay,
1834
- wn as ReviewLensProvider,
1906
+ Qt as ReviewLensLogo,
1907
+ Nn as ReviewLensOverlay,
1908
+ xn as ReviewLensProvider,
1835
1909
  Q as buildElementTarget,
1836
- vt as createGoogleSheetsAdapter,
1837
- $t as normalizeReviewUrl,
1838
- Tt as useReviewLens
1910
+ St as createGoogleSheetsAdapter,
1911
+ Ut as normalizeReviewUrl,
1912
+ Dt as useReviewLens
1839
1913
  };