@fluid-app/fluid-cli-theme-dev 0.1.740 → 0.1.742

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 (48) hide show
  1. package/dist/dist-cli-preview/.vite/manifest.json +51 -51
  2. package/dist/dist-cli-preview/account-screens.js +1 -1
  3. package/dist/dist-cli-preview/chunks/{MediaScreen-B6W5_Zyk.js → MediaScreen-hPpfBMTG.js} +1 -1
  4. package/dist/dist-cli-preview/chunks/{MemberShareablesScreen-DJfUS4f1.js → MemberShareablesScreen-pmXh96vz.js} +862 -843
  5. package/dist/dist-cli-preview/chunks/{PlaylistsScreen-D960PmAf.js → PlaylistsScreen-BzY2Y28c.js} +1 -1
  6. package/dist/dist-cli-preview/chunks/{ar-D6LJV1_E.js → ar-ClhIoz6a.js} +260 -256
  7. package/dist/dist-cli-preview/chunks/{bg-C5Ldmily.js → bg-BksVMhMy.js} +278 -274
  8. package/dist/dist-cli-preview/chunks/{bn-kfMPWNR6.js → bn-Jn0udx5-.js} +267 -263
  9. package/dist/dist-cli-preview/chunks/{cli-preview-CtzIoQ37.js → cli-preview-CAmjF-C1.js} +4 -4
  10. package/dist/dist-cli-preview/chunks/{cs-DqEgtV8D.js → cs-CMdINoT1.js} +262 -258
  11. package/dist/dist-cli-preview/chunks/{da-BbuvL7Gx.js → da-D25F0yGh.js} +277 -273
  12. package/dist/dist-cli-preview/chunks/{de-BfJ7rQig.js → de-CZiafs2R.js} +280 -276
  13. package/dist/dist-cli-preview/chunks/{el-BO0rLq6D.js → el-BWLIj7n7.js} +280 -276
  14. package/dist/dist-cli-preview/chunks/{es-BEVtEUXk.js → es-pIE-fFV2.js} +280 -276
  15. package/dist/dist-cli-preview/chunks/{fi-DjISV3UN.js → fi-BEqBi0iR.js} +278 -274
  16. package/dist/dist-cli-preview/chunks/{fr-1fFd-aKy.js → fr-BsEpyTmn.js} +278 -274
  17. package/dist/dist-cli-preview/chunks/{he-CaT9bwVp.js → he-CVyG1N7p.js} +265 -261
  18. package/dist/dist-cli-preview/chunks/{hi-DkzEm57l.js → hi-CA89BVKL.js} +266 -262
  19. package/dist/dist-cli-preview/chunks/{hr-DqM5N_bj.js → hr-Dbk-j9u8.js} +296 -292
  20. package/dist/dist-cli-preview/chunks/{hu-DiLqjo5c.js → hu-D6LKkyaV.js} +268 -264
  21. package/dist/dist-cli-preview/chunks/{id-DA1KmwgX.js → id-BGR9VsQZ.js} +264 -260
  22. package/dist/dist-cli-preview/chunks/{it-CTEVWCRz.js → it-B1r6jnOe.js} +267 -263
  23. package/dist/dist-cli-preview/chunks/{ja-fxqg1hhg.js → ja-BpANsj6V.js} +292 -288
  24. package/dist/dist-cli-preview/chunks/{ko-Btp1_5YS.js → ko-DX3tlkQ_.js} +293 -289
  25. package/dist/dist-cli-preview/chunks/messaging-BTJiMVy5.js +4 -0
  26. package/dist/dist-cli-preview/chunks/{mount-account-screen-BLTZLqGE.js → mount-account-screen-Bs6nHkeL.js} +2 -2
  27. package/dist/dist-cli-preview/chunks/{ms-DqRbmHx8.js → ms--yFb9SFW.js} +264 -260
  28. package/dist/dist-cli-preview/chunks/{navigate-account-screen-DdulEDHD.js → navigate-account-screen-BS-OVtsq.js} +1 -1
  29. package/dist/dist-cli-preview/chunks/{nl-CkPNddxO.js → nl-H9XiHH5i.js} +297 -293
  30. package/dist/dist-cli-preview/chunks/{no-ftcy0RcQ.js → no-BEW-_XcJ.js} +277 -273
  31. package/dist/dist-cli-preview/chunks/{pl-wyJLqfip.js → pl-CrFhIzj-.js} +309 -305
  32. package/dist/dist-cli-preview/chunks/{pt-7uHLacuI.js → pt-DlaqLtk5.js} +263 -259
  33. package/dist/dist-cli-preview/chunks/{ro-Dh12ghww.js → ro-gd_dWaXs.js} +279 -275
  34. package/dist/dist-cli-preview/chunks/ru-DlyR-9Mq.js +683 -0
  35. package/dist/dist-cli-preview/chunks/{sk-CsuNYa1k.js → sk-BhsGydo4.js} +279 -275
  36. package/dist/dist-cli-preview/chunks/{sv-DVrPaJbh.js → sv-B0ht7qZg.js} +265 -261
  37. package/dist/dist-cli-preview/chunks/{th-BEkMpcVW.js → th-ccJQMGOp.js} +281 -277
  38. package/dist/dist-cli-preview/chunks/{tl-CqwwplQC.js → tl-Bq05C1ac.js} +278 -274
  39. package/dist/dist-cli-preview/chunks/{tr-XEp4ekrM.js → tr-CRzzw4Hc.js} +262 -258
  40. package/dist/dist-cli-preview/chunks/{uk-DWdZFWBl.js → uk-Dn_JPwF7.js} +263 -259
  41. package/dist/dist-cli-preview/chunks/{vi-H__PaPsC.js → vi-LxWc0tDK.js} +286 -282
  42. package/dist/dist-cli-preview/chunks/zh_CN-795k0aqz.js +683 -0
  43. package/dist/dist-cli-preview/chunks/zh_TW-pxcxIx6W.js +683 -0
  44. package/package.json +2 -2
  45. package/dist/dist-cli-preview/chunks/messaging-BnA_aJoM.js +0 -4
  46. package/dist/dist-cli-preview/chunks/ru-DFM7xWFz.js +0 -679
  47. package/dist/dist-cli-preview/chunks/zh_CN-B62j_w_1.js +0 -679
  48. package/dist/dist-cli-preview/chunks/zh_TW-CYUIGBvP.js +0 -679
@@ -1,5 +1,5 @@
1
- import { c as be, l as o, j as e, G as kl, H as zn, J as Cl, K as os, M as Sl, N as Pl, O as On, R as Tl, U as Al, V as El, W as Ml, X as ve, Y as Ve, Z as oe, _ as Ge, $ as H, a0 as Vt, a1 as _t, a2 as $n, a3 as Un, a4 as pr, a5 as ba, a6 as qr, a7 as nt, a8 as rs, a9 as Fl, aa as Il, ab as Dl, ac as Ll, ad as Rl, ae as zl, a as Os, af as Hn, ag as qn, ah as Hs, ai as Ol, B as hr, aj as $l, D as Ul, E as Hl, ak as ql, z as Bl, x as Kl } from "./account-screen-runtime-gWamEEiQ.js";
2
- import { u as Rt } from "./useInfiniteQuery-BoOiol5L.js";
1
+ import { c as be, l as o, j as e, G as kl, H as zn, J as Cl, K as os, M as Sl, N as Pl, O as On, R as Tl, U as Al, V as El, W as Ml, X as ve, Y as Ve, Z as ue, _ as Ge, $ as H, a0 as Vt, a1 as _t, a2 as $n, a3 as Un, a4 as pr, a5 as ba, a6 as qr, a7 as nt, a8 as rs, a9 as Fl, aa as Il, ab as Dl, ac as Rl, ad as Ll, ae as zl, a as Os, af as Hn, ag as qn, ah as Hs, ai as Ol, B as hr, aj as $l, D as Ul, E as Hl, ak as ql, z as Bl, x as Kl } from "./account-screen-runtime-gWamEEiQ.js";
2
+ import { u as Lt } from "./useInfiniteQuery-BoOiol5L.js";
3
3
  import { u as ze, o as ke, r as Is, s as te, n as Nt, a as Ds, l as Vl, b as ts, c as Cs, d as Gt, e as fr, _ as Gl, C as as, f as Wl } from "./schemas-BGhVnzPl.js";
4
4
  import { u as Bn, P as Ql } from "./PortalTenantClientProvider-B3BFo8T5.js";
5
5
  import { p as Yl, d as Xl, e as Zl, f as Jl, g as eo, h as to, i as so, j as ao, c as ro } from "./hey-api-client-BtWnXt6Y.js";
@@ -10,7 +10,7 @@ import { S as ja } from "./search-DAHGESai.js";
10
10
  import { u as dt } from "./use-mobile-CzhxjMYC.js";
11
11
  import { c as Co, a as So, b as Po, u as To } from "./translation-api-context-factory-DDptTXAu.js";
12
12
  import { B as zt, P as gr, M as Gn, a as qs, b as Ao, T as Wn, C as Qn } from "./Textarea-BX1sqax1.js";
13
- import { L as _r, S as it, T as Eo, a as Mo, b as Ua, c as Ct, d as Fo, U as Io, e as Do, f as Lo, g as Ro, h as zo, i as Oo, M as $o, P as Uo } from "./index-B23yRHYj.js";
13
+ import { L as _r, S as it, T as Eo, a as Mo, b as Ua, c as Ct, d as Fo, U as Io, e as Do, f as Ro, g as Lo, h as zo, i as Oo, M as $o, P as Uo } from "./index-B23yRHYj.js";
14
14
  import { D as bs, a as wa, b as xr, c as Ho, d as qo, R as St, T as ns, P as Wt, e as Bs, f as Na, g as yr, h as br, M as Yn } from "./ResponsiveDialog-Cuv5gFUx.js";
15
15
  import { C as Bo } from "./copy-DO_MJg1G.js";
16
16
  import { u as Ko, S as Vo, P as Go, E as Wo } from "./index-DSMhrA7P.js";
@@ -19,7 +19,7 @@ import { u as ec } from "./index-dtGU2026.js";
19
19
  import { d as tc } from "./member-permissions-ndhNmlOk.js";
20
20
  import { u as sc } from "./use-store-B2hbh2xH.js";
21
21
  import { c as ac, a as rc } from "./client.gen-Bn09emPC.js";
22
- import { i as nc } from "./navigate-account-screen-DdulEDHD.js";
22
+ import { i as nc } from "./navigate-account-screen-BS-OVtsq.js";
23
23
  /**
24
24
  * @license lucide-react v0.575.0 - ISC
25
25
  *
@@ -134,7 +134,7 @@ const yc = [
134
134
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
135
135
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
136
136
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
137
- ], Ls = be("download", yc);
137
+ ], Rs = be("download", yc);
138
138
  /**
139
139
  * @license lucide-react v0.575.0 - ISC
140
140
  *
@@ -316,14 +316,14 @@ const Dc = [
316
316
  }
317
317
  ],
318
318
  ["path", { d: "M20.054 15.987H3.946", key: "14rxg9" }]
319
- ], Lc = be("laptop", Dc);
319
+ ], Rc = be("laptop", Dc);
320
320
  /**
321
321
  * @license lucide-react v0.575.0 - ISC
322
322
  *
323
323
  * This source code is licensed under the ISC license.
324
324
  * See the LICENSE file in the root directory of this source tree.
325
325
  */
