@chaibuilder/pages 0.4.10 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{B4MFY5CR-CbOhoSHj.cjs → B4MFY5CR-CMKhm_cO.cjs} +1 -1
- package/dist/{B4MFY5CR-BpnhFElu.js → B4MFY5CR-U296-XCc.js} +1 -1
- package/dist/{HO4MOOFI-D-nc_Jzj.cjs → HO4MOOFI-Cl7Y_Hiz.cjs} +1 -1
- package/dist/{HO4MOOFI-BaJU6Rmt.js → HO4MOOFI-DlO9_sj0.js} +2 -2
- package/dist/{HUY7CZI3-C24G2dcQ.js → HUY7CZI3-DGBcR9kM.js} +2 -2
- package/dist/{HUY7CZI3-CdUTm9km.cjs → HUY7CZI3-DIo60go4.cjs} +1 -1
- package/dist/{digital-asset-manager-Dx_Fm4jg.cjs → digital-asset-manager-ITE5Abrb.cjs} +1 -1
- package/dist/{digital-asset-manager-k8g3Euye.js → digital-asset-manager-pEAK8sn7.js} +1 -1
- package/dist/{index-Dg4tr4yA.cjs → index-B9Lp7kXg.cjs} +2 -2
- package/dist/{index-CYSpXUSz.js → index-CMdQT0mW.js} +530 -494
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.js +10 -9
- package/package.json +2 -7
|
@@ -4,20 +4,20 @@ var Ls = (e) => {
|
|
|
4
4
|
var Ds = (e, t, n) => t.has(e) || Ls("Cannot " + n);
|
|
5
5
|
var B = (e, t, n) => (Ds(e, t, "read from private field"), n ? n.call(e) : t.get(e)), ce = (e, t, n) => t.has(e) ? Ls("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ie = (e, t, n, s) => (Ds(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
|
|
6
6
|
import { jsx as r, jsxs as u, Fragment as Ne } from "react/jsx-runtime";
|
|
7
|
-
import { get as le, isEmpty as ye, reverse as
|
|
7
|
+
import { get as le, isEmpty as ye, reverse as Ba, sortBy as Ma, each as Fa, find as Ee, set as qa, has as sn, startsWith as Ot, isEqual as is, map as qe, toLower as Gt, trim as ja, filter as Ie, startCase as It, groupBy as Ha, compact as Nn, includes as Ft, concat as Js, endsWith as er, orderBy as mn, first as Ka, uniq as Va, debounce as za, pick as tr, keys as $a, pickBy as Wa, isArray as Ya, noop as Qa, isFunction as Xa, cloneDeep as Za, isString as Gs } from "lodash-es";
|
|
8
8
|
import * as ge from "react";
|
|
9
|
-
import nr, { useCallback as
|
|
9
|
+
import nr, { useCallback as xe, useMemo as $, useState as P, useEffect as Ae, useRef as ut, Suspense as Ja, lazy as ei } from "react";
|
|
10
10
|
import { useAtom as Dn, atom as ls } from "jotai";
|
|
11
|
-
import { useQueryClient as
|
|
11
|
+
import { useQueryClient as Te, useQuery as Pe, useMutation as _e, onlineManager as sr, QueryClient as ti, QueryClientProvider as ni } from "@tanstack/react-query";
|
|
12
12
|
import { toast as J } from "sonner";
|
|
13
|
-
import { useLanguages as dt, useUpdateBlocksPropsRealtime as rr, PERMISSIONS as
|
|
14
|
-
import { Card as cs, CardHeader as us, CardTitle as ds, CardContent as hs, CardFooter as ms, Button as C, AlertDialog as ar, AlertDialogTrigger as ir, AlertDialogContent as lr, AlertDialogHeader as or, AlertDialogTitle as cr, AlertDialogDescription as ur, AlertDialogFooter as dr, AlertDialogCancel as hr, AlertDialogAction as mr, Popover as fr, PopoverTrigger as gr, PopoverContent as pr, Input as we, Label as re, Dialog as
|
|
15
|
-
import { LockIcon as Nr, UserIcon as
|
|
16
|
-
import { format as Gn, formatDistanceToNow as
|
|
17
|
-
import { useRegisteredChaiBlocks as
|
|
13
|
+
import { useLanguages as dt, useUpdateBlocksPropsRealtime as rr, PERMISSIONS as si, usePartailBlocksStore as ri, usePermissions as Lt, useLibraryBlocks as ai, useTheme as ii, useSavePage as os, mergeClasses as li, useRightPanel as oi, useBlocksStore as ci, getBlocksFromHTML as ui, useTranslation as di, useSidebarActivePanel as hi, registerChaiSidebarPanel as $n, registerChaiTopBar as mi, registerChaiMediaManager as fi, registerChaiSaveToLibrary as gi, ChaiBuilderEditor as pi } from "@chaibuilder/sdk";
|
|
14
|
+
import { Card as cs, CardHeader as us, CardTitle as ds, CardContent as hs, CardFooter as ms, Button as C, AlertDialog as ar, AlertDialogTrigger as ir, AlertDialogContent as lr, AlertDialogHeader as or, AlertDialogTitle as cr, AlertDialogDescription as ur, AlertDialogFooter as dr, AlertDialogCancel as hr, AlertDialogAction as mr, Popover as fr, PopoverTrigger as gr, PopoverContent as pr, Input as we, Label as re, Dialog as He, DialogContent as Ke, DialogHeader as Ve, DialogTitle as ze, DialogDescription as Qe, Alert as yr, DialogFooter as et, DropdownMenu as rn, DropdownMenuTrigger as an, DropdownMenuContent as ln, DropdownMenuItem as Ge, Textarea as Ut, Select as yi, SelectTrigger as vi, SelectValue as Ei, SelectContent as bi, SelectItem as wi, Badge as qn, Sheet as vr, SheetContent as Er, SheetHeader as br, SheetTitle as wr, Separator as Si, TooltipProvider as Sr, Tooltip as fs, SheetTrigger as Ni, TooltipTrigger as gs, ScrollArea as Ai, TooltipContent as ps, Skeleton as fn, DropdownMenuSeparator as xi, CardDescription as Ti, Command as Ci, CommandInput as Pi, CommandList as _i, CommandEmpty as Ii, CommandGroup as ki, CommandItem as Us, AlertDescription as Li, Accordion as Di, AccordionItem as gn, AccordionTrigger as pn, AccordionContent as yn, HoverCard as Gi, HoverCardTrigger as Ui, HoverCardContent as Ri } from "@chaibuilder/sdk/ui";
|
|
15
|
+
import { LockIcon as Nr, UserIcon as Oi, AlertTriangleIcon as Bi, Trash2 as Ar, Plus as ys, ImageIcon as xr, X as Tr, AlertCircle as Cr, StarIcon as Mi, MoreHorizontal as vs, PencilIcon as Fi, Power as Pr, TrashIcon as qi, Tag as ji, File as on, Search as Hi, StarsIcon as Ki, Globe as Vi, Pencil as zi, Trash as Es, SquareLibrary as Rs, Logs as $i, Loader as _r, Languages as Wi, ChevronDown as Ir, Star as Yi, History as Os, ArrowUpRight as Qi, Clock as Xi, Undo2 as kr, CloudOff as Zi, Edit as Ji, Save as Lr, GlobeIcon as el, Eye as Dr, Palette as tl, CheckCircle as nl, Send as Bs, Rocket as Ms, Settings as sl, ExternalLink as rl, EyeOff as al, Loader2 as Gr, LanguagesIcon as il, DatabaseIcon as ll, ChevronLeft as ol, ChevronRight as cl, User as ul } from "lucide-react";
|
|
16
|
+
import { format as Gn, formatDistanceToNow as dl } from "date-fns";
|
|
17
|
+
import { useRegisteredChaiBlocks as hl, getDefaultBlockProps as ml } from "@chaibuilder/runtime";
|
|
18
18
|
import { z as An } from "zod";
|
|
19
|
-
import { loadWebBlocks as
|
|
20
|
-
const
|
|
19
|
+
import { loadWebBlocks as fl } from "@chaibuilder/sdk/web-blocks";
|
|
20
|
+
const je = {
|
|
21
21
|
ab: "Abkhazian",
|
|
22
22
|
aa: "Afar",
|
|
23
23
|
af: "Afrikaans",
|
|
@@ -252,29 +252,29 @@ const He = {
|
|
|
252
252
|
DELETE_ASSET: "DELETE_ASSET",
|
|
253
253
|
UPDATE_ASSET: "UPDATE_ASSET",
|
|
254
254
|
GET_ASSETS: "GET_ASSETS"
|
|
255
|
-
},
|
|
256
|
-
let
|
|
255
|
+
}, W = "chaibuilder";
|
|
256
|
+
let gl = 0;
|
|
257
257
|
function Fs(e, t) {
|
|
258
|
-
const n = `atom${++
|
|
258
|
+
const n = `atom${++gl}`, s = {
|
|
259
259
|
toString() {
|
|
260
260
|
return n;
|
|
261
261
|
}
|
|
262
262
|
};
|
|
263
|
-
return typeof e == "function" ? s.read = e : (s.init = e, s.read =
|
|
263
|
+
return typeof e == "function" ? s.read = e : (s.init = e, s.read = pl, s.write = yl), t && (s.write = t), s;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function pl(e) {
|
|
266
266
|
return e(this);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function yl(e, t, n) {
|
|
269
269
|
return t(
|
|
270
270
|
this,
|
|
271
271
|
typeof n == "function" ? n(e(this)) : n
|
|
272
272
|
);
|
|
273
273
|
}
|
|
274
|
-
const
|
|
274
|
+
const vl = Symbol(
|
|
275
275
|
""
|
|
276
|
-
),
|
|
277
|
-
function
|
|
276
|
+
), El = (e) => typeof (e == null ? void 0 : e.then) == "function";
|
|
277
|
+
function bl(e = () => {
|
|
278
278
|
try {
|
|
279
279
|
return window.localStorage;
|
|
280
280
|
} catch {
|
|
@@ -297,7 +297,7 @@ function El(e = () => {
|
|
|
297
297
|
}
|
|
298
298
|
return a;
|
|
299
299
|
}, v = (h = (f = e()) == null ? void 0 : f.getItem(c)) != null ? h : null;
|
|
300
|
-
return
|
|
300
|
+
return El(v) ? v.then(y) : y(v);
|
|
301
301
|
},
|
|
302
302
|
setItem: (c, d) => {
|
|
303
303
|
var f;
|
|
@@ -336,8 +336,8 @@ function El(e = () => {
|
|
|
336
336
|
};
|
|
337
337
|
}), o && (i.subscribe = l(o)), i;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
function
|
|
339
|
+
const wl = bl();
|
|
340
|
+
function Sl(e, t, n = wl, s) {
|
|
341
341
|
const a = Fs(
|
|
342
342
|
t
|
|
343
343
|
);
|
|
@@ -349,12 +349,12 @@ function wl(e, t, n = bl, s) {
|
|
|
349
349
|
(l) => l(a),
|
|
350
350
|
(l, o, c) => {
|
|
351
351
|
const d = typeof c == "function" ? c(l(a)) : c;
|
|
352
|
-
return d ===
|
|
352
|
+
return d === vl ? (o(a, t), n.removeItem(e)) : d instanceof Promise ? d.then((f) => (o(a, f), n.setItem(e, f))) : (o(a, d), n.setItem(e, d));
|
|
353
353
|
}
|
|
354
354
|
);
|
|
355
355
|
}
|
|
356
|
-
const
|
|
357
|
-
const [e, t] = Dn(
|
|
356
|
+
const Nl = Sl("__chai__user", null), tt = () => {
|
|
357
|
+
const [e, t] = Dn(Nl), n = xe(() => {
|
|
358
358
|
t(null);
|
|
359
359
|
}, [t]);
|
|
360
360
|
return {
|
|
@@ -363,8 +363,8 @@ const Sl = wl("__chai__user", null), rt = () => {
|
|
|
363
363
|
setUser: t,
|
|
364
364
|
logout: n
|
|
365
365
|
};
|
|
366
|
-
},
|
|
367
|
-
const { user: e, setUser: t, logout: n } =
|
|
366
|
+
}, Ur = () => {
|
|
367
|
+
const { user: e, setUser: t, logout: n } = tt(), s = Un(), a = Te();
|
|
368
368
|
return Pe({
|
|
369
369
|
queryKey: ["refresh_token"],
|
|
370
370
|
queryFn: async () => {
|
|
@@ -385,7 +385,7 @@ const Sl = wl("__chai__user", null), rt = () => {
|
|
|
385
385
|
if (i.ok) {
|
|
386
386
|
const l = await i.json();
|
|
387
387
|
t(l), a.invalidateQueries({
|
|
388
|
-
queryKey: [
|
|
388
|
+
queryKey: [W],
|
|
389
389
|
refetchType: "all"
|
|
390
390
|
});
|
|
391
391
|
} else
|
|
@@ -412,11 +412,11 @@ if (import.meta.vitest) {
|
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
414
|
const Zu = () => {
|
|
415
|
-
const { user: e } =
|
|
415
|
+
const { user: e } = tt(), t = nt("onSessionExpired"), n = $(
|
|
416
416
|
() => e == null ? void 0 : e.accessToken,
|
|
417
417
|
[e == null ? void 0 : e.accessToken]
|
|
418
418
|
);
|
|
419
|
-
return
|
|
419
|
+
return xe(
|
|
420
420
|
async (s, a, i = {}) => {
|
|
421
421
|
if (!n) {
|
|
422
422
|
console.log("no auth token");
|
|
@@ -444,11 +444,11 @@ const Zu = () => {
|
|
|
444
444
|
[n, t]
|
|
445
445
|
);
|
|
446
446
|
}, X = () => {
|
|
447
|
-
const { user: e } =
|
|
447
|
+
const { user: e } = tt(), t = $(
|
|
448
448
|
() => e == null ? void 0 : e.accessToken,
|
|
449
449
|
[e == null ? void 0 : e.accessToken]
|
|
450
|
-
), { refetch: n } =
|
|
451
|
-
return
|
|
450
|
+
), { refetch: n } = Ur();
|
|
451
|
+
return xe(
|
|
452
452
|
async (s, a, i = {}) => {
|
|
453
453
|
if (t)
|
|
454
454
|
try {
|
|
@@ -469,18 +469,18 @@ const Zu = () => {
|
|
|
469
469
|
},
|
|
470
470
|
[t, n]
|
|
471
471
|
);
|
|
472
|
-
},
|
|
473
|
-
const e = ee(), t =
|
|
472
|
+
}, Rr = () => {
|
|
473
|
+
const e = ee(), t = Te(), n = X();
|
|
474
474
|
return _e({
|
|
475
475
|
mutationFn: async (s) => n(e, { action: _.RELEASE_LOCK, data: s }),
|
|
476
476
|
onSuccess: () => {
|
|
477
477
|
t.invalidateQueries({
|
|
478
|
-
queryKey: [
|
|
478
|
+
queryKey: [W, _.GET_DRAFT_PAGE]
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
481
|
});
|
|
482
|
-
},
|
|
483
|
-
const e = ee(), t =
|
|
482
|
+
}, Or = () => {
|
|
483
|
+
const e = ee(), t = Te(), n = X();
|
|
484
484
|
return _e({
|
|
485
485
|
mutationFn: async (s) => n(e, {
|
|
486
486
|
action: _.UPDATE_WEBSITE_SETTINGS,
|
|
@@ -489,7 +489,7 @@ const Zu = () => {
|
|
|
489
489
|
onSuccess: (s, a) => {
|
|
490
490
|
var i;
|
|
491
491
|
t.invalidateQueries({
|
|
492
|
-
queryKey: [
|
|
492
|
+
queryKey: [W, _.GET_WEBSITE_DRAFT_SETTINGS]
|
|
493
493
|
}), (i = a == null ? void 0 : a.settings) != null && i.theme || J.success("Website settings updated successfully.");
|
|
494
494
|
},
|
|
495
495
|
onError: (s) => {
|
|
@@ -499,12 +499,12 @@ const Zu = () => {
|
|
|
499
499
|
}
|
|
500
500
|
});
|
|
501
501
|
}, Al = () => {
|
|
502
|
-
const e = ee(), t =
|
|
502
|
+
const e = ee(), t = Te(), n = X();
|
|
503
503
|
return _e({
|
|
504
504
|
mutationFn: async (s) => n(e, { action: _.UPDATE_WEBSITE_DATA, data: s }),
|
|
505
505
|
onSuccess: () => {
|
|
506
506
|
t.invalidateQueries({
|
|
507
|
-
queryKey: [
|
|
507
|
+
queryKey: [W, _.GET_WEBSITE_DATA]
|
|
508
508
|
}), J.success("Website data updated successfully.");
|
|
509
509
|
},
|
|
510
510
|
onError: (s) => {
|
|
@@ -527,21 +527,21 @@ function Re() {
|
|
|
527
527
|
};
|
|
528
528
|
}, []), [e, t];
|
|
529
529
|
}
|
|
530
|
-
const xl = ls({}),
|
|
531
|
-
const [e] = Re(), t = e.get("page"), n = ut(""), { mutate: s } =
|
|
530
|
+
const xl = ls({}), Br = () => Dn(xl), Tl = () => {
|
|
531
|
+
const [e] = Re(), t = e.get("page"), n = ut(""), { mutate: s } = Rr();
|
|
532
532
|
Ae(() => {
|
|
533
533
|
!ye(n.current) && t !== n.current && s({ id: n.current }), n.current = t;
|
|
534
534
|
}, [t, s, n]);
|
|
535
|
-
},
|
|
536
|
-
const [n] =
|
|
537
|
-
return
|
|
535
|
+
}, nt = (e, t) => {
|
|
536
|
+
const [n] = Br();
|
|
537
|
+
return $(
|
|
538
538
|
() => le(n, e, t),
|
|
539
539
|
[n, e, t]
|
|
540
540
|
);
|
|
541
|
-
}, ee = () =>
|
|
541
|
+
}, ee = () => nt("apiUrl", "/chai/api"), Un = () => nt("usersApiUrl", "/chai/users"), Ju = () => nt("assetsApiUrl", "/chai/assets"), cn = () => {
|
|
542
542
|
const e = ee(), [t] = Re(), n = t.get("page"), s = X();
|
|
543
543
|
return Pe({
|
|
544
|
-
queryKey: [
|
|
544
|
+
queryKey: [W, _.GET_LANGUAGE_PAGES, n],
|
|
545
545
|
initialData: [],
|
|
546
546
|
queryFn: async () => {
|
|
547
547
|
if (!n) return null;
|
|
@@ -549,7 +549,7 @@ const xl = ls({}), Or = () => Dn(xl), Tl = () => {
|
|
|
549
549
|
action: _.GET_LANGUAGE_PAGES,
|
|
550
550
|
data: { id: n }
|
|
551
551
|
});
|
|
552
|
-
return
|
|
552
|
+
return Ba(Ma(a, "primaryPage"));
|
|
553
553
|
},
|
|
554
554
|
enabled: !!n
|
|
555
555
|
});
|
|
@@ -567,22 +567,22 @@ const xl = ls({}), Or = () => Dn(xl), Tl = () => {
|
|
|
567
567
|
data: { draft: !0 }
|
|
568
568
|
})
|
|
569
569
|
});
|
|
570
|
-
},
|
|
571
|
-
const { fallbackLang: t } = dt(), { data: n } = un(), { data: s, isFetching: a } = cn(), i =
|
|
570
|
+
}, Mr = (e) => {
|
|
571
|
+
const { fallbackLang: t } = dt(), { data: n } = un(), { data: s, isFetching: a } = cn(), i = $(() => {
|
|
572
572
|
const l = { [t]: !0 };
|
|
573
|
-
return
|
|
573
|
+
return Fa(le(n, "languages"), (o) => {
|
|
574
574
|
const c = Ee(s, { lang: o });
|
|
575
575
|
l[o] = !!c;
|
|
576
576
|
}), l;
|
|
577
577
|
}, [t, s, n]);
|
|
578
578
|
return a || ye(e) || e && i[e];
|
|
579
579
|
}, ws = () => {
|
|
580
|
-
const e =
|
|
580
|
+
const e = Te(), { data: t } = Pe({
|
|
581
581
|
queryKey: ["chaibuilder", _.AI_CONTEXT],
|
|
582
582
|
initialData: "",
|
|
583
583
|
queryFn: () => ""
|
|
584
584
|
});
|
|
585
|
-
return { setAiContext:
|
|
585
|
+
return { setAiContext: xe(
|
|
586
586
|
(s) => {
|
|
587
587
|
e.setQueryData([_.AI_CONTEXT], s);
|
|
588
588
|
},
|
|
@@ -591,20 +591,20 @@ const xl = ls({}), Or = () => Dn(xl), Tl = () => {
|
|
|
591
591
|
}, Rn = () => {
|
|
592
592
|
const e = X(), t = ee();
|
|
593
593
|
return Pe({
|
|
594
|
-
queryKey: [
|
|
594
|
+
queryKey: [W, _.GET_WEBSITE_PAGES],
|
|
595
595
|
staleTime: 1e3 * 60 * 5,
|
|
596
596
|
queryFn: async () => e(t, { action: _.GET_WEBSITE_PAGES }) || []
|
|
597
597
|
});
|
|
598
598
|
}, Cl = ls({ lastSaved: void 0 }), Ss = () => Dn(Cl), Oe = () => {
|
|
599
599
|
const [e] = Re(), t = e.get("page"), { data: n, isFetching: s } = Rn();
|
|
600
|
-
return { data:
|
|
600
|
+
return { data: $(
|
|
601
601
|
() => Ee(n, { id: t }) || {},
|
|
602
602
|
[n, t]
|
|
603
603
|
), isFetching: s };
|
|
604
604
|
}, dn = (e) => {
|
|
605
605
|
const t = Un(), n = X();
|
|
606
606
|
return Pe({
|
|
607
|
-
queryKey: [
|
|
607
|
+
queryKey: [W, "chaiUserInfo", e],
|
|
608
608
|
queryFn: async () => await n(t, {
|
|
609
609
|
action: _.GET_CHAI_USER,
|
|
610
610
|
data: { userId: e }
|
|
@@ -612,16 +612,16 @@ const xl = ls({}), Or = () => Dn(xl), Tl = () => {
|
|
|
612
612
|
enabled: !!e && e !== "EXPIRED"
|
|
613
613
|
});
|
|
614
614
|
}, Pl = ls(void 0), hn = () => {
|
|
615
|
-
const [e] = Re(), t = e.get("page"), { user: n } =
|
|
616
|
-
return
|
|
615
|
+
const [e] = Re(), t = e.get("page"), { user: n } = tt(), [s, a] = Dn(Pl);
|
|
616
|
+
return $(() => ({
|
|
617
617
|
isLocked: t && (n == null ? void 0 : n.id) !== s,
|
|
618
618
|
currentEditor: s,
|
|
619
619
|
setCurrentEditor: (i) => a(i)
|
|
620
620
|
}), [n == null ? void 0 : n.id, s, t, a]);
|
|
621
|
-
},
|
|
621
|
+
}, Fr = () => {
|
|
622
622
|
const [e] = Re(), t = e.get("page"), n = ee(), { setAiContext: s } = ws(), { setCurrentEditor: a } = hn(), [, i] = Ss(), l = X();
|
|
623
623
|
return Pe({
|
|
624
|
-
queryKey: [
|
|
624
|
+
queryKey: [W, _.GET_DRAFT_PAGE, t],
|
|
625
625
|
staleTime: 1 / 0,
|
|
626
626
|
gcTime: 1 / 0,
|
|
627
627
|
queryFn: async () => {
|
|
@@ -636,13 +636,13 @@ const xl = ls({}), Or = () => Dn(xl), Tl = () => {
|
|
|
636
636
|
},
|
|
637
637
|
enabled: !!t
|
|
638
638
|
});
|
|
639
|
-
},
|
|
639
|
+
}, qr = ({
|
|
640
640
|
pageType: e,
|
|
641
641
|
lang: t
|
|
642
642
|
}) => {
|
|
643
643
|
const n = ee(), s = X();
|
|
644
644
|
return Pe({
|
|
645
|
-
queryKey: [
|
|
645
|
+
queryKey: [W, _.GET_BUILDER_PAGE_DATA, e, t],
|
|
646
646
|
initialData: {},
|
|
647
647
|
queryFn: async () => s(n, {
|
|
648
648
|
action: _.GET_BUILDER_PAGE_DATA,
|
|
@@ -673,7 +673,7 @@ function _l({
|
|
|
673
673
|
alt: t,
|
|
674
674
|
className: "w-12 h-12 border border-gray-300 rounded-full"
|
|
675
675
|
}
|
|
676
|
-
) : /* @__PURE__ */ r(
|
|
676
|
+
) : /* @__PURE__ */ r(Oi, { className: "w-12 h-12 p-2 border border-gray-300 rounded-full" }),
|
|
677
677
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
678
678
|
/* @__PURE__ */ r("h3", { className: "font-semibold", children: t }),
|
|
679
679
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: n })
|
|
@@ -699,7 +699,7 @@ function _l({
|
|
|
699
699
|
/* @__PURE__ */ r(cr, { children: "Are you sure you want to take over?" }),
|
|
700
700
|
/* @__PURE__ */ u(ur, { children: [
|
|
701
701
|
/* @__PURE__ */ u("span", { className: "flex items-center space-x-2 text-yellow-500", children: [
|
|
702
|
-
/* @__PURE__ */ r(
|
|
702
|
+
/* @__PURE__ */ r(Bi, { className: "w-5 h-5" }),
|
|
703
703
|
/* @__PURE__ */ r("span", { children: "This action might cause the other user to lose unsaved changes." })
|
|
704
704
|
] }),
|
|
705
705
|
/* @__PURE__ */ r("br", {}),
|
|
@@ -721,7 +721,7 @@ function _l({
|
|
|
721
721
|
] }) });
|
|
722
722
|
}
|
|
723
723
|
const Il = () => {
|
|
724
|
-
const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Re(), a = s.get("page"), { mutate: i } =
|
|
724
|
+
const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Re(), a = s.get("page"), { mutate: i } = Rr(), { isFetching: l } = Fr(), o = xe(() => {
|
|
725
725
|
i({ id: a });
|
|
726
726
|
}, [a, i]);
|
|
727
727
|
return !e || l ? /* @__PURE__ */ r("div", { className: "" }) : /* @__PURE__ */ r(
|
|
@@ -735,14 +735,14 @@ const Il = () => {
|
|
|
735
735
|
}
|
|
736
736
|
);
|
|
737
737
|
}, kl = () => {
|
|
738
|
-
const [e, t] = Re(), n = e.get("lang"), s =
|
|
738
|
+
const [e, t] = Re(), n = e.get("lang"), s = Mr(n), { setSelectedLang: a } = dt(), i = () => {
|
|
739
739
|
const o = new URLSearchParams(window.location.search);
|
|
740
740
|
o.delete("lang");
|
|
741
741
|
const c = o.toString(), d = `${window.location.pathname}${c ? `?${c}` : ""}`;
|
|
742
742
|
window.history.pushState({}, "", d), t(o), a(""), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
743
743
|
};
|
|
744
744
|
if (s) return null;
|
|
745
|
-
const l = le(
|
|
745
|
+
const l = le(je, n);
|
|
746
746
|
return /* @__PURE__ */ r("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ u(cs, { className: "w-full max-w-md mx-auto", children: [
|
|
747
747
|
/* @__PURE__ */ r(us, { className: "space-y-1", children: /* @__PURE__ */ u(ds, { className: "flex items-center gap-2 text-2xl", children: [
|
|
748
748
|
/* @__PURE__ */ r(Nr, { className: "w-6 h-6 text-yellow-500" }),
|
|
@@ -786,7 +786,7 @@ const Il = () => {
|
|
|
786
786
|
}, Dl = (e) => {
|
|
787
787
|
const t = ee(), n = X();
|
|
788
788
|
return Pe({
|
|
789
|
-
queryKey: [
|
|
789
|
+
queryKey: [W, "uiBlockDetails", e],
|
|
790
790
|
enabled: !!e,
|
|
791
791
|
// Only run query if blockId is provided
|
|
792
792
|
queryFn: async () => {
|
|
@@ -930,12 +930,12 @@ const Il = () => {
|
|
|
930
930
|
}
|
|
931
931
|
);
|
|
932
932
|
}, Ol = () => {
|
|
933
|
-
const e = ee(), t = X(), n =
|
|
933
|
+
const e = ee(), t = X(), n = Te(), {
|
|
934
934
|
data: s = [],
|
|
935
935
|
isLoading: a,
|
|
936
936
|
error: i
|
|
937
937
|
} = Pe({
|
|
938
|
-
queryKey: [
|
|
938
|
+
queryKey: [W, "library-groups"],
|
|
939
939
|
queryFn: async () => {
|
|
940
940
|
try {
|
|
941
941
|
return await t(e, {
|
|
@@ -957,7 +957,7 @@ const Il = () => {
|
|
|
957
957
|
},
|
|
958
958
|
onSuccess: () => {
|
|
959
959
|
n.invalidateQueries({
|
|
960
|
-
queryKey: [
|
|
960
|
+
queryKey: [W, "library-groups"]
|
|
961
961
|
}), J.success("Group created successfully");
|
|
962
962
|
},
|
|
963
963
|
onError: (c) => {
|
|
@@ -1002,7 +1002,7 @@ const Il = () => {
|
|
|
1002
1002
|
{ id: "stats", name: "Stats" },
|
|
1003
1003
|
{ id: "team", name: "Team" },
|
|
1004
1004
|
{ id: "timeline", name: "Timeline" }
|
|
1005
|
-
]), f =
|
|
1005
|
+
]), f = $(
|
|
1006
1006
|
() => [
|
|
1007
1007
|
...o,
|
|
1008
1008
|
...c.filter(
|
|
@@ -1077,7 +1077,7 @@ const Il = () => {
|
|
|
1077
1077
|
)
|
|
1078
1078
|
] });
|
|
1079
1079
|
}, Ml = 1 * 1024 * 1024, Fl = ({ value: e, onChange: t }) => {
|
|
1080
|
-
const [n, s] = P(!1), a = ut(null), i =
|
|
1080
|
+
const [n, s] = P(!1), a = ut(null), i = xe(
|
|
1081
1081
|
(c) => {
|
|
1082
1082
|
var f;
|
|
1083
1083
|
const d = (f = c.target.files) == null ? void 0 : f[0];
|
|
@@ -1158,7 +1158,7 @@ const Il = () => {
|
|
|
1158
1158
|
) })
|
|
1159
1159
|
] });
|
|
1160
1160
|
}, he = {
|
|
1161
|
-
...
|
|
1161
|
+
...si,
|
|
1162
1162
|
//pages
|
|
1163
1163
|
ADD_PAGE: "add_page",
|
|
1164
1164
|
EDIT_PAGE: "edit_page",
|
|
@@ -1195,14 +1195,14 @@ const Il = () => {
|
|
|
1195
1195
|
EDIT_MEDIA: "edit_media",
|
|
1196
1196
|
DELETE_MEDIA: "delete_media"
|
|
1197
1197
|
}, ql = (e) => {
|
|
1198
|
-
const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } =
|
|
1198
|
+
const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = ri(), i = t.find((x) => x._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l, c = $(() => t.some(
|
|
1199
1199
|
(x) => x._type === "PartialBlock" || x._type === "GlobalBlock"
|
|
1200
|
-
), [t]), d =
|
|
1200
|
+
), [t]), d = $(() => {
|
|
1201
1201
|
let x = [];
|
|
1202
1202
|
for (const k of t)
|
|
1203
1203
|
if (k._type === "PartialBlock" || k._type === "GlobalBlock") {
|
|
1204
1204
|
const R = a(k.partialBlockId);
|
|
1205
|
-
|
|
1205
|
+
qa(R, "0._parent", k._parent), x = [...x, ...R];
|
|
1206
1206
|
} else
|
|
1207
1207
|
x.push(k);
|
|
1208
1208
|
return x;
|
|
@@ -1224,7 +1224,7 @@ const Il = () => {
|
|
|
1224
1224
|
const K = () => {
|
|
1225
1225
|
const x = {};
|
|
1226
1226
|
return f.trim() ? f.length < 2 && (x.name = "Name must be at least 2 characters") : x.name = "Name is required", y || (x.group = "Group is required"), S(x), Object.keys(x).length === 0 && !c;
|
|
1227
|
-
}, { resetLibrary: pe } =
|
|
1227
|
+
}, { resetLibrary: pe } = ai({ id: "" }), z = Ll(
|
|
1228
1228
|
(x) => {
|
|
1229
1229
|
o || M([s], { _libBlockId: x.id }), J.success(`Block ${o ? "updated" : "saved"} successfully`), pe(x.library), n();
|
|
1230
1230
|
}
|
|
@@ -1383,18 +1383,18 @@ const Il = () => {
|
|
|
1383
1383
|
GLOBAL_BLOCK_PUBLISH_SUCCESS: "Global block published successfully.",
|
|
1384
1384
|
PAGES_PUBLISH_SUCCESS: "Your changes have been published successfully.",
|
|
1385
1385
|
SLUG_CHANGE_SUCCESS: "Slug changed successfully."
|
|
1386
|
-
},
|
|
1386
|
+
}, jl = {
|
|
1387
1387
|
SLUG_ALREADY_USED: "This slug is already in use. Please choose a different one."
|
|
1388
1388
|
}, De = () => {
|
|
1389
1389
|
const e = ee(), t = X();
|
|
1390
1390
|
return Pe({
|
|
1391
|
-
queryKey: [
|
|
1391
|
+
queryKey: [W, _.GET_PAGE_TYPES],
|
|
1392
1392
|
initialData: [],
|
|
1393
1393
|
queryFn: async () => t(e, { action: _.GET_PAGE_TYPES })
|
|
1394
1394
|
});
|
|
1395
|
-
},
|
|
1395
|
+
}, Hl = (e) => {
|
|
1396
1396
|
const { data: t } = De();
|
|
1397
|
-
return
|
|
1397
|
+
return $(
|
|
1398
1398
|
() => t == null ? void 0 : t.find((n) => n.key === e),
|
|
1399
1399
|
[t, e]
|
|
1400
1400
|
);
|
|
@@ -1415,8 +1415,8 @@ const Il = () => {
|
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
1417
|
});
|
|
1418
|
-
},
|
|
1419
|
-
const e = ee(), t =
|
|
1418
|
+
}, jr = () => {
|
|
1419
|
+
const e = ee(), t = Te(), n = X(), { data: s } = De();
|
|
1420
1420
|
return _e({
|
|
1421
1421
|
mutationFn: async (a) => (a.template && console.log("Creating page from template:", a.template), await n(e, {
|
|
1422
1422
|
action: _.CREATE_PAGE,
|
|
@@ -1426,12 +1426,12 @@ const Il = () => {
|
|
|
1426
1426
|
var o;
|
|
1427
1427
|
i && (i != null && i.primaryPage) ? t.invalidateQueries({
|
|
1428
1428
|
queryKey: [
|
|
1429
|
-
|
|
1429
|
+
W,
|
|
1430
1430
|
_.GET_LANGUAGE_PAGES,
|
|
1431
1431
|
i == null ? void 0 : i.primaryPage
|
|
1432
1432
|
]
|
|
1433
1433
|
}) : t.invalidateQueries({
|
|
1434
|
-
queryKey: [
|
|
1434
|
+
queryKey: [W, _.GET_WEBSITE_PAGES]
|
|
1435
1435
|
});
|
|
1436
1436
|
const l = i.template ? `Page created from "${i.template.name}" template` : i.hasSlug === !1 ? "New " + ((o = Ee(s, { key: i.pageType })) == null ? void 0 : o.name) + " added successfully" : "New page added successfully";
|
|
1437
1437
|
J.success(l);
|
|
@@ -1441,13 +1441,13 @@ const Il = () => {
|
|
|
1441
1441
|
J.error(
|
|
1442
1442
|
`Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`,
|
|
1443
1443
|
{
|
|
1444
|
-
description: le(
|
|
1444
|
+
description: le(jl, a.message, a.message)
|
|
1445
1445
|
}
|
|
1446
1446
|
);
|
|
1447
1447
|
}
|
|
1448
1448
|
});
|
|
1449
1449
|
}, Ns = () => {
|
|
1450
|
-
const e = ee(), t =
|
|
1450
|
+
const e = ee(), t = Te(), n = X(), { data: s } = De();
|
|
1451
1451
|
return _e({
|
|
1452
1452
|
mutationFn: async (a) => await n(e, {
|
|
1453
1453
|
action: _.UPDATE_PAGE,
|
|
@@ -1456,12 +1456,12 @@ const Il = () => {
|
|
|
1456
1456
|
onSuccess: (a, i) => {
|
|
1457
1457
|
i && (i != null && i.primaryPage || i != null && i.seo) ? t.invalidateQueries({
|
|
1458
1458
|
queryKey: [
|
|
1459
|
-
|
|
1459
|
+
W,
|
|
1460
1460
|
_.GET_LANGUAGE_PAGES,
|
|
1461
1461
|
i == null ? void 0 : i.primaryPage
|
|
1462
1462
|
]
|
|
1463
1463
|
}) : t.invalidateQueries({
|
|
1464
|
-
queryKey: [
|
|
1464
|
+
queryKey: [W, _.GET_WEBSITE_PAGES]
|
|
1465
1465
|
});
|
|
1466
1466
|
},
|
|
1467
1467
|
onError: (a, i) => {
|
|
@@ -1475,7 +1475,7 @@ const Il = () => {
|
|
|
1475
1475
|
}
|
|
1476
1476
|
});
|
|
1477
1477
|
}, Vl = () => {
|
|
1478
|
-
const e = ee(), t =
|
|
1478
|
+
const e = ee(), t = Te(), n = X(), { data: s } = De();
|
|
1479
1479
|
return _e({
|
|
1480
1480
|
mutationFn: async (a) => n(e, {
|
|
1481
1481
|
action: _.DELETE_PAGE,
|
|
@@ -1490,12 +1490,12 @@ const Il = () => {
|
|
|
1490
1490
|
}
|
|
1491
1491
|
i && (i != null && i.primaryPage) ? t.invalidateQueries({
|
|
1492
1492
|
queryKey: [
|
|
1493
|
-
|
|
1493
|
+
W,
|
|
1494
1494
|
_.GET_LANGUAGE_PAGES,
|
|
1495
1495
|
i == null ? void 0 : i.primaryPage
|
|
1496
1496
|
]
|
|
1497
1497
|
}) : t.invalidateQueries({
|
|
1498
|
-
queryKey: [
|
|
1498
|
+
queryKey: [W, _.GET_WEBSITE_PAGES]
|
|
1499
1499
|
});
|
|
1500
1500
|
},
|
|
1501
1501
|
onError: (a, i) => {
|
|
@@ -1509,7 +1509,7 @@ const Il = () => {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
});
|
|
1511
1511
|
}, zl = () => {
|
|
1512
|
-
const e = ee(), t =
|
|
1512
|
+
const e = ee(), t = Te(), n = X(), { data: s } = De();
|
|
1513
1513
|
return _e({
|
|
1514
1514
|
mutationFn: async (a) => n(e, {
|
|
1515
1515
|
action: _.TAKE_OFFLINE,
|
|
@@ -1518,12 +1518,12 @@ const Il = () => {
|
|
|
1518
1518
|
onSuccess: (a, i) => {
|
|
1519
1519
|
i && (i != null && i.primaryPage) ? t.invalidateQueries({
|
|
1520
1520
|
queryKey: [
|
|
1521
|
-
|
|
1521
|
+
W,
|
|
1522
1522
|
_.GET_LANGUAGE_PAGES,
|
|
1523
1523
|
i == null ? void 0 : i.primaryPage
|
|
1524
1524
|
]
|
|
1525
1525
|
}) : t.invalidateQueries({
|
|
1526
|
-
queryKey: [
|
|
1526
|
+
queryKey: [W, _.GET_WEBSITE_PAGES]
|
|
1527
1527
|
});
|
|
1528
1528
|
const l = Ee(s, { key: i.pageType });
|
|
1529
1529
|
J.success(
|
|
@@ -1541,7 +1541,7 @@ const Il = () => {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
});
|
|
1543
1543
|
}, As = () => {
|
|
1544
|
-
const e = ee(), t = X(), n =
|
|
1544
|
+
const e = ee(), t = X(), n = Te(), { data: s } = Oe();
|
|
1545
1545
|
return _e({
|
|
1546
1546
|
mutationFn: async ({ ids: a }) => t(e, {
|
|
1547
1547
|
action: _.PUBLISH_CHANGES,
|
|
@@ -1549,11 +1549,11 @@ const Il = () => {
|
|
|
1549
1549
|
}),
|
|
1550
1550
|
onSuccess: () => {
|
|
1551
1551
|
n.invalidateQueries({
|
|
1552
|
-
queryKey: [
|
|
1552
|
+
queryKey: [W, _.GET_CHANGES]
|
|
1553
1553
|
}), n.invalidateQueries({
|
|
1554
|
-
queryKey: [
|
|
1554
|
+
queryKey: [W, _.GET_WEBSITE_PAGES]
|
|
1555
1555
|
}), n.invalidateQueries({
|
|
1556
|
-
queryKey: [
|
|
1556
|
+
queryKey: [W, _.GET_LANGUAGE_PAGES, s == null ? void 0 : s.id]
|
|
1557
1557
|
});
|
|
1558
1558
|
},
|
|
1559
1559
|
onError: () => {
|
|
@@ -1561,7 +1561,7 @@ const Il = () => {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
});
|
|
1563
1563
|
}, $l = () => {
|
|
1564
|
-
const e = ee(), t = X(), n =
|
|
1564
|
+
const e = ee(), t = X(), n = Te();
|
|
1565
1565
|
return _e({
|
|
1566
1566
|
mutationFn: async (s) => {
|
|
1567
1567
|
var a;
|
|
@@ -1578,7 +1578,7 @@ const Il = () => {
|
|
|
1578
1578
|
},
|
|
1579
1579
|
onSuccess: () => {
|
|
1580
1580
|
n.invalidateQueries({
|
|
1581
|
-
queryKey: [
|
|
1581
|
+
queryKey: [W, _.GET_WEBSITE_PAGES]
|
|
1582
1582
|
}), J.success("Page marked as template successfully.");
|
|
1583
1583
|
},
|
|
1584
1584
|
onError: () => {
|
|
@@ -1586,7 +1586,7 @@ const Il = () => {
|
|
|
1586
1586
|
}
|
|
1587
1587
|
});
|
|
1588
1588
|
}, Wl = () => {
|
|
1589
|
-
const e = ee(), t = X(), n =
|
|
1589
|
+
const e = ee(), t = X(), n = Te();
|
|
1590
1590
|
return _e({
|
|
1591
1591
|
mutationFn: async (s) => t(e, {
|
|
1592
1592
|
action: _.UNMARK_AS_TEMPLATE,
|
|
@@ -1594,7 +1594,7 @@ const Il = () => {
|
|
|
1594
1594
|
}),
|
|
1595
1595
|
onSuccess: () => {
|
|
1596
1596
|
n.invalidateQueries({
|
|
1597
|
-
queryKey: [
|
|
1597
|
+
queryKey: [W, _.GET_WEBSITE_PAGES]
|
|
1598
1598
|
}), J.success("Page unmarked as template successfully.");
|
|
1599
1599
|
},
|
|
1600
1600
|
onError: () => {
|
|
@@ -1602,7 +1602,7 @@ const Il = () => {
|
|
|
1602
1602
|
}
|
|
1603
1603
|
});
|
|
1604
1604
|
}, Yl = () => {
|
|
1605
|
-
const e = ee(), t = X(), n =
|
|
1605
|
+
const e = ee(), t = X(), n = Te();
|
|
1606
1606
|
return _e({
|
|
1607
1607
|
mutationFn: async ({ id: s, slug: a }) => t(e, {
|
|
1608
1608
|
action: _.CHANGE_SLUG,
|
|
@@ -1610,9 +1610,9 @@ const Il = () => {
|
|
|
1610
1610
|
}),
|
|
1611
1611
|
onSuccess: (s, { primaryPage: a }) => {
|
|
1612
1612
|
J.success(q.SLUG_CHANGE_SUCCESS), a ? n.invalidateQueries({
|
|
1613
|
-
queryKey: [
|
|
1613
|
+
queryKey: [W, _.GET_LANGUAGE_PAGES, a]
|
|
1614
1614
|
}) : n.invalidateQueries({
|
|
1615
|
-
queryKey: [
|
|
1615
|
+
queryKey: [W, _.GET_WEBSITE_PAGES]
|
|
1616
1616
|
});
|
|
1617
1617
|
},
|
|
1618
1618
|
onError: () => {
|
|
@@ -1657,36 +1657,36 @@ var xs = {};
|
|
|
1657
1657
|
};
|
|
1658
1658
|
}(o, /* @__PURE__ */ new Map()), h = function() {
|
|
1659
1659
|
var g = Math.floor(16.666666666666668), m, x, k = {}, R = 0;
|
|
1660
|
-
return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (m = function(
|
|
1660
|
+
return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (m = function(j) {
|
|
1661
1661
|
var V = Math.random();
|
|
1662
1662
|
return k[V] = requestAnimationFrame(function G(b) {
|
|
1663
|
-
R === b || R + g - 1 < b ? (R = b, delete k[V],
|
|
1663
|
+
R === b || R + g - 1 < b ? (R = b, delete k[V], j()) : k[V] = requestAnimationFrame(G);
|
|
1664
1664
|
}), V;
|
|
1665
|
-
}, x = function(
|
|
1666
|
-
k[
|
|
1667
|
-
}) : (m = function(
|
|
1668
|
-
return setTimeout(
|
|
1669
|
-
}, x = function(
|
|
1670
|
-
return clearTimeout(
|
|
1665
|
+
}, x = function(j) {
|
|
1666
|
+
k[j] && cancelAnimationFrame(k[j]);
|
|
1667
|
+
}) : (m = function(j) {
|
|
1668
|
+
return setTimeout(j, g);
|
|
1669
|
+
}, x = function(j) {
|
|
1670
|
+
return clearTimeout(j);
|
|
1671
1671
|
}), { frame: m, cancel: x };
|
|
1672
1672
|
}(), y = /* @__PURE__ */ function() {
|
|
1673
1673
|
var g, m, x = {};
|
|
1674
1674
|
function k(R) {
|
|
1675
|
-
function
|
|
1675
|
+
function j(V, G) {
|
|
1676
1676
|
R.postMessage({ options: V || {}, callback: G });
|
|
1677
1677
|
}
|
|
1678
1678
|
R.init = function(G) {
|
|
1679
1679
|
var b = G.transferControlToOffscreen();
|
|
1680
1680
|
R.postMessage({ canvas: b }, [b]);
|
|
1681
|
-
}, R.fire = function(G, b,
|
|
1681
|
+
}, R.fire = function(G, b, H) {
|
|
1682
1682
|
if (m)
|
|
1683
|
-
return
|
|
1683
|
+
return j(G, null), m;
|
|
1684
1684
|
var se = Math.random().toString(36).slice(2);
|
|
1685
1685
|
return m = d(function(Q) {
|
|
1686
|
-
function ve(
|
|
1687
|
-
|
|
1686
|
+
function ve(Ce) {
|
|
1687
|
+
Ce.data.callback === se && (delete x[se], R.removeEventListener("message", ve), m = null, f.clear(), H(), Q());
|
|
1688
1688
|
}
|
|
1689
|
-
R.addEventListener("message", ve),
|
|
1689
|
+
R.addEventListener("message", ve), j(G, se), x[se] = ve.bind(null, { data: { callback: se } });
|
|
1690
1690
|
}), m;
|
|
1691
1691
|
}, R.reset = function() {
|
|
1692
1692
|
R.postMessage({ reset: !0 });
|
|
@@ -1723,8 +1723,8 @@ var xs = {};
|
|
|
1723
1723
|
`);
|
|
1724
1724
|
try {
|
|
1725
1725
|
g = new Worker(URL.createObjectURL(new Blob([R])));
|
|
1726
|
-
} catch (
|
|
1727
|
-
return typeof console !== void 0 && typeof console.warn == "function" && console.warn("🎊 Could not load worker",
|
|
1726
|
+
} catch (j) {
|
|
1727
|
+
return typeof console !== void 0 && typeof console.warn == "function" && console.warn("🎊 Could not load worker", j), null;
|
|
1728
1728
|
}
|
|
1729
1729
|
k(g);
|
|
1730
1730
|
}
|
|
@@ -1803,8 +1803,8 @@ var xs = {};
|
|
|
1803
1803
|
var m = document.createElement("canvas");
|
|
1804
1804
|
return m.style.position = "fixed", m.style.top = "0px", m.style.left = "0px", m.style.pointerEvents = "none", m.style.zIndex = g, m;
|
|
1805
1805
|
}
|
|
1806
|
-
function O(g, m, x, k, R,
|
|
1807
|
-
g.save(), g.translate(m, x), g.rotate(
|
|
1806
|
+
function O(g, m, x, k, R, j, V, G, b) {
|
|
1807
|
+
g.save(), g.translate(m, x), g.rotate(j), g.scale(k, R), g.arc(0, 0, 1, V, G, b), g.restore();
|
|
1808
1808
|
}
|
|
1809
1809
|
function T(g) {
|
|
1810
1810
|
var m = g.angle * (Math.PI / 180), x = g.spread * (Math.PI / 180);
|
|
@@ -1835,101 +1835,101 @@ var xs = {};
|
|
|
1835
1835
|
}
|
|
1836
1836
|
function M(g, m) {
|
|
1837
1837
|
m.x += Math.cos(m.angle2D) * m.velocity + m.drift, m.y += Math.sin(m.angle2D) * m.velocity + m.gravity, m.velocity *= m.decay, m.flat ? (m.wobble = 0, m.wobbleX = m.x + 10 * m.scalar, m.wobbleY = m.y + 10 * m.scalar, m.tiltSin = 0, m.tiltCos = 0, m.random = 1) : (m.wobble += m.wobbleSpeed, m.wobbleX = m.x + 10 * m.scalar * Math.cos(m.wobble), m.wobbleY = m.y + 10 * m.scalar * Math.sin(m.wobble), m.tiltAngle += 0.1, m.tiltSin = Math.sin(m.tiltAngle), m.tiltCos = Math.cos(m.tiltAngle), m.random = Math.random() + 2);
|
|
1838
|
-
var x = m.tick++ / m.totalTicks, k = m.x + m.random * m.tiltCos, R = m.y + m.random * m.tiltSin,
|
|
1838
|
+
var x = m.tick++ / m.totalTicks, k = m.x + m.random * m.tiltCos, R = m.y + m.random * m.tiltSin, j = m.wobbleX + m.random * m.tiltCos, V = m.wobbleY + m.random * m.tiltSin;
|
|
1839
1839
|
if (g.fillStyle = "rgba(" + m.color.r + ", " + m.color.g + ", " + m.color.b + ", " + (1 - x) + ")", g.beginPath(), l && m.shape.type === "path" && typeof m.shape.path == "string" && Array.isArray(m.shape.matrix))
|
|
1840
1840
|
g.fill(K(
|
|
1841
1841
|
m.shape.path,
|
|
1842
1842
|
m.shape.matrix,
|
|
1843
1843
|
m.x,
|
|
1844
1844
|
m.y,
|
|
1845
|
-
Math.abs(
|
|
1845
|
+
Math.abs(j - k) * 0.1,
|
|
1846
1846
|
Math.abs(V - R) * 0.1,
|
|
1847
1847
|
Math.PI / 10 * m.wobble
|
|
1848
1848
|
));
|
|
1849
1849
|
else if (m.shape.type === "bitmap") {
|
|
1850
|
-
var G = Math.PI / 10 * m.wobble, b = Math.abs(
|
|
1850
|
+
var G = Math.PI / 10 * m.wobble, b = Math.abs(j - k) * 0.1, H = Math.abs(V - R) * 0.1, se = m.shape.bitmap.width * m.scalar, Q = m.shape.bitmap.height * m.scalar, ve = new DOMMatrix([
|
|
1851
1851
|
Math.cos(G) * b,
|
|
1852
1852
|
Math.sin(G) * b,
|
|
1853
|
-
-Math.sin(G) *
|
|
1854
|
-
Math.cos(G) *
|
|
1853
|
+
-Math.sin(G) * H,
|
|
1854
|
+
Math.cos(G) * H,
|
|
1855
1855
|
m.x,
|
|
1856
1856
|
m.y
|
|
1857
1857
|
]);
|
|
1858
1858
|
ve.multiplySelf(new DOMMatrix(m.shape.matrix));
|
|
1859
|
-
var
|
|
1860
|
-
|
|
1859
|
+
var Ce = g.createPattern(f.transform(m.shape.bitmap), "no-repeat");
|
|
1860
|
+
Ce.setTransform(ve), g.globalAlpha = 1 - x, g.fillStyle = Ce, g.fillRect(
|
|
1861
1861
|
m.x - se / 2,
|
|
1862
1862
|
m.y - Q / 2,
|
|
1863
1863
|
se,
|
|
1864
1864
|
Q
|
|
1865
1865
|
), g.globalAlpha = 1;
|
|
1866
1866
|
} else if (m.shape === "circle")
|
|
1867
|
-
g.ellipse ? g.ellipse(m.x, m.y, Math.abs(
|
|
1867
|
+
g.ellipse ? g.ellipse(m.x, m.y, Math.abs(j - k) * m.ovalScalar, Math.abs(V - R) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI) : O(g, m.x, m.y, Math.abs(j - k) * m.ovalScalar, Math.abs(V - R) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI);
|
|
1868
1868
|
else if (m.shape === "star")
|
|
1869
|
-
for (var
|
|
1870
|
-
Fe = m.x + Math.cos(
|
|
1869
|
+
for (var Y = Math.PI / 2 * 3, be = 4 * m.scalar, Me = 8 * m.scalar, Fe = m.x, Xe = m.y, at = 5, $e = Math.PI / at; at--; )
|
|
1870
|
+
Fe = m.x + Math.cos(Y) * Me, Xe = m.y + Math.sin(Y) * Me, g.lineTo(Fe, Xe), Y += $e, Fe = m.x + Math.cos(Y) * be, Xe = m.y + Math.sin(Y) * be, g.lineTo(Fe, Xe), Y += $e;
|
|
1871
1871
|
else
|
|
1872
|
-
g.moveTo(Math.floor(m.x), Math.floor(m.y)), g.lineTo(Math.floor(m.wobbleX), Math.floor(R)), g.lineTo(Math.floor(
|
|
1872
|
+
g.moveTo(Math.floor(m.x), Math.floor(m.y)), g.lineTo(Math.floor(m.wobbleX), Math.floor(R)), g.lineTo(Math.floor(j), Math.floor(V)), g.lineTo(Math.floor(k), Math.floor(m.wobbleY));
|
|
1873
1873
|
return g.closePath(), g.fill(), m.tick < m.totalTicks;
|
|
1874
1874
|
}
|
|
1875
1875
|
function ne(g, m, x, k, R) {
|
|
1876
|
-
var
|
|
1876
|
+
var j = m.slice(), V = g.getContext("2d"), G, b, H = d(function(se) {
|
|
1877
1877
|
function Q() {
|
|
1878
1878
|
G = b = null, V.clearRect(0, 0, k.width, k.height), f.clear(), R(), se();
|
|
1879
1879
|
}
|
|
1880
1880
|
function ve() {
|
|
1881
|
-
s && !(k.width === a.width && k.height === a.height) && (k.width = g.width = a.width, k.height = g.height = a.height), !k.width && !k.height && (x(g), k.width = g.width, k.height = g.height), V.clearRect(0, 0, k.width, k.height),
|
|
1882
|
-
return M(V,
|
|
1883
|
-
}),
|
|
1881
|
+
s && !(k.width === a.width && k.height === a.height) && (k.width = g.width = a.width, k.height = g.height = a.height), !k.width && !k.height && (x(g), k.width = g.width, k.height = g.height), V.clearRect(0, 0, k.width, k.height), j = j.filter(function(Ce) {
|
|
1882
|
+
return M(V, Ce);
|
|
1883
|
+
}), j.length ? G = h.frame(ve) : Q();
|
|
1884
1884
|
}
|
|
1885
1885
|
G = h.frame(ve), b = Q;
|
|
1886
1886
|
});
|
|
1887
1887
|
return {
|
|
1888
1888
|
addFettis: function(se) {
|
|
1889
|
-
return
|
|
1889
|
+
return j = j.concat(se), H;
|
|
1890
1890
|
},
|
|
1891
1891
|
canvas: g,
|
|
1892
|
-
promise:
|
|
1892
|
+
promise: H,
|
|
1893
1893
|
reset: function() {
|
|
1894
1894
|
G && h.cancel(G), b && b();
|
|
1895
1895
|
}
|
|
1896
1896
|
};
|
|
1897
1897
|
}
|
|
1898
1898
|
function me(g, m) {
|
|
1899
|
-
var x = !g, k = !!E(m || {}, "resize"), R = !1,
|
|
1900
|
-
function ve(
|
|
1901
|
-
for (var Fe = E(
|
|
1899
|
+
var x = !g, k = !!E(m || {}, "resize"), R = !1, j = E(m, "disableForReducedMotion", Boolean), V = i && !!E(m || {}, "useWorker"), G = V ? y() : null, b = x ? oe : te, H = g && G ? !!g.__confetti_initialized : !1, se = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, Q;
|
|
1900
|
+
function ve(Y, be, Me) {
|
|
1901
|
+
for (var Fe = E(Y, "particleCount", A), Xe = E(Y, "angle", Number), at = E(Y, "spread", Number), $e = E(Y, "startVelocity", Number), Ia = E(Y, "decay", Number), ka = E(Y, "gravity", Number), La = E(Y, "drift", Number), Ps = E(Y, "colors", w), Da = E(Y, "ticks", Number), _s = E(Y, "shapes"), Ga = E(Y, "scalar"), Ua = !!E(Y, "flat"), Is = L(Y), ks = Fe, Fn = [], Ra = g.width * Is.x, Oa = g.height * Is.y; ks--; )
|
|
1902
1902
|
Fn.push(
|
|
1903
1903
|
T({
|
|
1904
|
-
x:
|
|
1905
|
-
y:
|
|
1904
|
+
x: Ra,
|
|
1905
|
+
y: Oa,
|
|
1906
1906
|
angle: Xe,
|
|
1907
1907
|
spread: at,
|
|
1908
1908
|
startVelocity: $e,
|
|
1909
1909
|
color: Ps[ks % Ps.length],
|
|
1910
1910
|
shape: _s[U(0, _s.length)],
|
|
1911
|
-
ticks:
|
|
1912
|
-
decay:
|
|
1913
|
-
gravity:
|
|
1914
|
-
drift:
|
|
1915
|
-
scalar:
|
|
1916
|
-
flat:
|
|
1911
|
+
ticks: Da,
|
|
1912
|
+
decay: Ia,
|
|
1913
|
+
gravity: ka,
|
|
1914
|
+
drift: La,
|
|
1915
|
+
scalar: Ga,
|
|
1916
|
+
flat: Ua
|
|
1917
1917
|
})
|
|
1918
1918
|
);
|
|
1919
1919
|
return Q ? Q.addFettis(Fn) : (Q = ne(g, Fn, b, be, Me), Q.promise);
|
|
1920
1920
|
}
|
|
1921
|
-
function
|
|
1922
|
-
var be =
|
|
1921
|
+
function Ce(Y) {
|
|
1922
|
+
var be = j || E(Y, "disableForReducedMotion", Boolean), Me = E(Y, "zIndex", Number);
|
|
1923
1923
|
if (be && se)
|
|
1924
1924
|
return d(function($e) {
|
|
1925
1925
|
$e();
|
|
1926
1926
|
});
|
|
1927
|
-
x && Q ? g = Q.canvas : x && !g && (g = D(Me), document.body.appendChild(g)), k && !
|
|
1927
|
+
x && Q ? g = Q.canvas : x && !g && (g = D(Me), document.body.appendChild(g)), k && !H && b(g);
|
|
1928
1928
|
var Fe = {
|
|
1929
1929
|
width: g.width,
|
|
1930
1930
|
height: g.height
|
|
1931
1931
|
};
|
|
1932
|
-
G && !
|
|
1932
|
+
G && !H && G.init(g), H = !0, G && (g.__confetti_initialized = !0);
|
|
1933
1933
|
function Xe() {
|
|
1934
1934
|
if (G) {
|
|
1935
1935
|
var $e = {
|
|
@@ -1949,42 +1949,42 @@ var xs = {};
|
|
|
1949
1949
|
Fe.width = Fe.height = null;
|
|
1950
1950
|
}
|
|
1951
1951
|
function at() {
|
|
1952
|
-
Q = null, k && (R = !1, t.removeEventListener("resize", Xe)), x && g && (document.body.contains(g) && document.body.removeChild(g), g = null,
|
|
1952
|
+
Q = null, k && (R = !1, t.removeEventListener("resize", Xe)), x && g && (document.body.contains(g) && document.body.removeChild(g), g = null, H = !1);
|
|
1953
1953
|
}
|
|
1954
|
-
return k && !R && (R = !0, t.addEventListener("resize", Xe, !1)), G ? G.fire(
|
|
1954
|
+
return k && !R && (R = !0, t.addEventListener("resize", Xe, !1)), G ? G.fire(Y, Fe, at) : ve(Y, Fe, at);
|
|
1955
1955
|
}
|
|
1956
|
-
return
|
|
1956
|
+
return Ce.reset = function() {
|
|
1957
1957
|
G && G.reset(), Q && Q.reset();
|
|
1958
|
-
},
|
|
1958
|
+
}, Ce;
|
|
1959
1959
|
}
|
|
1960
1960
|
var Z;
|
|
1961
1961
|
function fe() {
|
|
1962
1962
|
return Z || (Z = me(null, { useWorker: !0, resize: !0 })), Z;
|
|
1963
1963
|
}
|
|
1964
|
-
function K(g, m, x, k, R,
|
|
1964
|
+
function K(g, m, x, k, R, j, V) {
|
|
1965
1965
|
var G = new Path2D(g), b = new Path2D();
|
|
1966
1966
|
b.addPath(G, new DOMMatrix(m));
|
|
1967
|
-
var
|
|
1968
|
-
return
|
|
1967
|
+
var H = new Path2D();
|
|
1968
|
+
return H.addPath(b, new DOMMatrix([
|
|
1969
1969
|
Math.cos(V) * R,
|
|
1970
1970
|
Math.sin(V) * R,
|
|
1971
|
-
-Math.sin(V) *
|
|
1972
|
-
Math.cos(V) *
|
|
1971
|
+
-Math.sin(V) * j,
|
|
1972
|
+
Math.cos(V) * j,
|
|
1973
1973
|
x,
|
|
1974
1974
|
k
|
|
1975
|
-
])),
|
|
1975
|
+
])), H;
|
|
1976
1976
|
}
|
|
1977
1977
|
function pe(g) {
|
|
1978
1978
|
if (!l)
|
|
1979
1979
|
throw new Error("path confetti are not supported in this browser");
|
|
1980
1980
|
var m, x;
|
|
1981
1981
|
typeof g == "string" ? m = g : (m = g.path, x = g.matrix);
|
|
1982
|
-
var k = new Path2D(m), R = document.createElement("canvas"),
|
|
1982
|
+
var k = new Path2D(m), R = document.createElement("canvas"), j = R.getContext("2d");
|
|
1983
1983
|
if (!x) {
|
|
1984
|
-
for (var V = 1e3, G = V, b = V,
|
|
1985
|
-
for (var
|
|
1986
|
-
|
|
1987
|
-
Q =
|
|
1984
|
+
for (var V = 1e3, G = V, b = V, H = 0, se = 0, Q, ve, Ce = 0; Ce < V; Ce += 2)
|
|
1985
|
+
for (var Y = 0; Y < V; Y += 2)
|
|
1986
|
+
j.isPointInPath(k, Ce, Y, "nonzero") && (G = Math.min(G, Ce), b = Math.min(b, Y), H = Math.max(H, Ce), se = Math.max(se, Y));
|
|
1987
|
+
Q = H - G, ve = se - b;
|
|
1988
1988
|
var be = 10, Me = Math.min(be / Q, be / ve);
|
|
1989
1989
|
x = [
|
|
1990
1990
|
Me,
|
|
@@ -2004,10 +2004,10 @@ var xs = {};
|
|
|
2004
2004
|
function z(g) {
|
|
2005
2005
|
var m, x = 1, k = "#000000", R = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
|
|
2006
2006
|
typeof g == "string" ? m = g : (m = g.text, x = "scalar" in g ? g.scalar : x, R = "fontFamily" in g ? g.fontFamily : R, k = "color" in g ? g.color : k);
|
|
2007
|
-
var
|
|
2007
|
+
var j = 10 * x, V = "" + j + "px " + R, G = new OffscreenCanvas(j, j), b = G.getContext("2d");
|
|
2008
2008
|
b.font = V;
|
|
2009
|
-
var
|
|
2010
|
-
se += ve + ve, Q += ve + ve, G = new OffscreenCanvas(se, Q), b = G.getContext("2d"), b.font = V, b.fillStyle = k, b.fillText(m,
|
|
2009
|
+
var H = b.measureText(m), se = Math.ceil(H.actualBoundingBoxRight + H.actualBoundingBoxLeft), Q = Math.ceil(H.actualBoundingBoxAscent + H.actualBoundingBoxDescent), ve = 2, Ce = H.actualBoundingBoxLeft + ve, Y = H.actualBoundingBoxAscent + ve;
|
|
2010
|
+
se += ve + ve, Q += ve + ve, G = new OffscreenCanvas(se, Q), b = G.getContext("2d"), b.font = V, b.fillStyle = k, b.fillText(m, Ce, Y);
|
|
2011
2011
|
var be = 1 / x;
|
|
2012
2012
|
return {
|
|
2013
2013
|
type: "bitmap",
|
|
@@ -2046,7 +2046,7 @@ const Xl = {
|
|
|
2046
2046
|
const n = { ...Xl, ...t };
|
|
2047
2047
|
Ql(n);
|
|
2048
2048
|
}, Jl = () => {
|
|
2049
|
-
const [e] =
|
|
2049
|
+
const [e] = ii(), { mutate: t, isPending: n } = As(), { mutateAsync: s, isPending: a } = Or();
|
|
2050
2050
|
return /* @__PURE__ */ u("div", { className: "bg-white py-3 flex items-center justify-center gap-x-3 border-t", children: [
|
|
2051
2051
|
/* @__PURE__ */ r(
|
|
2052
2052
|
C,
|
|
@@ -2084,7 +2084,7 @@ const Xl = {
|
|
|
2084
2084
|
onClose: t
|
|
2085
2085
|
}) => {
|
|
2086
2086
|
const [n, s] = P(e.slug || ""), { mutate: a, isPending: i } = Yl(), { data: l } = De(), o = Ee(l, { key: e == null ? void 0 : e.pageType }), c = (f) => {
|
|
2087
|
-
if (f.preventDefault(), !(e != null && e.primaryPage) && Object.keys(
|
|
2087
|
+
if (f.preventDefault(), !(e != null && e.primaryPage) && Object.keys(je).some((v) => n === `/${v}` || Ot(n, `/${v}/`))) {
|
|
2088
2088
|
J.error("Error", {
|
|
2089
2089
|
description: "Slugs cannot start with a language code for primary page"
|
|
2090
2090
|
});
|
|
@@ -2092,7 +2092,7 @@ const Xl = {
|
|
|
2092
2092
|
}
|
|
2093
2093
|
a({ ...e, slug: n }, { onSuccess: t });
|
|
2094
2094
|
}, d = (e == null ? void 0 : e.lang) || "";
|
|
2095
|
-
return /* @__PURE__ */ r(
|
|
2095
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
2096
2096
|
/* @__PURE__ */ u(Ve, { children: [
|
|
2097
2097
|
/* @__PURE__ */ r(ze, { children: "Change Slug" }),
|
|
2098
2098
|
/* @__PURE__ */ r(Qe, { className: "text-xs", children: /* @__PURE__ */ u(yr, { variant: "destructive", className: "mt-2", children: [
|
|
@@ -2169,7 +2169,7 @@ function Hr({
|
|
|
2169
2169
|
}, o = i == null ? void 0 : i.find(
|
|
2170
2170
|
(c) => c.key === (e == null ? void 0 : e.pageType)
|
|
2171
2171
|
);
|
|
2172
|
-
return /* @__PURE__ */ r(
|
|
2172
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
2173
2173
|
/* @__PURE__ */ u(Ve, { children: [
|
|
2174
2174
|
/* @__PURE__ */ r(ze, { children: "Confirm Deletion" }),
|
|
2175
2175
|
/* @__PURE__ */ u(Qe, { className: "py-4 text-slate-500", children: [
|
|
@@ -2182,7 +2182,7 @@ function Hr({
|
|
|
2182
2182
|
e.lang && /* @__PURE__ */ u("div", { className: "py-2 text-sm", children: [
|
|
2183
2183
|
"Language:",
|
|
2184
2184
|
" ",
|
|
2185
|
-
/* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children: le(
|
|
2185
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children: le(je, e.lang, e.lang) })
|
|
2186
2186
|
] })
|
|
2187
2187
|
] })
|
|
2188
2188
|
] }),
|
|
@@ -2215,7 +2215,7 @@ const Be = ({
|
|
|
2215
2215
|
const { mutate: n, isPending: s } = zl(), a = async () => {
|
|
2216
2216
|
n(e, { onSuccess: t });
|
|
2217
2217
|
};
|
|
2218
|
-
return /* @__PURE__ */ r(
|
|
2218
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
2219
2219
|
/* @__PURE__ */ u(Ve, { children: [
|
|
2220
2220
|
/* @__PURE__ */ r(ze, { children: "Confirm action" }),
|
|
2221
2221
|
/* @__PURE__ */ u(Qe, { children: [
|
|
@@ -2238,12 +2238,12 @@ const Be = ({
|
|
|
2238
2238
|
)
|
|
2239
2239
|
] })
|
|
2240
2240
|
] }) });
|
|
2241
|
-
},
|
|
2241
|
+
}, Kr = ({
|
|
2242
2242
|
langProps: e,
|
|
2243
2243
|
onClose: t,
|
|
2244
2244
|
languages: n
|
|
2245
2245
|
}) => {
|
|
2246
|
-
const { data: s } = Oe(), { data: a } = De(), [i, l] = P(e.name || ""), [o, c] = P(e.edit ? e.lang : ""), [d, f] = P(e.edit ? e.slug : ""), { mutate: h, isPending: y } =
|
|
2246
|
+
const { data: s } = Oe(), { data: a } = De(), [i, l] = P(e.name || ""), [o, c] = P(e.edit ? e.lang : ""), [d, f] = P(e.edit ? e.slug : ""), { mutate: h, isPending: y } = jr(), { mutate: v, isPending: p } = Ns(), N = $(
|
|
2247
2247
|
() => a == null ? void 0 : a.find(
|
|
2248
2248
|
(S) => S.key === e.pageType
|
|
2249
2249
|
),
|
|
@@ -2259,7 +2259,7 @@ const Be = ({
|
|
|
2259
2259
|
};
|
|
2260
2260
|
w.pageType = e.pageType, e.edit && (w.id = e == null ? void 0 : e.id), e.edit ? v(w, { onSuccess: t }) : h(w, { onSuccess: t });
|
|
2261
2261
|
};
|
|
2262
|
-
return /* @__PURE__ */ r(
|
|
2262
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px] text-slate-600", children: [
|
|
2263
2263
|
/* @__PURE__ */ u(Ve, { children: [
|
|
2264
2264
|
/* @__PURE__ */ r(ze, { children: e.edit ? q.EDIT_LANGUAGE : q.ADD_NEW_LANGUAGE }),
|
|
2265
2265
|
/* @__PURE__ */ r(Qe, { className: "font-light", children: q.ENTER_LANGUAGE_DETAILS })
|
|
@@ -2279,8 +2279,8 @@ const Be = ({
|
|
|
2279
2279
|
},
|
|
2280
2280
|
className: "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",
|
|
2281
2281
|
children: [
|
|
2282
|
-
/* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ? le(
|
|
2283
|
-
qe(n, (S) => /* @__PURE__ */ r("option", { value: S, children: le(
|
|
2282
|
+
/* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ? le(je, e.lang, e.lang) : ye(n) ? q.ALL_AVAILABLE_LANGUAGE_PAGE : q.CHOOSE_LANGUAGE }),
|
|
2283
|
+
qe(n, (S) => /* @__PURE__ */ r("option", { value: S, children: le(je, S, S) }, S))
|
|
2284
2284
|
]
|
|
2285
2285
|
}
|
|
2286
2286
|
)
|
|
@@ -2312,7 +2312,7 @@ const Be = ({
|
|
|
2312
2312
|
value: d,
|
|
2313
2313
|
onChange: (S) => {
|
|
2314
2314
|
const w = S.target.value;
|
|
2315
|
-
Ot(w, `/${o}`) && f(Gt(
|
|
2315
|
+
Ot(w, `/${o}`) && f(Gt(ja(w)));
|
|
2316
2316
|
},
|
|
2317
2317
|
className: "col-span-3",
|
|
2318
2318
|
required: !0,
|
|
@@ -2365,7 +2365,7 @@ const Be = ({
|
|
|
2365
2365
|
className: `w-2.5 h-2.5 rounded-full ${E.online ? "bg-green-300" : "bg-gray-300"}`
|
|
2366
2366
|
}
|
|
2367
2367
|
),
|
|
2368
|
-
le(
|
|
2368
|
+
le(je, S ? s : A, A)
|
|
2369
2369
|
]
|
|
2370
2370
|
}
|
|
2371
2371
|
),
|
|
@@ -2385,7 +2385,7 @@ const Be = ({
|
|
|
2385
2385
|
] })
|
|
2386
2386
|
] }),
|
|
2387
2387
|
S ? /* @__PURE__ */ u("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
2388
|
-
/* @__PURE__ */ r(
|
|
2388
|
+
/* @__PURE__ */ r(Mi, { fill: "orange", className: "w-3 h-3" }),
|
|
2389
2389
|
/* @__PURE__ */ r("b", { children: " Primary" })
|
|
2390
2390
|
] }) : /* @__PURE__ */ r("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ r(
|
|
2391
2391
|
Be,
|
|
@@ -2430,7 +2430,7 @@ const Be = ({
|
|
|
2430
2430
|
I.stopPropagation(), t({ ...E, edit: !0 });
|
|
2431
2431
|
},
|
|
2432
2432
|
children: [
|
|
2433
|
-
/* @__PURE__ */ r(
|
|
2433
|
+
/* @__PURE__ */ r(Fi, { className: "size-3" }),
|
|
2434
2434
|
q.EDIT
|
|
2435
2435
|
]
|
|
2436
2436
|
}
|
|
@@ -2468,7 +2468,7 @@ const Be = ({
|
|
|
2468
2468
|
I.stopPropagation(), d(E);
|
|
2469
2469
|
},
|
|
2470
2470
|
children: [
|
|
2471
|
-
/* @__PURE__ */ r(
|
|
2471
|
+
/* @__PURE__ */ r(qi, { className: "size-3" }),
|
|
2472
2472
|
q.DELETE
|
|
2473
2473
|
]
|
|
2474
2474
|
}
|
|
@@ -2507,7 +2507,7 @@ const Be = ({
|
|
|
2507
2507
|
}
|
|
2508
2508
|
) }) }),
|
|
2509
2509
|
e && /* @__PURE__ */ r(
|
|
2510
|
-
|
|
2510
|
+
Kr,
|
|
2511
2511
|
{
|
|
2512
2512
|
languages: N,
|
|
2513
2513
|
langProps: e,
|
|
@@ -2538,7 +2538,7 @@ function no({
|
|
|
2538
2538
|
className: s = "w-full rounded-md border border-gray-300 px-3 py-2",
|
|
2539
2539
|
id: a = "parentPage"
|
|
2540
2540
|
}) {
|
|
2541
|
-
const i =
|
|
2541
|
+
const i = $(() => !e || e.length === 0 ? [] : e.filter((f) => !ye(f.slug)).filter((f) => f.slug !== "/").sort((f, h) => f.slug.localeCompare(h.slug)), [e]), l = (d) => Math.max(0, (d.match(/\//g) || []).length - 1), o = (d) => " ".repeat(d), c = (d) => {
|
|
2542
2542
|
if (d === "/") return "/";
|
|
2543
2543
|
const f = d.split("/").filter(Boolean);
|
|
2544
2544
|
return f.length <= 1 ? `/${f[0] || ""}` : `/${f[f.length - 1]}`;
|
|
@@ -2648,13 +2648,13 @@ const ro = ({
|
|
|
2648
2648
|
}, ao = () => {
|
|
2649
2649
|
const e = ee(), t = X();
|
|
2650
2650
|
return Pe({
|
|
2651
|
-
queryKey: [
|
|
2651
|
+
queryKey: [W, _.GET_LIBRARIES],
|
|
2652
2652
|
queryFn: async () => await t(e, { action: _.GET_LIBRARIES }) || []
|
|
2653
2653
|
});
|
|
2654
2654
|
}, io = (e) => {
|
|
2655
2655
|
const t = ee(), n = X();
|
|
2656
2656
|
return Pe({
|
|
2657
|
-
queryKey: [
|
|
2657
|
+
queryKey: [W, _.GET_TEMPLATES_BY_TYPE, e],
|
|
2658
2658
|
enabled: !!e,
|
|
2659
2659
|
queryFn: async () => {
|
|
2660
2660
|
const s = await n(t, {
|
|
@@ -2665,22 +2665,22 @@ const ro = ({
|
|
|
2665
2665
|
}
|
|
2666
2666
|
});
|
|
2667
2667
|
}, lo = (e) => {
|
|
2668
|
-
const { data: t = [], isLoading: n } = io(e), { data: s = [], isLoading: a } = ao(), i =
|
|
2668
|
+
const { data: t = [], isLoading: n } = io(e), { data: s = [], isLoading: a } = ao(), i = $(() => n || a ? [] : t.map((o) => {
|
|
2669
2669
|
const c = Ee(s, { id: o.library });
|
|
2670
2670
|
return {
|
|
2671
2671
|
...o,
|
|
2672
2672
|
libraryName: (c == null ? void 0 : c.type) !== "shared" ? "Site Library" : (c == null ? void 0 : c.name) + " Library",
|
|
2673
2673
|
libraryType: c == null ? void 0 : c.type
|
|
2674
2674
|
};
|
|
2675
|
-
}), [t, s, n, a]), l =
|
|
2675
|
+
}), [t, s, n, a]), l = $(() => Ha(i, "libraryName"), [i]);
|
|
2676
2676
|
return {
|
|
2677
2677
|
data: i,
|
|
2678
2678
|
groupedData: l,
|
|
2679
2679
|
isLoading: n || a
|
|
2680
2680
|
};
|
|
2681
|
-
},
|
|
2681
|
+
}, Vr = () => {
|
|
2682
2682
|
const [, e] = Re();
|
|
2683
|
-
return
|
|
2683
|
+
return xe(
|
|
2684
2684
|
(t, n) => {
|
|
2685
2685
|
const a = new URLSearchParams(window.location.search).get("lang"), i = new URLSearchParams({ page: t });
|
|
2686
2686
|
a && i.set("lang", a), window.history.pushState({}, "", `?${i.toString()}`), e(i), window.dispatchEvent(new PopStateEvent("popstate")), n == null || n();
|
|
@@ -2695,11 +2695,11 @@ function oo({
|
|
|
2695
2695
|
closePanel: s
|
|
2696
2696
|
}) {
|
|
2697
2697
|
var V, G;
|
|
2698
|
-
const a =
|
|
2698
|
+
const a = Vr(), i = !!(e != null && e.id), { data: l } = Rn(), { mutate: o, isPending: c } = jr(), { mutate: d, isPending: f } = Ns(), [h, y] = P(null), [v, p] = P(
|
|
2699
2699
|
(e == null ? void 0 : e.pageType) ?? "page"
|
|
2700
|
-
), { hasPermission: N } = Lt(), E = N(he.CHANGE_PAGE_TYPE), [A, U] = P(!1), [S, w] = P(""), I =
|
|
2700
|
+
), { hasPermission: N } = Lt(), E = N(he.CHANGE_PAGE_TYPE), [A, U] = P(!1), [S, w] = P(""), I = $(() => {
|
|
2701
2701
|
const b = t.find(
|
|
2702
|
-
(
|
|
2702
|
+
(H) => H.key === v
|
|
2703
2703
|
);
|
|
2704
2704
|
return (b == null ? void 0 : b.hasSlug) === !1;
|
|
2705
2705
|
}, [v, t]), [L, oe] = P(
|
|
@@ -2722,9 +2722,9 @@ function oo({
|
|
|
2722
2722
|
T(b), b && ne("");
|
|
2723
2723
|
}, k = (b) => {
|
|
2724
2724
|
if (oe(b), b && b !== "none") {
|
|
2725
|
-
const
|
|
2725
|
+
const H = l == null ? void 0 : l.find(
|
|
2726
2726
|
(Q) => Q.id === b
|
|
2727
|
-
), se = (
|
|
2727
|
+
), se = (H == null ? void 0 : H.slug) || "";
|
|
2728
2728
|
if (M.startsWith(se)) {
|
|
2729
2729
|
const Q = M.slice(se.length).replace(/^\/+/, "");
|
|
2730
2730
|
ne(Q);
|
|
@@ -2734,7 +2734,7 @@ function oo({
|
|
|
2734
2734
|
ne(M ? `${M}` : "");
|
|
2735
2735
|
}, R = (b) => {
|
|
2736
2736
|
Z(b);
|
|
2737
|
-
},
|
|
2737
|
+
}, j = (b) => {
|
|
2738
2738
|
if (b.preventDefault(), y(null), !te.trim()) {
|
|
2739
2739
|
J.error("Name is required");
|
|
2740
2740
|
return;
|
|
@@ -2744,7 +2744,7 @@ function oo({
|
|
|
2744
2744
|
return;
|
|
2745
2745
|
}
|
|
2746
2746
|
if (!(z != null && z.hasSlug)) {
|
|
2747
|
-
const
|
|
2747
|
+
const H = {
|
|
2748
2748
|
pageType: z == null ? void 0 : z.key,
|
|
2749
2749
|
name: te,
|
|
2750
2750
|
slug: "",
|
|
@@ -2761,7 +2761,7 @@ function oo({
|
|
|
2761
2761
|
);
|
|
2762
2762
|
return;
|
|
2763
2763
|
} else
|
|
2764
|
-
o(
|
|
2764
|
+
o(H, {
|
|
2765
2765
|
onSuccess: (se) => {
|
|
2766
2766
|
console.log("response", se), n(), a(se.page.id, s);
|
|
2767
2767
|
}
|
|
@@ -2773,16 +2773,16 @@ function oo({
|
|
|
2773
2773
|
y("Child page slug is required");
|
|
2774
2774
|
return;
|
|
2775
2775
|
}
|
|
2776
|
-
const
|
|
2776
|
+
const H = l == null ? void 0 : l.find(
|
|
2777
2777
|
(be) => be.id === L
|
|
2778
|
-
), se = (
|
|
2779
|
-
if (Object.keys(
|
|
2778
|
+
), se = (H == null ? void 0 : H.slug) || "", Q = se === "/" ? `/${M}` : `${se}/${M}`;
|
|
2779
|
+
if (Object.keys(je).some((be) => Q === `/${be}` || (Q == null ? void 0 : Q.startsWith(`/${be}/`)))) {
|
|
2780
2780
|
y(
|
|
2781
2781
|
"Slugs cannot start with a language code for primary page"
|
|
2782
2782
|
);
|
|
2783
2783
|
return;
|
|
2784
2784
|
}
|
|
2785
|
-
const
|
|
2785
|
+
const Y = {
|
|
2786
2786
|
pageType: v,
|
|
2787
2787
|
name: te,
|
|
2788
2788
|
slug: Q.replace(/\/$/, ""),
|
|
@@ -2794,7 +2794,7 @@ function oo({
|
|
|
2794
2794
|
};
|
|
2795
2795
|
if (i) {
|
|
2796
2796
|
d(
|
|
2797
|
-
{ id: e == null ? void 0 : e.id, ...
|
|
2797
|
+
{ id: e == null ? void 0 : e.id, ...Y },
|
|
2798
2798
|
{
|
|
2799
2799
|
onSuccess: () => {
|
|
2800
2800
|
J.success("Page updated successfully"), n();
|
|
@@ -2803,13 +2803,13 @@ function oo({
|
|
|
2803
2803
|
);
|
|
2804
2804
|
return;
|
|
2805
2805
|
}
|
|
2806
|
-
o(
|
|
2806
|
+
o(Y, {
|
|
2807
2807
|
onSuccess: (be) => {
|
|
2808
2808
|
console.log("response", be), n(), a(be.page.id, s);
|
|
2809
2809
|
}
|
|
2810
2810
|
});
|
|
2811
2811
|
} else {
|
|
2812
|
-
const
|
|
2812
|
+
const H = {
|
|
2813
2813
|
pageType: v,
|
|
2814
2814
|
name: te,
|
|
2815
2815
|
slug: M === "" ? "/" : `/${M.replace(/\/$/, "")}`,
|
|
@@ -2817,7 +2817,7 @@ function oo({
|
|
|
2817
2817
|
};
|
|
2818
2818
|
if (i) {
|
|
2819
2819
|
d(
|
|
2820
|
-
{ id: e == null ? void 0 : e.id, ...
|
|
2820
|
+
{ id: e == null ? void 0 : e.id, ...H },
|
|
2821
2821
|
{
|
|
2822
2822
|
onSuccess: () => {
|
|
2823
2823
|
J.success("Page updated successfully"), n();
|
|
@@ -2826,14 +2826,14 @@ function oo({
|
|
|
2826
2826
|
);
|
|
2827
2827
|
return;
|
|
2828
2828
|
}
|
|
2829
|
-
o(
|
|
2829
|
+
o(H, {
|
|
2830
2830
|
onSuccess: () => {
|
|
2831
2831
|
n();
|
|
2832
2832
|
}
|
|
2833
2833
|
});
|
|
2834
2834
|
}
|
|
2835
2835
|
};
|
|
2836
|
-
return z != null && z.hasSlug ? /* @__PURE__ */ u("form", { onSubmit:
|
|
2836
|
+
return z != null && z.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: j, className: "w-full max-w-md mx-auto space-y-4", children: [
|
|
2837
2837
|
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2838
2838
|
/* @__PURE__ */ r(re, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
|
|
2839
2839
|
/* @__PURE__ */ r(
|
|
@@ -2943,7 +2943,7 @@ function oo({
|
|
|
2943
2943
|
] }) : /* @__PURE__ */ u(
|
|
2944
2944
|
"form",
|
|
2945
2945
|
{
|
|
2946
|
-
onSubmit:
|
|
2946
|
+
onSubmit: j,
|
|
2947
2947
|
className: "w-full max-w-md mx-auto space-y-4",
|
|
2948
2948
|
children: [
|
|
2949
2949
|
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
@@ -3008,7 +3008,7 @@ const co = ({
|
|
|
3008
3008
|
closePanel: n
|
|
3009
3009
|
}) => {
|
|
3010
3010
|
const { data: s } = De(), a = !!(e != null && e.id);
|
|
3011
|
-
return /* @__PURE__ */ r(
|
|
3011
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: () => t(void 0), children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px]", children: [
|
|
3012
3012
|
/* @__PURE__ */ u(Ve, { children: [
|
|
3013
3013
|
/* @__PURE__ */ u(ze, { children: [
|
|
3014
3014
|
a ? "Edit" : "Add New",
|
|
@@ -3032,7 +3032,7 @@ const co = ({
|
|
|
3032
3032
|
}) => {
|
|
3033
3033
|
const [n, s] = P(!1), [a, i] = P(""), [l, o] = P(""), [c, d] = P(!1), f = ut(null), h = $l(), { data: y } = De(), v = y == null ? void 0 : y.find(
|
|
3034
3034
|
(S) => S.key === e.pageType
|
|
3035
|
-
), p = (v == null ? void 0 : v.name) || It(e.pageType), N =
|
|
3035
|
+
), p = (v == null ? void 0 : v.name) || It(e.pageType), N = xe(
|
|
3036
3036
|
(S) => {
|
|
3037
3037
|
var I;
|
|
3038
3038
|
const w = (I = S.target.files) == null ? void 0 : I[0];
|
|
@@ -3081,7 +3081,7 @@ const co = ({
|
|
|
3081
3081
|
}
|
|
3082
3082
|
);
|
|
3083
3083
|
};
|
|
3084
|
-
return /* @__PURE__ */ r(
|
|
3084
|
+
return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
3085
3085
|
/* @__PURE__ */ u(Ve, { children: [
|
|
3086
3086
|
/* @__PURE__ */ r(ze, { children: "Mark as template" }),
|
|
3087
3087
|
/* @__PURE__ */ u(Qe, { className: "py-4 text-slate-500 space-y-1 text-xs", children: [
|
|
@@ -3093,7 +3093,7 @@ const co = ({
|
|
|
3093
3093
|
/* @__PURE__ */ u("div", { className: "space-y-4 mb-4 text-xs", children: [
|
|
3094
3094
|
/* @__PURE__ */ u("div", { className: "p-4 border rounded bg-slate-50 space-y-3", children: [
|
|
3095
3095
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3096
|
-
/* @__PURE__ */ r(
|
|
3096
|
+
/* @__PURE__ */ r(ji, { className: "w-4 h-4 text-slate-500" }),
|
|
3097
3097
|
/* @__PURE__ */ r("span", { className: "font-medium text-slate-500", children: "Page Name:" }),
|
|
3098
3098
|
/* @__PURE__ */ r("span", { className: "font-semibold", children: It(e.name) })
|
|
3099
3099
|
] }),
|
|
@@ -3196,7 +3196,7 @@ const co = ({
|
|
|
3196
3196
|
onClose: t
|
|
3197
3197
|
}) => {
|
|
3198
3198
|
const [n, s] = P(!1), a = Wl();
|
|
3199
|
-
return /* @__PURE__ */ r(
|
|
3199
|
+
return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
3200
3200
|
/* @__PURE__ */ u(Ve, { children: [
|
|
3201
3201
|
/* @__PURE__ */ r(ze, { children: "Unmark as template" }),
|
|
3202
3202
|
/* @__PURE__ */ r(Qe, { className: "py-4 text-slate-500 space-y-1 text-xs", children: "Are you sure you want to unmark this page as a template?" })
|
|
@@ -3230,7 +3230,7 @@ const co = ({
|
|
|
3230
3230
|
}
|
|
3231
3231
|
)
|
|
3232
3232
|
] }) });
|
|
3233
|
-
},
|
|
3233
|
+
}, jn = ({
|
|
3234
3234
|
parentSlug: e,
|
|
3235
3235
|
page: t,
|
|
3236
3236
|
active: n,
|
|
@@ -3241,10 +3241,10 @@ const co = ({
|
|
|
3241
3241
|
setMarkAsTemplate: o,
|
|
3242
3242
|
setUnmarkAsTemplate: c
|
|
3243
3243
|
}) => {
|
|
3244
|
-
const d =
|
|
3244
|
+
const d = Vr(), { data: f } = De(), { hasPermission: h } = Lt(), y = $(
|
|
3245
3245
|
() => Ee(f, { key: t.pageType }),
|
|
3246
3246
|
[f, t.pageType]
|
|
3247
|
-
), v = le(t, "slug", "").replace(e, "") || "/", p = !h(he.EDIT_PAGE) && !h(he.DELETE_PAGE) && !h(he.UNPUBLISH_PAGE), N =
|
|
3247
|
+
), v = le(t, "slug", "").replace(e, "") || "/", p = !h(he.EDIT_PAGE) && !h(he.DELETE_PAGE) && !h(he.UNPUBLISH_PAGE), N = $(() => !!t.isTemplate, [t.isTemplate]), E = $(
|
|
3248
3248
|
() => !!(y != null && y.hasSlug),
|
|
3249
3249
|
[y == null ? void 0 : y.hasSlug]
|
|
3250
3250
|
);
|
|
@@ -3255,13 +3255,13 @@ const co = ({
|
|
|
3255
3255
|
className: `rounded flex p-1.5 items-center justify-between leading-none duration-300 cursor-pointer px-3 py-1.5 ${n ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
3256
3256
|
children: [
|
|
3257
3257
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
|
|
3258
|
-
t.dynamic ? /* @__PURE__ */ r("div", { className: "w-4 h-4 text-slate-500 stroke-[1]", children: /* @__PURE__ */ r(
|
|
3258
|
+
t.dynamic ? /* @__PURE__ */ r("div", { className: "w-4 h-4 text-slate-500 stroke-[1]", children: /* @__PURE__ */ r(Ki, { className: "w-4 h-4 text-yellow-400" }) }) : y != null && y.icon ? /* @__PURE__ */ r(
|
|
3259
3259
|
"div",
|
|
3260
3260
|
{
|
|
3261
3261
|
className: "w-4 h-4 text-slate-500 stroke-[1]",
|
|
3262
3262
|
dangerouslySetInnerHTML: { __html: y.icon }
|
|
3263
3263
|
}
|
|
3264
|
-
) : y != null && y.hasSlug ? /* @__PURE__ */ r(on, { className: "w-4 h-4 text-slate-500 stroke-[1]" }) : /* @__PURE__ */ r(
|
|
3264
|
+
) : y != null && y.hasSlug ? /* @__PURE__ */ r(on, { className: "w-4 h-4 text-slate-500 stroke-[1]" }) : /* @__PURE__ */ r(Vi, { className: "w-4 h-4 text-slate-500 stroke-[1]" }),
|
|
3265
3265
|
/* @__PURE__ */ r(
|
|
3266
3266
|
"div",
|
|
3267
3267
|
{
|
|
@@ -3310,7 +3310,7 @@ const co = ({
|
|
|
3310
3310
|
});
|
|
3311
3311
|
},
|
|
3312
3312
|
children: [
|
|
3313
|
-
/* @__PURE__ */ r(
|
|
3313
|
+
/* @__PURE__ */ r(zi, { className: "size-3" }),
|
|
3314
3314
|
"Edit"
|
|
3315
3315
|
]
|
|
3316
3316
|
}
|
|
@@ -3372,7 +3372,7 @@ const co = ({
|
|
|
3372
3372
|
}
|
|
3373
3373
|
);
|
|
3374
3374
|
}, fo = ({ close: e }) => {
|
|
3375
|
-
const [, t] = P([]), [n, s] = P(""), [a, i] = P(null), [l, o] = P(null), [c, d] = P(null), [f, h] = P(null), [y, v] = P(null), { data: p, isFetching: N } = Rn(), [E, A] = P(""), { hasPermission: U } = Lt(), [S, w] = Re(), I = S.get("page"), { data: L } = De(), oe =
|
|
3375
|
+
const [, t] = P([]), [n, s] = P(""), [a, i] = P(null), [l, o] = P(null), [c, d] = P(null), [f, h] = P(null), [y, v] = P(null), { data: p, isFetching: N } = Rn(), [E, A] = P(""), { hasPermission: U } = Lt(), [S, w] = Re(), I = S.get("page"), { data: L } = De(), oe = xe(
|
|
3376
3376
|
(T) => {
|
|
3377
3377
|
var M;
|
|
3378
3378
|
return (M = Ee(L, { key: T })) == null ? void 0 : M.hasSlug;
|
|
@@ -3386,7 +3386,7 @@ const co = ({
|
|
|
3386
3386
|
}, [L, E]);
|
|
3387
3387
|
const te = (T) => {
|
|
3388
3388
|
A(T), sessionStorage.setItem("pageTypeFilter", T);
|
|
3389
|
-
}, D =
|
|
3389
|
+
}, D = xe(
|
|
3390
3390
|
(T) => {
|
|
3391
3391
|
const ne = new URLSearchParams(window.location.search).get("lang"), me = new URLSearchParams({ page: T });
|
|
3392
3392
|
ne && me.set("lang", ne), window.history.pushState({}, "", `?${me.toString()}`), w(me), window.dispatchEvent(new PopStateEvent("popstate")), e();
|
|
@@ -3399,7 +3399,7 @@ const co = ({
|
|
|
3399
3399
|
T && (T != null && T.pageType) ? t((M) => [...M, T == null ? void 0 : T.pageType]) : (window.history.replaceState(null, "", "/"), w(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
3400
3400
|
}
|
|
3401
3401
|
}, [p, I, N, w]);
|
|
3402
|
-
const O =
|
|
3402
|
+
const O = $(() => {
|
|
3403
3403
|
const T = Nn(
|
|
3404
3404
|
Ie(p, (K) => ye(n) ? !0 : Ft(Gt(K == null ? void 0 : K.name), Gt(n)) || Ft(Gt(K == null ? void 0 : K.slug), Gt(n)))
|
|
3405
3405
|
);
|
|
@@ -3447,17 +3447,17 @@ const co = ({
|
|
|
3447
3447
|
onChange: (T) => s(T.target.value)
|
|
3448
3448
|
}
|
|
3449
3449
|
),
|
|
3450
|
-
!ye(E) && /* @__PURE__ */ u(
|
|
3450
|
+
!ye(E) && /* @__PURE__ */ u(yi, { value: E, onValueChange: te, children: [
|
|
3451
3451
|
/* @__PURE__ */ r(
|
|
3452
|
-
|
|
3452
|
+
vi,
|
|
3453
3453
|
{
|
|
3454
3454
|
className: `${E === "all" ? "bg-gray-50 hover:bg-gray-100" : "bg-gray-100 hover:bg-gray-50"} min-w-[120px] h-max p-0 py-1 pl-2 pr-1 top-1.5 -mt-px absolute text-gray-600 right-1.5 w-max text-xs whitespace-nowrap ring-0 focus:ring-0 shadow-none`,
|
|
3455
|
-
children: /* @__PURE__ */ r(
|
|
3455
|
+
children: /* @__PURE__ */ r(Ei, { placeholder: "Select page type" })
|
|
3456
3456
|
}
|
|
3457
3457
|
),
|
|
3458
|
-
/* @__PURE__ */ r(
|
|
3458
|
+
/* @__PURE__ */ r(bi, { align: "end", children: qe(
|
|
3459
3459
|
Js([{ key: "all", name: "All" }], L),
|
|
3460
|
-
(T) => /* @__PURE__ */ r(
|
|
3460
|
+
(T) => /* @__PURE__ */ r(wi, { value: le(T, "key"), children: le(T, "name") })
|
|
3461
3461
|
) })
|
|
3462
3462
|
] })
|
|
3463
3463
|
] }),
|
|
@@ -3472,7 +3472,7 @@ const co = ({
|
|
|
3472
3472
|
"Empty List!",
|
|
3473
3473
|
/* @__PURE__ */ r("span", { className: "font-light", children: "Add new page to start" })
|
|
3474
3474
|
] }) : /* @__PURE__ */ r("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: qe(O, (T) => ye(T == null ? void 0 : T.children) ? /* @__PURE__ */ r(
|
|
3475
|
-
|
|
3475
|
+
jn,
|
|
3476
3476
|
{
|
|
3477
3477
|
closePanel: e,
|
|
3478
3478
|
setUnpublishPage: o,
|
|
@@ -3486,7 +3486,7 @@ const co = ({
|
|
|
3486
3486
|
T.id
|
|
3487
3487
|
) : /* @__PURE__ */ u("div", { className: "border-0", children: [
|
|
3488
3488
|
/* @__PURE__ */ r(
|
|
3489
|
-
|
|
3489
|
+
jn,
|
|
3490
3490
|
{
|
|
3491
3491
|
closePanel: e,
|
|
3492
3492
|
setUnpublishPage: o,
|
|
@@ -3501,7 +3501,7 @@ const co = ({
|
|
|
3501
3501
|
/* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: qe(le(T, "children", []), (M) => {
|
|
3502
3502
|
const ne = I === le(M, "id");
|
|
3503
3503
|
return /* @__PURE__ */ r(
|
|
3504
|
-
|
|
3504
|
+
jn,
|
|
3505
3505
|
{
|
|
3506
3506
|
parentSlug: T.slug,
|
|
3507
3507
|
closePanel: e,
|
|
@@ -3568,7 +3568,7 @@ const co = ({
|
|
|
3568
3568
|
)
|
|
3569
3569
|
] });
|
|
3570
3570
|
}, go = () => {
|
|
3571
|
-
const e =
|
|
3571
|
+
const e = nt("logo", null);
|
|
3572
3572
|
return e ? /* @__PURE__ */ r("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: nr.createElement(e, {}) }) : null;
|
|
3573
3573
|
}, po = () => {
|
|
3574
3574
|
const [e] = Re(), t = e.get("page"), { data: n, isFetching: s } = Oe(), [a, i] = P(!1), { savePage: l } = os(), o = !!t && !ye(n), c = !t || !s && ye(n) || a;
|
|
@@ -3582,7 +3582,7 @@ const co = ({
|
|
|
3582
3582
|
l(), i(!0);
|
|
3583
3583
|
},
|
|
3584
3584
|
children: [
|
|
3585
|
-
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
3585
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r($i, { className: "h-4 w-4" }) }),
|
|
3586
3586
|
/* @__PURE__ */ u("span", { className: "truncate leading-tight flex items-center max-w-[200px]", children: [
|
|
3587
3587
|
/* @__PURE__ */ r("span", { className: "text-slate-600 pr-1 font-light", children: "Editing:" }),
|
|
3588
3588
|
s ? /* @__PURE__ */ r(_r, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : It(le(n, "name")) ?? ""
|
|
@@ -3622,13 +3622,13 @@ const co = ({
|
|
|
3622
3622
|
const p = new URLSearchParams(window.location.search), N = p.get("lang");
|
|
3623
3623
|
N && (t.includes(N) ? s(N) : (p.delete("lang"), i(p), s("")));
|
|
3624
3624
|
}, [t, i, s]);
|
|
3625
|
-
const [l, o] = P(null), { data: c } = Oe(), { data: d } = un(), { data: f, isFetching: h } = cn(), y =
|
|
3625
|
+
const [l, o] = P(null), { data: c } = Oe(), { data: d } = un(), { data: f, isFetching: h } = cn(), y = $(() => {
|
|
3626
3626
|
const p = Nn(
|
|
3627
3627
|
qe(le(d, "languages"), (N) => {
|
|
3628
3628
|
const E = Ee(f, { lang: N });
|
|
3629
3629
|
return {
|
|
3630
3630
|
key: N,
|
|
3631
|
-
value: le(
|
|
3631
|
+
value: le(je, N, N),
|
|
3632
3632
|
isLangPageAdded: !!E
|
|
3633
3633
|
};
|
|
3634
3634
|
})
|
|
@@ -3636,7 +3636,7 @@ const co = ({
|
|
|
3636
3636
|
return [
|
|
3637
3637
|
{
|
|
3638
3638
|
key: e,
|
|
3639
|
-
value: le(
|
|
3639
|
+
value: le(je, e),
|
|
3640
3640
|
isLangPageAdded: !0
|
|
3641
3641
|
},
|
|
3642
3642
|
...p
|
|
@@ -3651,8 +3651,8 @@ const co = ({
|
|
|
3651
3651
|
return ye(t) || h ? null : /* @__PURE__ */ u(Ne, { children: [
|
|
3652
3652
|
/* @__PURE__ */ u(rn, { children: [
|
|
3653
3653
|
/* @__PURE__ */ r(an, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ u(C, { variant: "ghost", size: "sm", className: "gap-2", children: [
|
|
3654
|
-
/* @__PURE__ */ r(
|
|
3655
|
-
le(
|
|
3654
|
+
/* @__PURE__ */ r(Wi, { className: "w-4 h-4" }),
|
|
3655
|
+
le(je, a, a),
|
|
3656
3656
|
/* @__PURE__ */ r(Ir, { className: "w-4 h-4" })
|
|
3657
3657
|
] }) }),
|
|
3658
3658
|
/* @__PURE__ */ u(ln, { className: "border-border space-y-1", children: [
|
|
@@ -3661,7 +3661,7 @@ const co = ({
|
|
|
3661
3661
|
(p) => /* @__PURE__ */ u(
|
|
3662
3662
|
Ge,
|
|
3663
3663
|
{
|
|
3664
|
-
className:
|
|
3664
|
+
className: li(
|
|
3665
3665
|
"flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",
|
|
3666
3666
|
p.key === a && "!bg-gray-200 text-gray-700"
|
|
3667
3667
|
),
|
|
@@ -3673,7 +3673,7 @@ const co = ({
|
|
|
3673
3673
|
{
|
|
3674
3674
|
className: "text-[9px] flex items-center gap-x-1 text-orange-500 leading-none",
|
|
3675
3675
|
children: [
|
|
3676
|
-
/* @__PURE__ */ r(
|
|
3676
|
+
/* @__PURE__ */ r(Yi, { fill: "orange", className: "w-2 h-2" }),
|
|
3677
3677
|
"Primary"
|
|
3678
3678
|
]
|
|
3679
3679
|
}
|
|
@@ -3684,7 +3684,7 @@ const co = ({
|
|
|
3684
3684
|
)
|
|
3685
3685
|
),
|
|
3686
3686
|
!ye(y.filter((p) => !p.isLangPageAdded)) && /* @__PURE__ */ u(Ne, { children: [
|
|
3687
|
-
/* @__PURE__ */ r(
|
|
3687
|
+
/* @__PURE__ */ r(Si, {}),
|
|
3688
3688
|
/* @__PURE__ */ u(
|
|
3689
3689
|
C,
|
|
3690
3690
|
{
|
|
@@ -3710,7 +3710,7 @@ const co = ({
|
|
|
3710
3710
|
] })
|
|
3711
3711
|
] }),
|
|
3712
3712
|
l && /* @__PURE__ */ r(
|
|
3713
|
-
|
|
3713
|
+
Kr,
|
|
3714
3714
|
{
|
|
3715
3715
|
languages: t,
|
|
3716
3716
|
langProps: l,
|
|
@@ -3729,7 +3729,7 @@ function vo() {
|
|
|
3729
3729
|
function Eo(e) {
|
|
3730
3730
|
const t = ee(), n = X();
|
|
3731
3731
|
return Pe({
|
|
3732
|
-
queryKey: [
|
|
3732
|
+
queryKey: [W, "revisions", e],
|
|
3733
3733
|
queryFn: async () => await n(t, {
|
|
3734
3734
|
action: _.GET_PAGE_REVISIONS,
|
|
3735
3735
|
data: { pageId: e }
|
|
@@ -3740,7 +3740,7 @@ function Eo(e) {
|
|
|
3740
3740
|
});
|
|
3741
3741
|
}
|
|
3742
3742
|
const bo = () => {
|
|
3743
|
-
const e = ee(), t = X(), n =
|
|
3743
|
+
const e = ee(), t = X(), n = Te();
|
|
3744
3744
|
return _e({
|
|
3745
3745
|
mutationFn: async (s) => await t(e, {
|
|
3746
3746
|
action: _.DELETE_PAGE_REVISION,
|
|
@@ -3748,12 +3748,12 @@ const bo = () => {
|
|
|
3748
3748
|
}),
|
|
3749
3749
|
onSuccess: () => {
|
|
3750
3750
|
n.invalidateQueries({
|
|
3751
|
-
queryKey: [
|
|
3751
|
+
queryKey: [W, "revisions"]
|
|
3752
3752
|
});
|
|
3753
3753
|
}
|
|
3754
3754
|
});
|
|
3755
3755
|
}, wo = () => {
|
|
3756
|
-
const e = ee(), t = X(), n =
|
|
3756
|
+
const e = ee(), t = X(), n = Te();
|
|
3757
3757
|
return _e({
|
|
3758
3758
|
mutationFn: async ({
|
|
3759
3759
|
revisionId: s,
|
|
@@ -3764,7 +3764,7 @@ const bo = () => {
|
|
|
3764
3764
|
}),
|
|
3765
3765
|
onSuccess: () => {
|
|
3766
3766
|
n.invalidateQueries({
|
|
3767
|
-
queryKey: [
|
|
3767
|
+
queryKey: [W, "revisions"]
|
|
3768
3768
|
});
|
|
3769
3769
|
}
|
|
3770
3770
|
});
|
|
@@ -3776,13 +3776,13 @@ function So() {
|
|
|
3776
3776
|
/* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !ye(n.lastSaved) && /* @__PURE__ */ u("span", { children: [
|
|
3777
3777
|
"Last updated",
|
|
3778
3778
|
" ",
|
|
3779
|
-
|
|
3779
|
+
dl(new Date(n.lastSaved), {
|
|
3780
3780
|
addSuffix: !0
|
|
3781
3781
|
})
|
|
3782
3782
|
] }) }),
|
|
3783
3783
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-2 pt-0.5", children: [
|
|
3784
3784
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-600", children: [
|
|
3785
|
-
/* @__PURE__ */ r(
|
|
3785
|
+
/* @__PURE__ */ r(Ji, { className: "h-3 w-3" }),
|
|
3786
3786
|
/* @__PURE__ */ r("span", { children: "Draft" })
|
|
3787
3787
|
] }),
|
|
3788
3788
|
t === "UNSAVED" ? /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-red-500/10 px-1.5 py-0.5 text-xs text-red-600", children: [
|
|
@@ -3798,13 +3798,13 @@ function No() {
|
|
|
3798
3798
|
isFetching: f,
|
|
3799
3799
|
error: h,
|
|
3800
3800
|
refetch: y
|
|
3801
|
-
} = Eo(c == null ? void 0 : c.id), { mutate: v, isPending: p } = bo(), { mutate: N, isPending: E } = wo(), A =
|
|
3801
|
+
} = Eo(c == null ? void 0 : c.id), { mutate: v, isPending: p } = bo(), { mutate: N, isPending: E } = wo(), A = Te(), U = (L) => {
|
|
3802
3802
|
n && N(
|
|
3803
3803
|
{ revisionId: n.uid, discardCurrent: L },
|
|
3804
3804
|
{
|
|
3805
3805
|
onSuccess: () => {
|
|
3806
3806
|
i(!1), s(null), A.invalidateQueries({
|
|
3807
|
-
queryKey: [
|
|
3807
|
+
queryKey: [W, _.GET_DRAFT_PAGE]
|
|
3808
3808
|
});
|
|
3809
3809
|
}
|
|
3810
3810
|
}
|
|
@@ -3825,7 +3825,7 @@ function No() {
|
|
|
3825
3825
|
}, [e, y]), /* @__PURE__ */ u(Ne, { children: [
|
|
3826
3826
|
/* @__PURE__ */ r(Sr, { children: /* @__PURE__ */ u(fs, { children: [
|
|
3827
3827
|
/* @__PURE__ */ u(vr, { open: e, onOpenChange: t, children: [
|
|
3828
|
-
/* @__PURE__ */ r(
|
|
3828
|
+
/* @__PURE__ */ r(Ni, { asChild: !0, children: /* @__PURE__ */ r(gs, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
|
|
3829
3829
|
/* @__PURE__ */ u(C, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
|
|
3830
3830
|
/* @__PURE__ */ r(Os, { className: "h-4 w-4" }),
|
|
3831
3831
|
/* @__PURE__ */ r("span", { className: "sr-only", children: "View revision history" })
|
|
@@ -3847,7 +3847,7 @@ function No() {
|
|
|
3847
3847
|
)
|
|
3848
3848
|
] })
|
|
3849
3849
|
] }),
|
|
3850
|
-
/* @__PURE__ */ r(
|
|
3850
|
+
/* @__PURE__ */ r(Ai, { className: "h-[calc(100vh-6rem)] pr-2", children: f ? /* @__PURE__ */ r(Ao, {}) : h ? /* @__PURE__ */ r("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Failed to load revisions. Please try again." }) : /* @__PURE__ */ u("div", { className: "mt-2 space-y-2", children: [
|
|
3851
3851
|
/* @__PURE__ */ r(So, {}),
|
|
3852
3852
|
d == null ? void 0 : d.map((L) => /* @__PURE__ */ r(
|
|
3853
3853
|
xo,
|
|
@@ -3919,10 +3919,10 @@ function xo({
|
|
|
3919
3919
|
] }) }),
|
|
3920
3920
|
/* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: /* @__PURE__ */ r("span", { children: Gn(e.createdAt, "MMM d, h:mm a") }) }),
|
|
3921
3921
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 pt-0.5", children: e.type === "published" ? /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-green-500/10 px-1.5 py-0.5 text-xs text-green-600", children: [
|
|
3922
|
-
/* @__PURE__ */ r(
|
|
3922
|
+
/* @__PURE__ */ r(Qi, { className: "h-3 w-3" }),
|
|
3923
3923
|
/* @__PURE__ */ r("span", { children: "Published" })
|
|
3924
3924
|
] }) : /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-600", children: [
|
|
3925
|
-
/* @__PURE__ */ r(
|
|
3925
|
+
/* @__PURE__ */ r(Xi, { className: "h-3 w-3" }),
|
|
3926
3926
|
/* @__PURE__ */ r("span", { children: "Draft" })
|
|
3927
3927
|
] }) })
|
|
3928
3928
|
] }),
|
|
@@ -3961,7 +3961,7 @@ function To({
|
|
|
3961
3961
|
/* @__PURE__ */ r("span", { children: "Restore this version" })
|
|
3962
3962
|
] }) }),
|
|
3963
3963
|
/* @__PURE__ */ r(Be, { permission: he.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ u(Ne, { children: [
|
|
3964
|
-
/* @__PURE__ */ r(
|
|
3964
|
+
/* @__PURE__ */ r(xi, {}),
|
|
3965
3965
|
/* @__PURE__ */ u(
|
|
3966
3966
|
Ge,
|
|
3967
3967
|
{
|
|
@@ -3986,7 +3986,7 @@ function Co({
|
|
|
3986
3986
|
}) {
|
|
3987
3987
|
const { data: i } = dn((n == null ? void 0 : n.currentEditor) || ""), l = (i == null ? void 0 : i.name) || "Unknown";
|
|
3988
3988
|
return n ? /* @__PURE__ */ r(
|
|
3989
|
-
|
|
3989
|
+
He,
|
|
3990
3990
|
{
|
|
3991
3991
|
open: e,
|
|
3992
3992
|
onOpenChange: (o) => {
|
|
@@ -4019,7 +4019,7 @@ function Co({
|
|
|
4019
4019
|
/* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
4020
4020
|
"Saving as draft..."
|
|
4021
4021
|
] }) : /* @__PURE__ */ u(Ne, { children: [
|
|
4022
|
-
/* @__PURE__ */ r(
|
|
4022
|
+
/* @__PURE__ */ r(Zi, { className: "mr-2 h-4 w-4" }),
|
|
4023
4023
|
"Save as draft"
|
|
4024
4024
|
] })
|
|
4025
4025
|
}
|
|
@@ -4054,7 +4054,7 @@ function Po({
|
|
|
4054
4054
|
}) {
|
|
4055
4055
|
const { data: i } = dn((n == null ? void 0 : n.currentEditor) || ""), l = (i == null ? void 0 : i.name) || "Unknown";
|
|
4056
4056
|
return n ? /* @__PURE__ */ r(
|
|
4057
|
-
|
|
4057
|
+
He,
|
|
4058
4058
|
{
|
|
4059
4059
|
open: e,
|
|
4060
4060
|
onOpenChange: (o) => {
|
|
@@ -4110,7 +4110,7 @@ function Po({
|
|
|
4110
4110
|
const _o = () => {
|
|
4111
4111
|
const e = ee(), t = X();
|
|
4112
4112
|
return Pe({
|
|
4113
|
-
queryKey: [
|
|
4113
|
+
queryKey: [W, _.GET_CHANGES],
|
|
4114
4114
|
queryFn: async () => t(e, { action: _.GET_CHANGES })
|
|
4115
4115
|
});
|
|
4116
4116
|
}, Io = ({ currentEditor: e }) => {
|
|
@@ -4121,24 +4121,24 @@ function ko({
|
|
|
4121
4121
|
showModal: e = !1,
|
|
4122
4122
|
onClose: t = () => console.log("Cancelled")
|
|
4123
4123
|
}) {
|
|
4124
|
-
const [n, s] = P([]), { data: a, isFetching: i } = _o(), { data: l } = De(), o =
|
|
4124
|
+
const [n, s] = P([]), { data: a, isFetching: i } = _o(), { data: l } = De(), o = xe(
|
|
4125
4125
|
(w) => {
|
|
4126
4126
|
var I;
|
|
4127
4127
|
return (I = Ee(l, { key: w })) == null ? void 0 : I.hasSlug;
|
|
4128
4128
|
},
|
|
4129
4129
|
[l]
|
|
4130
|
-
), c =
|
|
4130
|
+
), c = $(
|
|
4131
4131
|
() => Ie(l, (w) => !o(w.key)).map(
|
|
4132
4132
|
(w) => w.key
|
|
4133
4133
|
),
|
|
4134
4134
|
[o, l]
|
|
4135
|
-
), d =
|
|
4135
|
+
), d = $(
|
|
4136
4136
|
() => Ie(a, (w) => !c.includes(w.pageType)),
|
|
4137
4137
|
[a, c]
|
|
4138
|
-
), f =
|
|
4138
|
+
), f = $(
|
|
4139
4139
|
() => Ie(a, (w) => c.includes(w.pageType)),
|
|
4140
4140
|
[a, c]
|
|
4141
|
-
), h =
|
|
4141
|
+
), h = $(
|
|
4142
4142
|
() => Ee(a, { pageType: "theme", id: "THEME" }),
|
|
4143
4143
|
[a]
|
|
4144
4144
|
), { mutate: y, isPending: v } = As();
|
|
@@ -4154,7 +4154,7 @@ function ko({
|
|
|
4154
4154
|
s(p ? [] : qe(a, "id"));
|
|
4155
4155
|
}, A = () => {
|
|
4156
4156
|
y(
|
|
4157
|
-
{ ids:
|
|
4157
|
+
{ ids: Va(n) },
|
|
4158
4158
|
{
|
|
4159
4159
|
onSuccess: () => {
|
|
4160
4160
|
t(), Tn("CENTER_CENTER");
|
|
@@ -4165,7 +4165,7 @@ function ko({
|
|
|
4165
4165
|
if (w === "theme") return "Theme";
|
|
4166
4166
|
const I = Ee(l, { key: w });
|
|
4167
4167
|
return I ? I == null ? void 0 : I.name : w;
|
|
4168
|
-
}, S =
|
|
4168
|
+
}, S = $(() => {
|
|
4169
4169
|
const w = [
|
|
4170
4170
|
{ label: "Updated", top: "pt-2" },
|
|
4171
4171
|
...mn(Ie(d, { online: !0 }), "pageType"),
|
|
@@ -4177,7 +4177,7 @@ function ko({
|
|
|
4177
4177
|
], L = h ? [{ label: "Theme", top: "pt-6" }, h] : [];
|
|
4178
4178
|
return [...w, ...L, ...I];
|
|
4179
4179
|
}, [d, f, h]);
|
|
4180
|
-
return /* @__PURE__ */ r(
|
|
4180
|
+
return /* @__PURE__ */ r(He, { open: e, onOpenChange: v ? () => {
|
|
4181
4181
|
} : t, children: /* @__PURE__ */ u(Ke, { className: "max-w-4xl max-h-[80%] flex flex-col", children: [
|
|
4182
4182
|
/* @__PURE__ */ u(Ve, { children: [
|
|
4183
4183
|
/* @__PURE__ */ r(ze, { children: "Publish changes" }),
|
|
@@ -4250,7 +4250,7 @@ function ko({
|
|
|
4250
4250
|
}
|
|
4251
4251
|
),
|
|
4252
4252
|
" ",
|
|
4253
|
-
o(w.pageType) ? /* @__PURE__ */ r(on, { className: "w-4 h-4" }) : /* @__PURE__ */ r(
|
|
4253
|
+
o(w.pageType) ? /* @__PURE__ */ r(on, { className: "w-4 h-4" }) : /* @__PURE__ */ r(el, { className: "w-4 h-4" }),
|
|
4254
4254
|
w.name,
|
|
4255
4255
|
w.slug && /* @__PURE__ */ u("span", { className: "text-xs text-gray-500", children: [
|
|
4256
4256
|
"(",
|
|
@@ -4275,7 +4275,7 @@ function ko({
|
|
|
4275
4275
|
),
|
|
4276
4276
|
/* @__PURE__ */ r("td", { className: "px-2", children: w.lang }),
|
|
4277
4277
|
/* @__PURE__ */ r("td", { className: "px-2", children: U(w == null ? void 0 : w.pageType) }),
|
|
4278
|
-
/* @__PURE__ */ r("td", { className: "px-4 text-right", children:
|
|
4278
|
+
/* @__PURE__ */ r("td", { className: "px-4 text-right", children: Ka(w.changes) || "" })
|
|
4279
4279
|
]
|
|
4280
4280
|
},
|
|
4281
4281
|
w == null ? void 0 : w.id
|
|
@@ -4307,8 +4307,8 @@ const Lo = () => {
|
|
|
4307
4307
|
});
|
|
4308
4308
|
};
|
|
4309
4309
|
function Do({ onClose: e }) {
|
|
4310
|
-
const { data: t, isFetching: n } = Lo(), { mutateAsync: s, isPending: a } = Al(), i =
|
|
4311
|
-
return i ? /* @__PURE__ */ r(
|
|
4310
|
+
const { data: t, isFetching: n } = Lo(), { mutateAsync: s, isPending: a } = Al(), i = nt("settingComponent", null), l = za(async (o) => (await s({ data: o }), !0), 300);
|
|
4311
|
+
return i ? /* @__PURE__ */ r(He, { open: !0, onOpenChange: e, children: /* @__PURE__ */ u(Ke, { className: "w-full", children: [
|
|
4312
4312
|
/* @__PURE__ */ r(Ve, { children: /* @__PURE__ */ r(ze, { children: "Website Settings" }) }),
|
|
4313
4313
|
n ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
|
|
4314
4314
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
@@ -4326,7 +4326,7 @@ function Do({ onClose: e }) {
|
|
|
4326
4326
|
}) })
|
|
4327
4327
|
] }) }) : null;
|
|
4328
4328
|
}
|
|
4329
|
-
function
|
|
4329
|
+
function zr({
|
|
4330
4330
|
children: e,
|
|
4331
4331
|
content: t
|
|
4332
4332
|
}) {
|
|
@@ -4336,13 +4336,13 @@ function Vr({
|
|
|
4336
4336
|
] }) });
|
|
4337
4337
|
}
|
|
4338
4338
|
const Go = () => {
|
|
4339
|
-
const { selectedLang: e } = dt(), t =
|
|
4339
|
+
const { selectedLang: e } = dt(), t = nt("getPreviewUrl", async (f) => f), [n, s] = P(""), { data: a, isFetching: i } = Oe(), { data: l } = cn(), { data: o } = De(), c = $(
|
|
4340
4340
|
() => {
|
|
4341
4341
|
var f;
|
|
4342
4342
|
return (f = l == null ? void 0 : l.find((h) => (h == null ? void 0 : h.lang) === e)) == null ? void 0 : f.slug;
|
|
4343
4343
|
},
|
|
4344
4344
|
[e, l]
|
|
4345
|
-
), d =
|
|
4345
|
+
), d = xe(
|
|
4346
4346
|
(f) => {
|
|
4347
4347
|
var h;
|
|
4348
4348
|
return (h = Ee(o, { key: f })) == null ? void 0 : h.hasSlug;
|
|
@@ -4363,16 +4363,16 @@ const Go = () => {
|
|
|
4363
4363
|
q.PREVIEW
|
|
4364
4364
|
] }) }) });
|
|
4365
4365
|
}, Uo = () => {
|
|
4366
|
-
const [e, t] =
|
|
4366
|
+
const [e, t] = oi();
|
|
4367
4367
|
return /* @__PURE__ */ u(Ne, { children: [
|
|
4368
|
-
/* @__PURE__ */ r(
|
|
4368
|
+
/* @__PURE__ */ r(zr, { content: q.THEME, children: /* @__PURE__ */ r(
|
|
4369
4369
|
C,
|
|
4370
4370
|
{
|
|
4371
4371
|
variant: e === "theme" ? "outline" : "ghost",
|
|
4372
4372
|
size: "icon",
|
|
4373
4373
|
className: "gap-2",
|
|
4374
4374
|
onClick: () => t(e === "theme" ? "block" : "theme"),
|
|
4375
|
-
children: /* @__PURE__ */ r(
|
|
4375
|
+
children: /* @__PURE__ */ r(tl, { className: "w-4 h-4" })
|
|
4376
4376
|
}
|
|
4377
4377
|
) }),
|
|
4378
4378
|
/* @__PURE__ */ r("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
|
|
@@ -4387,16 +4387,16 @@ const Go = () => {
|
|
|
4387
4387
|
window.removeEventListener("beforeunload", f);
|
|
4388
4388
|
};
|
|
4389
4389
|
}, [a]);
|
|
4390
|
-
const i =
|
|
4390
|
+
const i = xe(async () => {
|
|
4391
4391
|
t(!0), await s(!1);
|
|
4392
4392
|
}, [s]);
|
|
4393
4393
|
Ae(() => {
|
|
4394
4394
|
a === "SAVED" && t(!1);
|
|
4395
4395
|
}, [a]);
|
|
4396
|
-
const l =
|
|
4396
|
+
const l = $(() => {
|
|
4397
4397
|
if (a === "SAVED" || a === "UNSAVED") return a;
|
|
4398
4398
|
if (a === "SAVING") return e ? a : "SAVED";
|
|
4399
|
-
}, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: d } =
|
|
4399
|
+
}, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: d } = $(() => {
|
|
4400
4400
|
switch (l) {
|
|
4401
4401
|
case "UNSAVED":
|
|
4402
4402
|
return {
|
|
@@ -4413,7 +4413,7 @@ const Go = () => {
|
|
|
4413
4413
|
case "SAVED":
|
|
4414
4414
|
return {
|
|
4415
4415
|
tooltipContent: q.SAVED,
|
|
4416
|
-
buttonIcon: /* @__PURE__ */ r(
|
|
4416
|
+
buttonIcon: /* @__PURE__ */ r(nl, { className: "w-4 h-4" }),
|
|
4417
4417
|
buttonClass: "text-green-500 flex items-center gap-x-1 leading-tight"
|
|
4418
4418
|
};
|
|
4419
4419
|
}
|
|
@@ -4433,7 +4433,7 @@ const Go = () => {
|
|
|
4433
4433
|
}
|
|
4434
4434
|
);
|
|
4435
4435
|
}, Oo = () => {
|
|
4436
|
-
const [e, t] = P(!1), [n, s] = P(!1), [a, i] = P(null), { data: l } = Oe(), { mutate: o, isPending: c } = As(), [d] =
|
|
4436
|
+
const [e, t] = P(!1), [n, s] = P(!1), [a, i] = P(null), { data: l } = Oe(), { mutate: o, isPending: c } = As(), [d] = ci(), { buttonText: f, buttonClassName: h, isPublished: y } = $(() => {
|
|
4437
4437
|
const p = l && (l == null ? void 0 : l.online);
|
|
4438
4438
|
return {
|
|
4439
4439
|
buttonClassName: p ? "hover:bg-green-600 bg-green-500" : "",
|
|
@@ -4539,16 +4539,16 @@ const Go = () => {
|
|
|
4539
4539
|
)
|
|
4540
4540
|
] });
|
|
4541
4541
|
}, Bo = () => {
|
|
4542
|
-
const e =
|
|
4542
|
+
const e = nt("settingComponent", null), [t, n] = P(!1);
|
|
4543
4543
|
return e ? /* @__PURE__ */ u(Ne, { children: [
|
|
4544
|
-
/* @__PURE__ */ r(
|
|
4544
|
+
/* @__PURE__ */ r(zr, { content: q.WEBSITEDATA, children: /* @__PURE__ */ r(
|
|
4545
4545
|
C,
|
|
4546
4546
|
{
|
|
4547
4547
|
variant: "ghost",
|
|
4548
4548
|
size: "icon",
|
|
4549
4549
|
className: "gap-2",
|
|
4550
4550
|
onClick: () => n(!0),
|
|
4551
|
-
children: /* @__PURE__ */ r(
|
|
4551
|
+
children: /* @__PURE__ */ r(sl, { className: "w-4 h-4" })
|
|
4552
4552
|
}
|
|
4553
4553
|
) }),
|
|
4554
4554
|
t && /* @__PURE__ */ r(Do, { onClose: () => n(!1) }),
|
|
@@ -4556,7 +4556,7 @@ const Go = () => {
|
|
|
4556
4556
|
] }) : null;
|
|
4557
4557
|
}, Mo = () => {
|
|
4558
4558
|
const { data: e } = Oe(), t = e && (e == null ? void 0 : e.online), { data: n } = De();
|
|
4559
|
-
return
|
|
4559
|
+
return xe(
|
|
4560
4560
|
(a) => {
|
|
4561
4561
|
var i;
|
|
4562
4562
|
return (i = Ee(n, { key: a })) == null ? void 0 : i.hasSlug;
|
|
@@ -4571,14 +4571,14 @@ const Go = () => {
|
|
|
4571
4571
|
size: "sm",
|
|
4572
4572
|
className: "flex items-center gap-1",
|
|
4573
4573
|
children: [
|
|
4574
|
-
/* @__PURE__ */ r(
|
|
4574
|
+
/* @__PURE__ */ r(rl, { className: "w-4 h-4" }),
|
|
4575
4575
|
/* @__PURE__ */ r("span", { className: "hidden sm:inline", children: q.OPEN })
|
|
4576
4576
|
]
|
|
4577
4577
|
}
|
|
4578
4578
|
) : null;
|
|
4579
4579
|
};
|
|
4580
4580
|
function Fo() {
|
|
4581
|
-
const { isLocked: e } = hn(), [t] = Re(), n = t.get("lang"), s =
|
|
4581
|
+
const { isLocked: e } = hn(), [t] = Re(), n = t.get("lang"), s = Mr(n);
|
|
4582
4582
|
return e || !s ? null : /* @__PURE__ */ u("div", { className: "flex items-center justify-end gap-1", children: [
|
|
4583
4583
|
/* @__PURE__ */ r(No, {}),
|
|
4584
4584
|
/* @__PURE__ */ r(Be, { permission: he.EDIT_THEME, children: /* @__PURE__ */ r(Uo, {}) }),
|
|
@@ -4592,56 +4592,56 @@ function Fo() {
|
|
|
4592
4592
|
const qo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-center justify-between w-full", children: [
|
|
4593
4593
|
/* @__PURE__ */ r(vo, {}),
|
|
4594
4594
|
/* @__PURE__ */ r(Fo, {})
|
|
4595
|
-
] }),
|
|
4595
|
+
] }), jo = () => {
|
|
4596
4596
|
const e = ee(), { aiContext: t } = ws(), n = X();
|
|
4597
|
-
return
|
|
4597
|
+
return xe(
|
|
4598
4598
|
async (s, a, i, l) => n(e, {
|
|
4599
4599
|
action: _.ASK_AI,
|
|
4600
4600
|
data: { type: s, prompt: a, blocks: i, context: t, lang: l }
|
|
4601
4601
|
}),
|
|
4602
4602
|
[e, t, n]
|
|
4603
4603
|
);
|
|
4604
|
-
},
|
|
4604
|
+
}, Ho = (e, t) => t.map((n) => {
|
|
4605
4605
|
if (sn(e, n._type)) {
|
|
4606
|
-
const s =
|
|
4606
|
+
const s = ml(n._type);
|
|
4607
4607
|
return {
|
|
4608
4608
|
...s,
|
|
4609
4609
|
...tr(n, [
|
|
4610
|
-
|
|
4610
|
+
...$a(s),
|
|
4611
4611
|
"_type",
|
|
4612
4612
|
"_id",
|
|
4613
4613
|
"_name",
|
|
4614
4614
|
"_parent",
|
|
4615
4615
|
"_bindings"
|
|
4616
4616
|
]),
|
|
4617
|
-
|
|
4617
|
+
...Wa(n, (a, i) => er(i, "_attrs")),
|
|
4618
4618
|
...n
|
|
4619
4619
|
};
|
|
4620
4620
|
}
|
|
4621
4621
|
return n;
|
|
4622
4622
|
}), Ko = (e) => {
|
|
4623
|
-
const t =
|
|
4624
|
-
return
|
|
4623
|
+
const t = hl();
|
|
4624
|
+
return $(() => {
|
|
4625
4625
|
if (!e || ye(e)) return { blocks: [] };
|
|
4626
4626
|
const n = Ie(
|
|
4627
4627
|
e,
|
|
4628
4628
|
(s) => !Ft(s == null ? void 0 : s._type, "@chai/")
|
|
4629
4629
|
);
|
|
4630
|
-
return { blocks:
|
|
4630
|
+
return { blocks: Ho(t, n) };
|
|
4631
4631
|
}, [e, t]);
|
|
4632
4632
|
}, Vo = () => {
|
|
4633
4633
|
const e = ee(), t = X();
|
|
4634
4634
|
return Pe({
|
|
4635
|
-
queryKey: [
|
|
4635
|
+
queryKey: [W, "uiLibraries"],
|
|
4636
4636
|
initialData: [],
|
|
4637
4637
|
queryFn: async () => (await t(e, { action: "GET_LIBRARIES" })).map((s) => ({
|
|
4638
4638
|
...s
|
|
4639
4639
|
}))
|
|
4640
4640
|
});
|
|
4641
4641
|
}, zo = () => {
|
|
4642
|
-
const e = Un(), t = X(), { user: n } =
|
|
4642
|
+
const e = Un(), t = X(), { user: n } = tt(), s = n == null ? void 0 : n.id;
|
|
4643
4643
|
return Pe({
|
|
4644
|
-
queryKey: [
|
|
4644
|
+
queryKey: [W, "permissions", s],
|
|
4645
4645
|
queryFn: () => t(e, {
|
|
4646
4646
|
action: _.GET_ROLE_AND_PERMISSIONS,
|
|
4647
4647
|
data: { userId: s }
|
|
@@ -4655,7 +4655,7 @@ const qo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4655
4655
|
action: "GET_LIBRARY_ITEM",
|
|
4656
4656
|
data: { id: c.id }
|
|
4657
4657
|
}), f = le(d, "html", ""), h = le(d, "blocks", []);
|
|
4658
|
-
return
|
|
4658
|
+
return Ya(h) ? h : ui(f);
|
|
4659
4659
|
}, getUILibraryBlocks: async (o) => {
|
|
4660
4660
|
try {
|
|
4661
4661
|
return (await t(e, {
|
|
@@ -4689,7 +4689,7 @@ const qo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4689
4689
|
}, Wo = () => {
|
|
4690
4690
|
const { data: e } = Rn(), t = ee(), n = X();
|
|
4691
4691
|
return {
|
|
4692
|
-
getPartialBlocks:
|
|
4692
|
+
getPartialBlocks: xe(async () => {
|
|
4693
4693
|
const s = {};
|
|
4694
4694
|
for (const a of e ?? [])
|
|
4695
4695
|
ye(a == null ? void 0 : a.slug) && (s[a.id] = {
|
|
@@ -4699,7 +4699,7 @@ const qo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4699
4699
|
});
|
|
4700
4700
|
return s;
|
|
4701
4701
|
}, [e]),
|
|
4702
|
-
getPartialBlockBlocks:
|
|
4702
|
+
getPartialBlockBlocks: xe(
|
|
4703
4703
|
async (s) => {
|
|
4704
4704
|
if (!s) return [];
|
|
4705
4705
|
try {
|
|
@@ -4719,7 +4719,7 @@ const qo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4719
4719
|
email: An.string().email({ message: "Please enter a valid email address" }),
|
|
4720
4720
|
password: An.string().min(6, { message: "Password must be at least 6 characters" })
|
|
4721
4721
|
}), Yo = () => {
|
|
4722
|
-
const { setUser: e } =
|
|
4722
|
+
const { setUser: e } = tt(), t = Un(), [n, s] = P(""), [a, i] = P(""), [l, o] = P({}), [c, d] = P(!1), [f, h] = P(""), y = _e({
|
|
4723
4723
|
mutationFn: async (N) => {
|
|
4724
4724
|
h("");
|
|
4725
4725
|
const E = await bs(t, {
|
|
@@ -4761,7 +4761,7 @@ const qo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4761
4761
|
return /* @__PURE__ */ r("div", { className: "flex justify-center items-center min-h-screen bg-slate-50", children: /* @__PURE__ */ u(cs, { className: "w-full max-w-md", children: [
|
|
4762
4762
|
/* @__PURE__ */ u(us, { children: [
|
|
4763
4763
|
/* @__PURE__ */ r(ds, { className: "text-2xl", children: "Sign in" }),
|
|
4764
|
-
/* @__PURE__ */ r(
|
|
4764
|
+
/* @__PURE__ */ r(Ti, { children: "Enter your credentials to sign in to visual builder" })
|
|
4765
4765
|
] }),
|
|
4766
4766
|
/* @__PURE__ */ r(hs, { children: /* @__PURE__ */ u("form", { onSubmit: v, className: "space-y-4", children: [
|
|
4767
4767
|
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
@@ -4799,7 +4799,7 @@ const qo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4799
4799
|
type: "button",
|
|
4800
4800
|
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",
|
|
4801
4801
|
onClick: () => d(!c),
|
|
4802
|
-
children: c ? /* @__PURE__ */ r(
|
|
4802
|
+
children: c ? /* @__PURE__ */ r(al, { className: "h-4 w-4" }) : /* @__PURE__ */ r(Dr, { className: "h-4 w-4" })
|
|
4803
4803
|
}
|
|
4804
4804
|
)
|
|
4805
4805
|
] }),
|
|
@@ -4862,19 +4862,19 @@ const qo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
|
|
|
4862
4862
|
] }) });
|
|
4863
4863
|
};
|
|
4864
4864
|
let Wn = Yo;
|
|
4865
|
-
const Qo = () =>
|
|
4865
|
+
const Qo = () => $(() => Wn, [Wn]), ed = (e) => {
|
|
4866
4866
|
Wn = e;
|
|
4867
4867
|
}, Xo = () => {
|
|
4868
4868
|
const e = Qo();
|
|
4869
|
-
return /* @__PURE__ */ r(
|
|
4869
|
+
return /* @__PURE__ */ r(Ja, { fallback: /* @__PURE__ */ r("div", { children: "Loading..." }), children: /* @__PURE__ */ r(e, {}) });
|
|
4870
4870
|
}, Zo = ({
|
|
4871
4871
|
isActive: e,
|
|
4872
4872
|
show: t
|
|
4873
4873
|
}) => {
|
|
4874
4874
|
const { data: n } = un();
|
|
4875
|
-
return !sn(n, "languages") || !le(n, "languages", []).length ? null : /* @__PURE__ */ r(C, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ r(
|
|
4876
|
-
},
|
|
4877
|
-
id:
|
|
4875
|
+
return !sn(n, "languages") || !le(n, "languages", []).length ? null : /* @__PURE__ */ r(C, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ r(il, { className: "w-4 h-4" }) });
|
|
4876
|
+
}, $r = "lang", Jo = {
|
|
4877
|
+
id: $r,
|
|
4878
4878
|
label: "Languages",
|
|
4879
4879
|
position: "top",
|
|
4880
4880
|
panel: to,
|
|
@@ -4919,23 +4919,23 @@ function Ze({
|
|
|
4919
4919
|
role: "combobox",
|
|
4920
4920
|
"aria-expanded": a,
|
|
4921
4921
|
disabled: s,
|
|
4922
|
-
children: /* @__PURE__ */ r(
|
|
4922
|
+
children: /* @__PURE__ */ r(ll, { className: "h-3 w-3" })
|
|
4923
4923
|
}
|
|
4924
4924
|
) }) }),
|
|
4925
4925
|
/* @__PURE__ */ r(ps, { children: "Add field" })
|
|
4926
4926
|
] }),
|
|
4927
|
-
/* @__PURE__ */ r(pr, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ u(
|
|
4928
|
-
/* @__PURE__ */ r(
|
|
4929
|
-
/* @__PURE__ */ u(
|
|
4930
|
-
/* @__PURE__ */ r(
|
|
4931
|
-
/* @__PURE__ */ u(
|
|
4927
|
+
/* @__PURE__ */ r(pr, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ u(Ci, { children: [
|
|
4928
|
+
/* @__PURE__ */ r(Pi, { className: "border-none", placeholder: "Search..." }),
|
|
4929
|
+
/* @__PURE__ */ u(_i, { children: [
|
|
4930
|
+
/* @__PURE__ */ r(Ii, { children: "No option found." }),
|
|
4931
|
+
/* @__PURE__ */ u(ki, { children: [
|
|
4932
4932
|
l.length > 0 && /* @__PURE__ */ u(
|
|
4933
4933
|
Us,
|
|
4934
4934
|
{
|
|
4935
4935
|
onSelect: y,
|
|
4936
4936
|
className: "flex items-center text-sm",
|
|
4937
4937
|
children: [
|
|
4938
|
-
/* @__PURE__ */ r(
|
|
4938
|
+
/* @__PURE__ */ r(ol, { className: "w-4 h-4 mr-2" }),
|
|
4939
4939
|
"Back"
|
|
4940
4940
|
]
|
|
4941
4941
|
}
|
|
@@ -4960,7 +4960,7 @@ function Ze({
|
|
|
4960
4960
|
children: "Select"
|
|
4961
4961
|
}
|
|
4962
4962
|
),
|
|
4963
|
-
(p.type === "object" || p.type === "array") && /* @__PURE__ */ r("div", { className: "p-1 rounded hover:bg-muted cursor-pointer", children: /* @__PURE__ */ r(
|
|
4963
|
+
(p.type === "object" || p.type === "array") && /* @__PURE__ */ r("div", { className: "p-1 rounded hover:bg-muted cursor-pointer", children: /* @__PURE__ */ r(cl, { className: "w-4 h-4 opacity-50" }) })
|
|
4964
4964
|
] })
|
|
4965
4965
|
]
|
|
4966
4966
|
},
|
|
@@ -4973,7 +4973,7 @@ function Ze({
|
|
|
4973
4973
|
}
|
|
4974
4974
|
const ec = () => {
|
|
4975
4975
|
const { selectedLang: e } = dt(), { data: t, isFetching: n } = cn();
|
|
4976
|
-
return { data:
|
|
4976
|
+
return { data: $(() => Ee(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
|
|
4977
4977
|
}, tc = (e, t) => {
|
|
4978
4978
|
const n = e.selectionStart || 0, s = e.selectionEnd || 0, a = e.value, i = a.substring(0, n), l = a.substring(s);
|
|
4979
4979
|
let o = !1;
|
|
@@ -4992,8 +4992,8 @@ const ec = () => {
|
|
|
4992
4992
|
value: y,
|
|
4993
4993
|
newCursorPos: v
|
|
4994
4994
|
};
|
|
4995
|
-
},
|
|
4996
|
-
const { t: e } =
|
|
4995
|
+
}, Wr = () => {
|
|
4996
|
+
const { t: e } = di(), { selectedLang: t, fallbackLang: n, languages: s } = dt(), [, a] = hi(), { data: i } = Oe(), { data: l } = qr({
|
|
4997
4997
|
lang: t || n,
|
|
4998
4998
|
pageType: i == null ? void 0 : i.pageType
|
|
4999
4999
|
}), { data: o, isFetching: c } = ec(), d = o == null ? void 0 : o.seo, f = ut(
|
|
@@ -5090,7 +5090,7 @@ const ec = () => {
|
|
|
5090
5090
|
y(O), v.current.updated = O;
|
|
5091
5091
|
};
|
|
5092
5092
|
return /* @__PURE__ */ u("div", { className: "relative h-full flex flex-col", children: [
|
|
5093
|
-
!S && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-10 backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ r(yr, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ r(
|
|
5093
|
+
!S && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-10 backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ r(yr, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ r(Li, { children: e(
|
|
5094
5094
|
"You don't have permission to edit SEO settings. Contact your administrator for access."
|
|
5095
5095
|
) }) }) }),
|
|
5096
5096
|
/* @__PURE__ */ u("div", { className: "flex-grow overflow-y-auto no-scrollbar px-2", children: [
|
|
@@ -5101,11 +5101,11 @@ const ec = () => {
|
|
|
5101
5101
|
" ",
|
|
5102
5102
|
s.length > 0 && /* @__PURE__ */ u("span", { className: "font-semibold text-blue-500", children: [
|
|
5103
5103
|
"(",
|
|
5104
|
-
le(
|
|
5104
|
+
le(je, p, p),
|
|
5105
5105
|
")"
|
|
5106
5106
|
] })
|
|
5107
5107
|
] }),
|
|
5108
|
-
/* @__PURE__ */ r("form", { className: "space-y-8", children: /* @__PURE__ */ u(
|
|
5108
|
+
/* @__PURE__ */ r("form", { className: "space-y-8", children: /* @__PURE__ */ u(Di, { type: "multiple", defaultValue: ["page"], children: [
|
|
5109
5109
|
/* @__PURE__ */ u(gn, { value: "page", children: [
|
|
5110
5110
|
/* @__PURE__ */ r(pn, { className: "font-semibold text-slate-700", children: e("SEO") }),
|
|
5111
5111
|
/* @__PURE__ */ r(yn, { className: "pt-2", children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
@@ -5433,12 +5433,12 @@ const ec = () => {
|
|
|
5433
5433
|
) })
|
|
5434
5434
|
] });
|
|
5435
5435
|
};
|
|
5436
|
-
|
|
5437
|
-
const
|
|
5436
|
+
Wr.displayName = "SeoPanel";
|
|
5437
|
+
const Yr = "seo", nc = ({
|
|
5438
5438
|
isActive: e,
|
|
5439
5439
|
show: t
|
|
5440
5440
|
}) => {
|
|
5441
|
-
const { data: n } = Oe(), s =
|
|
5441
|
+
const { data: n } = Oe(), s = Hl(n == null ? void 0 : n.pageType);
|
|
5442
5442
|
return !sn(s, "hasSlug") || !s.hasSlug ? null : /* @__PURE__ */ r(
|
|
5443
5443
|
C,
|
|
5444
5444
|
{
|
|
@@ -5462,20 +5462,20 @@ const Wr = "seo", nc = ({
|
|
|
5462
5462
|
}
|
|
5463
5463
|
);
|
|
5464
5464
|
}, sc = {
|
|
5465
|
-
id:
|
|
5465
|
+
id: Yr,
|
|
5466
5466
|
label: "SEO",
|
|
5467
|
-
panel:
|
|
5467
|
+
panel: Wr,
|
|
5468
5468
|
button: nc,
|
|
5469
5469
|
position: "top",
|
|
5470
5470
|
view: "modal",
|
|
5471
5471
|
width: 600
|
|
5472
5472
|
}, rc = () => {
|
|
5473
|
-
$n(
|
|
5473
|
+
$n(Yr, sc), $n($r, Jo);
|
|
5474
5474
|
}, ac = "user-info", ic = () => {
|
|
5475
|
-
const { user: e, logout: t } =
|
|
5476
|
-
return e ? /* @__PURE__ */ u(
|
|
5477
|
-
/* @__PURE__ */ r(
|
|
5478
|
-
/* @__PURE__ */ u(
|
|
5475
|
+
const { user: e, logout: t } = tt(), n = nt("onLogout", Qa);
|
|
5476
|
+
return e ? /* @__PURE__ */ u(Gi, { children: [
|
|
5477
|
+
/* @__PURE__ */ r(Ui, { asChild: !0, children: /* @__PURE__ */ r(C, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ r(ul, { className: "w-4 h-4" }) }) }),
|
|
5478
|
+
/* @__PURE__ */ u(Ri, { className: "w-auto p-4 space-y-2", children: [
|
|
5479
5479
|
/* @__PURE__ */ r("div", { className: "text-sm font-medium", children: e.name ?? e.email }),
|
|
5480
5480
|
/* @__PURE__ */ r("div", { className: "text-xs text-muted-foreground", children: e.email }),
|
|
5481
5481
|
/* @__PURE__ */ u(ar, { children: [
|
|
@@ -5491,7 +5491,7 @@ const Wr = "seo", nc = ({
|
|
|
5491
5491
|
mr,
|
|
5492
5492
|
{
|
|
5493
5493
|
onClick: () => {
|
|
5494
|
-
t(),
|
|
5494
|
+
t(), Xa(n) && n();
|
|
5495
5495
|
},
|
|
5496
5496
|
children: "Logout"
|
|
5497
5497
|
}
|
|
@@ -5513,34 +5513,34 @@ var F = {
|
|
|
5513
5513
|
effects: void 0,
|
|
5514
5514
|
done: !1,
|
|
5515
5515
|
getContextId() {
|
|
5516
|
-
return
|
|
5516
|
+
return js(this.context.count);
|
|
5517
5517
|
},
|
|
5518
5518
|
getNextContextId() {
|
|
5519
|
-
return
|
|
5519
|
+
return js(this.context.count++);
|
|
5520
5520
|
}
|
|
5521
5521
|
};
|
|
5522
|
-
function
|
|
5522
|
+
function js(e) {
|
|
5523
5523
|
const t = String(e), n = t.length - 1;
|
|
5524
5524
|
return F.context.id + (n ? String.fromCharCode(96 + n) : "") + t;
|
|
5525
5525
|
}
|
|
5526
5526
|
function Rt(e) {
|
|
5527
5527
|
F.context = e;
|
|
5528
5528
|
}
|
|
5529
|
-
var oc = (e, t) => e === t, Cn = Symbol("solid-proxy"),
|
|
5529
|
+
var oc = (e, t) => e === t, Cn = Symbol("solid-proxy"), Qr = typeof Proxy == "function", Xr = Symbol("solid-track"), Pn = {
|
|
5530
5530
|
equals: oc
|
|
5531
|
-
},
|
|
5531
|
+
}, Zr = ra, st = 1, _n = 2, Jr = {
|
|
5532
5532
|
owned: null,
|
|
5533
5533
|
cleanups: null,
|
|
5534
5534
|
context: null,
|
|
5535
5535
|
owner: null
|
|
5536
|
-
},
|
|
5536
|
+
}, Hn = {}, ae = null, Kn = null, cc = null, ue = null, Le = null, Je = null, On = 0;
|
|
5537
5537
|
function ot(e, t) {
|
|
5538
|
-
const n = ue, s = ae, a = e.length === 0, i = t === void 0 ? s : t, l = a ?
|
|
5538
|
+
const n = ue, s = ae, a = e.length === 0, i = t === void 0 ? s : t, l = a ? Jr : {
|
|
5539
5539
|
owned: null,
|
|
5540
5540
|
cleanups: null,
|
|
5541
5541
|
context: i ? i.context : null,
|
|
5542
5542
|
owner: i
|
|
5543
|
-
}, o = a ? e : () => e(() => ke(() =>
|
|
5543
|
+
}, o = a ? e : () => e(() => ke(() => jt(l)));
|
|
5544
5544
|
ae = l, ue = null;
|
|
5545
5545
|
try {
|
|
5546
5546
|
return Ye(o, !0);
|
|
@@ -5555,26 +5555,26 @@ function Se(e, t) {
|
|
|
5555
5555
|
observers: null,
|
|
5556
5556
|
observerSlots: null,
|
|
5557
5557
|
comparator: t.equals || void 0
|
|
5558
|
-
}, s = (a) => (typeof a == "function" && (a = a(n.value)),
|
|
5559
|
-
return [
|
|
5558
|
+
}, s = (a) => (typeof a == "function" && (a = a(n.value)), sa(n, a));
|
|
5559
|
+
return [na.bind(n), s];
|
|
5560
5560
|
}
|
|
5561
5561
|
function uc(e, t, n) {
|
|
5562
|
-
const s = Bn(e, t, !0,
|
|
5562
|
+
const s = Bn(e, t, !0, st);
|
|
5563
5563
|
Dt(s);
|
|
5564
5564
|
}
|
|
5565
5565
|
function ct(e, t, n) {
|
|
5566
|
-
const s = Bn(e, t, !1,
|
|
5566
|
+
const s = Bn(e, t, !1, st);
|
|
5567
5567
|
Dt(s);
|
|
5568
5568
|
}
|
|
5569
|
-
function
|
|
5570
|
-
|
|
5571
|
-
const s = Bn(e, t, !1,
|
|
5569
|
+
function ea(e, t, n) {
|
|
5570
|
+
Zr = bc;
|
|
5571
|
+
const s = Bn(e, t, !1, st);
|
|
5572
5572
|
(!n || !n.render) && (s.user = !0), Je ? Je.push(s) : Dt(s);
|
|
5573
5573
|
}
|
|
5574
5574
|
function Ue(e, t, n) {
|
|
5575
5575
|
n = n ? Object.assign({}, Pn, n) : Pn;
|
|
5576
5576
|
const s = Bn(e, t, !0, 0);
|
|
5577
|
-
return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, Dt(s),
|
|
5577
|
+
return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, Dt(s), na.bind(s);
|
|
5578
5578
|
}
|
|
5579
5579
|
function dc(e) {
|
|
5580
5580
|
return e && typeof e == "object" && "then" in e;
|
|
@@ -5582,7 +5582,7 @@ function dc(e) {
|
|
|
5582
5582
|
function hc(e, t, n) {
|
|
5583
5583
|
let s, a, i;
|
|
5584
5584
|
arguments.length === 1 ? (s = !0, a = e, i = {}) : (s = e, a = t, i = {});
|
|
5585
|
-
let l = null, o =
|
|
5585
|
+
let l = null, o = Hn, c = null, d = !1, f = "initialValue" in i, h = typeof s == "function" && Ue(s);
|
|
5586
5586
|
const y = /* @__PURE__ */ new Set(), [v, p] = (i.storage || Se)(i.initialValue), [N, E] = Se(void 0), [A, U] = Se(void 0, {
|
|
5587
5587
|
equals: !1
|
|
5588
5588
|
}), [S, w] = Se(f ? "ready" : "unresolved");
|
|
@@ -5592,7 +5592,7 @@ function hc(e, t, n) {
|
|
|
5592
5592
|
() => i.onHydrated(M, {
|
|
5593
5593
|
value: O
|
|
5594
5594
|
})
|
|
5595
|
-
), o =
|
|
5595
|
+
), o = Hn, L(O, T)), O;
|
|
5596
5596
|
}
|
|
5597
5597
|
function L(D, O) {
|
|
5598
5598
|
Ye(() => {
|
|
@@ -5617,7 +5617,7 @@ function hc(e, t, n) {
|
|
|
5617
5617
|
I(l, ke(v));
|
|
5618
5618
|
return;
|
|
5619
5619
|
}
|
|
5620
|
-
const T = o !==
|
|
5620
|
+
const T = o !== Hn ? o : ke(
|
|
5621
5621
|
() => a(O, {
|
|
5622
5622
|
value: v(),
|
|
5623
5623
|
refetching: D
|
|
@@ -5693,12 +5693,12 @@ function nd(e, t, n) {
|
|
|
5693
5693
|
};
|
|
5694
5694
|
}
|
|
5695
5695
|
function mc(e) {
|
|
5696
|
-
|
|
5696
|
+
ea(() => ke(e));
|
|
5697
5697
|
}
|
|
5698
5698
|
function qt(e) {
|
|
5699
5699
|
return ae === null || (ae.cleanups === null ? ae.cleanups = [e] : ae.cleanups.push(e)), e;
|
|
5700
5700
|
}
|
|
5701
|
-
function
|
|
5701
|
+
function Hs() {
|
|
5702
5702
|
return ae;
|
|
5703
5703
|
}
|
|
5704
5704
|
function fc(e, t) {
|
|
@@ -5736,7 +5736,7 @@ function id(e) {
|
|
|
5736
5736
|
let t;
|
|
5737
5737
|
return ae && ae.context && (t = ae.context[e.id]) !== void 0 ? t : e.defaultValue;
|
|
5738
5738
|
}
|
|
5739
|
-
function
|
|
5739
|
+
function ta(e) {
|
|
5740
5740
|
const t = Ue(e), n = Ue(() => Qn(t()));
|
|
5741
5741
|
return n.toArray = () => {
|
|
5742
5742
|
const s = n();
|
|
@@ -5744,9 +5744,9 @@ function ea(e) {
|
|
|
5744
5744
|
}, n;
|
|
5745
5745
|
}
|
|
5746
5746
|
var yc;
|
|
5747
|
-
function
|
|
5747
|
+
function na() {
|
|
5748
5748
|
if (this.sources && this.state)
|
|
5749
|
-
if (this.state ===
|
|
5749
|
+
if (this.state === st)
|
|
5750
5750
|
Dt(this);
|
|
5751
5751
|
else {
|
|
5752
5752
|
const e = Le;
|
|
@@ -5758,12 +5758,12 @@ function ta() {
|
|
|
5758
5758
|
}
|
|
5759
5759
|
return this.value;
|
|
5760
5760
|
}
|
|
5761
|
-
function
|
|
5761
|
+
function sa(e, t, n) {
|
|
5762
5762
|
let s = e.value;
|
|
5763
5763
|
return (!e.comparator || !e.comparator(s, t)) && (e.value = t, e.observers && e.observers.length && Ye(() => {
|
|
5764
5764
|
for (let a = 0; a < e.observers.length; a += 1) {
|
|
5765
5765
|
const i = e.observers[a], l = Kn && Kn.running;
|
|
5766
|
-
l && Kn.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Le.push(i) : Je.push(i), i.observers &&
|
|
5766
|
+
l && Kn.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Le.push(i) : Je.push(i), i.observers && aa(i)), l || (i.state = st);
|
|
5767
5767
|
}
|
|
5768
5768
|
if (Le.length > 1e6)
|
|
5769
5769
|
throw Le = [], new Error();
|
|
@@ -5772,7 +5772,7 @@ function na(e, t, n) {
|
|
|
5772
5772
|
function Dt(e) {
|
|
5773
5773
|
if (!e.fn)
|
|
5774
5774
|
return;
|
|
5775
|
-
|
|
5775
|
+
jt(e);
|
|
5776
5776
|
const t = On;
|
|
5777
5777
|
vc(
|
|
5778
5778
|
e,
|
|
@@ -5787,13 +5787,13 @@ function vc(e, t, n) {
|
|
|
5787
5787
|
try {
|
|
5788
5788
|
s = e.fn(t);
|
|
5789
5789
|
} catch (l) {
|
|
5790
|
-
return e.pure && (e.state =
|
|
5790
|
+
return e.pure && (e.state = st, e.owned && e.owned.forEach(jt), e.owned = null), e.updatedAt = n + 1, Cs(l);
|
|
5791
5791
|
} finally {
|
|
5792
5792
|
ue = i, ae = a;
|
|
5793
5793
|
}
|
|
5794
|
-
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ?
|
|
5794
|
+
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? sa(e, s) : e.value = s, e.updatedAt = n);
|
|
5795
5795
|
}
|
|
5796
|
-
function Bn(e, t, n, s =
|
|
5796
|
+
function Bn(e, t, n, s = st, a) {
|
|
5797
5797
|
const i = {
|
|
5798
5798
|
fn: e,
|
|
5799
5799
|
state: s,
|
|
@@ -5807,7 +5807,7 @@ function Bn(e, t, n, s = nt, a) {
|
|
|
5807
5807
|
context: ae ? ae.context : null,
|
|
5808
5808
|
pure: n
|
|
5809
5809
|
};
|
|
5810
|
-
return ae === null || ae !==
|
|
5810
|
+
return ae === null || ae !== Jr && (ae.owned ? ae.owned.push(i) : ae.owned = [i]), i;
|
|
5811
5811
|
}
|
|
5812
5812
|
function In(e) {
|
|
5813
5813
|
if (e.state === 0)
|
|
@@ -5820,7 +5820,7 @@ function In(e) {
|
|
|
5820
5820
|
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < On); )
|
|
5821
5821
|
e.state && t.push(e);
|
|
5822
5822
|
for (let n = t.length - 1; n >= 0; n--)
|
|
5823
|
-
if (e = t[n], e.state ===
|
|
5823
|
+
if (e = t[n], e.state === st)
|
|
5824
5824
|
Dt(e);
|
|
5825
5825
|
else if (e.state === _n) {
|
|
5826
5826
|
const s = Le;
|
|
@@ -5840,12 +5840,12 @@ function Ye(e, t) {
|
|
|
5840
5840
|
}
|
|
5841
5841
|
}
|
|
5842
5842
|
function Ec(e) {
|
|
5843
|
-
if (Le && (
|
|
5843
|
+
if (Le && (ra(Le), Le = null), e)
|
|
5844
5844
|
return;
|
|
5845
5845
|
const t = Je;
|
|
5846
|
-
Je = null, t.length && Ye(() =>
|
|
5846
|
+
Je = null, t.length && Ye(() => Zr(t), !1);
|
|
5847
5847
|
}
|
|
5848
|
-
function
|
|
5848
|
+
function ra(e) {
|
|
5849
5849
|
for (let t = 0; t < e.length; t++)
|
|
5850
5850
|
In(e[t]);
|
|
5851
5851
|
}
|
|
@@ -5871,17 +5871,17 @@ function kn(e, t) {
|
|
|
5871
5871
|
const s = e.sources[n];
|
|
5872
5872
|
if (s.sources) {
|
|
5873
5873
|
const a = s.state;
|
|
5874
|
-
a ===
|
|
5874
|
+
a === st ? s !== t && (!s.updatedAt || s.updatedAt < On) && In(s) : a === _n && kn(s, t);
|
|
5875
5875
|
}
|
|
5876
5876
|
}
|
|
5877
5877
|
}
|
|
5878
|
-
function
|
|
5878
|
+
function aa(e) {
|
|
5879
5879
|
for (let t = 0; t < e.observers.length; t += 1) {
|
|
5880
5880
|
const n = e.observers[t];
|
|
5881
|
-
n.state || (n.state = _n, n.pure ? Le.push(n) : Je.push(n), n.observers &&
|
|
5881
|
+
n.state || (n.state = _n, n.pure ? Le.push(n) : Je.push(n), n.observers && aa(n));
|
|
5882
5882
|
}
|
|
5883
5883
|
}
|
|
5884
|
-
function
|
|
5884
|
+
function jt(e) {
|
|
5885
5885
|
let t;
|
|
5886
5886
|
if (e.sources)
|
|
5887
5887
|
for (; e.sources.length; ) {
|
|
@@ -5893,12 +5893,12 @@ function Ht(e) {
|
|
|
5893
5893
|
}
|
|
5894
5894
|
if (e.tOwned) {
|
|
5895
5895
|
for (t = e.tOwned.length - 1; t >= 0; t--)
|
|
5896
|
-
|
|
5896
|
+
jt(e.tOwned[t]);
|
|
5897
5897
|
delete e.tOwned;
|
|
5898
5898
|
}
|
|
5899
5899
|
if (e.owned) {
|
|
5900
5900
|
for (t = e.owned.length - 1; t >= 0; t--)
|
|
5901
|
-
|
|
5901
|
+
jt(e.owned[t]);
|
|
5902
5902
|
e.owned = null;
|
|
5903
5903
|
}
|
|
5904
5904
|
if (e.cleanups) {
|
|
@@ -5936,7 +5936,7 @@ function wc(e, t) {
|
|
|
5936
5936
|
() => a = ke(() => (ae.context = {
|
|
5937
5937
|
...ae.context,
|
|
5938
5938
|
[e]: s.value
|
|
5939
|
-
},
|
|
5939
|
+
}, ta(() => s.children))),
|
|
5940
5940
|
void 0
|
|
5941
5941
|
), a;
|
|
5942
5942
|
};
|
|
@@ -5950,7 +5950,7 @@ function Sc(e, t, n = {}) {
|
|
|
5950
5950
|
let s = [], a = [], i = [], l = 0, o = t.length > 1 ? [] : null;
|
|
5951
5951
|
return qt(() => Ln(i)), () => {
|
|
5952
5952
|
let c = e() || [], d = c.length, f, h;
|
|
5953
|
-
return c[
|
|
5953
|
+
return c[Xr], ke(() => {
|
|
5954
5954
|
let v, p, N, E, A, U, S, w, I;
|
|
5955
5955
|
if (d === 0)
|
|
5956
5956
|
l !== 0 && (Ln(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Xn], a[0] = ot((L) => (i[0] = L, n.fallback())), l = 1);
|
|
@@ -5986,7 +5986,7 @@ function Nc(e, t, n = {}) {
|
|
|
5986
5986
|
let s = [], a = [], i = [], l = [], o = 0, c;
|
|
5987
5987
|
return qt(() => Ln(i)), () => {
|
|
5988
5988
|
const d = e() || [], f = d.length;
|
|
5989
|
-
return d[
|
|
5989
|
+
return d[Xr], ke(() => {
|
|
5990
5990
|
if (f === 0)
|
|
5991
5991
|
return o !== 0 && (Ln(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [Xn], a[0] = ot((y) => (i[0] = y, n.fallback())), o = 1), a;
|
|
5992
5992
|
for (s[0] === Xn && (i[0](), i = [], s = [], a = [], o = 0), c = 0; c < f; c++)
|
|
@@ -6002,7 +6002,7 @@ function Nc(e, t, n = {}) {
|
|
|
6002
6002
|
}
|
|
6003
6003
|
};
|
|
6004
6004
|
}
|
|
6005
|
-
function
|
|
6005
|
+
function ia(e, t) {
|
|
6006
6006
|
return ke(() => e(t || {}));
|
|
6007
6007
|
}
|
|
6008
6008
|
function vn() {
|
|
@@ -6042,13 +6042,13 @@ function Ac() {
|
|
|
6042
6042
|
return n;
|
|
6043
6043
|
}
|
|
6044
6044
|
}
|
|
6045
|
-
function
|
|
6045
|
+
function la(...e) {
|
|
6046
6046
|
let t = !1;
|
|
6047
6047
|
for (let l = 0; l < e.length; l++) {
|
|
6048
6048
|
const o = e[l];
|
|
6049
6049
|
t = t || !!o && Cn in o, e[l] = typeof o == "function" ? (t = !0, Ue(o)) : o;
|
|
6050
6050
|
}
|
|
6051
|
-
if (
|
|
6051
|
+
if (Qr && t)
|
|
6052
6052
|
return new Proxy(
|
|
6053
6053
|
{
|
|
6054
6054
|
get(l) {
|
|
@@ -6104,7 +6104,7 @@ function ia(...e) {
|
|
|
6104
6104
|
return a;
|
|
6105
6105
|
}
|
|
6106
6106
|
function xc(e, ...t) {
|
|
6107
|
-
if (
|
|
6107
|
+
if (Qr && Cn in e) {
|
|
6108
6108
|
const a = new Set(t.length > 1 ? t.flat() : t[0]), i = t.map((l) => new Proxy(
|
|
6109
6109
|
{
|
|
6110
6110
|
get(o) {
|
|
@@ -6146,7 +6146,7 @@ function xc(e, ...t) {
|
|
|
6146
6146
|
}
|
|
6147
6147
|
return [...s, n];
|
|
6148
6148
|
}
|
|
6149
|
-
function
|
|
6149
|
+
function oa(e) {
|
|
6150
6150
|
let t, n;
|
|
6151
6151
|
const s = (a) => {
|
|
6152
6152
|
const i = F.context;
|
|
@@ -6177,7 +6177,7 @@ var Tc = 0;
|
|
|
6177
6177
|
function ld() {
|
|
6178
6178
|
return F.context ? F.getNextContextId() : `cl-${Tc++}`;
|
|
6179
6179
|
}
|
|
6180
|
-
var
|
|
6180
|
+
var ca = (e) => `Stale read from <${e}>.`;
|
|
6181
6181
|
function od(e) {
|
|
6182
6182
|
const t = "fallback" in e && {
|
|
6183
6183
|
fallback: () => e.fallback
|
|
@@ -6203,7 +6203,7 @@ function ud(e) {
|
|
|
6203
6203
|
() => a(
|
|
6204
6204
|
t ? s : () => {
|
|
6205
6205
|
if (!ke(n))
|
|
6206
|
-
throw
|
|
6206
|
+
throw ca("Show");
|
|
6207
6207
|
return e.when;
|
|
6208
6208
|
}
|
|
6209
6209
|
)
|
|
@@ -6217,7 +6217,7 @@ function ud(e) {
|
|
|
6217
6217
|
}
|
|
6218
6218
|
function dd(e) {
|
|
6219
6219
|
let t = !1;
|
|
6220
|
-
const n = (i, l) => (t ? i[1] === l[1] : !i[1] == !l[1]) && i[2] === l[2], s =
|
|
6220
|
+
const n = (i, l) => (t ? i[1] === l[1] : !i[1] == !l[1]) && i[2] === l[2], s = ta(() => e.children), a = Ue(
|
|
6221
6221
|
() => {
|
|
6222
6222
|
let i = s();
|
|
6223
6223
|
Array.isArray(i) || (i = [i]);
|
|
@@ -6243,7 +6243,7 @@ function dd(e) {
|
|
|
6243
6243
|
() => c(
|
|
6244
6244
|
t ? l : () => {
|
|
6245
6245
|
if (ke(a)[0] !== i)
|
|
6246
|
-
throw
|
|
6246
|
+
throw ca("Match");
|
|
6247
6247
|
return o.when;
|
|
6248
6248
|
}
|
|
6249
6249
|
)
|
|
@@ -6479,7 +6479,7 @@ function Rc(e, t, n) {
|
|
|
6479
6479
|
}
|
|
6480
6480
|
}
|
|
6481
6481
|
var Bt = "_$DX_DELEGATE";
|
|
6482
|
-
function
|
|
6482
|
+
function ua(e, t, n, s = {}) {
|
|
6483
6483
|
let a;
|
|
6484
6484
|
return ot((i) => {
|
|
6485
6485
|
a = i, t === document ? e() : es(t, e(), t.firstChild ? null : void 0, n);
|
|
@@ -6499,13 +6499,13 @@ function Oc(e, t = window.document) {
|
|
|
6499
6499
|
const n = t[Bt] || (t[Bt] = /* @__PURE__ */ new Set());
|
|
6500
6500
|
for (let s = 0, a = e.length; s < a; s++) {
|
|
6501
6501
|
const i = e[s];
|
|
6502
|
-
n.has(i) || (n.add(i), t.addEventListener(i,
|
|
6502
|
+
n.has(i) || (n.add(i), t.addEventListener(i, da));
|
|
6503
6503
|
}
|
|
6504
6504
|
}
|
|
6505
6505
|
function fd(e = window.document) {
|
|
6506
6506
|
if (e[Bt]) {
|
|
6507
6507
|
for (let t of e[Bt].keys())
|
|
6508
|
-
e.removeEventListener(t,
|
|
6508
|
+
e.removeEventListener(t, da);
|
|
6509
6509
|
delete e[Bt];
|
|
6510
6510
|
}
|
|
6511
6511
|
}
|
|
@@ -6530,7 +6530,7 @@ function qc(e, t, n, s) {
|
|
|
6530
6530
|
} else
|
|
6531
6531
|
e.addEventListener(t, n, typeof n != "function" && n);
|
|
6532
6532
|
}
|
|
6533
|
-
function
|
|
6533
|
+
function jc(e, t, n = {}) {
|
|
6534
6534
|
const s = Object.keys(t || {}), a = Object.keys(n);
|
|
6535
6535
|
let i, l;
|
|
6536
6536
|
for (i = 0, l = a.length; i < l; i++) {
|
|
@@ -6543,7 +6543,7 @@ function Hc(e, t, n = {}) {
|
|
|
6543
6543
|
}
|
|
6544
6544
|
return n;
|
|
6545
6545
|
}
|
|
6546
|
-
function
|
|
6546
|
+
function Hc(e, t, n) {
|
|
6547
6547
|
if (!t)
|
|
6548
6548
|
return n ? Jn(e, "style") : t;
|
|
6549
6549
|
const s = e.style;
|
|
@@ -6560,7 +6560,7 @@ function jc(e, t, n) {
|
|
|
6560
6560
|
function Kc(e, t = {}, n, s) {
|
|
6561
6561
|
const a = {};
|
|
6562
6562
|
return s || ct(
|
|
6563
|
-
() => a.children =
|
|
6563
|
+
() => a.children = Ht(e, t.children, a.children)
|
|
6564
6564
|
), ct(() => typeof t.ref == "function" && Vc(t.ref, e)), ct(() => zc(e, t, n, !0, a, !0)), a;
|
|
6565
6565
|
}
|
|
6566
6566
|
function Vc(e, t, n) {
|
|
@@ -6568,8 +6568,8 @@ function Vc(e, t, n) {
|
|
|
6568
6568
|
}
|
|
6569
6569
|
function es(e, t, n, s) {
|
|
6570
6570
|
if (n !== void 0 && !s && (s = []), typeof t != "function")
|
|
6571
|
-
return
|
|
6572
|
-
ct((a) =>
|
|
6571
|
+
return Ht(e, t, s, n);
|
|
6572
|
+
ct((a) => Ht(e, t(), a, n), s);
|
|
6573
6573
|
}
|
|
6574
6574
|
function zc(e, t, n, s, a = {}, i = !1) {
|
|
6575
6575
|
t || (t = {});
|
|
@@ -6604,9 +6604,9 @@ function Ks(e, t, n) {
|
|
|
6604
6604
|
function Vs(e, t, n, s, a, i, l) {
|
|
6605
6605
|
let o, c, d, f, h;
|
|
6606
6606
|
if (t === "style")
|
|
6607
|
-
return jc(e, n, s);
|
|
6608
|
-
if (t === "classList")
|
|
6609
6607
|
return Hc(e, n, s);
|
|
6608
|
+
if (t === "classList")
|
|
6609
|
+
return jc(e, n, s);
|
|
6610
6610
|
if (n === s)
|
|
6611
6611
|
return s;
|
|
6612
6612
|
if (t === "ref")
|
|
@@ -6640,7 +6640,7 @@ function Vs(e, t, n, s, a, i, l) {
|
|
|
6640
6640
|
}
|
|
6641
6641
|
return n;
|
|
6642
6642
|
}
|
|
6643
|
-
function
|
|
6643
|
+
function da(e) {
|
|
6644
6644
|
if (F.registry && F.events && F.events.find(([c, d]) => d === e))
|
|
6645
6645
|
return;
|
|
6646
6646
|
let t = e.target;
|
|
@@ -6679,7 +6679,7 @@ function ua(e) {
|
|
|
6679
6679
|
o();
|
|
6680
6680
|
i(s);
|
|
6681
6681
|
}
|
|
6682
|
-
function
|
|
6682
|
+
function Ht(e, t, n, s, a) {
|
|
6683
6683
|
const i = ht(e);
|
|
6684
6684
|
if (i) {
|
|
6685
6685
|
!n && (n = [...e.childNodes]);
|
|
@@ -6713,12 +6713,12 @@ function jt(e, t, n, s, a) {
|
|
|
6713
6713
|
let c = t();
|
|
6714
6714
|
for (; typeof c == "function"; )
|
|
6715
6715
|
c = c();
|
|
6716
|
-
n =
|
|
6716
|
+
n = Ht(e, c, n, s);
|
|
6717
6717
|
}), () => n;
|
|
6718
6718
|
if (Array.isArray(t)) {
|
|
6719
6719
|
const c = [], d = n && Array.isArray(n);
|
|
6720
6720
|
if (ts(c, t, n, a))
|
|
6721
|
-
return ct(() => n =
|
|
6721
|
+
return ct(() => n = Ht(e, c, n, s, !0)), () => n;
|
|
6722
6722
|
if (i) {
|
|
6723
6723
|
if (!c.length)
|
|
6724
6724
|
return n;
|
|
@@ -6803,21 +6803,21 @@ function Yc() {
|
|
|
6803
6803
|
return F.getNextContextId();
|
|
6804
6804
|
}
|
|
6805
6805
|
var Qc = "http://www.w3.org/2000/svg";
|
|
6806
|
-
function
|
|
6806
|
+
function ha(e, t = !1) {
|
|
6807
6807
|
return t ? document.createElementNS(Qc, e) : document.createElement(e);
|
|
6808
6808
|
}
|
|
6809
6809
|
function gd(e) {
|
|
6810
|
-
const { useShadow: t } = e, n = document.createTextNode(""), s = () => e.mount || document.body, a =
|
|
6810
|
+
const { useShadow: t } = e, n = document.createTextNode(""), s = () => e.mount || document.body, a = Hs();
|
|
6811
6811
|
let i, l = !!F.context;
|
|
6812
|
-
return
|
|
6812
|
+
return ea(
|
|
6813
6813
|
() => {
|
|
6814
|
-
l && (
|
|
6814
|
+
l && (Hs().user = l = !1), i || (i = fc(a, () => Ue(() => e.children)));
|
|
6815
6815
|
const o = s();
|
|
6816
6816
|
if (o instanceof HTMLHeadElement) {
|
|
6817
6817
|
const [c, d] = Se(!1), f = () => d(!0);
|
|
6818
6818
|
ot((h) => es(o, () => c() ? h() : i(), null)), qt(f);
|
|
6819
6819
|
} else {
|
|
6820
|
-
const c =
|
|
6820
|
+
const c = ha(e.isSVG ? "g" : "div", e.isSVG), d = t && c.attachShadow ? c.attachShadow({
|
|
6821
6821
|
mode: "open"
|
|
6822
6822
|
}) : c;
|
|
6823
6823
|
Object.defineProperty(c, "_$host", {
|
|
@@ -6842,7 +6842,7 @@ function pd(e) {
|
|
|
6842
6842
|
case "function":
|
|
6843
6843
|
return ke(() => a(n));
|
|
6844
6844
|
case "string":
|
|
6845
|
-
const i = Gc.has(a), l = F.context ? $c() :
|
|
6845
|
+
const i = Gc.has(a), l = F.context ? $c() : ha(a, i);
|
|
6846
6846
|
return Kc(l, n, i), l;
|
|
6847
6847
|
}
|
|
6848
6848
|
});
|
|
@@ -6863,7 +6863,7 @@ var Xc = class {
|
|
|
6863
6863
|
clear() {
|
|
6864
6864
|
this.keyToValue.clear(), this.valueToKey.clear();
|
|
6865
6865
|
}
|
|
6866
|
-
},
|
|
6866
|
+
}, ma = class {
|
|
6867
6867
|
constructor(e) {
|
|
6868
6868
|
this.generateIdentifier = e, this.kv = new Xc();
|
|
6869
6869
|
}
|
|
@@ -6879,7 +6879,7 @@ var Xc = class {
|
|
|
6879
6879
|
getValue(e) {
|
|
6880
6880
|
return this.kv.getByKey(e);
|
|
6881
6881
|
}
|
|
6882
|
-
}, Zc = class extends
|
|
6882
|
+
}, Zc = class extends ma {
|
|
6883
6883
|
constructor() {
|
|
6884
6884
|
super((e) => e.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
6885
6885
|
}
|
|
@@ -6935,7 +6935,7 @@ var tu = class {
|
|
|
6935
6935
|
findByName(e) {
|
|
6936
6936
|
return this.transfomers[e];
|
|
6937
6937
|
}
|
|
6938
|
-
}, nu = (e) => Object.prototype.toString.call(e).slice(8, -1),
|
|
6938
|
+
}, nu = (e) => Object.prototype.toString.call(e).slice(8, -1), fa = (e) => typeof e > "u", su = (e) => e === null, Kt = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, ns = (e) => Kt(e) && Object.keys(e).length === 0, rt = (e) => Array.isArray(e), ru = (e) => typeof e == "string", au = (e) => typeof e == "number" && !isNaN(e), iu = (e) => typeof e == "boolean", lu = (e) => e instanceof RegExp, Vt = (e) => e instanceof Map, zt = (e) => e instanceof Set, ga = (e) => nu(e) === "Symbol", ou = (e) => e instanceof Date && !isNaN(e.valueOf()), cu = (e) => e instanceof Error, Ws = (e) => typeof e == "number" && isNaN(e), uu = (e) => iu(e) || su(e) || fa(e) || au(e) || ru(e) || ga(e), du = (e) => typeof e == "bigint", hu = (e) => e === 1 / 0 || e === -1 / 0, mu = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), fu = (e) => e instanceof URL, pa = (e) => e.replace(/\./g, "\\."), zn = (e) => e.map(String).map(pa).join("."), Mt = (e) => {
|
|
6939
6939
|
const t = [];
|
|
6940
6940
|
let n = "";
|
|
6941
6941
|
for (let a = 0; a < e.length; a++) {
|
|
@@ -6961,8 +6961,8 @@ function We(e, t, n, s) {
|
|
|
6961
6961
|
untransform: s
|
|
6962
6962
|
};
|
|
6963
6963
|
}
|
|
6964
|
-
var
|
|
6965
|
-
We(
|
|
6964
|
+
var ya = [
|
|
6965
|
+
We(fa, "undefined", () => null, () => {
|
|
6966
6966
|
}),
|
|
6967
6967
|
We(du, "bigint", (e) => e.toString(), (e) => typeof BigInt < "u" ? BigInt(e) : e),
|
|
6968
6968
|
We(ou, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
@@ -7005,7 +7005,7 @@ function Mn(e, t, n, s) {
|
|
|
7005
7005
|
untransform: s
|
|
7006
7006
|
};
|
|
7007
7007
|
}
|
|
7008
|
-
var
|
|
7008
|
+
var va = Mn((e, t) => ga(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, n) => {
|
|
7009
7009
|
const s = n.symbolRegistry.getValue(t[1]);
|
|
7010
7010
|
if (!s)
|
|
7011
7011
|
throw new Error("Trying to deserialize unknown symbol");
|
|
@@ -7020,16 +7020,16 @@ var ya = Mn((e, t) => fa(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) =
|
|
|
7020
7020
|
Float32Array,
|
|
7021
7021
|
Float64Array,
|
|
7022
7022
|
Uint8ClampedArray
|
|
7023
|
-
].reduce((e, t) => (e[t.name] = t, e), {}),
|
|
7023
|
+
].reduce((e, t) => (e[t.name] = t, e), {}), Ea = Mn(mu, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
7024
7024
|
const n = gu[t[1]];
|
|
7025
7025
|
if (!n)
|
|
7026
7026
|
throw new Error("Trying to deserialize unknown typed array");
|
|
7027
7027
|
return new n(e);
|
|
7028
7028
|
});
|
|
7029
|
-
function
|
|
7029
|
+
function ba(e, t) {
|
|
7030
7030
|
return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
7031
7031
|
}
|
|
7032
|
-
var
|
|
7032
|
+
var wa = Mn(ba, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
7033
7033
|
const n = t.classRegistry.getAllowedProps(e.constructor);
|
|
7034
7034
|
if (!n)
|
|
7035
7035
|
return { ...e };
|
|
@@ -7042,44 +7042,44 @@ var ba = Mn(Ea, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)
|
|
|
7042
7042
|
if (!s)
|
|
7043
7043
|
throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
|
|
7044
7044
|
return Object.assign(Object.create(s.prototype), e);
|
|
7045
|
-
}),
|
|
7045
|
+
}), Sa = Mn((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, n) => {
|
|
7046
7046
|
const s = n.customTransformerRegistry.findByName(t[1]);
|
|
7047
7047
|
if (!s)
|
|
7048
7048
|
throw new Error("Trying to deserialize unknown custom value");
|
|
7049
7049
|
return s.deserialize(e);
|
|
7050
|
-
}), pu = [
|
|
7050
|
+
}), pu = [wa, va, Sa, Ea], Ys = (e, t) => {
|
|
7051
7051
|
const n = $s(pu, (a) => a.isApplicable(e, t));
|
|
7052
7052
|
if (n)
|
|
7053
7053
|
return {
|
|
7054
7054
|
value: n.transform(e, t),
|
|
7055
7055
|
type: n.annotation(e, t)
|
|
7056
7056
|
};
|
|
7057
|
-
const s = $s(
|
|
7057
|
+
const s = $s(ya, (a) => a.isApplicable(e, t));
|
|
7058
7058
|
if (s)
|
|
7059
7059
|
return {
|
|
7060
7060
|
value: s.transform(e, t),
|
|
7061
7061
|
type: s.annotation
|
|
7062
7062
|
};
|
|
7063
|
-
},
|
|
7064
|
-
|
|
7065
|
-
|
|
7063
|
+
}, Na = {};
|
|
7064
|
+
ya.forEach((e) => {
|
|
7065
|
+
Na[e.annotation] = e;
|
|
7066
7066
|
});
|
|
7067
7067
|
var yu = (e, t, n) => {
|
|
7068
|
-
if (
|
|
7068
|
+
if (rt(t))
|
|
7069
7069
|
switch (t[0]) {
|
|
7070
7070
|
case "symbol":
|
|
7071
|
-
return
|
|
7071
|
+
return va.untransform(e, t, n);
|
|
7072
7072
|
case "class":
|
|
7073
|
-
return ba.untransform(e, t, n);
|
|
7074
|
-
case "custom":
|
|
7075
7073
|
return wa.untransform(e, t, n);
|
|
7074
|
+
case "custom":
|
|
7075
|
+
return Sa.untransform(e, t, n);
|
|
7076
7076
|
case "typed-array":
|
|
7077
|
-
return
|
|
7077
|
+
return Ea.untransform(e, t, n);
|
|
7078
7078
|
default:
|
|
7079
7079
|
throw new Error("Unknown transformation: " + t);
|
|
7080
7080
|
}
|
|
7081
7081
|
else {
|
|
7082
|
-
const s =
|
|
7082
|
+
const s = Na[t];
|
|
7083
7083
|
if (!s)
|
|
7084
7084
|
throw new Error("Unknown transformation: " + t);
|
|
7085
7085
|
return s.untransform(e, n);
|
|
@@ -7090,7 +7090,7 @@ var yu = (e, t, n) => {
|
|
|
7090
7090
|
n.next(), t--;
|
|
7091
7091
|
return n.next().value;
|
|
7092
7092
|
};
|
|
7093
|
-
function
|
|
7093
|
+
function Aa(e) {
|
|
7094
7094
|
if (xn(e, "__proto__"))
|
|
7095
7095
|
throw new Error("__proto__ is not allowed as a property");
|
|
7096
7096
|
if (xn(e, "prototype"))
|
|
@@ -7099,7 +7099,7 @@ function Na(e) {
|
|
|
7099
7099
|
throw new Error("constructor is not allowed as a property");
|
|
7100
7100
|
}
|
|
7101
7101
|
var vu = (e, t) => {
|
|
7102
|
-
|
|
7102
|
+
Aa(t);
|
|
7103
7103
|
for (let n = 0; n < t.length; n++) {
|
|
7104
7104
|
const s = t[n];
|
|
7105
7105
|
if (zt(e))
|
|
@@ -7119,12 +7119,12 @@ var vu = (e, t) => {
|
|
|
7119
7119
|
}
|
|
7120
7120
|
return e;
|
|
7121
7121
|
}, ss = (e, t, n) => {
|
|
7122
|
-
if (
|
|
7122
|
+
if (Aa(t), t.length === 0)
|
|
7123
7123
|
return n(e);
|
|
7124
7124
|
let s = e;
|
|
7125
7125
|
for (let i = 0; i < t.length - 1; i++) {
|
|
7126
7126
|
const l = t[i];
|
|
7127
|
-
if (
|
|
7127
|
+
if (rt(s)) {
|
|
7128
7128
|
const o = +l;
|
|
7129
7129
|
s = s[o];
|
|
7130
7130
|
} else if (Kt(s))
|
|
@@ -7147,7 +7147,7 @@ var vu = (e, t) => {
|
|
|
7147
7147
|
}
|
|
7148
7148
|
}
|
|
7149
7149
|
const a = t[t.length - 1];
|
|
7150
|
-
if (
|
|
7150
|
+
if (rt(s) ? s[+a] = n(s[+a]) : Kt(s) && (s[a] = n(s[a])), zt(s)) {
|
|
7151
7151
|
const i = ft(s, +a), l = n(i);
|
|
7152
7152
|
i !== l && (s.delete(i), s.add(l));
|
|
7153
7153
|
}
|
|
@@ -7170,7 +7170,7 @@ var vu = (e, t) => {
|
|
|
7170
7170
|
function rs(e, t, n = []) {
|
|
7171
7171
|
if (!e)
|
|
7172
7172
|
return;
|
|
7173
|
-
if (!
|
|
7173
|
+
if (!rt(e)) {
|
|
7174
7174
|
kt(e, (i, l) => rs(i, t, [...n, ...Mt(l)]));
|
|
7175
7175
|
return;
|
|
7176
7176
|
}
|
|
@@ -7191,7 +7191,7 @@ function bu(e, t) {
|
|
|
7191
7191
|
e = ss(e, l, () => i);
|
|
7192
7192
|
});
|
|
7193
7193
|
}
|
|
7194
|
-
if (
|
|
7194
|
+
if (rt(t)) {
|
|
7195
7195
|
const [s, a] = t;
|
|
7196
7196
|
s.forEach((i) => {
|
|
7197
7197
|
e = ss(e, Mt(i), () => e);
|
|
@@ -7200,7 +7200,7 @@ function bu(e, t) {
|
|
|
7200
7200
|
kt(t, n);
|
|
7201
7201
|
return e;
|
|
7202
7202
|
}
|
|
7203
|
-
var wu = (e, t) => Kt(e) ||
|
|
7203
|
+
var wu = (e, t) => Kt(e) || rt(e) || Vt(e) || zt(e) || ba(e, t);
|
|
7204
7204
|
function Su(e, t, n) {
|
|
7205
7205
|
const s = n.get(e);
|
|
7206
7206
|
s ? s.push(t) : n.set(e, [t]);
|
|
@@ -7216,7 +7216,7 @@ function Nu(e, t) {
|
|
|
7216
7216
|
i.length === 0 ? s = l.map(zn) : n[zn(i)] = l.map(zn);
|
|
7217
7217
|
}), s ? ns(n) ? [s] : [s, n] : ns(n) ? void 0 : n;
|
|
7218
7218
|
}
|
|
7219
|
-
var
|
|
7219
|
+
var xa = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
7220
7220
|
const o = uu(e);
|
|
7221
7221
|
if (!o) {
|
|
7222
7222
|
Su(e, a, t);
|
|
@@ -7239,13 +7239,13 @@ var Aa = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
7239
7239
|
return {
|
|
7240
7240
|
transformedValue: null
|
|
7241
7241
|
};
|
|
7242
|
-
const c = Ys(e, n), d = (c == null ? void 0 : c.value) ?? e, f =
|
|
7242
|
+
const c = Ys(e, n), d = (c == null ? void 0 : c.value) ?? e, f = rt(d) ? [] : {}, h = {};
|
|
7243
7243
|
kt(d, (v, p) => {
|
|
7244
7244
|
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
7245
7245
|
throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
|
|
7246
|
-
const N =
|
|
7247
|
-
f[p] = N.transformedValue,
|
|
7248
|
-
h[
|
|
7246
|
+
const N = xa(v, t, n, s, [...a, p], [...i, e], l);
|
|
7247
|
+
f[p] = N.transformedValue, rt(N.annotations) ? h[p] = N.annotations : Kt(N.annotations) && kt(N.annotations, (E, A) => {
|
|
7248
|
+
h[pa(p) + "." + A] = E;
|
|
7249
7249
|
});
|
|
7250
7250
|
});
|
|
7251
7251
|
const y = ns(h) ? {
|
|
@@ -7257,14 +7257,14 @@ var Aa = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
7257
7257
|
};
|
|
7258
7258
|
return o || l.set(e, y), y;
|
|
7259
7259
|
};
|
|
7260
|
-
function
|
|
7260
|
+
function Ta(e) {
|
|
7261
7261
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
7262
7262
|
}
|
|
7263
7263
|
function Qs(e) {
|
|
7264
|
-
return
|
|
7264
|
+
return Ta(e) === "Array";
|
|
7265
7265
|
}
|
|
7266
7266
|
function Au(e) {
|
|
7267
|
-
if (
|
|
7267
|
+
if (Ta(e) !== "Object")
|
|
7268
7268
|
return !1;
|
|
7269
7269
|
const t = Object.getPrototypeOf(e);
|
|
7270
7270
|
return !!t && t.constructor === Object && t === Object.prototype;
|
|
@@ -7296,10 +7296,10 @@ var de = class {
|
|
|
7296
7296
|
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
7297
7297
|
*/
|
|
7298
7298
|
constructor({ dedupe: e = !1 } = {}) {
|
|
7299
|
-
this.classRegistry = new Zc(), this.symbolRegistry = new
|
|
7299
|
+
this.classRegistry = new Zc(), this.symbolRegistry = new ma((t) => t.description ?? ""), this.customTransformerRegistry = new tu(), this.allowedErrorProps = [], this.dedupe = e;
|
|
7300
7300
|
}
|
|
7301
7301
|
serialize(e) {
|
|
7302
|
-
const t = /* @__PURE__ */ new Map(), n =
|
|
7302
|
+
const t = /* @__PURE__ */ new Map(), n = xa(e, t, this, this.dedupe), s = {
|
|
7303
7303
|
json: n.transformedValue
|
|
7304
7304
|
};
|
|
7305
7305
|
n.annotations && (s.meta = {
|
|
@@ -7376,13 +7376,13 @@ var Nd = (e, t = !1) => {
|
|
|
7376
7376
|
json: n
|
|
7377
7377
|
} = Tu(e);
|
|
7378
7378
|
return JSON.stringify(n, null, t ? 2 : void 0);
|
|
7379
|
-
}, En = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Cu = (e, t) => e.queryHash.localeCompare(t.queryHash),
|
|
7379
|
+
}, En = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Cu = (e, t) => e.queryHash.localeCompare(t.queryHash), Ca = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Pu = (e, t) => En(e) === En(t) ? Ca(e, t) : En(e) > En(t) ? 1 : -1, Ad = {
|
|
7380
7380
|
status: Pu,
|
|
7381
7381
|
"query hash": Cu,
|
|
7382
|
-
"last updated": Ta
|
|
7383
|
-
}, bn = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, Ca = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, _u = (e, t) => bn(e) === bn(t) ? Ca(e, t) : bn(e) > bn(t) ? 1 : -1, xd = {
|
|
7384
|
-
status: _u,
|
|
7385
7382
|
"last updated": Ca
|
|
7383
|
+
}, bn = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, Pa = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, _u = (e, t) => bn(e) === bn(t) ? Pa(e, t) : bn(e) > bn(t) ? 1 : -1, xd = {
|
|
7384
|
+
status: _u,
|
|
7385
|
+
"last updated": Pa
|
|
7386
7386
|
}, Td = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), Cd = () => {
|
|
7387
7387
|
const [e, t] = Se("dark");
|
|
7388
7388
|
return mc(() => {
|
|
@@ -7453,7 +7453,7 @@ var Nd = (e, t = !1) => {
|
|
|
7453
7453
|
return n[s] = Sn(n[s], a), n;
|
|
7454
7454
|
}
|
|
7455
7455
|
return e;
|
|
7456
|
-
},
|
|
7456
|
+
}, _a = (e, t) => {
|
|
7457
7457
|
if (!e || document.querySelector("#_goober") || (t == null ? void 0 : t.querySelector("#_goober")))
|
|
7458
7458
|
return;
|
|
7459
7459
|
const s = document.createElement("style"), a = document.createTextNode("");
|
|
@@ -7505,10 +7505,10 @@ var Nd = (e, t = !1) => {
|
|
|
7505
7505
|
mount(e) {
|
|
7506
7506
|
if (B(this, it))
|
|
7507
7507
|
throw new Error("Devtools is already mounted");
|
|
7508
|
-
const t =
|
|
7508
|
+
const t = ua(() => {
|
|
7509
7509
|
const n = this, [s] = B(this, yt), [a] = B(this, vt), [i] = B(this, Et), [l] = B(this, bt), [o] = B(this, gt);
|
|
7510
7510
|
let c;
|
|
7511
|
-
return B(this, wt) ? c = B(this, wt) : (c =
|
|
7511
|
+
return B(this, wt) ? c = B(this, wt) : (c = oa(() => import("./HO4MOOFI-DlO9_sj0.js")), ie(this, wt, c)), _a(B(this, Qt), B(this, pt)), ia(c, la({
|
|
7512
7512
|
get queryFlavor() {
|
|
7513
7513
|
return B(n, Wt);
|
|
7514
7514
|
},
|
|
@@ -7599,10 +7599,10 @@ var Nd = (e, t = !1) => {
|
|
|
7599
7599
|
mount(e) {
|
|
7600
7600
|
if (B(this, lt))
|
|
7601
7601
|
throw new Error("Devtools is already mounted");
|
|
7602
|
-
const t =
|
|
7602
|
+
const t = ua(() => {
|
|
7603
7603
|
const n = this, [s] = B(this, At), [a] = B(this, xt), [i] = B(this, Tt), [l] = B(this, Ct), [o] = B(this, St), [c] = B(this, Pt);
|
|
7604
7604
|
let d;
|
|
7605
|
-
return B(this, _t) ? d = B(this, _t) : (d =
|
|
7605
|
+
return B(this, _t) ? d = B(this, _t) : (d = oa(() => import("./HUY7CZI3-DGBcR9kM.js")), ie(this, _t, d)), _a(B(this, tn), B(this, Nt)), ia(d, la({
|
|
7606
7606
|
get queryFlavor() {
|
|
7607
7607
|
return B(n, Jt);
|
|
7608
7608
|
},
|
|
@@ -7646,7 +7646,7 @@ var Nd = (e, t = !1) => {
|
|
|
7646
7646
|
}
|
|
7647
7647
|
}, St = new WeakMap(), Zt = new WeakMap(), Jt = new WeakMap(), en = new WeakMap(), lt = new WeakMap(), tn = new WeakMap(), Nt = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Pt = new WeakMap(), _t = new WeakMap(), nn = new WeakMap(), Zs);
|
|
7648
7648
|
function Lu(e) {
|
|
7649
|
-
const t =
|
|
7649
|
+
const t = Te(e.client), n = ge.useRef(null), {
|
|
7650
7650
|
buttonPosition: s,
|
|
7651
7651
|
position: a,
|
|
7652
7652
|
initialIsOpen: i,
|
|
@@ -7682,7 +7682,7 @@ function Lu(e) {
|
|
|
7682
7682
|
}), [d]), /* @__PURE__ */ r("div", { className: "tsqd-parent-container", ref: n });
|
|
7683
7683
|
}
|
|
7684
7684
|
function Du(e) {
|
|
7685
|
-
const t =
|
|
7685
|
+
const t = Te(e.client), n = ge.useRef(null), { errorTypes: s, styleNonce: a, shadowDOMTarget: i } = e, [l] = ge.useState(
|
|
7686
7686
|
new ku({
|
|
7687
7687
|
client: t,
|
|
7688
7688
|
queryFlavor: "React Query",
|
|
@@ -7719,14 +7719,14 @@ var Gu = process.env.NODE_ENV !== "development" ? function() {
|
|
|
7719
7719
|
return null;
|
|
7720
7720
|
} : Lu;
|
|
7721
7721
|
process.env.NODE_ENV;
|
|
7722
|
-
const Uu =
|
|
7723
|
-
() => import("./digital-asset-manager-
|
|
7722
|
+
const Uu = ei(
|
|
7723
|
+
() => import("./digital-asset-manager-pEAK8sn7.js")
|
|
7724
7724
|
);
|
|
7725
|
-
|
|
7725
|
+
fl();
|
|
7726
7726
|
rc();
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7727
|
+
mi(qo);
|
|
7728
|
+
fi(Uu);
|
|
7729
|
+
gi(ql);
|
|
7730
7730
|
$n("user-info", lc);
|
|
7731
7731
|
const Ru = (e) => {
|
|
7732
7732
|
const t = ut([]), [n] = Re(), s = n.get("page"), a = n.get("lang"), { data: i } = Oe(), {
|
|
@@ -7734,10 +7734,10 @@ const Ru = (e) => {
|
|
|
7734
7734
|
role: "",
|
|
7735
7735
|
permissions: null
|
|
7736
7736
|
}
|
|
7737
|
-
} = zo(), { data: o } = Vo(), { data: c, isFetching: d } =
|
|
7737
|
+
} = zo(), { data: o } = Vo(), { data: c, isFetching: d } = Fr(), { blocks: f } = Ko(c), { data: h } = un(), { data: y } = De(), { mutateAsync: v } = Or(), p = jo(), { getUILibraryBlock: N, getUILibraryBlocks: E, onSave: A } = $o(), { getPartialBlocks: U, getPartialBlockBlocks: S } = Wo(), { aiContext: w, setAiContext: I } = ws(), { mutateAsync: L } = Kl(), [oe, te] = P(!1), D = $(
|
|
7738
7738
|
() => (h == null ? void 0 : h.fallbackLang) || "en",
|
|
7739
7739
|
[h]
|
|
7740
|
-
), { data: O } =
|
|
7740
|
+
), { data: O } = qr({
|
|
7741
7741
|
pageType: i == null ? void 0 : i.pageType,
|
|
7742
7742
|
lang: a || D
|
|
7743
7743
|
});
|
|
@@ -7747,20 +7747,20 @@ const Ru = (e) => {
|
|
|
7747
7747
|
};
|
|
7748
7748
|
return window.addEventListener("visibilitychange", Z), () => window.removeEventListener("visibilitychange", Z);
|
|
7749
7749
|
}, []), t.current = f;
|
|
7750
|
-
const T =
|
|
7750
|
+
const T = $(() => {
|
|
7751
7751
|
const Z = {};
|
|
7752
7752
|
return l && (Z.permissions = le(l, "permissions", null), Z.role = le(l, "role", "user")), Z;
|
|
7753
|
-
}, [l]), M =
|
|
7753
|
+
}, [l]), M = $(() => o, [o]), ne = xe(
|
|
7754
7754
|
async (Z, fe) => await L({ pageType: Z, query: fe }),
|
|
7755
7755
|
[L]
|
|
7756
|
-
), me =
|
|
7756
|
+
), me = $(
|
|
7757
7757
|
() => le(h, "theme", {}) || {},
|
|
7758
7758
|
[h]
|
|
7759
7759
|
);
|
|
7760
7760
|
return /* @__PURE__ */ u(Ne, { children: [
|
|
7761
7761
|
d && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-50 flex items-center justify-center w-screen h-screen bg-white/30", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center bg-white rounded-full size-10", children: /* @__PURE__ */ r(Gr, { className: "size-5 animate-spin" }) }) }),
|
|
7762
7762
|
/* @__PURE__ */ r(
|
|
7763
|
-
|
|
7763
|
+
pi,
|
|
7764
7764
|
{
|
|
7765
7765
|
pageExternalData: O,
|
|
7766
7766
|
themePresets: e.themePresets ?? [],
|
|
@@ -7778,7 +7778,7 @@ const Ru = (e) => {
|
|
|
7778
7778
|
getPartialBlockBlocks: S,
|
|
7779
7779
|
getPartialBlocks: U,
|
|
7780
7780
|
blocks: d ? [] : f,
|
|
7781
|
-
theme:
|
|
7781
|
+
theme: Za(me),
|
|
7782
7782
|
getUILibraryBlock: N,
|
|
7783
7783
|
getUILibraryBlocks: E,
|
|
7784
7784
|
uiLibraries: M,
|
|
@@ -7812,7 +7812,7 @@ const Ru = (e) => {
|
|
|
7812
7812
|
/* @__PURE__ */ r(kl, {})
|
|
7813
7813
|
] })
|
|
7814
7814
|
] });
|
|
7815
|
-
}, Ou = new
|
|
7815
|
+
}, Ou = new ti({
|
|
7816
7816
|
defaultOptions: {
|
|
7817
7817
|
queries: {
|
|
7818
7818
|
refetchOnWindowFocus: !1,
|
|
@@ -7820,7 +7820,7 @@ const Ru = (e) => {
|
|
|
7820
7820
|
}
|
|
7821
7821
|
}
|
|
7822
7822
|
}), Pd = (e) => {
|
|
7823
|
-
const { isLoggedIn: t } =
|
|
7823
|
+
const { isLoggedIn: t } = tt(), [, n] = Br(), [s, a] = P(!1);
|
|
7824
7824
|
return Ae(() => (n(
|
|
7825
7825
|
tr(e, [
|
|
7826
7826
|
"apiUrl",
|
|
@@ -7834,15 +7834,50 @@ const Ru = (e) => {
|
|
|
7834
7834
|
a(!0);
|
|
7835
7835
|
}, 200), () => {
|
|
7836
7836
|
a(!1), n({});
|
|
7837
|
-
}), [e, n]), s ? /* @__PURE__ */ u(
|
|
7837
|
+
}), [e, n]), s ? /* @__PURE__ */ u(ni, { client: Ou, children: [
|
|
7838
7838
|
t ? /* @__PURE__ */ r(Ru, { ...e }) : /* @__PURE__ */ r(Xo, {}),
|
|
7839
7839
|
/* @__PURE__ */ r(Gu, {})
|
|
7840
7840
|
] }) : /* @__PURE__ */ r("div", {});
|
|
7841
|
+
}, _d = () => {
|
|
7842
|
+
const { user: e } = tt(), t = $(
|
|
7843
|
+
() => e == null ? void 0 : e.accessToken,
|
|
7844
|
+
[e == null ? void 0 : e.accessToken]
|
|
7845
|
+
), { refetch: n } = Ur();
|
|
7846
|
+
return xe(
|
|
7847
|
+
async ({
|
|
7848
|
+
url: s,
|
|
7849
|
+
method: a = "GET",
|
|
7850
|
+
body: i = {},
|
|
7851
|
+
headers: l = {}
|
|
7852
|
+
}) => {
|
|
7853
|
+
if (t) {
|
|
7854
|
+
if (!s)
|
|
7855
|
+
throw new Error("URL is required");
|
|
7856
|
+
try {
|
|
7857
|
+
const o = await fetch(s, {
|
|
7858
|
+
method: a,
|
|
7859
|
+
headers: {
|
|
7860
|
+
"Content-Type": "application/json",
|
|
7861
|
+
Authorization: `Bearer ${t}`,
|
|
7862
|
+
...l
|
|
7863
|
+
},
|
|
7864
|
+
body: JSON.stringify(i)
|
|
7865
|
+
});
|
|
7866
|
+
if (o.status === 401 && await n(), o.status === 400)
|
|
7867
|
+
throw new Error((await o.json()).error);
|
|
7868
|
+
return await o.json();
|
|
7869
|
+
} catch (o) {
|
|
7870
|
+
throw console.log("Something went wrong", o), o;
|
|
7871
|
+
}
|
|
7872
|
+
}
|
|
7873
|
+
},
|
|
7874
|
+
[t, n]
|
|
7875
|
+
);
|
|
7841
7876
|
};
|
|
7842
7877
|
if (typeof window > "u")
|
|
7843
7878
|
throw new Error("@chaibuilder/pages is not available on the server");
|
|
7844
7879
|
export {
|
|
7845
|
-
|
|
7880
|
+
Xr as $,
|
|
7846
7881
|
Nd as A,
|
|
7847
7882
|
td as B,
|
|
7848
7883
|
fd as C,
|
|
@@ -7868,24 +7903,25 @@ export {
|
|
|
7868
7903
|
Ju as W,
|
|
7869
7904
|
X,
|
|
7870
7905
|
_ as Y,
|
|
7871
|
-
|
|
7906
|
+
W as Z,
|
|
7872
7907
|
Pd as _,
|
|
7873
|
-
|
|
7908
|
+
ia as a,
|
|
7874
7909
|
Be as a0,
|
|
7875
7910
|
ed as a1,
|
|
7876
7911
|
Oe as a2,
|
|
7877
7912
|
cn as a3,
|
|
7878
7913
|
Rn as a4,
|
|
7879
7914
|
un as a5,
|
|
7880
|
-
|
|
7915
|
+
tt as a6,
|
|
7881
7916
|
zo as a7,
|
|
7882
|
-
|
|
7883
|
-
|
|
7917
|
+
_d as a8,
|
|
7918
|
+
Zu as a9,
|
|
7919
|
+
dn as aa,
|
|
7884
7920
|
Se as b,
|
|
7885
7921
|
Ue as c,
|
|
7886
7922
|
Oc as d,
|
|
7887
|
-
|
|
7888
|
-
|
|
7923
|
+
ea as e,
|
|
7924
|
+
la as f,
|
|
7889
7925
|
Cd as g,
|
|
7890
7926
|
xc as h,
|
|
7891
7927
|
ad as i,
|