@soffits/dsh-media-hub 0.0.0-stage → 0.7.1

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.
package/web/ui.js ADDED
@@ -0,0 +1,301 @@
1
+ /**
2
+ * Shared pieces of the media hub page: React from the host page, requests
3
+ * to the Host half, formatting, icons and two small controls (an inline
4
+ * confirmation and a menu). The page's other modules import this one.
5
+ */
6
+ import { captionName, parseCaption } from './captions.js'
7
+ import { fill } from './format.js'
8
+ import { pick } from './i18n.js'
9
+
10
+ export let React
11
+ export let h
12
+ /** What the page knows of the library and the open rooms (web/known.js): set by Page, read anywhere a work is shown. */
13
+ export let Known
14
+ /** DSH's own components (@deepseek-ai/dsh-client-ui-primitives): Button, Tag, StateDot, SegmentedTabs, icons. */
15
+ export let P
16
+ /** The shared kit (@soffits/dsh-ui-kit, ctx.uiKit): Surface, Segments, Tile, Icon, TimeAgo, Suggested, TOUCH. */
17
+ export let K
18
+
19
+ /** Called once by client.js with the page's React, DSH's components and the kit before any view renders. */
20
+ export function init(react, { primitives, kit }) {
21
+ React = react
22
+ h = react.createElement
23
+ P = primitives
24
+ K = kit
25
+ Known = react.createContext({ library: null, rooms: undefined, reload: () => {} })
26
+ }
27
+
28
+ /** DSH's Button, compact on a desk and 40 px tall on touch screens: `variant` outline (default), primary, ghost or toolbar. */
29
+ export const Btn = ({ variant = 'outline', size = 'sm', className, ...rest }) => h(P.Button, { variant, size, className: className ? `${K.TOUCH} ${className}` : K.TOUCH, ...rest })
30
+
31
+ export const base = () => new URL('media-hub/', document.baseURI)
32
+ export const LINK_PARAM = 'media-room'
33
+ export const POLL_MS = 4000
34
+
35
+ /** The page's words for failures, set by the page whenever its language changes (`setWords`). */
36
+ let words = null
37
+ export function setWords(t) { words = t }
38
+
39
+ /**
40
+ * What a failed request says to the viewer: the page's words for the reason
41
+ * a site or route failed, else the hub's message, else a sentence with the
42
+ * status (a proxy in front of DSH may answer with a page of its own).
43
+ */
44
+ export function failureText(error, status) {
45
+ if (words !== null && error?.reason) return words(`error.${error.reason}`)
46
+ if (typeof error?.message === 'string' && error.message !== '') return error.message
47
+ return words === null ? `HTTP ${status}` : fill(words('error.status'), { status })
48
+ }
49
+
50
+ /** One JSON request; failures come back as { error, code, reason } with `error` in the viewer's words. */
51
+ async function request(url, init = {}) {
52
+ try {
53
+ const response = await fetch(url, init.body === undefined ? init : { ...init, headers: { 'content-type': 'application/json' } })
54
+ const data = await response.json().catch(() => ({}))
55
+ if (!response.ok) return { error: failureText(data.error, response.status), code: data.error?.code, reason: data.error?.reason ?? null }
56
+ return data
57
+ } catch (error) {
58
+ return { error: words === null ? error.message : words('error.network') }
59
+ }
60
+ }
61
+
62
+ /** One request to the Host half. */
63
+ export const api = (path, init = {}) => request(new URL(`api/${path}`, base()), init)
64
+
65
+ export const post = (path, body) => api(path, { method: 'POST', body: JSON.stringify(body) })
66
+
67
+ /** What acts for the person asking lives under DSH's own /api, where the signed-in person is known (src/person-routes.js). */
68
+ const personUrl = path => new URL(`api/media-hub/${path}`, document.baseURI)
69
+ export const asPerson = (path, body, init = {}) => request(personUrl(path), body === undefined ? init : { ...init, method: 'POST', body: JSON.stringify(body) })
70
+
71
+ /** The shelf's routes, under the same /api (src/shelf-routes.js). */
72
+ export const shelfUrl = (path = '') => personUrl(`shelf${path}`)
73
+ export const shelf = (path = '', body) => request(shelfUrl(path), body === undefined ? {} : { method: 'POST', body: JSON.stringify(body) })
74
+
75
+ /** Opens a conversation about an item (set by client.js; `available` is false without @soffits/dsh-ui-actions). */
76
+ let chat = null
77
+ export function setChat(value) { chat = value }
78
+ export const canChat = () => chat?.available() === true
79
+
80
+ /**
81
+ * Open a conversation about an item, attached to the message box as a card the person writes beside.
82
+ * @param {object} about
83
+ * @param {string} about.title
84
+ * @param {string[]} about.lines - what is shown about the item
85
+ * @param {object} about.context - ids that let the assistant find it again
86
+ */
87
+ export function chatAbout({ title, lines, context }) {
88
+ return chat?.start({ title, lines: lines.filter(Boolean), context })
89
+ }
90
+ export const query = values => new URLSearchParams(values).toString()
91
+
92
+ /** The signed-in user's name and picture (when it has one) from the sign-in plugin, if there is one. */
93
+ let profileRequest
94
+ export function profile() {
95
+ profileRequest ??= fetch(new URL('_dsh-oidc/session', document.baseURI))
96
+ .then(r => (r.ok ? r.json() : null))
97
+ .then(d => ({ name: (d && (d.name || d.username)) || null, picture: (d && (d.picture || d.avatar || d.avatar_url)) || null }), () => ({ name: null, picture: null }))
98
+ return profileRequest
99
+ }
100
+
101
+ export const displayName = fallback => profile().then(({ name }) => name || fallback)
102
+
103
+ /**
104
+ * The name of something configured (a source, a category): its configured label in the viewer's language
105
+ * (one string, or `{ <tag>: text }`: src/i18n.js), else the page's own words under `key`, else ''.
106
+ */
107
+ export function nameOf(t, key, label) {
108
+ const configured = pick(label, t.language).trim()
109
+ if (configured !== '') return configured
110
+ const own = t(key)
111
+ return own === key ? '' : own
112
+ }
113
+
114
+ export { fill }
115
+
116
+ /** Like fill, with elements as values (a ticking time inside a sentence): the parts, in the language's own order. */
117
+ export const fillNodes = (template, values) => template.split(/(\{\w+\})/).filter(Boolean).map((part, n) => {
118
+ const key = /^\{(\w+)\}$/.exec(part)?.[1]
119
+ return key !== undefined && key in values ? h(React.Fragment, { key: n }, values[key]) : part
120
+ })
121
+
122
+ /** A count in words: the `<key>.<category>` text the viewer's language's plural rules pick for `n` (Intl.PluralRules), else `<key>.other`. */
123
+ export function plural(t, key, n) {
124
+ const exact = `${key}.${new Intl.PluralRules(t.language).select(n)}`
125
+ const text = t(exact)
126
+ return fill(text === exact ? t(`${key}.other`) : text, { n })
127
+ }
128
+
129
+ export function clock(seconds) {
130
+ const s = Math.max(0, Math.floor(seconds ?? 0))
131
+ const hh = Math.floor(s / 3600)
132
+ const mm = Math.floor((s % 3600) / 60)
133
+ const ss = String(s % 60).padStart(2, '0')
134
+ return hh > 0 ? `${hh}:${String(mm).padStart(2, '0')}:${ss}` : `${mm}:${ss}`
135
+ }
136
+
137
+ const BYTE_UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte']
138
+ /** A size the way the viewer's language writes it (1.5 MB, 1,5 Mo): whole numbers from 10 up; plain bytes narrow (300B), as "300 byte" reads oddly. */
139
+ export function bytes(t, value) {
140
+ let n = Math.max(0, value ?? 0)
141
+ let unit = 0
142
+ while (n >= 1000 && unit < BYTE_UNITS.length - 1) {
143
+ n /= 1000
144
+ unit += 1
145
+ }
146
+ const digits = n >= 10 || unit === 0 ? 0 : 1
147
+ return new Intl.NumberFormat(t.language, { style: 'unit', unit: BYTE_UNITS[unit], unitDisplay: unit === 0 ? 'narrow' : 'short', maximumFractionDigits: digits }).format(n)
148
+ }
149
+
150
+ /** A caption track's name for the picker: its language in that language, marked when a machine made it. */
151
+ export function captionText(t, label) {
152
+ const name = captionName(label)
153
+ return parseCaption(label).auto ? fill(t('caption.auto'), { name }) : name
154
+ }
155
+
156
+ /** A language's name in the viewer's language (Intl.DisplayNames), else the text as it is (a label that names no known language). */
157
+ export function languageName(t, code) {
158
+ if (!code) return ''
159
+ try {
160
+ return new Intl.DisplayNames([t.language], { type: 'language', fallback: 'none' }).of(code) ?? code
161
+ } catch {
162
+ return code
163
+ }
164
+ }
165
+
166
+ /** How far an episode is on its way, as a fraction, or null when that is not known. */
167
+ export const progressFraction = progress => (Number.isFinite(progress?.fraction) ? progress.fraction : null)
168
+
169
+ /** How far an episode is on its way, in the viewer's words: downloading (percent, size, speed, time left), then preparing (percent). */
170
+ export function progressText(t, progress) {
171
+ const fraction = progressFraction(progress)
172
+ const percent = fraction === null ? null : Math.floor(fraction * 100)
173
+ if (progress?.step !== 'download') return percent === null ? t('room.preparing') : fill(t('room.preparingProgress'), { n: percent })
174
+ const parts = [percent === null ? t('progress.downloading') : fill(t('progress.downloadingPercent'), { n: percent })]
175
+ if (progress.total) parts.push(fill(t('progress.of'), { done: bytes(t, progress.done), total: bytes(t, progress.total) }))
176
+ else if (progress.done) parts.push(bytes(t, progress.done))
177
+ if (progress.speed) parts.push(fill(t('progress.speed'), { speed: bytes(t, progress.speed) }))
178
+ if (Number.isFinite(progress.eta)) parts.push(fill(t('progress.left'), { time: clock(progress.eta) }))
179
+ // Each part stays on one line ("228 kB/s"); a narrow screen breaks between them.
180
+ return parts.map(part => part.replace(/ /g, '\u00a0')).join(' · ')
181
+ }
182
+
183
+ /** A bar for an episode on its way, when how far is known. */
184
+ export const ProgressBar = ({ progress }) => (progressFraction(progress) === null ? null : h('progress', { className: 'vsync-progress', max: 1, value: progressFraction(progress) }))
185
+
186
+ /** Rough size of one downloaded episode by kind, for "about N GB" before a download (src/sources/index.js keeps the same numbers). */
187
+ export const EPISODE_BYTES = { drama: 15e6, audio: 8e6 }
188
+
189
+ export const DAY_MS = 86_400_000
190
+ export const day = (t, ms) => new Intl.DateTimeFormat(t.language, { month: 'short', day: 'numeric' }).format(new Date(ms))
191
+ export const time = (t, ms) => new Intl.DateTimeFormat(t.language, { hour: '2-digit', minute: '2-digit' }).format(new Date(ms))
192
+
193
+ export const roomLink = id => `${location.origin}${location.pathname}?${LINK_PARAM}=${encodeURIComponent(id)}`
194
+
195
+ export async function copyText(text, label) {
196
+ try {
197
+ await navigator.clipboard.writeText(text)
198
+ return true
199
+ } catch {
200
+ window.prompt(label, text)
201
+ return false
202
+ }
203
+ }
204
+
205
+ // ------------------------------------------------------------ icons
206
+ // Drawn for this plugin on a 16-unit grid; the stroke follows the text colour.
207
+
208
+ const svg = (size, ...children) => h('svg', { width: size, height: size, viewBox: '0 0 16 16', fill: 'none', 'aria-hidden': true, focusable: 'false' }, ...children)
209
+ const stroke = { stroke: 'currentColor', strokeWidth: 1.2, strokeLinecap: 'round', strokeLinejoin: 'round' }
210
+ export const Icon = {
211
+ Film: ({ size = 16 }) => svg(size, h('rect', { x: 2, y: 3, width: 12, height: 10, rx: 1.5, ...stroke }), h('path', { d: 'M5 3v10M11 3v10M2 6h3M2 10h3M11 6h3M11 10h3', ...stroke })),
212
+ Audio: ({ size = 16 }) => svg(size, h('path', { d: 'M3 9.5V8a5 5 0 0 1 10 0v1.5', ...stroke }), h('rect', { x: 2.5, y: 9, width: 2.5, height: 4, rx: 1, ...stroke }), h('rect', { x: 11, y: 9, width: 2.5, height: 4, rx: 1, ...stroke })),
213
+ Back: ({ size = 16 }) => svg(size, h('path', { d: 'M10 3.5 5.5 8l4.5 4.5', ...stroke })),
214
+ Link: ({ size = 16 }) => svg(size, h('path', { d: 'M6.8 9.2a2.6 2.6 0 0 0 3.7 0l2-2a2.6 2.6 0 0 0-3.7-3.7l-.6.6M9.2 6.8a2.6 2.6 0 0 0-3.7 0l-2 2a2.6 2.6 0 0 0 3.7 3.7l.6-.6', ...stroke })),
215
+ Close: ({ size = 16 }) => svg(size, h('path', { d: 'M4 4l8 8M12 4l-8 8', ...stroke })),
216
+ Search: ({ size = 16 }) => svg(size, h('circle', { cx: 7, cy: 7, r: 4.25, ...stroke }), h('path', { d: 'm10.2 10.2 3.3 3.3', ...stroke })),
217
+ More: ({ size = 16 }) => svg(size, ...[4, 8, 12].map(x => h('circle', { key: x, cx: x, cy: 8, r: 1, fill: 'currentColor' }))),
218
+ Chat: ({ size = 16 }) => svg(size, h('path', { d: 'M3 4.5A1.5 1.5 0 0 1 4.5 3h7A1.5 1.5 0 0 1 13 4.5v5a1.5 1.5 0 0 1-1.5 1.5H7l-3 2.5V11h.5A1.5 1.5 0 0 1 3 9.5Z', ...stroke })),
219
+ Download: ({ size = 16 }) => svg(size, h('path', { d: 'M8 2.5v8M4.75 7.5 8 10.75l3.25-3.25M3 13.5h10', ...stroke })),
220
+ Book: ({ size = 16 }) => svg(size, h('path', { d: 'M3 3.5A1.5 1.5 0 0 1 4.5 2H13v10H4.5A1.5 1.5 0 0 0 3 13.5Zm0 10A1.5 1.5 0 0 0 4.5 15H13v-3', ...stroke })),
221
+ Check: ({ size = 16 }) => svg(size, h('path', { d: 'M3.5 8.5 6.5 11.5 12.5 4.5', ...stroke })),
222
+ Chevron: ({ size = 16, open = false }) => svg(size, h('path', { d: open ? 'M4 6l4 4 4-4' : 'M6 4l4 4-4 4', ...stroke })),
223
+ }
224
+
225
+ /** A small turning ring, for something that is loading. */
226
+ export const Spinner = () => h('span', { className: 'vsync-spinner', 'aria-hidden': true })
227
+
228
+ // ------------------------------------------------------------ watched marks
229
+
230
+ /**
231
+ * How an episode row shows what was watched: watched ones dimmed with a
232
+ * check, partly watched ones a thin bar and where they stopped; the episode
233
+ * playing now shows neither.
234
+ * @returns {{ state: 'watched' | 'partial' | 'none', bar: object | null, note: object | null }}
235
+ */
236
+ export function watchMark(t, watch, current = false) {
237
+ if (current || watch === null || watch === undefined) return { state: 'none', bar: null, note: null }
238
+ if (watch.finished) return { state: 'watched', bar: null, note: h('span', { className: 'vsync-watchCheck', title: t('watch.watched'), 'aria-label': t('watch.watched') }, h(Icon.Check, { size: 14 })) }
239
+ if (!(watch.position > 0)) return { state: 'none', bar: null, note: null }
240
+ const share = watch.duration > 0 ? Math.min(1, watch.position / watch.duration) : null
241
+ return {
242
+ state: 'partial',
243
+ bar: share === null ? null : h('span', { className: 'vsync-watchBar', 'aria-hidden': true }, h('span', { style: { width: `${Math.max(3, share * 100)}%` } })),
244
+ note: h('span', { className: 'vsync-episodeState' }, fill(t('watch.stoppedAt'), { time: clock(watch.position) })),
245
+ }
246
+ }
247
+
248
+ // ------------------------------------------------------------ controls
249
+
250
+ /**
251
+ * An action that asks first, in place: the trigger turns into the question
252
+ * with Cancel and the confirming button. Closing a room, deleting a show.
253
+ */
254
+ export function Confirm({ t, question, confirmLabel, onConfirm, onCancel, danger = true }) {
255
+ const [busy, setBusy] = React.useState(false)
256
+ return h('span', { className: 'vsync-confirm', role: 'group' },
257
+ h('span', { className: 'vsync-confirmText' }, question),
258
+ h('button', { type: 'button', className: 'vsync-btn', onClick: onCancel, disabled: busy }, t('action.cancel')),
259
+ h('button', {
260
+ type: 'button',
261
+ className: `vsync-btn ${danger ? 'vsync-danger' : 'vsync-primary'}`,
262
+ disabled: busy,
263
+ onClick: async () => {
264
+ setBusy(true)
265
+ await onConfirm()
266
+ setBusy(false)
267
+ },
268
+ }, confirmLabel))
269
+ }
270
+
271
+ /**
272
+ * A button with a small menu of actions; closes on outside click or Escape.
273
+ * Without children it is the "more" icon; with children, a quiet text button.
274
+ */
275
+ export function Menu({ label, items, children, title }) {
276
+ const [open, setOpen] = React.useState(false)
277
+ const root = React.useRef(null)
278
+ React.useEffect(() => {
279
+ if (!open) return undefined
280
+ const away = (event) => { if (!root.current?.contains(event.target)) setOpen(false) }
281
+ const key = (event) => { if (event.key === 'Escape') setOpen(false) }
282
+ document.addEventListener('pointerdown', away)
283
+ document.addEventListener('keydown', key)
284
+ return () => {
285
+ document.removeEventListener('pointerdown', away)
286
+ document.removeEventListener('keydown', key)
287
+ }
288
+ }, [open])
289
+ return h('span', { className: 'vsync-menuWrap', ref: root },
290
+ h('button', { type: 'button', className: children ? 'vsync-metaButton' : 'vsync-icon', 'aria-label': label, title: title ?? label, 'aria-haspopup': 'menu', 'aria-expanded': String(open), onClick: () => setOpen(!open) }, children ?? h(Icon.More)),
291
+ open && h('div', { className: 'vsync-menu', role: 'menu' }, items.filter(Boolean).map(item => h('button', {
292
+ key: item.label,
293
+ type: 'button',
294
+ role: 'menuitem',
295
+ className: `vsync-menuItem${item.danger ? ' vsync-menuDanger' : ''}`,
296
+ onClick: () => {
297
+ setOpen(false)
298
+ item.onSelect()
299
+ },
300
+ }, item.label))))
301
+ }
@@ -0,0 +1,100 @@
1
+ /**
2
+ * The Watching tab, in the order of what matters now: the Continue card (the
3
+ * show someone is in, or the one watched last), news from followed works,
4
+ * "How was it?", picks, the shared rooms, and the other shows someone has
5
+ * started. Which optional parts show is the `presence` setting; a part with
6
+ * nothing to show takes no room.
7
+ */
8
+ import { ContinueCard } from './continue-card.js'
9
+ import { continueSubject, continueWatching } from './continue.js'
10
+ import { Poster, showMeta } from './library-view.js'
11
+ import { PicksSection, RatingsSection } from './presence-view.js'
12
+ import { RoomsSection } from './rooms-view.js'
13
+ import { Btn, K, api, asPerson, displayName, fill, h, plural, post, React } from './ui.js'
14
+
15
+ /** Shows with news from a followed work: a new season added, or more episodes. */
16
+ export const withNews = library => (library?.shows ?? []).filter(show => show.newSeason || show.newEpisodes)
17
+
18
+ /** One show in a list: its poster, title, what is known, and its buttons. */
19
+ function ShowRow({ show, title, meta, children }) {
20
+ return h(K.Surface, { as: 'li', className: 'vsync-row vsync-roomCard' },
21
+ h(Poster, { show }),
22
+ h('span', { className: 'vsync-rowText' },
23
+ h('span', { className: 'vsync-rowTitle' }, title),
24
+ h('span', { className: 'vsync-rowMeta' }, meta.filter(Boolean).map((part, n) => h('span', { key: n }, part)))),
25
+ h('span', { className: 'vsync-actions' }, children))
26
+ }
27
+
28
+ /** Opens a room for this person alone on a library show (watching alone is the default; the room offers sharing). */
29
+ function StartButton({ t, show, label, variant, onOpen, onStarted }) {
30
+ const [busy, setBusy] = React.useState(false)
31
+ const start = async () => {
32
+ setBusy(true)
33
+ const answer = await asPerson('rooms', { source: 'local', path: show.path, by: await displayName(t('guest')) })
34
+ setBusy(false)
35
+ if (answer.error) return
36
+ onStarted?.()
37
+ onOpen(answer.room.id)
38
+ }
39
+ return h(Btn, { variant, disabled: busy, onClick: start }, label)
40
+ }
41
+
42
+ function NewsRow({ t, show, onOpen, onChanged }) {
43
+ const dismiss = async () => { await post('library/seen', { path: show.path }); onChanged() }
44
+ return h(ShowRow, {
45
+ show,
46
+ title: show.work?.title ?? show.name,
47
+ meta: [
48
+ show.newSeason && (show.newSeason.from ? fill(t('follow.newSeasonOf'), { title: show.newSeason.from }) : t('follow.newSeason')),
49
+ show.newEpisodes && plural(t, 'follow.newEpisodes', show.newEpisodes.n),
50
+ ],
51
+ },
52
+ h(Btn, { variant: 'ghost', onClick: dismiss }, t('follow.dismiss')),
53
+ h(StartButton, { t, show, label: t('library.watch'), variant: 'primary', onOpen, onStarted: dismiss }))
54
+ }
55
+
56
+ /** The page's settings that shape this tab, and the configured sources (for their names), loaded once. */
57
+ function useSettings() {
58
+ const [settings, setSettings] = React.useState({ presence: { continue: true }, sources: [] })
59
+ React.useEffect(() => {
60
+ let live = true
61
+ Promise.all([api('settings'), api('sources')]).then(([answer, list]) => {
62
+ if (live) setSettings({ presence: { continue: true, ...answer.presence }, sources: list.sources ?? [] })
63
+ })
64
+ return () => { live = false }
65
+ }, [])
66
+ return settings
67
+ }
68
+
69
+ export function WatchingTab({ t, rooms, library, onOpen, onChanged, onGo, onOpenWork }) {
70
+ const { presence, sources } = useSettings()
71
+ const shows = library?.shows ?? []
72
+ const subject = presence.continue ? continueSubject(rooms, shows) : null
73
+ const others = continueWatching(shows).filter(show => show.path !== subject?.show?.path)
74
+ const news = withNews(library)
75
+ // A rating or a finished show changes what "How was it?" asks; the library's watched marks say when.
76
+ const watchedVersion = shows.map(show => show.watchedAt ?? 0).join(',')
77
+ const quiet = rooms !== undefined && rooms.length === 0 && library !== null && subject === null && others.length === 0 && news.length === 0
78
+ return h('div', { className: 'vsync-tabPanel vsync-watching' },
79
+ subject && h(ContinueCard, { key: subject.room?.id ?? subject.show?.path, t, subject, presence, sources, onOpen, onChanged }),
80
+ news.length > 0 && h('section', { className: 'vsync-section', 'aria-labelledby': 'vsync-news' },
81
+ h('h2', { id: 'vsync-news' }, t('follow.news')),
82
+ h('ul', { className: 'vsync-cards' }, news.map(show => h(NewsRow, { key: show.path, t, show, onOpen, onChanged })))),
83
+ h(RatingsSection, { t, on: presence.ratings === true, version: watchedVersion }),
84
+ h(PicksSection, { t, on: presence.picks === true, onOpen, onOpenWork }),
85
+ h(RoomsSection, { t, rooms, onOpen, onChanged }),
86
+ others.length > 0 && h('section', { className: 'vsync-section', 'aria-labelledby': 'vsync-continue' },
87
+ h('h2', { id: 'vsync-continue' }, t('watching.continue')),
88
+ h('ul', { className: 'vsync-cards' }, others.map(show => h(ShowRow, {
89
+ key: show.path,
90
+ show,
91
+ title: show.kind === 'file' ? show.name.replace(/\.[^.]+$/, '') : show.work?.title ?? show.name,
92
+ meta: Object.values(showMeta(t, show)).flat(),
93
+ }, h(StartButton, { t, show, label: t('library.continue'), onOpen }))))),
94
+ quiet && h(K.Surface, { className: 'vsync-emptyState' },
95
+ h('p', { className: 'vsync-emptyTitle' }, t('watching.emptyTitle')),
96
+ h('p', { className: 'vsync-emptyHint' }, t('watching.emptyHint')),
97
+ h('span', { className: 'vsync-actions vsync-emptyActions' },
98
+ h(Btn, { onClick: () => onGo('library') }, t('tab.library')),
99
+ h(Btn, { variant: 'primary', onClick: () => onGo('discover') }, t('tab.discover')))))
100
+ }