@burdenoff/microfe-conversations 2026.522.1 → 2026.523.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 (47) hide show
  1. package/dist/conversations/ConversationsUserRoutes.d.ts.map +1 -1
  2. package/dist/conversations/ConversationsUserRoutes.js +17 -19
  3. package/dist/conversations/ConversationsUserRoutes.js.map +1 -1
  4. package/dist/conversations/components/ConversationCard.d.ts.map +1 -1
  5. package/dist/conversations/components/ConversationCard.js +2 -1
  6. package/dist/conversations/components/ConversationCard.js.map +1 -1
  7. package/dist/conversations/components/LazyPageBoundary.d.ts +3 -3
  8. package/dist/conversations/components/LazyPageBoundary.d.ts.map +1 -1
  9. package/dist/conversations/components/LazyPageBoundary.js.map +1 -1
  10. package/dist/conversations/components/MessageBubble.d.ts.map +1 -1
  11. package/dist/conversations/components/MessageBubble.js +22 -16
  12. package/dist/conversations/components/MessageBubble.js.map +1 -1
  13. package/dist/conversations/components/PageLayout.d.ts +3 -1
  14. package/dist/conversations/components/PageLayout.d.ts.map +1 -1
  15. package/dist/conversations/components/PageLayout.js +2 -1
  16. package/dist/conversations/components/PageLayout.js.map +1 -1
  17. package/dist/conversations/hooks/useConversationQueries.js +1 -1
  18. package/dist/conversations/hooks/useConversationQueries.js.map +1 -1
  19. package/dist/conversations/hooks/useMessageQueries.d.ts +1 -0
  20. package/dist/conversations/hooks/useMessageQueries.d.ts.map +1 -1
  21. package/dist/conversations/hooks/useMessageQueries.js +48 -42
  22. package/dist/conversations/hooks/useMessageQueries.js.map +1 -1
  23. package/dist/conversations/index.js +1 -1
  24. package/dist/conversations/pages/ConversationAdminPages.d.ts.map +1 -1
  25. package/dist/conversations/pages/ConversationAdminPages.js +139 -138
  26. package/dist/conversations/pages/ConversationAdminPages.js.map +1 -1
  27. package/dist/conversations/pages/ConversationDetailPage.d.ts.map +1 -1
  28. package/dist/conversations/pages/ConversationDetailPage.js +256 -230
  29. package/dist/conversations/pages/ConversationDetailPage.js.map +1 -1
  30. package/dist/conversations/pages/ConversationListPage.d.ts +1 -2
  31. package/dist/conversations/pages/ConversationListPage.d.ts.map +1 -1
  32. package/dist/conversations/pages/ConversationListPage.js +138 -125
  33. package/dist/conversations/pages/ConversationListPage.js.map +1 -1
  34. package/dist/conversations/pages/ConversationsLandingPage.d.ts.map +1 -1
  35. package/dist/conversations/pages/ConversationsLandingPage.js +3 -1
  36. package/dist/conversations/pages/ConversationsLandingPage.js.map +1 -1
  37. package/dist/conversations/pages/ConversationsSettingsPage.d.ts.map +1 -1
  38. package/dist/conversations/pages/ConversationsSettingsPage.js +5 -4
  39. package/dist/conversations/pages/ConversationsSettingsPage.js.map +1 -1
  40. package/dist/conversations/pages/NewConversationPage.d.ts.map +1 -1
  41. package/dist/conversations/pages/NewConversationPage.js +4 -0
  42. package/dist/conversations/pages/NewConversationPage.js.map +1 -1
  43. package/dist/conversations/providers/ConversationsProvider.d.ts.map +1 -1
  44. package/dist/conversations/providers/ConversationsProvider.js +10 -8
  45. package/dist/conversations/providers/ConversationsProvider.js.map +1 -1
  46. package/dist/index.js +5 -5
  47. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
1
  import { useConversations as e } from "../providers/ConversationsProvider.js";
2
2
  import { useTr as t } from "../utils/i18n.js";
3
3
  import { EmptyState as n, PageLayout as r, PageSection as i } from "../components/PageLayout.js";
