@commentkit/comment-kit 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/dist/npm/THIRD_PARTY_NOTICES.txt +2 -2
  3. package/dist/npm/chunks/{AgentSend-DyWxNQ0p.js → AgentSend-2JPDseOo.js} +4 -5
  4. package/dist/npm/chunks/{Checklist-VYkSl6Q9.js → Checklist-BpDXQebo.js} +77 -79
  5. package/dist/npm/chunks/Composer-CAyj-c8e.js +677 -0
  6. package/dist/npm/chunks/Guest-ZdFmTcXI.js +187 -0
  7. package/dist/npm/chunks/{MarkupEditor-DxTI9nJH.js → MarkupEditor-BFplZwFy.js} +3 -5
  8. package/dist/npm/chunks/{Panel-riaMYxt-.js → Panel-BhZ4XRDR.js} +300 -302
  9. package/dist/npm/chunks/{Settings-CB4zxQAL.js → Settings-SPG9EHUZ.js} +70 -72
  10. package/dist/npm/chunks/{Shortcuts-D1cbajg_.js → Shortcuts-C28HVDw6.js} +3 -5
  11. package/dist/npm/chunks/{StyleEditor-BtTv3I8_.js → StyleEditor-ByZMtq10.js} +4 -5
  12. package/dist/npm/chunks/{StylePanel-BI-n5Me1.js → StylePanel-Iwhce2tE.js} +62 -64
  13. package/dist/npm/chunks/{TaskFields-HwrD0FrH.js → TaskFields-BsP_fVJg.js} +7 -6
  14. package/dist/npm/chunks/{ThreadCard-CjaC8BTa.js → ThreadCard-BzVZdDCb.js} +407 -403
  15. package/dist/npm/chunks/{Viewer-BnWshSXb.js → Viewer-CqtGrdD8.js} +29 -31
  16. package/dist/npm/chunks/{agent-Cr6NB6We.js → agent-BDMQtOzH.js} +14 -15
  17. package/dist/npm/chunks/{anchor-OCQnjp_6.js → anchor-BsradQhn.js} +1 -2
  18. package/dist/npm/chunks/{ar-BQ9K9Oqf.js → ar-8tPch6W4.js} +5 -2
  19. package/dist/npm/chunks/{card-bits-CxteYiZ9.js → card-bits-Bna-g3Py.js} +24 -26
  20. package/dist/npm/chunks/{client-CJ1tpI62.js → client-EFTWxHbJ.js} +76 -61
  21. package/dist/npm/chunks/{colors-0Ied7PE2.js → colors-CWAn_swA.js} +39 -4
  22. package/dist/npm/chunks/{confetti-DKeKR7-6.js → confetti-DTKpwF3O.js} +1 -2
  23. package/dist/npm/chunks/{de-CcPi8xdC.js → de-C63897uD.js} +5 -2
  24. package/dist/npm/chunks/{drafts-CpQdHhcK.js → drafts-akdBsOd0.js} +1 -2
  25. package/dist/npm/chunks/{es-DXgkjDCG.js → es-CI2bSpvB.js} +5 -2
  26. package/dist/npm/chunks/{extension-BIGfr4Gh.js → extension-BST6LH1q.js} +2 -3
  27. package/dist/npm/chunks/{extension-DkDSW4qw.js → extension-D-V3utTm.js} +3 -4
  28. package/dist/npm/chunks/{fr-IjJaUbWh.js → fr-rsVe-Lqk.js} +5 -2
  29. package/dist/npm/chunks/{hi-BhKQK2MU.js → hi-cvwbSaWP.js} +5 -2
  30. package/dist/npm/chunks/{html2canvas-pro.esm-lgs6tb4C.js → html2canvas-pro.esm-B7b8p5Wr.js} +608 -528
  31. package/dist/npm/chunks/{i18n-DAJGndZ2.js → i18n-C4v0M-6z.js} +254 -257
  32. package/dist/npm/chunks/{it-DKiSCkiD.js → it-C8tnV0BF.js} +5 -2
  33. package/dist/npm/chunks/{ja-BI1WagDg.js → ja-BWxDfC2f.js} +5 -2
  34. package/dist/npm/chunks/{live-B-mo27Qq.js → live-BCpJVBeN.js} +2 -3
  35. package/dist/npm/chunks/{lock-C82sC17d.js → lock-B1JLlOhz.js} +0 -1
  36. package/dist/npm/chunks/{nl-CJw3VUQ5.js → nl-DNQ6eCht.js} +5 -2
  37. package/dist/npm/chunks/{pick-CYPkLLFJ.js → pick-CLyOdjnD.js} +3 -4
  38. package/dist/npm/chunks/{pt-BR-CjBolC5g.js → pt-BR-CkG7vpU2.js} +5 -2
  39. package/dist/npm/chunks/{realtime-D22tI_AS.js → realtime-DIo-Wth4.js} +2 -3
  40. package/dist/npm/chunks/{report-DoDVi1qT.js → report-BBrT3r89.js} +1 -2
  41. package/dist/npm/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
  42. package/dist/npm/chunks/{source-CTQmAh0Y.js → source-CS7C6wJA.js} +2 -3
  43. package/dist/npm/chunks/{src-CgBEoWl0.js → src-C4FsVoUp.js} +22 -24
  44. package/dist/npm/chunks/{start-DW9_DKmf.js → start-i9M-r3aH.js} +375 -358
  45. package/dist/npm/chunks/{upload-BmrpZE5G.js → upload-DSv7EyBD.js} +2 -3
  46. package/dist/npm/chunks/uploads-I01kdqQF.js +1103 -0
  47. package/dist/npm/chunks/{zh-CN-BrZGx2S0.js → zh-CN-BKuZOLBE.js} +5 -2
  48. package/dist/npm/element.js +2 -3
  49. package/dist/npm/headless.js +2 -2
  50. package/dist/npm/index.js +2 -2
  51. package/dist/npm/react.js +2 -3
  52. package/dist/npm/svelte.js +2 -3
  53. package/dist/npm/types/core/auth.d.ts +14 -0
  54. package/dist/npm/vue.js +2 -3
  55. package/package.json +8 -8
  56. package/dist/npm/chunks/Composer-CnsGQirF.js +0 -679
  57. package/dist/npm/chunks/Guest-DkIvY5zt.js +0 -170
  58. package/dist/npm/chunks/uploads-CipONvCy.js +0 -541
