@openrails/contentkit-ui 0.98.0 → 0.98.3

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,40 +1,42 @@
1
1
  import { RenditionImg as e } from "../rendition-img.js";
2
- import { useLanguageName as t, useMessages as n } from "../../i18n/context.js";
3
- import { ContentKitContext as r } from "../../react/context.js";
4
- import { HoverPreview as i } from "../hover-preview.js";
5
- import { Badge as a } from "../../ui/badge.js";
6
- import { RelativeTime as o, formatDate as s } from "../social/parts.js";
7
- import { GroupAvatar as c, GroupLink as l, labelOf as u } from "../groups/parts.js";
8
- import { priceLabel as d } from "./paywall.js";
9
- import { useCallback as f, useContext as p, useState as m } from "react";
10
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
11
- import { cn as _ } from "cn";
12
- import { FavouriteIcon as v, LockIcon as y, ThumbsUpIcon as b } from "@hugeicons/core-free-icons";
13
- import { HugeiconsIcon as x } from "@hugeicons/react";
2
+ import { ratio as t } from "../../client/aspect.js";
3
+ import { useLanguageName as n, useMessages as r } from "../../i18n/context.js";
4
+ import { ContentKitContext as i } from "../../react/context.js";
5
+ import { usePresets as a } from "../../react/public.js";
6
+ import { HoverPreview as o } from "../hover-preview.js";
7
+ import { Badge as s } from "../../ui/badge.js";
8
+ import { RelativeTime as c, formatDate as l } from "../social/parts.js";
9
+ import { GroupAvatar as u, GroupLink as d, labelOf as f } from "../groups/parts.js";
10
+ import { priceLabel as p } from "./paywall.js";
11
+ import { useCallback as m, useContext as h, useState as g } from "react";
12
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
13
+ import { cn as y } from "cn";
14
+ import { FavouriteIcon as b, LockIcon as x, ThumbsUpIcon as S } from "@hugeicons/core-free-icons";
15
+ import { HugeiconsIcon as C } from "@hugeicons/react";
14
16
  //#region src/components/content/card.tsx
