@shophost/react 2.0.24 → 2.0.26
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/admin-client.cjs +1 -1
- package/admin-client.js +532 -522
- package/package.json +3 -3
- package/providers/organization-provider.d.ts +1 -0
package/admin-client.js
CHANGED
|
@@ -7,19 +7,19 @@ import R, { createContext as ve, useContext as le, useMemo as Se, useState as I,
|
|
|
7
7
|
import se, { Toaster as Nn } from "react-hot-toast";
|
|
8
8
|
import { inferAdditionalFields as Ur, organizationClient as Wr } from "better-auth/client/plugins";
|
|
9
9
|
import { createAuthClient as $r } from "better-auth/react";
|
|
10
|
-
import { useFormContext as _r, useFormState as
|
|
11
|
-
import { Search as Da, ChevronDown as Ke, Check as vt, MailIcon as Rn, XIcon as
|
|
10
|
+
import { useFormContext as _r, useFormState as Gt, useForm as de, FormProvider as Ge, useFieldArray as Ea } from "react-hook-form";
|
|
11
|
+
import { Search as Da, ChevronDown as Ke, Check as vt, MailIcon as Rn, XIcon as Kt, CloudUpload as Zt, Loader2 as Cn, Phone as qr, X as At, LanguagesIcon as Gr, ChevronLeft as Xt, ShoppingBasketIcon as Kr, UserIcon as Pn, CircleChevronRightIcon as Tn, PartyPopperIcon as Qn, AtSign as In, PlusCircleIcon as Ln, XCircleIcon as En, PlusIcon as je, CheckCircle as Yt, ArrowRight as Dn, EyeOffIcon as Xr, PencilIcon as Yr, Trash2 as es, TrashIcon as zn, BookCopyIcon as fr, CheckIcon as ts, HomeIcon as as, RadioIcon as rs, LogsIcon as ss, CalendarCheckIcon as is, PackageIcon as ns, BoxesIcon as os, FactoryIcon as ls, UserCircleIcon as Mn, ExternalLinkIcon as Bn } from "lucide-react";
|
|
12
12
|
import { upload as ds } from "@vercel/blob/client";
|
|
13
|
-
import
|
|
13
|
+
import he from "next/image.js";
|
|
14
14
|
import { useDebounce as Xe } from "use-debounce";
|
|
15
15
|
import x from "classnames";
|
|
16
16
|
import { withMask as Jn } from "use-mask-input";
|
|
17
17
|
import { Transition as cs, Dialog as On, TransitionChild as yr, DialogPanel as Fn } from "@headlessui/react";
|
|
18
18
|
import O from "next/link.js";
|
|
19
|
-
import { RiCloseLine as us, RiLoader2Fill as ps, RiSearchLine as za, RiEyeFill as ms, RiEyeOffFill as gs, RiGoogleFill as
|
|
20
|
-
import { useRouter as K, useSearchParams as
|
|
19
|
+
import { RiCloseLine as us, RiLoader2Fill as ps, RiSearchLine as za, RiEyeFill as ms, RiEyeOffFill as gs, RiGoogleFill as ea, RiArrowLeftSLine as Ut, RiArrowRightSLine as it, RiArrowLeftDoubleLine as hs, RiArrowRightDoubleLine as fs, RiCalendar2Fill as jn, RiSubtractFill as Vn, RiArrowDownSLine as Ma, RiArrowUpSLine as ys, RiCheckLine as ta, RiSettings5Line as Ba, RiRadioButtonFill as Hn, RiCheckboxBlankCircleLine as Zn, RiMoreFill as aa, RiMenuLine as Un, RiExpandUpDownLine as ws, RiSunLine as Wn, RiMoonLine as $n, RiComputerLine as _n, RiMore2Fill as qn } from "@remixicon/react";
|
|
20
|
+
import { useRouter as K, useSearchParams as ye, usePathname as nt, useParams as bs, notFound as _e } from "next/navigation.js";
|
|
21
21
|
import { zodResolver as ce } from "@hookform/resolvers/zod";
|
|
22
|
-
import { format as V, isValid as xs, isSameMonth as Gn, addYears as
|
|
22
|
+
import { format as V, isValid as xs, isSameMonth as Gn, addYears as Bt, subYears as wr, interval as Ot, eachDayOfInterval as Ss, subDays as Ra, isWithinInterval as br, formatDate as xr, toDate as ks } from "date-fns";
|
|
23
23
|
import { initClient as Kn } from "@shophost/client";
|
|
24
24
|
import { tv as Pe } from "tailwind-variants";
|
|
25
25
|
import vs from "clsx";
|
|
@@ -38,11 +38,11 @@ import * as Ns from "@radix-ui/react-label";
|
|
|
38
38
|
import * as Y from "@radix-ui/react-select";
|
|
39
39
|
import { z as g } from "@hono/zod-openapi";
|
|
40
40
|
import { Command as F } from "cmdk";
|
|
41
|
-
import * as
|
|
41
|
+
import * as ra from "react-phone-number-input";
|
|
42
42
|
import Rs from "react-phone-number-input/flags";
|
|
43
|
-
import * as
|
|
43
|
+
import * as Wt from "@radix-ui/react-switch";
|
|
44
44
|
import * as Oa from "@radix-ui/react-radio-group";
|
|
45
|
-
import * as
|
|
45
|
+
import * as $t from "@radix-ui/react-navigation-menu";
|
|
46
46
|
import { useReactTable as go, getSortedRowModel as ho, getCoreRowModel as fo, getFilteredRowModel as yo, flexRender as Nr, createColumnHelper as ot } from "@tanstack/react-table";
|
|
47
47
|
import * as ne from "@radix-ui/react-dropdown-menu";
|
|
48
48
|
const Cs = ve(null), Ps = ({ baseUrl: t, children: a }) => {
|
|
@@ -195,7 +195,7 @@ const Rr = "shophost-cart", Ao = {
|
|
|
195
195
|
if (!o || !o.modifiers) return "";
|
|
196
196
|
const l = ((p = (u = o.translations) == null ? void 0 : u.find((h) => h && h.locale === r)) == null ? void 0 : p.title) || (o.translations && o.translations.length > 0 ? (m = o.translations[0]) == null ? void 0 : m.title : "") || "", d = (n.modifiers || []).filter((h) => h).map((h) => {
|
|
197
197
|
const f = o.modifiers.find(
|
|
198
|
-
(
|
|
198
|
+
(S) => S && S.id === h.id
|
|
199
199
|
);
|
|
200
200
|
if (!f) return "";
|
|
201
201
|
const y = f.title || "", b = h.quantity || 1;
|
|
@@ -469,8 +469,8 @@ const zs = ve(
|
|
|
469
469
|
selectedProduct: f,
|
|
470
470
|
onModalAddToCart: y,
|
|
471
471
|
totalAmount: b,
|
|
472
|
-
itemCount:
|
|
473
|
-
removedItemsAlert:
|
|
472
|
+
itemCount: S,
|
|
473
|
+
removedItemsAlert: w
|
|
474
474
|
},
|
|
475
475
|
k
|
|
476
476
|
] = An(Es, Ao), v = Se(
|
|
@@ -481,7 +481,7 @@ const zs = ve(
|
|
|
481
481
|
isLoading: P,
|
|
482
482
|
isRefetching: _
|
|
483
483
|
} = G({
|
|
484
|
-
queryKey: ["cartProducts", v,
|
|
484
|
+
queryKey: ["cartProducts", v, S, c == null ? void 0 : c.id],
|
|
485
485
|
queryFn: async () => {
|
|
486
486
|
if (v.length === 0)
|
|
487
487
|
return {
|
|
@@ -586,7 +586,7 @@ const zs = ve(
|
|
|
586
586
|
removeItem: Z,
|
|
587
587
|
updateItemQuantity: ae,
|
|
588
588
|
clearCart: J,
|
|
589
|
-
itemCount:
|
|
589
|
+
itemCount: S,
|
|
590
590
|
totalAmount: b,
|
|
591
591
|
onCheckoutClick: Te,
|
|
592
592
|
openModifiersModal: We,
|
|
@@ -608,7 +608,7 @@ const zs = ve(
|
|
|
608
608
|
Z,
|
|
609
609
|
ae,
|
|
610
610
|
J,
|
|
611
|
-
|
|
611
|
+
S,
|
|
612
612
|
b,
|
|
613
613
|
Te,
|
|
614
614
|
We,
|
|
@@ -711,27 +711,27 @@ const zs = ve(
|
|
|
711
711
|
r(m), n(null);
|
|
712
712
|
}, [t]), l = j((m, h) => {
|
|
713
713
|
r((f) => {
|
|
714
|
-
const y = [...f], b = y.findIndex((
|
|
714
|
+
const y = [...f], b = y.findIndex((S) => S.groupId === m);
|
|
715
715
|
if (b === -1)
|
|
716
716
|
y.push({
|
|
717
717
|
groupId: m,
|
|
718
718
|
modifierIds: [h]
|
|
719
719
|
});
|
|
720
720
|
else {
|
|
721
|
-
const
|
|
722
|
-
|
|
723
|
-
...
|
|
724
|
-
modifierIds: [...
|
|
721
|
+
const S = y[b];
|
|
722
|
+
S.modifierIds.indexOf(h) === -1 ? y[b] = {
|
|
723
|
+
...S,
|
|
724
|
+
modifierIds: [...S.modifierIds, h]
|
|
725
725
|
} : y[b] = {
|
|
726
|
-
...
|
|
727
|
-
modifierIds:
|
|
726
|
+
...S,
|
|
727
|
+
modifierIds: S.modifierIds.filter((k) => k !== h)
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
730
|
return y;
|
|
731
731
|
}), n(null);
|
|
732
732
|
}, []), d = j((m, h) => {
|
|
733
733
|
r((f) => {
|
|
734
|
-
const y = [...f], b = y.findIndex((
|
|
734
|
+
const y = [...f], b = y.findIndex((S) => S.groupId === m);
|
|
735
735
|
return b === -1 ? y.push({
|
|
736
736
|
groupId: m,
|
|
737
737
|
modifierIds: [h]
|
|
@@ -783,7 +783,7 @@ const zs = ve(
|
|
|
783
783
|
validateSelections: f,
|
|
784
784
|
validationError: y,
|
|
785
785
|
getCartModifierGroups: b
|
|
786
|
-
} = Io(r || {}), { getProductName:
|
|
786
|
+
} = Io(r || {}), { getProductName: S, getModifierGroupName: w } = Qo(a);
|
|
787
787
|
X(() => {
|
|
788
788
|
r && (u(), c(1));
|
|
789
789
|
}, [r, u]);
|
|
@@ -824,12 +824,12 @@ const zs = ve(
|
|
|
824
824
|
isMultiSelect: ie,
|
|
825
825
|
toggleModifier: p,
|
|
826
826
|
selectModifier: m,
|
|
827
|
-
getModifierGroupName:
|
|
827
|
+
getModifierGroupName: w,
|
|
828
828
|
formatModifierPrice: ae,
|
|
829
829
|
locale: a
|
|
830
830
|
};
|
|
831
831
|
return /* @__PURE__ */ e(Ms.Provider, { value: Z, children: t });
|
|
832
|
-
},
|
|
832
|
+
}, sa = () => {
|
|
833
833
|
const t = le(Ms);
|
|
834
834
|
if (!t)
|
|
835
835
|
throw new Error("useModifiers must be used within a ModifiersProvider");
|
|
@@ -851,7 +851,7 @@ const zs = ve(
|
|
|
851
851
|
return !n || p ? i : l.length === 0 ? a : /* @__PURE__ */ e("div", { className: t || "flex-1 overflow-y-auto", children: u && l.map((m) => {
|
|
852
852
|
const h = u[m.productId];
|
|
853
853
|
if (!h) return null;
|
|
854
|
-
const f = () => d(m.productId, m.modifierGroups), y = (
|
|
854
|
+
const f = () => d(m.productId, m.modifierGroups), y = (S) => c(m.productId, S, m.modifierGroups), b = Ds(
|
|
855
855
|
m,
|
|
856
856
|
h,
|
|
857
857
|
n.configuration.defaultCurrency,
|
|
@@ -879,7 +879,7 @@ const zs = ve(
|
|
|
879
879
|
updateQuantity: l
|
|
880
880
|
}) => /* @__PURE__ */ e("div", { className: x("p-1 mb-3 transition-shadow"), children: /* @__PURE__ */ s("div", { className: "grid grid-cols-5", children: [
|
|
881
881
|
/* @__PURE__ */ e("div", { className: "shrink-0 w-full h-full mr-3 rounded-md overflow-hidden col-span-2", children: r ? /* @__PURE__ */ e(
|
|
882
|
-
|
|
882
|
+
he,
|
|
883
883
|
{
|
|
884
884
|
width: 100,
|
|
885
885
|
height: 100,
|
|
@@ -979,7 +979,7 @@ const zs = ve(
|
|
|
979
979
|
renderHeader: m,
|
|
980
980
|
renderItem: h = Mo
|
|
981
981
|
}) => {
|
|
982
|
-
const { itemCount: f, total: y, locale: b } = Va(), { organization:
|
|
982
|
+
const { itemCount: f, total: y, locale: b } = Va(), { organization: S } = ze(), w = (S == null ? void 0 : S.configuration.defaultCurrency) ?? "USD", k = Ne(y, w, b), v = {
|
|
983
983
|
checkoutHref: t,
|
|
984
984
|
checkoutLabel: a,
|
|
985
985
|
close: l ?? (() => {
|
|
@@ -1036,13 +1036,13 @@ const zs = ve(
|
|
|
1036
1036
|
renderFooter: u,
|
|
1037
1037
|
renderItem: p
|
|
1038
1038
|
}) => {
|
|
1039
|
-
const m = Hr(null), [h, f] = I(null), [y, b] = I(null),
|
|
1039
|
+
const m = Hr(null), [h, f] = I(null), [y, b] = I(null), S = 50, w = (A) => {
|
|
1040
1040
|
b(null), f(A.targetTouches[0].clientY);
|
|
1041
1041
|
}, k = (A) => {
|
|
1042
1042
|
b(A.targetTouches[0].clientY);
|
|
1043
1043
|
}, v = () => {
|
|
1044
1044
|
if (!h || !y) return;
|
|
1045
|
-
y - h >
|
|
1045
|
+
y - h > S && a(), f(null), b(null);
|
|
1046
1046
|
};
|
|
1047
1047
|
return /* @__PURE__ */ s(C, { children: [
|
|
1048
1048
|
t && /* @__PURE__ */ e(
|
|
@@ -1076,7 +1076,7 @@ const zs = ve(
|
|
|
1076
1076
|
{
|
|
1077
1077
|
className: "h-full",
|
|
1078
1078
|
ref: m,
|
|
1079
|
-
onTouchStart:
|
|
1079
|
+
onTouchStart: w,
|
|
1080
1080
|
onTouchMove: k,
|
|
1081
1081
|
onTouchEnd: v,
|
|
1082
1082
|
children: /* @__PURE__ */ e(
|
|
@@ -1123,7 +1123,7 @@ const zs = ve(
|
|
|
1123
1123
|
path: ["translations", o, l]
|
|
1124
1124
|
});
|
|
1125
1125
|
});
|
|
1126
|
-
},
|
|
1126
|
+
}, ia = /* @__PURE__ */ new Map([
|
|
1127
1127
|
["af", "Afrikaans"],
|
|
1128
1128
|
["sq", "Albanian"],
|
|
1129
1129
|
["ar_dz", "Arabic (Algeria)"],
|
|
@@ -1237,7 +1237,7 @@ const zs = ve(
|
|
|
1237
1237
|
["cy", "Welsh"],
|
|
1238
1238
|
["ji", "Yiddish"],
|
|
1239
1239
|
["zu", "Zulu"]
|
|
1240
|
-
]), Cr = Array.from(
|
|
1240
|
+
]), Cr = Array.from(ia.entries()).map(
|
|
1241
1241
|
([t, a]) => ({ value: t, label: a })
|
|
1242
1242
|
), Oe = g.enum([
|
|
1243
1243
|
"af",
|
|
@@ -1365,7 +1365,7 @@ const zs = ve(
|
|
|
1365
1365
|
g.number().nonnegative({ message: "This field must be a positive number" }).nullable().refine((t) => t === null || t >= 0, {
|
|
1366
1366
|
message: "Price must be positive"
|
|
1367
1367
|
})
|
|
1368
|
-
),
|
|
1368
|
+
), _t = g.coerce.number().min(0.1, "This field must be positive").refine((t) => /^\d+(\.\d{1,2})?$/.test(t.toString()), {
|
|
1369
1369
|
message: "This field can have a maximum of two decimal points"
|
|
1370
1370
|
}), Jo = g.object({
|
|
1371
1371
|
type: g.literal("blob.generate-client-token"),
|
|
@@ -1436,7 +1436,7 @@ const Ve = g.object({
|
|
|
1436
1436
|
example: "example.png",
|
|
1437
1437
|
description: "Name of the file"
|
|
1438
1438
|
})
|
|
1439
|
-
}).openapi("UploadedFile"),
|
|
1439
|
+
}).openapi("UploadedFile"), na = g.object({
|
|
1440
1440
|
id: g.string().openapi({
|
|
1441
1441
|
example: "clf9876543210abcdef",
|
|
1442
1442
|
description: "ID of the product category"
|
|
@@ -1471,13 +1471,13 @@ const Ve = g.object({
|
|
|
1471
1471
|
description: "List of translations for the product category"
|
|
1472
1472
|
})
|
|
1473
1473
|
}).openapi("ProductCategory");
|
|
1474
|
-
|
|
1474
|
+
na.omit({
|
|
1475
1475
|
translations: !0
|
|
1476
1476
|
}).extend({
|
|
1477
1477
|
title: g.string().default(""),
|
|
1478
1478
|
description: g.string().default("")
|
|
1479
1479
|
}).openapi("LocalizedProductCategory");
|
|
1480
|
-
const Fo =
|
|
1480
|
+
const Fo = na.pick({
|
|
1481
1481
|
slug: !0,
|
|
1482
1482
|
image: !0,
|
|
1483
1483
|
translations: !0
|
|
@@ -1488,7 +1488,7 @@ const Fo = oa.pick({
|
|
|
1488
1488
|
imageId: g.string().cuid().optional().openapi({
|
|
1489
1489
|
description: "ID of the image for the product category"
|
|
1490
1490
|
})
|
|
1491
|
-
}).superRefine(lt("title")).openapi("CreateProductCategory"), jo =
|
|
1491
|
+
}).superRefine(lt("title")).openapi("CreateProductCategory"), jo = na.pick({
|
|
1492
1492
|
slug: !0,
|
|
1493
1493
|
image: !0,
|
|
1494
1494
|
translations: !0
|
|
@@ -1584,7 +1584,7 @@ const Fo = oa.pick({
|
|
|
1584
1584
|
example: "PRM-WATCH-01",
|
|
1585
1585
|
description: "Stock Keeping Unit identifier"
|
|
1586
1586
|
}),
|
|
1587
|
-
basePrice:
|
|
1587
|
+
basePrice: _t,
|
|
1588
1588
|
discountedBasePrice: Js,
|
|
1589
1589
|
currency: g.string().openapi({
|
|
1590
1590
|
example: "USD",
|
|
@@ -1596,7 +1596,7 @@ const Fo = oa.pick({
|
|
|
1596
1596
|
modifierGroups: g.array(Fs).optional().openapi({
|
|
1597
1597
|
description: "List of product modifier groups"
|
|
1598
1598
|
}),
|
|
1599
|
-
categories: g.array(
|
|
1599
|
+
categories: g.array(na).openapi({
|
|
1600
1600
|
example: ["cju0z9k4z0000l1qg5z1z1z"],
|
|
1601
1601
|
description: "IDs of associated product categories"
|
|
1602
1602
|
}),
|
|
@@ -1863,7 +1863,7 @@ const dt = g.object({
|
|
|
1863
1863
|
example: "Leave at the door",
|
|
1864
1864
|
description: "Delivery instructions for the address"
|
|
1865
1865
|
})
|
|
1866
|
-
}).openapi("Address"),
|
|
1866
|
+
}).openapi("Address"), oa = dt.pick({
|
|
1867
1867
|
addressLineOne: !0,
|
|
1868
1868
|
doorNumber: !0,
|
|
1869
1869
|
addressLineTwo: !0,
|
|
@@ -1871,7 +1871,7 @@ const dt = g.object({
|
|
|
1871
1871
|
city: !0,
|
|
1872
1872
|
country: !0,
|
|
1873
1873
|
placeId: !0
|
|
1874
|
-
}).openapi("CreateAddress"), Us =
|
|
1874
|
+
}).openapi("CreateAddress"), Us = oa.partial().openapi("UpdateAddress"), $o = dt.extend({
|
|
1875
1875
|
firstname: g.string().min(2, "First Name must be at least 2 characters").openapi({
|
|
1876
1876
|
example: "John",
|
|
1877
1877
|
description: "The first name of the recipient"
|
|
@@ -2014,11 +2014,11 @@ const Go = g.object({
|
|
|
2014
2014
|
example: "Zone 1",
|
|
2015
2015
|
description: "Title of the shipping zone"
|
|
2016
2016
|
}),
|
|
2017
|
-
distanceUpto:
|
|
2017
|
+
distanceUpto: _t.openapi({
|
|
2018
2018
|
example: 10,
|
|
2019
2019
|
description: "Ending distance for the shipping zone"
|
|
2020
2020
|
}),
|
|
2021
|
-
price:
|
|
2021
|
+
price: _t.openapi({
|
|
2022
2022
|
example: 5.99,
|
|
2023
2023
|
description: "Price for shipping in this zone"
|
|
2024
2024
|
}),
|
|
@@ -2340,7 +2340,7 @@ const Tr = g.object({
|
|
|
2340
2340
|
example: "clm1234567890abcdef",
|
|
2341
2341
|
description: "The unique identifier of the thumbnail image associated with the organization"
|
|
2342
2342
|
}),
|
|
2343
|
-
address:
|
|
2343
|
+
address: oa
|
|
2344
2344
|
}).openapi("CreateOrganization"), Wa = Ks.extend({
|
|
2345
2345
|
address: Us,
|
|
2346
2346
|
configuration: el
|
|
@@ -2483,7 +2483,7 @@ g.object({
|
|
|
2483
2483
|
example: "+48123456789",
|
|
2484
2484
|
description: "The phone number of the legal entity"
|
|
2485
2485
|
}),
|
|
2486
|
-
address:
|
|
2486
|
+
address: oa.required().openapi({
|
|
2487
2487
|
description: "The address of the legal entity"
|
|
2488
2488
|
})
|
|
2489
2489
|
}).openapi("CreateLegalEntity");
|
|
@@ -2536,7 +2536,7 @@ const il = g.object({
|
|
|
2536
2536
|
email: !0,
|
|
2537
2537
|
phone: !0
|
|
2538
2538
|
}).extend({
|
|
2539
|
-
address:
|
|
2539
|
+
address: oa
|
|
2540
2540
|
}).openapi("Customer");
|
|
2541
2541
|
nl.partial().openapi("UpdateCustomer");
|
|
2542
2542
|
const $a = g.object({
|
|
@@ -2628,7 +2628,7 @@ const ll = g.object({
|
|
|
2628
2628
|
description: "Customer's last name",
|
|
2629
2629
|
example: "Doe"
|
|
2630
2630
|
}),
|
|
2631
|
-
guests:
|
|
2631
|
+
guests: _t,
|
|
2632
2632
|
phone: g.string().openapi({
|
|
2633
2633
|
description: "Customer's phone number",
|
|
2634
2634
|
example: "+1234567890"
|
|
@@ -2874,8 +2874,8 @@ const Qr = [
|
|
|
2874
2874
|
{ value: "ET", label: "Ethiopia", flag: "🇪🇹" }
|
|
2875
2875
|
]
|
|
2876
2876
|
}
|
|
2877
|
-
],
|
|
2878
|
-
|
|
2877
|
+
], la = (t) => /* @__PURE__ */ e(H.Root, { ...t });
|
|
2878
|
+
la.displayName = "Dialog";
|
|
2879
2879
|
const pl = H.Trigger;
|
|
2880
2880
|
pl.displayName = "DialogTrigger";
|
|
2881
2881
|
const ml = H.Close;
|
|
@@ -2899,7 +2899,7 @@ const ti = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
2899
2899
|
}
|
|
2900
2900
|
));
|
|
2901
2901
|
ti.displayName = "DialogOverlay";
|
|
2902
|
-
const
|
|
2902
|
+
const da = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(ei, { children: /* @__PURE__ */ e(ti, { children: /* @__PURE__ */ e(
|
|
2903
2903
|
H.Content,
|
|
2904
2904
|
{
|
|
2905
2905
|
ref: r,
|
|
@@ -2918,7 +2918,7 @@ const ca = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(ei, { c
|
|
|
2918
2918
|
...a
|
|
2919
2919
|
}
|
|
2920
2920
|
) }) }));
|
|
2921
|
-
|
|
2921
|
+
da.displayName = "DialogContent";
|
|
2922
2922
|
const ai = ({
|
|
2923
2923
|
className: t,
|
|
2924
2924
|
...a
|
|
@@ -2962,7 +2962,7 @@ const hl = ({
|
|
|
2962
2962
|
}
|
|
2963
2963
|
);
|
|
2964
2964
|
hl.displayName = "DialogFooter";
|
|
2965
|
-
const
|
|
2965
|
+
const ca = N.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
2966
2966
|
F,
|
|
2967
2967
|
{
|
|
2968
2968
|
ref: r,
|
|
@@ -2973,8 +2973,8 @@ const ua = N.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
2973
2973
|
...a
|
|
2974
2974
|
}
|
|
2975
2975
|
));
|
|
2976
|
-
|
|
2977
|
-
const Nu = ({ children: t, ...a }) => /* @__PURE__ */ e(
|
|
2976
|
+
ca.displayName = F.displayName;
|
|
2977
|
+
const Nu = ({ children: t, ...a }) => /* @__PURE__ */ e(la, { ...a, children: /* @__PURE__ */ e(da, { className: "overflow-hidden p-0", children: /* @__PURE__ */ e(ca, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: t }) }) }), qa = N.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ s("div", { className: "flex items-center border-b pl-3", "cmdk-input-wrapper": "", children: [
|
|
2978
2978
|
/* @__PURE__ */ e(Da, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
2979
2979
|
/* @__PURE__ */ e(
|
|
2980
2980
|
F.Input,
|
|
@@ -3149,7 +3149,7 @@ const xl = ({
|
|
|
3149
3149
|
{
|
|
3150
3150
|
className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50",
|
|
3151
3151
|
align: "start",
|
|
3152
|
-
children: /* @__PURE__ */ s(
|
|
3152
|
+
children: /* @__PURE__ */ s(ca, { className: "p-0", children: [
|
|
3153
3153
|
/* @__PURE__ */ e(
|
|
3154
3154
|
qa,
|
|
3155
3155
|
{
|
|
@@ -3344,11 +3344,11 @@ const kl = ({ ...t }) => {
|
|
|
3344
3344
|
{
|
|
3345
3345
|
className: "absolute w-6 h-6 bg-black flex items-center justify-center rounded-md right-1 top-1",
|
|
3346
3346
|
onClick: () => c(m.id),
|
|
3347
|
-
children: /* @__PURE__ */ e(
|
|
3347
|
+
children: /* @__PURE__ */ e(Kt, { className: "w-4 h-4 text-white" })
|
|
3348
3348
|
}
|
|
3349
3349
|
),
|
|
3350
3350
|
/* @__PURE__ */ e(
|
|
3351
|
-
|
|
3351
|
+
he,
|
|
3352
3352
|
{
|
|
3353
3353
|
src: m.url,
|
|
3354
3354
|
alt: m.filename,
|
|
@@ -3381,7 +3381,7 @@ const kl = ({ ...t }) => {
|
|
|
3381
3381
|
"%)"
|
|
3382
3382
|
] })
|
|
3383
3383
|
] }) : /* @__PURE__ */ s(C, { children: [
|
|
3384
|
-
/* @__PURE__ */ e(
|
|
3384
|
+
/* @__PURE__ */ e(Zt, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }),
|
|
3385
3385
|
/* @__PURE__ */ e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })
|
|
3386
3386
|
] }) }),
|
|
3387
3387
|
/* @__PURE__ */ e(
|
|
@@ -3419,7 +3419,7 @@ const kl = ({ ...t }) => {
|
|
|
3419
3419
|
"%)"
|
|
3420
3420
|
] })
|
|
3421
3421
|
] }) : /* @__PURE__ */ s(C, { children: [
|
|
3422
|
-
/* @__PURE__ */ e(
|
|
3422
|
+
/* @__PURE__ */ e(Zt, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }),
|
|
3423
3423
|
/* @__PURE__ */ e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })
|
|
3424
3424
|
] }) }),
|
|
3425
3425
|
/* @__PURE__ */ e(
|
|
@@ -3455,25 +3455,25 @@ const kl = ({ ...t }) => {
|
|
|
3455
3455
|
queryKey: ["autocomplete", h],
|
|
3456
3456
|
queryFn: async () => {
|
|
3457
3457
|
if (!h || h.length < 2) return [];
|
|
3458
|
-
const
|
|
3458
|
+
const w = await i.location.getPredictions({
|
|
3459
3459
|
query: {
|
|
3460
3460
|
query: h
|
|
3461
3461
|
}
|
|
3462
3462
|
});
|
|
3463
|
-
if (
|
|
3463
|
+
if (w.status !== 200)
|
|
3464
3464
|
throw new Error("Failed to fetch predictions");
|
|
3465
|
-
return Array.isArray(
|
|
3465
|
+
return Array.isArray(w.body) ? w.body : (console.warn("API did not return an array:", w.body), []);
|
|
3466
3466
|
},
|
|
3467
3467
|
enabled: h.length >= 2,
|
|
3468
3468
|
refetchOnWindowFocus: !1
|
|
3469
3469
|
// Don't refetch on window focus
|
|
3470
|
-
}),
|
|
3471
|
-
p(
|
|
3470
|
+
}), S = (w) => {
|
|
3471
|
+
p(w), c(w.text);
|
|
3472
3472
|
const k = {
|
|
3473
|
-
placeId:
|
|
3474
|
-
text:
|
|
3475
|
-
addressLineOne:
|
|
3476
|
-
addressLineTwo:
|
|
3473
|
+
placeId: w.placeId,
|
|
3474
|
+
text: w.text,
|
|
3475
|
+
addressLineOne: w.addressLineOne,
|
|
3476
|
+
addressLineTwo: w.addressLineTwo
|
|
3477
3477
|
};
|
|
3478
3478
|
a(k), l(!1);
|
|
3479
3479
|
};
|
|
@@ -3519,8 +3519,8 @@ const kl = ({ ...t }) => {
|
|
|
3519
3519
|
placeholder: "Search places...",
|
|
3520
3520
|
className: "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
3521
3521
|
value: d,
|
|
3522
|
-
onChange: (
|
|
3523
|
-
c(
|
|
3522
|
+
onChange: (w) => {
|
|
3523
|
+
c(w.target.value), w.target.value.length >= 2 && l(!0);
|
|
3524
3524
|
}
|
|
3525
3525
|
}
|
|
3526
3526
|
)
|
|
@@ -3538,20 +3538,20 @@ const kl = ({ ...t }) => {
|
|
|
3538
3538
|
f.length,
|
|
3539
3539
|
" results"
|
|
3540
3540
|
] }),
|
|
3541
|
-
f.map((
|
|
3541
|
+
f.map((w, k) => /* @__PURE__ */ s(
|
|
3542
3542
|
"div",
|
|
3543
3543
|
{
|
|
3544
3544
|
className: "relative flex cursor-pointer select-none items-center rounded-xs px-2 py-2 text-sm outline-hidden hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
3545
|
-
onClick: () => w
|
|
3545
|
+
onClick: () => S(w),
|
|
3546
3546
|
children: [
|
|
3547
3547
|
/* @__PURE__ */ s("div", { className: "flex flex-col grow", children: [
|
|
3548
|
-
/* @__PURE__ */ e("span", { children:
|
|
3549
|
-
|
|
3548
|
+
/* @__PURE__ */ e("span", { children: w.addressLineOne || w.text }),
|
|
3549
|
+
w.addressLineTwo && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: w.addressLineTwo })
|
|
3550
3550
|
] }),
|
|
3551
|
-
(u == null ? void 0 : u.placeId) ===
|
|
3551
|
+
(u == null ? void 0 : u.placeId) === w.placeId && /* @__PURE__ */ e(vt, { size: 16, strokeWidth: 2, className: "ml-auto" })
|
|
3552
3552
|
]
|
|
3553
3553
|
},
|
|
3554
|
-
`${
|
|
3554
|
+
`${w.placeId || "place"}-${k}`
|
|
3555
3555
|
))
|
|
3556
3556
|
] })
|
|
3557
3557
|
] })
|
|
@@ -3601,7 +3601,7 @@ const Al = ({
|
|
|
3601
3601
|
i.filter((o) => o.value).map((o, l) => /* @__PURE__ */ s("option", { value: o.value, children: [
|
|
3602
3602
|
o.label,
|
|
3603
3603
|
" ",
|
|
3604
|
-
o.value && `+${
|
|
3604
|
+
o.value && `+${ra.getCountryCallingCode(o.value)}`
|
|
3605
3605
|
] }, o.value ?? `empty-${l}`))
|
|
3606
3606
|
]
|
|
3607
3607
|
}
|
|
@@ -3616,7 +3616,7 @@ const Al = ({
|
|
|
3616
3616
|
}) => {
|
|
3617
3617
|
const i = De();
|
|
3618
3618
|
return /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(
|
|
3619
|
-
|
|
3619
|
+
ra.default,
|
|
3620
3620
|
{
|
|
3621
3621
|
id: i,
|
|
3622
3622
|
className: "flex rounded-lg shadow-2xs shadow-black/5",
|
|
@@ -3702,7 +3702,7 @@ const Al = ({
|
|
|
3702
3702
|
{
|
|
3703
3703
|
className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0",
|
|
3704
3704
|
align: "start",
|
|
3705
|
-
children: /* @__PURE__ */ s(
|
|
3705
|
+
children: /* @__PURE__ */ s(ca, { className: "p-0", children: [
|
|
3706
3706
|
/* @__PURE__ */ e(
|
|
3707
3707
|
qa,
|
|
3708
3708
|
{
|
|
@@ -3785,12 +3785,12 @@ const Al = ({
|
|
|
3785
3785
|
}), ii = R.forwardRef(({ className: t, size: a, ...r }, i) => {
|
|
3786
3786
|
const { root: n, thumb: o } = Cl({ size: a });
|
|
3787
3787
|
return /* @__PURE__ */ e(
|
|
3788
|
-
|
|
3788
|
+
Wt.Root,
|
|
3789
3789
|
{
|
|
3790
3790
|
ref: i,
|
|
3791
3791
|
className: x(n(), t),
|
|
3792
3792
|
...r,
|
|
3793
|
-
children: /* @__PURE__ */ e(
|
|
3793
|
+
children: /* @__PURE__ */ e(Wt.Thumb, { className: x(o()) })
|
|
3794
3794
|
}
|
|
3795
3795
|
);
|
|
3796
3796
|
});
|
|
@@ -3850,47 +3850,47 @@ const Pl = ({
|
|
|
3850
3850
|
disabled: r
|
|
3851
3851
|
}) => {
|
|
3852
3852
|
const i = () => {
|
|
3853
|
-
const
|
|
3854
|
-
return
|
|
3853
|
+
const S = /* @__PURE__ */ new Date(), w = new Date(S);
|
|
3854
|
+
return w.setMinutes(S.getMinutes() + 30), w;
|
|
3855
3855
|
}, n = Se(() => {
|
|
3856
|
-
const
|
|
3856
|
+
const S = [], w = /* @__PURE__ */ new Date();
|
|
3857
3857
|
for (let k = 0; k < 7; k++) {
|
|
3858
|
-
const v = new Date(
|
|
3859
|
-
v.setDate(
|
|
3858
|
+
const v = new Date(w);
|
|
3859
|
+
v.setDate(w.getDate() + k), v.setHours(0, 0, 0, 0), S.push(v);
|
|
3860
3860
|
}
|
|
3861
|
-
return
|
|
3862
|
-
}, []), o = (
|
|
3863
|
-
const
|
|
3864
|
-
if (!(
|
|
3865
|
-
if (
|
|
3861
|
+
return S;
|
|
3862
|
+
}, []), o = (S) => {
|
|
3863
|
+
const w = i();
|
|
3864
|
+
if (!(S.toDateString() === (/* @__PURE__ */ new Date()).toDateString())) return !0;
|
|
3865
|
+
if (w.getHours() >= 21 && w.getMinutes() > 0)
|
|
3866
3866
|
return !1;
|
|
3867
3867
|
for (let v = 11; v <= 21; v++) {
|
|
3868
|
-
const A = new Date(
|
|
3869
|
-
if (A.setHours(v, 0, 0, 0), A >
|
|
3868
|
+
const A = new Date(S);
|
|
3869
|
+
if (A.setHours(v, 0, 0, 0), A > w)
|
|
3870
3870
|
return !0;
|
|
3871
3871
|
}
|
|
3872
3872
|
return !1;
|
|
3873
|
-
}, l = (
|
|
3873
|
+
}, l = (S) => !o(S), d = Se(() => n.find((S) => !l(S)) || null, [n]), [c, u] = I(
|
|
3874
3874
|
t || d
|
|
3875
3875
|
), [p, m] = I(
|
|
3876
3876
|
t ? `${t.getHours()}:${t.getMinutes() === 0 ? "00" : t.getMinutes()}` : null
|
|
3877
3877
|
), h = Se(() => {
|
|
3878
3878
|
if (!c) return [];
|
|
3879
|
-
const
|
|
3879
|
+
const S = [], w = i(), k = c.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
3880
3880
|
for (let v = 11; v <= 21; v++) {
|
|
3881
3881
|
const A = new Date(c);
|
|
3882
|
-
A.setHours(v, 0, 0, 0), (!k || A >
|
|
3882
|
+
A.setHours(v, 0, 0, 0), (!k || A > w) && S.push(`${v}:00`);
|
|
3883
3883
|
}
|
|
3884
|
-
return
|
|
3885
|
-
}, [c]), f = (
|
|
3886
|
-
const
|
|
3887
|
-
return { weekday:
|
|
3888
|
-
}, y = (
|
|
3889
|
-
u(
|
|
3890
|
-
}, b = (
|
|
3891
|
-
if (m(
|
|
3892
|
-
const [
|
|
3893
|
-
k.setHours(
|
|
3884
|
+
return S;
|
|
3885
|
+
}, [c]), f = (S) => {
|
|
3886
|
+
const w = S.toLocaleDateString("en-US", { weekday: "short" }), k = S.toLocaleDateString("en-US", { month: "short" }), v = S.getDate();
|
|
3887
|
+
return { weekday: w, month: k, day: v };
|
|
3888
|
+
}, y = (S) => {
|
|
3889
|
+
u(S), m(null);
|
|
3890
|
+
}, b = (S) => {
|
|
3891
|
+
if (m(S), c) {
|
|
3892
|
+
const [w] = S.split(":").map(Number), k = new Date(c);
|
|
3893
|
+
k.setHours(w, 0, 0, 0), a(k);
|
|
3894
3894
|
}
|
|
3895
3895
|
};
|
|
3896
3896
|
return X(() => {
|
|
@@ -3898,36 +3898,36 @@ const Pl = ({
|
|
|
3898
3898
|
}, []), /* @__PURE__ */ s("div", { className: "mt-2", children: [
|
|
3899
3899
|
/* @__PURE__ */ s("div", { className: "col-span-4 mt-4", children: [
|
|
3900
3900
|
/* @__PURE__ */ e(Re, { htmlFor: "date", children: "Select Date" }),
|
|
3901
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-2 mt-2", children: n.map((
|
|
3902
|
-
const { weekday: k, month: v, day: A } = f(
|
|
3901
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-2 mt-2", children: n.map((S, w) => {
|
|
3902
|
+
const { weekday: k, month: v, day: A } = f(S), P = l(S);
|
|
3903
3903
|
return /* @__PURE__ */ e(
|
|
3904
3904
|
"button",
|
|
3905
3905
|
{
|
|
3906
3906
|
type: "button",
|
|
3907
3907
|
disabled: P,
|
|
3908
|
-
className: `p-2 text-center border rounded-md ${P ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} ${c && c.toDateString() ===
|
|
3909
|
-
onClick: () => !P && y(
|
|
3908
|
+
className: `p-2 text-center border rounded-md ${P ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} ${c && c.toDateString() === S.toDateString() ? "bg-teal-500 text-white" : "bg-white hover:bg-gray-100"}`,
|
|
3909
|
+
onClick: () => !P && y(S),
|
|
3910
3910
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center", children: [
|
|
3911
3911
|
/* @__PURE__ */ e("span", { className: "text-xs font-medium", children: k }),
|
|
3912
3912
|
/* @__PURE__ */ e("span", { className: "text-xl font-black font-red-hat-display", children: A }),
|
|
3913
3913
|
/* @__PURE__ */ e("span", { className: "text-xs font-medium", children: v })
|
|
3914
3914
|
] })
|
|
3915
3915
|
},
|
|
3916
|
-
|
|
3916
|
+
w
|
|
3917
3917
|
);
|
|
3918
3918
|
}) })
|
|
3919
3919
|
] }),
|
|
3920
3920
|
c && h.length > 0 && /* @__PURE__ */ s("div", { className: "col-span-4 mt-4", children: [
|
|
3921
3921
|
/* @__PURE__ */ e(Re, { htmlFor: "time", children: "Select Time" }),
|
|
3922
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2 mt-2", children: h.map((
|
|
3922
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2 mt-2", children: h.map((S, w) => /* @__PURE__ */ e(
|
|
3923
3923
|
"button",
|
|
3924
3924
|
{
|
|
3925
3925
|
type: "button",
|
|
3926
|
-
className: `p-2 text-sm text-center border rounded-md font-medium cursor-pointer ${p ===
|
|
3927
|
-
onClick: () => b(
|
|
3928
|
-
children:
|
|
3926
|
+
className: `p-2 text-sm text-center border rounded-md font-medium cursor-pointer ${p === S ? "bg-teal-500 text-white" : "bg-white hover:bg-gray-100"}`,
|
|
3927
|
+
onClick: () => b(S),
|
|
3928
|
+
children: S
|
|
3929
3929
|
},
|
|
3930
|
-
|
|
3930
|
+
w
|
|
3931
3931
|
)) })
|
|
3932
3932
|
] })
|
|
3933
3933
|
] });
|
|
@@ -4032,7 +4032,7 @@ const Pl = ({
|
|
|
4032
4032
|
}, Ql = (t, a) => !t || typeof t != "object" ? void 0 : a ? a.replace(/\[/g, ".").replace(/\]/g, "").split(".").filter(Boolean).reduce((i, n) => {
|
|
4033
4033
|
if (i != null)
|
|
4034
4034
|
return i[n];
|
|
4035
|
-
}, t) : t,
|
|
4035
|
+
}, t) : t, ge = ({
|
|
4036
4036
|
type: t = "text",
|
|
4037
4037
|
name: a,
|
|
4038
4038
|
label: r,
|
|
@@ -4045,7 +4045,7 @@ const Pl = ({
|
|
|
4045
4045
|
prefix: u,
|
|
4046
4046
|
disabled: p
|
|
4047
4047
|
}) => {
|
|
4048
|
-
const { errors: m } =
|
|
4048
|
+
const { errors: m } = Gt(), h = Ql(m, a);
|
|
4049
4049
|
return /* @__PURE__ */ s("div", { className: x("w-full", i), children: [
|
|
4050
4050
|
typeof r == "string" && /* @__PURE__ */ s(
|
|
4051
4051
|
Re,
|
|
@@ -4058,7 +4058,7 @@ const Pl = ({
|
|
|
4058
4058
|
c && /* @__PURE__ */ e(Gr, { className: "w-4 h-4 ml-1 text-gray-500" })
|
|
4059
4059
|
] }),
|
|
4060
4060
|
n && c && /* @__PURE__ */ s("span", { className: "flex items-center text-xs text-gray-500 ml-1 bg-gray-100 px-1 py-0.5 rounded-sm", children: [
|
|
4061
|
-
|
|
4061
|
+
ia.get(n),
|
|
4062
4062
|
" (",
|
|
4063
4063
|
n,
|
|
4064
4064
|
")"
|
|
@@ -4483,7 +4483,7 @@ const Ol = ({
|
|
|
4483
4483
|
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ e(Ge, { ...o, children: /* @__PURE__ */ s("form", { onSubmit: o.handleSubmit(p), children: [
|
|
4484
4484
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [
|
|
4485
4485
|
/* @__PURE__ */ e(
|
|
4486
|
-
|
|
4486
|
+
ge,
|
|
4487
4487
|
{
|
|
4488
4488
|
name: "firstname",
|
|
4489
4489
|
label: "First Name",
|
|
@@ -4493,7 +4493,7 @@ const Ol = ({
|
|
|
4493
4493
|
}
|
|
4494
4494
|
),
|
|
4495
4495
|
/* @__PURE__ */ e(
|
|
4496
|
-
|
|
4496
|
+
ge,
|
|
4497
4497
|
{
|
|
4498
4498
|
name: "lastname",
|
|
4499
4499
|
label: "Last Name",
|
|
@@ -4503,7 +4503,7 @@ const Ol = ({
|
|
|
4503
4503
|
}
|
|
4504
4504
|
),
|
|
4505
4505
|
/* @__PURE__ */ e(
|
|
4506
|
-
|
|
4506
|
+
ge,
|
|
4507
4507
|
{
|
|
4508
4508
|
name: "phone",
|
|
4509
4509
|
label: "Phone",
|
|
@@ -4539,7 +4539,7 @@ const Ol = ({
|
|
|
4539
4539
|
o.formState.errors.addressLineOne && /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-red-500", children: String(o.formState.errors.addressLineOne.message ?? "") })
|
|
4540
4540
|
] }),
|
|
4541
4541
|
/* @__PURE__ */ e(
|
|
4542
|
-
|
|
4542
|
+
ge,
|
|
4543
4543
|
{
|
|
4544
4544
|
name: "doorNumber",
|
|
4545
4545
|
label: "Door Number",
|
|
@@ -4549,7 +4549,7 @@ const Ol = ({
|
|
|
4549
4549
|
}
|
|
4550
4550
|
),
|
|
4551
4551
|
/* @__PURE__ */ e(
|
|
4552
|
-
|
|
4552
|
+
ge,
|
|
4553
4553
|
{
|
|
4554
4554
|
name: "zipCode",
|
|
4555
4555
|
label: "Postal Code",
|
|
@@ -4559,7 +4559,7 @@ const Ol = ({
|
|
|
4559
4559
|
}
|
|
4560
4560
|
),
|
|
4561
4561
|
/* @__PURE__ */ e(
|
|
4562
|
-
|
|
4562
|
+
ge,
|
|
4563
4563
|
{
|
|
4564
4564
|
name: "city",
|
|
4565
4565
|
label: "City",
|
|
@@ -4569,7 +4569,7 @@ const Ol = ({
|
|
|
4569
4569
|
}
|
|
4570
4570
|
),
|
|
4571
4571
|
/* @__PURE__ */ e(
|
|
4572
|
-
|
|
4572
|
+
ge,
|
|
4573
4573
|
{
|
|
4574
4574
|
name: "country",
|
|
4575
4575
|
label: "Country",
|
|
@@ -4579,7 +4579,7 @@ const Ol = ({
|
|
|
4579
4579
|
}
|
|
4580
4580
|
),
|
|
4581
4581
|
/* @__PURE__ */ e(
|
|
4582
|
-
|
|
4582
|
+
ge,
|
|
4583
4583
|
{
|
|
4584
4584
|
name: "deliveryInstructions",
|
|
4585
4585
|
label: "Notes / Instructions",
|
|
@@ -4960,7 +4960,7 @@ const Ol = ({
|
|
|
4960
4960
|
/* @__PURE__ */ e("div", { className: "my-3 sm:my-6 sm:pb-1", children: a.map(
|
|
4961
4961
|
({ title: d, subtitle: c, image: u, price: p, unitPrice: m, quantity: h }, f) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ s("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [
|
|
4962
4962
|
/* @__PURE__ */ e("div", { className: "w-14 sm:min-w-32 h-10 sm:h-24 overflow-hidden rounded-lg", children: u != null && u.url ? /* @__PURE__ */ e(
|
|
4963
|
-
|
|
4963
|
+
he,
|
|
4964
4964
|
{
|
|
4965
4965
|
width: 100,
|
|
4966
4966
|
height: 100,
|
|
@@ -5025,7 +5025,7 @@ const Ol = ({
|
|
|
5025
5025
|
] })
|
|
5026
5026
|
] }), $l = () => /* @__PURE__ */ s("header", { className: "fixed flex justify-between px-2 md:px-6 py-4 md:py-12 z-50 bg-gray-900 md:bg-transparent w-full", children: [
|
|
5027
5027
|
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
5028
|
-
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
5028
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(Xt, { className: "w-5 h-5 text-white" }) }),
|
|
5029
5029
|
/* @__PURE__ */ e("div", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 bg-gray-300 animate-pulse rounded-full" }),
|
|
5030
5030
|
/* @__PURE__ */ e("div", { className: "ml-2 bg-gray-300 animate-pulse h-5 xl:h-6 w-24 xl:w-28 rounded" })
|
|
5031
5031
|
] }),
|
|
@@ -5081,7 +5081,7 @@ const Ol = ({
|
|
|
5081
5081
|
}
|
|
5082
5082
|
)
|
|
5083
5083
|
] }) });
|
|
5084
|
-
},
|
|
5084
|
+
}, ua = ({ summary: t }) => {
|
|
5085
5085
|
const { organization: a, loading: r } = ze(), [i, n] = I(!1);
|
|
5086
5086
|
if (r || !a)
|
|
5087
5087
|
return /* @__PURE__ */ e($l, {});
|
|
@@ -5089,9 +5089,9 @@ const Ol = ({
|
|
|
5089
5089
|
return /* @__PURE__ */ s(C, { children: [
|
|
5090
5090
|
/* @__PURE__ */ s("header", { className: "fixed flex justify-between px-2 md:px-6 py-4 md:py-12 z-50 bg-gray-900 md:bg-transparent w-full", children: [
|
|
5091
5091
|
/* @__PURE__ */ s(O, { href: "/", className: "flex items-center", children: [
|
|
5092
|
-
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
5092
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(Xt, { className: "w-5 h-5 text-white" }) }),
|
|
5093
5093
|
l ? /* @__PURE__ */ e("span", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 overflow-hidden rounded-full", children: /* @__PURE__ */ e(
|
|
5094
|
-
|
|
5094
|
+
he,
|
|
5095
5095
|
{
|
|
5096
5096
|
src: l.url,
|
|
5097
5097
|
alt: o,
|
|
@@ -5112,7 +5112,7 @@ const Ol = ({
|
|
|
5112
5112
|
{
|
|
5113
5113
|
className: "flex items-center text-white mr-2 animate-fade",
|
|
5114
5114
|
onClick: () => n(!1),
|
|
5115
|
-
children: /* @__PURE__ */ e(
|
|
5115
|
+
children: /* @__PURE__ */ e(Kt, { className: "w-5 h-5" })
|
|
5116
5116
|
},
|
|
5117
5117
|
1
|
|
5118
5118
|
) : /* @__PURE__ */ s(
|
|
@@ -5145,10 +5145,10 @@ const Ol = ({
|
|
|
5145
5145
|
description: a,
|
|
5146
5146
|
title: r
|
|
5147
5147
|
}) => /* @__PURE__ */ s(C, { children: [
|
|
5148
|
-
/* @__PURE__ */ e(
|
|
5148
|
+
/* @__PURE__ */ e(ua, {}),
|
|
5149
5149
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ s("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [
|
|
5150
5150
|
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 relative", children: /* @__PURE__ */ e("div", { className: "absolute inset-0 z-0", children: /* @__PURE__ */ e(
|
|
5151
|
-
|
|
5151
|
+
he,
|
|
5152
5152
|
{
|
|
5153
5153
|
src: "/images/15750.jpg",
|
|
5154
5154
|
alt: "Authentication background",
|
|
@@ -5171,7 +5171,7 @@ const Ol = ({
|
|
|
5171
5171
|
if (!n && i)
|
|
5172
5172
|
return r.push("/checkout/customer-details");
|
|
5173
5173
|
}, [i, n, r]), n ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900", children: /* @__PURE__ */ e("div", { className: "mb-4", children: /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-18 w-18 border-b-2 border-teal-500" }) }) }) : /* @__PURE__ */ e(di, { children: t });
|
|
5174
|
-
},
|
|
5174
|
+
}, Jt = ({ children: t }) => {
|
|
5175
5175
|
const { useSession: a } = Ye(), r = K(), { data: i, isPending: n } = a();
|
|
5176
5176
|
return X(() => {
|
|
5177
5177
|
if (!n && !i)
|
|
@@ -5720,7 +5720,7 @@ const Ol = ({
|
|
|
5720
5720
|
] })
|
|
5721
5721
|
] });
|
|
5722
5722
|
}, td = ({ orderId: t }) => {
|
|
5723
|
-
const { client: a } = L(), { organization: r, organizationId: i } = ze(), n =
|
|
5723
|
+
const { client: a } = L(), { organization: r, organizationId: i } = ze(), n = ye(), o = K(), l = nt(), { t: d } = ui(), c = r == null ? void 0 : r.configuration.defaultCurrency;
|
|
5724
5724
|
X(() => {
|
|
5725
5725
|
if ((n == null ? void 0 : n.get("clearCart")) === "true" && l) {
|
|
5726
5726
|
localStorage.removeItem("shophost-cart");
|
|
@@ -5728,18 +5728,18 @@ const Ol = ({
|
|
|
5728
5728
|
Array.from(n.entries())
|
|
5729
5729
|
);
|
|
5730
5730
|
b.delete("clearCart");
|
|
5731
|
-
const
|
|
5732
|
-
o.replace(
|
|
5731
|
+
const S = b.toString() ? `${l}?${b.toString()}` : l;
|
|
5732
|
+
o.replace(S);
|
|
5733
5733
|
}
|
|
5734
5734
|
}, [n, o, l]);
|
|
5735
5735
|
const { data: u, isLoading: p, error: m } = G({
|
|
5736
5736
|
queryKey: ["order", t],
|
|
5737
5737
|
refetchInterval: ({ state: b }) => {
|
|
5738
|
-
var
|
|
5739
|
-
return ((
|
|
5738
|
+
var S, w;
|
|
5739
|
+
return ((S = b.data) == null ? void 0 : S.status) !== "completed" && ((w = b.data) == null ? void 0 : w.status) !== "cancelled" ? 30 * 1e3 : !1;
|
|
5740
5740
|
},
|
|
5741
5741
|
queryFn: async () => {
|
|
5742
|
-
const { status: b, body:
|
|
5742
|
+
const { status: b, body: S } = await a.order.getOrder({
|
|
5743
5743
|
params: {
|
|
5744
5744
|
id: t,
|
|
5745
5745
|
// Replace with the actual order ID
|
|
@@ -5749,7 +5749,7 @@ const Ol = ({
|
|
|
5749
5749
|
});
|
|
5750
5750
|
if (b !== 200)
|
|
5751
5751
|
throw new Error("Failed to fetch shipping address");
|
|
5752
|
-
return
|
|
5752
|
+
return S;
|
|
5753
5753
|
}
|
|
5754
5754
|
}), h = Se(() => u ? u == null ? void 0 : u.items.map((b) => ({
|
|
5755
5755
|
title: b.translations[0].title,
|
|
@@ -5802,7 +5802,7 @@ const Ol = ({
|
|
|
5802
5802
|
cancelled: !0
|
|
5803
5803
|
}), /* @__PURE__ */ s(C, { children: [
|
|
5804
5804
|
/* @__PURE__ */ e(
|
|
5805
|
-
|
|
5805
|
+
ua,
|
|
5806
5806
|
{
|
|
5807
5807
|
summary: {
|
|
5808
5808
|
total: u.payment.total,
|
|
@@ -5868,7 +5868,7 @@ const Ol = ({
|
|
|
5868
5868
|
}
|
|
5869
5869
|
}
|
|
5870
5870
|
),
|
|
5871
|
-
y.map((b,
|
|
5871
|
+
y.map((b, S) => /* @__PURE__ */ e(mi, { ...b }, S))
|
|
5872
5872
|
] }) })
|
|
5873
5873
|
] }) })
|
|
5874
5874
|
] }) })
|
|
@@ -5911,7 +5911,7 @@ const Ol = ({
|
|
|
5911
5911
|
children: [
|
|
5912
5912
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [
|
|
5913
5913
|
/* @__PURE__ */ e(
|
|
5914
|
-
|
|
5914
|
+
ge,
|
|
5915
5915
|
{
|
|
5916
5916
|
name: "firstname",
|
|
5917
5917
|
label: "First Name",
|
|
@@ -5921,7 +5921,7 @@ const Ol = ({
|
|
|
5921
5921
|
}
|
|
5922
5922
|
),
|
|
5923
5923
|
/* @__PURE__ */ e(
|
|
5924
|
-
|
|
5924
|
+
ge,
|
|
5925
5925
|
{
|
|
5926
5926
|
name: "lastname",
|
|
5927
5927
|
label: "Last Name",
|
|
@@ -5931,7 +5931,7 @@ const Ol = ({
|
|
|
5931
5931
|
}
|
|
5932
5932
|
),
|
|
5933
5933
|
/* @__PURE__ */ e(
|
|
5934
|
-
|
|
5934
|
+
ge,
|
|
5935
5935
|
{
|
|
5936
5936
|
name: "phone",
|
|
5937
5937
|
label: "Phone",
|
|
@@ -5941,7 +5941,7 @@ const Ol = ({
|
|
|
5941
5941
|
}
|
|
5942
5942
|
),
|
|
5943
5943
|
/* @__PURE__ */ e(
|
|
5944
|
-
|
|
5944
|
+
ge,
|
|
5945
5945
|
{
|
|
5946
5946
|
name: "guests",
|
|
5947
5947
|
label: "Number of Guests",
|
|
@@ -5951,7 +5951,7 @@ const Ol = ({
|
|
|
5951
5951
|
}
|
|
5952
5952
|
),
|
|
5953
5953
|
/* @__PURE__ */ e(
|
|
5954
|
-
|
|
5954
|
+
ge,
|
|
5955
5955
|
{
|
|
5956
5956
|
name: "date",
|
|
5957
5957
|
type: "week-time",
|
|
@@ -6053,7 +6053,7 @@ const Ol = ({
|
|
|
6053
6053
|
});
|
|
6054
6054
|
const d = () => n.cancelledAt ? i("reservation.cancelledStatus") : n.acceptedAt ? i("reservation.confirmedStatus") : i("reservation.pendingStatus");
|
|
6055
6055
|
return /* @__PURE__ */ s(C, { children: [
|
|
6056
|
-
/* @__PURE__ */ e(
|
|
6056
|
+
/* @__PURE__ */ e(ua, {}),
|
|
6057
6057
|
/* @__PURE__ */ s("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [
|
|
6058
6058
|
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "w-96 animate-fade", children: /* @__PURE__ */ s("div", { className: "pl-6", children: [
|
|
6059
6059
|
/* @__PURE__ */ s("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [
|
|
@@ -6193,7 +6193,7 @@ const Ol = ({
|
|
|
6193
6193
|
] })
|
|
6194
6194
|
] });
|
|
6195
6195
|
}, nd = () => {
|
|
6196
|
-
const t =
|
|
6196
|
+
const t = ye(), { signIn: a } = Ye(), { baseUrl: r } = L(), i = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
|
|
6197
6197
|
register: n,
|
|
6198
6198
|
handleSubmit: o,
|
|
6199
6199
|
formState: { errors: l, isSubmitting: d }
|
|
@@ -6237,7 +6237,7 @@ const Ol = ({
|
|
|
6237
6237
|
className: "mt-2 w-full sm:mt-0 shadow-none inline-flex items-center gap-2",
|
|
6238
6238
|
onClick: u,
|
|
6239
6239
|
children: [
|
|
6240
|
-
/* @__PURE__ */ e(
|
|
6240
|
+
/* @__PURE__ */ e(ea, { className: "size-4", "aria-hidden": "true" }),
|
|
6241
6241
|
"Login with Google"
|
|
6242
6242
|
]
|
|
6243
6243
|
}
|
|
@@ -6307,7 +6307,7 @@ const Ol = ({
|
|
|
6307
6307
|
] })
|
|
6308
6308
|
] });
|
|
6309
6309
|
}, od = () => /* @__PURE__ */ e(nd, {}), ld = () => {
|
|
6310
|
-
const t =
|
|
6310
|
+
const t = ye(), { signUp: a, signIn: r } = Ye(), { baseUrl: i } = L(), n = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
|
|
6311
6311
|
register: o,
|
|
6312
6312
|
handleSubmit: l,
|
|
6313
6313
|
formState: { errors: d }
|
|
@@ -6352,7 +6352,7 @@ const Ol = ({
|
|
|
6352
6352
|
callbackURL: `${i}${n}`
|
|
6353
6353
|
})),
|
|
6354
6354
|
children: [
|
|
6355
|
-
/* @__PURE__ */ e(
|
|
6355
|
+
/* @__PURE__ */ e(ea, { className: "size-4", "aria-hidden": "true" }),
|
|
6356
6356
|
"Signin with Google"
|
|
6357
6357
|
]
|
|
6358
6358
|
}
|
|
@@ -6448,9 +6448,9 @@ const Ol = ({
|
|
|
6448
6448
|
case "sign-up":
|
|
6449
6449
|
return r.length !== 0 ? _e() : /* @__PURE__ */ e(Lr, { children: /* @__PURE__ */ e(dd, {}) });
|
|
6450
6450
|
case "orders":
|
|
6451
|
-
return r.length > 1 ? _e() : r.length === 0 ? /* @__PURE__ */ e(
|
|
6451
|
+
return r.length > 1 ? _e() : r.length === 0 ? /* @__PURE__ */ e(Jt, { children: /* @__PURE__ */ e(ad, {}) }) : /* @__PURE__ */ e(Jt, { children: /* @__PURE__ */ e(td, { orderId: r[0] }) });
|
|
6452
6452
|
case "reservations":
|
|
6453
|
-
return r.length !== 1 ? _e() : r[0] === "book" ? /* @__PURE__ */ e(
|
|
6453
|
+
return r.length !== 1 ? _e() : r[0] === "book" ? /* @__PURE__ */ e(Jt, { children: /* @__PURE__ */ e(sd, {}) }) : /* @__PURE__ */ e(Jt, { children: /* @__PURE__ */ e(id, { reservationId: r[0] }) });
|
|
6454
6454
|
default:
|
|
6455
6455
|
return _e();
|
|
6456
6456
|
}
|
|
@@ -6513,7 +6513,7 @@ const Ol = ({
|
|
|
6513
6513
|
)
|
|
6514
6514
|
] }) }) : /* @__PURE__ */ s(C, { children: [
|
|
6515
6515
|
/* @__PURE__ */ e(
|
|
6516
|
-
|
|
6516
|
+
ua,
|
|
6517
6517
|
{
|
|
6518
6518
|
summary: { total: d, subtotal: c, shipping: u, items: l }
|
|
6519
6519
|
}
|
|
@@ -6561,7 +6561,7 @@ const Ol = ({
|
|
|
6561
6561
|
handleDecrement: u,
|
|
6562
6562
|
handleAddToCart: p,
|
|
6563
6563
|
validationError: m
|
|
6564
|
-
} =
|
|
6564
|
+
} = sa();
|
|
6565
6565
|
if (!i)
|
|
6566
6566
|
return null;
|
|
6567
6567
|
const h = d <= 1;
|
|
@@ -6588,7 +6588,7 @@ const Ol = ({
|
|
|
6588
6588
|
group: a,
|
|
6589
6589
|
renderOptions: r
|
|
6590
6590
|
}) => {
|
|
6591
|
-
const { getModifierGroupName: i } =
|
|
6591
|
+
const { getModifierGroupName: i } = sa(), n = i(a), o = a.selectMin > 0;
|
|
6592
6592
|
let l = null;
|
|
6593
6593
|
return a.selectMin > 0 && a.selectMax > 0 && (l = a.selectMin === a.selectMax ? `${a.selectMin} option` : `${a.selectMin}-${a.selectMax}`), t({
|
|
6594
6594
|
group: a,
|
|
@@ -6610,7 +6610,7 @@ const Ol = ({
|
|
|
6610
6610
|
formatModifierPrice: d,
|
|
6611
6611
|
product: c,
|
|
6612
6612
|
locale: u
|
|
6613
|
-
} =
|
|
6613
|
+
} = sa(), p = i(r, a.id), m = n(
|
|
6614
6614
|
c.modifierGroups.find((y) => y.id === r)
|
|
6615
6615
|
), h = d(a, c.currency);
|
|
6616
6616
|
return t({
|
|
@@ -6640,16 +6640,16 @@ const Ol = ({
|
|
|
6640
6640
|
onDecrement: f,
|
|
6641
6641
|
isDecrementDisabled: y,
|
|
6642
6642
|
onAddToCart: b,
|
|
6643
|
-
validationError:
|
|
6643
|
+
validationError: S
|
|
6644
6644
|
}) => /* @__PURE__ */ e(
|
|
6645
|
-
|
|
6645
|
+
la,
|
|
6646
6646
|
{
|
|
6647
6647
|
open: d,
|
|
6648
|
-
onOpenChange: (
|
|
6649
|
-
|
|
6648
|
+
onOpenChange: (w) => {
|
|
6649
|
+
w || c();
|
|
6650
6650
|
},
|
|
6651
6651
|
children: /* @__PURE__ */ s(
|
|
6652
|
-
|
|
6652
|
+
da,
|
|
6653
6653
|
{
|
|
6654
6654
|
className: x(
|
|
6655
6655
|
"w-full sm:max-w-md max-h-[75vh] sm:max-h-[90vh] overflow-auto p-0",
|
|
@@ -6675,15 +6675,15 @@ const Ol = ({
|
|
|
6675
6675
|
}
|
|
6676
6676
|
)
|
|
6677
6677
|
] }),
|
|
6678
|
-
p.length > 0 ? /* @__PURE__ */ e("div", { className: "px-4", children: p.map((
|
|
6678
|
+
p.length > 0 ? /* @__PURE__ */ e("div", { className: "px-4", children: p.map((w) => /* @__PURE__ */ e(
|
|
6679
6679
|
pd,
|
|
6680
6680
|
{
|
|
6681
|
-
group:
|
|
6682
|
-
renderOptions: () =>
|
|
6681
|
+
group: w,
|
|
6682
|
+
renderOptions: () => w.modifiers.map((k) => /* @__PURE__ */ e(
|
|
6683
6683
|
md,
|
|
6684
6684
|
{
|
|
6685
6685
|
modifier: k,
|
|
6686
|
-
groupId:
|
|
6686
|
+
groupId: w.id,
|
|
6687
6687
|
children: (v) => l ? l(v) : /* @__PURE__ */ s(
|
|
6688
6688
|
"div",
|
|
6689
6689
|
{
|
|
@@ -6726,7 +6726,7 @@ const Ol = ({
|
|
|
6726
6726
|
/* @__PURE__ */ e("div", { children: k.renderOptions() })
|
|
6727
6727
|
] })
|
|
6728
6728
|
},
|
|
6729
|
-
|
|
6729
|
+
w.id
|
|
6730
6730
|
)) }) : a,
|
|
6731
6731
|
i ? i({
|
|
6732
6732
|
isDecrementDisabled: y,
|
|
@@ -6734,7 +6734,7 @@ const Ol = ({
|
|
|
6734
6734
|
onDecrement: f,
|
|
6735
6735
|
onIncrement: h,
|
|
6736
6736
|
quantity: m,
|
|
6737
|
-
validationError:
|
|
6737
|
+
validationError: S
|
|
6738
6738
|
}) : /* @__PURE__ */ s(C, { children: [
|
|
6739
6739
|
/* @__PURE__ */ s("div", { className: "p-4 flex items-center justify-center border-t mt-8", children: [
|
|
6740
6740
|
/* @__PURE__ */ e(
|
|
@@ -6764,7 +6764,7 @@ const Ol = ({
|
|
|
6764
6764
|
)
|
|
6765
6765
|
] }),
|
|
6766
6766
|
/* @__PURE__ */ s("div", { className: "p-4 border-t", children: [
|
|
6767
|
-
|
|
6767
|
+
S && /* @__PURE__ */ e("div", { className: "text-red-500 mb-2", children: S }),
|
|
6768
6768
|
/* @__PURE__ */ e(
|
|
6769
6769
|
"button",
|
|
6770
6770
|
{
|
|
@@ -6784,7 +6784,7 @@ const Ol = ({
|
|
|
6784
6784
|
children: t,
|
|
6785
6785
|
minQuantity: a = 1
|
|
6786
6786
|
}) => {
|
|
6787
|
-
const { quantity: r, handleIncrement: i, handleDecrement: n } =
|
|
6787
|
+
const { quantity: r, handleIncrement: i, handleDecrement: n } = sa(), o = r <= a;
|
|
6788
6788
|
return t({
|
|
6789
6789
|
quantity: r,
|
|
6790
6790
|
onIncrement: i,
|
|
@@ -7069,7 +7069,7 @@ const ut = [
|
|
|
7069
7069
|
"outline outline-offset-2 outline-0 focus-visible:outline-2",
|
|
7070
7070
|
// outline color
|
|
7071
7071
|
"outline-blue-500 dark:outline-blue-500"
|
|
7072
|
-
],
|
|
7072
|
+
], pa = [
|
|
7073
7073
|
// base
|
|
7074
7074
|
"ring-2",
|
|
7075
7075
|
// border color
|
|
@@ -7230,7 +7230,7 @@ function bd(t) {
|
|
|
7230
7230
|
function xd(t, a) {
|
|
7231
7231
|
return t === a || t.startsWith(`${a}/`);
|
|
7232
7232
|
}
|
|
7233
|
-
function
|
|
7233
|
+
function ma(t, a) {
|
|
7234
7234
|
return !t || !bd(t) || !xd(t, a.home) || t === a.signIn || t === a.signUp ? a.home : t;
|
|
7235
7235
|
}
|
|
7236
7236
|
function ar(t, a) {
|
|
@@ -7240,28 +7240,28 @@ function ar(t, a) {
|
|
|
7240
7240
|
return `${t}?${r.toString()}`;
|
|
7241
7241
|
}
|
|
7242
7242
|
function fi(t, a, r) {
|
|
7243
|
-
const i =
|
|
7243
|
+
const i = ma(a, r);
|
|
7244
7244
|
return new URL(i, t).toString();
|
|
7245
7245
|
}
|
|
7246
|
-
const
|
|
7246
|
+
const ga = ve({});
|
|
7247
7247
|
function Sd({
|
|
7248
7248
|
children: t,
|
|
7249
7249
|
organizationId: a,
|
|
7250
7250
|
id: r
|
|
7251
7251
|
}) {
|
|
7252
|
-
return /* @__PURE__ */ e(
|
|
7252
|
+
return /* @__PURE__ */ e(ga.Provider, { value: { organizationId: a, id: r }, children: t });
|
|
7253
7253
|
}
|
|
7254
7254
|
function kd() {
|
|
7255
|
-
return le(
|
|
7255
|
+
return le(ga);
|
|
7256
7256
|
}
|
|
7257
7257
|
function ee() {
|
|
7258
|
-
const { organizationId: t } = le(
|
|
7258
|
+
const { organizationId: t } = le(ga);
|
|
7259
7259
|
if (!t)
|
|
7260
7260
|
throw new Error("useOrgId called outside an org-scoped route");
|
|
7261
7261
|
return t;
|
|
7262
7262
|
}
|
|
7263
|
-
function
|
|
7264
|
-
const { id: t } = le(
|
|
7263
|
+
function ha() {
|
|
7264
|
+
const { id: t } = le(ga);
|
|
7265
7265
|
if (!t)
|
|
7266
7266
|
throw new Error("useRouteId called outside a detail route");
|
|
7267
7267
|
return t;
|
|
@@ -7272,7 +7272,7 @@ const vd = ve(void 0), Ad = ({
|
|
|
7272
7272
|
}) => {
|
|
7273
7273
|
const [r, i] = I(a);
|
|
7274
7274
|
return /* @__PURE__ */ e(vd.Provider, { value: { flyoutOpen: r, setFlyoutOpen: i }, children: t });
|
|
7275
|
-
},
|
|
7275
|
+
}, fe = ({ className: t, ...a }) => /* @__PURE__ */ s(
|
|
7276
7276
|
"svg",
|
|
7277
7277
|
{
|
|
7278
7278
|
"aria-hidden": "true",
|
|
@@ -7306,45 +7306,46 @@ const vd = ve(void 0), Ad = ({
|
|
|
7306
7306
|
), Mr = ({
|
|
7307
7307
|
children: t
|
|
7308
7308
|
}) => {
|
|
7309
|
-
var
|
|
7309
|
+
var c, u, p, m, h;
|
|
7310
7310
|
const { client: a } = L(), { organizationId: r } = kd(), i = G({
|
|
7311
7311
|
queryKey: ["organizations"],
|
|
7312
7312
|
queryFn: async () => {
|
|
7313
|
-
const { body:
|
|
7314
|
-
if (
|
|
7315
|
-
throw
|
|
7313
|
+
const { body: f, status: y } = await a.organization.getOrganizations();
|
|
7314
|
+
if (y !== 200)
|
|
7315
|
+
throw y !== 401 && se.error(
|
|
7316
7316
|
"Failed to update organizations list. Please refresh the page or try again later."
|
|
7317
7317
|
), new Error("Failed to fetch organizations");
|
|
7318
|
-
return
|
|
7318
|
+
return f;
|
|
7319
7319
|
},
|
|
7320
7320
|
retry: !1
|
|
7321
7321
|
}), n = G({
|
|
7322
7322
|
queryKey: ["organization", r],
|
|
7323
7323
|
queryFn: async () => {
|
|
7324
|
-
const { body:
|
|
7324
|
+
const { body: f, status: y } = await a.organization.getOrganization({
|
|
7325
7325
|
params: {
|
|
7326
7326
|
organizationId: r
|
|
7327
7327
|
}
|
|
7328
7328
|
});
|
|
7329
|
-
if (
|
|
7330
|
-
throw
|
|
7329
|
+
if (y !== 200)
|
|
7330
|
+
throw y !== 401 && se.error(
|
|
7331
7331
|
"Failed to fetch organization. Please try refreshing the page or try again later."
|
|
7332
7332
|
), new Error("Failed to fetch organizations");
|
|
7333
|
-
return
|
|
7333
|
+
return f;
|
|
7334
7334
|
},
|
|
7335
7335
|
enabled: !!r
|
|
7336
|
-
}), o = ((
|
|
7337
|
-
(
|
|
7336
|
+
}), o = ((c = n.data) == null ? void 0 : c.configuration.defaultLocale) ?? "en", l = ((u = n.data) == null ? void 0 : u.configuration.defaultCurrency) ?? "USD", d = ((m = (p = n.data) == null ? void 0 : p.configuration.supportedLocales) == null ? void 0 : m.sort(
|
|
7337
|
+
(f) => f === o ? -1 : 1
|
|
7338
7338
|
)) || ["en"];
|
|
7339
7339
|
return /* @__PURE__ */ e(
|
|
7340
7340
|
yi.Provider,
|
|
7341
7341
|
{
|
|
7342
7342
|
value: {
|
|
7343
7343
|
defaultLocale: o,
|
|
7344
|
-
|
|
7344
|
+
defaultCurrency: l,
|
|
7345
|
+
supportedLocales: d,
|
|
7345
7346
|
organizations: {
|
|
7346
7347
|
loading: i.isLoading,
|
|
7347
|
-
data: ((
|
|
7348
|
+
data: ((h = i.data) == null ? void 0 : h.list) ?? [],
|
|
7348
7349
|
error: i.isError
|
|
7349
7350
|
},
|
|
7350
7351
|
organization: {
|
|
@@ -7354,12 +7355,12 @@ const vd = ve(void 0), Ad = ({
|
|
|
7354
7355
|
}
|
|
7355
7356
|
},
|
|
7356
7357
|
children: n.isLoading || i.isLoading ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen mt-5", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
|
|
7357
|
-
/* @__PURE__ */ e(
|
|
7358
|
+
/* @__PURE__ */ e(fe, { className: "w-12 h-12" }),
|
|
7358
7359
|
/* @__PURE__ */ e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })
|
|
7359
7360
|
] }) }) : t
|
|
7360
7361
|
}
|
|
7361
7362
|
);
|
|
7362
|
-
},
|
|
7363
|
+
}, pe = () => {
|
|
7363
7364
|
const t = le(yi);
|
|
7364
7365
|
if (!t)
|
|
7365
7366
|
throw new Error(
|
|
@@ -7397,7 +7398,7 @@ const vd = ve(void 0), Ad = ({
|
|
|
7397
7398
|
defaultVariants: {
|
|
7398
7399
|
variant: "default"
|
|
7399
7400
|
}
|
|
7400
|
-
}),
|
|
7401
|
+
}), Tt = R.forwardRef(
|
|
7401
7402
|
({ className: t, variant: a, ...r }, i) => /* @__PURE__ */ e(
|
|
7402
7403
|
"span",
|
|
7403
7404
|
{
|
|
@@ -7407,7 +7408,7 @@ const vd = ve(void 0), Ad = ({
|
|
|
7407
7408
|
}
|
|
7408
7409
|
)
|
|
7409
7410
|
);
|
|
7410
|
-
|
|
7411
|
+
Tt.displayName = "Badge";
|
|
7411
7412
|
function Rd({
|
|
7412
7413
|
title: t,
|
|
7413
7414
|
change: a,
|
|
@@ -7423,7 +7424,7 @@ function Rd({
|
|
|
7423
7424
|
/* @__PURE__ */ s("div", { children: [
|
|
7424
7425
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
7425
7426
|
/* @__PURE__ */ e("h3", { className: "font-bold text-gray-900 sm:text-sm dark:text-gray-50", children: t }),
|
|
7426
|
-
/* @__PURE__ */ e(
|
|
7427
|
+
/* @__PURE__ */ e(Tt, { variant: "neutral", children: a })
|
|
7427
7428
|
] }),
|
|
7428
7429
|
/* @__PURE__ */ s("p", { className: "mt-2 flex items-baseline gap-2", children: [
|
|
7429
7430
|
/* @__PURE__ */ e("span", { className: "text-xl text-gray-900 dark:text-gray-50", children: r }),
|
|
@@ -13174,7 +13175,7 @@ const Td = (t) => {
|
|
|
13174
13175
|
if (!v) return;
|
|
13175
13176
|
const A = v.scrollLeft > 0, P = v.scrollWidth - v.clientWidth > v.scrollLeft;
|
|
13176
13177
|
m({ left: A, right: P });
|
|
13177
|
-
}, [m]),
|
|
13178
|
+
}, [m]), S = R.useCallback(
|
|
13178
13179
|
(v) => {
|
|
13179
13180
|
const A = u == null ? void 0 : u.current, P = (A == null ? void 0 : A.clientWidth) ?? 0;
|
|
13180
13181
|
A && d && (A.scrollTo({
|
|
@@ -13188,21 +13189,21 @@ const Td = (t) => {
|
|
|
13188
13189
|
);
|
|
13189
13190
|
R.useEffect(() => {
|
|
13190
13191
|
const v = (A) => {
|
|
13191
|
-
A === "ArrowLeft" ?
|
|
13192
|
+
A === "ArrowLeft" ? S("left") : A === "ArrowRight" && S("right");
|
|
13192
13193
|
};
|
|
13193
13194
|
return h ? (v(h), y.current = setInterval(() => {
|
|
13194
13195
|
v(h);
|
|
13195
13196
|
}, 300)) : clearInterval(y.current), () => clearInterval(y.current);
|
|
13196
|
-
}, [h,
|
|
13197
|
-
const
|
|
13197
|
+
}, [h, S]);
|
|
13198
|
+
const w = (v) => {
|
|
13198
13199
|
v.stopPropagation(), (v.key === "ArrowLeft" || v.key === "ArrowRight") && (v.preventDefault(), f(v.key));
|
|
13199
13200
|
}, k = (v) => {
|
|
13200
13201
|
v.stopPropagation(), f(null);
|
|
13201
13202
|
};
|
|
13202
13203
|
return R.useEffect(() => {
|
|
13203
13204
|
const v = u == null ? void 0 : u.current;
|
|
13204
|
-
return d && (b(), v == null || v.addEventListener("keydown",
|
|
13205
|
-
v == null || v.removeEventListener("keydown",
|
|
13205
|
+
return d && (b(), v == null || v.addEventListener("keydown", w), v == null || v.addEventListener("keyup", k)), () => {
|
|
13206
|
+
v == null || v.removeEventListener("keydown", w), v == null || v.removeEventListener("keyup", k);
|
|
13206
13207
|
};
|
|
13207
13208
|
}, [b, d]), /* @__PURE__ */ s(
|
|
13208
13209
|
"ol",
|
|
@@ -13245,9 +13246,9 @@ const Td = (t) => {
|
|
|
13245
13246
|
/* @__PURE__ */ e(
|
|
13246
13247
|
Br,
|
|
13247
13248
|
{
|
|
13248
|
-
icon:
|
|
13249
|
+
icon: Ut,
|
|
13249
13250
|
onClick: () => {
|
|
13250
|
-
f(null),
|
|
13251
|
+
f(null), S("left");
|
|
13251
13252
|
},
|
|
13252
13253
|
disabled: !(p != null && p.left)
|
|
13253
13254
|
}
|
|
@@ -13257,7 +13258,7 @@ const Td = (t) => {
|
|
|
13257
13258
|
{
|
|
13258
13259
|
icon: it,
|
|
13259
13260
|
onClick: () => {
|
|
13260
|
-
f(null),
|
|
13261
|
+
f(null), S("right");
|
|
13261
13262
|
},
|
|
13262
13263
|
disabled: !(p != null && p.right)
|
|
13263
13264
|
}
|
|
@@ -13358,7 +13359,7 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13358
13359
|
children: o
|
|
13359
13360
|
}
|
|
13360
13361
|
),
|
|
13361
|
-
l !== void 0 && /* @__PURE__ */ e(
|
|
13362
|
+
l !== void 0 && /* @__PURE__ */ e(Tt, { variant: Ji(l), children: gi(l) })
|
|
13362
13363
|
] }),
|
|
13363
13364
|
/* @__PURE__ */ e("div", { className: Q("space-y-1 p-2"), children: n.map((d, c) => {
|
|
13364
13365
|
const u = d.payload;
|
|
@@ -13397,8 +13398,8 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13397
13398
|
showTooltip: f = !0,
|
|
13398
13399
|
showLegend: y = !0,
|
|
13399
13400
|
autoMinValue: b = !1,
|
|
13400
|
-
minValue:
|
|
13401
|
-
maxValue:
|
|
13401
|
+
minValue: S,
|
|
13402
|
+
maxValue: w,
|
|
13402
13403
|
allowDecimals: k = !0,
|
|
13403
13404
|
connectNulls: v = !1,
|
|
13404
13405
|
className: A,
|
|
@@ -13412,9 +13413,9 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13412
13413
|
void 0
|
|
13413
13414
|
), [M, D] = R.useState(
|
|
13414
13415
|
void 0
|
|
13415
|
-
), B = Cd(i, o),
|
|
13416
|
+
), B = Cd(i, o), me = Pd(b, S, w), zt = !!P;
|
|
13416
13417
|
function xn(z, we) {
|
|
13417
|
-
we.stopPropagation(),
|
|
13418
|
+
we.stopPropagation(), zt && (z.index === (U == null ? void 0 : U.index) && z.dataKey === (U == null ? void 0 : U.dataKey) || va(r, z.dataKey) && M && M === z.dataKey ? (D(void 0), Me(void 0), P == null || P(null)) : (D(z.dataKey), Me({
|
|
13418
13419
|
index: z.index,
|
|
13419
13420
|
dataKey: z.dataKey
|
|
13420
13421
|
}), P == null || P({
|
|
@@ -13424,7 +13425,7 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13424
13425
|
})));
|
|
13425
13426
|
}
|
|
13426
13427
|
function hr(z) {
|
|
13427
|
-
|
|
13428
|
+
zt && (z === M && !U || va(r, z) && U && U.dataKey === z ? (D(void 0), P == null || P(null)) : (D(z), P == null || P({
|
|
13428
13429
|
eventType: "category",
|
|
13429
13430
|
categoryClicked: z
|
|
13430
13431
|
})), Me(void 0));
|
|
@@ -13433,7 +13434,7 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13433
13434
|
Yn,
|
|
13434
13435
|
{
|
|
13435
13436
|
data: r,
|
|
13436
|
-
onClick:
|
|
13437
|
+
onClick: zt && (M || U) ? () => {
|
|
13437
13438
|
Me(void 0), D(void 0), P == null || P(null);
|
|
13438
13439
|
} : void 0,
|
|
13439
13440
|
margin: {
|
|
@@ -13490,7 +13491,7 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13490
13491
|
axisLine: !1,
|
|
13491
13492
|
tickLine: !1,
|
|
13492
13493
|
type: "number",
|
|
13493
|
-
domain:
|
|
13494
|
+
domain: me,
|
|
13494
13495
|
tick: { transform: "translate(-3, 0)" },
|
|
13495
13496
|
fill: "",
|
|
13496
13497
|
stroke: "",
|
|
@@ -13545,7 +13546,7 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13545
13546
|
B,
|
|
13546
13547
|
et,
|
|
13547
13548
|
M,
|
|
13548
|
-
|
|
13549
|
+
zt ? (we) => hr(we) : void 0,
|
|
13549
13550
|
_
|
|
13550
13551
|
)
|
|
13551
13552
|
}
|
|
@@ -13591,7 +13592,7 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13591
13592
|
strokeLinecap: wa,
|
|
13592
13593
|
strokeLinejoin: ba,
|
|
13593
13594
|
strokeWidth: xa,
|
|
13594
|
-
onClick: (
|
|
13595
|
+
onClick: (Mt, Sn) => xn(we, Sn)
|
|
13595
13596
|
}
|
|
13596
13597
|
);
|
|
13597
13598
|
},
|
|
@@ -13604,9 +13605,9 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13604
13605
|
cx: ba,
|
|
13605
13606
|
cy: xa,
|
|
13606
13607
|
dataKey: Sa,
|
|
13607
|
-
index:
|
|
13608
|
+
index: Mt
|
|
13608
13609
|
} = we;
|
|
13609
|
-
return va(r, z) && !(U || M && M !== z) || (U == null ? void 0 : U.index) ===
|
|
13610
|
+
return va(r, z) && !(U || M && M !== z) || (U == null ? void 0 : U.index) === Mt && (U == null ? void 0 : U.dataKey) === z ? /* @__PURE__ */ e(
|
|
13610
13611
|
vr,
|
|
13611
13612
|
{
|
|
13612
13613
|
cx: ba,
|
|
@@ -13628,8 +13629,8 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
|
|
|
13628
13629
|
)
|
|
13629
13630
|
)
|
|
13630
13631
|
},
|
|
13631
|
-
|
|
13632
|
-
) : /* @__PURE__ */ e(R.Fragment, {},
|
|
13632
|
+
Mt
|
|
13633
|
+
) : /* @__PURE__ */ e(R.Fragment, {}, Mt);
|
|
13633
13634
|
},
|
|
13634
13635
|
name: z,
|
|
13635
13636
|
type: "linear",
|
|
@@ -13837,7 +13838,7 @@ const ki = ({
|
|
|
13837
13838
|
...d
|
|
13838
13839
|
},
|
|
13839
13840
|
components: {
|
|
13840
|
-
IconLeft: () => /* @__PURE__ */ e(
|
|
13841
|
+
IconLeft: () => /* @__PURE__ */ e(Ut, { "aria-hidden": "true", className: "size-4" }),
|
|
13841
13842
|
IconRight: () => /* @__PURE__ */ e(it, { "aria-hidden": "true", className: "size-4" }),
|
|
13842
13843
|
Caption: ({ ...u }) => {
|
|
13843
13844
|
const {
|
|
@@ -13846,21 +13847,21 @@ const ki = ({
|
|
|
13846
13847
|
previousMonth: h,
|
|
13847
13848
|
currentMonth: f,
|
|
13848
13849
|
displayMonths: y
|
|
13849
|
-
} = po(), { numberOfMonths: b, fromDate:
|
|
13850
|
+
} = po(), { numberOfMonths: b, fromDate: S, toDate: w } = mo(), k = y.findIndex(
|
|
13850
13851
|
(Z) => Gn(u.displayMonth, Z)
|
|
13851
13852
|
), v = k === 0, A = k === y.length - 1, P = b > 1 && (v || !A), _ = b > 1 && (A || !v), ie = () => {
|
|
13852
|
-
const Z =
|
|
13853
|
-
h && (!
|
|
13853
|
+
const Z = Bt(f, -1);
|
|
13854
|
+
h && (!S || Z.getTime() >= S.getTime()) && p(Z);
|
|
13854
13855
|
}, ae = () => {
|
|
13855
|
-
const Z =
|
|
13856
|
-
m && (!
|
|
13856
|
+
const Z = Bt(f, 1);
|
|
13857
|
+
m && (!w || Z.getTime() <= w.getTime()) && p(Z);
|
|
13857
13858
|
};
|
|
13858
13859
|
return /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
13859
13860
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
13860
13861
|
i && !_ && /* @__PURE__ */ e(
|
|
13861
13862
|
yt,
|
|
13862
13863
|
{
|
|
13863
|
-
disabled: n || !h ||
|
|
13864
|
+
disabled: n || !h || S && Bt(f, -1).getTime() < S.getTime(),
|
|
13864
13865
|
"aria-label": "Go to previous year",
|
|
13865
13866
|
onClick: ie,
|
|
13866
13867
|
icon: hs
|
|
@@ -13872,7 +13873,7 @@ const ki = ({
|
|
|
13872
13873
|
disabled: n || !h,
|
|
13873
13874
|
"aria-label": "Go to previous month",
|
|
13874
13875
|
onClick: () => h && p(h),
|
|
13875
|
-
icon:
|
|
13876
|
+
icon: Ut
|
|
13876
13877
|
}
|
|
13877
13878
|
)
|
|
13878
13879
|
] }),
|
|
@@ -13898,7 +13899,7 @@ const ki = ({
|
|
|
13898
13899
|
i && !P && /* @__PURE__ */ e(
|
|
13899
13900
|
yt,
|
|
13900
13901
|
{
|
|
13901
|
-
disabled: n || !m ||
|
|
13902
|
+
disabled: n || !m || w && Bt(f, 1).getTime() > w.getTime(),
|
|
13902
13903
|
"aria-label": "Go to next year",
|
|
13903
13904
|
onClick: ae,
|
|
13904
13905
|
icon: fs
|
|
@@ -13908,8 +13909,8 @@ const ki = ({
|
|
|
13908
13909
|
] });
|
|
13909
13910
|
},
|
|
13910
13911
|
Day: ({ date: u, displayMonth: p }) => {
|
|
13911
|
-
const m = N.useRef(null), { activeModifiers: h, buttonProps: f, divProps: y, isButton: b, isHidden:
|
|
13912
|
-
if (
|
|
13912
|
+
const m = N.useRef(null), { activeModifiers: h, buttonProps: f, divProps: y, isButton: b, isHidden: S } = uo(u, p, m), { selected: w, today: k, disabled: v, range_middle: A } = h;
|
|
13913
|
+
if (S)
|
|
13913
13914
|
return /* @__PURE__ */ e(C, {});
|
|
13914
13915
|
if (!b)
|
|
13915
13916
|
return /* @__PURE__ */ e(
|
|
@@ -13942,9 +13943,9 @@ const ki = ({
|
|
|
13942
13943
|
className: x(
|
|
13943
13944
|
"absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",
|
|
13944
13945
|
{
|
|
13945
|
-
"bg-blue-500 dark:bg-blue-500": !
|
|
13946
|
-
"bg-white! dark:bg-gray-950!":
|
|
13947
|
-
"bg-gray-400! dark:bg-gray-600!":
|
|
13946
|
+
"bg-blue-500 dark:bg-blue-500": !w,
|
|
13947
|
+
"bg-white! dark:bg-gray-950!": w,
|
|
13948
|
+
"bg-gray-400! dark:bg-gray-600!": w && A,
|
|
13948
13949
|
"bg-gray-400 text-gray-400 dark:bg-gray-400 dark:text-gray-600": v
|
|
13949
13950
|
}
|
|
13950
13951
|
)
|
|
@@ -14069,7 +14070,7 @@ const Md = Pe({
|
|
|
14069
14070
|
],
|
|
14070
14071
|
variants: {
|
|
14071
14072
|
hasError: {
|
|
14072
|
-
true:
|
|
14073
|
+
true: pa
|
|
14073
14074
|
}
|
|
14074
14075
|
}
|
|
14075
14076
|
}), vi = N.forwardRef(
|
|
@@ -14131,8 +14132,8 @@ const Ni = ({
|
|
|
14131
14132
|
let f = !1;
|
|
14132
14133
|
m && h && l(m, h) && (f = !0);
|
|
14133
14134
|
const y = u.to, b = p.to;
|
|
14134
|
-
let
|
|
14135
|
-
return y && b && l(y, b) && (
|
|
14135
|
+
let S = !1;
|
|
14136
|
+
return y && b && l(y, b) && (S = !0), f && S;
|
|
14136
14137
|
}, c = (u) => {
|
|
14137
14138
|
if (i(u)) {
|
|
14138
14139
|
const p = r;
|
|
@@ -14192,20 +14193,20 @@ const Jr = (t, a, r) => {
|
|
|
14192
14193
|
className: y,
|
|
14193
14194
|
...b
|
|
14194
14195
|
}) => {
|
|
14195
|
-
const [
|
|
14196
|
+
const [S, w] = N.useState(!1), [k, v] = N.useState(
|
|
14196
14197
|
a ?? t ?? void 0
|
|
14197
14198
|
), [A, P] = N.useState(k == null ? void 0 : k.from), [_, ie] = N.useState(
|
|
14198
14199
|
a != null && a.from ? new re(a.from.getHours(), a.from.getMinutes()) : t != null && t.from ? new re(t.from.getHours(), t.from.getMinutes()) : new re(0, 0)
|
|
14199
14200
|
), [ae, Z] = N.useState(
|
|
14200
14201
|
a != null && a.to ? new re(a.to.getHours(), a.to.getMinutes()) : t != null && t.to ? new re(t.to.getHours(), t.to.getMinutes()) : new re(0, 0)
|
|
14201
|
-
), J = N.useMemo(() => k, [
|
|
14202
|
+
), J = N.useMemo(() => k, [S]);
|
|
14202
14203
|
N.useEffect(() => {
|
|
14203
14204
|
v(a ?? t ?? void 0);
|
|
14204
14205
|
}, [a, t]), N.useEffect(() => {
|
|
14205
14206
|
k && P(k.from);
|
|
14206
14207
|
}, [k]), N.useEffect(() => {
|
|
14207
|
-
|
|
14208
|
-
}, [
|
|
14208
|
+
S || P(k == null ? void 0 : k.from);
|
|
14209
|
+
}, [S]);
|
|
14209
14210
|
const Te = (D) => {
|
|
14210
14211
|
const B = D;
|
|
14211
14212
|
u && (B != null && B.from && !_ && ie(new re(0, 0)), B != null && B.to && !ae && Z(new re(0, 0)), B != null && B.from && _ && (B.from.setHours(_.hour), B.from.setMinutes(_.minute)), B != null && B.to && ae && (B.to.setHours(ae.hour), B.to.setMinutes(ae.minute))), v(B);
|
|
@@ -14214,9 +14215,9 @@ const Jr = (t, a, r) => {
|
|
|
14214
14215
|
J != null && J.from ? new re(J.from.getHours(), J.from.getMinutes()) : new re(0, 0)
|
|
14215
14216
|
), Z(
|
|
14216
14217
|
J != null && J.to ? new re(J.to.getHours(), J.to.getMinutes()) : new re(0, 0)
|
|
14217
|
-
),
|
|
14218
|
+
), w(!1);
|
|
14218
14219
|
}, et = (D) => {
|
|
14219
|
-
D || We(),
|
|
14220
|
+
D || We(), w(D);
|
|
14220
14221
|
}, U = (D, B) => {
|
|
14221
14222
|
switch (B) {
|
|
14222
14223
|
case "start":
|
|
@@ -14230,19 +14231,19 @@ const Jr = (t, a, r) => {
|
|
|
14230
14231
|
if (B === "start") {
|
|
14231
14232
|
if (!k.from)
|
|
14232
14233
|
return;
|
|
14233
|
-
const
|
|
14234
|
-
D ? (
|
|
14234
|
+
const me = new Date(k.from.getTime());
|
|
14235
|
+
D ? (me.setHours(D.hour), me.setMinutes(D.minute)) : (me.setHours(0), me.setMinutes(0)), v({
|
|
14235
14236
|
...k,
|
|
14236
|
-
from:
|
|
14237
|
+
from: me
|
|
14237
14238
|
});
|
|
14238
14239
|
}
|
|
14239
14240
|
if (B === "end") {
|
|
14240
14241
|
if (!k.to)
|
|
14241
14242
|
return;
|
|
14242
|
-
const
|
|
14243
|
-
D ? (
|
|
14243
|
+
const me = new Date(k.to.getTime());
|
|
14244
|
+
D ? (me.setHours(D.hour), me.setMinutes(D.minute)) : (me.setHours(0), me.setMinutes(0)), v({
|
|
14244
14245
|
...k,
|
|
14245
|
-
to:
|
|
14246
|
+
to: me
|
|
14246
14247
|
});
|
|
14247
14248
|
}
|
|
14248
14249
|
}
|
|
@@ -14258,13 +14259,13 @@ const Jr = (t, a, r) => {
|
|
|
14258
14259
|
);
|
|
14259
14260
|
}, [a, t]);
|
|
14260
14261
|
const Me = N.useMemo(() => k ? `${k.from ? Jr(k.from, c, u) : ""} - ${k.to ? Jr(k.to, c, u) : ""}` : null, [k, c, u]), M = () => {
|
|
14261
|
-
|
|
14262
|
+
w(!1), r == null || r(k);
|
|
14262
14263
|
};
|
|
14263
14264
|
return /* @__PURE__ */ s(
|
|
14264
14265
|
W.Root,
|
|
14265
14266
|
{
|
|
14266
14267
|
"tremor-id": "tremor-raw",
|
|
14267
|
-
open:
|
|
14268
|
+
open: S,
|
|
14268
14269
|
onOpenChange: et,
|
|
14269
14270
|
children: [
|
|
14270
14271
|
/* @__PURE__ */ e(
|
|
@@ -14398,14 +14399,14 @@ const Jr = (t, a, r) => {
|
|
|
14398
14399
|
if (t && t.length > 0) {
|
|
14399
14400
|
const c = i, u = r;
|
|
14400
14401
|
t.forEach((p) => {
|
|
14401
|
-
var m, h, f, y, b,
|
|
14402
|
+
var m, h, f, y, b, S;
|
|
14402
14403
|
if ("date" in p) {
|
|
14403
|
-
const
|
|
14404
|
-
if (i &&
|
|
14404
|
+
const w = p.date.getFullYear();
|
|
14405
|
+
if (i && w < i)
|
|
14405
14406
|
throw new Error(
|
|
14406
14407
|
`Preset ${p.label} is before fromYear ${c}.`
|
|
14407
14408
|
);
|
|
14408
|
-
if (r &&
|
|
14409
|
+
if (r && w > r)
|
|
14409
14410
|
throw new Error(
|
|
14410
14411
|
`Preset ${p.label} is after toYear ${u}.`
|
|
14411
14412
|
);
|
|
@@ -14430,8 +14431,8 @@ const Jr = (t, a, r) => {
|
|
|
14430
14431
|
);
|
|
14431
14432
|
}
|
|
14432
14433
|
if ("dateRange" in p) {
|
|
14433
|
-
const
|
|
14434
|
-
if (
|
|
14434
|
+
const w = (m = p.dateRange.from) == null ? void 0 : m.getFullYear(), k = (h = p.dateRange.to) == null ? void 0 : h.getFullYear();
|
|
14435
|
+
if (w && i && w < i)
|
|
14435
14436
|
throw new Error(
|
|
14436
14437
|
`Preset ${p.label}'s 'from' is before fromYear ${c}.`
|
|
14437
14438
|
);
|
|
@@ -14467,7 +14468,7 @@ const Jr = (t, a, r) => {
|
|
|
14467
14468
|
);
|
|
14468
14469
|
}
|
|
14469
14470
|
if (d) {
|
|
14470
|
-
const v = (
|
|
14471
|
+
const v = (S = p.dateRange.to) == null ? void 0 : S.getDate();
|
|
14471
14472
|
if (v && v > d.getDate())
|
|
14472
14473
|
throw new Error(
|
|
14473
14474
|
`Preset ${p.label}'s 'to' is after toDay ${V(
|
|
@@ -14481,12 +14482,12 @@ const Jr = (t, a, r) => {
|
|
|
14481
14482
|
}
|
|
14482
14483
|
}, Ri = ({ presets: t, ...a }) => (t && Jd(t, a), /* @__PURE__ */ e(Bd, { presets: t, ...a }));
|
|
14483
14484
|
Ri.displayName = "DateRangePicker";
|
|
14484
|
-
const
|
|
14485
|
-
|
|
14485
|
+
const Qt = (t) => /* @__PURE__ */ e(H.Root, { ...t });
|
|
14486
|
+
Qt.displayName = "Dialog";
|
|
14486
14487
|
const rr = H.Trigger;
|
|
14487
14488
|
rr.displayName = "DialogTrigger";
|
|
14488
|
-
const
|
|
14489
|
-
|
|
14489
|
+
const qt = H.Close;
|
|
14490
|
+
qt.displayName = "DialogClose";
|
|
14490
14491
|
const Ci = H.Portal;
|
|
14491
14492
|
Ci.displayName = "DialogPortal";
|
|
14492
14493
|
const Pi = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
@@ -14506,7 +14507,7 @@ const Pi = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
14506
14507
|
}
|
|
14507
14508
|
));
|
|
14508
14509
|
Pi.displayName = "DialogOverlay";
|
|
14509
|
-
const
|
|
14510
|
+
const It = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(Ci, { children: /* @__PURE__ */ e(Pi, { children: /* @__PURE__ */ e(
|
|
14510
14511
|
H.Content,
|
|
14511
14512
|
{
|
|
14512
14513
|
ref: r,
|
|
@@ -14525,13 +14526,13 @@ const Lt = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(Ci, { c
|
|
|
14525
14526
|
...a
|
|
14526
14527
|
}
|
|
14527
14528
|
) }) }));
|
|
14528
|
-
|
|
14529
|
-
const
|
|
14529
|
+
It.displayName = "DialogContent";
|
|
14530
|
+
const Lt = ({
|
|
14530
14531
|
className: t,
|
|
14531
14532
|
...a
|
|
14532
14533
|
}) => /* @__PURE__ */ e("div", { className: x("flex flex-col gap-y-1", t), ...a });
|
|
14533
|
-
|
|
14534
|
-
const
|
|
14534
|
+
Lt.displayName = "DialogHeader";
|
|
14535
|
+
const Et = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
14535
14536
|
H.Title,
|
|
14536
14537
|
{
|
|
14537
14538
|
ref: r,
|
|
@@ -14545,8 +14546,8 @@ const Dt = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
14545
14546
|
...a
|
|
14546
14547
|
}
|
|
14547
14548
|
));
|
|
14548
|
-
|
|
14549
|
-
const
|
|
14549
|
+
Et.displayName = "DialogTitle";
|
|
14550
|
+
const Dt = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
14550
14551
|
H.Description,
|
|
14551
14552
|
{
|
|
14552
14553
|
ref: r,
|
|
@@ -14554,7 +14555,7 @@ const zt = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
14554
14555
|
...a
|
|
14555
14556
|
}
|
|
14556
14557
|
));
|
|
14557
|
-
|
|
14558
|
+
Dt.displayName = "DialogDescription";
|
|
14558
14559
|
const Ti = ({
|
|
14559
14560
|
className: t,
|
|
14560
14561
|
...a
|
|
@@ -14622,7 +14623,7 @@ const Fd = [
|
|
|
14622
14623
|
ref: n,
|
|
14623
14624
|
className: x(
|
|
14624
14625
|
Fd,
|
|
14625
|
-
a ?
|
|
14626
|
+
a ? pa : "",
|
|
14626
14627
|
t
|
|
14627
14628
|
),
|
|
14628
14629
|
...i,
|
|
@@ -14761,7 +14762,7 @@ const Vd = R.forwardRef(({ className: t, children: a, ...r }, i) => /* @__PURE__
|
|
|
14761
14762
|
children: [
|
|
14762
14763
|
/* @__PURE__ */ e(Y.ItemText, { className: "flex-1 truncate", children: a }),
|
|
14763
14764
|
/* @__PURE__ */ e(Y.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
14764
|
-
|
|
14765
|
+
ta,
|
|
14765
14766
|
{
|
|
14766
14767
|
className: "size-5 shrink-0 text-gray-800 dark:text-gray-200",
|
|
14767
14768
|
"aria-hidden": "true"
|
|
@@ -14791,7 +14792,7 @@ const Mi = R.forwardRef(({ className: t, children: a, period: r, ...i }, n) => /
|
|
|
14791
14792
|
...i,
|
|
14792
14793
|
children: [
|
|
14793
14794
|
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(Y.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
14794
|
-
|
|
14795
|
+
ta,
|
|
14795
14796
|
{
|
|
14796
14797
|
className: "size-5 shrink-0 text-gray-800 dark:text-gray-200",
|
|
14797
14798
|
"aria-hidden": "true"
|
|
@@ -14844,7 +14845,7 @@ const Zd = [
|
|
|
14844
14845
|
case "previous-period": {
|
|
14845
14846
|
let n, o;
|
|
14846
14847
|
if (r && i) {
|
|
14847
|
-
const l =
|
|
14848
|
+
const l = Ot(r, i), d = Ss(l).length;
|
|
14848
14849
|
o = Ra(r, 1), n = Ra(o, d);
|
|
14849
14850
|
}
|
|
14850
14851
|
return { from: n, to: o };
|
|
@@ -14912,7 +14913,7 @@ function Ud({
|
|
|
14912
14913
|
}
|
|
14913
14914
|
)
|
|
14914
14915
|
] }),
|
|
14915
|
-
/* @__PURE__ */ s(
|
|
14916
|
+
/* @__PURE__ */ s(Qt, { children: [
|
|
14916
14917
|
/* @__PURE__ */ e(rr, { asChild: !0, children: /* @__PURE__ */ s(
|
|
14917
14918
|
T,
|
|
14918
14919
|
{
|
|
@@ -14930,10 +14931,10 @@ function Ud({
|
|
|
14930
14931
|
]
|
|
14931
14932
|
}
|
|
14932
14933
|
) }),
|
|
14933
|
-
/* @__PURE__ */ s(
|
|
14934
|
-
/* @__PURE__ */ s(
|
|
14935
|
-
/* @__PURE__ */ e(
|
|
14936
|
-
/* @__PURE__ */ e(
|
|
14934
|
+
/* @__PURE__ */ s(It, { className: "max-w-5xl", children: [
|
|
14935
|
+
/* @__PURE__ */ s(Lt, { children: [
|
|
14936
|
+
/* @__PURE__ */ e(Et, { children: "Customise overview charts" }),
|
|
14937
|
+
/* @__PURE__ */ e(Dt, { className: "sr-only", children: "Add or remove the charts for the overview panel." })
|
|
14937
14938
|
] }),
|
|
14938
14939
|
/* @__PURE__ */ e(
|
|
14939
14940
|
"div",
|
|
@@ -14973,7 +14974,7 @@ function Ud({
|
|
|
14973
14974
|
}
|
|
14974
14975
|
),
|
|
14975
14976
|
/* @__PURE__ */ s(Ti, { className: "mt-6", children: [
|
|
14976
|
-
/* @__PURE__ */ e(
|
|
14977
|
+
/* @__PURE__ */ e(qt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
14977
14978
|
T,
|
|
14978
14979
|
{
|
|
14979
14980
|
className: "mt-2 w-full sm:mt-0 sm:w-fit",
|
|
@@ -14981,7 +14982,7 @@ function Ud({
|
|
|
14981
14982
|
children: "Cancel"
|
|
14982
14983
|
}
|
|
14983
14984
|
) }),
|
|
14984
|
-
/* @__PURE__ */ e(
|
|
14985
|
+
/* @__PURE__ */ e(qt, { asChild: !0, children: /* @__PURE__ */ e(T, { className: "w-full sm:w-fit", onClick: h, children: "Apply" }) })
|
|
14985
14986
|
] })
|
|
14986
14987
|
] })
|
|
14987
14988
|
] })
|
|
@@ -14998,23 +14999,23 @@ function Oi({
|
|
|
14998
14999
|
selectedPeriod: i,
|
|
14999
15000
|
isThumbnail: n
|
|
15000
15001
|
}) {
|
|
15001
|
-
const o = Wd[a], l = r != null && r.from && (r != null && r.to) ?
|
|
15002
|
+
const o = Wd[a], l = r != null && r.from && (r != null && r.to) ? Ot(r.from, r.to) : null, d = r != null && r.from && (r != null && r.to) ? Ss(Ot(r.from, r.to)) : null, c = Bi(r, i), u = c != null && c.from && (c != null && c.to) ? Ot(c.from, c.to) : null, p = Ia.filter((w) => l ? br(w.date, l) : !0).sort((w, k) => new Date(w.date).getTime() - new Date(k.date).getTime()), m = Ia.filter((w) => u ? br(w.date, u) : !1).sort((w, k) => new Date(w.date).getTime() - new Date(k.date).getTime()), h = d == null ? void 0 : d.map((w, k) => {
|
|
15002
15003
|
const v = p[k], A = m[k], P = (v == null ? void 0 : v[t]) || null, _ = (A == null ? void 0 : A[t]) || null;
|
|
15003
15004
|
return {
|
|
15004
15005
|
title: t,
|
|
15005
|
-
date:
|
|
15006
|
-
formattedDate: xr(
|
|
15006
|
+
date: w,
|
|
15007
|
+
formattedDate: xr(w, "dd/MM/yyyy"),
|
|
15007
15008
|
value: P,
|
|
15008
15009
|
previousDate: A == null ? void 0 : A.date,
|
|
15009
15010
|
previousFormattedDate: A ? xr(A.date, "dd/MM/yyyy") : null,
|
|
15010
15011
|
previousValue: i !== "no-comparison" ? _ : null,
|
|
15011
15012
|
evolution: i !== "no-comparison" && P && _ ? (P - _) / _ : void 0
|
|
15012
15013
|
};
|
|
15013
|
-
}).sort((
|
|
15014
|
+
}).sort((w, k) => new Date(w.date).getTime() - new Date(k.date).getTime()), f = i === "no-comparison" ? ["value"] : ["value", "previousValue"], y = (h == null ? void 0 : h.reduce((w, k) => w + (k.value || 0), 0)) || 0, b = (h == null ? void 0 : h.reduce((w, k) => w + (k.previousValue || 0), 0)) || 0, S = i !== "no-comparison" ? (y - b) / b : 0;
|
|
15014
15015
|
return /* @__PURE__ */ s("div", { className: Q("transition"), children: [
|
|
15015
15016
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-x-2", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-x-2", children: [
|
|
15016
15017
|
/* @__PURE__ */ e("dt", { className: "font-bold text-gray-900 sm:text-sm dark:text-gray-50", children: t }),
|
|
15017
|
-
i !== "no-comparison" && /* @__PURE__ */ e(
|
|
15018
|
+
i !== "no-comparison" && /* @__PURE__ */ e(Tt, { variant: Ji(S), children: gi(S) })
|
|
15018
15019
|
] }) }),
|
|
15019
15020
|
/* @__PURE__ */ s("div", { className: "mt-2 flex items-baseline justify-between", children: [
|
|
15020
15021
|
/* @__PURE__ */ e("dd", { className: "text-xl text-gray-900 dark:text-gray-50", children: o(y) }),
|
|
@@ -15031,7 +15032,7 @@ function Oi({
|
|
|
15031
15032
|
index: "formattedDate",
|
|
15032
15033
|
colors: ["fuchsia", "gray"],
|
|
15033
15034
|
startEndOnly: !0,
|
|
15034
|
-
valueFormatter: (
|
|
15035
|
+
valueFormatter: (w) => o(w),
|
|
15035
15036
|
showYAxis: !1,
|
|
15036
15037
|
showLegend: !1,
|
|
15037
15038
|
categories: f,
|
|
@@ -15148,7 +15149,7 @@ function Or({
|
|
|
15148
15149
|
/* @__PURE__ */ s("div", { children: [
|
|
15149
15150
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
15150
15151
|
/* @__PURE__ */ e("dt", { className: "font-bold text-gray-900 sm:text-sm dark:text-gray-50", children: t }),
|
|
15151
|
-
/* @__PURE__ */ e(
|
|
15152
|
+
/* @__PURE__ */ e(Tt, { variant: "neutral", children: a })
|
|
15152
15153
|
] }),
|
|
15153
15154
|
/* @__PURE__ */ s("dd", { className: "mt-2 flex items-baseline gap-2", children: [
|
|
15154
15155
|
/* @__PURE__ */ e("span", { className: "text-xl text-gray-900 dark:text-gray-50", children: r }),
|
|
@@ -15652,7 +15653,7 @@ const ac = ({ value: t, onChange: a }) => {
|
|
|
15652
15653
|
ut
|
|
15653
15654
|
],
|
|
15654
15655
|
variants: {
|
|
15655
|
-
hasError: { true:
|
|
15656
|
+
hasError: { true: pa },
|
|
15656
15657
|
enableStepper: {
|
|
15657
15658
|
false: "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none"
|
|
15658
15659
|
},
|
|
@@ -15793,11 +15794,11 @@ const sc = ({ ...t }) => {
|
|
|
15793
15794
|
{
|
|
15794
15795
|
className: "absolute w-6 h-6 bg-black flex items-center justify-center rounded-md right-1 top-1",
|
|
15795
15796
|
onClick: () => c(m.id),
|
|
15796
|
-
children: /* @__PURE__ */ e(
|
|
15797
|
+
children: /* @__PURE__ */ e(Kt, { className: "w-4 h-4 text-white" })
|
|
15797
15798
|
}
|
|
15798
15799
|
),
|
|
15799
15800
|
/* @__PURE__ */ e(
|
|
15800
|
-
|
|
15801
|
+
he,
|
|
15801
15802
|
{
|
|
15802
15803
|
src: m.url,
|
|
15803
15804
|
alt: m.filename,
|
|
@@ -15830,7 +15831,7 @@ const sc = ({ ...t }) => {
|
|
|
15830
15831
|
"%)"
|
|
15831
15832
|
] })
|
|
15832
15833
|
] }) : /* @__PURE__ */ s(C, { children: [
|
|
15833
|
-
/* @__PURE__ */ e(
|
|
15834
|
+
/* @__PURE__ */ e(Zt, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }),
|
|
15834
15835
|
/* @__PURE__ */ e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })
|
|
15835
15836
|
] }) }),
|
|
15836
15837
|
/* @__PURE__ */ e(
|
|
@@ -15868,7 +15869,7 @@ const sc = ({ ...t }) => {
|
|
|
15868
15869
|
"%)"
|
|
15869
15870
|
] })
|
|
15870
15871
|
] }) : /* @__PURE__ */ s(C, { children: [
|
|
15871
|
-
/* @__PURE__ */ e(
|
|
15872
|
+
/* @__PURE__ */ e(Zt, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }),
|
|
15872
15873
|
/* @__PURE__ */ e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })
|
|
15873
15874
|
] }) }),
|
|
15874
15875
|
/* @__PURE__ */ e(
|
|
@@ -15922,7 +15923,7 @@ const nc = ({
|
|
|
15922
15923
|
i.filter((o) => o.value).map((o, l) => /* @__PURE__ */ s("option", { value: o.value, children: [
|
|
15923
15924
|
o.label,
|
|
15924
15925
|
" ",
|
|
15925
|
-
o.value && `+${
|
|
15926
|
+
o.value && `+${ra.getCountryCallingCode(o.value)}`
|
|
15926
15927
|
] }, o.value ?? `empty-${l}`))
|
|
15927
15928
|
]
|
|
15928
15929
|
}
|
|
@@ -15937,7 +15938,7 @@ const nc = ({
|
|
|
15937
15938
|
}) => {
|
|
15938
15939
|
const i = De();
|
|
15939
15940
|
return /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(
|
|
15940
|
-
|
|
15941
|
+
ra.default,
|
|
15941
15942
|
{
|
|
15942
15943
|
id: i,
|
|
15943
15944
|
className: "flex rounded-lg shadow-xs shadow-black/5",
|
|
@@ -16106,12 +16107,12 @@ const nc = ({
|
|
|
16106
16107
|
}), Zi = R.forwardRef(({ className: t, size: a, ...r }, i) => {
|
|
16107
16108
|
const { root: n, thumb: o } = dc({ size: a });
|
|
16108
16109
|
return /* @__PURE__ */ e(
|
|
16109
|
-
|
|
16110
|
+
Wt.Root,
|
|
16110
16111
|
{
|
|
16111
16112
|
ref: i,
|
|
16112
16113
|
className: x(n(), t),
|
|
16113
16114
|
...r,
|
|
16114
|
-
children: /* @__PURE__ */ e(
|
|
16115
|
+
children: /* @__PURE__ */ e(Wt.Thumb, { className: x(o()) })
|
|
16115
16116
|
}
|
|
16116
16117
|
);
|
|
16117
16118
|
});
|
|
@@ -16216,7 +16217,7 @@ const cc = ({
|
|
|
16216
16217
|
localizable: c,
|
|
16217
16218
|
prefix: u
|
|
16218
16219
|
}) => {
|
|
16219
|
-
const { errors: p } =
|
|
16220
|
+
const { errors: p } = Gt(), m = uc(p, a);
|
|
16220
16221
|
return /* @__PURE__ */ s(
|
|
16221
16222
|
"div",
|
|
16222
16223
|
{
|
|
@@ -16239,7 +16240,7 @@ const cc = ({
|
|
|
16239
16240
|
c && /* @__PURE__ */ e(Gr, { className: "w-4 h-4 ml-1 text-gray-500" })
|
|
16240
16241
|
] }),
|
|
16241
16242
|
n && c && /* @__PURE__ */ s("span", { className: "flex items-center text-xs text-gray-500 ml-1 bg-gray-100 px-1 py-0.5 rounded", children: [
|
|
16242
|
-
|
|
16243
|
+
ia.get(n),
|
|
16243
16244
|
" (",
|
|
16244
16245
|
n,
|
|
16245
16246
|
")"
|
|
@@ -16268,7 +16269,7 @@ const cc = ({
|
|
|
16268
16269
|
columns: r = 2
|
|
16269
16270
|
}) => {
|
|
16270
16271
|
var c;
|
|
16271
|
-
const { errors: i } =
|
|
16272
|
+
const { errors: i } = Gt(), n = ji(i, a.name), { fields: o, append: l, remove: d } = Ea({
|
|
16272
16273
|
control: t.control,
|
|
16273
16274
|
name: a.name
|
|
16274
16275
|
});
|
|
@@ -16296,8 +16297,8 @@ const cc = ({
|
|
|
16296
16297
|
label: f,
|
|
16297
16298
|
type: y,
|
|
16298
16299
|
colspan: b,
|
|
16299
|
-
localizable:
|
|
16300
|
-
multiple:
|
|
16300
|
+
localizable: S,
|
|
16301
|
+
multiple: w,
|
|
16301
16302
|
options: k,
|
|
16302
16303
|
placeholder: v,
|
|
16303
16304
|
prefix: A
|
|
@@ -16307,7 +16308,7 @@ const cc = ({
|
|
|
16307
16308
|
name: `${a.name}[${p}].${h}`,
|
|
16308
16309
|
label: f,
|
|
16309
16310
|
type: y ?? "text",
|
|
16310
|
-
localizable:
|
|
16311
|
+
localizable: S,
|
|
16311
16312
|
className: x({
|
|
16312
16313
|
"col-span-1": b === 1,
|
|
16313
16314
|
"col-span-2": b === 2,
|
|
@@ -16315,7 +16316,7 @@ const cc = ({
|
|
|
16315
16316
|
"col-span-4": b === 4
|
|
16316
16317
|
}),
|
|
16317
16318
|
placeholder: v,
|
|
16318
|
-
multiple:
|
|
16319
|
+
multiple: w,
|
|
16319
16320
|
options: k,
|
|
16320
16321
|
prefix: A
|
|
16321
16322
|
},
|
|
@@ -16361,7 +16362,7 @@ const cc = ({
|
|
|
16361
16362
|
columns: a = 2
|
|
16362
16363
|
}) => {
|
|
16363
16364
|
var n;
|
|
16364
|
-
const { errors: r } =
|
|
16365
|
+
const { errors: r } = Gt(), i = ji(r, t.name);
|
|
16365
16366
|
return (n = t.fields) != null && n.length ? /* @__PURE__ */ s("div", { className: "w-full col-span-full", children: [
|
|
16366
16367
|
t.label && /* @__PURE__ */ e("h4", { className: "text-2xl font-semibold mb-2", children: t.label }),
|
|
16367
16368
|
t.description && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 mb-3", children: t.description }),
|
|
@@ -16421,8 +16422,8 @@ function gc(t, a) {
|
|
|
16421
16422
|
children: typeof a == "function" ? a(n.props.children) : a
|
|
16422
16423
|
});
|
|
16423
16424
|
}
|
|
16424
|
-
const mr = R.forwardRef(({ className: t, children: a, ...r }, i) => /* @__PURE__ */ e(
|
|
16425
|
-
|
|
16425
|
+
const mr = R.forwardRef(({ className: t, children: a, ...r }, i) => /* @__PURE__ */ e($t.Root, { ref: i, ...r, asChild: !1, children: /* @__PURE__ */ e(
|
|
16426
|
+
$t.List,
|
|
16426
16427
|
{
|
|
16427
16428
|
className: x(
|
|
16428
16429
|
// base
|
|
@@ -16435,8 +16436,8 @@ const mr = R.forwardRef(({ className: t, children: a, ...r }, i) => /* @__PURE__
|
|
|
16435
16436
|
}
|
|
16436
16437
|
) }));
|
|
16437
16438
|
mr.displayName = "TabNavigation";
|
|
16438
|
-
const gr = R.forwardRef(({ asChild: t, disabled: a, className: r, children: i, ...n }, o) => /* @__PURE__ */ e(
|
|
16439
|
-
|
|
16439
|
+
const gr = R.forwardRef(({ asChild: t, disabled: a, className: r, children: i, ...n }, o) => /* @__PURE__ */ e($t.Item, { className: "flex", "aria-disabled": a, children: /* @__PURE__ */ e(
|
|
16440
|
+
$t.Link,
|
|
16440
16441
|
{
|
|
16441
16442
|
"aria-disabled": a,
|
|
16442
16443
|
className: x(
|
|
@@ -16484,8 +16485,8 @@ const Ee = ({
|
|
|
16484
16485
|
columns: l = 2,
|
|
16485
16486
|
onSubmit: d
|
|
16486
16487
|
}) => {
|
|
16487
|
-
const c = t.watch("translations"), { organization: u, defaultLocale: p, supportedLocales: m } =
|
|
16488
|
-
() => r.some((
|
|
16488
|
+
const c = t.watch("translations"), { organization: u, defaultLocale: p, supportedLocales: m } = pe(), [h, f] = I(), y = Se(
|
|
16489
|
+
() => r.some((S) => S.localizable),
|
|
16489
16490
|
[r]
|
|
16490
16491
|
);
|
|
16491
16492
|
X(() => {
|
|
@@ -16509,26 +16510,26 @@ const Ee = ({
|
|
|
16509
16510
|
"grid-cols-4": l === 4
|
|
16510
16511
|
}),
|
|
16511
16512
|
children: [
|
|
16512
|
-
y && /* @__PURE__ */ e("div", { className: "col-span-full", children: /* @__PURE__ */ e(mr, { className: "col-span-full mb-3", children: m.map((
|
|
16513
|
-
const
|
|
16513
|
+
y && /* @__PURE__ */ e("div", { className: "col-span-full", children: /* @__PURE__ */ e(mr, { className: "col-span-full mb-3", children: m.map((S) => {
|
|
16514
|
+
const w = S === p;
|
|
16514
16515
|
return /* @__PURE__ */ e(
|
|
16515
16516
|
gr,
|
|
16516
16517
|
{
|
|
16517
|
-
active:
|
|
16518
|
-
onClick: () => f(
|
|
16518
|
+
active: S === h,
|
|
16519
|
+
onClick: () => f(S),
|
|
16519
16520
|
className: "cursor-pointer",
|
|
16520
16521
|
children: /* @__PURE__ */ s(C, { children: [
|
|
16521
|
-
|
|
16522
|
+
ia.get(S),
|
|
16522
16523
|
" ",
|
|
16523
|
-
|
|
16524
|
+
w && "(Default)"
|
|
16524
16525
|
] })
|
|
16525
16526
|
},
|
|
16526
|
-
|
|
16527
|
+
S
|
|
16527
16528
|
);
|
|
16528
16529
|
}) }) }),
|
|
16529
|
-
r.map((
|
|
16530
|
+
r.map((S) => {
|
|
16530
16531
|
const {
|
|
16531
|
-
name:
|
|
16532
|
+
name: w,
|
|
16532
16533
|
label: k,
|
|
16533
16534
|
type: v,
|
|
16534
16535
|
colspan: A,
|
|
@@ -16537,8 +16538,8 @@ const Ee = ({
|
|
|
16537
16538
|
options: ie,
|
|
16538
16539
|
placeholder: ae,
|
|
16539
16540
|
prefix: Z
|
|
16540
|
-
} =
|
|
16541
|
-
return v === "object" ? /* @__PURE__ */ e(mc, { config:
|
|
16541
|
+
} = S, J = !P || !h ? w : `translations[${m == null ? void 0 : m.indexOf(h)}].${w}`;
|
|
16542
|
+
return v === "object" ? /* @__PURE__ */ e(mc, { config: S }, w) : v === "array" ? /* @__PURE__ */ e(pc, { form: t, config: S }, w) : /* @__PURE__ */ e(
|
|
16542
16543
|
Ae,
|
|
16543
16544
|
{
|
|
16544
16545
|
name: J,
|
|
@@ -16585,7 +16586,7 @@ const Ee = ({
|
|
|
16585
16586
|
]
|
|
16586
16587
|
}
|
|
16587
16588
|
);
|
|
16588
|
-
return d ? /* @__PURE__ */ e(Ge, { ...t, children: /* @__PURE__ */ e("form", { onSubmit: t.handleSubmit((
|
|
16589
|
+
return d ? /* @__PURE__ */ e(Ge, { ...t, children: /* @__PURE__ */ e("form", { onSubmit: t.handleSubmit((S) => d(S)), children: b }) }) : /* @__PURE__ */ e("div", { className: "w-full", children: b });
|
|
16589
16590
|
}, hc = [
|
|
16590
16591
|
{
|
|
16591
16592
|
name: "name",
|
|
@@ -16608,7 +16609,7 @@ const Ee = ({
|
|
|
16608
16609
|
type: "file"
|
|
16609
16610
|
}
|
|
16610
16611
|
], Ui = ({ initialData: t }) => {
|
|
16611
|
-
const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } =
|
|
16612
|
+
const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = pe(), c = de({
|
|
16612
16613
|
resolver: ce(t ? sl : rl),
|
|
16613
16614
|
defaultValues: t ? {
|
|
16614
16615
|
defaultLocale: o,
|
|
@@ -16621,12 +16622,12 @@ const Ee = ({
|
|
|
16621
16622
|
}
|
|
16622
16623
|
}), u = $({
|
|
16623
16624
|
mutationFn: async (f) => {
|
|
16624
|
-
var
|
|
16625
|
+
var S;
|
|
16625
16626
|
const y = {
|
|
16626
16627
|
name: f.name,
|
|
16627
16628
|
defaultLocale: f.defaultLocale,
|
|
16628
16629
|
translations: f.translations,
|
|
16629
|
-
logoId: (
|
|
16630
|
+
logoId: (S = f.logo) == null ? void 0 : S.id
|
|
16630
16631
|
}, { status: b } = await a.manufacturer.createManufacturer({
|
|
16631
16632
|
params: { organizationId: n },
|
|
16632
16633
|
body: y
|
|
@@ -16636,12 +16637,12 @@ const Ee = ({
|
|
|
16636
16637
|
}
|
|
16637
16638
|
}), p = $({
|
|
16638
16639
|
mutationFn: async (f) => {
|
|
16639
|
-
var
|
|
16640
|
+
var S;
|
|
16640
16641
|
const y = {
|
|
16641
16642
|
name: f.name,
|
|
16642
16643
|
defaultLocale: f.defaultLocale,
|
|
16643
16644
|
translations: f.translations,
|
|
16644
|
-
logoId: ((
|
|
16645
|
+
logoId: ((S = f.logo) == null ? void 0 : S.id) || null
|
|
16645
16646
|
}, { status: b } = await a.manufacturer.updateManufacturer({
|
|
16646
16647
|
params: { organizationId: n, id: t.id },
|
|
16647
16648
|
body: y
|
|
@@ -16687,7 +16688,7 @@ function fc() {
|
|
|
16687
16688
|
] });
|
|
16688
16689
|
}
|
|
16689
16690
|
function yc() {
|
|
16690
|
-
const t = ee(), a =
|
|
16691
|
+
const t = ee(), a = ha(), { client: r } = L(), { isLoading: i, data: n } = G({
|
|
16691
16692
|
queryKey: ["manufacturers", t, a],
|
|
16692
16693
|
queryFn: async () => {
|
|
16693
16694
|
const { status: o, body: l } = await r.manufacturer.getManufacturer({
|
|
@@ -16718,7 +16719,7 @@ function yc() {
|
|
|
16718
16719
|
/* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the manufacturer." })
|
|
16719
16720
|
] }),
|
|
16720
16721
|
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: i || !n ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen mt-5", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
|
|
16721
|
-
/* @__PURE__ */ e(
|
|
16722
|
+
/* @__PURE__ */ e(fe, { className: "w-12 h-12" }),
|
|
16722
16723
|
/* @__PURE__ */ e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })
|
|
16723
16724
|
] }) }) : /* @__PURE__ */ e(Ui, { initialData: n }) })
|
|
16724
16725
|
] }) }) }) })
|
|
@@ -16801,7 +16802,7 @@ const wt = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
16801
16802
|
}
|
|
16802
16803
|
));
|
|
16803
16804
|
wt.displayName = "TableRow";
|
|
16804
|
-
const
|
|
16805
|
+
const Ft = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
16805
16806
|
"td",
|
|
16806
16807
|
{
|
|
16807
16808
|
ref: r,
|
|
@@ -16815,7 +16816,7 @@ const jt = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
16815
16816
|
...a
|
|
16816
16817
|
}
|
|
16817
16818
|
));
|
|
16818
|
-
|
|
16819
|
+
Ft.displayName = "TableCell";
|
|
16819
16820
|
const bc = R.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
16820
16821
|
"tfoot",
|
|
16821
16822
|
{
|
|
@@ -16915,7 +16916,7 @@ const Xi = N.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
16915
16916
|
}
|
|
16916
16917
|
));
|
|
16917
16918
|
Xi.displayName = "CommandBarBar";
|
|
16918
|
-
const
|
|
16919
|
+
const jt = N.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
16919
16920
|
"div",
|
|
16920
16921
|
{
|
|
16921
16922
|
ref: r,
|
|
@@ -16923,8 +16924,8 @@ const Vt = N.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
|
16923
16924
|
...a
|
|
16924
16925
|
}
|
|
16925
16926
|
));
|
|
16926
|
-
|
|
16927
|
-
const
|
|
16927
|
+
jt.displayName = "CommandBar.Seperator";
|
|
16928
|
+
const Vt = N.forwardRef(
|
|
16928
16929
|
({
|
|
16929
16930
|
className: t,
|
|
16930
16931
|
type: a = "button",
|
|
@@ -16973,7 +16974,7 @@ const Ht = N.forwardRef(
|
|
|
16973
16974
|
}
|
|
16974
16975
|
))
|
|
16975
16976
|
);
|
|
16976
|
-
|
|
16977
|
+
Vt.displayName = "CommandBar.Command";
|
|
16977
16978
|
function kc({
|
|
16978
16979
|
table: t,
|
|
16979
16980
|
rowSelection: a
|
|
@@ -16984,9 +16985,9 @@ function kc({
|
|
|
16984
16985
|
Object.keys(a).length,
|
|
16985
16986
|
" selected"
|
|
16986
16987
|
] }),
|
|
16987
|
-
/* @__PURE__ */ e(
|
|
16988
|
+
/* @__PURE__ */ e(jt, {}),
|
|
16988
16989
|
/* @__PURE__ */ e(
|
|
16989
|
-
|
|
16990
|
+
Vt,
|
|
16990
16991
|
{
|
|
16991
16992
|
label: "Edit",
|
|
16992
16993
|
action: () => {
|
|
@@ -16995,9 +16996,9 @@ function kc({
|
|
|
16995
16996
|
shortcut: { shortcut: "e" }
|
|
16996
16997
|
}
|
|
16997
16998
|
),
|
|
16998
|
-
/* @__PURE__ */ e(
|
|
16999
|
+
/* @__PURE__ */ e(jt, {}),
|
|
16999
17000
|
/* @__PURE__ */ e(
|
|
17000
|
-
|
|
17001
|
+
Vt,
|
|
17001
17002
|
{
|
|
17002
17003
|
label: "Delete",
|
|
17003
17004
|
action: () => {
|
|
@@ -17006,9 +17007,9 @@ function kc({
|
|
|
17006
17007
|
shortcut: { shortcut: "d" }
|
|
17007
17008
|
}
|
|
17008
17009
|
),
|
|
17009
|
-
/* @__PURE__ */ e(
|
|
17010
|
+
/* @__PURE__ */ e(jt, {}),
|
|
17010
17011
|
/* @__PURE__ */ e(
|
|
17011
|
-
|
|
17012
|
+
Vt,
|
|
17012
17013
|
{
|
|
17013
17014
|
label: "Reset",
|
|
17014
17015
|
action: () => {
|
|
@@ -17023,9 +17024,9 @@ function vc({
|
|
|
17023
17024
|
meta: t,
|
|
17024
17025
|
table: a
|
|
17025
17026
|
}) {
|
|
17026
|
-
const i =
|
|
17027
|
-
const
|
|
17028
|
-
return
|
|
17027
|
+
const i = ye(), n = K(), o = nt(), l = Number((i == null ? void 0 : i.get("page")) || "1"), d = (y, b) => {
|
|
17028
|
+
const S = new URLSearchParams(i == null ? void 0 : i.toString());
|
|
17029
|
+
return S.set(y, b), S.toString();
|
|
17029
17030
|
}, c = (y) => {
|
|
17030
17031
|
n.push(`${o}?${d("page", y.toString())}`);
|
|
17031
17032
|
}, u = [
|
|
@@ -17037,7 +17038,7 @@ function vc({
|
|
|
17037
17038
|
mobileView: "hidden sm:block"
|
|
17038
17039
|
},
|
|
17039
17040
|
{
|
|
17040
|
-
icon:
|
|
17041
|
+
icon: Ut,
|
|
17041
17042
|
onClick: () => c(l - 1),
|
|
17042
17043
|
disabled: !(t != null && t.previousPage),
|
|
17043
17044
|
srText: "Previous page",
|
|
@@ -17127,7 +17128,7 @@ function pt({
|
|
|
17127
17128
|
n && !i ? (
|
|
17128
17129
|
// Render a loading spinner when loading is true
|
|
17129
17130
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-center h-48", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
|
|
17130
|
-
/* @__PURE__ */ e(
|
|
17131
|
+
/* @__PURE__ */ e(fe, { className: "w-10 h-10" }),
|
|
17131
17132
|
/* @__PURE__ */ e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })
|
|
17132
17133
|
] }) })
|
|
17133
17134
|
) : /* @__PURE__ */ s(C, { children: [
|
|
@@ -17137,13 +17138,13 @@ function pt({
|
|
|
17137
17138
|
{
|
|
17138
17139
|
className: "border-y border-gray-200 dark:border-gray-800 back",
|
|
17139
17140
|
children: y.headers.map((b) => {
|
|
17140
|
-
var
|
|
17141
|
+
var S;
|
|
17141
17142
|
return /* @__PURE__ */ e(
|
|
17142
17143
|
_i,
|
|
17143
17144
|
{
|
|
17144
17145
|
className: x(
|
|
17145
17146
|
"whitespace-nowrap py-1 text-sm sm:text-xs",
|
|
17146
|
-
(
|
|
17147
|
+
(S = b.column.columnDef.meta) == null ? void 0 : S.className
|
|
17147
17148
|
),
|
|
17148
17149
|
children: Nr(
|
|
17149
17150
|
b.column.columnDef.header,
|
|
@@ -17158,7 +17159,7 @@ function pt({
|
|
|
17158
17159
|
)) }),
|
|
17159
17160
|
/* @__PURE__ */ s(qi, { children: [
|
|
17160
17161
|
r && /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(
|
|
17161
|
-
|
|
17162
|
+
Ft,
|
|
17162
17163
|
{
|
|
17163
17164
|
colSpan: a.length,
|
|
17164
17165
|
className: "h-24 text-center text-red-500",
|
|
@@ -17169,18 +17170,18 @@ function pt({
|
|
|
17169
17170
|
wt,
|
|
17170
17171
|
{
|
|
17171
17172
|
className: "group select-none hover:bg-gray-50 dark:hover:bg-gray-900",
|
|
17172
|
-
children: y.getVisibleCells().map((b,
|
|
17173
|
-
var
|
|
17173
|
+
children: y.getVisibleCells().map((b, S) => {
|
|
17174
|
+
var w;
|
|
17174
17175
|
return /* @__PURE__ */ s(
|
|
17175
|
-
|
|
17176
|
+
Ft,
|
|
17176
17177
|
{
|
|
17177
17178
|
className: x(
|
|
17178
17179
|
y.getIsSelected() ? "bg-gray-50 dark:bg-gray-900" : "",
|
|
17179
17180
|
"relative whitespace-nowrap py-1 text-gray-600 first:w-10 dark:text-gray-400",
|
|
17180
|
-
(
|
|
17181
|
+
(w = b.column.columnDef.meta) == null ? void 0 : w.className
|
|
17181
17182
|
),
|
|
17182
17183
|
children: [
|
|
17183
|
-
|
|
17184
|
+
S === 0 && y.getIsSelected() && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 w-0.5 bg-blue-600 dark:bg-blue-500" }),
|
|
17184
17185
|
Nr(
|
|
17185
17186
|
b.column.columnDef.cell,
|
|
17186
17187
|
b.getContext()
|
|
@@ -17194,7 +17195,7 @@ function pt({
|
|
|
17194
17195
|
y.id
|
|
17195
17196
|
)),
|
|
17196
17197
|
((f = m.getRowModel().rows) == null ? void 0 : f.length) === 0 && !n && /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(
|
|
17197
|
-
|
|
17198
|
+
Ft,
|
|
17198
17199
|
{
|
|
17199
17200
|
colSpan: a.length,
|
|
17200
17201
|
className: "h-24 text-center",
|
|
@@ -17205,7 +17206,7 @@ function pt({
|
|
|
17205
17206
|
] }),
|
|
17206
17207
|
n && i && // Render a loading overlay when refetching is true
|
|
17207
17208
|
/* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-white bg-opacity-75 dark:bg-gray-900 dark:bg-opacity-75", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
|
|
17208
|
-
/* @__PURE__ */ e(
|
|
17209
|
+
/* @__PURE__ */ e(fe, { className: "w-10 h-10" }),
|
|
17209
17210
|
/* @__PURE__ */ e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })
|
|
17210
17211
|
] }) })
|
|
17211
17212
|
] }),
|
|
@@ -17238,7 +17239,7 @@ const Ac = Pe({
|
|
|
17238
17239
|
],
|
|
17239
17240
|
variants: {
|
|
17240
17241
|
hasError: {
|
|
17241
|
-
true:
|
|
17242
|
+
true: pa
|
|
17242
17243
|
},
|
|
17243
17244
|
// number input
|
|
17244
17245
|
enableStepper: {
|
|
@@ -17499,7 +17500,7 @@ const Nc = N.forwardRef(
|
|
|
17499
17500
|
...o,
|
|
17500
17501
|
children: [
|
|
17501
17502
|
/* @__PURE__ */ e("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ e(ne.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
17502
|
-
|
|
17503
|
+
ta,
|
|
17503
17504
|
{
|
|
17504
17505
|
"aria-hidden": "true",
|
|
17505
17506
|
className: "size-full shrink-0 text-gray-800 dark:text-gray-200"
|
|
@@ -17529,7 +17530,7 @@ const Nc = N.forwardRef(
|
|
|
17529
17530
|
)
|
|
17530
17531
|
);
|
|
17531
17532
|
Nc.displayName = "DropdownMenuCheckboxItem";
|
|
17532
|
-
const
|
|
17533
|
+
const Ht = N.forwardRef(
|
|
17533
17534
|
({ className: t, hint: a, shortcut: r, children: i, iconType: n = "radio", ...o }, l) => /* @__PURE__ */ s(
|
|
17534
17535
|
ne.RadioItem,
|
|
17535
17536
|
{
|
|
@@ -17565,7 +17566,7 @@ const Zt = N.forwardRef(
|
|
|
17565
17566
|
}
|
|
17566
17567
|
)
|
|
17567
17568
|
] }) : n === "check" ? /* @__PURE__ */ e("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ e(
|
|
17568
|
-
|
|
17569
|
+
ta,
|
|
17569
17570
|
{
|
|
17570
17571
|
"aria-hidden": "true",
|
|
17571
17572
|
className: "size-full shrink-0 text-gray-800 group-data-[state=checked]/DropdownMenuRadioItem:flex group-data-[state=unchecked]/DropdownMenuRadioItem:hidden dark:text-gray-200"
|
|
@@ -17594,7 +17595,7 @@ const Zt = N.forwardRef(
|
|
|
17594
17595
|
}
|
|
17595
17596
|
)
|
|
17596
17597
|
);
|
|
17597
|
-
|
|
17598
|
+
Ht.displayName = "DropdownMenuRadioItem";
|
|
17598
17599
|
const fa = N.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
17599
17600
|
ne.Label,
|
|
17600
17601
|
{
|
|
@@ -17722,7 +17723,7 @@ const at = ot(), Cc = [
|
|
|
17722
17723
|
variant: "ghost",
|
|
17723
17724
|
className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900",
|
|
17724
17725
|
children: /* @__PURE__ */ e(
|
|
17725
|
-
|
|
17726
|
+
aa,
|
|
17726
17727
|
{
|
|
17727
17728
|
className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300",
|
|
17728
17729
|
"aria-hidden": "true"
|
|
@@ -17745,7 +17746,7 @@ const at = ot(), Cc = [
|
|
|
17745
17746
|
}
|
|
17746
17747
|
})
|
|
17747
17748
|
], Pc = () => {
|
|
17748
|
-
const { client: t } = L(), a = te(), r = ee(), i =
|
|
17749
|
+
const { client: t } = L(), a = te(), r = ee(), i = ye(), [n, o] = I(""), [l] = Xe(n, 300), d = Number((i == null ? void 0 : i.get("page")) || "1"), { isLoading: c, isRefetching: u, isError: p, data: m } = G({
|
|
17749
17750
|
queryKey: ["manufacturers", r, d, l],
|
|
17750
17751
|
queryFn: async () => {
|
|
17751
17752
|
const { body: h, status: f } = await t.manufacturer.getManufacturers({
|
|
@@ -17885,7 +17886,7 @@ const Qc = ({
|
|
|
17885
17886
|
"tremor-id": "tremor-raw",
|
|
17886
17887
|
children: [
|
|
17887
17888
|
u && p !== "cancelled" ? "Loading..." : l,
|
|
17888
|
-
/* @__PURE__ */ e(
|
|
17889
|
+
/* @__PURE__ */ e(Yt, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" })
|
|
17889
17890
|
]
|
|
17890
17891
|
}
|
|
17891
17892
|
)
|
|
@@ -17918,16 +17919,16 @@ const Qc = ({
|
|
|
17918
17919
|
return "gray";
|
|
17919
17920
|
}
|
|
17920
17921
|
};
|
|
17921
|
-
return /* @__PURE__ */ e(
|
|
17922
|
-
/* @__PURE__ */ s(
|
|
17922
|
+
return /* @__PURE__ */ e(Qt, { open: t, onOpenChange: a, children: /* @__PURE__ */ s(It, { className: "sm:max-w-3xl overflow-y-auto max-h-[85vh]", children: [
|
|
17923
|
+
/* @__PURE__ */ s(Lt, { children: [
|
|
17923
17924
|
/* @__PURE__ */ s("div", { className: "flex justify-between items-center", children: [
|
|
17924
|
-
/* @__PURE__ */ s(
|
|
17925
|
+
/* @__PURE__ */ s(Et, { children: [
|
|
17925
17926
|
"Order Details #",
|
|
17926
17927
|
r.referenceId
|
|
17927
17928
|
] }),
|
|
17928
|
-
/* @__PURE__ */ e(
|
|
17929
|
+
/* @__PURE__ */ e(qt, { className: "rounded-full hover:bg-gray-200 p-1 dark:hover:bg-gray-800", children: /* @__PURE__ */ e(At, { className: "h-5 w-5" }) })
|
|
17929
17930
|
] }),
|
|
17930
|
-
/* @__PURE__ */ e(
|
|
17931
|
+
/* @__PURE__ */ e(Dt, { children: r.acceptedAt ? `Ordered on ${V(
|
|
17931
17932
|
new Date(r.acceptedAt),
|
|
17932
17933
|
"MMMM dd, yyyy"
|
|
17933
17934
|
)}` : "Order details" })
|
|
@@ -18207,7 +18208,7 @@ const Qc = ({
|
|
|
18207
18208
|
cell: ({ row: t, table: a }) => /* @__PURE__ */ e(Ec, { order: t.original, table: a })
|
|
18208
18209
|
})
|
|
18209
18210
|
], zc = () => {
|
|
18210
|
-
const { client: t } = L(), a = ee(), r =
|
|
18211
|
+
const { client: t } = L(), a = ee(), r = ye(), [i, n] = I(""), [o] = Xe(i, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: c, isError: u, data: p, refetch: m } = G({
|
|
18211
18212
|
queryKey: ["orders", a, l, o],
|
|
18212
18213
|
queryFn: async () => {
|
|
18213
18214
|
const { body: h, status: f } = await t.order.getOrders({
|
|
@@ -18452,7 +18453,7 @@ const rn = ({
|
|
|
18452
18453
|
}
|
|
18453
18454
|
) }) });
|
|
18454
18455
|
}, Bc = () => {
|
|
18455
|
-
const [t, a] = I(!1), r = te(), { organizations: i } =
|
|
18456
|
+
const [t, a] = I(!1), r = te(), { organizations: i } = pe(), n = () => a(!1);
|
|
18456
18457
|
return /* @__PURE__ */ s(C, { children: [
|
|
18457
18458
|
/* @__PURE__ */ s("div", { className: "max-w-4xl mx-auto py-8 px-4", children: [
|
|
18458
18459
|
/* @__PURE__ */ s("div", { className: "flex justify-between items-center", children: [
|
|
@@ -18508,7 +18509,7 @@ const rn = ({
|
|
|
18508
18509
|
}
|
|
18509
18510
|
),
|
|
18510
18511
|
o.logoFile ? /* @__PURE__ */ e(
|
|
18511
|
-
|
|
18512
|
+
he,
|
|
18512
18513
|
{
|
|
18513
18514
|
src: o.logoFile.url,
|
|
18514
18515
|
alt: o.name,
|
|
@@ -18545,12 +18546,12 @@ const rn = ({
|
|
|
18545
18546
|
);
|
|
18546
18547
|
}) })
|
|
18547
18548
|
] }),
|
|
18548
|
-
/* @__PURE__ */ s(
|
|
18549
|
+
/* @__PURE__ */ s(Qt, { onOpenChange: n, open: t, children: [
|
|
18549
18550
|
/* @__PURE__ */ e(rr, { className: "w-full text-left" }),
|
|
18550
|
-
/* @__PURE__ */ s(
|
|
18551
|
-
/* @__PURE__ */ s(
|
|
18552
|
-
/* @__PURE__ */ e(
|
|
18553
|
-
/* @__PURE__ */ e(
|
|
18551
|
+
/* @__PURE__ */ s(It, { className: "sm:max-w-xl", children: [
|
|
18552
|
+
/* @__PURE__ */ s(Lt, { children: [
|
|
18553
|
+
/* @__PURE__ */ e(Et, { children: "Create a Organization" }),
|
|
18554
|
+
/* @__PURE__ */ e(Dt, { className: "mt-1 text-sm leading-6", children: "Fill in the details below to create a new organization" })
|
|
18554
18555
|
] }),
|
|
18555
18556
|
/* @__PURE__ */ e(rn, { onClose: n })
|
|
18556
18557
|
] })
|
|
@@ -18561,7 +18562,7 @@ function Jc() {
|
|
|
18561
18562
|
const { appearance: t } = Is(), a = t == null ? void 0 : t.organizationImage;
|
|
18562
18563
|
return /* @__PURE__ */ s("div", { className: "flex w-full min-h-screen", children: [
|
|
18563
18564
|
a && /* @__PURE__ */ e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: /* @__PURE__ */ e(
|
|
18564
|
-
|
|
18565
|
+
he,
|
|
18565
18566
|
{
|
|
18566
18567
|
src: a,
|
|
18567
18568
|
alt: "Organization Visual",
|
|
@@ -18597,7 +18598,7 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
|
|
|
18597
18598
|
"tremor-id": "tremor-raw",
|
|
18598
18599
|
disabled: !0,
|
|
18599
18600
|
children: [
|
|
18600
|
-
/* @__PURE__ */ e(
|
|
18601
|
+
/* @__PURE__ */ e(fe, { className: "w-4 h-4" }),
|
|
18601
18602
|
" Saving..."
|
|
18602
18603
|
]
|
|
18603
18604
|
}
|
|
@@ -18608,7 +18609,7 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
|
|
|
18608
18609
|
className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600",
|
|
18609
18610
|
"tremor-id": "tremor-raw",
|
|
18610
18611
|
children: [
|
|
18611
|
-
i ? /* @__PURE__ */ e(
|
|
18612
|
+
i ? /* @__PURE__ */ e(Yt, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" }) : /* @__PURE__ */ e(Xr, { className: "w-4 h-4 text-red-600 dark:text-red-500" }),
|
|
18612
18613
|
i ? "Published" : "Draft"
|
|
18613
18614
|
]
|
|
18614
18615
|
}
|
|
@@ -18638,8 +18639,8 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
|
|
|
18638
18639
|
variant: "ghost",
|
|
18639
18640
|
className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900",
|
|
18640
18641
|
disabled: o.isPending,
|
|
18641
|
-
children: o.isPending ? /* @__PURE__ */ e(
|
|
18642
|
-
|
|
18642
|
+
children: o.isPending ? /* @__PURE__ */ e(fe, { className: "size-4 shrink-0" }) : /* @__PURE__ */ e(
|
|
18643
|
+
aa,
|
|
18643
18644
|
{
|
|
18644
18645
|
className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300",
|
|
18645
18646
|
"aria-hidden": "true"
|
|
@@ -18666,7 +18667,7 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
|
|
|
18666
18667
|
onClick: l,
|
|
18667
18668
|
disabled: o.isPending,
|
|
18668
18669
|
children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
18669
|
-
o.isPending ? /* @__PURE__ */ e(
|
|
18670
|
+
o.isPending ? /* @__PURE__ */ e(fe, { className: "w-4 h-4" }) : /* @__PURE__ */ e(es, { className: "w-4 h-4" }),
|
|
18670
18671
|
o.isPending ? "Deleting..." : "Delete"
|
|
18671
18672
|
] })
|
|
18672
18673
|
}
|
|
@@ -18772,7 +18773,7 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
|
|
|
18772
18773
|
cell: ({ row: t, table: a }) => /* @__PURE__ */ e(Fc, { row: t, table: a })
|
|
18773
18774
|
})
|
|
18774
18775
|
], Vc = () => {
|
|
18775
|
-
const { client: t } = L(), a = te(), { defaultLocale: r } =
|
|
18776
|
+
const { client: t } = L(), a = te(), { defaultLocale: r } = pe(), i = ee(), n = ye(), [o, l] = I(""), d = Number((n == null ? void 0 : n.get("page")) || "1"), [c] = Xe(o, 300), { isLoading: u, isRefetching: p, isError: m, data: h, refetch: f } = G({
|
|
18776
18777
|
queryKey: [
|
|
18777
18778
|
"productCategories",
|
|
18778
18779
|
i,
|
|
@@ -18874,7 +18875,7 @@ const Zc = [
|
|
|
18874
18875
|
], sn = ({
|
|
18875
18876
|
initialData: t
|
|
18876
18877
|
}) => {
|
|
18877
|
-
const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } =
|
|
18878
|
+
const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = pe(), c = de({
|
|
18878
18879
|
resolver: ce(t ? jo : Fo),
|
|
18879
18880
|
defaultValues: t ? {
|
|
18880
18881
|
defaultLocale: o,
|
|
@@ -18887,12 +18888,12 @@ const Zc = [
|
|
|
18887
18888
|
}
|
|
18888
18889
|
}), u = $({
|
|
18889
18890
|
mutationFn: async (f) => {
|
|
18890
|
-
var
|
|
18891
|
+
var S;
|
|
18891
18892
|
const y = {
|
|
18892
18893
|
slug: f.slug,
|
|
18893
18894
|
defaultLocale: f.defaultLocale,
|
|
18894
18895
|
translations: f.translations,
|
|
18895
|
-
imageId: (
|
|
18896
|
+
imageId: (S = f.image) == null ? void 0 : S.id
|
|
18896
18897
|
}, { status: b } = await a.productCategory.createProductCategory({
|
|
18897
18898
|
params: { organizationId: n },
|
|
18898
18899
|
body: y
|
|
@@ -18904,12 +18905,12 @@ const Zc = [
|
|
|
18904
18905
|
}
|
|
18905
18906
|
}), p = $({
|
|
18906
18907
|
mutationFn: async (f) => {
|
|
18907
|
-
var
|
|
18908
|
+
var S;
|
|
18908
18909
|
const y = {
|
|
18909
18910
|
slug: f.slug,
|
|
18910
18911
|
defaultLocale: f.defaultLocale,
|
|
18911
18912
|
translations: f.translations,
|
|
18912
|
-
imageId: ((
|
|
18913
|
+
imageId: ((S = f.image) == null ? void 0 : S.id) || null
|
|
18913
18914
|
}, { status: b } = await a.productCategory.updateProductCategory({
|
|
18914
18915
|
params: { organizationId: n, id: t.id },
|
|
18915
18916
|
body: y
|
|
@@ -18961,7 +18962,7 @@ function Uc() {
|
|
|
18961
18962
|
] });
|
|
18962
18963
|
}
|
|
18963
18964
|
function Wc() {
|
|
18964
|
-
const t = ee(), a =
|
|
18965
|
+
const t = ee(), a = ha(), { client: r } = L(), { isLoading: i, data: n } = G({
|
|
18965
18966
|
queryKey: ["productCategories", t, a],
|
|
18966
18967
|
queryFn: async () => {
|
|
18967
18968
|
const { status: o, body: l } = await r.productCategory.getProductCategory({
|
|
@@ -18992,7 +18993,7 @@ function Wc() {
|
|
|
18992
18993
|
/* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the product category." })
|
|
18993
18994
|
] }),
|
|
18994
18995
|
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: i || !n ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-[500px] mt-5", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
|
|
18995
|
-
/* @__PURE__ */ e(
|
|
18996
|
+
/* @__PURE__ */ e(fe, { className: "w-12 h-12" }),
|
|
18996
18997
|
/* @__PURE__ */ e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })
|
|
18997
18998
|
] }) }) : /* @__PURE__ */ e(sn, { initialData: n }) })
|
|
18998
18999
|
] }) }) }) })
|
|
@@ -19221,7 +19222,7 @@ const $c = ({ form: t }) => {
|
|
|
19221
19222
|
initialData: r,
|
|
19222
19223
|
onSubmit: i
|
|
19223
19224
|
}) => {
|
|
19224
|
-
const { defaultLocale: n, supportedLocales: o } =
|
|
19225
|
+
const { defaultLocale: n, supportedLocales: o } = pe(), l = de({
|
|
19225
19226
|
resolver: ce(js),
|
|
19226
19227
|
defaultValues: r ? {
|
|
19227
19228
|
...r,
|
|
@@ -19246,10 +19247,10 @@ const $c = ({ form: t }) => {
|
|
|
19246
19247
|
// Initial modifier value
|
|
19247
19248
|
});
|
|
19248
19249
|
};
|
|
19249
|
-
return /* @__PURE__ */ e(
|
|
19250
|
-
/* @__PURE__ */ s(
|
|
19251
|
-
/* @__PURE__ */ e(
|
|
19252
|
-
/* @__PURE__ */ e(
|
|
19250
|
+
return /* @__PURE__ */ e(Qt, { open: t, onOpenChange: a, children: /* @__PURE__ */ s(It, { className: "max-w-[710px]", children: [
|
|
19251
|
+
/* @__PURE__ */ s(Lt, { children: [
|
|
19252
|
+
/* @__PURE__ */ e(Et, { children: "New Modifier Group" }),
|
|
19253
|
+
/* @__PURE__ */ e(Dt, { className: "text-sm mb-5", children: "Modifiers allow you to create different variants of the same product. Create or choose existing modifiers for your product." })
|
|
19253
19254
|
] }),
|
|
19254
19255
|
/* @__PURE__ */ s(Ge, { ...l, children: [
|
|
19255
19256
|
/* @__PURE__ */ e(
|
|
@@ -19316,7 +19317,7 @@ const $c = ({ form: t }) => {
|
|
|
19316
19317
|
variant: "destructive",
|
|
19317
19318
|
className: "mt-auto ml-4 min-w-[42px] h-[42px] p-0! shadow-none!",
|
|
19318
19319
|
onClick: () => u(h),
|
|
19319
|
-
children: /* @__PURE__ */ e(
|
|
19320
|
+
children: /* @__PURE__ */ e(Kt, { className: "w-4 h-4" })
|
|
19320
19321
|
}
|
|
19321
19322
|
)
|
|
19322
19323
|
] }, m.id)),
|
|
@@ -19355,7 +19356,7 @@ const $c = ({ form: t }) => {
|
|
|
19355
19356
|
] })
|
|
19356
19357
|
] }) });
|
|
19357
19358
|
}, Gc = ({ form: t }) => {
|
|
19358
|
-
const { control: a } = t, { defaultLocale: r } =
|
|
19359
|
+
const { control: a } = t, { defaultLocale: r } = pe(), {
|
|
19359
19360
|
fields: i,
|
|
19360
19361
|
append: n,
|
|
19361
19362
|
remove: o,
|
|
@@ -19365,28 +19366,28 @@ const $c = ({ form: t }) => {
|
|
|
19365
19366
|
name: "modifierGroups"
|
|
19366
19367
|
}), [d, c] = I(!1), [u, p] = I(
|
|
19367
19368
|
null
|
|
19368
|
-
), m = () => crypto.randomUUID(), h = (
|
|
19369
|
+
), m = () => crypto.randomUUID(), h = (w) => {
|
|
19369
19370
|
var k;
|
|
19370
19371
|
return {
|
|
19371
|
-
...
|
|
19372
|
-
id:
|
|
19373
|
-
defaultLocale:
|
|
19374
|
-
modifiers: ((k =
|
|
19372
|
+
...w,
|
|
19373
|
+
id: w.id ?? m(),
|
|
19374
|
+
defaultLocale: w.defaultLocale ?? r,
|
|
19375
|
+
modifiers: ((k = w.modifiers) == null ? void 0 : k.map((v) => ({
|
|
19375
19376
|
...v,
|
|
19376
19377
|
id: v.id ?? m()
|
|
19377
19378
|
}))) ?? []
|
|
19378
19379
|
};
|
|
19379
|
-
}, f = (
|
|
19380
|
-
|
|
19381
|
-
}, y = (
|
|
19382
|
-
p(
|
|
19383
|
-
}, b = (
|
|
19380
|
+
}, f = (w) => {
|
|
19381
|
+
w.preventDefault(), p(null), c(!0);
|
|
19382
|
+
}, y = (w) => {
|
|
19383
|
+
p(w), c(!0);
|
|
19384
|
+
}, b = (w) => {
|
|
19384
19385
|
if (u === null) {
|
|
19385
|
-
n(h(
|
|
19386
|
+
n(h(w)), c(!1);
|
|
19386
19387
|
return;
|
|
19387
19388
|
}
|
|
19388
|
-
l(u, h(
|
|
19389
|
-
},
|
|
19389
|
+
l(u, h(w)), c(!1);
|
|
19390
|
+
}, S = () => {
|
|
19390
19391
|
n({
|
|
19391
19392
|
id: m(),
|
|
19392
19393
|
defaultLocale: r,
|
|
@@ -19447,7 +19448,7 @@ const $c = ({ form: t }) => {
|
|
|
19447
19448
|
type: "button",
|
|
19448
19449
|
variant: "secondary",
|
|
19449
19450
|
className: "shadow-none",
|
|
19450
|
-
onClick:
|
|
19451
|
+
onClick: S,
|
|
19451
19452
|
children: [
|
|
19452
19453
|
/* @__PURE__ */ e(fr, { className: "w-4 h-4 mr-2" }),
|
|
19453
19454
|
" Add From Template"
|
|
@@ -19476,7 +19477,7 @@ const $c = ({ form: t }) => {
|
|
|
19476
19477
|
type: "button",
|
|
19477
19478
|
variant: "secondary",
|
|
19478
19479
|
className: "shadow-none",
|
|
19479
|
-
onClick:
|
|
19480
|
+
onClick: S,
|
|
19480
19481
|
children: [
|
|
19481
19482
|
/* @__PURE__ */ e(fr, { className: "w-4 h-4 mr-2" }),
|
|
19482
19483
|
" Add From Template"
|
|
@@ -19497,11 +19498,11 @@ const $c = ({ form: t }) => {
|
|
|
19497
19498
|
}
|
|
19498
19499
|
)
|
|
19499
19500
|
] }),
|
|
19500
|
-
/* @__PURE__ */ e("div", { className: "space-y-4", children: i.map((
|
|
19501
|
+
/* @__PURE__ */ e("div", { className: "space-y-4", children: i.map((w, k) => {
|
|
19501
19502
|
var v;
|
|
19502
19503
|
return /* @__PURE__ */ s("div", { className: "p-4 border rounded-md", children: [
|
|
19503
19504
|
/* @__PURE__ */ s("div", { className: "flex justify-between items-center", children: [
|
|
19504
|
-
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children:
|
|
19505
|
+
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children: w.translations[0].title || "Unnamed Group" }),
|
|
19505
19506
|
/* @__PURE__ */ s("div", { children: [
|
|
19506
19507
|
/* @__PURE__ */ e(
|
|
19507
19508
|
"button",
|
|
@@ -19525,16 +19526,16 @@ const $c = ({ form: t }) => {
|
|
|
19525
19526
|
] }),
|
|
19526
19527
|
/* @__PURE__ */ s("p", { className: "text-sm text-gray-500 mt-3", children: [
|
|
19527
19528
|
"Min: ",
|
|
19528
|
-
|
|
19529
|
+
w.selectMin,
|
|
19529
19530
|
" | Max: ",
|
|
19530
|
-
|
|
19531
|
+
w.selectMax
|
|
19531
19532
|
] }),
|
|
19532
19533
|
/* @__PURE__ */ s("p", { className: "text-sm text-gray-500 mt-1", children: [
|
|
19533
19534
|
"Available Options:",
|
|
19534
19535
|
" ",
|
|
19535
|
-
(v =
|
|
19536
|
+
(v = w.modifiers) == null ? void 0 : v.map((A) => A == null ? void 0 : A.title).join(",")
|
|
19536
19537
|
] })
|
|
19537
|
-
] },
|
|
19538
|
+
] }, w.id);
|
|
19538
19539
|
}) })
|
|
19539
19540
|
] }) })
|
|
19540
19541
|
] }),
|
|
@@ -19551,46 +19552,49 @@ const $c = ({ form: t }) => {
|
|
|
19551
19552
|
u
|
|
19552
19553
|
)
|
|
19553
19554
|
] });
|
|
19554
|
-
}, Kc = ({ form: t, loading: a }) =>
|
|
19555
|
-
|
|
19556
|
-
|
|
19557
|
-
|
|
19555
|
+
}, Kc = ({ form: t, loading: a }) => {
|
|
19556
|
+
const { defaultCurrency: r } = pe();
|
|
19557
|
+
return /* @__PURE__ */ e("section", { "aria-labelledby": "product-information", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [
|
|
19558
|
+
/* @__PURE__ */ s("div", { children: [
|
|
19559
|
+
/* @__PURE__ */ e(
|
|
19560
|
+
"h2",
|
|
19561
|
+
{
|
|
19562
|
+
id: "product-information",
|
|
19563
|
+
className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50",
|
|
19564
|
+
children: "Pricing"
|
|
19565
|
+
}
|
|
19566
|
+
),
|
|
19567
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the pricing details of your product, including the base price and discounted price." })
|
|
19568
|
+
] }),
|
|
19569
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e(Ee, { form: t, config: [
|
|
19558
19570
|
{
|
|
19559
|
-
|
|
19560
|
-
|
|
19561
|
-
|
|
19571
|
+
name: "basePrice",
|
|
19572
|
+
label: "Base Price",
|
|
19573
|
+
type: "number",
|
|
19574
|
+
placeholder: "Enter base price",
|
|
19575
|
+
prefix: r
|
|
19576
|
+
},
|
|
19577
|
+
{
|
|
19578
|
+
name: "discountedBasePrice",
|
|
19579
|
+
label: "Discounted Price",
|
|
19580
|
+
type: "number",
|
|
19581
|
+
placeholder: "Enter discounted price",
|
|
19582
|
+
prefix: r
|
|
19562
19583
|
}
|
|
19563
|
-
)
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
name: "basePrice",
|
|
19569
|
-
label: "Base Price",
|
|
19570
|
-
type: "number",
|
|
19571
|
-
placeholder: "Enter base price",
|
|
19572
|
-
prefix: "USD"
|
|
19573
|
-
},
|
|
19574
|
-
{
|
|
19575
|
-
name: "discountedBasePrice",
|
|
19576
|
-
label: "Discounted Price",
|
|
19577
|
-
type: "number",
|
|
19578
|
-
placeholder: "Enter discounted price",
|
|
19579
|
-
prefix: "USD"
|
|
19580
|
-
}
|
|
19581
|
-
], loading: a }) })
|
|
19582
|
-
] }) }), nn = ({ initialData: t }) => {
|
|
19583
|
-
var y, b;
|
|
19584
|
-
const { client: a } = L(), r = K(), i = te(), n = ee(), o = Tt(), { defaultLocale: l, supportedLocales: d } = ye(), u = de({
|
|
19584
|
+
], loading: a }) })
|
|
19585
|
+
] }) });
|
|
19586
|
+
}, nn = ({ initialData: t }) => {
|
|
19587
|
+
var b, S;
|
|
19588
|
+
const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultCurrency: o, defaultLocale: l, supportedLocales: d } = pe(), c = t == null ? void 0 : t.id, p = de({
|
|
19585
19589
|
resolver: ce(t ? Uo : Zo),
|
|
19586
19590
|
defaultValues: t ? {
|
|
19587
19591
|
...t,
|
|
19588
19592
|
defaultLocale: l,
|
|
19589
|
-
categories: (
|
|
19593
|
+
categories: (b = t.categories) == null ? void 0 : b.map((w) => w.id),
|
|
19590
19594
|
translations: t.translations,
|
|
19591
19595
|
images: t.images,
|
|
19592
19596
|
metadata: t.metadata,
|
|
19593
|
-
modifierGroups: (
|
|
19597
|
+
modifierGroups: (S = t.modifierGroups) == null ? void 0 : S.map((w) => ({
|
|
19594
19598
|
...w,
|
|
19595
19599
|
defaultLocale: l,
|
|
19596
19600
|
translations: w.translations,
|
|
@@ -19599,46 +19603,46 @@ const $c = ({ form: t }) => {
|
|
|
19599
19603
|
} : {
|
|
19600
19604
|
defaultLocale: l,
|
|
19601
19605
|
translations: d.map((w) => ({ locale: w })),
|
|
19602
|
-
currency:
|
|
19606
|
+
currency: o
|
|
19603
19607
|
}
|
|
19604
|
-
}),
|
|
19608
|
+
}), m = $({
|
|
19605
19609
|
mutationFn: async (w) => {
|
|
19606
|
-
const { status:
|
|
19610
|
+
const { status: k } = await a.product.createProduct({
|
|
19607
19611
|
params: { organizationId: n },
|
|
19608
19612
|
body: w
|
|
19609
19613
|
});
|
|
19610
|
-
if (
|
|
19614
|
+
if (k !== 201)
|
|
19611
19615
|
throw new Error("Failed to create product");
|
|
19612
19616
|
}
|
|
19613
|
-
}),
|
|
19617
|
+
}), h = $({
|
|
19614
19618
|
mutationFn: async (w) => {
|
|
19615
|
-
const { status:
|
|
19616
|
-
params: { organizationId: n, id:
|
|
19619
|
+
const { status: k } = await a.product.updateProduct({
|
|
19620
|
+
params: { organizationId: n, id: c },
|
|
19617
19621
|
body: w
|
|
19618
19622
|
});
|
|
19619
|
-
if (
|
|
19623
|
+
if (k !== 200)
|
|
19620
19624
|
throw new Error("Failed to update product");
|
|
19621
19625
|
}
|
|
19622
|
-
}),
|
|
19623
|
-
se.success("Product saved successfully"), r.push(i.products(n)), await Ie.invalidateQueries({ queryKey: ["products"] }), await Ie.invalidateQueries({
|
|
19624
|
-
queryKey: ["product", n,
|
|
19626
|
+
}), f = async () => {
|
|
19627
|
+
se.success("Product saved successfully"), r.push(i.products(n)), await Ie.invalidateQueries({ queryKey: ["products"] }), c && await Ie.invalidateQueries({
|
|
19628
|
+
queryKey: ["product", n, c]
|
|
19625
19629
|
});
|
|
19626
|
-
},
|
|
19627
|
-
t ?
|
|
19630
|
+
}, y = (w) => {
|
|
19631
|
+
t ? h.mutate(w, { onSuccess: f }) : m.mutate(w, { onSuccess: f });
|
|
19628
19632
|
};
|
|
19629
|
-
return
|
|
19633
|
+
return /* @__PURE__ */ e(Ge, { ...p, children: /* @__PURE__ */ s(
|
|
19630
19634
|
"form",
|
|
19631
19635
|
{
|
|
19632
|
-
onSubmit:
|
|
19636
|
+
onSubmit: p.handleSubmit((w) => y(w)),
|
|
19633
19637
|
className: "space-y-14",
|
|
19634
19638
|
children: [
|
|
19635
|
-
/* @__PURE__ */ e($c, { form:
|
|
19639
|
+
/* @__PURE__ */ e($c, { form: p }),
|
|
19636
19640
|
/* @__PURE__ */ e(q, {}),
|
|
19637
|
-
/* @__PURE__ */ e(Kc, { form:
|
|
19641
|
+
/* @__PURE__ */ e(Kc, { form: p }),
|
|
19638
19642
|
/* @__PURE__ */ e(q, {}),
|
|
19639
|
-
/* @__PURE__ */ e(Gc, { form:
|
|
19643
|
+
/* @__PURE__ */ e(Gc, { form: p }),
|
|
19640
19644
|
/* @__PURE__ */ e(q, {}),
|
|
19641
|
-
/* @__PURE__ */ e(_c, { form:
|
|
19645
|
+
/* @__PURE__ */ e(_c, { form: p }),
|
|
19642
19646
|
/* @__PURE__ */ e(q, {}),
|
|
19643
19647
|
/* @__PURE__ */ s("div", { className: "flex justify-end space-x-3", children: [
|
|
19644
19648
|
/* @__PURE__ */ s(
|
|
@@ -19648,7 +19652,7 @@ const $c = ({ form: t }) => {
|
|
|
19648
19652
|
variant: "secondary",
|
|
19649
19653
|
onClick: () => r.push(i.products(n)),
|
|
19650
19654
|
children: [
|
|
19651
|
-
/* @__PURE__ */ e(
|
|
19655
|
+
/* @__PURE__ */ e(Xt, { className: "w-4 h-4 mr-2" }),
|
|
19652
19656
|
" Cancel"
|
|
19653
19657
|
]
|
|
19654
19658
|
}
|
|
@@ -19657,7 +19661,7 @@ const $c = ({ form: t }) => {
|
|
|
19657
19661
|
T,
|
|
19658
19662
|
{
|
|
19659
19663
|
type: "submit",
|
|
19660
|
-
isLoading:
|
|
19664
|
+
isLoading: m.isPending || h.isPending,
|
|
19661
19665
|
loadingText: "Saving...",
|
|
19662
19666
|
children: [
|
|
19663
19667
|
/* @__PURE__ */ e(ts, { className: "w-4 h-4 mr-2" }),
|
|
@@ -19679,7 +19683,7 @@ function Xc() {
|
|
|
19679
19683
|
] });
|
|
19680
19684
|
}
|
|
19681
19685
|
function Yc() {
|
|
19682
|
-
const t = ee(), a =
|
|
19686
|
+
const t = ee(), a = ha(), { client: r } = L(), { data: i, isLoading: n } = G({
|
|
19683
19687
|
queryKey: ["product", t, a],
|
|
19684
19688
|
queryFn: async () => {
|
|
19685
19689
|
const { status: o, body: l } = await r.product.getProduct({
|
|
@@ -19693,7 +19697,7 @@ function Yc() {
|
|
|
19693
19697
|
return /* @__PURE__ */ s("div", { className: "space-y-6", children: [
|
|
19694
19698
|
/* @__PURE__ */ e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Edit Product" }),
|
|
19695
19699
|
/* @__PURE__ */ e(q, {}),
|
|
19696
|
-
n ? /* @__PURE__ */ e("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e(
|
|
19700
|
+
n ? /* @__PURE__ */ e("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e(fe, { className: "w-8 h-8" }) }) : /* @__PURE__ */ e("div", { className: "pt-6", children: /* @__PURE__ */ e(nn, { initialData: i }) })
|
|
19697
19701
|
] });
|
|
19698
19702
|
}
|
|
19699
19703
|
const Be = ot(), e0 = ({ row: t, table: a }) => {
|
|
@@ -19720,7 +19724,7 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
|
|
|
19720
19724
|
"tremor-id": "tremor-raw",
|
|
19721
19725
|
disabled: !0,
|
|
19722
19726
|
children: [
|
|
19723
|
-
/* @__PURE__ */ e(
|
|
19727
|
+
/* @__PURE__ */ e(fe, { className: "w-4 h-4" }),
|
|
19724
19728
|
" Saving..."
|
|
19725
19729
|
]
|
|
19726
19730
|
}
|
|
@@ -19731,7 +19735,7 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
|
|
|
19731
19735
|
className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600",
|
|
19732
19736
|
"tremor-id": "tremor-raw",
|
|
19733
19737
|
children: [
|
|
19734
|
-
i ? /* @__PURE__ */ e(
|
|
19738
|
+
i ? /* @__PURE__ */ e(Yt, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" }) : /* @__PURE__ */ e(Xr, { className: "w-4 h-4 text-red-600 dark:text-red-500" }),
|
|
19735
19739
|
i ? "Published" : "Draft"
|
|
19736
19740
|
]
|
|
19737
19741
|
}
|
|
@@ -19761,8 +19765,8 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
|
|
|
19761
19765
|
variant: "ghost",
|
|
19762
19766
|
className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900",
|
|
19763
19767
|
disabled: o.isPending,
|
|
19764
|
-
children: o.isPending ? /* @__PURE__ */ e(
|
|
19765
|
-
|
|
19768
|
+
children: o.isPending ? /* @__PURE__ */ e(fe, { className: "size-4 shrink-0" }) : /* @__PURE__ */ e(
|
|
19769
|
+
aa,
|
|
19766
19770
|
{
|
|
19767
19771
|
className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300",
|
|
19768
19772
|
"aria-hidden": "true"
|
|
@@ -19789,7 +19793,7 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
|
|
|
19789
19793
|
onClick: l,
|
|
19790
19794
|
disabled: o.isPending,
|
|
19791
19795
|
children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
19792
|
-
o.isPending ? /* @__PURE__ */ e(
|
|
19796
|
+
o.isPending ? /* @__PURE__ */ e(fe, { className: "w-4 h-4" }) : /* @__PURE__ */ e(es, { className: "w-4 h-4" }),
|
|
19793
19797
|
o.isPending ? "Deleting..." : "Delete"
|
|
19794
19798
|
] })
|
|
19795
19799
|
}
|
|
@@ -19920,8 +19924,14 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
|
|
|
19920
19924
|
cell: ({ row: t, table: a }) => /* @__PURE__ */ e(t0, { row: t, table: a })
|
|
19921
19925
|
})
|
|
19922
19926
|
], r0 = () => {
|
|
19923
|
-
const { client: t } = L(), a = te(), { defaultLocale: r } =
|
|
19924
|
-
queryKey: [
|
|
19927
|
+
const { client: t } = L(), a = te(), { defaultLocale: r } = pe(), i = ee(), n = ye(), [o, l] = I(""), [d] = Xe(o, 300), c = Number((n == null ? void 0 : n.get("page")) || "1"), { isLoading: u, isRefetching: p, isError: m, data: h, refetch: f } = G({
|
|
19928
|
+
queryKey: [
|
|
19929
|
+
"products",
|
|
19930
|
+
i,
|
|
19931
|
+
c,
|
|
19932
|
+
d,
|
|
19933
|
+
r
|
|
19934
|
+
],
|
|
19925
19935
|
queryFn: async () => {
|
|
19926
19936
|
const { body: y, status: b } = await t.product.getProducts({
|
|
19927
19937
|
params: {
|
|
@@ -19993,12 +20003,12 @@ const i0 = ({
|
|
|
19993
20003
|
}) => {
|
|
19994
20004
|
var b;
|
|
19995
20005
|
const { client: o } = L(), l = $({
|
|
19996
|
-
mutationFn: async ({ operation:
|
|
20006
|
+
mutationFn: async ({ operation: S }) => {
|
|
19997
20007
|
if ((await o.reservation.updateReservationStatus({
|
|
19998
20008
|
params: {
|
|
19999
20009
|
organizationId: t,
|
|
20000
20010
|
reservationId: a,
|
|
20001
|
-
operation:
|
|
20011
|
+
operation: S
|
|
20002
20012
|
},
|
|
20003
20013
|
body: {}
|
|
20004
20014
|
})).status !== 200)
|
|
@@ -20031,12 +20041,12 @@ const i0 = ({
|
|
|
20031
20041
|
className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600",
|
|
20032
20042
|
children: [
|
|
20033
20043
|
u && p === "accept" ? "Loading..." : "Accept",
|
|
20034
|
-
/* @__PURE__ */ e(
|
|
20044
|
+
/* @__PURE__ */ e(Yt, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" })
|
|
20035
20045
|
]
|
|
20036
20046
|
}
|
|
20037
20047
|
)
|
|
20038
20048
|
] });
|
|
20039
|
-
}, n0 = ({ open: t, onOpenChange: a, reservation: r }) => /* @__PURE__ */ e(
|
|
20049
|
+
}, n0 = ({ open: t, onOpenChange: a, reservation: r }) => /* @__PURE__ */ e(la, { open: t, onOpenChange: a, children: /* @__PURE__ */ s(da, { className: "sm:max-w-[500px] overflow-y-auto max-h-[85vh]", children: [
|
|
20040
20050
|
/* @__PURE__ */ e(ai, { children: /* @__PURE__ */ e(_a, { children: "Reservation Details" }) }),
|
|
20041
20051
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 py-4", children: [
|
|
20042
20052
|
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
@@ -20209,7 +20219,7 @@ const i0 = ({
|
|
|
20209
20219
|
cell: ({ row: t, table: a }) => /* @__PURE__ */ e(l0, { reservation: t.original, table: a })
|
|
20210
20220
|
})
|
|
20211
20221
|
], c0 = () => {
|
|
20212
|
-
const { client: t } = L(), a = ee(), r =
|
|
20222
|
+
const { client: t } = L(), a = ee(), r = ye(), [i, n] = I(""), [o] = Xe(i, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: c, isError: u, data: p, refetch: m } = G({
|
|
20213
20223
|
queryKey: ["reservations", a, l, o],
|
|
20214
20224
|
queryFn: async () => {
|
|
20215
20225
|
const { body: h, status: f } = await t.reservation.getReservations({
|
|
@@ -20574,7 +20584,7 @@ function g0() {
|
|
|
20574
20584
|
}
|
|
20575
20585
|
const h0 = () => {
|
|
20576
20586
|
var d;
|
|
20577
|
-
const [t, a] = R.useState(!1), r = R.useRef(null), { organizations: i, organization: n } =
|
|
20587
|
+
const [t, a] = R.useState(!1), r = R.useRef(null), { organizations: i, organization: n } = pe(), o = K(), l = te();
|
|
20578
20588
|
return /* @__PURE__ */ e(C, { children: /* @__PURE__ */ s(
|
|
20579
20589
|
He,
|
|
20580
20590
|
{
|
|
@@ -20591,7 +20601,7 @@ const h0 = () => {
|
|
|
20591
20601
|
),
|
|
20592
20602
|
children: [
|
|
20593
20603
|
n.data.logoFile ? /* @__PURE__ */ e(
|
|
20594
|
-
|
|
20604
|
+
he,
|
|
20595
20605
|
{
|
|
20596
20606
|
src: n.data.logoFile.url,
|
|
20597
20607
|
alt: n.data.name,
|
|
@@ -20647,7 +20657,7 @@ const h0 = () => {
|
|
|
20647
20657
|
onClick: () => o.push(l.dashboard(c.id)),
|
|
20648
20658
|
children: /* @__PURE__ */ s("div", { className: "flex w-full items-center gap-x-2.5", children: [
|
|
20649
20659
|
c.logoFile ? /* @__PURE__ */ e(
|
|
20650
|
-
|
|
20660
|
+
he,
|
|
20651
20661
|
{
|
|
20652
20662
|
src: c.logoFile.url,
|
|
20653
20663
|
alt: c.name,
|
|
@@ -20682,7 +20692,7 @@ const h0 = () => {
|
|
|
20682
20692
|
}
|
|
20683
20693
|
) });
|
|
20684
20694
|
}, f0 = () => {
|
|
20685
|
-
const [t, a] = R.useState(!1), r = R.useRef(null), { organizations: i, organization: n } =
|
|
20695
|
+
const [t, a] = R.useState(!1), r = R.useRef(null), { organizations: i, organization: n } = pe(), o = K(), l = te();
|
|
20686
20696
|
return /* @__PURE__ */ s(
|
|
20687
20697
|
He,
|
|
20688
20698
|
{
|
|
@@ -20692,7 +20702,7 @@ const h0 = () => {
|
|
|
20692
20702
|
children: [
|
|
20693
20703
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: n.data && /* @__PURE__ */ s("button", { className: "flex items-center gap-x-1.5 rounded-md p-2 hover:bg-gray-100 focus:outline-hidden dark:hover:bg-gray-900", children: [
|
|
20694
20704
|
n.data.logoFile ? /* @__PURE__ */ e(
|
|
20695
|
-
|
|
20705
|
+
he,
|
|
20696
20706
|
{
|
|
20697
20707
|
src: n.data.logoFile.url,
|
|
20698
20708
|
alt: n.data.name,
|
|
@@ -20750,7 +20760,7 @@ const h0 = () => {
|
|
|
20750
20760
|
onClick: () => o.push(l.dashboard(d.id)),
|
|
20751
20761
|
children: /* @__PURE__ */ s("div", { className: "flex w-full items-center gap-x-2.5", children: [
|
|
20752
20762
|
d.logoFile ? /* @__PURE__ */ e(
|
|
20753
|
-
|
|
20763
|
+
he,
|
|
20754
20764
|
{
|
|
20755
20765
|
src: d.logoFile.url,
|
|
20756
20766
|
alt: d.name,
|
|
@@ -20814,7 +20824,7 @@ function fn({
|
|
|
20814
20824
|
},
|
|
20815
20825
|
children: [
|
|
20816
20826
|
/* @__PURE__ */ s(
|
|
20817
|
-
|
|
20827
|
+
Ht,
|
|
20818
20828
|
{
|
|
20819
20829
|
"aria-label": "Switch to Light Mode",
|
|
20820
20830
|
value: "light",
|
|
@@ -20826,7 +20836,7 @@ function fn({
|
|
|
20826
20836
|
}
|
|
20827
20837
|
),
|
|
20828
20838
|
/* @__PURE__ */ s(
|
|
20829
|
-
|
|
20839
|
+
Ht,
|
|
20830
20840
|
{
|
|
20831
20841
|
"aria-label": "Switch to Dark Mode",
|
|
20832
20842
|
value: "dark",
|
|
@@ -20844,7 +20854,7 @@ function fn({
|
|
|
20844
20854
|
}
|
|
20845
20855
|
),
|
|
20846
20856
|
/* @__PURE__ */ s(
|
|
20847
|
-
|
|
20857
|
+
Ht,
|
|
20848
20858
|
{
|
|
20849
20859
|
"aria-label": "Switch to System Mode",
|
|
20850
20860
|
value: "system",
|
|
@@ -21154,7 +21164,7 @@ const S0 = [
|
|
|
21154
21164
|
);
|
|
21155
21165
|
};
|
|
21156
21166
|
function v0() {
|
|
21157
|
-
const { organization: t } =
|
|
21167
|
+
const { organization: t } = pe();
|
|
21158
21168
|
return t.data ? /* @__PURE__ */ e("div", { className: "space-y-10", children: /* @__PURE__ */ e("section", { "aria-labelledby": "opening-times", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [
|
|
21159
21169
|
/* @__PURE__ */ s("div", { children: [
|
|
21160
21170
|
/* @__PURE__ */ e(
|
|
@@ -21275,7 +21285,7 @@ const A0 = [
|
|
|
21275
21285
|
);
|
|
21276
21286
|
yn.displayName = "Card";
|
|
21277
21287
|
function R0() {
|
|
21278
|
-
const { organization: t } =
|
|
21288
|
+
const { organization: t } = pe();
|
|
21279
21289
|
return t.data ? /* @__PURE__ */ s("div", { className: "space-y-10", children: [
|
|
21280
21290
|
/* @__PURE__ */ e("section", { "aria-labelledby": "org-information", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [
|
|
21281
21291
|
/* @__PURE__ */ s("div", { children: [
|
|
@@ -21522,7 +21532,7 @@ const wn = ({
|
|
|
21522
21532
|
variant: "secondary",
|
|
21523
21533
|
onClick: () => r.push(i.settingsShippingMethods(n)),
|
|
21524
21534
|
children: [
|
|
21525
|
-
/* @__PURE__ */ e(
|
|
21535
|
+
/* @__PURE__ */ e(Xt, { className: "w-4 h-4 mr-2" }),
|
|
21526
21536
|
" Cancel"
|
|
21527
21537
|
]
|
|
21528
21538
|
}
|
|
@@ -21553,7 +21563,7 @@ function C0() {
|
|
|
21553
21563
|
] });
|
|
21554
21564
|
}
|
|
21555
21565
|
function P0() {
|
|
21556
|
-
const t = ee(), a =
|
|
21566
|
+
const t = ee(), a = ha(), { client: r } = L(), { isLoading: i, data: n } = G({
|
|
21557
21567
|
queryKey: ["shipping-and-payment", t, a],
|
|
21558
21568
|
queryFn: async () => {
|
|
21559
21569
|
const { status: o, body: l } = await r.shippingMethod.getShippingMethod({
|
|
@@ -21572,7 +21582,7 @@ function P0() {
|
|
|
21572
21582
|
/* @__PURE__ */ e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Shipping Method" }),
|
|
21573
21583
|
/* @__PURE__ */ e(q, {}),
|
|
21574
21584
|
/* @__PURE__ */ e("div", { className: "pt-6", children: /* @__PURE__ */ e("div", { className: "space-y-10", children: i || !n ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen mt-5", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
|
|
21575
|
-
/* @__PURE__ */ e(
|
|
21585
|
+
/* @__PURE__ */ e(fe, { className: "w-12 h-12" }),
|
|
21576
21586
|
/* @__PURE__ */ e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })
|
|
21577
21587
|
] }) }) : /* @__PURE__ */ e(wn, { initialData: n }) }) })
|
|
21578
21588
|
] });
|
|
@@ -21670,7 +21680,7 @@ const rt = ot(), T0 = [
|
|
|
21670
21680
|
variant: "ghost",
|
|
21671
21681
|
className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900",
|
|
21672
21682
|
children: /* @__PURE__ */ e(
|
|
21673
|
-
|
|
21683
|
+
aa,
|
|
21674
21684
|
{
|
|
21675
21685
|
className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300",
|
|
21676
21686
|
"aria-hidden": "true"
|
|
@@ -21693,7 +21703,7 @@ const rt = ot(), T0 = [
|
|
|
21693
21703
|
}
|
|
21694
21704
|
})
|
|
21695
21705
|
], Q0 = () => {
|
|
21696
|
-
const { client: t } = L(), a = ee(), r =
|
|
21706
|
+
const { client: t } = L(), a = ee(), r = ye(), [i] = I(""), [n] = Xe(i, 300), o = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: l, isRefetching: d, isError: c, data: u } = G({
|
|
21697
21707
|
queryKey: [
|
|
21698
21708
|
"shipping-and-payment",
|
|
21699
21709
|
a,
|
|
@@ -21762,7 +21772,7 @@ function I0() {
|
|
|
21762
21772
|
] });
|
|
21763
21773
|
}
|
|
21764
21774
|
const L0 = () => {
|
|
21765
|
-
const t = K(), a =
|
|
21775
|
+
const t = K(), a = ye(), r = Nt(), i = te(), n = r.signIn, o = ma(
|
|
21766
21776
|
a == null ? void 0 : a.get("redirect"),
|
|
21767
21777
|
i
|
|
21768
21778
|
), {
|
|
@@ -21981,7 +21991,7 @@ const L0 = () => {
|
|
|
21981
21991
|
className: "mt-2 w-full sm:mt-0 shadow-none inline-flex items-center gap-2",
|
|
21982
21992
|
onClick: h,
|
|
21983
21993
|
children: [
|
|
21984
|
-
/* @__PURE__ */ e(
|
|
21994
|
+
/* @__PURE__ */ e(ea, { className: "size-4", "aria-hidden": "true" }),
|
|
21985
21995
|
"Login with Google"
|
|
21986
21996
|
]
|
|
21987
21997
|
}
|
|
@@ -22047,7 +22057,7 @@ function bn({ children: t }) {
|
|
|
22047
22057
|
const { appearance: a } = Is(), r = a == null ? void 0 : a.loginImage;
|
|
22048
22058
|
return /* @__PURE__ */ s("div", { className: "flex w-full min-h-screen", children: [
|
|
22049
22059
|
r && /* @__PURE__ */ e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: /* @__PURE__ */ e(
|
|
22050
|
-
|
|
22060
|
+
he,
|
|
22051
22061
|
{
|
|
22052
22062
|
src: r,
|
|
22053
22063
|
alt: "Login Visual",
|
|
@@ -22063,7 +22073,7 @@ function E0() {
|
|
|
22063
22073
|
return /* @__PURE__ */ e(bn, { children: /* @__PURE__ */ e(L0, {}) });
|
|
22064
22074
|
}
|
|
22065
22075
|
const D0 = () => {
|
|
22066
|
-
const t = K(), a =
|
|
22076
|
+
const t = K(), a = ye(), r = Nt(), i = te(), { signIn: n, signUp: o } = r, l = ma(
|
|
22067
22077
|
a == null ? void 0 : a.get("redirect"),
|
|
22068
22078
|
i
|
|
22069
22079
|
), {
|
|
@@ -22281,7 +22291,7 @@ const D0 = () => {
|
|
|
22281
22291
|
className: "inline-flex items-center gap-2",
|
|
22282
22292
|
onClick: y,
|
|
22283
22293
|
children: [
|
|
22284
|
-
/* @__PURE__ */ e(
|
|
22294
|
+
/* @__PURE__ */ e(ea, { className: "size-4", "aria-hidden": "true" }),
|
|
22285
22295
|
"Signin with Google"
|
|
22286
22296
|
]
|
|
22287
22297
|
}
|
|
@@ -22383,7 +22393,7 @@ function M0(t) {
|
|
|
22383
22393
|
return r ? r === "dashboard" ? { type: "dashboard", orgId: l } : r === "orders" ? { type: "orders", orgId: l } : r === "reservations" ? { type: "reservations", orgId: l } : r === "products" ? i ? i === "create" ? { type: "product-create", orgId: l } : { type: "product-edit", orgId: l, id: i } : { type: "products-list", orgId: l } : r === "product-categories" ? i ? i === "create" ? { type: "product-category-create", orgId: l } : { type: "product-category-edit", orgId: l, id: i } : { type: "product-categories-list", orgId: l } : r === "manufacturers" ? i ? i === "create" ? { type: "manufacturer-create", orgId: l } : { type: "manufacturer-edit", orgId: l, id: i } : { type: "manufacturers-list", orgId: l } : r === "settings" ? i ? i === "opening-times" ? { type: "settings-opening-times", orgId: l } : i === "shipping-methods" ? n ? n === "create" ? { type: "shipping-method-create", orgId: l } : { type: "shipping-method-edit", orgId: l, id: n } : { type: "shipping-methods-list", orgId: l } : { type: "settings", orgId: l } : { type: "settings", orgId: l } : { type: "not-found" } : { type: "not-found" };
|
|
22384
22394
|
}
|
|
22385
22395
|
function zu({ segments: t }) {
|
|
22386
|
-
const a = Nt(), r = te(), i = K(), n = nt(), o =
|
|
22396
|
+
const a = Nt(), r = te(), i = K(), n = nt(), o = ye(), { data: l, isPending: d } = a.useSession(), c = M0(t), u = c.type === "sign-in" || c.type === "sign-up", p = c.type === "home" || c.type === "organizations", m = o == null ? void 0 : o.get("redirect"), h = o == null ? void 0 : o.toString(), f = n ? `${n}${h ? `?${h}` : ""}` : r.home, y = u ? ma(m, r) : f;
|
|
22387
22397
|
if (X(() => {
|
|
22388
22398
|
if (!d) {
|
|
22389
22399
|
if (!l && !u) {
|
|
@@ -22404,8 +22414,8 @@ function zu({ segments: t }) {
|
|
|
22404
22414
|
return /* @__PURE__ */ e(Mr, { children: /* @__PURE__ */ e(Jc, {}) });
|
|
22405
22415
|
if (c.type === "not-found")
|
|
22406
22416
|
return /* @__PURE__ */ e(hi, {});
|
|
22407
|
-
const b = "orgId" in c ? c.orgId : void 0,
|
|
22408
|
-
return /* @__PURE__ */ e(Sd, { organizationId: b, id:
|
|
22417
|
+
const b = "orgId" in c ? c.orgId : void 0, S = "id" in c ? c.id : void 0;
|
|
22418
|
+
return /* @__PURE__ */ e(Sd, { organizationId: b, id: S, children: /* @__PURE__ */ e(Mr, { children: /* @__PURE__ */ e(Ad, { children: /* @__PURE__ */ e(x0, { children: B0(c) }) }) }) });
|
|
22409
22419
|
}
|
|
22410
22420
|
function B0(t) {
|
|
22411
22421
|
switch (t.type) {
|
|
@@ -22448,7 +22458,7 @@ function B0(t) {
|
|
|
22448
22458
|
}
|
|
22449
22459
|
}
|
|
22450
22460
|
export {
|
|
22451
|
-
|
|
22461
|
+
ca as $,
|
|
22452
22462
|
bu as A,
|
|
22453
22463
|
vu as B,
|
|
22454
22464
|
To as C,
|
|
@@ -22475,7 +22485,7 @@ export {
|
|
|
22475
22485
|
oi as X,
|
|
22476
22486
|
Re as Y,
|
|
22477
22487
|
Ql as Z,
|
|
22478
|
-
|
|
22488
|
+
ge as _,
|
|
22479
22489
|
zu as a,
|
|
22480
22490
|
Nu as a0,
|
|
22481
22491
|
qa as a1,
|
|
@@ -22485,9 +22495,9 @@ export {
|
|
|
22485
22495
|
Ya as a5,
|
|
22486
22496
|
yl as a6,
|
|
22487
22497
|
fl as a7,
|
|
22488
|
-
|
|
22498
|
+
la as a8,
|
|
22489
22499
|
ml as a9,
|
|
22490
|
-
|
|
22500
|
+
da as aa,
|
|
22491
22501
|
gl as ab,
|
|
22492
22502
|
hl as ac,
|
|
22493
22503
|
ai as ad,
|
|
@@ -22513,7 +22523,7 @@ export {
|
|
|
22513
22523
|
vo as b,
|
|
22514
22524
|
So as c,
|
|
22515
22525
|
ja as d,
|
|
22516
|
-
|
|
22526
|
+
sa as e,
|
|
22517
22527
|
Lo as f,
|
|
22518
22528
|
ko as g,
|
|
22519
22529
|
Bo as h,
|