@wexio/messenger-widget-react 1.2.4 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/README.md +15 -1
  3. package/dist/{widget-react-DubCiNev.js → widget-react--IUy5lNt.js} +21 -20
  4. package/dist/{widget-react-CIy9jXND.js → widget-react-B7es3n1-.js} +1 -1
  5. package/dist/{widget-react-2tTH7-bO.js → widget-react-BAUpSGhZ.js} +1 -1
  6. package/dist/{widget-react-CtvdaJvy.js → widget-react-BXf2Ty8d.js} +4 -4
  7. package/dist/{widget-react-AwEaD0v2.js → widget-react-BZ-SHa2o.js} +169 -273
  8. package/dist/{widget-react-faSyVXFQ.js → widget-react-BgALABDe.js} +1 -1
  9. package/dist/{widget-react-DXP6EOCM.js → widget-react-BkXA6ytR.js} +1 -1
  10. package/dist/{widget-react-DV3UnggB.js → widget-react-CHSNuztJ.js} +137 -226
  11. package/dist/widget-react-CN_FIvMD.js +834 -0
  12. package/dist/widget-react-CuphoFsN.js +229 -0
  13. package/dist/{widget-react-DNFROpaS.js → widget-react-D8Z8cGhJ.js} +40 -48
  14. package/dist/{widget-react-B9X7Tn7t.js → widget-react-DSUX0aJn.js} +42 -50
  15. package/dist/{widget-react-CAsPo1rw.js → widget-react-DWgRcZF7.js} +127 -127
  16. package/dist/{widget-react-B9XrHKqv.js → widget-react-DbOJZl9F.js} +1238 -2052
  17. package/dist/{widget-react-BlTmXnei.js → widget-react-DgIxSjv7.js} +1 -1
  18. package/dist/widget-react-Ds5J9FbQ.js +27 -0
  19. package/dist/{widget-react-CK8xTxwO.js → widget-react-Dtx_fW3V.js} +4895 -4454
  20. package/dist/{widget-react-B8rXZyxg.js → widget-react-SI7deQTE.js} +1 -1
  21. package/dist/{widget-react-yTVzOzaU.js → widget-react-l5oryxYk.js} +87 -87
  22. package/dist/{widget-react-DDEFbIbU.js → widget-react-vXfa9GKf.js} +95 -117
  23. package/dist/widget-react-wSc9gIfG.js +198 -0
  24. package/dist/widget-react.d.ts +2 -2
  25. package/dist/widget-react.js +9370 -4672
  26. package/package.json +1 -1
@@ -11,13 +11,14 @@ import "react";
11
11
  import "react-dom";
12
12
  import "react/jsx-runtime";
13
13
  import "react-dom/client";
