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

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.
@@ -2,17 +2,17 @@ var Ds = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
4
  var Gs = (e, t, n) => t.has(e) || Ds("Cannot " + n);
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
- import { jsx as r, jsxs as u, Fragment as Ee } from "react/jsx-runtime";
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";
5
+ var F = (e, t, n) => (Gs(e, t, "read from private field"), n ? n.call(e) : t.get(e)), ce = (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), oe = (e, t, n, s) => (Gs(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
6
+ import { jsx as r, jsxs as u, Fragment as we } from "react/jsx-runtime";
7
+ import { get as W, 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 Se, 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 _e, useState as I, useEffect as Ne, useRef as ut, useMemo as J, Suspense as ei, lazy as ti } from "react";
9
+ import nr, { useCallback as Pe, useState as I, useEffect as xe, useRef as ut, useMemo as X, 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 Pe, useQuery as ke, onlineManager as sr, QueryClient as ni, QueryClientProvider as si } from "@tanstack/react-query";
11
+ import { useQueryClient as Te, useMutation as Ce, useQuery as Ie, 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 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";
13
+ import { useLanguages as dt, useUpdateBlocksPropsRealtime as rr, PERMISSIONS as ri, usePartailBlocksStore as ai, usePermissions as Dt, 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 Ne, Label as re, 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 Ot, 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 Os, AlertDescription as Di, Accordion as Gi, AccordionItem as gn, AccordionTrigger as pn, AccordionContent as yn, HoverCard as Ui, HoverCardTrigger as Oi, HoverCardContent as Ri } 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 Rs, 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";
@@ -205,7 +205,8 @@ const He = {
205
205
  yo: "Yoruba",
206
206
  za: "Zhuang, Chuang",
207
207
  zu: "Zulu"
208
- }, L = {
208
+ }, k = {
209
+ GET_BLOCK_ASYNC_PROPS: "GET_BLOCK_ASYNC_PROPS",
209
210
  ASK_AI: "ASK_AI",
210
211
  GET_DRAFT_PAGE: "GET_DRAFT_PAGE",
211
212
  CREATE_PAGE: "CREATE_PAGE",
@@ -253,7 +254,7 @@ const He = {
253
254
  UPDATE_ASSET: "UPDATE_ASSET",
254
255
  GET_ASSETS: "GET_ASSETS",
255
256
  GET_ASSET: "GET_ASSET"
256
- }, V = "chaibuilder";
257
+ }, K = "chaibuilder";
257
258
  let pl = 0;
258
259
  function qs(e, t) {
259
260
  const n = `atom${++pl}`, s = {
@@ -360,7 +361,7 @@ const Ur = "__logged_in_user", Al = Nl(
360
361
  Ur,
361
362
  null
362
363
  ), ht = () => {
363
- const [e, t] = Dn(Al), n = _e(() => {
364
+ const [e, t] = Dn(Al), n = Pe(() => {
364
365
  t(null), localStorage.removeItem(Ur);
365
366
  }, [t]);
366
367
  return {
@@ -386,21 +387,21 @@ if (import.meta.vitest) {
386
387
  t(n).toBeDefined();
387
388
  });
388
389
  }
389
- const ee = () => {
390
- const { user: e, logout: t } = ht(), n = Ae(), s = e == null ? void 0 : e.accessToken;
391
- return _e(
390
+ const Y = () => {
391
+ const { user: e, logout: t } = ht(), n = Te(), s = e == null ? void 0 : e.accessToken;
392
+ return Pe(
392
393
  async (a, i, l = {}) => {
393
394
  if (!s)
394
395
  return null;
395
396
  try {
396
- const o = $(i, "action", "").toLowerCase(), c = await bs(
397
+ const o = W(i, "action", "").toLowerCase(), c = await bs(
397
398
  a + (o ? `?action=${o}` : ""),
398
399
  i,
399
400
  { ...l, Authorization: `Bearer ${s}` }
400
401
  );
401
402
  if (c.status === 401)
402
403
  return console.log("401 Response", c), n.invalidateQueries({
403
- queryKey: [V]
404
+ queryKey: [K]
404
405
  }), t(), null;
405
406
  if (c.status === 400)
406
407
  throw new Error((await c.json()).error);
@@ -411,27 +412,27 @@ const ee = () => {
411
412
  },
412
413
  [s, t, n]
413
414
  );
414
- }, Rr = () => {
415
- const e = ne(), t = Ae(), n = ee();
416
- return Pe({
417
- mutationFn: async (s) => n(e, { action: L.RELEASE_LOCK, data: s }),
415
+ }, Or = () => {
416
+ const e = ee(), t = Te(), n = Y();
417
+ return Ce({
418
+ mutationFn: async (s) => n(e, { action: k.RELEASE_LOCK, data: s }),
418
419
  onSuccess: () => {
419
420
  t.invalidateQueries({
420
- queryKey: [V, L.GET_DRAFT_PAGE]
421
+ queryKey: [K, k.GET_DRAFT_PAGE]
421
422
  });
422
423
  }
423
424
  });
424
- }, Or = () => {
425
- const e = ne(), t = Ae(), n = ee();
426
- return Pe({
425
+ }, Rr = () => {
426
+ const e = ee(), t = Te(), n = Y();
427
+ return Ce({
427
428
  mutationFn: async (s) => n(e, {
428
- action: L.UPDATE_WEBSITE_SETTINGS,
429
+ action: k.UPDATE_WEBSITE_SETTINGS,
429
430
  data: s
430
431
  }),
431
432
  onSuccess: (s, a) => {
432
433
  var i;
433
434
  t.invalidateQueries({
434
- queryKey: [V, L.GET_WEBSITE_DRAFT_SETTINGS]
435
+ queryKey: [K, k.GET_WEBSITE_DRAFT_SETTINGS]
435
436
  }), (i = a == null ? void 0 : a.settings) != null && i.theme || te.success("Website settings updated successfully.");
436
437
  },
437
438
  onError: (s) => {
@@ -441,12 +442,12 @@ const ee = () => {
441
442
  }
442
443
  });
443
444
  }, xl = () => {
444
- const e = ne(), t = Ae(), n = ee();
445
- return Pe({
446
- mutationFn: async (s) => n(e, { action: L.UPDATE_WEBSITE_DATA, data: s }),
445
+ const e = ee(), t = Te(), n = Y();
446
+ return Ce({
447
+ mutationFn: async (s) => n(e, { action: k.UPDATE_WEBSITE_DATA, data: s }),
447
448
  onSuccess: () => {
448
449
  t.invalidateQueries({
449
- queryKey: [V, L.GET_WEBSITE_DATA]
450
+ queryKey: [K, k.GET_WEBSITE_DATA]
450
451
  }), te.success("Website data updated successfully.");
451
452
  },
452
453
  onError: (s) => {
@@ -456,11 +457,11 @@ const ee = () => {
456
457
  }
457
458
  });
458
459
  };
459
- function Re() {
460
+ function Oe() {
460
461
  const [e, t] = I(
461
462
  new URLSearchParams(window.location.search)
462
463
  );
463
- return Ne(() => {
464
+ return xe(() => {
464
465
  const n = () => {
465
466
  t(new URLSearchParams(window.location.search));
466
467
  };
@@ -470,124 +471,124 @@ function Re() {
470
471
  }, []), [e, t];
471
472
  }
472
473
  const Tl = ls({}), Br = () => Dn(Tl), Cl = () => {
473
- const [e] = Re(), t = e.get("page"), n = ut(""), { mutate: s } = Rr();
474
- Ne(() => {
474
+ const [e] = Oe(), t = e.get("page"), n = ut(""), { mutate: s } = Or();
475
+ xe(() => {
475
476
  !de(n.current) && t !== n.current && s({ id: n.current }), n.current = t;
476
477
  }, [t, s, n]);
477
478
  }, rt = (e, t) => {
478
479
  const [n] = Br();
479
- return J(
480
- () => $(n, e, t),
480
+ return X(
481
+ () => W(n, e, t),
481
482
  [n, e, t]
482
483
  );
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();
485
- return ke({
486
- queryKey: [V, L.GET_LANGUAGE_PAGES, n],
484
+ }, ee = () => rt("apiUrl", "/chai/api"), ws = () => rt("usersApiUrl", "/chai/users"), td = () => rt("assetsApiUrl", "/chai/assets"), un = () => {
485
+ const e = ee(), [t] = Oe(), n = t.get("page"), s = Y();
486
+ return Ie({
487
+ queryKey: [K, k.GET_LANGUAGE_PAGES, n],
487
488
  initialData: [],
488
489
  queryFn: async () => {
489
490
  if (!n) return null;
490
491
  const a = await s(e, {
491
- action: L.GET_LANGUAGE_PAGES,
492
+ action: k.GET_LANGUAGE_PAGES,
492
493
  data: { id: n }
493
494
  });
494
495
  return Ba(Ma(a, "primaryPage"));
495
496
  },
496
497
  enabled: !!n
497
498
  });
498
- }, Dt = () => {
499
- const e = ne(), t = ee();
500
- return ke({
501
- queryKey: [V, L.GET_WEBSITE_DRAFT_SETTINGS],
499
+ }, mt = () => {
500
+ const e = ee(), t = Y();
501
+ return Ie({
502
+ queryKey: [K, k.GET_WEBSITE_DRAFT_SETTINGS],
502
503
  initialData: {
503
504
  theme: {},
504
505
  fallbackLang: "en",
505
506
  languages: []
506
507
  },
507
508
  queryFn: async () => t(e, {
508
- action: L.GET_WEBSITE_DRAFT_SETTINGS,
509
+ action: k.GET_WEBSITE_DRAFT_SETTINGS,
509
510
  data: { draft: !0 }
510
511
  })
511
512
  });
512
513
  }, Mr = (e) => {
513
- const { fallbackLang: t } = dt(), { data: n } = Dt(), { data: s, isFetching: a } = un(), i = J(() => {
514
+ const { fallbackLang: t } = dt(), { data: n } = mt(), { data: s, isFetching: a } = un(), i = X(() => {
514
515
  const l = { [t]: !0 };
515
- return Fa($(n, "languages"), (o) => {
516
+ return Fa(W(n, "languages"), (o) => {
516
517
  const c = ye(s, { lang: o });
517
518
  l[o] = !!c;
518
519
  }), l;
519
520
  }, [t, s, n]);
520
521
  return a || de(e) || e && i[e];
521
522
  }, Ss = () => {
522
- const e = Ae(), { data: t } = ke({
523
- queryKey: [V, L.AI_CONTEXT],
523
+ const e = Te(), { data: t } = Ie({
524
+ queryKey: [K, k.AI_CONTEXT],
524
525
  initialData: "",
525
526
  queryFn: () => "",
526
527
  staleTime: 0
527
528
  });
528
- return { setAiContext: _e(
529
+ return { setAiContext: Pe(
529
530
  (s) => {
530
- e.setQueryData([V, L.AI_CONTEXT], s);
531
+ e.setQueryData([K, k.AI_CONTEXT], s);
531
532
  },
532
533
  [e]
533
534
  ), aiContext: t };
534
535
  }, Un = () => {
535
- const e = ee(), t = ne();
536
- return ke({
537
- queryKey: [V, L.GET_WEBSITE_PAGES],
536
+ const e = Y(), t = ee();
537
+ return Ie({
538
+ queryKey: [K, k.GET_WEBSITE_PAGES],
538
539
  staleTime: 1e3 * 60 * 5,
539
- queryFn: async () => e(t, { action: L.GET_WEBSITE_PAGES }) || []
540
+ queryFn: async () => e(t, { action: k.GET_WEBSITE_PAGES }) || []
540
541
  });
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(
542
+ }, _l = ls({ lastSaved: void 0 }), Ns = () => Dn(_l), Re = () => {
543
+ const [e] = Oe(), t = e.get("page"), { data: n, isFetching: s } = Un();
544
+ return { data: X(
544
545
  () => ye(n, { id: t }) || {},
545
546
  [n, t]
546
547
  ), isFetching: s };
547
548
  }, dn = (e) => {
548
- const t = ws(), n = ee();
549
- return ke({
550
- queryKey: [V, "chaiUserInfo", e],
549
+ const t = ws(), n = Y();
550
+ return Ie({
551
+ queryKey: [K, "chaiUserInfo", e],
551
552
  queryFn: async () => await n(t, {
552
- action: L.GET_CHAI_USER,
553
+ action: k.GET_CHAI_USER,
553
554
  data: { userId: e }
554
555
  }),
555
556
  enabled: !de(e)
556
557
  });
557
558
  }, Pl = ls(void 0), hn = () => {
558
- const [e] = Re(), t = e.get("page"), { user: n } = ht(), [s, a] = Dn(Pl);
559
- return J(() => ({
559
+ const [e] = Oe(), t = e.get("page"), { user: n } = ht(), [s, a] = Dn(Pl);
560
+ return X(() => ({
560
561
  isLocked: t && (n == null ? void 0 : n.id) !== s,
561
562
  currentEditor: s,
562
563
  setCurrentEditor: (i) => a(i)
563
564
  }), [n == null ? void 0 : n.id, s, t, a]);
564
565
  }, Fr = () => {
565
- const [e] = Re(), t = e.get("page"), n = ne(), { setAiContext: s } = Ss(), { setCurrentEditor: a } = hn(), [, i] = Ns(), l = ee();
566
- return ke({
567
- queryKey: [V, L.GET_DRAFT_PAGE, t],
566
+ const [e] = Oe(), t = e.get("page"), n = ee(), { setAiContext: s } = Ss(), { setCurrentEditor: a } = hn(), [, i] = Ns(), l = Y();
567
+ return Ie({
568
+ queryKey: [K, k.GET_DRAFT_PAGE, t],
568
569
  staleTime: 1 / 0,
569
570
  gcTime: 1 / 0,
570
571
  queryFn: async () => {
571
572
  a("");
572
573
  const o = await l(n, {
573
- action: L.GET_DRAFT_PAGE,
574
+ action: k.GET_DRAFT_PAGE,
574
575
  data: { id: t, draft: !0 }
575
576
  });
576
577
  a(o.currentEditor);
577
578
  const c = o.blocks ?? [], d = ye(c, { _type: "@chai/ai-context" });
578
- return s($(d, "_value", "") || ""), i((h) => ({ ...h, lastSaved: o.lastSaved })), c;
579
+ return s(W(d, "_value", "") || ""), i((h) => ({ ...h, lastSaved: o.lastSaved })), c;
579
580
  },
580
581
  enabled: !!t
581
582
  });
582
583
  }, qr = () => {
583
- const { data: e } = Oe(), { data: t } = Dt(), n = ne(), s = ee(), a = J(
584
+ const { data: e } = Re(), { data: t } = mt(), n = ee(), s = Y(), a = X(
584
585
  () => (t == null ? void 0 : t.fallbackLang) || "en",
585
586
  [t == null ? void 0 : t.fallbackLang]
586
587
  );
587
- return ke({
588
+ return Ie({
588
589
  queryKey: [
589
- V,
590
- L.GET_BUILDER_PAGE_DATA,
590
+ K,
591
+ k.GET_BUILDER_PAGE_DATA,
591
592
  e == null ? void 0 : e.pageType,
592
593
  (e == null ? void 0 : e.lang) || a,
593
594
  e == null ? void 0 : e.dynamic,
@@ -595,7 +596,7 @@ const Tl = ls({}), Br = () => Dn(Tl), Cl = () => {
595
596
  ],
596
597
  initialData: {},
597
598
  queryFn: async () => s(n, {
598
- action: L.GET_BUILDER_PAGE_DATA,
599
+ action: k.GET_BUILDER_PAGE_DATA,
599
600
  data: {
600
601
  pageType: e == null ? void 0 : e.pageType,
601
602
  lang: (e == null ? void 0 : e.lang) || a,
@@ -667,7 +668,7 @@ function Il({
667
668
  ] }) });
668
669
  }
669
670
  const kl = () => {
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(() => {
671
+ const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Oe(), a = s.get("page"), { mutate: i } = Or(), { isFetching: l } = Fr(), o = Pe(() => {
671
672
  i({ id: a });
672
673
  }, [a, i]);
673
674
  return !e || l ? /* @__PURE__ */ r("div", { className: "" }) : /* @__PURE__ */ r(
@@ -680,14 +681,14 @@ const kl = () => {
680
681
  }
681
682
  );
682
683
  }, Ll = () => {
683
- const [e, t] = Re(), n = e.get("lang"), s = Mr(n), { setSelectedLang: a } = dt(), i = () => {
684
+ const [e, t] = Oe(), n = e.get("lang"), s = Mr(n), { setSelectedLang: a } = dt(), i = () => {
684
685
  const o = new URLSearchParams(window.location.search);
685
686
  o.delete("lang");
686
687
  const c = o.toString(), d = `${window.location.pathname}${c ? `?${c}` : ""}`;
687
688
  window.history.pushState({}, "", d), t(o), a(""), window.dispatchEvent(new PopStateEvent("popstate"));
688
689
  };
689
690
  if (s) return null;
690
- const l = $(He, n);
691
+ const l = W(He, n);
691
692
  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: [
692
693
  /* @__PURE__ */ r(us, { className: "space-y-1", children: /* @__PURE__ */ u(ds, { className: "flex items-center gap-2 text-2xl", children: [
693
694
  /* @__PURE__ */ r(Nr, { className: "w-6 h-6 text-yellow-500" }),
@@ -713,10 +714,10 @@ const kl = () => {
713
714
  ) })
714
715
  ] }) });
715
716
  }, Dl = (e) => {
716
- const t = ne(), n = ee();
717
- return Pe({
717
+ const t = ee(), n = Y();
718
+ return Ce({
718
719
  mutationFn: async (s) => n(t, {
719
- action: L.UPSERT_LIBRARY_ITEM,
720
+ action: k.UPSERT_LIBRARY_ITEM,
720
721
  data: s
721
722
  }),
722
723
  onSuccess: (s) => {
@@ -729,16 +730,16 @@ const kl = () => {
729
730
  }
730
731
  });
731
732
  }, Gl = (e) => {
732
- const t = ne(), n = ee();
733
- return ke({
734
- queryKey: [V, "uiBlockDetails", e],
733
+ const t = ee(), n = Y();
734
+ return Ie({
735
+ queryKey: [K, "uiBlockDetails", e],
735
736
  enabled: !!e,
736
737
  // Only run query if blockId is provided
737
738
  queryFn: async () => {
738
739
  if (!e) return null;
739
740
  try {
740
741
  return await n(t, {
741
- action: L.GET_LIBRARY_ITEM,
742
+ action: k.GET_LIBRARY_ITEM,
742
743
  data: { id: e }
743
744
  });
744
745
  } catch (s) {
@@ -750,10 +751,10 @@ const kl = () => {
750
751
  retry: !1
751
752
  });
752
753
  }, Ul = (e) => {
753
- const t = ne(), n = ee();
754
- return Pe({
754
+ const t = ee(), n = Y();
755
+ return Ce({
755
756
  mutationFn: async (s) => n(t, {
756
- action: L.DELETE_LIBRARY_ITEM,
757
+ action: k.DELETE_LIBRARY_ITEM,
757
758
  data: { id: s }
758
759
  }),
759
760
  onSuccess: () => {
@@ -765,7 +766,7 @@ const kl = () => {
765
766
  });
766
767
  }
767
768
  });
768
- }, Rl = ({
769
+ }, Ol = ({
769
770
  blockId: e,
770
771
  libBlockId: t,
771
772
  isOpen: n,
@@ -839,7 +840,7 @@ const kl = () => {
839
840
  }
840
841
  )
841
842
  ] });
842
- }, Ol = ({
843
+ }, Rl = ({
843
844
  blockId: e,
844
845
  libBlockId: t,
845
846
  blockName: n,
@@ -849,7 +850,7 @@ const kl = () => {
849
850
  }) => {
850
851
  const [l, o] = I(!1);
851
852
  return /* @__PURE__ */ r(
852
- Rl,
853
+ Ol,
853
854
  {
854
855
  blockId: e,
855
856
  libBlockId: t,
@@ -875,12 +876,12 @@ const kl = () => {
875
876
  }
876
877
  );
877
878
  }, Bl = () => {
878
- const e = ne(), t = ee(), n = Ae(), {
879
+ const e = ee(), t = Y(), n = Te(), {
879
880
  data: s = [],
880
881
  isLoading: a,
881
882
  error: i
882
- } = ke({
883
- queryKey: [V, "library-groups"],
883
+ } = Ie({
884
+ queryKey: [K, "library-groups"],
884
885
  queryFn: async () => {
885
886
  try {
886
887
  return await t(e, {
@@ -891,7 +892,7 @@ const kl = () => {
891
892
  }
892
893
  },
893
894
  initialData: []
894
- }), { mutateAsync: l, isPending: o } = Pe({
895
+ }), { mutateAsync: l, isPending: o } = Ce({
895
896
  mutationFn: async (c) => {
896
897
  if (!c.trim())
897
898
  throw new Error("Group name is required");
@@ -902,7 +903,7 @@ const kl = () => {
902
903
  },
903
904
  onSuccess: () => {
904
905
  n.invalidateQueries({
905
- queryKey: [V, "library-groups"]
906
+ queryKey: [K, "library-groups"]
906
907
  }), te.success("Group created successfully");
907
908
  },
908
909
  onError: (c) => {
@@ -947,7 +948,7 @@ const kl = () => {
947
948
  { id: "stats", name: "Stats" },
948
949
  { id: "team", name: "Team" },
949
950
  { id: "timeline", name: "Timeline" }
950
- ]), h = J(
951
+ ]), h = X(
951
952
  () => [
952
953
  ...o,
953
954
  ...c.filter(
@@ -961,17 +962,17 @@ const kl = () => {
961
962
  const p = { id: v, name: v };
962
963
  d((A) => [...A, p]), t(p.id), i(""), s(!1);
963
964
  };
964
- Ne(() => {
965
+ xe(() => {
965
966
  n && l.current && l.current.focus();
966
967
  }, [n]);
967
968
  const y = (v) => {
968
969
  v.key === "Enter" && (v.preventDefault(), f());
969
970
  };
970
- return Ne(() => {
971
+ return xe(() => {
971
972
  e && !h.some((v) => v.id === e) && t("");
972
973
  }, [e, h, t]), n ? /* @__PURE__ */ u("div", { className: "space-y-2", children: [
973
974
  /* @__PURE__ */ r(
974
- we,
975
+ Ne,
975
976
  {
976
977
  ref: l,
977
978
  placeholder: "Enter new group name",
@@ -1022,7 +1023,7 @@ const kl = () => {
1022
1023
  )
1023
1024
  ] });
1024
1025
  }, Fl = 1 * 1024 * 1024, ql = ({ value: e, onChange: t }) => {
1025
- const [n, s] = I(!1), a = ut(null), i = _e(
1026
+ const [n, s] = I(!1), a = ut(null), i = Pe(
1026
1027
  (c) => {
1027
1028
  var h;
1028
1029
  const d = (h = c.target.files) == null ? void 0 : h[0];
@@ -1051,7 +1052,7 @@ const kl = () => {
1051
1052
  return /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1052
1053
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
1053
1054
  /* @__PURE__ */ r(
1054
- we,
1055
+ Ne,
1055
1056
  {
1056
1057
  type: "file",
1057
1058
  ref: a,
@@ -1140,43 +1141,43 @@ const kl = () => {
1140
1141
  EDIT_MEDIA: "edit_media",
1141
1142
  DELETE_MEDIA: "delete_media"
1142
1143
  }, 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(
1144
+ 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 = X(() => t.some(
1144
1145
  (x) => x._type === "PartialBlock" || x._type === "GlobalBlock"
1145
- ), [t]), d = J(() => {
1146
+ ), [t]), d = X(() => {
1146
1147
  let x = [];
1147
1148
  for (const D of t)
1148
1149
  if (D._type === "PartialBlock" || D._type === "GlobalBlock") {
1149
- const R = a(D.partialBlockId);
1150
- qa(R, "0._parent", D._parent), x = [...x, ...R];
1150
+ let U = a(D.partialBlockId);
1151
+ D._parent && (U == null ? void 0 : U.length) > 0 && (U = U.map((M) => (de(M._parent) && qa(M, "_parent", D._parent), M))), x = [...x, ...U];
1151
1152
  } else
1152
1153
  x.push(D);
1153
1154
  return x;
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 = () => {
1155
+ }, [t, a]), [h, f] = I(""), [y, v] = I(""), [p, A] = I(""), [E, C] = I(""), [N, _] = I({}), [w, L] = I(!1), [T, ne] = I(o), [R, Z] = I(!1), { hasPermission: B } = Dt(), S = B(me.DELETE_LIBRARY_BLOCK), G = rr(), ve = () => {
1155
1156
  G([s], { _libBlockId: void 0 }), te.success("Block delinked from library"), n();
1156
1157
  }, {
1157
- data: F,
1158
- isLoading: he,
1159
- isError: Te
1158
+ data: ie,
1159
+ isLoading: Ee,
1160
+ isError: le
1160
1161
  } = Gl(l);
1161
- 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(() => {
1162
+ xe(() => {
1163
+ le && o && (Z(!0), ne(!1));
1164
+ }, [le, o]), xe(() => {
1165
+ ie && !Ee && (f(ie.name || ""), v(ie.group || ""), A(ie.description || ""), C(ie.preview || ""), ne(!1));
1166
+ }, [ie, Ee]), xe(() => {
1166
1167
  const x = h.trim().length >= 2, D = y.trim() !== "";
1167
- k(x && D && !c);
1168
+ L(x && D && !c);
1168
1169
  }, [h, y, c]);
1169
- const Y = () => {
1170
+ const $ = () => {
1170
1171
  const x = {};
1171
1172
  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;
1172
- }, { resetLibrary: xe } = ii({ id: "" }), W = Dl(
1173
+ }, { resetLibrary: ge } = ii({ id: "" }), H = Dl(
1173
1174
  (x) => {
1174
- o || G([s], { _libBlockId: x.id }), te.success(`Block ${o ? "updated" : "saved"} successfully`), xe(x.library), n();
1175
+ o || G([s], { _libBlockId: x.id }), te.success(`Block ${o ? "updated" : "saved"} successfully`), ge(x.library), n();
1175
1176
  }
1176
1177
  ), g = async (x) => {
1177
- if (x.preventDefault(), !Y()) return;
1178
- const D = d.map((R) => (Je(R, "_libBlockId") && delete R._libBlockId, R));
1179
- W.mutate({
1178
+ if (x.preventDefault(), !$()) return;
1179
+ const D = d.map((U) => (Je(U, "_libBlockId") && delete U._libBlockId, U));
1180
+ H.mutate({
1180
1181
  name: h.trim(),
1181
1182
  group: y,
1182
1183
  blocks: D,
@@ -1186,13 +1187,13 @@ const kl = () => {
1186
1187
  // Include id if in edit mode
1187
1188
  ...o ? { id: l } : {}
1188
1189
  });
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: [
1190
+ }, m = H.isPending;
1191
+ return T || Ee ? /* @__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" }) }) : R ? /* @__PURE__ */ u("div", { className: "p-6 space-y-4", children: [
1191
1192
  /* @__PURE__ */ r("div", { className: "text-destructive font-medium", children: "Block Not Found" }),
1192
1193
  /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: "This block could not be found on the server. It may have been deleted." }),
1193
1194
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-4", children: [
1194
1195
  /* @__PURE__ */ r(P, { type: "button", variant: "outline", onClick: n, children: "Cancel" }),
1195
- /* @__PURE__ */ r(P, { onClick: ge, variant: "destructive", children: "Delink Block" })
1196
+ /* @__PURE__ */ r(P, { onClick: ve, variant: "destructive", children: "Delink Block" })
1196
1197
  ] })
1197
1198
  ] }) : /* @__PURE__ */ u("div", { children: [
1198
1199
  c && /* @__PURE__ */ u("div", { className: "mb-4 p-3 border border-destructive/50 bg-destructive/10 text-destructive rounded-md flex items-start gap-2", children: [
@@ -1205,7 +1206,7 @@ const kl = () => {
1205
1206
  /* @__PURE__ */ u("form", { onSubmit: g, className: "space-y-4", children: [
1206
1207
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1207
1208
  /* @__PURE__ */ r(
1208
- ae,
1209
+ re,
1209
1210
  {
1210
1211
  htmlFor: "name",
1211
1212
  className: N.name ? "text-destructive" : "",
@@ -1213,7 +1214,7 @@ const kl = () => {
1213
1214
  }
1214
1215
  ),
1215
1216
  /* @__PURE__ */ r(
1216
- we,
1217
+ Ne,
1217
1218
  {
1218
1219
  id: "name",
1219
1220
  placeholder: "Enter block name",
@@ -1226,7 +1227,7 @@ const kl = () => {
1226
1227
  ] }),
1227
1228
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1228
1229
  /* @__PURE__ */ r(
1229
- ae,
1230
+ re,
1230
1231
  {
1231
1232
  htmlFor: "group",
1232
1233
  className: N.group ? "text-destructive" : "",
@@ -1237,9 +1238,9 @@ const kl = () => {
1237
1238
  N.group && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: N.group })
1238
1239
  ] }),
1239
1240
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1240
- /* @__PURE__ */ r(ae, { htmlFor: "description", children: "Description (optional)" }),
1241
+ /* @__PURE__ */ r(re, { htmlFor: "description", children: "Description (optional)" }),
1241
1242
  /* @__PURE__ */ r(
1242
- we,
1243
+ Ne,
1243
1244
  {
1244
1245
  id: "description",
1245
1246
  placeholder: "Enter a brief description",
@@ -1250,13 +1251,13 @@ const kl = () => {
1250
1251
  )
1251
1252
  ] }),
1252
1253
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1253
- /* @__PURE__ */ r(ae, { htmlFor: "previewImage", children: "Preview Image (optional)" }),
1254
+ /* @__PURE__ */ r(re, { htmlFor: "previewImage", children: "Preview Image (optional)" }),
1254
1255
  /* @__PURE__ */ r(ql, { value: E, onChange: C }),
1255
1256
  /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: "max 1mb" })
1256
1257
  ] }),
1257
1258
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-2", children: [
1258
1259
  o && S && /* @__PURE__ */ r(
1259
- Ol,
1260
+ Rl,
1260
1261
  {
1261
1262
  blockId: s,
1262
1263
  libBlockId: l,
@@ -1279,7 +1280,7 @@ const kl = () => {
1279
1280
  ] })
1280
1281
  ] })
1281
1282
  ] });
1282
- }, H = {
1283
+ }, j = {
1283
1284
  PREVIEW: "Preview",
1284
1285
  THEME: "Theme",
1285
1286
  SAVEDRAFT: "Save draft",
@@ -1331,25 +1332,25 @@ const kl = () => {
1331
1332
  }, jl = {
1332
1333
  SLUG_ALREADY_USED: "This slug is already in use. Please choose a different one."
1333
1334
  }, De = () => {
1334
- const e = ne(), t = ee();
1335
- return ke({
1336
- queryKey: [V, L.GET_PAGE_TYPES],
1335
+ const e = ee(), t = Y();
1336
+ return Ie({
1337
+ queryKey: [K, k.GET_PAGE_TYPES],
1337
1338
  initialData: [],
1338
- queryFn: async () => t(e, { action: L.GET_PAGE_TYPES })
1339
+ queryFn: async () => t(e, { action: k.GET_PAGE_TYPES })
1339
1340
  });
1340
1341
  }, Kl = (e) => {
1341
1342
  const { data: t } = De();
1342
- return J(
1343
+ return X(
1343
1344
  () => t == null ? void 0 : t.find((n) => n.key === e),
1344
1345
  [t, e]
1345
1346
  );
1346
1347
  }, Vl = () => {
1347
- const e = ne(), t = ee();
1348
- return Pe({
1348
+ const e = ee(), t = Y();
1349
+ return Ce({
1349
1350
  mutationFn: async ({ pageType: n, query: s }) => {
1350
1351
  try {
1351
1352
  return t(e, {
1352
- action: L.SEARCH_PAGES,
1353
+ action: k.SEARCH_PAGES,
1353
1354
  data: {
1354
1355
  pageType: n,
1355
1356
  query: Array.isArray(s) && s.length > 0 ? s[0] : s
@@ -1361,22 +1362,22 @@ const kl = () => {
1361
1362
  }
1362
1363
  });
1363
1364
  }, Hr = () => {
1364
- const e = ne(), t = Ae(), n = ee(), { data: s } = De();
1365
- return Pe({
1365
+ const e = ee(), t = Te(), n = Y(), { data: s } = De();
1366
+ return Ce({
1366
1367
  mutationFn: async (a) => (a.template && console.log("Creating page from template:", a.template), await n(e, {
1367
- action: L.CREATE_PAGE,
1368
+ action: k.CREATE_PAGE,
1368
1369
  data: a
1369
1370
  })),
1370
1371
  onSuccess: (a, i) => {
1371
1372
  var o;
1372
1373
  i && (i != null && i.primaryPage) ? t.invalidateQueries({
1373
1374
  queryKey: [
1374
- V,
1375
- L.GET_LANGUAGE_PAGES,
1375
+ K,
1376
+ k.GET_LANGUAGE_PAGES,
1376
1377
  i == null ? void 0 : i.primaryPage
1377
1378
  ]
1378
1379
  }) : t.invalidateQueries({
1379
- queryKey: [V, L.GET_WEBSITE_PAGES]
1380
+ queryKey: [K, k.GET_WEBSITE_PAGES]
1380
1381
  });
1381
1382
  const l = i.template ? `Page created from "${i.template.name}" template` : i.hasSlug === !1 ? "New " + ((o = ye(s, { key: i.pageType })) == null ? void 0 : o.name) + " added successfully" : "New page added successfully";
1382
1383
  te.success(l);
@@ -1386,27 +1387,27 @@ const kl = () => {
1386
1387
  te.error(
1387
1388
  `Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`,
1388
1389
  {
1389
- description: $(jl, a.message, a.message)
1390
+ description: W(jl, a.message, a.message)
1390
1391
  }
1391
1392
  );
1392
1393
  }
1393
1394
  });
1394
1395
  }, As = () => {
1395
- const e = ne(), t = Ae(), n = ee(), { data: s } = De();
1396
- return Pe({
1396
+ const e = ee(), t = Te(), n = Y(), { data: s } = De();
1397
+ return Ce({
1397
1398
  mutationFn: async (a) => await n(e, {
1398
- action: L.UPDATE_PAGE,
1399
+ action: k.UPDATE_PAGE,
1399
1400
  data: a
1400
1401
  }),
1401
1402
  onSuccess: (a, i) => {
1402
1403
  i && (i != null && i.primaryPage || i != null && i.seo) ? t.invalidateQueries({
1403
1404
  queryKey: [
1404
- V,
1405
- L.GET_LANGUAGE_PAGES,
1405
+ K,
1406
+ k.GET_LANGUAGE_PAGES,
1406
1407
  i == null ? void 0 : i.primaryPage
1407
1408
  ]
1408
1409
  }) : t.invalidateQueries({
1409
- queryKey: [V, L.GET_WEBSITE_PAGES]
1410
+ queryKey: [K, k.GET_WEBSITE_PAGES]
1410
1411
  });
1411
1412
  },
1412
1413
  onError: (a, i) => {
@@ -1420,10 +1421,10 @@ const kl = () => {
1420
1421
  }
1421
1422
  });
1422
1423
  }, zl = () => {
1423
- const e = ne(), t = Ae(), n = ee(), { data: s } = De();
1424
- return Pe({
1424
+ const e = ee(), t = Te(), n = Y(), { data: s } = De();
1425
+ return Ce({
1425
1426
  mutationFn: async (a) => n(e, {
1426
- action: L.DELETE_PAGE,
1427
+ action: k.DELETE_PAGE,
1427
1428
  data: { id: a == null ? void 0 : a.id }
1428
1429
  }),
1429
1430
  onSuccess: (a, i) => {
@@ -1435,12 +1436,12 @@ const kl = () => {
1435
1436
  }
1436
1437
  i && (i != null && i.primaryPage) ? t.invalidateQueries({
1437
1438
  queryKey: [
1438
- V,
1439
- L.GET_LANGUAGE_PAGES,
1439
+ K,
1440
+ k.GET_LANGUAGE_PAGES,
1440
1441
  i == null ? void 0 : i.primaryPage
1441
1442
  ]
1442
1443
  }) : t.invalidateQueries({
1443
- queryKey: [V, L.GET_WEBSITE_PAGES]
1444
+ queryKey: [K, k.GET_WEBSITE_PAGES]
1444
1445
  });
1445
1446
  },
1446
1447
  onError: (a, i) => {
@@ -1454,25 +1455,25 @@ const kl = () => {
1454
1455
  }
1455
1456
  });
1456
1457
  }, $l = () => {
1457
- const e = ne(), t = Ae(), n = ee(), { data: s } = De();
1458
- return Pe({
1458
+ const e = ee(), t = Te(), n = Y(), { data: s } = De();
1459
+ return Ce({
1459
1460
  mutationFn: async (a) => n(e, {
1460
- action: L.TAKE_OFFLINE,
1461
+ action: k.TAKE_OFFLINE,
1461
1462
  data: { id: a == null ? void 0 : a.id }
1462
1463
  }),
1463
1464
  onSuccess: (a, i) => {
1464
1465
  i && (i != null && i.primaryPage) ? t.invalidateQueries({
1465
1466
  queryKey: [
1466
- V,
1467
- L.GET_LANGUAGE_PAGES,
1467
+ K,
1468
+ k.GET_LANGUAGE_PAGES,
1468
1469
  i == null ? void 0 : i.primaryPage
1469
1470
  ]
1470
1471
  }) : t.invalidateQueries({
1471
- queryKey: [V, L.GET_WEBSITE_PAGES]
1472
+ queryKey: [K, k.GET_WEBSITE_PAGES]
1472
1473
  });
1473
1474
  const l = ye(s, { key: i.pageType });
1474
1475
  te.success(
1475
- l != null && l.hasSlug ? H.PAGE_UNPUBLISH_SUCCESS : "New " + l.name + " added successfully."
1476
+ l != null && l.hasSlug ? j.PAGE_UNPUBLISH_SUCCESS : "New " + l.name + " added successfully."
1476
1477
  );
1477
1478
  },
1478
1479
  onError: (a, i) => {
@@ -1486,19 +1487,19 @@ const kl = () => {
1486
1487
  }
1487
1488
  });
1488
1489
  }, xs = () => {
1489
- const e = ne(), t = ee(), n = Ae(), { data: s } = Oe();
1490
- return Pe({
1490
+ const e = ee(), t = Y(), n = Te(), { data: s } = Re();
1491
+ return Ce({
1491
1492
  mutationFn: async ({ ids: a }) => t(e, {
1492
- action: L.PUBLISH_CHANGES,
1493
+ action: k.PUBLISH_CHANGES,
1493
1494
  data: { ids: a }
1494
1495
  }),
1495
1496
  onSuccess: () => {
1496
1497
  n.invalidateQueries({
1497
- queryKey: [V, L.GET_CHANGES]
1498
+ queryKey: [K, k.GET_CHANGES]
1498
1499
  }), n.invalidateQueries({
1499
- queryKey: [V, L.GET_WEBSITE_PAGES]
1500
+ queryKey: [K, k.GET_WEBSITE_PAGES]
1500
1501
  }), n.invalidateQueries({
1501
- queryKey: [V, L.GET_LANGUAGE_PAGES, s == null ? void 0 : s.id]
1502
+ queryKey: [K, k.GET_LANGUAGE_PAGES, s == null ? void 0 : s.id]
1502
1503
  });
1503
1504
  },
1504
1505
  onError: () => {
@@ -1506,12 +1507,12 @@ const kl = () => {
1506
1507
  }
1507
1508
  });
1508
1509
  }, Wl = () => {
1509
- const e = ne(), t = ee(), n = Ae();
1510
- return Pe({
1510
+ const e = ee(), t = Y(), n = Te();
1511
+ return Ce({
1511
1512
  mutationFn: async (s) => {
1512
1513
  var a;
1513
1514
  return t(e, {
1514
- action: L.MARK_AS_TEMPLATE,
1515
+ action: k.MARK_AS_TEMPLATE,
1515
1516
  data: {
1516
1517
  id: (a = s.page) == null ? void 0 : a.id,
1517
1518
  name: s.name,
@@ -1523,7 +1524,7 @@ const kl = () => {
1523
1524
  },
1524
1525
  onSuccess: () => {
1525
1526
  n.invalidateQueries({
1526
- queryKey: [V, L.GET_WEBSITE_PAGES]
1527
+ queryKey: [K, k.GET_WEBSITE_PAGES]
1527
1528
  }), te.success("Page marked as template successfully.");
1528
1529
  },
1529
1530
  onError: () => {
@@ -1531,15 +1532,15 @@ const kl = () => {
1531
1532
  }
1532
1533
  });
1533
1534
  }, Yl = () => {
1534
- const e = ne(), t = ee(), n = Ae();
1535
- return Pe({
1535
+ const e = ee(), t = Y(), n = Te();
1536
+ return Ce({
1536
1537
  mutationFn: async (s) => t(e, {
1537
- action: L.UNMARK_AS_TEMPLATE,
1538
+ action: k.UNMARK_AS_TEMPLATE,
1538
1539
  data: { id: s == null ? void 0 : s.id }
1539
1540
  }),
1540
1541
  onSuccess: () => {
1541
1542
  n.invalidateQueries({
1542
- queryKey: [V, L.GET_WEBSITE_PAGES]
1543
+ queryKey: [K, k.GET_WEBSITE_PAGES]
1543
1544
  }), te.success("Page unmarked as template successfully.");
1544
1545
  },
1545
1546
  onError: () => {
@@ -1547,17 +1548,17 @@ const kl = () => {
1547
1548
  }
1548
1549
  });
1549
1550
  }, Ql = () => {
1550
- const e = ne(), t = ee(), n = Ae();
1551
- return Pe({
1551
+ const e = ee(), t = Y(), n = Te();
1552
+ return Ce({
1552
1553
  mutationFn: async ({ id: s, slug: a }) => t(e, {
1553
- action: L.CHANGE_SLUG,
1554
+ action: k.CHANGE_SLUG,
1554
1555
  data: { id: s, slug: a }
1555
1556
  }),
1556
1557
  onSuccess: (s, { primaryPage: a }) => {
1557
- te.success(H.SLUG_CHANGE_SUCCESS), a ? n.invalidateQueries({
1558
- queryKey: [V, L.GET_LANGUAGE_PAGES, a]
1558
+ te.success(j.SLUG_CHANGE_SUCCESS), a ? n.invalidateQueries({
1559
+ queryKey: [K, k.GET_LANGUAGE_PAGES, a]
1559
1560
  }) : n.invalidateQueries({
1560
- queryKey: [V, L.GET_WEBSITE_PAGES]
1561
+ queryKey: [K, k.GET_WEBSITE_PAGES]
1561
1562
  });
1562
1563
  },
1563
1564
  onError: () => {
@@ -1593,57 +1594,57 @@ var Ts = {};
1593
1594
  return x;
1594
1595
  if (m.has(x))
1595
1596
  return m.get(x);
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;
1597
+ var D = new OffscreenCanvas(x.width, x.height), U = D.getContext("2d");
1598
+ return U.drawImage(x, 0, 0), m.set(x, D), D;
1598
1599
  },
1599
1600
  clear: function() {
1600
1601
  m.clear();
1601
1602
  }
1602
1603
  };
1603
1604
  }(o, /* @__PURE__ */ new Map()), f = function() {
1604
- var g = Math.floor(16.666666666666668), m, x, D = {}, R = 0;
1605
- return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (m = function(j) {
1605
+ var g = Math.floor(16.666666666666668), m, x, D = {}, U = 0;
1606
+ return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (m = function(M) {
1606
1607
  var z = Math.random();
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);
1608
+ return D[z] = requestAnimationFrame(function O(b) {
1609
+ U === b || U + g - 1 < b ? (U = b, delete D[z], M()) : D[z] = requestAnimationFrame(O);
1609
1610
  }), z;
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);
1611
+ }, x = function(M) {
1612
+ D[M] && cancelAnimationFrame(D[M]);
1613
+ }) : (m = function(M) {
1614
+ return setTimeout(M, g);
1615
+ }, x = function(M) {
1616
+ return clearTimeout(M);
1616
1617
  }), { frame: m, cancel: x };
1617
1618
  }(), y = /* @__PURE__ */ function() {
1618
1619
  var g, m, x = {};
1619
- function D(R) {
1620
- function j(z, U) {
1621
- R.postMessage({ options: z || {}, callback: U });
1620
+ function D(U) {
1621
+ function M(z, O) {
1622
+ U.postMessage({ options: z || {}, callback: O });
1622
1623
  }
1623
- R.init = function(U) {
1624
- var b = U.transferControlToOffscreen();
1625
- R.postMessage({ canvas: b }, [b]);
1626
- }, R.fire = function(U, b, K) {
1624
+ U.init = function(O) {
1625
+ var b = O.transferControlToOffscreen();
1626
+ U.postMessage({ canvas: b }, [b]);
1627
+ }, U.fire = function(O, b, V) {
1627
1628
  if (m)
1628
- return j(U, null), m;
1629
- var re = Math.random().toString(36).slice(2);
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());
1629
+ return M(O, null), m;
1630
+ var se = Math.random().toString(36).slice(2);
1631
+ return m = d(function(J) {
1632
+ function pe(_e) {
1633
+ _e.data.callback === se && (delete x[se], U.removeEventListener("message", pe), m = null, h.clear(), V(), J());
1633
1634
  }
1634
- R.addEventListener("message", pe), j(U, re), x[re] = pe.bind(null, { data: { callback: re } });
1635
+ U.addEventListener("message", pe), M(O, se), x[se] = pe.bind(null, { data: { callback: se } });
1635
1636
  }), m;
1636
- }, R.reset = function() {
1637
- R.postMessage({ reset: !0 });
1638
- for (var U in x)
1639
- x[U](), delete x[U];
1637
+ }, U.reset = function() {
1638
+ U.postMessage({ reset: !0 });
1639
+ for (var O in x)
1640
+ x[O](), delete x[O];
1640
1641
  };
1641
1642
  }
1642
1643
  return function() {
1643
1644
  if (g)
1644
1645
  return g;
1645
1646
  if (!s && i) {
1646
- var R = [
1647
+ var U = [
1647
1648
  "var CONFETTI, SIZE = {}, module = {};",
1648
1649
  "(" + e.toString() + ")(this, module, true, SIZE);",
1649
1650
  "onmessage = function(msg) {",
@@ -1667,9 +1668,9 @@ var Ts = {};
1667
1668
  ].join(`
1668
1669
  `);
1669
1670
  try {
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;
1671
+ g = new Worker(URL.createObjectURL(new Blob([U])));
1672
+ } catch (M) {
1673
+ return typeof console !== void 0 && typeof console.warn == "function" && console.warn("🎊 Could not load worker", M), null;
1673
1674
  }
1674
1675
  D(g);
1675
1676
  }
@@ -1723,9 +1724,9 @@ var Ts = {};
1723
1724
  return parseInt(g, 16);
1724
1725
  }
1725
1726
  function w(g) {
1726
- return g.map(k);
1727
+ return g.map(L);
1727
1728
  }
1728
- function k(g) {
1729
+ function L(g) {
1729
1730
  var m = String(g).replace(/[^0-9a-f]/gi, "");
1730
1731
  return m.length < 6 && (m = m[0] + m[0] + m[1] + m[1] + m[2] + m[2]), {
1731
1732
  r: _(m.substring(0, 2)),
@@ -1737,19 +1738,19 @@ var Ts = {};
1737
1738
  var m = E(g, "origin", Object);
1738
1739
  return m.x = E(m, "x", Number), m.y = E(m, "y", Number), m;
1739
1740
  }
1740
- function se(g) {
1741
+ function ne(g) {
1741
1742
  g.width = document.documentElement.clientWidth, g.height = document.documentElement.clientHeight;
1742
1743
  }
1743
- function O(g) {
1744
+ function R(g) {
1744
1745
  var m = g.getBoundingClientRect();
1745
1746
  g.width = m.width, g.height = m.height;
1746
1747
  }
1747
- function X(g) {
1748
+ function Z(g) {
1748
1749
  var m = document.createElement("canvas");
1749
1750
  return m.style.position = "fixed", m.style.top = "0px", m.style.left = "0px", m.style.pointerEvents = "none", m.style.zIndex = g, m;
1750
1751
  }
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();
1752
+ function B(g, m, x, D, U, M, z, O, b) {
1753
+ g.save(), g.translate(m, x), g.rotate(M), g.scale(D, U), g.arc(0, 0, 1, z, O, b), g.restore();
1753
1754
  }
1754
1755
  function S(g) {
1755
1756
  var m = g.angle * (Math.PI / 180), x = g.spread * (Math.PI / 180);
@@ -1780,74 +1781,74 @@ var Ts = {};
1780
1781
  }
1781
1782
  function G(g, m) {
1782
1783
  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);
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;
1784
+ var x = m.tick++ / m.totalTicks, D = m.x + m.random * m.tiltCos, U = m.y + m.random * m.tiltSin, M = m.wobbleX + m.random * m.tiltCos, z = m.wobbleY + m.random * m.tiltSin;
1784
1785
  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))
1785
- g.fill(Y(
1786
+ g.fill($(
1786
1787
  m.shape.path,
1787
1788
  m.shape.matrix,
1788
1789
  m.x,
1789
1790
  m.y,
1790
- Math.abs(j - D) * 0.1,
1791
- Math.abs(z - R) * 0.1,
1791
+ Math.abs(M - D) * 0.1,
1792
+ Math.abs(z - U) * 0.1,
1792
1793
  Math.PI / 10 * m.wobble
1793
1794
  ));
1794
1795
  else if (m.shape.type === "bitmap") {
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,
1796
+ var O = Math.PI / 10 * m.wobble, b = Math.abs(M - D) * 0.1, V = Math.abs(z - U) * 0.1, se = m.shape.bitmap.width * m.scalar, J = m.shape.bitmap.height * m.scalar, pe = new DOMMatrix([
1797
+ Math.cos(O) * b,
1798
+ Math.sin(O) * b,
1799
+ -Math.sin(O) * V,
1800
+ Math.cos(O) * V,
1800
1801
  m.x,
1801
1802
  m.y
1802
1803
  ]);
1803
1804
  pe.multiplySelf(new DOMMatrix(m.shape.matrix));
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(
1806
- m.x - re / 2,
1807
- m.y - Z / 2,
1808
- re,
1809
- Z
1805
+ var _e = g.createPattern(h.transform(m.shape.bitmap), "no-repeat");
1806
+ _e.setTransform(pe), g.globalAlpha = 1 - x, g.fillStyle = _e, g.fillRect(
1807
+ m.x - se / 2,
1808
+ m.y - J / 2,
1809
+ se,
1810
+ J
1810
1811
  ), g.globalAlpha = 1;
1811
1812
  } else if (m.shape === "circle")
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);
1813
+ g.ellipse ? g.ellipse(m.x, m.y, Math.abs(M - 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(M - D) * m.ovalScalar, Math.abs(z - U) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI);
1813
1814
  else if (m.shape === "star")
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;
1815
+ for (var Q = Math.PI / 2 * 3, be = 4 * m.scalar, Fe = 8 * m.scalar, qe = m.x, Xe = m.y, at = 5, $e = Math.PI / at; at--; )
1816
+ 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) * be, Xe = m.y + Math.sin(Q) * be, g.lineTo(qe, Xe), Q += $e;
1816
1817
  else
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));
1818
+ g.moveTo(Math.floor(m.x), Math.floor(m.y)), g.lineTo(Math.floor(m.wobbleX), Math.floor(U)), g.lineTo(Math.floor(M), Math.floor(z)), g.lineTo(Math.floor(D), Math.floor(m.wobbleY));
1818
1819
  return g.closePath(), g.fill(), m.tick < m.totalTicks;
1819
1820
  }
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();
1821
+ function ve(g, m, x, D, U) {
1822
+ var M = m.slice(), z = g.getContext("2d"), O, b, V = d(function(se) {
1823
+ function J() {
1824
+ O = b = null, z.clearRect(0, 0, D.width, D.height), h.clear(), U(), se();
1824
1825
  }
1825
1826
  function pe() {
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();
1827
+ 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), M = M.filter(function(_e) {
1828
+ return G(z, _e);
1829
+ }), M.length ? O = f.frame(pe) : J();
1829
1830
  }
1830
- U = f.frame(pe), b = Z;
1831
+ O = f.frame(pe), b = J;
1831
1832
  });
1832
1833
  return {
1833
- addFettis: function(re) {
1834
- return j = j.concat(re), K;
1834
+ addFettis: function(se) {
1835
+ return M = M.concat(se), V;
1835
1836
  },
1836
1837
  canvas: g,
1837
- promise: K,
1838
+ promise: V,
1838
1839
  reset: function() {
1839
- U && f.cancel(U), b && b();
1840
+ O && f.cancel(O), b && b();
1840
1841
  }
1841
1842
  };
1842
1843
  }
1843
- function F(g, m) {
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--; )
1844
+ function ie(g, m) {
1845
+ var x = !g, D = !!E(m || {}, "resize"), U = !1, M = E(m, "disableForReducedMotion", Boolean), z = i && !!E(m || {}, "useWorker"), O = z ? y() : null, b = x ? ne : R, V = g && O ? !!g.__confetti_initialized : !1, se = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, J;
1846
+ function pe(Q, be, Fe) {
1847
+ 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 = [], Oa = g.width * ks.x, Ra = g.height * ks.y; Ls--; )
1847
1848
  Mn.push(
1848
1849
  S({
1849
- x: Ra,
1850
- y: Oa,
1850
+ x: Oa,
1851
+ y: Ra,
1851
1852
  angle: Xe,
1852
1853
  spread: at,
1853
1854
  startVelocity: $e,
@@ -1861,29 +1862,29 @@ var Ts = {};
1861
1862
  flat: Ua
1862
1863
  })
1863
1864
  );
1864
- return Z ? Z.addFettis(Mn) : (Z = ge(g, Mn, b, ve, Fe), Z.promise);
1865
+ return J ? J.addFettis(Mn) : (J = ve(g, Mn, b, be, Fe), J.promise);
1865
1866
  }
1866
- function Ce(Q) {
1867
- var ve = j || E(Q, "disableForReducedMotion", Boolean), Fe = E(Q, "zIndex", Number);
1868
- if (ve && re)
1867
+ function _e(Q) {
1868
+ var be = M || E(Q, "disableForReducedMotion", Boolean), Fe = E(Q, "zIndex", Number);
1869
+ if (be && se)
1869
1870
  return d(function($e) {
1870
1871
  $e();
1871
1872
  });
1872
- x && Z ? g = Z.canvas : x && !g && (g = X(Fe), document.body.appendChild(g)), D && !K && b(g);
1873
+ x && J ? g = J.canvas : x && !g && (g = Z(Fe), document.body.appendChild(g)), D && !V && b(g);
1873
1874
  var qe = {
1874
1875
  width: g.width,
1875
1876
  height: g.height
1876
1877
  };
1877
- U && !K && U.init(g), K = !0, U && (g.__confetti_initialized = !0);
1878
+ O && !V && O.init(g), V = !0, O && (g.__confetti_initialized = !0);
1878
1879
  function Xe() {
1879
- if (U) {
1880
+ if (O) {
1880
1881
  var $e = {
1881
1882
  getBoundingClientRect: function() {
1882
1883
  if (!x)
1883
1884
  return g.getBoundingClientRect();
1884
1885
  }
1885
1886
  };
1886
- b($e), U.postMessage({
1887
+ b($e), O.postMessage({
1887
1888
  resize: {
1888
1889
  width: $e.width,
1889
1890
  height: $e.height
@@ -1894,49 +1895,49 @@ var Ts = {};
1894
1895
  qe.width = qe.height = null;
1895
1896
  }
1896
1897
  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);
1898
+ J = null, D && (U = !1, t.removeEventListener("resize", Xe)), x && g && (document.body.contains(g) && document.body.removeChild(g), g = null, V = !1);
1898
1899
  }
1899
- return D && !R && (R = !0, t.addEventListener("resize", Xe, !1)), U ? U.fire(Q, qe, at) : pe(Q, qe, at);
1900
+ return D && !U && (U = !0, t.addEventListener("resize", Xe, !1)), O ? O.fire(Q, qe, at) : pe(Q, qe, at);
1900
1901
  }
1901
- return Ce.reset = function() {
1902
- U && U.reset(), Z && Z.reset();
1903
- }, Ce;
1904
- }
1905
- var he;
1906
- function Te() {
1907
- return he || (he = F(null, { useWorker: !0, resize: !0 })), he;
1908
- }
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));
1912
- var K = new Path2D();
1913
- return K.addPath(b, new DOMMatrix([
1914
- Math.cos(z) * R,
1915
- Math.sin(z) * R,
1916
- -Math.sin(z) * j,
1917
- Math.cos(z) * j,
1902
+ return _e.reset = function() {
1903
+ O && O.reset(), J && J.reset();
1904
+ }, _e;
1905
+ }
1906
+ var Ee;
1907
+ function le() {
1908
+ return Ee || (Ee = ie(null, { useWorker: !0, resize: !0 })), Ee;
1909
+ }
1910
+ function $(g, m, x, D, U, M, z) {
1911
+ var O = new Path2D(g), b = new Path2D();
1912
+ b.addPath(O, new DOMMatrix(m));
1913
+ var V = new Path2D();
1914
+ return V.addPath(b, new DOMMatrix([
1915
+ Math.cos(z) * U,
1916
+ Math.sin(z) * U,
1917
+ -Math.sin(z) * M,
1918
+ Math.cos(z) * M,
1918
1919
  x,
1919
1920
  D
1920
- ])), K;
1921
+ ])), V;
1921
1922
  }
1922
- function xe(g) {
1923
+ function ge(g) {
1923
1924
  if (!l)
1924
1925
  throw new Error("path confetti are not supported in this browser");
1925
1926
  var m, x;
1926
1927
  typeof g == "string" ? m = g : (m = g.path, x = g.matrix);
1927
- var D = new Path2D(m), R = document.createElement("canvas"), j = R.getContext("2d");
1928
+ var D = new Path2D(m), U = document.createElement("canvas"), M = U.getContext("2d");
1928
1929
  if (!x) {
1929
- for (var z = 1e3, U = z, b = z, K = 0, re = 0, Z, pe, Ce = 0; Ce < z; Ce += 2)
1930
+ for (var z = 1e3, O = z, b = z, V = 0, se = 0, J, pe, _e = 0; _e < z; _e += 2)
1930
1931
  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);
1932
+ M.isPointInPath(D, _e, Q, "nonzero") && (O = Math.min(O, _e), b = Math.min(b, Q), V = Math.max(V, _e), se = Math.max(se, Q));
1933
+ J = V - O, pe = se - b;
1934
+ var be = 10, Fe = Math.min(be / J, be / pe);
1934
1935
  x = [
1935
1936
  Fe,
1936
1937
  0,
1937
1938
  0,
1938
1939
  Fe,
1939
- -Math.round(Z / 2 + U) * Fe,
1940
+ -Math.round(J / 2 + O) * Fe,
1940
1941
  -Math.round(pe / 2 + b) * Fe
1941
1942
  ];
1942
1943
  }
@@ -1946,26 +1947,26 @@ var Ts = {};
1946
1947
  matrix: x
1947
1948
  };
1948
1949
  }
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");
1950
+ function H(g) {
1951
+ 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';
1952
+ 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);
1953
+ var M = 10 * x, z = "" + M + "px " + U, O = new OffscreenCanvas(M, M), b = O.getContext("2d");
1953
1954
  b.font = z;
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);
1956
- var ve = 1 / x;
1955
+ var V = b.measureText(m), se = Math.ceil(V.actualBoundingBoxRight + V.actualBoundingBoxLeft), J = Math.ceil(V.actualBoundingBoxAscent + V.actualBoundingBoxDescent), pe = 2, _e = V.actualBoundingBoxLeft + pe, Q = V.actualBoundingBoxAscent + pe;
1956
+ se += pe + pe, J += pe + pe, O = new OffscreenCanvas(se, J), b = O.getContext("2d"), b.font = z, b.fillStyle = D, b.fillText(m, _e, Q);
1957
+ var be = 1 / x;
1957
1958
  return {
1958
1959
  type: "bitmap",
1959
1960
  // TODO these probably need to be transfered for workers
1960
- bitmap: U.transferToImageBitmap(),
1961
- matrix: [ve, 0, 0, ve, -re * ve / 2, -Z * ve / 2]
1961
+ bitmap: O.transferToImageBitmap(),
1962
+ matrix: [be, 0, 0, be, -se * be / 2, -J * be / 2]
1962
1963
  };
1963
1964
  }
1964
1965
  n.exports = function() {
1965
- return Te().apply(this, arguments);
1966
+ return le().apply(this, arguments);
1966
1967
  }, n.exports.reset = function() {
1967
- Te().reset();
1968
- }, n.exports.create = F, n.exports.shapeFromPath = xe, n.exports.shapeFromText = W;
1968
+ le().reset();
1969
+ }, n.exports.create = ie, n.exports.shapeFromPath = ge, n.exports.shapeFromText = H;
1969
1970
  })(/* @__PURE__ */ function() {
1970
1971
  return typeof window < "u" ? window : typeof self < "u" ? self : this || {};
1971
1972
  }(), Ts, !1);
@@ -1991,7 +1992,7 @@ const Zl = {
1991
1992
  const n = { ...Zl, ...t };
1992
1993
  Xl(n);
1993
1994
  }, eo = () => {
1994
- const [e] = li(), { mutate: t, isPending: n } = xs(), { mutateAsync: s, isPending: a } = Or();
1995
+ const [e] = li(), { mutate: t, isPending: n } = xs(), { mutateAsync: s, isPending: a } = Rr();
1995
1996
  return /* @__PURE__ */ u("div", { className: "bg-white py-3 flex items-center justify-center gap-x-3 border-t", children: [
1996
1997
  /* @__PURE__ */ r(
1997
1998
  P,
@@ -2064,7 +2065,7 @@ const Zl = {
2064
2065
  ] })
2065
2066
  ] }),
2066
2067
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2067
- /* @__PURE__ */ u(ae, { htmlFor: "slug", className: "text-right", children: [
2068
+ /* @__PURE__ */ u(re, { htmlFor: "slug", className: "text-right", children: [
2068
2069
  "Slug",
2069
2070
  " ",
2070
2071
  /* @__PURE__ */ u("small", { className: "font-light text-gray-500", children: [
@@ -2073,7 +2074,7 @@ const Zl = {
2073
2074
  ] })
2074
2075
  ] }),
2075
2076
  /* @__PURE__ */ r(
2076
- we,
2077
+ Ne,
2077
2078
  {
2078
2079
  id: "slug",
2079
2080
  value: n,
@@ -2105,7 +2106,7 @@ function jr({
2105
2106
  page: e,
2106
2107
  onClose: t
2107
2108
  }) {
2108
- const [, n] = Re(), { mutate: s, isPending: a } = zl(), { data: i } = De(), l = () => {
2109
+ const [, n] = Oe(), { mutate: s, isPending: a } = zl(), { data: i } = De(), l = () => {
2109
2110
  s(e, {
2110
2111
  onSuccess: () => {
2111
2112
  e != null && e.primaryPage || (window.history.replaceState(null, "", "/"), n(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate"))), t();
@@ -2127,7 +2128,7 @@ function jr({
2127
2128
  e.lang && /* @__PURE__ */ u("div", { className: "py-2 text-sm", children: [
2128
2129
  "Language:",
2129
2130
  " ",
2130
- /* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children: $(He, e.lang, e.lang) })
2131
+ /* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children: W(He, e.lang, e.lang) })
2131
2132
  ] })
2132
2133
  ] })
2133
2134
  ] }),
@@ -2151,7 +2152,7 @@ const Me = ({
2151
2152
  children: n,
2152
2153
  fallback: s = null
2153
2154
  }) => {
2154
- const { hasPermission: a } = Lt();
2155
+ const { hasPermission: a } = Dt();
2155
2156
  return e && !a(e) || t && !t.some((i) => a(i)) ? s : n;
2156
2157
  }, Cs = ({
2157
2158
  page: e,
@@ -2164,7 +2165,7 @@ const Me = ({
2164
2165
  /* @__PURE__ */ u(Ve, { children: [
2165
2166
  /* @__PURE__ */ r(ze, { children: "Confirm action" }),
2166
2167
  /* @__PURE__ */ u(Qe, { children: [
2167
- H.UNPUBLISH_MSG,
2168
+ j.UNPUBLISH_MSG,
2168
2169
  " ",
2169
2170
  /* @__PURE__ */ r("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
2170
2171
  "?"
@@ -2178,7 +2179,7 @@ const Me = ({
2178
2179
  variant: "destructive",
2179
2180
  disabled: s,
2180
2181
  onClick: a,
2181
- children: s ? H.UPDATING : H.UNPUBLISH
2182
+ children: s ? j.UPDATING : j.UNPUBLISH
2182
2183
  }
2183
2184
  )
2184
2185
  ] })
@@ -2188,7 +2189,7 @@ const Me = ({
2188
2189
  onClose: t,
2189
2190
  languages: n
2190
2191
  }) => {
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(
2192
+ const { data: s } = Re(), { 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 = X(
2192
2193
  () => a == null ? void 0 : a.find(
2193
2194
  (_) => _.key === e.pageType
2194
2195
  ),
@@ -2206,13 +2207,13 @@ const Me = ({
2206
2207
  };
2207
2208
  return /* @__PURE__ */ r(je, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px] text-slate-600", children: [
2208
2209
  /* @__PURE__ */ u(Ve, { children: [
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 })
2210
+ /* @__PURE__ */ r(ze, { children: e.edit ? j.EDIT_LANGUAGE : j.ADD_NEW_LANGUAGE }),
2211
+ /* @__PURE__ */ r(Qe, { className: "font-light", children: j.ENTER_LANGUAGE_DETAILS })
2211
2212
  ] }),
2212
2213
  /* @__PURE__ */ u("form", { onSubmit: N, children: [
2213
2214
  /* @__PURE__ */ u("div", { className: "grid gap-4 py-4", children: [
2214
2215
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2215
- /* @__PURE__ */ r(ae, { htmlFor: "lang", className: "text-right", children: H.LANGUAGE }),
2216
+ /* @__PURE__ */ r(re, { htmlFor: "lang", className: "text-right", children: j.LANGUAGE }),
2216
2217
  /* @__PURE__ */ u(
2217
2218
  "select",
2218
2219
  {
@@ -2224,34 +2225,34 @@ const Me = ({
2224
2225
  },
2225
2226
  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",
2226
2227
  children: [
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, _, _) }, _))
2228
+ /* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ? W(He, e.lang, e.lang) : de(n) ? j.ALL_AVAILABLE_LANGUAGE_PAGE : j.CHOOSE_LANGUAGE }),
2229
+ Be(n, (_) => /* @__PURE__ */ r("option", { value: _, children: W(He, _, _) }, _))
2229
2230
  ]
2230
2231
  }
2231
2232
  )
2232
2233
  ] }),
2233
2234
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2234
- /* @__PURE__ */ r(ae, { htmlFor: "slug", className: "text-right", children: H.PAGE_NAME }),
2235
+ /* @__PURE__ */ r(re, { htmlFor: "slug", className: "text-right", children: j.PAGE_NAME }),
2235
2236
  /* @__PURE__ */ r(
2236
- we,
2237
+ Ne,
2237
2238
  {
2238
2239
  id: "name",
2239
2240
  value: i,
2240
2241
  onChange: (_) => l(_.target.value),
2241
2242
  className: "col-span-3",
2242
2243
  required: !0,
2243
- placeholder: H.ENTER_PAGE_NAME
2244
+ placeholder: j.ENTER_PAGE_NAME
2244
2245
  }
2245
2246
  )
2246
2247
  ] }),
2247
2248
  !E && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2248
- /* @__PURE__ */ u(ae, { htmlFor: "slug", className: "text-right", children: [
2249
- H.SLUG,
2249
+ /* @__PURE__ */ u(re, { htmlFor: "slug", className: "text-right", children: [
2250
+ j.SLUG,
2250
2251
  " ",
2251
- /* @__PURE__ */ r("small", { className: "font-light", children: H.SLUG_SHOULD_START_WITH })
2252
+ /* @__PURE__ */ r("small", { className: "font-light", children: j.SLUG_SHOULD_START_WITH })
2252
2253
  ] }),
2253
2254
  /* @__PURE__ */ r(
2254
- we,
2255
+ Ne,
2255
2256
  {
2256
2257
  id: "slug",
2257
2258
  value: d,
@@ -2263,8 +2264,8 @@ const Me = ({
2263
2264
  required: !0,
2264
2265
  pattern: "^/.*",
2265
2266
  disabled: de(o),
2266
- title: H.SLUG_MUST_START_WITH,
2267
- placeholder: de(o) ? H.CHOOSE_LANGUAGE_TO_ADD_SLUG : H.ENTER_PAGE_SLUG
2267
+ title: j.SLUG_MUST_START_WITH,
2268
+ placeholder: de(o) ? j.CHOOSE_LANGUAGE_TO_ADD_SLUG : j.ENTER_PAGE_SLUG
2268
2269
  }
2269
2270
  )
2270
2271
  ] })
@@ -2274,15 +2275,15 @@ const Me = ({
2274
2275
  {
2275
2276
  type: "submit",
2276
2277
  disabled: C || !i || !o || !E && !Bt(d, `/${o}`),
2277
- children: C ? e.edit ? H.UPDATING : H.ADDING : e.edit ? H.UPDATE : H.ADD_NEW_LANGUAGE
2278
+ children: C ? e.edit ? j.UPDATING : j.ADDING : e.edit ? j.UPDATE : j.ADD_NEW_LANGUAGE
2278
2279
  }
2279
2280
  ) })
2280
2281
  ] })
2281
2282
  ] }) });
2282
2283
  }, no = () => {
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(
2284
- $(p, "languages") || ["en"],
2285
- (E) => !ye(i, { lang: E }) && E !== $(p, "fallbackLang")
2284
+ const [e, t] = I(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = dt(), { data: i, isFetching: l } = un(), { data: o } = Re(), [c, d] = I(null), [h, f] = I(null), [y, v] = I(null), { data: p } = mt(), A = Se(
2285
+ W(p, "languages") || ["en"],
2286
+ (E) => !ye(i, { lang: E }) && E !== W(p, "fallbackLang")
2286
2287
  );
2287
2288
  return /* @__PURE__ */ u("div", { className: "space-y-4", children: [
2288
2289
  /* @__PURE__ */ r("ul", { className: "space-y-2", children: l ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
@@ -2291,7 +2292,7 @@ const Me = ({
2291
2292
  /* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
2292
2293
  ] }) : Be(i, (E) => {
2293
2294
  const C = E.lang, N = E.slug, _ = !E.primaryPage;
2294
- return /* @__PURE__ */ u(Ee, { children: [
2295
+ return /* @__PURE__ */ u(we, { children: [
2295
2296
  /* @__PURE__ */ u(
2296
2297
  "li",
2297
2298
  {
@@ -2310,7 +2311,7 @@ const Me = ({
2310
2311
  className: `w-2.5 h-2.5 rounded-full ${E.online ? "bg-green-300" : "bg-gray-300"}`
2311
2312
  }
2312
2313
  ),
2313
- $(He, _ ? s : C, C)
2314
+ W(He, _ ? s : C, C)
2314
2315
  ]
2315
2316
  }
2316
2317
  ),
@@ -2345,7 +2346,7 @@ const Me = ({
2345
2346
  ln,
2346
2347
  {
2347
2348
  asChild: !0,
2348
- onClick: (k) => k.stopPropagation(),
2349
+ onClick: (L) => L.stopPropagation(),
2349
2350
  children: /* @__PURE__ */ r(
2350
2351
  P,
2351
2352
  {
@@ -2371,12 +2372,12 @@ const Me = ({
2371
2372
  Ge,
2372
2373
  {
2373
2374
  className: "flex items-center gap-2 cursor-pointer",
2374
- onClick: (k) => {
2375
- k.stopPropagation(), t({ ...E, edit: !0 });
2375
+ onClick: (L) => {
2376
+ L.stopPropagation(), t({ ...E, edit: !0 });
2376
2377
  },
2377
2378
  children: [
2378
2379
  /* @__PURE__ */ r(qi, { className: "size-3" }),
2379
- H.EDIT
2380
+ j.EDIT
2380
2381
  ]
2381
2382
  }
2382
2383
  )
@@ -2390,12 +2391,12 @@ const Me = ({
2390
2391
  Ge,
2391
2392
  {
2392
2393
  className: "flex items-center gap-2 cursor-pointer",
2393
- onClick: (k) => {
2394
- k.stopPropagation(), f(E);
2394
+ onClick: (L) => {
2395
+ L.stopPropagation(), f(E);
2395
2396
  },
2396
2397
  children: [
2397
2398
  /* @__PURE__ */ r(_r, { className: "size-3" }),
2398
- H.UNPUBLISH
2399
+ j.UNPUBLISH
2399
2400
  ]
2400
2401
  }
2401
2402
  )
@@ -2409,12 +2410,12 @@ const Me = ({
2409
2410
  Ge,
2410
2411
  {
2411
2412
  className: "flex items-center gap-2 cursor-pointer",
2412
- onClick: (k) => {
2413
- k.stopPropagation(), d(E);
2413
+ onClick: (L) => {
2414
+ L.stopPropagation(), d(E);
2414
2415
  },
2415
2416
  children: [
2416
2417
  /* @__PURE__ */ r(Hi, { className: "size-3" }),
2417
- H.DELETE
2418
+ j.DELETE
2418
2419
  ]
2419
2420
  }
2420
2421
  )
@@ -2448,7 +2449,7 @@ const Me = ({
2448
2449
  edit: !1
2449
2450
  });
2450
2451
  },
2451
- children: H.ADD_NEW_LANGUAGE
2452
+ children: j.ADD_NEW_LANGUAGE
2452
2453
  }
2453
2454
  ) }) }),
2454
2455
  e && /* @__PURE__ */ r(
@@ -2483,13 +2484,13 @@ function so({
2483
2484
  className: s = "w-full rounded-md border border-gray-300 px-3 py-2",
2484
2485
  id: a = "parentPage"
2485
2486
  }) {
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) => {
2487
+ const i = X(() => !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) => {
2487
2488
  if (d === "/") return "/";
2488
2489
  const h = d.split("/").filter(Boolean);
2489
2490
  return h.length <= 1 ? `/${h[0] || ""}` : `/${h[h.length - 1]}`;
2490
2491
  };
2491
2492
  return /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2492
- /* @__PURE__ */ r(ae, { htmlFor: a, className: "text-sm", children: "Parent" }),
2493
+ /* @__PURE__ */ r(re, { htmlFor: a, className: "text-sm", children: "Parent" }),
2493
2494
  /* @__PURE__ */ u(
2494
2495
  "select",
2495
2496
  {
@@ -2522,7 +2523,7 @@ function ro({
2522
2523
  parentSlug: s
2523
2524
  }) {
2524
2525
  const [a, i] = I(e);
2525
- return Ne(() => {
2526
+ return xe(() => {
2526
2527
  i(e);
2527
2528
  }, [e]), /* @__PURE__ */ u("div", { children: [
2528
2529
  s && /* @__PURE__ */ r("div", { className: "flex items-center mb-1", children: /* @__PURE__ */ u("span", { className: "text-xs text-gray-500", children: [
@@ -2530,7 +2531,7 @@ function ro({
2530
2531
  s
2531
2532
  ] }) }),
2532
2533
  /* @__PURE__ */ r("div", { className: "relative", children: /* @__PURE__ */ r(
2533
- we,
2534
+ Ne,
2534
2535
  {
2535
2536
  value: a,
2536
2537
  onChange: (o) => {
@@ -2549,7 +2550,7 @@ const ao = ({
2549
2550
  isLoading: s = !1
2550
2551
  }) => {
2551
2552
  const [a, i] = I("");
2552
- if (Ne(() => {
2553
+ if (xe(() => {
2553
2554
  if (t) {
2554
2555
  const o = e.find((c) => c.id === t);
2555
2556
  i((o == null ? void 0 : o.preview) || "");
@@ -2591,41 +2592,41 @@ const ao = ({
2591
2592
  ] })
2592
2593
  ] });
2593
2594
  }, io = () => {
2594
- const e = ne(), t = ee();
2595
- return ke({
2596
- queryKey: [V, L.GET_LIBRARIES],
2597
- queryFn: async () => await t(e, { action: L.GET_LIBRARIES }) || []
2595
+ const e = ee(), t = Y();
2596
+ return Ie({
2597
+ queryKey: [K, k.GET_LIBRARIES],
2598
+ queryFn: async () => await t(e, { action: k.GET_LIBRARIES }) || []
2598
2599
  });
2599
2600
  }, lo = (e) => {
2600
- const t = ne(), n = ee();
2601
- return ke({
2602
- queryKey: [V, L.GET_TEMPLATES_BY_TYPE, e],
2601
+ const t = ee(), n = Y();
2602
+ return Ie({
2603
+ queryKey: [K, k.GET_TEMPLATES_BY_TYPE, e],
2603
2604
  enabled: !!e,
2604
2605
  queryFn: async () => {
2605
2606
  const s = await n(t, {
2606
- action: L.GET_TEMPLATES_BY_TYPE,
2607
+ action: k.GET_TEMPLATES_BY_TYPE,
2607
2608
  data: { pageType: e }
2608
2609
  });
2609
- return (e ? be(s, { pageType: e }) : s) || [];
2610
+ return (e ? Se(s, { pageType: e }) : s) || [];
2610
2611
  }
2611
2612
  });
2612
2613
  }, oo = (e) => {
2613
- const { data: t = [], isLoading: n } = lo(e), { data: s = [], isLoading: a } = io(), i = J(() => n || a ? [] : t.map((o) => {
2614
+ const { data: t = [], isLoading: n } = lo(e), { data: s = [], isLoading: a } = io(), i = X(() => n || a ? [] : t.map((o) => {
2614
2615
  const c = ye(s, { id: o.library });
2615
2616
  return {
2616
2617
  ...o,
2617
2618
  libraryName: (c == null ? void 0 : c.type) !== "shared" ? "Site Library" : (c == null ? void 0 : c.name) + " Library",
2618
2619
  libraryType: c == null ? void 0 : c.type
2619
2620
  };
2620
- }), [t, s, n, a]), l = J(() => ja(i, "libraryName"), [i]);
2621
+ }), [t, s, n, a]), l = X(() => ja(i, "libraryName"), [i]);
2621
2622
  return {
2622
2623
  data: i,
2623
2624
  groupedData: l,
2624
2625
  isLoading: n || a
2625
2626
  };
2626
2627
  }, Vr = () => {
2627
- const [, e] = Re();
2628
- return _e(
2628
+ const [, e] = Oe();
2629
+ return Pe(
2629
2630
  (t, n) => {
2630
2631
  const a = new URLSearchParams(window.location.search).get("lang"), i = new URLSearchParams({ page: t });
2631
2632
  a && i.set("lang", a), window.history.pushState({}, "", `?${i.toString()}`), e(i), window.dispatchEvent(new PopStateEvent("popstate")), n == null || n();
@@ -2639,21 +2640,21 @@ function co({
2639
2640
  close: n,
2640
2641
  closePanel: s
2641
2642
  }) {
2642
- var z, U;
2643
+ var z, O;
2643
2644
  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(
2644
2645
  (e == null ? void 0 : e.pageType) ?? "page"
2645
- ), { hasPermission: A } = Lt(), E = A(me.CHANGE_PAGE_TYPE), [C, N] = I(!1), [_, w] = I(""), k = J(() => {
2646
+ ), { hasPermission: A } = Dt(), E = A(me.CHANGE_PAGE_TYPE), [C, N] = I(!1), [_, w] = I(""), L = X(() => {
2646
2647
  const b = t.find(
2647
- (K) => K.key === v
2648
+ (V) => V.key === v
2648
2649
  );
2649
2650
  return (b == null ? void 0 : b.hasSlug) === !1;
2650
- }, [v, t]), [T, se] = I(
2651
+ }, [v, t]), [T, ne] = I(
2651
2652
  (e == null ? void 0 : e.parent) ?? ""
2652
- ), [O, X] = I((e == null ? void 0 : e.name) ?? ""), [B, S] = I(
2653
+ ), [R, Z] = I((e == null ? void 0 : e.name) ?? ""), [B, S] = I(
2653
2654
  (e == null ? void 0 : e.dynamic) ?? !1
2654
- ), [G, ge] = I(
2655
+ ), [G, ve] = I(
2655
2656
  B ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""
2656
- ), [F, he] = I(""), { data: Te, isLoading: Y } = oo(v), xe = c || h, W = t.find(
2657
+ ), [ie, Ee] = I(""), { data: le, isLoading: $ } = oo(v), ge = c || h, H = t.find(
2657
2658
  (b) => b.key === v
2658
2659
  ), g = (b) => {
2659
2660
  if (i && v !== b) {
@@ -2664,23 +2665,23 @@ function co({
2664
2665
  }, m = () => {
2665
2666
  p(_), N(!1), S(!1);
2666
2667
  }, x = (b) => {
2667
- S(b), b && ge("");
2668
+ S(b), b && ve("");
2668
2669
  }, D = (b) => {
2669
- if (se(b), b && b !== "none") {
2670
- const K = l == null ? void 0 : l.find(
2671
- (Z) => Z.id === b
2672
- ), re = (K == null ? void 0 : K.slug) || "";
2673
- if (G.startsWith(re)) {
2674
- const Z = G.slice(re.length).replace(/^\/+/, "");
2675
- ge(Z);
2670
+ if (ne(b), b && b !== "none") {
2671
+ const V = l == null ? void 0 : l.find(
2672
+ (J) => J.id === b
2673
+ ), se = (V == null ? void 0 : V.slug) || "";
2674
+ if (G.startsWith(se)) {
2675
+ const J = G.slice(se.length).replace(/^\/+/, "");
2676
+ ve(J);
2676
2677
  } else
2677
- ge(G.replace(/^\/+/, ""));
2678
+ ve(G.replace(/^\/+/, ""));
2678
2679
  } else
2679
- ge(G ? `${G}` : "");
2680
- }, R = (b) => {
2681
- he(b);
2682
- }, j = (b) => {
2683
- if (b.preventDefault(), y(null), !O.trim()) {
2680
+ ve(G ? `${G}` : "");
2681
+ }, U = (b) => {
2682
+ Ee(b);
2683
+ }, M = (b) => {
2684
+ if (b.preventDefault(), y(null), !R.trim()) {
2684
2685
  te.error("Name is required");
2685
2686
  return;
2686
2687
  }
@@ -2688,27 +2689,27 @@ function co({
2688
2689
  y("Slug must be empty when using dynamic slug");
2689
2690
  return;
2690
2691
  }
2691
- if (!(W != null && W.hasSlug)) {
2692
- const K = {
2693
- pageType: W == null ? void 0 : W.key,
2694
- name: O,
2692
+ if (!(H != null && H.hasSlug)) {
2693
+ const V = {
2694
+ pageType: H == null ? void 0 : H.key,
2695
+ name: R,
2695
2696
  slug: "",
2696
2697
  hasSlug: !1
2697
2698
  };
2698
2699
  if (i) {
2699
2700
  d(
2700
- { id: e == null ? void 0 : e.id, name: O },
2701
+ { id: e == null ? void 0 : e.id, name: R },
2701
2702
  {
2702
2703
  onSuccess: () => {
2703
- te.success((W == null ? void 0 : W.name) + " updated successfully"), n();
2704
+ te.success((H == null ? void 0 : H.name) + " updated successfully"), n();
2704
2705
  }
2705
2706
  }
2706
2707
  );
2707
2708
  return;
2708
2709
  } else
2709
- o(K, {
2710
- onSuccess: (re) => {
2711
- console.log("response", re), n(), a(re.page.id, s);
2710
+ o(V, {
2711
+ onSuccess: (se) => {
2712
+ console.log("response", se), n(), a(se.page.id, s);
2712
2713
  }
2713
2714
  });
2714
2715
  return;
@@ -2718,10 +2719,10 @@ function co({
2718
2719
  y("Child page slug is required");
2719
2720
  return;
2720
2721
  }
2721
- const K = l == null ? void 0 : l.find(
2722
- (ve) => ve.id === T
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}/`)))) {
2722
+ const V = l == null ? void 0 : l.find(
2723
+ (be) => be.id === T
2724
+ ), se = (V == null ? void 0 : V.slug) || "", J = se === "/" ? `/${G}` : `${se}/${G}`;
2725
+ if (Object.keys(He).some((be) => J === `/${be}` || (J == null ? void 0 : J.startsWith(`/${be}/`)))) {
2725
2726
  y(
2726
2727
  "Slugs cannot start with a language code for primary page"
2727
2728
  );
@@ -2729,13 +2730,13 @@ function co({
2729
2730
  }
2730
2731
  const Q = {
2731
2732
  pageType: v,
2732
- name: O,
2733
- slug: Z.replace(/\/$/, ""),
2733
+ name: R,
2734
+ slug: J.replace(/\/$/, ""),
2734
2735
  // remove trailing slashes
2735
2736
  parent: T,
2736
2737
  dynamic: B,
2737
2738
  hasSlug: !0,
2738
- template: F || void 0
2739
+ template: ie || void 0
2739
2740
  };
2740
2741
  if (i) {
2741
2742
  d(
@@ -2749,20 +2750,20 @@ function co({
2749
2750
  return;
2750
2751
  }
2751
2752
  o(Q, {
2752
- onSuccess: (ve) => {
2753
- console.log("response", ve), n(), a(ve.page.id, s);
2753
+ onSuccess: (be) => {
2754
+ console.log("response", be), n(), a(be.page.id, s);
2754
2755
  }
2755
2756
  });
2756
2757
  } else {
2757
- const K = {
2758
+ const V = {
2758
2759
  pageType: v,
2759
- name: O,
2760
+ name: R,
2760
2761
  slug: G === "" ? "/" : `/${G.replace(/\/$/, "")}`,
2761
- template: F || void 0
2762
+ template: ie || void 0
2762
2763
  };
2763
2764
  if (i) {
2764
2765
  d(
2765
- { id: e == null ? void 0 : e.id, ...K },
2766
+ { id: e == null ? void 0 : e.id, ...V },
2766
2767
  {
2767
2768
  onSuccess: () => {
2768
2769
  te.success("Page updated successfully"), n();
@@ -2771,16 +2772,16 @@ function co({
2771
2772
  );
2772
2773
  return;
2773
2774
  }
2774
- o(K, {
2775
+ o(V, {
2775
2776
  onSuccess: () => {
2776
2777
  n();
2777
2778
  }
2778
2779
  });
2779
2780
  }
2780
2781
  };
2781
- return W != null && W.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: j, className: "w-full max-w-md mx-auto space-y-4", children: [
2782
+ return H != null && H.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: M, className: "w-full max-w-md mx-auto space-y-4", children: [
2782
2783
  /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2783
- /* @__PURE__ */ r(ae, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
2784
+ /* @__PURE__ */ r(re, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
2784
2785
  /* @__PURE__ */ r(
2785
2786
  "select",
2786
2787
  {
@@ -2789,7 +2790,7 @@ function co({
2789
2790
  disabled: i && !E,
2790
2791
  onChange: (b) => g(b.target.value),
2791
2792
  className: `w-full rounded-md border border-gray-300 px-3 py-2 ${i && !E ? "cursor-not-allowed text-gray-500" : ""}`,
2792
- children: i ? k ? /* @__PURE__ */ r("optgroup", { label: "Partials", children: t.filter((b) => b.hasSlug === !1).map((b) => /* @__PURE__ */ r("option", { value: b.key, children: b.name }, b.key)) }) : /* @__PURE__ */ r("optgroup", { label: "Pages", children: t.filter((b) => b.hasSlug !== !1).map((b) => /* @__PURE__ */ r("option", { value: b.key, children: b.name }, b.key)) }) : /* @__PURE__ */ u(Ee, { children: [
2793
+ children: i ? L ? /* @__PURE__ */ r("optgroup", { label: "Partials", children: t.filter((b) => b.hasSlug === !1).map((b) => /* @__PURE__ */ r("option", { value: b.key, children: b.name }, b.key)) }) : /* @__PURE__ */ r("optgroup", { label: "Pages", children: t.filter((b) => b.hasSlug !== !1).map((b) => /* @__PURE__ */ r("option", { value: b.key, children: b.name }, b.key)) }) : /* @__PURE__ */ u(we, { children: [
2793
2794
  /* @__PURE__ */ r("optgroup", { label: "Pages", children: t.filter((b) => b.hasSlug !== !1).map((b) => /* @__PURE__ */ r("option", { value: b.key, children: b.name }, b.key)) }),
2794
2795
  /* @__PURE__ */ r("optgroup", { label: "Partials", children: t.filter((b) => b.hasSlug === !1).map((b) => /* @__PURE__ */ r("option", { value: b.key, children: b.name }, b.key)) })
2795
2796
  ] })
@@ -2819,15 +2820,15 @@ function co({
2819
2820
  ] })
2820
2821
  ] })
2821
2822
  ] }),
2822
- !i && (W == null ? void 0 : W.hasSlug) && Te.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2823
- /* @__PURE__ */ r(ae, { className: "text-sm mb-1 block", children: "Template" }),
2823
+ !i && (H == null ? void 0 : H.hasSlug) && le.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2824
+ /* @__PURE__ */ r(re, { className: "text-sm mb-1 block", children: "Template" }),
2824
2825
  /* @__PURE__ */ r(
2825
2826
  ao,
2826
2827
  {
2827
- templates: Te,
2828
- selectedTemplateId: F,
2829
- onSelectTemplate: R,
2830
- isLoading: Y
2828
+ templates: le,
2829
+ selectedTemplateId: ie,
2830
+ onSelectTemplate: U,
2831
+ isLoading: $
2831
2832
  }
2832
2833
  )
2833
2834
  ] }),
@@ -2840,19 +2841,19 @@ function co({
2840
2841
  }
2841
2842
  ),
2842
2843
  /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2843
- /* @__PURE__ */ r(ae, { htmlFor: "name", className: "text-sm", children: "Name" }),
2844
+ /* @__PURE__ */ r(re, { htmlFor: "name", className: "text-sm", children: "Name" }),
2844
2845
  /* @__PURE__ */ r(
2845
- we,
2846
+ Ne,
2846
2847
  {
2847
2848
  id: "name",
2848
- value: O,
2849
- onChange: (b) => X(b.target.value),
2849
+ value: R,
2850
+ onChange: (b) => Z(b.target.value),
2850
2851
  required: !0,
2851
2852
  "aria-required": "true"
2852
2853
  }
2853
2854
  )
2854
2855
  ] }),
2855
- (W == null ? void 0 : W.dynamicSegments) && T && T !== "none" && /* @__PURE__ */ u("div", { className: "space-y-2", children: [
2856
+ (H == null ? void 0 : H.dynamicSegments) && T && T !== "none" && /* @__PURE__ */ u("div", { className: "space-y-2", children: [
2856
2857
  /* @__PURE__ */ u("div", { className: "flex items-center space-x-2", children: [
2857
2858
  /* @__PURE__ */ r(
2858
2859
  "input",
@@ -2864,35 +2865,35 @@ function co({
2864
2865
  className: "rounded border-gray-300"
2865
2866
  }
2866
2867
  ),
2867
- /* @__PURE__ */ r(ae, { htmlFor: "useDynamicSlug", className: "text-sm", children: "Use Dynamic Slug" })
2868
+ /* @__PURE__ */ r(re, { htmlFor: "useDynamicSlug", className: "text-sm", children: "Use Dynamic Slug" })
2868
2869
  ] }),
2869
2870
  B && /* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: [
2870
2871
  "Pages will use pattern: ",
2871
- W == null ? void 0 : W.dynamicSlug
2872
+ H == null ? void 0 : H.dynamicSlug
2872
2873
  ] })
2873
2874
  ] }),
2874
- (!(W != null && W.dynamicSegments) || !B) && /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2875
- /* @__PURE__ */ r(ae, { htmlFor: "slug", className: "text-sm", children: "Slug" }),
2875
+ (!(H != null && H.dynamicSegments) || !B) && /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2876
+ /* @__PURE__ */ r(re, { htmlFor: "slug", className: "text-sm", children: "Slug" }),
2876
2877
  /* @__PURE__ */ r(
2877
2878
  ro,
2878
2879
  {
2879
2880
  value: G,
2880
- onChange: ge,
2881
+ onChange: ve,
2881
2882
  placeholder: T && T !== "none" ? "Enter page slug" : v === "page" ? "Leave empty for home page" : "Required - e.g. your-slug",
2882
- parentSlug: T && T !== "none" ? (U = l == null ? void 0 : l.find((b) => b.id === T)) == null ? void 0 : U.slug : void 0
2883
+ parentSlug: T && T !== "none" ? (O = l == null ? void 0 : l.find((b) => b.id === T)) == null ? void 0 : O.slug : void 0
2883
2884
  }
2884
2885
  ),
2885
2886
  f && /* @__PURE__ */ r("p", { className: "text-xs text-red-500", children: f })
2886
2887
  ] }),
2887
- /* @__PURE__ */ r(P, { disabled: xe, type: "submit", className: "w-full", children: i ? xe ? "Updating..." : "Update page" : xe ? "Creating..." : "Create Page" })
2888
+ /* @__PURE__ */ r(P, { disabled: ge, type: "submit", className: "w-full", children: i ? ge ? "Updating..." : "Update page" : ge ? "Creating..." : "Create Page" })
2888
2889
  ] }) : /* @__PURE__ */ u(
2889
2890
  "form",
2890
2891
  {
2891
- onSubmit: j,
2892
+ onSubmit: M,
2892
2893
  className: "w-full max-w-md mx-auto space-y-4",
2893
2894
  children: [
2894
2895
  /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2895
- /* @__PURE__ */ r(ae, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
2896
+ /* @__PURE__ */ r(re, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
2896
2897
  /* @__PURE__ */ r(
2897
2898
  "select",
2898
2899
  {
@@ -2930,19 +2931,19 @@ function co({
2930
2931
  /* @__PURE__ */ r("p", { className: "text-xs text-gray-500", children: (z = t.find((b) => b.key === v)) == null ? void 0 : z.helpText })
2931
2932
  ] }),
2932
2933
  /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2933
- /* @__PURE__ */ r(ae, { htmlFor: "name", className: "text-sm", children: "Name" }),
2934
+ /* @__PURE__ */ r(re, { htmlFor: "name", className: "text-sm", children: "Name" }),
2934
2935
  /* @__PURE__ */ r(
2935
- we,
2936
+ Ne,
2936
2937
  {
2937
2938
  id: "name",
2938
- value: O,
2939
- onChange: (b) => X(b.target.value),
2939
+ value: R,
2940
+ onChange: (b) => Z(b.target.value),
2940
2941
  required: !0,
2941
2942
  "aria-required": "true"
2942
2943
  }
2943
2944
  )
2944
2945
  ] }),
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) })
2946
+ /* @__PURE__ */ r(P, { disabled: ge, type: "submit", className: "w-full", children: i ? ge ? "Updating..." : "Update " + (H == null ? void 0 : H.name) : ge ? "Creating..." : "Create " + (H == null ? void 0 : H.name) })
2946
2947
  ]
2947
2948
  }
2948
2949
  );
@@ -2977,10 +2978,10 @@ const uo = ({
2977
2978
  }) => {
2978
2979
  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(
2979
2980
  (_) => _.key === e.pageType
2980
- ), p = (v == null ? void 0 : v.name) || qt(e.pageType), A = _e(
2981
+ ), p = (v == null ? void 0 : v.name) || qt(e.pageType), A = Pe(
2981
2982
  (_) => {
2982
- var k;
2983
- const w = (k = _.target.files) == null ? void 0 : k[0];
2983
+ var L;
2984
+ const w = (L = _.target.files) == null ? void 0 : L[0];
2984
2985
  if (w) {
2985
2986
  if (w.size > ho) {
2986
2987
  te.error("File too large", {
@@ -3049,9 +3050,9 @@ const uo = ({
3049
3050
  ] })
3050
3051
  ] }),
3051
3052
  /* @__PURE__ */ u("div", { children: [
3052
- /* @__PURE__ */ r(ae, { htmlFor: "description", className: "text-xs font-medium", children: "Description (Optional)" }),
3053
+ /* @__PURE__ */ r(re, { htmlFor: "description", className: "text-xs font-medium", children: "Description (Optional)" }),
3053
3054
  /* @__PURE__ */ r(
3054
- Rt,
3055
+ Ot,
3055
3056
  {
3056
3057
  id: "description",
3057
3058
  placeholder: "Describe this template's purpose",
@@ -3062,11 +3063,11 @@ const uo = ({
3062
3063
  )
3063
3064
  ] }),
3064
3065
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
3065
- /* @__PURE__ */ r(ae, { htmlFor: "previewImage", className: "text-xs font-medium", children: "Preview Image (Optional)" }),
3066
+ /* @__PURE__ */ r(re, { htmlFor: "previewImage", className: "text-xs font-medium", children: "Preview Image (Optional)" }),
3066
3067
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
3067
3068
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
3068
3069
  /* @__PURE__ */ r(
3069
- we,
3070
+ Ne,
3070
3071
  {
3071
3072
  type: "file",
3072
3073
  id: "previewImage",
@@ -3186,17 +3187,17 @@ const uo = ({
3186
3187
  setMarkAsTemplate: o,
3187
3188
  setUnmarkAsTemplate: c
3188
3189
  }) => {
3189
- const d = Vr(), { data: h } = De(), { hasPermission: f } = Lt(), y = J(
3190
+ const d = Vr(), { data: h } = De(), { hasPermission: f } = Dt(), y = X(
3190
3191
  () => ye(h, { key: t.pageType }),
3191
3192
  [h, t.pageType]
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(
3193
+ ), v = W(t, "slug", "").replace(e, "") || "/", p = !f(me.EDIT_PAGE) && !f(me.DELETE_PAGE) && !f(me.UNPUBLISH_PAGE), A = X(() => !!t.isTemplate, [t.isTemplate]), E = X(
3193
3194
  () => !!(y != null && y.hasSlug),
3194
3195
  [y == null ? void 0 : y.hasSlug]
3195
3196
  );
3196
3197
  return /* @__PURE__ */ u(
3197
3198
  "div",
3198
3199
  {
3199
- onClick: () => d($(t, "id"), s),
3200
+ onClick: () => d(W(t, "id"), s),
3200
3201
  className: `rounded flex p-1.5 items-center justify-between leading-none duration-300 cursor-pointer px-3 py-1.5 ${n ? "bg-gray-200" : "hover:bg-gray-100"}`,
3201
3202
  children: [
3202
3203
  /* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
@@ -3269,7 +3270,7 @@ const uo = ({
3269
3270
  },
3270
3271
  children: [
3271
3272
  /* @__PURE__ */ r(_r, { className: "size-3" }),
3272
- H.UNPUBLISH
3273
+ j.UNPUBLISH
3273
3274
  ]
3274
3275
  }
3275
3276
  ),
@@ -3282,11 +3283,11 @@ const uo = ({
3282
3283
  },
3283
3284
  children: [
3284
3285
  /* @__PURE__ */ r(Es, { className: "size-3" }),
3285
- H.DELETE
3286
+ j.DELETE
3286
3287
  ]
3287
3288
  }
3288
3289
  ),
3289
- f(me.MARK_AS_TEMPLATE) && E && /* @__PURE__ */ r(Ee, { children: A ? /* @__PURE__ */ u(
3290
+ f(me.MARK_AS_TEMPLATE) && E && /* @__PURE__ */ r(we, { children: A ? /* @__PURE__ */ u(
3290
3291
  Ge,
3291
3292
  {
3292
3293
  className: "flex items-center gap-2 cursor-pointer",
@@ -3294,8 +3295,8 @@ const uo = ({
3294
3295
  C.stopPropagation(), c(t);
3295
3296
  },
3296
3297
  children: [
3297
- /* @__PURE__ */ r(Os, { className: "size-3" }),
3298
- H.UNMARK_AS_TEMPLATE
3298
+ /* @__PURE__ */ r(Rs, { className: "size-3" }),
3299
+ j.UNMARK_AS_TEMPLATE
3299
3300
  ]
3300
3301
  }
3301
3302
  ) : /* @__PURE__ */ u(
@@ -3306,8 +3307,8 @@ const uo = ({
3306
3307
  C.stopPropagation(), o(t);
3307
3308
  },
3308
3309
  children: [
3309
- /* @__PURE__ */ r(Os, { className: "size-3" }),
3310
- H.MARK_AS_TEMPLATE
3310
+ /* @__PURE__ */ r(Rs, { className: "size-3" }),
3311
+ j.MARK_AS_TEMPLATE
3311
3312
  ]
3312
3313
  }
3313
3314
  ) })
@@ -3317,62 +3318,62 @@ const uo = ({
3317
3318
  }
3318
3319
  );
3319
3320
  }, go = ({ close: e }) => {
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(
3321
+ 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 } = Dt(), [_, w] = Oe(), L = _.get("page"), { data: T } = De(), ne = Pe(
3321
3322
  (S) => {
3322
3323
  var G;
3323
3324
  return (G = ye(T, { key: S })) == null ? void 0 : G.hasSlug;
3324
3325
  },
3325
3326
  [T]
3326
3327
  );
3327
- Ne(() => {
3328
+ xe(() => {
3328
3329
  if (!de(E)) return;
3329
3330
  const S = sessionStorage.getItem("pageTypeFilter") || "all";
3330
3331
  !de(T) && S && (ye(T, { key: S }) ? C(S) : C("all"));
3331
3332
  }, [T, E]);
3332
- const O = (S) => {
3333
+ const R = (S) => {
3333
3334
  C(S), sessionStorage.setItem("pageTypeFilter", S);
3334
- }, X = _e(
3335
+ }, Z = Pe(
3335
3336
  (S) => {
3336
- const ge = new URLSearchParams(window.location.search).get("lang"), F = new URLSearchParams({ page: S });
3337
- ge && F.set("lang", ge), window.history.pushState({}, "", `?${F.toString()}`), w(F), window.dispatchEvent(new PopStateEvent("popstate")), e();
3337
+ const ve = new URLSearchParams(window.location.search).get("lang"), ie = new URLSearchParams({ page: S });
3338
+ ve && ie.set("lang", ve), window.history.pushState({}, "", `?${ie.toString()}`), w(ie), window.dispatchEvent(new PopStateEvent("popstate")), e();
3338
3339
  },
3339
3340
  [w, e]
3340
3341
  );
3341
- Ne(() => {
3342
- if (k && !A) {
3343
- const S = ye(p, { id: k });
3342
+ xe(() => {
3343
+ if (L && !A) {
3344
+ const S = ye(p, { id: L });
3344
3345
  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")));
3345
3346
  }
3346
- }, [p, k, A, w]);
3347
- const B = J(() => {
3347
+ }, [p, L, A, w]);
3348
+ const B = X(() => {
3348
3349
  const S = Nn(
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)))
3350
+ Se(p, ($) => de(n) ? !0 : Ht(Ut($ == null ? void 0 : $.name), Ut(n)) || Ht(Ut($ == null ? void 0 : $.slug), Ut(n)))
3350
3351
  );
3351
3352
  if (E !== "all")
3352
- return Nn(be(S, { pageType: E }));
3353
+ return Nn(Se(S, { pageType: E }));
3353
3354
  const G = /* @__PURE__ */ new Map();
3354
- S.forEach((Y) => {
3355
- G.set(Y.id, { ...Y, children: [] });
3355
+ S.forEach(($) => {
3356
+ G.set($.id, { ...$, children: [] });
3356
3357
  });
3357
- const ge = [], F = [];
3358
- G.forEach((Y) => {
3359
- if (Y.parent) {
3360
- const xe = G.get(Y.parent);
3361
- xe ? xe.children.push(Y) : ge.push(Y);
3358
+ const ve = [], ie = [];
3359
+ G.forEach(($) => {
3360
+ if ($.parent) {
3361
+ const ge = G.get($.parent);
3362
+ ge ? ge.children.push($) : ve.push($);
3362
3363
  } else
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));
3364
+ ie.push($);
3365
+ }), ve.sort(($, ge) => $.name.localeCompare(ge.name)), ve.forEach(($) => {
3366
+ $.children.sort((ge, H) => ge.name.localeCompare(H.name));
3366
3367
  });
3367
- const he = be(
3368
- F,
3369
- (Y) => !se(Y.pageType)
3370
- ), Te = be(
3371
- F,
3372
- (Y) => se(Y.pageType)
3373
- ).sort((Y, xe) => Y.name.localeCompare(xe.name));
3374
- return Nn([...Te, ...he, ...ge]);
3375
- }, [p, se, n, E]);
3368
+ const Ee = Se(
3369
+ ie,
3370
+ ($) => !ne($.pageType)
3371
+ ), le = Se(
3372
+ ie,
3373
+ ($) => ne($.pageType)
3374
+ ).sort(($, ge) => $.name.localeCompare(ge.name));
3375
+ return Nn([...le, ...Ee, ...ve]);
3376
+ }, [p, ne, n, E]);
3376
3377
  return /* @__PURE__ */ u("div", { className: "flex flex-col justify-between h-full", children: [
3377
3378
  /* @__PURE__ */ u("div", { className: "flex flex-col h-full space-y-6", children: [
3378
3379
  /* @__PURE__ */ u("div", { className: "relative flex item-center gap-x-4", children: [
@@ -3384,7 +3385,7 @@ const uo = ({
3384
3385
  }
3385
3386
  ),
3386
3387
  /* @__PURE__ */ r(
3387
- we,
3388
+ Ne,
3388
3389
  {
3389
3390
  placeholder: "Search pages...",
3390
3391
  className: "text-xs font-medium leading-none text-gray-700 pl-9 pr-24 placeholder:text-gray-400",
@@ -3392,7 +3393,7 @@ const uo = ({
3392
3393
  onChange: (S) => s(S.target.value)
3393
3394
  }
3394
3395
  ),
3395
- !de(E) && /* @__PURE__ */ u(vi, { value: E, onValueChange: O, children: [
3396
+ !de(E) && /* @__PURE__ */ u(vi, { value: E, onValueChange: R, children: [
3396
3397
  /* @__PURE__ */ r(
3397
3398
  Ei,
3398
3399
  {
@@ -3403,42 +3404,42 @@ const uo = ({
3403
3404
  /* @__PURE__ */ u(wi, { align: "end", children: [
3404
3405
  /* @__PURE__ */ r(Fn, { value: "all", children: "All" }, "all"),
3405
3406
  !de(
3406
- be(T, (S) => S.hasSlug)
3407
- ) && /* @__PURE__ */ u(Ee, { children: [
3407
+ Se(T, (S) => S.hasSlug)
3408
+ ) && /* @__PURE__ */ u(we, { children: [
3408
3409
  /* @__PURE__ */ r("div", { className: "px-2 py-1.5 text-xs font-semibold text-gray-500 mt-2 border-t pt-2", children: "Pages" }),
3409
3410
  Be(
3410
3411
  [
3411
- ...be(T, (S) => S.hasSlug)
3412
+ ...Se(T, (S) => S.hasSlug)
3412
3413
  ].sort(
3413
- (S, G) => $(S, "name", "").localeCompare($(G, "name", ""))
3414
+ (S, G) => W(S, "name", "").localeCompare(W(G, "name", ""))
3414
3415
  ),
3415
3416
  (S) => /* @__PURE__ */ r(
3416
3417
  Fn,
3417
3418
  {
3418
- value: $(S, "key"),
3419
- children: $(S, "name")
3419
+ value: W(S, "key"),
3420
+ children: W(S, "name")
3420
3421
  },
3421
- $(S, "key")
3422
+ W(S, "key")
3422
3423
  )
3423
3424
  )
3424
3425
  ] }),
3425
3426
  !de(
3426
- be(T, (S) => !S.hasSlug)
3427
- ) && /* @__PURE__ */ u(Ee, { children: [
3427
+ Se(T, (S) => !S.hasSlug)
3428
+ ) && /* @__PURE__ */ u(we, { children: [
3428
3429
  /* @__PURE__ */ r("div", { className: "px-2 py-1.5 text-xs font-semibold text-gray-500 mt-2 border-t pt-2", children: "Partials" }),
3429
3430
  Be(
3430
3431
  [
3431
- ...be(T, (S) => !S.hasSlug)
3432
+ ...Se(T, (S) => !S.hasSlug)
3432
3433
  ].sort(
3433
- (S, G) => $(S, "name", "").localeCompare($(G, "name", ""))
3434
+ (S, G) => W(S, "name", "").localeCompare(W(G, "name", ""))
3434
3435
  ),
3435
3436
  (S) => /* @__PURE__ */ r(
3436
3437
  Fn,
3437
3438
  {
3438
- value: $(S, "key"),
3439
- children: $(S, "name")
3439
+ value: W(S, "key"),
3440
+ children: W(S, "name")
3440
3441
  },
3441
- $(S, "key")
3442
+ W(S, "key")
3442
3443
  )
3443
3444
  )
3444
3445
  ] })
@@ -3464,7 +3465,7 @@ const uo = ({
3464
3465
  setAddEditPage: d,
3465
3466
  setMarkAsTemplate: f,
3466
3467
  setUnmarkAsTemplate: v,
3467
- active: k === S.id,
3468
+ active: L === S.id,
3468
3469
  page: S
3469
3470
  },
3470
3471
  S.id || `item-${S.key}`
@@ -3478,12 +3479,12 @@ const uo = ({
3478
3479
  setAddEditPage: d,
3479
3480
  setMarkAsTemplate: f,
3480
3481
  setUnmarkAsTemplate: v,
3481
- active: k === S.id,
3482
+ active: L === S.id,
3482
3483
  page: S
3483
3484
  }
3484
3485
  ),
3485
- /* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: Be($(S, "children", []), (G) => {
3486
- const ge = k === $(G, "id");
3486
+ /* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: Be(W(S, "children", []), (G) => {
3487
+ const ve = L === W(G, "id");
3487
3488
  return /* @__PURE__ */ r(
3488
3489
  Hn,
3489
3490
  {
@@ -3494,7 +3495,7 @@ const uo = ({
3494
3495
  setAddEditPage: d,
3495
3496
  setMarkAsTemplate: f,
3496
3497
  setUnmarkAsTemplate: v,
3497
- active: ge,
3498
+ active: ve,
3498
3499
  page: G
3499
3500
  },
3500
3501
  G.id || `child-${G.key}`
@@ -3523,7 +3524,7 @@ const uo = ({
3523
3524
  uo,
3524
3525
  {
3525
3526
  closePanel: e,
3526
- editPage: X,
3527
+ editPage: Z,
3527
3528
  addEditPage: c,
3528
3529
  setAddEditPage: d
3529
3530
  }
@@ -3555,8 +3556,8 @@ const uo = ({
3555
3556
  const e = rt("logo", null);
3556
3557
  return e ? /* @__PURE__ */ r("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: nr.createElement(e, {}) }) : null;
3557
3558
  }, yo = () => {
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;
3559
- return /* @__PURE__ */ u(Ee, { children: [
3559
+ const [e] = Oe(), t = e.get("page"), { data: n, isFetching: s } = Re(), [a, i] = I(!1), { savePage: l } = os(), o = !!t && !de(n), c = !t || !s && de(n) || a;
3560
+ return /* @__PURE__ */ u(we, { children: [
3560
3561
  /* @__PURE__ */ u(
3561
3562
  P,
3562
3563
  {
@@ -3569,7 +3570,7 @@ const uo = ({
3569
3570
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Wi, { className: "h-4 w-4" }) }),
3570
3571
  /* @__PURE__ */ u("span", { className: "truncate leading-tight flex items-center max-w-[200px]", children: [
3571
3572
  /* @__PURE__ */ r("span", { className: "text-slate-600 pr-1 font-light", children: "Editing:" }),
3572
- s ? /* @__PURE__ */ r(Pr, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : qt($(n, "name")) ?? ""
3573
+ s ? /* @__PURE__ */ r(Pr, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : qt(W(n, "name")) ?? ""
3573
3574
  ] })
3574
3575
  ]
3575
3576
  },
@@ -3612,18 +3613,18 @@ const uo = ({
3612
3613
  )
3613
3614
  ] });
3614
3615
  }, vo = () => {
3615
- const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = dt(), a = de(n) ? e : n, [, i] = Re();
3616
- Ne(() => {
3616
+ const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = dt(), a = de(n) ? e : n, [, i] = Oe();
3617
+ xe(() => {
3617
3618
  const p = new URLSearchParams(window.location.search), A = p.get("lang");
3618
3619
  A && (t.includes(A) ? s(A) : (p.delete("lang"), i(p), s("")));
3619
3620
  }, [t, i, s]);
3620
- const [l, o] = I(null), { data: c } = Oe(), { data: d } = Dt(), { data: h, isFetching: f } = un(), y = J(() => {
3621
+ const [l, o] = I(null), { data: c } = Re(), { data: d } = mt(), { data: h, isFetching: f } = un(), y = X(() => {
3621
3622
  const p = Nn(
3622
- Be($(d, "languages"), (A) => {
3623
+ Be(W(d, "languages"), (A) => {
3623
3624
  const E = ye(h, { lang: A });
3624
3625
  return {
3625
3626
  key: A,
3626
- value: $(He, A, A),
3627
+ value: W(He, A, A),
3627
3628
  isLangPageAdded: !!E
3628
3629
  };
3629
3630
  })
@@ -3631,7 +3632,7 @@ const uo = ({
3631
3632
  return [
3632
3633
  {
3633
3634
  key: e,
3634
- value: $(He, e),
3635
+ value: W(He, e),
3635
3636
  isLangPageAdded: !0
3636
3637
  },
3637
3638
  ...p
@@ -3643,11 +3644,11 @@ const uo = ({
3643
3644
  const E = A.toString(), C = `${window.location.pathname}${E ? `?${E}` : ""}`;
3644
3645
  window.history.pushState({}, "", C), i(A), window.dispatchEvent(new PopStateEvent("popstate"));
3645
3646
  };
3646
- return de(t) || f ? null : /* @__PURE__ */ u(Ee, { children: [
3647
+ return de(t) || f ? null : /* @__PURE__ */ u(we, { children: [
3647
3648
  /* @__PURE__ */ u(an, { children: [
3648
3649
  /* @__PURE__ */ r(ln, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ u(P, { variant: "ghost", size: "sm", className: "gap-2", children: [
3649
3650
  /* @__PURE__ */ r(Yi, { className: "w-4 h-4" }),
3650
- $(He, a, a),
3651
+ W(He, a, a),
3651
3652
  /* @__PURE__ */ r(Ir, { className: "w-4 h-4" })
3652
3653
  ] }) }),
3653
3654
  /* @__PURE__ */ u(on, { className: "border-border space-y-1", children: [
@@ -3678,7 +3679,7 @@ const uo = ({
3678
3679
  p.value
3679
3680
  )
3680
3681
  ),
3681
- !de(y.filter((p) => !p.isLangPageAdded)) && /* @__PURE__ */ u(Ee, { children: [
3682
+ !de(y.filter((p) => !p.isLangPageAdded)) && /* @__PURE__ */ u(we, { children: [
3682
3683
  /* @__PURE__ */ r(Ni, {}),
3683
3684
  /* @__PURE__ */ u(
3684
3685
  P,
@@ -3722,11 +3723,11 @@ function Eo() {
3722
3723
  ] });
3723
3724
  }
3724
3725
  function bo(e) {
3725
- const t = ne(), n = ee();
3726
- return ke({
3727
- queryKey: [V, "revisions", e],
3726
+ const t = ee(), n = Y();
3727
+ return Ie({
3728
+ queryKey: [K, "revisions", e],
3728
3729
  queryFn: async () => await n(t, {
3729
- action: L.GET_PAGE_REVISIONS,
3730
+ action: k.GET_PAGE_REVISIONS,
3730
3731
  data: { pageId: e }
3731
3732
  }),
3732
3733
  enabled: !!e,
@@ -3735,37 +3736,37 @@ function bo(e) {
3735
3736
  });
3736
3737
  }
3737
3738
  const wo = () => {
3738
- const e = ne(), t = ee(), n = Ae();
3739
- return Pe({
3739
+ const e = ee(), t = Y(), n = Te();
3740
+ return Ce({
3740
3741
  mutationFn: async (s) => await t(e, {
3741
- action: L.DELETE_PAGE_REVISION,
3742
+ action: k.DELETE_PAGE_REVISION,
3742
3743
  data: { revisionId: s }
3743
3744
  }),
3744
3745
  onSuccess: () => {
3745
3746
  n.invalidateQueries({
3746
- queryKey: [V, "revisions"]
3747
+ queryKey: [K, "revisions"]
3747
3748
  });
3748
3749
  }
3749
3750
  });
3750
3751
  }, So = () => {
3751
- const e = ne(), t = ee(), n = Ae();
3752
- return Pe({
3752
+ const e = ee(), t = Y(), n = Te();
3753
+ return Ce({
3753
3754
  mutationFn: async ({
3754
3755
  revisionId: s,
3755
3756
  discardCurrent: a
3756
3757
  }) => await t(e, {
3757
- action: L.RESTORE_PAGE_REVISION,
3758
+ action: k.RESTORE_PAGE_REVISION,
3758
3759
  data: { revisionId: s, discardCurrent: a }
3759
3760
  }),
3760
3761
  onSuccess: () => {
3761
3762
  n.invalidateQueries({
3762
- queryKey: [V, "revisions"]
3763
+ queryKey: [K, "revisions"]
3763
3764
  });
3764
3765
  }
3765
3766
  });
3766
3767
  };
3767
3768
  function No() {
3768
- const { data: e } = Oe(), { saveState: t } = os(), [n] = Ns();
3769
+ const { data: e } = Re(), { saveState: t } = os(), [n] = Ns();
3769
3770
  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: [
3770
3771
  /* @__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" }) }) }),
3771
3772
  /* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !de(n.lastSaved) && /* @__PURE__ */ u("span", { children: [
@@ -3788,18 +3789,18 @@ function No() {
3788
3789
  ] }) }) : null;
3789
3790
  }
3790
3791
  function Ao() {
3791
- const [e, t] = fe.useState(!1), [n, s] = fe.useState(null), [a, i] = fe.useState(!1), [l, o] = fe.useState(!1), { data: c } = Oe(), {
3792
+ const [e, t] = fe.useState(!1), [n, s] = fe.useState(null), [a, i] = fe.useState(!1), [l, o] = fe.useState(!1), { data: c } = Re(), {
3792
3793
  data: d,
3793
3794
  isFetching: h,
3794
3795
  error: f,
3795
3796
  refetch: y
3796
- } = bo(c == null ? void 0 : c.id), { mutate: v, isPending: p } = wo(), { mutate: A, isPending: E } = So(), C = Ae(), N = (T) => {
3797
+ } = bo(c == null ? void 0 : c.id), { mutate: v, isPending: p } = wo(), { mutate: A, isPending: E } = So(), C = Te(), N = (T) => {
3797
3798
  n && A(
3798
3799
  { revisionId: n.uid, discardCurrent: T },
3799
3800
  {
3800
3801
  onSuccess: () => {
3801
3802
  i(!1), s(null), C.invalidateQueries({
3802
- queryKey: [V, L.GET_DRAFT_PAGE]
3803
+ queryKey: [K, k.GET_DRAFT_PAGE]
3803
3804
  });
3804
3805
  }
3805
3806
  }
@@ -3808,16 +3809,16 @@ function Ao() {
3808
3809
  s(T), i(!0);
3809
3810
  }, w = (T) => {
3810
3811
  s(T), o(!0);
3811
- }, k = () => {
3812
+ }, L = () => {
3812
3813
  n && v(n.uid, {
3813
3814
  onSuccess: () => {
3814
3815
  o(!1), s(null);
3815
3816
  }
3816
3817
  });
3817
3818
  };
3818
- return Ne(() => {
3819
+ return xe(() => {
3819
3820
  e && y();
3820
- }, [e, y]), /* @__PURE__ */ u(Ee, { children: [
3821
+ }, [e, y]), /* @__PURE__ */ u(we, { children: [
3821
3822
  /* @__PURE__ */ r(Sr, { children: /* @__PURE__ */ u(fs, { children: [
3822
3823
  /* @__PURE__ */ u(vr, { open: e, onOpenChange: t, children: [
3823
3824
  /* @__PURE__ */ r(Ai, { asChild: !0, children: /* @__PURE__ */ r(gs, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
@@ -3875,7 +3876,7 @@ function Ao() {
3875
3876
  open: l,
3876
3877
  onOpenChange: o,
3877
3878
  revision: n,
3878
- onDelete: k,
3879
+ onDelete: L,
3879
3880
  isDeleting: p
3880
3881
  }
3881
3882
  )
@@ -3955,7 +3956,7 @@ function Co({
3955
3956
  /* @__PURE__ */ r(kr, { className: "mr-2 h-4 w-4" }),
3956
3957
  /* @__PURE__ */ r("span", { children: "Restore this version" })
3957
3958
  ] }) }),
3958
- /* @__PURE__ */ r(Me, { permission: me.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ u(Ee, { children: [
3959
+ /* @__PURE__ */ r(Me, { permission: me.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ u(we, { children: [
3959
3960
  /* @__PURE__ */ r(Ti, {}),
3960
3961
  /* @__PURE__ */ u(
3961
3962
  Ge,
@@ -4010,10 +4011,10 @@ function _o({
4010
4011
  className: "sm:flex-1",
4011
4012
  onClick: () => s(!1),
4012
4013
  disabled: a,
4013
- children: a ? /* @__PURE__ */ u(Ee, { children: [
4014
+ children: a ? /* @__PURE__ */ u(we, { children: [
4014
4015
  /* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
4015
4016
  "Saving as draft..."
4016
- ] }) : /* @__PURE__ */ u(Ee, { children: [
4017
+ ] }) : /* @__PURE__ */ u(we, { children: [
4017
4018
  /* @__PURE__ */ r(Ji, { className: "mr-2 h-4 w-4" }),
4018
4019
  "Save as draft"
4019
4020
  ] })
@@ -4026,10 +4027,10 @@ function _o({
4026
4027
  className: "sm:flex-1",
4027
4028
  onClick: () => s(!0),
4028
4029
  disabled: a,
4029
- children: a ? /* @__PURE__ */ u(Ee, { children: [
4030
+ children: a ? /* @__PURE__ */ u(we, { children: [
4030
4031
  /* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
4031
4032
  "Discarding current..."
4032
- ] }) : /* @__PURE__ */ u(Ee, { children: [
4033
+ ] }) : /* @__PURE__ */ u(we, { children: [
4033
4034
  /* @__PURE__ */ r(kr, { className: "mr-2 h-4 w-4" }),
4034
4035
  "Discard current"
4035
4036
  ] })
@@ -4088,10 +4089,10 @@ function Po({
4088
4089
  className: "sm:flex-1",
4089
4090
  onClick: s,
4090
4091
  disabled: a,
4091
- children: a ? /* @__PURE__ */ u(Ee, { children: [
4092
+ children: a ? /* @__PURE__ */ u(we, { children: [
4092
4093
  /* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
4093
4094
  "Deleting..."
4094
- ] }) : /* @__PURE__ */ u(Ee, { children: [
4095
+ ] }) : /* @__PURE__ */ u(we, { children: [
4095
4096
  /* @__PURE__ */ r(Es, { className: "mr-2 h-4 w-4" }),
4096
4097
  "Delete Revision"
4097
4098
  ] })
@@ -4103,10 +4104,10 @@ function Po({
4103
4104
  ) : null;
4104
4105
  }
4105
4106
  const Io = () => {
4106
- const e = ne(), t = ee();
4107
- return ke({
4108
- queryKey: [V, L.GET_CHANGES],
4109
- queryFn: async () => t(e, { action: L.GET_CHANGES })
4107
+ const e = ee(), t = Y();
4108
+ return Ie({
4109
+ queryKey: [K, k.GET_CHANGES],
4110
+ queryFn: async () => t(e, { action: k.GET_CHANGES })
4110
4111
  });
4111
4112
  }, ko = ({ currentEditor: e }) => {
4112
4113
  const { data: t } = dn(e);
@@ -4116,34 +4117,34 @@ function Lo({
4116
4117
  showModal: e = !1,
4117
4118
  onClose: t = () => console.log("Cancelled")
4118
4119
  }) {
4119
- const [n, s] = I([]), { data: a, isFetching: i } = Io(), { data: l } = De(), o = _e(
4120
+ const [n, s] = I([]), { data: a, isFetching: i } = Io(), { data: l } = De(), o = Pe(
4120
4121
  (w) => {
4121
- var k;
4122
- return (k = ye(l, { key: w })) == null ? void 0 : k.hasSlug;
4122
+ var L;
4123
+ return (L = ye(l, { key: w })) == null ? void 0 : L.hasSlug;
4123
4124
  },
4124
4125
  [l]
4125
- ), c = J(
4126
- () => be(l, (w) => !o(w.key)).map(
4126
+ ), c = X(
4127
+ () => Se(l, (w) => !o(w.key)).map(
4127
4128
  (w) => w.key
4128
4129
  ),
4129
4130
  [o, l]
4130
- ), d = J(
4131
- () => be(a, (w) => !c.includes(w.pageType)),
4131
+ ), d = X(
4132
+ () => Se(a, (w) => !c.includes(w.pageType)),
4132
4133
  [a, c]
4133
- ), h = J(
4134
- () => be(a, (w) => c.includes(w.pageType)),
4134
+ ), h = X(
4135
+ () => Se(a, (w) => c.includes(w.pageType)),
4135
4136
  [a, c]
4136
- ), f = J(
4137
+ ), f = X(
4137
4138
  () => ye(a, { pageType: "theme", id: "THEME" }),
4138
4139
  [a]
4139
4140
  ), { mutate: y, isPending: v } = xs();
4140
- Ne(() => {
4141
- const w = Be(be(a, { online: !0 }), "id");
4141
+ xe(() => {
4142
+ const w = Be(Se(a, { online: !0 }), "id");
4142
4143
  f && w.push(f == null ? void 0 : f.id), s(w);
4143
4144
  }, [a, f]);
4144
4145
  const p = n.length === (a == null ? void 0 : a.length), A = (w) => {
4145
4146
  s(
4146
- (k) => Ht(k, w) ? be(k, (T) => T !== w) : Va(k, w)
4147
+ (L) => Ht(L, w) ? Se(L, (T) => T !== w) : Va(L, w)
4147
4148
  );
4148
4149
  }, E = () => {
4149
4150
  s(p ? [] : Be(a, "id"));
@@ -4158,19 +4159,19 @@ function Lo({
4158
4159
  );
4159
4160
  }, N = (w) => {
4160
4161
  if (w === "theme") return "Theme";
4161
- const k = ye(l, { key: w });
4162
- return k ? k == null ? void 0 : k.name : w;
4163
- }, _ = J(() => {
4162
+ const L = ye(l, { key: w });
4163
+ return L ? L == null ? void 0 : L.name : w;
4164
+ }, _ = X(() => {
4164
4165
  const w = [
4165
4166
  { label: "Updated", top: "pt-2" },
4166
- ...mn(be(d, { online: !0 }), "pageType"),
4167
- ...mn(be(h, { online: !0 }), "pageType")
4168
- ].filter((se) => se.pageType !== "theme"), k = [
4167
+ ...mn(Se(d, { online: !0 }), "pageType"),
4168
+ ...mn(Se(h, { online: !0 }), "pageType")
4169
+ ].filter((ne) => ne.pageType !== "theme"), L = [
4169
4170
  { label: "Offline", top: "pt-6" },
4170
- ...mn(be(d, { online: !1 }), "pageType"),
4171
- ...mn(be(h, { online: !1 }), "pageType")
4171
+ ...mn(Se(d, { online: !1 }), "pageType"),
4172
+ ...mn(Se(h, { online: !1 }), "pageType")
4172
4173
  ], T = f ? [{ label: "Theme", top: "pt-6" }, f] : [];
4173
- return [...w, ...T, ...k];
4174
+ return [...w, ...T, ...L];
4174
4175
  }, [d, h, f]);
4175
4176
  return /* @__PURE__ */ r(je, { open: e, onOpenChange: v ? () => {
4176
4177
  } : t, children: /* @__PURE__ */ u(Ke, { className: "max-w-4xl max-h-[80%] flex flex-col", children: [
@@ -4237,8 +4238,8 @@ function Lo({
4237
4238
  "input",
4238
4239
  {
4239
4240
  checked: Ht(n, w == null ? void 0 : w.id),
4240
- onClick: (k) => {
4241
- k.stopPropagation(), A(w == null ? void 0 : w.id);
4241
+ onClick: (L) => {
4242
+ L.stopPropagation(), A(w == null ? void 0 : w.id);
4242
4243
  },
4243
4244
  type: "checkbox",
4244
4245
  className: "rounded cursor-pointer focus:outline-none focus:ring-0"
@@ -4291,12 +4292,12 @@ function Lo({
4291
4292
  ] }) });
4292
4293
  }
4293
4294
  const Do = () => {
4294
- const e = ee(), t = ne();
4295
- return ke({
4296
- queryKey: [L.GET_WEBSITE_DATA],
4295
+ const e = Y(), t = ee();
4296
+ return Ie({
4297
+ queryKey: [k.GET_WEBSITE_DATA],
4297
4298
  staleTime: 1e3 * 60 * 5,
4298
4299
  queryFn: async () => e(t, {
4299
- action: L.GET_WEBSITE_DATA,
4300
+ action: k.GET_WEBSITE_DATA,
4300
4301
  data: { draft: !0 }
4301
4302
  })
4302
4303
  });
@@ -4331,20 +4332,20 @@ function zr({
4331
4332
  ] }) });
4332
4333
  }
4333
4334
  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(
4335
+ const { selectedLang: e } = dt(), t = rt("getPreviewUrl", async (h) => h), [n, s] = I(""), { data: a, isFetching: i } = Re(), { data: l } = un(), { data: o } = De(), c = X(
4335
4336
  () => {
4336
4337
  var h;
4337
4338
  return (h = l == null ? void 0 : l.find((f) => (f == null ? void 0 : f.lang) === e)) == null ? void 0 : h.slug;
4338
4339
  },
4339
4340
  [e, l]
4340
- ), d = _e(
4341
+ ), d = Pe(
4341
4342
  (h) => {
4342
4343
  var f;
4343
4344
  return (f = ye(o, { key: h })) == null ? void 0 : f.hasSlug;
4344
4345
  },
4345
4346
  [o]
4346
4347
  );
4347
- return Ne(() => {
4348
+ return xe(() => {
4348
4349
  (async () => {
4349
4350
  if (c && typeof t == "function") {
4350
4351
  const h = await t(c || "");
@@ -4352,15 +4353,15 @@ const Uo = () => {
4352
4353
  } else
4353
4354
  s("");
4354
4355
  })();
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: [
4356
+ }, [t, c]), !n || !d(a == null ? void 0 : a.pageType) || i ? null : /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("a", { href: n, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ u(P, { variant: "ghost", size: "sm", className: "gap-2", children: [
4356
4357
  /* @__PURE__ */ r(Dr, { className: "w-4 h-4" }),
4357
4358
  " ",
4358
- H.PREVIEW
4359
+ j.PREVIEW
4359
4360
  ] }) }) });
4360
- }, Ro = () => {
4361
+ }, Oo = () => {
4361
4362
  const [e, t] = ci();
4362
- return /* @__PURE__ */ u(Ee, { children: [
4363
- /* @__PURE__ */ r(zr, { content: H.THEME, children: /* @__PURE__ */ r(
4363
+ return /* @__PURE__ */ u(we, { children: [
4364
+ /* @__PURE__ */ r(zr, { content: j.THEME, children: /* @__PURE__ */ r(
4364
4365
  P,
4365
4366
  {
4366
4367
  variant: e === "theme" ? "outline" : "ghost",
@@ -4372,9 +4373,9 @@ const Uo = () => {
4372
4373
  ) }),
4373
4374
  /* @__PURE__ */ r("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
4374
4375
  ] });
4375
- }, Oo = () => {
4376
+ }, Ro = () => {
4376
4377
  const [e, t] = I(!1), { isLocked: n } = hn(), { savePage: s, saveState: a } = os();
4377
- Ne(() => {
4378
+ xe(() => {
4378
4379
  const h = (f) => {
4379
4380
  a === "UNSAVED" && (f.preventDefault(), f.returnValue = !1);
4380
4381
  };
@@ -4382,32 +4383,32 @@ const Uo = () => {
4382
4383
  window.removeEventListener("beforeunload", h);
4383
4384
  };
4384
4385
  }, [a]);
4385
- const i = _e(async () => {
4386
+ const i = Pe(async () => {
4386
4387
  t(!0), await s(!1);
4387
4388
  }, [s]);
4388
- Ne(() => {
4389
+ xe(() => {
4389
4390
  a === "SAVED" && t(!1);
4390
4391
  }, [a]);
4391
- const l = J(() => {
4392
+ const l = X(() => {
4392
4393
  if (a === "SAVED" || a === "UNSAVED") return a;
4393
4394
  if (a === "SAVING") return e ? a : "SAVED";
4394
- }, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: d } = J(() => {
4395
+ }, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: d } = X(() => {
4395
4396
  switch (l) {
4396
4397
  case "UNSAVED":
4397
4398
  return {
4398
- tooltipContent: H.SAVEDRAFT,
4399
+ tooltipContent: j.SAVEDRAFT,
4399
4400
  buttonIcon: /* @__PURE__ */ r(Lr, { className: "w-4 h-4" }),
4400
4401
  buttonClass: "flex items-center gap-x-1 leading-tight"
4401
4402
  };
4402
4403
  case "SAVING":
4403
4404
  return {
4404
- tooltipContent: H.SAVING,
4405
+ tooltipContent: j.SAVING,
4405
4406
  buttonIcon: /* @__PURE__ */ r(Pr, { className: "w-4 h-4 animate-spin" }),
4406
4407
  buttonClass: "flex items-center gap-x-1 leading-tight"
4407
4408
  };
4408
4409
  case "SAVED":
4409
4410
  return {
4410
- tooltipContent: H.SAVED,
4411
+ tooltipContent: j.SAVED,
4411
4412
  buttonIcon: /* @__PURE__ */ r(sl, { className: "w-4 h-4" }),
4412
4413
  buttonClass: "text-green-500 flex items-center gap-x-1 leading-tight"
4413
4414
  };
@@ -4428,15 +4429,15 @@ const Uo = () => {
4428
4429
  }
4429
4430
  );
4430
4431
  }, Bo = () => {
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(() => {
4432
+ const [e, t] = I(!1), [n, s] = I(!1), [a, i] = I(null), { data: l } = Re(), { mutate: o, isPending: c } = xs(), [d] = ui(), { buttonText: h, buttonClassName: f, isPublished: y } = X(() => {
4432
4433
  const p = l && (l == null ? void 0 : l.online);
4433
4434
  return {
4434
4435
  buttonClassName: p ? "hover:bg-green-600 bg-green-500" : "",
4435
4436
  isPublished: p,
4436
- buttonText: p ? H.PUBLISHED : H.PUBLISH
4437
+ buttonText: p ? j.PUBLISHED : j.PUBLISH
4437
4438
  };
4438
4439
  }, [l]);
4439
- return /* @__PURE__ */ u(Ee, { children: [
4440
+ return /* @__PURE__ */ u(we, { children: [
4440
4441
  /* @__PURE__ */ u("div", { className: "flex", children: [
4441
4442
  /* @__PURE__ */ u(
4442
4443
  P,
@@ -4494,7 +4495,7 @@ const Uo = () => {
4494
4495
  { onSuccess: () => Tn("TOP_RIGHT") }
4495
4496
  ),
4496
4497
  children: [
4497
- H.PUBLISH,
4498
+ j.PUBLISH,
4498
4499
  " page"
4499
4500
  ]
4500
4501
  }
@@ -4505,7 +4506,7 @@ const Uo = () => {
4505
4506
  onClick: () => t(!0),
4506
4507
  className: "text-xs cursor-pointer",
4507
4508
  children: [
4508
- H.OPEN,
4509
+ j.OPEN,
4509
4510
  " publish menu"
4510
4511
  ]
4511
4512
  }
@@ -4516,7 +4517,7 @@ const Uo = () => {
4516
4517
  onClick: () => i(l),
4517
4518
  className: "text-xs cursor-pointer",
4518
4519
  children: [
4519
- H.UNPUBLISH,
4520
+ j.UNPUBLISH,
4520
4521
  " page"
4521
4522
  ]
4522
4523
  }
@@ -4535,8 +4536,8 @@ const Uo = () => {
4535
4536
  ] });
4536
4537
  }, Mo = () => {
4537
4538
  const e = rt("settingComponent", null), [t, n] = I(!1);
4538
- return e ? /* @__PURE__ */ u(Ee, { children: [
4539
- /* @__PURE__ */ r(zr, { content: H.WEBSITEDATA, children: /* @__PURE__ */ r(
4539
+ return e ? /* @__PURE__ */ u(we, { children: [
4540
+ /* @__PURE__ */ r(zr, { content: j.WEBSITEDATA, children: /* @__PURE__ */ r(
4540
4541
  P,
4541
4542
  {
4542
4543
  variant: "ghost",
@@ -4550,8 +4551,8 @@ const Uo = () => {
4550
4551
  /* @__PURE__ */ r("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
4551
4552
  ] }) : null;
4552
4553
  }, Fo = () => {
4553
- const { data: e } = Oe(), t = e && (e == null ? void 0 : e.online), { data: n } = De();
4554
- return _e(
4554
+ const { data: e } = Re(), t = e && (e == null ? void 0 : e.online), { data: n } = De();
4555
+ return Pe(
4555
4556
  (a) => {
4556
4557
  var i;
4557
4558
  return (i = ye(n, { key: a })) == null ? void 0 : i.hasSlug;
@@ -4567,19 +4568,19 @@ const Uo = () => {
4567
4568
  className: "flex items-center gap-1",
4568
4569
  children: [
4569
4570
  /* @__PURE__ */ r(al, { className: "w-4 h-4" }),
4570
- /* @__PURE__ */ r("span", { className: "hidden sm:inline", children: H.OPEN })
4571
+ /* @__PURE__ */ r("span", { className: "hidden sm:inline", children: j.OPEN })
4571
4572
  ]
4572
4573
  }
4573
4574
  ) : null;
4574
4575
  };
4575
4576
  function qo() {
4576
- const { isLocked: e } = hn(), [t] = Re(), n = t.get("lang"), s = Mr(n);
4577
+ const { isLocked: e } = hn(), [t] = Oe(), n = t.get("lang"), s = Mr(n);
4577
4578
  return e || !s ? null : /* @__PURE__ */ u("div", { className: "flex items-center justify-end gap-1", children: [
4578
4579
  /* @__PURE__ */ r(Ao, {}),
4579
- /* @__PURE__ */ r(Me, { permission: me.EDIT_THEME, children: /* @__PURE__ */ r(Ro, {}) }),
4580
+ /* @__PURE__ */ r(Me, { permission: me.EDIT_THEME, children: /* @__PURE__ */ r(Oo, {}) }),
4580
4581
  /* @__PURE__ */ r(Me, { permission: me.EDIT_SETTINGS, children: /* @__PURE__ */ r(Mo, {}) }),
4581
4582
  /* @__PURE__ */ r(Uo, {}),
4582
- /* @__PURE__ */ r(Me, { permission: me.SAVE_PAGE, children: /* @__PURE__ */ r(Oo, {}) }),
4583
+ /* @__PURE__ */ r(Me, { permission: me.SAVE_PAGE, children: /* @__PURE__ */ r(Ro, {}) }),
4583
4584
  /* @__PURE__ */ r(Me, { permission: me.PUBLISH_PAGE, children: /* @__PURE__ */ r(Bo, {}) }),
4584
4585
  /* @__PURE__ */ r(Fo, {})
4585
4586
  ] });
@@ -4588,10 +4589,10 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4588
4589
  /* @__PURE__ */ r(Eo, {}),
4589
4590
  /* @__PURE__ */ r(qo, {})
4590
4591
  ] }), jo = () => {
4591
- const e = ne(), { aiContext: t } = Ss(), n = ee();
4592
- return _e(
4592
+ const e = ee(), { aiContext: t } = Ss(), n = Y();
4593
+ return Pe(
4593
4594
  async (s, a, i, l) => n(e, {
4594
- action: L.ASK_AI,
4595
+ action: k.ASK_AI,
4595
4596
  data: { type: s, prompt: a, blocks: i, context: t, lang: l }
4596
4597
  }),
4597
4598
  [e, t, n]
@@ -4616,40 +4617,40 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4616
4617
  return n;
4617
4618
  }), Vo = (e) => {
4618
4619
  const t = ml();
4619
- return J(() => {
4620
+ return X(() => {
4620
4621
  if (!e || de(e)) return { blocks: [] };
4621
- const n = be(
4622
+ const n = Se(
4622
4623
  e,
4623
4624
  (s) => !Ht(s == null ? void 0 : s._type, "@chai/")
4624
4625
  );
4625
4626
  return { blocks: Ko(t, n) };
4626
4627
  }, [e, t]);
4627
4628
  }, zo = () => {
4628
- const e = ne(), t = ee();
4629
- return ke({
4630
- queryKey: [V, "uiLibraries"],
4629
+ const e = ee(), t = Y();
4630
+ return Ie({
4631
+ queryKey: [K, "uiLibraries"],
4631
4632
  initialData: [],
4632
4633
  queryFn: async () => (await t(e, { action: "GET_LIBRARIES" })).map((s) => ({
4633
4634
  ...s
4634
4635
  }))
4635
4636
  });
4636
4637
  }, $o = () => {
4637
- const e = ws(), t = ee(), { user: n } = ht(), s = n == null ? void 0 : n.id;
4638
- return ke({
4639
- queryKey: [V, "permissions", s],
4638
+ const e = ws(), t = Y(), { user: n } = ht(), s = n == null ? void 0 : n.id;
4639
+ return Ie({
4640
+ queryKey: [K, "permissions", s],
4640
4641
  queryFn: () => t(e, {
4641
- action: L.GET_ROLE_AND_PERMISSIONS,
4642
+ action: k.GET_ROLE_AND_PERMISSIONS,
4642
4643
  data: { userId: s }
4643
4644
  }),
4644
4645
  enabled: !!s
4645
4646
  });
4646
4647
  }, Wo = () => {
4647
- const e = ne(), t = ee(), { setCurrentEditor: n } = hn(), [, s] = Ns();
4648
+ const e = ee(), t = Y(), { setCurrentEditor: n } = hn(), [, s] = Ns();
4648
4649
  return { getUILibraryBlock: async (o, c) => {
4649
4650
  const d = await t(e, {
4650
4651
  action: "GET_LIBRARY_ITEM",
4651
4652
  data: { id: c.id }
4652
- }), h = $(d, "html", ""), f = $(d, "blocks", []);
4653
+ }), h = W(d, "html", ""), f = W(d, "blocks", []);
4653
4654
  return Qa(f) ? f : di(h);
4654
4655
  }, getUILibraryBlocks: async (o) => {
4655
4656
  try {
@@ -4680,9 +4681,9 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4680
4681
  }
4681
4682
  } };
4682
4683
  }, Yo = () => {
4683
- const { data: e } = Un(), t = ne(), n = ee();
4684
+ const { data: e } = Un(), t = ee(), n = Y();
4684
4685
  return {
4685
- getPartialBlocks: _e(async () => {
4686
+ getPartialBlocks: Pe(async () => {
4686
4687
  const s = {};
4687
4688
  for (const a of e ?? [])
4688
4689
  de(a == null ? void 0 : a.slug) && (s[a.id] = {
@@ -4692,7 +4693,7 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4692
4693
  });
4693
4694
  return s;
4694
4695
  }, [e]),
4695
- getPartialBlockBlocks: _e(
4696
+ getPartialBlockBlocks: Pe(
4696
4697
  async (s) => {
4697
4698
  if (!s) return [];
4698
4699
  try {
@@ -4700,7 +4701,7 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4700
4701
  action: "GET_DRAFT_PAGE",
4701
4702
  data: { id: s, draft: !0, editor: !1 }
4702
4703
  });
4703
- return be(a.blocks, (i) => Je(i, "_id"));
4704
+ return Se(a.blocks, (i) => Je(i, "_id"));
4704
4705
  } catch (a) {
4705
4706
  return console.error(a), [];
4706
4707
  }
@@ -4712,7 +4713,7 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4712
4713
  email: An.string().email({ message: "Please enter a valid email address" }),
4713
4714
  password: An.string().min(6, { message: "Password must be at least 6 characters" })
4714
4715
  }), Qo = () => {
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({
4716
+ 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 = Ce({
4716
4717
  mutationFn: async (E) => {
4717
4718
  y("");
4718
4719
  const C = await bs(n, {
@@ -4747,9 +4748,9 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4747
4748
  v.mutate(N);
4748
4749
  } catch (N) {
4749
4750
  if (N instanceof An.ZodError) {
4750
- const _ = N.errors.reduce((w, k) => {
4751
- const T = k.path[0];
4752
- return w[T] = k.message, w;
4751
+ const _ = N.errors.reduce((w, L) => {
4752
+ const T = L.path[0];
4753
+ return w[T] = L.message, w;
4753
4754
  }, {});
4754
4755
  c(_);
4755
4756
  }
@@ -4762,9 +4763,9 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4762
4763
  ] }),
4763
4764
  /* @__PURE__ */ r(hs, { children: /* @__PURE__ */ u("form", { onSubmit: p, className: "space-y-4", children: [
4764
4765
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
4765
- /* @__PURE__ */ r(ae, { htmlFor: "email", children: "Email" }),
4766
+ /* @__PURE__ */ r(re, { htmlFor: "email", children: "Email" }),
4766
4767
  /* @__PURE__ */ r(
4767
- we,
4768
+ Ne,
4768
4769
  {
4769
4770
  id: "email",
4770
4771
  placeholder: "you@example.com",
@@ -4777,10 +4778,10 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4777
4778
  o.email && /* @__PURE__ */ r("p", { className: "text-sm text-destructive", children: o.email })
4778
4779
  ] }),
4779
4780
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
4780
- /* @__PURE__ */ r(ae, { htmlFor: "password", children: "Password" }),
4781
+ /* @__PURE__ */ r(re, { htmlFor: "password", children: "Password" }),
4781
4782
  /* @__PURE__ */ u("div", { className: "relative", children: [
4782
4783
  /* @__PURE__ */ r(
4783
- we,
4784
+ Ne,
4784
4785
  {
4785
4786
  id: "password",
4786
4787
  placeholder: "Enter your password",
@@ -4809,7 +4810,7 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4809
4810
  type: "submit",
4810
4811
  className: "w-full",
4811
4812
  disabled: !A || v.isPending,
4812
- children: v.isPending ? /* @__PURE__ */ u(Ee, { children: [
4813
+ children: v.isPending ? /* @__PURE__ */ u(we, { children: [
4813
4814
  /* @__PURE__ */ r(Gr, { className: "mr-2 h-4 w-4 animate-spin" }),
4814
4815
  "Logging in..."
4815
4816
  ] }) : "Login"
@@ -4859,7 +4860,7 @@ const Ho = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4859
4860
  ] }) });
4860
4861
  };
4861
4862
  let Wn = Qo;
4862
- const Xo = () => J(() => Wn, [Wn]), ed = (e) => {
4863
+ const Xo = () => X(() => Wn, [Wn]), nd = (e) => {
4863
4864
  Wn = e;
4864
4865
  }, Zo = () => {
4865
4866
  const e = Xo();
@@ -4868,8 +4869,8 @@ const Xo = () => J(() => Wn, [Wn]), ed = (e) => {
4868
4869
  isActive: e,
4869
4870
  show: t
4870
4871
  }) => {
4871
- const { data: n } = Dt();
4872
- return !Je(n, "languages") || !$(n, "languages", []).length ? null : /* @__PURE__ */ r(P, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ r(ll, { className: "w-4 h-4" }) });
4872
+ const { data: n } = mt();
4873
+ return !Je(n, "languages") || !W(n, "languages", []).length ? null : /* @__PURE__ */ r(P, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ r(ll, { className: "w-4 h-4" }) });
4873
4874
  }, $r = "lang", ec = {
4874
4875
  id: $r,
4875
4876
  label: "Languages",
@@ -4927,7 +4928,7 @@ function Ze({
4927
4928
  /* @__PURE__ */ r(ki, { children: "No option found." }),
4928
4929
  /* @__PURE__ */ u(Li, { children: [
4929
4930
  l.length > 0 && /* @__PURE__ */ u(
4930
- Rs,
4931
+ Os,
4931
4932
  {
4932
4933
  onSelect: y,
4933
4934
  className: "flex items-center text-sm",
@@ -4938,7 +4939,7 @@ function Ze({
4938
4939
  }
4939
4940
  ),
4940
4941
  v.map((p) => /* @__PURE__ */ u(
4941
- Rs,
4942
+ Os,
4942
4943
  {
4943
4944
  onSelect: () => f(p),
4944
4945
  className: "flex items-center justify-between",
@@ -4970,7 +4971,7 @@ function Ze({
4970
4971
  }
4971
4972
  const tc = () => {
4972
4973
  const { selectedLang: e } = dt(), { data: t, isFetching: n } = un();
4973
- return { data: J(() => ye(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
4974
+ return { data: X(() => ye(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
4974
4975
  }, nc = (e, t) => {
4975
4976
  const n = e.selectionStart || 0, s = e.selectionEnd || 0, a = e.value, i = a.substring(0, n), l = a.substring(s);
4976
4977
  let o = !1;
@@ -5005,8 +5006,8 @@ const tc = () => {
5005
5006
  searchDescription: "",
5006
5007
  jsonLD: "",
5007
5008
  ...c
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);
5009
- Ne(() => {
5009
+ }), y = ut({ initial: h, updated: h }), v = t.length ? t : n, { mutate: p, isPending: A } = As(), E = A, { hasPermission: C } = Dt(), N = C(me.EDIT_SEO);
5010
+ xe(() => {
5010
5011
  !o && c && f({
5011
5012
  title: "",
5012
5013
  description: "",
@@ -5037,51 +5038,51 @@ const tc = () => {
5037
5038
  ogTitle: h.title,
5038
5039
  ogDescription: h.description
5039
5040
  });
5040
- }, k = () => {
5041
+ }, L = () => {
5041
5042
  f({
5042
5043
  ...h,
5043
5044
  searchTitle: h.ogTitle,
5044
5045
  searchDescription: h.ogDescription
5045
5046
  });
5046
- }, T = (O, X) => {
5047
- const B = document.getElementById(X);
5047
+ }, T = (R, Z) => {
5048
+ const B = document.getElementById(Z);
5048
5049
  if (B) {
5049
5050
  const { value: S, newCursorPos: G } = nc(
5050
5051
  B,
5051
- O
5052
+ R
5052
5053
  );
5053
5054
  d.current = {
5054
- id: X,
5055
+ id: Z,
5055
5056
  position: G
5056
- }, B.tagName.toLowerCase() === "input" ? (B.value = S, f((he) => ({
5057
- ...he,
5057
+ }, B.tagName.toLowerCase() === "input" ? (B.value = S, f((Ee) => ({
5058
+ ...Ee,
5058
5059
  [B.name]: S
5059
- })), B.focus(), B.setSelectionRange(G, G), [0, 10, 50, 100, 200].forEach((he) => {
5060
+ })), B.focus(), B.setSelectionRange(G, G), [0, 10, 50, 100, 200].forEach((Ee) => {
5060
5061
  setTimeout(() => {
5061
- const Te = document.getElementById(X);
5062
- Te && (Te.focus(), Te.setSelectionRange(G, G));
5063
- }, he);
5064
- })) : (f((F) => ({
5065
- ...F,
5062
+ const le = document.getElementById(Z);
5063
+ le && (le.focus(), le.setSelectionRange(G, G));
5064
+ }, Ee);
5065
+ })) : (f((ie) => ({
5066
+ ...ie,
5066
5067
  [B.name]: S
5067
5068
  })), requestAnimationFrame(() => {
5068
- const F = document.getElementById(
5069
- X
5069
+ const ie = document.getElementById(
5070
+ Z
5070
5071
  );
5071
- F && (F.focus(), F.setSelectionRange(G, G), setTimeout(() => {
5072
- const he = document.getElementById(
5073
- X
5072
+ ie && (ie.focus(), ie.setSelectionRange(G, G), setTimeout(() => {
5073
+ const Ee = document.getElementById(
5074
+ Z
5074
5075
  );
5075
- he && (he.focus(), he.setSelectionRange(G, G));
5076
+ Ee && (Ee.focus(), Ee.setSelectionRange(G, G));
5076
5077
  }, 50));
5077
5078
  }));
5078
5079
  }
5079
- }, se = (O) => {
5080
- const X = {
5080
+ }, ne = (R) => {
5081
+ const Z = {
5081
5082
  ...h,
5082
- [O.target.name]: O.target.name === "noIndex" || O.target.name === "noFollow" ? O.target.checked : O.target.value
5083
+ [R.target.name]: R.target.name === "noIndex" || R.target.name === "noFollow" ? R.target.checked : R.target.value
5083
5084
  };
5084
- f(X), y.current.updated = X;
5085
+ f(Z), y.current.updated = Z;
5085
5086
  };
5086
5087
  return /* @__PURE__ */ u("div", { className: "relative h-full flex flex-col", children: [
5087
5088
  !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(
@@ -5095,7 +5096,7 @@ const tc = () => {
5095
5096
  "  ",
5096
5097
  s.length > 0 && /* @__PURE__ */ u("span", { className: "font-semibold text-blue-500", children: [
5097
5098
  "(",
5098
- $(He, v, v),
5099
+ W(He, v, v),
5099
5100
  ")"
5100
5101
  ] })
5101
5102
  ] }),
@@ -5105,24 +5106,24 @@ const tc = () => {
5105
5106
  /* @__PURE__ */ r(yn, { className: "pt-2", children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
5106
5107
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5107
5108
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5108
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "title", children: e("SEO Title") }),
5109
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "title", children: e("SEO Title") }),
5109
5110
  N && /* @__PURE__ */ r(
5110
5111
  Ze,
5111
5112
  {
5112
5113
  dataType: "value",
5113
5114
  data: i ?? {},
5114
- onSelect: (O) => T(O, "title")
5115
+ onSelect: (R) => T(R, "title")
5115
5116
  }
5116
5117
  )
5117
5118
  ] }),
5118
5119
  /* @__PURE__ */ r(
5119
- we,
5120
+ Ne,
5120
5121
  {
5121
5122
  type: "text",
5122
5123
  id: "title",
5123
5124
  name: "title",
5124
5125
  value: h.title,
5125
- onChange: se,
5126
+ onChange: ne,
5126
5127
  disabled: E || !N,
5127
5128
  placeholder: e("Enter SEO title"),
5128
5129
  readOnly: !N
@@ -5131,23 +5132,23 @@ const tc = () => {
5131
5132
  ] }),
5132
5133
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5133
5134
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5134
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "description", children: e("SEO Description") }),
5135
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "description", children: e("SEO Description") }),
5135
5136
  N && /* @__PURE__ */ r(
5136
5137
  Ze,
5137
5138
  {
5138
5139
  data: i ?? {},
5139
- onSelect: (O) => T(O, "description")
5140
+ onSelect: (R) => T(R, "description")
5140
5141
  }
5141
5142
  )
5142
5143
  ] }),
5143
5144
  /* @__PURE__ */ r(
5144
- Rt,
5145
+ Ot,
5145
5146
  {
5146
5147
  id: "description",
5147
5148
  name: "description",
5148
5149
  rows: 5,
5149
5150
  value: h.description,
5150
- onChange: se,
5151
+ onChange: ne,
5151
5152
  disabled: E || !N,
5152
5153
  placeholder: e("Enter SEO description"),
5153
5154
  readOnly: !N
@@ -5156,24 +5157,24 @@ const tc = () => {
5156
5157
  ] }),
5157
5158
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5158
5159
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5159
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "title", children: e("Canonical URL") }),
5160
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "title", children: e("Canonical URL") }),
5160
5161
  N && /* @__PURE__ */ r(
5161
5162
  Ze,
5162
5163
  {
5163
5164
  dataType: "value",
5164
5165
  data: i ?? {},
5165
- onSelect: (O) => T(O, "canonicalUrl")
5166
+ onSelect: (R) => T(R, "canonicalUrl")
5166
5167
  }
5167
5168
  )
5168
5169
  ] }),
5169
5170
  /* @__PURE__ */ r(
5170
- we,
5171
+ Ne,
5171
5172
  {
5172
5173
  type: "text",
5173
5174
  id: "canonicalUrl",
5174
5175
  name: "canonicalUrl",
5175
5176
  value: h.canonicalUrl,
5176
- onChange: se,
5177
+ onChange: ne,
5177
5178
  disabled: E || !N,
5178
5179
  placeholder: e("Enter Canonical URL"),
5179
5180
  readOnly: !N
@@ -5183,18 +5184,18 @@ const tc = () => {
5183
5184
  /* @__PURE__ */ u("div", { className: "", children: [
5184
5185
  /* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
5185
5186
  /* @__PURE__ */ r(
5186
- we,
5187
+ Ne,
5187
5188
  {
5188
5189
  type: "checkbox",
5189
5190
  id: "noIndex",
5190
5191
  name: "noIndex",
5191
5192
  checked: h.noIndex,
5192
- onChange: se,
5193
+ onChange: ne,
5193
5194
  disabled: E || !N,
5194
5195
  className: "w-4 h-4"
5195
5196
  }
5196
5197
  ),
5197
- /* @__PURE__ */ r(ae, { className: "pb-1 text-xs", htmlFor: "noIndex", children: e("No Index") })
5198
+ /* @__PURE__ */ r(re, { className: "pb-1 text-xs", htmlFor: "noIndex", children: e("No Index") })
5198
5199
  ] }),
5199
5200
  /* @__PURE__ */ r("p", { className: "mt-0 text-[10px] font-light text-gray-400 leading-4", children: e(
5200
5201
  "Check this if you don't want search engines to index this page."
@@ -5203,18 +5204,18 @@ const tc = () => {
5203
5204
  /* @__PURE__ */ u("div", { className: "", children: [
5204
5205
  /* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
5205
5206
  /* @__PURE__ */ r(
5206
- we,
5207
+ Ne,
5207
5208
  {
5208
5209
  type: "checkbox",
5209
5210
  id: "noFollow",
5210
5211
  name: "noFollow",
5211
5212
  checked: h.noFollow,
5212
- onChange: se,
5213
+ onChange: ne,
5213
5214
  disabled: E || !N,
5214
5215
  className: "w-4 h-4"
5215
5216
  }
5216
5217
  ),
5217
- /* @__PURE__ */ r(ae, { className: "pb-1 text-xs", htmlFor: "noIndex", children: e("No Follow") })
5218
+ /* @__PURE__ */ r(re, { className: "pb-1 text-xs", htmlFor: "noIndex", children: e("No Follow") })
5218
5219
  ] }),
5219
5220
  /* @__PURE__ */ r("p", { className: "text-[10px] font-light text-gray-400 leading-4", children: e(
5220
5221
  "Check this if you don't want search engines to follow links on this page."
@@ -5238,24 +5239,24 @@ const tc = () => {
5238
5239
  ) }),
5239
5240
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5240
5241
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5241
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "ogTitle", children: e("OG Title") }),
5242
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "ogTitle", children: e("OG Title") }),
5242
5243
  N && /* @__PURE__ */ r(
5243
5244
  Ze,
5244
5245
  {
5245
5246
  dataType: "value",
5246
5247
  data: i ?? {},
5247
- onSelect: (O) => T(O, "ogTitle")
5248
+ onSelect: (R) => T(R, "ogTitle")
5248
5249
  }
5249
5250
  )
5250
5251
  ] }),
5251
5252
  /* @__PURE__ */ r(
5252
- we,
5253
+ Ne,
5253
5254
  {
5254
5255
  type: "text",
5255
5256
  id: "ogTitle",
5256
5257
  name: "ogTitle",
5257
5258
  value: h.ogTitle,
5258
- onChange: se,
5259
+ onChange: ne,
5259
5260
  disabled: E || !N,
5260
5261
  placeholder: e("Enter OG title"),
5261
5262
  readOnly: !N
@@ -5264,24 +5265,24 @@ const tc = () => {
5264
5265
  ] }),
5265
5266
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5266
5267
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5267
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "ogDescription", children: e("OG Description") }),
5268
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "ogDescription", children: e("OG Description") }),
5268
5269
  N && /* @__PURE__ */ r(
5269
5270
  Ze,
5270
5271
  {
5271
5272
  dataType: "value",
5272
5273
  data: i ?? {},
5273
- onSelect: (O) => T(O, "ogDescription")
5274
+ onSelect: (R) => T(R, "ogDescription")
5274
5275
  }
5275
5276
  )
5276
5277
  ] }),
5277
5278
  /* @__PURE__ */ r(
5278
- Rt,
5279
+ Ot,
5279
5280
  {
5280
5281
  id: "ogDescription",
5281
5282
  name: "ogDescription",
5282
5283
  rows: 5,
5283
5284
  value: h.ogDescription,
5284
- onChange: se,
5285
+ onChange: ne,
5285
5286
  disabled: E || !N,
5286
5287
  placeholder: e("Enter OG description"),
5287
5288
  readOnly: !N
@@ -5290,24 +5291,24 @@ const tc = () => {
5290
5291
  ] }),
5291
5292
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5292
5293
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5293
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "ogImage", children: e("OG Image URL") }),
5294
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "ogImage", children: e("OG Image URL") }),
5294
5295
  N && /* @__PURE__ */ r(
5295
5296
  Ze,
5296
5297
  {
5297
5298
  dataType: "value",
5298
5299
  data: i ?? {},
5299
- onSelect: (O) => T(O, "ogImage")
5300
+ onSelect: (R) => T(R, "ogImage")
5300
5301
  }
5301
5302
  )
5302
5303
  ] }),
5303
5304
  /* @__PURE__ */ r(
5304
- we,
5305
+ Ne,
5305
5306
  {
5306
5307
  type: "text",
5307
5308
  id: "ogImage",
5308
5309
  name: "ogImage",
5309
5310
  value: h.ogImage,
5310
- onChange: se,
5311
+ onChange: ne,
5311
5312
  disabled: E || !N,
5312
5313
  placeholder: e("Enter OG image URL"),
5313
5314
  readOnly: !N
@@ -5325,31 +5326,31 @@ const tc = () => {
5325
5326
  type: "button",
5326
5327
  variant: "outline",
5327
5328
  size: "sm",
5328
- onClick: k,
5329
+ onClick: L,
5329
5330
  disabled: !N,
5330
5331
  children: e("Copy from OG Settings")
5331
5332
  }
5332
5333
  ) }),
5333
5334
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5334
5335
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5335
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "searchTitle", children: e("Search Title") }),
5336
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "searchTitle", children: e("Search Title") }),
5336
5337
  N && /* @__PURE__ */ r(
5337
5338
  Ze,
5338
5339
  {
5339
5340
  dataType: "value",
5340
5341
  data: i ?? {},
5341
- onSelect: (O) => T(O, "searchTitle")
5342
+ onSelect: (R) => T(R, "searchTitle")
5342
5343
  }
5343
5344
  )
5344
5345
  ] }),
5345
5346
  /* @__PURE__ */ r(
5346
- we,
5347
+ Ne,
5347
5348
  {
5348
5349
  type: "text",
5349
5350
  id: "searchTitle",
5350
5351
  name: "searchTitle",
5351
5352
  value: h.searchTitle,
5352
- onChange: se,
5353
+ onChange: ne,
5353
5354
  disabled: E || !N,
5354
5355
  placeholder: e("Enter search title"),
5355
5356
  readOnly: !N
@@ -5358,24 +5359,24 @@ const tc = () => {
5358
5359
  ] }),
5359
5360
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5360
5361
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5361
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "searchDescription", children: e("Search Description") }),
5362
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "searchDescription", children: e("Search Description") }),
5362
5363
  N && /* @__PURE__ */ r(
5363
5364
  Ze,
5364
5365
  {
5365
5366
  dataType: "value",
5366
5367
  data: i ?? {},
5367
- onSelect: (O) => T(O, "searchDescription")
5368
+ onSelect: (R) => T(R, "searchDescription")
5368
5369
  }
5369
5370
  )
5370
5371
  ] }),
5371
5372
  /* @__PURE__ */ r(
5372
- Rt,
5373
+ Ot,
5373
5374
  {
5374
5375
  id: "searchDescription",
5375
5376
  rows: 5,
5376
5377
  name: "searchDescription",
5377
5378
  value: h.searchDescription,
5378
- onChange: se,
5379
+ onChange: ne,
5379
5380
  placeholder: e("Enter search description"),
5380
5381
  disabled: E || !N,
5381
5382
  readOnly: !N
@@ -5388,24 +5389,24 @@ const tc = () => {
5388
5389
  /* @__PURE__ */ r(pn, { className: "font-bold text-slate-700", children: e("JSON-LD") }),
5389
5390
  /* @__PURE__ */ r(yn, { children: /* @__PURE__ */ r("div", { className: "space-y-4", children: /* @__PURE__ */ u("div", { className: "space-y-1", children: [
5390
5391
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
5391
- /* @__PURE__ */ r(ae, { className: "text-xs", htmlFor: "jsonLD", children: e("JSON-LD") }),
5392
+ /* @__PURE__ */ r(re, { className: "text-xs", htmlFor: "jsonLD", children: e("JSON-LD") }),
5392
5393
  N && /* @__PURE__ */ r(
5393
5394
  Ze,
5394
5395
  {
5395
5396
  dataType: "value",
5396
5397
  data: i ?? {},
5397
- onSelect: (O) => T(O, "jsonLD")
5398
+ onSelect: (R) => T(R, "jsonLD")
5398
5399
  }
5399
5400
  )
5400
5401
  ] }),
5401
5402
  /* @__PURE__ */ r(
5402
- Rt,
5403
+ Ot,
5403
5404
  {
5404
5405
  id: "jsonLD",
5405
5406
  name: "jsonLD",
5406
5407
  rows: 6,
5407
5408
  value: h.jsonLD,
5408
- onChange: se,
5409
+ onChange: ne,
5409
5410
  placeholder: e("Enter JSON-LD"),
5410
5411
  disabled: E || !N,
5411
5412
  readOnly: !N
@@ -5432,7 +5433,7 @@ const Yr = "seo", sc = ({
5432
5433
  isActive: e,
5433
5434
  show: t
5434
5435
  }) => {
5435
- const { data: n } = Oe(), s = Kl(n == null ? void 0 : n.pageType);
5436
+ const { data: n } = Re(), s = Kl(n == null ? void 0 : n.pageType);
5436
5437
  return !Je(s, "hasSlug") || !s.hasSlug ? null : /* @__PURE__ */ r(
5437
5438
  P,
5438
5439
  {
@@ -5466,10 +5467,10 @@ const Yr = "seo", sc = ({
5466
5467
  }, ac = () => {
5467
5468
  $n(Yr, rc), $n($r, ec);
5468
5469
  }, ic = "user-info", lc = () => {
5469
- const { user: e, logout: t } = ht(), n = Ae(), s = rt("onLogout", Xa);
5470
+ const { user: e, logout: t } = ht(), n = Te(), s = rt("onLogout", Xa);
5470
5471
  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" }) }) }),
5472
- /* @__PURE__ */ u(Oi, { className: "w-auto p-4 space-y-2", children: [
5472
+ /* @__PURE__ */ r(Oi, { asChild: !0, children: /* @__PURE__ */ r(P, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ r(dl, { className: "w-4 h-4" }) }) }),
5473
+ /* @__PURE__ */ u(Ri, { className: "w-auto p-4 space-y-2", children: [
5473
5474
  /* @__PURE__ */ r("div", { className: "text-sm font-medium", children: e.name ?? e.email }),
5474
5475
  /* @__PURE__ */ r("div", { className: "text-xs text-muted-foreground", children: e.email }),
5475
5476
  /* @__PURE__ */ u(ar, { children: [
@@ -5485,7 +5486,7 @@ const Yr = "seo", sc = ({
5485
5486
  mr,
5486
5487
  {
5487
5488
  onClick: () => {
5488
- t(), n.invalidateQueries({ queryKey: [V] }), Za(s) && s();
5489
+ t(), n.invalidateQueries({ queryKey: [K] }), Za(s) && s();
5489
5490
  },
5490
5491
  children: "Logout"
5491
5492
  }
@@ -5517,7 +5518,7 @@ function js(e) {
5517
5518
  const t = String(e), n = t.length - 1;
5518
5519
  return q.context.id + (n ? String.fromCharCode(96 + n) : "") + t;
5519
5520
  }
5520
- function Ot(e) {
5521
+ function Rt(e) {
5521
5522
  q.context = e;
5522
5523
  }
5523
5524
  var cc = (e, t) => e === t, Cn = Symbol("solid-proxy"), Qr = typeof Proxy == "function", Xr = Symbol("solid-track"), _n = {
@@ -5527,22 +5528,22 @@ var cc = (e, t) => e === t, Cn = Symbol("solid-proxy"), Qr = typeof Proxy == "fu
5527
5528
  cleanups: null,
5528
5529
  context: null,
5529
5530
  owner: null
5530
- }, jn = {}, ie = null, Kn = null, uc = null, ce = null, Le = null, et = null, Rn = 0;
5531
+ }, jn = {}, ae = null, Kn = null, uc = null, ue = null, Le = null, et = null, On = 0;
5531
5532
  function ot(e, t) {
5532
- const n = ce, s = ie, a = e.length === 0, i = t === void 0 ? s : t, l = a ? Jr : {
5533
+ const n = ue, s = ae, a = e.length === 0, i = t === void 0 ? s : t, l = a ? Jr : {
5533
5534
  owned: null,
5534
5535
  cleanups: null,
5535
5536
  context: i ? i.context : null,
5536
5537
  owner: i
5537
- }, o = a ? e : () => e(() => Ie(() => Kt(l)));
5538
- ie = l, ce = null;
5538
+ }, o = a ? e : () => e(() => ke(() => Kt(l)));
5539
+ ae = l, ue = null;
5539
5540
  try {
5540
5541
  return Ye(o, !0);
5541
5542
  } finally {
5542
- ce = n, ie = s;
5543
+ ue = n, ae = s;
5543
5544
  }
5544
5545
  }
5545
- function Se(e, t) {
5546
+ function Ae(e, t) {
5546
5547
  t = t ? Object.assign({}, _n, t) : _n;
5547
5548
  const n = {
5548
5549
  value: e,
@@ -5553,21 +5554,21 @@ function Se(e, t) {
5553
5554
  return [na.bind(n), s];
5554
5555
  }
5555
5556
  function dc(e, t, n) {
5556
- const s = On(e, t, !0, nt);
5557
+ const s = Rn(e, t, !0, nt);
5557
5558
  Gt(s);
5558
5559
  }
5559
5560
  function ct(e, t, n) {
5560
- const s = On(e, t, !1, nt);
5561
+ const s = Rn(e, t, !1, nt);
5561
5562
  Gt(s);
5562
5563
  }
5563
5564
  function ea(e, t, n) {
5564
5565
  Zr = wc;
5565
- const s = On(e, t, !1, nt);
5566
+ const s = Rn(e, t, !1, nt);
5566
5567
  (!n || !n.render) && (s.user = !0), et ? et.push(s) : Gt(s);
5567
5568
  }
5568
5569
  function Ue(e, t, n) {
5569
5570
  n = n ? Object.assign({}, _n, n) : _n;
5570
- const s = On(e, t, !0, 0);
5571
+ const s = Rn(e, t, !0, 0);
5571
5572
  return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, Gt(s), na.bind(s);
5572
5573
  }
5573
5574
  function hc(e) {
@@ -5577,54 +5578,54 @@ function mc(e, t, n) {
5577
5578
  let s, a, i;
5578
5579
  arguments.length === 1 ? (s = !0, a = e, i = {}) : (s = e, a = t, i = {});
5579
5580
  let l = null, o = jn, c = null, d = !1, h = "initialValue" in i, f = typeof s == "function" && Ue(s);
5580
- const y = /* @__PURE__ */ new Set(), [v, p] = (i.storage || Se)(i.initialValue), [A, E] = Se(void 0), [C, N] = Se(void 0, {
5581
+ const y = /* @__PURE__ */ new Set(), [v, p] = (i.storage || Ae)(i.initialValue), [A, E] = Ae(void 0), [C, N] = Ae(void 0, {
5581
5582
  equals: !1
5582
- }), [_, w] = Se(h ? "ready" : "unresolved");
5583
+ }), [_, w] = Ae(h ? "ready" : "unresolved");
5583
5584
  q.context && (c = q.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : q.load && q.has(c) && (o = q.load(c)));
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(
5585
+ function L(Z, B, S, G) {
5586
+ return l === Z && (l = null, G !== void 0 && (h = !0), (Z === o || B === o) && i.onHydrated && queueMicrotask(
5586
5587
  () => i.onHydrated(G, {
5587
5588
  value: B
5588
5589
  })
5589
5590
  ), o = jn, T(B, S)), B;
5590
5591
  }
5591
- function T(X, B) {
5592
+ function T(Z, B) {
5592
5593
  Ye(() => {
5593
- B === void 0 && p(() => X), w(B !== void 0 ? "errored" : h ? "ready" : "unresolved"), E(B);
5594
+ B === void 0 && p(() => Z), w(B !== void 0 ? "errored" : h ? "ready" : "unresolved"), E(B);
5594
5595
  for (const S of y.keys())
5595
5596
  S.decrement();
5596
5597
  y.clear();
5597
5598
  }, !1);
5598
5599
  }
5599
- function se() {
5600
- const X = vc, B = v(), S = A();
5600
+ function ne() {
5601
+ const Z = vc, B = v(), S = A();
5601
5602
  if (S !== void 0 && !l)
5602
5603
  throw S;
5603
- return ce && ce.user, B;
5604
+ return ue && ue.user, B;
5604
5605
  }
5605
- function O(X = !0) {
5606
- if (X !== !1 && d)
5606
+ function R(Z = !0) {
5607
+ if (Z !== !1 && d)
5607
5608
  return;
5608
5609
  d = !1;
5609
5610
  const B = f ? f() : s;
5610
5611
  if (B == null || B === !1) {
5611
- k(l, Ie(v));
5612
+ L(l, ke(v));
5612
5613
  return;
5613
5614
  }
5614
- const S = o !== jn ? o : Ie(
5615
+ const S = o !== jn ? o : ke(
5615
5616
  () => a(B, {
5616
5617
  value: v(),
5617
- refetching: X
5618
+ refetching: Z
5618
5619
  })
5619
5620
  );
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(() => {
5621
+ return hc(S) ? (l = S, "value" in S ? (S.status === "success" ? L(l, S.value, void 0, B) : L(l, void 0, Yn(S.value), B), S) : (d = !0, queueMicrotask(() => d = !1), Ye(() => {
5621
5622
  w(h ? "refreshing" : "pending"), N();
5622
5623
  }, !1), S.then(
5623
- (G) => k(S, G, void 0, B),
5624
- (G) => k(S, void 0, Yn(G), B)
5625
- ))) : (k(l, S, void 0, B), S);
5624
+ (G) => L(S, G, void 0, B),
5625
+ (G) => L(S, void 0, Yn(G), B)
5626
+ ))) : (L(l, S, void 0, B), S);
5626
5627
  }
5627
- return Object.defineProperties(se, {
5628
+ return Object.defineProperties(ne, {
5628
5629
  state: {
5629
5630
  get: () => _()
5630
5631
  },
@@ -5633,43 +5634,43 @@ function mc(e, t, n) {
5633
5634
  },
5634
5635
  loading: {
5635
5636
  get() {
5636
- const X = _();
5637
- return X === "pending" || X === "refreshing";
5637
+ const Z = _();
5638
+ return Z === "pending" || Z === "refreshing";
5638
5639
  }
5639
5640
  },
5640
5641
  latest: {
5641
5642
  get() {
5642
5643
  if (!h)
5643
- return se();
5644
- const X = A();
5645
- if (X && !l)
5646
- throw X;
5644
+ return ne();
5645
+ const Z = A();
5646
+ if (Z && !l)
5647
+ throw Z;
5647
5648
  return v();
5648
5649
  }
5649
5650
  }
5650
- }), f ? dc(() => O(!1)) : O(!1), [
5651
- se,
5651
+ }), f ? dc(() => R(!1)) : R(!1), [
5652
+ ne,
5652
5653
  {
5653
- refetch: O,
5654
+ refetch: R,
5654
5655
  mutate: p
5655
5656
  }
5656
5657
  ];
5657
5658
  }
5658
- function td(e) {
5659
+ function sd(e) {
5659
5660
  return Ye(e, !1);
5660
5661
  }
5661
- function Ie(e) {
5662
- if (ce === null)
5662
+ function ke(e) {
5663
+ if (ue === null)
5663
5664
  return e();
5664
- const t = ce;
5665
- ce = null;
5665
+ const t = ue;
5666
+ ue = null;
5666
5667
  try {
5667
5668
  return e();
5668
5669
  } finally {
5669
- ce = t;
5670
+ ue = t;
5670
5671
  }
5671
5672
  }
5672
- function nd(e, t, n) {
5673
+ function rd(e, t, n) {
5673
5674
  const s = Array.isArray(e);
5674
5675
  let a, i = n && n.defer;
5675
5676
  return (l) => {
@@ -5682,43 +5683,43 @@ function nd(e, t, n) {
5682
5683
  o = e();
5683
5684
  if (i)
5684
5685
  return i = !1, l;
5685
- const c = Ie(() => t(o, a, l));
5686
+ const c = ke(() => t(o, a, l));
5686
5687
  return a = o, c;
5687
5688
  };
5688
5689
  }
5689
5690
  function fc(e) {
5690
- ea(() => Ie(e));
5691
+ ea(() => ke(e));
5691
5692
  }
5692
5693
  function jt(e) {
5693
- return ie === null || (ie.cleanups === null ? ie.cleanups = [e] : ie.cleanups.push(e)), e;
5694
+ return ae === null || (ae.cleanups === null ? ae.cleanups = [e] : ae.cleanups.push(e)), e;
5694
5695
  }
5695
5696
  function Ks() {
5696
- return ie;
5697
+ return ae;
5697
5698
  }
5698
5699
  function gc(e, t) {
5699
- const n = ie, s = ce;
5700
- ie = e, ce = null;
5700
+ const n = ae, s = ue;
5701
+ ae = e, ue = null;
5701
5702
  try {
5702
5703
  return Ye(t, !0);
5703
5704
  } catch (a) {
5704
5705
  _s(a);
5705
5706
  } finally {
5706
- ie = n, ce = s;
5707
+ ae = n, ue = s;
5707
5708
  }
5708
5709
  }
5709
5710
  function pc(e) {
5710
- const t = ce, n = ie;
5711
+ const t = ue, n = ae;
5711
5712
  return Promise.resolve().then(() => {
5712
- ce = t, ie = n;
5713
+ ue = t, ae = n;
5713
5714
  let s;
5714
- return Ye(e, !1), ce = ie = null, s ? s.done : void 0;
5715
+ return Ye(e, !1), ue = ae = null, s ? s.done : void 0;
5715
5716
  });
5716
5717
  }
5717
- var [yc, sd] = /* @__PURE__ */ Se(!1);
5718
- function rd() {
5718
+ var [yc, ad] = /* @__PURE__ */ Ae(!1);
5719
+ function id() {
5719
5720
  return [yc, pc];
5720
5721
  }
5721
- function ad(e, t) {
5722
+ function ld(e, t) {
5722
5723
  const n = Symbol("context");
5723
5724
  return {
5724
5725
  id: n,
@@ -5726,9 +5727,9 @@ function ad(e, t) {
5726
5727
  defaultValue: e
5727
5728
  };
5728
5729
  }
5729
- function id(e) {
5730
+ function od(e) {
5730
5731
  let t;
5731
- return ie && ie.context && (t = ie.context[e.id]) !== void 0 ? t : e.defaultValue;
5732
+ return ae && ae.context && (t = ae.context[e.id]) !== void 0 ? t : e.defaultValue;
5732
5733
  }
5733
5734
  function ta(e) {
5734
5735
  const t = Ue(e), n = Ue(() => Qn(t()));
@@ -5746,9 +5747,9 @@ function na() {
5746
5747
  const e = Le;
5747
5748
  Le = null, Ye(() => kn(this), !1), Le = e;
5748
5749
  }
5749
- if (ce) {
5750
+ if (ue) {
5750
5751
  const e = this.observers ? this.observers.length : 0;
5751
- ce.sources ? (ce.sources.push(this), ce.sourceSlots.push(e)) : (ce.sources = [this], ce.sourceSlots = [e]), this.observers ? (this.observers.push(ce), this.observerSlots.push(ce.sources.length - 1)) : (this.observers = [ce], this.observerSlots = [ce.sources.length - 1]);
5752
+ ue.sources ? (ue.sources.push(this), ue.sourceSlots.push(e)) : (ue.sources = [this], ue.sourceSlots = [e]), this.observers ? (this.observers.push(ue), this.observerSlots.push(ue.sources.length - 1)) : (this.observers = [ue], this.observerSlots = [ue.sources.length - 1]);
5752
5753
  }
5753
5754
  return this.value;
5754
5755
  }
@@ -5767,7 +5768,7 @@ function Gt(e) {
5767
5768
  if (!e.fn)
5768
5769
  return;
5769
5770
  Kt(e);
5770
- const t = Rn;
5771
+ const t = On;
5771
5772
  Ec(
5772
5773
  e,
5773
5774
  e.value,
@@ -5776,18 +5777,18 @@ function Gt(e) {
5776
5777
  }
5777
5778
  function Ec(e, t, n) {
5778
5779
  let s;
5779
- const a = ie, i = ce;
5780
- ce = ie = e;
5780
+ const a = ae, i = ue;
5781
+ ue = ae = e;
5781
5782
  try {
5782
5783
  s = e.fn(t);
5783
5784
  } catch (l) {
5784
5785
  return e.pure && (e.state = nt, e.owned && e.owned.forEach(Kt), e.owned = null), e.updatedAt = n + 1, _s(l);
5785
5786
  } finally {
5786
- ce = i, ie = a;
5787
+ ue = i, ae = a;
5787
5788
  }
5788
5789
  (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? sa(e, s) : e.value = s, e.updatedAt = n);
5789
5790
  }
5790
- function On(e, t, n, s = nt, a) {
5791
+ function Rn(e, t, n, s = nt, a) {
5791
5792
  const i = {
5792
5793
  fn: e,
5793
5794
  state: s,
@@ -5797,21 +5798,21 @@ function On(e, t, n, s = nt, a) {
5797
5798
  sourceSlots: null,
5798
5799
  cleanups: null,
5799
5800
  value: t,
5800
- owner: ie,
5801
- context: ie ? ie.context : null,
5801
+ owner: ae,
5802
+ context: ae ? ae.context : null,
5802
5803
  pure: n
5803
5804
  };
5804
- return ie === null || ie !== Jr && (ie.owned ? ie.owned.push(i) : ie.owned = [i]), i;
5805
+ return ae === null || ae !== Jr && (ae.owned ? ae.owned.push(i) : ae.owned = [i]), i;
5805
5806
  }
5806
5807
  function In(e) {
5807
5808
  if (e.state === 0)
5808
5809
  return;
5809
5810
  if (e.state === Pn)
5810
5811
  return kn(e);
5811
- if (e.suspense && Ie(e.suspense.inFallback))
5812
+ if (e.suspense && ke(e.suspense.inFallback))
5812
5813
  return e.suspense.effects.push(e);
5813
5814
  const t = [e];
5814
- for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < Rn); )
5815
+ for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < On); )
5815
5816
  e.state && t.push(e);
5816
5817
  for (let n = t.length - 1; n >= 0; n--)
5817
5818
  if (e = t[n], e.state === nt)
@@ -5825,7 +5826,7 @@ function Ye(e, t) {
5825
5826
  if (Le)
5826
5827
  return e();
5827
5828
  let n = !1;
5828
- t || (Le = []), et ? n = !0 : et = [], Rn++;
5829
+ t || (Le = []), et ? n = !0 : et = [], On++;
5829
5830
  try {
5830
5831
  const s = e();
5831
5832
  return bc(n), s;
@@ -5854,7 +5855,7 @@ function wc(e) {
5854
5855
  q.effects || (q.effects = []), q.effects.push(...e.slice(0, n));
5855
5856
  return;
5856
5857
  }
5857
- Ot();
5858
+ Rt();
5858
5859
  }
5859
5860
  for (q.effects && (q.done || !q.count) && (e = [...q.effects, ...e], n += q.effects.length, delete q.effects), t = 0; t < n; t++)
5860
5861
  In(e[t]);
@@ -5865,7 +5866,7 @@ function kn(e, t) {
5865
5866
  const s = e.sources[n];
5866
5867
  if (s.sources) {
5867
5868
  const a = s.state;
5868
- a === nt ? s !== t && (!s.updatedAt || s.updatedAt < Rn) && In(s) : a === Pn && kn(s, t);
5869
+ a === nt ? s !== t && (!s.updatedAt || s.updatedAt < On) && In(s) : a === Pn && kn(s, t);
5869
5870
  }
5870
5871
  }
5871
5872
  }
@@ -5907,7 +5908,7 @@ function Yn(e) {
5907
5908
  cause: e
5908
5909
  });
5909
5910
  }
5910
- function _s(e, t = ie) {
5911
+ function _s(e, t = ae) {
5911
5912
  throw Yn(e);
5912
5913
  }
5913
5914
  function Qn(e) {
@@ -5927,8 +5928,8 @@ function Sc(e, t) {
5927
5928
  return function(s) {
5928
5929
  let a;
5929
5930
  return ct(
5930
- () => a = Ie(() => (ie.context = {
5931
- ...ie.context,
5931
+ () => a = ke(() => (ae.context = {
5932
+ ...ae.context,
5932
5933
  [e]: s.value
5933
5934
  }, ta(() => s.children))),
5934
5935
  void 0
@@ -5944,8 +5945,8 @@ function Nc(e, t, n = {}) {
5944
5945
  let s = [], a = [], i = [], l = 0, o = t.length > 1 ? [] : null;
5945
5946
  return jt(() => Ln(i)), () => {
5946
5947
  let c = e() || [], d = c.length, h, f;
5947
- return c[Xr], Ie(() => {
5948
- let v, p, A, E, C, N, _, w, k;
5948
+ return c[Xr], ke(() => {
5949
+ let v, p, A, E, C, N, _, w, L;
5949
5950
  if (d === 0)
5950
5951
  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);
5951
5952
  else if (l === 0) {
@@ -5958,9 +5959,9 @@ function Nc(e, t, n = {}) {
5958
5959
  for (_ = l - 1, w = d - 1; _ >= N && w >= N && s[_] === c[w]; _--, w--)
5959
5960
  A[w] = a[_], E[w] = i[_], o && (C[w] = o[_]);
5960
5961
  for (v = /* @__PURE__ */ new Map(), p = new Array(w + 1), f = w; f >= N; f--)
5961
- k = c[f], h = v.get(k), p[f] = h === void 0 ? -1 : h, v.set(k, f);
5962
+ L = c[f], h = v.get(L), p[f] = h === void 0 ? -1 : h, v.set(L, f);
5962
5963
  for (h = N; h <= _; h++)
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]();
5964
+ L = s[h], f = v.get(L), f !== void 0 && f !== -1 ? (A[f] = a[h], E[f] = i[h], o && (C[f] = o[h]), f = p[f], v.set(L, f)) : i[h]();
5964
5965
  for (f = N; f < d; f++)
5965
5966
  f in A ? (a[f] = A[f], i[f] = E[f], o && (o[f] = C[f], o[f](f))) : a[f] = ot(y);
5966
5967
  a = a.slice(0, l = d), s = c.slice(0);
@@ -5969,7 +5970,7 @@ function Nc(e, t, n = {}) {
5969
5970
  });
5970
5971
  function y(v) {
5971
5972
  if (i[f] = v, o) {
5972
- const [p, A] = Se(f);
5973
+ const [p, A] = Ae(f);
5973
5974
  return o[f] = A, t(c[f], p);
5974
5975
  }
5975
5976
  return t(c[f]);
@@ -5980,7 +5981,7 @@ function Ac(e, t, n = {}) {
5980
5981
  let s = [], a = [], i = [], l = [], o = 0, c;
5981
5982
  return jt(() => Ln(i)), () => {
5982
5983
  const d = e() || [], h = d.length;
5983
- return d[Xr], Ie(() => {
5984
+ return d[Xr], ke(() => {
5984
5985
  if (h === 0)
5985
5986
  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;
5986
5987
  for (s[0] === Xn && (i[0](), i = [], s = [], a = [], o = 0), c = 0; c < h; c++)
@@ -5991,13 +5992,13 @@ function Ac(e, t, n = {}) {
5991
5992
  });
5992
5993
  function f(y) {
5993
5994
  i[c] = y;
5994
- const [v, p] = Se(d[c]);
5995
+ const [v, p] = Ae(d[c]);
5995
5996
  return l[c] = p, t(v, c);
5996
5997
  }
5997
5998
  };
5998
5999
  }
5999
6000
  function ia(e, t) {
6000
- return Ie(() => e(t || {}));
6001
+ return ke(() => e(t || {}));
6001
6002
  }
6002
6003
  function vn() {
6003
6004
  return !0;
@@ -6145,9 +6146,9 @@ function oa(e) {
6145
6146
  const s = (a) => {
6146
6147
  const i = q.context;
6147
6148
  if (i) {
6148
- const [o, c] = Se();
6149
+ const [o, c] = Ae();
6149
6150
  q.count || (q.count = 0), q.count++, (n || (n = e())).then((d) => {
6150
- !q.done && Ot(i), q.count--, c(() => d.default), Ot();
6151
+ !q.done && Rt(i), q.count--, c(() => d.default), Rt();
6151
6152
  }), t = o;
6152
6153
  } else if (!t) {
6153
6154
  const [o] = mc(() => (n || (n = e())).then((c) => c.default));
@@ -6155,36 +6156,36 @@ function oa(e) {
6155
6156
  }
6156
6157
  let l;
6157
6158
  return Ue(
6158
- () => (l = t()) ? Ie(() => {
6159
+ () => (l = t()) ? ke(() => {
6159
6160
  if (!i || q.done)
6160
6161
  return l(a);
6161
6162
  const o = q.context;
6162
- Ot(i);
6163
+ Rt(i);
6163
6164
  const c = l(a);
6164
- return Ot(o), c;
6165
+ return Rt(o), c;
6165
6166
  }) : ""
6166
6167
  );
6167
6168
  };
6168
6169
  return s.preload = () => n || ((n = e()).then((a) => t = () => a.default), n), s;
6169
6170
  }
6170
6171
  var Cc = 0;
6171
- function ld() {
6172
+ function cd() {
6172
6173
  return q.context ? q.getNextContextId() : `cl-${Cc++}`;
6173
6174
  }
6174
6175
  var ca = (e) => `Stale read from <${e}>.`;
6175
- function od(e) {
6176
+ function ud(e) {
6176
6177
  const t = "fallback" in e && {
6177
6178
  fallback: () => e.fallback
6178
6179
  };
6179
6180
  return Ue(Nc(() => e.each, e.children, t || void 0));
6180
6181
  }
6181
- function cd(e) {
6182
+ function dd(e) {
6182
6183
  const t = "fallback" in e && {
6183
6184
  fallback: () => e.fallback
6184
6185
  };
6185
6186
  return Ue(Ac(() => e.each, e.children, t || void 0));
6186
6187
  }
6187
- function ud(e) {
6188
+ function hd(e) {
6188
6189
  const t = e.keyed, n = Ue(() => e.when, void 0, {
6189
6190
  equals: (s, a) => t ? s === a : !s == !a
6190
6191
  });
@@ -6193,10 +6194,10 @@ function ud(e) {
6193
6194
  const s = n();
6194
6195
  if (s) {
6195
6196
  const a = e.children;
6196
- return typeof a == "function" && a.length > 0 ? Ie(
6197
+ return typeof a == "function" && a.length > 0 ? ke(
6197
6198
  () => a(
6198
6199
  t ? s : () => {
6199
- if (!Ie(n))
6200
+ if (!ke(n))
6200
6201
  throw ca("Show");
6201
6202
  return e.when;
6202
6203
  }
@@ -6209,7 +6210,7 @@ function ud(e) {
6209
6210
  void 0
6210
6211
  );
6211
6212
  }
6212
- function dd(e) {
6213
+ function md(e) {
6213
6214
  let t = !1;
6214
6215
  const n = (i, l) => (t ? i[1] === l[1] : !i[1] == !l[1]) && i[2] === l[2], s = ta(() => e.children), a = Ue(
6215
6216
  () => {
@@ -6233,10 +6234,10 @@ function dd(e) {
6233
6234
  if (i < 0)
6234
6235
  return e.fallback;
6235
6236
  const c = o.children;
6236
- return typeof c == "function" && c.length > 0 ? Ie(
6237
+ return typeof c == "function" && c.length > 0 ? ke(
6237
6238
  () => c(
6238
6239
  t ? l : () => {
6239
- if (Ie(a)[0] !== i)
6240
+ if (ke(a)[0] !== i)
6240
6241
  throw ca("Match");
6241
6242
  return o.when;
6242
6243
  }
@@ -6247,7 +6248,7 @@ function dd(e) {
6247
6248
  void 0
6248
6249
  );
6249
6250
  }
6250
- function hd(e) {
6251
+ function fd(e) {
6251
6252
  return e;
6252
6253
  }
6253
6254
  var _c = [
@@ -6423,11 +6424,11 @@ var Gc = /* @__PURE__ */ new Set([
6423
6424
  "use",
6424
6425
  "view",
6425
6426
  "vkern"
6426
- ]), Rc = {
6427
+ ]), Oc = {
6427
6428
  xlink: "http://www.w3.org/1999/xlink",
6428
6429
  xml: "http://www.w3.org/XML/1998/namespace"
6429
6430
  };
6430
- function Oc(e, t, n) {
6431
+ function Rc(e, t, n) {
6431
6432
  let s = n.length, a = t.length, i = s, l = 0, o = 0, c = t[a - 1].nextSibling, d = null;
6432
6433
  for (; l < a || o < i; ) {
6433
6434
  if (t[l] === n[o]) {
@@ -6481,7 +6482,7 @@ function ua(e, t, n, s = {}) {
6481
6482
  a(), t.textContent = "";
6482
6483
  };
6483
6484
  }
6484
- function md(e, t, n) {
6485
+ function gd(e, t, n) {
6485
6486
  let s;
6486
6487
  const a = () => {
6487
6488
  const l = document.createElement("template");
@@ -6496,7 +6497,7 @@ function Bc(e, t = window.document) {
6496
6497
  n.has(i) || (n.add(i), t.addEventListener(i, da));
6497
6498
  }
6498
6499
  }
6499
- function fd(e = window.document) {
6500
+ function pd(e = window.document) {
6500
6501
  if (e[Mt]) {
6501
6502
  for (let t of e[Mt].keys())
6502
6503
  e.removeEventListener(t, da);
@@ -6504,16 +6505,16 @@ function fd(e = window.document) {
6504
6505
  }
6505
6506
  }
6506
6507
  function Jn(e, t, n) {
6507
- mt(e) || (n == null ? e.removeAttribute(t) : e.setAttribute(t, n));
6508
+ ft(e) || (n == null ? e.removeAttribute(t) : e.setAttribute(t, n));
6508
6509
  }
6509
6510
  function Mc(e, t, n, s) {
6510
- mt(e) || (s == null ? e.removeAttributeNS(t, n) : e.setAttributeNS(t, n, s));
6511
+ ft(e) || (s == null ? e.removeAttributeNS(t, n) : e.setAttributeNS(t, n, s));
6511
6512
  }
6512
6513
  function Fc(e, t, n) {
6513
- mt(e) || (n ? e.setAttribute(t, "") : e.removeAttribute(t));
6514
+ ft(e) || (n ? e.setAttribute(t, "") : e.removeAttribute(t));
6514
6515
  }
6515
6516
  function qc(e, t) {
6516
- mt(e) || (t == null ? e.removeAttribute("class") : e.className = t);
6517
+ ft(e) || (t == null ? e.removeAttribute("class") : e.className = t);
6517
6518
  }
6518
6519
  function Hc(e, t, n, s) {
6519
6520
  if (s)
@@ -6558,7 +6559,7 @@ function Vc(e, t = {}, n, s) {
6558
6559
  ), ct(() => typeof t.ref == "function" && zc(t.ref, e)), ct(() => $c(e, t, n, !0, a, !0)), a;
6559
6560
  }
6560
6561
  function zc(e, t, n) {
6561
- return Ie(() => e(t, n));
6562
+ return ke(() => e(t, n));
6562
6563
  }
6563
6564
  function es(e, t, n, s) {
6564
6565
  if (n !== void 0 && !s && (s = []), typeof t != "function")
@@ -6582,9 +6583,9 @@ function $c(e, t, n, s, a = {}, i = !1) {
6582
6583
  }
6583
6584
  function Wc(e) {
6584
6585
  let t, n;
6585
- return !mt() || !(t = q.registry.get(n = Qc())) ? e() : (q.completed && q.completed.add(t), q.registry.delete(n), t);
6586
+ return !ft() || !(t = q.registry.get(n = Qc())) ? e() : (q.completed && q.completed.add(t), q.registry.delete(n), t);
6586
6587
  }
6587
- function mt(e) {
6588
+ function ft(e) {
6588
6589
  return !!q.context && !q.done && (!e || e.isConnected);
6589
6590
  }
6590
6591
  function Yc(e) {
@@ -6625,11 +6626,11 @@ function zs(e, t, n, s, a, i, l) {
6625
6626
  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)) {
6626
6627
  if (f)
6627
6628
  t = t.slice(5), c = !0;
6628
- else if (mt(e))
6629
+ else if (ft(e))
6629
6630
  return n;
6630
6631
  t === "class" || t === "className" ? qc(e, n) : o && !c && !d ? e[Yc(t)] = n : e[h || t] = n;
6631
6632
  } else {
6632
- const y = a && t.indexOf(":") > -1 && Rc[t.split(":")[0]];
6633
+ const y = a && t.indexOf(":") > -1 && Oc[t.split(":")[0]];
6633
6634
  y ? Mc(e, y, t, n) : Jn(e, kc[t] || t, n);
6634
6635
  }
6635
6636
  return n;
@@ -6674,7 +6675,7 @@ function da(e) {
6674
6675
  i(s);
6675
6676
  }
6676
6677
  function Vt(e, t, n, s, a) {
6677
- const i = mt(e);
6678
+ const i = ft(e);
6678
6679
  if (i) {
6679
6680
  !n && (n = [...e.childNodes]);
6680
6681
  let c = [];
@@ -6694,13 +6695,13 @@ function Vt(e, t, n, s, a) {
6694
6695
  return n;
6695
6696
  if (o) {
6696
6697
  let c = n[0];
6697
- c && c.nodeType === 3 ? c.data !== t && (c.data = t) : c = document.createTextNode(t), n = ft(e, n, s, c);
6698
+ c && c.nodeType === 3 ? c.data !== t && (c.data = t) : c = document.createTextNode(t), n = gt(e, n, s, c);
6698
6699
  } else
6699
6700
  n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
6700
6701
  } else if (t == null || l === "boolean") {
6701
6702
  if (i)
6702
6703
  return n;
6703
- n = ft(e, n, s);
6704
+ n = gt(e, n, s);
6704
6705
  } else {
6705
6706
  if (l === "function")
6706
6707
  return ct(() => {
@@ -6727,17 +6728,17 @@ function Vt(e, t, n, s, a) {
6727
6728
  return n = f;
6728
6729
  }
6729
6730
  if (c.length === 0) {
6730
- if (n = ft(e, n, s), o)
6731
+ if (n = gt(e, n, s), o)
6731
6732
  return n;
6732
- } else d ? n.length === 0 ? $s(e, c, s) : Oc(e, n, c) : (n && ft(e), $s(e, c));
6733
+ } else d ? n.length === 0 ? $s(e, c, s) : Rc(e, n, c) : (n && gt(e), $s(e, c));
6733
6734
  n = c;
6734
6735
  } else if (t.nodeType) {
6735
6736
  if (i && t.parentNode)
6736
6737
  return n = o ? [t] : t;
6737
6738
  if (Array.isArray(n)) {
6738
6739
  if (o)
6739
- return n = ft(e, n, s, t);
6740
- ft(e, n, null, t);
6740
+ return n = gt(e, n, s, t);
6741
+ gt(e, n, null, t);
6741
6742
  } else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
6742
6743
  n = t;
6743
6744
  }
@@ -6775,7 +6776,7 @@ function $s(e, t, n = null) {
6775
6776
  for (let s = 0, a = t.length; s < a; s++)
6776
6777
  e.insertBefore(t[s], n);
6777
6778
  }
6778
- function ft(e, t, n, s) {
6779
+ function gt(e, t, n, s) {
6779
6780
  if (n === void 0)
6780
6781
  return e.textContent = "";
6781
6782
  const a = s || document.createTextNode("");
@@ -6800,7 +6801,7 @@ var Xc = "http://www.w3.org/2000/svg";
6800
6801
  function ha(e, t = !1) {
6801
6802
  return t ? document.createElementNS(Xc, e) : document.createElement(e);
6802
6803
  }
6803
- function gd(e) {
6804
+ function yd(e) {
6804
6805
  const { useShadow: t } = e, n = document.createTextNode(""), s = () => e.mount || document.body, a = Ks();
6805
6806
  let i, l = !!q.context;
6806
6807
  return ea(
@@ -6808,7 +6809,7 @@ function gd(e) {
6808
6809
  l && (Ks().user = l = !1), i || (i = gc(a, () => Ue(() => e.children)));
6809
6810
  const o = s();
6810
6811
  if (o instanceof HTMLHeadElement) {
6811
- const [c, d] = Se(!1), h = () => d(!0);
6812
+ const [c, d] = Ae(!1), h = () => d(!0);
6812
6813
  ot((f) => es(o, () => c() ? f() : i(), null)), jt(h);
6813
6814
  } else {
6814
6815
  const c = ha(e.isSVG ? "g" : "div", e.isSVG), d = t && c.attachShadow ? c.attachShadow({
@@ -6828,13 +6829,13 @@ function gd(e) {
6828
6829
  }
6829
6830
  ), n;
6830
6831
  }
6831
- function pd(e) {
6832
+ function vd(e) {
6832
6833
  const [t, n] = Tc(e, ["component"]), s = Ue(() => t.component);
6833
6834
  return Ue(() => {
6834
6835
  const a = s();
6835
6836
  switch (typeof a) {
6836
6837
  case "function":
6837
- return Ie(() => a(n));
6838
+ return ke(() => a(n));
6838
6839
  case "string":
6839
6840
  const i = Uc.has(a), l = q.context ? Wc() : ha(a, i);
6840
6841
  return Vc(l, n, i), l;
@@ -6903,7 +6904,7 @@ function tu(e, t) {
6903
6904
  return i;
6904
6905
  }
6905
6906
  }
6906
- function kt(e, t) {
6907
+ function Lt(e, t) {
6907
6908
  Object.entries(e).forEach(([n, s]) => t(s, n));
6908
6909
  }
6909
6910
  function xn(e, t) {
@@ -7078,7 +7079,7 @@ var vu = (e, t, n) => {
7078
7079
  throw new Error("Unknown transformation: " + t);
7079
7080
  return s.untransform(e, n);
7080
7081
  }
7081
- }, gt = (e, t) => {
7082
+ }, pt = (e, t) => {
7082
7083
  const n = e.keys();
7083
7084
  for (; t > 0; )
7084
7085
  n.next(), t--;
@@ -7097,9 +7098,9 @@ var Eu = (e, t) => {
7097
7098
  for (let n = 0; n < t.length; n++) {
7098
7099
  const s = t[n];
7099
7100
  if (Wt(e))
7100
- e = gt(e, +s);
7101
+ e = pt(e, +s);
7101
7102
  else if ($t(e)) {
7102
- const a = +s, i = +t[++n] == 0 ? "key" : "value", l = gt(e, a);
7103
+ const a = +s, i = +t[++n] == 0 ? "key" : "value", l = pt(e, a);
7103
7104
  switch (i) {
7104
7105
  case "key":
7105
7106
  e = l;
@@ -7125,11 +7126,11 @@ var Eu = (e, t) => {
7125
7126
  s = s[l];
7126
7127
  else if (Wt(s)) {
7127
7128
  const o = +l;
7128
- s = gt(s, o);
7129
+ s = pt(s, o);
7129
7130
  } else if ($t(s)) {
7130
7131
  if (i === t.length - 2)
7131
7132
  break;
7132
- const c = +l, d = +t[++i] == 0 ? "key" : "value", h = gt(s, c);
7133
+ const c = +l, d = +t[++i] == 0 ? "key" : "value", h = pt(s, c);
7133
7134
  switch (d) {
7134
7135
  case "key":
7135
7136
  s = h;
@@ -7142,11 +7143,11 @@ var Eu = (e, t) => {
7142
7143
  }
7143
7144
  const a = t[t.length - 1];
7144
7145
  if (st(s) ? s[+a] = n(s[+a]) : zt(s) && (s[a] = n(s[a])), Wt(s)) {
7145
- const i = gt(s, +a), l = n(i);
7146
+ const i = pt(s, +a), l = n(i);
7146
7147
  i !== l && (s.delete(i), s.add(l));
7147
7148
  }
7148
7149
  if ($t(s)) {
7149
- const i = +t[t.length - 2], l = gt(s, i);
7150
+ const i = +t[t.length - 2], l = pt(s, i);
7150
7151
  switch (+a == 0 ? "key" : "value") {
7151
7152
  case "key": {
7152
7153
  const c = n(l);
@@ -7165,11 +7166,11 @@ function rs(e, t, n = []) {
7165
7166
  if (!e)
7166
7167
  return;
7167
7168
  if (!st(e)) {
7168
- kt(e, (i, l) => rs(i, t, [...n, ...Ft(l)]));
7169
+ Lt(e, (i, l) => rs(i, t, [...n, ...Ft(l)]));
7169
7170
  return;
7170
7171
  }
7171
7172
  const [s, a] = e;
7172
- a && kt(a, (i, l) => {
7173
+ a && Lt(a, (i, l) => {
7173
7174
  rs(i, t, [...n, ...Ft(l)]);
7174
7175
  }), t(s, n);
7175
7176
  }
@@ -7189,9 +7190,9 @@ function wu(e, t) {
7189
7190
  const [s, a] = t;
7190
7191
  s.forEach((i) => {
7191
7192
  e = ss(e, Ft(i), () => e);
7192
- }), a && kt(a, n);
7193
+ }), a && Lt(a, n);
7193
7194
  } else
7194
- kt(t, n);
7195
+ Lt(t, n);
7195
7196
  return e;
7196
7197
  }
7197
7198
  var Su = (e, t) => zt(e) || st(e) || $t(e) || Wt(e) || ba(e, t);
@@ -7234,11 +7235,11 @@ var xa = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
7234
7235
  transformedValue: null
7235
7236
  };
7236
7237
  const c = Qs(e, n), d = (c == null ? void 0 : c.value) ?? e, h = st(d) ? [] : {}, f = {};
7237
- kt(d, (v, p) => {
7238
+ Lt(d, (v, p) => {
7238
7239
  if (p === "__proto__" || p === "constructor" || p === "prototype")
7239
7240
  throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
7240
7241
  const A = xa(v, t, n, s, [...a, p], [...i, e], l);
7241
- h[p] = A.transformedValue, st(A.annotations) ? f[p] = A.annotations : zt(A.annotations) && kt(A.annotations, (E, C) => {
7242
+ h[p] = A.transformedValue, st(A.annotations) ? f[p] = A.annotations : zt(A.annotations) && Lt(A.annotations, (E, C) => {
7242
7243
  f[pa(p) + "." + C] = E;
7243
7244
  });
7244
7245
  });
@@ -7285,7 +7286,7 @@ function as(e, t = {}) {
7285
7286
  return Tu(a, i, o, e, t.nonenumerable), a;
7286
7287
  }, {});
7287
7288
  }
7288
- var ue = class {
7289
+ var he = class {
7289
7290
  /**
7290
7291
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
7291
7292
  */
@@ -7333,52 +7334,52 @@ var ue = class {
7333
7334
  this.allowedErrorProps.push(...e);
7334
7335
  }
7335
7336
  };
7336
- ue.defaultInstance = new ue();
7337
- ue.serialize = ue.defaultInstance.serialize.bind(ue.defaultInstance);
7338
- ue.deserialize = ue.defaultInstance.deserialize.bind(ue.defaultInstance);
7339
- ue.stringify = ue.defaultInstance.stringify.bind(ue.defaultInstance);
7340
- ue.parse = ue.defaultInstance.parse.bind(ue.defaultInstance);
7341
- ue.registerClass = ue.defaultInstance.registerClass.bind(ue.defaultInstance);
7342
- ue.registerSymbol = ue.defaultInstance.registerSymbol.bind(ue.defaultInstance);
7343
- ue.registerCustom = ue.defaultInstance.registerCustom.bind(ue.defaultInstance);
7344
- ue.allowErrorProps = ue.defaultInstance.allowErrorProps.bind(ue.defaultInstance);
7345
- var Cu = ue.serialize, yd = ue.stringify;
7346
- function vd(e) {
7337
+ he.defaultInstance = new he();
7338
+ he.serialize = he.defaultInstance.serialize.bind(he.defaultInstance);
7339
+ he.deserialize = he.defaultInstance.deserialize.bind(he.defaultInstance);
7340
+ he.stringify = he.defaultInstance.stringify.bind(he.defaultInstance);
7341
+ he.parse = he.defaultInstance.parse.bind(he.defaultInstance);
7342
+ he.registerClass = he.defaultInstance.registerClass.bind(he.defaultInstance);
7343
+ he.registerSymbol = he.defaultInstance.registerSymbol.bind(he.defaultInstance);
7344
+ he.registerCustom = he.defaultInstance.registerCustom.bind(he.defaultInstance);
7345
+ he.allowErrorProps = he.defaultInstance.allowErrorProps.bind(he.defaultInstance);
7346
+ var Cu = he.serialize, Ed = he.stringify;
7347
+ function bd(e) {
7347
7348
  return e.state.fetchStatus === "fetching" ? "fetching" : e.getObserversCount() ? e.state.fetchStatus === "paused" ? "paused" : e.isStale() ? "stale" : "fresh" : "inactive";
7348
7349
  }
7349
- function Ed(e, t) {
7350
+ function wd(e, t) {
7350
7351
  return `${e}${t.charAt(0).toUpperCase() + t.slice(1)}`;
7351
7352
  }
7352
- function bd({
7353
+ function Sd({
7353
7354
  queryState: e,
7354
7355
  observerCount: t,
7355
7356
  isStale: n
7356
7357
  }) {
7357
7358
  return e.fetchStatus === "fetching" ? "blue" : t ? e.fetchStatus === "paused" ? "purple" : n ? "yellow" : "green" : "gray";
7358
7359
  }
7359
- function wd({
7360
+ function Nd({
7360
7361
  status: e,
7361
7362
  isPaused: t
7362
7363
  }) {
7363
7364
  return t ? "purple" : e === "error" ? "red" : e === "pending" ? "yellow" : e === "success" ? "green" : "gray";
7364
7365
  }
7365
- function Sd(e) {
7366
+ function Ad(e) {
7366
7367
  return e === "fresh" ? "green" : e === "stale" ? "yellow" : e === "paused" ? "purple" : e === "inactive" ? "gray" : "blue";
7367
7368
  }
7368
- var Nd = (e, t = !1) => {
7369
+ var xd = (e, t = !1) => {
7369
7370
  const {
7370
7371
  json: n
7371
7372
  } = Cu(e);
7372
7373
  return JSON.stringify(n, null, t ? 2 : void 0);
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
+ }, 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, Td = {
7374
7375
  status: Pu,
7375
7376
  "query hash": _u,
7376
7377
  "last updated": Ca
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 = {
7378
+ }, 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, Cd = {
7378
7379
  status: Iu,
7379
7380
  "last updated": _a
7380
- }, Td = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), Cd = () => {
7381
- const [e, t] = Se("dark");
7381
+ }, _d = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), Pd = () => {
7382
+ const [e, t] = Ae("dark");
7382
7383
  return fc(() => {
7383
7384
  const n = window.matchMedia("(prefers-color-scheme: dark)");
7384
7385
  t(n.matches ? "dark" : "light");
@@ -7452,21 +7453,21 @@ var Nd = (e, t = !1) => {
7452
7453
  return;
7453
7454
  const s = document.createElement("style"), a = document.createTextNode("");
7454
7455
  s.appendChild(a), s.id = "_goober", s.setAttribute("nonce", e), t ? t.appendChild(s) : document.head.appendChild(s);
7455
- }, pt, Yt, Qt, Xt, it, Zt, yt, vt, Et, bt, wt, St, Jt, Zs, ku = (Zs = class {
7456
+ }, yt, Yt, Qt, Xt, it, Zt, vt, Et, bt, wt, St, Nt, Jt, Zs, ku = (Zs = class {
7456
7457
  constructor(e) {
7457
- oe(this, pt);
7458
- oe(this, Yt);
7459
- oe(this, Qt);
7460
- oe(this, Xt);
7461
- oe(this, it, !1);
7462
- oe(this, Zt);
7463
- oe(this, yt);
7464
- oe(this, vt);
7465
- oe(this, Et);
7466
- oe(this, bt);
7467
- oe(this, wt);
7468
- oe(this, St);
7469
- oe(this, Jt);
7458
+ ce(this, yt);
7459
+ ce(this, Yt);
7460
+ ce(this, Qt);
7461
+ ce(this, Xt);
7462
+ ce(this, it, !1);
7463
+ ce(this, Zt);
7464
+ ce(this, vt);
7465
+ ce(this, Et);
7466
+ ce(this, bt);
7467
+ ce(this, wt);
7468
+ ce(this, St);
7469
+ ce(this, Nt);
7470
+ ce(this, Jt);
7470
7471
  const {
7471
7472
  client: t,
7472
7473
  queryFlavor: n,
@@ -7479,41 +7480,41 @@ var Nd = (e, t = !1) => {
7479
7480
  styleNonce: d,
7480
7481
  shadowDOMTarget: h
7481
7482
  } = e;
7482
- le(this, pt, Se(t)), le(this, Qt, n), le(this, Xt, s), le(this, Yt, a), le(this, Zt, d), le(this, yt, h), le(this, vt, Se(i)), le(this, Et, Se(l)), le(this, bt, Se(o)), le(this, wt, Se(c));
7483
+ oe(this, yt, Ae(t)), oe(this, Qt, n), oe(this, Xt, s), oe(this, Yt, a), oe(this, Zt, d), oe(this, vt, h), oe(this, Et, Ae(i)), oe(this, bt, Ae(l)), oe(this, wt, Ae(o)), oe(this, St, Ae(c));
7483
7484
  }
7484
7485
  setButtonPosition(e) {
7485
- M(this, vt)[1](e);
7486
+ F(this, Et)[1](e);
7486
7487
  }
7487
7488
  setPosition(e) {
7488
- M(this, Et)[1](e);
7489
+ F(this, bt)[1](e);
7489
7490
  }
7490
7491
  setInitialIsOpen(e) {
7491
- M(this, bt)[1](e);
7492
+ F(this, wt)[1](e);
7492
7493
  }
7493
7494
  setErrorTypes(e) {
7494
- M(this, wt)[1](e);
7495
+ F(this, St)[1](e);
7495
7496
  }
7496
7497
  setClient(e) {
7497
- M(this, pt)[1](e);
7498
+ F(this, yt)[1](e);
7498
7499
  }
7499
7500
  mount(e) {
7500
- if (M(this, it))
7501
+ if (F(this, it))
7501
7502
  throw new Error("Devtools is already mounted");
7502
7503
  const t = ua(() => {
7503
- const n = this, [s] = M(this, vt), [a] = M(this, Et), [i] = M(this, bt), [l] = M(this, wt), [o] = M(this, pt);
7504
+ const n = this, [s] = F(this, Et), [a] = F(this, bt), [i] = F(this, wt), [l] = F(this, St), [o] = F(this, yt);
7504
7505
  let c;
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({
7506
+ return F(this, Nt) ? c = F(this, Nt) : (c = oa(() => import("./HO4MOOFI-Buv_Pvi9.js")), oe(this, Nt, c)), Pa(F(this, Zt), F(this, vt)), ia(c, la({
7506
7507
  get queryFlavor() {
7507
- return M(n, Qt);
7508
+ return F(n, Qt);
7508
7509
  },
7509
7510
  get version() {
7510
- return M(n, Xt);
7511
+ return F(n, Xt);
7511
7512
  },
7512
7513
  get onlineManager() {
7513
- return M(n, Yt);
7514
+ return F(n, Yt);
7514
7515
  },
7515
7516
  get shadowDOMTarget() {
7516
- return M(n, yt);
7517
+ return F(n, vt);
7517
7518
  }
7518
7519
  }, {
7519
7520
  get client() {
@@ -7533,30 +7534,30 @@ var Nd = (e, t = !1) => {
7533
7534
  }
7534
7535
  }));
7535
7536
  }, e);
7536
- le(this, it, !0), le(this, Jt, t);
7537
+ oe(this, it, !0), oe(this, Jt, t);
7537
7538
  }
7538
7539
  unmount() {
7539
7540
  var e;
7540
- if (!M(this, it))
7541
+ if (!F(this, it))
7541
7542
  throw new Error("Devtools is not mounted");
7542
- (e = M(this, Jt)) == null || e.call(this), le(this, it, !1);
7543
+ (e = F(this, Jt)) == null || e.call(this), oe(this, it, !1);
7543
7544
  }
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 {
7545
+ }, yt = new WeakMap(), Yt = new WeakMap(), Qt = new WeakMap(), Xt = new WeakMap(), it = new WeakMap(), Zt = new WeakMap(), vt = new WeakMap(), Et = new WeakMap(), bt = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Nt = new WeakMap(), Jt = new WeakMap(), Zs), At, en, tn, nn, lt, sn, xt, Tt, Ct, _t, Pt, It, kt, rn, Js, Lu = (Js = class {
7545
7546
  constructor(e) {
7546
- oe(this, Nt);
7547
- oe(this, en);
7548
- oe(this, tn);
7549
- oe(this, nn);
7550
- oe(this, lt, !1);
7551
- oe(this, sn);
7552
- oe(this, At);
7553
- oe(this, xt);
7554
- oe(this, Tt);
7555
- oe(this, Ct);
7556
- oe(this, _t);
7557
- oe(this, Pt);
7558
- oe(this, It);
7559
- oe(this, rn);
7547
+ ce(this, At);
7548
+ ce(this, en);
7549
+ ce(this, tn);
7550
+ ce(this, nn);
7551
+ ce(this, lt, !1);
7552
+ ce(this, sn);
7553
+ ce(this, xt);
7554
+ ce(this, Tt);
7555
+ ce(this, Ct);
7556
+ ce(this, _t);
7557
+ ce(this, Pt);
7558
+ ce(this, It);
7559
+ ce(this, kt);
7560
+ ce(this, rn);
7560
7561
  const {
7561
7562
  client: t,
7562
7563
  queryFlavor: n,
@@ -7570,44 +7571,44 @@ var Nd = (e, t = !1) => {
7570
7571
  shadowDOMTarget: h,
7571
7572
  onClose: f
7572
7573
  } = e;
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));
7574
+ oe(this, At, Ae(t)), oe(this, tn, n), oe(this, nn, s), oe(this, en, a), oe(this, sn, d), oe(this, xt, h), oe(this, Tt, Ae(i)), oe(this, Ct, Ae(l)), oe(this, _t, Ae(o)), oe(this, Pt, Ae(c)), oe(this, It, Ae(f));
7574
7575
  }
7575
7576
  setButtonPosition(e) {
7576
- M(this, xt)[1](e);
7577
+ F(this, Tt)[1](e);
7577
7578
  }
7578
7579
  setPosition(e) {
7579
- M(this, Tt)[1](e);
7580
+ F(this, Ct)[1](e);
7580
7581
  }
7581
7582
  setInitialIsOpen(e) {
7582
- M(this, Ct)[1](e);
7583
+ F(this, _t)[1](e);
7583
7584
  }
7584
7585
  setErrorTypes(e) {
7585
- M(this, _t)[1](e);
7586
+ F(this, Pt)[1](e);
7586
7587
  }
7587
7588
  setClient(e) {
7588
- M(this, Nt)[1](e);
7589
+ F(this, At)[1](e);
7589
7590
  }
7590
7591
  setOnClose(e) {
7591
- M(this, Pt)[1](() => e);
7592
+ F(this, It)[1](() => e);
7592
7593
  }
7593
7594
  mount(e) {
7594
- if (M(this, lt))
7595
+ if (F(this, lt))
7595
7596
  throw new Error("Devtools is already mounted");
7596
7597
  const t = ua(() => {
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);
7598
+ const n = this, [s] = F(this, Tt), [a] = F(this, Ct), [i] = F(this, _t), [l] = F(this, Pt), [o] = F(this, At), [c] = F(this, It);
7598
7599
  let d;
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({
7600
+ return F(this, kt) ? d = F(this, kt) : (d = oa(() => import("./HUY7CZI3-H_gdIxzv.js")), oe(this, kt, d)), Pa(F(this, sn), F(this, xt)), ia(d, la({
7600
7601
  get queryFlavor() {
7601
- return M(n, tn);
7602
+ return F(n, tn);
7602
7603
  },
7603
7604
  get version() {
7604
- return M(n, nn);
7605
+ return F(n, nn);
7605
7606
  },
7606
7607
  get onlineManager() {
7607
- return M(n, en);
7608
+ return F(n, en);
7608
7609
  },
7609
7610
  get shadowDOMTarget() {
7610
- return M(n, At);
7611
+ return F(n, xt);
7611
7612
  }
7612
7613
  }, {
7613
7614
  get client() {
@@ -7630,17 +7631,17 @@ var Nd = (e, t = !1) => {
7630
7631
  }
7631
7632
  }));
7632
7633
  }, e);
7633
- le(this, lt, !0), le(this, rn, t);
7634
+ oe(this, lt, !0), oe(this, rn, t);
7634
7635
  }
7635
7636
  unmount() {
7636
7637
  var e;
7637
- if (!M(this, lt))
7638
+ if (!F(this, lt))
7638
7639
  throw new Error("Devtools is not mounted");
7639
- (e = M(this, rn)) == null || e.call(this), le(this, lt, !1);
7640
+ (e = F(this, rn)) == null || e.call(this), oe(this, lt, !1);
7640
7641
  }
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);
7642
+ }, At = new WeakMap(), en = new WeakMap(), tn = new WeakMap(), nn = new WeakMap(), lt = new WeakMap(), sn = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), Pt = new WeakMap(), It = new WeakMap(), kt = new WeakMap(), rn = new WeakMap(), Js);
7642
7643
  function Du(e) {
7643
- const t = Ae(e.client), n = fe.useRef(null), {
7644
+ const t = Te(e.client), n = fe.useRef(null), {
7644
7645
  buttonPosition: s,
7645
7646
  position: a,
7646
7647
  initialIsOpen: i,
@@ -7676,7 +7677,7 @@ function Du(e) {
7676
7677
  }), [d]), /* @__PURE__ */ r("div", { className: "tsqd-parent-container", ref: n });
7677
7678
  }
7678
7679
  function Gu(e) {
7679
- const t = Ae(e.client), n = fe.useRef(null), { errorTypes: s, styleNonce: a, shadowDOMTarget: i } = e, [l] = fe.useState(
7680
+ const t = Te(e.client), n = fe.useRef(null), { errorTypes: s, styleNonce: a, shadowDOMTarget: i } = e, [l] = fe.useState(
7680
7681
  new Lu({
7681
7682
  client: t,
7682
7683
  queryFlavor: "React Query",
@@ -7713,51 +7714,75 @@ var Uu = process.env.NODE_ENV !== "development" ? function() {
7713
7714
  return null;
7714
7715
  } : Du;
7715
7716
  process.env.NODE_ENV;
7716
- const Ru = ti(
7717
- () => import("./digital-asset-manager-C2ypiQHt.js")
7717
+ const Ou = () => {
7718
+ const e = ee(), t = Y();
7719
+ return Ie({
7720
+ queryKey: [K, k.GET_COLLECTIONS],
7721
+ initialData: [],
7722
+ queryFn: async () => t(e, { action: k.GET_COLLECTIONS })
7723
+ });
7724
+ }, Ru = () => {
7725
+ const { data: e } = Re(), { data: t } = mt(), n = ee(), s = Y(), a = X(
7726
+ () => (t == null ? void 0 : t.fallbackLang) || "en",
7727
+ [t == null ? void 0 : t.fallbackLang]
7728
+ );
7729
+ return Ce({
7730
+ mutationFn: async ({ block: i }) => s(n, {
7731
+ action: k.GET_BLOCK_ASYNC_PROPS,
7732
+ data: {
7733
+ block: i,
7734
+ lang: (e == null ? void 0 : e.lang) || a,
7735
+ pageProps: { slug: e == null ? void 0 : e.slug, searchParams: {} }
7736
+ }
7737
+ })
7738
+ });
7739
+ }, Bu = ti(
7740
+ () => import("./digital-asset-manager-DWilfiv8.js")
7718
7741
  );
7719
7742
  gl();
7720
7743
  ac();
7721
7744
  fi(Ho);
7722
- gi(Ru);
7745
+ gi(Bu);
7723
7746
  pi(Hl);
7724
7747
  $n("user-info", oc);
7725
- const Ou = (e) => {
7726
- const t = ut([]), [n] = Re(), s = n.get("page"), { data: a } = Oe(), {
7748
+ const Mu = (e) => {
7749
+ const t = ut([]), [n] = Oe(), s = n.get("page"), { data: a } = Re(), {
7727
7750
  data: i = {
7728
7751
  role: "",
7729
7752
  permissions: null
7730
7753
  }
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(
7754
+ } = $o(), { data: l } = zo(), { data: o, isFetching: c } = Fr(), { blocks: d } = Vo(o), { data: h } = mt(), { data: f } = De(), { mutateAsync: y } = Rr(), v = jo(), { getUILibraryBlock: p, getUILibraryBlocks: A, onSave: E } = Wo(), { getPartialBlocks: C, getPartialBlockBlocks: N } = Yo(), { aiContext: _, setAiContext: w } = Ss(), { mutateAsync: L } = Vl(), [T, ne] = I(!1), R = X(
7732
7755
  () => (h == null ? void 0 : h.fallbackLang) || "en",
7733
7756
  [h]
7734
- ), { data: X } = qr();
7735
- Cl(), Ne(() => {
7736
- const F = () => {
7737
- document.hidden ? se(!0) : se(!1);
7757
+ ), { data: Z } = qr(), { data: B } = Ou(), { mutateAsync: S } = Ru();
7758
+ Cl(), xe(() => {
7759
+ const le = () => {
7760
+ document.hidden ? ne(!0) : ne(!1);
7738
7761
  };
7739
- return window.addEventListener("visibilitychange", F), () => window.removeEventListener("visibilitychange", F);
7762
+ return window.addEventListener("visibilitychange", le), () => window.removeEventListener("visibilitychange", le);
7740
7763
  }, []), t.current = d;
7741
- const B = J(() => {
7742
- const F = {};
7743
- return i && (F.permissions = $(i, "permissions", null), F.role = $(i, "role", "user")), F;
7744
- }, [i]), S = J(() => l, [l]), G = _e(
7745
- async (F, he) => await k({ pageType: F, query: he }),
7746
- [k]
7747
- ), ge = J(
7748
- () => $(h, "theme", {}) || {},
7764
+ const G = X(() => {
7765
+ const le = {};
7766
+ return i && (le.permissions = W(i, "permissions", null), le.role = W(i, "role", "user")), le;
7767
+ }, [i]), ve = X(() => l, [l]), ie = Pe(
7768
+ async (le, $) => await L({ pageType: le, query: $ }),
7769
+ [L]
7770
+ ), Ee = X(
7771
+ () => W(h, "theme", {}) || {},
7749
7772
  [h]
7750
7773
  );
7751
- return /* @__PURE__ */ u(Ee, { children: [
7774
+ return /* @__PURE__ */ u(we, { children: [
7752
7775
  c && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-50 flex items-center justify-center w-screen h-screen bg-white/30", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center bg-white rounded-full size-10", children: /* @__PURE__ */ r(Gr, { className: "size-5 animate-spin" }) }) }),
7753
7776
  /* @__PURE__ */ r(
7754
7777
  yi,
7755
7778
  {
7756
- pageExternalData: X,
7779
+ collections: B ?? [],
7780
+ getBlockAsyncProps: S,
7781
+ pageExternalData: Z,
7757
7782
  themePresets: e.themePresets ?? [],
7758
7783
  pageId: a == null ? void 0 : a.id,
7759
7784
  loading: c,
7760
- fallbackLang: O,
7785
+ fallbackLang: R,
7761
7786
  languages: (h == null ? void 0 : h.languages) || [],
7762
7787
  brandingOptions: (h == null ? void 0 : h.theme) || {},
7763
7788
  translations: e.translations || {},
@@ -7769,33 +7794,33 @@ const Ou = (e) => {
7769
7794
  getPartialBlockBlocks: N,
7770
7795
  getPartialBlocks: C,
7771
7796
  blocks: c ? [] : d,
7772
- theme: Ja(ge),
7797
+ theme: Ja(Ee),
7773
7798
  getUILibraryBlock: p,
7774
7799
  getUILibraryBlocks: A,
7775
- uiLibraries: S,
7800
+ uiLibraries: ve,
7776
7801
  pageTypes: f,
7777
- searchPageTypeItems: G,
7778
- saveAiContextCallback: async (F) => {
7802
+ searchPageTypeItems: ie,
7803
+ saveAiContextCallback: async (le) => {
7779
7804
  if (!s) return !0;
7780
- const he = t.current, Te = {
7805
+ const $ = t.current, ge = {
7781
7806
  _type: "@chai/ai-context",
7782
- _value: Us(F) ? F : ""
7783
- }, Y = [...he, Te];
7784
- return await E({ page: s, blocks: Y }), w(F), !0;
7807
+ _value: Us(le) ? le : ""
7808
+ }, H = [...$, ge];
7809
+ return await E({ page: s, blocks: H }), w(le), !0;
7785
7810
  },
7786
7811
  aiContext: _,
7787
7812
  askAiCallBack: v,
7788
- onSave: async ({ blocks: F, theme: he }) => {
7813
+ onSave: async ({ blocks: le, theme: $ }) => {
7789
7814
  if (!s) return !0;
7790
- t.current = F;
7791
- const Te = {
7815
+ t.current = le;
7816
+ const ge = {
7792
7817
  _type: "@chai/ai-context",
7793
7818
  _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;
7819
+ }, H = [...le, ge];
7820
+ return await E({ page: s, blocks: H }), t.current = H, is($, Ee) || await y({ settings: { theme: $ } }), !0;
7796
7821
  },
7797
7822
  themePanelComponent: eo,
7798
- ...B
7823
+ ...G
7799
7824
  }
7800
7825
  ),
7801
7826
  /* @__PURE__ */ u("div", { children: [
@@ -7803,16 +7828,16 @@ const Ou = (e) => {
7803
7828
  /* @__PURE__ */ r(Ll, {})
7804
7829
  ] })
7805
7830
  ] });
7806
- }, Bu = new ni({
7831
+ }, Fu = new ni({
7807
7832
  defaultOptions: {
7808
7833
  queries: {
7809
7834
  refetchOnWindowFocus: !1,
7810
7835
  refetchOnReconnect: !1
7811
7836
  }
7812
7837
  }
7813
- }), _d = (e) => {
7838
+ }), Id = (e) => {
7814
7839
  const { isLoggedIn: t } = ht(), [, n] = Br(), [s, a] = I(!1);
7815
- return Ne(() => (n(
7840
+ return xe(() => (n(
7816
7841
  tr(e, [
7817
7842
  "apiUrl",
7818
7843
  "usersApiUrl",
@@ -7825,13 +7850,13 @@ const Ou = (e) => {
7825
7850
  a(!0);
7826
7851
  }, 200), () => {
7827
7852
  a(!1), n({});
7828
- }), [e, n]), s ? /* @__PURE__ */ u(si, { client: Bu, children: [
7829
- t ? /* @__PURE__ */ r(Ou, { ...e }) : /* @__PURE__ */ r(Zo, {}),
7853
+ }), [e, n]), s ? /* @__PURE__ */ u(si, { client: Fu, children: [
7854
+ t ? /* @__PURE__ */ r(Mu, { ...e }) : /* @__PURE__ */ r(Zo, {}),
7830
7855
  /* @__PURE__ */ r(Uu, {})
7831
7856
  ] }) : /* @__PURE__ */ r("div", {});
7832
- }, Pd = () => {
7857
+ }, kd = () => {
7833
7858
  const { user: e, logout: t } = ht(), n = e == null ? void 0 : e.accessToken;
7834
- return _e(
7859
+ return Pe(
7835
7860
  async ({
7836
7861
  url: s,
7837
7862
  method: a = "GET",
@@ -7853,7 +7878,7 @@ const Ou = (e) => {
7853
7878
  body: JSON.stringify(i)
7854
7879
  });
7855
7880
  if (o.status === 401)
7856
- return await t(), null;
7881
+ return console.log("Session expired", o), await t(), null;
7857
7882
  if (o.status === 400)
7858
7883
  throw new Error((await o.json()).error);
7859
7884
  return await o.json();
@@ -7868,67 +7893,67 @@ if (typeof window > "u")
7868
7893
  throw new Error("@chaibuilder/pages is not available on the server");
7869
7894
  export {
7870
7895
  Xr as $,
7871
- Nd as A,
7872
- td as B,
7873
- fd as C,
7874
- pd as D,
7875
- Ie as E,
7876
- od as F,
7896
+ xd as A,
7897
+ sd as B,
7898
+ pd as C,
7899
+ vd as D,
7900
+ ke as E,
7901
+ ud as F,
7877
7902
  dc as G,
7878
7903
  Cu as H,
7879
- cd as I,
7904
+ dd as I,
7880
7905
  wn as J,
7881
- Td as K,
7882
- Ed as L,
7883
- vd as M,
7906
+ _d as K,
7907
+ wd as L,
7908
+ bd as M,
7884
7909
  ot as N,
7885
7910
  Hc as O,
7886
- gd as P,
7887
- yd as Q,
7888
- hd as R,
7889
- ud as S,
7890
- dd as T,
7911
+ yd as P,
7912
+ Ed as Q,
7913
+ fd as R,
7914
+ hd as S,
7915
+ md as T,
7891
7916
  Sn as U,
7892
- rd as V,
7893
- Ju as W,
7894
- ee as X,
7895
- L as Y,
7896
- V as Z,
7897
- _d as _,
7917
+ id as V,
7918
+ td as W,
7919
+ Y as X,
7920
+ k as Y,
7921
+ K as Z,
7922
+ Id as _,
7898
7923
  ia as a,
7899
7924
  Me as a0,
7900
- ed as a1,
7901
- Oe as a2,
7925
+ nd as a1,
7926
+ Re as a2,
7902
7927
  un as a3,
7903
7928
  Un as a4,
7904
- Dt as a5,
7929
+ mt as a5,
7905
7930
  ht as a6,
7906
7931
  $o as a7,
7907
- Pd as a8,
7932
+ kd as a8,
7908
7933
  dn as a9,
7909
- Se as b,
7934
+ Ae as b,
7910
7935
  Ue as c,
7911
7936
  Bc as d,
7912
7937
  ea as e,
7913
7938
  la as f,
7914
- Cd as g,
7939
+ Pd as g,
7915
7940
  Tc as h,
7916
- ad as i,
7941
+ ld as i,
7917
7942
  ct as j,
7918
7943
  Jn as k,
7919
- ld as l,
7920
- xd as m,
7944
+ cd as l,
7945
+ Cd as m,
7921
7946
  jt as n,
7922
- nd as o,
7947
+ rd as o,
7923
7948
  fc as p,
7924
7949
  zc as q,
7925
7950
  es as r,
7926
- Ad as s,
7927
- md as t,
7928
- id as u,
7951
+ Td as s,
7952
+ gd as t,
7953
+ od as u,
7929
7954
  qc as v,
7930
- bd as w,
7931
- wd as x,
7955
+ Sd as w,
7956
+ Nd as x,
7932
7957
  Vc as y,
7933
- Sd as z
7958
+ Ad as z
7934
7959
  };