@roudanio/awesome-comment 0.4.2 → 0.4.4

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.
@@ -930,8 +930,8 @@ function Mn(e) {
930
930
  ctx: b,
931
931
  inheritAttrs: w
932
932
  } = e;
933
- let I, O;
934
- const T = un(e);
933
+ let I, T;
934
+ const O = un(e);
935
935
  try {
936
936
  if (n.shapeFlag & 4) {
937
937
  const A = s || o;
@@ -945,7 +945,7 @@ function Mn(e) {
945
945
  p,
946
946
  b
947
947
  )
948
- ), O = a;
948
+ ), T = a;
949
949
  } else {
950
950
  const A = t;
951
951
  I = Ae(
@@ -957,20 +957,20 @@ function Mn(e) {
957
957
  null
958
958
  /* we know it doesn't need it */
959
959
  )
960
- ), O = t.props ? a : Zr(a);
960
+ ), T = t.props ? a : Zr(a);
961
961
  }
962
962
  } catch (A) {
963
963
  Nt.length = 0, kn(A, e, 1), I = Oe(ct);
964
964
  }
965
965
  let R = I;
966
- if (O && w !== !1) {
967
- const A = Object.keys(O), { shapeFlag: W } = R;
968
- A.length && W & 7 && (r && A.some(lo) && (O = Vr(
969
- O,
966
+ if (T && w !== !1) {
967
+ const A = Object.keys(T), { shapeFlag: H } = R;
968
+ A.length && H & 7 && (r && A.some(lo) && (T = Vr(
969
+ T,
970
970
  r
971
- )), R = vt(R, O));
971
+ )), R = vt(R, T));
972
972
  }
973
- return n.dirs && (R = vt(R), R.dirs = R.dirs ? R.dirs.concat(n.dirs) : n.dirs), n.transition && (R.transition = n.transition), I = R, un(T), I;
973
+ return n.dirs && (R = vt(R), R.dirs = R.dirs ? R.dirs.concat(n.dirs) : n.dirs), n.transition && (R.transition = n.transition), I = R, un(O), I;
974
974
  }
