@burdenoff/microfe-theculturepost 2026.704.2 → 2026.705.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 (91) hide show
  1. package/dist/theculturepost/TheCulturePostRoot.js +63 -45
  2. package/dist/theculturepost/TheCulturePostRoot.js.map +1 -1
  3. package/dist/theculturepost/TheCulturePostRoutes.js +17 -9
  4. package/dist/theculturepost/TheCulturePostRoutes.js.map +1 -1
  5. package/dist/theculturepost/components/AddCitationDialog.js +131 -102
  6. package/dist/theculturepost/components/AddCitationDialog.js.map +1 -1
  7. package/dist/theculturepost/components/ArchiveItemCard.js +56 -43
  8. package/dist/theculturepost/components/ArchiveItemCard.js.map +1 -1
  9. package/dist/theculturepost/components/AudioPlayer.js +74 -0
  10. package/dist/theculturepost/components/AudioPlayer.js.map +1 -0
  11. package/dist/theculturepost/components/CitationList.js +215 -105
  12. package/dist/theculturepost/components/CitationList.js.map +1 -1
  13. package/dist/theculturepost/components/CollectionCard.js +32 -32
  14. package/dist/theculturepost/components/CollectionCard.js.map +1 -1
  15. package/dist/theculturepost/components/CreateArchiveItemDialog.js +133 -93
  16. package/dist/theculturepost/components/CreateArchiveItemDialog.js.map +1 -1
  17. package/dist/theculturepost/components/CreateCollectionDialog.js +91 -70
  18. package/dist/theculturepost/components/CreateCollectionDialog.js.map +1 -1
  19. package/dist/theculturepost/components/CreateStoryDialog.js +311 -132
  20. package/dist/theculturepost/components/CreateStoryDialog.js.map +1 -1
  21. package/dist/theculturepost/components/DecorativeCover.js +78 -0
  22. package/dist/theculturepost/components/DecorativeCover.js.map +1 -0
  23. package/dist/theculturepost/components/DecorativeDivider.js +45 -0
  24. package/dist/theculturepost/components/DecorativeDivider.js.map +1 -0
  25. package/dist/theculturepost/components/DiscussionCard.js +75 -60
  26. package/dist/theculturepost/components/DiscussionCard.js.map +1 -1
  27. package/dist/theculturepost/components/HistoryTimeline.js +115 -0
  28. package/dist/theculturepost/components/HistoryTimeline.js.map +1 -0
  29. package/dist/theculturepost/components/LifecycleStepper.js +33 -0
  30. package/dist/theculturepost/components/LifecycleStepper.js.map +1 -0
  31. package/dist/theculturepost/components/OpenDiscussionDialog.js +66 -56
  32. package/dist/theculturepost/components/OpenDiscussionDialog.js.map +1 -1
  33. package/dist/theculturepost/components/OralHistoryCard.js +6 -73
  34. package/dist/theculturepost/components/OverlayBadge.js +22 -0
  35. package/dist/theculturepost/components/OverlayBadge.js.map +1 -0
  36. package/dist/theculturepost/components/PageHero.js +62 -0
  37. package/dist/theculturepost/components/PageHero.js.map +1 -0
  38. package/dist/theculturepost/components/RecordOralHistoryDialog.js +306 -131
  39. package/dist/theculturepost/components/RecordOralHistoryDialog.js.map +1 -1
  40. package/dist/theculturepost/components/ReplyThread.js +268 -139
  41. package/dist/theculturepost/components/ReplyThread.js.map +1 -1
  42. package/dist/theculturepost/components/StatusBadge.js +9 -9
  43. package/dist/theculturepost/components/StatusBadge.js.map +1 -1
  44. package/dist/theculturepost/components/StoryCard.js +54 -49
  45. package/dist/theculturepost/components/StoryCard.js.map +1 -1
  46. package/dist/theculturepost/components/TopicCard.js +60 -41
  47. package/dist/theculturepost/components/TopicCard.js.map +1 -1
  48. package/dist/theculturepost/components/Waveform.js +31 -0
  49. package/dist/theculturepost/components/Waveform.js.map +1 -0
  50. package/dist/theculturepost/components/categoryMeta.js +20 -0
  51. package/dist/theculturepost/components/categoryMeta.js.map +1 -0
  52. package/dist/theculturepost/components/index.js +41 -0
  53. package/dist/theculturepost/components/viz/BarChart.js +53 -0
  54. package/dist/theculturepost/components/viz/BarChart.js.map +1 -0
  55. package/dist/theculturepost/components/viz/Donut.js +58 -0
  56. package/dist/theculturepost/components/viz/Donut.js.map +1 -0
  57. package/dist/theculturepost/components/viz/StatTile.js +35 -0
  58. package/dist/theculturepost/components/viz/StatTile.js.map +1 -0
  59. package/dist/theculturepost/components/viz/index.js +3 -0
  60. package/dist/theculturepost/hooks/useFiles.js +1 -1
  61. package/dist/theculturepost/hooks/useFiles.js.map +1 -1
  62. package/dist/theculturepost/pages/HomePage.js +247 -124
  63. package/dist/theculturepost/pages/HomePage.js.map +1 -1
  64. package/dist/theculturepost/pages/archive/ArchiveItemDetailPage.js +319 -127
  65. package/dist/theculturepost/pages/archive/ArchiveItemDetailPage.js.map +1 -1
  66. package/dist/theculturepost/pages/archive/ArchivePage.js +265 -180
  67. package/dist/theculturepost/pages/archive/ArchivePage.js.map +1 -1
  68. package/dist/theculturepost/pages/archive/CollectionDetailPage.js +158 -143
  69. package/dist/theculturepost/pages/archive/CollectionDetailPage.js.map +1 -1
  70. package/dist/theculturepost/pages/discussions/DiscussionDetailPage.js +155 -93
  71. package/dist/theculturepost/pages/discussions/DiscussionDetailPage.js.map +1 -1
  72. package/dist/theculturepost/pages/discussions/DiscussionsPage.js +16 -16
  73. package/dist/theculturepost/pages/discussions/DiscussionsPage.js.map +1 -1
  74. package/dist/theculturepost/pages/governance/GovernancePage.js +293 -0
  75. package/dist/theculturepost/pages/governance/GovernancePage.js.map +1 -0
  76. package/dist/theculturepost/pages/stories/StoriesPage.js +18 -18
  77. package/dist/theculturepost/pages/stories/StoriesPage.js.map +1 -1
  78. package/dist/theculturepost/pages/stories/StoryDetailPage.js +603 -285
  79. package/dist/theculturepost/pages/stories/StoryDetailPage.js.map +1 -1
  80. package/dist/theculturepost/pages/timeline/TimelinePage.js +162 -0
  81. package/dist/theculturepost/pages/timeline/TimelinePage.js.map +1 -0
  82. package/dist/theculturepost/pages/topics/TopicDetailPage.js +239 -163
  83. package/dist/theculturepost/pages/topics/TopicDetailPage.js.map +1 -1
  84. package/dist/theculturepost/pages/topics/TopicsPage.js +76 -74
  85. package/dist/theculturepost/pages/topics/TopicsPage.js.map +1 -1
  86. package/dist/theculturepost/styles/injectDisplayFont.js +11 -0
  87. package/dist/theculturepost/styles/injectDisplayFont.js.map +1 -0
  88. package/dist/theculturepost/utils/formatters.js +6 -1
  89. package/dist/theculturepost/utils/formatters.js.map +1 -1
  90. package/package.json +1 -1
  91. package/dist/theculturepost/components/OralHistoryCard.js.map +0 -1
@@ -1,257 +1,575 @@
1
1
  import { useTheCulturePost as e } from "../../context/TheCulturePostContext.js";
2
- import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { ErrorView as n, LoadingView as r, Section as i } from "../../components/StateViews.js";
2
+ import { cn as t } from "../../utils/cn.js";
4
3
  import "../../context/index.js";
5
- import { FILE_FOLDERS as a } from "../../hooks/useFiles.js";
6
- import { CoverImage as o } from "../../components/CoverImage.js";
7
- import { formatEnumLabel as s, formatNumber as c } from "../../utils/formatters.js";
8
- import { StatusBadge as l } from "../../components/StatusBadge.js";
9
- import { AuthorLabel as u } from "../../components/AuthorLabel.js";
10
- import { DiscussionCard as d } from "../../components/DiscussionCard.js";
4
+ import { FILE_FOLDERS as n } from "../../hooks/useFiles.js";
5
+ import { PageHero as r } from "../../components/PageHero.js";
6
+ import { ErrorView as i, LoadingView as a } from "../../components/StateViews.js";
7
+ import { formatDate as o, formatEnumLabel as s, formatNumber as c, formatRelativeTime as l } from "../../utils/formatters.js";
8
+ import { StatusBadge as u } from "../../components/StatusBadge.js";
9
+ import { AuthorLabel as d } from "../../components/AuthorLabel.js";
11
10
  import { EmptyState as f } from "../../components/EmptyState.js";
12
- import { useTcpDiscussions as p, useTcpStory as m, useTcpTopics as h, useTcpTransitionStory as g, useTcpUpdateStory as _ } from "../../hooks/useTcpApi.js";
11
+ import { useTcpCitations as p, useTcpDiscussions as m, useTcpStory as h, useTcpTopics as g, useTcpTransitionStory as _, useTcpUpdateStory as v, useTcpVerifyCitation as y } from "../../hooks/useTcpApi.js";
13
12
  import "../../hooks/index.js";
14
- import { describeError as v, notify as y } from "../../lib/toast.js";
15
- import { FileUploadField as b } from "../../components/FileUploadField.js";
16
- import { TagInput as x } from "../../components/TagInput.js";
17
- import { OpenDiscussionDialog as S } from "../../components/OpenDiscussionDialog.js";
18
- import { CitationList as C } from "../../components/CitationList.js";
19
- import { AddCitationDialog as w } from "../../components/AddCitationDialog.js";
20
- import { useMemo as T, useState as E } from "react";
21
- import { ArrowLeft as D, BookOpen as O, Clock as k, GitBranch as A, Languages as j, MessagesSquare as M, Pencil as N, Plus as P, Tag as F } from "lucide-react";
22
- import { useParams as I } from "react-router-dom";
23
- import { jsx as L, jsxs as R } from "react/jsx-runtime";
24
- import { Button as z, GlassCard as B, Input as V, Label as H, ResponsiveDialog as U, ResponsiveDialogContent as W, ResponsiveDialogDescription as G, ResponsiveDialogFooter as K, ResponsiveDialogHeader as q, ResponsiveDialogTitle as J, Select as Y, SelectContent as X, SelectItem as Z, SelectTrigger as Q, SelectValue as $, Textarea as ee } from "@burdenoff/fe-libs/ui";
13
+ import { DecorativeDivider as b } from "../../components/DecorativeDivider.js";
14
+ import { describeError as x, notify as S } from "../../lib/toast.js";
15
+ import { Tabs as C } from "../../components/Tabs.js";
16
+ import { TagInput as w } from "../../components/TagInput.js";
17
+ import { OpenDiscussionDialog as T } from "../../components/OpenDiscussionDialog.js";
18
+ import { LifecycleStepper as E } from "../../components/LifecycleStepper.js";
19
+ import { FileUploadField as D } from "../../components/FileUploadField.js";
20
+ import { CitationList as O, VERIFICATIONS as k, VERIFICATION_META as A, sourceTypeIcon as j } from "../../components/CitationList.js";
21
+ import { AddCitationDialog as M } from "../../components/AddCitationDialog.js";
22
+ import { Fragment as N, useMemo as P, useState as F } from "react";
23
+ import { Archive as I, ArrowLeft as L, BookOpen as ee, ChevronDown as te, Clock as ne, GitBranch as R, Languages as re, Lightbulb as ie, Lock as ae, MessagesSquare as z, Pencil as oe, Plus as B, RotateCcw as se, Scroll as V, Send as H, ShieldCheck as U, Sparkles as ce, Tag as le } from "lucide-react";
24
+ import { useParams as ue, useSearchParams as de } from "react-router-dom";
25
+ import { Fragment as fe, jsx as W, jsxs as G } from "react/jsx-runtime";
26
+ import { Button as K, DropdownMenu as pe, DropdownMenuContent as me, DropdownMenuItem as he, DropdownMenuTrigger as ge, GlassCard as q, Input as J, Label as Y, ResponsiveDialog as _e, ResponsiveDialogContent as ve, ResponsiveDialogDescription as ye, ResponsiveDialogFooter as be, ResponsiveDialogHeader as xe, ResponsiveDialogTitle as Se, ResponsiveTable as Ce, Select as X, SelectContent as Z, SelectItem as Q, SelectTrigger as $, SelectValue as we, Textarea as Te } from "@burdenoff/fe-libs/ui";
25
27
  //#region src/theculturepost/pages/stories/StoryDetailPage.tsx
26
- var te = {
28
+ var Ee = {
27
29
  IDEA: ["DRAFT"],
28
30
  DRAFT: ["IN_REVIEW"],
29
31
  IN_REVIEW: ["PUBLISHED", "DRAFT"],
30
32
  PUBLISHED: ["ARCHIVED"],
31
33
  ARCHIVED: ["PUBLISHED"]
32
- }, ne = {
33
- IDEA: "Move to Idea",
34
- DRAFT: "Move to Draft",
35
- IN_REVIEW: "Send to Review",
36
- PUBLISHED: "Publish",
37
- ARCHIVED: "Archive"
34
+ }, De = {
35
+ IDEA: {
36
+ label: "Move to Idea",
37
+ icon: ie
38
+ },
39
+ DRAFT: {
40
+ label: "Send back to Draft",
41
+ icon: se
42
+ },
43
+ IN_REVIEW: {
44
+ label: "Send to Review",
45
+ icon: H
46
+ },
47
+ PUBLISHED: {
48
+ label: "Publish",
49
+ icon: H,
50
+ primary: !0
51
+ },
52
+ ARCHIVED: {
53
+ label: "Archive",
54
+ icon: I
55
+ }
38
56
  };
39
- function re() {
40
- let { id: a } = I(), { navigateTo: h } = e(), { data: _, isLoading: b, isError: x, refetch: T } = m(a), V = g(), [H, U] = E(!1), [W, G] = E(!1), [K, q] = E(!1), J = p({
41
- storyId: a,
57
+ function Oe(e) {
58
+ switch (A[e].accent) {
59
+ case "success": return "text-status-success-text";
60
+ case "warning": return "text-status-warning-text";
61
+ case "destructive": return "text-status-error-text";
62
+ default: return "text-text-tertiary";
63
+ }
64
+ }
65
+ function ke() {
66
+ let { id: t } = ue(), { navigateTo: n } = e(), [o, l] = de(), f = o.get("view") === "editorial" ? "editorial" : "reading", p = (e) => {
67
+ l((t) => {
68
+ let n = new URLSearchParams(t);
69
+ return e === "editorial" ? n.set("view", "editorial") : n.delete("view"), n;
70
+ }, { replace: !0 });
71
+ }, { data: g, isLoading: _, isError: v, refetch: y } = h(t), [b, x] = F(!1), [S, w] = F(!1), [E, D] = F(!1), O = m({
72
+ storyId: t,
42
73
  pagination: { limit: 20 }
43
- }), Y = J.data?.items ?? [], X = /* @__PURE__ */ R(z, {
44
- variant: "ghost",
45
- size: "sm",
46
- onClick: () => h("stories"),
47
- children: [/* @__PURE__ */ L(D, { className: "mr-1.5 h-4 w-4" }), " Back"]
48
- });
49
- if (b) return /* @__PURE__ */ L(t, {
50
- title: "Story",
51
- actions: X,
52
- children: /* @__PURE__ */ L(r, { label: "Loading story…" })
74
+ }), k = O.data?.items ?? [];
75
+ if (_) return /* @__PURE__ */ G("div", {
76
+ className: "mx-auto max-w-6xl p-4 sm:p-6",
77
+ children: [/* @__PURE__ */ G(K, {
78
+ variant: "ghost",
79
+ size: "sm",
80
+ onClick: () => n("stories"),
81
+ children: [/* @__PURE__ */ W(L, { className: "mr-1.5 h-4 w-4" }), " Stories"]
82
+ }), /* @__PURE__ */ W(a, { label: "Loading story…" })]
53
83
  });
54
- if (x || !_) return /* @__PURE__ */ L(t, {
55
- title: "Story",
56
- actions: X,
57
- children: /* @__PURE__ */ L(n, {
84
+ if (v || !g) return /* @__PURE__ */ G("div", {
85
+ className: "mx-auto max-w-6xl p-4 sm:p-6",
86
+ children: [/* @__PURE__ */ G(K, {
87
+ variant: "ghost",
88
+ size: "sm",
89
+ onClick: () => n("stories"),
90
+ children: [/* @__PURE__ */ W(L, { className: "mr-1.5 h-4 w-4" }), " Stories"]
91
+ }), /* @__PURE__ */ W(i, {
58
92
  title: "Story not found",
59
93
  message: "This story may have been archived, or you may not have access.",
60
- onRetry: () => T()
61
- })
94
+ onRetry: () => y()
95
+ })]
62
96
  });
63
- let Z = te[_.status] ?? [], Q = async (e) => {
64
- try {
65
- await V.mutateAsync({
66
- id: _.id,
67
- status: e
68
- }), y.success("Story updated", `Moved to ${s(e)}`);
69
- } catch (e) {
70
- y.error("Could not update the story", v(e));
71
- }
72
- };
73
- return /* @__PURE__ */ R(t, {
74
- title: _.title,
75
- actions: /* @__PURE__ */ R("div", {
76
- className: "flex items-center gap-2",
77
- children: [X, /* @__PURE__ */ R(z, {
78
- variant: "outline",
79
- onClick: () => q(!0),
80
- children: [/* @__PURE__ */ L(N, { className: "mr-1.5 h-4 w-4" }), " Edit"]
81
- })]
97
+ let A = /* @__PURE__ */ G(fe, { children: [
98
+ /* @__PURE__ */ W(u, { status: g.format }),
99
+ /* @__PURE__ */ W(u, { status: g.status }),
100
+ g.topic && /* @__PURE__ */ G("button", {
101
+ type: "button",
102
+ onClick: () => n(`topics/${g.topic.id}`),
103
+ className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary transition-colors hover:text-text-primary",
104
+ children: [
105
+ /* @__PURE__ */ W(le, {
106
+ className: "h-3 w-3",
107
+ "aria-hidden": "true"
108
+ }),
109
+ " ",
110
+ g.topic.name
111
+ ]
82
112
  }),
113
+ /* @__PURE__ */ W("span", {
114
+ className: "inline-flex items-center gap-1.5 text-xs text-text-tertiary",
115
+ children: /* @__PURE__ */ W(d, {
116
+ actorId: g.authorId,
117
+ prefix: "By",
118
+ withIcon: !0
119
+ })
120
+ }),
121
+ g.readingMins > 0 && /* @__PURE__ */ G("span", {
122
+ className: "inline-flex items-center gap-1 text-xs text-text-tertiary",
123
+ children: [
124
+ /* @__PURE__ */ W(ne, {
125
+ className: "h-3.5 w-3.5",
126
+ "aria-hidden": "true"
127
+ }),
128
+ " ",
129
+ c(g.readingMins),
130
+ " min read"
131
+ ]
132
+ }),
133
+ g.languages.length > 0 && /* @__PURE__ */ G("span", {
134
+ className: "inline-flex items-center gap-1 text-xs text-text-tertiary",
135
+ children: [
136
+ /* @__PURE__ */ W(re, {
137
+ className: "h-3.5 w-3.5",
138
+ "aria-hidden": "true"
139
+ }),
140
+ " ",
141
+ g.languages.map(s).join(", ")
142
+ ]
143
+ })
144
+ ] }), j = [{
145
+ value: "reading",
146
+ label: "Reading",
147
+ icon: /* @__PURE__ */ W(ee, { className: "h-4 w-4" })
148
+ }, {
149
+ value: "editorial",
150
+ label: "Editorial",
151
+ icon: /* @__PURE__ */ W(R, { className: "h-4 w-4" }),
152
+ count: g.citations.length
153
+ }];
154
+ return /* @__PURE__ */ G("div", {
155
+ className: "mx-auto flex max-w-6xl flex-col gap-6 p-4 sm:p-6",
83
156
  children: [
84
- /* @__PURE__ */ R("article", {
85
- className: "mx-auto flex max-w-3xl flex-col gap-6",
157
+ /* @__PURE__ */ W(r, {
158
+ eyebrow: "Story",
159
+ title: g.title,
160
+ description: g.summary ?? void 0,
161
+ coverFileId: g.cover?.id ?? void 0,
162
+ backAction: {
163
+ label: "Stories",
164
+ onClick: () => n("stories")
165
+ },
166
+ meta: A,
167
+ actions: /* @__PURE__ */ G(K, {
168
+ variant: "outline",
169
+ onClick: () => D(!0),
170
+ children: [/* @__PURE__ */ W(oe, { className: "mr-1.5 h-4 w-4" }), " Edit"]
171
+ })
172
+ }),
173
+ /* @__PURE__ */ W(C, {
174
+ items: j,
175
+ value: f,
176
+ onChange: p
177
+ }),
178
+ f === "reading" ? /* @__PURE__ */ W(Ae, {
179
+ story: g,
180
+ discussions: k,
181
+ discussionsLoading: O.isLoading,
182
+ onViewCitations: () => p("editorial"),
183
+ onOpenDiscussion: () => w(!0),
184
+ onViewAllDiscussions: () => n("discussions"),
185
+ onOpenDiscussionItem: (e) => n(`discussions/${e.id}`)
186
+ }) : /* @__PURE__ */ W(Pe, {
187
+ story: g,
188
+ onAddCitation: () => x(!0)
189
+ }),
190
+ /* @__PURE__ */ W(M, {
191
+ open: b,
192
+ onOpenChange: x,
193
+ storyId: g.id
194
+ }),
195
+ /* @__PURE__ */ W(T, {
196
+ open: S,
197
+ onOpenChange: w,
198
+ storyId: g.id,
199
+ onCreated: (e) => n(`discussions/${e.id}`)
200
+ }),
201
+ /* @__PURE__ */ W(Re, {
202
+ open: E,
203
+ onOpenChange: D,
204
+ story: g
205
+ })
206
+ ]
207
+ });
208
+ }
209
+ function Ae({ story: e, discussions: t, discussionsLoading: n, onViewCitations: r, onOpenDiscussion: i, onViewAllDiscussions: o, onOpenDiscussionItem: s }) {
210
+ return /* @__PURE__ */ G("div", {
211
+ className: "grid grid-cols-1 gap-8 lg:grid-cols-[minmax(0,1fr)_360px]",
212
+ children: [/* @__PURE__ */ G("article", {
213
+ className: "min-w-0",
214
+ children: [/* @__PURE__ */ W(Me, { body: e.body }), e.tags.length > 0 && /* @__PURE__ */ W("div", {
215
+ className: "mt-8 flex flex-wrap gap-1.5 border-t border-border-seam pt-6",
216
+ children: e.tags.map((e) => /* @__PURE__ */ G("span", {
217
+ className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
218
+ children: ["#", e]
219
+ }, e))
220
+ })]
221
+ }), /* @__PURE__ */ G("aside", {
222
+ className: "flex flex-col gap-6 lg:sticky lg:top-4 lg:self-start",
223
+ children: [/* @__PURE__ */ W(je, {
224
+ title: "Citations",
225
+ action: /* @__PURE__ */ W("button", {
226
+ type: "button",
227
+ onClick: r,
228
+ className: "text-xs font-medium text-accent hover:underline",
229
+ children: "View all"
230
+ }),
231
+ children: /* @__PURE__ */ W(O, {
232
+ storyId: e.id,
233
+ compact: !0
234
+ })
235
+ }), /* @__PURE__ */ W(je, {
236
+ title: "Linked discussions",
237
+ action: /* @__PURE__ */ W("button", {
238
+ type: "button",
239
+ onClick: o,
240
+ className: "text-xs font-medium text-accent hover:underline",
241
+ children: "View all"
242
+ }),
243
+ children: n ? /* @__PURE__ */ W(a, {
244
+ label: "Loading discussions…",
245
+ className: "min-h-[8rem]"
246
+ }) : t.length === 0 ? /* @__PURE__ */ W(f, {
247
+ icon: /* @__PURE__ */ W(z, { className: "h-8 w-8" }),
248
+ title: "No discussions yet",
249
+ description: "Open a discussion to invite perspectives on this story.",
250
+ action: /* @__PURE__ */ G(K, {
251
+ size: "sm",
252
+ variant: "outline",
253
+ onClick: i,
254
+ children: [/* @__PURE__ */ W(B, { className: "mr-1.5 h-4 w-4" }), " Open discussion"]
255
+ })
256
+ }) : /* @__PURE__ */ W("div", {
257
+ className: "flex flex-col gap-3",
258
+ children: t.slice(0, 5).map((e) => /* @__PURE__ */ W(Ne, {
259
+ discussion: e,
260
+ onOpen: () => s(e)
261
+ }, e.id))
262
+ })
263
+ })]
264
+ })]
265
+ });
266
+ }
267
+ function je({ title: e, action: t, children: n }) {
268
+ return /* @__PURE__ */ G("section", { children: [/* @__PURE__ */ G("div", {
269
+ className: "mb-3 flex items-center justify-between gap-2",
270
+ children: [/* @__PURE__ */ W("h2", {
271
+ className: "font-display text-lg font-semibold text-text-primary",
272
+ children: e
273
+ }), t]
274
+ }), n] });
275
+ }
276
+ function Me({ body: e }) {
277
+ let n = P(() => (e ?? "").split(/\n{2,}/).map((e) => e.trim()).filter(Boolean), [e]);
278
+ return n.length === 0 ? /* @__PURE__ */ W("p", {
279
+ className: "rounded-xl border border-dashed border-border-seam px-4 py-10 text-center text-sm text-text-tertiary",
280
+ children: "This story has no body yet. Use Edit to write it."
281
+ }) : /* @__PURE__ */ W("div", {
282
+ className: "max-w-prose",
283
+ children: n.map((e, n) => /* @__PURE__ */ G(N, { children: [n === 1 && /* @__PURE__ */ W(b, {}), /* @__PURE__ */ W("p", {
284
+ className: t("text-[1.05rem] leading-8 text-text-primary", n > 0 && n !== 1 && "mt-5", n === 0 && "first-letter:float-left first-letter:mr-3 first-letter:mt-1 first-letter:font-display first-letter:text-6xl first-letter:font-semibold first-letter:leading-[0.72] first-letter:text-accent"),
285
+ children: e
286
+ })] }, n))
287
+ });
288
+ }
289
+ function Ne({ discussion: e, onOpen: t }) {
290
+ return /* @__PURE__ */ W("button", {
291
+ type: "button",
292
+ onClick: t,
293
+ className: "w-full rounded-xl border border-border-seam bg-bg-surface p-3 text-left transition-colors hover:border-border-strong",
294
+ children: /* @__PURE__ */ G("div", {
295
+ className: "flex items-start gap-2.5",
296
+ children: [/* @__PURE__ */ W("span", {
297
+ className: "grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
298
+ "aria-hidden": "true",
299
+ children: /* @__PURE__ */ W(z, { className: "h-4 w-4" })
300
+ }), /* @__PURE__ */ G("div", {
301
+ className: "min-w-0 flex-1",
86
302
  children: [
87
- /* @__PURE__ */ L(o, {
88
- fileId: _.cover?.id,
89
- alt: _.title,
90
- className: "aspect-[16/9] w-full",
91
- icon: /* @__PURE__ */ L(O, { className: "h-10 w-10" })
303
+ /* @__PURE__ */ W("p", {
304
+ className: "truncate text-sm font-medium text-text-primary",
305
+ children: e.title
92
306
  }),
93
- /* @__PURE__ */ R("div", {
94
- className: "flex flex-col gap-3",
95
- children: [
96
- /* @__PURE__ */ R("div", {
97
- className: "flex flex-wrap items-center gap-1.5",
98
- children: [
99
- /* @__PURE__ */ L(l, { status: _.format }),
100
- /* @__PURE__ */ L(l, { status: _.status }),
101
- _.topic && /* @__PURE__ */ R("button", {
102
- type: "button",
103
- onClick: () => h(`topics/${_.topic.id}`),
104
- className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary hover:text-text-primary",
105
- children: [
106
- /* @__PURE__ */ L(F, { className: "h-3 w-3" }),
107
- " ",
108
- _.topic.name
109
- ]
110
- })
111
- ]
112
- }),
113
- _.summary && /* @__PURE__ */ L("p", {
114
- className: "text-lg leading-relaxed text-text-secondary",
115
- children: _.summary
116
- }),
117
- /* @__PURE__ */ R("div", {
118
- className: "flex flex-wrap items-center gap-x-4 gap-y-1.5 text-sm text-text-tertiary",
119
- children: [
120
- /* @__PURE__ */ L(u, {
121
- actorId: _.authorId,
122
- prefix: "By",
123
- withIcon: !0
124
- }),
125
- _.editorId && /* @__PURE__ */ L(u, {
126
- actorId: _.editorId,
127
- prefix: "Edited by"
128
- }),
129
- _.readingMins > 0 && /* @__PURE__ */ R("span", {
130
- className: "inline-flex items-center gap-1",
131
- children: [
132
- /* @__PURE__ */ L(k, { className: "h-4 w-4" }),
133
- " ",
134
- c(_.readingMins),
135
- " min read"
136
- ]
137
- }),
138
- _.languages.length > 0 && /* @__PURE__ */ R("span", {
139
- className: "inline-flex items-center gap-1",
140
- children: [
141
- /* @__PURE__ */ L(j, { className: "h-4 w-4" }),
142
- " ",
143
- _.languages.map(s).join(", ")
144
- ]
145
- })
146
- ]
147
- }),
148
- _.tags.length > 0 && /* @__PURE__ */ L("div", {
149
- className: "flex flex-wrap gap-1.5",
150
- children: _.tags.map((e) => /* @__PURE__ */ R("span", {
151
- className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
152
- children: ["#", e]
153
- }, e))
154
- })
155
- ]
307
+ e.prompt && /* @__PURE__ */ W("p", {
308
+ className: "mt-0.5 line-clamp-2 text-xs text-text-tertiary",
309
+ children: e.prompt
156
310
  }),
157
- /* @__PURE__ */ R(B, {
158
- treatment: "plain",
159
- className: "p-5",
311
+ /* @__PURE__ */ G("div", {
312
+ className: "mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-text-tertiary",
160
313
  children: [
161
- /* @__PURE__ */ R("div", {
162
- className: "flex items-center gap-2",
163
- children: [/* @__PURE__ */ L(A, { className: "h-4 w-4 text-text-tertiary" }), /* @__PURE__ */ L("h2", {
164
- className: "text-sm font-semibold text-text-primary",
165
- children: "Editorial lifecycle"
166
- })]
314
+ /* @__PURE__ */ G("span", { children: [
315
+ c(e.replyCount),
316
+ " ",
317
+ e.replyCount === 1 ? "reply" : "replies"
318
+ ] }),
319
+ /* @__PURE__ */ W("span", {
320
+ "aria-hidden": "true",
321
+ children: "·"
167
322
  }),
168
- /* @__PURE__ */ R("p", {
169
- className: "mt-1 text-sm text-text-secondary",
170
- children: [
171
- "Current stage:",
172
- " ",
173
- /* @__PURE__ */ L("span", {
174
- className: "font-medium text-text-primary",
175
- children: s(_.status)
176
- })
177
- ]
323
+ /* @__PURE__ */ W("span", { children: l(e.createdAt) }),
324
+ e.isInterfaith && /* @__PURE__ */ W(u, {
325
+ status: "Interfaith",
326
+ icon: /* @__PURE__ */ W(ce, { className: "h-3 w-3" }),
327
+ className: "ml-0.5"
178
328
  }),
179
- Z.length > 0 ? /* @__PURE__ */ L("div", {
180
- className: "mt-3 flex flex-wrap gap-2",
181
- children: Z.map((e) => /* @__PURE__ */ L(z, {
182
- size: "sm",
183
- variant: e === "PUBLISHED" ? "default" : "outline",
184
- onClick: () => Q(e),
185
- disabled: V.isPending,
186
- children: ne[e]
187
- }, e))
188
- }) : /* @__PURE__ */ L("p", {
189
- className: "mt-3 text-sm text-text-tertiary",
190
- children: "This story is at the end of its lifecycle."
329
+ e.isLocked && /* @__PURE__ */ G("span", {
330
+ className: "inline-flex items-center gap-1 text-text-tertiary",
331
+ children: [/* @__PURE__ */ W(ae, {
332
+ className: "h-3 w-3",
333
+ "aria-hidden": "true"
334
+ }), " Locked"]
191
335
  })
192
336
  ]
193
- }),
194
- _.body ? /* @__PURE__ */ L("div", {
195
- className: "whitespace-pre-wrap text-base leading-relaxed text-text-primary",
196
- children: _.body
197
- }) : /* @__PURE__ */ L("p", {
198
- className: "rounded-xl border border-dashed border-border-seam px-4 py-6 text-center text-sm text-text-tertiary",
199
- children: "This story has no body yet. Use Edit to write it."
200
- }),
201
- /* @__PURE__ */ L(i, {
202
- title: "Citations",
203
- description: "Verifiable sources that ground this story.",
204
- action: /* @__PURE__ */ R(z, {
205
- size: "sm",
206
- variant: "outline",
207
- onClick: () => U(!0),
208
- children: [/* @__PURE__ */ L(P, { className: "mr-1.5 h-4 w-4" }), " Add citation"]
209
- }),
210
- children: /* @__PURE__ */ L(C, { storyId: _.id })
211
- }),
212
- /* @__PURE__ */ L(i, {
213
- title: "Discussions",
214
- description: "Conversations anchored to this story.",
215
- action: /* @__PURE__ */ R(z, {
216
- size: "sm",
217
- variant: "outline",
218
- onClick: () => G(!0),
219
- children: [/* @__PURE__ */ L(P, { className: "mr-1.5 h-4 w-4" }), " Open discussion"]
220
- }),
221
- children: J.isLoading ? /* @__PURE__ */ L(r, { label: "Loading discussions…" }) : Y.length === 0 ? /* @__PURE__ */ L(f, {
222
- icon: /* @__PURE__ */ L(M, { className: "h-9 w-9" }),
223
- title: "No discussions yet",
224
- description: "Open a discussion to invite perspectives on this story."
225
- }) : /* @__PURE__ */ L("div", {
226
- className: "grid gap-4 md:grid-cols-2",
227
- children: Y.map((e) => /* @__PURE__ */ L(d, {
228
- discussion: e,
229
- onOpen: () => h(`discussions/${e.id}`)
230
- }, e.id))
231
- })
232
337
  })
233
338
  ]
234
- }),
235
- /* @__PURE__ */ L(w, {
236
- open: H,
237
- onOpenChange: U,
238
- storyId: _.id
239
- }),
240
- /* @__PURE__ */ L(S, {
241
- open: W,
242
- onOpenChange: G,
243
- storyId: _.id,
244
- onCreated: (e) => h(`discussions/${e.id}`)
245
- }),
246
- /* @__PURE__ */ L(ae, {
247
- open: K,
248
- onOpenChange: q,
249
- story: _
250
- })
251
- ]
339
+ })]
340
+ })
341
+ });
342
+ }
343
+ function Pe({ story: e, onAddCitation: t }) {
344
+ let n = _(), r = Ee[e.status] ?? [], i = async (t) => {
345
+ try {
346
+ await n.mutateAsync({
347
+ id: e.id,
348
+ status: t
349
+ }), S.success("Story updated", `Moved to ${s(t)}`);
350
+ } catch (e) {
351
+ S.error("Could not update the story", x(e));
352
+ }
353
+ };
354
+ return /* @__PURE__ */ G("div", {
355
+ className: "flex flex-col gap-6",
356
+ children: [/* @__PURE__ */ G(q, {
357
+ treatment: "plain",
358
+ className: "p-5 sm:p-6",
359
+ children: [
360
+ /* @__PURE__ */ G("div", {
361
+ className: "flex items-center gap-2.5",
362
+ children: [/* @__PURE__ */ W("span", {
363
+ className: "grid h-9 w-9 shrink-0 place-items-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
364
+ "aria-hidden": "true",
365
+ children: /* @__PURE__ */ W(R, { className: "h-5 w-5" })
366
+ }), /* @__PURE__ */ W("h2", {
367
+ className: "font-display text-xl font-semibold text-text-primary",
368
+ children: "Editorial lifecycle"
369
+ })]
370
+ }),
371
+ /* @__PURE__ */ W(E, {
372
+ status: e.status,
373
+ className: "mt-6"
374
+ }),
375
+ /* @__PURE__ */ G("div", {
376
+ className: "mt-6 flex flex-col gap-4 border-t border-border-seam pt-5 md:flex-row md:items-center md:justify-between",
377
+ children: [r.length > 0 ? /* @__PURE__ */ W("div", {
378
+ className: "flex flex-wrap gap-2",
379
+ children: r.map((e) => {
380
+ let t = De[e], r = t.icon;
381
+ return /* @__PURE__ */ G(K, {
382
+ variant: t.primary ? "default" : "outline",
383
+ onClick: () => i(e),
384
+ disabled: n.isPending,
385
+ children: [/* @__PURE__ */ W(r, {
386
+ className: "mr-1.5 h-4 w-4",
387
+ "aria-hidden": "true"
388
+ }), t.label]
389
+ }, e);
390
+ })
391
+ }) : /* @__PURE__ */ W("p", {
392
+ className: "text-sm text-text-tertiary",
393
+ children: "This story is at the end of its lifecycle."
394
+ }), /* @__PURE__ */ G("p", {
395
+ className: "flex items-center gap-2 text-sm text-text-secondary",
396
+ children: [/* @__PURE__ */ W(U, {
397
+ className: "h-4 w-4 shrink-0 text-text-tertiary",
398
+ "aria-hidden": "true"
399
+ }), "Reviewed with fact and sensitivity care before publishing."]
400
+ })]
401
+ })
402
+ ]
403
+ }), /* @__PURE__ */ G(q, {
404
+ treatment: "plain",
405
+ className: "p-5 sm:p-6",
406
+ children: [
407
+ /* @__PURE__ */ G("div", {
408
+ className: "flex flex-wrap items-center justify-between gap-3",
409
+ children: [/* @__PURE__ */ G("div", {
410
+ className: "flex items-center gap-2.5",
411
+ children: [/* @__PURE__ */ W("span", {
412
+ className: "grid h-9 w-9 shrink-0 place-items-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
413
+ "aria-hidden": "true",
414
+ children: /* @__PURE__ */ W(V, { className: "h-5 w-5" })
415
+ }), /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("h2", {
416
+ className: "font-display text-xl font-semibold text-text-primary",
417
+ children: "Citations"
418
+ }), /* @__PURE__ */ W("p", {
419
+ className: "text-sm text-text-secondary",
420
+ children: "Verifiable sources that ground this story."
421
+ })] })]
422
+ }), /* @__PURE__ */ G(K, {
423
+ variant: "outline",
424
+ onClick: t,
425
+ children: [/* @__PURE__ */ W(B, { className: "mr-1.5 h-4 w-4" }), " Add citation"]
426
+ })]
427
+ }),
428
+ /* @__PURE__ */ W(Fe, {
429
+ storyId: e.id,
430
+ className: "mt-5"
431
+ }),
432
+ /* @__PURE__ */ G("p", {
433
+ className: "mt-4 flex items-center gap-2 border-t border-border-seam pt-4 text-xs text-text-tertiary",
434
+ children: [/* @__PURE__ */ W(U, {
435
+ className: "h-3.5 w-3.5 shrink-0",
436
+ "aria-hidden": "true"
437
+ }), "All sources are evaluated for accuracy, relevance, and cultural sensitivity."]
438
+ })
439
+ ]
440
+ })]
441
+ });
442
+ }
443
+ function Fe({ storyId: e, className: n }) {
444
+ let { data: r, isLoading: s, isError: c, refetch: l } = p(e);
445
+ return s ? /* @__PURE__ */ W(a, {
446
+ label: "Loading citations…",
447
+ className: n
448
+ }) : c ? /* @__PURE__ */ W("div", {
449
+ className: n,
450
+ children: /* @__PURE__ */ W(i, {
451
+ message: "We couldn't load citations.",
452
+ onRetry: () => l()
453
+ })
454
+ }) : /* @__PURE__ */ W(Ce, {
455
+ className: n,
456
+ columns: [
457
+ {
458
+ key: "source",
459
+ header: "Source",
460
+ priority: "primary",
461
+ cell: (e) => {
462
+ let t = j(e.sourceType), n = [e.author, e.publisher].filter((e) => e && e.trim()).join(" · ");
463
+ return /* @__PURE__ */ G("div", {
464
+ className: "flex min-w-0 items-start gap-3",
465
+ children: [/* @__PURE__ */ W("span", {
466
+ className: "grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
467
+ "aria-hidden": "true",
468
+ children: /* @__PURE__ */ W(t, { className: "h-4 w-4" })
469
+ }), /* @__PURE__ */ G("div", {
470
+ className: "min-w-0",
471
+ children: [
472
+ /* @__PURE__ */ W("p", {
473
+ className: "font-medium text-text-primary",
474
+ children: e.title
475
+ }),
476
+ e.excerpt && /* @__PURE__ */ W("p", {
477
+ className: "mt-0.5 line-clamp-1 text-xs italic text-text-tertiary",
478
+ children: e.excerpt
479
+ }),
480
+ n && /* @__PURE__ */ W("p", {
481
+ className: "mt-0.5 text-xs text-text-tertiary",
482
+ children: n
483
+ })
484
+ ]
485
+ })]
486
+ });
487
+ }
488
+ },
489
+ {
490
+ key: "type",
491
+ header: "Type",
492
+ cell: (e) => /* @__PURE__ */ W(u, {
493
+ status: e.sourceType,
494
+ icon: /* @__PURE__ */ W(j(e.sourceType), { className: "h-3 w-3" })
495
+ })
496
+ },
497
+ {
498
+ key: "added",
499
+ header: "Added on",
500
+ priority: "hidden-on-mobile",
501
+ cell: (e) => /* @__PURE__ */ W("span", {
502
+ className: "whitespace-nowrap text-sm text-text-secondary",
503
+ children: o(e.createdAt)
504
+ })
505
+ },
506
+ {
507
+ key: "verification",
508
+ header: "Status",
509
+ cell: (e) => {
510
+ let n = A[e.verification].icon;
511
+ return /* @__PURE__ */ W(u, {
512
+ status: e.verification,
513
+ icon: /* @__PURE__ */ W(n, { className: t("h-3 w-3", Oe(e.verification)) })
514
+ });
515
+ }
516
+ },
517
+ {
518
+ key: "actions",
519
+ header: "Actions",
520
+ headerClassName: "text-right",
521
+ cellClassName: "text-right",
522
+ cell: (e) => /* @__PURE__ */ W(Ie, { citation: e })
523
+ }
524
+ ],
525
+ data: r ?? [],
526
+ rowKey: (e) => e.id,
527
+ emptyState: /* @__PURE__ */ W(f, {
528
+ icon: /* @__PURE__ */ W(V, { className: "h-9 w-9" }),
529
+ title: "No citations yet",
530
+ description: "Add verifiable sources to ground this story in the record."
531
+ })
252
532
  });
253
533
  }
254
- var ie = [
534
+ function Ie({ citation: e }) {
535
+ let n = y(), r = async (t) => {
536
+ if (t !== e.verification) try {
537
+ await n.mutateAsync({
538
+ id: e.id,
539
+ verification: t
540
+ }), S.success("Verification updated", s(t));
541
+ } catch (e) {
542
+ S.error("Could not update verification", x(e));
543
+ }
544
+ };
545
+ return /* @__PURE__ */ G(pe, { children: [/* @__PURE__ */ W(ge, {
546
+ asChild: !0,
547
+ children: /* @__PURE__ */ G(K, {
548
+ size: "sm",
549
+ variant: "outline",
550
+ disabled: n.isPending,
551
+ "aria-label": `Change verification for ${e.title}`,
552
+ children: ["Verify ", /* @__PURE__ */ W(te, {
553
+ className: "ml-1 h-4 w-4",
554
+ "aria-hidden": "true"
555
+ })]
556
+ })
557
+ }), /* @__PURE__ */ W(me, {
558
+ align: "end",
559
+ children: k.map((n) => {
560
+ let i = A[n], a = i.icon;
561
+ return /* @__PURE__ */ G(he, {
562
+ onSelect: () => r(n),
563
+ className: t("gap-2", n === e.verification && "font-semibold"),
564
+ children: [/* @__PURE__ */ W(a, {
565
+ className: t("h-4 w-4", Oe(n)),
566
+ "aria-hidden": "true"
567
+ }), i.label]
568
+ }, n);
569
+ })
570
+ })] });
571
+ }
572
+ var Le = [
255
573
  "ARTICLE",
256
574
  "ESSAY",
257
575
  "EXPLAINER",
@@ -259,160 +577,160 @@ var ie = [
259
577
  "PHOTO_STORY",
260
578
  "TIMELINE"
261
579
  ];
262
- function ae({ open: e, onOpenChange: t, story: n }) {
263
- let r = _(), i = h({ pagination: { limit: 100 } }), [o, c] = E(n.title), [l, u] = E(n.summary ?? ""), [d, f] = E(n.body ?? ""), [p, m] = E(n.format), [g, S] = E(n.topicId ?? ""), [C, w] = E(n.languages), [D, O] = E(n.tags), [k, A] = E(n.readingMins ? String(n.readingMins) : ""), [j, M] = E(n.cover?.id ?? null), [N, P] = E(null), F = T(() => `${n.id}:${n.updatedAt}`, [n.id, n.updatedAt]), [I, B] = E(F);
264
- return I !== F && (B(F), c(n.title), u(n.summary ?? ""), f(n.body ?? ""), m(n.format), S(n.topicId ?? ""), w(n.languages), O(n.tags), A(n.readingMins ? String(n.readingMins) : ""), M(n.cover?.id ?? null), P(null)), /* @__PURE__ */ L(U, {
580
+ function Re({ open: e, onOpenChange: t, story: r }) {
581
+ let i = v(), a = g({ pagination: { limit: 100 } }), [o, c] = F(r.title), [l, u] = F(r.summary ?? ""), [d, f] = F(r.body ?? ""), [p, m] = F(r.format), [h, _] = F(r.topicId ?? ""), [y, b] = F(r.languages), [C, T] = F(r.tags), [E, O] = F(r.readingMins ? String(r.readingMins) : ""), [k, A] = F(r.cover?.id ?? null), [j, M] = F(null), N = P(() => `${r.id}:${r.updatedAt}`, [r.id, r.updatedAt]), [I, L] = F(N);
582
+ return I !== N && (L(N), c(r.title), u(r.summary ?? ""), f(r.body ?? ""), m(r.format), _(r.topicId ?? ""), b(r.languages), T(r.tags), O(r.readingMins ? String(r.readingMins) : ""), A(r.cover?.id ?? null), M(null)), /* @__PURE__ */ W(_e, {
265
583
  open: e,
266
584
  onOpenChange: t,
267
- children: /* @__PURE__ */ R(W, {
585
+ children: /* @__PURE__ */ G(ve, {
268
586
  className: "sm:max-w-lg",
269
587
  children: [
270
- /* @__PURE__ */ R(q, { children: [/* @__PURE__ */ L(J, { children: "Edit story" }), /* @__PURE__ */ L(G, { children: "Refine the story. The URL slug is fixed once created." })] }),
271
- /* @__PURE__ */ R("div", {
588
+ /* @__PURE__ */ G(xe, { children: [/* @__PURE__ */ W(Se, { children: "Edit story" }), /* @__PURE__ */ W(ye, { children: "Refine the story. The URL slug is fixed once created." })] }),
589
+ /* @__PURE__ */ G("div", {
272
590
  className: "flex max-h-[62vh] flex-col gap-4 overflow-y-auto py-2",
273
591
  children: [
274
- /* @__PURE__ */ R("div", {
592
+ /* @__PURE__ */ G("div", {
275
593
  className: "grid gap-1.5",
276
- children: [/* @__PURE__ */ L(H, { children: "Cover image" }), /* @__PURE__ */ L(b, {
277
- folder: a.covers,
594
+ children: [/* @__PURE__ */ W(Y, { children: "Cover image" }), /* @__PURE__ */ W(D, {
595
+ folder: n.covers,
278
596
  accept: "image/*",
279
597
  label: "Upload cover",
280
- fileId: j,
281
- onUploaded: M,
282
- onCleared: () => M(null)
598
+ fileId: k,
599
+ onUploaded: A,
600
+ onCleared: () => A(null)
283
601
  })]
284
602
  }),
285
- /* @__PURE__ */ R("div", {
603
+ /* @__PURE__ */ G("div", {
286
604
  className: "grid gap-1.5",
287
- children: [/* @__PURE__ */ L(H, {
605
+ children: [/* @__PURE__ */ W(Y, {
288
606
  htmlFor: "edit-title",
289
607
  children: "Title"
290
- }), /* @__PURE__ */ L(V, {
608
+ }), /* @__PURE__ */ W(J, {
291
609
  id: "edit-title",
292
610
  value: o,
293
611
  onChange: (e) => c(e.target.value)
294
612
  })]
295
613
  }),
296
- /* @__PURE__ */ R("div", {
614
+ /* @__PURE__ */ G("div", {
297
615
  className: "grid grid-cols-2 gap-3",
298
- children: [/* @__PURE__ */ R("div", {
616
+ children: [/* @__PURE__ */ G("div", {
299
617
  className: "grid gap-1.5",
300
- children: [/* @__PURE__ */ L(H, { children: "Format" }), /* @__PURE__ */ R(Y, {
618
+ children: [/* @__PURE__ */ W(Y, { children: "Format" }), /* @__PURE__ */ G(X, {
301
619
  value: p,
302
620
  onValueChange: (e) => m(e),
303
- children: [/* @__PURE__ */ L(Q, { children: /* @__PURE__ */ L($, {}) }), /* @__PURE__ */ L(X, { children: ie.map((e) => /* @__PURE__ */ L(Z, {
621
+ children: [/* @__PURE__ */ W($, { children: /* @__PURE__ */ W(we, {}) }), /* @__PURE__ */ W(Z, { children: Le.map((e) => /* @__PURE__ */ W(Q, {
304
622
  value: e,
305
623
  children: s(e)
306
624
  }, e)) })]
307
625
  })]
308
- }), /* @__PURE__ */ R("div", {
626
+ }), /* @__PURE__ */ G("div", {
309
627
  className: "grid gap-1.5",
310
- children: [/* @__PURE__ */ L(H, {
628
+ children: [/* @__PURE__ */ W(Y, {
311
629
  htmlFor: "edit-reading",
312
630
  children: "Reading time (min)"
313
- }), /* @__PURE__ */ L(V, {
631
+ }), /* @__PURE__ */ W(J, {
314
632
  id: "edit-reading",
315
633
  type: "number",
316
634
  min: 0,
317
- value: k,
318
- onChange: (e) => A(e.target.value)
635
+ value: E,
636
+ onChange: (e) => O(e.target.value)
319
637
  })]
320
638
  })]
321
639
  }),
322
- /* @__PURE__ */ R("div", {
640
+ /* @__PURE__ */ G("div", {
323
641
  className: "grid gap-1.5",
324
- children: [/* @__PURE__ */ L(H, { children: "Topic" }), /* @__PURE__ */ R(Y, {
325
- value: g,
326
- onValueChange: S,
327
- children: [/* @__PURE__ */ L(Q, { children: /* @__PURE__ */ L($, { placeholder: "Choose a topic (optional)" }) }), /* @__PURE__ */ L(X, { children: (i.data?.items ?? []).map((e) => /* @__PURE__ */ L(Z, {
642
+ children: [/* @__PURE__ */ W(Y, { children: "Topic" }), /* @__PURE__ */ G(X, {
643
+ value: h,
644
+ onValueChange: _,
645
+ children: [/* @__PURE__ */ W($, { children: /* @__PURE__ */ W(we, { placeholder: "Choose a topic (optional)" }) }), /* @__PURE__ */ W(Z, { children: (a.data?.items ?? []).map((e) => /* @__PURE__ */ W(Q, {
328
646
  value: e.id,
329
647
  children: e.name
330
648
  }, e.id)) })]
331
649
  })]
332
650
  }),
333
- /* @__PURE__ */ R("div", {
651
+ /* @__PURE__ */ G("div", {
334
652
  className: "grid gap-1.5",
335
- children: [/* @__PURE__ */ L(H, {
653
+ children: [/* @__PURE__ */ W(Y, {
336
654
  htmlFor: "edit-summary",
337
655
  children: "Summary"
338
- }), /* @__PURE__ */ L(ee, {
656
+ }), /* @__PURE__ */ W(Te, {
339
657
  id: "edit-summary",
340
658
  value: l,
341
659
  onChange: (e) => u(e.target.value),
342
660
  rows: 2
343
661
  })]
344
662
  }),
345
- /* @__PURE__ */ R("div", {
663
+ /* @__PURE__ */ G("div", {
346
664
  className: "grid gap-1.5",
347
- children: [/* @__PURE__ */ L(H, {
665
+ children: [/* @__PURE__ */ W(Y, {
348
666
  htmlFor: "edit-body",
349
667
  children: "Body"
350
- }), /* @__PURE__ */ L(ee, {
668
+ }), /* @__PURE__ */ W(Te, {
351
669
  id: "edit-body",
352
670
  value: d,
353
671
  onChange: (e) => f(e.target.value),
354
672
  rows: 6
355
673
  })]
356
674
  }),
357
- /* @__PURE__ */ R("div", {
675
+ /* @__PURE__ */ G("div", {
358
676
  className: "grid gap-1.5",
359
- children: [/* @__PURE__ */ L(H, {
677
+ children: [/* @__PURE__ */ W(Y, {
360
678
  htmlFor: "edit-langs",
361
679
  children: "Languages"
362
- }), /* @__PURE__ */ L(x, {
680
+ }), /* @__PURE__ */ W(w, {
363
681
  id: "edit-langs",
364
- value: C,
365
- onChange: w,
682
+ value: y,
683
+ onChange: b,
366
684
  preserveCase: !0
367
685
  })]
368
686
  }),
369
- /* @__PURE__ */ R("div", {
687
+ /* @__PURE__ */ G("div", {
370
688
  className: "grid gap-1.5",
371
- children: [/* @__PURE__ */ L(H, {
689
+ children: [/* @__PURE__ */ W(Y, {
372
690
  htmlFor: "edit-tags",
373
691
  children: "Tags"
374
- }), /* @__PURE__ */ L(x, {
692
+ }), /* @__PURE__ */ W(w, {
375
693
  id: "edit-tags",
376
- value: D,
377
- onChange: O
694
+ value: C,
695
+ onChange: T
378
696
  })]
379
697
  }),
380
- N && /* @__PURE__ */ L("p", {
698
+ j && /* @__PURE__ */ W("p", {
381
699
  className: "text-sm text-status-error-text",
382
- children: N
700
+ children: j
383
701
  })
384
702
  ]
385
703
  }),
386
- /* @__PURE__ */ R(K, { children: [/* @__PURE__ */ L(z, {
704
+ /* @__PURE__ */ G(be, { children: [/* @__PURE__ */ W(K, {
387
705
  variant: "outline",
388
706
  onClick: () => t(!1),
389
707
  children: "Cancel"
390
- }), /* @__PURE__ */ L(z, {
708
+ }), /* @__PURE__ */ W(K, {
391
709
  onClick: async () => {
392
710
  if (!o.trim()) {
393
- P("A title is required.");
711
+ M("A title is required.");
394
712
  return;
395
713
  }
396
714
  try {
397
- await r.mutateAsync({
398
- id: n.id,
715
+ await i.mutateAsync({
716
+ id: r.id,
399
717
  input: {
400
718
  title: o.trim(),
401
719
  summary: l.trim() || null,
402
720
  body: d.trim() || null,
403
721
  format: p,
404
- topicId: g || null,
405
- languages: C,
406
- tags: D,
407
- readingMins: k ? Number(k) : null,
408
- coverFileId: j
722
+ topicId: h || null,
723
+ languages: y,
724
+ tags: C,
725
+ readingMins: E ? Number(E) : null,
726
+ coverFileId: k
409
727
  }
410
- }), y.success("Story updated", o.trim()), t(!1);
728
+ }), S.success("Story updated", o.trim()), t(!1);
411
729
  } catch (e) {
412
- P(v(e));
730
+ M(x(e));
413
731
  }
414
732
  },
415
- disabled: r.isPending,
733
+ disabled: i.isPending,
416
734
  children: "Save changes"
417
735
  })] })
418
736
  ]
@@ -420,6 +738,6 @@ function ae({ open: e, onOpenChange: t, story: n }) {
420
738
  });
421
739
  }
422
740
  //#endregion
423
- export { re as StoryDetailPage };
741
+ export { ke as StoryDetailPage };
424
742
 
425
743
  //# sourceMappingURL=StoryDetailPage.js.map