@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,1160 @@
1
+ import { n as e } from "./src-C8rZFyL_.js";
2
+ import { b as t, v as n } from "./client-7eVxvg5j.js";
3
+ import { s as r } from "./anchor-BsQNVkHj.js";
4
+ import { _ as i, a, b as o, c as s, d as c, f as l, i as u, m as d, o as f, u as p, v as m } from "./i18n-aVSu9TcJ.js";
5
+ import { r as h } from "./agent-MTQHr9ei.js";
6
+ import { a as g, r as ee } from "./files-4lV9YQIX.js";
7
+ import { i as te, n as _, r as ne, t as re } from "./card-bits-CTdrkYn8.js";
8
+ import { n as ie } from "./drafts-B0ctr1g9.js";
9
+ import { a as v, c as y, f as ae, h as oe, i as b, l as se, m as ce, n as le, t as ue, u as de } from "./uploads-8AxyRq7g.js";
10
+ import { t as fe } from "./states-b9Bv3Ci7.js";
11
+ import { n as pe, r as x, t as me } from "./context-Cf6khm7A.js";
12
+ import { r as he, t as ge } from "./Checklist-CW_SwMpS.js";
13
+ import { TaskFields as _e } from "./TaskFields-C8BX0Sgg.js";
14
+ import { A as ve, C as S, D as ye, E as be, M as C, N as w, O as xe, _ as Se, b as Ce, f as we, g as Te, h as Ee, j as T, n as De, o as Oe, p as ke, s as E, v as Ae, x as D, y as je } from "./start-CV4j78_q.js";
15
+ // src/ui/Reactions.tsx
16
+ var O = g.slice(0, 6);
17
+ function k(e) {
18
+ if (!e) return;
19
+ ve(e), e.querySelector("button")?.focus({ preventScroll: !0 });
20
+ let t = e.closest(".ck-card-body")?.getBoundingClientRect();
21
+ t && e.getBoundingClientRect().top < t.top && (e.dataset.below = ""), e.scrollIntoView({ block: "nearest" });
22
+ }
23
+ function A({ reactions: e = [], canWrite: t, picker: n = !0, onReact: r }) {
24
+ let [o, c] = i(!1), l = d(null), u = () => {
25
+ c(!1), (l.current?.firstElementChild)?.focus();
26
+ };
27
+ return Ae(o, l, () => c(!1)), !e.length && !t ? null : /* @__PURE__ */ p("div", {
28
+ class: "ck-reactions",
29
+ children: [
30
+ e.map((e) => {
31
+ let t = `${a("reactionLabel", e.count, { emoji: e.emoji })}${e.mine ? `, ${s("youReacted")}` : ""}`;
32
+ return /* @__PURE__ */ p("button", {
33
+ class: "ck-reaction",
34
+ "aria-pressed": e.mine,
35
+ "aria-label": t,
36
+ title: t,
37
+ onClick: () => r(e.emoji),
38
+ children: [/* @__PURE__ */ p(D, { char: e.emoji }), /* @__PURE__ */ p("span", { children: e.count })]
39
+ });
40
+ }),
41
+ t && O.filter((t) => !e.some((e) => e.emoji === t)).slice(0, 3).map((e) => /* @__PURE__ */ p("button", {
42
+ class: "ck-reaction ck-reaction-add",
43
+ "aria-label": s("reactWith", { emoji: e }),
44
+ title: s("reactWith", { emoji: e }),
45
+ onClick: () => r(e),
46
+ children: /* @__PURE__ */ p(D, { char: e })
47
+ })),
48
+ t && n ? /* @__PURE__ */ p("span", {
49
+ class: "ck-picker-wrap",
50
+ ref: l,
51
+ children: [/* @__PURE__ */ p("button", {
52
+ class: "ck-reaction ck-reaction-more",
53
+ "aria-label": s("moreReactions"),
54
+ title: s("moreReactions"),
55
+ "aria-haspopup": "true",
56
+ "aria-expanded": o,
57
+ onClick: () => c(!o),
58
+ children: /* @__PURE__ */ p(S, {
59
+ name: "smile",
60
+ size: 14
61
+ })
62
+ }), o ? /* @__PURE__ */ p("div", {
63
+ class: "ck-picker ck-pop",
64
+ role: "group",
65
+ "aria-label": s("moreReactions"),
66
+ ref: k,
67
+ onKeyDown: (e) => {
68
+ e.key === "Escape" ? (e.stopPropagation(), u()) : Ee(e, "button", !1);
69
+ },
70
+ children: g.map((t) => /* @__PURE__ */ p("button", {
71
+ "aria-pressed": e.some((e) => e.emoji === t && e.mine),
72
+ "aria-label": s("reactWith", { emoji: t }),
73
+ onClick: () => (u(), r(t)),
74
+ children: /* @__PURE__ */ p(D, { char: t })
75
+ }))
76
+ }) : null]
77
+ }) : null
78
+ ]
79
+ });
80
+ }
81
+ // src/ui/ThreadMessage.tsx
82
+ function Me(e) {
83
+ let { client: t, message: n, first: r, mine: i, edit: a, canWrite: c, simple: l } = e, d = (e) => {
84
+ let t = e.currentTarget.getRootNode().getElementById(`ck-msg-${n.reply_to.id}`);
85
+ t?.scrollIntoView({
86
+ block: "center",
87
+ behavior: Ne() ? "auto" : "smooth"
88
+ }), t?.focus({ preventScroll: !0 });
89
+ }, m = i && !r, h = a ? null : /* @__PURE__ */ p("span", {
90
+ class: "ck-msg-actions",
91
+ children: [
92
+ l ? null : /* @__PURE__ */ p(o, { children: [c ? /* @__PURE__ */ p("button", {
93
+ class: "ck-ghost ck-ghost-sm",
94
+ "aria-label": s("replyTo", { name: n.author.name }),
95
+ title: s("quoteReply"),
96
+ onClick: e.onQuote,
97
+ children: /* @__PURE__ */ p(S, {
98
+ name: "reply",
99
+ size: 14
100
+ })
101
+ }) : null, /* @__PURE__ */ p("button", {
102
+ class: "ck-ghost ck-ghost-sm",
103
+ "aria-label": s("copyText"),
104
+ title: s("copyText"),
105
+ onClick: e.onCopy,
106
+ children: /* @__PURE__ */ p(S, {
107
+ name: "copy",
108
+ size: 14
109
+ })
110
+ })] }),
111
+ c && i ? /* @__PURE__ */ p("button", {
112
+ class: "ck-ghost ck-ghost-sm",
113
+ onClick: e.onEdit,
114
+ children: s("edit")
115
+ }) : null,
116
+ e.canDelete ? /* @__PURE__ */ p("button", {
117
+ class: "ck-ghost ck-ghost-sm ck-danger",
118
+ onClick: e.onDelete,
119
+ children: s("delete")
120
+ }) : null
121
+ ]
122
+ });
123
+ return /* @__PURE__ */ p("div", {
124
+ class: "ck-msg",
125
+ id: `ck-msg-${n.id}`,
126
+ tabIndex: -1,
127
+ "data-mine": i || void 0,
128
+ "data-reply": !r || void 0,
129
+ "data-new": e.fresh || void 0,
130
+ children: [/* @__PURE__ */ p(Ce, { person: n.author }), /* @__PURE__ */ p("div", {
131
+ class: "ck-msg-main",
132
+ children: [
133
+ /* @__PURE__ */ p("div", {
134
+ class: "ck-msg-meta",
135
+ children: [
136
+ m ? h : null,
137
+ /* @__PURE__ */ p("bdi", {
138
+ class: "ck-msg-name",
139
+ children: n.author.name
140
+ }),
141
+ /* @__PURE__ */ p("time", {
142
+ dateTime: n.created_at,
143
+ title: u(n.created_at),
144
+ children: f(n.created_at)
145
+ }),
146
+ n.edited_at ? /* @__PURE__ */ p("span", {
147
+ title: u(n.edited_at),
148
+ children: ["· ", s("edited")]
149
+ }) : null,
150
+ n.visibility === "team" ? /* @__PURE__ */ p("span", {
151
+ class: "ck-team-only",
152
+ children: s("teamOnly")
153
+ }) : null,
154
+ m ? null : h
155
+ ]
156
+ }),
157
+ n.reply_to ? /* @__PURE__ */ p("button", {
158
+ class: "ck-quote ck-quote-msg",
159
+ onClick: d,
160
+ children: [
161
+ /* @__PURE__ */ p("strong", { children: /* @__PURE__ */ p("bdi", { children: n.reply_to.author.name }) }),
162
+ " ",
163
+ /* @__PURE__ */ p("bdi", { children: n.reply_to.excerpt })
164
+ ]
165
+ }) : null,
166
+ a ? /* @__PURE__ */ p("div", {
167
+ class: "ck-msg-edit",
168
+ children: [/* @__PURE__ */ p("div", {
169
+ onKeyDown: (e) => {
170
+ e.key === "Escape" && (e.stopPropagation(), a.onCancel());
171
+ },
172
+ children: /* @__PURE__ */ p(se, {
173
+ client: t,
174
+ value: a.body,
175
+ onChange: a.onChange,
176
+ onMentions: () => void 0,
177
+ onSubmit: a.onSave,
178
+ placeholder: s("edit"),
179
+ autofocus: !0,
180
+ disabled: a.busy,
181
+ canMention: !0
182
+ })
183
+ }), /* @__PURE__ */ p("div", {
184
+ class: "ck-actions",
185
+ children: [/* @__PURE__ */ p("button", {
186
+ class: "ck-btn",
187
+ onClick: a.onCancel,
188
+ children: s("cancel")
189
+ }), /* @__PURE__ */ p("button", {
190
+ class: "ck-btn ck-primary",
191
+ "aria-disabled": a.busy || !a.body.trim() || void 0,
192
+ onClick: () => a.body.trim() && a.onSave(),
193
+ children: a.busy ? s("saving") : s("save")
194
+ })]
195
+ })]
196
+ }) : /* @__PURE__ */ p(o, { children: [/* @__PURE__ */ p("div", {
197
+ class: "ck-msg-body",
198
+ dir: "auto",
199
+ children: /* @__PURE__ */ p(be, {
200
+ text: n.body,
201
+ people: e.people
202
+ })
203
+ }), /* @__PURE__ */ p(M, {
204
+ client: t,
205
+ text: n.body,
206
+ onLoad: e.onImageLoad
207
+ })] }),
208
+ /* @__PURE__ */ p(Pe, {
209
+ files: n.attachments ?? [],
210
+ shot: r ? e.shot : null,
211
+ onView: e.onView,
212
+ onLoad: e.onImageLoad
213
+ }),
214
+ /* @__PURE__ */ p(A, {
215
+ reactions: n.reactions,
216
+ canWrite: c,
217
+ picker: !l,
218
+ onReact: e.onReact
219
+ }),
220
+ e.alone ? /* @__PURE__ */ p("p", {
221
+ class: "ck-muted ck-no-replies",
222
+ children: s("noReplies")
223
+ }) : null
224
+ ]
225
+ })]
226
+ });
227
+ }
228
+ function Ne() {
229
+ return matchMedia("(prefers-reduced-motion: reduce)").matches;
230
+ }
231
+ function j(e) {
232
+ return e.mime.startsWith("image/") && !!(C(e.url, "image") || C(e.thumbnail_url, "image"));
233
+ }
234
+ function Pe({ files: e, shot: t, onView: n, onLoad: r }) {
235
+ let i = e.filter((e) => e.kind !== "screenshot"), a = i.filter(j), c = [...t ? [{
236
+ src: t.src,
237
+ name: t.name,
238
+ href: t.href
239
+ }] : [], ...a.map((e) => ({
240
+ src: C(e.url, "image") ?? C(e.thumbnail_url, "image"),
241
+ name: e.name,
242
+ href: C(e.url)
243
+ }))], l = [...t ? [t.thumb] : [], ...a.map((e) => C(e.thumbnail_url, "image") ?? C(e.url, "image"))], u = i.filter((e) => !j(e));
244
+ return /* @__PURE__ */ p(o, { children: [l.length === 1 ? /* @__PURE__ */ p("button", {
245
+ class: "ck-shot",
246
+ "aria-label": s("openImage", { name: c[0].name }),
247
+ onClick: () => n(c, 0),
248
+ children: /* @__PURE__ */ p("img", {
249
+ src: l[0],
250
+ alt: c[0].name,
251
+ loading: "lazy",
252
+ onLoad: r
253
+ })
254
+ }) : l.length ? /* @__PURE__ */ p("div", {
255
+ class: "ck-grid",
256
+ "data-count": Math.min(l.length, 4),
257
+ children: l.slice(0, 4).map((e, t) => /* @__PURE__ */ p("button", {
258
+ class: "ck-grid-item",
259
+ "aria-label": t === 3 && l.length > 4 ? s("openImageMore", {
260
+ name: c[t].name,
261
+ n: l.length - 4
262
+ }) : s("openImage", { name: c[t].name }),
263
+ onClick: () => n(c, t),
264
+ children: [/* @__PURE__ */ p("img", {
265
+ src: e,
266
+ alt: c[t].name,
267
+ loading: "lazy",
268
+ onLoad: r
269
+ }), t === 3 && l.length > 4 ? /* @__PURE__ */ p("span", {
270
+ class: "ck-grid-more",
271
+ "aria-hidden": "true",
272
+ children: ["+", l.length - 4]
273
+ }) : null]
274
+ }))
275
+ }) : null, u.length ? /* @__PURE__ */ p("div", {
276
+ class: "ck-files",
277
+ children: u.map((e) => {
278
+ let t = C(e.url);
279
+ return t ? /* @__PURE__ */ p("a", {
280
+ class: "ck-file",
281
+ href: t,
282
+ target: "_blank",
283
+ rel: "noopener noreferrer",
284
+ children: /* @__PURE__ */ p("bdi", { children: e.name })
285
+ }) : /* @__PURE__ */ p("span", {
286
+ class: "ck-file",
287
+ children: /* @__PURE__ */ p("bdi", { children: e.name })
288
+ });
289
+ })
290
+ }) : null] });
291
+ }
292
+ function M({ client: e, text: t, onLoad: n }) {
293
+ let r = m(() => [...new Set([...t.matchAll(/https?:\/\/[^\s<>"')​-‏‪-‮⁠-⁩]+/g)].map((e) => C(e[0])).filter((e) => !!e))].slice(0, 2), [t]), [a, o] = i([]);
294
+ return c(() => {
295
+ let t = !0;
296
+ return o([]), r.length && Promise.all(r.map((t) => e.linkPreview(t))).then((e) => t && o(e.filter((e) => !!e))), () => {
297
+ t = !1;
298
+ };
299
+ }, [r.join(" ")]), c(() => void (a.length && n()), [a]), a.length ? /* @__PURE__ */ p("div", {
300
+ class: "ck-previews",
301
+ children: a.map((e) => {
302
+ let t = C(e.url);
303
+ return t ? /* @__PURE__ */ p("a", {
304
+ class: "ck-preview",
305
+ href: t,
306
+ target: "_blank",
307
+ rel: "noopener noreferrer nofollow ugc",
308
+ children: [
309
+ /* @__PURE__ */ p("span", {
310
+ class: "ck-preview-site",
311
+ children: /* @__PURE__ */ p("bdi", { children: e.site })
312
+ }),
313
+ /* @__PURE__ */ p("strong", {
314
+ title: e.title,
315
+ children: /* @__PURE__ */ p("bdi", { children: e.title })
316
+ }),
317
+ e.description ? /* @__PURE__ */ p("span", {
318
+ class: "ck-preview-text",
319
+ children: /* @__PURE__ */ p("bdi", { children: e.description })
320
+ }) : null
321
+ ]
322
+ }) : null;
323
+ })
324
+ }) : null;
325
+ }
326
+ var N = 24, Fe = 10, Ie = 4e3;
327
+ function Le(e, t, n) {
328
+ let [r, a] = i(""), o = d(n);
329
+ return o.current = n, c(() => {
330
+ if (!t) return;
331
+ let n = null, r = !1, i = null, c = -1e9, l, u = () => (clearTimeout(l), a("")), d = (t) => t.composedPath().some((t) => t === e.current || t instanceof Element && t.hasAttribute("data-commentkit-host")), f = (t) => {
332
+ if (n = null, d(t)) return void (i = null, u());
333
+ t.isPrimary && t.button === 0 && (n = t, r = !!(e.current?.getRootNode())?.querySelector?.(".ck-pop"));
334
+ }, p = (t) => {
335
+ let d = n;
336
+ if (n = null, !d || t.pointerId !== d.pointerId) return;
337
+ if (r) return void (i = null);
338
+ if (Math.hypot(t.clientX - d.clientX, t.clientY - d.clientY) > Fe) return;
339
+ let f = Date.now();
340
+ if (i && f - i.at <= 500 && Math.hypot(t.clientX - i.x, t.clientY - i.y) <= N) return i = null, u(), o.current();
341
+ i = {
342
+ x: t.clientX,
343
+ y: t.clientY,
344
+ at: f
345
+ }, P(e.current), !(f - c < 6e3) && (c = f, a(s(t.pointerType === "mouse" ? "closeCardHint" : "closeCardHintTouch")), clearTimeout(l), l = setTimeout(u, Ie));
346
+ }, m = () => n = null;
347
+ return addEventListener("pointerdown", f, !0), addEventListener("pointerup", p, !0), addEventListener("pointercancel", m, !0), addEventListener("keydown", u, !0), () => {
348
+ clearTimeout(l), removeEventListener("pointerdown", f, !0), removeEventListener("pointerup", p, !0), removeEventListener("pointercancel", m, !0), removeEventListener("keydown", u, !0);
349
+ };
350
+ }, [t]), t ? r : "";
351
+ }
352
+ function P(e) {
353
+ e && !Ne() && (e.removeAttribute("data-nudge"), e.offsetWidth, e.setAttribute("data-nudge", ""));
354
+ }
355
+ // src/ui/StyleChanges.tsx
356
+ function Re({ thread: e, element: t, editable: n, onChange: r }, a) {
357
+ let { reportError: o } = x(a), c = m(() => v(e.style_changes), [e.style_changes]), [u, f] = i(!1), [h, g] = i(!1), ee = Te(h, () => import("./StyleEditor-CZTdAA5c.js").then((e) => e.StyleEditor), o), te = d(null), _ = t instanceof HTMLElement || t instanceof SVGElement ? t : null;
358
+ return l(() => {
359
+ if (!u || !_) return;
360
+ let e = te.current = new b(_);
361
+ return e.apply(c), () => e.revert();
362
+ }, [
363
+ u,
364
+ _,
365
+ c
366
+ ]), h && _ && ee ? /* @__PURE__ */ p(ee, {
367
+ thread: e,
368
+ element: _,
369
+ onSaved: (e) => r?.(e),
370
+ onClose: () => g(!1)
371
+ }) : c.length ? /* @__PURE__ */ p("section", {
372
+ class: "ck-style-card",
373
+ "aria-label": s("styleSuggested"),
374
+ children: [/* @__PURE__ */ p("div", {
375
+ class: "ck-style-card-head",
376
+ children: [/* @__PURE__ */ p("span", { children: s("styleSuggested") }), _ ? /* @__PURE__ */ p("span", {
377
+ class: "ck-style-card-actions",
378
+ children: [n ? /* @__PURE__ */ p("button", {
379
+ class: "ck-ghost ck-ghost-sm",
380
+ "aria-label": s("styleEdit"),
381
+ onClick: () => {
382
+ te.current?.revert(), f(!1), g(!0);
383
+ },
384
+ children: s("edit")
385
+ }) : null, /* @__PURE__ */ p("button", {
386
+ class: "ck-chip",
387
+ "aria-pressed": u,
388
+ onClick: () => f(!u),
389
+ children: s("stylePreview")
390
+ })]
391
+ }) : null]
392
+ }), /* @__PURE__ */ p("ul", { children: c.map((e) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ p("code", { children: y(e) }) })) })]
393
+ }) : null;
394
+ }
395
+ // src/ui/ThreadContext.tsx
396
+ function ze({ thread: e, anchor: t, branch: n }) {
397
+ return /* @__PURE__ */ p(o, { children: [
398
+ t === "detached" ? /* @__PURE__ */ p("div", {
399
+ class: "ck-note",
400
+ "data-tone": "warning",
401
+ children: s("detached")
402
+ }) : null,
403
+ t === "moved" ? /* @__PURE__ */ p("p", {
404
+ class: "ck-muted",
405
+ children: s("moved")
406
+ }) : null,
407
+ T(e) ? /* @__PURE__ */ p("p", {
408
+ class: "ck-muted",
409
+ title: `${e.breakpoint}px`,
410
+ children: s(`screen_${w(e.breakpoint)}`)
411
+ }) : null,
412
+ e.page.branch && n ? /* @__PURE__ */ p("p", {
413
+ class: "ck-muted ck-build",
414
+ children: s("leftOnBranch", {
415
+ branch: e.page.branch,
416
+ commit: e.page.commit_sha ? ` @ ${e.page.commit_sha.slice(0, 7)}` : ""
417
+ })
418
+ }) : null,
419
+ e.anchor.quote ? /* @__PURE__ */ p("blockquote", {
420
+ class: "ck-quote",
421
+ "aria-label": s("quotedText"),
422
+ children: /* @__PURE__ */ p("bdi", { children: e.anchor.quote })
423
+ }) : null,
424
+ e.description?.trim() ? /* @__PURE__ */ p("details", {
425
+ class: "ck-description",
426
+ open: e.description.length <= 280,
427
+ children: [/* @__PURE__ */ p("summary", { children: s("description") }), /* @__PURE__ */ p("p", { children: /* @__PURE__ */ p("bdi", { children: e.description }) })]
428
+ }) : null
429
+ ] });
430
+ }
431
+ function Be({ thread: e }) {
432
+ let [t, n] = i(!1), r = C(e.page.url), a = e.capture?.device, o = e.capture?.viewport, c = [[s("detailCreated"), /* @__PURE__ */ p("time", {
433
+ dateTime: e.created_at,
434
+ children: u(e.created_at)
435
+ })]];
436
+ if (e.resolved_at && e.status === "resolved" && c.push([s("detailResolved"), /* @__PURE__ */ p("time", {
437
+ dateTime: e.resolved_at,
438
+ children: u(e.resolved_at)
439
+ })]), r && c.push([s("detailPage"), /* @__PURE__ */ p("a", {
440
+ href: r,
441
+ target: "_blank",
442
+ rel: "noopener noreferrer",
443
+ children: /* @__PURE__ */ p("bdi", { children: e.page.title || e.page.path })
444
+ })]), a?.browser || a?.os) {
445
+ let e = a.browser && `${a.browser}${a.browser_version ? ` ${a.browser_version.split(".")[0]}` : ""}`, t = a.os && `${a.os}${a.os_version ? ` ${a.os_version}` : ""}`;
446
+ c.push([s("detailBrowser"), /* @__PURE__ */ p("bdi", { children: [e, t].filter(Boolean).join(" · ") })]);
447
+ }
448
+ return o?.width && c.push([s("detailWindow"), /* @__PURE__ */ p("bdi", {
449
+ dir: "ltr",
450
+ children: `${o.width} × ${o.height}`
451
+ })]), /* @__PURE__ */ p("div", {
452
+ class: "ck-details",
453
+ children: [/* @__PURE__ */ p("button", {
454
+ class: "ck-details-toggle",
455
+ "aria-expanded": t,
456
+ "aria-controls": t ? "ck-details" : void 0,
457
+ onClick: () => n(!t),
458
+ children: s("details")
459
+ }), t ? /* @__PURE__ */ p("dl", {
460
+ id: "ck-details",
461
+ children: c.map(([e, t]) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("dt", { children: e }), /* @__PURE__ */ p("dd", { children: t })] }))
462
+ }) : null]
463
+ });
464
+ }
465
+ E(fe), E(".ck-msg-actions .ck-ghost{place-items:center;min-width:24px;display:inline-grid}.ck-msg-body .ck-pre code{box-shadow:none;font-size:var(--ck-fs-sm);background:0 0;padding:0;line-height:1.55}.ck-reaction .ck-emoji{vertical-align:-2px;width:14px;height:14px}.ck-msg-skeleton .ck-skeleton:not(.ck-skeleton-avatar){margin:4px 0 12px}.ck-msg-skeleton .ck-skeleton:first-child{width:34%}.ck-msg-skeleton .ck-skeleton:nth-child(2){width:92%}.ck-msg-skeleton .ck-skeleton:nth-child(3){width:64%}.ck-thread-head{position:relative}.ck-thread-head .ck-card-title:focus-visible{outline:none}.ck-thread-head .ck-menu{right:auto}.ck-thread-head .ck-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:8px}.ck-thread-head .ck-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:8px}.ck-thread-head .ck-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:8px}.ck-thread-head .ck-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:8px}.ck-more{display:contents}.ck-thread-head .ck-ghost[aria-expanded=true]{background:var(--ck-bg-hover);color:var(--ck-text)}.ck-card-hint{z-index:3;border-radius:var(--ck-radius-md);background:var(--ck-text);width:max-content;max-width:calc(100% - 32px);color:var(--ck-bg);font-size:var(--ck-fs-sm);text-align:center;pointer-events:none;font-weight:500;line-height:1.4;position:absolute;top:56px;left:50%;translate:-50%}.ck-card-hint:not(:empty){box-shadow:var(--ck-shadow);animation:ck-pop var(--ck-dur) var(--ck-ease);border:1px solid #0000;padding:5px 11px}.ck-card[data-nudge]{animation:ck-nudge .3s var(--ck-ease)}@keyframes ck-nudge{20%{translate:-6px}45%{translate:5px}70%{translate:-3px}90%{translate:1px}}@media (prefers-reduced-motion:reduce){.ck-card[data-nudge],.ck-card-hint{animation:none}}.ck-reply-foot{flex-direction:column;align-items:stretch;position:relative}.ck-reply-foot .ck-actions,.ck-reply-foot .ck-note{margin-top:0}.ck-card-body>.ck-note:first-child{margin:0 0 8px}.ck-card-embedded{width:auto;height:100%;max-height:none;box-shadow:none;animation:ck-slide-in var(--ck-dur) var(--ck-ease);border:0;border-radius:0;flex-direction:column;display:flex;position:static;top:auto;bottom:auto;left:auto;right:auto}.ck-card-embedded .ck-card-body{flex:1;min-height:0}.ck-back svg{scale:-1 1}.ck-root[dir=rtl] .ck-back svg{scale:1}.ck-step svg{rotate:-90deg}.ck-step[data-dir=next] svg{rotate:90deg}.ck-card-pos{font-size:var(--ck-fs-sm);font-variant-numeric:tabular-nums;white-space:nowrap}.ck-thread-head .ck-card-title{min-width:4.5em}.ck-thread-head .ck-status{text-overflow:ellipsis;min-width:0;display:block;overflow:hidden}.ck-thread-head .ck-status:before{vertical-align:1px;margin-inline-end:6px;display:inline-block}@media (max-width:520px){.ck-thread-head .ck-card-pos{display:none}}@keyframes ck-slide-in{0%{opacity:0;translate:24px}}.ck-root[dir=rtl] .ck-card-embedded{animation-name:ck-slide-in-rtl}@keyframes ck-slide-in-rtl{0%{opacity:0;translate:-24px}}.ck-thread-skeleton{gap:12px;display:grid}.ck-skeleton-meta{width:40%;height:10px}.ck-msg-skeleton{gap:8px;display:flex}.ck-msg-skeleton>div{flex:1}.ck-msg-skeleton .ck-skeleton.ck-skeleton-avatar{border-radius:50%;flex:none;width:28px;height:28px;margin:0;display:block}.ck-thread-skeleton .ck-msg-skeleton:nth-child(3){opacity:.7}.ck-thread-skeleton .ck-msg-skeleton:nth-child(4){opacity:.45}.ck-build{overflow-wrap:anywhere}.ck-description{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);font-size:var(--ck-fs-md);margin:0 0 8px;padding:8px 12px}.ck-description summary{cursor:pointer;color:var(--ck-text-muted);font-size:var(--ck-fs-sm);border-radius:var(--ck-radius-sm);font-weight:600}.ck-description p{white-space:pre-wrap;overflow-wrap:anywhere;text-wrap:pretty;max-height:240px;margin:4px 0 0;overflow:auto}.ck-details{font-size:var(--ck-fs-sm);margin:0 0 8px}.ck-details-toggle{min-height:24px;color:var(--ck-text-muted);font-size:var(--ck-fs-sm);border-radius:var(--ck-radius-sm);transition:color var(--ck-fast);background:0 0;border:0;align-items:center;gap:8px;margin-inline-start:-4px;padding:0 4px;font-weight:600;display:inline-flex}.ck-details-toggle:after{content:\"\";width:5px;height:5px;transition:transform var(--ck-dur) var(--ck-ease);border-bottom:1.5px solid;border-right:1.5px solid;transform:rotate(45deg)translateY(-2px)}.ck-details-toggle[aria-expanded=true]:after{transform:rotate(225deg)translate(-1px,-1px)}.ck-details dl{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);grid-template-columns:max-content minmax(0,1fr);gap:4px 12px;margin:4px 0 0;padding:8px 12px;display:grid}.ck-details dl>div{display:contents}.ck-details dt{color:var(--ck-text-muted)}.ck-details dd{overflow-wrap:anywhere;font-variant-numeric:tabular-nums;min-width:0;margin:0}.ck-details a{color:inherit;text-underline-offset:2px}.ck-review-ask{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);background:color-mix(in srgb, var(--ck-review) 14%, var(--ck-bg));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--ck-review) 30%, transparent);text-wrap:pretty;margin-bottom:12px;padding:12px}.ck-review-ask .ck-actions{margin-top:8px}.ck-extra{gap:8px;margin:0 0 12px;display:grid}.ck-extra>.ck-extra-add{gap:8px;margin:0;display:flex}.ck-extra>.ck-extra-add .ck-ghost{padding:4px 8px}.ck-checklist{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);padding:8px 12px}.ck-checklist-head{font-size:var(--ck-fs-sm);font-variant-numeric:tabular-nums;align-items:center;gap:8px;display:flex}.ck-checklist-bar{border-radius:var(--ck-radius-pill);background:var(--ck-border);flex:1;height:4px;overflow:hidden}.ck-checklist-bar>span{background:var(--ck-success);transform-origin:0;height:100%;transition:scale var(--ck-dur) var(--ck-ease);display:block}.ck-root[dir=rtl] .ck-checklist-bar>span{transform-origin:100%}.ck-checklist ul{gap:4px;margin:8px 0 0;padding:0;list-style:none;display:grid}.ck-checklist li{align-items:flex-start;gap:4px;display:flex}.ck-checklist li .ck-check{min-width:0;font-size:var(--ck-fs-md);overflow-wrap:anywhere;flex:1;margin:0;padding:2px 0}.ck-checklist li .ck-check:has(input:disabled){cursor:default}.ck-checklist li[data-done] bdi{color:var(--ck-text-muted);text-decoration:line-through}.ck-checklist li .ck-ghost{opacity:0;width:24px;min-width:0;height:24px;min-height:0;transition:opacity var(--ck-fast), background-color var(--ck-fast), color var(--ck-fast);flex:none;place-items:center;padding:0;display:grid}.ck-checklist li:hover .ck-ghost,.ck-checklist li:focus-within .ck-ghost{opacity:1}.ck-checklist-add{align-items:center;gap:4px;display:flex}.ck-checklist-add .ck-input{min-width:0;height:32px;font-size:var(--ck-fs-md);flex:1}.ck-checklist-add .ck-ghost{flex:none;justify-content:center;width:32px;height:32px;padding:0}.ck-msg{gap:8px;padding:4px 0;display:flex}.ck-msg+.ck-msg{border-top:1px solid var(--ck-hairline);padding-top:12px}.ck-msg+.ck-msg[data-reply]{border-top:0;padding-top:8px}.ck-msg-main{flex:1;min-width:0}.ck-msg-meta{font-size:var(--ck-fs-sm);color:var(--ck-text-muted);flex-wrap:wrap;align-items:baseline;gap:4px 8px;display:flex}.ck-msg-meta .ck-msg-name{overflow-wrap:anywhere;min-width:0}.ck-msg-meta time{cursor:default;font-variant-numeric:tabular-nums}.ck-team-only{border-radius:var(--ck-radius-pill);background:color-mix(in srgb, var(--ck-accent) 12%, transparent);color:var(--ck-text);font-size:var(--ck-fs-2xs);padding:0 6px;font-weight:600}.ck-msg-actions{opacity:0;transition:opacity var(--ck-fast);gap:4px;margin-inline-start:auto;display:inline-flex}.ck-msg:hover .ck-msg-actions,.ck-msg:focus-within .ck-msg-actions{opacity:1}.ck-msg-body{white-space:pre-wrap;overflow-wrap:anywhere;text-wrap:pretty;margin-top:2px;line-height:1.5}.ck-msg-body a{color:var(--ck-accent-text);text-underline-offset:2px}.ck-msg-body code{font-family:var(--ck-mono);font-size:var(--ck-fs-sm);border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);box-shadow:0 0 0 1px var(--ck-hairline);padding:0 4px}.ck-msg-body s{color:var(--ck-text-muted)}.ck-msg[data-reply] .ck-msg-body{border-radius:var(--ck-radius);background:var(--ck-bg-muted);max-width:100%;padding:4px 12px;display:inline-block}.ck-msg[data-reply] .ck-msg-body: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))){border-top-left-radius:var(--ck-radius-sm)}.ck-msg[data-reply] .ck-msg-body: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))){border-top-left-radius:var(--ck-radius-sm)}.ck-msg[data-reply] .ck-msg-body:-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)){border-top-right-radius:var(--ck-radius-sm)}.ck-msg[data-reply] .ck-msg-body: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)){border-top-right-radius:var(--ck-radius-sm)}.ck-msg[data-reply] .ck-msg-body code{background:var(--ck-bg)}.ck-msg[data-reply][data-mine]{flex-direction:row-reverse}.ck-msg[data-reply][data-mine] .ck-msg-main{flex-direction:column;align-items:flex-end;display:flex}.ck-msg[data-reply][data-mine] .ck-msg-meta{justify-content:flex-end}.ck-msg[data-reply][data-mine] .ck-msg-actions{margin-inline-start:0;margin-inline-end:auto}.ck-msg[data-mine] .ck-msg-edit .ck-actions{justify-content:flex-end}.ck-msg[data-reply][data-mine] .ck-msg-body{background:var(--ck-accent-soft)}.ck-msg[data-reply][data-mine] .ck-msg-body: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))){border-top-left-radius:var(--ck-radius);border-top-right-radius:var(--ck-radius-sm)}.ck-msg[data-reply][data-mine] .ck-msg-body: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))){border-top-left-radius:var(--ck-radius);border-top-right-radius:var(--ck-radius-sm)}.ck-msg[data-reply][data-mine] .ck-msg-body:-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)){border-top-right-radius:var(--ck-radius);border-top-left-radius:var(--ck-radius-sm)}.ck-msg[data-reply][data-mine] .ck-msg-body: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)){border-top-right-radius:var(--ck-radius);border-top-left-radius:var(--ck-radius-sm)}.ck-msg[data-reply][data-mine] .ck-reactions{justify-content:flex-end}.ck-msg[data-reply][data-mine] .ck-msg-body .ck-pre{text-align:start}.ck-msg[data-new]{animation:ck-reply-in var(--ck-dur) var(--ck-ease)}@keyframes ck-reply-in{0%{opacity:0;translate:0 8px}}.ck-msg-edit{width:100%}.ck-quote-msg{border-top:0;border-bottom:0;text-align:start;text-overflow:ellipsis;white-space:nowrap;width:100%;transition:color var(--ck-fast);border-inline-end:0;margin:4px 0 8px;overflow:hidden}.ck-quote-msg strong,.ck-quoting strong{color:var(--ck-text);font-weight:600}.ck-no-replies{font-size:var(--ck-fs-sm);text-wrap:pretty;margin:8px 0 0}.ck-card-body>p.ck-muted{text-wrap:pretty}.ck-msg:focus-visible{outline-offset:2px;border-radius:var(--ck-radius-sm)}.ck-card-body>.ck-task{padding:0 0 12px}.ck-card .ck-btn[aria-disabled=true]{opacity:.5;cursor:default}button.ck-shot{cursor:zoom-in;text-align:start;background:0 0;border:0;width:100%;padding:0;display:block}button.ck-shot:focus-visible{outline-offset:2px}.ck-grid{border-radius:var(--ck-radius-md);grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin-top:8px;display:grid;overflow:hidden}.ck-grid[data-count=\"3\"] .ck-grid-item:first-child{aspect-ratio:auto;grid-row:span 2}.ck-grid-item{aspect-ratio:4/3;background:var(--ck-bg-muted);cursor:zoom-in;border:0;padding:0;position:relative;overflow:hidden}.ck-grid-item:focus-visible{outline-offset:-2px;z-index:1}.ck-grid-item img{object-fit:cover;outline:1px solid var(--ck-img-outline);outline-offset:-1px;width:100%;height:100%;transition:scale var(--ck-dur) var(--ck-ease);display:block}.ck-grid-more{color:#fff;font-size:var(--ck-fs-xl);font-variant-numeric:tabular-nums;background:#1213168c;place-items:center;font-weight:700;display:grid;position:absolute;top:0;bottom:0;left:0;right:0}.ck-msg .ck-file{color:var(--ck-text);overflow-wrap:anywhere;transition:background-color var(--ck-fast);text-decoration:none}.ck-previews{gap:8px;margin-top:8px;display:grid}.ck-preview{padding:8px 12px;border-inline-start:3px solid var(--ck-border);border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);color:var(--ck-text);font-size:var(--ck-fs-sm);transition:background-color var(--ck-fast);gap:4px;padding-inline-start:9px;text-decoration:none;display:grid}.ck-preview>*{min-width:0}.ck-preview strong{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.ck-preview-site{color:var(--ck-text-muted);font-size:var(--ck-fs-xs);overflow-wrap:anywhere}.ck-preview-text{color:var(--ck-text-muted);-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ck-reactions{flex-wrap:wrap;gap:4px;margin-top:8px;display:flex}.ck-reaction{border-radius:var(--ck-radius-pill);border:1px solid var(--ck-control);background:var(--ck-bg);min-width:32px;height:24px;color:var(--ck-text);font-size:var(--ck-fs-sm);font-variant-numeric:tabular-nums;transition:background-color var(--ck-fast), border-color var(--ck-fast), color var(--ck-fast), scale var(--ck-fast) ease-out;justify-content:center;align-items:center;gap:4px;padding:0 8px;display:inline-flex}.ck-reaction:active{scale:.96}.ck-reaction[aria-pressed=true]{border-color:var(--ck-accent-text);background:var(--ck-accent-soft)}.ck-reaction .ck-emoji{margin:0}.ck-reaction-add{opacity:.55;transition:opacity var(--ck-fast), background-color var(--ck-fast)}.ck-reaction-add:focus-visible{opacity:1}.ck-picker-wrap{display:inline-flex;position:relative}.ck-reaction-more{color:var(--ck-text-muted);padding:0}.ck-picker{z-index:4;bottom:calc(100% + 8px);background:var(--ck-bg);border-radius:var(--ck-radius-md);box-shadow:var(--ck-shadow);animation:ck-pop var(--ck-fast) var(--ck-ease);border:1px solid #0000;grid-template-columns:repeat(8,32px);gap:4px;padding:4px;display:grid;position:absolute}.ck-picker: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-picker: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-picker:-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-picker: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-picker[data-below]{top:calc(100% + 8px);bottom:auto}.ck-picker button{border-radius:var(--ck-radius-sm);width:32px;height:32px;font-size:var(--ck-fs-lg);transition:background-color var(--ck-fast), scale var(--ck-fast) ease-out;background:0 0;border:0;place-items:center;padding:0;display:grid}.ck-picker button[aria-pressed=true]{background:var(--ck-accent-soft)}.ck-picker button:active{scale:.96}.ck-picker .ck-emoji{width:20px;height:20px;margin:0}@media (max-width:520px){.ck-picker{grid-template-columns:repeat(6,36px)}.ck-picker button{width:36px;height:36px}}.ck-quoting{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);border-inline-start:3px solid var(--ck-accent-text);font-size:var(--ck-fs-sm);color:var(--ck-text-muted);align-items:center;gap:8px;margin-bottom:8px;padding:4px;padding-inline-start:5px;display:flex}.ck-quoting>svg{flex:none}.ck-quoting>span{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.ck-quoting .ck-ghost{flex:none;place-items:center;min-width:24px;padding:0;display:grid}.ck-jump{box-shadow:var(--ck-shadow-sm);animation:ck-pop var(--ck-fast) var(--ck-ease);z-index:1;position:absolute;bottom:calc(100% + 8px);left:50%;translate:-50%}.ck-mention-card{z-index:5;background:var(--ck-bg);border-radius:var(--ck-radius-md);max-width:240px;box-shadow:var(--ck-shadow);pointer-events:none;animation:ck-fade var(--ck-fast) ease-out;font-size:var(--ck-fs-md);border:1px solid #0000;align-items:center;gap:8px;padding:4px;padding-inline-end:12px;display:flex;position:fixed}.ck-mention-card .ck-avatar{--ck-av:24px}.ck-mention-card .ck-msg-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}@media (hover:hover){.ck-reaction:hover{background:var(--ck-bg-muted)}.ck-reaction-add:hover{opacity:1}.ck-reaction-more:hover{color:var(--ck-text)}.ck-picker button:hover{background:var(--ck-bg-hover)}.ck-quote-msg:hover,.ck-details-toggle:hover{color:var(--ck-text)}.ck-grid-item:hover img,button.ck-shot:hover img{scale:1.02}.ck-preview:hover,.ck-msg a.ck-file:hover{background:var(--ck-bg-hover)}}@media (forced-colors:active){.ck-reaction[aria-pressed=true],.ck-picker button[aria-pressed=true]{color:highlighttext;background:highlight}}@media (hover:none){.ck-msg-actions,.ck-checklist li .ck-ghost{opacity:1}}@media (pointer:coarse){.ck-reaction,.ck-msg-actions .ck-ghost,.ck-quoting .ck-ghost,.ck-checklist li .ck-ghost,.ck-details-toggle,.ck-extra>.ck-extra-add .ck-ghost{min-width:44px;min-height:44px}.ck-checklist li{align-items:center}.ck-checklist-add .ck-input{height:44px;font-size:var(--ck-fs-lg)}.ck-picker{grid-template-columns:repeat(6,44px)}.ck-picker button{width:44px;height:44px}}");
466
+ function Ve(e, t) {
467
+ return !!t && e.id !== null && e.id === t.person.id && e.type === t.person.type;
468
+ }
469
+ function He(e, t) {
470
+ let n = /* @__PURE__ */ new Set(), r = [...new Set(t)].filter(Boolean).sort((e, t) => t.length - e.length);
471
+ if (!r.length) return n;
472
+ let i = r.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")), a = RegExp(`(?:^|[\\s(\\[])@(${i.join("|")})(?![\\p{L}\\p{N}_-])`, "gu");
473
+ for (let t of e.matchAll(a)) n.add(t[1]);
474
+ return n;
475
+ }
476
+ var Ue = /* @__PURE__ */ new Map();
477
+ function F({ client: a, threadId: u, version: f = 0, onClose: g, onError: v, notify: y, embedded: b, onMovePin: fe }) {
478
+ let x = je(a.state, (e) => e.session), ve = je(a.state, (e) => e.config?.read_only ?? !1), be = je(a.state, (e) => e.config?.limits?.upload_types), w = Se(), T = d(null), E = je(a.state, (e) => e.threads.find((e) => e.id === u) ?? null), [D, O] = i(E), [k, A] = i([]), [j, Pe] = i(null), M = ie(a.options.project, "reply", u), [N, Fe] = i(() => ce(M)), Ie = (e) => {
479
+ e !== N && (L.current = null), Fe(e), oe(M, e);
480
+ }, P = le(a, (e) => v(new n(0, "file_rejected", e))), [F, Ge] = i(null), Ke = Te(F, () => e(() => import("./Viewer-DY6zb90M.js")).then((e) => e.Viewer), v), qe = (e, t) => Ge({
481
+ images: e,
482
+ start: t
483
+ }), Je = d(null), [Ye, Xe] = i([]), [I, Ze] = i(!1), [Qe, $e] = i(!1), L = d(null), [R, et] = i(!1), tt = d(null), nt = d(null);
484
+ l(() => {
485
+ R && nt.current?.querySelector("[role=menuitem]")?.focus();
486
+ }, [R]);
487
+ let rt = () => {
488
+ et(!1), tt.current?.focus();
489
+ }, it = d(null);
490
+ Ae(R, it, () => et(!1));
491
+ let at = d(null), ot = Le(at, !b, g), [z, B] = i(null), [V, st] = i(null), [ct, lt] = i(!1), ut = d(0), [H, dt] = i([]), ft = m(() => H.map((e) => e.name), [H]), [U, W] = i(null), pt = d(/* @__PURE__ */ new Set()), [mt, ht] = i(!1), [gt, _t] = i(!0), vt = d(null), yt = (e = !1) => vt.current?.scrollTo({
492
+ top: vt.current.scrollHeight,
493
+ behavior: e && !Ne() ? "smooth" : "auto"
494
+ });
495
+ c(() => {
496
+ ct || yt();
497
+ }, [k.length]);
498
+ let bt = () => !ct && yt();
499
+ c(() => {
500
+ x && de(a).then(dt);
501
+ }, [x?.person.id]);
502
+ let G = d(u);
503
+ G.current = u;
504
+ let K = d(null), xt = (e) => {
505
+ K.current?.(), K.current = null;
506
+ let t = () => {
507
+ G.current === e && a.state.get().unread > 0 && a.markRead({ threadId: e }).catch(() => void 0);
508
+ };
509
+ if (a.inboxLoaded || a.state.get().unread > 0) return t();
510
+ let n = a.state.subscribe(() => {
511
+ a.inboxLoaded && (n(), K.current = null, t());
512
+ });
513
+ K.current = n;
514
+ };
515
+ c(() => () => K.current?.(), []);
516
+ let q = async (e = !1) => {
517
+ let t = u;
518
+ try {
519
+ let [n, r] = await Promise.all([a.getThread(t), a.allMessages(t, { refresh: e })]);
520
+ if (G.current !== t) return;
521
+ O(n), pt.current.size || r.forEach((e) => pt.current.add(e.id)), A(r), !Ue.has(t) && typeof n.watching == "boolean" && _t(n.watching), xt(t);
522
+ } catch (e) {
523
+ if (G.current !== t) return;
524
+ let r = e instanceof n && (e.status === 404 || e.status === 403);
525
+ if (E && !r) {
526
+ v(e);
527
+ return;
528
+ }
529
+ if (E) {
530
+ v(new n(404, "thread_not_found", s("threadNotFound"))), g();
531
+ return;
532
+ }
533
+ Pe({
534
+ gone: r,
535
+ text: r ? s("threadNotFound") : we(e)
536
+ });
537
+ }
538
+ };
539
+ l(() => {
540
+ O(E), A([]), Fe(ce(M)), P.clear(), st(null), lt(!1), W(null), pt.current = /* @__PURE__ */ new Set(), ht(!1), $e(!1), L.current = null, _t(Ue.get(u) ?? E?.watching ?? !0), q();
541
+ }, [u]), c(() => {
542
+ E && D && E.updated_at !== D.updated_at && q(!0);
543
+ }, [E?.updated_at]);
544
+ let St = d(f);
545
+ c(() => {
546
+ f !== St.current && (St.current = f, q(!0));
547
+ }, [f]);
548
+ let J = m(() => D ? r(D.anchor) : null, [D]);
549
+ c(() => {
550
+ !b && J?.element && J.state !== "detached" && J.element.scrollIntoView({
551
+ block: "center",
552
+ behavior: Ne() ? "auto" : "smooth"
553
+ });
554
+ }, [J?.element]), c(() => {
555
+ D && T.current?.focus({ preventScroll: !0 });
556
+ }, [D?.id]);
557
+ let Y = () => De(a);
558
+ if (l(() => {
559
+ let e = (e) => {
560
+ if (b && (e.key === "j" || e.key === "k") && !e.metaKey && !e.ctrlKey && !e.altKey && Y() && ke(e)) {
561
+ let t = e.key === "j" ? b.onNext : b.onPrev;
562
+ t && (e.preventDefault(), t());
563
+ } else e.key !== "e" && e.key !== "E" || e.metaKey || e.ctrlKey || e.altKey || !D || !Y() || ke(e) && x?.capabilities.comment && !ve && D.status !== "resolved" && (e.preventDefault(), $("resolved"));
564
+ };
565
+ return addEventListener("keydown", e), () => removeEventListener("keydown", e);
566
+ }), !D) return /* @__PURE__ */ p("div", {
567
+ class: b ? "ck-card ck-card-embedded" : "ck-card",
568
+ style: b ? void 0 : ne({
569
+ x: innerWidth - 400,
570
+ y: 80
571
+ }),
572
+ role: "region",
573
+ "aria-label": s("loadingThread"),
574
+ "aria-busy": !j,
575
+ "data-commentkit-ui": !0,
576
+ ref: at,
577
+ children: [/* @__PURE__ */ p("div", {
578
+ class: "ck-card-head",
579
+ children: [
580
+ b ? /* @__PURE__ */ p("button", {
581
+ class: "ck-ghost ck-back",
582
+ "aria-label": s("backToList"),
583
+ title: s("backToList"),
584
+ onClick: b.onBack,
585
+ children: /* @__PURE__ */ p(S, {
586
+ name: "chevron",
587
+ size: 16
588
+ })
589
+ }) : null,
590
+ /* @__PURE__ */ p("span", {
591
+ class: "ck-card-title",
592
+ children: j ? "" : s("loadingThread")
593
+ }),
594
+ /* @__PURE__ */ p("button", {
595
+ class: "ck-ghost",
596
+ "aria-label": s("close"),
597
+ title: s("close"),
598
+ onClick: b ? b.onBack : g,
599
+ children: /* @__PURE__ */ p(S, { name: "close" })
600
+ })
601
+ ]
602
+ }), j ? /* @__PURE__ */ p("div", {
603
+ class: "ck-card-body ck-empty",
604
+ role: "alert",
605
+ children: [
606
+ /* @__PURE__ */ p(he, { name: j.gone ? "gone" : "error" }),
607
+ /* @__PURE__ */ p("span", { children: j.text }),
608
+ /* @__PURE__ */ p("button", {
609
+ class: "ck-btn",
610
+ onClick: j.gone ? g : () => {
611
+ Pe(null), q();
612
+ },
613
+ children: s(j.gone ? "close" : "retry")
614
+ })
615
+ ]
616
+ }) : /* @__PURE__ */ p("div", {
617
+ class: "ck-card-body ck-thread-skeleton",
618
+ children: [/* @__PURE__ */ p("div", { class: "ck-skeleton ck-skeleton-meta" }), [
619
+ 0,
620
+ 1,
621
+ 2
622
+ ].map(() => /* @__PURE__ */ p("div", {
623
+ class: "ck-msg-skeleton",
624
+ children: [/* @__PURE__ */ p("span", { class: "ck-skeleton ck-skeleton-avatar" }), /* @__PURE__ */ p("div", { children: [
625
+ /* @__PURE__ */ p("div", { class: "ck-skeleton" }),
626
+ /* @__PURE__ */ p("div", { class: "ck-skeleton" }),
627
+ /* @__PURE__ */ p("div", { class: "ck-skeleton" })
628
+ ] })]
629
+ }))]
630
+ })]
631
+ });
632
+ let X = x?.capabilities, Z = !!X?.triage, Q = !!X?.comment && !ve, Ct = a.options.tools?.attachments !== !1, wt = x && D.author.id === x.person.id && D.author.type === (x.person.type === "guest" ? "guest" : "user"), Tt = J ? {
633
+ x: J.point.x - scrollX,
634
+ y: J.point.y - scrollY
635
+ } : {
636
+ x: innerWidth - 400,
637
+ y: 80
638
+ }, Et = ne({
639
+ x: Math.min(Math.max(Tt.x, 0), innerWidth),
640
+ y: Math.min(Math.max(Tt.y, 0), innerHeight - 40)
641
+ }), Dt = Z ? D.reference : s("feedbackRef", { ref: D.reference }), Ot = (e) => {
642
+ if (!(e instanceof n && e.status === 412)) return v(e);
643
+ B(null), y({
644
+ text: s("editConflict"),
645
+ tone: "info"
646
+ }), q();
647
+ }, kt = (e) => G.current === e.id && O(e), $ = async (e) => {
648
+ let t = D;
649
+ try {
650
+ kt(await a.updateThread(D.id, { status: e })), e === "resolved" && import("./confetti-BIs5s14P.js").then((e) => e.celebrate(vt.current)).catch(() => void 0), e === "resolved" ? y({
651
+ text: s("resolvedToast", { ref: D.reference }),
652
+ tone: "success",
653
+ action: {
654
+ label: s("undo"),
655
+ run: () => void te(a, t, y, v).then((e) => e && G.current === e.id && O(e))
656
+ }
657
+ }) : e === "open" && (t.status === "resolved" || t.status === "closed") && y({
658
+ text: s("reopenedToast", { ref: D.reference }),
659
+ tone: "info"
660
+ });
661
+ } catch (e) {
662
+ Ot(e);
663
+ }
664
+ }, At = () => a.watch(D.id, !gt).then((e) => {
665
+ let t = e?.watching ?? !gt;
666
+ Ue.set(D.id, t), G.current === D.id && _t(t), y({ text: s(t ? "followed" : "muted", { ref: D.reference }) });
667
+ }, v), jt = () => {
668
+ if (!z || I) return;
669
+ Ze(!0);
670
+ let e = He(z.body, H.map((e) => e.name)), t = H.filter((t) => /^\d+$/.test(t.id ?? "") && e.has(t.name)).map((e) => Number(e.id));
671
+ a.editMessage(z.id, z.body, ...t.length ? [{ mentionIds: t }] : []).then((e) => {
672
+ A((t) => t.map((t) => t.id === e.id ? e : t)), B(null), y({
673
+ text: s("editedToast"),
674
+ tone: "success"
675
+ }), e.id === k[0]?.id && a.refreshThread(D.id);
676
+ }, Ot).finally(() => Ze(!1));
677
+ }, Mt = async () => {
678
+ if (N.trim() && !I && w) {
679
+ Ze(!0), $e(!1);
680
+ try {
681
+ let e = await P.ready(), n = e.ids;
682
+ e.missing && y({
683
+ text: s("sentWithoutFiles"),
684
+ tone: "info"
685
+ });
686
+ let r = await a.reply(D.id, N.trim(), {
687
+ replyTo: V?.id ?? null,
688
+ mentionIds: Ye,
689
+ attachmentIds: n,
690
+ idempotencyKey: L.current ?? (L.current = t(16))
691
+ });
692
+ if (L.current = null, ae(M), G.current !== D.id) return;
693
+ A((e) => e.some((e) => e.id === r.id) ? e : [...e, r]), st(null), lt(!1), Fe(""), P.clear(), (D.status === "resolved" || D.status === "closed") && O({
694
+ ...D,
695
+ status: "open"
696
+ });
697
+ } catch (e) {
698
+ $e(_(e) ?? !0);
699
+ } finally {
700
+ Ze(!1);
701
+ }
702
+ }
703
+ }, Nt = async (e, t) => {
704
+ let n = e.reactions?.find((e) => e.emoji === t)?.mine ?? !1, r = (e) => {
705
+ let r = (e.reactions ?? []).map((e) => e.emoji === t ? {
706
+ ...e,
707
+ count: e.count + (n ? -1 : 1),
708
+ mine: !n
709
+ } : e).filter((e) => e.count > 0);
710
+ return !n && !r.some((e) => e.emoji === t) && r.push({
711
+ emoji: t,
712
+ count: 1,
713
+ mine: !0
714
+ }), {
715
+ ...e,
716
+ reactions: r
717
+ };
718
+ };
719
+ A(k.map((t) => t.id === e.id ? r(t) : t));
720
+ try {
721
+ await a.react(e.id, t, !n);
722
+ } catch (e) {
723
+ v(e), q();
724
+ }
725
+ }, Pt = (e) => P.add(e), Ft = (e) => {
726
+ let t = k.findIndex((t) => t.id === e.id);
727
+ A((t) => t.filter((t) => t.id !== e.id)), T.current?.focus({ preventScroll: !0 }), y({
728
+ text: s("replyDeleted"),
729
+ action: {
730
+ label: s("undo"),
731
+ run: () => G.current === D.id && A((n) => n.some((t) => t.id === e.id) ? n : [
732
+ ...n.slice(0, t),
733
+ e,
734
+ ...n.slice(t)
735
+ ])
736
+ },
737
+ expires: We,
738
+ onExpire: () => void a.deleteMessage(e.id).then(() => a.refreshThread(D.id), (e) => {
739
+ v(e), G.current === D.id && q();
740
+ })
741
+ });
742
+ }, It = () => {
743
+ let e = a.state.get().threads;
744
+ a.state.set((e) => ({ threads: e.threads.filter((e) => e.id !== D.id) })), g(), y({
745
+ text: s("threadDeleted", { ref: D.reference }),
746
+ action: {
747
+ label: s("undo"),
748
+ run: () => a.state.set((t) => ({ threads: t.threads.some((e) => e.id === D.id) ? t.threads : e.filter((e) => e.id === D.id).concat(t.threads) }))
749
+ },
750
+ expires: We,
751
+ onExpire: () => void a.deleteThread(D.id).catch((e) => {
752
+ v(e), a.refreshThread(D.id);
753
+ })
754
+ });
755
+ }, Lt = async (e, t) => {
756
+ try {
757
+ await navigator.clipboard.writeText(e), y({ text: t });
758
+ } catch {
759
+ v(Error(s("errorGeneric")));
760
+ }
761
+ }, Rt = (() => {
762
+ let e = C(D.page.url);
763
+ return e ? Oe(e, D.id) : "";
764
+ })(), zt = C(D.capture?.screenshot?.thumbnail_url, "image"), Bt = C(D.capture?.screenshot?.url), Vt = zt ? {
765
+ thumb: zt,
766
+ src: Bt ?? zt,
767
+ href: Bt,
768
+ name: s("screenshot")
769
+ } : null, Ht = D.status === "resolved" || D.status === "closed";
770
+ return /* @__PURE__ */ p(me, {
771
+ value: pe(a, y, Ot, x),
772
+ children: /* @__PURE__ */ p("div", {
773
+ class: b ? "ck-card ck-card-embedded" : "ck-card",
774
+ style: b ? void 0 : Et,
775
+ role: "region",
776
+ "aria-label": Dt,
777
+ "data-commentkit-ui": !0,
778
+ ref: at,
779
+ onKeyDown: b ? (e) => e.key === "Escape" && !e.defaultPrevented && (e.stopPropagation(), b.onBack()) : void 0,
780
+ children: [
781
+ /* @__PURE__ */ p("div", {
782
+ class: "ck-card-head ck-thread-head",
783
+ ref: nt,
784
+ children: [
785
+ b ? /* @__PURE__ */ p("button", {
786
+ class: "ck-ghost ck-back",
787
+ "aria-label": s("backToList"),
788
+ title: s("backToList"),
789
+ onClick: b.onBack,
790
+ children: /* @__PURE__ */ p(S, {
791
+ name: "chevron",
792
+ size: 16
793
+ })
794
+ }) : null,
795
+ /* @__PURE__ */ p("span", {
796
+ class: "ck-card-title",
797
+ ref: T,
798
+ tabIndex: -1,
799
+ children: Dt
800
+ }),
801
+ /* @__PURE__ */ p(ye, { status: D.status }),
802
+ b?.position ? /* @__PURE__ */ p("span", {
803
+ class: "ck-muted ck-card-pos",
804
+ children: s("countOf", {
805
+ n: b.position.n,
806
+ total: b.position.total
807
+ })
808
+ }) : null,
809
+ b?.onPrev ? /* @__PURE__ */ p("button", {
810
+ class: "ck-ghost ck-step",
811
+ "aria-label": s("previousThread"),
812
+ title: Y() ? `${s("previousThread")} (K)` : s("previousThread"),
813
+ "aria-keyshortcuts": Y() ? "K" : void 0,
814
+ onClick: b.onPrev,
815
+ children: /* @__PURE__ */ p(S, {
816
+ name: "chevron",
817
+ size: 16
818
+ })
819
+ }) : null,
820
+ b?.onNext ? /* @__PURE__ */ p("button", {
821
+ class: "ck-ghost ck-step",
822
+ "data-dir": "next",
823
+ "aria-label": s("nextThread"),
824
+ title: Y() ? `${s("nextThread")} (J)` : s("nextThread"),
825
+ "aria-keyshortcuts": Y() ? "J" : void 0,
826
+ onClick: b.onNext,
827
+ children: /* @__PURE__ */ p(S, {
828
+ name: "chevron",
829
+ size: 16
830
+ })
831
+ }) : null,
832
+ /* @__PURE__ */ p("span", {
833
+ class: "ck-more",
834
+ ref: it,
835
+ children: [/* @__PURE__ */ p("button", {
836
+ class: "ck-ghost",
837
+ ref: tt,
838
+ "aria-label": s("more"),
839
+ title: s("more"),
840
+ "aria-haspopup": "menu",
841
+ "aria-expanded": R,
842
+ "aria-controls": R ? "ck-thread-menu" : void 0,
843
+ onClick: () => et(!R),
844
+ children: /* @__PURE__ */ p(S, { name: "more" })
845
+ }), R ? /* @__PURE__ */ p("div", {
846
+ class: "ck-menu ck-pop",
847
+ id: "ck-thread-menu",
848
+ role: "menu",
849
+ onClick: rt,
850
+ onKeyDown: (e) => e.key === "Escape" ? (e.stopPropagation(), rt()) : Ee(e, "[role=menuitem]", !0),
851
+ children: [
852
+ b ? /* @__PURE__ */ p("button", {
853
+ role: "menuitem",
854
+ onClick: () => b.onShow(D),
855
+ children: s("showOnPage")
856
+ }) : null,
857
+ Rt ? /* @__PURE__ */ p("button", {
858
+ role: "menuitem",
859
+ onClick: () => void Lt(Rt, s("copied")),
860
+ children: s("copyLink")
861
+ }) : null,
862
+ fe && X?.triage && Q ? /* @__PURE__ */ p("button", {
863
+ role: "menuitem",
864
+ onClick: fe,
865
+ children: s("movePin")
866
+ }) : null,
867
+ X?.export_for_agents ? /* @__PURE__ */ p("button", {
868
+ role: "menuitem",
869
+ onClick: () => void Lt(h(D, k), s("copiedForAgent")),
870
+ children: s("copyForAgent")
871
+ }) : null,
872
+ X?.set_any_status && Q ? /* @__PURE__ */ p(o, { children: [
873
+ /* @__PURE__ */ p("button", {
874
+ role: "menuitem",
875
+ onClick: () => void $("in_progress"),
876
+ children: s("markInProgress")
877
+ }),
878
+ /* @__PURE__ */ p("button", {
879
+ role: "menuitem",
880
+ onClick: () => void $("in_review"),
881
+ children: s("markInReview")
882
+ }),
883
+ /* @__PURE__ */ p("button", {
884
+ role: "menuitem",
885
+ onClick: () => void $("closed"),
886
+ children: s("closeThread")
887
+ })
888
+ ] }) : null,
889
+ /* @__PURE__ */ p("button", {
890
+ role: "menuitem",
891
+ onClick: () => void At(),
892
+ children: s(gt ? "mute" : "unmute")
893
+ }),
894
+ Q && (X?.manage || wt && D.message_count <= 1) ? /* @__PURE__ */ p("button", {
895
+ role: "menuitem",
896
+ class: "ck-danger",
897
+ onClick: It,
898
+ children: s("delete")
899
+ }) : null
900
+ ]
901
+ }) : null]
902
+ }),
903
+ b ? null : /* @__PURE__ */ p("button", {
904
+ class: "ck-ghost",
905
+ "aria-label": s("close"),
906
+ title: s("close"),
907
+ onClick: g,
908
+ children: /* @__PURE__ */ p(S, { name: "close" })
909
+ })
910
+ ]
911
+ }),
912
+ b ? null : /* @__PURE__ */ p("div", {
913
+ class: "ck-card-hint",
914
+ role: "status",
915
+ children: ot
916
+ }),
917
+ /* @__PURE__ */ p("div", {
918
+ class: "ck-card-body",
919
+ ref: vt,
920
+ onScroll: (e) => {
921
+ let t = e.currentTarget, n = t.scrollHeight - t.scrollTop - t.clientHeight > 120, r = t.scrollTop < ut.current;
922
+ ut.current = t.scrollTop, lt((e) => n && (e || r)), W(null);
923
+ },
924
+ onMouseOver: (e) => {
925
+ let t = e.target.closest?.(".ck-mention");
926
+ if (!t) return W(null);
927
+ let n = t.textContent?.replace(/^@/, "") ?? "", r = H.find((e) => e.name === n) ?? H.find((e) => n.startsWith(e.name));
928
+ if (!r) return;
929
+ let i = t.getBoundingClientRect();
930
+ W({
931
+ person: r,
932
+ x: i.left,
933
+ y: i.bottom + 6
934
+ });
935
+ },
936
+ onMouseLeave: () => W(null),
937
+ children: [
938
+ /* @__PURE__ */ p(_e, {
939
+ thread: D,
940
+ editable: !!X?.triage && Q,
941
+ onChange: kt
942
+ }),
943
+ /* @__PURE__ */ p(ze, {
944
+ thread: D,
945
+ anchor: J?.state,
946
+ branch: Z && !!a.options.branch
947
+ }),
948
+ /* @__PURE__ */ p(ge, {
949
+ thread: D,
950
+ editable: Q && (Z || !!wt),
951
+ addable: Z && a.options.tools?.checklist !== !1,
952
+ onChange: kt
953
+ }, D.id),
954
+ D.style_changes?.length ? /* @__PURE__ */ p(Re, {
955
+ thread: D,
956
+ element: J?.state === "detached" ? null : J?.element ?? null,
957
+ editable: Q && (!!X?.triage || !!wt),
958
+ onChange: kt
959
+ }, D.id) : null,
960
+ Z ? /* @__PURE__ */ p(Be, { thread: D }) : null,
961
+ D.status === "in_review" && !X?.set_any_status && Q ? /* @__PURE__ */ p("div", {
962
+ class: "ck-review-ask",
963
+ children: [/* @__PURE__ */ p("div", { children: s("reviewAsk") }), /* @__PURE__ */ p("div", {
964
+ class: "ck-actions",
965
+ children: [/* @__PURE__ */ p("button", {
966
+ class: "ck-btn ck-primary",
967
+ onClick: () => void $("resolved"),
968
+ children: [
969
+ /* @__PURE__ */ p(S, {
970
+ name: "check",
971
+ size: 14
972
+ }),
973
+ " ",
974
+ s("looksGood")
975
+ ]
976
+ }), /* @__PURE__ */ p("button", {
977
+ class: "ck-btn",
978
+ onClick: () => ht(!0),
979
+ children: s("notYet")
980
+ })]
981
+ })]
982
+ }) : null,
983
+ k.map((e, t) => {
984
+ let n = Ve(e.author, x), r = t === 0;
985
+ return /* @__PURE__ */ p(Me, {
986
+ client: a,
987
+ message: e,
988
+ first: r,
989
+ mine: n,
990
+ fresh: !pt.current.has(e.id),
991
+ people: ft,
992
+ shot: Vt,
993
+ canWrite: Q,
994
+ simple: !Z,
995
+ canDelete: Q && (n || !!X?.manage) && !r,
996
+ edit: z?.id === e.id ? {
997
+ body: z.body,
998
+ busy: I,
999
+ onChange: (t) => B({
1000
+ id: e.id,
1001
+ body: t
1002
+ }),
1003
+ onCancel: () => B(null),
1004
+ onSave: jt
1005
+ } : null,
1006
+ alone: r && k.length === 1,
1007
+ onQuote: () => st(e),
1008
+ onCopy: () => void Lt(e.body, s("copiedText")),
1009
+ onEdit: () => B({
1010
+ id: e.id,
1011
+ body: e.body
1012
+ }),
1013
+ onDelete: () => Ft(e),
1014
+ onReact: (t) => void Nt(e, t),
1015
+ onView: qe,
1016
+ onImageLoad: bt
1017
+ });
1018
+ })
1019
+ ]
1020
+ }),
1021
+ /* @__PURE__ */ p("div", {
1022
+ class: "ck-card-foot ck-reply-foot",
1023
+ ...Q && Ct ? ee(Pt) : {},
1024
+ children: [ct ? /* @__PURE__ */ p("button", {
1025
+ class: "ck-chip ck-jump",
1026
+ onClick: () => (lt(!1), yt(!0)),
1027
+ children: [/* @__PURE__ */ p(S, {
1028
+ name: "down",
1029
+ size: 14
1030
+ }), s("jumpToLatest")]
1031
+ }) : null, Q ? /* @__PURE__ */ p(o, { children: [
1032
+ w ? null : /* @__PURE__ */ p("div", {
1033
+ class: "ck-note",
1034
+ "data-tone": "warning",
1035
+ role: "status",
1036
+ children: s("offline")
1037
+ }),
1038
+ Qe && w ? /* @__PURE__ */ p("div", {
1039
+ class: "ck-note",
1040
+ "data-tone": "warning",
1041
+ role: "alert",
1042
+ children: Qe === !0 ? /* @__PURE__ */ p(o, { children: [
1043
+ s("replyFailed"),
1044
+ " ",
1045
+ /* @__PURE__ */ p("button", {
1046
+ class: "ck-btn",
1047
+ "aria-disabled": I || void 0,
1048
+ onClick: () => void Mt(),
1049
+ children: s("retry")
1050
+ })
1051
+ ] }) : Qe
1052
+ }) : null,
1053
+ /* @__PURE__ */ p(se, {
1054
+ client: a,
1055
+ value: N,
1056
+ onChange: Ie,
1057
+ onMentions: Xe,
1058
+ onSubmit: () => void Mt(),
1059
+ placeholder: s(mt ? "notYetPlaceholder" : Ht ? "replyToReopen" : "replyPlaceholder"),
1060
+ autofocus: mt || !!V,
1061
+ disabled: I,
1062
+ canMention: !0,
1063
+ above: V ? /* @__PURE__ */ p("div", {
1064
+ class: "ck-quoting",
1065
+ role: "status",
1066
+ children: [
1067
+ /* @__PURE__ */ p(S, {
1068
+ name: "reply",
1069
+ size: 14
1070
+ }),
1071
+ /* @__PURE__ */ p("span", {
1072
+ title: V.body.slice(0, 280),
1073
+ children: [
1074
+ /* @__PURE__ */ p("strong", { children: /* @__PURE__ */ p("bdi", { children: V.author.name }) }),
1075
+ " ",
1076
+ /* @__PURE__ */ p("bdi", { children: V.body.slice(0, 140) })
1077
+ ]
1078
+ }),
1079
+ /* @__PURE__ */ p("button", {
1080
+ class: "ck-ghost ck-ghost-sm",
1081
+ "aria-label": s("quoteCancel"),
1082
+ title: s("quoteCancel"),
1083
+ onClick: () => st(null),
1084
+ children: /* @__PURE__ */ p(S, {
1085
+ name: "close",
1086
+ size: 14
1087
+ })
1088
+ })
1089
+ ]
1090
+ }) : null
1091
+ }),
1092
+ /* @__PURE__ */ p(ue, {
1093
+ items: P.items,
1094
+ onRemove: P.remove,
1095
+ onRetry: P.retry,
1096
+ onOpen: (e) => qe(P.items.filter((e) => e.preview).map((e) => ({
1097
+ src: e.preview,
1098
+ name: e.file.name
1099
+ })), e)
1100
+ }),
1101
+ /* @__PURE__ */ p("div", {
1102
+ class: "ck-actions",
1103
+ children: [
1104
+ Ct ? /* @__PURE__ */ p(re, {
1105
+ input: Je,
1106
+ onFiles: Pt,
1107
+ types: be
1108
+ }) : null,
1109
+ Ht ? /* @__PURE__ */ p("button", {
1110
+ class: "ck-btn",
1111
+ onClick: () => void $("open"),
1112
+ children: s("reopen")
1113
+ }) : /* @__PURE__ */ p("button", {
1114
+ class: "ck-btn",
1115
+ title: s("resolveHint"),
1116
+ "aria-keyshortcuts": Y() ? "E" : void 0,
1117
+ onClick: () => void $("resolved"),
1118
+ children: [
1119
+ /* @__PURE__ */ p(S, {
1120
+ name: "check",
1121
+ size: 14
1122
+ }),
1123
+ " ",
1124
+ s("resolve")
1125
+ ]
1126
+ }),
1127
+ /* @__PURE__ */ p("span", { class: "ck-spacer" }),
1128
+ /* @__PURE__ */ p("button", {
1129
+ class: D.status === "in_review" && !X?.set_any_status && Q ? "ck-btn" : "ck-btn ck-primary",
1130
+ "aria-disabled": I || !N.trim() || !w || void 0,
1131
+ onClick: () => w && void Mt(),
1132
+ children: s(I ? "sending" : "reply")
1133
+ })
1134
+ ]
1135
+ })
1136
+ ] }) : /* @__PURE__ */ p("div", {
1137
+ class: "ck-note",
1138
+ children: s(ve ? "readOnlyReply" : "noReplyAccess")
1139
+ })]
1140
+ }),
1141
+ F && Ke ? /* @__PURE__ */ p(Ke, {
1142
+ images: F.images,
1143
+ start: F.start,
1144
+ onClose: () => Ge(null)
1145
+ }) : null,
1146
+ U ? /* @__PURE__ */ p("div", {
1147
+ class: "ck-mention-card",
1148
+ style: xe(Math.max(8, Math.min(U.x, innerWidth - 248)), U.y),
1149
+ "aria-hidden": "true",
1150
+ children: [/* @__PURE__ */ p(Ce, { person: U.person }), /* @__PURE__ */ p("bdi", {
1151
+ class: "ck-msg-name",
1152
+ children: U.person.name
1153
+ })]
1154
+ }) : null
1155
+ ]
1156
+ })
1157
+ });
1158
+ }
1159
+ var We = 6e3;
1160
+ export { F as ThreadCard, Ve as isMine, He as mentionedNames };