975
975
  const Zr = (e) => {
976
976
  let t;
@@ -1051,7 +1051,7 @@ function ci(e, t, { immediate: n, deep: o, flush: s, onTrack: i, onTrigger: r }
1051
1051
  l = () => ot(A());
1052
1052
  }
1053
1053
  let p, g = (A) => {
1054
- p = T.onStop = () => {
1054
+ p = O.onStop = () => {
1055
1055
  Xe(A, a, 4);
1056
1056
  };
1057
1057
  }, b;
@@ -1067,11 +1067,11 @@ function ci(e, t, { immediate: n, deep: o, flush: s, onTrack: i, onTrigger: r }
1067
1067
  return Ie;
1068
1068
  let w = d ? new Array(e.length).fill(Gt) : Gt;
1069
1069
  const I = () => {
1070
- if (T.active)
1070
+ if (O.active)
1071
1071
  if (t) {
1072
- const A = T.run();
1072
+ const A = O.run();
1073
1073
  (o || f || (d ? A.some(
1074
- (W, fe) => Ft(W, w[fe])
1074
+ (H, fe) => Ft(H, w[fe])
1075
1075
  ) : Ft(A, w))) && (p && p(), Ce(t, a, 3, [
1076
1076
  A,
1077
1077
  // pass undefined as the old value when it's changed for the first time
@@ -1079,18 +1079,18 @@ function ci(e, t, { immediate: n, deep: o, flush: s, onTrack: i, onTrigger: r }
1079
1079
  g
1080
1080
  ]), w = A);
1081
1081
  } else
1082
- T.run();
1082
+ O.run();
1083
1083
  };
1084
1084
  I.allowRecurse = !!t;
1085
- let O;
1086
- s === "sync" ? O = I : s === "post" ? O = () => de(I, a && a.suspense) : (I.pre = !0, a && (I.id = a.uid), O = () => ko(I));
1087
- const T = new mo(l, O);
1088
- t ? n ? I() : w = T.run() : s === "post" ? de(
1089
- T.run.bind(T),
1085
+ let T;
1086
+ s === "sync" ? T = I : s === "post" ? T = () => de(I, a && a.suspense) : (I.pre = !0, a && (I.id = a.uid), T = () => ko(I));
1087
+ const O = new mo(l, T);
1088
+ t ? n ? I() : w = O.run() : s === "post" ? de(
1089
+ O.run.bind(O),
1090
1090
  a && a.suspense
1091
- ) : T.run();
1091
+ ) : O.run();
1092
1092
  const R = () => {
1093
- T.stop(), a && a.scope && uo(a.scope.effects, T);
1093
+ O.stop(), a && a.scope && uo(a.scope.effects, O);
1094
1094
  };
1095
1095
  return b && b.push(R), R;
1096
1096
  }
@@ -1397,13 +1397,13 @@ function pc(e) {
1397
1397
  updated: b,
1398
1398
  activated: w,
1399
1399
  deactivated: I,
1400
- beforeDestroy: O,
1401
- beforeUnmount: T,
1400
+ beforeDestroy: T,
1401
+ beforeUnmount: O,
1402
1402
  destroyed: R,
1403
1403
  unmounted: A,
1404
- render: W,
1404
+ render: H,
1405
1405
  renderTracked: fe,
1406
- renderTriggered: H,
1406
+ renderTriggered: Z,
1407
1407
  errorCaptured: L,
1408
1408
  serverPrefetch: K,
1409
1409
  // public API
@@ -1446,10 +1446,10 @@ function pc(e) {
1446
1446
  });
1447
1447
  }
1448
1448
  f && Go(f, e, "c");
1449
- function Z(te, B) {
1449
+ function V(te, B) {
1450
1450
  N(B) ? B.forEach((Je) => te(Je.bind(n))) : B && te(B.bind(n));
1451
1451
  }
1452
- if (Z(nc, d), Z(fi, p), Z(oc, g), Z(sc, b), Z(Qr, w), Z(ec, I), Z(lc, L), Z(ac, fe), Z(cc, H), Z(ic, T), Z(di, A), Z(rc, K), N(oe))
1452
+ if (V(nc, d), V(fi, p), V(oc, g), V(sc, b), V(Qr, w), V(ec, I), V(lc, L), V(ac, fe), V(cc, Z), V(ic, O), V(di, A), V(rc, K), N(oe))
1453
1453
  if (oe.length) {
1454
1454
  const te = e.exposed || (e.exposed = {});
1455
1455
  oe.forEach((B) => {
@@ -1460,7 +1460,7 @@ function pc(e) {
1460
1460
  });
1461
1461
  } else
1462
1462
  e.exposed || (e.exposed = {});
1463
- W && e.render === Ie && (e.render = W), pe != null && (e.inheritAttrs = pe), Se && (e.components = Se), lt && (e.directives = lt);
1463
+ H && e.render === Ie && (e.render = H), pe != null && (e.inheritAttrs = pe), Se && (e.components = Se), lt && (e.directives = lt);
1464
1464
  }
1465
1465
  function mc(e, t, n = Ie) {
1466
1466
  N(e) && (e = Qn(e));
@@ -1980,10 +1980,10 @@ function Pc(e, t) {
1980
1980
  I(u, h, m, y);
1981
1981
  break;
1982
1982
  case ct:
1983
- O(u, h, m, y);
1983
+ T(u, h, m, y);
1984
1984
  break;
1985
1985
  case $n:
1986
- u == null && T(h, m, y, S);
1986
+ u == null && O(h, m, y, S);
1987
1987
  break;
1988
1988
  case ye:
1989
1989
  Se(
@@ -1999,7 +1999,7 @@ function Pc(e, t) {
1999
1999
  );
2000
2000
  break;
2001
2001
  default:
2002
- P & 1 ? W(
2002
+ P & 1 ? H(
2003
2003
  u,
2004
2004
  h,
2005
2005
  m,
@@ -2044,13 +2044,13 @@ function Pc(e, t) {
2044
2044
  const _ = h.el = u.el;
2045
2045
  h.children !== u.children && l(_, h.children);
2046
2046
  }
2047
- }, O = (u, h, m, y) => {
2047
+ }, T = (u, h, m, y) => {
2048
2048
  u == null ? o(
2049
2049
  h.el = a(h.children || ""),
2050
2050
  m,
2051
2051
  y
2052
2052
  ) : h.el = u.el;
2053
- }, T = (u, h, m, y) => {
2053
+ }, O = (u, h, m, y) => {
2054
2054
  [u.el, u.anchor] = b(
2055
2055
  u.children,
2056
2056
  h,
@@ -2069,7 +2069,7 @@ function Pc(e, t) {
2069
2069
  for (; u && u !== h; )
2070
2070
  m = p(u), s(u), u = m;
2071
2071
  s(h);
2072
- }, W = (u, h, m, y, _, x, S, k, C) => {
2072
+ }, H = (u, h, m, y, _, x, S, k, C) => {
2073
2073
  S = S || h.type === "svg", u == null ? fe(
2074
2074
  h,
2075
2075
  m,
@@ -2105,13 +2105,13 @@ function Pc(e, t) {
2105
2105
  x && E !== "foreignObject",
2106
2106
  S,
2107
2107
  k
2108
- ), $ && qe(u, null, y, "created"), H(C, u, u.scopeId, S, y), P) {
2109
- for (const V in P)
2110
- V !== "value" && !en(V) && i(
2108
+ ), $ && qe(u, null, y, "created"), Z(C, u, u.scopeId, S, y), P) {
2109
+ for (const X in P)
2110
+ X !== "value" && !en(X) && i(
2111
2111
  C,
2112
- V,
2112
+ X,
2113
2113
  null,
2114
- P[V],
2114
+ P[X],
2115
2115
  x,
2116
2116
  u.children,
2117
2117
  y,
@@ -2125,7 +2125,7 @@ function Pc(e, t) {
2125
2125
  J && M.beforeEnter(C), o(C, h, m), ((v = P && P.onVnodeMounted) || J || $) && de(() => {
2126
2126
  v && je(v, y, u), J && M.enter(C), $ && qe(u, null, y, "mounted");
2127
2127
  }, _);
2128
- }, H = (u, h, m, y, _) => {
2128
+ }, Z = (u, h, m, y, _) => {
2129
2129
  if (m && g(u, m), y)
2130
2130
  for (let x = 0; x < y.length; x++)
2131
2131
  g(u, y[x]);
@@ -2133,7 +2133,7 @@ function Pc(e, t) {
2133
2133
  let x = _.subTree;
2134
2134
  if (h === x) {
2135
2135
  const S = _.vnode;
2136
- H(
2136
+ Z(
2137
2137
  u,
2138
2138
  S,
2139
2139
  S.scopeId,
@@ -2196,8 +2196,8 @@ function Pc(e, t) {
2196
2196
  );
2197
2197
  else if (C & 2 && P.class !== j.class && i(k, "class", null, j.class, _), C & 4 && i(k, "style", P.style, j.style, _), C & 8) {
2198
2198
  const J = h.dynamicProps;
2199
- for (let V = 0; V < J.length; V++) {
2200
- const se = J[V], we = P[se], ft = j[se];
2199
+ for (let X = 0; X < J.length; X++) {
2200
+ const se = J[X], we = P[se], ft = j[se];
2201
2201
  (ft !== we || se === "value") && i(
2202
2202
  k,
2203
2203
  se,
@@ -2351,13 +2351,13 @@ function Pc(e, t) {
2351
2351
  _
2352
2352
  );
2353
2353
  if (li(u) && (k.ctx.renderer = ut), zc(k), k.asyncDep) {
2354
- if (_ && _.registerDep(k, Z), !u.el) {
2354
+ if (_ && _.registerDep(k, V), !u.el) {
2355
2355
  const C = k.subTree = Oe(ct);
2356
- O(null, C, h, m);
2356
+ T(null, C, h, m);
2357
2357
  }
2358
2358
  return;
2359
2359
  }
2360
- Z(
2360
+ V(
2361
2361
  k,
2362
2362
  u,
2363
2363
  h,
@@ -2376,11 +2376,11 @@ function Pc(e, t) {
2376
2376
  y.next = h, zr(y.update), y.update();
2377
2377
  else
2378
2378
  h.el = u.el, y.vnode = h;
2379
- }, Z = (u, h, m, y, _, x, S) => {
2379
+ }, V = (u, h, m, y, _, x, S) => {
2380
2380
  const k = () => {
2381
2381
  if (u.isMounted) {
2382
- let { next: E, bu: P, u: j, parent: M, vnode: $ } = u, J = E, V;
2383
- Ge(u, !1), E ? (E.el = $.el, te(u, E, S)) : E = $, P && tn(P), (V = E.props && E.props.onVnodeBeforeUpdate) && je(V, M, E, $), Ge(u, !0);
2382
+ let { next: E, bu: P, u: j, parent: M, vnode: $ } = u, J = E, X;
2383
+ Ge(u, !1), E ? (E.el = $.el, te(u, E, S)) : E = $, P && tn(P), (X = E.props && E.props.onVnodeBeforeUpdate) && je(X, M, E, $), Ge(u, !0);
2384
2384
  const se = Mn(u), we = u.subTree;
2385
2385
  u.subTree = se, w(
2386
2386
  we,
@@ -2392,14 +2392,14 @@ function Pc(e, t) {
2392
2392
  u,
2393
2393
  _,
2394
2394
  x
2395
- ), E.el = se.el, J === null && Br(u, se.el), j && de(j, _), (V = E.props && E.props.onVnodeUpdated) && de(
2396
- () => je(V, M, E, $),
2395
+ ), E.el = se.el, J === null && Br(u, se.el), j && de(j, _), (X = E.props && E.props.onVnodeUpdated) && de(
2396
+ () => je(X, M, E, $),
2397
2397
  _
2398
2398
  );
2399
2399
  } else {
2400
2400
  let E;
2401
- const { el: P, props: j } = h, { bm: M, m: $, parent: J } = u, V = on(h);
2402
- if (Ge(u, !1), M && tn(M), !V && (E = j && j.onVnodeBeforeMount) && je(E, J, h), Ge(u, !0), P && Nn) {
2401
+ const { el: P, props: j } = h, { bm: M, m: $, parent: J } = u, X = on(h);
2402
+ if (Ge(u, !1), M && tn(M), !X && (E = j && j.onVnodeBeforeMount) && je(E, J, h), Ge(u, !0), P && Nn) {
2403
2403
  const se = () => {
2404
2404
  u.subTree = Mn(u), Nn(
2405
2405
  P,
@@ -2409,7 +2409,7 @@ function Pc(e, t) {
2409
2409
  null
2410
2410
  );
2411
2411
  };
2412
- V ? h.type.__asyncLoader().then(
2412
+ X ? h.type.__asyncLoader().then(
2413
2413
  // note: we are moving the render call into an async callback,
2414
2414
  // which means it won't track dependencies - but it's ok because
2415
2415
  // a server-rendered async wrapper is already in resolved state
@@ -2428,7 +2428,7 @@ function Pc(e, t) {
2428
2428
  x
2429
2429
  ), h.el = se.el;
2430
2430
  }
2431
- if ($ && de($, _), !V && (E = j && j.onVnodeMounted)) {
2431
+ if ($ && de($, _), !X && (E = j && j.onVnodeMounted)) {
2432
2432
  const se = h;
2433
2433
  de(
2434
2434
  () => je(E, J, se),
@@ -2600,7 +2600,7 @@ function Pc(e, t) {
2600
2600
  const me = h[v] = C ? He(h[v]) : Ae(h[v]);
2601
2601
  me.key != null && J.set(me.key, v);
2602
2602
  }
2603
- let V, se = 0;
2603
+ let X, se = 0;
2604
2604
  const we = j - $ + 1;
2605
2605
  let ft = !1, Fo = 0;
2606
2606
  const Tt = new Array(we);
@@ -2616,9 +2616,9 @@ function Pc(e, t) {
2616
2616
  if (me.key != null)
2617
2617
  Ee = J.get(me.key);
2618
2618
  else
2619
- for (V = $; V <= j; V++)
2620
- if (Tt[V - $] === 0 && Ot(me, h[V])) {
2621
- Ee = V;
2619
+ for (X = $; X <= j; X++)
2620
+ if (Tt[X - $] === 0 && Ot(me, h[X])) {
2621
+ Ee = X;
2622
2622
  break;
2623
2623
  }
2624
2624
  Ee === void 0 ? Pe(me, _, x, !0) : (Tt[Ee - $] = v + 1, Ee >= Fo ? Fo = Ee : ft = !0, w(
@@ -2634,7 +2634,7 @@ function Pc(e, t) {
2634
2634
  ), se++);
2635
2635
  }
2636
2636
  const $o = ft ? Ec(Tt) : bt;
2637
- for (V = $o.length - 1, v = we - 1; v >= 0; v--) {
2637
+ for (X = $o.length - 1, v = we - 1; v >= 0; v--) {
2638
2638
  const me = $ + v, Ee = h[me], Ko = me + 1 < E ? h[me + 1].el : y;
2639
2639
  Tt[v] === 0 ? w(
2640
2640
  null,
@@ -2646,7 +2646,7 @@ function Pc(e, t) {
2646
2646
  S,
2647
2647
  k,
2648
2648
  C
2649
- ) : ft && (V < 0 || v !== $o[V] ? Ye(Ee, m, Ko, 2) : V--);
2649
+ ) : ft && (X < 0 || v !== $o[X] ? Ye(Ee, m, Ko, 2) : X--);
2650
2650
  }
2651
2651
  }
2652
2652
  }, Ye = (u, h, m, y, _ = null) => {
@@ -2833,7 +2833,7 @@ function xi(e) {
2833
2833
  }
2834
2834
  function q(e, t, n, o, s, i) {
2835
2835
  return xi(
2836
- X(
2836
+ W(
2837
2837
  e,
2838
2838
  t,
2839
2839
  n,
@@ -2869,7 +2869,7 @@ const On = "__vInternal", Ii = ({ key: e }) => e ?? null, sn = ({
2869
2869
  ref_key: t,
2870
2870
  ref_for: n
2871
2871
  }) => (typeof e == "number" && (e = "" + e), e != null ? ie(e) || ne(e) || F(e) ? { i: _e, r: e, k: t, f: !!n } : e : null);
2872
- function X(e, t = null, n = null, o = 0, s = null, i = e === ye ? 0 : 1, r = !1, c = !1) {
2872
+ function W(e, t = null, n = null, o = 0, s = null, i = e === ye ? 0 : 1, r = !1, c = !1) {
2873
2873
  const a = {
2874
2874
  __v_isVNode: !0,
2875
2875
  __v_skip: !0,
@@ -2925,7 +2925,7 @@ function Nc(e, t = null, n = null, o = 0, s = null, i = !1) {
2925
2925
  c && !ie(c) && (t.class = _n(c)), ee(a) && (Ys(a) && !N(a) && (a = ce({}, a)), t.style = bn(a));
2926
2926
  }
2927
2927
  const r = ie(e) ? 1 : Jr(e) ? 128 : jc(e) ? 64 : ee(e) ? 4 : F(e) ? 2 : 0;
2928
- return X(
2928
+ return W(
2929
2929
  e,
2930
2930
  t,
2931
2931
  n,
@@ -3650,7 +3650,7 @@ function Ei(e, t, n = {}, o, s, i) {
3650
3650
  w === oe && (l = !0);
3651
3651
  }), f = !0, ht(d, K, o.state.value[e]);
3652
3652
  }
3653
- const O = i ? function() {
3653
+ const T = i ? function() {
3654
3654
  const { state: K } = n, oe = K ? K() : {};
3655
3655
  this.$patch((pe) => {
3656
3656
  We(pe, oe);
@@ -3659,33 +3659,33 @@ function Ei(e, t, n = {}, o, s, i) {
3659
3659
  /* istanbul ignore next */
3660
3660
  Pi
3661
3661
  );
3662
- function T() {
3662
+ function O() {
3663
3663
  r.stop(), d = [], p = [], o._s.delete(e);
3664
3664
  }
3665
3665
  function R(L, K) {
3666
3666
  return function() {
3667
3667
  En(o);
3668
3668
  const oe = Array.from(arguments), pe = [], Se = [];
3669
- function lt(Z) {
3670
- pe.push(Z);
3669
+ function lt(V) {
3670
+ pe.push(V);
3671
3671
  }
3672
- function Ct(Z) {
3673
- Se.push(Z);
3672
+ function Ct(V) {
3673
+ Se.push(V);
3674
3674
  }
3675
3675
  ht(p, {
3676
3676
  args: oe,
3677
3677
  name: L,
3678
- store: W,
3678
+ store: H,
3679
3679
  after: lt,
3680
3680
  onError: Ct
3681
3681
  });
3682
3682
  let Ue;
3683
3683
  try {
3684
- Ue = K.apply(this && this.$id === e ? this : W, oe);
3685
- } catch (Z) {
3686
- throw ht(Se, Z), Z;
3684
+ Ue = K.apply(this && this.$id === e ? this : H, oe);
3685
+ } catch (V) {
3686
+ throw ht(Se, V), V;
3687
3687
  }
3688
- return Ue instanceof Promise ? Ue.then((Z) => (ht(pe, Z), Z)).catch((Z) => (ht(Se, Z), Promise.reject(Z))) : (ht(pe, Ue), Ue);
3688
+ return Ue instanceof Promise ? Ue.then((V) => (ht(pe, V), V)).catch((V) => (ht(Se, V), Promise.reject(V))) : (ht(pe, Ue), Ue);
3689
3689
  };
3690
3690
  }
3691
3691
  const A = {
@@ -3694,7 +3694,7 @@ function Ei(e, t, n = {}, o, s, i) {
3694
3694
  $id: e,
3695
3695
  $onAction: ys.bind(null, p),
3696
3696
  $patch: I,
3697
- $reset: O,
3697
+ $reset: T,
3698
3698
  $subscribe(L, K = {}) {
3699
3699
  const oe = ys(d, L, K.detached, () => pe()), pe = r.run(() => nn(() => o.state.value[e], (Se) => {
3700
3700
  (K.flush === "sync" ? f : l) && L({
@@ -3705,20 +3705,20 @@ function Ei(e, t, n = {}, o, s, i) {
3705
3705
  }, We({}, a, K)));
3706
3706
  return oe;
3707
3707
  },
3708
- $dispose: T
3709
- }, W = wn(A);
3710
- o._s.set(e, W);
3711
- const fe = o._a && o._a.runWithContext || xa, H = o._e.run(() => (r = Fs(), fe(() => r.run(t))));
3712
- for (const L in H) {
3713
- const K = H[L];
3708
+ $dispose: O
3709
+ }, H = wn(A);
3710
+ o._s.set(e, H);
3711
+ const fe = o._a && o._a.runWithContext || xa, Z = o._e.run(() => (r = Fs(), fe(() => r.run(t))));
3712
+ for (const L in Z) {
3713
+ const K = Z[L];
3714
3714
  if (ne(K) && !Ta(K) || Ve(K))
3715
3715
  i || (b && Ca(K) && (ne(K) ? K.value = b[L] : so(K, b[L])), o.state.value[e][L] = K);
3716
3716
  else if (typeof K == "function") {
3717
3717
  const oe = R(L, K);
3718
- H[L] = oe, c.actions[L] = K;
3718
+ Z[L] = oe, c.actions[L] = K;
3719
3719
  }
3720
3720
  }
3721
- return We(W, H), We(U(W), H), Object.defineProperty(W, "$state", {
3721
+ return We(H, Z), We(U(H), Z), Object.defineProperty(H, "$state", {
3722
3722
  get: () => o.state.value[e],
3723
3723
  set: (L) => {
3724
3724
  I((K) => {
@@ -3726,13 +3726,13 @@ function Ei(e, t, n = {}, o, s, i) {
3726
3726
  });
3727
3727
  }
3728
3728
  }), o._p.forEach((L) => {
3729
- We(W, r.run(() => L({
3730
- store: W,
3729
+ We(H, r.run(() => L({
3730
+ store: H,
3731
3731
  app: o._a,
3732
3732
  pinia: o,
3733
3733
  options: c
3734
3734
  })));
3735
- }), b && i && n.hydrate && n.hydrate(W.$state, b), l = !0, f = !0, W;
3735
+ }), b && i && n.hydrate && n.hydrate(H.$state, b), l = !0, f = !0, H;
3736
3736
  }
3737
3737
  function Sa(e, t, n) {
3738
3738
  let o, s;
@@ -3800,23 +3800,23 @@ So(et);
3800
3800
  var Pa = So(Po(function(e, t) {
3801
3801
  var n = gt && gt.__awaiter || function(a, l, f, d) {
3802
3802
  return new (f || (f = Promise))(function(p, g) {
3803
- function b(O) {
3803
+ function b(T) {
3804
3804
  try {
3805
- I(d.next(O));
3806
- } catch (T) {
3807
- g(T);
3805
+ I(d.next(T));
3806
+ } catch (O) {
3807
+ g(O);
3808
3808
  }
3809
3809
  }
3810
- function w(O) {
3810
+ function w(T) {
3811
3811
  try {
3812
- I(d.throw(O));
3813
- } catch (T) {
3814
- g(T);
3812
+ I(d.throw(T));
3813
+ } catch (O) {
3814
+ g(O);
3815
3815
  }
3816
3816
  }
3817
- function I(O) {
3818
- O.done ? p(O.value) : new f(function(T) {
3819
- T(O.value);
3817
+ function I(T) {
3818
+ T.done ? p(T.value) : new f(function(O) {
3819
+ O(T.value);
3820
3820
  }).then(b, w);
3821
3821
  }
3822
3822
  I((d = d.apply(a, l || [])).next());
@@ -3831,57 +3831,57 @@ var Pa = So(Po(function(e, t) {
3831
3831
  return this;
3832
3832
  }), g;
3833
3833
  function w(I) {
3834
- return function(O) {
3835
- return function(T) {
3834
+ return function(T) {
3835
+ return function(O) {
3836
3836
  if (f)
3837
3837
  throw new TypeError("Generator is already executing.");
3838
3838
  for (; b; )
3839
3839
  try {
3840
- if (f = 1, d && (p = 2 & T[0] ? d.return : T[0] ? d.throw || ((p = d.return) && p.call(d), 0) : d.next) && !(p = p.call(d, T[1])).done)
3840
+ if (f = 1, d && (p = 2 & O[0] ? d.return : O[0] ? d.throw || ((p = d.return) && p.call(d), 0) : d.next) && !(p = p.call(d, O[1])).done)
3841
3841
  return p;
3842
- switch (d = 0, p && (T = [2 & T[0], p.value]), T[0]) {
3842
+ switch (d = 0, p && (O = [2 & O[0], p.value]), O[0]) {
3843
3843
  case 0:
3844
3844
  case 1:
3845
- p = T;
3845
+ p = O;
3846
3846
  break;
3847
3847
  case 4:
3848
- return b.label++, { value: T[1], done: !1 };
3848
+ return b.label++, { value: O[1], done: !1 };
3849
3849
  case 5:
3850
- b.label++, d = T[1], T = [0];
3850
+ b.label++, d = O[1], O = [0];
3851
3851
  continue;
3852
3852
  case 7:
3853
- T = b.ops.pop(), b.trys.pop();
3853
+ O = b.ops.pop(), b.trys.pop();
3854
3854
  continue;
3855
3855
  default:
3856
- if (!((p = (p = b.trys).length > 0 && p[p.length - 1]) || T[0] !== 6 && T[0] !== 2)) {
3856
+ if (!((p = (p = b.trys).length > 0 && p[p.length - 1]) || O[0] !== 6 && O[0] !== 2)) {
3857
3857
  b = 0;
3858
3858
  continue;
3859
3859
  }
3860
- if (T[0] === 3 && (!p || T[1] > p[0] && T[1] < p[3])) {
3861
- b.label = T[1];
3860
+ if (O[0] === 3 && (!p || O[1] > p[0] && O[1] < p[3])) {
3861
+ b.label = O[1];
3862
3862
  break;
3863
3863
  }
3864
- if (T[0] === 6 && b.label < p[1]) {
3865
- b.label = p[1], p = T;
3864
+ if (O[0] === 6 && b.label < p[1]) {
3865
+ b.label = p[1], p = O;
3866
3866
  break;
3867
3867
  }
3868
3868
  if (p && b.label < p[2]) {
3869
- b.label = p[2], b.ops.push(T);
3869
+ b.label = p[2], b.ops.push(O);
3870
3870
  break;
3871
3871
  }
3872
3872
  p[2] && b.ops.pop(), b.trys.pop();
3873
3873
  continue;
3874
3874
  }
3875
- T = l.call(a, b);
3875
+ O = l.call(a, b);
3876
3876
  } catch (R) {
3877
- T = [6, R], d = 0;
3877
+ O = [6, R], d = 0;
3878
3878
  } finally {
3879
3879
  f = p = 0;
3880
3880
  }
3881
- if (5 & T[0])
3882
- throw T[1];
3883
- return { value: T[0] ? T[1] : void 0, done: !0 };
3884
- }([I, O]);
3881
+ if (5 & O[0])
3882
+ throw O[1];
3883
+ return { value: O[0] ? O[1] : void 0, done: !0 };
3884
+ }([I, T]);
3885
3885
  };
3886
3886
  }
3887
3887
  };
@@ -3904,22 +3904,22 @@ var Pa = So(Po(function(e, t) {
3904
3904
  return a.prototype.acquireLock = function(l, f) {
3905
3905
  return f === void 0 && (f = 5e3), n(this, void 0, void 0, function() {
3906
3906
  var d, p, g, b, w, I;
3907
- return o(this, function(O) {
3908
- switch (O.label) {
3907
+ return o(this, function(T) {
3908
+ switch (T.label) {
3909
3909
  case 0:
3910
- d = Date.now() + r(4), p = Date.now() + f, g = s + "-" + l, b = window.localStorage, O.label = 1;
3910
+ d = Date.now() + r(4), p = Date.now() + f, g = s + "-" + l, b = window.localStorage, T.label = 1;
3911
3911
  case 1:
3912
3912
  return Date.now() < p ? [4, i(30)] : [3, 8];
3913
3913
  case 2:
3914
- return O.sent(), b.getItem(g) !== null ? [3, 5] : (w = this.id + "-" + l + "-" + d, [4, i(Math.floor(25 * Math.random()))]);
3914
+ return T.sent(), b.getItem(g) !== null ? [3, 5] : (w = this.id + "-" + l + "-" + d, [4, i(Math.floor(25 * Math.random()))]);
3915
3915
  case 3:
3916
- return O.sent(), b.setItem(g, JSON.stringify({ id: this.id, iat: d, timeoutKey: w, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, i(30)];
3916
+ return T.sent(), b.setItem(g, JSON.stringify({ id: this.id, iat: d, timeoutKey: w, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, i(30)];
3917
3917
  case 4:
3918
- return O.sent(), (I = b.getItem(g)) !== null && (I = JSON.parse(I)).id === this.id && I.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(g, d), [2, !0]) : [3, 7];
3918
+ return T.sent(), (I = b.getItem(g)) !== null && (I = JSON.parse(I)).id === this.id && I.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(g, d), [2, !0]) : [3, 7];
3919
3919
  case 5:
3920
3920
  return a.lockCorrector(), [4, this.waitForSomethingToChange(p)];
3921
3921
  case 6:
3922
- O.sent(), O.label = 7;
3922
+ T.sent(), T.label = 7;
3923
3923
  case 7:
3924
3924
  return d = Date.now() + r(4), [3, 1];
3925
3925
  case 8:
@@ -3956,8 +3956,8 @@ var Pa = So(Po(function(e, t) {
3956
3956
  function w() {
3957
3957
  if (b || (window.removeEventListener("storage", w), a.removeFromWaiting(w), clearTimeout(I), b = !0), !p) {
3958
3958
  p = !0;
3959
- var O = 50 - (Date.now() - g);
3960
- O > 0 ? setTimeout(d, O) : d();
3959
+ var T = 50 - (Date.now() - g);
3960
+ T > 0 ? setTimeout(d, T) : d();
3961
3961
  }
3962
3962
  }
3963
3963
  window.addEventListener("storage", w), a.addToWaiting(w);
@@ -4069,11 +4069,11 @@ const rn = () => window.crypto, Un = () => {
4069
4069
  const n = await fetch(e, t);
4070
4070
  return { ok: n.ok, json: await n.json() };
4071
4071
  }, Aa = async (e, t, n, o, s, i, r = 1e4) => s ? (async (c, a, l, f, d, p, g) => {
4072
- return b = { auth: { audience: a, scope: l }, timeout: d, fetchUrl: c, fetchOptions: f, useFormData: g }, w = p, new Promise(function(I, O) {
4073
- const T = new MessageChannel();
4074
- T.port1.onmessage = function(R) {
4075
- R.data.error ? O(new Error(R.data.error)) : I(R.data), T.port1.close();
4076
- }, w.postMessage(b, [T.port2]);
4072
+ return b = { auth: { audience: a, scope: l }, timeout: d, fetchUrl: c, fetchOptions: f, useFormData: g }, w = p, new Promise(function(I, T) {
4073
+ const O = new MessageChannel();
4074
+ O.port1.onmessage = function(R) {
4075
+ R.data.error ? T(new Error(R.data.error)) : I(R.data), O.port1.close();
4076
+ }, w.postMessage(b, [O.port2]);
4077
4077
  });
4078
4078
  var b, w;
4079
4079
  })(e, t, n, o, r, s, i) : (async (c, a, l) => {
@@ -4091,19 +4091,19 @@ async function Ra(e, t) {
4091
4091
  var { baseUrl: n, timeout: o, audience: s, scope: i, auth0Client: r, useFormData: c } = e, a = Re(e, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
4092
4092
  const l = c ? io(a) : JSON.stringify(a);
4093
4093
  return await async function(f, d, p, g, b, w, I) {
4094
- let O, T = null;
4094
+ let T, O = null;
4095
4095
  for (let L = 0; L < 3; L++)
4096
4096
  try {
4097
- O = await Aa(f, p, g, b, w, I, d), T = null;
4097
+ T = await Aa(f, p, g, b, w, I, d), O = null;
4098
4098
  break;
4099
4099
  } catch (K) {
4100
- T = K;
4100
+ O = K;
4101
4101
  }
4102
- if (T)
4103
- throw T;
4104
- const R = O.json, { error: A, error_description: W } = R, fe = Re(R, ["error", "error_description"]), { ok: H } = O;
4105
- if (!H) {
4106
- const L = W || `HTTP error. Unable to fetch ${f}`;
4102
+ if (O)
4103
+ throw O;
4104
+ const R = T.json, { error: A, error_description: H } = R, fe = Re(R, ["error", "error_description"]), { ok: Z } = T;
4105
+ if (!Z) {
4106
+ const L = H || `HTTP error. Unable to fetch ${f}`;
4107
4107
  throw A === "mfa_required" ? new Ro(A, L, fe.mfa_token) : A === "missing_refresh_token" ? new jn(p, g) : new ae(A || "request_error", L);
4108
4108
  }
4109
4109
  return fe;
@@ -4405,10 +4405,10 @@ class Ha {
4405
4405
  const p = d.split("."), [g, b, w] = p;
4406
4406
  if (p.length !== 3 || !g || !b || !w)
4407
4407
  throw new Error("ID token could not be decoded");
4408
- const I = JSON.parse(ks(b)), O = { __raw: d }, T = {};
4408
+ const I = JSON.parse(ks(b)), T = { __raw: d }, O = {};
4409
4409
  return Object.keys(I).forEach((R) => {
4410
- O[R] = I[R], Fa.includes(R) || (T[R] = I[R]);
4411
- }), { encoded: { header: g, payload: b, signature: w }, header: JSON.parse(ks(g)), claims: O, user: T };
4410
+ T[R] = I[R], Fa.includes(R) || (O[R] = I[R]);
4411
+ }), { encoded: { header: g, payload: b, signature: w }, header: JSON.parse(ks(g)), claims: T, user: O };
4412
4412
  })(r.id_token);
4413
4413
  if (!c.claims.iss)
4414
4414
  throw new Error("Issuer (iss) claim must be a string present in the ID token");
@@ -4486,7 +4486,7 @@ class Ha {
4486
4486
  const g = { "+": "-", "/": "_", "=": "" };
4487
4487
  return p.replace(/[+/=]/g, (b) => g[b]);
4488
4488
  })(window.btoa(String.fromCharCode(...Array.from(d))));
4489
- })(await (async (f) => await rn().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(f)))(r)), a = ((f, d, p, g, b, w, I, O) => Object.assign(Object.assign(Object.assign({ client_id: f.clientId }, f.authorizationParams), p), { scope: Qt(d, p.scope), response_type: "code", response_mode: O || "query", state: g, nonce: b, redirect_uri: I || f.authorizationParams.redirect_uri, code_challenge: w, code_challenge_method: "S256" }))(this.options, this.scope, t, s, i, c, t.redirect_uri || this.options.authorizationParams.redirect_uri || o, n?.response_mode), l = this._authorizeUrl(a);
4489
+ })(await (async (f) => await rn().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(f)))(r)), a = ((f, d, p, g, b, w, I, T) => Object.assign(Object.assign(Object.assign({ client_id: f.clientId }, f.authorizationParams), p), { scope: Qt(d, p.scope), response_type: "code", response_mode: T || "query", state: g, nonce: b, redirect_uri: I || f.authorizationParams.redirect_uri, code_challenge: w, code_challenge_method: "S256" }))(this.options, this.scope, t, s, i, c, t.redirect_uri || this.options.authorizationParams.redirect_uri || o, n?.response_mode), l = this._authorizeUrl(a);
4490
4490
  return { nonce: i, code_verifier: r, scope: a.scope, audience: a.audience || "default", redirect_uri: a.redirect_uri, state: s, url: l };
4491
4491
  }
4492
4492
  async loginWithPopup(t, n) {
@@ -4628,22 +4628,22 @@ class Ha {
4628
4628
  try {
4629
4629
  if (window.crossOriginIsolated)
4630
4630
  throw new ae("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
4631
- const d = t.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, p = await ((b, w, I = 60) => new Promise((O, T) => {
4631
+ const d = t.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, p = await ((b, w, I = 60) => new Promise((T, O) => {
4632
4632
  const R = window.document.createElement("iframe");
4633
4633
  R.setAttribute("width", "0"), R.setAttribute("height", "0"), R.style.display = "none";
4634
4634
  const A = () => {
4635
- window.document.body.contains(R) && (window.document.body.removeChild(R), window.removeEventListener("message", W, !1));
4635
+ window.document.body.contains(R) && (window.document.body.removeChild(R), window.removeEventListener("message", H, !1));
4636
4636
  };
4637
- let W;
4637
+ let H;
4638
4638
  const fe = setTimeout(() => {
4639
- T(new Ht()), A();
4639
+ O(new Ht()), A();
4640
4640
  }, 1e3 * I);
4641
- W = function(H) {
4642
- if (H.origin != w || !H.data || H.data.type !== "authorization_response")
4641
+ H = function(Z) {
4642
+ if (Z.origin != w || !Z.data || Z.data.type !== "authorization_response")
4643
4643
  return;
4644
- const L = H.source;
4645
- L && L.close(), H.data.response.error ? T(ae.fromPayload(H.data.response)) : O(H.data.response), clearTimeout(fe), window.removeEventListener("message", W, !1), setTimeout(A, 2e3);
4646
- }, window.addEventListener("message", W, !1), window.document.body.appendChild(R), R.setAttribute("src", b);
4644
+ const L = Z.source;
4645
+ L && L.close(), Z.data.response.error ? O(ae.fromPayload(Z.data.response)) : T(Z.data.response), clearTimeout(fe), window.removeEventListener("message", H, !1), setTimeout(A, 2e3);
4646
+ }, window.addEventListener("message", H, !1), window.document.body.appendChild(R), R.setAttribute("src", b);
4647
4647
  }))(s, this.domainUrl, d);
4648
4648
  if (i !== p.state)
4649
4649
  throw new ae("state_mismatch", "Invalid state");
@@ -4776,8 +4776,8 @@ const An = Sa("store", () => {
4776
4776
  !I.ancestor_id || Number(I.ancestor_id) === 0 ? b[I.id] = Cs(I) : w.push(I);
4777
4777
  }), w.forEach((I) => {
4778
4778
  if (I.ancestor_id in b) {
4779
- const O = b[I.ancestor_id];
4780
- O.children = [...O.children || [], Cs(I)];
4779
+ const T = b[I.ancestor_id];
4780
+ T.children = [...T.children || [], Cs(I)];
4781
4781
  }
4782
4782
  }), b;
4783
4783
  }
@@ -4795,42 +4795,43 @@ const An = Sa("store", () => {
4795
4795
  s.value = "Load comments failed. " + w.message, n.value = !0, a.value = !1;
4796
4796
  return;
4797
4797
  }
4798
- i.value = f(w.data || []);
4799
- const I = w.data?.length || 0;
4800
- return l.value = I >= 20, r.value += I, n.value = !0, a.value = !1, w;
4798
+ const I = f(w.data || []);
4799
+ Object.assign(i.value, I);
4800
+ const T = w.data?.length || 0;
4801
+ return l.value = Object.values(I).length >= 20, r.value += T, n.value = !0, a.value = !1, w;
4801
4802
  }
4802
- function p(g, b, w, I, O) {
4803
+ function p(g, b, w, I, T) {
4803
4804
  const {
4804
- sub: T = "",
4805
+ sub: O = "",
4805
4806
  name: R = "",
4806
4807
  picture: A = "",
4807
- email: W = "",
4808
+ email: H = "",
4808
4809
  nickname: fe = ""
4809
- } = w, H = {
4810
+ } = w, Z = {
4810
4811
  id: g,
4811
4812
  postId: e,
4812
4813
  content: b,
4813
4814
  createdAt: /* @__PURE__ */ new Date(),
4814
4815
  user: {
4815
4816
  avatar: A,
4816
- email: W,
4817
+ email: H,
4817
4818
  name: fe || R
4818
4819
  },
4819
- userId: T,
4820
+ userId: O,
4820
4821
  status: No.Pending,
4821
4822
  isNew: !0
4822
4823
  };
4823
- if (I || O) {
4824
- H.ancestorId = I, H.parentId = O;
4824
+ if (I || T) {
4825
+ Z.ancestorId = I, Z.parentId = T;
4825
4826
  const L = i.value[I];
4826
- if (I === O)
4827
- L.children || (L.children = []), L.children.unshift(H);
4827
+ if (I === T)
4828
+ L.children || (L.children = []), L.children.unshift(Z);
4828
4829
  else {
4829
- const K = L.children.findIndex((oe) => Number(oe.id) === O);
4830
- L.children.splice(K + 1, 0, H);
4830
+ const K = L.children.findIndex((oe) => Number(oe.id) === T);
4831
+ L.children.splice(K + 1, 0, Z);
4831
4832
  }
4832
4833
  } else
4833
- H.ancestorId = 0, H.parentId = 0, i.value = { [g]: H, ...i.value };
4834
+ Z.ancestorId = 0, Z.parentId = 0, i.value = { [g]: Z, ...i.value };
4834
4835
  r.value++;
4835
4836
  }
4836
4837
  return {
@@ -4845,7 +4846,7 @@ const An = Sa("store", () => {
4845
4846
  loadComments: d,
4846
4847
  addComment: p
4847
4848
  };
4848
- }), Ba = ["onSubmit"], Ja = { class: "ac-form-control border border-neutral bg-base-200 rounded-lg" }, Ya = /* @__PURE__ */ X("label", {
4849
+ }), Ba = ["onSubmit"], Ja = { class: "ac-form-control border border-neutral bg-base-200 rounded-lg" }, Ya = /* @__PURE__ */ W("label", {
4849
4850
  class: "sr-only",
4850
4851
  for: "ac-comment"
4851
4852
  }, "Your comment", -1), qa = ["onKeydown"], Ga = { class: "p-2 rounded-b-lg bg-base-300 flex items-center" }, Qa = {
@@ -4868,18 +4869,18 @@ const An = Sa("store", () => {
4868
4869
  },
4869
4870
  emits: ["close"],
4870
4871
  setup(e, { emit: t }) {
4871
- const n = e, o = $i(), s = An(), i = Te("ApiBaseUrl"), r = Te("Auth0Domain"), c = "0.4.2", a = Q(), l = Q(!1), f = Q(""), d = Q("");
4872
+ const n = e, o = $i(), s = An(), i = Te("ApiBaseUrl"), r = Te("Auth0Domain"), c = "0.4.4", a = Q(), l = Q(!1), f = Q(""), d = Q("");
4872
4873
  async function p(I) {
4873
4874
  if (!o.user.value)
4874
4875
  return g();
4875
4876
  if (!I.target.matches(":invalid")) {
4876
4877
  l.value = !0, d.value = "";
4877
4878
  try {
4878
- const O = await o.getAccessTokenSilently(), T = await fetch(i + "/api/comment", {
4879
+ const T = await o.getAccessTokenSilently(), O = await fetch(i + "/api/comment", {
4879
4880
  method: "POST",
4880
4881
  headers: {
4881
4882
  "Content-Type": "application/json",
4882
- Authorization: `Bearer ${O}`
4883
+ Authorization: `Bearer ${T}`
4883
4884
  },
4884
4885
  body: JSON.stringify({
4885
4886
  comment: f.value,
@@ -4888,12 +4889,12 @@ const An = Sa("store", () => {
4888
4889
  ancestorId: n.ancestorId ? Number(n.ancestorId) : void 0,
4889
4890
  parentId: n.parentId ? Number(n.parentId) : void 0
4890
4891
  })
4891
- }), R = await T.json();
4892
- if (!T.ok || R.message)
4892
+ }), R = await O.json();
4893
+ if (!O.ok || R.message)
4893
4894
  throw new Error("Failed to post comment: " + (R.message || "Unknown"));
4894
4895
  n.ancestorId || n.parentId ? s.addComment(R.data, f.value, o.user.value, Number(n.ancestorId), Number(n.parentId)) : s.addComment(R.data, f.value, o.user.value), f.value = "";
4895
- } catch (O) {
4896
- d.value = O.message || String(O);
4896
+ } catch (T) {
4897
+ d.value = T.message || String(T);
4897
4898
  }
4898
4899
  l.value = !1, t("close");
4899
4900
  }
@@ -4902,21 +4903,21 @@ const An = Sa("store", () => {
4902
4903
  o.loginWithPopup();
4903
4904
  }
4904
4905
  function b(I) {
4905
- const O = navigator.userAgent.match(/Macintosh/);
4906
- (O && I.metaKey || !O && I.ctrlKey) && p(I);
4906
+ const T = navigator.userAgent.match(/Macintosh/);
4907
+ (T && I.metaKey || !T && I.ctrlKey) && p(I);
4907
4908
  }
4908
4909
  function w() {
4909
4910
  t("close");
4910
4911
  }
4911
4912
  return fi(() => {
4912
4913
  a.value?.focus();
4913
- }), (I, O) => (D(), q("form", {
4914
+ }), (I, T) => (D(), q("form", {
4914
4915
  class: "mb-6",
4915
4916
  onSubmit: ma(p, ["prevent"])
4916
4917
  }, [
4917
- X("div", Ja, [
4918
+ W("div", Ja, [
4918
4919
  Ya,
4919
- Gr(X("textarea", {
4920
+ Gr(W("textarea", {
4920
4921
  class: "ac-textarea ac-textarea-bordered bg-base-200 rounded-b-none focus:outline-none",
4921
4922
  id: "ac-comment",
4922
4923
  ref_key: "textarea",
@@ -4928,14 +4929,14 @@ const An = Sa("store", () => {
4928
4929
  bs(b, ["enter"]),
4929
4930
  bs(w, ["esc"])
4930
4931
  ],
4931
- "onUpdate:modelValue": O[0] || (O[0] = (T) => f.value = T)
4932
+ "onUpdate:modelValue": T[0] || (T[0] = (O) => f.value = O)
4932
4933
  }, null, 40, qa), [
4933
4934
  [da, f.value]
4934
4935
  ]),
4935
- X("div", Ga, [
4936
+ W("div", Ga, [
4936
4937
  I.noVersion ? be("", !0) : (D(), q("div", Qa, "v" + ve(Y(c)), 1)),
4937
4938
  d.value ? (D(), q("div", el, ve(d.value), 1)) : be("", !0),
4938
- X("button", {
4939
+ W("button", {
4939
4940
  class: "ac-btn ac-btn-primary ac-btn-sm ml-auto",
4940
4941
  disabled: l.value
4941
4942
  }, [
@@ -4997,21 +4998,24 @@ function Ss(e) {
4997
4998
  }
4998
4999
  return n;
4999
5000
  }
5000
- const rl = ["id"], cl = { class: "p-6 text-base bg-base-200 rounded-lg dark:bg-gray-900" }, al = { class: "flex justify-between items-center mb-2" }, ll = { class: "flex items-center text-sm text-base-content dark:text-white" }, ul = { class: "avatar mr-2" }, fl = {
5001
+ const rl = ["id"], cl = { class: "p-6 text-base bg-base-200 rounded-lg dark:bg-gray-900" }, al = { class: "flex justify-between items-center font-sans mb-2" }, ll = { class: "flex items-center text-sm text-base-content dark:text-white" }, ul = { class: "ac-avatar mr-2" }, fl = {
5001
5002
  key: 0,
5002
5003
  class: "w-6 h-6"
5003
5004
  }, dl = ["src", "alt"], hl = { class: "text-neutral-content mix-blend-color-dodge uppercase font-bold leading-6" }, pl = {
5004
5005
  key: 0,
5005
- class: "bi bi-patch-check-fill text-success ml-2"
5006
- }, ml = ["datetime", "title"], gl = ["href"], bl = /* @__PURE__ */ X("i", { class: "bi bi-reply-fill h-4 w-4" }, null, -1), _l = [
5007
- bl
5008
- ], yl = ["innerHTML"], wl = {
5006
+ class: "ac-tooltip ml-2",
5007
+ "data-tip": "Admin"
5008
+ }, ml = /* @__PURE__ */ W("i", { class: "bi bi-patch-check-fill text-success" }, null, -1), gl = [
5009
+ ml
5010
+ ], bl = ["href"], _l = ["datetime", "title"], yl = ["href"], wl = /* @__PURE__ */ W("i", { class: "bi bi-reply-fill h-4 w-4" }, null, -1), vl = [
5011
+ wl
5012
+ ], kl = ["innerHTML"], xl = {
5009
5013
  key: 0,
5010
5014
  class: "italic mt-4 text-gray-500 mb-0 text-sm dark:text-gray-400"
5011
- }, vl = {
5015
+ }, Il = {
5012
5016
  name: "CommentItem"
5013
- }, kl = /* @__PURE__ */ In({
5014
- ...vl,
5017
+ }, Cl = /* @__PURE__ */ In({
5018
+ ...Il,
5015
5019
  props: {
5016
5020
  comment: {},
5017
5021
  isFirstLevel: { type: Boolean },
@@ -5019,107 +5023,115 @@ const rl = ["id"], cl = { class: "p-6 text-base bg-base-200 rounded-lg dark:bg-g
5019
5023
  },
5020
5024
  setup(e) {
5021
5025
  const t = e, n = An();
5022
- function o(s) {
5023
- return t.ancestorId && n.comments[t.ancestorId]?.children?.find((c) => Number(c.id) === Number(s))?.user?.name || "";
5026
+ function o(i) {
5027
+ return `${location.origin}${location.pathname}#awcm-${i}`;
5028
+ }
5029
+ function s(i) {
5030
+ return t.ancestorId && n.comments[t.ancestorId]?.children?.find((a) => Number(a.id) === Number(i))?.user?.name || "";
5024
5031
  }
5025
- return (s, i) => {
5026
- const r = uc("comment-item", !0);
5032
+ return (i, r) => {
5033
+ const c = uc("comment-item", !0);
5027
5034
  return D(), q("div", {
5028
- class: _n(["comment-item rounded-lg my-4", { "animated flash": s.comment.isNew }]),
5029
- id: "awcm-" + s.comment.id,
5030
- onAnimationend: i[2] || (i[2] = (c) => s.comment.isNew = !1)
5035
+ class: _n(["comment-item rounded-lg my-4", { "animated flash": i.comment.isNew }]),
5036
+ id: "awcm-" + i.comment.id,
5037
+ onAnimationend: r[2] || (r[2] = (a) => i.comment.isNew = !1)
5031
5038
  }, [
5032
- X("article", cl, [
5033
- X("header", al, [
5034
- X("div", ll, [
5035
- X("div", ul, [
5036
- s.comment.user.avatar ? (D(), q("div", fl, [
5037
- X("img", {
5039
+ W("article", cl, [
5040
+ W("header", al, [
5041
+ W("div", ll, [
5042
+ W("div", ul, [
5043
+ i.comment.user.avatar ? (D(), q("div", fl, [
5044
+ W("img", {
5038
5045
  class: "rounded-full max-w-full max-h-full",
5039
- src: s.comment.user.avatar,
5040
- alt: s.comment.user.name
5046
+ src: i.comment.user.avatar,
5047
+ alt: i.comment.user.name
5041
5048
  }, null, 8, dl)
5042
5049
  ])) : (D(), q("div", {
5043
5050
  key: 1,
5044
5051
  class: "avatar-char rounded-full w-6 h-6 text-center",
5045
- style: bn({ "background-color": Y(il)(s.comment.user.name || "Anonymous") })
5052
+ style: bn({ "background-color": Y(il)(i.comment.user.name || "Anonymous") })
5046
5053
  }, [
5047
- X("span", hl, ve((s.comment.user.name || "Anonymous").substring(0, 1)), 1)
5054
+ W("span", hl, ve((i.comment.user.name || "Anonymous").substring(0, 1)), 1)
5048
5055
  ], 4))
5049
5056
  ]),
5050
- Sn(ve(s.comment.user.name), 1),
5051
- s.comment.isAdmin ? (D(), q("i", pl)) : be("", !0),
5052
- X("time", {
5053
- class: "text-xs text-gray-600 ml-4 dark:text-gray-400",
5054
- pubdate: "",
5055
- datetime: s.comment.createdAt,
5056
- title: Y(Ss)(s.comment.createdAt)
5057
- }, ve(Y(Ss)(s.comment.createdAt)), 9, ml),
5058
- !s.isFirstLevel && s.comment.parent_id !== s.comment.ancestor_id ? (D(), q("a", {
5057
+ Sn(ve(i.comment.user.name), 1),
5058
+ i.comment.isAdmin ? (D(), q("div", pl, gl)) : be("", !0),
5059
+ W("a", {
5060
+ class: "ml-4 no-underline hover:underline",
5061
+ href: o(i.comment.id)
5062
+ }, [
5063
+ W("time", {
5064
+ class: "text-xs text-gray-600 dark:text-gray-400",
5065
+ pubdate: "",
5066
+ datetime: i.comment.createdAt,
5067
+ title: Y(Ss)(i.comment.createdAt)
5068
+ }, ve(Y(Ss)(i.comment.createdAt)), 9, _l)
5069
+ ], 8, bl),
5070
+ !i.isFirstLevel && i.comment.parent_id !== i.comment.ancestor_id ? (D(), q("a", {
5059
5071
  key: 1,
5060
5072
  class: "text-xs link link-hover ml-4",
5061
- href: "#awcm-" + s.comment.parent_id
5062
- }, "reply to " + ve(o(s.comment.parent_id)) + "(#" + ve(s.comment.parent_id) + ")", 9, gl)) : be("", !0)
5073
+ href: "#awcm-" + i.comment.parent_id
5074
+ }, "reply to " + ve(s(i.comment.parent_id)) + "(#" + ve(i.comment.parent_id) + ")", 9, yl)) : be("", !0)
5063
5075
  ]),
5064
- X("button", {
5076
+ W("button", {
5065
5077
  class: "ac-btn ac-btn-sm ac-btn-circle border-0",
5066
5078
  type: "button",
5067
- onClick: i[0] || (i[0] = (c) => s.comment.isReplying = !s.comment.isReplying)
5068
- }, _l)
5079
+ onClick: r[0] || (r[0] = (a) => i.comment.isReplying = !i.comment.isReplying)
5080
+ }, vl)
5069
5081
  ]),
5070
- X("p", {
5082
+ W("p", {
5071
5083
  class: "text-gray-500 dark:text-gray-400",
5072
- innerHTML: Y(co)(s.comment.content)
5073
- }, null, 8, yl),
5074
- s.comment.status === Y(No).Pending ? (D(), q("p", wl, "comments normally got approved within 24 hours")) : be("", !0)
5084
+ innerHTML: Y(co)(i.comment.content)
5085
+ }, null, 8, kl),
5086
+ i.comment.status === Y(No).Pending ? (D(), q("p", xl, "comments normally got approved within 24 hours")) : be("", !0)
5075
5087
  ]),
5076
- s.comment.isReplying && s.isFirstLevel ? (D(), Lt(ro, {
5088
+ i.comment.isReplying && i.isFirstLevel ? (D(), Lt(ro, {
5077
5089
  key: 0,
5078
5090
  class: "mt-3 ml-12",
5079
5091
  "no-version": "",
5080
- "ancestor-id": Number(s.ancestorId),
5081
- "parent-id": Number(s.comment.id),
5082
- onClose: i[1] || (i[1] = (c) => s.comment.isReplying = !1)
5092
+ "ancestor-id": Number(i.ancestorId),
5093
+ "parent-id": Number(i.comment.id),
5094
+ onClose: r[1] || (r[1] = (a) => i.comment.isReplying = !1)
5083
5095
  }, null, 8, ["ancestor-id", "parent-id"])) : be("", !0),
5084
- s.comment.children?.length ? (D(!0), q(ye, { key: 1 }, pi(s.comment.children, (c) => (D(), Lt(r, {
5096
+ i.comment.children?.length ? (D(!0), q(ye, { key: 1 }, pi(i.comment.children, (a) => (D(), Lt(c, {
5085
5097
  class: "ml-12",
5086
- key: c.id,
5087
- comment: c,
5088
- "ancestor-id": Number(s.ancestorId),
5098
+ key: a.id,
5099
+ comment: a,
5100
+ "ancestor-id": Number(i.ancestorId),
5089
5101
  "is-first-level": !1
5090
5102
  }, null, 8, ["comment", "ancestor-id"]))), 128)) : be("", !0),
5091
- s.comment.isReplying && !s.isFirstLevel ? (D(), Lt(ro, {
5103
+ i.comment.isReplying && !i.isFirstLevel ? (D(), Lt(ro, {
5092
5104
  key: 2,
5093
5105
  class: "mt-3 ml-12",
5094
- "ancestor-id": Number(s.ancestorId),
5095
- "parent-id": Number(s.comment.id)
5106
+ "ancestor-id": Number(i.ancestorId),
5107
+ "parent-id": Number(i.comment.id)
5096
5108
  }, null, 8, ["ancestor-id", "parent-id"])) : be("", !0)
5097
5109
  ], 42, rl);
5098
5110
  };
5099
5111
  }
5100
- }), xl = {
5112
+ }), Tl = {
5101
5113
  key: 0,
5102
5114
  class: "comments-wrapper"
5103
- }, Il = ["disabled"], Cl = {
5115
+ }, Ol = ["disabled"], Sl = {
5104
5116
  key: 0,
5105
5117
  class: "ac-loading ac-loading-xs ac-loading-spinner"
5106
- }, Tl = {
5118
+ }, Pl = {
5107
5119
  key: 1,
5108
5120
  class: "pt-8 text-center"
5109
- }, Ol = /* @__PURE__ */ X("span", { class: "ac-loading ac-loading-spinner" }, null, -1), Sl = [
5110
- Ol
5111
- ], Pl = {
5121
+ }, El = /* @__PURE__ */ W("span", { class: "ac-loading ac-loading-spinner" }, null, -1), jl = [
5122
+ El
5123
+ ], Al = {
5112
5124
  name: "CommentSections"
5113
- }, El = /* @__PURE__ */ In({
5114
- ...Pl,
5125
+ }, Rl = /* @__PURE__ */ In({
5126
+ ...Al,
5115
5127
  setup(e) {
5116
5128
  const t = An();
5117
5129
  t.loadComments();
5118
5130
  function n() {
5119
5131
  t.start += 20, t.loadComments();
5120
5132
  }
5121
- return (o, s) => Y(t).isLoaded ? (D(), q("div", xl, [
5122
- (D(!0), q(ye, null, pi(Object.values(Y(t).comments).reverse(), (i) => (D(), Lt(kl, {
5133
+ return (o, s) => Y(t).isLoaded ? (D(), q("div", Tl, [
5134
+ (D(!0), q(ye, null, pi(Object.values(Y(t).comments).reverse(), (i) => (D(), Lt(Cl, {
5123
5135
  key: i.id,
5124
5136
  comment: i,
5125
5137
  "ancestor-id": Number(i.id),
@@ -5132,35 +5144,35 @@ const rl = ["id"], cl = { class: "p-6 text-base bg-base-200 rounded-lg dark:bg-g
5132
5144
  onClick: n,
5133
5145
  disabled: Y(t).loadingMore
5134
5146
  }, [
5135
- Y(t).loadingMore ? (D(), q("span", Cl)) : be("", !0),
5147
+ Y(t).loadingMore ? (D(), q("span", Sl)) : be("", !0),
5136
5148
  Sn("Load More")
5137
- ], 8, Il)) : be("", !0)
5138
- ])) : (D(), q("div", Tl, Sl));
5149
+ ], 8, Ol)) : be("", !0)
5150
+ ])) : (D(), q("div", Pl, jl));
5139
5151
  }
5140
- }), jl = { class: "awesome-comment" }, Al = {
5152
+ }), Nl = { class: "awesome-comment" }, Ll = {
5141
5153
  key: 0,
5142
5154
  class: "ac-alert ac-alert-error mb-4"
5143
- }, Rl = { class: "flex justify-between items-center py-2" }, Nl = { class: "text-lg font-bold text-base-content my-0" }, Ll = {
5155
+ }, Ml = { class: "flex justify-between items-center py-2" }, Fl = { class: "text-lg font-bold text-base-content my-0" }, $l = {
5144
5156
  key: 0,
5145
5157
  class: "ac-loading ac-loading-spinner"
5146
- }, Ml = {
5158
+ }, Kl = {
5147
5159
  key: 1,
5148
5160
  class: "ac-dropdown ac-dropdown-end"
5149
- }, Fl = {
5161
+ }, zl = {
5150
5162
  key: 0,
5151
5163
  class: "ac-avatar flex",
5152
5164
  tabindex: "0"
5153
- }, $l = { class: "w-6 h-6 rounded-full" }, Kl = ["alt", "src"], zl = {
5165
+ }, Ul = { class: "w-6 h-6 rounded-full" }, Dl = ["alt", "src"], Wl = {
5154
5166
  key: 1,
5155
5167
  class: "ac-btn ac-btn-ghost",
5156
5168
  tabindex: "0"
5157
- }, Ul = {
5169
+ }, Hl = {
5158
5170
  class: "ac-dropdown-content z-10 ac-menu p-2 shadow bg-base-100 rounded-box w-52",
5159
5171
  tabindex: "0"
5160
- }, Dl = {
5172
+ }, Zl = {
5161
5173
  key: 0,
5162
5174
  class: "border-b border-neutral pb-2 mb-2 pointer-events-none"
5163
- }, Wl = { class: "text-base-content" }, Hl = ["disabled"], Zl = ["disabled"], Vl = /* @__PURE__ */ In({
5175
+ }, Vl = { class: "text-base-content" }, Xl = ["disabled"], Bl = ["disabled"], Jl = /* @__PURE__ */ In({
5164
5176
  __name: "App",
5165
5177
  setup(e) {
5166
5178
  const t = An(), {
@@ -5170,10 +5182,13 @@ const rl = ["id"], cl = { class: "p-6 text-base bg-base-200 rounded-lg dark:bg-g
5170
5182
  loginWithPopup: i,
5171
5183
  logout: r
5172
5184
  } = $i(), c = Oo(() => {
5173
- const f = t.total > 20 || t.total === 20 && t.hasMore ? "20+" : t.total, d = new CustomEvent("AwesomeComment:total", {
5185
+ const f = t.hasMore ? t.total + "+" : t.total;
5186
+ if (t.total === 0)
5187
+ return "0";
5188
+ const d = new CustomEvent("AwesomeComment:total", {
5174
5189
  bubbles: !0,
5175
5190
  cancelable: !0,
5176
- detail: f
5191
+ detail: t.total
5177
5192
  });
5178
5193
  return document.body.dispatchEvent(d), f;
5179
5194
  });
@@ -5185,34 +5200,34 @@ const rl = ["id"], cl = { class: "p-6 text-base bg-base-200 rounded-lg dark:bg-g
5185
5200
  openUrl: !1
5186
5201
  });
5187
5202
  }
5188
- return (f, d) => (D(), q("div", jl, [
5189
- Y(t).message ? (D(), q("div", Al, [
5190
- X("p", null, ve(Y(t).message), 1)
5203
+ return (f, d) => (D(), q("div", Nl, [
5204
+ Y(t).message ? (D(), q("div", Ll, [
5205
+ W("p", null, ve(Y(t).message), 1)
5191
5206
  ])) : be("", !0),
5192
- X("header", Rl, [
5193
- X("h2", Nl, "Discussion (" + ve(c.value) + ")", 1),
5194
- Y(o) ? (D(), q("span", Ll)) : (D(), q("div", Ml, [
5207
+ W("header", Ml, [
5208
+ W("h2", Fl, "Discussion (" + ve(c.value) + ")", 1),
5209
+ Y(o) ? (D(), q("span", $l)) : (D(), q("div", Kl, [
5195
5210
  Y(n) && Y(s) ? (D(), q(ye, { key: 0 }, [
5196
- Y(s).picture ? (D(), q("label", Fl, [
5197
- X("div", $l, [
5198
- X("img", {
5211
+ Y(s).picture ? (D(), q("label", zl, [
5212
+ W("div", Ul, [
5213
+ W("img", {
5199
5214
  class: "w-full h-full block",
5200
5215
  alt: Y(s).name || Y(s).email,
5201
5216
  src: Y(s).picture
5202
- }, null, 8, Kl)
5217
+ }, null, 8, Dl)
5203
5218
  ])
5204
- ])) : (D(), q("label", zl, ve(Y(s).email), 1)),
5205
- X("ul", Ul, [
5206
- Y(s).picture ? (D(), q("li", Dl, [
5207
- X("span", Wl, ve(Y(s).email), 1)
5219
+ ])) : (D(), q("label", Wl, ve(Y(s).email), 1)),
5220
+ W("ul", Hl, [
5221
+ Y(s).picture ? (D(), q("li", Zl, [
5222
+ W("span", Vl, ve(Y(s).email), 1)
5208
5223
  ])) : be("", !0),
5209
- X("li", null, [
5210
- X("button", {
5224
+ W("li", null, [
5225
+ W("button", {
5211
5226
  class: "border-0 bg-base-100",
5212
5227
  type: "button",
5213
5228
  disabled: Y(o),
5214
5229
  onClick: l
5215
- }, "Logout", 8, Hl)
5230
+ }, "Logout", 8, Xl)
5216
5231
  ])
5217
5232
  ])
5218
5233
  ], 64)) : (D(), q("button", {
@@ -5221,17 +5236,17 @@ const rl = ["id"], cl = { class: "p-6 text-base bg-base-200 rounded-lg dark:bg-g
5221
5236
  type: "button",
5222
5237
  disabled: Y(o),
5223
5238
  onClick: a
5224
- }, "Login", 8, Zl))
5239
+ }, "Login", 8, Bl))
5225
5240
  ]))
5226
5241
  ]),
5227
5242
  Oe(ro),
5228
- Oe(El)
5243
+ Oe(Rl)
5229
5244
  ]));
5230
5245
  }
5231
5246
  }), Ps = [];
5232
5247
  let Ki = null;
5233
- function Xl(e, t) {
5234
- const n = ya(Vl), o = ka(), s = Ki || Fi({
5248
+ function Yl(e, t) {
5249
+ const n = ya(Jl), o = ka(), s = Ki || Fi({
5235
5250
  domain: e,
5236
5251
  clientId: t,
5237
5252
  authorizationParams: {
@@ -5240,14 +5255,14 @@ function Xl(e, t) {
5240
5255
  });
5241
5256
  return n.use(s), n.use(o), n;
5242
5257
  }
5243
- const Bl = {
5258
+ const ql = {
5244
5259
  postId: "",
5245
5260
  apiUrl: "",
5246
5261
  domain: "",
5247
5262
  clientId: "",
5248
5263
  init(e, t, n, o, s) {
5249
5264
  t ??= this.postId, n ??= this.apiUrl, o ??= this.domain, s ??= this.clientId;
5250
- const i = Xl(o, s);
5265
+ const i = Yl(o, s);
5251
5266
  i.provide("ApiBaseUrl", n), i.provide("postId", t), i.provide("Auth0Domain", o), i.provide("comments", Ps), i.mount(e);
5252
5267
  },
5253
5268
  async preload(e, t, n, o) {
@@ -5265,5 +5280,5 @@ const Bl = {
5265
5280
  }
5266
5281
  };
5267
5282
  export {
5268
- Bl as default
5283
+ ql as default
5269
5284
  };