@commentkit/comment-kit 2.0.0 → 2.0.1

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +109 -13
  3. package/SECURITY.md +2 -2
  4. package/dist/node/cli/doctor.js +84 -20
  5. package/dist/node/cli/init.js +349 -35
  6. package/dist/node/cli/main.js +35 -17
  7. package/dist/node/cli/mcp.js +187 -6
  8. package/dist/node/shared/dashboard-places.js +33 -0
  9. package/dist/npm/chunks/{AgentSend-DxRJIYiz.js → AgentSend-DOy3jhyF.js} +16 -16
  10. package/dist/npm/chunks/{Checklist-CnlfeSbc.js → Checklist-CW_SwMpS.js} +70 -70
  11. package/dist/npm/chunks/{Composer-B1bBVszY.js → Composer-Bveq5QrK.js} +276 -274
  12. package/dist/npm/chunks/{Guest-vvNPz8h-.js → Guest-7hcN765o.js} +58 -55
  13. package/dist/npm/chunks/{MarkupEditor-VCOXh9d2.js → MarkupEditor-6bJGpWGO.js} +46 -39
  14. package/dist/npm/chunks/Panel-ChPUB68C.js +1211 -0
  15. package/dist/npm/chunks/{Settings-BGoZS2iV.js → Settings-CB5eEKnf.js} +77 -77
  16. package/dist/npm/chunks/{Shortcuts-B2OMvczr.js → Shortcuts-eAyjJ89P.js} +4 -4
  17. package/dist/npm/chunks/{StyleEditor-CJ_d8Huf.js → StyleEditor-CZTdAA5c.js} +10 -10
  18. package/dist/npm/chunks/{StylePanel-yQzHHlY7.js → StylePanel-B4pHQUL9.js} +61 -61
  19. package/dist/npm/chunks/{TaskFields-fmy6_HtK.js → TaskFields-C8BX0Sgg.js} +55 -55
  20. package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +1160 -0
  21. package/dist/npm/chunks/Viewer-DY6zb90M.js +114 -0
  22. package/dist/npm/chunks/{agent-C1OQzBAm.js → agent-MTQHr9ei.js} +1 -1
  23. package/dist/npm/chunks/{ar-CAJ3XT8e.js → ar-L5cQ-NPe.js} +2 -0
  24. package/dist/npm/chunks/{card-bits-CAnzrqx3.js → card-bits-CTdrkYn8.js} +16 -16
  25. package/dist/npm/chunks/{client-kNAo2TTG.js → client-7eVxvg5j.js} +7 -7
  26. package/dist/npm/chunks/{confetti-CkBdSu19.js → confetti-BIs5s14P.js} +1 -1
  27. package/dist/npm/chunks/{context-B8UAzve0.js → context-Cf6khm7A.js} +1 -1
  28. package/dist/npm/chunks/{de-Dl18G48t.js → de-D0C-v6tP.js} +2 -0
  29. package/dist/npm/chunks/{dialog-GO04oC3D.js → dialog-DvdIkCW0.js} +1 -1
  30. package/dist/npm/chunks/{dpop-U48QIQd7.js → dpop-0A76OPa9.js} +1 -1
  31. package/dist/npm/chunks/{es-Dxk79lS9.js → es-Bw4Dj9tN.js} +2 -0
  32. package/dist/npm/chunks/{extension-CKFpPWmi.js → extension-DFVOvciD.js} +1 -1
  33. package/dist/npm/chunks/{extension-E81hWyiT.js → extension-SmoH5AA4.js} +2 -2
  34. package/dist/npm/chunks/{files-DyD5BZgp.js → files-4lV9YQIX.js} +2 -2
  35. package/dist/npm/chunks/{fr-8BebGKYD.js → fr-TkuQaIAa.js} +2 -0
  36. package/dist/npm/chunks/{hi-BIN6Yy_p.js → hi-DXSH2U8d.js} +2 -0
  37. package/dist/npm/chunks/{i18n-DOBt8e9U.js → i18n-aVSu9TcJ.js} +56 -47
  38. package/dist/npm/chunks/{identify-CN-3xzqL.js → identify-BGYh2dVo.js} +4 -4
  39. package/dist/npm/chunks/{it-Cr6EwpPQ.js → it-CiWA_bch.js} +2 -0
  40. package/dist/npm/chunks/{ja-Iy3s5aur.js → ja-C-QmR3yz.js} +2 -0
  41. package/dist/npm/chunks/{late-words-B2bmZceJ.js → late-words-80_VWt8S.js} +3 -1
  42. package/dist/npm/chunks/{live-CelVeZfP.js → live-BExWHzQ7.js} +1 -1
  43. package/dist/npm/chunks/{nl-B84WHqqe.js → nl-CEmZRqjX.js} +2 -0
  44. package/dist/npm/chunks/{page-key-DepmJzC1.js → page-key-HSY3Lze5.js} +1 -1
  45. package/dist/npm/chunks/{pick-yTyqtxN0.js → pick-B3sR7jtS.js} +1 -1
  46. package/dist/npm/chunks/{pkce-ChKGSW_4.js → pkce-CfZhiNBi.js} +1 -1
  47. package/dist/npm/chunks/{pt-BR-DOkdlfoe.js → pt-BR-b-a8sxO8.js} +2 -0
  48. package/dist/npm/chunks/{report-CrIqQZDI.js → report-DaVuoRYS.js} +1 -1
  49. package/dist/npm/chunks/show-BoN8AC-F.js +97 -0
  50. package/dist/npm/chunks/{signin-Dd1rb2BP.js → signin-BOWr_WCo.js} +3 -3
  51. package/dist/npm/chunks/{source-pXVve2Cx.js → source-mk3rGBBQ.js} +1 -1
  52. package/dist/npm/chunks/{src-BTMy4Gyc.js → src-C8rZFyL_.js} +77 -70
  53. package/dist/npm/chunks/start-CV4j78_q.js +1894 -0
  54. package/dist/npm/chunks/{states-sfTbjZz8.js → states-b9Bv3Ci7.js} +1 -1
  55. package/dist/npm/chunks/{upload-MgPYqPyE.js → upload-B2mkgMeJ.js} +1 -1
  56. package/dist/npm/chunks/uploads-8AxyRq7g.js +1147 -0
  57. package/dist/npm/chunks/{wrap-Bl0gbnFa.js → wrap-DW6EFbVQ.js} +1 -1
  58. package/dist/npm/chunks/{zh-CN-Z5fQCb7G.js → zh-CN-JTscW8u8.js} +2 -0
  59. package/dist/npm/element.js +1 -1
  60. package/dist/npm/headless.js +2 -2
  61. package/dist/npm/index.js +2 -2
  62. package/dist/npm/react.js +1 -1
  63. package/dist/npm/svelte.js +1 -1
  64. package/dist/npm/types/core/types.d.ts +2 -2
  65. package/dist/npm/vue.js +1 -1
  66. package/package.json +3 -1
  67. package/dist/npm/chunks/Panel-F37vIL1K.js +0 -1206
  68. package/dist/npm/chunks/ThreadCard-D51slKST.js +0 -1113
  69. package/dist/npm/chunks/Viewer-BOBadqmC.js +0 -111
  70. package/dist/npm/chunks/show-BgVC8gWY.js +0 -97
  71. package/dist/npm/chunks/start-DtVlpt7p.js +0 -1878
  72. package/dist/npm/chunks/uploads-D49mywwz.js +0 -1146
