@levo-so/site-runtime 0.3.11 → 0.3.12

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