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