@levo-so/site-runtime 0.3.11 → 0.3.13

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
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { i as e, n as t } from "./dist-BdNHqoWi.js";
2
+ import { i as e, n as t } from "./dist-CEdznbFW.js";
3
3
  import { i as n, n as r, r as i } from "./LevoProvider-Bsjkcwc8.js";
4
4
  import { t as a } from "./inlineCollectionTheme-CWcMCUti.js";
5
5
  import { t as o } from "./inlineBaseTheme-BB9e6h5f.js";
@@ -7,33 +7,33 @@ import { a as s, c, d as l, f as u, i as d, l as f, n as p, o as m, r as h, s as
7
7
  import { createLevoClient as y, getLevoError as b } from "@levo-so/core";
8
8
  import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
9
9
  import * as w from "react";
10
- import { Suspense as T, createContext as E, lazy as D, useCallback as O, useContext as ee, useEffect as k, useLayoutEffect as A, useMemo as j, useRef as M, useState as N } from "react";
11
- import { Dialog as P } from "@base-ui/react/dialog";
12
- import { useMutation as F, useQuery as I, useQueryClient as L } from "@tanstack/react-query";
13
- import { ScriptOnce as te, redirect as R, useRouterState as z } from "@tanstack/react-router";
14
- import { createLevoInsights as ne } from "@levo-so/insights";
15
- import { CheckIcon as re, ChevronLeftIcon as ie, ChevronRightIcon as ae, LoaderCircle as B, Tag as V, X as oe, XIcon as se } from "lucide-react";
10
+ import { Suspense as T, createContext as E, lazy as D, useCallback as O, useContext as k, useEffect as A, useLayoutEffect as j, useMemo as M, useRef as N, useState as P, useSyncExternalStore as F } from "react";
11
+ import { Dialog as I } from "@base-ui/react/dialog";
12
+ import { keepPreviousData as L, useMutation as R, useQuery as z, useQueryClient as B } from "@tanstack/react-query";
13
+ import { ScriptOnce as V, redirect as ee, useRouterState as H } from "@tanstack/react-router";
14
+ import { createLevoInsights as te } from "@levo-so/insights";
15
+ import { CheckIcon as ne, ChevronLeftIcon as U, ChevronRightIcon as re, LoaderCircle as ie, Tag as ae, X as oe, XIcon as se } from "lucide-react";
16
16
  import { useRazorpay as ce } from "react-razorpay";
17
- import { EmbeddedCheckout as H, EmbeddedCheckoutProvider as le } from "@stripe/react-stripe-js";
17
+ import { EmbeddedCheckout as le, EmbeddedCheckoutProvider as W } from "@stripe/react-stripe-js";
18
18
  //#region src/access/types.ts
19
- var U = [
19
+ var ue = [
20
20
  "otp",
21
21
  "magiclink",
22
22
  "whatsapp"
23
- ], W = [
23
+ ], G = [
24
24
  "google",
25
25
  "microsoft",
26
26
  "linkedin"
27
- ], ue = [...U, ...W], de = "otp", G = (e) => typeof e == "object" && !!e && !Array.isArray(e), K = (e) => U.includes(e), fe = (e) => W.includes(e), pe = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], me = (e) => e, he = (e) => {
28
- if (!G(e)) return null;
29
- let t = e.enabled === void 0 ? !0 : e.enabled === !0, n = G(e.options) ? e.options : {};
27
+ ], de = [...ue, ...G], fe = "otp", K = (e) => typeof e == "object" && !!e && !Array.isArray(e), pe = (e) => ue.includes(e), me = (e) => G.includes(e), he = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], ge = (e) => e, _e = (e) => {
28
+ if (!K(e)) return null;
29
+ let t = e.enabled === void 0 ? !0 : e.enabled === !0, n = K(e.options) ? e.options : {};
30
30
  switch (e.kind) {
31
31
  case "authentication": return {
32
32
  kind: "authentication",
33
33
  enabled: t,
34
34
  options: {
35
- methods: pe(n.methods).filter((e) => K(e) || fe(e)),
36
- ...K(n.primary_method) ? { primary_method: n.primary_method } : {}
35
+ methods: he(n.methods).filter((e) => pe(e) || me(e)),
36
+ ...pe(n.primary_method) ? { primary_method: n.primary_method } : {}
37
37
  }
38
38
  };
39
39
  case "gating": return typeof n.collection != "string" || !n.collection.trim() ? null : {
@@ -41,42 +41,42 @@ var U = [
41
41
  enabled: t,
42
42
  options: {
43
43
  collection: n.collection.trim(),
44
- ...G(n.condition) ? { condition: me(n.condition) } : {},
45
- hidden: pe(n.hidden)
44
+ ...K(n.condition) ? { condition: ge(n.condition) } : {},
45
+ hidden: he(n.hidden)
46
46
  }
47
47
  };
48
48
  case "profile": return {
49
49
  kind: "profile",
50
50
  enabled: t,
51
51
  options: {
52
- ...G(n.condition) ? { condition: me(n.condition) } : {},
53
- hidden: pe(n.hidden)
52
+ ...K(n.condition) ? { condition: ge(n.condition) } : {},
53
+ hidden: he(n.hidden)
54
54
  }
55
55
  };
56
56
  default: return null;
57
57
  }
58
- }, ge = (e) => {
58
+ }, ve = (e) => {
59
59
  if (!Array.isArray(e) || e.length === 0) return {
60
60
  rules: [],
61
61
  invalid: !1
62
62
  };
63
- let t = e.map(he).filter((e) => e !== null);
63
+ let t = e.map(_e).filter((e) => e !== null);
64
64
  return {
65
65
  rules: t.filter((e) => e.enabled !== !1),
66
66
  invalid: t.length === 0
67
67
  };
68
- }, _e = (e) => {
68
+ }, ye = (e) => {
69
69
  let t = e.find((e) => e.kind === "authentication"), n = t?.kind === "authentication" ? t.options?.methods ?? [] : [];
70
70
  return {
71
- primary: (t?.kind === "authentication" ? t.options?.primary_method : void 0) ?? n.find(K) ?? de,
72
- oauth: n.filter(fe)
71
+ primary: (t?.kind === "authentication" ? t.options?.primary_method : void 0) ?? n.find(pe) ?? fe,
72
+ oauth: n.filter(me)
73
73
  };
74
- }, ve = (e = null) => ({
74
+ }, be = (e = null) => ({
75
75
  state: "granted",
76
76
  code: e,
77
77
  message: null,
78
78
  rule: null
79
- }), ye = () => ({
79
+ }), xe = () => ({
80
80
  state: "checking",
81
81
  code: null,
82
82
  message: null,
@@ -86,10 +86,26 @@ var U = [
86
86
  code: e,
87
87
  message: t,
88
88
  rule: n
89
- }), be = (e, t) => {
89
+ }), Se = (e, t) => {
90
90
  let n = t?.split(".")[0];
91
91
  return e.find((e) => e.kind === n) ?? null;
92
- }, xe = ({ rules: e, invalid: t, pageId: n, hasClient: r, isReady: i, isLoggedIn: a, check: o }) => e.length === 0 && !t ? ve() : t ? q("access.CONFIG_INVALID", "This page's access rules could not be read.") : i ? r ? a ? n ? o.isError ? q("access.CHECK_FAILED", "We could not verify your access.") : o.isSuccess ? o.data ? o.data.has_access ? ve(o.data.code ?? null) : q(o.data.code ?? "access.CHECK_FAILED", o.data.message ?? null, be(e, o.data.code)) : q("access.CHECK_FAILED", "We could not verify your access.") : ye() : q("access.PAGE_NOT_IDENTIFIED", "This page is not linked to its access rules yet.") : q("authentication.NOT_LOGGED_IN", "You need to be signed in to view this page.", e.find((e) => e.kind === "authentication") ?? e[0] ?? null) : q("access.UNWIRED", "This site is not connected to an account system.") : ye(), Se = (e) => {
92
+ }, Ce = (e, t) => {
93
+ let n = (e) => t.find((t) => t.kind === e);
94
+ if (e === "granted") return be();
95
+ if (e === "signed_out") return q("authentication.NOT_LOGGED_IN", "You need to be signed in to view this page.", n("authentication") ?? t[0] ?? null);
96
+ let r = n("gating");
97
+ if (e === "entry_missing" && r) return q("gating.ENTRY_NOT_FOUND", null, r);
98
+ if (e === "entry_under_review" && r) return q("gating.ENTRY_CONDITION_NOT_FULFILLED", "Your submission is being reviewed.", r);
99
+ let i = n("profile");
100
+ return e === "profile_incomplete" && i ? q("profile.CONDITION_NOT_FULFILLED", null, i) : null;
101
+ }, we = ({ rules: e, invalid: t, pageId: n, hasClient: r, isReady: i, isLoggedIn: a, check: o, preview: s }) => {
102
+ if (e.length === 0 && !t) return be();
103
+ if (s) {
104
+ let t = Ce(s, e);
105
+ if (t) return t;
106
+ }
107
+ return t ? q("access.CONFIG_INVALID", "This page's access rules could not be read.") : i ? r ? a ? n ? o.isError ? q("access.CHECK_FAILED", "We could not verify your access.") : o.isSuccess ? o.data ? o.data.has_access ? be(o.data.code ?? null) : q(o.data.code ?? "access.CHECK_FAILED", o.data.message ?? null, Se(e, o.data.code)) : q("access.CHECK_FAILED", "We could not verify your access.") : xe() : q("access.PAGE_NOT_IDENTIFIED", "This page is not linked to its access rules yet.") : q("authentication.NOT_LOGGED_IN", "You need to be signed in to view this page.", e.find((e) => e.kind === "authentication") ?? e[0] ?? null) : q("access.UNWIRED", "This site is not connected to an account system.") : xe();
108
+ }, Te = (e) => {
93
109
  let t = (e?.apiUrl || "").replace(/\/$/, "");
94
110
  return t ? y({
95
111
  apiUrl: t,
@@ -98,39 +114,39 @@ var U = [
98
114
  NODE_ENV: "",
99
115
  APP_MODE: e?.appMode || "production"
100
116
  }) : null;
101
- }, Ce = (e) => ({
117
+ }, Ee = (e) => ({
102
118
  apiUrl: e.levo?.api_url || "",
103
119
  workspace: e.workspace_id || "",
104
120
  siteId: e.id || "",
105
121
  insightsUrl: e.levo?.insights_url || null,
106
122
  appMode: e.levo?.app_mode || "production"
107
- }), we = (e) => [
123
+ }), De = (e) => [
108
124
  "levo-source",
109
125
  "list",
110
126
  e.module,
111
127
  e.identifier,
112
128
  e.query ?? null,
113
129
  e.options ?? null
114
- ], Te = (e, t) => [
130
+ ], Oe = (e, t) => [
115
131
  "levo-source",
116
132
  "record",
117
133
  e.module,
118
134
  e.identifier,
119
135
  t ?? null
120
- ], Ee = (e) => [
136
+ ], ke = (e) => [
121
137
  "levo-source",
122
138
  "form",
123
139
  e.module,
124
140
  e.identifier
125
- ], De = {
141
+ ], Ae = {
126
142
  blog_author: "author",
127
143
  blog_category: "category",
128
144
  blog_tag: "tag"
129
- }, Oe = (e, t) => {
130
- let n = encodeURIComponent(e.identifier), r = t ? `${encodeURIComponent(t)}/get-single` : "list", i = De[e.module];
145
+ }, je = (e, t) => {
146
+ let n = encodeURIComponent(e.identifier), r = t ? `${encodeURIComponent(t)}/get-single` : "list", i = Ae[e.module];
131
147
  return i ? `/v1/blog/${n}/${i}/${r}` : e.module === "community" ? `/v1/community/${n}/post/${r}` : null;
132
- }, ke = async (e, t) => {
133
- let n = Oe(t);
148
+ }, Me = async (e, t) => {
149
+ let n = je(t);
134
150
  if (n) {
135
151
  let r = await e.fetch.url(n).post(t.query ?? {}).json();
136
152
  return {
@@ -141,21 +157,21 @@ var U = [
141
157
  let r = t.module === "collection" ? await e.collection.getCollectionContentList({
142
158
  collection_key: t.identifier,
143
159
  ...t.query ?? {}
144
- }) : t.module === "blog" ? await e.blog.getAllBlogs(t.identifier, t.query ?? {}) : await e.event.getAllEvents(t.identifier, t.query ?? {});
160
+ }) : t.module === "blog" ? await e.blog.getAllBlogs(t.identifier, t.query ?? {}, { workspace_id: e.workspace ?? "" }) : await e.event.getAllEvents(t.identifier, t.query ?? {}, { workspace_id: e.workspace ?? "" });
145
161
  return {
146
162
  data: r.content.data ?? [],
147
163
  meta: r.content.meta ?? null
148
164
  };
149
- }, Ae = async (e, t, n) => {
150
- let r = Oe(t, n);
165
+ }, Ne = async (e, t, n) => {
166
+ let r = je(t, n);
151
167
  return r ? (await e.fetch.url(r).get().json()).content.data ?? null : (t.module === "collection" ? await e.collection.getCollectionContent({
152
168
  collection_key: t.identifier,
153
169
  slug: n
154
- }) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n) : await e.event.getSingleEvent(n)).content.data ?? null;
155
- }, je = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, Me = (e) => {
156
- let t = i(), n = I({
157
- queryKey: we(e),
158
- queryFn: () => ke(t, e),
170
+ }) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n, { workspace_id: e.workspace ?? "" }) : await e.event.getSingleEvent(n, { workspace_id: e.workspace ?? "" })).content.data ?? null;
171
+ }, Pe = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, Fe = (e) => {
172
+ let t = i(), n = z({
173
+ queryKey: De(e),
174
+ queryFn: () => Me(t, e),
159
175
  enabled: !!t
160
176
  });
161
177
  return {
@@ -168,10 +184,10 @@ var U = [
168
184
  ...e
169
185
  }) }
170
186
  };