4
- import { useEffect as a, useState as o } from "react";
5
- import { Activity as s, Archive as c, CheckCircle2 as l, Package as u, ShieldCheck as d, Trash2 as f } from "lucide-react";
6
- import { gql as p } from "@apollo/client";
7
- import { useMutation as m, useQuery as h } from "@apollo/client/react";
8
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
4
+ import { useEffect as a, useMemo as o, useState as s } from "react";
5
+ import { Activity as c, Archive as l, CheckCircle2 as u, Package as d, ShieldCheck as f, Trash2 as p } from "lucide-react";
6
+ import { gql as m } from "@apollo/client";
7
+ import { useMutation as h, useQuery as g } from "@apollo/client/react";
8
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
9
9
  //#region src/conversations/pages/ConversationAdminPages.tsx
10
- var v = p`
10
+ var y = m`
11
11
  query ConversationAdminMessageReports(
12
12
  $first: Int
13
13
  $filter: MessageReportFilter
@@ -35,7 +35,7 @@ var v = p`
35
35
  }
36
36
  }
37
37
  }
38
- `, y = p`
38
+ `, b = m`
39
39
  mutation ConversationAdminResolveMessageReport(
40
40
  $input: ResolveMessageReportInput!
41
41
  ) {
@@ -50,7 +50,7 @@ var v = p`
50
50
  }
51
51
  }
52
52
  }
53
- `, b = p`
53
+ `, x = m`
54
54
  query ConversationAdminBulkConversations(
55
55
  $first: Int
56
56
  $filter: ConversationFilter
@@ -67,7 +67,7 @@ var v = p`
67
67
  }
68
68
  }
69
69
  }
70
- `, x = p`
70
+ `, S = m`
71
71
  mutation ConversationAdminBulkUpdate(
72
72
  $input: BulkConversationOperationInput!
73
73
  ) {
@@ -83,7 +83,7 @@ var v = p`
83
83
  }
84
84
  }
85
85
  }
86
- `, S = p`
86
+ `, C = m`
87
87
  query ConversationAdminAuditLog($filter: ActivityLogFilter) {
88
88
  getActivities(filter: $filter) {
89
89
  id
@@ -95,7 +95,7 @@ var v = p`
95
95
  timestamp
96
96
  }
97
97
  }
98
- `, C = p`
98
+ `, w = m`
99
99
  query ConversationAdminAppInstallations($workspaceId: ID) {
100
100
  appInstallations(workspaceId: $workspaceId) {
101
101
  id
@@ -109,7 +109,7 @@ var v = p`
109
109
  updatedAt
110
110
  }
111
111
  }
112
- `, w = p`
112
+ `, T = m`
113
113
  mutation ConversationAdminInstallApp($input: InstallAppInput!) {
114
114
  installApp(input: $input) {
115
115
  id
@@ -119,7 +119,7 @@ var v = p`
119
119
  installedAt
120
120
  }
121
121
  }
122
- `, T = p`
122
+ `, E = m`
123
123
  mutation ConversationAdminUpdateAppSettings($id: ID!, $settings: JSON!) {
124
124
  updateAppSettings(id: $id, settings: $settings) {
125
125
  id
@@ -127,7 +127,7 @@ var v = p`
127
127
  updatedAt
128
128
  }
129
129
  }
