@planetaexo/design-system 0.4.15 → 0.4.17
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/dist/index.cjs +261 -128
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +244 -112
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React22 = require('react');
|
|
4
4
|
var classVarianceAuthority = require('class-variance-authority');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -36,7 +36,7 @@ function _interopNamespace(e) {
|
|
|
36
36
|
return Object.freeze(n);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var React22__namespace = /*#__PURE__*/_interopNamespace(React22);
|
|
40
40
|
|
|
41
41
|
var __defProp = Object.defineProperty;
|
|
42
42
|
var __defProps = Object.defineProperties;
|
|
@@ -101,7 +101,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
);
|
|
104
|
-
var Button =
|
|
104
|
+
var Button = React22__namespace.forwardRef(
|
|
105
105
|
(_a, ref) => {
|
|
106
106
|
var _b = _a, { className, variant, size } = _b, props = __objRest(_b, ["className", "variant", "size"]);
|
|
107
107
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -296,10 +296,10 @@ function DialogDescription(_a) {
|
|
|
296
296
|
}, props)
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
|
-
var FloatingInput =
|
|
299
|
+
var FloatingInput = React22__namespace.forwardRef(
|
|
300
300
|
(_a, ref) => {
|
|
301
301
|
var _b = _a, { label, error, id, className, required } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required"]);
|
|
302
|
-
const inputId = id != null ? id :
|
|
302
|
+
const inputId = id != null ? id : React22__namespace.useId();
|
|
303
303
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
304
304
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
305
305
|
"input",
|
|
@@ -339,10 +339,10 @@ var FloatingInput = React21__namespace.forwardRef(
|
|
|
339
339
|
}
|
|
340
340
|
);
|
|
341
341
|
FloatingInput.displayName = "FloatingInput";
|
|
342
|
-
var FloatingSelect =
|
|
342
|
+
var FloatingSelect = React22__namespace.forwardRef(
|
|
343
343
|
(_a, ref) => {
|
|
344
344
|
var _b = _a, { label, error, id, className, required, children, value } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required", "children", "value"]);
|
|
345
|
-
const inputId = id != null ? id :
|
|
345
|
+
const inputId = id != null ? id : React22__namespace.useId();
|
|
346
346
|
const hasValue = typeof value === "string" ? value !== "" : value !== void 0 && value !== null;
|
|
347
347
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
348
348
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -605,11 +605,11 @@ function PhoneCountrySelect({
|
|
|
605
605
|
className
|
|
606
606
|
}) {
|
|
607
607
|
var _a;
|
|
608
|
-
const [open, setOpen] =
|
|
609
|
-
const containerRef =
|
|
610
|
-
const listRef =
|
|
608
|
+
const [open, setOpen] = React22__namespace.useState(false);
|
|
609
|
+
const containerRef = React22__namespace.useRef(null);
|
|
610
|
+
const listRef = React22__namespace.useRef(null);
|
|
611
611
|
const selected = (_a = PHONE_COUNTRIES.find((c) => c.code === value)) != null ? _a : PHONE_COUNTRIES[0];
|
|
612
|
-
|
|
612
|
+
React22__namespace.useEffect(() => {
|
|
613
613
|
if (!open) return;
|
|
614
614
|
const handler = (e) => {
|
|
615
615
|
var _a2;
|
|
@@ -620,7 +620,7 @@ function PhoneCountrySelect({
|
|
|
620
620
|
document.addEventListener("mousedown", handler);
|
|
621
621
|
return () => document.removeEventListener("mousedown", handler);
|
|
622
622
|
}, [open]);
|
|
623
|
-
|
|
623
|
+
React22__namespace.useEffect(() => {
|
|
624
624
|
if (!open || !listRef.current) return;
|
|
625
625
|
const activeEl = listRef.current.querySelector("[data-selected=true]");
|
|
626
626
|
activeEl == null ? void 0 : activeEl.scrollIntoView({ block: "nearest" });
|
|
@@ -884,8 +884,8 @@ function CalendarDayButton(_a) {
|
|
|
884
884
|
"locale"
|
|
885
885
|
]);
|
|
886
886
|
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
887
|
-
const ref =
|
|
888
|
-
|
|
887
|
+
const ref = React22__namespace.useRef(null);
|
|
888
|
+
React22__namespace.useEffect(() => {
|
|
889
889
|
var _a2;
|
|
890
890
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
891
891
|
}, [modifiers.focused]);
|
|
@@ -915,16 +915,16 @@ function BirthDateField({
|
|
|
915
915
|
error,
|
|
916
916
|
className
|
|
917
917
|
}) {
|
|
918
|
-
const [open, setOpen] =
|
|
919
|
-
const [text, setText] =
|
|
918
|
+
const [open, setOpen] = React22__namespace.useState(false);
|
|
919
|
+
const [text, setText] = React22__namespace.useState(
|
|
920
920
|
value ? dateFns.format(value, "dd/MM/yyyy") : ""
|
|
921
921
|
);
|
|
922
|
-
const containerRef =
|
|
923
|
-
const inputId =
|
|
924
|
-
|
|
922
|
+
const containerRef = React22__namespace.useRef(null);
|
|
923
|
+
const inputId = React22__namespace.useId();
|
|
924
|
+
React22__namespace.useEffect(() => {
|
|
925
925
|
setText(value ? dateFns.format(value, "dd/MM/yyyy") : "");
|
|
926
926
|
}, [value]);
|
|
927
|
-
|
|
927
|
+
React22__namespace.useEffect(() => {
|
|
928
928
|
if (!open) return;
|
|
929
929
|
const handler = (e) => {
|
|
930
930
|
var _a;
|
|
@@ -1127,14 +1127,14 @@ function CountrySearchField({
|
|
|
1127
1127
|
}) {
|
|
1128
1128
|
var _a;
|
|
1129
1129
|
const list = countries != null ? countries : COUNTRIES;
|
|
1130
|
-
const [query, setQuery] =
|
|
1131
|
-
const [open, setOpen] =
|
|
1132
|
-
const containerRef =
|
|
1133
|
-
const searchRef =
|
|
1130
|
+
const [query, setQuery] = React22__namespace.useState("");
|
|
1131
|
+
const [open, setOpen] = React22__namespace.useState(false);
|
|
1132
|
+
const containerRef = React22__namespace.useRef(null);
|
|
1133
|
+
const searchRef = React22__namespace.useRef(null);
|
|
1134
1134
|
const selected = list.find((c) => c.code === value);
|
|
1135
1135
|
const isFloated = open || !!selected;
|
|
1136
1136
|
const filtered = query.trim() ? list.filter((c) => c.name.toLowerCase().includes(query.toLowerCase())) : list;
|
|
1137
|
-
|
|
1137
|
+
React22__namespace.useEffect(() => {
|
|
1138
1138
|
if (!open) return;
|
|
1139
1139
|
const handler = (e) => {
|
|
1140
1140
|
var _a2;
|
|
@@ -1241,7 +1241,7 @@ function Alert({ variant = "info", children, className }) {
|
|
|
1241
1241
|
function AdventureCard({ adventure }) {
|
|
1242
1242
|
var _a, _b, _c, _d, _e, _f;
|
|
1243
1243
|
const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
|
|
1244
|
-
const [checkedInternal, setCheckedInternal] =
|
|
1244
|
+
const [checkedInternal, setCheckedInternal] = React22__namespace.useState(
|
|
1245
1245
|
new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
|
|
1246
1246
|
);
|
|
1247
1247
|
const isChecked = (opt) => {
|
|
@@ -1578,7 +1578,7 @@ function BookingShell({
|
|
|
1578
1578
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card overflow-hidden", children: [
|
|
1579
1579
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-border px-5 py-4 bg-muted/20", children: [
|
|
1580
1580
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-bold text-foreground font-heading mb-2", children: title }),
|
|
1581
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1581
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxRuntime.jsxs(React22__namespace.Fragment, { children: [
|
|
1582
1582
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1583
1583
|
"span",
|
|
1584
1584
|
{
|
|
@@ -1777,7 +1777,7 @@ function TermsSection({
|
|
|
1777
1777
|
termsContent
|
|
1778
1778
|
}) {
|
|
1779
1779
|
var _a;
|
|
1780
|
-
const [modalOpen, setModalOpen] =
|
|
1780
|
+
const [modalOpen, setModalOpen] = React22__namespace.useState(false);
|
|
1781
1781
|
const i18n = (_a = TERMS_I18N[locale]) != null ? _a : TERMS_I18N.en;
|
|
1782
1782
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
|
|
1783
1783
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
|
|
@@ -1865,9 +1865,9 @@ function BookingWizard({
|
|
|
1865
1865
|
depositInfo,
|
|
1866
1866
|
onCancel
|
|
1867
1867
|
}) {
|
|
1868
|
-
const [step, setStep] =
|
|
1869
|
-
const [error, setError] =
|
|
1870
|
-
const [responsible, setResponsible] =
|
|
1868
|
+
const [step, setStep] = React22__namespace.useState("responsible");
|
|
1869
|
+
const [error, setError] = React22__namespace.useState(null);
|
|
1870
|
+
const [responsible, setResponsible] = React22__namespace.useState({
|
|
1871
1871
|
firstName: "",
|
|
1872
1872
|
lastName: "",
|
|
1873
1873
|
email: "",
|
|
@@ -1886,7 +1886,7 @@ function BookingWizard({
|
|
|
1886
1886
|
return s + ((_b = (_a = a.slots) == null ? void 0 : _a.children) != null ? _b : 0);
|
|
1887
1887
|
}, 0);
|
|
1888
1888
|
const totalPax = totalAdults + totalChildren;
|
|
1889
|
-
const [travellers, setTravellers] =
|
|
1889
|
+
const [travellers, setTravellers] = React22__namespace.useState(
|
|
1890
1890
|
Array.from({ length: Math.max(totalPax, 1) }, () => ({
|
|
1891
1891
|
firstName: "",
|
|
1892
1892
|
lastName: "",
|
|
@@ -1894,9 +1894,9 @@ function BookingWizard({
|
|
|
1894
1894
|
email: ""
|
|
1895
1895
|
}))
|
|
1896
1896
|
);
|
|
1897
|
-
const [payAmount, setPayAmount] =
|
|
1898
|
-
const [payMethod, setPayMethod] =
|
|
1899
|
-
const [termsAccepted, setTermsAccepted] =
|
|
1897
|
+
const [payAmount, setPayAmount] = React22__namespace.useState("full");
|
|
1898
|
+
const [payMethod, setPayMethod] = React22__namespace.useState("stripe");
|
|
1899
|
+
const [termsAccepted, setTermsAccepted] = React22__namespace.useState(false);
|
|
1900
1900
|
const setR = (k, v) => setResponsible((p) => __spreadProps(__spreadValues({}, p), { [k]: v }));
|
|
1901
1901
|
const setT = (i, k, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { [k]: v }) : t));
|
|
1902
1902
|
const setTDob = (i, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { dateOfBirth: v }) : t));
|
|
@@ -2097,7 +2097,7 @@ function Offer({
|
|
|
2097
2097
|
continueDisabled,
|
|
2098
2098
|
className
|
|
2099
2099
|
}) {
|
|
2100
|
-
const [showBooking, setShowBooking] =
|
|
2100
|
+
const [showBooking, setShowBooking] = React22__namespace.useState(false);
|
|
2101
2101
|
const isShowingCheckout = !!checkoutSlot || showBooking;
|
|
2102
2102
|
const handleBook = () => {
|
|
2103
2103
|
if (!checkoutSlot && !externalBookingFlow) setShowBooking(true);
|
|
@@ -2219,9 +2219,9 @@ function AdventureSection({
|
|
|
2219
2219
|
onAddSuggestedTraveller
|
|
2220
2220
|
}) {
|
|
2221
2221
|
var _a, _b, _c;
|
|
2222
|
-
const [detailsOpen, setDetailsOpen] =
|
|
2223
|
-
const [addModalOpen, setAddModalOpen] =
|
|
2224
|
-
const [newTraveller, setNewTraveller] =
|
|
2222
|
+
const [detailsOpen, setDetailsOpen] = React22__namespace.useState(false);
|
|
2223
|
+
const [addModalOpen, setAddModalOpen] = React22__namespace.useState(false);
|
|
2224
|
+
const [newTraveller, setNewTraveller] = React22__namespace.useState({
|
|
2225
2225
|
firstName: "",
|
|
2226
2226
|
lastName: "",
|
|
2227
2227
|
passport: "",
|
|
@@ -3640,11 +3640,11 @@ function DatePickerField({
|
|
|
3640
3640
|
fromDate,
|
|
3641
3641
|
className
|
|
3642
3642
|
}) {
|
|
3643
|
-
const [open, setOpen] =
|
|
3644
|
-
const containerRef =
|
|
3645
|
-
const [calendarWidth, setCalendarWidth] =
|
|
3643
|
+
const [open, setOpen] = React22__namespace.useState(false);
|
|
3644
|
+
const containerRef = React22__namespace.useRef(null);
|
|
3645
|
+
const [calendarWidth, setCalendarWidth] = React22__namespace.useState();
|
|
3646
3646
|
const hasValue = !!value;
|
|
3647
|
-
|
|
3647
|
+
React22__namespace.useEffect(() => {
|
|
3648
3648
|
if (!containerRef.current) return;
|
|
3649
3649
|
const observer = new ResizeObserver(([entry]) => {
|
|
3650
3650
|
setCalendarWidth(entry.contentRect.width);
|
|
@@ -3753,7 +3753,7 @@ function BookingForm({
|
|
|
3753
3753
|
subtitle = "Free enquiry \u2013 no commitment",
|
|
3754
3754
|
className
|
|
3755
3755
|
}) {
|
|
3756
|
-
const [values, setValues] =
|
|
3756
|
+
const [values, setValues] = React22__namespace.useState(__spreadValues(__spreadValues({}, defaultInitial), defaultValues));
|
|
3757
3757
|
const set = (key, value) => setValues((prev) => __spreadProps(__spreadValues({}, prev), { [key]: value }));
|
|
3758
3758
|
const handleSubmit = (e) => {
|
|
3759
3759
|
e.preventDefault();
|
|
@@ -4267,11 +4267,11 @@ function FloatingTextarea({
|
|
|
4267
4267
|
}
|
|
4268
4268
|
function SelectField({ field, value, onChange, error }) {
|
|
4269
4269
|
var _a, _b, _c;
|
|
4270
|
-
const [open, setOpen] =
|
|
4271
|
-
const containerRef =
|
|
4270
|
+
const [open, setOpen] = React22__namespace.useState(false);
|
|
4271
|
+
const containerRef = React22__namespace.useRef(null);
|
|
4272
4272
|
const options = (_a = field.options) != null ? _a : [];
|
|
4273
4273
|
const selectedOpt = (_b = options.find((o) => o.value === value)) != null ? _b : null;
|
|
4274
|
-
|
|
4274
|
+
React22__namespace.useEffect(() => {
|
|
4275
4275
|
if (!open) return;
|
|
4276
4276
|
const handleOutside = (e) => {
|
|
4277
4277
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -4638,11 +4638,11 @@ function RegistrationForm({
|
|
|
4638
4638
|
className
|
|
4639
4639
|
}) {
|
|
4640
4640
|
var _a;
|
|
4641
|
-
const L =
|
|
4641
|
+
const L = React22__namespace.useMemo(
|
|
4642
4642
|
() => __spreadValues(__spreadValues({}, DEFAULT_LABELS3), labels != null ? labels : {}),
|
|
4643
4643
|
[labels]
|
|
4644
4644
|
);
|
|
4645
|
-
const sortedFields =
|
|
4645
|
+
const sortedFields = React22__namespace.useMemo(
|
|
4646
4646
|
() => [...fields].sort((a, b) => {
|
|
4647
4647
|
var _a2, _b;
|
|
4648
4648
|
return ((_a2 = a.order) != null ? _a2 : 0) - ((_b = b.order) != null ? _b : 0);
|
|
@@ -4650,7 +4650,7 @@ function RegistrationForm({
|
|
|
4650
4650
|
[fields]
|
|
4651
4651
|
);
|
|
4652
4652
|
const isControlled = values !== void 0;
|
|
4653
|
-
const [internal, setInternal] =
|
|
4653
|
+
const [internal, setInternal] = React22__namespace.useState(
|
|
4654
4654
|
() => initializeValues(
|
|
4655
4655
|
sortedFields,
|
|
4656
4656
|
defaultValues != null ? defaultValues : {},
|
|
@@ -4658,9 +4658,9 @@ function RegistrationForm({
|
|
|
4658
4658
|
includeTerms
|
|
4659
4659
|
)
|
|
4660
4660
|
);
|
|
4661
|
-
const [submitAttempted, setSubmitAttempted] =
|
|
4662
|
-
const [validationErrors, setValidationErrors] =
|
|
4663
|
-
|
|
4661
|
+
const [submitAttempted, setSubmitAttempted] = React22__namespace.useState(false);
|
|
4662
|
+
const [validationErrors, setValidationErrors] = React22__namespace.useState({});
|
|
4663
|
+
React22__namespace.useEffect(() => {
|
|
4664
4664
|
if (isControlled) return;
|
|
4665
4665
|
setInternal((prev) => {
|
|
4666
4666
|
const next = initializeValues(
|
|
@@ -4717,7 +4717,7 @@ function RegistrationForm({
|
|
|
4717
4717
|
const termsError = submitAttempted && termsEnabled && !termsAccepted;
|
|
4718
4718
|
const firstErrorFieldId = Object.keys(fieldErrors)[0];
|
|
4719
4719
|
const scrollTargetId = firstErrorFieldId ? `rf-${firstErrorFieldId}` : termsError ? "rf-terms" : null;
|
|
4720
|
-
|
|
4720
|
+
React22__namespace.useEffect(() => {
|
|
4721
4721
|
if (!submitAttempted || !scrollTargetId) return;
|
|
4722
4722
|
const timer = setTimeout(() => {
|
|
4723
4723
|
const elem = document.getElementById(scrollTargetId);
|
|
@@ -5025,6 +5025,138 @@ function RegistrationSuccessCard({
|
|
|
5025
5025
|
] }, f.id)) }) })
|
|
5026
5026
|
] });
|
|
5027
5027
|
}
|
|
5028
|
+
var OTPCodeInput = ({
|
|
5029
|
+
value,
|
|
5030
|
+
onChange,
|
|
5031
|
+
label,
|
|
5032
|
+
error,
|
|
5033
|
+
disabled = false,
|
|
5034
|
+
length = 6,
|
|
5035
|
+
className,
|
|
5036
|
+
id,
|
|
5037
|
+
required
|
|
5038
|
+
}) => {
|
|
5039
|
+
const baseId = id != null ? id : React22__namespace.useId();
|
|
5040
|
+
const inputRefs = React22__namespace.useRef([]);
|
|
5041
|
+
const digits = React22__namespace.useMemo(() => {
|
|
5042
|
+
const arr = value.split("").slice(0, length);
|
|
5043
|
+
while (arr.length < length) arr.push("");
|
|
5044
|
+
return arr;
|
|
5045
|
+
}, [value, length]);
|
|
5046
|
+
const updateValue = (newDigits) => {
|
|
5047
|
+
onChange(newDigits.join(""));
|
|
5048
|
+
};
|
|
5049
|
+
const focusedIndexRef = React22__namespace.useRef(0);
|
|
5050
|
+
const focusSlot = (index) => {
|
|
5051
|
+
var _a;
|
|
5052
|
+
if (index >= 0 && index < length) {
|
|
5053
|
+
(_a = inputRefs.current[index]) == null ? void 0 : _a.focus();
|
|
5054
|
+
}
|
|
5055
|
+
};
|
|
5056
|
+
const handleChange = (index, raw) => {
|
|
5057
|
+
const numeric = raw.replace(/\D/g, "");
|
|
5058
|
+
if (!numeric) return;
|
|
5059
|
+
const newDigits = [...digits];
|
|
5060
|
+
newDigits[index] = numeric[numeric.length - 1];
|
|
5061
|
+
updateValue(newDigits);
|
|
5062
|
+
if (index < length - 1) {
|
|
5063
|
+
focusSlot(index + 1);
|
|
5064
|
+
}
|
|
5065
|
+
};
|
|
5066
|
+
const handleKeyDown = (index, e) => {
|
|
5067
|
+
if (e.key === "Backspace") {
|
|
5068
|
+
e.preventDefault();
|
|
5069
|
+
const newDigits = [...digits];
|
|
5070
|
+
if (newDigits[index]) {
|
|
5071
|
+
newDigits[index] = "";
|
|
5072
|
+
updateValue(newDigits);
|
|
5073
|
+
} else if (index > 0) {
|
|
5074
|
+
newDigits[index - 1] = "";
|
|
5075
|
+
updateValue(newDigits);
|
|
5076
|
+
focusSlot(index - 1);
|
|
5077
|
+
}
|
|
5078
|
+
} else if (e.key === "ArrowLeft") {
|
|
5079
|
+
e.preventDefault();
|
|
5080
|
+
focusSlot(index - 1);
|
|
5081
|
+
} else if (e.key === "ArrowRight") {
|
|
5082
|
+
e.preventDefault();
|
|
5083
|
+
focusSlot(index + 1);
|
|
5084
|
+
} else if (e.key === "Tab") ; else if (!/^\d$/.test(e.key) && e.key.length === 1) {
|
|
5085
|
+
e.preventDefault();
|
|
5086
|
+
}
|
|
5087
|
+
};
|
|
5088
|
+
const handlePaste = (e) => {
|
|
5089
|
+
e.preventDefault();
|
|
5090
|
+
const pasted = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, length);
|
|
5091
|
+
if (!pasted) return;
|
|
5092
|
+
const startIndex = focusedIndexRef.current;
|
|
5093
|
+
const newDigits = [...digits];
|
|
5094
|
+
for (let i = 0; i < pasted.length && startIndex + i < length; i++) {
|
|
5095
|
+
newDigits[startIndex + i] = pasted[i];
|
|
5096
|
+
}
|
|
5097
|
+
updateValue(newDigits);
|
|
5098
|
+
const lastFilled = Math.min(startIndex + pasted.length, length) - 1;
|
|
5099
|
+
focusSlot(lastFilled < length - 1 ? lastFilled + 1 : lastFilled);
|
|
5100
|
+
};
|
|
5101
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col items-center", className), children: [
|
|
5102
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5103
|
+
"label",
|
|
5104
|
+
{
|
|
5105
|
+
htmlFor: baseId,
|
|
5106
|
+
className: cn(
|
|
5107
|
+
"self-start text-sm text-muted-foreground font-ui mb-2",
|
|
5108
|
+
required && "after:content-['*'] after:text-primary after:ml-0.5"
|
|
5109
|
+
),
|
|
5110
|
+
children: label
|
|
5111
|
+
}
|
|
5112
|
+
),
|
|
5113
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5114
|
+
"div",
|
|
5115
|
+
{
|
|
5116
|
+
className: cn(
|
|
5117
|
+
"flex justify-center gap-2",
|
|
5118
|
+
disabled && "opacity-50 pointer-events-none"
|
|
5119
|
+
),
|
|
5120
|
+
role: "group",
|
|
5121
|
+
"aria-label": label,
|
|
5122
|
+
onPaste: handlePaste,
|
|
5123
|
+
children: digits.map((digit, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5124
|
+
"input",
|
|
5125
|
+
{
|
|
5126
|
+
ref: (el) => {
|
|
5127
|
+
inputRefs.current[index] = el;
|
|
5128
|
+
},
|
|
5129
|
+
id: index === 0 ? baseId : `${baseId}-${index}`,
|
|
5130
|
+
type: "text",
|
|
5131
|
+
inputMode: "numeric",
|
|
5132
|
+
pattern: "\\d*",
|
|
5133
|
+
maxLength: 2,
|
|
5134
|
+
value: digit,
|
|
5135
|
+
autoComplete: index === 0 ? "one-time-code" : "off",
|
|
5136
|
+
"aria-label": `${label} d\xEDgito ${index + 1} de ${length}`,
|
|
5137
|
+
disabled,
|
|
5138
|
+
onChange: (e) => handleChange(index, e.target.value),
|
|
5139
|
+
onKeyDown: (e) => handleKeyDown(index, e),
|
|
5140
|
+
onFocus: (e) => {
|
|
5141
|
+
focusedIndexRef.current = index;
|
|
5142
|
+
e.target.select();
|
|
5143
|
+
},
|
|
5144
|
+
className: cn(
|
|
5145
|
+
"w-11 h-14 text-center text-lg rounded-lg border font-ui",
|
|
5146
|
+
"bg-background text-foreground border-border",
|
|
5147
|
+
"transition-colors",
|
|
5148
|
+
"focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",
|
|
5149
|
+
error && "border-destructive focus:border-destructive focus:ring-destructive"
|
|
5150
|
+
)
|
|
5151
|
+
},
|
|
5152
|
+
index
|
|
5153
|
+
))
|
|
5154
|
+
}
|
|
5155
|
+
),
|
|
5156
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-destructive font-ui self-start", children: error })
|
|
5157
|
+
] });
|
|
5158
|
+
};
|
|
5159
|
+
OTPCodeInput.displayName = "OTPCodeInput";
|
|
5028
5160
|
function Checkbox(_a) {
|
|
5029
5161
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5030
5162
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5050,7 +5182,7 @@ function Checkbox(_a) {
|
|
|
5050
5182
|
})
|
|
5051
5183
|
);
|
|
5052
5184
|
}
|
|
5053
|
-
var AccordionVariantContext =
|
|
5185
|
+
var AccordionVariantContext = React22__namespace.createContext("default");
|
|
5054
5186
|
function Accordion(_a) {
|
|
5055
5187
|
var _b = _a, { className, variant = "default" } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
5056
5188
|
return /* @__PURE__ */ jsxRuntime.jsx(AccordionVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5068,7 +5200,7 @@ function Accordion(_a) {
|
|
|
5068
5200
|
}
|
|
5069
5201
|
function AccordionItem(_a) {
|
|
5070
5202
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5071
|
-
const variant =
|
|
5203
|
+
const variant = React22__namespace.useContext(AccordionVariantContext);
|
|
5072
5204
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5073
5205
|
accordion.Accordion.Item,
|
|
5074
5206
|
__spreadValues({
|
|
@@ -5089,7 +5221,7 @@ function AccordionTrigger(_a) {
|
|
|
5089
5221
|
"className",
|
|
5090
5222
|
"children"
|
|
5091
5223
|
]);
|
|
5092
|
-
const variant =
|
|
5224
|
+
const variant = React22__namespace.useContext(AccordionVariantContext);
|
|
5093
5225
|
return /* @__PURE__ */ jsxRuntime.jsx(accordion.Accordion.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5094
5226
|
accordion.Accordion.Trigger,
|
|
5095
5227
|
__spreadProps(__spreadValues({
|
|
@@ -5143,7 +5275,7 @@ function AccordionContent(_a) {
|
|
|
5143
5275
|
"className",
|
|
5144
5276
|
"children"
|
|
5145
5277
|
]);
|
|
5146
|
-
const variant =
|
|
5278
|
+
const variant = React22__namespace.useContext(AccordionVariantContext);
|
|
5147
5279
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5148
5280
|
accordion.Accordion.Panel,
|
|
5149
5281
|
__spreadProps(__spreadValues({
|
|
@@ -5175,7 +5307,7 @@ function FilterPanel({
|
|
|
5175
5307
|
title = "Filters",
|
|
5176
5308
|
className
|
|
5177
5309
|
}) {
|
|
5178
|
-
const [internalValue, setInternalValue] =
|
|
5310
|
+
const [internalValue, setInternalValue] = React22__namespace.useState(
|
|
5179
5311
|
() => Object.fromEntries(groups.map((g) => [g.id, []]))
|
|
5180
5312
|
);
|
|
5181
5313
|
const selected = value != null ? value : internalValue;
|
|
@@ -5337,11 +5469,11 @@ function ItineraryModal({
|
|
|
5337
5469
|
onNext
|
|
5338
5470
|
}) {
|
|
5339
5471
|
var _a, _b, _c;
|
|
5340
|
-
const [imgIndex, setImgIndex] =
|
|
5472
|
+
const [imgIndex, setImgIndex] = React22__namespace.useState(0);
|
|
5341
5473
|
const images = stop ? [stop.coverImage, ...(_a = stop.images) != null ? _a : []] : [];
|
|
5342
5474
|
const isFirst = (stop == null ? void 0 : stop.dayNumber) === ((_b = allStops[0]) == null ? void 0 : _b.dayNumber);
|
|
5343
5475
|
const isLast = (stop == null ? void 0 : stop.dayNumber) === ((_c = allStops[allStops.length - 1]) == null ? void 0 : _c.dayNumber);
|
|
5344
|
-
|
|
5476
|
+
React22__namespace.useEffect(() => {
|
|
5345
5477
|
setImgIndex(0);
|
|
5346
5478
|
}, [stop == null ? void 0 : stop.dayNumber]);
|
|
5347
5479
|
if (!stop) return null;
|
|
@@ -5468,8 +5600,8 @@ function ItineraryModal({
|
|
|
5468
5600
|
) });
|
|
5469
5601
|
}
|
|
5470
5602
|
function Itinerary({ title, subtitle, stops, className }) {
|
|
5471
|
-
const [activeIndex, setActiveIndex] =
|
|
5472
|
-
const scrollRef =
|
|
5603
|
+
const [activeIndex, setActiveIndex] = React22__namespace.useState(null);
|
|
5604
|
+
const scrollRef = React22__namespace.useRef(null);
|
|
5473
5605
|
const activeStop = activeIndex !== null ? stops[activeIndex] : null;
|
|
5474
5606
|
const scrollBy = (dir) => {
|
|
5475
5607
|
if (!scrollRef.current) return;
|
|
@@ -5555,8 +5687,8 @@ function MenuTrip({
|
|
|
5555
5687
|
bold = true,
|
|
5556
5688
|
className
|
|
5557
5689
|
}) {
|
|
5558
|
-
const scrollRef =
|
|
5559
|
-
|
|
5690
|
+
const scrollRef = React22__namespace.useRef(null);
|
|
5691
|
+
React22__namespace.useEffect(() => {
|
|
5560
5692
|
if (!scrollRef.current || !activeSection) return;
|
|
5561
5693
|
const container = scrollRef.current;
|
|
5562
5694
|
const btn = container.querySelector(
|
|
@@ -5702,18 +5834,18 @@ function Lightbox({
|
|
|
5702
5834
|
onClose
|
|
5703
5835
|
}) {
|
|
5704
5836
|
var _a;
|
|
5705
|
-
const [index, setIndex] =
|
|
5837
|
+
const [index, setIndex] = React22__namespace.useState(initialIndex);
|
|
5706
5838
|
const total = photos.length;
|
|
5707
5839
|
const photo = photos[index];
|
|
5708
|
-
const prev =
|
|
5840
|
+
const prev = React22__namespace.useCallback(
|
|
5709
5841
|
() => setIndex((i) => (i - 1 + total) % total),
|
|
5710
5842
|
[total]
|
|
5711
5843
|
);
|
|
5712
|
-
const next =
|
|
5844
|
+
const next = React22__namespace.useCallback(
|
|
5713
5845
|
() => setIndex((i) => (i + 1) % total),
|
|
5714
5846
|
[total]
|
|
5715
5847
|
);
|
|
5716
|
-
|
|
5848
|
+
React22__namespace.useEffect(() => {
|
|
5717
5849
|
const onKey = (e) => {
|
|
5718
5850
|
if (e.key === "Escape") onClose();
|
|
5719
5851
|
if (e.key === "ArrowLeft") prev();
|
|
@@ -5907,7 +6039,7 @@ function GridGallery({
|
|
|
5907
6039
|
initialVisible,
|
|
5908
6040
|
onOpen
|
|
5909
6041
|
}) {
|
|
5910
|
-
const [expanded, setExpanded] =
|
|
6042
|
+
const [expanded, setExpanded] = React22__namespace.useState(false);
|
|
5911
6043
|
const cols = gridCols(photos.length);
|
|
5912
6044
|
const hasMore = photos.length > initialVisible;
|
|
5913
6045
|
const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
|
|
@@ -5937,7 +6069,7 @@ function MasonryGallery({
|
|
|
5937
6069
|
initialVisible,
|
|
5938
6070
|
onOpen
|
|
5939
6071
|
}) {
|
|
5940
|
-
const [expanded, setExpanded] =
|
|
6072
|
+
const [expanded, setExpanded] = React22__namespace.useState(false);
|
|
5941
6073
|
const hasMore = photos.length > initialVisible;
|
|
5942
6074
|
const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
|
|
5943
6075
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -6010,7 +6142,7 @@ function FeaturedGallery({
|
|
|
6010
6142
|
photos,
|
|
6011
6143
|
onOpen
|
|
6012
6144
|
}) {
|
|
6013
|
-
const [expanded, setExpanded] =
|
|
6145
|
+
const [expanded, setExpanded] = React22__namespace.useState(false);
|
|
6014
6146
|
const featured = photos.slice(0, 3);
|
|
6015
6147
|
const extra = photos.slice(3);
|
|
6016
6148
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -6087,8 +6219,8 @@ function PhotoGallery({
|
|
|
6087
6219
|
onPhotoClick,
|
|
6088
6220
|
className
|
|
6089
6221
|
}) {
|
|
6090
|
-
const [lightboxIndex, setLightboxIndex] =
|
|
6091
|
-
const normalised =
|
|
6222
|
+
const [lightboxIndex, setLightboxIndex] = React22__namespace.useState(null);
|
|
6223
|
+
const normalised = React22__namespace.useMemo(() => photos.map(normalise), [photos]);
|
|
6092
6224
|
const handleOpen = (index) => {
|
|
6093
6225
|
setLightboxIndex(index);
|
|
6094
6226
|
onPhotoClick == null ? void 0 : onPhotoClick(normalised[index].src, index);
|
|
@@ -6177,7 +6309,7 @@ function PricingTrip({
|
|
|
6177
6309
|
variant = "card",
|
|
6178
6310
|
className
|
|
6179
6311
|
}) {
|
|
6180
|
-
const [showPricing, setShowPricing] =
|
|
6312
|
+
const [showPricing, setShowPricing] = React22__namespace.useState(false);
|
|
6181
6313
|
if (variant === "compact") {
|
|
6182
6314
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center gap-3", className), children: [
|
|
6183
6315
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -6500,14 +6632,14 @@ function SiteHeader({
|
|
|
6500
6632
|
className
|
|
6501
6633
|
}) {
|
|
6502
6634
|
const t = VARIANT[variant];
|
|
6503
|
-
const [openMenu, setOpenMenu] =
|
|
6504
|
-
const [langOpen, setLangOpen] =
|
|
6505
|
-
const [mobileOpen, setMobileOpen] =
|
|
6506
|
-
const [openMobileSection, setOpenMobileSection] =
|
|
6507
|
-
const [activeLang, setActiveLang] =
|
|
6635
|
+
const [openMenu, setOpenMenu] = React22__namespace.useState(null);
|
|
6636
|
+
const [langOpen, setLangOpen] = React22__namespace.useState(false);
|
|
6637
|
+
const [mobileOpen, setMobileOpen] = React22__namespace.useState(false);
|
|
6638
|
+
const [openMobileSection, setOpenMobileSection] = React22__namespace.useState(null);
|
|
6639
|
+
const [activeLang, setActiveLang] = React22__namespace.useState(currentLanguage);
|
|
6508
6640
|
const toggleMobileSection = (label) => setOpenMobileSection((prev) => prev === label ? null : label);
|
|
6509
|
-
const menuCloseTimer =
|
|
6510
|
-
const langCloseTimer =
|
|
6641
|
+
const menuCloseTimer = React22__namespace.useRef(void 0);
|
|
6642
|
+
const langCloseTimer = React22__namespace.useRef(void 0);
|
|
6511
6643
|
const handleMenuEnter = (label) => {
|
|
6512
6644
|
clearTimeout(menuCloseTimer.current);
|
|
6513
6645
|
setOpenMenu(label);
|
|
@@ -6528,7 +6660,7 @@ function SiteHeader({
|
|
|
6528
6660
|
setOpenMenu(null);
|
|
6529
6661
|
setLangOpen(false);
|
|
6530
6662
|
};
|
|
6531
|
-
|
|
6663
|
+
React22__namespace.useEffect(() => () => {
|
|
6532
6664
|
clearTimeout(menuCloseTimer.current);
|
|
6533
6665
|
clearTimeout(langCloseTimer.current);
|
|
6534
6666
|
}, []);
|
|
@@ -6793,7 +6925,7 @@ function SiteHeader({
|
|
|
6793
6925
|
), children: [
|
|
6794
6926
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: languages.map((lang, i) => {
|
|
6795
6927
|
const isActive = lang.code === activeLang;
|
|
6796
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6928
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React22__namespace.Fragment, { children: [
|
|
6797
6929
|
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
6798
6930
|
"text-xs select-none",
|
|
6799
6931
|
variant === "white" ? "text-border" : "text-white/15"
|
|
@@ -6855,8 +6987,8 @@ function SiteHeader({
|
|
|
6855
6987
|
);
|
|
6856
6988
|
}
|
|
6857
6989
|
function ThemeToggle({ className }) {
|
|
6858
|
-
const [dark, setDark] =
|
|
6859
|
-
|
|
6990
|
+
const [dark, setDark] = React22__namespace.useState(false);
|
|
6991
|
+
React22__namespace.useEffect(() => {
|
|
6860
6992
|
const saved = localStorage.getItem("theme");
|
|
6861
6993
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
6862
6994
|
const isDark = saved === "dark" || !saved && prefersDark;
|
|
@@ -7007,7 +7139,7 @@ function TripCard({
|
|
|
7007
7139
|
);
|
|
7008
7140
|
}
|
|
7009
7141
|
function useHlsVideo(videoRef, src) {
|
|
7010
|
-
|
|
7142
|
+
React22__namespace.useEffect(() => {
|
|
7011
7143
|
if (!src || !videoRef.current) return;
|
|
7012
7144
|
const video = videoRef.current;
|
|
7013
7145
|
if (!src.includes(".m3u8")) return;
|
|
@@ -7049,11 +7181,11 @@ function TripHeader({
|
|
|
7049
7181
|
className
|
|
7050
7182
|
}) {
|
|
7051
7183
|
var _a;
|
|
7052
|
-
const [heroIndex, setHeroIndex] =
|
|
7053
|
-
const [videoReady, setVideoReady] =
|
|
7054
|
-
const videoRef =
|
|
7184
|
+
const [heroIndex, setHeroIndex] = React22__namespace.useState(0);
|
|
7185
|
+
const [videoReady, setVideoReady] = React22__namespace.useState(false);
|
|
7186
|
+
const videoRef = React22__namespace.useRef(null);
|
|
7055
7187
|
const isHls = !!(videoUrl == null ? void 0 : videoUrl.includes(".m3u8"));
|
|
7056
|
-
const validImages =
|
|
7188
|
+
const validImages = React22__namespace.useMemo(
|
|
7057
7189
|
() => images.map((u) => u == null ? void 0 : u.trim()).filter(Boolean),
|
|
7058
7190
|
[images]
|
|
7059
7191
|
);
|
|
@@ -7068,7 +7200,7 @@ function TripHeader({
|
|
|
7068
7200
|
const nights = duration ? (_a = duration.nights) != null ? _a : Math.max(duration.days - 1, 1) : null;
|
|
7069
7201
|
const hasMeta = !!(destination || duration);
|
|
7070
7202
|
useHlsVideo(videoRef, isHls ? videoUrl : void 0);
|
|
7071
|
-
|
|
7203
|
+
React22__namespace.useEffect(() => {
|
|
7072
7204
|
if (!videoUrl) return;
|
|
7073
7205
|
const el = videoRef.current;
|
|
7074
7206
|
if (!el) return;
|
|
@@ -7210,7 +7342,7 @@ function TripHeader({
|
|
|
7210
7342
|
siteHeader ? "-mt-44" : "-mt-36"
|
|
7211
7343
|
),
|
|
7212
7344
|
children: [
|
|
7213
|
-
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7345
|
+
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(React22__namespace.Fragment, { children: [
|
|
7214
7346
|
i > 0 && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "h-3 w-3 text-white/50 shrink-0" }),
|
|
7215
7347
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-white/70 font-ui hover:text-white/90 cursor-default", children: crumb.label })
|
|
7216
7348
|
] }, i)) }),
|
|
@@ -7310,19 +7442,19 @@ function TripPage({
|
|
|
7310
7442
|
features,
|
|
7311
7443
|
className
|
|
7312
7444
|
}) {
|
|
7313
|
-
const [activeSection, setActiveSection] =
|
|
7314
|
-
const [navFloating, setNavFloating] =
|
|
7315
|
-
const [navHidden, setNavHidden] =
|
|
7316
|
-
const [isFloating, setIsFloating] =
|
|
7317
|
-
const [sidebarPos, setSidebarPos] =
|
|
7318
|
-
const [pricingBarVisible, setPricingBarVisible] =
|
|
7319
|
-
const navRef =
|
|
7320
|
-
const navSentinelRef =
|
|
7321
|
-
const sentinelRef =
|
|
7322
|
-
const sidebarPlaceholderRef =
|
|
7323
|
-
const pricingBarRef =
|
|
7324
|
-
const galleryRef =
|
|
7325
|
-
const sections =
|
|
7445
|
+
const [activeSection, setActiveSection] = React22__namespace.useState("");
|
|
7446
|
+
const [navFloating, setNavFloating] = React22__namespace.useState(false);
|
|
7447
|
+
const [navHidden, setNavHidden] = React22__namespace.useState(false);
|
|
7448
|
+
const [isFloating, setIsFloating] = React22__namespace.useState(false);
|
|
7449
|
+
const [sidebarPos, setSidebarPos] = React22__namespace.useState(null);
|
|
7450
|
+
const [pricingBarVisible, setPricingBarVisible] = React22__namespace.useState(false);
|
|
7451
|
+
const navRef = React22__namespace.useRef(null);
|
|
7452
|
+
const navSentinelRef = React22__namespace.useRef(null);
|
|
7453
|
+
const sentinelRef = React22__namespace.useRef(null);
|
|
7454
|
+
const sidebarPlaceholderRef = React22__namespace.useRef(null);
|
|
7455
|
+
const pricingBarRef = React22__namespace.useRef(null);
|
|
7456
|
+
const galleryRef = React22__namespace.useRef(null);
|
|
7457
|
+
const sections = React22__namespace.useMemo(
|
|
7326
7458
|
() => [
|
|
7327
7459
|
{ id: "key-info", label: "Key info", show: !!(infoGroups == null ? void 0 : infoGroups.length) },
|
|
7328
7460
|
{ id: "overview", label: "Overview", show: !!overview },
|
|
@@ -7337,7 +7469,7 @@ function TripPage({
|
|
|
7337
7469
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7338
7470
|
[]
|
|
7339
7471
|
);
|
|
7340
|
-
|
|
7472
|
+
React22__namespace.useEffect(() => {
|
|
7341
7473
|
const sentinel = navSentinelRef.current;
|
|
7342
7474
|
if (!sentinel) return;
|
|
7343
7475
|
const update = () => setNavFloating(sentinel.getBoundingClientRect().top < 1);
|
|
@@ -7345,7 +7477,7 @@ function TripPage({
|
|
|
7345
7477
|
update();
|
|
7346
7478
|
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
7347
7479
|
}, []);
|
|
7348
|
-
|
|
7480
|
+
React22__namespace.useEffect(() => {
|
|
7349
7481
|
const sentinel = sentinelRef.current;
|
|
7350
7482
|
if (!sentinel) return;
|
|
7351
7483
|
const update = () => setIsFloating(sentinel.getBoundingClientRect().top < 1);
|
|
@@ -7353,7 +7485,7 @@ function TripPage({
|
|
|
7353
7485
|
update();
|
|
7354
7486
|
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
7355
7487
|
}, []);
|
|
7356
|
-
|
|
7488
|
+
React22__namespace.useEffect(() => {
|
|
7357
7489
|
const measure = () => {
|
|
7358
7490
|
if (!sidebarPlaceholderRef.current) return;
|
|
7359
7491
|
const rect = sidebarPlaceholderRef.current.getBoundingClientRect();
|
|
@@ -7363,7 +7495,7 @@ function TripPage({
|
|
|
7363
7495
|
window.addEventListener("resize", measure);
|
|
7364
7496
|
return () => window.removeEventListener("resize", measure);
|
|
7365
7497
|
}, [isFloating]);
|
|
7366
|
-
|
|
7498
|
+
React22__namespace.useEffect(() => {
|
|
7367
7499
|
const check = () => {
|
|
7368
7500
|
var _a;
|
|
7369
7501
|
const target = (_a = galleryRef.current) != null ? _a : pricingBarRef.current;
|
|
@@ -7374,7 +7506,7 @@ function TripPage({
|
|
|
7374
7506
|
check();
|
|
7375
7507
|
return () => document.removeEventListener("scroll", check, { capture: true });
|
|
7376
7508
|
}, []);
|
|
7377
|
-
|
|
7509
|
+
React22__namespace.useEffect(() => {
|
|
7378
7510
|
const check = () => {
|
|
7379
7511
|
if (!pricingBarRef.current) return;
|
|
7380
7512
|
setNavHidden(pricingBarRef.current.getBoundingClientRect().top < window.innerHeight * 0.92);
|
|
@@ -7383,7 +7515,7 @@ function TripPage({
|
|
|
7383
7515
|
check();
|
|
7384
7516
|
return () => document.removeEventListener("scroll", check, { capture: true });
|
|
7385
7517
|
}, []);
|
|
7386
|
-
|
|
7518
|
+
React22__namespace.useEffect(() => {
|
|
7387
7519
|
if (sections.length === 0) return;
|
|
7388
7520
|
setActiveSection(sections[0].id);
|
|
7389
7521
|
const update = () => {
|
|
@@ -8100,21 +8232,21 @@ function LeadCapturePopup({
|
|
|
8100
8232
|
}) {
|
|
8101
8233
|
var _a;
|
|
8102
8234
|
const config = __spreadValues(__spreadValues({}, DEFAULTS), _config);
|
|
8103
|
-
const [open, setOpen] =
|
|
8104
|
-
const [closing, setClosing] =
|
|
8105
|
-
const [submitted, setSubmitted] =
|
|
8106
|
-
const [submitting, setSubmitting] =
|
|
8107
|
-
const [error, setError] =
|
|
8108
|
-
const [name, setName] =
|
|
8109
|
-
const [email, setEmail] =
|
|
8110
|
-
const [travelDate, setTravelDate] =
|
|
8111
|
-
const panelRef =
|
|
8112
|
-
const nameRef =
|
|
8113
|
-
const show =
|
|
8235
|
+
const [open, setOpen] = React22.useState(false);
|
|
8236
|
+
const [closing, setClosing] = React22.useState(false);
|
|
8237
|
+
const [submitted, setSubmitted] = React22.useState(false);
|
|
8238
|
+
const [submitting, setSubmitting] = React22.useState(false);
|
|
8239
|
+
const [error, setError] = React22.useState(null);
|
|
8240
|
+
const [name, setName] = React22.useState("");
|
|
8241
|
+
const [email, setEmail] = React22.useState("");
|
|
8242
|
+
const [travelDate, setTravelDate] = React22.useState("");
|
|
8243
|
+
const panelRef = React22.useRef(null);
|
|
8244
|
+
const nameRef = React22.useRef(null);
|
|
8245
|
+
const show = React22.useCallback(() => {
|
|
8114
8246
|
if (isDismissed()) return;
|
|
8115
8247
|
setOpen(true);
|
|
8116
8248
|
}, []);
|
|
8117
|
-
|
|
8249
|
+
React22.useEffect(() => {
|
|
8118
8250
|
var _a2;
|
|
8119
8251
|
if (isDismissed()) return;
|
|
8120
8252
|
if (config.trigger === "delay") {
|
|
@@ -8141,7 +8273,7 @@ function LeadCapturePopup({
|
|
|
8141
8273
|
return () => window.removeEventListener("scroll", handler);
|
|
8142
8274
|
}
|
|
8143
8275
|
}, [config.trigger, config.delaySeconds, config.scrollPercent, show]);
|
|
8144
|
-
|
|
8276
|
+
React22.useEffect(() => {
|
|
8145
8277
|
if (open && !submitted) {
|
|
8146
8278
|
requestAnimationFrame(() => {
|
|
8147
8279
|
var _a2;
|
|
@@ -8149,7 +8281,7 @@ function LeadCapturePopup({
|
|
|
8149
8281
|
});
|
|
8150
8282
|
}
|
|
8151
8283
|
}, [open, submitted]);
|
|
8152
|
-
const close =
|
|
8284
|
+
const close = React22.useCallback(() => {
|
|
8153
8285
|
setClosing(true);
|
|
8154
8286
|
setDismissed(config.dismissDays);
|
|
8155
8287
|
setTimeout(() => {
|
|
@@ -8157,7 +8289,7 @@ function LeadCapturePopup({
|
|
|
8157
8289
|
setClosing(false);
|
|
8158
8290
|
}, 250);
|
|
8159
8291
|
}, [config.dismissDays]);
|
|
8160
|
-
|
|
8292
|
+
React22.useEffect(() => {
|
|
8161
8293
|
if (!open) return;
|
|
8162
8294
|
const handler = (e) => {
|
|
8163
8295
|
if (e.key === "Escape") close();
|
|
@@ -8165,7 +8297,7 @@ function LeadCapturePopup({
|
|
|
8165
8297
|
document.addEventListener("keydown", handler);
|
|
8166
8298
|
return () => document.removeEventListener("keydown", handler);
|
|
8167
8299
|
}, [open, close]);
|
|
8168
|
-
const onOverlayClick =
|
|
8300
|
+
const onOverlayClick = React22.useCallback(
|
|
8169
8301
|
(e) => {
|
|
8170
8302
|
if (panelRef.current && !panelRef.current.contains(e.target)) {
|
|
8171
8303
|
close();
|
|
@@ -8421,6 +8553,7 @@ exports.Itinerary = Itinerary;
|
|
|
8421
8553
|
exports.LOGO_PLANETAEXO_DATA_URI = LOGO_PLANETAEXO_DATA_URI;
|
|
8422
8554
|
exports.LeadCapturePopup = LeadCapturePopup;
|
|
8423
8555
|
exports.MenuTrip = MenuTrip;
|
|
8556
|
+
exports.OTPCodeInput = OTPCodeInput;
|
|
8424
8557
|
exports.Offer = Offer;
|
|
8425
8558
|
exports.OfferAdventureCard = OfferAdventureCard;
|
|
8426
8559
|
exports.PaymentAmountSelector = PaymentAmountSelector;
|