@levo-so/site-runtime 0.3.0 → 0.3.1
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/index.d.ts +27 -3
- package/index.js +716 -691
- package/package.json +1 -1
- package/styles.css +1 -1
package/index.js
CHANGED
|
@@ -4,28 +4,28 @@ import { n as r } from "./dist-DBbiX2ST.js";
|
|
|
4
4
|
import { t as i } from "./inlineCollectionTheme-D2w17LHX.js";
|
|
5
5
|
import { t as a } from "./inlineBaseTheme-DS-AfUHi.js";
|
|
6
6
|
import * as o from "react";
|
|
7
|
-
import { Suspense as s, createContext as c, lazy as l, useCallback as u, useContext as d, useEffect as f,
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { createLevoClient as
|
|
10
|
-
import { ScriptOnce as
|
|
11
|
-
import { useQuery as
|
|
12
|
-
import { Dialog as
|
|
13
|
-
import { createLevoInsights as
|
|
14
|
-
import { CheckIcon as
|
|
7
|
+
import { Suspense as s, createContext as c, lazy as l, useCallback as u, useContext as d, useEffect as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
8
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
9
|
+
import { createLevoClient as b, getLevoError as x } from "@levo-so/core";
|
|
10
|
+
import { ScriptOnce as S, useRouterState as C } from "@tanstack/react-router";
|
|
11
|
+
import { useQuery as w } from "@tanstack/react-query";
|
|
12
|
+
import { Dialog as T } from "@base-ui/react/dialog";
|
|
13
|
+
import { createLevoInsights as E } from "@levo-so/insights";
|
|
14
|
+
import { CheckIcon as D, ChevronLeftIcon as O, ChevronRightIcon as k, LoaderCircle as A, Tag as ee, X as j, XIcon as te } from "lucide-react";
|
|
15
15
|
import { useRazorpay as ne } from "react-razorpay";
|
|
16
|
-
import { EmbeddedCheckout as re, EmbeddedCheckoutProvider as
|
|
16
|
+
import { EmbeddedCheckout as re, EmbeddedCheckoutProvider as M } from "@stripe/react-stripe-js";
|
|
17
17
|
//#region src/hooks/useMounted.ts
|
|
18
|
-
function
|
|
19
|
-
let [e, t] =
|
|
18
|
+
function N() {
|
|
19
|
+
let [e, t] = g(!1);
|
|
20
20
|
return f(() => t(!0), []), e;
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/chat/LevoChat.tsx
|
|
24
|
-
var
|
|
25
|
-
let t =
|
|
26
|
-
return !t || !n ? null : /* @__PURE__ */
|
|
24
|
+
var P = l(() => import("./kbChat-AUJxjURc.js")), ie = ({ site: e }) => {
|
|
25
|
+
let t = N(), n = e.workspace_id || void 0;
|
|
26
|
+
return !t || !n ? null : /* @__PURE__ */ v(s, {
|
|
27
27
|
fallback: null,
|
|
28
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ v(P, {
|
|
29
29
|
workspaceId: n,
|
|
30
30
|
siteName: e.name || void 0,
|
|
31
31
|
siteLogo: void 0,
|
|
@@ -34,82 +34,82 @@ var M = l(() => import("./kbChat-AUJxjURc.js")), N = ({ site: e }) => {
|
|
|
34
34
|
showBranding: !!e.feature_flag?.branding
|
|
35
35
|
})
|
|
36
36
|
});
|
|
37
|
-
},
|
|
37
|
+
}, F = (e) => {
|
|
38
38
|
let t = (e?.apiUrl || "").replace(/\/$/, "");
|
|
39
|
-
return t ?
|
|
39
|
+
return t ? b({
|
|
40
40
|
apiUrl: t,
|
|
41
41
|
workspace: e?.workspace ? e.workspace : null,
|
|
42
42
|
appName: "studio-site",
|
|
43
43
|
NODE_ENV: "",
|
|
44
44
|
APP_MODE: e?.appMode || "production"
|
|
45
45
|
}) : null;
|
|
46
|
-
},
|
|
46
|
+
}, I = (e) => ({
|
|
47
47
|
apiUrl: e.levo?.api_url || "",
|
|
48
48
|
workspace: e.workspace_id || "",
|
|
49
49
|
siteId: e.id || "",
|
|
50
50
|
insightsUrl: e.levo?.insights_url || null,
|
|
51
51
|
appMode: e.levo?.app_mode || "production"
|
|
52
|
-
}),
|
|
52
|
+
}), L = "(prefers-color-scheme: dark)", ae = (e) => {
|
|
53
53
|
try {
|
|
54
54
|
let t = localStorage.getItem(e);
|
|
55
55
|
return t === "light" || t === "dark" || t === "system" ? t : null;
|
|
56
56
|
} catch {
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, oe = (e, t) => {
|
|
60
60
|
try {
|
|
61
61
|
localStorage.setItem(e, t);
|
|
62
62
|
} catch {}
|
|
63
63
|
};
|
|
64
|
-
function
|
|
65
|
-
return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${
|
|
64
|
+
function se(e, t) {
|
|
65
|
+
return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${L}').matches;var r=t==='system'?(d?'dark':'light'):t;var e=document.documentElement;e.classList.remove('light','dark');e.classList.add(r);e.style.colorScheme=r}catch(e){}})();`;
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
function
|
|
67
|
+
var R = c(void 0), z = (e) => e === "system" ? window.matchMedia(L).matches ? "dark" : "light" : e;
|
|
68
|
+
function ce(e) {
|
|
69
69
|
let t = document.documentElement;
|
|
70
70
|
t.classList.remove("light", "dark"), t.classList.add(e), t.style.colorScheme = e;
|
|
71
71
|
}
|
|
72
|
-
var
|
|
73
|
-
let [r, i] =
|
|
72
|
+
var le = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
|
|
73
|
+
let [r, i] = g(t), [a, o] = g(t === "dark" ? "dark" : "light"), s = N();
|
|
74
74
|
return f(() => {
|
|
75
|
-
i(
|
|
75
|
+
i(ae(n) ?? t);
|
|
76
76
|
}, [t, n]), f(() => {
|
|
77
77
|
if (!s) return;
|
|
78
|
-
let e =
|
|
79
|
-
|
|
78
|
+
let e = z(r);
|
|
79
|
+
ce(e), o(e);
|
|
80
80
|
}, [r, s]), f(() => {
|
|
81
81
|
if (!s || r !== "system") return;
|
|
82
|
-
let e = window.matchMedia(
|
|
82
|
+
let e = window.matchMedia(L), t = () => {
|
|
83
83
|
let t = e.matches ? "dark" : "light";
|
|
84
|
-
|
|
84
|
+
ce(t), o(t);
|
|
85
85
|
};
|
|
86
86
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
87
|
-
}, [r, s]), /* @__PURE__ */
|
|
87
|
+
}, [r, s]), /* @__PURE__ */ y(R.Provider, {
|
|
88
88
|
value: {
|
|
89
89
|
mode: r,
|
|
90
90
|
resolvedMode: a,
|
|
91
91
|
setMode: (e) => {
|
|
92
|
-
|
|
92
|
+
oe(n, e), i(e);
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ v(S, { children: se(n, t) }), e]
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
|
-
function
|
|
99
|
-
let e = d(
|
|
98
|
+
function ue() {
|
|
99
|
+
let e = d(R);
|
|
100
100
|
if (e === void 0) throw Error("useColorMode must be used within a ColorModeProvider");
|
|
101
101
|
return e;
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
104
|
//#region src/data/index.ts
|
|
105
|
-
var
|
|
105
|
+
var B = (e) => [
|
|
106
106
|
"levo-source",
|
|
107
107
|
"list",
|
|
108
108
|
e.module,
|
|
109
109
|
e.identifier,
|
|
110
110
|
e.query ?? null,
|
|
111
111
|
e.options ?? null
|
|
112
|
-
],
|
|
112
|
+
], V = (e, t) => [
|
|
113
113
|
"levo-source",
|
|
114
114
|
"record",
|
|
115
115
|
e.module,
|
|
@@ -132,9 +132,9 @@ var V = (e) => [
|
|
|
132
132
|
}, W = async (e, t, n) => (t.module === "collection" ? await e.collection.getCollectionContent({
|
|
133
133
|
collection_key: t.identifier,
|
|
134
134
|
slug: n
|
|
135
|
-
}) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n) : await e.event.getSingleEvent(n)).content.data ?? null,
|
|
136
|
-
let t = n(), r =
|
|
137
|
-
queryKey:
|
|
135
|
+
}) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n) : await e.event.getSingleEvent(n)).content.data ?? null, de = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, fe = (e) => {
|
|
136
|
+
let t = n(), r = w({
|
|
137
|
+
queryKey: B(e),
|
|
138
138
|
queryFn: () => U(t, e),
|
|
139
139
|
enabled: !!t
|
|
140
140
|
});
|
|
@@ -142,63 +142,63 @@ var V = (e) => [
|
|
|
142
142
|
data: r.data?.data ?? null,
|
|
143
143
|
meta: r.data?.meta ?? null,
|
|
144
144
|
isLoading: r.isLoading,
|
|
145
|
-
error: r.error ?
|
|
145
|
+
error: r.error ? x(r.error).message : null,
|
|
146
146
|
bind: { "data-levo-source": JSON.stringify({
|
|
147
147
|
mode: "list",
|
|
148
148
|
...e
|
|
149
149
|
}) }
|
|
150
150
|
};
|
|
151
|
-
},
|
|
152
|
-
let r = n(), i =
|
|
153
|
-
queryKey:
|
|
151
|
+
}, pe = (e, t) => {
|
|
152
|
+
let r = n(), i = w({
|
|
153
|
+
queryKey: V(e, t),
|
|
154
154
|
queryFn: () => W(r, e, t),
|
|
155
155
|
enabled: !!r && !!t
|
|
156
156
|
});
|
|
157
157
|
return {
|
|
158
158
|
data: i.data ?? null,
|
|
159
159
|
isLoading: i.isLoading,
|
|
160
|
-
error: i.error ?
|
|
160
|
+
error: i.error ? x(i.error).message : null,
|
|
161
161
|
bind: { "data-levo-source": JSON.stringify({
|
|
162
162
|
mode: "record",
|
|
163
163
|
...e
|
|
164
164
|
}) }
|
|
165
165
|
};
|
|
166
|
-
},
|
|
167
|
-
let t = n(), r =
|
|
166
|
+
}, me = (e) => {
|
|
167
|
+
let t = n(), r = w({
|
|
168
168
|
queryKey: H(e),
|
|
169
|
-
queryFn: () =>
|
|
169
|
+
queryFn: () => de(t, e),
|
|
170
170
|
enabled: !!t
|
|
171
171
|
});
|
|
172
172
|
return {
|
|
173
173
|
schema: r.data ?? null,
|
|
174
174
|
isLoading: r.isLoading,
|
|
175
|
-
error: r.error ?
|
|
175
|
+
error: r.error ? x(r.error).message : null,
|
|
176
176
|
bind: { "data-levo-source": JSON.stringify({
|
|
177
177
|
mode: "form",
|
|
178
178
|
...e
|
|
179
179
|
}) }
|
|
180
180
|
};
|
|
181
|
-
},
|
|
182
|
-
let i =
|
|
181
|
+
}, G = async ({ queryClient: e, config: t, sources: n, params: r }) => {
|
|
182
|
+
let i = F(t);
|
|
183
183
|
if (!i || !n) return {};
|
|
184
184
|
let a = await Promise.all(Object.entries(n).map(async ([t, n]) => {
|
|
185
185
|
if (n.mode === "record") {
|
|
186
186
|
let a = r?.slug;
|
|
187
187
|
return a ? [t, await e.ensureQueryData({
|
|
188
|
-
queryKey:
|
|
188
|
+
queryKey: V(n, a),
|
|
189
189
|
queryFn: () => W(i, n, a)
|
|
190
190
|
}).catch(() => null)] : [t, null];
|
|
191
191
|
}
|
|
192
192
|
return n.mode === "form" ? [t, await e.ensureQueryData({
|
|
193
193
|
queryKey: H(n),
|
|
194
|
-
queryFn: () =>
|
|
194
|
+
queryFn: () => de(i, n)
|
|
195
195
|
}).catch(() => null)] : [t, await e.ensureQueryData({
|
|
196
|
-
queryKey:
|
|
196
|
+
queryKey: B(n),
|
|
197
197
|
queryFn: () => U(i, n)
|
|
198
198
|
}).catch(() => null)];
|
|
199
199
|
}));
|
|
200
200
|
return Object.fromEntries(a);
|
|
201
|
-
},
|
|
201
|
+
}, he = {
|
|
202
202
|
background: "var(--color-page)",
|
|
203
203
|
foreground: "var(--color-ink)",
|
|
204
204
|
text: "var(--color-ink)",
|
|
@@ -220,11 +220,11 @@ var V = (e) => [
|
|
|
220
220
|
input: "var(--color-background1)",
|
|
221
221
|
inputForeground: "var(--color-ink)",
|
|
222
222
|
ring: "var(--color-brand)"
|
|
223
|
-
},
|
|
224
|
-
let d = n(), { schema: f, isLoading:
|
|
223
|
+
}, ge = ({ source: e, submitLabel: t = "Submit", hiddenFields: o, formVariant: s = "default", successConfig: c, theme: l, className: u }) => {
|
|
224
|
+
let d = n(), { schema: f, isLoading: p, bind: h } = me(e), g = m(() => ({
|
|
225
225
|
...a({
|
|
226
226
|
colors: {
|
|
227
|
-
...
|
|
227
|
+
...he,
|
|
228
228
|
...l?.colors
|
|
229
229
|
},
|
|
230
230
|
radius: l?.radius ?? "var(--radius-token)",
|
|
@@ -235,12 +235,12 @@ var V = (e) => [
|
|
|
235
235
|
}),
|
|
236
236
|
...l?.gap ? i({ form: { gap: l.gap } }) : {}
|
|
237
237
|
}), [l]);
|
|
238
|
-
return d ? /* @__PURE__ */
|
|
238
|
+
return d ? /* @__PURE__ */ v("div", {
|
|
239
239
|
...h,
|
|
240
240
|
className: u,
|
|
241
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ v(r, {
|
|
242
242
|
fetchedSchema: f,
|
|
243
|
-
isLoading:
|
|
243
|
+
isLoading: p,
|
|
244
244
|
submitButtonConfig: {
|
|
245
245
|
show: !0,
|
|
246
246
|
text: t
|
|
@@ -255,24 +255,28 @@ var V = (e) => [
|
|
|
255
255
|
successConfig: c
|
|
256
256
|
})
|
|
257
257
|
}) : null;
|
|
258
|
-
},
|
|
258
|
+
}, _e = 1400, ve = 12 * 1024 * 1024, ye = new Set(["transparent", "rgba(0, 0, 0, 0)"]), be = {
|
|
259
|
+
imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
|
|
260
|
+
onImageErrorHandler: () => void 0
|
|
261
|
+
}, xe = (e) => {
|
|
259
262
|
let t = getComputedStyle(e);
|
|
260
|
-
return !
|
|
261
|
-
},
|
|
263
|
+
return !ye.has(t.backgroundColor) || t.backgroundImage !== "none";
|
|
264
|
+
}, Se = (e) => {
|
|
262
265
|
for (let t = e; t; t = t.parentElement) {
|
|
263
266
|
let e = getComputedStyle(t).backgroundColor;
|
|
264
|
-
if (!
|
|
267
|
+
if (!ye.has(e)) return e;
|
|
265
268
|
}
|
|
266
269
|
return "#ffffff";
|
|
267
|
-
},
|
|
268
|
-
let { toPng: n } = await import("./es-iCqKQf1c.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = await n(e, {
|
|
269
|
-
|
|
270
|
-
|
|
270
|
+
}, Ce = async (e, t) => {
|
|
271
|
+
let { toPng: n } = await import("./es-iCqKQf1c.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, _e / i)), o = await n(e, {
|
|
272
|
+
...be,
|
|
273
|
+
pixelRatio: a,
|
|
274
|
+
backgroundColor: Se(e),
|
|
271
275
|
filter: (e) => !t.includes(e)
|
|
272
276
|
});
|
|
273
|
-
if (
|
|
274
|
-
return
|
|
275
|
-
},
|
|
277
|
+
if (o.length > ve) throw Error("capture too large");
|
|
278
|
+
return o;
|
|
279
|
+
}, we = 4, Te = 4e3, Ee = (e, t) => {
|
|
276
280
|
let n = document.elementFromPoint(e.x + e.width / 2, e.y + e.height / 2);
|
|
277
281
|
for (; n && t.includes(n);) n = n.parentElement;
|
|
278
282
|
let r = document.body;
|
|
@@ -283,8 +287,8 @@ var V = (e) => [
|
|
|
283
287
|
break;
|
|
284
288
|
}
|
|
285
289
|
}
|
|
286
|
-
let i = window.innerWidth * window.innerHeight *
|
|
287
|
-
for (; !
|
|
290
|
+
let i = window.innerWidth * window.innerHeight * we || 2 ** 53 - 1, a = r;
|
|
291
|
+
for (; !xe(a);) {
|
|
288
292
|
let e = a.parentElement;
|
|
289
293
|
if (!e || e === document.documentElement) break;
|
|
290
294
|
let t = e.getBoundingClientRect();
|
|
@@ -292,12 +296,13 @@ var V = (e) => [
|
|
|
292
296
|
a = e;
|
|
293
297
|
}
|
|
294
298
|
return a;
|
|
295
|
-
},
|
|
296
|
-
let { toCanvas: n } = await import("./es-iCqKQf1c.js"), r =
|
|
297
|
-
o = Math.min(o,
|
|
299
|
+
}, De = async (e, t) => {
|
|
300
|
+
let { toCanvas: n } = await import("./es-iCqKQf1c.js"), r = Ee(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, _e / a)), s = Math.max(i.width, i.height, 1);
|
|
301
|
+
o = Math.min(o, Te / s);
|
|
298
302
|
let c = await n(r, {
|
|
303
|
+
...be,
|
|
299
304
|
pixelRatio: o,
|
|
300
|
-
backgroundColor:
|
|
305
|
+
backgroundColor: Se(r),
|
|
301
306
|
filter: (e) => !t.includes(e)
|
|
302
307
|
}), l = document.createElement("canvas");
|
|
303
308
|
l.width = Math.max(1, Math.round(e.width * o)), l.height = Math.max(1, Math.round(e.height * o));
|
|
@@ -305,39 +310,39 @@ var V = (e) => [
|
|
|
305
310
|
if (!u) throw Error("no 2d context");
|
|
306
311
|
u.drawImage(c, (e.x - i.left) * o, (e.y - i.top) * o, e.width * o, e.height * o, 0, 0, l.width, l.height);
|
|
307
312
|
let d = l.toDataURL("image/png");
|
|
308
|
-
if (d.length >
|
|
313
|
+
if (d.length > ve) throw Error("capture too large");
|
|
309
314
|
return d;
|
|
310
|
-
},
|
|
315
|
+
}, K = {
|
|
311
316
|
ring: 99997,
|
|
312
317
|
overlay: 99998,
|
|
313
318
|
label: 99999
|
|
314
|
-
},
|
|
319
|
+
}, q = {
|
|
315
320
|
hover: "#3b82f6",
|
|
316
321
|
hoverBg: "rgba(59,130,246,0.12)",
|
|
317
322
|
hoverLabelBg: "#1d4ed8",
|
|
318
323
|
select: "#16a34a",
|
|
319
324
|
selectGlow: "rgba(22,163,74,0.18)"
|
|
320
|
-
},
|
|
325
|
+
}, J = (e) => {
|
|
321
326
|
let t = e?.getAttribute("data-tsd-source");
|
|
322
327
|
return t ? t.replace(/^\//, "") : null;
|
|
323
|
-
},
|
|
324
|
-
let n =
|
|
328
|
+
}, Oe = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => J(t) === e), ke = (e, t) => {
|
|
329
|
+
let n = Oe(t).indexOf(e);
|
|
325
330
|
return n < 0 ? 0 : n;
|
|
326
|
-
},
|
|
327
|
-
let n =
|
|
331
|
+
}, Y = (e, t = 0) => {
|
|
332
|
+
let n = Oe(e);
|
|
328
333
|
return n[t] ?? n[0] ?? null;
|
|
329
|
-
},
|
|
334
|
+
}, Ae = (e, t) => {
|
|
330
335
|
let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter(Boolean);
|
|
331
336
|
n.includes(t) || e.setAttribute("data-staged-key", [...n, t].join(" "));
|
|
332
|
-
},
|
|
337
|
+
}, je = (e, t) => {
|
|
333
338
|
let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter((e) => e && e !== t);
|
|
334
339
|
n.length ? e.setAttribute("data-staged-key", n.join(" ")) : e.removeAttribute("data-staged-key");
|
|
335
|
-
},
|
|
340
|
+
}, Me = (e, t) => {
|
|
336
341
|
let n = Object.entries(t.styles).filter(([e]) => /^-?[a-zA-Z][a-zA-Z0-9-]*$/.test(e)).map(([e, t]) => `${e}:${String(t).replace(/[;{}]/g, "")} !important;`).join("");
|
|
337
342
|
if (!n) return "";
|
|
338
343
|
let r = `[data-staged-key~="${CSS.escape(e)}"]{${n}}`, i = t.media?.replace(/[;{}]/g, "").trim();
|
|
339
344
|
return i ? `@media ${i}{${r}}` : r;
|
|
340
|
-
},
|
|
345
|
+
}, Ne = (e) => {
|
|
341
346
|
let t = e.tagName.toLowerCase();
|
|
342
347
|
return t === "input" ? {
|
|
343
348
|
checkbox: "Checkbox",
|
|
@@ -379,31 +384,31 @@ var V = (e) => [
|
|
|
379
384
|
aside: "Sidebar",
|
|
380
385
|
div: "Container"
|
|
381
386
|
}[t] || `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
382
|
-
},
|
|
383
|
-
let t =
|
|
384
|
-
return n ? `${t} · ${n.length >
|
|
385
|
-
},
|
|
387
|
+
}, Pe = 36, Fe = (e) => {
|
|
388
|
+
let t = Ne(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
|
|
389
|
+
return n ? `${t} · ${n.length > Pe ? `${n.slice(0, Pe - 1).trimEnd()}…` : n}` : t;
|
|
390
|
+
}, Ie = (e) => {
|
|
386
391
|
let t = [], n = e;
|
|
387
392
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) t.unshift(n.tagName.toLowerCase()), n = n.parentElement;
|
|
388
393
|
return t.join(" > ");
|
|
389
|
-
},
|
|
394
|
+
}, Le = () => {
|
|
390
395
|
let e = document.createElement("div");
|
|
391
|
-
e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
396
|
+
e.style.cssText = `position:fixed;pointer-events:none;z-index:${K.overlay};background:${q.hoverBg};outline:2px solid ${q.hover};border-radius:2px;display:none`;
|
|
392
397
|
let t = document.createElement("div");
|
|
393
|
-
t.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
398
|
+
t.style.cssText = `position:fixed;pointer-events:none;z-index:${K.label};background:${q.hoverLabelBg};color:#fff;font:11px/1.6 ui-monospace,monospace;padding:1px 6px;border-radius:4px;display:none;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis`;
|
|
394
399
|
let n = document.createElement("div");
|
|
395
|
-
n.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
400
|
+
n.style.cssText = `position:fixed;pointer-events:none;z-index:${K.ring};outline:2px solid ${q.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${q.selectGlow};display:none`;
|
|
396
401
|
let r = document.createElement("div");
|
|
397
|
-
return r.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
402
|
+
return r.style.cssText = `position:fixed;pointer-events:none;z-index:${K.label};background:${q.select};color:#fff;font:11px/1.6 ui-monospace,monospace;padding:1px 6px;border-radius:4px;display:none;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis`, {
|
|
398
403
|
overlay: e,
|
|
399
404
|
label: t,
|
|
400
405
|
ring: n,
|
|
401
406
|
ringLabel: r
|
|
402
407
|
};
|
|
403
|
-
},
|
|
408
|
+
}, Re = (e, t, n) => {
|
|
404
409
|
let r = n.getBoundingClientRect();
|
|
405
|
-
e.style.display = "block", e.style.left = `${r.left}px`, e.style.top = `${r.top}px`, e.style.width = `${r.width}px`, e.style.height = `${r.height}px`, t.style.display = "block", t.textContent =
|
|
406
|
-
},
|
|
410
|
+
e.style.display = "block", e.style.left = `${r.left}px`, e.style.top = `${r.top}px`, e.style.width = `${r.width}px`, e.style.height = `${r.height}px`, t.style.display = "block", t.textContent = Fe(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
|
|
411
|
+
}, ze = (e) => {
|
|
407
412
|
let t = (e instanceof Element ? e : null)?.closest("a[href]");
|
|
408
413
|
if (!t || t.target === "_blank") return null;
|
|
409
414
|
let n;
|
|
@@ -413,11 +418,11 @@ var V = (e) => [
|
|
|
413
418
|
return null;
|
|
414
419
|
}
|
|
415
420
|
return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
|
|
416
|
-
},
|
|
421
|
+
}, Be = (e) => {
|
|
417
422
|
if (!e) return !1;
|
|
418
423
|
let t = e.tagName;
|
|
419
424
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
|
|
420
|
-
},
|
|
425
|
+
}, Ve = (e) => {
|
|
421
426
|
if (!e.childNodes.length) return !1;
|
|
422
427
|
let t = !1;
|
|
423
428
|
for (let n of e.childNodes) {
|
|
@@ -425,10 +430,10 @@ var V = (e) => [
|
|
|
425
430
|
(n.textContent ?? "").trim() && (t = !0);
|
|
426
431
|
}
|
|
427
432
|
return t;
|
|
428
|
-
},
|
|
433
|
+
}, He = 2e3, Ue = (e) => {
|
|
429
434
|
let t = [], n = e;
|
|
430
435
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
|
|
431
|
-
let e =
|
|
436
|
+
let e = J(n);
|
|
432
437
|
e && t.unshift({
|
|
433
438
|
tag: n.tagName.toLowerCase(),
|
|
434
439
|
text: (n.textContent || "").trim().slice(0, 60),
|
|
@@ -436,25 +441,25 @@ var V = (e) => [
|
|
|
436
441
|
}), n = n.parentElement;
|
|
437
442
|
}
|
|
438
443
|
return t;
|
|
439
|
-
},
|
|
440
|
-
let t =
|
|
444
|
+
}, We = (e) => {
|
|
445
|
+
let t = J(e), n = t ? Oe(t).length : 1, r = t ? ke(e, t) : 0, i = t && Ve(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, He) : void 0, a = Ge(e);
|
|
441
446
|
return {
|
|
442
447
|
tag: e.tagName.toLowerCase(),
|
|
443
448
|
classes: typeof e.className == "string" ? e.className.trim() : "",
|
|
444
449
|
text: (e.innerText || "").trim().slice(0, 120),
|
|
445
|
-
label:
|
|
446
|
-
path:
|
|
450
|
+
label: Fe(e),
|
|
451
|
+
path: Ie(e),
|
|
447
452
|
source: t,
|
|
448
453
|
index: r,
|
|
449
454
|
occurrences: n,
|
|
450
|
-
ancestors:
|
|
455
|
+
ancestors: Ue(e),
|
|
451
456
|
...i === void 0 ? {} : { fullText: i },
|
|
452
457
|
...a ? { sourceBinding: a } : {}
|
|
453
458
|
};
|
|
454
|
-
},
|
|
459
|
+
}, Ge = (e) => {
|
|
455
460
|
let t = e.closest("[data-levo-source]");
|
|
456
461
|
if (!t) return;
|
|
457
|
-
let n = t.getAttribute("data-levo-source") ?? "", r =
|
|
462
|
+
let n = t.getAttribute("data-levo-source") ?? "", r = J(t), i;
|
|
458
463
|
try {
|
|
459
464
|
i = JSON.parse(n);
|
|
460
465
|
} catch {
|
|
@@ -464,12 +469,12 @@ var V = (e) => [
|
|
|
464
469
|
raw: n,
|
|
465
470
|
element: {
|
|
466
471
|
source: r ?? "",
|
|
467
|
-
index: r ?
|
|
472
|
+
index: r ? ke(t, r) : 0
|
|
468
473
|
},
|
|
469
474
|
...i === void 0 ? {} : { config: i }
|
|
470
475
|
};
|
|
471
|
-
},
|
|
472
|
-
let t = e.getAttribute("data-levo-source") ?? "", n =
|
|
476
|
+
}, Ke = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
|
|
477
|
+
let t = e.getAttribute("data-levo-source") ?? "", n = J(e), r;
|
|
473
478
|
try {
|
|
474
479
|
r = JSON.parse(t);
|
|
475
480
|
} catch {
|
|
@@ -479,21 +484,21 @@ var V = (e) => [
|
|
|
479
484
|
raw: t,
|
|
480
485
|
element: {
|
|
481
486
|
source: n ?? "",
|
|
482
|
-
index: n ?
|
|
487
|
+
index: n ? ke(e, n) : 0
|
|
483
488
|
},
|
|
484
489
|
tag: e.tagName.toLowerCase(),
|
|
485
|
-
label:
|
|
490
|
+
label: Fe(e),
|
|
486
491
|
...r === void 0 ? {} : { config: r }
|
|
487
492
|
};
|
|
488
|
-
}),
|
|
493
|
+
}), qe = 14, Je = 2e3, Ye = 100, Xe = 48, Ze = new Set([
|
|
489
494
|
"script",
|
|
490
495
|
"style",
|
|
491
496
|
"template",
|
|
492
497
|
"noscript"
|
|
493
|
-
]),
|
|
498
|
+
]), Qe = (e, t) => t.includes(e) || e.id === "studio-staged" || Ze.has(e.tagName.toLowerCase()), $e = (e) => {
|
|
494
499
|
let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
495
500
|
for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
496
|
-
let t =
|
|
501
|
+
let t = J(e);
|
|
497
502
|
if (!t) continue;
|
|
498
503
|
let n = i.get(t) ?? 0;
|
|
499
504
|
r.set(e, n), i.set(t, n + 1);
|
|
@@ -502,11 +507,11 @@ var V = (e) => [
|
|
|
502
507
|
for (let t of e.childNodes) {
|
|
503
508
|
if (t.nodeType !== 3) continue;
|
|
504
509
|
let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
505
|
-
if (e) return e.length >
|
|
510
|
+
if (e) return e.length > Xe ? `${e.slice(0, Xe).trimEnd()}…` : e;
|
|
506
511
|
}
|
|
507
512
|
}, o = (i, s) => {
|
|
508
513
|
n++;
|
|
509
|
-
let c =
|
|
514
|
+
let c = J(i), l = a(i), u = Array.from(i.children).filter((t) => !Qe(t, e)), d = {
|
|
510
515
|
tag: i.tagName.toLowerCase(),
|
|
511
516
|
...c ? {
|
|
512
517
|
source: c,
|
|
@@ -517,9 +522,9 @@ var V = (e) => [
|
|
|
517
522
|
childCount: u.length,
|
|
518
523
|
children: []
|
|
519
524
|
};
|
|
520
|
-
if (s >=
|
|
525
|
+
if (s >= qe) return u.length && (t = !0), d;
|
|
521
526
|
for (let e of u) {
|
|
522
|
-
if (d.children.length >=
|
|
527
|
+
if (d.children.length >= Ye || n >= Je) {
|
|
523
528
|
t = !0;
|
|
524
529
|
break;
|
|
525
530
|
}
|
|
@@ -531,7 +536,7 @@ var V = (e) => [
|
|
|
531
536
|
tree: o(document.body, 0),
|
|
532
537
|
truncated: t
|
|
533
538
|
};
|
|
534
|
-
},
|
|
539
|
+
}, et = () => {
|
|
535
540
|
let e = null;
|
|
536
541
|
return {
|
|
537
542
|
send: (t) => {
|
|
@@ -546,77 +551,7 @@ var V = (e) => [
|
|
|
546
551
|
return !0;
|
|
547
552
|
}
|
|
548
553
|
};
|
|
549
|
-
},
|
|
550
|
-
x: Math.min(e, n),
|
|
551
|
-
y: Math.min(t, r),
|
|
552
|
-
width: Math.abs(n - e),
|
|
553
|
-
height: Math.abs(r - t)
|
|
554
|
-
}), tt = (e, t) => {
|
|
555
|
-
let n = e.x + e.width, r = e.y + e.height, i = [];
|
|
556
|
-
for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
557
|
-
if (t.includes(a)) continue;
|
|
558
|
-
let o = a.getBoundingClientRect(), s = o.width * o.height;
|
|
559
|
-
s <= 0 || Math.max(0, Math.min(n, o.right) - Math.max(e.x, o.left)) * Math.max(0, Math.min(r, o.bottom) - Math.max(e.y, o.top)) / s >= $e && i.push(a);
|
|
560
|
-
}
|
|
561
|
-
let a = new Set(i), o = i.filter((e) => {
|
|
562
|
-
for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
|
|
563
|
-
return !0;
|
|
564
|
-
}), s = o.length > Qe, c = [], l = [];
|
|
565
|
-
for (let e of o.slice(0, Qe)) {
|
|
566
|
-
let t = X(e);
|
|
567
|
-
if (!t) continue;
|
|
568
|
-
let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
|
|
569
|
-
c.push({
|
|
570
|
-
source: t,
|
|
571
|
-
index: we(e, t),
|
|
572
|
-
tag: e.tagName.toLowerCase(),
|
|
573
|
-
label: Ae(e),
|
|
574
|
-
...n ? { text: n } : {}
|
|
575
|
-
}), l.push(e);
|
|
576
|
-
}
|
|
577
|
-
return {
|
|
578
|
-
elements: c,
|
|
579
|
-
nodes: l,
|
|
580
|
-
truncated: s
|
|
581
|
-
};
|
|
582
|
-
}, nt = () => Array.from({ length: Qe }, () => {
|
|
583
|
-
let e = document.createElement("div");
|
|
584
|
-
return e.style.cssText = `position:fixed;pointer-events:none;z-index:${J.ring};outline:1.5px solid ${Y.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${Y.selectGlow};display:none`, e;
|
|
585
|
-
}), rt = () => {
|
|
586
|
-
let e = document.createElement("div");
|
|
587
|
-
e.style.cssText = `position:fixed;pointer-events:none;z-index:${J.overlay};border:1.5px dashed ${Y.select};background:${Y.selectGlow};border-radius:2px;display:none`;
|
|
588
|
-
let t = null, n = !1, r = 0, i = 0, a = () => {
|
|
589
|
-
e.style.display = "none";
|
|
590
|
-
};
|
|
591
|
-
return {
|
|
592
|
-
node: e,
|
|
593
|
-
pointerDown: (e, a) => {
|
|
594
|
-
t = {
|
|
595
|
-
x: e,
|
|
596
|
-
y: a
|
|
597
|
-
}, n = !1, r = e, i = a;
|
|
598
|
-
},
|
|
599
|
-
pointerMove: (a, o) => {
|
|
600
|
-
if (!t) return;
|
|
601
|
-
if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
|
|
602
|
-
if (Math.abs(a - t.x) < Xe && Math.abs(o - t.y) < Xe) return;
|
|
603
|
-
n = !0;
|
|
604
|
-
}
|
|
605
|
-
let s = et(t.x, t.y, a, o);
|
|
606
|
-
e.style.display = "block", e.style.left = `${s.x}px`, e.style.top = `${s.y}px`, e.style.width = `${s.width}px`, e.style.height = `${s.height}px`;
|
|
607
|
-
},
|
|
608
|
-
pointerUp: () => {
|
|
609
|
-
let e = n, o = t;
|
|
610
|
-
if (t = null, n = !1, a(), !e || !o) return null;
|
|
611
|
-
let s = et(o.x, o.y, r, i);
|
|
612
|
-
return s.width < Ze || s.height < Ze ? null : s;
|
|
613
|
-
},
|
|
614
|
-
cancel: () => {
|
|
615
|
-
t = null, n = !1, a();
|
|
616
|
-
},
|
|
617
|
-
isDragging: () => n
|
|
618
|
-
};
|
|
619
|
-
}, it = (e) => {
|
|
554
|
+
}, tt = (e) => {
|
|
620
555
|
let t = location.pathname, n = () => {
|
|
621
556
|
location.pathname !== t && (t = location.pathname, e.onPathChange());
|
|
622
557
|
}, r = !1;
|
|
@@ -636,7 +571,7 @@ var V = (e) => [
|
|
|
636
571
|
e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
|
|
637
572
|
}
|
|
638
573
|
} };
|
|
639
|
-
},
|
|
574
|
+
}, nt = (e) => {
|
|
640
575
|
let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
|
|
641
576
|
return { onMessage: (o) => {
|
|
642
577
|
let s = o.data;
|
|
@@ -644,7 +579,7 @@ var V = (e) => [
|
|
|
644
579
|
if (s.type === "set-inspect") e.setInspect(s.enabled);
|
|
645
580
|
else if (s.type === "set-text-edit") e.setTextEdit(s.enabled);
|
|
646
581
|
else if (s.type === "revert-text") {
|
|
647
|
-
let e = String(s.element?.source || ""), t = Number.isInteger(s.element?.index) ? s.element.index : 0, r = n.restore(`${e}#${t}`), i = r == null ? null :
|
|
582
|
+
let e = String(s.element?.source || ""), t = Number.isInteger(s.element?.index) ? s.element.index : 0, r = n.restore(`${e}#${t}`), i = r == null ? null : Y(e, t);
|
|
648
583
|
i && r != null && (i.textContent = r);
|
|
649
584
|
} else if (s.type === "stage-style") {
|
|
650
585
|
let t = String(s.stageId || ""), n = String(s.element?.source || ""), a = Number.isInteger(s.element?.index) ? s.element.index : 0, o = s.styles && typeof s.styles == "object" ? s.styles : null;
|
|
@@ -703,7 +638,7 @@ var V = (e) => [
|
|
|
703
638
|
}
|
|
704
639
|
e.syncDomObserver();
|
|
705
640
|
} else if (s.type === "select-element") {
|
|
706
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
641
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Y(t, n) : null;
|
|
707
642
|
if (!r) {
|
|
708
643
|
i({
|
|
709
644
|
type: "select-miss",
|
|
@@ -719,10 +654,10 @@ var V = (e) => [
|
|
|
719
654
|
behavior: "smooth"
|
|
720
655
|
}), i({
|
|
721
656
|
type: "element-selected",
|
|
722
|
-
element:
|
|
657
|
+
element: We(r)
|
|
723
658
|
});
|
|
724
659
|
} else if (s.type === "edit-element") {
|
|
725
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
660
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Y(t, n) : null;
|
|
726
661
|
if (!r) {
|
|
727
662
|
i({
|
|
728
663
|
type: "select-miss",
|
|
@@ -738,12 +673,12 @@ var V = (e) => [
|
|
|
738
673
|
behavior: "smooth"
|
|
739
674
|
}), i({
|
|
740
675
|
type: "element-selected",
|
|
741
|
-
element:
|
|
676
|
+
element: We(r)
|
|
742
677
|
}), e.isTextEditing() || e.setTextEdit(!0);
|
|
743
678
|
let o = e.editableTarget(r);
|
|
744
679
|
o && e.startEditAtEnd(o);
|
|
745
680
|
} else if (s.type === "highlight-element") {
|
|
746
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
681
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Y(t, n) : null;
|
|
747
682
|
if (!r) a = null, e.hideTextHover(), i({
|
|
748
683
|
type: "highlight-miss",
|
|
749
684
|
element: {
|
|
@@ -761,7 +696,7 @@ var V = (e) => [
|
|
|
761
696
|
}
|
|
762
697
|
} else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
|
|
763
698
|
else if (s.type === "request-layers") {
|
|
764
|
-
let { tree: t, truncated: n } =
|
|
699
|
+
let { tree: t, truncated: n } = $e(e.ownNodes);
|
|
765
700
|
i({
|
|
766
701
|
type: "layers-tree",
|
|
767
702
|
tree: t,
|
|
@@ -769,7 +704,7 @@ var V = (e) => [
|
|
|
769
704
|
});
|
|
770
705
|
} else if (s.type === "request-sources") i({
|
|
771
706
|
type: "sources-list",
|
|
772
|
-
sources:
|
|
707
|
+
sources: Ke()
|
|
773
708
|
});
|
|
774
709
|
else if (s.type === "capture-selected") {
|
|
775
710
|
let t = String(s.requestId || "");
|
|
@@ -784,7 +719,7 @@ var V = (e) => [
|
|
|
784
719
|
});
|
|
785
720
|
return;
|
|
786
721
|
}
|
|
787
|
-
|
|
722
|
+
Ce(n, e.ownNodes).then((e) => {
|
|
788
723
|
console.info(`[levo-inspector] element capture ok <${n.tagName.toLowerCase()}> (${Math.round(e.length / 1024)}kB)`), i({
|
|
789
724
|
type: "capture-result",
|
|
790
725
|
requestId: t,
|
|
@@ -805,7 +740,7 @@ var V = (e) => [
|
|
|
805
740
|
}
|
|
806
741
|
}
|
|
807
742
|
} };
|
|
808
|
-
},
|
|
743
|
+
}, rt = () => {
|
|
809
744
|
let e = /* @__PURE__ */ new Map(), t = () => {
|
|
810
745
|
if (e.size > 50) {
|
|
811
746
|
let t = e.keys().next().value;
|
|
@@ -825,14 +760,84 @@ var V = (e) => [
|
|
|
825
760
|
return e.delete(t), n;
|
|
826
761
|
}
|
|
827
762
|
};
|
|
828
|
-
}, st = (e) => {
|
|
763
|
+
}, it = 6, at = 12, ot = 12, st = .6, ct = (e, t, n, r) => ({
|
|
764
|
+
x: Math.min(e, n),
|
|
765
|
+
y: Math.min(t, r),
|
|
766
|
+
width: Math.abs(n - e),
|
|
767
|
+
height: Math.abs(r - t)
|
|
768
|
+
}), lt = (e, t) => {
|
|
769
|
+
let n = e.x + e.width, r = e.y + e.height, i = [];
|
|
770
|
+
for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
771
|
+
if (t.includes(a)) continue;
|
|
772
|
+
let o = a.getBoundingClientRect(), s = o.width * o.height;
|
|
773
|
+
s <= 0 || Math.max(0, Math.min(n, o.right) - Math.max(e.x, o.left)) * Math.max(0, Math.min(r, o.bottom) - Math.max(e.y, o.top)) / s >= st && i.push(a);
|
|
774
|
+
}
|
|
775
|
+
let a = new Set(i), o = i.filter((e) => {
|
|
776
|
+
for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
|
|
777
|
+
return !0;
|
|
778
|
+
}), s = o.length > ot, c = [], l = [];
|
|
779
|
+
for (let e of o.slice(0, ot)) {
|
|
780
|
+
let t = J(e);
|
|
781
|
+
if (!t) continue;
|
|
782
|
+
let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
|
|
783
|
+
c.push({
|
|
784
|
+
source: t,
|
|
785
|
+
index: ke(e, t),
|
|
786
|
+
tag: e.tagName.toLowerCase(),
|
|
787
|
+
label: Fe(e),
|
|
788
|
+
...n ? { text: n } : {}
|
|
789
|
+
}), l.push(e);
|
|
790
|
+
}
|
|
791
|
+
return {
|
|
792
|
+
elements: c,
|
|
793
|
+
nodes: l,
|
|
794
|
+
truncated: s
|
|
795
|
+
};
|
|
796
|
+
}, ut = () => Array.from({ length: ot }, () => {
|
|
797
|
+
let e = document.createElement("div");
|
|
798
|
+
return e.style.cssText = `position:fixed;pointer-events:none;z-index:${K.ring};outline:1.5px solid ${q.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${q.selectGlow};display:none`, e;
|
|
799
|
+
}), dt = () => {
|
|
800
|
+
let e = document.createElement("div");
|
|
801
|
+
e.style.cssText = `position:fixed;pointer-events:none;z-index:${K.overlay};border:1.5px dashed ${q.select};background:${q.selectGlow};border-radius:2px;display:none`;
|
|
802
|
+
let t = null, n = !1, r = 0, i = 0, a = () => {
|
|
803
|
+
e.style.display = "none";
|
|
804
|
+
};
|
|
805
|
+
return {
|
|
806
|
+
node: e,
|
|
807
|
+
pointerDown: (e, a) => {
|
|
808
|
+
t = {
|
|
809
|
+
x: e,
|
|
810
|
+
y: a
|
|
811
|
+
}, n = !1, r = e, i = a;
|
|
812
|
+
},
|
|
813
|
+
pointerMove: (a, o) => {
|
|
814
|
+
if (!t) return;
|
|
815
|
+
if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
|
|
816
|
+
if (Math.abs(a - t.x) < it && Math.abs(o - t.y) < it) return;
|
|
817
|
+
n = !0;
|
|
818
|
+
}
|
|
819
|
+
let s = ct(t.x, t.y, a, o);
|
|
820
|
+
e.style.display = "block", e.style.left = `${s.x}px`, e.style.top = `${s.y}px`, e.style.width = `${s.width}px`, e.style.height = `${s.height}px`;
|
|
821
|
+
},
|
|
822
|
+
pointerUp: () => {
|
|
823
|
+
let e = n, o = t;
|
|
824
|
+
if (t = null, n = !1, a(), !e || !o) return null;
|
|
825
|
+
let s = ct(o.x, o.y, r, i);
|
|
826
|
+
return s.width < at || s.height < at ? null : s;
|
|
827
|
+
},
|
|
828
|
+
cancel: () => {
|
|
829
|
+
t = null, n = !1, a();
|
|
830
|
+
},
|
|
831
|
+
isDragging: () => n
|
|
832
|
+
};
|
|
833
|
+
}, ft = (e) => {
|
|
829
834
|
let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
|
|
830
835
|
let e = document.getElementById("studio-staged");
|
|
831
836
|
return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
|
|
832
837
|
}, a = () => {
|
|
833
838
|
let e = [];
|
|
834
839
|
for (let [t, n] of r) if (n.kind === "style") {
|
|
835
|
-
let r =
|
|
840
|
+
let r = Me(t, n);
|
|
836
841
|
r && e.push(r);
|
|
837
842
|
}
|
|
838
843
|
let t = e.join("\n");
|
|
@@ -840,8 +845,8 @@ var V = (e) => [
|
|
|
840
845
|
let n = i();
|
|
841
846
|
n.textContent !== t && (n.textContent = t);
|
|
842
847
|
}, o = (e, r) => {
|
|
843
|
-
let i =
|
|
844
|
-
if (i) if (r.kind === "style")
|
|
848
|
+
let i = Y(r.source, r.index);
|
|
849
|
+
if (i) if (r.kind === "style") Ae(i, e);
|
|
845
850
|
else if (r.kind === "image") t.captureOnce(`${r.source}#${r.index}:src`, i.getAttribute("src") ?? ""), t.captureOnce(`${r.source}#${r.index}:srcset`, i.getAttribute("srcset") ?? ""), i.getAttribute("src") !== r.value && i.setAttribute("src", r.value), i.hasAttribute("srcset") && i.removeAttribute("srcset");
|
|
846
851
|
else {
|
|
847
852
|
if (i === n()) return;
|
|
@@ -854,8 +859,8 @@ var V = (e) => [
|
|
|
854
859
|
let n = r.get(e);
|
|
855
860
|
if (!n) return;
|
|
856
861
|
r.delete(e);
|
|
857
|
-
let i =
|
|
858
|
-
if (n.kind === "style") i &&
|
|
862
|
+
let i = Y(n.source, n.index);
|
|
863
|
+
if (n.kind === "style") i && je(i, e), a();
|
|
859
864
|
else if (n.kind === "image") {
|
|
860
865
|
let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
|
|
861
866
|
i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
|
|
@@ -884,7 +889,7 @@ var V = (e) => [
|
|
|
884
889
|
for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
|
|
885
890
|
}
|
|
886
891
|
};
|
|
887
|
-
},
|
|
892
|
+
}, pt = (e) => {
|
|
888
893
|
let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
|
|
889
894
|
try {
|
|
890
895
|
let e = document.createElement("div");
|
|
@@ -903,15 +908,15 @@ var V = (e) => [
|
|
|
903
908
|
n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n);
|
|
904
909
|
}, d = (e, t = !1) => {
|
|
905
910
|
if (i === e) return;
|
|
906
|
-
i && p(i), i = e, a =
|
|
911
|
+
i && p(i), i = e, a = J(e) || "", o = ke(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
|
|
907
912
|
let d = e;
|
|
908
|
-
d.style.outline = `2px solid ${
|
|
913
|
+
d.style.outline = `2px solid ${q.hover}`, d.style.outlineOffset = "3px", d.style.borderRadius = "3px", d.focus(), t && u(e), d.addEventListener("blur", c, !0), d.addEventListener("keydown", l, !0);
|
|
909
914
|
}, f = (e) => {
|
|
910
915
|
e.removeAttribute("contenteditable");
|
|
911
916
|
let t = e;
|
|
912
917
|
t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.removeEventListener("blur", c, !0), t.removeEventListener("keydown", l, !0), i = null;
|
|
913
918
|
}, p = (e) => {
|
|
914
|
-
let r =
|
|
919
|
+
let r = J(e), i = o, s = n.get(`${a}#${o}`);
|
|
915
920
|
f(e);
|
|
916
921
|
let c = (e.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
917
922
|
t.send({
|
|
@@ -922,7 +927,7 @@ var V = (e) => [
|
|
|
922
927
|
tag: e.tagName.toLowerCase(),
|
|
923
928
|
value: c,
|
|
924
929
|
previous: s,
|
|
925
|
-
occurrences: r ?
|
|
930
|
+
occurrences: r ? Oe(r).length : 1
|
|
926
931
|
}
|
|
927
932
|
});
|
|
928
933
|
}, m = (e) => {
|
|
@@ -941,16 +946,16 @@ var V = (e) => [
|
|
|
941
946
|
i && f(i);
|
|
942
947
|
}
|
|
943
948
|
};
|
|
944
|
-
},
|
|
945
|
-
function
|
|
946
|
-
return f(() =>
|
|
949
|
+
}, mt = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
|
|
950
|
+
function ht() {
|
|
951
|
+
return f(() => gt(), []), null;
|
|
947
952
|
}
|
|
948
|
-
function
|
|
949
|
-
let e = !1, t = null, n = null, r = !1, i = null, a =
|
|
953
|
+
function gt() {
|
|
954
|
+
let e = !1, t = null, n = null, r = !1, i = null, a = rt(), o = et(), { overlay: s, label: c, ring: l, ringLabel: u } = Le();
|
|
950
955
|
document.body.append(s, c, l, u);
|
|
951
|
-
let d =
|
|
956
|
+
let d = dt();
|
|
952
957
|
document.body.append(d.node);
|
|
953
|
-
let f =
|
|
958
|
+
let f = ut();
|
|
954
959
|
document.body.append(...f);
|
|
955
960
|
let p = [
|
|
956
961
|
s,
|
|
@@ -975,128 +980,128 @@ function dt() {
|
|
|
975
980
|
m = e, _();
|
|
976
981
|
}, y = () => {
|
|
977
982
|
m.length !== 0 && (m = [], _());
|
|
978
|
-
}, b = null,
|
|
983
|
+
}, b = null, x = (e) => {
|
|
979
984
|
e && !b ? (b = document.createElement("style"), b.id = "studio-pick-cursor", b.textContent = "*,*::before,*::after{cursor:crosshair !important}", document.head.appendChild(b)) : !e && b && (b.remove(), b = null);
|
|
980
|
-
},
|
|
981
|
-
if (!e ||
|
|
982
|
-
let t =
|
|
983
|
-
return !t ||
|
|
984
|
-
},
|
|
985
|
+
}, S = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, C = (e) => {
|
|
986
|
+
if (!e || S(e)) return null;
|
|
987
|
+
let t = J(e) ? e : e.closest("[data-tsd-source]");
|
|
988
|
+
return !t || S(t) || !Ve(t) ? null : t;
|
|
989
|
+
}, w = (e) => Re(s, c, e), T = () => {
|
|
985
990
|
if (n) {
|
|
986
991
|
if (!n.isConnected) {
|
|
987
|
-
|
|
992
|
+
ne();
|
|
988
993
|
return;
|
|
989
994
|
}
|
|
990
|
-
|
|
995
|
+
Re(l, u, n);
|
|
991
996
|
}
|
|
992
|
-
},
|
|
993
|
-
|
|
994
|
-
|
|
997
|
+
}, E = 0, D = () => {
|
|
998
|
+
E || !n || r || (E = requestAnimationFrame(() => {
|
|
999
|
+
E = 0, T();
|
|
995
1000
|
}));
|
|
996
|
-
},
|
|
1001
|
+
}, O = new ResizeObserver(D), k = new MutationObserver((e) => {
|
|
997
1002
|
for (let t of e) {
|
|
998
1003
|
let e = t.target;
|
|
999
1004
|
if (!p.some((t) => t === e) && !(t.type === "attributes" && t.attributeName === "data-staged-key")) {
|
|
1000
|
-
|
|
1005
|
+
D(), P.scheduleReapply();
|
|
1001
1006
|
return;
|
|
1002
1007
|
}
|
|
1003
1008
|
}
|
|
1004
|
-
}),
|
|
1005
|
-
|
|
1009
|
+
}), A = !1, ee = () => {
|
|
1010
|
+
A ||= (k.observe(document.documentElement, {
|
|
1006
1011
|
attributes: !0,
|
|
1007
1012
|
childList: !0,
|
|
1008
1013
|
characterData: !0,
|
|
1009
1014
|
subtree: !0
|
|
1010
1015
|
}), !0);
|
|
1016
|
+
}, j = () => {
|
|
1017
|
+
A &&= (k.disconnect(), !1);
|
|
1018
|
+
}, te = () => {
|
|
1019
|
+
O.disconnect(), n?.isConnected && (O.observe(n), ee());
|
|
1011
1020
|
}, ne = () => {
|
|
1012
|
-
|
|
1013
|
-
}, re = () => {
|
|
1014
|
-
D.disconnect(), n?.isConnected && (D.observe(n), te());
|
|
1015
|
-
}, A = () => {
|
|
1016
|
-
n = null, D.disconnect(), F(), T &&= (cancelAnimationFrame(T), 0), l.style.display = "none", u.style.display = "none", y(), g();
|
|
1017
|
-
}, j = (e) => C(e), M = () => {
|
|
1021
|
+
n = null, O.disconnect(), ie(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
|
|
1022
|
+
}, re = (e) => w(e), M = () => {
|
|
1018
1023
|
s.style.display = "none", c.style.display = "none";
|
|
1019
|
-
}, N =
|
|
1024
|
+
}, N = pt({
|
|
1020
1025
|
channel: o,
|
|
1021
1026
|
originals: a,
|
|
1022
1027
|
clearTextHover: () => {
|
|
1023
1028
|
i = null, M();
|
|
1024
1029
|
}
|
|
1025
|
-
}), P =
|
|
1030
|
+
}), P = ft({
|
|
1026
1031
|
originals: a,
|
|
1027
1032
|
editingNode: N.editingNode
|
|
1028
|
-
}),
|
|
1029
|
-
n?.isConnected || P.count() ?
|
|
1030
|
-
},
|
|
1031
|
-
n && r &&
|
|
1033
|
+
}), ie = () => {
|
|
1034
|
+
n?.isConnected || P.count() ? ee() : j();
|
|
1035
|
+
}, F = (n) => {
|
|
1036
|
+
n && r && I(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", U()), o.send({
|
|
1032
1037
|
type: "inspect-state",
|
|
1033
1038
|
enabled: e
|
|
1034
1039
|
});
|
|
1035
|
-
},
|
|
1040
|
+
}, I = (t) => {
|
|
1036
1041
|
if (r = !!t, r) {
|
|
1037
|
-
e &&
|
|
1042
|
+
e && F(!1), l.style.display = "none", u.style.display = "none";
|
|
1038
1043
|
for (let e of f) e.style.display = "none";
|
|
1039
|
-
} else N.commitIfEditing(), M(), document.documentElement.style.cursor = "", n &&
|
|
1044
|
+
} else N.commitIfEditing(), M(), document.documentElement.style.cursor = "", n && T(), m.length > 0 && _();
|
|
1040
1045
|
o.send({
|
|
1041
1046
|
type: "text-edit-state",
|
|
1042
1047
|
enabled: r
|
|
1043
1048
|
});
|
|
1044
|
-
},
|
|
1045
|
-
|
|
1046
|
-
let n = document.elementFromPoint(
|
|
1047
|
-
if (!
|
|
1049
|
+
}, L = 0, ae = 0, oe = 0, se = () => {
|
|
1050
|
+
L = 0;
|
|
1051
|
+
let n = document.elementFromPoint(ae, oe);
|
|
1052
|
+
if (!S(n)) {
|
|
1048
1053
|
if (r) {
|
|
1049
|
-
let e =
|
|
1054
|
+
let e = C(n);
|
|
1050
1055
|
if (e && e === N.editingNode()) {
|
|
1051
1056
|
i = null, M(), document.documentElement.style.cursor = "";
|
|
1052
1057
|
return;
|
|
1053
1058
|
}
|
|
1054
|
-
i = e, document.documentElement.style.cursor = e ? "text" : "", e ?
|
|
1059
|
+
i = e, document.documentElement.style.cursor = e ? "text" : "", e ? re(e) : M();
|
|
1055
1060
|
return;
|
|
1056
1061
|
}
|
|
1057
|
-
e && (d.isDragging() || (t = n, n &&
|
|
1062
|
+
e && (d.isDragging() || (t = n, n && w(n)));
|
|
1058
1063
|
}
|
|
1059
|
-
},
|
|
1060
|
-
!e && !r || (
|
|
1061
|
-
},
|
|
1062
|
-
|
|
1063
|
-
},
|
|
1064
|
-
|
|
1065
|
-
},
|
|
1064
|
+
}, R = (t) => {
|
|
1065
|
+
!e && !r || (ae = t.clientX, oe = t.clientY, L ||= requestAnimationFrame(se));
|
|
1066
|
+
}, z = 0, ce = () => {
|
|
1067
|
+
z = 0, e && t && w(t), r && !N.editingNode() && i?.isConnected && re(i), n && !r && T(), m.length > 0 && !r && _();
|
|
1068
|
+
}, le = () => {
|
|
1069
|
+
z ||= requestAnimationFrame(ce);
|
|
1070
|
+
}, ue = (n) => {
|
|
1066
1071
|
n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !N.editingNode() && (i = null, M(), document.documentElement.style.cursor = ""));
|
|
1067
|
-
},
|
|
1068
|
-
if (
|
|
1072
|
+
}, B = !1, V = null, H = () => {
|
|
1073
|
+
if (V != null) {
|
|
1069
1074
|
try {
|
|
1070
|
-
document.documentElement.releasePointerCapture(
|
|
1075
|
+
document.documentElement.releasePointerCapture(V);
|
|
1071
1076
|
} catch {}
|
|
1072
|
-
|
|
1077
|
+
V = null;
|
|
1073
1078
|
}
|
|
1074
|
-
},
|
|
1075
|
-
|
|
1076
|
-
},
|
|
1077
|
-
!e || t.button !== 0 || !t.isPrimary || (
|
|
1078
|
-
},
|
|
1079
|
+
}, U = () => {
|
|
1080
|
+
H(), d.cancel();
|
|
1081
|
+
}, W = (t) => {
|
|
1082
|
+
!e || t.button !== 0 || !t.isPrimary || (B = !1, d.pointerDown(t.clientX, t.clientY));
|
|
1083
|
+
}, de = (n) => {
|
|
1079
1084
|
if (!e || !n.isPrimary) return;
|
|
1080
1085
|
let r = d.isDragging();
|
|
1081
1086
|
if (d.pointerMove(n.clientX, n.clientY), d.isDragging()) {
|
|
1082
1087
|
if (!r) {
|
|
1083
|
-
|
|
1088
|
+
V = n.pointerId;
|
|
1084
1089
|
try {
|
|
1085
1090
|
document.documentElement.setPointerCapture(n.pointerId);
|
|
1086
1091
|
} catch {}
|
|
1087
1092
|
}
|
|
1088
1093
|
t = null, s.style.display = "none", c.style.display = "none";
|
|
1089
1094
|
}
|
|
1090
|
-
},
|
|
1095
|
+
}, fe = (t) => {
|
|
1091
1096
|
if (!e || !t.isPrimary) return;
|
|
1092
|
-
|
|
1097
|
+
H();
|
|
1093
1098
|
let n = d.pointerUp();
|
|
1094
1099
|
if (!n) return;
|
|
1095
|
-
|
|
1096
|
-
let { elements: r, nodes: i, truncated: a } =
|
|
1100
|
+
B = !0, ne();
|
|
1101
|
+
let { elements: r, nodes: i, truncated: a } = lt(n, p);
|
|
1097
1102
|
console.info(`[levo-inspector] region drag: ${Math.round(n.width)}×${Math.round(n.height)} — ${r.length} element(s)${a ? " (truncated)" : ""}`), v(i);
|
|
1098
1103
|
let s = ++h;
|
|
1099
|
-
|
|
1104
|
+
De(n, p).then((e) => {
|
|
1100
1105
|
s === h && (console.info(`[levo-inspector] region capture ok (${Math.round(e.length / 1024)}kB)`), o.send({
|
|
1101
1106
|
type: "region-selected",
|
|
1102
1107
|
rect: n,
|
|
@@ -1113,57 +1118,57 @@ function dt() {
|
|
|
1113
1118
|
dataUrl: null
|
|
1114
1119
|
}));
|
|
1115
1120
|
});
|
|
1116
|
-
},
|
|
1117
|
-
let t =
|
|
1121
|
+
}, pe = () => U(), me = (e) => {
|
|
1122
|
+
let t = ze(e.target);
|
|
1118
1123
|
return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
|
|
1119
|
-
},
|
|
1120
|
-
if (
|
|
1121
|
-
|
|
1124
|
+
}, G = (i) => {
|
|
1125
|
+
if (B) {
|
|
1126
|
+
B = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
|
|
1122
1127
|
return;
|
|
1123
1128
|
}
|
|
1124
1129
|
if (r) {
|
|
1125
|
-
let e =
|
|
1130
|
+
let e = C(document.elementFromPoint(i.clientX, i.clientY) || i.target);
|
|
1126
1131
|
if (!e || e === N.editingNode()) {
|
|
1127
|
-
|
|
1132
|
+
me(i);
|
|
1128
1133
|
return;
|
|
1129
1134
|
}
|
|
1130
1135
|
i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), N.startEdit(e);
|
|
1131
1136
|
return;
|
|
1132
1137
|
}
|
|
1133
1138
|
if (!e) {
|
|
1134
|
-
|
|
1139
|
+
me(i);
|
|
1135
1140
|
return;
|
|
1136
1141
|
}
|
|
1137
1142
|
i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
|
|
1138
1143
|
let a = t || i.target;
|
|
1139
|
-
if (
|
|
1144
|
+
if (S(a)) return;
|
|
1140
1145
|
let s = a.closest("[data-tsd-source]") || a;
|
|
1141
|
-
y(), g(), n = s,
|
|
1146
|
+
y(), g(), n = s, T(), te(), o.send({
|
|
1142
1147
|
type: "element-selected",
|
|
1143
|
-
element:
|
|
1148
|
+
element: We(s)
|
|
1144
1149
|
});
|
|
1145
|
-
},
|
|
1150
|
+
}, he = nt({
|
|
1146
1151
|
channel: o,
|
|
1147
1152
|
originals: a,
|
|
1148
1153
|
staged: P,
|
|
1149
|
-
setInspect:
|
|
1150
|
-
setTextEdit:
|
|
1154
|
+
setInspect: F,
|
|
1155
|
+
setTextEdit: I,
|
|
1151
1156
|
isInspecting: () => e,
|
|
1152
1157
|
isTextEditing: () => r,
|
|
1153
1158
|
editingNode: N.editingNode,
|
|
1154
1159
|
setSelected: (e) => {
|
|
1155
|
-
y(), g(), n = e,
|
|
1160
|
+
y(), g(), n = e, te();
|
|
1156
1161
|
},
|
|
1157
1162
|
selectedNode: () => n,
|
|
1158
|
-
positionSelected:
|
|
1159
|
-
clearSelection:
|
|
1160
|
-
syncDomObserver:
|
|
1161
|
-
positionHover:
|
|
1163
|
+
positionSelected: T,
|
|
1164
|
+
clearSelection: ne,
|
|
1165
|
+
syncDomObserver: ie,
|
|
1166
|
+
positionHover: w,
|
|
1162
1167
|
hideTextHover: M,
|
|
1163
1168
|
startEditAtEnd: (e) => N.startEdit(e, !0),
|
|
1164
|
-
editableTarget:
|
|
1169
|
+
editableTarget: C,
|
|
1165
1170
|
ownNodes: p
|
|
1166
|
-
}),
|
|
1171
|
+
}), ge = [
|
|
1167
1172
|
"mousedown",
|
|
1168
1173
|
"mouseup",
|
|
1169
1174
|
"dblclick",
|
|
@@ -1181,79 +1186,95 @@ function dt() {
|
|
|
1181
1186
|
"touchstart",
|
|
1182
1187
|
"touchend",
|
|
1183
1188
|
"submit"
|
|
1184
|
-
],
|
|
1189
|
+
], _e = (t) => {
|
|
1185
1190
|
e && (t.cancelable && t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation());
|
|
1186
|
-
},
|
|
1187
|
-
n && !r &&
|
|
1188
|
-
},
|
|
1191
|
+
}, ve = () => {
|
|
1192
|
+
n && !r && T(), m.length > 0 && !r && _();
|
|
1193
|
+
}, ye = () => {
|
|
1189
1194
|
let e = location.pathname.replace(/\/$/, "") || "/";
|
|
1190
1195
|
o.send({
|
|
1191
1196
|
type: "route",
|
|
1192
1197
|
route: e
|
|
1193
1198
|
});
|
|
1194
|
-
},
|
|
1195
|
-
|
|
1196
|
-
} }),
|
|
1199
|
+
}, be = tt({ onPathChange: () => {
|
|
1200
|
+
ne(), ye();
|
|
1201
|
+
} }), xe = (t) => {
|
|
1197
1202
|
if (N.editingNode()) return;
|
|
1198
1203
|
if (t.key === "Escape") {
|
|
1199
1204
|
if (e && d.isDragging()) {
|
|
1200
|
-
t.stopPropagation(),
|
|
1205
|
+
t.stopPropagation(), U();
|
|
1201
1206
|
return;
|
|
1202
1207
|
}
|
|
1203
|
-
r ? (t.stopPropagation(),
|
|
1208
|
+
r ? (t.stopPropagation(), I(!1)) : e && (t.stopPropagation(), F(!1));
|
|
1204
1209
|
return;
|
|
1205
1210
|
}
|
|
1206
|
-
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat ||
|
|
1211
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || Be(document.activeElement)) return;
|
|
1207
1212
|
let n = t.key.toLowerCase();
|
|
1208
|
-
n === "s" ? (t.preventDefault(), t.stopPropagation(),
|
|
1213
|
+
n === "s" ? (t.preventDefault(), t.stopPropagation(), F(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), I(!r));
|
|
1209
1214
|
};
|
|
1210
|
-
window.addEventListener("mousemove",
|
|
1211
|
-
for (let e of
|
|
1212
|
-
return console.info(`[levo-inspector] build ${
|
|
1213
|
-
window.removeEventListener("mousemove",
|
|
1214
|
-
for (let e of
|
|
1215
|
-
|
|
1215
|
+
window.addEventListener("mousemove", R, !0), window.addEventListener("scroll", le, !0), window.addEventListener("resize", ve), window.addEventListener("click", G, !0), window.addEventListener("keydown", xe, !0), window.addEventListener("message", he.onMessage), window.addEventListener("mouseout", ue, !0), window.addEventListener("pointerdown", W, !0), window.addEventListener("pointermove", de, !0), window.addEventListener("pointerup", fe, !0), window.addEventListener("pointercancel", pe, !0);
|
|
1216
|
+
for (let e of ge) window.addEventListener(e, _e, !0);
|
|
1217
|
+
return console.info(`[levo-inspector] build ${mt} — runtime mounted`), ye(), o.send({ type: "ready" }), () => {
|
|
1218
|
+
window.removeEventListener("mousemove", R, !0), window.removeEventListener("keydown", xe, !0), window.removeEventListener("scroll", le, !0), window.removeEventListener("resize", ve), window.removeEventListener("mouseout", ue, !0), window.removeEventListener("pointerdown", W, !0), window.removeEventListener("pointermove", de, !0), window.removeEventListener("pointerup", fe, !0), window.removeEventListener("pointercancel", pe, !0), window.removeEventListener("click", G, !0), window.removeEventListener("message", he.onMessage);
|
|
1219
|
+
for (let e of ge) window.removeEventListener(e, _e, !0);
|
|
1220
|
+
O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), L && cancelAnimationFrame(L), z && cancelAnimationFrame(z), P.teardown(), be.teardown(), N.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), U(), d.node.remove();
|
|
1216
1221
|
for (let e of f) e.remove();
|
|
1217
1222
|
};
|
|
1218
1223
|
}
|
|
1219
1224
|
//#endregion
|
|
1220
|
-
//#region src/
|
|
1221
|
-
var
|
|
1222
|
-
|
|
1223
|
-
|
|
1225
|
+
//#region src/pageId.ts
|
|
1226
|
+
var _t = "levo:page-id", vt = () => {
|
|
1227
|
+
if (typeof document > "u") return null;
|
|
1228
|
+
let e = document.querySelectorAll(`meta[name="${_t}"]`);
|
|
1229
|
+
return e[e.length - 1]?.getAttribute("content")?.trim() || null;
|
|
1230
|
+
}, yt = l(() => import("./dist-CJknSbJK.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), bt = ({ siteId: e, pageId: t }) => {
|
|
1231
|
+
let r = N(), i = n();
|
|
1232
|
+
return !r || !i ? null : /* @__PURE__ */ v(s, {
|
|
1224
1233
|
fallback: null,
|
|
1225
|
-
children: /* @__PURE__ */
|
|
1234
|
+
children: /* @__PURE__ */ v(yt, {
|
|
1235
|
+
pageId: t,
|
|
1236
|
+
siteId: e
|
|
1237
|
+
})
|
|
1226
1238
|
});
|
|
1227
|
-
},
|
|
1228
|
-
let [r] =
|
|
1239
|
+
}, xt = () => n(), St = () => t(), Ct = ({ site: t, children: n }) => {
|
|
1240
|
+
let [r] = g(() => {
|
|
1229
1241
|
if (!t) return null;
|
|
1230
|
-
let e =
|
|
1242
|
+
let e = I(t), n = F(e);
|
|
1231
1243
|
return n ? {
|
|
1232
1244
|
client: n,
|
|
1233
|
-
insights:
|
|
1245
|
+
insights: E(n, {
|
|
1234
1246
|
insightsUrl: e.insightsUrl || null,
|
|
1235
1247
|
site: e.siteId || null
|
|
1236
1248
|
}),
|
|
1237
1249
|
site: t
|
|
1238
1250
|
} : null;
|
|
1239
|
-
});
|
|
1240
|
-
return
|
|
1251
|
+
}), [i, a] = g(null), o = C({ select: (e) => e.location.pathname });
|
|
1252
|
+
return f(() => {
|
|
1253
|
+
r && (window.levo_client = r.client, window.levo_insights = r.insights);
|
|
1254
|
+
}, [r]), p(() => {
|
|
1255
|
+
if (!r) return;
|
|
1256
|
+
let e = vt();
|
|
1257
|
+
a(e), r.insights.init({ pageId: e });
|
|
1258
|
+
}, [r, o]), r ? /* @__PURE__ */ y(e, {
|
|
1241
1259
|
client: r.client,
|
|
1242
1260
|
insights: r.insights,
|
|
1243
1261
|
children: [
|
|
1244
1262
|
n,
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ v(ie, { site: r.site }),
|
|
1264
|
+
/* @__PURE__ */ v(bt, {
|
|
1265
|
+
pageId: i ?? void 0,
|
|
1266
|
+
siteId: r.site.id
|
|
1267
|
+
})
|
|
1247
1268
|
]
|
|
1248
|
-
}) : /* @__PURE__ */ _
|
|
1249
|
-
},
|
|
1269
|
+
}) : /* @__PURE__ */ v(_, { children: n });
|
|
1270
|
+
}, wt = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Tt = (e) => {
|
|
1250
1271
|
let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
|
|
1251
1272
|
for (let r = n.exec(e); r; r = n.exec(e)) {
|
|
1252
1273
|
let e = r[1];
|
|
1253
1274
|
!e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
|
|
1254
1275
|
}
|
|
1255
1276
|
return t;
|
|
1256
|
-
},
|
|
1277
|
+
}, Et = (e) => {
|
|
1257
1278
|
let t = {
|
|
1258
1279
|
meta: [],
|
|
1259
1280
|
links: [],
|
|
@@ -1261,11 +1282,11 @@ var ft = l(() => import("./dist-CJknSbJK.js").then((e) => e.n).then((e) => ({ de
|
|
|
1261
1282
|
};
|
|
1262
1283
|
if (!e?.trim()) return t;
|
|
1263
1284
|
let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
|
|
1264
|
-
let i =
|
|
1285
|
+
let i = Tt(n), a = r.trim();
|
|
1265
1286
|
return a && (i.children = a), t.scripts.push(i), "";
|
|
1266
1287
|
});
|
|
1267
|
-
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(
|
|
1268
|
-
},
|
|
1288
|
+
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(Tt(r)), "")), t;
|
|
1289
|
+
}, Dt = (e = {}, t = {}) => {
|
|
1269
1290
|
let n = {
|
|
1270
1291
|
meta: [],
|
|
1271
1292
|
links: [],
|
|
@@ -1330,21 +1351,21 @@ var ft = l(() => import("./dist-CJknSbJK.js").then((e) => e.n).then((e) => ({ de
|
|
|
1330
1351
|
let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
|
|
1331
1352
|
for (let e of y) n.scripts.push({
|
|
1332
1353
|
type: "application/ld+json",
|
|
1333
|
-
children:
|
|
1354
|
+
children: wt(e)
|
|
1334
1355
|
});
|
|
1335
1356
|
for (let r of [t.customHead, e.customHead]) {
|
|
1336
1357
|
if (!r) continue;
|
|
1337
|
-
let e =
|
|
1358
|
+
let e = Et(r);
|
|
1338
1359
|
n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
|
|
1339
1360
|
}
|
|
1340
1361
|
return n;
|
|
1341
1362
|
};
|
|
1342
|
-
function
|
|
1343
|
-
let n =
|
|
1344
|
-
return /* @__PURE__ */
|
|
1345
|
-
n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */
|
|
1346
|
-
n.links.map((e, t) => /* @__PURE__ */
|
|
1347
|
-
n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */
|
|
1363
|
+
function Ot({ meta: e, site: t }) {
|
|
1364
|
+
let n = Dt(e, t);
|
|
1365
|
+
return /* @__PURE__ */ y(_, { children: [
|
|
1366
|
+
n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ v("meta", { ...e }, `m${t}`) : /* @__PURE__ */ v("title", { children: e.title }, `t${t}`)),
|
|
1367
|
+
n.links.map((e, t) => /* @__PURE__ */ v("link", { ...e }, `l${t}`)),
|
|
1368
|
+
n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */ v("script", { ...t }, `s${n}`) : /* @__PURE__ */ v("script", {
|
|
1348
1369
|
...t,
|
|
1349
1370
|
dangerouslySetInnerHTML: { __html: e }
|
|
1350
1371
|
}, `s${n}`))
|
|
@@ -1352,25 +1373,25 @@ function xt({ meta: e, site: t }) {
|
|
|
1352
1373
|
}
|
|
1353
1374
|
//#endregion
|
|
1354
1375
|
//#region src/registration/ui.tsx
|
|
1355
|
-
var
|
|
1376
|
+
var X = (...e) => e.filter(Boolean).join(" "), Z = o.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ v("button", {
|
|
1356
1377
|
ref: o,
|
|
1357
1378
|
type: i,
|
|
1358
|
-
className:
|
|
1379
|
+
className: X("inline-flex items-center justify-center", e),
|
|
1359
1380
|
...a,
|
|
1360
|
-
children: t ? /* @__PURE__ */
|
|
1381
|
+
children: t ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(A, { className: X("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
|
|
1361
1382
|
}));
|
|
1362
|
-
|
|
1383
|
+
Z.displayName = "Btn";
|
|
1363
1384
|
//#endregion
|
|
1364
1385
|
//#region src/registration/AttendeeForm.tsx
|
|
1365
|
-
var
|
|
1386
|
+
var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o }) => /* @__PURE__ */ y("form", {
|
|
1366
1387
|
onSubmit: r,
|
|
1367
1388
|
className: "flex flex-col gap-4",
|
|
1368
1389
|
children: [
|
|
1369
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
1370
1391
|
htmlFor: "name",
|
|
1371
1392
|
className: "font-medium text-sm",
|
|
1372
1393
|
children: "Name"
|
|
1373
|
-
}), /* @__PURE__ */
|
|
1394
|
+
}), /* @__PURE__ */ v("input", {
|
|
1374
1395
|
className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1375
1396
|
placeholder: "Name",
|
|
1376
1397
|
name: "name",
|
|
@@ -1379,11 +1400,11 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1379
1400
|
onBlur: n,
|
|
1380
1401
|
required: !0
|
|
1381
1402
|
})] }),
|
|
1382
|
-
/* @__PURE__ */
|
|
1403
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
1383
1404
|
htmlFor: "email",
|
|
1384
1405
|
className: "font-medium text-sm",
|
|
1385
1406
|
children: "Email"
|
|
1386
|
-
}), /* @__PURE__ */
|
|
1407
|
+
}), /* @__PURE__ */ v("input", {
|
|
1387
1408
|
className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1388
1409
|
placeholder: "Email",
|
|
1389
1410
|
name: "email",
|
|
@@ -1393,32 +1414,32 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1393
1414
|
type: "email",
|
|
1394
1415
|
required: !0
|
|
1395
1416
|
})] }),
|
|
1396
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
1397
1418
|
htmlFor: "is_business_purchase",
|
|
1398
1419
|
className: "flex items-center gap-2 text-sm",
|
|
1399
|
-
children: [/* @__PURE__ */
|
|
1420
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1400
1421
|
type: "checkbox",
|
|
1401
1422
|
name: "is_business_purchase",
|
|
1402
1423
|
checked: e.is_business_purchase || !1,
|
|
1403
1424
|
onChange: t,
|
|
1404
1425
|
className: "rounded border-gray-300"
|
|
1405
|
-
}), /* @__PURE__ */
|
|
1426
|
+
}), /* @__PURE__ */ v("span", {
|
|
1406
1427
|
className: "font-medium",
|
|
1407
1428
|
children: "Tax for Business"
|
|
1408
1429
|
})]
|
|
1409
|
-
}), /* @__PURE__ */
|
|
1430
|
+
}), /* @__PURE__ */ v("p", {
|
|
1410
1431
|
className: "mt-1 text-gray-500 text-xs",
|
|
1411
1432
|
children: "Check this if you're purchasing for a business and need a tax-compliant invoice"
|
|
1412
1433
|
})] }),
|
|
1413
|
-
e.is_business_purchase && /* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1434
|
+
e.is_business_purchase && /* @__PURE__ */ y(_, { children: [
|
|
1435
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
1415
1436
|
htmlFor: "business_name",
|
|
1416
1437
|
className: "font-medium text-sm",
|
|
1417
|
-
children: ["Company Name ", /* @__PURE__ */
|
|
1438
|
+
children: ["Company Name ", /* @__PURE__ */ v("span", {
|
|
1418
1439
|
className: "text-red-500",
|
|
1419
1440
|
children: "*"
|
|
1420
1441
|
})]
|
|
1421
|
-
}), /* @__PURE__ */
|
|
1442
|
+
}), /* @__PURE__ */ v("input", {
|
|
1422
1443
|
className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1423
1444
|
placeholder: "Acme Corporation",
|
|
1424
1445
|
name: "billing_details.name",
|
|
@@ -1427,14 +1448,14 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1427
1448
|
onBlur: n,
|
|
1428
1449
|
required: e.is_business_purchase
|
|
1429
1450
|
})] }),
|
|
1430
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
1431
1452
|
htmlFor: "business_tax_id",
|
|
1432
1453
|
className: "font-medium text-sm",
|
|
1433
|
-
children: ["Tax ID / GST Number ", /* @__PURE__ */
|
|
1454
|
+
children: ["Tax ID / GST Number ", /* @__PURE__ */ v("span", {
|
|
1434
1455
|
className: "text-red-500",
|
|
1435
1456
|
children: "*"
|
|
1436
1457
|
})]
|
|
1437
|
-
}), /* @__PURE__ */
|
|
1458
|
+
}), /* @__PURE__ */ v("input", {
|
|
1438
1459
|
className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1439
1460
|
placeholder: "GST123456789",
|
|
1440
1461
|
name: "billing_details.tax_id",
|
|
@@ -1443,15 +1464,15 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1443
1464
|
onBlur: n,
|
|
1444
1465
|
required: e.is_business_purchase
|
|
1445
1466
|
})] }),
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1468
|
+
/* @__PURE__ */ y("p", {
|
|
1448
1469
|
className: "mb-1 font-medium text-sm",
|
|
1449
|
-
children: ["Business Address ", /* @__PURE__ */
|
|
1470
|
+
children: ["Business Address ", /* @__PURE__ */ v("span", {
|
|
1450
1471
|
className: "text-red-500",
|
|
1451
1472
|
children: "*"
|
|
1452
1473
|
})]
|
|
1453
1474
|
}),
|
|
1454
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ v("input", {
|
|
1455
1476
|
className: "mb-2 w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1456
1477
|
placeholder: "Street Address Line 1",
|
|
1457
1478
|
name: "billing_details.address.line1",
|
|
@@ -1460,7 +1481,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1460
1481
|
onBlur: n,
|
|
1461
1482
|
required: e.is_business_purchase
|
|
1462
1483
|
}),
|
|
1463
|
-
/* @__PURE__ */
|
|
1484
|
+
/* @__PURE__ */ v("input", {
|
|
1464
1485
|
className: "mb-2 w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1465
1486
|
placeholder: "Street Address Line 2 (Optional)",
|
|
1466
1487
|
name: "billing_details.address.line2",
|
|
@@ -1468,9 +1489,9 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1468
1489
|
onChange: t,
|
|
1469
1490
|
onBlur: n
|
|
1470
1491
|
}),
|
|
1471
|
-
/* @__PURE__ */
|
|
1492
|
+
/* @__PURE__ */ y("div", {
|
|
1472
1493
|
className: "grid grid-cols-2 gap-2",
|
|
1473
|
-
children: [/* @__PURE__ */
|
|
1494
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1474
1495
|
className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1475
1496
|
placeholder: "City",
|
|
1476
1497
|
name: "billing_details.address.city",
|
|
@@ -1478,7 +1499,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1478
1499
|
onChange: t,
|
|
1479
1500
|
onBlur: n,
|
|
1480
1501
|
required: e.is_business_purchase
|
|
1481
|
-
}), /* @__PURE__ */
|
|
1502
|
+
}), /* @__PURE__ */ v("input", {
|
|
1482
1503
|
className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1483
1504
|
placeholder: "State/Province",
|
|
1484
1505
|
name: "billing_details.address.state",
|
|
@@ -1488,9 +1509,9 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1488
1509
|
required: e.is_business_purchase
|
|
1489
1510
|
})]
|
|
1490
1511
|
}),
|
|
1491
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ y("div", {
|
|
1492
1513
|
className: "mt-2 grid grid-cols-2 gap-2",
|
|
1493
|
-
children: [/* @__PURE__ */
|
|
1514
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1494
1515
|
className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1495
1516
|
placeholder: "Postal Code",
|
|
1496
1517
|
name: "billing_details.address.postal_code",
|
|
@@ -1498,7 +1519,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1498
1519
|
onChange: t,
|
|
1499
1520
|
onBlur: n,
|
|
1500
1521
|
required: e.is_business_purchase
|
|
1501
|
-
}), /* @__PURE__ */
|
|
1522
|
+
}), /* @__PURE__ */ v("input", {
|
|
1502
1523
|
className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
|
|
1503
1524
|
placeholder: "Country",
|
|
1504
1525
|
name: "billing_details.address.country",
|
|
@@ -1510,15 +1531,15 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1510
1531
|
})
|
|
1511
1532
|
] })
|
|
1512
1533
|
] }),
|
|
1513
|
-
/* @__PURE__ */
|
|
1534
|
+
/* @__PURE__ */ y("div", {
|
|
1514
1535
|
className: "flex flex-col-reverse justify-end gap-4 md:flex-row",
|
|
1515
|
-
children: [/* @__PURE__ */
|
|
1536
|
+
children: [/* @__PURE__ */ v(Z, {
|
|
1516
1537
|
className: "rounded-lg bg-gray-100 px-6 py-2 font-semibold text-black hover:bg-gray-200",
|
|
1517
1538
|
type: "button",
|
|
1518
1539
|
onClick: a,
|
|
1519
1540
|
disabled: i,
|
|
1520
1541
|
children: "Back"
|
|
1521
|
-
}), /* @__PURE__ */
|
|
1542
|
+
}), /* @__PURE__ */ v(Z, {
|
|
1522
1543
|
className: "rounded-lg bg-brand px-6 py-2 font-semibold text-brand-foreground hover:opacity-90",
|
|
1523
1544
|
type: "submit",
|
|
1524
1545
|
isLoading: i,
|
|
@@ -1527,57 +1548,57 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1527
1548
|
})]
|
|
1528
1549
|
})
|
|
1529
1550
|
]
|
|
1530
|
-
}),
|
|
1551
|
+
}), At = {
|
|
1531
1552
|
USD: "$",
|
|
1532
1553
|
EUR: "€",
|
|
1533
1554
|
GBP: "£",
|
|
1534
1555
|
INR: "₹"
|
|
1535
|
-
},
|
|
1556
|
+
}, Q = (e) => e?.unit_amount ? `${At[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", jt = (e) => {
|
|
1536
1557
|
if (!e) return null;
|
|
1537
1558
|
let t = e.tax_enabled ?? !1, n = e.tax_inclusive ?? !1, r = e.taxes ?? [];
|
|
1538
1559
|
return !t || r.length === 0 ? null : n ? "(inclusive of taxes)" : "+ taxes";
|
|
1539
|
-
},
|
|
1560
|
+
}, Mt = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), Nt = (e) => {
|
|
1540
1561
|
if (!e) return !1;
|
|
1541
1562
|
let t = e;
|
|
1542
1563
|
return t.tax_enabled === !0 && t.taxes !== void 0 && t.taxes.length > 0 && t.subtotal !== void 0;
|
|
1543
|
-
},
|
|
1564
|
+
}, $ = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), Pt = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
|
|
1544
1565
|
let c = [...a].sort((e, t) => {
|
|
1545
|
-
let n =
|
|
1566
|
+
let n = $(e, s?._id), r = $(t, s?._id);
|
|
1546
1567
|
return n && !r ? -1 : !n && r ? 1 : 0;
|
|
1547
1568
|
});
|
|
1548
|
-
return /* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1569
|
+
return /* @__PURE__ */ y("div", { children: [
|
|
1570
|
+
/* @__PURE__ */ y("div", {
|
|
1550
1571
|
className: "flex items-center justify-between text-center",
|
|
1551
1572
|
children: [
|
|
1552
|
-
/* @__PURE__ */
|
|
1573
|
+
/* @__PURE__ */ v("button", {
|
|
1553
1574
|
type: "button",
|
|
1554
1575
|
className: "rounded-md p-2 hover:bg-gray-50 focus:outline-none",
|
|
1555
1576
|
"aria-label": "Back",
|
|
1556
1577
|
onClick: o,
|
|
1557
|
-
children: /* @__PURE__ */
|
|
1578
|
+
children: /* @__PURE__ */ v(O, { className: "size-4" })
|
|
1558
1579
|
}),
|
|
1559
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ y("p", {
|
|
1560
1581
|
className: "font-semibold text-md",
|
|
1561
1582
|
children: ["Apply Coupon for ", s?.title]
|
|
1562
1583
|
}),
|
|
1563
|
-
/* @__PURE__ */
|
|
1584
|
+
/* @__PURE__ */ v("div", { className: "w-4" })
|
|
1564
1585
|
]
|
|
1565
1586
|
}),
|
|
1566
|
-
/* @__PURE__ */
|
|
1587
|
+
/* @__PURE__ */ y("div", {
|
|
1567
1588
|
className: "mt-2 flex gap-4",
|
|
1568
|
-
children: [/* @__PURE__ */
|
|
1589
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1569
1590
|
className: "w-full",
|
|
1570
|
-
children: [/* @__PURE__ */
|
|
1591
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1571
1592
|
className: "w-full rounded border border-gray-300 px-3 py-2 focus:border-brand focus:outline-none",
|
|
1572
1593
|
type: "text",
|
|
1573
1594
|
placeholder: "Enter Coupon Code",
|
|
1574
1595
|
value: e,
|
|
1575
1596
|
onChange: (e) => t(e.target.value)
|
|
1576
|
-
}), n && /* @__PURE__ */
|
|
1597
|
+
}), n && /* @__PURE__ */ v("p", {
|
|
1577
1598
|
className: "mt-1 text-red-400 text-xs",
|
|
1578
1599
|
children: n
|
|
1579
1600
|
})]
|
|
1580
|
-
}), /* @__PURE__ */
|
|
1601
|
+
}), /* @__PURE__ */ v(Z, {
|
|
1581
1602
|
"aria-label": "Apply Coupon",
|
|
1582
1603
|
onClick: () => i(),
|
|
1583
1604
|
className: "rounded-lg bg-brand px-3 text-brand-foreground hover:opacity-90",
|
|
@@ -1586,55 +1607,55 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1586
1607
|
zIndex: e ? 1 : -1
|
|
1587
1608
|
},
|
|
1588
1609
|
isLoading: r,
|
|
1589
|
-
children: /* @__PURE__ */
|
|
1610
|
+
children: /* @__PURE__ */ v(D, { className: "h-fit" })
|
|
1590
1611
|
})]
|
|
1591
1612
|
}),
|
|
1592
|
-
c.length > 0 && /* @__PURE__ */
|
|
1613
|
+
c.length > 0 && /* @__PURE__ */ y("div", {
|
|
1593
1614
|
className: "mt-4 flex flex-col gap-4",
|
|
1594
|
-
children: [c.filter((e) =>
|
|
1615
|
+
children: [c.filter((e) => $(e, s?._id)).length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
1595
1616
|
className: "mb-2 text-gray-600 text-sm",
|
|
1596
1617
|
children: "Available Coupons"
|
|
1597
|
-
}), /* @__PURE__ */
|
|
1618
|
+
}), /* @__PURE__ */ v("div", {
|
|
1598
1619
|
className: "flex flex-col gap-2",
|
|
1599
|
-
children: c.filter((e) =>
|
|
1620
|
+
children: c.filter((e) => $(e, s?._id)).map((e) => /* @__PURE__ */ y("button", {
|
|
1600
1621
|
type: "button",
|
|
1601
1622
|
className: "flex flex-col gap-1 rounded-md border border-gray-300 border-dashed px-3 py-2 text-left transition hover:border-gray-400 hover:bg-gray-50",
|
|
1602
1623
|
onClick: () => {
|
|
1603
1624
|
i(e.code), t(e.code);
|
|
1604
1625
|
},
|
|
1605
|
-
children: [/* @__PURE__ */
|
|
1626
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1606
1627
|
className: "flex w-full items-center justify-between",
|
|
1607
|
-
children: [/* @__PURE__ */
|
|
1628
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1608
1629
|
className: "font-medium",
|
|
1609
1630
|
children: e.code
|
|
1610
|
-
}), /* @__PURE__ */
|
|
1631
|
+
}), /* @__PURE__ */ v("span", {
|
|
1611
1632
|
className: "text-gray-500 text-sm",
|
|
1612
|
-
children: e.kind === "percent" ? `${e.percent_off}% off` : `${
|
|
1633
|
+
children: e.kind === "percent" ? `${e.percent_off}% off` : `${At[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
|
|
1613
1634
|
})]
|
|
1614
|
-
}), e.description && /* @__PURE__ */
|
|
1635
|
+
}), e.description && /* @__PURE__ */ v("span", {
|
|
1615
1636
|
className: "text-gray-500 text-xs",
|
|
1616
1637
|
children: e.description
|
|
1617
1638
|
})]
|
|
1618
1639
|
}, e._id))
|
|
1619
|
-
})] }), c.filter((e) =>
|
|
1640
|
+
})] }), c.filter((e) => !$(e, s?._id)).length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
1620
1641
|
className: "mb-2 text-gray-400 text-sm",
|
|
1621
1642
|
children: "Not Applicable"
|
|
1622
|
-
}), /* @__PURE__ */
|
|
1643
|
+
}), /* @__PURE__ */ v("div", {
|
|
1623
1644
|
className: "flex flex-col gap-2",
|
|
1624
|
-
children: c.filter((e) =>
|
|
1645
|
+
children: c.filter((e) => !$(e, s?._id)).map((e) => /* @__PURE__ */ y("button", {
|
|
1625
1646
|
type: "button",
|
|
1626
1647
|
disabled: !0,
|
|
1627
1648
|
className: "flex cursor-not-allowed flex-col gap-1 rounded-md border border-gray-200 border-dashed px-3 py-2 text-left opacity-50",
|
|
1628
|
-
children: [/* @__PURE__ */
|
|
1649
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1629
1650
|
className: "flex w-full items-center justify-between",
|
|
1630
|
-
children: [/* @__PURE__ */
|
|
1651
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1631
1652
|
className: "font-medium",
|
|
1632
1653
|
children: e.code
|
|
1633
|
-
}), /* @__PURE__ */
|
|
1654
|
+
}), /* @__PURE__ */ v("span", {
|
|
1634
1655
|
className: "text-gray-500 text-sm",
|
|
1635
|
-
children: e.kind === "percent" ? `${e.percent_off}% off` : `${
|
|
1656
|
+
children: e.kind === "percent" ? `${e.percent_off}% off` : `${At[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
|
|
1636
1657
|
})]
|
|
1637
|
-
}), e.description && /* @__PURE__ */
|
|
1658
|
+
}), e.description && /* @__PURE__ */ v("span", {
|
|
1638
1659
|
className: "text-gray-500 text-xs",
|
|
1639
1660
|
children: e.description
|
|
1640
1661
|
})]
|
|
@@ -1642,7 +1663,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1642
1663
|
})] })]
|
|
1643
1664
|
})
|
|
1644
1665
|
] });
|
|
1645
|
-
},
|
|
1666
|
+
}, Ft = (e) => {
|
|
1646
1667
|
let t = new Date(e);
|
|
1647
1668
|
return `${new Intl.DateTimeFormat("en-GB", {
|
|
1648
1669
|
day: "numeric",
|
|
@@ -1653,24 +1674,24 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1653
1674
|
minute: "2-digit",
|
|
1654
1675
|
hour12: !0
|
|
1655
1676
|
}).format(t)}`;
|
|
1656
|
-
},
|
|
1657
|
-
let [r, i] =
|
|
1677
|
+
}, It = ({ ticketData: e, paymentData: t, type: n }) => {
|
|
1678
|
+
let [r, i] = g(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
|
|
1658
1679
|
style: "currency",
|
|
1659
1680
|
currency: t.currency || "INR",
|
|
1660
1681
|
minimumFractionDigits: 0
|
|
1661
1682
|
}).format(e);
|
|
1662
|
-
return /* @__PURE__ */
|
|
1683
|
+
return /* @__PURE__ */ v(T.Root, {
|
|
1663
1684
|
open: r,
|
|
1664
1685
|
onOpenChange: (e) => i(e),
|
|
1665
|
-
children: /* @__PURE__ */
|
|
1686
|
+
children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-50 bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
|
|
1666
1687
|
className: "fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-2rem)] w-full max-w-md -translate-x-1/2 -translate-y-1/2 flex-col overflow-y-auto rounded-2xl bg-white shadow-2xl",
|
|
1667
1688
|
children: [
|
|
1668
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ y("div", {
|
|
1669
1690
|
className: "bg-gradient-to-br from-green-50 to-emerald-50 px-6 py-6 text-center",
|
|
1670
1691
|
children: [
|
|
1671
|
-
/* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ v("div", {
|
|
1672
1693
|
className: "mx-auto mb-3 flex size-14 items-center justify-center rounded-full bg-green-100 ring-4 ring-green-50",
|
|
1673
|
-
children: /* @__PURE__ */
|
|
1694
|
+
children: /* @__PURE__ */ y("svg", {
|
|
1674
1695
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1675
1696
|
width: "28",
|
|
1676
1697
|
height: "28",
|
|
@@ -1682,72 +1703,72 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1682
1703
|
strokeLinejoin: "round",
|
|
1683
1704
|
className: "text-green-600",
|
|
1684
1705
|
"aria-hidden": "true",
|
|
1685
|
-
children: [/* @__PURE__ */
|
|
1706
|
+
children: [/* @__PURE__ */ v("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ v("polyline", { points: "22 4 12 14.01 9 11.01" })]
|
|
1686
1707
|
})
|
|
1687
1708
|
}),
|
|
1688
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ v(T.Title, {
|
|
1689
1710
|
className: "font-bold text-gray-900 text-lg",
|
|
1690
1711
|
children: n === "view" ? "Booking Details" : "Tickets Confirmed!"
|
|
1691
1712
|
}),
|
|
1692
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ v(T.Description, {
|
|
1693
1714
|
className: "mt-1 text-gray-600 text-sm",
|
|
1694
1715
|
children: n === "confirm" ? "Your tickets have been confirmed. A confirmation email is on its way." : "Here are the details about your booking."
|
|
1695
1716
|
})
|
|
1696
1717
|
]
|
|
1697
1718
|
}),
|
|
1698
|
-
/* @__PURE__ */
|
|
1719
|
+
/* @__PURE__ */ y("div", {
|
|
1699
1720
|
className: "px-6 py-5",
|
|
1700
|
-
children: [/* @__PURE__ */
|
|
1721
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1701
1722
|
className: "relative overflow-hidden rounded-xl border border-gray-200 bg-white",
|
|
1702
1723
|
children: [
|
|
1703
|
-
/* @__PURE__ */
|
|
1704
|
-
/* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1724
|
+
/* @__PURE__ */ v("div", { className: "absolute top-1/2 -left-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
|
|
1725
|
+
/* @__PURE__ */ v("div", { className: "absolute top-1/2 -right-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
|
|
1726
|
+
/* @__PURE__ */ y("div", {
|
|
1706
1727
|
className: "px-5 py-4",
|
|
1707
1728
|
children: [
|
|
1708
|
-
t.qr_image && /* @__PURE__ */
|
|
1729
|
+
t.qr_image && /* @__PURE__ */ v("div", {
|
|
1709
1730
|
className: "mb-4 flex flex-col items-center",
|
|
1710
|
-
children: /* @__PURE__ */
|
|
1731
|
+
children: /* @__PURE__ */ v("div", {
|
|
1711
1732
|
className: "rounded-lg border border-gray-200 bg-white p-2",
|
|
1712
|
-
children: /* @__PURE__ */
|
|
1733
|
+
children: /* @__PURE__ */ v("img", {
|
|
1713
1734
|
src: t.qr_image.location,
|
|
1714
1735
|
alt: "Booking QR Code",
|
|
1715
1736
|
className: "size-24"
|
|
1716
1737
|
})
|
|
1717
1738
|
})
|
|
1718
1739
|
}),
|
|
1719
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ y("div", {
|
|
1720
1741
|
className: "mb-4 flex items-center justify-between rounded-lg bg-gray-50 px-3 py-2.5",
|
|
1721
|
-
children: [/* @__PURE__ */
|
|
1742
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1722
1743
|
className: "font-medium text-gray-500 text-xs uppercase tracking-wide",
|
|
1723
1744
|
children: "Booking ID"
|
|
1724
|
-
}), /* @__PURE__ */
|
|
1745
|
+
}), /* @__PURE__ */ v("span", {
|
|
1725
1746
|
className: "font-mono font-semibold text-gray-900 text-sm",
|
|
1726
1747
|
children: t._id
|
|
1727
1748
|
})]
|
|
1728
1749
|
}),
|
|
1729
|
-
/* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
1750
|
+
/* @__PURE__ */ v("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
|
|
1751
|
+
/* @__PURE__ */ v("div", {
|
|
1731
1752
|
className: "space-y-3",
|
|
1732
1753
|
children: t.attendees.map((t) => {
|
|
1733
1754
|
let n = e.find((e) => e._id === t.ticket._id);
|
|
1734
|
-
return n ? /* @__PURE__ */
|
|
1755
|
+
return n ? /* @__PURE__ */ y("div", {
|
|
1735
1756
|
className: "flex items-center justify-between",
|
|
1736
|
-
children: [/* @__PURE__ */
|
|
1757
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1737
1758
|
className: "min-w-0 flex-1",
|
|
1738
|
-
children: [/* @__PURE__ */
|
|
1759
|
+
children: [/* @__PURE__ */ v("p", {
|
|
1739
1760
|
className: "truncate font-medium text-gray-900 text-sm",
|
|
1740
1761
|
children: t.name
|
|
1741
|
-
}), /* @__PURE__ */
|
|
1762
|
+
}), /* @__PURE__ */ v("p", {
|
|
1742
1763
|
className: "truncate text-gray-500 text-xs",
|
|
1743
1764
|
children: t.email
|
|
1744
1765
|
})]
|
|
1745
|
-
}), /* @__PURE__ */
|
|
1766
|
+
}), /* @__PURE__ */ y("div", {
|
|
1746
1767
|
className: "ml-3 shrink-0 text-right",
|
|
1747
|
-
children: [/* @__PURE__ */
|
|
1768
|
+
children: [/* @__PURE__ */ v("p", {
|
|
1748
1769
|
className: "font-medium text-gray-900 text-sm",
|
|
1749
1770
|
children: n.title
|
|
1750
|
-
}), /* @__PURE__ */
|
|
1771
|
+
}), /* @__PURE__ */ v("p", {
|
|
1751
1772
|
className: "text-gray-500 text-xs",
|
|
1752
1773
|
children: s(t.ticket.unit_amount / 100)
|
|
1753
1774
|
})]
|
|
@@ -1755,63 +1776,63 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1755
1776
|
}, t._id) : null;
|
|
1756
1777
|
})
|
|
1757
1778
|
}),
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
!o && /* @__PURE__ */
|
|
1779
|
+
/* @__PURE__ */ v("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
|
|
1780
|
+
!o && /* @__PURE__ */ y("div", {
|
|
1760
1781
|
className: "space-y-1.5 text-sm",
|
|
1761
1782
|
children: [
|
|
1762
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ y("div", {
|
|
1763
1784
|
className: "flex justify-between",
|
|
1764
|
-
children: [/* @__PURE__ */
|
|
1785
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1765
1786
|
className: "text-gray-500",
|
|
1766
1787
|
children: "Base Amount"
|
|
1767
|
-
}), /* @__PURE__ */
|
|
1788
|
+
}), /* @__PURE__ */ v("span", {
|
|
1768
1789
|
className: "font-medium text-gray-700",
|
|
1769
1790
|
children: s(t.unit_amount / 100)
|
|
1770
1791
|
})]
|
|
1771
1792
|
}),
|
|
1772
|
-
t.discount > 0 && /* @__PURE__ */
|
|
1793
|
+
t.discount > 0 && /* @__PURE__ */ y("div", {
|
|
1773
1794
|
className: "flex justify-between text-green-600",
|
|
1774
|
-
children: [/* @__PURE__ */
|
|
1795
|
+
children: [/* @__PURE__ */ v("span", { children: "Discount" }), /* @__PURE__ */ y("span", {
|
|
1775
1796
|
className: "font-medium",
|
|
1776
1797
|
children: ["- ", s(t.discount / 100)]
|
|
1777
1798
|
})]
|
|
1778
1799
|
}),
|
|
1779
|
-
t.taxes && Array.isArray(t.taxes) && t.taxes.length > 0 && t.taxes.map((e, t) => /* @__PURE__ */
|
|
1800
|
+
t.taxes && Array.isArray(t.taxes) && t.taxes.length > 0 && t.taxes.map((e, t) => /* @__PURE__ */ y("div", {
|
|
1780
1801
|
className: "flex justify-between",
|
|
1781
|
-
children: [/* @__PURE__ */
|
|
1802
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1782
1803
|
className: "text-gray-500",
|
|
1783
1804
|
children: e.label
|
|
1784
|
-
}), /* @__PURE__ */
|
|
1805
|
+
}), /* @__PURE__ */ v("span", {
|
|
1785
1806
|
className: "font-medium text-gray-700",
|
|
1786
1807
|
children: s(e.amount / 100)
|
|
1787
1808
|
})]
|
|
1788
1809
|
}, t)),
|
|
1789
|
-
/* @__PURE__ */
|
|
1810
|
+
/* @__PURE__ */ y("div", {
|
|
1790
1811
|
className: "flex justify-between border-gray-200 border-t pt-2 font-semibold text-gray-900",
|
|
1791
|
-
children: [/* @__PURE__ */
|
|
1812
|
+
children: [/* @__PURE__ */ v("span", { children: "Total Paid" }), /* @__PURE__ */ v("span", { children: s(a) })]
|
|
1792
1813
|
})
|
|
1793
1814
|
]
|
|
1794
1815
|
}),
|
|
1795
|
-
o && /* @__PURE__ */
|
|
1816
|
+
o && /* @__PURE__ */ y("div", {
|
|
1796
1817
|
className: "flex items-center justify-between font-semibold text-gray-900",
|
|
1797
|
-
children: [/* @__PURE__ */
|
|
1818
|
+
children: [/* @__PURE__ */ v("span", { children: "Total" }), /* @__PURE__ */ v("span", { children: "Free" })]
|
|
1798
1819
|
})
|
|
1799
1820
|
]
|
|
1800
1821
|
})
|
|
1801
1822
|
]
|
|
1802
|
-
}), /* @__PURE__ */
|
|
1823
|
+
}), /* @__PURE__ */ v("p", {
|
|
1803
1824
|
className: "mt-3 text-center text-gray-400 text-xs",
|
|
1804
|
-
children:
|
|
1825
|
+
children: Ft(t.created_at)
|
|
1805
1826
|
})]
|
|
1806
1827
|
}),
|
|
1807
|
-
/* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ y("div", {
|
|
1808
1829
|
className: "flex flex-col gap-2 px-6 pb-5",
|
|
1809
|
-
children: [t.invoice?.location && /* @__PURE__ */
|
|
1830
|
+
children: [t.invoice?.location && /* @__PURE__ */ y("a", {
|
|
1810
1831
|
href: t.invoice.location,
|
|
1811
1832
|
target: "_blank",
|
|
1812
1833
|
rel: "noopener noreferrer",
|
|
1813
1834
|
className: "flex w-full items-center justify-center gap-2 rounded-lg border border-gray-200 px-4 py-2.5 font-medium text-gray-700 text-sm transition-colors hover:bg-gray-50",
|
|
1814
|
-
children: [/* @__PURE__ */
|
|
1835
|
+
children: [/* @__PURE__ */ y("svg", {
|
|
1815
1836
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1816
1837
|
width: "16",
|
|
1817
1838
|
height: "16",
|
|
@@ -1823,9 +1844,9 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1823
1844
|
strokeLinejoin: "round",
|
|
1824
1845
|
"aria-hidden": "true",
|
|
1825
1846
|
children: [
|
|
1826
|
-
/* @__PURE__ */
|
|
1827
|
-
/* @__PURE__ */
|
|
1828
|
-
/* @__PURE__ */
|
|
1847
|
+
/* @__PURE__ */ v("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1848
|
+
/* @__PURE__ */ v("polyline", { points: "7 10 12 15 17 10" }),
|
|
1849
|
+
/* @__PURE__ */ v("line", {
|
|
1829
1850
|
x1: "12",
|
|
1830
1851
|
x2: "12",
|
|
1831
1852
|
y1: "15",
|
|
@@ -1833,7 +1854,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1833
1854
|
})
|
|
1834
1855
|
]
|
|
1835
1856
|
}), "Download Invoice"]
|
|
1836
|
-
}), /* @__PURE__ */
|
|
1857
|
+
}), /* @__PURE__ */ v(T.Close, {
|
|
1837
1858
|
className: "w-full rounded-lg bg-gray-900 px-4 py-2.5 font-medium text-sm text-white transition-colors hover:bg-gray-800",
|
|
1838
1859
|
children: "Done"
|
|
1839
1860
|
})]
|
|
@@ -1841,123 +1862,123 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1841
1862
|
]
|
|
1842
1863
|
})] })
|
|
1843
1864
|
});
|
|
1844
|
-
},
|
|
1865
|
+
}, Lt = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ v(T.Root, {
|
|
1845
1866
|
open: e,
|
|
1846
1867
|
onOpenChange: (e) => {
|
|
1847
1868
|
e || t();
|
|
1848
1869
|
},
|
|
1849
|
-
children: /* @__PURE__ */
|
|
1870
|
+
children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
|
|
1850
1871
|
className: "fixed top-8 left-1/2 z-[100] flex max-h-[calc(100vh-4rem)] min-h-[500px] w-[98vw] -translate-x-1/2 flex-col overflow-hidden rounded-2xl bg-white shadow-2xl md:top-10 md:w-auto md:max-w-[1000px] lg:max-w-[1100px]",
|
|
1851
|
-
children: [/* @__PURE__ */
|
|
1872
|
+
children: [/* @__PURE__ */ v(T.Close, {
|
|
1852
1873
|
className: "absolute top-4 right-4 z-10 rounded-full bg-white/90 p-2.5 text-gray-500 shadow-md backdrop-blur-sm transition-all hover:bg-white hover:text-gray-700",
|
|
1853
|
-
children: /* @__PURE__ */
|
|
1854
|
-
}), /* @__PURE__ */
|
|
1874
|
+
children: /* @__PURE__ */ v(te, { className: "size-5" })
|
|
1875
|
+
}), /* @__PURE__ */ v("div", {
|
|
1855
1876
|
className: "flex-1 overflow-y-auto rounded-2xl py-6",
|
|
1856
|
-
children: /* @__PURE__ */
|
|
1877
|
+
children: /* @__PURE__ */ v(M, {
|
|
1857
1878
|
stripe: n,
|
|
1858
1879
|
options: {
|
|
1859
1880
|
clientSecret: r,
|
|
1860
1881
|
onComplete: i
|
|
1861
1882
|
},
|
|
1862
|
-
children: /* @__PURE__ */
|
|
1883
|
+
children: /* @__PURE__ */ v(re, { className: "stripe-embedded-checkout h-full" })
|
|
1863
1884
|
})
|
|
1864
1885
|
})]
|
|
1865
1886
|
})] })
|
|
1866
|
-
}),
|
|
1867
|
-
let l =
|
|
1868
|
-
return /* @__PURE__ */
|
|
1887
|
+
}), Rt = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
|
|
1888
|
+
let l = Nt(t), u = Mt(r);
|
|
1889
|
+
return /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("div", {
|
|
1869
1890
|
className: "flex max-h-[64dvh] w-full flex-col justify-between gap-6 overflow-y-auto md:max-h-[unset] md:flex-row",
|
|
1870
|
-
children: [/* @__PURE__ */
|
|
1891
|
+
children: [/* @__PURE__ */ v("div", {
|
|
1871
1892
|
className: "flex w-full flex-col gap-3 md:w-[55%]",
|
|
1872
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1873
|
-
className:
|
|
1893
|
+
children: e.map((e) => /* @__PURE__ */ v("div", {
|
|
1894
|
+
className: X("flex cursor-pointer items-center justify-between rounded-md border border-gray-300 px-3 py-2 transition duration-300 hover:bg-gray-50", e._id === t?._id ? "border-brand bg-brand/10 hover:bg-brand/20" : ""),
|
|
1874
1895
|
onClick: () => n(e),
|
|
1875
|
-
children: /* @__PURE__ */
|
|
1876
|
-
/* @__PURE__ */
|
|
1896
|
+
children: /* @__PURE__ */ y("div", { children: [
|
|
1897
|
+
/* @__PURE__ */ v("p", {
|
|
1877
1898
|
className: "text-md",
|
|
1878
1899
|
children: e.title
|
|
1879
1900
|
}),
|
|
1880
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ v("p", {
|
|
1881
1902
|
className: "-mt-[2px] mb-1 text-gray-600 text-xs",
|
|
1882
1903
|
children: e.description
|
|
1883
1904
|
}),
|
|
1884
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ y("p", {
|
|
1885
1906
|
className: "text-md",
|
|
1886
|
-
children: [
|
|
1907
|
+
children: [Q(e), jt(e) && /* @__PURE__ */ y("span", {
|
|
1887
1908
|
className: "text-gray-500 text-sm",
|
|
1888
|
-
children: [" ",
|
|
1909
|
+
children: [" ", jt(e)]
|
|
1889
1910
|
})]
|
|
1890
1911
|
})
|
|
1891
1912
|
] })
|
|
1892
1913
|
}, e._id))
|
|
1893
|
-
}), /* @__PURE__ */
|
|
1914
|
+
}), /* @__PURE__ */ y("div", {
|
|
1894
1915
|
className: "w-full md:w-[45%]",
|
|
1895
|
-
children: [/* @__PURE__ */
|
|
1916
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1896
1917
|
className: "mt-4 flex min-h-[250px] flex-col justify-between rounded-md border border-gray-300 p-4 md:mt-0",
|
|
1897
|
-
children: [/* @__PURE__ */
|
|
1918
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
1898
1919
|
className: "border-b border-b-gray-200 pb-1 text-md",
|
|
1899
1920
|
children: "Confirm Details"
|
|
1900
|
-
}), /* @__PURE__ */
|
|
1921
|
+
}), /* @__PURE__ */ v("div", {
|
|
1901
1922
|
className: "mt-2 flex flex-col gap-2",
|
|
1902
|
-
children: t && /* @__PURE__ */
|
|
1923
|
+
children: t && /* @__PURE__ */ y("div", {
|
|
1903
1924
|
className: "flex justify-between",
|
|
1904
|
-
children: [/* @__PURE__ */
|
|
1925
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1905
1926
|
className: "text-md",
|
|
1906
1927
|
children: t.title
|
|
1907
|
-
}), /* @__PURE__ */
|
|
1928
|
+
}), /* @__PURE__ */ v("span", { children: Q({
|
|
1908
1929
|
unit_amount: l ? t.subtotal : t.unit_amount,
|
|
1909
1930
|
currency: t.currency
|
|
1910
1931
|
}) })]
|
|
1911
1932
|
})
|
|
1912
|
-
})] }), r && u ? /* @__PURE__ */
|
|
1933
|
+
})] }), r && u ? /* @__PURE__ */ y("div", {
|
|
1913
1934
|
className: "mt-2",
|
|
1914
1935
|
children: [
|
|
1915
|
-
/* @__PURE__ */
|
|
1936
|
+
/* @__PURE__ */ y("div", {
|
|
1916
1937
|
className: "flex items-center justify-between",
|
|
1917
|
-
children: [/* @__PURE__ */
|
|
1938
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1918
1939
|
className: "text-md",
|
|
1919
1940
|
children: "Subtotal"
|
|
1920
|
-
}), /* @__PURE__ */
|
|
1941
|
+
}), /* @__PURE__ */ v("span", {
|
|
1921
1942
|
className: "text-md",
|
|
1922
|
-
children:
|
|
1943
|
+
children: Q({
|
|
1923
1944
|
unit_amount: r.base_amount,
|
|
1924
1945
|
currency: t?.currency
|
|
1925
1946
|
})
|
|
1926
1947
|
})]
|
|
1927
1948
|
}),
|
|
1928
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ y("div", {
|
|
1929
1950
|
className: "flex items-center justify-between text-green-600",
|
|
1930
|
-
children: [/* @__PURE__ */
|
|
1951
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1931
1952
|
className: "text-md",
|
|
1932
1953
|
children: "Discount"
|
|
1933
|
-
}), /* @__PURE__ */
|
|
1954
|
+
}), /* @__PURE__ */ y("span", {
|
|
1934
1955
|
className: "text-md",
|
|
1935
1956
|
children: [
|
|
1936
1957
|
"-",
|
|
1937
1958
|
" ",
|
|
1938
|
-
|
|
1959
|
+
Q({
|
|
1939
1960
|
unit_amount: r.discount,
|
|
1940
1961
|
currency: t?.currency
|
|
1941
1962
|
})
|
|
1942
1963
|
]
|
|
1943
1964
|
})]
|
|
1944
1965
|
}),
|
|
1945
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ y("div", {
|
|
1946
1967
|
className: "flex items-center justify-between border-t border-t-gray-200 pt-1",
|
|
1947
|
-
children: [/* @__PURE__ */
|
|
1968
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1948
1969
|
className: "text-md",
|
|
1949
1970
|
children: "Taxable Amount"
|
|
1950
|
-
}), /* @__PURE__ */
|
|
1971
|
+
}), /* @__PURE__ */ v("span", {
|
|
1951
1972
|
className: "text-md",
|
|
1952
|
-
children:
|
|
1973
|
+
children: Q({
|
|
1953
1974
|
unit_amount: r.taxable_amount,
|
|
1954
1975
|
currency: t?.currency
|
|
1955
1976
|
})
|
|
1956
1977
|
})]
|
|
1957
1978
|
}),
|
|
1958
|
-
r.taxes?.map((e, n) => /* @__PURE__ */
|
|
1979
|
+
r.taxes?.map((e, n) => /* @__PURE__ */ y("div", {
|
|
1959
1980
|
className: "flex items-center justify-between text-gray-600",
|
|
1960
|
-
children: [/* @__PURE__ */
|
|
1981
|
+
children: [/* @__PURE__ */ y("span", {
|
|
1961
1982
|
className: "text-sm",
|
|
1962
1983
|
children: [
|
|
1963
1984
|
e.label,
|
|
@@ -1965,94 +1986,94 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1965
1986
|
e.percentage,
|
|
1966
1987
|
"%)"
|
|
1967
1988
|
]
|
|
1968
|
-
}), /* @__PURE__ */
|
|
1989
|
+
}), /* @__PURE__ */ v("span", {
|
|
1969
1990
|
className: "text-sm",
|
|
1970
|
-
children:
|
|
1991
|
+
children: Q({
|
|
1971
1992
|
unit_amount: e.amount,
|
|
1972
1993
|
currency: t?.currency
|
|
1973
1994
|
})
|
|
1974
1995
|
})]
|
|
1975
1996
|
}, e.id || e._id || n)),
|
|
1976
|
-
/* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ y("div", {
|
|
1977
1998
|
className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
|
|
1978
|
-
children: [/* @__PURE__ */
|
|
1999
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1979
2000
|
className: "text-md",
|
|
1980
2001
|
children: "Payable"
|
|
1981
|
-
}), /* @__PURE__ */
|
|
2002
|
+
}), /* @__PURE__ */ v("span", {
|
|
1982
2003
|
className: "text-md",
|
|
1983
|
-
children:
|
|
2004
|
+
children: Q({
|
|
1984
2005
|
unit_amount: r.total_amount,
|
|
1985
2006
|
currency: t?.currency
|
|
1986
2007
|
})
|
|
1987
2008
|
})]
|
|
1988
2009
|
})
|
|
1989
2010
|
]
|
|
1990
|
-
}) : r ? /* @__PURE__ */
|
|
2011
|
+
}) : r ? /* @__PURE__ */ y("div", {
|
|
1991
2012
|
className: "mt-2",
|
|
1992
2013
|
children: [
|
|
1993
|
-
/* @__PURE__ */
|
|
2014
|
+
/* @__PURE__ */ y("div", {
|
|
1994
2015
|
className: "flex items-center justify-between",
|
|
1995
|
-
children: [/* @__PURE__ */
|
|
2016
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1996
2017
|
className: "text-md",
|
|
1997
2018
|
children: "Subtotal"
|
|
1998
|
-
}), /* @__PURE__ */
|
|
2019
|
+
}), /* @__PURE__ */ v("span", {
|
|
1999
2020
|
className: "text-md",
|
|
2000
|
-
children:
|
|
2021
|
+
children: Q({
|
|
2001
2022
|
unit_amount: r.base_amount,
|
|
2002
2023
|
currency: t?.currency
|
|
2003
2024
|
})
|
|
2004
2025
|
})]
|
|
2005
2026
|
}),
|
|
2006
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ y("div", {
|
|
2007
2028
|
className: "flex items-center justify-between text-green-600",
|
|
2008
|
-
children: [/* @__PURE__ */
|
|
2029
|
+
children: [/* @__PURE__ */ v("span", {
|
|
2009
2030
|
className: "text-md",
|
|
2010
2031
|
children: "Discount"
|
|
2011
|
-
}), /* @__PURE__ */
|
|
2032
|
+
}), /* @__PURE__ */ y("span", {
|
|
2012
2033
|
className: "text-md",
|
|
2013
2034
|
children: [
|
|
2014
2035
|
"-",
|
|
2015
2036
|
" ",
|
|
2016
|
-
|
|
2037
|
+
Q({
|
|
2017
2038
|
unit_amount: r.discount,
|
|
2018
2039
|
currency: t?.currency
|
|
2019
2040
|
})
|
|
2020
2041
|
]
|
|
2021
2042
|
})]
|
|
2022
2043
|
}),
|
|
2023
|
-
/* @__PURE__ */
|
|
2044
|
+
/* @__PURE__ */ y("div", {
|
|
2024
2045
|
className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
|
|
2025
|
-
children: [/* @__PURE__ */
|
|
2046
|
+
children: [/* @__PURE__ */ v("span", {
|
|
2026
2047
|
className: "text-md",
|
|
2027
2048
|
children: "Payable"
|
|
2028
|
-
}), /* @__PURE__ */
|
|
2049
|
+
}), /* @__PURE__ */ v("span", {
|
|
2029
2050
|
className: "text-md",
|
|
2030
|
-
children:
|
|
2051
|
+
children: Q({
|
|
2031
2052
|
unit_amount: r.sale_amount,
|
|
2032
2053
|
currency: t?.currency
|
|
2033
2054
|
})
|
|
2034
2055
|
})]
|
|
2035
2056
|
})
|
|
2036
2057
|
]
|
|
2037
|
-
}) : l ? /* @__PURE__ */
|
|
2058
|
+
}) : l ? /* @__PURE__ */ y("div", {
|
|
2038
2059
|
className: "mt-2",
|
|
2039
2060
|
children: [
|
|
2040
|
-
/* @__PURE__ */
|
|
2061
|
+
/* @__PURE__ */ y("div", {
|
|
2041
2062
|
className: "flex items-center justify-between",
|
|
2042
|
-
children: [/* @__PURE__ */
|
|
2063
|
+
children: [/* @__PURE__ */ v("span", {
|
|
2043
2064
|
className: "text-md",
|
|
2044
2065
|
children: "Subtotal"
|
|
2045
|
-
}), /* @__PURE__ */
|
|
2066
|
+
}), /* @__PURE__ */ v("span", {
|
|
2046
2067
|
className: "text-md",
|
|
2047
|
-
children:
|
|
2068
|
+
children: Q({
|
|
2048
2069
|
unit_amount: t.subtotal,
|
|
2049
2070
|
currency: t?.currency
|
|
2050
2071
|
})
|
|
2051
2072
|
})]
|
|
2052
2073
|
}),
|
|
2053
|
-
t.taxes.map((e, n) => /* @__PURE__ */
|
|
2074
|
+
t.taxes.map((e, n) => /* @__PURE__ */ y("div", {
|
|
2054
2075
|
className: "flex items-center justify-between text-gray-600",
|
|
2055
|
-
children: [/* @__PURE__ */
|
|
2076
|
+
children: [/* @__PURE__ */ y("span", {
|
|
2056
2077
|
className: "text-sm",
|
|
2057
2078
|
children: [
|
|
2058
2079
|
e.label,
|
|
@@ -2060,81 +2081,81 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2060
2081
|
e.percentage,
|
|
2061
2082
|
"%)"
|
|
2062
2083
|
]
|
|
2063
|
-
}), /* @__PURE__ */
|
|
2084
|
+
}), /* @__PURE__ */ v("span", {
|
|
2064
2085
|
className: "text-sm",
|
|
2065
|
-
children:
|
|
2086
|
+
children: Q({
|
|
2066
2087
|
unit_amount: e.amount,
|
|
2067
2088
|
currency: t?.currency
|
|
2068
2089
|
})
|
|
2069
2090
|
})]
|
|
2070
2091
|
}, e.id || e._id || n)),
|
|
2071
|
-
/* @__PURE__ */
|
|
2092
|
+
/* @__PURE__ */ y("div", {
|
|
2072
2093
|
className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
|
|
2073
|
-
children: [/* @__PURE__ */
|
|
2094
|
+
children: [/* @__PURE__ */ v("span", {
|
|
2074
2095
|
className: "text-md",
|
|
2075
2096
|
children: "Payable"
|
|
2076
|
-
}), /* @__PURE__ */
|
|
2097
|
+
}), /* @__PURE__ */ v("span", {
|
|
2077
2098
|
className: "text-md",
|
|
2078
|
-
children:
|
|
2099
|
+
children: Q({
|
|
2079
2100
|
unit_amount: t.total,
|
|
2080
2101
|
currency: t?.currency
|
|
2081
2102
|
})
|
|
2082
2103
|
})]
|
|
2083
2104
|
}),
|
|
2084
|
-
t.tax_inclusive && /* @__PURE__ */
|
|
2105
|
+
t.tax_inclusive && /* @__PURE__ */ v("p", {
|
|
2085
2106
|
className: "mt-1 text-gray-500 text-xs",
|
|
2086
2107
|
children: "* Price is inclusive of taxes"
|
|
2087
2108
|
})
|
|
2088
2109
|
]
|
|
2089
|
-
}) : /* @__PURE__ */
|
|
2110
|
+
}) : /* @__PURE__ */ v("div", {
|
|
2090
2111
|
className: "mt-2",
|
|
2091
|
-
children: /* @__PURE__ */
|
|
2112
|
+
children: /* @__PURE__ */ y("div", {
|
|
2092
2113
|
className: "flex items-center justify-between font-medium",
|
|
2093
|
-
children: [/* @__PURE__ */
|
|
2114
|
+
children: [/* @__PURE__ */ v("span", {
|
|
2094
2115
|
className: "text-md",
|
|
2095
2116
|
children: "Payable"
|
|
2096
|
-
}), /* @__PURE__ */
|
|
2117
|
+
}), /* @__PURE__ */ v("span", {
|
|
2097
2118
|
className: "text-md",
|
|
2098
|
-
children:
|
|
2119
|
+
children: Q(t)
|
|
2099
2120
|
})]
|
|
2100
2121
|
})
|
|
2101
2122
|
})]
|
|
2102
|
-
}), r ? /* @__PURE__ */
|
|
2123
|
+
}), r ? /* @__PURE__ */ v("div", {
|
|
2103
2124
|
className: "flex flex-col justify-between gap-1 py-2",
|
|
2104
|
-
children: /* @__PURE__ */
|
|
2125
|
+
children: /* @__PURE__ */ y("div", {
|
|
2105
2126
|
className: "mt-2 mb-1 space-y-1 rounded-lg border border-green-200 bg-green-50 px-3 py-3",
|
|
2106
|
-
children: [/* @__PURE__ */
|
|
2127
|
+
children: [/* @__PURE__ */ y("div", {
|
|
2107
2128
|
className: "flex items-start justify-between gap-2",
|
|
2108
|
-
children: [/* @__PURE__ */
|
|
2129
|
+
children: [/* @__PURE__ */ y("div", {
|
|
2109
2130
|
className: "flex max-w-16 items-center gap-2",
|
|
2110
|
-
children: [/* @__PURE__ */
|
|
2131
|
+
children: [/* @__PURE__ */ v("div", {
|
|
2111
2132
|
className: "rounded bg-green-500 p-2",
|
|
2112
|
-
children: /* @__PURE__ */
|
|
2133
|
+
children: /* @__PURE__ */ v(ee, {
|
|
2113
2134
|
size: 16,
|
|
2114
2135
|
className: "text-white"
|
|
2115
2136
|
})
|
|
2116
|
-
}), /* @__PURE__ */
|
|
2137
|
+
}), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
|
|
2117
2138
|
className: "font-medium text-green-700 text-xs uppercase opacity-60",
|
|
2118
2139
|
children: "Coupon Applied"
|
|
2119
|
-
}), /* @__PURE__ */
|
|
2140
|
+
}), /* @__PURE__ */ v("div", {
|
|
2120
2141
|
className: "-mt-0.5 max-w-32 truncate font-bold text-green-900 text-sm tracking-wide",
|
|
2121
2142
|
children: i
|
|
2122
2143
|
})] })]
|
|
2123
|
-
}), /* @__PURE__ */
|
|
2144
|
+
}), /* @__PURE__ */ v("button", {
|
|
2124
2145
|
type: "button",
|
|
2125
2146
|
onClick: s,
|
|
2126
2147
|
className: "rounded-md p-1 text-green-600 transition-colors hover:bg-green-100 hover:text-green-800",
|
|
2127
2148
|
"aria-label": "Remove coupon",
|
|
2128
|
-
children: /* @__PURE__ */
|
|
2149
|
+
children: /* @__PURE__ */ v(j, { size: 18 })
|
|
2129
2150
|
})]
|
|
2130
|
-
}), /* @__PURE__ */
|
|
2151
|
+
}), /* @__PURE__ */ y("div", {
|
|
2131
2152
|
className: "text-green-700 text-xs",
|
|
2132
2153
|
children: [
|
|
2133
2154
|
"You are saving",
|
|
2134
2155
|
" ",
|
|
2135
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ v("span", {
|
|
2136
2157
|
className: "font-semibold",
|
|
2137
|
-
children:
|
|
2158
|
+
children: Q({
|
|
2138
2159
|
unit_amount: r.discount,
|
|
2139
2160
|
currency: t?.currency
|
|
2140
2161
|
})
|
|
@@ -2142,28 +2163,28 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2142
2163
|
]
|
|
2143
2164
|
})]
|
|
2144
2165
|
})
|
|
2145
|
-
}) : /* @__PURE__ */
|
|
2146
|
-
className:
|
|
2166
|
+
}) : /* @__PURE__ */ y("div", {
|
|
2167
|
+
className: X("flex cursor-pointer items-center justify-between border-b border-b-gray-300 pr-1 pl-4 transition-all duration-200 hover:bg-gray-50", t ? "h-[50px] py-3" : "py-3"),
|
|
2147
2168
|
onClick: () => t ? o() : null,
|
|
2148
|
-
children: [/* @__PURE__ */
|
|
2169
|
+
children: [/* @__PURE__ */ y("span", {
|
|
2149
2170
|
className: "flex items-center gap-2",
|
|
2150
|
-
children: ["Apply Coupon", a > 0 && /* @__PURE__ */
|
|
2171
|
+
children: ["Apply Coupon", a > 0 && /* @__PURE__ */ v("span", {
|
|
2151
2172
|
className: "rounded-full bg-gray-200 px-2 py-0.5 text-gray-600 text-xs",
|
|
2152
2173
|
children: a
|
|
2153
2174
|
})]
|
|
2154
|
-
}), /* @__PURE__ */
|
|
2175
|
+
}), /* @__PURE__ */ v("span", { children: /* @__PURE__ */ v(k, {}) })]
|
|
2155
2176
|
})]
|
|
2156
2177
|
})]
|
|
2157
|
-
}), /* @__PURE__ */
|
|
2178
|
+
}), /* @__PURE__ */ v("div", {
|
|
2158
2179
|
className: "mt-3 flex justify-start",
|
|
2159
|
-
children: /* @__PURE__ */
|
|
2180
|
+
children: /* @__PURE__ */ v(Z, {
|
|
2160
2181
|
onClick: c,
|
|
2161
2182
|
className: "rounded-lg bg-brand px-6 py-2 font-semibold text-brand-foreground hover:opacity-90",
|
|
2162
2183
|
children: "Continue for Payment"
|
|
2163
2184
|
})
|
|
2164
2185
|
})] });
|
|
2165
|
-
},
|
|
2166
|
-
let [e, t] =
|
|
2186
|
+
}, zt = () => {
|
|
2187
|
+
let [e, t] = g(null), [n, r] = g(null), [i, a] = g(!1), [o, s] = g(null);
|
|
2167
2188
|
return {
|
|
2168
2189
|
stripePromise: e,
|
|
2169
2190
|
config: n,
|
|
@@ -2186,7 +2207,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2186
2207
|
s(() => e);
|
|
2187
2208
|
}, [])
|
|
2188
2209
|
};
|
|
2189
|
-
},
|
|
2210
|
+
}, Bt = {
|
|
2190
2211
|
name: "",
|
|
2191
2212
|
email: "",
|
|
2192
2213
|
is_business_purchase: !1,
|
|
@@ -2202,77 +2223,77 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2202
2223
|
country: ""
|
|
2203
2224
|
}
|
|
2204
2225
|
}
|
|
2205
|
-
},
|
|
2226
|
+
}, Vt = (e, t, n) => {
|
|
2206
2227
|
let r = t.split("."), i = structuredClone(e), a = i, o = r.length - 1;
|
|
2207
2228
|
return r.forEach((e, t) => {
|
|
2208
2229
|
t === o ? a[e] = n : a = a[e];
|
|
2209
2230
|
}), i;
|
|
2210
|
-
},
|
|
2231
|
+
}, Ht = async (e, t) => {
|
|
2211
2232
|
try {
|
|
2212
2233
|
let n = new URLSearchParams();
|
|
2213
2234
|
return n.append("query", JSON.stringify({ where: { status: "active" } })), (await e.fetch?.url(`/v1/event/event/${t}/ticket/query?${n.toString()}`).get().json())?.content?.data;
|
|
2214
2235
|
} catch (t) {
|
|
2215
|
-
e.logger?.error("Failed to fetch event tickets", { exception:
|
|
2236
|
+
e.logger?.error("Failed to fetch event tickets", { exception: x(t) });
|
|
2216
2237
|
}
|
|
2217
|
-
},
|
|
2218
|
-
let a = n(), [o, s] =
|
|
2219
|
-
|
|
2220
|
-
}, { Razorpay:
|
|
2221
|
-
let e =
|
|
2238
|
+
}, Ut = ({ eventID: e, title: t, external: r, buttonText: i = "Register Now" }) => {
|
|
2239
|
+
let a = n(), [o, s] = g([]), [c, l] = g(!0), [d, p] = g(!1), [m, b] = g(!1), [S, C] = g(null), [w, E] = g(void 0), [D, O] = g(""), [k, A] = g(null), [ee, j] = g(!1), [re, M] = g(null), [N, P] = g(!1), [ie, F] = g(1), [I, L] = g(null), [ae, oe] = g([]), [se, R] = g(Bt), z = h(null), ce = () => R(Bt), le = () => {
|
|
2240
|
+
A(null), E(void 0), M(null), j(!1), O(""), L(null), p(!1), F(1), ce();
|
|
2241
|
+
}, { Razorpay: ue } = ne(), { stripePromise: B, config: V, isOpen: H, openStripeCheckout: U, closeStripeCheckout: W, setOnComplete: de } = zt(), fe = () => {
|
|
2242
|
+
let e = z.current;
|
|
2222
2243
|
!e || !a || a.fetch?.url(`/v1/event/booking/${e.bookingId}/confirm-booking`)?.post({ session_id: e.sessionId })?.json().then((e) => {
|
|
2223
|
-
e?.content?.data &&
|
|
2244
|
+
e?.content?.data && E(e?.content?.data), W(), z.current = null;
|
|
2224
2245
|
}).catch((e) => {
|
|
2225
|
-
a.logger?.error("Failed to confirm booking after Stripe payment", { exception:
|
|
2246
|
+
a.logger?.error("Failed to confirm booking after Stripe payment", { exception: x(e) }), W(), z.current = null;
|
|
2226
2247
|
});
|
|
2227
|
-
},
|
|
2248
|
+
}, pe = async () => {
|
|
2228
2249
|
if (!a) return;
|
|
2229
|
-
|
|
2230
|
-
let { name: t, email: n, is_business_purchase: r, billing_details: i } =
|
|
2250
|
+
b(!0), L(null);
|
|
2251
|
+
let { name: t, email: n, is_business_purchase: r, billing_details: i } = se;
|
|
2231
2252
|
try {
|
|
2232
2253
|
let o = {
|
|
2233
2254
|
event: e,
|
|
2234
|
-
coupon:
|
|
2255
|
+
coupon: D,
|
|
2235
2256
|
attendees: [{
|
|
2236
2257
|
name: t,
|
|
2237
2258
|
email: n,
|
|
2238
|
-
ticket:
|
|
2259
|
+
ticket: S?._id,
|
|
2239
2260
|
details: {}
|
|
2240
2261
|
}]
|
|
2241
2262
|
};
|
|
2242
2263
|
r && (o.is_business_purchase = !0, o.billing_details = i);
|
|
2243
2264
|
let s = await a.fetch?.url(`/v1/event/event/${e}/booking/create-new-booking`)?.post(o).json();
|
|
2244
|
-
if (!s?.status)
|
|
2265
|
+
if (!s?.status) L("Booking failed. Please try again.");
|
|
2245
2266
|
else {
|
|
2246
|
-
|
|
2267
|
+
le();
|
|
2247
2268
|
let e = s?.content?.meta;
|
|
2248
2269
|
if (e?.key) {
|
|
2249
2270
|
let t = s?.content.data?._id;
|
|
2250
|
-
e.provider === "stripe" && e.client_secret ? (
|
|
2271
|
+
e.provider === "stripe" && e.client_secret ? (z.current = t && e.session_id ? {
|
|
2251
2272
|
bookingId: t,
|
|
2252
2273
|
sessionId: e.session_id
|
|
2253
|
-
} : null,
|
|
2274
|
+
} : null, de(fe), await U({
|
|
2254
2275
|
key: e.key,
|
|
2255
2276
|
client_secret: e.client_secret,
|
|
2256
2277
|
amount: s?.content.data?.unit_amount || 0,
|
|
2257
2278
|
currency: e.currency || "USD",
|
|
2258
2279
|
provider: "stripe",
|
|
2259
2280
|
reference_id: e.reference_id || ""
|
|
2260
|
-
})) :
|
|
2281
|
+
})) : me({
|
|
2261
2282
|
key: e.key,
|
|
2262
2283
|
amount: s?.content.data?.unit_amount,
|
|
2263
2284
|
currency: e.currency || "INR",
|
|
2264
2285
|
order_id: e.order_id,
|
|
2265
2286
|
booking_id: t
|
|
2266
2287
|
});
|
|
2267
|
-
} else
|
|
2288
|
+
} else E(s?.content.data);
|
|
2268
2289
|
}
|
|
2269
2290
|
} catch (e) {
|
|
2270
|
-
|
|
2291
|
+
L(x(e).message || "Something went wrong. Please try again.");
|
|
2271
2292
|
}
|
|
2272
|
-
|
|
2273
|
-
},
|
|
2293
|
+
b(!1);
|
|
2294
|
+
}, me = async (e) => {
|
|
2274
2295
|
if (!a) return;
|
|
2275
|
-
let n = new
|
|
2296
|
+
let n = new ue({
|
|
2276
2297
|
key: e.key,
|
|
2277
2298
|
amount: e.amount ?? 0,
|
|
2278
2299
|
currency: e.currency,
|
|
@@ -2285,9 +2306,9 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2285
2306
|
payment_id: t.razorpay_payment_id,
|
|
2286
2307
|
signature: t.razorpay_signature
|
|
2287
2308
|
})?.json().then((e) => {
|
|
2288
|
-
e?.content?.data?.status &&
|
|
2309
|
+
e?.content?.data?.status && E(e?.content?.data);
|
|
2289
2310
|
}).catch((e) => {
|
|
2290
|
-
a.logger?.error("Failed to confirm Razorpay booking", { exception:
|
|
2311
|
+
a.logger?.error("Failed to confirm Razorpay booking", { exception: x(e) });
|
|
2291
2312
|
});
|
|
2292
2313
|
},
|
|
2293
2314
|
prefill: {
|
|
@@ -2298,19 +2319,19 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2298
2319
|
theme: { color: "#FC751A" }
|
|
2299
2320
|
});
|
|
2300
2321
|
n.on("payment.failed", (e) => {
|
|
2301
|
-
a.logger?.error("Razorpay payment failed", { exception:
|
|
2322
|
+
a.logger?.error("Razorpay payment failed", { exception: x(e.error) });
|
|
2302
2323
|
}), n.open();
|
|
2303
|
-
},
|
|
2324
|
+
}, G = u(async () => {
|
|
2304
2325
|
if (a) try {
|
|
2305
2326
|
let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/list-public-coupons`)?.get().json();
|
|
2306
|
-
t?.status && t?.content?.data &&
|
|
2327
|
+
t?.status && t?.content?.data && oe(t.content.data);
|
|
2307
2328
|
} catch (e) {
|
|
2308
|
-
a.logger?.error("Failed to fetch public coupons", { exception:
|
|
2329
|
+
a.logger?.error("Failed to fetch public coupons", { exception: x(e) });
|
|
2309
2330
|
}
|
|
2310
|
-
}, [a, e]),
|
|
2331
|
+
}, [a, e]), he = async (t) => {
|
|
2311
2332
|
if (!a) return;
|
|
2312
|
-
let n = t ??
|
|
2313
|
-
|
|
2333
|
+
let n = t ?? D;
|
|
2334
|
+
j(!0), M(null);
|
|
2314
2335
|
try {
|
|
2315
2336
|
let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/validate-coupon-code`)?.post({
|
|
2316
2337
|
coupon: n,
|
|
@@ -2318,31 +2339,31 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2318
2339
|
attendees: [{
|
|
2319
2340
|
name: "",
|
|
2320
2341
|
email: "",
|
|
2321
|
-
ticket:
|
|
2342
|
+
ticket: S?._id
|
|
2322
2343
|
}]
|
|
2323
2344
|
}).json();
|
|
2324
|
-
t?.status && (
|
|
2345
|
+
t?.status && (A(t.content.data), O(n)), P(!1), j(!1);
|
|
2325
2346
|
} catch (e) {
|
|
2326
|
-
M(
|
|
2347
|
+
M(x(e).message), j(!1);
|
|
2327
2348
|
}
|
|
2328
|
-
},
|
|
2329
|
-
|
|
2330
|
-
},
|
|
2331
|
-
|
|
2332
|
-
},
|
|
2333
|
-
M(null),
|
|
2334
|
-
},
|
|
2349
|
+
}, ge = (e) => {
|
|
2350
|
+
O(""), A(null), M(null), j(!1), L(null), C(e);
|
|
2351
|
+
}, _e = () => {
|
|
2352
|
+
A(null), M(null), O("");
|
|
2353
|
+
}, ve = () => {
|
|
2354
|
+
M(null), j(!1), O(""), P(!1);
|
|
2355
|
+
}, ye = (e) => {
|
|
2335
2356
|
let { name: t, value: n, type: r, checked: i } = e.target;
|
|
2336
|
-
|
|
2337
|
-
},
|
|
2338
|
-
e?.preventDefault(),
|
|
2357
|
+
R((e) => Vt(e, t, r === "checkbox" ? i : n));
|
|
2358
|
+
}, be = () => {}, xe = (e) => {
|
|
2359
|
+
e?.preventDefault(), pe();
|
|
2339
2360
|
};
|
|
2340
2361
|
if (f(() => {
|
|
2341
2362
|
if (r) {
|
|
2342
2363
|
l(!1);
|
|
2343
2364
|
return;
|
|
2344
2365
|
}
|
|
2345
|
-
e && a && (l(!0),
|
|
2366
|
+
e && a && (l(!0), Ht(a, e).then((e) => {
|
|
2346
2367
|
s(e ?? []), e && e.length > 0 && C(e[0] || null), l(!1);
|
|
2347
2368
|
}));
|
|
2348
2369
|
}, [
|
|
@@ -2350,108 +2371,108 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2350
2371
|
r,
|
|
2351
2372
|
a
|
|
2352
2373
|
]), f(() => {
|
|
2353
|
-
|
|
2354
|
-
}, [
|
|
2355
|
-
d && e &&
|
|
2374
|
+
S?.unit_amount === 0 && o?.length === 1 && F(2);
|
|
2375
|
+
}, [S, o]), f(() => {
|
|
2376
|
+
d && e && G();
|
|
2356
2377
|
}, [
|
|
2357
2378
|
d,
|
|
2358
2379
|
e,
|
|
2359
|
-
|
|
2360
|
-
]), r) return /* @__PURE__ */
|
|
2380
|
+
G
|
|
2381
|
+
]), r) return /* @__PURE__ */ v("div", {
|
|
2361
2382
|
className: "my-2",
|
|
2362
|
-
children: /* @__PURE__ */
|
|
2383
|
+
children: /* @__PURE__ */ v(Z, {
|
|
2363
2384
|
className: "rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground hover:opacity-90",
|
|
2364
2385
|
onClick: () => window.open(r, "_blank", "noopener,noreferrer"),
|
|
2365
2386
|
children: i
|
|
2366
2387
|
})
|
|
2367
2388
|
});
|
|
2368
|
-
if (c) return /* @__PURE__ */
|
|
2389
|
+
if (c) return /* @__PURE__ */ v("div", {
|
|
2369
2390
|
className: "my-2",
|
|
2370
|
-
children: /* @__PURE__ */
|
|
2391
|
+
children: /* @__PURE__ */ v(Z, {
|
|
2371
2392
|
className: "rounded-lg bg-brand px-4 py-2 font-bold text-brand-foreground",
|
|
2372
2393
|
children: "Loading..."
|
|
2373
2394
|
})
|
|
2374
2395
|
});
|
|
2375
|
-
let
|
|
2376
|
-
return /* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2396
|
+
let Se = k?.sale_amount === 0 || S?.unit_amount === 0 ? "Complete Registration" : "Pay";
|
|
2397
|
+
return /* @__PURE__ */ y(_, { children: [
|
|
2398
|
+
/* @__PURE__ */ v("div", {
|
|
2378
2399
|
className: "my-2",
|
|
2379
|
-
children: o?.length ? /* @__PURE__ */
|
|
2400
|
+
children: o?.length ? /* @__PURE__ */ v(Z, {
|
|
2380
2401
|
onClick: () => p(!0),
|
|
2381
2402
|
className: "rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground hover:opacity-90",
|
|
2382
2403
|
children: i
|
|
2383
|
-
}) : /* @__PURE__ */
|
|
2404
|
+
}) : /* @__PURE__ */ v("p", {
|
|
2384
2405
|
className: "text-red-500",
|
|
2385
2406
|
children: "No tickets available for this event."
|
|
2386
2407
|
})
|
|
2387
2408
|
}),
|
|
2388
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ v(T.Root, {
|
|
2389
2410
|
open: d,
|
|
2390
2411
|
onOpenChange: (e) => {
|
|
2391
|
-
e ||
|
|
2412
|
+
e || le();
|
|
2392
2413
|
},
|
|
2393
|
-
children: /* @__PURE__ */
|
|
2394
|
-
className:
|
|
2395
|
-
children: [/* @__PURE__ */
|
|
2414
|
+
children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
|
|
2415
|
+
className: X("fixed top-24 left-1/2 z-[100] flex max-h-[calc(100vh-7rem)] w-[90%] -translate-x-1/2 flex-col overflow-y-auto rounded-lg bg-white p-4", N ? "md:w-[30%]" : "md:w-[40%]"),
|
|
2416
|
+
children: [/* @__PURE__ */ y("div", {
|
|
2396
2417
|
className: `mb-4 flex w-full items-start justify-between ${N ? "" : "pb-[6px]"} `,
|
|
2397
|
-
children: [/* @__PURE__ */
|
|
2418
|
+
children: [/* @__PURE__ */ y(T.Title, {
|
|
2398
2419
|
className: "font-semibold text-lg",
|
|
2399
2420
|
children: [
|
|
2400
2421
|
"Register for ",
|
|
2401
2422
|
t,
|
|
2402
2423
|
"!"
|
|
2403
2424
|
]
|
|
2404
|
-
}), /* @__PURE__ */
|
|
2425
|
+
}), /* @__PURE__ */ v(T.Close, {
|
|
2405
2426
|
className: "rounded-md p-2 hover:bg-gray-100 focus:outline-none",
|
|
2406
|
-
children: /* @__PURE__ */
|
|
2427
|
+
children: /* @__PURE__ */ v(te, { className: "size-4" })
|
|
2407
2428
|
})]
|
|
2408
|
-
}), /* @__PURE__ */
|
|
2429
|
+
}), /* @__PURE__ */ y("div", { children: [I && /* @__PURE__ */ v("div", {
|
|
2409
2430
|
className: "mb-4 rounded-md bg-red-50 p-3 text-red-600 text-sm",
|
|
2410
|
-
children:
|
|
2411
|
-
}),
|
|
2412
|
-
couponCode:
|
|
2413
|
-
onCouponCodeChange:
|
|
2414
|
-
couponError:
|
|
2415
|
-
couponLoading:
|
|
2416
|
-
onValidateCoupon:
|
|
2417
|
-
publicCoupons:
|
|
2418
|
-
onBack:
|
|
2419
|
-
selectedTicket:
|
|
2420
|
-
}) : /* @__PURE__ */
|
|
2431
|
+
children: I
|
|
2432
|
+
}), ie === 1 ? /* @__PURE__ */ v("div", { children: N ? /* @__PURE__ */ v(Pt, {
|
|
2433
|
+
couponCode: D,
|
|
2434
|
+
onCouponCodeChange: O,
|
|
2435
|
+
couponError: re,
|
|
2436
|
+
couponLoading: ee,
|
|
2437
|
+
onValidateCoupon: he,
|
|
2438
|
+
publicCoupons: ae,
|
|
2439
|
+
onBack: ve,
|
|
2440
|
+
selectedTicket: S
|
|
2441
|
+
}) : /* @__PURE__ */ v(Rt, {
|
|
2421
2442
|
tickets: o,
|
|
2422
|
-
selectedTicket:
|
|
2423
|
-
onSelectTicket:
|
|
2424
|
-
discount:
|
|
2425
|
-
couponCode:
|
|
2426
|
-
publicCouponsCount:
|
|
2443
|
+
selectedTicket: S,
|
|
2444
|
+
onSelectTicket: ge,
|
|
2445
|
+
discount: k,
|
|
2446
|
+
couponCode: D,
|
|
2447
|
+
publicCouponsCount: ae.length,
|
|
2427
2448
|
onApplyCouponClick: () => P(!0),
|
|
2428
|
-
onRemoveCoupon:
|
|
2429
|
-
onNext: () =>
|
|
2430
|
-
}) }) : /* @__PURE__ */
|
|
2431
|
-
values:
|
|
2432
|
-
handleChange:
|
|
2433
|
-
handleBlur:
|
|
2434
|
-
handleSubmit:
|
|
2435
|
-
registerLoading:
|
|
2436
|
-
onBack: () =>
|
|
2437
|
-
submitLabel:
|
|
2449
|
+
onRemoveCoupon: _e,
|
|
2450
|
+
onNext: () => F(2)
|
|
2451
|
+
}) }) : /* @__PURE__ */ v(kt, {
|
|
2452
|
+
values: se,
|
|
2453
|
+
handleChange: ye,
|
|
2454
|
+
handleBlur: be,
|
|
2455
|
+
handleSubmit: xe,
|
|
2456
|
+
registerLoading: m,
|
|
2457
|
+
onBack: () => F(1),
|
|
2458
|
+
submitLabel: Se
|
|
2438
2459
|
})] })]
|
|
2439
2460
|
})] })
|
|
2440
2461
|
}),
|
|
2441
|
-
w && /* @__PURE__ */
|
|
2462
|
+
w && /* @__PURE__ */ v(It, {
|
|
2442
2463
|
paymentData: w,
|
|
2443
2464
|
ticketData: o,
|
|
2444
2465
|
type: "confirm"
|
|
2445
2466
|
}),
|
|
2446
|
-
|
|
2447
|
-
isOpen:
|
|
2448
|
-
onClose:
|
|
2449
|
-
stripePromise:
|
|
2450
|
-
clientSecret:
|
|
2451
|
-
onComplete:
|
|
2467
|
+
H && V && /* @__PURE__ */ v(Lt, {
|
|
2468
|
+
isOpen: H,
|
|
2469
|
+
onClose: W,
|
|
2470
|
+
stripePromise: B,
|
|
2471
|
+
clientSecret: V.clientSecret,
|
|
2472
|
+
onComplete: fe
|
|
2452
2473
|
})
|
|
2453
2474
|
] });
|
|
2454
|
-
},
|
|
2475
|
+
}, Wt = (e) => typeof e == "string" && e.trim() ? e : void 0, Gt = (e) => typeof e == "string" ? e : e?.location ?? void 0, Kt = (e, t) => {
|
|
2455
2476
|
let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
|
|
2456
2477
|
return {
|
|
2457
2478
|
title: n.meta_title || r,
|
|
@@ -2461,33 +2482,33 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2461
2482
|
og: {
|
|
2462
2483
|
title: n.og_title || void 0,
|
|
2463
2484
|
description: n.og_description || void 0,
|
|
2464
|
-
image:
|
|
2485
|
+
image: Gt(n.og_image),
|
|
2465
2486
|
url: n.og_url || void 0
|
|
2466
2487
|
},
|
|
2467
2488
|
twitter: { card: n.twitter_card || void 0 },
|
|
2468
2489
|
ldJson: n.ld_json || void 0,
|
|
2469
2490
|
customHead: n.head_code || void 0
|
|
2470
2491
|
};
|
|
2471
|
-
},
|
|
2492
|
+
}, qt = (e) => ({
|
|
2472
2493
|
description: e.description || void 0,
|
|
2473
2494
|
icon: e.icon?.location || void 0,
|
|
2474
2495
|
customHead: e.settings?.head_code || void 0
|
|
2475
|
-
}),
|
|
2476
|
-
let i =
|
|
2496
|
+
}), Jt = (e) => (t = {}, n) => (r) => {
|
|
2497
|
+
let i = Kt(t, e.name);
|
|
2477
2498
|
if (n) {
|
|
2478
2499
|
let t = r?.loaderData?.[n.source];
|
|
2479
2500
|
if (t) {
|
|
2480
|
-
let r = n.title ?
|
|
2501
|
+
let r = n.title ? Wt(t[n.title]) : void 0;
|
|
2481
2502
|
r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
|
|
2482
2503
|
...i.og,
|
|
2483
2504
|
title: r
|
|
2484
2505
|
});
|
|
2485
|
-
let a = n.description ?
|
|
2506
|
+
let a = n.description ? Wt(t[n.description]) : void 0;
|
|
2486
2507
|
a && (i.description = a, i.og = {
|
|
2487
2508
|
...i.og,
|
|
2488
2509
|
description: a
|
|
2489
2510
|
});
|
|
2490
|
-
let o = n.image ?
|
|
2511
|
+
let o = n.image ? Gt(t[n.image]) : void 0;
|
|
2491
2512
|
o && (i.og = {
|
|
2492
2513
|
...i.og,
|
|
2493
2514
|
image: o
|
|
@@ -2498,10 +2519,14 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2498
2519
|
let t = r?.match?.pathname, n = (e.domain || "").trim();
|
|
2499
2520
|
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + t);
|
|
2500
2521
|
}
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2522
|
+
let a = Dt(i, qt(e)), o = t.id?.trim();
|
|
2523
|
+
return o && a.meta.push({
|
|
2524
|
+
name: _t,
|
|
2525
|
+
content: o
|
|
2526
|
+
}), a;
|
|
2527
|
+
}, Yt = (e) => {
|
|
2528
|
+
let t = I(e);
|
|
2529
|
+
return (e) => ({ context: n, params: r }) => G({
|
|
2505
2530
|
queryClient: n.queryClient,
|
|
2506
2531
|
config: t,
|
|
2507
2532
|
sources: e,
|
|
@@ -2509,4 +2534,4 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2509
2534
|
});
|
|
2510
2535
|
};
|
|
2511
2536
|
//#endregion
|
|
2512
|
-
export {
|
|
2537
|
+
export { le as ColorModeProvider, ht as Inspector, ie as LevoChat, Ut as LevoEventRegister, ge as LevoForm, bt as LevoPopups, Ct as LevoSiteProvider, _t as PAGE_ID_META, Ot as PageHead, Jt as createLevoHead, Yt as createLevoLoader, F as createSiteClient, Dt as pageHead, Et as parseRawHead, G as prefetchLevoSources, vt as readPageId, I as siteConfigFromJson, ue as useColorMode, me as useLevoForm, St as useLevoInsights, pe as useLevoRecord, xt as useLevoSite, fe as useLevoSource };
|