@chaibuilder/sdk 1.2.23 → 1.2.24
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/{AddBlocks-b0Vk6eqO.js → AddBlocks-l1JENNvq.js} +2 -2
- package/dist/{AddBlocks-bgu08YJC.cjs → AddBlocks-zPPKkeKs.cjs} +1 -1
- package/dist/{BrandingOptions-AljW1cXz.cjs → BrandingOptions-DkpqGARR.cjs} +1 -1
- package/dist/{BrandingOptions-eUSoIgjj.js → BrandingOptions-udtH5yJs.js} +3 -3
- package/dist/{CanvasArea-ulUy_rmB.js → CanvasArea-IqeMbtOf.js} +3 -3
- package/dist/{CanvasArea-dp1tzDkK.cjs → CanvasArea-plZTWifU.cjs} +1 -1
- package/dist/CurrentPage-7_s9LtEJ.cjs +1 -0
- package/dist/{CurrentPage-SFhXzQMy.js → CurrentPage-AA0XHYMU.js} +20 -20
- package/dist/{ListTree-5n8U4-IF.cjs → ListTree-LAN7QmHQ.cjs} +1 -1
- package/dist/{ListTree-ZeVWczTF.js → ListTree-ZNEtds1d.js} +4 -4
- package/dist/{PagesPanel-sBN51kKZ.cjs → PagesPanel-5qMZBatP.cjs} +1 -1
- package/dist/{PagesPanel-IkZjy0Gn.js → PagesPanel-883P3_su.js} +5 -5
- package/dist/{ProjectPanel-e98TJLfI.js → ProjectPanel-Y8Qcmsn0.js} +6 -6
- package/dist/{ProjectPanel-lbQH31jc.cjs → ProjectPanel-otQb9ceP.cjs} +1 -1
- package/dist/{Settings-qytQoyTv.cjs → Settings-Rt342VJ3.cjs} +1 -1
- package/dist/{Settings-FZWm8Fc3.js → Settings-pIePR1Id.js} +2 -2
- package/dist/{SidePanels-wrkkpcGE.js → SidePanels-NznSn5RN.js} +5 -5
- package/dist/SidePanels-PaQkgjLa.cjs +1 -0
- package/dist/Topbar-CqW7G360.cjs +1 -0
- package/dist/{Topbar-LUyDFBkK.js → Topbar-pWzBEOed.js} +37 -34
- package/dist/{UnsplashImages-f-ObKOC-.cjs → UnsplashImages-NGskB93R.cjs} +1 -1
- package/dist/{UnsplashImages-eZedbK2J.js → UnsplashImages-qvwFbV-E.js} +3 -3
- package/dist/{UploadImages-71QziLbr.js → UploadImages-9NapgXBq.js} +3 -3
- package/dist/{UploadImages-oOnccvT9.cjs → UploadImages-Oh7Glr9A.cjs} +1 -1
- package/dist/{add-page-modal-yQ6qL6Ui.js → add-page-modal-4PiRJgX5.js} +6 -6
- package/dist/{add-page-modal-g3fd00P5.cjs → add-page-modal-4o2L_7T7.cjs} +1 -1
- package/dist/{confirm-alert-LQsGNYz8.cjs → confirm-alert-C4M9eF-o.cjs} +1 -1
- package/dist/{confirm-alert-3flAvzWH.js → confirm-alert-GUhZ_G8w.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +4 -3
- package/dist/core.js +3 -3
- package/dist/{delete-page-modal-iMmkPec0.js → delete-page-modal-4l5-RhQB.js} +5 -5
- package/dist/{delete-page-modal-tzZmqGzE.cjs → delete-page-modal-Bek5bCf-.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +2 -1
- package/dist/email.js +3 -3
- package/dist/{form-zKUMQFuB.js → form-STUz-6nE.js} +1 -1
- package/dist/{form-LBHtTduy.cjs → form-lBQ_76Uw.cjs} +1 -1
- package/dist/{index-HD1UKc4P.js → index-Gk6sASBd.js} +520 -519
- package/dist/{index-bOWwCMRF.cjs → index-dgm-fd8U.cjs} +2 -2
- package/dist/{index-uLtBNl55.js → index-gS-3liKK.js} +2 -2
- package/dist/index-h-hd6EvN.cjs +1 -0
- package/dist/index-oCYKBYyT.cjs +1 -0
- package/dist/{index-m4WGov7e.js → index-xZWaF8AW.js} +118 -119
- package/dist/{page-viewer-5gTszT-n.cjs → page-viewer-JlKEwACu.cjs} +1 -1
- package/dist/{page-viewer-7AwzWRtB.js → page-viewer-rCXavxpd.js} +6 -6
- package/dist/{project-general-setting-52CTYL_w.cjs → project-general-setting-2FGoUZ-z.cjs} +1 -1
- package/dist/{project-general-setting-pYPoqvqd.js → project-general-setting-rmAVpDu9.js} +6 -6
- package/dist/{project-seo-setting-jTweI1DX.cjs → project-seo-setting-mlxL_e2_.cjs} +1 -1
- package/dist/{project-seo-setting-zXKOcjep.js → project-seo-setting-pX34Qsym.js} +4 -4
- package/dist/{single-page-detail-jy2SPcp1.cjs → single-page-detail-c6-wRWyN.cjs} +1 -1
- package/dist/{single-page-detail-q2TDxN-P.js → single-page-detail-rSQomrY5.js} +7 -7
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +2 -1
- package/dist/studio.js +4 -4
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +3 -3
- package/package.json +1 -1
- package/dist/CurrentPage-rWHgPomd.cjs +0 -1
- package/dist/SidePanels-YRIM1IPq.cjs +0 -1
- package/dist/Topbar-NOSnWo7V.cjs +0 -1
- package/dist/index--dUsFH1I.cjs +0 -1
- package/dist/index-fvMaxES9.cjs +0 -1
|
@@ -18,13 +18,14 @@ var v2 = (a, t, h, v) => ({
|
|
|
18
18
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
19
19
|
import * as b from "react";
|
|
20
20
|
import H0, { lazy as A2, useCallback as g2, useState as M2, Suspense as u0, useEffect as s0 } from "react";
|
|
21
|
-
import { C as p0 } from "./index-
|
|
21
|
+
import { C as p0 } from "./index-gS-3liKK.js";
|
|
22
22
|
import { FileTextIcon as V0, GearIcon as f0, EyeClosedIcon as m0, EyeOpenIcon as L0 } from "@radix-ui/react-icons";
|
|
23
|
-
import { u as x0, B as Y2, A as w0, a as B0, b as C0, c as O0, d as A0, e as S0, f as y0, g as b0, h as P0 } from "./index-
|
|
23
|
+
import { u as x0, B as Y2, A as w0, a as B0, b as C0, c as O0, d as A0, e as S0, f as y0, g as b0, h as P0 } from "./index-Gk6sASBd.js";
|
|
24
24
|
import { toast as h1, Toaster as F0 } from "sonner";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
25
|
+
import { useTranslation as D0 } from "react-i18next";
|
|
26
|
+
import { sortBy as R0, filter as k0, has as T0, set as E0, capitalize as N0, get as b2, omit as I0, size as P2 } from "lodash-es";
|
|
27
|
+
import { g as W0 } from "./html-to-json-ngX9ef2u.js";
|
|
28
|
+
import { Loader as U0, Loader2 as j0, LogOutIcon as Q0 } from "lucide-react";
|
|
28
29
|
import { G as X2 } from "./index-YpnaudSM.js";
|
|
29
30
|
var N1 = class {
|
|
30
31
|
constructor() {
|
|
@@ -45,7 +46,7 @@ var N1 = class {
|
|
|
45
46
|
}, E1 = typeof window > "u" || "Deno" in window;
|
|
46
47
|
function K() {
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function K0(a, t) {
|
|
49
50
|
return typeof a == "function" ? a(t) : a;
|
|
50
51
|
}
|
|
51
52
|
function H2(a) {
|
|
@@ -151,15 +152,15 @@ function T2(a) {
|
|
|
151
152
|
function s2(a, t, h) {
|
|
152
153
|
return typeof h.structuralSharing == "function" ? h.structuralSharing(a, t) : h.structuralSharing !== !1 ? a0(a, t) : t;
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
+
function G0(a, t, h = 0) {
|
|
155
156
|
const v = [...a, t];
|
|
156
157
|
return h && v.length > h ? v.slice(1) : v;
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function q0(a, t, h = 0) {
|
|
159
160
|
const v = [t, ...a];
|
|
160
161
|
return h && v.length > h ? v.slice(0, -1) : v;
|
|
161
162
|
}
|
|
162
|
-
var g1, c1, L1, U2,
|
|
163
|
+
var g1, c1, L1, U2, _0 = (U2 = class extends N1 {
|
|
163
164
|
constructor() {
|
|
164
165
|
super();
|
|
165
166
|
d(this, g1, void 0);
|
|
@@ -199,7 +200,7 @@ var g1, c1, L1, U2, q0 = (U2 = class extends N1 {
|
|
|
199
200
|
var t;
|
|
200
201
|
return typeof c(this, g1) == "boolean" ? c(this, g1) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
201
202
|
}
|
|
202
|
-
}, g1 = new WeakMap(), c1 = new WeakMap(), L1 = new WeakMap(), U2), l2 = new
|
|
203
|
+
}, g1 = new WeakMap(), c1 = new WeakMap(), L1 = new WeakMap(), U2), l2 = new _0(), x1, r1, w1, j2, $0 = (j2 = class extends N1 {
|
|
203
204
|
constructor() {
|
|
204
205
|
super();
|
|
205
206
|
d(this, x1, !0);
|
|
@@ -233,8 +234,8 @@ var g1, c1, L1, U2, q0 = (U2 = class extends N1 {
|
|
|
233
234
|
isOnline() {
|
|
234
235
|
return c(this, x1);
|
|
235
236
|
}
|
|
236
|
-
}, x1 = new WeakMap(), r1 = new WeakMap(), w1 = new WeakMap(), j2), i2 = new
|
|
237
|
-
function
|
|
237
|
+
}, x1 = new WeakMap(), r1 = new WeakMap(), w1 = new WeakMap(), j2), i2 = new $0();
|
|
238
|
+
function J0(a) {
|
|
238
239
|
return Math.min(1e3 * 2 ** a, 3e4);
|
|
239
240
|
}
|
|
240
241
|
function d2(a) {
|
|
@@ -287,7 +288,7 @@ function c0(a) {
|
|
|
287
288
|
var k;
|
|
288
289
|
if (v)
|
|
289
290
|
return;
|
|
290
|
-
const O = a.retry ?? (E1 ? 0 : 3), f = a.retryDelay ??
|
|
291
|
+
const O = a.retry ?? (E1 ? 0 : 3), f = a.retryDelay ?? J0, m = typeof f == "function" ? f(h, u) : f, P = O === !0 || typeof O == "number" && h < O || typeof O == "function" && O(h, u);
|
|
291
292
|
if (t || !P) {
|
|
292
293
|
H(u);
|
|
293
294
|
return;
|
|
@@ -308,7 +309,7 @@ function c0(a) {
|
|
|
308
309
|
continueRetry: z
|
|
309
310
|
};
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
+
function Z0() {
|
|
312
313
|
let a = [], t = 0, h = (z) => {
|
|
313
314
|
z();
|
|
314
315
|
}, v = (z) => {
|
|
@@ -353,7 +354,7 @@ function J0() {
|
|
|
353
354
|
}
|
|
354
355
|
};
|
|
355
356
|
}
|
|
356
|
-
var S =
|
|
357
|
+
var S = Z0(), M1, Q2, r0 = (Q2 = class {
|
|
357
358
|
constructor() {
|
|
358
359
|
d(this, M1, void 0);
|
|
359
360
|
}
|
|
@@ -374,7 +375,7 @@ var S = J0(), M1, Q2, r0 = (Q2 = class {
|
|
|
374
375
|
clearGcTimeout() {
|
|
375
376
|
c(this, M1) && (clearTimeout(c(this, M1)), l(this, M1, void 0));
|
|
376
377
|
}
|
|
377
|
-
}, M1 = new WeakMap(), Q2), B1, C1, W, n1, U, y, j1, o1, O1, c2, q, t1, K2,
|
|
378
|
+
}, M1 = new WeakMap(), Q2), B1, C1, W, n1, U, y, j1, o1, O1, c2, q, t1, K2, Y0 = (K2 = class extends r0 {
|
|
378
379
|
constructor(t) {
|
|
379
380
|
super();
|
|
380
381
|
d(this, O1);
|
|
@@ -387,7 +388,7 @@ var S = J0(), M1, Q2, r0 = (Q2 = class {
|
|
|
387
388
|
d(this, y, void 0);
|
|
388
389
|
d(this, j1, void 0);
|
|
389
390
|
d(this, o1, void 0);
|
|
390
|
-
l(this, o1, !1), l(this, j1, t.defaultOptions), o(this, O1, c2).call(this, t.options), l(this, y, []), l(this, W, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, l(this, B1, t.state ||
|
|
391
|
+
l(this, o1, !1), l(this, j1, t.defaultOptions), o(this, O1, c2).call(this, t.options), l(this, y, []), l(this, W, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, l(this, B1, t.state || X0(this.options)), this.state = c(this, B1), this.scheduleGc();
|
|
391
392
|
}
|
|
392
393
|
get meta() {
|
|
393
394
|
return this.options.meta;
|
|
@@ -625,7 +626,7 @@ var S = J0(), M1, Q2, r0 = (Q2 = class {
|
|
|
625
626
|
}), c(this, W).notify({ query: this, type: "updated", action: t });
|
|
626
627
|
});
|
|
627
628
|
}, K2);
|
|
628
|
-
function
|
|
629
|
+
function X0(a) {
|
|
629
630
|
const t = typeof a.initialData == "function" ? a.initialData() : a.initialData, h = typeof t < "u", v = h ? typeof a.initialDataUpdatedAt == "function" ? a.initialDataUpdatedAt() : a.initialDataUpdatedAt : 0;
|
|
630
631
|
return {
|
|
631
632
|
data: t,
|
|
@@ -642,7 +643,7 @@ function Y0(a) {
|
|
|
642
643
|
fetchStatus: "idle"
|
|
643
644
|
};
|
|
644
645
|
}
|
|
645
|
-
var $, G2,
|
|
646
|
+
var $, G2, t4 = (G2 = class extends N1 {
|
|
646
647
|
constructor(t = {}) {
|
|
647
648
|
super();
|
|
648
649
|
d(this, $, void 0);
|
|
@@ -651,7 +652,7 @@ var $, G2, X0 = (G2 = class extends N1 {
|
|
|
651
652
|
build(t, h, v) {
|
|
652
653
|
const r = h.queryKey, n = h.queryHash ?? S2(r, h);
|
|
653
654
|
let e = this.get(n);
|
|
654
|
-
return e || (e = new
|
|
655
|
+
return e || (e = new Y0({
|
|
655
656
|
cache: this,
|
|
656
657
|
queryKey: r,
|
|
657
658
|
queryHash: n,
|
|
@@ -714,7 +715,7 @@ var $, G2, X0 = (G2 = class extends N1 {
|
|
|
714
715
|
});
|
|
715
716
|
});
|
|
716
717
|
}
|
|
717
|
-
}, $ = new WeakMap(), G2), J, Q1, N, A1, Z, v1, q2,
|
|
718
|
+
}, $ = new WeakMap(), G2), J, Q1, N, A1, Z, v1, q2, a4 = (q2 = class extends r0 {
|
|
718
719
|
constructor(t) {
|
|
719
720
|
super();
|
|
720
721
|
d(this, Z);
|
|
@@ -907,7 +908,7 @@ function n0() {
|
|
|
907
908
|
submittedAt: 0
|
|
908
909
|
};
|
|
909
910
|
}
|
|
910
|
-
var j, K1, H1, _2,
|
|
911
|
+
var j, K1, H1, _2, h4 = (_2 = class extends N1 {
|
|
911
912
|
constructor(t = {}) {
|
|
912
913
|
super();
|
|
913
914
|
d(this, j, void 0);
|
|
@@ -916,7 +917,7 @@ var j, K1, H1, _2, a4 = (_2 = class extends N1 {
|
|
|
916
917
|
this.config = t, l(this, j, []), l(this, K1, 0);
|
|
917
918
|
}
|
|
918
919
|
build(t, h, v) {
|
|
919
|
-
const r = new
|
|
920
|
+
const r = new a4({
|
|
920
921
|
mutationCache: this,
|
|
921
922
|
mutationId: ++v2(this, K1)._,
|
|
922
923
|
options: t.defaultMutationOptions(h),
|
|
@@ -972,7 +973,7 @@ var j, K1, H1, _2, a4 = (_2 = class extends N1 {
|
|
|
972
973
|
})), c(this, H1);
|
|
973
974
|
}
|
|
974
975
|
}, j = new WeakMap(), K1 = new WeakMap(), H1 = new WeakMap(), _2);
|
|
975
|
-
function
|
|
976
|
+
function v4(a) {
|
|
976
977
|
return {
|
|
977
978
|
onFetch: (t, h) => {
|
|
978
979
|
const v = async () => {
|
|
@@ -1002,7 +1003,7 @@ function h4(a) {
|
|
|
1002
1003
|
z(k);
|
|
1003
1004
|
const C = await x(
|
|
1004
1005
|
k
|
|
1005
|
-
), { maxPages: w } = t.options, X = P ?
|
|
1006
|
+
), { maxPages: w } = t.options, X = P ? q0 : G0;
|
|
1006
1007
|
return {
|
|
1007
1008
|
pages: X(f.pages, C, w),
|
|
1008
1009
|
pageParams: X(f.pageParams, m, w)
|
|
@@ -1010,7 +1011,7 @@ function h4(a) {
|
|
|
1010
1011
|
};
|
|
1011
1012
|
let H;
|
|
1012
1013
|
if (n && e.length) {
|
|
1013
|
-
const f = n === "backward", m = f ?
|
|
1014
|
+
const f = n === "backward", m = f ? c4 : E2, P = {
|
|
1014
1015
|
pages: e,
|
|
1015
1016
|
pageParams: g
|
|
1016
1017
|
}, k = m(r, P);
|
|
@@ -1053,7 +1054,7 @@ function E2(a, { pages: t, pageParams: h }) {
|
|
|
1053
1054
|
h
|
|
1054
1055
|
);
|
|
1055
1056
|
}
|
|
1056
|
-
function
|
|
1057
|
+
function c4(a, { pages: t, pageParams: h }) {
|
|
1057
1058
|
var v;
|
|
1058
1059
|
return (v = a.getPreviousPageParam) == null ? void 0 : v.call(
|
|
1059
1060
|
a,
|
|
@@ -1063,7 +1064,7 @@ function v4(a, { pages: t, pageParams: h }) {
|
|
|
1063
1064
|
h
|
|
1064
1065
|
);
|
|
1065
1066
|
}
|
|
1066
|
-
var A, l1, i1, S1, y1, e1, b1, P1, $2,
|
|
1067
|
+
var A, l1, i1, S1, y1, e1, b1, P1, $2, r4 = ($2 = class {
|
|
1067
1068
|
constructor(a = {}) {
|
|
1068
1069
|
d(this, A, void 0);
|
|
1069
1070
|
d(this, l1, void 0);
|
|
@@ -1073,7 +1074,7 @@ var A, l1, i1, S1, y1, e1, b1, P1, $2, c4 = ($2 = class {
|
|
|
1073
1074
|
d(this, e1, void 0);
|
|
1074
1075
|
d(this, b1, void 0);
|
|
1075
1076
|
d(this, P1, void 0);
|
|
1076
|
-
l(this, A, a.queryCache || new
|
|
1077
|
+
l(this, A, a.queryCache || new t4()), l(this, l1, a.mutationCache || new h4()), l(this, i1, a.defaultOptions || {}), l(this, S1, /* @__PURE__ */ new Map()), l(this, y1, /* @__PURE__ */ new Map()), l(this, e1, 0);
|
|
1077
1078
|
}
|
|
1078
1079
|
mount() {
|
|
1079
1080
|
v2(this, e1)._++, c(this, e1) === 1 && (l(this, b1, l2.subscribe(() => {
|
|
@@ -1107,7 +1108,7 @@ var A, l1, i1, S1, y1, e1, b1, P1, $2, c4 = ($2 = class {
|
|
|
1107
1108
|
});
|
|
1108
1109
|
}
|
|
1109
1110
|
setQueryData(a, t, h) {
|
|
1110
|
-
const v = c(this, A).find({ queryKey: a }), r = v == null ? void 0 : v.state.data, n =
|
|
1111
|
+
const v = c(this, A).find({ queryKey: a }), r = v == null ? void 0 : v.state.data, n = K0(t, r);
|
|
1111
1112
|
if (typeof n > "u")
|
|
1112
1113
|
return;
|
|
1113
1114
|
const e = this.defaultQueryOptions({ queryKey: a });
|
|
@@ -1183,7 +1184,7 @@ var A, l1, i1, S1, y1, e1, b1, P1, $2, c4 = ($2 = class {
|
|
|
1183
1184
|
return this.fetchQuery(a).then(K).catch(K);
|
|
1184
1185
|
}
|
|
1185
1186
|
fetchInfiniteQuery(a) {
|
|
1186
|
-
return a.behavior =
|
|
1187
|
+
return a.behavior = v4(a.pages), this.fetchQuery(a);
|
|
1187
1188
|
}
|
|
1188
1189
|
prefetchInfiniteQuery(a) {
|
|
1189
1190
|
return this.fetchInfiniteQuery(a).then(K).catch(K);
|
|
@@ -1254,7 +1255,7 @@ var A, l1, i1, S1, y1, e1, b1, P1, $2, c4 = ($2 = class {
|
|
|
1254
1255
|
clear() {
|
|
1255
1256
|
c(this, A).clear(), c(this, l1).clear();
|
|
1256
1257
|
}
|
|
1257
|
-
}, A = new WeakMap(), l1 = new WeakMap(), i1 = new WeakMap(), S1 = new WeakMap(), y1 = new WeakMap(), e1 = new WeakMap(), b1 = new WeakMap(), P1 = new WeakMap(), $2), E, L, F1, D, u1, D1, Y, G1, R1, k1, s1, p1, d1, V1, f1, I1, q1, p2, _1, V2, $1, f2, J1, m2, Z1, L2, Y1, x2, X1, w2, e2, l0, J2,
|
|
1258
|
+
}, A = new WeakMap(), l1 = new WeakMap(), i1 = new WeakMap(), S1 = new WeakMap(), y1 = new WeakMap(), e1 = new WeakMap(), b1 = new WeakMap(), P1 = new WeakMap(), $2), E, L, F1, D, u1, D1, Y, G1, R1, k1, s1, p1, d1, V1, f1, I1, q1, p2, _1, V2, $1, f2, J1, m2, Z1, L2, Y1, x2, X1, w2, e2, l0, J2, n4 = (J2 = class extends N1 {
|
|
1258
1259
|
constructor(t, h) {
|
|
1259
1260
|
super();
|
|
1260
1261
|
d(this, f1);
|
|
@@ -1331,7 +1332,7 @@ var A, l1, i1, S1, y1, e1, b1, P1, $2, c4 = ($2 = class {
|
|
|
1331
1332
|
}
|
|
1332
1333
|
getOptimisticResult(t) {
|
|
1333
1334
|
const h = c(this, E).getQueryCache().build(c(this, E), t), v = this.createResult(h, t);
|
|
1334
|
-
return
|
|
1335
|
+
return i4(this, v) && (l(this, D, v), l(this, D1, this.options), l(this, u1, c(this, L).state)), v;
|
|
1335
1336
|
}
|
|
1336
1337
|
getCurrentResult() {
|
|
1337
1338
|
return c(this, D);
|
|
@@ -1500,11 +1501,11 @@ var A, l1, i1, S1, y1, e1, b1, P1, $2, c4 = ($2 = class {
|
|
|
1500
1501
|
});
|
|
1501
1502
|
});
|
|
1502
1503
|
}, J2);
|
|
1503
|
-
function
|
|
1504
|
+
function l4(a, t) {
|
|
1504
1505
|
return t.enabled !== !1 && !a.state.dataUpdatedAt && !(a.state.status === "error" && t.retryOnMount === !1);
|
|
1505
1506
|
}
|
|
1506
1507
|
function N2(a, t) {
|
|
1507
|
-
return
|
|
1508
|
+
return l4(a, t) || a.state.dataUpdatedAt > 0 && B2(a, t, t.refetchOnMount);
|
|
1508
1509
|
}
|
|
1509
1510
|
function B2(a, t, h) {
|
|
1510
1511
|
if (t.enabled !== !1) {
|
|
@@ -1519,10 +1520,10 @@ function I2(a, t, h, v) {
|
|
|
1519
1520
|
function y2(a, t) {
|
|
1520
1521
|
return a.isStaleByTime(t.staleTime);
|
|
1521
1522
|
}
|
|
1522
|
-
function
|
|
1523
|
+
function i4(a, t) {
|
|
1523
1524
|
return !n2(a.getCurrentResult(), t);
|
|
1524
1525
|
}
|
|
1525
|
-
var z1, T, Q, a1, T1, r2, t2, C2, Z2,
|
|
1526
|
+
var z1, T, Q, a1, T1, r2, t2, C2, Z2, e4 = (Z2 = class extends N1 {
|
|
1526
1527
|
constructor(t, h) {
|
|
1527
1528
|
super();
|
|
1528
1529
|
d(this, T1);
|
|
@@ -1613,13 +1614,13 @@ var i0 = b.createContext(
|
|
|
1613
1614
|
if (!t)
|
|
1614
1615
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1615
1616
|
return t;
|
|
1616
|
-
},
|
|
1617
|
+
}, d4 = ({
|
|
1617
1618
|
client: a,
|
|
1618
1619
|
children: t
|
|
1619
1620
|
}) => (b.useEffect(() => (a.mount(), () => {
|
|
1620
1621
|
a.unmount();
|
|
1621
|
-
}), [a]), /* @__PURE__ */ b.createElement(i0.Provider, { value: a }, t)), e0 = b.createContext(!1),
|
|
1622
|
-
function
|
|
1622
|
+
}), [a]), /* @__PURE__ */ b.createElement(i0.Provider, { value: a }, t)), e0 = b.createContext(!1), z4 = () => b.useContext(e0), et = e0.Provider;
|
|
1623
|
+
function g4() {
|
|
1623
1624
|
let a = !1;
|
|
1624
1625
|
return {
|
|
1625
1626
|
clearReset: () => {
|
|
@@ -1631,35 +1632,35 @@ function z4() {
|
|
|
1631
1632
|
isReset: () => a
|
|
1632
1633
|
};
|
|
1633
1634
|
}
|
|
1634
|
-
var
|
|
1635
|
+
var M4 = b.createContext(g4()), o4 = () => b.useContext(M4);
|
|
1635
1636
|
function d0(a, t) {
|
|
1636
1637
|
return typeof a == "function" ? a(...t) : !!a;
|
|
1637
1638
|
}
|
|
1638
|
-
var
|
|
1639
|
+
var H4 = (a, t) => {
|
|
1639
1640
|
(a.suspense || a.throwOnError) && (t.isReset() || (a.retryOnMount = !1));
|
|
1640
|
-
},
|
|
1641
|
+
}, u4 = (a) => {
|
|
1641
1642
|
b.useEffect(() => {
|
|
1642
1643
|
a.clearReset();
|
|
1643
1644
|
}, [a]);
|
|
1644
|
-
},
|
|
1645
|
+
}, s4 = ({
|
|
1645
1646
|
result: a,
|
|
1646
1647
|
errorResetBoundary: t,
|
|
1647
1648
|
throwOnError: h,
|
|
1648
1649
|
query: v
|
|
1649
1650
|
}) => a.isError && !t.isReset() && !a.isFetching && d0(h, [a.error, v]);
|
|
1650
|
-
var
|
|
1651
|
+
var p4 = (a) => {
|
|
1651
1652
|
a.suspense && typeof a.staleTime != "number" && (a.staleTime = 1e3);
|
|
1652
1653
|
};
|
|
1653
|
-
var
|
|
1654
|
+
var V4 = (a, t) => (a == null ? void 0 : a.suspense) && t.isPending, f4 = (a, t, h) => t.fetchOptimistic(a).catch(() => {
|
|
1654
1655
|
h.clearReset();
|
|
1655
1656
|
});
|
|
1656
|
-
function
|
|
1657
|
+
function m4(a, t, h) {
|
|
1657
1658
|
if (process.env.NODE_ENV !== "production" && (typeof a != "object" || Array.isArray(a)))
|
|
1658
1659
|
throw new Error(
|
|
1659
1660
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1660
1661
|
);
|
|
1661
|
-
const v = G(h), r =
|
|
1662
|
-
e._optimisticResults = r ? "isRestoring" : "optimistic",
|
|
1662
|
+
const v = G(h), r = z4(), n = o4(), e = v.defaultQueryOptions(a);
|
|
1663
|
+
e._optimisticResults = r ? "isRestoring" : "optimistic", p4(e), H4(e, n), u4(n);
|
|
1663
1664
|
const [g] = b.useState(
|
|
1664
1665
|
() => new t(
|
|
1665
1666
|
v,
|
|
@@ -1679,9 +1680,9 @@ function f4(a, t, h) {
|
|
|
1679
1680
|
() => g.getCurrentResult()
|
|
1680
1681
|
), b.useEffect(() => {
|
|
1681
1682
|
g.setOptions(e, { listeners: !1 });
|
|
1682
|
-
}, [e, g]),
|
|
1683
|
-
throw
|
|
1684
|
-
if (
|
|
1683
|
+
}, [e, g]), V4(e, s))
|
|
1684
|
+
throw f4(e, g, n);
|
|
1685
|
+
if (s4({
|
|
1685
1686
|
result: s,
|
|
1686
1687
|
errorResetBoundary: n,
|
|
1687
1688
|
throwOnError: e.throwOnError,
|
|
@@ -1691,11 +1692,11 @@ function f4(a, t, h) {
|
|
|
1691
1692
|
return e.notifyOnChangeProps ? s : g.trackResult(s);
|
|
1692
1693
|
}
|
|
1693
1694
|
function a2(a, t) {
|
|
1694
|
-
return
|
|
1695
|
+
return m4(a, n4, t);
|
|
1695
1696
|
}
|
|
1696
1697
|
function _(a, t) {
|
|
1697
1698
|
const h = G(t), [v] = b.useState(
|
|
1698
|
-
() => new
|
|
1699
|
+
() => new e4(
|
|
1699
1700
|
h,
|
|
1700
1701
|
a
|
|
1701
1702
|
)
|
|
@@ -1712,7 +1713,7 @@ function _(a, t) {
|
|
|
1712
1713
|
() => v.getCurrentResult()
|
|
1713
1714
|
), n = b.useCallback(
|
|
1714
1715
|
(e, g) => {
|
|
1715
|
-
v.mutate(e, g).catch(
|
|
1716
|
+
v.mutate(e, g).catch(L4);
|
|
1716
1717
|
},
|
|
1717
1718
|
[v]
|
|
1718
1719
|
);
|
|
@@ -1720,7 +1721,7 @@ function _(a, t) {
|
|
|
1720
1721
|
throw r.error;
|
|
1721
1722
|
return { ...r, mutate: n, mutateAsync: r.mutate };
|
|
1722
1723
|
}
|
|
1723
|
-
function
|
|
1724
|
+
function L4() {
|
|
1724
1725
|
}
|
|
1725
1726
|
function R() {
|
|
1726
1727
|
return G().getQueryData(["apiBaseUrl"]) || "/api/chaibuilder";
|
|
@@ -1739,14 +1740,14 @@ const m1 = () => {
|
|
|
1739
1740
|
};
|
|
1740
1741
|
let W2 = "";
|
|
1741
1742
|
const h2 = () => (W2 = localStorage.getItem("__chai_at"), W2);
|
|
1742
|
-
function
|
|
1743
|
+
function x4(a) {
|
|
1743
1744
|
const t = {
|
|
1744
1745
|
method: "GET",
|
|
1745
1746
|
headers: { "x-chai-access-token": h2() }
|
|
1746
1747
|
};
|
|
1747
1748
|
return fetch(a, t);
|
|
1748
1749
|
}
|
|
1749
|
-
function
|
|
1750
|
+
function w4(a, t) {
|
|
1750
1751
|
const h = {
|
|
1751
1752
|
method: "POST",
|
|
1752
1753
|
headers: { "x-chai-access-token": h2() },
|
|
@@ -1754,7 +1755,7 @@ function x4(a, t) {
|
|
|
1754
1755
|
};
|
|
1755
1756
|
return fetch(a, h);
|
|
1756
1757
|
}
|
|
1757
|
-
function
|
|
1758
|
+
function B4(a, t) {
|
|
1758
1759
|
const h = {
|
|
1759
1760
|
method: "PUT",
|
|
1760
1761
|
headers: { "x-chai-access-token": h2() },
|
|
@@ -1762,7 +1763,7 @@ function w4(a, t) {
|
|
|
1762
1763
|
};
|
|
1763
1764
|
return fetch(a, h);
|
|
1764
1765
|
}
|
|
1765
|
-
function
|
|
1766
|
+
function C4(a, t) {
|
|
1766
1767
|
const h = {
|
|
1767
1768
|
method: "DELETE",
|
|
1768
1769
|
headers: { "x-chai-access-token": h2() },
|
|
@@ -1771,10 +1772,10 @@ function B4(a, t) {
|
|
|
1771
1772
|
return fetch(a, h);
|
|
1772
1773
|
}
|
|
1773
1774
|
const I = {
|
|
1774
|
-
get:
|
|
1775
|
-
post:
|
|
1776
|
-
put:
|
|
1777
|
-
delete:
|
|
1775
|
+
get: x4,
|
|
1776
|
+
post: w4,
|
|
1777
|
+
put: B4,
|
|
1778
|
+
delete: C4
|
|
1778
1779
|
}, z0 = () => {
|
|
1779
1780
|
const [a, t] = m1(), h = R();
|
|
1780
1781
|
return a2({
|
|
@@ -1816,7 +1817,7 @@ const I = {
|
|
|
1816
1817
|
/* @__PURE__ */ i.jsx("div", { className: "w-4 h-4 rounded-full bg-yellow-600 animate-bounce [animation-delay:.0s]" })
|
|
1817
1818
|
] }),
|
|
1818
1819
|
/* @__PURE__ */ i.jsx("div", { className: "text-gray-700 font-thin", children: "Loading Builder..." })
|
|
1819
|
-
] }) }),
|
|
1820
|
+
] }) }), O4 = (a = "Project updated successfully.") => {
|
|
1820
1821
|
const t = G(), h = R();
|
|
1821
1822
|
return _({
|
|
1822
1823
|
mutationFn: async (v) => await I.put(`${h}/project`, v).then((r) => r.json()),
|
|
@@ -1824,20 +1825,18 @@ const I = {
|
|
|
1824
1825
|
t.invalidateQueries({ queryKey: ["project"] }), h1.success(a);
|
|
1825
1826
|
}
|
|
1826
1827
|
});
|
|
1827
|
-
},
|
|
1828
|
-
const [a] = ["SAVED"], [t, h] = m1(), v = x0();
|
|
1829
|
-
return (
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
}, it = () => {
|
|
1833
|
-
const a = G(), t = O4(), h = R();
|
|
1828
|
+
}, A4 = () => {
|
|
1829
|
+
const [a] = ["SAVED"], [t, h] = m1(), v = x0(), { t: r } = D0();
|
|
1830
|
+
return (n) => a !== "SAVED" ? (h1.error(r("You have unsaved changes. Please save before changing the page.")), !1) : t === n.uuid ? !1 : (v(), setTimeout(() => h(n.uuid), 100), !0);
|
|
1831
|
+
}, dt = () => {
|
|
1832
|
+
const a = G(), t = A4(), h = R();
|
|
1834
1833
|
return _({
|
|
1835
1834
|
mutationFn: async (v) => I.post(`${h}/pages`, v).then((r) => r.json()),
|
|
1836
1835
|
onSuccess: (v) => {
|
|
1837
1836
|
a.invalidateQueries({ queryKey: ["pages"] }), t({ uuid: v.uuid, slug: v.slug }), h1.success("Page added successfully.");
|
|
1838
1837
|
}
|
|
1839
1838
|
});
|
|
1840
|
-
},
|
|
1839
|
+
}, S4 = () => {
|
|
1841
1840
|
const a = R(), [t] = m1(), h = G();
|
|
1842
1841
|
return _({
|
|
1843
1842
|
mutationFn: async (v) => I.put(`${a}/page`, v).then((r) => r.json()),
|
|
@@ -1850,7 +1849,7 @@ const I = {
|
|
|
1850
1849
|
h1.success("Page saved successfully.");
|
|
1851
1850
|
}
|
|
1852
1851
|
});
|
|
1853
|
-
},
|
|
1852
|
+
}, y4 = () => {
|
|
1854
1853
|
const a = R(), { data: t } = g0(), [h] = m1(), { data: v } = z0(), r = G();
|
|
1855
1854
|
return _({
|
|
1856
1855
|
mutationFn: async () => {
|
|
@@ -1873,7 +1872,7 @@ const I = {
|
|
|
1873
1872
|
});
|
|
1874
1873
|
}
|
|
1875
1874
|
});
|
|
1876
|
-
},
|
|
1875
|
+
}, zt = () => {
|
|
1877
1876
|
const a = G(), t = R();
|
|
1878
1877
|
return _({
|
|
1879
1878
|
mutationFn: async (h) => I.delete(`${t}/page`, h).then((v) => v.json()),
|
|
@@ -1881,7 +1880,7 @@ const I = {
|
|
|
1881
1880
|
h1.success("Page deleted successfully."), a.invalidateQueries({ queryKey: ["pages"] });
|
|
1882
1881
|
}
|
|
1883
1882
|
});
|
|
1884
|
-
},
|
|
1883
|
+
}, b4 = () => {
|
|
1885
1884
|
const a = G(), t = R();
|
|
1886
1885
|
return _({
|
|
1887
1886
|
mutationFn: async (h) => I.post(`${t}/take-control`, { uuid: h }).then((v) => v.json()),
|
|
@@ -1889,32 +1888,32 @@ const I = {
|
|
|
1889
1888
|
a.invalidateQueries({ queryKey: ["page_data", v] });
|
|
1890
1889
|
}
|
|
1891
1890
|
});
|
|
1892
|
-
},
|
|
1891
|
+
}, P4 = () => {
|
|
1893
1892
|
const a = R();
|
|
1894
1893
|
return _({
|
|
1895
1894
|
mutationFn: async () => {
|
|
1896
1895
|
const { data: t } = await I.get(`${a}/library`).then((h) => h.json());
|
|
1897
|
-
return
|
|
1898
|
-
|
|
1896
|
+
return R0(
|
|
1897
|
+
k0(t, (h) => !T0(h, "hidden")),
|
|
1899
1898
|
"group"
|
|
1900
1899
|
);
|
|
1901
1900
|
}
|
|
1902
1901
|
});
|
|
1903
|
-
},
|
|
1902
|
+
}, F4 = () => {
|
|
1904
1903
|
const a = R();
|
|
1905
1904
|
return _({
|
|
1906
1905
|
mutationFn: async (t) => {
|
|
1907
1906
|
if (!t || !t.uuid)
|
|
1908
1907
|
return [];
|
|
1909
1908
|
try {
|
|
1910
|
-
const { data: h } = await I.get(`${a}/block?uuid=${t.uuid}&format=${t.format}`).then(async (v) => t.format === "html" ?
|
|
1911
|
-
return
|
|
1909
|
+
const { data: h } = await I.get(`${a}/block?uuid=${t.uuid}&format=${t.format}`).then(async (v) => t.format === "html" ? W0(await v.text()) : await v.json());
|
|
1910
|
+
return E0(h, "0._name", N0(t.group)), h || [];
|
|
1912
1911
|
} catch {
|
|
1913
1912
|
return [];
|
|
1914
1913
|
}
|
|
1915
1914
|
}
|
|
1916
1915
|
});
|
|
1917
|
-
},
|
|
1916
|
+
}, D4 = () => {
|
|
1918
1917
|
const a = R();
|
|
1919
1918
|
return _({
|
|
1920
1919
|
mutationFn: async (t) => {
|
|
@@ -1932,11 +1931,11 @@ const I = {
|
|
|
1932
1931
|
function o0(a) {
|
|
1933
1932
|
return X2({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" } }] })(a);
|
|
1934
1933
|
}
|
|
1935
|
-
function
|
|
1934
|
+
function R4(a) {
|
|
1936
1935
|
return X2({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" } }] })(a);
|
|
1937
1936
|
}
|
|
1938
|
-
const
|
|
1939
|
-
const { mutate: a, isPending: t } =
|
|
1937
|
+
const k4 = () => {
|
|
1938
|
+
const { mutate: a, isPending: t } = b4(), [h] = m1(), { data: v } = M0(), r = b2(v, "lockedBy.name", ""), n = b2(v, "lockedBy.email", "");
|
|
1940
1939
|
return /* @__PURE__ */ i.jsxs("div", { className: "bg-white dark:bg-gray-800 rounded-lg drop-shadow-2xl mx-auto p-10 space-y-4 text-center max-w-xl", children: [
|
|
1941
1940
|
/* @__PURE__ */ i.jsxs("h2", { className: "text-2xl font-bold", children: [
|
|
1942
1941
|
"Page is ",
|
|
@@ -1947,7 +1946,7 @@ const R4 = () => {
|
|
|
1947
1946
|
/* @__PURE__ */ i.jsx("br", {}),
|
|
1948
1947
|
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-x-3 w-max mx-auto font-medium text-gray-700 mt-2 text-sm", children: [
|
|
1949
1948
|
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md", children: [
|
|
1950
|
-
/* @__PURE__ */ i.jsx(
|
|
1949
|
+
/* @__PURE__ */ i.jsx(R4, { className: "w-4 h-4 text-gray-500" }),
|
|
1951
1950
|
" ",
|
|
1952
1951
|
r
|
|
1953
1952
|
] }),
|
|
@@ -1971,11 +1970,11 @@ const R4 = () => {
|
|
|
1971
1970
|
disabled: t,
|
|
1972
1971
|
onClick: () => a(h),
|
|
1973
1972
|
className: `w-36 ${t ? "bg-transparent shadow-none hover:bg-transparent" : ""}`,
|
|
1974
|
-
children: t ? /* @__PURE__ */ i.jsx(
|
|
1973
|
+
children: t ? /* @__PURE__ */ i.jsx(U0, { className: "text-sm animate-spin text-gray-500" }) : "Take Over"
|
|
1975
1974
|
}
|
|
1976
1975
|
)
|
|
1977
1976
|
] });
|
|
1978
|
-
},
|
|
1977
|
+
}, T4 = () => {
|
|
1979
1978
|
const a = R(), t = G();
|
|
1980
1979
|
return _({
|
|
1981
1980
|
mutationFn: async (h) => {
|
|
@@ -1990,13 +1989,13 @@ const R4 = () => {
|
|
|
1990
1989
|
h1.error("Something went wrong. Please try again.", { position: "top-center" });
|
|
1991
1990
|
return;
|
|
1992
1991
|
}
|
|
1993
|
-
localStorage.setItem("__chai_at", v.accessToken), localStorage.setItem("__chai_ur", JSON.stringify(
|
|
1992
|
+
localStorage.setItem("__chai_at", v.accessToken), localStorage.setItem("__chai_ur", JSON.stringify(I0(v, ["accessToken"]))), t.invalidateQueries({ queryKey: ["verify"] }), h1.success("Logged in successfully.");
|
|
1994
1993
|
},
|
|
1995
1994
|
onError: () => {
|
|
1996
1995
|
h1.error("Invalid login credentials. Please try again.", { position: "top-center" });
|
|
1997
1996
|
}
|
|
1998
1997
|
});
|
|
1999
|
-
},
|
|
1998
|
+
}, E4 = () => {
|
|
2000
1999
|
const a = R();
|
|
2001
2000
|
return a2({
|
|
2002
2001
|
queryKey: ["verify"],
|
|
@@ -2005,7 +2004,7 @@ const R4 = () => {
|
|
|
2005
2004
|
return t.ok ? (await t.json()).result === "success" ? { valid: !0 } : (localStorage.removeItem("__chai_at"), { valid: !1 }) : (localStorage.removeItem("__chai_at"), { valid: !0 });
|
|
2006
2005
|
}
|
|
2007
2006
|
});
|
|
2008
|
-
},
|
|
2007
|
+
}, N4 = () => {
|
|
2009
2008
|
const a = R(), t = G();
|
|
2010
2009
|
return _({
|
|
2011
2010
|
mutationFn: async () => {
|
|
@@ -2015,8 +2014,8 @@ const R4 = () => {
|
|
|
2015
2014
|
throw new Error("Invalid session");
|
|
2016
2015
|
}
|
|
2017
2016
|
});
|
|
2018
|
-
},
|
|
2019
|
-
const t =
|
|
2017
|
+
}, I4 = ({ children: a }) => {
|
|
2018
|
+
const t = N4();
|
|
2020
2019
|
return /* @__PURE__ */ i.jsxs(w0, { children: [
|
|
2021
2020
|
/* @__PURE__ */ i.jsx(B0, { asChild: !0, children: a }),
|
|
2022
2021
|
/* @__PURE__ */ i.jsxs(C0, { children: [
|
|
@@ -2037,7 +2036,7 @@ const R4 = () => {
|
|
|
2037
2036
|
onClick: () => t.mutate(),
|
|
2038
2037
|
className: "rounded-md text-white w-28 text-center justify-center bg-red-600 hover:bg-red-700 flex items-center gap-x-2",
|
|
2039
2038
|
children: [
|
|
2040
|
-
t.isPending && /* @__PURE__ */ i.jsx(
|
|
2039
|
+
t.isPending && /* @__PURE__ */ i.jsx(j0, { className: "animate-spin w-5 h-5" }),
|
|
2041
2040
|
"Sign Out"
|
|
2042
2041
|
]
|
|
2043
2042
|
}
|
|
@@ -2045,12 +2044,12 @@ const R4 = () => {
|
|
|
2045
2044
|
] })
|
|
2046
2045
|
] })
|
|
2047
2046
|
] });
|
|
2048
|
-
},
|
|
2049
|
-
const { mutate: a } =
|
|
2047
|
+
}, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-883P3_su.js")), j4 = A2(() => import("./ProjectPanel-Y8Qcmsn0.js")), Q4 = A2(() => import("./CurrentPage-AA0XHYMU.js")), K4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), G4 = () => {
|
|
2048
|
+
const { mutate: a } = y4();
|
|
2050
2049
|
return P0("editable", !0) ? /* @__PURE__ */ i.jsx(Y2, { onClick: a, className: "bg-blue-600 text-white", children: "Publish" }) : null;
|
|
2051
|
-
},
|
|
2050
|
+
}, q4 = (a) => {
|
|
2052
2051
|
var f;
|
|
2053
|
-
const { data: t, isLoading: h } = z0(), { data: v, isLoading: r } = g0(), { data: n } = M0(), { mutate: e } =
|
|
2052
|
+
const { data: t, isLoading: h } = z0(), { data: v, isLoading: r } = g0(), { data: n } = M0(), { mutate: e } = O4(), { mutate: g } = S4(), [s] = m1(), p = D4(), z = P4(), x = F4(), F = R(), H = g2(
|
|
2054
2053
|
async (m) => await p.mutateAsync(m),
|
|
2055
2054
|
[p]
|
|
2056
2055
|
), V = g2(async () => await z.mutateAsync(), [z]), B = g2(
|
|
@@ -2059,7 +2058,7 @@ const R4 = () => {
|
|
|
2059
2058
|
), M = async (m = 20, P = 0) => {
|
|
2060
2059
|
const k = `limit=${m}&offset=${P}`, C = await fetch(`${F}/assets?${k}`).then((w) => w.json());
|
|
2061
2060
|
return C.result === "success" ? C.data : [];
|
|
2062
|
-
}, { logo: u =
|
|
2061
|
+
}, { logo: u = K4 } = a;
|
|
2063
2062
|
if (h || !t)
|
|
2064
2063
|
return /* @__PURE__ */ i.jsx(O2, {});
|
|
2065
2064
|
if (r || !v)
|
|
@@ -2067,7 +2066,7 @@ const R4 = () => {
|
|
|
2067
2066
|
const O = {
|
|
2068
2067
|
...a,
|
|
2069
2068
|
editable: n != null && n.lockedBy ? n == null ? void 0 : n.lockedBy.self : !0,
|
|
2070
|
-
nonEditableComponent:
|
|
2069
|
+
nonEditableComponent: k4,
|
|
2071
2070
|
blocks: (n == null ? void 0 : n.blocks) || [],
|
|
2072
2071
|
brandingOptions: t.brandingOptions,
|
|
2073
2072
|
darkMode: a.darkMode || !1,
|
|
@@ -2076,16 +2075,16 @@ const R4 = () => {
|
|
|
2076
2075
|
onSaveBrandingOptions: async (m) => (await e({ brandingOptions: m }), !0),
|
|
2077
2076
|
topBarComponents: {
|
|
2078
2077
|
left: [u],
|
|
2079
|
-
center: [
|
|
2080
|
-
right: [
|
|
2078
|
+
center: [Q4],
|
|
2079
|
+
right: [G4]
|
|
2081
2080
|
},
|
|
2082
2081
|
sideBarComponents: {
|
|
2083
2082
|
top: [
|
|
2084
|
-
{ icon: V0, name: "pages", panel:
|
|
2085
|
-
{ icon: f0, name: "settings", panel:
|
|
2083
|
+
{ icon: V0, name: "pages", panel: U4 },
|
|
2084
|
+
{ icon: f0, name: "settings", panel: j4 },
|
|
2086
2085
|
...((f = a.sideBarComponents) == null ? void 0 : f.top) || []
|
|
2087
2086
|
],
|
|
2088
|
-
bottom: [
|
|
2087
|
+
bottom: [W4]
|
|
2089
2088
|
},
|
|
2090
2089
|
uploadMediaCallback: H,
|
|
2091
2090
|
fetchMediaCallback: M,
|
|
@@ -2094,8 +2093,8 @@ const R4 = () => {
|
|
|
2094
2093
|
getPages: () => v
|
|
2095
2094
|
};
|
|
2096
2095
|
return /* @__PURE__ */ i.jsx(p0, { ...O });
|
|
2097
|
-
},
|
|
2098
|
-
const [t, h] = M2(!1), [v, r] = M2(""), [n, e] = M2(""), { mutate: g, isPending: s } =
|
|
2096
|
+
}, _4 = ({ logo: a }) => {
|
|
2097
|
+
const [t, h] = M2(!1), [v, r] = M2(""), [n, e] = M2(""), { mutate: g, isPending: s } = T4(), p = (z) => {
|
|
2099
2098
|
z.preventDefault(), g({ email: v, password: n });
|
|
2100
2099
|
};
|
|
2101
2100
|
return /* @__PURE__ */ i.jsx("section", { className: "h-screen w-screen flex items-center justify-center bg-[radial-gradient(#AAA,transparent_0.5px)] duration-300 [background-size:6px_6px]", children: /* @__PURE__ */ i.jsx("div", { className: "overflow-hidden bg-white rounded-xl w-96 drop-shadow-2xl duration-300", children: /* @__PURE__ */ i.jsxs("div", { className: "p-12", children: [
|
|
@@ -2179,24 +2178,24 @@ const R4 = () => {
|
|
|
2179
2178
|
}
|
|
2180
2179
|
) })
|
|
2181
2180
|
] }) }) });
|
|
2182
|
-
},
|
|
2183
|
-
const { data: t, isLoading: h } =
|
|
2181
|
+
}, $4 = (a) => {
|
|
2182
|
+
const { data: t, isLoading: h } = E4(), v = G();
|
|
2184
2183
|
return s0(() => {
|
|
2185
2184
|
v.setQueryData(["apiBaseUrl"], a.apiBaseUrl || "/api/chaibuilder");
|
|
2186
|
-
}, [a.apiBaseUrl, v]), h ? /* @__PURE__ */ i.jsx(O2, {}) : t != null && t.valid ? /* @__PURE__ */ i.jsx(
|
|
2187
|
-
},
|
|
2185
|
+
}, [a.apiBaseUrl, v]), h ? /* @__PURE__ */ i.jsx(O2, {}) : t != null && t.valid ? /* @__PURE__ */ i.jsx(q4, { ...a }) : /* @__PURE__ */ i.jsx(_4, { logo: a.logo });
|
|
2186
|
+
}, J4 = new r4(), gt = (a) => /* @__PURE__ */ i.jsxs(d4, { client: J4, children: [
|
|
2188
2187
|
/* @__PURE__ */ i.jsx(F0, { richColors: !0 }),
|
|
2189
|
-
/* @__PURE__ */ i.jsx(
|
|
2188
|
+
/* @__PURE__ */ i.jsx($4, { ...a })
|
|
2190
2189
|
] });
|
|
2191
2190
|
export {
|
|
2192
|
-
|
|
2191
|
+
gt as C,
|
|
2193
2192
|
z0 as a,
|
|
2194
|
-
|
|
2195
|
-
|
|
2193
|
+
O4 as b,
|
|
2194
|
+
A4 as c,
|
|
2196
2195
|
m1 as d,
|
|
2197
|
-
|
|
2196
|
+
dt as e,
|
|
2198
2197
|
G as f,
|
|
2199
|
-
|
|
2200
|
-
|
|
2198
|
+
S4 as g,
|
|
2199
|
+
zt as h,
|
|
2201
2200
|
g0 as u
|
|
2202
2201
|
};
|