15
- function S({ card: e, decorate: t, aboveTitle: n }) {
17
+ function w({ card: e, decorate: t, aboveTitle: n }) {
16
18
  let r = t?.(e);
17
- return r == null || r === !1 ? null : /* @__PURE__ */ h("span", {
18
- className: _("pointer-events-none absolute inset-0", n && "z-20"),
19
+ return r == null || r === !1 ? null : /* @__PURE__ */ _("span", {
20
+ className: y("pointer-events-none absolute inset-0", n && "z-20"),
19
21
  "data-ckui": "card-decorations",
20
22
  children: r
21
23
  });
22
24
  }
23
- var C = (e, t) => new Intl.NumberFormat(t, {
25
+ var T = (e, t) => new Intl.NumberFormat(t, {
24
26
  notation: "compact",
25
27
  maximumFractionDigits: 1
26
28
  }).format(e);
27
- function w(e, t, n = [], r) {
29
+ function E(e, t, n = [], r) {
28
30
  if (t.allowed) return null;
29
31
  if (t.unknown) return e.t("contents.unknownAccess");
30
32
  let i = t.offers?.[0];
31
- if (i) return i.target.kind === "group" && Number(i.terms.amount) === 0 ? e.t("contents.joinFree") : d(e, i.terms);
33
+ if (i) return i.target.kind === "group" && Number(i.terms.amount) === 0 ? e.t("contents.joinFree") : p(e, i.terms);
32
34
  let a = t.sell?.find((e) => n.includes(e));
33
- return a ? u(r, a) : t.sell?.some((e) => e.includes(":group:")) ? e.t("contents.members") : t.sell?.length ? e.t("contents.forSale") : e.t("contents.locked");
35
+ return a ? f(r, a) : t.sell?.some((e) => e.includes(":group:")) ? e.t("contents.members") : t.sell?.length ? e.t("contents.forSale") : e.t("contents.locked");
34
36
  }
35
- function T(e, t) {
36
- let n = p(r)?.navigate;
37
- return f((r) => {
37
+ function D(e, t) {
38
+ let n = h(i)?.navigate;
39
+ return m((r) => {
38
40
  t?.(), !(!n || !e || r.defaultPrevented || r.button !== 0 || r.metaKey || r.ctrlKey || r.shiftKey || r.altKey) && (r.preventDefault(), n(e));
39
41
  }, [
40
42
  n,
@@ -42,263 +44,285 @@ function T(e, t) {
42
44
  t
43
45
  ]);
44
46
  }
45
- function E({ card: r, href: o, onOpen: c, shape: l = "portrait", aspectRatio: d, titlePosition: p = "below", loadMedia: E = !0, groupKinds: k, chips: A = 3, filterEntity: j, entityStyle: M = "chips", metadata: N, showCounts: ee = !0, tiers: P, labels: F, owner: I = !0, ownerHref: L, decorate: R, children: z, className: te }) {
46
- let B = n(), { t: V } = B, ne = t(), H = o ? o(r) : r.path, U = T(H, f(() => c?.(r), [c, r])), W = w(B, r.access, P, F), G = r.version, K = r.viewer && r.viewer.progress_max > 0 ? Math.min(1, r.viewer.progress / r.viewer.progress_max) : 0, q = (k ?? Object.keys(r.entities)).flatMap((e) => (r.entities[e] ?? []).filter((t) => !j || j(t, e)).slice(0, A).map((t) => ({
47
+ function O({ card: i, client: c, href: u, onOpen: d, shape: p = "portrait", aspectRatio: h, titlePosition: O = "below", loadMedia: j = !0, groupKinds: M, chips: ee = 3, filterEntity: N, entityStyle: P = "chips", entityLayout: te = "inline", metadata: F, showCounts: ne = !0, tiers: re, labels: I, owner: ie = !0, ownerHref: ae, decorate: oe, children: se, className: ce }) {
48
+ let L = r(), { presets: le } = a({ client: c }), R = h ?? t(le.find((e) => e.kind === i.kind && e.name === "cover")?.aspect), { t: z } = L, ue = n(), B = u ? u(i) : i.path, V = D(B, m(() => d?.(i), [d, i])), H = E(L, i.access, re, I), U = i.version, W = i.viewer && i.viewer.progress_max > 0 ? Math.min(1, i.viewer.progress / i.viewer.progress_max) : 0, G = (M ?? Object.keys(i.entities)).map((e) => ({
47
49
  kind: e,
48
- entity: t
49
- }))), J = G.duration_ms ? Math.round(G.duration_ms / 6e4) : 0, Y = N?.traits, re = Y === !1 ? [] : Array.isArray(Y) ? G.traits.filter((e) => Y.includes(e)) : G.traits, X = [
50
- ...N?.languages === !1 ? [] : G.languages.map(ne),
51
- ...re.map((e) => u(F, e)),
52
- N?.pages !== !1 && G.pages ? B.plural("contents.pages", G.pages) : null,
53
- N?.duration !== !1 && J ? B.plural("contents.minutes", J) : null
54
- ].filter(Boolean), Z = r.title || r.code, Q = q.length > 0 ? /* @__PURE__ */ h("ul", {
55
- className: _("flex flex-wrap", M === "text" ? "gap-x-2 gap-y-1" : "gap-1"),
50
+ entities: (i.entities[e] ?? []).filter((t) => !N || N(t, e)).slice(0, ee)
51
+ })).filter(({ entities: e }) => e.length > 0), K = U.duration_ms ? Math.round(U.duration_ms / 6e4) : 0, q = F?.traits, J = q === !1 ? [] : Array.isArray(q) ? U.traits.filter((e) => q.includes(e)) : U.traits, Y = [
52
+ ...F?.languages === !1 ? [] : U.languages.map(ue),
53
+ F?.pages !== !1 && U.pages ? L.plural("contents.pages", U.pages) : null,
54
+ F?.duration !== !1 && K ? L.plural("contents.minutes", K) : null
55
+ ].filter(Boolean), X = i.title || i.code, Z = y("flex flex-wrap", P === "text" ? "gap-x-2 gap-y-1" : "gap-1"), Q = (e, t) => t.map((t) => /* @__PURE__ */ _("li", {
56
+ "data-kind": e,
57
+ children: /* @__PURE__ */ _(A, {
58
+ url: t.path,
59
+ name: t.name || t.slug,
60
+ variant: P
61
+ })
62
+ }, `${e}:${t.id}`)), $ = G.length > 0 ? te === "rows" ? /* @__PURE__ */ _("div", {
63
+ className: "grid gap-1",
56
64
  "data-ckui": "card-groups",
57
- children: q.map(({ kind: e, entity: t }) => /* @__PURE__ */ h("li", {
65
+ "data-layout": "rows",
66
+ children: G.map(({ kind: e, entities: t }) => /* @__PURE__ */ _("ul", {
67
+ className: Z,
68
+ "aria-label": f(I, e),
69
+ "data-ckui": "card-group-row",
58
70
  "data-kind": e,
59
- children: /* @__PURE__ */ h(O, {
60
- url: t.path,
61
- name: t.name || t.slug,
62
- variant: M
63
- })
64
- }, `${e}:${t.id}`))
65
- }) : null, $ = /* @__PURE__ */ g("a", {
66
- href: H,
67
- onClick: U,
68
- className: _("font-medium break-words focus-visible:underline", p === "cover" ? "absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/90 via-black/60 to-transparent px-3 pt-10 pb-3 text-white hover:underline" : "hover:underline"),
71
+ children: Q(e, t)
72
+ }, e))
73
+ }) : /* @__PURE__ */ _("ul", {
74
+ className: Z,
75
+ "data-ckui": "card-groups",
76
+ "data-layout": "inline",
77
+ children: G.flatMap(({ kind: e, entities: t }) => Q(e, t))
78
+ }) : null, de = /* @__PURE__ */ v("a", {
79
+ href: B,
80
+ onClick: V,
81
+ className: y("text-lg leading-snug font-medium break-words focus-visible:underline sm:text-xl", O === "cover" ? "absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/90 via-black/60 to-transparent px-3 pt-10 pb-3 text-white hover:underline" : "hover:underline"),
69
82
  "data-ckui": "card-title",
70
- children: [/* @__PURE__ */ h("span", {
83
+ children: [/* @__PURE__ */ _("span", {
71
84
  className: "line-clamp-2",
72
- children: Z
73
- }), W && /* @__PURE__ */ g("span", {
85
+ children: X
86
+ }), H && /* @__PURE__ */ v("span", {
74
87
  className: "sr-only",
75
88
  children: [
76
89
  " (",
77
- W,
90
+ H,
78
91
  ")"
79
92
  ]
80
93
  })]
81
- }), [ie, ae] = m(null);
82
- return /* @__PURE__ */ g("article", {
83
- ref: ae,
84
- className: _("group/card grid content-start gap-2", te),
94
+ }), [fe, pe] = g(null);
95
+ return /* @__PURE__ */ v("article", {
96
+ ref: pe,
97
+ className: y("group/card grid content-start gap-2", ce),
85
98
  "data-ckui": "content-card",
86
- "data-id": r.id,
87
- "data-locked": W ? "" : void 0,
88
- lang: r.language || void 0,
89
- children: [/* @__PURE__ */ g("div", {
99
+ "data-id": i.id,
100
+ "data-locked": H ? "" : void 0,
101
+ lang: i.language || void 0,
102
+ children: [/* @__PURE__ */ v("div", {
90
103
  className: "relative overflow-hidden rounded-lg",
91
104
  "data-ckui": "card-cover",
92
105
  children: [
93
- /* @__PURE__ */ g("a", {
94
- href: H,
95
- onClick: U,
106
+ /* @__PURE__ */ v("a", {
107
+ href: B,
108
+ onClick: V,
96
109
  className: "relative block overflow-hidden rounded-lg bg-muted",
97
110
  tabIndex: -1,
98
111
  "aria-hidden": !0,
99
112
  children: [
100
- /* @__PURE__ */ h("div", {
113
+ /* @__PURE__ */ _("div", {
101
114
  "data-ckui": "card-cover-frame",
102
- className: d === void 0 ? l === "landscape" ? "aspect-video" : "aspect-[3/4]" : void 0,
103
- style: d === void 0 ? void 0 : { aspectRatio: d },
104
- children: E ? /* @__PURE__ */ h(e, {
105
- outputs: r.cover,
115
+ className: R === void 0 ? p === "landscape" ? "aspect-video" : "aspect-[3/4]" : void 0,
116
+ style: R === void 0 ? void 0 : { aspectRatio: R },
117
+ children: j ? /* @__PURE__ */ _(e, {
118
+ outputs: i.cover,
106
119
  alt: "",
107
120
  fit: "cover",
108
121
  skeleton: !0,
109
122
  loading: "lazy",
110
123
  className: "size-full transition-transform group-hover/card:scale-[1.02]",
111
- fallback: /* @__PURE__ */ h("span", {
124
+ fallback: /* @__PURE__ */ _("span", {
112
125
  className: "grid size-full place-items-center text-2xl font-semibold text-muted-foreground",
113
- children: Z.charAt(0).toUpperCase()
126
+ children: X.charAt(0).toUpperCase()
114
127
  })
115
- }) : /* @__PURE__ */ h("span", {
128
+ }) : /* @__PURE__ */ _("span", {
116
129
  className: "block size-full bg-muted",
117
130
  "aria-hidden": !0
118
131
  })
119
132
  }),
120
- E && G.hls && /* @__PURE__ */ h(i, {
133
+ j && U.hls && /* @__PURE__ */ _(o, {
121
134
  item: {
122
- kind: r.kind,
123
- id: r.id,
124
- version: G.id
135
+ kind: i.kind,
136
+ id: i.id,
137
+ version: U.id
125
138
  },
126
- dir: G.hls,
127
- duration: G.duration_ms ? G.duration_ms / 1e3 : void 0,
128
- target: ie
139
+ dir: U.hls,
140
+ duration: U.duration_ms ? U.duration_ms / 1e3 : void 0,
141
+ target: fe
129
142
  }),
130
- W && /* @__PURE__ */ g("span", {
143
+ H && /* @__PURE__ */ v("span", {
131
144
  className: "absolute top-2 left-2 inline-flex items-center gap-1 rounded-md bg-background/85 px-1.5 py-0.5 text-xs font-medium text-foreground shadow-sm",
132
145
  "data-ckui": "card-lock",
133
- children: [/* @__PURE__ */ h(x, {
134
- icon: y,
146
+ children: [/* @__PURE__ */ _(C, {
147
+ icon: x,
135
148
  strokeWidth: 2,
136
149
  className: "size-3.5",
137
150
  "aria-hidden": !0
138
- }), W]
151
+ }), H]
139
152
  }),
140
- K > 0 && /* @__PURE__ */ h("span", {
141
- className: _("absolute inset-x-0 bottom-0 h-1 bg-background/60", p === "cover" && "z-20"),
153
+ W > 0 && /* @__PURE__ */ _("span", {
154
+ className: y("absolute inset-x-0 bottom-0 h-1 bg-background/60", O === "cover" && "z-20"),
142
155
  "data-ckui": "card-progress",
143
- children: /* @__PURE__ */ h("span", {
156
+ children: /* @__PURE__ */ _("span", {
144
157
  className: "block h-full bg-primary",
145
- style: { width: `${Math.round(K * 100)}%` }
158
+ style: { width: `${Math.round(W * 100)}%` }
146
159
  })
147
160
  })
148
161
  ]
149
162
  }),
150
- p === "cover" && $,
151
- E && /* @__PURE__ */ h(S, {
152
- card: r,
153
- decorate: R,
154
- aboveTitle: p === "cover"
163
+ O === "cover" && de,
164
+ j && /* @__PURE__ */ _(w, {
165
+ card: i,
166
+ decorate: oe,
167
+ aboveTitle: O === "cover"
155
168
  })
156
169
  ]
157
- }), /* @__PURE__ */ g("div", {
170
+ }), /* @__PURE__ */ v("div", {
158
171
  className: "grid gap-1",
159
172
  children: [
160
- p === "below" && $,
161
- M === "text" && Q,
162
- I && r.owner && /* @__PURE__ */ h(D, {
163
- group: r.owner,
164
- href: L,
165
- loadMedia: E
173
+ O === "below" && de,
174
+ P === "text" && $,
175
+ ie && i.owner && /* @__PURE__ */ _(k, {
176
+ group: i.owner,
177
+ href: ae,
178
+ loadMedia: j
179
+ }),
180
+ J.length > 0 && /* @__PURE__ */ _("div", {
181
+ className: "flex flex-wrap gap-1",
182
+ "data-ckui": "card-traits",
183
+ children: J.map((e) => /* @__PURE__ */ _(s, {
184
+ variant: "outline",
185
+ className: "h-auto rounded-md text-sm text-muted-foreground",
186
+ "data-ckui": "card-trait",
187
+ "data-trait": e,
188
+ children: f(I, e)
189
+ }, e))
166
190
  }),
167
- X.length > 0 && /* @__PURE__ */ h("p", {
191
+ Y.length > 0 && /* @__PURE__ */ _("p", {
168
192
  className: "text-xs text-muted-foreground",
169
- children: X.join(" · ")
193
+ children: Y.join(" · ")
170
194
  }),
171
- r.viewer?.completed && /* @__PURE__ */ h(a, {
195
+ i.viewer?.completed && /* @__PURE__ */ _(s, {
172
196
  variant: "secondary",
173
197
  className: "justify-self-start",
174
- children: V("contents.completed")
198
+ children: z("contents.completed")
175
199
  }),
176
- !r.access.allowed && r.access.free_after && /* @__PURE__ */ h("p", {
200
+ !i.access.allowed && i.access.free_after && /* @__PURE__ */ _("p", {
177
201
  className: "text-xs text-muted-foreground",
178
- children: V("contents.freeFrom", { date: s(B, r.access.free_after, !1) })
202
+ children: z("contents.freeFrom", { date: l(L, i.access.free_after, !1) })
179
203
  }),
180
- M === "chips" && Q,
181
- ee && (r.counts.favorites !== void 0 || r.counts.likes !== void 0) && /* @__PURE__ */ g("p", {
204
+ P === "chips" && $,
205
+ ne && (i.counts.favorites !== void 0 || i.counts.likes !== void 0) && /* @__PURE__ */ v("p", {
182
206
  className: "flex items-center gap-3 text-xs text-muted-foreground tabular-nums",
183
207
  "data-ckui": "card-counts",
184
- children: [r.counts.favorites !== void 0 && /* @__PURE__ */ g("span", {
208
+ children: [i.counts.favorites !== void 0 && /* @__PURE__ */ v("span", {
185
209
  className: "inline-flex items-center gap-1",
186
- title: V("contents.favorites"),
210
+ title: z("contents.favorites"),
187
211
  children: [
188
- /* @__PURE__ */ h(x, {
189
- icon: v,
212
+ /* @__PURE__ */ _(C, {
213
+ icon: b,
190
214
  strokeWidth: 2,
191
- className: _("size-3.5", r.viewer?.favorited && "fill-current text-primary"),
215
+ className: y("size-3.5", i.viewer?.favorited && "fill-current text-primary"),
192
216
  "aria-hidden": !0
193
217
  }),
194
- /* @__PURE__ */ h("span", {
218
+ /* @__PURE__ */ _("span", {
195
219
  className: "sr-only",
196
- children: V("contents.favorites")
220
+ children: z("contents.favorites")
197
221
  }),
198
- C(r.counts.favorites, B.language)
222
+ T(i.counts.favorites, L.language)
199
223
  ]
200
- }), r.counts.likes !== void 0 && /* @__PURE__ */ g("span", {
224
+ }), i.counts.likes !== void 0 && /* @__PURE__ */ v("span", {
201
225
  className: "inline-flex items-center gap-1",
202
- title: V("contents.likes"),
226
+ title: z("contents.likes"),
203
227
  children: [
204
- /* @__PURE__ */ h(x, {
205
- icon: b,
228
+ /* @__PURE__ */ _(C, {
229
+ icon: S,
206
230
  strokeWidth: 2,
207
231
  className: "size-3.5",
208
232
  "aria-hidden": !0
209
233
  }),
210
- /* @__PURE__ */ h("span", {
234
+ /* @__PURE__ */ _("span", {
211
235
  className: "sr-only",
212
- children: V("contents.likes")
236
+ children: z("contents.likes")
213
237
  }),
214
- C(r.counts.likes, B.language)
238
+ T(i.counts.likes, L.language)
215
239
  ]
216
240
  })]
217
241
  }),
218
- z
242
+ se
219
243
  ]
220
244
  })]
221
245
  });
222
246
  }
223
- function D({ group: e, href: t, className: n, loadMedia: r = !0 }) {
224
- return /* @__PURE__ */ h("span", {
225
- className: _("flex min-w-0 text-xs text-muted-foreground", n),
247
+ function k({ group: e, href: t, className: n, loadMedia: r = !0 }) {
248
+ return /* @__PURE__ */ _("span", {
249
+ className: y("flex min-w-0 text-xs text-muted-foreground", n),
226
250
  "data-ckui": "card-owner",
227
251
  "data-id": e.id,
228
- children: /* @__PURE__ */ g(l, {
252
+ children: /* @__PURE__ */ v(d, {
229
253
  group: e,
230
254
  href: t,
231
255
  className: "inline-flex min-w-0 items-center gap-1.5 hover:text-foreground",
232
- children: [r ? /* @__PURE__ */ h(c, {
256
+ children: [r ? /* @__PURE__ */ _(u, {
233
257
  group: e,
234
258
  className: "size-5 shrink-0 text-[0.625rem]"
235
- }) : /* @__PURE__ */ h("span", {
259
+ }) : /* @__PURE__ */ _("span", {
236
260
  className: "size-5 shrink-0 rounded-full bg-muted",
237
261
  "aria-hidden": !0
238
- }), /* @__PURE__ */ h("span", {
262
+ }), /* @__PURE__ */ _("span", {
239
263
  className: "truncate",
240
264
  children: e.name || e.slug
241
265
  })]
242
266
  })
243
267
  });
244
268
  }
245
- function O({ url: e, name: t, variant: n = "chips" }) {
246
- let r = T(e), i = n === "text" ? "text-sm text-muted-foreground" : "inline-block rounded-md border border-border px-1.5 py-0.5 text-xs text-muted-foreground";
247
- return e ? /* @__PURE__ */ h("a", {
269
+ function A({ url: e, name: t, variant: n = "chips" }) {
270
+ let r = D(e), i = n === "text" ? "text-sm text-muted-foreground" : "inline-block rounded-md border border-border px-1.5 py-0.5 text-sm text-muted-foreground";
271
+ return e ? /* @__PURE__ */ _("a", {
248
272
  href: e,
249
273
  onClick: r,
250
- className: _(i, "hover:text-foreground", n === "text" ? "hover:underline" : "hover:bg-muted"),
274
+ className: y(i, "hover:text-foreground", n === "text" ? "hover:underline" : "hover:bg-muted"),
251
275
  children: t
252
- }) : /* @__PURE__ */ h("span", {
276
+ }) : /* @__PURE__ */ _("span", {
253
277
  className: i,
254
278
  children: t
255
279
  });
256
280
  }
257
- function k({ card: t, href: r, onOpen: i, tiers: a, labels: s, byline: c, owner: l = !0, ownerHref: u, loadMedia: d = !0, showCounts: p = !0, decorate: m, children: b, className: E }) {
258
- let O = n(), k = r ? r(t) : t.path, A = T(k, f(() => i?.(t), [i, t])), j = w(O, t.access, a, s), M = t.title || t.code;
259
- return /* @__PURE__ */ g("article", {
260
- className: _("grid gap-3 rounded-lg border border-border p-3", E),
281
+ function j({ card: t, href: n, onOpen: i, tiers: a, labels: o, byline: s, owner: l = !0, ownerHref: u, loadMedia: d = !0, showCounts: f = !0, decorate: p, children: h, className: g }) {
282
+ let S = r(), O = n ? n(t) : t.path, A = D(O, m(() => i?.(t), [i, t])), j = E(S, t.access, a, o), M = t.title || t.code;
283
+ return /* @__PURE__ */ v("article", {
284
+ className: y("grid gap-3 rounded-lg border border-border p-3", g),
261
285
  "data-ckui": "post-card",
262
286
  "data-id": t.id,
263
287
  "data-locked": j ? "" : void 0,
264
288
  lang: t.language || void 0,
265
289
  children: [
266
- c ?? (l && t.owner && /* @__PURE__ */ h(D, {
290
+ s ?? (l && t.owner && /* @__PURE__ */ _(k, {
267
291
  group: t.owner,
268
292
  href: u,
269
293
  loadMedia: d,
270
294
  className: "text-sm"
271
295
  })),
272
- /* @__PURE__ */ g("a", {
273
- href: k,
296
+ /* @__PURE__ */ v("a", {
297
+ href: O,
274
298
  onClick: A,
275
299
  className: "grid gap-2",
276
- children: [/* @__PURE__ */ h("span", {
300
+ children: [/* @__PURE__ */ _("span", {
277
301
  className: "font-medium break-words hover:underline",
278
302
  "data-ckui": "card-title",
279
303
  children: M
280
- }), t.cover.length > 0 && /* @__PURE__ */ g("span", {
304
+ }), t.cover.length > 0 && /* @__PURE__ */ v("span", {
281
305
  className: "relative block aspect-video overflow-hidden rounded-md bg-muted",
282
306
  children: [
283
- d && /* @__PURE__ */ h(e, {
307
+ d && /* @__PURE__ */ _(e, {
284
308
  outputs: t.cover,
285
309
  alt: "",
286
310
  fit: "cover",
287
311
  skeleton: !0,
288
312
  loading: "lazy",
289
- className: _("size-full", j && "blur-md")
313
+ className: y("size-full", j && "blur-md")
290
314
  }),
291
- d && /* @__PURE__ */ h(S, {
315
+ d && /* @__PURE__ */ _(w, {
292
316
  card: t,
293
- decorate: m
317
+ decorate: p
294
318
  }),
295
- j && /* @__PURE__ */ h("span", {
319
+ j && /* @__PURE__ */ _("span", {
296
320
  className: "absolute inset-0 grid place-items-center",
297
- children: /* @__PURE__ */ g("span", {
321
+ children: /* @__PURE__ */ v("span", {
298
322
  className: "inline-flex items-center gap-1 rounded-md bg-background/85 px-2 py-1 text-xs font-medium shadow-sm",
299
323
  "data-ckui": "card-lock",
300
- children: [/* @__PURE__ */ h(x, {
301
- icon: y,
324
+ children: [/* @__PURE__ */ _(C, {
325
+ icon: x,
302
326
  strokeWidth: 2,
303
327
  className: "size-3.5",
304
328
  "aria-hidden": !0
@@ -308,38 +332,38 @@ function k({ card: t, href: r, onOpen: i, tiers: a, labels: s, byline: c, owner:
308
332
  ]
309
333
  })]
310
334
  }),
311
- /* @__PURE__ */ g("p", {
335
+ /* @__PURE__ */ v("p", {
312
336
  className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground",
313
337
  children: [
314
- t.published_at && /* @__PURE__ */ h(o, { at: t.published_at }),
315
- !t.cover.length && j && /* @__PURE__ */ h("span", {
338
+ t.published_at && /* @__PURE__ */ _(c, { at: t.published_at }),
339
+ !t.cover.length && j && /* @__PURE__ */ _("span", {
316
340
  "data-ckui": "card-lock",
317
341
  children: j
318
342
  }),
319
- p && t.counts.favorites !== void 0 && /* @__PURE__ */ g("span", {
343
+ f && t.counts.favorites !== void 0 && /* @__PURE__ */ v("span", {
320
344
  className: "inline-flex items-center gap-1 tabular-nums",
321
345
  "data-ckui": "card-counts",
322
346
  children: [
323
- /* @__PURE__ */ h(x, {
324
- icon: v,
347
+ /* @__PURE__ */ _(C, {
348
+ icon: b,
325
349
  strokeWidth: 2,
326
- className: _("size-3.5", t.viewer?.favorited && "fill-current text-primary"),
350
+ className: y("size-3.5", t.viewer?.favorited && "fill-current text-primary"),
327
351
  "aria-hidden": !0
328
352
  }),
329
- /* @__PURE__ */ h("span", {
353
+ /* @__PURE__ */ _("span", {
330
354
  className: "sr-only",
331
- children: O.t("contents.favorites")
355
+ children: S.t("contents.favorites")
332
356
  }),
333
- C(t.counts.favorites, O.language)
357
+ T(t.counts.favorites, S.language)
334
358
  ]
335
359
  })
336
360
  ]
337
361
  }),
338
- b
362
+ h
339
363
  ]
340
364
  });
341
365
  }
342
366
  //#endregion
343
- export { E as ContentCard, D as OwnerChip, k as PostCard, w as lockLabel };
367
+ export { O as ContentCard, k as OwnerChip, j as PostCard, E as lockLabel };
344
368
 
345
369
  //# sourceMappingURL=card.js.map