@@ -0,0 +1,677 @@
1
+ import { n as e } from "./src-C4FsVoUp.js";
2
+ import { p as t } from "./client-EFTWxHbJ.js";
3
+ import { a as n } from "./anchor-BsradQhn.js";
4
+ import { _ as r, d as i, f as a, h as o, l as s, m as c, s as l, u } from "./i18n-C4v0M-6z.js";
5
+ import { n as ee, o as te, r as ne, t as re } from "./card-bits-Bna-g3Py.js";
6
+ import { i as ie, r as ae, t as oe } from "./drafts-akdBsOd0.js";
7
+ import { a as se, c as ce, d, i as le, l as ue, n as de, o as fe, t as pe } from "./uploads-I01kdqQF.js";
8
+ import { T as me, _ as he, a as ge, f, i as _e, l as ve, n as p, o as ye, s as be, v as xe } from "./start-i9M-r3aH.js";
9
+ var m = "iframe,[data-commentkit],[data-commentkit-host],[data-commentkit-ui],[data-commentkit-panel],[data-commentkit-redact],[data-html2canvas-ignore],input[type=\"password\"],input[type=\"hidden\"],input[type=\"email\" i],input[type=\"tel\" i]," + [
10
+ "current-password",
11
+ "new-password",
12
+ "one-time-code",
13
+ "email",
14
+ "tel",
15
+ "street-address",
16
+ "address-line1",
17
+ "address-line2",
18
+ "address-line3",
19
+ "postal-code"
20
+ ].map((e) => `[autocomplete~="${e}" i]`).join(",") + "," + ["cc-", "tel-"].map((e) => `[autocomplete^="${e}" i],[autocomplete*=" ${e}" i]`).join(",");
21
+ function h(e) {
22
+ try {
23
+ let t = e;
24
+ for (; t;) {
25
+ if (t.closest(m)) return !0;
26
+ let e = t.getRootNode();
27
+ t = e instanceof ShadowRoot ? e.host : null;
28
+ }
29
+ return !1;
30
+ } catch {
31
+ return !0;
32
+ }
33
+ }
34
+ // src/capture/context.ts
35
+ function Se() {
36
+ let e = navigator.userAgent, t = Ce(e, [
37
+ ["Edge", /Edg\/([\d.]+)/],
38
+ ["Opera", /OPR\/([\d.]+)/],
39
+ ["Samsung Internet", /SamsungBrowser\/([\d.]+)/],
40
+ ["Chrome", /Chrome\/([\d.]+)/],
41
+ ["Firefox", /Firefox\/([\d.]+)/],
42
+ ["Safari", /Version\/([\d.]+).*Safari/]
43
+ ]), n = Ce(e, [
44
+ ["iOS", /(?:iPhone|iPad|iPod).*OS ([\d_]+)/],
45
+ ["Android", /Android ([\d.]+)/],
46
+ ["Windows", /Windows NT ([\d.]+)/],
47
+ ["macOS", /Mac OS X ([\d_]+)/],
48
+ ["ChromeOS", /CrOS [^ ]+ ([\d.]+)/],
49
+ ["Linux", /Linux()/]
50
+ ]), r = innerWidth, i = matchMedia?.("(pointer: coarse)").matches ?? !1;
51
+ return {
52
+ viewport: {
53
+ width: r,
54
+ height: innerHeight,
55
+ dpr: Math.round((devicePixelRatio || 1) * 100) / 100,
56
+ zoom: Math.round((visualViewport?.scale ?? 1) * 100) / 100
57
+ },
58
+ device: {
59
+ browser: t?.[0],
60
+ browser_version: t?.[1]?.split(".")[0],
61
+ os: n?.[0],
62
+ os_version: n?.[1]?.replace(/_/g, "."),
63
+ type: i ? r >= 768 ? "tablet" : "mobile" : "desktop",
64
+ locale: navigator.language,
65
+ color_scheme: matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light",
66
+ user_agent: e.slice(0, 500)
67
+ }
68
+ };
69
+ }
70
+ function Ce(e, t) {
71
+ for (let [n, r] of t) {
72
+ let t = e.match(r);
73
+ if (t) return [n, t[1] ?? ""];
74
+ }
75
+ return null;
76
+ }
77
+ // src/capture/screenshot.ts
78
+ var g = 8e6, _ = 15e3;
79
+ function v() {
80
+ e() || import("./html2canvas-pro.esm-B7b8p5Wr.js").catch(() => void 0);
81
+ }
82
+ async function we(t = {}) {
83
+ let n = (t.redact ?? []).filter(w), r = innerWidth, i = innerHeight, a = null;
84
+ e() && (a = await import("./extension-D-V3utTm.js").then((e) => e.captureTab(n)).catch(() => null)), a ?? (a = await y(n, r, i));
85
+ let o = a.getContext("2d"), s = a.width / Math.max(1, r);
86
+ return o && b(o, s, t), t.crop && t.region && (a = Te(a, s, t.region, r, i)), {
87
+ blob: await C(a),
88
+ width: a.width,
89
+ height: a.height
90
+ };
91
+ }
92
+ async function y(e, t, n) {
93
+ let [{ default: r }, { captureBackground: i, normalizeCaptureColors: a, settleStylesheets: o }] = await Promise.all([import("./html2canvas-pro.esm-B7b8p5Wr.js"), import("./colors-CWAn_swA.js")]), s = (t) => t.tagName === "NOSCRIPT" || h(t) || e.some((e) => De(t, e)), c = Math.min(devicePixelRatio || 1, 2, Math.sqrt(g / Math.max(1, t * n)));
94
+ return Ee(r(document.documentElement, {
95
+ useCORS: !0,
96
+ logging: !1,
97
+ backgroundColor: i(getComputedStyle(document.body).backgroundColor),
98
+ scale: c,
99
+ x: scrollX,
100
+ y: scrollY,
101
+ width: t,
102
+ height: n,
103
+ windowWidth: document.documentElement.clientWidth,
104
+ windowHeight: n,
105
+ ignoreElements: s,
106
+ onclone: async (e) => {
107
+ await o(e), a(e);
108
+ }
109
+ }), _);
110
+ }
111
+ function b(e, t, n) {
112
+ e.setTransform(1, 0, 0, 1, 0, 0);
113
+ let r = n.accent ?? "#ff5733";
114
+ if (n.region) {
115
+ let i = n.region;
116
+ e.save(), e.lineWidth = 3 * t, e.strokeStyle = r, e.setLineDash([8 * t, 6 * t]), e.strokeRect(i.x * t, i.y * t, i.w * t, i.h * t), e.restore();
117
+ }
118
+ if (n.pin) {
119
+ let i = n.pin.x * t, a = n.pin.y * t, o = 11 * t;
120
+ e.save(), e.shadowColor = "rgba(0,0,0,0.25)", e.shadowBlur = 6 * t, e.fillStyle = r, e.beginPath(), e.arc(i, a - o, o, Math.PI, 0), e.lineTo(i, a + o * .4), e.closePath(), e.fill(), e.shadowBlur = 0, e.fillStyle = "#ffffff", e.beginPath(), e.arc(i, a - o, o * .38, 0, Math.PI * 2), e.fill(), e.restore();
121
+ }
122
+ }
123
+ var x = {
124
+ w: 320,
125
+ h: 200
126
+ };
127
+ function S(e, t, n) {
128
+ let r = Math.min(t, Math.max(x.w, e.w + 64)), i = Math.min(n, Math.max(x.h, e.h + 64));
129
+ return {
130
+ x: Math.min(Math.max(0, e.x + e.w / 2 - r / 2), t - r),
131
+ y: Math.min(Math.max(0, e.y + e.h / 2 - i / 2), n - i),
132
+ w: r,
133
+ h: i
134
+ };
135
+ }
136
+ function Te(e, t, n, r, i) {
137
+ let a = S(n, r, i), o = document.createElement("canvas");
138
+ return o.width = Math.max(1, Math.round(a.w * t)), o.height = Math.max(1, Math.round(a.h * t)), o.getContext("2d")?.drawImage(e, a.x * t, a.y * t, o.width, o.height, 0, 0, o.width, o.height), o;
139
+ }
140
+ function C(e) {
141
+ return new Promise((t, n) => {
142
+ e.toBlob((r) => {
143
+ if (r && r.type === "image/webp") return t(r);
144
+ e.toBlob((e) => e ? t(e) : n(/* @__PURE__ */ Error("Could not encode the screenshot.")), "image/png");
145
+ }, "image/webp", .86);
146
+ });
147
+ }
148
+ function Ee(e, t) {
149
+ return new Promise((n, r) => {
150
+ let i = setTimeout(() => r(/* @__PURE__ */ Error("The screenshot took too long. Your feedback will be sent without it.")), t);
151
+ e.then((e) => (clearTimeout(i), n(e)), (e) => (clearTimeout(i), r(e)));
152
+ });
153
+ }
154
+ function w(e) {
155
+ try {
156
+ return document.createDocumentFragment().querySelector(e), !0;
157
+ } catch {
158
+ return !1;
159
+ }
160
+ }
161
+ function De(e, t) {
162
+ try {
163
+ return e.matches(t) || !!e.closest(t);
164
+ } catch {
165
+ return !1;
166
+ }
167
+ }
168
+ // src/ui/Composer.tsx
169
+ p(d);
170
+ function T({ client: e, draft: d, signedIn: p, onSignIn: m, onCancel: h, onSent: Ce, onError: g, share: _ = null, onPending: v }) {
171
+ let y = ge(e.state, (e) => e.config), b = ge(e.state, (e) => e.session?.person ?? null), x = o(() => be(e, d.anchor), [d.anchor]), [S, Te] = c(() => Me()), [C, Ee] = c(() => ae(x)), [w, De] = c([]), [T, Pe] = c(null), [Fe, Ie] = c(null), A = e.options.tools ?? {}, Le = y?.features.screenshots !== !1 && A.screenshots !== !1, Re = A.attachments !== !1, [j, M] = c(Le ? "capturing" : "off"), N = ge(e.state, (e) => !!e.session?.capabilities.triage), [P] = c(() => Ne(x)), [F, ze] = c(P?.task ?? {}), [I, L] = c(P?.checklist ?? null), [R, Be] = c(""), [z, Ve] = c(null);
172
+ u(() => {
173
+ N && !z && import("./TaskFields-BsP_fVJg.js").then((e) => Ve(() => e.TaskDraft), () => void 0);
174
+ }, [N]);
175
+ let [B, He] = c(P?.markup ?? []), [Ue, V] = c(null), H = de(e, (e) => g(new t(0, "file_rejected", e))), U = o(() => {
176
+ if (d.anchor.type !== "element" && d.anchor.type !== "text") return null;
177
+ let e = n(d.anchor).element;
178
+ return e instanceof HTMLElement || e instanceof SVGElement ? e : null;
179
+ }, [d.anchor]), [W, We] = c(P?.styles ?? []), [G, Ge] = c(!1), [K, Ke] = c(null), q = a(null), J = a(null), qe = () => {
180
+ U && (q.current ?? (q.current = fe(U)), J.current ?? (J.current = new le(U)), Ge(!0), K || import("./StylePanel-Iwhce2tE.js").then((e) => Ke(() => e.StylePanel), g));
181
+ };
182
+ i(() => {
183
+ G ? J.current?.apply(W) : J.current?.revert();
184
+ }, [G, W]), i(() => () => J.current?.revert(), []);
185
+ let [Je, Ye] = c(null), [Xe, Ze] = c(null), Qe = (e) => {
186
+ Ye(e), Xe || import("./Viewer-CqtGrdD8.js").then((e) => Ze(() => e.Viewer), g);
187
+ }, [Y, $e] = c(!1), [et, tt] = c(!1), nt = !!(y?.features.console_capture || y?.features.network_capture), [rt, it] = c(y?.features.capture_consent_default === !0), X = _e(), [at, ot] = c(!1), Z = !p && !!_ && !e.auth.pending(), [st, ct] = c(null), lt = {
188
+ name: a(null),
189
+ email: a(null)
190
+ }, ut = a(null), Q = a(null), dt = a(Promise.resolve(null));
191
+ u(() => {
192
+ if (j !== "capturing") return;
193
+ let t = !1, n = 0, r = 0;
194
+ return dt.current = new Promise((i) => {
195
+ let a = !1, o = () => {
196
+ if (!a) {
197
+ if (a = !0, t) return i(null);
198
+ we({
199
+ redact: [...y?.privacy.redact_selectors ?? [], ...e.options.redact ?? []],
200
+ pin: d.region ? null : d.point,
201
+ region: d.region,
202
+ crop: !!d.region
203
+ }).then(i, () => i(null));
204
+ }
205
+ };
206
+ n = requestAnimationFrame(() => n = requestAnimationFrame(o)), r = window.setTimeout(o, 300);
207
+ }), dt.current.then((e) => {
208
+ t || (e && Pe(e), M(e ? "ready" : "failed"));
209
+ }), () => {
210
+ t = !0, cancelAnimationFrame(n), clearTimeout(r);
211
+ };
212
+ }, []), u(() => {
213
+ if (!T) return;
214
+ let e = URL.createObjectURL(T.blob);
215
+ return Ie(e), () => URL.revokeObjectURL(e);
216
+ }, [T]);
217
+ let ft = (e) => {
218
+ Ee(e), ie(x, e);
219
+ };
220
+ u(() => {
221
+ Q.current = null;
222
+ }, [
223
+ C,
224
+ w,
225
+ T,
226
+ j,
227
+ B,
228
+ H.items,
229
+ rt,
230
+ F,
231
+ I,
232
+ W
233
+ ]);
234
+ let pt = o(() => ne(d.point, d.region ? {
235
+ top: d.region.y,
236
+ bottom: d.region.y + d.region.h
237
+ } : void 0), [d.point]), mt = (e) => H.add(e), ht = async () => {
238
+ let t = null, n = null, r = j === "capturing" ? await dt.current : j === "ready" ? T : null;
239
+ if (r) try {
240
+ let n = r.blob.type, i = `screenshot.${n === "image/webp" ? "webp" : n === "image/jpeg" ? "jpg" : "png"}`;
241
+ t = (await e.upload(r.blob, i, "screenshot")).id;
242
+ } catch {
243
+ n = "screenshot";
244
+ }
245
+ let i = await H.ready(), a = i.ids;
246
+ i.missing && (n ?? (n = "files"));
247
+ let o = {
248
+ ...Se(),
249
+ ...nt && rt ? me() : {},
250
+ screenshot_id: t,
251
+ markup: B.length ? B : void 0
252
+ }, s = N ? ke(F) : void 0, c = [...I ?? [], ...R.trim() ? [R.trim()] : []], l = U ? se(W) : [];
253
+ return {
254
+ key: crypto.randomUUID(),
255
+ input: {
256
+ anchor: d.anchor,
257
+ body: C.trim(),
258
+ capture: o,
259
+ attachmentIds: a,
260
+ mentionIds: w,
261
+ task: s,
262
+ checklist: c,
263
+ styleChanges: l
264
+ },
265
+ missing: n
266
+ };
267
+ }, $ = async () => {
268
+ if (Y || !C.trim() || !X) return;
269
+ if (tt(!1), !p && !_ && !at) {
270
+ ot(!0);
271
+ return;
272
+ }
273
+ let n = Z ? S.name.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(S.email.trim()) ? null : "email" : "name" : null;
274
+ if (ct(n), n) return lt[n].current?.focus();
275
+ $e(!0);
276
+ try {
277
+ let t = !p && !_;
278
+ if (Z && _) {
279
+ let { startGuest: n } = await import("./Guest-ZdFmTcXI.js");
280
+ O(D, JSON.stringify({
281
+ name: S.name,
282
+ email: S.email
283
+ })), t = await n(e, {
284
+ share: _,
285
+ ...S
286
+ }) === "popup";
287
+ }
288
+ if (t) {
289
+ if (O(ye, JSON.stringify({
290
+ draft: d,
291
+ scrollY
292
+ })), O(E, JSON.stringify({
293
+ id: x,
294
+ checklist: I,
295
+ task: F,
296
+ markup: B,
297
+ styles: W
298
+ })), !await m()) return;
299
+ k(ye), k(E);
300
+ }
301
+ let n = Q.current ?? (Q.current = await ht()), r = await e.createThread({
302
+ ...n.input,
303
+ idempotencyKey: n.key
304
+ });
305
+ if (Q.current = null, r.pending_verification) return v?.(e.auth.pending()?.email ?? S.email);
306
+ oe(x), k(D), Ce(r, n.missing);
307
+ } catch (n) {
308
+ if (n instanceof t && ["pending_limit", "verification_required"].includes(n.code) && e.auth.pending()) return v?.(e.auth.pending().email);
309
+ let r = ee(n);
310
+ tt(r ?? !0), r || g(n);
311
+ } finally {
312
+ $e(!1);
313
+ }
314
+ };
315
+ return /* @__PURE__ */ s(r, { children: [d.region ? /* @__PURE__ */ s("div", {
316
+ class: "ck-pending-region",
317
+ style: he(d.region.x, d.region.y, d.region.w, d.region.h),
318
+ "aria-hidden": "true",
319
+ "data-commentkit-ui": !0
320
+ }) : d.anchor.type === "page" ? null : /* @__PURE__ */ s("div", {
321
+ class: "ck-pending-pin",
322
+ style: he(d.point.x, d.point.y),
323
+ "aria-hidden": "true",
324
+ "data-commentkit-ui": !0,
325
+ children: [/* @__PURE__ */ s("svg", {
326
+ viewBox: "5 3 54 62",
327
+ children: /* @__PURE__ */ s("path", { d: Oe })
328
+ }), b ? /* @__PURE__ */ s(ve, { person: b }) : null]
329
+ }), /* @__PURE__ */ s("div", {
330
+ class: "ck-card ck-composer",
331
+ style: pt,
332
+ role: "dialog",
333
+ "aria-label": l("comment"),
334
+ "data-commentkit-ui": !0,
335
+ onKeyDown: (e) => e.key === "Escape" && h(),
336
+ ...Re ? te(mt) : {},
337
+ children: [
338
+ /* @__PURE__ */ s("div", {
339
+ class: "ck-card-body",
340
+ style: { position: "relative" },
341
+ children: [
342
+ d.anchor.quote ? /* @__PURE__ */ s("blockquote", {
343
+ class: "ck-quote",
344
+ "aria-label": l("quotedText"),
345
+ children: /* @__PURE__ */ s("bdi", { children: d.anchor.quote.slice(0, 200) })
346
+ }) : null,
347
+ X ? null : /* @__PURE__ */ s("div", {
348
+ class: "ck-note",
349
+ "data-tone": "warning",
350
+ role: "status",
351
+ children: l("offlineSend")
352
+ }),
353
+ et && X ? /* @__PURE__ */ s("div", {
354
+ class: "ck-note",
355
+ "data-tone": "warning",
356
+ role: "alert",
357
+ children: et === !0 ? /* @__PURE__ */ s(r, { children: [
358
+ l("sendFailed"),
359
+ " ",
360
+ /* @__PURE__ */ s("button", {
361
+ class: "ck-btn",
362
+ onClick: () => void $(),
363
+ children: l("retry")
364
+ })
365
+ ] }) : `${et} ${l("savedHere")}`
366
+ }) : null,
367
+ /* @__PURE__ */ s(ue, {
368
+ client: e,
369
+ value: C,
370
+ onChange: ft,
371
+ onMentions: De,
372
+ onSubmit: () => void $(),
373
+ placeholder: l("composerPlaceholder"),
374
+ autofocus: !0,
375
+ disabled: Y,
376
+ canMention: p
377
+ }),
378
+ I === null ? null : /* @__PURE__ */ s("div", {
379
+ class: "ck-draft-list",
380
+ role: "group",
381
+ "aria-label": l("checklist"),
382
+ children: [I.map((e, t) => /* @__PURE__ */ s("div", {
383
+ class: "ck-draft-item",
384
+ children: [
385
+ /* @__PURE__ */ s("span", {
386
+ "aria-hidden": "true",
387
+ class: "ck-draft-box"
388
+ }),
389
+ /* @__PURE__ */ s("bdi", { children: e }),
390
+ /* @__PURE__ */ s("button", {
391
+ class: "ck-ghost ck-ghost-sm",
392
+ "aria-label": l("removeItem", { item: e }),
393
+ onClick: () => L(I.filter((e, n) => n !== t)),
394
+ children: /* @__PURE__ */ s(f, {
395
+ name: "close",
396
+ size: 12
397
+ })
398
+ })
399
+ ]
400
+ })), I.length < 30 ? /* @__PURE__ */ s("input", {
401
+ class: "ck-input",
402
+ maxLength: 300,
403
+ placeholder: l("checklistAdd"),
404
+ "aria-label": l("checklistAdd"),
405
+ value: R,
406
+ ref: xe,
407
+ onInput: (e) => Be(e.target.value),
408
+ onKeyDown: (e) => {
409
+ e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && R.trim() && (e.preventDefault(), L([...I, R.trim()]), Be(""));
410
+ }
411
+ }) : null]
412
+ }),
413
+ W.length ? /* @__PURE__ */ s("div", {
414
+ class: "ck-draft-list ck-style-list",
415
+ role: "group",
416
+ "aria-label": l("styleChanges"),
417
+ children: W.map((e) => /* @__PURE__ */ s("div", {
418
+ class: "ck-draft-item",
419
+ children: [/* @__PURE__ */ s("code", { children: ce(e) }), /* @__PURE__ */ s("button", {
420
+ class: "ck-ghost ck-ghost-sm",
421
+ "aria-label": l("styleRemoveChange", { change: ce(e) }),
422
+ onClick: () => We(W.filter((t) => t.property !== e.property)),
423
+ children: /* @__PURE__ */ s(f, {
424
+ name: "close",
425
+ size: 12
426
+ })
427
+ })]
428
+ }))
429
+ }) : null,
430
+ G && K && q.current ? /* @__PURE__ */ s(K, {
431
+ base: q.current,
432
+ changes: W,
433
+ onChange: We,
434
+ onClose: () => Ge(!1)
435
+ }) : null,
436
+ I === null || U && !G ? /* @__PURE__ */ s("div", {
437
+ class: "ck-extra-add",
438
+ children: [I === null ? /* @__PURE__ */ s("button", {
439
+ class: "ck-ghost ck-ghost-sm",
440
+ onClick: () => L([]),
441
+ children: ["+ ", l("addChecklist")]
442
+ }) : null, U && !G ? /* @__PURE__ */ s("button", {
443
+ class: "ck-chip",
444
+ onClick: qe,
445
+ children: [/* @__PURE__ */ s("svg", {
446
+ width: "13",
447
+ height: "13",
448
+ viewBox: "0 0 24 24",
449
+ fill: "none",
450
+ stroke: "currentColor",
451
+ "stroke-width": "2",
452
+ "stroke-linecap": "round",
453
+ "stroke-linejoin": "round",
454
+ "aria-hidden": "true",
455
+ children: /* @__PURE__ */ s("path", { d: "M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6" })
456
+ }), l("adjustStyle")]
457
+ }) : null]
458
+ }) : null,
459
+ N && z ? /* @__PURE__ */ s(z, {
460
+ client: e,
461
+ value: F,
462
+ onChange: ze
463
+ }) : null,
464
+ Z || at && !p ? /* @__PURE__ */ s("div", {
465
+ class: "ck-note",
466
+ children: [
467
+ /* @__PURE__ */ s("strong", { children: l(Z ? "guestIntro" : "signInToSend") }),
468
+ /* @__PURE__ */ s("div", { children: l(_ ? "guestExplain" : "signInExplain") }),
469
+ Z ? /* @__PURE__ */ s("div", {
470
+ class: "ck-guest",
471
+ children: [["name", "email"].map((e) => /* @__PURE__ */ s("div", {
472
+ class: "ck-field",
473
+ children: [
474
+ /* @__PURE__ */ s("label", {
475
+ for: `ck-guest-${e}`,
476
+ children: l(e === "name" ? "guestName" : "guestEmail")
477
+ }),
478
+ /* @__PURE__ */ s("input", {
479
+ id: `ck-guest-${e}`,
480
+ ref: lt[e],
481
+ class: "ck-input",
482
+ type: e === "email" ? "email" : "text",
483
+ autoComplete: e,
484
+ maxLength: e === "name" ? 120 : 254,
485
+ value: S[e],
486
+ "aria-invalid": st === e,
487
+ "aria-describedby": st === e ? "ck-guest-error" : void 0,
488
+ onInput: (t) => {
489
+ let n = t.target.value;
490
+ Te((t) => ({
491
+ ...t,
492
+ [e]: n
493
+ }));
494
+ },
495
+ onKeyDown: (e) => {
496
+ e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && $();
497
+ }
498
+ }),
499
+ st === e ? /* @__PURE__ */ s("span", {
500
+ class: "ck-error",
501
+ id: "ck-guest-error",
502
+ role: "alert",
503
+ children: l(e === "name" ? "guestNameMissing" : "guestEmailInvalid")
504
+ }) : null
505
+ ]
506
+ })), /* @__PURE__ */ s("p", {
507
+ class: "ck-muted ck-guest-privacy",
508
+ children: [
509
+ l("guestPrivacy"),
510
+ " ",
511
+ /* @__PURE__ */ s("a", {
512
+ href: je(e.options.endpoint),
513
+ target: "_blank",
514
+ rel: "noopener noreferrer",
515
+ children: l("guestPrivacyLink")
516
+ })
517
+ ]
518
+ })]
519
+ }) : null
520
+ ]
521
+ }) : null,
522
+ j === "capturing" ? /* @__PURE__ */ s("div", {
523
+ class: "ck-shot ck-shot-wait",
524
+ children: /* @__PURE__ */ s("span", {
525
+ class: "ck-muted",
526
+ children: l("capturing")
527
+ })
528
+ }) : null,
529
+ j === "failed" ? /* @__PURE__ */ s("p", {
530
+ class: "ck-muted",
531
+ children: l("capturingFailed")
532
+ }) : null,
533
+ j === "ready" && Fe ? /* @__PURE__ */ s("div", {
534
+ class: "ck-shot",
535
+ children: [/* @__PURE__ */ s("img", {
536
+ src: Fe,
537
+ alt: l("screenshotIncluded"),
538
+ title: l("screenshotIncluded"),
539
+ style: { objectPosition: Ae(d) }
540
+ }), /* @__PURE__ */ s("div", {
541
+ class: "ck-shot-tools",
542
+ children: [A.markup === !1 ? null : /* @__PURE__ */ s("button", {
543
+ class: "ck-chip",
544
+ onClick: () => void import("./MarkupEditor-BFplZwFy.js").then((e) => V(() => e.MarkupEditor), g),
545
+ children: [/* @__PURE__ */ s(f, {
546
+ name: "pen",
547
+ size: 14
548
+ }), l("markup")]
549
+ }), /* @__PURE__ */ s("button", {
550
+ class: "ck-chip",
551
+ onClick: () => M("off"),
552
+ children: l("screenshotRemove")
553
+ })]
554
+ })]
555
+ }) : null,
556
+ j === "off" && T ? /* @__PURE__ */ s("button", {
557
+ class: "ck-chip",
558
+ style: { marginTop: "8px" },
559
+ onClick: () => M("ready"),
560
+ children: [/* @__PURE__ */ s(f, {
561
+ name: "image",
562
+ size: 14
563
+ }), l("screenshotAdd")]
564
+ }) : null,
565
+ nt ? /* @__PURE__ */ s("label", {
566
+ class: "ck-check",
567
+ children: [/* @__PURE__ */ s("input", {
568
+ type: "checkbox",
569
+ checked: rt,
570
+ onChange: (e) => it(e.target.checked)
571
+ }), l("includeDiagnostics")]
572
+ }) : null,
573
+ /* @__PURE__ */ s(pe, {
574
+ items: H.items,
575
+ onRemove: H.remove,
576
+ onRetry: H.retry,
577
+ onOpen: Qe
578
+ })
579
+ ]
580
+ }),
581
+ /* @__PURE__ */ s("div", {
582
+ class: "ck-card-foot",
583
+ children: [
584
+ Re ? /* @__PURE__ */ s(re, {
585
+ input: ut,
586
+ onFiles: mt
587
+ }) : null,
588
+ /* @__PURE__ */ s("span", { class: "ck-spacer" }),
589
+ /* @__PURE__ */ s("button", {
590
+ class: "ck-btn",
591
+ onClick: h,
592
+ children: l("cancel")
593
+ }),
594
+ /* @__PURE__ */ s("button", {
595
+ class: "ck-btn ck-primary",
596
+ disabled: Y || !C.trim() || !X,
597
+ onClick: () => void $(),
598
+ children: l(Y ? "sending" : at && !p ? "signIn" : "send")
599
+ })
600
+ ]
601
+ }),
602
+ Je !== null && Xe ? /* @__PURE__ */ s(Xe, {
603
+ images: H.items.filter((e) => e.preview).map((e) => ({
604
+ src: e.preview,
605
+ name: e.file.name
606
+ })),
607
+ start: Je,
608
+ onClose: () => Ye(null)
609
+ }) : null,
610
+ Ue && T ? /* @__PURE__ */ s(Ue, {
611
+ image: T.blob,
612
+ onCancel: () => V(null),
613
+ onDone: (e, t) => {
614
+ Pe({
615
+ ...T,
616
+ blob: e
617
+ }), He(t), V(null);
618
+ }
619
+ }) : null
620
+ ]
621
+ })] });
622
+ }
623
+ var Oe = "M31.5 4.8C17.3 4.4 7 15.2 7 29c0 13 8.5 21.2 20.9 23 1.6.2 2.1 1.2 2.1 2.5v6.9c0 1.7 1.2 2.1 2.5.9 5.7-4.9 16-13.6 21.1-22.1 3.5-5.8 4.7-11.8 3.2-18.1C54.3 11.5 44.7 4.6 31.5 4.8Z";
624
+ function ke(e) {
625
+ let t = {};
626
+ return e.priority && e.priority !== "none" && (t.priority = e.priority), e.assignee_ids?.length && (t.assignee_ids = e.assignee_ids), e.label_ids?.length && (t.label_ids = e.label_ids), Object.keys(t).length ? t : void 0;
627
+ }
628
+ function Ae(e) {
629
+ return e.region ? "50% 50%" : `50% ${Math.round(Math.min(100, Math.max(0, e.point.y / Math.max(1, innerHeight) * 100)))}%`;
630
+ }
631
+ var E = "commentkit:pending-extras";
632
+ function je(e) {
633
+ try {
634
+ return `${new URL(e ?? "https://commentkit.dev").origin}/privacy`;
635
+ } catch {
636
+ return "https://commentkit.dev/privacy";
637
+ }
638
+ }
639
+ var D = "commentkit:guest-details";
640
+ function Me() {
641
+ try {
642
+ let e = JSON.parse(sessionStorage.getItem(D) ?? "null"), t = (e, t) => typeof e == "string" ? e.slice(0, t) : "";
643
+ return {
644
+ name: t(e?.name, 120),
645
+ email: t(e?.email, 254)
646
+ };
647
+ } catch {
648
+ return {
649
+ name: "",
650
+ email: ""
651
+ };
652
+ }
653
+ }
654
+ function Ne(e) {
655
+ try {
656
+ let t = JSON.parse(sessionStorage.getItem(E) ?? "null");
657
+ return sessionStorage.removeItem(E), !t || t.id !== e ? null : {
658
+ checklist: Array.isArray(t.checklist) ? t.checklist.filter((e) => typeof e == "string").slice(0, 30) : null,
659
+ task: t.task && typeof t.task == "object" ? t.task : {},
660
+ markup: Array.isArray(t.markup) ? t.markup.filter((e) => !!e && typeof e == "object" && Array.isArray(e.points)).slice(0, 100) : [],
661
+ styles: se(t.styles)
662
+ };
663
+ } catch {
664
+ return null;
665
+ }
666
+ }
667
+ function O(e, t) {
668
+ try {
669
+ sessionStorage.setItem(e, t);
670
+ } catch {}
671
+ }
672
+ function k(e) {
673
+ try {
674
+ sessionStorage.removeItem(e);
675
+ } catch {}
676
+ }
677
+ export { T as Composer, m as t, v as warmCapture };