@chaibuilder/pages 0.11.5 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{LNWAZHJI-CzmJe4ww.js → LNWAZHJI-42v3DYDN.js} +2 -2
- package/dist/{LNWAZHJI-DigL_Bcq.cjs → LNWAZHJI-jQjloJz8.cjs} +1 -1
- package/dist/{MWZ6AO7Z-CBJrnDF2.js → MWZ6AO7Z-Bmq2Xvgm.js} +2 -2
- package/dist/{MWZ6AO7Z-ZBbZcFME.cjs → MWZ6AO7Z-BwJ129Hg.cjs} +1 -1
- package/dist/{YPM2AS64-DF93ukXQ.js → YPM2AS64-8wkd2ouk.js} +1 -1
- package/dist/{YPM2AS64-CzvPUBCJ.cjs → YPM2AS64-CEkbsobl.cjs} +1 -1
- package/dist/{index-BUdAblgQ.js → index-D8DNA-bs.js} +779 -777
- package/dist/{index-rs-_jQl1.cjs → index-D9p-oqpr.cjs} +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Xl = Object.defineProperty;
|
|
2
2
|
var fr = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var kt = (e, t, s) =>
|
|
5
|
+
var Zl = (e, t, s) => t in e ? Xl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
6
|
+
var kt = (e, t, s) => Zl(e, typeof t != "symbol" ? t + "" : t, s), gr = (e, t, s) => t.has(e) || fr("Cannot " + s);
|
|
7
7
|
var ee = (e, t, s) => (gr(e, t, "read from private field"), s ? s.call(e) : t.get(e)), we = (e, t, s) => t.has(e) ? fr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), pe = (e, t, s, a) => (gr(e, t, "write to private field"), a ? a.call(e, s) : t.set(e, s), s);
|
|
8
8
|
import { jsx as n, jsxs as c, Fragment as ce } from "react/jsx-runtime";
|
|
9
|
-
import { has as _e, get as M, isEmpty as J, reverse as
|
|
9
|
+
import { has as _e, get as M, isEmpty as J, reverse as eo, sortBy as to, each as no, find as ve, noop as Kr, groupBy as Hr, minBy as so, set as pt, keyBy as Qa, map as Be, filter as ye, startsWith as nn, startCase as zt, isObject as ba, pick as ms, initial as ao, includes as xt, uniq as ka, union as ro, flatMap as Pa, compact as Ks, uniqBy as io, mapValues as Wr, toLower as Bt, endsWith as Qr, replace as lo, isString as Ia, trim as oo, isArray as Jr, isPlainObject as co, orderBy as As, first as Yr, concat as uo, debounce as ho, upperCase as pr, keys as mo, pickBy as fo, isEqual as Us, values as go, isFunction as po, merge as yo, cloneDeep as vo } from "lodash-es";
|
|
10
10
|
import * as ke from "react";
|
|
11
|
-
import Hs, { useCallback as
|
|
11
|
+
import Hs, { useCallback as ae, useState as S, useEffect as ne, useRef as tt, useMemo as K, Suspense as Ja, createContext as bo, Component as xo, createElement as yr, lazy as wo } from "react";
|
|
12
12
|
import { useAtom as Ue, atom as vt } from "jotai";
|
|
13
|
-
import { useMutation as Pe, useQueryClient as Ie, useQuery as Oe, onlineManager as Xr, QueryClient as
|
|
13
|
+
import { useMutation as Pe, useQueryClient as Ie, useQuery as Oe, onlineManager as Xr, QueryClient as No, QueryClientProvider as Eo } from "@tanstack/react-query";
|
|
14
14
|
import { toast as V } from "sonner";
|
|
15
|
-
import { useLanguages as Fe, useSavePage as Wt, useIsPageLoaded as
|
|
16
|
-
import { Tooltip as Xe, TooltipTrigger as Ze, TooltipContent as et, Card as Qs, CardHeader as Js, CardTitle as Ys, CardContent as Xs, CardFooter as Zs, Button as T, Skeleton as Mt, AlertDialog as ei, AlertDialogTrigger as ti, AlertDialogContent as ni, AlertDialogHeader as si, AlertDialogTitle as ai, AlertDialogDescription as ri, AlertDialogFooter as ii, AlertDialogCancel as li, AlertDialogAction as oi, Popover as wn, PopoverTrigger as Nn, PopoverContent as En, Input as xe, Label as he, Dialog as je, DialogContent as ze, DialogHeader as Ve, DialogTitle as Ke, DialogDescription as nt, Alert as Pn, DialogFooter as
|
|
17
|
-
import { formatDistanceToNow as xi, formatDate as
|
|
18
|
-
import { LockIcon as wi, LockKeyhole as
|
|
19
|
-
import
|
|
20
|
-
import { parseDiff as
|
|
21
|
-
import { useRegisteredChaiBlocks as
|
|
15
|
+
import { useLanguages as Fe, useSavePage as Wt, useIsPageLoaded as So, useUpdateBlocksPropsRealtime as Zr, PERMISSIONS as Ao, usePartailBlocksStore as To, usePermissions as kn, useLibraryBlocks as Co, useTheme as ko, useSidebarActivePanel as Ws, useChaiFeatureFlag as Ot, mergeClasses as zn, useRightPanel as Po, registerChaiLibrary as Io, getBlocksFromHTML as _o, useBuilderProp as Lo, useTranslation as Do, registerChaiSidebarPanel as Ts, registerChaiFeatureFlag as Gn, registerChaiTopBar as Oo, registerChaiMediaManager as Ro, registerChaiSaveToLibrary as Go, ChaiBuilderEditor as Uo } from "@chaibuilder/sdk";
|
|
16
|
+
import { Tooltip as Xe, TooltipTrigger as Ze, TooltipContent as et, Card as Qs, CardHeader as Js, CardTitle as Ys, CardContent as Xs, CardFooter as Zs, Button as T, Skeleton as Mt, AlertDialog as ei, AlertDialogTrigger as ti, AlertDialogContent as ni, AlertDialogHeader as si, AlertDialogTitle as ai, AlertDialogDescription as ri, AlertDialogFooter as ii, AlertDialogCancel as li, AlertDialogAction as oi, Popover as wn, PopoverTrigger as Nn, PopoverContent as En, Input as xe, Label as he, Dialog as je, DialogContent as ze, DialogHeader as Ve, DialogTitle as Ke, DialogDescription as nt, Alert as Pn, DialogFooter as mt, CommandList as ci, Command as Vn, CommandEmpty as Kn, CommandGroup as It, CommandItem as gt, Textarea as Sn, DropdownMenu as In, DropdownMenuTrigger as _n, DropdownMenuContent as Ln, DropdownMenuItem as $e, Select as di, SelectTrigger as ui, SelectValue as Bo, SelectContent as hi, SelectItem as sn, Badge as xa, TooltipProvider as Ft, Separator as Mo, Sheet as mi, SheetContent as fi, SheetHeader as gi, SheetTitle as pi, SheetDescription as Fo, Switch as _a, ScrollArea as Ds, SheetTrigger as $o, DropdownMenuSeparator as qo, CardDescription as jo, CommandInput as zo, Tabs as yi, TabsList as vi, TabsTrigger as Bn, TabsContent as Mn, AlertDescription as bi, HoverCard as Vo, HoverCardTrigger as Ko, HoverCardContent as Ho } from "@chaibuilder/sdk/ui";
|
|
17
|
+
import { formatDistanceToNow as xi, formatDate as Wo, format as ea } from "date-fns";
|
|
18
|
+
import { LockIcon as wi, LockKeyhole as Qo, UserIcon as Jo, Info as Yo, KeyIcon as Xo, AlertTriangleIcon as Zo, Loader as wt, TableIcon as ec, CheckCircle as Ni, Target as tc, Edit as Hn, Check as it, X as An, Trash2 as ta, Plus as fs, ImageIcon as Wn, AlertCircle as na, ChevronDown as _t, Search as Nt, Tag as nc, File as Qt, CopyPlusIcon as sc, Pencil as Ei, Power as Si, Trash as Ya, SquareLibrary as vr, ChevronsUpDown as Ai, ChevronsDownUp as Ti, ChevronRight as sa, StarsIcon as Ci, Globe as Xa, MoreHorizontal as Tn, Star as ki, FilterXIcon as ac, Filter as rc, ListFilter as ic, RefreshCw as lc, NotepadText as oc, Lock as Pi, Languages as br, LogsIcon as cc, Folder as dc, FileJson as La, Copy as Bs, History as uc, Eye as aa, Undo2 as Ii, CloudOff as hc, Rocket as Da, Save as _i, GlobeIcon as mc, Palette as fc, Send as xr, Settings as Li, ExternalLink as gc, EyeOff as pc, Loader2 as Di, StarIcon as yc, PencilIcon as vc, TrashIcon as bc, LanguagesIcon as xc, DatabaseIcon as wc, ChevronLeft as Za, Sparkle as Nc, Code as Ec, AlertTriangle as Oi, User as Sc, Link as Ac, Archive as Tc, Film as Cc, Upload as kc } from "lucide-react";
|
|
19
|
+
import Pc from "compressorjs";
|
|
20
|
+
import { parseDiff as Ic, Diff as _c, Hunk as Lc } from "react-diff-view";
|
|
21
|
+
import { useRegisteredChaiBlocks as Dc, getDefaultBlockProps as Oc } from "@chaibuilder/runtime";
|
|
22
22
|
import { z as Os } from "zod";
|
|
23
|
-
import { useDropzone as
|
|
24
|
-
import { loadWebBlocks as
|
|
23
|
+
import { useDropzone as Rc } from "react-dropzone";
|
|
24
|
+
import { loadWebBlocks as Gc } from "@chaibuilder/sdk/web-blocks";
|
|
25
25
|
const De = {
|
|
26
26
|
ab: "Abkhazian",
|
|
27
27
|
aa: "Afar",
|
|
@@ -267,28 +267,28 @@ const De = {
|
|
|
267
267
|
GET_ASSETS: "GET_ASSETS",
|
|
268
268
|
GET_ASSET: "GET_ASSET"
|
|
269
269
|
};
|
|
270
|
-
let
|
|
270
|
+
let Uc = 0;
|
|
271
271
|
function wr(e, t) {
|
|
272
|
-
const s = `atom${++
|
|
272
|
+
const s = `atom${++Uc}`, a = {
|
|
273
273
|
toString() {
|
|
274
274
|
return s;
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
|
-
return typeof e == "function" ? a.read = e : (a.init = e, a.read =
|
|
277
|
+
return typeof e == "function" ? a.read = e : (a.init = e, a.read = Bc, a.write = Mc), t && (a.write = t), a;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Bc(e) {
|
|
280
280
|
return e(this);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Mc(e, t, s) {
|
|
283
283
|
return t(
|
|
284
284
|
this,
|
|
285
285
|
typeof s == "function" ? s(e(this)) : s
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
|
-
const
|
|
288
|
+
const Fc = Symbol(
|
|
289
289
|
""
|
|
290
|
-
),
|
|
291
|
-
function
|
|
290
|
+
), $c = (e) => typeof (e == null ? void 0 : e.then) == "function";
|
|
291
|
+
function qc(e = () => {
|
|
292
292
|
try {
|
|
293
293
|
return window.localStorage;
|
|
294
294
|
} catch {
|
|
@@ -311,7 +311,7 @@ function jc(e = () => {
|
|
|
311
311
|
}
|
|
312
312
|
return r;
|
|
313
313
|
}, p = (m = (u = e()) == null ? void 0 : u.getItem(d)) != null ? m : null;
|
|
314
|
-
return
|
|
314
|
+
return $c(p) ? p.then(v) : v(p);
|
|
315
315
|
},
|
|
316
316
|
setItem: (d, h) => {
|
|
317
317
|
var u;
|
|
@@ -350,8 +350,8 @@ function jc(e = () => {
|
|
|
350
350
|
};
|
|
351
351
|
}), o && (i.subscribe = l(o)), i;
|
|
352
352
|
}
|
|
353
|
-
const
|
|
354
|
-
function Ri(e, t, s =
|
|
353
|
+
const jc = qc();
|
|
354
|
+
function Ri(e, t, s = jc, a) {
|
|
355
355
|
const r = wr(
|
|
356
356
|
t
|
|
357
357
|
);
|
|
@@ -363,14 +363,14 @@ function Ri(e, t, s = zc, a) {
|
|
|
363
363
|
(l) => l(r),
|
|
364
364
|
(l, o, d) => {
|
|
365
365
|
const h = typeof d == "function" ? d(l(r)) : d;
|
|
366
|
-
return h ===
|
|
366
|
+
return h === Fc ? (o(r, t), s.removeItem(e)) : h instanceof Promise ? h.then((u) => (o(r, u), s.setItem(e, u))) : (o(r, h), s.setItem(e, h));
|
|
367
367
|
}
|
|
368
368
|
);
|
|
369
369
|
}
|
|
370
370
|
localStorage.removeItem("_chai_user");
|
|
371
371
|
localStorage.removeItem("__chai__user");
|
|
372
|
-
const Gi = "__logged_in_user",
|
|
373
|
-
const [e, t] = Ue(
|
|
372
|
+
const Gi = "__logged_in_user", zc = Ri(Gi, null), ot = () => {
|
|
373
|
+
const [e, t] = Ue(zc), s = ae(() => {
|
|
374
374
|
t(null), localStorage.removeItem(Gi);
|
|
375
375
|
}, [t]);
|
|
376
376
|
return {
|
|
@@ -397,7 +397,7 @@ if (import.meta.vitest) {
|
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
let en = null;
|
|
400
|
-
function
|
|
400
|
+
function Vc() {
|
|
401
401
|
const { user: e, setUser: t, logout: s } = ot(), a = ia(), r = ct("getAccessToken", !1), i = async () => {
|
|
402
402
|
if (r === !1 && e && !(!_e(e, "expiresAt") || !_e(e, "accessToken") || !_e(e, "refreshToken")))
|
|
403
403
|
try {
|
|
@@ -435,11 +435,11 @@ function Kc() {
|
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function Kc() {
|
|
439
439
|
return en;
|
|
440
440
|
}
|
|
441
441
|
const Ui = () => {
|
|
442
|
-
const { user: e, setUser: t } = ot(), { mutateAsync: s } =
|
|
442
|
+
const { user: e, setUser: t } = ot(), { mutateAsync: s } = Vc(), a = 60, r = ae(() => {
|
|
443
443
|
if (!(e != null && e.expiresAt)) return !1;
|
|
444
444
|
if (!e || !(e != null && e.refreshToken)) return !0;
|
|
445
445
|
const o = Math.floor(Date.now() / 1e3);
|
|
@@ -447,7 +447,7 @@ const Ui = () => {
|
|
|
447
447
|
}, [e]), l = ct("getAccessToken", async () => {
|
|
448
448
|
if (!(!_e(e, "expiresAt") || !_e(e, "accessToken") || !_e(e, "refreshToken"))) {
|
|
449
449
|
if (r()) {
|
|
450
|
-
const o =
|
|
450
|
+
const o = Kc();
|
|
451
451
|
if (o) {
|
|
452
452
|
const h = await o;
|
|
453
453
|
return h && t(h), (h == null ? void 0 : h.accessToken) || "";
|
|
@@ -459,7 +459,7 @@ const Ui = () => {
|
|
|
459
459
|
}
|
|
460
460
|
});
|
|
461
461
|
return {
|
|
462
|
-
getAccessToken:
|
|
462
|
+
getAccessToken: ae(async () => {
|
|
463
463
|
try {
|
|
464
464
|
return await l();
|
|
465
465
|
} catch {
|
|
@@ -469,7 +469,7 @@ const Ui = () => {
|
|
|
469
469
|
};
|
|
470
470
|
}, X = () => {
|
|
471
471
|
const { logout: e } = ot(), { getAccessToken: t } = Ui();
|
|
472
|
-
return
|
|
472
|
+
return ae(
|
|
473
473
|
async (s, a, r = {}) => {
|
|
474
474
|
const i = await t();
|
|
475
475
|
if (!i)
|
|
@@ -526,7 +526,7 @@ const Ui = () => {
|
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
528
|
});
|
|
529
|
-
},
|
|
529
|
+
}, Hc = () => {
|
|
530
530
|
const e = de(), t = Ie(), s = X();
|
|
531
531
|
return Pe({
|
|
532
532
|
mutationFn: async (a) => s(e, { action: G.UPDATE_WEBSITE_DATA, data: a }),
|
|
@@ -546,7 +546,7 @@ function He() {
|
|
|
546
546
|
const [e, t] = S(
|
|
547
547
|
new URLSearchParams(window.location.search)
|
|
548
548
|
);
|
|
549
|
-
return
|
|
549
|
+
return ne(() => {
|
|
550
550
|
const s = () => {
|
|
551
551
|
t(new URLSearchParams(window.location.search));
|
|
552
552
|
};
|
|
@@ -555,15 +555,15 @@ function He() {
|
|
|
555
555
|
};
|
|
556
556
|
}, []), [e, t];
|
|
557
557
|
}
|
|
558
|
-
const
|
|
558
|
+
const Wc = vt({}), Fi = () => Ue(Wc), Qc = () => {
|
|
559
559
|
const [e] = He(), t = e.get("page"), s = tt(""), { mutate: a } = Bi();
|
|
560
|
-
|
|
560
|
+
ne(() => {
|
|
561
561
|
!J(s.current) && t !== s.current && a({ id: s.current }), s.current = t;
|
|
562
562
|
}, [t, a, s]);
|
|
563
563
|
}, ct = (e, t) => {
|
|
564
564
|
const [s] = Fi();
|
|
565
565
|
return K(() => M(s, e, t), [s, e, t]);
|
|
566
|
-
}, de = () => ct("apiUrl", "/chai/api"), ia = () => ct("usersApiUrl", "/chai/users"),
|
|
566
|
+
}, de = () => ct("apiUrl", "/chai/api"), ia = () => ct("usersApiUrl", "/chai/users"), gs = () => ct("assetsApiUrl", "/chai/assets"), Jc = () => ct("supabaseInstance", null), ht = (e) => {
|
|
567
567
|
const t = de(), [s] = He(), a = e ?? s.get("page"), r = X();
|
|
568
568
|
return Oe({
|
|
569
569
|
queryKey: [G.GET_LANGUAGE_PAGES, a],
|
|
@@ -574,7 +574,7 @@ const Qc = vt({}), Fi = () => Ue(Qc), Jc = () => {
|
|
|
574
574
|
action: G.GET_LANGUAGE_PAGES,
|
|
575
575
|
data: { id: a }
|
|
576
576
|
});
|
|
577
|
-
return to(
|
|
577
|
+
return eo(to(i, "primaryPage"));
|
|
578
578
|
},
|
|
579
579
|
enabled: !!a
|
|
580
580
|
});
|
|
@@ -593,9 +593,9 @@ const Qc = vt({}), Fi = () => Ue(Qc), Jc = () => {
|
|
|
593
593
|
})
|
|
594
594
|
});
|
|
595
595
|
}, $i = (e) => {
|
|
596
|
-
const { fallbackLang: t } = Fe(), { data: s } = Et(), { data: a, isFetching: r } =
|
|
596
|
+
const { fallbackLang: t } = Fe(), { data: s } = Et(), { data: a, isFetching: r } = ht(), i = K(() => {
|
|
597
597
|
const l = { [t]: !0 };
|
|
598
|
-
return
|
|
598
|
+
return no(M(s, "languages"), (o) => {
|
|
599
599
|
const d = ve(a, { lang: o });
|
|
600
600
|
l[o] = !!d;
|
|
601
601
|
}), l;
|
|
@@ -608,26 +608,26 @@ const Qc = vt({}), Fi = () => Ue(Qc), Jc = () => {
|
|
|
608
608
|
queryFn: () => "",
|
|
609
609
|
staleTime: 0
|
|
610
610
|
});
|
|
611
|
-
return { setAiContext:
|
|
611
|
+
return { setAiContext: ae(
|
|
612
612
|
(a) => {
|
|
613
613
|
e.setQueryData([G.AI_CONTEXT], a);
|
|
614
614
|
},
|
|
615
615
|
[e]
|
|
616
616
|
), aiContext: t };
|
|
617
|
-
},
|
|
617
|
+
}, Yc = vt(
|
|
618
618
|
null
|
|
619
|
-
), qi = () => Ue(
|
|
619
|
+
), qi = () => Ue(Yc), tr = () => {
|
|
620
620
|
const [e] = qi();
|
|
621
621
|
return (e == null ? void 0 : e.slug) || "";
|
|
622
622
|
};
|
|
623
|
-
function
|
|
623
|
+
function Xc(e, t) {
|
|
624
624
|
const [s, a] = S(e);
|
|
625
|
-
return
|
|
625
|
+
return ne(() => {
|
|
626
626
|
const r = setTimeout(() => a(e), t);
|
|
627
627
|
return () => clearTimeout(r);
|
|
628
628
|
}, [e, t]), s;
|
|
629
629
|
}
|
|
630
|
-
const
|
|
630
|
+
const Zc = ({ query: e, uuid: t }) => {
|
|
631
631
|
const { selectedLang: s, fallbackLang: a } = Fe(), { data: r } = We(), i = r == null ? void 0 : r.pageType, l = de(), o = X(), { data: d, isFetching: h } = Oe({
|
|
632
632
|
queryKey: [G.GET_DYNAMIC_PAGES, e, i, t],
|
|
633
633
|
initialData: [],
|
|
@@ -639,7 +639,7 @@ const ed = ({ query: e, uuid: t }) => {
|
|
|
639
639
|
}), u = K(() => s === "" ? d.filter((m) => m.lang === "" || m.lang === a) : d.filter((m) => m.lang === s), [s, a, d]);
|
|
640
640
|
return { allLangPages: d, data: u, isFetching: h };
|
|
641
641
|
}, ji = () => {
|
|
642
|
-
const { selectedLang: e, fallbackLang: t } = Fe(), [s, a] = qi(), [r, i] = S(""), l =
|
|
642
|
+
const { selectedLang: e, fallbackLang: t } = Fe(), [s, a] = qi(), [r, i] = S(""), l = Xc(r, 500), { allLangPages: o, data: d, isFetching: h } = Zc({ query: l }), u = ae((p) => a(p), [a]), m = ae((p) => i(p), [i]), v = ae(() => {
|
|
643
643
|
if (!s) return;
|
|
644
644
|
const p = !(s != null && s.primaryPage), y = e.length === 0, g = p ? s == null ? void 0 : s.id : s == null ? void 0 : s.primaryPage, x = o.filter(
|
|
645
645
|
(N) => (N == null ? void 0 : N.primaryPage) === g || N.id === g
|
|
@@ -657,47 +657,17 @@ const ed = ({ query: e, uuid: t }) => {
|
|
|
657
657
|
updateSearchQuery: m,
|
|
658
658
|
onChangeLanguage: v
|
|
659
659
|
};
|
|
660
|
+
}, ed = vt({ lastSaved: void 0 }), la = () => Ue(ed), We = () => {
|
|
661
|
+
const [e] = He(), t = e.get("page"), { data: s, isFetching: a } = ht();
|
|
662
|
+
return { data: K(() => ({ ...ve(s, { id: t }) || {} }), [s, t]), isFetching: a };
|
|
660
663
|
}, Rt = () => {
|
|
661
|
-
const { data:
|
|
662
|
-
return K(
|
|
663
|
-
() => (e == null ? void 0 : e.fallbackLang) || "en",
|
|
664
|
-
[e]
|
|
665
|
-
);
|
|
666
|
-
}, Dn = () => {
|
|
667
|
-
const e = X(), t = de();
|
|
668
|
-
return Oe({
|
|
669
|
-
queryKey: [G.GET_WEBSITE_PAGES],
|
|
670
|
-
staleTime: 1e3 * 60 * 5,
|
|
671
|
-
queryFn: async () => e(t, { action: G.GET_WEBSITE_PAGES }) || [],
|
|
672
|
-
placeholderData: (s) => s || []
|
|
673
|
-
});
|
|
674
|
-
}, td = (e) => {
|
|
675
|
-
const t = X(), s = de(), a = Rt();
|
|
676
|
-
return Oe({
|
|
677
|
-
queryKey: [G.GET_WEBSITE_PAGES, e, a],
|
|
678
|
-
staleTime: 1e3 * 60 * 5,
|
|
679
|
-
enabled: !!e,
|
|
680
|
-
queryFn: async () => {
|
|
681
|
-
if (a === e) return {};
|
|
682
|
-
const r = await t(s, { action: G.GET_WEBSITE_PAGES, data: { lang: e } }) || [];
|
|
683
|
-
return Qa(
|
|
684
|
-
Be(r, (i) => ({ ...i, lang: e })),
|
|
685
|
-
"primaryPage"
|
|
686
|
-
);
|
|
687
|
-
},
|
|
688
|
-
placeholderData: (r) => r || {}
|
|
689
|
-
});
|
|
690
|
-
}, nd = vt({ lastSaved: void 0 }), la = () => Ue(nd), We = () => {
|
|
691
|
-
const [e] = He(), t = e.get("page"), [s] = zi(), { data: a, isFetching: r } = Dn();
|
|
692
|
-
return { data: K(() => ({ ...ve(a, { id: t }) || {}, metadata: s }), [a, t, s]), isFetching: r };
|
|
693
|
-
}, Gt = () => {
|
|
694
|
-
const [e] = He(), t = e.get("lang") ?? "", { data: s, isFetching: a } = pt();
|
|
664
|
+
const [e] = He(), t = e.get("lang") ?? "", { data: s, isFetching: a } = ht();
|
|
695
665
|
return { data: K(() => ve(s, { lang: t }) || {}, [s, t]), isFetching: a };
|
|
696
|
-
},
|
|
697
|
-
const { data: e } =
|
|
666
|
+
}, td = vt({}), nd = () => Ue(td), zi = () => {
|
|
667
|
+
const { data: e } = Rt(), t = tr(), s = ct("getLiveUrl", Kr), a = e == null ? void 0 : e.slug, r = s(a || "/");
|
|
698
668
|
return t ? r + t : r;
|
|
699
669
|
};
|
|
700
|
-
class
|
|
670
|
+
class sd {
|
|
701
671
|
constructor(t, s, a, r) {
|
|
702
672
|
kt(this, "channelId");
|
|
703
673
|
kt(this, "supabase");
|
|
@@ -744,7 +714,7 @@ class ad {
|
|
|
744
714
|
const t = this.getOnlineUsers({}), s = Hr(t, "pageId"), a = {};
|
|
745
715
|
return Object.keys(s).forEach((r) => {
|
|
746
716
|
var l;
|
|
747
|
-
const i = (l =
|
|
717
|
+
const i = (l = so(s[r], "onlineAt")) == null ? void 0 : l.userId;
|
|
748
718
|
i !== this.userId && (a[r] = i);
|
|
749
719
|
}), a;
|
|
750
720
|
}
|
|
@@ -817,14 +787,14 @@ const St = (e) => {
|
|
|
817
787
|
},
|
|
818
788
|
enabled: !J(e)
|
|
819
789
|
});
|
|
820
|
-
},
|
|
790
|
+
}, ad = vt(void 0), rd = vt({
|
|
821
791
|
status: "checking",
|
|
822
792
|
requestedBy: "",
|
|
823
793
|
isTakeOverRequested: !1,
|
|
824
794
|
requestingClientId: "",
|
|
825
795
|
isActiveInOtherTab: !1
|
|
826
|
-
}),
|
|
827
|
-
const [e] = He(), t = e.get("page"), { user: s } = ot(), [a, r] = Ue(
|
|
796
|
+
}), id = vt(""), ld = vt(null), nr = vt({}), Vi = () => Ue(nr), At = () => {
|
|
797
|
+
const [e] = He(), t = e.get("page"), { user: s } = ot(), [a, r] = Ue(ad), [i, l] = Ue(rd), [o, d] = Ue(ld), [h, u] = Ue(id), [m] = Ue(nr);
|
|
828
798
|
return K(() => ({
|
|
829
799
|
pageLock: i,
|
|
830
800
|
pageToUser: m,
|
|
@@ -850,9 +820,9 @@ const St = (e) => {
|
|
|
850
820
|
d,
|
|
851
821
|
m
|
|
852
822
|
]);
|
|
853
|
-
},
|
|
854
|
-
const e =
|
|
855
|
-
return
|
|
823
|
+
}, od = () => {
|
|
824
|
+
const e = Jc(), { data: t } = We(), { user: s } = ot(), a = t == null ? void 0 : t.id, { data: r } = Et(), { pageLock: i, setPageLock: l, setLockingStatus: o, realtimeInstance: d, setRealtimeInstance: h } = At(), [, u] = Ue(nr), m = tt(!1), v = tt(i), p = tt(!1);
|
|
825
|
+
return ne(() => {
|
|
856
826
|
if (s != null && s.id && e && !d && (r != null && r.appKey) && !p.current) {
|
|
857
827
|
p.current = !0;
|
|
858
828
|
const y = async (b, x) => {
|
|
@@ -935,7 +905,7 @@ const St = (e) => {
|
|
|
935
905
|
});
|
|
936
906
|
break;
|
|
937
907
|
}
|
|
938
|
-
}, g = new
|
|
908
|
+
}, g = new sd(
|
|
939
909
|
e,
|
|
940
910
|
r == null ? void 0 : r.appKey,
|
|
941
911
|
s == null ? void 0 : s.id,
|
|
@@ -943,9 +913,9 @@ const St = (e) => {
|
|
|
943
913
|
);
|
|
944
914
|
h(g);
|
|
945
915
|
}
|
|
946
|
-
}, [h, e, r == null ? void 0 : r.appKey]),
|
|
916
|
+
}, [h, e, r == null ? void 0 : r.appKey]), ne(() => {
|
|
947
917
|
v.current = i;
|
|
948
|
-
}, [i]),
|
|
918
|
+
}, [i]), ne(() => {
|
|
949
919
|
if (!(!d || !a || !(s != null && s.id) || m.current))
|
|
950
920
|
return m.current = !0, d == null || d.joinPage(a), () => {
|
|
951
921
|
d && m.current && (m.current = !1, v.current = {
|
|
@@ -957,10 +927,10 @@ const St = (e) => {
|
|
|
957
927
|
}, o(""), l(v.current), d == null || d.leavePage());
|
|
958
928
|
};
|
|
959
929
|
}, [a, d]), i == null ? void 0 : i.status;
|
|
960
|
-
},
|
|
961
|
-
const { data: e } = We(), { user: t } = ot(), s = e == null ? void 0 : e.id, { pageLock: a, setPageLock: r, realtimeInstance: i } = At(), { savePageAsync: l } = Wt(), o =
|
|
930
|
+
}, Ki = () => {
|
|
931
|
+
const { data: e } = We(), { user: t } = ot(), s = e == null ? void 0 : e.id, { pageLock: a, setPageLock: r, realtimeInstance: i } = At(), { savePageAsync: l } = Wt(), o = ae(() => {
|
|
962
932
|
!i || !s || !(t != null && t.id) || (r({ ...a, isTakeOverRequested: !0 }), i == null || i.sendEvent("TAKE_OVER_REQUESTED"));
|
|
963
|
-
}, [i, s, t == null ? void 0 : t.id, r, a]), d =
|
|
933
|
+
}, [i, s, t == null ? void 0 : t.id, r, a]), d = ae(async () => {
|
|
964
934
|
!i || !s || !(t != null && t.id) || (await l(), i == null || i.sendEvent("TAKE_OVER_REQUEST_ACCEPTED", {
|
|
965
935
|
requestingClientId: a == null ? void 0 : a.requestingClientId
|
|
966
936
|
}), r({
|
|
@@ -970,7 +940,7 @@ const St = (e) => {
|
|
|
970
940
|
isActiveInOtherTab: !1,
|
|
971
941
|
isTakeOverRequested: !1
|
|
972
942
|
}));
|
|
973
|
-
}, [s, i, t == null ? void 0 : t.id, r, l, a]), h =
|
|
943
|
+
}, [s, i, t == null ? void 0 : t.id, r, l, a]), h = ae(() => {
|
|
974
944
|
!i || !s || !(t != null && t.id) || (i == null || i.sendEvent("TAKE_OVER_REQUEST_REJECTED", {
|
|
975
945
|
requestingClientId: a == null ? void 0 : a.requestingClientId
|
|
976
946
|
}), r({
|
|
@@ -988,8 +958,14 @@ const St = (e) => {
|
|
|
988
958
|
rejectTakeOver: h,
|
|
989
959
|
requestTakeOver: o
|
|
990
960
|
};
|
|
991
|
-
},
|
|
992
|
-
const
|
|
961
|
+
}, Gt = () => {
|
|
962
|
+
const { data: e } = Et();
|
|
963
|
+
return K(
|
|
964
|
+
() => (e == null ? void 0 : e.fallbackLang) || "en",
|
|
965
|
+
[e]
|
|
966
|
+
);
|
|
967
|
+
}, Hi = () => {
|
|
968
|
+
const [e] = He(), t = e.get("page"), s = de(), { setAiContext: a } = er(), { setCurrentEditor: r } = At(), [, i] = la(), [, l] = nd(), [, o] = So(), d = X();
|
|
993
969
|
return Oe({
|
|
994
970
|
queryKey: [G.GET_DRAFT_PAGE, t],
|
|
995
971
|
staleTime: 1 / 0,
|
|
@@ -1006,8 +982,8 @@ const St = (e) => {
|
|
|
1006
982
|
},
|
|
1007
983
|
enabled: !!t
|
|
1008
984
|
});
|
|
1009
|
-
},
|
|
1010
|
-
const { data: e } = We(), { data: t } =
|
|
985
|
+
}, Wi = () => {
|
|
986
|
+
const { data: e } = We(), { data: t } = Rt(), s = de(), a = X(), r = Gt(), i = tr();
|
|
1011
987
|
return Oe({
|
|
1012
988
|
queryKey: [G.GET_BUILDER_PAGE_DATA, t == null ? void 0 : t.id, i],
|
|
1013
989
|
initialData: {},
|
|
@@ -1035,14 +1011,14 @@ const St = (e) => {
|
|
|
1035
1011
|
}),
|
|
1036
1012
|
enabled: !!(e != null && e.pageType) && !!t.id
|
|
1037
1013
|
});
|
|
1038
|
-
},
|
|
1014
|
+
}, ps = ({ children: e }) => /* @__PURE__ */ n("div", { className: "fixed bottom-0 left-0 right-0 top-[50px] z-[20] flex w-screen flex-col items-center justify-center bg-black/20", children: e }), Qi = ({ fullScreen: e = !0 }) => {
|
|
1039
1015
|
const t = /* @__PURE__ */ c("div", { className: "flex flex-row gap-2", children: [
|
|
1040
1016
|
/* @__PURE__ */ n("div", { className: "h-4 w-4 animate-bounce rounded-full bg-purple-500" }),
|
|
1041
1017
|
/* @__PURE__ */ n("div", { className: "h-4 w-4 animate-bounce rounded-full bg-cyan-500 [animation-delay:-.3s]" }),
|
|
1042
1018
|
/* @__PURE__ */ n("div", { className: "h-4 w-4 animate-bounce rounded-full bg-pink-500 [animation-delay:-.5s]" })
|
|
1043
1019
|
] });
|
|
1044
|
-
return e ? /* @__PURE__ */ n(
|
|
1045
|
-
},
|
|
1020
|
+
return e ? /* @__PURE__ */ n(ps, { children: t }) : /* @__PURE__ */ n("div", { className: "flex h-full w-full items-center justify-center", children: t });
|
|
1021
|
+
}, cd = ({ currentEditor: e }) => {
|
|
1046
1022
|
const { user: t } = ot(), { data: s } = St(e);
|
|
1047
1023
|
return !s || !e || e === (t == null ? void 0 : t.id) ? null : /* @__PURE__ */ n("span", { className: "ml-2 flex items-center gap-1 text-xs font-light text-gray-500", children: /* @__PURE__ */ c(Xe, { children: [
|
|
1048
1024
|
/* @__PURE__ */ n(Ze, { children: /* @__PURE__ */ n(wi, { className: "h-3 w-3" }) }),
|
|
@@ -1051,11 +1027,11 @@ const St = (e) => {
|
|
|
1051
1027
|
" is editing"
|
|
1052
1028
|
] }) })
|
|
1053
1029
|
] }) });
|
|
1054
|
-
},
|
|
1030
|
+
}, dd = ({ userId: e }) => {
|
|
1055
1031
|
const { data: t } = St(e);
|
|
1056
1032
|
return (t == null ? void 0 : t.name) || "Unknown";
|
|
1057
1033
|
};
|
|
1058
|
-
function
|
|
1034
|
+
function ud({
|
|
1059
1035
|
avatar: e,
|
|
1060
1036
|
name: t,
|
|
1061
1037
|
email: s,
|
|
@@ -1070,15 +1046,15 @@ function hd({
|
|
|
1070
1046
|
h(!1);
|
|
1071
1047
|
}, 15e3), m(!1), r();
|
|
1072
1048
|
};
|
|
1073
|
-
return /* @__PURE__ */ n(
|
|
1049
|
+
return /* @__PURE__ */ n(ps, { children: /* @__PURE__ */ c(Qs, { className: "mx-auto w-full max-w-md", children: [
|
|
1074
1050
|
/* @__PURE__ */ n(Js, { className: "space-y-1", children: /* @__PURE__ */ c(Ys, { className: "flex items-center gap-2 text-xl", children: [
|
|
1075
|
-
/* @__PURE__ */ n(
|
|
1051
|
+
/* @__PURE__ */ n(Qo, { className: "h-8 w-8 rounded-md bg-sky-500/20 p-1.5 text-sky-500" }),
|
|
1076
1052
|
"Page is locked for editing"
|
|
1077
1053
|
] }) }),
|
|
1078
1054
|
/* @__PURE__ */ n(Xs, { className: "w-md grid w-full pt-2", children: /* @__PURE__ */ c("div", { children: [
|
|
1079
1055
|
/* @__PURE__ */ c("div", { className: "relative mx-auto flex w-96 items-center space-x-4 rounded-md border border-green-500 px-2 pb-2 pt-4", children: [
|
|
1080
1056
|
/* @__PURE__ */ n("div", { className: "absolute -top-2.5 left-3 w-max rounded-full bg-green-500 px-3 py-1 text-xs font-medium leading-3 text-white", children: "Locked By" }),
|
|
1081
|
-
e && !o ? /* @__PURE__ */ n("img", { src: e, alt: t, className: "h-14 w-14 rounded-full border border-gray-300" }) : /* @__PURE__ */ n(
|
|
1057
|
+
e && !o ? /* @__PURE__ */ n("img", { src: e, alt: t, className: "h-14 w-14 rounded-full border border-gray-300" }) : /* @__PURE__ */ n(Jo, { className: "h-14 w-14 flex-shrink-0 rounded-full bg-gradient-to-br from-purple-400 to-pink-500 p-2 text-white" }),
|
|
1082
1058
|
/* @__PURE__ */ c("div", { className: o ? "space-y-1.5" : "space-y-0", children: [
|
|
1083
1059
|
o ? /* @__PURE__ */ n(Mt, { className: "h-4 w-40 rounded" }) : /* @__PURE__ */ n("span", { className: "truncate font-medium text-black", children: t }),
|
|
1084
1060
|
s && !o ? /* @__PURE__ */ n("p", { className: "truncate text-sm text-muted-foreground", children: s }) : /* @__PURE__ */ n(Mt, { className: "h-4 w-60 rounded" }),
|
|
@@ -1106,12 +1082,12 @@ function hd({
|
|
|
1106
1082
|
] })
|
|
1107
1083
|
] }) }),
|
|
1108
1084
|
l && /* @__PURE__ */ c("div", { className: "mt-4 flex w-full items-center justify-center gap-x-2 rounded border border-red-500 bg-red-50 p-2 text-center font-medium text-red-500", children: [
|
|
1109
|
-
/* @__PURE__ */ n(
|
|
1085
|
+
/* @__PURE__ */ n(Yo, { className: "h-5 w-5" }),
|
|
1110
1086
|
" Page take over request is rejected"
|
|
1111
1087
|
] })
|
|
1112
1088
|
] }) }),
|
|
1113
1089
|
/* @__PURE__ */ n(Zs, { children: i ? /* @__PURE__ */ c(T, { disabled: d, onClick: v, className: "w-full", variant: "destructive", children: [
|
|
1114
|
-
/* @__PURE__ */ n(
|
|
1090
|
+
/* @__PURE__ */ n(Xo, { className: "h-5 w-5" }),
|
|
1115
1091
|
d ? "Page take is requested." : l ? "Request take over again" : "Request take over"
|
|
1116
1092
|
] }) : /* @__PURE__ */ c(ei, { open: u, onOpenChange: m, children: [
|
|
1117
1093
|
/* @__PURE__ */ n(ti, { asChild: !0, children: /* @__PURE__ */ c("span", { className: "flex flex-col items-center", children: [
|
|
@@ -1123,7 +1099,7 @@ function hd({
|
|
|
1123
1099
|
/* @__PURE__ */ n(ai, { children: "Are you sure you want to take over?" }),
|
|
1124
1100
|
/* @__PURE__ */ c(ri, { children: [
|
|
1125
1101
|
/* @__PURE__ */ c("span", { className: "flex items-center space-x-2 text-yellow-500", children: [
|
|
1126
|
-
/* @__PURE__ */ n(
|
|
1102
|
+
/* @__PURE__ */ n(Zo, { className: "h-5 w-5" }),
|
|
1127
1103
|
/* @__PURE__ */ n("span", { children: "This action might cause the other user to lose unsaved changes." })
|
|
1128
1104
|
] }),
|
|
1129
1105
|
/* @__PURE__ */ n("br", {}),
|
|
@@ -1147,22 +1123,22 @@ const Cs = ({
|
|
|
1147
1123
|
lockingStatus: t,
|
|
1148
1124
|
onContinue: s
|
|
1149
1125
|
}) => {
|
|
1150
|
-
const [a, r] = S(!1), i = t === "page_is_active_in_other_tab", l = (t == null ? void 0 : t.length) > 0, { pageLock: o, acceptTakeOver: d, rejectTakeOver: h } =
|
|
1126
|
+
const [a, r] = S(!1), i = t === "page_is_active_in_other_tab", l = (t == null ? void 0 : t.length) > 0, { pageLock: o, acceptTakeOver: d, rejectTakeOver: h } = Ki(), u = () => {
|
|
1151
1127
|
r(!0), l || i ? s() : d(), setTimeout(() => {
|
|
1152
1128
|
r(!1);
|
|
1153
1129
|
}, 3e3);
|
|
1154
1130
|
};
|
|
1155
|
-
return
|
|
1131
|
+
return ne(() => {
|
|
1156
1132
|
(o == null ? void 0 : o.requestedBy) === "ANOTHER_TAB" && d();
|
|
1157
|
-
}, [o, d]), (o == null ? void 0 : o.requestedBy) === "ANOTHER_TAB" ? null : e ? /* @__PURE__ */ n(
|
|
1133
|
+
}, [o, d]), (o == null ? void 0 : o.requestedBy) === "ANOTHER_TAB" ? null : e ? /* @__PURE__ */ n(Qi, {}) : /* @__PURE__ */ n(ps, { children: /* @__PURE__ */ c(Qs, { className: "mx-auto w-full max-w-md", children: [
|
|
1158
1134
|
/* @__PURE__ */ n(Js, { className: "space-y-1", children: /* @__PURE__ */ c(Ys, { className: "flex items-center gap-2 text-xl font-medium", children: [
|
|
1159
|
-
a ? /* @__PURE__ */ n(wt, { className: "h-6 w-6 animate-spin text-gray-500" }) : i ? /* @__PURE__ */ n(
|
|
1135
|
+
a ? /* @__PURE__ */ n(wt, { className: "h-6 w-6 animate-spin text-gray-500" }) : i ? /* @__PURE__ */ n(ec, { className: "h-6 w-6 text-green-500" }) : l ? /* @__PURE__ */ n(Ni, { className: "h-6 w-6 text-green-500" }) : /* @__PURE__ */ n(tc, { className: "h-6 w-6 text-green-500" }),
|
|
1160
1136
|
i ? "Page is active in other tab" : l ? "You can edit the page now." : "Page take over request"
|
|
1161
1137
|
] }) }),
|
|
1162
1138
|
/* @__PURE__ */ n(Xs, { className: "grid gap-4", children: /* @__PURE__ */ n("div", { children: i ? /* @__PURE__ */ n("p", { children: 'You are already editing this page in another tab. To continue editing here, click on "Continue editing here".' }) : l ? /* @__PURE__ */ n("p", { children: "This page is released by other user you can continue editing now." }) : /* @__PURE__ */ c("p", { children: [
|
|
1163
1139
|
/* @__PURE__ */ c("b", { children: [
|
|
1164
1140
|
" ",
|
|
1165
|
-
/* @__PURE__ */ n(
|
|
1141
|
+
/* @__PURE__ */ n(dd, { userId: o == null ? void 0 : o.requestedBy })
|
|
1166
1142
|
] }),
|
|
1167
1143
|
" ",
|
|
1168
1144
|
"has requested to take over this page.",
|
|
@@ -1177,10 +1153,10 @@ const Cs = ({
|
|
|
1177
1153
|
onClick: u,
|
|
1178
1154
|
className: l ? "" : "bg-green-500 hover:bg-green-600",
|
|
1179
1155
|
children: i ? /* @__PURE__ */ c(ce, { children: [
|
|
1180
|
-
/* @__PURE__ */ n(
|
|
1156
|
+
/* @__PURE__ */ n(Hn, { className: "h-5 w-5" }),
|
|
1181
1157
|
" Continue editing here"
|
|
1182
1158
|
] }) : l ? /* @__PURE__ */ c(ce, { children: [
|
|
1183
|
-
/* @__PURE__ */ n(
|
|
1159
|
+
/* @__PURE__ */ n(Hn, { className: "h-5 w-5" }),
|
|
1184
1160
|
" Continue to edit"
|
|
1185
1161
|
] }) : /* @__PURE__ */ c(ce, { children: [
|
|
1186
1162
|
/* @__PURE__ */ n(it, { className: "h-5 w-5" }),
|
|
@@ -1194,8 +1170,8 @@ const Cs = ({
|
|
|
1194
1170
|
] })
|
|
1195
1171
|
] })
|
|
1196
1172
|
] }) });
|
|
1197
|
-
},
|
|
1198
|
-
const { pageLock: e, requestTakeOver: t } =
|
|
1173
|
+
}, hd = () => {
|
|
1174
|
+
const { pageLock: e, requestTakeOver: t } = Ki(), { isLocked: s, currentEditor: a, lockingStatus: r, setLockingStatus: i, realtimePageLockEnabled: l } = At(), { data: o, isFetching: d } = St(a), [h] = He(), u = h.get("page"), { mutate: m } = Bi(), { isFetching: v } = Hi(), [p] = la(), y = Ie(), g = ae(() => {
|
|
1199
1175
|
l ? t() : m({ id: u });
|
|
1200
1176
|
}, [u, m, t, l]);
|
|
1201
1177
|
return u ? l && (e == null ? void 0 : e.status) === "checking" ? /* @__PURE__ */ n(Cs, { isChecking: !0, lockingStatus: "", onContinue: () => {
|
|
@@ -1211,7 +1187,7 @@ const Cs = ({
|
|
|
1211
1187
|
}
|
|
1212
1188
|
}
|
|
1213
1189
|
) : null : l && (e != null && e.isActiveInOtherTab) ? /* @__PURE__ */ n(Cs, { lockingStatus: "page_is_active_in_other_tab", onContinue: t }) : /* @__PURE__ */ n(
|
|
1214
|
-
|
|
1190
|
+
ud,
|
|
1215
1191
|
{
|
|
1216
1192
|
...o,
|
|
1217
1193
|
isFetchingUserInfo: d,
|
|
@@ -1223,7 +1199,7 @@ const Cs = ({
|
|
|
1223
1199
|
isRequestRejected: r === "take_over_request_rejected"
|
|
1224
1200
|
}
|
|
1225
1201
|
) : null;
|
|
1226
|
-
},
|
|
1202
|
+
}, md = () => {
|
|
1227
1203
|
const [e, t] = He(), s = e.get("lang"), a = $i(s), { setSelectedLang: r } = Fe(), i = () => {
|
|
1228
1204
|
const o = new URLSearchParams(window.location.search);
|
|
1229
1205
|
o.delete("lang");
|
|
@@ -1232,7 +1208,7 @@ const Cs = ({
|
|
|
1232
1208
|
};
|
|
1233
1209
|
if (a) return null;
|
|
1234
1210
|
const l = M(De, s);
|
|
1235
|
-
return /* @__PURE__ */ n(
|
|
1211
|
+
return /* @__PURE__ */ n(ps, { children: /* @__PURE__ */ c(Qs, { className: "mx-auto w-full max-w-md", children: [
|
|
1236
1212
|
/* @__PURE__ */ n(Js, { className: "space-y-1", children: /* @__PURE__ */ c(Ys, { className: "flex items-center gap-2 text-2xl", children: [
|
|
1237
1213
|
/* @__PURE__ */ n(wi, { className: "h-6 w-6 text-yellow-500" }),
|
|
1238
1214
|
'Page missing for "',
|
|
@@ -1248,7 +1224,7 @@ const Cs = ({
|
|
|
1248
1224
|
] }) }),
|
|
1249
1225
|
/* @__PURE__ */ n(Zs, { children: /* @__PURE__ */ n(T, { onClick: i, className: "w-full", variant: "destructive", children: "Switch to default language" }) })
|
|
1250
1226
|
] }) });
|
|
1251
|
-
},
|
|
1227
|
+
}, fd = (e) => {
|
|
1252
1228
|
const t = de(), s = X();
|
|
1253
1229
|
return Pe({
|
|
1254
1230
|
mutationFn: async (a) => s(t, {
|
|
@@ -1264,7 +1240,7 @@ const Cs = ({
|
|
|
1264
1240
|
});
|
|
1265
1241
|
}
|
|
1266
1242
|
});
|
|
1267
|
-
},
|
|
1243
|
+
}, gd = (e) => {
|
|
1268
1244
|
const t = de(), s = X();
|
|
1269
1245
|
return Oe({
|
|
1270
1246
|
queryKey: ["uiBlockDetails", e],
|
|
@@ -1283,7 +1259,7 @@ const Cs = ({
|
|
|
1283
1259
|
},
|
|
1284
1260
|
retry: !1
|
|
1285
1261
|
});
|
|
1286
|
-
},
|
|
1262
|
+
}, pd = (e) => {
|
|
1287
1263
|
const t = de(), s = X();
|
|
1288
1264
|
return Pe({
|
|
1289
1265
|
mutationFn: async (a) => s(t, {
|
|
@@ -1299,7 +1275,7 @@ const Cs = ({
|
|
|
1299
1275
|
});
|
|
1300
1276
|
}
|
|
1301
1277
|
});
|
|
1302
|
-
},
|
|
1278
|
+
}, yd = ({
|
|
1303
1279
|
blockId: e,
|
|
1304
1280
|
libBlockId: t,
|
|
1305
1281
|
isOpen: s,
|
|
@@ -1307,7 +1283,7 @@ const Cs = ({
|
|
|
1307
1283
|
blockName: r,
|
|
1308
1284
|
trigger: i
|
|
1309
1285
|
}) => {
|
|
1310
|
-
const [l, o] = S(!1), d = Zr(), h =
|
|
1286
|
+
const [l, o] = S(!1), d = Zr(), h = pd(() => {
|
|
1311
1287
|
d([e], { _libBlockId: void 0 }), V.success("Block deleted successfully"), o(!1), a();
|
|
1312
1288
|
});
|
|
1313
1289
|
return /* @__PURE__ */ c(wn, { open: s, onOpenChange: (v) => !v && a(), children: [
|
|
@@ -1373,7 +1349,7 @@ const Cs = ({
|
|
|
1373
1349
|
}
|
|
1374
1350
|
)
|
|
1375
1351
|
] });
|
|
1376
|
-
},
|
|
1352
|
+
}, vd = ({
|
|
1377
1353
|
blockId: e,
|
|
1378
1354
|
libBlockId: t,
|
|
1379
1355
|
blockName: s,
|
|
@@ -1383,7 +1359,7 @@ const Cs = ({
|
|
|
1383
1359
|
}) => {
|
|
1384
1360
|
const [l, o] = S(!1);
|
|
1385
1361
|
return /* @__PURE__ */ n(
|
|
1386
|
-
|
|
1362
|
+
yd,
|
|
1387
1363
|
{
|
|
1388
1364
|
blockId: e,
|
|
1389
1365
|
libBlockId: t,
|
|
@@ -1408,7 +1384,7 @@ const Cs = ({
|
|
|
1408
1384
|
)
|
|
1409
1385
|
}
|
|
1410
1386
|
);
|
|
1411
|
-
},
|
|
1387
|
+
}, bd = () => {
|
|
1412
1388
|
const e = de(), t = X(), s = Ie(), {
|
|
1413
1389
|
data: a = [],
|
|
1414
1390
|
isLoading: r,
|
|
@@ -1452,8 +1428,8 @@ const Cs = ({
|
|
|
1452
1428
|
createGroup: l,
|
|
1453
1429
|
isCreating: o
|
|
1454
1430
|
};
|
|
1455
|
-
},
|
|
1456
|
-
const [s, a] = S(!1), [r, i] = S(""), l = tt(null), { groups: o } =
|
|
1431
|
+
}, xd = ({ value: e, onChange: t }) => {
|
|
1432
|
+
const [s, a] = S(!1), [r, i] = S(""), l = tt(null), { groups: o } = bd(), [d, h] = S([
|
|
1457
1433
|
{ id: "hero", name: "Hero" },
|
|
1458
1434
|
{ id: "feature", name: "Feature" },
|
|
1459
1435
|
{ id: "footer", name: "Footer" },
|
|
@@ -1495,13 +1471,13 @@ const Cs = ({
|
|
|
1495
1471
|
const y = { id: p, name: p };
|
|
1496
1472
|
h((g) => [...g, y]), t(y.id), i(""), a(!1);
|
|
1497
1473
|
};
|
|
1498
|
-
|
|
1474
|
+
ne(() => {
|
|
1499
1475
|
s && l.current && l.current.focus();
|
|
1500
1476
|
}, [s]);
|
|
1501
1477
|
const v = (p) => {
|
|
1502
1478
|
p.key === "Enter" && (p.preventDefault(), m());
|
|
1503
1479
|
};
|
|
1504
|
-
return
|
|
1480
|
+
return ne(() => {
|
|
1505
1481
|
e && !u.some((p) => p.id === e) && t("");
|
|
1506
1482
|
}, [e, u, t]), s ? /* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
1507
1483
|
/* @__PURE__ */ n(
|
|
@@ -1551,22 +1527,22 @@ const Cs = ({
|
|
|
1551
1527
|
size: "icon",
|
|
1552
1528
|
variant: "outline",
|
|
1553
1529
|
onClick: () => a(!0),
|
|
1554
|
-
children: /* @__PURE__ */ n(
|
|
1530
|
+
children: /* @__PURE__ */ n(fs, { className: "h-4 w-4" })
|
|
1555
1531
|
}
|
|
1556
1532
|
)
|
|
1557
1533
|
] });
|
|
1558
|
-
}, Nr = 3 * 1024 * 1024,
|
|
1534
|
+
}, Nr = 3 * 1024 * 1024, wd = 10 * 1024 * 1024;
|
|
1559
1535
|
function Oa(e) {
|
|
1560
1536
|
const t = isNaN(e) ? 0 : typeof e == "number" ? e : parseInt(e);
|
|
1561
1537
|
return t ? t < 1024 ? `${t.toFixed(2)} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(2)} KB` : `${(t / (1024 * 1024)).toFixed(2)} MB` : "0 B";
|
|
1562
1538
|
}
|
|
1563
|
-
function
|
|
1539
|
+
function Ji(e) {
|
|
1564
1540
|
return new Promise((t, s) => {
|
|
1565
1541
|
if (e.size <= Nr) {
|
|
1566
1542
|
t(e);
|
|
1567
1543
|
return;
|
|
1568
1544
|
}
|
|
1569
|
-
new
|
|
1545
|
+
new Pc(e, {
|
|
1570
1546
|
quality: 0.8,
|
|
1571
1547
|
// 80% quality
|
|
1572
1548
|
maxWidth: 2048,
|
|
@@ -1580,14 +1556,14 @@ function Yi(e) {
|
|
|
1580
1556
|
},
|
|
1581
1557
|
error(a) {
|
|
1582
1558
|
V.error(
|
|
1583
|
-
`Failed to compress image. Image size is ${Oa(e.size)}, which exceeds the maximum allowed size of ${Oa(
|
|
1559
|
+
`Failed to compress image. Image size is ${Oa(e.size)}, which exceeds the maximum allowed size of ${Oa(wd)}.`
|
|
1584
1560
|
), s(a);
|
|
1585
1561
|
}
|
|
1586
1562
|
});
|
|
1587
1563
|
});
|
|
1588
1564
|
}
|
|
1589
|
-
const
|
|
1590
|
-
const [s, a] = S(!1), r = tt(null), i =
|
|
1565
|
+
const Nd = ({ value: e, onChange: t }) => {
|
|
1566
|
+
const [s, a] = S(!1), r = tt(null), i = ae(
|
|
1591
1567
|
async (d) => {
|
|
1592
1568
|
var u;
|
|
1593
1569
|
const h = (u = d.target.files) == null ? void 0 : u[0];
|
|
@@ -1595,7 +1571,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1595
1571
|
try {
|
|
1596
1572
|
a(!0);
|
|
1597
1573
|
let m = h;
|
|
1598
|
-
h.type.startsWith("image/") && (m = await
|
|
1574
|
+
h.type.startsWith("image/") && (m = await Ji(h));
|
|
1599
1575
|
const v = new FileReader();
|
|
1600
1576
|
v.onloadend = () => {
|
|
1601
1577
|
t(v.result), a(!1);
|
|
@@ -1618,7 +1594,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1618
1594
|
/* @__PURE__ */ n("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
1619
1595
|
"Uploading..."
|
|
1620
1596
|
] }) : /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
1621
|
-
/* @__PURE__ */ n(
|
|
1597
|
+
/* @__PURE__ */ n(Wn, { className: "h-4 w-4" }),
|
|
1622
1598
|
"Select image"
|
|
1623
1599
|
] }) }),
|
|
1624
1600
|
e && /* @__PURE__ */ n(T, { type: "button", variant: "outline", size: "icon", onClick: () => {
|
|
@@ -1628,7 +1604,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1628
1604
|
e && /* @__PURE__ */ n("div", { className: "aspect-video h-[200px] max-h-[200px] overflow-hidden rounded-md border", children: /* @__PURE__ */ n("img", { src: e, alt: "Preview", className: "h-full w-full object-contain" }) })
|
|
1629
1605
|
] });
|
|
1630
1606
|
}, Ce = {
|
|
1631
|
-
...
|
|
1607
|
+
...Ao,
|
|
1632
1608
|
//pages
|
|
1633
1609
|
ADD_PAGE: "add_page",
|
|
1634
1610
|
EDIT_PAGE: "edit_page",
|
|
@@ -1664,39 +1640,39 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1664
1640
|
ADD_MEDIA: "add_media",
|
|
1665
1641
|
EDIT_MEDIA: "edit_media",
|
|
1666
1642
|
DELETE_MEDIA: "delete_media"
|
|
1667
|
-
},
|
|
1668
|
-
const { blocks: t, close: s, blockId: a } = e, { getPartailBlocks: r } =
|
|
1643
|
+
}, Ed = (e) => {
|
|
1644
|
+
const { blocks: t, close: s, blockId: a } = e, { getPartailBlocks: r } = To(), i = t.find((P) => P._id === a), l = i == null ? void 0 : i._libBlockId, o = !!l, d = K(() => t.some(
|
|
1669
1645
|
(P) => P._type === "PartialBlock" || P._type === "GlobalBlock"
|
|
1670
1646
|
), [t]), h = K(() => {
|
|
1671
1647
|
let P = [];
|
|
1672
1648
|
for (const B of t)
|
|
1673
1649
|
if (B._type === "PartialBlock" || B._type === "GlobalBlock") {
|
|
1674
1650
|
let A = r(B.partialBlockId);
|
|
1675
|
-
B._parent && (A == null ? void 0 : A.length) > 0 && (A = A.map((O) => (J(O._parent) &&
|
|
1651
|
+
B._parent && (A == null ? void 0 : A.length) > 0 && (A = A.map((O) => (J(O._parent) && pt(O, "_parent", B._parent), O))), P = [...P, ...A];
|
|
1676
1652
|
} else
|
|
1677
1653
|
P.push(B);
|
|
1678
1654
|
return P;
|
|
1679
|
-
}, [t, r]), [u, m] = S(""), [v, p] = S(""), [y, g] = S(""), [b, x] = S(""), [N, I] = S({}), [_, k] = S(!1), [E, q] = S(o), [Z, re] = S(!1), { hasPermission: L } = kn(), U = L(Ce.DELETE_LIBRARY_BLOCK),
|
|
1680
|
-
|
|
1655
|
+
}, [t, r]), [u, m] = S(""), [v, p] = S(""), [y, g] = S(""), [b, x] = S(""), [N, I] = S({}), [_, k] = S(!1), [E, q] = S(o), [Z, re] = S(!1), { hasPermission: L } = kn(), U = L(Ce.DELETE_LIBRARY_BLOCK), $ = Zr(), R = () => {
|
|
1656
|
+
$([a], { _libBlockId: void 0 }), V.success("Block delinked from library"), s();
|
|
1681
1657
|
}, {
|
|
1682
1658
|
data: H,
|
|
1683
1659
|
isLoading: z,
|
|
1684
1660
|
isError: ie
|
|
1685
|
-
} =
|
|
1686
|
-
|
|
1661
|
+
} = gd(l);
|
|
1662
|
+
ne(() => {
|
|
1687
1663
|
ie && o && (re(!0), q(!1));
|
|
1688
|
-
}, [ie, o]),
|
|
1664
|
+
}, [ie, o]), ne(() => {
|
|
1689
1665
|
H && !z && (m(H.name || ""), p(H.group || ""), g(H.description || ""), x(H.preview || ""), q(!1));
|
|
1690
|
-
}, [H, z]),
|
|
1666
|
+
}, [H, z]), ne(() => {
|
|
1691
1667
|
const P = u.trim().length >= 2, B = v.trim() !== "";
|
|
1692
1668
|
k(P && B);
|
|
1693
1669
|
}, [u, v]);
|
|
1694
1670
|
const Ne = () => {
|
|
1695
1671
|
const P = {};
|
|
1696
1672
|
return u.trim() ? u.length < 2 && (P.name = "Name must be at least 2 characters") : P.name = "Name is required", v || (P.group = "Group is required"), I(P), Object.keys(P).length === 0;
|
|
1697
|
-
}, { resetLibrary: Ee } =
|
|
1673
|
+
}, { resetLibrary: Ee } = Co({ id: "" }), me = fd(
|
|
1698
1674
|
(P) => {
|
|
1699
|
-
o ||
|
|
1675
|
+
o || $([a], { _libBlockId: P.id }), V.success(`Block ${o ? "updated" : "saved"} successfully`), Ee(P.library), s();
|
|
1700
1676
|
}
|
|
1701
1677
|
), w = async (P) => {
|
|
1702
1678
|
if (P.preventDefault(), !Ne()) return;
|
|
@@ -1758,7 +1734,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1758
1734
|
children: "Group"
|
|
1759
1735
|
}
|
|
1760
1736
|
),
|
|
1761
|
-
/* @__PURE__ */ n(
|
|
1737
|
+
/* @__PURE__ */ n(xd, { value: v, onChange: p }),
|
|
1762
1738
|
N.group && /* @__PURE__ */ n("p", { className: "text-xs text-destructive", children: N.group })
|
|
1763
1739
|
] }),
|
|
1764
1740
|
/* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
@@ -1776,11 +1752,11 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1776
1752
|
] }),
|
|
1777
1753
|
/* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
1778
1754
|
/* @__PURE__ */ n(he, { htmlFor: "previewImage", children: "Preview Image (optional)" }),
|
|
1779
|
-
/* @__PURE__ */ n(
|
|
1755
|
+
/* @__PURE__ */ n(Nd, { value: b, onChange: x })
|
|
1780
1756
|
] }),
|
|
1781
1757
|
/* @__PURE__ */ c("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
1782
1758
|
o && U && /* @__PURE__ */ n(
|
|
1783
|
-
|
|
1759
|
+
vd,
|
|
1784
1760
|
{
|
|
1785
1761
|
blockId: a,
|
|
1786
1762
|
libBlockId: l,
|
|
@@ -1852,7 +1828,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1852
1828
|
GLOBAL_BLOCK_PUBLISH_SUCCESS: "Global block published successfully.",
|
|
1853
1829
|
PAGES_PUBLISH_SUCCESS: "Your changes have been published successfully.",
|
|
1854
1830
|
SLUG_CHANGE_SUCCESS: "Slug changed successfully."
|
|
1855
|
-
},
|
|
1831
|
+
}, Sd = {
|
|
1856
1832
|
SLUG_ALREADY_USED: "This slug is already in use. Please choose a different one."
|
|
1857
1833
|
}, Ge = () => {
|
|
1858
1834
|
const e = de(), t = X();
|
|
@@ -1861,10 +1837,10 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1861
1837
|
initialData: [],
|
|
1862
1838
|
queryFn: async () => t(e, { action: G.GET_PAGE_TYPES })
|
|
1863
1839
|
});
|
|
1864
|
-
},
|
|
1840
|
+
}, Yi = (e) => {
|
|
1865
1841
|
const { data: t } = Ge();
|
|
1866
1842
|
return K(() => t == null ? void 0 : t.find((s) => s.key === e), [t, e]);
|
|
1867
|
-
},
|
|
1843
|
+
}, Ad = () => {
|
|
1868
1844
|
const e = de(), t = X();
|
|
1869
1845
|
return Pe({
|
|
1870
1846
|
mutationFn: async ({ pageType: s, query: a }) => {
|
|
@@ -1881,7 +1857,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1881
1857
|
}
|
|
1882
1858
|
}
|
|
1883
1859
|
});
|
|
1884
|
-
},
|
|
1860
|
+
}, Xi = () => {
|
|
1885
1861
|
const e = de(), t = Ie(), s = X(), { data: a } = Ge();
|
|
1886
1862
|
return Pe({
|
|
1887
1863
|
mutationFn: async (r) => await s(e, {
|
|
@@ -1903,12 +1879,12 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1903
1879
|
onError: (r, i) => {
|
|
1904
1880
|
const l = ve(a, { key: i.pageType });
|
|
1905
1881
|
V.error(`Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`, {
|
|
1906
|
-
description: M(
|
|
1882
|
+
description: M(Sd, r.message, r.message)
|
|
1907
1883
|
});
|
|
1908
1884
|
}
|
|
1909
1885
|
});
|
|
1910
1886
|
}, sr = () => {
|
|
1911
|
-
const e = de(), t = Ie(), s = X(), { data: a } =
|
|
1887
|
+
const e = de(), t = Ie(), s = X(), { data: a } = Rt(), { data: r } = Ge();
|
|
1912
1888
|
return Pe({
|
|
1913
1889
|
mutationFn: async (i) => await s(e, {
|
|
1914
1890
|
action: G.UPDATE_PAGE,
|
|
@@ -1932,7 +1908,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1932
1908
|
});
|
|
1933
1909
|
}
|
|
1934
1910
|
});
|
|
1935
|
-
},
|
|
1911
|
+
}, Td = () => {
|
|
1936
1912
|
const e = de(), t = Ie(), s = X(), { data: a } = Ge();
|
|
1937
1913
|
return Pe({
|
|
1938
1914
|
mutationFn: async (r) => s(e, {
|
|
@@ -1961,7 +1937,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
1961
1937
|
});
|
|
1962
1938
|
}
|
|
1963
1939
|
});
|
|
1964
|
-
},
|
|
1940
|
+
}, Cd = () => {
|
|
1965
1941
|
const e = de(), t = Ie(), s = X(), { data: a } = Ge();
|
|
1966
1942
|
return Pe({
|
|
1967
1943
|
mutationFn: async (r) => s(e, {
|
|
@@ -2006,7 +1982,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
2006
1982
|
console.log("##", i), V.error("Failed to publish pages.");
|
|
2007
1983
|
}
|
|
2008
1984
|
});
|
|
2009
|
-
},
|
|
1985
|
+
}, kd = () => {
|
|
2010
1986
|
const e = de(), t = X(), s = Ie();
|
|
2011
1987
|
return Pe({
|
|
2012
1988
|
mutationFn: async (a) => {
|
|
@@ -2031,7 +2007,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
2031
2007
|
V.error("Failed to mark page as template.");
|
|
2032
2008
|
}
|
|
2033
2009
|
});
|
|
2034
|
-
},
|
|
2010
|
+
}, Pd = () => {
|
|
2035
2011
|
const e = de(), t = X(), s = Ie();
|
|
2036
2012
|
return Pe({
|
|
2037
2013
|
mutationFn: async (a) => t(e, {
|
|
@@ -2047,7 +2023,7 @@ const Ed = ({ value: e, onChange: t }) => {
|
|
|
2047
2023
|
V.error("Failed to unmark page as template.");
|
|
2048
2024
|
}
|
|
2049
2025
|
});
|
|
2050
|
-
},
|
|
2026
|
+
}, Id = () => {
|
|
2051
2027
|
const e = de(), t = X(), s = Ie();
|
|
2052
2028
|
return Pe({
|
|
2053
2029
|
mutationFn: async ({ id: a, slug: r }) => t(e, {
|
|
@@ -2105,8 +2081,8 @@ var rr = {};
|
|
|
2105
2081
|
var w = Math.floor(16.666666666666668), f, P, B = {}, A = 0;
|
|
2106
2082
|
return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (f = function(O) {
|
|
2107
2083
|
var W = Math.random();
|
|
2108
|
-
return B[W] = requestAnimationFrame(function
|
|
2109
|
-
A === Q || A + w - 1 < Q ? (A = Q, delete B[W], O()) : B[W] = requestAnimationFrame(
|
|
2084
|
+
return B[W] = requestAnimationFrame(function F(Q) {
|
|
2085
|
+
A === Q || A + w - 1 < Q ? (A = Q, delete B[W], O()) : B[W] = requestAnimationFrame(F);
|
|
2110
2086
|
}), W;
|
|
2111
2087
|
}, P = function(O) {
|
|
2112
2088
|
B[O] && cancelAnimationFrame(B[O]);
|
|
@@ -2118,26 +2094,26 @@ var rr = {};
|
|
|
2118
2094
|
}(), v = /* @__PURE__ */ function() {
|
|
2119
2095
|
var w, f, P = {};
|
|
2120
2096
|
function B(A) {
|
|
2121
|
-
function O(W,
|
|
2122
|
-
A.postMessage({ options: W || {}, callback:
|
|
2097
|
+
function O(W, F) {
|
|
2098
|
+
A.postMessage({ options: W || {}, callback: F });
|
|
2123
2099
|
}
|
|
2124
|
-
A.init = function(
|
|
2125
|
-
var Q =
|
|
2100
|
+
A.init = function(F) {
|
|
2101
|
+
var Q = F.transferControlToOffscreen();
|
|
2126
2102
|
A.postMessage({ canvas: Q }, [Q]);
|
|
2127
|
-
}, A.fire = function(
|
|
2103
|
+
}, A.fire = function(F, Q, ue) {
|
|
2128
2104
|
if (f)
|
|
2129
|
-
return O(
|
|
2105
|
+
return O(F, null), f;
|
|
2130
2106
|
var j = Math.random().toString(36).slice(2);
|
|
2131
2107
|
return f = h(function(le) {
|
|
2132
2108
|
function be(Se) {
|
|
2133
2109
|
Se.data.callback === j && (delete P[j], A.removeEventListener("message", be), f = null, u.clear(), ue(), le());
|
|
2134
2110
|
}
|
|
2135
|
-
A.addEventListener("message", be), O(
|
|
2111
|
+
A.addEventListener("message", be), O(F, j), P[j] = be.bind(null, { data: { callback: j } });
|
|
2136
2112
|
}), f;
|
|
2137
2113
|
}, A.reset = function() {
|
|
2138
2114
|
A.postMessage({ reset: !0 });
|
|
2139
|
-
for (var
|
|
2140
|
-
P[
|
|
2115
|
+
for (var F in P)
|
|
2116
|
+
P[F](), delete P[F];
|
|
2141
2117
|
};
|
|
2142
2118
|
}
|
|
2143
2119
|
return function() {
|
|
@@ -2249,8 +2225,8 @@ var rr = {};
|
|
|
2249
2225
|
var f = document.createElement("canvas");
|
|
2250
2226
|
return f.style.position = "fixed", f.style.top = "0px", f.style.left = "0px", f.style.pointerEvents = "none", f.style.zIndex = w, f;
|
|
2251
2227
|
}
|
|
2252
|
-
function L(w, f, P, B, A, O, W,
|
|
2253
|
-
w.save(), w.translate(f, P), w.rotate(O), w.scale(B, A), w.arc(0, 0, 1, W,
|
|
2228
|
+
function L(w, f, P, B, A, O, W, F, Q) {
|
|
2229
|
+
w.save(), w.translate(f, P), w.rotate(O), w.scale(B, A), w.arc(0, 0, 1, W, F, Q), w.restore();
|
|
2254
2230
|
}
|
|
2255
2231
|
function U(w) {
|
|
2256
2232
|
var f = w.angle * (Math.PI / 180), P = w.spread * (Math.PI / 180);
|
|
@@ -2279,7 +2255,7 @@ var rr = {};
|
|
|
2279
2255
|
flat: w.flat
|
|
2280
2256
|
};
|
|
2281
2257
|
}
|
|
2282
|
-
function
|
|
2258
|
+
function $(w, f) {
|
|
2283
2259
|
f.x += Math.cos(f.angle2D) * f.velocity + f.drift, f.y += Math.sin(f.angle2D) * f.velocity + f.gravity, f.velocity *= f.decay, f.flat ? (f.wobble = 0, f.wobbleX = f.x + 10 * f.scalar, f.wobbleY = f.y + 10 * f.scalar, f.tiltSin = 0, f.tiltCos = 0, f.random = 1) : (f.wobble += f.wobbleSpeed, f.wobbleX = f.x + 10 * f.scalar * Math.cos(f.wobble), f.wobbleY = f.y + 10 * f.scalar * Math.sin(f.wobble), f.tiltAngle += 0.1, f.tiltSin = Math.sin(f.tiltAngle), f.tiltCos = Math.cos(f.tiltAngle), f.random = Math.random() + 2);
|
|
2284
2260
|
var P = f.tick++ / f.totalTicks, B = f.x + f.random * f.tiltCos, A = f.y + f.random * f.tiltSin, O = f.wobbleX + f.random * f.tiltCos, W = f.wobbleY + f.random * f.tiltSin;
|
|
2285
2261
|
if (w.fillStyle = "rgba(" + f.color.r + ", " + f.color.g + ", " + f.color.b + ", " + (1 - P) + ")", w.beginPath(), l && f.shape.type === "path" && typeof f.shape.path == "string" && Array.isArray(f.shape.matrix))
|
|
@@ -2293,11 +2269,11 @@ var rr = {};
|
|
|
2293
2269
|
Math.PI / 10 * f.wobble
|
|
2294
2270
|
));
|
|
2295
2271
|
else if (f.shape.type === "bitmap") {
|
|
2296
|
-
var
|
|
2297
|
-
Math.cos(
|
|
2298
|
-
Math.sin(
|
|
2299
|
-
-Math.sin(
|
|
2300
|
-
Math.cos(
|
|
2272
|
+
var F = Math.PI / 10 * f.wobble, Q = Math.abs(O - B) * 0.1, ue = Math.abs(W - A) * 0.1, j = f.shape.bitmap.width * f.scalar, le = f.shape.bitmap.height * f.scalar, be = new DOMMatrix([
|
|
2273
|
+
Math.cos(F) * Q,
|
|
2274
|
+
Math.sin(F) * Q,
|
|
2275
|
+
-Math.sin(F) * ue,
|
|
2276
|
+
Math.cos(F) * ue,
|
|
2301
2277
|
f.x,
|
|
2302
2278
|
f.y
|
|
2303
2279
|
]);
|
|
@@ -2319,16 +2295,16 @@ var rr = {};
|
|
|
2319
2295
|
return w.closePath(), w.fill(), f.tick < f.totalTicks;
|
|
2320
2296
|
}
|
|
2321
2297
|
function R(w, f, P, B, A) {
|
|
2322
|
-
var O = f.slice(), W = w.getContext("2d"),
|
|
2298
|
+
var O = f.slice(), W = w.getContext("2d"), F, Q, ue = h(function(j) {
|
|
2323
2299
|
function le() {
|
|
2324
|
-
|
|
2300
|
+
F = Q = null, W.clearRect(0, 0, B.width, B.height), u.clear(), A(), j();
|
|
2325
2301
|
}
|
|
2326
2302
|
function be() {
|
|
2327
2303
|
a && !(B.width === r.width && B.height === r.height) && (B.width = w.width = r.width, B.height = w.height = r.height), !B.width && !B.height && (P(w), B.width = w.width, B.height = w.height), W.clearRect(0, 0, B.width, B.height), O = O.filter(function(Se) {
|
|
2328
|
-
return
|
|
2329
|
-
}), O.length ?
|
|
2304
|
+
return $(W, Se);
|
|
2305
|
+
}), O.length ? F = m.frame(be) : le();
|
|
2330
2306
|
}
|
|
2331
|
-
|
|
2307
|
+
F = m.frame(be), Q = le;
|
|
2332
2308
|
});
|
|
2333
2309
|
return {
|
|
2334
2310
|
addFettis: function(j) {
|
|
@@ -2337,14 +2313,14 @@ var rr = {};
|
|
|
2337
2313
|
canvas: w,
|
|
2338
2314
|
promise: ue,
|
|
2339
2315
|
reset: function() {
|
|
2340
|
-
|
|
2316
|
+
F && m.cancel(F), Q && Q();
|
|
2341
2317
|
}
|
|
2342
2318
|
};
|
|
2343
2319
|
}
|
|
2344
2320
|
function H(w, f) {
|
|
2345
|
-
var P = !w, B = !!b(f || {}, "resize"), A = !1, O = b(f, "disableForReducedMotion", Boolean), W = i && !!b(f || {}, "useWorker"),
|
|
2321
|
+
var P = !w, B = !!b(f || {}, "resize"), A = !1, O = b(f, "disableForReducedMotion", Boolean), W = i && !!b(f || {}, "useWorker"), F = W ? v() : null, Q = P ? q : Z, ue = w && F ? !!w.__confetti_initialized : !1, j = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, le;
|
|
2346
2322
|
function be(D, te, Re) {
|
|
2347
|
-
for (var st = b(D, "particleCount", x), Y = b(D, "angle", Number), Je = b(D, "spread", Number), at = b(D, "startVelocity", Number), ma = b(D, "decay", Number), fa = b(D, "gravity", Number), ga = b(D, "drift", Number), xs = b(D, "colors", _), pa = b(D, "ticks", Number), ws = b(D, "shapes"), ya = b(D, "scalar"), va = !!b(D, "flat"),
|
|
2323
|
+
for (var st = b(D, "particleCount", x), Y = b(D, "angle", Number), Je = b(D, "spread", Number), at = b(D, "startVelocity", Number), ma = b(D, "decay", Number), fa = b(D, "gravity", Number), ga = b(D, "drift", Number), xs = b(D, "colors", _), pa = b(D, "ticks", Number), ws = b(D, "shapes"), ya = b(D, "scalar"), va = !!b(D, "flat"), Rn = E(D), Yt = st, Ct = [], Ns = w.width * Rn.x, Es = w.height * Rn.y; Yt--; )
|
|
2348
2324
|
Ct.push(
|
|
2349
2325
|
U({
|
|
2350
2326
|
x: Ns,
|
|
@@ -2375,16 +2351,16 @@ var rr = {};
|
|
|
2375
2351
|
width: w.width,
|
|
2376
2352
|
height: w.height
|
|
2377
2353
|
};
|
|
2378
|
-
|
|
2354
|
+
F && !ue && F.init(w), ue = !0, F && (w.__confetti_initialized = !0);
|
|
2379
2355
|
function Y() {
|
|
2380
|
-
if (
|
|
2356
|
+
if (F) {
|
|
2381
2357
|
var at = {
|
|
2382
2358
|
getBoundingClientRect: function() {
|
|
2383
2359
|
if (!P)
|
|
2384
2360
|
return w.getBoundingClientRect();
|
|
2385
2361
|
}
|
|
2386
2362
|
};
|
|
2387
|
-
Q(at),
|
|
2363
|
+
Q(at), F.postMessage({
|
|
2388
2364
|
resize: {
|
|
2389
2365
|
width: at.width,
|
|
2390
2366
|
height: at.height
|
|
@@ -2397,10 +2373,10 @@ var rr = {};
|
|
|
2397
2373
|
function Je() {
|
|
2398
2374
|
le = null, B && (A = !1, t.removeEventListener("resize", Y)), P && w && (document.body.contains(w) && document.body.removeChild(w), w = null, ue = !1);
|
|
2399
2375
|
}
|
|
2400
|
-
return B && !A && (A = !0, t.addEventListener("resize", Y, !1)),
|
|
2376
|
+
return B && !A && (A = !0, t.addEventListener("resize", Y, !1)), F ? F.fire(D, st, Je) : be(D, st, Je);
|
|
2401
2377
|
}
|
|
2402
2378
|
return Se.reset = function() {
|
|
2403
|
-
|
|
2379
|
+
F && F.reset(), le && le.reset();
|
|
2404
2380
|
}, Se;
|
|
2405
2381
|
}
|
|
2406
2382
|
var z;
|
|
@@ -2408,8 +2384,8 @@ var rr = {};
|
|
|
2408
2384
|
return z || (z = H(null, { useWorker: !0, resize: !0 })), z;
|
|
2409
2385
|
}
|
|
2410
2386
|
function Ne(w, f, P, B, A, O, W) {
|
|
2411
|
-
var
|
|
2412
|
-
Q.addPath(
|
|
2387
|
+
var F = new Path2D(w), Q = new Path2D();
|
|
2388
|
+
Q.addPath(F, new DOMMatrix(f));
|
|
2413
2389
|
var ue = new Path2D();
|
|
2414
2390
|
return ue.addPath(Q, new DOMMatrix([
|
|
2415
2391
|
Math.cos(W) * A,
|
|
@@ -2427,17 +2403,17 @@ var rr = {};
|
|
|
2427
2403
|
typeof w == "string" ? f = w : (f = w.path, P = w.matrix);
|
|
2428
2404
|
var B = new Path2D(f), A = document.createElement("canvas"), O = A.getContext("2d");
|
|
2429
2405
|
if (!P) {
|
|
2430
|
-
for (var W = 1e3,
|
|
2406
|
+
for (var W = 1e3, F = W, Q = W, ue = 0, j = 0, le, be, Se = 0; Se < W; Se += 2)
|
|
2431
2407
|
for (var D = 0; D < W; D += 2)
|
|
2432
|
-
O.isPointInPath(B, Se, D, "nonzero") && (
|
|
2433
|
-
le = ue -
|
|
2408
|
+
O.isPointInPath(B, Se, D, "nonzero") && (F = Math.min(F, Se), Q = Math.min(Q, D), ue = Math.max(ue, Se), j = Math.max(j, D));
|
|
2409
|
+
le = ue - F, be = j - Q;
|
|
2434
2410
|
var te = 10, Re = Math.min(te / le, te / be);
|
|
2435
2411
|
P = [
|
|
2436
2412
|
Re,
|
|
2437
2413
|
0,
|
|
2438
2414
|
0,
|
|
2439
2415
|
Re,
|
|
2440
|
-
-Math.round(le / 2 +
|
|
2416
|
+
-Math.round(le / 2 + F) * Re,
|
|
2441
2417
|
-Math.round(be / 2 + Q) * Re
|
|
2442
2418
|
];
|
|
2443
2419
|
}
|
|
@@ -2450,15 +2426,15 @@ var rr = {};
|
|
|
2450
2426
|
function me(w) {
|
|
2451
2427
|
var f, P = 1, B = "#000000", A = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
|
|
2452
2428
|
typeof w == "string" ? f = w : (f = w.text, P = "scalar" in w ? w.scalar : P, A = "fontFamily" in w ? w.fontFamily : A, B = "color" in w ? w.color : B);
|
|
2453
|
-
var O = 10 * P, W = "" + O + "px " + A,
|
|
2429
|
+
var O = 10 * P, W = "" + O + "px " + A, F = new OffscreenCanvas(O, O), Q = F.getContext("2d");
|
|
2454
2430
|
Q.font = W;
|
|
2455
2431
|
var ue = Q.measureText(f), j = Math.ceil(ue.actualBoundingBoxRight + ue.actualBoundingBoxLeft), le = Math.ceil(ue.actualBoundingBoxAscent + ue.actualBoundingBoxDescent), be = 2, Se = ue.actualBoundingBoxLeft + be, D = ue.actualBoundingBoxAscent + be;
|
|
2456
|
-
j += be + be, le += be + be,
|
|
2432
|
+
j += be + be, le += be + be, F = new OffscreenCanvas(j, le), Q = F.getContext("2d"), Q.font = W, Q.fillStyle = B, Q.fillText(f, Se, D);
|
|
2457
2433
|
var te = 1 / P;
|
|
2458
2434
|
return {
|
|
2459
2435
|
type: "bitmap",
|
|
2460
2436
|
// TODO these probably need to be transfered for workers
|
|
2461
|
-
bitmap:
|
|
2437
|
+
bitmap: F.transferToImageBitmap(),
|
|
2462
2438
|
matrix: [te, 0, 0, te, -j * te / 2, -le * te / 2]
|
|
2463
2439
|
};
|
|
2464
2440
|
}
|
|
@@ -2470,14 +2446,14 @@ var rr = {};
|
|
|
2470
2446
|
})(/* @__PURE__ */ function() {
|
|
2471
2447
|
return typeof window < "u" ? window : typeof self < "u" ? self : this || {};
|
|
2472
2448
|
}(), rr, !1);
|
|
2473
|
-
const
|
|
2449
|
+
const _d = rr.exports;
|
|
2474
2450
|
rr.exports.create;
|
|
2475
|
-
const
|
|
2451
|
+
const Ld = {
|
|
2476
2452
|
particleCount: 350,
|
|
2477
2453
|
spread: 120,
|
|
2478
2454
|
origin: { y: 0.6 },
|
|
2479
2455
|
angle: 90
|
|
2480
|
-
},
|
|
2456
|
+
}, Dd = {
|
|
2481
2457
|
TOP_RIGHT: {
|
|
2482
2458
|
angle: 225,
|
|
2483
2459
|
origin: { x: 0.9, y: 0 }
|
|
@@ -2486,13 +2462,13 @@ const Dd = {
|
|
|
2486
2462
|
angle: 100,
|
|
2487
2463
|
origin: { x: 0.9, y: 0.9 }
|
|
2488
2464
|
}
|
|
2489
|
-
},
|
|
2490
|
-
let t =
|
|
2465
|
+
}, Fn = (e) => {
|
|
2466
|
+
let t = Dd[e];
|
|
2491
2467
|
t || (t = {});
|
|
2492
|
-
const s = { ...
|
|
2493
|
-
|
|
2494
|
-
},
|
|
2495
|
-
const [e] =
|
|
2468
|
+
const s = { ...Ld, ...t };
|
|
2469
|
+
_d(s);
|
|
2470
|
+
}, Od = () => {
|
|
2471
|
+
const [e] = ko(), { mutate: t, isPending: s } = ar(), { mutateAsync: a, isPending: r } = Mi();
|
|
2496
2472
|
return /* @__PURE__ */ c("div", { className: "flex items-center justify-center gap-x-3 border-t bg-white py-3", children: [
|
|
2497
2473
|
/* @__PURE__ */ n(T, { size: "sm", variant: "outline", disabled: s || r, onClick: () => {
|
|
2498
2474
|
a({ settings: { theme: e } });
|
|
@@ -2502,13 +2478,13 @@ const Dd = {
|
|
|
2502
2478
|
{ ids: ["THEME"] },
|
|
2503
2479
|
{
|
|
2504
2480
|
onSuccess: () => {
|
|
2505
|
-
|
|
2481
|
+
Fn("BOTTOM_RIGHT");
|
|
2506
2482
|
}
|
|
2507
2483
|
}
|
|
2508
2484
|
);
|
|
2509
2485
|
}, children: "Publish" })
|
|
2510
2486
|
] });
|
|
2511
|
-
},
|
|
2487
|
+
}, ys = vt(null), Rd = (e) => {
|
|
2512
2488
|
if (!e) return { base: e, extension: null };
|
|
2513
2489
|
const t = e.lastIndexOf(".");
|
|
2514
2490
|
if (t <= 0) return { base: e, extension: null };
|
|
@@ -2516,10 +2492,10 @@ const Dd = {
|
|
|
2516
2492
|
return { base: e.substring(0, t), extension: s };
|
|
2517
2493
|
}, Lt = (e) => {
|
|
2518
2494
|
if (!e) return e;
|
|
2519
|
-
const { base: t } =
|
|
2495
|
+
const { base: t } = Rd(e);
|
|
2520
2496
|
return t;
|
|
2521
2497
|
};
|
|
2522
|
-
function
|
|
2498
|
+
function Gd(e, t) {
|
|
2523
2499
|
const s = (e || "").split("/").filter(Boolean);
|
|
2524
2500
|
let a = "", r = !0;
|
|
2525
2501
|
if (t.slug === "/") {
|
|
@@ -2540,7 +2516,7 @@ function Ud(e, t) {
|
|
|
2540
2516
|
}
|
|
2541
2517
|
return { initSlug: a, prefix: r };
|
|
2542
2518
|
}
|
|
2543
|
-
const
|
|
2519
|
+
const Ud = (e) => e && Lt(e), Er = (e, t) => {
|
|
2544
2520
|
const s = Lt(e || "");
|
|
2545
2521
|
return !s || s === "/" ? `/${t}` : `${s}/${t}`;
|
|
2546
2522
|
};
|
|
@@ -2554,7 +2530,7 @@ function ir({
|
|
|
2554
2530
|
fullSlug: l
|
|
2555
2531
|
}) {
|
|
2556
2532
|
const [o, d] = S(e), [h, u] = S(null);
|
|
2557
|
-
|
|
2533
|
+
ne(() => {
|
|
2558
2534
|
d(e);
|
|
2559
2535
|
}, [e]);
|
|
2560
2536
|
const m = (v) => {
|
|
@@ -2564,7 +2540,7 @@ function ir({
|
|
|
2564
2540
|
return /* @__PURE__ */ c("div", { children: [
|
|
2565
2541
|
a && /* @__PURE__ */ n("div", { className: "mb-1 flex items-center", children: /* @__PURE__ */ c("span", { className: "text-xs text-gray-500", children: [
|
|
2566
2542
|
"Parent: ",
|
|
2567
|
-
/* @__PURE__ */ n("span", { className: "font-mono text-gray-900", children:
|
|
2543
|
+
/* @__PURE__ */ n("span", { className: "font-mono text-gray-900", children: Ud(a) })
|
|
2568
2544
|
] }) }),
|
|
2569
2545
|
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2570
2546
|
/* @__PURE__ */ n(
|
|
@@ -2585,7 +2561,31 @@ function ir({
|
|
|
2585
2561
|
] }) })
|
|
2586
2562
|
] });
|
|
2587
2563
|
}
|
|
2588
|
-
const
|
|
2564
|
+
const vs = () => {
|
|
2565
|
+
const e = X(), t = de();
|
|
2566
|
+
return Oe({
|
|
2567
|
+
queryKey: [G.GET_WEBSITE_PAGES],
|
|
2568
|
+
staleTime: 1e3 * 60 * 5,
|
|
2569
|
+
queryFn: async () => e(t, { action: G.GET_WEBSITE_PAGES }) || [],
|
|
2570
|
+
placeholderData: (s) => s || []
|
|
2571
|
+
});
|
|
2572
|
+
}, Bd = (e) => {
|
|
2573
|
+
const t = X(), s = de(), a = Gt();
|
|
2574
|
+
return Oe({
|
|
2575
|
+
queryKey: [G.GET_WEBSITE_PAGES, e, a],
|
|
2576
|
+
staleTime: 1e3 * 60 * 5,
|
|
2577
|
+
enabled: !!e,
|
|
2578
|
+
queryFn: async () => {
|
|
2579
|
+
if (a === e) return {};
|
|
2580
|
+
const r = await t(s, { action: G.GET_WEBSITE_PAGES, data: { lang: e } }) || [];
|
|
2581
|
+
return Qa(
|
|
2582
|
+
Be(r, (i) => ({ ...i, lang: e })),
|
|
2583
|
+
"primaryPage"
|
|
2584
|
+
);
|
|
2585
|
+
},
|
|
2586
|
+
placeholderData: (r) => r || {}
|
|
2587
|
+
});
|
|
2588
|
+
}, Zi = ({
|
|
2589
2589
|
edit: e,
|
|
2590
2590
|
lang: t,
|
|
2591
2591
|
languages: s,
|
|
@@ -2611,7 +2611,7 @@ const el = ({
|
|
|
2611
2611
|
]
|
|
2612
2612
|
}
|
|
2613
2613
|
)
|
|
2614
|
-
] }),
|
|
2614
|
+
] }), el = ({ lang: e, name: t, setName: s, parentHasSelectedLanguagePage: a }) => /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
2615
2615
|
/* @__PURE__ */ n(he, { htmlFor: "name", children: oe.PAGE_NAME }),
|
|
2616
2616
|
/* @__PURE__ */ n(
|
|
2617
2617
|
xe,
|
|
@@ -2672,7 +2672,7 @@ const el = ({
|
|
|
2672
2672
|
fullSlug: v()
|
|
2673
2673
|
}
|
|
2674
2674
|
)
|
|
2675
|
-
] }),
|
|
2675
|
+
] }), tl = ({
|
|
2676
2676
|
parentHasSelectedLanguagePage: e,
|
|
2677
2677
|
name: t,
|
|
2678
2678
|
lang: s,
|
|
@@ -2688,7 +2688,7 @@ const el = ({
|
|
|
2688
2688
|
isPending: v
|
|
2689
2689
|
}) => {
|
|
2690
2690
|
const p = v || !t || !s || o.some((y) => (r ? y.id !== i : !0) && y.parent === (l == null ? void 0 : l.id) && y.lang === s) || !d && !(h && u) && (!m || !a);
|
|
2691
|
-
return /* @__PURE__ */ n(
|
|
2691
|
+
return /* @__PURE__ */ n(mt, { children: e ? /* @__PURE__ */ c(ce, { children: [
|
|
2692
2692
|
/* @__PURE__ */ n(T, { type: "submit", disabled: p && !l.dynamic, children: v ? /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
2693
2693
|
/* @__PURE__ */ n("span", { className: "loader mr-2" }),
|
|
2694
2694
|
r ? oe.UPDATING : oe.ADDING
|
|
@@ -2722,7 +2722,7 @@ const el = ({
|
|
|
2722
2722
|
}) => /* @__PURE__ */ c("form", { onSubmit: e, children: [
|
|
2723
2723
|
/* @__PURE__ */ c("div", { className: "grid gap-4 py-4", children: [
|
|
2724
2724
|
/* @__PURE__ */ n(
|
|
2725
|
-
|
|
2725
|
+
Zi,
|
|
2726
2726
|
{
|
|
2727
2727
|
edit: t,
|
|
2728
2728
|
lang: s,
|
|
@@ -2734,7 +2734,7 @@ const el = ({
|
|
|
2734
2734
|
}
|
|
2735
2735
|
),
|
|
2736
2736
|
/* @__PURE__ */ n(
|
|
2737
|
-
|
|
2737
|
+
el,
|
|
2738
2738
|
{
|
|
2739
2739
|
lang: s,
|
|
2740
2740
|
name: r,
|
|
@@ -2744,7 +2744,7 @@ const el = ({
|
|
|
2744
2744
|
)
|
|
2745
2745
|
] }),
|
|
2746
2746
|
/* @__PURE__ */ n(
|
|
2747
|
-
|
|
2747
|
+
tl,
|
|
2748
2748
|
{
|
|
2749
2749
|
parentHasSelectedLanguagePage: d,
|
|
2750
2750
|
name: r,
|
|
@@ -2810,7 +2810,7 @@ const el = ({
|
|
|
2810
2810
|
) : /* @__PURE__ */ c("form", { onSubmit: t, children: [
|
|
2811
2811
|
/* @__PURE__ */ c("div", { className: "grid gap-4 py-4", children: [
|
|
2812
2812
|
/* @__PURE__ */ n(
|
|
2813
|
-
|
|
2813
|
+
Zi,
|
|
2814
2814
|
{
|
|
2815
2815
|
edit: s,
|
|
2816
2816
|
lang: a,
|
|
@@ -2822,7 +2822,7 @@ const el = ({
|
|
|
2822
2822
|
}
|
|
2823
2823
|
),
|
|
2824
2824
|
/* @__PURE__ */ n(
|
|
2825
|
-
|
|
2825
|
+
el,
|
|
2826
2826
|
{
|
|
2827
2827
|
lang: a,
|
|
2828
2828
|
name: i,
|
|
@@ -2851,7 +2851,7 @@ const el = ({
|
|
|
2851
2851
|
)
|
|
2852
2852
|
] }),
|
|
2853
2853
|
/* @__PURE__ */ n(
|
|
2854
|
-
|
|
2854
|
+
tl,
|
|
2855
2855
|
{
|
|
2856
2856
|
parentHasSelectedLanguagePage: h,
|
|
2857
2857
|
name: i,
|
|
@@ -2876,20 +2876,20 @@ const el = ({
|
|
|
2876
2876
|
edit: r = !1,
|
|
2877
2877
|
preselectedLang: i
|
|
2878
2878
|
}) => {
|
|
2879
|
-
const { data: l = [] } =
|
|
2879
|
+
const { data: l = [] } = vs(), o = K(() => l.find((j) => j.id === a), [l, a]), [d, h] = S(""), [u, m] = S(""), [v, p] = S(""), [y, g] = S(!0), [b, x] = S(!0), { mutate: N, isPending: I } = Xi(), { mutate: _, isPending: k } = sr(), E = I || k, { data: q, isFetching: Z } = Et(), re = Gt(), { data: L, isFetching: U } = ht(a), { data: $ = [], isFetching: R } = ht(
|
|
2880
2880
|
o == null ? void 0 : o.parent
|
|
2881
2881
|
), { data: H = [], isFetching: z } = Ge(), { setSelectedLang: ie } = Fe(), [, Ne] = He(), [, Ee] = Ws(), me = Z || U || R || z, w = K(() => ye(q == null ? void 0 : q.languages, (j) => !ve(L, { lang: j })), [q, L]), f = K(
|
|
2882
2882
|
() => H.find((j) => j.key === (o == null ? void 0 : o.pageType)),
|
|
2883
2883
|
[H, o == null ? void 0 : o.pageType]
|
|
2884
2884
|
), P = !(f != null && f.hasSlug), B = (o == null ? void 0 : o.slug) === "/";
|
|
2885
|
-
|
|
2885
|
+
ne(() => {
|
|
2886
2886
|
if (!r && o && i && (m(i), h(`${o.name} - ${De[i]}`)), !r || !o) return;
|
|
2887
2887
|
const j = L == null ? void 0 : L.find((D) => D.id === e);
|
|
2888
2888
|
if (!j) return;
|
|
2889
2889
|
h(j.name), m(j.lang);
|
|
2890
|
-
const le = j.slug || "", { initSlug: be, prefix: Se } =
|
|
2890
|
+
const le = j.slug || "", { initSlug: be, prefix: Se } = Gd(le, o);
|
|
2891
2891
|
p(be), x(Se);
|
|
2892
|
-
}, [r, e, L, o, i]),
|
|
2892
|
+
}, [r, e, L, o, i]), ne(() => {
|
|
2893
2893
|
if (i)
|
|
2894
2894
|
m(i);
|
|
2895
2895
|
else if ((w == null ? void 0 : w.length) === 1 && !r) {
|
|
@@ -2906,9 +2906,9 @@ const el = ({
|
|
|
2906
2906
|
parentSlug: b ? `/${u}` : void 0,
|
|
2907
2907
|
isRootPage: !0
|
|
2908
2908
|
};
|
|
2909
|
-
const j =
|
|
2909
|
+
const j = $ == null ? void 0 : $.find((le) => le.lang === u);
|
|
2910
2910
|
return { parentSlug: j == null ? void 0 : j.slug, isRootPage: !1 };
|
|
2911
|
-
}, [o == null ? void 0 : o.parent,
|
|
2911
|
+
}, [o == null ? void 0 : o.parent, $, b, u, B]), W = K(() => O ? !0 : !!($ != null && $.some((j) => (j == null ? void 0 : j.lang) === u)), [u, $, O]), F = () => {
|
|
2912
2912
|
let j = "";
|
|
2913
2913
|
return O ? j = `/${b ? [u, v].filter(Boolean).join("/") : v}` : j = `${Lt(A)}/${v}`, j.replace(/\/{2,}/g, "/").replace(/\/$/, "");
|
|
2914
2914
|
}, Q = (j) => {
|
|
@@ -2920,7 +2920,7 @@ const el = ({
|
|
|
2920
2920
|
name: d,
|
|
2921
2921
|
lang: u,
|
|
2922
2922
|
primaryPage: o == null ? void 0 : o.id,
|
|
2923
|
-
slug: P ? "" :
|
|
2923
|
+
slug: P ? "" : F(),
|
|
2924
2924
|
pageType: o == null ? void 0 : o.pageType,
|
|
2925
2925
|
...r && { id: e }
|
|
2926
2926
|
}, be = () => {
|
|
@@ -2958,7 +2958,7 @@ const el = ({
|
|
|
2958
2958
|
setSlug: p,
|
|
2959
2959
|
isSlugValid: y,
|
|
2960
2960
|
setIsSlugValid: g,
|
|
2961
|
-
getSlug:
|
|
2961
|
+
getSlug: F,
|
|
2962
2962
|
isPending: E
|
|
2963
2963
|
}
|
|
2964
2964
|
)
|
|
@@ -2972,7 +2972,7 @@ function jd({
|
|
|
2972
2972
|
onValidationChange: r
|
|
2973
2973
|
}) {
|
|
2974
2974
|
const [i, l] = S(null), o = tt(null), [d, h] = S(a + e);
|
|
2975
|
-
|
|
2975
|
+
ne(() => {
|
|
2976
2976
|
h(a + e);
|
|
2977
2977
|
}, [e, a]);
|
|
2978
2978
|
const u = (p) => {
|
|
@@ -3077,7 +3077,7 @@ function zd({
|
|
|
3077
3077
|
]
|
|
3078
3078
|
}
|
|
3079
3079
|
) }),
|
|
3080
|
-
/* @__PURE__ */ n(En, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ c(
|
|
3080
|
+
/* @__PURE__ */ n(En, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ c(Vn, { shouldFilter: !1, children: [
|
|
3081
3081
|
/* @__PURE__ */ n("div", { className: "relative border-none py-2", children: /* @__PURE__ */ n("div", { className: "sticky top-0 z-10 bg-white px-3 py-2", children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
3082
3082
|
/* @__PURE__ */ n(Nt, { strokeWidth: 2, className: "absolute left-2 top-2 h-4 w-4 text-gray-400" }),
|
|
3083
3083
|
/* @__PURE__ */ n(
|
|
@@ -3091,10 +3091,10 @@ function zd({
|
|
|
3091
3091
|
)
|
|
3092
3092
|
] }) }) }),
|
|
3093
3093
|
/* @__PURE__ */ c(Ms, { className: "max-h-[300px] overflow-y-auto", children: [
|
|
3094
|
-
/* @__PURE__ */ n(
|
|
3094
|
+
/* @__PURE__ */ n(Kn, { children: "No pages found." }),
|
|
3095
3095
|
/* @__PURE__ */ c(It, { children: [
|
|
3096
3096
|
/* @__PURE__ */ c(
|
|
3097
|
-
|
|
3097
|
+
gt,
|
|
3098
3098
|
{
|
|
3099
3099
|
value: "none",
|
|
3100
3100
|
onSelect: () => {
|
|
@@ -3118,7 +3118,7 @@ function zd({
|
|
|
3118
3118
|
] })
|
|
3119
3119
|
] });
|
|
3120
3120
|
return /* @__PURE__ */ c(
|
|
3121
|
-
|
|
3121
|
+
gt,
|
|
3122
3122
|
{
|
|
3123
3123
|
value: x.id,
|
|
3124
3124
|
onSelect: () => {
|
|
@@ -3176,7 +3176,7 @@ const Vd = (...e) => e.filter(Boolean).join(" "), Kd = ({
|
|
|
3176
3176
|
isLoading: a = !1
|
|
3177
3177
|
}) => {
|
|
3178
3178
|
const [r, i] = S(""), [l, o] = S(!1), [d, h] = S(""), u = Ot("enable-add-page-dropdown");
|
|
3179
|
-
if (
|
|
3179
|
+
if (ne(() => {
|
|
3180
3180
|
if (t) {
|
|
3181
3181
|
const g = e.find((b) => b.id === t);
|
|
3182
3182
|
i((g == null ? void 0 : g.preview) || "");
|
|
@@ -3206,7 +3206,7 @@ const Vd = (...e) => e.filter(Boolean).join(" "), Kd = ({
|
|
|
3206
3206
|
y,
|
|
3207
3207
|
/* @__PURE__ */ n(_t, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
3208
3208
|
] }) }),
|
|
3209
|
-
/* @__PURE__ */ n(En, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ c(
|
|
3209
|
+
/* @__PURE__ */ n(En, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ c(Vn, { shouldFilter: !1, children: [
|
|
3210
3210
|
/* @__PURE__ */ n("div", { className: "sticky top-0 z-10 bg-white px-3 py-2", children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
3211
3211
|
/* @__PURE__ */ n(Nt, { strokeWidth: 2, className: "absolute left-2 top-2 h-4 w-4 text-gray-400" }),
|
|
3212
3212
|
/* @__PURE__ */ n(
|
|
@@ -3220,9 +3220,9 @@ const Vd = (...e) => e.filter(Boolean).join(" "), Kd = ({
|
|
|
3220
3220
|
)
|
|
3221
3221
|
] }) }),
|
|
3222
3222
|
/* @__PURE__ */ c(Ms, { className: "max-h-[300px] overflow-y-auto", children: [
|
|
3223
|
-
/* @__PURE__ */ n(
|
|
3223
|
+
/* @__PURE__ */ n(Kn, { children: "No templates found." }),
|
|
3224
3224
|
Object.entries(v).map(([g, b]) => /* @__PURE__ */ n(It, { heading: g, children: b.map((x) => /* @__PURE__ */ c(
|
|
3225
|
-
|
|
3225
|
+
gt,
|
|
3226
3226
|
{
|
|
3227
3227
|
value: x.id,
|
|
3228
3228
|
onSelect: () => {
|
|
@@ -3298,7 +3298,7 @@ const Vd = (...e) => e.filter(Boolean).join(" "), Kd = ({
|
|
|
3298
3298
|
};
|
|
3299
3299
|
}, oa = () => {
|
|
3300
3300
|
const [, e] = He();
|
|
3301
|
-
return
|
|
3301
|
+
return ae(
|
|
3302
3302
|
(t, s) => {
|
|
3303
3303
|
const r = new URLSearchParams(window.location.search).get("lang"), i = new URLSearchParams({ page: t });
|
|
3304
3304
|
r && i.set("lang", r), window.history.pushState({}, "", `?${i.toString()}`), e(i), window.dispatchEvent(new PopStateEvent("popstate")), s == null || s();
|
|
@@ -3324,9 +3324,9 @@ const Vd = (...e) => e.filter(Boolean).join(" "), Kd = ({
|
|
|
3324
3324
|
};
|
|
3325
3325
|
e != null && e.defaultSeo && (_e(e.defaultSeo, t) && ba(e.defaultSeo[t]) ? s.seo = { ...s.seo, ...e.defaultSeo[t] } : s.seo = { ...s.seo, ...e.defaultSeo });
|
|
3326
3326
|
let a = {};
|
|
3327
|
-
e != null && e.defaultJSONLD && (_e(e.defaultJSONLD, t) && ba(e.defaultJSONLD[t]) ? (a = e.defaultJSONLD[t],
|
|
3327
|
+
e != null && e.defaultJSONLD && (_e(e.defaultJSONLD, t) && ba(e.defaultJSONLD[t]) ? (a = e.defaultJSONLD[t], pt(s, "seo.jsonLD", JSON.stringify(a))) : (a = e.defaultJSONLD, pt(s, "seo.jsonLD", JSON.stringify(a))));
|
|
3328
3328
|
let r = {};
|
|
3329
|
-
return e != null && e.defaultMetaTags && (_e(e.defaultMetaTags, t) && ba(e.defaultMetaTags[t]) ? (r = e.defaultMetaTags[t],
|
|
3329
|
+
return e != null && e.defaultMetaTags && (_e(e.defaultMetaTags, t) && ba(e.defaultMetaTags[t]) ? (r = e.defaultMetaTags[t], pt(s, "seo.metaOther", JSON.stringify(r))) : (r = e.defaultMetaTags, pt(s, "seo.metaOther", JSON.stringify(r)))), { seo: s.seo, jsonLD: s.jsonLD, metaOther: r };
|
|
3330
3330
|
};
|
|
3331
3331
|
if (import.meta.vitest) {
|
|
3332
3332
|
const { it: e, expect: t } = import.meta.vitest;
|
|
@@ -3369,10 +3369,10 @@ if (import.meta.vitest) {
|
|
|
3369
3369
|
const Ut = (...e) => e.filter(Boolean).join(" ");
|
|
3370
3370
|
function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel: a }) {
|
|
3371
3371
|
var Ns, Es;
|
|
3372
|
-
const r = oa(), i = !!(e != null && e.id), { data: l } =
|
|
3372
|
+
const r = oa(), i = !!(e != null && e.id), { data: l } = vs(), { mutate: o, isPending: d } = Xi(), { mutate: h, isPending: u } = sr(), [m, v] = S(null), [p, y] = S(!0), [g, b] = S((e == null ? void 0 : e.pageType) ?? "page"), { hasPermission: x } = kn(), N = x(Ce.CHANGE_PAGE_TYPE), [I, _] = S(!1), [k, E] = S(""), { selectedLang: q, fallbackLang: Z } = Fe(), re = q || Z, [L, U] = S(""), [$, R] = S(!1), H = K(() => {
|
|
3373
3373
|
const C = t.find((fe) => fe.key === g);
|
|
3374
3374
|
return (C == null ? void 0 : C.hasSlug) === !1;
|
|
3375
|
-
}, [g, t]), [z, ie] = S((e == null ? void 0 : e.parent) ?? ""), [Ne, Ee] = S((e == null ? void 0 : e.name) ?? ""), [me, w] = S((e == null ? void 0 : e.dynamic) ?? !1), [f, P] = S(me ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""), [B, A] = S((e == null ? void 0 : e.dynamicSlugCustom) ?? ""), [O, W] = S(!0), [
|
|
3375
|
+
}, [g, t]), [z, ie] = S((e == null ? void 0 : e.parent) ?? ""), [Ne, Ee] = S((e == null ? void 0 : e.name) ?? ""), [me, w] = S((e == null ? void 0 : e.dynamic) ?? !1), [f, P] = S(me ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""), [B, A] = S((e == null ? void 0 : e.dynamicSlugCustom) ?? ""), [O, W] = S(!0), [F, Q] = S(!1), [ue, j] = S(""), { data: le, isLoading: be } = Qd(g), Se = d || u, D = Ot("enable-add-page-dropdown"), te = K(() => !i || !(e != null && e.id) || !l ? null : l.find((C) => C.id === e.id), [i, e == null ? void 0 : e.id, l]), Re = (te == null ? void 0 : te.online) || !1, st = K(() => !i || !(e != null && e.id) || !l ? !1 : l.some((C) => C.parent === e.id), [i, e == null ? void 0 : e.id, l]), Y = t.find((C) => C.key === g), Je = (C) => {
|
|
3376
3376
|
if (i && g !== C) {
|
|
3377
3377
|
E(C), _(!0), U(""), R(!1);
|
|
3378
3378
|
return;
|
|
@@ -3433,7 +3433,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3433
3433
|
jsonLD: {}
|
|
3434
3434
|
};
|
|
3435
3435
|
if (me && (rt.dynamicSlugCustom = B), i) {
|
|
3436
|
-
const ut =
|
|
3436
|
+
const ut = ms(rt, ["pageType", "parent", "name", "slug", "dynamic", "dynamicSlugCustom"]);
|
|
3437
3437
|
h(
|
|
3438
3438
|
{ id: e == null ? void 0 : e.id, ...ut },
|
|
3439
3439
|
{
|
|
@@ -3445,10 +3445,10 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3445
3445
|
} else {
|
|
3446
3446
|
const ut = ve(t, { key: g });
|
|
3447
3447
|
ut != null && ut.trackingDefault && (rt.tracking = ut.trackingDefault);
|
|
3448
|
-
const { seo: Ss, jsonLD:
|
|
3449
|
-
|
|
3450
|
-
onSuccess: (
|
|
3451
|
-
s(), r(
|
|
3448
|
+
const { seo: Ss, jsonLD: Jl } = an(ut, re);
|
|
3449
|
+
pt(rt, "seo", Ss), pt(rt, "jsonLD", Jl), o(rt, {
|
|
3450
|
+
onSuccess: (Yl) => {
|
|
3451
|
+
s(), r(Yl.page.id, a);
|
|
3452
3452
|
}
|
|
3453
3453
|
});
|
|
3454
3454
|
}
|
|
@@ -3474,14 +3474,14 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3474
3474
|
const fe = ve(t, { key: g });
|
|
3475
3475
|
fe != null && fe.trackingDefault && (C.tracking = fe.trackingDefault);
|
|
3476
3476
|
const { seo: dt, jsonLD: Ye } = an(fe, re);
|
|
3477
|
-
|
|
3477
|
+
pt(C, "seo", dt), pt(C, "jsonLD", Ye), o(C, {
|
|
3478
3478
|
onSuccess: (rt) => {
|
|
3479
3479
|
var ut;
|
|
3480
3480
|
(ut = rt == null ? void 0 : rt.page) != null && ut.id && r(rt.page.id, a), s();
|
|
3481
3481
|
}
|
|
3482
3482
|
});
|
|
3483
3483
|
}
|
|
3484
|
-
},
|
|
3484
|
+
}, Rn = (C) => {
|
|
3485
3485
|
if (C.preventDefault(), v(null), !!xs()) {
|
|
3486
3486
|
if (!(Y != null && Y.hasSlug)) {
|
|
3487
3487
|
pa();
|
|
@@ -3502,10 +3502,10 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3502
3502
|
partialsType: t.filter((fe) => fe.hasSlug === !1 && C(fe))
|
|
3503
3503
|
};
|
|
3504
3504
|
}, [t, L]);
|
|
3505
|
-
return Y != null && Y.hasSlug ? /* @__PURE__ */ c("form", { onSubmit:
|
|
3505
|
+
return Y != null && Y.hasSlug ? /* @__PURE__ */ c("form", { onSubmit: Rn, className: "mx-auto w-full max-w-md space-y-4", children: [
|
|
3506
3506
|
/* @__PURE__ */ c("div", { className: "space-y-0.5", children: [
|
|
3507
3507
|
/* @__PURE__ */ n(he, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
|
|
3508
|
-
D ? /* @__PURE__ */ c(wn, { open:
|
|
3508
|
+
D ? /* @__PURE__ */ c(wn, { open: $, onOpenChange: R, children: [
|
|
3509
3509
|
/* @__PURE__ */ n(Nn, { asChild: !0, children: /* @__PURE__ */ c(
|
|
3510
3510
|
T,
|
|
3511
3511
|
{
|
|
@@ -3522,7 +3522,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3522
3522
|
]
|
|
3523
3523
|
}
|
|
3524
3524
|
) }),
|
|
3525
|
-
/* @__PURE__ */ n(En, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ c(
|
|
3525
|
+
/* @__PURE__ */ n(En, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ c(Vn, { shouldFilter: !1, children: [
|
|
3526
3526
|
/* @__PURE__ */ n("div", { className: "sticky top-0 z-10 bg-white px-3 py-2", children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
3527
3527
|
/* @__PURE__ */ n(Nt, { strokeWidth: 2, className: "absolute left-2 top-2 h-4 w-4 text-gray-400" }),
|
|
3528
3528
|
/* @__PURE__ */ n(
|
|
@@ -3536,9 +3536,9 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3536
3536
|
)
|
|
3537
3537
|
] }) }),
|
|
3538
3538
|
/* @__PURE__ */ c(Ms, { className: "overflow-y-auto", children: [
|
|
3539
|
-
/* @__PURE__ */ n(
|
|
3539
|
+
/* @__PURE__ */ n(Kn, { children: "No page type found." }),
|
|
3540
3540
|
i ? H ? /* @__PURE__ */ n(It, { heading: "Partials", children: Ct.map((C) => /* @__PURE__ */ c(
|
|
3541
|
-
|
|
3541
|
+
gt,
|
|
3542
3542
|
{
|
|
3543
3543
|
value: C.key,
|
|
3544
3544
|
onSelect: () => Je(C.key),
|
|
@@ -3555,7 +3555,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3555
3555
|
},
|
|
3556
3556
|
C.key
|
|
3557
3557
|
)) }) : /* @__PURE__ */ n(It, { heading: "Pages", children: Yt.map((C) => /* @__PURE__ */ c(
|
|
3558
|
-
|
|
3558
|
+
gt,
|
|
3559
3559
|
{
|
|
3560
3560
|
value: C.key,
|
|
3561
3561
|
onSelect: () => Je(C.key),
|
|
@@ -3573,7 +3573,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3573
3573
|
C.key
|
|
3574
3574
|
)) }) : /* @__PURE__ */ c(ce, { children: [
|
|
3575
3575
|
Yt.length > 0 && /* @__PURE__ */ n(It, { heading: "Pages", children: Yt.map((C) => /* @__PURE__ */ c(
|
|
3576
|
-
|
|
3576
|
+
gt,
|
|
3577
3577
|
{
|
|
3578
3578
|
value: C.key,
|
|
3579
3579
|
onSelect: () => Je(C.key),
|
|
@@ -3591,7 +3591,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3591
3591
|
C.key
|
|
3592
3592
|
)) }),
|
|
3593
3593
|
Ct.length > 0 && /* @__PURE__ */ n(It, { heading: "Partials", children: Ct.map((C) => /* @__PURE__ */ c(
|
|
3594
|
-
|
|
3594
|
+
gt,
|
|
3595
3595
|
{
|
|
3596
3596
|
value: C.key,
|
|
3597
3597
|
onSelect: () => Je(C.key),
|
|
@@ -3709,7 +3709,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3709
3709
|
}
|
|
3710
3710
|
),
|
|
3711
3711
|
m && /* @__PURE__ */ n("p", { className: "text-xs text-red-500", children: m }),
|
|
3712
|
-
|
|
3712
|
+
F && /* @__PURE__ */ n("div", { className: "mt-4 rounded-md border border-amber-200 bg-amber-50 p-3", children: /* @__PURE__ */ c("div", { className: "flex items-start space-x-2", children: [
|
|
3713
3713
|
/* @__PURE__ */ n("div", { className: "flex-shrink-0", children: /* @__PURE__ */ n("svg", { className: "h-5 w-5 text-amber-400", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ n(
|
|
3714
3714
|
"path",
|
|
3715
3715
|
{
|
|
@@ -3735,10 +3735,10 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3735
3735
|
children: i ? Se ? "Updating..." : "Update page" : Se ? "Creating..." : "Create Page"
|
|
3736
3736
|
}
|
|
3737
3737
|
)
|
|
3738
|
-
] }) : /* @__PURE__ */ c("form", { onSubmit:
|
|
3738
|
+
] }) : /* @__PURE__ */ c("form", { onSubmit: Rn, className: "mx-auto w-full max-w-md space-y-4", children: [
|
|
3739
3739
|
/* @__PURE__ */ c("div", { className: "space-y-0.5", children: [
|
|
3740
3740
|
/* @__PURE__ */ n(he, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
|
|
3741
|
-
D ? /* @__PURE__ */ c(wn, { open:
|
|
3741
|
+
D ? /* @__PURE__ */ c(wn, { open: $, onOpenChange: R, children: [
|
|
3742
3742
|
/* @__PURE__ */ n(Nn, { asChild: !0, children: /* @__PURE__ */ c(
|
|
3743
3743
|
T,
|
|
3744
3744
|
{
|
|
@@ -3755,7 +3755,7 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3755
3755
|
]
|
|
3756
3756
|
}
|
|
3757
3757
|
) }),
|
|
3758
|
-
/* @__PURE__ */ n(En, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ c(
|
|
3758
|
+
/* @__PURE__ */ n(En, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ c(Vn, { shouldFilter: !1, children: [
|
|
3759
3759
|
/* @__PURE__ */ n("div", { className: "sticky top-0 z-10 bg-white px-3 py-2", children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
3760
3760
|
/* @__PURE__ */ n(Nt, { strokeWidth: 2, className: "absolute left-2 top-2 h-4 w-4 text-gray-400" }),
|
|
3761
3761
|
/* @__PURE__ */ n(
|
|
@@ -3769,9 +3769,9 @@ function Jd({ addEditPage: e, additionalPageTypes: t = [], close: s, closePanel:
|
|
|
3769
3769
|
)
|
|
3770
3770
|
] }) }),
|
|
3771
3771
|
/* @__PURE__ */ c(Ms, { className: "max-h-[200px] overflow-y-auto", children: [
|
|
3772
|
-
/* @__PURE__ */ n(
|
|
3772
|
+
/* @__PURE__ */ n(Kn, { children: "No page type found." }),
|
|
3773
3773
|
/* @__PURE__ */ n(It, { heading: "Partials", children: Ct.map((C) => /* @__PURE__ */ c(
|
|
3774
|
-
|
|
3774
|
+
gt,
|
|
3775
3775
|
{
|
|
3776
3776
|
value: C.key,
|
|
3777
3777
|
onSelect: () => {
|
|
@@ -3843,7 +3843,7 @@ function ca({
|
|
|
3843
3843
|
page: e,
|
|
3844
3844
|
onClose: t
|
|
3845
3845
|
}) {
|
|
3846
|
-
const [, s] = He(), { mutate: a, isPending: r } =
|
|
3846
|
+
const [, s] = He(), { mutate: a, isPending: r } = Td(), { data: i } = Ge(), { setSelectedLang: l, fallbackLang: o } = Fe(), [, d] = Ws(), h = () => {
|
|
3847
3847
|
r || a(e, {
|
|
3848
3848
|
onSuccess: () => {
|
|
3849
3849
|
e != null && e.primaryPage ? (window.history.replaceState({}, "", `/?page=${e.primaryPage}`), s(new URLSearchParams({ page: e.primaryPage }))) : (window.history.replaceState({}, "", "/"), s(new URLSearchParams())), window.dispatchEvent(new PopStateEvent("popstate")), l(o), d("outline"), t();
|
|
@@ -3869,7 +3869,7 @@ function ca({
|
|
|
3869
3869
|
] })
|
|
3870
3870
|
] })
|
|
3871
3871
|
] }),
|
|
3872
|
-
/* @__PURE__ */ c(
|
|
3872
|
+
/* @__PURE__ */ c(mt, { children: [
|
|
3873
3873
|
/* @__PURE__ */ n(T, { variant: "outline", onClick: t, children: "Cancel" }),
|
|
3874
3874
|
/* @__PURE__ */ n(
|
|
3875
3875
|
T,
|
|
@@ -3915,7 +3915,7 @@ const Yd = () => {
|
|
|
3915
3915
|
}) => {
|
|
3916
3916
|
const { mutate: a, isPending: r } = Yd(), [i, l] = S(null), [o, d] = S(`${e.name} (Copy)`), h = oa(), u = J(e.slug), [m, v] = S(
|
|
3917
3917
|
u ? "" : `${e.slug.split("/").pop()}-copy`
|
|
3918
|
-
), p = u ? "" :
|
|
3918
|
+
), p = u ? "" : ao(e.slug.split("/")).join("/"), [y, g] = S(!1), b = (x) => {
|
|
3919
3919
|
if (x.preventDefault(), !o.trim()) {
|
|
3920
3920
|
l("Name is required");
|
|
3921
3921
|
return;
|
|
@@ -4029,9 +4029,9 @@ const Yd = () => {
|
|
|
4029
4029
|
page: e,
|
|
4030
4030
|
onClose: t
|
|
4031
4031
|
}) => {
|
|
4032
|
-
const [s, a] = S(!1), [r, i] = S(""), [l, o] = S(""), [d, h] = S(!1), u = tt(null), m =
|
|
4032
|
+
const [s, a] = S(!1), [r, i] = S(""), [l, o] = S(""), [d, h] = S(!1), u = tt(null), m = kd(), { data: v } = Ge(), p = v == null ? void 0 : v.find(
|
|
4033
4033
|
(I) => I.key === e.pageType
|
|
4034
|
-
), y = (p == null ? void 0 : p.name) || zt(e.pageType), g =
|
|
4034
|
+
), y = (p == null ? void 0 : p.name) || zt(e.pageType), g = ae(
|
|
4035
4035
|
(I) => {
|
|
4036
4036
|
var k;
|
|
4037
4037
|
const _ = (k = I.target.files) == null ? void 0 : k[0];
|
|
@@ -4092,7 +4092,7 @@ const Yd = () => {
|
|
|
4092
4092
|
/* @__PURE__ */ c("div", { className: "space-y-4 mb-4 text-xs", children: [
|
|
4093
4093
|
/* @__PURE__ */ c("div", { className: "p-4 border rounded bg-slate-50 space-y-3", children: [
|
|
4094
4094
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
4095
|
-
/* @__PURE__ */ n(
|
|
4095
|
+
/* @__PURE__ */ n(nc, { className: "w-4 h-4 text-slate-500" }),
|
|
4096
4096
|
/* @__PURE__ */ n("span", { className: "font-medium text-slate-500", children: "Page Name:" }),
|
|
4097
4097
|
/* @__PURE__ */ n("span", { className: "font-semibold", children: zt(e.name) })
|
|
4098
4098
|
] }),
|
|
@@ -4142,7 +4142,7 @@ const Yd = () => {
|
|
|
4142
4142
|
/* @__PURE__ */ n("div", { className: "animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full" }),
|
|
4143
4143
|
"Uploading..."
|
|
4144
4144
|
] }) : /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
4145
|
-
/* @__PURE__ */ n(
|
|
4145
|
+
/* @__PURE__ */ n(Wn, { className: "h-4 w-4" }),
|
|
4146
4146
|
"Select image"
|
|
4147
4147
|
] })
|
|
4148
4148
|
}
|
|
@@ -4171,7 +4171,7 @@ const Yd = () => {
|
|
|
4171
4171
|
] })
|
|
4172
4172
|
] }),
|
|
4173
4173
|
/* @__PURE__ */ c(
|
|
4174
|
-
|
|
4174
|
+
mt,
|
|
4175
4175
|
{
|
|
4176
4176
|
className: s ? "opacity-75 pointer-events-none" : "",
|
|
4177
4177
|
children: [
|
|
@@ -4213,7 +4213,7 @@ const Yd = () => {
|
|
|
4213
4213
|
g.stopPropagation(), t(e);
|
|
4214
4214
|
},
|
|
4215
4215
|
children: [
|
|
4216
|
-
/* @__PURE__ */ n(
|
|
4216
|
+
/* @__PURE__ */ n(sc, { className: "size-3" }),
|
|
4217
4217
|
"Duplicate page"
|
|
4218
4218
|
]
|
|
4219
4219
|
}
|
|
@@ -4291,14 +4291,14 @@ const Yd = () => {
|
|
|
4291
4291
|
page: e,
|
|
4292
4292
|
onClose: t
|
|
4293
4293
|
}) => {
|
|
4294
|
-
const [s, a] = S(!1), r =
|
|
4294
|
+
const [s, a] = S(!1), r = Pd();
|
|
4295
4295
|
return /* @__PURE__ */ n(je, { open: !0, onOpenChange: t, children: /* @__PURE__ */ c(ze, { children: [
|
|
4296
4296
|
/* @__PURE__ */ c(Ve, { children: [
|
|
4297
4297
|
/* @__PURE__ */ n(Ke, { children: "Unmark as template" }),
|
|
4298
4298
|
/* @__PURE__ */ n(nt, { className: "py-4 text-slate-500 space-y-1 text-xs", children: "Are you sure you want to unmark this page as a template?" })
|
|
4299
4299
|
] }),
|
|
4300
4300
|
/* @__PURE__ */ c(
|
|
4301
|
-
|
|
4301
|
+
mt,
|
|
4302
4302
|
{
|
|
4303
4303
|
className: s ? "opacity-75 pointer-events-none" : "",
|
|
4304
4304
|
children: [
|
|
@@ -4330,7 +4330,7 @@ const Yd = () => {
|
|
|
4330
4330
|
page: e,
|
|
4331
4331
|
onClose: t
|
|
4332
4332
|
}) => {
|
|
4333
|
-
const { mutate: s, isPending: a } =
|
|
4333
|
+
const { mutate: s, isPending: a } = Cd(), r = async () => {
|
|
4334
4334
|
s(e, { onSuccess: t });
|
|
4335
4335
|
};
|
|
4336
4336
|
return /* @__PURE__ */ n(je, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ c(ze, { children: [
|
|
@@ -4343,7 +4343,7 @@ const Yd = () => {
|
|
|
4343
4343
|
"?"
|
|
4344
4344
|
] })
|
|
4345
4345
|
] }),
|
|
4346
|
-
/* @__PURE__ */ c(
|
|
4346
|
+
/* @__PURE__ */ c(mt, { children: [
|
|
4347
4347
|
/* @__PURE__ */ n(T, { variant: "outline", onClick: t, children: "Cancel" }),
|
|
4348
4348
|
/* @__PURE__ */ n(
|
|
4349
4349
|
T,
|
|
@@ -4373,12 +4373,12 @@ const Yd = () => {
|
|
|
4373
4373
|
return null;
|
|
4374
4374
|
};
|
|
4375
4375
|
return s(e) || [];
|
|
4376
|
-
},
|
|
4376
|
+
}, nl = (e, t) => {
|
|
4377
4377
|
if (!t) return [];
|
|
4378
4378
|
const s = hr(e), a = ve(s, (r) => r.id === t);
|
|
4379
4379
|
if (a) {
|
|
4380
4380
|
if (a.parent)
|
|
4381
|
-
return [...
|
|
4381
|
+
return [...nl(e, a.parent), t];
|
|
4382
4382
|
const r = eu(e, t);
|
|
4383
4383
|
if (!J(r))
|
|
4384
4384
|
return r;
|
|
@@ -4392,35 +4392,35 @@ const Yd = () => {
|
|
|
4392
4392
|
});
|
|
4393
4393
|
};
|
|
4394
4394
|
return s(e), Array.from(t);
|
|
4395
|
-
},
|
|
4396
|
-
const [t, s] = Ue(Zd), a = e ? xt(t, e) : !1, r =
|
|
4395
|
+
}, Dn = (e) => {
|
|
4396
|
+
const [t, s] = Ue(Zd), a = e ? xt(t, e) : !1, r = ae(() => {
|
|
4397
4397
|
s(
|
|
4398
4398
|
(h) => a ? ye(h, (u) => u !== e) : [...h, e]
|
|
4399
4399
|
);
|
|
4400
|
-
}, [s, a, e]), i =
|
|
4400
|
+
}, [s, a, e]), i = ae(
|
|
4401
4401
|
(h, u) => {
|
|
4402
4402
|
if (!u || J(h)) return;
|
|
4403
|
-
const m = hr(h), v =
|
|
4403
|
+
const m = hr(h), v = nl(m, u);
|
|
4404
4404
|
if (!Array.isArray(v) || J(v)) return;
|
|
4405
4405
|
const p = v.slice(0, -1);
|
|
4406
4406
|
J(p) || s((y) => ka([...y, ...p]));
|
|
4407
4407
|
},
|
|
4408
4408
|
[s]
|
|
4409
|
-
), l =
|
|
4409
|
+
), l = ae(
|
|
4410
4410
|
(h) => {
|
|
4411
4411
|
if (J(h)) return;
|
|
4412
4412
|
const u = tu(h);
|
|
4413
|
-
J(u) || s((m) =>
|
|
4413
|
+
J(u) || s((m) => ro(m, u));
|
|
4414
4414
|
},
|
|
4415
4415
|
[s]
|
|
4416
|
-
), o =
|
|
4416
|
+
), o = ae((h) => {
|
|
4417
4417
|
if (J(h)) return;
|
|
4418
4418
|
const u = Pa(h, (m) => {
|
|
4419
4419
|
const v = (p) => [p.id, ...p.children ? Pa(p.children, v) : []];
|
|
4420
4420
|
return v(m);
|
|
4421
4421
|
});
|
|
4422
4422
|
s(u);
|
|
4423
|
-
}, [s]), d =
|
|
4423
|
+
}, [s]), d = ae(() => {
|
|
4424
4424
|
s([]);
|
|
4425
4425
|
}, [s]);
|
|
4426
4426
|
return {
|
|
@@ -4470,21 +4470,21 @@ const Yd = () => {
|
|
|
4470
4470
|
return Object.values(t).forEach((a) => {
|
|
4471
4471
|
a.parent && t[a.parent] ? t[a.parent].children.push(a) : s.push(a);
|
|
4472
4472
|
}), s;
|
|
4473
|
-
},
|
|
4473
|
+
}, sl = (e) => !e || !e.length ? [] : [...e].sort(
|
|
4474
4474
|
(s, a) => (s.name || "").localeCompare(a.name || "")
|
|
4475
4475
|
).map((s) => ({
|
|
4476
4476
|
...s,
|
|
4477
|
-
children: s.children ?
|
|
4478
|
-
})),
|
|
4477
|
+
children: s.children ? sl(s.children) : []
|
|
4478
|
+
})), al = (e, t, s, a) => {
|
|
4479
4479
|
if (!e || !e.length) return [];
|
|
4480
4480
|
let r = e;
|
|
4481
4481
|
if (s !== "all" && (r = Ks(ye(e, { pageType: s }))), J(t))
|
|
4482
4482
|
r = Sr(r, t);
|
|
4483
4483
|
else {
|
|
4484
4484
|
const u = Sr(r, t), m = nu(e, u);
|
|
4485
|
-
r =
|
|
4485
|
+
r = io([...u, ...m], "id");
|
|
4486
4486
|
}
|
|
4487
|
-
const i =
|
|
4487
|
+
const i = sl(su(r)), l = Ra(i, t, a), o = ye(l, (u) => a(u.pageType)).sort((u, m) => (u.name || "").localeCompare(m.name || "")), d = ye(l, (u) => !a(u.pageType));
|
|
4488
4488
|
let h = [];
|
|
4489
4489
|
if (s === "all") {
|
|
4490
4490
|
const u = Qa(d, "pageType");
|
|
@@ -4518,9 +4518,9 @@ const Yd = () => {
|
|
|
4518
4518
|
const p = oa(), { data: y } = Ge(), [, g] = Ws(), b = K(() => ve(y, { key: t.pageType }), [y, t.pageType]), x = K(() => {
|
|
4519
4519
|
const k = M(t, "slug", ""), E = e ? Lt(e) : "", q = E ? k.replace(E, "") : k;
|
|
4520
4520
|
return q || "/";
|
|
4521
|
-
}, [t, e]), N = K(() => !!t.isTemplate, [t.isTemplate]), I =
|
|
4521
|
+
}, [t, e]), N = K(() => !!t.isTemplate, [t.isTemplate]), I = ae(() => {
|
|
4522
4522
|
g("outline"), p(M(t, "id"), a);
|
|
4523
|
-
}, [p, a, t, g]), _ =
|
|
4523
|
+
}, [p, a, t, g]), _ = ae(
|
|
4524
4524
|
(k) => {
|
|
4525
4525
|
k.stopPropagation(), v();
|
|
4526
4526
|
},
|
|
@@ -4582,7 +4582,7 @@ const Yd = () => {
|
|
|
4582
4582
|
)
|
|
4583
4583
|
] }),
|
|
4584
4584
|
!t.isPartialGroup && /* @__PURE__ */ c("div", { className: "flex items-center space-x-4", children: [
|
|
4585
|
-
/* @__PURE__ */ n(
|
|
4585
|
+
/* @__PURE__ */ n(cd, { currentEditor: t.currentEditor }),
|
|
4586
4586
|
/* @__PURE__ */ n(
|
|
4587
4587
|
dr,
|
|
4588
4588
|
{
|
|
@@ -4601,42 +4601,42 @@ const Yd = () => {
|
|
|
4601
4601
|
}
|
|
4602
4602
|
);
|
|
4603
4603
|
}, ru = ({ close: e }) => {
|
|
4604
|
-
const [, t] = S([]), [s, a] = S(null), [r, i] = S(""), [l, o] = S(""), [d, h] = S(null), u = (A) => l ? String(M(A, "name", "")).toLowerCase().includes(l.toLowerCase()) || String(M(A, "key", "")).toLowerCase().includes(l.toLowerCase()) : !0, [m, v] = S(null), [p, y] = S(null), [g, b] = S(null), [x, N] = S(null), { data: I, isFetching: _ } =
|
|
4604
|
+
const [, t] = S([]), [s, a] = S(null), [r, i] = S(""), [l, o] = S(""), [d, h] = S(null), u = (A) => l ? String(M(A, "name", "")).toLowerCase().includes(l.toLowerCase()) || String(M(A, "key", "")).toLowerCase().includes(l.toLowerCase()) : !0, [m, v] = S(null), [p, y] = S(null), [g, b] = S(null), [x, N] = S(null), { data: I, isFetching: _ } = vs(), [k, E] = S(""), { hasPermission: q } = kn(), { updateForSelectedPage: Z, expandPagesOnSearch: re, expandAll: L, collapseAll: U } = Dn(null), [$, R] = He(), H = $.get("page"), z = tt(null), { data: ie } = Ge(), Ne = Ot("enable-add-page-dropdown"), Ee = ae((A) => {
|
|
4605
4605
|
var O;
|
|
4606
4606
|
return (O = ve(ie, { key: A })) == null ? void 0 : O.hasSlug;
|
|
4607
4607
|
}, [ie]);
|
|
4608
|
-
|
|
4608
|
+
ne(() => {
|
|
4609
4609
|
if (!J(k)) return;
|
|
4610
4610
|
const A = sessionStorage.getItem("pageTypeFilter") || "all";
|
|
4611
4611
|
!J(ie) && A && (ve(ie, { key: A }) ? E(A) : E("all"));
|
|
4612
4612
|
}, [ie, k]);
|
|
4613
4613
|
const me = (A) => {
|
|
4614
4614
|
E(A), sessionStorage.setItem("pageTypeFilter", A), o("");
|
|
4615
|
-
}, w =
|
|
4615
|
+
}, w = ae(
|
|
4616
4616
|
(A) => {
|
|
4617
|
-
const W = new URLSearchParams(window.location.search).get("lang"),
|
|
4618
|
-
W &&
|
|
4617
|
+
const W = new URLSearchParams(window.location.search).get("lang"), F = new URLSearchParams({ page: A });
|
|
4618
|
+
W && F.set("lang", W), window.history.pushState({}, "", `?${F.toString()}`), R(F), window.dispatchEvent(new PopStateEvent("popstate")), e();
|
|
4619
4619
|
},
|
|
4620
4620
|
[R, e]
|
|
4621
4621
|
);
|
|
4622
|
-
|
|
4622
|
+
ne(() => {
|
|
4623
4623
|
if (H && !_) {
|
|
4624
4624
|
const A = ve(I, { id: H });
|
|
4625
4625
|
A && (A != null && A.pageType) ? t((O) => [...O, A == null ? void 0 : A.pageType]) : (window.history.replaceState(null, "", "/"), R(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
4626
4626
|
}
|
|
4627
4627
|
}, [I, H, _, R]);
|
|
4628
|
-
const f = K(() => I ?
|
|
4629
|
-
|
|
4628
|
+
const f = K(() => I ? al(I, r, k, Ee) : [], [I, r, k, Ee]);
|
|
4629
|
+
ne(() => {
|
|
4630
4630
|
H && !_ && !J(f) && (Z(f, H), z.current && z.current.scrollIntoView({
|
|
4631
4631
|
behavior: "smooth",
|
|
4632
4632
|
block: "end"
|
|
4633
4633
|
}));
|
|
4634
|
-
}, [H, _, f, Z]),
|
|
4634
|
+
}, [H, _, f, Z]), ne(() => {
|
|
4635
4635
|
!J(r) && !J(f) && re(f);
|
|
4636
4636
|
}, [r, f, re]);
|
|
4637
|
-
const P =
|
|
4637
|
+
const P = ae(() => {
|
|
4638
4638
|
L(f);
|
|
4639
|
-
}, [L, f]), B =
|
|
4639
|
+
}, [L, f]), B = ae(() => {
|
|
4640
4640
|
U();
|
|
4641
4641
|
}, [U]);
|
|
4642
4642
|
return /* @__PURE__ */ c("div", { className: "flex h-full flex-col justify-between", children: [
|
|
@@ -4658,7 +4658,7 @@ const Yd = () => {
|
|
|
4658
4658
|
ui,
|
|
4659
4659
|
{
|
|
4660
4660
|
className: `${k === "all" ? "bg-gray-50 hover:bg-gray-100" : "bg-gray-100 hover:bg-gray-50"} absolute right-1.5 top-1.5 -mt-px h-max w-max min-w-[120px] whitespace-nowrap p-0 py-1 pl-2 pr-1 text-xs text-gray-600 shadow-none ring-0 focus:ring-0`,
|
|
4661
|
-
children: /* @__PURE__ */ n(
|
|
4661
|
+
children: /* @__PURE__ */ n(Bo, { placeholder: "Select page type" })
|
|
4662
4662
|
}
|
|
4663
4663
|
),
|
|
4664
4664
|
/* @__PURE__ */ c(hi, { align: "end", children: [
|
|
@@ -4710,7 +4710,7 @@ const Yd = () => {
|
|
|
4710
4710
|
] }) : /* @__PURE__ */ n("div", { className: "h-[70vh] space-y-2 overflow-y-auto text-sm text-slate-700", children: Be(f, (A) => {
|
|
4711
4711
|
const O = A.id === H;
|
|
4712
4712
|
return /* @__PURE__ */ n("div", { ref: O ? z : null, children: /* @__PURE__ */ n(
|
|
4713
|
-
|
|
4713
|
+
rl,
|
|
4714
4714
|
{
|
|
4715
4715
|
item: A,
|
|
4716
4716
|
currentPage: H,
|
|
@@ -4738,7 +4738,7 @@ const Yd = () => {
|
|
|
4738
4738
|
});
|
|
4739
4739
|
},
|
|
4740
4740
|
children: [
|
|
4741
|
-
/* @__PURE__ */ n(
|
|
4741
|
+
/* @__PURE__ */ n(fs, { className: "h-4 w-4" }),
|
|
4742
4742
|
" Add New"
|
|
4743
4743
|
]
|
|
4744
4744
|
}
|
|
@@ -4758,7 +4758,7 @@ const Yd = () => {
|
|
|
4758
4758
|
x && /* @__PURE__ */ n(ur, { page: x, onClose: () => N(null) }),
|
|
4759
4759
|
s && /* @__PURE__ */ n(or, { page: s, onClose: () => a(null), closePanel: e })
|
|
4760
4760
|
] });
|
|
4761
|
-
},
|
|
4761
|
+
}, rl = ({
|
|
4762
4762
|
item: e,
|
|
4763
4763
|
currentPage: t,
|
|
4764
4764
|
close: s,
|
|
@@ -4771,7 +4771,7 @@ const Yd = () => {
|
|
|
4771
4771
|
parentSlug: h,
|
|
4772
4772
|
level: u = 0
|
|
4773
4773
|
}) => {
|
|
4774
|
-
const m = !J(e == null ? void 0 : e.children), { isExpanded: v, toggleExpanded: p } =
|
|
4774
|
+
const m = !J(e == null ? void 0 : e.children), { isExpanded: v, toggleExpanded: p } = Dn(e == null ? void 0 : e.id);
|
|
4775
4775
|
return /* @__PURE__ */ c("div", { className: "border-0", children: [
|
|
4776
4776
|
/* @__PURE__ */ n(
|
|
4777
4777
|
au,
|
|
@@ -4792,7 +4792,7 @@ const Yd = () => {
|
|
|
4792
4792
|
}
|
|
4793
4793
|
),
|
|
4794
4794
|
m && v && /* @__PURE__ */ n("div", { className: "bg-white pl-6 pt-2", children: Be(M(e, "children", []), (y) => /* @__PURE__ */ n(
|
|
4795
|
-
|
|
4795
|
+
rl,
|
|
4796
4796
|
{
|
|
4797
4797
|
item: y,
|
|
4798
4798
|
currentPage: t,
|
|
@@ -4823,7 +4823,7 @@ const Yd = () => {
|
|
|
4823
4823
|
children: /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-between gap-x-1.5", children: [
|
|
4824
4824
|
/* @__PURE__ */ n("span", { className: "max-w-[150px] overflow-hidden truncate whitespace-nowrap font-medium leading-tight", children: (l == null ? void 0 : l.name) || "All" }),
|
|
4825
4825
|
/* @__PURE__ */ n(
|
|
4826
|
-
|
|
4826
|
+
ic,
|
|
4827
4827
|
{
|
|
4828
4828
|
className: `${e !== "all" ? "fill-sky-50 text-sky-500" : ""} pointer-events-none h-4 w-4 text-muted-foreground hover:bg-blue-300`
|
|
4829
4829
|
}
|
|
@@ -4888,7 +4888,7 @@ const Yd = () => {
|
|
|
4888
4888
|
}
|
|
4889
4889
|
)
|
|
4890
4890
|
] }), ou = ({ pages: e }) => {
|
|
4891
|
-
const { expandAll: t, collapseAll: s, expandedPages: a } =
|
|
4891
|
+
const { expandAll: t, collapseAll: s, expandedPages: a } = Dn(null);
|
|
4892
4892
|
return /* @__PURE__ */ c("div", { className: "flex gap-1", children: [
|
|
4893
4893
|
/* @__PURE__ */ c(Xe, { children: [
|
|
4894
4894
|
/* @__PURE__ */ n(Ze, { asChild: !0, children: /* @__PURE__ */ n(T, { variant: "outline", size: "icon", onClick: () => t(e), className: "rounded p-1 text-gray-500", children: /* @__PURE__ */ n(Ai, {}) }) }),
|
|
@@ -4909,8 +4909,8 @@ const Yd = () => {
|
|
|
4909
4909
|
/* @__PURE__ */ n(et, { children: "Collapse All" })
|
|
4910
4910
|
] })
|
|
4911
4911
|
] });
|
|
4912
|
-
},
|
|
4913
|
-
const a =
|
|
4912
|
+
}, il = ({ languages: e, selectedLanguage: t, setSelectedLanguage: s }) => {
|
|
4913
|
+
const a = Gt();
|
|
4914
4914
|
return /* @__PURE__ */ n("div", { className: "scrollbar-hide flex gap-1 overflow-x-auto pb-1", children: e.map((r) => /* @__PURE__ */ c(
|
|
4915
4915
|
T,
|
|
4916
4916
|
{
|
|
@@ -4935,7 +4935,7 @@ const Yd = () => {
|
|
|
4935
4935
|
variant: "ghost",
|
|
4936
4936
|
onClick: () => e.invalidateQueries({ queryKey: [G.GET_WEBSITE_PAGES] }),
|
|
4937
4937
|
className: "mt-1 h-6 w-6",
|
|
4938
|
-
children: /* @__PURE__ */ n(
|
|
4938
|
+
children: /* @__PURE__ */ n(lc, {})
|
|
4939
4939
|
}
|
|
4940
4940
|
) }),
|
|
4941
4941
|
/* @__PURE__ */ n(et, { side: "bottom", children: "Refresh pages list" })
|
|
@@ -4960,14 +4960,14 @@ const Yd = () => {
|
|
|
4960
4960
|
/* @__PURE__ */ n(lu, { search: t, setSearch: s }),
|
|
4961
4961
|
/* @__PURE__ */ n(ou, { pages: e }),
|
|
4962
4962
|
/* @__PURE__ */ c(T, { variant: "default", onClick: r, className: "rounded px-3 font-normal", children: [
|
|
4963
|
-
/* @__PURE__ */ n(
|
|
4963
|
+
/* @__PURE__ */ n(fs, { strokeWidth: 2, className: "stroke-white stroke-[3]" }),
|
|
4964
4964
|
/* @__PURE__ */ n("span", { className: "font-normal text-white", children: "Add Page" })
|
|
4965
4965
|
] }),
|
|
4966
4966
|
!m && /* @__PURE__ */ n(Ar, {})
|
|
4967
4967
|
] }),
|
|
4968
4968
|
m ? /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4969
4969
|
/* @__PURE__ */ n(
|
|
4970
|
-
|
|
4970
|
+
il,
|
|
4971
4971
|
{
|
|
4972
4972
|
languages: a,
|
|
4973
4973
|
selectedLanguage: i,
|
|
@@ -4984,7 +4984,7 @@ const Yd = () => {
|
|
|
4984
4984
|
variant: "ghost",
|
|
4985
4985
|
onClick: () => u(!h),
|
|
4986
4986
|
className: "h-6 rounded px-3 py-1 text-xs font-normal",
|
|
4987
|
-
children: h ? /* @__PURE__ */ n(
|
|
4987
|
+
children: h ? /* @__PURE__ */ n(ac, {}) : /* @__PURE__ */ n(rc, {})
|
|
4988
4988
|
}
|
|
4989
4989
|
) }),
|
|
4990
4990
|
/* @__PURE__ */ n(et, { side: "bottom", children: "Toggle Untranslated Pages" })
|
|
@@ -5008,7 +5008,7 @@ function Vt({
|
|
|
5008
5008
|
}
|
|
5009
5009
|
const du = ({ page: e }) => {
|
|
5010
5010
|
var a, r;
|
|
5011
|
-
const { isExpanded: t, toggleExpanded: s } =
|
|
5011
|
+
const { isExpanded: t, toggleExpanded: s } = Dn(e == null ? void 0 : e.id);
|
|
5012
5012
|
return /* @__PURE__ */ n(
|
|
5013
5013
|
"button",
|
|
5014
5014
|
{
|
|
@@ -5041,7 +5041,7 @@ const du = ({ page: e }) => {
|
|
|
5041
5041
|
selectedLanguage: i,
|
|
5042
5042
|
showUntranslatedPages: l
|
|
5043
5043
|
}) => {
|
|
5044
|
-
const [o] =
|
|
5044
|
+
const [o] = Vi(), d = Gt(), h = s === e.id, u = !!e.isTemplate, m = K(() => ve(t, { key: e.pageType }), [t, e.pageType]), v = o == null ? void 0 : o[e.id], { data: p } = St(v), y = p ? p == null ? void 0 : p.name : null;
|
|
5045
5045
|
let g = M(r, e == null ? void 0 : e.id);
|
|
5046
5046
|
g = M(g, "lang") === i ? g : null;
|
|
5047
5047
|
const b = i === d || !!g, x = (g == null ? void 0 : g.name) || (e == null ? void 0 : e.name) || "No name";
|
|
@@ -5074,7 +5074,7 @@ const du = ({ page: e }) => {
|
|
|
5074
5074
|
e.dynamicSlugCustom
|
|
5075
5075
|
] })
|
|
5076
5076
|
] }) }),
|
|
5077
|
-
u && /* @__PURE__ */ n(Vt, { content: "Template", side: "top", children: /* @__PURE__ */ n("span", { className: "text-blue-500", children: /* @__PURE__ */ n(
|
|
5077
|
+
u && /* @__PURE__ */ n(Vt, { content: "Template", side: "top", children: /* @__PURE__ */ n("span", { className: "text-blue-500", children: /* @__PURE__ */ n(oc, { size: 16 }) }) }),
|
|
5078
5078
|
!e.isPartialGroup && b && !y ? /* @__PURE__ */ n("div", { className: "duration absolute right-0.5 top-[3px]", children: /* @__PURE__ */ n(
|
|
5079
5079
|
dr,
|
|
5080
5080
|
{
|
|
@@ -5093,7 +5093,7 @@ const du = ({ page: e }) => {
|
|
|
5093
5093
|
}
|
|
5094
5094
|
),
|
|
5095
5095
|
/* @__PURE__ */ n(ce, { children: y && /* @__PURE__ */ c("button", { className: "absolute right-0 top-0 flex h-full items-center gap-x-1 rounded bg-red-50 px-2 py-0.5 text-xs font-light text-red-500 opacity-0 group-hover:opacity-100", children: [
|
|
5096
|
-
/* @__PURE__ */ n(
|
|
5096
|
+
/* @__PURE__ */ n(Hn, { size: 12, className: "stroke-[3]" }),
|
|
5097
5097
|
" ",
|
|
5098
5098
|
/* @__PURE__ */ n("span", { className: "font-medium", children: y }),
|
|
5099
5099
|
" is editing this page"
|
|
@@ -5106,7 +5106,7 @@ const du = ({ page: e }) => {
|
|
|
5106
5106
|
},
|
|
5107
5107
|
className: "absolute left-1/2 top-1 flex -translate-x-1/2 items-center gap-x-1 rounded bg-blue-500 px-2 py-0.5 text-xs text-white opacity-0 duration-200 hover:bg-blue-700 group-hover:opacity-100",
|
|
5108
5108
|
children: [
|
|
5109
|
-
/* @__PURE__ */ n(
|
|
5109
|
+
/* @__PURE__ */ n(fs, { size: 12, className: "stroke-[3]" }),
|
|
5110
5110
|
" ",
|
|
5111
5111
|
/* @__PURE__ */ c("span", { className: "text-[10px]", children: [
|
|
5112
5112
|
"Add ",
|
|
@@ -5117,7 +5117,7 @@ const du = ({ page: e }) => {
|
|
|
5117
5117
|
}
|
|
5118
5118
|
) })
|
|
5119
5119
|
] });
|
|
5120
|
-
},
|
|
5120
|
+
}, ll = ({
|
|
5121
5121
|
pages: e,
|
|
5122
5122
|
tier: t,
|
|
5123
5123
|
pageTypes: s,
|
|
@@ -5127,7 +5127,7 @@ const du = ({ page: e }) => {
|
|
|
5127
5127
|
selectedLanguage: l,
|
|
5128
5128
|
showUntranslatedPages: o
|
|
5129
5129
|
}) => {
|
|
5130
|
-
const { expandedPages: d } =
|
|
5130
|
+
const { expandedPages: d } = Dn();
|
|
5131
5131
|
return /* @__PURE__ */ n("div", { className: "space-y-0.5", style: { paddingLeft: `${t * 10}px` }, children: e.map((h) => /* @__PURE__ */ c(ce, { children: [
|
|
5132
5132
|
/* @__PURE__ */ n(
|
|
5133
5133
|
mu,
|
|
@@ -5142,7 +5142,7 @@ const du = ({ page: e }) => {
|
|
|
5142
5142
|
}
|
|
5143
5143
|
),
|
|
5144
5144
|
h.children && h.children.length > 0 && (d == null ? void 0 : d.includes(h.id)) && /* @__PURE__ */ n(
|
|
5145
|
-
|
|
5145
|
+
ll,
|
|
5146
5146
|
{
|
|
5147
5147
|
pages: h.children,
|
|
5148
5148
|
tier: t + 1,
|
|
@@ -5156,30 +5156,32 @@ const du = ({ page: e }) => {
|
|
|
5156
5156
|
)
|
|
5157
5157
|
] }, h.id)) });
|
|
5158
5158
|
}, fu = ({ close: e }) => {
|
|
5159
|
-
const { languages: t, setSelectedLang: s } = Fe(), { data: a } = Ge(), { data: r, isFetching: i } =
|
|
5159
|
+
const { languages: t, setSelectedLang: s } = Fe(), { data: a } = Ge(), { data: r, isFetching: i } = vs(), [l, o] = He(), { updateForSelectedPage: d, expandPagesOnSearch: h } = Dn(null), u = Gt(), m = l.get("page"), [v, p] = S(""), [y, g] = S(null), [b, x] = S(null), [N, I] = S(null), [_, k] = S(null), [E, q] = S(""), [Z, re] = S(null), [L, U] = S(null), [$, R] = S(u), [H, z] = S(!1), [, ie] = Ue(ys), Ne = H && $ !== u, { data: Ee, isFetching: me } = Bd($), w = ae(
|
|
5160
5160
|
(A) => {
|
|
5161
5161
|
var O;
|
|
5162
5162
|
return (O = ve(a, { key: A })) == null ? void 0 : O.hasSlug;
|
|
5163
5163
|
},
|
|
5164
5164
|
[a]
|
|
5165
|
-
), f = K(() => r ? Ne ? ye(r, (A) => !(Ee != null && Ee[A.id])) :
|
|
5166
|
-
|
|
5165
|
+
), f = K(() => r ? Ne ? ye(r, (A) => !(Ee != null && Ee[A.id])) : al(r, v, E, w) : [], [r, w, v, E, Ee, Ne]);
|
|
5166
|
+
ne(() => {
|
|
5167
|
+
s(u);
|
|
5168
|
+
}, []), ne(() => {
|
|
5167
5169
|
if (!J(E)) return;
|
|
5168
5170
|
const A = sessionStorage.getItem("pageTypeFilter") || "all";
|
|
5169
5171
|
!J(a) && A && (ve(a, { key: A }) ? q(A) : q("all"));
|
|
5170
|
-
}, [a, E]),
|
|
5172
|
+
}, [a, E]), ne(() => {
|
|
5171
5173
|
m && !i && (ve(r, { id: m }) || (window.history.replaceState(null, "", "/"), o(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate"))));
|
|
5172
|
-
}, [r, m, i, o]),
|
|
5174
|
+
}, [r, m, i, o]), ne(() => {
|
|
5173
5175
|
m && !i && !J(f) && d(f, m);
|
|
5174
|
-
}, [m, i, f, d]),
|
|
5176
|
+
}, [m, i, f, d]), ne(() => {
|
|
5175
5177
|
!J(v) && !J(f) && h(f);
|
|
5176
5178
|
}, [v, f, h]);
|
|
5177
|
-
const P =
|
|
5179
|
+
const P = ae(
|
|
5178
5180
|
(A) => {
|
|
5179
5181
|
const O = new URLSearchParams({ page: A });
|
|
5180
|
-
|
|
5182
|
+
$ !== u && O.set("lang", $), window.history.pushState({}, "", `?${O.toString()}`), o(O), window.dispatchEvent(new PopStateEvent("popstate")), e();
|
|
5181
5183
|
},
|
|
5182
|
-
[e, o,
|
|
5184
|
+
[e, o, $, s, u]
|
|
5183
5185
|
), B = (A, O) => {
|
|
5184
5186
|
var W;
|
|
5185
5187
|
if (O)
|
|
@@ -5191,7 +5193,7 @@ const du = ({ page: e }) => {
|
|
|
5191
5193
|
P(O);
|
|
5192
5194
|
break;
|
|
5193
5195
|
case "edit":
|
|
5194
|
-
|
|
5196
|
+
$ !== u ? ie({
|
|
5195
5197
|
edit: !0,
|
|
5196
5198
|
id: O == null ? void 0 : O.id,
|
|
5197
5199
|
primaryPage: O == null ? void 0 : O.primaryPage
|
|
@@ -5216,7 +5218,7 @@ const du = ({ page: e }) => {
|
|
|
5216
5218
|
ie({
|
|
5217
5219
|
edit: !1,
|
|
5218
5220
|
primaryPage: ((W = O == null ? void 0 : O.page) == null ? void 0 : W.id) || "",
|
|
5219
|
-
preselectedLang: (O == null ? void 0 : O.language) ||
|
|
5221
|
+
preselectedLang: (O == null ? void 0 : O.language) || $
|
|
5220
5222
|
});
|
|
5221
5223
|
break;
|
|
5222
5224
|
}
|
|
@@ -5230,7 +5232,7 @@ const du = ({ page: e }) => {
|
|
|
5230
5232
|
search: v,
|
|
5231
5233
|
setSearch: p,
|
|
5232
5234
|
languages: [u, ...t],
|
|
5233
|
-
selectedLanguage:
|
|
5235
|
+
selectedLanguage: $,
|
|
5234
5236
|
setSelectedLanguage: R,
|
|
5235
5237
|
selectedPageType: E,
|
|
5236
5238
|
setSelectedPageType: q,
|
|
@@ -5244,7 +5246,7 @@ const du = ({ page: e }) => {
|
|
|
5244
5246
|
"Empty List!",
|
|
5245
5247
|
/* @__PURE__ */ n("span", { className: "font-light", children: "Add new page to start" })
|
|
5246
5248
|
] }) : /* @__PURE__ */ n(
|
|
5247
|
-
|
|
5249
|
+
ll,
|
|
5248
5250
|
{
|
|
5249
5251
|
tier: 0,
|
|
5250
5252
|
pages: f,
|
|
@@ -5252,7 +5254,7 @@ const du = ({ page: e }) => {
|
|
|
5252
5254
|
currentPage: m || "",
|
|
5253
5255
|
onClickAction: B,
|
|
5254
5256
|
languagePages: Ee,
|
|
5255
|
-
selectedLanguage:
|
|
5257
|
+
selectedLanguage: $,
|
|
5256
5258
|
showUntranslatedPages: Ne
|
|
5257
5259
|
}
|
|
5258
5260
|
) })
|
|
@@ -5287,7 +5289,7 @@ const du = ({ page: e }) => {
|
|
|
5287
5289
|
onClick: () => {
|
|
5288
5290
|
l(), i(!0);
|
|
5289
5291
|
},
|
|
5290
|
-
children: /* @__PURE__ */ n(
|
|
5292
|
+
children: /* @__PURE__ */ n(cc, { className: "h-4 w-4" })
|
|
5291
5293
|
},
|
|
5292
5294
|
"template-viewer"
|
|
5293
5295
|
) }),
|
|
@@ -5302,13 +5304,13 @@ const du = ({ page: e }) => {
|
|
|
5302
5304
|
children: [
|
|
5303
5305
|
/* @__PURE__ */ c(gi, { className: `mb-3 ${h ? "" : "px-4 pt-4"}`, children: [
|
|
5304
5306
|
/* @__PURE__ */ c(pi, { className: "flex items-center gap-2 text-sm font-semibold", children: [
|
|
5305
|
-
/* @__PURE__ */ n("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary text-primary-foreground", children: /* @__PURE__ */ n(
|
|
5307
|
+
/* @__PURE__ */ n("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary text-primary-foreground", children: /* @__PURE__ */ n(dc, { className: "h-4 w-4" }) }),
|
|
5306
5308
|
/* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
5307
5309
|
/* @__PURE__ */ n("span", { className: "text-sm font-semibold", children: "Pages" }),
|
|
5308
5310
|
/* @__PURE__ */ n("span", { id: "pages-manager-description", className: "text-xs font-normal text-muted-foreground", children: "Manage your site structure" })
|
|
5309
5311
|
] })
|
|
5310
5312
|
] }),
|
|
5311
|
-
/* @__PURE__ */ n(
|
|
5313
|
+
/* @__PURE__ */ n(Fo, { className: "sr-only", children: "Manage your site structure" })
|
|
5312
5314
|
] }),
|
|
5313
5315
|
/* @__PURE__ */ n(
|
|
5314
5316
|
"div",
|
|
@@ -5321,16 +5323,16 @@ const du = ({ page: e }) => {
|
|
|
5321
5323
|
}
|
|
5322
5324
|
) })
|
|
5323
5325
|
] });
|
|
5324
|
-
},
|
|
5326
|
+
}, ol = ({
|
|
5325
5327
|
showAdd: e = !0,
|
|
5326
5328
|
variant: t = "ghost"
|
|
5327
5329
|
}) => {
|
|
5328
5330
|
const { fallbackLang: s, languages: a, selectedLang: r, setSelectedLang: i } = Fe(), l = J(r) ? s : r, [, o] = He(), { isLocked: d } = At();
|
|
5329
|
-
|
|
5331
|
+
ne(() => {
|
|
5330
5332
|
const b = new URLSearchParams(window.location.search), x = b.get("lang");
|
|
5331
5333
|
x && (a.includes(x) ? i(x) : (b.delete("lang"), o(b), i("")));
|
|
5332
5334
|
}, [a, o, i]);
|
|
5333
|
-
const [, h] = Ue(
|
|
5335
|
+
const [, h] = Ue(ys), { data: u } = We(), { data: m } = Et(), { data: v } = ht(), p = K(() => {
|
|
5334
5336
|
const b = Ks(
|
|
5335
5337
|
Be(M(m, "languages"), (x) => {
|
|
5336
5338
|
const N = ve(v, { lang: x });
|
|
@@ -5394,7 +5396,7 @@ const du = ({ page: e }) => {
|
|
|
5394
5396
|
(b) => /* @__PURE__ */ c(
|
|
5395
5397
|
$e,
|
|
5396
5398
|
{
|
|
5397
|
-
className:
|
|
5399
|
+
className: zn(
|
|
5398
5400
|
"flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",
|
|
5399
5401
|
b.key === l && "!bg-gray-200 text-gray-700"
|
|
5400
5402
|
),
|
|
@@ -5411,7 +5413,7 @@ const du = ({ page: e }) => {
|
|
|
5411
5413
|
)
|
|
5412
5414
|
),
|
|
5413
5415
|
e && !J(p.filter((b) => !b.isLangPageAdded)) && /* @__PURE__ */ c(ce, { children: [
|
|
5414
|
-
/* @__PURE__ */ n(
|
|
5416
|
+
/* @__PURE__ */ n(Mo, {}),
|
|
5415
5417
|
/* @__PURE__ */ c(
|
|
5416
5418
|
T,
|
|
5417
5419
|
{
|
|
@@ -5425,7 +5427,7 @@ const du = ({ page: e }) => {
|
|
|
5425
5427
|
},
|
|
5426
5428
|
className: "text-xs font-normal duration-200 hover:bg-slate-300 hover:text-slate-800",
|
|
5427
5429
|
children: [
|
|
5428
|
-
/* @__PURE__ */ n(
|
|
5430
|
+
/* @__PURE__ */ n(fs, { className: "mr-1 h-3 w-3" }),
|
|
5429
5431
|
" Add Langauge"
|
|
5430
5432
|
]
|
|
5431
5433
|
}
|
|
@@ -5435,7 +5437,7 @@ const du = ({ page: e }) => {
|
|
|
5435
5437
|
] }) });
|
|
5436
5438
|
};
|
|
5437
5439
|
function yu() {
|
|
5438
|
-
const [e, t] = Ue(
|
|
5440
|
+
const [e, t] = Ue(ys);
|
|
5439
5441
|
return /* @__PURE__ */ c("div", { className: "relative z-10 flex items-center justify-end gap-1", children: [
|
|
5440
5442
|
/* @__PURE__ */ n(gu, {}),
|
|
5441
5443
|
/* @__PURE__ */ n(pu, {}),
|
|
@@ -5459,7 +5461,7 @@ function vu(e, t) {
|
|
|
5459
5461
|
queryFn: async () => {
|
|
5460
5462
|
if (!e.uid || !t.uid)
|
|
5461
5463
|
throw new Error("Both revision IDs are required for comparison");
|
|
5462
|
-
const r = (o) => o === "draft" || o === "live" ? o : "revision", i = (o) =>
|
|
5464
|
+
const r = (o) => o === "draft" || o === "live" ? o : "revision", i = (o) => lo(o.uid, `${o.label}:`, "");
|
|
5463
5465
|
return await a(s, {
|
|
5464
5466
|
action: G.GET_COMPARE_DATA,
|
|
5465
5467
|
data: {
|
|
@@ -5494,7 +5496,7 @@ const bu = ({ version: e }) => {
|
|
|
5494
5496
|
/* @__PURE__ */ n("span", { className: "font-light opacity-90", children: r ? "Currently editing" : "Published by" }),
|
|
5495
5497
|
!r && /* @__PURE__ */ n("span", { className: "pl-1 font-medium", children: (s == null ? void 0 : s.name) || "Unknown" })
|
|
5496
5498
|
] }),
|
|
5497
|
-
/* @__PURE__ */ n("div", { className: "text-[10px] leading-tight", children:
|
|
5499
|
+
/* @__PURE__ */ n("div", { className: "text-[10px] leading-tight", children: Wo(t.createdAt, "dd MMM yyyy, h:mm a") })
|
|
5498
5500
|
] })
|
|
5499
5501
|
]
|
|
5500
5502
|
}
|
|
@@ -5544,13 +5546,13 @@ function xu(e, t, s = "data.json") {
|
|
|
5544
5546
|
`) + `
|
|
5545
5547
|
`, o;
|
|
5546
5548
|
}
|
|
5547
|
-
function
|
|
5549
|
+
function $n(e, t = !0, s = !1) {
|
|
5548
5550
|
if (Ia(e)) {
|
|
5549
|
-
const a =
|
|
5551
|
+
const a = oo(e);
|
|
5550
5552
|
if (nn(a, "{") || nn(a, "[") || t && (a === "true" || a === "false" || a === "null" || /^-?\d+(\.\d+)?([eE][+-]?\d+)?$/.test(a)))
|
|
5551
5553
|
try {
|
|
5552
5554
|
const i = JSON.parse(a);
|
|
5553
|
-
return
|
|
5555
|
+
return $n(i, t, s);
|
|
5554
5556
|
} catch {
|
|
5555
5557
|
if (s)
|
|
5556
5558
|
throw new Error(`Invalid JSON string: ${a}`);
|
|
@@ -5558,7 +5560,7 @@ function qn(e, t = !0, s = !1) {
|
|
|
5558
5560
|
}
|
|
5559
5561
|
return e;
|
|
5560
5562
|
}
|
|
5561
|
-
return Jr(e) ? Be(e, (a) =>
|
|
5563
|
+
return Jr(e) ? Be(e, (a) => $n(a, t, s)) : co(e) ? Wr(e, (a) => $n(a, t, s)) : e;
|
|
5562
5564
|
}
|
|
5563
5565
|
const wu = (e) => {
|
|
5564
5566
|
switch (e) {
|
|
@@ -5578,13 +5580,13 @@ const wu = (e) => {
|
|
|
5578
5580
|
};
|
|
5579
5581
|
function Eu({ open: e, compare: t, onOpenChange: s }) {
|
|
5580
5582
|
const a = t[0], r = t[1], [i, l] = S(null), [o, d] = S("split"), [h, u] = S(!1), [m, v] = S("blocks"), { data: p, isLoading: y } = vu(a, r), { leftData: g, rightData: b, options: x } = K(() => {
|
|
5581
|
-
var U,
|
|
5582
|
-
const E = (U = p == null ? void 0 : p.version1) == null ? void 0 : U[m], q = (
|
|
5583
|
+
var U, $;
|
|
5584
|
+
const E = (U = p == null ? void 0 : p.version1) == null ? void 0 : U[m], q = ($ = p == null ? void 0 : p.version2) == null ? void 0 : $[m], Z = $n(E), re = $n(q), L = Nu(p == null ? void 0 : p.version1, p == null ? void 0 : p.version2);
|
|
5583
5585
|
return { leftData: Z, rightData: re, options: L };
|
|
5584
5586
|
}, [p, m]), N = K(() => !g || !b ? "" : xu(g, b), [g, b]), I = K(() => {
|
|
5585
5587
|
if (!N) return [];
|
|
5586
5588
|
try {
|
|
5587
|
-
return
|
|
5589
|
+
return Ic(N);
|
|
5588
5590
|
} catch (E) {
|
|
5589
5591
|
return console.error("Failed to parse diff:", E), [];
|
|
5590
5592
|
}
|
|
@@ -5629,7 +5631,7 @@ function Eu({ open: e, compare: t, onOpenChange: s }) {
|
|
|
5629
5631
|
] })
|
|
5630
5632
|
] }) })
|
|
5631
5633
|
] }) }),
|
|
5632
|
-
y ? /* @__PURE__ */ n(
|
|
5634
|
+
y ? /* @__PURE__ */ n(Qi, { fullScreen: !1 }) : /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ c("div", { className: "relative min-h-0 flex-1", children: [
|
|
5633
5635
|
/* @__PURE__ */ c("div", { className: "absolute -top-5 z-50 mt-0.5 flex w-full items-center justify-between gap-2", children: [
|
|
5634
5636
|
/* @__PURE__ */ n("div", { className: "flex w-1/2 items-center justify-center gap-2", children: /* @__PURE__ */ n(Tr, { version: a }) }),
|
|
5635
5637
|
/* @__PURE__ */ n("div", { className: "flex w-1/2 items-center justify-center gap-2", children: /* @__PURE__ */ n(Tr, { version: r }) })
|
|
@@ -5653,13 +5655,13 @@ function Eu({ open: e, compare: t, onOpenChange: s }) {
|
|
|
5653
5655
|
/* @__PURE__ */ n(La, { className: "mx-auto mb-2 h-8 w-8 opacity-50" }),
|
|
5654
5656
|
/* @__PURE__ */ n("p", { children: "No differences found or unable to parse diff" })
|
|
5655
5657
|
] }) }) : /* @__PURE__ */ n("div", { children: I.map((E, q) => /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(
|
|
5656
|
-
|
|
5658
|
+
_c,
|
|
5657
5659
|
{
|
|
5658
5660
|
viewType: o,
|
|
5659
5661
|
diffType: E.type,
|
|
5660
5662
|
hunks: E.hunks,
|
|
5661
5663
|
className: "rounded-lg text-xs",
|
|
5662
|
-
children: (Z) => Z.map((re, L) => /* @__PURE__ */ n(
|
|
5664
|
+
children: (Z) => Z.map((re, L) => /* @__PURE__ */ n(Lc, { hunk: re }, L))
|
|
5663
5665
|
}
|
|
5664
5666
|
) }, q)) }) })
|
|
5665
5667
|
] }) })
|
|
@@ -5755,7 +5757,7 @@ function Cu({ compare: e, setCompare: t, isComparisonEnabled: s }) {
|
|
|
5755
5757
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 pt-0.5", children: d ? /* @__PURE__ */ n($t, { tag: "unsaved" }) : null })
|
|
5756
5758
|
] }),
|
|
5757
5759
|
s && /* @__PURE__ */ n(
|
|
5758
|
-
|
|
5760
|
+
cl,
|
|
5759
5761
|
{
|
|
5760
5762
|
checked: l,
|
|
5761
5763
|
disabled: o,
|
|
@@ -5771,8 +5773,8 @@ function Cu({ compare: e, setCompare: t, isComparisonEnabled: s }) {
|
|
|
5771
5773
|
}
|
|
5772
5774
|
function ku() {
|
|
5773
5775
|
var R, H;
|
|
5774
|
-
const [e, t] = ke.useState([]), [s, a] = ke.useState(!1), [r, i] = ke.useState(null), [l, o] = ke.useState(!1), [d, h] = ke.useState(!1), { data: u } = We(), { data: m, isFetching: v, error: p, refetch: y } = Su(u == null ? void 0 : u.id), { mutate: g, isPending: b } = Au(), { mutate: x, isPending: N } = Tu(), I = Ie(), _ =
|
|
5775
|
-
|
|
5776
|
+
const [e, t] = ke.useState([]), [s, a] = ke.useState(!1), [r, i] = ke.useState(null), [l, o] = ke.useState(!1), [d, h] = ke.useState(!1), { data: u } = We(), { data: m, isFetching: v, error: p, refetch: y } = Su(u == null ? void 0 : u.id), { mutate: g, isPending: b } = Au(), { mutate: x, isPending: N } = Tu(), I = Ie(), _ = zi(), k = Ot("enable-page-revisions-compare"), { selectedLang: E, fallbackLang: q } = Fe(), Z = E || q;
|
|
5777
|
+
ne(() => t([]), [u == null ? void 0 : u.id]);
|
|
5776
5778
|
const re = (z) => {
|
|
5777
5779
|
r && x(
|
|
5778
5780
|
{ revisionId: r.uid, discardCurrent: z },
|
|
@@ -5788,7 +5790,7 @@ function ku() {
|
|
|
5788
5790
|
i(z), o(!0);
|
|
5789
5791
|
}, U = (z) => {
|
|
5790
5792
|
i(z), h(!0);
|
|
5791
|
-
},
|
|
5793
|
+
}, $ = () => {
|
|
5792
5794
|
r && g(r.uid, {
|
|
5793
5795
|
/**
|
|
5794
5796
|
* Callback for when deletion of a revision is successful. Closes the
|
|
@@ -5799,14 +5801,14 @@ function ku() {
|
|
|
5799
5801
|
}
|
|
5800
5802
|
});
|
|
5801
5803
|
};
|
|
5802
|
-
return
|
|
5804
|
+
return ne(() => {
|
|
5803
5805
|
s && y();
|
|
5804
5806
|
}, [s, y]), /* @__PURE__ */ c(ce, { children: [
|
|
5805
5807
|
/* @__PURE__ */ n(Ft, { children: /* @__PURE__ */ c(Xe, { children: [
|
|
5806
5808
|
/* @__PURE__ */ c(mi, { open: s, onOpenChange: a, children: [
|
|
5807
|
-
/* @__PURE__ */ n(
|
|
5809
|
+
/* @__PURE__ */ n($o, { asChild: !0, children: /* @__PURE__ */ n(Ze, { asChild: !0, children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
5808
5810
|
/* @__PURE__ */ c(T, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
|
|
5809
|
-
/* @__PURE__ */ n(
|
|
5811
|
+
/* @__PURE__ */ n(uc, { className: "h-4 w-4" }),
|
|
5810
5812
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "View revision history" })
|
|
5811
5813
|
] }),
|
|
5812
5814
|
/* @__PURE__ */ n("div", { className: "h-4 w-px bg-gray-200 dark:bg-gray-700" })
|
|
@@ -5884,7 +5886,7 @@ function ku() {
|
|
|
5884
5886
|
open: d,
|
|
5885
5887
|
onOpenChange: h,
|
|
5886
5888
|
revision: r,
|
|
5887
|
-
onDelete:
|
|
5889
|
+
onDelete: $,
|
|
5888
5890
|
isDeleting: b
|
|
5889
5891
|
}
|
|
5890
5892
|
)
|
|
@@ -5946,7 +5948,7 @@ function Cr({
|
|
|
5946
5948
|
/* @__PURE__ */ n(lt, { permissions: [Ce.RESTORE_REVISION, Ce.DELETE_REVISION], children: /* @__PURE__ */ n(_u, { revision: e, onRestore: s, onDelete: a }) })
|
|
5947
5949
|
] }),
|
|
5948
5950
|
h && /* @__PURE__ */ n(
|
|
5949
|
-
|
|
5951
|
+
cl,
|
|
5950
5952
|
{
|
|
5951
5953
|
checked: p,
|
|
5952
5954
|
disabled: y,
|
|
@@ -6018,7 +6020,7 @@ function Iu({ compare: e, setCompare: t, pageId: s }) {
|
|
|
6018
6020
|
a && (e == null ? void 0 : e.length) > 1 && s && /* @__PURE__ */ n(Eu, { open: a, onOpenChange: r, compare: e })
|
|
6019
6021
|
] });
|
|
6020
6022
|
}
|
|
6021
|
-
function
|
|
6023
|
+
function cl({ checked: e, disabled: t, onChange: s, label: a = "Compare" }) {
|
|
6022
6024
|
return /* @__PURE__ */ n("div", { className: "absolute bottom-2 right-2", children: /* @__PURE__ */ c("label", { className: `flex cursor-pointer items-center gap-x-1 text-[11px] ${t ? "opacity-50" : ""}`, children: [
|
|
6023
6025
|
/* @__PURE__ */ n(
|
|
6024
6026
|
"input",
|
|
@@ -6045,7 +6047,7 @@ function _u({ revision: e, onRestore: t, onDelete: s }) {
|
|
|
6045
6047
|
/* @__PURE__ */ n("span", { children: "Restore this version" })
|
|
6046
6048
|
] }) }),
|
|
6047
6049
|
/* @__PURE__ */ n(lt, { permission: Ce.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ c(ce, { children: [
|
|
6048
|
-
/* @__PURE__ */ n(
|
|
6050
|
+
/* @__PURE__ */ n(qo, {}),
|
|
6049
6051
|
/* @__PURE__ */ c($e, { onClick: s, className: "cursor-pointer text-destructive", children: [
|
|
6050
6052
|
/* @__PURE__ */ n(Ya, { className: "mr-2 h-4 w-4" }),
|
|
6051
6053
|
/* @__PURE__ */ n("span", { children: "Delete this version" })
|
|
@@ -6083,12 +6085,12 @@ function Lu({
|
|
|
6083
6085
|
] })
|
|
6084
6086
|
] }),
|
|
6085
6087
|
/* @__PURE__ */ n("div", { className: "py-2", children: /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground", children: "How would you like to handle your current edits?" }) }),
|
|
6086
|
-
/* @__PURE__ */ c(
|
|
6088
|
+
/* @__PURE__ */ c(mt, { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
6087
6089
|
/* @__PURE__ */ n(T, { variant: "outline", className: "sm:flex-1", onClick: () => a(!1), disabled: r, children: r ? /* @__PURE__ */ c(ce, { children: [
|
|
6088
6090
|
/* @__PURE__ */ n("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
6089
6091
|
"Saving as draft..."
|
|
6090
6092
|
] }) : /* @__PURE__ */ c(ce, { children: [
|
|
6091
|
-
/* @__PURE__ */ n(
|
|
6093
|
+
/* @__PURE__ */ n(hc, { className: "mr-2 h-4 w-4" }),
|
|
6092
6094
|
"Save as draft"
|
|
6093
6095
|
] }) }),
|
|
6094
6096
|
/* @__PURE__ */ n(T, { variant: "default", className: "sm:flex-1", onClick: () => a(!0), disabled: r, children: r ? /* @__PURE__ */ c(ce, { children: [
|
|
@@ -6132,7 +6134,7 @@ function Du({
|
|
|
6132
6134
|
] })
|
|
6133
6135
|
] }),
|
|
6134
6136
|
/* @__PURE__ */ n("div", { className: "py-2", children: /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground", children: "This action cannot be undone. Are you sure you want to proceed?" }) }),
|
|
6135
|
-
/* @__PURE__ */ c(
|
|
6137
|
+
/* @__PURE__ */ c(mt, { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
6136
6138
|
/* @__PURE__ */ n(T, { variant: "outline", className: "sm:flex-1", onClick: () => t(!1), disabled: r, children: "Cancel" }),
|
|
6137
6139
|
/* @__PURE__ */ n(T, { variant: "destructive", className: "sm:flex-1", onClick: a, disabled: r, children: r ? /* @__PURE__ */ c(ce, { children: [
|
|
6138
6140
|
/* @__PURE__ */ n("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
@@ -6173,7 +6175,7 @@ const Ou = () => {
|
|
|
6173
6175
|
}
|
|
6174
6176
|
),
|
|
6175
6177
|
" ",
|
|
6176
|
-
r(e.pageType) ? /* @__PURE__ */ n(Qt, { className: "h-4 w-4" }) : /* @__PURE__ */ n(
|
|
6178
|
+
r(e.pageType) ? /* @__PURE__ */ n(Qt, { className: "h-4 w-4" }) : /* @__PURE__ */ n(mc, { className: "h-4 w-4" }),
|
|
6177
6179
|
/* @__PURE__ */ n(Vt, { content: e.name, side: "top", showTooltip: e.name.length > 25, children: /* @__PURE__ */ n("span", { className: "max-w-[200px] truncate font-medium text-black", children: e.name }) }),
|
|
6178
6180
|
e.slug && /* @__PURE__ */ n(Vt, { content: e.slug, side: "top", showTooltip: e.slug.length > 25, children: /* @__PURE__ */ n("span", { className: "max-w-[200px] truncate font-mono text-xs text-muted-foreground", children: e.slug }) })
|
|
6179
6181
|
]
|
|
@@ -6182,7 +6184,7 @@ const Ou = () => {
|
|
|
6182
6184
|
/* @__PURE__ */ n("td", { className: "px-2", children: a(e == null ? void 0 : e.pageType) }),
|
|
6183
6185
|
/* @__PURE__ */ n("td", { className: "px-4 text-right", children: Yr(e.changes) || "" }),
|
|
6184
6186
|
/* @__PURE__ */ n(ce, { children: o && /* @__PURE__ */ c("button", { className: "absolute right-0 top-0 flex h-full items-center gap-x-1 rounded bg-red-50 px-2 py-0.5 text-xs font-light text-red-500 opacity-0 group-hover:opacity-100", children: [
|
|
6185
|
-
/* @__PURE__ */ n(
|
|
6187
|
+
/* @__PURE__ */ n(Hn, { size: 12, className: "stroke-[3]" }),
|
|
6186
6188
|
" ",
|
|
6187
6189
|
/* @__PURE__ */ n("span", { className: "font-medium", children: o }),
|
|
6188
6190
|
" is editing this page"
|
|
@@ -6193,7 +6195,7 @@ function Gu({
|
|
|
6193
6195
|
showModal: e = !1,
|
|
6194
6196
|
onClose: t = () => console.log("Cancelled")
|
|
6195
6197
|
}) {
|
|
6196
|
-
const [s] =
|
|
6198
|
+
const [s] = Vi(), [a, r] = S([]), i = Gt(), [l, o] = S(i), { data: d, isFetching: h } = Ou(), { data: u } = Ge(), m = ae((L) => {
|
|
6197
6199
|
var U;
|
|
6198
6200
|
return (U = ve(u, { key: L })) == null ? void 0 : U.hasSlug;
|
|
6199
6201
|
}, [u]), v = K(
|
|
@@ -6209,15 +6211,15 @@ function Gu({
|
|
|
6209
6211
|
() => ye(g, (L) => v.includes(L.pageType)),
|
|
6210
6212
|
[g, v]
|
|
6211
6213
|
), { mutate: N, isPending: I } = ar();
|
|
6212
|
-
|
|
6214
|
+
ne(() => {
|
|
6213
6215
|
const L = Be(ye(g, { online: !0 }), "id");
|
|
6214
6216
|
r(L);
|
|
6215
|
-
}, [g]),
|
|
6217
|
+
}, [g]), ne(() => {
|
|
6216
6218
|
const L = Object.keys(s);
|
|
6217
|
-
r((U) => ye(U, (
|
|
6219
|
+
r((U) => ye(U, ($) => !xt(L, $)));
|
|
6218
6220
|
}, [s]);
|
|
6219
6221
|
const _ = a.length === (g == null ? void 0 : g.length), k = (L) => {
|
|
6220
|
-
r((U) => xt(U, L) ? ye(U, (
|
|
6222
|
+
r((U) => xt(U, L) ? ye(U, ($) => $ !== L) : uo(U, L));
|
|
6221
6223
|
}, E = () => {
|
|
6222
6224
|
r(_ ? [] : Be(g, "id"));
|
|
6223
6225
|
}, q = () => {
|
|
@@ -6225,7 +6227,7 @@ function Gu({
|
|
|
6225
6227
|
{ ids: ka(a) },
|
|
6226
6228
|
{
|
|
6227
6229
|
onSuccess: () => {
|
|
6228
|
-
t(),
|
|
6230
|
+
t(), Fn("CENTER_CENTER"), o(i);
|
|
6229
6231
|
}
|
|
6230
6232
|
}
|
|
6231
6233
|
);
|
|
@@ -6238,7 +6240,7 @@ function Gu({
|
|
|
6238
6240
|
{ label: "Updated", top: "pt-2" },
|
|
6239
6241
|
...As(ye(b, { online: !0 }), "pageType"),
|
|
6240
6242
|
...As(ye(x, { online: !0 }), "pageType")
|
|
6241
|
-
].filter((
|
|
6243
|
+
].filter(($) => $.pageType !== "theme"), U = [
|
|
6242
6244
|
{ label: "Offline", top: "pt-6" },
|
|
6243
6245
|
...As(ye(b, { online: !1 }), "pageType"),
|
|
6244
6246
|
...As(ye(x, { online: !1 }), "pageType")
|
|
@@ -6252,7 +6254,7 @@ function Gu({
|
|
|
6252
6254
|
/* @__PURE__ */ n(nt, { className: "text-xs", children: "Select the pages you want to publish. Click publish when you're done." })
|
|
6253
6255
|
] }),
|
|
6254
6256
|
y.length > 0 && /* @__PURE__ */ n("div", { className: "my-[2px] mt-0", children: /* @__PURE__ */ n(
|
|
6255
|
-
|
|
6257
|
+
il,
|
|
6256
6258
|
{
|
|
6257
6259
|
languages: [i, ...y],
|
|
6258
6260
|
selectedLanguage: l,
|
|
@@ -6301,7 +6303,7 @@ function Gu({
|
|
|
6301
6303
|
)
|
|
6302
6304
|
) })
|
|
6303
6305
|
] }) }),
|
|
6304
|
-
/* @__PURE__ */ c(
|
|
6306
|
+
/* @__PURE__ */ c(mt, { className: "mt-10 flex items-center justify-center", children: [
|
|
6305
6307
|
a.length > 0 && /* @__PURE__ */ c("span", { className: "text-center text-sm text-muted-foreground", children: [
|
|
6306
6308
|
a.length,
|
|
6307
6309
|
" Page",
|
|
@@ -6325,7 +6327,7 @@ const Uu = ({
|
|
|
6325
6327
|
/* @__PURE__ */ n(Ke, { children: r }),
|
|
6326
6328
|
/* @__PURE__ */ n(nt, { children: i })
|
|
6327
6329
|
] }),
|
|
6328
|
-
/* @__PURE__ */ c(
|
|
6330
|
+
/* @__PURE__ */ c(mt, { className: "flex gap-2", children: [
|
|
6329
6331
|
/* @__PURE__ */ n(
|
|
6330
6332
|
T,
|
|
6331
6333
|
{
|
|
@@ -6360,7 +6362,7 @@ const Uu = ({
|
|
|
6360
6362
|
});
|
|
6361
6363
|
};
|
|
6362
6364
|
function Mu({ onClose: e }) {
|
|
6363
|
-
const { data: t, isFetching: s } = Bu(), { mutateAsync: a, isPending: r } =
|
|
6365
|
+
const { data: t, isFetching: s } = Bu(), { mutateAsync: a, isPending: r } = Hc(), i = ct("settingComponent", null), l = ho(async (o) => (await a({ data: o }), !0), 300);
|
|
6364
6366
|
return i ? /* @__PURE__ */ n(je, { open: !0, onOpenChange: e, children: /* @__PURE__ */ c(ze, { className: "w-full", children: [
|
|
6365
6367
|
/* @__PURE__ */ n(Ve, { children: /* @__PURE__ */ n(Ke, { children: "Website Settings" }) }),
|
|
6366
6368
|
s ? /* @__PURE__ */ c("div", { className: "w-full space-y-3 py-4", children: [
|
|
@@ -6380,17 +6382,17 @@ function Mu({ onClose: e }) {
|
|
|
6380
6382
|
] }) }) : null;
|
|
6381
6383
|
}
|
|
6382
6384
|
const Fu = () => {
|
|
6383
|
-
const { selectedLang: e, fallbackLang: t } = Fe(), s = ct("getPreviewUrl", async (m) => m), [a, r] = S(""), { data: i } = We(), { data: l } =
|
|
6385
|
+
const { selectedLang: e, fallbackLang: t } = Fe(), s = ct("getPreviewUrl", async (m) => m), [a, r] = S(""), { data: i } = We(), { data: l } = ht(), { data: o } = Ge(), d = K(
|
|
6384
6386
|
() => {
|
|
6385
6387
|
var m;
|
|
6386
6388
|
return (m = l == null ? void 0 : l.find((v) => (v == null ? void 0 : v.lang) === e)) == null ? void 0 : m.slug;
|
|
6387
6389
|
},
|
|
6388
6390
|
[e, l]
|
|
6389
|
-
), h =
|
|
6391
|
+
), h = ae((m) => {
|
|
6390
6392
|
var v;
|
|
6391
6393
|
return (v = ve(o, { key: m })) == null ? void 0 : v.hasSlug;
|
|
6392
6394
|
}, [o]), u = e === t ? "" : e;
|
|
6393
|
-
return
|
|
6395
|
+
return ne(() => {
|
|
6394
6396
|
(async () => {
|
|
6395
6397
|
if (typeof s == "function") {
|
|
6396
6398
|
const m = !h(i == null ? void 0 : i.pageType), v = await s(
|
|
@@ -6406,7 +6408,7 @@ const Fu = () => {
|
|
|
6406
6408
|
oe.PREVIEW
|
|
6407
6409
|
] }) }) });
|
|
6408
6410
|
}, $u = () => {
|
|
6409
|
-
const [e, t] =
|
|
6411
|
+
const [e, t] = Po();
|
|
6410
6412
|
return /* @__PURE__ */ c(ce, { children: [
|
|
6411
6413
|
/* @__PURE__ */ n(Vt, { content: oe.THEME, children: /* @__PURE__ */ n(
|
|
6412
6414
|
T,
|
|
@@ -6415,14 +6417,14 @@ const Fu = () => {
|
|
|
6415
6417
|
size: "icon",
|
|
6416
6418
|
className: "gap-2",
|
|
6417
6419
|
onClick: () => t(e === "theme" ? "block" : "theme"),
|
|
6418
|
-
children: /* @__PURE__ */ n(
|
|
6420
|
+
children: /* @__PURE__ */ n(fc, { className: "h-4 w-4" })
|
|
6419
6421
|
}
|
|
6420
6422
|
) }),
|
|
6421
6423
|
/* @__PURE__ */ n("div", { className: "h-4 w-px bg-gray-200 dark:bg-gray-700" })
|
|
6422
6424
|
] });
|
|
6423
6425
|
}, qu = () => {
|
|
6424
6426
|
const [e, t] = S(!1), { isLocked: s } = At(), { savePageAsync: a, saveState: r } = Wt();
|
|
6425
|
-
|
|
6427
|
+
ne(() => {
|
|
6426
6428
|
const h = (u) => {
|
|
6427
6429
|
r === "UNSAVED" && (u.preventDefault(), u.returnValue = !1);
|
|
6428
6430
|
};
|
|
@@ -6430,7 +6432,7 @@ const Fu = () => {
|
|
|
6430
6432
|
window.removeEventListener("beforeunload", h);
|
|
6431
6433
|
};
|
|
6432
6434
|
}, [r]);
|
|
6433
|
-
const i =
|
|
6435
|
+
const i = ae(async () => {
|
|
6434
6436
|
e || (t(!0), await a(), t(!1));
|
|
6435
6437
|
}, [a, e]), { buttonIcon: l, buttonClass: o, tooltipContent: d } = K(() => {
|
|
6436
6438
|
switch (r) {
|
|
@@ -6460,7 +6462,7 @@ const Fu = () => {
|
|
|
6460
6462
|
d
|
|
6461
6463
|
] });
|
|
6462
6464
|
}, ju = () => {
|
|
6463
|
-
const { selectedLang: e } = Fe(), { data: t } =
|
|
6465
|
+
const { selectedLang: e } = Fe(), { data: t } = Rt(), { data: s } = ht(), [a, r] = S(!1), [i, l] = S(!1), [o, d] = S(null), { savePageAsync: h } = Wt(), [u, m] = S(!1), { data: v } = We(), { mutate: p, isPending: y } = ar(), { needTranslations: g } = Wt(), b = g(), { buttonText: x, buttonClassName: N, isPublished: I } = K(() => {
|
|
6464
6466
|
const re = v && (v == null ? void 0 : v.online);
|
|
6465
6467
|
return {
|
|
6466
6468
|
buttonClassName: re ? "hover:bg-green-600 bg-green-500" : "",
|
|
@@ -6475,7 +6477,7 @@ const Fu = () => {
|
|
|
6475
6477
|
k();
|
|
6476
6478
|
}, k = () => {
|
|
6477
6479
|
const re = [t == null ? void 0 : t.id, t == null ? void 0 : t.primaryPage];
|
|
6478
|
-
p({ ids: Ks(re) }, { onSuccess: () =>
|
|
6480
|
+
p({ ids: Ks(re) }, { onSuccess: () => Fn("TOP_RIGHT") });
|
|
6479
6481
|
}, E = () => {
|
|
6480
6482
|
m(!1), k();
|
|
6481
6483
|
}, q = async () => {
|
|
@@ -6528,7 +6530,7 @@ const Fu = () => {
|
|
|
6528
6530
|
{
|
|
6529
6531
|
disabled: y,
|
|
6530
6532
|
className: "cursor-pointer text-xs",
|
|
6531
|
-
onClick: () => p({ ids: Z }, { onSuccess: () =>
|
|
6533
|
+
onClick: () => p({ ids: Z }, { onSuccess: () => Fn("TOP_RIGHT") }),
|
|
6532
6534
|
children: [
|
|
6533
6535
|
oe.PUBLISH,
|
|
6534
6536
|
" with translation pages"
|
|
@@ -6540,7 +6542,7 @@ const Fu = () => {
|
|
|
6540
6542
|
{
|
|
6541
6543
|
disabled: y,
|
|
6542
6544
|
className: "cursor-pointer text-xs",
|
|
6543
|
-
onClick: () => p({ ids: [v == null ? void 0 : v.id] }, { onSuccess: () =>
|
|
6545
|
+
onClick: () => p({ ids: [v == null ? void 0 : v.id] }, { onSuccess: () => Fn("TOP_RIGHT") }),
|
|
6544
6546
|
children: [
|
|
6545
6547
|
oe.PUBLISH,
|
|
6546
6548
|
" page"
|
|
@@ -6653,7 +6655,7 @@ const Ku = ({
|
|
|
6653
6655
|
updateSearchQuery: l,
|
|
6654
6656
|
onChangeLanguage: o
|
|
6655
6657
|
} = ji(), d = tt(void 0);
|
|
6656
|
-
return
|
|
6658
|
+
return ne(() => {
|
|
6657
6659
|
d.current !== a && e && (o(), d.current = a);
|
|
6658
6660
|
}, [a, t]), /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
6659
6661
|
Hu,
|
|
@@ -6666,7 +6668,7 @@ const Ku = ({
|
|
|
6666
6668
|
}
|
|
6667
6669
|
) });
|
|
6668
6670
|
}, Qu = () => {
|
|
6669
|
-
const [e, t] = S(null), [s, a] = S(null), [r, i] = S(null), [l, o] = S(null), [d, h] = S(null), [u, m] = S(null), { data: v, isFetching: p } =
|
|
6671
|
+
const [e, t] = S(null), [s, a] = S(null), [r, i] = S(null), [l, o] = S(null), [d, h] = S(null), [u, m] = S(null), { data: v, isFetching: p } = Rt(), { selectedLang: y, fallbackLang: g } = Fe(), { data: b } = ht(), x = b == null ? void 0 : b.find((E) => E.lang === y), { isLocked: N } = At(), I = !(v != null && v.slug), [, _] = Ue(ys);
|
|
6670
6672
|
if (!v) return null;
|
|
6671
6673
|
const k = (E) => {
|
|
6672
6674
|
y.length > 0 && y !== g ? _({
|
|
@@ -6720,16 +6722,16 @@ const Ku = ({
|
|
|
6720
6722
|
l && /* @__PURE__ */ n(ur, { page: l, onClose: () => o(null) }),
|
|
6721
6723
|
d && /* @__PURE__ */ n(or, { page: d, onClose: () => h(null), closePanel: () => m(null) })
|
|
6722
6724
|
] });
|
|
6723
|
-
}, Ju = ({ hasDynamicPage: e }) => /* @__PURE__ */ n(
|
|
6725
|
+
}, Ju = ({ hasDynamicPage: e }) => /* @__PURE__ */ n(ps, { children: /* @__PURE__ */ c("div", { className: "flex min-w-[300px] max-w-[400px] flex-col items-center justify-center rounded-lg border bg-white p-4 shadow-lg", children: [
|
|
6724
6726
|
/* @__PURE__ */ n("h1", { className: "text-lg font-medium", children: e ? "Select a page" : "No pages found" }),
|
|
6725
6727
|
/* @__PURE__ */ n("p", { className: "pt-2 text-center text-sm font-light text-gray-600", children: e ? "Please select a page from the list in the top header. This will enable you to edit the page." : "Please add a new page" })
|
|
6726
6728
|
] }) }), Yu = () => {
|
|
6727
|
-
const { data: e } =
|
|
6729
|
+
const { data: e } = Rt(), t = tr(), { data: s, isFetching: a } = We(), r = M(s, "dynamic", !1), i = Ot("dynamic-page-selector"), { dynamicPage: l, allLangPages: o } = ji(), d = o.length > 0, h = e == null ? void 0 : e.slug, u = !h, m = zi(), p = (u ? `Partial: ${e == null ? void 0 : e.name} ` : `${h}${t}`).replace(window.location.host, "");
|
|
6728
6730
|
return /* @__PURE__ */ c("div", { className: "relative z-10 flex items-center gap-x-1", children: [
|
|
6729
6731
|
/* @__PURE__ */ n(
|
|
6730
6732
|
"div",
|
|
6731
6733
|
{
|
|
6732
|
-
className:
|
|
6734
|
+
className: zn(
|
|
6733
6735
|
"flex h-8 w-auto max-w-[600px] items-center rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800",
|
|
6734
6736
|
a && "pointer-events-none cursor-not-allowed opacity-50"
|
|
6735
6737
|
),
|
|
@@ -6739,12 +6741,12 @@ const Ku = ({
|
|
|
6739
6741
|
/* @__PURE__ */ c(
|
|
6740
6742
|
"div",
|
|
6741
6743
|
{
|
|
6742
|
-
className:
|
|
6744
|
+
className: zn(
|
|
6743
6745
|
"flex h-8 w-auto max-w-[600px] items-center rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800" + (u ? " pr-2" : ""),
|
|
6744
6746
|
a && "pointer-events-none cursor-not-allowed opacity-50"
|
|
6745
6747
|
),
|
|
6746
6748
|
children: [
|
|
6747
|
-
/* @__PURE__ */ n(
|
|
6749
|
+
/* @__PURE__ */ n(ol, {}),
|
|
6748
6750
|
/* @__PURE__ */ c("div", { className: "flex w-full items-center overflow-hidden", children: [
|
|
6749
6751
|
/* @__PURE__ */ n(
|
|
6750
6752
|
"div",
|
|
@@ -6756,7 +6758,7 @@ const Ku = ({
|
|
|
6756
6758
|
] }) : p
|
|
6757
6759
|
}
|
|
6758
6760
|
),
|
|
6759
|
-
!u && /* @__PURE__ */ n("a", { href: m, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ n("div", { className: "ml-2 mr-px flex-shrink-0 rounded-sm p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300", children: /* @__PURE__ */ n(
|
|
6761
|
+
!u && /* @__PURE__ */ n("a", { href: m, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ n("div", { className: "ml-2 mr-px flex-shrink-0 rounded-sm p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300", children: /* @__PURE__ */ n(gc, { className: "h-4 w-4", strokeWidth: 1 }) }) })
|
|
6760
6762
|
] })
|
|
6761
6763
|
]
|
|
6762
6764
|
}
|
|
@@ -6772,7 +6774,7 @@ const Ku = ({
|
|
|
6772
6774
|
/* @__PURE__ */ n(Vu, {})
|
|
6773
6775
|
] }), Zu = () => {
|
|
6774
6776
|
const e = de(), { aiContext: t } = er(), s = X();
|
|
6775
|
-
return
|
|
6777
|
+
return ae(
|
|
6776
6778
|
async (a, r, i, l) => s(e, {
|
|
6777
6779
|
action: G.ASK_AI,
|
|
6778
6780
|
data: { type: a, prompt: r, blocks: i, context: t, lang: l }
|
|
@@ -6781,24 +6783,24 @@ const Ku = ({
|
|
|
6781
6783
|
);
|
|
6782
6784
|
}, eh = (e, t) => t.map((s) => {
|
|
6783
6785
|
if (_e(e, s._type)) {
|
|
6784
|
-
const a =
|
|
6786
|
+
const a = Oc(s._type);
|
|
6785
6787
|
return {
|
|
6786
6788
|
...a,
|
|
6787
|
-
...
|
|
6788
|
-
...
|
|
6789
|
+
...ms(s, [
|
|
6790
|
+
...mo(a),
|
|
6789
6791
|
"_type",
|
|
6790
6792
|
"_id",
|
|
6791
6793
|
"_name",
|
|
6792
6794
|
"_parent",
|
|
6793
6795
|
"_bindings"
|
|
6794
6796
|
]),
|
|
6795
|
-
...
|
|
6797
|
+
...fo(s, (r, i) => Qr(i, "_attrs")),
|
|
6796
6798
|
...s
|
|
6797
6799
|
};
|
|
6798
6800
|
}
|
|
6799
6801
|
return s;
|
|
6800
6802
|
}), th = (e) => {
|
|
6801
|
-
const t =
|
|
6803
|
+
const t = Dc();
|
|
6802
6804
|
return K(() => {
|
|
6803
6805
|
if (!e || J(e)) return { blocks: [] };
|
|
6804
6806
|
const s = ye(
|
|
@@ -6813,7 +6815,7 @@ const Ku = ({
|
|
|
6813
6815
|
action: "GET_LIBRARY_ITEM",
|
|
6814
6816
|
data: { id: e.id }
|
|
6815
6817
|
}), r = M(a, "html", ""), i = M(a, "blocks", []);
|
|
6816
|
-
return Jr(i) ? i :
|
|
6818
|
+
return Jr(i) ? i : _o(r);
|
|
6817
6819
|
},
|
|
6818
6820
|
async getUILibraryBlocks(e, t, s) {
|
|
6819
6821
|
try {
|
|
@@ -6837,7 +6839,7 @@ const Ku = ({
|
|
|
6837
6839
|
...r
|
|
6838
6840
|
}));
|
|
6839
6841
|
return a.forEach((r) => {
|
|
6840
|
-
|
|
6842
|
+
Io(r.id, {
|
|
6841
6843
|
name: r.isSiteLibrary ? r.name + " (Current Site) " : r.name,
|
|
6842
6844
|
description: r.description,
|
|
6843
6845
|
getBlocksList: (i) => kr.getUILibraryBlocks(i, t, e),
|
|
@@ -6877,9 +6879,9 @@ const Ku = ({
|
|
|
6877
6879
|
}
|
|
6878
6880
|
} };
|
|
6879
6881
|
}, rh = () => {
|
|
6880
|
-
const { data: e } =
|
|
6882
|
+
const { data: e } = vs(), t = de(), s = X();
|
|
6881
6883
|
return {
|
|
6882
|
-
getPartialBlocks:
|
|
6884
|
+
getPartialBlocks: ae(async () => {
|
|
6883
6885
|
const a = {};
|
|
6884
6886
|
for (const r of e ?? [])
|
|
6885
6887
|
J(r == null ? void 0 : r.slug) && (a[r.id] = {
|
|
@@ -6889,7 +6891,7 @@ const Ku = ({
|
|
|
6889
6891
|
});
|
|
6890
6892
|
return a;
|
|
6891
6893
|
}, [e]),
|
|
6892
|
-
getPartialBlockBlocks:
|
|
6894
|
+
getPartialBlockBlocks: ae(
|
|
6893
6895
|
async (a) => {
|
|
6894
6896
|
if (!a) return [];
|
|
6895
6897
|
try {
|
|
@@ -6955,7 +6957,7 @@ const Ku = ({
|
|
|
6955
6957
|
return /* @__PURE__ */ n("div", { className: "flex min-h-screen items-center justify-center bg-slate-50", children: /* @__PURE__ */ c(Qs, { className: "w-full max-w-md", children: [
|
|
6956
6958
|
/* @__PURE__ */ c(Js, { children: [
|
|
6957
6959
|
/* @__PURE__ */ n(Ys, { className: "text-2xl", children: "Sign in" }),
|
|
6958
|
-
/* @__PURE__ */ n(
|
|
6960
|
+
/* @__PURE__ */ n(jo, { children: "Enter your credentials to sign in to visual builder" })
|
|
6959
6961
|
] }),
|
|
6960
6962
|
/* @__PURE__ */ n(Xs, { children: /* @__PURE__ */ c("form", { onSubmit: y, className: "space-y-4", children: [
|
|
6961
6963
|
/* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
@@ -6993,7 +6995,7 @@ const Ku = ({
|
|
|
6993
6995
|
type: "button",
|
|
6994
6996
|
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",
|
|
6995
6997
|
onClick: () => u(!h),
|
|
6996
|
-
children: h ? /* @__PURE__ */ n(
|
|
6998
|
+
children: h ? /* @__PURE__ */ n(pc, { className: "h-4 w-4" }) : /* @__PURE__ */ n(aa, { className: "h-4 w-4" })
|
|
6997
6999
|
}
|
|
6998
7000
|
)
|
|
6999
7001
|
] }),
|
|
@@ -7049,7 +7051,7 @@ const lh = () => K(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7049
7051
|
page: e,
|
|
7050
7052
|
onClose: t
|
|
7051
7053
|
}) => {
|
|
7052
|
-
const [s, a] = S(e.slug || ""), { mutate: r, isPending: i } =
|
|
7054
|
+
const [s, a] = S(e.slug || ""), { mutate: r, isPending: i } = Id(), { data: l } = Ge(), o = ve(l, { key: e == null ? void 0 : e.pageType }), d = (u) => {
|
|
7053
7055
|
if (u.preventDefault(), !(e != null && e.primaryPage) && Object.keys(De).some((p) => s === `/${p}` || nn(s, `/${p}/`))) {
|
|
7054
7056
|
V.error("Error", {
|
|
7055
7057
|
description: "Slugs cannot start with a language code for primary page"
|
|
@@ -7111,7 +7113,7 @@ const lh = () => K(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7111
7113
|
)
|
|
7112
7114
|
] })
|
|
7113
7115
|
] }),
|
|
7114
|
-
/* @__PURE__ */ n(
|
|
7116
|
+
/* @__PURE__ */ n(mt, { children: /* @__PURE__ */ n(
|
|
7115
7117
|
T,
|
|
7116
7118
|
{
|
|
7117
7119
|
type: "submit",
|
|
@@ -7122,7 +7124,7 @@ const lh = () => K(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7122
7124
|
] })
|
|
7123
7125
|
] }) });
|
|
7124
7126
|
}, dh = () => {
|
|
7125
|
-
const [, e] = Ue(
|
|
7127
|
+
const [, e] = Ue(ys), { selectedLang: t, fallbackLang: s, setSelectedLang: a } = Fe(), { data: r, isFetching: i } = ht(), { data: l } = We(), { data: o } = Ge(), d = K(() => {
|
|
7126
7128
|
const x = o == null ? void 0 : o.find((N) => N.key === (l == null ? void 0 : l.pageType));
|
|
7127
7129
|
return l != null && l.dynamic ? x == null ? void 0 : x.dynamicSlug : "";
|
|
7128
7130
|
}, [o, l == null ? void 0 : l.pageType, l == null ? void 0 : l.dynamic]), [h, u] = S(null), [m, v] = S(null), [p, y] = S(null), { data: g } = Et(), b = ye(
|
|
@@ -7164,7 +7166,7 @@ const lh = () => K(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7164
7166
|
] })
|
|
7165
7167
|
] }),
|
|
7166
7168
|
_ ? /* @__PURE__ */ c("div", { className: "flex items-center gap-x-1 text-[11px] text-orange-500", children: [
|
|
7167
|
-
/* @__PURE__ */ n(
|
|
7169
|
+
/* @__PURE__ */ n(yc, { fill: "orange", className: "h-3 w-3" }),
|
|
7168
7170
|
/* @__PURE__ */ n("b", { children: " Primary" })
|
|
7169
7171
|
] }) : /* @__PURE__ */ n("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ n(
|
|
7170
7172
|
lt,
|
|
@@ -7189,7 +7191,7 @@ const lh = () => K(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7189
7191
|
});
|
|
7190
7192
|
},
|
|
7191
7193
|
children: [
|
|
7192
|
-
/* @__PURE__ */ n(
|
|
7194
|
+
/* @__PURE__ */ n(vc, { className: "size-3" }),
|
|
7193
7195
|
oe.EDIT
|
|
7194
7196
|
]
|
|
7195
7197
|
}
|
|
@@ -7215,7 +7217,7 @@ const lh = () => K(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7215
7217
|
E.stopPropagation(), u(x);
|
|
7216
7218
|
},
|
|
7217
7219
|
children: [
|
|
7218
|
-
/* @__PURE__ */ n(
|
|
7220
|
+
/* @__PURE__ */ n(bc, { className: "size-3" }),
|
|
7219
7221
|
oe.DELETE
|
|
7220
7222
|
]
|
|
7221
7223
|
}
|
|
@@ -7255,9 +7257,9 @@ const lh = () => K(() => Ga, [Ga]), Yf = (e) => {
|
|
|
7255
7257
|
show: t
|
|
7256
7258
|
}) => {
|
|
7257
7259
|
const { data: s } = Et();
|
|
7258
|
-
return !_e(s, "languages") || !M(s, "languages", []).length ? null : /* @__PURE__ */ n(T, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ n(
|
|
7259
|
-
},
|
|
7260
|
-
id:
|
|
7260
|
+
return !_e(s, "languages") || !M(s, "languages", []).length ? null : /* @__PURE__ */ n(T, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ n(xc, { className: "w-4 h-4" }) });
|
|
7261
|
+
}, dl = "lang", hh = {
|
|
7262
|
+
id: dl,
|
|
7261
7263
|
label: "Languages",
|
|
7262
7264
|
position: "top",
|
|
7263
7265
|
panel: dh,
|
|
@@ -7302,13 +7304,13 @@ function Pt({
|
|
|
7302
7304
|
role: "combobox",
|
|
7303
7305
|
"aria-expanded": r,
|
|
7304
7306
|
disabled: a,
|
|
7305
|
-
children: /* @__PURE__ */ n(
|
|
7307
|
+
children: /* @__PURE__ */ n(wc, { className: "h-3 w-3" })
|
|
7306
7308
|
}
|
|
7307
7309
|
) }) }),
|
|
7308
7310
|
/* @__PURE__ */ n(et, { children: "Add field" })
|
|
7309
7311
|
] }),
|
|
7310
|
-
/* @__PURE__ */ n(En, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ c(
|
|
7311
|
-
/* @__PURE__ */ n(
|
|
7312
|
+
/* @__PURE__ */ n(En, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ c(Vn, { children: [
|
|
7313
|
+
/* @__PURE__ */ n(zo, { className: "border-none", placeholder: "Search..." }),
|
|
7312
7314
|
/* @__PURE__ */ c(
|
|
7313
7315
|
ci,
|
|
7314
7316
|
{
|
|
@@ -7322,10 +7324,10 @@ function Pt({
|
|
|
7322
7324
|
}
|
|
7323
7325
|
},
|
|
7324
7326
|
children: [
|
|
7325
|
-
/* @__PURE__ */ n(
|
|
7327
|
+
/* @__PURE__ */ n(Kn, { children: "No option found." }),
|
|
7326
7328
|
/* @__PURE__ */ c(It, { children: [
|
|
7327
7329
|
l.length > 0 && /* @__PURE__ */ c(
|
|
7328
|
-
|
|
7330
|
+
gt,
|
|
7329
7331
|
{
|
|
7330
7332
|
onSelect: v,
|
|
7331
7333
|
className: "flex items-center text-sm",
|
|
@@ -7336,7 +7338,7 @@ function Pt({
|
|
|
7336
7338
|
}
|
|
7337
7339
|
),
|
|
7338
7340
|
p.map((y) => /* @__PURE__ */ c(
|
|
7339
|
-
|
|
7341
|
+
gt,
|
|
7340
7342
|
{
|
|
7341
7343
|
onSelect: () => m(y),
|
|
7342
7344
|
className: "flex items-center justify-between",
|
|
@@ -7369,7 +7371,7 @@ function Pt({
|
|
|
7369
7371
|
] });
|
|
7370
7372
|
}
|
|
7371
7373
|
const mh = () => {
|
|
7372
|
-
const { selectedLang: e } = Fe(), { data: t, isFetching: s } =
|
|
7374
|
+
const { selectedLang: e } = Fe(), { data: t, isFetching: s } = ht();
|
|
7373
7375
|
return { data: K(() => ve(t, { lang: e || "" }) || {}, [t, e]), isFetching: s };
|
|
7374
7376
|
}, fh = () => {
|
|
7375
7377
|
var l;
|
|
@@ -7395,7 +7397,7 @@ const mh = () => {
|
|
|
7395
7397
|
onComplete: t,
|
|
7396
7398
|
field: s
|
|
7397
7399
|
}) => {
|
|
7398
|
-
const a = X(), r = de(), { selectedLang: i, fallbackLang: l } = Fe(), o =
|
|
7400
|
+
const a = X(), r = de(), { selectedLang: i, fallbackLang: l } = Fe(), o = Lo("aiContext", ""), { mutate: d, isPending: h } = Pe({
|
|
7399
7401
|
mutationFn: async () => {
|
|
7400
7402
|
const u = fh();
|
|
7401
7403
|
return await a(r, {
|
|
@@ -7426,7 +7428,7 @@ const mh = () => {
|
|
|
7426
7428
|
variant: "ghost",
|
|
7427
7429
|
size: "sm",
|
|
7428
7430
|
onClick: () => d(),
|
|
7429
|
-
children: h ? /* @__PURE__ */ n(Di, { className: "h-3 w-3 animate-spin text-yellow-500" }) : /* @__PURE__ */ n(
|
|
7431
|
+
children: h ? /* @__PURE__ */ n(Di, { className: "h-3 w-3 animate-spin text-yellow-500" }) : /* @__PURE__ */ n(Nc, { className: "text-yellow-500" })
|
|
7430
7432
|
}
|
|
7431
7433
|
);
|
|
7432
7434
|
}, gh = ({
|
|
@@ -7518,7 +7520,7 @@ const mh = () => {
|
|
|
7518
7520
|
handleFieldInsert: d
|
|
7519
7521
|
}) => {
|
|
7520
7522
|
const [h, u] = S("edit"), [m, v] = S(null), [p, y] = S(""), g = tt(null);
|
|
7521
|
-
|
|
7523
|
+
ne(() => {
|
|
7522
7524
|
e.trim() === "" && t("{}");
|
|
7523
7525
|
}, [e, t]);
|
|
7524
7526
|
const b = (_) => {
|
|
@@ -7534,14 +7536,14 @@ const mh = () => {
|
|
|
7534
7536
|
`);
|
|
7535
7537
|
if (_.shiftKey) {
|
|
7536
7538
|
const U = re.map((R) => R.startsWith(" ") ? R.substring(2) : R).join(`
|
|
7537
|
-
`),
|
|
7538
|
-
t(
|
|
7539
|
+
`), $ = e.substring(0, E) + U + e.substring(q);
|
|
7540
|
+
t($), setTimeout(() => {
|
|
7539
7541
|
k.selectionStart = E, k.selectionEnd = E + U.length;
|
|
7540
7542
|
}, 0);
|
|
7541
7543
|
} else {
|
|
7542
7544
|
const U = re.map((R) => ` ${R}`).join(`
|
|
7543
|
-
`),
|
|
7544
|
-
t(
|
|
7545
|
+
`), $ = e.substring(0, E) + U + e.substring(q);
|
|
7546
|
+
t($), setTimeout(() => {
|
|
7545
7547
|
k.selectionStart = E, k.selectionEnd = E + U.length;
|
|
7546
7548
|
}, 0);
|
|
7547
7549
|
}
|
|
@@ -7553,7 +7555,7 @@ const mh = () => {
|
|
|
7553
7555
|
}
|
|
7554
7556
|
}
|
|
7555
7557
|
};
|
|
7556
|
-
|
|
7558
|
+
ne(() => {
|
|
7557
7559
|
const _ = Ir(e);
|
|
7558
7560
|
if (_.isValid)
|
|
7559
7561
|
if (v(null), _.parsed) {
|
|
@@ -7576,12 +7578,12 @@ const mh = () => {
|
|
|
7576
7578
|
return /* @__PURE__ */ n("div", { className: "space-y-2", children: /* @__PURE__ */ c(yi, { value: h, onValueChange: u, className: "w-full", children: [
|
|
7577
7579
|
/* @__PURE__ */ c("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
7578
7580
|
/* @__PURE__ */ c(vi, { className: "grid w-[200px] grid-cols-2", children: [
|
|
7579
|
-
/* @__PURE__ */ c(
|
|
7580
|
-
/* @__PURE__ */ n(
|
|
7581
|
+
/* @__PURE__ */ c(Bn, { value: "edit", className: "flex items-center gap-1", children: [
|
|
7582
|
+
/* @__PURE__ */ n(Ec, { className: "h-4 w-4" }),
|
|
7581
7583
|
/* @__PURE__ */ n("span", { children: "Edit" })
|
|
7582
7584
|
] }),
|
|
7583
7585
|
/* @__PURE__ */ c(
|
|
7584
|
-
|
|
7586
|
+
Bn,
|
|
7585
7587
|
{
|
|
7586
7588
|
value: "preview",
|
|
7587
7589
|
className: "flex items-center gap-1",
|
|
@@ -7615,7 +7617,7 @@ const mh = () => {
|
|
|
7615
7617
|
)
|
|
7616
7618
|
] })
|
|
7617
7619
|
] }),
|
|
7618
|
-
/* @__PURE__ */ c(
|
|
7620
|
+
/* @__PURE__ */ c(Mn, { value: "edit", className: "mt-0", children: [
|
|
7619
7621
|
/* @__PURE__ */ n(
|
|
7620
7622
|
Sn,
|
|
7621
7623
|
{
|
|
@@ -7657,7 +7659,7 @@ const mh = () => {
|
|
|
7657
7659
|
] })
|
|
7658
7660
|
] })
|
|
7659
7661
|
] }),
|
|
7660
|
-
/* @__PURE__ */ c(
|
|
7662
|
+
/* @__PURE__ */ c(Mn, { value: "preview", className: "mt-0", children: [
|
|
7661
7663
|
/* @__PURE__ */ n(Sn, { rows: i, value: p, readOnly: !0, className: "cursor-default bg-muted font-mono text-sm" }),
|
|
7662
7664
|
/* @__PURE__ */ n("p", { className: "mt-1 text-xs text-muted-foreground", children: "This is how the JSON will look after placeholder substitution." })
|
|
7663
7665
|
] })
|
|
@@ -7676,8 +7678,8 @@ const mh = () => {
|
|
|
7676
7678
|
value: d,
|
|
7677
7679
|
newCursorPos: h
|
|
7678
7680
|
};
|
|
7679
|
-
},
|
|
7680
|
-
const { t: e } =
|
|
7681
|
+
}, ul = () => {
|
|
7682
|
+
const { t: e } = Do(), [, t] = Ws(), { data: s } = We(), { data: a } = Wi(), { data: r, isFetching: i } = mh(), l = r == null ? void 0 : r.seo, o = tt(null), d = s == null ? void 0 : s.id, h = s == null ? void 0 : s.pageType, u = Yi(h), { selectedLang: m, fallbackLang: v } = Fe(), p = m || v, [y, g] = S(!1), [b, x] = S(!1), [N, I] = S(!1), [_, k] = S(null), [E, q] = S({
|
|
7681
7683
|
keyword: "",
|
|
7682
7684
|
title: "",
|
|
7683
7685
|
description: "",
|
|
@@ -7693,8 +7695,8 @@ const mh = () => {
|
|
|
7693
7695
|
jsonLD: "{}",
|
|
7694
7696
|
metaOther: "{}",
|
|
7695
7697
|
...l
|
|
7696
|
-
}), Z = tt({}), { mutate: re, isPending: L } = sr(), U = L || y || b, { hasPermission:
|
|
7697
|
-
|
|
7698
|
+
}), Z = tt({}), { mutate: re, isPending: L } = sr(), U = L || y || b, { hasPermission: $ } = kn(), R = $(Ce.EDIT_SEO);
|
|
7699
|
+
ne(() => {
|
|
7698
7700
|
if (!i && l && d) {
|
|
7699
7701
|
const f = {
|
|
7700
7702
|
keyword: "",
|
|
@@ -7715,7 +7717,7 @@ const mh = () => {
|
|
|
7715
7717
|
};
|
|
7716
7718
|
q(f), Z.current[p] = f;
|
|
7717
7719
|
}
|
|
7718
|
-
}, [i, l, p, d]),
|
|
7720
|
+
}, [i, l, p, d]), ne(() => {
|
|
7719
7721
|
const f = (P) => {
|
|
7720
7722
|
const { fromLang: B, toLang: A, switchHandler: O } = P.detail, W = Z.current[p];
|
|
7721
7723
|
(W ? !Us(W, E) : !1) ? (k({ fromLang: B, toLang: A, switchHandler: O }), I(!0)) : O();
|
|
@@ -7802,12 +7804,12 @@ const mh = () => {
|
|
|
7802
7804
|
const ue = document.getElementById(P);
|
|
7803
7805
|
ue && (ue.focus(), ue.setSelectionRange(O, O));
|
|
7804
7806
|
}, Q);
|
|
7805
|
-
})) : (q((
|
|
7806
|
-
|
|
7807
|
+
})) : (q((F) => ({
|
|
7808
|
+
...F,
|
|
7807
7809
|
[B.name]: A
|
|
7808
7810
|
})), requestAnimationFrame(() => {
|
|
7809
|
-
const
|
|
7810
|
-
|
|
7811
|
+
const F = document.getElementById(P);
|
|
7812
|
+
F && (F.focus(), F.setSelectionRange(O, O), setTimeout(() => {
|
|
7811
7813
|
const Q = document.getElementById(P);
|
|
7812
7814
|
Q && (Q.focus(), Q.setSelectionRange(O, O));
|
|
7813
7815
|
}, 50));
|
|
@@ -7840,15 +7842,15 @@ const mh = () => {
|
|
|
7840
7842
|
/* @__PURE__ */ n("div", { className: "font-medium", children: r == null ? void 0 : r.name }),
|
|
7841
7843
|
/* @__PURE__ */ n("span", { className: "font-mono text-xs leading-tight text-gray-500", children: r == null ? void 0 : r.slug })
|
|
7842
7844
|
] }),
|
|
7843
|
-
/* @__PURE__ */ n(
|
|
7845
|
+
/* @__PURE__ */ n(ol, { variant: "outline", showAdd: !1 })
|
|
7844
7846
|
] }),
|
|
7845
7847
|
/* @__PURE__ */ n("form", { className: "space-y-8", children: /* @__PURE__ */ c(yi, { defaultValue: "seo", className: "w-full", children: [
|
|
7846
7848
|
/* @__PURE__ */ c(vi, { className: "mb-4 grid w-full grid-cols-3", children: [
|
|
7847
|
-
/* @__PURE__ */ n(
|
|
7848
|
-
/* @__PURE__ */ n(
|
|
7849
|
-
/* @__PURE__ */ n(
|
|
7849
|
+
/* @__PURE__ */ n(Bn, { value: "seo", children: e("SEO") }),
|
|
7850
|
+
/* @__PURE__ */ n(Bn, { value: "opengraph", children: e("Meta Tags") }),
|
|
7851
|
+
/* @__PURE__ */ n(Bn, { value: "jsonld", children: e("JSON-LD") })
|
|
7850
7852
|
] }),
|
|
7851
|
-
/* @__PURE__ */ n(
|
|
7853
|
+
/* @__PURE__ */ n(Mn, { value: "seo", children: /* @__PURE__ */ c("div", { className: "space-y-4", children: [
|
|
7852
7854
|
R && /* @__PURE__ */ n("div", { className: "mb-4 flex justify-end", children: /* @__PURE__ */ n(
|
|
7853
7855
|
T,
|
|
7854
7856
|
{
|
|
@@ -8013,7 +8015,7 @@ const mh = () => {
|
|
|
8013
8015
|
/* @__PURE__ */ n("p", { className: "text-[10px] font-light leading-4 text-gray-400", children: e("Check this if you don't want search engines to follow links on this page.") })
|
|
8014
8016
|
] })
|
|
8015
8017
|
] }) }),
|
|
8016
|
-
/* @__PURE__ */ n(
|
|
8018
|
+
/* @__PURE__ */ n(Mn, { value: "opengraph", children: /* @__PURE__ */ c("div", { className: "space-y-4", children: [
|
|
8017
8019
|
R && /* @__PURE__ */ n("div", { className: "mb-4 flex justify-end", children: /* @__PURE__ */ n(
|
|
8018
8020
|
T,
|
|
8019
8021
|
{
|
|
@@ -8170,7 +8172,7 @@ const mh = () => {
|
|
|
8170
8172
|
] })
|
|
8171
8173
|
] })
|
|
8172
8174
|
] }) }),
|
|
8173
|
-
/* @__PURE__ */ n(
|
|
8175
|
+
/* @__PURE__ */ n(Mn, { value: "jsonld", children: /* @__PURE__ */ c("div", { className: "space-y-4", children: [
|
|
8174
8176
|
R && /* @__PURE__ */ n("div", { className: "mb-4 flex justify-end", children: /* @__PURE__ */ n(
|
|
8175
8177
|
T,
|
|
8176
8178
|
{
|
|
@@ -8253,24 +8255,24 @@ const mh = () => {
|
|
|
8253
8255
|
)
|
|
8254
8256
|
] });
|
|
8255
8257
|
};
|
|
8256
|
-
|
|
8257
|
-
const
|
|
8258
|
-
const { data: s } = We(), a =
|
|
8258
|
+
ul.displayName = "SeoPanel";
|
|
8259
|
+
const hl = "seo", xh = ({ isActive: e, show: t }) => {
|
|
8260
|
+
const { data: s } = We(), a = Yi(s == null ? void 0 : s.pageType);
|
|
8259
8261
|
return !_e(a, "hasSlug") || !a.hasSlug ? null : /* @__PURE__ */ n(T, { size: "sm", className: "my-1", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ c("svg", { className: "h-4 w-4", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 21 21", fill: "currentColor", children: [
|
|
8260
8262
|
/* @__PURE__ */ n("path", { d: "M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249" }),
|
|
8261
8263
|
/* @__PURE__ */ n("path", { d: "M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z" })
|
|
8262
8264
|
] }) });
|
|
8263
8265
|
}, wh = {
|
|
8264
|
-
id:
|
|
8266
|
+
id: hl,
|
|
8265
8267
|
label: "SEO",
|
|
8266
|
-
panel:
|
|
8268
|
+
panel: ul,
|
|
8267
8269
|
button: xh,
|
|
8268
8270
|
position: "top",
|
|
8269
8271
|
width: 600,
|
|
8270
8272
|
view: "modal"
|
|
8271
8273
|
}, Ua = {}, Na = (e, t) => {
|
|
8272
|
-
_e(Ua, e) && console.warn(`Site setting ${e} already registered. Overriding...`),
|
|
8273
|
-
}, Nh = () =>
|
|
8274
|
+
_e(Ua, e) && console.warn(`Site setting ${e} already registered. Overriding...`), pt(Ua, e, { id: e, ...t });
|
|
8275
|
+
}, Nh = () => go(Ua), Eh = () => {
|
|
8274
8276
|
var i;
|
|
8275
8277
|
const e = Nh(), [t, s] = S(((i = e[0]) == null ? void 0 : i.id) || ""), a = e.find((l) => l.id === t), r = a == null ? void 0 : a.panel;
|
|
8276
8278
|
return /* @__PURE__ */ c("div", { className: "flex h-full gap-4", children: [
|
|
@@ -8296,9 +8298,9 @@ const ml = "seo", xh = ({ isActive: e, show: t }) => {
|
|
|
8296
8298
|
view: "modal"
|
|
8297
8299
|
}, Ch = "user-info", kh = () => {
|
|
8298
8300
|
const { user: e, logout: t } = ot(), s = ct("onLogout", Kr);
|
|
8299
|
-
return e ? /* @__PURE__ */ c(
|
|
8300
|
-
/* @__PURE__ */ n(
|
|
8301
|
-
/* @__PURE__ */ c(
|
|
8301
|
+
return e ? /* @__PURE__ */ c(Vo, { children: [
|
|
8302
|
+
/* @__PURE__ */ n(Ko, { asChild: !0, children: /* @__PURE__ */ n(T, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ n(Sc, { className: "h-4 w-4" }) }) }),
|
|
8303
|
+
/* @__PURE__ */ c(Ho, { className: "w-auto space-y-2 p-4", children: [
|
|
8302
8304
|
/* @__PURE__ */ n("div", { className: "text-sm font-medium", children: e.name ?? e.email }),
|
|
8303
8305
|
/* @__PURE__ */ n("div", { className: "text-xs text-muted-foreground", children: e.email }),
|
|
8304
8306
|
/* @__PURE__ */ c(ei, { children: [
|
|
@@ -8314,7 +8316,7 @@ const ml = "seo", xh = ({ isActive: e, show: t }) => {
|
|
|
8314
8316
|
oi,
|
|
8315
8317
|
{
|
|
8316
8318
|
onClick: () => {
|
|
8317
|
-
t(),
|
|
8319
|
+
t(), po(s) && s();
|
|
8318
8320
|
},
|
|
8319
8321
|
children: "Logout"
|
|
8320
8322
|
}
|
|
@@ -8330,9 +8332,9 @@ const ml = "seo", xh = ({ isActive: e, show: t }) => {
|
|
|
8330
8332
|
button: kh,
|
|
8331
8333
|
position: "bottom"
|
|
8332
8334
|
}, Ih = () => {
|
|
8333
|
-
Ts(
|
|
8335
|
+
Ts(hl, wh), Ts(dl, hh), Ts("site-settings", Th), Ts("user-info", Ph);
|
|
8334
8336
|
};
|
|
8335
|
-
var
|
|
8337
|
+
var se = {
|
|
8336
8338
|
context: void 0,
|
|
8337
8339
|
registry: void 0,
|
|
8338
8340
|
effects: void 0,
|
|
@@ -8346,26 +8348,26 @@ var ne = {
|
|
|
8346
8348
|
};
|
|
8347
8349
|
function Dr(e) {
|
|
8348
8350
|
const t = String(e), s = t.length - 1;
|
|
8349
|
-
return
|
|
8351
|
+
return se.context.id + (s ? String.fromCharCode(96 + s) : "") + t;
|
|
8350
8352
|
}
|
|
8351
|
-
function
|
|
8352
|
-
|
|
8353
|
+
function Un(e) {
|
|
8354
|
+
se.context = e;
|
|
8353
8355
|
}
|
|
8354
|
-
var
|
|
8356
|
+
var ml = !1, _h = (e, t) => e === t, Fs = Symbol("solid-proxy"), fl = typeof Proxy == "function", gl = Symbol("solid-track"), $s = {
|
|
8355
8357
|
equals: _h
|
|
8356
|
-
},
|
|
8358
|
+
}, pl = El, Tt = 1, qs = 2, yl = {
|
|
8357
8359
|
owned: null,
|
|
8358
8360
|
cleanups: null,
|
|
8359
8361
|
context: null,
|
|
8360
8362
|
owner: null
|
|
8361
8363
|
}, Ea = {}, ge = null, Sa = null, Lh = null, Ae = null, Qe = null, bt = null, da = 0;
|
|
8362
8364
|
function Kt(e, t) {
|
|
8363
|
-
const s = Ae, a = ge, r = e.length === 0, i = t === void 0 ? a : t, l = r ?
|
|
8365
|
+
const s = Ae, a = ge, r = e.length === 0, i = t === void 0 ? a : t, l = r ? yl : {
|
|
8364
8366
|
owned: null,
|
|
8365
8367
|
cleanups: null,
|
|
8366
8368
|
context: i ? i.context : null,
|
|
8367
8369
|
owner: i
|
|
8368
|
-
}, o = r ? e : () => e(() => qe(() =>
|
|
8370
|
+
}, o = r ? e : () => e(() => qe(() => Jn(l)));
|
|
8369
8371
|
ge = l, Ae = null;
|
|
8370
8372
|
try {
|
|
8371
8373
|
return yt(o, !0);
|
|
@@ -8380,26 +8382,26 @@ function Le(e, t) {
|
|
|
8380
8382
|
observers: null,
|
|
8381
8383
|
observerSlots: null,
|
|
8382
8384
|
comparator: t.equals || void 0
|
|
8383
|
-
}, a = (r) => (typeof r == "function" && (r = r(s.value)),
|
|
8384
|
-
return [
|
|
8385
|
+
}, a = (r) => (typeof r == "function" && (r = r(s.value)), Nl(s, r));
|
|
8386
|
+
return [wl.bind(s), a];
|
|
8385
8387
|
}
|
|
8386
8388
|
function Dh(e, t, s) {
|
|
8387
8389
|
const a = ua(e, t, !0, Tt);
|
|
8388
|
-
|
|
8390
|
+
On(a);
|
|
8389
8391
|
}
|
|
8390
8392
|
function Ht(e, t, s) {
|
|
8391
8393
|
const a = ua(e, t, !1, Tt);
|
|
8392
|
-
|
|
8394
|
+
On(a);
|
|
8393
8395
|
}
|
|
8394
|
-
function
|
|
8395
|
-
|
|
8396
|
+
function vl(e, t, s) {
|
|
8397
|
+
pl = qh;
|
|
8396
8398
|
const a = ua(e, t, !1, Tt);
|
|
8397
|
-
(!s || !s.render) && (a.user = !0), bt ? bt.push(a) :
|
|
8399
|
+
(!s || !s.render) && (a.user = !0), bt ? bt.push(a) : On(a);
|
|
8398
8400
|
}
|
|
8399
8401
|
function Me(e, t, s) {
|
|
8400
8402
|
s = s ? Object.assign({}, $s, s) : $s;
|
|
8401
8403
|
const a = ua(e, t, !0, 0);
|
|
8402
|
-
return a.observers = null, a.observerSlots = null, a.comparator = s.equals || void 0,
|
|
8404
|
+
return a.observers = null, a.observerSlots = null, a.comparator = s.equals || void 0, On(a), wl.bind(a);
|
|
8403
8405
|
}
|
|
8404
8406
|
function Oh(e) {
|
|
8405
8407
|
return e && typeof e == "object" && "then" in e;
|
|
@@ -8411,22 +8413,22 @@ function Rh(e, t, s) {
|
|
|
8411
8413
|
const v = /* @__PURE__ */ new Set(), [p, y] = (i.storage || Le)(i.initialValue), [g, b] = Le(void 0), [x, N] = Le(void 0, {
|
|
8412
8414
|
equals: !1
|
|
8413
8415
|
}), [I, _] = Le(u ? "ready" : "unresolved");
|
|
8414
|
-
|
|
8415
|
-
function k(L, U,
|
|
8416
|
+
se.context && (d = se.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : se.load && se.has(d) && (o = se.load(d)));
|
|
8417
|
+
function k(L, U, $, R) {
|
|
8416
8418
|
return l === L && (l = null, R !== void 0 && (u = !0), (L === o || U === o) && i.onHydrated && queueMicrotask(() => i.onHydrated(R, {
|
|
8417
8419
|
value: U
|
|
8418
|
-
})), o = Ea, E(U,
|
|
8420
|
+
})), o = Ea, E(U, $)), U;
|
|
8419
8421
|
}
|
|
8420
8422
|
function E(L, U) {
|
|
8421
8423
|
yt(() => {
|
|
8422
8424
|
U === void 0 && y(() => L), _(U !== void 0 ? "errored" : u ? "ready" : "unresolved"), b(U);
|
|
8423
|
-
for (const
|
|
8425
|
+
for (const $ of v.keys()) $.decrement();
|
|
8424
8426
|
v.clear();
|
|
8425
8427
|
}, !1);
|
|
8426
8428
|
}
|
|
8427
8429
|
function q() {
|
|
8428
|
-
const L = Mh, U = p(),
|
|
8429
|
-
if (
|
|
8430
|
+
const L = Mh, U = p(), $ = g();
|
|
8431
|
+
if ($ !== void 0 && !l) throw $;
|
|
8430
8432
|
return Ae && Ae.user, U;
|
|
8431
8433
|
}
|
|
8432
8434
|
function Z(L = !0) {
|
|
@@ -8437,7 +8439,7 @@ function Rh(e, t, s) {
|
|
|
8437
8439
|
k(l, qe(p));
|
|
8438
8440
|
return;
|
|
8439
8441
|
}
|
|
8440
|
-
let
|
|
8442
|
+
let $;
|
|
8441
8443
|
const R = o !== Ea ? o : qe(() => {
|
|
8442
8444
|
try {
|
|
8443
8445
|
return r(U, {
|
|
@@ -8445,11 +8447,11 @@ function Rh(e, t, s) {
|
|
|
8445
8447
|
refetching: L
|
|
8446
8448
|
});
|
|
8447
8449
|
} catch (H) {
|
|
8448
|
-
|
|
8450
|
+
$ = H;
|
|
8449
8451
|
}
|
|
8450
8452
|
});
|
|
8451
|
-
if (
|
|
8452
|
-
k(l, void 0, Rs(
|
|
8453
|
+
if ($ !== void 0) {
|
|
8454
|
+
k(l, void 0, Rs($), U);
|
|
8453
8455
|
return;
|
|
8454
8456
|
} else if (!Oh(R))
|
|
8455
8457
|
return k(l, R, void 0, U), R;
|
|
@@ -8481,7 +8483,7 @@ function Rh(e, t, s) {
|
|
|
8481
8483
|
});
|
|
8482
8484
|
let re = ge;
|
|
8483
8485
|
return m ? Dh(() => (re = ge, Z(!1))) : Z(!1), [q, {
|
|
8484
|
-
refetch: (L) =>
|
|
8486
|
+
refetch: (L) => bl(re, () => Z(L)),
|
|
8485
8487
|
mutate: y
|
|
8486
8488
|
}];
|
|
8487
8489
|
}
|
|
@@ -8514,15 +8516,15 @@ function Zf(e, t, s) {
|
|
|
8514
8516
|
};
|
|
8515
8517
|
}
|
|
8516
8518
|
function Gh(e) {
|
|
8517
|
-
|
|
8519
|
+
vl(() => qe(e));
|
|
8518
8520
|
}
|
|
8519
|
-
function
|
|
8521
|
+
function Qn(e) {
|
|
8520
8522
|
return ge === null || (ge.cleanups === null ? ge.cleanups = [e] : ge.cleanups.push(e)), e;
|
|
8521
8523
|
}
|
|
8522
8524
|
function Or() {
|
|
8523
8525
|
return ge;
|
|
8524
8526
|
}
|
|
8525
|
-
function
|
|
8527
|
+
function bl(e, t) {
|
|
8526
8528
|
const s = ge, a = Ae;
|
|
8527
8529
|
ge = e, Ae = null;
|
|
8528
8530
|
try {
|
|
@@ -8557,7 +8559,7 @@ function sg(e) {
|
|
|
8557
8559
|
let t;
|
|
8558
8560
|
return ge && ge.context && (t = ge.context[e.id]) !== void 0 ? t : e.defaultValue;
|
|
8559
8561
|
}
|
|
8560
|
-
function
|
|
8562
|
+
function xl(e) {
|
|
8561
8563
|
const t = Me(e), s = Me(() => Ba(t()));
|
|
8562
8564
|
return s.toArray = () => {
|
|
8563
8565
|
const a = s();
|
|
@@ -8565,9 +8567,9 @@ function wl(e) {
|
|
|
8565
8567
|
}, s;
|
|
8566
8568
|
}
|
|
8567
8569
|
var Mh;
|
|
8568
|
-
function
|
|
8570
|
+
function wl() {
|
|
8569
8571
|
if (this.sources && this.state)
|
|
8570
|
-
if (this.state === Tt)
|
|
8572
|
+
if (this.state === Tt) On(this);
|
|
8571
8573
|
else {
|
|
8572
8574
|
const e = Qe;
|
|
8573
8575
|
Qe = null, yt(() => zs(this), !1), Qe = e;
|
|
@@ -8578,20 +8580,20 @@ function Nl() {
|
|
|
8578
8580
|
}
|
|
8579
8581
|
return this.value;
|
|
8580
8582
|
}
|
|
8581
|
-
function
|
|
8583
|
+
function Nl(e, t, s) {
|
|
8582
8584
|
let a = e.value;
|
|
8583
8585
|
return (!e.comparator || !e.comparator(a, t)) && (e.value = t, e.observers && e.observers.length && yt(() => {
|
|
8584
8586
|
for (let r = 0; r < e.observers.length; r += 1) {
|
|
8585
8587
|
const i = e.observers[r], l = Sa && Sa.running;
|
|
8586
|
-
l && Sa.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Qe.push(i) : bt.push(i), i.observers &&
|
|
8588
|
+
l && Sa.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Qe.push(i) : bt.push(i), i.observers && Sl(i)), l || (i.state = Tt);
|
|
8587
8589
|
}
|
|
8588
8590
|
if (Qe.length > 1e6)
|
|
8589
8591
|
throw Qe = [], new Error();
|
|
8590
8592
|
}, !1)), t;
|
|
8591
8593
|
}
|
|
8592
|
-
function
|
|
8594
|
+
function On(e) {
|
|
8593
8595
|
if (!e.fn) return;
|
|
8594
|
-
|
|
8596
|
+
Jn(e);
|
|
8595
8597
|
const t = da;
|
|
8596
8598
|
Fh(e, e.value, t);
|
|
8597
8599
|
}
|
|
@@ -8602,11 +8604,11 @@ function Fh(e, t, s) {
|
|
|
8602
8604
|
try {
|
|
8603
8605
|
a = e.fn(t);
|
|
8604
8606
|
} catch (l) {
|
|
8605
|
-
return e.pure && (e.state = Tt, e.owned && e.owned.forEach(
|
|
8607
|
+
return e.pure && (e.state = Tt, e.owned && e.owned.forEach(Jn), e.owned = null), e.updatedAt = s + 1, mr(l);
|
|
8606
8608
|
} finally {
|
|
8607
8609
|
Ae = i, ge = r;
|
|
8608
8610
|
}
|
|
8609
|
-
(!e.updatedAt || e.updatedAt <= s) && (e.updatedAt != null && "observers" in e ?
|
|
8611
|
+
(!e.updatedAt || e.updatedAt <= s) && (e.updatedAt != null && "observers" in e ? Nl(e, a) : e.value = a, e.updatedAt = s);
|
|
8610
8612
|
}
|
|
8611
8613
|
function ua(e, t, s, a = Tt, r) {
|
|
8612
8614
|
const i = {
|
|
@@ -8622,7 +8624,7 @@ function ua(e, t, s, a = Tt, r) {
|
|
|
8622
8624
|
context: ge ? ge.context : null,
|
|
8623
8625
|
pure: s
|
|
8624
8626
|
};
|
|
8625
|
-
return ge === null || ge !==
|
|
8627
|
+
return ge === null || ge !== yl && (ge.owned ? ge.owned.push(i) : ge.owned = [i]), i;
|
|
8626
8628
|
}
|
|
8627
8629
|
function js(e) {
|
|
8628
8630
|
if (e.state === 0) return;
|
|
@@ -8633,7 +8635,7 @@ function js(e) {
|
|
|
8633
8635
|
e.state && t.push(e);
|
|
8634
8636
|
for (let s = t.length - 1; s >= 0; s--)
|
|
8635
8637
|
if (e = t[s], e.state === Tt)
|
|
8636
|
-
|
|
8638
|
+
On(e);
|
|
8637
8639
|
else if (e.state === qs) {
|
|
8638
8640
|
const a = Qe;
|
|
8639
8641
|
Qe = null, yt(() => zs(e, t[0]), !1), Qe = a;
|
|
@@ -8651,11 +8653,11 @@ function yt(e, t) {
|
|
|
8651
8653
|
}
|
|
8652
8654
|
}
|
|
8653
8655
|
function $h(e) {
|
|
8654
|
-
if (Qe && (
|
|
8656
|
+
if (Qe && (El(Qe), Qe = null), e) return;
|
|
8655
8657
|
const t = bt;
|
|
8656
|
-
bt = null, t.length && yt(() =>
|
|
8658
|
+
bt = null, t.length && yt(() => pl(t), !1);
|
|
8657
8659
|
}
|
|
8658
|
-
function
|
|
8660
|
+
function El(e) {
|
|
8659
8661
|
for (let t = 0; t < e.length; t++) js(e[t]);
|
|
8660
8662
|
}
|
|
8661
8663
|
function qh(e) {
|
|
@@ -8664,14 +8666,14 @@ function qh(e) {
|
|
|
8664
8666
|
const a = e[t];
|
|
8665
8667
|
a.user ? e[s++] = a : js(a);
|
|
8666
8668
|
}
|
|
8667
|
-
if (
|
|
8668
|
-
if (
|
|
8669
|
-
|
|
8669
|
+
if (se.context) {
|
|
8670
|
+
if (se.count) {
|
|
8671
|
+
se.effects || (se.effects = []), se.effects.push(...e.slice(0, s));
|
|
8670
8672
|
return;
|
|
8671
8673
|
}
|
|
8672
|
-
|
|
8674
|
+
Un();
|
|
8673
8675
|
}
|
|
8674
|
-
for (
|
|
8676
|
+
for (se.effects && (se.done || !se.count) && (e = [...se.effects, ...e], s += se.effects.length, delete se.effects), t = 0; t < s; t++) js(e[t]);
|
|
8675
8677
|
}
|
|
8676
8678
|
function zs(e, t) {
|
|
8677
8679
|
e.state = 0;
|
|
@@ -8683,13 +8685,13 @@ function zs(e, t) {
|
|
|
8683
8685
|
}
|
|
8684
8686
|
}
|
|
8685
8687
|
}
|
|
8686
|
-
function
|
|
8688
|
+
function Sl(e) {
|
|
8687
8689
|
for (let t = 0; t < e.observers.length; t += 1) {
|
|
8688
8690
|
const s = e.observers[t];
|
|
8689
|
-
s.state || (s.state = qs, s.pure ? Qe.push(s) : bt.push(s), s.observers &&
|
|
8691
|
+
s.state || (s.state = qs, s.pure ? Qe.push(s) : bt.push(s), s.observers && Sl(s));
|
|
8690
8692
|
}
|
|
8691
8693
|
}
|
|
8692
|
-
function
|
|
8694
|
+
function Jn(e) {
|
|
8693
8695
|
let t;
|
|
8694
8696
|
if (e.sources)
|
|
8695
8697
|
for (; e.sources.length; ) {
|
|
@@ -8700,11 +8702,11 @@ function Yn(e) {
|
|
|
8700
8702
|
}
|
|
8701
8703
|
}
|
|
8702
8704
|
if (e.tOwned) {
|
|
8703
|
-
for (t = e.tOwned.length - 1; t >= 0; t--)
|
|
8705
|
+
for (t = e.tOwned.length - 1; t >= 0; t--) Jn(e.tOwned[t]);
|
|
8704
8706
|
delete e.tOwned;
|
|
8705
8707
|
}
|
|
8706
8708
|
if (e.owned) {
|
|
8707
|
-
for (t = e.owned.length - 1; t >= 0; t--)
|
|
8709
|
+
for (t = e.owned.length - 1; t >= 0; t--) Jn(e.owned[t]);
|
|
8708
8710
|
e.owned = null;
|
|
8709
8711
|
}
|
|
8710
8712
|
if (e.cleanups) {
|
|
@@ -8739,7 +8741,7 @@ function jh(e, t) {
|
|
|
8739
8741
|
return Ht(() => r = qe(() => (ge.context = {
|
|
8740
8742
|
...ge.context,
|
|
8741
8743
|
[e]: a.value
|
|
8742
|
-
},
|
|
8744
|
+
}, xl(() => a.children))), void 0), r;
|
|
8743
8745
|
};
|
|
8744
8746
|
}
|
|
8745
8747
|
var Ma = Symbol("fallback");
|
|
@@ -8748,9 +8750,9 @@ function Vs(e) {
|
|
|
8748
8750
|
}
|
|
8749
8751
|
function zh(e, t, s = {}) {
|
|
8750
8752
|
let a = [], r = [], i = [], l = 0, o = t.length > 1 ? [] : null;
|
|
8751
|
-
return
|
|
8753
|
+
return Qn(() => Vs(i)), () => {
|
|
8752
8754
|
let d = e() || [], h = d.length, u, m;
|
|
8753
|
-
return d[
|
|
8755
|
+
return d[gl], qe(() => {
|
|
8754
8756
|
let p, y, g, b, x, N, I, _, k;
|
|
8755
8757
|
if (h === 0)
|
|
8756
8758
|
l !== 0 && (Vs(i), i = [], a = [], r = [], l = 0, o && (o = [])), s.fallback && (a = [Ma], r[0] = Kt((E) => (i[0] = E, s.fallback())), l = 1);
|
|
@@ -8783,9 +8785,9 @@ function zh(e, t, s = {}) {
|
|
|
8783
8785
|
}
|
|
8784
8786
|
function Vh(e, t, s = {}) {
|
|
8785
8787
|
let a = [], r = [], i = [], l = [], o = 0, d;
|
|
8786
|
-
return
|
|
8788
|
+
return Qn(() => Vs(i)), () => {
|
|
8787
8789
|
const h = e() || [], u = h.length;
|
|
8788
|
-
return h[
|
|
8790
|
+
return h[gl], qe(() => {
|
|
8789
8791
|
if (u === 0)
|
|
8790
8792
|
return o !== 0 && (Vs(i), i = [], a = [], r = [], o = 0, l = []), s.fallback && (a = [Ma], r[0] = Kt((v) => (i[0] = v, s.fallback())), o = 1), r;
|
|
8791
8793
|
for (a[0] === Ma && (i[0](), i = [], a = [], r = [], o = 0), d = 0; d < u; d++)
|
|
@@ -8801,7 +8803,7 @@ function Vh(e, t, s = {}) {
|
|
|
8801
8803
|
}
|
|
8802
8804
|
};
|
|
8803
8805
|
}
|
|
8804
|
-
function
|
|
8806
|
+
function Al(e, t) {
|
|
8805
8807
|
return qe(() => e(t || {}));
|
|
8806
8808
|
}
|
|
8807
8809
|
function ks() {
|
|
@@ -8840,13 +8842,13 @@ function Kh() {
|
|
|
8840
8842
|
if (s !== void 0) return s;
|
|
8841
8843
|
}
|
|
8842
8844
|
}
|
|
8843
|
-
function
|
|
8845
|
+
function Tl(...e) {
|
|
8844
8846
|
let t = !1;
|
|
8845
8847
|
for (let l = 0; l < e.length; l++) {
|
|
8846
8848
|
const o = e[l];
|
|
8847
8849
|
t = t || !!o && Fs in o, e[l] = typeof o == "function" ? (t = !0, Me(o)) : o;
|
|
8848
8850
|
}
|
|
8849
|
-
if (
|
|
8851
|
+
if (fl && t)
|
|
8850
8852
|
return new Proxy({
|
|
8851
8853
|
get(l) {
|
|
8852
8854
|
for (let o = e.length - 1; o >= 0; o--) {
|
|
@@ -8894,7 +8896,7 @@ function Cl(...e) {
|
|
|
8894
8896
|
return r;
|
|
8895
8897
|
}
|
|
8896
8898
|
function Hh(e, ...t) {
|
|
8897
|
-
if (
|
|
8899
|
+
if (fl && Fs in e) {
|
|
8898
8900
|
const r = new Set(t.length > 1 ? t.flat() : t[0]), i = t.map((l) => new Proxy({
|
|
8899
8901
|
get(o) {
|
|
8900
8902
|
return l.includes(o) ? e[o] : void 0;
|
|
@@ -8928,14 +8930,14 @@ function Hh(e, ...t) {
|
|
|
8928
8930
|
}
|
|
8929
8931
|
return [...a, s];
|
|
8930
8932
|
}
|
|
8931
|
-
function
|
|
8933
|
+
function Cl(e) {
|
|
8932
8934
|
let t, s;
|
|
8933
8935
|
const a = (r) => {
|
|
8934
|
-
const i =
|
|
8936
|
+
const i = se.context;
|
|
8935
8937
|
if (i) {
|
|
8936
8938
|
const [o, d] = Le();
|
|
8937
|
-
|
|
8938
|
-
!
|
|
8939
|
+
se.count || (se.count = 0), se.count++, (s || (s = e())).then((h) => {
|
|
8940
|
+
!se.done && Un(i), se.count--, d(() => h.default), Un();
|
|
8939
8941
|
}), t = o;
|
|
8940
8942
|
} else if (!t) {
|
|
8941
8943
|
const [o] = Rh(() => (s || (s = e())).then((d) => d.default));
|
|
@@ -8943,20 +8945,20 @@ function kl(e) {
|
|
|
8943
8945
|
}
|
|
8944
8946
|
let l;
|
|
8945
8947
|
return Me(() => (l = t()) ? qe(() => {
|
|
8946
|
-
if (!i ||
|
|
8947
|
-
const o =
|
|
8948
|
-
|
|
8948
|
+
if (!i || se.done) return l(r);
|
|
8949
|
+
const o = se.context;
|
|
8950
|
+
Un(i);
|
|
8949
8951
|
const d = l(r);
|
|
8950
|
-
return
|
|
8952
|
+
return Un(o), d;
|
|
8951
8953
|
}) : "");
|
|
8952
8954
|
};
|
|
8953
8955
|
return a.preload = () => s || ((s = e()).then((r) => t = () => r.default), s), a;
|
|
8954
8956
|
}
|
|
8955
8957
|
var Wh = 0;
|
|
8956
8958
|
function ag() {
|
|
8957
|
-
return
|
|
8959
|
+
return se.context ? se.getNextContextId() : `cl-${Wh++}`;
|
|
8958
8960
|
}
|
|
8959
|
-
var
|
|
8961
|
+
var kl = (e) => `Stale read from <${e}>.`;
|
|
8960
8962
|
function rg(e) {
|
|
8961
8963
|
const t = "fallback" in e && {
|
|
8962
8964
|
fallback: () => e.fallback
|
|
@@ -8978,7 +8980,7 @@ function lg(e) {
|
|
|
8978
8980
|
if (r) {
|
|
8979
8981
|
const i = e.children;
|
|
8980
8982
|
return typeof i == "function" && i.length > 0 ? qe(() => i(t ? r : () => {
|
|
8981
|
-
if (!qe(a)) throw
|
|
8983
|
+
if (!qe(a)) throw kl("Show");
|
|
8982
8984
|
return s();
|
|
8983
8985
|
})) : i;
|
|
8984
8986
|
}
|
|
@@ -8986,7 +8988,7 @@ function lg(e) {
|
|
|
8986
8988
|
}, void 0, void 0);
|
|
8987
8989
|
}
|
|
8988
8990
|
function og(e) {
|
|
8989
|
-
const t =
|
|
8991
|
+
const t = xl(() => e.children), s = Me(() => {
|
|
8990
8992
|
const a = t(), r = Array.isArray(a) ? a : [a];
|
|
8991
8993
|
let i = () => {
|
|
8992
8994
|
};
|
|
@@ -9004,7 +9006,7 @@ function og(e) {
|
|
|
9004
9006
|
const [r, i, l] = a, o = l.children;
|
|
9005
9007
|
return typeof o == "function" && o.length > 0 ? qe(() => o(l.keyed ? i() : () => {
|
|
9006
9008
|
var h;
|
|
9007
|
-
if (((h = qe(s)()) == null ? void 0 : h[0]) !== r) throw
|
|
9009
|
+
if (((h = qe(s)()) == null ? void 0 : h[0]) !== r) throw kl("Match");
|
|
9008
9010
|
return i();
|
|
9009
9011
|
})) : o;
|
|
9010
9012
|
}, void 0, void 0);
|
|
@@ -9169,8 +9171,8 @@ function am(e, t, s) {
|
|
|
9169
9171
|
}
|
|
9170
9172
|
}
|
|
9171
9173
|
}
|
|
9172
|
-
var
|
|
9173
|
-
function
|
|
9174
|
+
var qn = "_$DX_DELEGATE";
|
|
9175
|
+
function Pl(e, t, s, a = {}) {
|
|
9174
9176
|
let r;
|
|
9175
9177
|
return Kt((i) => {
|
|
9176
9178
|
r = i, t === document ? e() : qa(t, e(), t.firstChild ? null : void 0, s);
|
|
@@ -9187,16 +9189,16 @@ function ug(e, t, s, a) {
|
|
|
9187
9189
|
return l.cloneNode = l, l;
|
|
9188
9190
|
}
|
|
9189
9191
|
function rm(e, t = window.document) {
|
|
9190
|
-
const s = t[
|
|
9192
|
+
const s = t[qn] || (t[qn] = /* @__PURE__ */ new Set());
|
|
9191
9193
|
for (let a = 0, r = e.length; a < r; a++) {
|
|
9192
9194
|
const i = e[a];
|
|
9193
|
-
s.has(i) || (s.add(i), t.addEventListener(i,
|
|
9195
|
+
s.has(i) || (s.add(i), t.addEventListener(i, Il));
|
|
9194
9196
|
}
|
|
9195
9197
|
}
|
|
9196
9198
|
function hg(e = window.document) {
|
|
9197
|
-
if (e[
|
|
9198
|
-
for (let t of e[
|
|
9199
|
-
delete e[
|
|
9199
|
+
if (e[qn]) {
|
|
9200
|
+
for (let t of e[qn].keys()) e.removeEventListener(t, Il);
|
|
9201
|
+
delete e[qn];
|
|
9200
9202
|
}
|
|
9201
9203
|
}
|
|
9202
9204
|
function $a(e, t, s) {
|
|
@@ -9246,14 +9248,14 @@ function um(e, t, s) {
|
|
|
9246
9248
|
}
|
|
9247
9249
|
function hm(e, t = {}, s, a) {
|
|
9248
9250
|
const r = {};
|
|
9249
|
-
return a || Ht(() => r.children =
|
|
9251
|
+
return a || Ht(() => r.children = Yn(e, t.children, r.children)), Ht(() => typeof t.ref == "function" && mm(t.ref, e)), Ht(() => fm(e, t, s, !0, r, !0)), r;
|
|
9250
9252
|
}
|
|
9251
9253
|
function mm(e, t, s) {
|
|
9252
9254
|
return qe(() => e(t, s));
|
|
9253
9255
|
}
|
|
9254
9256
|
function qa(e, t, s, a) {
|
|
9255
|
-
if (s !== void 0 && !a && (a = []), typeof t != "function") return
|
|
9256
|
-
Ht((r) =>
|
|
9257
|
+
if (s !== void 0 && !a && (a = []), typeof t != "function") return Yn(e, t, a, s);
|
|
9258
|
+
Ht((r) => Yn(e, t(), r, s), a);
|
|
9257
9259
|
}
|
|
9258
9260
|
function fm(e, t, s, a, r = {}, i = !1) {
|
|
9259
9261
|
t || (t = {});
|
|
@@ -9271,10 +9273,10 @@ function fm(e, t, s, a, r = {}, i = !1) {
|
|
|
9271
9273
|
}
|
|
9272
9274
|
function gm(e) {
|
|
9273
9275
|
let t, s;
|
|
9274
|
-
return !Jt() || !(t =
|
|
9276
|
+
return !Jt() || !(t = se.registry.get(s = ym())) ? e() : (se.completed && se.completed.add(t), se.registry.delete(s), t);
|
|
9275
9277
|
}
|
|
9276
9278
|
function Jt(e) {
|
|
9277
|
-
return !!
|
|
9279
|
+
return !!se.context && !se.done && (!e || e.isConnected);
|
|
9278
9280
|
}
|
|
9279
9281
|
function pm(e) {
|
|
9280
9282
|
return e.toLowerCase().replace(/-([a-z])/g, (t, s) => s.toUpperCase());
|
|
@@ -9318,8 +9320,8 @@ function Gr(e, t, s, a, r, i, l) {
|
|
|
9318
9320
|
}
|
|
9319
9321
|
return s;
|
|
9320
9322
|
}
|
|
9321
|
-
function
|
|
9322
|
-
if (
|
|
9323
|
+
function Il(e) {
|
|
9324
|
+
if (se.registry && se.events && se.events.find(([d, h]) => h === e))
|
|
9323
9325
|
return;
|
|
9324
9326
|
let t = e.target;
|
|
9325
9327
|
const s = `$$${e.type}`, a = e.target, r = e.currentTarget, i = (d) => Object.defineProperty(e, "target", {
|
|
@@ -9340,7 +9342,7 @@ function _l(e) {
|
|
|
9340
9342
|
get() {
|
|
9341
9343
|
return t || document;
|
|
9342
9344
|
}
|
|
9343
|
-
}),
|
|
9345
|
+
}), se.registry && !se.done && (se.done = _$HY.done = !0), e.composedPath) {
|
|
9344
9346
|
const d = e.composedPath();
|
|
9345
9347
|
i(d[0]);
|
|
9346
9348
|
for (let h = 0; h < d.length - 2 && (t = d[h], !!l()); h++) {
|
|
@@ -9354,7 +9356,7 @@ function _l(e) {
|
|
|
9354
9356
|
} else o();
|
|
9355
9357
|
i(a);
|
|
9356
9358
|
}
|
|
9357
|
-
function
|
|
9359
|
+
function Yn(e, t, s, a, r) {
|
|
9358
9360
|
const i = Jt(e);
|
|
9359
9361
|
if (i) {
|
|
9360
9362
|
!s && (s = [...e.childNodes]);
|
|
@@ -9384,12 +9386,12 @@ function Xn(e, t, s, a, r) {
|
|
|
9384
9386
|
return Ht(() => {
|
|
9385
9387
|
let d = t();
|
|
9386
9388
|
for (; typeof d == "function"; ) d = d();
|
|
9387
|
-
s =
|
|
9389
|
+
s = Yn(e, d, s, a);
|
|
9388
9390
|
}), () => s;
|
|
9389
9391
|
if (Array.isArray(t)) {
|
|
9390
9392
|
const d = [], h = s && Array.isArray(s);
|
|
9391
9393
|
if (ja(d, t, s, r))
|
|
9392
|
-
return Ht(() => s =
|
|
9394
|
+
return Ht(() => s = Yn(e, d, s, a, !0)), () => s;
|
|
9393
9395
|
if (i) {
|
|
9394
9396
|
if (!d.length) return s;
|
|
9395
9397
|
if (a === void 0) return s = [...e.childNodes];
|
|
@@ -9454,25 +9456,25 @@ function Zt(e, t, s, a) {
|
|
|
9454
9456
|
return [r];
|
|
9455
9457
|
}
|
|
9456
9458
|
function ym() {
|
|
9457
|
-
return
|
|
9459
|
+
return se.getNextContextId();
|
|
9458
9460
|
}
|
|
9459
9461
|
var vm = "http://www.w3.org/2000/svg";
|
|
9460
|
-
function
|
|
9462
|
+
function _l(e, t = !1) {
|
|
9461
9463
|
return t ? document.createElementNS(vm, e) : document.createElement(e);
|
|
9462
9464
|
}
|
|
9463
9465
|
function mg(e) {
|
|
9464
9466
|
const {
|
|
9465
9467
|
useShadow: t
|
|
9466
9468
|
} = e, s = document.createTextNode(""), a = () => e.mount || document.body, r = Or();
|
|
9467
|
-
let i, l = !!
|
|
9468
|
-
return
|
|
9469
|
-
l && (Or().user = l = !1), i || (i =
|
|
9469
|
+
let i, l = !!se.context;
|
|
9470
|
+
return vl(() => {
|
|
9471
|
+
l && (Or().user = l = !1), i || (i = bl(r, () => Me(() => e.children)));
|
|
9470
9472
|
const o = a();
|
|
9471
9473
|
if (o instanceof HTMLHeadElement) {
|
|
9472
9474
|
const [d, h] = Le(!1), u = () => h(!0);
|
|
9473
|
-
Kt((m) => qa(o, () => d() ? m() : i(), null)),
|
|
9475
|
+
Kt((m) => qa(o, () => d() ? m() : i(), null)), Qn(u);
|
|
9474
9476
|
} else {
|
|
9475
|
-
const d =
|
|
9477
|
+
const d = _l(e.isSVG ? "g" : "div", e.isSVG), h = t && d.attachShadow ? d.attachShadow({
|
|
9476
9478
|
mode: "open"
|
|
9477
9479
|
}) : d;
|
|
9478
9480
|
Object.defineProperty(d, "_$host", {
|
|
@@ -9480,7 +9482,7 @@ function mg(e) {
|
|
|
9480
9482
|
return s.parentNode;
|
|
9481
9483
|
},
|
|
9482
9484
|
configurable: !0
|
|
9483
|
-
}), qa(h, i), o.appendChild(d), e.ref && e.ref(d),
|
|
9485
|
+
}), qa(h, i), o.appendChild(d), e.ref && e.ref(d), Qn(() => o.removeChild(d));
|
|
9484
9486
|
}
|
|
9485
9487
|
}, void 0, {
|
|
9486
9488
|
render: !l
|
|
@@ -9494,7 +9496,7 @@ function bm(e, t) {
|
|
|
9494
9496
|
case "function":
|
|
9495
9497
|
return qe(() => a(t));
|
|
9496
9498
|
case "string":
|
|
9497
|
-
const r = nm.has(a), i =
|
|
9499
|
+
const r = nm.has(a), i = se.context ? gm() : _l(a, r);
|
|
9498
9500
|
return hm(i, t, r), i;
|
|
9499
9501
|
}
|
|
9500
9502
|
});
|
|
@@ -9519,7 +9521,7 @@ var xm = class {
|
|
|
9519
9521
|
clear() {
|
|
9520
9522
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
9521
9523
|
}
|
|
9522
|
-
},
|
|
9524
|
+
}, Ll = class {
|
|
9523
9525
|
constructor(e) {
|
|
9524
9526
|
this.generateIdentifier = e, this.kv = new xm();
|
|
9525
9527
|
}
|
|
@@ -9535,7 +9537,7 @@ var xm = class {
|
|
|
9535
9537
|
getValue(e) {
|
|
9536
9538
|
return this.kv.getByKey(e);
|
|
9537
9539
|
}
|
|
9538
|
-
}, wm = class extends
|
|
9540
|
+
}, wm = class extends Ll {
|
|
9539
9541
|
constructor() {
|
|
9540
9542
|
super((e) => e.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
9541
9543
|
}
|
|
@@ -9591,7 +9593,7 @@ var Sm = class {
|
|
|
9591
9593
|
findByName(e) {
|
|
9592
9594
|
return this.transfomers[e];
|
|
9593
9595
|
}
|
|
9594
|
-
}, Am = (e) => Object.prototype.toString.call(e).slice(8, -1),
|
|
9596
|
+
}, Am = (e) => Object.prototype.toString.call(e).slice(8, -1), Dl = (e) => typeof e > "u", Tm = (e) => e === null, Xn = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, za = (e) => Xn(e) && Object.keys(e).length === 0, Dt = (e) => Array.isArray(e), Cm = (e) => typeof e == "string", km = (e) => typeof e == "number" && !isNaN(e), Pm = (e) => typeof e == "boolean", Im = (e) => e instanceof RegExp, Zn = (e) => e instanceof Map, es = (e) => e instanceof Set, Ol = (e) => Am(e) === "Symbol", _m = (e) => e instanceof Date && !isNaN(e.valueOf()), Lm = (e) => e instanceof Error, Mr = (e) => typeof e == "number" && isNaN(e), Dm = (e) => Pm(e) || Tm(e) || Dl(e) || km(e) || Cm(e) || Ol(e), Om = (e) => typeof e == "bigint", Rm = (e) => e === 1 / 0 || e === -1 / 0, Gm = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Um = (e) => e instanceof URL, Rl = (e) => e.replace(/\./g, "\\."), Ta = (e) => e.map(String).map(Rl).join("."), jn = (e) => {
|
|
9595
9597
|
const t = [];
|
|
9596
9598
|
let s = "";
|
|
9597
9599
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -9609,7 +9611,7 @@ var Sm = class {
|
|
|
9609
9611
|
const a = s;
|
|
9610
9612
|
return t.push(a), t;
|
|
9611
9613
|
};
|
|
9612
|
-
function
|
|
9614
|
+
function ft(e, t, s, a) {
|
|
9613
9615
|
return {
|
|
9614
9616
|
isApplicable: e,
|
|
9615
9617
|
annotation: t,
|
|
@@ -9617,12 +9619,12 @@ function mt(e, t, s, a) {
|
|
|
9617
9619
|
untransform: a
|
|
9618
9620
|
};
|
|
9619
9621
|
}
|
|
9620
|
-
var
|
|
9621
|
-
|
|
9622
|
+
var Gl = [
|
|
9623
|
+
ft(Dl, "undefined", () => null, () => {
|
|
9622
9624
|
}),
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9625
|
+
ft(Om, "bigint", (e) => e.toString(), (e) => typeof BigInt < "u" ? BigInt(e) : e),
|
|
9626
|
+
ft(_m, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
9627
|
+
ft(Lm, "Error", (e, t) => {
|
|
9626
9628
|
const s = {
|
|
9627
9629
|
name: e.name,
|
|
9628
9630
|
message: e.message
|
|
@@ -9636,22 +9638,22 @@ var Ul = [
|
|
|
9636
9638
|
s[a] = e[a];
|
|
9637
9639
|
}), s;
|
|
9638
9640
|
}),
|
|
9639
|
-
|
|
9641
|
+
ft(Im, "regexp", (e) => "" + e, (e) => {
|
|
9640
9642
|
const t = e.slice(1, e.lastIndexOf("/")), s = e.slice(e.lastIndexOf("/") + 1);
|
|
9641
9643
|
return new RegExp(t, s);
|
|
9642
9644
|
}),
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
+
ft(
|
|
9646
|
+
es,
|
|
9645
9647
|
"set",
|
|
9646
9648
|
// (sets only exist in es6+)
|
|
9647
9649
|
// eslint-disable-next-line es5/no-es6-methods
|
|
9648
9650
|
(e) => [...e.values()],
|
|
9649
9651
|
(e) => new Set(e)
|
|
9650
9652
|
),
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9653
|
+
ft(Zn, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
9654
|
+
ft((e) => Mr(e) || Rm(e), "number", (e) => Mr(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
9655
|
+
ft((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
9656
|
+
ft(Um, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
9655
9657
|
];
|
|
9656
9658
|
function ha(e, t, s, a) {
|
|
9657
9659
|
return {
|
|
@@ -9661,7 +9663,7 @@ function ha(e, t, s, a) {
|
|
|
9661
9663
|
untransform: a
|
|
9662
9664
|
};
|
|
9663
9665
|
}
|
|
9664
|
-
var
|
|
9666
|
+
var Ul = ha((e, t) => Ol(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, s) => {
|
|
9665
9667
|
const a = s.symbolRegistry.getValue(t[1]);
|
|
9666
9668
|
if (!a)
|
|
9667
9669
|
throw new Error("Trying to deserialize unknown symbol");
|
|
@@ -9676,16 +9678,16 @@ var Bl = ha((e, t) => Rl(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) =
|
|
|
9676
9678
|
Float32Array,
|
|
9677
9679
|
Float64Array,
|
|
9678
9680
|
Uint8ClampedArray
|
|
9679
|
-
].reduce((e, t) => (e[t.name] = t, e), {}),
|
|
9681
|
+
].reduce((e, t) => (e[t.name] = t, e), {}), Bl = ha(Gm, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
9680
9682
|
const s = Bm[t[1]];
|
|
9681
9683
|
if (!s)
|
|
9682
9684
|
throw new Error("Trying to deserialize unknown typed array");
|
|
9683
9685
|
return new s(e);
|
|
9684
9686
|
});
|
|
9685
|
-
function
|
|
9687
|
+
function Ml(e, t) {
|
|
9686
9688
|
return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
9687
9689
|
}
|
|
9688
|
-
var
|
|
9690
|
+
var Fl = ha(Ml, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
9689
9691
|
const s = t.classRegistry.getAllowedProps(e.constructor);
|
|
9690
9692
|
if (!s)
|
|
9691
9693
|
return { ...e };
|
|
@@ -9698,44 +9700,44 @@ var $l = ha(Fl, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)
|
|
|
9698
9700
|
if (!a)
|
|
9699
9701
|
throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
9700
9702
|
return Object.assign(Object.create(a.prototype), e);
|
|
9701
|
-
}),
|
|
9703
|
+
}), $l = ha((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, s) => {
|
|
9702
9704
|
const a = s.customTransformerRegistry.findByName(t[1]);
|
|
9703
9705
|
if (!a)
|
|
9704
9706
|
throw new Error("Trying to deserialize unknown custom value");
|
|
9705
9707
|
return a.deserialize(e);
|
|
9706
|
-
}), Mm = [
|
|
9708
|
+
}), Mm = [Fl, Ul, $l, Bl], Fr = (e, t) => {
|
|
9707
9709
|
const s = Br(Mm, (r) => r.isApplicable(e, t));
|
|
9708
9710
|
if (s)
|
|
9709
9711
|
return {
|
|
9710
9712
|
value: s.transform(e, t),
|
|
9711
9713
|
type: s.annotation(e, t)
|
|
9712
9714
|
};
|
|
9713
|
-
const a = Br(
|
|
9715
|
+
const a = Br(Gl, (r) => r.isApplicable(e, t));
|
|
9714
9716
|
if (a)
|
|
9715
9717
|
return {
|
|
9716
9718
|
value: a.transform(e, t),
|
|
9717
9719
|
type: a.annotation
|
|
9718
9720
|
};
|
|
9719
|
-
},
|
|
9720
|
-
|
|
9721
|
-
|
|
9721
|
+
}, ql = {};
|
|
9722
|
+
Gl.forEach((e) => {
|
|
9723
|
+
ql[e.annotation] = e;
|
|
9722
9724
|
});
|
|
9723
9725
|
var Fm = (e, t, s) => {
|
|
9724
9726
|
if (Dt(t))
|
|
9725
9727
|
switch (t[0]) {
|
|
9726
9728
|
case "symbol":
|
|
9727
|
-
return
|
|
9729
|
+
return Ul.untransform(e, t, s);
|
|
9728
9730
|
case "class":
|
|
9729
|
-
return
|
|
9731
|
+
return Fl.untransform(e, t, s);
|
|
9730
9732
|
case "custom":
|
|
9731
|
-
return
|
|
9733
|
+
return $l.untransform(e, t, s);
|
|
9732
9734
|
case "typed-array":
|
|
9733
|
-
return
|
|
9735
|
+
return Bl.untransform(e, t, s);
|
|
9734
9736
|
default:
|
|
9735
9737
|
throw new Error("Unknown transformation: " + t);
|
|
9736
9738
|
}
|
|
9737
9739
|
else {
|
|
9738
|
-
const a =
|
|
9740
|
+
const a = ql[t];
|
|
9739
9741
|
if (!a)
|
|
9740
9742
|
throw new Error("Unknown transformation: " + t);
|
|
9741
9743
|
return a.untransform(e, s);
|
|
@@ -9748,7 +9750,7 @@ var Fm = (e, t, s) => {
|
|
|
9748
9750
|
s.next(), t--;
|
|
9749
9751
|
return s.next().value;
|
|
9750
9752
|
};
|
|
9751
|
-
function
|
|
9753
|
+
function jl(e) {
|
|
9752
9754
|
if (Gs(e, "__proto__"))
|
|
9753
9755
|
throw new Error("__proto__ is not allowed as a property");
|
|
9754
9756
|
if (Gs(e, "prototype"))
|
|
@@ -9757,12 +9759,12 @@ function zl(e) {
|
|
|
9757
9759
|
throw new Error("constructor is not allowed as a property");
|
|
9758
9760
|
}
|
|
9759
9761
|
var $m = (e, t) => {
|
|
9760
|
-
|
|
9762
|
+
jl(t);
|
|
9761
9763
|
for (let s = 0; s < t.length; s++) {
|
|
9762
9764
|
const a = t[s];
|
|
9763
|
-
if (
|
|
9765
|
+
if (es(e))
|
|
9764
9766
|
e = tn(e, +a);
|
|
9765
|
-
else if (
|
|
9767
|
+
else if (Zn(e)) {
|
|
9766
9768
|
const r = +a, i = +t[++s] == 0 ? "key" : "value", l = tn(e, r);
|
|
9767
9769
|
switch (i) {
|
|
9768
9770
|
case "key":
|
|
@@ -9777,7 +9779,7 @@ var $m = (e, t) => {
|
|
|
9777
9779
|
}
|
|
9778
9780
|
return e;
|
|
9779
9781
|
}, Va = (e, t, s) => {
|
|
9780
|
-
if (
|
|
9782
|
+
if (jl(t), t.length === 0)
|
|
9781
9783
|
return s(e);
|
|
9782
9784
|
let a = e;
|
|
9783
9785
|
for (let i = 0; i < t.length - 1; i++) {
|
|
@@ -9785,12 +9787,12 @@ var $m = (e, t) => {
|
|
|
9785
9787
|
if (Dt(a)) {
|
|
9786
9788
|
const o = +l;
|
|
9787
9789
|
a = a[o];
|
|
9788
|
-
} else if (
|
|
9790
|
+
} else if (Xn(a))
|
|
9789
9791
|
a = a[l];
|
|
9790
|
-
else if (
|
|
9792
|
+
else if (es(a)) {
|
|
9791
9793
|
const o = +l;
|
|
9792
9794
|
a = tn(a, o);
|
|
9793
|
-
} else if (
|
|
9795
|
+
} else if (Zn(a)) {
|
|
9794
9796
|
if (i === t.length - 2)
|
|
9795
9797
|
break;
|
|
9796
9798
|
const d = +l, h = +t[++i] == 0 ? "key" : "value", u = tn(a, d);
|
|
@@ -9805,11 +9807,11 @@ var $m = (e, t) => {
|
|
|
9805
9807
|
}
|
|
9806
9808
|
}
|
|
9807
9809
|
const r = t[t.length - 1];
|
|
9808
|
-
if (Dt(a) ? a[+r] = s(a[+r]) :
|
|
9810
|
+
if (Dt(a) ? a[+r] = s(a[+r]) : Xn(a) && (a[r] = s(a[r])), es(a)) {
|
|
9809
9811
|
const i = tn(a, +r), l = s(i);
|
|
9810
9812
|
i !== l && (a.delete(i), a.add(l));
|
|
9811
9813
|
}
|
|
9812
|
-
if (
|
|
9814
|
+
if (Zn(a)) {
|
|
9813
9815
|
const i = +t[t.length - 2], l = tn(a, i);
|
|
9814
9816
|
switch (+r == 0 ? "key" : "value") {
|
|
9815
9817
|
case "key": {
|
|
@@ -9829,12 +9831,12 @@ function Ka(e, t, s = []) {
|
|
|
9829
9831
|
if (!e)
|
|
9830
9832
|
return;
|
|
9831
9833
|
if (!Dt(e)) {
|
|
9832
|
-
Cn(e, (i, l) => Ka(i, t, [...s, ...
|
|
9834
|
+
Cn(e, (i, l) => Ka(i, t, [...s, ...jn(l)]));
|
|
9833
9835
|
return;
|
|
9834
9836
|
}
|
|
9835
9837
|
const [a, r] = e;
|
|
9836
9838
|
r && Cn(r, (i, l) => {
|
|
9837
|
-
Ka(i, t, [...s, ...
|
|
9839
|
+
Ka(i, t, [...s, ...jn(l)]);
|
|
9838
9840
|
}), t(a, s);
|
|
9839
9841
|
}
|
|
9840
9842
|
function qm(e, t, s) {
|
|
@@ -9844,21 +9846,21 @@ function qm(e, t, s) {
|
|
|
9844
9846
|
}
|
|
9845
9847
|
function jm(e, t) {
|
|
9846
9848
|
function s(a, r) {
|
|
9847
|
-
const i = $m(e,
|
|
9848
|
-
a.map(
|
|
9849
|
+
const i = $m(e, jn(r));
|
|
9850
|
+
a.map(jn).forEach((l) => {
|
|
9849
9851
|
e = Va(e, l, () => i);
|
|
9850
9852
|
});
|
|
9851
9853
|
}
|
|
9852
9854
|
if (Dt(t)) {
|
|
9853
9855
|
const [a, r] = t;
|
|
9854
9856
|
a.forEach((i) => {
|
|
9855
|
-
e = Va(e,
|
|
9857
|
+
e = Va(e, jn(i), () => e);
|
|
9856
9858
|
}), r && Cn(r, s);
|
|
9857
9859
|
} else
|
|
9858
9860
|
Cn(t, s);
|
|
9859
9861
|
return e;
|
|
9860
9862
|
}
|
|
9861
|
-
var zm = (e, t) =>
|
|
9863
|
+
var zm = (e, t) => Xn(e) || Dt(e) || Zn(e) || es(e) || Ml(e, t);
|
|
9862
9864
|
function Vm(e, t, s) {
|
|
9863
9865
|
const a = s.get(e);
|
|
9864
9866
|
a ? a.push(t) : s.set(e, [t]);
|
|
@@ -9874,7 +9876,7 @@ function Km(e, t) {
|
|
|
9874
9876
|
i.length === 0 ? a = l.map(Ta) : s[Ta(i)] = l.map(Ta);
|
|
9875
9877
|
}), a ? za(s) ? [a] : [a, s] : za(s) ? void 0 : s;
|
|
9876
9878
|
}
|
|
9877
|
-
var
|
|
9879
|
+
var zl = (e, t, s, a, r = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
9878
9880
|
const o = Dm(e);
|
|
9879
9881
|
if (!o) {
|
|
9880
9882
|
Vm(e, r, t);
|
|
@@ -9901,9 +9903,9 @@ var Vl = (e, t, s, a, r = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
9901
9903
|
Cn(h, (p, y) => {
|
|
9902
9904
|
if (y === "__proto__" || y === "constructor" || y === "prototype")
|
|
9903
9905
|
throw new Error(`Detected property ${y}. This is a prototype pollution risk, please remove it from your object.`);
|
|
9904
|
-
const g =
|
|
9905
|
-
u[y] = g.transformedValue, Dt(g.annotations) ? m[y] = g.annotations :
|
|
9906
|
-
m[
|
|
9906
|
+
const g = zl(p, t, s, a, [...r, y], [...i, e], l);
|
|
9907
|
+
u[y] = g.transformedValue, Dt(g.annotations) ? m[y] = g.annotations : Xn(g.annotations) && Cn(g.annotations, (b, x) => {
|
|
9908
|
+
m[Rl(y) + "." + x] = b;
|
|
9907
9909
|
});
|
|
9908
9910
|
});
|
|
9909
9911
|
const v = za(m) ? {
|
|
@@ -9915,14 +9917,14 @@ var Vl = (e, t, s, a, r = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
9915
9917
|
};
|
|
9916
9918
|
return o || l.set(e, v), v;
|
|
9917
9919
|
};
|
|
9918
|
-
function
|
|
9920
|
+
function Vl(e) {
|
|
9919
9921
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
9920
9922
|
}
|
|
9921
9923
|
function $r(e) {
|
|
9922
|
-
return
|
|
9924
|
+
return Vl(e) === "Array";
|
|
9923
9925
|
}
|
|
9924
9926
|
function Hm(e) {
|
|
9925
|
-
if (
|
|
9927
|
+
if (Vl(e) !== "Object")
|
|
9926
9928
|
return !1;
|
|
9927
9929
|
const t = Object.getPrototypeOf(e);
|
|
9928
9930
|
return !!t && t.constructor === Object && t === Object.prototype;
|
|
@@ -9954,10 +9956,10 @@ var Te = class {
|
|
|
9954
9956
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
9955
9957
|
*/
|
|
9956
9958
|
constructor({ dedupe: e = !1 } = {}) {
|
|
9957
|
-
this.classRegistry = new wm(), this.symbolRegistry = new
|
|
9959
|
+
this.classRegistry = new wm(), this.symbolRegistry = new Ll((t) => t.description ?? ""), this.customTransformerRegistry = new Sm(), this.allowedErrorProps = [], this.dedupe = e;
|
|
9958
9960
|
}
|
|
9959
9961
|
serialize(e) {
|
|
9960
|
-
const t = /* @__PURE__ */ new Map(), s =
|
|
9962
|
+
const t = /* @__PURE__ */ new Map(), s = zl(e, t, this, this.dedupe), a = {
|
|
9961
9963
|
json: s.transformedValue
|
|
9962
9964
|
};
|
|
9963
9965
|
s.annotations && (a.meta = {
|
|
@@ -10034,13 +10036,13 @@ var wg = (e, t = !1) => {
|
|
|
10034
10036
|
json: s
|
|
10035
10037
|
} = Qm(e);
|
|
10036
10038
|
return JSON.stringify(s, null, t ? 2 : void 0);
|
|
10037
|
-
}, Ps = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Jm = (e, t) => e.queryHash.localeCompare(t.queryHash),
|
|
10039
|
+
}, Ps = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Jm = (e, t) => e.queryHash.localeCompare(t.queryHash), Kl = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Ym = (e, t) => Ps(e) === Ps(t) ? Kl(e, t) : Ps(e) > Ps(t) ? 1 : -1, Ng = {
|
|
10038
10040
|
status: Ym,
|
|
10039
10041
|
"query hash": Jm,
|
|
10040
|
-
"last updated":
|
|
10041
|
-
}, Is = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3,
|
|
10042
|
+
"last updated": Kl
|
|
10043
|
+
}, Is = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, Hl = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, Xm = (e, t) => Is(e) === Is(t) ? Hl(e, t) : Is(e) > Is(t) ? 1 : -1, Eg = {
|
|
10042
10044
|
status: Xm,
|
|
10043
|
-
"last updated":
|
|
10045
|
+
"last updated": Hl
|
|
10044
10046
|
}, Sg = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), Ag = () => {
|
|
10045
10047
|
const [e, t] = Le("dark");
|
|
10046
10048
|
return Gh(() => {
|
|
@@ -10049,7 +10051,7 @@ var wg = (e, t = !1) => {
|
|
|
10049
10051
|
const a = (r) => {
|
|
10050
10052
|
t(r.matches ? "dark" : "light");
|
|
10051
10053
|
};
|
|
10052
|
-
s.addEventListener("change", a),
|
|
10054
|
+
s.addEventListener("change", a), Qn(() => s.removeEventListener("change", a));
|
|
10053
10055
|
}), e;
|
|
10054
10056
|
}, _s = (e, t, s) => {
|
|
10055
10057
|
if (t.length === 0)
|
|
@@ -10111,26 +10113,26 @@ var wg = (e, t = !1) => {
|
|
|
10111
10113
|
return s[a] = Ls(s[a], r), s;
|
|
10112
10114
|
}
|
|
10113
10115
|
return e;
|
|
10114
|
-
},
|
|
10116
|
+
}, Wl = (e, t) => {
|
|
10115
10117
|
if (!e || document.querySelector("#_goober") || (t == null ? void 0 : t.querySelector("#_goober"))) return;
|
|
10116
10118
|
const a = document.createElement("style"), r = document.createTextNode("");
|
|
10117
10119
|
a.appendChild(r), a.id = "_goober", a.setAttribute("nonce", e), t ? t.appendChild(a) : document.head.appendChild(a);
|
|
10118
|
-
}, rn, ns, ss,
|
|
10120
|
+
}, rn, ts, ns, ss, qt, as, ln, on, cn, dn, un, rs, hn, is, zr, Zm = (zr = class {
|
|
10119
10121
|
constructor(e) {
|
|
10120
10122
|
we(this, rn);
|
|
10123
|
+
we(this, ts);
|
|
10121
10124
|
we(this, ns);
|
|
10122
10125
|
we(this, ss);
|
|
10123
|
-
we(this, as);
|
|
10124
10126
|
we(this, qt, !1);
|
|
10125
|
-
we(this,
|
|
10127
|
+
we(this, as);
|
|
10126
10128
|
we(this, ln);
|
|
10127
10129
|
we(this, on);
|
|
10128
10130
|
we(this, cn);
|
|
10129
10131
|
we(this, dn);
|
|
10130
10132
|
we(this, un);
|
|
10131
|
-
we(this,
|
|
10133
|
+
we(this, rs);
|
|
10132
10134
|
we(this, hn);
|
|
10133
|
-
we(this,
|
|
10135
|
+
we(this, is);
|
|
10134
10136
|
const {
|
|
10135
10137
|
client: t,
|
|
10136
10138
|
queryFlavor: s,
|
|
@@ -10144,7 +10146,7 @@ var wg = (e, t = !1) => {
|
|
|
10144
10146
|
shadowDOMTarget: u,
|
|
10145
10147
|
hideDisabledQueries: m
|
|
10146
10148
|
} = e;
|
|
10147
|
-
pe(this, rn, Le(t)), pe(this,
|
|
10149
|
+
pe(this, rn, Le(t)), pe(this, ns, s), pe(this, ss, a), pe(this, ts, r), pe(this, as, h), pe(this, ln, u), pe(this, on, Le(i)), pe(this, cn, Le(l)), pe(this, dn, Le(o)), pe(this, un, Le(d)), pe(this, rs, Le(m));
|
|
10148
10150
|
}
|
|
10149
10151
|
setButtonPosition(e) {
|
|
10150
10152
|
ee(this, on)[1](e);
|
|
@@ -10164,18 +10166,18 @@ var wg = (e, t = !1) => {
|
|
|
10164
10166
|
mount(e) {
|
|
10165
10167
|
if (ee(this, qt))
|
|
10166
10168
|
throw new Error("Devtools is already mounted");
|
|
10167
|
-
const t =
|
|
10168
|
-
const s = this, [a] = ee(this, on), [r] = ee(this, cn), [i] = ee(this, dn), [l] = ee(this, un), [o] = ee(this,
|
|
10169
|
+
const t = Pl(() => {
|
|
10170
|
+
const s = this, [a] = ee(this, on), [r] = ee(this, cn), [i] = ee(this, dn), [l] = ee(this, un), [o] = ee(this, rs), [d] = ee(this, rn);
|
|
10169
10171
|
let h;
|
|
10170
|
-
return ee(this, hn) ? h = ee(this, hn) : (h =
|
|
10172
|
+
return ee(this, hn) ? h = ee(this, hn) : (h = Cl(() => import("./LNWAZHJI-42v3DYDN.js")), pe(this, hn, h)), Wl(ee(this, as), ee(this, ln)), Al(h, Tl({
|
|
10171
10173
|
get queryFlavor() {
|
|
10172
|
-
return ee(s,
|
|
10174
|
+
return ee(s, ns);
|
|
10173
10175
|
},
|
|
10174
10176
|
get version() {
|
|
10175
|
-
return ee(s,
|
|
10177
|
+
return ee(s, ss);
|
|
10176
10178
|
},
|
|
10177
10179
|
get onlineManager() {
|
|
10178
|
-
return ee(s,
|
|
10180
|
+
return ee(s, ts);
|
|
10179
10181
|
},
|
|
10180
10182
|
get shadowDOMTarget() {
|
|
10181
10183
|
return ee(s, ln);
|
|
@@ -10201,31 +10203,31 @@ var wg = (e, t = !1) => {
|
|
|
10201
10203
|
}
|
|
10202
10204
|
}));
|
|
10203
10205
|
}, e);
|
|
10204
|
-
pe(this, qt, !0), pe(this,
|
|
10206
|
+
pe(this, qt, !0), pe(this, is, t);
|
|
10205
10207
|
}
|
|
10206
10208
|
unmount() {
|
|
10207
10209
|
var e;
|
|
10208
10210
|
if (!ee(this, qt))
|
|
10209
10211
|
throw new Error("Devtools is not mounted");
|
|
10210
|
-
(e = ee(this,
|
|
10212
|
+
(e = ee(this, is)) == null || e.call(this), pe(this, qt, !1);
|
|
10211
10213
|
}
|
|
10212
|
-
}, rn = new WeakMap(),
|
|
10214
|
+
}, rn = new WeakMap(), ts = new WeakMap(), ns = new WeakMap(), ss = new WeakMap(), qt = new WeakMap(), as = new WeakMap(), ln = new WeakMap(), on = new WeakMap(), cn = new WeakMap(), dn = new WeakMap(), un = new WeakMap(), rs = new WeakMap(), hn = new WeakMap(), is = new WeakMap(), zr), mn, ls, os, cs, jt, ds, fn, gn, pn, yn, vn, us, bn, xn, hs, Vr, ef = (Vr = class {
|
|
10213
10215
|
constructor(e) {
|
|
10214
10216
|
we(this, mn);
|
|
10217
|
+
we(this, ls);
|
|
10215
10218
|
we(this, os);
|
|
10216
10219
|
we(this, cs);
|
|
10217
|
-
we(this, ds);
|
|
10218
10220
|
we(this, jt, !1);
|
|
10219
|
-
we(this,
|
|
10221
|
+
we(this, ds);
|
|
10220
10222
|
we(this, fn);
|
|
10221
10223
|
we(this, gn);
|
|
10222
10224
|
we(this, pn);
|
|
10223
10225
|
we(this, yn);
|
|
10224
10226
|
we(this, vn);
|
|
10225
|
-
we(this,
|
|
10227
|
+
we(this, us);
|
|
10226
10228
|
we(this, bn);
|
|
10227
10229
|
we(this, xn);
|
|
10228
|
-
we(this,
|
|
10230
|
+
we(this, hs);
|
|
10229
10231
|
const {
|
|
10230
10232
|
client: t,
|
|
10231
10233
|
queryFlavor: s,
|
|
@@ -10240,7 +10242,7 @@ var wg = (e, t = !1) => {
|
|
|
10240
10242
|
onClose: m,
|
|
10241
10243
|
hideDisabledQueries: v
|
|
10242
10244
|
} = e;
|
|
10243
|
-
pe(this, mn, Le(t)), pe(this,
|
|
10245
|
+
pe(this, mn, Le(t)), pe(this, os, s), pe(this, cs, a), pe(this, ls, r), pe(this, ds, h), pe(this, fn, u), pe(this, gn, Le(i)), pe(this, pn, Le(l)), pe(this, yn, Le(o)), pe(this, vn, Le(d)), pe(this, us, Le(v)), pe(this, bn, Le(m));
|
|
10244
10246
|
}
|
|
10245
10247
|
setButtonPosition(e) {
|
|
10246
10248
|
ee(this, gn)[1](e);
|
|
@@ -10263,18 +10265,18 @@ var wg = (e, t = !1) => {
|
|
|
10263
10265
|
mount(e) {
|
|
10264
10266
|
if (ee(this, jt))
|
|
10265
10267
|
throw new Error("Devtools is already mounted");
|
|
10266
|
-
const t =
|
|
10267
|
-
const s = this, [a] = ee(this, gn), [r] = ee(this, pn), [i] = ee(this, yn), [l] = ee(this, vn), [o] = ee(this,
|
|
10268
|
+
const t = Pl(() => {
|
|
10269
|
+
const s = this, [a] = ee(this, gn), [r] = ee(this, pn), [i] = ee(this, yn), [l] = ee(this, vn), [o] = ee(this, us), [d] = ee(this, mn), [h] = ee(this, bn);
|
|
10268
10270
|
let u;
|
|
10269
|
-
return ee(this, xn) ? u = ee(this, xn) : (u =
|
|
10271
|
+
return ee(this, xn) ? u = ee(this, xn) : (u = Cl(() => import("./MWZ6AO7Z-Bmq2Xvgm.js")), pe(this, xn, u)), Wl(ee(this, ds), ee(this, fn)), Al(u, Tl({
|
|
10270
10272
|
get queryFlavor() {
|
|
10271
|
-
return ee(s,
|
|
10273
|
+
return ee(s, os);
|
|
10272
10274
|
},
|
|
10273
10275
|
get version() {
|
|
10274
|
-
return ee(s,
|
|
10276
|
+
return ee(s, cs);
|
|
10275
10277
|
},
|
|
10276
10278
|
get onlineManager() {
|
|
10277
|
-
return ee(s,
|
|
10279
|
+
return ee(s, ls);
|
|
10278
10280
|
},
|
|
10279
10281
|
get shadowDOMTarget() {
|
|
10280
10282
|
return ee(s, fn);
|
|
@@ -10303,15 +10305,15 @@ var wg = (e, t = !1) => {
|
|
|
10303
10305
|
}
|
|
10304
10306
|
}));
|
|
10305
10307
|
}, e);
|
|
10306
|
-
pe(this, jt, !0), pe(this,
|
|
10308
|
+
pe(this, jt, !0), pe(this, hs, t);
|
|
10307
10309
|
}
|
|
10308
10310
|
unmount() {
|
|
10309
10311
|
var e;
|
|
10310
10312
|
if (!ee(this, jt))
|
|
10311
10313
|
throw new Error("Devtools is not mounted");
|
|
10312
|
-
(e = ee(this,
|
|
10314
|
+
(e = ee(this, hs)) == null || e.call(this), pe(this, jt, !1);
|
|
10313
10315
|
}
|
|
10314
|
-
}, mn = new WeakMap(),
|
|
10316
|
+
}, mn = new WeakMap(), ls = new WeakMap(), os = new WeakMap(), cs = new WeakMap(), jt = new WeakMap(), ds = new WeakMap(), fn = new WeakMap(), gn = new WeakMap(), pn = new WeakMap(), yn = new WeakMap(), vn = new WeakMap(), us = new WeakMap(), bn = new WeakMap(), xn = new WeakMap(), hs = new WeakMap(), Vr);
|
|
10315
10317
|
function tf(e) {
|
|
10316
10318
|
const t = Ie(e.client), s = ke.useRef(null), {
|
|
10317
10319
|
buttonPosition: a,
|
|
@@ -10390,15 +10392,15 @@ var sf = process.env.NODE_ENV !== "development" ? function() {
|
|
|
10390
10392
|
} : tf;
|
|
10391
10393
|
process.env.NODE_ENV;
|
|
10392
10394
|
const af = () => {
|
|
10393
|
-
|
|
10395
|
+
Gn("dynamic-page-selector", {
|
|
10394
10396
|
description: "Dynamic page selector"
|
|
10395
|
-
}),
|
|
10397
|
+
}), Gn("enable-add-page-dropdown", {
|
|
10396
10398
|
description: "Enable add page dropdown"
|
|
10397
|
-
}),
|
|
10399
|
+
}), Gn("enable-page-revisions-compare", {
|
|
10398
10400
|
description: "Page revisions compare"
|
|
10399
|
-
}),
|
|
10401
|
+
}), Gn("enable-old-page-manager", {
|
|
10400
10402
|
description: "Switch to older page manager"
|
|
10401
|
-
}),
|
|
10403
|
+
}), Gn("enable-site-settings", {
|
|
10402
10404
|
description: "Site settings"
|
|
10403
10405
|
});
|
|
10404
10406
|
}, rf = () => {
|
|
@@ -10409,7 +10411,7 @@ const af = () => {
|
|
|
10409
10411
|
queryFn: async () => t(e, { action: G.GET_COLLECTIONS })
|
|
10410
10412
|
});
|
|
10411
10413
|
}, lf = () => {
|
|
10412
|
-
const { data: e } = We(), { data: t } =
|
|
10414
|
+
const { data: e } = We(), { data: t } = Rt(), { data: s } = Et(), a = de(), r = X(), i = K(() => (s == null ? void 0 : s.fallbackLang) || "en", [s == null ? void 0 : s.fallbackLang]);
|
|
10413
10415
|
return Pe({
|
|
10414
10416
|
mutationFn: async ({ block: l }) => r(a, {
|
|
10415
10417
|
action: G.GET_BLOCK_ASYNC_PROPS,
|
|
@@ -10434,17 +10436,17 @@ const af = () => {
|
|
|
10434
10436
|
});
|
|
10435
10437
|
}, of = () => {
|
|
10436
10438
|
const e = oa();
|
|
10437
|
-
return
|
|
10439
|
+
return ae(
|
|
10438
10440
|
({ pageId: t }) => {
|
|
10439
10441
|
e(t);
|
|
10440
10442
|
},
|
|
10441
10443
|
[e]
|
|
10442
10444
|
);
|
|
10443
|
-
}, cf =
|
|
10445
|
+
}, cf = bo(null), Ca = {
|
|
10444
10446
|
didCatch: !1,
|
|
10445
10447
|
error: null
|
|
10446
10448
|
};
|
|
10447
|
-
class df extends
|
|
10449
|
+
class df extends xo {
|
|
10448
10450
|
constructor(t) {
|
|
10449
10451
|
super(t), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = Ca;
|
|
10450
10452
|
}
|
|
@@ -10525,7 +10527,7 @@ function uf() {
|
|
|
10525
10527
|
return e.length !== t.length || e.some((s, a) => !Object.is(s, t[a]));
|
|
10526
10528
|
}
|
|
10527
10529
|
const hf = () => {
|
|
10528
|
-
const e =
|
|
10530
|
+
const e = gs(), t = Ie(), s = X();
|
|
10529
10531
|
return Pe({
|
|
10530
10532
|
mutationFn: async (a) => {
|
|
10531
10533
|
const r = a.map(async (l) => s(e, {
|
|
@@ -10551,7 +10553,7 @@ const hf = () => {
|
|
|
10551
10553
|
}
|
|
10552
10554
|
});
|
|
10553
10555
|
}, mf = () => {
|
|
10554
|
-
const e =
|
|
10556
|
+
const e = gs(), t = Ie(), s = X();
|
|
10555
10557
|
return Pe({
|
|
10556
10558
|
mutationFn: async (a) => s(e, {
|
|
10557
10559
|
action: G.DELETE_ASSET,
|
|
@@ -10569,7 +10571,7 @@ const hf = () => {
|
|
|
10569
10571
|
}
|
|
10570
10572
|
});
|
|
10571
10573
|
}, ff = () => {
|
|
10572
|
-
const e =
|
|
10574
|
+
const e = gs(), t = Ie(), s = X();
|
|
10573
10575
|
return Pe({
|
|
10574
10576
|
mutationFn: async (a) => s(e, {
|
|
10575
10577
|
action: G.UPDATE_ASSET,
|
|
@@ -10694,7 +10696,7 @@ function gf({
|
|
|
10694
10696
|
] });
|
|
10695
10697
|
}
|
|
10696
10698
|
const pf = (e = {}) => {
|
|
10697
|
-
const t =
|
|
10699
|
+
const t = gs(), s = X(), { search: a, page: r = 1, limit: i = 30 } = e;
|
|
10698
10700
|
return Oe({
|
|
10699
10701
|
queryKey: [G.GET_ASSETS, a, r, i],
|
|
10700
10702
|
queryFn: async () => {
|
|
@@ -10712,7 +10714,7 @@ const pf = (e = {}) => {
|
|
|
10712
10714
|
retry: 1
|
|
10713
10715
|
});
|
|
10714
10716
|
}, yf = (e) => {
|
|
10715
|
-
const t =
|
|
10717
|
+
const t = gs(), s = X();
|
|
10716
10718
|
return Oe({
|
|
10717
10719
|
queryKey: [G.GET_ASSET, e],
|
|
10718
10720
|
queryFn: async () => e ? await s(t, {
|
|
@@ -10880,7 +10882,7 @@ const bf = ({
|
|
|
10880
10882
|
size: "icon",
|
|
10881
10883
|
className: "h-6 w-6",
|
|
10882
10884
|
onClick: () => u(y.value, y.label),
|
|
10883
|
-
children: /* @__PURE__ */ n(
|
|
10885
|
+
children: /* @__PURE__ */ n(Ac, { className: "h-3 w-3" })
|
|
10884
10886
|
}
|
|
10885
10887
|
)
|
|
10886
10888
|
] })
|
|
@@ -10933,10 +10935,10 @@ const bf = ({
|
|
|
10933
10935
|
const p = localStorage.getItem("chai_optimize_images");
|
|
10934
10936
|
return p !== null ? p === "true" : !0;
|
|
10935
10937
|
});
|
|
10936
|
-
|
|
10938
|
+
ne(() => {
|
|
10937
10939
|
localStorage.setItem("chai_optimize_images", i.toString());
|
|
10938
10940
|
}, [i]);
|
|
10939
|
-
const o = e || a, d =
|
|
10941
|
+
const o = e || a, d = ae(
|
|
10940
10942
|
async (p) => {
|
|
10941
10943
|
try {
|
|
10942
10944
|
const y = p;
|
|
@@ -10944,7 +10946,7 @@ const bf = ({
|
|
|
10944
10946
|
return V.error("Invalid file type. Please upload a valid file."), Promise.reject(new Error("Invalid file type"));
|
|
10945
10947
|
const g = y.map(async (N) => {
|
|
10946
10948
|
let I = N;
|
|
10947
|
-
return N.type.startsWith("image/") && (I = await
|
|
10949
|
+
return N.type.startsWith("image/") && (I = await Ji(N)), new Promise((_, k) => {
|
|
10948
10950
|
const E = new FileReader();
|
|
10949
10951
|
E.readAsDataURL(I), E.onload = async () => {
|
|
10950
10952
|
_({
|
|
@@ -10970,7 +10972,7 @@ const bf = ({
|
|
|
10970
10972
|
}), g > 0 && V.error(
|
|
10971
10973
|
`${g === 1 && p.length === 1 ? "File" : g + (g === 1 ? " file" : " files")} exceed the maximum size limit of 10MB.`
|
|
10972
10974
|
), J(y) ? [] : d(y);
|
|
10973
|
-
}, { getRootProps: u, getInputProps: m, isDragActive: v } =
|
|
10975
|
+
}, { getRootProps: u, getInputProps: m, isDragActive: v } = Rc({
|
|
10974
10976
|
onDrop: h,
|
|
10975
10977
|
accept: {
|
|
10976
10978
|
"image/*": t.includes("image") ? [] : []
|
|
@@ -10986,7 +10988,7 @@ const bf = ({
|
|
|
10986
10988
|
"div",
|
|
10987
10989
|
{
|
|
10988
10990
|
...u(),
|
|
10989
|
-
className:
|
|
10991
|
+
className: zn(
|
|
10990
10992
|
"flex h-max w-full cursor-pointer flex-col justify-center rounded-lg text-center",
|
|
10991
10993
|
o ? "items-start" : "items-center",
|
|
10992
10994
|
v ? "border-primary bg-primary/5" : "border-muted-foreground/20"
|
|
@@ -11009,7 +11011,7 @@ const bf = ({
|
|
|
11009
11011
|
"div",
|
|
11010
11012
|
{
|
|
11011
11013
|
className: "flex items-center justify-center rounded-full border border-indigo-500 bg-indigo-100 p-2",
|
|
11012
|
-
children: /* @__PURE__ */ n(
|
|
11014
|
+
children: /* @__PURE__ */ n(kc, { className: "h-4 w-4 text-indigo-500" })
|
|
11013
11015
|
}
|
|
11014
11016
|
),
|
|
11015
11017
|
/* @__PURE__ */ c("div", { className: "text-left", children: [
|
|
@@ -11067,25 +11069,25 @@ const bf = ({
|
|
|
11067
11069
|
}
|
|
11068
11070
|
);
|
|
11069
11071
|
};
|
|
11070
|
-
function
|
|
11072
|
+
function Ql({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
11071
11073
|
const l = K(() => [s], [s]), [o, d] = S(null), [h, u] = S(null), [m, v] = S(null), [p, y] = S({ show: !1, file: "" }), [g, b] = S(!1), [x, N] = S(a ? "details" : "grid"), [I, _] = S(""), [k, E] = S(""), [q, Z] = S(1), [re] = S(30), [L, U] = S([]);
|
|
11072
|
-
|
|
11074
|
+
ne(() => {
|
|
11073
11075
|
a && (d(a), N("details"));
|
|
11074
|
-
}, [a]),
|
|
11076
|
+
}, [a]), ne(() => {
|
|
11075
11077
|
const D = setTimeout(() => {
|
|
11076
11078
|
_(k), Z(1);
|
|
11077
11079
|
}, 300);
|
|
11078
11080
|
return () => clearTimeout(D);
|
|
11079
11081
|
}, [k]);
|
|
11080
|
-
const { data:
|
|
11082
|
+
const { data: $, isLoading: R } = pf({
|
|
11081
11083
|
search: I.toLowerCase().trim(),
|
|
11082
11084
|
page: q,
|
|
11083
11085
|
limit: re
|
|
11084
|
-
}), H = (
|
|
11085
|
-
|
|
11086
|
+
}), H = ($ == null ? void 0 : $.assets) || [], z = ($ == null ? void 0 : $.total) || 0, ie = Math.ceil(z / re);
|
|
11087
|
+
ne(() => {
|
|
11086
11088
|
R || ie <= 0 || Z((D) => D > ie ? ie : D < 1 ? 1 : D);
|
|
11087
11089
|
}, [R, ie]);
|
|
11088
|
-
const Ne = (H == null ? void 0 : H.length) > 0, { mutate: Ee } = mf(), { mutateAsync: me, isPending: w } = hf(), { mutate: f, isPending: P } = ff(), B =
|
|
11090
|
+
const Ne = (H == null ? void 0 : H.length) > 0, { mutate: Ee } = mf(), { mutateAsync: me, isPending: w } = hf(), { mutate: f, isPending: P } = ff(), B = ae(
|
|
11089
11091
|
(D) => {
|
|
11090
11092
|
const te = Math.min(Math.max(1, D), Math.max(1, ie));
|
|
11091
11093
|
te !== q && Z(te);
|
|
@@ -11093,15 +11095,15 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11093
11095
|
[ie, q]
|
|
11094
11096
|
), A = (D) => {
|
|
11095
11097
|
E(D.target.value);
|
|
11096
|
-
}, O =
|
|
11098
|
+
}, O = ae(
|
|
11097
11099
|
(D) => {
|
|
11098
11100
|
U((te) => ve(te, { id: D.id }) ? [] : [D]);
|
|
11099
11101
|
},
|
|
11100
11102
|
[!1]
|
|
11101
|
-
), W =
|
|
11103
|
+
), W = ae(() => {
|
|
11102
11104
|
U([]);
|
|
11103
|
-
}, []),
|
|
11104
|
-
(D == null ? void 0 : D.length) !== 0 && (t(
|
|
11105
|
+
}, []), F = (D) => {
|
|
11106
|
+
(D == null ? void 0 : D.length) !== 0 && (t(ms(Yr(D || L), ["id", "url", "width", "height", "description"])), e());
|
|
11105
11107
|
}, Q = async (D) => {
|
|
11106
11108
|
u(D);
|
|
11107
11109
|
}, ue = async () => {
|
|
@@ -11132,9 +11134,9 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11132
11134
|
} catch (Re) {
|
|
11133
11135
|
console.error("Error saving edited image:", Re);
|
|
11134
11136
|
}
|
|
11135
|
-
}, be =
|
|
11137
|
+
}, be = ae((D) => {
|
|
11136
11138
|
U([D]);
|
|
11137
|
-
}, []), Se =
|
|
11139
|
+
}, []), Se = ae(
|
|
11138
11140
|
(D) => {
|
|
11139
11141
|
B(D);
|
|
11140
11142
|
},
|
|
@@ -11190,7 +11192,7 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11190
11192
|
T,
|
|
11191
11193
|
{
|
|
11192
11194
|
size: "sm",
|
|
11193
|
-
onClick: () =>
|
|
11195
|
+
onClick: () => F(L),
|
|
11194
11196
|
disabled: L.length === 0,
|
|
11195
11197
|
children: "Select Asset"
|
|
11196
11198
|
}
|
|
@@ -11209,21 +11211,21 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11209
11211
|
/* @__PURE__ */ n("div", { className: "h-64 w-full animate-pulse rounded bg-gray-200" }),
|
|
11210
11212
|
/* @__PURE__ */ n("div", { className: "h-64 w-full animate-pulse rounded bg-gray-200" })
|
|
11211
11213
|
] }) : !R && !Ne ? /* @__PURE__ */ c("div", { className: "flex h-full flex-col items-center justify-center rounded-lg border", children: [
|
|
11212
|
-
/* @__PURE__ */ n("div", { className: "text-muted-foreground", children: /* @__PURE__ */ n(
|
|
11214
|
+
/* @__PURE__ */ n("div", { className: "text-muted-foreground", children: /* @__PURE__ */ n(Tc, { className: "h-9 w-9 text-indigo-500" }) }),
|
|
11213
11215
|
/* @__PURE__ */ n("div", { className: "text-lg text-muted-foreground", children: "No assets found" }),
|
|
11214
11216
|
/* @__PURE__ */ n("div", { className: "text-sm text-muted-foreground", children: I.length > 0 ? "No assets found for your search: " + I : "Start uploading assets to get started" }),
|
|
11215
11217
|
/* @__PURE__ */ n("br", {})
|
|
11216
11218
|
] }) : /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-3 p-1", children: H == null ? void 0 : H.map((D) => /* @__PURE__ */ c(
|
|
11217
11219
|
"div",
|
|
11218
11220
|
{
|
|
11219
|
-
className:
|
|
11221
|
+
className: zn(
|
|
11220
11222
|
"group relative flex max-h-[180px] max-w-[180px] cursor-pointer flex-col justify-between overflow-hidden rounded-lg border-2 transition-all",
|
|
11221
11223
|
L.some((te) => te.id === D.id) ? "border-blue-500" : "hover:border-black/90",
|
|
11222
11224
|
m && (h == null ? void 0 : h.id) === D.id ? "pointer-events-none opacity-50" : "",
|
|
11223
11225
|
m === D.id ? "pointer-events-none opacity-50" : ""
|
|
11224
11226
|
),
|
|
11225
11227
|
onClick: () => O(D),
|
|
11226
|
-
onDoubleClick: () =>
|
|
11228
|
+
onDoubleClick: () => F([D]),
|
|
11227
11229
|
children: [
|
|
11228
11230
|
/* @__PURE__ */ c("div", { className: "aspect-square relative overflow-hidden", children: [
|
|
11229
11231
|
m === D.id ? /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ n(wt, { className: "h-8 w-8 animate-spin text-white" }) }) : null,
|
|
@@ -11235,7 +11237,7 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11235
11237
|
className: `h-full min-h-[80px] w-full object-contain ${L.some((te) => te.id === D.id) ? "" : "group-hover:blur group-hover:contrast-50"}`
|
|
11236
11238
|
}
|
|
11237
11239
|
) : /* @__PURE__ */ c("div", { className: "flex h-full items-center justify-center", children: [
|
|
11238
|
-
/* @__PURE__ */ n(
|
|
11240
|
+
/* @__PURE__ */ n(Cc, { className: "h-12 w-12 text-muted-foreground" }),
|
|
11239
11241
|
D.thumbnailUrl && /* @__PURE__ */ n(
|
|
11240
11242
|
"img",
|
|
11241
11243
|
{
|
|
@@ -11261,7 +11263,7 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11261
11263
|
onClick: (te) => {
|
|
11262
11264
|
te.stopPropagation(), j(D);
|
|
11263
11265
|
},
|
|
11264
|
-
children: /* @__PURE__ */ n(
|
|
11266
|
+
children: /* @__PURE__ */ n(Wn, { className: "h-4 w-4" })
|
|
11265
11267
|
}
|
|
11266
11268
|
) }),
|
|
11267
11269
|
/* @__PURE__ */ n(et, { children: /* @__PURE__ */ n("p", { children: "View Details" }) })
|
|
@@ -11296,7 +11298,7 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11296
11298
|
name: D.name
|
|
11297
11299
|
});
|
|
11298
11300
|
},
|
|
11299
|
-
children: /* @__PURE__ */ n(
|
|
11301
|
+
children: /* @__PURE__ */ n(Hn, { className: "h-4 w-4" })
|
|
11300
11302
|
}
|
|
11301
11303
|
) }),
|
|
11302
11304
|
/* @__PURE__ */ n(et, { children: /* @__PURE__ */ n("p", { children: "Edit Image" }) })
|
|
@@ -11353,7 +11355,7 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11353
11355
|
b(!0);
|
|
11354
11356
|
try {
|
|
11355
11357
|
const te = H.find((Re) => Re.id === o);
|
|
11356
|
-
te && await f(
|
|
11358
|
+
te && await f(yo(te, { description: D }));
|
|
11357
11359
|
} finally {
|
|
11358
11360
|
b(!1);
|
|
11359
11361
|
}
|
|
@@ -11388,7 +11390,7 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11388
11390
|
'"? This action cannot be undone.'
|
|
11389
11391
|
] })
|
|
11390
11392
|
] }),
|
|
11391
|
-
/* @__PURE__ */ c(
|
|
11393
|
+
/* @__PURE__ */ c(mt, { className: "gap-2 sm:gap-0", children: [
|
|
11392
11394
|
/* @__PURE__ */ n(T, { variant: "outline", onClick: () => u(null), children: "Cancel" }),
|
|
11393
11395
|
/* @__PURE__ */ n(T, { variant: "destructive", onClick: ue, children: "Delete" })
|
|
11394
11396
|
] })
|
|
@@ -11397,7 +11399,7 @@ function Jl({ close: e, onSelect: t, mode: s = "image", assetId: a }) {
|
|
|
11397
11399
|
}
|
|
11398
11400
|
const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11399
11401
|
__proto__: null,
|
|
11400
|
-
default:
|
|
11402
|
+
default: Ql
|
|
11401
11403
|
}, Symbol.toStringTag, { value: "Module" })), Wa = ({
|
|
11402
11404
|
assetId: e,
|
|
11403
11405
|
assetUrl: t,
|
|
@@ -11412,7 +11414,7 @@ const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11412
11414
|
o(!1);
|
|
11413
11415
|
}, u = (p) => {
|
|
11414
11416
|
const y = Array.isArray(p) ? p[0] : p;
|
|
11415
|
-
y != null && y.url && s(
|
|
11417
|
+
y != null && y.url && s(ms(y, ["url", "id"])), o(!1);
|
|
11416
11418
|
}, m = () => {
|
|
11417
11419
|
s({ url: "", id: "" });
|
|
11418
11420
|
}, v = (t == null ? void 0 : t.startsWith("{{")) && (t == null ? void 0 : t.endsWith("}}"));
|
|
@@ -11449,7 +11451,7 @@ const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11449
11451
|
className: "h-8 w-8 rounded-full bg-white/80 hover:bg-white/90",
|
|
11450
11452
|
onClick: d,
|
|
11451
11453
|
disabled: i,
|
|
11452
|
-
children: /* @__PURE__ */ n(
|
|
11454
|
+
children: /* @__PURE__ */ n(Wn, { className: "h-4 w-4" })
|
|
11453
11455
|
}
|
|
11454
11456
|
)
|
|
11455
11457
|
] })
|
|
@@ -11459,7 +11461,7 @@ const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11459
11461
|
className: `flex cursor-pointer items-center justify-center rounded-md border border-dashed p-6 ${i ? "cursor-not-allowed opacity-50" : "hover:border-gray-400"}`,
|
|
11460
11462
|
onClick: d,
|
|
11461
11463
|
children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2", children: [
|
|
11462
|
-
/* @__PURE__ */ n(
|
|
11464
|
+
/* @__PURE__ */ n(Wn, { className: "h-10 w-10 text-gray-400" }),
|
|
11463
11465
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500", children: r })
|
|
11464
11466
|
] })
|
|
11465
11467
|
}
|
|
@@ -11480,7 +11482,7 @@ const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11480
11482
|
)
|
|
11481
11483
|
] }),
|
|
11482
11484
|
/* @__PURE__ */ n("div", { className: "h-full flex-1 p-4", children: /* @__PURE__ */ n(
|
|
11483
|
-
|
|
11485
|
+
Ql,
|
|
11484
11486
|
{
|
|
11485
11487
|
close: h,
|
|
11486
11488
|
onSelect: u,
|
|
@@ -11855,14 +11857,14 @@ const Ef = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11855
11857
|
button: kf,
|
|
11856
11858
|
panel: Pf
|
|
11857
11859
|
});
|
|
11858
|
-
}, _f =
|
|
11860
|
+
}, _f = wo(() => Promise.resolve().then(() => Ef));
|
|
11859
11861
|
af();
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
+
Gc();
|
|
11863
|
+
Oo(Xu);
|
|
11862
11864
|
Ih();
|
|
11863
11865
|
If();
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
+
Ro(_f);
|
|
11867
|
+
Go(Ed);
|
|
11866
11868
|
const Lf = (e) => {
|
|
11867
11869
|
const t = tt([]), [s] = He(), a = s.get("page"), { data: r } = We(), {
|
|
11868
11870
|
data: i = {
|
|
@@ -11870,9 +11872,9 @@ const Lf = (e) => {
|
|
|
11870
11872
|
permissions: null
|
|
11871
11873
|
}
|
|
11872
11874
|
} = sh();
|
|
11873
|
-
nh(),
|
|
11874
|
-
const { data: l, isFetching: o } =
|
|
11875
|
-
|
|
11875
|
+
nh(), od();
|
|
11876
|
+
const { data: l, isFetching: o } = Hi(), { blocks: d } = th(l), { data: h } = Ge(), { mutateAsync: u } = Mi(), m = Zu(), { onSave: v } = ah(), { getPartialBlocks: p, getPartialBlockBlocks: y } = rh(), { aiContext: g, setAiContext: b } = er(), { mutateAsync: x } = Ad(), [N, I] = S(!1), { data: _ } = Et(), k = Gt(), { data: E } = Wi(), { data: q } = rf(), { mutateAsync: Z } = lf(), re = of();
|
|
11877
|
+
Qc(), ne(() => {
|
|
11876
11878
|
const R = () => {
|
|
11877
11879
|
document.hidden ? I(!0) : I(!1);
|
|
11878
11880
|
};
|
|
@@ -11881,13 +11883,13 @@ const Lf = (e) => {
|
|
|
11881
11883
|
const L = K(() => {
|
|
11882
11884
|
const R = {};
|
|
11883
11885
|
return i && (R.permissions = M(i, "permissions", null), R.role = M(i, "role", "user")), R;
|
|
11884
|
-
}, [i]), U =
|
|
11886
|
+
}, [i]), U = ae(
|
|
11885
11887
|
async (R, H) => await x({ pageType: R, query: H }),
|
|
11886
11888
|
[x]
|
|
11887
|
-
),
|
|
11889
|
+
), $ = K(() => M(_, "theme", {}) || {}, [_]);
|
|
11888
11890
|
return /* @__PURE__ */ c(ce, { children: [
|
|
11889
11891
|
/* @__PURE__ */ n(
|
|
11890
|
-
|
|
11892
|
+
Uo,
|
|
11891
11893
|
{
|
|
11892
11894
|
gotoPage: re,
|
|
11893
11895
|
collections: q ?? [],
|
|
@@ -11908,7 +11910,7 @@ const Lf = (e) => {
|
|
|
11908
11910
|
getPartialBlockBlocks: y,
|
|
11909
11911
|
getPartialBlocks: p,
|
|
11910
11912
|
blocks: o ? [] : d,
|
|
11911
|
-
theme:
|
|
11913
|
+
theme: vo($),
|
|
11912
11914
|
pageTypes: h,
|
|
11913
11915
|
searchPageTypeItems: U,
|
|
11914
11916
|
saveAiContextCallback: async (R) => {
|
|
@@ -11928,18 +11930,18 @@ const Lf = (e) => {
|
|
|
11928
11930
|
_type: "@chai/ai-context",
|
|
11929
11931
|
_value: Ia(g) ? g : ""
|
|
11930
11932
|
}, Ne = [...R, ie];
|
|
11931
|
-
return await v({ page: a, blocks: Ne, needTranslations: z }), t.current = Ne, Us(H,
|
|
11933
|
+
return await v({ page: a, blocks: Ne, needTranslations: z }), t.current = Ne, Us(H, $) || await u({ settings: { theme: H } }), !0;
|
|
11932
11934
|
},
|
|
11933
|
-
themePanelComponent:
|
|
11935
|
+
themePanelComponent: Od,
|
|
11934
11936
|
...L
|
|
11935
11937
|
}
|
|
11936
11938
|
),
|
|
11937
11939
|
/* @__PURE__ */ c("div", { children: [
|
|
11938
|
-
/* @__PURE__ */ n(
|
|
11939
|
-
/* @__PURE__ */ n(
|
|
11940
|
+
/* @__PURE__ */ n(hd, {}),
|
|
11941
|
+
/* @__PURE__ */ n(md, {})
|
|
11940
11942
|
] })
|
|
11941
11943
|
] });
|
|
11942
|
-
}, Df = new
|
|
11944
|
+
}, Df = new No({
|
|
11943
11945
|
defaultOptions: {
|
|
11944
11946
|
queries: {
|
|
11945
11947
|
refetchOnWindowFocus: !1,
|
|
@@ -11948,8 +11950,8 @@ const Lf = (e) => {
|
|
|
11948
11950
|
}
|
|
11949
11951
|
}), Tg = (e) => {
|
|
11950
11952
|
const { isLoggedIn: t } = ot(), [, s] = Fi(), [a, r] = S(!1);
|
|
11951
|
-
return
|
|
11952
|
-
|
|
11953
|
+
return ne(() => (s(
|
|
11954
|
+
ms(e, [
|
|
11953
11955
|
"apiUrl",
|
|
11954
11956
|
"usersApiUrl",
|
|
11955
11957
|
"assetsApiUrl",
|
|
@@ -11964,12 +11966,12 @@ const Lf = (e) => {
|
|
|
11964
11966
|
r(!0);
|
|
11965
11967
|
}, 200), () => {
|
|
11966
11968
|
r(!1), s({});
|
|
11967
|
-
}), [e, s]), a ? /* @__PURE__ */ c(
|
|
11969
|
+
}), [e, s]), a ? /* @__PURE__ */ c(Eo, { client: Df, children: [
|
|
11968
11970
|
t ? /* @__PURE__ */ n(Lf, { ...e }) : /* @__PURE__ */ n(oh, {}),
|
|
11969
11971
|
/* @__PURE__ */ n(sf, {})
|
|
11970
11972
|
] }) : /* @__PURE__ */ n("div", {});
|
|
11971
11973
|
}, Cg = () => {
|
|
11972
|
-
const e = de(), t = X(), { data: s } =
|
|
11974
|
+
const e = de(), t = X(), { data: s } = Rt(), a = Ie();
|
|
11973
11975
|
return Pe({
|
|
11974
11976
|
mutationFn: async (r) => {
|
|
11975
11977
|
if (!(s != null && s.id))
|
|
@@ -11995,7 +11997,7 @@ const Lf = (e) => {
|
|
|
11995
11997
|
});
|
|
11996
11998
|
}, kg = () => {
|
|
11997
11999
|
const { logout: e } = ot(), { getAccessToken: t } = Ui();
|
|
11998
|
-
return
|
|
12000
|
+
return ae(
|
|
11999
12001
|
async ({
|
|
12000
12002
|
url: s,
|
|
12001
12003
|
method: a = "GET",
|
|
@@ -12032,7 +12034,7 @@ const Lf = (e) => {
|
|
|
12032
12034
|
if (typeof window > "u")
|
|
12033
12035
|
throw new Error("@chaibuilder/pages is not available on the server");
|
|
12034
12036
|
export {
|
|
12035
|
-
|
|
12037
|
+
gl as $,
|
|
12036
12038
|
xg as A,
|
|
12037
12039
|
wg as B,
|
|
12038
12040
|
Xf as C,
|
|
@@ -12058,34 +12060,34 @@ export {
|
|
|
12058
12060
|
tg as W,
|
|
12059
12061
|
Tg as X,
|
|
12060
12062
|
Pt as Y,
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
12063
|
+
Rt as Z,
|
|
12064
|
+
Wi as _,
|
|
12065
|
+
Al as a,
|
|
12066
|
+
Gt as a0,
|
|
12065
12067
|
of as a1,
|
|
12066
12068
|
Ge as a2,
|
|
12067
12069
|
Cg as a3,
|
|
12068
12070
|
lt as a4,
|
|
12069
|
-
|
|
12071
|
+
ol as a5,
|
|
12070
12072
|
Wa as a6,
|
|
12071
12073
|
_r as a7,
|
|
12072
12074
|
Yf as a8,
|
|
12073
12075
|
Na as a9,
|
|
12074
12076
|
We as aa,
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
+
ht as ab,
|
|
12078
|
+
vs as ac,
|
|
12077
12079
|
Et as ad,
|
|
12078
12080
|
ot as ae,
|
|
12079
12081
|
sh as af,
|
|
12080
12082
|
kg as ag,
|
|
12081
12083
|
X as ah,
|
|
12082
12084
|
St as ai,
|
|
12083
|
-
|
|
12085
|
+
sd as aj,
|
|
12084
12086
|
Le as b,
|
|
12085
12087
|
Me as c,
|
|
12086
12088
|
rm as d,
|
|
12087
|
-
|
|
12088
|
-
|
|
12089
|
+
vl as e,
|
|
12090
|
+
Tl as f,
|
|
12089
12091
|
Ag as g,
|
|
12090
12092
|
Hh as h,
|
|
12091
12093
|
ng as i,
|
|
@@ -12095,7 +12097,7 @@ export {
|
|
|
12095
12097
|
Eg as m,
|
|
12096
12098
|
dg as n,
|
|
12097
12099
|
Zf as o,
|
|
12098
|
-
|
|
12100
|
+
Qn as p,
|
|
12099
12101
|
Gh as q,
|
|
12100
12102
|
mm as r,
|
|
12101
12103
|
Ng as s,
|