@@ -0,0 +1,1211 @@
1
+ import { n as e } from "./src-C8rZFyL_.js";
2
+ import { o as t, p as n, v as r } from "./client-7eVxvg5j.js";
3
+ import { s as i } from "./anchor-BsQNVkHj.js";
4
+ import { _ as a, a as o, b as s, c, d as l, f as u, i as d, m as f, n as p, o as m, t as h, u as g } from "./i18n-aVSu9TcJ.js";
5
+ import { i as ee } from "./card-bits-CTdrkYn8.js";
6
+ import { r as _ } from "./drafts-B0ctr1g9.js";
7
+ import { t as v } from "./states-b9Bv3Ci7.js";
8
+ import { n as y, r as b, t as x } from "./context-Cf6khm7A.js";
9
+ import { n as S, r as C } from "./Checklist-CW_SwMpS.js";
10
+ import { C as w, D as te, M as T, N as E, _ as ne, b as D, g as O, h as k, j as A, k as re, o as j, s as M, v as ie, x as N, y as P } from "./start-CV4j78_q.js";
11
+ // src/ui/Notifications.tsx
12
+ function ae({ items: e, onOpen: t, more: n, loadingMore: r, onMore: i, unread: a, onMarkAll: o }) {
13
+ let l = e.map((e) => e.thread_id);
14
+ return /* @__PURE__ */ g(s, { children: [/* @__PURE__ */ g("ul", {
15
+ class: "ck-list",
16
+ onKeyDown: (e) => k(e, ".ck-item", !0),
17
+ children: e.map((e) => /* @__PURE__ */ g("li", { children: /* @__PURE__ */ g("button", {
18
+ class: "ck-item",
19
+ "data-id": e.thread_id,
20
+ "data-unread": !e.read,
21
+ onClick: () => t(e.thread_id, l),
22
+ children: [/* @__PURE__ */ g("div", {
23
+ class: "ck-item-top",
24
+ children: [
25
+ e.read ? null : /* @__PURE__ */ g("span", {
26
+ class: "ck-unread",
27
+ children: /* @__PURE__ */ g("span", {
28
+ class: "ck-sr",
29
+ children: c("unread")
30
+ })
31
+ }),
32
+ /* @__PURE__ */ g("span", {
33
+ class: "ck-item-tags",
34
+ children: /* @__PURE__ */ g("span", { children: [/* @__PURE__ */ g(F, { item: e }), e.reference ? ` · ${e.reference}` : ""] })
35
+ }),
36
+ /* @__PURE__ */ g("time", {
37
+ class: "ck-time",
38
+ dateTime: e.created_at,
39
+ title: d(e.created_at),
40
+ children: m(e.created_at)
41
+ })
42
+ ]
43
+ }), e.excerpt ? /* @__PURE__ */ g("div", {
44
+ class: "ck-item-text",
45
+ dir: "auto",
46
+ children: e.excerpt
47
+ }) : null]
48
+ }) }))
49
+ }), n || a ? /* @__PURE__ */ g("div", {
50
+ class: "ck-pad ck-list-foot",
51
+ children: [a ? /* @__PURE__ */ g("button", {
52
+ class: "ck-btn",
53
+ onClick: o,
54
+ children: c("markAllRead")
55
+ }) : null, n ? /* @__PURE__ */ g("button", {
56
+ class: "ck-btn",
57
+ "aria-disabled": r || void 0,
58
+ "aria-busy": r,
59
+ onClick: () => !r && i(),
60
+ children: c("showMore")
61
+ }) : null]
62
+ }) : null] });
63
+ }
64
+ function F({ item: e }) {
65
+ let t = `kind_${e.kind}`, [n, r] = h(t in oe ? t : "otherKind", "actor"), { type: i, name: a } = e.actor;
66
+ return /* @__PURE__ */ g(s, { children: [
67
+ n,
68
+ /* @__PURE__ */ g("strong", { children: /* @__PURE__ */ g("bdi", { children: i === "agent" || i === "integration" || i === "system" ? a : c("personName", { name: a }) }) }),
69
+ r
70
+ ] });
71
+ }
72
+ var oe = {
73
+ kind_mention: !0,
74
+ kind_reply: !0,
75
+ kind_assigned: !0,
76
+ kind_ready_for_review: !0,
77
+ kind_reopened: !0,
78
+ kind_resolved: !0,
79
+ kind_closed: !0,
80
+ kind_new_feedback: !0,
81
+ kind_due_soon: !0,
82
+ kind_overdue: !0,
83
+ kind_agent_request: !0
84
+ };
85
+ // src/ui/panel-parts.tsx
86
+ M(v);
87
+ function I(e) {
88
+ let t = e.getBoundingClientRect(), n = e.closest(".ck-panel")?.getBoundingClientRect();
89
+ if (!n) return !1;
90
+ let r = t.left + t.width / 2 > n.left + n.width / 2;
91
+ return getComputedStyle(e).direction === "rtl" ? !r : r;
92
+ }
93
+ function L(e, t, n) {
94
+ return ie(e, t, n), (e) => {
95
+ let r = e.relatedTarget;
96
+ r && t.current && !t.current.contains(r) && n();
97
+ };
98
+ }
99
+ function R({ label: e, value: t, options: n, onChange: r, compact: i = !1 }) {
100
+ let [o, s] = a(!1), [c, l] = a(!1), d = f(null), p = () => d.current?.querySelector(".ck-choose-btn"), m = n.find(([e]) => e === t)?.[1] ?? n[0]?.[1] ?? "", h = L(o, d, () => s(!1));
101
+ u(() => {
102
+ o && d.current?.querySelector("[aria-selected=true]")?.focus();
103
+ }, [o]);
104
+ let ee = () => (s(!1), p()?.focus());
105
+ return /* @__PURE__ */ g("div", {
106
+ class: "ck-choose",
107
+ ref: d,
108
+ "data-compact": i || void 0,
109
+ onFocusOut: h,
110
+ children: [/* @__PURE__ */ g("button", {
111
+ class: "ck-input ck-choose-btn",
112
+ "aria-haspopup": "listbox",
113
+ "aria-expanded": o,
114
+ "aria-label": `${e}: ${m}`,
115
+ onClick: () => {
116
+ !o && d.current && l(I(d.current)), s(!o);
117
+ },
118
+ children: [/* @__PURE__ */ g("bdi", {
119
+ title: m,
120
+ children: m
121
+ }), /* @__PURE__ */ g(w, {
122
+ name: "chevron",
123
+ size: 12
124
+ })]
125
+ }), o ? /* @__PURE__ */ g("div", {
126
+ class: "ck-choose-menu ck-pop",
127
+ role: "listbox",
128
+ "aria-label": e,
129
+ "data-end": c || void 0,
130
+ onKeyDown: (e) => {
131
+ e.key === "Escape" ? (e.stopPropagation(), ee()) : k(e, "[role=option]", !0);
132
+ },
133
+ children: n.map(([e, n]) => /* @__PURE__ */ g("button", {
134
+ role: "option",
135
+ "aria-selected": e === t,
136
+ title: n,
137
+ onClick: () => (r(e), ee()),
138
+ children: /* @__PURE__ */ g("bdi", { children: n })
139
+ }))
140
+ }) : null]
141
+ });
142
+ }
143
+ function se({ value: e, people: t, onChange: n }) {
144
+ let [r, i] = a(!1), [o, s] = a(!1), l = f(null), d = L(r, l, () => i(!1));
145
+ u(() => {
146
+ r && l.current && s(I(l.current));
147
+ }, [r, e.join()]);
148
+ let p = [
149
+ ["me", c("assignedToMe")],
150
+ ["none", c("unassigned")],
151
+ ...t.map((e) => [String(e.id), e.name])
152
+ ], m = e.length ? ce(e, t) : c("anyone");
153
+ return /* @__PURE__ */ g("div", {
154
+ class: r ? "ck-people-pick ck-pop" : "ck-people-pick",
155
+ ref: l,
156
+ onFocusOut: d,
157
+ onKeyDown: (e) => {
158
+ r && e.key === "Escape" && (e.stopPropagation(), i(!1), l.current?.querySelector(".ck-people-btn")?.focus());
159
+ },
160
+ children: [/* @__PURE__ */ g("button", {
161
+ class: "ck-input ck-choose-btn ck-people-btn",
162
+ "aria-expanded": r,
163
+ "aria-haspopup": "true",
164
+ "aria-label": `${c("assigneeFilter")}: ${m}`,
165
+ onClick: () => i(!r),
166
+ children: [/* @__PURE__ */ g("bdi", {
167
+ title: m,
168
+ children: m
169
+ }), /* @__PURE__ */ g(w, {
170
+ name: "chevron",
171
+ size: 12
172
+ })]
173
+ }), r ? /* @__PURE__ */ g("div", {
174
+ class: "ck-people-menu",
175
+ "data-end": o || void 0,
176
+ role: "group",
177
+ "aria-label": c("assigneeFilter"),
178
+ children: p.map(([t, r]) => /* @__PURE__ */ g("label", {
179
+ class: "ck-check",
180
+ children: [/* @__PURE__ */ g("input", {
181
+ type: "checkbox",
182
+ checked: e.includes(t),
183
+ onChange: (r) => {
184
+ let i = r.target.checked;
185
+ n(i ? t === "none" ? ["none"] : [...e.filter((e) => e !== "none"), t] : e.filter((e) => e !== t));
186
+ }
187
+ }), /* @__PURE__ */ g("bdi", { children: r })]
188
+ }))
189
+ }) : null]
190
+ });
191
+ }
192
+ function ce(e, t) {
193
+ let n = e.map((e) => e === "me" ? c("assignedToMe") : e === "none" ? c("unassigned") : t.find((t) => String(t.id) === e)?.name ?? "").filter(Boolean);
194
+ return n.length > 1 ? `${n[0]} +${n.length - 1}` : n[0] ?? c("anyone");
195
+ }
196
+ function le({ load: e, onRetry: t, art: n, empty: r, children: i }) {
197
+ return e.state === "loading" ? /* @__PURE__ */ g("div", {
198
+ class: "ck-loading",
199
+ role: "status",
200
+ children: [/* @__PURE__ */ g("span", {
201
+ class: "ck-sr",
202
+ children: c("loadingEarlier")
203
+ }), [
204
+ 0,
205
+ 1,
206
+ 2
207
+ ].map(() => /* @__PURE__ */ g("div", {
208
+ class: "ck-loading-row",
209
+ children: [
210
+ /* @__PURE__ */ g("div", { class: "ck-skeleton" }),
211
+ /* @__PURE__ */ g("div", { class: "ck-skeleton" }),
212
+ /* @__PURE__ */ g("div", { class: "ck-skeleton" })
213
+ ]
214
+ }))]
215
+ }) : e.state === "error" ? /* @__PURE__ */ g("div", {
216
+ class: "ck-empty",
217
+ role: "alert",
218
+ children: [
219
+ /* @__PURE__ */ g(C, { name: "error" }),
220
+ c("loadFailed"),
221
+ /* @__PURE__ */ g("button", {
222
+ class: "ck-btn",
223
+ onClick: t,
224
+ children: c("retry")
225
+ })
226
+ ]
227
+ }) : e.data.length ? /* @__PURE__ */ g(s, { children: i(e.data) }) : /* @__PURE__ */ g("div", {
228
+ class: "ck-empty",
229
+ children: [/* @__PURE__ */ g(C, { name: n }), r]
230
+ });
231
+ }
232
+ // src/ui/PickBar.tsx
233
+ function ue({ threads: t, onCancel: n, onDone: r }, i) {
234
+ let { client: s, reportError: l } = b(i), [u, d] = a(!1), p = O(u, () => e(() => import("./AgentSend-DOy3jhyF.js")).then((e) => e.AgentSend), (e) => (l(e), d(!1))), m = f(null);
235
+ return /* @__PURE__ */ g("div", {
236
+ class: "ck-pickbar",
237
+ role: "group",
238
+ "aria-label": c("sendToAgent"),
239
+ children: [
240
+ u && p ? /* @__PURE__ */ g(p, {
241
+ client: s,
242
+ threads: t,
243
+ onError: l,
244
+ onClose: () => (d(!1), m.current?.focus()),
245
+ onDone: r
246
+ }, t.map((e) => e.id).join()) : null,
247
+ /* @__PURE__ */ g("span", {
248
+ class: "ck-muted",
249
+ role: "status",
250
+ children: o("selectedCount", t.length)
251
+ }),
252
+ /* @__PURE__ */ g("button", {
253
+ class: "ck-btn",
254
+ onClick: n,
255
+ children: c("cancel")
256
+ }),
257
+ /* @__PURE__ */ g("button", {
258
+ class: "ck-btn ck-primary",
259
+ ref: m,
260
+ "aria-disabled": !t.length || void 0,
261
+ "aria-expanded": u,
262
+ "aria-haspopup": "menu",
263
+ onClick: () => t.length && d(!u),
264
+ children: [/* @__PURE__ */ g(w, {
265
+ name: "agent",
266
+ size: 14
267
+ }), c("sendToAgent")]
268
+ })
269
+ ]
270
+ });
271
+ }
272
+ var z = "/pages/sign-off", B = (e) => n(e.options.branch, e.options.commit);
273
+ function V(e) {
274
+ return e.api.request(z, { query: {
275
+ page_url: t(),
276
+ commit_sha: B(e).commit
277
+ } }).then((e) => e.data);
278
+ }
279
+ function de(e, n) {
280
+ let r = B(e), i = n?.trim().slice(0, 280);
281
+ return e.api.request(z, {
282
+ method: "POST",
283
+ idempotent: !0,
284
+ body: {
285
+ page: {
286
+ url: t(),
287
+ title: document.title.slice(0, 500) || null,
288
+ branch: r.branch,
289
+ commit_sha: r.commit
290
+ },
291
+ note: i || null
292
+ }
293
+ }).then((e) => e.data);
294
+ }
295
+ function fe(e, n = t()) {
296
+ return e.api.request(z, {
297
+ method: "DELETE",
298
+ query: { page_url: n }
299
+ }).then((e) => e.data);
300
+ }
301
+ // src/ui/SignOff.tsx
302
+ var pe = [
303
+ 401,
304
+ 402,
305
+ 403,
306
+ 404,
307
+ 503
308
+ ];
309
+ function me(e) {
310
+ let t = e.approvals.find((e) => e.mine) ?? null, n = e.approvals.filter((e) => !e.mine && !e.stale), r = t?.stale ? t : e.status === "outdated" && !n.length ? e.approvals.find((e) => e.stale) ?? null : null;
311
+ return {
312
+ state: r ? "outdated" : t ? "mine" : n.length ? "others" : "none",
313
+ mine: t && !t.stale ? t : null,
314
+ others: n,
315
+ reason: r ? r.stale_reason ?? "new_feedback" : null,
316
+ open: e.active_threads
317
+ };
318
+ }
319
+ function H(e) {
320
+ let t = e[0]?.person.name ?? "";
321
+ return e.length > 1 ? o("signOffByMore", e.length - 1, { name: t }) : c("signOffBy", { name: t });
322
+ }
323
+ var U = (e) => {
324
+ try {
325
+ return new Date(e).toLocaleDateString(p(), {
326
+ day: "numeric",
327
+ month: "short",
328
+ year: "numeric"
329
+ });
330
+ } catch {
331
+ return e.slice(0, 10);
332
+ }
333
+ };
334
+ function he({ version: e = 0, reveal: n = 0 }, i) {
335
+ let { client: s, caps: u, notify: p, reportError: m } = b(i), h = P(s.state, (e) => e.config?.read_only ?? !1), ee = P(s.state, (e) => e.threads), _ = ne(), [v, y] = a(null), [x, S] = a(!1), [C, w] = a(!1), [te, T] = a(null), [E, D] = a(""), O = f(null), k = f(!0);
336
+ l(() => () => void (k.current = !1), []);
337
+ let A = !!u?.comment && !h, j = s.pageKey(), M = v?.page === j ? v.data : null, ie = ee.filter((e) => e.status !== "resolved" && e.status !== "closed").map((e) => `${e.id}:${e.status}`).join(), N = f(0);
338
+ l(() => {
339
+ if (!A || x) return;
340
+ let e = ++N.current;
341
+ V(s).then((t) => {
342
+ e === N.current && k.current && (Array.isArray(t?.approvals) ? y({
343
+ page: j,
344
+ data: t
345
+ }) : S(!0));
346
+ }, (t) => {
347
+ e === N.current && k.current && (!(t instanceof r) || pe.includes(t.status)) && S(!0);
348
+ });
349
+ }, [
350
+ A,
351
+ x,
352
+ j,
353
+ ie,
354
+ e
355
+ ]);
356
+ let ae = f(0);
357
+ if (l(() => {
358
+ n && M && ae.current !== n && (ae.current = n, O.current?.scrollIntoView?.({ block: "nearest" }), O.current?.querySelector(".ck-signoff-text")?.focus({ preventScroll: !0 }));
359
+ }, [n, M]), !A || x || !M) return null;
360
+ let F = me(M), oe = (e) => {
361
+ m(e), e instanceof r && [
362
+ 402,
363
+ 403,
364
+ 503
365
+ ].includes(e.status) && e.code !== "verification_required" && S(!0);
366
+ }, I = (e, t) => {
367
+ N.current++, k.current && y({
368
+ page: t,
369
+ data: e
370
+ });
371
+ }, L = () => queueMicrotask(() => O.current?.querySelector(".ck-signoff-text")?.focus({ preventScroll: !0 })), R = () => {
372
+ if (C) return;
373
+ w(!0);
374
+ let e = s.pageKey();
375
+ fe(s).then((t) => (I(t, e), L()), oe).finally(() => k.current && w(!1));
376
+ }, se = (e = E) => {
377
+ if (C || !_) return;
378
+ w(!0);
379
+ let n = s.pageKey(), r = t();
380
+ de(s, e).then((e) => {
381
+ I(e, n), T(null), D(""), L(), p({
382
+ text: c("signOffDone"),
383
+ tone: "success",
384
+ action: {
385
+ label: c("undo"),
386
+ run: () => void fe(s, r).then((e) => I(e, n), m)
387
+ }
388
+ });
389
+ }, oe).finally(() => k.current && w(!1));
390
+ }, ce = F.state === "mine" ? c("signOffMine", { date: U(F.mine.approved_at) }) : F.state === "outdated" ? c(F.reason === "new_commit" ? "signOffNewCommit" : "signOffNewFeedback") : F.state === "others" ? H(F.others) : c("signOffAsk"), le = [F.state === "mine" && F.others.length ? H(F.others) : "", F.state !== "mine" && F.open ? o("signOffOpen", F.open) : ""].filter(Boolean), ue = F.mine ?? F.others[0];
391
+ return /* @__PURE__ */ g("section", {
392
+ class: "ck-signoff",
393
+ ref: O,
394
+ role: "region",
395
+ "aria-label": c("signOff"),
396
+ "data-state": F.state,
397
+ "aria-busy": C || void 0,
398
+ children: [/* @__PURE__ */ g("div", {
399
+ class: "ck-signoff-text",
400
+ role: "status",
401
+ tabIndex: -1,
402
+ title: ue && F.state !== "outdated" ? d(ue.approved_at) : void 0,
403
+ children: [
404
+ /* @__PURE__ */ g("strong", { children: ce }),
405
+ le.map((e) => /* @__PURE__ */ g("span", {
406
+ class: "ck-signoff-sub",
407
+ children: e
408
+ })),
409
+ F.mine?.note ? /* @__PURE__ */ g("span", {
410
+ class: "ck-signoff-sub ck-signoff-note",
411
+ children: /* @__PURE__ */ g("bdi", { children: F.mine.note })
412
+ }) : null
413
+ ]
414
+ }), te === j ? /* @__PURE__ */ g("div", {
415
+ class: "ck-signoff-form",
416
+ children: [
417
+ /* @__PURE__ */ g("input", {
418
+ class: "ck-input",
419
+ type: "text",
420
+ maxLength: 280,
421
+ value: E,
422
+ placeholder: c("signOffNote"),
423
+ "aria-label": c("signOffNote"),
424
+ ref: re,
425
+ onInput: (e) => D(e.target.value),
426
+ onKeyDown: (e) => {
427
+ e.key === "Enter" ? (e.preventDefault(), se(e.target.value)) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), T(null), D(""), L());
428
+ }
429
+ }),
430
+ /* @__PURE__ */ g("button", {
431
+ class: "ck-btn",
432
+ onClick: () => (T(null), D(""), L()),
433
+ children: c("cancel")
434
+ }),
435
+ /* @__PURE__ */ g("button", {
436
+ class: "ck-btn ck-primary",
437
+ "aria-disabled": C || !_ || void 0,
438
+ onClick: () => se(),
439
+ children: c(F.state === "outdated" ? "signOffAgain" : "signOffApprove")
440
+ })
441
+ ]
442
+ }) : F.state === "mine" ? /* @__PURE__ */ g("button", {
443
+ class: "ck-chip ck-chip-quiet",
444
+ "aria-disabled": C || !_ || void 0,
445
+ onClick: () => _ && R(),
446
+ children: c("signOffWithdraw")
447
+ }) : /* @__PURE__ */ g("button", {
448
+ class: F.state === "others" ? "ck-btn" : "ck-btn ck-primary",
449
+ "aria-disabled": !_ || void 0,
450
+ onClick: () => _ && (D(""), T(j)),
451
+ children: c(F.state === "outdated" ? "signOffAgain" : "signOffApprove")
452
+ })]
453
+ });
454
+ }
455
+ // src/ui/ThreadRow.tsx
456
+ var ge = {
457
+ element: "pin",
458
+ region: "area",
459
+ text: "quote",
460
+ page: "page"
461
+ };
462
+ function _e({ thread: e, tab: t, triager: n, picked: r, branch: a, allBranches: l, canResolve: u, onOpen: f, onToggle: p, onResolve: h, onCopyLink: ee }) {
463
+ let _ = r !== void 0, v = t === "page" && i(e.anchor).state === "detached", y = v ? T(e.capture?.screenshot?.thumbnail_url, "image") : null, b = e.assignees ?? (e.assignee ? [e.assignee] : []), x = (e.first_message?.reactions ?? []).slice().sort((e, t) => t.count - e.count).slice(0, 3), C = S(e), ne = e.status === "resolved" || e.status === "closed", O = c(`spot_${e.anchor.type}`), k = e.priority === "none" ? null : `${c("priority")}: ${c(`priority_${e.priority}`)}`;
464
+ return /* @__PURE__ */ g("li", {
465
+ "data-done": ne || void 0,
466
+ "data-picking": _ || void 0,
467
+ children: [
468
+ _ ? /* @__PURE__ */ g("input", {
469
+ type: "checkbox",
470
+ class: "ck-pick",
471
+ checked: r,
472
+ "aria-label": c("selectThread", { ref: e.reference }),
473
+ onChange: p
474
+ }) : null,
475
+ /* @__PURE__ */ g("button", {
476
+ class: "ck-item",
477
+ "data-id": e.id,
478
+ "data-shot": y ? "true" : void 0,
479
+ "aria-pressed": _ ? r : void 0,
480
+ onClick: _ ? p : f,
481
+ children: [/* @__PURE__ */ g("div", {
482
+ class: "ck-item-main",
483
+ children: [
484
+ /* @__PURE__ */ g("div", {
485
+ class: "ck-item-top",
486
+ children: [/* @__PURE__ */ g("span", {
487
+ class: "ck-item-tags",
488
+ children: [
489
+ /* @__PURE__ */ g("span", {
490
+ class: "ck-kind",
491
+ title: O,
492
+ "aria-label": O,
493
+ children: /* @__PURE__ */ g(w, {
494
+ name: ge[e.anchor.type] ?? "comment",
495
+ size: 12
496
+ })
497
+ }),
498
+ /* @__PURE__ */ g("strong", { children: n ? e.reference : c("feedbackRef", { ref: e.reference }) }),
499
+ /* @__PURE__ */ g(te, { status: e.status }),
500
+ k ? /* @__PURE__ */ g("span", {
501
+ class: "ck-flag",
502
+ "data-priority": e.priority,
503
+ title: k,
504
+ "aria-label": k,
505
+ children: /* @__PURE__ */ g(w, {
506
+ name: "flag",
507
+ size: 12
508
+ })
509
+ }) : null,
510
+ A(e) ? /* @__PURE__ */ g("span", {
511
+ class: "ck-tag",
512
+ title: `${c(`screen_${E(e.breakpoint)}`)} (${e.breakpoint}px)`,
513
+ children: c(`size_${E(e.breakpoint)}`)
514
+ }) : null,
515
+ v ? /* @__PURE__ */ g("span", {
516
+ class: "ck-tag ck-badge-soft",
517
+ title: c("detached"),
518
+ children: c("notOnPage")
519
+ }) : null
520
+ ]
521
+ }), /* @__PURE__ */ g("time", {
522
+ class: "ck-time",
523
+ dateTime: e.last_activity_at,
524
+ title: d(e.last_activity_at),
525
+ children: m(e.last_activity_at)
526
+ })]
527
+ }),
528
+ /* @__PURE__ */ g("div", {
529
+ class: "ck-item-text",
530
+ dir: "auto",
531
+ children: e.first_message?.body
532
+ }),
533
+ /* @__PURE__ */ g("div", {
534
+ class: "ck-muted ck-item-meta",
535
+ children: [
536
+ /* @__PURE__ */ g(D, { person: e.author }),
537
+ /* @__PURE__ */ g("bdi", {
538
+ title: e.author.name,
539
+ children: W(e.author.name)
540
+ }),
541
+ t === "all" ? /* @__PURE__ */ g(s, { children: [" · ", /* @__PURE__ */ g("bdi", {
542
+ class: "ck-item-page",
543
+ title: e.page.title || e.page.path,
544
+ children: e.page.title || e.page.path
545
+ })] }) : null,
546
+ /* @__PURE__ */ g("span", {
547
+ class: "ck-item-sep",
548
+ children: [" · ", o("messageCount", e.message_count)]
549
+ }),
550
+ l && e.page.branch && e.page.branch !== a ? /* @__PURE__ */ g("span", {
551
+ class: "ck-item-sep",
552
+ title: e.page.branch,
553
+ children: [" · ", c("onBranch", { branch: ve(e.page.branch) })]
554
+ }) : null,
555
+ C ? /* @__PURE__ */ g("span", {
556
+ class: "ck-item-check",
557
+ children: [
558
+ " · ",
559
+ /* @__PURE__ */ g(w, {
560
+ name: "check",
561
+ size: 12
562
+ }),
563
+ C
564
+ ]
565
+ }) : null,
566
+ x.length ? /* @__PURE__ */ g("span", {
567
+ class: "ck-item-reactions",
568
+ "aria-label": x.map((e) => o("reactionLabel", e.count, { emoji: e.emoji })).join(", "),
569
+ children: x.map((e) => /* @__PURE__ */ g("span", { children: [/* @__PURE__ */ g(N, { char: e.emoji }), e.count] }))
570
+ }) : null,
571
+ b.length ? /* @__PURE__ */ g("span", {
572
+ class: "ck-faces ck-item-faces",
573
+ title: `${c("assigneeFilter")}: ${b.map((e) => e.name).join(", ")}`,
574
+ children: b.slice(0, 3).map((e) => /* @__PURE__ */ g(D, { person: e }))
575
+ }) : null
576
+ ]
577
+ })
578
+ ]
579
+ }), y ? /* @__PURE__ */ g("img", {
580
+ class: "ck-item-thumb",
581
+ src: y,
582
+ alt: c("screenshot"),
583
+ loading: "lazy"
584
+ }) : null]
585
+ }),
586
+ _ ? null : /* @__PURE__ */ g("span", {
587
+ class: "ck-item-actions",
588
+ children: [u && !ne ? /* @__PURE__ */ g("button", {
589
+ class: "ck-ghost ck-ghost-sm",
590
+ "aria-label": c("resolveRef", { ref: e.reference }),
591
+ title: c("resolve"),
592
+ onClick: h,
593
+ children: /* @__PURE__ */ g(w, {
594
+ name: "check",
595
+ size: 14
596
+ })
597
+ }) : null, /* @__PURE__ */ g("button", {
598
+ class: "ck-ghost ck-ghost-sm",
599
+ "aria-label": c("copyLinkRef", { ref: e.reference }),
600
+ title: c("copyLink"),
601
+ onClick: ee,
602
+ children: /* @__PURE__ */ g(w, {
603
+ name: "link",
604
+ size: 14
605
+ })
606
+ })]
607
+ })
608
+ ]
609
+ });
610
+ }
611
+ function W(e) {
612
+ return e.trim().split(/\s+/)[0] || e;
613
+ }
614
+ function ve(e) {
615
+ return e.length > 28 ? `${e.slice(0, 27)}…` : e;
616
+ }
617
+ // src/ui/Panel.tsx
618
+ M(".ck-live-note .ck-btn{flex:none;margin-inline-start:auto}.ck-item-meta .ck-avatar{--ck-av:16px;margin-inline-end:2px}.ck-panel-list,.ck-panel-detail{flex-direction:column;flex:1;min-height:0;display:flex}.ck-panel-list[data-back]{animation:ck-slide-back var(--ck-dur) var(--ck-ease)}.ck-root[dir=rtl] .ck-panel-list[data-back]{animation-name:ck-slide-back-rtl}@keyframes ck-slide-back{0%{opacity:.4;translate:-16px}}@keyframes ck-slide-back-rtl{0%{opacity:.4;translate:16px}}.ck-panel-list>.ck-card-body{padding:0}.ck-here{font-size:var(--ck-fs-sm);color:var(--ck-text-muted);white-space:nowrap;font-variant-numeric:tabular-nums;align-items:center;gap:8px;display:inline-flex}.ck-dot{background:var(--ck-success);border-radius:50%;width:8px;height:8px}.ck-faces{display:inline-flex}.ck-faces .ck-avatar{--ck-av:24px;box-shadow:0 0 0 2px var(--ck-bg);margin-inline-start:-6px}.ck-faces .ck-avatar:first-child{margin-inline-start:0}.ck-faces-more{font-size:var(--ck-fs-sm);color:var(--ck-text-muted);font-variant-numeric:tabular-nums;margin-inline-start:4px}.ck-agent-chip{flex:0 auto;gap:4px;min-width:0}.ck-agent-chip>span{text-overflow:ellipsis;min-width:0;overflow:hidden}.ck-tabs{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);gap:2px;margin:8px 16px 0;padding:4px;display:flex}.ck-tab{border-radius:var(--ck-radius-sm);min-width:0;min-height:32px;font-size:var(--ck-fs-md);color:var(--ck-text-muted);white-space:nowrap;transition:background-color var(--ck-fast), color var(--ck-fast);background:0 0;border:0;flex:1;justify-content:center;align-items:center;gap:4px;padding:4px 8px;font-weight:600;display:inline-flex}.ck-tab[aria-selected=true]{color:var(--ck-text);background:var(--ck-bg);box-shadow:var(--ck-shadow-sm)}.ck-tab:focus-visible{outline-offset:-2px}.ck-tab-label{text-overflow:ellipsis;min-width:0;overflow:hidden}.ck-tab .ck-count{flex:none}.ck-count{border-radius:var(--ck-radius-pill);background:var(--ck-bg-hover);min-width:18px;height:18px;color:var(--ck-text-muted);font-size:var(--ck-fs-xs);text-align:center;font-variant-numeric:tabular-nums;padding:0 4px;font-weight:700;line-height:18px;display:inline-block}.ck-tab[aria-selected=true] .ck-count{background:var(--ck-accent-soft);color:var(--ck-accent-text)}.ck-chip .ck-count{min-width:16px;height:16px;margin-inline-start:2px;padding:0 4px;line-height:16px}.ck-pad-x{margin:8px 16px 0}.ck-live-note{align-items:center;gap:8px;display:flex}.ck-filters{gap:8px;padding:8px 16px;display:flex}.ck-filters+.ck-filters{padding-top:0}#ck-more-filters{flex-wrap:wrap}.ck-filters .ck-choose,.ck-filters .ck-people-pick{flex:none}#ck-more-filters .ck-choose-btn{height:32px;font-size:var(--ck-fs-md);padding-block-start:0;padding-block-end:0}.ck-search{flex:1;align-items:center;min-width:0;display:flex;position:relative}.ck-search>svg{color:var(--ck-text-muted);pointer-events:none;position:absolute}.ck-search>svg:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:12px}.ck-search>svg:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:12px}.ck-search>svg:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:12px}.ck-search>svg:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:12px}.ck-search .ck-input{padding-inline-start:32px;padding-inline-end:32px}.ck-search .ck-ghost{place-items:center;width:24px;height:24px;padding:0;display:grid;position:absolute;right:4px}.ck-branchbar{flex-wrap:wrap;align-items:center;gap:8px;padding:8px 16px 0;display:flex}.ck-quick-filters{padding-top:0}.ck-chip-quiet{background:0 0;border-color:#0000}.ck-result-count{font-size:var(--ck-fs-sm);font-variant-numeric:tabular-nums;white-space:nowrap;margin-inline-start:auto}.ck-choose,.ck-people-pick{position:relative}.ck-choose-btn{text-align:start;white-space:nowrap;cursor:pointer;align-items:center;gap:8px;width:auto;max-width:180px;padding-inline-start:12px;padding-inline-end:8px;display:inline-flex}.ck-choose-btn bdi{text-overflow:ellipsis;min-width:0;overflow:hidden}.ck-choose-btn svg{color:var(--ck-text-muted);transition:rotate var(--ck-dur) var(--ck-ease);flex:none;rotate:90deg}.ck-choose-btn[aria-expanded=true] svg{rotate:-90deg}.ck-choose[data-compact] .ck-choose-btn{height:28px;font-size:var(--ck-fs-sm);color:var(--ck-text-muted);border-radius:var(--ck-radius-pill);padding-block-start:0;padding-block-end:0;font-weight:600}.ck-choose-menu,.ck-people-menu{z-index:4;top:calc(100% + 4px);overscroll-behavior:contain;background:var(--ck-bg);border-radius:var(--ck-radius-md);width:max-content;max-width:280px;max-height:260px;box-shadow:var(--ck-shadow);animation:ck-pop var(--ck-dur) var(--ck-ease);border:1px solid #0000;gap:2px;padding:4px;display:grid;position:absolute;overflow:hidden auto}.ck-choose-menu:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-choose-menu:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-people-menu:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-people-menu:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-choose-menu:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-choose-menu:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-people-menu:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-people-menu:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-choose-menu{min-width:180px}.ck-people-menu{min-width:200px;max-height:240px}.ck-choose-menu[data-end]:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:auto;right:0}.ck-choose-menu[data-end]:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:auto;right:0}.ck-people-menu[data-end]:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:auto;right:0}.ck-people-menu[data-end]:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:auto;right:0}.ck-choose-menu[data-end]:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:0;right:auto}.ck-choose-menu[data-end]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:0;right:auto}.ck-people-menu[data-end]:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:0;right:auto}.ck-people-menu[data-end]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:0;right:auto}.ck-people-btn{max-width:180px}.ck-choose-menu button{border-radius:var(--ck-radius-sm);text-align:start;width:100%;min-height:32px;font-size:var(--ck-fs-md);white-space:nowrap;text-overflow:ellipsis;transition:background-color var(--ck-fast);background:0 0;border:0;padding:4px 8px;display:block;overflow:hidden}.ck-choose-menu button[aria-selected=true]{background:var(--ck-accent-soft);font-weight:600}.ck-choose-menu button:focus-visible{outline-offset:-2px}.ck-people-menu .ck-check{border-radius:var(--ck-radius-sm);min-width:0;min-height:32px;font-size:var(--ck-fs-md);transition:background-color var(--ck-fast);align-items:center;margin:0;padding:4px 8px}.ck-people-menu .ck-check input{margin:0}.ck-people-menu .ck-check bdi{overflow-wrap:anywhere;min-width:0}.ck-people-menu .ck-check:has(:focus-visible){outline:2px solid var(--ck-ring);outline-offset:-2px}.ck-people-menu .ck-check input:focus-visible{outline:none}.ck-list{margin:0;padding:4px 8px;list-style:none}.ck-list>li{position:relative}.ck-list>li+li{border-top:1px solid var(--ck-hairline)}.ck-item{text-align:start;border-radius:var(--ck-radius-sm);width:100%;transition:background-color var(--ck-fast);background:0 0;border:0;padding:12px 8px;display:block}.ck-item:focus-visible{outline-offset:-2px}.ck-item:active{background:var(--ck-bg-hover)}.ck-item[data-unread=true]{background:var(--ck-accent-soft)}.ck-item[data-shot]{grid-template-columns:minmax(0,1fr) 64px;align-items:start;gap:12px;display:grid}.ck-item-main{min-width:0}.ck-list>li[data-done] .ck-item-main{opacity:.6}.ck-item-top{font-size:var(--ck-fs-sm);color:var(--ck-text-muted);align-items:flex-start;gap:8px;line-height:1.67;display:flex}.ck-item-tags{flex-wrap:wrap;flex:1;align-items:center;gap:4px 8px;min-width:0;display:flex}.ck-item-tags>span:not([class]){overflow-wrap:anywhere;min-width:0}.ck-item-tags>.ck-tag{text-overflow:ellipsis;min-width:0;max-width:100%;overflow:hidden}.ck-item-tags>.ck-status{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;display:block;overflow:hidden}.ck-item-tags>.ck-status:before{vertical-align:middle;margin-inline-end:6px;display:inline-block}.ck-item-tags>strong{color:var(--ck-text);font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}.ck-item-tags strong{color:var(--ck-text)}.ck-item-text{-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;margin-top:4px;line-height:1.45;display:-webkit-box;overflow:hidden}.ck-item-meta{white-space:nowrap;align-items:center;gap:4px;min-width:0;margin-top:4px;display:flex;overflow:hidden}.ck-item-meta .ck-avatar{--ck-av:16px}.ck-item-meta bdi,.ck-item-sep{text-overflow:ellipsis;min-width:0;overflow:hidden}.ck-item-meta>:-webkit-any(.ck-avatar,.ck-item-check,.ck-item-reactions,.ck-item-faces){flex:none}.ck-item-meta>:is(.ck-avatar,.ck-item-check,.ck-item-reactions,.ck-item-faces){flex:none}.ck-item-thumb{object-fit:cover;object-position:top;border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);outline:1px solid var(--ck-img-outline);outline-offset:-1px;width:64px;height:44px;margin-top:2px}.ck-kind,.ck-flag{color:var(--ck-text-muted);place-items:center;display:inline-grid}.ck-flag[data-priority=urgent]{color:var(--ck-danger)}.ck-flag[data-priority=high]{color:color-mix(in srgb, var(--ck-danger) 50%, var(--ck-warning))}.ck-flag[data-priority=medium]{color:var(--ck-warning)}.ck-tag{border-radius:var(--ck-radius-pill);font-size:var(--ck-fs-xs);background:var(--ck-bg-hover);color:var(--ck-text-muted);white-space:nowrap;padding:0 8px;font-weight:600;line-height:18px}.ck-badge-soft{background:color-mix(in srgb, var(--ck-warning) 14%, transparent);color:color-mix(in srgb, var(--ck-warning) 80%, var(--ck-text))}.ck-item-check{font-variant-numeric:tabular-nums;align-items:center;gap:2px;display:inline-flex}.ck-item-reactions{font-variant-numeric:tabular-nums;gap:8px;margin-inline-start:4px;display:inline-flex}.ck-item-reactions>span{align-items:center;gap:2px;display:inline-flex}.ck-item-reactions .ck-emoji{width:12px;height:12px}.ck-item-faces{margin-inline-start:auto;padding-inline-start:4px}.ck-item-faces .ck-avatar{--ck-av:16px;margin-inline-start:-4px;margin-inline-end:0}.ck-item-actions{top:8px;border-radius:var(--ck-radius-sm);background:var(--ck-bg);box-shadow:var(--ck-shadow-sm);opacity:0;pointer-events:none;transition:opacity var(--ck-fast);gap:2px;padding:2px;display:flex;position:absolute}.ck-item-actions:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:8px}.ck-item-actions:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:8px}.ck-item-actions:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:8px}.ck-item-actions:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:8px}.ck-list>li:has(:focus-visible) .ck-item-actions{opacity:1;pointer-events:auto}.ck-item-actions .ck-ghost{border-radius:var(--ck-radius-sm);place-items:center;width:28px;height:28px;padding:0;display:grid}.ck-pad{padding:8px 16px}.ck-list-foot{flex-wrap:wrap;gap:8px;display:flex}.ck-loading{padding:4px 16px}.ck-loading-row{padding:12px 0}.ck-loading-row+.ck-loading-row{border-top:1px solid var(--ck-hairline)}.ck-list>li[data-picking] .ck-item{padding-inline-start:36px}.ck-list>li[data-picking] .ck-item[aria-pressed=true]{background:color-mix(in srgb, var(--ck-accent) 8%, transparent)}.ck-pick{z-index:1;width:16px;height:16px;accent-color:var(--ck-accent);cursor:pointer;margin:0;position:absolute;top:14px}.ck-pick:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:12px}.ck-pick:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:12px}.ck-pick:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:12px}.ck-pick:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:12px}.ck-pickbar{border-top:1px solid var(--ck-hairline);background:var(--ck-bg);align-items:center;gap:8px;padding:8px 16px;display:flex;position:relative}.ck-pickbar>.ck-muted{min-width:0;font-size:var(--ck-fs-md);font-variant-numeric:tabular-nums;flex:1}.ck-agent-menu{top:auto;right:auto;bottom:calc(100% + 8px)}.ck-agent-menu:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:12px}.ck-agent-menu:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:12px}.ck-agent-menu:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:12px}.ck-agent-menu:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:12px}.ck-agent-menu button[aria-disabled=true]{opacity:.5;cursor:default}.ck-agent-note{font-size:var(--ck-fs-sm);margin:4px 8px}.ck-unread{background:var(--ck-accent-text);border-radius:50%;flex:none;width:8px;height:8px;margin-block-start:6px;margin-block-end:6px}.ck-sr{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.ck-grabber{display:none}@media (max-width:520px){.ck-grabber{touch-action:none;flex:none;place-items:center;height:16px;display:grid}.ck-grabber:before{content:\"\";background:var(--ck-border);border-radius:2px;width:36px;height:4px}.ck-panel .ck-card-head{touch-action:none}.ck-panel-list>:not(:-webkit-any(.ck-card-body,.ck-card-head)){touch-action:pan-x}.ck-panel-list>:not(:is(.ck-card-body,.ck-card-head)){touch-action:pan-x}}@media (max-width:400px){.ck-agent-chip>span{display:none}}@media (max-height:480px){.ck-panel-list{overflow-y:auto}.ck-panel-list>.ck-card-body{flex:none;overflow:visible}.ck-root:has(.ck-panel) .ck-launcher[data-covered=true]{display:none}}.ck-signoff{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);font-size:var(--ck-fs-md);flex-wrap:wrap;align-items:center;gap:8px 12px;margin:8px 16px 4px;padding:8px 12px;line-height:1.45;display:flex}.ck-signoff[data-state=mine],.ck-signoff[data-state=others]{background:color-mix(in srgb, var(--ck-success) 10%, var(--ck-bg))}.ck-signoff[data-state=outdated]{background:color-mix(in srgb, var(--ck-warning) 12%, var(--ck-bg))}.ck-signoff-text{overflow-wrap:anywhere;text-wrap:pretty;flex:180px;min-width:0}.ck-signoff-text strong{color:var(--ck-text);font-weight:600}.ck-signoff-sub{color:var(--ck-text-muted);font-size:var(--ck-fs-sm);margin-top:2px;display:block}.ck-signoff-note:before{content:\"“\"}.ck-signoff-note:after{content:\"”\"}.ck-signoff>.ck-btn,.ck-signoff>.ck-chip{flex:none}.ck-signoff-form{flex-wrap:wrap;flex:100%;gap:8px;display:flex}.ck-signoff-form .ck-input{flex:160px;min-width:0}@media (hover:hover){.ck-tab:hover{color:var(--ck-text)}.ck-list>li:hover .ck-item-actions{opacity:1;pointer-events:auto}.ck-item:hover{background:var(--ck-bg-muted)}.ck-item[data-unread=true]:hover{background:color-mix(in srgb, var(--ck-accent) 18%, var(--ck-bg))}.ck-choose-menu button:hover,.ck-people-menu .ck-check:hover{background:var(--ck-bg-hover)}.ck-choose-menu button[aria-selected=true]:hover{background:color-mix(in srgb, var(--ck-accent) 18%, var(--ck-bg))}.ck-agent-menu button[aria-disabled=true]:hover{background:0 0}}@media (pointer:coarse){.ck-tab{min-height:44px}.ck-item{min-height:48px}.ck-choose-btn,.ck-choose-menu button,.ck-people-menu .ck-check{min-height:44px}.ck-choose[data-compact] .ck-choose-btn{height:36px;min-height:36px}.ck-item-actions{display:none}.ck-pick{width:20px;height:20px;top:12px}.ck-list>li[data-picking] .ck-item{padding-inline-start:44px}}@media (forced-colors:active){.ck-tab[aria-selected=true],.ck-choose-menu button[aria-selected=true],.ck-chip[aria-pressed=true]{color:highlighttext;background:highlight}.ck-unread{background:canvastext}}@media (prefers-reduced-motion:reduce){.ck-panel-list[data-back],.ck-choose-menu,.ck-people-menu{animation:none}.ck-choose-btn svg{transition:none}.ck-grabber{display:none}}");
619
+ var ye = {
620
+ urgent: 4,
621
+ high: 3,
622
+ medium: 2,
623
+ low: 1,
624
+ none: 0
625
+ };
626
+ function be({ client: e, side: n, dock: r = "bottom", onClose: i, onOpen: d, onError: p, detail: m, notify: h = () => void 0, version: v, reveal: b }) {
627
+ let S = P(e.state, (e) => e.session), C = P(e.state, (e) => e.threads), te = P(e.state, (e) => e.moreThreads), E = P(e.state, (e) => e.unread), O = P(e.state, (e) => e.allBranches), A = P(e.state, (e) => e.here), re = P(e.state, (e) => e.config?.read_only ?? !1), M = e.options.branch, ie = ne(), [N, F] = a(E > 0 && !b ? "inbox" : "page"), [oe, I] = a({ state: "loading" }), [L, ce] = a(null), [z, B] = a(!1), V = f(0), [de, fe] = a({ state: "loading" }), [pe, me] = a(null), H = f(0), [U, ge] = a(""), [W, be] = a("active"), [Ce, we] = a(0), [G, De] = a([]), [Oe, ke] = a(""), [K, Ae] = a(!1), [q, je] = a(null), [Me, Ne] = a([]), J = P(e.state, (e) => e.team), Pe = !!S?.capabilities.export_for_agents, [Y, Fe] = a(null), Ie = (e) => Fe((t) => {
628
+ let n = new Set(t);
629
+ return n.delete(e) || n.add(e), n;
630
+ }), Le = () => Fe(null);
631
+ l(Le, [N]), l(() => void (b && F("page")), [b]);
632
+ let [X, Re] = a(null), [Z, ze] = a(!1), [Q, Be] = a("recent"), Ve = P(e.state, (e) => e.live), [He, Ue] = a(!1);
633
+ l(() => {
634
+ if (Ve !== "lost") return Ue(!1);
635
+ let e = setTimeout(() => Ue(!0), 4e3);
636
+ return () => clearTimeout(e);
637
+ }, [Ve]);
638
+ let We = f(null), [Ge, Ke] = a({
639
+ people: [],
640
+ labels: []
641
+ }), qe = f(null), Je = f(null), Ye = f(null), Xe = f(!1), Ze = Xe.current && !m;
642
+ Xe.current = !!m, u(() => {
643
+ if (m || !Ye.current) return;
644
+ let e = Ye.current;
645
+ Ye.current = null, [...Je.current?.querySelectorAll(".ck-item[data-id]") ?? []].find((t) => t.dataset.id === e)?.focus();
646
+ }, [!!m]);
647
+ let Qe = (e, t) => {
648
+ Ye.current = typeof e == "string" ? e : e.id, d(e, t);
649
+ };
650
+ u(() => {
651
+ matchMedia("(pointer: fine)").matches && We.current ? We.current.focus({ preventScroll: !0 }) : qe.current?.querySelector("[aria-selected=true]")?.focus({ preventScroll: !0 });
652
+ }, []);
653
+ let $e = !!(U || G.length || X || Oe || K || W !== "active" || q), et = $e, tt = () => {
654
+ ge(""), be("active"), De([]), Re(null), Be("recent"), ke(""), Ae(!1), je(null);
655
+ }, nt = [
656
+ G.length > 0,
657
+ X !== null,
658
+ W !== "active",
659
+ Q !== "recent",
660
+ !!Oe,
661
+ K,
662
+ !!q
663
+ ].filter(Boolean).length, rt = G.includes("none") ? "none" : G.join(","), it = !!S?.capabilities.triage, at = () => ({
664
+ q: U || void 0,
665
+ status: W,
666
+ branch: q ?? e.branchFilter(),
667
+ page_url: N === "page" ? t() : void 0,
668
+ assignee: rt || void 0,
669
+ label: X ?? void 0,
670
+ priority: Oe || void 0,
671
+ author: K ? "me" : void 0,
672
+ sort: Q
673
+ }), ot = (e) => e.filter((e) => Ee(e, G, X, S));
674
+ l(() => {
675
+ if (N === "inbox" || N === "page" && !$e) return;
676
+ let t = ++V.current;
677
+ I({ state: "loading" }), ce(null);
678
+ let n = setTimeout(() => {
679
+ e.listThreads(at()).then((e) => {
680
+ t === V.current && (I({
681
+ state: "ready",
682
+ data: ot(e.data)
683
+ }), ce(e.next_cursor ?? null));
684
+ }, () => t === V.current && I({ state: "error" }));
685
+ }, U ? 250 : 0);
686
+ return () => clearTimeout(n);
687
+ }, [
688
+ N,
689
+ U,
690
+ W,
691
+ Ce,
692
+ O,
693
+ rt,
694
+ X,
695
+ $e,
696
+ Q,
697
+ Oe,
698
+ K,
699
+ q
700
+ ]);
701
+ let st = () => {
702
+ if (!L || z) return;
703
+ let t = V.current;
704
+ B(!0), e.listThreads({
705
+ ...at(),
706
+ cursor: L
707
+ }).then((e) => {
708
+ t === V.current && (I((t) => t.state === "ready" ? {
709
+ state: "ready",
710
+ data: [...t.data, ...ot(e.data).filter((e) => !t.data.some((t) => t.id === e.id))]
711
+ } : t), ce(e.next_cursor ?? null));
712
+ }, p).finally(() => B(!1));
713
+ };
714
+ l(() => {
715
+ M && it && e.branches().then(Ne);
716
+ }, []), l(() => {
717
+ !Z || Ge.people.length || Ge.labels.length || Promise.all([e.people().catch(() => []), e.labels().catch(() => [])]).then(([e, t]) => Ke({
718
+ people: e.filter((e) => e.assignable && e.id !== null),
719
+ labels: t
720
+ }));
721
+ }, [Z]), l(() => {
722
+ if (N !== "inbox") return;
723
+ let t = ++H.current;
724
+ e.inboxPage().then((e) => t === H.current && (fe({
725
+ state: "ready",
726
+ data: e.data
727
+ }), me(e.next_cursor)), () => t === H.current && fe({ state: "error" }));
728
+ }, [
729
+ N,
730
+ E,
731
+ Ce
732
+ ]);
733
+ let ct = () => {
734
+ if (!pe || z) return;
735
+ let t = H.current;
736
+ B(!0), e.inboxPage(pe).then((e) => {
737
+ t === H.current && (fe((t) => t.state === "ready" ? {
738
+ state: "ready",
739
+ data: [...t.data, ...e.data.filter((e) => !t.data.some((t) => t.id === e.id))]
740
+ } : t), me(e.next_cursor));
741
+ }, p).finally(() => B(!1));
742
+ }, lt = () => we((e) => e + 1), ut = Te(Je, i);
743
+ l(() => {
744
+ let e = (e) => !e.composedPath().some((e) => e instanceof HTMLElement && e.hasAttribute("data-commentkit-ui")), t = (t) => e(t) && i(), n = (t) => {
745
+ t.pointerType === "mouse" && e(t) && t.button === 0 && !_(xe) && (_(xe, "1"), h({
746
+ text: c("doubleClickHint"),
747
+ tone: "info"
748
+ }));
749
+ };
750
+ return addEventListener("dblclick", t, !0), addEventListener("pointerdown", n, !0), () => {
751
+ removeEventListener("dblclick", t, !0), removeEventListener("pointerdown", n, !0);
752
+ };
753
+ }, []);
754
+ let dt = (e) => e && I((t) => t.state === "ready" ? {
755
+ ...t,
756
+ data: t.data.map((t) => t.id === e.id ? e : t)
757
+ } : t), ft = async (t) => {
758
+ try {
759
+ dt(await e.updateThread(t.id, { status: "resolved" })), h({
760
+ text: c("resolvedToast", { ref: t.reference }),
761
+ tone: "success",
762
+ action: {
763
+ label: c("undo"),
764
+ run: () => void ee(e, t, h, p).then(dt)
765
+ }
766
+ });
767
+ } catch (e) {
768
+ p(e);
769
+ }
770
+ }, pt = async (e) => {
771
+ let t = T(e.page.url);
772
+ if (t) try {
773
+ await navigator.clipboard.writeText(j(t, e.id)), h({ text: c("copied") });
774
+ } catch {
775
+ p(Error(c("errorGeneric")));
776
+ }
777
+ }, mt = Q === "recent" ? C : [...C].sort((e, t) => Q === "oldest" ? e.created_at.localeCompare(t.created_at) : (ye[t.priority] ?? 0) - (ye[e.priority] ?? 0) || t.last_activity_at.localeCompare(e.last_activity_at)), $ = N === "page" && !$e ? {
778
+ state: "ready",
779
+ data: mt
780
+ } : oe, ht = $.state === "ready" ? $.data.length : null, gt = $ === oe ? L : null, _t = ht === null || N === "inbox" ? null : gt ? c("resultsMore", { n: ht }) : N === "page" && $e ? c("countOf", {
781
+ n: ht,
782
+ total: C.length
783
+ }) : et || N === "all" ? o("results", ht) : null, vt = [
784
+ [
785
+ "page",
786
+ "thisPage",
787
+ C.length
788
+ ],
789
+ [
790
+ "all",
791
+ "allPages",
792
+ null
793
+ ],
794
+ [
795
+ "inbox",
796
+ "notifications",
797
+ E || null
798
+ ]
799
+ ], yt = Y && $.state === "ready" ? $.data.filter((e) => Y.has(e.id)) : [], bt = (e) => {
800
+ e.stopPropagation(), e.key === "Escape" && U ? (e.preventDefault(), ge("")) : e.key === "Escape" && i(!0);
801
+ };
802
+ return /* @__PURE__ */ g(x, {
803
+ value: y(e, h, p, S),
804
+ children: /* @__PURE__ */ g("aside", {
805
+ class: "ck-panel",
806
+ ref: Je,
807
+ "data-side": n,
808
+ "data-dock": r,
809
+ "aria-label": c("inbox"),
810
+ "data-commentkit-ui": !0,
811
+ ...ut,
812
+ onKeyDown: (e) => {
813
+ if (!(e.key !== "Escape" || m)) {
814
+ if (Y) return void (e.stopPropagation(), Le());
815
+ i(!0);
816
+ }
817
+ },
818
+ children: [/* @__PURE__ */ g("div", {
819
+ class: "ck-grabber",
820
+ "aria-hidden": "true"
821
+ }), m ? /* @__PURE__ */ g("div", {
822
+ class: "ck-panel-detail",
823
+ children: m
824
+ }) : /* @__PURE__ */ g("div", {
825
+ class: "ck-panel-list",
826
+ "data-back": Ze || void 0,
827
+ children: [
828
+ /* @__PURE__ */ g("div", {
829
+ class: "ck-card-head",
830
+ children: [
831
+ /* @__PURE__ */ g("span", {
832
+ class: "ck-card-title",
833
+ children: c("inbox")
834
+ }),
835
+ J.length > 1 ? /* @__PURE__ */ g("span", {
836
+ class: "ck-here",
837
+ role: "status",
838
+ "aria-label": c("teamHere", { names: J.map((e) => e.name).join(", ") }),
839
+ title: J.map((e) => e.name).join(", "),
840
+ children: [/* @__PURE__ */ g("span", {
841
+ class: "ck-faces",
842
+ "aria-hidden": "true",
843
+ children: J.slice(0, 4).map((e) => /* @__PURE__ */ g(D, { person: e }))
844
+ }), J.length > 4 ? /* @__PURE__ */ g("span", {
845
+ class: "ck-faces-more",
846
+ children: ["+", J.length - 4]
847
+ }) : null]
848
+ }) : A > 1 ? /* @__PURE__ */ g("span", {
849
+ class: "ck-here",
850
+ role: "status",
851
+ children: [/* @__PURE__ */ g("span", {
852
+ "aria-hidden": "true",
853
+ class: "ck-dot"
854
+ }), o("peopleHere", A)]
855
+ }) : null,
856
+ Pe && N !== "inbox" && ht && !Y ? /* @__PURE__ */ g("button", {
857
+ class: "ck-chip ck-agent-chip",
858
+ "aria-label": c("sendToAgent"),
859
+ title: c("sendToAgent"),
860
+ onClick: () => $.state === "ready" && Fe(new Set($.data.map((e) => e.id))),
861
+ children: [/* @__PURE__ */ g(w, {
862
+ name: "agent",
863
+ size: 14
864
+ }), /* @__PURE__ */ g("span", { children: c("sendToAgent") })]
865
+ }) : null,
866
+ /* @__PURE__ */ g("button", {
867
+ class: "ck-ghost",
868
+ onClick: () => i(),
869
+ "aria-label": c("close"),
870
+ title: c("close"),
871
+ children: /* @__PURE__ */ g(w, { name: "close" })
872
+ })
873
+ ]
874
+ }),
875
+ /* @__PURE__ */ g("div", {
876
+ class: "ck-tabs",
877
+ role: "tablist",
878
+ ref: qe,
879
+ onKeyDown: (e) => k(e, "[role=tab]"),
880
+ children: vt.map(([e, t, n]) => /* @__PURE__ */ g("button", {
881
+ role: "tab",
882
+ id: `ck-tab-${e}`,
883
+ "aria-controls": "ck-tabpanel",
884
+ class: "ck-tab",
885
+ "aria-selected": N === e,
886
+ tabIndex: N === e ? 0 : -1,
887
+ onClick: () => F(e),
888
+ onFocus: () => F(e),
889
+ title: c(t),
890
+ children: [/* @__PURE__ */ g("span", {
891
+ class: "ck-tab-label",
892
+ children: c(t)
893
+ }), n ? /* @__PURE__ */ g("span", {
894
+ class: "ck-count",
895
+ children: [
896
+ /* @__PURE__ */ g("span", {
897
+ class: "ck-sr",
898
+ children: " ("
899
+ }),
900
+ Se(n),
901
+ /* @__PURE__ */ g("span", {
902
+ class: "ck-sr",
903
+ children: ")"
904
+ })
905
+ ]
906
+ }) : null]
907
+ }))
908
+ }),
909
+ ie ? He ? /* @__PURE__ */ g("div", {
910
+ class: "ck-note ck-pad-x ck-live-note",
911
+ role: "status",
912
+ children: [
913
+ c("livePaused"),
914
+ " ",
915
+ /* @__PURE__ */ g("button", {
916
+ class: "ck-btn",
917
+ onClick: () => e.reconnectRealtime(),
918
+ children: c("retry")
919
+ })
920
+ ]
921
+ }) : null : /* @__PURE__ */ g("div", {
922
+ class: "ck-note ck-pad-x",
923
+ "data-tone": "warning",
924
+ role: "status",
925
+ children: c("offline")
926
+ }),
927
+ re ? /* @__PURE__ */ g("div", {
928
+ class: "ck-note ck-pad-x",
929
+ role: "status",
930
+ children: c("readOnlyShort")
931
+ }) : null,
932
+ M && it && N !== "inbox" ? /* @__PURE__ */ g("div", {
933
+ class: "ck-branchbar",
934
+ role: "group",
935
+ "aria-label": c("branchFilter"),
936
+ children: [
937
+ /* @__PURE__ */ g("button", {
938
+ class: "ck-chip",
939
+ "aria-pressed": !O && !q,
940
+ onClick: () => (je(null), void e.setAllBranches(!1).catch(() => void 0)),
941
+ title: M,
942
+ children: c("thisBranch", { branch: ve(M) })
943
+ }),
944
+ /* @__PURE__ */ g("button", {
945
+ class: "ck-chip",
946
+ "aria-pressed": O && !q,
947
+ onClick: () => (je(null), void e.setAllBranches(!0).catch(() => void 0)),
948
+ children: c("allBranches")
949
+ }),
950
+ Me.some((e) => e.name !== M) ? /* @__PURE__ */ g(R, {
951
+ label: c("otherBranch"),
952
+ value: q ?? "",
953
+ onChange: (e) => je(e || null),
954
+ compact: !0,
955
+ options: [["", c("otherBranch")], ...Me.filter((e) => e.name !== M).map((e) => [e.name, `${ve(e.name)} (${e.open})`])]
956
+ }) : null
957
+ ]
958
+ }) : null,
959
+ N === "inbox" ? null : /* @__PURE__ */ g(s, { children: [
960
+ /* @__PURE__ */ g("div", {
961
+ class: "ck-filters",
962
+ children: [/* @__PURE__ */ g("div", {
963
+ class: "ck-search",
964
+ children: [
965
+ /* @__PURE__ */ g(w, {
966
+ name: "search",
967
+ size: 16
968
+ }),
969
+ /* @__PURE__ */ g("input", {
970
+ ref: We,
971
+ class: "ck-input",
972
+ type: "text",
973
+ role: "searchbox",
974
+ "aria-label": c("search"),
975
+ placeholder: c("search"),
976
+ value: U,
977
+ onInput: (e) => ge(e.target.value),
978
+ onKeyDown: bt
979
+ }),
980
+ U ? /* @__PURE__ */ g("button", {
981
+ class: "ck-ghost ck-ghost-sm",
982
+ "aria-label": c("clearSearch"),
983
+ title: c("clearSearch"),
984
+ onClick: () => (ge(""), We.current?.focus()),
985
+ children: /* @__PURE__ */ g(w, {
986
+ name: "close",
987
+ size: 14
988
+ })
989
+ }) : null
990
+ ]
991
+ }), /* @__PURE__ */ g(R, {
992
+ label: c("statusFilter"),
993
+ value: W,
994
+ onChange: be,
995
+ options: [
996
+ ["active", c("status_open")],
997
+ ["in_review", c("status_in_review")],
998
+ ["resolved,closed", c("status_resolved")],
999
+ ["all", c("allStatuses")]
1000
+ ]
1001
+ })]
1002
+ }),
1003
+ /* @__PURE__ */ g("div", {
1004
+ class: "ck-branchbar ck-quick-filters",
1005
+ children: [
1006
+ it ? /* @__PURE__ */ g("button", {
1007
+ class: "ck-chip",
1008
+ "aria-pressed": G.length === 1 && G[0] === "me",
1009
+ onClick: () => De(G.length === 1 && G[0] === "me" ? [] : ["me"]),
1010
+ children: c("assignedToMe")
1011
+ }) : null,
1012
+ S ? /* @__PURE__ */ g("button", {
1013
+ class: "ck-chip",
1014
+ "aria-pressed": K,
1015
+ onClick: () => Ae(!K),
1016
+ children: c("createdByMe")
1017
+ }) : null,
1018
+ it ? /* @__PURE__ */ g("button", {
1019
+ class: "ck-chip",
1020
+ "aria-expanded": Z,
1021
+ "aria-controls": Z ? "ck-more-filters" : void 0,
1022
+ onClick: () => ze(!Z),
1023
+ children: [c("filters"), nt ? /* @__PURE__ */ g(s, { children: [/* @__PURE__ */ g("span", {
1024
+ class: "ck-count",
1025
+ "aria-hidden": "true",
1026
+ children: nt
1027
+ }), /* @__PURE__ */ g("span", {
1028
+ class: "ck-sr",
1029
+ children: o("filtersOn", nt)
1030
+ })] }) : null]
1031
+ }) : null,
1032
+ et || Q !== "recent" ? /* @__PURE__ */ g("button", {
1033
+ class: "ck-chip ck-chip-quiet",
1034
+ onClick: tt,
1035
+ children: c("resetFilters")
1036
+ }) : null,
1037
+ /* @__PURE__ */ g("span", {
1038
+ class: "ck-muted ck-result-count",
1039
+ role: "status",
1040
+ children: _t ?? ""
1041
+ })
1042
+ ]
1043
+ }),
1044
+ Z && it ? /* @__PURE__ */ g("div", {
1045
+ class: "ck-filters",
1046
+ id: "ck-more-filters",
1047
+ children: [
1048
+ /* @__PURE__ */ g(R, {
1049
+ label: c("sortBy"),
1050
+ value: Q,
1051
+ onChange: (e) => Be(e),
1052
+ options: [
1053
+ ["recent", c("sortRecent")],
1054
+ ["oldest", c("sortOldest")],
1055
+ ["priority", c("sortPriority")]
1056
+ ]
1057
+ }),
1058
+ /* @__PURE__ */ g(R, {
1059
+ label: c("priority"),
1060
+ value: Oe,
1061
+ onChange: ke,
1062
+ options: [
1063
+ ["", c("anyPriority")],
1064
+ ["urgent,high", c("priorityImportant")],
1065
+ ...[
1066
+ "urgent",
1067
+ "high",
1068
+ "medium",
1069
+ "low"
1070
+ ].map((e) => [e, c(`priority_${e}`)])
1071
+ ]
1072
+ }),
1073
+ /* @__PURE__ */ g(se, {
1074
+ value: G,
1075
+ people: Ge.people,
1076
+ onChange: De
1077
+ }),
1078
+ /* @__PURE__ */ g(R, {
1079
+ label: c("labelFilter"),
1080
+ value: X === null ? "" : String(X),
1081
+ onChange: (e) => Re(e ? Number(e) : null),
1082
+ options: [["", c("anyLabel")], ...Ge.labels.map((e) => [String(e.id), e.name])]
1083
+ })
1084
+ ]
1085
+ }) : null
1086
+ ] }),
1087
+ /* @__PURE__ */ g("div", {
1088
+ class: "ck-card-body",
1089
+ id: "ck-tabpanel",
1090
+ role: "tabpanel",
1091
+ "aria-labelledby": `ck-tab-${N}`,
1092
+ "aria-busy": (N === "inbox" ? de : $).state === "loading",
1093
+ children: [N === "page" ? /* @__PURE__ */ g(he, {
1094
+ version: v,
1095
+ reveal: b
1096
+ }) : null, N === "inbox" ? /* @__PURE__ */ g(le, {
1097
+ load: de,
1098
+ onRetry: lt,
1099
+ art: "caughtUp",
1100
+ empty: /* @__PURE__ */ g("strong", { children: c("allCaughtUp") }),
1101
+ children: (t) => /* @__PURE__ */ g(ae, {
1102
+ items: t,
1103
+ onOpen: Qe,
1104
+ more: !!pe,
1105
+ loadingMore: z,
1106
+ onMore: ct,
1107
+ unread: E,
1108
+ onMarkAll: () => void e.markRead({ all: !0 }).catch(p)
1109
+ })
1110
+ }) : /* @__PURE__ */ g(le, {
1111
+ load: $,
1112
+ onRetry: lt,
1113
+ art: et ? "noMatch" : "noFeedback",
1114
+ empty: et ? /* @__PURE__ */ g(s, { children: [/* @__PURE__ */ g("strong", { children: c("noMatch") }), /* @__PURE__ */ g("button", {
1115
+ class: "ck-btn",
1116
+ onClick: tt,
1117
+ children: c("clearFilters")
1118
+ })] }) : /* @__PURE__ */ g(s, { children: [/* @__PURE__ */ g("strong", { children: c(N === "all" ? "nothingAnywhere" : "nothingHere") }), /* @__PURE__ */ g("span", {
1119
+ class: "ck-hint",
1120
+ children: c(matchMedia("(pointer: coarse)").matches ? "nothingHereHintTouch" : "nothingHereHint")
1121
+ })] }),
1122
+ children: (e) => /* @__PURE__ */ g(s, { children: [
1123
+ /* @__PURE__ */ g("ul", {
1124
+ class: "ck-list",
1125
+ onKeyDown: (e) => k(e, ".ck-item", !0),
1126
+ children: e.map((t) => /* @__PURE__ */ g(_e, {
1127
+ thread: t,
1128
+ tab: N === "all" ? "all" : "page",
1129
+ triager: it,
1130
+ picked: Y ? Y.has(t.id) : void 0,
1131
+ branch: M,
1132
+ allBranches: O,
1133
+ canResolve: !!S?.capabilities.comment && !re,
1134
+ onOpen: () => Qe(t, e.map((e) => e.id)),
1135
+ onToggle: () => Ie(t.id),
1136
+ onResolve: () => void ft(t),
1137
+ onCopyLink: () => void pt(t)
1138
+ }))
1139
+ }),
1140
+ N === "page" && te ? /* @__PURE__ */ g("p", {
1141
+ class: "ck-pad ck-hint",
1142
+ role: "note",
1143
+ children: c("firstPageThreads", { n: 500 })
1144
+ }) : null,
1145
+ gt ? /* @__PURE__ */ g("div", {
1146
+ class: "ck-pad",
1147
+ children: /* @__PURE__ */ g("button", {
1148
+ class: "ck-btn",
1149
+ "aria-disabled": z || void 0,
1150
+ "aria-busy": z,
1151
+ onClick: () => !z && st(),
1152
+ children: c("showMore")
1153
+ })
1154
+ }) : null
1155
+ ] })
1156
+ })]
1157
+ }),
1158
+ Y ? /* @__PURE__ */ g(ue, {
1159
+ threads: yt,
1160
+ onCancel: Le,
1161
+ onDone: (e) => (h({
1162
+ text: e,
1163
+ tone: "success"
1164
+ }), Le())
1165
+ }) : null
1166
+ ]
1167
+ })]
1168
+ })
1169
+ });
1170
+ }
1171
+ var xe = "commentkit:dblclick-hint", Se = (e) => e > 99 ? "99+" : String(e), Ce = .4, we = .11;
1172
+ function Te(e, t) {
1173
+ let n = f(null), r = (r, i) => {
1174
+ let a = n.current, o = e.current;
1175
+ if (!a || !o || r.pointerId !== a.id) return;
1176
+ n.current = null, o.hasPointerCapture?.(r.pointerId) && o.releasePointerCapture(r.pointerId);
1177
+ let [s, c] = a.samples.filter(([e]) => r.timeStamp - e <= 100)[0] ?? [r.timeStamp, a.dy], l = r.timeStamp > s ? (a.dy - c) / (r.timeStamp - s) : 0;
1178
+ if (!i && a.dy > 0 && (a.dy > Ce * o.offsetHeight || l > we)) return t();
1179
+ o.style.transition = "transform var(--ck-dur) var(--ck-ease)", o.style.transform = "";
1180
+ };
1181
+ return {
1182
+ onPointerDown(t) {
1183
+ let r = e.current, i = t.target;
1184
+ if (!r || t.button !== 0 || !i.closest?.(".ck-grabber, .ck-card-head") || i.closest("button, a, input, select, textarea, [role=tab]") || !matchMedia("(max-width: 520px)").matches || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
1185
+ let a = getComputedStyle(r).transform, o = a && a !== "none" && typeof DOMMatrix == "function" ? new DOMMatrix(a).m42 : 0;
1186
+ r.style.transition = "none", r.style.transform = o ? `translateY(${o}px)` : "", n.current = {
1187
+ id: t.pointerId,
1188
+ y0: t.clientY - o,
1189
+ dy: o,
1190
+ samples: [[t.timeStamp, o]]
1191
+ }, r.setPointerCapture?.(t.pointerId);
1192
+ },
1193
+ onPointerMove(t) {
1194
+ let r = n.current, i = e.current;
1195
+ if (!r || !i || t.pointerId !== r.id) return;
1196
+ let a = t.clientY - r.y0;
1197
+ r.dy = a >= 0 ? a : -Math.sqrt(-a), r.samples.push([t.timeStamp, r.dy]), r.samples.length > 12 && r.samples.shift(), i.style.transform = `translateY(${r.dy}px)`;
1198
+ },
1199
+ onPointerUp: (e) => r(e, !1),
1200
+ onPointerCancel: (e) => r(e, !0),
1201
+ onTransitionEnd(t) {
1202
+ let n = e.current;
1203
+ n && t.target === n && t.propertyName === "transform" && (n.style.transition = "");
1204
+ }
1205
+ };
1206
+ }
1207
+ function Ee(e, t, n, r) {
1208
+ let i = e.assignees ?? (e.assignee ? [e.assignee] : []);
1209
+ return n !== null && e.labels && !e.labels.some((e) => e.id === n) ? !1 : t.length ? t.includes("none") ? !i.length : t.some((e) => e === "me" ? i.some((e) => !!r && e.id === r.person.id && e.type === r.person.type) : i.some((t) => t.id === e)) : !0;
1210
+ }
1211
+ export { be as Panel };