171
- }, Ne = (e, t) => {
172
- let n = i(), r = I({
173
- queryKey: Te(e, t),
174
- queryFn: () => Ae(n, e, t),
187
+ }, Ie = (e, t) => {
188
+ let n = i(), r = z({
189
+ queryKey: Oe(e, t),
190
+ queryFn: () => Ne(n, e, t),
175
191
  enabled: !!n && !!t
176
192
  });
177
193
  return {
@@ -183,10 +199,10 @@ var U = [
183
199
  ...e
184
200
  }) }
185
201
  };
186
- }, Pe = (e) => {
187
- let t = i(), n = I({
188
- queryKey: Ee(e),
189
- queryFn: () => je(t, e),
202
+ }, Le = (e) => {
203
+ let t = i(), n = z({
204
+ queryKey: ke(e),
205
+ queryFn: () => Pe(t, e),
190
206
  enabled: !!t
191
207
  });
192
208
  return {
@@ -198,27 +214,30 @@ var U = [
198
214
  ...e
199
215
  }) }
200
216
  };
201
- }, Fe = async ({ queryClient: e, config: t, sources: n, params: r }) => {
202
- let i = Se(t);
217
+ }, Re = (e) => {
218
+ let t = Object.values(e ?? {});
219
+ return t.length === 1 ? t[0] : e?.slug;
220
+ }, ze = async ({ queryClient: e, config: t, sources: n, params: r }) => {
221
+ let i = Te(t);
203
222
  if (!i || !n) return {};
204
223
  let a = await Promise.all(Object.entries(n).map(async ([t, n]) => {
205
224
  if (n.mode === "record") {
206
- let a = r?.slug;
225
+ let a = n.param ? r?.[n.param] : Re(r);
207
226
  return a ? [t, await e.ensureQueryData({
208
- queryKey: Te(n, a),
209
- queryFn: () => Ae(i, n, a)
227
+ queryKey: Oe(n, a),
228
+ queryFn: () => Ne(i, n, a)
210
229
  }).catch(() => null)] : [t, null];
211
230
  }
212
231
  return n.mode === "form" ? [t, await e.ensureQueryData({
213
- queryKey: Ee(n),
214
- queryFn: () => je(i, n)
232
+ queryKey: ke(n),
233
+ queryFn: () => Pe(i, n)
215
234
  }).catch(() => null)] : [t, await e.ensureQueryData({
216
- queryKey: we(n),
217
- queryFn: () => ke(i, n)
235
+ queryKey: De(n),
236
+ queryFn: () => Me(i, n)
218
237
  }).catch(() => null)];
219
238
  }));
220
239
  return Object.fromEntries(a);
221
- }, Ie = {
240
+ }, Be = {
222
241
  background: "var(--color-page)",
223
242
  foreground: "var(--color-ink)",
224
243
  text: "var(--color-ink)",
@@ -240,10 +259,10 @@ var U = [
240
259
  input: "var(--color-background1)",
241
260
  inputForeground: "var(--color-ink)",
242
261
  ring: "var(--color-brand)"
243
- }, Le = (e) => j(() => ({
262
+ }, Ve = (e) => M(() => ({
244
263
  ...o({
245
264
  colors: {
246
- ...Ie,
265
+ ...Be,
247
266
  ...e?.colors
248
267
  },
249
268
  radius: e?.radius ?? "var(--radius-token)",
@@ -257,13 +276,13 @@ var U = [
257
276
  //#endregion
258
277
  //#region src/hooks/useMounted.ts
259
278
  function J() {
260
- let [e, t] = N(!1);
261
- return k(() => t(!0), []), e;
279
+ let [e, t] = P(!1);
280
+ return A(() => t(!0), []), e;
262
281
  }
263
282
  //#endregion
264
283
  //#region src/access/useLevoAuth.ts
265
- var Y = ["levo-auth", "session"], Re = () => {
266
- let e = i(), t = L(), n = J(), r = I({
284
+ var Y = ["levo-auth", "session"], He = () => {
285
+ let e = i(), t = B(), n = J(), r = z({
267
286
  queryKey: Y,
268
287
  queryFn: async () => {
269
288
  try {
@@ -275,7 +294,7 @@ var Y = ["levo-auth", "session"], Re = () => {
275
294
  enabled: n && !!e,
276
295
  staleTime: 3e4,
277
296
  retry: !1
278
- }), a = F({
297
+ }), a = R({
279
298
  mutationFn: async () => {
280
299
  await e?.membership?.signOut();
281
300
  },
@@ -297,11 +316,11 @@ var Y = ["levo-auth", "session"], Re = () => {
297
316
  signOut: s,
298
317
  isSigningOut: a.isPending
299
318
  };
300
- }, ze = ({ collection: e, hidden: n, submitLabel: r = "Submit", onSuccess: a, theme: o, className: s }) => {
301
- let c = i(), { account: l } = Re(), { schema: u, isLoading: d } = Pe({
319
+ }, Ue = ({ collection: e, hidden: n, submitLabel: r = "Submit", onSuccess: a, theme: o, className: s }) => {
320
+ let c = i(), { account: l } = He(), { schema: u, isLoading: d } = Le({
302
321
  module: "collection",
303
322
  identifier: e
304
- }), f = Le(o);
323
+ }), f = Ve(o);
305
324
  return c ? /* @__PURE__ */ S("div", {
306
325
  className: s,
307
326
  children: /* @__PURE__ */ S(t, {
@@ -325,21 +344,21 @@ var Y = ["levo-auth", "session"], Re = () => {
325
344
  onSuccess: () => a?.()
326
345
  })
327
346
  }) : null;
328
- }, Be = "so_levo_membership_account", Ve = [
347
+ }, We = "so_levo_membership_account", Ge = [
329
348
  "profile_picture",
330
349
  "first_name",
331
350
  "last_name",
332
351
  "email",
333
352
  "username",
334
353
  "socials"
335
- ], He = ["email", "username"], Ue = (e) => Ve.includes(e.key) || e.editable === !0, We = ({ hidden: t, submitLabel: n = "Save and continue", onSuccess: r, errorClassName: a = "text-sm text-[var(--color-danger)]", theme: o, className: s }) => {
336
- let c = i(), l = J(), { account: u } = Re(), d = Le(o), [f, p] = N(""), m = I({
354
+ ], Ke = ["email", "username"], qe = (e) => Ge.includes(e.key) || e.editable === !0, Je = ({ hidden: t, submitLabel: n = "Save and continue", onSuccess: r, errorClassName: a = "text-sm text-[var(--color-danger)]", theme: o, className: s }) => {
355
+ let c = i(), l = J(), { account: u } = He(), d = Ve(o), [f, p] = P(""), m = z({
337
356
  queryKey: ["levo-access", "profile-schema"],
338
- queryFn: async () => (await c?.collection?.getCollectionByIDExpanded(Be))?.content?.data ?? null,
357
+ queryFn: async () => (await c?.collection?.getCollectionByIDExpanded(We))?.content?.data ?? null,
339
358
  enabled: l && !!c,
340
359
  staleTime: 5 * 6e4,
341
360
  retry: 1
342
- }), h = t?.join("|") ?? "", g = j(() => {
361
+ }), h = t?.join("|") ?? "", g = M(() => {
343
362
  let e = m.data;
344
363
  return e ? {
345
364
  ...e,
@@ -347,14 +366,14 @@ var Y = ["levo-auth", "session"], Re = () => {
347
366
  ...e,
348
367
  fields: e.fields?.map((e) => ({
349
368
  ...e,
350
- hidden: !Ue(e) || !!t?.includes(e.key),
351
- readonly: e.readonly || He.includes(e.key)
369
+ hidden: !qe(e) || !!t?.includes(e.key),
370
+ readonly: e.readonly || Ke.includes(e.key)
352
371
  }))
353
372
  }))
354
373
  } : null;
355
- }, [m.data, h]), _ = F({
374
+ }, [m.data, h]), _ = R({
356
375
  mutationFn: async (e) => {
357
- let n = g?.sections?.flatMap((e) => e?.fields ?? [])?.filter((e) => Ue(e) && !He.includes(e.key) && !t?.includes(e.key))?.map((e) => e?.key) ?? [];
376
+ let n = g?.sections?.flatMap((e) => e?.fields ?? [])?.filter((e) => qe(e) && !Ke.includes(e.key) && !t?.includes(e.key))?.map((e) => e?.key) ?? [];
358
377
  await c?.membership?.updateMe(Object.fromEntries(Object.entries(e).filter(([e]) => n.includes(e))));
359
378
  },
360
379
  onMutate: () => p(""),
@@ -385,62 +404,70 @@ var Y = ["levo-auth", "session"], Re = () => {
385
404
  onSubmit: (e) => _.mutate(e)
386
405
  }) : null]
387
406
  }) : null;
388
- }, Ge = (e) => {
389
- let t = i(), n = L(), r = J(), { isLoggedIn: a, isLoaded: o } = Re(), s = e.id?.trim() || "", { rules: c, invalid: l } = j(() => ge(e.access), [e.access]), u = j(() => _e(c), [c]), d = r && !!t && c.length > 0 && !l && !!s && a, f = I({
390
- queryKey: ["levo-access", s],
391
- queryFn: async () => (await t?.fetch.url(`/v1/builder/page/${s}/check-access`).post().json())?.content?.data ?? null,
392
- enabled: d,
407
+ }, Ye = null, Xe = /* @__PURE__ */ new Set(), Ze = (e) => {
408
+ if (Ye !== e) {
409
+ Ye = e;
410
+ for (let e of Xe) e();
411
+ }
412
+ }, Qe = (e) => (Xe.add(e), () => {
413
+ Xe.delete(e);
414
+ }), $e = () => F(Qe, () => Ye, () => null), et = (e) => {
415
+ let t = i(), n = B(), r = J(), { isLoggedIn: a, isLoaded: o } = He(), s = $e(), c = e.id?.trim() || "", { rules: l, invalid: u } = M(() => ve(e.access), [e.access]), d = M(() => ye(l), [l]), f = r && !!t && l.length > 0 && !u && !!c && a && !s, p = z({
416
+ queryKey: ["levo-access", c],
417
+ queryFn: async () => (await t?.fetch.url(`/v1/builder/page/${c}/check-access`).post().json())?.content?.data ?? null,
418
+ enabled: f,
393
419
  staleTime: 0,
394
420
  retry: 1
395
421
  });
396
- k(() => {
397
- f.isError && t?.logger?.error("Page access check failed", { exception: b(f.error) });
422
+ A(() => {
423
+ p.isError && t?.logger?.error("Page access check failed", { exception: b(p.error) });
398
424
  }, [
399
- f.isError,
400
- f.error,
425
+ p.isError,
426
+ p.error,
401
427
  t
402
428
  ]);
403
- let p = O(() => {
404
- n.invalidateQueries({ queryKey: Y }), n.invalidateQueries({ queryKey: ["levo-access", s] });
405
- }, [n, s]);
429
+ let m = O(() => {
430
+ n.invalidateQueries({ queryKey: Y }), n.invalidateQueries({ queryKey: ["levo-access", c] });
431
+ }, [n, c]);
406
432
  return {
407
- ...xe({
408
- rules: c,
409
- invalid: l,
410
- pageId: s,
433
+ ...we({
434
+ rules: l,
435
+ invalid: u,
436
+ pageId: c,
411
437
  hasClient: !!t,
412
438
  isReady: r && o,
413
439
  isLoggedIn: a,
414
440
  check: {
415
- isError: f.isError,
416
- isSuccess: f.isSuccess,
417
- data: f.data ?? null
418
- }
441
+ isError: p.isError,
442
+ isSuccess: p.isSuccess,
443
+ data: p.data ?? null
444
+ },
445
+ preview: s
419
446
  }),
420
- authMethods: u,
421
- recheck: p,
422
- isChecking: f.isFetching
447
+ authMethods: d,
448
+ recheck: m,
449
+ isChecking: p.isFetching
423
450
  };
424
- }, Ke = "membership.account.ACCOUNT_PENDING_APPROVAL", qe = (e) => e ? e === "membership.account.ACCOUNT_PENDING_APPROVAL" || e.includes("ACCOUNT_PENDING_APPROVAL") : !1, Je = (e) => {
451
+ }, tt = "membership.account.ACCOUNT_PENDING_APPROVAL", nt = (e) => e ? e === "membership.account.ACCOUNT_PENDING_APPROVAL" || e.includes("ACCOUNT_PENDING_APPROVAL") : !1, rt = (e) => {
425
452
  let t = b(e);
426
453
  return {
427
454
  code: t?.code || "SOMETHING_WENT_WRONG",
428
455
  title: t?.title || "Something went wrong",
429
456
  message: t?.message || "Something went wrong. Please try again.",
430
457
  fieldErrors: Object.fromEntries((t?.fieldErrors ?? []).map((e) => [e.param, e.message])),
431
- isPendingApproval: qe(t?.code)
458
+ isPendingApproval: nt(t?.code)
432
459
  };
433
- }, Ye = {
460
+ }, it = {
434
461
  code: "site.NOT_CONNECTED",
435
462
  title: "Sign-in unavailable",
436
463
  message: "This site is not connected to an account system yet.",
437
464
  fieldErrors: {},
438
465
  isPendingApproval: !1
439
- }, Xe = () => {
440
- let e = i(), t = L(), n = O(async (t, n) => {
466
+ }, at = () => {
467
+ let e = i(), t = B(), n = O(async (t, n) => {
441
468
  if (!e?.membership) return {
442
469
  ok: !1,
443
- error: Ye
470
+ error: it
444
471
  };
445
472
  try {
446
473
  return {
@@ -451,7 +478,7 @@ var Y = ["levo-auth", "session"], Re = () => {
451
478
  let r = b(n);
452
479
  return e.logger?.error(t, { exception: r }), {
453
480
  ok: !1,
454
- error: Je(r)
481
+ error: rt(r)
455
482
  };
456
483
  }
457
484
  }, [e]), r = O(async ({ identifier: t, medium: n }) => {
@@ -459,13 +486,13 @@ var Y = ["levo-auth", "session"], Re = () => {
459
486
  content: t,
460
487
  ...n === "whatsapp" ? { medium: "whatsapp" } : {}
461
488
  });
462
- }, [e]), a = F({ mutationFn: (e) => n("Failed to send verification code", () => r(e)) }), o = F({ mutationFn: (e) => n("Failed to resend verification code", () => r(e)) }), s = F({ mutationFn: ({ identifier: r, code: i }) => n("Verification failed", async () => {
489
+ }, [e]), a = R({ mutationFn: (e) => n("Failed to send verification code", () => r(e)) }), o = R({ mutationFn: (e) => n("Failed to resend verification code", () => r(e)) }), s = R({ mutationFn: ({ identifier: r, code: i }) => n("Verification failed", async () => {
463
490
  let n = await e?.membership?.signInWithOtp({
464
491
  content: r,
465
492
  code: i
466
493
  }) ?? null;
467
494
  return t.setQueryData(Y, n), t.invalidateQueries({ queryKey: Y }), n;
468
- }) }), c = F({ mutationFn: (t) => n("Failed to send magic link", async () => {
495
+ }) }), c = R({ mutationFn: (t) => n("Failed to send magic link", async () => {
469
496
  await e?.membership?.requestMagicLink({ content: t });
470
497
  }) });
471
498
  return {
@@ -478,11 +505,11 @@ var Y = ["levo-auth", "session"], Re = () => {
478
505
  isVerifying: s.isPending,
479
506
  isSendingMagicLink: c.isPending
480
507
  };
481
- }, Ze = 700, Qe = 500, $e = 700, et = (e, t) => {
482
- let n = window.screenX + (window.outerWidth - Qe) / 2, r = window.screenY + (window.outerHeight - $e) / 2.5;
483
- return window.open(e, t, `width=${Qe},height=${$e},left=${n},top=${r}`);
484
- }, tt = ({ methods: e, title: t = "Sign in", onSuccess: n, onError: r }) => {
485
- let a = i(), o = L(), s = J(), [c, l] = N(null), [u, d] = N(null), f = M(null), p = M(void 0), m = M({
508
+ }, ot = 700, st = 500, ct = 700, lt = (e, t) => {
509
+ let n = window.screenX + (window.outerWidth - st) / 2, r = window.screenY + (window.outerHeight - ct) / 2.5;
510
+ return window.open(e, t, `width=${st},height=${ct},left=${n},top=${r}`);
511
+ }, ut = ({ methods: e, title: t = "Sign in", onSuccess: n, onError: r }) => {
512
+ let a = i(), o = B(), s = J(), [c, l] = P(null), [u, d] = P(null), f = N(null), p = N(void 0), m = N({
486
513
  onSuccess: n,
487
514
  onError: r
488
515
  });
@@ -490,14 +517,14 @@ var Y = ["levo-auth", "session"], Re = () => {
490
517
  onSuccess: n,
491
518
  onError: r
492
519
  };
493
- let h = I({
520
+ let h = z({
494
521
  queryKey: ["levo-auth", "oauth-urls"],
495
522
  queryFn: async () => await a?.membership?.getOAuthURL() ?? null,
496
523
  enabled: s && !!a && e.length > 0,
497
524
  staleTime: 5 * 6e4,
498
525
  retry: !1
499
526
  });
500
- k(() => {
527
+ A(() => {
501
528
  if (!h.error) return;
502
529
  let e = b(h.error);
503
530
  a?.logger?.error("Failed to load OAuth URLs", { exception: e }), d({
@@ -511,7 +538,7 @@ var Y = ["levo-auth", "session"], Re = () => {
511
538
  let g = O(() => {
512
539
  window.clearInterval(p.current), p.current = void 0, f.current?.close(), f.current = null, l(null);
513
540
  }, []);
514
- k(() => () => {
541
+ A(() => () => {
515
542
  window.clearInterval(p.current), f.current?.close();
516
543
  }, []);
517
544
  let _ = O(() => {
@@ -538,11 +565,11 @@ var Y = ["levo-auth", "session"], Re = () => {
538
565
  title: t.get("title") || "Sign-in failed",
539
566
  message: t.get("message") || "We could not sign you in. Please try again.",
540
567
  fieldErrors: {},
541
- isPendingApproval: qe(t.get("code"))
568
+ isPendingApproval: nt(t.get("code"))
542
569
  };
543
570
  r.isPendingApproval || d(r), m.current.onError?.(r);
544
- }, Ze);
545
- }, [o, g]), v = j(() => {
571
+ }, ot);
572
+ }, [o, g]), v = M(() => {
546
573
  let e = h.data;
547
574
  if (!e || typeof window > "u") return {};
548
575
  let t = window.location.href, n = a?.pageContext;
@@ -557,12 +584,12 @@ var Y = ["levo-auth", "session"], Re = () => {
557
584
  }));
558
585
  }, [h.data, a]);
559
586
  return {
560
- providers: j(() => e.filter((e) => !!v[e]).map((e) => ({
587
+ providers: M(() => e.filter((e) => !!v[e]).map((e) => ({
561
588
  provider: e,
562
589
  signIn: () => {
563
590
  let n = v[e];
564
591
  if (n) {
565
- if (d(null), f.current?.close(), f.current = et(n, t), !f.current) {
592
+ if (d(null), f.current?.close(), f.current = lt(n, t), !f.current) {
566
593
  d({
567
594
  code: "POPUP_BLOCKED",
568
595
  title: "Popup blocked",
@@ -586,17 +613,17 @@ var Y = ["levo-auth", "session"], Re = () => {
586
613
  error: u,
587
614
  clearError: O(() => d(null), [])
588
615
  };
589
- }, nt = 4, rt = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim()), it = (e) => RegExp("^\\d{4}$").test(e.trim()), at = (e) => {
616
+ }, dt = 4, ft = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim()), pt = (e) => RegExp("^\\d{4}$").test(e.trim()), mt = (e) => {
590
617
  let t = e.replace(/\D/g, "").replace(/^0+/, "");
591
618
  return t ? `+${t}` : "";
592
- }, ot = (e) => /^\+[1-9]\d{7,14}$/.test(at(e)), st = ({ value: e, onChange: t, length: n = 4, onComplete: r, autoFocus: i, disabled: a }) => {
593
- let o = M([]), [s, c] = N(null), l = M(r);
619
+ }, ht = (e) => /^\+[1-9]\d{7,14}$/.test(mt(e)), gt = ({ value: e, onChange: t, length: n = 4, onComplete: r, autoFocus: i, disabled: a }) => {
620
+ let o = N([]), [s, c] = P(null), l = N(r);
594
621
  l.current = r;
595
622
  let u = Array.from({ length: n }, (t, n) => e[n] ?? ""), d = O((e) => {
596
623
  let t = Math.max(0, Math.min(n - 1, e)), r = o.current[t];
597
624
  r?.focus(), r?.select();
598
625
  }, [n]);
599
- k(() => {
626
+ A(() => {
600
627
  i && !a && d(0);
601
628
  }, [
602
629
  i,
@@ -673,11 +700,11 @@ var Y = ["levo-auth", "session"], Re = () => {
673
700
  },
674
701
  clear: O(() => f("", 0), [f])
675
702
  };
676
- }, ct = D(() => import("./kbChat-jqrzqmaT.js")), lt = ({ site: e, path: t }) => {
703
+ }, _t = D(() => import("./kbChat-BIzoQwEC.js")), vt = ({ site: e, path: t }) => {
677
704
  let n = J(), r = e.workspace_id || void 0;
678
705
  return !n || !r ? null : /* @__PURE__ */ S(T, {
679
706
  fallback: null,
680
- children: /* @__PURE__ */ S(ct, {
707
+ children: /* @__PURE__ */ S(_t, {
681
708
  workspaceId: r,
682
709
  siteName: e.name || void 0,
683
710
  siteLogo: void 0,
@@ -687,103 +714,112 @@ var Y = ["levo-auth", "session"], Re = () => {
687
714
  path: t
688
715
  })
689
716
  });
690
- }, ut = "(prefers-color-scheme: dark)", dt = (e) => {
717
+ }, yt = "(prefers-color-scheme: dark)", bt = (e) => {
691
718
  try {
692
719
  let t = localStorage.getItem(e);
693
720
  return t === "light" || t === "dark" || t === "system" ? t : null;
694
721
  } catch {
695
722
  return null;
696
723
  }
697
- }, ft = (e, t) => {
724
+ }, xt = (e, t) => {
698
725
  try {
699
726
  localStorage.setItem(e, t);
700
727
  } catch {}
701
728
  };
702
- function pt(e, t) {
703
- return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${ut}').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){}})();`;
729
+ function St(e, t) {
730
+ return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${yt}').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){}})();`;
704
731
  }
705
- var mt = E(void 0), ht = (e) => e === "system" ? window.matchMedia(ut).matches ? "dark" : "light" : e;
706
- function gt(e) {
732
+ var Ct = E(void 0), wt = (e) => e === "system" ? window.matchMedia(yt).matches ? "dark" : "light" : e;
733
+ function Tt(e) {
707
734
  let t = document.documentElement;
708
735
  t.classList.remove("light", "dark"), t.classList.add(e), t.style.colorScheme = e;
709
736
  }
710
- var _t = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
711
- let [r, i] = N(t), [a, o] = N(t === "dark" ? "dark" : "light"), s = J();
712
- return k(() => {
713
- i(dt(n) ?? t);
714
- }, [t, n]), k(() => {
737
+ var Et = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
738
+ let [r, i] = P(t), [a, o] = P(t === "dark" ? "dark" : "light"), s = J();
739
+ return A(() => {
740
+ i(bt(n) ?? t);
741
+ }, [t, n]), A(() => {
715
742
  if (!s) return;
716
- let e = ht(r);
717
- gt(e), o(e);
718
- }, [r, s]), k(() => {
743
+ let e = wt(r);
744
+ Tt(e), o(e);
745
+ }, [r, s]), A(() => {
719
746
  if (!s || r !== "system") return;
720
- let e = window.matchMedia(ut), t = () => {
747
+ let e = window.matchMedia(yt), t = () => {
721
748
  let t = e.matches ? "dark" : "light";
722
- gt(t), o(t);
749
+ Tt(t), o(t);
723
750
  };
724
751
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
725
- }, [r, s]), /* @__PURE__ */ C(mt.Provider, {
752
+ }, [r, s]), /* @__PURE__ */ C(Ct.Provider, {
726
753
  value: {
727
754
  mode: r,
728
755
  resolvedMode: a,
729
756
  setMode: (e) => {
730
- ft(n, e), i(e);
757
+ xt(n, e), i(e);
731
758
  }
732
759
  },
733
- children: [/* @__PURE__ */ S(te, { children: pt(n, t) }), e]
760
+ children: [/* @__PURE__ */ S(V, { children: St(n, t) }), e]
734
761
  });
735
762
  };
736
- function vt() {
737
- let e = ee(mt);
763
+ function Dt() {
764
+ let e = k(Ct);
738
765
  if (e === void 0) throw Error("useColorMode must be used within a ColorModeProvider");
739
766
  return e;
740
767
  }
741
768
  //#endregion
742
769
  //#region src/form/LevoForm.tsx
743
- var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant: a = "default", successConfig: o, theme: s, className: c }) => {
744
- let l = i(), { schema: u, isLoading: d, bind: f } = Pe(e), p = Le(s);
745
- return l ? /* @__PURE__ */ S("div", {
746
- ...f,
770
+ var Ot = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant: a = "default", successConfig: o, theme: s, className: c, defaultValues: l, disabled: u, showSuccessScreen: d = !0, onSuccess: f, onError: p }) => {
771
+ let m = i(), { schema: h, isLoading: g, bind: _ } = Le(e), v = Ve(s);
772
+ return m ? /* @__PURE__ */ S("div", {
773
+ ..._,
747
774
  className: c,
748
775
  children: /* @__PURE__ */ S(t, {
749
- fetchedSchema: u,
750
- isLoading: d,
776
+ fetchedSchema: h,
777
+ isLoading: g,
751
778
  submitButtonConfig: {
752
779
  show: !0,
753
780
  text: n
754
781
  },
755
782
  uiConfig: {
756
783
  hideFormHeading: !0,
757
- hideSectionHeadings: !0
784
+ hideSectionHeadings: !0,
785
+ hideSuccessScreen: !d
758
786
  },
759
- theme: { style: p },
787
+ theme: { style: v },
760
788
  hiddenFields: r,
761
789
  formVariant: a,
762
- successConfig: o
790
+ successConfig: o,
791
+ externalInitialValues: l,
792
+ isDisabled: u,
793
+ onSuccess: f ? ({ schemaId: e, response: t, meta: n }) => f({
794
+ schemaId: e,
795
+ record: t,
796
+ meta: n
797
+ }) : void 0,
798
+ onError: p
763
799
  })
764
800
  }) : null;
765
- }, bt = 1400, xt = 12 * 1024 * 1024, St = new Set(["transparent", "rgba(0, 0, 0, 0)"]), Ct = {
801
+ }, kt = 1400, At = 12 * 1024 * 1024, jt = new Set(["transparent", "rgba(0, 0, 0, 0)"]), Mt = {
766
802
  imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
767
803
  onImageErrorHandler: () => void 0
768
- }, wt = (e) => {
804
+ }, Nt = (e) => {
769
805
  let t = getComputedStyle(e);
770
- return !St.has(t.backgroundColor) || t.backgroundImage !== "none";
771
- }, Tt = (e) => {
806
+ return !jt.has(t.backgroundColor) || t.backgroundImage !== "none";
807
+ }, Pt = (e) => {
772
808
  for (let t = e; t; t = t.parentElement) {
773
809
  let e = getComputedStyle(t).backgroundColor;
774
- if (!St.has(e)) return e;
810
+ if (!jt.has(e)) return e;
775
811
  }
776
812
  return "#ffffff";
777
- }, Et = async (e, t) => {
778
- let { toPng: n } = await import("./es-ByBbirnH.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, bt / i)), o = await n(e, {
779
- ...Ct,
813
+ }, Ft = async (e, t) => {
814
+ let { toPng: n } = await import("./es-ByBbirnH.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, kt / i)), o = await n(e, {
815
+ ...Mt,
780
816
  pixelRatio: a,
781
- backgroundColor: Tt(e),
817
+ backgroundColor: Pt(e),
782
818
  filter: (e) => !t.includes(e)
783
819
  });
784
- if (o.length > xt) throw Error("capture too large");
820
+ if (o.length > At) throw Error("capture too large");
785
821
  return o;
786
- }, Dt = 4, Ot = 4e3, kt = (e, t) => {
822
+ }, It = 4, Lt = 4e3, Rt = (e, t) => {
787
823
  let n = document.elementFromPoint(e.x + e.width / 2, e.y + e.height / 2);
788
824
  for (; n && t.includes(n);) n = n.parentElement;
789
825
  let r = document.body;
@@ -794,8 +830,8 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
794
830
  break;
795
831
  }
796
832
  }
797
- let i = window.innerWidth * window.innerHeight * Dt || 2 ** 53 - 1, a = r;
798
- for (; !wt(a);) {
833
+ let i = window.innerWidth * window.innerHeight * It || 2 ** 53 - 1, a = r;
834
+ for (; !Nt(a);) {
799
835
  let e = a.parentElement;
800
836
  if (!e || e === document.documentElement) break;
801
837
  let t = e.getBoundingClientRect();
@@ -803,13 +839,13 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
803
839
  a = e;
804
840
  }
805
841
  return a;
806
- }, At = async (e, t) => {
807
- let { toCanvas: n } = await import("./es-ByBbirnH.js"), r = kt(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, bt / a)), s = Math.max(i.width, i.height, 1);
808
- o = Math.min(o, Ot / s);
842
+ }, zt = async (e, t) => {
843
+ let { toCanvas: n } = await import("./es-ByBbirnH.js"), r = Rt(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, kt / a)), s = Math.max(i.width, i.height, 1);
844
+ o = Math.min(o, Lt / s);
809
845
  let c = await n(r, {
810
- ...Ct,
846
+ ...Mt,
811
847
  pixelRatio: o,
812
- backgroundColor: Tt(r),
848
+ backgroundColor: Pt(r),
813
849
  filter: (e) => !t.includes(e)
814
850
  }), l = document.createElement("canvas");
815
851
  l.width = Math.max(1, Math.round(e.width * o)), l.height = Math.max(1, Math.round(e.height * o));
@@ -817,9 +853,9 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
817
853
  if (!u) throw Error("no 2d context");
818
854
  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);
819
855
  let d = l.toDataURL("image/png");
820
- if (d.length > xt) throw Error("capture too large");
856
+ if (d.length > At) throw Error("capture too large");
821
857
  return d;
822
- }, jt = {
858
+ }, Bt = {
823
859
  ring: 99997,
824
860
  overlay: 99998,
825
861
  label: 99999
@@ -832,24 +868,24 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
832
868
  }, Z = (e) => {
833
869
  let t = e?.getAttribute("data-tsd-source");
834
870
  return t ? t.replace(/^\//, "") : null;
835
- }, Mt = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Z(t) === e), Nt = (e, t) => {
836
- let n = Mt(t).indexOf(e);
871
+ }, Vt = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Z(t) === e), Ht = (e, t) => {
872
+ let n = Vt(t).indexOf(e);
837
873
  return n < 0 ? 0 : n;
838
- }, Pt = (e, t = 0) => {
839
- let n = Mt(e);
874
+ }, Ut = (e, t = 0) => {
875
+ let n = Vt(e);
840
876
  return n[t] ?? n[0] ?? null;
841
- }, Ft = (e, t) => {
877
+ }, Wt = (e, t) => {
842
878
  let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter(Boolean);
843
879
  n.includes(t) || e.setAttribute("data-staged-key", [...n, t].join(" "));
844
- }, It = (e, t) => {
880
+ }, Gt = (e, t) => {
845
881
  let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter((e) => e && e !== t);
846
882
  n.length ? e.setAttribute("data-staged-key", n.join(" ")) : e.removeAttribute("data-staged-key");
847
- }, Lt = (e, t) => {
883
+ }, Kt = (e, t) => {
848
884
  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("");
849
885
  if (!n) return "";
850
886
  let r = `[data-staged-key~="${CSS.escape(e)}"]{${n}}`, i = t.media?.replace(/[;{}]/g, "").trim();
851
887
  return i ? `@media ${i}{${r}}` : r;
852
- }, Rt = (e) => {
888
+ }, qt = (e) => {
853
889
  let t = e.tagName.toLowerCase();
854
890
  return t === "input" ? {
855
891
  checkbox: "Checkbox",
@@ -891,31 +927,31 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
891
927
  aside: "Sidebar",
892
928
  div: "Container"
893
929
  }[t] || `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
894
- }, zt = 36, Bt = (e) => {
895
- let t = Rt(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
896
- return n ? `${t} · ${n.length > zt ? `${n.slice(0, zt - 1).trimEnd()}…` : n}` : t;
897
- }, Vt = (e) => {
930
+ }, Jt = 36, Yt = (e) => {
931
+ let t = qt(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
932
+ return n ? `${t} · ${n.length > Jt ? `${n.slice(0, Jt - 1).trimEnd()}…` : n}` : t;
933
+ }, Xt = (e) => {
898
934
  let t = [], n = e;
899
935
  for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) t.unshift(n.tagName.toLowerCase()), n = n.parentElement;
900
936
  return t.join(" > ");
901
- }, Ht = () => {
937
+ }, Zt = () => {
902
938
  let e = document.createElement("div");
903
- e.style.cssText = `position:fixed;pointer-events:none;z-index:${jt.overlay};background:${X.hoverBg};outline:2px solid ${X.hover};border-radius:2px;display:none`;
939
+ e.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.overlay};background:${X.hoverBg};outline:2px solid ${X.hover};border-radius:2px;display:none`;
904
940
  let t = document.createElement("div");
905
- t.style.cssText = `position:fixed;pointer-events:none;z-index:${jt.label};background:${X.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`;
941
+ t.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.label};background:${X.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`;
906
942
  let n = document.createElement("div");
907
- n.style.cssText = `position:fixed;pointer-events:none;z-index:${jt.ring};outline:2px solid ${X.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${X.selectGlow};display:none`;
943
+ n.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.ring};outline:2px solid ${X.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${X.selectGlow};display:none`;
908
944
  let r = document.createElement("div");
909
- return r.style.cssText = `position:fixed;pointer-events:none;z-index:${jt.label};background:${X.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`, {
945
+ return r.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.label};background:${X.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`, {
910
946
  overlay: e,
911
947
  label: t,
912
948
  ring: n,
913
949
  ringLabel: r
914
950
  };
915
- }, Ut = (e, t, n) => {
951
+ }, Qt = (e, t, n) => {
916
952
  let r = n.getBoundingClientRect();
917
- 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 = Bt(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
918
- }, Wt = (e) => {
953
+ 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 = Yt(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
954
+ }, $t = (e) => {
919
955
  let t = (e instanceof Element ? e : null)?.closest("a[href]");
920
956
  if (!t || t.target === "_blank") return null;
921
957
  let n;
@@ -925,11 +961,11 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
925
961
  return null;
926
962
  }
927
963
  return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
928
- }, Gt = (e) => {
964
+ }, en = (e) => {
929
965
  if (!e) return !1;
930
966
  let t = e.tagName;
931
967
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
932
- }, Kt = (e) => {
968
+ }, tn = (e) => {
933
969
  if (!e.childNodes.length) return !1;
934
970
  let t = !1;
935
971
  for (let n of e.childNodes) {
@@ -937,7 +973,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
937
973
  (n.textContent ?? "").trim() && (t = !0);
938
974
  }
939
975
  return t;
940
- }, qt = 2e3, Jt = (e) => {
976
+ }, nn = 2e3, rn = (e) => {
941
977
  let t = [], n = e;
942
978
  for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
943
979
  let e = Z(n);
@@ -948,22 +984,22 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
948
984
  }), n = n.parentElement;
949
985
  }
950
986
  return t;
951
- }, Yt = (e) => {
952
- let t = Z(e), n = t ? Mt(t).length : 1, r = t ? Nt(e, t) : 0, i = t && Kt(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, qt) : void 0, a = Xt(e);
987
+ }, an = (e) => {
988
+ let t = Z(e), n = t ? Vt(t).length : 1, r = t ? Ht(e, t) : 0, i = t && tn(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, nn) : void 0, a = on(e);
953
989
  return {
954
990
  tag: e.tagName.toLowerCase(),
955
991
  classes: typeof e.className == "string" ? e.className.trim() : "",
956
992
  text: (e.innerText || "").trim().slice(0, 120),
957
- label: Bt(e),
958
- path: Vt(e),
993
+ label: Yt(e),
994
+ path: Xt(e),
959
995
  source: t,
960
996
  index: r,
961
997
  occurrences: n,
962
- ancestors: Jt(e),
998
+ ancestors: rn(e),
963
999
  ...i === void 0 ? {} : { fullText: i },
964
1000
  ...a ? { sourceBinding: a } : {}
965
1001
  };
966
- }, Xt = (e) => {
1002
+ }, on = (e) => {
967
1003
  let t = e.closest("[data-levo-source]");
968
1004
  if (!t) return;
969
1005
  let n = t.getAttribute("data-levo-source") ?? "", r = Z(t), i;
@@ -976,11 +1012,11 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
976
1012
  raw: n,
977
1013
  element: {
978
1014
  source: r ?? "",
979
- index: r ? Nt(t, r) : 0
1015
+ index: r ? Ht(t, r) : 0
980
1016
  },
981
1017
  ...i === void 0 ? {} : { config: i }
982
1018
  };
983
- }, Zt = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
1019
+ }, sn = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
984
1020
  let t = e.getAttribute("data-levo-source") ?? "", n = Z(e), r;
985
1021
  try {
986
1022
  r = JSON.parse(t);
@@ -991,18 +1027,18 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
991
1027
  raw: t,
992
1028
  element: {
993
1029
  source: n ?? "",
994
- index: n ? Nt(e, n) : 0
1030
+ index: n ? Ht(e, n) : 0
995
1031
  },
996
1032
  tag: e.tagName.toLowerCase(),
997
- label: Bt(e),
1033
+ label: Yt(e),
998
1034
  ...r === void 0 ? {} : { config: r }
999
1035
  };
1000
- }), Qt = 14, $t = 2e3, en = 100, tn = 48, nn = new Set([
1036
+ }), cn = 14, ln = 2e3, un = 100, dn = 48, fn = new Set([
1001
1037
  "script",
1002
1038
  "style",
1003
1039
  "template",
1004
1040
  "noscript"
1005
- ]), rn = (e, t) => t.includes(e) || e.id === "studio-staged" || nn.has(e.tagName.toLowerCase()), an = (e) => {
1041
+ ]), pn = (e, t) => t.includes(e) || e.id === "studio-staged" || fn.has(e.tagName.toLowerCase()), mn = (e) => {
1006
1042
  let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
1007
1043
  for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
1008
1044
  let t = Z(e);
@@ -1014,11 +1050,11 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1014
1050
  for (let t of e.childNodes) {
1015
1051
  if (t.nodeType !== 3) continue;
1016
1052
  let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
1017
- if (e) return e.length > tn ? `${e.slice(0, tn).trimEnd()}…` : e;
1053
+ if (e) return e.length > dn ? `${e.slice(0, dn).trimEnd()}…` : e;
1018
1054
  }
1019
1055
  }, o = (i, s) => {
1020
1056
  n++;
1021
- let c = Z(i), l = a(i), u = Array.from(i.children).filter((t) => !rn(t, e)), d = {
1057
+ let c = Z(i), l = a(i), u = Array.from(i.children).filter((t) => !pn(t, e)), d = {
1022
1058
  tag: i.tagName.toLowerCase(),
1023
1059
  ...c ? {
1024
1060
  source: c,
@@ -1029,9 +1065,9 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1029
1065
  childCount: u.length,
1030
1066
  children: []
1031
1067
  };
1032
- if (s >= Qt) return u.length && (t = !0), d;
1068
+ if (s >= cn) return u.length && (t = !0), d;
1033
1069
  for (let e of u) {
1034
- if (d.children.length >= en || n >= $t) {
1070
+ if (d.children.length >= un || n >= ln) {
1035
1071
  t = !0;
1036
1072
  break;
1037
1073
  }
@@ -1043,7 +1079,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1043
1079
  tree: o(document.body, 0),
1044
1080
  truncated: t
1045
1081
  };
1046
- }, on = () => {
1082
+ }, hn = () => {
1047
1083
  let e = null;
1048
1084
  return {
1049
1085
  send: (t) => {
@@ -1058,7 +1094,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1058
1094
  return !0;
1059
1095
  }
1060
1096
  };
1061
- }, sn = (e) => {
1097
+ }, gn = (e) => {
1062
1098
  let t = location.pathname, n = () => {
1063
1099
  location.pathname !== t && (t = location.pathname, e.onPathChange());
1064
1100
  }, r = !1;
@@ -1078,15 +1114,23 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1078
1114
  e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
1079
1115
  }
1080
1116
  } };
1081
- }, cn = (e) => {
1117
+ }, _n = !1, vn = /* @__PURE__ */ new Set(), yn = () => {
1118
+ if (!_n) {
1119
+ _n = !0;
1120
+ for (let e of vn) e();
1121
+ }
1122
+ }, bn = (e) => (vn.add(e), () => {
1123
+ vn.delete(e);
1124
+ }), xn = () => F(bn, () => _n, () => !1), Sn = (e) => {
1082
1125
  let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
1083
1126
  return { onMessage: (o) => {
1084
1127
  let s = o.data;
1085
1128
  if (!(!s || s.source !== "web-chat") && t.acceptOrigin(o)) {
1086
- if (s.type === "set-inspect") e.setInspect(s.enabled);
1129
+ if (yn(), s.type === "set-access-preview") Ze(s.stage ?? null);
1130
+ else if (s.type === "set-inspect") e.setInspect(s.enabled);
1087
1131
  else if (s.type === "set-text-edit") e.setTextEdit(s.enabled);
1088
1132
  else if (s.type === "revert-text") {
1089
- 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 : Pt(e, t);
1133
+ 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 : Ut(e, t);
1090
1134
  i && r != null && (i.textContent = r);
1091
1135
  } else if (s.type === "stage-style") {
1092
1136
  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;
@@ -1145,7 +1189,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1145
1189
  }
1146
1190
  e.syncDomObserver();
1147
1191
  } else if (s.type === "select-element") {
1148
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Pt(t, n) : null;
1192
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Ut(t, n) : null;
1149
1193
  if (!r) {
1150
1194
  i({
1151
1195
  type: "select-miss",
@@ -1161,10 +1205,10 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1161
1205
  behavior: "smooth"
1162
1206
  }), i({
1163
1207
  type: "element-selected",
1164
- element: Yt(r)
1208
+ element: an(r)
1165
1209
  });
1166
1210
  } else if (s.type === "edit-element") {
1167
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Pt(t, n) : null;
1211
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Ut(t, n) : null;
1168
1212
  if (!r) {
1169
1213
  i({
1170
1214
  type: "select-miss",
@@ -1180,12 +1224,12 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1180
1224
  behavior: "smooth"
1181
1225
  }), i({
1182
1226
  type: "element-selected",
1183
- element: Yt(r)
1227
+ element: an(r)
1184
1228
  }), e.isTextEditing() || e.setTextEdit(!0);
1185
1229
  let o = e.editableTarget(r);
1186
1230
  o && e.startEditAtEnd(o);
1187
1231
  } else if (s.type === "highlight-element") {
1188
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Pt(t, n) : null;
1232
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Ut(t, n) : null;
1189
1233
  if (!r) a = null, e.hideTextHover(), i({
1190
1234
  type: "highlight-miss",
1191
1235
  element: {
@@ -1203,7 +1247,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1203
1247
  }
1204
1248
  } else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
1205
1249
  else if (s.type === "request-layers") {
1206
- let { tree: t, truncated: n } = an(e.ownNodes);
1250
+ let { tree: t, truncated: n } = mn(e.ownNodes);
1207
1251
  i({
1208
1252
  type: "layers-tree",
1209
1253
  tree: t,
@@ -1211,7 +1255,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1211
1255
  });
1212
1256
  } else if (s.type === "request-sources") i({
1213
1257
  type: "sources-list",
1214
- sources: Zt()
1258
+ sources: sn()
1215
1259
  });
1216
1260
  else if (s.type === "capture-selected") {
1217
1261
  let t = String(s.requestId || "");
@@ -1226,7 +1270,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1226
1270
  });
1227
1271
  return;
1228
1272
  }
1229
- Et(n, e.ownNodes).then((e) => {
1273
+ Ft(n, e.ownNodes).then((e) => {
1230
1274
  console.info(`[levo-inspector] element capture ok <${n.tagName.toLowerCase()}> (${Math.round(e.length / 1024)}kB)`), i({
1231
1275
  type: "capture-result",
1232
1276
  requestId: t,
@@ -1247,7 +1291,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1247
1291
  }
1248
1292
  }
1249
1293
  } };
1250
- }, ln = () => {
1294
+ }, Cn = () => {
1251
1295
  let e = /* @__PURE__ */ new Map(), t = () => {
1252
1296
  if (e.size > 50) {
1253
1297
  let t = e.keys().next().value;
@@ -1267,31 +1311,31 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1267
1311
  return e.delete(t), n;
1268
1312
  }
1269
1313
  };
1270
- }, un = 6, dn = 12, fn = 12, pn = .6, mn = (e, t, n, r) => ({
1314
+ }, wn = 6, Tn = 12, En = 12, Dn = .6, On = (e, t, n, r) => ({
1271
1315
  x: Math.min(e, n),
1272
1316
  y: Math.min(t, r),
1273
1317
  width: Math.abs(n - e),
1274
1318
  height: Math.abs(r - t)
1275
- }), hn = (e, t) => {
1319
+ }), kn = (e, t) => {
1276
1320
  let n = e.x + e.width, r = e.y + e.height, i = [];
1277
1321
  for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
1278
1322
  if (t.includes(a)) continue;
1279
1323
  let o = a.getBoundingClientRect(), s = o.width * o.height;
1280
- 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 >= pn && i.push(a);
1324
+ 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 >= Dn && i.push(a);
1281
1325
  }
1282
1326
  let a = new Set(i), o = i.filter((e) => {
1283
1327
  for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
1284
1328
  return !0;
1285
- }), s = o.length > fn, c = [], l = [];
1286
- for (let e of o.slice(0, fn)) {
1329
+ }), s = o.length > En, c = [], l = [];
1330
+ for (let e of o.slice(0, En)) {
1287
1331
  let t = Z(e);
1288
1332
  if (!t) continue;
1289
1333
  let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
1290
1334
  c.push({
1291
1335
  source: t,
1292
- index: Nt(e, t),
1336
+ index: Ht(e, t),
1293
1337
  tag: e.tagName.toLowerCase(),
1294
- label: Bt(e),
1338
+ label: Yt(e),
1295
1339
  ...n ? { text: n } : {}
1296
1340
  }), l.push(e);
1297
1341
  }
@@ -1300,12 +1344,12 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1300
1344
  nodes: l,
1301
1345
  truncated: s
1302
1346
  };
1303
- }, gn = () => Array.from({ length: fn }, () => {
1347
+ }, An = () => Array.from({ length: En }, () => {
1304
1348
  let e = document.createElement("div");
1305
- return e.style.cssText = `position:fixed;pointer-events:none;z-index:${jt.ring};outline:1.5px solid ${X.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${X.selectGlow};display:none`, e;
1306
- }), _n = () => {
1349
+ return e.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.ring};outline:1.5px solid ${X.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${X.selectGlow};display:none`, e;
1350
+ }), jn = () => {
1307
1351
  let e = document.createElement("div");
1308
- e.style.cssText = `position:fixed;pointer-events:none;z-index:${jt.overlay};border:1.5px dashed ${X.select};background:${X.selectGlow};border-radius:2px;display:none`;
1352
+ e.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.overlay};border:1.5px dashed ${X.select};background:${X.selectGlow};border-radius:2px;display:none`;
1309
1353
  let t = null, n = !1, r = 0, i = 0, a = () => {
1310
1354
  e.style.display = "none";
1311
1355
  };
@@ -1320,31 +1364,31 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1320
1364
  pointerMove: (a, o) => {
1321
1365
  if (!t) return;
1322
1366
  if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
1323
- if (Math.abs(a - t.x) < un && Math.abs(o - t.y) < un) return;
1367
+ if (Math.abs(a - t.x) < wn && Math.abs(o - t.y) < wn) return;
1324
1368
  n = !0;
1325
1369
  }
1326
- let s = mn(t.x, t.y, a, o);
1370
+ let s = On(t.x, t.y, a, o);
1327
1371
  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`;
1328
1372
  },
1329
1373
  pointerUp: () => {
1330
1374
  let e = n, o = t;
1331
1375
  if (t = null, n = !1, a(), !e || !o) return null;
1332
- let s = mn(o.x, o.y, r, i);
1333
- return s.width < dn || s.height < dn ? null : s;
1376
+ let s = On(o.x, o.y, r, i);
1377
+ return s.width < Tn || s.height < Tn ? null : s;
1334
1378
  },
1335
1379
  cancel: () => {
1336
1380
  t = null, n = !1, a();
1337
1381
  },
1338
1382
  isDragging: () => n
1339
1383
  };
1340
- }, vn = (e) => {
1384
+ }, Mn = (e) => {
1341
1385
  let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
1342
1386
  let e = document.getElementById("studio-staged");
1343
1387
  return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
1344
1388
  }, a = () => {
1345
1389
  let e = [];
1346
1390
  for (let [t, n] of r) if (n.kind === "style") {
1347
- let r = Lt(t, n);
1391
+ let r = Kt(t, n);
1348
1392
  r && e.push(r);
1349
1393
  }
1350
1394
  let t = e.join("\n");
@@ -1352,8 +1396,8 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1352
1396
  let n = i();
1353
1397
  n.textContent !== t && (n.textContent = t);
1354
1398
  }, o = (e, r) => {
1355
- let i = Pt(r.source, r.index);
1356
- if (i) if (r.kind === "style") Ft(i, e);
1399
+ let i = Ut(r.source, r.index);
1400
+ if (i) if (r.kind === "style") Wt(i, e);
1357
1401
  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");
1358
1402
  else {
1359
1403
  if (i === n()) return;
@@ -1366,8 +1410,8 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1366
1410
  let n = r.get(e);
1367
1411
  if (!n) return;
1368
1412
  r.delete(e);
1369
- let i = Pt(n.source, n.index);
1370
- if (n.kind === "style") i && It(i, e), a();
1413
+ let i = Ut(n.source, n.index);
1414
+ if (n.kind === "style") i && Gt(i, e), a();
1371
1415
  else if (n.kind === "image") {
1372
1416
  let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
1373
1417
  i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
@@ -1396,7 +1440,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1396
1440
  for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
1397
1441
  }
1398
1442
  };
1399
- }, yn = (e) => {
1443
+ }, Nn = (e) => {
1400
1444
  let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
1401
1445
  try {
1402
1446
  let e = document.createElement("div");
@@ -1415,7 +1459,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1415
1459
  n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n);
1416
1460
  }, d = (e, t = !1) => {
1417
1461
  if (i === e) return;
1418
- i && p(i), i = e, a = Z(e) || "", o = Nt(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
1462
+ i && p(i), i = e, a = Z(e) || "", o = Ht(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
1419
1463
  let d = e;
1420
1464
  d.style.outline = `2px solid ${X.hover}`, d.style.outlineOffset = "3px", d.style.borderRadius = "3px", d.focus(), t && u(e), d.addEventListener("blur", c, !0), d.addEventListener("keydown", l, !0);
1421
1465
  }, f = (e) => {
@@ -1434,7 +1478,7 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1434
1478
  tag: e.tagName.toLowerCase(),
1435
1479
  value: c,
1436
1480
  previous: s,
1437
- occurrences: r ? Mt(r).length : 1
1481
+ occurrences: r ? Vt(r).length : 1
1438
1482
  }
1439
1483
  });
1440
1484
  }, m = (e) => {
@@ -1453,16 +1497,16 @@ var yt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
1453
1497
  i && f(i);
1454
1498
  }
1455
1499
  };
1456
- }, bn = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
1457
- function xn() {
1458
- return k(() => Sn(), []), null;
1500
+ }, Pn = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
1501
+ function Fn() {
1502
+ return A(() => In(), []), null;
1459
1503
  }
1460
- function Sn() {
1461
- let e = !1, t = null, n = null, r = !1, i = null, a = ln(), o = on(), { overlay: s, label: c, ring: l, ringLabel: u } = Ht();
1504
+ function In() {
1505
+ let e = !1, t = null, n = null, r = !1, i = null, a = Cn(), o = hn(), { overlay: s, label: c, ring: l, ringLabel: u } = Zt();
1462
1506
  document.body.append(s, c, l, u);
1463
- let d = _n();
1507
+ let d = jn();
1464
1508
  document.body.append(d.node);
1465
- let f = gn();
1509
+ let f = An();
1466
1510
  document.body.append(...f);
1467
1511
  let p = [
1468
1512
  s,
@@ -1492,123 +1536,123 @@ function Sn() {
1492
1536
  }, S = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, C = (e) => {
1493
1537
  if (!e || S(e)) return null;
1494
1538
  let t = Z(e) ? e : e.closest("[data-tsd-source]");
1495
- return !t || S(t) || !Kt(t) ? null : t;
1496
- }, w = (e) => Ut(s, c, e), T = () => {
1539
+ return !t || S(t) || !tn(t) ? null : t;
1540
+ }, w = (e) => Qt(s, c, e), T = () => {
1497
1541
  if (n) {
1498
1542
  if (!n.isConnected) {
1499
- N();
1543
+ P();
1500
1544
  return;
1501
1545
  }
1502
- Ut(l, u, n);
1546
+ Qt(l, u, n);
1503
1547
  }
1504
1548
  }, E = 0, D = () => {
1505
1549
  E || !n || r || (E = requestAnimationFrame(() => {
1506
1550
  E = 0, T();
1507
1551
  }));
1508
- }, O = new ResizeObserver(D), ee = new MutationObserver((e) => {
1552
+ }, O = new ResizeObserver(D), k = new MutationObserver((e) => {
1509
1553
  for (let t of e) {
1510
1554
  let e = t.target;
1511
1555
  if (!p.some((t) => t === e) && !(t.type === "attributes" && t.attributeName === "data-staged-key")) {
1512
- D(), L.scheduleReapply();
1556
+ D(), R.scheduleReapply();
1513
1557
  return;
1514
1558
  }
1515
1559
  }
1516
- }), k = !1, A = () => {
1517
- k ||= (ee.observe(document.documentElement, {
1560
+ }), A = !1, j = () => {
1561
+ A ||= (k.observe(document.documentElement, {
1518
1562
  attributes: !0,
1519
1563
  childList: !0,
1520
1564
  characterData: !0,
1521
1565
  subtree: !0
1522
1566
  }), !0);
1523
- }, j = () => {
1524
- k &&= (ee.disconnect(), !1);
1525
1567
  }, M = () => {
1526
- O.disconnect(), n?.isConnected && (O.observe(n), A());
1568
+ A &&= (k.disconnect(), !1);
1527
1569
  }, N = () => {
1528
- n = null, O.disconnect(), te(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
1529
- }, P = (e) => w(e), F = () => {
1570
+ O.disconnect(), n?.isConnected && (O.observe(n), j());
1571
+ }, P = () => {
1572
+ n = null, O.disconnect(), z(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
1573
+ }, F = (e) => w(e), I = () => {
1530
1574
  s.style.display = "none", c.style.display = "none";
1531
- }, I = yn({
1575
+ }, L = Nn({
1532
1576
  channel: o,
1533
1577
  originals: a,
1534
1578
  clearTextHover: () => {
1535
- i = null, F();
1579
+ i = null, I();
1536
1580
  }
1537
- }), L = vn({
1581
+ }), R = Mn({
1538
1582
  originals: a,
1539
- editingNode: I.editingNode
1540
- }), te = () => {
1541
- n?.isConnected || L.count() ? A() : j();
1542
- }, R = (n) => {
1543
- n && r && z(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", W()), o.send({
1583
+ editingNode: L.editingNode
1584
+ }), z = () => {
1585
+ n?.isConnected || R.count() ? j() : M();
1586
+ }, B = (n) => {
1587
+ n && r && V(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", W()), o.send({
1544
1588
  type: "inspect-state",
1545
1589
  enabled: e
1546
1590
  });
1547
- }, z = (t) => {
1591
+ }, V = (t) => {
1548
1592
  if (r = !!t, r) {
1549
- e && R(!1), l.style.display = "none", u.style.display = "none";
1593
+ e && B(!1), l.style.display = "none", u.style.display = "none";
1550
1594
  for (let e of f) e.style.display = "none";
1551
- } else I.commitIfEditing(), F(), document.documentElement.style.cursor = "", n && T(), m.length > 0 && _();
1595
+ } else L.commitIfEditing(), I(), document.documentElement.style.cursor = "", n && T(), m.length > 0 && _();
1552
1596
  o.send({
1553
1597
  type: "text-edit-state",
1554
1598
  enabled: r
1555
1599
  });
1556
- }, ne = 0, re = 0, ie = 0, ae = () => {
1557
- ne = 0;
1558
- let n = document.elementFromPoint(re, ie);
1600
+ }, ee = 0, H = 0, te = 0, ne = () => {
1601
+ ee = 0;
1602
+ let n = document.elementFromPoint(H, te);
1559
1603
  if (!S(n)) {
1560
1604
  if (r) {
1561
1605
  let e = C(n);
1562
- if (e && e === I.editingNode()) {
1563
- i = null, F(), document.documentElement.style.cursor = "";
1606
+ if (e && e === L.editingNode()) {
1607
+ i = null, I(), document.documentElement.style.cursor = "";
1564
1608
  return;
1565
1609
  }
1566
- i = e, document.documentElement.style.cursor = e ? "text" : "", e ? P(e) : F();
1610
+ i = e, document.documentElement.style.cursor = e ? "text" : "", e ? F(e) : I();
1567
1611
  return;
1568
1612
  }
1569
1613
  e && (d.isDragging() || (t = n, n && w(n)));
1570
1614
  }
1571
- }, B = (t) => {
1572
- !e && !r || (re = t.clientX, ie = t.clientY, ne ||= requestAnimationFrame(ae));
1573
- }, V = 0, oe = () => {
1574
- V = 0, e && t && w(t), r && !I.editingNode() && i?.isConnected && P(i), n && !r && T(), m.length > 0 && !r && _();
1575
- }, se = () => {
1576
- V ||= requestAnimationFrame(oe);
1577
- }, ce = (n) => {
1578
- n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !I.editingNode() && (i = null, F(), document.documentElement.style.cursor = ""));
1579
- }, H = !1, le = null, U = () => {
1580
- if (le != null) {
1615
+ }, U = (t) => {
1616
+ !e && !r || (H = t.clientX, te = t.clientY, ee ||= requestAnimationFrame(ne));
1617
+ }, re = 0, ie = () => {
1618
+ re = 0, e && t && w(t), r && !L.editingNode() && i?.isConnected && F(i), n && !r && T(), m.length > 0 && !r && _();
1619
+ }, ae = () => {
1620
+ re ||= requestAnimationFrame(ie);
1621
+ }, oe = (n) => {
1622
+ n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !L.editingNode() && (i = null, I(), document.documentElement.style.cursor = ""));
1623
+ }, se = !1, ce = null, le = () => {
1624
+ if (ce != null) {
1581
1625
  try {
1582
- document.documentElement.releasePointerCapture(le);
1626
+ document.documentElement.releasePointerCapture(ce);
1583
1627
  } catch {}
1584
- le = null;
1628
+ ce = null;
1585
1629
  }
1586
1630
  }, W = () => {
1587
- U(), d.cancel();
1631
+ le(), d.cancel();
1588
1632
  }, ue = (t) => {
1589
- !e || t.button !== 0 || !t.isPrimary || (H = !1, d.pointerDown(t.clientX, t.clientY));
1590
- }, de = (n) => {
1633
+ !e || t.button !== 0 || !t.isPrimary || (se = !1, d.pointerDown(t.clientX, t.clientY));
1634
+ }, G = (n) => {
1591
1635
  if (!e || !n.isPrimary) return;
1592
1636
  let r = d.isDragging();
1593
1637
  if (d.pointerMove(n.clientX, n.clientY), d.isDragging()) {
1594
1638
  if (!r) {
1595
- le = n.pointerId;
1639
+ ce = n.pointerId;
1596
1640
  try {
1597
1641
  document.documentElement.setPointerCapture(n.pointerId);
1598
1642
  } catch {}
1599
1643
  }
1600
1644
  t = null, s.style.display = "none", c.style.display = "none";
1601
1645
  }
1602
- }, G = (t) => {
1646
+ }, de = (t) => {
1603
1647
  if (!e || !t.isPrimary) return;
1604
- U();
1648
+ le();
1605
1649
  let n = d.pointerUp();
1606
1650
  if (!n) return;
1607
- H = !0, N();
1608
- let { elements: r, nodes: i, truncated: a } = hn(n, p);
1651
+ se = !0, P();
1652
+ let { elements: r, nodes: i, truncated: a } = kn(n, p);
1609
1653
  console.info(`[levo-inspector] region drag: ${Math.round(n.width)}×${Math.round(n.height)} — ${r.length} element(s)${a ? " (truncated)" : ""}`), v(i);
1610
1654
  let s = ++h;
1611
- At(n, p).then((e) => {
1655
+ zt(n, p).then((e) => {
1612
1656
  s === h && (console.info(`[levo-inspector] region capture ok (${Math.round(e.length / 1024)}kB)`), o.send({
1613
1657
  type: "region-selected",
1614
1658
  rect: n,
@@ -1625,54 +1669,54 @@ function Sn() {
1625
1669
  dataUrl: null
1626
1670
  }));
1627
1671
  });
1628
- }, K = () => W(), fe = (e) => {
1629
- let t = Wt(e.target);
1672
+ }, fe = () => W(), K = (e) => {
1673
+ let t = $t(e.target);
1630
1674
  return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
1631
1675
  }, pe = (i) => {
1632
- if (H) {
1633
- H = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1676
+ if (se) {
1677
+ se = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1634
1678
  return;
1635
1679
  }
1636
1680
  if (r) {
1637
1681
  let e = C(document.elementFromPoint(i.clientX, i.clientY) || i.target);
1638
- if (!e || e === I.editingNode()) {
1639
- fe(i);
1682
+ if (!e || e === L.editingNode()) {
1683
+ K(i);
1640
1684
  return;
1641
1685
  }
1642
- i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), I.startEdit(e);
1686
+ i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), L.startEdit(e);
1643
1687
  return;
1644
1688
  }
1645
1689
  if (!e) {
1646
- fe(i);
1690
+ K(i);
1647
1691
  return;
1648
1692
  }
1649
1693
  i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1650
1694
  let a = t || i.target;
1651
1695
  if (S(a)) return;
1652
1696
  let s = a.closest("[data-tsd-source]") || a;
1653
- y(), g(), n = s, T(), M(), o.send({
1697
+ y(), g(), n = s, T(), N(), o.send({
1654
1698
  type: "element-selected",
1655
- element: Yt(s)
1699
+ element: an(s)
1656
1700
  });
1657
- }, me = cn({
1701
+ }, me = Sn({
1658
1702
  channel: o,
1659
1703
  originals: a,
1660
- staged: L,
1661
- setInspect: R,
1662
- setTextEdit: z,
1704
+ staged: R,
1705
+ setInspect: B,
1706
+ setTextEdit: V,
1663
1707
  isInspecting: () => e,
1664
1708
  isTextEditing: () => r,
1665
- editingNode: I.editingNode,
1709
+ editingNode: L.editingNode,
1666
1710
  setSelected: (e) => {
1667
- y(), g(), n = e, M();
1711
+ y(), g(), n = e, N();
1668
1712
  },
1669
1713
  selectedNode: () => n,
1670
1714
  positionSelected: T,
1671
- clearSelection: N,
1672
- syncDomObserver: te,
1715
+ clearSelection: P,
1716
+ syncDomObserver: z,
1673
1717
  positionHover: w,
1674
- hideTextHover: F,
1675
- startEditAtEnd: (e) => I.startEdit(e, !0),
1718
+ hideTextHover: I,
1719
+ startEditAtEnd: (e) => L.startEdit(e, !0),
1676
1720
  editableTarget: C,
1677
1721
  ownNodes: p
1678
1722
  }), he = [
@@ -1703,42 +1747,42 @@ function Sn() {
1703
1747
  type: "route",
1704
1748
  route: e
1705
1749
  });
1706
- }, ye = sn({ onPathChange: () => {
1707
- N(), ve();
1708
- } }), q = (t) => {
1709
- if (I.editingNode()) return;
1750
+ }, ye = gn({ onPathChange: () => {
1751
+ P(), ve();
1752
+ } }), be = (t) => {
1753
+ if (L.editingNode()) return;
1710
1754
  if (t.key === "Escape") {
1711
1755
  if (e && d.isDragging()) {
1712
1756
  t.stopPropagation(), W();
1713
1757
  return;
1714
1758
  }
1715
- r ? (t.stopPropagation(), z(!1)) : e && (t.stopPropagation(), R(!1));
1759
+ r ? (t.stopPropagation(), V(!1)) : e && (t.stopPropagation(), B(!1));
1716
1760
  return;
1717
1761
  }
1718
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || Gt(document.activeElement)) return;
1762
+ if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || en(document.activeElement)) return;
1719
1763
  let n = t.key.toLowerCase();
1720
- n === "s" ? (t.preventDefault(), t.stopPropagation(), R(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), z(!r));
1764
+ n === "s" ? (t.preventDefault(), t.stopPropagation(), B(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), V(!r));
1721
1765
  };
1722
- window.addEventListener("mousemove", B, !0), window.addEventListener("scroll", se, !0), window.addEventListener("resize", _e), window.addEventListener("click", pe, !0), window.addEventListener("keydown", q, !0), window.addEventListener("message", me.onMessage), window.addEventListener("mouseout", ce, !0), window.addEventListener("pointerdown", ue, !0), window.addEventListener("pointermove", de, !0), window.addEventListener("pointerup", G, !0), window.addEventListener("pointercancel", K, !0);
1766
+ window.addEventListener("mousemove", U, !0), window.addEventListener("scroll", ae, !0), window.addEventListener("resize", _e), window.addEventListener("click", pe, !0), window.addEventListener("keydown", be, !0), window.addEventListener("message", me.onMessage), window.addEventListener("mouseout", oe, !0), window.addEventListener("pointerdown", ue, !0), window.addEventListener("pointermove", G, !0), window.addEventListener("pointerup", de, !0), window.addEventListener("pointercancel", fe, !0);
1723
1767
  for (let e of he) window.addEventListener(e, ge, !0);
1724
- return console.info(`[levo-inspector] build ${bn} — runtime mounted`), ve(), o.send({ type: "ready" }), () => {
1725
- window.removeEventListener("mousemove", B, !0), window.removeEventListener("keydown", q, !0), window.removeEventListener("scroll", se, !0), window.removeEventListener("resize", _e), window.removeEventListener("mouseout", ce, !0), window.removeEventListener("pointerdown", ue, !0), window.removeEventListener("pointermove", de, !0), window.removeEventListener("pointerup", G, !0), window.removeEventListener("pointercancel", K, !0), window.removeEventListener("click", pe, !0), window.removeEventListener("message", me.onMessage);
1768
+ return console.info(`[levo-inspector] build ${Pn} — runtime mounted`), ve(), o.send({ type: "ready" }), () => {
1769
+ window.removeEventListener("mousemove", U, !0), window.removeEventListener("keydown", be, !0), window.removeEventListener("scroll", ae, !0), window.removeEventListener("resize", _e), window.removeEventListener("mouseout", oe, !0), window.removeEventListener("pointerdown", ue, !0), window.removeEventListener("pointermove", G, !0), window.removeEventListener("pointerup", de, !0), window.removeEventListener("pointercancel", fe, !0), window.removeEventListener("click", pe, !0), window.removeEventListener("message", me.onMessage);
1726
1770
  for (let e of he) window.removeEventListener(e, ge, !0);
1727
- O.disconnect(), ee.disconnect(), E && cancelAnimationFrame(E), ne && cancelAnimationFrame(ne), V && cancelAnimationFrame(V), L.teardown(), ye.teardown(), I.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), W(), d.node.remove();
1771
+ O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), ee && cancelAnimationFrame(ee), re && cancelAnimationFrame(re), R.teardown(), ye.teardown(), L.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), W(), d.node.remove();
1728
1772
  for (let e of f) e.remove();
1729
1773
  };
1730
1774
  }
1731
1775
  //#endregion
1732
1776
  //#region src/branding/MadeWithLevo.tsx
1733
- var Cn = "levo-made-with", wn = `.${Cn}{opacity:.2;transition:opacity 150ms,transform 150ms}
1734
- .${Cn}:hover,.${Cn}:focus-visible{opacity:1;transform:translateY(-2px)}`, Tn = ({ slug: e }) => {
1777
+ var Ln = "levo-made-with", Rn = `.${Ln}{opacity:.2;transition:opacity 150ms,transform 150ms}
1778
+ .${Ln}:hover,.${Ln}:focus-visible{opacity:1;transform:translateY(-2px)}`, zn = ({ slug: e }) => {
1735
1779
  let t = `utm_source=${encodeURIComponent(e || "website")}&utm_term=Made%20With%20Levo&utm_campaign=footer_branding&utm_medium=organic_footer_branding`;
1736
1780
  return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("style", {
1737
1781
  href: "levo-made-with",
1738
1782
  precedence: "default",
1739
- children: wn
1783
+ children: Rn
1740
1784
  }), /* @__PURE__ */ C("a", {
1741
- className: Cn,
1785
+ className: Ln,
1742
1786
  href: `https://levo.so/?${t}`,
1743
1787
  target: "_blank",
1744
1788
  rel: "noopener noreferrer",
@@ -1769,55 +1813,58 @@ var Cn = "levo-made-with", wn = `.${Cn}{opacity:.2;transition:opacity 150ms,tran
1769
1813
  }
1770
1814
  }), "Made with Levo"]
1771
1815
  })] });
1772
- }, En = "levo:page-id", Dn = () => {
1816
+ }, Bn = "levo:page-id", Vn = () => {
1773
1817
  if (typeof document > "u") return null;
1774
- let e = document.querySelectorAll(`meta[name="${En}"]`);
1818
+ let e = document.querySelectorAll(`meta[name="${Bn}"]`);
1775
1819
  return e[e.length - 1]?.getAttribute("content")?.trim() || null;
1776
- }, On = D(() => import("./dist-Cl_sKk9y.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), kn = ({ siteId: e, pageId: t }) => {
1820
+ }, Hn = D(() => import("./dist-6AIgW_iB.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), Un = ({ siteId: e, pageId: t }) => {
1777
1821
  let n = J(), r = i();
1778
1822
  return !n || !r ? null : /* @__PURE__ */ S(T, {
1779
1823
  fallback: null,
1780
- children: /* @__PURE__ */ S(On, {
1824
+ children: /* @__PURE__ */ S(Hn, {
1781
1825
  pageId: t,
1782
1826
  siteId: e
1783
1827
  })
1784
1828
  });
1785
- }, An = () => i(), jn = () => n(), Mn = ({ site: e, children: t }) => {
1786
- let [n] = N(() => {
1829
+ }, Wn = E(null), Gn = Wn.Provider, Kn = () => k(Wn), qn = () => i(), Jn = () => n(), Yn = ({ site: e, analytics: t = !0, children: n }) => {
1830
+ let [i] = P(() => {
1787
1831
  if (!e) return null;
1788
- let t = Ce(e), n = Se(t);
1789
- return n ? {
1790
- client: n,
1791
- insights: ne(n, {
1792
- insightsUrl: t.insightsUrl || null,
1793
- site: t.siteId || null
1832
+ let n = Ee(e), r = Te(n);
1833
+ return r ? {
1834
+ client: r,
1835
+ insights: te(r, {
1836
+ insightsUrl: t && n.insightsUrl || null,
1837
+ site: n.siteId || null
1794
1838
  }),
1795
1839
  site: e
1796
1840
  } : null;
1797
- }), [i, a] = N(null), o = z({ select: (e) => e.location.pathname });
1798
- return k(() => {
1799
- n && (window.levo_client = n.client, window.levo_insights = n.insights);
1800
- }, [n]), A(() => {
1801
- if (!n) return;
1802
- let e = Dn();
1803
- a(e), n.insights.init({ pageId: e });
1804
- }, [n, o]), n ? /* @__PURE__ */ C(r, {
1805
- client: n.client,
1806
- insights: n.insights,
1841
+ }), [a, o] = P(null), s = H({ select: (e) => e.location.pathname }), c = xn();
1842
+ return A(() => {
1843
+ i && (window.levo_client = i.client, window.levo_insights = i.insights);
1844
+ }, [i]), j(() => {
1845
+ if (!i) return;
1846
+ let e = Vn();
1847
+ o(e), i.insights.init({ pageId: e });
1848
+ }, [i, s]), i ? /* @__PURE__ */ C(r, {
1849
+ client: i.client,
1850
+ insights: i.insights,
1807
1851
  children: [
1808
- t,
1809
- /* @__PURE__ */ S(lt, {
1810
- site: n.site,
1811
- path: o
1852
+ /* @__PURE__ */ S(Gn, {
1853
+ value: i.site,
1854
+ children: n
1855
+ }),
1856
+ !c && /* @__PURE__ */ S(vt, {
1857
+ site: i.site,
1858
+ path: s
1812
1859
  }),
1813
- /* @__PURE__ */ S(kn, {
1814
- pageId: i ?? void 0,
1815
- siteId: n.site.id
1860
+ /* @__PURE__ */ S(Un, {
1861
+ pageId: a ?? void 0,
1862
+ siteId: i.site.id
1816
1863
  }),
1817
- !!n.site.feature_flag?.branding && /* @__PURE__ */ S(Tn, { slug: n.site.slug })
1864
+ !c && !!i.site.feature_flag?.branding && /* @__PURE__ */ S(zn, { slug: i.site.slug })
1818
1865
  ]
1819
- }) : /* @__PURE__ */ S(x, { children: t });
1820
- }, Nn = (e, t) => {
1866
+ }) : /* @__PURE__ */ S(x, { children: n });
1867
+ }, Xn = (e, t) => {
1821
1868
  let n = h(t);
1822
1869
  return ({ location: t }) => {
1823
1870
  if (!e.isLocalized) return;
@@ -1828,9 +1875,9 @@ var Cn = "levo-made-with", wn = `.${Cn}{opacity:.2;transition:opacity 150ms,tran
1828
1875
  cookie: typeof document > "u" ? null : document.cookie,
1829
1876
  hasRoute: n
1830
1877
  });
1831
- if (r.kind === "redirect" && r.path !== t.pathname) throw R({ href: `${r.path}${t.searchStr ?? ""}` });
1878
+ if (r.kind === "redirect" && r.path !== t.pathname) throw ee({ href: `${r.path}${t.searchStr ?? ""}` });
1832
1879
  };
1833
- }, Pn = (e) => {
1880
+ }, Zn = (e) => {
1834
1881
  let t = e.locales ?? [], n = e.domain?.trim().replace(/^https?:\/\//, "").replace(/\/+$/, "");
1835
1882
  return {
1836
1883
  locales: t,
@@ -1838,8 +1885,8 @@ var Cn = "levo-made-with", wn = `.${Cn}{opacity:.2;transition:opacity 150ms,tran
1838
1885
  isLocalized: t.length > 1,
1839
1886
  origin: n ? `https://${n}` : null
1840
1887
  };
1841
- }, Fn = (e) => e.replace(/\/$/, ""), In = (e) => {
1842
- let { neutralPath: t, locales: n, activePrefix: r, hasRoute: i } = e, a = Fn(e.origin), o = `${a}${t}`;
1888
+ }, Qn = (e) => e.replace(/\/$/, ""), $n = (e) => {
1889
+ let { neutralPath: t, locales: n, activePrefix: r, hasRoute: i } = e, a = Qn(e.origin), o = `${a}${t}`;
1843
1890
  if (n.length <= 1) return [{
1844
1891
  rel: "canonical",
1845
1892
  href: o
@@ -1861,11 +1908,11 @@ var Cn = "levo-made-with", wn = `.${Cn}{opacity:.2;transition:opacity 150ms,tran
1861
1908
  hrefLang: "x-default",
1862
1909
  href: o
1863
1910
  }), s;
1864
- }, Ln = ({ config: e, routeTree: t }) => {
1865
- let n = z({ select: (e) => e.location.pathname });
1911
+ }, er = ({ config: e, routeTree: t }) => {
1912
+ let n = H({ select: (e) => e.location.pathname });
1866
1913
  if (!e.isLocalized || !e.origin) return null;
1867
1914
  let { neutralPath: r } = f(n, e.locales);
1868
- return /* @__PURE__ */ S(x, { children: In({
1915
+ return /* @__PURE__ */ S(x, { children: $n({
1869
1916
  neutralPath: r,
1870
1917
  origin: e.origin,
1871
1918
  locales: e.locales,
@@ -1875,8 +1922,8 @@ var Cn = "levo-made-with", wn = `.${Cn}{opacity:.2;transition:opacity 150ms,tran
1875
1922
  hrefLang: e.hrefLang,
1876
1923
  rel: e.rel
1877
1924
  }, e.hrefLang ?? e.href)) });
1878
- }, Rn = E(void 0), zn = ({ children: e, locale: t, locales: n, defaultLocale: r, source: i = "default", hasRoute: a }) => {
1879
- let o = j(() => {
1925
+ }, tr = E(void 0), nr = ({ children: e, locale: t, locales: n, defaultLocale: r, source: i = "default", hasRoute: a }) => {
1926
+ let o = M(() => {
1880
1927
  let e = n?.length ? n : [t];
1881
1928
  return {
1882
1929
  locale: t,
@@ -1899,13 +1946,13 @@ var Cn = "levo-made-with", wn = `.${Cn}{opacity:.2;transition:opacity 150ms,tran
1899
1946
  i,
1900
1947
  a
1901
1948
  ]);
1902
- return /* @__PURE__ */ S(Rn.Provider, {
1949
+ return /* @__PURE__ */ S(tr.Provider, {
1903
1950
  value: o,
1904
1951
  children: e
1905
1952
  });
1906
1953
  };
1907
- function Bn() {
1908
- return ee(Rn) || {
1954
+ function rr() {
1955
+ return k(tr) || {
1909
1956
  locale: "en",
1910
1957
  locales: ["en"],
1911
1958
  defaultLocale: "en",
@@ -1915,13 +1962,13 @@ function Bn() {
1915
1962
  pathFor: (e) => e
1916
1963
  };
1917
1964
  }
1918
- function Vn(e) {
1919
- let { prefix: t } = f(z({ select: (e) => e.location.pathname }), e.locales);
1965
+ function ir(e) {
1966
+ let { prefix: t } = f(H({ select: (e) => e.location.pathname }), e.locales);
1920
1967
  return t ?? e.defaultLocale;
1921
1968
  }
1922
- var Hn = ({ config: e, children: t, routeTree: n }) => {
1923
- let { prefix: r } = f(z({ select: (e) => e.location.pathname }), e.locales);
1924
- return /* @__PURE__ */ S(zn, {
1969
+ var ar = ({ config: e, children: t, routeTree: n }) => {
1970
+ let { prefix: r } = f(H({ select: (e) => e.location.pathname }), e.locales);
1971
+ return /* @__PURE__ */ S(nr, {
1925
1972
  defaultLocale: e.defaultLocale,
1926
1973
  hasRoute: n ? h(n) : void 0,
1927
1974
  locale: r ?? e.defaultLocale,
@@ -1930,9 +1977,9 @@ var Hn = ({ config: e, children: t, routeTree: n }) => {
1930
1977
  children: t
1931
1978
  });
1932
1979
  };
1933
- function Un() {
1934
- let { locale: e, locales: t, isMultiLocale: n, setLocale: r, pathFor: i, hasRoute: a } = Bn(), o = z({ select: (e) => e.location.pathname });
1935
- return j(() => {
1980
+ function or() {
1981
+ let { locale: e, locales: t, isMultiLocale: n, setLocale: r, pathFor: i, hasRoute: a } = rr(), o = H({ select: (e) => e.location.pathname });
1982
+ return M(() => {
1936
1983
  if (!n) return [];
1937
1984
  let { neutralPath: s } = f(o, t), c = t.filter((e) => !a || a(i(s, e)));
1938
1985
  return c.length < 2 ? [] : c.map((t) => ({
@@ -1958,14 +2005,14 @@ function Un() {
1958
2005
  }
1959
2006
  //#endregion
1960
2007
  //#region src/pageHead.tsx
1961
- var Wn = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Gn = (e) => {
2008
+ var sr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), cr = (e) => {
1962
2009
  let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
1963
2010
  for (let r = n.exec(e); r; r = n.exec(e)) {
1964
2011
  let e = r[1];
1965
2012
  !e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
1966
2013
  }
1967
2014
  return t;
1968
- }, Kn = (e) => {
2015
+ }, lr = (e) => {
1969
2016
  let t = {
1970
2017
  meta: [],
1971
2018
  links: [],
@@ -1973,11 +2020,11 @@ var Wn = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Gn = (e) => {
1973
2020
  };
1974
2021
  if (!e?.trim()) return t;
1975
2022
  let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
1976
- let i = Gn(n), a = r.trim();
2023
+ let i = cr(n), a = r.trim();
1977
2024
  return a && (i.children = a), t.scripts.push(i), "";
1978
2025
  });
1979
- return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(Gn(r)), "")), t;
1980
- }, qn = (e = {}, t = {}) => {
2026
+ return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(cr(r)), "")), t;
2027
+ }, ur = (e = {}, t = {}) => {
1981
2028
  let n = {
1982
2029
  meta: [],
1983
2030
  links: [],
@@ -2042,17 +2089,17 @@ var Wn = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Gn = (e) => {
2042
2089
  let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
2043
2090
  for (let e of y) n.scripts.push({
2044
2091
  type: "application/ld+json",
2045
- children: Wn(e)
2092
+ children: sr(e)
2046
2093
  });
2047
2094
  for (let r of [t.customHead, e.customHead]) {
2048
2095
  if (!r) continue;
2049
- let e = Kn(r);
2096
+ let e = lr(r);
2050
2097
  n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
2051
2098
  }
2052
2099
  return n;
2053
2100
  };
2054
- function Jn({ meta: e, site: t }) {
2055
- let n = qn(e, t);
2101
+ function dr({ meta: e, site: t }) {
2102
+ let n = ur(e, t);
2056
2103
  return /* @__PURE__ */ C(x, { children: [
2057
2104
  n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ S("meta", { ...e }, `m${t}`) : /* @__PURE__ */ S("title", { children: e.title }, `t${t}`)),
2058
2105
  n.links.map((e, t) => /* @__PURE__ */ S("link", { ...e }, `l${t}`)),
@@ -2064,17 +2111,17 @@ function Jn({ meta: e, site: t }) {
2064
2111
  }
2065
2112
  //#endregion
2066
2113
  //#region src/registration/ui.tsx
2067
- var Yn = (...e) => e.filter(Boolean).join(" "), Q = w.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ S("button", {
2114
+ var fr = (...e) => e.filter(Boolean).join(" "), Q = w.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ S("button", {
2068
2115
  ref: o,
2069
2116
  type: i,
2070
- className: Yn("inline-flex items-center justify-center", e),
2117
+ className: fr("inline-flex items-center justify-center", e),
2071
2118
  ...a,
2072
- children: t ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(B, { className: Yn("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
2119
+ children: t ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(ie, { className: fr("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
2073
2120
  }));
2074
2121
  Q.displayName = "Btn";
2075
2122
  //#endregion
2076
2123
  //#region src/registration/AttendeeForm.tsx
2077
- var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o, showBusinessBilling: s = !0 }) => /* @__PURE__ */ C("form", {
2124
+ var pr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o, showBusinessBilling: s = !0 }) => /* @__PURE__ */ C("form", {
2078
2125
  onSubmit: r,
2079
2126
  className: "flex flex-col gap-4",
2080
2127
  children: [
@@ -2239,22 +2286,22 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2239
2286
  })]
2240
2287
  })
2241
2288
  ]
2242
- }), Zn = {
2289
+ }), mr = {
2243
2290
  USD: "$",
2244
2291
  EUR: "€",
2245
2292
  GBP: "£",
2246
2293
  INR: "₹"
2247
- }, $ = (e) => e?.unit_amount ? `${Zn[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", Qn = (e) => {
2294
+ }, $ = (e) => e?.unit_amount ? `${mr[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", hr = (e) => {
2248
2295
  if (!e) return null;
2249
2296
  let t = e.tax_enabled ?? !1, n = e.tax_inclusive ?? !1, r = e.taxes ?? [];
2250
2297
  return !t || r.length === 0 ? null : n ? "(inclusive of taxes)" : "+ taxes";
2251
- }, $n = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), er = (e) => {
2298
+ }, gr = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), _r = (e) => {
2252
2299
  if (!e) return !1;
2253
2300
  let t = e;
2254
2301
  return t.tax_enabled === !0 && t.taxes !== void 0 && t.taxes.length > 0 && t.subtotal !== void 0;
2255
- }, tr = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : er(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, nr = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), rr = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
2302
+ }, vr = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : _r(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, yr = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), br = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
2256
2303
  let c = [...a].sort((e, t) => {
2257
- let n = nr(e, s?._id), r = nr(t, s?._id);
2304
+ let n = yr(e, s?._id), r = yr(t, s?._id);
2258
2305
  return n && !r ? -1 : !n && r ? 1 : 0;
2259
2306
  });
2260
2307
  return /* @__PURE__ */ C("div", { children: [
@@ -2266,7 +2313,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2266
2313
  className: "rounded-md p-2 hover:bg-gray-50 focus:outline-none",
2267
2314
  "aria-label": "Back",
2268
2315
  onClick: o,
2269
- children: /* @__PURE__ */ S(ie, { className: "size-4" })
2316
+ children: /* @__PURE__ */ S(U, { className: "size-4" })
2270
2317
  }),
2271
2318
  /* @__PURE__ */ C("p", {
2272
2319
  className: "font-semibold text-md",
@@ -2298,17 +2345,17 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2298
2345
  zIndex: e ? 1 : -1
2299
2346
  },
2300
2347
  isLoading: r,
2301
- children: /* @__PURE__ */ S(re, { className: "h-fit" })
2348
+ children: /* @__PURE__ */ S(ne, { className: "h-fit" })
2302
2349
  })]
2303
2350
  }),
2304
2351
  c.length > 0 && /* @__PURE__ */ C("div", {
2305
2352
  className: "mt-4 flex flex-col gap-4",
2306
- children: [c.filter((e) => nr(e, s?._id)).length > 0 && /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
2353
+ children: [c.filter((e) => yr(e, s?._id)).length > 0 && /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
2307
2354
  className: "mb-2 text-gray-600 text-sm",
2308
2355
  children: "Available Coupons"
2309
2356
  }), /* @__PURE__ */ S("div", {
2310
2357
  className: "flex flex-col gap-2",
2311
- children: c.filter((e) => nr(e, s?._id)).map((e) => /* @__PURE__ */ C("button", {
2358
+ children: c.filter((e) => yr(e, s?._id)).map((e) => /* @__PURE__ */ C("button", {
2312
2359
  type: "button",
2313
2360
  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",
2314
2361
  onClick: () => {
@@ -2321,19 +2368,19 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2321
2368
  children: e.code
2322
2369
  }), /* @__PURE__ */ S("span", {
2323
2370
  className: "text-gray-500 text-sm",
2324
- children: e.kind === "percent" ? `${e.percent_off}% off` : `${Zn[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
2371
+ children: e.kind === "percent" ? `${e.percent_off}% off` : `${mr[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
2325
2372
  })]
2326
2373
  }), e.description && /* @__PURE__ */ S("span", {
2327
2374
  className: "text-gray-500 text-xs",
2328
2375
  children: e.description
2329
2376
  })]
2330
2377
  }, e._id))
2331
- })] }), c.filter((e) => !nr(e, s?._id)).length > 0 && /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
2378
+ })] }), c.filter((e) => !yr(e, s?._id)).length > 0 && /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
2332
2379
  className: "mb-2 text-gray-400 text-sm",
2333
2380
  children: "Not Applicable"
2334
2381
  }), /* @__PURE__ */ S("div", {
2335
2382
  className: "flex flex-col gap-2",
2336
- children: c.filter((e) => !nr(e, s?._id)).map((e) => /* @__PURE__ */ C("button", {
2383
+ children: c.filter((e) => !yr(e, s?._id)).map((e) => /* @__PURE__ */ C("button", {
2337
2384
  type: "button",
2338
2385
  disabled: !0,
2339
2386
  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",
@@ -2344,7 +2391,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2344
2391
  children: e.code
2345
2392
  }), /* @__PURE__ */ S("span", {
2346
2393
  className: "text-gray-500 text-sm",
2347
- children: e.kind === "percent" ? `${e.percent_off}% off` : `${Zn[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
2394
+ children: e.kind === "percent" ? `${e.percent_off}% off` : `${mr[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
2348
2395
  })]
2349
2396
  }), e.description && /* @__PURE__ */ S("span", {
2350
2397
  className: "text-gray-500 text-xs",
@@ -2354,7 +2401,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2354
2401
  })] })]
2355
2402
  })
2356
2403
  ] });
2357
- }, ir = (e) => {
2404
+ }, xr = (e) => {
2358
2405
  let t = new Date(e);
2359
2406
  return `${new Intl.DateTimeFormat("en-GB", {
2360
2407
  day: "numeric",
@@ -2365,16 +2412,16 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2365
2412
  minute: "2-digit",
2366
2413
  hour12: !0
2367
2414
  }).format(t)}`;
2368
- }, ar = ({ ticketData: e, paymentData: t, type: n }) => {
2369
- let [r, i] = N(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
2415
+ }, Sr = ({ ticketData: e, paymentData: t, type: n }) => {
2416
+ let [r, i] = P(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
2370
2417
  style: "currency",
2371
2418
  currency: t.currency || "INR",
2372
2419
  minimumFractionDigits: 0
2373
2420
  }).format(e);
2374
- return /* @__PURE__ */ S(P.Root, {
2421
+ return /* @__PURE__ */ S(I.Root, {
2375
2422
  open: r,
2376
2423
  onOpenChange: (e) => i(e),
2377
- children: /* @__PURE__ */ C(P.Portal, { children: [/* @__PURE__ */ S(P.Backdrop, { className: "fixed inset-0 z-50 bg-black/50" }), /* @__PURE__ */ C(P.Popup, {
2424
+ children: /* @__PURE__ */ C(I.Portal, { children: [/* @__PURE__ */ S(I.Backdrop, { className: "fixed inset-0 z-50 bg-black/50" }), /* @__PURE__ */ C(I.Popup, {
2378
2425
  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",
2379
2426
  children: [
2380
2427
  /* @__PURE__ */ C("div", {
@@ -2397,11 +2444,11 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2397
2444
  children: [/* @__PURE__ */ S("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ S("polyline", { points: "22 4 12 14.01 9 11.01" })]
2398
2445
  })
2399
2446
  }),
2400
- /* @__PURE__ */ S(P.Title, {
2447
+ /* @__PURE__ */ S(I.Title, {
2401
2448
  className: "font-bold text-gray-900 text-lg",
2402
2449
  children: n === "view" ? "Booking Details" : "Tickets Confirmed!"
2403
2450
  }),
2404
- /* @__PURE__ */ S(P.Description, {
2451
+ /* @__PURE__ */ S(I.Description, {
2405
2452
  className: "mt-1 text-gray-600 text-sm",
2406
2453
  children: n === "confirm" ? "Your tickets have been confirmed. A confirmation email is on its way." : "Here are the details about your booking."
2407
2454
  })
@@ -2513,7 +2560,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2513
2560
  ]
2514
2561
  }), /* @__PURE__ */ S("p", {
2515
2562
  className: "mt-3 text-center text-gray-400 text-xs",
2516
- children: ir(t.created_at)
2563
+ children: xr(t.created_at)
2517
2564
  })]
2518
2565
  }),
2519
2566
  /* @__PURE__ */ C("div", {
@@ -2545,7 +2592,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2545
2592
  })
2546
2593
  ]
2547
2594
  }), "Download Invoice"]
2548
- }), /* @__PURE__ */ S(P.Close, {
2595
+ }), /* @__PURE__ */ S(I.Close, {
2549
2596
  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",
2550
2597
  children: "Done"
2551
2598
  })]
@@ -2553,36 +2600,36 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2553
2600
  ]
2554
2601
  })] })
2555
2602
  });
2556
- }, or = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ S(P.Root, {
2603
+ }, Cr = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ S(I.Root, {
2557
2604
  open: e,
2558
2605
  onOpenChange: (e) => {
2559
2606
  e || t();
2560
2607
  },
2561
- children: /* @__PURE__ */ C(P.Portal, { children: [/* @__PURE__ */ S(P.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ C(P.Popup, {
2608
+ children: /* @__PURE__ */ C(I.Portal, { children: [/* @__PURE__ */ S(I.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ C(I.Popup, {
2562
2609
  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]",
2563
- children: [/* @__PURE__ */ S(P.Close, {
2610
+ children: [/* @__PURE__ */ S(I.Close, {
2564
2611
  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",
2565
2612
  children: /* @__PURE__ */ S(se, { className: "size-5" })
2566
2613
  }), /* @__PURE__ */ S("div", {
2567
2614
  className: "flex-1 overflow-y-auto rounded-2xl py-6",
2568
- children: /* @__PURE__ */ S(le, {
2615
+ children: /* @__PURE__ */ S(W, {
2569
2616
  stripe: n,
2570
2617
  options: {
2571
2618
  clientSecret: r,
2572
2619
  onComplete: i
2573
2620
  },
2574
- children: /* @__PURE__ */ S(H, { className: "stripe-embedded-checkout h-full" })
2621
+ children: /* @__PURE__ */ S(le, { className: "stripe-embedded-checkout h-full" })
2575
2622
  })
2576
2623
  })]
2577
2624
  })] })
2578
- }), sr = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
2579
- let l = er(t), u = $n(r);
2625
+ }), wr = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
2626
+ let l = _r(t), u = gr(r);
2580
2627
  return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("div", {
2581
2628
  className: "flex max-h-[64dvh] w-full flex-col justify-between gap-6 overflow-y-auto md:max-h-[unset] md:flex-row",
2582
2629
  children: [/* @__PURE__ */ S("div", {
2583
2630
  className: "flex w-full flex-col gap-3 md:w-[55%]",
2584
2631
  children: e.map((e) => /* @__PURE__ */ S("div", {
2585
- className: Yn("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" : ""),
2632
+ className: fr("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" : ""),
2586
2633
  onClick: () => n(e),
2587
2634
  children: /* @__PURE__ */ C("div", { children: [
2588
2635
  /* @__PURE__ */ S("p", {
@@ -2595,9 +2642,9 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2595
2642
  }),
2596
2643
  /* @__PURE__ */ C("p", {
2597
2644
  className: "text-md",
2598
- children: [$(e), Qn(e) && /* @__PURE__ */ C("span", {
2645
+ children: [$(e), hr(e) && /* @__PURE__ */ C("span", {
2599
2646
  className: "text-gray-500 text-sm",
2600
- children: [" ", Qn(e)]
2647
+ children: [" ", hr(e)]
2601
2648
  })]
2602
2649
  })
2603
2650
  ] })
@@ -2821,7 +2868,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2821
2868
  className: "flex max-w-16 items-center gap-2",
2822
2869
  children: [/* @__PURE__ */ S("div", {
2823
2870
  className: "rounded bg-green-500 p-2",
2824
- children: /* @__PURE__ */ S(V, {
2871
+ children: /* @__PURE__ */ S(ae, {
2825
2872
  size: 16,
2826
2873
  className: "text-white"
2827
2874
  })
@@ -2855,7 +2902,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2855
2902
  })]
2856
2903
  })
2857
2904
  }) : /* @__PURE__ */ C("div", {
2858
- className: Yn("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"),
2905
+ className: fr("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"),
2859
2906
  onClick: () => t ? o() : null,
2860
2907
  children: [/* @__PURE__ */ C("span", {
2861
2908
  className: "flex items-center gap-2",
@@ -2863,7 +2910,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2863
2910
  className: "rounded-full bg-gray-200 px-2 py-0.5 text-gray-600 text-xs",
2864
2911
  children: a
2865
2912
  })]
2866
- }), /* @__PURE__ */ S("span", { children: /* @__PURE__ */ S(ae, {}) })]
2913
+ }), /* @__PURE__ */ S("span", { children: /* @__PURE__ */ S(re, {}) })]
2867
2914
  })]
2868
2915
  })]
2869
2916
  }), /* @__PURE__ */ S("div", {
@@ -2874,8 +2921,8 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2874
2921
  children: "Continue for Payment"
2875
2922
  })
2876
2923
  })] });
2877
- }, cr = () => {
2878
- let [e, t] = N(null), [n, r] = N(null), [i, a] = N(!1), [o, s] = N(null);
2924
+ }, Tr = () => {
2925
+ let [e, t] = P(null), [n, r] = P(null), [i, a] = P(!1), [o, s] = P(null);
2879
2926
  return {
2880
2927
  stripePromise: e,
2881
2928
  config: n,
@@ -2898,7 +2945,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2898
2945
  s(() => e);
2899
2946
  }, [])
2900
2947
  };
2901
- }, lr = {
2948
+ }, Er = {
2902
2949
  name: "",
2903
2950
  email: "",
2904
2951
  is_business_purchase: !1,
@@ -2914,32 +2961,32 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2914
2961
  country: ""
2915
2962
  }
2916
2963
  }
2917
- }, ur = (e, t, n) => {
2964
+ }, Dr = (e, t, n) => {
2918
2965
  let r = t.split("."), i = structuredClone(e), a = i, o = r.length - 1;
2919
2966
  return r.forEach((e, t) => {
2920
2967
  t === o ? a[e] = n : a = a[e];
2921
2968
  }), i;
2922
- }, dr = async (e, t) => {
2969
+ }, Or = async (e, t) => {
2923
2970
  try {
2924
2971
  let n = new URLSearchParams();
2925
2972
  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;
2926
2973
  } catch (t) {
2927
2974
  e.logger?.error("Failed to fetch event tickets", { exception: b(t) });
2928
2975
  }
2929
- }, fr = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now" }) => {
2930
- let a = i(), [o, s] = N([]), [c, l] = N(!0), [u, d] = N(!1), [f, p] = N(!1), [m, h] = N(null), [g, _] = N(void 0), [v, y] = N(""), [w, T] = N(null), [E, D] = N(!1), [ee, A] = N(null), [j, F] = N(!1), [I, L] = N(1), [te, R] = N(null), [z, ne] = N([]), [re, ie] = N(lr), ae = tr(m, w) === 0, B = M(null), V = () => ie(lr), oe = () => {
2931
- T(null), _(void 0), A(null), D(!1), y(""), R(null), d(!1), L(1), V();
2932
- }, { Razorpay: H } = ce(), { stripePromise: le, config: U, isOpen: W, openStripeCheckout: ue, closeStripeCheckout: de, setOnComplete: G } = cr(), K = () => {
2933
- let e = B.current;
2976
+ }, kr = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now" }) => {
2977
+ let a = i(), [o, s] = P([]), [c, l] = P(!0), [u, d] = P(!1), [f, p] = P(!1), [m, h] = P(null), [g, _] = P(void 0), [v, y] = P(""), [w, T] = P(null), [E, D] = P(!1), [k, j] = P(null), [M, F] = P(!1), [L, R] = P(1), [z, B] = P(null), [V, ee] = P([]), [H, te] = P(Er), ne = vr(m, w) === 0, U = N(null), re = () => te(Er), ie = () => {
2978
+ T(null), _(void 0), j(null), D(!1), y(""), B(null), d(!1), R(1), re();
2979
+ }, { Razorpay: ae } = ce(), { stripePromise: oe, config: le, isOpen: W, openStripeCheckout: ue, closeStripeCheckout: G, setOnComplete: de } = Tr(), fe = () => {
2980
+ let e = U.current;
2934
2981
  !e || !a || a.fetch?.url(`/v1/event/booking/${e.bookingId}/confirm-booking`)?.post({ session_id: e.sessionId })?.json().then((e) => {
2935
- e?.content?.data && _(e?.content?.data), de(), B.current = null;
2982
+ e?.content?.data && _(e?.content?.data), G(), U.current = null;
2936
2983
  }).catch((e) => {
2937
- a.logger?.error("Failed to confirm booking after Stripe payment", { exception: b(e) }), de(), B.current = null;
2984
+ a.logger?.error("Failed to confirm booking after Stripe payment", { exception: b(e) }), G(), U.current = null;
2938
2985
  });
2939
- }, fe = async () => {
2986
+ }, K = async () => {
2940
2987
  if (!a) return;
2941
- p(!0), R(null);
2942
- let { name: t, email: n, is_business_purchase: r, billing_details: i } = re;
2988
+ p(!0), B(null);
2989
+ let { name: t, email: n, is_business_purchase: r, billing_details: i } = H;
2943
2990
  try {
2944
2991
  let o = {
2945
2992
  event: e,
@@ -2951,18 +2998,18 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2951
2998
  details: {}
2952
2999
  }]
2953
3000
  };
2954
- r && !ae && (o.is_business_purchase = !0, o.billing_details = i);
3001
+ r && !ne && (o.is_business_purchase = !0, o.billing_details = i);
2955
3002
  let s = await a.fetch?.url(`/v1/event/event/${e}/booking/create-new-booking`)?.post(o).json();
2956
- if (!s?.status) R("Booking failed. Please try again.");
3003
+ if (!s?.status) B("Booking failed. Please try again.");
2957
3004
  else {
2958
- oe();
3005
+ ie();
2959
3006
  let e = s?.content?.meta;
2960
3007
  if (e?.key) {
2961
3008
  let t = s?.content.data?._id;
2962
- e.provider === "stripe" && e.client_secret ? (B.current = t && e.session_id ? {
3009
+ e.provider === "stripe" && e.client_secret ? (U.current = t && e.session_id ? {
2963
3010
  bookingId: t,
2964
3011
  sessionId: e.session_id
2965
- } : null, G(K), await ue({
3012
+ } : null, de(fe), await ue({
2966
3013
  key: e.key,
2967
3014
  client_secret: e.client_secret,
2968
3015
  amount: s?.content.data?.unit_amount || 0,
@@ -2979,12 +3026,12 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2979
3026
  } else _(s?.content.data);
2980
3027
  }
2981
3028
  } catch (e) {
2982
- R(b(e).message || "Something went wrong. Please try again.");
3029
+ B(b(e).message || "Something went wrong. Please try again.");
2983
3030
  }
2984
3031
  p(!1);
2985
3032
  }, pe = async (e) => {
2986
3033
  if (!a) return;
2987
- let n = new H({
3034
+ let n = new ae({
2988
3035
  key: e.key,
2989
3036
  amount: e.amount ?? 0,
2990
3037
  currency: e.currency,
@@ -3015,14 +3062,14 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
3015
3062
  }, me = O(async () => {
3016
3063
  if (a) try {
3017
3064
  let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/list-public-coupons`)?.get().json();
3018
- t?.status && t?.content?.data && ne(t.content.data);
3065
+ t?.status && t?.content?.data && ee(t.content.data);
3019
3066
  } catch (e) {
3020
3067
  a.logger?.error("Failed to fetch public coupons", { exception: b(e) });
3021
3068
  }
3022
3069
  }, [a, e]), he = async (t) => {
3023
3070
  if (!a) return;
3024
3071
  let n = t ?? v;
3025
- D(!0), A(null);
3072
+ D(!0), j(null);
3026
3073
  try {
3027
3074
  let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/validate-coupon-code`)?.post({
3028
3075
  coupon: n,
@@ -3035,35 +3082,35 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
3035
3082
  }).json();
3036
3083
  t?.status && (T(t.content.data), y(n)), F(!1), D(!1);
3037
3084
  } catch (e) {
3038
- A(b(e).message), D(!1);
3085
+ j(b(e).message), D(!1);
3039
3086
  }
3040
3087
  }, ge = (e) => {
3041
- y(""), T(null), A(null), D(!1), R(null), h(e);
3088
+ y(""), T(null), j(null), D(!1), B(null), h(e);
3042
3089
  }, _e = () => {
3043
- T(null), A(null), y("");
3090
+ T(null), j(null), y("");
3044
3091
  }, ve = () => {
3045
- A(null), D(!1), y(""), F(!1);
3092
+ j(null), D(!1), y(""), F(!1);
3046
3093
  }, ye = (e) => {
3047
3094
  let { name: t, value: n, type: r, checked: i } = e.target;
3048
- ie((e) => ur(e, t, r === "checkbox" ? i : n));
3049
- }, q = () => {}, be = (e) => {
3050
- e?.preventDefault(), fe();
3095
+ te((e) => Dr(e, t, r === "checkbox" ? i : n));
3096
+ }, be = () => {}, xe = (e) => {
3097
+ e?.preventDefault(), K();
3051
3098
  };
3052
- if (k(() => {
3099
+ if (A(() => {
3053
3100
  if (n) {
3054
3101
  l(!1);
3055
3102
  return;
3056
3103
  }
3057
- e && a && (l(!0), dr(a, e).then((e) => {
3104
+ e && a && (l(!0), Or(a, e).then((e) => {
3058
3105
  s(e ?? []), e && e.length > 0 && h(e[0] || null), l(!1);
3059
3106
  }));
3060
3107
  }, [
3061
3108
  e,
3062
3109
  n,
3063
3110
  a
3064
- ]), k(() => {
3065
- m?.unit_amount === 0 && o?.length === 1 && L(2);
3066
- }, [m, o]), k(() => {
3111
+ ]), A(() => {
3112
+ m?.unit_amount === 0 && o?.length === 1 && R(2);
3113
+ }, [m, o]), A(() => {
3067
3114
  u && e && me();
3068
3115
  }, [
3069
3116
  u,
@@ -3084,7 +3131,7 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
3084
3131
  children: "Loading..."
3085
3132
  })
3086
3133
  });
3087
- let xe = ae ? "Complete Registration" : "Pay";
3134
+ let q = ne ? "Complete Registration" : "Pay";
3088
3135
  return /* @__PURE__ */ C(x, { children: [
3089
3136
  /* @__PURE__ */ S("div", {
3090
3137
  className: "my-2",
@@ -3097,74 +3144,74 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
3097
3144
  children: "No tickets available for this event."
3098
3145
  })
3099
3146
  }),
3100
- /* @__PURE__ */ S(P.Root, {
3147
+ /* @__PURE__ */ S(I.Root, {
3101
3148
  open: u,
3102
3149
  onOpenChange: (e) => {
3103
- e || oe();
3150
+ e || ie();
3104
3151
  },
3105
- children: /* @__PURE__ */ C(P.Portal, { children: [/* @__PURE__ */ S(P.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ C(P.Popup, {
3106
- className: Yn("fixed top-24 left-1/2 z-[100] flex max-h-[calc(100dvh-12rem)] w-[90%] -translate-x-1/2 flex-col overflow-y-auto rounded-lg bg-white p-4", j ? "md:w-[30%]" : "md:w-[40%]"),
3152
+ children: /* @__PURE__ */ C(I.Portal, { children: [/* @__PURE__ */ S(I.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ C(I.Popup, {
3153
+ className: fr("fixed top-24 left-1/2 z-[100] flex max-h-[calc(100dvh-12rem)] w-[90%] -translate-x-1/2 flex-col overflow-y-auto rounded-lg bg-white p-4", M ? "md:w-[30%]" : "md:w-[40%]"),
3107
3154
  children: [/* @__PURE__ */ C("div", {
3108
- className: `mb-4 flex w-full items-start justify-between ${j ? "" : "pb-[6px]"} `,
3109
- children: [/* @__PURE__ */ C(P.Title, {
3155
+ className: `mb-4 flex w-full items-start justify-between ${M ? "" : "pb-[6px]"} `,
3156
+ children: [/* @__PURE__ */ C(I.Title, {
3110
3157
  className: "font-semibold text-lg",
3111
3158
  children: [
3112
3159
  "Register for ",
3113
3160
  t,
3114
3161
  "!"
3115
3162
  ]
3116
- }), /* @__PURE__ */ S(P.Close, {
3163
+ }), /* @__PURE__ */ S(I.Close, {
3117
3164
  className: "rounded-md p-2 hover:bg-gray-100 focus:outline-none",
3118
3165
  children: /* @__PURE__ */ S(se, { className: "size-4" })
3119
3166
  })]
3120
- }), /* @__PURE__ */ C("div", { children: [te && /* @__PURE__ */ S("div", {
3167
+ }), /* @__PURE__ */ C("div", { children: [z && /* @__PURE__ */ S("div", {
3121
3168
  className: "mb-4 rounded-md bg-red-50 p-3 text-red-600 text-sm",
3122
- children: te
3123
- }), I === 1 ? /* @__PURE__ */ S("div", { children: j ? /* @__PURE__ */ S(rr, {
3169
+ children: z
3170
+ }), L === 1 ? /* @__PURE__ */ S("div", { children: M ? /* @__PURE__ */ S(br, {
3124
3171
  couponCode: v,
3125
3172
  onCouponCodeChange: y,
3126
- couponError: ee,
3173
+ couponError: k,
3127
3174
  couponLoading: E,
3128
3175
  onValidateCoupon: he,
3129
- publicCoupons: z,
3176
+ publicCoupons: V,
3130
3177
  onBack: ve,
3131
3178
  selectedTicket: m
3132
- }) : /* @__PURE__ */ S(sr, {
3179
+ }) : /* @__PURE__ */ S(wr, {
3133
3180
  tickets: o,
3134
3181
  selectedTicket: m,
3135
3182
  onSelectTicket: ge,
3136
3183
  discount: w,
3137
3184
  couponCode: v,
3138
- publicCouponsCount: z.length,
3185
+ publicCouponsCount: V.length,
3139
3186
  onApplyCouponClick: () => F(!0),
3140
3187
  onRemoveCoupon: _e,
3141
- onNext: () => L(2)
3142
- }) }) : /* @__PURE__ */ S(Xn, {
3143
- values: re,
3188
+ onNext: () => R(2)
3189
+ }) }) : /* @__PURE__ */ S(pr, {
3190
+ values: H,
3144
3191
  handleChange: ye,
3145
- handleBlur: q,
3146
- handleSubmit: be,
3192
+ handleBlur: be,
3193
+ handleSubmit: xe,
3147
3194
  registerLoading: f,
3148
- onBack: () => L(1),
3149
- submitLabel: xe,
3150
- showBusinessBilling: !ae
3195
+ onBack: () => R(1),
3196
+ submitLabel: q,
3197
+ showBusinessBilling: !ne
3151
3198
  })] })]
3152
3199
  })] })
3153
3200
  }),
3154
- g && /* @__PURE__ */ S(ar, {
3201
+ g && /* @__PURE__ */ S(Sr, {
3155
3202
  paymentData: g,
3156
3203
  ticketData: o,
3157
3204
  type: "confirm"
3158
3205
  }),
3159
- W && U && /* @__PURE__ */ S(or, {
3206
+ W && le && /* @__PURE__ */ S(Cr, {
3160
3207
  isOpen: W,
3161
- onClose: de,
3162
- stripePromise: le,
3163
- clientSecret: U.clientSecret,
3164
- onComplete: K
3208
+ onClose: G,
3209
+ stripePromise: oe,
3210
+ clientSecret: le.clientSecret,
3211
+ onComplete: fe
3165
3212
  })
3166
3213
  ] });
3167
- }, pr = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, mr = (e) => typeof e == "string" && e.trim() ? e : void 0, hr = (e) => typeof e == "string" ? e : e?.location ?? void 0, gr = (e, t) => {
3214
+ }, Ar = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, jr = (e) => typeof e == "string" && e.trim() ? e : void 0, Mr = (e) => typeof e == "string" ? e : e?.location ?? void 0, Nr = (e, t) => {
3168
3215
  let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
3169
3216
  return {
3170
3217
  title: n.meta_title || r,
@@ -3174,33 +3221,33 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
3174
3221
  og: {
3175
3222
  title: n.og_title || void 0,
3176
3223
  description: n.og_description || void 0,
3177
- image: hr(n.og_image),
3224
+ image: Mr(n.og_image),
3178
3225
  url: n.og_url || void 0
3179
3226
  },
3180
3227
  twitter: { card: n.twitter_card || void 0 },
3181
3228
  ldJson: n.ld_json || void 0,
3182
3229
  customHead: n.head_code || void 0
3183
3230
  };
3184
- }, _r = (e) => ({
3231
+ }, Pr = (e) => ({
3185
3232
  description: e.description || void 0,
3186
3233
  icon: e.icon?.location || void 0,
3187
3234
  customHead: e.settings?.head_code || void 0
3188
- }), vr = (e) => (t = {}, n) => (r) => {
3189
- let i = gr(t, e.name);
3235
+ }), Fr = (e) => (t = {}, n) => (r) => {
3236
+ let i = Nr(t, e.name);
3190
3237
  if (n) {
3191
3238
  let t = r?.loaderData?.[n.source];
3192
3239
  if (t) {
3193
- let r = n.title ? mr(t[n.title]) : void 0;
3240
+ let r = n.title ? jr(t[n.title]) : void 0;
3194
3241
  r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
3195
3242
  ...i.og,
3196
3243
  title: r
3197
3244
  });
3198
- let a = n.description ? mr(t[n.description]) : void 0;
3245
+ let a = n.description ? jr(t[n.description]) : void 0;
3199
3246
  a && (i.description = a, i.og = {
3200
3247
  ...i.og,
3201
3248
  description: a
3202
3249
  });
3203
- let o = n.image ? hr(t[n.image]) : void 0;
3250
+ let o = n.image ? Mr(t[n.image]) : void 0;
3204
3251
  o && (i.og = {
3205
3252
  ...i.og,
3206
3253
  image: o
@@ -3209,24 +3256,77 @@ var Xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
3209
3256
  }
3210
3257
  if (!i.canonical) {
3211
3258
  let t = r?.match?.pathname, n = (e.domain || "").trim();
3212
- n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + pr(t));
3259
+ n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + Ar(t));
3213
3260
  }
3214
- let a = qn(i, _r(e)), o = t.id?.trim();
3261
+ let a = ur(i, Pr(e)), o = t.id?.trim();
3215
3262
  return o && a.meta.push({
3216
- name: En,
3263
+ name: Bn,
3217
3264
  content: o
3218
3265
  }), a;
3219
- }, yr = (e) => {
3220
- let t = Ce(e);
3266
+ }, Ir = (e) => {
3267
+ let t = Ee(e);
3221
3268
  return (e, n) => {
3222
- let { rules: r, invalid: i } = ge(n?.access), a = r.length > 0 || i;
3223
- return ({ context: n, params: r }) => a ? Promise.resolve({}) : Fe({
3269
+ let { rules: r, invalid: i } = ve(n?.access), a = r.length > 0 || i;
3270
+ return ({ context: n, params: r }) => a ? Promise.resolve({}) : ze({
3224
3271
  queryClient: n.queryClient,
3225
3272
  config: t,
3226
3273
  sources: e,
3227
3274
  params: r
3228
3275
  });
3229
3276
  };
3277
+ }, Lr = 2, Rr = (e) => {
3278
+ let { limit: t = 20, debounceMs: n = 300, hotkey: r = !0 } = e ?? {}, a = i(), o = Kn(), s = J(), [c, l] = P(""), [u, d] = P(!1), [f, p] = P("");
3279
+ A(() => {
3280
+ let e = setTimeout(() => p(c.trim()), n);
3281
+ return () => clearTimeout(e);
3282
+ }, [c, n]);
3283
+ let m = f.length >= Lr, h = z({
3284
+ queryKey: [
3285
+ "levo-search",
3286
+ o?.id ?? null,
3287
+ f,
3288
+ t
3289
+ ],
3290
+ queryFn: async () => {
3291
+ try {
3292
+ return (await a?.fetch.url("/v1/builder/search").query({
3293
+ q: f,
3294
+ limit: t,
3295
+ site_id: o?.id
3296
+ }).get().json())?.content?.data ?? [];
3297
+ } catch (e) {
3298
+ let t = b(e);
3299
+ throw a?.logger?.error("Site search failed", { exception: t }), t;
3300
+ }
3301
+ },
3302
+ enabled: s && !!a && !!o?.id && m,
3303
+ placeholderData: L,
3304
+ staleTime: 3e4
3305
+ }), g = O(() => {
3306
+ l(""), p("");
3307
+ }, []), _ = O(() => d(!0), []), v = O(() => d(!1), []);
3308
+ A(() => {
3309
+ if (!r) return;
3310
+ let e = (e) => {
3311
+ e.key !== "k" || !(e.metaKey || e.ctrlKey) || (e.preventDefault(), d((e) => !e));
3312
+ };
3313
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
3314
+ }, [r]);
3315
+ let y = m ? h.data ?? [] : [];
3316
+ return {
3317
+ query: c,
3318
+ setQuery: l,
3319
+ results: y,
3320
+ isLoading: h.isFetching,
3321
+ error: h.error ? b(h.error).message : null,
3322
+ isEmpty: m && h.isSuccess && !h.isFetching && y.length === 0,
3323
+ isSearchable: m,
3324
+ reset: g,
3325
+ isOpen: u,
3326
+ setOpen: d,
3327
+ open: _,
3328
+ close: v
3329
+ };
3230
3330
  };
3231
3331
  //#endregion
3232
- export { _t as ColorModeProvider, xn as Inspector, ue as LEVO_AUTH_METHODS, Y as LEVO_AUTH_QUERY_KEY, W as LEVO_OAUTH_METHODS, nt as LEVO_OTP_LENGTH, Ke as LEVO_PENDING_APPROVAL_CODE, U as LEVO_PRIMARY_AUTH_METHODS, m as LOCALE_COOKIE, l as LOCALE_REDIRECT_CACHE_CONTROL, lt as LevoChat, ze as LevoEntryForm, fr as LevoEventRegister, yt as LevoForm, kn as LevoPopups, We as LevoProfileForm, Mn as LevoSiteProvider, Ln as LocaleHreflang, zn as LocaleProvider, En as PAGE_ID_META, Jn as PageHead, Hn as SiteLocaleProvider, In as buildHreflangLinks, vr as createLevoHead, yr as createLevoLoader, _ as createRouteTreeMatcher, Se as createSiteClient, xe as decideAccess, v as extractGeoAndLanguageData, qe as isPendingApprovalError, rt as isValidEmail, it as isValidOtp, ot as isValidPhone, Nn as localeBeforeLoad, p as localePath, d as localeRedirectResponse, at as normalizePhone, qn as pageHead, ge as parseAccess, Kn as parseRawHead, Fe as prefetchLevoSources, Pn as readLocaleConfig, Dn as readPageId, _e as resolveAuthMethods, g as resolveLocale, u as resolveLocaleRedirect, s as resolveLocaleRequest, Ce as siteConfigFromJson, f as splitLocalePrefix, vt as useColorMode, Un as useLanguageOptions, Ge as useLevoAccess, Re as useLevoAuth, Pe as useLevoForm, jn as useLevoInsights, Xe as useLevoLogin, tt as useLevoOAuth, st as useLevoOtpInput, Ne as useLevoRecord, An as useLevoSite, Me as useLevoSource, Bn as useLocale, Vn as useUrlLocale };
3332
+ export { Et as ColorModeProvider, Fn as Inspector, de as LEVO_AUTH_METHODS, Y as LEVO_AUTH_QUERY_KEY, G as LEVO_OAUTH_METHODS, dt as LEVO_OTP_LENGTH, tt as LEVO_PENDING_APPROVAL_CODE, ue as LEVO_PRIMARY_AUTH_METHODS, m as LOCALE_COOKIE, l as LOCALE_REDIRECT_CACHE_CONTROL, vt as LevoChat, Ue as LevoEntryForm, kr as LevoEventRegister, Ot as LevoForm, Un as LevoPopups, Je as LevoProfileForm, Yn as LevoSiteProvider, er as LocaleHreflang, nr as LocaleProvider, Bn as PAGE_ID_META, dr as PageHead, ar as SiteLocaleProvider, $n as buildHreflangLinks, Fr as createLevoHead, Ir as createLevoLoader, _ as createRouteTreeMatcher, Te as createSiteClient, we as decideAccess, v as extractGeoAndLanguageData, nt as isPendingApprovalError, ft as isValidEmail, pt as isValidOtp, ht as isValidPhone, Xn as localeBeforeLoad, p as localePath, d as localeRedirectResponse, mt as normalizePhone, ur as pageHead, ve as parseAccess, lr as parseRawHead, ze as prefetchLevoSources, Zn as readLocaleConfig, Vn as readPageId, ye as resolveAuthMethods, g as resolveLocale, u as resolveLocaleRedirect, s as resolveLocaleRequest, Ee as siteConfigFromJson, f as splitLocalePrefix, Dt as useColorMode, or as useLanguageOptions, et as useLevoAccess, He as useLevoAuth, Le as useLevoForm, Jn as useLevoInsights, at as useLevoLogin, ut as useLevoOAuth, gt as useLevoOtpInput, Ie as useLevoRecord, Rr as useLevoSearch, qn as useLevoSite, Fe as useLevoSource, rr as useLocale, ir as useUrlLocale };