@chaibuilder/pages 0.7.6 → 0.7.7

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.
@@ -4,18 +4,18 @@ var Ga = (e) => {
4
4
  };
5
5
  var il = (e, t, n) => t in e ? rl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
6
  var Ks = (e, t, n) => il(e, typeof t != "symbol" ? t + "" : t, n), Ra = (e, t, n) => t.has(e) || Ga("Cannot " + n);
7
- var Z = (e, t, n) => (Ra(e, t, "read from private field"), n ? n.call(e) : t.get(e)), we = (e, t, n) => t.has(e) ? Ga("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ye = (e, t, n, s) => (Ra(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
7
+ var Z = (e, t, n) => (Ra(e, t, "read from private field"), n ? n.call(e) : t.get(e)), be = (e, t, n) => t.has(e) ? Ga("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ye = (e, t, n, s) => (Ra(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
8
8
  import { jsx as a, jsxs as o, Fragment as ve } from "react/jsx-runtime";
9
- import { get as V, isEmpty as Q, reverse as ll, sortBy as ol, each as cl, find as be, set as kt, has as Le, startCase as Gt, filter as Ie, groupBy as dl, isObject as Ua, initial as ul, includes as Et, uniq as dr, union as hl, flatMap as ta, compact as ws, uniqBy as ml, keyBy as ur, mapValues as fl, toLower as _t, map as et, endsWith as hr, startsWith as os, isEqual as ya, orderBy as es, first as mr, concat as gl, debounce as pl, upperCase as Ba, pick as Ns, keys as yl, pickBy as vl, isArray as bl, noop as wl, isFunction as Nl, cloneDeep as xl, isString as Ma, merge as El } from "lodash-es";
9
+ import { get as V, isEmpty as Q, reverse as ll, sortBy as ol, each as cl, find as we, set as kt, has as Le, startCase as Gt, filter as Ie, groupBy as dl, isObject as Ua, initial as ul, includes as Et, uniq as dr, union as hl, flatMap as ta, compact as bs, uniqBy as ml, keyBy as ur, mapValues as fl, toLower as _t, map as et, endsWith as hr, startsWith as os, isEqual as ya, orderBy as es, first as mr, concat as gl, debounce as pl, upperCase as Ba, pick as Ns, keys as yl, pickBy as vl, isArray as wl, noop as bl, isFunction as Nl, cloneDeep as xl, isString as Ma, merge as El } from "lodash-es";
10
10
  import * as Pe from "react";
11
11
  import xs, { useCallback as ie, useMemo as Y, useState as A, useEffect as de, useRef as tt, Suspense as fr, lazy as Sl } from "react";
12
12
  import { useAtom as nt, atom as jt } from "jotai";
13
13
  import { useQueryClient as ke, useMutation as _e, useQuery as Ge, onlineManager as gr, QueryClient as Al, QueryClientProvider as Tl } from "@tanstack/react-query";
14
14
  import { toast as K, Toaster as Cl } from "sonner";
15
15
  import { useLanguages as qe, useChaiFeatureFlag as vt, useSavePage as Es, useUpdateBlocksPropsRealtime as pr, PERMISSIONS as Pl, usePartailBlocksStore as kl, usePermissions as mn, useLibraryBlocks as _l, useTheme as Ll, useSidebarActivePanel as Ss, mergeClasses as va, useRightPanel as Il, registerChaiLibrary as Dl, getBlocksFromHTML as Ol, useBuilderProp as Gl, useTranslation as Rl, registerChaiSidebarPanel as Hs, registerChaiFeatureFlag as ts, registerChaiTopBar as Ul, registerChaiMediaManager as Bl, registerChaiSaveToLibrary as Ml, ChaiBuilderEditor as Fl } from "@chaibuilder/sdk";
16
- import { Tooltip as ct, TooltipTrigger as dt, TooltipContent as ut, Card as As, CardHeader as Ts, CardTitle as Cs, CardContent as Ps, CardFooter as ks, Button as C, AlertDialog as yr, AlertDialogTrigger as vr, AlertDialogContent as br, AlertDialogHeader as wr, AlertDialogTitle as Nr, AlertDialogDescription as xr, AlertDialogFooter as Er, AlertDialogCancel as Sr, AlertDialogAction as Ar, Popover as on, PopoverTrigger as cn, PopoverContent as dn, Input as xe, Label as oe, CommandList as Tr, Command as Tn, CommandEmpty as Cn, CommandGroup as xt, CommandItem as ot, Dialog as Ye, DialogContent as Je, DialogHeader as Xe, DialogTitle as Ze, DialogDescription as rt, DialogFooter as mt, Alert as Hn, Textarea as un, DropdownMenu as fn, DropdownMenuTrigger as gn, DropdownMenuContent as pn, DropdownMenuItem as Be, Select as jl, SelectTrigger as $l, SelectValue as ql, SelectContent as zl, SelectItem as Ws, Badge as Qs, Separator as Vl, Sheet as Cr, SheetContent as Pr, SheetHeader as kr, SheetTitle as _r, SheetDescription as Kl, TooltipProvider as Lt, SheetTrigger as Hl, ScrollArea as Wl, Skeleton as ns, DropdownMenuSeparator as Ql, CardDescription as Yl, CommandInput as Jl, Tabs as Lr, TabsList as Ir, TabsTrigger as us, TabsContent as hs, AlertDescription as Dr, HoverCard as Xl, HoverCardTrigger as Zl, HoverCardContent as eo, Switch as to } from "@chaibuilder/sdk/ui";
16
+ import { Tooltip as ct, TooltipTrigger as dt, TooltipContent as ut, Card as As, CardHeader as Ts, CardTitle as Cs, CardContent as Ps, CardFooter as ks, Button as C, AlertDialog as yr, AlertDialogTrigger as vr, AlertDialogContent as wr, AlertDialogHeader as br, AlertDialogTitle as Nr, AlertDialogDescription as xr, AlertDialogFooter as Er, AlertDialogCancel as Sr, AlertDialogAction as Ar, Popover as on, PopoverTrigger as cn, PopoverContent as dn, Input as xe, Label as oe, CommandList as Tr, Command as Tn, CommandEmpty as Cn, CommandGroup as xt, CommandItem as ot, Dialog as Ye, DialogContent as Je, DialogHeader as Xe, DialogTitle as Ze, DialogDescription as rt, DialogFooter as mt, Alert as Hn, Textarea as un, DropdownMenu as fn, DropdownMenuTrigger as gn, DropdownMenuContent as pn, DropdownMenuItem as Be, Select as jl, SelectTrigger as $l, SelectValue as ql, SelectContent as zl, SelectItem as Ws, Badge as Qs, Separator as Vl, Sheet as Cr, SheetContent as Pr, SheetHeader as kr, SheetTitle as _r, SheetDescription as Kl, TooltipProvider as Lt, SheetTrigger as Hl, ScrollArea as Wl, Skeleton as ns, DropdownMenuSeparator as Ql, CardDescription as Yl, CommandInput as Jl, Tabs as Lr, TabsList as Ir, TabsTrigger as us, TabsContent as hs, AlertDescription as Dr, HoverCard as Xl, HoverCardTrigger as Zl, HoverCardContent as eo, Switch as to } from "@chaibuilder/sdk/ui";
17
17
  import { formatDistanceToNow as Or, format as _s } from "date-fns";
18
- import { LockIcon as ba, UserIcon as no, AlertTriangleIcon as so, AccessibilityIcon as ao, Trash2 as Ls, Plus as wa, ImageIcon as Pn, X as kn, AlertCircle as Is, ChevronDown as Bt, Search as Mt, Check as gt, Tag as ro, File as Wn, CopyPlusIcon as io, Pencil as Gr, Power as Rr, Trash as Na, SquareLibrary as Fa, ChevronsUpDown as lo, ChevronsDownUp as oo, ChevronRight as Ur, StarsIcon as co, Globe as uo, MoreHorizontal as Ds, StarIcon as ho, PencilIcon as mo, TrashIcon as fo, Languages as go, Star as po, LogsIcon as yo, History as vo, Eye as Os, ExternalLink as na, Undo2 as Br, CloudOff as bo, Rocket as sa, Save as Mr, GlobeIcon as wo, Palette as No, CheckCircle as xo, Loader as Ft, Send as ja, Settings as Eo, EyeOff as So, Loader2 as xa, LanguagesIcon as Ao, DatabaseIcon as To, ChevronLeft as Fr, Sparkle as Co, Code as Po, AlertTriangle as jr, User as ko, Copy as $r, Link as _o, Archive as Lo, Film as Io, Edit as Do, Upload as Oo } from "lucide-react";
18
+ import { LockIcon as wa, UserIcon as no, AlertTriangleIcon as so, AccessibilityIcon as ao, Trash2 as Ls, Plus as ba, ImageIcon as Pn, X as kn, AlertCircle as Is, ChevronDown as Bt, Search as Mt, Check as gt, Tag as ro, File as Wn, CopyPlusIcon as io, Pencil as Gr, Power as Rr, Trash as Na, SquareLibrary as Fa, ChevronsUpDown as lo, ChevronsDownUp as oo, ChevronRight as Ur, StarsIcon as co, Globe as uo, MoreHorizontal as Ds, StarIcon as ho, PencilIcon as mo, TrashIcon as fo, Languages as go, Star as po, LogsIcon as yo, History as vo, Eye as Os, ExternalLink as na, Undo2 as Br, CloudOff as wo, Rocket as sa, Save as Mr, GlobeIcon as bo, Palette as No, CheckCircle as xo, Loader as Ft, Send as ja, Settings as Eo, EyeOff as So, Loader2 as xa, LanguagesIcon as Ao, DatabaseIcon as To, ChevronLeft as Fr, Sparkle as Co, Code as Po, AlertTriangle as jr, User as ko, Copy as $r, Link as _o, Archive as Lo, Film as Io, Edit as Do, Upload as Oo } from "lucide-react";
19
19
  import { useRegisteredChaiBlocks as Go, getDefaultBlockProps as Ro } from "@chaibuilder/runtime";
20
20
  import { z as cs } from "zod";
21
21
  import { useDropzone as Uo } from "react-dropzone";
@@ -295,7 +295,7 @@ function zo(e = () => {
295
295
  const i = {
296
296
  getItem: (d, u) => {
297
297
  var h, m;
298
- const w = (g) => {
298
+ const b = (g) => {
299
299
  if (g = g || "", s !== g) {
300
300
  try {
301
301
  r = JSON.parse(g, t == null ? void 0 : t.reviver);
@@ -306,7 +306,7 @@ function zo(e = () => {
306
306
  }
307
307
  return r;
308
308
  }, y = (m = (h = e()) == null ? void 0 : h.getItem(d)) != null ? m : null;
309
- return qo(y) ? y.then(w) : w(y);
309
+ return qo(y) ? y.then(b) : b(y);
310
310
  },
311
311
  setItem: (d, u) => {
312
312
  var h;
@@ -319,10 +319,10 @@ function zo(e = () => {
319
319
  var u;
320
320
  return (u = e()) == null ? void 0 : u.removeItem(d);
321
321
  }
322
- }, l = (d) => (u, h, m) => d(u, (w) => {
322
+ }, l = (d) => (u, h, m) => d(u, (b) => {
323
323
  let y;
324
324
  try {
325
- y = JSON.parse(w || "");
325
+ y = JSON.parse(b || "");
326
326
  } catch {
327
327
  y = m;
328
328
  }
@@ -409,7 +409,7 @@ const J = () => {
409
409
  Authorization: `Bearer ${s}`
410
410
  });
411
411
  if (d.status === 401)
412
- return console.log("401 Response", d), n.invalidateQueries({ queryKey: [H] }), t(), null;
412
+ return console.log("401 Response", d), n.invalidateQueries({ queryKey: [H] }), t(), window.location.reload(), null;
413
413
  if (!d.ok) {
414
414
  const u = await d.json();
415
415
  throw console.error(`API Error (${d.status}):`, u), {
@@ -489,10 +489,10 @@ const Wo = jt({}), Hr = () => nt(Wo), Qo = () => {
489
489
  de(() => {
490
490
  !Q(n.current) && t !== n.current && s({ id: n.current }), n.current = t;
491
491
  }, [t, s, n]);
492
- }, bt = (e, t) => {
492
+ }, wt = (e, t) => {
493
493
  const [n] = Hr();
494
494
  return Y(() => V(n, e, t), [n, e, t]);
495
- }, le = () => bt("apiUrl", "/chai/api"), Rs = () => bt("usersApiUrl", "/chai/users"), Qn = () => bt("assetsApiUrl", "/chai/assets"), Wr = () => bt("realtimeInstance", null), wt = (e) => {
495
+ }, le = () => wt("apiUrl", "/chai/api"), Rs = () => wt("usersApiUrl", "/chai/users"), Qn = () => wt("assetsApiUrl", "/chai/assets"), Wr = () => wt("realtimeInstance", null), bt = (e) => {
496
496
  const t = le(), [n] = ze(), s = e ?? n.get("page"), r = J();
497
497
  return Ge({
498
498
  queryKey: [H, I.GET_LANGUAGE_PAGES, s],
@@ -522,10 +522,10 @@ const Wo = jt({}), Hr = () => nt(Wo), Qo = () => {
522
522
  })
523
523
  });
524
524
  }, Qr = (e) => {
525
- const { fallbackLang: t } = qe(), { data: n } = At(), { data: s, isFetching: r } = wt(), i = Y(() => {
525
+ const { fallbackLang: t } = qe(), { data: n } = At(), { data: s, isFetching: r } = bt(), i = Y(() => {
526
526
  const l = { [t]: !0 };
527
527
  return cl(V(n, "languages"), (c) => {
528
- const d = be(s, { lang: c });
528
+ const d = we(s, { lang: c });
529
529
  l[c] = !!d;
530
530
  }), l;
531
531
  }, [t, s, n]);
@@ -568,10 +568,10 @@ const Xo = ({ query: e, uuid: t }) => {
568
568
  }), h = Y(() => n === "" ? d.filter((m) => m.lang === "" || m.lang === s) : d.filter((m) => m.lang === n), [n, s, d]);
569
569
  return { allLangPages: d, data: h, isFetching: u };
570
570
  }, Jr = () => {
571
- const { selectedLang: e, fallbackLang: t } = qe(), [n, s] = Yr(), [r, i] = A(""), l = Jo(r, 500), { allLangPages: c, data: d, isFetching: u } = Xo({ query: l }), h = ie((y) => s(y), [s]), m = ie((y) => i(y), [i]), w = ie(() => {
571
+ const { selectedLang: e, fallbackLang: t } = qe(), [n, s] = Yr(), [r, i] = A(""), l = Jo(r, 500), { allLangPages: c, data: d, isFetching: u } = Xo({ query: l }), h = ie((y) => s(y), [s]), m = ie((y) => i(y), [i]), b = ie(() => {
572
572
  if (!n) return;
573
- const y = !(n != null && n.primaryPage), g = e.length === 0, b = y ? n == null ? void 0 : n.id : n == null ? void 0 : n.primaryPage, N = c.filter(
574
- (S) => (S == null ? void 0 : S.primaryPage) === b || S.id === b
573
+ const y = !(n != null && n.primaryPage), g = e.length === 0, w = y ? n == null ? void 0 : n.id : n == null ? void 0 : n.primaryPage, N = c.filter(
574
+ (S) => (S == null ? void 0 : S.primaryPage) === w || S.id === w
575
575
  ).find((S) => g ? S.lang === e || S.lang === t : S.lang === e);
576
576
  s(N || n);
577
577
  }, [n, e, c, s, t]);
@@ -584,7 +584,7 @@ const Xo = ({ query: e, uuid: t }) => {
584
584
  allLangPages: c,
585
585
  updateDynamicPage: h,
586
586
  updateSearchQuery: m,
587
- onChangeLanguage: w
587
+ onChangeLanguage: b
588
588
  };
589
589
  }, Us = () => {
590
590
  const e = J(), t = le();
@@ -596,10 +596,10 @@ const Xo = ({ query: e, uuid: t }) => {
596
596
  });
597
597
  }, Zo = jt({ lastSaved: void 0 }), Bs = () => nt(Zo), Ue = () => {
598
598
  const [e] = ze(), t = e.get("page"), [n] = Xr(), { data: s, isFetching: r } = Us();
599
- return { data: Y(() => ({ ...be(s, { id: t }) || {}, metadata: n }), [s, t, n]), isFetching: r };
599
+ return { data: Y(() => ({ ...we(s, { id: t }) || {}, metadata: n }), [s, t, n]), isFetching: r };
600
600
  }, yn = () => {
601
- const [e] = ze(), t = e.get("lang") ?? "", { data: n, isFetching: s } = wt();
602
- return { data: Y(() => be(n, { lang: t }) || {}, [n, t]), isFetching: s };
601
+ const [e] = ze(), t = e.get("lang") ?? "", { data: n, isFetching: s } = bt();
602
+ return { data: Y(() => we(n, { lang: t }) || {}, [n, t]), isFetching: s };
603
603
  }, ec = jt({}), Xr = () => nt(ec), Zr = () => {
604
604
  const { data: e } = yn(), t = Sa(), n = e == null ? void 0 : e.slug, s = n ? window.location.origin + (n.endsWith("/") ? n.slice(0, -1) : n) : window.location.origin;
605
605
  return t ? s + t : s;
@@ -656,7 +656,7 @@ const Xo = ({ query: e, uuid: t }) => {
656
656
  });
657
657
  }));
658
658
  }, [e, s, n == null ? void 0 : n.id, i, r, d]), h = ie(async () => {
659
- !e || !s || !(n != null && n.id) || (l !== "SAVED" && (c(), await new Promise((w) => setTimeout(w, 1500))), e == null || e.acceptTakeOver(s, n == null ? void 0 : n.id), i({ status: "locked", requestedBy: "", isTakeOverRequested: !1 }));
659
+ !e || !s || !(n != null && n.id) || (l !== "SAVED" && (c(), await new Promise((b) => setTimeout(b, 1500))), e == null || e.acceptTakeOver(s, n == null ? void 0 : n.id), i({ status: "locked", requestedBy: "", isTakeOverRequested: !1 }));
660
660
  }, [s, e, n == null ? void 0 : n.id, i, c, l]), m = ie(() => {
661
661
  !e || !s || !(n != null && n.id) || (e == null || e.rejectTakeOver(s, n == null ? void 0 : n.id), i({ status: "editing", requestedBy: "", isTakeOverRequested: !1 }));
662
662
  }, [s, e, n == null ? void 0 : n.id, i]);
@@ -685,7 +685,7 @@ const Xo = ({ query: e, uuid: t }) => {
685
685
  data: { id: t, draft: !0 }
686
686
  });
687
687
  r(d.currentEditor);
688
- const u = d.blocks ?? [], h = be(u, { _type: "@chai/ai-context" });
688
+ const u = d.blocks ?? [], h = we(u, { _type: "@chai/ai-context" });
689
689
  return s(V(h, "_value", "") || ""), i((m) => ({ ...m, lastSaved: d.lastSaved })), l(V(d, "metadata", {})), u;
690
690
  },
691
691
  enabled: !!t
@@ -721,7 +721,7 @@ const Xo = ({ query: e, uuid: t }) => {
721
721
  }, sc = ({ currentEditor: e }) => {
722
722
  const { user: t } = it(), { data: n } = $t(e);
723
723
  return !n || !e || e === (t == null ? void 0 : t.id) ? null : /* @__PURE__ */ a("span", { className: "ml-2 flex items-center gap-1 text-xs font-light text-gray-500", children: /* @__PURE__ */ o(ct, { children: [
724
- /* @__PURE__ */ a(dt, { children: /* @__PURE__ */ a(ba, { className: "h-3 w-3" }) }),
724
+ /* @__PURE__ */ a(dt, { children: /* @__PURE__ */ a(wa, { className: "h-3 w-3" }) }),
725
725
  /* @__PURE__ */ a(ut, { children: /* @__PURE__ */ o("p", { children: [
726
726
  n.name,
727
727
  " is editing"
@@ -745,7 +745,7 @@ function ac({
745
745
  };
746
746
  return /* @__PURE__ */ a("div", { className: "fixed bottom-0 left-0 right-0 top-[50px] z-[20] flex w-screen items-center justify-center bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ o(As, { className: "mx-auto w-full max-w-md", children: [
747
747
  /* @__PURE__ */ a(Ts, { className: "space-y-1", children: /* @__PURE__ */ o(Cs, { className: "flex items-center gap-2 text-2xl", children: [
748
- /* @__PURE__ */ a(ba, { className: "h-6 w-6 text-yellow-500" }),
748
+ /* @__PURE__ */ a(wa, { className: "h-6 w-6 text-yellow-500" }),
749
749
  "Page locked for editing"
750
750
  ] }) }),
751
751
  /* @__PURE__ */ a(Ps, { className: "grid gap-4", children: /* @__PURE__ */ o("div", { children: [
@@ -779,8 +779,8 @@ function ac({
779
779
  /* @__PURE__ */ a(C, { className: "w-full", variant: "destructive", children: "Take over" }),
780
780
  /* @__PURE__ */ a("p", { className: "mt-2 text-xs text-muted-foreground", children: "If you need to edit, you can take over the lock, but be aware that the other user might lose unsaved changes." })
781
781
  ] }) }),
782
- /* @__PURE__ */ o(br, { className: "z-[99]", children: [
783
- /* @__PURE__ */ o(wr, { children: [
782
+ /* @__PURE__ */ o(wr, { className: "z-[99]", children: [
783
+ /* @__PURE__ */ o(br, { children: [
784
784
  /* @__PURE__ */ a(Nr, { children: "Are you sure you want to take over?" }),
785
785
  /* @__PURE__ */ o(xr, { children: [
786
786
  /* @__PURE__ */ o("span", { className: "flex items-center space-x-2 text-yellow-500", children: [
@@ -847,7 +847,7 @@ const rc = () => {
847
847
  const l = V(He, n);
848
848
  return /* @__PURE__ */ a("div", { className: "fixed bottom-0 left-0 right-0 top-12 z-[20] flex w-screen items-center justify-center bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ o(As, { className: "mx-auto w-full max-w-md", children: [
849
849
  /* @__PURE__ */ a(Ts, { className: "space-y-1", children: /* @__PURE__ */ o(Cs, { className: "flex items-center gap-2 text-2xl", children: [
850
- /* @__PURE__ */ a(ba, { className: "h-6 w-6 text-yellow-500" }),
850
+ /* @__PURE__ */ a(wa, { className: "h-6 w-6 text-yellow-500" }),
851
851
  'Page missing for "',
852
852
  l,
853
853
  '" language.'
@@ -925,14 +925,14 @@ const rc = () => {
925
925
  const [l, c] = A(!1), d = pr(), u = dc(() => {
926
926
  d([e], { _libBlockId: void 0 }), K.success("Block deleted successfully"), c(!1), s();
927
927
  });
928
- return /* @__PURE__ */ o(on, { open: n, onOpenChange: (w) => !w && s(), children: [
928
+ return /* @__PURE__ */ o(on, { open: n, onOpenChange: (b) => !b && s(), children: [
929
929
  /* @__PURE__ */ a(cn, { asChild: !0, children: i || /* @__PURE__ */ o(
930
930
  C,
931
931
  {
932
932
  type: "button",
933
933
  variant: "destructive",
934
934
  size: "sm",
935
- onClick: (w) => w.preventDefault(),
935
+ onClick: (b) => b.preventDefault(),
936
936
  disabled: l,
937
937
  children: [
938
938
  /* @__PURE__ */ a(Ls, { className: "h-4 w-4 mr-2" }),
@@ -1108,12 +1108,12 @@ const rc = () => {
1108
1108
  const y = r.trim();
1109
1109
  if (!y) return;
1110
1110
  const g = { id: y, name: y };
1111
- u((b) => [...b, g]), t(g.id), i(""), s(!1);
1111
+ u((w) => [...w, g]), t(g.id), i(""), s(!1);
1112
1112
  };
1113
1113
  de(() => {
1114
1114
  n && l.current && l.current.focus();
1115
1115
  }, [n]);
1116
- const w = (y) => {
1116
+ const b = (y) => {
1117
1117
  y.key === "Enter" && (y.preventDefault(), m());
1118
1118
  };
1119
1119
  return de(() => {
@@ -1126,7 +1126,7 @@ const rc = () => {
1126
1126
  placeholder: "Enter new group name",
1127
1127
  value: r,
1128
1128
  onChange: (y) => i(y.target.value),
1129
- onKeyDown: w
1129
+ onKeyDown: b
1130
1130
  }
1131
1131
  ),
1132
1132
  /* @__PURE__ */ o("div", { className: "flex justify-end gap-2", children: [
@@ -1166,7 +1166,7 @@ const rc = () => {
1166
1166
  size: "icon",
1167
1167
  variant: "outline",
1168
1168
  onClick: () => s(!0),
1169
- children: /* @__PURE__ */ a(wa, { className: "h-4 w-4" })
1169
+ children: /* @__PURE__ */ a(ba, { className: "h-4 w-4" })
1170
1170
  }
1171
1171
  )
1172
1172
  ] });
@@ -1300,7 +1300,7 @@ const rc = () => {
1300
1300
  } else
1301
1301
  T.push(L);
1302
1302
  return T;
1303
- }, [t, r]), [h, m] = A(""), [w, y] = A(""), [g, b] = A(""), [p, N] = A(""), [S, O] = A({}), [x, _] = A(!1), [G, W] = A(c), [F, te] = A(!1), { hasPermission: j } = mn(), q = j(Te.DELETE_LIBRARY_BLOCK), ee = pr(), z = () => {
1303
+ }, [t, r]), [h, m] = A(""), [b, y] = A(""), [g, w] = A(""), [p, N] = A(""), [S, O] = A({}), [x, _] = A(!1), [G, W] = A(c), [F, te] = A(!1), { hasPermission: j } = mn(), q = j(Te.DELETE_LIBRARY_BLOCK), ee = pr(), z = () => {
1304
1304
  ee([s], { _libBlockId: void 0 }), K.success("Block delinked from library"), n();
1305
1305
  }, {
1306
1306
  data: X,
@@ -1310,14 +1310,14 @@ const rc = () => {
1310
1310
  de(() => {
1311
1311
  B && c && (te(!0), W(!1));
1312
1312
  }, [B, c]), de(() => {
1313
- X && !P && (m(X.name || ""), y(X.group || ""), b(X.description || ""), N(X.preview || ""), W(!1));
1313
+ X && !P && (m(X.name || ""), y(X.group || ""), w(X.description || ""), N(X.preview || ""), W(!1));
1314
1314
  }, [X, P]), de(() => {
1315
- const T = h.trim().length >= 2, L = w.trim() !== "";
1315
+ const T = h.trim().length >= 2, L = b.trim() !== "";
1316
1316
  _(T && L);
1317
- }, [h, w]);
1317
+ }, [h, b]);
1318
1318
  const pe = () => {
1319
1319
  const T = {};
1320
- return h.trim() ? h.length < 2 && (T.name = "Name must be at least 2 characters") : T.name = "Name is required", w || (T.group = "Group is required"), O(T), Object.keys(T).length === 0;
1320
+ return h.trim() ? h.length < 2 && (T.name = "Name must be at least 2 characters") : T.name = "Name is required", b || (T.group = "Group is required"), O(T), Object.keys(T).length === 0;
1321
1321
  }, { resetLibrary: Se } = _l({ id: "" }), me = oc(
1322
1322
  (T) => {
1323
1323
  c || ee([s], { _libBlockId: T.id }), K.success(`Block ${c ? "updated" : "saved"} successfully`), Se(T.library), n();
@@ -1327,7 +1327,7 @@ const rc = () => {
1327
1327
  const L = u.map((R) => (Le(R, "_libBlockId") && delete R._libBlockId, R));
1328
1328
  me.mutate({
1329
1329
  name: h.trim(),
1330
- group: w,
1330
+ group: b,
1331
1331
  blocks: L,
1332
1332
  description: g.trim(),
1333
1333
  // Only include previewImage if it exists and is a base64 image
@@ -1382,7 +1382,7 @@ const rc = () => {
1382
1382
  children: "Group"
1383
1383
  }
1384
1384
  ),
1385
- /* @__PURE__ */ a(fc, { value: w, onChange: y }),
1385
+ /* @__PURE__ */ a(fc, { value: b, onChange: y }),
1386
1386
  S.group && /* @__PURE__ */ a("p", { className: "text-xs text-destructive", children: S.group })
1387
1387
  ] }),
1388
1388
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
@@ -1394,7 +1394,7 @@ const rc = () => {
1394
1394
  placeholder: "Enter a brief description",
1395
1395
  className: "resize-none",
1396
1396
  value: g,
1397
- onChange: (T) => b(T.target.value)
1397
+ onChange: (T) => w(T.target.value)
1398
1398
  }
1399
1399
  )
1400
1400
  ] }),
@@ -1491,7 +1491,7 @@ const rc = () => {
1491
1491
  () => t == null ? void 0 : t.find((n) => n.key === e),
1492
1492
  [t, e]
1493
1493
  );
1494
- }, bc = () => {
1494
+ }, wc = () => {
1495
1495
  const e = le(), t = J();
1496
1496
  return _e({
1497
1497
  mutationFn: async ({ pageType: n, query: s }) => {
@@ -1526,11 +1526,11 @@ const rc = () => {
1526
1526
  }) : t.invalidateQueries({
1527
1527
  queryKey: [H, I.GET_WEBSITE_PAGES]
1528
1528
  });
1529
- const l = i.template ? `Page created from "${i.template.name}" template` : i.hasSlug === !1 ? "New " + ((c = be(s, { key: i.pageType })) == null ? void 0 : c.name) + " added successfully" : "New page added successfully";
1529
+ const l = i.template ? `Page created from "${i.template.name}" template` : i.hasSlug === !1 ? "New " + ((c = we(s, { key: i.pageType })) == null ? void 0 : c.name) + " added successfully" : "New page added successfully";
1530
1530
  K.success(l);
1531
1531
  },
1532
1532
  onError: (r, i) => {
1533
- const l = be(s, { key: i.pageType });
1533
+ const l = we(s, { key: i.pageType });
1534
1534
  K.error(
1535
1535
  `Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`,
1536
1536
  {
@@ -1558,7 +1558,7 @@ const rc = () => {
1558
1558
  });
1559
1559
  },
1560
1560
  onError: (r, i) => {
1561
- const l = be(s, { key: i.pageType });
1561
+ const l = we(s, { key: i.pageType });
1562
1562
  K.error(
1563
1563
  `Failed to update ${l != null && l.hasSlug ? "page" : l.name}.`,
1564
1564
  {
@@ -1567,7 +1567,7 @@ const rc = () => {
1567
1567
  );
1568
1568
  }
1569
1569
  });
1570
- }, wc = () => {
1570
+ }, bc = () => {
1571
1571
  const e = le(), t = ke(), n = J(), { data: s } = Fe();
1572
1572
  return _e({
1573
1573
  mutationFn: async (r) => n(e, {
@@ -1592,7 +1592,7 @@ const rc = () => {
1592
1592
  });
1593
1593
  },
1594
1594
  onError: (r, i) => {
1595
- const l = be(s, { key: i.pageType });
1595
+ const l = we(s, { key: i.pageType });
1596
1596
  K.error(
1597
1597
  `Failed to delete ${l != null && l.hasSlug ? "page" : l.name}.`,
1598
1598
  {
@@ -1618,13 +1618,13 @@ const rc = () => {
1618
1618
  }) : t.invalidateQueries({
1619
1619
  queryKey: [H, I.GET_WEBSITE_PAGES]
1620
1620
  });
1621
- const l = be(s, { key: i.pageType });
1621
+ const l = we(s, { key: i.pageType });
1622
1622
  K.success(
1623
1623
  l != null && l.hasSlug ? re.PAGE_UNPUBLISH_SUCCESS : "New " + l.name + " added successfully."
1624
1624
  );
1625
1625
  },
1626
1626
  onError: (r, i) => {
1627
- const l = be(s, { key: i.pageType });
1627
+ const l = we(s, { key: i.pageType });
1628
1628
  K.error(
1629
1629
  `Failed to take offline ${l != null && l.hasSlug ? "page" : l.name}.`,
1630
1630
  {
@@ -1762,7 +1762,7 @@ var Pa = {};
1762
1762
  }, T = function($) {
1763
1763
  return clearTimeout($);
1764
1764
  }), { frame: f, cancel: T };
1765
- }(), w = /* @__PURE__ */ function() {
1765
+ }(), b = /* @__PURE__ */ function() {
1766
1766
  var v, f, T = {};
1767
1767
  function L(R) {
1768
1768
  function $(k, U) {
@@ -1852,12 +1852,12 @@ var Pa = {};
1852
1852
  function g(v, f) {
1853
1853
  return f ? f(v) : v;
1854
1854
  }
1855
- function b(v) {
1855
+ function w(v) {
1856
1856
  return v != null;
1857
1857
  }
1858
1858
  function p(v, f, T) {
1859
1859
  return g(
1860
- v && b(v[f]) ? v[f] : y[f],
1860
+ v && w(v[f]) ? v[f] : y[f],
1861
1861
  T
1862
1862
  );
1863
1863
  }
@@ -1989,9 +1989,9 @@ var Pa = {};
1989
1989
  };
1990
1990
  }
1991
1991
  function X(v, f) {
1992
- var T = !v, L = !!p(f || {}, "resize"), R = !1, $ = p(f, "disableForReducedMotion", Boolean), k = i && !!p(f || {}, "useWorker"), U = k ? w() : null, ne = T ? W : F, ue = v && U ? !!v.__confetti_initialized : !1, Ce = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, he;
1992
+ var T = !v, L = !!p(f || {}, "resize"), R = !1, $ = p(f, "disableForReducedMotion", Boolean), k = i && !!p(f || {}, "useWorker"), U = k ? b() : null, ne = T ? W : F, ue = v && U ? !!v.__confetti_initialized : !1, Ce = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, he;
1993
1993
  function Ae(se, Re, Ve) {
1994
- for (var D = p(se, "particleCount", N), ce = p(se, "angle", Number), De = p(se, "spread", Number), st = p(se, "startVelocity", Number), qs = p(se, "decay", Number), zs = p(se, "gravity", Number), Vs = p(se, "drift", Number), bn = p(se, "colors", x), wn = p(se, "ticks", Number), Tt = p(se, "shapes"), Jn = p(se, "scalar"), Xn = !!p(se, "flat"), E = G(se), fe = D, Ke = [], je = v.width * E.x, We = v.height * E.y; fe--; )
1994
+ for (var D = p(se, "particleCount", N), ce = p(se, "angle", Number), De = p(se, "spread", Number), st = p(se, "startVelocity", Number), qs = p(se, "decay", Number), zs = p(se, "gravity", Number), Vs = p(se, "drift", Number), wn = p(se, "colors", x), bn = p(se, "ticks", Number), Tt = p(se, "shapes"), Jn = p(se, "scalar"), Xn = !!p(se, "flat"), E = G(se), fe = D, Ke = [], je = v.width * E.x, We = v.height * E.y; fe--; )
1995
1995
  Ke.push(
1996
1996
  q({
1997
1997
  x: je,
@@ -1999,9 +1999,9 @@ var Pa = {};
1999
1999
  angle: ce,
2000
2000
  spread: De,
2001
2001
  startVelocity: st,
2002
- color: bn[fe % bn.length],
2002
+ color: wn[fe % wn.length],
2003
2003
  shape: Tt[S(0, Tt.length)],
2004
- ticks: wn,
2004
+ ticks: bn,
2005
2005
  decay: qs,
2006
2006
  gravity: zs,
2007
2007
  drift: Vs,
@@ -2203,7 +2203,7 @@ function kc({
2203
2203
  y.setSelectionRange(g, g);
2204
2204
  }, 0);
2205
2205
  }
2206
- }, w = (y) => {
2206
+ }, b = (y) => {
2207
2207
  const g = y.currentTarget;
2208
2208
  (g.selectionStart || 0) <= s.length && setTimeout(() => {
2209
2209
  const p = s.length;
@@ -2222,7 +2222,7 @@ function kc({
2222
2222
  value: d,
2223
2223
  onChange: h,
2224
2224
  onFocus: m,
2225
- onClick: w,
2225
+ onClick: b,
2226
2226
  placeholder: n,
2227
2227
  className: i ? "border-red-500" : ""
2228
2228
  }
@@ -2268,7 +2268,7 @@ function Ic({
2268
2268
  return h.filter(
2269
2269
  (N) => N.name.toLowerCase().includes(p) || N.slug.toLowerCase().includes(p)
2270
2270
  );
2271
- }, [h, c]), w = (p) => Math.max(0, (p.match(/\//g) || []).length - 1), y = (p) => "    ".repeat(p), g = (p) => {
2271
+ }, [h, c]), b = (p) => Math.max(0, (p.match(/\//g) || []).length - 1), y = (p) => "    ".repeat(p), g = (p) => {
2272
2272
  if (p === "/") return "/";
2273
2273
  const N = p.split("/").filter(Boolean);
2274
2274
  if (N.length <= 1) {
@@ -2276,7 +2276,7 @@ function Ic({
2276
2276
  return `/${yt(S)}`;
2277
2277
  }
2278
2278
  return `/${yt(N[N.length - 1])}`;
2279
- }, b = () => {
2279
+ }, w = () => {
2280
2280
  if (!t || t === "none") return "None";
2281
2281
  const p = h.find((N) => N.id === t);
2282
2282
  return p ? `${p.name} (${g(p.slug)})` : "None";
@@ -2293,7 +2293,7 @@ function Ic({
2293
2293
  className: Ys("w-full justify-between", s),
2294
2294
  "data-testid": "parent-page-selector",
2295
2295
  children: [
2296
- b(),
2296
+ w(),
2297
2297
  /* @__PURE__ */ a(Bt, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
2298
2298
  ]
2299
2299
  }
@@ -2329,7 +2329,7 @@ function Ic({
2329
2329
  }
2330
2330
  ),
2331
2331
  m.map((p) => {
2332
- const N = y(w(p.slug)), S = g(p.slug), O = /* @__PURE__ */ o("span", { className: "flex items-center text-sm", children: [
2332
+ const N = y(b(p.slug)), S = g(p.slug), O = /* @__PURE__ */ o("span", { className: "flex items-center text-sm", children: [
2333
2333
  N,
2334
2334
  p.name,
2335
2335
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
@@ -2376,7 +2376,7 @@ function Ic({
2376
2376
  children: [
2377
2377
  /* @__PURE__ */ a("option", { value: "none", children: "None" }),
2378
2378
  h.map((p) => {
2379
- const N = w(p.slug), S = N > 0 ? y(N) : "", O = g(p.slug);
2379
+ const N = b(p.slug), S = N > 0 ? y(N) : "", O = g(p.slug);
2380
2380
  return /* @__PURE__ */ o("option", { value: p.id, children: [
2381
2381
  S,
2382
2382
  p.name,
@@ -2403,9 +2403,9 @@ function ka({
2403
2403
  de(() => {
2404
2404
  d(e);
2405
2405
  }, [e]);
2406
- const m = (w) => {
2407
- const g = w.target.value.replace(/\//g, "").replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-_.]/g, "-").replace(/-+/g, "-").replace(/^-+/, "").toLowerCase(), b = (g.match(/\./g) || []).length, p = b <= 1;
2408
- b > 1 ? h("Invalid slug. Only one dot (.) is allowed in the slug") : h(null), r && r(p), d(g), t(g);
2406
+ const m = (b) => {
2407
+ const g = b.target.value.replace(/\//g, "").replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-_.]/g, "-").replace(/-+/g, "-").replace(/^-+/, "").toLowerCase(), w = (g.match(/\./g) || []).length, p = w <= 1;
2408
+ w > 1 ? h("Invalid slug. Only one dot (.) is allowed in the slug") : h(null), r && r(p), d(g), t(g);
2409
2409
  };
2410
2410
  return /* @__PURE__ */ o("div", { children: [
2411
2411
  s && /* @__PURE__ */ a("div", { className: "flex items-center mb-1", children: /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
@@ -2442,8 +2442,8 @@ const Dc = (...e) => e.filter(Boolean).join(" "), Oc = ({
2442
2442
  const [r, i] = A(""), [l, c] = A(!1), [d, u] = A(""), h = vt("enable-add-page-dropdown");
2443
2443
  if (de(() => {
2444
2444
  if (t) {
2445
- const b = e.find((p) => p.id === t);
2446
- i((b == null ? void 0 : b.preview) || "");
2445
+ const w = e.find((p) => p.id === t);
2446
+ i((w == null ? void 0 : w.preview) || "");
2447
2447
  } else
2448
2448
  i("");
2449
2449
  }, [t, e]), s)
@@ -2451,19 +2451,19 @@ const Dc = (...e) => e.filter(Boolean).join(" "), Oc = ({
2451
2451
  if (e.length === 0)
2452
2452
  return null;
2453
2453
  const m = {};
2454
- e.forEach((b) => {
2455
- const p = b.libraryName;
2456
- m[p] || (m[p] = []), m[p].push(b);
2454
+ e.forEach((w) => {
2455
+ const p = w.libraryName;
2456
+ m[p] || (m[p] = []), m[p].push(w);
2457
2457
  });
2458
- const w = Object.entries(m).reduce(
2459
- (b, [p, N]) => {
2458
+ const b = Object.entries(m).reduce(
2459
+ (w, [p, N]) => {
2460
2460
  const S = N.filter(
2461
2461
  (O) => O.name.toLowerCase().includes(d.toLowerCase()) || p.toLowerCase().includes(d.toLowerCase())
2462
2462
  );
2463
- return S.length > 0 && (b[p] = S), b;
2463
+ return S.length > 0 && (w[p] = S), w;
2464
2464
  },
2465
2465
  {}
2466
- ), y = e.find((b) => b.id === t), g = y ? Gt(y.name) : "No Template";
2466
+ ), y = e.find((w) => w.id === t), g = y ? Gt(y.name) : "No Template";
2467
2467
  return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
2468
2468
  h ? /* @__PURE__ */ o(on, { open: l, onOpenChange: c, children: [
2469
2469
  /* @__PURE__ */ a(cn, { asChild: !0, children: /* @__PURE__ */ o(C, { variant: "outline", role: "combobox", className: "w-full justify-between", children: [
@@ -2479,13 +2479,13 @@ const Dc = (...e) => e.filter(Boolean).join(" "), Oc = ({
2479
2479
  placeholder: "Search templates...",
2480
2480
  className: "h-8 pl-8 text-xs",
2481
2481
  value: d,
2482
- onChange: (b) => u(b.target.value)
2482
+ onChange: (w) => u(w.target.value)
2483
2483
  }
2484
2484
  )
2485
2485
  ] }) }),
2486
2486
  /* @__PURE__ */ o(ms, { className: "max-h-[300px] overflow-y-auto", children: [
2487
2487
  /* @__PURE__ */ a(Cn, { children: "No templates found." }),
2488
- Object.entries(w).map(([b, p]) => /* @__PURE__ */ a(xt, { heading: b, children: p.map((N) => /* @__PURE__ */ o(
2488
+ Object.entries(b).map(([w, p]) => /* @__PURE__ */ a(xt, { heading: w, children: p.map((N) => /* @__PURE__ */ o(
2489
2489
  ot,
2490
2490
  {
2491
2491
  value: N.id,
@@ -2507,7 +2507,7 @@ const Dc = (...e) => e.filter(Boolean).join(" "), Oc = ({
2507
2507
  ]
2508
2508
  },
2509
2509
  N.id
2510
- )) }, b))
2510
+ )) }, w))
2511
2511
  ] })
2512
2512
  ] }) })
2513
2513
  ] }) : /* @__PURE__ */ o(
@@ -2515,10 +2515,10 @@ const Dc = (...e) => e.filter(Boolean).join(" "), Oc = ({
2515
2515
  {
2516
2516
  className: "w-full rounded-md border border-gray-300 px-3 py-2",
2517
2517
  value: t,
2518
- onChange: (b) => n(b.target.value),
2518
+ onChange: (w) => n(w.target.value),
2519
2519
  children: [
2520
2520
  /* @__PURE__ */ a("option", { value: "", children: "No Template" }),
2521
- Object.entries(m).map(([b, p]) => /* @__PURE__ */ a("optgroup", { label: b, children: p.map((N) => /* @__PURE__ */ a("option", { value: N.id, children: Gt(N.name) }, N.id)) }, b))
2521
+ Object.entries(m).map(([w, p]) => /* @__PURE__ */ a("optgroup", { label: w, children: p.map((N) => /* @__PURE__ */ a("option", { value: N.id, children: Gt(N.name) }, N.id)) }, w))
2522
2522
  ]
2523
2523
  }
2524
2524
  ),
@@ -2548,7 +2548,7 @@ const Dc = (...e) => e.filter(Boolean).join(" "), Oc = ({
2548
2548
  });
2549
2549
  }, Uc = (e) => {
2550
2550
  const { data: t = [], isLoading: n } = Rc(e), { data: s = [], isLoading: r } = Gc(), i = Y(() => n || r ? [] : t.map((c) => {
2551
- const d = be(s, { id: c.library });
2551
+ const d = we(s, { id: c.library });
2552
2552
  return {
2553
2553
  ...c,
2554
2554
  libraryName: (d == null ? void 0 : d.type) !== "shared" ? "Site Library" : (d == null ? void 0 : d.name) + " Library",
@@ -2627,11 +2627,11 @@ if (import.meta.vitest) {
2627
2627
  const Ct = (...e) => e.filter(Boolean).join(" ");
2628
2628
  function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel: s }) {
2629
2629
  var Jn, Xn;
2630
- const r = _a(), i = !!(e != null && e.id), { data: l } = Us(), { mutate: c, isPending: d } = ri(), { mutate: u, isPending: h } = Ta(), [m, w] = A(null), [y, g] = A(!0), [b, p] = A((e == null ? void 0 : e.pageType) ?? "page"), { hasPermission: N } = mn(), S = N(Te.CHANGE_PAGE_TYPE), [O, x] = A(!1), [_, G] = A(""), { selectedLang: W, fallbackLang: F } = qe(), te = W || F, [j, q] = A(""), [ee, z] = A(!1), X = Y(() => {
2631
- const E = t.find((fe) => fe.key === b);
2630
+ const r = _a(), i = !!(e != null && e.id), { data: l } = Us(), { mutate: c, isPending: d } = ri(), { mutate: u, isPending: h } = Ta(), [m, b] = A(null), [y, g] = A(!0), [w, p] = A((e == null ? void 0 : e.pageType) ?? "page"), { hasPermission: N } = mn(), S = N(Te.CHANGE_PAGE_TYPE), [O, x] = A(!1), [_, G] = A(""), { selectedLang: W, fallbackLang: F } = qe(), te = W || F, [j, q] = A(""), [ee, z] = A(!1), X = Y(() => {
2631
+ const E = t.find((fe) => fe.key === w);
2632
2632
  return (E == null ? void 0 : E.hasSlug) === !1;
2633
- }, [b, t]), [P, B] = A((e == null ? void 0 : e.parent) ?? ""), [pe, Se] = A((e == null ? void 0 : e.name) ?? ""), [me, v] = A((e == null ? void 0 : e.dynamic) ?? !1), [f, T] = A(me ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""), [L, R] = A((e == null ? void 0 : e.dynamicSlugCustom) ?? ""), [$, k] = A(!0), [U, ne] = A(""), { data: ue, isLoading: Ce } = Uc(b), he = d || h, Ae = vt("enable-add-page-dropdown"), M = t.find((E) => E.key === b), se = (E) => {
2634
- if (i && b !== E) {
2633
+ }, [w, t]), [P, B] = A((e == null ? void 0 : e.parent) ?? ""), [pe, Se] = A((e == null ? void 0 : e.name) ?? ""), [me, v] = A((e == null ? void 0 : e.dynamic) ?? !1), [f, T] = A(me ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""), [L, R] = A((e == null ? void 0 : e.dynamicSlugCustom) ?? ""), [$, k] = A(!0), [U, ne] = A(""), { data: ue, isLoading: Ce } = Uc(w), he = d || h, Ae = vt("enable-add-page-dropdown"), M = t.find((E) => E.key === w), se = (E) => {
2634
+ if (i && w !== E) {
2635
2635
  G(E), x(!0), q(""), z(!1);
2636
2636
  return;
2637
2637
  }
@@ -2652,7 +2652,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2652
2652
  T(f ? `${f}` : "");
2653
2653
  }, ce = (E) => {
2654
2654
  ne(E);
2655
- }, De = () => pe.trim() ? me && !Q(f) ? (w("Slug must be empty when using dynamic slug"), !1) : me && !$ ? (w("Dynamic slug is invalid"), !1) : !0 : (K.error("Name is required"), !1), st = () => {
2655
+ }, De = () => pe.trim() ? me && !Q(f) ? (b("Slug must be empty when using dynamic slug"), !1) : me && !$ ? (b("Dynamic slug is invalid"), !1) : !0 : (K.error("Name is required"), !1), st = () => {
2656
2656
  const E = {
2657
2657
  pageType: M == null ? void 0 : M.key,
2658
2658
  name: pe,
@@ -2673,12 +2673,12 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2673
2673
  });
2674
2674
  }, qs = (E, fe) => {
2675
2675
  if (!E.trim() && !me)
2676
- return w("Child page slug is required"), !1;
2676
+ return b("Child page slug is required"), !1;
2677
2677
  const Ke = yt(fe), je = za(Ke, E);
2678
- return Object.keys(He).some((Zn) => je === `/${Zn}` || (je == null ? void 0 : je.startsWith(`/${Zn}/`))) ? (w("Slugs cannot start with a language code for primary page"), !1) : !0;
2678
+ return Object.keys(He).some((Zn) => je === `/${Zn}` || (je == null ? void 0 : je.startsWith(`/${Zn}/`))) ? (b("Slugs cannot start with a language code for primary page"), !1) : !0;
2679
2679
  }, zs = (E, fe) => {
2680
2680
  const Ke = yt(fe), je = za(Ke, E), We = {
2681
- pageType: b,
2681
+ pageType: w,
2682
2682
  name: pe,
2683
2683
  slug: je.replace(/\/$/, ""),
2684
2684
  // remove trailing slashes
@@ -2700,7 +2700,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2700
2700
  }
2701
2701
  );
2702
2702
  else {
2703
- const ft = be(t, { key: b });
2703
+ const ft = we(t, { key: w });
2704
2704
  ft != null && ft.trackingDefault && (We.tracking = ft.trackingDefault);
2705
2705
  const { seo: Zn, jsonLD: sl } = _n(ft, te);
2706
2706
  kt(We, "seo", Zn), kt(We, "jsonLD", sl), c(We, {
@@ -2711,7 +2711,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2711
2711
  }
2712
2712
  }, Vs = () => {
2713
2713
  const E = {
2714
- pageType: b,
2714
+ pageType: w,
2715
2715
  name: pe,
2716
2716
  slug: f === "" ? "/" : `/${f.replace(/\/$/, "")}`,
2717
2717
  template: U || void 0,
@@ -2728,7 +2728,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2728
2728
  }
2729
2729
  );
2730
2730
  else {
2731
- const fe = be(t, { key: b });
2731
+ const fe = we(t, { key: w });
2732
2732
  fe != null && fe.trackingDefault && (E.tracking = fe.trackingDefault);
2733
2733
  const { seo: Ke, jsonLD: je } = _n(fe, te);
2734
2734
  kt(E, "seo", Ke), kt(E, "jsonLD", je), c(E, {
@@ -2738,8 +2738,8 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2738
2738
  }
2739
2739
  });
2740
2740
  }
2741
- }, bn = (E) => {
2742
- if (E.preventDefault(), w(null), !!De()) {
2741
+ }, wn = (E) => {
2742
+ if (E.preventDefault(), b(null), !!De()) {
2743
2743
  if (!(M != null && M.hasSlug)) {
2744
2744
  st();
2745
2745
  return;
@@ -2752,14 +2752,14 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2752
2752
  } else
2753
2753
  Vs();
2754
2754
  }
2755
- }, { pagesType: wn, partialsType: Tt } = Y(() => {
2755
+ }, { pagesType: bn, partialsType: Tt } = Y(() => {
2756
2756
  const E = (fe) => j ? fe.name.toLowerCase().includes(j.toLowerCase()) || fe.key.toLowerCase().includes(j.toLowerCase()) : !0;
2757
2757
  return {
2758
2758
  pagesType: t.filter((fe) => fe.hasSlug !== !1 && E(fe)),
2759
2759
  partialsType: t.filter((fe) => fe.hasSlug === !1 && E(fe))
2760
2760
  };
2761
2761
  }, [t, j]);
2762
- return M != null && M.hasSlug ? /* @__PURE__ */ o("form", { onSubmit: bn, className: "mx-auto w-full max-w-md space-y-4", children: [
2762
+ return M != null && M.hasSlug ? /* @__PURE__ */ o("form", { onSubmit: wn, className: "mx-auto w-full max-w-md space-y-4", children: [
2763
2763
  /* @__PURE__ */ o("div", { className: "space-y-0.5", children: [
2764
2764
  /* @__PURE__ */ a(oe, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
2765
2765
  Ae ? /* @__PURE__ */ o(on, { open: ee, onOpenChange: z, children: [
@@ -2805,13 +2805,13 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2805
2805
  /* @__PURE__ */ a(
2806
2806
  gt,
2807
2807
  {
2808
- className: Ct("mr-2 h-4 w-4", b === E.key ? "opacity-100" : "opacity-0")
2808
+ className: Ct("mr-2 h-4 w-4", w === E.key ? "opacity-100" : "opacity-0")
2809
2809
  }
2810
2810
  )
2811
2811
  ]
2812
2812
  },
2813
2813
  E.key
2814
- )) }) : /* @__PURE__ */ a(xt, { heading: "Pages", children: wn.map((E) => /* @__PURE__ */ o(
2814
+ )) }) : /* @__PURE__ */ a(xt, { heading: "Pages", children: bn.map((E) => /* @__PURE__ */ o(
2815
2815
  ot,
2816
2816
  {
2817
2817
  value: E.key,
@@ -2822,14 +2822,14 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2822
2822
  /* @__PURE__ */ a(
2823
2823
  gt,
2824
2824
  {
2825
- className: Ct("mr-2 h-4 w-4", b === E.key ? "opacity-100" : "opacity-0")
2825
+ className: Ct("mr-2 h-4 w-4", w === E.key ? "opacity-100" : "opacity-0")
2826
2826
  }
2827
2827
  )
2828
2828
  ]
2829
2829
  },
2830
2830
  E.key
2831
2831
  )) }) : /* @__PURE__ */ o(ve, { children: [
2832
- wn.length > 0 && /* @__PURE__ */ a(xt, { heading: "Pages", children: wn.map((E) => /* @__PURE__ */ o(
2832
+ bn.length > 0 && /* @__PURE__ */ a(xt, { heading: "Pages", children: bn.map((E) => /* @__PURE__ */ o(
2833
2833
  ot,
2834
2834
  {
2835
2835
  value: E.key,
@@ -2840,7 +2840,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2840
2840
  /* @__PURE__ */ a(
2841
2841
  gt,
2842
2842
  {
2843
- className: Ct("mr-2 h-4 w-4", b === E.key ? "opacity-100" : "opacity-0")
2843
+ className: Ct("mr-2 h-4 w-4", w === E.key ? "opacity-100" : "opacity-0")
2844
2844
  }
2845
2845
  )
2846
2846
  ]
@@ -2858,7 +2858,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2858
2858
  /* @__PURE__ */ a(
2859
2859
  gt,
2860
2860
  {
2861
- className: Ct("mr-2 h-4 w-4", b === E.key ? "opacity-100" : "opacity-0")
2861
+ className: Ct("mr-2 h-4 w-4", w === E.key ? "opacity-100" : "opacity-0")
2862
2862
  }
2863
2863
  )
2864
2864
  ]
@@ -2872,7 +2872,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2872
2872
  "select",
2873
2873
  {
2874
2874
  id: "pageType",
2875
- value: b,
2875
+ value: w,
2876
2876
  disabled: i && !S,
2877
2877
  onChange: (E) => se(E.target.value),
2878
2878
  className: `w-full rounded-md border border-gray-300 px-3 py-2 ${i && !S ? "cursor-not-allowed text-gray-500" : ""}`,
@@ -2949,7 +2949,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2949
2949
  {
2950
2950
  value: f,
2951
2951
  onChange: T,
2952
- placeholder: P && P !== "none" ? "Enter page slug" : b === "page" ? "Leave empty for home page" : "Required - e.g. your-slug",
2952
+ placeholder: P && P !== "none" ? "Enter page slug" : w === "page" ? "Leave empty for home page" : "Required - e.g. your-slug",
2953
2953
  parentSlug: P && P !== "none" ? (Xn = l == null ? void 0 : l.find((E) => E.id === P)) == null ? void 0 : Xn.slug : void 0,
2954
2954
  onValidationChange: g
2955
2955
  }
@@ -2967,7 +2967,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
2967
2967
  children: i ? he ? "Updating..." : "Update page" : he ? "Creating..." : "Create Page"
2968
2968
  }
2969
2969
  )
2970
- ] }) : /* @__PURE__ */ o("form", { onSubmit: bn, className: "mx-auto w-full max-w-md space-y-4", children: [
2970
+ ] }) : /* @__PURE__ */ o("form", { onSubmit: wn, className: "mx-auto w-full max-w-md space-y-4", children: [
2971
2971
  /* @__PURE__ */ o("div", { className: "space-y-0.5", children: [
2972
2972
  /* @__PURE__ */ a(oe, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
2973
2973
  Ae ? /* @__PURE__ */ o(on, { open: ee, onOpenChange: z, children: [
@@ -3012,7 +3012,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
3012
3012
  className: "flex cursor-pointer items-center justify-between",
3013
3013
  children: [
3014
3014
  E.name,
3015
- /* @__PURE__ */ a(gt, { className: Ct("mr-2 h-4 w-4", b === E.key ? "opacity-100" : "opacity-0") })
3015
+ /* @__PURE__ */ a(gt, { className: Ct("mr-2 h-4 w-4", w === E.key ? "opacity-100" : "opacity-0") })
3016
3016
  ]
3017
3017
  },
3018
3018
  E.key
@@ -3023,7 +3023,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
3023
3023
  "select",
3024
3024
  {
3025
3025
  id: "pageType",
3026
- value: b,
3026
+ value: w,
3027
3027
  disabled: i && !S,
3028
3028
  onChange: (E) => se(E.target.value),
3029
3029
  className: `w-full rounded-md border border-gray-300 px-3 py-2 ${i && !S ? "cursor-not-allowed text-gray-500" : ""}`,
@@ -3037,7 +3037,7 @@ function Bc({ addEditPage: e, additionalPageTypes: t = [], close: n, closePanel:
3037
3037
  /* @__PURE__ */ a(C, { variant: "default", size: "sm", onClick: Re, children: "Confirm" })
3038
3038
  ] })
3039
3039
  ] }),
3040
- /* @__PURE__ */ a("p", { className: "text-xs text-gray-500", children: (Jn = t.find((E) => E.key === b)) == null ? void 0 : Jn.helpText })
3040
+ /* @__PURE__ */ a("p", { className: "text-xs text-gray-500", children: (Jn = t.find((E) => E.key === w)) == null ? void 0 : Jn.helpText })
3041
3041
  ] }),
3042
3042
  /* @__PURE__ */ o("div", { className: "space-y-0.5", children: [
3043
3043
  /* @__PURE__ */ a(oe, { htmlFor: "name", className: "text-sm", children: "Name" }),
@@ -3075,7 +3075,7 @@ function La({
3075
3075
  page: e,
3076
3076
  onClose: t
3077
3077
  }) {
3078
- const [, n] = ze(), { mutate: s, isPending: r } = wc(), { data: i } = Fe(), { setSelectedLang: l, fallbackLang: c } = qe(), [, d] = Ss(), u = () => {
3078
+ const [, n] = ze(), { mutate: s, isPending: r } = bc(), { data: i } = Fe(), { setSelectedLang: l, fallbackLang: c } = qe(), [, d] = Ss(), u = () => {
3079
3079
  r || s(e, {
3080
3080
  onSuccess: () => {
3081
3081
  e != null && e.primaryPage ? (window.history.replaceState({}, "", `/?page=${e.primaryPage}`), n(new URLSearchParams({ page: e.primaryPage }))) : (window.history.replaceState({}, "", "/"), n(new URLSearchParams())), window.dispatchEvent(new PopStateEvent("popstate")), l(c), d("outline"), t();
@@ -3149,8 +3149,8 @@ const Mc = () => {
3149
3149
  }) => {
3150
3150
  const { mutate: n, isPending: s } = Mc(), [r, i] = A(null), [l, c] = A(`${e.name} (Copy)`), d = Q(e.slug), [u, h] = A(
3151
3151
  d ? "" : `${e.slug.split("/").pop()}-copy`
3152
- ), m = d ? "" : ul(e.slug.split("/")).join("/"), [w, y] = A(!1), g = (b) => {
3153
- if (b.preventDefault(), !l.trim()) {
3152
+ ), m = d ? "" : ul(e.slug.split("/")).join("/"), [b, y] = A(!1), g = (w) => {
3153
+ if (w.preventDefault(), !l.trim()) {
3154
3154
  i("Name is required");
3155
3155
  return;
3156
3156
  }
@@ -3214,7 +3214,7 @@ const Mc = () => {
3214
3214
  {
3215
3215
  id: "name",
3216
3216
  value: l,
3217
- onChange: (b) => c(b.target.value),
3217
+ onChange: (w) => c(w.target.value),
3218
3218
  required: !0
3219
3219
  }
3220
3220
  )
@@ -3225,10 +3225,10 @@ const Mc = () => {
3225
3225
  ka,
3226
3226
  {
3227
3227
  value: u,
3228
- onChange: (b) => h(b),
3228
+ onChange: (w) => h(w),
3229
3229
  parentSlug: m,
3230
- onValidationChange: (b) => {
3231
- i(b ? null : "Invalid slug");
3230
+ onValidationChange: (w) => {
3231
+ i(w ? null : "Invalid slug");
3232
3232
  }
3233
3233
  }
3234
3234
  )
@@ -3252,8 +3252,8 @@ const Mc = () => {
3252
3252
  C,
3253
3253
  {
3254
3254
  type: "submit",
3255
- disabled: !l.trim() || !d && !u.trim() || s || w,
3256
- children: s || w ? "Duplicating..." : "Duplicate"
3255
+ disabled: !l.trim() || !d && !u.trim() || s || b,
3256
+ children: s || b ? "Duplicating..." : "Duplicate"
3257
3257
  }
3258
3258
  )
3259
3259
  ] })
@@ -3263,9 +3263,9 @@ const Mc = () => {
3263
3263
  page: e,
3264
3264
  onClose: t
3265
3265
  }) => {
3266
- const [n, s] = A(!1), [r, i] = A(""), [l, c] = A(""), [d, u] = A(!1), h = tt(null), m = xc(), { data: w } = Fe(), y = w == null ? void 0 : w.find(
3266
+ const [n, s] = A(!1), [r, i] = A(""), [l, c] = A(""), [d, u] = A(!1), h = tt(null), m = xc(), { data: b } = Fe(), y = b == null ? void 0 : b.find(
3267
3267
  (O) => O.key === e.pageType
3268
- ), g = (y == null ? void 0 : y.name) || Gt(e.pageType), b = ie(
3268
+ ), g = (y == null ? void 0 : y.name) || Gt(e.pageType), w = ie(
3269
3269
  (O) => {
3270
3270
  var _;
3271
3271
  const x = (_ = O.target.files) == null ? void 0 : _[0];
@@ -3359,7 +3359,7 @@ const Mc = () => {
3359
3359
  type: "file",
3360
3360
  id: "previewImage",
3361
3361
  ref: h,
3362
- onChange: b,
3362
+ onChange: w,
3363
3363
  accept: "image/*",
3364
3364
  className: "hidden"
3365
3365
  }
@@ -3435,9 +3435,9 @@ const Mc = () => {
3435
3435
  children: c
3436
3436
  }) => {
3437
3437
  const { hasPermission: d } = mn(), { data: u } = Fe(), h = Y(
3438
- () => be(u, { key: e.pageType }),
3438
+ () => we(u, { key: e.pageType }),
3439
3439
  [u, e.pageType]
3440
- ), m = Y(() => !!e.isTemplate, [e.isTemplate]), w = Y(
3440
+ ), m = Y(() => !!e.isTemplate, [e.isTemplate]), b = Y(
3441
3441
  () => !!(h != null && h.hasSlug),
3442
3442
  [h == null ? void 0 : h.hasSlug]
3443
3443
  );
@@ -3499,7 +3499,7 @@ const Mc = () => {
3499
3499
  ]
3500
3500
  }
3501
3501
  ),
3502
- d(Te.MARK_AS_TEMPLATE) && w && /* @__PURE__ */ a(ve, { children: m ? /* @__PURE__ */ o(
3502
+ d(Te.MARK_AS_TEMPLATE) && b && /* @__PURE__ */ a(ve, { children: m ? /* @__PURE__ */ o(
3503
3503
  Be,
3504
3504
  {
3505
3505
  className: "flex items-center gap-2 cursor-pointer",
@@ -3614,7 +3614,7 @@ const Mc = () => {
3614
3614
  return n(e) || [];
3615
3615
  }, ui = (e, t) => {
3616
3616
  if (!t) return [];
3617
- const n = Ia(e), s = be(n, (r) => r.id === t);
3617
+ const n = Ia(e), s = we(n, (r) => r.id === t);
3618
3618
  if (s) {
3619
3619
  if (s.parent)
3620
3620
  return [...ui(e, s.parent), t];
@@ -3639,9 +3639,9 @@ const Mc = () => {
3639
3639
  }, [n, s, e]), i = ie(
3640
3640
  (u, h) => {
3641
3641
  if (!h || Q(u)) return;
3642
- const m = Ia(u), w = ui(m, h);
3643
- if (!Array.isArray(w) || Q(w)) return;
3644
- const y = w.slice(0, -1);
3642
+ const m = Ia(u), b = ui(m, h);
3643
+ if (!Array.isArray(b) || Q(b)) return;
3644
+ const y = b.slice(0, -1);
3645
3645
  Q(y) || n((g) => dr([...g, ...y]));
3646
3646
  },
3647
3647
  [n]
@@ -3655,8 +3655,8 @@ const Mc = () => {
3655
3655
  ), c = ie((u) => {
3656
3656
  if (Q(u)) return;
3657
3657
  const h = ta(u, (m) => {
3658
- const w = (y) => [y.id, ...y.children ? ta(y.children, w) : []];
3659
- return w(m);
3658
+ const b = (y) => [y.id, ...y.children ? ta(y.children, b) : []];
3659
+ return b(m);
3660
3660
  });
3661
3661
  n(h);
3662
3662
  }, [n]), d = ie(() => {
@@ -3672,7 +3672,7 @@ const Mc = () => {
3672
3672
  expandAll: c,
3673
3673
  collapseAll: d
3674
3674
  };
3675
- }, Va = (e, t) => !e || !Array.isArray(e) ? [] : Q(t) ? e : ws(
3675
+ }, Va = (e, t) => !e || !Array.isArray(e) ? [] : Q(t) ? e : bs(
3676
3676
  Ie(e, (n) => {
3677
3677
  const s = _t(t);
3678
3678
  return Et(_t((n == null ? void 0 : n.name) || ""), s) || Et(_t((n == null ? void 0 : n.slug) || ""), s);
@@ -3717,7 +3717,7 @@ const Mc = () => {
3717
3717
  })), Kc = (e, t, n, s) => {
3718
3718
  if (!e || !e.length) return [];
3719
3719
  let r = e;
3720
- if (n !== "all" && (r = ws(Ie(e, { pageType: n }))), Q(t))
3720
+ if (n !== "all" && (r = bs(Ie(e, { pageType: n }))), Q(t))
3721
3721
  r = Va(r, t);
3722
3722
  else {
3723
3723
  const h = Va(r, t), m = zc(e, h);
@@ -3731,7 +3731,7 @@ const Mc = () => {
3731
3731
  ...h,
3732
3732
  name: Gt(m),
3733
3733
  isPartialGroup: !0,
3734
- children: l.filter((w) => w.pageType === m)
3734
+ children: l.filter((b) => b.pageType === m)
3735
3735
  }))
3736
3736
  );
3737
3737
  return [...c, ...u];
@@ -3748,18 +3748,18 @@ const Mc = () => {
3748
3748
  setDuplicatePage: u,
3749
3749
  hasChildren: h,
3750
3750
  isExpanded: m,
3751
- onToggleExpand: w
3751
+ onToggleExpand: b
3752
3752
  }) => {
3753
- const y = _a(), { data: g } = Fe(), [, b] = Ss(), p = Y(() => be(g, { key: t.pageType }), [g, t.pageType]), N = Y(() => {
3753
+ const y = _a(), { data: g } = Fe(), [, w] = Ss(), p = Y(() => we(g, { key: t.pageType }), [g, t.pageType]), N = Y(() => {
3754
3754
  const _ = V(t, "slug", ""), G = e ? yt(e) : "", W = G ? _.replace(G, "") : _;
3755
3755
  return W || "/";
3756
3756
  }, [t, e]), S = Y(() => !!t.isTemplate, [t.isTemplate]), O = ie(() => {
3757
- b("outline"), y(V(t, "id"), s);
3758
- }, [y, s, t, b]), x = ie(
3757
+ w("outline"), y(V(t, "id"), s);
3758
+ }, [y, s, t, w]), x = ie(
3759
3759
  (_) => {
3760
- _.stopPropagation(), w();
3760
+ _.stopPropagation(), b();
3761
3761
  },
3762
- [w]
3762
+ [b]
3763
3763
  );
3764
3764
  return /* @__PURE__ */ o(
3765
3765
  "div",
@@ -3836,16 +3836,16 @@ const Mc = () => {
3836
3836
  }
3837
3837
  );
3838
3838
  }, Wc = ({ close: e, isOpen: t }) => {
3839
- const [, n] = A([]), [s, r] = A(null), [i, l] = A(""), [c, d] = A(""), [u, h] = A(null), m = (k) => c ? String(V(k, "name", "")).toLowerCase().includes(c.toLowerCase()) || String(V(k, "key", "")).toLowerCase().includes(c.toLowerCase()) : !0, [w, y] = A(null), [g, b] = A(null), [p, N] = A(null), [S, O] = A(null), { data: x, isFetching: _, refetch: G } = Us(), [W, F] = A(""), { hasPermission: te } = mn(), { updateForSelectedPage: j, expandPagesOnSearch: q, expandAll: ee, collapseAll: z } = hi(null), [X, P] = ze(), B = X.get("page"), pe = tt(null), { data: Se } = Fe(), me = vt("enable-add-page-dropdown"), v = ie((k) => {
3839
+ const [, n] = A([]), [s, r] = A(null), [i, l] = A(""), [c, d] = A(""), [u, h] = A(null), m = (k) => c ? String(V(k, "name", "")).toLowerCase().includes(c.toLowerCase()) || String(V(k, "key", "")).toLowerCase().includes(c.toLowerCase()) : !0, [b, y] = A(null), [g, w] = A(null), [p, N] = A(null), [S, O] = A(null), { data: x, isFetching: _, refetch: G } = Us(), [W, F] = A(""), { hasPermission: te } = mn(), { updateForSelectedPage: j, expandPagesOnSearch: q, expandAll: ee, collapseAll: z } = hi(null), [X, P] = ze(), B = X.get("page"), pe = tt(null), { data: Se } = Fe(), me = vt("enable-add-page-dropdown"), v = ie((k) => {
3840
3840
  var U;
3841
- return (U = be(Se, { key: k })) == null ? void 0 : U.hasSlug;
3841
+ return (U = we(Se, { key: k })) == null ? void 0 : U.hasSlug;
3842
3842
  }, [Se]);
3843
3843
  de(() => {
3844
3844
  t && G();
3845
3845
  }, [t, G]), de(() => {
3846
3846
  if (!Q(W)) return;
3847
3847
  const k = sessionStorage.getItem("pageTypeFilter") || "all";
3848
- !Q(Se) && k && (be(Se, { key: k }) ? F(k) : F("all"));
3848
+ !Q(Se) && k && (we(Se, { key: k }) ? F(k) : F("all"));
3849
3849
  }, [Se, W]);
3850
3850
  const f = (k) => {
3851
3851
  F(k), sessionStorage.setItem("pageTypeFilter", k), d("");
@@ -3858,7 +3858,7 @@ const Mc = () => {
3858
3858
  );
3859
3859
  de(() => {
3860
3860
  if (B && !_) {
3861
- const k = be(x, { id: B });
3861
+ const k = we(x, { id: B });
3862
3862
  k && (k != null && k.pageType) ? n((U) => [...U, k == null ? void 0 : k.pageType]) : (window.history.replaceState(null, "", "/"), P(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
3863
3863
  }
3864
3864
  }, [x, B, _, P]);
@@ -3954,7 +3954,7 @@ const Mc = () => {
3954
3954
  close: e,
3955
3955
  setUnpublishPage: y,
3956
3956
  setDeletePage: h,
3957
- setAddEditPage: b,
3957
+ setAddEditPage: w,
3958
3958
  setMarkAsTemplate: N,
3959
3959
  setUnmarkAsTemplate: O,
3960
3960
  setDuplicatePage: r,
@@ -3968,14 +3968,14 @@ const Mc = () => {
3968
3968
  {
3969
3969
  className: "flex text-sm gap-x-2",
3970
3970
  onClick: () => {
3971
- b({
3971
+ w({
3972
3972
  slug: "",
3973
3973
  name: "",
3974
3974
  pageType: W === "all" ? "page" : W
3975
3975
  });
3976
3976
  },
3977
3977
  children: [
3978
- /* @__PURE__ */ a(wa, { className: "w-4 h-4" }),
3978
+ /* @__PURE__ */ a(ba, { className: "w-4 h-4" }),
3979
3979
  " Add New"
3980
3980
  ]
3981
3981
  }
@@ -3986,11 +3986,11 @@ const Mc = () => {
3986
3986
  closePanel: e,
3987
3987
  editPage: T,
3988
3988
  addEditPage: g,
3989
- setAddEditPage: b
3989
+ setAddEditPage: w
3990
3990
  }
3991
3991
  ),
3992
3992
  u && /* @__PURE__ */ a(La, { page: u, onClose: () => h(null) }),
3993
- w && /* @__PURE__ */ a(Ms, { page: w, onClose: () => y(null) }),
3993
+ b && /* @__PURE__ */ a(Ms, { page: b, onClose: () => y(null) }),
3994
3994
  p && /* @__PURE__ */ a(oi, { page: p, onClose: () => N(null) }),
3995
3995
  S && /* @__PURE__ */ a(di, { page: S, onClose: () => O(null) }),
3996
3996
  s && /* @__PURE__ */ a(li, { page: s, onClose: () => r(null) })
@@ -4008,7 +4008,7 @@ const Mc = () => {
4008
4008
  parentSlug: u,
4009
4009
  level: h = 0
4010
4010
  }) => {
4011
- const m = !Q(e == null ? void 0 : e.children), { isExpanded: w, toggleExpanded: y } = hi(e == null ? void 0 : e.id);
4011
+ const m = !Q(e == null ? void 0 : e.children), { isExpanded: b, toggleExpanded: y } = hi(e == null ? void 0 : e.id);
4012
4012
  return /* @__PURE__ */ o("div", { className: "border-0", children: [
4013
4013
  /* @__PURE__ */ a(
4014
4014
  Hc,
@@ -4024,11 +4024,11 @@ const Mc = () => {
4024
4024
  page: e,
4025
4025
  parentSlug: u,
4026
4026
  hasChildren: m,
4027
- isExpanded: w,
4027
+ isExpanded: b,
4028
4028
  onToggleExpand: y
4029
4029
  }
4030
4030
  ),
4031
- m && w && /* @__PURE__ */ a("div", { className: "pt-2 pl-6 bg-white", children: et(V(e, "children", []), (g) => /* @__PURE__ */ a(
4031
+ m && b && /* @__PURE__ */ a("div", { className: "pt-2 pl-6 bg-white", children: et(V(e, "children", []), (g) => /* @__PURE__ */ a(
4032
4032
  fi,
4033
4033
  {
4034
4034
  item: g,
@@ -4050,7 +4050,7 @@ const Mc = () => {
4050
4050
  page: e,
4051
4051
  onClose: t
4052
4052
  }) => {
4053
- const [n, s] = A(e.slug || ""), { mutate: r, isPending: i } = Sc(), { data: l } = Fe(), c = be(l, { key: e == null ? void 0 : e.pageType }), d = (h) => {
4053
+ const [n, s] = A(e.slug || ""), { mutate: r, isPending: i } = Sc(), { data: l } = Fe(), c = we(l, { key: e == null ? void 0 : e.pageType }), d = (h) => {
4054
4054
  if (h.preventDefault(), !(e != null && e.primaryPage) && Object.keys(He).some((y) => n === `/${y}` || os(n, `/${y}/`))) {
4055
4055
  K.error("Error", {
4056
4056
  description: "Slugs cannot start with a language code for primary page"
@@ -4135,7 +4135,7 @@ const Mc = () => {
4135
4135
  onClose: t,
4136
4136
  languages: n
4137
4137
  }) => {
4138
- const { data: s } = Ue(), r = s == null ? void 0 : s.dynamic, { data: i } = Fe(), [l, c] = A(e.name || ""), [d, u] = A(e.edit ? e.lang : ""), [h, m] = A(e.edit ? e.slug : ""), [w, y] = A(!0), [g, b] = A(!0), { mutate: p, isPending: N } = ri(), { mutate: S, isPending: O } = Ta(), { data: x } = wt(s == null ? void 0 : s.parent), { setSelectedLang: _, fallbackLang: G } = qe(), [, W] = ze(), [, F] = Ss(), te = Y(
4138
+ const { data: s } = Ue(), r = s == null ? void 0 : s.dynamic, { data: i } = Fe(), [l, c] = A(e.name || ""), [d, u] = A(e.edit ? e.lang : ""), [h, m] = A(e.edit ? e.slug : ""), [b, y] = A(!0), [g, w] = A(!0), { mutate: p, isPending: N } = ri(), { mutate: S, isPending: O } = Ta(), { data: x } = bt(s == null ? void 0 : s.parent), { setSelectedLang: _, fallbackLang: G } = qe(), [, W] = ze(), [, F] = Ss(), te = Y(
4139
4139
  () => i == null ? void 0 : i.find((v) => v.key === e.pageType),
4140
4140
  [i, e.pageType]
4141
4141
  ), j = r || !(te != null && te.hasSlug), q = (s == null ? void 0 : s.slug) === "/", ee = N || O, { parentSlug: z, isRootPage: X } = Y(() => {
@@ -4153,7 +4153,7 @@ const Mc = () => {
4153
4153
  if (!e.edit) return;
4154
4154
  const f = (e.slug || "").split("/").filter(Boolean);
4155
4155
  let T = "";
4156
- const L = (R) => b(R);
4156
+ const L = (R) => w(R);
4157
4157
  if (q) {
4158
4158
  const R = f.pop() || "";
4159
4159
  if (He[R])
@@ -4196,7 +4196,7 @@ const Mc = () => {
4196
4196
  d && (_(d), pe(d, G)), F("outline"), t();
4197
4197
  }
4198
4198
  });
4199
- }, me = ee || Q(l) || Q(d) || (j || q && g ? !1 : !w || Q(h));
4199
+ }, me = ee || Q(l) || Q(d) || (j || q && g ? !1 : !b || Q(h));
4200
4200
  return /* @__PURE__ */ a(Ye, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ o(Je, { className: "text-slate-600 sm:max-w-[425px]", children: [
4201
4201
  /* @__PURE__ */ o(Xe, { children: [
4202
4202
  /* @__PURE__ */ a(Ze, { children: e.edit ? re.EDIT_LANGUAGE : re.ADD_NEW_LANGUAGE }),
@@ -4246,7 +4246,7 @@ const Mc = () => {
4246
4246
  type: "checkbox",
4247
4247
  id: "useLanguagePrefix",
4248
4248
  checked: g,
4249
- onChange: (v) => b(v.target.checked),
4249
+ onChange: (v) => w(v.target.checked),
4250
4250
  className: "rounded border-gray-300"
4251
4251
  }
4252
4252
  ),
@@ -4290,12 +4290,12 @@ const Mc = () => {
4290
4290
  ] })
4291
4291
  ] }) });
4292
4292
  }, Jc = () => {
4293
- const [, e] = nt(Da), { selectedLang: t, fallbackLang: n, setSelectedLang: s } = qe(), { data: r, isFetching: i } = wt(), { data: l } = Ue(), { data: c } = Fe(), d = Y(() => {
4293
+ const [, e] = nt(Da), { selectedLang: t, fallbackLang: n, setSelectedLang: s } = qe(), { data: r, isFetching: i } = bt(), { data: l } = Ue(), { data: c } = Fe(), d = Y(() => {
4294
4294
  const N = c == null ? void 0 : c.find((S) => S.key === (l == null ? void 0 : l.pageType));
4295
4295
  return N == null ? void 0 : N.dynamicSlug;
4296
- }, [c, l == null ? void 0 : l.pageType]), [u, h] = A(null), [m, w] = A(null), [y, g] = A(null), { data: b } = At(), p = Ie(
4297
- V(b, "languages") || ["en"],
4298
- (N) => !be(r, { lang: N }) && N !== V(b, "fallbackLang")
4296
+ }, [c, l == null ? void 0 : l.pageType]), [u, h] = A(null), [m, b] = A(null), [y, g] = A(null), { data: w } = At(), p = Ie(
4297
+ V(w, "languages") || ["en"],
4298
+ (N) => !we(r, { lang: N }) && N !== V(w, "fallbackLang")
4299
4299
  );
4300
4300
  return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
4301
4301
  /* @__PURE__ */ a("ul", { className: "space-y-2", children: i ? /* @__PURE__ */ o("div", { className: "w-full space-y-3 py-4", children: [
@@ -4363,7 +4363,7 @@ const Mc = () => {
4363
4363
  {
4364
4364
  className: "flex cursor-pointer items-center gap-2",
4365
4365
  onClick: (G) => {
4366
- G.stopPropagation(), w(N);
4366
+ G.stopPropagation(), b(N);
4367
4367
  },
4368
4368
  children: [
4369
4369
  /* @__PURE__ */ a(Rr, { className: "size-3" }),
@@ -4414,11 +4414,11 @@ const Mc = () => {
4414
4414
  }
4415
4415
  ) }) }),
4416
4416
  u && /* @__PURE__ */ a(La, { page: u, onClose: () => h(null) }),
4417
- m && /* @__PURE__ */ a(Ms, { page: m, onClose: () => w(null) }),
4417
+ m && /* @__PURE__ */ a(Ms, { page: m, onClose: () => b(null) }),
4418
4418
  y && /* @__PURE__ */ a(Qc, { page: y, onClose: () => g(null) })
4419
4419
  ] });
4420
4420
  }, Xc = () => {
4421
- const e = bt("logo", null);
4421
+ const e = wt("logo", null);
4422
4422
  return e ? /* @__PURE__ */ a("div", { className: "max-h-9 w-full overflow-hidden pr-2", children: xs.createElement(e, {}) }) : null;
4423
4423
  }, Zc = () => {
4424
4424
  const [e] = ze(), t = e.get("page"), { data: n, isFetching: s } = Ue(), [r, i] = A(!1), { savePage: l } = Es(), c = !!t && !Q(n), d = !t || !s && Q(n) || r;
@@ -4466,13 +4466,13 @@ const Mc = () => {
4466
4466
  }) => {
4467
4467
  const { fallbackLang: n, languages: s, selectedLang: r, setSelectedLang: i } = qe(), l = Q(r) ? n : r, [, c] = ze();
4468
4468
  de(() => {
4469
- const b = new URLSearchParams(window.location.search), p = b.get("lang");
4470
- p && (s.includes(p) ? i(p) : (b.delete("lang"), c(b), i("")));
4469
+ const w = new URLSearchParams(window.location.search), p = w.get("lang");
4470
+ p && (s.includes(p) ? i(p) : (w.delete("lang"), c(w), i("")));
4471
4471
  }, [s, c, i]);
4472
- const [, d] = nt(Da), { data: u } = Ue(), { data: h } = At(), { data: m, isFetching: w } = wt(), y = Y(() => {
4473
- const b = ws(
4472
+ const [, d] = nt(Da), { data: u } = Ue(), { data: h } = At(), { data: m, isFetching: b } = bt(), y = Y(() => {
4473
+ const w = bs(
4474
4474
  et(V(h, "languages"), (p) => {
4475
- const N = be(m, { lang: p });
4475
+ const N = we(m, { lang: p });
4476
4476
  return {
4477
4477
  key: p,
4478
4478
  value: V(He, p, p),
@@ -4486,16 +4486,16 @@ const Mc = () => {
4486
4486
  value: V(He, n),
4487
4487
  isLangPageAdded: !0
4488
4488
  },
4489
- ...b
4489
+ ...w
4490
4490
  ];
4491
- }, [n, m, h]), g = (b) => {
4492
- i(b);
4491
+ }, [n, m, h]), g = (w) => {
4492
+ i(w);
4493
4493
  const p = new URLSearchParams(window.location.search);
4494
- b === n ? p.delete("lang") : p.set("lang", b);
4494
+ w === n ? p.delete("lang") : p.set("lang", w);
4495
4495
  const N = p.toString(), S = `${window.location.pathname}${N ? `?${N}` : ""}`;
4496
4496
  window.history.pushState({}, "", S), c(p), window.dispatchEvent(new PopStateEvent("popstate"));
4497
4497
  };
4498
- return Q(s) || w ? null : /* @__PURE__ */ a(ve, { children: /* @__PURE__ */ o(fn, { children: [
4498
+ return Q(s) || b ? null : /* @__PURE__ */ a(ve, { children: /* @__PURE__ */ o(fn, { children: [
4499
4499
  /* @__PURE__ */ a(gn, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ o(C, { variant: t, size: "sm", className: "ml-px h-max gap-2 py-1.5", children: [
4500
4500
  /* @__PURE__ */ a(go, { className: "h-4 w-4" }),
4501
4501
  V(He, l, l),
@@ -4503,27 +4503,27 @@ const Mc = () => {
4503
4503
  ] }) }),
4504
4504
  /* @__PURE__ */ o(pn, { className: "space-y-1 border-border", children: [
4505
4505
  et(
4506
- y.filter((b) => b.isLangPageAdded),
4507
- (b) => /* @__PURE__ */ o(
4506
+ y.filter((w) => w.isLangPageAdded),
4507
+ (w) => /* @__PURE__ */ o(
4508
4508
  Be,
4509
4509
  {
4510
4510
  className: va(
4511
4511
  "flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",
4512
- b.key === l && "!bg-gray-200 text-gray-700"
4512
+ w.key === l && "!bg-gray-200 text-gray-700"
4513
4513
  ),
4514
- onClick: () => g(b.key),
4514
+ onClick: () => g(w.key),
4515
4515
  children: [
4516
- /* @__PURE__ */ a("div", { className: "text-slate-600", children: b.value }),
4517
- b.key === n && /* @__PURE__ */ o("small", { className: "flex items-center gap-x-1 text-[9px] leading-none text-orange-500", children: [
4516
+ /* @__PURE__ */ a("div", { className: "text-slate-600", children: w.value }),
4517
+ w.key === n && /* @__PURE__ */ o("small", { className: "flex items-center gap-x-1 text-[9px] leading-none text-orange-500", children: [
4518
4518
  /* @__PURE__ */ a(po, { fill: "orange", className: "h-2 w-2" }),
4519
4519
  "Primary"
4520
4520
  ] })
4521
4521
  ]
4522
4522
  },
4523
- b.value
4523
+ w.value
4524
4524
  )
4525
4525
  ),
4526
- e && !Q(y.filter((b) => !b.isLangPageAdded)) && /* @__PURE__ */ o(ve, { children: [
4526
+ e && !Q(y.filter((w) => !w.isLangPageAdded)) && /* @__PURE__ */ o(ve, { children: [
4527
4527
  /* @__PURE__ */ a(Vl, {}),
4528
4528
  /* @__PURE__ */ o(
4529
4529
  C,
@@ -4541,7 +4541,7 @@ const Mc = () => {
4541
4541
  },
4542
4542
  className: "text-xs font-normal duration-200 hover:bg-slate-300 hover:text-slate-800",
4543
4543
  children: [
4544
- /* @__PURE__ */ a(wa, { className: "mr-1 h-3 w-3" }),
4544
+ /* @__PURE__ */ a(ba, { className: "mr-1 h-3 w-3" }),
4545
4545
  " Add Langauge"
4546
4546
  ]
4547
4547
  }
@@ -4551,9 +4551,9 @@ const Mc = () => {
4551
4551
  ] }) });
4552
4552
  };
4553
4553
  function ed() {
4554
- const [e, t] = nt(Da), { data: n } = wt(), { data: s } = At(), r = Ie(
4554
+ const [e, t] = nt(Da), { data: n } = bt(), { data: s } = At(), r = Ie(
4555
4555
  V(s, "languages") || ["en"],
4556
- (i) => !be(n, { lang: i }) && i !== V(s, "fallbackLang")
4556
+ (i) => !we(n, { lang: i }) && i !== V(s, "fallbackLang")
4557
4557
  );
4558
4558
  return /* @__PURE__ */ o("div", { className: "relative z-10 flex items-center justify-end gap-1", children: [
4559
4559
  /* @__PURE__ */ a(Xc, {}),
@@ -4658,7 +4658,7 @@ function ad({ compare: e, setCompare: t, isComparisonEnabled: n }) {
4658
4658
  }
4659
4659
  function rd() {
4660
4660
  var z, X;
4661
- const [e, t] = Pe.useState([]), [n, s] = Pe.useState(!1), [r, i] = Pe.useState(null), [l, c] = Pe.useState(!1), [d, u] = Pe.useState(!1), { data: h } = Ue(), { data: m, isFetching: w, error: y, refetch: g } = td(h == null ? void 0 : h.id), { mutate: b, isPending: p } = nd(), { mutate: N, isPending: S } = sd(), O = ke(), x = Zr(), _ = vt("enable-page-revisions-compare"), { selectedLang: G, fallbackLang: W } = qe(), F = G || W;
4661
+ const [e, t] = Pe.useState([]), [n, s] = Pe.useState(!1), [r, i] = Pe.useState(null), [l, c] = Pe.useState(!1), [d, u] = Pe.useState(!1), { data: h } = Ue(), { data: m, isFetching: b, error: y, refetch: g } = td(h == null ? void 0 : h.id), { mutate: w, isPending: p } = nd(), { mutate: N, isPending: S } = sd(), O = ke(), x = Zr(), _ = vt("enable-page-revisions-compare"), { selectedLang: G, fallbackLang: W } = qe(), F = G || W;
4662
4662
  de(() => t([]), [h == null ? void 0 : h.id]);
4663
4663
  const te = (P) => {
4664
4664
  r && N(
@@ -4676,7 +4676,7 @@ function rd() {
4676
4676
  }, q = (P) => {
4677
4677
  i(P), u(!0);
4678
4678
  }, ee = () => {
4679
- r && b(r.uid, {
4679
+ r && w(r.uid, {
4680
4680
  /**
4681
4681
  * Callback for when deletion of a revision is successful. Closes the
4682
4682
  * delete dialog and resets the selected revision to null.
@@ -4706,7 +4706,7 @@ function rd() {
4706
4706
  _s(new Date(h.createdAt), "MMM d, yyyy 'at' h:mm a")
4707
4707
  ] })
4708
4708
  ] }),
4709
- w ? /* @__PURE__ */ a(id, {}) : y ? /* @__PURE__ */ a("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Failed to load revisions. Please try again." }) : /* @__PURE__ */ o("div", { className: "mt-2 flex h-full min-h-0 flex-1 flex-col space-y-2", children: [
4709
+ b ? /* @__PURE__ */ a(id, {}) : y ? /* @__PURE__ */ a("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Failed to load revisions. Please try again." }) : /* @__PURE__ */ o("div", { className: "mt-2 flex h-full min-h-0 flex-1 flex-col space-y-2", children: [
4710
4710
  _ && /* @__PURE__ */ a(od, { lang: F, compare: e, setCompare: t }),
4711
4711
  /* @__PURE__ */ a(
4712
4712
  ad,
@@ -4800,9 +4800,9 @@ function Ka({
4800
4800
  isComparisonEnabled: u,
4801
4801
  lang: h
4802
4802
  }) {
4803
- const { data: m } = $t(e.currentEditor), w = (m == null ? void 0 : m.name) || "Unknown", y = !!i.find((b) => {
4803
+ const { data: m } = $t(e.currentEditor), b = (m == null ? void 0 : m.name) || "Unknown", y = !!i.find((w) => {
4804
4804
  var p;
4805
- return t ? (p = b == null ? void 0 : b.uid) == null ? void 0 : p.startsWith("live") : (b == null ? void 0 : b.uid) === e.uid;
4805
+ return t ? (p = w == null ? void 0 : w.uid) == null ? void 0 : p.startsWith("live") : (w == null ? void 0 : w.uid) === e.uid;
4806
4806
  }), g = i.length >= 2 && !y;
4807
4807
  return /* @__PURE__ */ o("div", { className: "relative flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50", children: [
4808
4808
  /* @__PURE__ */ o("div", { className: "flex-1 space-y-3", children: [
@@ -4810,7 +4810,7 @@ function Ka({
4810
4810
  u && /* @__PURE__ */ a(It, { tag: t ? "live" : `#${r}` }),
4811
4811
  e.type === "published" ? "Published" : "Draft",
4812
4812
  " by ",
4813
- /* @__PURE__ */ a("span", { className: "text-xs font-bold", children: w }),
4813
+ /* @__PURE__ */ a("span", { className: "text-xs font-bold", children: b }),
4814
4814
  !u && t && /* @__PURE__ */ a(It, { tag: "live" })
4815
4815
  ] }) }),
4816
4816
  /* @__PURE__ */ o("div", { className: "flex items-center gap-x-3", children: [
@@ -4839,7 +4839,7 @@ function Ka({
4839
4839
  disabled: g,
4840
4840
  onChange: () => {
4841
4841
  l(
4842
- y ? i.filter((b) => t ? b.uid !== `live:${c}` : b.uid !== e.uid) : [
4842
+ y ? i.filter((w) => t ? w.uid !== `live:${c}` : w.uid !== e.uid) : [
4843
4843
  ...i,
4844
4844
  { uid: t ? `live:${c}` : e.uid, label: t ? "live" : `#${r}` }
4845
4845
  ]
@@ -4972,7 +4972,7 @@ function dd({
4972
4972
  /* @__PURE__ */ a("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
4973
4973
  "Saving as draft..."
4974
4974
  ] }) : /* @__PURE__ */ o(ve, { children: [
4975
- /* @__PURE__ */ a(bo, { className: "mr-2 h-4 w-4" }),
4975
+ /* @__PURE__ */ a(wo, { className: "mr-2 h-4 w-4" }),
4976
4976
  "Save as draft"
4977
4977
  ] }) }),
4978
4978
  /* @__PURE__ */ a(C, { variant: "default", className: "sm:flex-1", onClick: () => s(!0), disabled: r, children: r ? /* @__PURE__ */ o(ve, { children: [
@@ -5047,7 +5047,7 @@ function fd({
5047
5047
  const [n, s] = A([]), { data: r, isFetching: i } = hd(), { data: l } = Fe(), c = ie(
5048
5048
  (x) => {
5049
5049
  var _;
5050
- return (_ = be(l, { key: x })) == null ? void 0 : _.hasSlug;
5050
+ return (_ = we(l, { key: x })) == null ? void 0 : _.hasSlug;
5051
5051
  },
5052
5052
  [l]
5053
5053
  ), d = Y(
@@ -5062,21 +5062,21 @@ function fd({
5062
5062
  () => Ie(r, (x) => d.includes(x.pageType)),
5063
5063
  [r, d]
5064
5064
  ), m = Y(
5065
- () => be(r, { pageType: "theme", id: "THEME" }),
5065
+ () => we(r, { pageType: "theme", id: "THEME" }),
5066
5066
  [r]
5067
- ), { mutate: w, isPending: y } = Ca();
5067
+ ), { mutate: b, isPending: y } = Ca();
5068
5068
  de(() => {
5069
5069
  const x = et(Ie(r, { online: !0 }), "id");
5070
5070
  m && x.push(m == null ? void 0 : m.id), s(x);
5071
5071
  }, [r, m]);
5072
- const g = n.length === (r == null ? void 0 : r.length), b = (x) => {
5072
+ const g = n.length === (r == null ? void 0 : r.length), w = (x) => {
5073
5073
  s(
5074
5074
  (_) => Et(_, x) ? Ie(_, (G) => G !== x) : gl(_, x)
5075
5075
  );
5076
5076
  }, p = () => {
5077
5077
  s(g ? [] : et(r, "id"));
5078
5078
  }, N = () => {
5079
- w(
5079
+ b(
5080
5080
  { ids: dr(n) },
5081
5081
  {
5082
5082
  onSuccess: () => {
@@ -5086,7 +5086,7 @@ function fd({
5086
5086
  );
5087
5087
  }, S = (x) => {
5088
5088
  if (x === "theme") return "Theme";
5089
- const _ = be(l, { key: x });
5089
+ const _ = we(l, { key: x });
5090
5090
  return _ ? _ == null ? void 0 : _.name : x;
5091
5091
  }, O = Y(() => {
5092
5092
  const x = [
@@ -5166,14 +5166,14 @@ function fd({
5166
5166
  {
5167
5167
  checked: Et(n, x == null ? void 0 : x.id),
5168
5168
  onClick: (_) => {
5169
- _.stopPropagation(), b(x == null ? void 0 : x.id);
5169
+ _.stopPropagation(), w(x == null ? void 0 : x.id);
5170
5170
  },
5171
5171
  type: "checkbox",
5172
5172
  className: "rounded cursor-pointer focus:outline-none focus:ring-0"
5173
5173
  }
5174
5174
  ),
5175
5175
  " ",
5176
- c(x.pageType) ? /* @__PURE__ */ a(Wn, { className: "w-4 h-4" }) : /* @__PURE__ */ a(wo, { className: "w-4 h-4" }),
5176
+ c(x.pageType) ? /* @__PURE__ */ a(Wn, { className: "w-4 h-4" }) : /* @__PURE__ */ a(bo, { className: "w-4 h-4" }),
5177
5177
  x.name,
5178
5178
  x.slug && /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
5179
5179
  "(",
@@ -5230,7 +5230,7 @@ const gd = () => {
5230
5230
  });
5231
5231
  };
5232
5232
  function pd({ onClose: e }) {
5233
- const { data: t, isFetching: n } = gd(), { mutateAsync: s, isPending: r } = Ho(), i = bt("settingComponent", null), l = pl(async (c) => (await s({ data: c }), !0), 300);
5233
+ const { data: t, isFetching: n } = gd(), { mutateAsync: s, isPending: r } = Ho(), i = wt("settingComponent", null), l = pl(async (c) => (await s({ data: c }), !0), 300);
5234
5234
  return i ? /* @__PURE__ */ a(Ye, { open: !0, onOpenChange: e, children: /* @__PURE__ */ o(Je, { className: "w-full", children: [
5235
5235
  /* @__PURE__ */ a(Xe, { children: /* @__PURE__ */ a(Ze, { children: "Website Settings" }) }),
5236
5236
  n ? /* @__PURE__ */ o("div", { className: "w-full space-y-3 py-4", children: [
@@ -5259,23 +5259,23 @@ function yi({
5259
5259
  ] }) });
5260
5260
  }
5261
5261
  const yd = () => {
5262
- const { selectedLang: e, fallbackLang: t } = qe(), n = bt("getPreviewUrl", async (m) => m), [s, r] = A(""), { data: i } = Ue(), { data: l } = wt(), { data: c } = Fe(), d = Y(
5262
+ const { selectedLang: e, fallbackLang: t } = qe(), n = wt("getPreviewUrl", async (m) => m), [s, r] = A(""), { data: i } = Ue(), { data: l } = bt(), { data: c } = Fe(), d = Y(
5263
5263
  () => {
5264
5264
  var m;
5265
- return (m = l == null ? void 0 : l.find((w) => (w == null ? void 0 : w.lang) === e)) == null ? void 0 : m.slug;
5265
+ return (m = l == null ? void 0 : l.find((b) => (b == null ? void 0 : b.lang) === e)) == null ? void 0 : m.slug;
5266
5266
  },
5267
5267
  [e, l]
5268
5268
  ), u = ie((m) => {
5269
- var w;
5270
- return (w = be(c, { key: m })) == null ? void 0 : w.hasSlug;
5269
+ var b;
5270
+ return (b = we(c, { key: m })) == null ? void 0 : b.hasSlug;
5271
5271
  }, [c]), h = e === t ? "" : e;
5272
5272
  return de(() => {
5273
5273
  (async () => {
5274
5274
  if (typeof n == "function") {
5275
- const m = !u(i == null ? void 0 : i.pageType), w = await n(
5275
+ const m = !u(i == null ? void 0 : i.pageType), b = await n(
5276
5276
  m ? `${h !== "" ? h + "/" : ""}${i == null ? void 0 : i.id}` : d || ""
5277
5277
  );
5278
- r(w);
5278
+ r(b);
5279
5279
  } else
5280
5280
  r("");
5281
5281
  })();
@@ -5299,7 +5299,7 @@ const yd = () => {
5299
5299
  ) }),
5300
5300
  /* @__PURE__ */ a("div", { className: "h-4 w-px bg-gray-200 dark:bg-gray-700" })
5301
5301
  ] });
5302
- }, bd = () => {
5302
+ }, wd = () => {
5303
5303
  const [e, t] = A(!1), { isLocked: n } = Yn(), { savePage: s, saveState: r } = Es();
5304
5304
  de(() => {
5305
5305
  const h = (m) => {
@@ -5345,17 +5345,17 @@ const yd = () => {
5345
5345
  " ",
5346
5346
  u
5347
5347
  ] });
5348
- }, wd = () => {
5349
- const { selectedLang: e } = qe(), { data: t } = yn(), { data: n } = wt(), [s, r] = A(!1), [i, l] = A(!1), [c, d] = A(null), { data: u } = Ue(), { mutate: h, isPending: m } = Ca(), { buttonText: w, buttonClassName: y, isPublished: g } = Y(() => {
5348
+ }, bd = () => {
5349
+ const { selectedLang: e } = qe(), { data: t } = yn(), { data: n } = bt(), [s, r] = A(!1), [i, l] = A(!1), [c, d] = A(null), { data: u } = Ue(), { mutate: h, isPending: m } = Ca(), { buttonText: b, buttonClassName: y, isPublished: g } = Y(() => {
5350
5350
  const N = u && (u == null ? void 0 : u.online);
5351
5351
  return {
5352
5352
  buttonClassName: N ? "hover:bg-green-600 bg-green-500" : "",
5353
5353
  isPublished: N,
5354
5354
  buttonText: N ? re.PUBLISHED : re.PUBLISH
5355
5355
  };
5356
- }, [u]), b = async () => {
5356
+ }, [u]), w = async () => {
5357
5357
  const N = [t == null ? void 0 : t.id, t == null ? void 0 : t.primaryPage];
5358
- h({ ids: ws(N) }, { onSuccess: () => En("TOP_RIGHT") });
5358
+ h({ ids: bs(N) }, { onSuccess: () => En("TOP_RIGHT") });
5359
5359
  }, p = Y(() => et(n ?? [], "id"), [n]);
5360
5360
  return /* @__PURE__ */ o(ve, { children: [
5361
5361
  /* @__PURE__ */ o("div", { className: "flex", children: [
@@ -5363,7 +5363,7 @@ const yd = () => {
5363
5363
  C,
5364
5364
  {
5365
5365
  size: "sm",
5366
- onClick: b,
5366
+ onClick: w,
5367
5367
  disabled: m || !(u != null && u.id),
5368
5368
  className: `relative flex items-center gap-1 overflow-hidden rounded-r-none text-white transition-all duration-300 ease-in-out ${y}`,
5369
5369
  onMouseEnter: () => l(!0),
@@ -5383,7 +5383,7 @@ const yd = () => {
5383
5383
  children: g ? /* @__PURE__ */ a(sa, { className: "h-4 w-4" }) : /* @__PURE__ */ a(ja, { className: "h-4 w-4" })
5384
5384
  }
5385
5385
  ),
5386
- /* @__PURE__ */ a("span", { children: w }),
5386
+ /* @__PURE__ */ a("span", { children: b }),
5387
5387
  e ? `(${Ba(e)})` : ""
5388
5388
  ]
5389
5389
  }
@@ -5439,7 +5439,7 @@ const yd = () => {
5439
5439
  c && /* @__PURE__ */ a(Ms, { page: c, onClose: () => d(null) })
5440
5440
  ] });
5441
5441
  }, Nd = () => {
5442
- const e = bt("settingComponent", null), [t, n] = A(!1);
5442
+ const e = wt("settingComponent", null), [t, n] = A(!1);
5443
5443
  return e ? /* @__PURE__ */ o(ve, { children: [
5444
5444
  /* @__PURE__ */ a(yi, { content: re.WEBSITEDATA, children: /* @__PURE__ */ a(C, { variant: "ghost", size: "icon", className: "gap-2", onClick: () => n(!0), children: /* @__PURE__ */ a(Eo, { className: "h-4 w-4" }) }) }),
5445
5445
  t && /* @__PURE__ */ a(pd, { onClose: () => n(!1) }),
@@ -5453,8 +5453,8 @@ function xd() {
5453
5453
  /* @__PURE__ */ a(at, { permission: Te.EDIT_THEME, children: /* @__PURE__ */ a(vd, {}) }),
5454
5454
  /* @__PURE__ */ a(at, { permission: Te.EDIT_SETTINGS, children: /* @__PURE__ */ a(Nd, {}) }),
5455
5455
  /* @__PURE__ */ a(yd, {}),
5456
- /* @__PURE__ */ a(at, { permission: Te.SAVE_PAGE, children: /* @__PURE__ */ a(bd, {}) }),
5457
- /* @__PURE__ */ a(at, { permission: Te.PUBLISH_PAGE, children: /* @__PURE__ */ a(wd, {}) })
5456
+ /* @__PURE__ */ a(at, { permission: Te.SAVE_PAGE, children: /* @__PURE__ */ a(wd, {}) }),
5457
+ /* @__PURE__ */ a(at, { permission: Te.PUBLISH_PAGE, children: /* @__PURE__ */ a(bd, {}) })
5458
5458
  ] });
5459
5459
  }
5460
5460
  const Ed = ({
@@ -5533,12 +5533,12 @@ const Ed = ({
5533
5533
  }
5534
5534
  ) });
5535
5535
  }, Td = () => {
5536
- const [e, t] = A(null), [n, s] = A(null), [r, i] = A(null), [l, c] = A(null), [d, u] = A(null), [h, m] = A(null), { data: w, isFetching: y } = Ue();
5537
- return w ? /* @__PURE__ */ o(ve, { children: [
5536
+ const [e, t] = A(null), [n, s] = A(null), [r, i] = A(null), [l, c] = A(null), [d, u] = A(null), [h, m] = A(null), { data: b, isFetching: y } = Ue();
5537
+ return b ? /* @__PURE__ */ o(ve, { children: [
5538
5538
  /* @__PURE__ */ a(
5539
5539
  ci,
5540
5540
  {
5541
- page: w,
5541
+ page: b,
5542
5542
  setDuplicatePage: (g) => u(g),
5543
5543
  setAddEditPage: (g) => m(g),
5544
5544
  setUnpublishPage: (g) => s(g),
@@ -5546,7 +5546,7 @@ const Ed = ({
5546
5546
  setMarkAsTemplate: (g) => i(g),
5547
5547
  setUnmarkAsTemplate: (g) => c(g),
5548
5548
  children: /* @__PURE__ */ o("div", { className: "flex cursor-pointer items-center justify-center space-x-2 rounded px-2 py-1 duration-100 hover:bg-gray-200", children: [
5549
- /* @__PURE__ */ a("span", { className: "flex max-w-[200px] items-center truncate text-xs font-medium leading-tight", children: y ? /* @__PURE__ */ a(Ft, { className: "ml-2 h-4 w-4 animate-spin text-slate-400" }) : V(w, "name") ?? "" }),
5549
+ /* @__PURE__ */ a("span", { className: "flex max-w-[200px] items-center truncate text-xs font-medium leading-tight", children: y ? /* @__PURE__ */ a(Ft, { className: "ml-2 h-4 w-4 animate-spin text-slate-400" }) : V(b, "name") ?? "" }),
5550
5550
  /* @__PURE__ */ a(Ds, { className: "h-4 w-4", onClick: (g) => g.stopPropagation() })
5551
5551
  ] })
5552
5552
  }
@@ -5654,7 +5654,7 @@ const Ed = ({
5654
5654
  action: "GET_LIBRARY_ITEM",
5655
5655
  data: { id: e.id }
5656
5656
  }), r = V(s, "html", ""), i = V(s, "blocks", []);
5657
- return bl(i) ? i : Ol(r);
5657
+ return wl(i) ? i : Ol(r);
5658
5658
  },
5659
5659
  async getUILibraryBlocks(e, t, n) {
5660
5660
  try {
@@ -5757,9 +5757,9 @@ const Ed = ({
5757
5757
  email: cs.string().email({ message: "Please enter a valid email address" }),
5758
5758
  password: cs.string().min(6, { message: "Password must be at least 6 characters" })
5759
5759
  }), Ud = () => {
5760
- const { setUser: e, logout: t } = it(), n = Rs(), [s, r] = A(""), [i, l] = A(""), [c, d] = A({}), [u, h] = A(!1), [m, w] = A(""), y = _e({
5760
+ const { setUser: e, logout: t } = it(), n = Rs(), [s, r] = A(""), [i, l] = A(""), [c, d] = A({}), [u, h] = A(!1), [m, b] = A(""), y = _e({
5761
5761
  mutationFn: async (p) => {
5762
- w("");
5762
+ b("");
5763
5763
  const N = await Gs(n, {
5764
5764
  action: "LOGIN",
5765
5765
  data: p
@@ -5776,13 +5776,13 @@ const Ed = ({
5776
5776
  return S;
5777
5777
  },
5778
5778
  onSuccess: () => {
5779
- d({}), w("");
5779
+ d({}), b("");
5780
5780
  },
5781
5781
  onError: (p) => {
5782
5782
  d({
5783
5783
  email: " ",
5784
5784
  password: " "
5785
- }), w(p.message || "Something went wrong");
5785
+ }), b(p.message || "Something went wrong");
5786
5786
  }
5787
5787
  }), g = async (p) => {
5788
5788
  p.preventDefault(), d({});
@@ -5799,7 +5799,7 @@ const Ed = ({
5799
5799
  d(O);
5800
5800
  }
5801
5801
  }
5802
- }, b = Wa.safeParse({ email: s, password: i }).success;
5802
+ }, w = Wa.safeParse({ email: s, password: i }).success;
5803
5803
  return /* @__PURE__ */ a("div", { className: "flex justify-center items-center min-h-screen bg-slate-50", children: /* @__PURE__ */ o(As, { className: "w-full max-w-md", children: [
5804
5804
  /* @__PURE__ */ o(Ts, { children: [
5805
5805
  /* @__PURE__ */ a(Cs, { className: "text-2xl", children: "Sign in" }),
@@ -5853,7 +5853,7 @@ const Ed = ({
5853
5853
  {
5854
5854
  type: "submit",
5855
5855
  className: "w-full",
5856
- disabled: !b || y.isPending,
5856
+ disabled: !w || y.isPending,
5857
5857
  children: y.isPending ? /* @__PURE__ */ o(ve, { children: [
5858
5858
  /* @__PURE__ */ a(xa, { className: "mr-2 h-4 w-4 animate-spin" }),
5859
5859
  "Logging in..."
@@ -5936,19 +5936,19 @@ function Pt({
5936
5936
  }, [e, r]);
5937
5937
  const h = (g) => Array.isArray(g) ? "array" : typeof g == "object" && g !== null ? "object" : "value", m = Pe.useCallback(
5938
5938
  (g) => {
5939
- const b = (p) => n === "value" ? p === "value" || p === "object" : n === "array" ? p === "array" : p === n;
5940
- g.type === "object" ? (c((p) => [...p, g.key]), u(g.value)) : b(g.type) && (t([...l, g.key].join(".")), i(!1));
5939
+ const w = (p) => n === "value" ? p === "value" || p === "object" : n === "array" ? p === "array" : p === n;
5940
+ g.type === "object" ? (c((p) => [...p, g.key]), u(g.value)) : w(g.type) && (t([...l, g.key].join(".")), i(!1));
5941
5941
  },
5942
5942
  [l, t, n]
5943
- ), w = Pe.useCallback(() => {
5943
+ ), b = Pe.useCallback(() => {
5944
5944
  if (l.length > 0) {
5945
5945
  const g = l.slice(0, -1);
5946
- c(g), u(g.reduce((b, p) => b[p], e));
5946
+ c(g), u(g.reduce((w, p) => w[p], e));
5947
5947
  }
5948
- }, [l, e]), y = Pe.useMemo(() => Object.entries(d).map(([g, b]) => ({
5948
+ }, [l, e]), y = Pe.useMemo(() => Object.entries(d).map(([g, w]) => ({
5949
5949
  key: g,
5950
- value: b,
5951
- type: h(b)
5950
+ value: w,
5951
+ type: h(w)
5952
5952
  })).filter((g) => n === "value" ? g.type === "value" || g.type === "object" : n === "array" ? g.type === "array" || g.type === "object" : n === "object" ? g.type === "object" : !0), [d, n]);
5953
5953
  return /* @__PURE__ */ o(on, { open: r, onOpenChange: i, children: [
5954
5954
  /* @__PURE__ */ o(ct, { children: [
@@ -5974,8 +5974,8 @@ function Pt({
5974
5974
  onWheel: (g) => {
5975
5975
  try {
5976
5976
  g.preventDefault();
5977
- const b = g.currentTarget;
5978
- b.scrollTop += g.deltaY;
5977
+ const w = g.currentTarget;
5978
+ w.scrollTop += g.deltaY;
5979
5979
  } catch {
5980
5980
  g.preventDefault();
5981
5981
  }
@@ -5986,7 +5986,7 @@ function Pt({
5986
5986
  l.length > 0 && /* @__PURE__ */ o(
5987
5987
  ot,
5988
5988
  {
5989
- onSelect: w,
5989
+ onSelect: b,
5990
5990
  className: "flex items-center text-sm",
5991
5991
  children: [
5992
5992
  /* @__PURE__ */ a(Fr, { className: "w-4 h-4 mr-2" }),
@@ -6008,8 +6008,8 @@ function Pt({
6008
6008
  size: "sm",
6009
6009
  variant: "ghost",
6010
6010
  className: "h-6 px-2 hover:bg-primary hover:text-primary-foreground",
6011
- onClick: (b) => {
6012
- b.stopPropagation(), t([...l, g.key].join(".")), i(!1);
6011
+ onClick: (w) => {
6012
+ w.stopPropagation(), t([...l, g.key].join(".")), i(!1);
6013
6013
  },
6014
6014
  children: "Select"
6015
6015
  }
@@ -6028,8 +6028,8 @@ function Pt({
6028
6028
  ] });
6029
6029
  }
6030
6030
  const $d = () => {
6031
- const { selectedLang: e } = qe(), { data: t, isFetching: n } = wt();
6032
- return { data: Y(() => be(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
6031
+ const { selectedLang: e } = qe(), { data: t, isFetching: n } = bt();
6032
+ return { data: Y(() => we(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
6033
6033
  }, qd = () => {
6034
6034
  var l;
6035
6035
  const t = (l = document.getElementById("canvas-iframe").contentDocument) == null ? void 0 : l.body.innerHTML;
@@ -6150,7 +6150,7 @@ const $d = () => {
6150
6150
  pageData: c = {},
6151
6151
  handleFieldInsert: d
6152
6152
  }) => {
6153
- const [u, h] = A("edit"), [m, w] = A(null), [y, g] = A(""), b = tt(null), p = (x) => {
6153
+ const [u, h] = A("edit"), [m, b] = A(null), [y, g] = A(""), w = tt(null), p = (x) => {
6154
6154
  if (s) return;
6155
6155
  const _ = x.target.value;
6156
6156
  t(_);
@@ -6185,13 +6185,13 @@ const $d = () => {
6185
6185
  de(() => {
6186
6186
  const x = Qa(e);
6187
6187
  if (x.isValid)
6188
- if (w(null), x.parsed) {
6188
+ if (b(null), x.parsed) {
6189
6189
  const _ = Kd(x.parsed, c);
6190
6190
  g(_);
6191
6191
  } else
6192
6192
  g("");
6193
6193
  else
6194
- w(x.error), g("");
6194
+ b(x.error), g("");
6195
6195
  }, [e, c]);
6196
6196
  const S = () => {
6197
6197
  const x = Qa(e);
@@ -6200,7 +6200,7 @@ const $d = () => {
6200
6200
  t(_);
6201
6201
  }
6202
6202
  }, O = () => {
6203
- m != null && m.position && b.current && (b.current.focus(), b.current.setSelectionRange(m.position, m.position + 1));
6203
+ m != null && m.position && w.current && (w.current.focus(), w.current.setSelectionRange(m.position, m.position + 1));
6204
6204
  };
6205
6205
  return /* @__PURE__ */ a("div", { className: "space-y-2", children: /* @__PURE__ */ o(Lr, { value: u, onValueChange: h, className: "w-full", children: [
6206
6206
  /* @__PURE__ */ o("div", { className: "mb-2 flex items-center justify-between", children: [
@@ -6248,7 +6248,7 @@ const $d = () => {
6248
6248
  /* @__PURE__ */ a(
6249
6249
  un,
6250
6250
  {
6251
- ref: b,
6251
+ ref: w,
6252
6252
  id: l,
6253
6253
  name: l,
6254
6254
  className: `rounded-md border border-input text-xs ${m ? "border-red-500" : ""}`,
@@ -6305,8 +6305,8 @@ const $d = () => {
6305
6305
  value: d,
6306
6306
  newCursorPos: u
6307
6307
  };
6308
- }, bi = () => {
6309
- const { t: e } = Rl(), [, t] = Ss(), { data: n } = Ue(), { data: s } = si(), { data: r, isFetching: i } = $d(), l = r == null ? void 0 : r.seo, c = tt(null), d = n == null ? void 0 : n.pageType, u = ai(d), { selectedLang: h, fallbackLang: m } = qe(), w = h || m, [y, g] = A(!1), [b, p] = A(!1), [N, S] = A({
6308
+ }, wi = () => {
6309
+ const { t: e } = Rl(), [, t] = Ss(), { data: n } = Ue(), { data: s } = si(), { data: r, isFetching: i } = $d(), l = r == null ? void 0 : r.seo, c = tt(null), d = n == null ? void 0 : n.pageType, u = ai(d), { selectedLang: h, fallbackLang: m } = qe(), b = h || m, [y, g] = A(!1), [w, p] = A(!1), [N, S] = A({
6310
6310
  keyword: "",
6311
6311
  title: "",
6312
6312
  description: "",
@@ -6321,7 +6321,7 @@ const $d = () => {
6321
6321
  searchDescription: "",
6322
6322
  jsonLD: "{}",
6323
6323
  ...l
6324
- }), O = tt({ initial: N, updated: N }), { mutate: x, isPending: _ } = Ta(), G = _ || y || b, { hasPermission: W } = mn(), F = W(Te.EDIT_SEO);
6324
+ }), O = tt({ initial: N, updated: N }), { mutate: x, isPending: _ } = Ta(), G = _ || y || w, { hasPermission: W } = mn(), F = W(Te.EDIT_SEO);
6325
6325
  de(() => {
6326
6326
  !i && l && S({
6327
6327
  title: "",
@@ -6339,10 +6339,10 @@ const $d = () => {
6339
6339
  });
6340
6340
  }, [i, l]);
6341
6341
  const te = async () => {
6342
- if (!(!u || !w))
6342
+ if (!(!u || !b))
6343
6343
  try {
6344
6344
  g(!0);
6345
- const P = _n(u, w), B = {
6345
+ const P = _n(u, b), B = {
6346
6346
  ...N,
6347
6347
  keyword: V(P, "seo.keyword", ""),
6348
6348
  title: V(P, "seo.title", ""),
@@ -6361,10 +6361,10 @@ const $d = () => {
6361
6361
  g(!1);
6362
6362
  }
6363
6363
  }, j = async () => {
6364
- if (!(!u || !w))
6364
+ if (!(!u || !b))
6365
6365
  try {
6366
6366
  p(!0);
6367
- const P = _n(u, w), B = {
6367
+ const P = _n(u, b), B = {
6368
6368
  ...N,
6369
6369
  jsonLD: V(P, "seo.jsonLD", "")
6370
6370
  };
@@ -6716,7 +6716,7 @@ const $d = () => {
6716
6716
  type: "button",
6717
6717
  onClick: j,
6718
6718
  disabled: G || !F || !u,
6719
- children: e(b ? "Resetting..." : "Reset to Default")
6719
+ children: e(w ? "Resetting..." : "Reset to Default")
6720
6720
  }
6721
6721
  ) }),
6722
6722
  /* @__PURE__ */ o("div", { className: "space-y-1", children: [
@@ -6769,23 +6769,23 @@ const $d = () => {
6769
6769
  ] })
6770
6770
  ] });
6771
6771
  };
6772
- bi.displayName = "SeoPanel";
6773
- const wi = "seo", Qd = ({ isActive: e, show: t }) => {
6772
+ wi.displayName = "SeoPanel";
6773
+ const bi = "seo", Qd = ({ isActive: e, show: t }) => {
6774
6774
  const { data: n } = Ue(), s = ai(n == null ? void 0 : n.pageType);
6775
6775
  return !Le(s, "hasSlug") || !s.hasSlug ? null : /* @__PURE__ */ a(C, { size: "sm", className: "my-1", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ o("svg", { className: "h-4 w-4", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 21 21", fill: "currentColor", children: [
6776
6776
  /* @__PURE__ */ a("path", { d: "M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249" }),
6777
6777
  /* @__PURE__ */ a("path", { d: "M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z" })
6778
6778
  ] }) });
6779
6779
  }, Yd = {
6780
- id: wi,
6780
+ id: bi,
6781
6781
  label: "SEO & JSON-LD",
6782
- panel: bi,
6782
+ panel: wi,
6783
6783
  button: Qd,
6784
6784
  position: "top",
6785
6785
  width: 600,
6786
6786
  view: "modal"
6787
6787
  }, Jd = "user-info", Xd = () => {
6788
- const { user: e, logout: t } = it(), n = ke(), s = bt("onLogout", wl);
6788
+ const { user: e, logout: t } = it(), n = ke(), s = wt("onLogout", bl);
6789
6789
  return e ? /* @__PURE__ */ o(Xl, { children: [
6790
6790
  /* @__PURE__ */ a(Zl, { asChild: !0, children: /* @__PURE__ */ a(C, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ a(ko, { className: "w-4 h-4" }) }) }),
6791
6791
  /* @__PURE__ */ o(eo, { className: "w-auto p-4 space-y-2", children: [
@@ -6793,8 +6793,8 @@ const wi = "seo", Qd = ({ isActive: e, show: t }) => {
6793
6793
  /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: e.email }),
6794
6794
  /* @__PURE__ */ o(yr, { children: [
6795
6795
  /* @__PURE__ */ a(vr, { asChild: !0, children: /* @__PURE__ */ a(C, { variant: "outline", size: "sm", className: "w-full", children: "Logout" }) }),
6796
- /* @__PURE__ */ o(br, { children: [
6797
- /* @__PURE__ */ o(wr, { children: [
6796
+ /* @__PURE__ */ o(wr, { children: [
6797
+ /* @__PURE__ */ o(br, { children: [
6798
6798
  /* @__PURE__ */ a(Nr, { children: "Are you sure you want to logout?" }),
6799
6799
  /* @__PURE__ */ a(xr, { children: "You will be redirected to the login page." })
6800
6800
  ] }),
@@ -6820,7 +6820,7 @@ const wi = "seo", Qd = ({ isActive: e, show: t }) => {
6820
6820
  button: Xd,
6821
6821
  position: "bottom"
6822
6822
  }, eu = () => {
6823
- Hs(wi, Yd), Hs(vi, jd), Hs("user-info", Zd);
6823
+ Hs(bi, Yd), Hs(vi, jd), Hs("user-info", Zd);
6824
6824
  };
6825
6825
  var ae = {
6826
6826
  context: void 0,
@@ -6898,7 +6898,7 @@ function ru(e, t, n) {
6898
6898
  let s, r, i;
6899
6899
  arguments.length === 1 ? (s = !0, r = e, i = {}) : (s = e, r = t, i = {});
6900
6900
  let l = null, c = Js, d = null, u = !1, h = "initialValue" in i, m = typeof s == "function" && Qe(s);
6901
- const w = /* @__PURE__ */ new Set(), [y, g] = (i.storage || Oe)(i.initialValue), [b, p] = Oe(void 0), [N, S] = Oe(void 0, {
6901
+ const b = /* @__PURE__ */ new Set(), [y, g] = (i.storage || Oe)(i.initialValue), [w, p] = Oe(void 0), [N, S] = Oe(void 0, {
6902
6902
  equals: !1
6903
6903
  }), [O, x] = Oe(h ? "ready" : "unresolved");
6904
6904
  ae.context && (d = ae.getNextContextId(), i.ssrLoadFrom === "initial" ? c = i.initialValue : ae.load && ae.has(d) && (c = ae.load(d)));
@@ -6912,13 +6912,13 @@ function ru(e, t, n) {
6912
6912
  function G(te, j) {
6913
6913
  ht(() => {
6914
6914
  j === void 0 && g(() => te), x(j !== void 0 ? "errored" : h ? "ready" : "unresolved"), p(j);
6915
- for (const q of w.keys())
6915
+ for (const q of b.keys())
6916
6916
  q.decrement();
6917
- w.clear();
6917
+ b.clear();
6918
6918
  }, !1);
6919
6919
  }
6920
6920
  function W() {
6921
- const te = du, j = y(), q = b();
6921
+ const te = du, j = y(), q = w();
6922
6922
  if (q !== void 0 && !l)
6923
6923
  throw q;
6924
6924
  return Ne && Ne.user, j;
@@ -6950,7 +6950,7 @@ function ru(e, t, n) {
6950
6950
  get: () => O()
6951
6951
  },
6952
6952
  error: {
6953
- get: () => b()
6953
+ get: () => w()
6954
6954
  },
6955
6955
  loading: {
6956
6956
  get() {
@@ -6962,7 +6962,7 @@ function ru(e, t, n) {
6962
6962
  get() {
6963
6963
  if (!h)
6964
6964
  return W();
6965
- const te = b();
6965
+ const te = w();
6966
6966
  if (te && !l)
6967
6967
  throw te;
6968
6968
  return y();
@@ -7257,41 +7257,41 @@ function fu(e, t) {
7257
7257
  };
7258
7258
  }
7259
7259
  var oa = Symbol("fallback");
7260
- function bs(e) {
7260
+ function ws(e) {
7261
7261
  for (let t = 0; t < e.length; t++)
7262
7262
  e[t]();
7263
7263
  }
7264
7264
  function gu(e, t, n = {}) {
7265
7265
  let s = [], r = [], i = [], l = 0, c = t.length > 1 ? [] : null;
7266
- return Ln(() => bs(i)), () => {
7266
+ return Ln(() => ws(i)), () => {
7267
7267
  let d = e() || [], u = d.length, h, m;
7268
7268
  return d[xi], Me(() => {
7269
- let y, g, b, p, N, S, O, x, _;
7269
+ let y, g, w, p, N, S, O, x, _;
7270
7270
  if (u === 0)
7271
- l !== 0 && (bs(i), i = [], s = [], r = [], l = 0, c && (c = [])), n.fallback && (s = [oa], r[0] = Rt((G) => (i[0] = G, n.fallback())), l = 1);
7271
+ l !== 0 && (ws(i), i = [], s = [], r = [], l = 0, c && (c = [])), n.fallback && (s = [oa], r[0] = Rt((G) => (i[0] = G, n.fallback())), l = 1);
7272
7272
  else if (l === 0) {
7273
7273
  for (r = new Array(u), m = 0; m < u; m++)
7274
- s[m] = d[m], r[m] = Rt(w);
7274
+ s[m] = d[m], r[m] = Rt(b);
7275
7275
  l = u;
7276
7276
  } else {
7277
- for (b = new Array(u), p = new Array(u), c && (N = new Array(u)), S = 0, O = Math.min(l, u); S < O && s[S] === d[S]; S++)
7277
+ for (w = new Array(u), p = new Array(u), c && (N = new Array(u)), S = 0, O = Math.min(l, u); S < O && s[S] === d[S]; S++)
7278
7278
  ;
7279
7279
  for (O = l - 1, x = u - 1; O >= S && x >= S && s[O] === d[x]; O--, x--)
7280
- b[x] = r[O], p[x] = i[O], c && (N[x] = c[O]);
7280
+ w[x] = r[O], p[x] = i[O], c && (N[x] = c[O]);
7281
7281
  for (y = /* @__PURE__ */ new Map(), g = new Array(x + 1), m = x; m >= S; m--)
7282
7282
  _ = d[m], h = y.get(_), g[m] = h === void 0 ? -1 : h, y.set(_, m);
7283
7283
  for (h = S; h <= O; h++)
7284
- _ = s[h], m = y.get(_), m !== void 0 && m !== -1 ? (b[m] = r[h], p[m] = i[h], c && (N[m] = c[h]), m = g[m], y.set(_, m)) : i[h]();
7284
+ _ = s[h], m = y.get(_), m !== void 0 && m !== -1 ? (w[m] = r[h], p[m] = i[h], c && (N[m] = c[h]), m = g[m], y.set(_, m)) : i[h]();
7285
7285
  for (m = S; m < u; m++)
7286
- m in b ? (r[m] = b[m], i[m] = p[m], c && (c[m] = N[m], c[m](m))) : r[m] = Rt(w);
7286
+ m in w ? (r[m] = w[m], i[m] = p[m], c && (c[m] = N[m], c[m](m))) : r[m] = Rt(b);
7287
7287
  r = r.slice(0, l = u), s = d.slice(0);
7288
7288
  }
7289
7289
  return r;
7290
7290
  });
7291
- function w(y) {
7291
+ function b(y) {
7292
7292
  if (i[m] = y, c) {
7293
- const [g, b] = Oe(m);
7294
- return c[m] = b, t(d[m], g);
7293
+ const [g, w] = Oe(m);
7294
+ return c[m] = w, t(d[m], g);
7295
7295
  }
7296
7296
  return t(d[m]);
7297
7297
  }
@@ -7299,19 +7299,19 @@ function gu(e, t, n = {}) {
7299
7299
  }
7300
7300
  function pu(e, t, n = {}) {
7301
7301
  let s = [], r = [], i = [], l = [], c = 0, d;
7302
- return Ln(() => bs(i)), () => {
7302
+ return Ln(() => ws(i)), () => {
7303
7303
  const u = e() || [], h = u.length;
7304
7304
  return u[xi], Me(() => {
7305
7305
  if (h === 0)
7306
- return c !== 0 && (bs(i), i = [], s = [], r = [], c = 0, l = []), n.fallback && (s = [oa], r[0] = Rt((w) => (i[0] = w, n.fallback())), c = 1), r;
7306
+ return c !== 0 && (ws(i), i = [], s = [], r = [], c = 0, l = []), n.fallback && (s = [oa], r[0] = Rt((b) => (i[0] = b, n.fallback())), c = 1), r;
7307
7307
  for (s[0] === oa && (i[0](), i = [], s = [], r = [], c = 0), d = 0; d < h; d++)
7308
7308
  d < s.length && s[d] !== u[d] ? l[d](() => u[d]) : d >= s.length && (r[d] = Rt(m));
7309
7309
  for (; d < s.length; d++)
7310
7310
  i[d]();
7311
7311
  return c = l.length = i.length = h, s = u.slice(0), r = r.slice(0, c);
7312
7312
  });
7313
- function m(w) {
7314
- i[d] = w;
7313
+ function m(b) {
7314
+ i[d] = b;
7315
7315
  const [y, g] = Oe(u[d]);
7316
7316
  return l[d] = g, t(y, d);
7317
7317
  }
@@ -7406,8 +7406,8 @@ function Ii(...e) {
7406
7406
  get: yu.bind(n[h] = [m.get.bind(c)])
7407
7407
  } : m.value !== void 0 ? m : void 0;
7408
7408
  else {
7409
- const w = n[h];
7410
- w && (m.get ? w.push(m.get.bind(c)) : m.value !== void 0 && w.push(() => m.value));
7409
+ const b = n[h];
7410
+ b && (m.get ? b.push(m.get.bind(c)) : m.value !== void 0 && b.push(() => m.value));
7411
7411
  }
7412
7412
  }
7413
7413
  }
@@ -7488,9 +7488,9 @@ function Di(e) {
7488
7488
  };
7489
7489
  return s.preload = () => n || ((n = e()).then((r) => t = () => r.default), n), s;
7490
7490
  }
7491
- var bu = 0;
7491
+ var wu = 0;
7492
7492
  function ym() {
7493
- return ae.context ? ae.getNextContextId() : `cl-${bu++}`;
7493
+ return ae.context ? ae.getNextContextId() : `cl-${wu++}`;
7494
7494
  }
7495
7495
  var Oi = (e) => `Stale read from <${e}>.`;
7496
7496
  function vm(e) {
@@ -7499,13 +7499,13 @@ function vm(e) {
7499
7499
  };
7500
7500
  return Qe(gu(() => e.each, e.children, t || void 0));
7501
7501
  }
7502
- function bm(e) {
7502
+ function wm(e) {
7503
7503
  const t = "fallback" in e && {
7504
7504
  fallback: () => e.fallback
7505
7505
  };
7506
7506
  return Qe(pu(() => e.each, e.children, t || void 0));
7507
7507
  }
7508
- function wm(e) {
7508
+ function bm(e) {
7509
7509
  const t = e.keyed, n = Qe(() => e.when, void 0, {
7510
7510
  equals: (s, r) => t ? s === r : !s == !r
7511
7511
  });
@@ -7571,7 +7571,7 @@ function Nm(e) {
7571
7571
  function xm(e) {
7572
7572
  return e;
7573
7573
  }
7574
- var wu = [
7574
+ var bu = [
7575
7575
  "allowfullscreen",
7576
7576
  "async",
7577
7577
  "autofocus",
@@ -7605,7 +7605,7 @@ var wu = [
7605
7605
  "isMap",
7606
7606
  "noModule",
7607
7607
  "playsInline",
7608
- ...wu
7608
+ ...bu
7609
7609
  ]), xu = /* @__PURE__ */ new Set([
7610
7610
  "innerHTML",
7611
7611
  "textContent",
@@ -7777,10 +7777,10 @@ function ku(e, t, n) {
7777
7777
  const h = u.get(t[l]);
7778
7778
  if (h != null)
7779
7779
  if (c < h && h < i) {
7780
- let m = l, w = 1, y;
7781
- for (; ++m < r && m < i && !((y = u.get(t[m])) == null || y !== h + w); )
7782
- w++;
7783
- if (w > h - c) {
7780
+ let m = l, b = 1, y;
7781
+ for (; ++m < r && m < i && !((y = u.get(t[m])) == null || y !== h + b); )
7782
+ b++;
7783
+ if (b > h - c) {
7784
7784
  const g = t[l];
7785
7785
  for (; c < h; )
7786
7786
  e.insertBefore(n[c++], g);
@@ -7927,18 +7927,18 @@ function er(e, t, n, s, r, i, l) {
7927
7927
  if (t === "ref")
7928
7928
  i || n(e);
7929
7929
  else if (t.slice(0, 3) === "on:") {
7930
- const w = t.slice(3);
7931
- s && e.removeEventListener(w, s, typeof s != "function" && s), n && e.addEventListener(w, n, typeof n != "function" && n);
7930
+ const b = t.slice(3);
7931
+ s && e.removeEventListener(b, s, typeof s != "function" && s), n && e.addEventListener(b, n, typeof n != "function" && n);
7932
7932
  } else if (t.slice(0, 10) === "oncapture:") {
7933
- const w = t.slice(10);
7934
- s && e.removeEventListener(w, s, !0), n && e.addEventListener(w, n, !0);
7933
+ const b = t.slice(10);
7934
+ s && e.removeEventListener(b, s, !0), n && e.addEventListener(b, n, !0);
7935
7935
  } else if (t.slice(0, 2) === "on") {
7936
- const w = t.slice(2).toLowerCase(), y = Tu.has(w);
7936
+ const b = t.slice(2).toLowerCase(), y = Tu.has(b);
7937
7937
  if (!y && s) {
7938
7938
  const g = Array.isArray(s) ? s[0] : s;
7939
- e.removeEventListener(w, g);
7939
+ e.removeEventListener(b, g);
7940
7940
  }
7941
- (y || n) && (Ou(e, w, n, y), y && _u([w]));
7941
+ (y || n) && (Ou(e, b, n, y), y && _u([b]));
7942
7942
  } else if (t.slice(0, 5) === "attr:")
7943
7943
  da(e, t.slice(5), n);
7944
7944
  else if (t.slice(0, 5) === "bool:")
@@ -7950,8 +7950,8 @@ function er(e, t, n, s, r, i, l) {
7950
7950
  return n;
7951
7951
  t === "class" || t === "className" ? Du(e, n) : c && !d && !u ? e[ju(t)] = n : e[h || t] = n;
7952
7952
  } else {
7953
- const w = r && t.indexOf(":") > -1 && Pu[t.split(":")[0]];
7954
- w ? Lu(e, w, t, n) : da(e, Eu[t] || t, n);
7953
+ const b = r && t.indexOf(":") > -1 && Pu[t.split(":")[0]];
7954
+ b ? Lu(e, b, t, n) : da(e, Eu[t] || t, n);
7955
7955
  }
7956
7956
  return n;
7957
7957
  }
@@ -8558,19 +8558,19 @@ var Yi = (e, t, n, s, r = [], i = [], l = /* @__PURE__ */ new Map()) => {
8558
8558
  hn(u, (y, g) => {
8559
8559
  if (g === "__proto__" || g === "constructor" || g === "prototype")
8560
8560
  throw new Error(`Detected property ${g}. This is a prototype pollution risk, please remove it from your object.`);
8561
- const b = Yi(y, t, n, s, [...r, g], [...i, e], l);
8562
- h[g] = b.transformedValue, St(b.annotations) ? m[g] = b.annotations : On(b.annotations) && hn(b.annotations, (p, N) => {
8561
+ const w = Yi(y, t, n, s, [...r, g], [...i, e], l);
8562
+ h[g] = w.transformedValue, St(w.annotations) ? m[g] = w.annotations : On(w.annotations) && hn(w.annotations, (p, N) => {
8563
8563
  m[ji(g) + "." + N] = p;
8564
8564
  });
8565
8565
  });
8566
- const w = ma(m) ? {
8566
+ const b = ma(m) ? {
8567
8567
  transformedValue: h,
8568
8568
  annotations: d ? [d.type] : void 0
8569
8569
  } : {
8570
8570
  transformedValue: h,
8571
8571
  annotations: d ? [d.type, m] : m
8572
8572
  };
8573
- return c || l.set(e, w), w;
8573
+ return c || l.set(e, b), b;
8574
8574
  };
8575
8575
  function Ji(e) {
8576
8576
  return Object.prototype.toString.call(e).slice(8, -1);
@@ -8663,7 +8663,7 @@ Ee.registerClass = Ee.defaultInstance.registerClass.bind(Ee.defaultInstance);
8663
8663
  Ee.registerSymbol = Ee.defaultInstance.registerSymbol.bind(Ee.defaultInstance);
8664
8664
  Ee.registerCustom = Ee.defaultInstance.registerCustom.bind(Ee.defaultInstance);
8665
8665
  Ee.allowErrorProps = Ee.defaultInstance.allowErrorProps.bind(Ee.defaultInstance);
8666
- var bh = Ee.serialize, Cm = Ee.stringify;
8666
+ var wh = Ee.serialize, Cm = Ee.stringify;
8667
8667
  function Pm(e) {
8668
8668
  return e.state.fetchStatus === "fetching" ? "fetching" : e.getObserversCount() ? e.state.fetchStatus === "paused" ? "paused" : e.isStale() ? "stale" : "fresh" : "inactive";
8669
8669
  }
@@ -8689,11 +8689,11 @@ function Im(e) {
8689
8689
  var Dm = (e, t = !1) => {
8690
8690
  const {
8691
8691
  json: n
8692
- } = bh(e);
8692
+ } = wh(e);
8693
8693
  return JSON.stringify(n, null, t ? 2 : void 0);
8694
- }, as = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, wh = (e, t) => e.queryHash.localeCompare(t.queryHash), Xi = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Nh = (e, t) => as(e) === as(t) ? Xi(e, t) : as(e) > as(t) ? 1 : -1, Om = {
8694
+ }, as = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, bh = (e, t) => e.queryHash.localeCompare(t.queryHash), Xi = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Nh = (e, t) => as(e) === as(t) ? Xi(e, t) : as(e) > as(t) ? 1 : -1, Om = {
8695
8695
  status: Nh,
8696
- "query hash": wh,
8696
+ "query hash": bh,
8697
8697
  "last updated": Xi
8698
8698
  }, rs = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, Zi = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, xh = (e, t) => rs(e) === rs(t) ? Zi(e, t) : rs(e) > rs(t) ? 1 : -1, Gm = {
8699
8699
  status: xh,
@@ -8775,19 +8775,19 @@ var Dm = (e, t = !1) => {
8775
8775
  s.appendChild(r), s.id = "_goober", s.setAttribute("nonce", e), t ? t.appendChild(s) : document.head.appendChild(s);
8776
8776
  }, Kt, Un, Bn, Mn, Dt, Fn, Ht, Wt, Qt, Yt, Jt, Xt, jn, or, Eh = (or = class {
8777
8777
  constructor(e) {
8778
- we(this, Kt);
8779
- we(this, Un);
8780
- we(this, Bn);
8781
- we(this, Mn);
8782
- we(this, Dt, !1);
8783
- we(this, Fn);
8784
- we(this, Ht);
8785
- we(this, Wt);
8786
- we(this, Qt);
8787
- we(this, Yt);
8788
- we(this, Jt);
8789
- we(this, Xt);
8790
- we(this, jn);
8778
+ be(this, Kt);
8779
+ be(this, Un);
8780
+ be(this, Bn);
8781
+ be(this, Mn);
8782
+ be(this, Dt, !1);
8783
+ be(this, Fn);
8784
+ be(this, Ht);
8785
+ be(this, Wt);
8786
+ be(this, Qt);
8787
+ be(this, Yt);
8788
+ be(this, Jt);
8789
+ be(this, Xt);
8790
+ be(this, jn);
8791
8791
  const {
8792
8792
  client: t,
8793
8793
  queryFlavor: n,
@@ -8823,7 +8823,7 @@ var Dm = (e, t = !1) => {
8823
8823
  const t = Gi(() => {
8824
8824
  const n = this, [s] = Z(this, Wt), [r] = Z(this, Qt), [i] = Z(this, Yt), [l] = Z(this, Jt), [c] = Z(this, Kt);
8825
8825
  let d;
8826
- return Z(this, Xt) ? d = Z(this, Xt) : (d = Di(() => import("./HO4MOOFI-ZEMHxM7X.js")), ye(this, Xt, d)), el(Z(this, Fn), Z(this, Ht)), Li(d, Ii({
8826
+ return Z(this, Xt) ? d = Z(this, Xt) : (d = Di(() => import("./HO4MOOFI-Cueri-LI.js")), ye(this, Xt, d)), el(Z(this, Fn), Z(this, Ht)), Li(d, Ii({
8827
8827
  get queryFlavor() {
8828
8828
  return Z(n, Bn);
8829
8829
  },
@@ -8864,20 +8864,20 @@ var Dm = (e, t = !1) => {
8864
8864
  }
8865
8865
  }, Kt = new WeakMap(), Un = new WeakMap(), Bn = new WeakMap(), Mn = new WeakMap(), Dt = new WeakMap(), Fn = new WeakMap(), Ht = new WeakMap(), Wt = new WeakMap(), Qt = new WeakMap(), Yt = new WeakMap(), Jt = new WeakMap(), Xt = new WeakMap(), jn = new WeakMap(), or), Zt, $n, qn, zn, Ot, Vn, en, tn, nn, sn, an, rn, ln, Kn, cr, Sh = (cr = class {
8866
8866
  constructor(e) {
8867
- we(this, Zt);
8868
- we(this, $n);
8869
- we(this, qn);
8870
- we(this, zn);
8871
- we(this, Ot, !1);
8872
- we(this, Vn);
8873
- we(this, en);
8874
- we(this, tn);
8875
- we(this, nn);
8876
- we(this, sn);
8877
- we(this, an);
8878
- we(this, rn);
8879
- we(this, ln);
8880
- we(this, Kn);
8867
+ be(this, Zt);
8868
+ be(this, $n);
8869
+ be(this, qn);
8870
+ be(this, zn);
8871
+ be(this, Ot, !1);
8872
+ be(this, Vn);
8873
+ be(this, en);
8874
+ be(this, tn);
8875
+ be(this, nn);
8876
+ be(this, sn);
8877
+ be(this, an);
8878
+ be(this, rn);
8879
+ be(this, ln);
8880
+ be(this, Kn);
8881
8881
  const {
8882
8882
  client: t,
8883
8883
  queryFlavor: n,
@@ -8917,7 +8917,7 @@ var Dm = (e, t = !1) => {
8917
8917
  const t = Gi(() => {
8918
8918
  const n = this, [s] = Z(this, tn), [r] = Z(this, nn), [i] = Z(this, sn), [l] = Z(this, an), [c] = Z(this, Zt), [d] = Z(this, rn);
8919
8919
  let u;
8920
- return Z(this, ln) ? u = Z(this, ln) : (u = Di(() => import("./HUY7CZI3-sbFYeEgU.js")), ye(this, ln, u)), el(Z(this, Vn), Z(this, en)), Li(u, Ii({
8920
+ return Z(this, ln) ? u = Z(this, ln) : (u = Di(() => import("./HUY7CZI3-CrBwmWq4.js")), ye(this, ln, u)), el(Z(this, Vn), Z(this, en)), Li(u, Ii({
8921
8921
  get queryFlavor() {
8922
8922
  return Z(n, qn);
8923
8923
  },
@@ -9139,7 +9139,7 @@ const Gh = (e) => {
9139
9139
  }
9140
9140
  } = Od();
9141
9141
  Dd(), nc();
9142
- const { data: l, isFetching: c } = ni(), { blocks: d } = Id(l), { data: u } = Fe(), { mutateAsync: h } = Kr(), m = _d(), { onSave: w } = Gd(), { getPartialBlocks: y, getPartialBlockBlocks: g } = Rd(), { aiContext: b, setAiContext: p } = Ea(), { mutateAsync: N } = bc(), [S, O] = A(!1), { data: x } = At(), _ = ti(), { data: G } = si(), { data: W } = kh(), { mutateAsync: F } = _h(), te = Lh();
9142
+ const { data: l, isFetching: c } = ni(), { blocks: d } = Id(l), { data: u } = Fe(), { mutateAsync: h } = Kr(), m = _d(), { onSave: b } = Gd(), { getPartialBlocks: y, getPartialBlockBlocks: g } = Rd(), { aiContext: w, setAiContext: p } = Ea(), { mutateAsync: N } = wc(), [S, O] = A(!1), { data: x } = At(), _ = ti(), { data: G } = si(), { data: W } = kh(), { mutateAsync: F } = _h(), te = Lh();
9143
9143
  Qo(), de(() => {
9144
9144
  const z = () => {
9145
9145
  document.hidden ? O(!0) : O(!1);
@@ -9186,18 +9186,18 @@ const Gh = (e) => {
9186
9186
  _type: "@chai/ai-context",
9187
9187
  _value: Ma(z) ? z : ""
9188
9188
  }, B = [...X, P];
9189
- return await w({ page: s, blocks: B }), p(z), !0;
9189
+ return await b({ page: s, blocks: B }), p(z), !0;
9190
9190
  },
9191
- aiContext: b,
9191
+ aiContext: w,
9192
9192
  askAiCallBack: m,
9193
9193
  onSave: async ({ blocks: z, theme: X }) => {
9194
9194
  if (!s) return !0;
9195
9195
  t.current = z;
9196
9196
  const P = {
9197
9197
  _type: "@chai/ai-context",
9198
- _value: Ma(b) ? b : ""
9198
+ _value: Ma(w) ? w : ""
9199
9199
  }, B = [...z, P];
9200
- return await w({ page: s, blocks: B }), t.current = B, ya(X, ee) || await h({ settings: { theme: X } }), !0;
9200
+ return await b({ page: s, blocks: B }), t.current = B, ya(X, ee) || await h({ settings: { theme: X } }), !0;
9201
9201
  },
9202
9202
  themePanelComponent: Pc,
9203
9203
  ...j
@@ -9378,12 +9378,12 @@ const qh = ({
9378
9378
  onSave: s,
9379
9379
  isSaving: r
9380
9380
  }) => {
9381
- var m, w, y;
9382
- const { data: i, isLoading: l, isError: c } = jh(e || ""), [d, u] = A(""), h = async (g, b) => {
9381
+ var m, b, y;
9382
+ const { data: i, isLoading: l, isError: c } = jh(e || ""), [d, u] = A(""), h = async (g, w) => {
9383
9383
  try {
9384
- await navigator.clipboard.writeText(g), K.success(`${b} copied to clipboard`);
9384
+ await navigator.clipboard.writeText(g), K.success(`${w} copied to clipboard`);
9385
9385
  } catch (p) {
9386
- K.error(`Failed to copy ${b}`, {
9386
+ K.error(`Failed to copy ${w}`, {
9387
9387
  description: p == null ? void 0 : p.message
9388
9388
  });
9389
9389
  }
@@ -9465,7 +9465,7 @@ const qh = ({
9465
9465
  { label: "Type", value: i.type, capitalize: !0 },
9466
9466
  {
9467
9467
  label: "Format",
9468
- value: ((w = i.metadata) == null ? void 0 : w.format) || i.type,
9468
+ value: ((b = i.metadata) == null ? void 0 : b.format) || i.type,
9469
9469
  capitalize: !0
9470
9470
  },
9471
9471
  {
@@ -9517,14 +9517,14 @@ const qh = ({
9517
9517
  ] }),
9518
9518
  i.usedOn && i.usedOn.length > 0 && /* @__PURE__ */ o("div", { className: "grid gap-3", children: [
9519
9519
  /* @__PURE__ */ a(oe, { children: "Used On" }),
9520
- /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-2 text-sm border rounded-md p-2", children: i.usedOn.map((g, b) => /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
9520
+ /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-2 text-sm border rounded-md p-2", children: i.usedOn.map((g, w) => /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
9521
9521
  /* @__PURE__ */ a("div", { className: "w-max text-left font-medium text-gray-900", children: g.name }),
9522
9522
  /* @__PURE__ */ o("div", { className: "text-gray-500", children: [
9523
9523
  "(",
9524
9524
  g.slug,
9525
9525
  ")"
9526
9526
  ] })
9527
- ] }, b)) })
9527
+ ] }, w)) })
9528
9528
  ] }),
9529
9529
  /* @__PURE__ */ o("div", { className: "grid gap-3 border rounded-md pt-2 bg-gray-100 relative", children: [
9530
9530
  /* @__PURE__ */ a(oe, { className: "w-full text-center", children: "Description" }),
@@ -9578,7 +9578,7 @@ const Kh = ({
9578
9578
  localStorage.setItem("chai_optimize_images", l.toString());
9579
9579
  }, [l]);
9580
9580
  const d = e || r, u = ie(
9581
- async (y) => new Promise((g, b) => {
9581
+ async (y) => new Promise((g, w) => {
9582
9582
  const p = y[0], N = new FileReader();
9583
9583
  N.readAsDataURL(p), N.onload = async () => {
9584
9584
  s(
@@ -9593,14 +9593,14 @@ const Kh = ({
9593
9593
  i && i(S), g(S);
9594
9594
  },
9595
9595
  onError: (S) => {
9596
- b(S);
9596
+ w(S);
9597
9597
  }
9598
9598
  }
9599
9599
  );
9600
- }, N.onerror = (S) => b(S);
9600
+ }, N.onerror = (S) => w(S);
9601
9601
  }),
9602
9602
  [s, l, i]
9603
- ), { getRootProps: h, getInputProps: m, isDragActive: w } = Uo({
9603
+ ), { getRootProps: h, getInputProps: m, isDragActive: b } = Uo({
9604
9604
  onDrop: u,
9605
9605
  accept: {
9606
9606
  "image/*": t.includes("image") ? [] : []
@@ -9619,7 +9619,7 @@ const Kh = ({
9619
9619
  className: va(
9620
9620
  "rounded-lg text-center cursor-pointer w-full h-max flex flex-col justify-center",
9621
9621
  d ? "items-start" : "items-center",
9622
- w ? "border-primary bg-primary/5" : "border-muted-foreground/20"
9622
+ b ? "border-primary bg-primary/5" : "border-muted-foreground/20"
9623
9623
  ),
9624
9624
  children: [
9625
9625
  /* @__PURE__ */ a("input", { ...m() }),
@@ -9740,7 +9740,7 @@ function nl({
9740
9740
  mode: n = "image",
9741
9741
  assetId: s
9742
9742
  }) {
9743
- const l = Y(() => [n], [n]), [c, d] = A(null), [u, h] = A(null), [m, w] = A(null), [y, g] = A({ show: !1, file: "" }), [b, p] = A(!1), [N, S] = A(
9743
+ const l = Y(() => [n], [n]), [c, d] = A(null), [u, h] = A(null), [m, b] = A(null), [y, g] = A({ show: !1, file: "" }), [w, p] = A(!1), [N, S] = A(
9744
9744
  s ? "details" : "grid"
9745
9745
  ), [O, x] = A(""), [_, G] = A(""), [W, F] = A(1), [te] = A(30), [j, q] = A([]);
9746
9746
  de(() => {
@@ -9768,7 +9768,7 @@ function nl({
9768
9768
  G(D.target.value);
9769
9769
  }, ue = ie(
9770
9770
  (D) => {
9771
- q((ce) => be(ce, { id: D.id }) ? [] : [D]);
9771
+ q((ce) => we(ce, { id: D.id }) ? [] : [D]);
9772
9772
  },
9773
9773
  [!1]
9774
9774
  ), Ce = ie(() => {
@@ -9786,12 +9786,12 @@ function nl({
9786
9786
  }, Ae = async (D) => {
9787
9787
  h(D);
9788
9788
  }, M = async () => {
9789
- u && (w(u == null ? void 0 : u.id), await v(u.id, {
9789
+ u && (b(u == null ? void 0 : u.id), await v(u.id, {
9790
9790
  onSuccess: () => {
9791
- w(null), h(null);
9791
+ b(null), h(null);
9792
9792
  },
9793
9793
  onError: () => {
9794
- w(null);
9794
+ b(null);
9795
9795
  }
9796
9796
  }), h(null));
9797
9797
  }, se = (D) => {
@@ -10087,7 +10087,7 @@ function nl({
10087
10087
  }
10088
10088
  }
10089
10089
  },
10090
- isSaving: b
10090
+ isSaving: w
10091
10091
  }
10092
10092
  )
10093
10093
  ] }),
@@ -10145,8 +10145,8 @@ const Hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10145
10145
  i || c(!0);
10146
10146
  }, u = () => {
10147
10147
  c(!1);
10148
- }, h = (w) => {
10149
- const y = Array.isArray(w) ? w[0] : w;
10148
+ }, h = (b) => {
10149
+ const y = Array.isArray(b) ? b[0] : b;
10150
10150
  y != null && y.url && n(
10151
10151
  Ns(y, ["url", "id"])
10152
10152
  ), c(!1);
@@ -10251,7 +10251,7 @@ const Hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10251
10251
  body: JSON.stringify(i)
10252
10252
  });
10253
10253
  if (c.status === 401)
10254
- return console.log("Session expired", c), await t(), null;
10254
+ return console.log("Session expired", c), await t(), window.location.reload(), null;
10255
10255
  if (c.status === 400)
10256
10256
  throw new Error((await c.json()).error);
10257
10257
  return await c.json();
@@ -10342,8 +10342,8 @@ export {
10342
10342
  Me as E,
10343
10343
  vm as F,
10344
10344
  su as G,
10345
- bh as H,
10346
- bm as I,
10345
+ wh as H,
10346
+ wm as I,
10347
10347
  is as J,
10348
10348
  Rm as K,
10349
10349
  km as L,
@@ -10353,7 +10353,7 @@ export {
10353
10353
  Am as P,
10354
10354
  Cm as Q,
10355
10355
  xm as R,
10356
- wm as S,
10356
+ bm as S,
10357
10357
  Nm as T,
10358
10358
  ls as U,
10359
10359
  fm as V,
@@ -10372,7 +10372,7 @@ export {
10372
10372
  Hd as a6,
10373
10373
  dm as a7,
10374
10374
  Ue as a8,
10375
- wt as a9,
10375
+ bt as a9,
10376
10376
  Us as aa,
10377
10377
  At as ab,
10378
10378
  it as ac,