326
- const Rc = [
326
+ const Lc = [
327
327
  [
328
328
  "path",
329
329
  {
@@ -345,7 +345,7 @@ const Rc = [
345
345
  key: "kqbvx6"
346
346
  }
347
347
  ]
348
- ], zc = be("layers", Rc);
348
+ ], zc = be("layers", Lc);
349
349
  /**
350
350
  * @license lucide-react v0.575.0 - ISC
351
351
  *
@@ -567,22 +567,22 @@ var $s = "Tooltip", [od, Ks] = ka($s), di = (t) => {
567
567
  onOpenChange: i,
568
568
  disableHoverableContent: l,
569
569
  delayDuration: u
570
- } = t, c = vr($s, t.__scopeTooltip), d = Ca(s), [m, h] = o.useState(null), p = Sl(), f = o.useRef(0), g = l ?? c.disableHoverableContent, _ = u ?? c.delayDuration, x = o.useRef(!1), [w, b] = Pl({
570
+ } = t, c = vr($s, t.__scopeTooltip), d = Ca(s), [m, h] = o.useState(null), p = Sl(), f = o.useRef(0), g = l ?? c.disableHoverableContent, x = u ?? c.delayDuration, _ = o.useRef(!1), [w, b] = Pl({
571
571
  prop: r,
572
572
  defaultProp: n ?? !1,
573
573
  onChange: (z) => {
574
574
  z ? (c.onOpen(), document.dispatchEvent(new CustomEvent(nr))) : c.onClose(), i?.(z);
575
575
  },
576
576
  caller: $s
577
- }), j = o.useMemo(() => w ? x.current ? "delayed-open" : "instant-open" : "closed", [w]), v = o.useCallback(() => {
578
- window.clearTimeout(f.current), f.current = 0, x.current = !1, b(!0);
577
+ }), j = o.useMemo(() => w ? _.current ? "delayed-open" : "instant-open" : "closed", [w]), v = o.useCallback(() => {
578
+ window.clearTimeout(f.current), f.current = 0, _.current = !1, b(!0);
579
579
  }, [b]), C = o.useCallback(() => {
580
580
  window.clearTimeout(f.current), f.current = 0, b(!1);
581
581
  }, [b]), N = o.useCallback(() => {
582
582
  window.clearTimeout(f.current), f.current = window.setTimeout(() => {
583
- x.current = !0, b(!0), f.current = 0;
584
- }, _);
585
- }, [_, b]);
583
+ _.current = !0, b(!0), f.current = 0;
584
+ }, x);
585
+ }, [x, b]);
586
586
  return o.useEffect(() => () => {
587
587
  f.current && (window.clearTimeout(f.current), f.current = 0);
588
588
  }, []), /* @__PURE__ */ e.jsx(Yo, { ...d, children: /* @__PURE__ */ e.jsx(
@@ -653,23 +653,23 @@ var ys = "TooltipContent", pi = o.forwardRef(
653
653
  const a = Ks(ys, t.__scopeTooltip), r = vr(ys, t.__scopeTooltip), n = o.useRef(null), i = zn(s, n), [l, u] = o.useState(null), { trigger: c, onClose: d } = a, m = n.current, { onPointerInTransitChange: h } = r, p = o.useCallback(() => {
654
654
  u(null), h(!1);
655
655
  }, [h]), f = o.useCallback(
656
- (g, _) => {
657
- const x = g.currentTarget, w = { x: g.clientX, y: g.clientY }, b = gd(w, x.getBoundingClientRect()), j = _d(w, b), v = xd(_.getBoundingClientRect()), C = bd([...j, ...v]);
656
+ (g, x) => {
657
+ const _ = g.currentTarget, w = { x: g.clientX, y: g.clientY }, b = gd(w, _.getBoundingClientRect()), j = _d(w, b), v = xd(x.getBoundingClientRect()), C = bd([...j, ...v]);
658
658
  u(C), h(!0);
659
659
  },
660
660
  [h]
661
661
  );
662
662
  return o.useEffect(() => () => p(), [p]), o.useEffect(() => {
663
663
  if (c && m) {
664
- const g = (x) => f(x, m), _ = (x) => f(x, c);
665
- return c.addEventListener("pointerleave", g), m.addEventListener("pointerleave", _), () => {
666
- c.removeEventListener("pointerleave", g), m.removeEventListener("pointerleave", _);
664
+ const g = (_) => f(_, m), x = (_) => f(_, c);
665
+ return c.addEventListener("pointerleave", g), m.addEventListener("pointerleave", x), () => {
666
+ c.removeEventListener("pointerleave", g), m.removeEventListener("pointerleave", x);
667
667
  };
668
668
  }
669
669
  }, [c, m, f, p]), o.useEffect(() => {
670
670
  if (l) {
671
- const g = (_) => {
672
- const x = _.target, w = { x: _.clientX, y: _.clientY }, b = c?.contains(x) || m?.contains(x), j = !yd(w, l);
671
+ const g = (x) => {
672
+ const _ = x.target, w = { x: x.clientX, y: x.clientY }, b = c?.contains(_) || m?.contains(_), j = !yd(w, l);
673
673
  b ? p() : j && (p(), d());
674
674
  };
675
675
  return document.addEventListener("pointermove", g), () => document.removeEventListener("pointermove", g);
@@ -835,7 +835,7 @@ function It(t) {
835
835
  return /* @__PURE__ */ e.jsx(wd, { ...t });
836
836
  }
837
837
  const Dt = Nd;
838
- function Lt({
838
+ function Rt({
839
839
  className: t,
840
840
  sideOffset: s = 4,
841
841
  ...a
@@ -969,7 +969,7 @@ const Td = (t) => t.client.get(
969
969
  "Content-Type": "application/json",
970
970
  ...t.headers
971
971
  }
972
- }), Ld = (t) => t.client.delete({
972
+ }), Rd = (t) => t.client.delete({
973
973
  responseStyle: "data",
974
974
  security: [
975
975
  {
@@ -980,7 +980,7 @@ const Td = (t) => t.client.get(
980
980
  ],
981
981
  url: "/api/content/media/{medium_id}/products/{id}",
982
982
  ...t
983
- }), Rd = (t) => t.client.get({
983
+ }), Ld = (t) => t.client.get({
984
984
  responseStyle: "data",
985
985
  security: [
986
986
  {
@@ -1348,7 +1348,7 @@ const Td = (t) => t.client.get(
1348
1348
  path: { medium_id: s },
1349
1349
  ...qe(a)
1350
1350
  }),
1351
- media_products_remove: (t, s, a) => Ld({
1351
+ media_products_remove: (t, s, a) => Rd({
1352
1352
  client: t,
1353
1353
  path: { medium_id: s, id: a }
1354
1354
  }),
@@ -1377,7 +1377,7 @@ const Td = (t) => t.client.get(
1377
1377
  path: { playlist_id: s },
1378
1378
  body: a
1379
1379
  }),
1380
- playlists_list: (t, s) => Rd({ client: t, ...qe(s) }),
1380
+ playlists_list: (t, s) => Ld({ client: t, ...qe(s) }),
1381
1381
  playlists_show: (t, s) => $d({ client: t, path: { id: s } }),
1382
1382
  playlists_update: (t, s, a) => Ud({ client: t, path: { id: s }, body: a }),
1383
1383
  shares_create: (t, s) => Qd({ client: t, body: s }),
@@ -1405,17 +1405,17 @@ function wi() {
1405
1405
  );
1406
1406
  return t.api;
1407
1407
  }
1408
- const Rs = {
1408
+ const Ls = {
1409
1409
  all: ["portal-products"],
1410
- list: (t) => [...Rs.all, "list", t],
1411
- detail: (t) => [...Rs.all, "detail", String(t)],
1412
- search: (t, s) => [...Rs.all, "search", t, s],
1413
- media: (t) => [...Rs.all, "media", String(t)]
1410
+ list: (t) => [...Ls.all, "list", t],
1411
+ detail: (t) => [...Ls.all, "detail", String(t)],
1412
+ search: (t, s) => [...Ls.all, "search", t, s],
1413
+ media: (t) => [...Ls.all, "media", String(t)]
1414
1414
  };
1415
1415
  function ou(t, s) {
1416
1416
  const a = wi();
1417
1417
  return Ve({
1418
- queryKey: Rs.detail(t),
1418
+ queryKey: Ls.detail(t),
1419
1419
  queryFn: () => a.getProduct(t),
1420
1420
  enabled: s?.enabled ?? !0
1421
1421
  });
@@ -1432,12 +1432,12 @@ const Qr = (t) => {
1432
1432
  return u;
1433
1433
  }, cu = ((t) => t ? Qr(t) : Qr), du = (t) => t;
1434
1434
  function uu(t, s = du) {
1435
- const a = oe.useSyncExternalStore(
1435
+ const a = ue.useSyncExternalStore(
1436
1436
  t.subscribe,
1437
- oe.useCallback(() => s(t.getState()), [t, s]),
1438
- oe.useCallback(() => s(t.getInitialState()), [t, s])
1437
+ ue.useCallback(() => s(t.getState()), [t, s]),
1438
+ ue.useCallback(() => s(t.getInitialState()), [t, s])
1439
1439
  );
1440
- return oe.useDebugValue(a), a;
1440
+ return ue.useDebugValue(a), a;
1441
1441
  }
1442
1442
  const mu = (t) => {
1443
1443
  const s = cu(t), a = (r) => uu(s, r);
@@ -2170,25 +2170,25 @@ function Pa(t, s, a, r = "en") {
2170
2170
  throw new Error("Something went wrong, please try again.");
2171
2171
  if (l && !u)
2172
2172
  throw new Error("Share links are not available for this item.");
2173
- const x = {
2173
+ const _ = {
2174
2174
  locale: r,
2175
2175
  relateableType: s,
2176
2176
  ...l && t?.id && { relateableId: t.id },
2177
2177
  ...a
2178
2178
  };
2179
- return await n.share.createShareLink(x);
2179
+ return await n.share.createShareLink(_);
2180
2180
  },
2181
2181
  enabled: l ? !!(c && t?.id) : !0,
2182
2182
  staleTime: 300 * 1e3,
2183
2183
  gcTime: 600 * 1e3
2184
- }), g = o.useCallback(async () => m || (await f()).data, [m, f]), _ = o.useCallback(() => {
2184
+ }), g = o.useCallback(async () => m || (await f()).data, [m, f]), x = o.useCallback(() => {
2185
2185
  i.removeQueries({ queryKey: d });
2186
2186
  }, [i, d]);
2187
2187
  return {
2188
2188
  loading: h,
2189
2189
  shareLink: m,
2190
2190
  getShareLink: g,
2191
- resetShareLink: _,
2191
+ resetShareLink: x,
2192
2192
  error: p
2193
2193
  };
2194
2194
  }
@@ -2549,7 +2549,7 @@ function Du(t, s, a) {
2549
2549
  return !1;
2550
2550
  });
2551
2551
  }
2552
- function Lu(t) {
2552
+ function Ru(t) {
2553
2553
  if (!t || t.length === 0)
2554
2554
  return "Any file type";
2555
2555
  const s = [], a = /* @__PURE__ */ new Set();
@@ -2557,7 +2557,7 @@ function Lu(t) {
2557
2557
  a.has(r) || (a.add(r), r === "image/*" ? s.push("Images") : r === "video/*" ? s.push("Videos") : r === "audio/*" ? s.push("Audio") : r === "application/pdf" ? s.push("PDF files") : r.startsWith(".") ? s.push(`${r.toUpperCase()} files`) : r.includes("/") && s.push(r));
2558
2558
  }), s.length === 0 ? t.join(", ") : s.length === 1 ? s[0] : s.length === 2 ? `${s[0]} and ${s[1]}` : `${s.slice(0, -1).join(", ")}, and ${s[s.length - 1]}`;
2559
2559
  }
2560
- var Ru = Object.defineProperty, zu = (t, s, a) => s in t ? Ru(t, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[s] = a, Pe = (t, s, a) => zu(t, typeof s != "symbol" ? s + "" : s, a);
2560
+ var Lu = Object.defineProperty, zu = (t, s, a) => s in t ? Lu(t, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[s] = a, Pe = (t, s, a) => zu(t, typeof s != "symbol" ? s + "" : s, a);
2561
2561
  const _a = {
2562
2562
  x: 0,
2563
2563
  y: 0,
@@ -2597,13 +2597,13 @@ function en(t, s, a, r, n, i = 0, l = 0, u = r, c = n) {
2597
2597
  s && (s > 1 ? (m = l ? l * s : m, h = m / s, p = u * s) : (h = i ? i / s : h, m = h * s, f = c / s)), d.y < 0 && (d.height = Math.max(d.height + d.y, h), d.y = 0), d.x < 0 && (d.width = Math.max(d.width + d.x, m), d.x = 0);
2598
2598
  const g = r - (d.x + d.width);
2599
2599
  g < 0 && (d.x = Math.min(d.x, r - m), d.width += g);
2600
- const _ = n - (d.y + d.height);
2601
- if (_ < 0 && (d.y = Math.min(d.y, n - h), d.height += _), d.width < m && ((a === "sw" || a == "nw") && (d.x -= m - d.width), d.width = m), d.height < h && ((a === "nw" || a == "ne") && (d.y -= h - d.height), d.height = h), d.width > p && ((a === "sw" || a == "nw") && (d.x -= p - d.width), d.width = p), d.height > f && ((a === "nw" || a == "ne") && (d.y -= f - d.height), d.height = f), s) {
2602
- const x = d.width / d.height;
2603
- if (x < s) {
2600
+ const x = n - (d.y + d.height);
2601
+ if (x < 0 && (d.y = Math.min(d.y, n - h), d.height += x), d.width < m && ((a === "sw" || a == "nw") && (d.x -= m - d.width), d.width = m), d.height < h && ((a === "nw" || a == "ne") && (d.y -= h - d.height), d.height = h), d.width > p && ((a === "sw" || a == "nw") && (d.x -= p - d.width), d.width = p), d.height > f && ((a === "nw" || a == "ne") && (d.y -= f - d.height), d.height = f), s) {
2602
+ const _ = d.width / d.height;
2603
+ if (_ < s) {
2604
2604
  const w = Math.max(d.width / s, h);
2605
2605
  (a === "nw" || a == "ne") && (d.y -= w - d.height), d.height = w;
2606
- } else if (x > s) {
2606
+ } else if (_ > s) {
2607
2607
  const w = Math.max(d.height * s, m);
2608
2608
  (a === "sw" || a == "nw") && (d.x -= w - d.width), d.width = w;
2609
2609
  }
@@ -2641,8 +2641,8 @@ const Bt = class bt extends o.PureComponent {
2641
2641
  let c = s.clientX, d = s.clientY, m = i.x, h = i.y;
2642
2642
  if (l) {
2643
2643
  const p = s.clientX - n.x, f = s.clientY - n.y;
2644
- let g = 0, _ = 0;
2645
- l === "ne" || l == "e" ? (g = p - (i.x + i.width), _ = f - i.y, m = i.x, h = i.y + i.height) : l === "se" || l === "s" ? (g = p - (i.x + i.width), _ = f - (i.y + i.height), m = i.x, h = i.y) : l === "sw" || l == "w" ? (g = p - i.x, _ = f - (i.y + i.height), m = i.x + i.width, h = i.y) : (l === "nw" || l == "n") && (g = p - i.x, _ = f - i.y, m = i.x + i.width, h = i.y + i.height), c = m + n.x + g, d = h + n.y + _;
2644
+ let g = 0, x = 0;
2645
+ l === "ne" || l == "e" ? (g = p - (i.x + i.width), x = f - i.y, m = i.x, h = i.y + i.height) : l === "se" || l === "s" ? (g = p - (i.x + i.width), x = f - (i.y + i.height), m = i.x, h = i.y) : l === "sw" || l == "w" ? (g = p - i.x, x = f - (i.y + i.height), m = i.x + i.width, h = i.y) : (l === "nw" || l == "n") && (g = p - i.x, x = f - i.y, m = i.x + i.width, h = i.y + i.height), c = m + n.x + g, d = h + n.y + x;
2646
2646
  }
2647
2647
  this.evData = {
2648
2648
  startClientX: c,
@@ -2719,8 +2719,8 @@ const Bt = class bt extends o.PureComponent {
2719
2719
  s.stopPropagation(), s.preventDefault();
2720
2720
  else
2721
2721
  return;
2722
- const f = (navigator.platform.match("Mac") ? s.metaKey : s.ctrlKey) ? bt.nudgeStepLarge : s.shiftKey ? bt.nudgeStepMedium : bt.nudgeStep, g = wt(n, p.width, p.height), _ = Hu(g, s.key, f, a), x = en(
2723
- _,
2722
+ const f = (navigator.platform.match("Mac") ? s.metaKey : s.ctrlKey) ? bt.nudgeStepLarge : s.shiftKey ? bt.nudgeStepMedium : bt.nudgeStep, g = wt(n, p.width, p.height), x = Hu(g, s.key, f, a), _ = en(
2723
+ x,
2724
2724
  r,
2725
2725
  a,
2726
2726
  p.width,
@@ -2730,9 +2730,9 @@ const Bt = class bt extends o.PureComponent {
2730
2730
  c,
2731
2731
  d
2732
2732
  );
2733
- if (!Jr(n, x)) {
2734
- const w = Kt(x, p.width, p.height);
2735
- m(x, w), h && h(x, w);
2733
+ if (!Jr(n, _)) {
2734
+ const w = Kt(_, p.width, p.height);
2735
+ m(_, w), h && h(_, w);
2736
2736
  }
2737
2737
  }), Pe(this, "onDocPointerDone", (s) => {
2738
2738
  const { crop: a, disabled: r, onComplete: n, onDragEnd: i } = this.props, l = this.getBox();
@@ -2832,7 +2832,7 @@ const Bt = class bt extends o.PureComponent {
2832
2832
  crop: l
2833
2833
  } = this.props, u = this.getCropStyle();
2834
2834
  if (l)
2835
- return /* @__PURE__ */ oe.createElement(
2835
+ return /* @__PURE__ */ ue.createElement(
2836
2836
  "div",
2837
2837
  {
2838
2838
  style: u,
@@ -2843,7 +2843,7 @@ const Bt = class bt extends o.PureComponent {
2843
2843
  onKeyDown: this.onComponentKeyDown,
2844
2844
  role: "group"
2845
2845
  },
2846
- !a && !r && /* @__PURE__ */ oe.createElement("div", { className: "ReactCrop__drag-elements", onFocus: this.onDragFocus }, /* @__PURE__ */ oe.createElement("div", { className: "ReactCrop__drag-bar ord-n", "data-ord": "n" }), /* @__PURE__ */ oe.createElement("div", { className: "ReactCrop__drag-bar ord-e", "data-ord": "e" }), /* @__PURE__ */ oe.createElement("div", { className: "ReactCrop__drag-bar ord-s", "data-ord": "s" }), /* @__PURE__ */ oe.createElement("div", { className: "ReactCrop__drag-bar ord-w", "data-ord": "w" }), /* @__PURE__ */ oe.createElement(
2846
+ !a && !r && /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-elements", onFocus: this.onDragFocus }, /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-bar ord-n", "data-ord": "n" }), /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-bar ord-e", "data-ord": "e" }), /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-bar ord-s", "data-ord": "s" }), /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-bar ord-w", "data-ord": "w" }), /* @__PURE__ */ ue.createElement(
2847
2847
  "div",
2848
2848
  {
2849
2849
  className: "ReactCrop__drag-handle ord-nw",
@@ -2853,7 +2853,7 @@ const Bt = class bt extends o.PureComponent {
2853
2853
  onKeyDown: (c) => this.onHandlerKeyDown(c, "nw"),
2854
2854
  role: "button"
2855
2855
  }
2856
- ), /* @__PURE__ */ oe.createElement(
2856
+ ), /* @__PURE__ */ ue.createElement(
2857
2857
  "div",
2858
2858
  {
2859
2859
  className: "ReactCrop__drag-handle ord-n",
@@ -2863,7 +2863,7 @@ const Bt = class bt extends o.PureComponent {
2863
2863
  onKeyDown: (c) => this.onHandlerKeyDown(c, "n"),
2864
2864
  role: "button"
2865
2865
  }
2866
- ), /* @__PURE__ */ oe.createElement(
2866
+ ), /* @__PURE__ */ ue.createElement(
2867
2867
  "div",
2868
2868
  {
2869
2869
  className: "ReactCrop__drag-handle ord-ne",
@@ -2873,7 +2873,7 @@ const Bt = class bt extends o.PureComponent {
2873
2873
  onKeyDown: (c) => this.onHandlerKeyDown(c, "ne"),
2874
2874
  role: "button"
2875
2875
  }
2876
- ), /* @__PURE__ */ oe.createElement(
2876
+ ), /* @__PURE__ */ ue.createElement(
2877
2877
  "div",
2878
2878
  {
2879
2879
  className: "ReactCrop__drag-handle ord-e",
@@ -2883,7 +2883,7 @@ const Bt = class bt extends o.PureComponent {
2883
2883
  onKeyDown: (c) => this.onHandlerKeyDown(c, "e"),
2884
2884
  role: "button"
2885
2885
  }
2886
- ), /* @__PURE__ */ oe.createElement(
2886
+ ), /* @__PURE__ */ ue.createElement(
2887
2887
  "div",
2888
2888
  {
2889
2889
  className: "ReactCrop__drag-handle ord-se",
@@ -2893,7 +2893,7 @@ const Bt = class bt extends o.PureComponent {
2893
2893
  onKeyDown: (c) => this.onHandlerKeyDown(c, "se"),
2894
2894
  role: "button"
2895
2895
  }
2896
- ), /* @__PURE__ */ oe.createElement(
2896
+ ), /* @__PURE__ */ ue.createElement(
2897
2897
  "div",
2898
2898
  {
2899
2899
  className: "ReactCrop__drag-handle ord-s",
@@ -2903,7 +2903,7 @@ const Bt = class bt extends o.PureComponent {
2903
2903
  onKeyDown: (c) => this.onHandlerKeyDown(c, "s"),
2904
2904
  role: "button"
2905
2905
  }
2906
- ), /* @__PURE__ */ oe.createElement(
2906
+ ), /* @__PURE__ */ ue.createElement(
2907
2907
  "div",
2908
2908
  {
2909
2909
  className: "ReactCrop__drag-handle ord-sw",
@@ -2913,7 +2913,7 @@ const Bt = class bt extends o.PureComponent {
2913
2913
  onKeyDown: (c) => this.onHandlerKeyDown(c, "sw"),
2914
2914
  role: "button"
2915
2915
  }
2916
- ), /* @__PURE__ */ oe.createElement(
2916
+ ), /* @__PURE__ */ ue.createElement(
2917
2917
  "div",
2918
2918
  {
2919
2919
  className: "ReactCrop__drag-handle ord-w",
@@ -2924,8 +2924,8 @@ const Bt = class bt extends o.PureComponent {
2924
2924
  role: "button"
2925
2925
  }
2926
2926
  )),
2927
- n && /* @__PURE__ */ oe.createElement("div", { className: "ReactCrop__selection-addon", onPointerDown: (c) => c.stopPropagation() }, n(this.state)),
2928
- i && /* @__PURE__ */ oe.createElement(oe.Fragment, null, /* @__PURE__ */ oe.createElement("div", { className: "ReactCrop__rule-of-thirds-hz" }), /* @__PURE__ */ oe.createElement("div", { className: "ReactCrop__rule-of-thirds-vt" }))
2927
+ n && /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__selection-addon", onPointerDown: (c) => c.stopPropagation() }, n(this.state)),
2928
+ i && /* @__PURE__ */ ue.createElement(ue.Fragment, null, /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__rule-of-thirds-hz" }), /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__rule-of-thirds-vt" }))
2929
2929
  );
2930
2930
  }
2931
2931
  makePixelCrop(s) {
@@ -2946,7 +2946,7 @@ const Bt = class bt extends o.PureComponent {
2946
2946
  !this.dragStarted && i && !i.width && !i.height && "ReactCrop--invisible-crop",
2947
2947
  r && "ReactCrop--no-animate"
2948
2948
  );
2949
- return /* @__PURE__ */ oe.createElement("div", { ref: this.componentRef, className: f, style: c }, /* @__PURE__ */ oe.createElement("div", { ref: this.mediaRef, className: "ReactCrop__child-wrapper", onPointerDown: this.onComponentPointerDown }, a), i ? /* @__PURE__ */ oe.createElement("svg", { className: "ReactCrop__crop-mask", width: "100%", height: "100%" }, /* @__PURE__ */ oe.createElement("defs", null, /* @__PURE__ */ oe.createElement("mask", { id: `hole-${this.instanceId}` }, /* @__PURE__ */ oe.createElement("rect", { width: "100%", height: "100%", fill: "white" }), r ? /* @__PURE__ */ oe.createElement(
2949
+ return /* @__PURE__ */ ue.createElement("div", { ref: this.componentRef, className: f, style: c }, /* @__PURE__ */ ue.createElement("div", { ref: this.mediaRef, className: "ReactCrop__child-wrapper", onPointerDown: this.onComponentPointerDown }, a), i ? /* @__PURE__ */ ue.createElement("svg", { className: "ReactCrop__crop-mask", width: "100%", height: "100%" }, /* @__PURE__ */ ue.createElement("defs", null, /* @__PURE__ */ ue.createElement("mask", { id: `hole-${this.instanceId}` }, /* @__PURE__ */ ue.createElement("rect", { width: "100%", height: "100%", fill: "white" }), r ? /* @__PURE__ */ ue.createElement(
2950
2950
  "ellipse",
2951
2951
  {
2952
2952
  cx: `${i.x + i.width / 2}${i.unit}`,
@@ -2955,7 +2955,7 @@ const Bt = class bt extends o.PureComponent {
2955
2955
  ry: `${i.height / 2}${i.unit}`,
2956
2956
  fill: "black"
2957
2957
  }
2958
- ) : /* @__PURE__ */ oe.createElement(
2958
+ ) : /* @__PURE__ */ ue.createElement(
2959
2959
  "rect",
2960
2960
  {
2961
2961
  x: `${i.x}${i.unit}`,
@@ -2964,7 +2964,7 @@ const Bt = class bt extends o.PureComponent {
2964
2964
  height: `${i.height}${i.unit}`,
2965
2965
  fill: "black"
2966
2966
  }
2967
- ))), /* @__PURE__ */ oe.createElement("rect", { fill: "black", fillOpacity: 0.5, width: "100%", height: "100%", mask: `url(#hole-${this.instanceId})` })) : void 0, p);
2967
+ ))), /* @__PURE__ */ ue.createElement("rect", { fill: "black", fillOpacity: 0.5, width: "100%", height: "100%", mask: `url(#hole-${this.instanceId})` })) : void 0, p);
2968
2968
  }
2969
2969
  };
2970
2970
  Pe(Bt, "xOrds", ["e", "w"]), Pe(Bt, "yOrds", ["n", "s"]), Pe(Bt, "xyOrds", ["nw", "ne", "se", "sw"]), Pe(Bt, "nudgeStep", 1), Pe(Bt, "nudgeStepMedium", 10), Pe(Bt, "nudgeStepLarge", 100), Pe(Bt, "defaultProps", {
@@ -3011,7 +3011,7 @@ function Gu(t, s, a) {
3011
3011
  } };
3012
3012
  }
3013
3013
  async function Wu(t, s, a, r, n, i, l, u, c = "image/jpeg", d = 0.9, m) {
3014
- const h = m ? await createImageBitmap(m) : await createImageBitmap(t), p = h.width, f = h.height, g = 4096, _ = Math.max(p / s, f / a), x = Math.round(s * _), w = Math.round(a * _), b = Math.min(1, g / x, g / w), j = _ * b, v = Math.round(x * b), C = Math.round(w * b), z = Math.min(v / p, C / f) * n, O = document.createElement("canvas");
3014
+ const h = m ? await createImageBitmap(m) : await createImageBitmap(t), p = h.width, f = h.height, g = 4096, x = Math.max(p / s, f / a), _ = Math.round(s * x), w = Math.round(a * x), b = Math.min(1, g / _, g / w), j = x * b, v = Math.round(_ * b), C = Math.round(w * b), z = Math.min(v / p, C / f) * n, O = document.createElement("canvas");
3015
3015
  O.width = v, O.height = C;
3016
3016
  const U = O.getContext("2d");
3017
3017
  if (!U) throw new Error("No 2d context");
@@ -3022,12 +3022,12 @@ async function Wu(t, s, a, r, n, i, l, u, c = "image/jpeg", d = 0.9, m) {
3022
3022
  if (!K) throw new Error("No 2d context");
3023
3023
  return K.imageSmoothingQuality = "high", K.imageSmoothingEnabled = !0, K.drawImage(O, E, P, A, M, 0, 0, A, M), new Promise((W, D) => {
3024
3024
  S.toBlob(
3025
- (L) => {
3026
- if (!L) {
3025
+ (R) => {
3026
+ if (!R) {
3027
3027
  D(new Error("Canvas is empty"));
3028
3028
  return;
3029
3029
  }
3030
- const T = new File([L], u, { type: c });
3030
+ const T = new File([R], u, { type: c });
3031
3031
  W(T);
3032
3032
  },
3033
3033
  c,
@@ -3494,15 +3494,15 @@ function fm(t) {
3494
3494
  language_iso: n?.language_iso
3495
3495
  }), f = p.meta.pagination?.next_cursor;
3496
3496
  f && a.set(i + 1, f);
3497
- const g = p.media.map(Ss), _ = n?.per_page ?? 24, x = f ? i * _ + 1 : (i - 1) * _ + g.length;
3497
+ const g = p.media.map(Ss), x = n?.per_page ?? 24, _ = f ? i * x + 1 : (i - 1) * x + g.length;
3498
3498
  return {
3499
3499
  data: g,
3500
3500
  status: "success",
3501
3501
  media: g,
3502
3502
  meta: {
3503
- total_count: x,
3503
+ total_count: _,
3504
3504
  current: i,
3505
- per_page: _,
3505
+ per_page: x,
3506
3506
  pages: f ? i + 1 : i,
3507
3507
  next: f ? i + 1 : null,
3508
3508
  previous: i > 1 ? i - 1 : null
@@ -3991,7 +3991,7 @@ function ln(t) {
3991
3991
  } : void 0
3992
3992
  };
3993
3993
  }
3994
- function Li(t) {
3994
+ function Ri(t) {
3995
3995
  return {
3996
3996
  listShares: async (s) => {
3997
3997
  const a = await je.shares_list(t, {
@@ -4014,7 +4014,7 @@ function Li(t) {
4014
4014
  }
4015
4015
  };
4016
4016
  }
4017
- const Ri = {
4017
+ const Li = {
4018
4018
  Medium: "media",
4019
4019
  media: "media",
4020
4020
  Product: "product",
@@ -4026,15 +4026,15 @@ const Ri = {
4026
4026
  Page: "page",
4027
4027
  page: "page"
4028
4028
  }, vm = [
4029
- ...new Set(Object.values(Ri))
4029
+ ...new Set(Object.values(Li))
4030
4030
  ].join(", ");
4031
4031
  function jm(t) {
4032
- const s = Li(t);
4032
+ const s = Ri(t);
4033
4033
  return {
4034
4034
  createShareLink: async (a) => {
4035
4035
  if (!a.relateableId)
4036
4036
  throw new Error("Cannot create share link without a relateableId");
4037
- const r = Ri[a.relateableType];
4037
+ const r = Li[a.relateableType];
4038
4038
  if (!r)
4039
4039
  throw new Error(
4040
4040
  `Cannot share a "${a.relateableType}" — shareable links support only ${vm}.`
@@ -4468,7 +4468,7 @@ function Em(t) {
4468
4468
  return Ii(t);
4469
4469
  }
4470
4470
  function Mm(t) {
4471
- return Li(t);
4471
+ return Ri(t);
4472
4472
  }
4473
4473
  function Fm(t) {
4474
4474
  return Oi(t);
@@ -4479,7 +4479,7 @@ function Im(t) {
4479
4479
  function Dm(t) {
4480
4480
  return zi(t);
4481
4481
  }
4482
- function Lm(t) {
4482
+ function Rm(t) {
4483
4483
  return wm(t);
4484
4484
  }
4485
4485
  async function pn(t, s, a) {
@@ -4492,7 +4492,7 @@ async function pn(t, s, a) {
4492
4492
  })).is_favorited };
4493
4493
  }
4494
4494
  const Ui = o.createContext(null);
4495
- function Rm() {
4495
+ function Lm() {
4496
4496
  const t = o.use(Ui);
4497
4497
  if (!t)
4498
4498
  throw new Error(
@@ -4516,7 +4516,7 @@ function Hi({
4516
4516
  () => Dm(a),
4517
4517
  [a]
4518
4518
  ), c = o.useMemo(
4519
- () => Lm(s),
4519
+ () => Rm(s),
4520
4520
  [s]
4521
4521
  ), d = o.useMemo(
4522
4522
  () => pm(a),
@@ -4727,7 +4727,7 @@ function Vi() {
4727
4727
  HTMLFormElement: h,
4728
4728
  DOMParser: p,
4729
4729
  trustedTypes: f
4730
- } = t, g = c.prototype, _ = Es(g, "cloneNode"), x = Es(g, "remove"), w = Es(g, "nextSibling"), b = Es(g, "childNodes"), j = Es(g, "parentNode");
4730
+ } = t, g = c.prototype, x = Es(g, "cloneNode"), _ = Es(g, "remove"), w = Es(g, "nextSibling"), b = Es(g, "childNodes"), j = Es(g, "parentNode");
4731
4731
  if (typeof l == "function") {
4732
4732
  const ie = a.createElement("template");
4733
4733
  ie.content && ie.content.ownerDocument && (a = ie.content.ownerDocument);
@@ -4750,7 +4750,7 @@ function Vi() {
4750
4750
  DATA_ATTR: K,
4751
4751
  ARIA_ATTR: W,
4752
4752
  IS_SCRIPT_OR_DATA: D,
4753
- ATTR_WHITESPACE: L,
4753
+ ATTR_WHITESPACE: R,
4754
4754
  CUSTOM_ELEMENT: T
4755
4755
  } = bn;
4756
4756
  let {
@@ -4793,20 +4793,20 @@ function Vi() {
4793
4793
  value: null
4794
4794
  }
4795
4795
  }));
4796
- let F = !0, R = !0, Y = !1, Z = !0, J = !1, me = !0, k = !1, ce = !1, ye = !1, fe = !1, X = !1, le = !1, We = !0, Be = !1;
4796
+ let F = !0, L = !0, Y = !1, Z = !0, J = !1, me = !0, k = !1, oe = !1, ye = !1, fe = !1, X = !1, le = !1, We = !0, Be = !1;
4797
4797
  const tt = "user-content-";
4798
4798
  let Qe = !0, Pt = !1, V = {}, ae = null;
4799
4799
  const pe = xe({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
4800
4800
  let ge = null;
4801
- const Re = xe({}, ["audio", "video", "img", "source", "image", "track"]);
4801
+ const Le = xe({}, ["audio", "video", "img", "source", "image", "track"]);
4802
4802
  let Ue = null;
4803
4803
  const Qt = xe({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), vt = "http://www.w3.org/1998/Math/MathML", Tt = "http://www.w3.org/2000/svg", st = "http://www.w3.org/1999/xhtml";
4804
4804
  let at = st, Yt = !1, $t = null;
4805
- const La = xe({}, [vt, Tt, st], Va);
4805
+ const Ra = xe({}, [vt, Tt, st], Va);
4806
4806
  let Ut = xe({}, ["mi", "mo", "mn", "ms", "mtext"]), Xt = xe({}, ["annotation-xml"]);
4807
4807
  const ws = xe({}, ["title", "style", "font", "a", "script"]);
4808
4808
  let Ht = null;
4809
- const Ra = ["application/xhtml+xml", "text/html"], za = "text/html";
4809
+ const La = ["application/xhtml+xml", "text/html"], za = "text/html";
4810
4810
  let Me = null, qt = null;
4811
4811
  const Oa = a.createElement("form"), Xs = function(y) {
4812
4812
  return y instanceof RegExp || y instanceof Function;
@@ -4814,7 +4814,7 @@ function Vi() {
4814
4814
  let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
4815
4815
  if (!(qt && qt === y)) {
4816
4816
  if ((!y || typeof y != "object") && (y = {}), y = jt(y), Ht = // eslint-disable-next-line unicorn/prefer-includes
4817
- Ra.indexOf(y.PARSER_MEDIA_TYPE) === -1 ? za : y.PARSER_MEDIA_TYPE, Me = Ht === "application/xhtml+xml" ? Va : ma, $ = pt(y, "ALLOWED_TAGS") ? xe({}, y.ALLOWED_TAGS, Me) : se, G = pt(y, "ALLOWED_ATTR") ? xe({}, y.ALLOWED_ATTR, Me) : q, $t = pt(y, "ALLOWED_NAMESPACES") ? xe({}, y.ALLOWED_NAMESPACES, Va) : La, Ue = pt(y, "ADD_URI_SAFE_ATTR") ? xe(jt(Qt), y.ADD_URI_SAFE_ATTR, Me) : Qt, ge = pt(y, "ADD_DATA_URI_TAGS") ? xe(jt(Re), y.ADD_DATA_URI_TAGS, Me) : Re, ae = pt(y, "FORBID_CONTENTS") ? xe({}, y.FORBID_CONTENTS, Me) : pe, he = pt(y, "FORBID_TAGS") ? xe({}, y.FORBID_TAGS, Me) : jt({}), we = pt(y, "FORBID_ATTR") ? xe({}, y.FORBID_ATTR, Me) : jt({}), V = pt(y, "USE_PROFILES") ? y.USE_PROFILES : !1, F = y.ALLOW_ARIA_ATTR !== !1, R = y.ALLOW_DATA_ATTR !== !1, Y = y.ALLOW_UNKNOWN_PROTOCOLS || !1, Z = y.ALLOW_SELF_CLOSE_IN_ATTR !== !1, J = y.SAFE_FOR_TEMPLATES || !1, me = y.SAFE_FOR_XML !== !1, k = y.WHOLE_DOCUMENT || !1, fe = y.RETURN_DOM || !1, X = y.RETURN_DOM_FRAGMENT || !1, le = y.RETURN_TRUSTED_TYPE || !1, ye = y.FORCE_BODY || !1, We = y.SANITIZE_DOM !== !1, Be = y.SANITIZE_NAMED_PROPS || !1, Qe = y.KEEP_CONTENT !== !1, Pt = y.IN_PLACE || !1, I = y.ALLOWED_URI_REGEXP || Bi, at = y.NAMESPACE || st, Ut = y.MATHML_TEXT_INTEGRATION_POINTS || Ut, Xt = y.HTML_INTEGRATION_POINTS || Xt, B = y.CUSTOM_ELEMENT_HANDLING || {}, y.CUSTOM_ELEMENT_HANDLING && Xs(y.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (B.tagNameCheck = y.CUSTOM_ELEMENT_HANDLING.tagNameCheck), y.CUSTOM_ELEMENT_HANDLING && Xs(y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (B.attributeNameCheck = y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), y.CUSTOM_ELEMENT_HANDLING && typeof y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), J && (R = !1), X && (fe = !0), V && ($ = xe({}, _n), G = ua(null), V.html === !0 && (xe($, gn), xe(G, xn)), V.svg === !0 && (xe($, Wa), xe(G, Xa), xe(G, la)), V.svgFilters === !0 && (xe($, Qa), xe(G, Xa), xe(G, la)), V.mathMl === !0 && (xe($, Ya), xe(G, yn), xe(G, la))), pt(y, "ADD_TAGS") || (_e.tagCheck = null), pt(y, "ADD_ATTR") || (_e.attributeCheck = null), y.ADD_TAGS && (typeof y.ADD_TAGS == "function" ? _e.tagCheck = y.ADD_TAGS : ($ === se && ($ = jt($)), xe($, y.ADD_TAGS, Me))), y.ADD_ATTR && (typeof y.ADD_ATTR == "function" ? _e.attributeCheck = y.ADD_ATTR : (G === q && (G = jt(G)), xe(G, y.ADD_ATTR, Me))), y.ADD_URI_SAFE_ATTR && xe(Ue, y.ADD_URI_SAFE_ATTR, Me), y.FORBID_CONTENTS && (ae === pe && (ae = jt(ae)), xe(ae, y.FORBID_CONTENTS, Me)), y.ADD_FORBID_CONTENTS && (ae === pe && (ae = jt(ae)), xe(ae, y.ADD_FORBID_CONTENTS, Me)), Qe && ($["#text"] = !0), k && xe($, ["html", "head", "body"]), $.table && (xe($, ["tbody"]), delete he.tbody), y.TRUSTED_TYPES_POLICY) {
4817
+ La.indexOf(y.PARSER_MEDIA_TYPE) === -1 ? za : y.PARSER_MEDIA_TYPE, Me = Ht === "application/xhtml+xml" ? Va : ma, $ = pt(y, "ALLOWED_TAGS") ? xe({}, y.ALLOWED_TAGS, Me) : se, G = pt(y, "ALLOWED_ATTR") ? xe({}, y.ALLOWED_ATTR, Me) : q, $t = pt(y, "ALLOWED_NAMESPACES") ? xe({}, y.ALLOWED_NAMESPACES, Va) : Ra, Ue = pt(y, "ADD_URI_SAFE_ATTR") ? xe(jt(Qt), y.ADD_URI_SAFE_ATTR, Me) : Qt, ge = pt(y, "ADD_DATA_URI_TAGS") ? xe(jt(Le), y.ADD_DATA_URI_TAGS, Me) : Le, ae = pt(y, "FORBID_CONTENTS") ? xe({}, y.FORBID_CONTENTS, Me) : pe, he = pt(y, "FORBID_TAGS") ? xe({}, y.FORBID_TAGS, Me) : jt({}), we = pt(y, "FORBID_ATTR") ? xe({}, y.FORBID_ATTR, Me) : jt({}), V = pt(y, "USE_PROFILES") ? y.USE_PROFILES : !1, F = y.ALLOW_ARIA_ATTR !== !1, L = y.ALLOW_DATA_ATTR !== !1, Y = y.ALLOW_UNKNOWN_PROTOCOLS || !1, Z = y.ALLOW_SELF_CLOSE_IN_ATTR !== !1, J = y.SAFE_FOR_TEMPLATES || !1, me = y.SAFE_FOR_XML !== !1, k = y.WHOLE_DOCUMENT || !1, fe = y.RETURN_DOM || !1, X = y.RETURN_DOM_FRAGMENT || !1, le = y.RETURN_TRUSTED_TYPE || !1, ye = y.FORCE_BODY || !1, We = y.SANITIZE_DOM !== !1, Be = y.SANITIZE_NAMED_PROPS || !1, Qe = y.KEEP_CONTENT !== !1, Pt = y.IN_PLACE || !1, I = y.ALLOWED_URI_REGEXP || Bi, at = y.NAMESPACE || st, Ut = y.MATHML_TEXT_INTEGRATION_POINTS || Ut, Xt = y.HTML_INTEGRATION_POINTS || Xt, B = y.CUSTOM_ELEMENT_HANDLING || {}, y.CUSTOM_ELEMENT_HANDLING && Xs(y.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (B.tagNameCheck = y.CUSTOM_ELEMENT_HANDLING.tagNameCheck), y.CUSTOM_ELEMENT_HANDLING && Xs(y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (B.attributeNameCheck = y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), y.CUSTOM_ELEMENT_HANDLING && typeof y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), J && (L = !1), X && (fe = !0), V && ($ = xe({}, _n), G = ua(null), V.html === !0 && (xe($, gn), xe(G, xn)), V.svg === !0 && (xe($, Wa), xe(G, Xa), xe(G, la)), V.svgFilters === !0 && (xe($, Qa), xe(G, Xa), xe(G, la)), V.mathMl === !0 && (xe($, Ya), xe(G, yn), xe(G, la))), pt(y, "ADD_TAGS") || (_e.tagCheck = null), pt(y, "ADD_ATTR") || (_e.attributeCheck = null), y.ADD_TAGS && (typeof y.ADD_TAGS == "function" ? _e.tagCheck = y.ADD_TAGS : ($ === se && ($ = jt($)), xe($, y.ADD_TAGS, Me))), y.ADD_ATTR && (typeof y.ADD_ATTR == "function" ? _e.attributeCheck = y.ADD_ATTR : (G === q && (G = jt(G)), xe(G, y.ADD_ATTR, Me))), y.ADD_URI_SAFE_ATTR && xe(Ue, y.ADD_URI_SAFE_ATTR, Me), y.FORBID_CONTENTS && (ae === pe && (ae = jt(ae)), xe(ae, y.FORBID_CONTENTS, Me)), y.ADD_FORBID_CONTENTS && (ae === pe && (ae = jt(ae)), xe(ae, y.ADD_FORBID_CONTENTS, Me)), Qe && ($["#text"] = !0), k && xe($, ["html", "head", "body"]), $.table && (xe($, ["tbody"]), delete he.tbody), y.TRUSTED_TYPES_POLICY) {
4818
4818
  if (typeof y.TRUSTED_TYPES_POLICY.createHTML != "function")
4819
4819
  throw As('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
4820
4820
  if (typeof y.TRUSTED_TYPES_POLICY.createScriptURL != "function")
@@ -4839,7 +4839,7 @@ function Vi() {
4839
4839
  try {
4840
4840
  j(y).removeChild(y);
4841
4841
  } catch {
4842
- x(y);
4842
+ _(y);
4843
4843
  }
4844
4844
  }, At = function(y, Q) {
4845
4845
  try {
@@ -4901,17 +4901,17 @@ function Vi() {
4901
4901
  }, ee = function(y) {
4902
4902
  return typeof u == "function" && y instanceof u;
4903
4903
  };
4904
- function de(ie, y, Q) {
4904
+ function ce(ie, y, Q) {
4905
4905
  ia(ie, (re) => {
4906
4906
  re.call(s, y, Q, qt);
4907
4907
  });
4908
4908
  }
4909
- const ue = function(y) {
4909
+ const de = function(y) {
4910
4910
  let Q = null;
4911
- if (de(P.beforeSanitizeElements, y, null), is(y))
4911
+ if (ce(P.beforeSanitizeElements, y, null), is(y))
4912
4912
  return mt(y), !0;
4913
4913
  const re = Me(y.nodeName);
4914
- if (de(P.uponSanitizeElement, y, {
4914
+ if (ce(P.uponSanitizeElement, y, {
4915
4915
  tagName: re,
4916
4916
  allowedTags: $
4917
4917
  }), me && y.hasChildNodes() && !ee(y.firstElementChild) && Ye(/<[/\w!]/g, y.innerHTML) && Ye(/<[/\w!]/g, y.textContent) || y.nodeType === Ms.progressingInstruction || me && y.nodeType === Ms.comment && Ye(/<[/\w]/g, y.data))
@@ -4924,7 +4924,7 @@ function Vi() {
4924
4924
  if (Ke && Se) {
4925
4925
  const Ie = Ke.length;
4926
4926
  for (let rt = Ie - 1; rt >= 0; --rt) {
4927
- const Et = _(Ke[rt], !0);
4927
+ const Et = x(Ke[rt], !0);
4928
4928
  Et.__removalCount = (y.__removalCount || 0) + 1, Se.insertBefore(Et, w(y));
4929
4929
  }
4930
4930
  }
@@ -4935,11 +4935,11 @@ function Vi() {
4935
4935
  Q = Ts(Q, Se, " ");
4936
4936
  }), y.textContent !== Q && (Ps(s.removed, {
4937
4937
  element: y.cloneNode()
4938
- }), y.textContent = Q)), de(P.afterSanitizeElements, y, null), !1);
4938
+ }), y.textContent = Q)), ce(P.afterSanitizeElements, y, null), !1);
4939
4939
  }, Te = function(y, Q, re) {
4940
4940
  if (we[Q] || We && (Q === "id" || Q === "name") && (re in a || re in Oa))
4941
4941
  return !1;
4942
- if (!(R && !we[Q] && Ye(K, Q))) {
4942
+ if (!(L && !we[Q] && Ye(K, Q))) {
4943
4943
  if (!(F && Ye(W, Q))) {
4944
4944
  if (!(_e.attributeCheck instanceof Function && _e.attributeCheck(Q, y))) {
4945
4945
  if (!G[Q] || we[Q]) {
@@ -4952,9 +4952,9 @@ function Vi() {
4952
4952
  Q === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Ye(B.tagNameCheck, re) || B.tagNameCheck instanceof Function && B.tagNameCheck(re)))
4953
4953
  ) return !1;
4954
4954
  } else if (!Ue[Q]) {
4955
- if (!Ye(I, Ts(re, L, ""))) {
4955
+ if (!Ye(I, Ts(re, R, ""))) {
4956
4956
  if (!((Q === "src" || Q === "xlink:href" || Q === "href") && y !== "script" && qm(re, "data:") === 0 && ge[y])) {
4957
- if (!(Y && !Ye(D, Ts(re, L, "")))) {
4957
+ if (!(Y && !Ye(D, Ts(re, R, "")))) {
4958
4958
  if (re)
4959
4959
  return !1;
4960
4960
  }
@@ -4968,7 +4968,7 @@ function Vi() {
4968
4968
  }, ea = function(y) {
4969
4969
  return y !== "annotation-xml" && Ga(y, T);
4970
4970
  }, $r = function(y) {
4971
- de(P.beforeSanitizeAttributes, y, null);
4971
+ ce(P.beforeSanitizeAttributes, y, null);
4972
4972
  const {
4973
4973
  attributes: Q
4974
4974
  } = y;
@@ -4989,7 +4989,7 @@ function Vi() {
4989
4989
  value: Et
4990
4990
  } = Ke, ls = Me(Ie), $a = Et;
4991
4991
  let He = Ie === "value" ? $a : Bm($a);
4992
- if (re.attrName = ls, re.attrValue = He, re.keepAttr = !0, re.forceKeepAttr = void 0, de(P.uponSanitizeAttribute, y, re), He = re.attrValue, Be && (ls === "id" || ls === "name") && (At(Ie, y), He = tt + He), me && Ye(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, He)) {
4992
+ if (re.attrName = ls, re.attrValue = He, re.keepAttr = !0, re.forceKeepAttr = void 0, ce(P.uponSanitizeAttribute, y, re), He = re.attrValue, Be && (ls === "id" || ls === "name") && (At(Ie, y), He = tt + He), me && Ye(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, He)) {
4993
4993
  At(Ie, y);
4994
4994
  continue;
4995
4995
  }
@@ -5033,13 +5033,13 @@ function Vi() {
5033
5033
  At(Ie, y);
5034
5034
  }
5035
5035
  }
5036
- de(P.afterSanitizeAttributes, y, null);
5036
+ ce(P.afterSanitizeAttributes, y, null);
5037
5037
  }, Nl = function ie(y) {
5038
5038
  let Q = null;
5039
5039
  const re = Js(y);
5040
- for (de(P.beforeSanitizeShadowDOM, y, null); Q = re.nextNode(); )
5041
- de(P.uponSanitizeShadowNode, Q, null), ue(Q), $r(Q), Q.content instanceof i && ie(Q.content);
5042
- de(P.afterSanitizeShadowDOM, y, null);
5040
+ for (ce(P.beforeSanitizeShadowDOM, y, null); Q = re.nextNode(); )
5041
+ ce(P.uponSanitizeShadowNode, Q, null), de(Q), $r(Q), Q.content instanceof i && ie(Q.content);
5042
+ ce(P.afterSanitizeShadowDOM, y, null);
5043
5043
  };
5044
5044
  return s.sanitize = function(ie) {
5045
5045
  let y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Q = null, re = null, Se = null, Ke = null;
@@ -5051,7 +5051,7 @@ function Vi() {
5051
5051
  throw As("toString is not a function");
5052
5052
  if (!s.isSupported)
5053
5053
  return ie;
5054
- if (ce || Ns(y), s.removed = [], typeof ie == "string" && (Pt = !1), Pt) {
5054
+ if (oe || Ns(y), s.removed = [], typeof ie == "string" && (Pt = !1), Pt) {
5055
5055
  if (ie.nodeName) {
5056
5056
  const Et = Me(ie.nodeName);
5057
5057
  if (!$[Et] || he[Et])
@@ -5069,7 +5069,7 @@ function Vi() {
5069
5069
  Q && ye && mt(Q.firstChild);
5070
5070
  const Ie = Js(Pt ? ie : Q);
5071
5071
  for (; Se = Ie.nextNode(); )
5072
- ue(Se), $r(Se), Se.content instanceof i && Nl(Se.content);
5072
+ de(Se), $r(Se), Se.content instanceof i && Nl(Se.content);
5073
5073
  if (Pt)
5074
5074
  return ie;
5075
5075
  if (fe) {
@@ -5087,9 +5087,9 @@ function Vi() {
5087
5087
  }), v && le ? v.createHTML(rt) : rt;
5088
5088
  }, s.setConfig = function() {
5089
5089
  let ie = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
5090
- Ns(ie), ce = !0;
5090
+ Ns(ie), oe = !0;
5091
5091
  }, s.clearConfig = function() {
5092
- qt = null, ce = !1;
5092
+ qt = null, oe = !1;
5093
5093
  }, s.isValidAttribute = function(ie, y, Q) {
5094
5094
  qt || Ns({});
5095
5095
  const re = Me(ie), Se = Me(y);
@@ -5108,7 +5108,7 @@ function Vi() {
5108
5108
  P = vn();
5109
5109
  }, s;
5110
5110
  }
5111
- var Le = Vi();
5111
+ var Re = Vi();
5112
5112
  function Gs({
5113
5113
  searchValue: t,
5114
5114
  onSearchChange: s,
@@ -5409,6 +5409,8 @@ const np = {
5409
5409
  playlist_item_already_exists: "This item is already in the playlist",
5410
5410
  playlist_item_already_exists_named: "{{title}} already has this item",
5411
5411
  playlist_delete_item: "Delete Item",
5412
+ playlist_drag_to_reorder_aria: "Drag to reorder {{title}}",
5413
+ playlist_item_actions_aria: "Actions for {{title}}",
5412
5414
  playlist_table_order: "Order",
5413
5415
  playlist_table_item: "Item",
5414
5416
  playlist_table_type: "Type",
@@ -5573,106 +5575,106 @@ const np = {
5573
5575
  }, ip = Co({
5574
5576
  fallback: np,
5575
5577
  loaders: {
5576
- ar: () => import("./ar-D6LJV1_E.js").then(
5578
+ ar: () => import("./ar-ClhIoz6a.js").then(
5577
5579
  (t) => t.default
5578
5580
  ),
5579
- bg: () => import("./bg-C5Ldmily.js").then(
5581
+ bg: () => import("./bg-BksVMhMy.js").then(
5580
5582
  (t) => t.default
5581
5583
  ),
5582
- bn: () => import("./bn-kfMPWNR6.js").then(
5584
+ bn: () => import("./bn-Jn0udx5-.js").then(
5583
5585
  (t) => t.default
5584
5586
  ),
5585
- cs: () => import("./cs-DqEgtV8D.js").then(
5587
+ cs: () => import("./cs-CMdINoT1.js").then(
5586
5588
  (t) => t.default
5587
5589
  ),
5588
- da: () => import("./da-BbuvL7Gx.js").then(
5590
+ da: () => import("./da-D25F0yGh.js").then(
5589
5591
  (t) => t.default
5590
5592
  ),
5591
- de: () => import("./de-BfJ7rQig.js").then(
5593
+ de: () => import("./de-CZiafs2R.js").then(
5592
5594
  (t) => t.default
5593
5595
  ),
5594
- el: () => import("./el-BO0rLq6D.js").then(
5596
+ el: () => import("./el-BWLIj7n7.js").then(
5595
5597
  (t) => t.default
5596
5598
  ),
5597
- es: () => import("./es-BEVtEUXk.js").then(
5599
+ es: () => import("./es-pIE-fFV2.js").then(
5598
5600
  (t) => t.default
5599
5601
  ),
5600
- fi: () => import("./fi-DjISV3UN.js").then(
5602
+ fi: () => import("./fi-BEqBi0iR.js").then(
5601
5603
  (t) => t.default
5602
5604
  ),
5603
- fr: () => import("./fr-1fFd-aKy.js").then(
5605
+ fr: () => import("./fr-BsEpyTmn.js").then(
5604
5606
  (t) => t.default
5605
5607
  ),
5606
- he: () => import("./he-CaT9bwVp.js").then(
5608
+ he: () => import("./he-CVyG1N7p.js").then(
5607
5609
  (t) => t.default
5608
5610
  ),
5609
- hi: () => import("./hi-DkzEm57l.js").then(
5611
+ hi: () => import("./hi-CA89BVKL.js").then(
5610
5612
  (t) => t.default
5611
5613
  ),
5612
- hr: () => import("./hr-DqM5N_bj.js").then(
5614
+ hr: () => import("./hr-Dbk-j9u8.js").then(
5613
5615
  (t) => t.default
5614
5616
  ),
5615
- hu: () => import("./hu-DiLqjo5c.js").then(
5617
+ hu: () => import("./hu-D6LKkyaV.js").then(
5616
5618
  (t) => t.default
5617
5619
  ),
5618
- id: () => import("./id-DA1KmwgX.js").then(
5620
+ id: () => import("./id-BGR9VsQZ.js").then(
5619
5621
  (t) => t.default
5620
5622
  ),
5621
- it: () => import("./it-CTEVWCRz.js").then(
5623
+ it: () => import("./it-B1r6jnOe.js").then(
5622
5624
  (t) => t.default
5623
5625
  ),
5624
- ja: () => import("./ja-fxqg1hhg.js").then(
5626
+ ja: () => import("./ja-BpANsj6V.js").then(
5625
5627
  (t) => t.default
5626
5628
  ),
5627
- ko: () => import("./ko-Btp1_5YS.js").then(
5629
+ ko: () => import("./ko-DX3tlkQ_.js").then(
5628
5630
  (t) => t.default
5629
5631
  ),
5630
- ms: () => import("./ms-DqRbmHx8.js").then(
5632
+ ms: () => import("./ms--yFb9SFW.js").then(
5631
5633
  (t) => t.default
5632
5634
  ),
5633
- nl: () => import("./nl-CkPNddxO.js").then(
5635
+ nl: () => import("./nl-H9XiHH5i.js").then(
5634
5636
  (t) => t.default
5635
5637
  ),
5636
- no: () => import("./no-ftcy0RcQ.js").then(
5638
+ no: () => import("./no-BEW-_XcJ.js").then(
5637
5639
  (t) => t.default
5638
5640
  ),
5639
- pl: () => import("./pl-wyJLqfip.js").then(
5641
+ pl: () => import("./pl-CrFhIzj-.js").then(
5640
5642
  (t) => t.default
5641
5643
  ),
5642
- pt: () => import("./pt-7uHLacuI.js").then(
5644
+ pt: () => import("./pt-DlaqLtk5.js").then(
5643
5645
  (t) => t.default
5644
5646
  ),
5645
- ro: () => import("./ro-Dh12ghww.js").then(
5647
+ ro: () => import("./ro-gd_dWaXs.js").then(
5646
5648
  (t) => t.default
5647
5649
  ),
5648
- ru: () => import("./ru-DFM7xWFz.js").then(
5650
+ ru: () => import("./ru-DlyR-9Mq.js").then(
5649
5651
  (t) => t.default
5650
5652
  ),
5651
- sk: () => import("./sk-CsuNYa1k.js").then(
5653
+ sk: () => import("./sk-BhsGydo4.js").then(
5652
5654
  (t) => t.default
5653
5655
  ),
5654
- sv: () => import("./sv-DVrPaJbh.js").then(
5656
+ sv: () => import("./sv-B0ht7qZg.js").then(
5655
5657
  (t) => t.default
5656
5658
  ),
5657
- th: () => import("./th-BEkMpcVW.js").then(
5659
+ th: () => import("./th-ccJQMGOp.js").then(
5658
5660
  (t) => t.default
5659
5661
  ),
5660
- tl: () => import("./tl-CqwwplQC.js").then(
5662
+ tl: () => import("./tl-Bq05C1ac.js").then(
5661
5663
  (t) => t.default
5662
5664
  ),
5663
- tr: () => import("./tr-XEp4ekrM.js").then(
5665
+ tr: () => import("./tr-CRzzw4Hc.js").then(
5664
5666
  (t) => t.default
5665
5667
  ),
5666
- uk: () => import("./uk-DWdZFWBl.js").then(
5668
+ uk: () => import("./uk-Dn_JPwF7.js").then(
5667
5669
  (t) => t.default
5668
5670
  ),
5669
- vi: () => import("./vi-H__PaPsC.js").then(
5671
+ vi: () => import("./vi-LxWc0tDK.js").then(
5670
5672
  (t) => t.default
5671
5673
  ),
5672
- zh_CN: () => import("./zh_CN-B62j_w_1.js").then(
5674
+ zh_CN: () => import("./zh_CN-795k0aqz.js").then(
5673
5675
  (t) => t.default
5674
5676
  ),
5675
- zh_TW: () => import("./zh_TW-CYUIGBvP.js").then(
5677
+ zh_TW: () => import("./zh_TW-pxcxIx6W.js").then(
5676
5678
  (t) => t.default
5677
5679
  )
5678
5680
  }
@@ -5725,18 +5727,18 @@ function Ee() {
5725
5727
  function Ws() {
5726
5728
  return Ee().canCuratePlaylists !== !1;
5727
5729
  }
5728
- var Gi = Le;
5729
- Le.sanitize.bind(Le);
5730
- Le.isSupported;
5731
- Le.addHook.bind(Le);
5732
- Le.removeHook.bind(Le);
5733
- Le.removeHooks.bind(Le);
5734
- Le.removeAllHooks.bind(Le);
5735
- Le.setConfig.bind(Le);
5736
- Le.clearConfig.bind(Le);
5737
- Le.isValidAttribute.bind(Le);
5738
- Le.version;
5739
- Le.removed;
5730
+ var Gi = Re;
5731
+ Re.sanitize.bind(Re);
5732
+ Re.isSupported;
5733
+ Re.addHook.bind(Re);
5734
+ Re.removeHook.bind(Re);
5735
+ Re.removeHooks.bind(Re);
5736
+ Re.removeAllHooks.bind(Re);
5737
+ Re.setConfig.bind(Re);
5738
+ Re.clearConfig.bind(Re);
5739
+ Re.isValidAttribute.bind(Re);
5740
+ Re.version;
5741
+ Re.removed;
5740
5742
  const up = {
5741
5743
  amp: "&",
5742
5744
  apos: "'",
@@ -6127,30 +6129,30 @@ function Mp({
6127
6129
  { label: i("sort_price_desc"), value: "price_desc" }
6128
6130
  ],
6129
6131
  [i]
6130
- ), [c, d] = o.useState(""), [m, h] = o.useState(""), [p, f] = o.useState("created_at_desc"), [g, _] = o.useState("grid");
6132
+ ), [c, d] = o.useState(""), [m, h] = o.useState(""), [p, f] = o.useState("created_at_desc"), [g, x] = o.useState("grid");
6131
6133
  o.useEffect(() => {
6132
6134
  const S = setTimeout(() => {
6133
6135
  h(c);
6134
6136
  }, 300);
6135
6137
  return () => clearTimeout(S);
6136
6138
  }, [c]);
6137
- const x = m ? void 0 : p, w = Rt({
6139
+ const _ = m ? void 0 : p, w = Lt({
6138
6140
  queryKey: [
6139
6141
  "portal-product-catalog",
6140
6142
  m || "",
6141
6143
  oa,
6142
- x
6144
+ _
6143
6145
  ],
6144
6146
  queryFn: async ({ pageParam: S }) => s(
6145
6147
  m,
6146
6148
  S,
6147
6149
  oa,
6148
- x
6150
+ _
6149
6151
  ),
6150
6152
  getNextPageParam: (S) => S.meta?.pagination?.next_cursor ?? void 0,
6151
6153
  initialPageParam: void 0,
6152
6154
  enabled: !!s
6153
- }), b = Rt({
6155
+ }), b = Lt({
6154
6156
  queryKey: ["shareables-products", m, t],
6155
6157
  queryFn: async ({ pageParam: S = 1 }) => {
6156
6158
  if (!r) throw new Error("Unreachable: client is null");
@@ -6216,7 +6218,7 @@ function Mp({
6216
6218
  onSortChange: f
6217
6219
  }
6218
6220
  ) }),
6219
- /* @__PURE__ */ e.jsx(Mr, { value: g, onChange: _ })
6221
+ /* @__PURE__ */ e.jsx(Mr, { value: g, onChange: x })
6220
6222
  ] }),
6221
6223
  loadingFilterShape: "search-view",
6222
6224
  footer: M,
@@ -6269,12 +6271,12 @@ function Aa({
6269
6271
  pdfNextAriaLabel: d,
6270
6272
  pdfDocumentTitle: m
6271
6273
  }) {
6272
- const [h, p] = o.useState(!1), [f, g] = o.useState(1), [_, x] = o.useState(!1), w = o.useRef(null), b = Ot(), { t: j } = ne(), v = s || i, C = !!t && !_, N = v ? j("open_image_viewer_for", { title: v }) : j("open_image_viewer"), z = h && !n && !r && C, O = c ?? j("pdf_previous_page_aria"), U = d ?? j("pdf_next_page_aria"), E = m || j("pdf_document_title");
6274
+ const [h, p] = o.useState(!1), [f, g] = o.useState(1), [x, _] = o.useState(!1), w = o.useRef(null), b = Ot(), { t: j } = ne(), v = s || i, C = !!t && !x, N = v ? j("open_image_viewer_for", { title: v }) : j("open_image_viewer"), z = h && !n && !r && C, O = c ?? j("pdf_previous_page_aria"), U = d ?? j("pdf_next_page_aria"), E = m || j("pdf_document_title");
6273
6275
  o.useEffect(() => {
6274
- x(!1);
6276
+ _(!1);
6275
6277
  }, [t]);
6276
6278
  const P = () => {
6277
- x(!0), p(!1);
6279
+ _(!0), p(!1);
6278
6280
  }, A = () => {
6279
6281
  g((S) => S > 1 ? S - 1 : S);
6280
6282
  }, M = () => {
@@ -6575,7 +6577,7 @@ function Dp(t) {
6575
6577
  }
6576
6578
  );
6577
6579
  }
6578
- function Lp(t) {
6580
+ function Rp(t) {
6579
6581
  return /* @__PURE__ */ e.jsx(
6580
6582
  "svg",
6581
6583
  {
@@ -6587,7 +6589,7 @@ function Lp(t) {
6587
6589
  }
6588
6590
  );
6589
6591
  }
6590
- function Rp(t) {
6592
+ function Lp(t) {
6591
6593
  return /* @__PURE__ */ e.jsx(
6592
6594
  "svg",
6593
6595
  {
@@ -6614,14 +6616,14 @@ function zp({
6614
6616
  title: c("share_link_copied"),
6615
6617
  type: "success"
6616
6618
  });
6617
- } catch (_) {
6619
+ } catch (x) {
6618
6620
  l({
6619
6621
  title: c("share_link_copy_error"),
6620
6622
  type: "error",
6621
- error: _
6623
+ error: x
6622
6624
  });
6623
6625
  }
6624
- }, p = async (_) => {
6626
+ }, p = async (x) => {
6625
6627
  if (!t) {
6626
6628
  l({
6627
6629
  title: c("share_link_not_available"),
@@ -6630,7 +6632,7 @@ function zp({
6630
6632
  return;
6631
6633
  }
6632
6634
  await vp(
6633
- _.toLowerCase(),
6635
+ x.toLowerCase(),
6634
6636
  {
6635
6637
  url: t,
6636
6638
  title: a,
@@ -6639,8 +6641,8 @@ function zp({
6639
6641
  title: a
6640
6642
  })
6641
6643
  },
6642
- (x) => l({ title: x, type: "success" }),
6643
- (x) => l({ title: x, type: "error" }),
6644
+ (_) => l({ title: _, type: "success" }),
6645
+ (_) => l({ title: _, type: "error" }),
6644
6646
  bp(c)
6645
6647
  );
6646
6648
  }, f = async () => {
@@ -6661,18 +6663,18 @@ function zp({
6661
6663
  title: c("share_mysite_success"),
6662
6664
  type: "success"
6663
6665
  });
6664
- } catch (_) {
6666
+ } catch (x) {
6665
6667
  l({
6666
6668
  title: c("share_mysite_error"),
6667
6669
  type: "error",
6668
- error: _
6670
+ error: x
6669
6671
  });
6670
6672
  }
6671
6673
  }, g = [
6672
6674
  { name: "Facebook", Icon: Ip },
6673
6675
  { name: "Instagram", Icon: Dp },
6674
- { name: "TikTok", Icon: Lp },
6675
- { name: "X", Icon: Rp }
6676
+ { name: "TikTok", Icon: Rp },
6677
+ { name: "X", Icon: Lp }
6676
6678
  ];
6677
6679
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
6678
6680
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
@@ -6721,26 +6723,26 @@ function zp({
6721
6723
  open: d,
6722
6724
  onOpenChange: m,
6723
6725
  title: c("share_button"),
6724
- actions: g.map((_) => ({
6725
- id: _.name,
6726
- label: _.name,
6727
- onSelect: () => p(_.name)
6726
+ actions: g.map((x) => ({
6727
+ id: x.name,
6728
+ label: x.name,
6729
+ onSelect: () => p(x.name)
6728
6730
  }))
6729
6731
  }
6730
6732
  )
6731
- ] }) : g.map((_) => /* @__PURE__ */ e.jsxs(
6733
+ ] }) : g.map((x) => /* @__PURE__ */ e.jsxs(
6732
6734
  H,
6733
6735
  {
6734
- onClick: () => p(_.name),
6736
+ onClick: () => p(x.name),
6735
6737
  variant: "secondary",
6736
6738
  size: "sm",
6737
6739
  className: "border-foreground bg-background text-foreground hover:bg-muted h-8 rounded-md border px-3 text-xs font-semibold transition-colors",
6738
6740
  children: [
6739
- /* @__PURE__ */ e.jsx(_.Icon, { className: "mr-1.5 size-3" }),
6740
- _.name
6741
+ /* @__PURE__ */ e.jsx(x.Icon, { className: "mr-1.5 size-3" }),
6742
+ x.name
6741
6743
  ]
6742
6744
  },
6743
- _.name
6745
+ x.name
6744
6746
  ))
6745
6747
  ] }),
6746
6748
  /* @__PURE__ */ e.jsxs(
@@ -6811,7 +6813,7 @@ function Ea({
6811
6813
  className: u ? "border-foreground bg-background text-foreground hover:bg-muted flex h-10 items-center justify-center gap-2 rounded-lg border px-4 transition-all" : "bg-foreground text-background hover:bg-foreground/70 flex h-10 w-full items-center justify-between rounded-lg px-4 transition-all",
6812
6814
  children: [
6813
6815
  /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: m("share_download_asset") }),
6814
- /* @__PURE__ */ e.jsx(Ls, { className: "size-4" })
6816
+ /* @__PURE__ */ e.jsx(Rs, { className: "size-4" })
6815
6817
  ]
6816
6818
  }
6817
6819
  );
@@ -6843,7 +6845,7 @@ function Ea({
6843
6845
  )
6844
6846
  ] });
6845
6847
  }
6846
- const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = oe.memo(function({
6848
+ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = ue.memo(function({
6847
6849
  tabs: s,
6848
6850
  activeTab: a,
6849
6851
  onTabChange: r
@@ -6859,7 +6861,7 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = o
6859
6861
  },
6860
6862
  n.id
6861
6863
  )) });
6862
- }), Hp = oe.memo(function({
6864
+ }), Hp = ue.memo(function({
6863
6865
  mediaItem: s,
6864
6866
  onClick: a
6865
6867
  }) {
@@ -6883,7 +6885,7 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = o
6883
6885
  ]
6884
6886
  }
6885
6887
  );
6886
- }), qp = oe.memo(function({
6888
+ }), qp = ue.memo(function({
6887
6889
  message: s
6888
6890
  }) {
6889
6891
  const { t: a } = ne(), r = s ?? a("share_loading_media");
@@ -6891,12 +6893,12 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = o
6891
6893
  /* @__PURE__ */ e.jsx(it, { className: "size-8" }),
6892
6894
  /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-sm", children: r })
6893
6895
  ] });
6894
- }), Bp = oe.memo(function({
6896
+ }), Bp = ue.memo(function({
6895
6897
  message: s
6896
6898
  }) {
6897
6899
  const { t: a } = ne(), r = s ?? a("share_media_load_error");
6898
6900
  return /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "text-sm text-red-500", children: r }) });
6899
- }), Kp = oe.memo(function({
6901
+ }), Kp = ue.memo(function({
6900
6902
  message: s,
6901
6903
  icon: a,
6902
6904
  description: r
@@ -6908,13 +6910,13 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = o
6908
6910
  r && /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: r })
6909
6911
  ] })
6910
6912
  ] });
6911
- }), Vp = oe.memo(function() {
6913
+ }), Vp = ue.memo(function() {
6912
6914
  const { t: s } = ne();
6913
6915
  return /* @__PURE__ */ e.jsx("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
6914
6916
  /* @__PURE__ */ e.jsx("div", { className: "mb-1 text-sm text-gray-500", children: s("share_analytics_coming_soon") }),
6915
6917
  /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: s("share_analytics_description") })
6916
6918
  ] }) });
6917
- }), Gp = oe.memo(function({
6919
+ }), Gp = ue.memo(function({
6918
6920
  relateable_type: s
6919
6921
  }) {
6920
6922
  const { t: a } = ne(), n = o.useMemo(
@@ -6998,7 +7000,7 @@ function Wp({
6998
7000
  }
6999
7001
  );
7000
7002
  }
7001
- const Qp = oe.memo(Wp), Yp = [
7003
+ const Qp = ue.memo(Wp), Yp = [
7002
7004
  "a",
7003
7005
  "b",
7004
7006
  "blockquote",
@@ -7285,14 +7287,14 @@ function xh({
7285
7287
  queryKey: ["portal-products", "detail", t],
7286
7288
  queryFn: () => a(t),
7287
7289
  enabled: !!a
7288
- }), { data: _, isLoading: x } = Ve({
7290
+ }), { data: x, isLoading: _ } = Ve({
7289
7291
  queryKey: ["product", t],
7290
7292
  queryFn: () => {
7291
7293
  if (!u) throw new Error("Unreachable: client is null");
7292
7294
  return kp(u, t, { country_code: s });
7293
7295
  },
7294
7296
  enabled: !a && !!u
7295
- }), w = a ? g : x, {
7297
+ }), w = a ? g : _, {
7296
7298
  data: b,
7297
7299
  isLoading: j,
7298
7300
  error: v
@@ -7303,23 +7305,23 @@ function xh({
7303
7305
  shareLink: C,
7304
7306
  loading: N,
7305
7307
  error: z
7306
- } = Pa({ id: Number(t) }, "Product", void 0, m), O = f?.product, U = _?.product, E = O || U, P = O?.name || U?.title || "", A = O?.images?.[0]?.url || U?.image_url || "", M = O?.description || U?.description || U?.stripped || "", S = _h({
7308
+ } = Pa({ id: Number(t) }, "Product", void 0, m), O = f?.product, U = x?.product, E = O || U, P = O?.name || U?.title || "", A = O?.images?.[0]?.url || U?.image_url || "", M = O?.description || U?.description || U?.stripped || "", S = _h({
7307
7309
  portalMode: !!a,
7308
7310
  portalProduct: O,
7309
7311
  legacyProduct: U,
7310
7312
  locale: m
7311
- }), K = (b?.media ?? []).filter((L) => h === "all" ? !0 : h === "images" ? L.kind === "image" : h === "videos" ? L.kind === "video" : !0).map(
7312
- (L) => ({
7313
- id: L.id,
7314
- title: L.title,
7315
- image_url: L.image_url,
7316
- kind: L.kind || "",
7317
- video_url: L.video_url,
7318
- media_format: L.media_format
7313
+ }), K = (b?.media ?? []).filter((R) => h === "all" ? !0 : h === "images" ? R.kind === "image" : h === "videos" ? R.kind === "video" : !0).map(
7314
+ (R) => ({
7315
+ id: R.id,
7316
+ title: R.title,
7317
+ image_url: R.image_url,
7318
+ kind: R.kind || "",
7319
+ video_url: R.video_url,
7320
+ media_format: R.media_format
7319
7321
  })
7320
7322
  ), W = (b?.media?.length || 0) > 0, D = o.useCallback(
7321
- (L) => {
7322
- r?.("media", String(L.id));
7323
+ (R) => {
7324
+ r?.("media", String(R.id));
7323
7325
  },
7324
7326
  [r]
7325
7327
  );
@@ -7329,8 +7331,8 @@ function xh({
7329
7331
  kt,
7330
7332
  {
7331
7333
  href: "#",
7332
- onClick: (L) => {
7333
- L.preventDefault(), (i?.onClick ?? n ?? (() => c("products")))();
7334
+ onClick: (R) => {
7335
+ R.preventDefault(), (i?.onClick ?? n ?? (() => c("products")))();
7334
7336
  },
7335
7337
  children: d("products_breadcrumb")
7336
7338
  }
@@ -7410,10 +7412,10 @@ function kn(t) {
7410
7412
  function vh({
7411
7413
  maxProducts: t = 6
7412
7414
  }) {
7413
- const { t: s, locale: a } = ne(), { navigate: r, searchProducts: n } = Ee(), i = Ot(), l = o.useRef(null), u = o.useCallback((_) => {
7414
- const x = l.current;
7415
- x && x.scrollBy({
7416
- left: _ * Math.min(x.clientWidth * 0.85, 720),
7415
+ const { t: s, locale: a } = ne(), { navigate: r, searchProducts: n } = Ee(), i = Ot(), l = o.useRef(null), u = o.useCallback((x) => {
7416
+ const _ = l.current;
7417
+ _ && _.scrollBy({
7418
+ left: x * Math.min(_.clientWidth * 0.85, 720),
7417
7419
  behavior: "smooth"
7418
7420
  });
7419
7421
  }, []), { data: c, isLoading: d } = Ve({
@@ -7422,37 +7424,37 @@ function vh({
7422
7424
  enabled: !!n,
7423
7425
  staleTime: 300 * 1e3
7424
7426
  }), m = o.useMemo(
7425
- () => c?.filter((_) => _.id != null).map((_) => ({
7426
- id: _.id,
7427
- title: _.name ?? s("common_untitled"),
7428
- image_url: _.image_url ?? null
7427
+ () => c?.filter((x) => x.id != null).map((x) => ({
7428
+ id: x.id,
7429
+ title: x.name ?? s("common_untitled"),
7430
+ image_url: x.image_url ?? null
7429
7431
  })) ?? [],
7430
7432
  [c, s]
7431
7433
  ), h = o.useMemo(
7432
- () => m.slice(0, t).map((_) => _.id),
7434
+ () => m.slice(0, t).map((x) => x.id),
7433
7435
  [t, m]
7434
7436
  ), { data: p } = vu(h), f = o.useMemo(
7435
7437
  () => m.toSorted(
7436
- (_, x) => kn(p?.[x.id]) - kn(p?.[_.id])
7438
+ (x, _) => kn(p?.[_.id]) - kn(p?.[x.id])
7437
7439
  ).slice(0, t),
7438
7440
  [t, p, m]
7439
- ), g = (_, x = "object-cover transition-transform duration-500 group-hover:scale-105") => i({
7440
- src: _?.image_url || yh,
7441
- alt: _?.title ?? s("common_untitled"),
7441
+ ), g = (x, _ = "object-cover transition-transform duration-500 group-hover:scale-105") => i({
7442
+ src: x?.image_url || yh,
7443
+ alt: x?.title ?? s("common_untitled"),
7442
7444
  fill: !0,
7443
- className: x
7445
+ className: _
7444
7446
  });
7445
7447
  return d ? /* @__PURE__ */ e.jsxs("section", { className: "space-y-4", children: [
7446
7448
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
7447
7449
  /* @__PURE__ */ e.jsx(Oe, { className: "h-8 w-64" }),
7448
7450
  /* @__PURE__ */ e.jsx(Oe, { className: "h-4 w-full max-w-96" })
7449
7451
  ] }),
7450
- /* @__PURE__ */ e.jsx("div", { className: "-my-2 flex gap-4 overflow-x-auto py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: Array.from({ length: 3 }, (_, x) => /* @__PURE__ */ e.jsx(
7452
+ /* @__PURE__ */ e.jsx("div", { className: "-my-2 flex gap-4 overflow-x-auto py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: Array.from({ length: 3 }, (x, _) => /* @__PURE__ */ e.jsx(
7451
7453
  Oe,
7452
7454
  {
7453
7455
  className: "h-[25rem] min-w-[min(78vw,20rem)] rounded-[2rem] md:min-w-[22rem] lg:min-w-[23rem]"
7454
7456
  },
7455
- x
7457
+ _
7456
7458
  )) })
7457
7459
  ] }) : f.length === 0 ? null : /* @__PURE__ */ e.jsxs("section", { className: "space-y-4", children: [
7458
7460
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-end justify-between gap-4", children: [
@@ -7492,25 +7494,25 @@ function vh({
7492
7494
  {
7493
7495
  ref: l,
7494
7496
  className: "-my-2 flex snap-x gap-4 overflow-x-auto py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
7495
- children: f.map((_) => {
7496
- const x = bh(
7497
- _.title,
7497
+ children: f.map((x) => {
7498
+ const _ = bh(
7499
+ x.title,
7498
7500
  s("common_untitled")
7499
- ), w = p?.[_.id]?.toSorted((j, v) => v.id - j.id).slice(0, 3) ?? [], b = p?.[_.id]?.length ?? w.length;
7501
+ ), w = p?.[x.id]?.toSorted((j, v) => v.id - j.id).slice(0, 3) ?? [], b = p?.[x.id]?.length ?? w.length;
7500
7502
  return /* @__PURE__ */ e.jsxs(
7501
7503
  "button",
7502
7504
  {
7503
7505
  type: "button",
7504
- onClick: () => r(`product/${_.id}`),
7506
+ onClick: () => r(`product/${x.id}`),
7505
7507
  className: "group focus-visible:ring-ring relative h-[25rem] min-w-[min(78vw,20rem)] snap-start overflow-hidden rounded-[2rem] text-left shadow-sm transition-transform hover:-translate-y-1 focus-visible:ring-2 focus-visible:outline-none md:min-w-[22rem] lg:min-w-[23rem]",
7506
7508
  children: [
7507
- g(_),
7509
+ g(x),
7508
7510
  /* @__PURE__ */ e.jsx("span", { className: "bg-foreground/25 absolute inset-0" }),
7509
7511
  /* @__PURE__ */ e.jsx("span", { className: "from-foreground/85 via-foreground/20 absolute inset-0 bg-gradient-to-t to-transparent" }),
7510
7512
  /* @__PURE__ */ e.jsx("span", { className: "to-foreground/20 absolute inset-0 bg-gradient-to-b from-transparent" }),
7511
7513
  /* @__PURE__ */ e.jsxs("span", { className: "absolute inset-0 flex flex-col justify-between p-4", children: [
7512
7514
  /* @__PURE__ */ e.jsxs("span", { className: "text-background flex flex-col items-start gap-1 drop-shadow-sm", children: [
7513
- /* @__PURE__ */ e.jsx("span", { className: "max-w-[80%] text-base leading-tight font-bold", children: x }),
7515
+ /* @__PURE__ */ e.jsx("span", { className: "max-w-[80%] text-base leading-tight font-bold", children: _ }),
7514
7516
  /* @__PURE__ */ e.jsxs("span", { className: "text-background/90 flex items-center gap-2 text-sm font-semibold", children: [
7515
7517
  /* @__PURE__ */ e.jsx(ed, { className: "size-3.5 fill-current" }),
7516
7518
  s("media_product_carousel_count", {
@@ -7519,7 +7521,7 @@ function vh({
7519
7521
  ] })
7520
7522
  ] }),
7521
7523
  /* @__PURE__ */ e.jsx("span", { className: "text-background mx-auto max-w-[14rem] text-center text-3xl leading-none font-bold tracking-normal drop-shadow-md", children: s("media_product_carousel_kit_title", {
7522
- title: x
7524
+ title: _
7523
7525
  }) }),
7524
7526
  /* @__PURE__ */ e.jsx("span", { className: "mx-auto flex max-w-[13rem] justify-center gap-2", children: w.map((j) => /* @__PURE__ */ e.jsx(
7525
7527
  "span",
@@ -7532,7 +7534,7 @@ function vh({
7532
7534
  ] })
7533
7535
  ]
7534
7536
  },
7535
- _.id
7537
+ x.id
7536
7538
  );
7537
7539
  })
7538
7540
  }
@@ -7570,7 +7572,7 @@ function Zi({
7570
7572
  onAdded: u,
7571
7573
  restoreFocusTo: c
7572
7574
  }) {
7573
- const d = Ae(), m = dt(), { t: h } = ne(), { showToast: p } = Ee(), f = Ge(), [g, _] = o.useState(""), [x, w] = o.useState(""), [b, j] = o.useState(""), [v, C] = o.useState(
7575
+ const d = Ae(), m = dt(), { t: h } = ne(), { showToast: p } = Ee(), f = Ge(), [g, x] = o.useState(""), [_, w] = o.useState(""), [b, j] = o.useState(""), [v, C] = o.useState(
7574
7576
  /* @__PURE__ */ new Set()
7575
7577
  ), [N, z] = o.useState(null), [O, U] = o.useState(
7576
7578
  i
@@ -7589,12 +7591,12 @@ function Zi({
7589
7591
  hasNextPage: K,
7590
7592
  isFetchingNextPage: W,
7591
7593
  fetchNextPage: D,
7592
- error: L,
7594
+ error: R,
7593
7595
  isPending: T,
7594
7596
  isFetching: I,
7595
7597
  refetch: $
7596
- } = Rt({
7597
- ...Xi(d, x),
7598
+ } = Lt({
7599
+ ...Xi(d, _),
7598
7600
  enabled: t && M === "pick",
7599
7601
  // Hold the previous page while a new search is in flight, so the list
7600
7602
  // doesn't blank — and read as "no playlists" — on every keystroke.
@@ -7603,7 +7605,7 @@ function Zi({
7603
7605
  hasNextPage: K,
7604
7606
  isFetchingNextPage: W,
7605
7607
  fetchNextPage: D,
7606
- error: L
7608
+ error: R
7607
7609
  }), B = (F) => d.playlists.addItemToPlaylist(F, {
7608
7610
  items: [{ relateable_type: r, relateable_id: a }]
7609
7611
  }), he = () => {
@@ -7615,19 +7617,19 @@ function Zi({
7615
7617
  onSuccess: () => {
7616
7618
  u?.(), p({ type: "success", title: h("playlist_add_item_success") }), he(), s(!1);
7617
7619
  },
7618
- onError: (F, { id: R, title: Y }) => {
7620
+ onError: (F, { id: L, title: Y }) => {
7619
7621
  if (qr(F) && F.status === 409) {
7620
- C((Z) => new Set(Z).add(R)), z({ id: R, title: Y }), R === O && (U(null), P("pick"), u?.());
7622
+ C((Z) => new Set(Z).add(L)), z({ id: L, title: Y }), L === O && (U(null), P("pick"), u?.());
7621
7623
  return;
7622
7624
  }
7623
7625
  p({ type: "error", title: h("playlist_add_item_error"), error: F });
7624
7626
  }
7625
7627
  }), _e = ze({
7626
7628
  mutationFn: async (F) => {
7627
- const R = await d.playlists.createPlaylist({
7629
+ const L = await d.playlists.createPlaylist({
7628
7630
  playlist: { title: F }
7629
7631
  });
7630
- U(R.playlist.id), _(""), w(""), l?.(R.playlist.id), await B(R.playlist.id);
7632
+ U(L.playlist.id), x(""), w(""), l?.(L.playlist.id), await B(L.playlist.id);
7631
7633
  },
7632
7634
  onSuccess: () => {
7633
7635
  U(null), u?.(), p({ type: "success", title: h("playlist_add_item_success") }), s(!1);
@@ -7688,7 +7690,7 @@ function Zi({
7688
7690
  value: g,
7689
7691
  placeholder: h("playlist_picker_search"),
7690
7692
  "aria-label": h("playlist_picker_search"),
7691
- onChange: (F) => _(F.target.value)
7693
+ onChange: (F) => x(F.target.value)
7692
7694
  }
7693
7695
  ),
7694
7696
  /* @__PURE__ */ e.jsx(
@@ -7701,7 +7703,7 @@ function Zi({
7701
7703
  children: G
7702
7704
  }
7703
7705
  ),
7704
- T || I && se.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-6", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) : L ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-2 py-2", children: [
7706
+ T || I && se.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-6", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) : R ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-2 py-2", children: [
7705
7707
  /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: h("common_load_error_default") }),
7706
7708
  /* @__PURE__ */ e.jsx(H, { variant: "outline", size: "sm", onClick: () => $(), children: h("common_retry") })
7707
7709
  ] }) : se.length === 0 ? (
@@ -7710,7 +7712,7 @@ function Zi({
7710
7712
  the menu *behind* this dialog, so the way forward is to close
7711
7713
  what you just opened. */
7712
7714
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-3 py-2", children: [
7713
- /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: h(x ? "playlist_picker_no_matches" : "playlist_picker_empty") }),
7715
+ /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: h(_ ? "playlist_picker_no_matches" : "playlist_picker_empty") }),
7714
7716
  O === null && /* @__PURE__ */ e.jsx(
7715
7717
  H,
7716
7718
  {
@@ -7722,7 +7724,7 @@ function Zi({
7722
7724
  )
7723
7725
  ] })
7724
7726
  ) : se.map((F) => {
7725
- const R = v.has(F.id), Y = we.isPending || R;
7727
+ const L = v.has(F.id), Y = we.isPending || L;
7726
7728
  return /* @__PURE__ */ e.jsxs(
7727
7729
  "button",
7728
7730
  {
@@ -7763,7 +7765,7 @@ function Zi({
7763
7765
  ),
7764
7766
  /* @__PURE__ */ e.jsxs("span", { className: "flex min-w-0 flex-col", children: [
7765
7767
  /* @__PURE__ */ e.jsx("span", { className: "truncate", children: F.title }),
7766
- R && /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: h("playlist_item_already_exists") })
7768
+ L && /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: h("playlist_item_already_exists") })
7767
7769
  ] })
7768
7770
  ]
7769
7771
  },
@@ -7972,9 +7974,9 @@ function Ah({
7972
7974
  }) {
7973
7975
  const { t: s, locale: a } = ne(), r = dt(), n = Ae(), i = wr(), l = Ge(), { navigate: u, readOnly: c, showToast: d } = Ee(), m = Ws(), [h, p] = o.useState(
7974
7976
  {}
7975
- ), [f, g] = o.useState(null), [_, x] = o.useState(null), w = o.useRef(null), b = o.useCallback(
7976
- (k, ce) => (ye) => {
7977
- w.current = ye, x({ mediaId: k, mode: ce });
7977
+ ), [f, g] = o.useState(null), [x, _] = o.useState(null), w = o.useRef(null), b = o.useCallback(
7978
+ (k, oe) => (ye) => {
7979
+ w.current = ye, _({ mediaId: k, mode: oe });
7978
7980
  },
7979
7981
  []
7980
7982
  ), [j, v] = o.useState(""), [C, N] = o.useState(""), [z, O] = o.useState("newest"), [U, E] = o.useState("grid"), [P, A] = o.useState("all"), [M, S] = o.useState("all"), [K, W] = o.useState(!1);
@@ -7984,7 +7986,7 @@ function Ah({
7984
7986
  }, 300);
7985
7987
  return () => clearTimeout(k);
7986
7988
  }, [j]);
7987
- const { mutate: D, isPending: L } = ze({
7989
+ const { mutate: D, isPending: R } = ze({
7988
7990
  mutationFn: (k) => n.media.deleteMedia(k),
7989
7991
  onSuccess: () => {
7990
7992
  d({ title: s("media_delete_success"), type: "success" }), l.invalidateQueries({
@@ -8007,7 +8009,7 @@ function Ah({
8007
8009
  hasNextPage: B,
8008
8010
  fetchNextPage: he,
8009
8011
  error: we
8010
- } = Rt({
8012
+ } = Lt({
8011
8013
  queryKey: [
8012
8014
  ...Ne.media.list(
8013
8015
  C,
@@ -8039,13 +8041,13 @@ function Ah({
8039
8041
  isFetchingNextPage: q,
8040
8042
  fetchNextPage: he,
8041
8043
  error: we
8042
- }), R = o.useMemo(
8044
+ }), L = o.useMemo(
8043
8045
  () => Th.map((k) => ({
8044
8046
  value: k.value,
8045
8047
  label: s(k.labelKey)
8046
8048
  })),
8047
8049
  [s]
8048
- ), Y = R.find((k) => k.value === M)?.label ?? s("media_filter_all_types"), Z = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
8050
+ ), Y = L.find((k) => k.value === M)?.label ?? s("media_filter_all_types"), Z = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
8049
8051
  /* @__PURE__ */ e.jsx(Sc, { className: "size-4" }),
8050
8052
  /* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: Y })
8051
8053
  ] }), J = /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
@@ -8097,7 +8099,7 @@ function Ah({
8097
8099
  open: K,
8098
8100
  onOpenChange: W,
8099
8101
  title: s("media_filter_all_types"),
8100
- actions: R.map((k) => ({
8102
+ actions: L.map((k) => ({
8101
8103
  id: k.value,
8102
8104
  label: k.label,
8103
8105
  selected: M === k.value,
@@ -8116,7 +8118,7 @@ function Ah({
8116
8118
  children: Z
8117
8119
  }
8118
8120
  ) }),
8119
- /* @__PURE__ */ e.jsx(gt, { align: "end", children: R.map((k) => /* @__PURE__ */ e.jsxs(
8121
+ /* @__PURE__ */ e.jsx(gt, { align: "end", children: L.map((k) => /* @__PURE__ */ e.jsxs(
8120
8122
  Fe,
8121
8123
  {
8122
8124
  onClick: () => S(k.value),
@@ -8270,7 +8272,7 @@ function Ah({
8270
8272
  {
8271
8273
  variant: "secondary",
8272
8274
  onClick: () => g(null),
8273
- disabled: L,
8275
+ disabled: R,
8274
8276
  children: s("common_cancel")
8275
8277
  }
8276
8278
  ),
@@ -8279,31 +8281,31 @@ function Ah({
8279
8281
  {
8280
8282
  variant: "destructive",
8281
8283
  onClick: T,
8282
- disabled: L,
8283
- children: L ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : s("common_delete")
8284
+ disabled: R,
8285
+ children: R ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : s("common_delete")
8284
8286
  }
8285
8287
  )
8286
8288
  ] })
8287
8289
  }
8288
8290
  ),
8289
- _ && /* @__PURE__ */ e.jsx(
8291
+ x && /* @__PURE__ */ e.jsx(
8290
8292
  Zi,
8291
8293
  {
8292
8294
  open: !0,
8293
8295
  onOpenChange: (k) => {
8294
- k || x(null);
8296
+ k || _(null);
8295
8297
  },
8296
- contentId: _.mediaId,
8298
+ contentId: x.mediaId,
8297
8299
  contentType: "Medium",
8298
- mode: _.mode,
8299
- resumePlaylistId: h[_.mediaId] ?? null,
8300
+ mode: x.mode,
8301
+ resumePlaylistId: h[x.mediaId] ?? null,
8300
8302
  restoreFocusTo: w,
8301
- onPlaylistCreated: (k) => p((ce) => ({
8302
- ...ce,
8303
- [_.mediaId]: k
8303
+ onPlaylistCreated: (k) => p((oe) => ({
8304
+ ...oe,
8305
+ [x.mediaId]: k
8304
8306
  })),
8305
8307
  onAdded: () => p(
8306
- ({ [_.mediaId]: k, ...ce }) => ce
8308
+ ({ [x.mediaId]: k, ...oe }) => oe
8307
8309
  )
8308
8310
  }
8309
8311
  )
@@ -8445,13 +8447,13 @@ function Dh(t, s) {
8445
8447
  return s.default;
8446
8448
  }
8447
8449
  }
8448
- function Lh({
8450
+ function Rh({
8449
8451
  mediaId: t,
8450
8452
  onNavigate: s,
8451
8453
  onBack: a,
8452
8454
  parentBreadcrumb: r
8453
8455
  }) {
8454
- const { t: n, locale: i } = ne(), l = Ae(), u = wr(), { navigate: c, readOnly: d, mediaProductsApi: m } = Ee(), h = Ws(), [p, f] = o.useState(null), [g, _] = o.useState(!1), [x, w] = o.useState(null), b = o.useRef(null), { data: j, isLoading: v } = Ve({
8456
+ const { t: n, locale: i } = ne(), l = Ae(), u = wr(), { navigate: c, readOnly: d, mediaProductsApi: m } = Ee(), h = Ws(), [p, f] = o.useState(null), [g, x] = o.useState(!1), [_, w] = o.useState(null), b = o.useRef(null), { data: j, isLoading: v } = Ve({
8455
8457
  queryKey: Ne.media.detail(Number(t), u, i),
8456
8458
  queryFn: () => l.media.getMediaById(Number(t), i)
8457
8459
  }), {
@@ -8479,7 +8481,7 @@ function Lh({
8479
8481
  image: n("media_type_image"),
8480
8482
  pdf: n("media_type_pdf"),
8481
8483
  default: n("media_type_default")
8482
- }), L = E?.description?.body || E?.stripped || "", T = K ? M : E?.pdf_url || A;
8484
+ }), R = E?.description?.body || E?.stripped || "", T = K ? M : E?.pdf_url || A;
8483
8485
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
8484
8486
  /* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsxs(ct, { className: "text-lg", children: [
8485
8487
  /* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(
@@ -8515,7 +8517,7 @@ function Lh({
8515
8517
  notFound: !E,
8516
8518
  notFoundMessage: n("media_not_found"),
8517
8519
  title: P,
8518
- description: L,
8520
+ description: R,
8519
8521
  containerHeightClass: "md:h-[calc(95vh-140px)]",
8520
8522
  image: /* @__PURE__ */ e.jsxs("div", { className: "relative h-full overflow-hidden", children: [
8521
8523
  /* @__PURE__ */ e.jsx(
@@ -8550,7 +8552,7 @@ function Lh({
8550
8552
  Fh,
8551
8553
  {
8552
8554
  open: g,
8553
- onToggle: () => _((I) => !I),
8555
+ onToggle: () => x((I) => !I),
8554
8556
  triggerRef: b
8555
8557
  }
8556
8558
  ) : void 0,
@@ -8563,13 +8565,13 @@ function Lh({
8563
8565
  f({
8564
8566
  mediaId: Number(t),
8565
8567
  mode: "pick"
8566
- }), _(!1);
8568
+ }), x(!1);
8567
8569
  },
8568
8570
  onNewPlaylist: () => {
8569
8571
  f({
8570
8572
  mediaId: Number(t),
8571
8573
  mode: "create"
8572
- }), _(!1);
8574
+ }), x(!1);
8573
8575
  }
8574
8576
  }
8575
8577
  ) : void 0
@@ -8597,7 +8599,7 @@ function Lh({
8597
8599
  contentId: p.mediaId,
8598
8600
  contentType: "Medium",
8599
8601
  mode: p.mode,
8600
- resumePlaylistId: x?.mediaId === p.mediaId ? x.playlistId : null,
8602
+ resumePlaylistId: _?.mediaId === p.mediaId ? _.playlistId : null,
8601
8603
  restoreFocusTo: b,
8602
8604
  onPlaylistCreated: (I) => w({ mediaId: p.mediaId, playlistId: I }),
8603
8605
  onAdded: () => (
@@ -8621,7 +8623,7 @@ function ya({
8621
8623
  children: t,
8622
8624
  value: s
8623
8625
  }) {
8624
- return /* @__PURE__ */ e.jsx(rl.Provider, { value: s, children: /* @__PURE__ */ e.jsx(Rh, { children: t }) });
8626
+ return /* @__PURE__ */ e.jsx(rl.Provider, { value: s, children: /* @__PURE__ */ e.jsx(Lh, { children: t }) });
8625
8627
  }
8626
8628
  function ut() {
8627
8629
  const t = o.useContext(rl);
@@ -8632,7 +8634,7 @@ function ut() {
8632
8634
  return t;
8633
8635
  }
8634
8636
  const Fr = o.createContext(null), Ir = o.createContext(null);
8635
- function Rh({
8637
+ function Lh({
8636
8638
  children: t
8637
8639
  }) {
8638
8640
  return /* @__PURE__ */ e.jsx(Fr.Provider, { value: null, children: /* @__PURE__ */ e.jsx(Ir.Provider, { value: null, children: t }) });
@@ -8736,15 +8738,15 @@ const $h = (t = 300) => {
8736
8738
  const T = setTimeout(() => h(c), 300);
8737
8739
  return () => clearTimeout(T);
8738
8740
  }, [u, c]);
8739
- const p = u ? m : l.debouncedSearchQuery, [f, g] = o.useState(/* @__PURE__ */ new Map()), _ = o.useMemo(() => !t || !r ? t : t.map(
8741
+ const p = u ? m : l.debouncedSearchQuery, [f, g] = o.useState(/* @__PURE__ */ new Map()), x = o.useMemo(() => !t || !r ? t : t.map(
8740
8742
  (T) => T.includes(".") ? T : `${r}.${T}.*`
8741
- ), [t, r]), x = o.useMemo(() => {
8742
- if (!_?.length) return n;
8743
- if (_?.length === 1) return _[0];
8743
+ ), [t, r]), _ = o.useMemo(() => {
8744
+ if (!x?.length) return n;
8745
+ if (x?.length === 1) return x[0];
8744
8746
  if (!r) return n;
8745
- const T = _.map((I) => I.split(".")[1]).filter(Boolean);
8747
+ const T = x.map((I) => I.split(".")[1]).filter(Boolean);
8746
8748
  return T?.length ? `${r}.${T.join("|")}.*` : n;
8747
- }, [_, n, r]), {
8749
+ }, [x, n, r]), {
8748
8750
  data: w,
8749
8751
  isLoading: b,
8750
8752
  error: j,
@@ -8752,14 +8754,14 @@ const $h = (t = 300) => {
8752
8754
  fetchNextPage: C,
8753
8755
  hasNextPage: N,
8754
8756
  isFetchingNextPage: z
8755
- } = Rt({
8757
+ } = Lt({
8756
8758
  queryKey: ss.query({
8757
- path: x,
8759
+ path: _,
8758
8760
  search: p,
8759
- filters: _
8761
+ filters: x
8760
8762
  }),
8761
8763
  queryFn: ({ pageParam: T }) => a.queryDamAssets({
8762
- path: x || "*",
8764
+ path: _ || "*",
8763
8765
  search: p,
8764
8766
  tags_string: "*",
8765
8767
  exclude_tags: "file_resource",
@@ -8838,7 +8840,7 @@ const $h = (t = 300) => {
8838
8840
  return I && T[I] ? { [I]: T[I] } : T;
8839
8841
  },
8840
8842
  [r]
8841
- ), { folders: D, allAssets: L } = o.useMemo(() => {
8843
+ ), { folders: D, allAssets: R } = o.useMemo(() => {
8842
8844
  if (!w?.pages?.length)
8843
8845
  return { folders: [], allAssets: [] };
8844
8846
  const T = r?.toString(), I = T ? [T] : [];
@@ -8873,7 +8875,7 @@ const $h = (t = 300) => {
8873
8875
  selectedAssets: K,
8874
8876
  selectedAssetsMap: f,
8875
8877
  folders: D ?? [],
8876
- assets: L ?? [],
8878
+ assets: R ?? [],
8877
8879
  isLoading: b,
8878
8880
  error: j,
8879
8881
  isSearching: c !== p,
@@ -8927,8 +8929,8 @@ function Vh({
8927
8929
  control: r.control,
8928
8930
  name: "folderName",
8929
8931
  render: ({ field: u }) => /* @__PURE__ */ e.jsxs(Dl, { children: [
8930
- /* @__PURE__ */ e.jsx(Ll, { children: "Folder Name" }),
8931
- /* @__PURE__ */ e.jsx(Rl, { children: /* @__PURE__ */ e.jsx(
8932
+ /* @__PURE__ */ e.jsx(Rl, { children: "Folder Name" }),
8933
+ /* @__PURE__ */ e.jsx(Ll, { children: /* @__PURE__ */ e.jsx(
8932
8934
  $e,
8933
8935
  {
8934
8936
  placeholder: "Enter folder name",
@@ -9239,9 +9241,9 @@ function Dr({
9239
9241
  const m = Xh(s, a), h = (p, f) => {
9240
9242
  const g = (w) => {
9241
9243
  w.preventDefault(), i(w, p.id, f);
9242
- }, _ = l ? (w) => {
9244
+ }, x = l ? (w) => {
9243
9245
  w.preventDefault(), w.stopPropagation(), l(w, p.id, f);
9244
- } : void 0, x = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
9246
+ } : void 0, _ = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
9245
9247
  c?.(p),
9246
9248
  s === "list" ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-4", children: [
9247
9249
  /* @__PURE__ */ e.jsx("div", { className: "h-12 w-12 shrink-0 overflow-hidden rounded bg-gray-100", children: n(p.raw, "list") }),
@@ -9270,17 +9272,17 @@ function Dr({
9270
9272
  s === "list" && "flex items-start gap-4 p-3"
9271
9273
  ),
9272
9274
  onClick: g,
9273
- onDoubleClick: _,
9275
+ onDoubleClick: x,
9274
9276
  onKeyDown: (w) => {
9275
9277
  (w.key === "Enter" || w.key === " ") && (w.preventDefault(), i(w, p.id, f));
9276
9278
  },
9277
- children: x
9279
+ children: _
9278
9280
  }
9279
9281
  );
9280
9282
  };
9281
9283
  return /* @__PURE__ */ e.jsx("div", { className: ve("grid gap-4", m), children: t.map((p, f) => {
9282
- const g = h(p, f), _ = d ? d(p, g) : g;
9283
- return /* @__PURE__ */ e.jsx(oe.Fragment, { children: _ }, p.id);
9284
+ const g = h(p, f), x = d ? d(p, g) : g;
9285
+ return /* @__PURE__ */ e.jsx(ue.Fragment, { children: x }, p.id);
9284
9286
  }) });
9285
9287
  }
9286
9288
  function Zh(t) {
@@ -9320,8 +9322,8 @@ const hl = o.forwardRef(
9320
9322
  onFoldersChange: p,
9321
9323
  previewContainer: f,
9322
9324
  previewAsset: g,
9323
- onPreviewAssetChange: _
9324
- }, x) => {
9325
+ onPreviewAssetChange: x
9326
+ }, _) => {
9325
9327
  "use no memo";
9326
9328
  const w = vs(), { companyId: b, toast: j } = ut(), v = Ge(), C = l !== void 0 && u ? {
9327
9329
  searchQuery: l,
@@ -9339,7 +9341,7 @@ const hl = o.forwardRef(
9339
9341
  selectedAssetsMap: K,
9340
9342
  folders: W,
9341
9343
  assets: D,
9342
- isLoading: L,
9344
+ isLoading: R,
9343
9345
  isSearching: T,
9344
9346
  hasNextPage: I,
9345
9347
  loadMore: $,
@@ -9358,7 +9360,7 @@ const hl = o.forwardRef(
9358
9360
  return V.sortDirection === "asc" ? ge : -ge;
9359
9361
  }
9360
9362
  if (V.sortBy === "created_at") {
9361
- const ge = ae.id ?? 0, Re = pe.id ?? 0, Ue = ge - Re;
9363
+ const ge = ae.id ?? 0, Le = pe.id ?? 0, Ue = ge - Le;
9362
9364
  return V.sortDirection === "asc" ? Ue : -Ue;
9363
9365
  }
9364
9366
  return 0;
@@ -9386,7 +9388,7 @@ const hl = o.forwardRef(
9386
9388
  onError: () => {
9387
9389
  j.error("Failed to move assets to folder.");
9388
9390
  }
9389
- }), [R, Y] = o.useState(null), Z = o.useRef(-1), J = o.useRef(
9391
+ }), [L, Y] = o.useState(null), Z = o.useRef(-1), J = o.useRef(
9390
9392
  null
9391
9393
  ), { mutate: me, isPending: k } = ze({
9392
9394
  mutationFn: (V) => w.deleteDamAsset(V),
@@ -9396,7 +9398,7 @@ const hl = o.forwardRef(
9396
9398
  onError: () => {
9397
9399
  j.error("Failed to delete asset.");
9398
9400
  }
9399
- }), { mutate: ce, isPending: ye } = ze(
9401
+ }), { mutate: oe, isPending: ye } = ze(
9400
9402
  {
9401
9403
  mutationFn: (V) => w.discardDamAsset(V),
9402
9404
  onSuccess: () => {
@@ -9416,10 +9418,10 @@ const hl = o.forwardRef(
9416
9418
  return;
9417
9419
  }
9418
9420
  const ae = A().map((pe) => {
9419
- const ge = b.toString() + ".", Re = fe(pe.metadata.file_name);
9421
+ const ge = b.toString() + ".", Le = fe(pe.metadata.file_name);
9420
9422
  return {
9421
9423
  code: pe.asset_code,
9422
- asset_paths: [`${ge}${V.folderName}.${Re}`]
9424
+ asset_paths: [`${ge}${V.folderName}.${Le}`]
9423
9425
  };
9424
9426
  });
9425
9427
  _e(ae);
@@ -9439,7 +9441,7 @@ const hl = o.forwardRef(
9439
9441
  [A, _e]
9440
9442
  );
9441
9443
  o.useImperativeHandle(
9442
- x,
9444
+ _,
9443
9445
  () => ({
9444
9446
  clearSelection: () => {
9445
9447
  E();
@@ -9495,15 +9497,15 @@ const hl = o.forwardRef(
9495
9497
  const We = o.useRef(a);
9496
9498
  We.current = a, o.useEffect(() => {
9497
9499
  const V = (S ?? []).length, ae = A(), pe = {};
9498
- K.forEach((ge, Re) => {
9500
+ K.forEach((ge, Le) => {
9499
9501
  const Ue = ge?.asset?.variants?.length ?? 0;
9500
- Ue > 0 && (pe[Re] = Ue);
9502
+ Ue > 0 && (pe[Le] = Ue);
9501
9503
  }), We.current?.(V, ae, pe);
9502
9504
  }, [S, A, K]);
9503
9505
  const Be = (V, ae, pe) => {
9504
- const ge = ae.variants.find((Re) => Re.ready) || ae.variants[0];
9506
+ const ge = ae.variants.find((Le) => Le.ready) || ae.variants[0];
9505
9507
  if (V.shiftKey && t.maxFiles !== 1) {
9506
- const Re = Z.current, Ue = Re >= 0 ? Math.min(Re, pe) : pe, Qt = Re >= 0 ? Math.max(Re, pe) : pe, vt = q?.slice(Ue, Qt + 1) ?? [], Tt = t.maxFiles ? Math.max(0, t.maxFiles - S.length) : vt.length;
9508
+ const Le = Z.current, Ue = Le >= 0 ? Math.min(Le, pe) : pe, Qt = Le >= 0 ? Math.max(Le, pe) : pe, vt = q?.slice(Ue, Qt + 1) ?? [], Tt = t.maxFiles ? Math.max(0, t.maxFiles - S.length) : vt.length;
9507
9509
  let st = 0;
9508
9510
  vt.forEach((at) => {
9509
9511
  if (S.includes(at.asset_code) || st >= Tt) return;
@@ -9542,10 +9544,10 @@ const hl = o.forwardRef(
9542
9544
  /* @__PURE__ */ e.jsx(
9543
9545
  Pn,
9544
9546
  {
9545
- open: R?.type === "Delete",
9546
- description: `This asset **${R?.item.name}** will be permanently deleted.`,
9547
+ open: L?.type === "Delete",
9548
+ description: `This asset **${L?.item.name}** will be permanently deleted.`,
9547
9549
  onCancel: tt,
9548
- onAction: () => me(R?.item.asset_code ?? "", {
9550
+ onAction: () => me(L?.item.asset_code ?? "", {
9549
9551
  onSuccess: tt
9550
9552
  }),
9551
9553
  title: "Are you sure?",
@@ -9556,9 +9558,9 @@ const hl = o.forwardRef(
9556
9558
  Pn,
9557
9559
  {
9558
9560
  actionLabel: "Discard",
9559
- open: R?.type === "Discard",
9560
- description: `This asset **${R?.item.name}** will be discarded from your library and will be permanently deleted after a month!`,
9561
- onAction: () => ce(R?.item.asset_code ?? "", {
9561
+ open: L?.type === "Discard",
9562
+ description: `This asset **${L?.item.name}** will be discarded from your library and will be permanently deleted after a month!`,
9563
+ onAction: () => oe(L?.item.asset_code ?? "", {
9562
9564
  onSuccess: tt
9563
9565
  }),
9564
9566
  title: "Are you sure?",
@@ -9571,7 +9573,7 @@ const hl = o.forwardRef(
9571
9573
  bs,
9572
9574
  {
9573
9575
  open: g !== null,
9574
- onOpenChange: (V) => !V && _?.(null),
9576
+ onOpenChange: (V) => !V && x?.(null),
9575
9577
  children: /* @__PURE__ */ e.jsxs(yr, { container: f ?? void 0, children: [
9576
9578
  /* @__PURE__ */ e.jsx(br, { className: "z-9999 bg-black/70 backdrop-blur-none" }),
9577
9579
  /* @__PURE__ */ e.jsx(
@@ -9594,7 +9596,7 @@ const hl = o.forwardRef(
9594
9596
  }
9595
9597
  ),
9596
9598
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
9597
- /* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsx(ct, { className: "min-w-0 flex-wrap", children: G.map((V, ae) => /* @__PURE__ */ e.jsxs(oe.Fragment, { children: [
9599
+ /* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsx(ct, { className: "min-w-0 flex-wrap", children: G.map((V, ae) => /* @__PURE__ */ e.jsxs(ue.Fragment, { children: [
9598
9600
  /* @__PURE__ */ e.jsx(Ce, { className: "inline-flex min-w-0", children: V.isCurrent ? /* @__PURE__ */ e.jsx(Ze, { className: "max-w-48 truncate sm:max-w-xs", children: V.label }) : /* @__PURE__ */ e.jsx(
9599
9601
  H,
9600
9602
  {
@@ -9609,7 +9611,7 @@ const hl = o.forwardRef(
9609
9611
  ) }),
9610
9612
  ae < G.length - 1 && /* @__PURE__ */ e.jsx(xt, {})
9611
9613
  ] }, V.path)) }) }),
9612
- L || T ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
9614
+ R || T ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
9613
9615
  /* @__PURE__ */ e.jsx("div", { className: "mx-auto mb-2 h-8 w-8 animate-spin rounded-full border-2 border-blue-600 border-t-transparent" }),
9614
9616
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500", children: T ? "Searching..." : "Loading assets..." })
9615
9617
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
@@ -9656,7 +9658,7 @@ const hl = o.forwardRef(
9656
9658
  tn(
9657
9659
  J,
9658
9660
  Be,
9659
- (Ue) => _?.(Ue),
9661
+ (Ue) => x?.(Ue),
9660
9662
  ge,
9661
9663
  pe
9662
9664
  ).onClick(V);
@@ -9667,7 +9669,7 @@ const hl = o.forwardRef(
9667
9669
  tn(
9668
9670
  J,
9669
9671
  Be,
9670
- (Ue) => _?.(Ue),
9672
+ (Ue) => x?.(Ue),
9671
9673
  ge,
9672
9674
  pe
9673
9675
  ).onDoubleClick(V);
@@ -9683,7 +9685,7 @@ const hl = o.forwardRef(
9683
9685
  ),
9684
9686
  wrapItem: (V, ae) => /* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
9685
9687
  /* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: ae }),
9686
- /* @__PURE__ */ e.jsx(Lt, { children: V.name })
9688
+ /* @__PURE__ */ e.jsx(Rt, { children: V.name })
9687
9689
  ] }) }, V.id)
9688
9690
  }
9689
9691
  ),
@@ -9706,7 +9708,7 @@ const hl = o.forwardRef(
9706
9708
  }
9707
9709
  ) })
9708
9710
  ] }),
9709
- W?.length === 0 && q?.length === 0 && !L && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
9711
+ W?.length === 0 && q?.length === 0 && !R && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
9710
9712
  /* @__PURE__ */ e.jsx("div", { className: "mb-4 rounded-full bg-gray-100 p-3", children: /* @__PURE__ */ e.jsx(ar, { className: "h-6 w-6 text-gray-400" }) }),
9711
9713
  /* @__PURE__ */ e.jsx("h3", { className: "mb-1 text-sm font-medium text-gray-900", children: "No assets found" }),
9712
9714
  /* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500", children: "Try searching for something else or navigate to a different folder" })
@@ -9731,7 +9733,7 @@ const Jh = ({
9731
9733
  onClick: () => a(n.id),
9732
9734
  className: `flex h-8 w-full cursor-pointer items-center justify-start gap-2 rounded-md p-2 text-left text-sm transition-colors hover:bg-gray-100 ${s === n.id ? "bg-gray-100 font-medium text-gray-900" : "text-gray-700"}`,
9733
9735
  children: [
9734
- oe.createElement(n.icon, {
9736
+ ue.createElement(n.icon, {
9735
9737
  className: "h-4 w-4 text-gray-500"
9736
9738
  }),
9737
9739
  /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: n.label })
@@ -9801,8 +9803,8 @@ const ef = ({
9801
9803
  showNamesOnMedia: p = !0,
9802
9804
  onShowNamesOnMediaChange: f,
9803
9805
  hasSelectedFiles: g = !1,
9804
- damFolders: _ = [],
9805
- onAddToNewFolder: x,
9806
+ damFolders: x = [],
9807
+ onAddToNewFolder: _,
9806
9808
  onAddToExistingFolder: w,
9807
9809
  filters: b,
9808
9810
  onFiltersChange: j,
@@ -9814,7 +9816,7 @@ const ef = ({
9814
9816
  unsplashSearching: U = !1,
9815
9817
  isUnsplashUploading: E = !1
9816
9818
  }) => {
9817
- const [P, A] = o.useState(!1), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D, L] = o.useState(!1), T = js(), I = t === "select" && (s === "dam" || s === "media"), $ = t === "select" && s === "unsplash", se = t === "select" ? a.find((B) => B.id === s)?.label || "Select Files" : "Media Details", G = a.filter(
9819
+ const [P, A] = o.useState(!1), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D, R] = o.useState(!1), T = js(), I = t === "select" && (s === "dam" || s === "media"), $ = t === "select" && s === "unsplash", se = t === "select" ? a.find((B) => B.id === s)?.label || "Select Files" : "Media Details", G = a.filter(
9818
9820
  (B) => Mi.includes(B.id)
9819
9821
  ), q = T && t === "select" && n !== void 0 && G.length > 1;
9820
9822
  return /* @__PURE__ */ e.jsxs("div", { className: "sticky top-0 z-20 flex w-full flex-wrap items-center justify-between gap-3 border-b border-gray-100 bg-white px-6 py-3", children: [
@@ -9828,7 +9830,7 @@ const ef = ({
9828
9830
  "data-testid": "file-picker-method-switcher",
9829
9831
  "aria-haspopup": "dialog",
9830
9832
  "aria-expanded": D,
9831
- onClick: () => L(!0),
9833
+ onClick: () => R(!0),
9832
9834
  className: "h-8 shrink-0 gap-1 px-2 text-lg font-semibold text-gray-900 hover:bg-gray-100",
9833
9835
  children: [
9834
9836
  se,
@@ -9840,7 +9842,7 @@ const ef = ({
9840
9842
  Xe,
9841
9843
  {
9842
9844
  open: D,
9843
- onOpenChange: L,
9845
+ onOpenChange: R,
9844
9846
  title: "Choose source",
9845
9847
  actions: G.map((B) => ({
9846
9848
  id: B.id,
@@ -9901,7 +9903,7 @@ const ef = ({
9901
9903
  children: /* @__PURE__ */ e.jsx(Gn, { className: "h-3 w-3" })
9902
9904
  }
9903
9905
  ) }),
9904
- /* @__PURE__ */ e.jsx(Lt, { children: "Zoom out" })
9906
+ /* @__PURE__ */ e.jsx(Rt, { children: "Zoom out" })
9905
9907
  ] }) }),
9906
9908
  /* @__PURE__ */ e.jsx(
9907
9909
  qn,
@@ -9933,7 +9935,7 @@ const ef = ({
9933
9935
  children: /* @__PURE__ */ e.jsx(Wt, { className: "h-3 w-3" })
9934
9936
  }
9935
9937
  ) }),
9936
- /* @__PURE__ */ e.jsx(Lt, { children: "Zoom in" })
9938
+ /* @__PURE__ */ e.jsx(Rt, { children: "Zoom in" })
9937
9939
  ] }) })
9938
9940
  ]
9939
9941
  }
@@ -9951,7 +9953,7 @@ const ef = ({
9951
9953
  children: /* @__PURE__ */ e.jsx(sd, { className: "h-4 w-4" })
9952
9954
  }
9953
9955
  ) }),
9954
- /* @__PURE__ */ e.jsx(Lt, { children: m === "list" ? "Not available in list view" : p ? "Hide names on media" : "Show names on media" })
9956
+ /* @__PURE__ */ e.jsx(Rt, { children: m === "list" ? "Not available in list view" : p ? "Hide names on media" : "Show names on media" })
9955
9957
  ] }) }),
9956
9958
  /* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
9957
9959
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 rounded-md border border-gray-200 bg-gray-50 p-0.5", children: [
@@ -9966,7 +9968,7 @@ const ef = ({
9966
9968
  children: /* @__PURE__ */ e.jsx(Kn, { className: "h-3.5 w-3.5" })
9967
9969
  }
9968
9970
  ) }),
9969
- /* @__PURE__ */ e.jsx(Lt, { children: "Grid View" })
9971
+ /* @__PURE__ */ e.jsx(Rt, { children: "Grid View" })
9970
9972
  ] }) }),
9971
9973
  /* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
9972
9974
  /* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
@@ -9979,7 +9981,7 @@ const ef = ({
9979
9981
  children: /* @__PURE__ */ e.jsx(_r, { className: "h-3.5 w-3.5" })
9980
9982
  }
9981
9983
  ) }),
9982
- /* @__PURE__ */ e.jsx(Lt, { children: "List View" })
9984
+ /* @__PURE__ */ e.jsx(Rt, { children: "List View" })
9983
9985
  ] }) })
9984
9986
  ] }),
9985
9987
  /* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
@@ -10006,9 +10008,9 @@ const ef = ({
10006
10008
  {
10007
10009
  id: "new",
10008
10010
  label: "Add to New Folder",
10009
- onSelect: () => x?.()
10011
+ onSelect: () => _?.()
10010
10012
  },
10011
- ..._.map((B) => ({
10013
+ ...x.map((B) => ({
10012
10014
  id: B,
10013
10015
  label: B.split(".").pop() || B,
10014
10016
  onSelect: () => w?.(B)
@@ -10031,7 +10033,7 @@ const ef = ({
10031
10033
  /* @__PURE__ */ e.jsxs(
10032
10034
  Fe,
10033
10035
  {
10034
- onClick: () => x?.(),
10036
+ onClick: () => _?.(),
10035
10037
  className: "cursor-pointer",
10036
10038
  children: [
10037
10039
  /* @__PURE__ */ e.jsx(sa, { className: "mr-2 h-4 w-4" }),
@@ -10039,12 +10041,12 @@ const ef = ({
10039
10041
  ]
10040
10042
  }
10041
10043
  ),
10042
- _.length > 0 && /* @__PURE__ */ e.jsxs(bo, { children: [
10044
+ x.length > 0 && /* @__PURE__ */ e.jsxs(bo, { children: [
10043
10045
  /* @__PURE__ */ e.jsxs(vo, { className: "cursor-pointer", children: [
10044
10046
  /* @__PURE__ */ e.jsx(sa, { className: "mr-2 h-4 w-4" }),
10045
10047
  "Add to Existing Folder"
10046
10048
  ] }),
10047
- /* @__PURE__ */ e.jsx(jo, { className: "z-350 max-h-64 overflow-y-auto", children: _.map((B) => /* @__PURE__ */ e.jsxs(
10049
+ /* @__PURE__ */ e.jsx(jo, { className: "z-350 max-h-64 overflow-y-auto", children: x.map((B) => /* @__PURE__ */ e.jsxs(
10048
10050
  Fe,
10049
10051
  {
10050
10052
  onClick: () => w?.(B),
@@ -10059,7 +10061,7 @@ const ef = ({
10059
10061
  ] })
10060
10062
  ] })
10061
10063
  ] }) }) }),
10062
- /* @__PURE__ */ e.jsx(Lt, { children: g ? "Add selected files to a folder" : "Select files to add to a folder" })
10064
+ /* @__PURE__ */ e.jsx(Rt, { children: g ? "Add selected files to a folder" : "Select files to add to a folder" })
10063
10065
  ] }) }),
10064
10066
  s === "dam" && /* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
10065
10067
  T ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -10106,7 +10108,7 @@ const ef = ({
10106
10108
  children: /* @__PURE__ */ e.jsx(Wr, { className: "h-4 w-4" })
10107
10109
  }
10108
10110
  ) }) }),
10109
- /* @__PURE__ */ e.jsx(Lt, { children: "Filters" })
10111
+ /* @__PURE__ */ e.jsx(Rt, { children: "Filters" })
10110
10112
  ] }) }),
10111
10113
  /* @__PURE__ */ e.jsx(ko, { align: "end", className: "w-auto p-0", children: /* @__PURE__ */ e.jsx(
10112
10114
  mr,
@@ -10174,7 +10176,7 @@ const ef = ({
10174
10176
  B.id
10175
10177
  )) })
10176
10178
  ] }) }) }),
10177
- /* @__PURE__ */ e.jsx(Lt, { children: "Sort" })
10179
+ /* @__PURE__ */ e.jsx(Rt, { children: "Sort" })
10178
10180
  ] }) })
10179
10181
  ] }),
10180
10182
  /* @__PURE__ */ e.jsx(H, { variant: "ghost", size: "sm", onClick: r, className: "ml-2", children: /* @__PURE__ */ e.jsx(Vt, { className: "h-4 w-4" }) })
@@ -10204,24 +10206,24 @@ const ef = ({
10204
10206
  previewMedia: f,
10205
10207
  onPreviewMediaChange: g
10206
10208
  }) => {
10207
- const { shareablesClient: _ } = ut(), x = _?.media.cacheKey ?? "default", [w, b] = o.useState(""), j = i !== void 0 && l != null, v = j ? i : w, C = j ? l : b, [N, z] = o.useState([]), [O, U] = o.useState(1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), S = o.useMemo(() => {
10209
+ const { shareablesClient: x } = ut(), _ = x?.media.cacheKey ?? "default", [w, b] = o.useState(""), j = i !== void 0 && l != null, v = j ? i : w, C = j ? l : b, [N, z] = o.useState([]), [O, U] = o.useState(1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), S = o.useMemo(() => {
10208
10210
  if (m && ca[m])
10209
10211
  return ca[m];
10210
10212
  if (!(!t.fileTypeFilter || t.fileTypeFilter.length === 0)) {
10211
- for (const R of t.fileTypeFilter)
10212
- if (ca[R])
10213
- return ca[R];
10213
+ for (const L of t.fileTypeFilter)
10214
+ if (ca[L])
10215
+ return ca[L];
10214
10216
  }
10215
10217
  }, [m, t.fileTypeFilter]), {
10216
10218
  data: K,
10217
10219
  isLoading: W,
10218
10220
  error: D
10219
10221
  } = Ve({
10220
- queryKey: ["media-tab", v, S, x],
10222
+ queryKey: ["media-tab", v, S, _],
10221
10223
  queryFn: () => {
10222
- if (!_)
10224
+ if (!x)
10223
10225
  throw new Error("Shareables client is not configured");
10224
- return _.media.list({
10226
+ return x.media.list({
10225
10227
  search_query: v,
10226
10228
  page: 1,
10227
10229
  per_page: 30,
@@ -10229,47 +10231,47 @@ const ef = ({
10229
10231
  with_type: S
10230
10232
  });
10231
10233
  },
10232
- enabled: !!_,
10234
+ enabled: !!x,
10233
10235
  staleTime: 300 * 1e3
10234
10236
  // 5 minutes
10235
10237
  });
10236
10238
  o.useEffect(() => {
10237
10239
  z([]), U(1), M(!1);
10238
- }, [x, v, S]);
10239
- const L = oe.useRef(
10240
- `${x}|${v}|${S ?? ""}`
10240
+ }, [_, v, S]);
10241
+ const R = ue.useRef(
10242
+ `${_}|${v}|${S ?? ""}`
10241
10243
  );
10242
10244
  o.useEffect(() => {
10243
- L.current = `${x}|${v}|${S ?? ""}`;
10244
- }, [x, v, S]), o.useEffect(() => {
10245
+ R.current = `${_}|${v}|${S ?? ""}`;
10246
+ }, [_, v, S]), o.useEffect(() => {
10245
10247
  if (!K) return;
10246
10248
  M(K.meta?.next != null);
10247
- const R = K.media || [];
10248
- R.length > 0 && z((Y) => {
10249
+ const L = K.media || [];
10250
+ L.length > 0 && z((Y) => {
10249
10251
  const Z = new Map(Y.map((J) => [J.id, J]));
10250
- for (const J of R)
10252
+ for (const J of L)
10251
10253
  Z.set(J.id, J);
10252
10254
  return Array.from(Z.values());
10253
10255
  });
10254
10256
  }, [K]);
10255
10257
  const T = o.useCallback(async () => {
10256
- if (!(!A || !_))
10258
+ if (!(!A || !x))
10257
10259
  try {
10258
10260
  P(!0);
10259
- const R = O + 1, Y = `${x}|${v}|${S ?? ""}`, Z = await _.media.list({
10261
+ const L = O + 1, Y = `${_}|${v}|${S ?? ""}`, Z = await x.media.list({
10260
10262
  search_query: v,
10261
- page: R,
10263
+ page: L,
10262
10264
  per_page: 30,
10263
10265
  active: !0,
10264
10266
  with_type: S
10265
10267
  });
10266
- if (Y !== L.current) return;
10267
- M(Z.meta?.next != null), U(R);
10268
+ if (Y !== R.current) return;
10269
+ M(Z.meta?.next != null), U(L);
10268
10270
  const J = Z.media || [];
10269
10271
  J.length > 0 && z((me) => {
10270
- const k = new Map(me.map((ce) => [ce.id, ce]));
10271
- for (const ce of J)
10272
- k.set(ce.id, ce);
10272
+ const k = new Map(me.map((oe) => [oe.id, oe]));
10273
+ for (const oe of J)
10274
+ k.set(oe.id, oe);
10273
10275
  return Array.from(k.values());
10274
10276
  });
10275
10277
  } finally {
@@ -10280,14 +10282,14 @@ const ef = ({
10280
10282
  O,
10281
10283
  v,
10282
10284
  S,
10283
- _,
10284
- x
10285
+ x,
10286
+ _
10285
10287
  ]), I = o.useCallback(
10286
- (R) => {
10287
- let Y = "", Z = "", J = R.title, me = "", k = "";
10288
- return R.video_url ? (Y = R.video_url, Z = "video/mp4", J = `${R.title}.mp4`, me = R.image_url || "", k = R.description?.body || "") : R.pdf_url ? (Y = R.pdf_url, Z = "application/pdf", J = `${R.title}.pdf`) : R.image_url && (Y = R.image_url, Z = "image/jpeg", J = `${R.title}.jpg`), {
10289
- asset_id: R.id,
10290
- asset_code: `media_${R.id}`,
10288
+ (L) => {
10289
+ let Y = "", Z = "", J = L.title, me = "", k = "";
10290
+ return L.video_url ? (Y = L.video_url, Z = "video/mp4", J = `${L.title}.mp4`, me = L.image_url || "", k = L.description?.body || "") : L.pdf_url ? (Y = L.pdf_url, Z = "application/pdf", J = `${L.title}.pdf`) : L.image_url && (Y = L.image_url, Z = "image/jpeg", J = `${L.title}.jpg`), {
10291
+ asset_id: L.id,
10292
+ asset_code: `media_${L.id}`,
10291
10293
  file_path: Y,
10292
10294
  file_url: Y,
10293
10295
  ...me ? { thumbnail_url: me } : {},
@@ -10301,7 +10303,7 @@ const ef = ({
10301
10303
  },
10302
10304
  []
10303
10305
  ), { state: $, api: se } = nl(), G = $ !== null && se !== null, q = o.useCallback(
10304
- (R, Y, Z) => {
10306
+ (L, Y, Z) => {
10305
10307
  const J = parseInt(Y.replace(/^media_/, ""), 10);
10306
10308
  if (Number.isNaN(J)) return;
10307
10309
  if (G) {
@@ -10323,7 +10325,7 @@ const ef = ({
10323
10325
  k = [...r, J];
10324
10326
  }
10325
10327
  n(k);
10326
- const ce = new Map(N.map((X) => [X.id, X])), fe = k.map((X) => ce.get(X)).filter((X) => X != null).map(I);
10328
+ const oe = new Map(N.map((X) => [X.id, X])), fe = k.map((X) => oe.get(X)).filter((X) => X != null).map(I);
10327
10329
  a?.(fe);
10328
10330
  },
10329
10331
  [
@@ -10337,62 +10339,62 @@ const ef = ({
10337
10339
  a
10338
10340
  ]
10339
10341
  );
10340
- oe.useEffect(() => {
10342
+ ue.useEffect(() => {
10341
10343
  G || s?.(r.length);
10342
10344
  }, [G, r.length, s]);
10343
10345
  const B = o.useMemo(() => {
10344
10346
  if (!h || !N.length) return N;
10345
- const R = fa.find((Y) => Y.id === h);
10346
- return R ? [...N].sort((Y, Z) => {
10347
- if (R.sortBy === "name") {
10347
+ const L = fa.find((Y) => Y.id === h);
10348
+ return L ? [...N].sort((Y, Z) => {
10349
+ if (L.sortBy === "name") {
10348
10350
  const J = (Y.title ?? "").localeCompare(Z.title ?? "", void 0, {
10349
10351
  sensitivity: "base"
10350
10352
  });
10351
- return R.sortDirection === "asc" ? J : -J;
10353
+ return L.sortDirection === "asc" ? J : -J;
10352
10354
  }
10353
- if (R.sortBy === "created_at") {
10355
+ if (L.sortBy === "created_at") {
10354
10356
  const J = Y.id ?? 0, me = Z.id ?? 0, k = J - me;
10355
- return R.sortDirection === "asc" ? k : -k;
10357
+ return L.sortDirection === "asc" ? k : -k;
10356
10358
  }
10357
10359
  return 0;
10358
10360
  }) : N;
10359
- }, [N, h]), he = (R) => R.image_url ? De : R.video_url ? xs : (R.pdf_url, _s), we = o.useCallback(
10360
- (R, Y) => {
10361
- if (R.image_url)
10361
+ }, [N, h]), he = (L) => L.image_url ? De : L.video_url ? xs : (L.pdf_url, _s), we = o.useCallback(
10362
+ (L, Y) => {
10363
+ if (L.image_url)
10362
10364
  return /* @__PURE__ */ e.jsx(
10363
10365
  "img",
10364
10366
  {
10365
- src: R.image_url,
10366
- alt: R.title,
10367
+ src: L.image_url,
10368
+ alt: L.title,
10367
10369
  width: 200,
10368
10370
  height: 150,
10369
10371
  className: "h-full w-full object-cover"
10370
10372
  }
10371
10373
  );
10372
- const Z = he(R);
10374
+ const Z = he(L);
10373
10375
  return /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center bg-gray-100", children: /* @__PURE__ */ e.jsx(Z, { className: "h-8 w-8 text-gray-400" }) });
10374
10376
  },
10375
10377
  []
10376
- ), _e = o.useMemo(() => B.map((R) => {
10377
- const Y = `media_${R.id}`;
10378
+ ), _e = o.useMemo(() => B.map((L) => {
10379
+ const Y = `media_${L.id}`;
10378
10380
  let Z, J;
10379
10381
  if (G) {
10380
10382
  const me = $.items.findIndex((k) => k.asset_code === Y);
10381
10383
  Z = me >= 0, J = Z ? me + 1 : 0;
10382
10384
  } else {
10383
- const me = r.indexOf(R.id);
10385
+ const me = r.indexOf(L.id);
10384
10386
  Z = me >= 0, J = Z ? me + 1 : 0;
10385
10387
  }
10386
10388
  return {
10387
10389
  id: Y,
10388
- name: R.title ?? "",
10389
- subtitle: R.kind ?? "Media",
10390
+ name: L.title ?? "",
10391
+ subtitle: L.kind ?? "Media",
10390
10392
  isSelected: Z,
10391
10393
  selectionIndex: J,
10392
- raw: R
10394
+ raw: L
10393
10395
  };
10394
10396
  }), [B, r, G, $]), F = o.useCallback(
10395
- (R, Y, Z) => {
10397
+ (L, Y, Z) => {
10396
10398
  const J = B[Z];
10397
10399
  J && g?.(J);
10398
10400
  },
@@ -10406,7 +10408,7 @@ const ef = ({
10406
10408
  bs,
10407
10409
  {
10408
10410
  open: !!f,
10409
- onOpenChange: (R) => !R && g?.(null),
10411
+ onOpenChange: (L) => !L && g?.(null),
10410
10412
  children: /* @__PURE__ */ e.jsxs(yr, { container: p ?? void 0, children: [
10411
10413
  /* @__PURE__ */ e.jsx(br, { className: "z-9999 bg-black/70 backdrop-blur-none" }),
10412
10414
  /* @__PURE__ */ e.jsx(
@@ -10432,8 +10434,8 @@ const ef = ({
10432
10434
  }
10433
10435
  ) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex aspect-video min-h-[200px] items-center justify-center bg-gray-100 p-8", children: [
10434
10436
  (() => {
10435
- const R = he(f);
10436
- return /* @__PURE__ */ e.jsx(R, { className: "h-16 w-16 text-gray-400" });
10437
+ const L = he(f);
10438
+ return /* @__PURE__ */ e.jsx(L, { className: "h-16 w-16 text-gray-400" });
10437
10439
  })(),
10438
10440
  /* @__PURE__ */ e.jsx("p", { className: "ml-4 text-sm text-gray-600", children: f.title })
10439
10441
  ] }) })
@@ -10449,8 +10451,8 @@ const ef = ({
10449
10451
  type: "text",
10450
10452
  placeholder: "Search media...",
10451
10453
  value: v,
10452
- onChange: (R) => {
10453
- C(R.target.value);
10454
+ onChange: (L) => {
10455
+ C(L.target.value);
10454
10456
  },
10455
10457
  className: "h-9"
10456
10458
  }
@@ -10496,7 +10498,7 @@ const ef = ({
10496
10498
  ] })
10497
10499
  ] });
10498
10500
  }, An = 30;
10499
- function Lr({
10501
+ function Rr({
10500
10502
  contentKind: t,
10501
10503
  assetCodePrefix: s,
10502
10504
  labelPlural: a,
@@ -10512,8 +10514,8 @@ function Lr({
10512
10514
  onSelectedDataChange: p,
10513
10515
  onSelectionCountChange: f,
10514
10516
  thumbnailSize: g = 100,
10515
- viewMode: _ = "grid",
10516
- showNamesOnMedia: x = !0
10517
+ viewMode: x = "grid",
10518
+ showNamesOnMedia: _ = !0
10517
10519
  }) {
10518
10520
  const w = r.supportsSearch !== !1, b = r.cacheKey ?? "default", [j, v] = o.useState(""), [C, N] = o.useState(""), [z, O] = o.useState([]), [U, E] = o.useState(null), [P, A] = o.useState(!1);
10519
10521
  o.useEffect(() => {
@@ -10541,9 +10543,9 @@ function Lr({
10541
10543
  o.useEffect(() => {
10542
10544
  D.current = `${b}|${C}`;
10543
10545
  }, [b, C]);
10544
- const { toast: L } = ut(), T = o.useCallback(async () => {
10546
+ const { toast: R } = ut(), T = o.useCallback(async () => {
10545
10547
  if (!U) return;
10546
- const F = C, R = `${b}|${F}`;
10548
+ const F = C, L = `${b}|${F}`;
10547
10549
  try {
10548
10550
  A(!0);
10549
10551
  const Y = await r.list({
@@ -10551,7 +10553,7 @@ function Lr({
10551
10553
  cursor: U,
10552
10554
  limit: An
10553
10555
  });
10554
- if (R !== D.current) return;
10556
+ if (L !== D.current) return;
10555
10557
  O((Z) => {
10556
10558
  const J = new Set(Z.map(n)), me = [...Z];
10557
10559
  for (const k of Y.items)
@@ -10559,7 +10561,7 @@ function Lr({
10559
10561
  return me;
10560
10562
  }), E(Y.nextCursor);
10561
10563
  } catch (Y) {
10562
- L.error(`Failed to load more ${a}`, Y);
10564
+ R.error(`Failed to load more ${a}`, Y);
10563
10565
  } finally {
10564
10566
  A(!1);
10565
10567
  }
@@ -10570,13 +10572,13 @@ function Lr({
10570
10572
  r,
10571
10573
  n,
10572
10574
  a,
10573
- L
10575
+ R
10574
10576
  ]), { state: I, api: $ } = nl(), se = I !== null && $ !== null, G = o.useCallback(
10575
10577
  (F) => {
10576
- const R = n(F), Y = i(F), Z = l(F) ?? "";
10578
+ const L = n(F), Y = i(F), Z = l(F) ?? "";
10577
10579
  return {
10578
- asset_id: R,
10579
- asset_code: `${s}${R}`,
10580
+ asset_id: L,
10581
+ asset_code: `${s}${L}`,
10580
10582
  file_path: Z,
10581
10583
  file_url: Z,
10582
10584
  ...Z ? { thumbnail_url: Z } : {},
@@ -10590,22 +10592,22 @@ function Lr({
10590
10592
  [s, n, i, l]
10591
10593
  ), q = o.useCallback(
10592
10594
  (F) => se ? I.items.some(
10593
- (R) => R.asset_code === `${s}${F}`
10595
+ (L) => L.asset_code === `${s}${F}`
10594
10596
  ) : m.includes(F),
10595
10597
  [se, I, s, m]
10596
10598
  ), B = o.useCallback(
10597
10599
  (F) => {
10598
10600
  if (se) {
10599
- const R = `${s}${F}`;
10600
- return I.items.findIndex((Y) => Y.asset_code === R) + 1;
10601
+ const L = `${s}${F}`;
10602
+ return I.items.findIndex((Y) => Y.asset_code === L) + 1;
10601
10603
  }
10602
10604
  return m.indexOf(F) + 1;
10603
10605
  },
10604
10606
  [se, I, s, m]
10605
10607
  ), he = o.useCallback(
10606
- (F, R) => {
10608
+ (F, L) => {
10607
10609
  const Y = Number.parseInt(
10608
- R.startsWith(s) ? R.slice(s.length) : R,
10610
+ L.startsWith(s) ? L.slice(s.length) : L,
10609
10611
  10
10610
10612
  );
10611
10613
  if (Number.isNaN(Y)) return;
@@ -10628,7 +10630,7 @@ function Lr({
10628
10630
  k = [...m, Y];
10629
10631
  }
10630
10632
  h(k);
10631
- const ce = new Map(z.map((fe) => [n(fe), fe])), ye = k.map((fe) => ce.get(fe)).filter((fe) => fe != null).map(G);
10633
+ const oe = new Map(z.map((fe) => [n(fe), fe])), ye = k.map((fe) => oe.get(fe)).filter((fe) => fe != null).map(G);
10632
10634
  p(ye);
10633
10635
  },
10634
10636
  [
@@ -10649,11 +10651,11 @@ function Lr({
10649
10651
  }, [se, m.length, f]);
10650
10652
  const we = o.useCallback(
10651
10653
  (F) => {
10652
- const R = l(F);
10653
- return R ? /* @__PURE__ */ e.jsx(
10654
+ const L = l(F);
10655
+ return L ? /* @__PURE__ */ e.jsx(
10654
10656
  "img",
10655
10657
  {
10656
- src: R,
10658
+ src: L,
10657
10659
  alt: i(F),
10658
10660
  width: 200,
10659
10661
  height: 150,
@@ -10664,12 +10666,12 @@ function Lr({
10664
10666
  [c, l, i]
10665
10667
  ), _e = o.useMemo(
10666
10668
  () => z.map((F) => {
10667
- const R = n(F), Y = B(R);
10669
+ const L = n(F), Y = B(L);
10668
10670
  return {
10669
- id: `${s}${R}`,
10671
+ id: `${s}${L}`,
10670
10672
  name: i(F),
10671
10673
  subtitle: u?.(F) ?? void 0,
10672
- isSelected: q(R),
10674
+ isSelected: q(L),
10673
10675
  selectionIndex: Y,
10674
10676
  raw: F
10675
10677
  };
@@ -10724,9 +10726,9 @@ function Lr({
10724
10726
  Dr,
10725
10727
  {
10726
10728
  items: _e,
10727
- viewMode: _,
10729
+ viewMode: x,
10728
10730
  thumbnailSize: g,
10729
- showNamesOnMedia: x,
10731
+ showNamesOnMedia: _,
10730
10732
  renderThumbnail: we,
10731
10733
  onClick: he
10732
10734
  }
@@ -10753,7 +10755,7 @@ function Lr({
10753
10755
  const sf = (t) => {
10754
10756
  const { shareablesClient: s } = ut(), a = s?.pages;
10755
10757
  return a ? /* @__PURE__ */ e.jsx(
10756
- Lr,
10758
+ Rr,
10757
10759
  {
10758
10760
  contentKind: "pages",
10759
10761
  assetCodePrefix: "page_",
@@ -10769,7 +10771,7 @@ const sf = (t) => {
10769
10771
  }, af = (t) => {
10770
10772
  const { shareablesClient: s } = ut(), a = s?.products;
10771
10773
  return a ? /* @__PURE__ */ e.jsx(
10772
- Lr,
10774
+ Rr,
10773
10775
  {
10774
10776
  contentKind: "products",
10775
10777
  assetCodePrefix: "product_",
@@ -10786,7 +10788,7 @@ const sf = (t) => {
10786
10788
  }, rf = (t) => {
10787
10789
  const { shareablesClient: s } = ut(), a = s?.enrollment_packs;
10788
10790
  return a ? /* @__PURE__ */ e.jsx(
10789
- Lr,
10791
+ Rr,
10790
10792
  {
10791
10793
  contentKind: "enrollment_packs",
10792
10794
  assetCodePrefix: "enrollment_pack_",
@@ -10800,7 +10802,7 @@ const sf = (t) => {
10800
10802
  }
10801
10803
  ) : null;
10802
10804
  }, nf = (t) => {
10803
- const { controlledSearchQuery: s, onControlledSearchQueryChange: a } = t ?? {}, [r, n] = o.useState(""), i = s ?? r, l = a ?? n, [u, c] = o.useState([]), [d, m] = o.useState(!1), [h, p] = o.useState(!1), [f, g] = o.useState(1), [_, x] = o.useState(!0), [w, b] = o.useState(/* @__PURE__ */ new Map()), j = Ge(), v = vs(), { apiBaseUrl: C, toast: N } = ut(), z = ze({
10805
+ const { controlledSearchQuery: s, onControlledSearchQueryChange: a } = t ?? {}, [r, n] = o.useState(""), i = s ?? r, l = a ?? n, [u, c] = o.useState([]), [d, m] = o.useState(!1), [h, p] = o.useState(!1), [f, g] = o.useState(1), [x, _] = o.useState(!0), [w, b] = o.useState(/* @__PURE__ */ new Map()), j = Ge(), v = vs(), { apiBaseUrl: C, toast: N } = ut(), z = ze({
10804
10806
  mutationFn: (A) => v.createDamAsset(A),
10805
10807
  onSuccess: () => {
10806
10808
  j.invalidateQueries({ queryKey: ss.all });
@@ -10808,7 +10810,7 @@ const sf = (t) => {
10808
10810
  }), O = o.useCallback(
10809
10811
  async (A, M = 1) => {
10810
10812
  if (!A.trim()) {
10811
- c([]), g(1), x(!0);
10813
+ c([]), g(1), _(!0);
10812
10814
  return;
10813
10815
  }
10814
10816
  M === 1 ? (m(!0), g(1)) : p(!0);
@@ -10816,7 +10818,7 @@ const sf = (t) => {
10816
10818
  const S = await v.searchUnsplash(A, M);
10817
10819
  c(
10818
10820
  (K) => M === 1 ? S.results : [...K, ...S.results]
10819
- ), g(M), x(M < S.total_pages);
10821
+ ), g(M), _(M < S.total_pages);
10820
10822
  } catch (S) {
10821
10823
  M === 1 && c([]), N.error(
10822
10824
  S instanceof Error ? S.message : "Unsplash search failed"
@@ -10859,7 +10861,7 @@ const sf = (t) => {
10859
10861
  status: "uploading"
10860
10862
  }), q;
10861
10863
  });
10862
- const L = await D.blob(), T = new File([L], S, { type: "image/jpeg" });
10864
+ const R = await D.blob(), T = new File([R], S, { type: "image/jpeg" });
10863
10865
  b((G) => {
10864
10866
  const q = new Map(G);
10865
10867
  return q.set(M, {
@@ -10908,13 +10910,13 @@ const sf = (t) => {
10908
10910
  } catch (K) {
10909
10911
  const W = K instanceof Error ? K.message : "Upload failed";
10910
10912
  return N.error(W), b((D) => {
10911
- const L = new Map(D);
10912
- return L.set(M, {
10913
+ const R = new Map(D);
10914
+ return R.set(M, {
10913
10915
  file_name: S,
10914
10916
  progress: 0,
10915
10917
  status: "error",
10916
10918
  error: W
10917
- }), L;
10919
+ }), R;
10918
10920
  }), {
10919
10921
  asset_id: 0,
10920
10922
  asset_code: "",
@@ -10936,8 +10938,8 @@ const sf = (t) => {
10936
10938
  ), E = o.useCallback(() => {
10937
10939
  b(/* @__PURE__ */ new Map());
10938
10940
  }, []), P = o.useCallback(() => {
10939
- i.trim() && _ && !h && O(i, f + 1);
10940
- }, [i, _, h, f, O]);
10941
+ i.trim() && x && !h && O(i, f + 1);
10942
+ }, [i, x, h, f, O]);
10941
10943
  return {
10942
10944
  searchQuery: i,
10943
10945
  setSearchQuery: l,
@@ -10948,7 +10950,7 @@ const sf = (t) => {
10948
10950
  uploadProgress: Array.from(w.values()),
10949
10951
  isUploading: z.isPending,
10950
10952
  clearProgress: E,
10951
- hasMoreResults: _,
10953
+ hasMoreResults: x,
10952
10954
  loadMore: P,
10953
10955
  isLoadingMore: h
10954
10956
  };
@@ -10970,8 +10972,8 @@ const sf = (t) => {
10970
10972
  isUploading: p,
10971
10973
  clearProgress: f,
10972
10974
  hasMoreResults: g,
10973
- loadMore: _,
10974
- isLoadingMore: x
10975
+ loadMore: x,
10976
+ isLoadingMore: _
10975
10977
  } = nf(
10976
10978
  a !== void 0 && r ? {
10977
10979
  controlledSearchQuery: a,
@@ -11022,7 +11024,7 @@ const sf = (t) => {
11022
11024
  style: {
11023
11025
  backgroundColor: "rgba(0, 0, 0, 0)"
11024
11026
  },
11025
- children: /* @__PURE__ */ e.jsx("div", { className: "opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ e.jsx(Ls, { className: "h-6 w-6 text-white" }) })
11027
+ children: /* @__PURE__ */ e.jsx("div", { className: "opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ e.jsx(Rs, { className: "h-6 w-6 text-white" }) })
11026
11028
  }
11027
11029
  ),
11028
11030
  /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 bottom-0 left-0 bg-linear-to-t from-black to-transparent p-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-1 text-xs text-white", children: [
@@ -11058,7 +11060,7 @@ const sf = (t) => {
11058
11060
  ] })
11059
11061
  ] }) }),
11060
11062
  w === v.id && p && /* @__PURE__ */ e.jsx("div", { className: "bg-opacity-75 absolute inset-0 flex items-center justify-center bg-blue-500", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center text-white", children: [
11061
- /* @__PURE__ */ e.jsx(Ls, { className: "mb-1 h-6 w-6 animate-pulse" }),
11063
+ /* @__PURE__ */ e.jsx(Rs, { className: "mb-1 h-6 w-6 animate-pulse" }),
11062
11064
  /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Uploading..." })
11063
11065
  ] }) })
11064
11066
  ]
@@ -11070,11 +11072,11 @@ const sf = (t) => {
11070
11072
  l,
11071
11073
  '"'
11072
11074
  ] }) }),
11073
- g && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ e.jsx(H, { onClick: _, disabled: x, variant: "outline", children: x ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
11075
+ g && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ e.jsx(H, { onClick: x, disabled: _, variant: "outline", children: _ ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
11074
11076
  /* @__PURE__ */ e.jsx(Ct, { className: "mr-2 animate-spin" }),
11075
11077
  "Loading..."
11076
11078
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
11077
- /* @__PURE__ */ e.jsx(Ls, { className: "mr-2" }),
11079
+ /* @__PURE__ */ e.jsx(Rs, { className: "mr-2" }),
11078
11080
  "Load More"
11079
11081
  ] }) }) }),
11080
11082
  t.showProgress && h.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
@@ -11087,7 +11089,7 @@ const sf = (t) => {
11087
11089
  /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
11088
11090
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
11089
11091
  (() => {
11090
- const C = v.status === "ready" ? as : v.status === "error" ? Os : Ls;
11092
+ const C = v.status === "ready" ? as : v.status === "error" ? Os : Rs;
11091
11093
  return /* @__PURE__ */ e.jsx(
11092
11094
  C,
11093
11095
  {
@@ -11137,12 +11139,12 @@ const sf = (t) => {
11137
11139
  async (m, h) => {
11138
11140
  const p = `url-${Date.now()}`, f = h || m.split("/").pop()?.split("?")[0]?.split("#")[0] || "url-upload";
11139
11141
  s((g) => {
11140
- const _ = new Map(g);
11141
- return _.set(p, {
11142
+ const x = new Map(g);
11143
+ return x.set(p, {
11142
11144
  file_name: f,
11143
11145
  progress: 0,
11144
11146
  status: "uploading"
11145
- }), _;
11147
+ }), x;
11146
11148
  });
11147
11149
  try {
11148
11150
  s((N) => {
@@ -11153,7 +11155,7 @@ const sf = (t) => {
11153
11155
  status: "uploading"
11154
11156
  }), z;
11155
11157
  });
11156
- let g, _;
11158
+ let g, x;
11157
11159
  try {
11158
11160
  const N = await fetch(m, {
11159
11161
  mode: "cors",
@@ -11161,7 +11163,7 @@ const sf = (t) => {
11161
11163
  });
11162
11164
  if (!N.ok)
11163
11165
  throw new Error(`Failed to fetch file: ${N.statusText}`);
11164
- g = await N.blob(), _ = N.headers.get("content-type") || "application/octet-stream";
11166
+ g = await N.blob(), x = N.headers.get("content-type") || "application/octet-stream";
11165
11167
  } catch (N) {
11166
11168
  if (N instanceof TypeError && (N.message.includes("CORS") || N.message.includes("Failed to fetch") || N.message.includes("NetworkError"))) {
11167
11169
  s((O) => {
@@ -11176,7 +11178,7 @@ const sf = (t) => {
11176
11178
  const O = await r.proxyUrlFetch(m), U = atob(O.data), E = new Uint8Array(U.length);
11177
11179
  for (let P = 0; P < U.length; P++)
11178
11180
  E[P] = U.charCodeAt(P);
11179
- g = new Blob([E], { type: O.contentType }), _ = O.contentType;
11181
+ g = new Blob([E], { type: O.contentType }), x = O.contentType;
11180
11182
  } catch (O) {
11181
11183
  let U = m;
11182
11184
  try {
@@ -11198,7 +11200,7 @@ const sf = (t) => {
11198
11200
  status: "uploading"
11199
11201
  }), z;
11200
11202
  });
11201
- const w = Yu(f), b = new File([g], w, { type: _ });
11203
+ const w = Yu(f), b = new File([g], w, { type: x });
11202
11204
  s((N) => {
11203
11205
  const z = new Map(N);
11204
11206
  return z.set(p, {
@@ -11229,21 +11231,21 @@ const sf = (t) => {
11229
11231
  file_url: C,
11230
11232
  metadata: {
11231
11233
  file_name: w,
11232
- mime_type: _,
11234
+ mime_type: x,
11233
11235
  file_size: g.size
11234
11236
  },
11235
11237
  upload_status: "ready",
11236
11238
  variant_id: v.default_variant_id ? v.default_variant_id.toString() : void 0
11237
11239
  };
11238
11240
  } catch (g) {
11239
- const _ = g instanceof Error ? g.message : "Upload failed";
11240
- return l.error(_), s((x) => {
11241
- const w = new Map(x);
11241
+ const x = g instanceof Error ? g.message : "Upload failed";
11242
+ return l.error(x), s((_) => {
11243
+ const w = new Map(_);
11242
11244
  return w.set(p, {
11243
11245
  file_name: f,
11244
11246
  progress: 0,
11245
11247
  status: "error",
11246
- error: _
11248
+ error: x
11247
11249
  }), w;
11248
11250
  }), {
11249
11251
  asset_id: 0,
@@ -11276,7 +11278,7 @@ const sf = (t) => {
11276
11278
  onShareableChange: n,
11277
11279
  selectedFilesCount: i
11278
11280
  }) => {
11279
- const { toast: l } = ut(), [u, c] = o.useState(""), [d, m] = o.useState(""), { uploadFromUrl: h, uploadProgress: p, isUploading: f, clearProgress: g } = of(), _ = async (j) => {
11281
+ const { toast: l } = ut(), [u, c] = o.useState(""), [d, m] = o.useState(""), { uploadFromUrl: h, uploadProgress: p, isUploading: f, clearProgress: g } = of(), x = async (j) => {
11280
11282
  if (j.preventDefault(), !!u.trim()) {
11281
11283
  g();
11282
11284
  try {
@@ -11288,7 +11290,7 @@ const sf = (t) => {
11288
11290
  credentials: "omit"
11289
11291
  })).headers.get("content-type") || "", z = d.trim() || w(u.trim());
11290
11292
  if (!Du(N, z, t.accept)) {
11291
- const O = Lu(
11293
+ const O = Ru(
11292
11294
  t.accept
11293
11295
  );
11294
11296
  l.error(
@@ -11311,7 +11313,7 @@ const sf = (t) => {
11311
11313
  l.error(v instanceof Error ? v.message : "Unknown error");
11312
11314
  }
11313
11315
  }
11314
- }, x = (j) => {
11316
+ }, _ = (j) => {
11315
11317
  try {
11316
11318
  return new URL(j), !0;
11317
11319
  } catch {
@@ -11324,7 +11326,7 @@ const sf = (t) => {
11324
11326
  return "";
11325
11327
  }
11326
11328
  }, b = (j) => {
11327
- if (c(j), j && x(j) && !d) {
11329
+ if (c(j), j && _(j) && !d) {
11328
11330
  const v = w(j);
11329
11331
  v && m(v);
11330
11332
  }
@@ -11337,7 +11339,7 @@ const sf = (t) => {
11337
11339
  /* @__PURE__ */ e.jsxs(
11338
11340
  "form",
11339
11341
  {
11340
- onSubmit: _,
11342
+ onSubmit: x,
11341
11343
  className: "mx-auto w-full space-y-5 md:w-1/2",
11342
11344
  children: [
11343
11345
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
@@ -11352,15 +11354,15 @@ const sf = (t) => {
11352
11354
  onChange: (j) => b(j.target.value),
11353
11355
  disabled: f,
11354
11356
  required: !0,
11355
- className: `w-full pr-10 transition-all duration-200 ${u && !x(u) ? "border-red-300 bg-red-50/30 focus:border-red-500 focus:ring-red-500/20" : "focus:border-blue-500 focus:ring-blue-500/20"}`
11357
+ className: `w-full pr-10 transition-all duration-200 ${u && !_(u) ? "border-red-300 bg-red-50/30 focus:border-red-500 focus:ring-red-500/20" : "focus:border-blue-500 focus:ring-blue-500/20"}`
11356
11358
  }
11357
11359
  ),
11358
- u && /* @__PURE__ */ e.jsx("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children: x(u) ? /* @__PURE__ */ e.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-green-100", children: /* @__PURE__ */ e.jsx(as, { className: "h-3 w-3 text-green-600" }) }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-red-100", children: /* @__PURE__ */ e.jsx(Os, { className: "h-3 w-3 text-red-600" }) }) })
11360
+ u && /* @__PURE__ */ e.jsx("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children: _(u) ? /* @__PURE__ */ e.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-green-100", children: /* @__PURE__ */ e.jsx(as, { className: "h-3 w-3 text-green-600" }) }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-red-100", children: /* @__PURE__ */ e.jsx(Os, { className: "h-3 w-3 text-red-600" }) }) })
11359
11361
  ] }),
11360
- u.trim() && x(u) && /* @__PURE__ */ e.jsx(H, { variant: "default", type: "submit", disabled: f, children: f ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(Ct, { className: "h-3 w-3 animate-spin" }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(lc, { className: "h-3 w-3" }) }) })
11362
+ u.trim() && _(u) && /* @__PURE__ */ e.jsx(H, { variant: "default", type: "submit", disabled: f, children: f ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(Ct, { className: "h-3 w-3 animate-spin" }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(lc, { className: "h-3 w-3" }) }) })
11361
11363
  ] }),
11362
- u && !x(u) && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-600", children: "Please enter a valid URL" }),
11363
- u && x(u) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
11364
+ u && !_(u) && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-600", children: "Please enter a valid URL" }),
11365
+ u && _(u) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
11364
11366
  /* @__PURE__ */ e.jsxs(
11365
11367
  "label",
11366
11368
  {
@@ -11469,12 +11471,12 @@ const sf = (t) => {
11469
11471
  for (const p of m) {
11470
11472
  const f = `${p.name}-${Date.now()}`;
11471
11473
  s((g) => {
11472
- const _ = new Map(g);
11473
- return _.set(f, {
11474
+ const x = new Map(g);
11475
+ return x.set(f, {
11474
11476
  file_name: p.name,
11475
11477
  progress: 0,
11476
11478
  status: "uploading"
11477
- }), _;
11479
+ }), x;
11478
11480
  });
11479
11481
  try {
11480
11482
  s((w) => {
@@ -11499,31 +11501,31 @@ const sf = (t) => {
11499
11501
  status: "ready"
11500
11502
  }), b;
11501
11503
  });
11502
- const _ = g.asset, x = kr(_, l);
11504
+ const x = g.asset, _ = kr(x, l);
11503
11505
  h.push({
11504
- asset_id: _.id,
11505
- asset_code: _.code,
11506
- file_path: x,
11507
- file_url: x,
11506
+ asset_id: x.id,
11507
+ asset_code: x.code,
11508
+ file_path: _,
11509
+ file_url: _,
11508
11510
  metadata: {
11509
11511
  file_name: p.name,
11510
11512
  mime_type: ga(p),
11511
11513
  file_size: p.size
11512
11514
  },
11513
11515
  upload_status: "ready",
11514
- variant_id: _.default_variant_id ? _.default_variant_id.toString() : void 0
11516
+ variant_id: x.default_variant_id ? x.default_variant_id.toString() : void 0
11515
11517
  });
11516
11518
  } catch (g) {
11517
- const _ = g instanceof Error ? g.message : "Upload failed", x = g instanceof Error && "status" in g ? g.status : void 0;
11518
- x === 413 || x === 400 && _.toLowerCase().includes("file size") ? i.error(
11519
+ const x = g instanceof Error ? g.message : "Upload failed", _ = g instanceof Error && "status" in g ? g.status : void 0;
11520
+ _ === 413 || _ === 400 && x.toLowerCase().includes("file size") ? i.error(
11519
11521
  "File size too large: Please compress or choose another file"
11520
- ) : i.error(_), s((b) => {
11522
+ ) : i.error(x), s((b) => {
11521
11523
  const j = new Map(b);
11522
11524
  return j.set(f, {
11523
11525
  file_name: p.name,
11524
11526
  progress: 0,
11525
11527
  status: "error",
11526
- error: _
11528
+ error: x
11527
11529
  }), j;
11528
11530
  }), h.push({
11529
11531
  asset_id: 0,
@@ -11562,21 +11564,21 @@ const sf = (t) => {
11562
11564
  maxWidth: u = 2e3,
11563
11565
  maxHeight: c = 2e3
11564
11566
  }) => {
11565
- const { toast: d } = ut(), m = js(), [h, p] = o.useState(!1), [f, g] = o.useState(), [_, x] = o.useState(), [w, b] = o.useState(""), [j, v] = o.useState(!1), [C, N] = o.useState(
11567
+ const { toast: d } = ut(), m = js(), [h, p] = o.useState(!1), [f, g] = o.useState(), [x, _] = o.useState(), [w, b] = o.useState(""), [j, v] = o.useState(!1), [C, N] = o.useState(
11566
11568
  n ?? "free"
11567
11569
  ), [z, O] = o.useState(0), [U, E] = o.useState(!1), [P, A] = o.useState(1), [M, S] = o.useState(!1), [K, W] = o.useState(
11568
11570
  null
11569
- ), D = o.useRef(null), L = o.useRef(null), T = o.useRef(null), I = C === "free" ? void 0 : C, $ = o.useMemo(() => {
11571
+ ), D = o.useRef(null), R = o.useRef(null), T = o.useRef(null), I = C === "free" ? void 0 : C, $ = o.useMemo(() => {
11570
11572
  const F = D.current;
11571
- if (!_ || !F) return null;
11572
- const R = F.naturalWidth, Y = F.naturalHeight, Z = F.clientWidth, J = F.clientHeight;
11573
+ if (!x || !F) return null;
11574
+ const L = F.naturalWidth, Y = F.naturalHeight, Z = F.clientWidth, J = F.clientHeight;
11573
11575
  if (!Z || !J) return null;
11574
- const me = Math.max(R / Z, Y / J);
11576
+ const me = Math.max(L / Z, Y / J);
11575
11577
  return {
11576
- width: Math.floor(_.width * me),
11577
- height: Math.floor(_.height * me)
11578
+ width: Math.floor(x.width * me),
11579
+ height: Math.floor(x.height * me)
11578
11580
  };
11579
- }, [_]), G = z !== 0 || U !== !1 || P !== 1 || C !== (n ?? "free") || M;
11581
+ }, [x]), G = z !== 0 || U !== !1 || P !== 1 || C !== (n ?? "free") || M;
11580
11582
  o.useEffect(() => {
11581
11583
  if (t && r) {
11582
11584
  const F = new FileReader();
@@ -11587,27 +11589,27 @@ const sf = (t) => {
11587
11589
  t || (O(0), E(!1), A(1), S(!1), W(null), N(n ?? "free"));
11588
11590
  }, [t, r, n]);
11589
11591
  const q = o.useCallback((F) => {
11590
- const R = D.current;
11591
- if (!R) return;
11592
+ const L = D.current;
11593
+ if (!L) return;
11592
11594
  const { crop: Y, completedCrop: Z } = Gu(
11593
- R.clientWidth,
11594
- R.clientHeight,
11595
+ L.clientWidth,
11596
+ L.clientHeight,
11595
11597
  F
11596
11598
  );
11597
- g(Y), setTimeout(() => x(Z), 0);
11599
+ g(Y), setTimeout(() => _(Z), 0);
11598
11600
  }, []), B = o.useCallback(() => {
11599
11601
  D.current && q(I);
11600
11602
  }, [I, q]), he = async () => {
11601
11603
  if (D.current) {
11602
11604
  v(!0);
11603
11605
  try {
11604
- const F = D.current.clientWidth, R = D.current.clientHeight;
11606
+ const F = D.current.clientWidth, L = D.current.clientHeight;
11605
11607
  let Y, Z, J, me;
11606
- _ ? (Y = _.x, Z = _.y, J = _.width, me = _.height) : f ? f.unit === "%" ? (Y = f.x / 100 * F, Z = f.y / 100 * R, J = f.width / 100 * F, me = f.height / 100 * R) : (Y = f.x, Z = f.y, J = f.width, me = f.height) : (Y = 0, Z = 0, J = F, me = R);
11608
+ x ? (Y = x.x, Z = x.y, J = x.width, me = x.height) : f ? f.unit === "%" ? (Y = f.x / 100 * F, Z = f.y / 100 * L, J = f.width / 100 * F, me = f.height / 100 * L) : (Y = f.x, Z = f.y, J = f.width, me = f.height) : (Y = 0, Z = 0, J = F, me = L);
11607
11609
  const k = await Wu(
11608
11610
  D.current,
11609
11611
  F,
11610
- R,
11612
+ L,
11611
11613
  { x: Y, y: Z, width: J, height: me },
11612
11614
  P,
11613
11615
  z,
@@ -11712,8 +11714,8 @@ const sf = (t) => {
11712
11714
  type: "button",
11713
11715
  onClick: () => {
11714
11716
  O((F) => {
11715
- const R = F + 90;
11716
- return R > Vu ? R - 360 : R < Ku ? R + 360 : R;
11717
+ const L = F + 90;
11718
+ return L > Vu ? L - 360 : L < Ku ? L + 360 : L;
11717
11719
  });
11718
11720
  },
11719
11721
  "aria-label": "Rotate 90deg",
@@ -11787,16 +11789,16 @@ const sf = (t) => {
11787
11789
  children: /* @__PURE__ */ e.jsx(
11788
11790
  "div",
11789
11791
  {
11790
- ref: L,
11792
+ ref: R,
11791
11793
  className: "image-crop-modal-crop [&_.ReactCrop__crop-selection]:border-contrast [&_.ReactCrop__rule]:border-border flex w-full items-center justify-center [&_.ReactCrop__crop-selection]:border-2 [&_.ReactCrop__crop-selection]:border-dashed [&_.ReactCrop__crop-selection]:shadow-[0_0_0_9999px_rgba(0,0,0,0.4)]",
11792
11794
  children: /* @__PURE__ */ e.jsx(
11793
11795
  Bu,
11794
11796
  {
11795
11797
  crop: f,
11796
- onChange: (F, R) => {
11797
- g(R), x(F), S(!0);
11798
+ onChange: (F, L) => {
11799
+ g(L), _(F), S(!0);
11798
11800
  },
11799
- onComplete: (F) => x(F),
11801
+ onComplete: (F) => _(F),
11800
11802
  aspect: I,
11801
11803
  minWidth: i,
11802
11804
  minHeight: l,
@@ -11882,7 +11884,7 @@ const mf = ({
11882
11884
  skipCropper: i = !1,
11883
11885
  selectedFilesCount: l
11884
11886
  }) => {
11885
- const { toast: u } = ut(), { uploadFiles: c, uploadProgress: d, isUploading: m, clearProgress: h } = df(), [p, f] = o.useState(!1), [g, _] = o.useState(!1), [x, w] = o.useState(null), [b, j] = o.useState([]), v = o.useCallback(
11887
+ const { toast: u } = ut(), { uploadFiles: c, uploadProgress: d, isUploading: m, clearProgress: h } = df(), [p, f] = o.useState(!1), [g, x] = o.useState(!1), [_, w] = o.useState(null), [b, j] = o.useState([]), v = o.useCallback(
11886
11888
  async (P) => {
11887
11889
  f(!1), h();
11888
11890
  const A = t.maxFiles ? P.slice(0, t.maxFiles) : P, M = [
@@ -11891,11 +11893,11 @@ const mf = ({
11891
11893
  "image/heif",
11892
11894
  "image/svg+xml"
11893
11895
  ], S = (D) => {
11894
- const L = ga(D);
11895
- return L.startsWith("image/") && !M.includes(L);
11896
+ const R = ga(D);
11897
+ return R.startsWith("image/") && !M.includes(R);
11896
11898
  }, K = A.filter(S), W = A.filter((D) => !S(D));
11897
11899
  if (K.length === 1 && !i)
11898
- j(W), w(K[0] || null), _(!0);
11900
+ j(W), w(K[0] || null), x(!0);
11899
11901
  else {
11900
11902
  const D = await c(A);
11901
11903
  s(D);
@@ -11904,13 +11906,13 @@ const mf = ({
11904
11906
  [c, s, t.maxFiles, h, i]
11905
11907
  ), C = o.useCallback(
11906
11908
  async (P) => {
11907
- _(!1);
11909
+ x(!1);
11908
11910
  const A = [P, ...b], M = await c(A);
11909
11911
  s(M), w(null), j([]);
11910
11912
  },
11911
11913
  [c, s, b]
11912
11914
  ), N = o.useCallback(() => {
11913
- _(!1), w(null), b.length > 0 && c(b).then(s), j([]);
11915
+ x(!1), w(null), b.length > 0 && c(b).then(s), j([]);
11914
11916
  }, [c, s, b]), z = o.useCallback(
11915
11917
  (P) => {
11916
11918
  P.forEach(({ file: A, errors: M }) => {
@@ -12027,13 +12029,13 @@ const mf = ({
12027
12029
  }
12028
12030
  )
12029
12031
  ] }) }),
12030
- x && /* @__PURE__ */ e.jsx(
12032
+ _ && /* @__PURE__ */ e.jsx(
12031
12033
  fl,
12032
12034
  {
12033
12035
  isOpen: g,
12034
12036
  onClose: N,
12035
12037
  onCrop: C,
12036
- imageFile: x,
12038
+ imageFile: _,
12037
12039
  minWidth: 50,
12038
12040
  minHeight: 50,
12039
12041
  maxWidth: 2e3,
@@ -12057,8 +12059,8 @@ const mf = ({
12057
12059
  onMediaIdsChange: p,
12058
12060
  onMediaSelectionChange: f,
12059
12061
  onMediaDataChange: g,
12060
- selectedPageIds: _,
12061
- onPageIdsChange: x,
12062
+ selectedPageIds: x,
12063
+ onPageIdsChange: _,
12062
12064
  onPageSelectionChange: w,
12063
12065
  onPageDataChange: b,
12064
12066
  selectedProductIds: j,
@@ -12076,7 +12078,7 @@ const mf = ({
12076
12078
  onDamSearchChange: K,
12077
12079
  mediaSearchQuery: W,
12078
12080
  onMediaSearchChange: D,
12079
- unsplashSearchQuery: L,
12081
+ unsplashSearchQuery: R,
12080
12082
  onUnsplashSearchChange: T,
12081
12083
  onUnsplashSearchingChange: I,
12082
12084
  onUnsplashUploadingChange: $,
@@ -12088,10 +12090,10 @@ const mf = ({
12088
12090
  previewMedia: we,
12089
12091
  onPreviewMediaChange: _e,
12090
12092
  previewAsset: F,
12091
- onPreviewAssetChange: R,
12093
+ onPreviewAssetChange: L,
12092
12094
  uploadSelectionCount: Y
12093
12095
  }) => {
12094
- const Z = oe.useMemo(
12096
+ const Z = ue.useMemo(
12095
12097
  () => ({
12096
12098
  ...s,
12097
12099
  fileTypeFilter: a ? [a] : s.fileTypeFilter
@@ -12143,7 +12145,7 @@ const mf = ({
12143
12145
  showNamesOnMedia: q,
12144
12146
  previewContainer: he,
12145
12147
  previewAsset: F,
12146
- onPreviewAssetChange: R
12148
+ onPreviewAssetChange: L
12147
12149
  }
12148
12150
  ),
12149
12151
  t === "media" && /* @__PURE__ */ e.jsx(
@@ -12172,8 +12174,8 @@ const mf = ({
12172
12174
  sf,
12173
12175
  {
12174
12176
  config: s,
12175
- selectedIds: _ ?? [],
12176
- onSelectedIdsChange: x ?? (() => {
12177
+ selectedIds: x ?? [],
12178
+ onSelectedIdsChange: _ ?? (() => {
12177
12179
  }),
12178
12180
  onSelectedDataChange: b ?? (() => {
12179
12181
  }),
@@ -12218,7 +12220,7 @@ const mf = ({
12218
12220
  {
12219
12221
  config: s,
12220
12222
  onFileSelected: i,
12221
- searchQuery: L,
12223
+ searchQuery: R,
12222
12224
  onSearchQueryChange: T,
12223
12225
  onSearchingChange: I,
12224
12226
  onUploadingChange: $
@@ -12278,7 +12280,7 @@ const mf = ({
12278
12280
  onOpenVariantModal: d,
12279
12281
  onCropImage: m
12280
12282
  }) => {
12281
- const h = js(), [p, f] = o.useState(null), [g, _] = o.useState(null), [x, w] = o.useState(null), [b, j] = o.useState(!1), [v, C] = o.useState(null), N = o.useCallback(
12283
+ const h = js(), [p, f] = o.useState(null), [g, x] = o.useState(null), [_, w] = o.useState(null), [b, j] = o.useState(!1), [v, C] = o.useState(null), N = o.useCallback(
12282
12284
  (E) => {
12283
12285
  if (u && c) {
12284
12286
  const P = u(E);
@@ -12306,7 +12308,7 @@ const mf = ({
12306
12308
  const K = new File([S], A, { type: M });
12307
12309
  w(K), j(!0);
12308
12310
  }).catch(() => {
12309
- E || _(null);
12311
+ E || x(null);
12310
12312
  }), () => {
12311
12313
  E = !0;
12312
12314
  };
@@ -12317,11 +12319,11 @@ const mf = ({
12317
12319
  const P = m?.(g.assetCode, E);
12318
12320
  P != null && typeof P?.then == "function" && await P;
12319
12321
  }
12320
- _(null), w(null), j(!1);
12322
+ x(null), w(null), j(!1);
12321
12323
  },
12322
12324
  [g, m]
12323
12325
  ), U = o.useCallback(() => {
12324
- _(null), w(null), j(!1);
12326
+ x(null), w(null), j(!1);
12325
12327
  }, []);
12326
12328
  return !i || t.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex max-h-[45%] w-full shrink-0 flex-col border-t border-gray-200 bg-white md:h-full md:max-h-none md:w-72 md:border-t-0 md:border-l", children: [
12327
12329
  /* @__PURE__ */ e.jsx("div", { className: "border-b border-gray-200 px-4 py-3", children: /* @__PURE__ */ e.jsx("h3", { className: "text-sm font-semibold text-gray-900", children: "Selection" }) }),
@@ -12350,7 +12352,7 @@ const mf = ({
12350
12352
  height: 40,
12351
12353
  className: "h-full w-full object-cover"
12352
12354
  }
12353
- ) : /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center", children: oe.createElement(
12355
+ ) : /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center", children: ue.createElement(
12354
12356
  hf(E.metadata.mime_type),
12355
12357
  {
12356
12358
  className: "h-4 w-4 text-gray-400"
@@ -12388,7 +12390,7 @@ const mf = ({
12388
12390
  {
12389
12391
  disabled: !P,
12390
12392
  onClick: (M) => {
12391
- M.stopPropagation(), P && Fs(E) && _({
12393
+ M.stopPropagation(), P && Fs(E) && x({
12392
12394
  assetCode: E.asset_code,
12393
12395
  file: E
12394
12396
  });
@@ -12455,7 +12457,7 @@ const mf = ({
12455
12457
  label: "Crop image",
12456
12458
  disabled: !p || !Fs(p) || !m,
12457
12459
  onSelect: () => {
12458
- p && Fs(p) && m && _({
12460
+ p && Fs(p) && m && x({
12459
12461
  assetCode: p.asset_code,
12460
12462
  file: p
12461
12463
  });
@@ -12476,13 +12478,13 @@ const mf = ({
12476
12478
  /* @__PURE__ */ e.jsx(H, { variant: "secondary", size: "sm", onClick: a, children: "Clear" }),
12477
12479
  /* @__PURE__ */ e.jsx(H, { variant: "default", size: "sm", onClick: r, children: n ? "Next" : `Use ${t.length} File${t.length !== 1 ? "s" : ""}` })
12478
12480
  ] }),
12479
- x && /* @__PURE__ */ e.jsx(
12481
+ _ && /* @__PURE__ */ e.jsx(
12480
12482
  fl,
12481
12483
  {
12482
12484
  isOpen: b,
12483
12485
  onClose: U,
12484
12486
  onCrop: O,
12485
- imageFile: x
12487
+ imageFile: _
12486
12488
  }
12487
12489
  ),
12488
12490
  v && h ? /* @__PURE__ */ e.jsxs(
@@ -12558,7 +12560,7 @@ const mf = ({
12558
12560
  height: 64,
12559
12561
  className: "h-16 w-16 rounded-md object-cover"
12560
12562
  }
12561
- ) }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-md bg-gray-50", children: oe.createElement(
12563
+ ) }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-md bg-gray-50", children: ue.createElement(
12562
12564
  pl(
12563
12565
  v.asset?.category || "unknown"
12564
12566
  ),
@@ -12619,54 +12621,54 @@ const mf = ({
12619
12621
  }, [c.allowedMethods, h]);
12620
12622
  const [f, g] = o.useState(
12621
12623
  []
12622
- ), [_, x] = o.useState(0), [w, b] = o.useState(
12624
+ ), [x, _] = o.useState(0), [w, b] = o.useState(
12623
12625
  []
12624
- ), [j, v] = o.useState({}), [C, N] = o.useState(""), [z, O] = o.useState(!1), [U, E] = o.useState(""), [P, A] = o.useState(""), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D, L] = o.useState(0), [T, I] = o.useState(zs), [$, se] = o.useState(
12626
+ ), [j, v] = o.useState({}), [C, N] = o.useState(""), [z, O] = o.useState(!1), [U, E] = o.useState(""), [P, A] = o.useState(""), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D, R] = o.useState(0), [T, I] = o.useState(zs), [$, se] = o.useState(
12625
12627
  void 0
12626
- ), [G, q] = o.useState([]), [B, he] = o.useState([]), [we, _e] = o.useState([]), [F, R] = o.useState([]), [Y, Z] = o.useState(
12628
+ ), [G, q] = o.useState([]), [B, he] = o.useState([]), [we, _e] = o.useState([]), [F, L] = o.useState([]), [Y, Z] = o.useState(
12627
12629
  []
12628
- ), [J, me] = o.useState(0), [k, ce] = o.useState([]), [ye, fe] = o.useState([]), [X, le] = o.useState(0), [We, Be] = o.useState([]), [tt, Qe] = o.useState([]), [Pt, V] = o.useState(0), [ae, pe] = o.useState([]), ge = o.useRef(null), [Re, Ue] = o.useState(null), [Qt, vt] = o.useState(null), [Tt, st] = o.useState(100), [at, Yt] = o.useState("grid"), [$t, La] = o.useState(!0), Ut = o.useCallback(() => {
12629
- p(m), g([]), x(0), b([]), v({}), N(""), E(""), A(""), S(!1), W(!1), L(0), he([]), _e([]), R([]), Z([]), me(0), ce([]), fe([]), le(0), Be([]), Qe([]), V(0), pe([]), I(zs), se(void 0), ge.current?.clearSelection?.(), vt(null);
12630
+ ), [J, me] = o.useState(0), [k, oe] = o.useState([]), [ye, fe] = o.useState([]), [X, le] = o.useState(0), [We, Be] = o.useState([]), [tt, Qe] = o.useState([]), [Pt, V] = o.useState(0), [ae, pe] = o.useState([]), ge = o.useRef(null), [Le, Ue] = o.useState(null), [Qt, vt] = o.useState(null), [Tt, st] = o.useState(100), [at, Yt] = o.useState("grid"), [$t, Ra] = o.useState(!0), Ut = o.useCallback(() => {
12631
+ p(m), g([]), _(0), b([]), v({}), N(""), E(""), A(""), S(!1), W(!1), R(0), he([]), _e([]), L([]), Z([]), me(0), oe([]), fe([]), le(0), Be([]), Qe([]), V(0), pe([]), I(zs), se(void 0), ge.current?.clearSelection?.(), vt(null);
12630
12632
  }, [m]), Xt = o.useCallback(
12631
12633
  (ee) => {
12632
- c.unifiedSelection || (g([]), x(0), b([]), v({}), N(""), A(""), S(!1), W(!1), L(0), he([]), _e([]), R([]), Z([]), me(0), ce([]), fe([]), le(0), Be([]), Qe([]), V(0), ge.current?.clearSelection?.()), p(ee);
12634
+ c.unifiedSelection || (g([]), _(0), b([]), v({}), N(""), A(""), S(!1), W(!1), R(0), he([]), _e([]), L([]), Z([]), me(0), oe([]), fe([]), le(0), Be([]), Qe([]), V(0), ge.current?.clearSelection?.()), p(ee);
12633
12635
  },
12634
12636
  [c.unifiedSelection]
12635
12637
  ), ws = o.useCallback(
12636
12638
  (ee) => {
12637
- const de = ee.filter(
12638
- (ue) => ue.upload_status !== "error"
12639
+ const ce = ee.filter(
12640
+ (de) => de.upload_status !== "error"
12639
12641
  );
12640
- c.maxFiles === 1 ? g(de.slice(0, 1)) : g((ue) => {
12641
- const Te = ue.length + de.length;
12642
+ c.maxFiles === 1 ? g(ce.slice(0, 1)) : g((de) => {
12643
+ const Te = de.length + ce.length;
12642
12644
  if (c.maxFiles && Te > c.maxFiles) {
12643
- const ea = c.maxFiles - ue.length;
12644
- return [...ue, ...de.slice(0, ea)];
12645
+ const ea = c.maxFiles - de.length;
12646
+ return [...de, ...ce.slice(0, ea)];
12645
12647
  }
12646
- return [...ue, ...de];
12648
+ return [...de, ...ce];
12647
12649
  });
12648
12650
  },
12649
12651
  [c.maxFiles]
12650
12652
  ), Ht = o.useCallback(
12651
12653
  (ee) => {
12652
- const de = ee.filter(
12653
- (ue) => ue.upload_status !== "error"
12654
+ const ce = ee.filter(
12655
+ (de) => de.upload_status !== "error"
12654
12656
  );
12655
- de.length !== 0 && (s(de), a?.());
12657
+ ce.length !== 0 && (s(ce), a?.());
12656
12658
  },
12657
12659
  [s, a]
12658
- ), Ra = o.useCallback(
12660
+ ), La = o.useCallback(
12659
12661
  (ee) => {
12660
12662
  ws([ee]);
12661
12663
  },
12662
12664
  [ws]
12663
12665
  ), za = o.useCallback(
12664
- (ee, de, ue) => {
12665
- x(ee), b(de ?? []), v(ue ?? {});
12666
+ (ee, ce, de) => {
12667
+ _(ee), b(ce ?? []), v(de ?? {});
12666
12668
  },
12667
12669
  []
12668
12670
  ), Me = o.useCallback((ee) => {
12669
- L(ee);
12671
+ R(ee);
12670
12672
  }, []), qt = o.useCallback((ee) => {
12671
12673
  _e(ee);
12672
12674
  }, []), Oa = o.useCallback((ee) => {
@@ -12679,7 +12681,7 @@ const mf = ({
12679
12681
  },
12680
12682
  [s, a]
12681
12683
  ), { shareablesClient: Zt, toast: ks } = ut(), Zs = o.useMemo(() => {
12682
- const de = [
12684
+ const ce = [
12683
12685
  {
12684
12686
  id: "dam",
12685
12687
  label: "Library",
@@ -12715,7 +12717,7 @@ const mf = ({
12715
12717
  {
12716
12718
  id: "upload",
12717
12719
  label: "Local Files",
12718
- icon: Lc,
12720
+ icon: Rc,
12719
12721
  description: "Upload files from computer or URL"
12720
12722
  },
12721
12723
  {
@@ -12760,10 +12762,10 @@ const mf = ({
12760
12762
  icon: dl,
12761
12763
  description: "Import from Dropbox"
12762
12764
  }
12763
- ].filter((ue) => ue.id === "pages" ? Zt?.pages != null : ue.id === "products" ? Zt?.products != null : ue.id === "enrollment_packs" ? Zt?.enrollment_packs != null : !0);
12764
- return c.allowedMethods && c.allowedMethods.length > 0 ? de.filter(
12765
- (ue) => c.allowedMethods.includes(ue.id)
12766
- ) : de;
12765
+ ].filter((de) => de.id === "pages" ? Zt?.pages != null : de.id === "products" ? Zt?.products != null : de.id === "enrollment_packs" ? Zt?.enrollment_packs != null : !0);
12766
+ return c.allowedMethods && c.allowedMethods.length > 0 ? ce.filter(
12767
+ (de) => c.allowedMethods.includes(de.id)
12768
+ ) : ce;
12767
12769
  }, [n, c.allowedMethods, Zt]), mt = Qt !== null, At = o.useMemo(
12768
12770
  () => ({ items: ae }),
12769
12771
  [ae]
@@ -12774,25 +12776,25 @@ const mf = ({
12774
12776
  const Js = o.useMemo(
12775
12777
  () => ({
12776
12778
  add: (ee) => {
12777
- const de = Jt.current;
12778
- if (!de.some((ue) => ue.asset_code === ee.asset_code)) {
12779
- if (c.maxFiles && de.length >= c.maxFiles) {
12779
+ const ce = Jt.current;
12780
+ if (!ce.some((de) => de.asset_code === ee.asset_code)) {
12781
+ if (c.maxFiles && ce.length >= c.maxFiles) {
12780
12782
  ks.error(
12781
12783
  `You can select up to ${c.maxFiles} items at a time.`
12782
12784
  );
12783
12785
  return;
12784
12786
  }
12785
- pe((ue) => ue.some((Te) => Te.asset_code === ee.asset_code) || c.maxFiles && ue.length >= c.maxFiles ? ue : [...ue, ee]);
12787
+ pe((de) => de.some((Te) => Te.asset_code === ee.asset_code) || c.maxFiles && de.length >= c.maxFiles ? de : [...de, ee]);
12786
12788
  }
12787
12789
  },
12788
12790
  remove: (ee) => {
12789
12791
  pe(
12790
- (de) => de.filter((ue) => ue.asset_code !== ee)
12792
+ (ce) => ce.filter((de) => de.asset_code !== ee)
12791
12793
  );
12792
12794
  },
12793
12795
  clear: () => pe([]),
12794
- isSelected: (ee) => Jt.current.some((de) => de.asset_code === ee),
12795
- selectionIndex: (ee) => Jt.current.findIndex((de) => de.asset_code === ee) + 1
12796
+ isSelected: (ee) => Jt.current.some((ce) => ce.asset_code === ee),
12797
+ selectionIndex: (ee) => Jt.current.findIndex((ce) => ce.asset_code === ee) + 1
12796
12798
  }),
12797
12799
  [c.maxFiles, ks]
12798
12800
  ), is = /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-y-auto", children: [
@@ -12824,8 +12826,8 @@ const mf = ({
12824
12826
  viewMode: at,
12825
12827
  onViewModeChange: Xs,
12826
12828
  showNamesOnMedia: $t,
12827
- onShowNamesOnMediaChange: La,
12828
- hasSelectedFiles: _ > 0,
12829
+ onShowNamesOnMediaChange: Ra,
12830
+ hasSelectedFiles: x > 0,
12829
12831
  damFolders: G,
12830
12832
  onAddToNewFolder: () => ge.current?.openAddFolderModal(),
12831
12833
  onAddToExistingFolder: (ee) => ge.current?.addToExistingFolder?.(ee),
@@ -12850,7 +12852,7 @@ const mf = ({
12850
12852
  sortOption: $,
12851
12853
  onFilesSelected: ws,
12852
12854
  onUploadConfirmAndMaybeCreate: Ht,
12853
- onSingleFileSelected: Ra,
12855
+ onSingleFileSelected: La,
12854
12856
  damLibraryRef: ge,
12855
12857
  onDamConfirmAndMaybeCreate: Ns,
12856
12858
  selectedMediaIds: B,
@@ -12858,11 +12860,11 @@ const mf = ({
12858
12860
  onMediaSelectionChange: Me,
12859
12861
  onMediaDataChange: qt,
12860
12862
  selectedPageIds: F,
12861
- onPageIdsChange: R,
12863
+ onPageIdsChange: L,
12862
12864
  onPageSelectionChange: me,
12863
12865
  onPageDataChange: Z,
12864
12866
  selectedProductIds: k,
12865
- onProductIdsChange: ce,
12867
+ onProductIdsChange: oe,
12866
12868
  onProductSelectionChange: le,
12867
12869
  onProductDataChange: fe,
12868
12870
  selectedEnrollmentPackIds: We,
@@ -12884,7 +12886,7 @@ const mf = ({
12884
12886
  viewMode: at,
12885
12887
  showNamesOnMedia: $t,
12886
12888
  onDamFoldersChange: q,
12887
- previewContainer: Re,
12889
+ previewContainer: Le,
12888
12890
  previewAsset: Qt,
12889
12891
  onPreviewAssetChange: vt,
12890
12892
  uploadSelectionCount: h === "upload" || h === "url" || h === "unsplash" ? f.length : void 0
@@ -12898,18 +12900,18 @@ const mf = ({
12898
12900
  ge.current?.deselectAssetByCode?.(ee);
12899
12901
  },
12900
12902
  onClear: () => {
12901
- ge.current?.clearSelection(), x(0), b([]), v({});
12903
+ ge.current?.clearSelection(), _(0), b([]), v({});
12902
12904
  },
12903
12905
  onConfirm: () => {
12904
12906
  ge.current?.confirmAndClose();
12905
12907
  },
12906
- isVisible: _ > 0,
12908
+ isVisible: x > 0,
12907
12909
  hasVariants: (ee) => (j[ee] ?? 0) > 1,
12908
12910
  getAssetWithVariants: (ee) => ge.current?.getAssetWithVariants?.(ee) ?? null,
12909
- onVariantChange: (ee, de) => {
12911
+ onVariantChange: (ee, ce) => {
12910
12912
  ge.current?.setVariantForAsset?.(
12911
12913
  ee,
12912
- de
12914
+ ce
12913
12915
  );
12914
12916
  }
12915
12917
  }
@@ -12919,15 +12921,15 @@ const mf = ({
12919
12921
  {
12920
12922
  selectedFiles: we,
12921
12923
  onRemoveFile: (ee) => {
12922
- const de = parseInt(ee.replace(/^media_/, ""), 10);
12923
- Number.isNaN(de) || (he(
12924
- (ue) => ue.filter((Te) => Te !== de)
12924
+ const ce = parseInt(ee.replace(/^media_/, ""), 10);
12925
+ Number.isNaN(ce) || (he(
12926
+ (de) => de.filter((Te) => Te !== ce)
12925
12927
  ), _e(
12926
- (ue) => ue.filter((Te) => Te.asset_code !== ee)
12928
+ (de) => de.filter((Te) => Te.asset_code !== ee)
12927
12929
  ));
12928
12930
  },
12929
12931
  onClear: () => {
12930
- he([]), _e([]), L(0);
12932
+ he([]), _e([]), R(0);
12931
12933
  },
12932
12934
  onConfirm: () => {
12933
12935
  s(we), a?.();
@@ -12941,15 +12943,15 @@ const mf = ({
12941
12943
  {
12942
12944
  selectedFiles: Y,
12943
12945
  onRemoveFile: (ee) => {
12944
- const de = parseInt(ee.replace(/^page_/, ""), 10);
12945
- Number.isNaN(de) || (R(
12946
- (ue) => ue.filter((Te) => Te !== de)
12946
+ const ce = parseInt(ee.replace(/^page_/, ""), 10);
12947
+ Number.isNaN(ce) || (L(
12948
+ (de) => de.filter((Te) => Te !== ce)
12947
12949
  ), Z(
12948
- (ue) => ue.filter((Te) => Te.asset_code !== ee)
12950
+ (de) => de.filter((Te) => Te.asset_code !== ee)
12949
12951
  ));
12950
12952
  },
12951
12953
  onClear: () => {
12952
- R([]), Z([]), me(0);
12954
+ L([]), Z([]), me(0);
12953
12955
  },
12954
12956
  onConfirm: () => {
12955
12957
  s(Y), a?.();
@@ -12963,15 +12965,15 @@ const mf = ({
12963
12965
  {
12964
12966
  selectedFiles: ye,
12965
12967
  onRemoveFile: (ee) => {
12966
- const de = parseInt(ee.replace(/^product_/, ""), 10);
12967
- Number.isNaN(de) || (ce(
12968
- (ue) => ue.filter((Te) => Te !== de)
12968
+ const ce = parseInt(ee.replace(/^product_/, ""), 10);
12969
+ Number.isNaN(ce) || (oe(
12970
+ (de) => de.filter((Te) => Te !== ce)
12969
12971
  ), fe(
12970
- (ue) => ue.filter((Te) => Te.asset_code !== ee)
12972
+ (de) => de.filter((Te) => Te.asset_code !== ee)
12971
12973
  ));
12972
12974
  },
12973
12975
  onClear: () => {
12974
- ce([]), fe([]), le(0);
12976
+ oe([]), fe([]), le(0);
12975
12977
  },
12976
12978
  onConfirm: () => {
12977
12979
  s(ye), a?.();
@@ -12985,14 +12987,14 @@ const mf = ({
12985
12987
  {
12986
12988
  selectedFiles: tt,
12987
12989
  onRemoveFile: (ee) => {
12988
- const de = parseInt(
12990
+ const ce = parseInt(
12989
12991
  ee.replace(/^enrollment_pack_/, ""),
12990
12992
  10
12991
12993
  );
12992
- Number.isNaN(de) || (Be(
12993
- (ue) => ue.filter((Te) => Te !== de)
12994
+ Number.isNaN(ce) || (Be(
12995
+ (de) => de.filter((Te) => Te !== ce)
12994
12996
  ), Qe(
12995
- (ue) => ue.filter((Te) => Te.asset_code !== ee)
12997
+ (de) => de.filter((Te) => Te.asset_code !== ee)
12996
12998
  ));
12997
12999
  },
12998
13000
  onClear: () => {
@@ -13011,7 +13013,7 @@ const mf = ({
13011
13013
  selectedFiles: f,
13012
13014
  onRemoveFile: (ee) => {
13013
13015
  g(
13014
- (de) => de.filter((ue) => ue.asset_code !== ee)
13016
+ (ce) => ce.filter((de) => de.asset_code !== ee)
13015
13017
  );
13016
13018
  },
13017
13019
  onClear: () => {
@@ -13030,7 +13032,7 @@ const mf = ({
13030
13032
  selectedFiles: ae,
13031
13033
  onRemoveFile: (ee) => {
13032
13034
  pe(
13033
- (de) => de.filter((ue) => ue.asset_code !== ee)
13035
+ (ce) => ce.filter((de) => de.asset_code !== ee)
13034
13036
  );
13035
13037
  },
13036
13038
  onClear: () => {
@@ -13132,7 +13134,7 @@ function gl(t) {
13132
13134
  n(!1);
13133
13135
  }, [t]), { meta: s, fileName: i, handleLoad: l, handleError: u, loadError: r };
13134
13136
  }
13135
- function Rr({
13137
+ function Lr({
13136
13138
  value: t,
13137
13139
  onChange: s,
13138
13140
  placeholder: a,
@@ -13241,7 +13243,7 @@ function Rr({
13241
13243
  l?.isActive({ textAlign: "center" }) ? c : d
13242
13244
  ),
13243
13245
  title: i("editor_align_center"),
13244
- children: /* @__PURE__ */ e.jsx(Lo, { className: "size-3.5" })
13246
+ children: /* @__PURE__ */ e.jsx(Ro, { className: "size-3.5" })
13245
13247
  }
13246
13248
  ),
13247
13249
  /* @__PURE__ */ e.jsx(
@@ -13254,7 +13256,7 @@ function Rr({
13254
13256
  l?.isActive({ textAlign: "right" }) ? c : d
13255
13257
  ),
13256
13258
  title: i("editor_align_right"),
13257
- children: /* @__PURE__ */ e.jsx(Ro, { className: "size-3.5" })
13259
+ children: /* @__PURE__ */ e.jsx(Lo, { className: "size-3.5" })
13258
13260
  }
13259
13261
  ),
13260
13262
  /* @__PURE__ */ e.jsx(
@@ -13364,12 +13366,12 @@ function ff({
13364
13366
  disabled: n = !1,
13365
13367
  maxProducts: i = 100
13366
13368
  }) {
13367
- const { t: l } = ne(), u = dt(), { showToast: c } = Ee(), [d, m] = o.useState(!1), [h, p] = o.useState(""), [f, g] = o.useState([]), [_, x] = o.useState(!1), [w, b] = o.useState(!1), [j, v] = o.useState(null), [C, N] = o.useState(null), [z, O] = o.useState(null), U = o.useRef(null), E = o.useRef(null), P = o.useRef(null), A = o.useMemo(
13369
+ const { t: l } = ne(), u = dt(), { showToast: c } = Ee(), [d, m] = o.useState(!1), [h, p] = o.useState(""), [f, g] = o.useState([]), [x, _] = o.useState(!1), [w, b] = o.useState(!1), [j, v] = o.useState(null), [C, N] = o.useState(null), [z, O] = o.useState(null), U = o.useRef(null), E = o.useRef(null), P = o.useRef(null), A = o.useMemo(
13368
13370
  () => new Set(t.map((T) => T.id)),
13369
13371
  [t]
13370
13372
  ), M = t.length >= i, S = o.useCallback(
13371
13373
  async (T) => {
13372
- x(!0);
13374
+ _(!0);
13373
13375
  try {
13374
13376
  const { products: I, nextCursor: $ } = await r(T, { limit: En });
13375
13377
  g(I), v($ ?? null);
@@ -13380,12 +13382,12 @@ function ff({
13380
13382
  error: I
13381
13383
  });
13382
13384
  } finally {
13383
- x(!1);
13385
+ _(!1);
13384
13386
  }
13385
13387
  },
13386
13388
  [r, c]
13387
13389
  ), K = o.useCallback(async () => {
13388
- if (!(!j || w || _)) {
13390
+ if (!(!j || w || x)) {
13389
13391
  b(!0);
13390
13392
  try {
13391
13393
  const { products: T, nextCursor: I } = await r(
@@ -13403,7 +13405,7 @@ function ff({
13403
13405
  b(!1);
13404
13406
  }
13405
13407
  }
13406
- }, [j, w, _, r, h, c]);
13408
+ }, [j, w, x, r, h, c]);
13407
13409
  o.useEffect(() => {
13408
13410
  if (d)
13409
13411
  return U.current && clearTimeout(U.current), U.current = setTimeout(() => {
@@ -13440,7 +13442,7 @@ function ff({
13440
13442
  O(null);
13441
13443
  }
13442
13444
  }
13443
- async function L(T) {
13445
+ async function R(T) {
13444
13446
  N(T);
13445
13447
  try {
13446
13448
  await a(T);
@@ -13522,7 +13524,7 @@ function ff({
13522
13524
  type: "button",
13523
13525
  variant: "outline",
13524
13526
  size: "sm",
13525
- onClick: () => void L(T.id),
13527
+ onClick: () => void R(T.id),
13526
13528
  disabled: C === T.id,
13527
13529
  className: "text-xs text-red-600 hover:bg-red-50 hover:text-red-700",
13528
13530
  children: C === T.id ? l("common_removing") : l("common_remove")
@@ -13549,7 +13551,7 @@ function ff({
13549
13551
  }) }),
13550
13552
  M && /* @__PURE__ */ e.jsx("div", { className: "rounded-md border border-yellow-200 bg-yellow-50 p-3", children: /* @__PURE__ */ e.jsx("p", { className: "text-sm text-yellow-800", children: l("media_max_products_warning", { max: String(i) }) }) }),
13551
13553
  /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
13552
- _ ? /* @__PURE__ */ e.jsx(it, { className: "absolute top-1/2 left-3 size-4 -translate-y-1/2" }) : /* @__PURE__ */ e.jsx(ja, { className: "absolute top-1/2 left-3 size-4 -translate-y-1/2 text-gray-400" }),
13554
+ x ? /* @__PURE__ */ e.jsx(it, { className: "absolute top-1/2 left-3 size-4 -translate-y-1/2" }) : /* @__PURE__ */ e.jsx(ja, { className: "absolute top-1/2 left-3 size-4 -translate-y-1/2 text-gray-400" }),
13553
13555
  /* @__PURE__ */ e.jsx(
13554
13556
  $e,
13555
13557
  {
@@ -13560,7 +13562,7 @@ function ff({
13560
13562
  }
13561
13563
  )
13562
13564
  ] }),
13563
- /* @__PURE__ */ e.jsx("div", { ref: P, className: "max-h-96 overflow-y-auto", children: _ && f.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) : f.length === 0 ? /* @__PURE__ */ e.jsx("p", { className: "py-8 text-center text-sm text-gray-500", children: h.length > 0 ? l("products_search_no_results") : l("products_search_start_typing") }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 px-1", children: [
13565
+ /* @__PURE__ */ e.jsx("div", { ref: P, className: "max-h-96 overflow-y-auto", children: x && f.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) : f.length === 0 ? /* @__PURE__ */ e.jsx("p", { className: "py-8 text-center text-sm text-gray-500", children: h.length > 0 ? l("products_search_no_results") : l("products_search_start_typing") }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 px-1", children: [
13564
13566
  f.map((T) => {
13565
13567
  const I = A.has(T.id), $ = !I && !M;
13566
13568
  return /* @__PURE__ */ e.jsxs(
@@ -13667,16 +13669,16 @@ function _l({
13667
13669
  }
13668
13670
  ],
13669
13671
  [u]
13670
- ), [m, h] = o.useState(a), [p, f] = o.useState(r || "link"), [g, _] = o.useState(n), [x, w] = o.useState(i);
13672
+ ), [m, h] = o.useState(a), [p, f] = o.useState(r || "link"), [g, x] = o.useState(n), [_, w] = o.useState(i);
13671
13673
  o.useEffect(() => {
13672
- t && (h(a), f(r || "link"), _(n || u("cta_default_button_text")), w(i));
13674
+ t && (h(a), f(r || "link"), x(n || u("cta_default_button_text")), w(i));
13673
13675
  }, [t, a, r, n, i]);
13674
13676
  const b = (N) => {
13675
- h(N), N && !g && _(u("cta_default_button_text"));
13677
+ h(N), N && !g && x(u("cta_default_button_text"));
13676
13678
  }, j = () => {
13677
13679
  s(!1);
13678
13680
  }, v = () => {
13679
- l({ enabled: m, type: p, buttonText: g, url: x }), s(!1);
13681
+ l({ enabled: m, type: p, buttonText: g, url: _ }), s(!1);
13680
13682
  }, C = !m;
13681
13683
  return /* @__PURE__ */ e.jsxs(
13682
13684
  St,
@@ -13738,7 +13740,7 @@ function _l({
13738
13740
  $e,
13739
13741
  {
13740
13742
  value: g,
13741
- onChange: (N) => _(N.target.value),
13743
+ onChange: (N) => x(N.target.value),
13742
13744
  placeholder: u("cta_default_button_text"),
13743
13745
  disabled: C,
13744
13746
  className: C ? "opacity-50" : ""
@@ -13760,7 +13762,7 @@ function _l({
13760
13762
  /* @__PURE__ */ e.jsx(
13761
13763
  $e,
13762
13764
  {
13763
- value: x,
13765
+ value: _,
13764
13766
  onChange: (N) => w(N.target.value),
13765
13767
  placeholder: u("cta_url_placeholder"),
13766
13768
  type: "url",
@@ -13789,9 +13791,9 @@ function gf({
13789
13791
  onThumbnailSelected: r,
13790
13792
  disabled: n = !1
13791
13793
  }) {
13792
- const { t: i } = ne(), l = dt(), { showToast: u } = Ee(), [c, d] = o.useState(!1), [m, h] = o.useState(!1), [p, f] = o.useState(0), [g, _] = o.useState(0), [x, w] = o.useState(!1), b = o.useRef(null), j = o.useRef(null), v = o.useCallback(() => {
13794
+ const { t: i } = ne(), l = dt(), { showToast: u } = Ee(), [c, d] = o.useState(!1), [m, h] = o.useState(!1), [p, f] = o.useState(0), [g, x] = o.useState(0), [_, w] = o.useState(!1), b = o.useRef(null), j = o.useRef(null), v = o.useCallback(() => {
13793
13795
  const W = b.current;
13794
- W && (_(W.duration), W.currentTime = Math.min(1, W.duration * 0.1));
13796
+ W && (x(W.duration), W.currentTime = Math.min(1, W.duration * 0.1));
13795
13797
  }, []), C = o.useCallback(() => {
13796
13798
  b.current && f(b.current.currentTime);
13797
13799
  }, []), N = o.useCallback(() => {
@@ -13800,20 +13802,20 @@ function gf({
13800
13802
  }, []), z = o.useCallback((W) => {
13801
13803
  const D = b.current;
13802
13804
  if (!D) return;
13803
- const L = Number(W.target.value);
13804
- D.currentTime = L, f(L), D.paused || (D.pause(), h(!1));
13805
+ const R = Number(W.target.value);
13806
+ D.currentTime = R, f(R), D.paused || (D.pause(), h(!1));
13805
13807
  }, []), O = o.useCallback(() => {
13806
13808
  const W = b.current, D = j.current;
13807
13809
  if (!(!W || !D)) {
13808
13810
  w(!0);
13809
13811
  try {
13810
13812
  D.width = W.videoWidth, D.height = W.videoHeight;
13811
- const L = D.getContext("2d");
13812
- if (!L) {
13813
+ const R = D.getContext("2d");
13814
+ if (!R) {
13813
13815
  w(!1);
13814
13816
  return;
13815
13817
  }
13816
- L.drawImage(W, 0, 0, D.width, D.height), D.toBlob(
13818
+ R.drawImage(W, 0, 0, D.width, D.height), D.toBlob(
13817
13819
  (T) => {
13818
13820
  T ? (a(T), d(!1)) : u({
13819
13821
  title: i("media_frame_capture_error"),
@@ -13823,16 +13825,16 @@ function gf({
13823
13825
  "image/jpeg",
13824
13826
  0.92
13825
13827
  );
13826
- } catch (L) {
13828
+ } catch (R) {
13827
13829
  u({
13828
13830
  title: i("media_frame_capture_error"),
13829
13831
  type: "error",
13830
- error: L
13832
+ error: R
13831
13833
  }), w(!1);
13832
13834
  }
13833
13835
  }
13834
13836
  }, [a, u, i]), U = o.useCallback(() => {
13835
- h(!1), f(0), _(0), d(!0);
13837
+ h(!1), f(0), x(0), d(!0);
13836
13838
  }, []), E = g > 0, {
13837
13839
  meta: P,
13838
13840
  fileName: A,
@@ -13970,10 +13972,10 @@ function gf({
13970
13972
  H,
13971
13973
  {
13972
13974
  onClick: O,
13973
- disabled: !E || x,
13975
+ disabled: !E || _,
13974
13976
  className: "w-full gap-2",
13975
13977
  children: [
13976
- x ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : /* @__PURE__ */ e.jsx(ta, { className: "size-4" }),
13978
+ _ ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : /* @__PURE__ */ e.jsx(ta, { className: "size-4" }),
13977
13979
  i("media_capture_frame")
13978
13980
  ]
13979
13981
  }
@@ -14097,8 +14099,8 @@ function bf({
14097
14099
  readOnly: p,
14098
14100
  mediaProductsApi: f,
14099
14101
  searchProducts: g,
14100
- uploadThumbnail: _
14101
- } = Ee(), [x, w] = o.useState({
14102
+ uploadThumbnail: x
14103
+ } = Ee(), [_, w] = o.useState({
14102
14104
  title: "",
14103
14105
  description: "",
14104
14106
  active: !0,
@@ -14109,7 +14111,7 @@ function bf({
14109
14111
  seoTitle: "",
14110
14112
  seoDescription: "",
14111
14113
  blockCrawler: !1
14112
- }), [b, j] = o.useState(null), [v, C] = o.useState(null), [N, z] = o.useState(!1), [O, U] = o.useState(!1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), [S, K] = o.useState(!1), [W, D] = o.useState(!1), [L, T] = o.useState(null), [I, $] = o.useState(null), { data: se, isLoading: G } = Ve({
14114
+ }), [b, j] = o.useState(null), [v, C] = o.useState(null), [N, z] = o.useState(!1), [O, U] = o.useState(!1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), [S, K] = o.useState(!1), [W, D] = o.useState(!1), [R, T] = o.useState(null), [I, $] = o.useState(null), { data: se, isLoading: G } = Ve({
14113
14115
  queryKey: Ne.media.detail(Number(t), u, n),
14114
14116
  queryFn: () => l.media.getMediaById(Number(t), n)
14115
14117
  }), q = se?.media, { data: B, refetch: he } = Ve({
@@ -14118,32 +14120,32 @@ function bf({
14118
14120
  language_iso: n
14119
14121
  }),
14120
14122
  enabled: !!f
14121
- }), we = B?.media_products ?? [], _e = o.useMemo(() => L || I ? !0 : b ? x.title !== b.title || x.description !== b.description || x.active !== b.active || x.ctaEnabled !== b.ctaEnabled || x.ctaType !== b.ctaType || x.ctaButtonText !== b.ctaButtonText || x.ctaUrl !== b.ctaUrl || x.seoTitle !== b.seoTitle || x.seoDescription !== b.seoDescription || x.blockCrawler !== b.blockCrawler : !1, [x, b, L, I]), F = o.useRef(!1);
14123
+ }), we = B?.media_products ?? [], _e = o.useMemo(() => R || I ? !0 : b ? _.title !== b.title || _.description !== b.description || _.active !== b.active || _.ctaEnabled !== b.ctaEnabled || _.ctaType !== b.ctaType || _.ctaButtonText !== b.ctaButtonText || _.ctaUrl !== b.ctaUrl || _.seoTitle !== b.seoTitle || _.seoDescription !== b.seoDescription || _.blockCrawler !== b.blockCrawler : !1, [_, b, R, I]), F = o.useRef(!1);
14122
14124
  F.current = _e, o.useEffect(() => {
14123
14125
  if (!q || F.current) return;
14124
14126
  const X = _f(q);
14125
14127
  w(X), j(X), C(n);
14126
14128
  }, [q, n]);
14127
- const { mutate: R, isPending: Y } = ze({
14129
+ const { mutate: L, isPending: Y } = ze({
14128
14130
  mutationFn: () => l.media.updateMedia(
14129
14131
  Number(t),
14130
14132
  {
14131
- title: x.title,
14132
- description: x.description,
14133
- active: x.active,
14134
- ...L ? da(L) : {},
14133
+ title: _.title,
14134
+ description: _.description,
14135
+ active: _.active,
14136
+ ...R ? da(R) : {},
14135
14137
  ...I ? { thumbnail_url: I } : {},
14136
14138
  settings: {
14137
14139
  cta: {
14138
- enabled: x.ctaEnabled,
14139
- type: x.ctaType,
14140
- button_text: x.ctaButtonText || void 0,
14141
- url: x.ctaType === "link" && x.ctaUrl || void 0
14140
+ enabled: _.ctaEnabled,
14141
+ type: _.ctaType,
14142
+ button_text: _.ctaButtonText || void 0,
14143
+ url: _.ctaType === "link" && _.ctaUrl || void 0
14142
14144
  },
14143
14145
  seo: {
14144
- title: x.seoTitle || null,
14145
- description: x.seoDescription || null,
14146
- block_crawler: x.blockCrawler
14146
+ title: _.seoTitle || null,
14147
+ description: _.seoDescription || null,
14148
+ block_crawler: _.blockCrawler
14147
14149
  }
14148
14150
  }
14149
14151
  },
@@ -14152,7 +14154,7 @@ function bf({
14152
14154
  onSuccess: () => {
14153
14155
  c.invalidateQueries({
14154
14156
  queryKey: Ne.media.all
14155
- }), j(x), T(null), $(null), m({ title: r("media_save_success"), type: "success" });
14157
+ }), j(_), T(null), $(null), m({ title: r("media_save_success"), type: "success" });
14156
14158
  },
14157
14159
  onError: (X) => {
14158
14160
  m({
@@ -14174,10 +14176,10 @@ function bf({
14174
14176
  }), z(!1);
14175
14177
  }
14176
14178
  }), me = o.useCallback(() => {
14177
- R();
14178
- }, [R]), k = o.useCallback(() => {
14179
+ L();
14180
+ }, [L]), k = o.useCallback(() => {
14179
14181
  Z();
14180
- }, [Z]), ce = o.useCallback((X) => {
14182
+ }, [Z]), oe = o.useCallback((X) => {
14181
14183
  const le = X[0];
14182
14184
  le && (P(!1), T(le));
14183
14185
  }, []), ye = o.useMemo(() => h ? {
@@ -14273,7 +14275,7 @@ function bf({
14273
14275
  )
14274
14276
  ] }) }),
14275
14277
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 px-4 pt-4 pb-24 md:px-10 md:py-6", children: [
14276
- /* @__PURE__ */ e.jsx("div", { className: "mx-auto flex w-full max-w-5xl items-center gap-3", children: /* @__PURE__ */ e.jsx("h1", { className: "text-foreground text-xl font-semibold break-words", children: x.title || fe || r("media_heading") }) }),
14278
+ /* @__PURE__ */ e.jsx("div", { className: "mx-auto flex w-full max-w-5xl items-center gap-3", children: /* @__PURE__ */ e.jsx("h1", { className: "text-foreground text-xl font-semibold break-words", children: _.title || fe || r("media_heading") }) }),
14277
14279
  /* @__PURE__ */ e.jsxs("div", { className: "mx-auto grid w-full max-w-5xl grid-cols-1 gap-6 md:grid-cols-[3fr_1fr]", children: [
14278
14280
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
14279
14281
  /* @__PURE__ */ e.jsxs("div", { className: "border-border bg-card rounded-lg border p-4 md:p-5", children: [
@@ -14295,10 +14297,10 @@ function bf({
14295
14297
  variant: "outline",
14296
14298
  size: "sm",
14297
14299
  onClick: () => K(!0),
14298
- className: x.ctaEnabled ? "border-primary text-primary" : "",
14300
+ className: _.ctaEnabled ? "border-primary text-primary" : "",
14299
14301
  children: [
14300
14302
  r("media_cta_button_label"),
14301
- x.ctaEnabled ? r("common_on") : r("common_off")
14303
+ _.ctaEnabled ? r("common_on") : r("common_off")
14302
14304
  ]
14303
14305
  }
14304
14306
  )
@@ -14308,12 +14310,12 @@ function bf({
14308
14310
  yf,
14309
14311
  {
14310
14312
  mediaItem: q,
14311
- pendingFileUrl: L ? L.file_url : null,
14312
- pendingKind: L ? da(L).kind : null
14313
+ pendingFileUrl: R ? R.file_url : null,
14314
+ pendingKind: R ? da(R).kind : null
14313
14315
  }
14314
14316
  ),
14315
14317
  (() => {
14316
- const X = L ? da(L).kind : null, le = q.content_format, We = X ?? le ?? q.kind, Be = X === "video" ? L?.file_url : q.video_url;
14318
+ const X = R ? da(R).kind : null, le = q.content_format, We = X ?? le ?? q.kind, Be = X === "video" ? R?.file_url : q.video_url;
14317
14319
  if (p) return null;
14318
14320
  if (We === "video" && Be)
14319
14321
  return /* @__PURE__ */ e.jsxs("div", { className: "border-border mt-4 border-t pt-4", children: [
@@ -14323,7 +14325,7 @@ function bf({
14323
14325
  videoUrl: Be,
14324
14326
  thumbnailUrl: I ?? q.image_url,
14325
14327
  onThumbnailCaptured: async (tt) => {
14326
- if (!_) {
14328
+ if (!x) {
14327
14329
  m({
14328
14330
  title: r("media_thumbnail_capture_unavailable"),
14329
14331
  type: "error"
@@ -14331,7 +14333,7 @@ function bf({
14331
14333
  return;
14332
14334
  }
14333
14335
  try {
14334
- const Qe = await _(
14336
+ const Qe = await x(
14335
14337
  tt,
14336
14338
  `thumbnail-${t}.jpg`
14337
14339
  );
@@ -14399,7 +14401,7 @@ function bf({
14399
14401
  $e,
14400
14402
  {
14401
14403
  id: "media-title",
14402
- value: x.title,
14404
+ value: _.title,
14403
14405
  onChange: (X) => w((le) => ({ ...le, title: X.target.value })),
14404
14406
  placeholder: r("media_title_placeholder")
14405
14407
  }
@@ -14411,11 +14413,11 @@ function bf({
14411
14413
  // Description is stored as HTML from RichTextEditor, so
14412
14414
  // strip tags before rendering as plain text — otherwise
14413
14415
  // raw <p>/<strong>/etc. would show as visible characters.
14414
- /* @__PURE__ */ e.jsx("p", { className: "text-foreground/70 text-sm leading-relaxed", children: Tr(x.description) })
14416
+ /* @__PURE__ */ e.jsx("p", { className: "text-foreground/70 text-sm leading-relaxed", children: Tr(_.description) })
14415
14417
  ) : /* @__PURE__ */ e.jsx(
14416
- Rr,
14418
+ Lr,
14417
14419
  {
14418
- value: x.description,
14420
+ value: _.description,
14419
14421
  onChange: (X) => w((le) => ({ ...le, description: X })),
14420
14422
  placeholder: r("common_start_writing_placeholder")
14421
14423
  }
@@ -14479,7 +14481,7 @@ function bf({
14479
14481
  )
14480
14482
  ] }),
14481
14483
  (() => {
14482
- const le = (L ? da(L) : null)?.image_url ?? I ?? q?.image_url;
14484
+ const le = (R ? da(R) : null)?.image_url ?? I ?? q?.image_url;
14483
14485
  return /* @__PURE__ */ e.jsxs("div", { className: "bg-muted/40 border-border mb-4 rounded-md border p-3", children: [
14484
14486
  /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center gap-2", children: [
14485
14487
  le ? /* @__PURE__ */ e.jsx(
@@ -14491,11 +14493,11 @@ function bf({
14491
14493
  }
14492
14494
  ) : /* @__PURE__ */ e.jsx("div", { className: "bg-muted flex size-8 items-center justify-center rounded", children: /* @__PURE__ */ e.jsx(De, { className: "text-muted-foreground size-4" }) }),
14493
14495
  /* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
14494
- /* @__PURE__ */ e.jsx("p", { className: "text-foreground truncate text-xs font-medium", children: x.seoTitle || fe || r("seo_preview_title_fallback") }),
14496
+ /* @__PURE__ */ e.jsx("p", { className: "text-foreground truncate text-xs font-medium", children: _.seoTitle || fe || r("seo_preview_title_fallback") }),
14495
14497
  /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground truncate text-xs", children: q?.preview_link ?? q?.canonical_url ?? r("seo_preview_url_fallback") })
14496
14498
  ] })
14497
14499
  ] }),
14498
- x.seoDescription && /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground line-clamp-2 text-xs", children: x.seoDescription })
14500
+ _.seoDescription && /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground line-clamp-2 text-xs", children: _.seoDescription })
14499
14501
  ] });
14500
14502
  })(),
14501
14503
  W && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
@@ -14505,7 +14507,7 @@ function bf({
14505
14507
  $e,
14506
14508
  {
14507
14509
  id: "seo-title",
14508
- value: x.seoTitle,
14510
+ value: _.seoTitle,
14509
14511
  onChange: (X) => w((le) => ({
14510
14512
  ...le,
14511
14513
  seoTitle: X.target.value
@@ -14520,7 +14522,7 @@ function bf({
14520
14522
  Wn,
14521
14523
  {
14522
14524
  id: "seo-description",
14523
- value: x.seoDescription,
14525
+ value: _.seoDescription,
14524
14526
  onChange: (X) => w((le) => ({
14525
14527
  ...le,
14526
14528
  seoDescription: X.target.value
@@ -14538,7 +14540,7 @@ function bf({
14538
14540
  /* @__PURE__ */ e.jsx(
14539
14541
  Hs,
14540
14542
  {
14541
- checked: x.blockCrawler,
14543
+ checked: _.blockCrawler,
14542
14544
  onCheckedChange: (X) => w((le) => ({ ...le, blockCrawler: X })),
14543
14545
  "aria-label": r("seo_block_crawlers_aria")
14544
14546
  }
@@ -14586,10 +14588,10 @@ function bf({
14586
14588
  {
14587
14589
  open: S,
14588
14590
  onOpenChange: K,
14589
- ctaEnabled: x.ctaEnabled,
14590
- ctaType: x.ctaType,
14591
- ctaButtonText: x.ctaButtonText,
14592
- ctaUrl: x.ctaUrl,
14591
+ ctaEnabled: _.ctaEnabled,
14592
+ ctaType: _.ctaType,
14593
+ ctaButtonText: _.ctaButtonText,
14594
+ ctaUrl: _.ctaUrl,
14593
14595
  onDone: (X) => {
14594
14596
  w((le) => ({
14595
14597
  ...le,
@@ -14605,7 +14607,7 @@ function bf({
14605
14607
  Us,
14606
14608
  {
14607
14609
  open: E,
14608
- onFilesSelected: ce,
14610
+ onFilesSelected: oe,
14609
14611
  onClose: () => P(!1),
14610
14612
  config: {
14611
14613
  maxFiles: 1,
@@ -14671,7 +14673,7 @@ function jf({
14671
14673
  }) {
14672
14674
  const { t: a } = ne(), { navigate: r, showToast: n, filePickerApi: i } = Ee(), l = _u(), [u, c] = o.useState(""), [d, m] = o.useState(""), [h] = o.useState(!0), [p, f] = o.useState(
14673
14675
  null
14674
- ), [g, _] = o.useState(!1), [x, w] = o.useState(!1), [b, j] = o.useState(!1), [v, C] = o.useState("link"), [N, z] = o.useState(""), [O, U] = o.useState(""), [E, P] = o.useState(!1), [A, M] = o.useState(""), [S, K] = o.useState(""), [W, D] = o.useState(!1), L = p ? In(p.metadata.mime_type) : null, { mutate: T, isPending: I } = ju(
14676
+ ), [g, x] = o.useState(!1), [_, w] = o.useState(!1), [b, j] = o.useState(!1), [v, C] = o.useState("link"), [N, z] = o.useState(""), [O, U] = o.useState(""), [E, P] = o.useState(!1), [A, M] = o.useState(""), [S, K] = o.useState(""), [W, D] = o.useState(!1), R = p ? In(p.metadata.mime_type) : null, { mutate: T, isPending: I } = ju(
14675
14677
  {
14676
14678
  onSuccess: (q) => {
14677
14679
  n({ title: a("media_create_success"), type: "success" }), t?.("media", String(q.id));
@@ -14736,7 +14738,7 @@ function jf({
14736
14738
  ]), se = o.useCallback(
14737
14739
  (q) => {
14738
14740
  const B = q[0];
14739
- B && (f(B), _(!1), u.trim() || c(B.metadata.file_name.replace(/\.[^/.]+$/, "")));
14741
+ B && (f(B), x(!1), u.trim() || c(B.metadata.file_name.replace(/\.[^/.]+$/, "")));
14740
14742
  },
14741
14743
  [u]
14742
14744
  ), G = o.useMemo(() => i ? {
@@ -14778,7 +14780,7 @@ function jf({
14778
14780
  /* @__PURE__ */ e.jsx(
14779
14781
  H,
14780
14782
  {
14781
- onClick: () => _(!0),
14783
+ onClick: () => x(!0),
14782
14784
  variant: "outline",
14783
14785
  size: "sm",
14784
14786
  disabled: !i,
@@ -14800,12 +14802,12 @@ function jf({
14800
14802
  )
14801
14803
  ] })
14802
14804
  ] }),
14803
- p && L ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3", children: [
14804
- /* @__PURE__ */ e.jsx(vf, { result: p, mediaType: L }),
14805
+ p && R ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3", children: [
14806
+ /* @__PURE__ */ e.jsx(vf, { result: p, mediaType: R }),
14805
14807
  /* @__PURE__ */ e.jsx(
14806
14808
  H,
14807
14809
  {
14808
- onClick: () => _(!0),
14810
+ onClick: () => x(!0),
14809
14811
  variant: "outline",
14810
14812
  size: "sm",
14811
14813
  className: "w-fit",
@@ -14816,7 +14818,7 @@ function jf({
14816
14818
  "button",
14817
14819
  {
14818
14820
  type: "button",
14819
- onClick: () => _(!0),
14821
+ onClick: () => x(!0),
14820
14822
  disabled: !i,
14821
14823
  className: "border-border text-muted-foreground hover:bg-muted/30 flex h-40 w-full flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors disabled:cursor-not-allowed disabled:opacity-50",
14822
14824
  children: [
@@ -14849,7 +14851,7 @@ function jf({
14849
14851
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
14850
14852
  /* @__PURE__ */ e.jsx(nt, { children: a("common_description_label") }),
14851
14853
  /* @__PURE__ */ e.jsx(
14852
- Rr,
14854
+ Lr,
14853
14855
  {
14854
14856
  value: d,
14855
14857
  onChange: m,
@@ -14929,7 +14931,7 @@ function jf({
14929
14931
  /* @__PURE__ */ e.jsx(
14930
14932
  _l,
14931
14933
  {
14932
- open: x,
14934
+ open: _,
14933
14935
  onOpenChange: w,
14934
14936
  ctaEnabled: b,
14935
14937
  ctaType: v,
@@ -14945,7 +14947,7 @@ function jf({
14945
14947
  {
14946
14948
  open: g,
14947
14949
  onFilesSelected: se,
14948
- onClose: () => _(!1),
14950
+ onClose: () => x(!1),
14949
14951
  config: {
14950
14952
  maxFiles: 1,
14951
14953
  allowedMethods: ["dam", "upload", "url"]
@@ -14970,7 +14972,7 @@ function wf({
14970
14972
  onEdit: m,
14971
14973
  onDelete: h
14972
14974
  }) {
14973
- const { navigate: p } = Ee(), { t: f } = ne(), g = Ot(), [_, x] = o.useState(!1), [w, b] = o.useState(!1), j = dt(), v = r > 1, C = r === 1 ? f("playlist_item_count_one", { count: "1" }) : f("playlist_item_count_other", { count: String(r) });
14975
+ const { navigate: p } = Ee(), { t: f } = ne(), g = Ot(), [x, _] = o.useState(!1), [w, b] = o.useState(!1), j = dt(), v = r > 1, C = r === 1 ? f("playlist_item_count_one", { count: "1" }) : f("playlist_item_count_other", { count: String(r) });
14974
14976
  return /* @__PURE__ */ e.jsx(
14975
14977
  "button",
14976
14978
  {
@@ -15001,11 +15003,11 @@ function wf({
15001
15003
  /* @__PURE__ */ e.jsxs("div", { className: "bg-background relative z-10 rounded-lg p-1 shadow-md", children: [
15002
15004
  /* @__PURE__ */ e.jsxs("div", { className: "bg-muted relative aspect-square overflow-hidden rounded-lg", children: [
15003
15005
  g({
15004
- src: _ ? Dn : s || Dn,
15006
+ src: x ? Dn : s || Dn,
15005
15007
  alt: t,
15006
15008
  fill: !0,
15007
15009
  className: "object-cover transition-transform group-hover:scale-105",
15008
- onError: () => x(!0)
15010
+ onError: () => _(!0)
15009
15011
  }),
15010
15012
  i && /* @__PURE__ */ e.jsx(
15011
15013
  "div",
@@ -15215,7 +15217,7 @@ function Nf({
15215
15217
  }
15216
15218
  const kf = 12, Cf = "grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4";
15217
15219
  function Sf(t) {
15218
- const s = Ae(), { t: a } = ne(), r = dt(), { navigate: n, showToast: i, user: l, onToggleFavorite: u, onDeletePlaylist: c } = Ee(), d = Ws(), m = Ge(), [h, p] = o.useState(""), [f, g] = o.useState(""), [_, x] = o.useState("title"), [w, b] = o.useState("all"), [j, v] = o.useState("grid"), [C, N] = o.useState(/* @__PURE__ */ new Set()), [z, O] = o.useState(null), [U, E] = o.useState(null);
15220
+ const s = Ae(), { t: a } = ne(), r = dt(), { navigate: n, showToast: i, user: l, onToggleFavorite: u, onDeletePlaylist: c } = Ee(), d = Ws(), m = Ge(), [h, p] = o.useState(""), [f, g] = o.useState(""), [x, _] = o.useState("title"), [w, b] = o.useState("all"), [j, v] = o.useState("grid"), [C, N] = o.useState(/* @__PURE__ */ new Set()), [z, O] = o.useState(null), [U, E] = o.useState(null);
15219
15221
  o.useEffect(() => {
15220
15222
  N(/* @__PURE__ */ new Set());
15221
15223
  }, [w]), o.useEffect(() => {
@@ -15223,27 +15225,27 @@ function Sf(t) {
15223
15225
  return () => clearTimeout(k);
15224
15226
  }, [h]);
15225
15227
  const P = o.useRef(null), A = [
15226
- ...Ne.playlists.list(f, _, w)
15228
+ ...Ne.playlists.list(f, x, w)
15227
15229
  ], {
15228
15230
  data: M,
15229
15231
  isLoading: S,
15230
15232
  isFetchingNextPage: K,
15231
15233
  hasNextPage: W,
15232
15234
  fetchNextPage: D,
15233
- error: L
15234
- } = Rt({
15235
+ error: R
15236
+ } = Lt({
15235
15237
  queryKey: A,
15236
15238
  queryFn: async ({ pageParam: k }) => {
15237
- const ce = await s.playlists.getPlaylists({
15239
+ const oe = await s.playlists.getPlaylists({
15238
15240
  "filter[title]": f || void 0,
15239
15241
  "filter[ownership]": w !== "all" ? w : void 0,
15240
15242
  "page[cursor]": k,
15241
15243
  "page[limit]": kf,
15242
- sort: _
15244
+ sort: x
15243
15245
  });
15244
15246
  return {
15245
- playlists: ce.playlists,
15246
- nextCursor: ce.meta.pagination.next_cursor
15247
+ playlists: oe.playlists,
15248
+ nextCursor: oe.meta.pagination.next_cursor
15247
15249
  };
15248
15250
  },
15249
15251
  getNextPageParam: (k) => k.nextCursor ?? void 0,
@@ -15256,18 +15258,18 @@ function Sf(t) {
15256
15258
  o.useEffect(() => {
15257
15259
  const k = P.current;
15258
15260
  if (!k) return;
15259
- const ce = new IntersectionObserver(
15261
+ const oe = new IntersectionObserver(
15260
15262
  (ye) => {
15261
15263
  ye[0]?.isIntersecting && W && !K && D();
15262
15264
  },
15263
15265
  { threshold: 0, rootMargin: "200px" }
15264
15266
  );
15265
- return ce.observe(k), () => ce.disconnect();
15267
+ return oe.observe(k), () => oe.disconnect();
15266
15268
  }, [D, W, K]);
15267
- const I = C.size > 0, $ = o.useCallback((k, ce) => {
15269
+ const I = C.size > 0, $ = o.useCallback((k, oe) => {
15268
15270
  N((ye) => {
15269
15271
  const fe = new Set(ye);
15270
- return ce ? fe.add(k) : fe.delete(k), fe;
15272
+ return oe ? fe.add(k) : fe.delete(k), fe;
15271
15273
  });
15272
15274
  }, []), se = o.useCallback(() => {
15273
15275
  C.size === T.length ? N(/* @__PURE__ */ new Set()) : N(new Set(T.map((k) => k.id)));
@@ -15280,7 +15282,7 @@ function Sf(t) {
15280
15282
  }) : Promise.reject(new Error("Favorite not available")),
15281
15283
  onMutate: async (k) => {
15282
15284
  await m.cancelQueries({ queryKey: A });
15283
- const ce = m.getQueryData(A);
15285
+ const oe = m.getQueryData(A);
15284
15286
  return m.setQueryData(A, (ye) => ye && {
15285
15287
  ...ye,
15286
15288
  pages: ye.pages.map((fe) => ({
@@ -15289,9 +15291,9 @@ function Sf(t) {
15289
15291
  (X) => X.id === k ? { ...X, is_favorited: !X.is_favorited } : X
15290
15292
  )
15291
15293
  }))
15292
- }), { previousData: ce, capturedKey: A };
15294
+ }), { previousData: oe, capturedKey: A };
15293
15295
  },
15294
- onError: (k, ce, ye) => {
15296
+ onError: (k, oe, ye) => {
15295
15297
  ye?.previousData && m.setQueryData(ye.capturedKey, ye.previousData), i({ title: a("playlist_favorite_error"), type: "error" });
15296
15298
  },
15297
15299
  onSuccess: (k) => {
@@ -15329,7 +15331,7 @@ function Sf(t) {
15329
15331
  error: k
15330
15332
  }), O(null);
15331
15333
  }
15332
- }), R = o.useCallback(() => {
15334
+ }), L = o.useCallback(() => {
15333
15335
  z != null && _e(z);
15334
15336
  }, [z, _e]), Y = o.useMemo(
15335
15337
  () => [
@@ -15369,8 +15371,8 @@ function Sf(t) {
15369
15371
  onSearchChange: p,
15370
15372
  placeholder: a("playlist_search_placeholder"),
15371
15373
  sortOptions: Y,
15372
- sortValue: _,
15373
- onSortChange: x
15374
+ sortValue: x,
15375
+ onSortChange: _
15374
15376
  }
15375
15377
  ) }),
15376
15378
  /* @__PURE__ */ e.jsx(Mr, { value: j, onChange: v })
@@ -15378,9 +15380,9 @@ function Sf(t) {
15378
15380
  }
15379
15381
  ), J = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
15380
15382
  K && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx("div", { className: "border-primary size-6 animate-spin rounded-full border-2 border-t-transparent" }) }),
15381
- L && /* @__PURE__ */ e.jsxs("p", { className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2", children: [
15383
+ R && /* @__PURE__ */ e.jsxs("p", { className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2", children: [
15382
15384
  "Error: ",
15383
- L.message
15385
+ R.message
15384
15386
  ] })
15385
15387
  ] }), me = T.length === 0 && !K && !W;
15386
15388
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -15419,7 +15421,7 @@ function Sf(t) {
15419
15421
  sentinelRef: P,
15420
15422
  loadingFilterShape: "search-view",
15421
15423
  children: j === "grid" ? /* @__PURE__ */ e.jsx("div", { className: Cf, children: T.map((k) => {
15422
- const ce = k.items?.[0], ye = k.image_url ?? ce?.image_url ?? ce?.relateable?.image_url ?? ce?.relateable?.compressed_image_url, fe = k.items_count ?? k.items?.length ?? 0, X = d && k.user_id === l?.id;
15424
+ const oe = k.items?.[0], ye = k.image_url ?? oe?.image_url ?? oe?.relateable?.image_url ?? oe?.relateable?.compressed_image_url, fe = k.items_count ?? k.items?.length ?? 0, X = d && k.user_id === l?.id;
15423
15425
  return /* @__PURE__ */ e.jsx(
15424
15426
  wf,
15425
15427
  {
@@ -15439,7 +15441,7 @@ function Sf(t) {
15439
15441
  k.id
15440
15442
  );
15441
15443
  }) }) : /* @__PURE__ */ e.jsx("div", { className: Ar, children: T.map((k) => {
15442
- const ce = k.items?.[0], ye = k.image_url ?? ce?.image_url ?? ce?.relateable?.image_url ?? ce?.relateable?.compressed_image_url, fe = k.items_count ?? k.items?.length ?? 0, X = d && k.user_id === l?.id, le = C.has(k.id), We = k.title || a("playlist_untitled");
15444
+ const oe = k.items?.[0], ye = k.image_url ?? oe?.image_url ?? oe?.relateable?.image_url ?? oe?.relateable?.compressed_image_url, fe = k.items_count ?? k.items?.length ?? 0, X = d && k.user_id === l?.id, le = C.has(k.id), We = k.title || a("playlist_untitled");
15443
15445
  return /* @__PURE__ */ e.jsx(
15444
15446
  Er,
15445
15447
  {
@@ -15591,7 +15593,7 @@ function Sf(t) {
15591
15593
  H,
15592
15594
  {
15593
15595
  variant: "destructive",
15594
- onClick: R,
15596
+ onClick: L,
15595
15597
  disabled: F,
15596
15598
  children: F ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : a("common_delete")
15597
15599
  }
@@ -15639,14 +15641,14 @@ function Mf({
15639
15641
  /* @__PURE__ */ e.jsx("div", { className: "mb-1 text-sm text-gray-500", children: n("playlist_no_items") }),
15640
15642
  /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: n("playlist_no_items_description") })
15641
15643
  ] }) }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: t.map((d, m) => {
15642
- const h = d.relateable, p = d.image_url ?? h?.image_url ?? h?.compressed_image_url ?? Pf, f = d.title ?? h?.title ?? n("common_untitled"), g = h?.display_price || h?.price, _ = g && parseFloat(g.replace(/[^0-9.-]/g, "")) > 0 ? g : null, x = d.kind ?? h?.kind, w = Tf(d.relateable_type, x, {
15644
+ const h = d.relateable, p = d.image_url ?? h?.image_url ?? h?.compressed_image_url ?? Pf, f = d.title ?? h?.title ?? n("common_untitled"), g = h?.display_price || h?.price, x = g && parseFloat(g.replace(/[^0-9.-]/g, "")) > 0 ? g : null, _ = d.kind ?? h?.kind, w = Tf(d.relateable_type, _, {
15643
15645
  product: n("common_product"),
15644
15646
  enrollment: n("common_enrollment"),
15645
15647
  page: n("common_page"),
15646
15648
  video: n("media_type_video"),
15647
15649
  image: n("media_type_image"),
15648
15650
  media: n("media_type_default")
15649
- }), b = x === "video", j = x === "image", v = d.relateable_type === "Product", C = xl.has(
15651
+ }), b = _ === "video", j = _ === "image", v = d.relateable_type === "Product", C = xl.has(
15650
15652
  d.relateable_type ?? ""
15651
15653
  ), N = Af(
15652
15654
  d.duration ?? h?.duration
@@ -15685,7 +15687,7 @@ function Mf({
15685
15687
  ]
15686
15688
  }
15687
15689
  ) : /* @__PURE__ */ e.jsx("div", { className: "text-foreground text-[15px] leading-[1.4] font-semibold", children: /* @__PURE__ */ e.jsx("span", { className: "line-clamp-2", children: f }) }),
15688
- v && _ && /* @__PURE__ */ e.jsx("div", { className: "text-foreground text-[15px] leading-[1.4] font-normal", children: _ }),
15690
+ v && x && /* @__PURE__ */ e.jsx("div", { className: "text-foreground text-[15px] leading-[1.4] font-normal", children: x }),
15689
15691
  b && /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-[13px] leading-[1.4] font-normal", children: N || n("media_type_video") }),
15690
15692
  j && /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-[13px] leading-[1.4] font-normal", children: z || n("file_type_image_fallback") }),
15691
15693
  /* @__PURE__ */ e.jsx("div", { className: "mt-1", children: /* @__PURE__ */ e.jsx("span", { className: "bg-background text-foreground inline-flex items-center rounded-md px-2.5 py-1 text-[13px] leading-[1.4] font-medium", children: w }) })
@@ -15714,8 +15716,8 @@ function If({
15714
15716
  queryFn: () => n.playlists.getPlaylistById(Number(t), l)
15715
15717
  }), {
15716
15718
  shareLink: g,
15717
- loading: _,
15718
- error: x
15719
+ loading: x,
15720
+ error: _
15719
15721
  } = Pa({ id: Number(t) }, "Library", void 0, l), w = p?.playlist, b = d && w?.user_id === c?.id, j = w?.title || "", v = w?.items?.filter(
15720
15722
  (A) => A.relateable_type === "Product" || A.relateable_type === "EnrollmentPack"
15721
15723
  ).map((A) => A.relateable).filter((A) => !!A) || [], C = w?.items?.filter(
@@ -15774,8 +15776,8 @@ function If({
15774
15776
  {
15775
15777
  downloadUrl: null,
15776
15778
  displayTitle: j,
15777
- shareLink: x ? null : g || null,
15778
- shareLinkLoading: _,
15779
+ shareLink: _ ? null : g || null,
15780
+ shareLinkLoading: x,
15779
15781
  isVideo: P,
15780
15782
  relateableId: Number(t),
15781
15783
  relateableType: "Library"
@@ -15831,7 +15833,7 @@ const yl = o.createContext(
15831
15833
  countries: t?.countries?.map((s) => s.iso) ?? [],
15832
15834
  search_engine_optimizer: t?.search_engine_optimizer ?? null
15833
15835
  });
15834
- function Lf({
15836
+ function Rf({
15835
15837
  children: t,
15836
15838
  playlist: s
15837
15839
  }) {
@@ -15839,23 +15841,23 @@ function Lf({
15839
15841
  {}
15840
15842
  ), c = o.useMemo(() => JSON.stringify(n) !== JSON.stringify(r), [n, r]), d = o.useRef(JSON.stringify(s));
15841
15843
  o.useEffect(() => {
15842
- const x = JSON.stringify(s);
15843
- x !== d.current && (d.current = x, i(sr(s)));
15844
+ const _ = JSON.stringify(s);
15845
+ _ !== d.current && (d.current = _, i(sr(s)));
15844
15846
  }, [s]);
15845
15847
  const m = o.useCallback(
15846
- (x, w) => {
15847
- i((b) => ({ ...b, [x]: w })), l[x] && u((b) => {
15848
+ (_, w) => {
15849
+ i((b) => ({ ...b, [_]: w })), l[_] && u((b) => {
15848
15850
  const j = { ...b };
15849
- return delete j[x], j;
15851
+ return delete j[_], j;
15850
15852
  });
15851
15853
  },
15852
15854
  [l]
15853
15855
  ), h = o.useCallback(
15854
- (x) => {
15856
+ (_) => {
15855
15857
  i((w) => {
15856
15858
  const j = { ...w.search_engine_optimizer ?? Df(w.title) };
15857
- x.title !== void 0 && (j.title = x.title ?? ""), x.description !== void 0 && (j.description = x.description ?? ""), x.image_url !== void 0 && (j.image_url = x.image_url ?? ""), x.image_path !== void 0 && (j.image_path = x.image_path ?? ""), x.block_crawler !== void 0 && (j.block_crawler = x.block_crawler ?? !1);
15858
- const v = x.slug !== void 0 ? x.slug ?? null : w.slug;
15859
+ _.title !== void 0 && (j.title = _.title ?? ""), _.description !== void 0 && (j.description = _.description ?? ""), _.image_url !== void 0 && (j.image_url = _.image_url ?? ""), _.image_path !== void 0 && (j.image_path = _.image_path ?? ""), _.block_crawler !== void 0 && (j.block_crawler = _.block_crawler ?? !1);
15860
+ const v = _.slug !== void 0 ? _.slug ?? null : w.slug;
15859
15861
  return {
15860
15862
  ...w,
15861
15863
  slug: v,
@@ -15865,19 +15867,19 @@ function Lf({
15865
15867
  },
15866
15868
  []
15867
15869
  ), p = o.useCallback(() => {
15868
- const x = {};
15869
- return (!n.title || !n.title.trim()) && (x.title = a("playlist_title_required")), u(x), Object.keys(x).length === 0;
15870
- }, [n.title, a]), f = o.useCallback((x) => {
15870
+ const _ = {};
15871
+ return (!n.title || !n.title.trim()) && (_.title = a("playlist_title_required")), u(_), Object.keys(_).length === 0;
15872
+ }, [n.title, a]), f = o.useCallback((_) => {
15871
15873
  u((w) => {
15872
15874
  const b = { ...w };
15873
- return delete b[x], b;
15875
+ return delete b[_], b;
15874
15876
  });
15875
15877
  }, []), g = o.useCallback(
15876
- (x) => {
15877
- i(sr(x ?? s)), u({});
15878
+ (_) => {
15879
+ i(sr(_ ?? s)), u({});
15878
15880
  },
15879
15881
  [s]
15880
- ), _ = o.useMemo(
15882
+ ), x = o.useMemo(
15881
15883
  () => ({
15882
15884
  form: n,
15883
15885
  validationErrors: l,
@@ -15899,7 +15901,7 @@ function Lf({
15899
15901
  g
15900
15902
  ]
15901
15903
  );
15902
- return /* @__PURE__ */ e.jsx(yl.Provider, { value: _, children: t });
15904
+ return /* @__PURE__ */ e.jsx(yl.Provider, { value: x, children: t });
15903
15905
  }
15904
15906
  function Fa() {
15905
15907
  const t = o.use(yl);
@@ -15916,7 +15918,7 @@ function Ia() {
15916
15918
  );
15917
15919
  return t;
15918
15920
  }
15919
- function Rf({
15921
+ function Lf({
15920
15922
  children: t,
15921
15923
  initialItems: s = []
15922
15924
  }) {
@@ -15958,7 +15960,7 @@ function zf({
15958
15960
  onSubmit: a,
15959
15961
  isSaving: r
15960
15962
  }) {
15961
- const { t: n } = ne(), { form: i, isDirty: l } = Fa(), { isDirty: u } = Ia(), { onDeletePlaylist: c, showToast: d, navigate: m } = Ee(), h = dt(), [p, f] = o.useState(!1), [g, _] = o.useState(!1), [x, w] = o.useState(!1), b = o.useMemo(() => !!(i.title && i.title.trim()), [i.title]), j = l || u, v = x || r, C = async () => {
15963
+ const { t: n } = ne(), { form: i, isDirty: l } = Fa(), { isDirty: u } = Ia(), { onDeletePlaylist: c, showToast: d, navigate: m } = Ee(), h = dt(), [p, f] = o.useState(!1), [g, x] = o.useState(!1), [_, w] = o.useState(!1), b = o.useMemo(() => !!(i.title && i.title.trim()), [i.title]), j = l || u, v = _ || r, C = async () => {
15962
15964
  if (!(!t || !c)) {
15963
15965
  w(!0);
15964
15966
  try {
@@ -15985,7 +15987,7 @@ function zf({
15985
15987
  className: "size-8 p-0",
15986
15988
  "aria-label": n("playlist_actions_aria"),
15987
15989
  disabled: v,
15988
- onClick: () => _(!0),
15990
+ onClick: () => x(!0),
15989
15991
  children: /* @__PURE__ */ e.jsx(lt, { className: "size-4" })
15990
15992
  }
15991
15993
  ),
@@ -15993,7 +15995,7 @@ function zf({
15993
15995
  Xe,
15994
15996
  {
15995
15997
  open: g,
15996
- onOpenChange: _,
15998
+ onOpenChange: x,
15997
15999
  title: n("playlist_actions_aria"),
15998
16000
  actions: [
15999
16001
  {
@@ -16061,7 +16063,7 @@ function zf({
16061
16063
  {
16062
16064
  open: p,
16063
16065
  onOpenChange: (N) => {
16064
- !N && !x && f(!1);
16066
+ !N && !_ && f(!1);
16065
16067
  },
16066
16068
  title: n("playlist_delete_confirm_title"),
16067
16069
  description: n("playlist_delete_confirm_description"),
@@ -16073,7 +16075,7 @@ function zf({
16073
16075
  H,
16074
16076
  {
16075
16077
  variant: "secondary",
16076
- disabled: x,
16078
+ disabled: _,
16077
16079
  onClick: () => f(!1),
16078
16080
  children: n("common_cancel")
16079
16081
  }
@@ -16085,8 +16087,8 @@ function zf({
16085
16087
  onClick: (N) => {
16086
16088
  N.preventDefault(), C();
16087
16089
  },
16088
- disabled: x,
16089
- children: x ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : n("common_delete")
16090
+ disabled: _,
16091
+ children: _ ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : n("common_delete")
16090
16092
  }
16091
16093
  )
16092
16094
  ] })
@@ -16122,7 +16124,7 @@ function Of() {
16122
16124
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
16123
16125
  /* @__PURE__ */ e.jsx(nt, { className: "text-foreground font-medium", children: t("common_description_label") }),
16124
16126
  /* @__PURE__ */ e.jsx("div", { className: "border-border rounded-[6px] border shadow-xs", children: /* @__PURE__ */ e.jsx(
16125
- Rr,
16127
+ Lr,
16126
16128
  {
16127
16129
  value: s.description || "",
16128
16130
  onChange: (n) => a("description", n),
@@ -16140,21 +16142,19 @@ function $f({
16140
16142
  id: s,
16141
16143
  enableReordering: a = !0
16142
16144
  }) {
16143
- const {
16144
- attributes: r,
16145
- listeners: n,
16146
- setNodeRef: i,
16147
- transform: l,
16148
- transition: u,
16149
- isDragging: c
16150
- } = lo({ id: s, disabled: !a }), d = {
16151
- transform: oo.Transform.toString(l),
16152
- transition: u,
16153
- opacity: c ? 0.5 : 1
16145
+ const r = !a, {
16146
+ attributes: n,
16147
+ listeners: i,
16148
+ setNodeRef: l,
16149
+ transform: u,
16150
+ transition: c,
16151
+ isDragging: d
16152
+ } = lo({ id: s, disabled: r }), m = {
16153
+ transform: oo.Transform.toString(u),
16154
+ transition: c,
16155
+ opacity: d ? 0.5 : 1
16154
16156
  };
16155
- return /* @__PURE__ */ e.jsx("tr", { ref: i, style: d, ...r, children: oe.Children.map(t, (m, h) => h === 0 && a ? oe.cloneElement(m, {
16156
- ...n
16157
- }) : m) });
16157
+ return /* @__PURE__ */ e.jsx("tr", { ref: l, style: m, children: t({ ...n, ...i, disabled: r }) });
16158
16158
  }
16159
16159
  function Uf(t, s) {
16160
16160
  const a = s?.toLowerCase() ?? "";
@@ -16203,21 +16203,21 @@ function Bf({
16203
16203
  coordinateGetter: uo
16204
16204
  })
16205
16205
  ), m = (g) => {
16206
- const { active: _, over: x } = g;
16207
- if (_.id !== x?.id && s) {
16206
+ const { active: x, over: _ } = g;
16207
+ if (x.id !== _?.id && s) {
16208
16208
  const w = t.findIndex(
16209
- (j) => j.id?.toString() === _.id
16209
+ (j) => j.id?.toString() === x.id
16210
16210
  ), b = t.findIndex(
16211
- (j) => j.id?.toString() === x?.id
16211
+ (j) => j.id?.toString() === _?.id
16212
16212
  );
16213
16213
  s(yo(t, w, b));
16214
16214
  }
16215
- }, h = t.map((g, _) => ({
16216
- id: g.id || `item-${_}`,
16215
+ }, h = t.map((g, x) => ({
16216
+ id: g.id || `item-${x}`,
16217
16217
  relateable_type: g.relateable_type,
16218
16218
  relateable_id: g.relateable?.id,
16219
16219
  relateable: g.relateable,
16220
- order: _ + 1,
16220
+ order: x + 1,
16221
16221
  title: g.title ?? g.relateable?.title ?? `${g.relateable_type} #${g.relateable?.id}`,
16222
16222
  image_url: g.image_url ?? g.relateable?.image_url ?? null,
16223
16223
  kind: g.kind ?? g.relateable?.kind ?? null
@@ -16228,19 +16228,30 @@ function Bf({
16228
16228
  /* @__PURE__ */ e.jsx("th", { className: "text-muted-foreground px-6 py-3 text-left text-xs font-medium tracking-wider uppercase", children: i("playlist_table_type") }),
16229
16229
  /* @__PURE__ */ e.jsx("th", { className: "text-muted-foreground px-6 py-3 text-left text-xs font-medium tracking-wider uppercase", children: i("playlist_table_actions") })
16230
16230
  ] }) }),
16231
- /* @__PURE__ */ e.jsx("tbody", { className: "divide-border bg-card divide-y", children: h.map((g) => /* @__PURE__ */ e.jsxs(
16231
+ /* @__PURE__ */ e.jsx("tbody", { className: "divide-border bg-card divide-y", children: h.map((g) => /* @__PURE__ */ e.jsx(
16232
16232
  $f,
16233
16233
  {
16234
16234
  id: g.id.toString(),
16235
16235
  enableReordering: n,
16236
- children: [
16236
+ children: (x) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
16237
16237
  /* @__PURE__ */ e.jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
16238
- /* @__PURE__ */ e.jsx("div", { className: n ? "cursor-move" : "", children: /* @__PURE__ */ e.jsx(
16239
- ho,
16238
+ /* @__PURE__ */ e.jsx(
16239
+ "button",
16240
16240
  {
16241
- className: `h-4 w-4 ${n ? "text-muted-foreground" : "text-muted-foreground/50"}`
16241
+ type: "button",
16242
+ ...x,
16243
+ "aria-label": i("playlist_drag_to_reorder_aria", {
16244
+ title: g.title
16245
+ }),
16246
+ className: n ? "cursor-move" : "",
16247
+ children: /* @__PURE__ */ e.jsx(
16248
+ ho,
16249
+ {
16250
+ className: `h-4 w-4 ${n ? "text-muted-foreground" : "text-muted-foreground/50"}`
16251
+ }
16252
+ )
16242
16253
  }
16243
- ) }),
16254
+ ),
16244
16255
  /* @__PURE__ */ e.jsx("div", { className: "text-foreground text-sm font-medium", children: g.order })
16245
16256
  ] }) }),
16246
16257
  /* @__PURE__ */ e.jsx("td", { className: "max-w-xs px-6 py-4 lg:max-w-md", children: /* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [
@@ -16275,6 +16286,9 @@ function Bf({
16275
16286
  size: "sm",
16276
16287
  className: "flex size-8 items-center justify-center p-0",
16277
16288
  disabled: r,
16289
+ "aria-label": i("playlist_item_actions_aria", {
16290
+ title: g.title
16291
+ }),
16278
16292
  onClick: () => {
16279
16293
  const _ = typeof g.id == "number" ? g.id : parseInt(String(g.id).replace("item-", ""));
16280
16294
  c(_);
@@ -16289,6 +16303,9 @@ function Bf({
16289
16303
  size: "sm",
16290
16304
  className: "flex size-8 items-center justify-center p-0",
16291
16305
  disabled: r,
16306
+ "aria-label": i("playlist_item_actions_aria", {
16307
+ title: g.title
16308
+ }),
16292
16309
  children: /* @__PURE__ */ e.jsx(Vr, { className: "size-4" })
16293
16310
  }
16294
16311
  ) }),
@@ -16296,7 +16313,9 @@ function Bf({
16296
16313
  Fe,
16297
16314
  {
16298
16315
  onClick: () => {
16299
- const _ = typeof g.id == "number" ? g.id : parseInt(String(g.id).replace("item-", ""));
16316
+ const _ = typeof g.id == "number" ? g.id : parseInt(
16317
+ String(g.id).replace("item-", "")
16318
+ );
16300
16319
  a(_);
16301
16320
  },
16302
16321
  variant: "destructive",
@@ -16307,7 +16326,7 @@ function Bf({
16307
16326
  }
16308
16327
  ) })
16309
16328
  ] }) })
16310
- ]
16329
+ ] })
16311
16330
  },
16312
16331
  g.id
16313
16332
  )) })
@@ -16423,7 +16442,7 @@ function Qf({
16423
16442
  updateItems: h,
16424
16443
  addItem: p,
16425
16444
  removeItem: f
16426
- } = Ia(), g = m, { primaryItems: _, taggedItems: x } = o.useMemo(() => {
16445
+ } = Ia(), g = m, { primaryItems: x, taggedItems: _ } = o.useMemo(() => {
16427
16446
  const M = [], S = [];
16428
16447
  return g.forEach((K) => {
16429
16448
  K.relateable_type && zr.has(K.relateable_type) ? M.push(K) : K.relateable_type && Or.has(K.relateable_type) && S.push(K);
@@ -16459,7 +16478,7 @@ function Qf({
16459
16478
  );
16460
16479
  const N = !!l.playlists.reorderPlaylistItems, z = o.useCallback(
16461
16480
  (M, S) => {
16462
- const K = S === "primary" ? [...M, ...x] : [..._, ...M], W = Gf(K);
16481
+ const K = S === "primary" ? [...M, ..._] : [...x, ...M], W = Gf(K);
16463
16482
  t && N && v.current === null && C.current === null && (C.current = g), h(W), !(!t || !N) && (v.current && clearTimeout(v.current), v.current = setTimeout(() => {
16464
16483
  v.current = null;
16465
16484
  const D = C.current;
@@ -16468,19 +16487,19 @@ function Qf({
16468
16487
  playlistId: t,
16469
16488
  data: {
16470
16489
  items: W.filter(
16471
- (L) => Number.isInteger(L.id) && typeof L.order == "number"
16472
- ).map((L) => ({ id: L.id, order: L.order }))
16490
+ (R) => Number.isInteger(R.id) && typeof R.order == "number"
16491
+ ).map((R) => ({ id: R.id, order: R.order }))
16473
16492
  }
16474
16493
  },
16475
16494
  {
16476
16495
  onSuccess: () => {
16477
16496
  v.current === null ? C.current = null : C.current = W;
16478
16497
  },
16479
- onError: (L) => {
16498
+ onError: (R) => {
16480
16499
  D && h(D), C.current = null, r({
16481
16500
  title: s("playlist_reorder_error"),
16482
16501
  type: "error",
16483
- error: L
16502
+ error: R
16484
16503
  });
16485
16504
  }
16486
16505
  }
@@ -16488,8 +16507,8 @@ function Qf({
16488
16507
  }, Kf));
16489
16508
  },
16490
16509
  [
16491
- _,
16492
16510
  x,
16511
+ _,
16493
16512
  g,
16494
16513
  h,
16495
16514
  t,
@@ -16516,9 +16535,9 @@ function Qf({
16516
16535
  for (const W of S) {
16517
16536
  const D = Vf(W.asset_code);
16518
16537
  if (!D || !M.allowedRelateableTypes.has(D)) continue;
16519
- const L = W.asset_id, T = W.metadata?.file_name || `${D} #${L}`;
16538
+ const R = W.asset_id, T = W.metadata?.file_name || `${D} #${R}`;
16520
16539
  if (g.some(
16521
- (G) => G.relateable_type === D && G.relateable?.id === L
16540
+ (G) => G.relateable_type === D && G.relateable?.id === R
16522
16541
  )) {
16523
16542
  r({
16524
16543
  title: s("playlist_item_already_exists"),
@@ -16531,7 +16550,7 @@ function Qf({
16531
16550
  order: $,
16532
16551
  relateable_type: D,
16533
16552
  relateable: {
16534
- id: L,
16553
+ id: R,
16535
16554
  title: T,
16536
16555
  image_url: W.thumbnail_url ?? W.file_url ?? null
16537
16556
  }
@@ -16543,7 +16562,7 @@ function Qf({
16543
16562
  newItem: se,
16544
16563
  data: {
16545
16564
  relateable_type: D,
16546
- relateable_id: L,
16565
+ relateable_id: R,
16547
16566
  order: $
16548
16567
  }
16549
16568
  }), r({
@@ -16602,10 +16621,10 @@ function Qf({
16602
16621
  );
16603
16622
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-8", children: [
16604
16623
  /* @__PURE__ */ e.jsx(
16605
- Ln,
16624
+ Rn,
16606
16625
  {
16607
16626
  section: u.primary,
16608
- items: _,
16627
+ items: x,
16609
16628
  onAdd: () => d("primary"),
16610
16629
  onReorder: (M) => z(M, "primary"),
16611
16630
  onDeleteItem: O,
@@ -16614,11 +16633,11 @@ function Qf({
16614
16633
  disableAdd: !P
16615
16634
  }
16616
16635
  ),
16617
- (!P || A || x.length > 0) && /* @__PURE__ */ e.jsx(
16618
- Ln,
16636
+ (!P || A || _.length > 0) && /* @__PURE__ */ e.jsx(
16637
+ Rn,
16619
16638
  {
16620
16639
  section: u.tagged,
16621
- items: x,
16640
+ items: _,
16622
16641
  onAdd: () => d("tagged"),
16623
16642
  onReorder: (M) => z(M, "tagged"),
16624
16643
  onDeleteItem: O,
@@ -16657,7 +16676,7 @@ function Qf({
16657
16676
  ] }) })
16658
16677
  ] });
16659
16678
  }
16660
- function Ln({
16679
+ function Rn({
16661
16680
  section: t,
16662
16681
  items: s,
16663
16682
  onAdd: a,
@@ -16791,18 +16810,18 @@ function ag({
16791
16810
  hideHeader: n,
16792
16811
  renderHeaderSlot: i
16793
16812
  }) {
16794
- const l = Ae(), { t: u } = ne(), { showToast: c, navigate: d, user: m } = Ee(), { items: h } = Ia(), { form: p, updateField: f, validateForm: g } = Fa(), _ = p.title || "", x = p.slug ?? "";
16813
+ const l = Ae(), { t: u } = ne(), { showToast: c, navigate: d, user: m } = Ee(), { items: h } = Ia(), { form: p, updateField: f, validateForm: g } = Fa(), x = p.title || "", _ = p.slug ?? "";
16795
16814
  o.useEffect(() => {
16796
16815
  const z = p.custom_slug || s?.custom_slug || !1;
16797
- if (_ && !z) {
16798
- const O = _.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
16799
- O !== x && f("slug", O);
16816
+ if (x && !z) {
16817
+ const O = x.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
16818
+ O !== _ && f("slug", O);
16800
16819
  }
16801
16820
  }, [
16802
- _,
16821
+ x,
16803
16822
  p.custom_slug,
16804
16823
  s?.custom_slug,
16805
- x,
16824
+ _,
16806
16825
  f
16807
16826
  ]);
16808
16827
  const w = ku({
@@ -16933,7 +16952,7 @@ function ag({
16933
16952
  z.preventDefault(), d(`playlists/${t}`);
16934
16953
  },
16935
16954
  className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
16936
- children: _ || u("playlist_breadcrumb_fallback")
16955
+ children: x || u("playlist_breadcrumb_fallback")
16937
16956
  }
16938
16957
  ) }),
16939
16958
  /* @__PURE__ */ e.jsx(xt, {}),
@@ -16973,7 +16992,7 @@ function ag({
16973
16992
  ] }) })
16974
16993
  ] });
16975
16994
  }
16976
- function Rn({
16995
+ function Ln({
16977
16996
  playlistId: t,
16978
16997
  onBack: s,
16979
16998
  hideHeader: a,
@@ -16987,7 +17006,7 @@ function Rn({
16987
17006
  return l && c ? /* @__PURE__ */ e.jsxs("div", { className: "mx-auto max-w-7xl space-y-6 px-6 pt-6 pb-8 md:px-10 md:py-8", children: [
16988
17007
  /* @__PURE__ */ e.jsx(Oe, { className: "h-8 w-48" }),
16989
17008
  /* @__PURE__ */ e.jsx(Oe, { className: "h-64 w-full" })
16990
- ] }) : /* @__PURE__ */ e.jsx(Lf, { playlist: d, children: /* @__PURE__ */ e.jsx(Rf, { initialItems: m, children: /* @__PURE__ */ e.jsx(
17009
+ ] }) : /* @__PURE__ */ e.jsx(Rf, { playlist: d, children: /* @__PURE__ */ e.jsx(Lf, { initialItems: m, children: /* @__PURE__ */ e.jsx(
16991
17010
  ag,
16992
17011
  {
16993
17012
  playlistId: t,
@@ -17021,7 +17040,7 @@ function lg({
17021
17040
  hasNextPage: p,
17022
17041
  fetchNextPage: f,
17023
17042
  error: g
17024
- } = Rt({
17043
+ } = Lt({
17025
17044
  queryKey: ["shareables-files", u],
17026
17045
  queryFn: async ({ pageParam: b = 1 }) => await s.fileResources.getFileResources({
17027
17046
  search_query: u || void 0,
@@ -17033,10 +17052,10 @@ function lg({
17033
17052
  return j < v ? j + 1 : void 0;
17034
17053
  },
17035
17054
  initialPageParam: 1
17036
- }), _ = o.useMemo(
17055
+ }), x = o.useMemo(
17037
17056
  () => d?.pages.flatMap((b) => b.file_resources) ?? [],
17038
17057
  [d?.pages]
17039
- ), x = Ta({
17058
+ ), _ = Ta({
17040
17059
  hasNextPage: p,
17041
17060
  isFetchingNextPage: h,
17042
17061
  fetchNextPage: f,
@@ -17051,7 +17070,7 @@ function lg({
17051
17070
  Ys,
17052
17071
  {
17053
17072
  isLoading: m,
17054
- isEmpty: !g && _.length === 0 && !h && !p,
17073
+ isEmpty: !g && x.length === 0 && !h && !p,
17055
17074
  emptyMessage: u ? r("files_search_no_results", { search: u }) : r("files_empty_default"),
17056
17075
  filters: /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx("div", { className: "w-full max-w-sm", children: /* @__PURE__ */ e.jsx(
17057
17076
  Gs,
@@ -17063,8 +17082,8 @@ function lg({
17063
17082
  }
17064
17083
  ) }) }),
17065
17084
  footer: w,
17066
- sentinelRef: x,
17067
- children: /* @__PURE__ */ e.jsx("div", { className: Qs, children: _.map((b) => {
17085
+ sentinelRef: _,
17086
+ children: /* @__PURE__ */ e.jsx("div", { className: Qs, children: x.map((b) => {
17068
17087
  const j = b.content_type?.startsWith("video/"), v = b.url || "#";
17069
17088
  return /* @__PURE__ */ e.jsxs(
17070
17089
  va,
@@ -17130,12 +17149,12 @@ function ug({
17130
17149
  n
17131
17150
  ), {
17132
17151
  data: g,
17133
- isLoading: _,
17134
- isFetchingNextPage: x,
17152
+ isLoading: x,
17153
+ isFetchingNextPage: _,
17135
17154
  hasNextPage: w,
17136
17155
  fetchNextPage: b,
17137
17156
  error: j
17138
- } = Rt({
17157
+ } = Lt({
17139
17158
  queryKey: f,
17140
17159
  queryFn: async ({ pageParam: N }) => {
17141
17160
  const z = await s.pages.listPages({
@@ -17169,20 +17188,20 @@ function ug({
17169
17188
  if (!N) return;
17170
17189
  const z = new IntersectionObserver(
17171
17190
  (O) => {
17172
- O[0]?.isIntersecting && w && !x && b();
17191
+ O[0]?.isIntersecting && w && !_ && b();
17173
17192
  },
17174
17193
  { threshold: 0, rootMargin: "200px" }
17175
17194
  );
17176
17195
  return z.observe(N), () => z.disconnect();
17177
- }, [b, w, x]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
17196
+ }, [b, w, _]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
17178
17197
  /* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsx(ct, { className: "text-lg", children: /* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(Ze, { className: "font-semibold", children: r("pages_breadcrumb") }) }) }) }) }),
17179
17198
  /* @__PURE__ */ e.jsx(
17180
17199
  Ys,
17181
17200
  {
17182
- isLoading: _,
17201
+ isLoading: x,
17183
17202
  error: j,
17184
17203
  errorMessage: r("pages_load_error"),
17185
- isEmpty: C.length === 0 && !x,
17204
+ isEmpty: C.length === 0 && !_,
17186
17205
  emptyMessage: c ? r("pages_search_no_results", { search: c }) : r("pages_empty_default"),
17187
17206
  filters: /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx("div", { className: "w-full max-w-sm", children: /* @__PURE__ */ e.jsx(
17188
17207
  Gs,
@@ -17196,7 +17215,7 @@ function ug({
17196
17215
  onSortChange: (N) => h(N)
17197
17216
  }
17198
17217
  ) }) }),
17199
- footer: x && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx("div", { className: "border-primary size-6 animate-spin rounded-full border-2 border-t-transparent" }) }),
17218
+ footer: _ && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx("div", { className: "border-primary size-6 animate-spin rounded-full border-2 border-t-transparent" }) }),
17200
17219
  sentinelRef: p,
17201
17220
  children: /* @__PURE__ */ e.jsx("div", { className: Qs, children: C.map((N) => {
17202
17221
  const z = N.title || r("pages_untitled"), O = () => t?.("pages", String(N.id));
@@ -17251,7 +17270,7 @@ function mg({
17251
17270
  }), d = u?.page, m = d?.title || "", h = d?.image_url || "", p = d?.description ?? "", {
17252
17271
  shareLink: f,
17253
17272
  loading: g,
17254
- error: _
17273
+ error: x
17255
17274
  } = Pa(
17256
17275
  {
17257
17276
  id: d?.id,
@@ -17267,8 +17286,8 @@ function mg({
17267
17286
  kt,
17268
17287
  {
17269
17288
  href: "#",
17270
- onClick: (x) => {
17271
- x.preventDefault(), (a?.onClick ?? s ?? (() => n("pages")))();
17289
+ onClick: (_) => {
17290
+ _.preventDefault(), (a?.onClick ?? s ?? (() => n("pages")))();
17272
17291
  },
17273
17292
  children: i("pages_breadcrumb")
17274
17293
  }
@@ -17314,7 +17333,7 @@ function mg({
17314
17333
  {
17315
17334
  downloadUrl: null,
17316
17335
  displayTitle: m,
17317
- shareLink: _ ? null : f || null,
17336
+ shareLink: x ? null : f || null,
17318
17337
  shareLinkLoading: g,
17319
17338
  isVideo: !1,
17320
17339
  relateableId: d.id,
@@ -17349,7 +17368,7 @@ function pg({
17349
17368
  onBack: n
17350
17369
  }
17351
17370
  ) : s && s !== "new" ? p = /* @__PURE__ */ e.jsx(
17352
- Lh,
17371
+ Rh,
17353
17372
  {
17354
17373
  mediaId: s,
17355
17374
  onNavigate: r,
@@ -17366,7 +17385,7 @@ function pg({
17366
17385
  break;
17367
17386
  case "playlists":
17368
17387
  case "playlist":
17369
- s === "new" && h ? p = /* @__PURE__ */ e.jsx(Rn, { onBack: n }) : s && a === "edit" && h ? p = /* @__PURE__ */ e.jsx(Rn, { playlistId: s, onBack: n }) : s && s !== "new" ? p = /* @__PURE__ */ e.jsx(
17388
+ s === "new" && h ? p = /* @__PURE__ */ e.jsx(Ln, { onBack: n }) : s && a === "edit" && h ? p = /* @__PURE__ */ e.jsx(Ln, { playlistId: s, onBack: n }) : s && s !== "new" ? p = /* @__PURE__ */ e.jsx(
17370
17389
  If,
17371
17390
  {
17372
17391
  playlistId: s,
@@ -17523,23 +17542,23 @@ function vg({
17523
17542
  l.current = n;
17524
17543
  const u = o.useRef(i);
17525
17544
  u.current = i;
17526
- const c = Rm(), { productsApi: d } = c, m = vs(), { data: h } = Ul(), { data: p } = sc(), { currentSlug: f, navigate: g } = hr(), _ = _g(), x = s ?? tc(h), w = vi(), b = Ge(), j = o.useCallback(
17527
- async (D, L, T, I) => D ? d.searchProducts(D, { cursor: L, limit: T }) : d.listProducts({ cursor: L, limit: T, sort: I }),
17545
+ const c = Lm(), { productsApi: d } = c, m = vs(), { data: h } = Ul(), { data: p } = sc(), { currentSlug: f, navigate: g } = hr(), x = _g(), _ = s ?? tc(h), w = vi(), b = Ge(), j = o.useCallback(
17546
+ async (D, R, T, I) => D ? d.searchProducts(D, { cursor: R, limit: T }) : d.listProducts({ cursor: R, limit: T, sort: I }),
17528
17547
  [d]
17529
17548
  ), v = o.useCallback(
17530
17549
  async (D) => d.getProduct(D),
17531
17550
  [d]
17532
17551
  ), { screen: C, detailId: N, action: z } = vl(f), O = yg(
17533
17552
  { screen: C, detailId: N, action: z },
17534
- _?.slug
17553
+ x?.slug
17535
17554
  ), { data: U } = ou(
17536
17555
  O ?? "",
17537
17556
  {
17538
17557
  enabled: !!O
17539
17558
  }
17540
- ), E = U?.product.name, P = o.useMemo(() => _ ? E ? { ..._, label: E } : _ : null, [_, E]), A = o.useCallback(
17541
- (D, L) => {
17542
- const T = L ? `share/${D}/${L}` : `share/${D}`;
17559
+ ), E = U?.product.name, P = o.useMemo(() => x ? E ? { ...x, label: E } : x : null, [x, E]), A = o.useCallback(
17560
+ (D, R) => {
17561
+ const T = R ? `share/${D}/${R}` : `share/${D}`;
17543
17562
  g(T);
17544
17563
  },
17545
17564
  [g]
@@ -17561,7 +17580,7 @@ function vg({
17561
17580
  affiliateId: null,
17562
17581
  basePath: "",
17563
17582
  navigate: (D) => {
17564
- const L = D.replace(/^\//, ""), T = L.startsWith("share/") ? L : `share/${L}`;
17583
+ const R = D.replace(/^\//, ""), T = R.startsWith("share/") ? R : `share/${R}`;
17565
17584
  g(T);
17566
17585
  },
17567
17586
  showToast: (D) => {
@@ -17569,14 +17588,14 @@ function vg({
17569
17588
  },
17570
17589
  filePickerApi: m,
17571
17590
  onToggleFavorite: async (D) => {
17572
- const L = await pn(
17591
+ const R = await pn(
17573
17592
  w,
17574
17593
  D.favoriteableId,
17575
17594
  D.favoriteableType
17576
17595
  );
17577
17596
  return b.invalidateQueries({
17578
17597
  queryKey: Kr.favorites()
17579
- }), L;
17598
+ }), R;
17580
17599
  },
17581
17600
  onMySiteShare: async (D) => {
17582
17601
  await pn(
@@ -17594,15 +17613,15 @@ function vg({
17594
17613
  onDeletePlaylist: async (D) => {
17595
17614
  await c.playlistsAdapter.deletePlaylist(D);
17596
17615
  },
17597
- mediaProductsApi: x ? void 0 : {
17616
+ mediaProductsApi: _ ? void 0 : {
17598
17617
  ...c.mediaProductsAdapter,
17599
- listMediaProducts: (D, L) => c.mediaProductsAdapter.listMediaProducts(D, {
17600
- ...L,
17601
- language_iso: L?.language_iso ?? u.current
17618
+ listMediaProducts: (D, R) => c.mediaProductsAdapter.listMediaProducts(D, {
17619
+ ...R,
17620
+ language_iso: R?.language_iso ?? u.current
17602
17621
  })
17603
17622
  },
17604
- searchProducts: x ? void 0 : async (D, L) => {
17605
- const T = L?.limit ?? 25, I = L?.cursor ?? void 0, $ = D.trim().length > 0 ? await d.searchProducts(D, {
17623
+ searchProducts: _ ? void 0 : async (D, R) => {
17624
+ const T = R?.limit ?? 25, I = R?.cursor ?? void 0, $ = D.trim().length > 0 ? await d.searchProducts(D, {
17606
17625
  cursor: I,
17607
17626
  limit: T
17608
17627
  }) : await d.listProducts({ cursor: I, limit: T });
@@ -17621,7 +17640,7 @@ function vg({
17621
17640
  // `readOnly` covers content authoring only: creating and editing media,
17622
17641
  // tagging products, uploading thumbnails. Playlist curation is answered
17623
17642
  // by `canCuratePlaylists`, which stays open to everyone.
17624
- readOnly: x,
17643
+ readOnly: _,
17625
17644
  canCuratePlaylists: a ?? !0,
17626
17645
  // pickerSources powers the playlist editor's content browser tabs.
17627
17646
  // All four content types are wired here: Media via the existing media
@@ -17632,9 +17651,9 @@ function vg({
17632
17651
  pickerSources: {
17633
17652
  pages: {
17634
17653
  cacheKey: `locale:${i}`,
17635
- list: async ({ search: D, cursor: L, limit: T }) => {
17654
+ list: async ({ search: D, cursor: R, limit: T }) => {
17636
17655
  const I = await c.pagesAdapter.listPages({
17637
- cursor: L ?? void 0,
17656
+ cursor: R ?? void 0,
17638
17657
  limit: T,
17639
17658
  "filter[title]": D && D.trim().length > 0 ? D : void 0,
17640
17659
  language_iso: u.current
@@ -17651,12 +17670,12 @@ function vg({
17651
17670
  },
17652
17671
  products: {
17653
17672
  cacheKey: `locale:${i}`,
17654
- list: async ({ search: D, cursor: L, limit: T }) => {
17673
+ list: async ({ search: D, cursor: R, limit: T }) => {
17655
17674
  const I = D?.trim() ?? "", $ = I.length > 0 ? await d.searchProducts(I, {
17656
- cursor: L ?? void 0,
17675
+ cursor: R ?? void 0,
17657
17676
  limit: T
17658
17677
  }) : await d.listProducts({
17659
- cursor: L ?? void 0,
17678
+ cursor: R ?? void 0,
17660
17679
  limit: T
17661
17680
  });
17662
17681
  return {
@@ -17679,10 +17698,10 @@ function vg({
17679
17698
  // surface a non-functional one. Flip to true once the
17680
17699
  // backend ships filter[title] support.
17681
17700
  supportsSearch: !1,
17682
- list: async ({ cursor: D, limit: L }) => {
17701
+ list: async ({ cursor: D, limit: R }) => {
17683
17702
  const T = await c.enrollmentPacksAdapter.listEnrollmentPacks({
17684
17703
  cursor: D ?? void 0,
17685
- limit: L
17704
+ limit: R
17686
17705
  });
17687
17706
  return {
17688
17707
  items: T.enrollment_packs.map(($) => ({
@@ -17697,10 +17716,10 @@ function vg({
17697
17716
  }
17698
17717
  }
17699
17718
  },
17700
- uploadThumbnail: x ? void 0 : async (D, L) => {
17719
+ uploadThumbnail: _ ? void 0 : async (D, R) => {
17701
17720
  const I = (await m.createDamAsset({
17702
- file: new File([D], L, { type: D.type }),
17703
- name: L
17721
+ file: new File([D], R, { type: D.type }),
17722
+ name: R
17704
17723
  })).asset?.default_variant_url;
17705
17724
  if (!I)
17706
17725
  throw new Error("Thumbnail upload succeeded but no URL returned");
@@ -17713,7 +17732,7 @@ function vg({
17713
17732
  i,
17714
17733
  g,
17715
17734
  m,
17716
- x,
17735
+ _,
17717
17736
  a,
17718
17737
  c.playlistsAdapter,
17719
17738
  c.pagesAdapter,
@@ -17803,7 +17822,7 @@ function kg({
17803
17822
  }
17804
17823
  const wl = [];
17805
17824
  function Cg() {
17806
- const t = Ae(), { isSuccess: s } = Rt({
17825
+ const t = Ae(), { isSuccess: s } = Lt({
17807
17826
  ...Xi(t, ""),
17808
17827
  retry: !1
17809
17828
  });