14
- import { c as e, d as t } from "./widget-react-B9XrHKqv.js";
15
- import { N as n, at as r, b as i, j as a, l as o, ot as s, x as c } from "./widget-react-CK8xTxwO.js";
16
- import { i as l, n as u, o as d, t as f } from "./widget-react-krPPnv02.js";
17
- import { useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
18
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
14
+ import { t as e } from "./widget-react-DbOJZl9F.js";
15
+ import { F as t, M as n, S as r, St as i, dt as a, l as o, rt as s, u as c, x as l, xt as u } from "./widget-react-Dtx_fW3V.js";
16
+ import { i as d, n as f, o as ee, t as p } from "./widget-react-krPPnv02.js";
17
+ import { c as m } from "./widget-react-CN_FIvMD.js";
18
+ import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
19
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
19
20
  //#region lib/graphql/queries/generated/news.generated.tsx
20
- var x = {}, S = s`
21
+ var C = {}, w = i`
21
22
  query VisitorNewsList($args: VisitorNewsListArgs) {
22
23
  visitorNewsList(args: $args) {
23
24
  items {
@@ -62,13 +63,13 @@ var x = {}, S = s`
62
63
  }
63
64
  }
64
65
  `;
65
- function C(e) {
66
- return r(S, {
67
- ...x,
66
+ function T(e) {
67
+ return u(w, {
68
+ ...C,
68
69
  ...e
69
70
  });
70
71
  }
71
- var w = s`
72
+ var E = i`
72
73
  query VisitorNewsPostCard($args: VisitorNewsPostArgs!) {
73
74
  visitorNewsPost(args: $args) {
74
75
  _id
@@ -82,13 +83,13 @@ var w = s`
82
83
  }
83
84
  }
84
85
  `;
85
- function T(e) {
86
- return r(w, {
87
- ...x,
86
+ function D(e) {
87
+ return u(E, {
88
+ ...C,
88
89
  ...e
89
90
  });
90
91
  }
91
- var E = s`
92
+ var O = i`
92
93
  query VisitorNewsPost($args: VisitorNewsPostArgs!) {
93
94
  visitorNewsPost(args: $args) {
94
95
  _id
@@ -140,13 +141,13 @@ var E = s`
140
141
  }
141
142
  }
142
143
  `;
143
- function D(e) {
144
- return r(E, {
145
- ...x,
144
+ function k(e) {
145
+ return u(O, {
146
+ ...C,
146
147
  ...e
147
148
  });
148
149
  }
149
- var O = s`
150
+ var A = i`
150
151
  query VisitorNewsRelated($postId: ID!, $limit: Int, $locale: String) {
151
152
  visitorNewsRelated(postId: $postId, limit: $limit, locale: $locale) {
152
153
  _id
@@ -162,20 +163,20 @@ var O = s`
162
163
  }
163
164
  }
164
165
  `;
165
- function k(e) {
166
- return r(O, {
167
- ...x,
166
+ function j(e) {
167
+ return u(A, {
168
+ ...C,
168
169
  ...e
169
170
  });
170
171
  }
171
- s`
172
+ i`
172
173
  mutation RecordVisitorNewsView($postId: String!) {
173
174
  recordVisitorNewsView(postId: $postId) {
174
175
  ok
175
176
  }
176
177
  }
177
178
  `;
178
- var A = s`
179
+ var M = i`
179
180
  query VisitorNewsListSlim($args: VisitorNewsListArgs) {
180
181
  visitorNewsList(args: $args) {
181
182
  items {
@@ -185,103 +186,13 @@ var A = s`
185
186
  }
186
187
  }
187
188
  `;
188
- function j(e) {
189
- return r(A, {
190
- ...x,
189
+ function N(e) {
190
+ return u(M, {
191
+ ...C,
191
192
  ...e
192
193
  });
193
194
  }
194
- //#endregion
195
- //#region dummy/news.ts
196
- var M = [
197
- {
198
- id: "demo-news-1",
199
- publishedAt: "2026-04-30T10:00:00.000Z",
200
- coverGradient: ["#1e1f21", "#121314"],
201
- coverImageUrl: "https://picsum.photos/seed/wexio-pioneer/960/600",
202
- authorIds: ["maya", "sam"],
203
- categorySlug: "company",
204
- tagSlugs: ["events", "product"]
205
- },
206
- {
207
- id: "demo-news-2",
208
- publishedAt: "2026-04-15T10:00:00.000Z",
209
- coverGradient: ["#1e3a8a", "#0c1e4a"],
210
- coverImageUrl: "https://picsum.photos/seed/wexio-april/960/600",
211
- authorIds: ["leo"],
212
- categorySlug: "product",
213
- tagSlugs: ["product", "release"]
214
- },
215
- {
216
- id: "demo-news-3",
217
- publishedAt: "2026-03-22T10:00:00.000Z",
218
- coverGradient: ["#0f766e", "#042f2e"],
219
- coverImageUrl: "https://picsum.photos/seed/wexio-langs/960/600",
220
- authorIds: ["ira", "leo"],
221
- categorySlug: "product",
222
- tagSlugs: ["ai", "languages"]
223
- },
224
- {
225
- id: "demo-news-4",
226
- publishedAt: "2026-03-08T10:00:00.000Z",
227
- coverGradient: ["#7c3aed", "#2e1065"],
228
- authorIds: ["leo"],
229
- categorySlug: "engineering",
230
- tagSlugs: ["integrations", "slack"]
231
- },
232
- {
233
- id: "demo-news-5",
234
- publishedAt: "2026-02-18T10:00:00.000Z",
235
- coverGradient: ["#b45309", "#451a03"],
236
- coverImageUrl: "https://picsum.photos/seed/wexio-inbox2/960/600",
237
- authorIds: ["maya"],
238
- categorySlug: "product",
239
- tagSlugs: ["inbox", "product"]
240
- },
241
- {
242
- id: "demo-news-6",
243
- publishedAt: "2026-02-02T10:00:00.000Z",
244
- coverGradient: ["#155e75", "#083344"],
245
- authorIds: ["sam"],
246
- categorySlug: "engineering",
247
- tagSlugs: ["privacy", "security"]
248
- },
249
- {
250
- id: "demo-news-7",
251
- publishedAt: "2026-01-20T10:00:00.000Z",
252
- coverGradient: ["#be185d", "#500724"],
253
- coverImageUrl: "https://picsum.photos/seed/wexio-mobile/960/600",
254
- authorIds: ["ira"],
255
- categorySlug: "product",
256
- tagSlugs: ["mobile", "beta"]
257
- },
258
- {
259
- id: "demo-news-8",
260
- publishedAt: "2026-01-05T10:00:00.000Z",
261
- coverGradient: ["#15803d", "#052e16"],
262
- authorIds: ["maya", "leo"],
263
- categorySlug: "engineering",
264
- tagSlugs: ["ai", "analytics"]
265
- }
266
- ];
267
- function N(e) {
268
- return M.map(({ tagSlugs: t, authorIds: n, categorySlug: r, ...i }) => ({
269
- ...i,
270
- title: e.raw(`news.${i.id}.title`),
271
- excerpt: e.raw(`news.${i.id}.excerpt`),
272
- contentMarkdown: e.raw(`news.${i.id}.body`),
273
- authors: a(n),
274
- category: {
275
- slug: r,
276
- label: e.raw(`news.categories.${r}`)
277
- },
278
- tags: t.map((t) => ({
279
- slug: t,
280
- label: e.raw(`news.tags.${t}`)
281
- }))
282
- }));
283
- }
284
- var P = f("megaphone", [
195
+ var P = p("megaphone", [
285
196
  ["path", {
286
197
  d: "M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",
287
198
  key: "q8bfy3"
@@ -298,20 +209,20 @@ var P = f("megaphone", [
298
209
  //#endregion
299
210
  //#region components/ui/icon.tsx
300
211
  function F({ icon: e, size: t = 20, strokeWidth: n = 2, className: r, ...i }) {
301
- return /* @__PURE__ */ y(e, {
212
+ return /* @__PURE__ */ x(e, {
302
213
  width: t,
303
214
  height: t,
304
215
  strokeWidth: n,
305
- className: u("shrink-0", r),
216
+ className: f("shrink-0", r),
306
217
  ...i
307
218
  });
308
219
  }
309
220
  //#endregion
310
221
  //#region components/ui/skeleton.tsx
311
222
  function I({ className: e, ...t }) {
312
- return /* @__PURE__ */ y("div", {
223
+ return /* @__PURE__ */ x("div", {
313
224
  "data-slot": "skeleton",
314
- className: u("animate-pulse rounded-wx-sm bg-wx-bg-elevated", e),
225
+ className: f("animate-pulse rounded-wx-sm bg-wx-bg-elevated", e),
315
226
  ...t
316
227
  });
317
228
  }
@@ -333,14 +244,14 @@ function L(e) {
333
244
  return t.length > 0 ? t : void 0;
334
245
  }
335
246
  function R({ authors: e, max: t = 3, className: n }) {
336
- return !e || e.length === 0 ? null : /* @__PURE__ */ y("span", {
247
+ return !e || e.length === 0 ? null : /* @__PURE__ */ x("span", {
337
248
  className: `flex items-center -space-x-1.5 ${n ?? ""}`,
338
- children: e.slice(0, t).map((e) => e.photoUrl ? /* @__PURE__ */ y("img", {
249
+ children: e.slice(0, t).map((e) => e.photoUrl ? /* @__PURE__ */ x("img", {
339
250
  src: e.photoUrl,
340
251
  alt: e.name,
341
252
  title: e.name,
342
253
  className: "h-5 w-5 rounded-full border border-wx-bg object-cover"
343
- }, e.id) : /* @__PURE__ */ y("span", {
254
+ }, e.id) : /* @__PURE__ */ x("span", {
344
255
  title: e.name,
345
256
  className: "flex h-5 w-5 items-center justify-center rounded-full border border-wx-bg bg-wx-bg-elevated-2 text-[9px] font-semibold text-wx-fg-muted",
346
257
  children: e.name.charAt(0).toUpperCase()
@@ -349,18 +260,18 @@ function R({ authors: e, max: t = 3, className: n }) {
349
260
  }
350
261
  //#endregion
351
262
  //#region components/widget/sticky-search-header.tsx
352
- function z({ value: t, onChange: n, placeholder: r, className: i }) {
353
- return /* @__PURE__ */ b("div", {
354
- className: u("sticky top-0 z-10 flex items-center gap-2.5 border-wx-border border-b bg-wx-bg px-4", i),
355
- children: [/* @__PURE__ */ y(e, {
263
+ function z({ value: e, onChange: t, placeholder: n, className: r }) {
264
+ return /* @__PURE__ */ S("div", {
265
+ className: f("sticky top-0 z-10 flex items-center gap-2.5 border-wx-border border-b bg-wx-bg px-4", r),
266
+ children: [/* @__PURE__ */ x(m, {
356
267
  size: 16,
357
268
  className: "shrink-0 text-wx-fg-muted"
358
- }), /* @__PURE__ */ y("input", {
269
+ }), /* @__PURE__ */ x("input", {
359
270
  type: "search",
360
- value: t,
361
- onChange: (e) => n(e.target.value),
362
- placeholder: r,
363
- className: u("block w-full min-w-0 flex-1 border-0 bg-transparent py-3 text-sm text-wx-fg", "placeholder:text-wx-fg-muted focus:outline-none focus:ring-0", "[&::-webkit-search-cancel-button]:appearance-none")
271
+ value: e,
272
+ onChange: (e) => t(e.target.value),
273
+ placeholder: n,
274
+ className: f("block w-full min-w-0 flex-1 border-0 bg-transparent py-3 text-sm text-wx-fg", "placeholder:text-wx-fg-muted focus:outline-none focus:ring-0", "[&::-webkit-search-cancel-button]:appearance-none")
364
275
  })]
365
276
  });
366
277
  }
@@ -368,8 +279,8 @@ function z({ value: t, onChange: n, placeholder: r, className: i }) {
368
279
  //#region lib/use-scroll-restore.ts
369
280
  var B = /* @__PURE__ */ new Map();
370
281
  function V(e) {
371
- let t = g(null);
372
- return m(() => {
282
+ let t = v(null);
283
+ return g(() => {
373
284
  let n = t.current;
374
285
  if (!n) return;
375
286
  let r = B.get(e) ?? 0, i = !1, a = performance.now(), o = () => {
@@ -415,40 +326,40 @@ function U(e) {
415
326
  //#endregion
416
327
  //#region components/widget/tabs/news-tab/index.tsx
417
328
  var W = 10, G = 240;
418
- function K({ isDummy: e, onOpenArticle: t }) {
419
- let r = l("news"), i = l("demo"), a = d(), s = n(), [c, u] = _(""), f = J(c, 300), g = f.length >= 2, x = s.previewData?.newsPosts, S = !e && Array.isArray(x) && x.length > 0, [w, T] = _(W), { data: E, error: D, loading: O, fetchMore: k } = C({
329
+ function K({ isDummy: e, onOpenArticle: r }) {
330
+ let i = d("news"), l = d("demo"), u = ee(), f = n(), [p, m] = y(""), v = J(p, 300), C = v.length >= 2, w = f.previewData?.newsPosts, E = !e && Array.isArray(w) && w.length > 0, [D, O] = y(W), { data: k, error: A, loading: j, fetchMore: M } = T({
420
331
  variables: { args: {
421
- locale: a,
332
+ locale: u,
422
333
  limit: W,
423
334
  offset: 0,
424
- ...g ? { query: f } : {}
335
+ ...C ? { query: v } : {}
425
336
  } },
426
- skip: e || S,
337
+ skip: e || E,
427
338
  notifyOnNetworkStatusChange: !0
428
339
  });
429
- m(() => {
430
- T(W);
431
- }, [f, S]);
432
- let A = h(() => (E?.visitorNewsList.items ?? []).filter((e) => !!e).map(q), [E]), j = S ? (x ?? []).filter((e) => !!e && typeof e == "object").map(q) : [], M = p((e) => e.title.toLowerCase().includes(f.toLowerCase()) || e.excerpt.toLowerCase().includes(f.toLowerCase()), [f]), L = e ? g ? N(i).filter(M) : N(i) : S ? g ? j.filter(M) : j : A, R = S || e ? L.slice(0, w) : L, B = h(() => e || S ? w < L.length : E?.visitorNewsList.meta.hasNextPage ?? !1, [
340
+ g(() => {
341
+ O(W);
342
+ }, [v, E]);
343
+ let N = s(), L = o(N && !e && !C ? t.news(N, u) : null, k), R = _(() => (L?.visitorNewsList.items ?? []).filter((e) => !!e).map(q), [L]), B = E ? (w ?? []).filter((e) => !!e && typeof e == "object").map(q) : [], H = h((e) => e.title.toLowerCase().includes(v.toLowerCase()) || e.excerpt.toLowerCase().includes(v.toLowerCase()), [v]), U = e ? C ? a(l).filter(H) : a(l) : E ? C ? B.filter(H) : B : R, K = E || e ? U.slice(0, D) : U, X = _(() => e || E ? D < U.length : L?.visitorNewsList.meta.hasNextPage ?? !1, [
433
344
  e,
434
- S,
435
- w,
436
- L.length,
437
- E
438
- ]), [H, U] = _(!1), K = p(async () => {
439
- if (!(!B || H)) {
440
- if (e || S) {
441
- T((e) => e + W);
345
+ E,
346
+ D,
347
+ U.length,
348
+ L
349
+ ]), [Z, Q] = y(!1), $ = h(async () => {
350
+ if (!(!X || Z)) {
351
+ if (e || E) {
352
+ O((e) => e + W);
442
353
  return;
443
354
  }
444
- U(!0);
355
+ Q(!0);
445
356
  try {
446
- await k({
357
+ await M({
447
358
  variables: { args: {
448
- locale: a,
359
+ locale: u,
449
360
  limit: W,
450
- offset: E?.visitorNewsList.items.length ?? 0,
451
- ...g ? { query: f } : {}
361
+ offset: k?.visitorNewsList.items.length ?? 0,
362
+ ...C ? { query: v } : {}
452
363
  } },
453
364
  updateQuery: (e, { fetchMoreResult: t }) => {
454
365
  if (!t) return e;
@@ -464,76 +375,76 @@ function K({ isDummy: e, onOpenArticle: t }) {
464
375
  }
465
376
  });
466
377
  } finally {
467
- U(!1);
378
+ Q(!1);
468
379
  }
469
380
  }
470
381
  }, [
471
- B,
472
- H,
382
+ X,
383
+ Z,
473
384
  e,
474
- S,
475
- g,
476
- f,
477
- a,
478
- k,
479
- E
480
- ]), X = V("news"), Z = p((e) => {
385
+ E,
386
+ C,
387
+ v,
388
+ u,
389
+ M,
390
+ k
391
+ ]), te = V("news"), ne = h((e) => {
481
392
  let t = e.currentTarget;
482
- t.scrollHeight - t.clientHeight - t.scrollTop < G && K();
483
- }, [K]), Q = L.length > 0 || g, $ = !e && !S && O && R.length === 0;
484
- return D && R.length === 0 ? /* @__PURE__ */ y("div", {
393
+ t.scrollHeight - t.clientHeight - t.scrollTop < G && $();
394
+ }, [$]), re = U.length > 0 || C, ie = !e && !E && j && K.length === 0;
395
+ return A && K.length === 0 ? /* @__PURE__ */ x("div", {
485
396
  className: "flex flex-1 flex-col items-center justify-center gap-3 px-6 py-12 text-center",
486
- children: /* @__PURE__ */ y("p", {
397
+ children: /* @__PURE__ */ x("p", {
487
398
  className: "text-sm text-wx-fg-muted",
488
- children: r("emptyTitle")
399
+ children: i("emptyTitle")
489
400
  })
490
- }) : /* @__PURE__ */ b(o, {
401
+ }) : /* @__PURE__ */ S(c, {
491
402
  className: "flex-1",
492
- viewportRef: X,
493
- onScroll: Z,
494
- children: [Q && /* @__PURE__ */ y(z, {
495
- value: c,
496
- onChange: u,
497
- placeholder: r("searchPlaceholder")
498
- }), /* @__PURE__ */ y("div", {
403
+ viewportRef: te,
404
+ onScroll: ne,
405
+ children: [re && /* @__PURE__ */ x(z, {
406
+ value: p,
407
+ onChange: m,
408
+ placeholder: i("searchPlaceholder")
409
+ }), /* @__PURE__ */ x("div", {
499
410
  className: "flex flex-col gap-3 px-4 pt-4 pb-6",
500
- children: $ ? Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ b("div", {
411
+ children: ie ? Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ S("div", {
501
412
  className: "overflow-hidden rounded-wx-lg bg-wx-bg-elevated",
502
- children: [/* @__PURE__ */ y(I, { className: "aspect-[16/10] w-full rounded-none" }), /* @__PURE__ */ b("div", {
413
+ children: [/* @__PURE__ */ x(I, { className: "aspect-[16/10] w-full rounded-none" }), /* @__PURE__ */ S("div", {
503
414
  className: "space-y-2 px-5 py-4",
504
415
  children: [
505
- /* @__PURE__ */ y(I, { className: "h-3 w-3/4" }),
506
- /* @__PURE__ */ y(I, { className: "h-3 w-1/2" }),
507
- /* @__PURE__ */ y(I, { className: "mt-1 h-2 w-1/3" })
416
+ /* @__PURE__ */ x(I, { className: "h-3 w-3/4" }),
417
+ /* @__PURE__ */ x(I, { className: "h-3 w-1/2" }),
418
+ /* @__PURE__ */ x(I, { className: "mt-1 h-2 w-1/3" })
508
419
  ]
509
420
  })]
510
- }, t)) : R.length === 0 ? /* @__PURE__ */ b("div", {
421
+ }, t)) : K.length === 0 ? /* @__PURE__ */ S("div", {
511
422
  className: "flex flex-1 flex-col items-center justify-center gap-3 px-6 py-12 text-center",
512
423
  children: [
513
- /* @__PURE__ */ y("div", {
424
+ /* @__PURE__ */ x("div", {
514
425
  className: "flex h-14 w-14 items-center justify-center rounded-full bg-wx-bg-elevated text-wx-fg-muted",
515
- children: /* @__PURE__ */ y(F, {
426
+ children: /* @__PURE__ */ x(F, {
516
427
  icon: P,
517
428
  size: 28
518
429
  })
519
430
  }),
520
- /* @__PURE__ */ y("p", {
431
+ /* @__PURE__ */ x("p", {
521
432
  className: "text-base font-semibold text-wx-fg",
522
- children: r(g ? "noResults" : "emptyTitle")
433
+ children: i(C ? "noResults" : "emptyTitle")
523
434
  }),
524
- !g && /* @__PURE__ */ y("p", {
435
+ !C && /* @__PURE__ */ x("p", {
525
436
  className: "text-sm text-wx-fg-muted",
526
- children: r("emptyBody")
437
+ children: i("emptyBody")
527
438
  })
528
439
  ]
529
- }) : /* @__PURE__ */ b(v, { children: [R.map((e, n) => /* @__PURE__ */ y(Y, {
440
+ }) : /* @__PURE__ */ S(b, { children: [K.map((e, t) => /* @__PURE__ */ x(Y, {
530
441
  item: e,
531
- locale: a,
532
- delay: n < W ? n * .04 : 0,
533
- onClick: () => t(e.id)
534
- }, e.id)), H && /* @__PURE__ */ y("div", {
442
+ locale: u,
443
+ delay: t < W ? t * .04 : 0,
444
+ onClick: () => r(e.id)
445
+ }, e.id)), Z && /* @__PURE__ */ x("div", {
535
446
  className: "flex justify-center py-3",
536
- children: /* @__PURE__ */ y(I, { className: "h-3 w-24" })
447
+ children: /* @__PURE__ */ x(I, { className: "h-3 w-24" })
537
448
  })] })
538
449
  })]
539
450
  });
@@ -572,15 +483,15 @@ function q(e, t = 0) {
572
483
  };
573
484
  }
574
485
  function J(e, t) {
575
- let [n, r] = _(e);
576
- return m(() => {
486
+ let [n, r] = y(e);
487
+ return g(() => {
577
488
  let n = setTimeout(() => r(e), t);
578
489
  return () => clearTimeout(n);
579
490
  }, [e, t]), n;
580
491
  }
581
- function Y({ item: e, locale: n, delay: r, onClick: a }) {
582
- let o = l("news"), s = e.categories ?? (e.category ? [e.category] : []), d = L(e.authors);
583
- return /* @__PURE__ */ b(t.button, {
492
+ function Y({ item: t, locale: n, delay: i, onClick: a }) {
493
+ let o = d("news"), s = t.categories ?? (t.category ? [t.category] : []), c = L(t.authors);
494
+ return /* @__PURE__ */ S(e.button, {
584
495
  type: "button",
585
496
  onClick: a,
586
497
  initial: {
@@ -595,52 +506,52 @@ function Y({ item: e, locale: n, delay: r, onClick: a }) {
595
506
  whileTap: { scale: .985 },
596
507
  transition: {
597
508
  duration: .2,
598
- delay: r
509
+ delay: i
599
510
  },
600
- className: u("block w-full shrink-0 overflow-hidden rounded-wx-lg bg-wx-bg-elevated text-left", "transition-colors hover:bg-wx-bg-elevated-2", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-wx-primary focus-visible:ring-offset-2 focus-visible:ring-offset-wx-bg"),
601
- children: [/* @__PURE__ */ y("div", {
511
+ className: f("block w-full shrink-0 overflow-hidden rounded-wx-lg bg-wx-bg-elevated text-left", "transition-colors hover:bg-wx-bg-elevated-2", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-wx-primary focus-visible:ring-offset-2 focus-visible:ring-offset-wx-bg"),
512
+ children: [/* @__PURE__ */ x("div", {
602
513
  className: "aspect-[16/10] w-full bg-cover bg-center",
603
- style: e.coverImageUrl ? { backgroundImage: `url(${e.coverImageUrl})` } : { background: `linear-gradient(135deg, ${e.coverGradient[0]}, ${e.coverGradient[1]})` },
514
+ style: t.coverImageUrl ? { backgroundImage: `url(${t.coverImageUrl})` } : { background: `linear-gradient(135deg, ${t.coverGradient[0]}, ${t.coverGradient[1]})` },
604
515
  "aria-hidden": "true"
605
- }), /* @__PURE__ */ b("div", {
516
+ }), /* @__PURE__ */ S("div", {
606
517
  className: "px-5 py-4",
607
518
  children: [
608
- (s.length > 0 || d != null) && /* @__PURE__ */ b("div", {
519
+ (s.length > 0 || c != null) && /* @__PURE__ */ S("div", {
609
520
  className: "mb-1.5 flex items-center justify-between gap-2",
610
- children: [/* @__PURE__ */ y("div", {
521
+ children: [/* @__PURE__ */ x("div", {
611
522
  className: "flex min-w-0 flex-wrap gap-1.5",
612
- children: s.slice(0, 2).map((e) => /* @__PURE__ */ y("span", {
523
+ children: s.slice(0, 2).map((e) => /* @__PURE__ */ x("span", {
613
524
  className: "text-[10px] font-semibold uppercase tracking-wide text-wx-primary",
614
525
  children: e.label
615
526
  }, e.slug))
616
- }), /* @__PURE__ */ y(R, {
617
- authors: d,
527
+ }), /* @__PURE__ */ x(R, {
528
+ authors: c,
618
529
  className: "shrink-0"
619
530
  })]
620
531
  }),
621
- /* @__PURE__ */ y(c, {
532
+ /* @__PURE__ */ x(r, {
622
533
  className: "text-sm",
623
- children: e.title
534
+ children: t.title
624
535
  }),
625
- e.excerpt && /* @__PURE__ */ y(i, {
536
+ t.excerpt && /* @__PURE__ */ x(l, {
626
537
  className: "mt-1 text-xs",
627
- children: e.excerpt
538
+ children: t.excerpt
628
539
  }),
629
- /* @__PURE__ */ b("p", {
540
+ /* @__PURE__ */ S("p", {
630
541
  className: "mt-2 flex items-center gap-2 text-xs text-wx-fg-subtle",
631
- children: [/* @__PURE__ */ y("span", { children: new Date(e.publishedAt).toLocaleDateString(n, {
542
+ children: [/* @__PURE__ */ x("span", { children: new Date(t.publishedAt).toLocaleDateString(n, {
632
543
  month: "short",
633
544
  day: "numeric",
634
545
  year: "numeric"
635
- }) }), H(e) && e.upstreamUpdatedAt && /* @__PURE__ */ y("span", {
546
+ }) }), H(t) && t.upstreamUpdatedAt && /* @__PURE__ */ x("span", {
636
547
  className: "rounded-full bg-wx-bg-elevated px-1.5 py-0.5 text-[10px] font-medium text-wx-fg-muted",
637
- title: new Date(e.upstreamUpdatedAt).toLocaleString(n),
638
- children: o("editedAt", { when: U(e.upstreamUpdatedAt) })
548
+ title: new Date(t.upstreamUpdatedAt).toLocaleString(n),
549
+ children: o("editedAt", { when: U(t.upstreamUpdatedAt) })
639
550
  })]
640
551
  }),
641
- e.tags && e.tags.length > 0 && /* @__PURE__ */ y("div", {
552
+ t.tags && t.tags.length > 0 && /* @__PURE__ */ x("div", {
642
553
  className: "mt-2.5 flex flex-wrap gap-1",
643
- children: e.tags.slice(0, 4).map((e) => /* @__PURE__ */ y("span", {
554
+ children: t.tags.slice(0, 4).map((e) => /* @__PURE__ */ x("span", {
644
555
  className: "rounded-full bg-wx-bg-elevated px-2 py-0.5 text-[10px] font-medium text-wx-fg-muted",
645
556
  children: e.label
646
557
  }, e.slug))
@@ -650,6 +561,6 @@ function Y({ item: e, locale: n, delay: r, onClick: a }) {
650
561
  });
651
562
  }
652
563
  //#endregion
653
- export { z as a, I as c, N as d, j as f, k as h, V as i, F as l, D as m, U as n, R as o, T as p, H as r, L as s, K as t, P as u };
564
+ export { z as a, I as c, w as d, N as f, j as h, V as i, F as l, k as m, U as n, R as o, D as p, H as r, L as s, K as t, P as u };
654
565
 
655
- //# sourceMappingURL=widget-react-DV3UnggB.js.map
566
+ //# sourceMappingURL=widget-react-CHSNuztJ.js.map