@commentkit/comment-kit 2.1.1 → 2.1.2

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 (49) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/npm/chunks/{AgentSend-B4rxdY68.js → AgentSend-DhG61w_r.js} +2 -2
  3. package/dist/npm/chunks/{Checklist-Cy68X5qC.js → Checklist-C2q5KzWe.js} +8 -7
  4. package/dist/npm/chunks/{Composer-D65l6Jg4.js → Composer-Dj0YAYOR.js} +27 -26
  5. package/dist/npm/chunks/{DatePicker-BPzzqW3f.js → DatePicker-TshUaQHj.js} +1 -1
  6. package/dist/npm/chunks/{Guest-C-ZhARI0.js → Guest-bAxvxjbL.js} +4 -3
  7. package/dist/npm/chunks/{MarkupEditor-BOb2jFTR.js → MarkupEditor-DnViTOOC.js} +2 -1
  8. package/dist/npm/chunks/{Panel-DgdCgaC-.js → Panel-C3_NURrp.js} +109 -108
  9. package/dist/npm/chunks/{Settings-BbWu2Rd5.js → Settings-BM7pWbwd.js} +18 -17
  10. package/dist/npm/chunks/{Shortcuts-C5wEx-Mq.js → Shortcuts-CFDTnP5H.js} +3 -3
  11. package/dist/npm/chunks/{SignInFirst-BlMbutED.js → SignInFirst-CeiPhLx0.js} +3 -3
  12. package/dist/npm/chunks/{StyleEditor-BN2z7mUs.js → StyleEditor-BUZrhAY6.js} +2 -2
  13. package/dist/npm/chunks/{StylePanel-BZk-r-kl.js → StylePanel-CFp-U7qa.js} +2 -2
  14. package/dist/npm/chunks/TaskFields-C4GddJTi.js +652 -0
  15. package/dist/npm/chunks/{ThreadCard-xKy4JbXK.js → ThreadCard-CwClbMNh.js} +60 -59
  16. package/dist/npm/chunks/{Viewer-DL6M3wAT.js → Viewer-oM3stPeq.js} +1 -1
  17. package/dist/npm/chunks/{agent-D1VQvc14.js → agent-DfUu5BAp.js} +1 -1
  18. package/dist/npm/chunks/{card-bits-B94SwnS9.js → card-bits-BXOCnmcQ.js} +2 -2
  19. package/dist/npm/chunks/{client-CULjcQxz.js → client-BqcfSisZ.js} +7 -7
  20. package/dist/npm/chunks/{confetti-K_xKxQGa.js → confetti-CM1XHlrM.js} +1 -1
  21. package/dist/npm/chunks/{dpop-DpxIN5kL.js → dpop-CHzhM9ud.js} +1 -1
  22. package/dist/npm/chunks/{entrance-CO0AzUKy.js → entrance-D7kmBxF3.js} +29 -29
  23. package/dist/npm/chunks/{extension-DpfiPOjC.js → extension-PWW2UQD7.js} +1 -1
  24. package/dist/npm/chunks/{extension-faFfCApb.js → extension-TF7pIF_W.js} +2 -2
  25. package/dist/npm/chunks/{identify-963WDKul.js → identify-CoQ4rxaI.js} +1 -1
  26. package/dist/npm/chunks/{live-BI72WQBA.js → live-HKWO5Tsg.js} +5 -5
  27. package/dist/npm/chunks/{page-key-CW8Mtf60.js → page-key-z6o1r8Uu.js} +1 -1
  28. package/dist/npm/chunks/{pick-BRhngGMq.js → pick-Bai3lMZX.js} +1 -1
  29. package/dist/npm/chunks/{pkce-BEeLAZhN.js → pkce-B6VU0dtv.js} +1 -1
  30. package/dist/npm/chunks/{report-DAzQvgUh.js → report-D-yxx5uK.js} +1 -1
  31. package/dist/npm/chunks/sheet-77GHVTpR.js +18 -0
  32. package/dist/npm/chunks/{show-Ka3g4eCJ.js → show-C3bJFyaD.js} +11 -9
  33. package/dist/npm/chunks/{signin-Car5vP1U.js → signin-Bq2KYFLY.js} +3 -3
  34. package/dist/npm/chunks/{source-dd_it90W.js → source-W_nJm3Ym.js} +1 -1
  35. package/dist/npm/chunks/{src-fTYV50pw.js → src-BFu9DgRc.js} +57 -52
  36. package/dist/npm/chunks/{start-CE5eR33Z.js → start-Dgw3mSp8.js} +428 -429
  37. package/dist/npm/chunks/{upload-Dcv9CCly.js → upload-b0nY04eW.js} +1 -1
  38. package/dist/npm/chunks/{uploads-CmeoNVO2.js → uploads-Df4mLJ9O.js} +21 -20
  39. package/dist/npm/chunks/waiting-BRtT3ZZT.js +54 -0
  40. package/dist/npm/chunks/{wrap-B0mzrRhc.js → wrap-BuWw3zAq.js} +1 -1
  41. package/dist/npm/element.js +1 -1
  42. package/dist/npm/headless.js +2 -2
  43. package/dist/npm/index.js +2 -2
  44. package/dist/npm/react.js +1 -1
  45. package/dist/npm/svelte.js +1 -1
  46. package/dist/npm/types/core/client.d.ts +2 -0
  47. package/dist/npm/vue.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/npm/chunks/TaskFields-B2-YvIwV.js +0 -617
