@levo-so/site-runtime 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +14 -1
- package/index.js +163 -133
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -88,6 +88,11 @@ export declare type IEditorToPreview = {
|
|
|
88
88
|
stageId: string;
|
|
89
89
|
element: IElementLocator;
|
|
90
90
|
value: string;
|
|
91
|
+
} | {
|
|
92
|
+
type: "stage-image";
|
|
93
|
+
stageId: string;
|
|
94
|
+
element: IElementLocator;
|
|
95
|
+
value: string;
|
|
91
96
|
} | {
|
|
92
97
|
type: "clear-staged";
|
|
93
98
|
stageId?: string;
|
|
@@ -504,7 +509,15 @@ export declare interface ISiteMeta extends IPageMeta {
|
|
|
504
509
|
titleTemplate?: string;
|
|
505
510
|
}
|
|
506
511
|
|
|
507
|
-
export declare type IStagedEntry = IStagedStyleEntry | IStagedTextEntry;
|
|
512
|
+
export declare type IStagedEntry = IStagedStyleEntry | IStagedTextEntry | IStagedImageEntry;
|
|
513
|
+
|
|
514
|
+
declare interface IStagedImageEntry {
|
|
515
|
+
kind: "image";
|
|
516
|
+
source: string;
|
|
517
|
+
index: number;
|
|
518
|
+
/** New image URL applied as the element's `src`; its original `src`/`srcset` are stashed. */
|
|
519
|
+
value: string;
|
|
520
|
+
}
|
|
508
521
|
|
|
509
522
|
export declare interface IStagedStyleEntry {
|
|
510
523
|
kind: "style";
|
package/index.js
CHANGED
|
@@ -3893,6 +3893,10 @@ var Ga = (e) => {
|
|
|
3893
3893
|
}
|
|
3894
3894
|
return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
|
|
3895
3895
|
}, vo = (e) => {
|
|
3896
|
+
if (!e) return !1;
|
|
3897
|
+
let t = e.tagName;
|
|
3898
|
+
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
|
|
3899
|
+
}, yo = (e) => {
|
|
3896
3900
|
if (!e.childNodes.length) return !1;
|
|
3897
3901
|
let t = !1;
|
|
3898
3902
|
for (let n of e.childNodes) {
|
|
@@ -3900,7 +3904,7 @@ var Ga = (e) => {
|
|
|
3900
3904
|
(n.textContent ?? "").trim() && (t = !0);
|
|
3901
3905
|
}
|
|
3902
3906
|
return t;
|
|
3903
|
-
},
|
|
3907
|
+
}, bo = 2e3, xo = (e) => {
|
|
3904
3908
|
let t = [], n = e;
|
|
3905
3909
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
|
|
3906
3910
|
let e = ro(n);
|
|
@@ -3911,8 +3915,8 @@ var Ga = (e) => {
|
|
|
3911
3915
|
}), n = n.parentElement;
|
|
3912
3916
|
}
|
|
3913
3917
|
return t;
|
|
3914
|
-
},
|
|
3915
|
-
let t = ro(e), n = t ? io(t).length : 1, r = t ? ao(e, t) : 0, i = t &&
|
|
3918
|
+
}, So = (e) => {
|
|
3919
|
+
let t = ro(e), n = t ? io(t).length : 1, r = t ? ao(e, t) : 0, i = t && yo(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, bo) : void 0, a = Co(e);
|
|
3916
3920
|
return {
|
|
3917
3921
|
tag: e.tagName.toLowerCase(),
|
|
3918
3922
|
classes: typeof e.className == "string" ? e.className.trim() : "",
|
|
@@ -3922,11 +3926,11 @@ var Ga = (e) => {
|
|
|
3922
3926
|
source: t,
|
|
3923
3927
|
index: r,
|
|
3924
3928
|
occurrences: n,
|
|
3925
|
-
ancestors:
|
|
3929
|
+
ancestors: xo(e),
|
|
3926
3930
|
...i === void 0 ? {} : { fullText: i },
|
|
3927
3931
|
...a ? { sourceBinding: a } : {}
|
|
3928
3932
|
};
|
|
3929
|
-
},
|
|
3933
|
+
}, Co = (e) => {
|
|
3930
3934
|
let t = e.closest("[data-levo-source]");
|
|
3931
3935
|
if (!t) return;
|
|
3932
3936
|
let n = t.getAttribute("data-levo-source") ?? "", r = ro(t), i;
|
|
@@ -3943,7 +3947,7 @@ var Ga = (e) => {
|
|
|
3943
3947
|
},
|
|
3944
3948
|
...i === void 0 ? {} : { config: i }
|
|
3945
3949
|
};
|
|
3946
|
-
},
|
|
3950
|
+
}, wo = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
|
|
3947
3951
|
let t = e.getAttribute("data-levo-source") ?? "", n = ro(e), r;
|
|
3948
3952
|
try {
|
|
3949
3953
|
r = JSON.parse(t);
|
|
@@ -3960,12 +3964,12 @@ var Ga = (e) => {
|
|
|
3960
3964
|
label: po(e),
|
|
3961
3965
|
...r === void 0 ? {} : { config: r }
|
|
3962
3966
|
};
|
|
3963
|
-
}),
|
|
3967
|
+
}), To = 14, Eo = 2e3, Do = 100, Oo = 48, ko = new Set([
|
|
3964
3968
|
"script",
|
|
3965
3969
|
"style",
|
|
3966
3970
|
"template",
|
|
3967
3971
|
"noscript"
|
|
3968
|
-
]),
|
|
3972
|
+
]), Ao = (e, t) => t.includes(e) || e.id === "studio-staged" || ko.has(e.tagName.toLowerCase()), jo = (e) => {
|
|
3969
3973
|
let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
3970
3974
|
for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
3971
3975
|
let t = ro(e);
|
|
@@ -3977,11 +3981,11 @@ var Ga = (e) => {
|
|
|
3977
3981
|
for (let t of e.childNodes) {
|
|
3978
3982
|
if (t.nodeType !== 3) continue;
|
|
3979
3983
|
let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
3980
|
-
if (e) return e.length >
|
|
3984
|
+
if (e) return e.length > Oo ? `${e.slice(0, Oo).trimEnd()}…` : e;
|
|
3981
3985
|
}
|
|
3982
3986
|
}, o = (i, s) => {
|
|
3983
3987
|
n++;
|
|
3984
|
-
let c = ro(i), l = a(i), u = Array.from(i.children).filter((t) => !
|
|
3988
|
+
let c = ro(i), l = a(i), u = Array.from(i.children).filter((t) => !Ao(t, e)), d = {
|
|
3985
3989
|
tag: i.tagName.toLowerCase(),
|
|
3986
3990
|
...c ? {
|
|
3987
3991
|
source: c,
|
|
@@ -3992,9 +3996,9 @@ var Ga = (e) => {
|
|
|
3992
3996
|
childCount: u.length,
|
|
3993
3997
|
children: []
|
|
3994
3998
|
};
|
|
3995
|
-
if (s >=
|
|
3999
|
+
if (s >= To) return u.length && (t = !0), d;
|
|
3996
4000
|
for (let e of u) {
|
|
3997
|
-
if (d.children.length >=
|
|
4001
|
+
if (d.children.length >= Do || n >= Eo) {
|
|
3998
4002
|
t = !0;
|
|
3999
4003
|
break;
|
|
4000
4004
|
}
|
|
@@ -4006,7 +4010,7 @@ var Ga = (e) => {
|
|
|
4006
4010
|
tree: o(document.body, 0),
|
|
4007
4011
|
truncated: t
|
|
4008
4012
|
};
|
|
4009
|
-
},
|
|
4013
|
+
}, Mo = () => {
|
|
4010
4014
|
let e = null;
|
|
4011
4015
|
return {
|
|
4012
4016
|
send: (t) => {
|
|
@@ -4021,7 +4025,7 @@ var Ga = (e) => {
|
|
|
4021
4025
|
return !0;
|
|
4022
4026
|
}
|
|
4023
4027
|
};
|
|
4024
|
-
},
|
|
4028
|
+
}, No = (e) => {
|
|
4025
4029
|
let t = location.pathname, n = () => {
|
|
4026
4030
|
location.pathname !== t && (t = location.pathname, e.onPathChange());
|
|
4027
4031
|
}, r = !1;
|
|
@@ -4041,7 +4045,7 @@ var Ga = (e) => {
|
|
|
4041
4045
|
e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
|
|
4042
4046
|
}
|
|
4043
4047
|
} };
|
|
4044
|
-
},
|
|
4048
|
+
}, Po = (e) => {
|
|
4045
4049
|
let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
|
|
4046
4050
|
return { onMessage: (o) => {
|
|
4047
4051
|
let s = o.data;
|
|
@@ -4078,6 +4082,19 @@ var Ga = (e) => {
|
|
|
4078
4082
|
type: "staged-ack",
|
|
4079
4083
|
stageId: t
|
|
4080
4084
|
});
|
|
4085
|
+
} else if (s.type === "stage-image") {
|
|
4086
|
+
let t = String(s.stageId || ""), n = String(s.element?.source || ""), a = Number.isInteger(s.element?.index) ? s.element.index : 0;
|
|
4087
|
+
if (!t || /\s/.test(t) || !n || typeof s.value != "string" || !s.value) return;
|
|
4088
|
+
let o = {
|
|
4089
|
+
kind: "image",
|
|
4090
|
+
source: n,
|
|
4091
|
+
index: a,
|
|
4092
|
+
value: s.value
|
|
4093
|
+
};
|
|
4094
|
+
r.upsert(t, o), e.syncDomObserver(), i({
|
|
4095
|
+
type: "staged-ack",
|
|
4096
|
+
stageId: t
|
|
4097
|
+
});
|
|
4081
4098
|
} else if (s.type === "clear-staged") {
|
|
4082
4099
|
if (s.stageId == null) {
|
|
4083
4100
|
let e = r.ids();
|
|
@@ -4111,7 +4128,7 @@ var Ga = (e) => {
|
|
|
4111
4128
|
behavior: "smooth"
|
|
4112
4129
|
}), i({
|
|
4113
4130
|
type: "element-selected",
|
|
4114
|
-
element:
|
|
4131
|
+
element: So(r)
|
|
4115
4132
|
});
|
|
4116
4133
|
} else if (s.type === "edit-element") {
|
|
4117
4134
|
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? oo(t, n) : null;
|
|
@@ -4130,7 +4147,7 @@ var Ga = (e) => {
|
|
|
4130
4147
|
behavior: "smooth"
|
|
4131
4148
|
}), i({
|
|
4132
4149
|
type: "element-selected",
|
|
4133
|
-
element:
|
|
4150
|
+
element: So(r)
|
|
4134
4151
|
}), e.isTextEditing() || e.setTextEdit(!0);
|
|
4135
4152
|
let o = e.editableTarget(r);
|
|
4136
4153
|
o && e.startEditAtEnd(o);
|
|
@@ -4153,7 +4170,7 @@ var Ga = (e) => {
|
|
|
4153
4170
|
}
|
|
4154
4171
|
} else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
|
|
4155
4172
|
else if (s.type === "request-layers") {
|
|
4156
|
-
let { tree: t, truncated: n } =
|
|
4173
|
+
let { tree: t, truncated: n } = jo(e.ownNodes);
|
|
4157
4174
|
i({
|
|
4158
4175
|
type: "layers-tree",
|
|
4159
4176
|
tree: t,
|
|
@@ -4161,7 +4178,7 @@ var Ga = (e) => {
|
|
|
4161
4178
|
});
|
|
4162
4179
|
} else if (s.type === "request-sources") i({
|
|
4163
4180
|
type: "sources-list",
|
|
4164
|
-
sources:
|
|
4181
|
+
sources: wo()
|
|
4165
4182
|
});
|
|
4166
4183
|
else if (s.type === "clear-selection") e.clearSelection();
|
|
4167
4184
|
else if (s.type === "navigate") {
|
|
@@ -4170,7 +4187,7 @@ var Ga = (e) => {
|
|
|
4170
4187
|
}
|
|
4171
4188
|
}
|
|
4172
4189
|
} };
|
|
4173
|
-
},
|
|
4190
|
+
}, Fo = () => {
|
|
4174
4191
|
let e = /* @__PURE__ */ new Map(), t = () => {
|
|
4175
4192
|
if (e.size > 50) {
|
|
4176
4193
|
let t = e.keys().next().value;
|
|
@@ -4190,7 +4207,7 @@ var Ga = (e) => {
|
|
|
4190
4207
|
return e.delete(t), n;
|
|
4191
4208
|
}
|
|
4192
4209
|
};
|
|
4193
|
-
},
|
|
4210
|
+
}, Io = (e) => {
|
|
4194
4211
|
let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
|
|
4195
4212
|
let e = document.getElementById("studio-staged");
|
|
4196
4213
|
return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
|
|
@@ -4207,6 +4224,7 @@ var Ga = (e) => {
|
|
|
4207
4224
|
}, o = (e, r) => {
|
|
4208
4225
|
let i = oo(r.source, r.index);
|
|
4209
4226
|
if (i) if (r.kind === "style") so(i, e);
|
|
4227
|
+
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");
|
|
4210
4228
|
else {
|
|
4211
4229
|
if (i === n()) return;
|
|
4212
4230
|
let e = `${r.source}#${r.index}`;
|
|
@@ -4220,7 +4238,10 @@ var Ga = (e) => {
|
|
|
4220
4238
|
r.delete(e);
|
|
4221
4239
|
let i = oo(n.source, n.index);
|
|
4222
4240
|
if (n.kind === "style") i && co(i, e), a();
|
|
4223
|
-
else {
|
|
4241
|
+
else if (n.kind === "image") {
|
|
4242
|
+
let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
|
|
4243
|
+
i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
|
|
4244
|
+
} else {
|
|
4224
4245
|
let e = t.restore(`${n.source}#${n.index}`);
|
|
4225
4246
|
i && e != null && (i.textContent = e);
|
|
4226
4247
|
}
|
|
@@ -4245,7 +4266,7 @@ var Ga = (e) => {
|
|
|
4245
4266
|
for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
|
|
4246
4267
|
}
|
|
4247
4268
|
};
|
|
4248
|
-
},
|
|
4269
|
+
}, Lo = (e) => {
|
|
4249
4270
|
let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
|
|
4250
4271
|
try {
|
|
4251
4272
|
let e = document.createElement("div");
|
|
@@ -4305,11 +4326,11 @@ var Ga = (e) => {
|
|
|
4305
4326
|
};
|
|
4306
4327
|
//#endregion
|
|
4307
4328
|
//#region src/inspector/index.tsx
|
|
4308
|
-
function Lo() {
|
|
4309
|
-
return G(() => Ro(), []), null;
|
|
4310
|
-
}
|
|
4311
4329
|
function Ro() {
|
|
4312
|
-
|
|
4330
|
+
return G(() => zo(), []), null;
|
|
4331
|
+
}
|
|
4332
|
+
function zo() {
|
|
4333
|
+
let e = !1, t = null, n = null, r = !1, i = null, a = Fo(), o = Mo(), { overlay: s, label: c, ring: l, ringLabel: u } = ho();
|
|
4313
4334
|
document.body.append(s, c, l, u);
|
|
4314
4335
|
let d = [
|
|
4315
4336
|
s,
|
|
@@ -4321,7 +4342,7 @@ function Ro() {
|
|
|
4321
4342
|
}, m = (e) => !e || d.includes(e) || e === document.body || e === document.documentElement, h = (e) => {
|
|
4322
4343
|
if (!e || m(e)) return null;
|
|
4323
4344
|
let t = ro(e) ? e : e.closest("[data-tsd-source]");
|
|
4324
|
-
return !t || m(t) || !
|
|
4345
|
+
return !t || m(t) || !yo(t) ? null : t;
|
|
4325
4346
|
}, g = (e) => go(s, c, e), _ = () => {
|
|
4326
4347
|
if (n) {
|
|
4327
4348
|
if (!n.isConnected) {
|
|
@@ -4357,13 +4378,13 @@ function Ro() {
|
|
|
4357
4378
|
n = null, b.disconnect(), j(), v &&= (cancelAnimationFrame(v), 0), l.style.display = "none", u.style.display = "none";
|
|
4358
4379
|
}, D = (e) => g(e), O = () => {
|
|
4359
4380
|
s.style.display = "none", c.style.display = "none";
|
|
4360
|
-
}, k =
|
|
4381
|
+
}, k = Lo({
|
|
4361
4382
|
channel: o,
|
|
4362
4383
|
originals: a,
|
|
4363
4384
|
clearTextHover: () => {
|
|
4364
4385
|
i = null, O();
|
|
4365
4386
|
}
|
|
4366
|
-
}), A =
|
|
4387
|
+
}), A = Io({
|
|
4367
4388
|
originals: a,
|
|
4368
4389
|
editingNode: k.editingNode
|
|
4369
4390
|
}), j = () => {
|
|
@@ -4399,21 +4420,23 @@ function Ro() {
|
|
|
4399
4420
|
z = 0, e && t && g(t), r && !k.editingNode() && i?.isConnected && D(i), n && !r && _();
|
|
4400
4421
|
}, V = () => {
|
|
4401
4422
|
z ||= requestAnimationFrame(B);
|
|
4402
|
-
}, H = (
|
|
4423
|
+
}, H = (n) => {
|
|
4424
|
+
n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !k.editingNode() && (i = null, O(), document.documentElement.style.cursor = ""));
|
|
4425
|
+
}, U = (e) => {
|
|
4403
4426
|
let t = _o(e.target);
|
|
4404
4427
|
return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
|
|
4405
|
-
},
|
|
4428
|
+
}, W = (i) => {
|
|
4406
4429
|
if (r) {
|
|
4407
4430
|
let e = h(document.elementFromPoint(i.clientX, i.clientY) || i.target);
|
|
4408
4431
|
if (!e || e === k.editingNode()) {
|
|
4409
|
-
|
|
4432
|
+
U(i);
|
|
4410
4433
|
return;
|
|
4411
4434
|
}
|
|
4412
4435
|
i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), k.startEdit(e);
|
|
4413
4436
|
return;
|
|
4414
4437
|
}
|
|
4415
4438
|
if (!e) {
|
|
4416
|
-
|
|
4439
|
+
U(i);
|
|
4417
4440
|
return;
|
|
4418
4441
|
}
|
|
4419
4442
|
i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
|
|
@@ -4422,9 +4445,9 @@ function Ro() {
|
|
|
4422
4445
|
let s = a.closest("[data-tsd-source]") || a;
|
|
4423
4446
|
n = s, _(), T(), o.send({
|
|
4424
4447
|
type: "element-selected",
|
|
4425
|
-
element:
|
|
4448
|
+
element: So(s)
|
|
4426
4449
|
});
|
|
4427
|
-
},
|
|
4450
|
+
}, G = Po({
|
|
4428
4451
|
channel: o,
|
|
4429
4452
|
originals: a,
|
|
4430
4453
|
staged: A,
|
|
@@ -4444,7 +4467,7 @@ function Ro() {
|
|
|
4444
4467
|
startEditAtEnd: (e) => k.startEdit(e, !0),
|
|
4445
4468
|
editableTarget: h,
|
|
4446
4469
|
ownNodes: d
|
|
4447
|
-
}),
|
|
4470
|
+
}), K = [
|
|
4448
4471
|
"mousedown",
|
|
4449
4472
|
"mouseup",
|
|
4450
4473
|
"dblclick",
|
|
@@ -4462,39 +4485,46 @@ function Ro() {
|
|
|
4462
4485
|
"touchstart",
|
|
4463
4486
|
"touchend",
|
|
4464
4487
|
"submit"
|
|
4465
|
-
],
|
|
4488
|
+
], ee = (t) => {
|
|
4466
4489
|
e && (t.cancelable && t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation());
|
|
4467
|
-
}, ee = () => {
|
|
4468
|
-
n && !r && _();
|
|
4469
4490
|
}, q = () => {
|
|
4491
|
+
n && !r && _();
|
|
4492
|
+
}, J = () => {
|
|
4470
4493
|
let e = location.pathname.replace(/\/$/, "") || "/";
|
|
4471
4494
|
o.send({
|
|
4472
4495
|
type: "route",
|
|
4473
4496
|
route: e
|
|
4474
4497
|
});
|
|
4475
|
-
},
|
|
4476
|
-
E(),
|
|
4477
|
-
} }),
|
|
4478
|
-
|
|
4498
|
+
}, Y = No({ onPathChange: () => {
|
|
4499
|
+
E(), J();
|
|
4500
|
+
} }), X = (t) => {
|
|
4501
|
+
if (k.editingNode()) return;
|
|
4502
|
+
if (t.key === "Escape") {
|
|
4503
|
+
r ? N(!1) : e && M(!1);
|
|
4504
|
+
return;
|
|
4505
|
+
}
|
|
4506
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || vo(document.activeElement)) return;
|
|
4507
|
+
let n = t.key.toLowerCase();
|
|
4508
|
+
n === "s" ? (t.preventDefault(), M(!e)) : n === "t" && (t.preventDefault(), N(!r));
|
|
4479
4509
|
};
|
|
4480
|
-
window.addEventListener("mousemove", R, !0), window.addEventListener("scroll", V, !0), window.addEventListener("resize",
|
|
4481
|
-
for (let e of
|
|
4482
|
-
return
|
|
4483
|
-
window.removeEventListener("mousemove", R, !0), window.removeEventListener("keydown",
|
|
4484
|
-
for (let e of
|
|
4485
|
-
b.disconnect(), x.disconnect(), v && cancelAnimationFrame(v), P && cancelAnimationFrame(P), z && cancelAnimationFrame(z), A.teardown(),
|
|
4510
|
+
window.addEventListener("mousemove", R, !0), window.addEventListener("scroll", V, !0), window.addEventListener("resize", q), window.addEventListener("click", W, !0), window.addEventListener("keydown", X, !0), window.addEventListener("message", G.onMessage), window.addEventListener("mouseout", H, !0);
|
|
4511
|
+
for (let e of K) window.addEventListener(e, ee, !0);
|
|
4512
|
+
return J(), o.send({ type: "ready" }), () => {
|
|
4513
|
+
window.removeEventListener("mousemove", R, !0), window.removeEventListener("keydown", X, !0), window.removeEventListener("scroll", V, !0), window.removeEventListener("resize", q), window.removeEventListener("mouseout", H, !0), window.removeEventListener("click", W, !0), window.removeEventListener("message", G.onMessage);
|
|
4514
|
+
for (let e of K) window.removeEventListener(e, ee, !0);
|
|
4515
|
+
b.disconnect(), x.disconnect(), v && cancelAnimationFrame(v), P && cancelAnimationFrame(P), z && cancelAnimationFrame(z), A.teardown(), Y.teardown(), k.teardown(), document.documentElement.style.cursor = "", f?.remove(), s.remove(), c.remove(), l.remove(), u.remove();
|
|
4486
4516
|
};
|
|
4487
4517
|
}
|
|
4488
4518
|
//#endregion
|
|
4489
4519
|
//#region src/pageHead.tsx
|
|
4490
|
-
var
|
|
4520
|
+
var Bo = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Vo = (e) => {
|
|
4491
4521
|
let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
|
|
4492
4522
|
for (let r = n.exec(e); r; r = n.exec(e)) {
|
|
4493
4523
|
let e = r[1];
|
|
4494
4524
|
!e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
|
|
4495
4525
|
}
|
|
4496
4526
|
return t;
|
|
4497
|
-
},
|
|
4527
|
+
}, Ho = (e) => {
|
|
4498
4528
|
let t = {
|
|
4499
4529
|
meta: [],
|
|
4500
4530
|
links: [],
|
|
@@ -4502,11 +4532,11 @@ var zo = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Bo = (e) => {
|
|
|
4502
4532
|
};
|
|
4503
4533
|
if (!e?.trim()) return t;
|
|
4504
4534
|
let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
|
|
4505
|
-
let i =
|
|
4535
|
+
let i = Vo(n), a = r.trim();
|
|
4506
4536
|
return a && (i.children = a), t.scripts.push(i), "";
|
|
4507
4537
|
});
|
|
4508
|
-
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(
|
|
4509
|
-
},
|
|
4538
|
+
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(Vo(r)), "")), t;
|
|
4539
|
+
}, Uo = (e = {}, t = {}) => {
|
|
4510
4540
|
let n = {
|
|
4511
4541
|
meta: [],
|
|
4512
4542
|
links: [],
|
|
@@ -4568,17 +4598,17 @@ var zo = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Bo = (e) => {
|
|
|
4568
4598
|
let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
|
|
4569
4599
|
for (let e of y) n.scripts.push({
|
|
4570
4600
|
type: "application/ld+json",
|
|
4571
|
-
children:
|
|
4601
|
+
children: Bo(e)
|
|
4572
4602
|
});
|
|
4573
4603
|
for (let r of [t.customHead, e.customHead]) {
|
|
4574
4604
|
if (!r) continue;
|
|
4575
|
-
let e =
|
|
4605
|
+
let e = Ho(r);
|
|
4576
4606
|
n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
|
|
4577
4607
|
}
|
|
4578
4608
|
return n;
|
|
4579
4609
|
};
|
|
4580
|
-
function
|
|
4581
|
-
let n =
|
|
4610
|
+
function Wo({ meta: e, site: t }) {
|
|
4611
|
+
let n = Uo(e, t);
|
|
4582
4612
|
return /* @__PURE__ */ X(J, { children: [
|
|
4583
4613
|
n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ Y("meta", { ...e }, `m${t}`) : /* @__PURE__ */ Y("title", { children: e.title }, `t${t}`)),
|
|
4584
4614
|
n.links.map((e, t) => /* @__PURE__ */ Y("link", { ...e }, `l${t}`)),
|
|
@@ -4590,17 +4620,17 @@ function Uo({ meta: e, site: t }) {
|
|
|
4590
4620
|
}
|
|
4591
4621
|
//#endregion
|
|
4592
4622
|
//#region src/registration/ui.tsx
|
|
4593
|
-
var
|
|
4623
|
+
var Go = (...e) => e.filter(Boolean).join(" "), Ko = z.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ Y("button", {
|
|
4594
4624
|
ref: o,
|
|
4595
4625
|
type: i,
|
|
4596
|
-
className:
|
|
4626
|
+
className: Go("inline-flex items-center justify-center", e),
|
|
4597
4627
|
...a,
|
|
4598
|
-
children: t ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Le, { className:
|
|
4628
|
+
children: t ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Le, { className: Go("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
|
|
4599
4629
|
}));
|
|
4600
|
-
|
|
4630
|
+
Ko.displayName = "Btn";
|
|
4601
4631
|
//#endregion
|
|
4602
4632
|
//#region src/registration/AttendeeForm.tsx
|
|
4603
|
-
var
|
|
4633
|
+
var qo = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o }) => /* @__PURE__ */ X("form", {
|
|
4604
4634
|
onSubmit: r,
|
|
4605
4635
|
className: "flex flex-col gap-4",
|
|
4606
4636
|
children: [
|
|
@@ -4750,13 +4780,13 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
4750
4780
|
] }),
|
|
4751
4781
|
/* @__PURE__ */ X("div", {
|
|
4752
4782
|
className: "flex flex-col-reverse justify-end gap-4 md:flex-row",
|
|
4753
|
-
children: [/* @__PURE__ */ Y(
|
|
4783
|
+
children: [/* @__PURE__ */ Y(Ko, {
|
|
4754
4784
|
className: "rounded-lg bg-gray-100 px-6 py-2 font-semibold text-black hover:bg-gray-200",
|
|
4755
4785
|
type: "button",
|
|
4756
4786
|
onClick: a,
|
|
4757
4787
|
disabled: i,
|
|
4758
4788
|
children: "Back"
|
|
4759
|
-
}), /* @__PURE__ */ Y(
|
|
4789
|
+
}), /* @__PURE__ */ Y(Ko, {
|
|
4760
4790
|
className: "rounded-lg bg-brand px-6 py-2 font-semibold text-brand-foreground hover:opacity-90",
|
|
4761
4791
|
type: "submit",
|
|
4762
4792
|
isLoading: i,
|
|
@@ -4765,22 +4795,22 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
4765
4795
|
})]
|
|
4766
4796
|
})
|
|
4767
4797
|
]
|
|
4768
|
-
}),
|
|
4798
|
+
}), Jo = {
|
|
4769
4799
|
USD: "$",
|
|
4770
4800
|
EUR: "€",
|
|
4771
4801
|
GBP: "£",
|
|
4772
4802
|
INR: "₹"
|
|
4773
|
-
},
|
|
4803
|
+
}, Yo = (e) => e?.unit_amount ? `${Jo[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", Xo = (e) => {
|
|
4774
4804
|
if (!e) return null;
|
|
4775
4805
|
let t = e.tax_enabled ?? !1, n = e.tax_inclusive ?? !1, r = e.taxes ?? [];
|
|
4776
4806
|
return !t || r.length === 0 ? null : n ? "(inclusive of taxes)" : "+ taxes";
|
|
4777
|
-
},
|
|
4807
|
+
}, Zo = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), Qo = (e) => {
|
|
4778
4808
|
if (!e) return !1;
|
|
4779
4809
|
let t = e;
|
|
4780
4810
|
return t.tax_enabled === !0 && t.taxes !== void 0 && t.taxes.length > 0 && t.subtotal !== void 0;
|
|
4781
|
-
},
|
|
4811
|
+
}, $o = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), es = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
|
|
4782
4812
|
let c = [...a].sort((e, t) => {
|
|
4783
|
-
let n =
|
|
4813
|
+
let n = $o(e, s?._id), r = $o(t, s?._id);
|
|
4784
4814
|
return n && !r ? -1 : !n && r ? 1 : 0;
|
|
4785
4815
|
});
|
|
4786
4816
|
return /* @__PURE__ */ X("div", { children: [
|
|
@@ -4815,7 +4845,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
4815
4845
|
className: "mt-1 text-red-400 text-xs",
|
|
4816
4846
|
children: n
|
|
4817
4847
|
})]
|
|
4818
|
-
}), /* @__PURE__ */ Y(
|
|
4848
|
+
}), /* @__PURE__ */ Y(Ko, {
|
|
4819
4849
|
"aria-label": "Apply Coupon",
|
|
4820
4850
|
onClick: () => i(),
|
|
4821
4851
|
className: "rounded-lg bg-brand px-3 text-brand-foreground hover:opacity-90",
|
|
@@ -4829,12 +4859,12 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
4829
4859
|
}),
|
|
4830
4860
|
c.length > 0 && /* @__PURE__ */ X("div", {
|
|
4831
4861
|
className: "mt-4 flex flex-col gap-4",
|
|
4832
|
-
children: [c.filter((e) =>
|
|
4862
|
+
children: [c.filter((e) => $o(e, s?._id)).length > 0 && /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("p", {
|
|
4833
4863
|
className: "mb-2 text-gray-600 text-sm",
|
|
4834
4864
|
children: "Available Coupons"
|
|
4835
4865
|
}), /* @__PURE__ */ Y("div", {
|
|
4836
4866
|
className: "flex flex-col gap-2",
|
|
4837
|
-
children: c.filter((e) =>
|
|
4867
|
+
children: c.filter((e) => $o(e, s?._id)).map((e) => /* @__PURE__ */ X("button", {
|
|
4838
4868
|
type: "button",
|
|
4839
4869
|
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",
|
|
4840
4870
|
onClick: () => {
|
|
@@ -4847,19 +4877,19 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
4847
4877
|
children: e.code
|
|
4848
4878
|
}), /* @__PURE__ */ Y("span", {
|
|
4849
4879
|
className: "text-gray-500 text-sm",
|
|
4850
|
-
children: e.kind === "percent" ? `${e.percent_off}% off` : `${
|
|
4880
|
+
children: e.kind === "percent" ? `${e.percent_off}% off` : `${Jo[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
|
|
4851
4881
|
})]
|
|
4852
4882
|
}), e.description && /* @__PURE__ */ Y("span", {
|
|
4853
4883
|
className: "text-gray-500 text-xs",
|
|
4854
4884
|
children: e.description
|
|
4855
4885
|
})]
|
|
4856
4886
|
}, e._id))
|
|
4857
|
-
})] }), c.filter((e) =>
|
|
4887
|
+
})] }), c.filter((e) => !$o(e, s?._id)).length > 0 && /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("p", {
|
|
4858
4888
|
className: "mb-2 text-gray-400 text-sm",
|
|
4859
4889
|
children: "Not Applicable"
|
|
4860
4890
|
}), /* @__PURE__ */ Y("div", {
|
|
4861
4891
|
className: "flex flex-col gap-2",
|
|
4862
|
-
children: c.filter((e) =>
|
|
4892
|
+
children: c.filter((e) => !$o(e, s?._id)).map((e) => /* @__PURE__ */ X("button", {
|
|
4863
4893
|
type: "button",
|
|
4864
4894
|
disabled: !0,
|
|
4865
4895
|
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",
|
|
@@ -4870,7 +4900,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
4870
4900
|
children: e.code
|
|
4871
4901
|
}), /* @__PURE__ */ Y("span", {
|
|
4872
4902
|
className: "text-gray-500 text-sm",
|
|
4873
|
-
children: e.kind === "percent" ? `${e.percent_off}% off` : `${
|
|
4903
|
+
children: e.kind === "percent" ? `${e.percent_off}% off` : `${Jo[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
|
|
4874
4904
|
})]
|
|
4875
4905
|
}), e.description && /* @__PURE__ */ Y("span", {
|
|
4876
4906
|
className: "text-gray-500 text-xs",
|
|
@@ -4880,7 +4910,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
4880
4910
|
})] })]
|
|
4881
4911
|
})
|
|
4882
4912
|
] });
|
|
4883
|
-
},
|
|
4913
|
+
}, ts = (e) => {
|
|
4884
4914
|
let t = new Date(e);
|
|
4885
4915
|
return `${new Intl.DateTimeFormat("en-GB", {
|
|
4886
4916
|
day: "numeric",
|
|
@@ -4891,7 +4921,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
4891
4921
|
minute: "2-digit",
|
|
4892
4922
|
hour12: !0
|
|
4893
4923
|
}).format(t)}`;
|
|
4894
|
-
},
|
|
4924
|
+
}, ns = ({ ticketData: e, paymentData: t, type: n }) => {
|
|
4895
4925
|
let [r, i] = q(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
|
|
4896
4926
|
style: "currency",
|
|
4897
4927
|
currency: t.currency || "INR",
|
|
@@ -5039,7 +5069,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5039
5069
|
]
|
|
5040
5070
|
}), /* @__PURE__ */ Y("p", {
|
|
5041
5071
|
className: "mt-3 text-center text-gray-400 text-xs",
|
|
5042
|
-
children:
|
|
5072
|
+
children: ts(t.created_at)
|
|
5043
5073
|
})]
|
|
5044
5074
|
}),
|
|
5045
5075
|
/* @__PURE__ */ X("div", {
|
|
@@ -5079,7 +5109,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5079
5109
|
]
|
|
5080
5110
|
})] })
|
|
5081
5111
|
});
|
|
5082
|
-
},
|
|
5112
|
+
}, rs = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ Y(De.Root, {
|
|
5083
5113
|
open: e,
|
|
5084
5114
|
onOpenChange: (e) => {
|
|
5085
5115
|
e || t();
|
|
@@ -5101,14 +5131,14 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5101
5131
|
})
|
|
5102
5132
|
})]
|
|
5103
5133
|
})] })
|
|
5104
|
-
}),
|
|
5105
|
-
let l =
|
|
5134
|
+
}), is = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
|
|
5135
|
+
let l = Qo(t), u = Zo(r);
|
|
5106
5136
|
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ X("div", {
|
|
5107
5137
|
className: "flex max-h-[64dvh] w-full flex-col justify-between gap-6 overflow-y-auto md:max-h-[unset] md:flex-row",
|
|
5108
5138
|
children: [/* @__PURE__ */ Y("div", {
|
|
5109
5139
|
className: "flex w-full flex-col gap-3 md:w-[55%]",
|
|
5110
5140
|
children: e.map((e) => /* @__PURE__ */ Y("div", {
|
|
5111
|
-
className:
|
|
5141
|
+
className: Go("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" : ""),
|
|
5112
5142
|
onClick: () => n(e),
|
|
5113
5143
|
children: /* @__PURE__ */ X("div", { children: [
|
|
5114
5144
|
/* @__PURE__ */ Y("p", {
|
|
@@ -5121,9 +5151,9 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5121
5151
|
}),
|
|
5122
5152
|
/* @__PURE__ */ X("p", {
|
|
5123
5153
|
className: "text-md",
|
|
5124
|
-
children: [
|
|
5154
|
+
children: [Yo(e), Xo(e) && /* @__PURE__ */ X("span", {
|
|
5125
5155
|
className: "text-gray-500 text-sm",
|
|
5126
|
-
children: [" ",
|
|
5156
|
+
children: [" ", Xo(e)]
|
|
5127
5157
|
})]
|
|
5128
5158
|
})
|
|
5129
5159
|
] })
|
|
@@ -5142,7 +5172,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5142
5172
|
children: [/* @__PURE__ */ Y("span", {
|
|
5143
5173
|
className: "text-md",
|
|
5144
5174
|
children: t.title
|
|
5145
|
-
}), /* @__PURE__ */ Y("span", { children:
|
|
5175
|
+
}), /* @__PURE__ */ Y("span", { children: Yo({
|
|
5146
5176
|
unit_amount: l ? t.subtotal : t.unit_amount,
|
|
5147
5177
|
currency: t.currency
|
|
5148
5178
|
}) })]
|
|
@@ -5157,7 +5187,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5157
5187
|
children: "Subtotal"
|
|
5158
5188
|
}), /* @__PURE__ */ Y("span", {
|
|
5159
5189
|
className: "text-md",
|
|
5160
|
-
children:
|
|
5190
|
+
children: Yo({
|
|
5161
5191
|
unit_amount: r.base_amount,
|
|
5162
5192
|
currency: t?.currency
|
|
5163
5193
|
})
|
|
@@ -5173,7 +5203,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5173
5203
|
children: [
|
|
5174
5204
|
"-",
|
|
5175
5205
|
" ",
|
|
5176
|
-
|
|
5206
|
+
Yo({
|
|
5177
5207
|
unit_amount: r.discount,
|
|
5178
5208
|
currency: t?.currency
|
|
5179
5209
|
})
|
|
@@ -5187,7 +5217,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5187
5217
|
children: "Taxable Amount"
|
|
5188
5218
|
}), /* @__PURE__ */ Y("span", {
|
|
5189
5219
|
className: "text-md",
|
|
5190
|
-
children:
|
|
5220
|
+
children: Yo({
|
|
5191
5221
|
unit_amount: r.taxable_amount,
|
|
5192
5222
|
currency: t?.currency
|
|
5193
5223
|
})
|
|
@@ -5205,7 +5235,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5205
5235
|
]
|
|
5206
5236
|
}), /* @__PURE__ */ Y("span", {
|
|
5207
5237
|
className: "text-sm",
|
|
5208
|
-
children:
|
|
5238
|
+
children: Yo({
|
|
5209
5239
|
unit_amount: e.amount,
|
|
5210
5240
|
currency: t?.currency
|
|
5211
5241
|
})
|
|
@@ -5218,7 +5248,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5218
5248
|
children: "Payable"
|
|
5219
5249
|
}), /* @__PURE__ */ Y("span", {
|
|
5220
5250
|
className: "text-md",
|
|
5221
|
-
children:
|
|
5251
|
+
children: Yo({
|
|
5222
5252
|
unit_amount: r.total_amount,
|
|
5223
5253
|
currency: t?.currency
|
|
5224
5254
|
})
|
|
@@ -5235,7 +5265,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5235
5265
|
children: "Subtotal"
|
|
5236
5266
|
}), /* @__PURE__ */ Y("span", {
|
|
5237
5267
|
className: "text-md",
|
|
5238
|
-
children:
|
|
5268
|
+
children: Yo({
|
|
5239
5269
|
unit_amount: r.base_amount,
|
|
5240
5270
|
currency: t?.currency
|
|
5241
5271
|
})
|
|
@@ -5251,7 +5281,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5251
5281
|
children: [
|
|
5252
5282
|
"-",
|
|
5253
5283
|
" ",
|
|
5254
|
-
|
|
5284
|
+
Yo({
|
|
5255
5285
|
unit_amount: r.discount,
|
|
5256
5286
|
currency: t?.currency
|
|
5257
5287
|
})
|
|
@@ -5265,7 +5295,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5265
5295
|
children: "Payable"
|
|
5266
5296
|
}), /* @__PURE__ */ Y("span", {
|
|
5267
5297
|
className: "text-md",
|
|
5268
|
-
children:
|
|
5298
|
+
children: Yo({
|
|
5269
5299
|
unit_amount: r.sale_amount,
|
|
5270
5300
|
currency: t?.currency
|
|
5271
5301
|
})
|
|
@@ -5282,7 +5312,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5282
5312
|
children: "Subtotal"
|
|
5283
5313
|
}), /* @__PURE__ */ Y("span", {
|
|
5284
5314
|
className: "text-md",
|
|
5285
|
-
children:
|
|
5315
|
+
children: Yo({
|
|
5286
5316
|
unit_amount: t.subtotal,
|
|
5287
5317
|
currency: t?.currency
|
|
5288
5318
|
})
|
|
@@ -5300,7 +5330,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5300
5330
|
]
|
|
5301
5331
|
}), /* @__PURE__ */ Y("span", {
|
|
5302
5332
|
className: "text-sm",
|
|
5303
|
-
children:
|
|
5333
|
+
children: Yo({
|
|
5304
5334
|
unit_amount: e.amount,
|
|
5305
5335
|
currency: t?.currency
|
|
5306
5336
|
})
|
|
@@ -5313,7 +5343,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5313
5343
|
children: "Payable"
|
|
5314
5344
|
}), /* @__PURE__ */ Y("span", {
|
|
5315
5345
|
className: "text-md",
|
|
5316
|
-
children:
|
|
5346
|
+
children: Yo({
|
|
5317
5347
|
unit_amount: t.total,
|
|
5318
5348
|
currency: t?.currency
|
|
5319
5349
|
})
|
|
@@ -5333,7 +5363,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5333
5363
|
children: "Payable"
|
|
5334
5364
|
}), /* @__PURE__ */ Y("span", {
|
|
5335
5365
|
className: "text-md",
|
|
5336
|
-
children:
|
|
5366
|
+
children: Yo(t)
|
|
5337
5367
|
})]
|
|
5338
5368
|
})
|
|
5339
5369
|
})]
|
|
@@ -5372,7 +5402,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5372
5402
|
" ",
|
|
5373
5403
|
/* @__PURE__ */ Y("span", {
|
|
5374
5404
|
className: "font-semibold",
|
|
5375
|
-
children:
|
|
5405
|
+
children: Yo({
|
|
5376
5406
|
unit_amount: r.discount,
|
|
5377
5407
|
currency: t?.currency
|
|
5378
5408
|
})
|
|
@@ -5381,7 +5411,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5381
5411
|
})]
|
|
5382
5412
|
})
|
|
5383
5413
|
}) : /* @__PURE__ */ X("div", {
|
|
5384
|
-
className:
|
|
5414
|
+
className: Go("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"),
|
|
5385
5415
|
onClick: () => t ? o() : null,
|
|
5386
5416
|
children: [/* @__PURE__ */ X("span", {
|
|
5387
5417
|
className: "flex items-center gap-2",
|
|
@@ -5394,13 +5424,13 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5394
5424
|
})]
|
|
5395
5425
|
}), /* @__PURE__ */ Y("div", {
|
|
5396
5426
|
className: "mt-3 flex justify-start",
|
|
5397
|
-
children: /* @__PURE__ */ Y(
|
|
5427
|
+
children: /* @__PURE__ */ Y(Ko, {
|
|
5398
5428
|
onClick: c,
|
|
5399
5429
|
className: "rounded-lg bg-brand px-6 py-2 font-semibold text-brand-foreground hover:opacity-90",
|
|
5400
5430
|
children: "Continue for Payment"
|
|
5401
5431
|
})
|
|
5402
5432
|
})] });
|
|
5403
|
-
},
|
|
5433
|
+
}, as = () => {
|
|
5404
5434
|
let [e, t] = q(null), [n, r] = q(null), [i, a] = q(!1), [o, s] = q(null);
|
|
5405
5435
|
return {
|
|
5406
5436
|
stripePromise: e,
|
|
@@ -5424,7 +5454,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5424
5454
|
s(() => e);
|
|
5425
5455
|
}, [])
|
|
5426
5456
|
};
|
|
5427
|
-
},
|
|
5457
|
+
}, os = {
|
|
5428
5458
|
name: "",
|
|
5429
5459
|
email: "",
|
|
5430
5460
|
is_business_purchase: !1,
|
|
@@ -5440,22 +5470,22 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5440
5470
|
country: ""
|
|
5441
5471
|
}
|
|
5442
5472
|
}
|
|
5443
|
-
},
|
|
5473
|
+
}, ss = (e, t, n) => {
|
|
5444
5474
|
let r = t.split("."), i = structuredClone(e), a = i, o = r.length - 1;
|
|
5445
5475
|
return r.forEach((e, t) => {
|
|
5446
5476
|
t === o ? a[e] = n : a = a[e];
|
|
5447
5477
|
}), i;
|
|
5448
|
-
},
|
|
5478
|
+
}, cs = async (e, t) => {
|
|
5449
5479
|
try {
|
|
5450
5480
|
let n = new URLSearchParams();
|
|
5451
5481
|
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;
|
|
5452
5482
|
} catch (t) {
|
|
5453
5483
|
e.logger?.error("Failed to fetch event tickets", { exception: P(t) });
|
|
5454
5484
|
}
|
|
5455
|
-
},
|
|
5456
|
-
let i = Ke(), [a, o] = q([]), [s, c] = q(!0), [l, u] = q(!1), [d, f] = q(!1), [p, m] = q(null), [h, g] = q(void 0), [_, v] = q(""), [y, b] = q(null), [x, S] = q(!1), [C, w] = q(null), [T, E] = q(!1), [D, O] = q(1), [k, A] = q(null), [j, M] = q([]), [N, F] = q(
|
|
5485
|
+
}, ls = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now" }) => {
|
|
5486
|
+
let i = Ke(), [a, o] = q([]), [s, c] = q(!0), [l, u] = q(!1), [d, f] = q(!1), [p, m] = q(null), [h, g] = q(void 0), [_, v] = q(""), [y, b] = q(null), [x, S] = q(!1), [C, w] = q(null), [T, E] = q(!1), [D, O] = q(1), [k, A] = q(null), [j, M] = q([]), [N, F] = q(os), I = ee(null), L = () => F(os), R = () => {
|
|
5457
5487
|
b(null), g(void 0), w(null), S(!1), v(""), A(null), u(!1), O(1), L();
|
|
5458
|
-
}, { Razorpay: z } = Ve(), { stripePromise: B, config: V, isOpen: H, openStripeCheckout: U, closeStripeCheckout: K, setOnComplete: te } =
|
|
5488
|
+
}, { Razorpay: z } = Ve(), { stripePromise: B, config: V, isOpen: H, openStripeCheckout: U, closeStripeCheckout: K, setOnComplete: te } = as(), ne = () => {
|
|
5459
5489
|
let e = I.current;
|
|
5460
5490
|
!e || !i || i.fetch?.url(`/v1/event/booking/${e.bookingId}/confirm-booking`)?.post({ session_id: e.sessionId })?.json().then((e) => {
|
|
5461
5491
|
e?.content?.data && g(e?.content?.data), K(), I.current = null;
|
|
@@ -5571,7 +5601,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5571
5601
|
w(null), S(!1), v(""), E(!1);
|
|
5572
5602
|
}, $ = (e) => {
|
|
5573
5603
|
let { name: t, value: n, type: r, checked: i } = e.target;
|
|
5574
|
-
F((e) =>
|
|
5604
|
+
F((e) => ss(e, t, r === "checkbox" ? i : n));
|
|
5575
5605
|
}, ce = () => {}, le = (e) => {
|
|
5576
5606
|
e?.preventDefault(), re();
|
|
5577
5607
|
};
|
|
@@ -5580,7 +5610,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5580
5610
|
c(!1);
|
|
5581
5611
|
return;
|
|
5582
5612
|
}
|
|
5583
|
-
e && i && (c(!0),
|
|
5613
|
+
e && i && (c(!0), cs(i, e).then((e) => {
|
|
5584
5614
|
o(e ?? []), e && e.length > 0 && m(e[0] || null), c(!1);
|
|
5585
5615
|
}));
|
|
5586
5616
|
}, [
|
|
@@ -5597,7 +5627,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5597
5627
|
ie
|
|
5598
5628
|
]), n) return /* @__PURE__ */ Y("div", {
|
|
5599
5629
|
className: "my-2",
|
|
5600
|
-
children: /* @__PURE__ */ Y(
|
|
5630
|
+
children: /* @__PURE__ */ Y(Ko, {
|
|
5601
5631
|
className: "rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground hover:opacity-90",
|
|
5602
5632
|
onClick: () => window.open(n, "_blank", "noopener,noreferrer"),
|
|
5603
5633
|
children: r
|
|
@@ -5605,7 +5635,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5605
5635
|
});
|
|
5606
5636
|
if (s) return /* @__PURE__ */ Y("div", {
|
|
5607
5637
|
className: "my-2",
|
|
5608
|
-
children: /* @__PURE__ */ Y(
|
|
5638
|
+
children: /* @__PURE__ */ Y(Ko, {
|
|
5609
5639
|
className: "rounded-lg bg-brand px-4 py-2 font-bold text-brand-foreground",
|
|
5610
5640
|
children: "Loading..."
|
|
5611
5641
|
})
|
|
@@ -5614,7 +5644,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5614
5644
|
return /* @__PURE__ */ X(J, { children: [
|
|
5615
5645
|
/* @__PURE__ */ Y("div", {
|
|
5616
5646
|
className: "my-2",
|
|
5617
|
-
children: a?.length ? /* @__PURE__ */ Y(
|
|
5647
|
+
children: a?.length ? /* @__PURE__ */ Y(Ko, {
|
|
5618
5648
|
onClick: () => u(!0),
|
|
5619
5649
|
className: "rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground hover:opacity-90",
|
|
5620
5650
|
children: r
|
|
@@ -5629,7 +5659,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5629
5659
|
e || R();
|
|
5630
5660
|
},
|
|
5631
5661
|
children: /* @__PURE__ */ X(De.Portal, { children: [/* @__PURE__ */ Y(De.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ X(De.Popup, {
|
|
5632
|
-
className:
|
|
5662
|
+
className: Go("fixed top-24 left-1/2 z-[100] flex max-h-[calc(100vh-7rem)] w-[90%] -translate-x-1/2 flex-col overflow-y-auto rounded-lg bg-white p-4", T ? "md:w-[30%]" : "md:w-[40%]"),
|
|
5633
5663
|
children: [/* @__PURE__ */ X("div", {
|
|
5634
5664
|
className: `mb-4 flex w-full items-start justify-between ${T ? "" : "pb-[6px]"} `,
|
|
5635
5665
|
children: [/* @__PURE__ */ X(De.Title, {
|
|
@@ -5646,7 +5676,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5646
5676
|
}), /* @__PURE__ */ X("div", { children: [k && /* @__PURE__ */ Y("div", {
|
|
5647
5677
|
className: "mb-4 rounded-md bg-red-50 p-3 text-red-600 text-sm",
|
|
5648
5678
|
children: k
|
|
5649
|
-
}), D === 1 ? /* @__PURE__ */ Y("div", { children: T ? /* @__PURE__ */ Y(
|
|
5679
|
+
}), D === 1 ? /* @__PURE__ */ Y("div", { children: T ? /* @__PURE__ */ Y(es, {
|
|
5650
5680
|
couponCode: _,
|
|
5651
5681
|
onCouponCodeChange: v,
|
|
5652
5682
|
couponError: C,
|
|
@@ -5655,7 +5685,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5655
5685
|
publicCoupons: j,
|
|
5656
5686
|
onBack: Q,
|
|
5657
5687
|
selectedTicket: p
|
|
5658
|
-
}) : /* @__PURE__ */ Y(
|
|
5688
|
+
}) : /* @__PURE__ */ Y(is, {
|
|
5659
5689
|
tickets: a,
|
|
5660
5690
|
selectedTicket: p,
|
|
5661
5691
|
onSelectTicket: oe,
|
|
@@ -5665,7 +5695,7 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5665
5695
|
onApplyCouponClick: () => E(!0),
|
|
5666
5696
|
onRemoveCoupon: se,
|
|
5667
5697
|
onNext: () => O(2)
|
|
5668
|
-
}) }) : /* @__PURE__ */ Y(
|
|
5698
|
+
}) }) : /* @__PURE__ */ Y(qo, {
|
|
5669
5699
|
values: N,
|
|
5670
5700
|
handleChange: $,
|
|
5671
5701
|
handleBlur: ce,
|
|
@@ -5676,12 +5706,12 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5676
5706
|
})] })]
|
|
5677
5707
|
})] })
|
|
5678
5708
|
}),
|
|
5679
|
-
h && /* @__PURE__ */ Y(
|
|
5709
|
+
h && /* @__PURE__ */ Y(ns, {
|
|
5680
5710
|
paymentData: h,
|
|
5681
5711
|
ticketData: a,
|
|
5682
5712
|
type: "confirm"
|
|
5683
5713
|
}),
|
|
5684
|
-
H && V && /* @__PURE__ */ Y(
|
|
5714
|
+
H && V && /* @__PURE__ */ Y(rs, {
|
|
5685
5715
|
isOpen: H,
|
|
5686
5716
|
onClose: K,
|
|
5687
5717
|
stripePromise: B,
|
|
@@ -5689,13 +5719,13 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5689
5719
|
onComplete: ne
|
|
5690
5720
|
})
|
|
5691
5721
|
] });
|
|
5692
|
-
},
|
|
5722
|
+
}, us = (e) => typeof e == "string" && e.trim() ? e : void 0, ds = (e) => ({
|
|
5693
5723
|
apiUrl: e.levo?.api_url || "",
|
|
5694
5724
|
workspace: e.workspace_id || "",
|
|
5695
5725
|
siteId: e.id || "",
|
|
5696
5726
|
insightsUrl: e.levo?.insights_url || null,
|
|
5697
5727
|
appMode: e.levo?.app_mode || "production"
|
|
5698
|
-
}),
|
|
5728
|
+
}), fs = (e) => typeof e == "string" ? e : e?.location ?? void 0, ps = (e, t) => {
|
|
5699
5729
|
let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
|
|
5700
5730
|
return {
|
|
5701
5731
|
title: n.meta_title || r,
|
|
@@ -5705,32 +5735,32 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5705
5735
|
og: {
|
|
5706
5736
|
title: n.og_title || void 0,
|
|
5707
5737
|
description: n.og_description || void 0,
|
|
5708
|
-
image:
|
|
5738
|
+
image: fs(n.og_image),
|
|
5709
5739
|
url: n.og_url || void 0
|
|
5710
5740
|
},
|
|
5711
5741
|
twitter: { card: n.twitter_card || void 0 },
|
|
5712
5742
|
ldJson: n.ld_json || void 0,
|
|
5713
5743
|
customHead: n.head_code || void 0
|
|
5714
5744
|
};
|
|
5715
|
-
},
|
|
5745
|
+
}, ms = (e) => ({
|
|
5716
5746
|
description: e.description || void 0,
|
|
5717
5747
|
customHead: e.settings?.head_code || void 0
|
|
5718
|
-
}),
|
|
5719
|
-
let i =
|
|
5748
|
+
}), hs = (e) => (t = {}, n) => (r) => {
|
|
5749
|
+
let i = ps(t, e.name);
|
|
5720
5750
|
if (n) {
|
|
5721
5751
|
let t = r?.loaderData?.[n.source];
|
|
5722
5752
|
if (t) {
|
|
5723
|
-
let r = n.title ?
|
|
5753
|
+
let r = n.title ? us(t[n.title]) : void 0;
|
|
5724
5754
|
r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
|
|
5725
5755
|
...i.og,
|
|
5726
5756
|
title: r
|
|
5727
5757
|
});
|
|
5728
|
-
let a = n.description ?
|
|
5758
|
+
let a = n.description ? us(t[n.description]) : void 0;
|
|
5729
5759
|
a && (i.description = a, i.og = {
|
|
5730
5760
|
...i.og,
|
|
5731
5761
|
description: a
|
|
5732
5762
|
});
|
|
5733
|
-
let o = n.image ?
|
|
5763
|
+
let o = n.image ? fs(t[n.image]) : void 0;
|
|
5734
5764
|
o && (i.og = {
|
|
5735
5765
|
...i.og,
|
|
5736
5766
|
image: o
|
|
@@ -5741,12 +5771,12 @@ var Ko = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
5741
5771
|
let t = r?.match?.pathname, n = (e.domain || "").trim();
|
|
5742
5772
|
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + t);
|
|
5743
5773
|
}
|
|
5744
|
-
return
|
|
5745
|
-
},
|
|
5774
|
+
return Uo(i, ms(e));
|
|
5775
|
+
}, gs = (e) => (t) => ({ context: n, params: r }) => it({
|
|
5746
5776
|
queryClient: n.queryClient,
|
|
5747
5777
|
config: e,
|
|
5748
5778
|
sources: t,
|
|
5749
5779
|
params: r
|
|
5750
5780
|
});
|
|
5751
5781
|
//#endregion
|
|
5752
|
-
export {
|
|
5782
|
+
export { Ro as Inspector, ls as LevoEventRegister, eo as LevoForm, Je as LevoSiteProvider, Wo as PageHead, hs as createLevoHead, gs as createLevoLoader, We as createSiteClient, Uo as pageHead, Ho as parseRawHead, it as prefetchLevoSources, ds as siteConfigFromJson, rt as useLevoForm, qe as useLevoInsights, nt as useLevoRecord, Ke as useLevoSite, tt as useLevoSource };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/site-runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Runtime for Levo Studio v3 sites — the editor preview inspector, page head metadata, and the Levo data client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"@stripe/react-stripe-js": "^3.1.1",
|
|
67
67
|
"@stripe/stripe-js": "^5.5.0",
|
|
68
68
|
"react-razorpay": "^3.0.1",
|
|
69
|
-
"@levo-so/
|
|
70
|
-
"@levo-so/
|
|
69
|
+
"@levo-so/insights": "0.2.1",
|
|
70
|
+
"@levo-so/core": "0.2.1"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@base-ui/react": "^1.5.0",
|