@chaibuilder/pages 0.4.20-beta.1 → 0.4.20-beta.2

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,20 +4,20 @@ var Ds = (e) => {
4
4
  var Gs = (e, t, n) => t.has(e) || Ds("Cannot " + n);
5
5
  var M = (e, t, n) => (Gs(e, t, "read from private field"), n ? n.call(e) : t.get(e)), oe = (e, t, n) => t.has(e) ? Ds("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), le = (e, t, n, s) => (Gs(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
6
6
  import { jsx as r, jsxs as u, Fragment as Ee } from "react/jsx-runtime";
7
- import { get as $, isEmpty as he, reverse as Ba, sortBy as Ma, each as Fa, find as ye, set as qa, has as Je, startsWith as Bt, isEqual as is, map as Be, toLower as Rt, trim as ja, filter as be, startCase as qt, groupBy as Ha, compact as Nn, includes as jt, endsWith as er, orderBy as mn, first as Ka, concat as Va, uniq as za, debounce as $a, pick as tr, keys as Wa, pickBy as Ya, isArray as Qa, noop as Xa, isFunction as Za, cloneDeep as Ja, isString as Rs } from "lodash-es";
7
+ import { get as $, isEmpty as de, reverse as Ba, sortBy as Ma, each as Fa, find as ye, set as qa, has as Je, startsWith as Bt, isEqual as is, map as Be, toLower as Ut, trim as Ha, filter as be, startCase as qt, groupBy as ja, compact as Nn, includes as Ht, endsWith as er, orderBy as mn, first as Ka, concat as Va, uniq as za, debounce as $a, pick as tr, keys as Wa, pickBy as Ya, isArray as Qa, noop as Xa, isFunction as Za, cloneDeep as Ja, isString as Us } from "lodash-es";
8
8
  import * as fe from "react";
9
- import nr, { useCallback as Te, useMemo as W, useState as I, useEffect as Ne, useRef as dt, Suspense as ei, lazy as ti } from "react";
9
+ import nr, { useCallback as _e, useState as I, useEffect as Ne, useRef as ut, useMemo as J, Suspense as ei, lazy as ti } from "react";
10
10
  import { useAtom as Dn, atom as ls } from "jotai";
11
- import { useQueryClient as Ae, useMutation as _e, useQuery as ke, onlineManager as sr, QueryClient as ni, QueryClientProvider as si } from "@tanstack/react-query";
11
+ import { useQueryClient as Ae, useMutation as Pe, useQuery as ke, onlineManager as sr, QueryClient as ni, QueryClientProvider as si } from "@tanstack/react-query";
12
12
  import { toast as te } from "sonner";
13
- import { useLanguages as ht, useUpdateBlocksPropsRealtime as rr, PERMISSIONS as ri, usePartailBlocksStore as ai, usePermissions as Lt, useLibraryBlocks as ii, useTheme as li, useSavePage as os, mergeClasses as oi, useRightPanel as ci, useBlocksStore as ui, getBlocksFromHTML as di, useTranslation as hi, useSidebarActivePanel as mi, registerChaiSidebarPanel as $n, registerChaiTopBar as fi, registerChaiMediaManager as gi, registerChaiSaveToLibrary as pi, ChaiBuilderEditor as yi } from "@chaibuilder/sdk";
14
- import { Card as cs, CardHeader as us, CardTitle as ds, CardContent as hs, CardFooter as ms, Button as P, AlertDialog as ar, AlertDialogTrigger as ir, AlertDialogContent as lr, AlertDialogHeader as or, AlertDialogTitle as cr, AlertDialogDescription as ur, AlertDialogFooter as dr, AlertDialogCancel as hr, AlertDialogAction as mr, Popover as fr, PopoverTrigger as gr, PopoverContent as pr, Input as we, Label as ae, Dialog as He, DialogContent as Ke, DialogHeader as Ve, DialogTitle as ze, DialogDescription as Qe, Alert as yr, DialogFooter as tt, DropdownMenu as an, DropdownMenuTrigger as ln, DropdownMenuContent as on, DropdownMenuItem as Ge, Textarea as Ut, Select as vi, SelectTrigger as Ei, SelectValue as bi, SelectContent as wi, SelectItem as Fn, Badge as qn, Sheet as vr, SheetContent as Er, SheetHeader as br, SheetTitle as wr, SheetDescription as Si, Separator as Ni, TooltipProvider as Sr, Tooltip as fs, SheetTrigger as Ai, TooltipTrigger as gs, ScrollArea as xi, TooltipContent as ps, Skeleton as fn, DropdownMenuSeparator as Ti, CardDescription as Ci, Command as Pi, CommandInput as _i, CommandList as Ii, CommandEmpty as ki, CommandGroup as Li, CommandItem as Us, AlertDescription as Di, Accordion as Gi, AccordionItem as gn, AccordionTrigger as pn, AccordionContent as yn, HoverCard as Ri, HoverCardTrigger as Ui, HoverCardContent as Oi } from "@chaibuilder/sdk/ui";
15
- import { LockIcon as Nr, UserIcon as Bi, AlertTriangleIcon as Mi, Trash2 as Ar, Plus as ys, ImageIcon as xr, X as Tr, AlertCircle as Cr, StarIcon as Fi, MoreHorizontal as vs, PencilIcon as qi, Power as Pr, TrashIcon as ji, Tag as Hi, File as cn, Search as Ki, StarsIcon as Vi, Globe as zi, Pencil as $i, Trash as Es, SquareLibrary as Os, Logs as Wi, Loader as _r, Languages as Yi, ChevronDown as Ir, Star as Qi, History as Bs, ArrowUpRight as Xi, Clock as Zi, Undo2 as kr, CloudOff as Ji, Edit as el, Save as Lr, GlobeIcon as tl, Eye as Dr, Palette as nl, CheckCircle as sl, Send as Ms, Rocket as Fs, Settings as rl, ExternalLink as al, EyeOff as il, Loader2 as Gr, LanguagesIcon as ll, DatabaseIcon as ol, ChevronLeft as cl, ChevronRight as ul, User as dl } from "lucide-react";
13
+ import { useLanguages as dt, useUpdateBlocksPropsRealtime as rr, PERMISSIONS as ri, usePartailBlocksStore as ai, usePermissions as Lt, useLibraryBlocks as ii, useTheme as li, useSavePage as os, mergeClasses as oi, useRightPanel as ci, useBlocksStore as ui, getBlocksFromHTML as di, useTranslation as hi, useSidebarActivePanel as mi, registerChaiSidebarPanel as $n, registerChaiTopBar as fi, registerChaiMediaManager as gi, registerChaiSaveToLibrary as pi, ChaiBuilderEditor as yi } from "@chaibuilder/sdk";
14
+ import { Card as cs, CardHeader as us, CardTitle as ds, CardContent as hs, CardFooter as ms, Button as P, AlertDialog as ar, AlertDialogTrigger as ir, AlertDialogContent as lr, AlertDialogHeader as or, AlertDialogTitle as cr, AlertDialogDescription as ur, AlertDialogFooter as dr, AlertDialogCancel as hr, AlertDialogAction as mr, Popover as fr, PopoverTrigger as gr, PopoverContent as pr, Input as we, Label as ae, Dialog as je, DialogContent as Ke, DialogHeader as Ve, DialogTitle as ze, DialogDescription as Qe, Alert as yr, DialogFooter as tt, DropdownMenu as an, DropdownMenuTrigger as ln, DropdownMenuContent as on, DropdownMenuItem as Ge, Textarea as Rt, Select as vi, SelectTrigger as Ei, SelectValue as bi, SelectContent as wi, SelectItem as Fn, Badge as qn, Sheet as vr, SheetContent as Er, SheetHeader as br, SheetTitle as wr, SheetDescription as Si, Separator as Ni, TooltipProvider as Sr, Tooltip as fs, SheetTrigger as Ai, TooltipTrigger as gs, ScrollArea as xi, TooltipContent as ps, Skeleton as fn, DropdownMenuSeparator as Ti, CardDescription as Ci, Command as _i, CommandInput as Pi, CommandList as Ii, CommandEmpty as ki, CommandGroup as Li, CommandItem as Rs, AlertDescription as Di, Accordion as Gi, AccordionItem as gn, AccordionTrigger as pn, AccordionContent as yn, HoverCard as Ui, HoverCardTrigger as Ri, HoverCardContent as Oi } from "@chaibuilder/sdk/ui";
15
+ import { LockIcon as Nr, UserIcon as Bi, AlertTriangleIcon as Mi, Trash2 as Ar, Plus as ys, ImageIcon as xr, X as Tr, AlertCircle as Cr, StarIcon as Fi, MoreHorizontal as vs, PencilIcon as qi, Power as _r, TrashIcon as Hi, Tag as ji, File as cn, Search as Ki, StarsIcon as Vi, Globe as zi, Pencil as $i, Trash as Es, SquareLibrary as Os, Logs as Wi, Loader as Pr, Languages as Yi, ChevronDown as Ir, Star as Qi, History as Bs, ArrowUpRight as Xi, Clock as Zi, Undo2 as kr, CloudOff as Ji, Edit as el, Save as Lr, GlobeIcon as tl, Eye as Dr, Palette as nl, CheckCircle as sl, Send as Ms, Rocket as Fs, Settings as rl, ExternalLink as al, EyeOff as il, Loader2 as Gr, LanguagesIcon as ll, DatabaseIcon as ol, ChevronLeft as cl, ChevronRight as ul, User as dl } from "lucide-react";
16
16
  import { format as Gn, formatDistanceToNow as hl } from "date-fns";
17
17
  import { useRegisteredChaiBlocks as ml, getDefaultBlockProps as fl } from "@chaibuilder/runtime";
18
18
  import { z as An } from "zod";
19
19
  import { loadWebBlocks as gl } from "@chaibuilder/sdk/web-blocks";
20
- const je = {
20
+ const He = {
21
21
  ab: "Abkhazian",
22
22
  aa: "Afar",
23
23
  af: "Afrikaans",
@@ -356,12 +356,12 @@ function Nl(e, t, n = Sl, s) {
356
356
  }
357
357
  localStorage.removeItem("_chai_user");
358
358
  localStorage.removeItem("__chai__user");
359
- const Rr = "__logged_in_user", Al = Nl(
360
- Rr,
359
+ const Ur = "__logged_in_user", Al = Nl(
360
+ Ur,
361
361
  null
362
- ), rt = () => {
363
- const [e, t] = Dn(Al), n = Te(() => {
364
- t(null), localStorage.removeItem(Rr);
362
+ ), ht = () => {
363
+ const [e, t] = Dn(Al), n = _e(() => {
364
+ t(null), localStorage.removeItem(Ur);
365
365
  }, [t]);
366
366
  return {
367
367
  isLoggedIn: !!e,
@@ -386,42 +386,9 @@ if (import.meta.vitest) {
386
386
  t(n).toBeDefined();
387
387
  });
388
388
  }
389
- const Ju = () => {
390
- const { user: e } = rt(), t = W(
391
- () => e == null ? void 0 : e.accessToken,
392
- [e == null ? void 0 : e.accessToken]
393
- );
394
- return Te(
395
- async (n, s, a = {}) => {
396
- if (!t)
397
- return console.log("no auth token"), null;
398
- try {
399
- const i = await fetch(n, {
400
- method: "POST",
401
- body: s,
402
- headers: {
403
- ...a,
404
- Authorization: `Bearer ${t}`,
405
- "x-chai-upload": "true"
406
- }
407
- });
408
- if (i.status === 401)
409
- throw new Error("Session expired");
410
- if (i.status === 400)
411
- throw new Error((await i.json()).error);
412
- return await i.json();
413
- } catch (i) {
414
- return console.log("Something went wrong", s, i), null;
415
- }
416
- },
417
- [t]
418
- );
419
- }, ee = () => {
420
- const { user: e, logout: t } = rt(), n = Ae(), s = W(
421
- () => e == null ? void 0 : e.accessToken,
422
- [e == null ? void 0 : e.accessToken]
423
- );
424
- return Te(
389
+ const ee = () => {
390
+ const { user: e, logout: t } = ht(), n = Ae(), s = e == null ? void 0 : e.accessToken;
391
+ return _e(
425
392
  async (a, i, l = {}) => {
426
393
  if (!s)
427
394
  return null;
@@ -444,9 +411,9 @@ const Ju = () => {
444
411
  },
445
412
  [s, t, n]
446
413
  );
447
- }, Ur = () => {
414
+ }, Rr = () => {
448
415
  const e = ne(), t = Ae(), n = ee();
449
- return _e({
416
+ return Pe({
450
417
  mutationFn: async (s) => n(e, { action: L.RELEASE_LOCK, data: s }),
451
418
  onSuccess: () => {
452
419
  t.invalidateQueries({
@@ -456,7 +423,7 @@ const Ju = () => {
456
423
  });
457
424
  }, Or = () => {
458
425
  const e = ne(), t = Ae(), n = ee();
459
- return _e({
426
+ return Pe({
460
427
  mutationFn: async (s) => n(e, {
461
428
  action: L.UPDATE_WEBSITE_SETTINGS,
462
429
  data: s
@@ -475,7 +442,7 @@ const Ju = () => {
475
442
  });
476
443
  }, xl = () => {
477
444
  const e = ne(), t = Ae(), n = ee();
478
- return _e({
445
+ return Pe({
479
446
  mutationFn: async (s) => n(e, { action: L.UPDATE_WEBSITE_DATA, data: s }),
480
447
  onSuccess: () => {
481
448
  t.invalidateQueries({
@@ -489,7 +456,7 @@ const Ju = () => {
489
456
  }
490
457
  });
491
458
  };
492
- function Ue() {
459
+ function Re() {
493
460
  const [e, t] = I(
494
461
  new URLSearchParams(window.location.search)
495
462
  );
@@ -503,18 +470,18 @@ function Ue() {
503
470
  }, []), [e, t];
504
471
  }
505
472
  const Tl = ls({}), Br = () => Dn(Tl), Cl = () => {
506
- const [e] = Ue(), t = e.get("page"), n = dt(""), { mutate: s } = Ur();
473
+ const [e] = Re(), t = e.get("page"), n = ut(""), { mutate: s } = Rr();
507
474
  Ne(() => {
508
- !he(n.current) && t !== n.current && s({ id: n.current }), n.current = t;
475
+ !de(n.current) && t !== n.current && s({ id: n.current }), n.current = t;
509
476
  }, [t, s, n]);
510
- }, at = (e, t) => {
477
+ }, rt = (e, t) => {
511
478
  const [n] = Br();
512
- return W(
479
+ return J(
513
480
  () => $(n, e, t),
514
481
  [n, e, t]
515
482
  );
516
- }, ne = () => at("apiUrl", "/chai/api"), ws = () => at("usersApiUrl", "/chai/users"), ed = () => at("assetsApiUrl", "/chai/assets"), un = () => {
517
- const e = ne(), [t] = Ue(), n = t.get("page"), s = ee();
483
+ }, ne = () => rt("apiUrl", "/chai/api"), ws = () => rt("usersApiUrl", "/chai/users"), Ju = () => rt("assetsApiUrl", "/chai/assets"), un = () => {
484
+ const e = ne(), [t] = Re(), n = t.get("page"), s = ee();
518
485
  return ke({
519
486
  queryKey: [V, L.GET_LANGUAGE_PAGES, n],
520
487
  initialData: [],
@@ -531,7 +498,7 @@ const Tl = ls({}), Br = () => Dn(Tl), Cl = () => {
531
498
  }, Dt = () => {
532
499
  const e = ne(), t = ee();
533
500
  return ke({
534
- queryKey: [L.GET_WEBSITE_DRAFT_SETTINGS],
501
+ queryKey: [V, L.GET_WEBSITE_DRAFT_SETTINGS],
535
502
  initialData: {
536
503
  theme: {},
537
504
  fallbackLang: "en",
@@ -543,14 +510,14 @@ const Tl = ls({}), Br = () => Dn(Tl), Cl = () => {
543
510
  })
544
511
  });
545
512
  }, Mr = (e) => {
546
- const { fallbackLang: t } = ht(), { data: n } = Dt(), { data: s, isFetching: a } = un(), i = W(() => {
513
+ const { fallbackLang: t } = dt(), { data: n } = Dt(), { data: s, isFetching: a } = un(), i = J(() => {
547
514
  const l = { [t]: !0 };
548
515
  return Fa($(n, "languages"), (o) => {
549
516
  const c = ye(s, { lang: o });
550
517
  l[o] = !!c;
551
518
  }), l;
552
519
  }, [t, s, n]);
553
- return a || he(e) || e && i[e];
520
+ return a || de(e) || e && i[e];
554
521
  }, Ss = () => {
555
522
  const e = Ae(), { data: t } = ke({
556
523
  queryKey: [V, L.AI_CONTEXT],
@@ -558,22 +525,22 @@ const Tl = ls({}), Br = () => Dn(Tl), Cl = () => {
558
525
  queryFn: () => "",
559
526
  staleTime: 0
560
527
  });
561
- return { setAiContext: Te(
528
+ return { setAiContext: _e(
562
529
  (s) => {
563
530
  e.setQueryData([V, L.AI_CONTEXT], s);
564
531
  },
565
532
  [e]
566
533
  ), aiContext: t };
567
- }, Rn = () => {
534
+ }, Un = () => {
568
535
  const e = ee(), t = ne();
569
536
  return ke({
570
537
  queryKey: [V, L.GET_WEBSITE_PAGES],
571
538
  staleTime: 1e3 * 60 * 5,
572
539
  queryFn: async () => e(t, { action: L.GET_WEBSITE_PAGES }) || []
573
540
  });
574
- }, Pl = ls({ lastSaved: void 0 }), Ns = () => Dn(Pl), Oe = () => {
575
- const [e] = Ue(), t = e.get("page"), { data: n, isFetching: s } = Rn();
576
- return { data: W(
541
+ }, _l = ls({ lastSaved: void 0 }), Ns = () => Dn(_l), Oe = () => {
542
+ const [e] = Re(), t = e.get("page"), { data: n, isFetching: s } = Un();
543
+ return { data: J(
577
544
  () => ye(n, { id: t }) || {},
578
545
  [n, t]
579
546
  ), isFetching: s };
@@ -585,37 +552,35 @@ const Tl = ls({}), Br = () => Dn(Tl), Cl = () => {
585
552
  action: L.GET_CHAI_USER,
586
553
  data: { userId: e }
587
554
  }),
588
- enabled: !!e && e !== "EXPIRED"
555
+ enabled: !de(e)
589
556
  });
590
- }, _l = ls(void 0), hn = () => {
591
- const [e] = Ue(), t = e.get("page"), { user: n } = rt(), [s, a] = Dn(_l);
592
- return W(() => ({
557
+ }, Pl = ls(void 0), hn = () => {
558
+ const [e] = Re(), t = e.get("page"), { user: n } = ht(), [s, a] = Dn(Pl);
559
+ return J(() => ({
593
560
  isLocked: t && (n == null ? void 0 : n.id) !== s,
594
561
  currentEditor: s,
595
562
  setCurrentEditor: (i) => a(i)
596
563
  }), [n == null ? void 0 : n.id, s, t, a]);
597
564
  }, Fr = () => {
598
- const [e] = Ue(), t = e.get("page"), n = ne(), s = Ae(), { setAiContext: a } = Ss(), { setCurrentEditor: i } = hn(), [, l] = Ns(), o = ee();
565
+ const [e] = Re(), t = e.get("page"), n = ne(), { setAiContext: s } = Ss(), { setCurrentEditor: a } = hn(), [, i] = Ns(), l = ee();
599
566
  return ke({
600
567
  queryKey: [V, L.GET_DRAFT_PAGE, t],
601
568
  staleTime: 1 / 0,
602
569
  gcTime: 1 / 0,
603
570
  queryFn: async () => {
604
- s.invalidateQueries({
605
- queryKey: [V, L.GET_DRAFT_PAGE]
606
- }), i("");
607
- const c = await o(n, {
571
+ a("");
572
+ const o = await l(n, {
608
573
  action: L.GET_DRAFT_PAGE,
609
574
  data: { id: t, draft: !0 }
610
575
  });
611
- i(c.currentEditor);
612
- const d = c.blocks ?? [], h = ye(d, { _type: "@chai/ai-context" });
613
- return a($(h, "_value", "") || ""), l((f) => ({ ...f, lastSaved: c.lastSaved })), d;
576
+ a(o.currentEditor);
577
+ const c = o.blocks ?? [], d = ye(c, { _type: "@chai/ai-context" });
578
+ return s($(d, "_value", "") || ""), i((h) => ({ ...h, lastSaved: o.lastSaved })), c;
614
579
  },
615
580
  enabled: !!t
616
581
  });
617
582
  }, qr = () => {
618
- const { data: e } = Oe(), { data: t } = Dt(), n = ne(), s = ee(), a = W(
583
+ const { data: e } = Oe(), { data: t } = Dt(), n = ne(), s = ee(), a = J(
619
584
  () => (t == null ? void 0 : t.fallbackLang) || "en",
620
585
  [t == null ? void 0 : t.fallbackLang]
621
586
  );
@@ -645,16 +610,15 @@ function Il({
645
610
  avatar: e,
646
611
  name: t,
647
612
  email: n,
648
- onTakeOver: s,
649
- currentEditor: a
613
+ onTakeOver: s
650
614
  }) {
651
- const [i, l] = I(!1);
615
+ const [a, i] = I(!1);
652
616
  return /* @__PURE__ */ r("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ u(cs, { className: "w-full max-w-md mx-auto", children: [
653
617
  /* @__PURE__ */ r(us, { className: "space-y-1", children: /* @__PURE__ */ u(ds, { className: "flex items-center gap-2 text-2xl", children: [
654
618
  /* @__PURE__ */ r(Nr, { className: "w-6 h-6 text-yellow-500" }),
655
- a === "EXPIRED" ? "Editing access timed out" : "Page locked for editing"
619
+ "Page locked for editing"
656
620
  ] }) }),
657
- /* @__PURE__ */ r(hs, { className: "grid gap-4", children: a === "EXPIRED" ? /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children: "Your editing access has been paused due to inactivity. Please refresh the page to continue" }) }) : /* @__PURE__ */ u("div", { children: [
621
+ /* @__PURE__ */ r(hs, { className: "grid gap-4", children: /* @__PURE__ */ u("div", { children: [
658
622
  /* @__PURE__ */ u("div", { className: "flex items-center space-x-4", children: [
659
623
  e ? /* @__PURE__ */ r(
660
624
  "img",
@@ -671,15 +635,7 @@ function Il({
671
635
  ] }),
672
636
  /* @__PURE__ */ r("div", { className: "text-sm mt-4", children: /* @__PURE__ */ r("p", { children: "This user is currently editing the page. You cannot make changes." }) })
673
637
  ] }) }),
674
- /* @__PURE__ */ r(ms, { children: a === "EXPIRED" ? /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
675
- P,
676
- {
677
- className: "w-full",
678
- onClick: () => window.location.reload(),
679
- variant: "destructive",
680
- children: "Refresh"
681
- }
682
- ) }) : /* @__PURE__ */ u(ar, { open: i, onOpenChange: l, children: [
638
+ /* @__PURE__ */ r(ms, { children: /* @__PURE__ */ u(ar, { open: a, onOpenChange: i, children: [
683
639
  /* @__PURE__ */ r(ir, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex flex-col items-center", children: [
684
640
  /* @__PURE__ */ r(P, { className: "w-full", variant: "destructive", children: "Take Over" }),
685
641
  /* @__PURE__ */ r("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." })
@@ -703,7 +659,7 @@ function Il({
703
659
  /* @__PURE__ */ u(dr, { children: [
704
660
  /* @__PURE__ */ r(hr, { children: "Cancel" }),
705
661
  /* @__PURE__ */ r(mr, { onClick: () => {
706
- l(!1), s();
662
+ i(!1), s();
707
663
  }, children: "Yes, Take Over" })
708
664
  ] })
709
665
  ] })
@@ -711,7 +667,7 @@ function Il({
711
667
  ] }) });
712
668
  }
713
669
  const kl = () => {
714
- const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Ue(), a = s.get("page"), { mutate: i } = Ur(), { isFetching: l } = Fr(), o = Te(() => {
670
+ const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Re(), a = s.get("page"), { mutate: i } = Rr(), { isFetching: l } = Fr(), o = _e(() => {
715
671
  i({ id: a });
716
672
  }, [a, i]);
717
673
  return !e || l ? /* @__PURE__ */ r("div", { className: "" }) : /* @__PURE__ */ r(
@@ -720,19 +676,18 @@ const kl = () => {
720
676
  ...n,
721
677
  name: (n == null ? void 0 : n.name) || "Unknown User",
722
678
  email: (n == null ? void 0 : n.email) || "",
723
- currentEditor: t ?? null,
724
679
  onTakeOver: o
725
680
  }
726
681
  );
727
682
  }, Ll = () => {
728
- const [e, t] = Ue(), n = e.get("lang"), s = Mr(n), { setSelectedLang: a } = ht(), i = () => {
683
+ const [e, t] = Re(), n = e.get("lang"), s = Mr(n), { setSelectedLang: a } = dt(), i = () => {
729
684
  const o = new URLSearchParams(window.location.search);
730
685
  o.delete("lang");
731
686
  const c = o.toString(), d = `${window.location.pathname}${c ? `?${c}` : ""}`;
732
687
  window.history.pushState({}, "", d), t(o), a(""), window.dispatchEvent(new PopStateEvent("popstate"));
733
688
  };
734
689
  if (s) return null;
735
- const l = $(je, n);
690
+ const l = $(He, n);
736
691
  return /* @__PURE__ */ r("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ u(cs, { className: "w-full max-w-md mx-auto", children: [
737
692
  /* @__PURE__ */ r(us, { className: "space-y-1", children: /* @__PURE__ */ u(ds, { className: "flex items-center gap-2 text-2xl", children: [
738
693
  /* @__PURE__ */ r(Nr, { className: "w-6 h-6 text-yellow-500" }),
@@ -759,7 +714,7 @@ const kl = () => {
759
714
  ] }) });
760
715
  }, Dl = (e) => {
761
716
  const t = ne(), n = ee();
762
- return _e({
717
+ return Pe({
763
718
  mutationFn: async (s) => n(t, {
764
719
  action: L.UPSERT_LIBRARY_ITEM,
765
720
  data: s
@@ -794,9 +749,9 @@ const kl = () => {
794
749
  },
795
750
  retry: !1
796
751
  });
797
- }, Rl = (e) => {
752
+ }, Ul = (e) => {
798
753
  const t = ne(), n = ee();
799
- return _e({
754
+ return Pe({
800
755
  mutationFn: async (s) => n(t, {
801
756
  action: L.DELETE_LIBRARY_ITEM,
802
757
  data: { id: s }
@@ -810,7 +765,7 @@ const kl = () => {
810
765
  });
811
766
  }
812
767
  });
813
- }, Ul = ({
768
+ }, Rl = ({
814
769
  blockId: e,
815
770
  libBlockId: t,
816
771
  isOpen: n,
@@ -818,7 +773,7 @@ const kl = () => {
818
773
  blockName: a,
819
774
  trigger: i
820
775
  }) => {
821
- const [l, o] = I(!1), c = rr(), d = Rl(() => {
776
+ const [l, o] = I(!1), c = rr(), d = Ul(() => {
822
777
  c([e], { _libBlockId: void 0 }), te.success("Block deleted successfully"), o(!1), s();
823
778
  });
824
779
  return /* @__PURE__ */ u(fr, { open: n, onOpenChange: (y) => !y && s(), children: [
@@ -894,7 +849,7 @@ const kl = () => {
894
849
  }) => {
895
850
  const [l, o] = I(!1);
896
851
  return /* @__PURE__ */ r(
897
- Ul,
852
+ Rl,
898
853
  {
899
854
  blockId: e,
900
855
  libBlockId: t,
@@ -936,7 +891,7 @@ const kl = () => {
936
891
  }
937
892
  },
938
893
  initialData: []
939
- }), { mutateAsync: l, isPending: o } = _e({
894
+ }), { mutateAsync: l, isPending: o } = Pe({
940
895
  mutationFn: async (c) => {
941
896
  if (!c.trim())
942
897
  throw new Error("Group name is required");
@@ -964,7 +919,7 @@ const kl = () => {
964
919
  isCreating: o
965
920
  };
966
921
  }, Ml = ({ value: e, onChange: t }) => {
967
- const [n, s] = I(!1), [a, i] = I(""), l = dt(null), { groups: o } = Bl(), [c, d] = I([
922
+ const [n, s] = I(!1), [a, i] = I(""), l = ut(null), { groups: o } = Bl(), [c, d] = I([
968
923
  { id: "hero", name: "Hero" },
969
924
  { id: "feature", name: "Feature" },
970
925
  { id: "footer", name: "Footer" },
@@ -992,7 +947,7 @@ const kl = () => {
992
947
  { id: "stats", name: "Stats" },
993
948
  { id: "team", name: "Team" },
994
949
  { id: "timeline", name: "Timeline" }
995
- ]), h = W(
950
+ ]), h = J(
996
951
  () => [
997
952
  ...o,
998
953
  ...c.filter(
@@ -1067,7 +1022,7 @@ const kl = () => {
1067
1022
  )
1068
1023
  ] });
1069
1024
  }, Fl = 1 * 1024 * 1024, ql = ({ value: e, onChange: t }) => {
1070
- const [n, s] = I(!1), a = dt(null), i = Te(
1025
+ const [n, s] = I(!1), a = ut(null), i = _e(
1071
1026
  (c) => {
1072
1027
  var h;
1073
1028
  const d = (h = c.target.files) == null ? void 0 : h[0];
@@ -1184,44 +1139,44 @@ const kl = () => {
1184
1139
  ADD_MEDIA: "add_media",
1185
1140
  EDIT_MEDIA: "edit_media",
1186
1141
  DELETE_MEDIA: "delete_media"
1187
- }, jl = (e) => {
1188
- const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = ai(), i = t.find((x) => x._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l, c = W(() => t.some(
1142
+ }, Hl = (e) => {
1143
+ const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = ai(), i = t.find((x) => x._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l, c = J(() => t.some(
1189
1144
  (x) => x._type === "PartialBlock" || x._type === "GlobalBlock"
1190
- ), [t]), d = W(() => {
1145
+ ), [t]), d = J(() => {
1191
1146
  let x = [];
1192
1147
  for (const D of t)
1193
1148
  if (D._type === "PartialBlock" || D._type === "GlobalBlock") {
1194
- const U = a(D.partialBlockId);
1195
- qa(U, "0._parent", D._parent), x = [...x, ...U];
1149
+ const R = a(D.partialBlockId);
1150
+ qa(R, "0._parent", D._parent), x = [...x, ...R];
1196
1151
  } else
1197
1152
  x.push(D);
1198
1153
  return x;
1199
- }, [t, a]), [h, f] = I(""), [y, v] = I(""), [p, A] = I(""), [E, C] = I(""), [N, _] = I({}), [w, k] = I(!1), [T, se] = I(o), [O, Z] = I(!1), { hasPermission: B } = Lt(), S = B(me.DELETE_LIBRARY_BLOCK), G = rr(), ge = () => {
1154
+ }, [t, a]), [h, f] = I(""), [y, v] = I(""), [p, A] = I(""), [E, C] = I(""), [N, _] = I({}), [w, k] = I(!1), [T, se] = I(o), [O, X] = I(!1), { hasPermission: B } = Lt(), S = B(me.DELETE_LIBRARY_BLOCK), G = rr(), ge = () => {
1200
1155
  G([s], { _libBlockId: void 0 }), te.success("Block delinked from library"), n();
1201
1156
  }, {
1202
1157
  data: F,
1203
- isLoading: de,
1204
- isError: Ce
1158
+ isLoading: he,
1159
+ isError: Te
1205
1160
  } = Gl(l);
1206
1161
  Ne(() => {
1207
- Ce && o && (Z(!0), se(!1));
1208
- }, [Ce, o]), Ne(() => {
1209
- F && !de && (f(F.name || ""), v(F.group || ""), A(F.description || ""), C(F.preview || ""), se(!1));
1210
- }, [F, de]), Ne(() => {
1162
+ Te && o && (X(!0), se(!1));
1163
+ }, [Te, o]), Ne(() => {
1164
+ F && !he && (f(F.name || ""), v(F.group || ""), A(F.description || ""), C(F.preview || ""), se(!1));
1165
+ }, [F, he]), Ne(() => {
1211
1166
  const x = h.trim().length >= 2, D = y.trim() !== "";
1212
1167
  k(x && D && !c);
1213
1168
  }, [h, y, c]);
1214
- const Q = () => {
1169
+ const Y = () => {
1215
1170
  const x = {};
1216
1171
  return h.trim() ? h.length < 2 && (x.name = "Name must be at least 2 characters") : x.name = "Name is required", y || (x.group = "Group is required"), _(x), Object.keys(x).length === 0 && !c;
1217
- }, { resetLibrary: xe } = ii({ id: "" }), Y = Dl(
1172
+ }, { resetLibrary: xe } = ii({ id: "" }), W = Dl(
1218
1173
  (x) => {
1219
1174
  o || G([s], { _libBlockId: x.id }), te.success(`Block ${o ? "updated" : "saved"} successfully`), xe(x.library), n();
1220
1175
  }
1221
1176
  ), g = async (x) => {
1222
- if (x.preventDefault(), !Q()) return;
1223
- const D = d.map((U) => (Je(U, "_libBlockId") && delete U._libBlockId, U));
1224
- Y.mutate({
1177
+ if (x.preventDefault(), !Y()) return;
1178
+ const D = d.map((R) => (Je(R, "_libBlockId") && delete R._libBlockId, R));
1179
+ W.mutate({
1225
1180
  name: h.trim(),
1226
1181
  group: y,
1227
1182
  blocks: D,
@@ -1231,8 +1186,8 @@ const kl = () => {
1231
1186
  // Include id if in edit mode
1232
1187
  ...o ? { id: l } : {}
1233
1188
  });
1234
- }, m = Y.isPending;
1235
- return T || de ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ r("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }) }) : O ? /* @__PURE__ */ u("div", { className: "p-6 space-y-4", children: [
1189
+ }, m = W.isPending;
1190
+ return T || he ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ r("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }) }) : O ? /* @__PURE__ */ u("div", { className: "p-6 space-y-4", children: [
1236
1191
  /* @__PURE__ */ r("div", { className: "text-destructive font-medium", children: "Block Not Found" }),
1237
1192
  /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: "This block could not be found on the server. It may have been deleted." }),
1238
1193
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-4", children: [
@@ -1324,7 +1279,7 @@ const kl = () => {
1324
1279
  ] })
1325
1280
  ] })
1326
1281
  ] });
1327
- }, j = {
1282
+ }, H = {
1328
1283
  PREVIEW: "Preview",
1329
1284
  THEME: "Theme",
1330
1285
  SAVEDRAFT: "Save draft",
@@ -1373,7 +1328,7 @@ const kl = () => {
1373
1328
  GLOBAL_BLOCK_PUBLISH_SUCCESS: "Global block published successfully.",
1374
1329
  PAGES_PUBLISH_SUCCESS: "Your changes have been published successfully.",
1375
1330
  SLUG_CHANGE_SUCCESS: "Slug changed successfully."
1376
- }, Hl = {
1331
+ }, jl = {
1377
1332
  SLUG_ALREADY_USED: "This slug is already in use. Please choose a different one."
1378
1333
  }, De = () => {
1379
1334
  const e = ne(), t = ee();
@@ -1384,13 +1339,13 @@ const kl = () => {
1384
1339
  });
1385
1340
  }, Kl = (e) => {
1386
1341
  const { data: t } = De();
1387
- return W(
1342
+ return J(
1388
1343
  () => t == null ? void 0 : t.find((n) => n.key === e),
1389
1344
  [t, e]
1390
1345
  );
1391
1346
  }, Vl = () => {
1392
1347
  const e = ne(), t = ee();
1393
- return _e({
1348
+ return Pe({
1394
1349
  mutationFn: async ({ pageType: n, query: s }) => {
1395
1350
  try {
1396
1351
  return t(e, {
@@ -1405,9 +1360,9 @@ const kl = () => {
1405
1360
  }
1406
1361
  }
1407
1362
  });
1408
- }, jr = () => {
1363
+ }, Hr = () => {
1409
1364
  const e = ne(), t = Ae(), n = ee(), { data: s } = De();
1410
- return _e({
1365
+ return Pe({
1411
1366
  mutationFn: async (a) => (a.template && console.log("Creating page from template:", a.template), await n(e, {
1412
1367
  action: L.CREATE_PAGE,
1413
1368
  data: a
@@ -1431,14 +1386,14 @@ const kl = () => {
1431
1386
  te.error(
1432
1387
  `Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`,
1433
1388
  {
1434
- description: $(Hl, a.message, a.message)
1389
+ description: $(jl, a.message, a.message)
1435
1390
  }
1436
1391
  );
1437
1392
  }
1438
1393
  });
1439
1394
  }, As = () => {
1440
1395
  const e = ne(), t = Ae(), n = ee(), { data: s } = De();
1441
- return _e({
1396
+ return Pe({
1442
1397
  mutationFn: async (a) => await n(e, {
1443
1398
  action: L.UPDATE_PAGE,
1444
1399
  data: a
@@ -1466,7 +1421,7 @@ const kl = () => {
1466
1421
  });
1467
1422
  }, zl = () => {
1468
1423
  const e = ne(), t = Ae(), n = ee(), { data: s } = De();
1469
- return _e({
1424
+ return Pe({
1470
1425
  mutationFn: async (a) => n(e, {
1471
1426
  action: L.DELETE_PAGE,
1472
1427
  data: { id: a == null ? void 0 : a.id }
@@ -1500,7 +1455,7 @@ const kl = () => {
1500
1455
  });
1501
1456
  }, $l = () => {
1502
1457
  const e = ne(), t = Ae(), n = ee(), { data: s } = De();
1503
- return _e({
1458
+ return Pe({
1504
1459
  mutationFn: async (a) => n(e, {
1505
1460
  action: L.TAKE_OFFLINE,
1506
1461
  data: { id: a == null ? void 0 : a.id }
@@ -1517,7 +1472,7 @@ const kl = () => {
1517
1472
  });
1518
1473
  const l = ye(s, { key: i.pageType });
1519
1474
  te.success(
1520
- l != null && l.hasSlug ? j.PAGE_UNPUBLISH_SUCCESS : "New " + l.name + " added successfully."
1475
+ l != null && l.hasSlug ? H.PAGE_UNPUBLISH_SUCCESS : "New " + l.name + " added successfully."
1521
1476
  );
1522
1477
  },
1523
1478
  onError: (a, i) => {
@@ -1532,7 +1487,7 @@ const kl = () => {
1532
1487
  });
1533
1488
  }, xs = () => {
1534
1489
  const e = ne(), t = ee(), n = Ae(), { data: s } = Oe();
1535
- return _e({
1490
+ return Pe({
1536
1491
  mutationFn: async ({ ids: a }) => t(e, {
1537
1492
  action: L.PUBLISH_CHANGES,
1538
1493
  data: { ids: a }
@@ -1552,7 +1507,7 @@ const kl = () => {
1552
1507
  });
1553
1508
  }, Wl = () => {
1554
1509
  const e = ne(), t = ee(), n = Ae();
1555
- return _e({
1510
+ return Pe({
1556
1511
  mutationFn: async (s) => {
1557
1512
  var a;
1558
1513
  return t(e, {
@@ -1577,7 +1532,7 @@ const kl = () => {
1577
1532
  });
1578
1533
  }, Yl = () => {
1579
1534
  const e = ne(), t = ee(), n = Ae();
1580
- return _e({
1535
+ return Pe({
1581
1536
  mutationFn: async (s) => t(e, {
1582
1537
  action: L.UNMARK_AS_TEMPLATE,
1583
1538
  data: { id: s == null ? void 0 : s.id }
@@ -1593,13 +1548,13 @@ const kl = () => {
1593
1548
  });
1594
1549
  }, Ql = () => {
1595
1550
  const e = ne(), t = ee(), n = Ae();
1596
- return _e({
1551
+ return Pe({
1597
1552
  mutationFn: async ({ id: s, slug: a }) => t(e, {
1598
1553
  action: L.CHANGE_SLUG,
1599
1554
  data: { id: s, slug: a }
1600
1555
  }),
1601
1556
  onSuccess: (s, { primaryPage: a }) => {
1602
- te.success(j.SLUG_CHANGE_SUCCESS), a ? n.invalidateQueries({
1557
+ te.success(H.SLUG_CHANGE_SUCCESS), a ? n.invalidateQueries({
1603
1558
  queryKey: [V, L.GET_LANGUAGE_PAGES, a]
1604
1559
  }) : n.invalidateQueries({
1605
1560
  queryKey: [V, L.GET_WEBSITE_PAGES]
@@ -1638,57 +1593,57 @@ var Ts = {};
1638
1593
  return x;
1639
1594
  if (m.has(x))
1640
1595
  return m.get(x);
1641
- var D = new OffscreenCanvas(x.width, x.height), U = D.getContext("2d");
1642
- return U.drawImage(x, 0, 0), m.set(x, D), D;
1596
+ var D = new OffscreenCanvas(x.width, x.height), R = D.getContext("2d");
1597
+ return R.drawImage(x, 0, 0), m.set(x, D), D;
1643
1598
  },
1644
1599
  clear: function() {
1645
1600
  m.clear();
1646
1601
  }
1647
1602
  };
1648
1603
  }(o, /* @__PURE__ */ new Map()), f = function() {
1649
- var g = Math.floor(16.666666666666668), m, x, D = {}, U = 0;
1650
- return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (m = function(H) {
1604
+ var g = Math.floor(16.666666666666668), m, x, D = {}, R = 0;
1605
+ return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (m = function(j) {
1651
1606
  var z = Math.random();
1652
- return D[z] = requestAnimationFrame(function R(b) {
1653
- U === b || U + g - 1 < b ? (U = b, delete D[z], H()) : D[z] = requestAnimationFrame(R);
1607
+ return D[z] = requestAnimationFrame(function U(b) {
1608
+ R === b || R + g - 1 < b ? (R = b, delete D[z], j()) : D[z] = requestAnimationFrame(U);
1654
1609
  }), z;
1655
- }, x = function(H) {
1656
- D[H] && cancelAnimationFrame(D[H]);
1657
- }) : (m = function(H) {
1658
- return setTimeout(H, g);
1659
- }, x = function(H) {
1660
- return clearTimeout(H);
1610
+ }, x = function(j) {
1611
+ D[j] && cancelAnimationFrame(D[j]);
1612
+ }) : (m = function(j) {
1613
+ return setTimeout(j, g);
1614
+ }, x = function(j) {
1615
+ return clearTimeout(j);
1661
1616
  }), { frame: m, cancel: x };
1662
1617
  }(), y = /* @__PURE__ */ function() {
1663
1618
  var g, m, x = {};
1664
- function D(U) {
1665
- function H(z, R) {
1666
- U.postMessage({ options: z || {}, callback: R });
1619
+ function D(R) {
1620
+ function j(z, U) {
1621
+ R.postMessage({ options: z || {}, callback: U });
1667
1622
  }
1668
- U.init = function(R) {
1669
- var b = R.transferControlToOffscreen();
1670
- U.postMessage({ canvas: b }, [b]);
1671
- }, U.fire = function(R, b, K) {
1623
+ R.init = function(U) {
1624
+ var b = U.transferControlToOffscreen();
1625
+ R.postMessage({ canvas: b }, [b]);
1626
+ }, R.fire = function(U, b, K) {
1672
1627
  if (m)
1673
- return H(R, null), m;
1628
+ return j(U, null), m;
1674
1629
  var re = Math.random().toString(36).slice(2);
1675
- return m = d(function(J) {
1676
- function pe(Pe) {
1677
- Pe.data.callback === re && (delete x[re], U.removeEventListener("message", pe), m = null, h.clear(), K(), J());
1630
+ return m = d(function(Z) {
1631
+ function pe(Ce) {
1632
+ Ce.data.callback === re && (delete x[re], R.removeEventListener("message", pe), m = null, h.clear(), K(), Z());
1678
1633
  }
1679
- U.addEventListener("message", pe), H(R, re), x[re] = pe.bind(null, { data: { callback: re } });
1634
+ R.addEventListener("message", pe), j(U, re), x[re] = pe.bind(null, { data: { callback: re } });
1680
1635
  }), m;
1681
- }, U.reset = function() {
1682
- U.postMessage({ reset: !0 });
1683
- for (var R in x)
1684
- x[R](), delete x[R];
1636
+ }, R.reset = function() {
1637
+ R.postMessage({ reset: !0 });
1638
+ for (var U in x)
1639
+ x[U](), delete x[U];
1685
1640
  };
1686
1641
  }
1687
1642
  return function() {
1688
1643
  if (g)
1689
1644
  return g;
1690
1645
  if (!s && i) {
1691
- var U = [
1646
+ var R = [
1692
1647
  "var CONFETTI, SIZE = {}, module = {};",
1693
1648
  "(" + e.toString() + ")(this, module, true, SIZE);",
1694
1649
  "onmessage = function(msg) {",
@@ -1712,9 +1667,9 @@ var Ts = {};
1712
1667
  ].join(`
1713
1668
  `);
1714
1669
  try {
1715
- g = new Worker(URL.createObjectURL(new Blob([U])));
1716
- } catch (H) {
1717
- return typeof console !== void 0 && typeof console.warn == "function" && console.warn("🎊 Could not load worker", H), null;
1670
+ g = new Worker(URL.createObjectURL(new Blob([R])));
1671
+ } catch (j) {
1672
+ return typeof console !== void 0 && typeof console.warn == "function" && console.warn("🎊 Could not load worker", j), null;
1718
1673
  }
1719
1674
  D(g);
1720
1675
  }
@@ -1789,12 +1744,12 @@ var Ts = {};
1789
1744
  var m = g.getBoundingClientRect();
1790
1745
  g.width = m.width, g.height = m.height;
1791
1746
  }
1792
- function Z(g) {
1747
+ function X(g) {
1793
1748
  var m = document.createElement("canvas");
1794
1749
  return m.style.position = "fixed", m.style.top = "0px", m.style.left = "0px", m.style.pointerEvents = "none", m.style.zIndex = g, m;
1795
1750
  }
1796
- function B(g, m, x, D, U, H, z, R, b) {
1797
- g.save(), g.translate(m, x), g.rotate(H), g.scale(D, U), g.arc(0, 0, 1, z, R, b), g.restore();
1751
+ function B(g, m, x, D, R, j, z, U, b) {
1752
+ g.save(), g.translate(m, x), g.rotate(j), g.scale(D, R), g.arc(0, 0, 1, z, U, b), g.restore();
1798
1753
  }
1799
1754
  function S(g) {
1800
1755
  var m = g.angle * (Math.PI / 180), x = g.spread * (Math.PI / 180);
@@ -1825,110 +1780,110 @@ var Ts = {};
1825
1780
  }
1826
1781
  function G(g, m) {
1827
1782
  m.x += Math.cos(m.angle2D) * m.velocity + m.drift, m.y += Math.sin(m.angle2D) * m.velocity + m.gravity, m.velocity *= m.decay, m.flat ? (m.wobble = 0, m.wobbleX = m.x + 10 * m.scalar, m.wobbleY = m.y + 10 * m.scalar, m.tiltSin = 0, m.tiltCos = 0, m.random = 1) : (m.wobble += m.wobbleSpeed, m.wobbleX = m.x + 10 * m.scalar * Math.cos(m.wobble), m.wobbleY = m.y + 10 * m.scalar * Math.sin(m.wobble), m.tiltAngle += 0.1, m.tiltSin = Math.sin(m.tiltAngle), m.tiltCos = Math.cos(m.tiltAngle), m.random = Math.random() + 2);
1828
- var x = m.tick++ / m.totalTicks, D = m.x + m.random * m.tiltCos, U = m.y + m.random * m.tiltSin, H = m.wobbleX + m.random * m.tiltCos, z = m.wobbleY + m.random * m.tiltSin;
1783
+ var x = m.tick++ / m.totalTicks, D = m.x + m.random * m.tiltCos, R = m.y + m.random * m.tiltSin, j = m.wobbleX + m.random * m.tiltCos, z = m.wobbleY + m.random * m.tiltSin;
1829
1784
  if (g.fillStyle = "rgba(" + m.color.r + ", " + m.color.g + ", " + m.color.b + ", " + (1 - x) + ")", g.beginPath(), l && m.shape.type === "path" && typeof m.shape.path == "string" && Array.isArray(m.shape.matrix))
1830
- g.fill(Q(
1785
+ g.fill(Y(
1831
1786
  m.shape.path,
1832
1787
  m.shape.matrix,
1833
1788
  m.x,
1834
1789
  m.y,
1835
- Math.abs(H - D) * 0.1,
1836
- Math.abs(z - U) * 0.1,
1790
+ Math.abs(j - D) * 0.1,
1791
+ Math.abs(z - R) * 0.1,
1837
1792
  Math.PI / 10 * m.wobble
1838
1793
  ));
1839
1794
  else if (m.shape.type === "bitmap") {
1840
- var R = Math.PI / 10 * m.wobble, b = Math.abs(H - D) * 0.1, K = Math.abs(z - U) * 0.1, re = m.shape.bitmap.width * m.scalar, J = m.shape.bitmap.height * m.scalar, pe = new DOMMatrix([
1841
- Math.cos(R) * b,
1842
- Math.sin(R) * b,
1843
- -Math.sin(R) * K,
1844
- Math.cos(R) * K,
1795
+ var U = Math.PI / 10 * m.wobble, b = Math.abs(j - D) * 0.1, K = Math.abs(z - R) * 0.1, re = m.shape.bitmap.width * m.scalar, Z = m.shape.bitmap.height * m.scalar, pe = new DOMMatrix([
1796
+ Math.cos(U) * b,
1797
+ Math.sin(U) * b,
1798
+ -Math.sin(U) * K,
1799
+ Math.cos(U) * K,
1845
1800
  m.x,
1846
1801
  m.y
1847
1802
  ]);
1848
1803
  pe.multiplySelf(new DOMMatrix(m.shape.matrix));
1849
- var Pe = g.createPattern(h.transform(m.shape.bitmap), "no-repeat");
1850
- Pe.setTransform(pe), g.globalAlpha = 1 - x, g.fillStyle = Pe, g.fillRect(
1804
+ var Ce = g.createPattern(h.transform(m.shape.bitmap), "no-repeat");
1805
+ Ce.setTransform(pe), g.globalAlpha = 1 - x, g.fillStyle = Ce, g.fillRect(
1851
1806
  m.x - re / 2,
1852
- m.y - J / 2,
1807
+ m.y - Z / 2,
1853
1808
  re,
1854
- J
1809
+ Z
1855
1810
  ), g.globalAlpha = 1;
1856
1811
  } else if (m.shape === "circle")
1857
- g.ellipse ? g.ellipse(m.x, m.y, Math.abs(H - D) * m.ovalScalar, Math.abs(z - U) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI) : B(g, m.x, m.y, Math.abs(H - D) * m.ovalScalar, Math.abs(z - U) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI);
1812
+ g.ellipse ? g.ellipse(m.x, m.y, Math.abs(j - D) * m.ovalScalar, Math.abs(z - R) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI) : B(g, m.x, m.y, Math.abs(j - D) * m.ovalScalar, Math.abs(z - R) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI);
1858
1813
  else if (m.shape === "star")
1859
- for (var X = Math.PI / 2 * 3, ve = 4 * m.scalar, Fe = 8 * m.scalar, qe = m.x, Xe = m.y, it = 5, $e = Math.PI / it; it--; )
1860
- qe = m.x + Math.cos(X) * Fe, Xe = m.y + Math.sin(X) * Fe, g.lineTo(qe, Xe), X += $e, qe = m.x + Math.cos(X) * ve, Xe = m.y + Math.sin(X) * ve, g.lineTo(qe, Xe), X += $e;
1814
+ for (var Q = Math.PI / 2 * 3, ve = 4 * m.scalar, Fe = 8 * m.scalar, qe = m.x, Xe = m.y, at = 5, $e = Math.PI / at; at--; )
1815
+ qe = m.x + Math.cos(Q) * Fe, Xe = m.y + Math.sin(Q) * Fe, g.lineTo(qe, Xe), Q += $e, qe = m.x + Math.cos(Q) * ve, Xe = m.y + Math.sin(Q) * ve, g.lineTo(qe, Xe), Q += $e;
1861
1816
  else
1862
- g.moveTo(Math.floor(m.x), Math.floor(m.y)), g.lineTo(Math.floor(m.wobbleX), Math.floor(U)), g.lineTo(Math.floor(H), Math.floor(z)), g.lineTo(Math.floor(D), Math.floor(m.wobbleY));
1817
+ g.moveTo(Math.floor(m.x), Math.floor(m.y)), g.lineTo(Math.floor(m.wobbleX), Math.floor(R)), g.lineTo(Math.floor(j), Math.floor(z)), g.lineTo(Math.floor(D), Math.floor(m.wobbleY));
1863
1818
  return g.closePath(), g.fill(), m.tick < m.totalTicks;
1864
1819
  }
1865
- function ge(g, m, x, D, U) {
1866
- var H = m.slice(), z = g.getContext("2d"), R, b, K = d(function(re) {
1867
- function J() {
1868
- R = b = null, z.clearRect(0, 0, D.width, D.height), h.clear(), U(), re();
1820
+ function ge(g, m, x, D, R) {
1821
+ var j = m.slice(), z = g.getContext("2d"), U, b, K = d(function(re) {
1822
+ function Z() {
1823
+ U = b = null, z.clearRect(0, 0, D.width, D.height), h.clear(), R(), re();
1869
1824
  }
1870
1825
  function pe() {
1871
- s && !(D.width === a.width && D.height === a.height) && (D.width = g.width = a.width, D.height = g.height = a.height), !D.width && !D.height && (x(g), D.width = g.width, D.height = g.height), z.clearRect(0, 0, D.width, D.height), H = H.filter(function(Pe) {
1872
- return G(z, Pe);
1873
- }), H.length ? R = f.frame(pe) : J();
1826
+ s && !(D.width === a.width && D.height === a.height) && (D.width = g.width = a.width, D.height = g.height = a.height), !D.width && !D.height && (x(g), D.width = g.width, D.height = g.height), z.clearRect(0, 0, D.width, D.height), j = j.filter(function(Ce) {
1827
+ return G(z, Ce);
1828
+ }), j.length ? U = f.frame(pe) : Z();
1874
1829
  }
1875
- R = f.frame(pe), b = J;
1830
+ U = f.frame(pe), b = Z;
1876
1831
  });
1877
1832
  return {
1878
1833
  addFettis: function(re) {
1879
- return H = H.concat(re), K;
1834
+ return j = j.concat(re), K;
1880
1835
  },
1881
1836
  canvas: g,
1882
1837
  promise: K,
1883
1838
  reset: function() {
1884
- R && f.cancel(R), b && b();
1839
+ U && f.cancel(U), b && b();
1885
1840
  }
1886
1841
  };
1887
1842
  }
1888
1843
  function F(g, m) {
1889
- var x = !g, D = !!E(m || {}, "resize"), U = !1, H = E(m, "disableForReducedMotion", Boolean), z = i && !!E(m || {}, "useWorker"), R = z ? y() : null, b = x ? se : O, K = g && R ? !!g.__confetti_initialized : !1, re = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, J;
1890
- function pe(X, ve, Fe) {
1891
- for (var qe = E(X, "particleCount", C), Xe = E(X, "angle", Number), it = E(X, "spread", Number), $e = E(X, "startVelocity", Number), Ia = E(X, "decay", Number), ka = E(X, "gravity", Number), La = E(X, "drift", Number), _s = E(X, "colors", w), Da = E(X, "ticks", Number), Is = E(X, "shapes"), Ga = E(X, "scalar"), Ra = !!E(X, "flat"), ks = T(X), Ls = qe, Mn = [], Ua = g.width * ks.x, Oa = g.height * ks.y; Ls--; )
1844
+ var x = !g, D = !!E(m || {}, "resize"), R = !1, j = E(m, "disableForReducedMotion", Boolean), z = i && !!E(m || {}, "useWorker"), U = z ? y() : null, b = x ? se : O, K = g && U ? !!g.__confetti_initialized : !1, re = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, Z;
1845
+ function pe(Q, ve, Fe) {
1846
+ for (var qe = E(Q, "particleCount", C), Xe = E(Q, "angle", Number), at = E(Q, "spread", Number), $e = E(Q, "startVelocity", Number), Ia = E(Q, "decay", Number), ka = E(Q, "gravity", Number), La = E(Q, "drift", Number), Ps = E(Q, "colors", w), Da = E(Q, "ticks", Number), Is = E(Q, "shapes"), Ga = E(Q, "scalar"), Ua = !!E(Q, "flat"), ks = T(Q), Ls = qe, Mn = [], Ra = g.width * ks.x, Oa = g.height * ks.y; Ls--; )
1892
1847
  Mn.push(
1893
1848
  S({
1894
- x: Ua,
1849
+ x: Ra,
1895
1850
  y: Oa,
1896
1851
  angle: Xe,
1897
- spread: it,
1852
+ spread: at,
1898
1853
  startVelocity: $e,
1899
- color: _s[Ls % _s.length],
1854
+ color: Ps[Ls % Ps.length],
1900
1855
  shape: Is[N(0, Is.length)],
1901
1856
  ticks: Da,
1902
1857
  decay: Ia,
1903
1858
  gravity: ka,
1904
1859
  drift: La,
1905
1860
  scalar: Ga,
1906
- flat: Ra
1861
+ flat: Ua
1907
1862
  })
1908
1863
  );
1909
- return J ? J.addFettis(Mn) : (J = ge(g, Mn, b, ve, Fe), J.promise);
1864
+ return Z ? Z.addFettis(Mn) : (Z = ge(g, Mn, b, ve, Fe), Z.promise);
1910
1865
  }
1911
- function Pe(X) {
1912
- var ve = H || E(X, "disableForReducedMotion", Boolean), Fe = E(X, "zIndex", Number);
1866
+ function Ce(Q) {
1867
+ var ve = j || E(Q, "disableForReducedMotion", Boolean), Fe = E(Q, "zIndex", Number);
1913
1868
  if (ve && re)
1914
1869
  return d(function($e) {
1915
1870
  $e();
1916
1871
  });
1917
- x && J ? g = J.canvas : x && !g && (g = Z(Fe), document.body.appendChild(g)), D && !K && b(g);
1872
+ x && Z ? g = Z.canvas : x && !g && (g = X(Fe), document.body.appendChild(g)), D && !K && b(g);
1918
1873
  var qe = {
1919
1874
  width: g.width,
1920
1875
  height: g.height
1921
1876
  };
1922
- R && !K && R.init(g), K = !0, R && (g.__confetti_initialized = !0);
1877
+ U && !K && U.init(g), K = !0, U && (g.__confetti_initialized = !0);
1923
1878
  function Xe() {
1924
- if (R) {
1879
+ if (U) {
1925
1880
  var $e = {
1926
1881
  getBoundingClientRect: function() {
1927
1882
  if (!x)
1928
1883
  return g.getBoundingClientRect();
1929
1884
  }
1930
1885
  };
1931
- b($e), R.postMessage({
1886
+ b($e), U.postMessage({
1932
1887
  resize: {
1933
1888
  width: $e.width,
1934
1889
  height: $e.height
@@ -1938,28 +1893,28 @@ var Ts = {};
1938
1893
  }
1939
1894
  qe.width = qe.height = null;
1940
1895
  }
1941
- function it() {
1942
- J = null, D && (U = !1, t.removeEventListener("resize", Xe)), x && g && (document.body.contains(g) && document.body.removeChild(g), g = null, K = !1);
1896
+ function at() {
1897
+ Z = null, D && (R = !1, t.removeEventListener("resize", Xe)), x && g && (document.body.contains(g) && document.body.removeChild(g), g = null, K = !1);
1943
1898
  }
1944
- return D && !U && (U = !0, t.addEventListener("resize", Xe, !1)), R ? R.fire(X, qe, it) : pe(X, qe, it);
1899
+ return D && !R && (R = !0, t.addEventListener("resize", Xe, !1)), U ? U.fire(Q, qe, at) : pe(Q, qe, at);
1945
1900
  }
1946
- return Pe.reset = function() {
1947
- R && R.reset(), J && J.reset();
1948
- }, Pe;
1901
+ return Ce.reset = function() {
1902
+ U && U.reset(), Z && Z.reset();
1903
+ }, Ce;
1949
1904
  }
1950
- var de;
1951
- function Ce() {
1952
- return de || (de = F(null, { useWorker: !0, resize: !0 })), de;
1905
+ var he;
1906
+ function Te() {
1907
+ return he || (he = F(null, { useWorker: !0, resize: !0 })), he;
1953
1908
  }
1954
- function Q(g, m, x, D, U, H, z) {
1955
- var R = new Path2D(g), b = new Path2D();
1956
- b.addPath(R, new DOMMatrix(m));
1909
+ function Y(g, m, x, D, R, j, z) {
1910
+ var U = new Path2D(g), b = new Path2D();
1911
+ b.addPath(U, new DOMMatrix(m));
1957
1912
  var K = new Path2D();
1958
1913
  return K.addPath(b, new DOMMatrix([
1959
- Math.cos(z) * U,
1960
- Math.sin(z) * U,
1961
- -Math.sin(z) * H,
1962
- Math.cos(z) * H,
1914
+ Math.cos(z) * R,
1915
+ Math.sin(z) * R,
1916
+ -Math.sin(z) * j,
1917
+ Math.cos(z) * j,
1963
1918
  x,
1964
1919
  D
1965
1920
  ])), K;
@@ -1969,19 +1924,19 @@ var Ts = {};
1969
1924
  throw new Error("path confetti are not supported in this browser");
1970
1925
  var m, x;
1971
1926
  typeof g == "string" ? m = g : (m = g.path, x = g.matrix);
1972
- var D = new Path2D(m), U = document.createElement("canvas"), H = U.getContext("2d");
1927
+ var D = new Path2D(m), R = document.createElement("canvas"), j = R.getContext("2d");
1973
1928
  if (!x) {
1974
- for (var z = 1e3, R = z, b = z, K = 0, re = 0, J, pe, Pe = 0; Pe < z; Pe += 2)
1975
- for (var X = 0; X < z; X += 2)
1976
- H.isPointInPath(D, Pe, X, "nonzero") && (R = Math.min(R, Pe), b = Math.min(b, X), K = Math.max(K, Pe), re = Math.max(re, X));
1977
- J = K - R, pe = re - b;
1978
- var ve = 10, Fe = Math.min(ve / J, ve / pe);
1929
+ for (var z = 1e3, U = z, b = z, K = 0, re = 0, Z, pe, Ce = 0; Ce < z; Ce += 2)
1930
+ for (var Q = 0; Q < z; Q += 2)
1931
+ j.isPointInPath(D, Ce, Q, "nonzero") && (U = Math.min(U, Ce), b = Math.min(b, Q), K = Math.max(K, Ce), re = Math.max(re, Q));
1932
+ Z = K - U, pe = re - b;
1933
+ var ve = 10, Fe = Math.min(ve / Z, ve / pe);
1979
1934
  x = [
1980
1935
  Fe,
1981
1936
  0,
1982
1937
  0,
1983
1938
  Fe,
1984
- -Math.round(J / 2 + R) * Fe,
1939
+ -Math.round(Z / 2 + U) * Fe,
1985
1940
  -Math.round(pe / 2 + b) * Fe
1986
1941
  ];
1987
1942
  }
@@ -1991,26 +1946,26 @@ var Ts = {};
1991
1946
  matrix: x
1992
1947
  };
1993
1948
  }
1994
- function Y(g) {
1995
- var m, x = 1, D = "#000000", U = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
1996
- typeof g == "string" ? m = g : (m = g.text, x = "scalar" in g ? g.scalar : x, U = "fontFamily" in g ? g.fontFamily : U, D = "color" in g ? g.color : D);
1997
- var H = 10 * x, z = "" + H + "px " + U, R = new OffscreenCanvas(H, H), b = R.getContext("2d");
1949
+ function W(g) {
1950
+ var m, x = 1, D = "#000000", R = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
1951
+ typeof g == "string" ? m = g : (m = g.text, x = "scalar" in g ? g.scalar : x, R = "fontFamily" in g ? g.fontFamily : R, D = "color" in g ? g.color : D);
1952
+ var j = 10 * x, z = "" + j + "px " + R, U = new OffscreenCanvas(j, j), b = U.getContext("2d");
1998
1953
  b.font = z;
1999
- var K = b.measureText(m), re = Math.ceil(K.actualBoundingBoxRight + K.actualBoundingBoxLeft), J = Math.ceil(K.actualBoundingBoxAscent + K.actualBoundingBoxDescent), pe = 2, Pe = K.actualBoundingBoxLeft + pe, X = K.actualBoundingBoxAscent + pe;
2000
- re += pe + pe, J += pe + pe, R = new OffscreenCanvas(re, J), b = R.getContext("2d"), b.font = z, b.fillStyle = D, b.fillText(m, Pe, X);
1954
+ var K = b.measureText(m), re = Math.ceil(K.actualBoundingBoxRight + K.actualBoundingBoxLeft), Z = Math.ceil(K.actualBoundingBoxAscent + K.actualBoundingBoxDescent), pe = 2, Ce = K.actualBoundingBoxLeft + pe, Q = K.actualBoundingBoxAscent + pe;
1955
+ re += pe + pe, Z += pe + pe, U = new OffscreenCanvas(re, Z), b = U.getContext("2d"), b.font = z, b.fillStyle = D, b.fillText(m, Ce, Q);
2001
1956
  var ve = 1 / x;
2002
1957
  return {
2003
1958
  type: "bitmap",
2004
1959
  // TODO these probably need to be transfered for workers
2005
- bitmap: R.transferToImageBitmap(),
2006
- matrix: [ve, 0, 0, ve, -re * ve / 2, -J * ve / 2]
1960
+ bitmap: U.transferToImageBitmap(),
1961
+ matrix: [ve, 0, 0, ve, -re * ve / 2, -Z * ve / 2]
2007
1962
  };
2008
1963
  }
2009
1964
  n.exports = function() {
2010
- return Ce().apply(this, arguments);
1965
+ return Te().apply(this, arguments);
2011
1966
  }, n.exports.reset = function() {
2012
- Ce().reset();
2013
- }, n.exports.create = F, n.exports.shapeFromPath = xe, n.exports.shapeFromText = Y;
1967
+ Te().reset();
1968
+ }, n.exports.create = F, n.exports.shapeFromPath = xe, n.exports.shapeFromText = W;
2014
1969
  })(/* @__PURE__ */ function() {
2015
1970
  return typeof window < "u" ? window : typeof self < "u" ? self : this || {};
2016
1971
  }(), Ts, !1);
@@ -2074,7 +2029,7 @@ const Zl = {
2074
2029
  onClose: t
2075
2030
  }) => {
2076
2031
  const [n, s] = I(e.slug || ""), { mutate: a, isPending: i } = Ql(), { data: l } = De(), o = ye(l, { key: e == null ? void 0 : e.pageType }), c = (h) => {
2077
- if (h.preventDefault(), !(e != null && e.primaryPage) && Object.keys(je).some((v) => n === `/${v}` || Bt(n, `/${v}/`))) {
2032
+ if (h.preventDefault(), !(e != null && e.primaryPage) && Object.keys(He).some((v) => n === `/${v}` || Bt(n, `/${v}/`))) {
2078
2033
  te.error("Error", {
2079
2034
  description: "Slugs cannot start with a language code for primary page"
2080
2035
  });
@@ -2082,7 +2037,7 @@ const Zl = {
2082
2037
  }
2083
2038
  a({ ...e, slug: n }, { onSuccess: t });
2084
2039
  }, d = (e == null ? void 0 : e.lang) || "";
2085
- return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
2040
+ return /* @__PURE__ */ r(je, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
2086
2041
  /* @__PURE__ */ u(Ve, { children: [
2087
2042
  /* @__PURE__ */ r(ze, { children: "Change Slug" }),
2088
2043
  /* @__PURE__ */ r(Qe, { className: "text-xs", children: /* @__PURE__ */ u(yr, { variant: "destructive", className: "mt-2", children: [
@@ -2146,11 +2101,11 @@ const Zl = {
2146
2101
  ] })
2147
2102
  ] }) });
2148
2103
  };
2149
- function Hr({
2104
+ function jr({
2150
2105
  page: e,
2151
2106
  onClose: t
2152
2107
  }) {
2153
- const [, n] = Ue(), { mutate: s, isPending: a } = zl(), { data: i } = De(), l = () => {
2108
+ const [, n] = Re(), { mutate: s, isPending: a } = zl(), { data: i } = De(), l = () => {
2154
2109
  s(e, {
2155
2110
  onSuccess: () => {
2156
2111
  e != null && e.primaryPage || (window.history.replaceState(null, "", "/"), n(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate"))), t();
@@ -2159,7 +2114,7 @@ function Hr({
2159
2114
  }, o = i == null ? void 0 : i.find(
2160
2115
  (c) => c.key === (e == null ? void 0 : e.pageType)
2161
2116
  );
2162
- return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
2117
+ return /* @__PURE__ */ r(je, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
2163
2118
  /* @__PURE__ */ u(Ve, { children: [
2164
2119
  /* @__PURE__ */ r(ze, { children: "Confirm Deletion" }),
2165
2120
  /* @__PURE__ */ u(Qe, { className: "py-4 text-slate-500", children: [
@@ -2172,7 +2127,7 @@ function Hr({
2172
2127
  e.lang && /* @__PURE__ */ u("div", { className: "py-2 text-sm", children: [
2173
2128
  "Language:",
2174
2129
  " ",
2175
- /* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children: $(je, e.lang, e.lang) })
2130
+ /* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children: $(He, e.lang, e.lang) })
2176
2131
  ] })
2177
2132
  ] })
2178
2133
  ] }),
@@ -2205,11 +2160,11 @@ const Me = ({
2205
2160
  const { mutate: n, isPending: s } = $l(), a = async () => {
2206
2161
  n(e, { onSuccess: t });
2207
2162
  };
2208
- return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
2163
+ return /* @__PURE__ */ r(je, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
2209
2164
  /* @__PURE__ */ u(Ve, { children: [
2210
2165
  /* @__PURE__ */ r(ze, { children: "Confirm action" }),
2211
2166
  /* @__PURE__ */ u(Qe, { children: [
2212
- j.UNPUBLISH_MSG,
2167
+ H.UNPUBLISH_MSG,
2213
2168
  " ",
2214
2169
  /* @__PURE__ */ r("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
2215
2170
  "?"
@@ -2223,7 +2178,7 @@ const Me = ({
2223
2178
  variant: "destructive",
2224
2179
  disabled: s,
2225
2180
  onClick: a,
2226
- children: s ? j.UPDATING : j.UNPUBLISH
2181
+ children: s ? H.UPDATING : H.UNPUBLISH
2227
2182
  }
2228
2183
  )
2229
2184
  ] })
@@ -2233,7 +2188,7 @@ const Me = ({
2233
2188
  onClose: t,
2234
2189
  languages: n
2235
2190
  }) => {
2236
- const { data: s } = Oe(), { data: a } = De(), [i, l] = I(e.name || ""), [o, c] = I(e.edit ? e.lang : ""), [d, h] = I(e.edit ? e.slug : ""), { mutate: f, isPending: y } = jr(), { mutate: v, isPending: p } = As(), A = W(
2191
+ const { data: s } = Oe(), { data: a } = De(), [i, l] = I(e.name || ""), [o, c] = I(e.edit ? e.lang : ""), [d, h] = I(e.edit ? e.slug : ""), { mutate: f, isPending: y } = Hr(), { mutate: v, isPending: p } = As(), A = J(
2237
2192
  () => a == null ? void 0 : a.find(
2238
2193
  (_) => _.key === e.pageType
2239
2194
  ),
@@ -2249,34 +2204,34 @@ const Me = ({
2249
2204
  };
2250
2205
  w.pageType = e.pageType, e.edit && (w.id = e == null ? void 0 : e.id), e.edit ? v(w, { onSuccess: t }) : f(w, { onSuccess: t });
2251
2206
  };
2252
- return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px] text-slate-600", children: [
2207
+ return /* @__PURE__ */ r(je, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px] text-slate-600", children: [
2253
2208
  /* @__PURE__ */ u(Ve, { children: [
2254
- /* @__PURE__ */ r(ze, { children: e.edit ? j.EDIT_LANGUAGE : j.ADD_NEW_LANGUAGE }),
2255
- /* @__PURE__ */ r(Qe, { className: "font-light", children: j.ENTER_LANGUAGE_DETAILS })
2209
+ /* @__PURE__ */ r(ze, { children: e.edit ? H.EDIT_LANGUAGE : H.ADD_NEW_LANGUAGE }),
2210
+ /* @__PURE__ */ r(Qe, { className: "font-light", children: H.ENTER_LANGUAGE_DETAILS })
2256
2211
  ] }),
2257
2212
  /* @__PURE__ */ u("form", { onSubmit: N, children: [
2258
2213
  /* @__PURE__ */ u("div", { className: "grid gap-4 py-4", children: [
2259
2214
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2260
- /* @__PURE__ */ r(ae, { htmlFor: "lang", className: "text-right", children: j.LANGUAGE }),
2215
+ /* @__PURE__ */ r(ae, { htmlFor: "lang", className: "text-right", children: H.LANGUAGE }),
2261
2216
  /* @__PURE__ */ u(
2262
2217
  "select",
2263
2218
  {
2264
2219
  value: o,
2265
- disabled: e.edit || he(n),
2220
+ disabled: e.edit || de(n),
2266
2221
  onChange: (_) => {
2267
2222
  const w = _.target.value;
2268
2223
  c(w), !E && h(`/${w}`);
2269
2224
  },
2270
2225
  className: "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",
2271
2226
  children: [
2272
- /* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ? $(je, e.lang, e.lang) : he(n) ? j.ALL_AVAILABLE_LANGUAGE_PAGE : j.CHOOSE_LANGUAGE }),
2273
- Be(n, (_) => /* @__PURE__ */ r("option", { value: _, children: $(je, _, _) }, _))
2227
+ /* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ? $(He, e.lang, e.lang) : de(n) ? H.ALL_AVAILABLE_LANGUAGE_PAGE : H.CHOOSE_LANGUAGE }),
2228
+ Be(n, (_) => /* @__PURE__ */ r("option", { value: _, children: $(He, _, _) }, _))
2274
2229
  ]
2275
2230
  }
2276
2231
  )
2277
2232
  ] }),
2278
2233
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2279
- /* @__PURE__ */ r(ae, { htmlFor: "slug", className: "text-right", children: j.PAGE_NAME }),
2234
+ /* @__PURE__ */ r(ae, { htmlFor: "slug", className: "text-right", children: H.PAGE_NAME }),
2280
2235
  /* @__PURE__ */ r(
2281
2236
  we,
2282
2237
  {
@@ -2285,15 +2240,15 @@ const Me = ({
2285
2240
  onChange: (_) => l(_.target.value),
2286
2241
  className: "col-span-3",
2287
2242
  required: !0,
2288
- placeholder: j.ENTER_PAGE_NAME
2243
+ placeholder: H.ENTER_PAGE_NAME
2289
2244
  }
2290
2245
  )
2291
2246
  ] }),
2292
2247
  !E && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2293
2248
  /* @__PURE__ */ u(ae, { htmlFor: "slug", className: "text-right", children: [
2294
- j.SLUG,
2249
+ H.SLUG,
2295
2250
  " ",
2296
- /* @__PURE__ */ r("small", { className: "font-light", children: j.SLUG_SHOULD_START_WITH })
2251
+ /* @__PURE__ */ r("small", { className: "font-light", children: H.SLUG_SHOULD_START_WITH })
2297
2252
  ] }),
2298
2253
  /* @__PURE__ */ r(
2299
2254
  we,
@@ -2302,14 +2257,14 @@ const Me = ({
2302
2257
  value: d,
2303
2258
  onChange: (_) => {
2304
2259
  const w = _.target.value;
2305
- Bt(w, `/${o}`) && h(Rt(ja(w)));
2260
+ Bt(w, `/${o}`) && h(Ut(Ha(w)));
2306
2261
  },
2307
2262
  className: "col-span-3",
2308
2263
  required: !0,
2309
2264
  pattern: "^/.*",
2310
- disabled: he(o),
2311
- title: j.SLUG_MUST_START_WITH,
2312
- placeholder: he(o) ? j.CHOOSE_LANGUAGE_TO_ADD_SLUG : j.ENTER_PAGE_SLUG
2265
+ disabled: de(o),
2266
+ title: H.SLUG_MUST_START_WITH,
2267
+ placeholder: de(o) ? H.CHOOSE_LANGUAGE_TO_ADD_SLUG : H.ENTER_PAGE_SLUG
2313
2268
  }
2314
2269
  )
2315
2270
  ] })
@@ -2319,13 +2274,13 @@ const Me = ({
2319
2274
  {
2320
2275
  type: "submit",
2321
2276
  disabled: C || !i || !o || !E && !Bt(d, `/${o}`),
2322
- children: C ? e.edit ? j.UPDATING : j.ADDING : e.edit ? j.UPDATE : j.ADD_NEW_LANGUAGE
2277
+ children: C ? e.edit ? H.UPDATING : H.ADDING : e.edit ? H.UPDATE : H.ADD_NEW_LANGUAGE
2323
2278
  }
2324
2279
  ) })
2325
2280
  ] })
2326
2281
  ] }) });
2327
2282
  }, no = () => {
2328
- const [e, t] = I(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = ht(), { data: i, isFetching: l } = un(), { data: o } = Oe(), [c, d] = I(null), [h, f] = I(null), [y, v] = I(null), { data: p } = Dt(), A = be(
2283
+ const [e, t] = I(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = dt(), { data: i, isFetching: l } = un(), { data: o } = Oe(), [c, d] = I(null), [h, f] = I(null), [y, v] = I(null), { data: p } = Dt(), A = be(
2329
2284
  $(p, "languages") || ["en"],
2330
2285
  (E) => !ye(i, { lang: E }) && E !== $(p, "fallbackLang")
2331
2286
  );
@@ -2355,7 +2310,7 @@ const Me = ({
2355
2310
  className: `w-2.5 h-2.5 rounded-full ${E.online ? "bg-green-300" : "bg-gray-300"}`
2356
2311
  }
2357
2312
  ),
2358
- $(je, _ ? s : C, C)
2313
+ $(He, _ ? s : C, C)
2359
2314
  ]
2360
2315
  }
2361
2316
  ),
@@ -2421,7 +2376,7 @@ const Me = ({
2421
2376
  },
2422
2377
  children: [
2423
2378
  /* @__PURE__ */ r(qi, { className: "size-3" }),
2424
- j.EDIT
2379
+ H.EDIT
2425
2380
  ]
2426
2381
  }
2427
2382
  )
@@ -2439,8 +2394,8 @@ const Me = ({
2439
2394
  k.stopPropagation(), f(E);
2440
2395
  },
2441
2396
  children: [
2442
- /* @__PURE__ */ r(Pr, { className: "size-3" }),
2443
- j.UNPUBLISH
2397
+ /* @__PURE__ */ r(_r, { className: "size-3" }),
2398
+ H.UNPUBLISH
2444
2399
  ]
2445
2400
  }
2446
2401
  )
@@ -2458,8 +2413,8 @@ const Me = ({
2458
2413
  k.stopPropagation(), d(E);
2459
2414
  },
2460
2415
  children: [
2461
- /* @__PURE__ */ r(ji, { className: "size-3" }),
2462
- j.DELETE
2416
+ /* @__PURE__ */ r(Hi, { className: "size-3" }),
2417
+ H.DELETE
2463
2418
  ]
2464
2419
  }
2465
2420
  )
@@ -2483,7 +2438,7 @@ const Me = ({
2483
2438
  {
2484
2439
  variant: "default",
2485
2440
  size: "sm",
2486
- disabled: he(A),
2441
+ disabled: de(A),
2487
2442
  onClick: () => {
2488
2443
  t({
2489
2444
  name: o == null ? void 0 : o.name,
@@ -2493,7 +2448,7 @@ const Me = ({
2493
2448
  edit: !1
2494
2449
  });
2495
2450
  },
2496
- children: j.ADD_NEW_LANGUAGE
2451
+ children: H.ADD_NEW_LANGUAGE
2497
2452
  }
2498
2453
  ) }) }),
2499
2454
  e && /* @__PURE__ */ r(
@@ -2504,7 +2459,7 @@ const Me = ({
2504
2459
  onClose: () => t(null)
2505
2460
  }
2506
2461
  ),
2507
- c && /* @__PURE__ */ r(Hr, { page: c, onClose: () => d(null) }),
2462
+ c && /* @__PURE__ */ r(jr, { page: c, onClose: () => d(null) }),
2508
2463
  h && /* @__PURE__ */ r(
2509
2464
  Cs,
2510
2465
  {
@@ -2528,7 +2483,7 @@ function so({
2528
2483
  className: s = "w-full rounded-md border border-gray-300 px-3 py-2",
2529
2484
  id: a = "parentPage"
2530
2485
  }) {
2531
- const i = W(() => !e || e.length === 0 ? [] : e.filter((h) => !he(h.slug)).filter((h) => h.slug !== "/").sort((h, f) => h.slug.localeCompare(f.slug)), [e]), l = (d) => Math.max(0, (d.match(/\//g) || []).length - 1), o = (d) => "    ".repeat(d), c = (d) => {
2486
+ const i = J(() => !e || e.length === 0 ? [] : e.filter((h) => !de(h.slug)).filter((h) => h.slug !== "/").sort((h, f) => h.slug.localeCompare(f.slug)), [e]), l = (d) => Math.max(0, (d.match(/\//g) || []).length - 1), o = (d) => "    ".repeat(d), c = (d) => {
2532
2487
  if (d === "/") return "/";
2533
2488
  const h = d.split("/").filter(Boolean);
2534
2489
  return h.length <= 1 ? `/${h[0] || ""}` : `/${h[h.length - 1]}`;
@@ -2655,22 +2610,22 @@ const ao = ({
2655
2610
  }
2656
2611
  });
2657
2612
  }, oo = (e) => {
2658
- const { data: t = [], isLoading: n } = lo(e), { data: s = [], isLoading: a } = io(), i = W(() => n || a ? [] : t.map((o) => {
2613
+ const { data: t = [], isLoading: n } = lo(e), { data: s = [], isLoading: a } = io(), i = J(() => n || a ? [] : t.map((o) => {
2659
2614
  const c = ye(s, { id: o.library });
2660
2615
  return {
2661
2616
  ...o,
2662
2617
  libraryName: (c == null ? void 0 : c.type) !== "shared" ? "Site Library" : (c == null ? void 0 : c.name) + " Library",
2663
2618
  libraryType: c == null ? void 0 : c.type
2664
2619
  };
2665
- }), [t, s, n, a]), l = W(() => Ha(i, "libraryName"), [i]);
2620
+ }), [t, s, n, a]), l = J(() => ja(i, "libraryName"), [i]);
2666
2621
  return {
2667
2622
  data: i,
2668
2623
  groupedData: l,
2669
2624
  isLoading: n || a
2670
2625
  };
2671
2626
  }, Vr = () => {
2672
- const [, e] = Ue();
2673
- return Te(
2627
+ const [, e] = Re();
2628
+ return _e(
2674
2629
  (t, n) => {
2675
2630
  const a = new URLSearchParams(window.location.search).get("lang"), i = new URLSearchParams({ page: t });
2676
2631
  a && i.set("lang", a), window.history.pushState({}, "", `?${i.toString()}`), e(i), window.dispatchEvent(new PopStateEvent("popstate")), n == null || n();
@@ -2684,21 +2639,21 @@ function co({
2684
2639
  close: n,
2685
2640
  closePanel: s
2686
2641
  }) {
2687
- var z, R;
2688
- const a = Vr(), i = !!(e != null && e.id), { data: l } = Rn(), { mutate: o, isPending: c } = jr(), { mutate: d, isPending: h } = As(), [f, y] = I(null), [v, p] = I(
2642
+ var z, U;
2643
+ const a = Vr(), i = !!(e != null && e.id), { data: l } = Un(), { mutate: o, isPending: c } = Hr(), { mutate: d, isPending: h } = As(), [f, y] = I(null), [v, p] = I(
2689
2644
  (e == null ? void 0 : e.pageType) ?? "page"
2690
- ), { hasPermission: A } = Lt(), E = A(me.CHANGE_PAGE_TYPE), [C, N] = I(!1), [_, w] = I(""), k = W(() => {
2645
+ ), { hasPermission: A } = Lt(), E = A(me.CHANGE_PAGE_TYPE), [C, N] = I(!1), [_, w] = I(""), k = J(() => {
2691
2646
  const b = t.find(
2692
2647
  (K) => K.key === v
2693
2648
  );
2694
2649
  return (b == null ? void 0 : b.hasSlug) === !1;
2695
2650
  }, [v, t]), [T, se] = I(
2696
2651
  (e == null ? void 0 : e.parent) ?? ""
2697
- ), [O, Z] = I((e == null ? void 0 : e.name) ?? ""), [B, S] = I(
2652
+ ), [O, X] = I((e == null ? void 0 : e.name) ?? ""), [B, S] = I(
2698
2653
  (e == null ? void 0 : e.dynamic) ?? !1
2699
2654
  ), [G, ge] = I(
2700
2655
  B ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""
2701
- ), [F, de] = I(""), { data: Ce, isLoading: Q } = oo(v), xe = c || h, Y = t.find(
2656
+ ), [F, he] = I(""), { data: Te, isLoading: Y } = oo(v), xe = c || h, W = t.find(
2702
2657
  (b) => b.key === v
2703
2658
  ), g = (b) => {
2704
2659
  if (i && v !== b) {
@@ -2713,29 +2668,29 @@ function co({
2713
2668
  }, D = (b) => {
2714
2669
  if (se(b), b && b !== "none") {
2715
2670
  const K = l == null ? void 0 : l.find(
2716
- (J) => J.id === b
2671
+ (Z) => Z.id === b
2717
2672
  ), re = (K == null ? void 0 : K.slug) || "";
2718
2673
  if (G.startsWith(re)) {
2719
- const J = G.slice(re.length).replace(/^\/+/, "");
2720
- ge(J);
2674
+ const Z = G.slice(re.length).replace(/^\/+/, "");
2675
+ ge(Z);
2721
2676
  } else
2722
2677
  ge(G.replace(/^\/+/, ""));
2723
2678
  } else
2724
2679
  ge(G ? `${G}` : "");
2725
- }, U = (b) => {
2726
- de(b);
2727
- }, H = (b) => {
2680
+ }, R = (b) => {
2681
+ he(b);
2682
+ }, j = (b) => {
2728
2683
  if (b.preventDefault(), y(null), !O.trim()) {
2729
2684
  te.error("Name is required");
2730
2685
  return;
2731
2686
  }
2732
- if (B && !he(G)) {
2687
+ if (B && !de(G)) {
2733
2688
  y("Slug must be empty when using dynamic slug");
2734
2689
  return;
2735
2690
  }
2736
- if (!(Y != null && Y.hasSlug)) {
2691
+ if (!(W != null && W.hasSlug)) {
2737
2692
  const K = {
2738
- pageType: Y == null ? void 0 : Y.key,
2693
+ pageType: W == null ? void 0 : W.key,
2739
2694
  name: O,
2740
2695
  slug: "",
2741
2696
  hasSlug: !1
@@ -2745,7 +2700,7 @@ function co({
2745
2700
  { id: e == null ? void 0 : e.id, name: O },
2746
2701
  {
2747
2702
  onSuccess: () => {
2748
- te.success((Y == null ? void 0 : Y.name) + " updated successfully"), n();
2703
+ te.success((W == null ? void 0 : W.name) + " updated successfully"), n();
2749
2704
  }
2750
2705
  }
2751
2706
  );
@@ -2765,17 +2720,17 @@ function co({
2765
2720
  }
2766
2721
  const K = l == null ? void 0 : l.find(
2767
2722
  (ve) => ve.id === T
2768
- ), re = (K == null ? void 0 : K.slug) || "", J = re === "/" ? `/${G}` : `${re}/${G}`;
2769
- if (Object.keys(je).some((ve) => J === `/${ve}` || (J == null ? void 0 : J.startsWith(`/${ve}/`)))) {
2723
+ ), re = (K == null ? void 0 : K.slug) || "", Z = re === "/" ? `/${G}` : `${re}/${G}`;
2724
+ if (Object.keys(He).some((ve) => Z === `/${ve}` || (Z == null ? void 0 : Z.startsWith(`/${ve}/`)))) {
2770
2725
  y(
2771
2726
  "Slugs cannot start with a language code for primary page"
2772
2727
  );
2773
2728
  return;
2774
2729
  }
2775
- const X = {
2730
+ const Q = {
2776
2731
  pageType: v,
2777
2732
  name: O,
2778
- slug: J.replace(/\/$/, ""),
2733
+ slug: Z.replace(/\/$/, ""),
2779
2734
  // remove trailing slashes
2780
2735
  parent: T,
2781
2736
  dynamic: B,
@@ -2784,7 +2739,7 @@ function co({
2784
2739
  };
2785
2740
  if (i) {
2786
2741
  d(
2787
- { id: e == null ? void 0 : e.id, ...X },
2742
+ { id: e == null ? void 0 : e.id, ...Q },
2788
2743
  {
2789
2744
  onSuccess: () => {
2790
2745
  te.success("Page updated successfully"), n();
@@ -2793,7 +2748,7 @@ function co({
2793
2748
  );
2794
2749
  return;
2795
2750
  }
2796
- o(X, {
2751
+ o(Q, {
2797
2752
  onSuccess: (ve) => {
2798
2753
  console.log("response", ve), n(), a(ve.page.id, s);
2799
2754
  }
@@ -2823,7 +2778,7 @@ function co({
2823
2778
  });
2824
2779
  }
2825
2780
  };
2826
- return Y != null && Y.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: H, className: "w-full max-w-md mx-auto space-y-4", children: [
2781
+ return W != null && W.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: j, className: "w-full max-w-md mx-auto space-y-4", children: [
2827
2782
  /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2828
2783
  /* @__PURE__ */ r(ae, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
2829
2784
  /* @__PURE__ */ r(
@@ -2864,15 +2819,15 @@ function co({
2864
2819
  ] })
2865
2820
  ] })
2866
2821
  ] }),
2867
- !i && (Y == null ? void 0 : Y.hasSlug) && Ce.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2822
+ !i && (W == null ? void 0 : W.hasSlug) && Te.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2868
2823
  /* @__PURE__ */ r(ae, { className: "text-sm mb-1 block", children: "Template" }),
2869
2824
  /* @__PURE__ */ r(
2870
2825
  ao,
2871
2826
  {
2872
- templates: Ce,
2827
+ templates: Te,
2873
2828
  selectedTemplateId: F,
2874
- onSelectTemplate: U,
2875
- isLoading: Q
2829
+ onSelectTemplate: R,
2830
+ isLoading: Y
2876
2831
  }
2877
2832
  )
2878
2833
  ] }),
@@ -2891,13 +2846,13 @@ function co({
2891
2846
  {
2892
2847
  id: "name",
2893
2848
  value: O,
2894
- onChange: (b) => Z(b.target.value),
2849
+ onChange: (b) => X(b.target.value),
2895
2850
  required: !0,
2896
2851
  "aria-required": "true"
2897
2852
  }
2898
2853
  )
2899
2854
  ] }),
2900
- (Y == null ? void 0 : Y.dynamicSegments) && T && T !== "none" && /* @__PURE__ */ u("div", { className: "space-y-2", children: [
2855
+ (W == null ? void 0 : W.dynamicSegments) && T && T !== "none" && /* @__PURE__ */ u("div", { className: "space-y-2", children: [
2901
2856
  /* @__PURE__ */ u("div", { className: "flex items-center space-x-2", children: [
2902
2857
  /* @__PURE__ */ r(
2903
2858
  "input",
@@ -2913,10 +2868,10 @@ function co({
2913
2868
  ] }),
2914
2869
  B && /* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: [
2915
2870
  "Pages will use pattern: ",
2916
- Y == null ? void 0 : Y.dynamicSlug
2871
+ W == null ? void 0 : W.dynamicSlug
2917
2872
  ] })
2918
2873
  ] }),
2919
- (!(Y != null && Y.dynamicSegments) || !B) && /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2874
+ (!(W != null && W.dynamicSegments) || !B) && /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2920
2875
  /* @__PURE__ */ r(ae, { htmlFor: "slug", className: "text-sm", children: "Slug" }),
2921
2876
  /* @__PURE__ */ r(
2922
2877
  ro,
@@ -2924,7 +2879,7 @@ function co({
2924
2879
  value: G,
2925
2880
  onChange: ge,
2926
2881
  placeholder: T && T !== "none" ? "Enter page slug" : v === "page" ? "Leave empty for home page" : "Required - e.g. your-slug",
2927
- parentSlug: T && T !== "none" ? (R = l == null ? void 0 : l.find((b) => b.id === T)) == null ? void 0 : R.slug : void 0
2882
+ parentSlug: T && T !== "none" ? (U = l == null ? void 0 : l.find((b) => b.id === T)) == null ? void 0 : U.slug : void 0
2928
2883
  }
2929
2884
  ),
2930
2885
  f && /* @__PURE__ */ r("p", { className: "text-xs text-red-500", children: f })
@@ -2933,7 +2888,7 @@ function co({
2933
2888
  ] }) : /* @__PURE__ */ u(
2934
2889
  "form",
2935
2890
  {
2936
- onSubmit: H,
2891
+ onSubmit: j,
2937
2892
  className: "w-full max-w-md mx-auto space-y-4",
2938
2893
  children: [
2939
2894
  /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
@@ -2981,13 +2936,13 @@ function co({
2981
2936
  {
2982
2937
  id: "name",
2983
2938
  value: O,
2984
- onChange: (b) => Z(b.target.value),
2939
+ onChange: (b) => X(b.target.value),
2985
2940
  required: !0,
2986
2941
  "aria-required": "true"
2987
2942
  }
2988
2943
  )
2989
2944
  ] }),
2990
- /* @__PURE__ */ r(P, { disabled: xe, type: "submit", className: "w-full", children: i ? xe ? "Updating..." : "Update " + (Y == null ? void 0 : Y.name) : xe ? "Creating..." : "Create " + (Y == null ? void 0 : Y.name) })
2945
+ /* @__PURE__ */ r(P, { disabled: xe, type: "submit", className: "w-full", children: i ? xe ? "Updating..." : "Update " + (W == null ? void 0 : W.name) : xe ? "Creating..." : "Create " + (W == null ? void 0 : W.name) })
2991
2946
  ]
2992
2947
  }
2993
2948
  );
@@ -2998,7 +2953,7 @@ const uo = ({
2998
2953
  closePanel: n
2999
2954
  }) => {
3000
2955
  const { data: s } = De(), a = !!(e != null && e.id);
3001
- return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: () => t(void 0), children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px]", children: [
2956
+ return /* @__PURE__ */ r(je, { open: !!e, onOpenChange: () => t(void 0), children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px]", children: [
3002
2957
  /* @__PURE__ */ u(Ve, { children: [
3003
2958
  /* @__PURE__ */ u(ze, { children: [
3004
2959
  a ? "Edit" : "Add New",
@@ -3020,9 +2975,9 @@ const uo = ({
3020
2975
  page: e,
3021
2976
  onClose: t
3022
2977
  }) => {
3023
- const [n, s] = I(!1), [a, i] = I(""), [l, o] = I(""), [c, d] = I(!1), h = dt(null), f = Wl(), { data: y } = De(), v = y == null ? void 0 : y.find(
2978
+ const [n, s] = I(!1), [a, i] = I(""), [l, o] = I(""), [c, d] = I(!1), h = ut(null), f = Wl(), { data: y } = De(), v = y == null ? void 0 : y.find(
3024
2979
  (_) => _.key === e.pageType
3025
- ), p = (v == null ? void 0 : v.name) || qt(e.pageType), A = Te(
2980
+ ), p = (v == null ? void 0 : v.name) || qt(e.pageType), A = _e(
3026
2981
  (_) => {
3027
2982
  var k;
3028
2983
  const w = (k = _.target.files) == null ? void 0 : k[0];
@@ -3071,7 +3026,7 @@ const uo = ({
3071
3026
  }
3072
3027
  );
3073
3028
  };
3074
- return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
3029
+ return /* @__PURE__ */ r(je, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
3075
3030
  /* @__PURE__ */ u(Ve, { children: [
3076
3031
  /* @__PURE__ */ r(ze, { children: "Mark as template" }),
3077
3032
  /* @__PURE__ */ u(Qe, { className: "py-4 text-slate-500 space-y-1 text-xs", children: [
@@ -3083,7 +3038,7 @@ const uo = ({
3083
3038
  /* @__PURE__ */ u("div", { className: "space-y-4 mb-4 text-xs", children: [
3084
3039
  /* @__PURE__ */ u("div", { className: "p-4 border rounded bg-slate-50 space-y-3", children: [
3085
3040
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
3086
- /* @__PURE__ */ r(Hi, { className: "w-4 h-4 text-slate-500" }),
3041
+ /* @__PURE__ */ r(ji, { className: "w-4 h-4 text-slate-500" }),
3087
3042
  /* @__PURE__ */ r("span", { className: "font-medium text-slate-500", children: "Page Name:" }),
3088
3043
  /* @__PURE__ */ r("span", { className: "font-semibold", children: qt(e.name) })
3089
3044
  ] }),
@@ -3096,7 +3051,7 @@ const uo = ({
3096
3051
  /* @__PURE__ */ u("div", { children: [
3097
3052
  /* @__PURE__ */ r(ae, { htmlFor: "description", className: "text-xs font-medium", children: "Description (Optional)" }),
3098
3053
  /* @__PURE__ */ r(
3099
- Ut,
3054
+ Rt,
3100
3055
  {
3101
3056
  id: "description",
3102
3057
  placeholder: "Describe this template's purpose",
@@ -3186,7 +3141,7 @@ const uo = ({
3186
3141
  onClose: t
3187
3142
  }) => {
3188
3143
  const [n, s] = I(!1), a = Yl();
3189
- return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
3144
+ return /* @__PURE__ */ r(je, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
3190
3145
  /* @__PURE__ */ u(Ve, { children: [
3191
3146
  /* @__PURE__ */ r(ze, { children: "Unmark as template" }),
3192
3147
  /* @__PURE__ */ r(Qe, { className: "py-4 text-slate-500 space-y-1 text-xs", children: "Are you sure you want to unmark this page as a template?" })
@@ -3220,7 +3175,7 @@ const uo = ({
3220
3175
  }
3221
3176
  )
3222
3177
  ] }) });
3223
- }, jn = ({
3178
+ }, Hn = ({
3224
3179
  parentSlug: e,
3225
3180
  page: t,
3226
3181
  active: n,
@@ -3231,10 +3186,10 @@ const uo = ({
3231
3186
  setMarkAsTemplate: o,
3232
3187
  setUnmarkAsTemplate: c
3233
3188
  }) => {
3234
- const d = Vr(), { data: h } = De(), { hasPermission: f } = Lt(), y = W(
3189
+ const d = Vr(), { data: h } = De(), { hasPermission: f } = Lt(), y = J(
3235
3190
  () => ye(h, { key: t.pageType }),
3236
3191
  [h, t.pageType]
3237
- ), v = $(t, "slug", "").replace(e, "") || "/", p = !f(me.EDIT_PAGE) && !f(me.DELETE_PAGE) && !f(me.UNPUBLISH_PAGE), A = W(() => !!t.isTemplate, [t.isTemplate]), E = W(
3192
+ ), v = $(t, "slug", "").replace(e, "") || "/", p = !f(me.EDIT_PAGE) && !f(me.DELETE_PAGE) && !f(me.UNPUBLISH_PAGE), A = J(() => !!t.isTemplate, [t.isTemplate]), E = J(
3238
3193
  () => !!(y != null && y.hasSlug),
3239
3194
  [y == null ? void 0 : y.hasSlug]
3240
3195
  );
@@ -3313,8 +3268,8 @@ const uo = ({
3313
3268
  C.stopPropagation(), a(t);
3314
3269
  },
3315
3270
  children: [
3316
- /* @__PURE__ */ r(Pr, { className: "size-3" }),
3317
- j.UNPUBLISH
3271
+ /* @__PURE__ */ r(_r, { className: "size-3" }),
3272
+ H.UNPUBLISH
3318
3273
  ]
3319
3274
  }
3320
3275
  ),
@@ -3327,7 +3282,7 @@ const uo = ({
3327
3282
  },
3328
3283
  children: [
3329
3284
  /* @__PURE__ */ r(Es, { className: "size-3" }),
3330
- j.DELETE
3285
+ H.DELETE
3331
3286
  ]
3332
3287
  }
3333
3288
  ),
@@ -3340,7 +3295,7 @@ const uo = ({
3340
3295
  },
3341
3296
  children: [
3342
3297
  /* @__PURE__ */ r(Os, { className: "size-3" }),
3343
- j.UNMARK_AS_TEMPLATE
3298
+ H.UNMARK_AS_TEMPLATE
3344
3299
  ]
3345
3300
  }
3346
3301
  ) : /* @__PURE__ */ u(
@@ -3352,7 +3307,7 @@ const uo = ({
3352
3307
  },
3353
3308
  children: [
3354
3309
  /* @__PURE__ */ r(Os, { className: "size-3" }),
3355
- j.MARK_AS_TEMPLATE
3310
+ H.MARK_AS_TEMPLATE
3356
3311
  ]
3357
3312
  }
3358
3313
  ) })
@@ -3362,7 +3317,7 @@ const uo = ({
3362
3317
  }
3363
3318
  );
3364
3319
  }, go = ({ close: e }) => {
3365
- const [, t] = I([]), [n, s] = I(""), [a, i] = I(null), [l, o] = I(null), [c, d] = I(null), [h, f] = I(null), [y, v] = I(null), { data: p, isFetching: A } = Rn(), [E, C] = I(""), { hasPermission: N } = Lt(), [_, w] = Ue(), k = _.get("page"), { data: T } = De(), se = Te(
3320
+ const [, t] = I([]), [n, s] = I(""), [a, i] = I(null), [l, o] = I(null), [c, d] = I(null), [h, f] = I(null), [y, v] = I(null), { data: p, isFetching: A } = Un(), [E, C] = I(""), { hasPermission: N } = Lt(), [_, w] = Re(), k = _.get("page"), { data: T } = De(), se = _e(
3366
3321
  (S) => {
3367
3322
  var G;
3368
3323
  return (G = ye(T, { key: S })) == null ? void 0 : G.hasSlug;
@@ -3370,13 +3325,13 @@ const uo = ({
3370
3325
  [T]
3371
3326
  );
3372
3327
  Ne(() => {
3373
- if (!he(E)) return;
3328
+ if (!de(E)) return;
3374
3329
  const S = sessionStorage.getItem("pageTypeFilter") || "all";
3375
- !he(T) && S && (ye(T, { key: S }) ? C(S) : C("all"));
3330
+ !de(T) && S && (ye(T, { key: S }) ? C(S) : C("all"));
3376
3331
  }, [T, E]);
3377
3332
  const O = (S) => {
3378
3333
  C(S), sessionStorage.setItem("pageTypeFilter", S);
3379
- }, Z = Te(
3334
+ }, X = _e(
3380
3335
  (S) => {
3381
3336
  const ge = new URLSearchParams(window.location.search).get("lang"), F = new URLSearchParams({ page: S });
3382
3337
  ge && F.set("lang", ge), window.history.pushState({}, "", `?${F.toString()}`), w(F), window.dispatchEvent(new PopStateEvent("popstate")), e();
@@ -3389,34 +3344,34 @@ const uo = ({
3389
3344
  S && (S != null && S.pageType) ? t((G) => [...G, S == null ? void 0 : S.pageType]) : (window.history.replaceState(null, "", "/"), w(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
3390
3345
  }
3391
3346
  }, [p, k, A, w]);
3392
- const B = W(() => {
3347
+ const B = J(() => {
3393
3348
  const S = Nn(
3394
- be(p, (Q) => he(n) ? !0 : jt(Rt(Q == null ? void 0 : Q.name), Rt(n)) || jt(Rt(Q == null ? void 0 : Q.slug), Rt(n)))
3349
+ be(p, (Y) => de(n) ? !0 : Ht(Ut(Y == null ? void 0 : Y.name), Ut(n)) || Ht(Ut(Y == null ? void 0 : Y.slug), Ut(n)))
3395
3350
  );
3396
3351
  if (E !== "all")
3397
3352
  return Nn(be(S, { pageType: E }));
3398
3353
  const G = /* @__PURE__ */ new Map();
3399
- S.forEach((Q) => {
3400
- G.set(Q.id, { ...Q, children: [] });
3354
+ S.forEach((Y) => {
3355
+ G.set(Y.id, { ...Y, children: [] });
3401
3356
  });
3402
3357
  const ge = [], F = [];
3403
- G.forEach((Q) => {
3404
- if (Q.parent) {
3405
- const xe = G.get(Q.parent);
3406
- xe ? xe.children.push(Q) : ge.push(Q);
3358
+ G.forEach((Y) => {
3359
+ if (Y.parent) {
3360
+ const xe = G.get(Y.parent);
3361
+ xe ? xe.children.push(Y) : ge.push(Y);
3407
3362
  } else
3408
- F.push(Q);
3409
- }), ge.sort((Q, xe) => Q.name.localeCompare(xe.name)), ge.forEach((Q) => {
3410
- Q.children.sort((xe, Y) => xe.name.localeCompare(Y.name));
3363
+ F.push(Y);
3364
+ }), ge.sort((Y, xe) => Y.name.localeCompare(xe.name)), ge.forEach((Y) => {
3365
+ Y.children.sort((xe, W) => xe.name.localeCompare(W.name));
3411
3366
  });
3412
- const de = be(
3367
+ const he = be(
3413
3368
  F,
3414
- (Q) => !se(Q.pageType)
3415
- ), Ce = be(
3369
+ (Y) => !se(Y.pageType)
3370
+ ), Te = be(
3416
3371
  F,
3417
- (Q) => se(Q.pageType)
3418
- ).sort((Q, xe) => Q.name.localeCompare(xe.name));
3419
- return Nn([...Ce, ...de, ...ge]);
3372
+ (Y) => se(Y.pageType)
3373
+ ).sort((Y, xe) => Y.name.localeCompare(xe.name));
3374
+ return Nn([...Te, ...he, ...ge]);
3420
3375
  }, [p, se, n, E]);
3421
3376
  return /* @__PURE__ */ u("div", { className: "flex flex-col justify-between h-full", children: [
3422
3377
  /* @__PURE__ */ u("div", { className: "flex flex-col h-full space-y-6", children: [
@@ -3437,7 +3392,7 @@ const uo = ({
3437
3392
  onChange: (S) => s(S.target.value)
3438
3393
  }
3439
3394
  ),
3440
- !he(E) && /* @__PURE__ */ u(vi, { value: E, onValueChange: O, children: [
3395
+ !de(E) && /* @__PURE__ */ u(vi, { value: E, onValueChange: O, children: [
3441
3396
  /* @__PURE__ */ r(
3442
3397
  Ei,
3443
3398
  {
@@ -3447,7 +3402,7 @@ const uo = ({
3447
3402
  ),
3448
3403
  /* @__PURE__ */ u(wi, { align: "end", children: [
3449
3404
  /* @__PURE__ */ r(Fn, { value: "all", children: "All" }, "all"),
3450
- !he(
3405
+ !de(
3451
3406
  be(T, (S) => S.hasSlug)
3452
3407
  ) && /* @__PURE__ */ u(Ee, { children: [
3453
3408
  /* @__PURE__ */ r("div", { className: "px-2 py-1.5 text-xs font-semibold text-gray-500 mt-2 border-t pt-2", children: "Pages" }),
@@ -3467,7 +3422,7 @@ const uo = ({
3467
3422
  )
3468
3423
  )
3469
3424
  ] }),
3470
- !he(
3425
+ !de(
3471
3426
  be(T, (S) => !S.hasSlug)
3472
3427
  ) && /* @__PURE__ */ u(Ee, { children: [
3473
3428
  /* @__PURE__ */ r("div", { className: "px-2 py-1.5 text-xs font-semibold text-gray-500 mt-2 border-t pt-2", children: "Partials" }),
@@ -3496,12 +3451,12 @@ const uo = ({
3496
3451
  className: "w-full bg-gray-200 rounded h-9 animate-pulse"
3497
3452
  },
3498
3453
  S
3499
- )) }) : he(B) ? /* @__PURE__ */ u("div", { className: "h-[70vh] flex flex-col gap-y-1 items-center justify-center text-slate-500 text-sm font-medium", children: [
3454
+ )) }) : de(B) ? /* @__PURE__ */ u("div", { className: "h-[70vh] flex flex-col gap-y-1 items-center justify-center text-slate-500 text-sm font-medium", children: [
3500
3455
  /* @__PURE__ */ r(cn, { className: "h-6 w-6 stroke-[1]" }),
3501
3456
  "Empty List!",
3502
3457
  /* @__PURE__ */ r("span", { className: "font-light", children: "Add new page to start" })
3503
- ] }) : /* @__PURE__ */ r("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: Be(B, (S) => he(S == null ? void 0 : S.children) ? /* @__PURE__ */ r(
3504
- jn,
3458
+ ] }) : /* @__PURE__ */ r("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: Be(B, (S) => de(S == null ? void 0 : S.children) ? /* @__PURE__ */ r(
3459
+ Hn,
3505
3460
  {
3506
3461
  closePanel: e,
3507
3462
  setUnpublishPage: o,
@@ -3515,7 +3470,7 @@ const uo = ({
3515
3470
  S.id || `item-${S.key}`
3516
3471
  ) : /* @__PURE__ */ u("div", { className: "border-0", children: [
3517
3472
  /* @__PURE__ */ r(
3518
- jn,
3473
+ Hn,
3519
3474
  {
3520
3475
  closePanel: e,
3521
3476
  setUnpublishPage: o,
@@ -3530,7 +3485,7 @@ const uo = ({
3530
3485
  /* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: Be($(S, "children", []), (G) => {
3531
3486
  const ge = k === $(G, "id");
3532
3487
  return /* @__PURE__ */ r(
3533
- jn,
3488
+ Hn,
3534
3489
  {
3535
3490
  parentSlug: S.slug,
3536
3491
  closePanel: e,
@@ -3568,12 +3523,12 @@ const uo = ({
3568
3523
  uo,
3569
3524
  {
3570
3525
  closePanel: e,
3571
- editPage: Z,
3526
+ editPage: X,
3572
3527
  addEditPage: c,
3573
3528
  setAddEditPage: d
3574
3529
  }
3575
3530
  ),
3576
- a && /* @__PURE__ */ r(Hr, { page: a, onClose: () => i(null) }),
3531
+ a && /* @__PURE__ */ r(jr, { page: a, onClose: () => i(null) }),
3577
3532
  l && /* @__PURE__ */ r(
3578
3533
  Cs,
3579
3534
  {
@@ -3597,10 +3552,10 @@ const uo = ({
3597
3552
  )
3598
3553
  ] });
3599
3554
  }, po = () => {
3600
- const e = at("logo", null);
3555
+ const e = rt("logo", null);
3601
3556
  return e ? /* @__PURE__ */ r("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: nr.createElement(e, {}) }) : null;
3602
3557
  }, yo = () => {
3603
- const [e] = Ue(), t = e.get("page"), { data: n, isFetching: s } = Oe(), [a, i] = I(!1), { savePage: l } = os(), o = !!t && !he(n), c = !t || !s && he(n) || a;
3558
+ const [e] = Re(), t = e.get("page"), { data: n, isFetching: s } = Oe(), [a, i] = I(!1), { savePage: l } = os(), o = !!t && !de(n), c = !t || !s && de(n) || a;
3604
3559
  return /* @__PURE__ */ u(Ee, { children: [
3605
3560
  /* @__PURE__ */ u(
3606
3561
  P,
@@ -3614,7 +3569,7 @@ const uo = ({
3614
3569
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Wi, { className: "h-4 w-4" }) }),
3615
3570
  /* @__PURE__ */ u("span", { className: "truncate leading-tight flex items-center max-w-[200px]", children: [
3616
3571
  /* @__PURE__ */ r("span", { className: "text-slate-600 pr-1 font-light", children: "Editing:" }),
3617
- s ? /* @__PURE__ */ r(_r, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : qt($(n, "name")) ?? ""
3572
+ s ? /* @__PURE__ */ r(Pr, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : qt($(n, "name")) ?? ""
3618
3573
  ] })
3619
3574
  ]
3620
3575
  },
@@ -3657,18 +3612,18 @@ const uo = ({
3657
3612
  )
3658
3613
  ] });
3659
3614
  }, vo = () => {
3660
- const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = ht(), a = he(n) ? e : n, [, i] = Ue();
3615
+ const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = dt(), a = de(n) ? e : n, [, i] = Re();
3661
3616
  Ne(() => {
3662
3617
  const p = new URLSearchParams(window.location.search), A = p.get("lang");
3663
3618
  A && (t.includes(A) ? s(A) : (p.delete("lang"), i(p), s("")));
3664
3619
  }, [t, i, s]);
3665
- const [l, o] = I(null), { data: c } = Oe(), { data: d } = Dt(), { data: h, isFetching: f } = un(), y = W(() => {
3620
+ const [l, o] = I(null), { data: c } = Oe(), { data: d } = Dt(), { data: h, isFetching: f } = un(), y = J(() => {
3666
3621
  const p = Nn(
3667
3622
  Be($(d, "languages"), (A) => {
3668
3623
  const E = ye(h, { lang: A });
3669
3624
  return {
3670
3625
  key: A,
3671
- value: $(je, A, A),
3626
+ value: $(He, A, A),
3672
3627
  isLangPageAdded: !!E
3673
3628
  };
3674
3629
  })
@@ -3676,7 +3631,7 @@ const uo = ({
3676
3631
  return [
3677
3632
  {
3678
3633
  key: e,
3679
- value: $(je, e),
3634
+ value: $(He, e),
3680
3635
  isLangPageAdded: !0
3681
3636
  },
3682
3637
  ...p
@@ -3688,11 +3643,11 @@ const uo = ({
3688
3643
  const E = A.toString(), C = `${window.location.pathname}${E ? `?${E}` : ""}`;
3689
3644
  window.history.pushState({}, "", C), i(A), window.dispatchEvent(new PopStateEvent("popstate"));
3690
3645
  };
3691
- return he(t) || f ? null : /* @__PURE__ */ u(Ee, { children: [
3646
+ return de(t) || f ? null : /* @__PURE__ */ u(Ee, { children: [
3692
3647
  /* @__PURE__ */ u(an, { children: [
3693
3648
  /* @__PURE__ */ r(ln, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ u(P, { variant: "ghost", size: "sm", className: "gap-2", children: [
3694
3649
  /* @__PURE__ */ r(Yi, { className: "w-4 h-4" }),
3695
- $(je, a, a),
3650
+ $(He, a, a),
3696
3651
  /* @__PURE__ */ r(Ir, { className: "w-4 h-4" })
3697
3652
  ] }) }),
3698
3653
  /* @__PURE__ */ u(on, { className: "border-border space-y-1", children: [
@@ -3723,7 +3678,7 @@ const uo = ({
3723
3678
  p.value
3724
3679
  )
3725
3680
  ),
3726
- !he(y.filter((p) => !p.isLangPageAdded)) && /* @__PURE__ */ u(Ee, { children: [
3681
+ !de(y.filter((p) => !p.isLangPageAdded)) && /* @__PURE__ */ u(Ee, { children: [
3727
3682
  /* @__PURE__ */ r(Ni, {}),
3728
3683
  /* @__PURE__ */ u(
3729
3684
  P,
@@ -3781,7 +3736,7 @@ function bo(e) {
3781
3736
  }
3782
3737
  const wo = () => {
3783
3738
  const e = ne(), t = ee(), n = Ae();
3784
- return _e({
3739
+ return Pe({
3785
3740
  mutationFn: async (s) => await t(e, {
3786
3741
  action: L.DELETE_PAGE_REVISION,
3787
3742
  data: { revisionId: s }
@@ -3794,7 +3749,7 @@ const wo = () => {
3794
3749
  });
3795
3750
  }, So = () => {
3796
3751
  const e = ne(), t = ee(), n = Ae();
3797
- return _e({
3752
+ return Pe({
3798
3753
  mutationFn: async ({
3799
3754
  revisionId: s,
3800
3755
  discardCurrent: a
@@ -3813,7 +3768,7 @@ function No() {
3813
3768
  const { data: e } = Oe(), { saveState: t } = os(), [n] = Ns();
3814
3769
  return e ? /* @__PURE__ */ r("div", { className: "flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50 bg-primary/5 mb-4", children: /* @__PURE__ */ u("div", { className: "flex-1 space-y-1", children: [
3815
3770
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r("p", { className: "text-sm flex items-center gap-1 font-medium leading-none", children: /* @__PURE__ */ r("span", { className: "font-bold", children: "Currently editing" }) }) }),
3816
- /* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !he(n.lastSaved) && /* @__PURE__ */ u("span", { children: [
3771
+ /* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !de(n.lastSaved) && /* @__PURE__ */ u("span", { children: [
3817
3772
  "Last updated",
3818
3773
  " ",
3819
3774
  hl(new Date(n.lastSaved), {
@@ -3905,7 +3860,7 @@ function Ao() {
3905
3860
  /* @__PURE__ */ r(ps, { side: "bottom", children: /* @__PURE__ */ r("p", { children: "Revision history" }) })
3906
3861
  ] }) }),
3907
3862
  /* @__PURE__ */ r(
3908
- Po,
3863
+ _o,
3909
3864
  {
3910
3865
  open: a,
3911
3866
  onOpenChange: i,
@@ -3915,7 +3870,7 @@ function Ao() {
3915
3870
  }
3916
3871
  ),
3917
3872
  /* @__PURE__ */ r(
3918
- _o,
3873
+ Po,
3919
3874
  {
3920
3875
  open: l,
3921
3876
  onOpenChange: o,
@@ -4017,7 +3972,7 @@ function Co({
4017
3972
  ] })
4018
3973
  ] });
4019
3974
  }
4020
- function Po({
3975
+ function _o({
4021
3976
  open: e,
4022
3977
  onOpenChange: t,
4023
3978
  revision: n,
@@ -4026,7 +3981,7 @@ function Po({
4026
3981
  }) {
4027
3982
  const { data: i } = dn((n == null ? void 0 : n.currentEditor) || ""), l = (i == null ? void 0 : i.name) || "Unknown";
4028
3983
  return n ? /* @__PURE__ */ r(
4029
- He,
3984
+ je,
4030
3985
  {
4031
3986
  open: e,
4032
3987
  onOpenChange: (o) => {
@@ -4085,7 +4040,7 @@ function Po({
4085
4040
  }
4086
4041
  ) : null;
4087
4042
  }
4088
- function _o({
4043
+ function Po({
4089
4044
  open: e,
4090
4045
  onOpenChange: t,
4091
4046
  revision: n,
@@ -4094,7 +4049,7 @@ function _o({
4094
4049
  }) {
4095
4050
  const { data: i } = dn((n == null ? void 0 : n.currentEditor) || ""), l = (i == null ? void 0 : i.name) || "Unknown";
4096
4051
  return n ? /* @__PURE__ */ r(
4097
- He,
4052
+ je,
4098
4053
  {
4099
4054
  open: e,
4100
4055
  onOpenChange: (o) => {
@@ -4161,24 +4116,24 @@ function Lo({
4161
4116
  showModal: e = !1,
4162
4117
  onClose: t = () => console.log("Cancelled")
4163
4118
  }) {
4164
- const [n, s] = I([]), { data: a, isFetching: i } = Io(), { data: l } = De(), o = Te(
4119
+ const [n, s] = I([]), { data: a, isFetching: i } = Io(), { data: l } = De(), o = _e(
4165
4120
  (w) => {
4166
4121
  var k;
4167
4122
  return (k = ye(l, { key: w })) == null ? void 0 : k.hasSlug;
4168
4123
  },
4169
4124
  [l]
4170
- ), c = W(
4125
+ ), c = J(
4171
4126
  () => be(l, (w) => !o(w.key)).map(
4172
4127
  (w) => w.key
4173
4128
  ),
4174
4129
  [o, l]
4175
- ), d = W(
4130
+ ), d = J(
4176
4131
  () => be(a, (w) => !c.includes(w.pageType)),
4177
4132
  [a, c]
4178
- ), h = W(
4133
+ ), h = J(
4179
4134
  () => be(a, (w) => c.includes(w.pageType)),
4180
4135
  [a, c]
4181
- ), f = W(
4136
+ ), f = J(
4182
4137
  () => ye(a, { pageType: "theme", id: "THEME" }),
4183
4138
  [a]
4184
4139
  ), { mutate: y, isPending: v } = xs();
@@ -4188,7 +4143,7 @@ function Lo({
4188
4143
  }, [a, f]);
4189
4144
  const p = n.length === (a == null ? void 0 : a.length), A = (w) => {
4190
4145
  s(
4191
- (k) => jt(k, w) ? be(k, (T) => T !== w) : Va(k, w)
4146
+ (k) => Ht(k, w) ? be(k, (T) => T !== w) : Va(k, w)
4192
4147
  );
4193
4148
  }, E = () => {
4194
4149
  s(p ? [] : Be(a, "id"));
@@ -4205,7 +4160,7 @@ function Lo({
4205
4160
  if (w === "theme") return "Theme";
4206
4161
  const k = ye(l, { key: w });
4207
4162
  return k ? k == null ? void 0 : k.name : w;
4208
- }, _ = W(() => {
4163
+ }, _ = J(() => {
4209
4164
  const w = [
4210
4165
  { label: "Updated", top: "pt-2" },
4211
4166
  ...mn(be(d, { online: !0 }), "pageType"),
@@ -4217,7 +4172,7 @@ function Lo({
4217
4172
  ], T = f ? [{ label: "Theme", top: "pt-6" }, f] : [];
4218
4173
  return [...w, ...T, ...k];
4219
4174
  }, [d, h, f]);
4220
- return /* @__PURE__ */ r(He, { open: e, onOpenChange: v ? () => {
4175
+ return /* @__PURE__ */ r(je, { open: e, onOpenChange: v ? () => {
4221
4176
  } : t, children: /* @__PURE__ */ u(Ke, { className: "max-w-4xl max-h-[80%] flex flex-col", children: [
4222
4177
  /* @__PURE__ */ u(Ve, { children: [
4223
4178
  /* @__PURE__ */ r(ze, { children: "Publish changes" }),
@@ -4281,7 +4236,7 @@ function Lo({
4281
4236
  /* @__PURE__ */ r(
4282
4237
  "input",
4283
4238
  {
4284
- checked: jt(n, w == null ? void 0 : w.id),
4239
+ checked: Ht(n, w == null ? void 0 : w.id),
4285
4240
  onClick: (k) => {
4286
4241
  k.stopPropagation(), A(w == null ? void 0 : w.id);
4287
4242
  },
@@ -4327,7 +4282,7 @@ function Lo({
4327
4282
  /* @__PURE__ */ r(
4328
4283
  P,
4329
4284
  {
4330
- disabled: v || i || he(a),
4285
+ disabled: v || i || de(a),
4331
4286
  onClick: C,
4332
4287
  children: v ? "Publishing..." : "Publish"
4333
4288
  }
@@ -4347,8 +4302,8 @@ const Do = () => {
4347
4302
  });
4348
4303
  };
4349
4304
  function Go({ onClose: e }) {
4350
- const { data: t, isFetching: n } = Do(), { mutateAsync: s, isPending: a } = xl(), i = at("settingComponent", null), l = $a(async (o) => (await s({ data: o }), !0), 300);
4351
- return i ? /* @__PURE__ */ r(He, { open: !0, onOpenChange: e, children: /* @__PURE__ */ u(Ke, { className: "w-full", children: [
4305
+ const { data: t, isFetching: n } = Do(), { mutateAsync: s, isPending: a } = xl(), i = rt("settingComponent", null), l = $a(async (o) => (await s({ data: o }), !0), 300);
4306
+ return i ? /* @__PURE__ */ r(je, { open: !0, onOpenChange: e, children: /* @__PURE__ */ u(Ke, { className: "w-full", children: [
4352
4307
  /* @__PURE__ */ r(Ve, { children: /* @__PURE__ */ r(ze, { children: "Website Settings" }) }),
4353
4308
  n ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
4354
4309
  /* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
@@ -4375,14 +4330,14 @@ function zr({
4375
4330
  /* @__PURE__ */ r(ps, { side: "bottom", sideOffset: 10, children: /* @__PURE__ */ r("p", { children: t }) })
4376
4331
  ] }) });
4377
4332
  }
4378
- const Ro = () => {
4379
- const { selectedLang: e } = ht(), t = at("getPreviewUrl", async (h) => h), [n, s] = I(""), { data: a, isFetching: i } = Oe(), { data: l } = un(), { data: o } = De(), c = W(
4333
+ const Uo = () => {
4334
+ const { selectedLang: e } = dt(), t = rt("getPreviewUrl", async (h) => h), [n, s] = I(""), { data: a, isFetching: i } = Oe(), { data: l } = un(), { data: o } = De(), c = J(
4380
4335
  () => {
4381
4336
  var h;
4382
4337
  return (h = l == null ? void 0 : l.find((f) => (f == null ? void 0 : f.lang) === e)) == null ? void 0 : h.slug;
4383
4338
  },
4384
4339
  [e, l]
4385
- ), d = Te(
4340
+ ), d = _e(
4386
4341
  (h) => {
4387
4342
  var f;
4388
4343
  return (f = ye(o, { key: h })) == null ? void 0 : f.hasSlug;
@@ -4400,12 +4355,12 @@ const Ro = () => {
4400
4355
  }, [t, c]), !n || !d(a == null ? void 0 : a.pageType) || i ? null : /* @__PURE__ */ r(Ee, { children: /* @__PURE__ */ r("a", { href: n, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ u(P, { variant: "ghost", size: "sm", className: "gap-2", children: [
4401
4356
  /* @__PURE__ */ r(Dr, { className: "w-4 h-4" }),
4402
4357
  " ",
4403
- j.PREVIEW
4358
+ H.PREVIEW
4404
4359
  ] }) }) });
4405
- }, Uo = () => {
4360
+ }, Ro = () => {
4406
4361
  const [e, t] = ci();
4407
4362
  return /* @__PURE__ */ u(Ee, { children: [
4408
- /* @__PURE__ */ r(zr, { content: j.THEME, children: /* @__PURE__ */ r(
4363
+ /* @__PURE__ */ r(zr, { content: H.THEME, children: /* @__PURE__ */ r(
4409
4364
  P,
4410
4365
  {
4411
4366
  variant: e === "theme" ? "outline" : "ghost",
@@ -4427,32 +4382,32 @@ const Ro = () => {
4427
4382
  window.removeEventListener("beforeunload", h);
4428
4383
  };
4429
4384
  }, [a]);
4430
- const i = Te(async () => {
4385
+ const i = _e(async () => {
4431
4386
  t(!0), await s(!1);
4432
4387
  }, [s]);
4433
4388
  Ne(() => {
4434
4389
  a === "SAVED" && t(!1);
4435
4390
  }, [a]);
4436
- const l = W(() => {
4391
+ const l = J(() => {
4437
4392
  if (a === "SAVED" || a === "UNSAVED") return a;
4438
4393
  if (a === "SAVING") return e ? a : "SAVED";
4439
- }, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: d } = W(() => {
4394
+ }, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: d } = J(() => {
4440
4395
  switch (l) {
4441
4396
  case "UNSAVED":
4442
4397
  return {
4443
- tooltipContent: j.SAVEDRAFT,
4398
+ tooltipContent: H.SAVEDRAFT,
4444
4399
  buttonIcon: /* @__PURE__ */ r(Lr, { className: "w-4 h-4" }),
4445
4400
  buttonClass: "flex items-center gap-x-1 leading-tight"
4446
4401
  };
4447
4402
  case "SAVING":
4448
4403
  return {
4449
- tooltipContent: j.SAVING,
4450
- buttonIcon: /* @__PURE__ */ r(_r, { className: "w-4 h-4 animate-spin" }),
4404
+ tooltipContent: H.SAVING,
4405
+ buttonIcon: /* @__PURE__ */ r(Pr, { className: "w-4 h-4 animate-spin" }),
4451
4406
  buttonClass: "flex items-center gap-x-1 leading-tight"
4452
4407
  };
4453
4408
  case "SAVED":
4454
4409
  return {
4455
- tooltipContent: j.SAVED,
4410
+ tooltipContent: H.SAVED,
4456
4411
  buttonIcon: /* @__PURE__ */ r(sl, { className: "w-4 h-4" }),
4457
4412
  buttonClass: "text-green-500 flex items-center gap-x-1 leading-tight"
4458
4413
  };
@@ -4473,12 +4428,12 @@ const Ro = () => {
4473
4428
  }
4474
4429
  );
4475
4430
  }, Bo = () => {
4476
- const [e, t] = I(!1), [n, s] = I(!1), [a, i] = I(null), { data: l } = Oe(), { mutate: o, isPending: c } = xs(), [d] = ui(), { buttonText: h, buttonClassName: f, isPublished: y } = W(() => {
4431
+ const [e, t] = I(!1), [n, s] = I(!1), [a, i] = I(null), { data: l } = Oe(), { mutate: o, isPending: c } = xs(), [d] = ui(), { buttonText: h, buttonClassName: f, isPublished: y } = J(() => {
4477
4432
  const p = l && (l == null ? void 0 : l.online);
4478
4433
  return {
4479
4434
  buttonClassName: p ? "hover:bg-green-600 bg-green-500" : "",
4480
4435
  isPublished: p,
4481
- buttonText: p ? j.PUBLISHED : j.PUBLISH
4436
+ buttonText: p ? H.PUBLISHED : H.PUBLISH
4482
4437
  };
4483
4438
  }, [l]);
4484
4439
  return /* @__PURE__ */ u(Ee, { children: [
@@ -4539,7 +4494,7 @@ const Ro = () => {
4539
4494
  { onSuccess: () => Tn("TOP_RIGHT") }
4540
4495
  ),
4541
4496
  children: [
4542
- j.PUBLISH,
4497
+ H.PUBLISH,
4543
4498
  " page"
4544
4499
  ]
4545
4500
  }
@@ -4550,7 +4505,7 @@ const Ro = () => {
4550
4505
  onClick: () => t(!0),
4551
4506
  className: "text-xs cursor-pointer",
4552
4507
  children: [
4553
- j.OPEN,
4508
+ H.OPEN,
4554
4509
  " publish menu"
4555
4510
  ]
4556
4511
  }
@@ -4561,7 +4516,7 @@ const Ro = () => {
4561
4516
  onClick: () => i(l),
4562
4517
  className: "text-xs cursor-pointer",
4563
4518
  children: [
4564
- j.UNPUBLISH,
4519
+ H.UNPUBLISH,
4565
4520
  " page"
4566
4521
  ]
4567
4522
  }
@@ -4579,9 +4534,9 @@ const Ro = () => {
4579
4534
  )
4580
4535
  ] });
4581
4536
  }, Mo = () => {
4582
- const e = at("settingComponent", null), [t, n] = I(!1);
4537
+ const e = rt("settingComponent", null), [t, n] = I(!1);
4583
4538
  return e ? /* @__PURE__ */ u(Ee, { children: [
4584
- /* @__PURE__ */ r(zr, { content: j.WEBSITEDATA, children: /* @__PURE__ */ r(
4539
+ /* @__PURE__ */ r(zr, { content: H.WEBSITEDATA, children: /* @__PURE__ */ r(
4585
4540
  P,
4586
4541
  {
4587
4542
  variant: "ghost",
@@ -4596,7 +4551,7 @@ const Ro = () => {
4596
4551
  ] }) : null;
4597
4552
  }, Fo = () => {
4598
4553
  const { data: e } = Oe(), t = e && (e == null ? void 0 : e.online), { data: n } = De();
4599
- return Te(
4554
+ return _e(
4600
4555
  (a) => {
4601
4556
  var i;
4602
4557
  return (i = ye(n, { key: a })) == null ? void 0 : i.hasSlug;
@@ -4612,29 +4567,29 @@ const Ro = () => {
4612
4567
  className: "flex items-center gap-1",
4613
4568
  children: [
4614
4569
  /* @__PURE__ */ r(al, { className: "w-4 h-4" }),
4615
- /* @__PURE__ */ r("span", { className: "hidden sm:inline", children: j.OPEN })
4570
+ /* @__PURE__ */ r("span", { className: "hidden sm:inline", children: H.OPEN })
4616
4571
  ]
4617
4572
  }
4618
4573
  ) : null;
4619
4574
  };
4620
4575
  function qo() {
4621
- const { isLocked: e } = hn(), [t] = Ue(), n = t.get("lang"), s = Mr(n);
4576
+ const { isLocked: e } = hn(), [t] = Re(), n = t.get("lang"), s = Mr(n);
4622
4577
  return e || !s ? null : /* @__PURE__ */ u("div", { className: "flex items-center justify-end gap-1", children: [
4623
4578
  /* @__PURE__ */ r(Ao, {}),
4624
- /* @__PURE__ */ r(Me, { permission: me.EDIT_THEME, children: /* @__PURE__ */ r(Uo, {}) }),
4579
+ /* @__PURE__ */ r(Me, { permission: me.EDIT_THEME, children: /* @__PURE__ */ r(Ro, {}) }),
4625
4580
  /* @__PURE__ */ r(Me, { permission: me.EDIT_SETTINGS, children: /* @__PURE__ */ r(Mo, {}) }),
4626
- /* @__PURE__ */ r(Ro, {}),
4581
+ /* @__PURE__ */ r(Uo, {}),
4627
4582
  /* @__PURE__ */ r(Me, { permission: me.SAVE_PAGE, children: /* @__PURE__ */ r(Oo, {}) }),
4628
4583
  /* @__PURE__ */ r(Me, { permission: me.PUBLISH_PAGE, children: /* @__PURE__ */ r(Bo, {}) }),
4629
4584
  /* @__PURE__ */ r(Fo, {})
4630
4585
  ] });
4631
4586
  }
4632
- const jo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-center justify-between w-full", children: [
4587
+ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-center justify-between w-full", children: [
4633
4588
  /* @__PURE__ */ r(Eo, {}),
4634
4589
  /* @__PURE__ */ r(qo, {})
4635
- ] }), Ho = () => {
4590
+ ] }), jo = () => {
4636
4591
  const e = ne(), { aiContext: t } = Ss(), n = ee();
4637
- return Te(
4592
+ return _e(
4638
4593
  async (s, a, i, l) => n(e, {
4639
4594
  action: L.ASK_AI,
4640
4595
  data: { type: s, prompt: a, blocks: i, context: t, lang: l }
@@ -4661,11 +4616,11 @@ const jo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4661
4616
  return n;
4662
4617
  }), Vo = (e) => {
4663
4618
  const t = ml();
4664
- return W(() => {
4665
- if (!e || he(e)) return { blocks: [] };
4619
+ return J(() => {
4620
+ if (!e || de(e)) return { blocks: [] };
4666
4621
  const n = be(
4667
4622
  e,
4668
- (s) => !jt(s == null ? void 0 : s._type, "@chai/")
4623
+ (s) => !Ht(s == null ? void 0 : s._type, "@chai/")
4669
4624
  );
4670
4625
  return { blocks: Ko(t, n) };
4671
4626
  }, [e, t]);
@@ -4679,7 +4634,7 @@ const jo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4679
4634
  }))
4680
4635
  });
4681
4636
  }, $o = () => {
4682
- const e = ws(), t = ee(), { user: n } = rt(), s = n == null ? void 0 : n.id;
4637
+ const e = ws(), t = ee(), { user: n } = ht(), s = n == null ? void 0 : n.id;
4683
4638
  return ke({
4684
4639
  queryKey: [V, "permissions", s],
4685
4640
  queryFn: () => t(e, {
@@ -4725,19 +4680,19 @@ const jo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4725
4680
  }
4726
4681
  } };
4727
4682
  }, Yo = () => {
4728
- const { data: e } = Rn(), t = ne(), n = ee();
4683
+ const { data: e } = Un(), t = ne(), n = ee();
4729
4684
  return {
4730
- getPartialBlocks: Te(async () => {
4685
+ getPartialBlocks: _e(async () => {
4731
4686
  const s = {};
4732
4687
  for (const a of e ?? [])
4733
- he(a == null ? void 0 : a.slug) && (s[a.id] = {
4688
+ de(a == null ? void 0 : a.slug) && (s[a.id] = {
4734
4689
  type: a.pageType,
4735
4690
  name: qt(a.name ?? a.slug),
4736
4691
  description: ""
4737
4692
  });
4738
4693
  return s;
4739
4694
  }, [e]),
4740
- getPartialBlockBlocks: Te(
4695
+ getPartialBlockBlocks: _e(
4741
4696
  async (s) => {
4742
4697
  if (!s) return [];
4743
4698
  try {
@@ -4753,11 +4708,11 @@ const jo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4753
4708
  [n, t]
4754
4709
  )
4755
4710
  };
4756
- }, js = An.object({
4711
+ }, Hs = An.object({
4757
4712
  email: An.string().email({ message: "Please enter a valid email address" }),
4758
4713
  password: An.string().min(6, { message: "Password must be at least 6 characters" })
4759
4714
  }), Qo = () => {
4760
- const { setUser: e, logout: t } = rt(), n = ws(), [s, a] = I(""), [i, l] = I(""), [o, c] = I({}), [d, h] = I(!1), [f, y] = I(""), v = _e({
4715
+ const { setUser: e, logout: t } = ht(), n = ws(), [s, a] = I(""), [i, l] = I(""), [o, c] = I({}), [d, h] = I(!1), [f, y] = I(""), v = Pe({
4761
4716
  mutationFn: async (E) => {
4762
4717
  y("");
4763
4718
  const C = await bs(n, {
@@ -4788,7 +4743,7 @@ const jo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4788
4743
  E.preventDefault(), c({});
4789
4744
  const C = { email: s, password: i };
4790
4745
  try {
4791
- const N = js.parse(C);
4746
+ const N = Hs.parse(C);
4792
4747
  v.mutate(N);
4793
4748
  } catch (N) {
4794
4749
  if (N instanceof An.ZodError) {
@@ -4799,7 +4754,7 @@ const jo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4799
4754
  c(_);
4800
4755
  }
4801
4756
  }
4802
- }, A = js.safeParse({ email: s, password: i }).success;
4757
+ }, A = Hs.safeParse({ email: s, password: i }).success;
4803
4758
  return /* @__PURE__ */ r("div", { className: "flex justify-center items-center min-h-screen bg-slate-50", children: /* @__PURE__ */ u(cs, { className: "w-full max-w-md", children: [
4804
4759
  /* @__PURE__ */ u(us, { children: [
4805
4760
  /* @__PURE__ */ r(ds, { className: "text-2xl", children: "Sign in" }),
@@ -4904,7 +4859,7 @@ const jo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4904
4859
  ] }) });
4905
4860
  };
4906
4861
  let Wn = Qo;
4907
- const Xo = () => W(() => Wn, [Wn]), td = (e) => {
4862
+ const Xo = () => J(() => Wn, [Wn]), ed = (e) => {
4908
4863
  Wn = e;
4909
4864
  }, Zo = () => {
4910
4865
  const e = Xo();
@@ -4966,13 +4921,13 @@ function Ze({
4966
4921
  ) }) }),
4967
4922
  /* @__PURE__ */ r(ps, { children: "Add field" })
4968
4923
  ] }),
4969
- /* @__PURE__ */ r(pr, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ u(Pi, { children: [
4970
- /* @__PURE__ */ r(_i, { className: "border-none", placeholder: "Search..." }),
4924
+ /* @__PURE__ */ r(pr, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ u(_i, { children: [
4925
+ /* @__PURE__ */ r(Pi, { className: "border-none", placeholder: "Search..." }),
4971
4926
  /* @__PURE__ */ u(Ii, { children: [
4972
4927
  /* @__PURE__ */ r(ki, { children: "No option found." }),
4973
4928
  /* @__PURE__ */ u(Li, { children: [
4974
4929
  l.length > 0 && /* @__PURE__ */ u(
4975
- Us,
4930
+ Rs,
4976
4931
  {
4977
4932
  onSelect: y,
4978
4933
  className: "flex items-center text-sm",
@@ -4983,7 +4938,7 @@ function Ze({
4983
4938
  }
4984
4939
  ),
4985
4940
  v.map((p) => /* @__PURE__ */ u(
4986
- Us,
4941
+ Rs,
4987
4942
  {
4988
4943
  onSelect: () => f(p),
4989
4944
  className: "flex items-center justify-between",
@@ -5014,8 +4969,8 @@ function Ze({
5014
4969
  ] });
5015
4970
  }
5016
4971
  const tc = () => {
5017
- const { selectedLang: e } = ht(), { data: t, isFetching: n } = un();
5018
- return { data: W(() => ye(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
4972
+ const { selectedLang: e } = dt(), { data: t, isFetching: n } = un();
4973
+ return { data: J(() => ye(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
5019
4974
  }, nc = (e, t) => {
5020
4975
  const n = e.selectionStart || 0, s = e.selectionEnd || 0, a = e.value, i = a.substring(0, n), l = a.substring(s);
5021
4976
  let o = !1;
@@ -5035,7 +4990,7 @@ const tc = () => {
5035
4990
  newCursorPos: v
5036
4991
  };
5037
4992
  }, Wr = () => {
5038
- const { t: e } = hi(), { selectedLang: t, fallbackLang: n, languages: s } = ht(), [, a] = mi(), { data: i } = qr(), { data: l, isFetching: o } = tc(), c = l == null ? void 0 : l.seo, d = dt(
4993
+ const { t: e } = hi(), { selectedLang: t, fallbackLang: n, languages: s } = dt(), [, a] = mi(), { data: i } = qr(), { data: l, isFetching: o } = tc(), c = l == null ? void 0 : l.seo, d = ut(
5039
4994
  null
5040
4995
  ), [h, f] = I({
5041
4996
  title: "",
@@ -5050,7 +5005,7 @@ const tc = () => {
5050
5005
  searchDescription: "",
5051
5006
  jsonLD: "",
5052
5007
  ...c
5053
- }), y = dt({ initial: h, updated: h }), v = t.length ? t : n, { mutate: p, isPending: A } = As(), E = A, { hasPermission: C } = Lt(), N = C(me.EDIT_SEO);
5008
+ }), y = ut({ initial: h, updated: h }), v = t.length ? t : n, { mutate: p, isPending: A } = As(), E = A, { hasPermission: C } = Lt(), N = C(me.EDIT_SEO);
5054
5009
  Ne(() => {
5055
5010
  !o && c && f({
5056
5011
  title: "",
@@ -5088,45 +5043,45 @@ const tc = () => {
5088
5043
  searchTitle: h.ogTitle,
5089
5044
  searchDescription: h.ogDescription
5090
5045
  });
5091
- }, T = (O, Z) => {
5092
- const B = document.getElementById(Z);
5046
+ }, T = (O, X) => {
5047
+ const B = document.getElementById(X);
5093
5048
  if (B) {
5094
5049
  const { value: S, newCursorPos: G } = nc(
5095
5050
  B,
5096
5051
  O
5097
5052
  );
5098
5053
  d.current = {
5099
- id: Z,
5054
+ id: X,
5100
5055
  position: G
5101
- }, B.tagName.toLowerCase() === "input" ? (B.value = S, f((de) => ({
5102
- ...de,
5056
+ }, B.tagName.toLowerCase() === "input" ? (B.value = S, f((he) => ({
5057
+ ...he,
5103
5058
  [B.name]: S
5104
- })), B.focus(), B.setSelectionRange(G, G), [0, 10, 50, 100, 200].forEach((de) => {
5059
+ })), B.focus(), B.setSelectionRange(G, G), [0, 10, 50, 100, 200].forEach((he) => {
5105
5060
  setTimeout(() => {
5106
- const Ce = document.getElementById(Z);
5107
- Ce && (Ce.focus(), Ce.setSelectionRange(G, G));
5108
- }, de);
5061
+ const Te = document.getElementById(X);
5062
+ Te && (Te.focus(), Te.setSelectionRange(G, G));
5063
+ }, he);
5109
5064
  })) : (f((F) => ({
5110
5065
  ...F,
5111
5066
  [B.name]: S
5112
5067
  })), requestAnimationFrame(() => {
5113
5068
  const F = document.getElementById(
5114
- Z
5069
+ X
5115
5070
  );
5116
5071
  F && (F.focus(), F.setSelectionRange(G, G), setTimeout(() => {
5117
- const de = document.getElementById(
5118
- Z
5072
+ const he = document.getElementById(
5073
+ X
5119
5074
  );
5120
- de && (de.focus(), de.setSelectionRange(G, G));
5075
+ he && (he.focus(), he.setSelectionRange(G, G));
5121
5076
  }, 50));
5122
5077
  }));
5123
5078
  }
5124
5079
  }, se = (O) => {
5125
- const Z = {
5080
+ const X = {
5126
5081
  ...h,
5127
5082
  [O.target.name]: O.target.name === "noIndex" || O.target.name === "noFollow" ? O.target.checked : O.target.value
5128
5083
  };
5129
- f(Z), y.current.updated = Z;
5084
+ f(X), y.current.updated = X;
5130
5085
  };
5131
5086
  return /* @__PURE__ */ u("div", { className: "relative h-full flex flex-col", children: [
5132
5087
  !N && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-10 backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ r(yr, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ r(Di, { children: e(
@@ -5140,7 +5095,7 @@ const tc = () => {
5140
5095
  "  ",
5141
5096
  s.length > 0 && /* @__PURE__ */ u("span", { className: "font-semibold text-blue-500", children: [
5142
5097
  "(",
5143
- $(je, v, v),
5098
+ $(He, v, v),
5144
5099
  ")"
5145
5100
  ] })
5146
5101
  ] }),
@@ -5186,7 +5141,7 @@ const tc = () => {
5186
5141
  )
5187
5142
  ] }),
5188
5143
  /* @__PURE__ */ r(
5189
- Ut,
5144
+ Rt,
5190
5145
  {
5191
5146
  id: "description",
5192
5147
  name: "description",
@@ -5320,7 +5275,7 @@ const tc = () => {
5320
5275
  )
5321
5276
  ] }),
5322
5277
  /* @__PURE__ */ r(
5323
- Ut,
5278
+ Rt,
5324
5279
  {
5325
5280
  id: "ogDescription",
5326
5281
  name: "ogDescription",
@@ -5414,7 +5369,7 @@ const tc = () => {
5414
5369
  )
5415
5370
  ] }),
5416
5371
  /* @__PURE__ */ r(
5417
- Ut,
5372
+ Rt,
5418
5373
  {
5419
5374
  id: "searchDescription",
5420
5375
  rows: 5,
@@ -5444,7 +5399,7 @@ const tc = () => {
5444
5399
  )
5445
5400
  ] }),
5446
5401
  /* @__PURE__ */ r(
5447
- Ut,
5402
+ Rt,
5448
5403
  {
5449
5404
  id: "jsonLD",
5450
5405
  name: "jsonLD",
@@ -5511,9 +5466,9 @@ const Yr = "seo", sc = ({
5511
5466
  }, ac = () => {
5512
5467
  $n(Yr, rc), $n($r, ec);
5513
5468
  }, ic = "user-info", lc = () => {
5514
- const { user: e, logout: t } = rt(), n = at("onLogout", Xa);
5515
- return e ? /* @__PURE__ */ u(Ri, { children: [
5516
- /* @__PURE__ */ r(Ui, { asChild: !0, children: /* @__PURE__ */ r(P, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ r(dl, { className: "w-4 h-4" }) }) }),
5469
+ const { user: e, logout: t } = ht(), n = Ae(), s = rt("onLogout", Xa);
5470
+ return e ? /* @__PURE__ */ u(Ui, { children: [
5471
+ /* @__PURE__ */ r(Ri, { asChild: !0, children: /* @__PURE__ */ r(P, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ r(dl, { className: "w-4 h-4" }) }) }),
5517
5472
  /* @__PURE__ */ u(Oi, { className: "w-auto p-4 space-y-2", children: [
5518
5473
  /* @__PURE__ */ r("div", { className: "text-sm font-medium", children: e.name ?? e.email }),
5519
5474
  /* @__PURE__ */ r("div", { className: "text-xs text-muted-foreground", children: e.email }),
@@ -5530,7 +5485,7 @@ const Yr = "seo", sc = ({
5530
5485
  mr,
5531
5486
  {
5532
5487
  onClick: () => {
5533
- t(), Za(n) && n();
5488
+ t(), n.invalidateQueries({ queryKey: [V] }), Za(s) && s();
5534
5489
  },
5535
5490
  children: "Logout"
5536
5491
  }
@@ -5552,28 +5507,28 @@ var q = {
5552
5507
  effects: void 0,
5553
5508
  done: !1,
5554
5509
  getContextId() {
5555
- return Hs(this.context.count);
5510
+ return js(this.context.count);
5556
5511
  },
5557
5512
  getNextContextId() {
5558
- return Hs(this.context.count++);
5513
+ return js(this.context.count++);
5559
5514
  }
5560
5515
  };
5561
- function Hs(e) {
5516
+ function js(e) {
5562
5517
  const t = String(e), n = t.length - 1;
5563
5518
  return q.context.id + (n ? String.fromCharCode(96 + n) : "") + t;
5564
5519
  }
5565
5520
  function Ot(e) {
5566
5521
  q.context = e;
5567
5522
  }
5568
- var cc = (e, t) => e === t, Cn = Symbol("solid-proxy"), Qr = typeof Proxy == "function", Xr = Symbol("solid-track"), Pn = {
5523
+ var cc = (e, t) => e === t, Cn = Symbol("solid-proxy"), Qr = typeof Proxy == "function", Xr = Symbol("solid-track"), _n = {
5569
5524
  equals: cc
5570
- }, Zr = ra, nt = 1, _n = 2, Jr = {
5525
+ }, Zr = ra, nt = 1, Pn = 2, Jr = {
5571
5526
  owned: null,
5572
5527
  cleanups: null,
5573
5528
  context: null,
5574
5529
  owner: null
5575
- }, Hn = {}, ie = null, Kn = null, uc = null, ce = null, Le = null, et = null, Un = 0;
5576
- function ct(e, t) {
5530
+ }, jn = {}, ie = null, Kn = null, uc = null, ce = null, Le = null, et = null, Rn = 0;
5531
+ function ot(e, t) {
5577
5532
  const n = ce, s = ie, a = e.length === 0, i = t === void 0 ? s : t, l = a ? Jr : {
5578
5533
  owned: null,
5579
5534
  cleanups: null,
@@ -5588,7 +5543,7 @@ function ct(e, t) {
5588
5543
  }
5589
5544
  }
5590
5545
  function Se(e, t) {
5591
- t = t ? Object.assign({}, Pn, t) : Pn;
5546
+ t = t ? Object.assign({}, _n, t) : _n;
5592
5547
  const n = {
5593
5548
  value: e,
5594
5549
  observers: null,
@@ -5601,7 +5556,7 @@ function dc(e, t, n) {
5601
5556
  const s = On(e, t, !0, nt);
5602
5557
  Gt(s);
5603
5558
  }
5604
- function ut(e, t, n) {
5559
+ function ct(e, t, n) {
5605
5560
  const s = On(e, t, !1, nt);
5606
5561
  Gt(s);
5607
5562
  }
@@ -5610,8 +5565,8 @@ function ea(e, t, n) {
5610
5565
  const s = On(e, t, !1, nt);
5611
5566
  (!n || !n.render) && (s.user = !0), et ? et.push(s) : Gt(s);
5612
5567
  }
5613
- function Re(e, t, n) {
5614
- n = n ? Object.assign({}, Pn, n) : Pn;
5568
+ function Ue(e, t, n) {
5569
+ n = n ? Object.assign({}, _n, n) : _n;
5615
5570
  const s = On(e, t, !0, 0);
5616
5571
  return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, Gt(s), na.bind(s);
5617
5572
  }
@@ -5621,34 +5576,34 @@ function hc(e) {
5621
5576
  function mc(e, t, n) {
5622
5577
  let s, a, i;
5623
5578
  arguments.length === 1 ? (s = !0, a = e, i = {}) : (s = e, a = t, i = {});
5624
- let l = null, o = Hn, c = null, d = !1, h = "initialValue" in i, f = typeof s == "function" && Re(s);
5579
+ let l = null, o = jn, c = null, d = !1, h = "initialValue" in i, f = typeof s == "function" && Ue(s);
5625
5580
  const y = /* @__PURE__ */ new Set(), [v, p] = (i.storage || Se)(i.initialValue), [A, E] = Se(void 0), [C, N] = Se(void 0, {
5626
5581
  equals: !1
5627
5582
  }), [_, w] = Se(h ? "ready" : "unresolved");
5628
5583
  q.context && (c = q.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : q.load && q.has(c) && (o = q.load(c)));
5629
- function k(Z, B, S, G) {
5630
- return l === Z && (l = null, G !== void 0 && (h = !0), (Z === o || B === o) && i.onHydrated && queueMicrotask(
5584
+ function k(X, B, S, G) {
5585
+ return l === X && (l = null, G !== void 0 && (h = !0), (X === o || B === o) && i.onHydrated && queueMicrotask(
5631
5586
  () => i.onHydrated(G, {
5632
5587
  value: B
5633
5588
  })
5634
- ), o = Hn, T(B, S)), B;
5589
+ ), o = jn, T(B, S)), B;
5635
5590
  }
5636
- function T(Z, B) {
5591
+ function T(X, B) {
5637
5592
  Ye(() => {
5638
- B === void 0 && p(() => Z), w(B !== void 0 ? "errored" : h ? "ready" : "unresolved"), E(B);
5593
+ B === void 0 && p(() => X), w(B !== void 0 ? "errored" : h ? "ready" : "unresolved"), E(B);
5639
5594
  for (const S of y.keys())
5640
5595
  S.decrement();
5641
5596
  y.clear();
5642
5597
  }, !1);
5643
5598
  }
5644
5599
  function se() {
5645
- const Z = vc, B = v(), S = A();
5600
+ const X = vc, B = v(), S = A();
5646
5601
  if (S !== void 0 && !l)
5647
5602
  throw S;
5648
5603
  return ce && ce.user, B;
5649
5604
  }
5650
- function O(Z = !0) {
5651
- if (Z !== !1 && d)
5605
+ function O(X = !0) {
5606
+ if (X !== !1 && d)
5652
5607
  return;
5653
5608
  d = !1;
5654
5609
  const B = f ? f() : s;
@@ -5656,10 +5611,10 @@ function mc(e, t, n) {
5656
5611
  k(l, Ie(v));
5657
5612
  return;
5658
5613
  }
5659
- const S = o !== Hn ? o : Ie(
5614
+ const S = o !== jn ? o : Ie(
5660
5615
  () => a(B, {
5661
5616
  value: v(),
5662
- refetching: Z
5617
+ refetching: X
5663
5618
  })
5664
5619
  );
5665
5620
  return hc(S) ? (l = S, "value" in S ? (S.status === "success" ? k(l, S.value, void 0, B) : k(l, void 0, Yn(S.value), B), S) : (d = !0, queueMicrotask(() => d = !1), Ye(() => {
@@ -5678,17 +5633,17 @@ function mc(e, t, n) {
5678
5633
  },
5679
5634
  loading: {
5680
5635
  get() {
5681
- const Z = _();
5682
- return Z === "pending" || Z === "refreshing";
5636
+ const X = _();
5637
+ return X === "pending" || X === "refreshing";
5683
5638
  }
5684
5639
  },
5685
5640
  latest: {
5686
5641
  get() {
5687
5642
  if (!h)
5688
5643
  return se();
5689
- const Z = A();
5690
- if (Z && !l)
5691
- throw Z;
5644
+ const X = A();
5645
+ if (X && !l)
5646
+ throw X;
5692
5647
  return v();
5693
5648
  }
5694
5649
  }
@@ -5700,7 +5655,7 @@ function mc(e, t, n) {
5700
5655
  }
5701
5656
  ];
5702
5657
  }
5703
- function nd(e) {
5658
+ function td(e) {
5704
5659
  return Ye(e, !1);
5705
5660
  }
5706
5661
  function Ie(e) {
@@ -5714,7 +5669,7 @@ function Ie(e) {
5714
5669
  ce = t;
5715
5670
  }
5716
5671
  }
5717
- function sd(e, t, n) {
5672
+ function nd(e, t, n) {
5718
5673
  const s = Array.isArray(e);
5719
5674
  let a, i = n && n.defer;
5720
5675
  return (l) => {
@@ -5734,7 +5689,7 @@ function sd(e, t, n) {
5734
5689
  function fc(e) {
5735
5690
  ea(() => Ie(e));
5736
5691
  }
5737
- function Ht(e) {
5692
+ function jt(e) {
5738
5693
  return ie === null || (ie.cleanups === null ? ie.cleanups = [e] : ie.cleanups.push(e)), e;
5739
5694
  }
5740
5695
  function Ks() {
@@ -5746,7 +5701,7 @@ function gc(e, t) {
5746
5701
  try {
5747
5702
  return Ye(t, !0);
5748
5703
  } catch (a) {
5749
- Ps(a);
5704
+ _s(a);
5750
5705
  } finally {
5751
5706
  ie = n, ce = s;
5752
5707
  }
@@ -5759,11 +5714,11 @@ function pc(e) {
5759
5714
  return Ye(e, !1), ce = ie = null, s ? s.done : void 0;
5760
5715
  });
5761
5716
  }
5762
- var [yc, rd] = /* @__PURE__ */ Se(!1);
5763
- function ad() {
5717
+ var [yc, sd] = /* @__PURE__ */ Se(!1);
5718
+ function rd() {
5764
5719
  return [yc, pc];
5765
5720
  }
5766
- function id(e, t) {
5721
+ function ad(e, t) {
5767
5722
  const n = Symbol("context");
5768
5723
  return {
5769
5724
  id: n,
@@ -5771,12 +5726,12 @@ function id(e, t) {
5771
5726
  defaultValue: e
5772
5727
  };
5773
5728
  }
5774
- function ld(e) {
5729
+ function id(e) {
5775
5730
  let t;
5776
5731
  return ie && ie.context && (t = ie.context[e.id]) !== void 0 ? t : e.defaultValue;
5777
5732
  }
5778
5733
  function ta(e) {
5779
- const t = Re(e), n = Re(() => Qn(t()));
5734
+ const t = Ue(e), n = Ue(() => Qn(t()));
5780
5735
  return n.toArray = () => {
5781
5736
  const s = n();
5782
5737
  return Array.isArray(s) ? s : s != null ? [s] : [];
@@ -5812,7 +5767,7 @@ function Gt(e) {
5812
5767
  if (!e.fn)
5813
5768
  return;
5814
5769
  Kt(e);
5815
- const t = Un;
5770
+ const t = Rn;
5816
5771
  Ec(
5817
5772
  e,
5818
5773
  e.value,
@@ -5826,7 +5781,7 @@ function Ec(e, t, n) {
5826
5781
  try {
5827
5782
  s = e.fn(t);
5828
5783
  } catch (l) {
5829
- return e.pure && (e.state = nt, e.owned && e.owned.forEach(Kt), e.owned = null), e.updatedAt = n + 1, Ps(l);
5784
+ return e.pure && (e.state = nt, e.owned && e.owned.forEach(Kt), e.owned = null), e.updatedAt = n + 1, _s(l);
5830
5785
  } finally {
5831
5786
  ce = i, ie = a;
5832
5787
  }
@@ -5851,17 +5806,17 @@ function On(e, t, n, s = nt, a) {
5851
5806
  function In(e) {
5852
5807
  if (e.state === 0)
5853
5808
  return;
5854
- if (e.state === _n)
5809
+ if (e.state === Pn)
5855
5810
  return kn(e);
5856
5811
  if (e.suspense && Ie(e.suspense.inFallback))
5857
5812
  return e.suspense.effects.push(e);
5858
5813
  const t = [e];
5859
- for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < Un); )
5814
+ for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < Rn); )
5860
5815
  e.state && t.push(e);
5861
5816
  for (let n = t.length - 1; n >= 0; n--)
5862
5817
  if (e = t[n], e.state === nt)
5863
5818
  Gt(e);
5864
- else if (e.state === _n) {
5819
+ else if (e.state === Pn) {
5865
5820
  const s = Le;
5866
5821
  Le = null, Ye(() => kn(e, t[0]), !1), Le = s;
5867
5822
  }
@@ -5870,12 +5825,12 @@ function Ye(e, t) {
5870
5825
  if (Le)
5871
5826
  return e();
5872
5827
  let n = !1;
5873
- t || (Le = []), et ? n = !0 : et = [], Un++;
5828
+ t || (Le = []), et ? n = !0 : et = [], Rn++;
5874
5829
  try {
5875
5830
  const s = e();
5876
5831
  return bc(n), s;
5877
5832
  } catch (s) {
5878
- n || (et = null), Le = null, Ps(s);
5833
+ n || (et = null), Le = null, _s(s);
5879
5834
  }
5880
5835
  }
5881
5836
  function bc(e) {
@@ -5910,14 +5865,14 @@ function kn(e, t) {
5910
5865
  const s = e.sources[n];
5911
5866
  if (s.sources) {
5912
5867
  const a = s.state;
5913
- a === nt ? s !== t && (!s.updatedAt || s.updatedAt < Un) && In(s) : a === _n && kn(s, t);
5868
+ a === nt ? s !== t && (!s.updatedAt || s.updatedAt < Rn) && In(s) : a === Pn && kn(s, t);
5914
5869
  }
5915
5870
  }
5916
5871
  }
5917
5872
  function aa(e) {
5918
5873
  for (let t = 0; t < e.observers.length; t += 1) {
5919
5874
  const n = e.observers[t];
5920
- n.state || (n.state = _n, n.pure ? Le.push(n) : et.push(n), n.observers && aa(n));
5875
+ n.state || (n.state = Pn, n.pure ? Le.push(n) : et.push(n), n.observers && aa(n));
5921
5876
  }
5922
5877
  }
5923
5878
  function Kt(e) {
@@ -5952,7 +5907,7 @@ function Yn(e) {
5952
5907
  cause: e
5953
5908
  });
5954
5909
  }
5955
- function Ps(e, t = ie) {
5910
+ function _s(e, t = ie) {
5956
5911
  throw Yn(e);
5957
5912
  }
5958
5913
  function Qn(e) {
@@ -5971,7 +5926,7 @@ function Qn(e) {
5971
5926
  function Sc(e, t) {
5972
5927
  return function(s) {
5973
5928
  let a;
5974
- return ut(
5929
+ return ct(
5975
5930
  () => a = Ie(() => (ie.context = {
5976
5931
  ...ie.context,
5977
5932
  [e]: s.value
@@ -5987,15 +5942,15 @@ function Ln(e) {
5987
5942
  }
5988
5943
  function Nc(e, t, n = {}) {
5989
5944
  let s = [], a = [], i = [], l = 0, o = t.length > 1 ? [] : null;
5990
- return Ht(() => Ln(i)), () => {
5945
+ return jt(() => Ln(i)), () => {
5991
5946
  let c = e() || [], d = c.length, h, f;
5992
5947
  return c[Xr], Ie(() => {
5993
5948
  let v, p, A, E, C, N, _, w, k;
5994
5949
  if (d === 0)
5995
- l !== 0 && (Ln(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Xn], a[0] = ct((T) => (i[0] = T, n.fallback())), l = 1);
5950
+ l !== 0 && (Ln(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Xn], a[0] = ot((T) => (i[0] = T, n.fallback())), l = 1);
5996
5951
  else if (l === 0) {
5997
5952
  for (a = new Array(d), f = 0; f < d; f++)
5998
- s[f] = c[f], a[f] = ct(y);
5953
+ s[f] = c[f], a[f] = ot(y);
5999
5954
  l = d;
6000
5955
  } else {
6001
5956
  for (A = new Array(d), E = new Array(d), o && (C = new Array(d)), N = 0, _ = Math.min(l, d); N < _ && s[N] === c[N]; N++)
@@ -6007,7 +5962,7 @@ function Nc(e, t, n = {}) {
6007
5962
  for (h = N; h <= _; h++)
6008
5963
  k = s[h], f = v.get(k), f !== void 0 && f !== -1 ? (A[f] = a[h], E[f] = i[h], o && (C[f] = o[h]), f = p[f], v.set(k, f)) : i[h]();
6009
5964
  for (f = N; f < d; f++)
6010
- f in A ? (a[f] = A[f], i[f] = E[f], o && (o[f] = C[f], o[f](f))) : a[f] = ct(y);
5965
+ f in A ? (a[f] = A[f], i[f] = E[f], o && (o[f] = C[f], o[f](f))) : a[f] = ot(y);
6011
5966
  a = a.slice(0, l = d), s = c.slice(0);
6012
5967
  }
6013
5968
  return a;
@@ -6023,13 +5978,13 @@ function Nc(e, t, n = {}) {
6023
5978
  }
6024
5979
  function Ac(e, t, n = {}) {
6025
5980
  let s = [], a = [], i = [], l = [], o = 0, c;
6026
- return Ht(() => Ln(i)), () => {
5981
+ return jt(() => Ln(i)), () => {
6027
5982
  const d = e() || [], h = d.length;
6028
5983
  return d[Xr], Ie(() => {
6029
5984
  if (h === 0)
6030
- return o !== 0 && (Ln(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [Xn], a[0] = ct((y) => (i[0] = y, n.fallback())), o = 1), a;
5985
+ return o !== 0 && (Ln(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [Xn], a[0] = ot((y) => (i[0] = y, n.fallback())), o = 1), a;
6031
5986
  for (s[0] === Xn && (i[0](), i = [], s = [], a = [], o = 0), c = 0; c < h; c++)
6032
- c < s.length && s[c] !== d[c] ? l[c](() => d[c]) : c >= s.length && (a[c] = ct(f));
5987
+ c < s.length && s[c] !== d[c] ? l[c](() => d[c]) : c >= s.length && (a[c] = ot(f));
6033
5988
  for (; c < s.length; c++)
6034
5989
  i[c]();
6035
5990
  return o = l.length = i.length = h, s = d.slice(0), a = a.slice(0, o);
@@ -6085,7 +6040,7 @@ function la(...e) {
6085
6040
  let t = !1;
6086
6041
  for (let l = 0; l < e.length; l++) {
6087
6042
  const o = e[l];
6088
- t = t || !!o && Cn in o, e[l] = typeof o == "function" ? (t = !0, Re(o)) : o;
6043
+ t = t || !!o && Cn in o, e[l] = typeof o == "function" ? (t = !0, Ue(o)) : o;
6089
6044
  }
6090
6045
  if (Qr && t)
6091
6046
  return new Proxy(
@@ -6199,7 +6154,7 @@ function oa(e) {
6199
6154
  t = o;
6200
6155
  }
6201
6156
  let l;
6202
- return Re(
6157
+ return Ue(
6203
6158
  () => (l = t()) ? Ie(() => {
6204
6159
  if (!i || q.done)
6205
6160
  return l(a);
@@ -6213,27 +6168,27 @@ function oa(e) {
6213
6168
  return s.preload = () => n || ((n = e()).then((a) => t = () => a.default), n), s;
6214
6169
  }
6215
6170
  var Cc = 0;
6216
- function od() {
6171
+ function ld() {
6217
6172
  return q.context ? q.getNextContextId() : `cl-${Cc++}`;
6218
6173
  }
6219
6174
  var ca = (e) => `Stale read from <${e}>.`;
6220
- function cd(e) {
6175
+ function od(e) {
6221
6176
  const t = "fallback" in e && {
6222
6177
  fallback: () => e.fallback
6223
6178
  };
6224
- return Re(Nc(() => e.each, e.children, t || void 0));
6179
+ return Ue(Nc(() => e.each, e.children, t || void 0));
6225
6180
  }
6226
- function ud(e) {
6181
+ function cd(e) {
6227
6182
  const t = "fallback" in e && {
6228
6183
  fallback: () => e.fallback
6229
6184
  };
6230
- return Re(Ac(() => e.each, e.children, t || void 0));
6185
+ return Ue(Ac(() => e.each, e.children, t || void 0));
6231
6186
  }
6232
- function dd(e) {
6233
- const t = e.keyed, n = Re(() => e.when, void 0, {
6187
+ function ud(e) {
6188
+ const t = e.keyed, n = Ue(() => e.when, void 0, {
6234
6189
  equals: (s, a) => t ? s === a : !s == !a
6235
6190
  });
6236
- return Re(
6191
+ return Ue(
6237
6192
  () => {
6238
6193
  const s = n();
6239
6194
  if (s) {
@@ -6254,9 +6209,9 @@ function dd(e) {
6254
6209
  void 0
6255
6210
  );
6256
6211
  }
6257
- function hd(e) {
6212
+ function dd(e) {
6258
6213
  let t = !1;
6259
- const n = (i, l) => (t ? i[1] === l[1] : !i[1] == !l[1]) && i[2] === l[2], s = ta(() => e.children), a = Re(
6214
+ const n = (i, l) => (t ? i[1] === l[1] : !i[1] == !l[1]) && i[2] === l[2], s = ta(() => e.children), a = Ue(
6260
6215
  () => {
6261
6216
  let i = s();
6262
6217
  Array.isArray(i) || (i = [i]);
@@ -6272,7 +6227,7 @@ function hd(e) {
6272
6227
  equals: n
6273
6228
  }
6274
6229
  );
6275
- return Re(
6230
+ return Ue(
6276
6231
  () => {
6277
6232
  const [i, l, o] = a();
6278
6233
  if (i < 0)
@@ -6292,10 +6247,10 @@ function hd(e) {
6292
6247
  void 0
6293
6248
  );
6294
6249
  }
6295
- function md(e) {
6250
+ function hd(e) {
6296
6251
  return e;
6297
6252
  }
6298
- var Pc = [
6253
+ var _c = [
6299
6254
  "allowfullscreen",
6300
6255
  "async",
6301
6256
  "autofocus",
@@ -6321,7 +6276,7 @@ var Pc = [
6321
6276
  "reversed",
6322
6277
  "seamless",
6323
6278
  "selected"
6324
- ], _c = /* @__PURE__ */ new Set([
6279
+ ], Pc = /* @__PURE__ */ new Set([
6325
6280
  "className",
6326
6281
  "value",
6327
6282
  "readOnly",
@@ -6329,7 +6284,7 @@ var Pc = [
6329
6284
  "isMap",
6330
6285
  "noModule",
6331
6286
  "playsInline",
6332
- ...Pc
6287
+ ..._c
6333
6288
  ]), Ic = /* @__PURE__ */ new Set([
6334
6289
  "innerHTML",
6335
6290
  "textContent",
@@ -6390,7 +6345,7 @@ var Gc = /* @__PURE__ */ new Set([
6390
6345
  "touchend",
6391
6346
  "touchmove",
6392
6347
  "touchstart"
6393
- ]), Rc = /* @__PURE__ */ new Set([
6348
+ ]), Uc = /* @__PURE__ */ new Set([
6394
6349
  "altGlyph",
6395
6350
  "altGlyphDef",
6396
6351
  "altGlyphItem",
@@ -6468,7 +6423,7 @@ var Gc = /* @__PURE__ */ new Set([
6468
6423
  "use",
6469
6424
  "view",
6470
6425
  "vkern"
6471
- ]), Uc = {
6426
+ ]), Rc = {
6472
6427
  xlink: "http://www.w3.org/1999/xlink",
6473
6428
  xml: "http://www.w3.org/XML/1998/namespace"
6474
6429
  };
@@ -6520,13 +6475,13 @@ function Oc(e, t, n) {
6520
6475
  var Mt = "_$DX_DELEGATE";
6521
6476
  function ua(e, t, n, s = {}) {
6522
6477
  let a;
6523
- return ct((i) => {
6478
+ return ot((i) => {
6524
6479
  a = i, t === document ? e() : es(t, e(), t.firstChild ? null : void 0, n);
6525
6480
  }, s.owner), () => {
6526
6481
  a(), t.textContent = "";
6527
6482
  };
6528
6483
  }
6529
- function fd(e, t, n) {
6484
+ function md(e, t, n) {
6530
6485
  let s;
6531
6486
  const a = () => {
6532
6487
  const l = document.createElement("template");
@@ -6541,7 +6496,7 @@ function Bc(e, t = window.document) {
6541
6496
  n.has(i) || (n.add(i), t.addEventListener(i, da));
6542
6497
  }
6543
6498
  }
6544
- function gd(e = window.document) {
6499
+ function fd(e = window.document) {
6545
6500
  if (e[Mt]) {
6546
6501
  for (let t of e[Mt].keys())
6547
6502
  e.removeEventListener(t, da);
@@ -6560,7 +6515,7 @@ function Fc(e, t, n) {
6560
6515
  function qc(e, t) {
6561
6516
  mt(e) || (t == null ? e.removeAttribute("class") : e.className = t);
6562
6517
  }
6563
- function jc(e, t, n, s) {
6518
+ function Hc(e, t, n, s) {
6564
6519
  if (s)
6565
6520
  Array.isArray(n) ? (e[`$$${t}`] = n[0], e[`$$${t}Data`] = n[1]) : e[`$$${t}`] = n;
6566
6521
  else if (Array.isArray(n)) {
@@ -6569,7 +6524,7 @@ function jc(e, t, n, s) {
6569
6524
  } else
6570
6525
  e.addEventListener(t, n, typeof n != "function" && n);
6571
6526
  }
6572
- function Hc(e, t, n = {}) {
6527
+ function jc(e, t, n = {}) {
6573
6528
  const s = Object.keys(t || {}), a = Object.keys(n);
6574
6529
  let i, l;
6575
6530
  for (i = 0, l = a.length; i < l; i++) {
@@ -6598,9 +6553,9 @@ function Kc(e, t, n) {
6598
6553
  }
6599
6554
  function Vc(e, t = {}, n, s) {
6600
6555
  const a = {};
6601
- return s || ut(
6556
+ return s || ct(
6602
6557
  () => a.children = Vt(e, t.children, a.children)
6603
- ), ut(() => typeof t.ref == "function" && zc(t.ref, e)), ut(() => $c(e, t, n, !0, a, !0)), a;
6558
+ ), ct(() => typeof t.ref == "function" && zc(t.ref, e)), ct(() => $c(e, t, n, !0, a, !0)), a;
6604
6559
  }
6605
6560
  function zc(e, t, n) {
6606
6561
  return Ie(() => e(t, n));
@@ -6608,7 +6563,7 @@ function zc(e, t, n) {
6608
6563
  function es(e, t, n, s) {
6609
6564
  if (n !== void 0 && !s && (s = []), typeof t != "function")
6610
6565
  return Vt(e, t, s, n);
6611
- ut((a) => Vt(e, t(), a, n), s);
6566
+ ct((a) => Vt(e, t(), a, n), s);
6612
6567
  }
6613
6568
  function $c(e, t, n, s, a = {}, i = !1) {
6614
6569
  t || (t = {});
@@ -6645,7 +6600,7 @@ function zs(e, t, n, s, a, i, l) {
6645
6600
  if (t === "style")
6646
6601
  return Kc(e, n, s);
6647
6602
  if (t === "classList")
6648
- return Hc(e, n, s);
6603
+ return jc(e, n, s);
6649
6604
  if (n === s)
6650
6605
  return s;
6651
6606
  if (t === "ref")
@@ -6662,19 +6617,19 @@ function zs(e, t, n, s, a, i, l) {
6662
6617
  const p = Array.isArray(s) ? s[0] : s;
6663
6618
  e.removeEventListener(y, p);
6664
6619
  }
6665
- (v || n) && (jc(e, y, n, v), v && Bc([y]));
6620
+ (v || n) && (Hc(e, y, n, v), v && Bc([y]));
6666
6621
  } else if (t.slice(0, 5) === "attr:")
6667
6622
  Jn(e, t.slice(5), n);
6668
6623
  else if (t.slice(0, 5) === "bool:")
6669
6624
  Fc(e, t.slice(5), n);
6670
- else if ((f = t.slice(0, 5) === "prop:") || (d = Ic.has(t)) || !a && ((h = Dc(t, e.tagName)) || (c = _c.has(t))) || (o = e.nodeName.includes("-") || "is" in l)) {
6625
+ else if ((f = t.slice(0, 5) === "prop:") || (d = Ic.has(t)) || !a && ((h = Dc(t, e.tagName)) || (c = Pc.has(t))) || (o = e.nodeName.includes("-") || "is" in l)) {
6671
6626
  if (f)
6672
6627
  t = t.slice(5), c = !0;
6673
6628
  else if (mt(e))
6674
6629
  return n;
6675
6630
  t === "class" || t === "className" ? qc(e, n) : o && !c && !d ? e[Yc(t)] = n : e[h || t] = n;
6676
6631
  } else {
6677
- const y = a && t.indexOf(":") > -1 && Uc[t.split(":")[0]];
6632
+ const y = a && t.indexOf(":") > -1 && Rc[t.split(":")[0]];
6678
6633
  y ? Mc(e, y, t, n) : Jn(e, kc[t] || t, n);
6679
6634
  }
6680
6635
  return n;
@@ -6748,7 +6703,7 @@ function Vt(e, t, n, s, a) {
6748
6703
  n = ft(e, n, s);
6749
6704
  } else {
6750
6705
  if (l === "function")
6751
- return ut(() => {
6706
+ return ct(() => {
6752
6707
  let c = t();
6753
6708
  for (; typeof c == "function"; )
6754
6709
  c = c();
@@ -6757,7 +6712,7 @@ function Vt(e, t, n, s, a) {
6757
6712
  if (Array.isArray(t)) {
6758
6713
  const c = [], d = n && Array.isArray(n);
6759
6714
  if (ts(c, t, n, a))
6760
- return ut(() => n = Vt(e, c, n, s, !0)), () => n;
6715
+ return ct(() => n = Vt(e, c, n, s, !0)), () => n;
6761
6716
  if (i) {
6762
6717
  if (!c.length)
6763
6718
  return n;
@@ -6845,16 +6800,16 @@ var Xc = "http://www.w3.org/2000/svg";
6845
6800
  function ha(e, t = !1) {
6846
6801
  return t ? document.createElementNS(Xc, e) : document.createElement(e);
6847
6802
  }
6848
- function pd(e) {
6803
+ function gd(e) {
6849
6804
  const { useShadow: t } = e, n = document.createTextNode(""), s = () => e.mount || document.body, a = Ks();
6850
6805
  let i, l = !!q.context;
6851
6806
  return ea(
6852
6807
  () => {
6853
- l && (Ks().user = l = !1), i || (i = gc(a, () => Re(() => e.children)));
6808
+ l && (Ks().user = l = !1), i || (i = gc(a, () => Ue(() => e.children)));
6854
6809
  const o = s();
6855
6810
  if (o instanceof HTMLHeadElement) {
6856
6811
  const [c, d] = Se(!1), h = () => d(!0);
6857
- ct((f) => es(o, () => c() ? f() : i(), null)), Ht(h);
6812
+ ot((f) => es(o, () => c() ? f() : i(), null)), jt(h);
6858
6813
  } else {
6859
6814
  const c = ha(e.isSVG ? "g" : "div", e.isSVG), d = t && c.attachShadow ? c.attachShadow({
6860
6815
  mode: "open"
@@ -6864,7 +6819,7 @@ function pd(e) {
6864
6819
  return n.parentNode;
6865
6820
  },
6866
6821
  configurable: !0
6867
- }), es(d, i), o.appendChild(c), e.ref && e.ref(c), Ht(() => o.removeChild(c));
6822
+ }), es(d, i), o.appendChild(c), e.ref && e.ref(c), jt(() => o.removeChild(c));
6868
6823
  }
6869
6824
  },
6870
6825
  void 0,
@@ -6873,15 +6828,15 @@ function pd(e) {
6873
6828
  }
6874
6829
  ), n;
6875
6830
  }
6876
- function yd(e) {
6877
- const [t, n] = Tc(e, ["component"]), s = Re(() => t.component);
6878
- return Re(() => {
6831
+ function pd(e) {
6832
+ const [t, n] = Tc(e, ["component"]), s = Ue(() => t.component);
6833
+ return Ue(() => {
6879
6834
  const a = s();
6880
6835
  switch (typeof a) {
6881
6836
  case "function":
6882
6837
  return Ie(() => a(n));
6883
6838
  case "string":
6884
- const i = Rc.has(a), l = q.context ? Wc() : ha(a, i);
6839
+ const i = Uc.has(a), l = q.context ? Wc() : ha(a, i);
6885
6840
  return Vc(l, n, i), l;
6886
6841
  }
6887
6842
  });
@@ -7387,42 +7342,42 @@ ue.registerClass = ue.defaultInstance.registerClass.bind(ue.defaultInstance);
7387
7342
  ue.registerSymbol = ue.defaultInstance.registerSymbol.bind(ue.defaultInstance);
7388
7343
  ue.registerCustom = ue.defaultInstance.registerCustom.bind(ue.defaultInstance);
7389
7344
  ue.allowErrorProps = ue.defaultInstance.allowErrorProps.bind(ue.defaultInstance);
7390
- var Cu = ue.serialize, vd = ue.stringify;
7391
- function Ed(e) {
7345
+ var Cu = ue.serialize, yd = ue.stringify;
7346
+ function vd(e) {
7392
7347
  return e.state.fetchStatus === "fetching" ? "fetching" : e.getObserversCount() ? e.state.fetchStatus === "paused" ? "paused" : e.isStale() ? "stale" : "fresh" : "inactive";
7393
7348
  }
7394
- function bd(e, t) {
7349
+ function Ed(e, t) {
7395
7350
  return `${e}${t.charAt(0).toUpperCase() + t.slice(1)}`;
7396
7351
  }
7397
- function wd({
7352
+ function bd({
7398
7353
  queryState: e,
7399
7354
  observerCount: t,
7400
7355
  isStale: n
7401
7356
  }) {
7402
7357
  return e.fetchStatus === "fetching" ? "blue" : t ? e.fetchStatus === "paused" ? "purple" : n ? "yellow" : "green" : "gray";
7403
7358
  }
7404
- function Sd({
7359
+ function wd({
7405
7360
  status: e,
7406
7361
  isPaused: t
7407
7362
  }) {
7408
7363
  return t ? "purple" : e === "error" ? "red" : e === "pending" ? "yellow" : e === "success" ? "green" : "gray";
7409
7364
  }
7410
- function Nd(e) {
7365
+ function Sd(e) {
7411
7366
  return e === "fresh" ? "green" : e === "stale" ? "yellow" : e === "paused" ? "purple" : e === "inactive" ? "gray" : "blue";
7412
7367
  }
7413
- var Ad = (e, t = !1) => {
7368
+ var Nd = (e, t = !1) => {
7414
7369
  const {
7415
7370
  json: n
7416
7371
  } = Cu(e);
7417
7372
  return JSON.stringify(n, null, t ? 2 : void 0);
7418
- }, En = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Pu = (e, t) => e.queryHash.localeCompare(t.queryHash), Ca = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, _u = (e, t) => En(e) === En(t) ? Ca(e, t) : En(e) > En(t) ? 1 : -1, xd = {
7419
- status: _u,
7420
- "query hash": Pu,
7373
+ }, En = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, _u = (e, t) => e.queryHash.localeCompare(t.queryHash), Ca = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Pu = (e, t) => En(e) === En(t) ? Ca(e, t) : En(e) > En(t) ? 1 : -1, Ad = {
7374
+ status: Pu,
7375
+ "query hash": _u,
7421
7376
  "last updated": Ca
7422
- }, bn = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, Pa = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, Iu = (e, t) => bn(e) === bn(t) ? Pa(e, t) : bn(e) > bn(t) ? 1 : -1, Td = {
7377
+ }, bn = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, _a = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, Iu = (e, t) => bn(e) === bn(t) ? _a(e, t) : bn(e) > bn(t) ? 1 : -1, xd = {
7423
7378
  status: Iu,
7424
- "last updated": Pa
7425
- }, Cd = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), Pd = () => {
7379
+ "last updated": _a
7380
+ }, Td = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), Cd = () => {
7426
7381
  const [e, t] = Se("dark");
7427
7382
  return fc(() => {
7428
7383
  const n = window.matchMedia("(prefers-color-scheme: dark)");
@@ -7430,7 +7385,7 @@ var Ad = (e, t = !1) => {
7430
7385
  const s = (a) => {
7431
7386
  t(a.matches ? "dark" : "light");
7432
7387
  };
7433
- n.addEventListener("change", s), Ht(() => n.removeEventListener("change", s));
7388
+ n.addEventListener("change", s), jt(() => n.removeEventListener("change", s));
7434
7389
  }), e;
7435
7390
  }, wn = (e, t, n) => {
7436
7391
  if (t.length === 0)
@@ -7492,18 +7447,18 @@ var Ad = (e, t = !1) => {
7492
7447
  return n[s] = Sn(n[s], a), n;
7493
7448
  }
7494
7449
  return e;
7495
- }, _a = (e, t) => {
7450
+ }, Pa = (e, t) => {
7496
7451
  if (!e || document.querySelector("#_goober") || (t == null ? void 0 : t.querySelector("#_goober")))
7497
7452
  return;
7498
7453
  const s = document.createElement("style"), a = document.createTextNode("");
7499
7454
  s.appendChild(a), s.id = "_goober", s.setAttribute("nonce", e), t ? t.appendChild(s) : document.head.appendChild(s);
7500
- }, pt, Yt, Qt, Xt, lt, Zt, yt, vt, Et, bt, wt, St, Jt, Zs, ku = (Zs = class {
7455
+ }, pt, Yt, Qt, Xt, it, Zt, yt, vt, Et, bt, wt, St, Jt, Zs, ku = (Zs = class {
7501
7456
  constructor(e) {
7502
7457
  oe(this, pt);
7503
7458
  oe(this, Yt);
7504
7459
  oe(this, Qt);
7505
7460
  oe(this, Xt);
7506
- oe(this, lt, !1);
7461
+ oe(this, it, !1);
7507
7462
  oe(this, Zt);
7508
7463
  oe(this, yt);
7509
7464
  oe(this, vt);
@@ -7542,12 +7497,12 @@ var Ad = (e, t = !1) => {
7542
7497
  M(this, pt)[1](e);
7543
7498
  }
7544
7499
  mount(e) {
7545
- if (M(this, lt))
7500
+ if (M(this, it))
7546
7501
  throw new Error("Devtools is already mounted");
7547
7502
  const t = ua(() => {
7548
7503
  const n = this, [s] = M(this, vt), [a] = M(this, Et), [i] = M(this, bt), [l] = M(this, wt), [o] = M(this, pt);
7549
7504
  let c;
7550
- return M(this, St) ? c = M(this, St) : (c = oa(() => import("./HO4MOOFI-DrE4dbIW.js")), le(this, St, c)), _a(M(this, Zt), M(this, yt)), ia(c, la({
7505
+ return M(this, St) ? c = M(this, St) : (c = oa(() => import("./HO4MOOFI-3ZFIZEaF.js")), le(this, St, c)), Pa(M(this, Zt), M(this, yt)), ia(c, la({
7551
7506
  get queryFlavor() {
7552
7507
  return M(n, Qt);
7553
7508
  },
@@ -7578,28 +7533,28 @@ var Ad = (e, t = !1) => {
7578
7533
  }
7579
7534
  }));
7580
7535
  }, e);
7581
- le(this, lt, !0), le(this, Jt, t);
7536
+ le(this, it, !0), le(this, Jt, t);
7582
7537
  }
7583
7538
  unmount() {
7584
7539
  var e;
7585
- if (!M(this, lt))
7540
+ if (!M(this, it))
7586
7541
  throw new Error("Devtools is not mounted");
7587
- (e = M(this, Jt)) == null || e.call(this), le(this, lt, !1);
7542
+ (e = M(this, Jt)) == null || e.call(this), le(this, it, !1);
7588
7543
  }
7589
- }, pt = new WeakMap(), Yt = new WeakMap(), Qt = new WeakMap(), Xt = new WeakMap(), lt = new WeakMap(), Zt = new WeakMap(), yt = new WeakMap(), vt = new WeakMap(), Et = new WeakMap(), bt = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Jt = new WeakMap(), Zs), Nt, en, tn, nn, ot, sn, At, xt, Tt, Ct, Pt, _t, It, rn, Js, Lu = (Js = class {
7544
+ }, pt = new WeakMap(), Yt = new WeakMap(), Qt = new WeakMap(), Xt = new WeakMap(), it = new WeakMap(), Zt = new WeakMap(), yt = new WeakMap(), vt = new WeakMap(), Et = new WeakMap(), bt = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Jt = new WeakMap(), Zs), Nt, en, tn, nn, lt, sn, At, xt, Tt, Ct, _t, Pt, It, rn, Js, Lu = (Js = class {
7590
7545
  constructor(e) {
7591
7546
  oe(this, Nt);
7592
7547
  oe(this, en);
7593
7548
  oe(this, tn);
7594
7549
  oe(this, nn);
7595
- oe(this, ot, !1);
7550
+ oe(this, lt, !1);
7596
7551
  oe(this, sn);
7597
7552
  oe(this, At);
7598
7553
  oe(this, xt);
7599
7554
  oe(this, Tt);
7600
7555
  oe(this, Ct);
7601
- oe(this, Pt);
7602
7556
  oe(this, _t);
7557
+ oe(this, Pt);
7603
7558
  oe(this, It);
7604
7559
  oe(this, rn);
7605
7560
  const {
@@ -7615,7 +7570,7 @@ var Ad = (e, t = !1) => {
7615
7570
  shadowDOMTarget: h,
7616
7571
  onClose: f
7617
7572
  } = e;
7618
- le(this, Nt, Se(t)), le(this, tn, n), le(this, nn, s), le(this, en, a), le(this, sn, d), le(this, At, h), le(this, xt, Se(i)), le(this, Tt, Se(l)), le(this, Ct, Se(o)), le(this, Pt, Se(c)), le(this, _t, Se(f));
7573
+ le(this, Nt, Se(t)), le(this, tn, n), le(this, nn, s), le(this, en, a), le(this, sn, d), le(this, At, h), le(this, xt, Se(i)), le(this, Tt, Se(l)), le(this, Ct, Se(o)), le(this, _t, Se(c)), le(this, Pt, Se(f));
7619
7574
  }
7620
7575
  setButtonPosition(e) {
7621
7576
  M(this, xt)[1](e);
@@ -7627,21 +7582,21 @@ var Ad = (e, t = !1) => {
7627
7582
  M(this, Ct)[1](e);
7628
7583
  }
7629
7584
  setErrorTypes(e) {
7630
- M(this, Pt)[1](e);
7585
+ M(this, _t)[1](e);
7631
7586
  }
7632
7587
  setClient(e) {
7633
7588
  M(this, Nt)[1](e);
7634
7589
  }
7635
7590
  setOnClose(e) {
7636
- M(this, _t)[1](() => e);
7591
+ M(this, Pt)[1](() => e);
7637
7592
  }
7638
7593
  mount(e) {
7639
- if (M(this, ot))
7594
+ if (M(this, lt))
7640
7595
  throw new Error("Devtools is already mounted");
7641
7596
  const t = ua(() => {
7642
- const n = this, [s] = M(this, xt), [a] = M(this, Tt), [i] = M(this, Ct), [l] = M(this, Pt), [o] = M(this, Nt), [c] = M(this, _t);
7597
+ const n = this, [s] = M(this, xt), [a] = M(this, Tt), [i] = M(this, Ct), [l] = M(this, _t), [o] = M(this, Nt), [c] = M(this, Pt);
7643
7598
  let d;
7644
- return M(this, It) ? d = M(this, It) : (d = oa(() => import("./HUY7CZI3-69B3wtUx.js")), le(this, It, d)), _a(M(this, sn), M(this, At)), ia(d, la({
7599
+ return M(this, It) ? d = M(this, It) : (d = oa(() => import("./HUY7CZI3-BSDTRnrG.js")), le(this, It, d)), Pa(M(this, sn), M(this, At)), ia(d, la({
7645
7600
  get queryFlavor() {
7646
7601
  return M(n, tn);
7647
7602
  },
@@ -7675,15 +7630,15 @@ var Ad = (e, t = !1) => {
7675
7630
  }
7676
7631
  }));
7677
7632
  }, e);
7678
- le(this, ot, !0), le(this, rn, t);
7633
+ le(this, lt, !0), le(this, rn, t);
7679
7634
  }
7680
7635
  unmount() {
7681
7636
  var e;
7682
- if (!M(this, ot))
7637
+ if (!M(this, lt))
7683
7638
  throw new Error("Devtools is not mounted");
7684
- (e = M(this, rn)) == null || e.call(this), le(this, ot, !1);
7639
+ (e = M(this, rn)) == null || e.call(this), le(this, lt, !1);
7685
7640
  }
7686
- }, Nt = new WeakMap(), en = new WeakMap(), tn = new WeakMap(), nn = new WeakMap(), ot = new WeakMap(), sn = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Pt = new WeakMap(), _t = new WeakMap(), It = new WeakMap(), rn = new WeakMap(), Js);
7641
+ }, Nt = new WeakMap(), en = new WeakMap(), tn = new WeakMap(), nn = new WeakMap(), lt = new WeakMap(), sn = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), Pt = new WeakMap(), It = new WeakMap(), rn = new WeakMap(), Js);
7687
7642
  function Du(e) {
7688
7643
  const t = Ae(e.client), n = fe.useRef(null), {
7689
7644
  buttonPosition: s,
@@ -7754,42 +7709,42 @@ function Gu(e) {
7754
7709
  }
7755
7710
  );
7756
7711
  }
7757
- var Ru = process.env.NODE_ENV !== "development" ? function() {
7712
+ var Uu = process.env.NODE_ENV !== "development" ? function() {
7758
7713
  return null;
7759
7714
  } : Du;
7760
7715
  process.env.NODE_ENV;
7761
- const Uu = ti(
7762
- () => import("./digital-asset-manager-C8zV1JcX.js")
7716
+ const Ru = ti(
7717
+ () => import("./digital-asset-manager-C2ypiQHt.js")
7763
7718
  );
7764
7719
  gl();
7765
7720
  ac();
7766
- fi(jo);
7767
- gi(Uu);
7768
- pi(jl);
7721
+ fi(Ho);
7722
+ gi(Ru);
7723
+ pi(Hl);
7769
7724
  $n("user-info", oc);
7770
7725
  const Ou = (e) => {
7771
- const t = dt([]), [n] = Ue(), s = n.get("page"), { data: a } = Oe(), {
7726
+ const t = ut([]), [n] = Re(), s = n.get("page"), { data: a } = Oe(), {
7772
7727
  data: i = {
7773
7728
  role: "",
7774
7729
  permissions: null
7775
7730
  }
7776
- } = $o(), { data: l } = zo(), { data: o, isFetching: c } = Fr(), { blocks: d } = Vo(o), { data: h } = Dt(), { data: f } = De(), { mutateAsync: y } = Or(), v = Ho(), { getUILibraryBlock: p, getUILibraryBlocks: A, onSave: E } = Wo(), { getPartialBlocks: C, getPartialBlockBlocks: N } = Yo(), { aiContext: _, setAiContext: w } = Ss(), { mutateAsync: k } = Vl(), [T, se] = I(!1), O = W(
7731
+ } = $o(), { data: l } = zo(), { data: o, isFetching: c } = Fr(), { blocks: d } = Vo(o), { data: h } = Dt(), { data: f } = De(), { mutateAsync: y } = Or(), v = jo(), { getUILibraryBlock: p, getUILibraryBlocks: A, onSave: E } = Wo(), { getPartialBlocks: C, getPartialBlockBlocks: N } = Yo(), { aiContext: _, setAiContext: w } = Ss(), { mutateAsync: k } = Vl(), [T, se] = I(!1), O = J(
7777
7732
  () => (h == null ? void 0 : h.fallbackLang) || "en",
7778
7733
  [h]
7779
- ), { data: Z } = qr();
7734
+ ), { data: X } = qr();
7780
7735
  Cl(), Ne(() => {
7781
7736
  const F = () => {
7782
7737
  document.hidden ? se(!0) : se(!1);
7783
7738
  };
7784
7739
  return window.addEventListener("visibilitychange", F), () => window.removeEventListener("visibilitychange", F);
7785
7740
  }, []), t.current = d;
7786
- const B = W(() => {
7741
+ const B = J(() => {
7787
7742
  const F = {};
7788
7743
  return i && (F.permissions = $(i, "permissions", null), F.role = $(i, "role", "user")), F;
7789
- }, [i]), S = W(() => l, [l]), G = Te(
7790
- async (F, de) => await k({ pageType: F, query: de }),
7744
+ }, [i]), S = J(() => l, [l]), G = _e(
7745
+ async (F, he) => await k({ pageType: F, query: he }),
7791
7746
  [k]
7792
- ), ge = W(
7747
+ ), ge = J(
7793
7748
  () => $(h, "theme", {}) || {},
7794
7749
  [h]
7795
7750
  );
@@ -7798,7 +7753,7 @@ const Ou = (e) => {
7798
7753
  /* @__PURE__ */ r(
7799
7754
  yi,
7800
7755
  {
7801
- pageExternalData: Z,
7756
+ pageExternalData: X,
7802
7757
  themePresets: e.themePresets ?? [],
7803
7758
  pageId: a == null ? void 0 : a.id,
7804
7759
  loading: c,
@@ -7822,22 +7777,22 @@ const Ou = (e) => {
7822
7777
  searchPageTypeItems: G,
7823
7778
  saveAiContextCallback: async (F) => {
7824
7779
  if (!s) return !0;
7825
- const de = t.current, Ce = {
7780
+ const he = t.current, Te = {
7826
7781
  _type: "@chai/ai-context",
7827
- _value: Rs(F) ? F : ""
7828
- }, Q = [...de, Ce];
7829
- return await E({ page: s, blocks: Q }), w(F), !0;
7782
+ _value: Us(F) ? F : ""
7783
+ }, Y = [...he, Te];
7784
+ return await E({ page: s, blocks: Y }), w(F), !0;
7830
7785
  },
7831
7786
  aiContext: _,
7832
7787
  askAiCallBack: v,
7833
- onSave: async ({ blocks: F, theme: de }) => {
7788
+ onSave: async ({ blocks: F, theme: he }) => {
7834
7789
  if (!s) return !0;
7835
7790
  t.current = F;
7836
- const Ce = {
7791
+ const Te = {
7837
7792
  _type: "@chai/ai-context",
7838
- _value: Rs(_) ? _ : ""
7839
- }, Q = [...F, Ce];
7840
- return await E({ page: s, blocks: Q }), t.current = Q, is(de, ge) || await y({ settings: { theme: de } }), !0;
7793
+ _value: Us(_) ? _ : ""
7794
+ }, Y = [...F, Te];
7795
+ return await E({ page: s, blocks: Y }), t.current = Y, is(he, ge) || await y({ settings: { theme: he } }), !0;
7841
7796
  },
7842
7797
  themePanelComponent: eo,
7843
7798
  ...B
@@ -7856,7 +7811,7 @@ const Ou = (e) => {
7856
7811
  }
7857
7812
  }
7858
7813
  }), _d = (e) => {
7859
- const { isLoggedIn: t } = rt(), [, n] = Br(), [s, a] = I(!1);
7814
+ const { isLoggedIn: t } = ht(), [, n] = Br(), [s, a] = I(!1);
7860
7815
  return Ne(() => (n(
7861
7816
  tr(e, [
7862
7817
  "apiUrl",
@@ -7872,41 +7827,38 @@ const Ou = (e) => {
7872
7827
  a(!1), n({});
7873
7828
  }), [e, n]), s ? /* @__PURE__ */ u(si, { client: Bu, children: [
7874
7829
  t ? /* @__PURE__ */ r(Ou, { ...e }) : /* @__PURE__ */ r(Zo, {}),
7875
- /* @__PURE__ */ r(Ru, {})
7830
+ /* @__PURE__ */ r(Uu, {})
7876
7831
  ] }) : /* @__PURE__ */ r("div", {});
7877
- }, Id = () => {
7878
- const { user: e, logout: t } = rt(), n = W(
7879
- () => e == null ? void 0 : e.accessToken,
7880
- [e == null ? void 0 : e.accessToken]
7881
- );
7882
- return Te(
7832
+ }, Pd = () => {
7833
+ const { user: e, logout: t } = ht(), n = e == null ? void 0 : e.accessToken;
7834
+ return _e(
7883
7835
  async ({
7884
7836
  url: s,
7885
7837
  method: a = "GET",
7886
7838
  body: i = {},
7887
7839
  headers: l = {}
7888
7840
  }) => {
7889
- if (n) {
7890
- if (!s)
7891
- throw new Error("URL is required");
7892
- try {
7893
- const o = await fetch(s, {
7894
- method: a,
7895
- headers: {
7896
- "Content-Type": "application/json",
7897
- Authorization: `Bearer ${n}`,
7898
- ...l
7899
- },
7900
- body: JSON.stringify(i)
7901
- });
7902
- if (o.status === 401)
7903
- return await t(), null;
7904
- if (o.status === 400)
7905
- throw new Error((await o.json()).error);
7906
- return await o.json();
7907
- } catch (o) {
7908
- throw console.log("Something went wrong", o), o;
7909
- }
7841
+ if (!n)
7842
+ throw new Error("No auth token");
7843
+ if (!s)
7844
+ throw new Error("URL is required");
7845
+ try {
7846
+ const o = await fetch(s, {
7847
+ method: a,
7848
+ headers: {
7849
+ "Content-Type": "application/json",
7850
+ Authorization: `Bearer ${n}`,
7851
+ ...l
7852
+ },
7853
+ body: JSON.stringify(i)
7854
+ });
7855
+ if (o.status === 401)
7856
+ return await t(), null;
7857
+ if (o.status === 400)
7858
+ throw new Error((await o.json()).error);
7859
+ return await o.json();
7860
+ } catch (o) {
7861
+ throw console.log("Something went wrong", o), o;
7910
7862
  }
7911
7863
  },
7912
7864
  [n, t]
@@ -7916,68 +7868,67 @@ if (typeof window > "u")
7916
7868
  throw new Error("@chaibuilder/pages is not available on the server");
7917
7869
  export {
7918
7870
  Xr as $,
7919
- Ad as A,
7920
- nd as B,
7921
- gd as C,
7922
- yd as D,
7871
+ Nd as A,
7872
+ td as B,
7873
+ fd as C,
7874
+ pd as D,
7923
7875
  Ie as E,
7924
- cd as F,
7876
+ od as F,
7925
7877
  dc as G,
7926
7878
  Cu as H,
7927
- ud as I,
7879
+ cd as I,
7928
7880
  wn as J,
7929
- Cd as K,
7930
- bd as L,
7931
- Ed as M,
7932
- ct as N,
7933
- jc as O,
7934
- pd as P,
7935
- vd as Q,
7936
- md as R,
7937
- dd as S,
7938
- hd as T,
7881
+ Td as K,
7882
+ Ed as L,
7883
+ vd as M,
7884
+ ot as N,
7885
+ Hc as O,
7886
+ gd as P,
7887
+ yd as Q,
7888
+ hd as R,
7889
+ ud as S,
7890
+ dd as T,
7939
7891
  Sn as U,
7940
- ad as V,
7941
- ed as W,
7892
+ rd as V,
7893
+ Ju as W,
7942
7894
  ee as X,
7943
7895
  L as Y,
7944
7896
  V as Z,
7945
7897
  _d as _,
7946
7898
  ia as a,
7947
7899
  Me as a0,
7948
- td as a1,
7900
+ ed as a1,
7949
7901
  Oe as a2,
7950
7902
  un as a3,
7951
- Rn as a4,
7903
+ Un as a4,
7952
7904
  Dt as a5,
7953
- rt as a6,
7905
+ ht as a6,
7954
7906
  $o as a7,
7955
- Id as a8,
7956
- Ju as a9,
7957
- dn as aa,
7907
+ Pd as a8,
7908
+ dn as a9,
7958
7909
  Se as b,
7959
- Re as c,
7910
+ Ue as c,
7960
7911
  Bc as d,
7961
7912
  ea as e,
7962
7913
  la as f,
7963
- Pd as g,
7914
+ Cd as g,
7964
7915
  Tc as h,
7965
- id as i,
7966
- ut as j,
7916
+ ad as i,
7917
+ ct as j,
7967
7918
  Jn as k,
7968
- od as l,
7969
- Td as m,
7970
- Ht as n,
7971
- sd as o,
7919
+ ld as l,
7920
+ xd as m,
7921
+ jt as n,
7922
+ nd as o,
7972
7923
  fc as p,
7973
7924
  zc as q,
7974
7925
  es as r,
7975
- xd as s,
7976
- fd as t,
7977
- ld as u,
7926
+ Ad as s,
7927
+ md as t,
7928
+ id as u,
7978
7929
  qc as v,
7979
- wd as w,
7980
- Sd as x,
7930
+ bd as w,
7931
+ wd as x,
7981
7932
  Vc as y,
7982
- Nd as z
7933
+ Sd as z
7983
7934
  };