130
- `, E = p`
130
+ `, D = m`
131
131
  mutation ConversationAdminUninstallApp($id: ID!) {
132
132
  uninstallApp(id: $id) {
133
133
  appInstallationId
@@ -135,7 +135,7 @@ var v = p`
135
135
  }
136
136
  }
137
137
  `;
138
- function D(e) {
138
+ function O(e) {
139
139
  if (typeof e == "string") return e;
140
140
  if (e && typeof e == "object" && "text" in e) {
141
141
  let t = e.text;
@@ -147,77 +147,77 @@ function D(e) {
147
147
  return "Message content unavailable";
148
148
  }
149
149
  }
150
- function O(e) {
150
+ function k(e) {
151
151
  return new Intl.DateTimeFormat(void 0, {
152
152
  dateStyle: "medium",
153
153
  timeStyle: "short"
154
154
  }).format(new Date(e));
155
155
  }
156
- function k({ children: e }) {
157
- return /* @__PURE__ */ g("span", {
156
+ function A({ children: e }) {
157
+ return /* @__PURE__ */ _("span", {
158
158
  className: "rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",
159
159
  children: e
160
160
  });
161
161
  }
162
- function A() {
163
- let e = t(), { data: i, loading: a, error: o, refetch: s } = h(v, { variables: {
162
+ function j() {
163
+ let e = t(), { data: i, loading: a, error: o, refetch: s } = g(y, { variables: {
164
164
  first: 50,
165
165
  filter: { statuses: ["PENDING", "REVIEWING"] }
166
- } }), [c, { loading: u }] = m(y, { onCompleted: () => void s() }), f = i?.messageReports.edges.map((e) => e.node) ?? [];
167
- return /* @__PURE__ */ _(r, {
166
+ } }), [c, { loading: l }] = h(b, { onCompleted: () => void s() }), d = i?.messageReports.edges.map((e) => e.node) ?? [];
167
+ return /* @__PURE__ */ v(r, {
168
168
  title: e("conversations.admin.moderationPageTitle", "Moderation queue"),
169
169
  subtitle: e("conversations.admin.moderationPageDescription", "Review reported messages and apply moderator decisions."),
170
- icon: /* @__PURE__ */ g(d, {
170
+ icon: /* @__PURE__ */ _(f, {
171
171
  className: "h-5 w-5",
172
172
  "aria-hidden": "true"
173
173
  }),
174
174
  maxWidth: "2xl",
175
175
  children: [
176
- a && /* @__PURE__ */ g("p", {
176
+ a && /* @__PURE__ */ _("p", {
177
177
  className: "text-sm text-muted-foreground",
178
178
  children: "Loading reports..."
179
179
  }),
180
- o && /* @__PURE__ */ g("p", {
180
+ o && /* @__PURE__ */ _("p", {
181
181
  className: "text-sm text-destructive",
182
182
  children: o.message
183
183
  }),
184
- !a && !o && f.length === 0 && /* @__PURE__ */ g(n, {
184
+ !a && !o && d.length === 0 && /* @__PURE__ */ _(n, {
185
185
  title: "No reports waiting for review",
186
186
  description: "Reported messages will appear here as they are submitted.",
187
- icon: /* @__PURE__ */ g(l, {
187
+ icon: /* @__PURE__ */ _(u, {
188
188
  className: "h-6 w-6",
189
189
  "aria-hidden": "true"
190
190
  })
191
191
  }),
192
- /* @__PURE__ */ g("div", {
192
+ /* @__PURE__ */ _("div", {
193
193
  className: "grid gap-3",
194
- children: f.map((e) => /* @__PURE__ */ g("article", {
194
+ children: d.map((e) => /* @__PURE__ */ _("article", {
195
195
  className: "rounded-lg border border-border bg-card p-4 shadow-sm",
196
- children: /* @__PURE__ */ _("div", {
196
+ children: /* @__PURE__ */ v("div", {
197
197
  className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
198
- children: [/* @__PURE__ */ _("div", {
198
+ children: [/* @__PURE__ */ v("div", {
199
199
  className: "space-y-2",
200
200
  children: [
201
- /* @__PURE__ */ _("div", {
201
+ /* @__PURE__ */ v("div", {
202
202
  className: "flex flex-wrap items-center gap-2",
203
203
  children: [
204
- /* @__PURE__ */ g(k, { children: e.status }),
205
- e.message.isHidden && /* @__PURE__ */ g(k, { children: "Hidden" }),
206
- /* @__PURE__ */ _("span", {
204
+ /* @__PURE__ */ _(A, { children: e.status }),
205
+ e.message.isHidden && /* @__PURE__ */ _(A, { children: "Hidden" }),
206
+ /* @__PURE__ */ v("span", {
207
207
  className: "text-xs text-muted-foreground",
208
- children: ["Reported ", O(e.createdAt)]
208
+ children: ["Reported ", k(e.createdAt)]
209
209
  })
210
210
  ]
211
211
  }),
212
- /* @__PURE__ */ g("p", {
212
+ /* @__PURE__ */ _("p", {
213
213
  className: "text-sm font-medium text-foreground",
214
214
  children: e.reason
215
215
  }),
216
- /* @__PURE__ */ g("p", {
216
+ /* @__PURE__ */ _("p", {
217
217
  className: "rounded-md bg-muted p-3 text-sm text-muted-foreground",
218
- children: D(e.message.content)
218
+ children: O(e.message.content)
219
219
  }),
220
- /* @__PURE__ */ _("p", {
220
+ /* @__PURE__ */ v("p", {
221
221
  className: "text-xs text-muted-foreground",
222
222
  children: [
223
223
  "Message ",
@@ -232,20 +232,20 @@ function A() {
232
232
  ]
233
233
  })
234
234
  ]
235
- }), /* @__PURE__ */ _("div", {
235
+ }), /* @__PURE__ */ v("div", {
236
236
  className: "flex flex-wrap gap-2",
237
- children: [/* @__PURE__ */ g("button", {
237
+ children: [/* @__PURE__ */ _("button", {
238
238
  type: "button",
239
- disabled: u,
239
+ disabled: l,
240
240
  className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground hover:bg-accent disabled:opacity-50",
241
241
  onClick: () => void c({ variables: { input: {
242
242
  reportId: e.id,
243
243
  action: "DISMISS"
244
244
  } } }),
245
245
  children: "Dismiss"
246
- }), /* @__PURE__ */ g("button", {
246
+ }), /* @__PURE__ */ _("button", {
247
247
  type: "button",
248
- disabled: u,
248
+ disabled: l,
249
249
  className: "rounded-md bg-primary px-3 py-2 text-sm text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
250
250
  onClick: () => void c({ variables: { input: {
251
251
  reportId: e.id,
@@ -260,44 +260,44 @@ function A() {
260
260
  ]
261
261
  });
262
262
  }
263
- function j() {
264
- let e = t(), [n, i] = o(() => /* @__PURE__ */ new Set()), [a, s] = o("ARCHIVE"), { data: l, loading: u, error: d, refetch: f } = h(b, { variables: { first: 100 } }), [p, { data: v, loading: y }] = m(x, { onCompleted: () => {
263
+ function M() {
264
+ let e = t(), [n, i] = s(() => /* @__PURE__ */ new Set()), [a, o] = s("ARCHIVE"), { data: c, loading: u, error: d, refetch: f } = g(x, { variables: { first: 100 } }), [p, { data: m, loading: y }] = h(S, { onCompleted: () => {
265
265
  i(/* @__PURE__ */ new Set()), f();
266
- } }), S = l?.conversations.edges.map((e) => e.node) ?? [], C = (e) => {
266
+ } }), b = c?.conversations.edges.map((e) => e.node) ?? [], C = (e) => {
267
267
  i((t) => {
268
268
  let n = new Set(t);
269
269
  return n.has(e) ? n.delete(e) : n.add(e), n;
270
270
  });
271
271
  };
272
- return /* @__PURE__ */ _(r, {
272
+ return /* @__PURE__ */ v(r, {
273
273
  title: e("conversations.admin.bulkOperationsPageTitle", "Bulk operations"),
274
274
  subtitle: e("conversations.admin.bulkOperationsPageDescription", "Select workspace conversations and apply archive, unarchive, or delete operations."),
275
- icon: /* @__PURE__ */ g(c, {
275
+ icon: /* @__PURE__ */ _(l, {
276
276
  className: "h-5 w-5",
277
277
  "aria-hidden": "true"
278
278
  }),
279
279
  maxWidth: "2xl",
280
- headerActions: /* @__PURE__ */ _("div", {
280
+ headerActions: /* @__PURE__ */ v("div", {
281
281
  className: "flex flex-wrap items-center gap-2",
282
- children: [/* @__PURE__ */ _("select", {
282
+ children: [/* @__PURE__ */ v("select", {
283
283
  value: a,
284
- onChange: (e) => s(e.target.value),
284
+ onChange: (e) => o(e.target.value),
285
285
  className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground",
286
286
  children: [
287
- /* @__PURE__ */ g("option", {
287
+ /* @__PURE__ */ _("option", {
288
288
  value: "ARCHIVE",
289
289
  children: "Archive"
290
290
  }),
291
- /* @__PURE__ */ g("option", {
291
+ /* @__PURE__ */ _("option", {
292
292
  value: "UNARCHIVE",
293
293
  children: "Unarchive"
294
294
  }),
295
- /* @__PURE__ */ g("option", {
295
+ /* @__PURE__ */ _("option", {
296
296
  value: "DELETE",
297
297
  children: "Delete"
298
298
  })
299
299
  ]
300
- }), /* @__PURE__ */ _("button", {
300
+ }), /* @__PURE__ */ v("button", {
301
301
  type: "button",
302
302
  disabled: n.size === 0 || y,
303
303
  className: "rounded-md bg-primary px-3 py-2 text-sm text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
@@ -309,38 +309,38 @@ function j() {
309
309
  })]
310
310
  }),
311
311
  children: [
312
- u && /* @__PURE__ */ g("p", {
312
+ u && /* @__PURE__ */ _("p", {
313
313
  className: "text-sm text-muted-foreground",
314
314
  children: "Loading conversations..."
315
315
  }),
316
- d && /* @__PURE__ */ g("p", {
316
+ d && /* @__PURE__ */ _("p", {
317
317
  className: "text-sm text-destructive",
318
318
  children: d.message
319
319
  }),
320
- v?.bulkUpdateConversations && /* @__PURE__ */ _("div", {
320
+ m?.bulkUpdateConversations && /* @__PURE__ */ v("div", {
321
321
  className: "rounded-lg border border-border bg-muted p-3 text-sm text-muted-foreground",
322
322
  children: [
323
- v.bulkUpdateConversations.successCount,
323
+ m.bulkUpdateConversations.successCount,
324
324
  " succeeded,",
325
325
  " ",
326
- v.bulkUpdateConversations.failureCount,
326
+ m.bulkUpdateConversations.failureCount,
327
327
  " failed."
328
328
  ]
329
329
  }),
330
- /* @__PURE__ */ g("div", {
330
+ /* @__PURE__ */ _("div", {
331
331
  className: "overflow-hidden rounded-lg border border-border bg-card",
332
- children: S.map((e) => /* @__PURE__ */ _("label", {
332
+ children: b.map((e) => /* @__PURE__ */ v("label", {
333
333
  className: "flex cursor-pointer items-center gap-3 border-b border-border px-4 py-3 last:border-b-0 hover:bg-accent",
334
- children: [/* @__PURE__ */ g("input", {
334
+ children: [/* @__PURE__ */ _("input", {
335
335
  type: "checkbox",
336
336
  checked: n.has(e.id),
337
337
  onChange: () => C(e.id)
338
- }), /* @__PURE__ */ _("div", {
338
+ }), /* @__PURE__ */ v("div", {
339
339
  className: "min-w-0 flex-1",
340
- children: [/* @__PURE__ */ g("p", {
340
+ children: [/* @__PURE__ */ _("p", {
341
341
  className: "truncate text-sm font-medium text-foreground",
342
342
  children: e.title || "Untitled conversation"
343
- }), /* @__PURE__ */ _("p", {
343
+ }), /* @__PURE__ */ v("p", {
344
344
  className: "text-xs text-muted-foreground",
345
345
  children: [
346
346
  e.type,
@@ -348,7 +348,7 @@ function j() {
348
348
  e.state,
349
349
  " · Updated",
350
350
  " ",
351
- O(e.updatedAt)
351
+ k(e.updatedAt)
352
352
  ]
353
353
  })]
354
354
  })]
@@ -357,8 +357,8 @@ function j() {
357
357
  ]
358
358
  });
359
359
  }
360
- function M() {
361
- let i = t(), { workspaceId: a } = e(), { data: o, loading: c, error: l } = h(S, {
360
+ function N() {
361
+ let i = t(), { workspaceId: a } = e(), { data: o, loading: s, error: l } = g(C, {
362
362
  variables: { filter: {
363
363
  workspaceId: a,
364
364
  resourceType: "conversation",
@@ -366,47 +366,47 @@ function M() {
366
366
  } },
367
367
  skip: !a
368
368
  }), u = o?.getActivities ?? [];
369
- return /* @__PURE__ */ _(r, {
369
+ return /* @__PURE__ */ v(r, {
370
370
  title: i("conversations.admin.auditLogPageTitle", "Audit log"),
371
371
  subtitle: i("conversations.admin.auditLogPageDescription", "Activity stream for admin and moderator actions on workspace conversations."),
372
- icon: /* @__PURE__ */ g(s, {
372
+ icon: /* @__PURE__ */ _(c, {
373
373
  className: "h-5 w-5",
374
374
  "aria-hidden": "true"
375
375
  }),
376
376
  maxWidth: "2xl",
377
377
  children: [
378
- c && /* @__PURE__ */ g("p", {
378
+ s && /* @__PURE__ */ _("p", {
379
379
  className: "text-sm text-muted-foreground",
380
380
  children: "Loading activity..."
381
381
  }),
382
- l && /* @__PURE__ */ g("p", {
382
+ l && /* @__PURE__ */ _("p", {
383
383
  className: "text-sm text-destructive",
384
384
  children: l.message
385
385
  }),
386
- !c && !l && u.length === 0 && /* @__PURE__ */ g(n, {
386
+ !s && !l && u.length === 0 && /* @__PURE__ */ _(n, {
387
387
  title: "No activity found",
388
388
  description: "Conversation admin actions will appear here."
389
389
  }),
390
- /* @__PURE__ */ g("div", {
390
+ /* @__PURE__ */ _("div", {
391
391
  className: "grid gap-3",
392
- children: u.map((e) => /* @__PURE__ */ _("article", {
392
+ children: u.map((e) => /* @__PURE__ */ v("article", {
393
393
  className: "rounded-lg border border-border bg-card p-4",
394
394
  children: [
395
- /* @__PURE__ */ _("div", {
395
+ /* @__PURE__ */ v("div", {
396
396
  className: "flex flex-wrap items-center justify-between gap-2",
397
- children: [/* @__PURE__ */ g("p", {
397
+ children: [/* @__PURE__ */ _("p", {
398
398
  className: "text-sm font-medium text-foreground",
399
399
  children: e.action
400
- }), /* @__PURE__ */ g("span", {
400
+ }), /* @__PURE__ */ _("span", {
401
401
  className: "text-xs text-muted-foreground",
402
- children: O(e.timestamp)
402
+ children: k(e.timestamp)
403
403
  })]
404
404
  }),
405
- /* @__PURE__ */ g("p", {
405
+ /* @__PURE__ */ _("p", {
406
406
  className: "mt-1 text-sm text-muted-foreground",
407
407
  children: e.description || "No description provided"
408
408
  }),
409
- /* @__PURE__ */ _("p", {
409
+ /* @__PURE__ */ v("p", {
410
410
  className: "mt-2 text-xs text-muted-foreground",
411
411
  children: [
412
412
  "User ",
@@ -421,19 +421,20 @@ function M() {
421
421
  ]
422
422
  });
423
423
  }
424
- function N() {
425
- let n = t(), { workspaceId: s } = e(), [c, l] = o(""), [d, p] = o("{}"), [v, y] = o({}), [b, x] = o(null), { data: S, loading: D, error: A, refetch: j } = h(C, {
426
- variables: { workspaceId: s },
427
- skip: !s
428
- }), [M, { loading: N }] = m(w, { onCompleted: () => void j() }), [P, { loading: F }] = m(T, { onCompleted: () => void j() }), [I, { loading: L }] = m(E, { onCompleted: () => void j() }), R = S?.appInstallations ?? [];
424
+ function P() {
425
+ let n = t(), { workspaceId: c } = e(), [l, u] = s(""), [f, m] = s("{}"), [y, b] = s({}), [x, S] = s(null), { data: C, loading: O, error: j, refetch: M } = g(w, {
426
+ variables: { workspaceId: c },
427
+ skip: !c
428
+ }), [N, { loading: P }] = h(T, { onCompleted: () => void M() }), [F, { loading: I }] = h(E, { onCompleted: () => void M() }), [L, { loading: R }] = h(D, { onCompleted: () => void M() }), z = o(() => C?.appInstallations ?? [], [C?.appInstallations]);
429
429
  a(() => {
430
- y((e) => {
430
+ b((e) => {
431
+ if (z.every((t) => e[t.id])) return e;
431
432
  let t = { ...e };
432
- for (let e of R) t[e.id] || (t[e.id] = JSON.stringify(e.settings ?? {}, null, 2));
433
+ for (let e of z) t[e.id] || (t[e.id] = JSON.stringify(e.settings ?? {}, null, 2));
433
434
  return t;
434
435
  });
435
- }, [R]);
436
- let z = (e) => {
436
+ }, [z]);
437
+ let B = (e) => {
437
438
  try {
438
439
  let t = JSON.parse(e);
439
440
  return t && typeof t == "object" && !Array.isArray(t) ? t : null;
@@ -441,78 +442,78 @@ function N() {
441
442
  return null;
442
443
  }
443
444
  };
444
- return /* @__PURE__ */ _(r, {
445
+ return /* @__PURE__ */ v(r, {
445
446
  title: n("conversations.admin.appInstallationsPageTitle", "App installations"),
446
447
  subtitle: n("conversations.admin.appInstallationsPageDescription", "Install, configure, and remove conversation apps and integrations."),
447
- icon: /* @__PURE__ */ g(u, {
448
+ icon: /* @__PURE__ */ _(d, {
448
449
  className: "h-5 w-5",
449
450
  "aria-hidden": "true"
450
451
  }),
451
452
  maxWidth: "2xl",
452
453
  children: [
453
- /* @__PURE__ */ _(i, {
454
+ /* @__PURE__ */ v(i, {
454
455
  title: "Install app",
455
456
  description: "Install a workspace-scoped conversation app by app ID.",
456
- children: [/* @__PURE__ */ _("div", {
457
+ children: [/* @__PURE__ */ v("div", {
457
458
  className: "grid gap-3 rounded-lg border border-border bg-card p-4 sm:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_auto]",
458
459
  children: [
459
- /* @__PURE__ */ g("input", {
460
- value: c,
461
- onChange: (e) => l(e.target.value),
460
+ /* @__PURE__ */ _("input", {
461
+ value: l,
462
+ onChange: (e) => u(e.target.value),
462
463
  placeholder: "app-id",
463
464
  className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground"
464
465
  }),
465
- /* @__PURE__ */ g("textarea", {
466
- value: d,
467
- onChange: (e) => p(e.target.value),
466
+ /* @__PURE__ */ _("textarea", {
467
+ value: f,
468
+ onChange: (e) => m(e.target.value),
468
469
  rows: 3,
469
470
  className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground"
470
471
  }),
471
- /* @__PURE__ */ g("button", {
472
+ /* @__PURE__ */ _("button", {
472
473
  type: "button",
473
- disabled: N,
474
+ disabled: P,
474
475
  className: "rounded-md bg-primary px-3 py-2 text-sm text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
475
476
  onClick: () => {
476
- let e = z(d);
477
- if (!c.trim() || !e) {
478
- x("Enter an app ID and a valid JSON settings object.");
477
+ let e = B(f);
478
+ if (!l.trim() || !e) {
479
+ S("Enter an app ID and a valid JSON settings object.");
479
480
  return;
480
481
  }
481
- x(null), M({ variables: { input: {
482
- appId: c.trim(),
483
- workspaceId: s,
482
+ S(null), N({ variables: { input: {
483
+ appId: l.trim(),
484
+ workspaceId: c,
484
485
  settings: e
485
486
  } } });
486
487
  },
487
488
  children: "Install"
488
489
  })
489
490
  ]
490
- }), b && /* @__PURE__ */ g("p", {
491
+ }), x && /* @__PURE__ */ _("p", {
491
492
  className: "text-sm text-destructive",
492
- children: b
493
+ children: x
493
494
  })]
494
495
  }),
495
- D && /* @__PURE__ */ g("p", {
496
+ O && /* @__PURE__ */ _("p", {
496
497
  className: "text-sm text-muted-foreground",
497
498
  children: "Loading app installations..."
498
499
  }),
499
- A && /* @__PURE__ */ g("p", {
500
+ j && /* @__PURE__ */ _("p", {
500
501
  className: "text-sm text-destructive",
501
- children: A.message
502
+ children: j.message
502
503
  }),
503
- /* @__PURE__ */ g("div", {
504
+ /* @__PURE__ */ _("div", {
504
505
  className: "grid gap-3",
505
- children: R.map((e) => /* @__PURE__ */ _("article", {
506
+ children: z.map((e) => /* @__PURE__ */ v("article", {
506
507
  className: "rounded-lg border border-border bg-card p-4",
507
- children: [/* @__PURE__ */ _("div", {
508
+ children: [/* @__PURE__ */ v("div", {
508
509
  className: "flex flex-wrap items-start justify-between gap-3",
509
- children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("div", {
510
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("div", {
510
511
  className: "flex items-center gap-2",
511
- children: [/* @__PURE__ */ g("h3", {
512
+ children: [/* @__PURE__ */ _("h3", {
512
513
  className: "text-sm font-semibold text-foreground",
513
514
  children: e.appId
514
- }), /* @__PURE__ */ g(k, { children: e.state })]
515
- }), /* @__PURE__ */ _("p", {
515
+ }), /* @__PURE__ */ _(A, { children: e.state })]
516
+ }), /* @__PURE__ */ v("p", {
516
517
  className: "text-xs text-muted-foreground",
517
518
  children: [
518
519
  "Version ",
@@ -522,39 +523,39 @@ function N() {
522
523
  e.installedBy,
523
524
  " on",
524
525
  " ",
525
- O(e.installedAt)
526
+ k(e.installedAt)
526
527
  ]
527
- })] }), /* @__PURE__ */ _("button", {
528
+ })] }), /* @__PURE__ */ v("button", {
528
529
  type: "button",
529
- disabled: L,
530
+ disabled: R,
530
531
  className: "inline-flex items-center gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground hover:bg-accent disabled:opacity-50",
531
- onClick: () => void I({ variables: { id: e.id } }),
532
- children: [/* @__PURE__ */ g(f, {
532
+ onClick: () => void L({ variables: { id: e.id } }),
533
+ children: [/* @__PURE__ */ _(p, {
533
534
  className: "h-4 w-4",
534
535
  "aria-hidden": "true"
535
536
  }), "Uninstall"]
536
537
  })]
537
- }), /* @__PURE__ */ _("div", {
538
+ }), /* @__PURE__ */ v("div", {
538
539
  className: "mt-3 grid gap-2",
539
- children: [/* @__PURE__ */ g("textarea", {
540
+ children: [/* @__PURE__ */ _("textarea", {
540
541
  rows: 5,
541
- value: v[e.id] ?? "{}",
542
- onChange: (t) => y((n) => ({
542
+ value: y[e.id] ?? "{}",
543
+ onChange: (t) => b((n) => ({
543
544
  ...n,
544
545
  [e.id]: t.target.value
545
546
  })),
546
547
  className: "rounded-md border border-border bg-background px-3 py-2 font-mono text-xs text-foreground"
547
- }), /* @__PURE__ */ g("button", {
548
+ }), /* @__PURE__ */ _("button", {
548
549
  type: "button",
549
- disabled: F,
550
+ disabled: I,
550
551
  className: "w-fit rounded-md bg-secondary px-3 py-2 text-sm text-secondary-foreground hover:bg-secondary/90 disabled:opacity-50",
551
552
  onClick: () => {
552
- let t = z(v[e.id] ?? "{}");
553
+ let t = B(y[e.id] ?? "{}");
553
554
  if (!t) {
554
- x("Installation settings must be a valid JSON object.");
555
+ S("Installation settings must be a valid JSON object.");
555
556
  return;
556
557
  }
557
- x(null), P({ variables: {
558
+ S(null), F({ variables: {
558
559
  id: e.id,
559
560
  settings: t
560
561
  } });
@@ -568,6 +569,6 @@ function N() {
568
569
  });
569
570
  }
570
571
  //#endregion
571
- export { N as AppInstallationsPage, j as BulkOperationsPage, M as ConversationAuditLogPage, A as ModerationQueuePage };
572
+ export { P as AppInstallationsPage, M as BulkOperationsPage, N as ConversationAuditLogPage, j as ModerationQueuePage };
572
573
 
573
574
  //# sourceMappingURL=ConversationAdminPages.js.map