@logora/debate 0.3.90 → 0.3.91

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 (67) hide show
  1. package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +1 -0
  2. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +1 -0
  3. package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +1 -0
  4. package/dist/assets/components/input/text_editor/{TextEditor.module-DePSfOvG.css → TextEditor.module-CxuSL3l3.css} +1 -1
  5. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +1 -0
  6. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +1 -0
  7. package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
  8. package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
  9. package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
  10. package/dist/assets/components/summary/summary/Summary.module-2bnx3egy.css +1 -0
  11. package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
  12. package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +1 -0
  13. package/dist/components/argument/argument/Argument.js +111 -106
  14. package/dist/components/argument/argument/Argument.module.scss.js +31 -31
  15. package/dist/components/consultation/consultation_box/ConsultationBox.js +80 -111
  16. package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +31 -29
  17. package/dist/components/dialog/dropdown/Dropdown.js +35 -28
  18. package/dist/components/follow/follow_button/FollowButton.js +17 -16
  19. package/dist/components/follow/follow_button/FollowButton.module.scss.js +6 -4
  20. package/dist/components/icons/bild_icons/index.js +58 -56
  21. package/dist/components/icons/hero_icons/index.js +20 -18
  22. package/dist/components/icons/krone_icons/index.js +48 -46
  23. package/dist/components/icons/regular_icons/Follow.js +6 -0
  24. package/dist/components/icons/regular_icons/index.js +20 -18
  25. package/dist/components/icons/spiegel_icons/Downvote.js +6 -0
  26. package/dist/components/icons/spiegel_icons/Upvote.js +6 -0
  27. package/dist/components/icons/spiegel_icons/index.js +54 -52
  28. package/dist/components/icons/stern_icons/index.js +102 -70
  29. package/dist/components/input/argument_input/ArgumentInput.js +201 -197
  30. package/dist/components/input/select/Select.js +19 -19
  31. package/dist/components/input/text_editor/TextEditor.js +143 -129
  32. package/dist/components/input/text_editor/TextEditor.module.scss.js +5 -5
  33. package/dist/components/input/text_editor/plugins/FocusPlugin.js +12 -8
  34. package/dist/components/input/text_editor/plugins/SetContentPlugin.js +13 -13
  35. package/dist/components/input/text_editor/plugins/SetRichContentPlugin.js +10 -10
  36. package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +70 -72
  37. package/dist/components/list/paginated_list/PaginatedList.js +152 -144
  38. package/dist/components/list/paginated_list/action_bar/ActionBar.js +72 -61
  39. package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +18 -16
  40. package/dist/components/notification/notification_menu/NotificationMenu.js +23 -22
  41. package/dist/components/proposal/proposal_box/ProposalBox.js +70 -59
  42. package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +14 -10
  43. package/dist/components/section/section_box/SectionBox.js +10 -10
  44. package/dist/components/section/section_box/SectionBox.module.scss.js +9 -9
  45. package/dist/components/source/context_source_box/ContextSourceBox.js +7 -7
  46. package/dist/components/source/context_source_list/ContextSourceList.js +10 -13
  47. package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +14 -12
  48. package/dist/components/source/source_list_item/SourceListItem.js +42 -28
  49. package/dist/components/source/source_list_item/SourceListItem.module.scss.js +8 -6
  50. package/dist/components/source/source_modal/SourceModal.js +15 -15
  51. package/dist/components/summary/summary/Summary.js +41 -63
  52. package/dist/components/summary/summary/Summary.module.scss.js +10 -6
  53. package/dist/components/summary/summary_box/SummaryBox.module.scss.js +9 -9
  54. package/dist/components/vote/vote_box/VoteBox.js +122 -143
  55. package/dist/components/vote/vote_box/VoteBox.module.scss.js +50 -48
  56. package/package.json +1 -1
  57. package/dist/assets/components/argument/argument/Argument.module-gLfNRLks.css +0 -1
  58. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-BnTr5IaF.css +0 -1
  59. package/dist/assets/components/follow/follow_button/FollowButton.module-Da-cPgwT.css +0 -1
  60. package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-pxwFC_Y2.css +0 -1
  61. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-T4ms_LQ7.css +0 -1
  62. package/dist/assets/components/section/section_box/SectionBox.module-DUeUtdWr.css +0 -1
  63. package/dist/assets/components/source/context_source_list/ContextSourceList.module-D6X_0dB7.css +0 -1
  64. package/dist/assets/components/source/source_list_item/SourceListItem.module-mTxHhXPV.css +0 -1
  65. package/dist/assets/components/summary/summary/Summary.module-DjfmUlkW.css +0 -1
  66. package/dist/assets/components/summary/summary_box/SummaryBox.module-DQVkA8l7.css +0 -1
  67. package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +0 -1
