@apolitical/component-library 1.14.1-beta.0 → 1.14.1-beta.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 (4) hide show
  1. package/index.js +7 -7
  2. package/index.mjs +111 -102
  3. package/package.json +1 -1
  4. package/style.css +1 -1
package/index.mjs CHANGED
@@ -112,18 +112,18 @@ function ys() {
112
112
  }
113
113
  function T(m, v, y) {
114
114
  {
115
- var $ = E.ReactDebugCurrentFrame, I = $.getStackAddendum();
116
- I !== "" && (v += "%s", y = y.concat([I]));
115
+ var $ = E.ReactDebugCurrentFrame, H = $.getStackAddendum();
116
+ H !== "" && (v += "%s", y = y.concat([H]));
117
117
  var z = y.map(function(R) {
118
118
  return String(R);
119
119
  });
120
120
  z.unshift("Warning: " + v), Function.prototype.apply.call(console[m], console, z);
121
121
  }
122
122
  }
123
- var M = !1, C = !1, H = !1, Y = !1, x = !1, b;
123
+ var M = !1, C = !1, O = !1, Y = !1, x = !1, b;
124
124
  b = Symbol.for("react.module.reference");
125
125
  function U(m) {
126
- return !!(typeof m == "string" || typeof m == "function" || m === r || m === c || x || m === i || m === u || m === l || Y || m === p || M || C || H || typeof m == "object" && m !== null && (m.$$typeof === h || m.$$typeof === f || m.$$typeof === d || m.$$typeof === o || m.$$typeof === a || // This needs to include all possible module reference object
126
+ return !!(typeof m == "string" || typeof m == "function" || m === r || m === c || x || m === i || m === u || m === l || Y || m === p || M || C || O || typeof m == "object" && m !== null && (m.$$typeof === h || m.$$typeof === f || m.$$typeof === d || m.$$typeof === o || m.$$typeof === a || // This needs to include all possible module reference object
127
127
  // types supported by any Flight configuration anywhere since
128
128
  // we don't know which Flight build this will end up being used
129
129
  // with.
@@ -133,13 +133,13 @@ function ys() {
133
133
  var $ = m.displayName;
134
134
  if ($)
135
135
  return $;
136
- var I = v.displayName || v.name || "";
137
- return I !== "" ? y + "(" + I + ")" : y;
136
+ var H = v.displayName || v.name || "";
137
+ return H !== "" ? y + "(" + H + ")" : y;
138
138
  }
139
139
  function G(m) {
140
140
  return m.displayName || "Context";
141
141
  }
142
- function O(m) {
142
+ function B(m) {
143
143
  if (m == null)
144
144
  return null;
145
145
  if (typeof m.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof m == "function")
@@ -172,11 +172,11 @@ function ys() {
172
172
  return w(m, m.render, "ForwardRef");
173
173
  case f:
174
174
  var $ = m.displayName || null;
175
- return $ !== null ? $ : O(m.type) || "Memo";
175
+ return $ !== null ? $ : B(m.type) || "Memo";
176
176
  case h: {
177
- var I = m, z = I._payload, R = I._init;
177
+ var H = m, z = H._payload, R = H._init;
178
178
  try {
179
- return O(R(z));
179
+ return B(R(z));
180
180
  } catch {
181
181
  return null;
182
182
  }
@@ -184,7 +184,7 @@ function ys() {
184
184
  }
185
185
  return null;
186
186
  }
187
- var B = Object.assign, W = 0, V, K, oe, ae, ie, le, re;
187
+ var I = Object.assign, W = 0, V, K, oe, ae, ie, le, re;
188
188
  function P() {
189
189
  }
190
190
  P.__reactDisabledLog = !0;
@@ -220,25 +220,25 @@ function ys() {
220
220
  writable: !0
221
221
  };
222
222
  Object.defineProperties(console, {
223
- log: B({}, m, {
223
+ log: I({}, m, {
224
224
  value: V
225
225
  }),
226
- info: B({}, m, {
226
+ info: I({}, m, {
227
227
  value: K
228
228
  }),
229
- warn: B({}, m, {
229
+ warn: I({}, m, {
230
230
  value: oe
231
231
  }),
232
- error: B({}, m, {
232
+ error: I({}, m, {
233
233
  value: ae
234
234
  }),
235
- group: B({}, m, {
235
+ group: I({}, m, {
236
236
  value: ie
237
237
  }),
238
- groupCollapsed: B({}, m, {
238
+ groupCollapsed: I({}, m, {
239
239
  value: le
240
240
  }),
241
- groupEnd: B({}, m, {
241
+ groupEnd: I({}, m, {
242
242
  value: re
243
243
  })
244
244
  });
@@ -252,8 +252,8 @@ function ys() {
252
252
  if (F === void 0)
253
253
  try {
254
254
  throw Error();
255
- } catch (I) {
256
- var $ = I.stack.trim().match(/\n( *(at )?)/);
255
+ } catch (H) {
256
+ var $ = H.stack.trim().match(/\n( *(at )?)/);
257
257
  F = $ && $[1] || "";
258
258
  }
259
259
  return `
@@ -275,7 +275,7 @@ function ys() {
275
275
  }
276
276
  var $;
277
277
  fe = !0;
278
- var I = Error.prepareStackTrace;
278
+ var H = Error.prepareStackTrace;
279
279
  Error.prepareStackTrace = void 0;
280
280
  var z;
281
281
  z = ne.current, ne.current = null, te();
@@ -331,7 +331,7 @@ function ys() {
331
331
  }
332
332
  }
333
333
  } finally {
334
- fe = !1, ne.current = z, ce(), Error.prepareStackTrace = I;
334
+ fe = !1, ne.current = z, ce(), Error.prepareStackTrace = H;
335
335
  }
336
336
  var Ce = m ? m.displayName || m.name : "", nn = Ce ? J(Ce) : "";
337
337
  return typeof m == "function" && pe.set(m, nn), nn;
@@ -363,9 +363,9 @@ function ys() {
363
363
  case f:
364
364
  return Ue(m.type, v, y);
365
365
  case h: {
366
- var $ = m, I = $._payload, z = $._init;
366
+ var $ = m, H = $._payload, z = $._init;
367
367
  try {
368
- return Ue(z(I), v, y);
368
+ return Ue(z(H), v, y);
369
369
  } catch {
370
370
  }
371
371
  }
@@ -380,7 +380,7 @@ function ys() {
380
380
  } else
381
381
  zt.setExtraStackFrame(null);
382
382
  }
383
- function On(m, v, y, $, I) {
383
+ function On(m, v, y, $, H) {
384
384
  {
385
385
  var z = Function.call.bind(We);
386
386
  for (var R in m)
@@ -395,7 +395,7 @@ function ys() {
395
395
  } catch (q) {
396
396
  A = q;
397
397
  }
398
- A && !(A instanceof Error) && (ze(I), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", $ || "React class", y, R, typeof A), ze(null)), A instanceof Error && !(A.message in Wt) && (Wt[A.message] = !0, ze(I), k("Failed %s type: %s", y, A.message), ze(null));
398
+ A && !(A instanceof Error) && (ze(H), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", $ || "React class", y, R, typeof A), ze(null)), A instanceof Error && !(A.message in Wt) && (Wt[A.message] = !0, ze(H), k("Failed %s type: %s", y, A.message), ze(null));
399
399
  }
400
400
  }
401
401
  }
@@ -448,8 +448,8 @@ function ys() {
448
448
  }
449
449
  function zn(m, v) {
450
450
  if (typeof m.ref == "string" && Re.current && v && Re.current.stateNode !== v) {
451
- var y = O(Re.current.type);
452
- ft[y] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O(Re.current.type), m.ref), ft[y] = !0);
451
+ var y = B(Re.current.type);
452
+ ft[y] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', B(Re.current.type), m.ref), ft[y] = !0);
453
453
  }
454
454
  }
455
455
  function Vn(m, v) {
@@ -474,7 +474,7 @@ function ys() {
474
474
  });
475
475
  }
476
476
  }
477
- var Gn = function(m, v, y, $, I, z, R) {
477
+ var Gn = function(m, v, y, $, H, z, R) {
478
478
  var A = {
479
479
  // This tag allows us to uniquely identify this as a React Element
480
480
  $$typeof: t,
@@ -500,13 +500,13 @@ function ys() {
500
500
  configurable: !1,
501
501
  enumerable: !1,
502
502
  writable: !1,
503
- value: I
503
+ value: H
504
504
  }), Object.freeze && (Object.freeze(A.props), Object.freeze(A)), A;
505
505
  };
506
- function Jn(m, v, y, $, I) {
506
+ function Jn(m, v, y, $, H) {
507
507
  {
508
508
  var z, R = {}, A = null, ue = null;
509
- y !== void 0 && (Yt(y), A = "" + y), Wn(v) && (Yt(v.key), A = "" + v.key), Un(v) && (ue = v.ref, zn(v, I));
509
+ y !== void 0 && (Yt(y), A = "" + y), Wn(v) && (Yt(v.key), A = "" + v.key), Un(v) && (ue = v.ref, zn(v, H));
510
510
  for (z in v)
511
511
  We.call(v, z) && !Qn.hasOwnProperty(z) && (R[z] = v[z]);
512
512
  if (m && m.defaultProps) {
@@ -518,7 +518,7 @@ function ys() {
518
518
  var ee = typeof m == "function" ? m.displayName || m.name || "Unknown" : m;
519
519
  A && Vn(R, ee), ue && Yn(R, ee);
520
520
  }
521
- return Gn(m, A, ue, I, $, Re.current, R);
521
+ return Gn(m, A, ue, H, $, Re.current, R);
522
522
  }
523
523
  }
524
524
  var ht = E.ReactCurrentOwner, Xt = E.ReactDebugCurrentFrame;
@@ -537,7 +537,7 @@ function ys() {
537
537
  function Zt() {
538
538
  {
539
539
  if (ht.current) {
540
- var m = O(ht.current.type);
540
+ var m = B(ht.current.type);
541
541
  if (m)
542
542
  return `
543
543
 
@@ -580,7 +580,7 @@ Check the top-level render call using <` + y + ">.");
580
580
  return;
581
581
  Kt[y] = !0;
582
582
  var $ = "";
583
- m && m._owner && m._owner !== ht.current && ($ = " It was passed a child from " + O(m._owner.type) + "."), Me(m), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', y, $), Me(null);
583
+ m && m._owner && m._owner !== ht.current && ($ = " It was passed a child from " + B(m._owner.type) + "."), Me(m), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', y, $), Me(null);
584
584
  }
585
585
  }
586
586
  function en(m, v) {
@@ -595,9 +595,9 @@ Check the top-level render call using <` + y + ">.");
595
595
  else if (gt(m))
596
596
  m._store && (m._store.validated = !0);
597
597
  else if (m) {
598
- var I = g(m);
599
- if (typeof I == "function" && I !== m.entries)
600
- for (var z = I.call(m), R; !(R = z.next()).done; )
598
+ var H = g(m);
599
+ if (typeof H == "function" && H !== m.entries)
600
+ for (var z = H.call(m), R; !(R = z.next()).done; )
601
601
  gt(R.value) && qt(R.value, v);
602
602
  }
603
603
  }
@@ -617,12 +617,12 @@ Check the top-level render call using <` + y + ">.");
617
617
  else
618
618
  return;
619
619
  if (y) {
620
- var $ = O(v);
620
+ var $ = B(v);
621
621
  On(y, m.props, "prop", $, m);
622
622
  } else if (v.PropTypes !== void 0 && !pt) {
623
623
  pt = !0;
624
- var I = O(v);
625
- k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", I || "Unknown");
624
+ var H = B(v);
625
+ k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", H || "Unknown");
626
626
  }
627
627
  typeof v.getDefaultProps == "function" && !v.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
628
628
  }
@@ -639,18 +639,18 @@ Check the top-level render call using <` + y + ">.");
639
639
  m.ref !== null && (Me(m), k("Invalid attribute `ref` supplied to `React.Fragment`."), Me(null));
640
640
  }
641
641
  }
642
- function tn(m, v, y, $, I, z) {
642
+ function tn(m, v, y, $, H, z) {
643
643
  {
644
644
  var R = U(m);
645
645
  if (!R) {
646
646
  var A = "";
647
647
  (m === void 0 || typeof m == "object" && m !== null && Object.keys(m).length === 0) && (A += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
648
- var ue = Xn(I);
648
+ var ue = Xn(H);
649
649
  ue ? A += ue : A += Zt();
650
650
  var q;
651
- m === null ? q = "null" : mt(m) ? q = "array" : m !== void 0 && m.$$typeof === t ? (q = "<" + (O(m.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : q = typeof m, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, A);
651
+ m === null ? q = "null" : mt(m) ? q = "array" : m !== void 0 && m.$$typeof === t ? (q = "<" + (B(m.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : q = typeof m, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, A);
652
652
  }
653
- var ee = Jn(m, v, y, I, z);
653
+ var ee = Jn(m, v, y, H, z);
654
654
  if (ee == null)
655
655
  return ee;
656
656
  if (R) {
@@ -723,7 +723,7 @@ function Ss(e, t, n) {
723
723
  return !i.current || b >= t || b < 0 || j && x - c.current >= g;
724
724
  }, C = function(x) {
725
725
  return d.current = null, _ && o.current ? k(x) : (o.current = a.current = null, u.current);
726
- }, H = function x() {
726
+ }, O = function x() {
727
727
  var b = Date.now();
728
728
  if (M(b))
729
729
  return C(b);
@@ -735,11 +735,11 @@ function Ss(e, t, n) {
735
735
  var x = Date.now(), b = M(x);
736
736
  if (o.current = [].slice.call(arguments), a.current = r, i.current = x, b) {
737
737
  if (!d.current && f.current)
738
- return c.current = i.current, T(H, t), p ? k(i.current) : u.current;
738
+ return c.current = i.current, T(O, t), p ? k(i.current) : u.current;
739
739
  if (j)
740
- return T(H, t), k(i.current);
740
+ return T(O, t), k(i.current);
741
741
  }
742
- return d.current || T(H, t), u.current;
742
+ return d.current || T(O, t), u.current;
743
743
  };
744
744
  return Y.cancel = function() {
745
745
  d.current && (h ? cancelAnimationFrame(d.current) : clearTimeout(d.current)), c.current = 0, o.current = i.current = a.current = d.current = null;
@@ -2917,7 +2917,7 @@ const kr = ({
2917
2917
  f(M), p(!M.length);
2918
2918
  },
2919
2919
  autoFocus: !1,
2920
- getLabel: (M, C, H) => /* @__PURE__ */ s.jsxs("div", { className: "email text-medium", children: [
2920
+ getLabel: (M, C, O) => /* @__PURE__ */ s.jsxs("div", { className: "email text-medium", children: [
2921
2921
  /* @__PURE__ */ s.jsx("div", { "data-tag-item": !0, children: M }),
2922
2922
  /* @__PURE__ */ s.jsx(
2923
2923
  X,
@@ -2926,7 +2926,7 @@ const kr = ({
2926
2926
  size: "small",
2927
2927
  icon: { icon: "close" },
2928
2928
  onClick: () => {
2929
- H(C), p(!l.length);
2929
+ O(C), p(!l.length);
2930
2930
  },
2931
2931
  className: "remove-email-button",
2932
2932
  screenreaderText: g({ id: "overlay_close" })
@@ -3528,18 +3528,18 @@ const he = "discussion_form_", Fn = ({
3528
3528
  const k = (w) => {
3529
3529
  const G = w.target.value;
3530
3530
  h(G);
3531
- let O;
3532
- !l || !l.id ? O = xe(
3531
+ let B;
3532
+ !l || !l.id ? B = xe(
3533
3533
  u.formatMessage,
3534
3534
  `${he}error_loggedOut`,
3535
3535
  e.type,
3536
3536
  "action"
3537
- ) : t ? G.length >= i && (O = `${he}error_tooLong`) : O = xe(
3537
+ ) : t ? G.length >= i && (B = `${he}error_tooLong`) : B = xe(
3538
3538
  u.formatMessage,
3539
3539
  `${he}error_noPermission`,
3540
3540
  e.type,
3541
3541
  "action"
3542
- ), O ? _(O) : p && _(!1);
3542
+ ), B ? _(B) : p && _(!1);
3543
3543
  };
3544
3544
  let T = `${e.type}-form`;
3545
3545
  if (e.type === "response" || e.type === "reply") {
@@ -3547,32 +3547,32 @@ const he = "discussion_form_", Fn = ({
3547
3547
  w && (T = `${T}-${w.slice(-15)}`);
3548
3548
  }
3549
3549
  const M = async (w) => {
3550
- var O;
3551
- if (w.preventDefault(), w.stopPropagation(), !l || !l.id || !t || H)
3550
+ var B;
3551
+ if (w.preventDefault(), w.stopPropagation(), !l || !l.id || !t || O)
3552
3552
  return;
3553
3553
  Ze && clearTimeout(Ze), g("submitting");
3554
3554
  const G = window.location.pathname;
3555
3555
  try {
3556
- let B;
3556
+ let I;
3557
3557
  switch (e.type) {
3558
3558
  case "post":
3559
- B = await o.create({ content: f });
3559
+ I = await o.create({ content: f });
3560
3560
  break;
3561
3561
  case "question":
3562
- B = await o.create({
3562
+ I = await o.create({
3563
3563
  title: f,
3564
3564
  authorId: l && l.id,
3565
- ...(O = o.props) == null ? void 0 : O.create
3565
+ ...(B = o.props) == null ? void 0 : B.create
3566
3566
  });
3567
3567
  break;
3568
3568
  case "response":
3569
- B = await o.create(
3569
+ I = await o.create(
3570
3570
  { question: e.slugs.question },
3571
3571
  { body: f, authorId: l && l.id, contentPath: G }
3572
3572
  );
3573
3573
  break;
3574
3574
  case "reply":
3575
- B = await o.create(
3575
+ I = await o.create(
3576
3576
  { question: e.slugs.question, answer: e.slugs.answer },
3577
3577
  { body: f, authorId: l && l.id, contentPath: G }
3578
3578
  );
@@ -3580,11 +3580,11 @@ const he = "discussion_form_", Fn = ({
3580
3580
  default:
3581
3581
  break;
3582
3582
  }
3583
- await As(1e3), o.callback && await o.callback(B), Ze = setTimeout(() => {
3583
+ await As(1e3), o.callback && await o.callback(I), Ze = setTimeout(() => {
3584
3584
  h(""), g("submitted"), C();
3585
3585
  }, 500);
3586
- } catch (B) {
3587
- const W = B;
3586
+ } catch (I) {
3587
+ const W = I;
3588
3588
  let V = `${he}error`;
3589
3589
  W.message.includes("entry already exists") && (V = xe(
3590
3590
  u.formatMessage,
@@ -3602,7 +3602,7 @@ const he = "discussion_form_", Fn = ({
3602
3602
  Ze = setTimeout(() => {
3603
3603
  _(!1), g(!1);
3604
3604
  }, 5e3);
3605
- }, H = !f || !Os(f), Y = j === "submitting", x = [];
3605
+ }, O = !f || !Os(f), Y = j === "submitting", x = [];
3606
3606
  return (n.isEditing && !Y || d.cancel) && x.push({
3607
3607
  variant: "secondary",
3608
3608
  size: { mobile: "small", 600: "medium" },
@@ -3628,7 +3628,7 @@ const he = "discussion_form_", Fn = ({
3628
3628
  "data-gtm-event-context": a,
3629
3629
  "data-gtm-event-type": `${n.isEditing ? "save" : "submit"}-${e.type}-click`,
3630
3630
  "data-testid": "save-button",
3631
- disabled: !l || !l.id || !t || H || Y || n.isEditing && f === n.isEditing.text,
3631
+ disabled: !l || !l.id || !t || O || Y || n.isEditing && f === n.isEditing.text,
3632
3632
  children: u.formatMessage({
3633
3633
  id: `${he}${Y ? n.isEditing ? "saving" : "posting" : n.isEditing ? "save" : "post"}`
3634
3634
  })
@@ -3770,8 +3770,8 @@ const $t = () => {
3770
3770
  C < 0 && (C = 0), j(!0), f(C), p(!h);
3771
3771
  try {
3772
3772
  if (c && c.slugs) {
3773
- const H = $r(c.slugs);
3774
- h ? await a(H) : await o(H, { contentPath: window.location.pathname });
3773
+ const O = $r(c.slugs);
3774
+ h ? await a(O) : await o(O, { contentPath: window.location.pathname });
3775
3775
  }
3776
3776
  } catch {
3777
3777
  f(t), p(i);
@@ -3817,7 +3817,16 @@ const $t = () => {
3817
3817
  ),
3818
3818
  /* @__PURE__ */ s.jsx("span", { className: S("number-of-likes", { "no-likes": l === 0 }), "data-testid": "number-of-likes", children: u.formatMessage({ id: `discussion_likes${r ? "_short" : ""}` }, { number: l }) }),
3819
3819
  n && /* @__PURE__ */ s.jsx(Qs, { isOpen: g, isLoading: n.length === 0, children: n.length && /* @__PURE__ */ s.jsxs("ul", { children: [
3820
- k.map((C) => typeof C == "string" || !C.name ? null : /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(lt, { href: C.id ? `/profiles/${C.id}` : void 0, gtmContext: "Likes", gtmType: "liked-name-click", children: C.name }) }, C.id || window.btoa(C.name))),
3820
+ k.map((C) => typeof C == "string" || !C.name ? null : /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(
3821
+ lt,
3822
+ {
3823
+ href: C.id ? `/profiles/${C.id}` : void 0,
3824
+ gtmContext: "Likes",
3825
+ gtmType: "liked-name-click",
3826
+ onClick: (O) => O == null ? void 0 : O.stopPropagation(),
3827
+ children: C.name
3828
+ }
3829
+ ) }, C.id || window.btoa(C.name))),
3821
3830
  n.length > Mt && /* @__PURE__ */ s.jsx("li", { children: u.formatMessage({ id: "discussion_likes_more" }, { number: n.length - Mt }) })
3822
3831
  ] }) })
3823
3832
  ] })
@@ -3961,7 +3970,7 @@ const ve = "discussion_", Nr = 280, ut = ({
3961
3970
  body: t && t.body || "",
3962
3971
  isEditing: !1,
3963
3972
  didEdit: t && t.isEdited || !1
3964
- }), [C, H] = L(!1), [Y, x] = L("");
3973
+ }), [C, O] = L(!1), [Y, x] = L("");
3965
3974
  if (Z(() => {
3966
3975
  M({
3967
3976
  ...T,
@@ -3970,7 +3979,7 @@ const ve = "discussion_", Nr = 280, ut = ({
3970
3979
  });
3971
3980
  }, [t.isEdited]), r || !t || t.type === "answer" && (!t.slugs || !t.slugs.question))
3972
3981
  return /* @__PURE__ */ s.jsx(ye, { className: "discussion-card discussion-post" });
3973
- const { author: b, canLike: U, createdAt: w, id: G, likes: O = 0, userLiked: B, comments: W = 0 } = t, V = j ? st(T.body, Nr) : T.body, K = E && E.id && typeof b != "string" && b.id && b.id === E.id || !1, oe = typeof U == "boolean" ? U : n ? !K : !1, ae = async (P) => {
3982
+ const { author: b, canLike: U, createdAt: w, id: G, likes: B = 0, userLiked: I, comments: W = 0 } = t, V = j ? st(T.body, Nr) : T.body, K = E && E.id && typeof b != "string" && b.id && b.id === E.id || !1, oe = typeof U == "boolean" ? U : n ? !K : !1, ae = async (P) => {
3974
3983
  P || (P = ""), x("");
3975
3984
  try {
3976
3985
  if (!xs(P, T.body)) {
@@ -4022,7 +4031,7 @@ const ve = "discussion_", Nr = 280, ut = ({
4022
4031
  {
4023
4032
  text: g.formatMessage({ id: `${ve}moreMenu_delete` }),
4024
4033
  onClick: (P) => {
4025
- P.preventDefault(), P.stopPropagation(), H(!0);
4034
+ P.preventDefault(), P.stopPropagation(), O(!0);
4026
4035
  },
4027
4036
  icon: "trash",
4028
4037
  className: "gtm-trackable",
@@ -4117,9 +4126,9 @@ const ve = "discussion_", Nr = 280, ut = ({
4117
4126
  Cr,
4118
4127
  {
4119
4128
  element: "li",
4120
- likes: O,
4129
+ likes: B,
4121
4130
  isShort: !1,
4122
- userLiked: B,
4131
+ userLiked: I,
4123
4132
  content: { type: t.type, slugs: t.slugs },
4124
4133
  canLike: oe,
4125
4134
  peopleWhoLiked: t.peopleWhoLiked,
@@ -4193,7 +4202,7 @@ const ve = "discussion_", Nr = 280, ut = ({
4193
4202
  id: `delete-${t.slug}-modal`,
4194
4203
  isOpen: C,
4195
4204
  functions: { onOpen: () => {
4196
- }, onClose: () => H(!1) },
4205
+ }, onClose: () => O(!1) },
4197
4206
  forceShow: {
4198
4207
  error: Y === "delete-error" ? g.formatMessage(
4199
4208
  { id: "discussion_delete_error" },
@@ -4211,7 +4220,7 @@ const ve = "discussion_", Nr = 280, ut = ({
4211
4220
  buttons: [
4212
4221
  {
4213
4222
  variant: "secondary",
4214
- onClick: () => H(!1),
4223
+ onClick: () => O(!1),
4215
4224
  children: g.formatMessage({ id: "discussion_delete_cancel" })
4216
4225
  },
4217
4226
  {
@@ -4458,25 +4467,25 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4458
4467
  queryKey: [e, t],
4459
4468
  mutationFn: d
4460
4469
  }), {
4461
- mutate: H
4470
+ mutate: O
4462
4471
  } = me(C), Y = Br({
4463
4472
  queryClient: f,
4464
4473
  queryKey: [e, t],
4465
4474
  user: h,
4466
4475
  mutationFn: async ({ activityId: w }) => {
4467
- var B, W, V;
4476
+ var I, W, V;
4468
4477
  const G = p && (p == null ? void 0 : p.find(
4469
4478
  (K) => K.id === w
4470
- )), O = (V = (W = (B = G == null ? void 0 : G.own_reactions) == null ? void 0 : B.like) == null ? void 0 : W.find(
4479
+ )), B = (V = (W = (I = G == null ? void 0 : G.own_reactions) == null ? void 0 : I.like) == null ? void 0 : W.find(
4471
4480
  (K) => K.user_id === (h == null ? void 0 : h.id)
4472
4481
  )) == null ? void 0 : V.id;
4473
- await o({ reactionId: O || "", activityId: w });
4482
+ await o({ reactionId: B || "", activityId: w });
4474
4483
  }
4475
4484
  }), {
4476
4485
  mutate: x
4477
4486
  } = me(Y), b = je(
4478
- ({ activityId: w }) => H({ activityId: w }),
4479
- [H]
4487
+ ({ activityId: w }) => O({ activityId: w }),
4488
+ [O]
4480
4489
  ), U = je(
4481
4490
  ({ activityId: w }) => x({ activityId: w }),
4482
4491
  [x]
@@ -4497,8 +4506,8 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4497
4506
  }
4498
4507
  ),
4499
4508
  !g && Array.isArray(p) && (p == null ? void 0 : p.map((w) => {
4500
- var B, W, V, K, oe, ae, ie, le, re, P, te, ce, ne, F;
4501
- const G = ((B = w == null ? void 0 : w.actor) == null ? void 0 : B.id) === (h == null ? void 0 : h.id), O = Ut(n, G);
4509
+ var I, W, V, K, oe, ae, ie, le, re, P, te, ce, ne, F;
4510
+ const G = ((I = w == null ? void 0 : w.actor) == null ? void 0 : I.id) === (h == null ? void 0 : h.id), B = Ut(n, G);
4502
4511
  return /* @__PURE__ */ s.jsxs(Dt, { children: [
4503
4512
  /* @__PURE__ */ s.jsx(
4504
4513
  ut,
@@ -4506,7 +4515,7 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4506
4515
  content: {
4507
4516
  type: "post",
4508
4517
  body: w == null ? void 0 : w.content,
4509
- canLike: O,
4518
+ canLike: B,
4510
4519
  createdAt: (w == null ? void 0 : w.time) || "",
4511
4520
  slugs: { parentId: t, activityId: w == null ? void 0 : w.id },
4512
4521
  slug: w == null ? void 0 : w.id,
@@ -4778,13 +4787,13 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4778
4787
  queryKey: [e, t, r],
4779
4788
  mutationFn: f
4780
4789
  }), {
4781
- mutate: H
4790
+ mutate: O
4782
4791
  } = me(C), Y = je(
4783
4792
  ({ replyId: b, replyParentId: U }) => M({ replyId: b, replyParentId: U }),
4784
4793
  [M]
4785
4794
  ), x = je(
4786
- ({ replyId: b, replyParentId: U }) => H({ replyId: b, replyParentId: U }),
4787
- [H]
4795
+ ({ replyId: b, replyParentId: U }) => O({ replyId: b, replyParentId: U }),
4796
+ [O]
4788
4797
  );
4789
4798
  return /* @__PURE__ */ s.jsx(
4790
4799
  Pr,
@@ -4807,7 +4816,7 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4807
4816
  }
4808
4817
  ),
4809
4818
  (c == null ? void 0 : c.length) === 0 || (c == null ? void 0 : c.map((b) => {
4810
- var U, w, G, O, B, W, V, K, oe, ae, ie, le, re, P, te, ce, ne;
4819
+ var U, w, G, B, I, W, V, K, oe, ae, ie, le, re, P, te, ce, ne;
4811
4820
  return /* @__PURE__ */ s.jsx(
4812
4821
  ut,
4813
4822
  {
@@ -4823,8 +4832,8 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4823
4832
  },
4824
4833
  slug: "",
4825
4834
  author: {
4826
- id: (O = b == null ? void 0 : b.user) == null ? void 0 : O.id,
4827
- name: (W = (B = b == null ? void 0 : b.user) == null ? void 0 : B.data) == null ? void 0 : W.name,
4835
+ id: (B = b == null ? void 0 : b.user) == null ? void 0 : B.id,
4836
+ name: (W = (I = b == null ? void 0 : b.user) == null ? void 0 : I.data) == null ? void 0 : W.name,
4828
4837
  organization: (K = (V = b == null ? void 0 : b.user) == null ? void 0 : V.data) == null ? void 0 : K.organization,
4829
4838
  jobTitle: (ae = (oe = b == null ? void 0 : b.user) == null ? void 0 : oe.data) == null ? void 0 : ae.jobTitle,
4830
4839
  image: {
@@ -4897,7 +4906,7 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4897
4906
  mutationFn: a
4898
4907
  }), {
4899
4908
  mutate: C
4900
- } = me(M), H = je(
4909
+ } = me(M), O = je(
4901
4910
  ({ replyId: x }) => T({ replyId: x }),
4902
4911
  [T]
4903
4912
  ), Y = je(
@@ -4920,14 +4929,14 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4920
4929
  }
4921
4930
  ),
4922
4931
  (r == null ? void 0 : r.length) === 0 || (r == null ? void 0 : r.map((x) => {
4923
- var w, G, O, B, W, V, K, oe, ae, ie, le, re, P, te, ce, ne, F, J, fe, pe;
4932
+ var w, G, B, I, W, V, K, oe, ae, ie, le, re, P, te, ce, ne, F, J, fe, pe;
4924
4933
  const b = ((w = x == null ? void 0 : x.user) == null ? void 0 : w.id) === (p == null ? void 0 : p.id), U = Ut(i, b);
4925
4934
  return /* @__PURE__ */ s.jsx(Tr, { children: /* @__PURE__ */ s.jsx(
4926
4935
  ut,
4927
4936
  {
4928
4937
  content: {
4929
4938
  type: "reply",
4930
- body: typeof x.data.content == "string" ? (G = x == null ? void 0 : x.data) == null ? void 0 : G.content : ((B = (O = x == null ? void 0 : x.data) == null ? void 0 : O.content) == null ? void 0 : B.text) || "",
4939
+ body: typeof x.data.content == "string" ? (G = x == null ? void 0 : x.data) == null ? void 0 : G.content : ((I = (B = x == null ? void 0 : x.data) == null ? void 0 : B.content) == null ? void 0 : I.text) || "",
4931
4940
  canLike: U,
4932
4941
  createdAt: x == null ? void 0 : x.created_at,
4933
4942
  slugs: {
@@ -4959,7 +4968,7 @@ const Pr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4959
4968
  updateContent: (ge, $e) => E({ replyInfo: ge, content: $e })
4960
4969
  },
4961
4970
  likes: {
4962
- createLike: () => H({ replyId: x == null ? void 0 : x.id }),
4971
+ createLike: () => O({ replyId: x == null ? void 0 : x.id }),
4963
4972
  deleteLike: () => {
4964
4973
  var $e, He, Qe;
4965
4974
  const ge = (($e = x == null ? void 0 : x.own_children) == null ? void 0 : $e.like) && ((Qe = (He = x == null ? void 0 : x.own_children) == null ? void 0 : He.like[0]) == null ? void 0 : Qe.id);
@@ -5088,7 +5097,7 @@ const Fo = ({
5088
5097
  leave: p
5089
5098
  }
5090
5099
  }) => {
5091
- var B, W, V, K, oe, ae, ie, le, re, P, te, ce, ne;
5100
+ var I, W, V, K, oe, ae, ie, le, re, P, te, ce, ne;
5092
5101
  const _ = be(Te), j = ot(), {
5093
5102
  data: g,
5094
5103
  error: E,
@@ -5103,13 +5112,13 @@ const Fo = ({
5103
5112
  mutationFn: async (F) => await c(F)
5104
5113
  }), {
5105
5114
  mutate: C
5106
- } = me(M), H = Jr({
5115
+ } = me(M), O = Jr({
5107
5116
  queryClient: j,
5108
5117
  queryKey: [e, t, n],
5109
5118
  mutationFn: d
5110
5119
  }), {
5111
5120
  mutate: Y
5112
- } = me(H), x = Xr({
5121
+ } = me(O), x = Xr({
5113
5122
  queryClient: j,
5114
5123
  queryKey: [e, t, n],
5115
5124
  user: _,
@@ -5134,7 +5143,7 @@ const Fo = ({
5134
5143
  return /* @__PURE__ */ s.jsx(ct, { variant: "error", text: E.message });
5135
5144
  if (k || T)
5136
5145
  return /* @__PURE__ */ s.jsx(ye, { style: { height: "400px" } });
5137
- const G = ((B = g == null ? void 0 : g.actor) == null ? void 0 : B.id) === (_ == null ? void 0 : _.id), O = Ut(r, G);
5146
+ const G = ((I = g == null ? void 0 : g.actor) == null ? void 0 : I.id) === (_ == null ? void 0 : _.id), B = Ut(r, G);
5138
5147
  return /* @__PURE__ */ s.jsx(
5139
5148
  ut,
5140
5149
  {
@@ -5142,7 +5151,7 @@ const Fo = ({
5142
5151
  content: {
5143
5152
  type: "post",
5144
5153
  body: g == null ? void 0 : g.content,
5145
- canLike: O,
5154
+ canLike: B,
5146
5155
  createdAt: (g == null ? void 0 : g.time) || "",
5147
5156
  slugs: {
5148
5157
  question: `${t}/${n}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "1.14.1-beta.0",
3
+ "version": "1.14.1-beta.2",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {