@burdenoff/microfe-hookmovies 2026.706.1 → 2026.706.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.
@@ -1,17 +1,21 @@
1
1
  import { useHookMovies as e } from "../../context/HookMoviesContext.js";
2
- import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { StatusBadge as n } from "../../components/StatusBadge.js";
4
- import { useAddCredit as ee, useArchiveTitle as te, useCheckEntitlement as ne, useCreateEpisode as re, useCreateSeason as ie, usePeople as ae, useRecordProgress as oe, useReviews as se, useStudios as ce, useTitle as le, useTransitionTitle as ue, useUpdateTitle as de } from "../../hooks/useHookMoviesApi.js";
5
- import { formatDate as fe, formatEnumLabel as r } from "../../utils/formatters.js";
6
- import { ErrorState as pe, LoadingState as me } from "../../components/StateViews.js";
7
- import { RatingDisplay as he } from "../../components/RatingDisplay.js";
8
- import { useState as i } from "react";
9
- import { Archive as ge, ArrowLeft as _e, Calendar as ve, CheckCircle2 as ye, Clock as be, Globe as xe, Languages as Se, Layers as Ce, Lock as we, Pencil as Te, Play as Ee, Plus as a, ShieldCheck as De, Sparkles as Oe, Star as ke, UserPlus as Ae, Users as je, X as Me } from "lucide-react";
10
- import { useParams as Ne } from "react-router-dom";
11
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
12
- import { GlassCard as l } from "@burdenoff/fe-libs/ui";
2
+ import { cn as t } from "../../utils/cn.js";
3
+ import { PageLayout as n } from "../../components/PageLayout.js";
4
+ import { StatusBadge as r } from "../../components/StatusBadge.js";
5
+ import { useAddCredit as i, useArchiveTitle as a, useCheckEntitlement as o, useClips as s, useCreateClip as c, useCreateEpisode as l, useCreateSeason as u, useDeleteClip as ee, usePeople as te, useRecordProgress as ne, useReviews as re, useStudios as ie, useTitle as ae, useTransitionTitle as oe, useUpdateTitle as se } from "../../hooks/useHookMoviesApi.js";
6
+ import { formatDate as ce, formatEnumLabel as d } from "../../utils/formatters.js";
7
+ import { FILE_FOLDERS as f, uploadFileToFiles as le, useFileUrl as p } from "../../hooks/useFiles.js";
8
+ import { ErrorState as ue, LoadingState as de } from "../../components/StateViews.js";
9
+ import { EmptyState as fe } from "../../components/EmptyState.js";
10
+ import { Pagination as pe } from "../../components/Pagination.js";
11
+ import { RatingDisplay as me } from "../../components/RatingDisplay.js";
12
+ import { useRef as he, useState as m } from "react";
13
+ import { Archive as ge, ArrowLeft as _e, Calendar as ve, CheckCircle2 as ye, Clapperboard as h, Clock as be, Film as g, Globe as xe, Image as _, Languages as Se, Layers as Ce, Loader2 as v, Lock as we, Pencil as Te, Play as Ee, Plus as y, ShieldCheck as De, Sparkles as Oe, Star as ke, Trash2 as b, Upload as x, UserPlus as Ae, Users as je, Video as Me, X as Ne } from "lucide-react";
14
+ import { useParams as Pe } from "react-router-dom";
15
+ import { Fragment as Fe, jsx as S, jsxs as C } from "react/jsx-runtime";
16
+ import { GlassCard as w } from "@burdenoff/fe-libs/ui";
13
17
  //#region src/hookmovies/pages/catalog/TitleDetailPage.tsx
14
- var u = {
18
+ var Ie = {
15
19
  DRAFT: ["IN_REVIEW"],
16
20
  IN_REVIEW: [
17
21
  "SCHEDULED",
@@ -22,7 +26,7 @@ var u = {
22
26
  PUBLISHED: ["UNPUBLISHED"],
23
27
  UNPUBLISHED: ["PUBLISHED"],
24
28
  ARCHIVED: []
25
- }, Pe = [
29
+ }, Le = [
26
30
  "MOVIE",
27
31
  "SERIES",
28
32
  "SHORT_FILM",
@@ -34,7 +38,7 @@ var u = {
34
38
  "TRAILER",
35
39
  "COLLECTION",
36
40
  "FAST_CHANNEL"
37
- ], Fe = [
41
+ ], Re = [
38
42
  "ACTOR",
39
43
  "DIRECTOR",
40
44
  "WRITER",
@@ -44,384 +48,624 @@ var u = {
44
48
  "COMPOSER",
45
49
  "VOICE_ACTOR",
46
50
  "CREW"
47
- ], d = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", f = "mb-1.5 block text-xs font-medium text-text-secondary", p = (e) => e.split(",").map((e) => e.trim()).filter(Boolean), m = (e) => e.trim() ? new Date(e).toISOString() : void 0, h = () => {
48
- let { id: h } = Ne(), { navigateTo: g } = e(), { data: _, isLoading: Ie, isError: Le, refetch: Re } = le(h), v = ue(), y = te(), ze = se({ titleId: h }, {
51
+ ], T = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", E = "mb-1.5 block text-xs font-medium text-text-secondary", ze = (e) => e.split(",").map((e) => e.trim()).filter(Boolean), Be = (e) => e.trim() ? new Date(e).toISOString() : void 0, Ve = (e) => `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`, He = [
52
+ {
53
+ field: "posterFileId",
54
+ label: "Poster",
55
+ kind: "image",
56
+ folder: f.artwork,
57
+ accept: "image/*",
58
+ icon: _,
59
+ hint: "Vertical key art (2:3)."
60
+ },
61
+ {
62
+ field: "backdropFileId",
63
+ label: "Backdrop",
64
+ kind: "image",
65
+ folder: f.artwork,
66
+ accept: "image/*",
67
+ icon: _,
68
+ hint: "Wide hero art (16:9)."
69
+ },
70
+ {
71
+ field: "trailerFileId",
72
+ label: "Trailer",
73
+ kind: "video",
74
+ folder: f.masters,
75
+ accept: "video/*",
76
+ icon: g,
77
+ hint: "Promo trailer master."
78
+ },
79
+ {
80
+ field: "videoFileId",
81
+ label: "Video master",
82
+ kind: "video",
83
+ folder: f.masters,
84
+ accept: "video/*",
85
+ icon: h,
86
+ hint: "Full-length feature master."
87
+ }
88
+ ], Ue = ({ titleId: e, config: n, currentFileId: r }) => {
89
+ let i = se(), a = p(r), o = he(null), [s, c] = m(!1), [l, u] = m(null), ee = n.icon, te = async (t) => {
90
+ let r = t.target.files?.[0];
91
+ if (t.target.value = "", r) {
92
+ u(null), c(!0);
93
+ try {
94
+ let t = await le(r, n.folder), a = {};
95
+ a[n.field] = t.id, await i.mutateAsync({
96
+ id: e,
97
+ input: a
98
+ });
99
+ } catch (e) {
100
+ u(e instanceof Error ? e.message : "Upload failed");
101
+ } finally {
102
+ c(!1);
103
+ }
104
+ }
105
+ }, ne = async () => {
106
+ u(null), c(!0);
107
+ try {
108
+ let t = { [n.field]: null };
109
+ await i.mutateAsync({
110
+ id: e,
111
+ input: t
112
+ });
113
+ } catch (e) {
114
+ u(e instanceof Error ? e.message : "Could not remove file");
115
+ } finally {
116
+ c(!1);
117
+ }
118
+ };
119
+ return /* @__PURE__ */ C("div", {
120
+ className: "rounded-xl border border-border-seam bg-bg-surface p-4",
121
+ children: [
122
+ /* @__PURE__ */ C("div", {
123
+ className: "mb-3 flex items-center justify-between gap-2",
124
+ children: [/* @__PURE__ */ C("div", {
125
+ className: "flex items-center gap-2",
126
+ children: [/* @__PURE__ */ S(ee, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ S("h3", {
127
+ className: "text-sm font-medium text-text-primary",
128
+ children: n.label
129
+ })]
130
+ }), r && /* @__PURE__ */ S("span", {
131
+ className: "rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text",
132
+ children: "Set"
133
+ })]
134
+ }),
135
+ /* @__PURE__ */ S("div", {
136
+ className: t("relative flex items-center justify-center overflow-hidden rounded-lg border border-border-subtle bg-bg-sunken", n.kind === "image" ? "aspect-[3/4]" : "aspect-video"),
137
+ children: s ? /* @__PURE__ */ C("div", {
138
+ className: "flex flex-col items-center gap-2 text-text-secondary",
139
+ children: [/* @__PURE__ */ S(v, { className: "h-6 w-6 animate-spin" }), /* @__PURE__ */ S("span", {
140
+ className: "text-xs",
141
+ children: "Uploading…"
142
+ })]
143
+ }) : r ? a.isLoading ? /* @__PURE__ */ S(v, { className: "h-6 w-6 animate-spin text-text-secondary" }) : a.data ? n.kind === "image" ? /* @__PURE__ */ S("img", {
144
+ src: a.data,
145
+ alt: `${n.label} artwork`,
146
+ className: "h-full w-full object-cover"
147
+ }) : /* @__PURE__ */ S("video", {
148
+ src: a.data,
149
+ controls: !0,
150
+ preload: "metadata",
151
+ className: "h-full w-full bg-bg-canvas object-contain",
152
+ children: /* @__PURE__ */ S("track", { kind: "captions" })
153
+ }) : /* @__PURE__ */ C("div", {
154
+ className: "flex flex-col items-center gap-1 text-text-secondary",
155
+ children: [/* @__PURE__ */ S(ee, { className: "h-6 w-6" }), /* @__PURE__ */ S("span", {
156
+ className: "text-xs",
157
+ children: "Preview unavailable"
158
+ })]
159
+ }) : /* @__PURE__ */ C("button", {
160
+ type: "button",
161
+ onClick: () => o.current?.click(),
162
+ className: "flex h-full w-full flex-col items-center justify-center gap-2 text-text-secondary transition-colors hover:text-text-primary",
163
+ children: [/* @__PURE__ */ S(x, { className: "h-6 w-6" }), /* @__PURE__ */ C("span", {
164
+ className: "text-xs",
165
+ children: ["Upload ", n.label.toLowerCase()]
166
+ })]
167
+ })
168
+ }),
169
+ /* @__PURE__ */ S("p", {
170
+ className: "mt-2 text-[11px] text-text-secondary",
171
+ children: n.hint
172
+ }),
173
+ l && /* @__PURE__ */ S("p", {
174
+ className: "mt-2 text-xs text-status-error-text",
175
+ children: l
176
+ }),
177
+ /* @__PURE__ */ C("div", {
178
+ className: "mt-3 flex items-center gap-2",
179
+ children: [/* @__PURE__ */ C("button", {
180
+ type: "button",
181
+ disabled: s,
182
+ onClick: () => o.current?.click(),
183
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-2.5 py-1 text-xs font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
184
+ children: [/* @__PURE__ */ S(x, { className: "h-3.5 w-3.5" }), r ? "Replace" : "Upload"]
185
+ }), r && /* @__PURE__ */ C("button", {
186
+ type: "button",
187
+ disabled: s,
188
+ onClick: () => void ne(),
189
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-status-error-border px-2.5 py-1 text-xs font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-50",
190
+ children: [/* @__PURE__ */ S(b, { className: "h-3.5 w-3.5" }), "Remove"]
191
+ })]
192
+ }),
193
+ /* @__PURE__ */ S("input", {
194
+ ref: o,
195
+ type: "file",
196
+ accept: n.accept,
197
+ className: "hidden",
198
+ onChange: (e) => void te(e),
199
+ "aria-label": `Upload ${n.label}`
200
+ })
201
+ ]
202
+ });
203
+ }, We = ({ clip: e, onDelete: t, deleting: n }) => {
204
+ let r = p(e.posterFileId), i = p(e.posterFileId ? void 0 : e.videoFileId);
205
+ return /* @__PURE__ */ C("div", {
206
+ className: "flex flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface",
207
+ children: [/* @__PURE__ */ C("div", {
208
+ className: "relative aspect-[9/16] w-full overflow-hidden bg-bg-sunken",
209
+ children: [e.posterFileId ? r.isLoading ? /* @__PURE__ */ S("div", {
210
+ className: "flex h-full w-full items-center justify-center",
211
+ children: /* @__PURE__ */ S(v, { className: "h-5 w-5 animate-spin text-text-secondary" })
212
+ }) : r.data ? /* @__PURE__ */ S("img", {
213
+ src: r.data,
214
+ alt: e.caption ?? "Clip poster",
215
+ className: "h-full w-full object-cover"
216
+ }) : /* @__PURE__ */ S("div", {
217
+ className: "flex h-full w-full items-center justify-center text-text-secondary",
218
+ children: /* @__PURE__ */ S(g, { className: "h-6 w-6" })
219
+ }) : i.isLoading ? /* @__PURE__ */ S("div", {
220
+ className: "flex h-full w-full items-center justify-center",
221
+ children: /* @__PURE__ */ S(v, { className: "h-5 w-5 animate-spin text-text-secondary" })
222
+ }) : i.data ? /* @__PURE__ */ S("video", {
223
+ src: i.data,
224
+ controls: !0,
225
+ preload: "metadata",
226
+ className: "h-full w-full bg-bg-canvas object-contain",
227
+ children: /* @__PURE__ */ S("track", { kind: "captions" })
228
+ }) : /* @__PURE__ */ S("div", {
229
+ className: "flex h-full w-full items-center justify-center text-text-secondary",
230
+ children: /* @__PURE__ */ S(g, { className: "h-6 w-6" })
231
+ }), e.durationSeconds != null && /* @__PURE__ */ S("span", {
232
+ className: "absolute bottom-2 right-2 rounded bg-bg-canvas/80 px-1.5 py-0.5 text-[10px] font-medium text-text-primary",
233
+ children: Ve(e.durationSeconds)
234
+ })]
235
+ }), /* @__PURE__ */ C("div", {
236
+ className: "flex flex-1 flex-col gap-2 p-3",
237
+ children: [
238
+ /* @__PURE__ */ S("p", {
239
+ className: "line-clamp-2 text-sm text-text-primary",
240
+ children: e.caption ?? "Untitled clip"
241
+ }),
242
+ e.language && /* @__PURE__ */ S("span", {
243
+ className: "w-fit rounded-full bg-bg-sunken px-2 py-0.5 text-[10px] uppercase tracking-wide text-text-secondary",
244
+ children: e.language
245
+ }),
246
+ /* @__PURE__ */ C("button", {
247
+ type: "button",
248
+ disabled: n,
249
+ onClick: () => t(e),
250
+ className: "mt-auto inline-flex items-center justify-center gap-1.5 rounded-lg border border-status-error-border px-2.5 py-1 text-xs font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-50",
251
+ children: [/* @__PURE__ */ S(b, { className: "h-3.5 w-3.5" }), n ? "Deleting…" : "Delete"]
252
+ })
253
+ ]
254
+ })]
255
+ });
256
+ }, Ge = 12, Ke = () => {
257
+ let { id: t } = Pe(), { navigateTo: p } = e(), { data: h, isLoading: g, isError: v, refetch: b } = ae(t), Ve = oe(), Ke = a(), qe = re({ titleId: t }, {
49
258
  limit: 10,
50
259
  offset: 0
51
- }), b = de(), x = ee(), S = ie(), C = re(), w = oe(), T = ne(h), Be = ce({
260
+ }), D = se(), O = i(), k = u(), A = l(), j = ne(), M = o(t), Je = ie({
52
261
  limit: 200,
53
262
  offset: 0
54
- }), [E, D] = i(null), [O, k] = i("none"), [A, j] = i(""), [M, N] = i("MOVIE"), [P, F] = i(""), [I, L] = i(""), [R, z] = i(""), [B, V] = i(""), [Ve, He] = i(""), [H, Ue] = i(""), [U, We] = i(""), [Ge, Ke] = i(""), [qe, Je] = i(""), [Ye, Xe] = i(!1), [Ze, Qe] = i(""), [W, $e] = i(""), [et, tt] = i("ACTOR"), [nt, rt] = i(""), [G, it] = i(""), at = ae({
263
+ }), [Ye, Xe] = m(0), N = s(t, void 0, {
264
+ limit: Ge,
265
+ offset: Ye * Ge
266
+ }), Ze = c(), Qe = ee(), [$e, P] = m(null), [et, F] = m(!1), [I, tt] = m(null), [nt, rt] = m(""), [L, it] = m(""), [at, ot] = m(""), [st, ct] = m(!1), [lt, R] = m(null), [ut, dt] = m(null), z = he(null), [B, V] = m("none"), [H, ft] = m(""), [pt, mt] = m("MOVIE"), [ht, gt] = m(""), [_t, vt] = m(""), [yt, bt] = m(""), [xt, St] = m(""), [Ct, wt] = m(""), [U, Tt] = m(""), [W, Et] = m(""), [Dt, Ot] = m(""), [kt, At] = m(""), [jt, Mt] = m(!1), [Nt, Pt] = m(""), [G, Ft] = m(""), [It, Lt] = m("ACTOR"), [Rt, zt] = m(""), [K, Bt] = m(""), Vt = te({
55
267
  limit: 50,
56
268
  offset: 0
57
- }, Ze), [K, ot] = i(""), [st, ct] = i(""), [lt, ut] = i(""), [dt, ft] = i(""), [pt, mt] = i(""), [q, ht] = i(""), [J, gt] = i(""), [_t, vt] = i(""), [Y, yt] = i(""), [bt, xt] = i(""), [St, Ct] = i(!1);
58
- if (Ie) return /* @__PURE__ */ s(t, {
269
+ }, Nt), [q, Ht] = m(""), [Ut, Wt] = m(""), [Gt, Kt] = m(""), [qt, Jt] = m(""), [Yt, Xt] = m(""), [J, Zt] = m(""), [Qt, $t] = m(""), [en, tn] = m(""), [nn, rn] = m(""), [an, on] = m(""), [sn, cn] = m(!1);
270
+ if (g) return /* @__PURE__ */ S(n, {
59
271
  title: "Title",
60
- children: /* @__PURE__ */ s(me, { label: "Loading title…" })
272
+ children: /* @__PURE__ */ S(de, { label: "Loading title…" })
61
273
  });
62
- if (Le || !_) return /* @__PURE__ */ s(t, {
274
+ if (v || !h) return /* @__PURE__ */ S(n, {
63
275
  title: "Title",
64
- children: /* @__PURE__ */ s(pe, {
276
+ children: /* @__PURE__ */ S(ue, {
65
277
  title: "Title not found",
66
278
  message: "This title may have been archived or you may not have access.",
67
- onRetry: () => void Re()
279
+ onRetry: () => void b()
68
280
  })
69
281
  });
70
- let X = _.type === "SERIES", Z = () => k("none"), wt = () => {
71
- D(null), j(_.title), N(_.type), F(_.synopsis ?? ""), L(_.genres.join(", ")), z(_.tags.join(", ")), V(_.originalLanguage ?? ""), He(_.originCountry ?? ""), Ue(_.releaseYear ? String(_.releaseYear) : ""), We(_.runtimeMinutes ? String(_.runtimeMinutes) : ""), Ke(_.certification ?? ""), Je(_.studioId ?? ""), Xe(_.aiDisclosure), k("edit");
72
- }, Tt = async (e) => {
73
- D(null);
282
+ let Y = h.type === "SERIES", X = () => V("none"), ln = () => {
283
+ P(null), ft(h.title), mt(h.type), gt(h.synopsis ?? ""), vt(h.genres.join(", ")), bt(h.tags.join(", ")), St(h.originalLanguage ?? ""), wt(h.originCountry ?? ""), Tt(h.releaseYear ? String(h.releaseYear) : ""), Et(h.runtimeMinutes ? String(h.runtimeMinutes) : ""), Ot(h.certification ?? ""), At(h.studioId ?? ""), Mt(h.aiDisclosure), V("edit");
284
+ }, un = async (e) => {
285
+ P(null);
74
286
  try {
75
- await v.mutateAsync({
76
- id: _.id,
287
+ await Ve.mutateAsync({
288
+ id: h.id,
77
289
  status: e
78
290
  });
79
291
  } catch (e) {
80
- D(e instanceof Error ? e.message : "Transition failed");
292
+ P(e instanceof Error ? e.message : "Transition failed");
81
293
  }
82
- }, Et = async () => {
83
- D(null);
294
+ }, dn = async () => {
295
+ P(null);
84
296
  try {
85
- await y.mutateAsync(_.id), g("catalog/titles");
297
+ await Ke.mutateAsync(h.id), p("catalog/titles");
86
298
  } catch (e) {
87
- D(e instanceof Error ? e.message : "Archive failed");
299
+ P(e instanceof Error ? e.message : "Archive failed");
88
300
  }
89
- }, Dt = async (e) => {
90
- if (e.preventDefault(), D(null), !A.trim()) {
91
- D("Title is required.");
301
+ }, fn = async (e) => {
302
+ if (e.preventDefault(), P(null), !H.trim()) {
303
+ P("Title is required.");
92
304
  return;
93
305
  }
94
306
  let t = {
95
- title: A.trim(),
96
- type: M,
97
- synopsis: P.trim() || void 0,
98
- genres: p(I),
99
- tags: p(R),
100
- originalLanguage: B.trim() || void 0,
101
- originCountry: Ve.trim() || void 0,
102
- releaseYear: H.trim() ? Number(H) : void 0,
103
- runtimeMinutes: U.trim() ? Number(U) : void 0,
104
- certification: Ge.trim() || void 0,
105
- studioId: qe || void 0,
106
- aiDisclosure: Ye
307
+ title: H.trim(),
308
+ type: pt,
309
+ synopsis: ht.trim() || void 0,
310
+ genres: ze(_t),
311
+ tags: ze(yt),
312
+ originalLanguage: xt.trim() || void 0,
313
+ originCountry: Ct.trim() || void 0,
314
+ releaseYear: U.trim() ? Number(U) : void 0,
315
+ runtimeMinutes: W.trim() ? Number(W) : void 0,
316
+ certification: Dt.trim() || void 0,
317
+ studioId: kt || void 0,
318
+ aiDisclosure: jt
107
319
  };
108
320
  try {
109
- await b.mutateAsync({
110
- id: _.id,
321
+ await D.mutateAsync({
322
+ id: h.id,
111
323
  input: t
112
- }), Z();
324
+ }), X();
113
325
  } catch (e) {
114
- D(e instanceof Error ? e.message : "Failed to update title");
326
+ P(e instanceof Error ? e.message : "Failed to update title");
115
327
  }
116
- }, Ot = async (e) => {
117
- if (e.preventDefault(), D(null), !W) {
118
- D("Select a person to credit.");
328
+ }, pn = async (e) => {
329
+ if (e.preventDefault(), P(null), !G) {
330
+ P("Select a person to credit.");
119
331
  return;
120
332
  }
121
333
  try {
122
- await x.mutateAsync({
123
- personId: W,
124
- titleId: _.id,
125
- role: et,
126
- characterName: nt.trim() || void 0,
127
- billingOrder: G.trim() ? Number(G) : void 0
128
- }), $e(""), rt(""), it(""), Qe(""), Z();
334
+ await O.mutateAsync({
335
+ personId: G,
336
+ titleId: h.id,
337
+ role: It,
338
+ characterName: Rt.trim() || void 0,
339
+ billingOrder: K.trim() ? Number(K) : void 0
340
+ }), Ft(""), zt(""), Bt(""), Pt(""), X();
129
341
  } catch (e) {
130
- D(e instanceof Error ? e.message : "Failed to add credit");
342
+ P(e instanceof Error ? e.message : "Failed to add credit");
131
343
  }
132
- }, kt = async (e) => {
133
- if (e.preventDefault(), D(null), !K.trim()) {
134
- D("Season number is required.");
344
+ }, mn = async (e) => {
345
+ if (e.preventDefault(), P(null), !q.trim()) {
346
+ P("Season number is required.");
135
347
  return;
136
348
  }
137
349
  try {
138
- await S.mutateAsync({
139
- titleId: _.id,
140
- number: Number(K),
141
- name: st.trim() || void 0,
142
- synopsis: lt.trim() || void 0,
143
- airDate: m(dt)
144
- }), ot(""), ct(""), ut(""), ft(""), Z();
350
+ await k.mutateAsync({
351
+ titleId: h.id,
352
+ number: Number(q),
353
+ name: Ut.trim() || void 0,
354
+ synopsis: Gt.trim() || void 0,
355
+ airDate: Be(qt)
356
+ }), Ht(""), Wt(""), Kt(""), Jt(""), X();
145
357
  } catch (e) {
146
- D(e instanceof Error ? e.message : "Failed to add season");
358
+ P(e instanceof Error ? e.message : "Failed to add season");
147
359
  }
148
- }, At = async (e) => {
149
- if (e.preventDefault(), D(null), !q.trim()) {
150
- D("Episode number is required.");
360
+ }, hn = async (e) => {
361
+ if (e.preventDefault(), P(null), !J.trim()) {
362
+ P("Episode number is required.");
151
363
  return;
152
364
  }
153
- if (!J.trim()) {
154
- D("Episode name is required.");
365
+ if (!Qt.trim()) {
366
+ P("Episode name is required.");
155
367
  return;
156
368
  }
157
369
  try {
158
- await C.mutateAsync({
159
- titleId: _.id,
160
- number: Number(q),
161
- name: J.trim(),
162
- seasonId: pt || void 0,
163
- synopsis: _t.trim() || void 0,
164
- runtimeMinutes: Y.trim() ? Number(Y) : void 0,
165
- airDate: m(bt)
166
- }), mt(""), ht(""), gt(""), vt(""), yt(""), xt(""), Z();
370
+ await A.mutateAsync({
371
+ titleId: h.id,
372
+ number: Number(J),
373
+ name: Qt.trim(),
374
+ seasonId: Yt || void 0,
375
+ synopsis: en.trim() || void 0,
376
+ runtimeMinutes: nn.trim() ? Number(nn) : void 0,
377
+ airDate: Be(an)
378
+ }), Xt(""), Zt(""), $t(""), tn(""), rn(""), on(""), X();
167
379
  } catch (e) {
168
- D(e instanceof Error ? e.message : "Failed to add episode");
380
+ P(e instanceof Error ? e.message : "Failed to add episode");
169
381
  }
170
- }, jt = async () => {
171
- if (D(null), Ct(!1), !T.data?.entitled) {
172
- D("You are not entitled to watch this title.");
382
+ }, gn = async () => {
383
+ if (P(null), cn(!1), !M.data?.entitled) {
384
+ P("You are not entitled to watch this title.");
173
385
  return;
174
386
  }
175
387
  try {
176
- await w.mutateAsync({
177
- titleId: _.id,
178
- positionSeconds: (_.runtimeMinutes ?? 0) * 60,
388
+ await j.mutateAsync({
389
+ titleId: h.id,
390
+ positionSeconds: (h.runtimeMinutes ?? 0) * 60,
179
391
  completed: !0,
180
392
  lastDevice: "web"
181
- }), Ct(!0);
393
+ }), cn(!0);
394
+ } catch (e) {
395
+ P(e instanceof Error ? e.message : "Failed to record progress");
396
+ }
397
+ }, _n = async (e) => {
398
+ if (e.preventDefault(), R(null), !I) {
399
+ R("Select a clip video to upload.");
400
+ return;
401
+ }
402
+ ct(!0);
403
+ try {
404
+ let e = await le(I, f.clips);
405
+ await Ze.mutateAsync({
406
+ titleId: h.id,
407
+ videoFileId: e.id,
408
+ caption: nt.trim() || void 0,
409
+ durationSeconds: L.trim() ? Number(L) : void 0,
410
+ language: at.trim() || void 0
411
+ }), tt(null), rt(""), it(""), ot(""), z.current && (z.current.value = ""), F(!1), Xe(0);
412
+ } catch (e) {
413
+ R(e instanceof Error ? e.message : "Failed to add clip");
414
+ } finally {
415
+ ct(!1);
416
+ }
417
+ }, vn = async (e) => {
418
+ P(null), dt(e.id);
419
+ try {
420
+ await Qe.mutateAsync({
421
+ id: e.id,
422
+ titleId: h.id
423
+ });
182
424
  } catch (e) {
183
- D(e instanceof Error ? e.message : "Failed to record progress");
425
+ P(e instanceof Error ? e.message : "Failed to delete clip");
426
+ } finally {
427
+ dt(null);
184
428
  }
185
- }, Q = ze.data?.items ?? [], Mt = Q.length > 0 ? Q.reduce((e, t) => e + t.score, 0) / Q.length : null, $ = [];
186
- _.releaseDate ? $.push({
429
+ }, Z = qe.data?.items ?? [], Q = N.data?.items ?? [], yn = Z.length > 0 ? Z.reduce((e, t) => e + t.score, 0) / Z.length : null, $ = [];
430
+ h.releaseDate ? $.push({
187
431
  icon: ve,
188
432
  label: "Release",
189
- value: fe(_.releaseDate)
190
- }) : _.releaseYear && $.push({
433
+ value: ce(h.releaseDate)
434
+ }) : h.releaseYear && $.push({
191
435
  icon: ve,
192
436
  label: "Year",
193
- value: String(_.releaseYear)
194
- }), _.runtimeMinutes && $.push({
437
+ value: String(h.releaseYear)
438
+ }), h.runtimeMinutes && $.push({
195
439
  icon: be,
196
440
  label: "Runtime",
197
- value: `${_.runtimeMinutes} min`
198
- }), _.originalLanguage && $.push({
441
+ value: `${h.runtimeMinutes} min`
442
+ }), h.originalLanguage && $.push({
199
443
  icon: Se,
200
444
  label: "Language",
201
- value: _.originalLanguage
202
- }), _.originCountry && $.push({
445
+ value: h.originalLanguage
446
+ }), h.originCountry && $.push({
203
447
  icon: xe,
204
448
  label: "Country",
205
- value: _.originCountry
206
- }), _.certification && $.push({
449
+ value: h.originCountry
450
+ }), h.certification && $.push({
207
451
  icon: De,
208
452
  label: "Certification",
209
- value: _.certification
453
+ value: h.certification
210
454
  });
211
- let Nt = at.data?.items ?? [];
212
- return /* @__PURE__ */ c(t, {
213
- title: /* @__PURE__ */ c("span", {
455
+ let bn = Vt.data?.items ?? [];
456
+ return /* @__PURE__ */ C(n, {
457
+ title: /* @__PURE__ */ C("span", {
214
458
  className: "flex items-center gap-3",
215
- children: [/* @__PURE__ */ s("button", {
459
+ children: [/* @__PURE__ */ S("button", {
216
460
  type: "button",
217
- onClick: () => g("catalog/titles"),
461
+ onClick: () => p("catalog/titles"),
218
462
  className: "rounded-md p-1 text-text-secondary hover:text-text-primary",
219
463
  "aria-label": "Back to catalog",
220
- children: /* @__PURE__ */ s(_e, { className: "h-5 w-5" })
221
- }), _.title]
464
+ children: /* @__PURE__ */ S(_e, { className: "h-5 w-5" })
465
+ }), h.title]
222
466
  }),
223
- description: `${r(_.type)}${_.studio ? ` · ${_.studio.name}` : ""}`,
224
- actions: /* @__PURE__ */ c("div", {
467
+ description: `${d(h.type)}${h.studio ? ` · ${h.studio.name}` : ""}`,
468
+ actions: /* @__PURE__ */ C("div", {
225
469
  className: "flex items-center gap-2",
226
- children: [/* @__PURE__ */ c("button", {
470
+ children: [/* @__PURE__ */ C("button", {
227
471
  type: "button",
228
- onClick: wt,
472
+ onClick: ln,
229
473
  className: "inline-flex items-center gap-2 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
230
- children: [/* @__PURE__ */ s(Te, { className: "h-3.5 w-3.5" }), "Edit"]
231
- }), /* @__PURE__ */ s(n, { status: _.status })]
474
+ children: [/* @__PURE__ */ S(Te, { className: "h-3.5 w-3.5" }), "Edit"]
475
+ }), /* @__PURE__ */ S(r, { status: h.status })]
232
476
  }),
233
477
  children: [
234
- E && /* @__PURE__ */ s("div", {
478
+ $e && /* @__PURE__ */ S("div", {
235
479
  className: "mb-4 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
236
- children: E
480
+ children: $e
237
481
  }),
238
- O === "edit" && /* @__PURE__ */ c(l, {
482
+ B === "edit" && /* @__PURE__ */ C(w, {
239
483
  treatment: "metric",
240
484
  className: "mb-6 border-border-seam p-5",
241
- children: [/* @__PURE__ */ c("div", {
485
+ children: [/* @__PURE__ */ C("div", {
242
486
  className: "mb-4 flex items-center justify-between",
243
- children: [/* @__PURE__ */ s("h2", {
487
+ children: [/* @__PURE__ */ S("h2", {
244
488
  className: "text-sm font-semibold text-text-primary",
245
489
  children: "Edit title"
246
- }), /* @__PURE__ */ s("button", {
490
+ }), /* @__PURE__ */ S("button", {
247
491
  type: "button",
248
- onClick: Z,
492
+ onClick: X,
249
493
  className: "rounded-md p-1 text-text-secondary hover:text-text-primary",
250
494
  "aria-label": "Close edit form",
251
- children: /* @__PURE__ */ s(Me, { className: "h-4 w-4" })
495
+ children: /* @__PURE__ */ S(Ne, { className: "h-4 w-4" })
252
496
  })]
253
- }), /* @__PURE__ */ c("form", {
254
- onSubmit: Dt,
497
+ }), /* @__PURE__ */ C("form", {
498
+ onSubmit: fn,
255
499
  className: "space-y-5",
256
500
  children: [
257
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
501
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
258
502
  htmlFor: "edit-title",
259
- className: f,
503
+ className: E,
260
504
  children: "Title *"
261
- }), /* @__PURE__ */ s("input", {
505
+ }), /* @__PURE__ */ S("input", {
262
506
  id: "edit-title",
263
507
  type: "text",
264
- value: A,
265
- onChange: (e) => j(e.target.value),
266
- className: d,
508
+ value: H,
509
+ onChange: (e) => ft(e.target.value),
510
+ className: T,
267
511
  required: !0
268
512
  })] }),
269
- /* @__PURE__ */ c("div", {
513
+ /* @__PURE__ */ C("div", {
270
514
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
271
- children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
515
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
272
516
  htmlFor: "edit-type",
273
- className: f,
517
+ className: E,
274
518
  children: "Type"
275
- }), /* @__PURE__ */ s("select", {
519
+ }), /* @__PURE__ */ S("select", {
276
520
  id: "edit-type",
277
- value: M,
278
- onChange: (e) => N(e.target.value),
279
- className: d,
280
- children: Pe.map((e) => /* @__PURE__ */ s("option", {
521
+ value: pt,
522
+ onChange: (e) => mt(e.target.value),
523
+ className: T,
524
+ children: Le.map((e) => /* @__PURE__ */ S("option", {
281
525
  value: e,
282
- children: r(e)
526
+ children: d(e)
283
527
  }, e))
284
- })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
528
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
285
529
  htmlFor: "edit-studio",
286
- className: f,
530
+ className: E,
287
531
  children: "Studio"
288
- }), /* @__PURE__ */ c("select", {
532
+ }), /* @__PURE__ */ C("select", {
289
533
  id: "edit-studio",
290
- value: qe,
291
- onChange: (e) => Je(e.target.value),
292
- className: d,
293
- children: [/* @__PURE__ */ s("option", {
534
+ value: kt,
535
+ onChange: (e) => At(e.target.value),
536
+ className: T,
537
+ children: [/* @__PURE__ */ S("option", {
294
538
  value: "",
295
539
  children: "No studio"
296
- }), (Be.data?.items ?? []).map((e) => /* @__PURE__ */ s("option", {
540
+ }), (Je.data?.items ?? []).map((e) => /* @__PURE__ */ S("option", {
297
541
  value: e.id,
298
542
  children: e.name
299
543
  }, e.id))]
300
544
  })] })]
301
545
  }),
302
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
546
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
303
547
  htmlFor: "edit-synopsis",
304
- className: f,
548
+ className: E,
305
549
  children: "Synopsis"
306
- }), /* @__PURE__ */ s("textarea", {
550
+ }), /* @__PURE__ */ S("textarea", {
307
551
  id: "edit-synopsis",
308
- value: P,
309
- onChange: (e) => F(e.target.value),
552
+ value: ht,
553
+ onChange: (e) => gt(e.target.value),
310
554
  rows: 4,
311
- className: d
555
+ className: T
312
556
  })] }),
313
- /* @__PURE__ */ c("div", {
557
+ /* @__PURE__ */ C("div", {
314
558
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
315
- children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
559
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
316
560
  htmlFor: "edit-genres",
317
- className: f,
561
+ className: E,
318
562
  children: "Genres (comma-separated)"
319
- }), /* @__PURE__ */ s("input", {
563
+ }), /* @__PURE__ */ S("input", {
320
564
  id: "edit-genres",
321
565
  type: "text",
322
- value: I,
323
- onChange: (e) => L(e.target.value),
566
+ value: _t,
567
+ onChange: (e) => vt(e.target.value),
324
568
  placeholder: "Drama, Thriller",
325
- className: d
326
- })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
569
+ className: T
570
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
327
571
  htmlFor: "edit-tags",
328
- className: f,
572
+ className: E,
329
573
  children: "Tags (comma-separated)"
330
- }), /* @__PURE__ */ s("input", {
574
+ }), /* @__PURE__ */ S("input", {
331
575
  id: "edit-tags",
332
576
  type: "text",
333
- value: R,
334
- onChange: (e) => z(e.target.value),
577
+ value: yt,
578
+ onChange: (e) => bt(e.target.value),
335
579
  placeholder: "award-winner, indie",
336
- className: d
580
+ className: T
337
581
  })] })]
338
582
  }),
339
- /* @__PURE__ */ c("div", {
583
+ /* @__PURE__ */ C("div", {
340
584
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
341
585
  children: [
342
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
586
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
343
587
  htmlFor: "edit-language",
344
- className: f,
588
+ className: E,
345
589
  children: "Original Language"
346
- }), /* @__PURE__ */ s("input", {
590
+ }), /* @__PURE__ */ S("input", {
347
591
  id: "edit-language",
348
592
  type: "text",
349
- value: B,
350
- onChange: (e) => V(e.target.value),
593
+ value: xt,
594
+ onChange: (e) => St(e.target.value),
351
595
  placeholder: "en",
352
- className: d
596
+ className: T
353
597
  })] }),
354
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
598
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
355
599
  htmlFor: "edit-country",
356
- className: f,
600
+ className: E,
357
601
  children: "Origin Country"
358
- }), /* @__PURE__ */ s("input", {
602
+ }), /* @__PURE__ */ S("input", {
359
603
  id: "edit-country",
360
604
  type: "text",
361
- value: Ve,
362
- onChange: (e) => He(e.target.value),
605
+ value: Ct,
606
+ onChange: (e) => wt(e.target.value),
363
607
  placeholder: "US",
364
- className: d
608
+ className: T
365
609
  })] }),
366
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
610
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
367
611
  htmlFor: "edit-certification",
368
- className: f,
612
+ className: E,
369
613
  children: "Certification"
370
- }), /* @__PURE__ */ s("input", {
614
+ }), /* @__PURE__ */ S("input", {
371
615
  id: "edit-certification",
372
616
  type: "text",
373
- value: Ge,
374
- onChange: (e) => Ke(e.target.value),
617
+ value: Dt,
618
+ onChange: (e) => Ot(e.target.value),
375
619
  placeholder: "PG-13",
376
- className: d
620
+ className: T
377
621
  })] })
378
622
  ]
379
623
  }),
380
- /* @__PURE__ */ c("div", {
624
+ /* @__PURE__ */ C("div", {
381
625
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
382
- children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
626
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
383
627
  htmlFor: "edit-year",
384
- className: f,
628
+ className: E,
385
629
  children: "Release Year"
386
- }), /* @__PURE__ */ s("input", {
630
+ }), /* @__PURE__ */ S("input", {
387
631
  id: "edit-year",
388
632
  type: "number",
389
- value: H,
390
- onChange: (e) => Ue(e.target.value),
633
+ value: U,
634
+ onChange: (e) => Tt(e.target.value),
391
635
  placeholder: "2026",
392
- className: d
393
- })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
636
+ className: T
637
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
394
638
  htmlFor: "edit-runtime",
395
- className: f,
639
+ className: E,
396
640
  children: "Runtime (minutes)"
397
- }), /* @__PURE__ */ s("input", {
641
+ }), /* @__PURE__ */ S("input", {
398
642
  id: "edit-runtime",
399
643
  type: "number",
400
- value: U,
401
- onChange: (e) => We(e.target.value),
644
+ value: W,
645
+ onChange: (e) => Et(e.target.value),
402
646
  placeholder: "120",
403
- className: d
647
+ className: T
404
648
  })] })]
405
649
  }),
406
- /* @__PURE__ */ c("label", {
650
+ /* @__PURE__ */ C("label", {
407
651
  className: "flex items-center gap-2 text-sm text-text-primary",
408
- children: [/* @__PURE__ */ s("input", {
652
+ children: [/* @__PURE__ */ S("input", {
409
653
  type: "checkbox",
410
- checked: Ye,
411
- onChange: (e) => Xe(e.target.checked),
654
+ checked: jt,
655
+ onChange: (e) => Mt(e.target.checked),
412
656
  className: "h-4 w-4 rounded border-border-subtle"
413
657
  }), "This title contains AI-generated or AI-altered content"]
414
658
  }),
415
- /* @__PURE__ */ c("div", {
659
+ /* @__PURE__ */ C("div", {
416
660
  className: "flex items-center gap-3 pt-1",
417
- children: [/* @__PURE__ */ s("button", {
661
+ children: [/* @__PURE__ */ S("button", {
418
662
  type: "submit",
419
- disabled: b.isPending,
663
+ disabled: D.isPending,
420
664
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50 transition-opacity",
421
- children: b.isPending ? "Saving…" : "Save changes"
422
- }), /* @__PURE__ */ s("button", {
665
+ children: D.isPending ? "Saving…" : "Save changes"
666
+ }), /* @__PURE__ */ S("button", {
423
667
  type: "button",
424
- onClick: Z,
668
+ onClick: X,
425
669
  className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
426
670
  children: "Cancel"
427
671
  })]
@@ -429,385 +673,406 @@ var u = {
429
673
  ]
430
674
  })]
431
675
  }),
432
- /* @__PURE__ */ c("div", {
676
+ /* @__PURE__ */ C("div", {
433
677
  className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
434
- children: [/* @__PURE__ */ c("div", {
678
+ children: [/* @__PURE__ */ C("div", {
435
679
  className: "space-y-6 lg:col-span-2",
436
680
  children: [
437
- _.synopsis && /* @__PURE__ */ c(l, {
681
+ /* @__PURE__ */ C(w, {
682
+ treatment: "metric",
683
+ className: "border-border-seam p-5",
684
+ children: [/* @__PURE__ */ C("div", {
685
+ className: "mb-4",
686
+ children: [/* @__PURE__ */ C("h2", {
687
+ className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
688
+ children: [/* @__PURE__ */ S(_, { className: "h-4 w-4" }), "Artwork & Media"]
689
+ }), /* @__PURE__ */ S("p", {
690
+ className: "mt-1 text-xs text-text-secondary",
691
+ children: "Poster and backdrop art, plus the trailer and full-length video master. Files are stored in the workspace files service; the title keeps only a reference."
692
+ })]
693
+ }), /* @__PURE__ */ S("div", {
694
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
695
+ children: He.map((e) => /* @__PURE__ */ S(Ue, {
696
+ titleId: h.id,
697
+ config: e,
698
+ currentFileId: h[e.field]
699
+ }, e.field))
700
+ })]
701
+ }),
702
+ h.synopsis && /* @__PURE__ */ C(w, {
438
703
  treatment: "metric",
439
704
  className: "border-border-seam p-5",
440
- children: [/* @__PURE__ */ s("h2", {
705
+ children: [/* @__PURE__ */ S("h2", {
441
706
  className: "mb-2 text-sm font-semibold text-text-primary",
442
707
  children: "Synopsis"
443
- }), /* @__PURE__ */ s("p", {
708
+ }), /* @__PURE__ */ S("p", {
444
709
  className: "text-sm leading-relaxed text-text-secondary",
445
- children: _.synopsis
710
+ children: h.synopsis
446
711
  })]
447
712
  }),
448
- /* @__PURE__ */ c(l, {
713
+ /* @__PURE__ */ C(w, {
449
714
  treatment: "metric",
450
715
  className: "border-border-seam p-5",
451
716
  children: [
452
- /* @__PURE__ */ c("div", {
717
+ /* @__PURE__ */ C("div", {
453
718
  className: "mb-3 flex items-center justify-between gap-3",
454
- children: [/* @__PURE__ */ c("h2", {
719
+ children: [/* @__PURE__ */ C("h2", {
455
720
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
456
721
  children: [
457
- /* @__PURE__ */ s(je, { className: "h-4 w-4" }),
722
+ /* @__PURE__ */ S(je, { className: "h-4 w-4" }),
458
723
  "Cast & Crew (",
459
- _.credits.length,
724
+ h.credits.length,
460
725
  ")"
461
726
  ]
462
- }), /* @__PURE__ */ c("button", {
727
+ }), /* @__PURE__ */ C("button", {
463
728
  type: "button",
464
729
  onClick: () => {
465
- D(null), k(O === "credit" ? "none" : "credit");
730
+ P(null), V(B === "credit" ? "none" : "credit");
466
731
  },
467
732
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-2.5 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
468
- children: [/* @__PURE__ */ s(Ae, { className: "h-3.5 w-3.5" }), "Add credit"]
733
+ children: [/* @__PURE__ */ S(Ae, { className: "h-3.5 w-3.5" }), "Add credit"]
469
734
  })]
470
735
  }),
471
- O === "credit" && /* @__PURE__ */ c("form", {
472
- onSubmit: Ot,
736
+ B === "credit" && /* @__PURE__ */ C("form", {
737
+ onSubmit: pn,
473
738
  className: "mb-4 space-y-4 rounded-lg border border-border-seam bg-bg-surface p-4",
474
739
  children: [
475
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
740
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
476
741
  htmlFor: "credit-search",
477
- className: f,
742
+ className: E,
478
743
  children: "Search people"
479
- }), /* @__PURE__ */ s("input", {
744
+ }), /* @__PURE__ */ S("input", {
480
745
  id: "credit-search",
481
746
  type: "text",
482
- value: Ze,
483
- onChange: (e) => Qe(e.target.value),
747
+ value: Nt,
748
+ onChange: (e) => Pt(e.target.value),
484
749
  placeholder: "Type a name to filter…",
485
- className: d
750
+ className: T
486
751
  })] }),
487
- /* @__PURE__ */ c("div", {
752
+ /* @__PURE__ */ C("div", {
488
753
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
489
- children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
754
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
490
755
  htmlFor: "credit-person",
491
- className: f,
756
+ className: E,
492
757
  children: "Person *"
493
- }), /* @__PURE__ */ c("select", {
758
+ }), /* @__PURE__ */ C("select", {
494
759
  id: "credit-person",
495
- value: W,
496
- onChange: (e) => $e(e.target.value),
497
- className: d,
760
+ value: G,
761
+ onChange: (e) => Ft(e.target.value),
762
+ className: T,
498
763
  required: !0,
499
- children: [/* @__PURE__ */ s("option", {
764
+ children: [/* @__PURE__ */ S("option", {
500
765
  value: "",
501
- children: at.isLoading ? "Loading people…" : Nt.length === 0 ? "No people found" : "Select a person"
502
- }), Nt.map((e) => /* @__PURE__ */ c("option", {
766
+ children: Vt.isLoading ? "Loading people…" : bn.length === 0 ? "No people found" : "Select a person"
767
+ }), bn.map((e) => /* @__PURE__ */ C("option", {
503
768
  value: e.id,
504
769
  children: [e.name, e.knownFor ? ` — ${e.knownFor}` : ""]
505
770
  }, e.id))]
506
- })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
771
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
507
772
  htmlFor: "credit-role",
508
- className: f,
773
+ className: E,
509
774
  children: "Role"
510
- }), /* @__PURE__ */ s("select", {
775
+ }), /* @__PURE__ */ S("select", {
511
776
  id: "credit-role",
512
- value: et,
513
- onChange: (e) => tt(e.target.value),
514
- className: d,
515
- children: Fe.map((e) => /* @__PURE__ */ s("option", {
777
+ value: It,
778
+ onChange: (e) => Lt(e.target.value),
779
+ className: T,
780
+ children: Re.map((e) => /* @__PURE__ */ S("option", {
516
781
  value: e,
517
- children: r(e)
782
+ children: d(e)
518
783
  }, e))
519
784
  })] })]
520
785
  }),
521
- /* @__PURE__ */ c("div", {
786
+ /* @__PURE__ */ C("div", {
522
787
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
523
- children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
788
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
524
789
  htmlFor: "credit-character",
525
- className: f,
790
+ className: E,
526
791
  children: "Character name"
527
- }), /* @__PURE__ */ s("input", {
792
+ }), /* @__PURE__ */ S("input", {
528
793
  id: "credit-character",
529
794
  type: "text",
530
- value: nt,
531
- onChange: (e) => rt(e.target.value),
795
+ value: Rt,
796
+ onChange: (e) => zt(e.target.value),
532
797
  placeholder: "e.g. Captain Rao",
533
- className: d
534
- })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
798
+ className: T
799
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
535
800
  htmlFor: "credit-billing",
536
- className: f,
801
+ className: E,
537
802
  children: "Billing order"
538
- }), /* @__PURE__ */ s("input", {
803
+ }), /* @__PURE__ */ S("input", {
539
804
  id: "credit-billing",
540
805
  type: "number",
541
- value: G,
542
- onChange: (e) => it(e.target.value),
806
+ value: K,
807
+ onChange: (e) => Bt(e.target.value),
543
808
  placeholder: "1",
544
- className: d
809
+ className: T
545
810
  })] })]
546
811
  }),
547
- /* @__PURE__ */ c("div", {
812
+ /* @__PURE__ */ C("div", {
548
813
  className: "flex items-center gap-3",
549
- children: [/* @__PURE__ */ c("button", {
814
+ children: [/* @__PURE__ */ C("button", {
550
815
  type: "submit",
551
- disabled: x.isPending,
816
+ disabled: O.isPending,
552
817
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50 transition-opacity",
553
- children: [/* @__PURE__ */ s(a, { className: "h-4 w-4" }), x.isPending ? "Adding…" : "Add credit"]
554
- }), /* @__PURE__ */ s("button", {
818
+ children: [/* @__PURE__ */ S(y, { className: "h-4 w-4" }), O.isPending ? "Adding…" : "Add credit"]
819
+ }), /* @__PURE__ */ S("button", {
555
820
  type: "button",
556
- onClick: Z,
821
+ onClick: X,
557
822
  className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
558
823
  children: "Cancel"
559
824
  })]
560
825
  })
561
826
  ]
562
827
  }),
563
- _.credits.length === 0 ? /* @__PURE__ */ s("p", {
828
+ h.credits.length === 0 ? /* @__PURE__ */ S("p", {
564
829
  className: "text-sm text-text-secondary",
565
830
  children: "No credits recorded yet."
566
- }) : /* @__PURE__ */ s("ul", {
831
+ }) : /* @__PURE__ */ S("ul", {
567
832
  className: "divide-y divide-border-seam",
568
- children: [..._.credits].sort((e, t) => e.billingOrder - t.billingOrder).map((e) => /* @__PURE__ */ c("li", {
833
+ children: [...h.credits].sort((e, t) => e.billingOrder - t.billingOrder).map((e) => /* @__PURE__ */ C("li", {
569
834
  className: "flex items-center justify-between py-2",
570
- children: [/* @__PURE__ */ c("div", {
835
+ children: [/* @__PURE__ */ C("div", {
571
836
  className: "min-w-0",
572
- children: [/* @__PURE__ */ s("p", {
837
+ children: [/* @__PURE__ */ S("p", {
573
838
  className: "truncate text-sm font-medium text-text-primary",
574
839
  children: e.person?.name ?? "Unknown person"
575
- }), e.characterName && /* @__PURE__ */ c("p", {
840
+ }), e.characterName && /* @__PURE__ */ C("p", {
576
841
  className: "text-xs text-text-secondary",
577
842
  children: ["as ", e.characterName]
578
843
  })]
579
- }), /* @__PURE__ */ s("span", {
844
+ }), /* @__PURE__ */ S("span", {
580
845
  className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
581
- children: r(e.role)
846
+ children: d(e.role)
582
847
  })]
583
848
  }, e.id))
584
849
  })
585
850
  ]
586
851
  }),
587
- /* @__PURE__ */ c(l, {
852
+ /* @__PURE__ */ C(w, {
588
853
  treatment: "metric",
589
854
  className: "border-border-seam p-5",
590
855
  children: [
591
- /* @__PURE__ */ c("div", {
856
+ /* @__PURE__ */ C("div", {
592
857
  className: "mb-3 flex flex-wrap items-center justify-between gap-3",
593
- children: [/* @__PURE__ */ c("h2", {
858
+ children: [/* @__PURE__ */ C("h2", {
594
859
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
595
860
  children: [
596
- /* @__PURE__ */ s(Ce, { className: "h-4 w-4" }),
861
+ /* @__PURE__ */ S(Ce, { className: "h-4 w-4" }),
597
862
  "Episodes (",
598
- _.episodes.length,
863
+ h.episodes.length,
599
864
  ")"
600
865
  ]
601
- }), X && /* @__PURE__ */ c("div", {
866
+ }), Y && /* @__PURE__ */ C("div", {
602
867
  className: "flex items-center gap-2",
603
- children: [/* @__PURE__ */ c("button", {
868
+ children: [/* @__PURE__ */ C("button", {
604
869
  type: "button",
605
870
  onClick: () => {
606
- D(null), k(O === "season" ? "none" : "season");
871
+ P(null), V(B === "season" ? "none" : "season");
607
872
  },
608
873
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-2.5 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
609
- children: [/* @__PURE__ */ s(a, { className: "h-3.5 w-3.5" }), "Add season"]
610
- }), /* @__PURE__ */ c("button", {
874
+ children: [/* @__PURE__ */ S(y, { className: "h-3.5 w-3.5" }), "Add season"]
875
+ }), /* @__PURE__ */ C("button", {
611
876
  type: "button",
612
877
  onClick: () => {
613
- D(null), k(O === "episode" ? "none" : "episode");
878
+ P(null), V(B === "episode" ? "none" : "episode");
614
879
  },
615
880
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-2.5 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
616
- children: [/* @__PURE__ */ s(a, { className: "h-3.5 w-3.5" }), "Add episode"]
881
+ children: [/* @__PURE__ */ S(y, { className: "h-3.5 w-3.5" }), "Add episode"]
617
882
  })]
618
883
  })]
619
884
  }),
620
- X && O === "season" && /* @__PURE__ */ c("form", {
621
- onSubmit: kt,
885
+ Y && B === "season" && /* @__PURE__ */ C("form", {
886
+ onSubmit: mn,
622
887
  className: "mb-4 space-y-4 rounded-lg border border-border-seam bg-bg-surface p-4",
623
888
  children: [
624
- /* @__PURE__ */ c("div", {
889
+ /* @__PURE__ */ C("div", {
625
890
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
626
- children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
891
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
627
892
  htmlFor: "season-number",
628
- className: f,
893
+ className: E,
629
894
  children: "Season number *"
630
- }), /* @__PURE__ */ s("input", {
895
+ }), /* @__PURE__ */ S("input", {
631
896
  id: "season-number",
632
897
  type: "number",
633
- value: K,
634
- onChange: (e) => ot(e.target.value),
898
+ value: q,
899
+ onChange: (e) => Ht(e.target.value),
635
900
  placeholder: "1",
636
- className: d,
901
+ className: T,
637
902
  required: !0
638
- })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
903
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
639
904
  htmlFor: "season-name",
640
- className: f,
905
+ className: E,
641
906
  children: "Name"
642
- }), /* @__PURE__ */ s("input", {
907
+ }), /* @__PURE__ */ S("input", {
643
908
  id: "season-name",
644
909
  type: "text",
645
- value: st,
646
- onChange: (e) => ct(e.target.value),
910
+ value: Ut,
911
+ onChange: (e) => Wt(e.target.value),
647
912
  placeholder: "Season 1",
648
- className: d
913
+ className: T
649
914
  })] })]
650
915
  }),
651
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
916
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
652
917
  htmlFor: "season-synopsis",
653
- className: f,
918
+ className: E,
654
919
  children: "Synopsis"
655
- }), /* @__PURE__ */ s("textarea", {
920
+ }), /* @__PURE__ */ S("textarea", {
656
921
  id: "season-synopsis",
657
- value: lt,
658
- onChange: (e) => ut(e.target.value),
922
+ value: Gt,
923
+ onChange: (e) => Kt(e.target.value),
659
924
  rows: 3,
660
- className: d
925
+ className: T
661
926
  })] }),
662
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
927
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
663
928
  htmlFor: "season-airdate",
664
- className: f,
929
+ className: E,
665
930
  children: "Air date"
666
- }), /* @__PURE__ */ s("input", {
931
+ }), /* @__PURE__ */ S("input", {
667
932
  id: "season-airdate",
668
933
  type: "date",
669
- value: dt,
670
- onChange: (e) => ft(e.target.value),
671
- className: d
934
+ value: qt,
935
+ onChange: (e) => Jt(e.target.value),
936
+ className: T
672
937
  })] }),
673
- /* @__PURE__ */ c("div", {
938
+ /* @__PURE__ */ C("div", {
674
939
  className: "flex items-center gap-3",
675
- children: [/* @__PURE__ */ c("button", {
940
+ children: [/* @__PURE__ */ C("button", {
676
941
  type: "submit",
677
- disabled: S.isPending,
942
+ disabled: k.isPending,
678
943
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50 transition-opacity",
679
- children: [/* @__PURE__ */ s(a, { className: "h-4 w-4" }), S.isPending ? "Adding…" : "Add season"]
680
- }), /* @__PURE__ */ s("button", {
944
+ children: [/* @__PURE__ */ S(y, { className: "h-4 w-4" }), k.isPending ? "Adding…" : "Add season"]
945
+ }), /* @__PURE__ */ S("button", {
681
946
  type: "button",
682
- onClick: Z,
947
+ onClick: X,
683
948
  className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
684
949
  children: "Cancel"
685
950
  })]
686
951
  })
687
952
  ]
688
953
  }),
689
- X && O === "episode" && /* @__PURE__ */ c("form", {
690
- onSubmit: At,
954
+ Y && B === "episode" && /* @__PURE__ */ C("form", {
955
+ onSubmit: hn,
691
956
  className: "mb-4 space-y-4 rounded-lg border border-border-seam bg-bg-surface p-4",
692
957
  children: [
693
- /* @__PURE__ */ c("div", {
958
+ /* @__PURE__ */ C("div", {
694
959
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
695
- children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
960
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
696
961
  htmlFor: "episode-season",
697
- className: f,
962
+ className: E,
698
963
  children: "Season"
699
- }), /* @__PURE__ */ c("select", {
964
+ }), /* @__PURE__ */ C("select", {
700
965
  id: "episode-season",
701
- value: pt,
702
- onChange: (e) => mt(e.target.value),
703
- className: d,
704
- children: [/* @__PURE__ */ s("option", {
966
+ value: Yt,
967
+ onChange: (e) => Xt(e.target.value),
968
+ className: T,
969
+ children: [/* @__PURE__ */ S("option", {
705
970
  value: "",
706
971
  children: "No season"
707
- }), [..._.seasons].sort((e, t) => e.number - t.number).map((e) => /* @__PURE__ */ s("option", {
972
+ }), [...h.seasons].sort((e, t) => e.number - t.number).map((e) => /* @__PURE__ */ S("option", {
708
973
  value: e.id,
709
974
  children: e.name ? `${e.number}. ${e.name}` : `Season ${e.number}`
710
975
  }, e.id))]
711
- })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
976
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
712
977
  htmlFor: "episode-number",
713
- className: f,
978
+ className: E,
714
979
  children: "Episode number *"
715
- }), /* @__PURE__ */ s("input", {
980
+ }), /* @__PURE__ */ S("input", {
716
981
  id: "episode-number",
717
982
  type: "number",
718
- value: q,
719
- onChange: (e) => ht(e.target.value),
983
+ value: J,
984
+ onChange: (e) => Zt(e.target.value),
720
985
  placeholder: "1",
721
- className: d,
986
+ className: T,
722
987
  required: !0
723
988
  })] })]
724
989
  }),
725
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
990
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
726
991
  htmlFor: "episode-name",
727
- className: f,
992
+ className: E,
728
993
  children: "Name *"
729
- }), /* @__PURE__ */ s("input", {
994
+ }), /* @__PURE__ */ S("input", {
730
995
  id: "episode-name",
731
996
  type: "text",
732
- value: J,
733
- onChange: (e) => gt(e.target.value),
997
+ value: Qt,
998
+ onChange: (e) => $t(e.target.value),
734
999
  placeholder: "Pilot",
735
- className: d,
1000
+ className: T,
736
1001
  required: !0
737
1002
  })] }),
738
- /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
1003
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
739
1004
  htmlFor: "episode-synopsis",
740
- className: f,
1005
+ className: E,
741
1006
  children: "Synopsis"
742
- }), /* @__PURE__ */ s("textarea", {
1007
+ }), /* @__PURE__ */ S("textarea", {
743
1008
  id: "episode-synopsis",
744
- value: _t,
745
- onChange: (e) => vt(e.target.value),
1009
+ value: en,
1010
+ onChange: (e) => tn(e.target.value),
746
1011
  rows: 3,
747
- className: d
1012
+ className: T
748
1013
  })] }),
749
- /* @__PURE__ */ c("div", {
1014
+ /* @__PURE__ */ C("div", {
750
1015
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
751
- children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
1016
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
752
1017
  htmlFor: "episode-runtime",
753
- className: f,
1018
+ className: E,
754
1019
  children: "Runtime (minutes)"
755
- }), /* @__PURE__ */ s("input", {
1020
+ }), /* @__PURE__ */ S("input", {
756
1021
  id: "episode-runtime",
757
1022
  type: "number",
758
- value: Y,
759
- onChange: (e) => yt(e.target.value),
1023
+ value: nn,
1024
+ onChange: (e) => rn(e.target.value),
760
1025
  placeholder: "45",
761
- className: d
762
- })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
1026
+ className: T
1027
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
763
1028
  htmlFor: "episode-airdate",
764
- className: f,
1029
+ className: E,
765
1030
  children: "Air date"
766
- }), /* @__PURE__ */ s("input", {
1031
+ }), /* @__PURE__ */ S("input", {
767
1032
  id: "episode-airdate",
768
1033
  type: "date",
769
- value: bt,
770
- onChange: (e) => xt(e.target.value),
771
- className: d
1034
+ value: an,
1035
+ onChange: (e) => on(e.target.value),
1036
+ className: T
772
1037
  })] })]
773
1038
  }),
774
- /* @__PURE__ */ c("div", {
1039
+ /* @__PURE__ */ C("div", {
775
1040
  className: "flex items-center gap-3",
776
- children: [/* @__PURE__ */ c("button", {
1041
+ children: [/* @__PURE__ */ C("button", {
777
1042
  type: "submit",
778
- disabled: C.isPending,
1043
+ disabled: A.isPending,
779
1044
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50 transition-opacity",
780
- children: [/* @__PURE__ */ s(a, { className: "h-4 w-4" }), C.isPending ? "Adding…" : "Add episode"]
781
- }), /* @__PURE__ */ s("button", {
1045
+ children: [/* @__PURE__ */ S(y, { className: "h-4 w-4" }), A.isPending ? "Adding…" : "Add episode"]
1046
+ }), /* @__PURE__ */ S("button", {
782
1047
  type: "button",
783
- onClick: Z,
1048
+ onClick: X,
784
1049
  className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
785
1050
  children: "Cancel"
786
1051
  })]
787
1052
  })
788
1053
  ]
789
1054
  }),
790
- _.episodes.length === 0 ? /* @__PURE__ */ s("p", {
1055
+ h.episodes.length === 0 ? /* @__PURE__ */ S("p", {
791
1056
  className: "text-sm text-text-secondary",
792
- children: X ? "No episodes yet. Add a season, then episodes, to build out this series." : "No episodes recorded for this title."
793
- }) : /* @__PURE__ */ s("ul", {
1057
+ children: Y ? "No episodes yet. Add a season, then episodes, to build out this series." : "No episodes recorded for this title."
1058
+ }) : /* @__PURE__ */ S("ul", {
794
1059
  className: "divide-y divide-border-seam",
795
- children: [..._.episodes].sort((e, t) => e.number - t.number).map((e) => /* @__PURE__ */ c("li", {
1060
+ children: [...h.episodes].sort((e, t) => e.number - t.number).map((e) => /* @__PURE__ */ C("li", {
796
1061
  className: "flex items-center justify-between py-2",
797
- children: [/* @__PURE__ */ c("div", {
1062
+ children: [/* @__PURE__ */ C("div", {
798
1063
  className: "min-w-0",
799
- children: [/* @__PURE__ */ c("p", {
1064
+ children: [/* @__PURE__ */ C("p", {
800
1065
  className: "truncate text-sm font-medium text-text-primary",
801
1066
  children: [
802
1067
  e.number,
803
1068
  ". ",
804
1069
  e.name
805
1070
  ]
806
- }), e.synopsis && /* @__PURE__ */ s("p", {
1071
+ }), e.synopsis && /* @__PURE__ */ S("p", {
807
1072
  className: "line-clamp-1 text-xs text-text-secondary",
808
1073
  children: e.synopsis
809
1074
  })]
810
- }), e.runtimeMinutes && /* @__PURE__ */ c("span", {
1075
+ }), e.runtimeMinutes && /* @__PURE__ */ C("span", {
811
1076
  className: "text-xs text-text-secondary",
812
1077
  children: [e.runtimeMinutes, " min"]
813
1078
  })]
@@ -815,173 +1080,306 @@ var u = {
815
1080
  })
816
1081
  ]
817
1082
  }),
818
- /* @__PURE__ */ c(l, {
1083
+ /* @__PURE__ */ C(w, {
819
1084
  treatment: "metric",
820
1085
  className: "border-border-seam p-5",
821
- children: [/* @__PURE__ */ c("div", {
1086
+ children: [/* @__PURE__ */ C("div", {
822
1087
  className: "mb-3 flex items-center justify-between",
823
- children: [/* @__PURE__ */ c("h2", {
1088
+ children: [/* @__PURE__ */ C("h2", {
824
1089
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
825
1090
  children: [
826
- /* @__PURE__ */ s(ke, { className: "h-4 w-4" }),
1091
+ /* @__PURE__ */ S(ke, { className: "h-4 w-4" }),
827
1092
  "Reviews (",
828
- Q.length,
1093
+ Z.length,
829
1094
  ")"
830
1095
  ]
831
- }), Mt !== null && /* @__PURE__ */ s(he, {
832
- value: Mt / 2,
833
- count: Q.length
1096
+ }), yn !== null && /* @__PURE__ */ S(me, {
1097
+ value: yn / 2,
1098
+ count: Z.length
834
1099
  })]
835
- }), Q.length === 0 ? /* @__PURE__ */ s("p", {
1100
+ }), Z.length === 0 ? /* @__PURE__ */ S("p", {
836
1101
  className: "text-sm text-text-secondary",
837
1102
  children: "No reviews yet."
838
- }) : /* @__PURE__ */ s("ul", {
1103
+ }) : /* @__PURE__ */ S("ul", {
839
1104
  className: "space-y-3",
840
- children: Q.map((e) => /* @__PURE__ */ c("li", {
1105
+ children: Z.map((e) => /* @__PURE__ */ C("li", {
841
1106
  className: "rounded-lg border border-border-seam bg-bg-surface p-3",
842
- children: [/* @__PURE__ */ c("div", {
1107
+ children: [/* @__PURE__ */ C("div", {
843
1108
  className: "flex items-center justify-between",
844
- children: [/* @__PURE__ */ c("span", {
1109
+ children: [/* @__PURE__ */ C("span", {
845
1110
  className: "text-sm font-semibold text-text-primary",
846
1111
  children: [e.score, "/10"]
847
- }), /* @__PURE__ */ c("div", {
1112
+ }), /* @__PURE__ */ C("div", {
848
1113
  className: "flex items-center gap-2",
849
- children: [e.verifiedWatch && /* @__PURE__ */ s("span", {
1114
+ children: [e.verifiedWatch && /* @__PURE__ */ S("span", {
850
1115
  className: "rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] text-status-success-text",
851
1116
  children: "Verified"
852
- }), /* @__PURE__ */ s(n, { status: e.status })]
1117
+ }), /* @__PURE__ */ S(r, { status: e.status })]
853
1118
  })]
854
- }), e.body && /* @__PURE__ */ s("p", {
1119
+ }), e.body && /* @__PURE__ */ S("p", {
855
1120
  className: "mt-1 text-sm text-text-secondary",
856
1121
  children: e.body
857
1122
  })]
858
1123
  }, e.id))
859
1124
  })]
1125
+ }),
1126
+ /* @__PURE__ */ C(w, {
1127
+ treatment: "metric",
1128
+ className: "border-border-seam p-5",
1129
+ children: [
1130
+ /* @__PURE__ */ C("div", {
1131
+ className: "mb-3 flex flex-wrap items-center justify-between gap-3",
1132
+ children: [/* @__PURE__ */ C("h2", {
1133
+ className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
1134
+ children: [
1135
+ /* @__PURE__ */ S(Me, { className: "h-4 w-4" }),
1136
+ "Clips (",
1137
+ N.data?.totalCount ?? Q.length,
1138
+ ")"
1139
+ ]
1140
+ }), /* @__PURE__ */ C("button", {
1141
+ type: "button",
1142
+ onClick: () => {
1143
+ R(null), F((e) => !e);
1144
+ },
1145
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-2.5 py-1 text-xs font-medium text-text-primary transition-colors hover:bg-bg-sunken",
1146
+ children: [/* @__PURE__ */ S(y, { className: "h-3.5 w-3.5" }), "Add clip"]
1147
+ })]
1148
+ }),
1149
+ et && /* @__PURE__ */ C("form", {
1150
+ onSubmit: _n,
1151
+ className: "mb-4 space-y-4 rounded-lg border border-border-seam bg-bg-surface p-4",
1152
+ children: [
1153
+ /* @__PURE__ */ C("div", { children: [
1154
+ /* @__PURE__ */ S("label", {
1155
+ htmlFor: "clip-file",
1156
+ className: E,
1157
+ children: "Clip video * (short vertical MP4)"
1158
+ }),
1159
+ /* @__PURE__ */ S("input", {
1160
+ id: "clip-file",
1161
+ ref: z,
1162
+ type: "file",
1163
+ accept: "video/*",
1164
+ onChange: (e) => tt(e.target.files?.[0] ?? null),
1165
+ className: T
1166
+ }),
1167
+ I && /* @__PURE__ */ C("p", {
1168
+ className: "mt-1 truncate text-xs text-text-secondary",
1169
+ children: ["Selected: ", I.name]
1170
+ })
1171
+ ] }),
1172
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
1173
+ htmlFor: "clip-caption",
1174
+ className: E,
1175
+ children: "Caption"
1176
+ }), /* @__PURE__ */ S("input", {
1177
+ id: "clip-caption",
1178
+ type: "text",
1179
+ value: nt,
1180
+ onChange: (e) => rt(e.target.value),
1181
+ placeholder: "e.g. Official teaser",
1182
+ className: T
1183
+ })] }),
1184
+ /* @__PURE__ */ C("div", {
1185
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
1186
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
1187
+ htmlFor: "clip-duration",
1188
+ className: E,
1189
+ children: "Duration (seconds)"
1190
+ }), /* @__PURE__ */ S("input", {
1191
+ id: "clip-duration",
1192
+ type: "number",
1193
+ min: 0,
1194
+ value: L,
1195
+ onChange: (e) => it(e.target.value),
1196
+ placeholder: "30",
1197
+ className: T
1198
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
1199
+ htmlFor: "clip-language",
1200
+ className: E,
1201
+ children: "Language"
1202
+ }), /* @__PURE__ */ S("input", {
1203
+ id: "clip-language",
1204
+ type: "text",
1205
+ value: at,
1206
+ onChange: (e) => ot(e.target.value),
1207
+ placeholder: "en",
1208
+ className: T
1209
+ })] })]
1210
+ }),
1211
+ lt && /* @__PURE__ */ S("p", {
1212
+ className: "text-xs text-status-error-text",
1213
+ children: lt
1214
+ }),
1215
+ /* @__PURE__ */ C("div", {
1216
+ className: "flex items-center gap-3",
1217
+ children: [/* @__PURE__ */ C("button", {
1218
+ type: "submit",
1219
+ disabled: st,
1220
+ className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-50",
1221
+ children: [/* @__PURE__ */ S(x, { className: "h-4 w-4" }), st ? "Uploading…" : "Add clip"]
1222
+ }), /* @__PURE__ */ S("button", {
1223
+ type: "button",
1224
+ onClick: () => {
1225
+ F(!1), R(null);
1226
+ },
1227
+ className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
1228
+ children: "Cancel"
1229
+ })]
1230
+ })
1231
+ ]
1232
+ }),
1233
+ N.isLoading ? /* @__PURE__ */ S(de, {
1234
+ label: "Loading clips…",
1235
+ className: "min-h-[20vh]"
1236
+ }) : N.isError ? /* @__PURE__ */ S(ue, {
1237
+ title: "Could not load clips",
1238
+ message: "Something went wrong fetching this title's clips.",
1239
+ onRetry: () => void N.refetch(),
1240
+ className: "min-h-[20vh]"
1241
+ }) : Q.length === 0 ? /* @__PURE__ */ S(fe, {
1242
+ title: "No clips yet",
1243
+ description: "Upload a short vertical clip to promote this title."
1244
+ }) : /* @__PURE__ */ C(Fe, { children: [/* @__PURE__ */ S("div", {
1245
+ className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",
1246
+ children: Q.map((e) => /* @__PURE__ */ S(We, {
1247
+ clip: e,
1248
+ deleting: ut === e.id,
1249
+ onDelete: (e) => void vn(e)
1250
+ }, e.id))
1251
+ }), /* @__PURE__ */ S(pe, {
1252
+ page: Ye,
1253
+ hasMore: N.data?.pageInfo.hasMore ?? !1,
1254
+ shownCount: Q.length,
1255
+ onPageChange: Xe
1256
+ })] })
1257
+ ]
860
1258
  })
861
1259
  ]
862
- }), /* @__PURE__ */ c("div", {
1260
+ }), /* @__PURE__ */ C("div", {
863
1261
  className: "space-y-6",
864
1262
  children: [
865
- /* @__PURE__ */ c(l, {
1263
+ /* @__PURE__ */ C(w, {
866
1264
  treatment: "metric",
867
1265
  className: "border-border-seam p-5",
868
- children: [/* @__PURE__ */ c("h2", {
1266
+ children: [/* @__PURE__ */ C("h2", {
869
1267
  className: "mb-3 flex items-center gap-2 text-sm font-semibold text-text-primary",
870
- children: [/* @__PURE__ */ s(Ee, { className: "h-4 w-4" }), "Watch"]
871
- }), T.isLoading ? /* @__PURE__ */ s("p", {
1268
+ children: [/* @__PURE__ */ S(Ee, { className: "h-4 w-4" }), "Watch"]
1269
+ }), M.isLoading ? /* @__PURE__ */ S("p", {
872
1270
  className: "text-sm text-text-secondary",
873
1271
  children: "Checking access…"
874
- }) : T.isError ? /* @__PURE__ */ c("div", {
1272
+ }) : M.isError ? /* @__PURE__ */ C("div", {
875
1273
  className: "space-y-2",
876
- children: [/* @__PURE__ */ s("p", {
1274
+ children: [/* @__PURE__ */ S("p", {
877
1275
  className: "text-sm text-status-error-text",
878
1276
  children: "Could not check entitlement."
879
- }), /* @__PURE__ */ s("button", {
1277
+ }), /* @__PURE__ */ S("button", {
880
1278
  type: "button",
881
- onClick: () => void T.refetch(),
1279
+ onClick: () => void M.refetch(),
882
1280
  className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken transition-colors",
883
1281
  children: "Retry"
884
1282
  })]
885
- }) : T.data?.entitled ? /* @__PURE__ */ c("div", {
1283
+ }) : M.data?.entitled ? /* @__PURE__ */ C("div", {
886
1284
  className: "space-y-3",
887
- children: [T.data.modes.length > 0 && /* @__PURE__ */ s("div", {
1285
+ children: [M.data.modes.length > 0 && /* @__PURE__ */ S("div", {
888
1286
  className: "flex flex-wrap gap-1.5",
889
- children: T.data.modes.map((e) => /* @__PURE__ */ s("span", {
1287
+ children: M.data.modes.map((e) => /* @__PURE__ */ S("span", {
890
1288
  className: "rounded-full bg-status-success-bg-subtle px-2.5 py-0.5 text-xs text-status-success-text",
891
- children: r(e)
1289
+ children: d(e)
892
1290
  }, e))
893
- }), St ? /* @__PURE__ */ c("p", {
1291
+ }), sn ? /* @__PURE__ */ C("p", {
894
1292
  className: "flex items-center gap-2 text-sm text-status-success-text",
895
- children: [/* @__PURE__ */ s(ye, { className: "h-4 w-4" }), "Marked as watched — see Continue Watching."]
896
- }) : /* @__PURE__ */ c("button", {
1293
+ children: [/* @__PURE__ */ S(ye, { className: "h-4 w-4" }), "Marked as watched — see Continue Watching."]
1294
+ }) : /* @__PURE__ */ C("button", {
897
1295
  type: "button",
898
- disabled: w.isPending,
899
- onClick: () => void jt(),
1296
+ disabled: j.isPending,
1297
+ onClick: () => void gn(),
900
1298
  className: "inline-flex w-full items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50 transition-opacity",
901
- children: [/* @__PURE__ */ s(Ee, { className: "h-4 w-4" }), w.isPending ? "Saving…" : "Mark as watched"]
1299
+ children: [/* @__PURE__ */ S(Ee, { className: "h-4 w-4" }), j.isPending ? "Saving…" : "Mark as watched"]
902
1300
  })]
903
- }) : /* @__PURE__ */ c("div", {
1301
+ }) : /* @__PURE__ */ C("div", {
904
1302
  className: "flex items-start gap-2 rounded-lg border border-border-seam bg-bg-sunken px-3 py-2.5",
905
- children: [/* @__PURE__ */ s(we, { className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ s("p", {
1303
+ children: [/* @__PURE__ */ S(we, { className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ S("p", {
906
1304
  className: "text-sm text-text-secondary",
907
1305
  children: "You are not entitled to watch this title. Grant an entitlement or add a rights window to enable playback."
908
1306
  })]
909
1307
  })]
910
1308
  }),
911
- /* @__PURE__ */ c(l, {
1309
+ /* @__PURE__ */ C(w, {
912
1310
  treatment: "metric",
913
1311
  className: "border-border-seam p-5",
914
1312
  children: [
915
- /* @__PURE__ */ s("h2", {
1313
+ /* @__PURE__ */ S("h2", {
916
1314
  className: "mb-3 text-sm font-semibold text-text-primary",
917
1315
  children: "Publication"
918
1316
  }),
919
- /* @__PURE__ */ c("div", {
1317
+ /* @__PURE__ */ C("div", {
920
1318
  className: "flex flex-wrap gap-2",
921
- children: [u[_.status].map((e) => /* @__PURE__ */ s("button", {
1319
+ children: [Ie[h.status].map((e) => /* @__PURE__ */ S("button", {
922
1320
  type: "button",
923
- disabled: v.isPending,
924
- onClick: () => void Tt(e),
1321
+ disabled: Ve.isPending,
1322
+ onClick: () => void un(e),
925
1323
  className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50 transition-opacity",
926
- children: r(e)
927
- }, e)), u[_.status].length === 0 && /* @__PURE__ */ s("p", {
1324
+ children: d(e)
1325
+ }, e)), Ie[h.status].length === 0 && /* @__PURE__ */ S("p", {
928
1326
  className: "text-xs text-text-secondary",
929
1327
  children: "No further transitions available."
930
1328
  })]
931
1329
  }),
932
- _.status !== "ARCHIVED" && /* @__PURE__ */ c("button", {
1330
+ h.status !== "ARCHIVED" && /* @__PURE__ */ C("button", {
933
1331
  type: "button",
934
- disabled: y.isPending,
935
- onClick: () => void Et(),
1332
+ disabled: Ke.isPending,
1333
+ onClick: () => void dn(),
936
1334
  className: "mt-3 inline-flex items-center gap-2 rounded-lg border border-status-error-border px-3 py-1.5 text-xs font-medium text-status-error-text hover:bg-status-error-bg-subtle disabled:opacity-50 transition-colors",
937
- children: [/* @__PURE__ */ s(ge, { className: "h-3.5 w-3.5" }), "Archive Title"]
1335
+ children: [/* @__PURE__ */ S(ge, { className: "h-3.5 w-3.5" }), "Archive Title"]
938
1336
  })
939
1337
  ]
940
1338
  }),
941
- /* @__PURE__ */ c(l, {
1339
+ /* @__PURE__ */ C(w, {
942
1340
  treatment: "metric",
943
1341
  className: "border-border-seam p-5",
944
- children: [/* @__PURE__ */ s("h2", {
1342
+ children: [/* @__PURE__ */ S("h2", {
945
1343
  className: "mb-3 text-sm font-semibold text-text-primary",
946
1344
  children: "Details"
947
- }), /* @__PURE__ */ c("dl", {
1345
+ }), /* @__PURE__ */ C("dl", {
948
1346
  className: "space-y-2",
949
1347
  children: [$.map((e) => {
950
1348
  let t = e.icon;
951
- return /* @__PURE__ */ c("div", {
1349
+ return /* @__PURE__ */ C("div", {
952
1350
  className: "flex items-center justify-between text-sm",
953
- children: [/* @__PURE__ */ c("dt", {
1351
+ children: [/* @__PURE__ */ C("dt", {
954
1352
  className: "flex items-center gap-2 text-text-secondary",
955
- children: [/* @__PURE__ */ s(t, { className: "h-3.5 w-3.5" }), e.label]
956
- }), /* @__PURE__ */ s("dd", {
1353
+ children: [/* @__PURE__ */ S(t, { className: "h-3.5 w-3.5" }), e.label]
1354
+ }), /* @__PURE__ */ S("dd", {
957
1355
  className: "font-medium text-text-primary",
958
1356
  children: e.value
959
1357
  })]
960
1358
  }, e.label);
961
- }), _.aiDisclosure && /* @__PURE__ */ c("div", {
1359
+ }), h.aiDisclosure && /* @__PURE__ */ C("div", {
962
1360
  className: "flex items-center gap-2 pt-1 text-sm text-text-secondary",
963
- children: [/* @__PURE__ */ s(Oe, { className: "h-3.5 w-3.5" }), "Contains AI-generated content"]
1361
+ children: [/* @__PURE__ */ S(Oe, { className: "h-3.5 w-3.5" }), "Contains AI-generated content"]
964
1362
  })]
965
1363
  })]
966
1364
  }),
967
- (_.genres.length > 0 || _.tags.length > 0) && /* @__PURE__ */ c(l, {
1365
+ (h.genres.length > 0 || h.tags.length > 0) && /* @__PURE__ */ C(w, {
968
1366
  treatment: "metric",
969
1367
  className: "border-border-seam p-5",
970
- children: [_.genres.length > 0 && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("h3", {
1368
+ children: [h.genres.length > 0 && /* @__PURE__ */ C(Fe, { children: [/* @__PURE__ */ S("h3", {
971
1369
  className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
972
1370
  children: "Genres"
973
- }), /* @__PURE__ */ s("div", {
1371
+ }), /* @__PURE__ */ S("div", {
974
1372
  className: "mb-3 flex flex-wrap gap-1.5",
975
- children: _.genres.map((e) => /* @__PURE__ */ s("span", {
1373
+ children: h.genres.map((e) => /* @__PURE__ */ S("span", {
976
1374
  className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-primary",
977
1375
  children: e
978
1376
  }, e))
979
- })] }), _.tags.length > 0 && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("h3", {
1377
+ })] }), h.tags.length > 0 && /* @__PURE__ */ C(Fe, { children: [/* @__PURE__ */ S("h3", {
980
1378
  className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
981
1379
  children: "Tags"
982
- }), /* @__PURE__ */ s("div", {
1380
+ }), /* @__PURE__ */ S("div", {
983
1381
  className: "flex flex-wrap gap-1.5",
984
- children: _.tags.map((e) => /* @__PURE__ */ s("span", {
1382
+ children: h.tags.map((e) => /* @__PURE__ */ S("span", {
985
1383
  className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
986
1384
  children: e
987
1385
  }, e))
@@ -994,6 +1392,6 @@ var u = {
994
1392
  });
995
1393
  };
996
1394
  //#endregion
997
- export { h as TitleDetailPage };
1395
+ export { Ke as TitleDetailPage };
998
1396
 
999
1397
  //# sourceMappingURL=TitleDetailPage.js.map