@chaibuilder/pages 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,19 +2,19 @@ var bs = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
4
  var Ns = (e, t, n) => t.has(e) || bs("Cannot " + n);
5
- var O = (e, t, n) => (Ns(e, t, "read from private field"), n ? n.call(e) : t.get(e)), J = (e, t, n) => t.has(e) ? bs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Y = (e, t, n, s) => (Ns(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
5
+ var U = (e, t, n) => (Ns(e, t, "read from private field"), n ? n.call(e) : t.get(e)), ee = (e, t, n) => t.has(e) ? bs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Y = (e, t, n, s) => (Ns(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
6
6
  import { jsx as a, jsxs as c, Fragment as ge } from "react/jsx-runtime";
7
7
  import { useLibraryBlocks as Sa, getBlocksFromHTML as wa, useLanguages as ot, useBlocksStore as $s, useTheme as ba, PERMISSIONS as Na, usePermissions as xn, mergeClasses as Aa, useSavePage as js, useRightPanel as xa, useTranslation as Ta, ChaiBuilderEditor as Ca } from "@chaibuilder/sdk";
8
8
  import { loadWebBlocks as Pa } from "@chaibuilder/sdk/web-blocks";
9
9
  import { useQueryClient as Ae, onlineManager as Ks, useQuery as xe, useMutation as De, QueryClient as _a, QueryClientProvider as Ia } from "@tanstack/react-query";
10
10
  import * as oe from "react";
11
11
  import zs, { useCallback as _e, useMemo as ae, useState as M, useEffect as Ie, useRef as yn } from "react";
12
- import { get as ne, isEmpty as ue, find as me, filter as Ee, includes as Gt, has as Tn, pick as Ws, keys as La, pickBy as ka, endsWith as Qs, isArray as Da, startCase as ns, reverse as Ga, sortBy as Ua, each as Oa, map as ke, cloneDeep as Ys, startsWith as Lt, isEqual as ss, toLower as _t, trim as Ra, compact as Xs, concat as Zs, orderBy as rn, first as Ma, uniq as Ba, debounce as Fa, set as Ha, omit as Va, isString as As } from "lodash-es";
12
+ import { get as J, isEmpty as ue, find as me, filter as Ee, includes as Gt, has as Tn, pick as Ws, keys as La, pickBy as ka, endsWith as Qs, isArray as Da, startCase as ns, reverse as Ga, sortBy as Oa, each as Ua, map as ke, cloneDeep as Ys, startsWith as Lt, isEqual as ss, toLower as _t, trim as Ra, compact as Xs, concat as Zs, orderBy as rn, first as Ma, uniq as Ba, debounce as Fa, set as Ha, omit as Va, isString as As } from "lodash-es";
13
13
  import { LockIcon as Js, UserIcon as qa, AlertTriangleIcon as $a, SquareLibrary as er, AlertCircle as ja, StarIcon as Ka, MoreHorizontal as rs, PencilIcon as za, Power as tr, TrashIcon as Wa, Search as Qa, File as Cn, Plus as nr, StarsIcon as Ya, Globe as Xa, Pencil as Za, Trash as as, Logs as Ja, Loader as sr, Languages as ei, ChevronDown as rr, Star as ti, History as xs, ArrowUpRight as ni, Clock as si, Undo2 as ar, CloudOff as ri, Edit as ai, Save as ir, GlobeIcon as ii, Eye as li, Palette as oi, CheckCircle as ci, Send as Ts, Rocket as Cs, Settings as ui, ExternalLink as di, LanguagesIcon as hi, DatabaseIcon as fi, ChevronLeft as mi, ChevronRight as gi, Loader2 as pi } from "lucide-react";
14
14
  import { atom as is, useAtom as ls } from "jotai";
15
15
  import { toast as le } from "sonner";
16
16
  import { useRegisteredChaiBlocks as yi, getDefaultBlockProps as Ei } from "@chaibuilder/runtime";
17
- import { Card as lr, CardHeader as or, CardTitle as cr, CardContent as ur, CardFooter as dr, Button as H, AlertDialog as vi, AlertDialogTrigger as Si, AlertDialogContent as wi, AlertDialogHeader as bi, AlertDialogTitle as Ni, AlertDialogDescription as Ai, AlertDialogFooter as xi, AlertDialogCancel as Ti, AlertDialogAction as Ci, DropdownMenuItem as Pe, Dialog as $e, DialogContent as je, DialogHeader as Ke, DialogTitle as ze, DialogDescription as Ze, Tabs as Pi, TabsList as _i, TabsTrigger as Ps, Label as re, Select as Bn, SelectTrigger as Fn, SelectValue as Hn, SelectContent as Vn, SelectItem as qn, Input as we, DialogFooter as tt, Alert as hr, DropdownMenu as Xt, DropdownMenuTrigger as Zt, DropdownMenuContent as Jt, Badge as _s, Sheet as fr, SheetContent as mr, SheetHeader as gr, SheetTitle as pr, Separator as Ii, TooltipProvider as yr, Tooltip as os, TooltipTrigger as cs, TooltipContent as us, SheetTrigger as Li, ScrollArea as ki, Skeleton as an, DropdownMenuSeparator as Di, Popover as Gi, PopoverTrigger as Ui, PopoverContent as Oi, Command as Ri, CommandInput as Mi, CommandList as Bi, CommandEmpty as Fi, CommandGroup as Hi, CommandItem as Is, AlertDescription as Vi, Accordion as qi, AccordionItem as ln, AccordionTrigger as on, AccordionContent as cn, Textarea as un } from "@chaibuilder/sdk/ui";
17
+ import { Card as lr, CardHeader as or, CardTitle as cr, CardContent as ur, CardFooter as dr, Button as H, AlertDialog as vi, AlertDialogTrigger as Si, AlertDialogContent as wi, AlertDialogHeader as bi, AlertDialogTitle as Ni, AlertDialogDescription as Ai, AlertDialogFooter as xi, AlertDialogCancel as Ti, AlertDialogAction as Ci, DropdownMenuItem as Pe, Dialog as $e, DialogContent as je, DialogHeader as Ke, DialogTitle as ze, DialogDescription as Ze, Tabs as Pi, TabsList as _i, TabsTrigger as Ps, Label as re, Select as Bn, SelectTrigger as Fn, SelectValue as Hn, SelectContent as Vn, SelectItem as qn, Input as we, DialogFooter as tt, Alert as hr, DropdownMenu as Xt, DropdownMenuTrigger as Zt, DropdownMenuContent as Jt, Badge as _s, Sheet as fr, SheetContent as mr, SheetHeader as gr, SheetTitle as pr, Separator as Ii, TooltipProvider as yr, Tooltip as os, TooltipTrigger as cs, TooltipContent as us, SheetTrigger as Li, ScrollArea as ki, Skeleton as an, DropdownMenuSeparator as Di, Popover as Gi, PopoverTrigger as Oi, PopoverContent as Ui, Command as Ri, CommandInput as Mi, CommandList as Bi, CommandEmpty as Fi, CommandGroup as Hi, CommandItem as Is, AlertDescription as Vi, Accordion as qi, AccordionItem as ln, AccordionTrigger as on, AccordionContent as cn, Textarea as un } from "@chaibuilder/sdk/ui";
18
18
  import { format as Pn, formatDistanceToNow as $i } from "date-fns";
19
19
  var R = {
20
20
  context: void 0,
@@ -42,19 +42,19 @@ var ji = (e, t) => e === t, En = Symbol("solid-proxy"), Er = typeof Proxy == "fu
42
42
  cleanups: null,
43
43
  context: null,
44
44
  owner: null
45
- }, Gn = {}, Q = null, Un = null, Ki = null, ee = null, be = null, Xe = null, _n = 0;
45
+ }, Gn = {}, Q = null, On = null, Ki = null, te = null, be = null, Xe = null, _n = 0;
46
46
  function it(e, t) {
47
- const n = ee, s = Q, r = e.length === 0, i = t === void 0 ? s : t, l = r ? wr : {
47
+ const n = te, s = Q, r = e.length === 0, i = t === void 0 ? s : t, l = r ? wr : {
48
48
  owned: null,
49
49
  cleanups: null,
50
50
  context: i ? i.context : null,
51
51
  owner: i
52
- }, o = r ? e : () => e(() => ve(() => Ot(l)));
53
- Q = l, ee = null;
52
+ }, o = r ? e : () => e(() => ve(() => Ut(l)));
53
+ Q = l, te = null;
54
54
  try {
55
55
  return qe(o, !0);
56
56
  } finally {
57
- ee = n, Q = s;
57
+ te = n, Q = s;
58
58
  }
59
59
  }
60
60
  function fe(e, t) {
@@ -115,7 +115,7 @@ function Qi(e, t, n) {
115
115
  const N = el, k = E(), V = b();
116
116
  if (V !== void 0 && !l)
117
117
  throw V;
118
- return ee && ee.user, k;
118
+ return te && te.user, k;
119
119
  }
120
120
  function L(N = !0) {
121
121
  if (N !== !1 && d)
@@ -174,14 +174,14 @@ function zc(e) {
174
174
  return qe(e, !1);
175
175
  }
176
176
  function ve(e) {
177
- if (ee === null)
177
+ if (te === null)
178
178
  return e();
179
- const t = ee;
180
- ee = null;
179
+ const t = te;
180
+ te = null;
181
181
  try {
182
182
  return e();
183
183
  } finally {
184
- ee = t;
184
+ te = t;
185
185
  }
186
186
  }
187
187
  function Wc(e, t, n) {
@@ -204,29 +204,29 @@ function Wc(e, t, n) {
204
204
  function Yi(e) {
205
205
  br(() => ve(e));
206
206
  }
207
- function Ut(e) {
207
+ function Ot(e) {
208
208
  return Q === null || (Q.cleanups === null ? Q.cleanups = [e] : Q.cleanups.push(e)), e;
209
209
  }
210
210
  function ks() {
211
211
  return Q;
212
212
  }
213
213
  function Xi(e, t) {
214
- const n = Q, s = ee;
215
- Q = e, ee = null;
214
+ const n = Q, s = te;
215
+ Q = e, te = null;
216
216
  try {
217
217
  return qe(t, !0);
218
218
  } catch (r) {
219
219
  ds(r);
220
220
  } finally {
221
- Q = n, ee = s;
221
+ Q = n, te = s;
222
222
  }
223
223
  }
224
224
  function Zi(e) {
225
- const t = ee, n = Q;
225
+ const t = te, n = Q;
226
226
  return Promise.resolve().then(() => {
227
- ee = t, Q = n;
227
+ te = t, Q = n;
228
228
  let s;
229
- return qe(e, !1), ee = Q = null, s ? s.done : void 0;
229
+ return qe(e, !1), te = Q = null, s ? s.done : void 0;
230
230
  });
231
231
  }
232
232
  var [Ji, Qc] = /* @__PURE__ */ fe(!1);
@@ -261,9 +261,9 @@ function Ar() {
261
261
  const e = be;
262
262
  be = null, qe(() => bn(this), !1), be = e;
263
263
  }
264
- if (ee) {
264
+ if (te) {
265
265
  const e = this.observers ? this.observers.length : 0;
266
- ee.sources ? (ee.sources.push(this), ee.sourceSlots.push(e)) : (ee.sources = [this], ee.sourceSlots = [e]), this.observers ? (this.observers.push(ee), this.observerSlots.push(ee.sources.length - 1)) : (this.observers = [ee], this.observerSlots = [ee.sources.length - 1]);
266
+ te.sources ? (te.sources.push(this), te.sourceSlots.push(e)) : (te.sources = [this], te.sourceSlots = [e]), this.observers ? (this.observers.push(te), this.observerSlots.push(te.sources.length - 1)) : (this.observers = [te], this.observerSlots = [te.sources.length - 1]);
267
267
  }
268
268
  return this.value;
269
269
  }
@@ -271,8 +271,8 @@ function xr(e, t, n) {
271
271
  let s = e.value;
272
272
  return (!e.comparator || !e.comparator(s, t)) && (e.value = t, e.observers && e.observers.length && qe(() => {
273
273
  for (let r = 0; r < e.observers.length; r += 1) {
274
- const i = e.observers[r], l = Un && Un.running;
275
- l && Un.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? be.push(i) : Xe.push(i), i.observers && Cr(i)), l || (i.state = Je);
274
+ const i = e.observers[r], l = On && On.running;
275
+ l && On.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? be.push(i) : Xe.push(i), i.observers && Cr(i)), l || (i.state = Je);
276
276
  }
277
277
  if (be.length > 1e6)
278
278
  throw be = [], new Error();
@@ -281,7 +281,7 @@ function xr(e, t, n) {
281
281
  function Pt(e) {
282
282
  if (!e.fn)
283
283
  return;
284
- Ot(e);
284
+ Ut(e);
285
285
  const t = _n;
286
286
  tl(
287
287
  e,
@@ -291,14 +291,14 @@ function Pt(e) {
291
291
  }
292
292
  function tl(e, t, n) {
293
293
  let s;
294
- const r = Q, i = ee;
295
- ee = Q = e;
294
+ const r = Q, i = te;
295
+ te = Q = e;
296
296
  try {
297
297
  s = e.fn(t);
298
298
  } catch (l) {
299
- return e.pure && (e.state = Je, e.owned && e.owned.forEach(Ot), e.owned = null), e.updatedAt = n + 1, ds(l);
299
+ return e.pure && (e.state = Je, e.owned && e.owned.forEach(Ut), e.owned = null), e.updatedAt = n + 1, ds(l);
300
300
  } finally {
301
- ee = i, Q = r;
301
+ te = i, Q = r;
302
302
  }
303
303
  (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? xr(e, s) : e.value = s, e.updatedAt = n);
304
304
  }
@@ -390,7 +390,7 @@ function Cr(e) {
390
390
  n.state || (n.state = Sn, n.pure ? be.push(n) : Xe.push(n), n.observers && Cr(n));
391
391
  }
392
392
  }
393
- function Ot(e) {
393
+ function Ut(e) {
394
394
  let t;
395
395
  if (e.sources)
396
396
  for (; e.sources.length; ) {
@@ -402,12 +402,12 @@ function Ot(e) {
402
402
  }
403
403
  if (e.tOwned) {
404
404
  for (t = e.tOwned.length - 1; t >= 0; t--)
405
- Ot(e.tOwned[t]);
405
+ Ut(e.tOwned[t]);
406
406
  delete e.tOwned;
407
407
  }
408
408
  if (e.owned) {
409
409
  for (t = e.owned.length - 1; t >= 0; t--)
410
- Ot(e.owned[t]);
410
+ Ut(e.owned[t]);
411
411
  e.owned = null;
412
412
  }
413
413
  if (e.cleanups) {
@@ -457,7 +457,7 @@ function Nn(e) {
457
457
  }
458
458
  function al(e, t, n = {}) {
459
459
  let s = [], r = [], i = [], l = 0, o = t.length > 1 ? [] : null;
460
- return Ut(() => Nn(i)), () => {
460
+ return Ot(() => Nn(i)), () => {
461
461
  let u = e() || [], d = u.length, f, m;
462
462
  return u[vr], ve(() => {
463
463
  let E, p, b, S, I, A, x, v, C;
@@ -493,7 +493,7 @@ function al(e, t, n = {}) {
493
493
  }
494
494
  function il(e, t, n = {}) {
495
495
  let s = [], r = [], i = [], l = [], o = 0, u;
496
- return Ut(() => Nn(i)), () => {
496
+ return Ot(() => Nn(i)), () => {
497
497
  const d = e() || [], f = d.length;
498
498
  return d[vr], ve(() => {
499
499
  if (f === 0)
@@ -541,7 +541,7 @@ var zn = {
541
541
  return e.keys();
542
542
  }
543
543
  };
544
- function On(e) {
544
+ function Un(e) {
545
545
  return (e = typeof e == "function" ? e() : e) ? e : {};
546
546
  }
547
547
  function ll() {
@@ -562,21 +562,21 @@ function _r(...e) {
562
562
  {
563
563
  get(l) {
564
564
  for (let o = e.length - 1; o >= 0; o--) {
565
- const u = On(e[o])[l];
565
+ const u = Un(e[o])[l];
566
566
  if (u !== void 0)
567
567
  return u;
568
568
  }
569
569
  },
570
570
  has(l) {
571
571
  for (let o = e.length - 1; o >= 0; o--)
572
- if (l in On(e[o]))
572
+ if (l in Un(e[o]))
573
573
  return !0;
574
574
  return !1;
575
575
  },
576
576
  keys() {
577
577
  const l = [];
578
578
  for (let o = 0; o < e.length; o++)
579
- l.push(...Object.keys(On(e[o])));
579
+ l.push(...Object.keys(Un(e[o])));
580
580
  return [...new Set(l)];
581
581
  }
582
582
  },
@@ -1244,7 +1244,7 @@ function Rt(e, t, n, s, r) {
1244
1244
  if (u.length === 0) {
1245
1245
  if (n = ut(e, n, s), o)
1246
1246
  return n;
1247
- } else d ? n.length === 0 ? Us(e, u, s) : vl(e, n, u) : (n && ut(e), Us(e, u));
1247
+ } else d ? n.length === 0 ? Os(e, u, s) : vl(e, n, u) : (n && ut(e), Os(e, u));
1248
1248
  n = u;
1249
1249
  } else if (t.nodeType) {
1250
1250
  if (i && t.parentNode)
@@ -1286,7 +1286,7 @@ function Yn(e, t, n, s) {
1286
1286
  }
1287
1287
  return r;
1288
1288
  }
1289
- function Us(e, t, n = null) {
1289
+ function Os(e, t, n = null) {
1290
1290
  for (let s = 0, r = t.length; s < r; s++)
1291
1291
  e.insertBefore(t[s], n);
1292
1292
  }
@@ -1324,7 +1324,7 @@ function lu(e) {
1324
1324
  const o = s();
1325
1325
  if (o instanceof HTMLHeadElement) {
1326
1326
  const [u, d] = fe(!1), f = () => d(!0);
1327
- it((m) => Qn(o, () => u() ? m() : i(), null)), Ut(f);
1327
+ it((m) => Qn(o, () => u() ? m() : i(), null)), Ot(f);
1328
1328
  } else {
1329
1329
  const u = Gr(e.isSVG ? "g" : "div", e.isSVG), d = t && u.attachShadow ? u.attachShadow({
1330
1330
  mode: "open"
@@ -1334,7 +1334,7 @@ function lu(e) {
1334
1334
  return n.parentNode;
1335
1335
  },
1336
1336
  configurable: !0
1337
- }), Qn(d, i), o.appendChild(u), e.ref && e.ref(u), Ut(() => o.removeChild(u));
1337
+ }), Qn(d, i), o.appendChild(u), e.ref && e.ref(u), Ot(() => o.removeChild(u));
1338
1338
  }
1339
1339
  },
1340
1340
  void 0,
@@ -1372,7 +1372,7 @@ var Gl = class {
1372
1372
  clear() {
1373
1373
  this.keyToValue.clear(), this.valueToKey.clear();
1374
1374
  }
1375
- }, Ur = class {
1375
+ }, Or = class {
1376
1376
  constructor(e) {
1377
1377
  this.generateIdentifier = e, this.kv = new Gl();
1378
1378
  }
@@ -1388,7 +1388,7 @@ var Gl = class {
1388
1388
  getValue(e) {
1389
1389
  return this.kv.getByKey(e);
1390
1390
  }
1391
- }, Ul = class extends Ur {
1391
+ }, Ol = class extends Or {
1392
1392
  constructor() {
1393
1393
  super((e) => e.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
1394
1394
  }
@@ -1399,7 +1399,7 @@ var Gl = class {
1399
1399
  return this.classToAllowedProps.get(e);
1400
1400
  }
1401
1401
  };
1402
- function Ol(e) {
1402
+ function Ul(e) {
1403
1403
  if ("values" in Object)
1404
1404
  return Object.values(e);
1405
1405
  const t = [];
@@ -1408,7 +1408,7 @@ function Ol(e) {
1408
1408
  return t;
1409
1409
  }
1410
1410
  function Rl(e, t) {
1411
- const n = Ol(e);
1411
+ const n = Ul(e);
1412
1412
  if ("find" in n)
1413
1413
  return n.find(t);
1414
1414
  const s = n;
@@ -1424,7 +1424,7 @@ function Ct(e, t) {
1424
1424
  function pn(e, t) {
1425
1425
  return e.indexOf(t) !== -1;
1426
1426
  }
1427
- function Os(e, t) {
1427
+ function Us(e, t) {
1428
1428
  for (let n = 0; n < e.length; n++) {
1429
1429
  const s = e[n];
1430
1430
  if (t(s))
@@ -1444,7 +1444,7 @@ var Ml = class {
1444
1444
  findByName(e) {
1445
1445
  return this.transfomers[e];
1446
1446
  }
1447
- }, Bl = (e) => Object.prototype.toString.call(e).slice(8, -1), Or = (e) => typeof e > "u", Fl = (e) => e === null, Mt = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Xn = (e) => Mt(e) && Object.keys(e).length === 0, et = (e) => Array.isArray(e), Hl = (e) => typeof e == "string", Vl = (e) => typeof e == "number" && !isNaN(e), ql = (e) => typeof e == "boolean", $l = (e) => e instanceof RegExp, Bt = (e) => e instanceof Map, Ft = (e) => e instanceof Set, Rr = (e) => Bl(e) === "Symbol", jl = (e) => e instanceof Date && !isNaN(e.valueOf()), Kl = (e) => e instanceof Error, Rs = (e) => typeof e == "number" && isNaN(e), zl = (e) => ql(e) || Fl(e) || Or(e) || Vl(e) || Hl(e) || Rr(e), Wl = (e) => typeof e == "bigint", Ql = (e) => e === 1 / 0 || e === -1 / 0, Yl = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Xl = (e) => e instanceof URL, Mr = (e) => e.replace(/\./g, "\\."), Rn = (e) => e.map(String).map(Mr).join("."), Dt = (e) => {
1447
+ }, Bl = (e) => Object.prototype.toString.call(e).slice(8, -1), Ur = (e) => typeof e > "u", Fl = (e) => e === null, Mt = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Xn = (e) => Mt(e) && Object.keys(e).length === 0, et = (e) => Array.isArray(e), Hl = (e) => typeof e == "string", Vl = (e) => typeof e == "number" && !isNaN(e), ql = (e) => typeof e == "boolean", $l = (e) => e instanceof RegExp, Bt = (e) => e instanceof Map, Ft = (e) => e instanceof Set, Rr = (e) => Bl(e) === "Symbol", jl = (e) => e instanceof Date && !isNaN(e.valueOf()), Kl = (e) => e instanceof Error, Rs = (e) => typeof e == "number" && isNaN(e), zl = (e) => ql(e) || Fl(e) || Ur(e) || Vl(e) || Hl(e) || Rr(e), Wl = (e) => typeof e == "bigint", Ql = (e) => e === 1 / 0 || e === -1 / 0, Yl = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Xl = (e) => e instanceof URL, Mr = (e) => e.replace(/\./g, "\\."), Rn = (e) => e.map(String).map(Mr).join("."), Dt = (e) => {
1448
1448
  const t = [];
1449
1449
  let n = "";
1450
1450
  for (let r = 0; r < e.length; r++) {
@@ -1471,7 +1471,7 @@ function Ve(e, t, n, s) {
1471
1471
  };
1472
1472
  }
1473
1473
  var Br = [
1474
- Ve(Or, "undefined", () => null, () => {
1474
+ Ve(Ur, "undefined", () => null, () => {
1475
1475
  }),
1476
1476
  Ve(Wl, "bigint", (e) => e.toString(), (e) => typeof BigInt < "u" ? BigInt(e) : e),
1477
1477
  Ve(jl, "Date", (e) => e.toISOString(), (e) => new Date(e)),
@@ -1557,13 +1557,13 @@ var qr = Ln(Vr, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)
1557
1557
  throw new Error("Trying to deserialize unknown custom value");
1558
1558
  return s.deserialize(e);
1559
1559
  }), Jl = [qr, Fr, $r, Hr], Ms = (e, t) => {
1560
- const n = Os(Jl, (r) => r.isApplicable(e, t));
1560
+ const n = Us(Jl, (r) => r.isApplicable(e, t));
1561
1561
  if (n)
1562
1562
  return {
1563
1563
  value: n.transform(e, t),
1564
1564
  type: n.annotation(e, t)
1565
1565
  };
1566
- const s = Os(Br, (r) => r.isApplicable(e, t));
1566
+ const s = Us(Br, (r) => r.isApplicable(e, t));
1567
1567
  if (s)
1568
1568
  return {
1569
1569
  value: s.transform(e, t),
@@ -1800,12 +1800,12 @@ function es(e, t = {}) {
1800
1800
  return oo(r, i, o, e, t.nonenumerable), r;
1801
1801
  }, {});
1802
1802
  }
1803
- var te = class {
1803
+ var ne = class {
1804
1804
  /**
1805
1805
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
1806
1806
  */
1807
1807
  constructor({ dedupe: e = !1 } = {}) {
1808
- this.classRegistry = new Ul(), this.symbolRegistry = new Ur((t) => t.description ?? ""), this.customTransformerRegistry = new Ml(), this.allowedErrorProps = [], this.dedupe = e;
1808
+ this.classRegistry = new Ol(), this.symbolRegistry = new Or((t) => t.description ?? ""), this.customTransformerRegistry = new Ml(), this.allowedErrorProps = [], this.dedupe = e;
1809
1809
  }
1810
1810
  serialize(e) {
1811
1811
  const t = /* @__PURE__ */ new Map(), n = zr(e, t, this, this.dedupe), s = {
@@ -1848,16 +1848,16 @@ var te = class {
1848
1848
  this.allowedErrorProps.push(...e);
1849
1849
  }
1850
1850
  };
1851
- te.defaultInstance = new te();
1852
- te.serialize = te.defaultInstance.serialize.bind(te.defaultInstance);
1853
- te.deserialize = te.defaultInstance.deserialize.bind(te.defaultInstance);
1854
- te.stringify = te.defaultInstance.stringify.bind(te.defaultInstance);
1855
- te.parse = te.defaultInstance.parse.bind(te.defaultInstance);
1856
- te.registerClass = te.defaultInstance.registerClass.bind(te.defaultInstance);
1857
- te.registerSymbol = te.defaultInstance.registerSymbol.bind(te.defaultInstance);
1858
- te.registerCustom = te.defaultInstance.registerCustom.bind(te.defaultInstance);
1859
- te.allowErrorProps = te.defaultInstance.allowErrorProps.bind(te.defaultInstance);
1860
- var co = te.serialize, cu = te.stringify;
1851
+ ne.defaultInstance = new ne();
1852
+ ne.serialize = ne.defaultInstance.serialize.bind(ne.defaultInstance);
1853
+ ne.deserialize = ne.defaultInstance.deserialize.bind(ne.defaultInstance);
1854
+ ne.stringify = ne.defaultInstance.stringify.bind(ne.defaultInstance);
1855
+ ne.parse = ne.defaultInstance.parse.bind(ne.defaultInstance);
1856
+ ne.registerClass = ne.defaultInstance.registerClass.bind(ne.defaultInstance);
1857
+ ne.registerSymbol = ne.defaultInstance.registerSymbol.bind(ne.defaultInstance);
1858
+ ne.registerCustom = ne.defaultInstance.registerCustom.bind(ne.defaultInstance);
1859
+ ne.allowErrorProps = ne.defaultInstance.allowErrorProps.bind(ne.defaultInstance);
1860
+ var co = ne.serialize, cu = ne.stringify;
1861
1861
  function uu(e) {
1862
1862
  return e.state.fetchStatus === "fetching" ? "fetching" : e.getObserversCount() ? e.state.fetchStatus === "paused" ? "paused" : e.isStale() ? "stale" : "fresh" : "inactive";
1863
1863
  }
@@ -1900,7 +1900,7 @@ var gu = (e, t = !1) => {
1900
1900
  const s = (r) => {
1901
1901
  t(r.matches ? "dark" : "light");
1902
1902
  };
1903
- n.addEventListener("change", s), Ut(() => n.removeEventListener("change", s));
1903
+ n.addEventListener("change", s), Ot(() => n.removeEventListener("change", s));
1904
1904
  }), e;
1905
1905
  }, mn = (e, t, n) => {
1906
1906
  if (t.length === 0)
@@ -1969,19 +1969,19 @@ var gu = (e, t = !1) => {
1969
1969
  s.appendChild(r), s.id = "_goober", s.setAttribute("nonce", e), t ? t.appendChild(s) : document.head.appendChild(s);
1970
1970
  }, ht, Ht, Vt, qt, rt, $t, ft, mt, gt, pt, yt, Et, jt, Vs, mo = (Vs = class {
1971
1971
  constructor(e) {
1972
- J(this, ht);
1973
- J(this, Ht);
1974
- J(this, Vt);
1975
- J(this, qt);
1976
- J(this, rt, !1);
1977
- J(this, $t);
1978
- J(this, ft);
1979
- J(this, mt);
1980
- J(this, gt);
1981
- J(this, pt);
1982
- J(this, yt);
1983
- J(this, Et);
1984
- J(this, jt);
1972
+ ee(this, ht);
1973
+ ee(this, Ht);
1974
+ ee(this, Vt);
1975
+ ee(this, qt);
1976
+ ee(this, rt, !1);
1977
+ ee(this, $t);
1978
+ ee(this, ft);
1979
+ ee(this, mt);
1980
+ ee(this, gt);
1981
+ ee(this, pt);
1982
+ ee(this, yt);
1983
+ ee(this, Et);
1984
+ ee(this, jt);
1985
1985
  const {
1986
1986
  client: t,
1987
1987
  queryFlavor: n,
@@ -1997,38 +1997,38 @@ var gu = (e, t = !1) => {
1997
1997
  Y(this, ht, fe(t)), Y(this, Vt, n), Y(this, qt, s), Y(this, Ht, r), Y(this, $t, d), Y(this, ft, f), Y(this, mt, fe(i)), Y(this, gt, fe(l)), Y(this, pt, fe(o)), Y(this, yt, fe(u));
1998
1998
  }
1999
1999
  setButtonPosition(e) {
2000
- O(this, mt)[1](e);
2000
+ U(this, mt)[1](e);
2001
2001
  }
2002
2002
  setPosition(e) {
2003
- O(this, gt)[1](e);
2003
+ U(this, gt)[1](e);
2004
2004
  }
2005
2005
  setInitialIsOpen(e) {
2006
- O(this, pt)[1](e);
2006
+ U(this, pt)[1](e);
2007
2007
  }
2008
2008
  setErrorTypes(e) {
2009
- O(this, yt)[1](e);
2009
+ U(this, yt)[1](e);
2010
2010
  }
2011
2011
  setClient(e) {
2012
- O(this, ht)[1](e);
2012
+ U(this, ht)[1](e);
2013
2013
  }
2014
2014
  mount(e) {
2015
- if (O(this, rt))
2015
+ if (U(this, rt))
2016
2016
  throw new Error("Devtools is already mounted");
2017
2017
  const t = kr(() => {
2018
- const n = this, [s] = O(this, mt), [r] = O(this, gt), [i] = O(this, pt), [l] = O(this, yt), [o] = O(this, ht);
2018
+ const n = this, [s] = U(this, mt), [r] = U(this, gt), [i] = U(this, pt), [l] = U(this, yt), [o] = U(this, ht);
2019
2019
  let u;
2020
- return O(this, Et) ? u = O(this, Et) : (u = Ir(() => import("./HO4MOOFI-BoB6vpqY.js")), Y(this, Et, u)), Xr(O(this, $t), O(this, ft)), Pr(u, _r({
2020
+ return U(this, Et) ? u = U(this, Et) : (u = Ir(() => import("./HO4MOOFI-sdcsvWJW.js")), Y(this, Et, u)), Xr(U(this, $t), U(this, ft)), Pr(u, _r({
2021
2021
  get queryFlavor() {
2022
- return O(n, Vt);
2022
+ return U(n, Vt);
2023
2023
  },
2024
2024
  get version() {
2025
- return O(n, qt);
2025
+ return U(n, qt);
2026
2026
  },
2027
2027
  get onlineManager() {
2028
- return O(n, Ht);
2028
+ return U(n, Ht);
2029
2029
  },
2030
2030
  get shadowDOMTarget() {
2031
- return O(n, ft);
2031
+ return U(n, ft);
2032
2032
  }
2033
2033
  }, {
2034
2034
  get client() {
@@ -2052,26 +2052,26 @@ var gu = (e, t = !1) => {
2052
2052
  }
2053
2053
  unmount() {
2054
2054
  var e;
2055
- if (!O(this, rt))
2055
+ if (!U(this, rt))
2056
2056
  throw new Error("Devtools is not mounted");
2057
- (e = O(this, jt)) == null || e.call(this), Y(this, rt, !1);
2057
+ (e = U(this, jt)) == null || e.call(this), Y(this, rt, !1);
2058
2058
  }
2059
2059
  }, ht = new WeakMap(), Ht = new WeakMap(), Vt = new WeakMap(), qt = new WeakMap(), rt = new WeakMap(), $t = new WeakMap(), ft = new WeakMap(), mt = new WeakMap(), gt = new WeakMap(), pt = new WeakMap(), yt = new WeakMap(), Et = new WeakMap(), jt = new WeakMap(), Vs), vt, Kt, zt, Wt, at, Qt, St, wt, bt, Nt, At, xt, Tt, Yt, qs, go = (qs = class {
2060
2060
  constructor(e) {
2061
- J(this, vt);
2062
- J(this, Kt);
2063
- J(this, zt);
2064
- J(this, Wt);
2065
- J(this, at, !1);
2066
- J(this, Qt);
2067
- J(this, St);
2068
- J(this, wt);
2069
- J(this, bt);
2070
- J(this, Nt);
2071
- J(this, At);
2072
- J(this, xt);
2073
- J(this, Tt);
2074
- J(this, Yt);
2061
+ ee(this, vt);
2062
+ ee(this, Kt);
2063
+ ee(this, zt);
2064
+ ee(this, Wt);
2065
+ ee(this, at, !1);
2066
+ ee(this, Qt);
2067
+ ee(this, St);
2068
+ ee(this, wt);
2069
+ ee(this, bt);
2070
+ ee(this, Nt);
2071
+ ee(this, At);
2072
+ ee(this, xt);
2073
+ ee(this, Tt);
2074
+ ee(this, Yt);
2075
2075
  const {
2076
2076
  client: t,
2077
2077
  queryFlavor: n,
@@ -2088,41 +2088,41 @@ var gu = (e, t = !1) => {
2088
2088
  Y(this, vt, fe(t)), Y(this, zt, n), Y(this, Wt, s), Y(this, Kt, r), Y(this, Qt, d), Y(this, St, f), Y(this, wt, fe(i)), Y(this, bt, fe(l)), Y(this, Nt, fe(o)), Y(this, At, fe(u)), Y(this, xt, fe(m));
2089
2089
  }
2090
2090
  setButtonPosition(e) {
2091
- O(this, wt)[1](e);
2091
+ U(this, wt)[1](e);
2092
2092
  }
2093
2093
  setPosition(e) {
2094
- O(this, bt)[1](e);
2094
+ U(this, bt)[1](e);
2095
2095
  }
2096
2096
  setInitialIsOpen(e) {
2097
- O(this, Nt)[1](e);
2097
+ U(this, Nt)[1](e);
2098
2098
  }
2099
2099
  setErrorTypes(e) {
2100
- O(this, At)[1](e);
2100
+ U(this, At)[1](e);
2101
2101
  }
2102
2102
  setClient(e) {
2103
- O(this, vt)[1](e);
2103
+ U(this, vt)[1](e);
2104
2104
  }
2105
2105
  setOnClose(e) {
2106
- O(this, xt)[1](() => e);
2106
+ U(this, xt)[1](() => e);
2107
2107
  }
2108
2108
  mount(e) {
2109
- if (O(this, at))
2109
+ if (U(this, at))
2110
2110
  throw new Error("Devtools is already mounted");
2111
2111
  const t = kr(() => {
2112
- const n = this, [s] = O(this, wt), [r] = O(this, bt), [i] = O(this, Nt), [l] = O(this, At), [o] = O(this, vt), [u] = O(this, xt);
2112
+ const n = this, [s] = U(this, wt), [r] = U(this, bt), [i] = U(this, Nt), [l] = U(this, At), [o] = U(this, vt), [u] = U(this, xt);
2113
2113
  let d;
2114
- return O(this, Tt) ? d = O(this, Tt) : (d = Ir(() => import("./HUY7CZI3-Cj4icxzC.js")), Y(this, Tt, d)), Xr(O(this, Qt), O(this, St)), Pr(d, _r({
2114
+ return U(this, Tt) ? d = U(this, Tt) : (d = Ir(() => import("./HUY7CZI3-DDw0mu7q.js")), Y(this, Tt, d)), Xr(U(this, Qt), U(this, St)), Pr(d, _r({
2115
2115
  get queryFlavor() {
2116
- return O(n, zt);
2116
+ return U(n, zt);
2117
2117
  },
2118
2118
  get version() {
2119
- return O(n, Wt);
2119
+ return U(n, Wt);
2120
2120
  },
2121
2121
  get onlineManager() {
2122
- return O(n, Kt);
2122
+ return U(n, Kt);
2123
2123
  },
2124
2124
  get shadowDOMTarget() {
2125
- return O(n, St);
2125
+ return U(n, St);
2126
2126
  }
2127
2127
  }, {
2128
2128
  get client() {
@@ -2149,9 +2149,9 @@ var gu = (e, t = !1) => {
2149
2149
  }
2150
2150
  unmount() {
2151
2151
  var e;
2152
- if (!O(this, at))
2152
+ if (!U(this, at))
2153
2153
  throw new Error("Devtools is not mounted");
2154
- (e = O(this, Yt)) == null || e.call(this), Y(this, at, !1);
2154
+ (e = U(this, Yt)) == null || e.call(this), Y(this, at, !1);
2155
2155
  }
2156
2156
  }, vt = new WeakMap(), Kt = new WeakMap(), zt = new WeakMap(), Wt = new WeakMap(), at = new WeakMap(), Qt = new WeakMap(), St = new WeakMap(), wt = new WeakMap(), bt = new WeakMap(), Nt = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Yt = new WeakMap(), qs);
2157
2157
  function po(e) {
@@ -2261,7 +2261,7 @@ const _ = {
2261
2261
  GET_PAGE_REVISIONS: "GET_PAGE_REVISIONS",
2262
2262
  DELETE_PAGE_REVISION: "DELETE_PAGE_REVISION",
2263
2263
  RESTORE_PAGE_REVISION: "RESTORE_PAGE_REVISION",
2264
- GET_PERMISSIONS: "GET_PERMISSIONS",
2264
+ GET_ROLE_AND_PERMISSIONS: "GET_ROLE_AND_PERMISSIONS",
2265
2265
  UPSERT_LIBRARY_ITEM: "UPSERT_LIBRARY_ITEM",
2266
2266
  GET_LIBRARIES: "GET_LIBRARIES",
2267
2267
  GET_LIBRARY_ITEM: "GET_LIBRARY_ITEM",
@@ -2324,7 +2324,7 @@ const Su = () => {
2324
2324
  async (s, r, i = {}) => {
2325
2325
  if (n)
2326
2326
  try {
2327
- const l = ne(r, "action", "").toLowerCase(), o = await Zr(
2327
+ const l = J(r, "action", "").toLowerCase(), o = await Zr(
2328
2328
  s + (l ? `?action=${l}` : ""),
2329
2329
  r,
2330
2330
  {
@@ -2421,7 +2421,7 @@ const wo = is({}), ta = () => ls(wo), bo = () => {
2421
2421
  }, [t, s, n]);
2422
2422
  }, Re = (e, t) => {
2423
2423
  const [n] = ta();
2424
- return ne(n, e, t);
2424
+ return J(n, e, t);
2425
2425
  }, Z = () => Re("apiUrl", "/chai/api"), No = () => {
2426
2426
  const e = Z(), { aiContext: t } = hs(), n = X();
2427
2427
  return _e(
@@ -2438,7 +2438,7 @@ const wo = is({}), ta = () => ls(wo), bo = () => {
2438
2438
  staleTime: 1e3 * 60 * 5,
2439
2439
  queryFn: async () => e(t, { action: _.GET_WEBSITE_PAGES }) || []
2440
2440
  });
2441
- }, Ao = is({ lastSaved: void 0 }), fs = () => ls(Ao), Ue = () => {
2441
+ }, Ao = is({ lastSaved: void 0 }), fs = () => ls(Ao), Oe = () => {
2442
2442
  const [e] = Ge(), t = e.get("page"), { data: n, isFetching: s } = kn();
2443
2443
  return { data: ae(
2444
2444
  () => me(n, { id: t }) || {},
@@ -2503,7 +2503,7 @@ const wo = is({}), ta = () => ls(wo), bo = () => {
2503
2503
  });
2504
2504
  r(o.currentEditor);
2505
2505
  const u = o.blocks ?? [], d = me(u, { _type: "@chai/ai-context" });
2506
- return s(ne(d, "_value", "") || ""), i((f) => ({ ...f, lastSaved: o.lastSaved })), u;
2506
+ return s(J(d, "_value", "") || ""), i((f) => ({ ...f, lastSaved: o.lastSaved })), u;
2507
2507
  },
2508
2508
  enabled: !!t
2509
2509
  });
@@ -2580,7 +2580,7 @@ const wo = is({}), ta = () => ls(wo), bo = () => {
2580
2580
  const d = await t(e, {
2581
2581
  action: "GET_LIBRARY_ITEM",
2582
2582
  data: { id: u.id }
2583
- }), f = ne(d, "html", ""), m = ne(d, "blocks", []);
2583
+ }), f = J(d, "html", ""), m = J(d, "blocks", []);
2584
2584
  return Da(m) ? m : wa(f);
2585
2585
  }, getUILibraryBlocks: async (o) => {
2586
2586
  try {
@@ -2836,14 +2836,14 @@ const wo = is({}), ta = () => ls(wo), bo = () => {
2836
2836
  action: _.GET_LANGUAGE_PAGES,
2837
2837
  data: { id: n }
2838
2838
  });
2839
- return Ga(Ua(r, "primaryPage"));
2839
+ return Ga(Oa(r, "primaryPage"));
2840
2840
  },
2841
2841
  enabled: !!n
2842
2842
  });
2843
2843
  }, ra = (e) => {
2844
2844
  const { fallbackLang: t } = ot(), { data: n } = nn(), { data: s, isFetching: r } = sn(), i = ae(() => {
2845
2845
  const l = { [t]: !0 };
2846
- return Oa(ne(n, "languages"), (o) => {
2846
+ return Ua(J(n, "languages"), (o) => {
2847
2847
  const u = me(s, { lang: o });
2848
2848
  l[o] = !!u;
2849
2849
  }), l;
@@ -2932,7 +2932,7 @@ const Go = () => {
2932
2932
  onTakeOver: u
2933
2933
  }
2934
2934
  );
2935
- }, Uo = () => {
2935
+ }, Oo = () => {
2936
2936
  const [e, t] = Ge(), n = e.get("lang"), s = ra(n), { setSelectedLang: r } = ot(), i = () => {
2937
2937
  const o = new URLSearchParams(window.location.search);
2938
2938
  o.delete("lang");
@@ -2940,7 +2940,7 @@ const Go = () => {
2940
2940
  window.history.pushState({}, "", d), t(o), r(""), window.dispatchEvent(new PopStateEvent("popstate"));
2941
2941
  };
2942
2942
  if (s) return null;
2943
- const l = ne(Fe, n);
2943
+ const l = J(Fe, n);
2944
2944
  return /* @__PURE__ */ a("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__ */ c(lr, { className: "w-full max-w-md mx-auto", children: [
2945
2945
  /* @__PURE__ */ a(or, { className: "space-y-1", children: /* @__PURE__ */ c(cr, { className: "flex items-center gap-2 text-2xl", children: [
2946
2946
  /* @__PURE__ */ a(Js, { className: "w-6 h-6 text-yellow-500" }),
@@ -2965,7 +2965,7 @@ const Go = () => {
2965
2965
  }
2966
2966
  ) })
2967
2967
  ] }) });
2968
- }, Oo = () => {
2968
+ }, Uo = () => {
2969
2969
  const e = Z(), t = X();
2970
2970
  return xe({
2971
2971
  queryKey: [_.GET_LIBRARIES],
@@ -2998,7 +2998,7 @@ const Go = () => {
2998
2998
  }) => {
2999
2999
  const r = !!t, [i, l] = M("CREATE"), [o, u] = M(""), [d, f] = M(
3000
3000
  r ? (t == null ? void 0 : t.name) + " template" : ""
3001
- ), [m, w] = M(""), [E, p] = M(""), [b] = $s(), S = So({ id: o }), { data: I, isLoading: A } = Oo(), { data: x, isLoading: v } = Ro(o), C = A || v || S.isPending;
3001
+ ), [m, w] = M(""), [E, p] = M(""), [b] = $s(), S = So({ id: o }), { data: I, isLoading: A } = Uo(), { data: x, isLoading: v } = Ro(o), C = A || v || S.isPending;
3002
3002
  Ie(() => {
3003
3003
  I.length > 0 && u(I[0].id);
3004
3004
  }, [I]);
@@ -3265,7 +3265,7 @@ const Go = () => {
3265
3265
  le.error(
3266
3266
  `Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`,
3267
3267
  {
3268
- description: ne(Mo, r.message, r.message)
3268
+ description: J(Mo, r.message, r.message)
3269
3269
  }
3270
3270
  );
3271
3271
  }
@@ -3353,7 +3353,7 @@ const Go = () => {
3353
3353
  }
3354
3354
  });
3355
3355
  }, gs = () => {
3356
- const e = Z(), t = X(), n = Ae(), { data: s } = Ue();
3356
+ const e = Z(), t = X(), n = Ae(), { data: s } = Oe();
3357
3357
  return De({
3358
3358
  mutationFn: async ({ ids: r }) => t(e, {
3359
3359
  action: _.PUBLISH_CHANGES,
@@ -3415,22 +3415,22 @@ var ps = {};
3415
3415
  return P;
3416
3416
  if (h.has(P))
3417
3417
  return h.get(P);
3418
- var U = new OffscreenCanvas(P.width, P.height), q = U.getContext("2d");
3419
- return q.drawImage(P, 0, 0), h.set(P, U), U;
3418
+ var O = new OffscreenCanvas(P.width, P.height), q = O.getContext("2d");
3419
+ return q.drawImage(P, 0, 0), h.set(P, O), O;
3420
3420
  },
3421
3421
  clear: function() {
3422
3422
  h.clear();
3423
3423
  }
3424
3424
  };
3425
3425
  }(o, /* @__PURE__ */ new Map()), m = function() {
3426
- var g = Math.floor(16.666666666666668), h, P, U = {}, q = 0;
3426
+ var g = Math.floor(16.666666666666668), h, P, O = {}, q = 0;
3427
3427
  return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (h = function($) {
3428
3428
  var j = Math.random();
3429
- return U[j] = requestAnimationFrame(function G(K) {
3430
- q === K || q + g - 1 < K ? (q = K, delete U[j], $()) : U[j] = requestAnimationFrame(G);
3429
+ return O[j] = requestAnimationFrame(function G(K) {
3430
+ q === K || q + g - 1 < K ? (q = K, delete O[j], $()) : O[j] = requestAnimationFrame(G);
3431
3431
  }), j;
3432
3432
  }, P = function($) {
3433
- U[$] && cancelAnimationFrame(U[$]);
3433
+ O[$] && cancelAnimationFrame(O[$]);
3434
3434
  }) : (h = function($) {
3435
3435
  return setTimeout($, g);
3436
3436
  }, P = function($) {
@@ -3438,7 +3438,7 @@ var ps = {};
3438
3438
  }), { frame: h, cancel: P };
3439
3439
  }(), w = /* @__PURE__ */ function() {
3440
3440
  var g, h, P = {};
3441
- function U(q) {
3441
+ function O(q) {
3442
3442
  function $(j, G) {
3443
3443
  q.postMessage({ options: j || {}, callback: G });
3444
3444
  }
@@ -3493,7 +3493,7 @@ var ps = {};
3493
3493
  } catch ($) {
3494
3494
  return typeof console !== void 0 && typeof console.warn == "function" && console.warn("🎊 Could not load worker", $), null;
3495
3495
  }
3496
- U(g);
3496
+ O(g);
3497
3497
  }
3498
3498
  return g;
3499
3499
  };
@@ -3570,8 +3570,8 @@ var ps = {};
3570
3570
  var h = document.createElement("canvas");
3571
3571
  return h.style.position = "fixed", h.style.top = "0px", h.style.left = "0px", h.style.pointerEvents = "none", h.style.zIndex = g, h;
3572
3572
  }
3573
- function k(g, h, P, U, q, $, j, G, K) {
3574
- g.save(), g.translate(h, P), g.rotate($), g.scale(U, q), g.arc(0, 0, 1, j, G, K), g.restore();
3573
+ function k(g, h, P, O, q, $, j, G, K) {
3574
+ g.save(), g.translate(h, P), g.rotate($), g.scale(O, q), g.arc(0, 0, 1, j, G, K), g.restore();
3575
3575
  }
3576
3576
  function V(g) {
3577
3577
  var h = g.angle * (Math.PI / 180), P = g.spread * (Math.PI / 180);
@@ -3602,19 +3602,19 @@ var ps = {};
3602
3602
  }
3603
3603
  function W(g, h) {
3604
3604
  h.x += Math.cos(h.angle2D) * h.velocity + h.drift, h.y += Math.sin(h.angle2D) * h.velocity + h.gravity, h.velocity *= h.decay, h.flat ? (h.wobble = 0, h.wobbleX = h.x + 10 * h.scalar, h.wobbleY = h.y + 10 * h.scalar, h.tiltSin = 0, h.tiltCos = 0, h.random = 1) : (h.wobble += h.wobbleSpeed, h.wobbleX = h.x + 10 * h.scalar * Math.cos(h.wobble), h.wobbleY = h.y + 10 * h.scalar * Math.sin(h.wobble), h.tiltAngle += 0.1, h.tiltSin = Math.sin(h.tiltAngle), h.tiltCos = Math.cos(h.tiltAngle), h.random = Math.random() + 2);
3605
- var P = h.tick++ / h.totalTicks, U = h.x + h.random * h.tiltCos, q = h.y + h.random * h.tiltSin, $ = h.wobbleX + h.random * h.tiltCos, j = h.wobbleY + h.random * h.tiltSin;
3605
+ var P = h.tick++ / h.totalTicks, O = h.x + h.random * h.tiltCos, q = h.y + h.random * h.tiltSin, $ = h.wobbleX + h.random * h.tiltCos, j = h.wobbleY + h.random * h.tiltSin;
3606
3606
  if (g.fillStyle = "rgba(" + h.color.r + ", " + h.color.g + ", " + h.color.b + ", " + (1 - P) + ")", g.beginPath(), l && h.shape.type === "path" && typeof h.shape.path == "string" && Array.isArray(h.shape.matrix))
3607
3607
  g.fill(Se(
3608
3608
  h.shape.path,
3609
3609
  h.shape.matrix,
3610
3610
  h.x,
3611
3611
  h.y,
3612
- Math.abs($ - U) * 0.1,
3612
+ Math.abs($ - O) * 0.1,
3613
3613
  Math.abs(j - q) * 0.1,
3614
3614
  Math.PI / 10 * h.wobble
3615
3615
  ));
3616
3616
  else if (h.shape.type === "bitmap") {
3617
- var G = Math.PI / 10 * h.wobble, K = Math.abs($ - U) * 0.1, se = Math.abs(j - q) * 0.1, de = h.shape.bitmap.width * h.scalar, ie = h.shape.bitmap.height * h.scalar, he = new DOMMatrix([
3617
+ var G = Math.PI / 10 * h.wobble, K = Math.abs($ - O) * 0.1, se = Math.abs(j - q) * 0.1, de = h.shape.bitmap.width * h.scalar, ie = h.shape.bitmap.height * h.scalar, he = new DOMMatrix([
3618
3618
  Math.cos(G) * K,
3619
3619
  Math.sin(G) * K,
3620
3620
  -Math.sin(G) * se,
@@ -3631,21 +3631,21 @@ var ps = {};
3631
3631
  ie
3632
3632
  ), g.globalAlpha = 1;
3633
3633
  } else if (h.shape === "circle")
3634
- g.ellipse ? g.ellipse(h.x, h.y, Math.abs($ - U) * h.ovalScalar, Math.abs(j - q) * h.ovalScalar, Math.PI / 10 * h.wobble, 0, 2 * Math.PI) : k(g, h.x, h.y, Math.abs($ - U) * h.ovalScalar, Math.abs(j - q) * h.ovalScalar, Math.PI / 10 * h.wobble, 0, 2 * Math.PI);
3634
+ g.ellipse ? g.ellipse(h.x, h.y, Math.abs($ - O) * h.ovalScalar, Math.abs(j - q) * h.ovalScalar, Math.PI / 10 * h.wobble, 0, 2 * Math.PI) : k(g, h.x, h.y, Math.abs($ - O) * h.ovalScalar, Math.abs(j - q) * h.ovalScalar, Math.PI / 10 * h.wobble, 0, 2 * Math.PI);
3635
3635
  else if (h.shape === "star")
3636
3636
  for (var z = Math.PI / 2 * 3, Ce = 4 * h.scalar, Me = 8 * h.scalar, Be = h.x, Qe = h.y, st = 5, He = Math.PI / st; st--; )
3637
3637
  Be = h.x + Math.cos(z) * Me, Qe = h.y + Math.sin(z) * Me, g.lineTo(Be, Qe), z += He, Be = h.x + Math.cos(z) * Ce, Qe = h.y + Math.sin(z) * Ce, g.lineTo(Be, Qe), z += He;
3638
3638
  else
3639
- g.moveTo(Math.floor(h.x), Math.floor(h.y)), g.lineTo(Math.floor(h.wobbleX), Math.floor(q)), g.lineTo(Math.floor($), Math.floor(j)), g.lineTo(Math.floor(U), Math.floor(h.wobbleY));
3639
+ g.moveTo(Math.floor(h.x), Math.floor(h.y)), g.lineTo(Math.floor(h.wobbleX), Math.floor(q)), g.lineTo(Math.floor($), Math.floor(j)), g.lineTo(Math.floor(O), Math.floor(h.wobbleY));
3640
3640
  return g.closePath(), g.fill(), h.tick < h.totalTicks;
3641
3641
  }
3642
- function We(g, h, P, U, q) {
3642
+ function We(g, h, P, O, q) {
3643
3643
  var $ = h.slice(), j = g.getContext("2d"), G, K, se = d(function(de) {
3644
3644
  function ie() {
3645
- G = K = null, j.clearRect(0, 0, U.width, U.height), f.clear(), q(), de();
3645
+ G = K = null, j.clearRect(0, 0, O.width, O.height), f.clear(), q(), de();
3646
3646
  }
3647
3647
  function he() {
3648
- s && !(U.width === r.width && U.height === r.height) && (U.width = g.width = r.width, U.height = g.height = r.height), !U.width && !U.height && (P(g), U.width = g.width, U.height = g.height), j.clearRect(0, 0, U.width, U.height), $ = $.filter(function(ye) {
3648
+ s && !(O.width === r.width && O.height === r.height) && (O.width = g.width = r.width, O.height = g.height = r.height), !O.width && !O.height && (P(g), O.width = g.width, O.height = g.height), j.clearRect(0, 0, O.width, O.height), $ = $.filter(function(ye) {
3649
3649
  return W(j, ye);
3650
3650
  }), $.length ? G = m.frame(he) : ie();
3651
3651
  }
@@ -3663,7 +3663,7 @@ var ps = {};
3663
3663
  };
3664
3664
  }
3665
3665
  function pe(g, h) {
3666
- var P = !g, U = !!S(h || {}, "resize"), q = !1, $ = S(h, "disableForReducedMotion", Boolean), j = i && !!S(h || {}, "useWorker"), G = j ? w() : null, K = P ? T : L, se = g && G ? !!g.__confetti_initialized : !1, de = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, ie;
3666
+ var P = !g, O = !!S(h || {}, "resize"), q = !1, $ = S(h, "disableForReducedMotion", Boolean), j = i && !!S(h || {}, "useWorker"), G = j ? w() : null, K = P ? T : L, se = g && G ? !!g.__confetti_initialized : !1, de = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, ie;
3667
3667
  function he(z, Ce, Me) {
3668
3668
  for (var Be = S(z, "particleCount", I), Qe = S(z, "angle", Number), st = S(z, "spread", Number), He = S(z, "startVelocity", Number), ha = S(z, "decay", Number), fa = S(z, "gravity", Number), ma = S(z, "drift", Number), Es = S(z, "colors", v), ga = S(z, "ticks", Number), vs = S(z, "shapes"), pa = S(z, "scalar"), ya = !!S(z, "flat"), Ss = B(z), ws = Be, Dn = [], Ea = g.width * Ss.x, va = g.height * Ss.y; ws--; )
3669
3669
  Dn.push(
@@ -3691,7 +3691,7 @@ var ps = {};
3691
3691
  return d(function(He) {
3692
3692
  He();
3693
3693
  });
3694
- P && ie ? g = ie.canvas : P && !g && (g = N(Me), document.body.appendChild(g)), U && !se && K(g);
3694
+ P && ie ? g = ie.canvas : P && !g && (g = N(Me), document.body.appendChild(g)), O && !se && K(g);
3695
3695
  var Be = {
3696
3696
  width: g.width,
3697
3697
  height: g.height
@@ -3716,9 +3716,9 @@ var ps = {};
3716
3716
  Be.width = Be.height = null;
3717
3717
  }
3718
3718
  function st() {
3719
- ie = null, U && (q = !1, t.removeEventListener("resize", Qe)), P && g && (document.body.contains(g) && document.body.removeChild(g), g = null, se = !1);
3719
+ ie = null, O && (q = !1, t.removeEventListener("resize", Qe)), P && g && (document.body.contains(g) && document.body.removeChild(g), g = null, se = !1);
3720
3720
  }
3721
- return U && !q && (q = !0, t.addEventListener("resize", Qe, !1)), G ? G.fire(z, Be, st) : he(z, Be, st);
3721
+ return O && !q && (q = !0, t.addEventListener("resize", Qe, !1)), G ? G.fire(z, Be, st) : he(z, Be, st);
3722
3722
  }
3723
3723
  return ye.reset = function() {
3724
3724
  G && G.reset(), ie && ie.reset();
@@ -3728,7 +3728,7 @@ var ps = {};
3728
3728
  function D() {
3729
3729
  return y || (y = pe(null, { useWorker: !0, resize: !0 })), y;
3730
3730
  }
3731
- function Se(g, h, P, U, q, $, j) {
3731
+ function Se(g, h, P, O, q, $, j) {
3732
3732
  var G = new Path2D(g), K = new Path2D();
3733
3733
  K.addPath(G, new DOMMatrix(h));
3734
3734
  var se = new Path2D();
@@ -3738,7 +3738,7 @@ var ps = {};
3738
3738
  -Math.sin(j) * $,
3739
3739
  Math.cos(j) * $,
3740
3740
  P,
3741
- U
3741
+ O
3742
3742
  ])), se;
3743
3743
  }
3744
3744
  function Ne(g) {
@@ -3746,11 +3746,11 @@ var ps = {};
3746
3746
  throw new Error("path confetti are not supported in this browser");
3747
3747
  var h, P;
3748
3748
  typeof g == "string" ? h = g : (h = g.path, P = g.matrix);
3749
- var U = new Path2D(h), q = document.createElement("canvas"), $ = q.getContext("2d");
3749
+ var O = new Path2D(h), q = document.createElement("canvas"), $ = q.getContext("2d");
3750
3750
  if (!P) {
3751
3751
  for (var j = 1e3, G = j, K = j, se = 0, de = 0, ie, he, ye = 0; ye < j; ye += 2)
3752
3752
  for (var z = 0; z < j; z += 2)
3753
- $.isPointInPath(U, ye, z, "nonzero") && (G = Math.min(G, ye), K = Math.min(K, z), se = Math.max(se, ye), de = Math.max(de, z));
3753
+ $.isPointInPath(O, ye, z, "nonzero") && (G = Math.min(G, ye), K = Math.min(K, z), se = Math.max(se, ye), de = Math.max(de, z));
3754
3754
  ie = se - G, he = de - K;
3755
3755
  var Ce = 10, Me = Math.min(Ce / ie, Ce / he);
3756
3756
  P = [
@@ -3769,12 +3769,12 @@ var ps = {};
3769
3769
  };
3770
3770
  }
3771
3771
  function nt(g) {
3772
- var h, P = 1, U = "#000000", q = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
3773
- typeof g == "string" ? h = g : (h = g.text, P = "scalar" in g ? g.scalar : P, q = "fontFamily" in g ? g.fontFamily : q, U = "color" in g ? g.color : U);
3772
+ var h, P = 1, O = "#000000", q = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
3773
+ typeof g == "string" ? h = g : (h = g.text, P = "scalar" in g ? g.scalar : P, q = "fontFamily" in g ? g.fontFamily : q, O = "color" in g ? g.color : O);
3774
3774
  var $ = 10 * P, j = "" + $ + "px " + q, G = new OffscreenCanvas($, $), K = G.getContext("2d");
3775
3775
  K.font = j;
3776
3776
  var se = K.measureText(h), de = Math.ceil(se.actualBoundingBoxRight + se.actualBoundingBoxLeft), ie = Math.ceil(se.actualBoundingBoxAscent + se.actualBoundingBoxDescent), he = 2, ye = se.actualBoundingBoxLeft + he, z = se.actualBoundingBoxAscent + he;
3777
- de += he + he, ie += he + he, G = new OffscreenCanvas(de, ie), K = G.getContext("2d"), K.font = j, K.fillStyle = U, K.fillText(h, ye, z);
3777
+ de += he + he, ie += he + he, G = new OffscreenCanvas(de, ie), K = G.getContext("2d"), K.font = j, K.fillStyle = O, K.fillText(h, ye, z);
3778
3778
  var Ce = 1 / P;
3779
3779
  return {
3780
3780
  type: "bitmap",
@@ -3984,7 +3984,7 @@ function oa({
3984
3984
  e.lang && /* @__PURE__ */ c("div", { className: "py-2 text-sm", children: [
3985
3985
  "Language:",
3986
3986
  " ",
3987
- /* @__PURE__ */ a("span", { className: "font-medium text-gray-500", children: ne(Fe, e.lang, e.lang) })
3987
+ /* @__PURE__ */ a("span", { className: "font-medium text-gray-500", children: J(Fe, e.lang, e.lang) })
3988
3988
  ] })
3989
3989
  ] })
3990
3990
  ] }),
@@ -4002,7 +4002,7 @@ function oa({
4002
4002
  ] })
4003
4003
  ] }) });
4004
4004
  }
4005
- const Oe = ({
4005
+ const Ue = ({
4006
4006
  permission: e,
4007
4007
  permissions: t,
4008
4008
  children: n,
@@ -4045,7 +4045,7 @@ const Oe = ({
4045
4045
  onClose: t,
4046
4046
  languages: n
4047
4047
  }) => {
4048
- const { data: s } = Ue(), { data: r } = Te(), [i, l] = M(e.name || ""), [o, u] = M(e.edit ? e.lang : ""), [d, f] = M(e.edit ? e.slug : ""), { mutate: m, isPending: w } = la(), { mutate: E, isPending: p } = ms(), b = ae(
4048
+ const { data: s } = Oe(), { data: r } = Te(), [i, l] = M(e.name || ""), [o, u] = M(e.edit ? e.lang : ""), [d, f] = M(e.edit ? e.slug : ""), { mutate: m, isPending: w } = la(), { mutate: E, isPending: p } = ms(), b = ae(
4049
4049
  () => r == null ? void 0 : r.find(
4050
4050
  (x) => x.key === e.pageType
4051
4051
  ),
@@ -4081,8 +4081,8 @@ const Oe = ({
4081
4081
  },
4082
4082
  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",
4083
4083
  children: [
4084
- /* @__PURE__ */ a("option", { value: "", disabled: !0, selected: !0, children: e.edit ? ne(Fe, e.lang, e.lang) : ue(n) ? F.ALL_AVAILABLE_LANGUAGE_PAGE : F.CHOOSE_LANGUAGE }),
4085
- ke(n, (x) => /* @__PURE__ */ a("option", { value: x, children: ne(Fe, x, x) }, x))
4084
+ /* @__PURE__ */ a("option", { value: "", disabled: !0, selected: !0, children: e.edit ? J(Fe, e.lang, e.lang) : ue(n) ? F.ALL_AVAILABLE_LANGUAGE_PAGE : F.CHOOSE_LANGUAGE }),
4085
+ ke(n, (x) => /* @__PURE__ */ a("option", { value: x, children: J(Fe, x, x) }, x))
4086
4086
  ]
4087
4087
  }
4088
4088
  )
@@ -4137,9 +4137,9 @@ const Oe = ({
4137
4137
  ] })
4138
4138
  ] }) });
4139
4139
  }, zo = () => {
4140
- const [e, t] = M(null), { selectedLang: n, fallbackLang: s, setSelectedLang: r } = ot(), { data: i, isFetching: l } = sn(), { data: o } = Ue(), [u, d] = M(null), [f, m] = M(null), [w, E] = M(null), { data: p } = nn(), b = Ee(
4141
- ne(p, "languages") || ["en"],
4142
- (S) => !me(i, { lang: S }) && S !== ne(p, "fallbackLang")
4140
+ const [e, t] = M(null), { selectedLang: n, fallbackLang: s, setSelectedLang: r } = ot(), { data: i, isFetching: l } = sn(), { data: o } = Oe(), [u, d] = M(null), [f, m] = M(null), [w, E] = M(null), { data: p } = nn(), b = Ee(
4141
+ J(p, "languages") || ["en"],
4142
+ (S) => !me(i, { lang: S }) && S !== J(p, "fallbackLang")
4143
4143
  );
4144
4144
  return /* @__PURE__ */ c("div", { className: "space-y-4 pt-2", children: [
4145
4145
  /* @__PURE__ */ a("ul", { className: "space-y-2 mt-4", children: l ? /* @__PURE__ */ c("div", { className: "w-full space-y-3 py-4", children: [
@@ -4167,7 +4167,7 @@ const Oe = ({
4167
4167
  className: `w-2.5 h-2.5 rounded-full ${S.online ? "bg-green-300" : "bg-gray-300"}`
4168
4168
  }
4169
4169
  ),
4170
- ne(Fe, x ? s : I, I)
4170
+ J(Fe, x ? s : I, I)
4171
4171
  ]
4172
4172
  }
4173
4173
  ),
@@ -4190,7 +4190,7 @@ const Oe = ({
4190
4190
  /* @__PURE__ */ a(Ka, { fill: "orange", className: "w-3 h-3" }),
4191
4191
  /* @__PURE__ */ a("b", { children: " Primary" })
4192
4192
  ] }) : /* @__PURE__ */ a("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ a(
4193
- Oe,
4193
+ Ue,
4194
4194
  {
4195
4195
  permissions: [
4196
4196
  ce.EDIT_PAGE,
@@ -4216,7 +4216,7 @@ const Oe = ({
4216
4216
  ),
4217
4217
  /* @__PURE__ */ c(Jt, { align: "end", className: "text-sm", children: [
4218
4218
  /* @__PURE__ */ a(
4219
- Oe,
4219
+ Ue,
4220
4220
  {
4221
4221
  permissions: [ce.EDIT_PAGE],
4222
4222
  children: /* @__PURE__ */ c(
@@ -4235,7 +4235,7 @@ const Oe = ({
4235
4235
  }
4236
4236
  ),
4237
4237
  /* @__PURE__ */ a(
4238
- Oe,
4238
+ Ue,
4239
4239
  {
4240
4240
  permissions: [ce.UNPUBLISH_PAGE],
4241
4241
  children: (S == null ? void 0 : S.online) && /* @__PURE__ */ c(
@@ -4254,7 +4254,7 @@ const Oe = ({
4254
4254
  }
4255
4255
  ),
4256
4256
  /* @__PURE__ */ a(
4257
- Oe,
4257
+ Ue,
4258
4258
  {
4259
4259
  permissions: [ce.DELETE_PAGE],
4260
4260
  children: /* @__PURE__ */ c(
@@ -4283,7 +4283,7 @@ const Oe = ({
4283
4283
  /* @__PURE__ */ a("div", { className: "h-1 w-full border-b" })
4284
4284
  ] });
4285
4285
  }) }),
4286
- /* @__PURE__ */ a(Oe, { permissions: [ce.ADD_PAGE], children: /* @__PURE__ */ a("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ a(
4286
+ /* @__PURE__ */ a(Ue, { permissions: [ce.ADD_PAGE], children: /* @__PURE__ */ a("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ a(
4287
4287
  H,
4288
4288
  {
4289
4289
  variant: "default",
@@ -4638,11 +4638,11 @@ const Qo = ({
4638
4638
  const { data: u } = Te(), { hasPermission: d } = xn(), f = ae(
4639
4639
  () => me(u, { key: t.pageType }),
4640
4640
  [u, t.pageType]
4641
- ), m = ne(t, "slug").replace(e, "") || "/", w = !d(ce.EDIT_PAGE) && !d(ce.DELETE_PAGE) && !d(ce.UNPUBLISH_PAGE);
4641
+ ), m = J(t, "slug").replace(e, "") || "/", w = !d(ce.EDIT_PAGE) && !d(ce.DELETE_PAGE) && !d(ce.UNPUBLISH_PAGE);
4642
4642
  return /* @__PURE__ */ c(
4643
4643
  "div",
4644
4644
  {
4645
- onClick: () => s(ne(t, "id")),
4645
+ onClick: () => s(J(t, "id")),
4646
4646
  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"}`,
4647
4647
  children: [
4648
4648
  /* @__PURE__ */ c("div", { className: "flex items-center gap-x-2", children: [
@@ -4826,7 +4826,7 @@ const Qo = ({
4826
4826
  ),
4827
4827
  /* @__PURE__ */ a(Vn, { align: "end", children: ke(
4828
4828
  Zs([{ key: "all", name: "All" }], v),
4829
- (N) => /* @__PURE__ */ a(qn, { value: ne(N, "key"), children: ne(N, "name") })
4829
+ (N) => /* @__PURE__ */ a(qn, { value: J(N, "key"), children: J(N, "name") })
4830
4830
  ) })
4831
4831
  ] })
4832
4832
  ] }),
@@ -4865,8 +4865,8 @@ const Qo = ({
4865
4865
  setSaveAsTemp: S
4866
4866
  }
4867
4867
  ),
4868
- /* @__PURE__ */ a("div", { className: "pt-2 pl-6 bg-white", children: ke(ne(N, "children", []), (k) => {
4869
- const V = x === ne(k, "id");
4868
+ /* @__PURE__ */ a("div", { className: "pt-2 pl-6 bg-white", children: ke(J(N, "children", []), (k) => {
4869
+ const V = x === J(k, "id");
4870
4870
  return /* @__PURE__ */ a(
4871
4871
  Mn,
4872
4872
  {
@@ -4923,7 +4923,7 @@ const Qo = ({
4923
4923
  const e = Re("logo", null);
4924
4924
  return e ? /* @__PURE__ */ a("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: zs.createElement(e, {}) }) : null;
4925
4925
  }, Zo = () => {
4926
- const [e] = Ge(), t = e.get("page"), { data: n, isFetching: s } = Ue(), [r, i] = M(!1), l = !!t && !ue(n), o = !t || !s && ue(n) || r;
4926
+ const [e] = Ge(), t = e.get("page"), { data: n, isFetching: s } = Oe(), [r, i] = M(!1), l = !!t && !ue(n), o = !t || !s && ue(n) || r;
4927
4927
  return /* @__PURE__ */ c(ge, { children: [
4928
4928
  /* @__PURE__ */ c(
4929
4929
  H,
@@ -4935,7 +4935,7 @@ const Qo = ({
4935
4935
  /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(Ja, { className: "h-4 w-4" }) }),
4936
4936
  /* @__PURE__ */ c("span", { className: "truncate leading-tight flex items-center max-w-[200px]", children: [
4937
4937
  /* @__PURE__ */ a("span", { className: "text-slate-600 pr-1 font-light", children: "Editing:" }),
4938
- s ? /* @__PURE__ */ a(sr, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : ns(ne(n, "name")) ?? ""
4938
+ s ? /* @__PURE__ */ a(sr, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : ns(J(n, "name")) ?? ""
4939
4939
  ] })
4940
4940
  ]
4941
4941
  },
@@ -4972,13 +4972,13 @@ const Qo = ({
4972
4972
  const p = new URLSearchParams(window.location.search), b = p.get("lang");
4973
4973
  b && (t.includes(b) ? s(b) : (p.delete("lang"), i(p), s("")));
4974
4974
  }, [t, i, s]);
4975
- const [l, o] = M(null), { data: u } = Ue(), { data: d } = nn(), { data: f, isFetching: m } = sn(), w = ae(() => {
4975
+ const [l, o] = M(null), { data: u } = Oe(), { data: d } = nn(), { data: f, isFetching: m } = sn(), w = ae(() => {
4976
4976
  const p = Xs(
4977
- ke(ne(d, "languages"), (b) => {
4977
+ ke(J(d, "languages"), (b) => {
4978
4978
  const S = me(f, { lang: b });
4979
4979
  return {
4980
4980
  key: b,
4981
- value: ne(Fe, b, b),
4981
+ value: J(Fe, b, b),
4982
4982
  isLangPageAdded: !!S
4983
4983
  };
4984
4984
  })
@@ -4986,7 +4986,7 @@ const Qo = ({
4986
4986
  return [
4987
4987
  {
4988
4988
  key: e,
4989
- value: ne(Fe, e),
4989
+ value: J(Fe, e),
4990
4990
  isLangPageAdded: !0
4991
4991
  },
4992
4992
  ...p
@@ -5002,7 +5002,7 @@ const Qo = ({
5002
5002
  /* @__PURE__ */ c(Xt, { children: [
5003
5003
  /* @__PURE__ */ a(Zt, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ c(H, { variant: "ghost", size: "sm", className: "gap-2", children: [
5004
5004
  /* @__PURE__ */ a(ei, { className: "w-4 h-4" }),
5005
- ne(Fe, r, r),
5005
+ J(Fe, r, r),
5006
5006
  /* @__PURE__ */ a(rr, { className: "w-4 h-4" })
5007
5007
  ] }) }),
5008
5008
  /* @__PURE__ */ c(Jt, { className: "border-border space-y-1", children: [
@@ -5125,7 +5125,7 @@ const nc = () => {
5125
5125
  });
5126
5126
  };
5127
5127
  function rc() {
5128
- const { data: e } = Ue(), { saveState: t } = js(), [n] = fs();
5128
+ const { data: e } = Oe(), { saveState: t } = js(), [n] = fs();
5129
5129
  return e ? /* @__PURE__ */ a("div", { className: "flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50 bg-primary/5 mb-4", children: /* @__PURE__ */ c("div", { className: "flex-1 space-y-1", children: [
5130
5130
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ a("p", { className: "text-sm flex items-center gap-1 font-medium leading-none", children: /* @__PURE__ */ a("span", { className: "font-bold", children: "Currently editing" }) }) }),
5131
5131
  /* @__PURE__ */ a("div", { className: "flex items-center text-xs text-muted-foreground", children: !ue(n.lastSaved) && /* @__PURE__ */ c("span", { children: [
@@ -5148,7 +5148,7 @@ function rc() {
5148
5148
  ] }) }) : null;
5149
5149
  }
5150
5150
  function ac() {
5151
- const [e, t] = oe.useState(!1), [n, s] = oe.useState(null), [r, i] = oe.useState(!1), [l, o] = oe.useState(!1), { data: u } = Ue(), {
5151
+ const [e, t] = oe.useState(!1), [n, s] = oe.useState(null), [r, i] = oe.useState(!1), [l, o] = oe.useState(!1), { data: u } = Oe(), {
5152
5152
  data: d,
5153
5153
  isFetching: f,
5154
5154
  error: m,
@@ -5280,7 +5280,7 @@ function lc({
5280
5280
  ] }) })
5281
5281
  ] }),
5282
5282
  /* @__PURE__ */ a(
5283
- Oe,
5283
+ Ue,
5284
5284
  {
5285
5285
  permissions: [
5286
5286
  ce.RESTORE_REVISION,
@@ -5309,11 +5309,11 @@ function oc({
5309
5309
  /* @__PURE__ */ a("span", { className: "sr-only", children: "More options" })
5310
5310
  ] }) }),
5311
5311
  /* @__PURE__ */ c(Jt, { align: "end", className: "text-xs", children: [
5312
- /* @__PURE__ */ a(Oe, { permission: ce.RESTORE_REVISION, children: /* @__PURE__ */ c(Pe, { onClick: t, className: "cursor-pointer", children: [
5312
+ /* @__PURE__ */ a(Ue, { permission: ce.RESTORE_REVISION, children: /* @__PURE__ */ c(Pe, { onClick: t, className: "cursor-pointer", children: [
5313
5313
  /* @__PURE__ */ a(ar, { className: "mr-2 h-4 w-4" }),
5314
5314
  /* @__PURE__ */ a("span", { children: "Restore this version" })
5315
5315
  ] }) }),
5316
- /* @__PURE__ */ a(Oe, { permission: ce.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ c(ge, { children: [
5316
+ /* @__PURE__ */ a(Ue, { permission: ce.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ c(ge, { children: [
5317
5317
  /* @__PURE__ */ a(Di, {}),
5318
5318
  /* @__PURE__ */ c(
5319
5319
  Pe,
@@ -5680,7 +5680,7 @@ function gc({ onClose: e }) {
5680
5680
  ] }) }) : null;
5681
5681
  }
5682
5682
  const pc = () => {
5683
- const { selectedLang: e } = ot(), t = Re("getPreviewUrl", async (f) => f), [n, s] = M(""), { data: r, isFetching: i } = Ue(), { data: l } = sn(), { data: o } = Te(), u = ae(
5683
+ const { selectedLang: e } = ot(), t = Re("getPreviewUrl", async (f) => f), [n, s] = M(""), { data: r, isFetching: i } = Oe(), { data: l } = sn(), { data: o } = Te(), u = ae(
5684
5684
  () => {
5685
5685
  var f;
5686
5686
  return (f = l == null ? void 0 : l.find((m) => (m == null ? void 0 : m.lang) === e)) == null ? void 0 : f.slug;
@@ -5777,7 +5777,7 @@ const pc = () => {
5777
5777
  }
5778
5778
  );
5779
5779
  }, vc = () => {
5780
- const [e, t] = M(!1), [n, s] = M(!1), [r, i] = M(null), { data: l } = Ue(), { mutate: o, isPending: u } = gs(), [d] = $s(), { buttonText: f, buttonClassName: m, isPublished: w } = ae(() => {
5780
+ const [e, t] = M(!1), [n, s] = M(!1), [r, i] = M(null), { data: l } = Oe(), { mutate: o, isPending: u } = gs(), [d] = $s(), { buttonText: f, buttonClassName: m, isPublished: w } = ae(() => {
5781
5781
  const p = l && (l == null ? void 0 : l.online);
5782
5782
  return {
5783
5783
  buttonClassName: p ? "hover:bg-green-600 bg-green-500" : "",
@@ -5899,7 +5899,7 @@ const pc = () => {
5899
5899
  /* @__PURE__ */ a("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
5900
5900
  ] }) : null;
5901
5901
  }, wc = () => {
5902
- const { data: e } = Ue(), t = e && (e == null ? void 0 : e.online), { data: n } = Te();
5902
+ const { data: e } = Oe(), t = e && (e == null ? void 0 : e.online), { data: n } = Te();
5903
5903
  return _e(
5904
5904
  (r) => {
5905
5905
  var i;
@@ -5925,11 +5925,11 @@ function bc() {
5925
5925
  const { isLocked: e } = tn(), [t] = Ge(), n = t.get("lang"), s = ra(n);
5926
5926
  return e || !s ? null : /* @__PURE__ */ c("div", { className: "flex items-center justify-end gap-1", children: [
5927
5927
  /* @__PURE__ */ a(ac, {}),
5928
- /* @__PURE__ */ a(Oe, { permission: ce.EDIT_THEME, children: /* @__PURE__ */ a(yc, {}) }),
5929
- /* @__PURE__ */ a(Oe, { permission: ce.EDIT_SETTINGS, children: /* @__PURE__ */ a(Sc, {}) }),
5928
+ /* @__PURE__ */ a(Ue, { permission: ce.EDIT_THEME, children: /* @__PURE__ */ a(yc, {}) }),
5929
+ /* @__PURE__ */ a(Ue, { permission: ce.EDIT_SETTINGS, children: /* @__PURE__ */ a(Sc, {}) }),
5930
5930
  /* @__PURE__ */ a(pc, {}),
5931
- /* @__PURE__ */ a(Oe, { permission: ce.SAVE_PAGE, children: /* @__PURE__ */ a(Ec, {}) }),
5932
- /* @__PURE__ */ a(Oe, { permission: ce.PUBLISH_PAGE, children: /* @__PURE__ */ a(vc, {}) }),
5931
+ /* @__PURE__ */ a(Ue, { permission: ce.SAVE_PAGE, children: /* @__PURE__ */ a(Ec, {}) }),
5932
+ /* @__PURE__ */ a(Ue, { permission: ce.PUBLISH_PAGE, children: /* @__PURE__ */ a(vc, {}) }),
5933
5933
  /* @__PURE__ */ a(wc, {})
5934
5934
  ] });
5935
5935
  }
@@ -5938,15 +5938,16 @@ const Nc = () => {
5938
5938
  return xe({
5939
5939
  queryKey: ["permissions", s],
5940
5940
  queryFn: () => t(e, {
5941
- action: _.GET_PERMISSIONS,
5941
+ action: _.GET_ROLE_AND_PERMISSIONS,
5942
5942
  data: { userId: s }
5943
5943
  }),
5944
- enabled: !!s
5944
+ enabled: !!s,
5945
+ staleTime: 0
5945
5946
  });
5946
5947
  }, ts = {}, Hs = (e, t) => {
5947
5948
  Tn(ts, e) && console.warn(`Panel ${e} already registered. Overriding...`), Ha(ts, e, { id: e, ...t });
5948
5949
  }, Ac = () => {
5949
- const { data: e } = Ue(), { data: t } = nn(), n = Po(e == null ? void 0 : e.pageType);
5950
+ const { data: e } = Oe(), { data: t } = nn(), n = Po(e == null ? void 0 : e.pageType);
5950
5951
  return ae(() => !n || !e || !t ? [] : Object.values(ts).filter(
5951
5952
  (s) => s.showIf({ page: e, pageType: n, websiteSetting: t })
5952
5953
  ).map((s) => Va(s, "showIf")), [t, n, e]);
@@ -5987,7 +5988,7 @@ function Ye({
5987
5988
  })).filter((p) => n === "value" ? p.type === "value" || p.type === "object" : n === "array" ? p.type === "array" || p.type === "object" : n === "object" ? p.type === "object" : !0), [u, n]);
5988
5989
  return /* @__PURE__ */ c(Gi, { open: r, onOpenChange: i, children: [
5989
5990
  /* @__PURE__ */ c(os, { children: [
5990
- /* @__PURE__ */ a(cs, { asChild: !0, children: /* @__PURE__ */ a(Ui, { asChild: !0, children: /* @__PURE__ */ a(
5991
+ /* @__PURE__ */ a(cs, { asChild: !0, children: /* @__PURE__ */ a(Oi, { asChild: !0, children: /* @__PURE__ */ a(
5991
5992
  H,
5992
5993
  {
5993
5994
  size: "sm",
@@ -6001,7 +6002,7 @@ function Ye({
6001
6002
  ) }) }),
6002
6003
  /* @__PURE__ */ a(us, { children: "Add field" })
6003
6004
  ] }),
6004
- /* @__PURE__ */ a(Oi, { className: "w-[200px] p-0", children: /* @__PURE__ */ c(Ri, { children: [
6005
+ /* @__PURE__ */ a(Ui, { className: "w-[200px] p-0", children: /* @__PURE__ */ c(Ri, { children: [
6005
6006
  /* @__PURE__ */ a(Mi, { className: "border-none", placeholder: "Search..." }),
6006
6007
  /* @__PURE__ */ c(Bi, { children: [
6007
6008
  /* @__PURE__ */ a(Fi, { children: "No option found." }),
@@ -6067,7 +6068,7 @@ const Pc = (e, t) => {
6067
6068
  newCursorPos: E
6068
6069
  };
6069
6070
  }, da = () => {
6070
- const { t: e } = Ta(), { selectedLang: t, fallbackLang: n, languages: s } = ot(), { data: r } = Ue(), { data: i } = sa({
6071
+ const { t: e } = Ta(), { selectedLang: t, fallbackLang: n, languages: s } = ot(), { data: r } = Oe(), { data: i } = sa({
6071
6072
  lang: t || n,
6072
6073
  pageType: r == null ? void 0 : r.pageType
6073
6074
  }), { data: l, isFetching: o } = Cc(), u = l == null ? void 0 : l.seo, d = yn(
@@ -6167,7 +6168,7 @@ const Pc = (e, t) => {
6167
6168
  "  ",
6168
6169
  s.length > 0 && /* @__PURE__ */ c("span", { className: "font-semibold text-blue-500", children: [
6169
6170
  "(",
6170
- ne(Fe, E, E),
6171
+ J(Fe, E, E),
6171
6172
  ")"
6172
6173
  ] })
6173
6174
  ] }),
@@ -6523,7 +6524,7 @@ const _c = "seo", Ic = {
6523
6524
  Pa();
6524
6525
  Lc();
6525
6526
  const kc = (e) => {
6526
- const t = yn([]), [n] = Ge(), s = n.get("page"), r = n.get("lang"), { data: i } = Ue(), { data: l = null } = Nc(), { data: o } = Io(), { data: u, isFetching: d } = na(), { blocks: f } = To(u), { data: m } = nn(), { data: w } = Te(), { mutateAsync: E } = ea(), p = No(), { getUILibraryBlock: b, getUILibraryBlocks: S, onSave: I } = Lo(), { getPartialBlocks: A, getPartialBlockBlocks: x } = ko(), { aiContext: v, setAiContext: C } = hs(), { mutateAsync: B } = _o(), [T, L] = M(!1), N = ae(
6527
+ const t = yn([]), [n] = Ge(), s = n.get("page"), r = n.get("lang"), { data: i } = Oe(), { data: l = null } = Nc(), { data: o } = Io(), { data: u, isFetching: d } = na(), { blocks: f } = To(u), { data: m } = nn(), { data: w } = Te(), { mutateAsync: E } = ea(), p = No(), { getUILibraryBlock: b, getUILibraryBlocks: S, onSave: I } = Lo(), { getPartialBlocks: A, getPartialBlockBlocks: x } = ko(), { aiContext: v, setAiContext: C } = hs(), { mutateAsync: B } = _o(), [T, L] = M(!1), N = ae(
6527
6528
  () => (m == null ? void 0 : m.fallbackLang) || "en",
6528
6529
  [m]
6529
6530
  ), { data: k } = sa({
@@ -6538,12 +6539,12 @@ const kc = (e) => {
6538
6539
  }, []), t.current = f;
6539
6540
  const V = ae(() => {
6540
6541
  const D = {};
6541
- return e.mediaManagerComponent && (D.mediaManagerComponent = e.mediaManagerComponent), l && (D.permissions = l), D;
6542
+ return e.mediaManagerComponent && (D.mediaManagerComponent = e.mediaManagerComponent), l && (D.permissions = J(l, "permissions", []), D.role = J(l, "role", "")), D;
6542
6543
  }, [e.mediaManagerComponent, l]), W = ae(() => Array.isArray(e == null ? void 0 : e.uiLibraries) ? [...o, ...e == null ? void 0 : e.uiLibraries] : o, [o, e == null ? void 0 : e.uiLibraries]), We = _e(
6543
6544
  async (D, Se) => await B({ pageType: D, query: Se }),
6544
6545
  [B]
6545
6546
  ), pe = ae(
6546
- () => ne(m, "theme", {}) || {},
6547
+ () => J(m, "theme", {}) || {},
6547
6548
  [m]
6548
6549
  ), y = Ac();
6549
6550
  return /* @__PURE__ */ c(ge, { children: [
@@ -6602,7 +6603,7 @@ const kc = (e) => {
6602
6603
  bottom: [
6603
6604
  ...e != null && e.sidebarBottomComponents ? [...e.sidebarBottomComponents] : [],
6604
6605
  Go,
6605
- Uo
6606
+ Oo
6606
6607
  // TODO: Check why the component is not showing. This is working as of now.
6607
6608
  ]
6608
6609
  },
@@ -6667,9 +6668,9 @@ export {
6667
6668
  gn as U,
6668
6669
  Yc as V,
6669
6670
  wu as W,
6670
- Oe as X,
6671
+ Ue as X,
6671
6672
  Hs as Y,
6672
- Ue as Z,
6673
+ Oe as Z,
6673
6674
  sn as _,
6674
6675
  Pr as a,
6675
6676
  kn as a0,
@@ -6690,7 +6691,7 @@ export {
6690
6691
  Wn as k,
6691
6692
  Jc as l,
6692
6693
  yu as m,
6693
- Ut as n,
6694
+ Ot as n,
6694
6695
  Wc as o,
6695
6696
  Yi as p,
6696
6697
  Pl as q,