@logora/debate 0.4.104 → 0.4.106

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.
@@ -1,141 +1,171 @@
1
- import { jsxs as C, jsx as i } from "react/jsx-runtime";
2
- import { storePendingReply as je } from "../../util/pending_reply/pendingReply.js";
3
- import { useRef as ze, useState as u, useEffect as M, Suspense as Oe, lazy as Re } from "react";
4
- import { useIntl as Je, FormattedMessage as he } from "react-intl";
5
- import { useLocation as Ke } from "react-router";
1
+ import { jsxs as S, jsx as s } from "react/jsx-runtime";
2
+ import { storePendingReply as Qe } from "../../util/pending_reply/pendingReply.js";
3
+ import { useRef as be, useState as d, useEffect as M, Suspense as Xe, lazy as Ze } from "react";
4
+ import { useIntl as et, FormattedMessage as ve } from "react-intl";
5
+ import { useLocation as tt } from "react-router";
6
6
  import I from "classnames";
7
7
  import n from "./ArgumentInput.module.scss.js";
8
- import { useDataProvider as Ge } from "../../data/data_provider/useDataProvider.js";
9
- import { useList as He } from "../../list/list_provider/useList.js";
10
- import { useConfig as Qe } from "../../data/config_provider/useConfig.js";
11
- import { useInput as Xe } from "../input_provider/useInput.js";
12
- import { useAuth as Ze } from "../../auth/use_auth/useAuth.js";
13
- import { useFormValidation as et } from "../../forms/use_form_validation/useFormValidation.js";
14
- import { useResponsive as tt } from "../../hooks/use_responsive/useResponsive.js";
15
- import { useScrollToEditor as nt } from "../use_scroll_to_editor/useScrollToEditor.js";
16
- import { useSessionStorageState as at } from "../../hooks/use_session_storage_state/useSessionStorageState.js";
17
- import { useAuthRequired as it } from "../../hooks/use_auth_required/useAuthRequired.js";
18
- import { useModal as st } from "../../dialog/modal/useModal.js";
19
- import { useToast as ot } from "../../dialog/toast_provider/useToast.js";
20
- import { TogglePosition as rt } from "../toggle_position/TogglePosition.js";
21
- import { Avatar as ut } from "../../user/avatar/Avatar.js";
22
- import { AuthorBox as dt } from "../../user/author_box/AuthorBox.js";
23
- import { TextEditor as lt } from "../text_editor/TextEditor.js";
24
- import { Icon as ct } from "../../icons/icon/Icon.js";
25
- const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ default: N.SideModal }))), qt = ({
26
- argumentListId: N,
27
- avatarSize: pe = 48,
28
- disabled: R = !1,
8
+ import { useDataProvider as nt } from "../../data/data_provider/useDataProvider.js";
9
+ import { useList as at } from "../../list/list_provider/useList.js";
10
+ import { useConfig as st } from "../../data/config_provider/useConfig.js";
11
+ import { useInput as it } from "../input_provider/useInput.js";
12
+ import { useAuth as ot } from "../../auth/use_auth/useAuth.js";
13
+ import { useFormValidation as rt } from "../../forms/use_form_validation/useFormValidation.js";
14
+ import { useResponsive as ut } from "../../hooks/use_responsive/useResponsive.js";
15
+ import { useScrollToEditor as dt } from "../use_scroll_to_editor/useScrollToEditor.js";
16
+ import { useSessionStorageState as lt } from "../../hooks/use_session_storage_state/useSessionStorageState.js";
17
+ import { useAuthRequired as ct } from "../../hooks/use_auth_required/useAuthRequired.js";
18
+ import { useModal as mt } from "../../dialog/modal/useModal.js";
19
+ import { useToast as ft } from "../../dialog/toast_provider/useToast.js";
20
+ import { TogglePosition as gt } from "../toggle_position/TogglePosition.js";
21
+ import { Avatar as ht } from "../../user/avatar/Avatar.js";
22
+ import { AuthorBox as pt } from "../../user/author_box/AuthorBox.js";
23
+ import { TextEditor as _t } from "../text_editor/TextEditor.js";
24
+ import { Icon as Mt } from "../../icons/icon/Icon.js";
25
+ const bt = Ze(() => import("../../modal/side_modal/index.js").then((x) => ({ default: x.SideModal }))), Ae = 2e4, Rt = ({
26
+ argumentListId: x,
27
+ avatarSize: Se = 48,
28
+ disabled: K = !1,
29
29
  positions: a = [],
30
- disabledPositions: T = [],
30
+ disabledPositions: N = [],
31
31
  groupId: f,
32
- groupName: _e,
33
- groupType: J,
34
- hideSourceAction: Me = !1,
35
- isReply: s = !1,
36
- onSubmit: K,
37
- onUpdate: G,
32
+ groupName: we,
33
+ groupType: G,
34
+ hideSourceAction: Ce = !1,
35
+ isReply: o = !1,
36
+ onSubmit: H,
37
+ onUpdate: Q,
38
38
  parentId: m,
39
- ancestorIds: ve = [],
40
- placeholder: be,
39
+ ancestorIds: ye = [],
40
+ placeholder: Ie,
41
41
  positionId: w,
42
- focusOnInit: Ae = !1,
43
- activeOnInit: P = !1,
44
- userGuideUrl: H,
45
- hideUserGuideLink: Ce = !1,
46
- hideCharCount: we = !1,
47
- disableAutoActivate: Se = !1,
48
- autoFocus: Q = !1
42
+ focusOnInit: xe = !1,
43
+ activeOnInit: Y = !1,
44
+ userGuideUrl: X,
45
+ hideUserGuideLink: Ne = !1,
46
+ hideCharCount: Te = !1,
47
+ disableAutoActivate: Le = !1,
48
+ autoFocus: Z = !1
49
49
  }) => {
50
- const r = Je(), X = Ge(), y = He(), v = Qe(), {
51
- focus: Z,
52
- setFocus: ee,
53
- inputContent: B,
54
- setInputContent: te,
55
- setInputRichContent: xe
56
- } = Xe(), { isLoggedIn: S, currentUser: d } = Ze(), { errors: E, validate: $ } = et(), { isMobile: g } = tt(), Ie = Ke(), ne = ze(null), L = nt(ne), [V, q] = u([]), [D, U] = u(""), [ae, W] = u(null), [l, b] = u(null), [ie, se] = u(null), [oe, re] = u(!1), [x, ue] = u(!1), [A, de] = u({}), [Ne, Y] = u(!1), [Te, ye] = u(0), [h, Le] = at(
50
+ const r = et(), ee = nt(), T = at(), b = st(), {
51
+ focus: te,
52
+ setFocus: ne,
53
+ inputContent: $,
54
+ setInputContent: ae,
55
+ setInputRichContent: Pe
56
+ } = it(), { isLoggedIn: C, currentUser: l } = ot(), { errors: U, validate: q } = rt(), { isMobile: g } = ut(), Fe = tt(), se = be(null), L = dt(se), [V, D] = d([]), [W, k] = d(""), [ie, O] = d(null), [c, v] = d(null), [oe, re] = d(null), [ue, de] = d(!1), [y, le] = d(!1), [A, ce] = d({}), [Ee, R] = d(!1), [Be, Ye] = d(0), P = be(!1), [$e, me] = d(!1), [h, Ue] = lt(
57
57
  "userSide",
58
58
  {}
59
- ), [p, Fe] = u(
60
- !S && v?.actions?.disableInputForVisitor
61
- ), k = it(), { showModal: Pe } = st(), { toast: j } = ot() || {}, le = new URLSearchParams(
62
- typeof window < "u" ? window.location.search : Ie.search
59
+ ), [p, qe] = d(
60
+ !C && b?.actions?.disableInputForVisitor
61
+ ), j = ct(), { showModal: Ve } = mt(), { toast: F } = ft() || {}, fe = new URLSearchParams(
62
+ typeof window < "u" ? window.location.search : Fe.search
63
63
  );
64
64
  M(() => {
65
- Fe(
66
- !S && v?.actions?.disableInputForVisitor
65
+ qe(
66
+ !C && b?.actions?.disableInputForVisitor
67
67
  );
68
- }, [S, v]);
69
- const z = d?.role === "editor" || d?.role === "moderator", ce = d?.moderation_status === "banned";
68
+ }, [C, b]);
69
+ const z = l?.role === "editor" || l?.role === "moderator", ge = l?.moderation_status === "banned";
70
70
  M(() => {
71
71
  let e = null;
72
- typeof window < "u" && (e = le.get("positionId")), w && w != a[2]?.id && a?.find((t) => t.id === w) ? b(w) : e && e != a[2]?.id ? b(e) : h && h.groupId == f && h.positionId != a[2]?.id && b(h.positionId);
72
+ typeof window < "u" && (e = fe.get("positionId")), w && w != a[2]?.id && a?.find((t) => t.id === w) ? v(w) : e && e != a[2]?.id ? v(e) : h && h.groupId == f && h.positionId != a[2]?.id && v(h.positionId);
73
73
  }, [w]), M(() => {
74
- Q && Y(!0);
75
- }, [Q]), M(() => {
76
- P && (O(), Y(!0), L());
77
- }, [P]), M(() => {
74
+ Z && R(!0);
75
+ }, [Z]), M(() => {
76
+ Y && (J(), R(!0), L());
77
+ }, [Y]), M(() => {
78
78
  if (typeof window < "u") {
79
- const e = Ae || le.get("initArgument");
80
- (e === !0 || e === "true") && (Y(!0), L(), We());
79
+ const e = xe || fe.get("initArgument");
80
+ (e === !0 || e === "true") && (R(!0), L(), Ke());
81
81
  }
82
82
  }, []), M(() => {
83
- Z && !s && (L(), ee(!1));
84
- }, [Z]), M(() => {
85
- B?.id && !s && (Be(B), ee(!0));
86
- }, [B]);
87
- const Be = (e) => {
88
- de(e), ue(!0), q(e.sources), U(e.content), W(e.rich_content), se(e.id), L(), b(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? xe(e.rich_content) : te(e.content);
89
- }, me = () => {
90
- U(""), W(null), de({}), se(null), q([]), ye((e) => e + 1), te(null);
91
- }, Ee = (e) => {
92
- b(e), ge(e);
93
- }, $e = () => {
94
- Pe(
95
- /* @__PURE__ */ i(Oe, { fallback: null, children: /* @__PURE__ */ i(
96
- mt,
83
+ te && !o && (L(), ne(!1));
84
+ }, [te]), M(() => {
85
+ $?.id && !o && (De($), ne(!0));
86
+ }, [$]);
87
+ const De = (e) => {
88
+ ce(e), le(!0), D(e.sources), k(e.content), O(e.rich_content), re(e.id), L(), v(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Pe(e.rich_content) : ae(e.content);
89
+ }, he = () => {
90
+ k(""), O(null), ce({}), re(null), D([]), Ye((e) => e + 1), ae(null);
91
+ }, We = {
92
+ create: {
93
+ id: "alert.argument_create_error",
94
+ defaultMessage: "Your contribution could not be sent. Please try again."
95
+ },
96
+ update: {
97
+ id: "alert.argument_modify_error",
98
+ defaultMessage: "Your contribution could not be saved. Please try again."
99
+ },
100
+ rateLimited: {
101
+ id: "alert.argument_rate_limited",
102
+ defaultMessage: "Your contribution could not be sent. Please try again in a few moments."
103
+ }
104
+ }, E = (e, t) => {
105
+ t && console.error("[ArgumentInput] submission failed", t);
106
+ const { id: u, defaultMessage: i } = We[t?.response?.status === 429 ? "rateLimited" : e];
107
+ F?.(r.formatMessage({ id: u, defaultMessage: i }), { type: "error" });
108
+ }, pe = async (e) => {
109
+ P.current = !0, me(!0);
110
+ try {
111
+ return await e();
112
+ } finally {
113
+ P.current = !1, me(!1);
114
+ }
115
+ }, ke = (e) => {
116
+ v(e), Me(e);
117
+ }, Oe = () => {
118
+ Ve(
119
+ /* @__PURE__ */ s(Xe, { fallback: null, children: /* @__PURE__ */ s(
120
+ bt,
97
121
  {
98
122
  modalTitle: r.formatMessage({
99
123
  id: "modal.side_modal.modal_title",
100
124
  defaultMessage: "Choose your side"
101
125
  }),
102
- onChooseSide: Ee,
126
+ onChooseSide: ke,
103
127
  positions: a,
104
- title: _e,
105
- disabledPositions: !s && T,
128
+ title: we,
129
+ disabledPositions: !o && N,
106
130
  isNeutral: h && h.groupId == f && h.positionId === a[2]?.id
107
131
  }
108
132
  ) })
109
133
  );
110
- }, Ve = () => {
111
- S ? ie ? Ue() : !a || a?.length === 0 || !T?.find((e) => e?.id === l) && l || z && s ? ge(s && z && a[0]?.id) : $e() : (m && je({ groupId: f, parentId: m, ancestorIds: ve }), k({ loginAction: "argument" }));
112
- }, qe = (e, t) => {
113
- p ? k({ loginAction: "argument" }) : (U(e), W(t), $({ content: e }, [{ content: ["url", null] }]));
114
- }, De = (e) => {
115
- q(e);
116
- }, fe = [
134
+ }, Re = () => {
135
+ C ? oe ? Je() : !a || a?.length === 0 || !N?.find((e) => e?.id === c) && c || z && o ? Me(o && z && a[0]?.id) : Oe() : (m && Qe({ groupId: f, parentId: m, ancestorIds: ye }), j({ loginAction: "argument" }));
136
+ }, je = (e, t) => {
137
+ p ? j({ loginAction: "argument" }) : (k(e), O(t), q({ content: e }, [{ content: ["url", null] }]));
138
+ }, ze = (e) => {
139
+ D(e);
140
+ }, _e = [
117
141
  { content: ["length", 3] },
118
142
  { content: ["required", null] },
119
143
  { content: ["url", null] },
120
144
  ...!a || a?.length === 0 ? [] : [{ position_id: ["required", null] }]
121
- ], ge = (e) => {
122
- const t = e || l, c = {
123
- content: D,
124
- rich_content: ae,
145
+ ], Me = (e) => {
146
+ if (P.current)
147
+ return;
148
+ const t = e || c, u = {
149
+ content: W,
150
+ rich_content: ie,
125
151
  group_id: f,
126
- ...J && { group_type: J },
152
+ ...G && { group_type: G },
127
153
  ...t && { position_id: t },
128
154
  is_reply: !!m,
129
155
  message_id: m || null,
130
- source_ids: V?.map((o) => o.id)
156
+ source_ids: V?.map((i) => i.id)
131
157
  };
132
- $(c, fe) && (t && a && a.map((o) => o.id).includes(t) && Le({
158
+ q(u, _e) && (t && a && a.map((i) => i.id).includes(t) && Ue({
133
159
  groupId: f,
134
160
  positionId: t
135
- }), me(), X.create("messages", c).then((o) => {
136
- if (o.data.success) {
161
+ }), pe(
162
+ () => ee.create("messages", u, {}, !0, {
163
+ timeout: Ae
164
+ })
165
+ ).then((i) => {
166
+ if (i?.data?.success) {
137
167
  if (m)
138
- K(o.data.data.resource), j(
168
+ H(i.data.data.resource), F(
139
169
  r.formatMessage({
140
170
  id: "alert.argument_create",
141
171
  defaultMessage: "Your contribution has been sent !"
@@ -149,12 +179,12 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
149
179
  }
150
180
  );
151
181
  else {
152
- const _ = o.data.data.resource;
153
- let F = N;
154
- t && !g && (F = `argumentList${_.position.id}`), K?.(
155
- D,
156
- a.find((ke) => ke.id === t) || null
157
- ), y.add(F, [_]), j(
182
+ const _ = i.data.data.resource;
183
+ let B = x;
184
+ t && !g && (B = `argumentList${_.position.id}`), H?.(
185
+ W,
186
+ a.find((He) => He.id === t) || null
187
+ ), T.add(B, [_]), F(
158
188
  r.formatMessage({
159
189
  id: "alert.argument_create",
160
190
  defaultMessage: "Your contribution has been sent !"
@@ -166,57 +196,68 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
166
196
  defaultMessage: "Up to 10 eloquence points"
167
197
  }),
168
198
  category: "ARGUMENT",
169
- contentKey: d.messages_count === 2 ? "alert.third_argument" : "alert.first_argument"
199
+ contentKey: l.messages_count === 2 ? "alert.third_argument" : "alert.first_argument"
170
200
  }
171
201
  );
172
202
  }
173
203
  typeof window < "u" && window.dispatchEvent(
174
204
  new CustomEvent("logora:user_content:created", {
175
205
  detail: {
176
- content: o.data.data?.resource
206
+ content: i.data.data?.resource
177
207
  }
178
208
  })
179
- );
180
- }
181
- }));
182
- }, Ue = () => {
209
+ ), he();
210
+ } else
211
+ E("create");
212
+ }, (i) => E("create", i)));
213
+ }, Je = () => {
214
+ if (P.current)
215
+ return;
183
216
  const e = {
184
- content: D,
185
- rich_content: ae,
217
+ content: W,
218
+ rich_content: ie,
186
219
  source_ids: V?.map((t) => t.id),
187
- ...l && { position_id: l }
220
+ ...c && { position_id: c }
188
221
  };
189
- $(e, fe) && X.update("messages", ie, e).then((t) => {
190
- if (t.data.success) {
191
- const c = t.data.data.resource;
192
- let o = N;
193
- if (A?.is_reply || s) {
194
- const _ = A?.message_id || A?.reply_to_id || m;
195
- _ && (o = `argument_${_}_reply_list`);
196
- } else l && !g && (o = `argumentList${c.position?.id}`);
197
- if (!A?.is_reply && A?.position?.id != c.position?.id && !g) {
198
- const _ = `argumentList${A.position.id}`, F = `argumentList${c.position.id}`;
199
- y.remove(_, [c]), y.add(F, [c]);
222
+ q(e, _e) && pe(
223
+ () => ee.update("messages", oe, e, {}, !0, {
224
+ timeout: Ae
225
+ })
226
+ ).then(
227
+ (t) => {
228
+ if (t?.data?.success) {
229
+ const u = t.data.data.resource;
230
+ let i = x;
231
+ if (A?.is_reply || o) {
232
+ const _ = A?.message_id || A?.reply_to_id || m;
233
+ _ && (i = `argument_${_}_reply_list`);
234
+ } else c && !g && (i = `argumentList${u.position?.id}`);
235
+ if (!A?.is_reply && A?.position?.id != u.position?.id && !g) {
236
+ const _ = `argumentList${A.position.id}`, B = `argumentList${u.position.id}`;
237
+ T.remove(_, [u]), T.add(B, [u]);
238
+ } else
239
+ T.update(i, [u]);
240
+ Q && Q(u), F(r.formatMessage({ id: "alert.argument_modify" }), {
241
+ type: "success"
242
+ }), he();
200
243
  } else
201
- y.update(o, [c]);
202
- G && G(c), j(r.formatMessage({ id: "alert.argument_modify" }), {
203
- type: "success"
204
- }), me();
205
- }
206
- });
207
- }, We = () => {
208
- if (!oe) {
209
- re(!0);
244
+ E("update");
245
+ },
246
+ (t) => E("update", t)
247
+ );
248
+ }, Ke = () => {
249
+ if (!ue) {
250
+ de(!0);
210
251
  const e = setTimeout(() => {
211
- re(!1);
252
+ de(!1);
212
253
  }, 2e3);
213
254
  return () => clearTimeout(e);
214
255
  }
215
- }, O = () => {
216
- p ? k({ loginAction: "argument" }) : ue(!0);
217
- }, Ye = () => {
218
- const e = T.find(
219
- (t) => t.id === l
256
+ }, J = () => {
257
+ p ? j({ loginAction: "argument" }) : le(!0);
258
+ }, Ge = () => {
259
+ const e = N.find(
260
+ (t) => t.id === c
220
261
  );
221
262
  if (e)
222
263
  return r.formatMessage(
@@ -227,117 +268,118 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
227
268
  { position: e.name }
228
269
  );
229
270
  };
230
- return /* @__PURE__ */ C("div", { className: n.inputContainer, children: [
231
- R && /* @__PURE__ */ i("div", { className: n.disabledInputMask, children: ce ? r.formatMessage({
271
+ return /* @__PURE__ */ S("div", { className: n.inputContainer, children: [
272
+ K && /* @__PURE__ */ s("div", { className: n.disabledInputMask, children: ge ? r.formatMessage({
232
273
  id: "input.argument_input.user_banned",
233
274
  defaultMessage: "You are banned from the debate space."
234
275
  }) : r.formatMessage({
235
276
  id: "info.debate_is_inactive",
236
277
  defaultMessage: "Debate is closed"
237
278
  }) }),
238
- /* @__PURE__ */ i(
279
+ /* @__PURE__ */ s(
239
280
  "div",
240
281
  {
241
282
  className: I(n.argumentInput, {
242
- [n.flash]: oe,
243
- [n.replyInputContainer]: s
283
+ [n.flash]: ue,
284
+ [n.replyInputContainer]: o
244
285
  }),
245
- children: /* @__PURE__ */ i("div", { "data-tid": "action_add_argument", ref: ne, children: /* @__PURE__ */ C("div", { className: n.argumentInputBox, children: [
246
- a.length > 0 && S && (!s || !z) && /* @__PURE__ */ C("div", { className: n.userPosition, children: [
247
- /* @__PURE__ */ i("div", { children: r.formatMessage({
286
+ children: /* @__PURE__ */ s("div", { "data-tid": "action_add_argument", ref: se, children: /* @__PURE__ */ S("div", { className: n.argumentInputBox, children: [
287
+ a.length > 0 && C && (!o || !z) && /* @__PURE__ */ S("div", { className: n.userPosition, children: [
288
+ /* @__PURE__ */ s("div", { children: r.formatMessage({
248
289
  id: "input.position",
249
290
  defaultMessage: "Your position"
250
291
  }) }),
251
- /* @__PURE__ */ i(
252
- rt,
292
+ /* @__PURE__ */ s(
293
+ gt,
253
294
  {
254
- activeLabel: l === a[0].id ? 0 : l === a[1].id ? 1 : null,
295
+ activeLabel: c === a[0].id ? 0 : c === a[1].id ? 1 : null,
255
296
  firstLabel: a[0],
256
297
  secondLabel: a[1],
257
- onChange: (e) => b(a[e].id)
298
+ onChange: (e) => v(a[e].id)
258
299
  }
259
300
  )
260
301
  ] }),
261
- /* @__PURE__ */ C(
302
+ /* @__PURE__ */ S(
262
303
  "div",
263
304
  {
264
305
  className: I(n.argumentTextInputBox, {
265
306
  [n.argumentTextInputBoxisTablet]: !g,
266
- [n.replyEditorRow]: s
307
+ [n.replyEditorRow]: o
267
308
  }),
268
309
  children: [
269
- /* @__PURE__ */ i(
310
+ /* @__PURE__ */ s(
270
311
  "div",
271
312
  {
272
313
  className: I(n.argumentAuthorContainer, {
273
314
  [n.argumentAuthorContainerMobile]: g,
274
- [n.argumentAuthorContainerActivated]: !g && x || s
315
+ [n.argumentAuthorContainerActivated]: !g && y || o
275
316
  }),
276
- children: !g && x || s ? /* @__PURE__ */ i(
277
- ut,
317
+ children: !g && y || o ? /* @__PURE__ */ s(
318
+ ht,
278
319
  {
279
- avatarUrl: d.image_url,
280
- userName: d.full_name,
281
- size: pe
320
+ avatarUrl: l.image_url,
321
+ userName: l.full_name,
322
+ size: Se
282
323
  }
283
- ) : /* @__PURE__ */ i(
284
- dt,
324
+ ) : /* @__PURE__ */ s(
325
+ pt,
285
326
  {
286
- fullName: d?.full_name || r.formatMessage({ id: "default_author.full_name" }),
287
- avatarUrl: d?.image_url,
288
- points: d?.points || 0,
289
- slug: d?.hash_id
327
+ fullName: l?.full_name || r.formatMessage({ id: "default_author.full_name" }),
328
+ avatarUrl: l?.image_url,
329
+ points: l?.points || 0,
330
+ slug: l?.hash_id
290
331
  }
291
332
  )
292
333
  }
293
334
  ),
294
- /* @__PURE__ */ C(
335
+ /* @__PURE__ */ S(
295
336
  "div",
296
337
  {
297
- onClick: O,
338
+ onClick: J,
298
339
  "data-testid": "argument-input",
299
340
  className: I(n.textEditorBox, {
300
- [n.replyTextEditorBox]: s
341
+ [n.replyTextEditorBox]: o
301
342
  }),
302
343
  children: [
303
- /* @__PURE__ */ i(
304
- lt,
344
+ /* @__PURE__ */ s(
345
+ _t,
305
346
  {
306
347
  handleChange: (e, t) => {
307
- qe(e, t);
348
+ je(e, t);
308
349
  },
309
350
  handleSourcesChange: (e) => {
310
- De(e);
351
+ ze(e);
311
352
  },
312
- placeholder: be,
353
+ placeholder: Ie,
313
354
  "aria-label": r.formatMessage({
314
355
  id: "input.argument_input.aria_label",
315
356
  defaultMessage: "Message input field"
316
357
  }),
317
- onSubmit: Ve,
358
+ onSubmit: Re,
318
359
  sources: V,
319
- hideSourceAction: Me || p,
360
+ hideSourceAction: Ce || p,
320
361
  uid: m ? `Reply${f}_${m}` : `Argument${f}`,
321
- onActivation: O,
322
- showStylesControls: x,
323
- disabled: R || p || ce,
324
- maxLength: p ? !1 : v?.actions?.argumentMaxLength,
325
- disableRichText: v?.actions?.disableRichText || p,
326
- shortBar: s,
327
- isReply: s,
328
- resetSignal: Te,
362
+ onActivation: J,
363
+ showStylesControls: y,
364
+ disabled: K || p || ge,
365
+ maxLength: p ? !1 : b?.actions?.argumentMaxLength,
366
+ disableRichText: b?.actions?.disableRichText || p,
367
+ shortBar: o,
368
+ isReply: o,
369
+ resetSignal: Be,
329
370
  hideSubmit: p,
330
- allowedDomains: v?.allowed_sources,
331
- active: P,
332
- autoFocus: Ne,
333
- hideCharCount: we,
334
- disableAutoActivate: Se
371
+ allowedDomains: b?.allowed_sources,
372
+ active: Y,
373
+ autoFocus: Ee,
374
+ hideCharCount: Te,
375
+ disableAutoActivate: Le,
376
+ submitting: $e
335
377
  }
336
378
  ),
337
- E?.content && /* @__PURE__ */ i("div", { className: n.argumentInputWarning, children: E && Object.values(E).map((e, t) => /* @__PURE__ */ i("div", { children: e }, t)) }),
338
- x && T?.find(
339
- (e) => e.id === l
340
- ) && /* @__PURE__ */ C(
379
+ U?.content && /* @__PURE__ */ s("div", { className: n.argumentInputWarning, children: U && Object.values(U).map((e, t) => /* @__PURE__ */ s("div", { children: e }, t)) }),
380
+ y && N?.find(
381
+ (e) => e.id === c
382
+ ) && /* @__PURE__ */ S(
341
383
  "div",
342
384
  {
343
385
  className: I(
@@ -345,8 +387,8 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
345
387
  n.disabledPositionWarning
346
388
  ),
347
389
  children: [
348
- /* @__PURE__ */ i(
349
- ct,
390
+ /* @__PURE__ */ s(
391
+ Mt,
350
392
  {
351
393
  name: "announcement",
352
394
  className: n.warningIcon,
@@ -354,25 +396,25 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
354
396
  width: 20
355
397
  }
356
398
  ),
357
- /* @__PURE__ */ i("div", { className: n.argumentInputWarningText, children: Ye() })
399
+ /* @__PURE__ */ s("div", { className: n.argumentInputWarningText, children: Ge() })
358
400
  ]
359
401
  }
360
402
  ),
361
- x && H && !Ce && /* @__PURE__ */ i("div", { className: n.guideMessage, children: /* @__PURE__ */ i(
362
- he,
403
+ y && X && !Ne && /* @__PURE__ */ s("div", { className: n.guideMessage, children: /* @__PURE__ */ s(
404
+ ve,
363
405
  {
364
406
  id: "alert.guide_message",
365
407
  defaultMessage: "Contributions must comply with our {userCharter}.",
366
408
  values: {
367
- userCharter: /* @__PURE__ */ i(
409
+ userCharter: /* @__PURE__ */ s(
368
410
  "a",
369
411
  {
370
412
  className: n.guideMessage,
371
- href: H,
413
+ href: X,
372
414
  target: "_blank",
373
415
  rel: "noreferrer",
374
- children: /* @__PURE__ */ i(
375
- he,
416
+ children: /* @__PURE__ */ s(
417
+ ve,
376
418
  {
377
419
  id: "alert.user_charter",
378
420
  defaultMessage: "user charter"
@@ -395,5 +437,5 @@ const mt = Re(() => import("../../modal/side_modal/index.js").then((N) => ({ def
395
437
  ] });
396
438
  };
397
439
  export {
398
- qt as ArgumentInput
440
+ Rt as ArgumentInput
399
441
  };