@@ -1,163 +1,166 @@
1
- import { jsxs as _, jsx as i } from "react/jsx-runtime";
2
- import qe from "@rooks/use-sessionstorage-state";
3
- import { useRef as De, useState as c, useEffect as M, Suspense as We, lazy as Ye } from "react";
4
- import { useIntl as $e, FormattedMessage as ce } from "react-intl";
5
- import { useLocation as ke } from "react-router";
6
- import w from "classnames";
1
+ import { jsxs as v, jsx as s } from "react/jsx-runtime";
2
+ import We from "@rooks/use-sessionstorage-state";
3
+ import { useRef as Ye, useState as l, useEffect as h, Suspense as ke, lazy as Re } from "react";
4
+ import { useIntl as je, FormattedMessage as ge } from "react-intl";
5
+ import { useLocation as ze } from "react-router";
6
+ import I from "classnames";
7
7
  import n from "./ArgumentInput.module.scss.js";
8
- import { useDataProvider as Re } from "../../data/data_provider/useDataProvider.js";
9
- import { useList as je } from "../../list/list_provider/useList.js";
10
- import { useConfig as ze } from "../../data/config_provider/useConfig.js";
11
- import { useInput as Oe } from "../input_provider/useInput.js";
12
- import { useAuth as Je } from "../../auth/use_auth/useAuth.js";
13
- import { useFormValidation as Ke } from "../../forms/use_form_validation/useFormValidation.js";
14
- import { useResponsive as Ge } from "../../hooks/use_responsive/useResponsive.js";
15
- import { useAuthRequired as He } from "../../hooks/use_auth_required/useAuthRequired.js";
16
- import { useModal as Qe } from "../../dialog/modal/useModal.js";
17
- import { useToast as Xe } from "../../dialog/toast_provider/useToast.js";
18
- import { TogglePosition as Ze } from "../toggle_position/TogglePosition.js";
19
- import { Avatar as et } from "../../user/avatar/Avatar.js";
20
- import { AuthorBox as tt } from "../../user/author_box/AuthorBox.js";
21
- import { TextEditor as nt } from "../text_editor/TextEditor.js";
22
- import { Icon as at } from "../../icons/icon/Icon.js";
23
- const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ default: I.SideModal }))), Nt = ({
24
- argumentListId: I,
25
- avatarSize: me = 48,
26
- disabled: j = !1,
8
+ import { useDataProvider as Oe } from "../../data/data_provider/useDataProvider.js";
9
+ import { useList as Je } from "../../list/list_provider/useList.js";
10
+ import { useConfig as Ke } from "../../data/config_provider/useConfig.js";
11
+ import { useInput as Ge } from "../input_provider/useInput.js";
12
+ import { useAuth as He } from "../../auth/use_auth/useAuth.js";
13
+ import { useFormValidation as Qe } from "../../forms/use_form_validation/useFormValidation.js";
14
+ import { useResponsive as Xe } from "../../hooks/use_responsive/useResponsive.js";
15
+ import { useAuthRequired as Ze } from "../../hooks/use_auth_required/useAuthRequired.js";
16
+ import { useModal as et } from "../../dialog/modal/useModal.js";
17
+ import { useToast as tt } from "../../dialog/toast_provider/useToast.js";
18
+ import { TogglePosition as nt } from "../toggle_position/TogglePosition.js";
19
+ import { Avatar as at } from "../../user/avatar/Avatar.js";
20
+ import { AuthorBox as st } from "../../user/author_box/AuthorBox.js";
21
+ import { TextEditor as it } from "../text_editor/TextEditor.js";
22
+ import { Icon as ot } from "../../icons/icon/Icon.js";
23
+ const rt = Re(() => import("../../modal/side_modal/index.js").then((S) => ({ default: S.SideModal }))), Lt = ({
24
+ argumentListId: S,
25
+ avatarSize: he = 48,
26
+ disabled: O = !1,
27
27
  positions: a = [],
28
- disabledPositions: S = [],
29
- groupId: v,
30
- groupName: fe,
31
- groupType: z,
32
- hideSourceAction: ge = !1,
28
+ disabledPositions: x = [],
29
+ groupId: b,
30
+ groupName: pe,
31
+ groupType: J,
32
+ hideSourceAction: _e = !1,
33
33
  isReply: r = !1,
34
- onSubmit: O,
35
- parentId: y,
36
- placeholder: he,
37
- positionId: b,
38
- focusOnInit: pe = !1,
39
- activeOnInit: F = !1,
40
- userGuideUrl: J,
41
- hideUserGuideLink: _e = !1,
42
- hideCharCount: Me = !1,
43
- disableAutoActivate: ve = !1
34
+ onSubmit: K,
35
+ parentId: F,
36
+ placeholder: Me,
37
+ positionId: A,
38
+ focusOnInit: ve = !1,
39
+ activeOnInit: P = !1,
40
+ userGuideUrl: G,
41
+ hideUserGuideLink: be = !1,
42
+ hideCharCount: Ae = !1,
43
+ disableAutoActivate: Ce = !1,
44
+ autoFocus: H = !1
44
45
  }) => {
45
- const s = $e(), K = Re(), x = je(), h = ze(), {
46
- focus: G,
47
- setFocus: N,
48
- setReset: be,
49
- inputContent: P,
50
- setInputContent: Ae,
51
- setInputRichContent: Ce
52
- } = Oe(), { isLoggedIn: A, currentUser: u } = Je(), { errors: B, validate: E } = Ke(), { isMobile: m } = Ge(), we = ke(), H = De(null), [V, U] = c([]), [q, D] = c(""), [Q, W] = c(null), [d, p] = c(null), [X, Z] = c(null), [ee, te] = c(!1), [C, ne] = c(!1), [ae, ie] = c({}), [f, Ie] = qe(
46
+ const o = je(), Q = Oe(), N = Je(), p = Ke(), {
47
+ focus: X,
48
+ setFocus: Z,
49
+ setReset: we,
50
+ inputContent: B,
51
+ setInputContent: ee,
52
+ setInputRichContent: Ie
53
+ } = Ge(), { isLoggedIn: C, currentUser: u } = He(), { errors: E, validate: V } = Qe(), { isMobile: m } = Xe(), Se = ze(), te = Ye(null), [U, $] = l([]), [q, D] = l(""), [ne, W] = l(null), [d, _] = l(null), [ae, se] = l(null), [ie, oe] = l(!1), [w, re] = l(!1), [M, ue] = l({}), [xe, Y] = l(!1), [f, Ne] = We(
53
54
  "userSide",
54
55
  {}
55
- ), [g, Se] = c(
56
- !A && h?.actions?.disableInputForVisitor
57
- ), Y = He(), { showModal: xe } = Qe(), { toast: $ } = Xe() || {}, se = new URLSearchParams(
58
- typeof window < "u" ? window.location.search : we.search
56
+ ), [g, Te] = l(
57
+ !C && p?.actions?.disableInputForVisitor
58
+ ), k = Ze(), { showModal: ye } = et(), { toast: R } = tt() || {}, de = new URLSearchParams(
59
+ typeof window < "u" ? window.location.search : Se.search
59
60
  );
60
- M(() => {
61
- Se(
62
- !A && h?.actions?.disableInputForVisitor
61
+ h(() => {
62
+ Te(
63
+ !C && p?.actions?.disableInputForVisitor
63
64
  );
64
- }, [A, h]);
65
- const k = u?.role === "editor" || u?.role === "moderator", oe = u?.moderation_status === "banned";
66
- M(() => {
65
+ }, [C, p]);
66
+ const j = u?.role === "editor" || u?.role === "moderator", le = u?.moderation_status === "banned";
67
+ h(() => {
67
68
  let e = null;
68
- typeof window < "u" && (e = se.get("positionId")), b && b != a[2]?.id && a?.find((t) => t.id === b) ? p(b) : e && e != a[2]?.id ? p(e) : f && f.groupId == v && f.positionId != a[2]?.id && p(f.positionId);
69
- }, [b]), M(() => {
70
- F && (R(), N(!0));
71
- }, [F]), M(() => {
69
+ typeof window < "u" && (e = de.get("positionId")), A && A != a[2]?.id && a?.find((t) => t.id === A) ? _(A) : e && e != a[2]?.id ? _(e) : f && f.groupId == b && f.positionId != a[2]?.id && _(f.positionId);
70
+ }, [A]), h(() => {
71
+ H && Y(!0);
72
+ }, [H]), h(() => {
73
+ P && (z(), Y(!0), T());
74
+ }, [P]), h(() => {
72
75
  if (typeof window < "u") {
73
- const e = pe || se.get("initArgument");
74
- (e === !0 || e === "true") && (N(!0), Ee());
76
+ const e = ve || de.get("initArgument");
77
+ (e === !0 || e === "true") && (Y(!0), T(), $e());
75
78
  }
76
- }, []), M(() => {
77
- G && (re(), N(!1));
78
- }, [G]), M(() => {
79
- P?.id && (Ne(P), N(!0));
80
- }, [P]);
81
- const Ne = (e) => {
82
- ie(e), ne(!0), U(e.sources), D(e.content), W(e.rich_content), Z(e.id), re(), p(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Ce(e.rich_content) : Ae(e.content);
83
- }, re = () => {
84
- H.current.scrollIntoView(!1);
85
- }, ue = () => {
86
- D(""), W(null), ie({}), Z(null), U([]), be(!0);
87
- }, Te = (e) => {
88
- p(e), le(e);
89
- }, Le = () => {
90
- xe(
91
- /* @__PURE__ */ i(We, { fallback: null, children: /* @__PURE__ */ i(
92
- it,
79
+ }, []), h(() => {
80
+ X && (T(), Z(!1));
81
+ }, [X]), h(() => {
82
+ B?.id && (Le(B), Z(!0));
83
+ }, [B]);
84
+ const Le = (e) => {
85
+ ue(e), re(!0), $(e.sources), D(e.content), W(e.rich_content), se(e.id), T(), _(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Ie(e.rich_content) : ee(e.content);
86
+ }, T = () => {
87
+ te.current.scrollIntoView(!1);
88
+ }, ce = () => {
89
+ D(""), W(null), ue({}), se(null), $([]), we(!0), ee(null);
90
+ }, Fe = (e) => {
91
+ _(e), fe(e);
92
+ }, Pe = () => {
93
+ ye(
94
+ /* @__PURE__ */ s(ke, { fallback: null, children: /* @__PURE__ */ s(
95
+ rt,
93
96
  {
94
- modalTitle: s.formatMessage({
97
+ modalTitle: o.formatMessage({
95
98
  id: "modal.side_modal.modal_title",
96
99
  defaultMessage: "Choose your side"
97
100
  }),
98
- onChooseSide: Te,
101
+ onChooseSide: Fe,
99
102
  positions: a,
100
- title: fe,
101
- disabledPositions: !r && S,
102
- isNeutral: f && f.groupId == v && f.positionId === a[2]?.id
103
+ title: pe,
104
+ disabledPositions: !r && x,
105
+ isNeutral: f && f.groupId == b && f.positionId === a[2]?.id
103
106
  }
104
107
  ) })
105
108
  );
106
- }, ye = () => {
107
- A ? X ? Be() : !a || a?.length === 0 || !S?.find((e) => e?.id === d) && d || k && r ? le(r && k && a[0]?.id) : Le() : Y({ loginAction: "argument" });
108
- }, Fe = (e, t) => {
109
- g ? Y({ loginAction: "argument" }) : (D(e), W(t), E({ content: e }, [{ content: ["url", null] }]));
110
- }, Pe = (e) => {
111
- U(e);
112
- }, de = [
109
+ }, Be = () => {
110
+ C ? ae ? Ue() : !a || a?.length === 0 || !x?.find((e) => e?.id === d) && d || j && r ? fe(r && j && a[0]?.id) : Pe() : k({ loginAction: "argument" });
111
+ }, Ee = (e, t) => {
112
+ g ? k({ loginAction: "argument" }) : (D(e), W(t), V({ content: e }, [{ content: ["url", null] }]));
113
+ }, Ve = (e) => {
114
+ $(e);
115
+ }, me = [
113
116
  { content: ["length", 3] },
114
117
  { content: ["required", null] },
115
118
  { content: ["url", null] },
116
119
  ...!a || a?.length === 0 ? [] : [{ position_id: ["required", null] }]
117
- ], le = (e) => {
118
- const t = e || d, l = {
120
+ ], fe = (e) => {
121
+ const t = e || d, c = {
119
122
  content: q,
120
- rich_content: Q,
121
- group_id: v,
122
- ...z && { group_type: z },
123
+ rich_content: ne,
124
+ group_id: b,
125
+ ...J && { group_type: J },
123
126
  ...t && { position_id: t },
124
- is_reply: !!y,
125
- message_id: y || null,
126
- source_ids: V?.map((o) => o.id)
127
+ is_reply: !!F,
128
+ message_id: F || null,
129
+ source_ids: U?.map((i) => i.id)
127
130
  };
128
- E(l, de) && (t && a && a.map((o) => o.id).includes(t) && Ie({
129
- groupId: v,
131
+ V(c, me) && (t && a && a.map((i) => i.id).includes(t) && Ne({
132
+ groupId: b,
130
133
  positionId: t
131
- }), ue(), K.create("messages", l).then((o) => {
132
- if (o.data.success) {
133
- if (y)
134
- O(o.data.data.resource), $(
135
- s.formatMessage({
134
+ }), ce(), Q.create("messages", c).then((i) => {
135
+ if (i.data.success) {
136
+ if (F)
137
+ K(i.data.data.resource), R(
138
+ o.formatMessage({
136
139
  id: "alert.argument_create",
137
140
  defaultMessage: "Your contribution has been sent !"
138
141
  }),
139
142
  {
140
143
  type: "success",
141
- points: s.formatMessage({
144
+ points: o.formatMessage({
142
145
  id: "alert.reply_gain",
143
146
  defaultMessage: " "
144
147
  })
145
148
  }
146
149
  );
147
150
  else {
148
- const T = o.data.data.resource;
149
- let L = I;
150
- t && !m && (L = `argumentList${T.position.id}`), O?.(
151
+ const y = i.data.data.resource;
152
+ let L = S;
153
+ t && !m && (L = `argumentList${y.position.id}`), K?.(
151
154
  q,
152
- a.find((Ue) => Ue.id === t) || null
153
- ), x.add(L, [T]), $(
154
- s.formatMessage({
155
+ a.find((De) => De.id === t) || null
156
+ ), N.add(L, [y]), R(
157
+ o.formatMessage({
155
158
  id: "alert.argument_create",
156
159
  defaultMessage: "Your contribution has been sent !"
157
160
  }),
158
161
  {
159
162
  type: "success",
160
- points: s.formatMessage({
163
+ points: o.formatMessage({
161
164
  id: "alert.argument_create_gain",
162
165
  defaultMessage: "Up to 10 eloquence points"
163
166
  }),
@@ -169,49 +172,49 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
169
172
  typeof window < "u" && window.dispatchEvent(
170
173
  new CustomEvent("logora:user_content:created", {
171
174
  detail: {
172
- content: o.data.data?.resource
175
+ content: i.data.data?.resource
173
176
  }
174
177
  })
175
178
  );
176
179
  }
177
180
  }));
178
- }, Be = () => {
181
+ }, Ue = () => {
179
182
  const e = {
180
183
  content: q,
181
- rich_content: Q,
182
- source_ids: V?.map((t) => t.id),
184
+ rich_content: ne,
185
+ source_ids: U?.map((t) => t.id),
183
186
  ...d && { position_id: d }
184
187
  };
185
- E(e, de) && K.update("messages", X, e).then((t) => {
188
+ V(e, me) && Q.update("messages", ae, e).then((t) => {
186
189
  if (t.data.success) {
187
- const l = t.data.data.resource;
188
- let o = I;
189
- if (d && !m && (o = `argumentList${l.position?.id}`), ae?.position?.id != l.position?.id && !m && !l.is_reply) {
190
- const T = `argumentList${ae.position.id}`, L = `argumentList${l.position.id}`;
191
- x.remove(T, [l]), x.add(L, [l]);
190
+ const c = t.data.data.resource;
191
+ let i = S;
192
+ if (M?.is_reply && M?.message_id ? i = `argument_${M.message_id}_reply_list` : d && !m && (i = `argumentList${c.position?.id}`), !M?.is_reply && M?.position?.id != c.position?.id && !m) {
193
+ const y = `argumentList${M.position.id}`, L = `argumentList${c.position.id}`;
194
+ N.remove(y, [c]), N.add(L, [c]);
192
195
  } else
193
- x.update(o, [l]);
194
- $(s.formatMessage({ id: "alert.argument_modify" }), {
196
+ N.update(i, [c]);
197
+ R(o.formatMessage({ id: "alert.argument_modify" }), {
195
198
  type: "success"
196
- }), ue();
199
+ }), ce();
197
200
  }
198
201
  });
199
- }, Ee = () => {
200
- if (!ee) {
201
- te(!0);
202
+ }, $e = () => {
203
+ if (!ie) {
204
+ oe(!0);
202
205
  const e = setTimeout(() => {
203
- te(!1);
206
+ oe(!1);
204
207
  }, 2e3);
205
208
  return () => clearTimeout(e);
206
209
  }
207
- }, R = () => {
208
- g ? Y({ loginAction: "argument" }) : ne(!0);
209
- }, Ve = () => {
210
- const e = S.find(
210
+ }, z = () => {
211
+ g ? k({ loginAction: "argument" }) : re(!0);
212
+ }, qe = () => {
213
+ const e = x.find(
211
214
  (t) => t.id === d
212
215
  );
213
216
  if (e)
214
- return s.formatMessage(
217
+ return o.formatMessage(
215
218
  {
216
219
  id: "info.argument_side_limit",
217
220
  defaultMessage: "You have reached the argument limit (10) for position {position}."
@@ -219,63 +222,63 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
219
222
  { position: e.name }
220
223
  );
221
224
  };
222
- return /* @__PURE__ */ _("div", { className: n.inputContainer, children: [
223
- j && /* @__PURE__ */ i("div", { className: n.disabledInputMask, children: oe ? s.formatMessage({
225
+ return /* @__PURE__ */ v("div", { className: n.inputContainer, children: [
226
+ O && /* @__PURE__ */ s("div", { className: n.disabledInputMask, children: le ? o.formatMessage({
224
227
  id: "input.argument_input.user_banned",
225
228
  defaultMessage: "You are banned from the debate space."
226
- }) : s.formatMessage({
229
+ }) : o.formatMessage({
227
230
  id: "info.debate_is_inactive",
228
231
  defaultMessage: "Debate is closed"
229
232
  }) }),
230
- /* @__PURE__ */ i(
233
+ /* @__PURE__ */ s(
231
234
  "div",
232
235
  {
233
- className: w(n.argumentInput, {
234
- [n.flash]: ee,
236
+ className: I(n.argumentInput, {
237
+ [n.flash]: ie,
235
238
  [n.replyInputContainer]: r
236
239
  }),
237
- children: /* @__PURE__ */ i("div", { "data-tid": "action_add_argument", ref: H, children: /* @__PURE__ */ _("div", { className: n.argumentInputBox, children: [
238
- a.length > 0 && A && (!r || !k) && /* @__PURE__ */ _("div", { className: n.userPosition, children: [
239
- /* @__PURE__ */ i("div", { children: s.formatMessage({
240
+ children: /* @__PURE__ */ s("div", { "data-tid": "action_add_argument", ref: te, children: /* @__PURE__ */ v("div", { className: n.argumentInputBox, children: [
241
+ a.length > 0 && C && (!r || !j) && /* @__PURE__ */ v("div", { className: n.userPosition, children: [
242
+ /* @__PURE__ */ s("div", { children: o.formatMessage({
240
243
  id: "input.position",
241
244
  defaultMessage: "Your position"
242
245
  }) }),
243
- /* @__PURE__ */ i(
244
- Ze,
246
+ /* @__PURE__ */ s(
247
+ nt,
245
248
  {
246
249
  activeLabel: d === a[0].id ? 0 : d === a[1].id ? 1 : null,
247
250
  firstLabel: a[0],
248
251
  secondLabel: a[1],
249
- onChange: (e) => p(a[e].id)
252
+ onChange: (e) => _(a[e].id)
250
253
  }
251
254
  )
252
255
  ] }),
253
- /* @__PURE__ */ _(
256
+ /* @__PURE__ */ v(
254
257
  "div",
255
258
  {
256
- className: w(n.argumentTextInputBox, {
259
+ className: I(n.argumentTextInputBox, {
257
260
  [n.argumentTextInputBoxisTablet]: !m,
258
261
  [n.replyEditorRow]: r
259
262
  }),
260
263
  children: [
261
- /* @__PURE__ */ i(
264
+ /* @__PURE__ */ s(
262
265
  "div",
263
266
  {
264
- className: w(n.argumentAuthorContainer, {
267
+ className: I(n.argumentAuthorContainer, {
265
268
  [n.argumentAuthorContainerMobile]: m,
266
- [n.argumentAuthorContainerActivated]: !m && C || r
269
+ [n.argumentAuthorContainerActivated]: !m && w || r
267
270
  }),
268
- children: !m && C || r ? /* @__PURE__ */ i(
269
- et,
271
+ children: !m && w || r ? /* @__PURE__ */ s(
272
+ at,
270
273
  {
271
274
  avatarUrl: u.image_url,
272
275
  userName: u.full_name,
273
- size: me
276
+ size: he
274
277
  }
275
- ) : /* @__PURE__ */ i(
276
- tt,
278
+ ) : /* @__PURE__ */ s(
279
+ st,
277
280
  {
278
- fullName: u?.full_name || s.formatMessage({ id: "default_author.full_name" }),
281
+ fullName: u?.full_name || o.formatMessage({ id: "default_author.full_name" }),
279
282
  avatarUrl: u?.image_url,
280
283
  points: u?.points || 0,
281
284
  slug: u?.hash_id
@@ -283,59 +286,60 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
283
286
  )
284
287
  }
285
288
  ),
286
- /* @__PURE__ */ _(
289
+ /* @__PURE__ */ v(
287
290
  "div",
288
291
  {
289
- onClick: R,
292
+ onClick: z,
290
293
  "data-testid": "argument-input",
291
- className: w(n.textEditorBox, {
294
+ className: I(n.textEditorBox, {
292
295
  [n.replyTextEditorBox]: r
293
296
  }),
294
297
  children: [
295
- /* @__PURE__ */ i(
296
- nt,
298
+ /* @__PURE__ */ s(
299
+ it,
297
300
  {
298
301
  handleChange: (e, t) => {
299
- Fe(e, t);
302
+ Ee(e, t);
300
303
  },
301
304
  handleSourcesChange: (e) => {
302
- Pe(e);
305
+ Ve(e);
303
306
  },
304
- placeholder: he,
305
- "aria-label": s.formatMessage({
307
+ placeholder: Me,
308
+ "aria-label": o.formatMessage({
306
309
  id: "input.argument_input.aria_label",
307
310
  defaultMessage: "Message input field"
308
311
  }),
309
- onSubmit: ye,
310
- sources: V,
311
- hideSourceAction: ge || g,
312
- uid: `Argument${v}`,
313
- onActivation: R,
314
- showStylesControls: C,
315
- disabled: j || g || oe,
316
- maxLength: g ? !1 : h?.actions?.argumentMaxLength,
317
- disableRichText: h?.actions?.disableRichText || g,
312
+ onSubmit: Be,
313
+ sources: U,
314
+ hideSourceAction: _e || g,
315
+ uid: `Argument${b}`,
316
+ onActivation: z,
317
+ showStylesControls: w,
318
+ disabled: O || g || le,
319
+ maxLength: g ? !1 : p?.actions?.argumentMaxLength,
320
+ disableRichText: p?.actions?.disableRichText || g,
318
321
  shortBar: r,
319
322
  hideSubmit: g,
320
- allowedDomains: h?.allowed_sources,
321
- active: F,
322
- hideCharCount: Me,
323
- disableAutoActivate: ve
323
+ allowedDomains: p?.allowed_sources,
324
+ active: P,
325
+ autoFocus: xe,
326
+ hideCharCount: Ae,
327
+ disableAutoActivate: Ce
324
328
  }
325
329
  ),
326
- B?.content && /* @__PURE__ */ i("div", { className: n.argumentInputWarning, children: B && Object.values(B).map((e, t) => /* @__PURE__ */ i("div", { children: e }, t)) }),
327
- C && S?.find(
330
+ E?.content && /* @__PURE__ */ s("div", { className: n.argumentInputWarning, children: E && Object.values(E).map((e, t) => /* @__PURE__ */ s("div", { children: e }, t)) }),
331
+ w && x?.find(
328
332
  (e) => e.id === d
329
- ) && /* @__PURE__ */ _(
333
+ ) && /* @__PURE__ */ v(
330
334
  "div",
331
335
  {
332
- className: w(
336
+ className: I(
333
337
  n.argumentInputWarning,
334
338
  n.disabledPositionWarning
335
339
  ),
336
340
  children: [
337
- /* @__PURE__ */ i(
338
- at,
341
+ /* @__PURE__ */ s(
342
+ ot,
339
343
  {
340
344
  name: "announcement",
341
345
  className: n.warningIcon,
@@ -343,25 +347,25 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
343
347
  width: 20
344
348
  }
345
349
  ),
346
- /* @__PURE__ */ i("div", { className: n.argumentInputWarningText, children: Ve() })
350
+ /* @__PURE__ */ s("div", { className: n.argumentInputWarningText, children: qe() })
347
351
  ]
348
352
  }
349
353
  ),
350
- C && J && !_e && /* @__PURE__ */ i("div", { className: n.guideMessage, children: /* @__PURE__ */ i(
351
- ce,
354
+ w && G && !be && /* @__PURE__ */ s("div", { className: n.guideMessage, children: /* @__PURE__ */ s(
355
+ ge,
352
356
  {
353
357
  id: "alert.guide_message",
354
358
  defaultMessage: "Contributions must comply with our {userCharter}.",
355
359
  values: {
356
- userCharter: /* @__PURE__ */ i(
360
+ userCharter: /* @__PURE__ */ s(
357
361
  "a",
358
362
  {
359
363
  className: n.guideMessage,
360
- href: J,
364
+ href: G,
361
365
  target: "_blank",
362
366
  rel: "noreferrer",
363
- children: /* @__PURE__ */ i(
364
- ce,
367
+ children: /* @__PURE__ */ s(
368
+ ge,
365
369
  {
366
370
  id: "alert.user_charter",
367
371
  defaultMessage: "user charter"
@@ -384,5 +388,5 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
384
388
  ] });
385
389
  };
386
390
  export {
387
- Nt as ArgumentInput
391
+ Lt as ArgumentInput
388
392
  };