@chaibuilder/pages 0.4.7 → 0.4.8
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.
- package/dist/{B4MFY5CR-B0gjiEA3.js → B4MFY5CR-BZLbrbU9.js} +1 -1
- package/dist/{B4MFY5CR-0MVmdo7C.cjs → B4MFY5CR-CrFfLRY2.cjs} +1 -1
- package/dist/{HO4MOOFI-r2V7_ve4.cjs → HO4MOOFI-CpUW02ii.cjs} +1 -1
- package/dist/{HO4MOOFI-CIV6iAkb.js → HO4MOOFI-DgTndXY6.js} +2 -2
- package/dist/{HUY7CZI3-Chau07Me.js → HUY7CZI3-B-83eNUU.js} +2 -2
- package/dist/{HUY7CZI3-D-0djGVi.cjs → HUY7CZI3-COZlEkVr.cjs} +1 -1
- package/dist/digital-asset-manager-DZTV3jDX.cjs +1 -0
- package/dist/{digital-asset-manager-CBaY202W.js → digital-asset-manager-cGBJUg2A.js} +104 -104
- package/dist/index-B3cE059x.cjs +2 -0
- package/dist/{index-CSVDtkP9.js → index-CCLkatX6.js} +744 -712
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/digital-asset-manager-BopT8BhD.cjs +0 -1
- package/dist/index-Cv2dcnN-.cjs +0 -2
|
@@ -2,16 +2,16 @@ var ks = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var Ls = (e, t, n) => t.has(e) || ks("Cannot " + n);
|
|
5
|
-
var R = (e, t, n) => (Ls(e, t, "read from private field"), n ? n.call(e) : t.get(e)),
|
|
6
|
-
import { jsx as r, jsxs as u, Fragment as
|
|
7
|
-
import { get as
|
|
5
|
+
var R = (e, t, n) => (Ls(e, t, "read from private field"), n ? n.call(e) : t.get(e)), re = (e, t, n) => t.has(e) ? ks("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), te = (e, t, n, s) => (Ls(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 ne, isEmpty as fe, reverse as Ra, sortBy as Oa, each as Ba, find as ge, set as Ma, has as nn, startsWith as Rt, isEqual as is, map as Fe, toLower as Dt, trim as Fa, filter as Ce, startCase as It, groupBy as qa, compact as Nn, includes as Mt, concat as Zs, endsWith as Js, orderBy as mn, first as Ha, uniq as Ka, debounce as Va, pick as er, keys as ja, pickBy as $a, isArray as za, cloneDeep as Wa, isString as Ds } from "lodash-es";
|
|
8
8
|
import { useAtom as Dn, atom as ls } from "jotai";
|
|
9
|
-
import * as
|
|
10
|
-
import tr, { useMemo as
|
|
11
|
-
import { useQueryClient as
|
|
12
|
-
import { toast as
|
|
9
|
+
import * as ue from "react";
|
|
10
|
+
import tr, { useMemo as Y, useCallback as Ie, useState as P, useEffect as Se, useRef as ut, Suspense as Ya, lazy as Qa } from "react";
|
|
11
|
+
import { useQueryClient as Ne, useQuery as Ae, useMutation as xe, onlineManager as nr, QueryClient as Xa, QueryClientProvider as Za } from "@tanstack/react-query";
|
|
12
|
+
import { toast as $ } from "sonner";
|
|
13
13
|
import { useLanguages as dt, useUpdateBlocksPropsRealtime as sr, PERMISSIONS as Ja, usePartailBlocksStore as ei, usePermissions as sn, useLibraryBlocks as ti, useTheme as ni, mergeClasses as si, useSavePage as rr, useRightPanel as ri, useBlocksStore as ai, getBlocksFromHTML as ii, useTranslation as li, useSidebarActivePanel as oi, registerChaiSidebarPanel as zn, registerChaiTopBar as ci, registerChaiMediaManager as ui, registerChaiSaveToLibrary as di, ChaiBuilderEditor as hi } from "@chaibuilder/sdk";
|
|
14
|
-
import { Card as os, CardHeader as cs, CardTitle as us, CardContent as ds, CardFooter as hs, Button as _, 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
|
|
14
|
+
import { Card as os, CardHeader as cs, CardTitle as us, CardContent as ds, CardFooter as hs, Button as _, 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 ve, Label as Z, Dialog as He, DialogContent as Ke, DialogHeader as Ve, DialogTitle as je, DialogDescription as Ye, Alert as yr, DialogFooter as et, DropdownMenu as rn, DropdownMenuTrigger as an, DropdownMenuContent as ln, DropdownMenuItem as De, Textarea as Gt, Select as mi, SelectTrigger as fi, SelectValue as gi, SelectContent as pi, SelectItem as yi, Badge as qn, Sheet as vr, SheetContent as Er, SheetHeader as br, SheetTitle as wr, Separator as vi, TooltipProvider as Sr, Tooltip as ms, SheetTrigger as Ei, TooltipTrigger as fs, ScrollArea as bi, TooltipContent as gs, Skeleton as fn, DropdownMenuSeparator as wi, CardDescription as Si, Command as Ni, CommandInput as Ai, CommandList as xi, CommandEmpty as Ti, CommandGroup as Ci, CommandItem as Gs, AlertDescription as Pi, Accordion as _i, AccordionItem as gn, AccordionTrigger as pn, AccordionContent as yn, HoverCard as Ii, HoverCardTrigger as ki, HoverCardContent as Li } from "@chaibuilder/sdk/ui";
|
|
15
15
|
import { LockIcon as Nr, UserIcon as Di, AlertTriangleIcon as Gi, Trash2 as Ar, Plus as ps, ImageIcon as xr, X as Tr, AlertCircle as Cr, StarIcon as Ui, MoreHorizontal as ys, PencilIcon as Ri, Power as Pr, TrashIcon as Oi, Tag as Bi, File as on, Search as Mi, StarsIcon as Fi, Globe as qi, Pencil as Hi, Trash as vs, SquareLibrary as Us, Logs as Ki, Loader as _r, Languages as Vi, ChevronDown as Ir, Star as ji, History as Rs, ArrowUpRight as $i, Clock as zi, Undo2 as kr, CloudOff as Wi, Edit as Yi, Save as Lr, GlobeIcon as Qi, Eye as Dr, Palette as Xi, CheckCircle as Zi, Send as Os, Rocket as Bs, Settings as Ji, ExternalLink as el, EyeOff as tl, Loader2 as Gr, LanguagesIcon as nl, DatabaseIcon as sl, ChevronLeft as rl, ChevronRight as al, User as il } from "lucide-react";
|
|
16
16
|
import { format as Gn, formatDistanceToNow as ll } from "date-fns";
|
|
17
17
|
import { useRegisteredChaiBlocks as ol, getDefaultBlockProps as cl } from "@chaibuilder/runtime";
|
|
@@ -252,7 +252,7 @@ const qe = {
|
|
|
252
252
|
DELETE_ASSET: "DELETE_ASSET",
|
|
253
253
|
UPDATE_ASSET: "UPDATE_ASSET",
|
|
254
254
|
GET_ASSETS: "GET_ASSETS"
|
|
255
|
-
},
|
|
255
|
+
}, V = "chaibuilder", Es = async (e, t, n = {}) => await fetch(e, {
|
|
256
256
|
method: "POST",
|
|
257
257
|
headers: {
|
|
258
258
|
"Content-Type": "application/json",
|
|
@@ -380,8 +380,8 @@ const El = vl("__chai_user", null), st = () => {
|
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
382
|
}, bl = () => {
|
|
383
|
-
const { user: e, setUser: t, logout: n } = st(), s = Un(), a =
|
|
384
|
-
return
|
|
383
|
+
const { user: e, setUser: t, logout: n } = st(), s = Un(), a = Ne();
|
|
384
|
+
return Ae({
|
|
385
385
|
queryKey: ["refresh_token"],
|
|
386
386
|
queryFn: async () => {
|
|
387
387
|
const i = await fetch(s, {
|
|
@@ -401,7 +401,7 @@ const El = vl("__chai_user", null), st = () => {
|
|
|
401
401
|
if (i.ok) {
|
|
402
402
|
const l = await i.json();
|
|
403
403
|
t(l), a.invalidateQueries({
|
|
404
|
-
queryKey: [
|
|
404
|
+
queryKey: [V],
|
|
405
405
|
refetchType: "all"
|
|
406
406
|
});
|
|
407
407
|
} else
|
|
@@ -411,11 +411,11 @@ const El = vl("__chai_user", null), st = () => {
|
|
|
411
411
|
enabled: !1
|
|
412
412
|
});
|
|
413
413
|
}, Wu = () => {
|
|
414
|
-
const { user: e } = st(), t = rt("onSessionExpired"), n =
|
|
414
|
+
const { user: e } = st(), t = rt("onSessionExpired"), n = Y(
|
|
415
415
|
() => e == null ? void 0 : e.accessToken,
|
|
416
416
|
[e == null ? void 0 : e.accessToken]
|
|
417
417
|
);
|
|
418
|
-
return
|
|
418
|
+
return Ie(
|
|
419
419
|
async (s, a, i = {}) => {
|
|
420
420
|
if (!n) {
|
|
421
421
|
console.log("no auth token");
|
|
@@ -442,16 +442,16 @@ const El = vl("__chai_user", null), st = () => {
|
|
|
442
442
|
},
|
|
443
443
|
[n, t]
|
|
444
444
|
);
|
|
445
|
-
},
|
|
446
|
-
const { user: e } = st(), t =
|
|
445
|
+
}, z = () => {
|
|
446
|
+
const { user: e } = st(), t = Y(
|
|
447
447
|
() => e == null ? void 0 : e.accessToken,
|
|
448
448
|
[e == null ? void 0 : e.accessToken]
|
|
449
449
|
), { refetch: n } = bl();
|
|
450
|
-
return
|
|
450
|
+
return Ie(
|
|
451
451
|
async (s, a, i = {}) => {
|
|
452
452
|
if (t)
|
|
453
453
|
try {
|
|
454
|
-
const l =
|
|
454
|
+
const l = ne(a, "action", "").toLowerCase(), o = await Es(
|
|
455
455
|
s + (l ? `?action=${l}` : ""),
|
|
456
456
|
a,
|
|
457
457
|
{
|
|
@@ -469,18 +469,18 @@ const El = vl("__chai_user", null), st = () => {
|
|
|
469
469
|
[t, n]
|
|
470
470
|
);
|
|
471
471
|
}, Ur = () => {
|
|
472
|
-
const e =
|
|
473
|
-
return
|
|
472
|
+
const e = X(), t = Ne(), n = z();
|
|
473
|
+
return xe({
|
|
474
474
|
mutationFn: async (s) => n(e, { action: I.RELEASE_LOCK, data: s }),
|
|
475
475
|
onSuccess: () => {
|
|
476
476
|
t.invalidateQueries({
|
|
477
|
-
queryKey: [
|
|
477
|
+
queryKey: [V, I.GET_DRAFT_PAGE]
|
|
478
478
|
});
|
|
479
479
|
}
|
|
480
480
|
});
|
|
481
481
|
}, Rr = () => {
|
|
482
|
-
const e =
|
|
483
|
-
return
|
|
482
|
+
const e = X(), t = Ne(), n = z();
|
|
483
|
+
return xe({
|
|
484
484
|
mutationFn: async (s) => n(e, {
|
|
485
485
|
action: I.UPDATE_WEBSITE_SETTINGS,
|
|
486
486
|
data: s
|
|
@@ -488,26 +488,26 @@ const El = vl("__chai_user", null), st = () => {
|
|
|
488
488
|
onSuccess: (s, a) => {
|
|
489
489
|
var i;
|
|
490
490
|
t.invalidateQueries({
|
|
491
|
-
queryKey: [I.GET_WEBSITE_DRAFT_SETTINGS]
|
|
492
|
-
}), (i = a == null ? void 0 : a.settings) != null && i.theme ||
|
|
491
|
+
queryKey: [V, I.GET_WEBSITE_DRAFT_SETTINGS]
|
|
492
|
+
}), (i = a == null ? void 0 : a.settings) != null && i.theme || $.success("Website settings updated successfully.");
|
|
493
493
|
},
|
|
494
494
|
onError: (s) => {
|
|
495
|
-
|
|
495
|
+
$.error("Failed to update website settings", {
|
|
496
496
|
description: s.message
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
499
|
});
|
|
500
500
|
}, wl = () => {
|
|
501
|
-
const e =
|
|
502
|
-
return
|
|
501
|
+
const e = X(), t = Ne(), n = z();
|
|
502
|
+
return xe({
|
|
503
503
|
mutationFn: async (s) => n(e, { action: I.UPDATE_WEBSITE_DATA, data: s }),
|
|
504
504
|
onSuccess: () => {
|
|
505
505
|
t.invalidateQueries({
|
|
506
|
-
queryKey: [I.GET_WEBSITE_DATA]
|
|
507
|
-
}),
|
|
506
|
+
queryKey: [V, I.GET_WEBSITE_DATA]
|
|
507
|
+
}), $.success("Website data updated successfully.");
|
|
508
508
|
},
|
|
509
509
|
onError: (s) => {
|
|
510
|
-
|
|
510
|
+
$.error("Failed to update website data", {
|
|
511
511
|
description: s.message
|
|
512
512
|
});
|
|
513
513
|
}
|
|
@@ -517,7 +517,7 @@ function Ue() {
|
|
|
517
517
|
const [e, t] = P(
|
|
518
518
|
new URLSearchParams(window.location.search)
|
|
519
519
|
);
|
|
520
|
-
return
|
|
520
|
+
return Se(() => {
|
|
521
521
|
const n = () => {
|
|
522
522
|
t(new URLSearchParams(window.location.search));
|
|
523
523
|
};
|
|
@@ -528,16 +528,16 @@ function Ue() {
|
|
|
528
528
|
}
|
|
529
529
|
const Sl = ls({}), Or = () => Dn(Sl), Nl = () => {
|
|
530
530
|
const [e] = Ue(), t = e.get("page"), n = ut(""), { mutate: s } = Ur();
|
|
531
|
-
|
|
532
|
-
!
|
|
531
|
+
Se(() => {
|
|
532
|
+
!fe(n.current) && t !== n.current && s({ id: n.current }), n.current = t;
|
|
533
533
|
}, [t, s, n]);
|
|
534
534
|
}, rt = (e, t) => {
|
|
535
535
|
const [n] = Or();
|
|
536
|
-
return
|
|
537
|
-
},
|
|
538
|
-
const e =
|
|
539
|
-
return
|
|
540
|
-
queryKey: [
|
|
536
|
+
return ne(n, e, t);
|
|
537
|
+
}, X = () => rt("apiUrl", "/chai/api"), Un = () => rt("usersApiUrl", "/chai/users"), Yu = () => rt("assetsApiUrl", "/chai/assets"), cn = () => {
|
|
538
|
+
const e = X(), [t] = Ue(), n = t.get("page"), s = z();
|
|
539
|
+
return Ae({
|
|
540
|
+
queryKey: [V, I.GET_LANGUAGE_PAGES, n],
|
|
541
541
|
initialData: [],
|
|
542
542
|
queryFn: async () => {
|
|
543
543
|
if (!n) return null;
|
|
@@ -550,8 +550,8 @@ const Sl = ls({}), Or = () => Dn(Sl), Nl = () => {
|
|
|
550
550
|
enabled: !!n
|
|
551
551
|
});
|
|
552
552
|
}, un = () => {
|
|
553
|
-
const e =
|
|
554
|
-
return
|
|
553
|
+
const e = X(), t = z();
|
|
554
|
+
return Ae({
|
|
555
555
|
queryKey: [I.GET_WEBSITE_DRAFT_SETTINGS],
|
|
556
556
|
initialData: {
|
|
557
557
|
theme: {},
|
|
@@ -564,43 +564,43 @@ const Sl = ls({}), Or = () => Dn(Sl), Nl = () => {
|
|
|
564
564
|
})
|
|
565
565
|
});
|
|
566
566
|
}, Br = (e) => {
|
|
567
|
-
const { fallbackLang: t } = dt(), { data: n } = un(), { data: s, isFetching: a } = cn(), i =
|
|
567
|
+
const { fallbackLang: t } = dt(), { data: n } = un(), { data: s, isFetching: a } = cn(), i = Y(() => {
|
|
568
568
|
const l = { [t]: !0 };
|
|
569
|
-
return Ba(
|
|
570
|
-
const c =
|
|
569
|
+
return Ba(ne(n, "languages"), (o) => {
|
|
570
|
+
const c = ge(s, { lang: o });
|
|
571
571
|
l[o] = !!c;
|
|
572
572
|
}), l;
|
|
573
573
|
}, [t, s, n]);
|
|
574
|
-
return a ||
|
|
574
|
+
return a || fe(e) || e && i[e];
|
|
575
575
|
}, bs = () => {
|
|
576
|
-
const e =
|
|
576
|
+
const e = Ne(), { data: t } = Ae({
|
|
577
577
|
queryKey: ["chaibuilder", I.AI_CONTEXT],
|
|
578
578
|
initialData: "",
|
|
579
579
|
queryFn: () => ""
|
|
580
580
|
});
|
|
581
|
-
return { setAiContext:
|
|
581
|
+
return { setAiContext: Ie(
|
|
582
582
|
(s) => {
|
|
583
583
|
e.setQueryData([I.AI_CONTEXT], s);
|
|
584
584
|
},
|
|
585
585
|
[e]
|
|
586
586
|
), aiContext: t };
|
|
587
587
|
}, Rn = () => {
|
|
588
|
-
const e =
|
|
589
|
-
return
|
|
590
|
-
queryKey: [
|
|
588
|
+
const e = z(), t = X();
|
|
589
|
+
return Ae({
|
|
590
|
+
queryKey: [V, I.GET_WEBSITE_PAGES],
|
|
591
591
|
staleTime: 1e3 * 60 * 5,
|
|
592
592
|
queryFn: async () => e(t, { action: I.GET_WEBSITE_PAGES }) || []
|
|
593
593
|
});
|
|
594
594
|
}, Al = ls({ lastSaved: void 0 }), ws = () => Dn(Al), Re = () => {
|
|
595
595
|
const [e] = Ue(), t = e.get("page"), { data: n, isFetching: s } = Rn();
|
|
596
|
-
return { data:
|
|
597
|
-
() =>
|
|
596
|
+
return { data: Y(
|
|
597
|
+
() => ge(n, { id: t }) || {},
|
|
598
598
|
[n, t]
|
|
599
599
|
), isFetching: s };
|
|
600
600
|
}, dn = (e) => {
|
|
601
|
-
const t = Un(), n =
|
|
602
|
-
return
|
|
603
|
-
queryKey: [
|
|
601
|
+
const t = Un(), n = z();
|
|
602
|
+
return Ae({
|
|
603
|
+
queryKey: [V, "chaiUserInfo", e],
|
|
604
604
|
queryFn: async () => await n(t, {
|
|
605
605
|
action: I.GET_CHAI_USER,
|
|
606
606
|
data: { userId: e }
|
|
@@ -609,15 +609,15 @@ const Sl = ls({}), Or = () => Dn(Sl), Nl = () => {
|
|
|
609
609
|
});
|
|
610
610
|
}, xl = ls(void 0), hn = () => {
|
|
611
611
|
const [e] = Ue(), t = e.get("page"), { user: n } = st(), [s, a] = Dn(xl);
|
|
612
|
-
return
|
|
612
|
+
return Y(() => ({
|
|
613
613
|
isLocked: t && (n == null ? void 0 : n.id) !== s,
|
|
614
614
|
currentEditor: s,
|
|
615
615
|
setCurrentEditor: (i) => a(i)
|
|
616
616
|
}), [n == null ? void 0 : n.id, s, t, a]);
|
|
617
617
|
}, Mr = () => {
|
|
618
|
-
const [e] = Ue(), t = e.get("page"), n =
|
|
619
|
-
return
|
|
620
|
-
queryKey: [
|
|
618
|
+
const [e] = Ue(), t = e.get("page"), n = X(), { setAiContext: s } = bs(), { setCurrentEditor: a } = hn(), [, i] = ws(), l = z();
|
|
619
|
+
return Ae({
|
|
620
|
+
queryKey: [V, I.GET_DRAFT_PAGE, t],
|
|
621
621
|
staleTime: 1 / 0,
|
|
622
622
|
gcTime: 1 / 0,
|
|
623
623
|
queryFn: async () => {
|
|
@@ -627,8 +627,8 @@ const Sl = ls({}), Or = () => Dn(Sl), Nl = () => {
|
|
|
627
627
|
data: { id: t, draft: !0 }
|
|
628
628
|
});
|
|
629
629
|
a(o.currentEditor);
|
|
630
|
-
const c = o.blocks ?? [], h =
|
|
631
|
-
return s(
|
|
630
|
+
const c = o.blocks ?? [], h = ge(c, { _type: "@chai/ai-context" });
|
|
631
|
+
return s(ne(h, "_value", "") || ""), i((g) => ({ ...g, lastSaved: o.lastSaved })), c;
|
|
632
632
|
},
|
|
633
633
|
enabled: !!t
|
|
634
634
|
});
|
|
@@ -636,9 +636,9 @@ const Sl = ls({}), Or = () => Dn(Sl), Nl = () => {
|
|
|
636
636
|
pageType: e,
|
|
637
637
|
lang: t
|
|
638
638
|
}) => {
|
|
639
|
-
const n =
|
|
640
|
-
return
|
|
641
|
-
queryKey: [
|
|
639
|
+
const n = X(), s = z();
|
|
640
|
+
return Ae({
|
|
641
|
+
queryKey: [V, I.GET_BUILDER_PAGE_DATA, e, t],
|
|
642
642
|
initialData: {},
|
|
643
643
|
queryFn: async () => s(n, {
|
|
644
644
|
action: I.GET_BUILDER_PAGE_DATA,
|
|
@@ -717,7 +717,7 @@ function Tl({
|
|
|
717
717
|
] }) });
|
|
718
718
|
}
|
|
719
719
|
const Cl = () => {
|
|
720
|
-
const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Ue(), a = s.get("page"), { mutate: i } = Ur(), { isFetching: l } = Mr(), o =
|
|
720
|
+
const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Ue(), a = s.get("page"), { mutate: i } = Ur(), { isFetching: l } = Mr(), o = Ie(() => {
|
|
721
721
|
i({ id: a });
|
|
722
722
|
}, [a, i]);
|
|
723
723
|
return !e || l ? /* @__PURE__ */ r("div", { className: "" }) : /* @__PURE__ */ r(
|
|
@@ -738,7 +738,7 @@ const Cl = () => {
|
|
|
738
738
|
window.history.pushState({}, "", h), t(o), a(""), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
739
739
|
};
|
|
740
740
|
if (s) return null;
|
|
741
|
-
const l =
|
|
741
|
+
const l = ne(qe, n);
|
|
742
742
|
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(os, { className: "w-full max-w-md mx-auto", children: [
|
|
743
743
|
/* @__PURE__ */ r(cs, { className: "space-y-1", children: /* @__PURE__ */ u(us, { className: "flex items-center gap-2 text-2xl", children: [
|
|
744
744
|
/* @__PURE__ */ r(Nr, { className: "w-6 h-6 text-yellow-500" }),
|
|
@@ -764,8 +764,8 @@ const Cl = () => {
|
|
|
764
764
|
) })
|
|
765
765
|
] }) });
|
|
766
766
|
}, _l = (e) => {
|
|
767
|
-
const t =
|
|
768
|
-
return
|
|
767
|
+
const t = X(), n = z();
|
|
768
|
+
return xe({
|
|
769
769
|
mutationFn: async (s) => n(t, {
|
|
770
770
|
action: I.UPSERT_LIBRARY_ITEM,
|
|
771
771
|
data: s
|
|
@@ -774,15 +774,15 @@ const Cl = () => {
|
|
|
774
774
|
e(s);
|
|
775
775
|
},
|
|
776
776
|
onError: (s) => {
|
|
777
|
-
console.error("Error saving block:", s),
|
|
777
|
+
console.error("Error saving block:", s), $.error("Failed to save block", {
|
|
778
778
|
description: s instanceof Error ? s.message : "Unknown error"
|
|
779
779
|
});
|
|
780
780
|
}
|
|
781
781
|
});
|
|
782
782
|
}, Il = (e) => {
|
|
783
|
-
const t =
|
|
784
|
-
return
|
|
785
|
-
queryKey: [
|
|
783
|
+
const t = X(), n = z();
|
|
784
|
+
return Ae({
|
|
785
|
+
queryKey: [V, "uiBlockDetails", e],
|
|
786
786
|
enabled: !!e,
|
|
787
787
|
// Only run query if blockId is provided
|
|
788
788
|
queryFn: async () => {
|
|
@@ -801,8 +801,8 @@ const Cl = () => {
|
|
|
801
801
|
retry: !1
|
|
802
802
|
});
|
|
803
803
|
}, kl = (e) => {
|
|
804
|
-
const t =
|
|
805
|
-
return
|
|
804
|
+
const t = X(), n = z();
|
|
805
|
+
return xe({
|
|
806
806
|
mutationFn: async (s) => n(t, {
|
|
807
807
|
action: I.DELETE_LIBRARY_ITEM,
|
|
808
808
|
data: { id: s }
|
|
@@ -811,7 +811,7 @@ const Cl = () => {
|
|
|
811
811
|
e();
|
|
812
812
|
},
|
|
813
813
|
onError: (s) => {
|
|
814
|
-
console.error("Error deleting block:", s),
|
|
814
|
+
console.error("Error deleting block:", s), $.error("Failed to delete block", {
|
|
815
815
|
description: s instanceof Error ? s.message : "Unknown error"
|
|
816
816
|
});
|
|
817
817
|
}
|
|
@@ -825,7 +825,7 @@ const Cl = () => {
|
|
|
825
825
|
trigger: i
|
|
826
826
|
}) => {
|
|
827
827
|
const [l, o] = P(!1), c = sr(), h = kl(() => {
|
|
828
|
-
c([e], { _libBlockId: void 0 }),
|
|
828
|
+
c([e], { _libBlockId: void 0 }), $.success("Block deleted successfully"), o(!1), s();
|
|
829
829
|
});
|
|
830
830
|
return /* @__PURE__ */ u(fr, { open: n, onOpenChange: (w) => !w && s(), children: [
|
|
831
831
|
/* @__PURE__ */ r(gr, { asChild: !0, children: i || /* @__PURE__ */ u(
|
|
@@ -926,12 +926,12 @@ const Cl = () => {
|
|
|
926
926
|
}
|
|
927
927
|
);
|
|
928
928
|
}, Gl = () => {
|
|
929
|
-
const e =
|
|
929
|
+
const e = X(), t = z(), n = Ne(), {
|
|
930
930
|
data: s = [],
|
|
931
931
|
isLoading: a,
|
|
932
932
|
error: i
|
|
933
|
-
} =
|
|
934
|
-
queryKey: [
|
|
933
|
+
} = Ae({
|
|
934
|
+
queryKey: [V, "library-groups"],
|
|
935
935
|
queryFn: async () => {
|
|
936
936
|
try {
|
|
937
937
|
return await t(e, {
|
|
@@ -942,7 +942,7 @@ const Cl = () => {
|
|
|
942
942
|
}
|
|
943
943
|
},
|
|
944
944
|
initialData: []
|
|
945
|
-
}), { mutateAsync: l, isPending: o } =
|
|
945
|
+
}), { mutateAsync: l, isPending: o } = xe({
|
|
946
946
|
mutationFn: async (c) => {
|
|
947
947
|
if (!c.trim())
|
|
948
948
|
throw new Error("Group name is required");
|
|
@@ -952,10 +952,12 @@ const Cl = () => {
|
|
|
952
952
|
});
|
|
953
953
|
},
|
|
954
954
|
onSuccess: () => {
|
|
955
|
-
n.invalidateQueries({
|
|
955
|
+
n.invalidateQueries({
|
|
956
|
+
queryKey: [V, "library-groups"]
|
|
957
|
+
}), $.success("Group created successfully");
|
|
956
958
|
},
|
|
957
959
|
onError: (c) => {
|
|
958
|
-
console.error("Error creating group:", c),
|
|
960
|
+
console.error("Error creating group:", c), $.error("Failed to create group", {
|
|
959
961
|
description: c instanceof Error ? c.message : "Unknown error"
|
|
960
962
|
});
|
|
961
963
|
}
|
|
@@ -996,7 +998,7 @@ const Cl = () => {
|
|
|
996
998
|
{ id: "stats", name: "Stats" },
|
|
997
999
|
{ id: "team", name: "Team" },
|
|
998
1000
|
{ id: "timeline", name: "Timeline" }
|
|
999
|
-
]), g =
|
|
1001
|
+
]), g = Y(
|
|
1000
1002
|
() => [
|
|
1001
1003
|
...o,
|
|
1002
1004
|
...c.filter(
|
|
@@ -1010,17 +1012,17 @@ const Cl = () => {
|
|
|
1010
1012
|
const p = { id: y, name: y };
|
|
1011
1013
|
h((S) => [...S, p]), t(p.id), i(""), s(!1);
|
|
1012
1014
|
};
|
|
1013
|
-
|
|
1015
|
+
Se(() => {
|
|
1014
1016
|
n && l.current && l.current.focus();
|
|
1015
1017
|
}, [n]);
|
|
1016
1018
|
const w = (y) => {
|
|
1017
1019
|
y.key === "Enter" && (y.preventDefault(), d());
|
|
1018
1020
|
};
|
|
1019
|
-
return
|
|
1021
|
+
return Se(() => {
|
|
1020
1022
|
e && !g.some((y) => y.id === e) && t("");
|
|
1021
1023
|
}, [e, g, t]), n ? /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1022
1024
|
/* @__PURE__ */ r(
|
|
1023
|
-
|
|
1025
|
+
ve,
|
|
1024
1026
|
{
|
|
1025
1027
|
ref: l,
|
|
1026
1028
|
placeholder: "Enter new group name",
|
|
@@ -1071,13 +1073,13 @@ const Cl = () => {
|
|
|
1071
1073
|
)
|
|
1072
1074
|
] });
|
|
1073
1075
|
}, Rl = 1 * 1024 * 1024, Ol = ({ value: e, onChange: t }) => {
|
|
1074
|
-
const [n, s] = P(!1), a = ut(null), i =
|
|
1076
|
+
const [n, s] = P(!1), a = ut(null), i = Ie(
|
|
1075
1077
|
(c) => {
|
|
1076
1078
|
var g;
|
|
1077
1079
|
const h = (g = c.target.files) == null ? void 0 : g[0];
|
|
1078
1080
|
if (h) {
|
|
1079
1081
|
if (h.size > Rl) {
|
|
1080
|
-
|
|
1082
|
+
$.error("File too large", {
|
|
1081
1083
|
description: `Maximum file size is 1mb. Selected file is ${(h.size / 1024 / 1024).toFixed(2)}MB.`
|
|
1082
1084
|
}), a.current && (a.current.value = "");
|
|
1083
1085
|
return;
|
|
@@ -1089,7 +1091,7 @@ const Cl = () => {
|
|
|
1089
1091
|
t(d.result), s(!1);
|
|
1090
1092
|
}, d.readAsDataURL(h);
|
|
1091
1093
|
} catch (d) {
|
|
1092
|
-
console.error("Error reading file:", d), s(!1),
|
|
1094
|
+
console.error("Error reading file:", d), s(!1), $.error("Failed to process image", {
|
|
1093
1095
|
description: d instanceof Error ? d.message : "Unknown error"
|
|
1094
1096
|
});
|
|
1095
1097
|
}
|
|
@@ -1100,7 +1102,7 @@ const Cl = () => {
|
|
|
1100
1102
|
return /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1101
1103
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1102
1104
|
/* @__PURE__ */ r(
|
|
1103
|
-
|
|
1105
|
+
ve,
|
|
1104
1106
|
{
|
|
1105
1107
|
type: "file",
|
|
1106
1108
|
ref: a,
|
|
@@ -1151,7 +1153,7 @@ const Cl = () => {
|
|
|
1151
1153
|
}
|
|
1152
1154
|
) })
|
|
1153
1155
|
] });
|
|
1154
|
-
},
|
|
1156
|
+
}, de = {
|
|
1155
1157
|
...Ja,
|
|
1156
1158
|
//pages
|
|
1157
1159
|
ADD_PAGE: "add_page",
|
|
@@ -1188,9 +1190,9 @@ const Cl = () => {
|
|
|
1188
1190
|
EDIT_MEDIA: "edit_media",
|
|
1189
1191
|
DELETE_MEDIA: "delete_media"
|
|
1190
1192
|
}, Bl = (e) => {
|
|
1191
|
-
const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = ei(), i = t.find((N) => N._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l, c =
|
|
1193
|
+
const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = ei(), i = t.find((N) => N._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l, c = Y(() => t.some(
|
|
1192
1194
|
(N) => N._type === "PartialBlock" || N._type === "GlobalBlock"
|
|
1193
|
-
), [t]), h =
|
|
1195
|
+
), [t]), h = Y(() => {
|
|
1194
1196
|
let N = [];
|
|
1195
1197
|
for (const C of t)
|
|
1196
1198
|
if (C._type === "PartialBlock" || C._type === "GlobalBlock") {
|
|
@@ -1199,27 +1201,27 @@ const Cl = () => {
|
|
|
1199
1201
|
} else
|
|
1200
1202
|
N.push(C);
|
|
1201
1203
|
return N;
|
|
1202
|
-
}, [t, a]), [g, d] = P(""), [w, y] = P(""), [p, S] = P(""), [v, x] = P(""), [G, E] = P({}), [b, T] = P(!1), [U,
|
|
1203
|
-
M([s], { _libBlockId: void 0 }),
|
|
1204
|
+
}, [t, a]), [g, d] = P(""), [w, y] = P(""), [p, S] = P(""), [v, x] = P(""), [G, E] = P({}), [b, T] = P(!1), [U, ee] = P(o), [le, k] = P(!1), { hasPermission: q } = sn(), A = q(de.DELETE_LIBRARY_BLOCK), M = sr(), se = () => {
|
|
1205
|
+
M([s], { _libBlockId: void 0 }), $.success("Block delinked from library"), n();
|
|
1204
1206
|
}, {
|
|
1205
|
-
data:
|
|
1206
|
-
isLoading:
|
|
1207
|
-
isError:
|
|
1207
|
+
data: me,
|
|
1208
|
+
isLoading: W,
|
|
1209
|
+
isError: he
|
|
1208
1210
|
} = Il(l);
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
}, [
|
|
1212
|
-
|
|
1213
|
-
}, [
|
|
1211
|
+
Se(() => {
|
|
1212
|
+
he && o && (k(!0), ee(!1));
|
|
1213
|
+
}, [he, o]), Se(() => {
|
|
1214
|
+
me && !W && (d(me.name || ""), y(me.group || ""), S(me.description || ""), x(me.preview || ""), ee(!1));
|
|
1215
|
+
}, [me, W]), Se(() => {
|
|
1214
1216
|
const N = g.trim().length >= 2, C = w.trim() !== "";
|
|
1215
1217
|
T(N && C && !c);
|
|
1216
1218
|
}, [g, w, c]);
|
|
1217
1219
|
const F = () => {
|
|
1218
1220
|
const N = {};
|
|
1219
1221
|
return g.trim() ? g.length < 2 && (N.name = "Name must be at least 2 characters") : N.name = "Name is required", w || (N.group = "Group is required"), E(N), Object.keys(N).length === 0 && !c;
|
|
1220
|
-
}, { resetLibrary:
|
|
1222
|
+
}, { resetLibrary: be } = ti({ id: "" }), Qe = _l(
|
|
1221
1223
|
(N) => {
|
|
1222
|
-
o || M([s], { _libBlockId: N.id }),
|
|
1224
|
+
o || M([s], { _libBlockId: N.id }), $.success(`Block ${o ? "updated" : "saved"} successfully`), be(N.library), n();
|
|
1223
1225
|
}
|
|
1224
1226
|
), f = async (N) => {
|
|
1225
1227
|
if (N.preventDefault(), !F()) return;
|
|
@@ -1235,12 +1237,12 @@ const Cl = () => {
|
|
|
1235
1237
|
...o ? { id: l } : {}
|
|
1236
1238
|
});
|
|
1237
1239
|
}, m = Qe.isPending;
|
|
1238
|
-
return U ||
|
|
1240
|
+
return U || W ? /* @__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" }) }) : le ? /* @__PURE__ */ u("div", { className: "p-6 space-y-4", children: [
|
|
1239
1241
|
/* @__PURE__ */ r("div", { className: "text-destructive font-medium", children: "Block Not Found" }),
|
|
1240
1242
|
/* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: "This block could not be found on the server. It may have been deleted." }),
|
|
1241
1243
|
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-4", children: [
|
|
1242
1244
|
/* @__PURE__ */ r(_, { type: "button", variant: "outline", onClick: n, children: "Cancel" }),
|
|
1243
|
-
/* @__PURE__ */ r(_, { onClick:
|
|
1245
|
+
/* @__PURE__ */ r(_, { onClick: se, variant: "destructive", children: "Delink Block" })
|
|
1244
1246
|
] })
|
|
1245
1247
|
] }) : /* @__PURE__ */ u("div", { children: [
|
|
1246
1248
|
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: [
|
|
@@ -1253,7 +1255,7 @@ const Cl = () => {
|
|
|
1253
1255
|
/* @__PURE__ */ u("form", { onSubmit: f, className: "space-y-4", children: [
|
|
1254
1256
|
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1255
1257
|
/* @__PURE__ */ r(
|
|
1256
|
-
|
|
1258
|
+
Z,
|
|
1257
1259
|
{
|
|
1258
1260
|
htmlFor: "name",
|
|
1259
1261
|
className: G.name ? "text-destructive" : "",
|
|
@@ -1261,7 +1263,7 @@ const Cl = () => {
|
|
|
1261
1263
|
}
|
|
1262
1264
|
),
|
|
1263
1265
|
/* @__PURE__ */ r(
|
|
1264
|
-
|
|
1266
|
+
ve,
|
|
1265
1267
|
{
|
|
1266
1268
|
id: "name",
|
|
1267
1269
|
placeholder: "Enter block name",
|
|
@@ -1274,7 +1276,7 @@ const Cl = () => {
|
|
|
1274
1276
|
] }),
|
|
1275
1277
|
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1276
1278
|
/* @__PURE__ */ r(
|
|
1277
|
-
|
|
1279
|
+
Z,
|
|
1278
1280
|
{
|
|
1279
1281
|
htmlFor: "group",
|
|
1280
1282
|
className: G.group ? "text-destructive" : "",
|
|
@@ -1285,9 +1287,9 @@ const Cl = () => {
|
|
|
1285
1287
|
G.group && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: G.group })
|
|
1286
1288
|
] }),
|
|
1287
1289
|
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1288
|
-
/* @__PURE__ */ r(
|
|
1290
|
+
/* @__PURE__ */ r(Z, { htmlFor: "description", children: "Description (optional)" }),
|
|
1289
1291
|
/* @__PURE__ */ r(
|
|
1290
|
-
|
|
1292
|
+
ve,
|
|
1291
1293
|
{
|
|
1292
1294
|
id: "description",
|
|
1293
1295
|
placeholder: "Enter a brief description",
|
|
@@ -1298,7 +1300,7 @@ const Cl = () => {
|
|
|
1298
1300
|
)
|
|
1299
1301
|
] }),
|
|
1300
1302
|
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1301
|
-
/* @__PURE__ */ r(
|
|
1303
|
+
/* @__PURE__ */ r(Z, { htmlFor: "previewImage", children: "Preview Image (optional)" }),
|
|
1302
1304
|
/* @__PURE__ */ r(Ol, { value: v, onChange: x }),
|
|
1303
1305
|
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: "max 1mb" })
|
|
1304
1306
|
] }),
|
|
@@ -1379,21 +1381,21 @@ const Cl = () => {
|
|
|
1379
1381
|
}, Ml = {
|
|
1380
1382
|
SLUG_ALREADY_USED: "This slug is already in use. Please choose a different one."
|
|
1381
1383
|
}, ke = () => {
|
|
1382
|
-
const e =
|
|
1383
|
-
return
|
|
1384
|
-
queryKey: [
|
|
1384
|
+
const e = X(), t = z();
|
|
1385
|
+
return Ae({
|
|
1386
|
+
queryKey: [V, I.GET_PAGE_TYPES],
|
|
1385
1387
|
initialData: [],
|
|
1386
1388
|
queryFn: async () => t(e, { action: I.GET_PAGE_TYPES })
|
|
1387
1389
|
});
|
|
1388
1390
|
}, Fl = (e) => {
|
|
1389
1391
|
const { data: t } = ke();
|
|
1390
|
-
return
|
|
1392
|
+
return Y(
|
|
1391
1393
|
() => t == null ? void 0 : t.find((n) => n.key === e),
|
|
1392
1394
|
[t, e]
|
|
1393
1395
|
);
|
|
1394
1396
|
}, ql = () => {
|
|
1395
|
-
const e =
|
|
1396
|
-
return
|
|
1397
|
+
const e = X(), t = z();
|
|
1398
|
+
return xe({
|
|
1397
1399
|
mutationFn: async ({ pageType: n, query: s }) => {
|
|
1398
1400
|
try {
|
|
1399
1401
|
return t(e, {
|
|
@@ -1409,46 +1411,54 @@ const Cl = () => {
|
|
|
1409
1411
|
}
|
|
1410
1412
|
});
|
|
1411
1413
|
}, qr = () => {
|
|
1412
|
-
const e =
|
|
1413
|
-
return
|
|
1414
|
+
const e = X(), t = Ne(), n = z(), { data: s } = ke();
|
|
1415
|
+
return xe({
|
|
1414
1416
|
mutationFn: async (a) => (a.template && console.log("Creating page from template:", a.template), n(e, { action: I.CREATE_PAGE, data: a })),
|
|
1415
1417
|
onSuccess: (a, i) => {
|
|
1416
1418
|
var o;
|
|
1417
1419
|
i && (i != null && i.primaryPage) ? t.invalidateQueries({
|
|
1418
|
-
queryKey: [
|
|
1420
|
+
queryKey: [
|
|
1421
|
+
V,
|
|
1422
|
+
I.GET_LANGUAGE_PAGES,
|
|
1423
|
+
i == null ? void 0 : i.primaryPage
|
|
1424
|
+
]
|
|
1419
1425
|
}) : t.invalidateQueries({
|
|
1420
|
-
queryKey: [I.GET_WEBSITE_PAGES]
|
|
1426
|
+
queryKey: [V, I.GET_WEBSITE_PAGES]
|
|
1421
1427
|
});
|
|
1422
|
-
const l = i.template ? `Page created from "${i.template.name}" template` : i.hasSlug === !1 ? "New " + ((o =
|
|
1423
|
-
|
|
1428
|
+
const l = i.template ? `Page created from "${i.template.name}" template` : i.hasSlug === !1 ? "New " + ((o = ge(s, { key: i.pageType })) == null ? void 0 : o.name) + " added successfully" : "New page added successfully";
|
|
1429
|
+
$.success(l);
|
|
1424
1430
|
},
|
|
1425
1431
|
onError: (a, i) => {
|
|
1426
|
-
const l =
|
|
1427
|
-
|
|
1432
|
+
const l = ge(s, { key: i.pageType });
|
|
1433
|
+
$.error(
|
|
1428
1434
|
`Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`,
|
|
1429
1435
|
{
|
|
1430
|
-
description:
|
|
1436
|
+
description: ne(Ml, a.message, a.message)
|
|
1431
1437
|
}
|
|
1432
1438
|
);
|
|
1433
1439
|
}
|
|
1434
1440
|
});
|
|
1435
1441
|
}, Ss = () => {
|
|
1436
|
-
const e =
|
|
1437
|
-
return
|
|
1442
|
+
const e = X(), t = Ne(), n = z(), { data: s } = ke();
|
|
1443
|
+
return xe({
|
|
1438
1444
|
mutationFn: async (a) => await n(e, {
|
|
1439
1445
|
action: I.UPDATE_PAGE,
|
|
1440
1446
|
data: a
|
|
1441
1447
|
}),
|
|
1442
1448
|
onSuccess: (a, i) => {
|
|
1443
1449
|
i && (i != null && i.primaryPage || i != null && i.seo) ? t.invalidateQueries({
|
|
1444
|
-
queryKey: [
|
|
1450
|
+
queryKey: [
|
|
1451
|
+
V,
|
|
1452
|
+
I.GET_LANGUAGE_PAGES,
|
|
1453
|
+
i == null ? void 0 : i.primaryPage
|
|
1454
|
+
]
|
|
1445
1455
|
}) : t.invalidateQueries({
|
|
1446
|
-
queryKey: [I.GET_WEBSITE_PAGES]
|
|
1456
|
+
queryKey: [V, I.GET_WEBSITE_PAGES]
|
|
1447
1457
|
});
|
|
1448
1458
|
},
|
|
1449
1459
|
onError: (a, i) => {
|
|
1450
|
-
const l =
|
|
1451
|
-
|
|
1460
|
+
const l = ge(s, { key: i.pageType });
|
|
1461
|
+
$.error(
|
|
1452
1462
|
`Failed to update ${l != null && l.hasSlug ? "page" : l.name}.`,
|
|
1453
1463
|
{
|
|
1454
1464
|
description: a.message
|
|
@@ -1457,28 +1467,32 @@ const Cl = () => {
|
|
|
1457
1467
|
}
|
|
1458
1468
|
});
|
|
1459
1469
|
}, Hl = () => {
|
|
1460
|
-
const e =
|
|
1461
|
-
return
|
|
1470
|
+
const e = X(), t = Ne(), n = z(), { data: s } = ke();
|
|
1471
|
+
return xe({
|
|
1462
1472
|
mutationFn: async (a) => n(e, {
|
|
1463
1473
|
action: I.DELETE_PAGE,
|
|
1464
1474
|
data: { id: a == null ? void 0 : a.id }
|
|
1465
1475
|
}),
|
|
1466
1476
|
onSuccess: (a, i) => {
|
|
1467
1477
|
if (a.code === "PAGE_LOCKED") {
|
|
1468
|
-
|
|
1478
|
+
$.error("Delete not allowed", {
|
|
1469
1479
|
description: "Page is currently being edited by another user."
|
|
1470
1480
|
});
|
|
1471
1481
|
return;
|
|
1472
1482
|
}
|
|
1473
1483
|
i && (i != null && i.primaryPage) ? t.invalidateQueries({
|
|
1474
|
-
queryKey: [
|
|
1484
|
+
queryKey: [
|
|
1485
|
+
V,
|
|
1486
|
+
I.GET_LANGUAGE_PAGES,
|
|
1487
|
+
i == null ? void 0 : i.primaryPage
|
|
1488
|
+
]
|
|
1475
1489
|
}) : t.invalidateQueries({
|
|
1476
|
-
queryKey: [I.GET_WEBSITE_PAGES]
|
|
1490
|
+
queryKey: [V, I.GET_WEBSITE_PAGES]
|
|
1477
1491
|
});
|
|
1478
1492
|
},
|
|
1479
1493
|
onError: (a, i) => {
|
|
1480
|
-
const l =
|
|
1481
|
-
|
|
1494
|
+
const l = ge(s, { key: i.pageType });
|
|
1495
|
+
$.error(
|
|
1482
1496
|
`Failed to delete ${l != null && l.hasSlug ? "page" : l.name}.`,
|
|
1483
1497
|
{
|
|
1484
1498
|
description: a.message
|
|
@@ -1487,26 +1501,30 @@ const Cl = () => {
|
|
|
1487
1501
|
}
|
|
1488
1502
|
});
|
|
1489
1503
|
}, Kl = () => {
|
|
1490
|
-
const e =
|
|
1491
|
-
return
|
|
1504
|
+
const e = X(), t = Ne(), n = z(), { data: s } = ke();
|
|
1505
|
+
return xe({
|
|
1492
1506
|
mutationFn: async (a) => n(e, {
|
|
1493
1507
|
action: I.TAKE_OFFLINE,
|
|
1494
1508
|
data: { id: a == null ? void 0 : a.id }
|
|
1495
1509
|
}),
|
|
1496
1510
|
onSuccess: (a, i) => {
|
|
1497
1511
|
i && (i != null && i.primaryPage) ? t.invalidateQueries({
|
|
1498
|
-
queryKey: [
|
|
1512
|
+
queryKey: [
|
|
1513
|
+
V,
|
|
1514
|
+
I.GET_LANGUAGE_PAGES,
|
|
1515
|
+
i == null ? void 0 : i.primaryPage
|
|
1516
|
+
]
|
|
1499
1517
|
}) : t.invalidateQueries({
|
|
1500
|
-
queryKey: [I.GET_WEBSITE_PAGES]
|
|
1518
|
+
queryKey: [V, I.GET_WEBSITE_PAGES]
|
|
1501
1519
|
});
|
|
1502
|
-
const l =
|
|
1503
|
-
|
|
1520
|
+
const l = ge(s, { key: i.pageType });
|
|
1521
|
+
$.success(
|
|
1504
1522
|
l != null && l.hasSlug ? B.PAGE_UNPUBLISH_SUCCESS : "New " + l.name + " added successfully."
|
|
1505
1523
|
);
|
|
1506
1524
|
},
|
|
1507
1525
|
onError: (a, i) => {
|
|
1508
|
-
const l =
|
|
1509
|
-
|
|
1526
|
+
const l = ge(s, { key: i.pageType });
|
|
1527
|
+
$.error(
|
|
1510
1528
|
`Failed to take offline ${l != null && l.hasSlug ? "page" : l.name}.`,
|
|
1511
1529
|
{
|
|
1512
1530
|
description: a.message
|
|
@@ -1515,24 +1533,28 @@ const Cl = () => {
|
|
|
1515
1533
|
}
|
|
1516
1534
|
});
|
|
1517
1535
|
}, Ns = () => {
|
|
1518
|
-
const e =
|
|
1519
|
-
return
|
|
1536
|
+
const e = X(), t = z(), n = Ne(), { data: s } = Re();
|
|
1537
|
+
return xe({
|
|
1520
1538
|
mutationFn: async ({ ids: a }) => t(e, {
|
|
1521
1539
|
action: I.PUBLISH_CHANGES,
|
|
1522
1540
|
data: { ids: a }
|
|
1523
1541
|
}),
|
|
1524
1542
|
onSuccess: () => {
|
|
1525
|
-
n.invalidateQueries({
|
|
1526
|
-
queryKey: [
|
|
1543
|
+
n.invalidateQueries({
|
|
1544
|
+
queryKey: [V, I.GET_CHANGES]
|
|
1545
|
+
}), n.invalidateQueries({
|
|
1546
|
+
queryKey: [V, I.GET_WEBSITE_PAGES]
|
|
1547
|
+
}), n.invalidateQueries({
|
|
1548
|
+
queryKey: [V, I.GET_LANGUAGE_PAGES, s == null ? void 0 : s.id]
|
|
1527
1549
|
});
|
|
1528
1550
|
},
|
|
1529
1551
|
onError: () => {
|
|
1530
|
-
|
|
1552
|
+
$.error("Failed to publish pages.");
|
|
1531
1553
|
}
|
|
1532
1554
|
});
|
|
1533
1555
|
}, Vl = () => {
|
|
1534
|
-
const e =
|
|
1535
|
-
return
|
|
1556
|
+
const e = X(), t = z(), n = Ne();
|
|
1557
|
+
return xe({
|
|
1536
1558
|
mutationFn: async (s) => {
|
|
1537
1559
|
var a;
|
|
1538
1560
|
return t(e, {
|
|
@@ -1547,42 +1569,46 @@ const Cl = () => {
|
|
|
1547
1569
|
});
|
|
1548
1570
|
},
|
|
1549
1571
|
onSuccess: () => {
|
|
1550
|
-
n.invalidateQueries({
|
|
1572
|
+
n.invalidateQueries({
|
|
1573
|
+
queryKey: [V, I.GET_WEBSITE_PAGES]
|
|
1574
|
+
}), $.success("Page marked as template successfully.");
|
|
1551
1575
|
},
|
|
1552
1576
|
onError: () => {
|
|
1553
|
-
|
|
1577
|
+
$.error("Failed to mark page as template.");
|
|
1554
1578
|
}
|
|
1555
1579
|
});
|
|
1556
1580
|
}, jl = () => {
|
|
1557
|
-
const e =
|
|
1558
|
-
return
|
|
1581
|
+
const e = X(), t = z(), n = Ne();
|
|
1582
|
+
return xe({
|
|
1559
1583
|
mutationFn: async (s) => t(e, {
|
|
1560
1584
|
action: I.UNMARK_AS_TEMPLATE,
|
|
1561
1585
|
data: { id: s == null ? void 0 : s.id }
|
|
1562
1586
|
}),
|
|
1563
1587
|
onSuccess: () => {
|
|
1564
|
-
n.invalidateQueries({
|
|
1588
|
+
n.invalidateQueries({
|
|
1589
|
+
queryKey: [V, I.GET_WEBSITE_PAGES]
|
|
1590
|
+
}), $.success("Page unmarked as template successfully.");
|
|
1565
1591
|
},
|
|
1566
1592
|
onError: () => {
|
|
1567
|
-
|
|
1593
|
+
$.error("Failed to unmark page as template.");
|
|
1568
1594
|
}
|
|
1569
1595
|
});
|
|
1570
1596
|
}, $l = () => {
|
|
1571
|
-
const e =
|
|
1572
|
-
return
|
|
1597
|
+
const e = X(), t = z(), n = Ne();
|
|
1598
|
+
return xe({
|
|
1573
1599
|
mutationFn: async ({ id: s, slug: a }) => t(e, {
|
|
1574
1600
|
action: I.CHANGE_SLUG,
|
|
1575
1601
|
data: { id: s, slug: a }
|
|
1576
1602
|
}),
|
|
1577
1603
|
onSuccess: (s, { primaryPage: a }) => {
|
|
1578
|
-
|
|
1579
|
-
queryKey: [I.GET_LANGUAGE_PAGES, a]
|
|
1604
|
+
$.success(B.SLUG_CHANGE_SUCCESS), a ? n.invalidateQueries({
|
|
1605
|
+
queryKey: [V, I.GET_LANGUAGE_PAGES, a]
|
|
1580
1606
|
}) : n.invalidateQueries({
|
|
1581
|
-
queryKey: [I.GET_WEBSITE_PAGES]
|
|
1607
|
+
queryKey: [V, I.GET_WEBSITE_PAGES]
|
|
1582
1608
|
});
|
|
1583
1609
|
},
|
|
1584
1610
|
onError: () => {
|
|
1585
|
-
|
|
1611
|
+
$.error("Failed to change slug");
|
|
1586
1612
|
}
|
|
1587
1613
|
});
|
|
1588
1614
|
};
|
|
@@ -1625,8 +1651,8 @@ var As = {};
|
|
|
1625
1651
|
var f = Math.floor(16.666666666666668), m, N, C = {}, D = 0;
|
|
1626
1652
|
return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (m = function(H) {
|
|
1627
1653
|
var K = Math.random();
|
|
1628
|
-
return C[K] = requestAnimationFrame(function L(
|
|
1629
|
-
D ===
|
|
1654
|
+
return C[K] = requestAnimationFrame(function L(j) {
|
|
1655
|
+
D === j || D + f - 1 < j ? (D = j, delete C[K], H()) : C[K] = requestAnimationFrame(L);
|
|
1630
1656
|
}), K;
|
|
1631
1657
|
}, N = function(H) {
|
|
1632
1658
|
C[H] && cancelAnimationFrame(C[H]);
|
|
@@ -1642,17 +1668,17 @@ var As = {};
|
|
|
1642
1668
|
D.postMessage({ options: K || {}, callback: L });
|
|
1643
1669
|
}
|
|
1644
1670
|
D.init = function(L) {
|
|
1645
|
-
var
|
|
1646
|
-
D.postMessage({ canvas:
|
|
1647
|
-
}, D.fire = function(L,
|
|
1671
|
+
var j = L.transferControlToOffscreen();
|
|
1672
|
+
D.postMessage({ canvas: j }, [j]);
|
|
1673
|
+
}, D.fire = function(L, j, oe) {
|
|
1648
1674
|
if (m)
|
|
1649
1675
|
return H(L, null), m;
|
|
1650
|
-
var
|
|
1651
|
-
return m = h(function(
|
|
1652
|
-
function
|
|
1653
|
-
|
|
1676
|
+
var pe = Math.random().toString(36).slice(2);
|
|
1677
|
+
return m = h(function(ce) {
|
|
1678
|
+
function ye(Te) {
|
|
1679
|
+
Te.data.callback === pe && (delete N[pe], D.removeEventListener("message", ye), m = null, g.clear(), oe(), ce());
|
|
1654
1680
|
}
|
|
1655
|
-
D.addEventListener("message",
|
|
1681
|
+
D.addEventListener("message", ye), H(L, pe), N[pe] = ye.bind(null, { data: { callback: pe } });
|
|
1656
1682
|
}), m;
|
|
1657
1683
|
}, D.reset = function() {
|
|
1658
1684
|
D.postMessage({ reset: !0 });
|
|
@@ -1758,10 +1784,10 @@ var As = {};
|
|
|
1758
1784
|
var m = v(f, "origin", Object);
|
|
1759
1785
|
return m.x = v(m, "x", Number), m.y = v(m, "y", Number), m;
|
|
1760
1786
|
}
|
|
1761
|
-
function
|
|
1787
|
+
function ee(f) {
|
|
1762
1788
|
f.width = document.documentElement.clientWidth, f.height = document.documentElement.clientHeight;
|
|
1763
1789
|
}
|
|
1764
|
-
function
|
|
1790
|
+
function le(f) {
|
|
1765
1791
|
var m = f.getBoundingClientRect();
|
|
1766
1792
|
f.width = m.width, f.height = m.height;
|
|
1767
1793
|
}
|
|
@@ -1769,8 +1795,8 @@ var As = {};
|
|
|
1769
1795
|
var m = document.createElement("canvas");
|
|
1770
1796
|
return m.style.position = "fixed", m.style.top = "0px", m.style.left = "0px", m.style.pointerEvents = "none", m.style.zIndex = f, m;
|
|
1771
1797
|
}
|
|
1772
|
-
function q(f, m, N, C, D, H, K, L,
|
|
1773
|
-
f.save(), f.translate(m, N), f.rotate(H), f.scale(C, D), f.arc(0, 0, 1, K, L,
|
|
1798
|
+
function q(f, m, N, C, D, H, K, L, j) {
|
|
1799
|
+
f.save(), f.translate(m, N), f.rotate(H), f.scale(C, D), f.arc(0, 0, 1, K, L, j), f.restore();
|
|
1774
1800
|
}
|
|
1775
1801
|
function A(f) {
|
|
1776
1802
|
var m = f.angle * (Math.PI / 180), N = f.spread * (Math.PI / 180);
|
|
@@ -1813,58 +1839,58 @@ var As = {};
|
|
|
1813
1839
|
Math.PI / 10 * m.wobble
|
|
1814
1840
|
));
|
|
1815
1841
|
else if (m.shape.type === "bitmap") {
|
|
1816
|
-
var L = Math.PI / 10 * m.wobble,
|
|
1817
|
-
Math.cos(L) *
|
|
1818
|
-
Math.sin(L) *
|
|
1819
|
-
-Math.sin(L) *
|
|
1820
|
-
Math.cos(L) *
|
|
1842
|
+
var L = Math.PI / 10 * m.wobble, j = Math.abs(H - C) * 0.1, oe = Math.abs(K - D) * 0.1, pe = m.shape.bitmap.width * m.scalar, ce = m.shape.bitmap.height * m.scalar, ye = new DOMMatrix([
|
|
1843
|
+
Math.cos(L) * j,
|
|
1844
|
+
Math.sin(L) * j,
|
|
1845
|
+
-Math.sin(L) * oe,
|
|
1846
|
+
Math.cos(L) * oe,
|
|
1821
1847
|
m.x,
|
|
1822
1848
|
m.y
|
|
1823
1849
|
]);
|
|
1824
|
-
|
|
1825
|
-
var
|
|
1826
|
-
|
|
1827
|
-
m.x -
|
|
1828
|
-
m.y -
|
|
1829
|
-
|
|
1830
|
-
|
|
1850
|
+
ye.multiplySelf(new DOMMatrix(m.shape.matrix));
|
|
1851
|
+
var Te = f.createPattern(g.transform(m.shape.bitmap), "no-repeat");
|
|
1852
|
+
Te.setTransform(ye), f.globalAlpha = 1 - N, f.fillStyle = Te, f.fillRect(
|
|
1853
|
+
m.x - pe / 2,
|
|
1854
|
+
m.y - ce / 2,
|
|
1855
|
+
pe,
|
|
1856
|
+
ce
|
|
1831
1857
|
), f.globalAlpha = 1;
|
|
1832
1858
|
} else if (m.shape === "circle")
|
|
1833
1859
|
f.ellipse ? f.ellipse(m.x, m.y, Math.abs(H - C) * m.ovalScalar, Math.abs(K - D) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI) : q(f, m.x, m.y, Math.abs(H - C) * m.ovalScalar, Math.abs(K - D) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI);
|
|
1834
1860
|
else if (m.shape === "star")
|
|
1835
|
-
for (var
|
|
1836
|
-
Me = m.x + Math.cos(
|
|
1861
|
+
for (var Q = Math.PI / 2 * 3, Le = 4 * m.scalar, Be = 8 * m.scalar, Me = m.x, Xe = m.y, at = 5, $e = Math.PI / at; at--; )
|
|
1862
|
+
Me = m.x + Math.cos(Q) * Be, Xe = m.y + Math.sin(Q) * Be, f.lineTo(Me, Xe), Q += $e, Me = m.x + Math.cos(Q) * Le, Xe = m.y + Math.sin(Q) * Le, f.lineTo(Me, Xe), Q += $e;
|
|
1837
1863
|
else
|
|
1838
1864
|
f.moveTo(Math.floor(m.x), Math.floor(m.y)), f.lineTo(Math.floor(m.wobbleX), Math.floor(D)), f.lineTo(Math.floor(H), Math.floor(K)), f.lineTo(Math.floor(C), Math.floor(m.wobbleY));
|
|
1839
1865
|
return f.closePath(), f.fill(), m.tick < m.totalTicks;
|
|
1840
1866
|
}
|
|
1841
|
-
function
|
|
1842
|
-
var H = m.slice(), K = f.getContext("2d"), L,
|
|
1843
|
-
function
|
|
1844
|
-
L =
|
|
1867
|
+
function se(f, m, N, C, D) {
|
|
1868
|
+
var H = m.slice(), K = f.getContext("2d"), L, j, oe = h(function(pe) {
|
|
1869
|
+
function ce() {
|
|
1870
|
+
L = j = null, K.clearRect(0, 0, C.width, C.height), g.clear(), D(), pe();
|
|
1845
1871
|
}
|
|
1846
|
-
function
|
|
1847
|
-
s && !(C.width === a.width && C.height === a.height) && (C.width = f.width = a.width, C.height = f.height = a.height), !C.width && !C.height && (N(f), C.width = f.width, C.height = f.height), K.clearRect(0, 0, C.width, C.height), H = H.filter(function(
|
|
1848
|
-
return M(K,
|
|
1849
|
-
}), H.length ? L = d.frame(
|
|
1872
|
+
function ye() {
|
|
1873
|
+
s && !(C.width === a.width && C.height === a.height) && (C.width = f.width = a.width, C.height = f.height = a.height), !C.width && !C.height && (N(f), C.width = f.width, C.height = f.height), K.clearRect(0, 0, C.width, C.height), H = H.filter(function(Te) {
|
|
1874
|
+
return M(K, Te);
|
|
1875
|
+
}), H.length ? L = d.frame(ye) : ce();
|
|
1850
1876
|
}
|
|
1851
|
-
L = d.frame(
|
|
1877
|
+
L = d.frame(ye), j = ce;
|
|
1852
1878
|
});
|
|
1853
1879
|
return {
|
|
1854
|
-
addFettis: function(
|
|
1855
|
-
return H = H.concat(
|
|
1880
|
+
addFettis: function(pe) {
|
|
1881
|
+
return H = H.concat(pe), oe;
|
|
1856
1882
|
},
|
|
1857
1883
|
canvas: f,
|
|
1858
|
-
promise:
|
|
1884
|
+
promise: oe,
|
|
1859
1885
|
reset: function() {
|
|
1860
|
-
L && d.cancel(L),
|
|
1886
|
+
L && d.cancel(L), j && j();
|
|
1861
1887
|
}
|
|
1862
1888
|
};
|
|
1863
1889
|
}
|
|
1864
|
-
function
|
|
1865
|
-
var N = !f, C = !!v(m || {}, "resize"), D = !1, H = v(m, "disableForReducedMotion", Boolean), K = i && !!v(m || {}, "useWorker"), L = K ? w() : null,
|
|
1866
|
-
function
|
|
1867
|
-
for (var Me = v(
|
|
1890
|
+
function me(f, m) {
|
|
1891
|
+
var N = !f, C = !!v(m || {}, "resize"), D = !1, H = v(m, "disableForReducedMotion", Boolean), K = i && !!v(m || {}, "useWorker"), L = K ? w() : null, j = N ? ee : le, oe = f && L ? !!f.__confetti_initialized : !1, pe = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, ce;
|
|
1892
|
+
function ye(Q, Le, Be) {
|
|
1893
|
+
for (var Me = v(Q, "particleCount", x), Xe = v(Q, "angle", Number), at = v(Q, "spread", Number), $e = v(Q, "startVelocity", Number), Pa = v(Q, "decay", Number), _a = v(Q, "gravity", Number), Ia = v(Q, "drift", Number), Cs = v(Q, "colors", b), ka = v(Q, "ticks", Number), Ps = v(Q, "shapes"), La = v(Q, "scalar"), Da = !!v(Q, "flat"), _s = U(Q), Is = Me, Fn = [], Ga = f.width * _s.x, Ua = f.height * _s.y; Is--; )
|
|
1868
1894
|
Fn.push(
|
|
1869
1895
|
A({
|
|
1870
1896
|
x: Ga,
|
|
@@ -1882,20 +1908,20 @@ var As = {};
|
|
|
1882
1908
|
flat: Da
|
|
1883
1909
|
})
|
|
1884
1910
|
);
|
|
1885
|
-
return
|
|
1911
|
+
return ce ? ce.addFettis(Fn) : (ce = se(f, Fn, j, Le, Be), ce.promise);
|
|
1886
1912
|
}
|
|
1887
|
-
function
|
|
1888
|
-
var Le = H || v(
|
|
1889
|
-
if (Le &&
|
|
1913
|
+
function Te(Q) {
|
|
1914
|
+
var Le = H || v(Q, "disableForReducedMotion", Boolean), Be = v(Q, "zIndex", Number);
|
|
1915
|
+
if (Le && pe)
|
|
1890
1916
|
return h(function($e) {
|
|
1891
1917
|
$e();
|
|
1892
1918
|
});
|
|
1893
|
-
N &&
|
|
1919
|
+
N && ce ? f = ce.canvas : N && !f && (f = k(Be), document.body.appendChild(f)), C && !oe && j(f);
|
|
1894
1920
|
var Me = {
|
|
1895
1921
|
width: f.width,
|
|
1896
1922
|
height: f.height
|
|
1897
1923
|
};
|
|
1898
|
-
L && !
|
|
1924
|
+
L && !oe && L.init(f), oe = !0, L && (f.__confetti_initialized = !0);
|
|
1899
1925
|
function Xe() {
|
|
1900
1926
|
if (L) {
|
|
1901
1927
|
var $e = {
|
|
@@ -1904,7 +1930,7 @@ var As = {};
|
|
|
1904
1930
|
return f.getBoundingClientRect();
|
|
1905
1931
|
}
|
|
1906
1932
|
};
|
|
1907
|
-
|
|
1933
|
+
j($e), L.postMessage({
|
|
1908
1934
|
resize: {
|
|
1909
1935
|
width: $e.width,
|
|
1910
1936
|
height: $e.height
|
|
@@ -1915,50 +1941,50 @@ var As = {};
|
|
|
1915
1941
|
Me.width = Me.height = null;
|
|
1916
1942
|
}
|
|
1917
1943
|
function at() {
|
|
1918
|
-
|
|
1944
|
+
ce = null, C && (D = !1, t.removeEventListener("resize", Xe)), N && f && (document.body.contains(f) && document.body.removeChild(f), f = null, oe = !1);
|
|
1919
1945
|
}
|
|
1920
|
-
return C && !D && (D = !0, t.addEventListener("resize", Xe, !1)), L ? L.fire(
|
|
1946
|
+
return C && !D && (D = !0, t.addEventListener("resize", Xe, !1)), L ? L.fire(Q, Me, at) : ye(Q, Me, at);
|
|
1921
1947
|
}
|
|
1922
|
-
return
|
|
1923
|
-
L && L.reset(),
|
|
1924
|
-
},
|
|
1948
|
+
return Te.reset = function() {
|
|
1949
|
+
L && L.reset(), ce && ce.reset();
|
|
1950
|
+
}, Te;
|
|
1925
1951
|
}
|
|
1926
|
-
var
|
|
1927
|
-
function
|
|
1928
|
-
return
|
|
1952
|
+
var W;
|
|
1953
|
+
function he() {
|
|
1954
|
+
return W || (W = me(null, { useWorker: !0, resize: !0 })), W;
|
|
1929
1955
|
}
|
|
1930
1956
|
function F(f, m, N, C, D, H, K) {
|
|
1931
|
-
var L = new Path2D(f),
|
|
1932
|
-
|
|
1933
|
-
var
|
|
1934
|
-
return
|
|
1957
|
+
var L = new Path2D(f), j = new Path2D();
|
|
1958
|
+
j.addPath(L, new DOMMatrix(m));
|
|
1959
|
+
var oe = new Path2D();
|
|
1960
|
+
return oe.addPath(j, new DOMMatrix([
|
|
1935
1961
|
Math.cos(K) * D,
|
|
1936
1962
|
Math.sin(K) * D,
|
|
1937
1963
|
-Math.sin(K) * H,
|
|
1938
1964
|
Math.cos(K) * H,
|
|
1939
1965
|
N,
|
|
1940
1966
|
C
|
|
1941
|
-
])),
|
|
1967
|
+
])), oe;
|
|
1942
1968
|
}
|
|
1943
|
-
function
|
|
1969
|
+
function be(f) {
|
|
1944
1970
|
if (!l)
|
|
1945
1971
|
throw new Error("path confetti are not supported in this browser");
|
|
1946
1972
|
var m, N;
|
|
1947
1973
|
typeof f == "string" ? m = f : (m = f.path, N = f.matrix);
|
|
1948
1974
|
var C = new Path2D(m), D = document.createElement("canvas"), H = D.getContext("2d");
|
|
1949
1975
|
if (!N) {
|
|
1950
|
-
for (var K = 1e3, L = K,
|
|
1951
|
-
for (var
|
|
1952
|
-
H.isPointInPath(C,
|
|
1953
|
-
|
|
1954
|
-
var Le = 10, Be = Math.min(Le /
|
|
1976
|
+
for (var K = 1e3, L = K, j = K, oe = 0, pe = 0, ce, ye, Te = 0; Te < K; Te += 2)
|
|
1977
|
+
for (var Q = 0; Q < K; Q += 2)
|
|
1978
|
+
H.isPointInPath(C, Te, Q, "nonzero") && (L = Math.min(L, Te), j = Math.min(j, Q), oe = Math.max(oe, Te), pe = Math.max(pe, Q));
|
|
1979
|
+
ce = oe - L, ye = pe - j;
|
|
1980
|
+
var Le = 10, Be = Math.min(Le / ce, Le / ye);
|
|
1955
1981
|
N = [
|
|
1956
1982
|
Be,
|
|
1957
1983
|
0,
|
|
1958
1984
|
0,
|
|
1959
1985
|
Be,
|
|
1960
|
-
-Math.round(
|
|
1961
|
-
-Math.round(
|
|
1986
|
+
-Math.round(ce / 2 + L) * Be,
|
|
1987
|
+
-Math.round(ye / 2 + j) * Be
|
|
1962
1988
|
];
|
|
1963
1989
|
}
|
|
1964
1990
|
return {
|
|
@@ -1970,23 +1996,23 @@ var As = {};
|
|
|
1970
1996
|
function Qe(f) {
|
|
1971
1997
|
var m, N = 1, C = "#000000", D = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
|
|
1972
1998
|
typeof f == "string" ? m = f : (m = f.text, N = "scalar" in f ? f.scalar : N, D = "fontFamily" in f ? f.fontFamily : D, C = "color" in f ? f.color : C);
|
|
1973
|
-
var H = 10 * N, K = "" + H + "px " + D, L = new OffscreenCanvas(H, H),
|
|
1974
|
-
|
|
1975
|
-
var
|
|
1976
|
-
|
|
1999
|
+
var H = 10 * N, K = "" + H + "px " + D, L = new OffscreenCanvas(H, H), j = L.getContext("2d");
|
|
2000
|
+
j.font = K;
|
|
2001
|
+
var oe = j.measureText(m), pe = Math.ceil(oe.actualBoundingBoxRight + oe.actualBoundingBoxLeft), ce = Math.ceil(oe.actualBoundingBoxAscent + oe.actualBoundingBoxDescent), ye = 2, Te = oe.actualBoundingBoxLeft + ye, Q = oe.actualBoundingBoxAscent + ye;
|
|
2002
|
+
pe += ye + ye, ce += ye + ye, L = new OffscreenCanvas(pe, ce), j = L.getContext("2d"), j.font = K, j.fillStyle = C, j.fillText(m, Te, Q);
|
|
1977
2003
|
var Le = 1 / N;
|
|
1978
2004
|
return {
|
|
1979
2005
|
type: "bitmap",
|
|
1980
2006
|
// TODO these probably need to be transfered for workers
|
|
1981
2007
|
bitmap: L.transferToImageBitmap(),
|
|
1982
|
-
matrix: [Le, 0, 0, Le, -
|
|
2008
|
+
matrix: [Le, 0, 0, Le, -pe * Le / 2, -ce * Le / 2]
|
|
1983
2009
|
};
|
|
1984
2010
|
}
|
|
1985
2011
|
n.exports = function() {
|
|
1986
|
-
return
|
|
2012
|
+
return he().apply(this, arguments);
|
|
1987
2013
|
}, n.exports.reset = function() {
|
|
1988
|
-
|
|
1989
|
-
}, n.exports.create =
|
|
2014
|
+
he().reset();
|
|
2015
|
+
}, n.exports.create = me, n.exports.shapeFromPath = be, n.exports.shapeFromText = Qe;
|
|
1990
2016
|
})(/* @__PURE__ */ function() {
|
|
1991
2017
|
return typeof window < "u" ? window : typeof self < "u" ? self : this || {};
|
|
1992
2018
|
}(), As, !1);
|
|
@@ -2049,9 +2075,9 @@ const Wl = {
|
|
|
2049
2075
|
page: e,
|
|
2050
2076
|
onClose: t
|
|
2051
2077
|
}) => {
|
|
2052
|
-
const [n, s] = P(e.slug || ""), { mutate: a, isPending: i } = $l(), { data: l } = ke(), o =
|
|
2078
|
+
const [n, s] = P(e.slug || ""), { mutate: a, isPending: i } = $l(), { data: l } = ke(), o = ge(l, { key: e == null ? void 0 : e.pageType }), c = (g) => {
|
|
2053
2079
|
if (g.preventDefault(), !(e != null && e.primaryPage) && Object.keys(qe).some((y) => n === `/${y}` || Rt(n, `/${y}/`))) {
|
|
2054
|
-
|
|
2080
|
+
$.error("Error", {
|
|
2055
2081
|
description: "Slugs cannot start with a language code for primary page"
|
|
2056
2082
|
});
|
|
2057
2083
|
return;
|
|
@@ -2085,7 +2111,7 @@ const Wl = {
|
|
|
2085
2111
|
] })
|
|
2086
2112
|
] }),
|
|
2087
2113
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2088
|
-
/* @__PURE__ */ u(
|
|
2114
|
+
/* @__PURE__ */ u(Z, { htmlFor: "slug", className: "text-right", children: [
|
|
2089
2115
|
"Slug",
|
|
2090
2116
|
" ",
|
|
2091
2117
|
/* @__PURE__ */ u("small", { className: "font-light text-gray-500", children: [
|
|
@@ -2094,7 +2120,7 @@ const Wl = {
|
|
|
2094
2120
|
] })
|
|
2095
2121
|
] }),
|
|
2096
2122
|
/* @__PURE__ */ r(
|
|
2097
|
-
|
|
2123
|
+
ve,
|
|
2098
2124
|
{
|
|
2099
2125
|
id: "slug",
|
|
2100
2126
|
value: n,
|
|
@@ -2148,7 +2174,7 @@ function Hr({
|
|
|
2148
2174
|
e.lang && /* @__PURE__ */ u("div", { className: "py-2 text-sm", children: [
|
|
2149
2175
|
"Language:",
|
|
2150
2176
|
" ",
|
|
2151
|
-
/* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children:
|
|
2177
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children: ne(qe, e.lang, e.lang) })
|
|
2152
2178
|
] })
|
|
2153
2179
|
] })
|
|
2154
2180
|
] }),
|
|
@@ -2209,7 +2235,7 @@ const Oe = ({
|
|
|
2209
2235
|
onClose: t,
|
|
2210
2236
|
languages: n
|
|
2211
2237
|
}) => {
|
|
2212
|
-
const { data: s } = Re(), { data: a } = ke(), [i, l] = P(e.name || ""), [o, c] = P(e.edit ? e.lang : ""), [h, g] = P(e.edit ? e.slug : ""), { mutate: d, isPending: w } = qr(), { mutate: y, isPending: p } = Ss(), S =
|
|
2238
|
+
const { data: s } = Re(), { data: a } = ke(), [i, l] = P(e.name || ""), [o, c] = P(e.edit ? e.lang : ""), [h, g] = P(e.edit ? e.slug : ""), { mutate: d, isPending: w } = qr(), { mutate: y, isPending: p } = Ss(), S = Y(
|
|
2213
2239
|
() => a == null ? void 0 : a.find(
|
|
2214
2240
|
(E) => E.key === e.pageType
|
|
2215
2241
|
),
|
|
@@ -2233,28 +2259,28 @@ const Oe = ({
|
|
|
2233
2259
|
/* @__PURE__ */ u("form", { onSubmit: G, children: [
|
|
2234
2260
|
/* @__PURE__ */ u("div", { className: "grid gap-4 py-4", children: [
|
|
2235
2261
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2236
|
-
/* @__PURE__ */ r(
|
|
2262
|
+
/* @__PURE__ */ r(Z, { htmlFor: "lang", className: "text-right", children: B.LANGUAGE }),
|
|
2237
2263
|
/* @__PURE__ */ u(
|
|
2238
2264
|
"select",
|
|
2239
2265
|
{
|
|
2240
2266
|
value: o,
|
|
2241
|
-
disabled: e.edit ||
|
|
2267
|
+
disabled: e.edit || fe(n),
|
|
2242
2268
|
onChange: (E) => {
|
|
2243
2269
|
const b = E.target.value;
|
|
2244
2270
|
c(b), !v && g(`/${b}`);
|
|
2245
2271
|
},
|
|
2246
2272
|
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",
|
|
2247
2273
|
children: [
|
|
2248
|
-
/* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ?
|
|
2249
|
-
Fe(n, (E) => /* @__PURE__ */ r("option", { value: E, children:
|
|
2274
|
+
/* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ? ne(qe, e.lang, e.lang) : fe(n) ? B.ALL_AVAILABLE_LANGUAGE_PAGE : B.CHOOSE_LANGUAGE }),
|
|
2275
|
+
Fe(n, (E) => /* @__PURE__ */ r("option", { value: E, children: ne(qe, E, E) }, E))
|
|
2250
2276
|
]
|
|
2251
2277
|
}
|
|
2252
2278
|
)
|
|
2253
2279
|
] }),
|
|
2254
2280
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2255
|
-
/* @__PURE__ */ r(
|
|
2281
|
+
/* @__PURE__ */ r(Z, { htmlFor: "slug", className: "text-right", children: B.PAGE_NAME }),
|
|
2256
2282
|
/* @__PURE__ */ r(
|
|
2257
|
-
|
|
2283
|
+
ve,
|
|
2258
2284
|
{
|
|
2259
2285
|
id: "name",
|
|
2260
2286
|
value: i,
|
|
@@ -2266,13 +2292,13 @@ const Oe = ({
|
|
|
2266
2292
|
)
|
|
2267
2293
|
] }),
|
|
2268
2294
|
!v && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2269
|
-
/* @__PURE__ */ u(
|
|
2295
|
+
/* @__PURE__ */ u(Z, { htmlFor: "slug", className: "text-right", children: [
|
|
2270
2296
|
B.SLUG,
|
|
2271
2297
|
" ",
|
|
2272
2298
|
/* @__PURE__ */ r("small", { className: "font-light", children: B.SLUG_SHOULD_START_WITH })
|
|
2273
2299
|
] }),
|
|
2274
2300
|
/* @__PURE__ */ r(
|
|
2275
|
-
|
|
2301
|
+
ve,
|
|
2276
2302
|
{
|
|
2277
2303
|
id: "slug",
|
|
2278
2304
|
value: h,
|
|
@@ -2283,9 +2309,9 @@ const Oe = ({
|
|
|
2283
2309
|
className: "col-span-3",
|
|
2284
2310
|
required: !0,
|
|
2285
2311
|
pattern: "^/.*",
|
|
2286
|
-
disabled:
|
|
2312
|
+
disabled: fe(o),
|
|
2287
2313
|
title: B.SLUG_MUST_START_WITH,
|
|
2288
|
-
placeholder:
|
|
2314
|
+
placeholder: fe(o) ? B.CHOOSE_LANGUAGE_TO_ADD_SLUG : B.ENTER_PAGE_SLUG
|
|
2289
2315
|
}
|
|
2290
2316
|
)
|
|
2291
2317
|
] })
|
|
@@ -2301,9 +2327,9 @@ const Oe = ({
|
|
|
2301
2327
|
] })
|
|
2302
2328
|
] }) });
|
|
2303
2329
|
}, Zl = () => {
|
|
2304
|
-
const [e, t] = P(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = dt(), { data: i, isFetching: l } = cn(), { data: o } = Re(), [c, h] = P(null), [g, d] = P(null), [w, y] = P(null), { data: p } = un(), S =
|
|
2305
|
-
|
|
2306
|
-
(v) => !
|
|
2330
|
+
const [e, t] = P(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = dt(), { data: i, isFetching: l } = cn(), { data: o } = Re(), [c, h] = P(null), [g, d] = P(null), [w, y] = P(null), { data: p } = un(), S = Ce(
|
|
2331
|
+
ne(p, "languages") || ["en"],
|
|
2332
|
+
(v) => !ge(i, { lang: v }) && v !== ne(p, "fallbackLang")
|
|
2307
2333
|
);
|
|
2308
2334
|
return /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
2309
2335
|
/* @__PURE__ */ r("ul", { className: "space-y-2", children: l ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
|
|
@@ -2312,7 +2338,7 @@ const Oe = ({
|
|
|
2312
2338
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
2313
2339
|
] }) : Fe(i, (v) => {
|
|
2314
2340
|
const x = v.lang, G = v.slug, E = !v.primaryPage;
|
|
2315
|
-
return /* @__PURE__ */ u(
|
|
2341
|
+
return /* @__PURE__ */ u(we, { children: [
|
|
2316
2342
|
/* @__PURE__ */ u(
|
|
2317
2343
|
"li",
|
|
2318
2344
|
{
|
|
@@ -2331,7 +2357,7 @@ const Oe = ({
|
|
|
2331
2357
|
className: `w-2.5 h-2.5 rounded-full ${v.online ? "bg-green-300" : "bg-gray-300"}`
|
|
2332
2358
|
}
|
|
2333
2359
|
),
|
|
2334
|
-
|
|
2360
|
+
ne(qe, E ? s : x, x)
|
|
2335
2361
|
]
|
|
2336
2362
|
}
|
|
2337
2363
|
),
|
|
@@ -2357,9 +2383,9 @@ const Oe = ({
|
|
|
2357
2383
|
Oe,
|
|
2358
2384
|
{
|
|
2359
2385
|
permissions: [
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2386
|
+
de.EDIT_PAGE,
|
|
2387
|
+
de.DELETE_PAGE,
|
|
2388
|
+
de.UNPUBLISH_PAGE
|
|
2363
2389
|
],
|
|
2364
2390
|
children: /* @__PURE__ */ u(rn, { children: [
|
|
2365
2391
|
/* @__PURE__ */ r(
|
|
@@ -2387,7 +2413,7 @@ const Oe = ({
|
|
|
2387
2413
|
/* @__PURE__ */ r(
|
|
2388
2414
|
Oe,
|
|
2389
2415
|
{
|
|
2390
|
-
permissions: [
|
|
2416
|
+
permissions: [de.EDIT_PAGE],
|
|
2391
2417
|
children: /* @__PURE__ */ u(
|
|
2392
2418
|
De,
|
|
2393
2419
|
{
|
|
@@ -2406,7 +2432,7 @@ const Oe = ({
|
|
|
2406
2432
|
/* @__PURE__ */ r(
|
|
2407
2433
|
Oe,
|
|
2408
2434
|
{
|
|
2409
|
-
permissions: [
|
|
2435
|
+
permissions: [de.UNPUBLISH_PAGE],
|
|
2410
2436
|
children: (v == null ? void 0 : v.online) && /* @__PURE__ */ u(
|
|
2411
2437
|
De,
|
|
2412
2438
|
{
|
|
@@ -2425,7 +2451,7 @@ const Oe = ({
|
|
|
2425
2451
|
/* @__PURE__ */ r(
|
|
2426
2452
|
Oe,
|
|
2427
2453
|
{
|
|
2428
|
-
permissions: [
|
|
2454
|
+
permissions: [de.DELETE_PAGE],
|
|
2429
2455
|
children: /* @__PURE__ */ u(
|
|
2430
2456
|
De,
|
|
2431
2457
|
{
|
|
@@ -2454,12 +2480,12 @@ const Oe = ({
|
|
|
2454
2480
|
/* @__PURE__ */ r("div", { className: "h-1 w-full border-b" })
|
|
2455
2481
|
] });
|
|
2456
2482
|
}) }),
|
|
2457
|
-
/* @__PURE__ */ r(Oe, { permissions: [
|
|
2483
|
+
/* @__PURE__ */ r(Oe, { permissions: [de.ADD_PAGE], children: /* @__PURE__ */ r("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ r(
|
|
2458
2484
|
_,
|
|
2459
2485
|
{
|
|
2460
2486
|
variant: "default",
|
|
2461
2487
|
size: "sm",
|
|
2462
|
-
disabled:
|
|
2488
|
+
disabled: fe(S),
|
|
2463
2489
|
onClick: () => {
|
|
2464
2490
|
t({
|
|
2465
2491
|
name: o == null ? void 0 : o.name,
|
|
@@ -2504,13 +2530,13 @@ function Jl({
|
|
|
2504
2530
|
className: s = "w-full rounded-md border border-gray-300 px-3 py-2",
|
|
2505
2531
|
id: a = "parentPage"
|
|
2506
2532
|
}) {
|
|
2507
|
-
const i =
|
|
2533
|
+
const i = Y(() => !e || e.length === 0 ? [] : e.filter((g) => !fe(g.slug)).filter((g) => g.slug !== "/").sort((g, d) => g.slug.localeCompare(d.slug)), [e]), l = (h) => Math.max(0, (h.match(/\//g) || []).length - 1), o = (h) => " ".repeat(h), c = (h) => {
|
|
2508
2534
|
if (h === "/") return "/";
|
|
2509
2535
|
const g = h.split("/").filter(Boolean);
|
|
2510
2536
|
return g.length <= 1 ? `/${g[0] || ""}` : `/${g[g.length - 1]}`;
|
|
2511
2537
|
};
|
|
2512
2538
|
return /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2513
|
-
/* @__PURE__ */ r(
|
|
2539
|
+
/* @__PURE__ */ r(Z, { htmlFor: a, className: "text-sm", children: "Parent" }),
|
|
2514
2540
|
/* @__PURE__ */ u(
|
|
2515
2541
|
"select",
|
|
2516
2542
|
{
|
|
@@ -2543,7 +2569,7 @@ const eo = ({
|
|
|
2543
2569
|
isLoading: s = !1
|
|
2544
2570
|
}) => {
|
|
2545
2571
|
const [a, i] = P("");
|
|
2546
|
-
if (
|
|
2572
|
+
if (Se(() => {
|
|
2547
2573
|
if (t) {
|
|
2548
2574
|
const o = e.find((c) => c.id === t);
|
|
2549
2575
|
i((o == null ? void 0 : o.preview) || "");
|
|
@@ -2585,33 +2611,33 @@ const eo = ({
|
|
|
2585
2611
|
] })
|
|
2586
2612
|
] });
|
|
2587
2613
|
}, to = () => {
|
|
2588
|
-
const e =
|
|
2589
|
-
return
|
|
2590
|
-
queryKey: [
|
|
2614
|
+
const e = X(), t = z();
|
|
2615
|
+
return Ae({
|
|
2616
|
+
queryKey: [V, I.GET_LIBRARIES],
|
|
2591
2617
|
queryFn: async () => await t(e, { action: I.GET_LIBRARIES }) || []
|
|
2592
2618
|
});
|
|
2593
2619
|
}, no = (e) => {
|
|
2594
|
-
const t =
|
|
2595
|
-
return
|
|
2596
|
-
queryKey: [
|
|
2620
|
+
const t = X(), n = z();
|
|
2621
|
+
return Ae({
|
|
2622
|
+
queryKey: [V, I.GET_TEMPLATES_BY_TYPE, e],
|
|
2597
2623
|
enabled: !!e,
|
|
2598
2624
|
queryFn: async () => {
|
|
2599
2625
|
const s = await n(t, {
|
|
2600
2626
|
action: I.GET_TEMPLATES_BY_TYPE,
|
|
2601
2627
|
data: { pageType: e }
|
|
2602
2628
|
});
|
|
2603
|
-
return (e ?
|
|
2629
|
+
return (e ? Ce(s, { pageType: e }) : s) || [];
|
|
2604
2630
|
}
|
|
2605
2631
|
});
|
|
2606
2632
|
}, so = (e) => {
|
|
2607
|
-
const { data: t = [], isLoading: n } = no(e), { data: s = [], isLoading: a } = to(), i =
|
|
2608
|
-
const c =
|
|
2633
|
+
const { data: t = [], isLoading: n } = no(e), { data: s = [], isLoading: a } = to(), i = Y(() => n || a ? [] : t.map((o) => {
|
|
2634
|
+
const c = ge(s, { id: o.library });
|
|
2609
2635
|
return {
|
|
2610
2636
|
...o,
|
|
2611
2637
|
libraryName: (c == null ? void 0 : c.type) !== "shared" ? "Site Library" : (c == null ? void 0 : c.name) + " Library",
|
|
2612
2638
|
libraryType: c == null ? void 0 : c.type
|
|
2613
2639
|
};
|
|
2614
|
-
}), [t, s, n, a]), l =
|
|
2640
|
+
}), [t, s, n, a]), l = Y(() => qa(i, "libraryName"), [i]);
|
|
2615
2641
|
return {
|
|
2616
2642
|
data: i,
|
|
2617
2643
|
groupedData: l,
|
|
@@ -2623,7 +2649,7 @@ function ro({
|
|
|
2623
2649
|
additionalPageTypes: t = [],
|
|
2624
2650
|
close: n
|
|
2625
2651
|
}) {
|
|
2626
|
-
var
|
|
2652
|
+
var be, Qe;
|
|
2627
2653
|
const s = !!(e != null && e.id), { data: a } = Rn(), { mutate: i, isPending: l } = qr(), { mutate: o, isPending: c } = Ss(), [h, g] = P(null), [d, w] = P(
|
|
2628
2654
|
(e == null ? void 0 : e.pageType) ?? "page"
|
|
2629
2655
|
), [y, p] = P(
|
|
@@ -2636,17 +2662,17 @@ function ro({
|
|
|
2636
2662
|
((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""
|
|
2637
2663
|
), [T, U] = P(
|
|
2638
2664
|
(e == null ? void 0 : e.dynamic) ?? !1
|
|
2639
|
-
), [
|
|
2665
|
+
), [ee, le] = P(""), { data: k, isLoading: q } = so(d), A = l || c, M = t.find(
|
|
2640
2666
|
(f) => f.key === d
|
|
2641
|
-
),
|
|
2642
|
-
w(f), v(""), b(""), U(!1),
|
|
2667
|
+
), se = (f) => {
|
|
2668
|
+
w(f), v(""), b(""), U(!1), le(""), p(
|
|
2643
2669
|
t.find(
|
|
2644
2670
|
(m) => m.key === f
|
|
2645
2671
|
)
|
|
2646
2672
|
);
|
|
2647
|
-
},
|
|
2673
|
+
}, me = (f) => {
|
|
2648
2674
|
U(f), f && b("");
|
|
2649
|
-
},
|
|
2675
|
+
}, W = (f) => {
|
|
2650
2676
|
if (v(f), f && f !== "none") {
|
|
2651
2677
|
const m = a == null ? void 0 : a.find(
|
|
2652
2678
|
(C) => C.id === f
|
|
@@ -2658,8 +2684,8 @@ function ro({
|
|
|
2658
2684
|
b(E.replace(/^\/+/, ""));
|
|
2659
2685
|
} else
|
|
2660
2686
|
b(E ? `${E}` : "");
|
|
2661
|
-
},
|
|
2662
|
-
|
|
2687
|
+
}, he = (f) => {
|
|
2688
|
+
le(f);
|
|
2663
2689
|
}, F = (f) => {
|
|
2664
2690
|
if (f.preventDefault(), E.length > 0 && !T && !E.match(/^[a-zA-Z0-9-_]+$/)) {
|
|
2665
2691
|
g("Slug can only contain letters, numbers, and hyphens");
|
|
@@ -2670,7 +2696,7 @@ function ro({
|
|
|
2670
2696
|
return;
|
|
2671
2697
|
}
|
|
2672
2698
|
if (!x.trim()) {
|
|
2673
|
-
|
|
2699
|
+
$.error("Name is required");
|
|
2674
2700
|
return;
|
|
2675
2701
|
}
|
|
2676
2702
|
if (!(y != null && y.hasSlug)) {
|
|
@@ -2685,7 +2711,7 @@ function ro({
|
|
|
2685
2711
|
{ id: e == null ? void 0 : e.id, name: x },
|
|
2686
2712
|
{
|
|
2687
2713
|
onSuccess: () => {
|
|
2688
|
-
|
|
2714
|
+
$.success((y == null ? void 0 : y.name) + " updated successfully"), n();
|
|
2689
2715
|
}
|
|
2690
2716
|
}
|
|
2691
2717
|
);
|
|
@@ -2700,14 +2726,14 @@ function ro({
|
|
|
2700
2726
|
}
|
|
2701
2727
|
if (S && S !== "none") {
|
|
2702
2728
|
if (!E.trim() && !T) {
|
|
2703
|
-
|
|
2729
|
+
$.error("Child page slug is required");
|
|
2704
2730
|
return;
|
|
2705
2731
|
}
|
|
2706
2732
|
const m = a == null ? void 0 : a.find(
|
|
2707
2733
|
(L) => L.id === S
|
|
2708
2734
|
), N = (m == null ? void 0 : m.slug) || "", C = N === "/" ? `/${E}` : `${N}/${E}`;
|
|
2709
2735
|
if (Object.keys(qe).some((L) => C === `/${L}` || (C == null ? void 0 : C.startsWith(`/${L}/`)))) {
|
|
2710
|
-
|
|
2736
|
+
$.error("Slugs cannot start with a language code for primary page");
|
|
2711
2737
|
return;
|
|
2712
2738
|
}
|
|
2713
2739
|
const K = {
|
|
@@ -2718,14 +2744,14 @@ function ro({
|
|
|
2718
2744
|
parent: S,
|
|
2719
2745
|
dynamic: T,
|
|
2720
2746
|
hasSlug: !0,
|
|
2721
|
-
templateId:
|
|
2747
|
+
templateId: ee || void 0
|
|
2722
2748
|
};
|
|
2723
2749
|
if (s) {
|
|
2724
2750
|
o(
|
|
2725
2751
|
{ id: e == null ? void 0 : e.id, ...K },
|
|
2726
2752
|
{
|
|
2727
2753
|
onSuccess: () => {
|
|
2728
|
-
|
|
2754
|
+
$.success("Page updated successfully"), n();
|
|
2729
2755
|
}
|
|
2730
2756
|
}
|
|
2731
2757
|
);
|
|
@@ -2741,14 +2767,14 @@ function ro({
|
|
|
2741
2767
|
pageType: d,
|
|
2742
2768
|
name: x,
|
|
2743
2769
|
slug: E === "" ? "/" : `/${E.replace(/\/$/, "")}`,
|
|
2744
|
-
template:
|
|
2770
|
+
template: ee || void 0
|
|
2745
2771
|
};
|
|
2746
2772
|
if (s) {
|
|
2747
2773
|
o(
|
|
2748
2774
|
{ id: e == null ? void 0 : e.id, ...m },
|
|
2749
2775
|
{
|
|
2750
2776
|
onSuccess: () => {
|
|
2751
|
-
|
|
2777
|
+
$.success("Page updated successfully"), n();
|
|
2752
2778
|
}
|
|
2753
2779
|
}
|
|
2754
2780
|
);
|
|
@@ -2763,14 +2789,14 @@ function ro({
|
|
|
2763
2789
|
};
|
|
2764
2790
|
return y != null && y.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: F, className: "w-full max-w-md mx-auto space-y-4", children: [
|
|
2765
2791
|
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2766
|
-
/* @__PURE__ */ r(
|
|
2792
|
+
/* @__PURE__ */ r(Z, { htmlFor: "pageType", className: "text-sm", children: "Page Type" }),
|
|
2767
2793
|
/* @__PURE__ */ u(
|
|
2768
2794
|
"select",
|
|
2769
2795
|
{
|
|
2770
2796
|
id: "pageType",
|
|
2771
2797
|
value: d,
|
|
2772
2798
|
disabled: s,
|
|
2773
|
-
onChange: (f) =>
|
|
2799
|
+
onChange: (f) => se(f.target.value),
|
|
2774
2800
|
className: `w-full rounded-md border border-gray-300 px-3 py-2 ${s ? "cursor-not-allowed text-gray-500" : ""}`,
|
|
2775
2801
|
children: [
|
|
2776
2802
|
/* @__PURE__ */ r("optgroup", { label: "Pages", children: t.filter((f) => f.hasSlug !== !1).map((f) => /* @__PURE__ */ r("option", { value: f.key, children: f.name }, f.key)) }),
|
|
@@ -2780,13 +2806,13 @@ function ro({
|
|
|
2780
2806
|
)
|
|
2781
2807
|
] }),
|
|
2782
2808
|
!s && (y == null ? void 0 : y.hasSlug) && k.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2783
|
-
/* @__PURE__ */ r(
|
|
2809
|
+
/* @__PURE__ */ r(Z, { className: "text-sm mb-1 block", children: "Template" }),
|
|
2784
2810
|
/* @__PURE__ */ r(
|
|
2785
2811
|
eo,
|
|
2786
2812
|
{
|
|
2787
2813
|
templates: k,
|
|
2788
|
-
selectedTemplateId:
|
|
2789
|
-
onSelectTemplate:
|
|
2814
|
+
selectedTemplateId: ee,
|
|
2815
|
+
onSelectTemplate: he,
|
|
2790
2816
|
isLoading: q
|
|
2791
2817
|
}
|
|
2792
2818
|
)
|
|
@@ -2796,13 +2822,13 @@ function ro({
|
|
|
2796
2822
|
{
|
|
2797
2823
|
pages: a,
|
|
2798
2824
|
selectedParentId: S,
|
|
2799
|
-
onChange:
|
|
2825
|
+
onChange: W
|
|
2800
2826
|
}
|
|
2801
2827
|
),
|
|
2802
2828
|
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2803
|
-
/* @__PURE__ */ r(
|
|
2829
|
+
/* @__PURE__ */ r(Z, { htmlFor: "name", className: "text-sm", children: "Name" }),
|
|
2804
2830
|
/* @__PURE__ */ r(
|
|
2805
|
-
|
|
2831
|
+
ve,
|
|
2806
2832
|
{
|
|
2807
2833
|
id: "name",
|
|
2808
2834
|
value: x,
|
|
@@ -2820,11 +2846,11 @@ function ro({
|
|
|
2820
2846
|
type: "checkbox",
|
|
2821
2847
|
id: "useDynamicSlug",
|
|
2822
2848
|
checked: T,
|
|
2823
|
-
onChange: (f) =>
|
|
2849
|
+
onChange: (f) => me(f.target.checked),
|
|
2824
2850
|
className: "rounded border-gray-300"
|
|
2825
2851
|
}
|
|
2826
2852
|
),
|
|
2827
|
-
/* @__PURE__ */ r(
|
|
2853
|
+
/* @__PURE__ */ r(Z, { htmlFor: "useDynamicSlug", className: "text-sm", children: "Use Dynamic Slug" })
|
|
2828
2854
|
] }),
|
|
2829
2855
|
T && /* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: [
|
|
2830
2856
|
"Pages will use pattern: ",
|
|
@@ -2832,7 +2858,7 @@ function ro({
|
|
|
2832
2858
|
] })
|
|
2833
2859
|
] }),
|
|
2834
2860
|
(!(M != null && M.dynamicSegments) || !T) && /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2835
|
-
/* @__PURE__ */ u(
|
|
2861
|
+
/* @__PURE__ */ u(Z, { htmlFor: "slug", className: "text-sm", children: [
|
|
2836
2862
|
"Slug",
|
|
2837
2863
|
S && S !== "none" && /* @__PURE__ */ u("span", { className: "ml-2 text-sm text-gray-500", children: [
|
|
2838
2864
|
"Parent:",
|
|
@@ -2841,7 +2867,7 @@ function ro({
|
|
|
2841
2867
|
] })
|
|
2842
2868
|
] }),
|
|
2843
2869
|
/* @__PURE__ */ r(
|
|
2844
|
-
|
|
2870
|
+
ve,
|
|
2845
2871
|
{
|
|
2846
2872
|
id: "slug",
|
|
2847
2873
|
value: E,
|
|
@@ -2859,14 +2885,14 @@ function ro({
|
|
|
2859
2885
|
className: "w-full max-w-md mx-auto space-y-4",
|
|
2860
2886
|
children: [
|
|
2861
2887
|
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2862
|
-
/* @__PURE__ */ r(
|
|
2888
|
+
/* @__PURE__ */ r(Z, { htmlFor: "pageType", className: "text-sm", children: "Page Type" }),
|
|
2863
2889
|
/* @__PURE__ */ u(
|
|
2864
2890
|
"select",
|
|
2865
2891
|
{
|
|
2866
2892
|
id: "pageType",
|
|
2867
2893
|
value: d,
|
|
2868
2894
|
disabled: s,
|
|
2869
|
-
onChange: (f) =>
|
|
2895
|
+
onChange: (f) => se(f.target.value),
|
|
2870
2896
|
className: `w-full rounded-md border border-gray-300 px-3 py-2 ${s ? "cursor-not-allowed text-gray-500" : ""}`,
|
|
2871
2897
|
children: [
|
|
2872
2898
|
/* @__PURE__ */ r("optgroup", { label: "Pages", children: t.filter((f) => f.hasSlug !== !1).map((f) => /* @__PURE__ */ r("option", { value: f.key, children: f.name }, f.key)) }),
|
|
@@ -2874,12 +2900,12 @@ function ro({
|
|
|
2874
2900
|
]
|
|
2875
2901
|
}
|
|
2876
2902
|
),
|
|
2877
|
-
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500", children: (
|
|
2903
|
+
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500", children: (be = t.find((f) => f.key === d)) == null ? void 0 : be.helpText })
|
|
2878
2904
|
] }),
|
|
2879
2905
|
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2880
|
-
/* @__PURE__ */ r(
|
|
2906
|
+
/* @__PURE__ */ r(Z, { htmlFor: "name", className: "text-sm", children: "Name" }),
|
|
2881
2907
|
/* @__PURE__ */ r(
|
|
2882
|
-
|
|
2908
|
+
ve,
|
|
2883
2909
|
{
|
|
2884
2910
|
id: "name",
|
|
2885
2911
|
value: x,
|
|
@@ -2922,13 +2948,13 @@ const ao = ({
|
|
|
2922
2948
|
}) => {
|
|
2923
2949
|
const [n, s] = P(!1), [a, i] = P(""), [l, o] = P(""), [c, h] = P(!1), g = ut(null), d = Vl(), { data: w } = ke(), y = w == null ? void 0 : w.find(
|
|
2924
2950
|
(E) => E.key === e.pageType
|
|
2925
|
-
), p = (y == null ? void 0 : y.name) || It(e.pageType), S =
|
|
2951
|
+
), p = (y == null ? void 0 : y.name) || It(e.pageType), S = Ie(
|
|
2926
2952
|
(E) => {
|
|
2927
2953
|
var T;
|
|
2928
2954
|
const b = (T = E.target.files) == null ? void 0 : T[0];
|
|
2929
2955
|
if (b) {
|
|
2930
2956
|
if (b.size > io) {
|
|
2931
|
-
|
|
2957
|
+
$.error("File too large", {
|
|
2932
2958
|
description: `Maximum file size is 1MB. Selected file is ${(b.size / 1024).toFixed(2)}KB.`
|
|
2933
2959
|
}), g.current && (g.current.value = "");
|
|
2934
2960
|
return;
|
|
@@ -2940,7 +2966,7 @@ const ao = ({
|
|
|
2940
2966
|
o(U.result), h(!1);
|
|
2941
2967
|
}, U.readAsDataURL(b);
|
|
2942
2968
|
} catch (U) {
|
|
2943
|
-
console.error("Error reading file:", U), h(!1),
|
|
2969
|
+
console.error("Error reading file:", U), h(!1), $.error("Failed to process image", {
|
|
2944
2970
|
description: U instanceof Error ? U.message : "Unknown error"
|
|
2945
2971
|
});
|
|
2946
2972
|
}
|
|
@@ -2994,7 +3020,7 @@ const ao = ({
|
|
|
2994
3020
|
] })
|
|
2995
3021
|
] }),
|
|
2996
3022
|
/* @__PURE__ */ u("div", { children: [
|
|
2997
|
-
/* @__PURE__ */ r(
|
|
3023
|
+
/* @__PURE__ */ r(Z, { htmlFor: "description", className: "text-xs font-medium", children: "Description (Optional)" }),
|
|
2998
3024
|
/* @__PURE__ */ r(
|
|
2999
3025
|
Gt,
|
|
3000
3026
|
{
|
|
@@ -3007,11 +3033,11 @@ const ao = ({
|
|
|
3007
3033
|
)
|
|
3008
3034
|
] }),
|
|
3009
3035
|
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
3010
|
-
/* @__PURE__ */ r(
|
|
3036
|
+
/* @__PURE__ */ r(Z, { htmlFor: "previewImage", className: "text-xs font-medium", children: "Preview Image (Optional)" }),
|
|
3011
3037
|
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
3012
3038
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3013
3039
|
/* @__PURE__ */ r(
|
|
3014
|
-
|
|
3040
|
+
ve,
|
|
3015
3041
|
{
|
|
3016
3042
|
type: "file",
|
|
3017
3043
|
id: "previewImage",
|
|
@@ -3131,17 +3157,17 @@ const ao = ({
|
|
|
3131
3157
|
setMarkAsTemplate: o,
|
|
3132
3158
|
setUnmarkAsTemplate: c
|
|
3133
3159
|
}) => {
|
|
3134
|
-
const { data: h } = ke(), { hasPermission: g } = sn(), d =
|
|
3135
|
-
() =>
|
|
3160
|
+
const { data: h } = ke(), { hasPermission: g } = sn(), d = Y(
|
|
3161
|
+
() => ge(h, { key: t.pageType }),
|
|
3136
3162
|
[h, t.pageType]
|
|
3137
|
-
), w =
|
|
3163
|
+
), w = ne(t, "slug", "").replace(e, "") || "/", y = !g(de.EDIT_PAGE) && !g(de.DELETE_PAGE) && !g(de.UNPUBLISH_PAGE), p = Y(() => !!t.isTemplate, [t.isTemplate]), S = Y(
|
|
3138
3164
|
() => !!(d != null && d.hasSlug),
|
|
3139
3165
|
[d == null ? void 0 : d.hasSlug]
|
|
3140
3166
|
);
|
|
3141
3167
|
return /* @__PURE__ */ u(
|
|
3142
3168
|
"div",
|
|
3143
3169
|
{
|
|
3144
|
-
onClick: () => s(
|
|
3170
|
+
onClick: () => s(ne(t, "id")),
|
|
3145
3171
|
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"}`,
|
|
3146
3172
|
children: [
|
|
3147
3173
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -3189,7 +3215,7 @@ const ao = ({
|
|
|
3189
3215
|
/* @__PURE__ */ r("div", { className: "flex items-center space-x-4", children: !y && /* @__PURE__ */ u(rn, { children: [
|
|
3190
3216
|
/* @__PURE__ */ r(an, { asChild: !0, onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ r(ys, { className: "h-4 w-4 hover:stroke-[3]" }) }),
|
|
3191
3217
|
/* @__PURE__ */ u(ln, { align: "end", className: "text-sm", children: [
|
|
3192
|
-
g(
|
|
3218
|
+
g(de.EDIT_PAGE) && /* @__PURE__ */ u(
|
|
3193
3219
|
De,
|
|
3194
3220
|
{
|
|
3195
3221
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3205,7 +3231,7 @@ const ao = ({
|
|
|
3205
3231
|
]
|
|
3206
3232
|
}
|
|
3207
3233
|
),
|
|
3208
|
-
(t == null ? void 0 : t.online) && g(
|
|
3234
|
+
(t == null ? void 0 : t.online) && g(de.UNPUBLISH_PAGE) && /* @__PURE__ */ u(
|
|
3209
3235
|
De,
|
|
3210
3236
|
{
|
|
3211
3237
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3218,7 +3244,7 @@ const ao = ({
|
|
|
3218
3244
|
]
|
|
3219
3245
|
}
|
|
3220
3246
|
),
|
|
3221
|
-
g(
|
|
3247
|
+
g(de.DELETE_PAGE) && /* @__PURE__ */ u(
|
|
3222
3248
|
De,
|
|
3223
3249
|
{
|
|
3224
3250
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3231,7 +3257,7 @@ const ao = ({
|
|
|
3231
3257
|
]
|
|
3232
3258
|
}
|
|
3233
3259
|
),
|
|
3234
|
-
g(
|
|
3260
|
+
g(de.MARK_AS_TEMPLATE) && S && /* @__PURE__ */ r(we, { children: p ? /* @__PURE__ */ u(
|
|
3235
3261
|
De,
|
|
3236
3262
|
{
|
|
3237
3263
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3262,62 +3288,62 @@ const ao = ({
|
|
|
3262
3288
|
}
|
|
3263
3289
|
);
|
|
3264
3290
|
}, co = ({ close: e }) => {
|
|
3265
|
-
const [, t] = P([]), [n, s] = P(""), [a, i] = P(null), [l, o] = P(null), [c, h] = P(null), [g, d] = P(null), [w, y] = P(null), { data: p, isFetching: S } = Rn(), [v, x] = P(""), { hasPermission: G } = sn(), [E, b] = Ue(), T = E.get("page"), { data: U } = ke(),
|
|
3291
|
+
const [, t] = P([]), [n, s] = P(""), [a, i] = P(null), [l, o] = P(null), [c, h] = P(null), [g, d] = P(null), [w, y] = P(null), { data: p, isFetching: S } = Rn(), [v, x] = P(""), { hasPermission: G } = sn(), [E, b] = Ue(), T = E.get("page"), { data: U } = ke(), ee = Ie(
|
|
3266
3292
|
(A) => {
|
|
3267
3293
|
var M;
|
|
3268
|
-
return (M =
|
|
3294
|
+
return (M = ge(U, { key: A })) == null ? void 0 : M.hasSlug;
|
|
3269
3295
|
},
|
|
3270
3296
|
[U]
|
|
3271
3297
|
);
|
|
3272
|
-
|
|
3273
|
-
if (!
|
|
3298
|
+
Se(() => {
|
|
3299
|
+
if (!fe(v)) return;
|
|
3274
3300
|
const A = sessionStorage.getItem("pageTypeFilter") || "all";
|
|
3275
|
-
!
|
|
3301
|
+
!fe(U) && A && (ge(U, { key: A }) ? x(A) : x("all"));
|
|
3276
3302
|
}, [U, v]);
|
|
3277
|
-
const
|
|
3303
|
+
const le = (A) => {
|
|
3278
3304
|
x(A), sessionStorage.setItem("pageTypeFilter", A);
|
|
3279
|
-
}, k =
|
|
3305
|
+
}, k = Ie(
|
|
3280
3306
|
(A) => {
|
|
3281
|
-
const
|
|
3282
|
-
|
|
3307
|
+
const se = new URLSearchParams(window.location.search).get("lang"), me = new URLSearchParams({ page: A });
|
|
3308
|
+
se && me.set("lang", se), window.history.pushState({}, "", `?${me.toString()}`), b(me), window.dispatchEvent(new PopStateEvent("popstate")), e();
|
|
3283
3309
|
},
|
|
3284
3310
|
[b, e]
|
|
3285
3311
|
);
|
|
3286
|
-
|
|
3312
|
+
Se(() => {
|
|
3287
3313
|
if (T && !S) {
|
|
3288
|
-
const A =
|
|
3314
|
+
const A = ge(p, { id: T });
|
|
3289
3315
|
A && (A != null && A.pageType) ? t((M) => [...M, A == null ? void 0 : A.pageType]) : (window.history.replaceState(null, "", "/"), b(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
3290
3316
|
}
|
|
3291
3317
|
}, [p, T, S, b]);
|
|
3292
|
-
const q =
|
|
3318
|
+
const q = Y(() => {
|
|
3293
3319
|
const A = Nn(
|
|
3294
|
-
|
|
3320
|
+
Ce(p, (F) => fe(n) ? !0 : Mt(Dt(F == null ? void 0 : F.name), Dt(n)) || Mt(Dt(F == null ? void 0 : F.slug), Dt(n)))
|
|
3295
3321
|
);
|
|
3296
3322
|
if (v !== "all")
|
|
3297
|
-
return Nn(
|
|
3323
|
+
return Nn(Ce(A, { pageType: v }));
|
|
3298
3324
|
const M = /* @__PURE__ */ new Map();
|
|
3299
3325
|
A.forEach((F) => {
|
|
3300
3326
|
M.set(F.id, { ...F, children: [] });
|
|
3301
3327
|
});
|
|
3302
|
-
const
|
|
3328
|
+
const se = [], me = [];
|
|
3303
3329
|
M.forEach((F) => {
|
|
3304
3330
|
if (F.parent) {
|
|
3305
|
-
const
|
|
3306
|
-
|
|
3331
|
+
const be = M.get(F.parent);
|
|
3332
|
+
be ? be.children.push(F) : se.push(F);
|
|
3307
3333
|
} else
|
|
3308
|
-
|
|
3309
|
-
}),
|
|
3310
|
-
F.children.sort((
|
|
3334
|
+
me.push(F);
|
|
3335
|
+
}), se.sort((F, be) => F.name.localeCompare(be.name)), se.forEach((F) => {
|
|
3336
|
+
F.children.sort((be, Qe) => be.name.localeCompare(Qe.name));
|
|
3311
3337
|
});
|
|
3312
|
-
const
|
|
3313
|
-
|
|
3314
|
-
(F) => !
|
|
3315
|
-
),
|
|
3316
|
-
|
|
3317
|
-
(F) =>
|
|
3318
|
-
).sort((F,
|
|
3319
|
-
return Nn([...
|
|
3320
|
-
}, [p,
|
|
3338
|
+
const W = Ce(
|
|
3339
|
+
me,
|
|
3340
|
+
(F) => !ee(F.pageType)
|
|
3341
|
+
), he = Ce(
|
|
3342
|
+
me,
|
|
3343
|
+
(F) => ee(F.pageType)
|
|
3344
|
+
).sort((F, be) => F.name.localeCompare(be.name));
|
|
3345
|
+
return Nn([...he, ...W, ...se]);
|
|
3346
|
+
}, [p, ee, n, v]);
|
|
3321
3347
|
return /* @__PURE__ */ u("div", { className: "flex flex-col justify-between h-full", children: [
|
|
3322
3348
|
/* @__PURE__ */ u("div", { className: "flex flex-col h-full space-y-6", children: [
|
|
3323
3349
|
/* @__PURE__ */ u("div", { className: "relative flex item-center gap-x-4", children: [
|
|
@@ -3329,7 +3355,7 @@ const ao = ({
|
|
|
3329
3355
|
}
|
|
3330
3356
|
),
|
|
3331
3357
|
/* @__PURE__ */ r(
|
|
3332
|
-
|
|
3358
|
+
ve,
|
|
3333
3359
|
{
|
|
3334
3360
|
placeholder: "Search pages...",
|
|
3335
3361
|
className: "text-xs font-medium leading-none text-gray-700 pl-9 pr-24 placeholder:text-gray-400",
|
|
@@ -3337,7 +3363,7 @@ const ao = ({
|
|
|
3337
3363
|
onChange: (A) => s(A.target.value)
|
|
3338
3364
|
}
|
|
3339
3365
|
),
|
|
3340
|
-
!
|
|
3366
|
+
!fe(v) && /* @__PURE__ */ u(mi, { value: v, onValueChange: le, children: [
|
|
3341
3367
|
/* @__PURE__ */ r(
|
|
3342
3368
|
fi,
|
|
3343
3369
|
{
|
|
@@ -3347,7 +3373,7 @@ const ao = ({
|
|
|
3347
3373
|
),
|
|
3348
3374
|
/* @__PURE__ */ r(pi, { align: "end", children: Fe(
|
|
3349
3375
|
Zs([{ key: "all", name: "All" }], U),
|
|
3350
|
-
(A) => /* @__PURE__ */ r(yi, { value:
|
|
3376
|
+
(A) => /* @__PURE__ */ r(yi, { value: ne(A, "key"), children: ne(A, "name") })
|
|
3351
3377
|
) })
|
|
3352
3378
|
] })
|
|
3353
3379
|
] }),
|
|
@@ -3357,11 +3383,11 @@ const ao = ({
|
|
|
3357
3383
|
className: "w-full bg-gray-200 rounded h-9 animate-pulse"
|
|
3358
3384
|
},
|
|
3359
3385
|
A
|
|
3360
|
-
)) }) :
|
|
3386
|
+
)) }) : fe(q) ? /* @__PURE__ */ u("div", { className: "h-[70vh] flex flex-col gap-y-1 items-center justify-center text-slate-500 text-sm font-medium", children: [
|
|
3361
3387
|
/* @__PURE__ */ r(on, { className: "h-6 w-6 stroke-[1]" }),
|
|
3362
3388
|
"Empty List!",
|
|
3363
3389
|
/* @__PURE__ */ r("span", { className: "font-light", children: "Add new page to start" })
|
|
3364
|
-
] }) : /* @__PURE__ */ r("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: Fe(q, (A) =>
|
|
3390
|
+
] }) : /* @__PURE__ */ r("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: Fe(q, (A) => fe(A == null ? void 0 : A.children) ? /* @__PURE__ */ r(
|
|
3365
3391
|
Hn,
|
|
3366
3392
|
{
|
|
3367
3393
|
changeActivePage: k,
|
|
@@ -3388,8 +3414,8 @@ const ao = ({
|
|
|
3388
3414
|
page: A
|
|
3389
3415
|
}
|
|
3390
3416
|
),
|
|
3391
|
-
/* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: Fe(
|
|
3392
|
-
const
|
|
3417
|
+
/* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: Fe(ne(A, "children", []), (M) => {
|
|
3418
|
+
const se = T === ne(M, "id");
|
|
3393
3419
|
return /* @__PURE__ */ r(
|
|
3394
3420
|
Hn,
|
|
3395
3421
|
{
|
|
@@ -3400,7 +3426,7 @@ const ao = ({
|
|
|
3400
3426
|
setAddEditPage: h,
|
|
3401
3427
|
setMarkAsTemplate: d,
|
|
3402
3428
|
setUnmarkAsTemplate: y,
|
|
3403
|
-
active:
|
|
3429
|
+
active: se,
|
|
3404
3430
|
page: M
|
|
3405
3431
|
},
|
|
3406
3432
|
M.id
|
|
@@ -3408,7 +3434,7 @@ const ao = ({
|
|
|
3408
3434
|
}) })
|
|
3409
3435
|
] }, A.key)) })
|
|
3410
3436
|
] }),
|
|
3411
|
-
G(
|
|
3437
|
+
G(de.ADD_PAGE) && /* @__PURE__ */ u(
|
|
3412
3438
|
_,
|
|
3413
3439
|
{
|
|
3414
3440
|
className: "flex text-sm gap-x-2",
|
|
@@ -3460,8 +3486,8 @@ const ao = ({
|
|
|
3460
3486
|
const e = rt("logo", null);
|
|
3461
3487
|
return e ? /* @__PURE__ */ r("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: tr.createElement(e, {}) }) : null;
|
|
3462
3488
|
}, ho = () => {
|
|
3463
|
-
const [e] = Ue(), t = e.get("page"), { data: n, isFetching: s } = Re(), [a, i] = P(!1), l = !!t && !
|
|
3464
|
-
return /* @__PURE__ */ u(
|
|
3489
|
+
const [e] = Ue(), t = e.get("page"), { data: n, isFetching: s } = Re(), [a, i] = P(!1), l = !!t && !fe(n), o = !t || !s && fe(n) || a;
|
|
3490
|
+
return /* @__PURE__ */ u(we, { children: [
|
|
3465
3491
|
/* @__PURE__ */ u(
|
|
3466
3492
|
_,
|
|
3467
3493
|
{
|
|
@@ -3472,7 +3498,7 @@ const ao = ({
|
|
|
3472
3498
|
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Ki, { className: "h-4 w-4" }) }),
|
|
3473
3499
|
/* @__PURE__ */ u("span", { className: "truncate leading-tight flex items-center max-w-[200px]", children: [
|
|
3474
3500
|
/* @__PURE__ */ r("span", { className: "text-slate-600 pr-1 font-light", children: "Editing:" }),
|
|
3475
|
-
s ? /* @__PURE__ */ r(_r, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : It(
|
|
3501
|
+
s ? /* @__PURE__ */ r(_r, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : It(ne(n, "name")) ?? ""
|
|
3476
3502
|
] })
|
|
3477
3503
|
]
|
|
3478
3504
|
},
|
|
@@ -3504,18 +3530,18 @@ const ao = ({
|
|
|
3504
3530
|
)
|
|
3505
3531
|
] });
|
|
3506
3532
|
}, mo = () => {
|
|
3507
|
-
const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = dt(), a =
|
|
3508
|
-
|
|
3533
|
+
const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = dt(), a = fe(n) ? e : n, [, i] = Ue();
|
|
3534
|
+
Se(() => {
|
|
3509
3535
|
const p = new URLSearchParams(window.location.search), S = p.get("lang");
|
|
3510
3536
|
S && (t.includes(S) ? s(S) : (p.delete("lang"), i(p), s("")));
|
|
3511
3537
|
}, [t, i, s]);
|
|
3512
|
-
const [l, o] = P(null), { data: c } = Re(), { data: h } = un(), { data: g, isFetching: d } = cn(), w =
|
|
3538
|
+
const [l, o] = P(null), { data: c } = Re(), { data: h } = un(), { data: g, isFetching: d } = cn(), w = Y(() => {
|
|
3513
3539
|
const p = Nn(
|
|
3514
|
-
Fe(
|
|
3515
|
-
const v =
|
|
3540
|
+
Fe(ne(h, "languages"), (S) => {
|
|
3541
|
+
const v = ge(g, { lang: S });
|
|
3516
3542
|
return {
|
|
3517
3543
|
key: S,
|
|
3518
|
-
value:
|
|
3544
|
+
value: ne(qe, S, S),
|
|
3519
3545
|
isLangPageAdded: !!v
|
|
3520
3546
|
};
|
|
3521
3547
|
})
|
|
@@ -3523,7 +3549,7 @@ const ao = ({
|
|
|
3523
3549
|
return [
|
|
3524
3550
|
{
|
|
3525
3551
|
key: e,
|
|
3526
|
-
value:
|
|
3552
|
+
value: ne(qe, e),
|
|
3527
3553
|
isLangPageAdded: !0
|
|
3528
3554
|
},
|
|
3529
3555
|
...p
|
|
@@ -3535,11 +3561,11 @@ const ao = ({
|
|
|
3535
3561
|
const v = S.toString(), x = `${window.location.pathname}${v ? `?${v}` : ""}`;
|
|
3536
3562
|
window.history.pushState({}, "", x), i(S), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
3537
3563
|
};
|
|
3538
|
-
return
|
|
3564
|
+
return fe(t) || d ? null : /* @__PURE__ */ u(we, { children: [
|
|
3539
3565
|
/* @__PURE__ */ u(rn, { children: [
|
|
3540
3566
|
/* @__PURE__ */ r(an, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ u(_, { variant: "ghost", size: "sm", className: "gap-2", children: [
|
|
3541
3567
|
/* @__PURE__ */ r(Vi, { className: "w-4 h-4" }),
|
|
3542
|
-
|
|
3568
|
+
ne(qe, a, a),
|
|
3543
3569
|
/* @__PURE__ */ r(Ir, { className: "w-4 h-4" })
|
|
3544
3570
|
] }) }),
|
|
3545
3571
|
/* @__PURE__ */ u(ln, { className: "border-border space-y-1", children: [
|
|
@@ -3570,7 +3596,7 @@ const ao = ({
|
|
|
3570
3596
|
p.value
|
|
3571
3597
|
)
|
|
3572
3598
|
),
|
|
3573
|
-
!
|
|
3599
|
+
!fe(w.filter((p) => !p.isLangPageAdded)) && /* @__PURE__ */ u(we, { children: [
|
|
3574
3600
|
/* @__PURE__ */ r(vi, {}),
|
|
3575
3601
|
/* @__PURE__ */ u(
|
|
3576
3602
|
_,
|
|
@@ -3614,9 +3640,9 @@ function fo() {
|
|
|
3614
3640
|
] });
|
|
3615
3641
|
}
|
|
3616
3642
|
function go(e) {
|
|
3617
|
-
const t =
|
|
3618
|
-
return
|
|
3619
|
-
queryKey: [
|
|
3643
|
+
const t = X(), n = z();
|
|
3644
|
+
return Ae({
|
|
3645
|
+
queryKey: [V, "revisions", e],
|
|
3620
3646
|
queryFn: async () => await n(t, {
|
|
3621
3647
|
action: I.GET_PAGE_REVISIONS,
|
|
3622
3648
|
data: { pageId: e }
|
|
@@ -3627,19 +3653,21 @@ function go(e) {
|
|
|
3627
3653
|
});
|
|
3628
3654
|
}
|
|
3629
3655
|
const po = () => {
|
|
3630
|
-
const e =
|
|
3631
|
-
return
|
|
3656
|
+
const e = X(), t = z(), n = Ne();
|
|
3657
|
+
return xe({
|
|
3632
3658
|
mutationFn: async (s) => await t(e, {
|
|
3633
3659
|
action: I.DELETE_PAGE_REVISION,
|
|
3634
3660
|
data: { revisionId: s }
|
|
3635
3661
|
}),
|
|
3636
3662
|
onSuccess: () => {
|
|
3637
|
-
n.invalidateQueries({
|
|
3663
|
+
n.invalidateQueries({
|
|
3664
|
+
queryKey: [V, "revisions"]
|
|
3665
|
+
});
|
|
3638
3666
|
}
|
|
3639
3667
|
});
|
|
3640
3668
|
}, yo = () => {
|
|
3641
|
-
const e =
|
|
3642
|
-
return
|
|
3669
|
+
const e = X(), t = z(), n = Ne();
|
|
3670
|
+
return xe({
|
|
3643
3671
|
mutationFn: async ({
|
|
3644
3672
|
revisionId: s,
|
|
3645
3673
|
discardCurrent: a
|
|
@@ -3648,7 +3676,9 @@ const po = () => {
|
|
|
3648
3676
|
data: { revisionId: s, discardCurrent: a }
|
|
3649
3677
|
}),
|
|
3650
3678
|
onSuccess: () => {
|
|
3651
|
-
n.invalidateQueries({
|
|
3679
|
+
n.invalidateQueries({
|
|
3680
|
+
queryKey: [V, "revisions"]
|
|
3681
|
+
});
|
|
3652
3682
|
}
|
|
3653
3683
|
});
|
|
3654
3684
|
};
|
|
@@ -3656,7 +3686,7 @@ function vo() {
|
|
|
3656
3686
|
const { data: e } = Re(), { saveState: t } = rr(), [n] = ws();
|
|
3657
3687
|
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: [
|
|
3658
3688
|
/* @__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" }) }) }),
|
|
3659
|
-
/* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !
|
|
3689
|
+
/* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !fe(n.lastSaved) && /* @__PURE__ */ u("span", { children: [
|
|
3660
3690
|
"Last updated",
|
|
3661
3691
|
" ",
|
|
3662
3692
|
ll(new Date(n.lastSaved), {
|
|
@@ -3676,17 +3706,19 @@ function vo() {
|
|
|
3676
3706
|
] }) }) : null;
|
|
3677
3707
|
}
|
|
3678
3708
|
function Eo() {
|
|
3679
|
-
const [e, t] =
|
|
3709
|
+
const [e, t] = ue.useState(!1), [n, s] = ue.useState(null), [a, i] = ue.useState(!1), [l, o] = ue.useState(!1), { data: c } = Re(), {
|
|
3680
3710
|
data: h,
|
|
3681
3711
|
isFetching: g,
|
|
3682
3712
|
error: d,
|
|
3683
3713
|
refetch: w
|
|
3684
|
-
} = go(c == null ? void 0 : c.id), { mutate: y, isPending: p } = po(), { mutate: S, isPending: v } = yo(), x =
|
|
3714
|
+
} = go(c == null ? void 0 : c.id), { mutate: y, isPending: p } = po(), { mutate: S, isPending: v } = yo(), x = Ne(), G = (U) => {
|
|
3685
3715
|
n && S(
|
|
3686
3716
|
{ revisionId: n.uid, discardCurrent: U },
|
|
3687
3717
|
{
|
|
3688
3718
|
onSuccess: () => {
|
|
3689
|
-
i(!1), s(null), x.invalidateQueries({
|
|
3719
|
+
i(!1), s(null), x.invalidateQueries({
|
|
3720
|
+
queryKey: [V, I.GET_DRAFT_PAGE]
|
|
3721
|
+
});
|
|
3690
3722
|
}
|
|
3691
3723
|
}
|
|
3692
3724
|
);
|
|
@@ -3701,9 +3733,9 @@ function Eo() {
|
|
|
3701
3733
|
}
|
|
3702
3734
|
});
|
|
3703
3735
|
};
|
|
3704
|
-
return
|
|
3736
|
+
return Se(() => {
|
|
3705
3737
|
e && w();
|
|
3706
|
-
}, [e, w]), /* @__PURE__ */ u(
|
|
3738
|
+
}, [e, w]), /* @__PURE__ */ u(we, { children: [
|
|
3707
3739
|
/* @__PURE__ */ r(Sr, { children: /* @__PURE__ */ u(ms, { children: [
|
|
3708
3740
|
/* @__PURE__ */ u(vr, { open: e, onOpenChange: t, children: [
|
|
3709
3741
|
/* @__PURE__ */ r(Ei, { asChild: !0, children: /* @__PURE__ */ r(fs, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
|
|
@@ -3811,8 +3843,8 @@ function wo({
|
|
|
3811
3843
|
Oe,
|
|
3812
3844
|
{
|
|
3813
3845
|
permissions: [
|
|
3814
|
-
|
|
3815
|
-
|
|
3846
|
+
de.RESTORE_REVISION,
|
|
3847
|
+
de.DELETE_REVISION
|
|
3816
3848
|
],
|
|
3817
3849
|
children: /* @__PURE__ */ r(
|
|
3818
3850
|
So,
|
|
@@ -3837,11 +3869,11 @@ function So({
|
|
|
3837
3869
|
/* @__PURE__ */ r("span", { className: "sr-only", children: "More options" })
|
|
3838
3870
|
] }) }),
|
|
3839
3871
|
/* @__PURE__ */ u(ln, { align: "end", className: "text-xs", children: [
|
|
3840
|
-
/* @__PURE__ */ r(Oe, { permission:
|
|
3872
|
+
/* @__PURE__ */ r(Oe, { permission: de.RESTORE_REVISION, children: /* @__PURE__ */ u(De, { onClick: t, className: "cursor-pointer", children: [
|
|
3841
3873
|
/* @__PURE__ */ r(kr, { className: "mr-2 h-4 w-4" }),
|
|
3842
3874
|
/* @__PURE__ */ r("span", { children: "Restore this version" })
|
|
3843
3875
|
] }) }),
|
|
3844
|
-
/* @__PURE__ */ r(Oe, { permission:
|
|
3876
|
+
/* @__PURE__ */ r(Oe, { permission: de.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ u(we, { children: [
|
|
3845
3877
|
/* @__PURE__ */ r(wi, {}),
|
|
3846
3878
|
/* @__PURE__ */ u(
|
|
3847
3879
|
De,
|
|
@@ -3896,10 +3928,10 @@ function No({
|
|
|
3896
3928
|
className: "sm:flex-1",
|
|
3897
3929
|
onClick: () => s(!1),
|
|
3898
3930
|
disabled: a,
|
|
3899
|
-
children: a ? /* @__PURE__ */ u(
|
|
3931
|
+
children: a ? /* @__PURE__ */ u(we, { children: [
|
|
3900
3932
|
/* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
3901
3933
|
"Saving as draft..."
|
|
3902
|
-
] }) : /* @__PURE__ */ u(
|
|
3934
|
+
] }) : /* @__PURE__ */ u(we, { children: [
|
|
3903
3935
|
/* @__PURE__ */ r(Wi, { className: "mr-2 h-4 w-4" }),
|
|
3904
3936
|
"Save as draft"
|
|
3905
3937
|
] })
|
|
@@ -3912,10 +3944,10 @@ function No({
|
|
|
3912
3944
|
className: "sm:flex-1",
|
|
3913
3945
|
onClick: () => s(!0),
|
|
3914
3946
|
disabled: a,
|
|
3915
|
-
children: a ? /* @__PURE__ */ u(
|
|
3947
|
+
children: a ? /* @__PURE__ */ u(we, { children: [
|
|
3916
3948
|
/* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
3917
3949
|
"Discarding current..."
|
|
3918
|
-
] }) : /* @__PURE__ */ u(
|
|
3950
|
+
] }) : /* @__PURE__ */ u(we, { children: [
|
|
3919
3951
|
/* @__PURE__ */ r(kr, { className: "mr-2 h-4 w-4" }),
|
|
3920
3952
|
"Discard current"
|
|
3921
3953
|
] })
|
|
@@ -3974,10 +4006,10 @@ function Ao({
|
|
|
3974
4006
|
className: "sm:flex-1",
|
|
3975
4007
|
onClick: s,
|
|
3976
4008
|
disabled: a,
|
|
3977
|
-
children: a ? /* @__PURE__ */ u(
|
|
4009
|
+
children: a ? /* @__PURE__ */ u(we, { children: [
|
|
3978
4010
|
/* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
3979
4011
|
"Deleting..."
|
|
3980
|
-
] }) : /* @__PURE__ */ u(
|
|
4012
|
+
] }) : /* @__PURE__ */ u(we, { children: [
|
|
3981
4013
|
/* @__PURE__ */ r(vs, { className: "mr-2 h-4 w-4" }),
|
|
3982
4014
|
"Delete Revision"
|
|
3983
4015
|
] })
|
|
@@ -3989,9 +4021,9 @@ function Ao({
|
|
|
3989
4021
|
) : null;
|
|
3990
4022
|
}
|
|
3991
4023
|
const xo = () => {
|
|
3992
|
-
const e =
|
|
3993
|
-
return
|
|
3994
|
-
queryKey: [
|
|
4024
|
+
const e = X(), t = z();
|
|
4025
|
+
return Ae({
|
|
4026
|
+
queryKey: [V, I.GET_CHANGES],
|
|
3995
4027
|
queryFn: async () => t(e, { action: I.GET_CHANGES })
|
|
3996
4028
|
});
|
|
3997
4029
|
}, To = ({ currentEditor: e }) => {
|
|
@@ -4002,34 +4034,34 @@ function Co({
|
|
|
4002
4034
|
showModal: e = !1,
|
|
4003
4035
|
onClose: t = () => console.log("Cancelled")
|
|
4004
4036
|
}) {
|
|
4005
|
-
const [n, s] = P([]), { data: a, isFetching: i } = xo(), { data: l } = ke(), o =
|
|
4037
|
+
const [n, s] = P([]), { data: a, isFetching: i } = xo(), { data: l } = ke(), o = Ie(
|
|
4006
4038
|
(b) => {
|
|
4007
4039
|
var T;
|
|
4008
|
-
return (T =
|
|
4040
|
+
return (T = ge(l, { key: b })) == null ? void 0 : T.hasSlug;
|
|
4009
4041
|
},
|
|
4010
4042
|
[l]
|
|
4011
|
-
), c =
|
|
4012
|
-
() =>
|
|
4043
|
+
), c = Y(
|
|
4044
|
+
() => Ce(l, (b) => !o(b.key)).map(
|
|
4013
4045
|
(b) => b.key
|
|
4014
4046
|
),
|
|
4015
4047
|
[o, l]
|
|
4016
|
-
), h =
|
|
4017
|
-
() =>
|
|
4048
|
+
), h = Y(
|
|
4049
|
+
() => Ce(a, (b) => !c.includes(b.pageType)),
|
|
4018
4050
|
[a, c]
|
|
4019
|
-
), g =
|
|
4020
|
-
() =>
|
|
4051
|
+
), g = Y(
|
|
4052
|
+
() => Ce(a, (b) => c.includes(b.pageType)),
|
|
4021
4053
|
[a, c]
|
|
4022
|
-
), d =
|
|
4023
|
-
() =>
|
|
4054
|
+
), d = Y(
|
|
4055
|
+
() => ge(a, { pageType: "theme", id: "THEME" }),
|
|
4024
4056
|
[a]
|
|
4025
4057
|
), { mutate: w, isPending: y } = Ns();
|
|
4026
|
-
|
|
4027
|
-
const b = Fe(
|
|
4058
|
+
Se(() => {
|
|
4059
|
+
const b = Fe(Ce(a, { online: !0 }), "id");
|
|
4028
4060
|
d && b.push(d == null ? void 0 : d.id), s(b);
|
|
4029
4061
|
}, [a, d]);
|
|
4030
4062
|
const p = n.length === (a == null ? void 0 : a.length), S = (b) => {
|
|
4031
4063
|
s(
|
|
4032
|
-
(T) => Mt(T, b) ?
|
|
4064
|
+
(T) => Mt(T, b) ? Ce(T, (U) => U !== b) : Zs(T, b)
|
|
4033
4065
|
);
|
|
4034
4066
|
}, v = () => {
|
|
4035
4067
|
s(p ? [] : Fe(a, "id"));
|
|
@@ -4044,17 +4076,17 @@ function Co({
|
|
|
4044
4076
|
);
|
|
4045
4077
|
}, G = (b) => {
|
|
4046
4078
|
if (b === "theme") return "Theme";
|
|
4047
|
-
const T =
|
|
4079
|
+
const T = ge(l, { key: b });
|
|
4048
4080
|
return T ? T == null ? void 0 : T.name : b;
|
|
4049
|
-
}, E =
|
|
4081
|
+
}, E = Y(() => {
|
|
4050
4082
|
const b = [
|
|
4051
4083
|
{ label: "Updated", top: "pt-2" },
|
|
4052
|
-
...mn(
|
|
4053
|
-
...mn(
|
|
4054
|
-
].filter((
|
|
4084
|
+
...mn(Ce(h, { online: !0 }), "pageType"),
|
|
4085
|
+
...mn(Ce(g, { online: !0 }), "pageType")
|
|
4086
|
+
].filter((ee) => ee.pageType !== "theme"), T = [
|
|
4055
4087
|
{ label: "Offline", top: "pt-6" },
|
|
4056
|
-
...mn(
|
|
4057
|
-
...mn(
|
|
4088
|
+
...mn(Ce(h, { online: !1 }), "pageType"),
|
|
4089
|
+
...mn(Ce(g, { online: !1 }), "pageType")
|
|
4058
4090
|
], U = d ? [{ label: "Theme", top: "pt-6" }, d] : [];
|
|
4059
4091
|
return [...b, ...U, ...T];
|
|
4060
4092
|
}, [h, g, d]);
|
|
@@ -4168,7 +4200,7 @@ function Co({
|
|
|
4168
4200
|
/* @__PURE__ */ r(
|
|
4169
4201
|
_,
|
|
4170
4202
|
{
|
|
4171
|
-
disabled: y || i ||
|
|
4203
|
+
disabled: y || i || fe(a),
|
|
4172
4204
|
onClick: x,
|
|
4173
4205
|
children: y ? "Publishing..." : "Publish"
|
|
4174
4206
|
}
|
|
@@ -4177,8 +4209,8 @@ function Co({
|
|
|
4177
4209
|
] }) });
|
|
4178
4210
|
}
|
|
4179
4211
|
const Po = () => {
|
|
4180
|
-
const e =
|
|
4181
|
-
return
|
|
4212
|
+
const e = z(), t = X();
|
|
4213
|
+
return Ae({
|
|
4182
4214
|
queryKey: [I.GET_WEBSITE_DATA],
|
|
4183
4215
|
staleTime: 1e3 * 60 * 5,
|
|
4184
4216
|
queryFn: async () => e(t, {
|
|
@@ -4217,20 +4249,20 @@ function Vr({
|
|
|
4217
4249
|
] }) });
|
|
4218
4250
|
}
|
|
4219
4251
|
const Io = () => {
|
|
4220
|
-
const { selectedLang: e } = dt(), t = rt("getPreviewUrl", async (g) => g), [n, s] = P(""), { data: a, isFetching: i } = Re(), { data: l } = cn(), { data: o } = ke(), c =
|
|
4252
|
+
const { selectedLang: e } = dt(), t = rt("getPreviewUrl", async (g) => g), [n, s] = P(""), { data: a, isFetching: i } = Re(), { data: l } = cn(), { data: o } = ke(), c = Y(
|
|
4221
4253
|
() => {
|
|
4222
4254
|
var g;
|
|
4223
4255
|
return (g = l == null ? void 0 : l.find((d) => (d == null ? void 0 : d.lang) === e)) == null ? void 0 : g.slug;
|
|
4224
4256
|
},
|
|
4225
4257
|
[e, l]
|
|
4226
|
-
), h =
|
|
4258
|
+
), h = Ie(
|
|
4227
4259
|
(g) => {
|
|
4228
4260
|
var d;
|
|
4229
|
-
return (d =
|
|
4261
|
+
return (d = ge(o, { key: g })) == null ? void 0 : d.hasSlug;
|
|
4230
4262
|
},
|
|
4231
4263
|
[o]
|
|
4232
4264
|
);
|
|
4233
|
-
return
|
|
4265
|
+
return Se(() => {
|
|
4234
4266
|
(async () => {
|
|
4235
4267
|
if (c && typeof t == "function") {
|
|
4236
4268
|
const g = await t(c || "");
|
|
@@ -4238,14 +4270,14 @@ const Io = () => {
|
|
|
4238
4270
|
} else
|
|
4239
4271
|
s("");
|
|
4240
4272
|
})();
|
|
4241
|
-
}, [t, c]), !n || !h(a == null ? void 0 : a.pageType) || i ? null : /* @__PURE__ */ r(
|
|
4273
|
+
}, [t, c]), !n || !h(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(_, { variant: "ghost", size: "sm", className: "gap-2", children: [
|
|
4242
4274
|
/* @__PURE__ */ r(Dr, { className: "w-4 h-4" }),
|
|
4243
4275
|
" ",
|
|
4244
4276
|
B.PREVIEW
|
|
4245
4277
|
] }) }) });
|
|
4246
4278
|
}, ko = () => {
|
|
4247
4279
|
const [e, t] = ri();
|
|
4248
|
-
return /* @__PURE__ */ u(
|
|
4280
|
+
return /* @__PURE__ */ u(we, { children: [
|
|
4249
4281
|
/* @__PURE__ */ r(Vr, { content: B.THEME, children: /* @__PURE__ */ r(
|
|
4250
4282
|
_,
|
|
4251
4283
|
{
|
|
@@ -4260,7 +4292,7 @@ const Io = () => {
|
|
|
4260
4292
|
] });
|
|
4261
4293
|
}, Lo = () => {
|
|
4262
4294
|
const [e, t] = P(!1), { isLocked: n } = hn(), { savePage: s, saveState: a } = rr();
|
|
4263
|
-
|
|
4295
|
+
Se(() => {
|
|
4264
4296
|
const g = (d) => {
|
|
4265
4297
|
a === "UNSAVED" && (d.preventDefault(), d.returnValue = !1);
|
|
4266
4298
|
};
|
|
@@ -4268,16 +4300,16 @@ const Io = () => {
|
|
|
4268
4300
|
window.removeEventListener("beforeunload", g);
|
|
4269
4301
|
};
|
|
4270
4302
|
}, [a]);
|
|
4271
|
-
const i =
|
|
4303
|
+
const i = Ie(async () => {
|
|
4272
4304
|
t(!0), await s(!1);
|
|
4273
4305
|
}, [s]);
|
|
4274
|
-
|
|
4306
|
+
Se(() => {
|
|
4275
4307
|
a === "SAVED" && t(!1);
|
|
4276
4308
|
}, [a]);
|
|
4277
|
-
const l =
|
|
4309
|
+
const l = Y(() => {
|
|
4278
4310
|
if (a === "SAVED" || a === "UNSAVED") return a;
|
|
4279
4311
|
if (a === "SAVING") return e ? a : "SAVED";
|
|
4280
|
-
}, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: h } =
|
|
4312
|
+
}, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: h } = Y(() => {
|
|
4281
4313
|
switch (l) {
|
|
4282
4314
|
case "UNSAVED":
|
|
4283
4315
|
return {
|
|
@@ -4314,7 +4346,7 @@ const Io = () => {
|
|
|
4314
4346
|
}
|
|
4315
4347
|
);
|
|
4316
4348
|
}, Do = () => {
|
|
4317
|
-
const [e, t] = P(!1), [n, s] = P(!1), [a, i] = P(null), { data: l } = Re(), { mutate: o, isPending: c } = Ns(), [h] = ai(), { buttonText: g, buttonClassName: d, isPublished: w } =
|
|
4349
|
+
const [e, t] = P(!1), [n, s] = P(!1), [a, i] = P(null), { data: l } = Re(), { mutate: o, isPending: c } = Ns(), [h] = ai(), { buttonText: g, buttonClassName: d, isPublished: w } = Y(() => {
|
|
4318
4350
|
const p = l && (l == null ? void 0 : l.online);
|
|
4319
4351
|
return {
|
|
4320
4352
|
buttonClassName: p ? "hover:bg-green-600 bg-green-500" : "",
|
|
@@ -4322,7 +4354,7 @@ const Io = () => {
|
|
|
4322
4354
|
buttonText: p ? B.PUBLISHED : B.PUBLISH
|
|
4323
4355
|
};
|
|
4324
4356
|
}, [l]);
|
|
4325
|
-
return /* @__PURE__ */ u(
|
|
4357
|
+
return /* @__PURE__ */ u(we, { children: [
|
|
4326
4358
|
/* @__PURE__ */ u("div", { className: "flex", children: [
|
|
4327
4359
|
/* @__PURE__ */ u(
|
|
4328
4360
|
_,
|
|
@@ -4421,7 +4453,7 @@ const Io = () => {
|
|
|
4421
4453
|
] });
|
|
4422
4454
|
}, Go = () => {
|
|
4423
4455
|
const e = rt("settingComponent", null), [t, n] = P(!1);
|
|
4424
|
-
return e ? /* @__PURE__ */ u(
|
|
4456
|
+
return e ? /* @__PURE__ */ u(we, { children: [
|
|
4425
4457
|
/* @__PURE__ */ r(Vr, { content: B.WEBSITEDATA, children: /* @__PURE__ */ r(
|
|
4426
4458
|
_,
|
|
4427
4459
|
{
|
|
@@ -4437,10 +4469,10 @@ const Io = () => {
|
|
|
4437
4469
|
] }) : null;
|
|
4438
4470
|
}, Uo = () => {
|
|
4439
4471
|
const { data: e } = Re(), t = e && (e == null ? void 0 : e.online), { data: n } = ke();
|
|
4440
|
-
return
|
|
4472
|
+
return Ie(
|
|
4441
4473
|
(a) => {
|
|
4442
4474
|
var i;
|
|
4443
|
-
return (i =
|
|
4475
|
+
return (i = ge(n, { key: a })) == null ? void 0 : i.hasSlug;
|
|
4444
4476
|
},
|
|
4445
4477
|
[n]
|
|
4446
4478
|
)(e == null ? void 0 : e.pageType) ? /* @__PURE__ */ u(
|
|
@@ -4462,11 +4494,11 @@ function Ro() {
|
|
|
4462
4494
|
const { isLocked: e } = hn(), [t] = Ue(), n = t.get("lang"), s = Br(n);
|
|
4463
4495
|
return e || !s ? null : /* @__PURE__ */ u("div", { className: "flex items-center justify-end gap-1", children: [
|
|
4464
4496
|
/* @__PURE__ */ r(Eo, {}),
|
|
4465
|
-
/* @__PURE__ */ r(Oe, { permission:
|
|
4466
|
-
/* @__PURE__ */ r(Oe, { permission:
|
|
4497
|
+
/* @__PURE__ */ r(Oe, { permission: de.EDIT_THEME, children: /* @__PURE__ */ r(ko, {}) }),
|
|
4498
|
+
/* @__PURE__ */ r(Oe, { permission: de.EDIT_SETTINGS, children: /* @__PURE__ */ r(Go, {}) }),
|
|
4467
4499
|
/* @__PURE__ */ r(Io, {}),
|
|
4468
|
-
/* @__PURE__ */ r(Oe, { permission:
|
|
4469
|
-
/* @__PURE__ */ r(Oe, { permission:
|
|
4500
|
+
/* @__PURE__ */ r(Oe, { permission: de.SAVE_PAGE, children: /* @__PURE__ */ r(Lo, {}) }),
|
|
4501
|
+
/* @__PURE__ */ r(Oe, { permission: de.PUBLISH_PAGE, children: /* @__PURE__ */ r(Do, {}) }),
|
|
4470
4502
|
/* @__PURE__ */ r(Uo, {})
|
|
4471
4503
|
] });
|
|
4472
4504
|
}
|
|
@@ -4474,8 +4506,8 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4474
4506
|
/* @__PURE__ */ r(fo, {}),
|
|
4475
4507
|
/* @__PURE__ */ r(Ro, {})
|
|
4476
4508
|
] }), Bo = () => {
|
|
4477
|
-
const e =
|
|
4478
|
-
return
|
|
4509
|
+
const e = X(), { aiContext: t } = bs(), n = z();
|
|
4510
|
+
return Ie(
|
|
4479
4511
|
async (s, a, i, l) => n(e, {
|
|
4480
4512
|
action: I.ASK_AI,
|
|
4481
4513
|
data: { type: s, prompt: a, blocks: i, context: t, lang: l }
|
|
@@ -4502,27 +4534,27 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4502
4534
|
return n;
|
|
4503
4535
|
}), Fo = (e) => {
|
|
4504
4536
|
const t = ol();
|
|
4505
|
-
return
|
|
4506
|
-
if (!e ||
|
|
4507
|
-
const n =
|
|
4537
|
+
return Y(() => {
|
|
4538
|
+
if (!e || fe(e)) return { blocks: [] };
|
|
4539
|
+
const n = Ce(
|
|
4508
4540
|
e,
|
|
4509
4541
|
(s) => !Mt(s == null ? void 0 : s._type, "@chai/")
|
|
4510
4542
|
);
|
|
4511
4543
|
return { blocks: Mo(t, n) };
|
|
4512
4544
|
}, [e, t]);
|
|
4513
4545
|
}, qo = () => {
|
|
4514
|
-
const e =
|
|
4515
|
-
return
|
|
4516
|
-
queryKey: [
|
|
4546
|
+
const e = X(), t = z();
|
|
4547
|
+
return Ae({
|
|
4548
|
+
queryKey: [V, "uiLibraries"],
|
|
4517
4549
|
initialData: [],
|
|
4518
4550
|
queryFn: async () => (await t(e, { action: "GET_LIBRARIES" })).map((s) => ({
|
|
4519
4551
|
...s
|
|
4520
4552
|
}))
|
|
4521
4553
|
});
|
|
4522
4554
|
}, Ho = () => {
|
|
4523
|
-
const e = Un(), t =
|
|
4524
|
-
return
|
|
4525
|
-
queryKey: [
|
|
4555
|
+
const e = Un(), t = z(), { user: n } = st(), s = n == null ? void 0 : n.id;
|
|
4556
|
+
return Ae({
|
|
4557
|
+
queryKey: [V, "permissions", s],
|
|
4526
4558
|
queryFn: () => t(e, {
|
|
4527
4559
|
action: I.GET_ROLE_AND_PERMISSIONS,
|
|
4528
4560
|
data: { userId: s }
|
|
@@ -4530,12 +4562,12 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4530
4562
|
enabled: !!s
|
|
4531
4563
|
});
|
|
4532
4564
|
}, Ko = () => {
|
|
4533
|
-
const e =
|
|
4565
|
+
const e = X(), t = z(), { setCurrentEditor: n } = hn(), [, s] = ws();
|
|
4534
4566
|
return { getUILibraryBlock: async (o, c) => {
|
|
4535
4567
|
const h = await t(e, {
|
|
4536
4568
|
action: "GET_LIBRARY_ITEM",
|
|
4537
4569
|
data: { id: c.id }
|
|
4538
|
-
}), g =
|
|
4570
|
+
}), g = ne(h, "html", ""), d = ne(h, "blocks", []);
|
|
4539
4571
|
return za(d) ? d : ii(g);
|
|
4540
4572
|
}, getUILibraryBlocks: async (o) => {
|
|
4541
4573
|
try {
|
|
@@ -4568,19 +4600,19 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4568
4600
|
}
|
|
4569
4601
|
} };
|
|
4570
4602
|
}, Vo = () => {
|
|
4571
|
-
const { data: e } = Rn(), t =
|
|
4603
|
+
const { data: e } = Rn(), t = X(), n = z();
|
|
4572
4604
|
return {
|
|
4573
|
-
getPartialBlocks:
|
|
4605
|
+
getPartialBlocks: Ie(async () => {
|
|
4574
4606
|
const s = {};
|
|
4575
4607
|
for (const a of e ?? [])
|
|
4576
|
-
|
|
4608
|
+
fe(a == null ? void 0 : a.slug) && (s[a.id] = {
|
|
4577
4609
|
type: a.pageType,
|
|
4578
4610
|
name: It(a.name ?? a.slug),
|
|
4579
4611
|
description: ""
|
|
4580
4612
|
});
|
|
4581
4613
|
return s;
|
|
4582
4614
|
}, [e]),
|
|
4583
|
-
getPartialBlockBlocks:
|
|
4615
|
+
getPartialBlockBlocks: Ie(
|
|
4584
4616
|
async (s) => {
|
|
4585
4617
|
if (!s) return [];
|
|
4586
4618
|
try {
|
|
@@ -4588,7 +4620,7 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4588
4620
|
action: "GET_DRAFT_PAGE",
|
|
4589
4621
|
data: { id: s, draft: !0, editor: !1 }
|
|
4590
4622
|
});
|
|
4591
|
-
return
|
|
4623
|
+
return Ce(a.blocks, (i) => nn(i, "_id"));
|
|
4592
4624
|
} catch (a) {
|
|
4593
4625
|
return console.error(a), [];
|
|
4594
4626
|
}
|
|
@@ -4602,7 +4634,7 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4602
4634
|
}), jo = ({
|
|
4603
4635
|
onLoginSuccess: e
|
|
4604
4636
|
}) => {
|
|
4605
|
-
const t = Un(), [n, s] = P(""), [a, i] = P(""), [l, o] = P({}), [c, h] = P(!1), [g, d] = P(""), w =
|
|
4637
|
+
const t = Un(), [n, s] = P(""), [a, i] = P(""), [l, o] = P({}), [c, h] = P(!1), [g, d] = P(""), w = xe({
|
|
4606
4638
|
mutationFn: async (S) => {
|
|
4607
4639
|
d("");
|
|
4608
4640
|
const v = await Es(t, {
|
|
@@ -4648,9 +4680,9 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4648
4680
|
] }),
|
|
4649
4681
|
/* @__PURE__ */ r(ds, { children: /* @__PURE__ */ u("form", { onSubmit: y, className: "space-y-4", children: [
|
|
4650
4682
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
4651
|
-
/* @__PURE__ */ r(
|
|
4683
|
+
/* @__PURE__ */ r(Z, { htmlFor: "email", children: "Email" }),
|
|
4652
4684
|
/* @__PURE__ */ r(
|
|
4653
|
-
|
|
4685
|
+
ve,
|
|
4654
4686
|
{
|
|
4655
4687
|
id: "email",
|
|
4656
4688
|
placeholder: "you@example.com",
|
|
@@ -4663,10 +4695,10 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4663
4695
|
l.email && /* @__PURE__ */ r("p", { className: "text-sm text-destructive", children: l.email })
|
|
4664
4696
|
] }),
|
|
4665
4697
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
4666
|
-
/* @__PURE__ */ r(
|
|
4698
|
+
/* @__PURE__ */ r(Z, { htmlFor: "password", children: "Password" }),
|
|
4667
4699
|
/* @__PURE__ */ u("div", { className: "relative", children: [
|
|
4668
4700
|
/* @__PURE__ */ r(
|
|
4669
|
-
|
|
4701
|
+
ve,
|
|
4670
4702
|
{
|
|
4671
4703
|
id: "password",
|
|
4672
4704
|
placeholder: "Enter your password",
|
|
@@ -4695,7 +4727,7 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4695
4727
|
type: "submit",
|
|
4696
4728
|
className: "w-full",
|
|
4697
4729
|
disabled: !p || w.isPending,
|
|
4698
|
-
children: w.isPending ? /* @__PURE__ */ u(
|
|
4730
|
+
children: w.isPending ? /* @__PURE__ */ u(we, { children: [
|
|
4699
4731
|
/* @__PURE__ */ r(Gr, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
4700
4732
|
"Logging in..."
|
|
4701
4733
|
] }) : "Login"
|
|
@@ -4745,7 +4777,7 @@ const Oo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4745
4777
|
] }) });
|
|
4746
4778
|
};
|
|
4747
4779
|
let Wn = jo;
|
|
4748
|
-
const $o = () =>
|
|
4780
|
+
const $o = () => Y(() => Wn, [Wn]), Qu = (e) => {
|
|
4749
4781
|
Wn = e;
|
|
4750
4782
|
}, zo = () => {
|
|
4751
4783
|
const { setUser: e } = st(), t = $o();
|
|
@@ -4762,7 +4794,7 @@ const $o = () => W(() => Wn, [Wn]), Qu = (e) => {
|
|
|
4762
4794
|
show: t
|
|
4763
4795
|
}) => {
|
|
4764
4796
|
const { data: n } = un();
|
|
4765
|
-
return !nn(n, "languages") || !
|
|
4797
|
+
return !nn(n, "languages") || !ne(n, "languages", []).length ? null : /* @__PURE__ */ r(_, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ r(nl, { className: "w-4 h-4" }) });
|
|
4766
4798
|
}, jr = "lang", Yo = {
|
|
4767
4799
|
id: jr,
|
|
4768
4800
|
label: "Languages",
|
|
@@ -4778,22 +4810,22 @@ function Ze({
|
|
|
4778
4810
|
dataType: n = "value",
|
|
4779
4811
|
disabled: s = !1
|
|
4780
4812
|
}) {
|
|
4781
|
-
const [a, i] =
|
|
4782
|
-
|
|
4813
|
+
const [a, i] = ue.useState(!1), [l, o] = ue.useState([]), [c, h] = ue.useState(e);
|
|
4814
|
+
ue.useEffect(() => {
|
|
4783
4815
|
a || o([]), h(e);
|
|
4784
4816
|
}, [e, a]);
|
|
4785
|
-
const g = (p) => Array.isArray(p) ? "array" : typeof p == "object" && p !== null ? "object" : "value", d =
|
|
4817
|
+
const g = (p) => Array.isArray(p) ? "array" : typeof p == "object" && p !== null ? "object" : "value", d = ue.useCallback(
|
|
4786
4818
|
(p) => {
|
|
4787
4819
|
const S = (v) => n === "value" ? v === "value" || v === "object" : n === "array" ? v === "array" : v === n;
|
|
4788
4820
|
p.type === "object" ? (o((v) => [...v, p.key]), h(p.value)) : S(p.type) && (t([...l, p.key].join(".")), i(!1));
|
|
4789
4821
|
},
|
|
4790
4822
|
[l, t, n]
|
|
4791
|
-
), w =
|
|
4823
|
+
), w = ue.useCallback(() => {
|
|
4792
4824
|
if (l.length > 0) {
|
|
4793
4825
|
const p = l.slice(0, -1);
|
|
4794
4826
|
o(p), h(p.reduce((S, v) => S[v], e));
|
|
4795
4827
|
}
|
|
4796
|
-
}, [l, e]), y =
|
|
4828
|
+
}, [l, e]), y = ue.useMemo(() => Object.entries(c).map(([p, S]) => ({
|
|
4797
4829
|
key: p,
|
|
4798
4830
|
value: S,
|
|
4799
4831
|
type: g(S)
|
|
@@ -4863,7 +4895,7 @@ function Ze({
|
|
|
4863
4895
|
}
|
|
4864
4896
|
const Qo = () => {
|
|
4865
4897
|
const { selectedLang: e } = dt(), { data: t, isFetching: n } = cn();
|
|
4866
|
-
return { data:
|
|
4898
|
+
return { data: Y(() => ge(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
|
|
4867
4899
|
}, Xo = (e, t) => {
|
|
4868
4900
|
const n = e.selectionStart || 0, s = e.selectionEnd || 0, a = e.value, i = a.substring(0, n), l = a.substring(s);
|
|
4869
4901
|
let o = !1;
|
|
@@ -4901,8 +4933,8 @@ const Qo = () => {
|
|
|
4901
4933
|
searchDescription: "",
|
|
4902
4934
|
jsonLD: "",
|
|
4903
4935
|
...h
|
|
4904
|
-
}), y = ut({ initial: d, updated: d }), p = t.length ? t : n, { mutate: S, isPending: v } = Ss(), x = v, { hasPermission: G } = sn(), E = G(
|
|
4905
|
-
|
|
4936
|
+
}), y = ut({ initial: d, updated: d }), p = t.length ? t : n, { mutate: S, isPending: v } = Ss(), x = v, { hasPermission: G } = sn(), E = G(de.EDIT_SEO);
|
|
4937
|
+
Se(() => {
|
|
4906
4938
|
!c && h && w({
|
|
4907
4939
|
title: "",
|
|
4908
4940
|
description: "",
|
|
@@ -4939,40 +4971,40 @@ const Qo = () => {
|
|
|
4939
4971
|
searchTitle: d.ogTitle,
|
|
4940
4972
|
searchDescription: d.ogDescription
|
|
4941
4973
|
});
|
|
4942
|
-
},
|
|
4974
|
+
}, ee = (k, q) => {
|
|
4943
4975
|
const A = document.getElementById(q);
|
|
4944
4976
|
if (A) {
|
|
4945
|
-
const { value: M, newCursorPos:
|
|
4977
|
+
const { value: M, newCursorPos: se } = Xo(
|
|
4946
4978
|
A,
|
|
4947
4979
|
k
|
|
4948
4980
|
);
|
|
4949
4981
|
g.current = {
|
|
4950
4982
|
id: q,
|
|
4951
|
-
position:
|
|
4952
|
-
}, A.tagName.toLowerCase() === "input" ? (A.value = M, w((
|
|
4953
|
-
...
|
|
4983
|
+
position: se
|
|
4984
|
+
}, A.tagName.toLowerCase() === "input" ? (A.value = M, w((he) => ({
|
|
4985
|
+
...he,
|
|
4954
4986
|
[A.name]: M
|
|
4955
|
-
})), A.focus(), A.setSelectionRange(
|
|
4987
|
+
})), A.focus(), A.setSelectionRange(se, se), [0, 10, 50, 100, 200].forEach((he) => {
|
|
4956
4988
|
setTimeout(() => {
|
|
4957
4989
|
const F = document.getElementById(q);
|
|
4958
|
-
F && (F.focus(), F.setSelectionRange(
|
|
4959
|
-
},
|
|
4960
|
-
})) : (w((
|
|
4961
|
-
...
|
|
4990
|
+
F && (F.focus(), F.setSelectionRange(se, se));
|
|
4991
|
+
}, he);
|
|
4992
|
+
})) : (w((W) => ({
|
|
4993
|
+
...W,
|
|
4962
4994
|
[A.name]: M
|
|
4963
4995
|
})), requestAnimationFrame(() => {
|
|
4964
|
-
const
|
|
4996
|
+
const W = document.getElementById(
|
|
4965
4997
|
q
|
|
4966
4998
|
);
|
|
4967
|
-
|
|
4968
|
-
const
|
|
4999
|
+
W && (W.focus(), W.setSelectionRange(se, se), setTimeout(() => {
|
|
5000
|
+
const he = document.getElementById(
|
|
4969
5001
|
q
|
|
4970
5002
|
);
|
|
4971
|
-
|
|
5003
|
+
he && (he.focus(), he.setSelectionRange(se, se));
|
|
4972
5004
|
}, 50));
|
|
4973
5005
|
}));
|
|
4974
5006
|
}
|
|
4975
|
-
},
|
|
5007
|
+
}, le = (k) => {
|
|
4976
5008
|
const q = {
|
|
4977
5009
|
...d,
|
|
4978
5010
|
[k.target.name]: k.target.name === "noIndex" || k.target.name === "noFollow" ? k.target.checked : k.target.value
|
|
@@ -4991,7 +5023,7 @@ const Qo = () => {
|
|
|
4991
5023
|
" ",
|
|
4992
5024
|
s.length > 0 && /* @__PURE__ */ u("span", { className: "font-semibold text-blue-500", children: [
|
|
4993
5025
|
"(",
|
|
4994
|
-
|
|
5026
|
+
ne(qe, p, p),
|
|
4995
5027
|
")"
|
|
4996
5028
|
] })
|
|
4997
5029
|
] }),
|
|
@@ -5001,24 +5033,24 @@ const Qo = () => {
|
|
|
5001
5033
|
/* @__PURE__ */ r(yn, { className: "pt-2", children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
5002
5034
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5003
5035
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5004
|
-
/* @__PURE__ */ r(
|
|
5036
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "title", children: e("SEO Title") }),
|
|
5005
5037
|
E && /* @__PURE__ */ r(
|
|
5006
5038
|
Ze,
|
|
5007
5039
|
{
|
|
5008
5040
|
dataType: "value",
|
|
5009
5041
|
data: l ?? {},
|
|
5010
|
-
onSelect: (k) =>
|
|
5042
|
+
onSelect: (k) => ee(k, "title")
|
|
5011
5043
|
}
|
|
5012
5044
|
)
|
|
5013
5045
|
] }),
|
|
5014
5046
|
/* @__PURE__ */ r(
|
|
5015
|
-
|
|
5047
|
+
ve,
|
|
5016
5048
|
{
|
|
5017
5049
|
type: "text",
|
|
5018
5050
|
id: "title",
|
|
5019
5051
|
name: "title",
|
|
5020
5052
|
value: d.title,
|
|
5021
|
-
onChange:
|
|
5053
|
+
onChange: le,
|
|
5022
5054
|
disabled: x || !E,
|
|
5023
5055
|
placeholder: e("Enter SEO title"),
|
|
5024
5056
|
readOnly: !E
|
|
@@ -5027,12 +5059,12 @@ const Qo = () => {
|
|
|
5027
5059
|
] }),
|
|
5028
5060
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5029
5061
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5030
|
-
/* @__PURE__ */ r(
|
|
5062
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "description", children: e("SEO Description") }),
|
|
5031
5063
|
E && /* @__PURE__ */ r(
|
|
5032
5064
|
Ze,
|
|
5033
5065
|
{
|
|
5034
5066
|
data: l ?? {},
|
|
5035
|
-
onSelect: (k) =>
|
|
5067
|
+
onSelect: (k) => ee(k, "description")
|
|
5036
5068
|
}
|
|
5037
5069
|
)
|
|
5038
5070
|
] }),
|
|
@@ -5043,7 +5075,7 @@ const Qo = () => {
|
|
|
5043
5075
|
name: "description",
|
|
5044
5076
|
rows: 5,
|
|
5045
5077
|
value: d.description,
|
|
5046
|
-
onChange:
|
|
5078
|
+
onChange: le,
|
|
5047
5079
|
disabled: x || !E,
|
|
5048
5080
|
placeholder: e("Enter SEO description"),
|
|
5049
5081
|
readOnly: !E
|
|
@@ -5052,24 +5084,24 @@ const Qo = () => {
|
|
|
5052
5084
|
] }),
|
|
5053
5085
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5054
5086
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5055
|
-
/* @__PURE__ */ r(
|
|
5087
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "title", children: e("Canonical URL") }),
|
|
5056
5088
|
E && /* @__PURE__ */ r(
|
|
5057
5089
|
Ze,
|
|
5058
5090
|
{
|
|
5059
5091
|
dataType: "value",
|
|
5060
5092
|
data: l ?? {},
|
|
5061
|
-
onSelect: (k) =>
|
|
5093
|
+
onSelect: (k) => ee(k, "canonicalUrl")
|
|
5062
5094
|
}
|
|
5063
5095
|
)
|
|
5064
5096
|
] }),
|
|
5065
5097
|
/* @__PURE__ */ r(
|
|
5066
|
-
|
|
5098
|
+
ve,
|
|
5067
5099
|
{
|
|
5068
5100
|
type: "text",
|
|
5069
5101
|
id: "canonicalUrl",
|
|
5070
5102
|
name: "canonicalUrl",
|
|
5071
5103
|
value: d.canonicalUrl,
|
|
5072
|
-
onChange:
|
|
5104
|
+
onChange: le,
|
|
5073
5105
|
disabled: x || !E,
|
|
5074
5106
|
placeholder: e("Enter Canonical URL"),
|
|
5075
5107
|
readOnly: !E
|
|
@@ -5079,18 +5111,18 @@ const Qo = () => {
|
|
|
5079
5111
|
/* @__PURE__ */ u("div", { className: "", children: [
|
|
5080
5112
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
|
|
5081
5113
|
/* @__PURE__ */ r(
|
|
5082
|
-
|
|
5114
|
+
ve,
|
|
5083
5115
|
{
|
|
5084
5116
|
type: "checkbox",
|
|
5085
5117
|
id: "noIndex",
|
|
5086
5118
|
name: "noIndex",
|
|
5087
5119
|
checked: d.noIndex,
|
|
5088
|
-
onChange:
|
|
5120
|
+
onChange: le,
|
|
5089
5121
|
disabled: x || !E,
|
|
5090
5122
|
className: "w-4 h-4"
|
|
5091
5123
|
}
|
|
5092
5124
|
),
|
|
5093
|
-
/* @__PURE__ */ r(
|
|
5125
|
+
/* @__PURE__ */ r(Z, { className: "pb-1 text-xs", htmlFor: "noIndex", children: e("No Index") })
|
|
5094
5126
|
] }),
|
|
5095
5127
|
/* @__PURE__ */ r("p", { className: "mt-0 text-[10px] font-light text-gray-400 leading-4", children: e(
|
|
5096
5128
|
"Check this if you don't want search engines to index this page."
|
|
@@ -5099,18 +5131,18 @@ const Qo = () => {
|
|
|
5099
5131
|
/* @__PURE__ */ u("div", { className: "", children: [
|
|
5100
5132
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
|
|
5101
5133
|
/* @__PURE__ */ r(
|
|
5102
|
-
|
|
5134
|
+
ve,
|
|
5103
5135
|
{
|
|
5104
5136
|
type: "checkbox",
|
|
5105
5137
|
id: "noFollow",
|
|
5106
5138
|
name: "noFollow",
|
|
5107
5139
|
checked: d.noFollow,
|
|
5108
|
-
onChange:
|
|
5140
|
+
onChange: le,
|
|
5109
5141
|
disabled: x || !E,
|
|
5110
5142
|
className: "w-4 h-4"
|
|
5111
5143
|
}
|
|
5112
5144
|
),
|
|
5113
|
-
/* @__PURE__ */ r(
|
|
5145
|
+
/* @__PURE__ */ r(Z, { className: "pb-1 text-xs", htmlFor: "noIndex", children: e("No Follow") })
|
|
5114
5146
|
] }),
|
|
5115
5147
|
/* @__PURE__ */ r("p", { className: "text-[10px] font-light text-gray-400 leading-4", children: e(
|
|
5116
5148
|
"Check this if you don't want search engines to follow links on this page."
|
|
@@ -5134,24 +5166,24 @@ const Qo = () => {
|
|
|
5134
5166
|
) }),
|
|
5135
5167
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5136
5168
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5137
|
-
/* @__PURE__ */ r(
|
|
5169
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "ogTitle", children: e("OG Title") }),
|
|
5138
5170
|
E && /* @__PURE__ */ r(
|
|
5139
5171
|
Ze,
|
|
5140
5172
|
{
|
|
5141
5173
|
dataType: "value",
|
|
5142
5174
|
data: l ?? {},
|
|
5143
|
-
onSelect: (k) =>
|
|
5175
|
+
onSelect: (k) => ee(k, "ogTitle")
|
|
5144
5176
|
}
|
|
5145
5177
|
)
|
|
5146
5178
|
] }),
|
|
5147
5179
|
/* @__PURE__ */ r(
|
|
5148
|
-
|
|
5180
|
+
ve,
|
|
5149
5181
|
{
|
|
5150
5182
|
type: "text",
|
|
5151
5183
|
id: "ogTitle",
|
|
5152
5184
|
name: "ogTitle",
|
|
5153
5185
|
value: d.ogTitle,
|
|
5154
|
-
onChange:
|
|
5186
|
+
onChange: le,
|
|
5155
5187
|
disabled: x || !E,
|
|
5156
5188
|
placeholder: e("Enter OG title"),
|
|
5157
5189
|
readOnly: !E
|
|
@@ -5160,13 +5192,13 @@ const Qo = () => {
|
|
|
5160
5192
|
] }),
|
|
5161
5193
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5162
5194
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5163
|
-
/* @__PURE__ */ r(
|
|
5195
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "ogDescription", children: e("OG Description") }),
|
|
5164
5196
|
E && /* @__PURE__ */ r(
|
|
5165
5197
|
Ze,
|
|
5166
5198
|
{
|
|
5167
5199
|
dataType: "value",
|
|
5168
5200
|
data: l ?? {},
|
|
5169
|
-
onSelect: (k) =>
|
|
5201
|
+
onSelect: (k) => ee(k, "ogDescription")
|
|
5170
5202
|
}
|
|
5171
5203
|
)
|
|
5172
5204
|
] }),
|
|
@@ -5177,7 +5209,7 @@ const Qo = () => {
|
|
|
5177
5209
|
name: "ogDescription",
|
|
5178
5210
|
rows: 5,
|
|
5179
5211
|
value: d.ogDescription,
|
|
5180
|
-
onChange:
|
|
5212
|
+
onChange: le,
|
|
5181
5213
|
disabled: x || !E,
|
|
5182
5214
|
placeholder: e("Enter OG description"),
|
|
5183
5215
|
readOnly: !E
|
|
@@ -5186,24 +5218,24 @@ const Qo = () => {
|
|
|
5186
5218
|
] }),
|
|
5187
5219
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5188
5220
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5189
|
-
/* @__PURE__ */ r(
|
|
5221
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "ogImage", children: e("OG Image URL") }),
|
|
5190
5222
|
E && /* @__PURE__ */ r(
|
|
5191
5223
|
Ze,
|
|
5192
5224
|
{
|
|
5193
5225
|
dataType: "value",
|
|
5194
5226
|
data: l ?? {},
|
|
5195
|
-
onSelect: (k) =>
|
|
5227
|
+
onSelect: (k) => ee(k, "ogImage")
|
|
5196
5228
|
}
|
|
5197
5229
|
)
|
|
5198
5230
|
] }),
|
|
5199
5231
|
/* @__PURE__ */ r(
|
|
5200
|
-
|
|
5232
|
+
ve,
|
|
5201
5233
|
{
|
|
5202
5234
|
type: "text",
|
|
5203
5235
|
id: "ogImage",
|
|
5204
5236
|
name: "ogImage",
|
|
5205
5237
|
value: d.ogImage,
|
|
5206
|
-
onChange:
|
|
5238
|
+
onChange: le,
|
|
5207
5239
|
disabled: x || !E,
|
|
5208
5240
|
placeholder: e("Enter OG image URL"),
|
|
5209
5241
|
readOnly: !E
|
|
@@ -5228,24 +5260,24 @@ const Qo = () => {
|
|
|
5228
5260
|
) }),
|
|
5229
5261
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5230
5262
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5231
|
-
/* @__PURE__ */ r(
|
|
5263
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "searchTitle", children: e("Search Title") }),
|
|
5232
5264
|
E && /* @__PURE__ */ r(
|
|
5233
5265
|
Ze,
|
|
5234
5266
|
{
|
|
5235
5267
|
dataType: "value",
|
|
5236
5268
|
data: l ?? {},
|
|
5237
|
-
onSelect: (k) =>
|
|
5269
|
+
onSelect: (k) => ee(k, "searchTitle")
|
|
5238
5270
|
}
|
|
5239
5271
|
)
|
|
5240
5272
|
] }),
|
|
5241
5273
|
/* @__PURE__ */ r(
|
|
5242
|
-
|
|
5274
|
+
ve,
|
|
5243
5275
|
{
|
|
5244
5276
|
type: "text",
|
|
5245
5277
|
id: "searchTitle",
|
|
5246
5278
|
name: "searchTitle",
|
|
5247
5279
|
value: d.searchTitle,
|
|
5248
|
-
onChange:
|
|
5280
|
+
onChange: le,
|
|
5249
5281
|
disabled: x || !E,
|
|
5250
5282
|
placeholder: e("Enter search title"),
|
|
5251
5283
|
readOnly: !E
|
|
@@ -5254,13 +5286,13 @@ const Qo = () => {
|
|
|
5254
5286
|
] }),
|
|
5255
5287
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5256
5288
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5257
|
-
/* @__PURE__ */ r(
|
|
5289
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "searchDescription", children: e("Search Description") }),
|
|
5258
5290
|
E && /* @__PURE__ */ r(
|
|
5259
5291
|
Ze,
|
|
5260
5292
|
{
|
|
5261
5293
|
dataType: "value",
|
|
5262
5294
|
data: l ?? {},
|
|
5263
|
-
onSelect: (k) =>
|
|
5295
|
+
onSelect: (k) => ee(k, "searchDescription")
|
|
5264
5296
|
}
|
|
5265
5297
|
)
|
|
5266
5298
|
] }),
|
|
@@ -5271,7 +5303,7 @@ const Qo = () => {
|
|
|
5271
5303
|
rows: 5,
|
|
5272
5304
|
name: "searchDescription",
|
|
5273
5305
|
value: d.searchDescription,
|
|
5274
|
-
onChange:
|
|
5306
|
+
onChange: le,
|
|
5275
5307
|
placeholder: e("Enter search description"),
|
|
5276
5308
|
disabled: x || !E,
|
|
5277
5309
|
readOnly: !E
|
|
@@ -5284,13 +5316,13 @@ const Qo = () => {
|
|
|
5284
5316
|
/* @__PURE__ */ r(pn, { className: "font-bold text-slate-700", children: e("JSON-LD") }),
|
|
5285
5317
|
/* @__PURE__ */ r(yn, { children: /* @__PURE__ */ r("div", { className: "space-y-4", children: /* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5286
5318
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5287
|
-
/* @__PURE__ */ r(
|
|
5319
|
+
/* @__PURE__ */ r(Z, { className: "text-xs", htmlFor: "jsonLD", children: e("JSON-LD") }),
|
|
5288
5320
|
E && /* @__PURE__ */ r(
|
|
5289
5321
|
Ze,
|
|
5290
5322
|
{
|
|
5291
5323
|
dataType: "value",
|
|
5292
5324
|
data: l ?? {},
|
|
5293
|
-
onSelect: (k) =>
|
|
5325
|
+
onSelect: (k) => ee(k, "jsonLD")
|
|
5294
5326
|
}
|
|
5295
5327
|
)
|
|
5296
5328
|
] }),
|
|
@@ -5301,7 +5333,7 @@ const Qo = () => {
|
|
|
5301
5333
|
name: "jsonLD",
|
|
5302
5334
|
rows: 6,
|
|
5303
5335
|
value: d.jsonLD,
|
|
5304
|
-
onChange:
|
|
5336
|
+
onChange: le,
|
|
5305
5337
|
placeholder: e("Enter JSON-LD"),
|
|
5306
5338
|
disabled: x || !E,
|
|
5307
5339
|
readOnly: !E
|
|
@@ -5415,22 +5447,22 @@ var rc = (e, t) => e === t, Cn = Symbol("solid-proxy"), Wr = typeof Proxy == "fu
|
|
|
5415
5447
|
cleanups: null,
|
|
5416
5448
|
context: null,
|
|
5417
5449
|
owner: null
|
|
5418
|
-
}, Kn = {},
|
|
5450
|
+
}, Kn = {}, J = null, Vn = null, ac = null, ae = null, _e = null, Je = null, On = 0;
|
|
5419
5451
|
function ot(e, t) {
|
|
5420
|
-
const n =
|
|
5452
|
+
const n = ae, s = J, a = e.length === 0, i = t === void 0 ? s : t, l = a ? Xr : {
|
|
5421
5453
|
owned: null,
|
|
5422
5454
|
cleanups: null,
|
|
5423
5455
|
context: i ? i.context : null,
|
|
5424
5456
|
owner: i
|
|
5425
|
-
}, o = a ? e : () => e(() =>
|
|
5426
|
-
|
|
5457
|
+
}, o = a ? e : () => e(() => Pe(() => qt(l)));
|
|
5458
|
+
J = l, ae = null;
|
|
5427
5459
|
try {
|
|
5428
5460
|
return We(o, !0);
|
|
5429
5461
|
} finally {
|
|
5430
|
-
|
|
5462
|
+
ae = n, J = s;
|
|
5431
5463
|
}
|
|
5432
5464
|
}
|
|
5433
|
-
function
|
|
5465
|
+
function Ee(e, t) {
|
|
5434
5466
|
t = t ? Object.assign({}, Pn, t) : Pn;
|
|
5435
5467
|
const n = {
|
|
5436
5468
|
value: e,
|
|
@@ -5465,9 +5497,9 @@ function oc(e, t, n) {
|
|
|
5465
5497
|
let s, a, i;
|
|
5466
5498
|
arguments.length === 1 ? (s = !0, a = e, i = {}) : (s = e, a = t, i = {});
|
|
5467
5499
|
let l = null, o = Kn, c = null, h = !1, g = "initialValue" in i, d = typeof s == "function" && Ge(s);
|
|
5468
|
-
const w = /* @__PURE__ */ new Set(), [y, p] = (i.storage ||
|
|
5500
|
+
const w = /* @__PURE__ */ new Set(), [y, p] = (i.storage || Ee)(i.initialValue), [S, v] = Ee(void 0), [x, G] = Ee(void 0, {
|
|
5469
5501
|
equals: !1
|
|
5470
|
-
}), [E, b] =
|
|
5502
|
+
}), [E, b] = Ee(g ? "ready" : "unresolved");
|
|
5471
5503
|
O.context && (c = O.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : O.load && O.has(c) && (o = O.load(c)));
|
|
5472
5504
|
function T(k, q, A, M) {
|
|
5473
5505
|
return l === k && (l = null, M !== void 0 && (g = !0), (k === o || q === o) && i.onHydrated && queueMicrotask(
|
|
@@ -5484,22 +5516,22 @@ function oc(e, t, n) {
|
|
|
5484
5516
|
w.clear();
|
|
5485
5517
|
}, !1);
|
|
5486
5518
|
}
|
|
5487
|
-
function
|
|
5519
|
+
function ee() {
|
|
5488
5520
|
const k = mc, q = y(), A = S();
|
|
5489
5521
|
if (A !== void 0 && !l)
|
|
5490
5522
|
throw A;
|
|
5491
|
-
return
|
|
5523
|
+
return ae && ae.user, q;
|
|
5492
5524
|
}
|
|
5493
|
-
function
|
|
5525
|
+
function le(k = !0) {
|
|
5494
5526
|
if (k !== !1 && h)
|
|
5495
5527
|
return;
|
|
5496
5528
|
h = !1;
|
|
5497
5529
|
const q = d ? d() : s;
|
|
5498
5530
|
if (q == null || q === !1) {
|
|
5499
|
-
T(l,
|
|
5531
|
+
T(l, Pe(y));
|
|
5500
5532
|
return;
|
|
5501
5533
|
}
|
|
5502
|
-
const A = o !== Kn ? o :
|
|
5534
|
+
const A = o !== Kn ? o : Pe(
|
|
5503
5535
|
() => a(q, {
|
|
5504
5536
|
value: y(),
|
|
5505
5537
|
refetching: k
|
|
@@ -5512,7 +5544,7 @@ function oc(e, t, n) {
|
|
|
5512
5544
|
(M) => T(A, void 0, Yn(M), q)
|
|
5513
5545
|
))) : (T(l, A, void 0, q), A);
|
|
5514
5546
|
}
|
|
5515
|
-
return Object.defineProperties(
|
|
5547
|
+
return Object.defineProperties(ee, {
|
|
5516
5548
|
state: {
|
|
5517
5549
|
get: () => E()
|
|
5518
5550
|
},
|
|
@@ -5528,17 +5560,17 @@ function oc(e, t, n) {
|
|
|
5528
5560
|
latest: {
|
|
5529
5561
|
get() {
|
|
5530
5562
|
if (!g)
|
|
5531
|
-
return
|
|
5563
|
+
return ee();
|
|
5532
5564
|
const k = S();
|
|
5533
5565
|
if (k && !l)
|
|
5534
5566
|
throw k;
|
|
5535
5567
|
return y();
|
|
5536
5568
|
}
|
|
5537
5569
|
}
|
|
5538
|
-
}), d ? ic(() =>
|
|
5539
|
-
|
|
5570
|
+
}), d ? ic(() => le(!1)) : le(!1), [
|
|
5571
|
+
ee,
|
|
5540
5572
|
{
|
|
5541
|
-
refetch:
|
|
5573
|
+
refetch: le,
|
|
5542
5574
|
mutate: p
|
|
5543
5575
|
}
|
|
5544
5576
|
];
|
|
@@ -5546,15 +5578,15 @@ function oc(e, t, n) {
|
|
|
5546
5578
|
function Xu(e) {
|
|
5547
5579
|
return We(e, !1);
|
|
5548
5580
|
}
|
|
5549
|
-
function
|
|
5550
|
-
if (
|
|
5581
|
+
function Pe(e) {
|
|
5582
|
+
if (ae === null)
|
|
5551
5583
|
return e();
|
|
5552
|
-
const t =
|
|
5553
|
-
|
|
5584
|
+
const t = ae;
|
|
5585
|
+
ae = null;
|
|
5554
5586
|
try {
|
|
5555
5587
|
return e();
|
|
5556
5588
|
} finally {
|
|
5557
|
-
|
|
5589
|
+
ae = t;
|
|
5558
5590
|
}
|
|
5559
5591
|
}
|
|
5560
5592
|
function Zu(e, t, n) {
|
|
@@ -5570,39 +5602,39 @@ function Zu(e, t, n) {
|
|
|
5570
5602
|
o = e();
|
|
5571
5603
|
if (i)
|
|
5572
5604
|
return i = !1, l;
|
|
5573
|
-
const c =
|
|
5605
|
+
const c = Pe(() => t(o, a, l));
|
|
5574
5606
|
return a = o, c;
|
|
5575
5607
|
};
|
|
5576
5608
|
}
|
|
5577
5609
|
function cc(e) {
|
|
5578
|
-
Zr(() =>
|
|
5610
|
+
Zr(() => Pe(e));
|
|
5579
5611
|
}
|
|
5580
5612
|
function Ft(e) {
|
|
5581
|
-
return
|
|
5613
|
+
return J === null || (J.cleanups === null ? J.cleanups = [e] : J.cleanups.push(e)), e;
|
|
5582
5614
|
}
|
|
5583
5615
|
function Hs() {
|
|
5584
|
-
return
|
|
5616
|
+
return J;
|
|
5585
5617
|
}
|
|
5586
5618
|
function uc(e, t) {
|
|
5587
|
-
const n =
|
|
5588
|
-
|
|
5619
|
+
const n = J, s = ae;
|
|
5620
|
+
J = e, ae = null;
|
|
5589
5621
|
try {
|
|
5590
5622
|
return We(t, !0);
|
|
5591
5623
|
} catch (a) {
|
|
5592
5624
|
Ts(a);
|
|
5593
5625
|
} finally {
|
|
5594
|
-
|
|
5626
|
+
J = n, ae = s;
|
|
5595
5627
|
}
|
|
5596
5628
|
}
|
|
5597
5629
|
function dc(e) {
|
|
5598
|
-
const t =
|
|
5630
|
+
const t = ae, n = J;
|
|
5599
5631
|
return Promise.resolve().then(() => {
|
|
5600
|
-
|
|
5632
|
+
ae = t, J = n;
|
|
5601
5633
|
let s;
|
|
5602
|
-
return We(e, !1),
|
|
5634
|
+
return We(e, !1), ae = J = null, s ? s.done : void 0;
|
|
5603
5635
|
});
|
|
5604
5636
|
}
|
|
5605
|
-
var [hc, Ju] = /* @__PURE__ */
|
|
5637
|
+
var [hc, Ju] = /* @__PURE__ */ Ee(!1);
|
|
5606
5638
|
function ed() {
|
|
5607
5639
|
return [hc, dc];
|
|
5608
5640
|
}
|
|
@@ -5616,7 +5648,7 @@ function td(e, t) {
|
|
|
5616
5648
|
}
|
|
5617
5649
|
function nd(e) {
|
|
5618
5650
|
let t;
|
|
5619
|
-
return
|
|
5651
|
+
return J && J.context && (t = J.context[e.id]) !== void 0 ? t : e.defaultValue;
|
|
5620
5652
|
}
|
|
5621
5653
|
function Jr(e) {
|
|
5622
5654
|
const t = Ge(e), n = Ge(() => Qn(t()));
|
|
@@ -5631,12 +5663,12 @@ function ea() {
|
|
|
5631
5663
|
if (this.state === tt)
|
|
5632
5664
|
Lt(this);
|
|
5633
5665
|
else {
|
|
5634
|
-
const e =
|
|
5635
|
-
|
|
5666
|
+
const e = _e;
|
|
5667
|
+
_e = null, We(() => kn(this), !1), _e = e;
|
|
5636
5668
|
}
|
|
5637
|
-
if (
|
|
5669
|
+
if (ae) {
|
|
5638
5670
|
const e = this.observers ? this.observers.length : 0;
|
|
5639
|
-
|
|
5671
|
+
ae.sources ? (ae.sources.push(this), ae.sourceSlots.push(e)) : (ae.sources = [this], ae.sourceSlots = [e]), this.observers ? (this.observers.push(ae), this.observerSlots.push(ae.sources.length - 1)) : (this.observers = [ae], this.observerSlots = [ae.sources.length - 1]);
|
|
5640
5672
|
}
|
|
5641
5673
|
return this.value;
|
|
5642
5674
|
}
|
|
@@ -5645,10 +5677,10 @@ function ta(e, t, n) {
|
|
|
5645
5677
|
return (!e.comparator || !e.comparator(s, t)) && (e.value = t, e.observers && e.observers.length && We(() => {
|
|
5646
5678
|
for (let a = 0; a < e.observers.length; a += 1) {
|
|
5647
5679
|
const i = e.observers[a], l = Vn && Vn.running;
|
|
5648
|
-
l && Vn.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ?
|
|
5680
|
+
l && Vn.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? _e.push(i) : Je.push(i), i.observers && sa(i)), l || (i.state = tt);
|
|
5649
5681
|
}
|
|
5650
|
-
if (
|
|
5651
|
-
throw
|
|
5682
|
+
if (_e.length > 1e6)
|
|
5683
|
+
throw _e = [], new Error();
|
|
5652
5684
|
}, !1)), t;
|
|
5653
5685
|
}
|
|
5654
5686
|
function Lt(e) {
|
|
@@ -5664,14 +5696,14 @@ function Lt(e) {
|
|
|
5664
5696
|
}
|
|
5665
5697
|
function fc(e, t, n) {
|
|
5666
5698
|
let s;
|
|
5667
|
-
const a =
|
|
5668
|
-
|
|
5699
|
+
const a = J, i = ae;
|
|
5700
|
+
ae = J = e;
|
|
5669
5701
|
try {
|
|
5670
5702
|
s = e.fn(t);
|
|
5671
5703
|
} catch (l) {
|
|
5672
5704
|
return e.pure && (e.state = tt, e.owned && e.owned.forEach(qt), e.owned = null), e.updatedAt = n + 1, Ts(l);
|
|
5673
5705
|
} finally {
|
|
5674
|
-
|
|
5706
|
+
ae = i, J = a;
|
|
5675
5707
|
}
|
|
5676
5708
|
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? ta(e, s) : e.value = s, e.updatedAt = n);
|
|
5677
5709
|
}
|
|
@@ -5685,18 +5717,18 @@ function Bn(e, t, n, s = tt, a) {
|
|
|
5685
5717
|
sourceSlots: null,
|
|
5686
5718
|
cleanups: null,
|
|
5687
5719
|
value: t,
|
|
5688
|
-
owner:
|
|
5689
|
-
context:
|
|
5720
|
+
owner: J,
|
|
5721
|
+
context: J ? J.context : null,
|
|
5690
5722
|
pure: n
|
|
5691
5723
|
};
|
|
5692
|
-
return
|
|
5724
|
+
return J === null || J !== Xr && (J.owned ? J.owned.push(i) : J.owned = [i]), i;
|
|
5693
5725
|
}
|
|
5694
5726
|
function In(e) {
|
|
5695
5727
|
if (e.state === 0)
|
|
5696
5728
|
return;
|
|
5697
5729
|
if (e.state === _n)
|
|
5698
5730
|
return kn(e);
|
|
5699
|
-
if (e.suspense &&
|
|
5731
|
+
if (e.suspense && Pe(e.suspense.inFallback))
|
|
5700
5732
|
return e.suspense.effects.push(e);
|
|
5701
5733
|
const t = [e];
|
|
5702
5734
|
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < On); )
|
|
@@ -5705,24 +5737,24 @@ function In(e) {
|
|
|
5705
5737
|
if (e = t[n], e.state === tt)
|
|
5706
5738
|
Lt(e);
|
|
5707
5739
|
else if (e.state === _n) {
|
|
5708
|
-
const s =
|
|
5709
|
-
|
|
5740
|
+
const s = _e;
|
|
5741
|
+
_e = null, We(() => kn(e, t[0]), !1), _e = s;
|
|
5710
5742
|
}
|
|
5711
5743
|
}
|
|
5712
5744
|
function We(e, t) {
|
|
5713
|
-
if (
|
|
5745
|
+
if (_e)
|
|
5714
5746
|
return e();
|
|
5715
5747
|
let n = !1;
|
|
5716
|
-
t || (
|
|
5748
|
+
t || (_e = []), Je ? n = !0 : Je = [], On++;
|
|
5717
5749
|
try {
|
|
5718
5750
|
const s = e();
|
|
5719
5751
|
return gc(n), s;
|
|
5720
5752
|
} catch (s) {
|
|
5721
|
-
n || (Je = null),
|
|
5753
|
+
n || (Je = null), _e = null, Ts(s);
|
|
5722
5754
|
}
|
|
5723
5755
|
}
|
|
5724
5756
|
function gc(e) {
|
|
5725
|
-
if (
|
|
5757
|
+
if (_e && (na(_e), _e = null), e)
|
|
5726
5758
|
return;
|
|
5727
5759
|
const t = Je;
|
|
5728
5760
|
Je = null, t.length && We(() => Qr(t), !1);
|
|
@@ -5760,7 +5792,7 @@ function kn(e, t) {
|
|
|
5760
5792
|
function sa(e) {
|
|
5761
5793
|
for (let t = 0; t < e.observers.length; t += 1) {
|
|
5762
5794
|
const n = e.observers[t];
|
|
5763
|
-
n.state || (n.state = _n, n.pure ?
|
|
5795
|
+
n.state || (n.state = _n, n.pure ? _e.push(n) : Je.push(n), n.observers && sa(n));
|
|
5764
5796
|
}
|
|
5765
5797
|
}
|
|
5766
5798
|
function qt(e) {
|
|
@@ -5795,7 +5827,7 @@ function Yn(e) {
|
|
|
5795
5827
|
cause: e
|
|
5796
5828
|
});
|
|
5797
5829
|
}
|
|
5798
|
-
function Ts(e, t =
|
|
5830
|
+
function Ts(e, t = J) {
|
|
5799
5831
|
throw Yn(e);
|
|
5800
5832
|
}
|
|
5801
5833
|
function Qn(e) {
|
|
@@ -5815,8 +5847,8 @@ function yc(e, t) {
|
|
|
5815
5847
|
return function(s) {
|
|
5816
5848
|
let a;
|
|
5817
5849
|
return ct(
|
|
5818
|
-
() => a =
|
|
5819
|
-
...
|
|
5850
|
+
() => a = Pe(() => (J.context = {
|
|
5851
|
+
...J.context,
|
|
5820
5852
|
[e]: s.value
|
|
5821
5853
|
}, Jr(() => s.children))),
|
|
5822
5854
|
void 0
|
|
@@ -5832,7 +5864,7 @@ function vc(e, t, n = {}) {
|
|
|
5832
5864
|
let s = [], a = [], i = [], l = 0, o = t.length > 1 ? [] : null;
|
|
5833
5865
|
return Ft(() => Ln(i)), () => {
|
|
5834
5866
|
let c = e() || [], h = c.length, g, d;
|
|
5835
|
-
return c[Yr],
|
|
5867
|
+
return c[Yr], Pe(() => {
|
|
5836
5868
|
let y, p, S, v, x, G, E, b, T;
|
|
5837
5869
|
if (h === 0)
|
|
5838
5870
|
l !== 0 && (Ln(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Xn], a[0] = ot((U) => (i[0] = U, n.fallback())), l = 1);
|
|
@@ -5857,7 +5889,7 @@ function vc(e, t, n = {}) {
|
|
|
5857
5889
|
});
|
|
5858
5890
|
function w(y) {
|
|
5859
5891
|
if (i[d] = y, o) {
|
|
5860
|
-
const [p, S] =
|
|
5892
|
+
const [p, S] = Ee(d);
|
|
5861
5893
|
return o[d] = S, t(c[d], p);
|
|
5862
5894
|
}
|
|
5863
5895
|
return t(c[d]);
|
|
@@ -5868,7 +5900,7 @@ function Ec(e, t, n = {}) {
|
|
|
5868
5900
|
let s = [], a = [], i = [], l = [], o = 0, c;
|
|
5869
5901
|
return Ft(() => Ln(i)), () => {
|
|
5870
5902
|
const h = e() || [], g = h.length;
|
|
5871
|
-
return h[Yr],
|
|
5903
|
+
return h[Yr], Pe(() => {
|
|
5872
5904
|
if (g === 0)
|
|
5873
5905
|
return o !== 0 && (Ln(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [Xn], a[0] = ot((w) => (i[0] = w, n.fallback())), o = 1), a;
|
|
5874
5906
|
for (s[0] === Xn && (i[0](), i = [], s = [], a = [], o = 0), c = 0; c < g; c++)
|
|
@@ -5879,13 +5911,13 @@ function Ec(e, t, n = {}) {
|
|
|
5879
5911
|
});
|
|
5880
5912
|
function d(w) {
|
|
5881
5913
|
i[c] = w;
|
|
5882
|
-
const [y, p] =
|
|
5914
|
+
const [y, p] = Ee(h[c]);
|
|
5883
5915
|
return l[c] = p, t(y, c);
|
|
5884
5916
|
}
|
|
5885
5917
|
};
|
|
5886
5918
|
}
|
|
5887
5919
|
function ra(e, t) {
|
|
5888
|
-
return
|
|
5920
|
+
return Pe(() => e(t || {}));
|
|
5889
5921
|
}
|
|
5890
5922
|
function vn() {
|
|
5891
5923
|
return !0;
|
|
@@ -6033,7 +6065,7 @@ function ia(e) {
|
|
|
6033
6065
|
const s = (a) => {
|
|
6034
6066
|
const i = O.context;
|
|
6035
6067
|
if (i) {
|
|
6036
|
-
const [o, c] =
|
|
6068
|
+
const [o, c] = Ee();
|
|
6037
6069
|
O.count || (O.count = 0), O.count++, (n || (n = e())).then((h) => {
|
|
6038
6070
|
!O.done && Ut(i), O.count--, c(() => h.default), Ut();
|
|
6039
6071
|
}), t = o;
|
|
@@ -6043,7 +6075,7 @@ function ia(e) {
|
|
|
6043
6075
|
}
|
|
6044
6076
|
let l;
|
|
6045
6077
|
return Ge(
|
|
6046
|
-
() => (l = t()) ?
|
|
6078
|
+
() => (l = t()) ? Pe(() => {
|
|
6047
6079
|
if (!i || O.done)
|
|
6048
6080
|
return l(a);
|
|
6049
6081
|
const o = O.context;
|
|
@@ -6081,10 +6113,10 @@ function id(e) {
|
|
|
6081
6113
|
const s = n();
|
|
6082
6114
|
if (s) {
|
|
6083
6115
|
const a = e.children;
|
|
6084
|
-
return typeof a == "function" && a.length > 0 ?
|
|
6116
|
+
return typeof a == "function" && a.length > 0 ? Pe(
|
|
6085
6117
|
() => a(
|
|
6086
6118
|
t ? s : () => {
|
|
6087
|
-
if (!
|
|
6119
|
+
if (!Pe(n))
|
|
6088
6120
|
throw la("Show");
|
|
6089
6121
|
return e.when;
|
|
6090
6122
|
}
|
|
@@ -6121,10 +6153,10 @@ function ld(e) {
|
|
|
6121
6153
|
if (i < 0)
|
|
6122
6154
|
return e.fallback;
|
|
6123
6155
|
const c = o.children;
|
|
6124
|
-
return typeof c == "function" && c.length > 0 ?
|
|
6156
|
+
return typeof c == "function" && c.length > 0 ? Pe(
|
|
6125
6157
|
() => c(
|
|
6126
6158
|
t ? l : () => {
|
|
6127
|
-
if (
|
|
6159
|
+
if (Pe(a)[0] !== i)
|
|
6128
6160
|
throw la("Match");
|
|
6129
6161
|
return o.when;
|
|
6130
6162
|
}
|
|
@@ -6446,7 +6478,7 @@ function Fc(e, t = {}, n, s) {
|
|
|
6446
6478
|
), ct(() => typeof t.ref == "function" && qc(t.ref, e)), ct(() => Hc(e, t, n, !0, a, !0)), a;
|
|
6447
6479
|
}
|
|
6448
6480
|
function qc(e, t, n) {
|
|
6449
|
-
return
|
|
6481
|
+
return Pe(() => e(t, n));
|
|
6450
6482
|
}
|
|
6451
6483
|
function es(e, t, n, s) {
|
|
6452
6484
|
if (n !== void 0 && !s && (s = []), typeof t != "function")
|
|
@@ -6696,7 +6728,7 @@ function dd(e) {
|
|
|
6696
6728
|
l && (Hs().user = l = !1), i || (i = uc(a, () => Ge(() => e.children)));
|
|
6697
6729
|
const o = s();
|
|
6698
6730
|
if (o instanceof HTMLHeadElement) {
|
|
6699
|
-
const [c, h] =
|
|
6731
|
+
const [c, h] = Ee(!1), g = () => h(!0);
|
|
6700
6732
|
ot((d) => es(o, () => c() ? d() : i(), null)), Ft(g);
|
|
6701
6733
|
} else {
|
|
6702
6734
|
const c = ua(e.isSVG ? "g" : "div", e.isSVG), h = t && c.attachShadow ? c.attachShadow({
|
|
@@ -6722,7 +6754,7 @@ function hd(e) {
|
|
|
6722
6754
|
const a = s();
|
|
6723
6755
|
switch (typeof a) {
|
|
6724
6756
|
case "function":
|
|
6725
|
-
return
|
|
6757
|
+
return Pe(() => a(n));
|
|
6726
6758
|
case "string":
|
|
6727
6759
|
const i = Ic.has(a), l = O.context ? Kc() : ua(a, i);
|
|
6728
6760
|
return Fc(l, n, i), l;
|
|
@@ -7173,7 +7205,7 @@ function as(e, t = {}) {
|
|
|
7173
7205
|
return wu(a, i, o, e, t.nonenumerable), a;
|
|
7174
7206
|
}, {});
|
|
7175
7207
|
}
|
|
7176
|
-
var
|
|
7208
|
+
var ie = class {
|
|
7177
7209
|
/**
|
|
7178
7210
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
7179
7211
|
*/
|
|
@@ -7221,16 +7253,16 @@ var ae = class {
|
|
|
7221
7253
|
this.allowedErrorProps.push(...e);
|
|
7222
7254
|
}
|
|
7223
7255
|
};
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
var Su =
|
|
7256
|
+
ie.defaultInstance = new ie();
|
|
7257
|
+
ie.serialize = ie.defaultInstance.serialize.bind(ie.defaultInstance);
|
|
7258
|
+
ie.deserialize = ie.defaultInstance.deserialize.bind(ie.defaultInstance);
|
|
7259
|
+
ie.stringify = ie.defaultInstance.stringify.bind(ie.defaultInstance);
|
|
7260
|
+
ie.parse = ie.defaultInstance.parse.bind(ie.defaultInstance);
|
|
7261
|
+
ie.registerClass = ie.defaultInstance.registerClass.bind(ie.defaultInstance);
|
|
7262
|
+
ie.registerSymbol = ie.defaultInstance.registerSymbol.bind(ie.defaultInstance);
|
|
7263
|
+
ie.registerCustom = ie.defaultInstance.registerCustom.bind(ie.defaultInstance);
|
|
7264
|
+
ie.allowErrorProps = ie.defaultInstance.allowErrorProps.bind(ie.defaultInstance);
|
|
7265
|
+
var Su = ie.serialize, md = ie.stringify;
|
|
7234
7266
|
function fd(e) {
|
|
7235
7267
|
return e.state.fetchStatus === "fetching" ? "fetching" : e.getObserversCount() ? e.state.fetchStatus === "paused" ? "paused" : e.isStale() ? "stale" : "fresh" : "inactive";
|
|
7236
7268
|
}
|
|
@@ -7266,7 +7298,7 @@ var Ed = (e, t = !1) => {
|
|
|
7266
7298
|
status: xu,
|
|
7267
7299
|
"last updated": Ta
|
|
7268
7300
|
}, Sd = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), Nd = () => {
|
|
7269
|
-
const [e, t] =
|
|
7301
|
+
const [e, t] = Ee("dark");
|
|
7270
7302
|
return cc(() => {
|
|
7271
7303
|
const n = window.matchMedia("(prefers-color-scheme: dark)");
|
|
7272
7304
|
t(n.matches ? "dark" : "light");
|
|
@@ -7342,19 +7374,19 @@ var Ed = (e, t = !1) => {
|
|
|
7342
7374
|
s.appendChild(a), s.id = "_goober", s.setAttribute("nonce", e), t ? t.appendChild(s) : document.head.appendChild(s);
|
|
7343
7375
|
}, gt, $t, zt, Wt, it, Yt, pt, yt, vt, Et, bt, wt, Qt, Qs, Tu = (Qs = class {
|
|
7344
7376
|
constructor(e) {
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7377
|
+
re(this, gt);
|
|
7378
|
+
re(this, $t);
|
|
7379
|
+
re(this, zt);
|
|
7380
|
+
re(this, Wt);
|
|
7381
|
+
re(this, it, !1);
|
|
7382
|
+
re(this, Yt);
|
|
7383
|
+
re(this, pt);
|
|
7384
|
+
re(this, yt);
|
|
7385
|
+
re(this, vt);
|
|
7386
|
+
re(this, Et);
|
|
7387
|
+
re(this, bt);
|
|
7388
|
+
re(this, wt);
|
|
7389
|
+
re(this, Qt);
|
|
7358
7390
|
const {
|
|
7359
7391
|
client: t,
|
|
7360
7392
|
queryFlavor: n,
|
|
@@ -7367,7 +7399,7 @@ var Ed = (e, t = !1) => {
|
|
|
7367
7399
|
styleNonce: h,
|
|
7368
7400
|
shadowDOMTarget: g
|
|
7369
7401
|
} = e;
|
|
7370
|
-
|
|
7402
|
+
te(this, gt, Ee(t)), te(this, zt, n), te(this, Wt, s), te(this, $t, a), te(this, Yt, h), te(this, pt, g), te(this, yt, Ee(i)), te(this, vt, Ee(l)), te(this, Et, Ee(o)), te(this, bt, Ee(c));
|
|
7371
7403
|
}
|
|
7372
7404
|
setButtonPosition(e) {
|
|
7373
7405
|
R(this, yt)[1](e);
|
|
@@ -7390,7 +7422,7 @@ var Ed = (e, t = !1) => {
|
|
|
7390
7422
|
const t = oa(() => {
|
|
7391
7423
|
const n = this, [s] = R(this, yt), [a] = R(this, vt), [i] = R(this, Et), [l] = R(this, bt), [o] = R(this, gt);
|
|
7392
7424
|
let c;
|
|
7393
|
-
return R(this, wt) ? c = R(this, wt) : (c = ia(() => import("./HO4MOOFI-
|
|
7425
|
+
return R(this, wt) ? c = R(this, wt) : (c = ia(() => import("./HO4MOOFI-DgTndXY6.js")), te(this, wt, c)), Ca(R(this, Yt), R(this, pt)), ra(c, aa({
|
|
7394
7426
|
get queryFlavor() {
|
|
7395
7427
|
return R(n, zt);
|
|
7396
7428
|
},
|
|
@@ -7421,30 +7453,30 @@ var Ed = (e, t = !1) => {
|
|
|
7421
7453
|
}
|
|
7422
7454
|
}));
|
|
7423
7455
|
}, e);
|
|
7424
|
-
|
|
7456
|
+
te(this, it, !0), te(this, Qt, t);
|
|
7425
7457
|
}
|
|
7426
7458
|
unmount() {
|
|
7427
7459
|
var e;
|
|
7428
7460
|
if (!R(this, it))
|
|
7429
7461
|
throw new Error("Devtools is not mounted");
|
|
7430
|
-
(e = R(this, Qt)) == null || e.call(this),
|
|
7462
|
+
(e = R(this, Qt)) == null || e.call(this), te(this, it, !1);
|
|
7431
7463
|
}
|
|
7432
7464
|
}, gt = new WeakMap(), $t = new WeakMap(), zt = new WeakMap(), Wt = new WeakMap(), it = new WeakMap(), Yt = new WeakMap(), pt = new WeakMap(), yt = new WeakMap(), vt = new WeakMap(), Et = new WeakMap(), bt = new WeakMap(), wt = new WeakMap(), Qt = new WeakMap(), Qs), St, Xt, Zt, Jt, lt, en, Nt, At, xt, Tt, Ct, Pt, _t, tn, Xs, Cu = (Xs = class {
|
|
7433
7465
|
constructor(e) {
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7466
|
+
re(this, St);
|
|
7467
|
+
re(this, Xt);
|
|
7468
|
+
re(this, Zt);
|
|
7469
|
+
re(this, Jt);
|
|
7470
|
+
re(this, lt, !1);
|
|
7471
|
+
re(this, en);
|
|
7472
|
+
re(this, Nt);
|
|
7473
|
+
re(this, At);
|
|
7474
|
+
re(this, xt);
|
|
7475
|
+
re(this, Tt);
|
|
7476
|
+
re(this, Ct);
|
|
7477
|
+
re(this, Pt);
|
|
7478
|
+
re(this, _t);
|
|
7479
|
+
re(this, tn);
|
|
7448
7480
|
const {
|
|
7449
7481
|
client: t,
|
|
7450
7482
|
queryFlavor: n,
|
|
@@ -7458,7 +7490,7 @@ var Ed = (e, t = !1) => {
|
|
|
7458
7490
|
shadowDOMTarget: g,
|
|
7459
7491
|
onClose: d
|
|
7460
7492
|
} = e;
|
|
7461
|
-
|
|
7493
|
+
te(this, St, Ee(t)), te(this, Zt, n), te(this, Jt, s), te(this, Xt, a), te(this, en, h), te(this, Nt, g), te(this, At, Ee(i)), te(this, xt, Ee(l)), te(this, Tt, Ee(o)), te(this, Ct, Ee(c)), te(this, Pt, Ee(d));
|
|
7462
7494
|
}
|
|
7463
7495
|
setButtonPosition(e) {
|
|
7464
7496
|
R(this, At)[1](e);
|
|
@@ -7484,7 +7516,7 @@ var Ed = (e, t = !1) => {
|
|
|
7484
7516
|
const t = oa(() => {
|
|
7485
7517
|
const n = this, [s] = R(this, At), [a] = R(this, xt), [i] = R(this, Tt), [l] = R(this, Ct), [o] = R(this, St), [c] = R(this, Pt);
|
|
7486
7518
|
let h;
|
|
7487
|
-
return R(this, _t) ? h = R(this, _t) : (h = ia(() => import("./HUY7CZI3-
|
|
7519
|
+
return R(this, _t) ? h = R(this, _t) : (h = ia(() => import("./HUY7CZI3-B-83eNUU.js")), te(this, _t, h)), Ca(R(this, en), R(this, Nt)), ra(h, aa({
|
|
7488
7520
|
get queryFlavor() {
|
|
7489
7521
|
return R(n, Zt);
|
|
7490
7522
|
},
|
|
@@ -7518,24 +7550,24 @@ var Ed = (e, t = !1) => {
|
|
|
7518
7550
|
}
|
|
7519
7551
|
}));
|
|
7520
7552
|
}, e);
|
|
7521
|
-
|
|
7553
|
+
te(this, lt, !0), te(this, tn, t);
|
|
7522
7554
|
}
|
|
7523
7555
|
unmount() {
|
|
7524
7556
|
var e;
|
|
7525
7557
|
if (!R(this, lt))
|
|
7526
7558
|
throw new Error("Devtools is not mounted");
|
|
7527
|
-
(e = R(this, tn)) == null || e.call(this),
|
|
7559
|
+
(e = R(this, tn)) == null || e.call(this), te(this, lt, !1);
|
|
7528
7560
|
}
|
|
7529
7561
|
}, St = new WeakMap(), Xt = new WeakMap(), Zt = new WeakMap(), Jt = new WeakMap(), lt = new WeakMap(), en = new WeakMap(), Nt = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Pt = new WeakMap(), _t = new WeakMap(), tn = new WeakMap(), Xs);
|
|
7530
7562
|
function Pu(e) {
|
|
7531
|
-
const t =
|
|
7563
|
+
const t = Ne(e.client), n = ue.useRef(null), {
|
|
7532
7564
|
buttonPosition: s,
|
|
7533
7565
|
position: a,
|
|
7534
7566
|
initialIsOpen: i,
|
|
7535
7567
|
errorTypes: l,
|
|
7536
7568
|
styleNonce: o,
|
|
7537
7569
|
shadowDOMTarget: c
|
|
7538
|
-
} = e, [h] =
|
|
7570
|
+
} = e, [h] = ue.useState(
|
|
7539
7571
|
new Tu({
|
|
7540
7572
|
client: t,
|
|
7541
7573
|
queryFlavor: "React Query",
|
|
@@ -7549,22 +7581,22 @@ function Pu(e) {
|
|
|
7549
7581
|
shadowDOMTarget: c
|
|
7550
7582
|
})
|
|
7551
7583
|
);
|
|
7552
|
-
return
|
|
7584
|
+
return ue.useEffect(() => {
|
|
7553
7585
|
h.setClient(t);
|
|
7554
|
-
}, [t, h]),
|
|
7586
|
+
}, [t, h]), ue.useEffect(() => {
|
|
7555
7587
|
s && h.setButtonPosition(s);
|
|
7556
|
-
}, [s, h]),
|
|
7588
|
+
}, [s, h]), ue.useEffect(() => {
|
|
7557
7589
|
a && h.setPosition(a);
|
|
7558
|
-
}, [a, h]),
|
|
7590
|
+
}, [a, h]), ue.useEffect(() => {
|
|
7559
7591
|
h.setInitialIsOpen(i || !1);
|
|
7560
|
-
}, [i, h]),
|
|
7592
|
+
}, [i, h]), ue.useEffect(() => {
|
|
7561
7593
|
h.setErrorTypes(l || []);
|
|
7562
|
-
}, [l, h]),
|
|
7594
|
+
}, [l, h]), ue.useEffect(() => (n.current && h.mount(n.current), () => {
|
|
7563
7595
|
h.unmount();
|
|
7564
7596
|
}), [h]), /* @__PURE__ */ r("div", { className: "tsqd-parent-container", ref: n });
|
|
7565
7597
|
}
|
|
7566
7598
|
function _u(e) {
|
|
7567
|
-
const t =
|
|
7599
|
+
const t = Ne(e.client), n = ue.useRef(null), { errorTypes: s, styleNonce: a, shadowDOMTarget: i } = e, [l] = ue.useState(
|
|
7568
7600
|
new Cu({
|
|
7569
7601
|
client: t,
|
|
7570
7602
|
queryFlavor: "React Query",
|
|
@@ -7579,14 +7611,14 @@ function _u(e) {
|
|
|
7579
7611
|
onClose: e.onClose
|
|
7580
7612
|
})
|
|
7581
7613
|
);
|
|
7582
|
-
return
|
|
7614
|
+
return ue.useEffect(() => {
|
|
7583
7615
|
l.setClient(t);
|
|
7584
|
-
}, [t, l]),
|
|
7616
|
+
}, [t, l]), ue.useEffect(() => {
|
|
7585
7617
|
l.setOnClose(e.onClose ?? (() => {
|
|
7586
7618
|
}));
|
|
7587
|
-
}, [e.onClose, l]),
|
|
7619
|
+
}, [e.onClose, l]), ue.useEffect(() => {
|
|
7588
7620
|
l.setErrorTypes(s || []);
|
|
7589
|
-
}, [s, l]),
|
|
7621
|
+
}, [s, l]), ue.useEffect(() => (n.current && l.mount(n.current), () => {
|
|
7590
7622
|
l.unmount();
|
|
7591
7623
|
}), [l]), /* @__PURE__ */ r(
|
|
7592
7624
|
"div",
|
|
@@ -7602,7 +7634,7 @@ var Iu = process.env.NODE_ENV !== "development" ? function() {
|
|
|
7602
7634
|
} : Pu;
|
|
7603
7635
|
process.env.NODE_ENV;
|
|
7604
7636
|
const ku = Qa(
|
|
7605
|
-
() => import("./digital-asset-manager-
|
|
7637
|
+
() => import("./digital-asset-manager-cGBJUg2A.js")
|
|
7606
7638
|
);
|
|
7607
7639
|
ul();
|
|
7608
7640
|
ec();
|
|
@@ -7616,30 +7648,30 @@ const Lu = (e) => {
|
|
|
7616
7648
|
role: "",
|
|
7617
7649
|
permissions: null
|
|
7618
7650
|
}
|
|
7619
|
-
} = Ho(), { data: o } = qo(), { data: c, isFetching: h } = Mr(), { blocks: g } = Fo(c), { data: d } = un(), { data: w } = ke(), { mutateAsync: y } = Rr(), p = Bo(), { getUILibraryBlock: S, getUILibraryBlocks: v, onSave: x } = Ko(), { getPartialBlocks: G, getPartialBlockBlocks: E } = Vo(), { aiContext: b, setAiContext: T } = bs(), { mutateAsync: U } = ql(), [
|
|
7651
|
+
} = Ho(), { data: o } = qo(), { data: c, isFetching: h } = Mr(), { blocks: g } = Fo(c), { data: d } = un(), { data: w } = ke(), { mutateAsync: y } = Rr(), p = Bo(), { getUILibraryBlock: S, getUILibraryBlocks: v, onSave: x } = Ko(), { getPartialBlocks: G, getPartialBlockBlocks: E } = Vo(), { aiContext: b, setAiContext: T } = bs(), { mutateAsync: U } = ql(), [ee, le] = P(!1), k = Y(
|
|
7620
7652
|
() => (d == null ? void 0 : d.fallbackLang) || "en",
|
|
7621
7653
|
[d]
|
|
7622
7654
|
), { data: q } = Fr({
|
|
7623
7655
|
pageType: i == null ? void 0 : i.pageType,
|
|
7624
7656
|
lang: a || k
|
|
7625
7657
|
});
|
|
7626
|
-
Nl(),
|
|
7627
|
-
const
|
|
7628
|
-
document.hidden ?
|
|
7658
|
+
Nl(), Se(() => {
|
|
7659
|
+
const W = () => {
|
|
7660
|
+
document.hidden ? le(!0) : le(!1);
|
|
7629
7661
|
};
|
|
7630
|
-
return window.addEventListener("visibilitychange",
|
|
7662
|
+
return window.addEventListener("visibilitychange", W), () => window.removeEventListener("visibilitychange", W);
|
|
7631
7663
|
}, []), t.current = g;
|
|
7632
|
-
const A =
|
|
7633
|
-
const
|
|
7634
|
-
return l && (
|
|
7635
|
-
}, [l]), M =
|
|
7636
|
-
async (
|
|
7664
|
+
const A = Y(() => {
|
|
7665
|
+
const W = {};
|
|
7666
|
+
return l && (W.permissions = ne(l, "permissions", null), W.role = ne(l, "role", "user")), W;
|
|
7667
|
+
}, [l]), M = Y(() => o, [o]), se = Ie(
|
|
7668
|
+
async (W, he) => await U({ pageType: W, query: he }),
|
|
7637
7669
|
[U]
|
|
7638
|
-
),
|
|
7639
|
-
() =>
|
|
7670
|
+
), me = Y(
|
|
7671
|
+
() => ne(d, "theme", {}) || {},
|
|
7640
7672
|
[d]
|
|
7641
7673
|
);
|
|
7642
|
-
return /* @__PURE__ */ u(
|
|
7674
|
+
return /* @__PURE__ */ u(we, { children: [
|
|
7643
7675
|
h && /* @__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" }) }) }),
|
|
7644
7676
|
/* @__PURE__ */ r(
|
|
7645
7677
|
hi,
|
|
@@ -7654,36 +7686,36 @@ const Lu = (e) => {
|
|
|
7654
7686
|
translations: e.translations || {},
|
|
7655
7687
|
locale: e.locale || "en",
|
|
7656
7688
|
htmlDir: e.htmlDir || "ltr",
|
|
7657
|
-
autoSaveSupport: !
|
|
7689
|
+
autoSaveSupport: !ee && (e.autoSaveSupport ?? !0),
|
|
7658
7690
|
autoSaveInterval: e.autoSaveInterval ?? 15,
|
|
7659
7691
|
onError: e.onError || console.error,
|
|
7660
7692
|
getPartialBlockBlocks: E,
|
|
7661
7693
|
getPartialBlocks: G,
|
|
7662
7694
|
blocks: h ? [] : g,
|
|
7663
|
-
theme: Wa(
|
|
7695
|
+
theme: Wa(me),
|
|
7664
7696
|
getUILibraryBlock: S,
|
|
7665
7697
|
getUILibraryBlocks: v,
|
|
7666
7698
|
uiLibraries: M,
|
|
7667
7699
|
pageTypes: w,
|
|
7668
|
-
searchPageTypeItems:
|
|
7669
|
-
saveAiContextCallback: async (
|
|
7700
|
+
searchPageTypeItems: se,
|
|
7701
|
+
saveAiContextCallback: async (W) => {
|
|
7670
7702
|
if (!s) return !0;
|
|
7671
|
-
const
|
|
7703
|
+
const he = t.current, F = {
|
|
7672
7704
|
_type: "@chai/ai-context",
|
|
7673
|
-
_value: Ds(
|
|
7674
|
-
},
|
|
7675
|
-
return await x({ page: s, blocks:
|
|
7705
|
+
_value: Ds(W) ? W : ""
|
|
7706
|
+
}, be = [...he, F];
|
|
7707
|
+
return await x({ page: s, blocks: be }), T(W), !0;
|
|
7676
7708
|
},
|
|
7677
7709
|
aiContext: b,
|
|
7678
7710
|
askAiCallBack: p,
|
|
7679
|
-
onSave: async ({ blocks:
|
|
7711
|
+
onSave: async ({ blocks: W, theme: he }) => {
|
|
7680
7712
|
if (!s) return !0;
|
|
7681
|
-
t.current =
|
|
7713
|
+
t.current = W;
|
|
7682
7714
|
const F = {
|
|
7683
7715
|
_type: "@chai/ai-context",
|
|
7684
7716
|
_value: Ds(b) ? b : ""
|
|
7685
|
-
},
|
|
7686
|
-
return await x({ page: s, blocks:
|
|
7717
|
+
}, be = [...W, F];
|
|
7718
|
+
return await x({ page: s, blocks: be }), t.current = be, is(he, me) || await y({ settings: { theme: he } }), !0;
|
|
7687
7719
|
},
|
|
7688
7720
|
themePanelComponent: Ql,
|
|
7689
7721
|
...A
|
|
@@ -7703,7 +7735,7 @@ const Lu = (e) => {
|
|
|
7703
7735
|
}
|
|
7704
7736
|
}), Ad = (e) => {
|
|
7705
7737
|
const { isLoggedIn: t } = st(), [, n] = Or(), [s, a] = P(!1);
|
|
7706
|
-
return
|
|
7738
|
+
return Se(() => (n(
|
|
7707
7739
|
er(e, [
|
|
7708
7740
|
"apiUrl",
|
|
7709
7741
|
"usersApiUrl",
|
|
@@ -7732,7 +7764,7 @@ export {
|
|
|
7732
7764
|
Xu as B,
|
|
7733
7765
|
ud as C,
|
|
7734
7766
|
hd as D,
|
|
7735
|
-
|
|
7767
|
+
Pe as E,
|
|
7736
7768
|
rd as F,
|
|
7737
7769
|
ic as G,
|
|
7738
7770
|
Su as H,
|
|
@@ -7751,9 +7783,9 @@ export {
|
|
|
7751
7783
|
Sn as U,
|
|
7752
7784
|
ed as V,
|
|
7753
7785
|
Yu as W,
|
|
7754
|
-
|
|
7786
|
+
z as X,
|
|
7755
7787
|
I as Y,
|
|
7756
|
-
|
|
7788
|
+
V as Z,
|
|
7757
7789
|
Ad as _,
|
|
7758
7790
|
ra as a,
|
|
7759
7791
|
Oe as a0,
|
|
@@ -7765,7 +7797,7 @@ export {
|
|
|
7765
7797
|
Ho as a6,
|
|
7766
7798
|
Wu as a7,
|
|
7767
7799
|
dn as a8,
|
|
7768
|
-
|
|
7800
|
+
Ee as b,
|
|
7769
7801
|
Ge as c,
|
|
7770
7802
|
Dc as d,
|
|
7771
7803
|
Zr as e,
|