@@ -1,10 +1,10 @@
1
- import { c as e } from "./start-CE5eR33Z.js";
1
+ import { t as e } from "./sheet-77GHVTpR.js";
2
2
  // src/ui/entrance.ts
3
3
  e(".ck-ring{position:fixed;z-index:var(--ck-z);border-radius:var(--ck-radius-pill);outline:2px solid var(--ck-accent);pointer-events:none;opacity:0}.ck-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}");
4
4
  var t = 140, n = 180, r = 420, i = 500, a = 1500, o = "cubic-bezier(0.22, 1, 0.36, 1)";
5
- function s(e, t, n) {
5
+ function s(e, t, n, r = !1) {
6
6
  try {
7
- return c(e, t, n);
7
+ return c(e, t, n, r);
8
8
  } catch {
9
9
  return e.dataset.entering = "done", {
10
10
  stop() {},
@@ -12,28 +12,28 @@ function s(e, t, n) {
12
12
  };
13
13
  }
14
14
  }
15
- function c(e, t, n) {
16
- let r = e.querySelector(".ck-bar") ?? e, i = matchMedia("(prefers-reduced-motion: reduce)").matches, s = e.getBoundingClientRect(), c = `translate(${Math.round(innerWidth / 2 - (s.left + s.width / 2))}px, ${Math.round(innerHeight * .4 - (s.top + s.height / 2))}px)`;
15
+ function c(e, t, n, r) {
16
+ let i = e.querySelector(".ck-bar") ?? e, s = matchMedia("(prefers-reduced-motion: reduce)").matches, c = e.getBoundingClientRect(), l = `translate(${Math.round(innerWidth / 2 - (c.left + c.width / 2))}px, ${Math.round(innerHeight * .4 - (c.top + c.height / 2))}px)`;
17
17
  e.dataset.entering = "run";
18
- let l = i ? e.animate([{ opacity: 0 }, { opacity: 1 }], {
18
+ let u = s || r ? e.animate([{ opacity: 0 }, { opacity: 1 }], {
19
19
  duration: 140,
20
20
  easing: "ease-out"
21
21
  }) : e.animate([
22
22
  {
23
23
  offset: 0,
24
24
  opacity: 0,
25
- transform: c,
25
+ transform: l,
26
26
  easing: "ease-out"
27
27
  },
28
28
  {
29
29
  offset: 140 / 740,
30
30
  opacity: 1,
31
- transform: c
31
+ transform: l
32
32
  },
33
33
  {
34
34
  offset: 320 / 740,
35
35
  opacity: 1,
36
- transform: c,
36
+ transform: l,
37
37
  easing: o
38
38
  },
39
39
  {
@@ -41,38 +41,38 @@ function c(e, t, n) {
41
41
  opacity: 1,
42
42
  transform: "none"
43
43
  }
44
- ], { duration: 740 }), u = null, d = null, f, p = new Promise((e) => f = e), m = !1, h = (t) => {
45
- if (!m) {
46
- m = !0;
47
- for (let [e, t] of _) removeEventListener(e, t, !0);
48
- t && l.finish(), d?.cancel(), u?.remove(), e.dataset.entering = "done", f();
44
+ ], { duration: 740 }), d = null, f = null, p, m = new Promise((e) => p = e), h = !1, g = (t) => {
45
+ if (!h) {
46
+ h = !0;
47
+ for (let [e, t] of v) removeEventListener(e, t, !0);
48
+ t && u.finish(), f?.cancel(), d?.remove(), e.dataset.entering = "done", p();
49
49
  }
50
- }, g = !1, _ = [
51
- ["pointerdown", (t) => t.composedPath().includes(e) ? (g = !0, l.pause(), d?.pause()) : h(!0)],
52
- ["pointerup", () => g && setTimeout(() => h(!0))],
53
- ["pointercancel", () => g && h(!0)],
50
+ }, _ = !1, v = [
51
+ ["pointerdown", (t) => t.composedPath().includes(e) ? (_ = !0, u.pause(), f?.pause()) : g(!0)],
52
+ ["pointerup", () => _ && setTimeout(() => g(!0))],
53
+ ["pointercancel", () => _ && g(!0)],
54
54
  ["keydown", (e) => {
55
55
  let t = e;
56
- !t.repeat && !/^(Shift|Control|Alt|Meta|OS)$/.test(t.key) && h(!0);
56
+ !t.repeat && !/^(Shift|Control|Alt|Meta|OS)$/.test(t.key) && g(!0);
57
57
  }]
58
58
  ];
59
- for (let [e, t] of _) addEventListener(e, t, !0);
60
- return l.onfinish = () => {
61
- if (m) return;
62
- let t = r.getBoundingClientRect(), n = e.getRootNode();
63
- u = document.createElement("div"), u.className = "ck-ring", u.setAttribute("aria-hidden", "true"), Object.assign(u.style, {
59
+ for (let [e, t] of v) addEventListener(e, t, !0);
60
+ return u.onfinish = () => {
61
+ if (h) return;
62
+ let t = i.getBoundingClientRect(), n = e.getRootNode();
63
+ d = document.createElement("div"), d.className = "ck-ring", d.setAttribute("aria-hidden", "true"), Object.assign(d.style, {
64
64
  left: `${t.left}px`,
65
65
  top: `${t.top}px`,
66
66
  width: `${t.width}px`,
67
67
  height: `${t.height}px`
68
- }), n.appendChild(u), d = i ? u.animate([
68
+ }), n.appendChild(d), f = s ? d.animate([
69
69
  { opacity: 1 },
70
70
  {
71
71
  opacity: 1,
72
72
  offset: a / 1800
73
73
  },
74
74
  { opacity: 0 }
75
- ], { duration: 1800 }) : u.animate([{
75
+ ], { duration: 1800 }) : d.animate([{
76
76
  opacity: 1,
77
77
  outlineOffset: "0px"
78
78
  }, {
@@ -81,10 +81,10 @@ function c(e, t, n) {
81
81
  }], {
82
82
  duration: 500,
83
83
  easing: "ease-out"
84
- }), d.onfinish = () => h(!1);
84
+ }), f.onfinish = () => g(!1);
85
85
  }, t && (e.querySelector(".ck-bar-btn")?.focus({ preventScroll: !0 }), n()), {
86
- stop: () => h(!0),
87
- done: p
86
+ stop: () => g(!0),
87
+ done: m
88
88
  };
89
89
  }
90
90
  export { t as FADE, n as HOLD, i as RING, a as STILL_RING, r as TRAVEL, s as enter };
@@ -1,5 +1,5 @@
1
1
  import { c as e, n as t, r as n } from "./privacy-BWUGlHw5.js";
2
- import { askExtension as r } from "./extension-faFfCApb.js";
2
+ import { askExtension as r } from "./extension-TF7pIF_W.js";
3
3
  // src/capture/extension.ts
4
4
  var i = 8e6, a = "[data-commentkit-host]", o = "#d4d4d8";
5
5
  function s(n = [], r = !1) {
@@ -1,5 +1,5 @@
1
- import { b as e } from "./client-CULjcQxz.js";
2
- import { t } from "./pkce-BEeLAZhN.js";
1
+ import { b as e } from "./client-BqcfSisZ.js";
2
+ import { t } from "./pkce-B6VU0dtv.js";
3
3
  // src/core/extension.ts
4
4
  var n = "commentkit:ext-request", r = "The CommentKit extension did not answer.", i = null, a = /* @__PURE__ */ new Map();
5
5
  function o() {
@@ -1,4 +1,4 @@
1
- import { _ as e, g as t, i as n, v as r } from "./client-CULjcQxz.js";
1
+ import { _ as e, g as t, i as n, v as r } from "./client-BqcfSisZ.js";
2
2
  import { t as i } from "./locale-D8Q4Q2Nt.js";
3
3
  // src/core/identify.ts
4
4
  var a = "See https://commentkit.dev/docs/identify", o = {
@@ -1,6 +1,6 @@
1
- import { o as e } from "./client-CULjcQxz.js";
1
+ import { o as e } from "./client-BqcfSisZ.js";
2
2
  import { a as t, i as n, n as r, r as i } from "./drafts-B0ctr1g9.js";
3
- import { d as a, p as o, u as s } from "./start-CE5eR33Z.js";
3
+ import { f as a, l as o, u as s } from "./start-Dgw3mSp8.js";
4
4
  // src/ui/live.ts
5
5
  var c = 1500, l = 1e4;
6
6
  function u(e, t, n, r = Math.random) {
@@ -59,7 +59,7 @@ function m() {
59
59
  try {
60
60
  e = JSON.parse(n("commentkit:pending-compose") ?? "null");
61
61
  } catch {}
62
- n("commentkit:pending-compose", null), e?.draft?.anchor && n(o, "1");
62
+ n("commentkit:pending-compose", null), e?.draft?.anchor && n(a, "1");
63
63
  let t = i("commentkit:pending-thread");
64
64
  i("commentkit:pending-thread", null);
65
65
  let r = (e) => {
@@ -69,8 +69,8 @@ function m() {
69
69
  return {
70
70
  ...e?.draft?.anchor ? e : null,
71
71
  thread: t,
72
- comment: r(s),
73
- inbox: r(a)
72
+ comment: r(o),
73
+ inbox: r(s)
74
74
  };
75
75
  }
76
76
  function h(e, a) {
@@ -1,4 +1,4 @@
1
- import { u as e } from "./client-CULjcQxz.js";
1
+ import { u as e } from "./client-BqcfSisZ.js";
2
2
  // src/core/page-key.ts
3
3
  var t = [
4
4
  "gclid",
@@ -105,7 +105,7 @@ function _() {
105
105
  }
106
106
  var v = null, y = !1;
107
107
  function b() {
108
- r(), !y && _() && (y = !0, import("./source-dd_it90W.js").then((e) => v = e.readSource, () => y = !1));
108
+ r(), !y && _() && (y = !0, import("./source-W_nJm3Ym.js").then((e) => v = e.readSource, () => y = !1));
109
109
  }
110
110
  function x(e) {
111
111
  let t = null;
@@ -1,4 +1,4 @@
1
- import { v as e, y as t } from "./client-CULjcQxz.js";
1
+ import { v as e, y as t } from "./client-BqcfSisZ.js";
2
2
  // src/core/pkce.ts
3
3
  async function n(n) {
4
4
  if (!crypto.subtle) throw new e(0, "insecure_context", "Sign-in needs this page to be on https.");
@@ -1,4 +1,4 @@
1
- import { d as e, i as t, n } from "./client-CULjcQxz.js";
1
+ import { d as e, i as t, n } from "./client-BqcfSisZ.js";
2
2
  // src/core/report.ts
3
3
  var r = 0;
4
4
  function i(r, i) {
@@ -0,0 +1,18 @@
1
+ // src/ui/sheet.ts
2
+ var e = [], t = null;
3
+ function n(n) {
4
+ t = n, n && e.forEach((e) => i(n, e));
5
+ }
6
+ function r(n) {
7
+ e.includes(n) || (e.push(n), t && i(t, n));
8
+ }
9
+ function i(e, t) {
10
+ if ("adoptedStyleSheets" in e && "replaceSync" in CSSStyleSheet.prototype) {
11
+ let n = new CSSStyleSheet();
12
+ n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n];
13
+ } else {
14
+ let n = document.createElement("style");
15
+ n.textContent = t, e.insertBefore(n, e.querySelector(".ck-root"));
16
+ }
17
+ }
18
+ export { n, r as t };
@@ -1,6 +1,6 @@
1
- import { a as e, i as t, n, o as r, r as i } from "./src-fTYV50pw.js";
2
- import { i as a, l as o, v as s } from "./client-CULjcQxz.js";
3
- import { n as c } from "./page-key-CW8Mtf60.js";
1
+ import { a as e, i as t, n, o as r, r as i } from "./src-BFu9DgRc.js";
2
+ import { i as a, l as o, v as s } from "./client-BqcfSisZ.js";
3
+ import { n as c } from "./page-key-z6o1r8Uu.js";
4
4
  // src/core/show.ts
5
5
  var l;
6
6
  function u() {
@@ -23,8 +23,8 @@ async function m(i, a, o, s, m, v, y = () => void 0) {
23
23
  if (x && !i.auth.hasSession() && !e()) return y(), null;
24
24
  if (!a.enabled && !b && !x) return null;
25
25
  c.ignore(a.pages?.ignored_query_params);
26
- let S = n(() => import("./start-CE5eR33Z.js").then((e) => e.t)), C = S.then((e) => e.setLocale(i.options.locale));
27
- if (S.catch(() => void 0), C.catch(() => void 0), await i.auth.completeRedirect().catch(() => !1), e() && await import("./extension-faFfCApb.js").then((e) => e.extensionHandoff(i.auth)).catch(() => !1), v && a.enabled && await import("./identify-963WDKul.js").then((e) => e.identify(i, v, null, !0)).catch(() => !1), await i.loadSession().catch(() => null), i.state.get().session || h(i.options.project), x && !p(i)) return y(), null;
26
+ let S = n(() => import("./start-Dgw3mSp8.js").then((e) => e.t)), C = S.then((e) => e.setLocale(i.options.locale));
27
+ if (S.catch(() => void 0), C.catch(() => void 0), await i.auth.completeRedirect().catch(() => !1), e() && await import("./extension-TF7pIF_W.js").then((e) => e.extensionHandoff(i.auth)).catch(() => !1), v && a.enabled && await import("./identify-CoQ4rxaI.js").then((e) => e.identify(i, v, null, !0)).catch(() => !1), await i.loadSession().catch(() => null), i.state.get().session || h(i.options.project), x && !p(i)) return y(), null;
28
28
  let w = await S, { installDiagnostics: T, mountWidget: E } = w;
29
29
  if (x && Object.assign(w.en, (await import("./late-words-QnNheaDY.js").then((e) => e.n)).LATE), await C, s()) return null;
30
30
  let D = T({
@@ -39,11 +39,13 @@ async function m(i, a, o, s, m, v, y = () => void 0) {
39
39
  } catch (e) {
40
40
  throw D(), e;
41
41
  }
42
- let A = setTimeout(g, 3e4, null), j = _(i, b, m, y), M = i.state.get().config, N = i.state.subscribe((e) => {
43
- e.config && e.config !== M && c.ignore((M = e.config).pages?.ignored_query_params);
42
+ let A = setTimeout(g, 3e4, null), j = setTimeout(() => {
43
+ i.wait?.(), i.wait = void 0;
44
+ }, 1600), M = _(i, b, m, y), N = i.state.get().config, P = i.state.subscribe((e) => {
45
+ e.config && e.config !== N && c.ignore((N = e.config).pages?.ignored_query_params);
44
46
  });
45
47
  return i.emit("ready", { session: i.state.get().session }), Object.assign(() => {
46
- clearTimeout(A), j(), N();
48
+ clearTimeout(A), clearTimeout(j), i.wait?.(), M(), P();
47
49
  for (let e of [k, D]) try {
48
50
  e();
49
51
  } catch (e) {
@@ -82,7 +84,7 @@ function v(e, t) {
82
84
  console.warn(r ? `[CommentKit] The widget could not start: ${t.message} (${t.code}). See https://commentkit.dev/docs/errors#${t.code}` : "[CommentKit] The widget could not start; your page is not affected. See https://commentkit.dev/docs/troubleshooting", t), r && e.emit("error", { error: t }), (!r || t.status >= 500) && e.reportCrash(t, "start");
83
85
  }
84
86
  function y(e, t) {
85
- import("./report-DAzQvgUh.js").then((n) => n.reportStart(e, t)).catch(() => void 0);
87
+ import("./report-D-yxx5uK.js").then((n) => n.reportStart(e, t)).catch(() => void 0);
86
88
  }
87
89
  var b = "See https://commentkit.dev/docs/";
88
90
  function x(e, ...t) {
@@ -1,6 +1,6 @@
1
- import { b as e } from "./client-CULjcQxz.js";
2
- import { r as t } from "./page-key-CW8Mtf60.js";
3
- import { t as n } from "./pkce-BEeLAZhN.js";
1
+ import { b as e } from "./client-BqcfSisZ.js";
2
+ import { r as t } from "./page-key-z6o1r8Uu.js";
3
+ import { t as n } from "./pkce-B6VU0dtv.js";
4
4
  import { t as r } from "./locale-D8Q4Q2Nt.js";
5
5
  // src/core/signin.ts
6
6
  function i(e = navigator.userAgent) {
@@ -1,4 +1,4 @@
1
- import { f as e } from "./client-CULjcQxz.js";
1
+ import { f as e } from "./client-BqcfSisZ.js";
2
2
  // src/anchor/source.ts
3
3
  var t = /^[A-Za-z_$][\w$.-]*$/, n = /* @__PURE__ */ new Set([
4
4
  "src",
@@ -1,4 +1,4 @@
1
- import { a as e, d as t, i as n, p as r, s as i, t as a } from "./client-CULjcQxz.js";
1
+ import { a as e, d as t, i as n, p as r, s as i, t as a } from "./client-BqcfSisZ.js";
2
2
  // src/activation.ts
3
3
  var o = "commentkit:active", s = "data-commentkit-extension";
4
4
  function c() {
@@ -62,7 +62,7 @@ function S(e, t, ...n) {
62
62
  b[e] || (b[e] = 1, console.warn(`[CommentKit] ${t}`, ...n));
63
63
  }
64
64
  function C(e, ...t) {
65
- b[e] || (b[e] = 1, import("./show-Ka3g4eCJ.js").then((n) => n.explain(e, ...t)).catch(E));
65
+ b[e] || (b[e] = 1, import("./show-C3bJFyaD.js").then((n) => n.explain(e, ...t)).catch(E));
66
66
  }
67
67
  function w() {
68
68
  let e = (e) => typeof e == "string" && e.trim() ? e.trim().slice(0, 255) : null;
@@ -83,18 +83,23 @@ function w() {
83
83
  }
84
84
  function T(e) {
85
85
  let t = f("signin"), n = f("code", 1);
86
- if (typeof window > "u") return M(e);
86
+ if (typeof window > "u") return N(e);
87
87
  try {
88
88
  let r = t ?? e?._signin;
89
- if (r != null && (v = r), y = n ?? e?._finish ?? y, _) return e?.project !== _.project && C("project", e?.project, _.project), _.client.auth.takeSignInLink(v), v = null, k(_);
90
- let i = A(e);
91
- return typeof i == "string" ? M(e, i) : (_ = i, k(i));
89
+ if (r != null && (v = r), y = n ?? e?._finish ?? y, _) return e?.project !== _.project && C("project", e?.project, _.project), _.client.auth.takeSignInLink(v), v = null, A(_);
90
+ let i = j(e);
91
+ return typeof i == "string" ? N(e, i) : (_ = i, A(i));
92
92
  } catch (t) {
93
- return console.warn("[CommentKit] The widget could not start because of an error inside CommentKit; your page is not affected. See https://commentkit.dev/docs/troubleshooting", t), import("./show-Ka3g4eCJ.js").then((n) => n.reportStart(e, t)).catch(E), M(e);
93
+ return console.warn("[CommentKit] The widget could not start because of an error inside CommentKit; your page is not affected. See https://commentkit.dev/docs/troubleshooting", t), import("./show-C3bJFyaD.js").then((n) => n.reportStart(e, t)).catch(E), N(e);
94
94
  }
95
95
  }
96
- var E = () => void 0, D = (e) => (t) => S(e, `${e}() failed.`, t), O = (e, t) => (...n) => t(...n).then(E, D(e));
97
- function k(e) {
96
+ var E = () => void 0;
97
+ function D(e) {
98
+ let t, n, r = performance.now();
99
+ return import("./waiting-BRtT3ZZT.js").then((i) => n || (t = i.waiting(e, r)), E), () => (n = 1, !!t?.());
100
+ }
101
+ var O = (e) => (t) => S(e, `${e}() failed.`, t), k = (e, t) => (...n) => t(...n).then(E, O(e));
102
+ function A(e) {
98
103
  e.refs++;
99
104
  let t = !0, n = /* @__PURE__ */ new Set();
100
105
  return {
@@ -111,84 +116,84 @@ function k(e) {
111
116
  _m: e.started
112
117
  };
113
118
  }
114
- function A(e) {
119
+ function j(e) {
115
120
  if (!e?.project || !t.test(e.project)) return C("key", !!e?.project), "bad project key";
116
121
  let o = document;
117
122
  if (o[x]) return C("copy", o[x]), "second copy";
118
123
  let s = w(), { _key: l, _signin: f, _finish: m, identity: b, ...S } = e, T = {
119
124
  ...S,
120
125
  ...r(e.branch || s.branch, e.commit || s.commit)
121
- }, k = new a(T), A = null, j = null, M = !1, N = !1, P = !!l;
122
- l && (k.entrance = "key");
123
- let F = k.auth.takeSignInLink(v) || !!(k.auth.finishLink = y);
126
+ }, A = new a(T), j = null, M = null, N = !1, P = !1, F = !!l;
127
+ l && (A.entrance = "key");
128
+ let I = A.auth.takeSignInLink(v) || !!(A.auth.finishLink = y);
124
129
  v = y = null;
125
- let I = 0, L, R = (e) => (e === !0 && (N = !0), N && A?.attach?.(), M || A ? Promise.resolve() : (j ?? (j = (async (e) => {
126
- let t = () => e !== I, n = g(() => import("./show-Ka3g4eCJ.js"));
127
- n.catch(E);
130
+ let L = 0, R, z = (e) => (e === !0 && (P = !0), P && j?.attach?.(), N || j ? Promise.resolve() : (M ?? (M = (async (e) => {
131
+ let t = () => e !== L, n = g(() => import("./show-C3bJFyaD.js"));
132
+ n.catch(E), A.entrance && (import("./start-Dgw3mSp8.js").then((e) => e.t).catch(E), import("./entrance-D7kmBxF3.js").catch(E));
128
133
  try {
129
- let e = await k.loadConfig();
134
+ let e = await A.loadConfig();
130
135
  if (t()) return;
131
- A = await (await n).mount(k, e, F, t, z, b, () => L = setTimeout(R, 6e4)), N && A?.attach?.(), A && P && d(!0);
136
+ j = await (await n).mount(A, e, I, t, B, b, () => R = setTimeout(z, 6e4)), P && j?.attach?.(), j && F && d(!0);
132
137
  } catch (e) {
133
- await n.then((t) => t.failed(k, e), D("show"));
138
+ await n.then((t) => t.failed(A, e), O("show"));
134
139
  } finally {
135
- t() || (j = null);
140
+ t() || (M = null), j || (A.wait = void A.wait?.());
136
141
  }
137
- })(I)), j)), z = () => {
138
- clearTimeout(L), I++, N = !1, j = null, A?.(), A = null;
139
- }, B = T.toggleShortcut === !1 ? E : p(() => {
142
+ })(L)), M)), B = () => {
143
+ clearTimeout(R), L++, P = !1, M = null, j?.(), j = null, A.wait = void A.wait?.();
144
+ }, V = T.toggleShortcut === !1 ? E : p(() => {
140
145
  try {
141
- return A ? (k.state.set({ request: {
146
+ return j ? (A.wait || A.state.set({ request: {
142
147
  kind: "inbox",
143
148
  at: Date.now()
144
- } }), !0) : (P = !0, k.entrance = "key", R(!0), !0);
149
+ } }), !0) : (F = !0, A.entrance = "key", A.wait ?? (A.wait = D(A.options)), z(!0), !0);
145
150
  } catch (e) {
146
- D("shortcut")(e);
151
+ O("shortcut")(e);
147
152
  }
148
153
  });
149
- c() && import("./extension-faFfCApb.js").then((e) => e.extensionHello()).catch(() => void 0);
150
- let V = F || P || u(T.project, T.hideOnProduction ?? !0) || !!b;
151
- V && !F && !P && h() >= 3 && (V = !1, C("cooling")), V && !k.auth.hasSession() && k.prefetchSignIn();
152
- let H = V ? R().then(() => !!A) : Promise.resolve(!1), U = {
153
- show: () => R(!0),
154
- hide: z,
155
- open: O("open", async (e) => {
156
- k.state.set({ opening: String(e).slice(0, 64) }), await R(!0);
154
+ c() && import("./extension-TF7pIF_W.js").then((e) => e.extensionHello()).catch(() => void 0);
155
+ let H = I || F || u(T.project, T.hideOnProduction ?? !0) || !!b;
156
+ H && !I && !F && h() >= 3 && (H = !1, C("cooling")), H && !A.auth.hasSession() && A.prefetchSignIn();
157
+ let U = H ? z().then(() => !!j) : Promise.resolve(!1), W = {
158
+ show: () => z(!0),
159
+ hide: B,
160
+ open: k("open", async (e) => {
161
+ A.state.set({ opening: String(e).slice(0, 64) }), await z(!0);
157
162
  }),
158
- comment: O("comment", async (e = !0) => {
159
- e && (P = !0), await R(e), e && A && d(!0), k.state.set({ request: {
163
+ comment: k("comment", async (e = !0) => {
164
+ e && (F = !0), await z(e), e && j && d(!0), A.state.set({ request: {
160
165
  kind: e ? "comment" : "stop",
161
166
  at: Date.now()
162
167
  } });
163
168
  }),
164
- signIn: async () => await k.signIn() === "signed_in",
165
- identify: (e) => import("./identify-963WDKul.js").then((t) => t.identify(k, e, R)).catch(() => !1),
166
- signOut: O("signOut", () => k.signOut()),
167
- session: () => i(k.state.get().session)
169
+ signIn: async () => await A.signIn() === "signed_in",
170
+ identify: (e) => import("./identify-CoQ4rxaI.js").then((t) => t.identify(A, e, z)).catch(() => !1),
171
+ signOut: k("signOut", () => A.signOut()),
172
+ session: () => i(A.state.get().session)
168
173
  };
169
174
  Object.defineProperty(o, x, {
170
175
  value: n,
171
176
  configurable: !0
172
177
  });
173
- let W = {
178
+ let G = {
174
179
  project: T.project,
175
- client: k,
180
+ client: A,
176
181
  refs: 0,
177
- started: H,
178
- api: U,
182
+ started: U,
183
+ api: W,
179
184
  destroy() {
180
- M = !0, z(), B(), v = k.auth.signInLink, y = k.auth.finishLink, delete o[x], _ === W && (_ = null);
185
+ N = !0, B(), V(), v = A.auth.signInLink, y = A.auth.finishLink, delete o[x], _ === G && (_ = null);
181
186
  try {
182
- k.destroy();
187
+ A.destroy();
183
188
  } catch (e) {
184
- D("destroy")(e);
189
+ O("destroy")(e);
185
190
  }
186
191
  }
187
192
  };
188
- return W;
193
+ return G;
189
194
  }
190
- var j = () => new Proxy(() => Promise.resolve(), { get: (e, t) => t === "then" ? void 0 : t === Symbol.toPrimitive ? () => "" : j() });
191
- function M(t, n) {
195
+ var M = () => new Proxy(() => Promise.resolve(), { get: (e, t) => t === "then" ? void 0 : t === Symbol.toPrimitive ? () => "" : M() });
196
+ function N(t, n) {
192
197
  let r = async () => void 0, i = async () => !1, a = () => E, o = e(), s = t ?? {}, c = {
193
198
  options: s,
194
199
  state: {
@@ -201,7 +206,7 @@ function M(t, n) {
201
206
  endpoint: String(s.endpoint ?? "https://commentkit.dev").replace(/\/+$/, "")
202
207
  };
203
208
  return {
204
- client: new Proxy(c, { get: (e, t) => t in e ? e[t] : t === "then" ? void 0 : j() }),
209
+ client: new Proxy(c, { get: (e, t) => t in e ? e[t] : t === "then" ? void 0 : M() }),
205
210
  show: r,
206
211
  hide: E,
207
212
  open: r,
@@ -214,7 +219,7 @@ function M(t, n) {
214
219
  destroy: E,
215
220
  ...n ? { _r() {
216
221
  let e = n && /* @__PURE__ */ Error(`init() stayed off: ${n}`);
217
- n = void 0, e && import("./show-Ka3g4eCJ.js").then((n) => n.reportStart(t, e)).catch(E);
222
+ n = void 0, e && import("./show-C3bJFyaD.js").then((n) => n.reportStart(t, e)).catch(E);
218
223
  } } : {}
219
224
  };
220
225
  }